var b_=Object.defineProperty;var k_=(Tr,Cr,$r)=>Cr in Tr?b_(Tr,Cr,{enumerable:!0,configurable:!0,writable:!0,value:$r}):Tr[Cr]=$r;var Fa=(Tr,Cr,$r)=>(k_(Tr,typeof Cr!="symbol"?Cr+"":Cr,$r),$r);(function(){try{var Tr=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Cr=new Error().stack;Cr&&(Tr._sentryDebugIds=Tr._sentryDebugIds||{},Tr._sentryDebugIds[Cr]="5adffa95-3094-4506-b2f3-bd34f7d967aa",Tr._sentryDebugIdIdentifier="sentry-dbid-5adffa95-3094-4506-b2f3-bd34f7d967aa")}catch{}})();function makeMap$1(Tr,Cr){const $r=Object.create(null),Ar=Tr.split(",");for(let Rr=0;Rr!!$r[Rr.toLowerCase()]:Rr=>!!$r[Rr]}const EMPTY_OBJ={},EMPTY_ARR=[],NOOP=()=>{},NO=()=>!1,isOn=Tr=>Tr.charCodeAt(0)===111&&Tr.charCodeAt(1)===110&&(Tr.charCodeAt(2)>122||Tr.charCodeAt(2)<97),isModelListener=Tr=>Tr.startsWith("onUpdate:"),extend$1=Object.assign,remove$1=(Tr,Cr)=>{const $r=Tr.indexOf(Cr);$r>-1&&Tr.splice($r,1)},hasOwnProperty$1=Object.prototype.hasOwnProperty,hasOwn$2=(Tr,Cr)=>hasOwnProperty$1.call(Tr,Cr),isArray$4=Array.isArray,isMap=Tr=>toTypeString(Tr)==="[object Map]",isSet=Tr=>toTypeString(Tr)==="[object Set]",isDate$2=Tr=>toTypeString(Tr)==="[object Date]",isRegExp$4=Tr=>toTypeString(Tr)==="[object RegExp]",isFunction$4=Tr=>typeof Tr=="function",isString$7=Tr=>typeof Tr=="string",isSymbol=Tr=>typeof Tr=="symbol",isObject$5=Tr=>Tr!==null&&typeof Tr=="object",isPromise=Tr=>(isObject$5(Tr)||isFunction$4(Tr))&&isFunction$4(Tr.then)&&isFunction$4(Tr.catch),objectToString$1=Object.prototype.toString,toTypeString=Tr=>objectToString$1.call(Tr),toRawType=Tr=>toTypeString(Tr).slice(8,-1),isPlainObject$4=Tr=>toTypeString(Tr)==="[object Object]",isIntegerKey=Tr=>isString$7(Tr)&&Tr!=="NaN"&&Tr[0]!=="-"&&""+parseInt(Tr,10)===Tr,isReservedProp=makeMap$1(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),cacheStringFunction=Tr=>{const Cr=Object.create(null);return $r=>Cr[$r]||(Cr[$r]=Tr($r))},camelizeRE=/-(\w)/g,camelize$2=cacheStringFunction(Tr=>Tr.replace(camelizeRE,(Cr,$r)=>$r?$r.toUpperCase():"")),hyphenateRE=/\B([A-Z])/g,hyphenate=cacheStringFunction(Tr=>Tr.replace(hyphenateRE,"-$1").toLowerCase()),capitalize=cacheStringFunction(Tr=>Tr.charAt(0).toUpperCase()+Tr.slice(1)),toHandlerKey=cacheStringFunction(Tr=>Tr?`on${capitalize(Tr)}`:""),hasChanged=(Tr,Cr)=>!Object.is(Tr,Cr),invokeArrayFns=(Tr,Cr)=>{for(let $r=0;$r{Object.defineProperty(Tr,Cr,{configurable:!0,enumerable:!1,value:$r})},looseToNumber=Tr=>{const Cr=parseFloat(Tr);return isNaN(Cr)?Tr:Cr},toNumber$1=Tr=>{const Cr=isString$7(Tr)?Number(Tr):NaN;return isNaN(Cr)?Tr:Cr};let _globalThis$3;const getGlobalThis=()=>_globalThis$3||(_globalThis$3=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function normalizeStyle(Tr){if(isArray$4(Tr)){const Cr={};for(let $r=0;$r{if($r){const Ar=$r.split(propertyDelimiterRE);Ar.length>1&&(Cr[Ar[0].trim()]=Ar[1].trim())}}),Cr}function normalizeClass(Tr){let Cr="";if(isString$7(Tr))Cr=Tr;else if(isArray$4(Tr))for(let $r=0;$rlooseEqual($r,Cr))}const toDisplayString=Tr=>isString$7(Tr)?Tr:Tr==null?"":isArray$4(Tr)||isObject$5(Tr)&&(Tr.toString===objectToString$1||!isFunction$4(Tr.toString))?JSON.stringify(Tr,replacer,2):String(Tr),replacer=(Tr,Cr)=>Cr&&Cr.__v_isRef?replacer(Tr,Cr.value):isMap(Cr)?{[`Map(${Cr.size})`]:[...Cr.entries()].reduce(($r,[Ar,Rr],Dr)=>($r[stringifySymbol(Ar,Dr)+" =>"]=Rr,$r),{})}:isSet(Cr)?{[`Set(${Cr.size})`]:[...Cr.values()].map($r=>stringifySymbol($r))}:isSymbol(Cr)?stringifySymbol(Cr):isObject$5(Cr)&&!isArray$4(Cr)&&!isPlainObject$4(Cr)?String(Cr):Cr,stringifySymbol=(Tr,Cr="")=>{var $r;return isSymbol(Tr)?`Symbol(${($r=Tr.description)!=null?$r:Cr})`:Tr};let activeEffectScope;class EffectScope{constructor(Cr=!1){this.detached=Cr,this._active=!0,this.effects=[],this.cleanups=[],this.parent=activeEffectScope,!Cr&&activeEffectScope&&(this.index=(activeEffectScope.scopes||(activeEffectScope.scopes=[])).push(this)-1)}get active(){return this._active}run(Cr){if(this._active){const $r=activeEffectScope;try{return activeEffectScope=this,Cr()}finally{activeEffectScope=$r}}}on(){activeEffectScope=this}off(){activeEffectScope=this.parent}stop(Cr){if(this._active){let $r,Ar;for($r=0,Ar=this.effects.length;$r{const Cr=new Set(Tr);return Cr.w=0,Cr.n=0,Cr},wasTracked=Tr=>(Tr.w&trackOpBit)>0,newTracked=Tr=>(Tr.n&trackOpBit)>0,initDepMarkers=({deps:Tr})=>{if(Tr.length)for(let Cr=0;Cr{const{deps:Cr}=Tr;if(Cr.length){let $r=0;for(let Ar=0;Ar{(Hr==="length"||!isSymbol(Hr)&&Hr>=Nr)&&Br.push(Lr)})}else switch($r!==void 0&&Br.push(Mr.get($r)),Cr){case"add":isArray$4(Tr)?isIntegerKey($r)&&Br.push(Mr.get("length")):(Br.push(Mr.get(ITERATE_KEY)),isMap(Tr)&&Br.push(Mr.get(MAP_KEY_ITERATE_KEY)));break;case"delete":isArray$4(Tr)||(Br.push(Mr.get(ITERATE_KEY)),isMap(Tr)&&Br.push(Mr.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap(Tr)&&Br.push(Mr.get(ITERATE_KEY));break}if(Br.length===1)Br[0]&&triggerEffects(Br[0]);else{const Nr=[];for(const Lr of Br)Lr&&Nr.push(...Lr);triggerEffects(createDep(Nr))}}function triggerEffects(Tr,Cr){const $r=isArray$4(Tr)?Tr:[...Tr];for(const Ar of $r)Ar.computed&&triggerEffect(Ar);for(const Ar of $r)Ar.computed||triggerEffect(Ar)}function triggerEffect(Tr,Cr){(Tr!==activeEffect||Tr.allowRecurse)&&(Tr.scheduler?Tr.scheduler():Tr.run())}function getDepFromReactive(Tr,Cr){var $r;return($r=targetMap.get(Tr))==null?void 0:$r.get(Cr)}const isNonTrackableKeys=makeMap$1("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).filter(Tr=>Tr!=="arguments"&&Tr!=="caller").map(Tr=>Symbol[Tr]).filter(isSymbol)),arrayInstrumentations=createArrayInstrumentations();function createArrayInstrumentations(){const Tr={};return["includes","indexOf","lastIndexOf"].forEach(Cr=>{Tr[Cr]=function(...$r){const Ar=toRaw(this);for(let Dr=0,Mr=this.length;Dr{Tr[Cr]=function(...$r){pauseTracking();const Ar=toRaw(this)[Cr].apply(this,$r);return resetTracking(),Ar}}),Tr}function hasOwnProperty(Tr){const Cr=toRaw(this);return track(Cr,"has",Tr),Cr.hasOwnProperty(Tr)}class BaseReactiveHandler{constructor(Cr=!1,$r=!1){this._isReadonly=Cr,this._shallow=$r}get(Cr,$r,Ar){const Rr=this._isReadonly,Dr=this._shallow;if($r==="__v_isReactive")return!Rr;if($r==="__v_isReadonly")return Rr;if($r==="__v_isShallow")return Dr;if($r==="__v_raw")return Ar===(Rr?Dr?shallowReadonlyMap:readonlyMap:Dr?shallowReactiveMap:reactiveMap).get(Cr)||Object.getPrototypeOf(Cr)===Object.getPrototypeOf(Ar)?Cr:void 0;const Mr=isArray$4(Cr);if(!Rr){if(Mr&&hasOwn$2(arrayInstrumentations,$r))return Reflect.get(arrayInstrumentations,$r,Ar);if($r==="hasOwnProperty")return hasOwnProperty}const Br=Reflect.get(Cr,$r,Ar);return(isSymbol($r)?builtInSymbols.has($r):isNonTrackableKeys($r))||(Rr||track(Cr,"get",$r),Dr)?Br:isRef(Br)?Mr&&isIntegerKey($r)?Br:Br.value:isObject$5(Br)?Rr?readonly(Br):reactive(Br):Br}}class MutableReactiveHandler extends BaseReactiveHandler{constructor(Cr=!1){super(!1,Cr)}set(Cr,$r,Ar,Rr){let Dr=Cr[$r];if(!this._shallow){const Nr=isReadonly(Dr);if(!isShallow(Ar)&&!isReadonly(Ar)&&(Dr=toRaw(Dr),Ar=toRaw(Ar)),!isArray$4(Cr)&&isRef(Dr)&&!isRef(Ar))return Nr?!1:(Dr.value=Ar,!0)}const Mr=isArray$4(Cr)&&isIntegerKey($r)?Number($r)Tr,getProto=Tr=>Reflect.getPrototypeOf(Tr);function get$4(Tr,Cr,$r=!1,Ar=!1){Tr=Tr.__v_raw;const Rr=toRaw(Tr),Dr=toRaw(Cr);$r||(hasChanged(Cr,Dr)&&track(Rr,"get",Cr),track(Rr,"get",Dr));const{has:Mr}=getProto(Rr),Br=Ar?toShallow:$r?toReadonly:toReactive;if(Mr.call(Rr,Cr))return Br(Tr.get(Cr));if(Mr.call(Rr,Dr))return Br(Tr.get(Dr));Tr!==Rr&&Tr.get(Cr)}function has$2(Tr,Cr=!1){const $r=this.__v_raw,Ar=toRaw($r),Rr=toRaw(Tr);return Cr||(hasChanged(Tr,Rr)&&track(Ar,"has",Tr),track(Ar,"has",Rr)),Tr===Rr?$r.has(Tr):$r.has(Tr)||$r.has(Rr)}function size$1(Tr,Cr=!1){return Tr=Tr.__v_raw,!Cr&&track(toRaw(Tr),"iterate",ITERATE_KEY),Reflect.get(Tr,"size",Tr)}function add$2(Tr){Tr=toRaw(Tr);const Cr=toRaw(this);return getProto(Cr).has.call(Cr,Tr)||(Cr.add(Tr),trigger(Cr,"add",Tr,Tr)),this}function set$2(Tr,Cr){Cr=toRaw(Cr);const $r=toRaw(this),{has:Ar,get:Rr}=getProto($r);let Dr=Ar.call($r,Tr);Dr||(Tr=toRaw(Tr),Dr=Ar.call($r,Tr));const Mr=Rr.call($r,Tr);return $r.set(Tr,Cr),Dr?hasChanged(Cr,Mr)&&trigger($r,"set",Tr,Cr):trigger($r,"add",Tr,Cr),this}function deleteEntry(Tr){const Cr=toRaw(this),{has:$r,get:Ar}=getProto(Cr);let Rr=$r.call(Cr,Tr);Rr||(Tr=toRaw(Tr),Rr=$r.call(Cr,Tr)),Ar&&Ar.call(Cr,Tr);const Dr=Cr.delete(Tr);return Rr&&trigger(Cr,"delete",Tr,void 0),Dr}function clear(){const Tr=toRaw(this),Cr=Tr.size!==0,$r=Tr.clear();return Cr&&trigger(Tr,"clear",void 0,void 0),$r}function createForEach(Tr,Cr){return function(Ar,Rr){const Dr=this,Mr=Dr.__v_raw,Br=toRaw(Mr),Nr=Cr?toShallow:Tr?toReadonly:toReactive;return!Tr&&track(Br,"iterate",ITERATE_KEY),Mr.forEach((Lr,Hr)=>Ar.call(Rr,Nr(Lr),Nr(Hr),Dr))}}function createIterableMethod(Tr,Cr,$r){return function(...Ar){const Rr=this.__v_raw,Dr=toRaw(Rr),Mr=isMap(Dr),Br=Tr==="entries"||Tr===Symbol.iterator&&Mr,Nr=Tr==="keys"&&Mr,Lr=Rr[Tr](...Ar),Hr=$r?toShallow:Cr?toReadonly:toReactive;return!Cr&&track(Dr,"iterate",Nr?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:zr,done:Ur}=Lr.next();return Ur?{value:zr,done:Ur}:{value:Br?[Hr(zr[0]),Hr(zr[1])]:Hr(zr),done:Ur}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(Tr){return function(...Cr){return Tr==="delete"?!1:Tr==="clear"?void 0:this}}function createInstrumentations(){const Tr={get(Dr){return get$4(this,Dr)},get size(){return size$1(this)},has:has$2,add:add$2,set:set$2,delete:deleteEntry,clear,forEach:createForEach(!1,!1)},Cr={get(Dr){return get$4(this,Dr,!1,!0)},get size(){return size$1(this)},has:has$2,add:add$2,set:set$2,delete:deleteEntry,clear,forEach:createForEach(!1,!0)},$r={get(Dr){return get$4(this,Dr,!0)},get size(){return size$1(this,!0)},has(Dr){return has$2.call(this,Dr,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!1)},Ar={get(Dr){return get$4(this,Dr,!0,!0)},get size(){return size$1(this,!0)},has(Dr){return has$2.call(this,Dr,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(Dr=>{Tr[Dr]=createIterableMethod(Dr,!1,!1),$r[Dr]=createIterableMethod(Dr,!0,!1),Cr[Dr]=createIterableMethod(Dr,!1,!0),Ar[Dr]=createIterableMethod(Dr,!0,!0)}),[Tr,$r,Cr,Ar]}const[mutableInstrumentations,readonlyInstrumentations,shallowInstrumentations,shallowReadonlyInstrumentations]=createInstrumentations();function createInstrumentationGetter(Tr,Cr){const $r=Cr?Tr?shallowReadonlyInstrumentations:shallowInstrumentations:Tr?readonlyInstrumentations:mutableInstrumentations;return(Ar,Rr,Dr)=>Rr==="__v_isReactive"?!Tr:Rr==="__v_isReadonly"?Tr:Rr==="__v_raw"?Ar:Reflect.get(hasOwn$2($r,Rr)&&Rr in Ar?$r:Ar,Rr,Dr)}const mutableCollectionHandlers={get:createInstrumentationGetter(!1,!1)},shallowCollectionHandlers={get:createInstrumentationGetter(!1,!0)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0,!1)},reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(Tr){switch(Tr){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(Tr){return Tr.__v_skip||!Object.isExtensible(Tr)?0:targetTypeMap(toRawType(Tr))}function reactive(Tr){return isReadonly(Tr)?Tr:createReactiveObject(Tr,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function shallowReactive(Tr){return createReactiveObject(Tr,!1,shallowReactiveHandlers,shallowCollectionHandlers,shallowReactiveMap)}function readonly(Tr){return createReactiveObject(Tr,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function createReactiveObject(Tr,Cr,$r,Ar,Rr){if(!isObject$5(Tr)||Tr.__v_raw&&!(Cr&&Tr.__v_isReactive))return Tr;const Dr=Rr.get(Tr);if(Dr)return Dr;const Mr=getTargetType(Tr);if(Mr===0)return Tr;const Br=new Proxy(Tr,Mr===2?Ar:$r);return Rr.set(Tr,Br),Br}function isReactive(Tr){return isReadonly(Tr)?isReactive(Tr.__v_raw):!!(Tr&&Tr.__v_isReactive)}function isReadonly(Tr){return!!(Tr&&Tr.__v_isReadonly)}function isShallow(Tr){return!!(Tr&&Tr.__v_isShallow)}function isProxy(Tr){return isReactive(Tr)||isReadonly(Tr)}function toRaw(Tr){const Cr=Tr&&Tr.__v_raw;return Cr?toRaw(Cr):Tr}function markRaw(Tr){return def(Tr,"__v_skip",!0),Tr}const toReactive=Tr=>isObject$5(Tr)?reactive(Tr):Tr,toReadonly=Tr=>isObject$5(Tr)?readonly(Tr):Tr;function trackRefValue(Tr){shouldTrack&&activeEffect&&(Tr=toRaw(Tr),trackEffects(Tr.dep||(Tr.dep=createDep())))}function triggerRefValue(Tr,Cr){Tr=toRaw(Tr);const $r=Tr.dep;$r&&triggerEffects($r)}function isRef(Tr){return!!(Tr&&Tr.__v_isRef===!0)}function ref(Tr){return createRef(Tr,!1)}function shallowRef(Tr){return createRef(Tr,!0)}function createRef(Tr,Cr){return isRef(Tr)?Tr:new RefImpl(Tr,Cr)}class RefImpl{constructor(Cr,$r){this.__v_isShallow=$r,this.dep=void 0,this.__v_isRef=!0,this._rawValue=$r?Cr:toRaw(Cr),this._value=$r?Cr:toReactive(Cr)}get value(){return trackRefValue(this),this._value}set value(Cr){const $r=this.__v_isShallow||isShallow(Cr)||isReadonly(Cr);Cr=$r?Cr:toRaw(Cr),hasChanged(Cr,this._rawValue)&&(this._rawValue=Cr,this._value=$r?Cr:toReactive(Cr),triggerRefValue(this))}}function unref(Tr){return isRef(Tr)?Tr.value:Tr}const shallowUnwrapHandlers={get:(Tr,Cr,$r)=>unref(Reflect.get(Tr,Cr,$r)),set:(Tr,Cr,$r,Ar)=>{const Rr=Tr[Cr];return isRef(Rr)&&!isRef($r)?(Rr.value=$r,!0):Reflect.set(Tr,Cr,$r,Ar)}};function proxyRefs(Tr){return isReactive(Tr)?Tr:new Proxy(Tr,shallowUnwrapHandlers)}class CustomRefImpl{constructor(Cr){this.dep=void 0,this.__v_isRef=!0;const{get:$r,set:Ar}=Cr(()=>trackRefValue(this),()=>triggerRefValue(this));this._get=$r,this._set=Ar}get value(){return this._get()}set value(Cr){this._set(Cr)}}function customRef(Tr){return new CustomRefImpl(Tr)}function toRefs$1(Tr){const Cr=isArray$4(Tr)?new Array(Tr.length):{};for(const $r in Tr)Cr[$r]=propertyToRef(Tr,$r);return Cr}class ObjectRefImpl{constructor(Cr,$r,Ar){this._object=Cr,this._key=$r,this._defaultValue=Ar,this.__v_isRef=!0}get value(){const Cr=this._object[this._key];return Cr===void 0?this._defaultValue:Cr}set value(Cr){this._object[this._key]=Cr}get dep(){return getDepFromReactive(toRaw(this._object),this._key)}}class GetterRefImpl{constructor(Cr){this._getter=Cr,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function toRef$1(Tr,Cr,$r){return isRef(Tr)?Tr:isFunction$4(Tr)?new GetterRefImpl(Tr):isObject$5(Tr)&&arguments.length>1?propertyToRef(Tr,Cr,$r):ref(Tr)}function propertyToRef(Tr,Cr,$r){const Ar=Tr[Cr];return isRef(Ar)?Ar:new ObjectRefImpl(Tr,Cr,$r)}class ComputedRefImpl{constructor(Cr,$r,Ar,Rr){this._setter=$r,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new ReactiveEffect(Cr,()=>{this._dirty||(this._dirty=!0,triggerRefValue(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!Rr,this.__v_isReadonly=Ar}get value(){const Cr=toRaw(this);return trackRefValue(Cr),(Cr._dirty||!Cr._cacheable)&&(Cr._dirty=!1,Cr._value=Cr.effect.run()),Cr._value}set value(Cr){this._setter(Cr)}}function computed$1(Tr,Cr,$r=!1){let Ar,Rr;const Dr=isFunction$4(Tr);return Dr?(Ar=Tr,Rr=NOOP):(Ar=Tr.get,Rr=Tr.set),new ComputedRefImpl(Ar,Rr,Dr||!Rr,$r)}function warn$2(Tr,...Cr){}function callWithErrorHandling(Tr,Cr,$r,Ar){let Rr;try{Rr=Ar?Tr(...Ar):Tr()}catch(Dr){handleError$2(Dr,Cr,$r)}return Rr}function callWithAsyncErrorHandling(Tr,Cr,$r,Ar){if(isFunction$4(Tr)){const Dr=callWithErrorHandling(Tr,Cr,$r,Ar);return Dr&&isPromise(Dr)&&Dr.catch(Mr=>{handleError$2(Mr,Cr,$r)}),Dr}const Rr=[];for(let Dr=0;Dr>>1,Rr=queue[Ar],Dr=getId(Rr);DrflushIndex&&queue.splice(Cr,1)}function queuePostFlushCb(Tr){isArray$4(Tr)?pendingPostFlushCbs.push(...Tr):(!activePostFlushCbs||!activePostFlushCbs.includes(Tr,Tr.allowRecurse?postFlushIndex+1:postFlushIndex))&&pendingPostFlushCbs.push(Tr),queueFlush()}function flushPreFlushCbs(Tr,Cr,$r=isFlushing?flushIndex+1:0){for(;$rgetId($r)-getId(Ar)),postFlushIndex=0;postFlushIndexTr.id==null?1/0:Tr.id,comparator=(Tr,Cr)=>{const $r=getId(Tr)-getId(Cr);if($r===0){if(Tr.pre&&!Cr.pre)return-1;if(Cr.pre&&!Tr.pre)return 1}return $r};function flushJobs(Tr){isFlushPending=!1,isFlushing=!0,queue.sort(comparator);const Cr=NOOP;try{for(flushIndex=0;flushIndexisString$7(Vr)?Vr.trim():Vr)),zr&&(Rr=$r.map(looseToNumber))}let Br,Nr=Ar[Br=toHandlerKey(Cr)]||Ar[Br=toHandlerKey(camelize$2(Cr))];!Nr&&Dr&&(Nr=Ar[Br=toHandlerKey(hyphenate(Cr))]),Nr&&callWithAsyncErrorHandling(Nr,Tr,6,Rr);const Lr=Ar[Br+"Once"];if(Lr){if(!Tr.emitted)Tr.emitted={};else if(Tr.emitted[Br])return;Tr.emitted[Br]=!0,callWithAsyncErrorHandling(Lr,Tr,6,Rr)}}function normalizeEmitsOptions(Tr,Cr,$r=!1){const Ar=Cr.emitsCache,Rr=Ar.get(Tr);if(Rr!==void 0)return Rr;const Dr=Tr.emits;let Mr={},Br=!1;if(!isFunction$4(Tr)){const Nr=Lr=>{const Hr=normalizeEmitsOptions(Lr,Cr,!0);Hr&&(Br=!0,extend$1(Mr,Hr))};!$r&&Cr.mixins.length&&Cr.mixins.forEach(Nr),Tr.extends&&Nr(Tr.extends),Tr.mixins&&Tr.mixins.forEach(Nr)}return!Dr&&!Br?(isObject$5(Tr)&&Ar.set(Tr,null),null):(isArray$4(Dr)?Dr.forEach(Nr=>Mr[Nr]=null):extend$1(Mr,Dr),isObject$5(Tr)&&Ar.set(Tr,Mr),Mr)}function isEmitListener(Tr,Cr){return!Tr||!isOn(Cr)?!1:(Cr=Cr.slice(2).replace(/Once$/,""),hasOwn$2(Tr,Cr[0].toLowerCase()+Cr.slice(1))||hasOwn$2(Tr,hyphenate(Cr))||hasOwn$2(Tr,Cr))}let currentRenderingInstance=null,currentScopeId=null;function setCurrentRenderingInstance(Tr){const Cr=currentRenderingInstance;return currentRenderingInstance=Tr,currentScopeId=Tr&&Tr.type.__scopeId||null,Cr}function pushScopeId(Tr){currentScopeId=Tr}function popScopeId(){currentScopeId=null}const withScopeId=Tr=>withCtx;function withCtx(Tr,Cr=currentRenderingInstance,$r){if(!Cr||Tr._n)return Tr;const Ar=(...Rr)=>{Ar._d&&setBlockTracking(-1);const Dr=setCurrentRenderingInstance(Cr);let Mr;try{Mr=Tr(...Rr)}finally{setCurrentRenderingInstance(Dr),Ar._d&&setBlockTracking(1)}return Mr};return Ar._n=!0,Ar._c=!0,Ar._d=!0,Ar}function markAttrsAccessed(){}function renderComponentRoot(Tr){const{type:Cr,vnode:$r,proxy:Ar,withProxy:Rr,props:Dr,propsOptions:[Mr],slots:Br,attrs:Nr,emit:Lr,render:Hr,renderCache:zr,data:Ur,setupState:Vr,ctx:jr,inheritAttrs:Gr}=Tr;let Xr,Kr;const Zr=setCurrentRenderingInstance(Tr);try{if($r.shapeFlag&4){const Wr=Rr||Ar,Yr=Wr;Xr=normalizeVNode(Hr.call(Yr,Wr,zr,Dr,Vr,Ur,jr)),Kr=Nr}else{const Wr=Cr;Xr=normalizeVNode(Wr.length>1?Wr(Dr,{attrs:Nr,slots:Br,emit:Lr}):Wr(Dr,null)),Kr=Cr.props?Nr:getFunctionalFallthrough(Nr)}}catch(Wr){blockStack.length=0,handleError$2(Wr,Tr,1),Xr=createVNode(Comment$1)}let eo=Xr;if(Kr&&Gr!==!1){const Wr=Object.keys(Kr),{shapeFlag:Yr}=eo;Wr.length&&Yr&7&&(Mr&&Wr.some(isModelListener)&&(Kr=filterModelListeners(Kr,Mr)),eo=cloneVNode(eo,Kr))}return $r.dirs&&(eo=cloneVNode(eo),eo.dirs=eo.dirs?eo.dirs.concat($r.dirs):$r.dirs),$r.transition&&(eo.transition=$r.transition),Xr=eo,setCurrentRenderingInstance(Zr),Xr}function filterSingleRoot(Tr){let Cr;for(let $r=0;$r{let Cr;for(const $r in Tr)($r==="class"||$r==="style"||isOn($r))&&((Cr||(Cr={}))[$r]=Tr[$r]);return Cr},filterModelListeners=(Tr,Cr)=>{const $r={};for(const Ar in Tr)(!isModelListener(Ar)||!(Ar.slice(9)in Cr))&&($r[Ar]=Tr[Ar]);return $r};function shouldUpdateComponent(Tr,Cr,$r){const{props:Ar,children:Rr,component:Dr}=Tr,{props:Mr,children:Br,patchFlag:Nr}=Cr,Lr=Dr.emitsOptions;if(Cr.dirs||Cr.transition)return!0;if($r&&Nr>=0){if(Nr&1024)return!0;if(Nr&16)return Ar?hasPropsChanged(Ar,Mr,Lr):!!Mr;if(Nr&8){const Hr=Cr.dynamicProps;for(let zr=0;zrTr.__isSuspense,SuspenseImpl={name:"Suspense",__isSuspense:!0,process(Tr,Cr,$r,Ar,Rr,Dr,Mr,Br,Nr,Lr){Tr==null?mountSuspense(Cr,$r,Ar,Rr,Dr,Mr,Br,Nr,Lr):patchSuspense(Tr,Cr,$r,Ar,Rr,Mr,Br,Nr,Lr)},hydrate:hydrateSuspense,create:createSuspenseBoundary,normalize:normalizeSuspenseChildren},Suspense=SuspenseImpl;function triggerEvent(Tr,Cr){const $r=Tr.props&&Tr.props[Cr];isFunction$4($r)&&$r()}function mountSuspense(Tr,Cr,$r,Ar,Rr,Dr,Mr,Br,Nr){const{p:Lr,o:{createElement:Hr}}=Nr,zr=Hr("div"),Ur=Tr.suspense=createSuspenseBoundary(Tr,Rr,Ar,Cr,zr,$r,Dr,Mr,Br,Nr);Lr(null,Ur.pendingBranch=Tr.ssContent,zr,null,Ar,Ur,Dr,Mr),Ur.deps>0?(triggerEvent(Tr,"onPending"),triggerEvent(Tr,"onFallback"),Lr(null,Tr.ssFallback,Cr,$r,Ar,null,Dr,Mr),setActiveBranch(Ur,Tr.ssFallback)):Ur.resolve(!1,!0)}function patchSuspense(Tr,Cr,$r,Ar,Rr,Dr,Mr,Br,{p:Nr,um:Lr,o:{createElement:Hr}}){const zr=Cr.suspense=Tr.suspense;zr.vnode=Cr,Cr.el=Tr.el;const Ur=Cr.ssContent,Vr=Cr.ssFallback,{activeBranch:jr,pendingBranch:Gr,isInFallback:Xr,isHydrating:Kr}=zr;if(Gr)zr.pendingBranch=Ur,isSameVNodeType(Ur,Gr)?(Nr(Gr,Ur,zr.hiddenContainer,null,Rr,zr,Dr,Mr,Br),zr.deps<=0?zr.resolve():Xr&&(Nr(jr,Vr,$r,Ar,Rr,null,Dr,Mr,Br),setActiveBranch(zr,Vr))):(zr.pendingId++,Kr?(zr.isHydrating=!1,zr.activeBranch=Gr):Lr(Gr,Rr,zr),zr.deps=0,zr.effects.length=0,zr.hiddenContainer=Hr("div"),Xr?(Nr(null,Ur,zr.hiddenContainer,null,Rr,zr,Dr,Mr,Br),zr.deps<=0?zr.resolve():(Nr(jr,Vr,$r,Ar,Rr,null,Dr,Mr,Br),setActiveBranch(zr,Vr))):jr&&isSameVNodeType(Ur,jr)?(Nr(jr,Ur,$r,Ar,Rr,zr,Dr,Mr,Br),zr.resolve(!0)):(Nr(null,Ur,zr.hiddenContainer,null,Rr,zr,Dr,Mr,Br),zr.deps<=0&&zr.resolve()));else if(jr&&isSameVNodeType(Ur,jr))Nr(jr,Ur,$r,Ar,Rr,zr,Dr,Mr,Br),setActiveBranch(zr,Ur);else if(triggerEvent(Cr,"onPending"),zr.pendingBranch=Ur,zr.pendingId++,Nr(null,Ur,zr.hiddenContainer,null,Rr,zr,Dr,Mr,Br),zr.deps<=0)zr.resolve();else{const{timeout:Zr,pendingId:eo}=zr;Zr>0?setTimeout(()=>{zr.pendingId===eo&&zr.fallback(Vr)},Zr):Zr===0&&zr.fallback(Vr)}}function createSuspenseBoundary(Tr,Cr,$r,Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr=!1){const{p:zr,m:Ur,um:Vr,n:jr,o:{parentNode:Gr,remove:Xr}}=Lr;let Kr;const Zr=isVNodeSuspensible(Tr);Zr&&Cr!=null&&Cr.pendingBranch&&(Kr=Cr.pendingId,Cr.deps++);const eo=Tr.props?toNumber$1(Tr.props.timeout):void 0,Wr={vnode:Tr,parent:Cr,parentComponent:$r,isSVG:Mr,container:Ar,hiddenContainer:Rr,anchor:Dr,deps:0,pendingId:0,timeout:typeof eo=="number"?eo:-1,activeBranch:null,pendingBranch:null,isInFallback:!Hr,isHydrating:Hr,isUnmounted:!1,effects:[],resolve(Yr=!1,Jr=!1){const{vnode:no,activeBranch:ro,pendingBranch:so,pendingId:ao,effects:lo,parentComponent:po,container:go}=Wr;let co=!1;if(Wr.isHydrating)Wr.isHydrating=!1;else if(!Yr){co=ro&&so.transition&&so.transition.mode==="out-in",co&&(ro.transition.afterLeave=()=>{ao===Wr.pendingId&&(Ur(so,go,jr(ro),0),queuePostFlushCb(lo))});let{anchor:uo}=Wr;ro&&(uo=jr(ro),Vr(ro,po,Wr,!0)),co||Ur(so,go,uo,0)}setActiveBranch(Wr,so),Wr.pendingBranch=null,Wr.isInFallback=!1;let mo=Wr.parent,io=!1;for(;mo;){if(mo.pendingBranch){mo.effects.push(...lo),io=!0;break}mo=mo.parent}!io&&!co&&queuePostFlushCb(lo),Wr.effects=[],Zr&&Cr&&Cr.pendingBranch&&Kr===Cr.pendingId&&(Cr.deps--,Cr.deps===0&&!Jr&&Cr.resolve()),triggerEvent(no,"onResolve")},fallback(Yr){if(!Wr.pendingBranch)return;const{vnode:Jr,activeBranch:no,parentComponent:ro,container:so,isSVG:ao}=Wr;triggerEvent(Jr,"onFallback");const lo=jr(no),po=()=>{Wr.isInFallback&&(zr(null,Yr,so,lo,ro,null,ao,Br,Nr),setActiveBranch(Wr,Yr))},go=Yr.transition&&Yr.transition.mode==="out-in";go&&(no.transition.afterLeave=po),Wr.isInFallback=!0,Vr(no,ro,null,!0),go||po()},move(Yr,Jr,no){Wr.activeBranch&&Ur(Wr.activeBranch,Yr,Jr,no),Wr.container=Yr},next(){return Wr.activeBranch&&jr(Wr.activeBranch)},registerDep(Yr,Jr){const no=!!Wr.pendingBranch;no&&Wr.deps++;const ro=Yr.vnode.el;Yr.asyncDep.catch(so=>{handleError$2(so,Yr,0)}).then(so=>{if(Yr.isUnmounted||Wr.isUnmounted||Wr.pendingId!==Yr.suspenseId)return;Yr.asyncResolved=!0;const{vnode:ao}=Yr;handleSetupResult(Yr,so,!1),ro&&(ao.el=ro);const lo=!ro&&Yr.subTree.el;Jr(Yr,ao,Gr(ro||Yr.subTree.el),ro?null:jr(Yr.subTree),Wr,Mr,Nr),lo&&Xr(lo),updateHOCHostEl(Yr,ao.el),no&&--Wr.deps===0&&Wr.resolve()})},unmount(Yr,Jr){Wr.isUnmounted=!0,Wr.activeBranch&&Vr(Wr.activeBranch,$r,Yr,Jr),Wr.pendingBranch&&Vr(Wr.pendingBranch,$r,Yr,Jr)}};return Wr}function hydrateSuspense(Tr,Cr,$r,Ar,Rr,Dr,Mr,Br,Nr){const Lr=Cr.suspense=createSuspenseBoundary(Cr,Ar,$r,Tr.parentNode,document.createElement("div"),null,Rr,Dr,Mr,Br,!0),Hr=Nr(Tr,Lr.pendingBranch=Cr.ssContent,$r,Lr,Dr,Mr);return Lr.deps===0&&Lr.resolve(!1,!0),Hr}function normalizeSuspenseChildren(Tr){const{shapeFlag:Cr,children:$r}=Tr,Ar=Cr&32;Tr.ssContent=normalizeSuspenseSlot(Ar?$r.default:$r),Tr.ssFallback=Ar?normalizeSuspenseSlot($r.fallback):createVNode(Comment$1)}function normalizeSuspenseSlot(Tr){let Cr;if(isFunction$4(Tr)){const $r=isBlockTreeEnabled&&Tr._c;$r&&(Tr._d=!1,openBlock()),Tr=Tr(),$r&&(Tr._d=!0,Cr=currentBlock,closeBlock())}return isArray$4(Tr)&&(Tr=filterSingleRoot(Tr)),Tr=normalizeVNode(Tr),Cr&&!Tr.dynamicChildren&&(Tr.dynamicChildren=Cr.filter($r=>$r!==Tr)),Tr}function queueEffectWithSuspense(Tr,Cr){Cr&&Cr.pendingBranch?isArray$4(Tr)?Cr.effects.push(...Tr):Cr.effects.push(Tr):queuePostFlushCb(Tr)}function setActiveBranch(Tr,Cr){Tr.activeBranch=Cr;const{vnode:$r,parentComponent:Ar}=Tr,Rr=$r.el=Cr.el;Ar&&Ar.subTree===$r&&(Ar.vnode.el=Rr,updateHOCHostEl(Ar,Rr))}function isVNodeSuspensible(Tr){var Cr;return((Cr=Tr.props)==null?void 0:Cr.suspensible)!=null&&Tr.props.suspensible!==!1}function watchEffect(Tr,Cr){return doWatch(Tr,null,Cr)}function watchPostEffect(Tr,Cr){return doWatch(Tr,null,{flush:"post"})}const INITIAL_WATCHER_VALUE={};function watch(Tr,Cr,$r){return doWatch(Tr,Cr,$r)}function doWatch(Tr,Cr,{immediate:$r,deep:Ar,flush:Rr,onTrack:Dr,onTrigger:Mr}=EMPTY_OBJ){var Br;const Nr=getCurrentScope()===((Br=currentInstance)==null?void 0:Br.scope)?currentInstance:null;let Lr,Hr=!1,zr=!1;if(isRef(Tr)?(Lr=()=>Tr.value,Hr=isShallow(Tr)):isReactive(Tr)?(Lr=()=>Tr,Ar=!0):isArray$4(Tr)?(zr=!0,Hr=Tr.some(Wr=>isReactive(Wr)||isShallow(Wr)),Lr=()=>Tr.map(Wr=>{if(isRef(Wr))return Wr.value;if(isReactive(Wr))return traverse(Wr);if(isFunction$4(Wr))return callWithErrorHandling(Wr,Nr,2)})):isFunction$4(Tr)?Cr?Lr=()=>callWithErrorHandling(Tr,Nr,2):Lr=()=>{if(!(Nr&&Nr.isUnmounted))return Ur&&Ur(),callWithAsyncErrorHandling(Tr,Nr,3,[Vr])}:Lr=NOOP,Cr&&Ar){const Wr=Lr;Lr=()=>traverse(Wr())}let Ur,Vr=Wr=>{Ur=Zr.onStop=()=>{callWithErrorHandling(Wr,Nr,4),Ur=Zr.onStop=void 0}},jr;if(isInSSRComponentSetup)if(Vr=NOOP,Cr?$r&&callWithAsyncErrorHandling(Cr,Nr,3,[Lr(),zr?[]:void 0,Vr]):Lr(),Rr==="sync"){const Wr=useSSRContext();jr=Wr.__watcherHandles||(Wr.__watcherHandles=[])}else return NOOP;let Gr=zr?new Array(Tr.length).fill(INITIAL_WATCHER_VALUE):INITIAL_WATCHER_VALUE;const Xr=()=>{if(Zr.active)if(Cr){const Wr=Zr.run();(Ar||Hr||(zr?Wr.some((Yr,Jr)=>hasChanged(Yr,Gr[Jr])):hasChanged(Wr,Gr)))&&(Ur&&Ur(),callWithAsyncErrorHandling(Cr,Nr,3,[Wr,Gr===INITIAL_WATCHER_VALUE?void 0:zr&&Gr[0]===INITIAL_WATCHER_VALUE?[]:Gr,Vr]),Gr=Wr)}else Zr.run()};Xr.allowRecurse=!!Cr;let Kr;Rr==="sync"?Kr=Xr:Rr==="post"?Kr=()=>queuePostRenderEffect(Xr,Nr&&Nr.suspense):(Xr.pre=!0,Nr&&(Xr.id=Nr.uid),Kr=()=>queueJob(Xr));const Zr=new ReactiveEffect(Lr,Kr);Cr?$r?Xr():Gr=Zr.run():Rr==="post"?queuePostRenderEffect(Zr.run.bind(Zr),Nr&&Nr.suspense):Zr.run();const eo=()=>{Zr.stop(),Nr&&Nr.scope&&remove$1(Nr.scope.effects,Zr)};return jr&&jr.push(eo),eo}function instanceWatch(Tr,Cr,$r){const Ar=this.proxy,Rr=isString$7(Tr)?Tr.includes(".")?createPathGetter(Ar,Tr):()=>Ar[Tr]:Tr.bind(Ar,Ar);let Dr;isFunction$4(Cr)?Dr=Cr:(Dr=Cr.handler,$r=Cr);const Mr=currentInstance;setCurrentInstance(this);const Br=doWatch(Rr,Dr.bind(Ar),$r);return Mr?setCurrentInstance(Mr):unsetCurrentInstance(),Br}function createPathGetter(Tr,Cr){const $r=Cr.split(".");return()=>{let Ar=Tr;for(let Rr=0;Rr<$r.length&&Ar;Rr++)Ar=Ar[$r[Rr]];return Ar}}function traverse(Tr,Cr){if(!isObject$5(Tr)||Tr.__v_skip||(Cr=Cr||new Set,Cr.has(Tr)))return Tr;if(Cr.add(Tr),isRef(Tr))traverse(Tr.value,Cr);else if(isArray$4(Tr))for(let $r=0;$r{traverse($r,Cr)});else if(isPlainObject$4(Tr))for(const $r in Tr)traverse(Tr[$r],Cr);return Tr}function withDirectives(Tr,Cr){const $r=currentRenderingInstance;if($r===null)return Tr;const Ar=getExposeProxy($r)||$r.proxy,Rr=Tr.dirs||(Tr.dirs=[]);for(let Dr=0;Dr{Tr.isMounted=!0}),onBeforeUnmount(()=>{Tr.isUnmounting=!0}),Tr}const TransitionHookValidator=[Function,Array],BaseTransitionPropsValidators={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:TransitionHookValidator,onEnter:TransitionHookValidator,onAfterEnter:TransitionHookValidator,onEnterCancelled:TransitionHookValidator,onBeforeLeave:TransitionHookValidator,onLeave:TransitionHookValidator,onAfterLeave:TransitionHookValidator,onLeaveCancelled:TransitionHookValidator,onBeforeAppear:TransitionHookValidator,onAppear:TransitionHookValidator,onAfterAppear:TransitionHookValidator,onAppearCancelled:TransitionHookValidator},BaseTransitionImpl={name:"BaseTransition",props:BaseTransitionPropsValidators,setup(Tr,{slots:Cr}){const $r=getCurrentInstance(),Ar=useTransitionState();let Rr;return()=>{const Dr=Cr.default&&getTransitionRawChildren(Cr.default(),!0);if(!Dr||!Dr.length)return;let Mr=Dr[0];if(Dr.length>1){for(const Gr of Dr)if(Gr.type!==Comment$1){Mr=Gr;break}}const Br=toRaw(Tr),{mode:Nr}=Br;if(Ar.isLeaving)return emptyPlaceholder(Mr);const Lr=getKeepAliveChild(Mr);if(!Lr)return emptyPlaceholder(Mr);const Hr=resolveTransitionHooks(Lr,Br,Ar,$r);setTransitionHooks(Lr,Hr);const zr=$r.subTree,Ur=zr&&getKeepAliveChild(zr);let Vr=!1;const{getTransitionKey:jr}=Lr.type;if(jr){const Gr=jr();Rr===void 0?Rr=Gr:Gr!==Rr&&(Rr=Gr,Vr=!0)}if(Ur&&Ur.type!==Comment$1&&(!isSameVNodeType(Lr,Ur)||Vr)){const Gr=resolveTransitionHooks(Ur,Br,Ar,$r);if(setTransitionHooks(Ur,Gr),Nr==="out-in")return Ar.isLeaving=!0,Gr.afterLeave=()=>{Ar.isLeaving=!1,$r.update.active!==!1&&$r.update()},emptyPlaceholder(Mr);Nr==="in-out"&&Lr.type!==Comment$1&&(Gr.delayLeave=(Xr,Kr,Zr)=>{const eo=getLeavingNodesForType(Ar,Ur);eo[String(Ur.key)]=Ur,Xr[leaveCbKey]=()=>{Kr(),Xr[leaveCbKey]=void 0,delete Hr.delayedLeave},Hr.delayedLeave=Zr})}return Mr}}},BaseTransition=BaseTransitionImpl;function getLeavingNodesForType(Tr,Cr){const{leavingVNodes:$r}=Tr;let Ar=$r.get(Cr.type);return Ar||(Ar=Object.create(null),$r.set(Cr.type,Ar)),Ar}function resolveTransitionHooks(Tr,Cr,$r,Ar){const{appear:Rr,mode:Dr,persisted:Mr=!1,onBeforeEnter:Br,onEnter:Nr,onAfterEnter:Lr,onEnterCancelled:Hr,onBeforeLeave:zr,onLeave:Ur,onAfterLeave:Vr,onLeaveCancelled:jr,onBeforeAppear:Gr,onAppear:Xr,onAfterAppear:Kr,onAppearCancelled:Zr}=Cr,eo=String(Tr.key),Wr=getLeavingNodesForType($r,Tr),Yr=(ro,so)=>{ro&&callWithAsyncErrorHandling(ro,Ar,9,so)},Jr=(ro,so)=>{const ao=so[1];Yr(ro,so),isArray$4(ro)?ro.every(lo=>lo.length<=1)&&ao():ro.length<=1&&ao()},no={mode:Dr,persisted:Mr,beforeEnter(ro){let so=Br;if(!$r.isMounted)if(Rr)so=Gr||Br;else return;ro[leaveCbKey]&&ro[leaveCbKey](!0);const ao=Wr[eo];ao&&isSameVNodeType(Tr,ao)&&ao.el[leaveCbKey]&&ao.el[leaveCbKey](),Yr(so,[ro])},enter(ro){let so=Nr,ao=Lr,lo=Hr;if(!$r.isMounted)if(Rr)so=Xr||Nr,ao=Kr||Lr,lo=Zr||Hr;else return;let po=!1;const go=ro[enterCbKey$1]=co=>{po||(po=!0,co?Yr(lo,[ro]):Yr(ao,[ro]),no.delayedLeave&&no.delayedLeave(),ro[enterCbKey$1]=void 0)};so?Jr(so,[ro,go]):go()},leave(ro,so){const ao=String(Tr.key);if(ro[enterCbKey$1]&&ro[enterCbKey$1](!0),$r.isUnmounting)return so();Yr(zr,[ro]);let lo=!1;const po=ro[leaveCbKey]=go=>{lo||(lo=!0,so(),go?Yr(jr,[ro]):Yr(Vr,[ro]),ro[leaveCbKey]=void 0,Wr[ao]===Tr&&delete Wr[ao])};Wr[ao]=Tr,Ur?Jr(Ur,[ro,po]):po()},clone(ro){return resolveTransitionHooks(ro,Cr,$r,Ar)}};return no}function emptyPlaceholder(Tr){if(isKeepAlive(Tr))return Tr=cloneVNode(Tr),Tr.children=null,Tr}function getKeepAliveChild(Tr){return isKeepAlive(Tr)?Tr.children?Tr.children[0]:void 0:Tr}function setTransitionHooks(Tr,Cr){Tr.shapeFlag&6&&Tr.component?setTransitionHooks(Tr.component.subTree,Cr):Tr.shapeFlag&128?(Tr.ssContent.transition=Cr.clone(Tr.ssContent),Tr.ssFallback.transition=Cr.clone(Tr.ssFallback)):Tr.transition=Cr}function getTransitionRawChildren(Tr,Cr=!1,$r){let Ar=[],Rr=0;for(let Dr=0;Dr1)for(let Dr=0;Drextend$1({name:Tr.name},Cr,{setup:Tr}))():Tr}const isAsyncWrapper=Tr=>!!Tr.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function defineAsyncComponent(Tr){isFunction$4(Tr)&&(Tr={loader:Tr});const{loader:Cr,loadingComponent:$r,errorComponent:Ar,delay:Rr=200,timeout:Dr,suspensible:Mr=!0,onError:Br}=Tr;let Nr=null,Lr,Hr=0;const zr=()=>(Hr++,Nr=null,Ur()),Ur=()=>{let Vr;return Nr||(Vr=Nr=Cr().catch(jr=>{if(jr=jr instanceof Error?jr:new Error(String(jr)),Br)return new Promise((Gr,Xr)=>{Br(jr,()=>Gr(zr()),()=>Xr(jr),Hr+1)});throw jr}).then(jr=>Vr!==Nr&&Nr?Nr:(jr&&(jr.__esModule||jr[Symbol.toStringTag]==="Module")&&(jr=jr.default),Lr=jr,jr)))};return defineComponent({name:"AsyncComponentWrapper",__asyncLoader:Ur,get __asyncResolved(){return Lr},setup(){const Vr=currentInstance;if(Lr)return()=>createInnerComp(Lr,Vr);const jr=Zr=>{Nr=null,handleError$2(Zr,Vr,13,!Ar)};if(Mr&&Vr.suspense||isInSSRComponentSetup)return Ur().then(Zr=>()=>createInnerComp(Zr,Vr)).catch(Zr=>(jr(Zr),()=>Ar?createVNode(Ar,{error:Zr}):null));const Gr=ref(!1),Xr=ref(),Kr=ref(!!Rr);return Rr&&setTimeout(()=>{Kr.value=!1},Rr),Dr!=null&&setTimeout(()=>{if(!Gr.value&&!Xr.value){const Zr=new Error(`Async component timed out after ${Dr}ms.`);jr(Zr),Xr.value=Zr}},Dr),Ur().then(()=>{Gr.value=!0,Vr.parent&&isKeepAlive(Vr.parent.vnode)&&queueJob(Vr.parent.update)}).catch(Zr=>{jr(Zr),Xr.value=Zr}),()=>{if(Gr.value&&Lr)return createInnerComp(Lr,Vr);if(Xr.value&&Ar)return createVNode(Ar,{error:Xr.value});if($r&&!Kr.value)return createVNode($r)}}})}function createInnerComp(Tr,Cr){const{ref:$r,props:Ar,children:Rr,ce:Dr}=Cr.vnode,Mr=createVNode(Tr,Ar,Rr);return Mr.ref=$r,Mr.ce=Dr,delete Cr.vnode.ce,Mr}const isKeepAlive=Tr=>Tr.type.__isKeepAlive,KeepAliveImpl={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(Tr,{slots:Cr}){const $r=getCurrentInstance(),Ar=$r.ctx;if(!Ar.renderer)return()=>{const Zr=Cr.default&&Cr.default();return Zr&&Zr.length===1?Zr[0]:Zr};const Rr=new Map,Dr=new Set;let Mr=null;const Br=$r.suspense,{renderer:{p:Nr,m:Lr,um:Hr,o:{createElement:zr}}}=Ar,Ur=zr("div");Ar.activate=(Zr,eo,Wr,Yr,Jr)=>{const no=Zr.component;Lr(Zr,eo,Wr,0,Br),Nr(no.vnode,Zr,eo,Wr,no,Br,Yr,Zr.slotScopeIds,Jr),queuePostRenderEffect(()=>{no.isDeactivated=!1,no.a&&invokeArrayFns(no.a);const ro=Zr.props&&Zr.props.onVnodeMounted;ro&&invokeVNodeHook(ro,no.parent,Zr)},Br)},Ar.deactivate=Zr=>{const eo=Zr.component;Lr(Zr,Ur,null,1,Br),queuePostRenderEffect(()=>{eo.da&&invokeArrayFns(eo.da);const Wr=Zr.props&&Zr.props.onVnodeUnmounted;Wr&&invokeVNodeHook(Wr,eo.parent,Zr),eo.isDeactivated=!0},Br)};function Vr(Zr){resetShapeFlag(Zr),Hr(Zr,$r,Br,!0)}function jr(Zr){Rr.forEach((eo,Wr)=>{const Yr=getComponentName(eo.type);Yr&&(!Zr||!Zr(Yr))&&Gr(Wr)})}function Gr(Zr){const eo=Rr.get(Zr);!Mr||!isSameVNodeType(eo,Mr)?Vr(eo):Mr&&resetShapeFlag(Mr),Rr.delete(Zr),Dr.delete(Zr)}watch(()=>[Tr.include,Tr.exclude],([Zr,eo])=>{Zr&&jr(Wr=>matches$1(Zr,Wr)),eo&&jr(Wr=>!matches$1(eo,Wr))},{flush:"post",deep:!0});let Xr=null;const Kr=()=>{Xr!=null&&Rr.set(Xr,getInnerChild($r.subTree))};return onMounted(Kr),onUpdated(Kr),onBeforeUnmount(()=>{Rr.forEach(Zr=>{const{subTree:eo,suspense:Wr}=$r,Yr=getInnerChild(eo);if(Zr.type===Yr.type&&Zr.key===Yr.key){resetShapeFlag(Yr);const Jr=Yr.component.da;Jr&&queuePostRenderEffect(Jr,Wr);return}Vr(Zr)})}),()=>{if(Xr=null,!Cr.default)return null;const Zr=Cr.default(),eo=Zr[0];if(Zr.length>1)return Mr=null,Zr;if(!isVNode(eo)||!(eo.shapeFlag&4)&&!(eo.shapeFlag&128))return Mr=null,eo;let Wr=getInnerChild(eo);const Yr=Wr.type,Jr=getComponentName(isAsyncWrapper(Wr)?Wr.type.__asyncResolved||{}:Yr),{include:no,exclude:ro,max:so}=Tr;if(no&&(!Jr||!matches$1(no,Jr))||ro&&Jr&&matches$1(ro,Jr))return Mr=Wr,eo;const ao=Wr.key==null?Yr:Wr.key,lo=Rr.get(ao);return Wr.el&&(Wr=cloneVNode(Wr),eo.shapeFlag&128&&(eo.ssContent=Wr)),Xr=ao,lo?(Wr.el=lo.el,Wr.component=lo.component,Wr.transition&&setTransitionHooks(Wr,Wr.transition),Wr.shapeFlag|=512,Dr.delete(ao),Dr.add(ao)):(Dr.add(ao),so&&Dr.size>parseInt(so,10)&&Gr(Dr.values().next().value)),Wr.shapeFlag|=256,Mr=Wr,isSuspense(eo.type)?eo:Wr}}},KeepAlive=KeepAliveImpl;function matches$1(Tr,Cr){return isArray$4(Tr)?Tr.some($r=>matches$1($r,Cr)):isString$7(Tr)?Tr.split(",").includes(Cr):isRegExp$4(Tr)?Tr.test(Cr):!1}function onActivated(Tr,Cr){registerKeepAliveHook(Tr,"a",Cr)}function onDeactivated(Tr,Cr){registerKeepAliveHook(Tr,"da",Cr)}function registerKeepAliveHook(Tr,Cr,$r=currentInstance){const Ar=Tr.__wdc||(Tr.__wdc=()=>{let Rr=$r;for(;Rr;){if(Rr.isDeactivated)return;Rr=Rr.parent}return Tr()});if(injectHook(Cr,Ar,$r),$r){let Rr=$r.parent;for(;Rr&&Rr.parent;)isKeepAlive(Rr.parent.vnode)&&injectToKeepAliveRoot(Ar,Cr,$r,Rr),Rr=Rr.parent}}function injectToKeepAliveRoot(Tr,Cr,$r,Ar){const Rr=injectHook(Cr,Tr,Ar,!0);onUnmounted(()=>{remove$1(Ar[Cr],Rr)},$r)}function resetShapeFlag(Tr){Tr.shapeFlag&=-257,Tr.shapeFlag&=-513}function getInnerChild(Tr){return Tr.shapeFlag&128?Tr.ssContent:Tr}function injectHook(Tr,Cr,$r=currentInstance,Ar=!1){if($r){const Rr=$r[Tr]||($r[Tr]=[]),Dr=Cr.__weh||(Cr.__weh=(...Mr)=>{if($r.isUnmounted)return;pauseTracking(),setCurrentInstance($r);const Br=callWithAsyncErrorHandling(Cr,$r,Tr,Mr);return unsetCurrentInstance(),resetTracking(),Br});return Ar?Rr.unshift(Dr):Rr.push(Dr),Dr}}const createHook=Tr=>(Cr,$r=currentInstance)=>(!isInSSRComponentSetup||Tr==="sp")&&injectHook(Tr,(...Ar)=>Cr(...Ar),$r),onBeforeMount=createHook("bm"),onMounted=createHook("m"),onBeforeUpdate=createHook("bu"),onUpdated=createHook("u"),onBeforeUnmount=createHook("bum"),onUnmounted=createHook("um"),onServerPrefetch=createHook("sp"),onRenderTriggered=createHook("rtg"),onRenderTracked=createHook("rtc");function onErrorCaptured(Tr,Cr=currentInstance){injectHook("ec",Tr,Cr)}function renderList(Tr,Cr,$r,Ar){let Rr;const Dr=$r&&$r[Ar];if(isArray$4(Tr)||isString$7(Tr)){Rr=new Array(Tr.length);for(let Mr=0,Br=Tr.length;MrCr(Mr,Br,void 0,Dr&&Dr[Br]));else{const Mr=Object.keys(Tr);Rr=new Array(Mr.length);for(let Br=0,Nr=Mr.length;Br{const Dr=Ar.fn(...Rr);return Dr&&(Dr.key=Ar.key),Dr}:Ar.fn)}return Tr}function renderSlot(Tr,Cr,$r={},Ar,Rr){if(currentRenderingInstance.isCE||currentRenderingInstance.parent&&isAsyncWrapper(currentRenderingInstance.parent)&¤tRenderingInstance.parent.isCE)return Cr!=="default"&&($r.name=Cr),createVNode("slot",$r,Ar&&Ar());let Dr=Tr[Cr];Dr&&Dr._c&&(Dr._d=!1),openBlock();const Mr=Dr&&ensureValidVNode(Dr($r)),Br=createBlock(Fragment$1,{key:$r.key||Mr&&Mr.key||`_${Cr}`},Mr||(Ar?Ar():[]),Mr&&Tr._===1?64:-2);return!Rr&&Br.scopeId&&(Br.slotScopeIds=[Br.scopeId+"-s"]),Dr&&Dr._c&&(Dr._d=!0),Br}function ensureValidVNode(Tr){return Tr.some(Cr=>isVNode(Cr)?!(Cr.type===Comment$1||Cr.type===Fragment$1&&!ensureValidVNode(Cr.children)):!0)?Tr:null}function toHandlers(Tr,Cr){const $r={};for(const Ar in Tr)$r[Cr&&/[A-Z]/.test(Ar)?`on:${Ar}`:toHandlerKey(Ar)]=Tr[Ar];return $r}const getPublicInstance=Tr=>Tr?isStatefulComponent(Tr)?getExposeProxy(Tr)||Tr.proxy:getPublicInstance(Tr.parent):null,publicPropertiesMap=extend$1(Object.create(null),{$:Tr=>Tr,$el:Tr=>Tr.vnode.el,$data:Tr=>Tr.data,$props:Tr=>Tr.props,$attrs:Tr=>Tr.attrs,$slots:Tr=>Tr.slots,$refs:Tr=>Tr.refs,$parent:Tr=>getPublicInstance(Tr.parent),$root:Tr=>getPublicInstance(Tr.root),$emit:Tr=>Tr.emit,$options:Tr=>resolveMergedOptions(Tr),$forceUpdate:Tr=>Tr.f||(Tr.f=()=>queueJob(Tr.update)),$nextTick:Tr=>Tr.n||(Tr.n=nextTick.bind(Tr.proxy)),$watch:Tr=>instanceWatch.bind(Tr)}),hasSetupBinding=(Tr,Cr)=>Tr!==EMPTY_OBJ&&!Tr.__isScriptSetup&&hasOwn$2(Tr,Cr),PublicInstanceProxyHandlers={get({_:Tr},Cr){const{ctx:$r,setupState:Ar,data:Rr,props:Dr,accessCache:Mr,type:Br,appContext:Nr}=Tr;let Lr;if(Cr[0]!=="$"){const Vr=Mr[Cr];if(Vr!==void 0)switch(Vr){case 1:return Ar[Cr];case 2:return Rr[Cr];case 4:return $r[Cr];case 3:return Dr[Cr]}else{if(hasSetupBinding(Ar,Cr))return Mr[Cr]=1,Ar[Cr];if(Rr!==EMPTY_OBJ&&hasOwn$2(Rr,Cr))return Mr[Cr]=2,Rr[Cr];if((Lr=Tr.propsOptions[0])&&hasOwn$2(Lr,Cr))return Mr[Cr]=3,Dr[Cr];if($r!==EMPTY_OBJ&&hasOwn$2($r,Cr))return Mr[Cr]=4,$r[Cr];shouldCacheAccess&&(Mr[Cr]=0)}}const Hr=publicPropertiesMap[Cr];let zr,Ur;if(Hr)return Cr==="$attrs"&&track(Tr,"get",Cr),Hr(Tr);if((zr=Br.__cssModules)&&(zr=zr[Cr]))return zr;if($r!==EMPTY_OBJ&&hasOwn$2($r,Cr))return Mr[Cr]=4,$r[Cr];if(Ur=Nr.config.globalProperties,hasOwn$2(Ur,Cr))return Ur[Cr]},set({_:Tr},Cr,$r){const{data:Ar,setupState:Rr,ctx:Dr}=Tr;return hasSetupBinding(Rr,Cr)?(Rr[Cr]=$r,!0):Ar!==EMPTY_OBJ&&hasOwn$2(Ar,Cr)?(Ar[Cr]=$r,!0):hasOwn$2(Tr.props,Cr)||Cr[0]==="$"&&Cr.slice(1)in Tr?!1:(Dr[Cr]=$r,!0)},has({_:{data:Tr,setupState:Cr,accessCache:$r,ctx:Ar,appContext:Rr,propsOptions:Dr}},Mr){let Br;return!!$r[Mr]||Tr!==EMPTY_OBJ&&hasOwn$2(Tr,Mr)||hasSetupBinding(Cr,Mr)||(Br=Dr[0])&&hasOwn$2(Br,Mr)||hasOwn$2(Ar,Mr)||hasOwn$2(publicPropertiesMap,Mr)||hasOwn$2(Rr.config.globalProperties,Mr)},defineProperty(Tr,Cr,$r){return $r.get!=null?Tr._.accessCache[Cr]=0:hasOwn$2($r,"value")&&this.set(Tr,Cr,$r.value,null),Reflect.defineProperty(Tr,Cr,$r)}};function useSlots(){return getContext$1().slots}function getContext$1(){const Tr=getCurrentInstance();return Tr.setupContext||(Tr.setupContext=createSetupContext(Tr))}function normalizePropsOrEmits(Tr){return isArray$4(Tr)?Tr.reduce((Cr,$r)=>(Cr[$r]=null,Cr),{}):Tr}function withAsyncContext(Tr){const Cr=getCurrentInstance();let $r=Tr();return unsetCurrentInstance(),isPromise($r)&&($r=$r.catch(Ar=>{throw setCurrentInstance(Cr),Ar})),[$r,()=>setCurrentInstance(Cr)]}let shouldCacheAccess=!0;function applyOptions(Tr){const Cr=resolveMergedOptions(Tr),$r=Tr.proxy,Ar=Tr.ctx;shouldCacheAccess=!1,Cr.beforeCreate&&callHook$1(Cr.beforeCreate,Tr,"bc");const{data:Rr,computed:Dr,methods:Mr,watch:Br,provide:Nr,inject:Lr,created:Hr,beforeMount:zr,mounted:Ur,beforeUpdate:Vr,updated:jr,activated:Gr,deactivated:Xr,beforeDestroy:Kr,beforeUnmount:Zr,destroyed:eo,unmounted:Wr,render:Yr,renderTracked:Jr,renderTriggered:no,errorCaptured:ro,serverPrefetch:so,expose:ao,inheritAttrs:lo,components:po,directives:go,filters:co}=Cr;if(Lr&&resolveInjections(Lr,Ar,null),Mr)for(const uo in Mr){const ho=Mr[uo];isFunction$4(ho)&&(Ar[uo]=ho.bind($r))}if(Rr){const uo=Rr.call($r,$r);isObject$5(uo)&&(Tr.data=reactive(uo))}if(shouldCacheAccess=!0,Dr)for(const uo in Dr){const ho=Dr[uo],yo=isFunction$4(ho)?ho.bind($r,$r):isFunction$4(ho.get)?ho.get.bind($r,$r):NOOP,So=!isFunction$4(ho)&&isFunction$4(ho.set)?ho.set.bind($r):NOOP,ko=computed({get:yo,set:So});Object.defineProperty(Ar,uo,{enumerable:!0,configurable:!0,get:()=>ko.value,set:$o=>ko.value=$o})}if(Br)for(const uo in Br)createWatcher(Br[uo],Ar,$r,uo);if(Nr){const uo=isFunction$4(Nr)?Nr.call($r):Nr;Reflect.ownKeys(uo).forEach(ho=>{provide(ho,uo[ho])})}Hr&&callHook$1(Hr,Tr,"c");function io(uo,ho){isArray$4(ho)?ho.forEach(yo=>uo(yo.bind($r))):ho&&uo(ho.bind($r))}if(io(onBeforeMount,zr),io(onMounted,Ur),io(onBeforeUpdate,Vr),io(onUpdated,jr),io(onActivated,Gr),io(onDeactivated,Xr),io(onErrorCaptured,ro),io(onRenderTracked,Jr),io(onRenderTriggered,no),io(onBeforeUnmount,Zr),io(onUnmounted,Wr),io(onServerPrefetch,so),isArray$4(ao))if(ao.length){const uo=Tr.exposed||(Tr.exposed={});ao.forEach(ho=>{Object.defineProperty(uo,ho,{get:()=>$r[ho],set:yo=>$r[ho]=yo})})}else Tr.exposed||(Tr.exposed={});Yr&&Tr.render===NOOP&&(Tr.render=Yr),lo!=null&&(Tr.inheritAttrs=lo),po&&(Tr.components=po),go&&(Tr.directives=go)}function resolveInjections(Tr,Cr,$r=NOOP){isArray$4(Tr)&&(Tr=normalizeInject(Tr));for(const Ar in Tr){const Rr=Tr[Ar];let Dr;isObject$5(Rr)?"default"in Rr?Dr=inject(Rr.from||Ar,Rr.default,!0):Dr=inject(Rr.from||Ar):Dr=inject(Rr),isRef(Dr)?Object.defineProperty(Cr,Ar,{enumerable:!0,configurable:!0,get:()=>Dr.value,set:Mr=>Dr.value=Mr}):Cr[Ar]=Dr}}function callHook$1(Tr,Cr,$r){callWithAsyncErrorHandling(isArray$4(Tr)?Tr.map(Ar=>Ar.bind(Cr.proxy)):Tr.bind(Cr.proxy),Cr,$r)}function createWatcher(Tr,Cr,$r,Ar){const Rr=Ar.includes(".")?createPathGetter($r,Ar):()=>$r[Ar];if(isString$7(Tr)){const Dr=Cr[Tr];isFunction$4(Dr)&&watch(Rr,Dr)}else if(isFunction$4(Tr))watch(Rr,Tr.bind($r));else if(isObject$5(Tr))if(isArray$4(Tr))Tr.forEach(Dr=>createWatcher(Dr,Cr,$r,Ar));else{const Dr=isFunction$4(Tr.handler)?Tr.handler.bind($r):Cr[Tr.handler];isFunction$4(Dr)&&watch(Rr,Dr,Tr)}}function resolveMergedOptions(Tr){const Cr=Tr.type,{mixins:$r,extends:Ar}=Cr,{mixins:Rr,optionsCache:Dr,config:{optionMergeStrategies:Mr}}=Tr.appContext,Br=Dr.get(Cr);let Nr;return Br?Nr=Br:!Rr.length&&!$r&&!Ar?Nr=Cr:(Nr={},Rr.length&&Rr.forEach(Lr=>mergeOptions$1(Nr,Lr,Mr,!0)),mergeOptions$1(Nr,Cr,Mr)),isObject$5(Cr)&&Dr.set(Cr,Nr),Nr}function mergeOptions$1(Tr,Cr,$r,Ar=!1){const{mixins:Rr,extends:Dr}=Cr;Dr&&mergeOptions$1(Tr,Dr,$r,!0),Rr&&Rr.forEach(Mr=>mergeOptions$1(Tr,Mr,$r,!0));for(const Mr in Cr)if(!(Ar&&Mr==="expose")){const Br=internalOptionMergeStrats[Mr]||$r&&$r[Mr];Tr[Mr]=Br?Br(Tr[Mr],Cr[Mr]):Cr[Mr]}return Tr}const internalOptionMergeStrats={data:mergeDataFn,props:mergeEmitsOrPropsOptions,emits:mergeEmitsOrPropsOptions,methods:mergeObjectOptions,computed:mergeObjectOptions,beforeCreate:mergeAsArray,created:mergeAsArray,beforeMount:mergeAsArray,mounted:mergeAsArray,beforeUpdate:mergeAsArray,updated:mergeAsArray,beforeDestroy:mergeAsArray,beforeUnmount:mergeAsArray,destroyed:mergeAsArray,unmounted:mergeAsArray,activated:mergeAsArray,deactivated:mergeAsArray,errorCaptured:mergeAsArray,serverPrefetch:mergeAsArray,components:mergeObjectOptions,directives:mergeObjectOptions,watch:mergeWatchOptions,provide:mergeDataFn,inject:mergeInject};function mergeDataFn(Tr,Cr){return Cr?Tr?function(){return extend$1(isFunction$4(Tr)?Tr.call(this,this):Tr,isFunction$4(Cr)?Cr.call(this,this):Cr)}:Cr:Tr}function mergeInject(Tr,Cr){return mergeObjectOptions(normalizeInject(Tr),normalizeInject(Cr))}function normalizeInject(Tr){if(isArray$4(Tr)){const Cr={};for(let $r=0;$r1)return $r&&isFunction$4(Cr)?Cr.call(Ar&&Ar.proxy):Cr}}function hasInjectionContext(){return!!(currentInstance||currentRenderingInstance||currentApp)}function initProps(Tr,Cr,$r,Ar=!1){const Rr={},Dr={};def(Dr,InternalObjectKey,1),Tr.propsDefaults=Object.create(null),setFullProps(Tr,Cr,Rr,Dr);for(const Mr in Tr.propsOptions[0])Mr in Rr||(Rr[Mr]=void 0);$r?Tr.props=Ar?Rr:shallowReactive(Rr):Tr.type.props?Tr.props=Rr:Tr.props=Dr,Tr.attrs=Dr}function updateProps(Tr,Cr,$r,Ar){const{props:Rr,attrs:Dr,vnode:{patchFlag:Mr}}=Tr,Br=toRaw(Rr),[Nr]=Tr.propsOptions;let Lr=!1;if((Ar||Mr>0)&&!(Mr&16)){if(Mr&8){const Hr=Tr.vnode.dynamicProps;for(let zr=0;zr{Nr=!0;const[Ur,Vr]=normalizePropsOptions(zr,Cr,!0);extend$1(Mr,Ur),Vr&&Br.push(...Vr)};!$r&&Cr.mixins.length&&Cr.mixins.forEach(Hr),Tr.extends&&Hr(Tr.extends),Tr.mixins&&Tr.mixins.forEach(Hr)}if(!Dr&&!Nr)return isObject$5(Tr)&&Ar.set(Tr,EMPTY_ARR),EMPTY_ARR;if(isArray$4(Dr))for(let Hr=0;Hr-1,Vr[1]=Gr<0||jr-1||hasOwn$2(Vr,"default"))&&Br.push(zr)}}}const Lr=[Mr,Br];return isObject$5(Tr)&&Ar.set(Tr,Lr),Lr}function validatePropName(Tr){return Tr[0]!=="$"}function getType$1(Tr){const Cr=Tr&&Tr.toString().match(/^\s*(function|class) (\w+)/);return Cr?Cr[2]:Tr===null?"null":""}function isSameType(Tr,Cr){return getType$1(Tr)===getType$1(Cr)}function getTypeIndex(Tr,Cr){return isArray$4(Cr)?Cr.findIndex($r=>isSameType($r,Tr)):isFunction$4(Cr)&&isSameType(Cr,Tr)?0:-1}const isInternalKey=Tr=>Tr[0]==="_"||Tr==="$stable",normalizeSlotValue=Tr=>isArray$4(Tr)?Tr.map(normalizeVNode):[normalizeVNode(Tr)],normalizeSlot$1=(Tr,Cr,$r)=>{if(Cr._n)return Cr;const Ar=withCtx((...Rr)=>normalizeSlotValue(Cr(...Rr)),$r);return Ar._c=!1,Ar},normalizeObjectSlots=(Tr,Cr,$r)=>{const Ar=Tr._ctx;for(const Rr in Tr){if(isInternalKey(Rr))continue;const Dr=Tr[Rr];if(isFunction$4(Dr))Cr[Rr]=normalizeSlot$1(Rr,Dr,Ar);else if(Dr!=null){const Mr=normalizeSlotValue(Dr);Cr[Rr]=()=>Mr}}},normalizeVNodeSlots=(Tr,Cr)=>{const $r=normalizeSlotValue(Cr);Tr.slots.default=()=>$r},initSlots=(Tr,Cr)=>{if(Tr.vnode.shapeFlag&32){const $r=Cr._;$r?(Tr.slots=toRaw(Cr),def(Cr,"_",$r)):normalizeObjectSlots(Cr,Tr.slots={})}else Tr.slots={},Cr&&normalizeVNodeSlots(Tr,Cr);def(Tr.slots,InternalObjectKey,1)},updateSlots=(Tr,Cr,$r)=>{const{vnode:Ar,slots:Rr}=Tr;let Dr=!0,Mr=EMPTY_OBJ;if(Ar.shapeFlag&32){const Br=Cr._;Br?$r&&Br===1?Dr=!1:(extend$1(Rr,Cr),!$r&&Br===1&&delete Rr._):(Dr=!Cr.$stable,normalizeObjectSlots(Cr,Rr)),Mr=Cr}else Cr&&(normalizeVNodeSlots(Tr,Cr),Mr={default:1});if(Dr)for(const Br in Rr)!isInternalKey(Br)&&Mr[Br]==null&&delete Rr[Br]};function setRef(Tr,Cr,$r,Ar,Rr=!1){if(isArray$4(Tr)){Tr.forEach((Ur,Vr)=>setRef(Ur,Cr&&(isArray$4(Cr)?Cr[Vr]:Cr),$r,Ar,Rr));return}if(isAsyncWrapper(Ar)&&!Rr)return;const Dr=Ar.shapeFlag&4?getExposeProxy(Ar.component)||Ar.component.proxy:Ar.el,Mr=Rr?null:Dr,{i:Br,r:Nr}=Tr,Lr=Cr&&Cr.r,Hr=Br.refs===EMPTY_OBJ?Br.refs={}:Br.refs,zr=Br.setupState;if(Lr!=null&&Lr!==Nr&&(isString$7(Lr)?(Hr[Lr]=null,hasOwn$2(zr,Lr)&&(zr[Lr]=null)):isRef(Lr)&&(Lr.value=null)),isFunction$4(Nr))callWithErrorHandling(Nr,Br,12,[Mr,Hr]);else{const Ur=isString$7(Nr),Vr=isRef(Nr);if(Ur||Vr){const jr=()=>{if(Tr.f){const Gr=Ur?hasOwn$2(zr,Nr)?zr[Nr]:Hr[Nr]:Nr.value;Rr?isArray$4(Gr)&&remove$1(Gr,Dr):isArray$4(Gr)?Gr.includes(Dr)||Gr.push(Dr):Ur?(Hr[Nr]=[Dr],hasOwn$2(zr,Nr)&&(zr[Nr]=Hr[Nr])):(Nr.value=[Dr],Tr.k&&(Hr[Tr.k]=Nr.value))}else Ur?(Hr[Nr]=Mr,hasOwn$2(zr,Nr)&&(zr[Nr]=Mr)):Vr&&(Nr.value=Mr,Tr.k&&(Hr[Tr.k]=Mr))};Mr?(jr.id=-1,queuePostRenderEffect(jr,$r)):jr()}}}let hasMismatch=!1;const isSVGContainer=Tr=>/svg/.test(Tr.namespaceURI)&&Tr.tagName!=="foreignObject",isComment=Tr=>Tr.nodeType===8;function createHydrationFunctions(Tr){const{mt:Cr,p:$r,o:{patchProp:Ar,createText:Rr,nextSibling:Dr,parentNode:Mr,remove:Br,insert:Nr,createComment:Lr}}=Tr,Hr=(eo,Wr)=>{if(!Wr.hasChildNodes()){$r(null,eo,Wr),flushPostFlushCbs(),Wr._vnode=eo;return}hasMismatch=!1,zr(Wr.firstChild,eo,null,null,null),flushPostFlushCbs(),Wr._vnode=eo,hasMismatch&&console.error("Hydration completed but contains mismatches.")},zr=(eo,Wr,Yr,Jr,no,ro=!1)=>{const so=isComment(eo)&&eo.data==="[",ao=()=>Gr(eo,Wr,Yr,Jr,no,so),{type:lo,ref:po,shapeFlag:go,patchFlag:co}=Wr;let mo=eo.nodeType;Wr.el=eo,co===-2&&(ro=!1,Wr.dynamicChildren=null);let io=null;switch(lo){case Text$4:mo!==3?Wr.children===""?(Nr(Wr.el=Rr(""),Mr(eo),eo),io=eo):io=ao():(eo.data!==Wr.children&&(hasMismatch=!0,eo.data=Wr.children),io=Dr(eo));break;case Comment$1:Zr(eo)?(io=Dr(eo),Kr(Wr.el=eo.content.firstChild,eo,Yr)):mo!==8||so?io=ao():io=Dr(eo);break;case Static:if(so&&(eo=Dr(eo),mo=eo.nodeType),mo===1||mo===3){io=eo;const uo=!Wr.children.length;for(let ho=0;ho{ro=ro||!!Wr.dynamicChildren;const{type:so,props:ao,patchFlag:lo,shapeFlag:po,dirs:go,transition:co}=Wr,mo=so==="input"||so==="option";if(mo||lo!==-1){go&&invokeDirectiveHook(Wr,null,Yr,"created");let io=!1;if(Zr(eo)){io=needTransition(Jr,co)&&Yr&&Yr.vnode.props&&Yr.vnode.props.appear;const ho=eo.content.firstChild;io&&co.beforeEnter(ho),Kr(ho,eo,Yr),Wr.el=eo=ho}if(ao)if(mo||!ro||lo&48)for(const ho in ao)(mo&&(ho.endsWith("value")||ho==="indeterminate")||isOn(ho)&&!isReservedProp(ho)||ho[0]===".")&&Ar(eo,ho,null,ao[ho],!1,void 0,Yr);else ao.onClick&&Ar(eo,"onClick",null,ao.onClick,!1,void 0,Yr);let uo;if((uo=ao&&ao.onVnodeBeforeMount)&&invokeVNodeHook(uo,Yr,Wr),go&&invokeDirectiveHook(Wr,null,Yr,"beforeMount"),((uo=ao&&ao.onVnodeMounted)||go||io)&&queueEffectWithSuspense(()=>{uo&&invokeVNodeHook(uo,Yr,Wr),io&&co.enter(eo),go&&invokeDirectiveHook(Wr,null,Yr,"mounted")},Jr),po&16&&!(ao&&(ao.innerHTML||ao.textContent))){let ho=Vr(eo.firstChild,Wr,eo,Yr,Jr,no,ro);for(;ho;){hasMismatch=!0;const yo=ho;ho=ho.nextSibling,Br(yo)}}else po&8&&eo.textContent!==Wr.children&&(hasMismatch=!0,eo.textContent=Wr.children)}return eo.nextSibling},Vr=(eo,Wr,Yr,Jr,no,ro,so)=>{so=so||!!Wr.dynamicChildren;const ao=Wr.children,lo=ao.length;for(let po=0;po{const{slotScopeIds:so}=Wr;so&&(no=no?no.concat(so):so);const ao=Mr(eo),lo=Vr(Dr(eo),Wr,ao,Yr,Jr,no,ro);return lo&&isComment(lo)&&lo.data==="]"?Dr(Wr.anchor=lo):(hasMismatch=!0,Nr(Wr.anchor=Lr("]"),ao,lo),lo)},Gr=(eo,Wr,Yr,Jr,no,ro)=>{if(hasMismatch=!0,Wr.el=null,ro){const lo=Xr(eo);for(;;){const po=Dr(eo);if(po&&po!==lo)Br(po);else break}}const so=Dr(eo),ao=Mr(eo);return Br(eo),$r(null,Wr,ao,so,Yr,Jr,isSVGContainer(ao),no),so},Xr=(eo,Wr="[",Yr="]")=>{let Jr=0;for(;eo;)if(eo=Dr(eo),eo&&isComment(eo)&&(eo.data===Wr&&Jr++,eo.data===Yr)){if(Jr===0)return Dr(eo);Jr--}return eo},Kr=(eo,Wr,Yr)=>{const Jr=Wr.parentNode;Jr&&Jr.replaceChild(eo,Wr);let no=Yr;for(;no;)no.vnode.el===Wr&&(no.vnode.el=no.subTree.el=eo),no=no.parent},Zr=eo=>eo.nodeType===1&&eo.tagName.toLowerCase()==="template";return[Hr,zr]}const queuePostRenderEffect=queueEffectWithSuspense;function createRenderer(Tr){return baseCreateRenderer(Tr)}function createHydrationRenderer(Tr){return baseCreateRenderer(Tr,createHydrationFunctions)}function baseCreateRenderer(Tr,Cr){const $r=getGlobalThis();$r.__VUE__=!0;const{insert:Ar,remove:Rr,patchProp:Dr,createElement:Mr,createText:Br,createComment:Nr,setText:Lr,setElementText:Hr,parentNode:zr,nextSibling:Ur,setScopeId:Vr=NOOP,insertStaticContent:jr}=Tr,Gr=(bo,vo,Io,To=null,Co=null,Po=null,Fo=!1,Vo=null,Ko=!!vo.dynamicChildren)=>{if(bo===vo)return;bo&&!isSameVNodeType(bo,vo)&&(To=Ro(bo),$o(bo,Co,Po,!0),bo=null),vo.patchFlag===-2&&(Ko=!1,vo.dynamicChildren=null);const{type:Uo,ref:ei,shapeFlag:qo}=vo;switch(Uo){case Text$4:Xr(bo,vo,Io,To);break;case Comment$1:Kr(bo,vo,Io,To);break;case Static:bo==null&&Zr(vo,Io,To,Fo);break;case Fragment$1:po(bo,vo,Io,To,Co,Po,Fo,Vo,Ko);break;default:qo&1?Yr(bo,vo,Io,To,Co,Po,Fo,Vo,Ko):qo&6?go(bo,vo,Io,To,Co,Po,Fo,Vo,Ko):(qo&64||qo&128)&&Uo.process(bo,vo,Io,To,Co,Po,Fo,Vo,Ko,zo)}ei!=null&&Co&&setRef(ei,bo&&bo.ref,Po,vo||bo,!vo)},Xr=(bo,vo,Io,To)=>{if(bo==null)Ar(vo.el=Br(vo.children),Io,To);else{const Co=vo.el=bo.el;vo.children!==bo.children&&Lr(Co,vo.children)}},Kr=(bo,vo,Io,To)=>{bo==null?Ar(vo.el=Nr(vo.children||""),Io,To):vo.el=bo.el},Zr=(bo,vo,Io,To)=>{[bo.el,bo.anchor]=jr(bo.children,vo,Io,To,bo.el,bo.anchor)},eo=({el:bo,anchor:vo},Io,To)=>{let Co;for(;bo&&bo!==vo;)Co=Ur(bo),Ar(bo,Io,To),bo=Co;Ar(vo,Io,To)},Wr=({el:bo,anchor:vo})=>{let Io;for(;bo&&bo!==vo;)Io=Ur(bo),Rr(bo),bo=Io;Rr(vo)},Yr=(bo,vo,Io,To,Co,Po,Fo,Vo,Ko)=>{Fo=Fo||vo.type==="svg",bo==null?Jr(vo,Io,To,Co,Po,Fo,Vo,Ko):so(bo,vo,Co,Po,Fo,Vo,Ko)},Jr=(bo,vo,Io,To,Co,Po,Fo,Vo)=>{let Ko,Uo;const{type:ei,props:qo,shapeFlag:ri,transition:ki,dirs:ti}=bo;if(Ko=bo.el=Mr(bo.type,Po,qo&&qo.is,qo),ri&8?Hr(Ko,bo.children):ri&16&&ro(bo.children,Ko,null,To,Co,Po&&ei!=="foreignObject",Fo,Vo),ti&&invokeDirectiveHook(bo,null,To,"created"),no(Ko,bo,bo.scopeId,Fo,To),qo){for(const Xo in qo)Xo!=="value"&&!isReservedProp(Xo)&&Dr(Ko,Xo,null,qo[Xo],Po,bo.children,To,Co,Mo);"value"in qo&&Dr(Ko,"value",null,qo.value),(Uo=qo.onVnodeBeforeMount)&&invokeVNodeHook(Uo,To,bo)}ti&&invokeDirectiveHook(bo,null,To,"beforeMount");const ai=needTransition(Co,ki);ai&&ki.beforeEnter(Ko),Ar(Ko,vo,Io),((Uo=qo&&qo.onVnodeMounted)||ai||ti)&&queuePostRenderEffect(()=>{Uo&&invokeVNodeHook(Uo,To,bo),ai&&ki.enter(Ko),ti&&invokeDirectiveHook(bo,null,To,"mounted")},Co)},no=(bo,vo,Io,To,Co)=>{if(Io&&Vr(bo,Io),To)for(let Po=0;Po{for(let Uo=Ko;Uo{const Vo=vo.el=bo.el;let{patchFlag:Ko,dynamicChildren:Uo,dirs:ei}=vo;Ko|=bo.patchFlag&16;const qo=bo.props||EMPTY_OBJ,ri=vo.props||EMPTY_OBJ;let ki;Io&&toggleRecurse(Io,!1),(ki=ri.onVnodeBeforeUpdate)&&invokeVNodeHook(ki,Io,vo,bo),ei&&invokeDirectiveHook(vo,bo,Io,"beforeUpdate"),Io&&toggleRecurse(Io,!0);const ti=Co&&vo.type!=="foreignObject";if(Uo?ao(bo.dynamicChildren,Uo,Vo,Io,To,ti,Po):Fo||ho(bo,vo,Vo,null,Io,To,ti,Po,!1),Ko>0){if(Ko&16)lo(Vo,vo,qo,ri,Io,To,Co);else if(Ko&2&&qo.class!==ri.class&&Dr(Vo,"class",null,ri.class,Co),Ko&4&&Dr(Vo,"style",qo.style,ri.style,Co),Ko&8){const ai=vo.dynamicProps;for(let Xo=0;Xo{ki&&invokeVNodeHook(ki,Io,vo,bo),ei&&invokeDirectiveHook(vo,bo,Io,"updated")},To)},ao=(bo,vo,Io,To,Co,Po,Fo)=>{for(let Vo=0;Vo{if(Io!==To){if(Io!==EMPTY_OBJ)for(const Vo in Io)!isReservedProp(Vo)&&!(Vo in To)&&Dr(bo,Vo,Io[Vo],null,Fo,vo.children,Co,Po,Mo);for(const Vo in To){if(isReservedProp(Vo))continue;const Ko=To[Vo],Uo=Io[Vo];Ko!==Uo&&Vo!=="value"&&Dr(bo,Vo,Uo,Ko,Fo,vo.children,Co,Po,Mo)}"value"in To&&Dr(bo,"value",Io.value,To.value)}},po=(bo,vo,Io,To,Co,Po,Fo,Vo,Ko)=>{const Uo=vo.el=bo?bo.el:Br(""),ei=vo.anchor=bo?bo.anchor:Br("");let{patchFlag:qo,dynamicChildren:ri,slotScopeIds:ki}=vo;ki&&(Vo=Vo?Vo.concat(ki):ki),bo==null?(Ar(Uo,Io,To),Ar(ei,Io,To),ro(vo.children,Io,ei,Co,Po,Fo,Vo,Ko)):qo>0&&qo&64&&ri&&bo.dynamicChildren?(ao(bo.dynamicChildren,ri,Io,Co,Po,Fo,Vo),(vo.key!=null||Co&&vo===Co.subTree)&&traverseStaticChildren(bo,vo,!0)):ho(bo,vo,Io,ei,Co,Po,Fo,Vo,Ko)},go=(bo,vo,Io,To,Co,Po,Fo,Vo,Ko)=>{vo.slotScopeIds=Vo,bo==null?vo.shapeFlag&512?Co.ctx.activate(vo,Io,To,Fo,Ko):co(vo,Io,To,Co,Po,Fo,Ko):mo(bo,vo,Ko)},co=(bo,vo,Io,To,Co,Po,Fo)=>{const Vo=bo.component=createComponentInstance(bo,To,Co);if(isKeepAlive(bo)&&(Vo.ctx.renderer=zo),setupComponent(Vo),Vo.asyncDep){if(Co&&Co.registerDep(Vo,io),!bo.el){const Ko=Vo.subTree=createVNode(Comment$1);Kr(null,Ko,vo,Io)}return}io(Vo,bo,vo,Io,Co,Po,Fo)},mo=(bo,vo,Io)=>{const To=vo.component=bo.component;if(shouldUpdateComponent(bo,vo,Io))if(To.asyncDep&&!To.asyncResolved){uo(To,vo,Io);return}else To.next=vo,invalidateJob(To.update),To.update();else vo.el=bo.el,To.vnode=vo},io=(bo,vo,Io,To,Co,Po,Fo)=>{const Vo=()=>{if(bo.isMounted){let{next:ei,bu:qo,u:ri,parent:ki,vnode:ti}=bo,ai=ei,Xo;toggleRecurse(bo,!1),ei?(ei.el=ti.el,uo(bo,ei,Fo)):ei=ti,qo&&invokeArrayFns(qo),(Xo=ei.props&&ei.props.onVnodeBeforeUpdate)&&invokeVNodeHook(Xo,ki,ei,ti),toggleRecurse(bo,!0);const si=renderComponentRoot(bo),vi=bo.subTree;bo.subTree=si,Gr(vi,si,zr(vi.el),Ro(vi),bo,Co,Po),ei.el=si.el,ai===null&&updateHOCHostEl(bo,si.el),ri&&queuePostRenderEffect(ri,Co),(Xo=ei.props&&ei.props.onVnodeUpdated)&&queuePostRenderEffect(()=>invokeVNodeHook(Xo,ki,ei,ti),Co)}else{let ei;const{el:qo,props:ri}=vo,{bm:ki,m:ti,parent:ai}=bo,Xo=isAsyncWrapper(vo);if(toggleRecurse(bo,!1),ki&&invokeArrayFns(ki),!Xo&&(ei=ri&&ri.onVnodeBeforeMount)&&invokeVNodeHook(ei,ai,vo),toggleRecurse(bo,!0),qo&&Bo){const si=()=>{bo.subTree=renderComponentRoot(bo),Bo(qo,bo.subTree,bo,Co,null)};Xo?vo.type.__asyncLoader().then(()=>!bo.isUnmounted&&si()):si()}else{const si=bo.subTree=renderComponentRoot(bo);Gr(null,si,Io,To,bo,Co,Po),vo.el=si.el}if(ti&&queuePostRenderEffect(ti,Co),!Xo&&(ei=ri&&ri.onVnodeMounted)){const si=vo;queuePostRenderEffect(()=>invokeVNodeHook(ei,ai,si),Co)}(vo.shapeFlag&256||ai&&isAsyncWrapper(ai.vnode)&&ai.vnode.shapeFlag&256)&&bo.a&&queuePostRenderEffect(bo.a,Co),bo.isMounted=!0,vo=Io=To=null}},Ko=bo.effect=new ReactiveEffect(Vo,()=>queueJob(Uo),bo.scope),Uo=bo.update=()=>Ko.run();Uo.id=bo.uid,toggleRecurse(bo,!0),Uo()},uo=(bo,vo,Io)=>{vo.component=bo;const To=bo.vnode.props;bo.vnode=vo,bo.next=null,updateProps(bo,vo.props,To,Io),updateSlots(bo,vo.children,Io),pauseTracking(),flushPreFlushCbs(bo),resetTracking()},ho=(bo,vo,Io,To,Co,Po,Fo,Vo,Ko=!1)=>{const Uo=bo&&bo.children,ei=bo?bo.shapeFlag:0,qo=vo.children,{patchFlag:ri,shapeFlag:ki}=vo;if(ri>0){if(ri&128){So(Uo,qo,Io,To,Co,Po,Fo,Vo,Ko);return}else if(ri&256){yo(Uo,qo,Io,To,Co,Po,Fo,Vo,Ko);return}}ki&8?(ei&16&&Mo(Uo,Co,Po),qo!==Uo&&Hr(Io,qo)):ei&16?ki&16?So(Uo,qo,Io,To,Co,Po,Fo,Vo,Ko):Mo(Uo,Co,Po,!0):(ei&8&&Hr(Io,""),ki&16&&ro(qo,Io,To,Co,Po,Fo,Vo,Ko))},yo=(bo,vo,Io,To,Co,Po,Fo,Vo,Ko)=>{bo=bo||EMPTY_ARR,vo=vo||EMPTY_ARR;const Uo=bo.length,ei=vo.length,qo=Math.min(Uo,ei);let ri;for(ri=0;riei?Mo(bo,Co,Po,!0,!1,qo):ro(vo,Io,To,Co,Po,Fo,Vo,Ko,qo)},So=(bo,vo,Io,To,Co,Po,Fo,Vo,Ko)=>{let Uo=0;const ei=vo.length;let qo=bo.length-1,ri=ei-1;for(;Uo<=qo&&Uo<=ri;){const ki=bo[Uo],ti=vo[Uo]=Ko?cloneIfMounted(vo[Uo]):normalizeVNode(vo[Uo]);if(isSameVNodeType(ki,ti))Gr(ki,ti,Io,null,Co,Po,Fo,Vo,Ko);else break;Uo++}for(;Uo<=qo&&Uo<=ri;){const ki=bo[qo],ti=vo[ri]=Ko?cloneIfMounted(vo[ri]):normalizeVNode(vo[ri]);if(isSameVNodeType(ki,ti))Gr(ki,ti,Io,null,Co,Po,Fo,Vo,Ko);else break;qo--,ri--}if(Uo>qo){if(Uo<=ri){const ki=ri+1,ti=kiri)for(;Uo<=qo;)$o(bo[Uo],Co,Po,!0),Uo++;else{const ki=Uo,ti=Uo,ai=new Map;for(Uo=ti;Uo<=ri;Uo++){const ci=vo[Uo]=Ko?cloneIfMounted(vo[Uo]):normalizeVNode(vo[Uo]);ci.key!=null&&ai.set(ci.key,Uo)}let Xo,si=0;const vi=ri-ti+1;let Ci=!1,wi=0;const bi=new Array(vi);for(Uo=0;Uo=vi){$o(ci,Co,Po,!0);continue}let Ii;if(ci.key!=null)Ii=ai.get(ci.key);else for(Xo=ti;Xo<=ri;Xo++)if(bi[Xo-ti]===0&&isSameVNodeType(ci,vo[Xo])){Ii=Xo;break}Ii===void 0?$o(ci,Co,Po,!0):(bi[Ii-ti]=Uo+1,Ii>=wi?wi=Ii:Ci=!0,Gr(ci,vo[Ii],Io,null,Co,Po,Fo,Vo,Ko),si++)}const li=Ci?getSequence(bi):EMPTY_ARR;for(Xo=li.length-1,Uo=vi-1;Uo>=0;Uo--){const ci=ti+Uo,Ii=vo[ci],Ni=ci+1{const{el:Po,type:Fo,transition:Vo,children:Ko,shapeFlag:Uo}=bo;if(Uo&6){ko(bo.component.subTree,vo,Io,To);return}if(Uo&128){bo.suspense.move(vo,Io,To);return}if(Uo&64){Fo.move(bo,vo,Io,zo);return}if(Fo===Fragment$1){Ar(Po,vo,Io);for(let qo=0;qoVo.enter(Po),Co);else{const{leave:qo,delayLeave:ri,afterLeave:ki}=Vo,ti=()=>Ar(Po,vo,Io),ai=()=>{qo(Po,()=>{ti(),ki&&ki()})};ri?ri(Po,ti,ai):ai()}else Ar(Po,vo,Io)},$o=(bo,vo,Io,To=!1,Co=!1)=>{const{type:Po,props:Fo,ref:Vo,children:Ko,dynamicChildren:Uo,shapeFlag:ei,patchFlag:qo,dirs:ri}=bo;if(Vo!=null&&setRef(Vo,null,Io,bo,!0),ei&256){vo.ctx.deactivate(bo);return}const ki=ei&1&&ri,ti=!isAsyncWrapper(bo);let ai;if(ti&&(ai=Fo&&Fo.onVnodeBeforeUnmount)&&invokeVNodeHook(ai,vo,bo),ei&6)Eo(bo.component,Io,To);else{if(ei&128){bo.suspense.unmount(Io,To);return}ki&&invokeDirectiveHook(bo,null,vo,"beforeUnmount"),ei&64?bo.type.remove(bo,vo,Io,Co,zo,To):Uo&&(Po!==Fragment$1||qo>0&&qo&64)?Mo(Uo,vo,Io,!1,!0):(Po===Fragment$1&&qo&384||!Co&&ei&16)&&Mo(Ko,vo,Io),To&&Go(bo)}(ti&&(ai=Fo&&Fo.onVnodeUnmounted)||ki)&&queuePostRenderEffect(()=>{ai&&invokeVNodeHook(ai,vo,bo),ki&&invokeDirectiveHook(bo,null,vo,"unmounted")},Io)},Go=bo=>{const{type:vo,el:Io,anchor:To,transition:Co}=bo;if(vo===Fragment$1){No(Io,To);return}if(vo===Static){Wr(bo);return}const Po=()=>{Rr(Io),Co&&!Co.persisted&&Co.afterLeave&&Co.afterLeave()};if(bo.shapeFlag&1&&Co&&!Co.persisted){const{leave:Fo,delayLeave:Vo}=Co,Ko=()=>Fo(Io,Po);Vo?Vo(bo.el,Po,Ko):Ko()}else Po()},No=(bo,vo)=>{let Io;for(;bo!==vo;)Io=Ur(bo),Rr(bo),bo=Io;Rr(vo)},Eo=(bo,vo,Io)=>{const{bum:To,scope:Co,update:Po,subTree:Fo,um:Vo}=bo;To&&invokeArrayFns(To),Co.stop(),Po&&(Po.active=!1,$o(Fo,bo,vo,Io)),Vo&&queuePostRenderEffect(Vo,vo),queuePostRenderEffect(()=>{bo.isUnmounted=!0},vo),vo&&vo.pendingBranch&&!vo.isUnmounted&&bo.asyncDep&&!bo.asyncResolved&&bo.suspenseId===vo.pendingId&&(vo.deps--,vo.deps===0&&vo.resolve())},Mo=(bo,vo,Io,To=!1,Co=!1,Po=0)=>{for(let Fo=Po;Fobo.shapeFlag&6?Ro(bo.component.subTree):bo.shapeFlag&128?bo.suspense.next():Ur(bo.anchor||bo.el),Ao=(bo,vo,Io)=>{bo==null?vo._vnode&&$o(vo._vnode,null,null,!0):Gr(vo._vnode||null,bo,vo,null,null,null,Io),flushPreFlushCbs(),flushPostFlushCbs(),vo._vnode=bo},zo={p:Gr,um:$o,m:ko,r:Go,mt:co,mc:ro,pc:ho,pbc:ao,n:Ro,o:Tr};let Oo,Bo;return Cr&&([Oo,Bo]=Cr(zo)),{render:Ao,hydrate:Oo,createApp:createAppAPI(Ao,Oo)}}function toggleRecurse({effect:Tr,update:Cr},$r){Tr.allowRecurse=Cr.allowRecurse=$r}function needTransition(Tr,Cr){return(!Tr||Tr&&!Tr.pendingBranch)&&Cr&&!Cr.persisted}function traverseStaticChildren(Tr,Cr,$r=!1){const Ar=Tr.children,Rr=Cr.children;if(isArray$4(Ar)&&isArray$4(Rr))for(let Dr=0;Dr>1,Tr[$r[Br]]0&&(Cr[Ar]=$r[Dr-1]),$r[Dr]=Ar)}}for(Dr=$r.length,Mr=$r[Dr-1];Dr-- >0;)$r[Dr]=Mr,Mr=Cr[Mr];return $r}const isTeleport=Tr=>Tr.__isTeleport,isTeleportDisabled=Tr=>Tr&&(Tr.disabled||Tr.disabled===""),isTargetSVG=Tr=>typeof SVGElement<"u"&&Tr instanceof SVGElement,resolveTarget=(Tr,Cr)=>{const $r=Tr&&Tr.to;return isString$7($r)?Cr?Cr($r):null:$r},TeleportImpl={name:"Teleport",__isTeleport:!0,process(Tr,Cr,$r,Ar,Rr,Dr,Mr,Br,Nr,Lr){const{mc:Hr,pc:zr,pbc:Ur,o:{insert:Vr,querySelector:jr,createText:Gr,createComment:Xr}}=Lr,Kr=isTeleportDisabled(Cr.props);let{shapeFlag:Zr,children:eo,dynamicChildren:Wr}=Cr;if(Tr==null){const Yr=Cr.el=Gr(""),Jr=Cr.anchor=Gr("");Vr(Yr,$r,Ar),Vr(Jr,$r,Ar);const no=Cr.target=resolveTarget(Cr.props,jr),ro=Cr.targetAnchor=Gr("");no&&(Vr(ro,no),Mr=Mr||isTargetSVG(no));const so=(ao,lo)=>{Zr&16&&Hr(eo,ao,lo,Rr,Dr,Mr,Br,Nr)};Kr?so($r,Jr):no&&so(no,ro)}else{Cr.el=Tr.el;const Yr=Cr.anchor=Tr.anchor,Jr=Cr.target=Tr.target,no=Cr.targetAnchor=Tr.targetAnchor,ro=isTeleportDisabled(Tr.props),so=ro?$r:Jr,ao=ro?Yr:no;if(Mr=Mr||isTargetSVG(Jr),Wr?(Ur(Tr.dynamicChildren,Wr,so,Rr,Dr,Mr,Br),traverseStaticChildren(Tr,Cr,!0)):Nr||zr(Tr,Cr,so,ao,Rr,Dr,Mr,Br,!1),Kr)ro?Cr.props&&Tr.props&&Cr.props.to!==Tr.props.to&&(Cr.props.to=Tr.props.to):moveTeleport(Cr,$r,Yr,Lr,1);else if((Cr.props&&Cr.props.to)!==(Tr.props&&Tr.props.to)){const lo=Cr.target=resolveTarget(Cr.props,jr);lo&&moveTeleport(Cr,lo,null,Lr,0)}else ro&&moveTeleport(Cr,Jr,no,Lr,1)}updateCssVars(Cr)},remove(Tr,Cr,$r,Ar,{um:Rr,o:{remove:Dr}},Mr){const{shapeFlag:Br,children:Nr,anchor:Lr,targetAnchor:Hr,target:zr,props:Ur}=Tr;if(zr&&Dr(Hr),Mr&&Dr(Lr),Br&16){const Vr=Mr||!isTeleportDisabled(Ur);for(let jr=0;jr0?currentBlock||EMPTY_ARR:null,closeBlock(),isBlockTreeEnabled>0&¤tBlock&¤tBlock.push(Tr),Tr}function createElementBlock(Tr,Cr,$r,Ar,Rr,Dr){return setupBlock(createBaseVNode(Tr,Cr,$r,Ar,Rr,Dr,!0))}function createBlock(Tr,Cr,$r,Ar,Rr){return setupBlock(createVNode(Tr,Cr,$r,Ar,Rr,!0))}function isVNode(Tr){return Tr?Tr.__v_isVNode===!0:!1}function isSameVNodeType(Tr,Cr){return Tr.type===Cr.type&&Tr.key===Cr.key}const InternalObjectKey="__vInternal",normalizeKey=({key:Tr})=>Tr??null,normalizeRef=({ref:Tr,ref_key:Cr,ref_for:$r})=>(typeof Tr=="number"&&(Tr=""+Tr),Tr!=null?isString$7(Tr)||isRef(Tr)||isFunction$4(Tr)?{i:currentRenderingInstance,r:Tr,k:Cr,f:!!$r}:Tr:null);function createBaseVNode(Tr,Cr=null,$r=null,Ar=0,Rr=null,Dr=Tr===Fragment$1?0:1,Mr=!1,Br=!1){const Nr={__v_isVNode:!0,__v_skip:!0,type:Tr,props:Cr,key:Cr&&normalizeKey(Cr),ref:Cr&&normalizeRef(Cr),scopeId:currentScopeId,slotScopeIds:null,children:$r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:Dr,patchFlag:Ar,dynamicProps:Rr,dynamicChildren:null,appContext:null,ctx:currentRenderingInstance};return Br?(normalizeChildren(Nr,$r),Dr&128&&Tr.normalize(Nr)):$r&&(Nr.shapeFlag|=isString$7($r)?8:16),isBlockTreeEnabled>0&&!Mr&¤tBlock&&(Nr.patchFlag>0||Dr&6)&&Nr.patchFlag!==32&¤tBlock.push(Nr),Nr}const createVNode=_createVNode;function _createVNode(Tr,Cr=null,$r=null,Ar=0,Rr=null,Dr=!1){if((!Tr||Tr===NULL_DYNAMIC_COMPONENT)&&(Tr=Comment$1),isVNode(Tr)){const Br=cloneVNode(Tr,Cr,!0);return $r&&normalizeChildren(Br,$r),isBlockTreeEnabled>0&&!Dr&¤tBlock&&(Br.shapeFlag&6?currentBlock[currentBlock.indexOf(Tr)]=Br:currentBlock.push(Br)),Br.patchFlag|=-2,Br}if(isClassComponent(Tr)&&(Tr=Tr.__vccOpts),Cr){Cr=guardReactiveProps(Cr);let{class:Br,style:Nr}=Cr;Br&&!isString$7(Br)&&(Cr.class=normalizeClass(Br)),isObject$5(Nr)&&(isProxy(Nr)&&!isArray$4(Nr)&&(Nr=extend$1({},Nr)),Cr.style=normalizeStyle(Nr))}const Mr=isString$7(Tr)?1:isSuspense(Tr)?128:isTeleport(Tr)?64:isObject$5(Tr)?4:isFunction$4(Tr)?2:0;return createBaseVNode(Tr,Cr,$r,Ar,Rr,Mr,Dr,!0)}function guardReactiveProps(Tr){return Tr?isProxy(Tr)||InternalObjectKey in Tr?extend$1({},Tr):Tr:null}function cloneVNode(Tr,Cr,$r=!1){const{props:Ar,ref:Rr,patchFlag:Dr,children:Mr}=Tr,Br=Cr?mergeProps(Ar||{},Cr):Ar;return{__v_isVNode:!0,__v_skip:!0,type:Tr.type,props:Br,key:Br&&normalizeKey(Br),ref:Cr&&Cr.ref?$r&&Rr?isArray$4(Rr)?Rr.concat(normalizeRef(Cr)):[Rr,normalizeRef(Cr)]:normalizeRef(Cr):Rr,scopeId:Tr.scopeId,slotScopeIds:Tr.slotScopeIds,children:Mr,target:Tr.target,targetAnchor:Tr.targetAnchor,staticCount:Tr.staticCount,shapeFlag:Tr.shapeFlag,patchFlag:Cr&&Tr.type!==Fragment$1?Dr===-1?16:Dr|16:Dr,dynamicProps:Tr.dynamicProps,dynamicChildren:Tr.dynamicChildren,appContext:Tr.appContext,dirs:Tr.dirs,transition:Tr.transition,component:Tr.component,suspense:Tr.suspense,ssContent:Tr.ssContent&&cloneVNode(Tr.ssContent),ssFallback:Tr.ssFallback&&cloneVNode(Tr.ssFallback),el:Tr.el,anchor:Tr.anchor,ctx:Tr.ctx,ce:Tr.ce}}function createTextVNode(Tr=" ",Cr=0){return createVNode(Text$4,null,Tr,Cr)}function createStaticVNode(Tr,Cr){const $r=createVNode(Static,null,Tr);return $r.staticCount=Cr,$r}function createCommentVNode(Tr="",Cr=!1){return Cr?(openBlock(),createBlock(Comment$1,null,Tr)):createVNode(Comment$1,null,Tr)}function normalizeVNode(Tr){return Tr==null||typeof Tr=="boolean"?createVNode(Comment$1):isArray$4(Tr)?createVNode(Fragment$1,null,Tr.slice()):typeof Tr=="object"?cloneIfMounted(Tr):createVNode(Text$4,null,String(Tr))}function cloneIfMounted(Tr){return Tr.el===null&&Tr.patchFlag!==-1||Tr.memo?Tr:cloneVNode(Tr)}function normalizeChildren(Tr,Cr){let $r=0;const{shapeFlag:Ar}=Tr;if(Cr==null)Cr=null;else if(isArray$4(Cr))$r=16;else if(typeof Cr=="object")if(Ar&65){const Rr=Cr.default;Rr&&(Rr._c&&(Rr._d=!1),normalizeChildren(Tr,Rr()),Rr._c&&(Rr._d=!0));return}else{$r=32;const Rr=Cr._;!Rr&&!(InternalObjectKey in Cr)?Cr._ctx=currentRenderingInstance:Rr===3&¤tRenderingInstance&&(currentRenderingInstance.slots._===1?Cr._=1:(Cr._=2,Tr.patchFlag|=1024))}else isFunction$4(Cr)?(Cr={default:Cr,_ctx:currentRenderingInstance},$r=32):(Cr=String(Cr),Ar&64?($r=16,Cr=[createTextVNode(Cr)]):$r=8);Tr.children=Cr,Tr.shapeFlag|=$r}function mergeProps(...Tr){const Cr={};for(let $r=0;$rcurrentInstance||currentRenderingInstance;let internalSetCurrentInstance,globalCurrentInstanceSetters,settersKey="__VUE_INSTANCE_SETTERS__";(globalCurrentInstanceSetters=getGlobalThis()[settersKey])||(globalCurrentInstanceSetters=getGlobalThis()[settersKey]=[]),globalCurrentInstanceSetters.push(Tr=>currentInstance=Tr),internalSetCurrentInstance=Tr=>{globalCurrentInstanceSetters.length>1?globalCurrentInstanceSetters.forEach(Cr=>Cr(Tr)):globalCurrentInstanceSetters[0](Tr)};const setCurrentInstance=Tr=>{internalSetCurrentInstance(Tr),Tr.scope.on()},unsetCurrentInstance=()=>{currentInstance&¤tInstance.scope.off(),internalSetCurrentInstance(null)};function isStatefulComponent(Tr){return Tr.vnode.shapeFlag&4}let isInSSRComponentSetup=!1;function setupComponent(Tr,Cr=!1){isInSSRComponentSetup=Cr;const{props:$r,children:Ar}=Tr.vnode,Rr=isStatefulComponent(Tr);initProps(Tr,$r,Rr,Cr),initSlots(Tr,Ar);const Dr=Rr?setupStatefulComponent(Tr,Cr):void 0;return isInSSRComponentSetup=!1,Dr}function setupStatefulComponent(Tr,Cr){const $r=Tr.type;Tr.accessCache=Object.create(null),Tr.proxy=markRaw(new Proxy(Tr.ctx,PublicInstanceProxyHandlers));const{setup:Ar}=$r;if(Ar){const Rr=Tr.setupContext=Ar.length>1?createSetupContext(Tr):null;setCurrentInstance(Tr),pauseTracking();const Dr=callWithErrorHandling(Ar,Tr,0,[Tr.props,Rr]);if(resetTracking(),unsetCurrentInstance(),isPromise(Dr)){if(Dr.then(unsetCurrentInstance,unsetCurrentInstance),Cr)return Dr.then(Mr=>{handleSetupResult(Tr,Mr,Cr)}).catch(Mr=>{handleError$2(Mr,Tr,0)});Tr.asyncDep=Dr}else handleSetupResult(Tr,Dr,Cr)}else finishComponentSetup(Tr,Cr)}function handleSetupResult(Tr,Cr,$r){isFunction$4(Cr)?Tr.type.__ssrInlineRender?Tr.ssrRender=Cr:Tr.render=Cr:isObject$5(Cr)&&(Tr.setupState=proxyRefs(Cr)),finishComponentSetup(Tr,$r)}let compile$2;function finishComponentSetup(Tr,Cr,$r){const Ar=Tr.type;if(!Tr.render){if(!Cr&&compile$2&&!Ar.render){const Rr=Ar.template||resolveMergedOptions(Tr).template;if(Rr){const{isCustomElement:Dr,compilerOptions:Mr}=Tr.appContext.config,{delimiters:Br,compilerOptions:Nr}=Ar,Lr=extend$1(extend$1({isCustomElement:Dr,delimiters:Br},Mr),Nr);Ar.render=compile$2(Rr,Lr)}}Tr.render=Ar.render||NOOP}{setCurrentInstance(Tr),pauseTracking();try{applyOptions(Tr)}finally{resetTracking(),unsetCurrentInstance()}}}function getAttrsProxy(Tr){return Tr.attrsProxy||(Tr.attrsProxy=new Proxy(Tr.attrs,{get(Cr,$r){return track(Tr,"get","$attrs"),Cr[$r]}}))}function createSetupContext(Tr){const Cr=$r=>{Tr.exposed=$r||{}};return{get attrs(){return getAttrsProxy(Tr)},slots:Tr.slots,emit:Tr.emit,expose:Cr}}function getExposeProxy(Tr){if(Tr.exposed)return Tr.exposeProxy||(Tr.exposeProxy=new Proxy(proxyRefs(markRaw(Tr.exposed)),{get(Cr,$r){if($r in Cr)return Cr[$r];if($r in publicPropertiesMap)return publicPropertiesMap[$r](Tr)},has(Cr,$r){return $r in Cr||$r in publicPropertiesMap}}))}function getComponentName(Tr,Cr=!0){return isFunction$4(Tr)?Tr.displayName||Tr.name:Tr.name||Cr&&Tr.__name}function isClassComponent(Tr){return isFunction$4(Tr)&&"__vccOpts"in Tr}const computed=(Tr,Cr)=>computed$1(Tr,Cr,isInSSRComponentSetup);function h$5(Tr,Cr,$r){const Ar=arguments.length;return Ar===2?isObject$5(Cr)&&!isArray$4(Cr)?isVNode(Cr)?createVNode(Tr,null,[Cr]):createVNode(Tr,Cr):createVNode(Tr,null,Cr):(Ar>3?$r=Array.prototype.slice.call(arguments,2):Ar===3&&isVNode($r)&&($r=[$r]),createVNode(Tr,Cr,$r))}const ssrContextKey=Symbol.for("v-scx"),useSSRContext=()=>inject(ssrContextKey),version$7="3.3.13",svgNS="http://www.w3.org/2000/svg",doc$2=typeof document<"u"?document:null,templateContainer=doc$2&&doc$2.createElement("template"),nodeOps={insert:(Tr,Cr,$r)=>{Cr.insertBefore(Tr,$r||null)},remove:Tr=>{const Cr=Tr.parentNode;Cr&&Cr.removeChild(Tr)},createElement:(Tr,Cr,$r,Ar)=>{const Rr=Cr?doc$2.createElementNS(svgNS,Tr):doc$2.createElement(Tr,$r?{is:$r}:void 0);return Tr==="select"&&Ar&&Ar.multiple!=null&&Rr.setAttribute("multiple",Ar.multiple),Rr},createText:Tr=>doc$2.createTextNode(Tr),createComment:Tr=>doc$2.createComment(Tr),setText:(Tr,Cr)=>{Tr.nodeValue=Cr},setElementText:(Tr,Cr)=>{Tr.textContent=Cr},parentNode:Tr=>Tr.parentNode,nextSibling:Tr=>Tr.nextSibling,querySelector:Tr=>doc$2.querySelector(Tr),setScopeId(Tr,Cr){Tr.setAttribute(Cr,"")},insertStaticContent(Tr,Cr,$r,Ar,Rr,Dr){const Mr=$r?$r.previousSibling:Cr.lastChild;if(Rr&&(Rr===Dr||Rr.nextSibling))for(;Cr.insertBefore(Rr.cloneNode(!0),$r),!(Rr===Dr||!(Rr=Rr.nextSibling)););else{templateContainer.innerHTML=Ar?`${Tr}`:Tr;const Br=templateContainer.content;if(Ar){const Nr=Br.firstChild;for(;Nr.firstChild;)Br.appendChild(Nr.firstChild);Br.removeChild(Nr)}Cr.insertBefore(Br,$r)}return[Mr?Mr.nextSibling:Cr.firstChild,$r?$r.previousSibling:Cr.lastChild]}},TRANSITION="transition",ANIMATION="animation",vtcKey=Symbol("_vtc"),Transition=(Tr,{slots:Cr})=>h$5(BaseTransition,resolveTransitionProps(Tr),Cr);Transition.displayName="Transition";const DOMTransitionPropsValidators={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},TransitionPropsValidators=Transition.props=extend$1({},BaseTransitionPropsValidators,DOMTransitionPropsValidators),callHook=(Tr,Cr=[])=>{isArray$4(Tr)?Tr.forEach($r=>$r(...Cr)):Tr&&Tr(...Cr)},hasExplicitCallback=Tr=>Tr?isArray$4(Tr)?Tr.some(Cr=>Cr.length>1):Tr.length>1:!1;function resolveTransitionProps(Tr){const Cr={};for(const po in Tr)po in DOMTransitionPropsValidators||(Cr[po]=Tr[po]);if(Tr.css===!1)return Cr;const{name:$r="v",type:Ar,duration:Rr,enterFromClass:Dr=`${$r}-enter-from`,enterActiveClass:Mr=`${$r}-enter-active`,enterToClass:Br=`${$r}-enter-to`,appearFromClass:Nr=Dr,appearActiveClass:Lr=Mr,appearToClass:Hr=Br,leaveFromClass:zr=`${$r}-leave-from`,leaveActiveClass:Ur=`${$r}-leave-active`,leaveToClass:Vr=`${$r}-leave-to`}=Tr,jr=normalizeDuration(Rr),Gr=jr&&jr[0],Xr=jr&&jr[1],{onBeforeEnter:Kr,onEnter:Zr,onEnterCancelled:eo,onLeave:Wr,onLeaveCancelled:Yr,onBeforeAppear:Jr=Kr,onAppear:no=Zr,onAppearCancelled:ro=eo}=Cr,so=(po,go,co)=>{removeTransitionClass(po,go?Hr:Br),removeTransitionClass(po,go?Lr:Mr),co&&co()},ao=(po,go)=>{po._isLeaving=!1,removeTransitionClass(po,zr),removeTransitionClass(po,Vr),removeTransitionClass(po,Ur),go&&go()},lo=po=>(go,co)=>{const mo=po?no:Zr,io=()=>so(go,po,co);callHook(mo,[go,io]),nextFrame(()=>{removeTransitionClass(go,po?Nr:Dr),addTransitionClass(go,po?Hr:Br),hasExplicitCallback(mo)||whenTransitionEnds(go,Ar,Gr,io)})};return extend$1(Cr,{onBeforeEnter(po){callHook(Kr,[po]),addTransitionClass(po,Dr),addTransitionClass(po,Mr)},onBeforeAppear(po){callHook(Jr,[po]),addTransitionClass(po,Nr),addTransitionClass(po,Lr)},onEnter:lo(!1),onAppear:lo(!0),onLeave(po,go){po._isLeaving=!0;const co=()=>ao(po,go);addTransitionClass(po,zr),forceReflow(),addTransitionClass(po,Ur),nextFrame(()=>{po._isLeaving&&(removeTransitionClass(po,zr),addTransitionClass(po,Vr),hasExplicitCallback(Wr)||whenTransitionEnds(po,Ar,Xr,co))}),callHook(Wr,[po,co])},onEnterCancelled(po){so(po,!1),callHook(eo,[po])},onAppearCancelled(po){so(po,!0),callHook(ro,[po])},onLeaveCancelled(po){ao(po),callHook(Yr,[po])}})}function normalizeDuration(Tr){if(Tr==null)return null;if(isObject$5(Tr))return[NumberOf(Tr.enter),NumberOf(Tr.leave)];{const Cr=NumberOf(Tr);return[Cr,Cr]}}function NumberOf(Tr){return toNumber$1(Tr)}function addTransitionClass(Tr,Cr){Cr.split(/\s+/).forEach($r=>$r&&Tr.classList.add($r)),(Tr[vtcKey]||(Tr[vtcKey]=new Set)).add(Cr)}function removeTransitionClass(Tr,Cr){Cr.split(/\s+/).forEach(Ar=>Ar&&Tr.classList.remove(Ar));const $r=Tr[vtcKey];$r&&($r.delete(Cr),$r.size||(Tr[vtcKey]=void 0))}function nextFrame(Tr){requestAnimationFrame(()=>{requestAnimationFrame(Tr)})}let endId=0;function whenTransitionEnds(Tr,Cr,$r,Ar){const Rr=Tr._endId=++endId,Dr=()=>{Rr===Tr._endId&&Ar()};if($r)return setTimeout(Dr,$r);const{type:Mr,timeout:Br,propCount:Nr}=getTransitionInfo(Tr,Cr);if(!Mr)return Ar();const Lr=Mr+"end";let Hr=0;const zr=()=>{Tr.removeEventListener(Lr,Ur),Dr()},Ur=Vr=>{Vr.target===Tr&&++Hr>=Nr&&zr()};setTimeout(()=>{Hr($r[jr]||"").split(", "),Rr=Ar(`${TRANSITION}Delay`),Dr=Ar(`${TRANSITION}Duration`),Mr=getTimeout(Rr,Dr),Br=Ar(`${ANIMATION}Delay`),Nr=Ar(`${ANIMATION}Duration`),Lr=getTimeout(Br,Nr);let Hr=null,zr=0,Ur=0;Cr===TRANSITION?Mr>0&&(Hr=TRANSITION,zr=Mr,Ur=Dr.length):Cr===ANIMATION?Lr>0&&(Hr=ANIMATION,zr=Lr,Ur=Nr.length):(zr=Math.max(Mr,Lr),Hr=zr>0?Mr>Lr?TRANSITION:ANIMATION:null,Ur=Hr?Hr===TRANSITION?Dr.length:Nr.length:0);const Vr=Hr===TRANSITION&&/\b(transform|all)(,|$)/.test(Ar(`${TRANSITION}Property`).toString());return{type:Hr,timeout:zr,propCount:Ur,hasTransform:Vr}}function getTimeout(Tr,Cr){for(;Tr.lengthtoMs($r)+toMs(Tr[Ar])))}function toMs(Tr){return Tr==="auto"?0:Number(Tr.slice(0,-1).replace(",","."))*1e3}function forceReflow(){return document.body.offsetHeight}function patchClass(Tr,Cr,$r){const Ar=Tr[vtcKey];Ar&&(Cr=(Cr?[Cr,...Ar]:[...Ar]).join(" ")),Cr==null?Tr.removeAttribute("class"):$r?Tr.setAttribute("class",Cr):Tr.className=Cr}const vShowOldKey=Symbol("_vod"),vShow={beforeMount(Tr,{value:Cr},{transition:$r}){Tr[vShowOldKey]=Tr.style.display==="none"?"":Tr.style.display,$r&&Cr?$r.beforeEnter(Tr):setDisplay(Tr,Cr)},mounted(Tr,{value:Cr},{transition:$r}){$r&&Cr&&$r.enter(Tr)},updated(Tr,{value:Cr,oldValue:$r},{transition:Ar}){!Cr!=!$r&&(Ar?Cr?(Ar.beforeEnter(Tr),setDisplay(Tr,!0),Ar.enter(Tr)):Ar.leave(Tr,()=>{setDisplay(Tr,!1)}):setDisplay(Tr,Cr))},beforeUnmount(Tr,{value:Cr}){setDisplay(Tr,Cr)}};function setDisplay(Tr,Cr){Tr.style.display=Cr?Tr[vShowOldKey]:"none"}const CSS_VAR_TEXT=Symbol("");function useCssVars(Tr){const Cr=getCurrentInstance();if(!Cr)return;const $r=Cr.ut=(Rr=Tr(Cr.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${Cr.uid}"]`)).forEach(Dr=>setVarsOnNode(Dr,Rr))},Ar=()=>{const Rr=Tr(Cr.proxy);setVarsOnVNode(Cr.subTree,Rr),$r(Rr)};watchPostEffect(Ar),onMounted(()=>{const Rr=new MutationObserver(Ar);Rr.observe(Cr.subTree.el.parentNode,{childList:!0}),onUnmounted(()=>Rr.disconnect())})}function setVarsOnVNode(Tr,Cr){if(Tr.shapeFlag&128){const $r=Tr.suspense;Tr=$r.activeBranch,$r.pendingBranch&&!$r.isHydrating&&$r.effects.push(()=>{setVarsOnVNode($r.activeBranch,Cr)})}for(;Tr.component;)Tr=Tr.component.subTree;if(Tr.shapeFlag&1&&Tr.el)setVarsOnNode(Tr.el,Cr);else if(Tr.type===Fragment$1)Tr.children.forEach($r=>setVarsOnVNode($r,Cr));else if(Tr.type===Static){let{el:$r,anchor:Ar}=Tr;for(;$r&&(setVarsOnNode($r,Cr),$r!==Ar);)$r=$r.nextSibling}}function setVarsOnNode(Tr,Cr){if(Tr.nodeType===1){const $r=Tr.style;let Ar="";for(const Rr in Cr)$r.setProperty(`--${Rr}`,Cr[Rr]),Ar+=`--${Rr}: ${Cr[Rr]};`;$r[CSS_VAR_TEXT]=Ar}}function patchStyle(Tr,Cr,$r){const Ar=Tr.style,Rr=isString$7($r);if($r&&!Rr){if(Cr&&!isString$7(Cr))for(const Dr in Cr)$r[Dr]==null&&setStyle(Ar,Dr,"");for(const Dr in $r)setStyle(Ar,Dr,$r[Dr])}else{const Dr=Ar.display;if(Rr){if(Cr!==$r){const Mr=Ar[CSS_VAR_TEXT];Mr&&($r+=";"+Mr),Ar.cssText=$r}}else Cr&&Tr.removeAttribute("style");vShowOldKey in Tr&&(Ar.display=Dr)}}const importantRE=/\s*!important$/;function setStyle(Tr,Cr,$r){if(isArray$4($r))$r.forEach(Ar=>setStyle(Tr,Cr,Ar));else if($r==null&&($r=""),Cr.startsWith("--"))Tr.setProperty(Cr,$r);else{const Ar=autoPrefix(Tr,Cr);importantRE.test($r)?Tr.setProperty(hyphenate(Ar),$r.replace(importantRE,""),"important"):Tr[Ar]=$r}}const prefixes=["Webkit","Moz","ms"],prefixCache={};function autoPrefix(Tr,Cr){const $r=prefixCache[Cr];if($r)return $r;let Ar=camelize$2(Cr);if(Ar!=="filter"&&Ar in Tr)return prefixCache[Cr]=Ar;Ar=capitalize(Ar);for(let Rr=0;RrcachedNow||(p$9.then(()=>cachedNow=0),cachedNow=Date.now());function createInvoker(Tr,Cr){const $r=Ar=>{if(!Ar._vts)Ar._vts=Date.now();else if(Ar._vts<=$r.attached)return;callWithAsyncErrorHandling(patchStopImmediatePropagation(Ar,$r.value),Cr,5,[Ar])};return $r.value=Tr,$r.attached=getNow(),$r}function patchStopImmediatePropagation(Tr,Cr){if(isArray$4(Cr)){const $r=Tr.stopImmediatePropagation;return Tr.stopImmediatePropagation=()=>{$r.call(Tr),Tr._stopped=!0},Cr.map(Ar=>Rr=>!Rr._stopped&&Ar&&Ar(Rr))}else return Cr}const isNativeOn=Tr=>Tr.charCodeAt(0)===111&&Tr.charCodeAt(1)===110&&Tr.charCodeAt(2)>96&&Tr.charCodeAt(2)<123,patchProp=(Tr,Cr,$r,Ar,Rr=!1,Dr,Mr,Br,Nr)=>{Cr==="class"?patchClass(Tr,Ar,Rr):Cr==="style"?patchStyle(Tr,$r,Ar):isOn(Cr)?isModelListener(Cr)||patchEvent(Tr,Cr,$r,Ar,Mr):(Cr[0]==="."?(Cr=Cr.slice(1),!0):Cr[0]==="^"?(Cr=Cr.slice(1),!1):shouldSetAsProp(Tr,Cr,Ar,Rr))?patchDOMProp(Tr,Cr,Ar,Dr,Mr,Br,Nr):(Cr==="true-value"?Tr._trueValue=Ar:Cr==="false-value"&&(Tr._falseValue=Ar),patchAttr(Tr,Cr,Ar,Rr))};function shouldSetAsProp(Tr,Cr,$r,Ar){if(Ar)return!!(Cr==="innerHTML"||Cr==="textContent"||Cr in Tr&&isNativeOn(Cr)&&isFunction$4($r));if(Cr==="spellcheck"||Cr==="draggable"||Cr==="translate"||Cr==="form"||Cr==="list"&&Tr.tagName==="INPUT"||Cr==="type"&&Tr.tagName==="TEXTAREA")return!1;if(Cr==="width"||Cr==="height"){const Rr=Tr.tagName;if(Rr==="IMG"||Rr==="VIDEO"||Rr==="CANVAS"||Rr==="SOURCE")return!1}return isNativeOn(Cr)&&isString$7($r)?!1:Cr in Tr}const positionMap=new WeakMap,newPositionMap=new WeakMap,moveCbKey=Symbol("_moveCb"),enterCbKey=Symbol("_enterCb"),TransitionGroupImpl={name:"TransitionGroup",props:extend$1({},TransitionPropsValidators,{tag:String,moveClass:String}),setup(Tr,{slots:Cr}){const $r=getCurrentInstance(),Ar=useTransitionState();let Rr,Dr;return onUpdated(()=>{if(!Rr.length)return;const Mr=Tr.moveClass||`${Tr.name||"v"}-move`;if(!hasCSSTransform(Rr[0].el,$r.vnode.el,Mr))return;Rr.forEach(callPendingCbs),Rr.forEach(recordPosition);const Br=Rr.filter(applyTranslation);forceReflow(),Br.forEach(Nr=>{const Lr=Nr.el,Hr=Lr.style;addTransitionClass(Lr,Mr),Hr.transform=Hr.webkitTransform=Hr.transitionDuration="";const zr=Lr[moveCbKey]=Ur=>{Ur&&Ur.target!==Lr||(!Ur||/transform$/.test(Ur.propertyName))&&(Lr.removeEventListener("transitionend",zr),Lr[moveCbKey]=null,removeTransitionClass(Lr,Mr))};Lr.addEventListener("transitionend",zr)})}),()=>{const Mr=toRaw(Tr),Br=resolveTransitionProps(Mr);let Nr=Mr.tag||Fragment$1;Rr=Dr,Dr=Cr.default?getTransitionRawChildren(Cr.default()):[];for(let Lr=0;Lrdelete Tr.mode;TransitionGroupImpl.props;const TransitionGroup=TransitionGroupImpl;function callPendingCbs(Tr){const Cr=Tr.el;Cr[moveCbKey]&&Cr[moveCbKey](),Cr[enterCbKey]&&Cr[enterCbKey]()}function recordPosition(Tr){newPositionMap.set(Tr,Tr.el.getBoundingClientRect())}function applyTranslation(Tr){const Cr=positionMap.get(Tr),$r=newPositionMap.get(Tr),Ar=Cr.left-$r.left,Rr=Cr.top-$r.top;if(Ar||Rr){const Dr=Tr.el.style;return Dr.transform=Dr.webkitTransform=`translate(${Ar}px,${Rr}px)`,Dr.transitionDuration="0s",Tr}}function hasCSSTransform(Tr,Cr,$r){const Ar=Tr.cloneNode(),Rr=Tr[vtcKey];Rr&&Rr.forEach(Br=>{Br.split(/\s+/).forEach(Nr=>Nr&&Ar.classList.remove(Nr))}),$r.split(/\s+/).forEach(Br=>Br&&Ar.classList.add(Br)),Ar.style.display="none";const Dr=Cr.nodeType===1?Cr:Cr.parentNode;Dr.appendChild(Ar);const{hasTransform:Mr}=getTransitionInfo(Ar);return Dr.removeChild(Ar),Mr}const getModelAssigner=Tr=>{const Cr=Tr.props["onUpdate:modelValue"]||!1;return isArray$4(Cr)?$r=>invokeArrayFns(Cr,$r):Cr};function onCompositionStart(Tr){Tr.target.composing=!0}function onCompositionEnd(Tr){const Cr=Tr.target;Cr.composing&&(Cr.composing=!1,Cr.dispatchEvent(new Event("input")))}const assignKey=Symbol("_assign"),vModelText={created(Tr,{modifiers:{lazy:Cr,trim:$r,number:Ar}},Rr){Tr[assignKey]=getModelAssigner(Rr);const Dr=Ar||Rr.props&&Rr.props.type==="number";addEventListener$1(Tr,Cr?"change":"input",Mr=>{if(Mr.target.composing)return;let Br=Tr.value;$r&&(Br=Br.trim()),Dr&&(Br=looseToNumber(Br)),Tr[assignKey](Br)}),$r&&addEventListener$1(Tr,"change",()=>{Tr.value=Tr.value.trim()}),Cr||(addEventListener$1(Tr,"compositionstart",onCompositionStart),addEventListener$1(Tr,"compositionend",onCompositionEnd),addEventListener$1(Tr,"change",onCompositionEnd))},mounted(Tr,{value:Cr}){Tr.value=Cr??""},beforeUpdate(Tr,{value:Cr,modifiers:{lazy:$r,trim:Ar,number:Rr}},Dr){if(Tr[assignKey]=getModelAssigner(Dr),Tr.composing)return;const Mr=Rr||Tr.type==="number"?looseToNumber(Tr.value):Tr.value,Br=Cr??"";Mr!==Br&&(document.activeElement===Tr&&Tr.type!=="range"&&($r||Ar&&Tr.value.trim()===Br)||(Tr.value=Br))}},vModelCheckbox={deep:!0,created(Tr,Cr,$r){Tr[assignKey]=getModelAssigner($r),addEventListener$1(Tr,"change",()=>{const Ar=Tr._modelValue,Rr=getValue(Tr),Dr=Tr.checked,Mr=Tr[assignKey];if(isArray$4(Ar)){const Br=looseIndexOf(Ar,Rr),Nr=Br!==-1;if(Dr&&!Nr)Mr(Ar.concat(Rr));else if(!Dr&&Nr){const Lr=[...Ar];Lr.splice(Br,1),Mr(Lr)}}else if(isSet(Ar)){const Br=new Set(Ar);Dr?Br.add(Rr):Br.delete(Rr),Mr(Br)}else Mr(getCheckboxValue(Tr,Dr))})},mounted:setChecked,beforeUpdate(Tr,Cr,$r){Tr[assignKey]=getModelAssigner($r),setChecked(Tr,Cr,$r)}};function setChecked(Tr,{value:Cr,oldValue:$r},Ar){Tr._modelValue=Cr,isArray$4(Cr)?Tr.checked=looseIndexOf(Cr,Ar.props.value)>-1:isSet(Cr)?Tr.checked=Cr.has(Ar.props.value):Cr!==$r&&(Tr.checked=looseEqual(Cr,getCheckboxValue(Tr,!0)))}const vModelRadio={created(Tr,{value:Cr},$r){Tr.checked=looseEqual(Cr,$r.props.value),Tr[assignKey]=getModelAssigner($r),addEventListener$1(Tr,"change",()=>{Tr[assignKey](getValue(Tr))})},beforeUpdate(Tr,{value:Cr,oldValue:$r},Ar){Tr[assignKey]=getModelAssigner(Ar),Cr!==$r&&(Tr.checked=looseEqual(Cr,Ar.props.value))}},vModelSelect={deep:!0,created(Tr,{value:Cr,modifiers:{number:$r}},Ar){const Rr=isSet(Cr);addEventListener$1(Tr,"change",()=>{const Dr=Array.prototype.filter.call(Tr.options,Mr=>Mr.selected).map(Mr=>$r?looseToNumber(getValue(Mr)):getValue(Mr));Tr[assignKey](Tr.multiple?Rr?new Set(Dr):Dr:Dr[0])}),Tr[assignKey]=getModelAssigner(Ar)},mounted(Tr,{value:Cr}){setSelected(Tr,Cr)},beforeUpdate(Tr,Cr,$r){Tr[assignKey]=getModelAssigner($r)},updated(Tr,{value:Cr}){setSelected(Tr,Cr)}};function setSelected(Tr,Cr){const $r=Tr.multiple;if(!($r&&!isArray$4(Cr)&&!isSet(Cr))){for(let Ar=0,Rr=Tr.options.length;Ar-1:Dr.selected=Cr.has(Mr);else if(looseEqual(getValue(Dr),Cr)){Tr.selectedIndex!==Ar&&(Tr.selectedIndex=Ar);return}}!$r&&Tr.selectedIndex!==-1&&(Tr.selectedIndex=-1)}}function getValue(Tr){return"_value"in Tr?Tr._value:Tr.value}function getCheckboxValue(Tr,Cr){const $r=Cr?"_trueValue":"_falseValue";return $r in Tr?Tr[$r]:Cr}const vModelDynamic={created(Tr,Cr,$r){callModelHook(Tr,Cr,$r,null,"created")},mounted(Tr,Cr,$r){callModelHook(Tr,Cr,$r,null,"mounted")},beforeUpdate(Tr,Cr,$r,Ar){callModelHook(Tr,Cr,$r,Ar,"beforeUpdate")},updated(Tr,Cr,$r,Ar){callModelHook(Tr,Cr,$r,Ar,"updated")}};function resolveDynamicModel(Tr,Cr){switch(Tr){case"SELECT":return vModelSelect;case"TEXTAREA":return vModelText;default:switch(Cr){case"checkbox":return vModelCheckbox;case"radio":return vModelRadio;default:return vModelText}}}function callModelHook(Tr,Cr,$r,Ar,Rr){const Mr=resolveDynamicModel(Tr.tagName,$r.props&&$r.props.type)[Rr];Mr&&Mr(Tr,Cr,$r,Ar)}const systemModifiers=["ctrl","shift","alt","meta"],modifierGuards={stop:Tr=>Tr.stopPropagation(),prevent:Tr=>Tr.preventDefault(),self:Tr=>Tr.target!==Tr.currentTarget,ctrl:Tr=>!Tr.ctrlKey,shift:Tr=>!Tr.shiftKey,alt:Tr=>!Tr.altKey,meta:Tr=>!Tr.metaKey,left:Tr=>"button"in Tr&&Tr.button!==0,middle:Tr=>"button"in Tr&&Tr.button!==1,right:Tr=>"button"in Tr&&Tr.button!==2,exact:(Tr,Cr)=>systemModifiers.some($r=>Tr[`${$r}Key`]&&!Cr.includes($r))},withModifiers=(Tr,Cr)=>{const $r=Tr._withMods||(Tr._withMods={}),Ar=Cr.join(".");return $r[Ar]||($r[Ar]=(Rr,...Dr)=>{for(let Mr=0;Mr{const $r=Tr._withKeys||(Tr._withKeys={}),Ar=Cr.join(".");return $r[Ar]||($r[Ar]=Rr=>{if(!("key"in Rr))return;const Dr=hyphenate(Rr.key);if(Cr.some(Mr=>Mr===Dr||keyNames[Mr]===Dr))return Tr(Rr)})},rendererOptions=extend$1({patchProp},nodeOps);let renderer$1,enabledHydration=!1;function ensureRenderer(){return renderer$1||(renderer$1=createRenderer(rendererOptions))}function ensureHydrationRenderer(){return renderer$1=enabledHydration?renderer$1:createHydrationRenderer(rendererOptions),enabledHydration=!0,renderer$1}const createApp=(...Tr)=>{const Cr=ensureRenderer().createApp(...Tr),{mount:$r}=Cr;return Cr.mount=Ar=>{const Rr=normalizeContainer(Ar);if(!Rr)return;const Dr=Cr._component;!isFunction$4(Dr)&&!Dr.render&&!Dr.template&&(Dr.template=Rr.innerHTML),Rr.innerHTML="";const Mr=$r(Rr,!1,Rr instanceof SVGElement);return Rr instanceof Element&&(Rr.removeAttribute("v-cloak"),Rr.setAttribute("data-v-app","")),Mr},Cr},createSSRApp=(...Tr)=>{const Cr=ensureHydrationRenderer().createApp(...Tr),{mount:$r}=Cr;return Cr.mount=Ar=>{const Rr=normalizeContainer(Ar);if(Rr)return $r(Rr,!0,Rr instanceof SVGElement)},Cr};function normalizeContainer(Tr){return isString$7(Tr)?document.querySelector(Tr):Tr}const suspectProtoRx=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,suspectConstructorRx=/"(?: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*:/,JsonSigRx=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function jsonParseTransform(Tr,Cr){if(Tr==="__proto__"||Tr==="constructor"&&Cr&&typeof Cr=="object"&&"prototype"in Cr){warnKeyDropped(Tr);return}return Cr}function warnKeyDropped(Tr){console.warn(`[destr] Dropping "${Tr}" key to prevent prototype pollution.`)}function destr(Tr,Cr={}){if(typeof Tr!="string")return Tr;const $r=Tr.trim();if(Tr[0]==='"'&&Tr.at(-1)==='"'&&!Tr.includes("\\"))return $r.slice(1,-1);if($r.length<=9){const Ar=$r.toLowerCase();if(Ar==="true")return!0;if(Ar==="false")return!1;if(Ar==="undefined")return;if(Ar==="null")return null;if(Ar==="nan")return Number.NaN;if(Ar==="infinity")return Number.POSITIVE_INFINITY;if(Ar==="-infinity")return Number.NEGATIVE_INFINITY}if(!JsonSigRx.test(Tr)){if(Cr.strict)throw new SyntaxError("[destr] Invalid JSON");return Tr}try{if(suspectProtoRx.test(Tr)||suspectConstructorRx.test(Tr)){if(Cr.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(Tr,jsonParseTransform)}return JSON.parse(Tr)}catch(Ar){if(Cr.strict)throw Ar;return Tr}}const HASH_RE$1=/#/g,AMPERSAND_RE$1=/&/g,EQUAL_RE$1=/=/g,PLUS_RE$1=/\+/g,ENC_CARET_RE$1=/%5e/gi,ENC_BACKTICK_RE$1=/%60/gi,ENC_PIPE_RE$1=/%7c/gi,ENC_SPACE_RE$1=/%20/gi;function encode$6(Tr){return encodeURI(""+Tr).replace(ENC_PIPE_RE$1,"|")}function encodeQueryValue$1(Tr){return encode$6(typeof Tr=="string"?Tr:JSON.stringify(Tr)).replace(PLUS_RE$1,"%2B").replace(ENC_SPACE_RE$1,"+").replace(HASH_RE$1,"%23").replace(AMPERSAND_RE$1,"%26").replace(ENC_BACKTICK_RE$1,"`").replace(ENC_CARET_RE$1,"^")}function encodeQueryKey$1(Tr){return encodeQueryValue$1(Tr).replace(EQUAL_RE$1,"%3D")}function decode$6(Tr=""){try{return decodeURIComponent(""+Tr)}catch{return""+Tr}}function decodeQueryKey(Tr){return decode$6(Tr.replace(PLUS_RE$1," "))}function decodeQueryValue(Tr){return decode$6(Tr.replace(PLUS_RE$1," "))}function parseQuery$2(Tr=""){const Cr={};Tr[0]==="?"&&(Tr=Tr.slice(1));for(const $r of Tr.split("&")){const Ar=$r.match(/([^=]+)=?(.*)/)||[];if(Ar.length<2)continue;const Rr=decodeQueryKey(Ar[1]);if(Rr==="__proto__"||Rr==="constructor")continue;const Dr=decodeQueryValue(Ar[2]||"");Cr[Rr]===void 0?Cr[Rr]=Dr:Array.isArray(Cr[Rr])?Cr[Rr].push(Dr):Cr[Rr]=[Cr[Rr],Dr]}return Cr}function encodeQueryItem(Tr,Cr){return(typeof Cr=="number"||typeof Cr=="boolean")&&(Cr=String(Cr)),Cr?Array.isArray(Cr)?Cr.map($r=>`${encodeQueryKey$1(Tr)}=${encodeQueryValue$1($r)}`).join("&"):`${encodeQueryKey$1(Tr)}=${encodeQueryValue$1(Cr)}`:encodeQueryKey$1(Tr)}function stringifyQuery$1(Tr){return Object.keys(Tr).filter(Cr=>Tr[Cr]!==void 0).map(Cr=>encodeQueryItem(Cr,Tr[Cr])).filter(Boolean).join("&")}const PROTOCOL_STRICT_REGEX=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,PROTOCOL_REGEX=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,PROTOCOL_RELATIVE_REGEX=/^([/\\]\s*){2,}[^/\\]/;function hasProtocol(Tr,Cr={}){return typeof Cr=="boolean"&&(Cr={acceptRelative:Cr}),Cr.strict?PROTOCOL_STRICT_REGEX.test(Tr):PROTOCOL_REGEX.test(Tr)||(Cr.acceptRelative?PROTOCOL_RELATIVE_REGEX.test(Tr):!1)}const PROTOCOL_SCRIPT_RE=/^[\s\0]*(blob|data|javascript|vbscript):$/i;function isScriptProtocol(Tr){return!!Tr&&PROTOCOL_SCRIPT_RE.test(Tr)}const TRAILING_SLASH_RE$1=/\/$|\/\?|\/#/;function hasTrailingSlash(Tr="",Cr){return Cr?TRAILING_SLASH_RE$1.test(Tr):Tr.endsWith("/")}function withoutTrailingSlash(Tr="",Cr){if(!Cr)return(hasTrailingSlash(Tr)?Tr.slice(0,-1):Tr)||"/";if(!hasTrailingSlash(Tr,!0))return Tr||"/";let $r=Tr,Ar="";const Rr=Tr.indexOf("#");Rr>=0&&($r=Tr.slice(0,Rr),Ar=Tr.slice(Rr));const[Dr,...Mr]=$r.split("?");return(Dr.slice(0,-1)||"/")+(Mr.length>0?`?${Mr.join("?")}`:"")+Ar}function withTrailingSlash(Tr="",Cr){if(!Cr)return Tr.endsWith("/")?Tr:Tr+"/";if(hasTrailingSlash(Tr,!0))return Tr||"/";let $r=Tr,Ar="";const Rr=Tr.indexOf("#");if(Rr>=0&&($r=Tr.slice(0,Rr),Ar=Tr.slice(Rr),!$r))return Ar;const[Dr,...Mr]=$r.split("?");return Dr+"/"+(Mr.length>0?`?${Mr.join("?")}`:"")+Ar}function hasLeadingSlash(Tr=""){return Tr.startsWith("/")}function withLeadingSlash(Tr=""){return hasLeadingSlash(Tr)?Tr:"/"+Tr}function withBase(Tr,Cr){if(isEmptyURL(Cr)||hasProtocol(Tr))return Tr;const $r=withoutTrailingSlash(Cr);return Tr.startsWith($r)?Tr:joinURL($r,Tr)}function withoutBase(Tr,Cr){if(isEmptyURL(Cr))return Tr;const $r=withoutTrailingSlash(Cr);if(!Tr.startsWith($r))return Tr;const Ar=Tr.slice($r.length);return Ar[0]==="/"?Ar:"/"+Ar}function withQuery(Tr,Cr){const $r=parseURL$1(Tr),Ar={...parseQuery$2($r.search),...Cr};return $r.search=stringifyQuery$1(Ar),stringifyParsedURL($r)}function isEmptyURL(Tr){return!Tr||Tr==="/"}function isNonEmptyURL(Tr){return Tr&&Tr!=="/"}const JOIN_LEADING_SLASH_RE=/^\.?\//;function joinURL(Tr,...Cr){let $r=Tr||"";for(const Ar of Cr.filter(Rr=>isNonEmptyURL(Rr)))if($r){const Rr=Ar.replace(JOIN_LEADING_SLASH_RE,"");$r=withTrailingSlash($r)+Rr}else $r=Ar;return $r}function isEqual(Tr,Cr,$r={}){return $r.trailingSlash||(Tr=withTrailingSlash(Tr),Cr=withTrailingSlash(Cr)),$r.leadingSlash||(Tr=withLeadingSlash(Tr),Cr=withLeadingSlash(Cr)),$r.encoding||(Tr=decode$6(Tr),Cr=decode$6(Cr)),Tr===Cr}function parseURL$1(Tr="",Cr){const $r=Tr.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if($r){const[,zr,Ur=""]=$r;return{protocol:zr.toLowerCase(),pathname:Ur,href:zr+Ur,auth:"",host:"",search:"",hash:""}}if(!hasProtocol(Tr,{acceptRelative:!0}))return Cr?parseURL$1(Cr+Tr):parsePath(Tr);const[,Ar="",Rr,Dr=""]=Tr.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,Mr="",Br=""]=Dr.match(/([^#/?]*)(.*)?/)||[],{pathname:Nr,search:Lr,hash:Hr}=parsePath(Br.replace(/\/(?=[A-Za-z]:)/,""));return{protocol:Ar.toLowerCase(),auth:Rr?Rr.slice(0,Math.max(0,Rr.length-1)):"",host:Mr,pathname:Nr,search:Lr,hash:Hr}}function parsePath(Tr=""){const[Cr="",$r="",Ar=""]=(Tr.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:Cr,search:$r,hash:Ar}}function stringifyParsedURL(Tr){const Cr=Tr.pathname||"",$r=Tr.search?(Tr.search.startsWith("?")?"":"?")+Tr.search:"",Ar=Tr.hash||"",Rr=Tr.auth?Tr.auth+"@":"",Dr=Tr.host||"";return(Tr.protocol?Tr.protocol+"//":"")+Rr+Dr+Cr+$r+Ar}class FetchError extends Error{constructor(Cr,$r){super(Cr,$r),this.name="FetchError",$r!=null&&$r.cause&&!this.cause&&(this.cause=$r.cause)}}function createFetchError(Tr){var Nr,Lr,Hr,zr,Ur;const Cr=((Nr=Tr.error)==null?void 0:Nr.message)||((Lr=Tr.error)==null?void 0:Lr.toString())||"",$r=((Hr=Tr.request)==null?void 0:Hr.method)||((zr=Tr.options)==null?void 0:zr.method)||"GET",Ar=((Ur=Tr.request)==null?void 0:Ur.url)||String(Tr.request)||"/",Rr=`[${$r}] ${JSON.stringify(Ar)}`,Dr=Tr.response?`${Tr.response.status} ${Tr.response.statusText}`:"",Mr=`${Rr}: ${Dr}${Cr?` ${Cr}`:""}`,Br=new FetchError(Mr,Tr.error?{cause:Tr.error}:void 0);for(const Vr of["request","options","response"])Object.defineProperty(Br,Vr,{get(){return Tr[Vr]}});for(const[Vr,jr]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(Br,Vr,{get(){return Tr.response&&Tr.response[jr]}});return Br}const payloadMethods=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function isPayloadMethod(Tr="GET"){return payloadMethods.has(Tr.toUpperCase())}function isJSONSerializable(Tr){if(Tr===void 0)return!1;const Cr=typeof Tr;return Cr==="string"||Cr==="number"||Cr==="boolean"||Cr===null?!0:Cr!=="object"?!1:Array.isArray(Tr)?!0:Tr.buffer?!1:Tr.constructor&&Tr.constructor.name==="Object"||typeof Tr.toJSON=="function"}const textTypes$1=new Set(["image/svg","application/xml","application/xhtml","application/html"]),JSON_RE=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function detectResponseType(Tr=""){if(!Tr)return"json";const Cr=Tr.split(";").shift()||"";return JSON_RE.test(Cr)?"json":textTypes$1.has(Cr)||Cr.startsWith("text/")?"text":"blob"}function mergeFetchOptions(Tr,Cr,$r=globalThis.Headers){const Ar={...Cr,...Tr};if(Cr!=null&&Cr.params&&(Tr!=null&&Tr.params)&&(Ar.params={...Cr==null?void 0:Cr.params,...Tr==null?void 0:Tr.params}),Cr!=null&&Cr.query&&(Tr!=null&&Tr.query)&&(Ar.query={...Cr==null?void 0:Cr.query,...Tr==null?void 0:Tr.query}),Cr!=null&&Cr.headers&&(Tr!=null&&Tr.headers)){Ar.headers=new $r((Cr==null?void 0:Cr.headers)||{});for(const[Rr,Dr]of new $r((Tr==null?void 0:Tr.headers)||{}))Ar.headers.set(Rr,Dr)}return Ar}const retryStatusCodes=new Set([408,409,425,429,500,502,503,504]),nullBodyResponses=new Set([101,204,205,304]);function createFetch(Tr={}){const{fetch:Cr=globalThis.fetch,Headers:$r=globalThis.Headers,AbortController:Ar=globalThis.AbortController}=Tr;async function Rr(Br){const Nr=Br.error&&Br.error.name==="AbortError"&&!Br.options.timeout||!1;if(Br.options.retry!==!1&&!Nr){let Hr;typeof Br.options.retry=="number"?Hr=Br.options.retry:Hr=isPayloadMethod(Br.options.method)?0:1;const zr=Br.response&&Br.response.status||500;if(Hr>0&&(Array.isArray(Br.options.retryStatusCodes)?Br.options.retryStatusCodes.includes(zr):retryStatusCodes.has(zr))){const Ur=Br.options.retryDelay||0;return Ur>0&&await new Promise(Vr=>setTimeout(Vr,Ur)),Dr(Br.request,{...Br.options,retry:Hr-1,timeout:Br.options.timeout})}}const Lr=createFetchError(Br);throw Error.captureStackTrace&&Error.captureStackTrace(Lr,Dr),Lr}const Dr=async function(Nr,Lr={}){var Ur;const Hr={request:Nr,options:mergeFetchOptions(Lr,Tr.defaults,$r),response:void 0,error:void 0};if(Hr.options.method=(Ur=Hr.options.method)==null?void 0:Ur.toUpperCase(),Hr.options.onRequest&&await Hr.options.onRequest(Hr),typeof Hr.request=="string"&&(Hr.options.baseURL&&(Hr.request=withBase(Hr.request,Hr.options.baseURL)),(Hr.options.query||Hr.options.params)&&(Hr.request=withQuery(Hr.request,{...Hr.options.params,...Hr.options.query}))),Hr.options.body&&isPayloadMethod(Hr.options.method)&&(isJSONSerializable(Hr.options.body)?(Hr.options.body=typeof Hr.options.body=="string"?Hr.options.body:JSON.stringify(Hr.options.body),Hr.options.headers=new $r(Hr.options.headers||{}),Hr.options.headers.has("content-type")||Hr.options.headers.set("content-type","application/json"),Hr.options.headers.has("accept")||Hr.options.headers.set("accept","application/json")):("pipeTo"in Hr.options.body&&typeof Hr.options.body.pipeTo=="function"||typeof Hr.options.body.pipe=="function")&&("duplex"in Hr.options||(Hr.options.duplex="half"))),!Hr.options.signal&&Hr.options.timeout){const Vr=new Ar;setTimeout(()=>Vr.abort(),Hr.options.timeout),Hr.options.signal=Vr.signal}try{Hr.response=await Cr(Hr.request,Hr.options)}catch(Vr){return Hr.error=Vr,Hr.options.onRequestError&&await Hr.options.onRequestError(Hr),await Rr(Hr)}if(Hr.response.body&&!nullBodyResponses.has(Hr.response.status)&&Hr.options.method!=="HEAD"){const Vr=(Hr.options.parseResponse?"json":Hr.options.responseType)||detectResponseType(Hr.response.headers.get("content-type")||"");switch(Vr){case"json":{const jr=await Hr.response.text(),Gr=Hr.options.parseResponse||destr;Hr.response._data=Gr(jr);break}case"stream":{Hr.response._data=Hr.response.body;break}default:Hr.response._data=await Hr.response[Vr]()}}return Hr.options.onResponse&&await Hr.options.onResponse(Hr),!Hr.options.ignoreResponseError&&Hr.response.status>=400&&Hr.response.status<600?(Hr.options.onResponseError&&await Hr.options.onResponseError(Hr),await Rr(Hr)):Hr.response},Mr=async function(Nr,Lr){return(await Dr(Nr,Lr))._data};return Mr.raw=Dr,Mr.native=(...Br)=>Cr(...Br),Mr.create=(Br={})=>createFetch({...Tr,defaults:{...Tr.defaults,...Br}}),Mr}const _globalThis$2=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}(),fetch$2=_globalThis$2.fetch||(()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!"))),Headers$2=_globalThis$2.Headers,AbortController=_globalThis$2.AbortController,ofetch=createFetch({fetch:fetch$2,Headers:Headers$2,AbortController}),$fetch=ofetch;var _global$1=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};_global$1.SENTRY_RELEASE={id:"914dd8cb9b4ac0bc9be7b33ad7d7c0b59d59260d"};const useRuntimeConfig$1=()=>{var Tr;return((Tr=window==null?void 0:window.__NUXT__)==null?void 0:Tr.config)||{}},appConfig$1=useRuntimeConfig$1().app,baseURL=()=>appConfig$1.baseURL,buildAssetsDir=()=>appConfig$1.buildAssetsDir,buildAssetsURL=(...Tr)=>joinURL(publicAssetsURL(),buildAssetsDir(),...Tr),publicAssetsURL=(...Tr)=>{const Cr=appConfig$1.cdnURL||appConfig$1.baseURL;return Tr.length?joinURL(Cr,...Tr):Cr};globalThis.__buildAssetsURL=buildAssetsURL,globalThis.__publicAssetsURL=publicAssetsURL;function flatHooks(Tr,Cr={},$r){for(const Ar in Tr){const Rr=Tr[Ar],Dr=$r?`${$r}:${Ar}`:Ar;typeof Rr=="object"&&Rr!==null?flatHooks(Rr,Cr,Dr):typeof Rr=="function"&&(Cr[Dr]=Rr)}return Cr}const defaultTask={run:Tr=>Tr()},_createTask=()=>defaultTask,createTask=typeof console.createTask<"u"?console.createTask:_createTask;function serialTaskCaller(Tr,Cr){const $r=Cr.shift(),Ar=createTask($r);return Tr.reduce((Rr,Dr)=>Rr.then(()=>Ar.run(()=>Dr(...Cr))),Promise.resolve())}function parallelTaskCaller(Tr,Cr){const $r=Cr.shift(),Ar=createTask($r);return Promise.all(Tr.map(Rr=>Ar.run(()=>Rr(...Cr))))}function callEachWith(Tr,Cr){for(const $r of[...Tr])$r(Cr)}class Hookable{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(Cr,$r,Ar={}){if(!Cr||typeof $r!="function")return()=>{};const Rr=Cr;let Dr;for(;this._deprecatedHooks[Cr];)Dr=this._deprecatedHooks[Cr],Cr=Dr.to;if(Dr&&!Ar.allowDeprecated){let Mr=Dr.message;Mr||(Mr=`${Rr} hook has been deprecated`+(Dr.to?`, please use ${Dr.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(Mr)||(console.warn(Mr),this._deprecatedMessages.add(Mr))}if(!$r.name)try{Object.defineProperty($r,"name",{get:()=>"_"+Cr.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[Cr]=this._hooks[Cr]||[],this._hooks[Cr].push($r),()=>{$r&&(this.removeHook(Cr,$r),$r=void 0)}}hookOnce(Cr,$r){let Ar,Rr=(...Dr)=>(typeof Ar=="function"&&Ar(),Ar=void 0,Rr=void 0,$r(...Dr));return Ar=this.hook(Cr,Rr),Ar}removeHook(Cr,$r){if(this._hooks[Cr]){const Ar=this._hooks[Cr].indexOf($r);Ar!==-1&&this._hooks[Cr].splice(Ar,1),this._hooks[Cr].length===0&&delete this._hooks[Cr]}}deprecateHook(Cr,$r){this._deprecatedHooks[Cr]=typeof $r=="string"?{to:$r}:$r;const Ar=this._hooks[Cr]||[];delete this._hooks[Cr];for(const Rr of Ar)this.hook(Cr,Rr)}deprecateHooks(Cr){Object.assign(this._deprecatedHooks,Cr);for(const $r in Cr)this.deprecateHook($r,Cr[$r])}addHooks(Cr){const $r=flatHooks(Cr),Ar=Object.keys($r).map(Rr=>this.hook(Rr,$r[Rr]));return()=>{for(const Rr of Ar.splice(0,Ar.length))Rr()}}removeHooks(Cr){const $r=flatHooks(Cr);for(const Ar in $r)this.removeHook(Ar,$r[Ar])}removeAllHooks(){for(const Cr in this._hooks)delete this._hooks[Cr]}callHook(Cr,...$r){return $r.unshift(Cr),this.callHookWith(serialTaskCaller,Cr,...$r)}callHookParallel(Cr,...$r){return $r.unshift(Cr),this.callHookWith(parallelTaskCaller,Cr,...$r)}callHookWith(Cr,$r,...Ar){const Rr=this._before||this._after?{name:$r,args:Ar,context:{}}:void 0;this._before&&callEachWith(this._before,Rr);const Dr=Cr($r in this._hooks?[...this._hooks[$r]]:[],Ar);return Dr instanceof Promise?Dr.finally(()=>{this._after&&Rr&&callEachWith(this._after,Rr)}):(this._after&&Rr&&callEachWith(this._after,Rr),Dr)}beforeEach(Cr){return this._before=this._before||[],this._before.push(Cr),()=>{if(this._before!==void 0){const $r=this._before.indexOf(Cr);$r!==-1&&this._before.splice($r,1)}}}afterEach(Cr){return this._after=this._after||[],this._after.push(Cr),()=>{if(this._after!==void 0){const $r=this._after.indexOf(Cr);$r!==-1&&this._after.splice($r,1)}}}}function createHooks(){return new Hookable}function createContext(Tr={}){let Cr,$r=!1;const Ar=Mr=>{if(Cr&&Cr!==Mr)throw new Error("Context conflict")};let Rr;if(Tr.asyncContext){const Mr=Tr.AsyncLocalStorage||globalThis.AsyncLocalStorage;Mr?Rr=new Mr:console.warn("[unctx] `AsyncLocalStorage` is not provided.")}const Dr=()=>{if(Rr&&Cr===void 0){const Mr=Rr.getStore();if(Mr!==void 0)return Mr}return Cr};return{use:()=>{const Mr=Dr();if(Mr===void 0)throw new Error("Context is not available");return Mr},tryUse:()=>Dr(),set:(Mr,Br)=>{Br||Ar(Mr),Cr=Mr,$r=!0},unset:()=>{Cr=void 0,$r=!1},call:(Mr,Br)=>{Ar(Mr),Cr=Mr;try{return Rr?Rr.run(Mr,Br):Br()}finally{$r||(Cr=void 0)}},async callAsync(Mr,Br){Cr=Mr;const Nr=()=>{Cr=Mr},Lr=()=>Cr===Mr?Nr:void 0;asyncHandlers.add(Lr);try{const Hr=Rr?Rr.run(Mr,Br):Br();return $r||(Cr=void 0),await Hr}finally{asyncHandlers.delete(Lr)}}}}function createNamespace(Tr={}){const Cr={};return{get($r,Ar={}){return Cr[$r]||(Cr[$r]=createContext({...Tr,...Ar})),Cr[$r],Cr[$r]}}}const _globalThis$1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:typeof window<"u"?window:{},globalKey$1="__unctx__",defaultNamespace=_globalThis$1[globalKey$1]||(_globalThis$1[globalKey$1]=createNamespace()),getContext=(Tr,Cr={})=>defaultNamespace.get(Tr,Cr),asyncHandlersKey="__unctx_async_handlers__",asyncHandlers=_globalThis$1[asyncHandlersKey]||(_globalThis$1[asyncHandlersKey]=new Set);function executeAsync(Tr){const Cr=[];for(const Rr of asyncHandlers){const Dr=Rr();Dr&&Cr.push(Dr)}const $r=()=>{for(const Rr of Cr)Rr()};let Ar=Tr();return Ar&&typeof Ar=="object"&&"catch"in Ar&&(Ar=Ar.catch(Rr=>{throw $r(),Rr})),[Ar,$r]}const nuxtAppCtx=getContext("nuxt-app",{asyncContext:!1}),NuxtPluginIndicator="__nuxt_plugin";function createNuxtApp(Tr){let Cr=0;const $r={provide:void 0,globalName:"nuxt",versions:{get nuxt(){return"3.7.4"},get vue(){return $r.vueApp.version}},payload:reactive({data:{},state:{},_errors:{},...window.__NUXT__??{}}),static:{data:{}},runWithContext:Rr=>callWithNuxt($r,Rr),isHydrating:!0,deferHydration(){if(!$r.isHydrating)return()=>{};Cr++;let Rr=!1;return()=>{if(!Rr&&(Rr=!0,Cr--,Cr===0))return $r.isHydrating=!1,$r.callHook("app:suspense:resolve")}},_asyncDataPromises:{},_asyncData:{},_payloadRevivers:{},...Tr};$r.hooks=createHooks(),$r.hook=$r.hooks.hook,$r.callHook=$r.hooks.callHook,$r.provide=(Rr,Dr)=>{const Mr="$"+Rr;defineGetter($r,Mr,Dr),defineGetter($r.vueApp.config.globalProperties,Mr,Dr)},defineGetter($r.vueApp,"$nuxt",$r),defineGetter($r.vueApp.config.globalProperties,"$nuxt",$r);{window.addEventListener("nuxt.preloadError",Dr=>{$r.callHook("app:chunkError",{error:Dr.payload})}),window.useNuxtApp=window.useNuxtApp||useNuxtApp;const Rr=$r.hook("app:error",(...Dr)=>{console.error("[nuxt] error caught during app initialization",...Dr)});$r.hook("app:mounted",Rr)}const Ar=reactive($r.payload.config);return $r.provide("config",Ar),$r}async function applyPlugin(Tr,Cr){if(Cr.hooks&&Tr.hooks.addHooks(Cr.hooks),typeof Cr=="function"){const{provide:$r}=await Tr.runWithContext(()=>Cr(Tr))||{};if($r&&typeof $r=="object")for(const Ar in $r)Tr.provide(Ar,$r[Ar])}}async function applyPlugins(Tr,Cr){const $r=[],Ar=[];for(const Rr of Cr){const Dr=applyPlugin(Tr,Rr);Rr.parallel?$r.push(Dr.catch(Mr=>Ar.push(Mr))):await Dr}if(await Promise.all($r),Ar.length)throw Ar[0]}/*! @__NO_SIDE_EFFECTS__ */function defineNuxtPlugin(Tr){return typeof Tr=="function"?Tr:(delete Tr.name,Object.assign(Tr.setup||(()=>{}),Tr,{[NuxtPluginIndicator]:!0}))}function callWithNuxt(Tr,Cr,$r){const Ar=()=>$r?Cr(...$r):Cr();return nuxtAppCtx.set(Tr),Tr.vueApp.runWithContext(Ar)}/*! @__NO_SIDE_EFFECTS__ */function useNuxtApp(){var Cr;let Tr;if(hasInjectionContext()&&(Tr=(Cr=getCurrentInstance())==null?void 0:Cr.appContext.app.$nuxt),Tr=Tr||nuxtAppCtx.tryUse(),!Tr)throw new Error("[nuxt] instance unavailable");return Tr}/*! @__NO_SIDE_EFFECTS__ */function useRuntimeConfig(){return useNuxtApp().$config}function defineGetter(Tr,Cr,$r){Object.defineProperty(Tr,Cr,{get:()=>$r})}const scriptRel="modulepreload",assetsURL=function(Tr,Cr){return Tr[0]==="."?new URL(Tr,Cr).href:Tr},seen={},___vitePreload=function(Cr,$r,Ar){if(!$r||$r.length===0)return Cr();const Rr=document.getElementsByTagName("link");return Promise.all($r.map(Dr=>{if(Dr=assetsURL(Dr,Ar),Dr in seen)return;seen[Dr]=!0;const Mr=Dr.endsWith(".css"),Br=Mr?'[rel="stylesheet"]':"";if(!!Ar)for(let Hr=Rr.length-1;Hr>=0;Hr--){const zr=Rr[Hr];if(zr.href===Dr&&(!Mr||zr.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${Dr}"]${Br}`))return;const Lr=document.createElement("link");if(Lr.rel=Mr?"stylesheet":scriptRel,Mr||(Lr.as="script",Lr.crossOrigin=""),Lr.href=Dr,document.head.appendChild(Lr),Mr)return new Promise((Hr,zr)=>{Lr.addEventListener("load",Hr),Lr.addEventListener("error",()=>zr(new Error(`Unable to preload CSS for ${Dr}`)))})})).then(()=>Cr()).catch(Dr=>{const Mr=new Event("vite:preloadError",{cancelable:!0});if(Mr.payload=Dr,window.dispatchEvent(Mr),!Mr.defaultPrevented)throw Dr})},__vitePreload=(...Tr)=>___vitePreload(...Tr).catch(Cr=>{const $r=new Event("nuxt.preloadError");throw $r.payload=Cr,window.dispatchEvent($r),Cr}),UNDEFINED=-1,HOLE=-2,NAN=-3,POSITIVE_INFINITY=-4,NEGATIVE_INFINITY=-5,NEGATIVE_ZERO=-6;function parse$4(Tr,Cr){return unflatten(JSON.parse(Tr),Cr)}function unflatten(Tr,Cr){if(typeof Tr=="number")return Rr(Tr,!0);if(!Array.isArray(Tr)||Tr.length===0)throw new Error("Invalid input");const $r=Tr,Ar=Array($r.length);function Rr(Dr,Mr=!1){if(Dr===UNDEFINED)return;if(Dr===NAN)return NaN;if(Dr===POSITIVE_INFINITY)return 1/0;if(Dr===NEGATIVE_INFINITY)return-1/0;if(Dr===NEGATIVE_ZERO)return-0;if(Mr)throw new Error("Invalid input");if(Dr in Ar)return Ar[Dr];const Br=$r[Dr];if(!Br||typeof Br!="object")Ar[Dr]=Br;else if(Array.isArray(Br))if(typeof Br[0]=="string"){const Nr=Br[0],Lr=Cr==null?void 0:Cr[Nr];if(Lr)return Ar[Dr]=Lr(Rr(Br[1]));switch(Nr){case"Date":Ar[Dr]=new Date(Br[1]);break;case"Set":const Hr=new Set;Ar[Dr]=Hr;for(let Vr=1;Vr>>9)+65536).toString(16).substring(1,8).toLowerCase()}function hashTag(Tr){return Tr._h||hashCode(Tr._d?Tr._d:`${Tr.tag}:${Tr.textContent||Tr.innerHTML||""}:${Object.entries(Tr.props).map(([Cr,$r])=>`${Cr}:${String($r)}`).join(",")}`)}function tagDedupeKey(Tr,Cr){const{props:$r,tag:Ar}=Tr;if(UniqueTags.includes(Ar))return Ar;if(Ar==="link"&&$r.rel==="canonical")return"canonical";if($r.charset)return"charset";const Rr=["id"];Ar==="meta"&&Rr.push("name","property","http-equiv");for(const Dr of Rr)if(typeof $r[Dr]<"u"){const Mr=String($r[Dr]);return Cr&&!Cr(Mr)?!1:`${Ar}:${Dr}:${Mr}`}return!1}function resolveTitleTemplate(Tr,Cr){return Tr==null?Cr||null:typeof Tr=="function"?Tr(Cr):Tr}async function normaliseTag(Tr,Cr,$r){const Ar={tag:Tr,props:await normaliseProps(typeof Cr=="object"&&typeof Cr!="function"&&!(Cr instanceof Promise)?{...Cr}:{[["script","noscript","style"].includes(Tr)?"innerHTML":"textContent"]:Cr},["templateParams","titleTemplate"].includes(Tr))};return TagConfigKeys.forEach(Rr=>{const Dr=typeof Ar.props[Rr]<"u"?Ar.props[Rr]:$r[Rr];typeof Dr<"u"&&((!["innerHTML","textContent","children"].includes(Rr)||TagsWithInnerContent.includes(Ar.tag))&&(Ar[Rr==="children"?"innerHTML":Rr]=Dr),delete Ar.props[Rr])}),Ar.props.body&&(Ar.tagPosition="bodyClose",delete Ar.props.body),Ar.tag==="script"&&typeof Ar.innerHTML=="object"&&(Ar.innerHTML=JSON.stringify(Ar.innerHTML),Ar.props.type=Ar.props.type||"application/json"),Array.isArray(Ar.props.content)?Ar.props.content.map(Rr=>({...Ar,props:{...Ar.props,content:Rr}})):Ar}function normaliseClassProp(Tr){return typeof Tr=="object"&&!Array.isArray(Tr)&&(Tr=Object.keys(Tr).filter(Cr=>Tr[Cr])),(Array.isArray(Tr)?Tr.join(" "):Tr).split(" ").filter(Cr=>Cr.trim()).filter(Boolean).join(" ")}async function normaliseProps(Tr,Cr){for(const $r of Object.keys(Tr)){if($r==="class"){Tr[$r]=normaliseClassProp(Tr[$r]);continue}if(Tr[$r]instanceof Promise&&(Tr[$r]=await Tr[$r]),!Cr&&!TagConfigKeys.includes($r)){const Ar=String(Tr[$r]),Rr=$r.startsWith("data-");Ar==="true"||Ar===""?Tr[$r]=Rr?"true":!0:Tr[$r]||(Rr&&Ar==="false"?Tr[$r]="false":delete Tr[$r])}}return Tr}const TagEntityBits=10;async function normaliseEntryTags(Tr){const Cr=[];return Object.entries(Tr.resolvedInput).filter(([$r,Ar])=>typeof Ar<"u"&&ValidHeadTags.includes($r)).forEach(([$r,Ar])=>{const Rr=asArray$1(Ar);Cr.push(...Rr.map(Dr=>normaliseTag($r,Dr,Tr)).flat())}),(await Promise.all(Cr)).flat().filter(Boolean).map(($r,Ar)=>($r._e=Tr._i,Tr.mode&&($r._m=Tr.mode),$r._p=(Tr._i<Nr&&Nr[Lr]||void 0,Cr):Br=Cr[Mr],typeof Br<"u"?(Br||"").replace(/"/g,'\\"'):!1}let Rr=Tr;try{Rr=decodeURI(Tr)}catch{}return(Rr.match(/%(\w+\.+\w+)|%(\w+)/g)||[]).sort().reverse().forEach(Mr=>{const Br=Ar(Mr.slice(1));typeof Br=="string"&&(Tr=Tr.replace(new RegExp(`\\${Mr}(\\W|$)`,"g"),(Nr,Lr)=>`${Br}${Lr}`).trim())}),Tr.includes(sepSub)&&(Tr.endsWith(sepSub)&&(Tr=Tr.slice(0,-sepSub.length).trim()),Tr.startsWith(sepSub)&&(Tr=Tr.slice(sepSub.length).trim()),Tr=Tr.replace(new RegExp(`\\${sepSub}\\s*\\${sepSub}`,"g"),sepSub),Tr=processTemplateParams(Tr,{separator:$r},$r)),Tr}async function elementToTag(Tr){const Cr={tag:Tr.tagName.toLowerCase(),props:await normaliseProps(Tr.getAttributeNames().reduce(($r,Ar)=>({...$r,[Ar]:Tr.getAttribute(Ar)}),{})),innerHTML:Tr.innerHTML};return Cr._d=tagDedupeKey(Cr),Cr}async function renderDOMHead(Tr,Cr={}){var Hr;const $r=Cr.document||Tr.resolvedOptions.document;if(!$r)return;const Ar={shouldRender:Tr.dirty,tags:[]};if(await Tr.hooks.callHook("dom:beforeRender",Ar),!Ar.shouldRender)return;const Rr=(await Tr.resolveTags()).map(zr=>({tag:zr,id:HasElementTags.includes(zr.tag)?hashTag(zr):zr.tag,shouldRender:!0}));let Dr=Tr._dom;if(!Dr){Dr={elMap:{htmlAttrs:$r.documentElement,bodyAttrs:$r.body}};for(const zr of["body","head"]){const Ur=(Hr=$r==null?void 0:$r[zr])==null?void 0:Hr.children;for(const Vr of[...Ur].filter(jr=>HasElementTags.includes(jr.tagName.toLowerCase())))Dr.elMap[Vr.getAttribute("data-hid")||hashTag(await elementToTag(Vr))]=Vr}}Dr.pendingSideEffects={...Dr.sideEffects||{}},Dr.sideEffects={};function Mr(zr,Ur,Vr){const jr=`${zr}:${Ur}`;Dr.sideEffects[jr]=Vr,delete Dr.pendingSideEffects[jr]}function Br({id:zr,$el:Ur,tag:Vr}){const jr=Vr.tag.endsWith("Attrs");Dr.elMap[zr]=Ur,jr||(["textContent","innerHTML"].forEach(Gr=>{Vr[Gr]&&Vr[Gr]!==Ur[Gr]&&(Ur[Gr]=Vr[Gr])}),Mr(zr,"el",()=>{Dr.elMap[zr].remove(),delete Dr.elMap[zr]})),Object.entries(Vr.props).forEach(([Gr,Xr])=>{const Kr=`attr:${Gr}`;if(Gr==="class")for(const Zr of(Xr||"").split(" ").filter(Boolean))jr&&Mr(zr,`${Kr}:${Zr}`,()=>Ur.classList.remove(Zr)),!Ur.classList.contains(Zr)&&Ur.classList.add(Zr);else Ur.getAttribute(Gr)!==Xr&&Ur.setAttribute(Gr,Xr===!0?"":String(Xr)),jr&&Mr(zr,Kr,()=>Ur.removeAttribute(Gr))})}const Nr=[],Lr={bodyClose:void 0,bodyOpen:void 0,head:void 0};for(const zr of Rr){const{tag:Ur,shouldRender:Vr,id:jr}=zr;if(Vr){if(Ur.tag==="title"){$r.title=Ur.textContent;continue}zr.$el=zr.$el||Dr.elMap[jr],zr.$el?Br(zr):HasElementTags.includes(Ur.tag)&&Nr.push(zr)}}for(const zr of Nr){const Ur=zr.tag.tagPosition||"head";zr.$el=$r.createElement(zr.tag.tag),Br(zr),Lr[Ur]=Lr[Ur]||$r.createDocumentFragment(),Lr[Ur].appendChild(zr.$el)}for(const zr of Rr)await Tr.hooks.callHook("dom:renderTag",zr,$r,Mr);Lr.head&&$r.head.appendChild(Lr.head),Lr.bodyOpen&&$r.body.insertBefore(Lr.bodyOpen,$r.body.firstChild),Lr.bodyClose&&$r.body.appendChild(Lr.bodyClose),Object.values(Dr.pendingSideEffects).forEach(zr=>zr()),Tr._dom=Dr,Tr.dirty=!1,await Tr.hooks.callHook("dom:rendered",{renders:Rr})}async function debouncedRenderDOMHead(Tr,Cr={}){const $r=Cr.delayFn||(Ar=>setTimeout(Ar,10));return Tr._domUpdatePromise=Tr._domUpdatePromise||new Promise(Ar=>$r(async()=>{await renderDOMHead(Tr,Cr),delete Tr._domUpdatePromise,Ar()}))}function DomPlugin(Tr){return Cr=>{var Ar,Rr;const $r=((Rr=(Ar=Cr.resolvedOptions.document)==null?void 0:Ar.head.querySelector('script[id="unhead:payload"]'))==null?void 0:Rr.innerHTML)||!1;return $r&&Cr.push(JSON.parse($r)),{mode:"client",hooks:{"entries:updated":function(Dr){debouncedRenderDOMHead(Dr,Tr)}}}}}const UsesMergeStrategy=["templateParams","htmlAttrs","bodyAttrs"],DedupePlugin={hooks:{"tag:normalise":function({tag:Tr}){["hid","vmid","key"].forEach(Ar=>{Tr.props[Ar]&&(Tr.key=Tr.props[Ar],delete Tr.props[Ar])});const $r=tagDedupeKey(Tr)||(Tr.key?`${Tr.tag}:${Tr.key}`:!1);$r&&(Tr._d=$r)},"tags:resolve":function(Tr){const Cr={};Tr.tags.forEach(Ar=>{const Rr=(Ar.key?`${Ar.tag}:${Ar.key}`:Ar._d)||Ar._p,Dr=Cr[Rr];if(Dr){let Br=Ar==null?void 0:Ar.tagDuplicateStrategy;if(!Br&&UsesMergeStrategy.includes(Ar.tag)&&(Br="merge"),Br==="merge"){const Nr=Dr.props;["class","style"].forEach(Lr=>{Nr[Lr]&&(Ar.props[Lr]?(Lr==="style"&&!Nr[Lr].endsWith(";")&&(Nr[Lr]+=";"),Ar.props[Lr]=`${Nr[Lr]} ${Ar.props[Lr]}`):Ar.props[Lr]=Nr[Lr])}),Cr[Rr].props={...Nr,...Ar.props};return}else if(Ar._e===Dr._e){Dr._duped=Dr._duped||[],Ar._d=`${Dr._d}:${Dr._duped.length+1}`,Dr._duped.push(Ar);return}else if(tagWeight(Ar)>tagWeight(Dr))return}const Mr=Object.keys(Ar.props).length+(Ar.innerHTML?1:0)+(Ar.textContent?1:0);if(HasElementTags.includes(Ar.tag)&&Mr===0){delete Cr[Rr];return}Cr[Rr]=Ar});const $r=[];Object.values(Cr).forEach(Ar=>{const Rr=Ar._duped;delete Ar._duped,$r.push(Ar),Rr&&$r.push(...Rr)}),Tr.tags=$r,Tr.tags=Tr.tags.filter(Ar=>!(Ar.tag==="meta"&&(Ar.props.name||Ar.props.property)&&!Ar.props.content))}}},PayloadPlugin={mode:"server",hooks:{"tags:resolve":function(Tr){const Cr={};Tr.tags.filter($r=>["titleTemplate","templateParams","title"].includes($r.tag)&&$r._m==="server").forEach($r=>{Cr[$r.tag]=$r.tag.startsWith("title")?$r.textContent:$r.props}),Object.keys(Cr).length&&Tr.tags.push({tag:"script",innerHTML:JSON.stringify(Cr),props:{id:"unhead:payload",type:"application/json"}})}}},ValidEventTags=["script","link","bodyAttrs"];function stripEventHandlers(Tr){const Cr={},$r={};return Object.entries(Tr.props).forEach(([Ar,Rr])=>{Ar.startsWith("on")&&typeof Rr=="function"?(NetworkEvents.includes(Ar)&&(Cr[Ar]=`this.dataset.${Ar} = true`),$r[Ar]=Rr):Cr[Ar]=Rr}),{props:Cr,eventHandlers:$r}}const EventHandlersPlugin=Tr=>({hooks:{"tags:resolve":function(Cr){for(const $r of Cr.tags)if(ValidEventTags.includes($r.tag)){const{props:Ar,eventHandlers:Rr}=stripEventHandlers($r);$r.props=Ar,Object.keys(Rr).length&&(($r.props.src||$r.props.href)&&($r.key=$r.key||hashCode($r.props.src||$r.props.href)),$r._eventHandlers=Rr)}},"dom:renderTag":function(Cr,$r,Ar){if(!Cr.tag._eventHandlers)return;const Rr=Cr.tag.tag==="bodyAttrs"?$r.defaultView:Cr.$el;Object.entries(Cr.tag._eventHandlers).forEach(([Dr,Mr])=>{const Br=`${Cr.tag._d||Cr.tag._p}:${Dr}`,Nr=Dr.slice(2).toLowerCase(),Lr=`data-h-${Nr}`;if(Ar(Cr.id,Br,()=>{}),Cr.$el.hasAttribute(Lr))return;Cr.$el.setAttribute(Lr,"");let Hr;const zr=Ur=>{Mr(Ur),Hr==null||Hr.disconnect()};Dr in Cr.$el.dataset?zr(new Event(Dr.replace("on",""))):NetworkEvents.includes(Dr)&&typeof MutationObserver<"u"?(Hr=new MutationObserver(Ur=>{Ur.some(jr=>jr.attributeName===`data-${Dr}`)&&(zr(new Event(Dr.replace("on",""))),Hr==null||Hr.disconnect())}),Hr.observe(Cr.$el,{attributes:!0})):Rr.addEventListener(Nr,zr),Ar(Cr.id,Br,()=>{Hr==null||Hr.disconnect(),Rr.removeEventListener(Nr,zr),Cr.$el.removeAttribute(Lr)})})}}}),DupeableTags=["link","style","script","noscript"],HashKeyedPlugin={hooks:{"tag:normalise":({tag:Tr})=>{Tr.key&&DupeableTags.includes(Tr.tag)&&(Tr.props["data-hid"]=Tr._h=hashCode(Tr.key))}}},SortPlugin={hooks:{"tags:resolve":Tr=>{const Cr=$r=>{var Ar;return(Ar=Tr.tags.find(Rr=>Rr._d===$r))==null?void 0:Ar._p};for(const{prefix:$r,offset:Ar}of SortModifiers)for(const Rr of Tr.tags.filter(Dr=>typeof Dr.tagPriority=="string"&&Dr.tagPriority.startsWith($r))){const Dr=Cr(Rr.tagPriority.replace($r,""));typeof Dr<"u"&&(Rr._p=Dr+Ar)}Tr.tags.sort(($r,Ar)=>$r._p-Ar._p).sort(($r,Ar)=>tagWeight($r)-tagWeight(Ar))}}},SupportedAttrs={meta:"content",link:"href",htmlAttrs:"lang"},TemplateParamsPlugin=Tr=>({hooks:{"tags:resolve":Cr=>{var Br;const{tags:$r}=Cr,Ar=(Br=$r.find(Nr=>Nr.tag==="title"))==null?void 0:Br.textContent,Rr=$r.findIndex(Nr=>Nr.tag==="templateParams"),Dr=Rr!==-1?$r[Rr].props:{},Mr=Dr.separator||"|";delete Dr.separator,Dr.pageTitle=processTemplateParams(Dr.pageTitle||Ar||"",Dr,Mr);for(const Nr of $r.filter(Lr=>Lr.processTemplateParams!==!1)){const Lr=SupportedAttrs[Nr.tag];Lr&&typeof Nr.props[Lr]=="string"?Nr.props[Lr]=processTemplateParams(Nr.props[Lr],Dr,Mr):(Nr.processTemplateParams===!0||["titleTemplate","title"].includes(Nr.tag))&&["innerHTML","textContent"].forEach(Hr=>{typeof Nr[Hr]=="string"&&(Nr[Hr]=processTemplateParams(Nr[Hr],Dr,Mr))})}Tr._templateParams=Dr,Tr._separator=Mr,Cr.tags=$r.filter(Nr=>Nr.tag!=="templateParams")}}}),TitleTemplatePlugin={hooks:{"tags:resolve":Tr=>{const{tags:Cr}=Tr;let $r=Cr.findIndex(Rr=>Rr.tag==="titleTemplate");const Ar=Cr.findIndex(Rr=>Rr.tag==="title");if(Ar!==-1&&$r!==-1){const Rr=resolveTitleTemplate(Cr[$r].textContent,Cr[Ar].textContent);Rr!==null?Cr[Ar].textContent=Rr||Cr[Ar].textContent:delete Cr[Ar]}else if($r!==-1){const Rr=resolveTitleTemplate(Cr[$r].textContent);Rr!==null&&(Cr[$r].textContent=Rr,Cr[$r].tag="title",$r=-1)}$r!==-1&&delete Cr[$r],Tr.tags=Cr.filter(Boolean)}}},XSSPlugin={hooks:{"tags:afterResolve":function(Tr){for(const Cr of Tr.tags)typeof Cr.innerHTML=="string"&&(Cr.innerHTML&&["application/ld+json","application/json"].includes(Cr.props.type)?Cr.innerHTML=Cr.innerHTML.replace(/{Br.dirty=!0,Cr.callHook("entries:updated",Br)};let Rr=0,Dr=[];const Mr=[],Br={plugins:Mr,dirty:!1,resolvedOptions:Tr,hooks:Cr,headEntries(){return Dr},use(Nr){const Lr=typeof Nr=="function"?Nr(Br):Nr;(!Lr.key||!Mr.some(Hr=>Hr.key===Lr.key))&&(Mr.push(Lr),filterMode(Lr.mode,$r)&&Cr.addHooks(Lr.hooks||{}))},push(Nr,Lr){Lr==null||delete Lr.head;const Hr={_i:Rr++,input:Nr,...Lr};return filterMode(Hr.mode,$r)&&(Dr.push(Hr),Ar()),{dispose(){Dr=Dr.filter(zr=>zr._i!==Hr._i),Cr.callHook("entries:updated",Br),Ar()},patch(zr){Dr=Dr.map(Ur=>(Ur._i===Hr._i&&(Ur.input=Hr.input=zr),Ur)),Ar()}}},async resolveTags(){const Nr={tags:[],entries:[...Dr]};await Cr.callHook("entries:resolve",Nr);for(const Lr of Nr.entries){const Hr=Lr.resolvedInput||Lr.input;if(Lr.resolvedInput=await(Lr.transform?Lr.transform(Hr):Hr),Lr.resolvedInput)for(const zr of await normaliseEntryTags(Lr)){const Ur={tag:zr,entry:Lr,resolvedOptions:Br.resolvedOptions};await Cr.callHook("tag:normalise",Ur),Nr.tags.push(Ur.tag)}}return await Cr.callHook("tags:beforeResolve",Nr),await Cr.callHook("tags:resolve",Nr),await Cr.callHook("tags:afterResolve",Nr),Nr.tags},ssr:$r};return[DedupePlugin,PayloadPlugin,EventHandlersPlugin,HashKeyedPlugin,SortPlugin,TemplateParamsPlugin,TitleTemplatePlugin,XSSPlugin,...(Tr==null?void 0:Tr.plugins)||[]].forEach(Nr=>Br.use(Nr)),Br.hooks.callHook("init",Br),Br}function getActiveHead(){return activeHead}const Vue3=version$7.startsWith("3");function resolveUnref$2(Tr){return typeof Tr=="function"?Tr():unref(Tr)}function resolveUnrefHeadInput(Tr,Cr=""){if(Tr instanceof Promise)return Tr;const $r=resolveUnref$2(Tr);return!Tr||!$r?$r:Array.isArray($r)?$r.map(Ar=>resolveUnrefHeadInput(Ar,Cr)):typeof $r=="object"?Object.fromEntries(Object.entries($r).map(([Ar,Rr])=>Ar==="titleTemplate"||Ar.startsWith("on")?[Ar,unref(Rr)]:[Ar,resolveUnrefHeadInput(Rr,Ar)])):$r}const VueReactivityPlugin={hooks:{"entries:resolve":function(Tr){for(const Cr of Tr.entries)Cr.resolvedInput=resolveUnrefHeadInput(Cr.input)}}},headSymbol="usehead";function vueInstall(Tr){return{install($r){Vue3&&($r.config.globalProperties.$unhead=Tr,$r.config.globalProperties.$head=Tr,$r.provide(headSymbol,Tr))}}.install}function createHead(Tr={}){Tr.domDelayFn=Tr.domDelayFn||($r=>nextTick(()=>setTimeout(()=>$r(),0)));const Cr=createHead$1(Tr);return Cr.use(VueReactivityPlugin),Cr.install=vueInstall(Cr),Cr}const _global=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},globalKey="__unhead_injection_handler__";function setHeadInjectionHandler(Tr){_global[globalKey]=Tr}function injectHead(){if(globalKey in _global)return _global[globalKey]();const Tr=inject(headSymbol);return Tr||getActiveHead()}function useHead(Tr,Cr={}){const $r=Cr.head||injectHead();if($r)return $r.ssr?$r.push(Tr,Cr):clientUseHead($r,Tr,Cr)}function clientUseHead(Tr,Cr,$r={}){const Ar=ref(!1),Rr=ref({});watchEffect(()=>{Rr.value=Ar.value?{}:resolveUnrefHeadInput(Cr)});const Dr=Tr.push(Rr.value,$r);return watch(Rr,Br=>{Dr.patch(Br)}),getCurrentInstance()&&(onBeforeUnmount(()=>{Dr.dispose()}),onDeactivated(()=>{Ar.value=!0}),onActivated(()=>{Ar.value=!1})),Dr}function isPlainObject$3(Tr){if(Tr===null||typeof Tr!="object")return!1;const Cr=Object.getPrototypeOf(Tr);return Cr!==null&&Cr!==Object.prototype&&Object.getPrototypeOf(Cr)!==null||Symbol.iterator in Tr?!1:Symbol.toStringTag in Tr?Object.prototype.toString.call(Tr)==="[object Module]":!0}function _defu(Tr,Cr,$r=".",Ar){if(!isPlainObject$3(Cr))return _defu(Tr,{},$r,Ar);const Rr=Object.assign({},Cr);for(const Dr in Tr){if(Dr==="__proto__"||Dr==="constructor")continue;const Mr=Tr[Dr];Mr!=null&&(Ar&&Ar(Rr,Dr,Mr,$r)||(Array.isArray(Mr)&&Array.isArray(Rr[Dr])?Rr[Dr]=[...Mr,...Rr[Dr]]:isPlainObject$3(Mr)&&isPlainObject$3(Rr[Dr])?Rr[Dr]=_defu(Mr,Rr[Dr],($r?`${$r}.`:"")+Dr.toString(),Ar):Rr[Dr]=Mr))}return Rr}function createDefu(Tr){return(...Cr)=>Cr.reduce(($r,Ar)=>_defu($r,Ar,"",Tr),{})}const defu=createDefu(),fieldContentRegExp=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function parse$3(Tr,Cr){if(typeof Tr!="string")throw new TypeError("argument str must be a string");const $r={},Rr=(Cr||{}).decode||decode$5;let Dr=0;for(;DrCr in Tr?__defProp$1$1(Tr,Cr,{enumerable:!0,configurable:!0,writable:!0,value:$r}):Tr[Cr]=$r,__publicField$1=(Tr,Cr,$r)=>(__defNormalProp$1$1(Tr,typeof Cr!="symbol"?Cr+"":Cr,$r),$r);class H3Error extends Error{constructor(Cr,$r={}){super(Cr,$r),__publicField$1(this,"statusCode",500),__publicField$1(this,"fatal",!1),__publicField$1(this,"unhandled",!1),__publicField$1(this,"statusMessage"),__publicField$1(this,"data"),__publicField$1(this,"cause"),$r.cause&&!this.cause&&(this.cause=$r.cause)}toJSON(){const Cr={message:this.message,statusCode:sanitizeStatusCode(this.statusCode,500)};return this.statusMessage&&(Cr.statusMessage=sanitizeStatusMessage(this.statusMessage)),this.data!==void 0&&(Cr.data=this.data),Cr}}__publicField$1(H3Error,"__h3_error__",!0);function createError$1(Tr){if(typeof Tr=="string")return new H3Error(Tr);if(isError$1(Tr))return Tr;const Cr=new H3Error(Tr.message??Tr.statusMessage??"",{cause:Tr.cause||Tr});if(hasProp$1(Tr,"stack"))try{Object.defineProperty(Cr,"stack",{get(){return Tr.stack}})}catch{try{Cr.stack=Tr.stack}catch{}}if(Tr.data&&(Cr.data=Tr.data),Tr.statusCode?Cr.statusCode=sanitizeStatusCode(Tr.statusCode,Cr.statusCode):Tr.status&&(Cr.statusCode=sanitizeStatusCode(Tr.status,Cr.statusCode)),Tr.statusMessage?Cr.statusMessage=Tr.statusMessage:Tr.statusText&&(Cr.statusMessage=Tr.statusText),Cr.statusMessage){const $r=Cr.statusMessage;sanitizeStatusMessage(Cr.statusMessage)!==$r&&console.warn("[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.")}return Tr.fatal!==void 0&&(Cr.fatal=Tr.fatal),Tr.unhandled!==void 0&&(Cr.unhandled=Tr.unhandled),Cr}function isError$1(Tr){var Cr;return((Cr=Tr==null?void 0:Tr.constructor)==null?void 0:Cr.__h3_error__)===!0}const DISALLOWED_STATUS_CHARS=/[^\u0009\u0020-\u007E]/g;function sanitizeStatusMessage(Tr=""){return Tr.replace(DISALLOWED_STATUS_CHARS,"")}function sanitizeStatusCode(Tr,Cr=200){return!Tr||(typeof Tr=="string"&&(Tr=Number.parseInt(Tr,10)),Tr<100||Tr>999)?Cr:Tr}typeof setImmediate>"u"||setImmediate;const LayoutMetaSymbol=Symbol("layout-meta"),PageRouteSymbol=Symbol("route"),useRouter$1=()=>{var Tr;return(Tr=useNuxtApp())==null?void 0:Tr.$router},useRoute$1=()=>hasInjectionContext()?inject(PageRouteSymbol,useNuxtApp()._route):useNuxtApp()._route;/*! @__NO_SIDE_EFFECTS__ */function defineNuxtRouteMiddleware(Tr){return Tr}const isProcessingMiddleware=()=>{try{if(useNuxtApp()._processingMiddleware)return!0}catch{return!0}return!1},navigateTo=(Tr,Cr)=>{Tr||(Tr="/");const $r=typeof Tr=="string"?Tr:withQuery(Tr.path||"/",Tr.query||{})+(Tr.hash||"");if(Cr!=null&&Cr.open){{const{target:Br="_blank",windowFeatures:Nr={}}=Cr.open,Lr=Object.entries(Nr).filter(([Hr,zr])=>zr!==void 0).map(([Hr,zr])=>`${Hr.toLowerCase()}=${zr}`).join(", ");open($r,Br,Lr)}return Promise.resolve()}const Ar=(Cr==null?void 0:Cr.external)||hasProtocol($r,{acceptRelative:!0});if(Ar){if(!(Cr!=null&&Cr.external))throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");const Br=parseURL$1($r).protocol;if(Br&&isScriptProtocol(Br))throw new Error(`Cannot navigate to a URL with '${Br}' protocol.`)}const Rr=isProcessingMiddleware();if(!Ar&&Rr)return Tr;const Dr=useRouter$1(),Mr=useNuxtApp();return Ar?(Cr!=null&&Cr.replace?location.replace($r):location.href=$r,Rr?Mr.isHydrating?new Promise(()=>{}):!1:Promise.resolve()):Cr!=null&&Cr.replace?Dr.replace(Tr):Dr.push(Tr)},useError=()=>toRef$1(useNuxtApp().payload,"error"),showError=Tr=>{const Cr=createError(Tr);try{const $r=useNuxtApp(),Ar=useError();$r.hooks.callHook("app:error",Cr),Ar.value=Ar.value||Cr}catch{throw Cr}return Cr},clearError=async(Tr={})=>{const Cr=useNuxtApp(),$r=useError();Cr.callHook("app:error:cleared",Tr),Tr.redirect&&await useRouter$1().replace(Tr.redirect),$r.value=null},isNuxtError=Tr=>!!(Tr&&typeof Tr=="object"&&"__nuxt_error"in Tr),createError=Tr=>{const Cr=createError$1(Tr);return Cr.__nuxt_error=!0,Cr},requestIdleCallback=globalThis.requestIdleCallback||(Tr=>{const Cr=Date.now(),$r={didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-Cr))};return setTimeout(()=>{Tr($r)},1)}),onNuxtReady=Tr=>{const Cr=useNuxtApp();Cr.isHydrating?Cr.hooks.hookOnce("app:suspense:resolve",()=>{requestIdleCallback(Tr)}):requestIdleCallback(Tr)},getDefault=()=>null;function useAsyncData(...Tr){const Cr=typeof Tr[Tr.length-1]=="string"?Tr.pop():void 0;typeof Tr[0]!="string"&&Tr.unshift(Cr);let[$r,Ar,Rr={}]=Tr;if(typeof $r!="string")throw new TypeError("[nuxt] [asyncData] key must be a string.");if(typeof Ar!="function")throw new TypeError("[nuxt] [asyncData] handler must be a function.");Rr.server=Rr.server??!0,Rr.default=Rr.default??getDefault,Rr.lazy=Rr.lazy??!1,Rr.immediate=Rr.immediate??!0;const Dr=useNuxtApp(),Mr=()=>Dr.isHydrating?Dr.payload.data[$r]:Dr.static.data[$r],Br=()=>Mr()!==void 0;(!Dr._asyncData[$r]||!Rr.immediate)&&(Dr._asyncData[$r]={data:ref(Mr()??Rr.default()),pending:ref(!Br()),error:toRef$1(Dr.payload._errors,$r),status:ref("idle")});const Nr={...Dr._asyncData[$r]};Nr.refresh=Nr.execute=(Ur={})=>{if(Dr._asyncDataPromises[$r]){if(Ur.dedupe===!1)return Dr._asyncDataPromises[$r];Dr._asyncDataPromises[$r].cancelled=!0}if((Ur._initial||Dr.isHydrating&&Ur._initial!==!1)&&Br())return Mr();Nr.pending.value=!0,Nr.status.value="pending";const Vr=new Promise((jr,Gr)=>{try{jr(Ar(Dr))}catch(Xr){Gr(Xr)}}).then(jr=>{if(Vr.cancelled)return Dr._asyncDataPromises[$r];let Gr=jr;Rr.transform&&(Gr=Rr.transform(jr)),Rr.pick&&(Gr=pick(Gr,Rr.pick)),Nr.data.value=Gr,Nr.error.value=null,Nr.status.value="success"}).catch(jr=>{if(Vr.cancelled)return Dr._asyncDataPromises[$r];Nr.error.value=jr,Nr.data.value=unref(Rr.default()),Nr.status.value="error"}).finally(()=>{Vr.cancelled||(Nr.pending.value=!1,Dr.payload.data[$r]=Nr.data.value,Nr.error.value&&(Dr.payload._errors[$r]=createError(Nr.error.value)),delete Dr._asyncDataPromises[$r])});return Dr._asyncDataPromises[$r]=Vr,Dr._asyncDataPromises[$r]};const Lr=()=>Nr.refresh({_initial:!0}),Hr=Rr.server!==!1&&Dr.payload.serverRendered;{const Ur=getCurrentInstance();if(Ur&&!Ur._nuxtOnBeforeMountCbs){Ur._nuxtOnBeforeMountCbs=[];const jr=Ur._nuxtOnBeforeMountCbs;Ur&&(onBeforeMount(()=>{jr.forEach(Gr=>{Gr()}),jr.splice(0,jr.length)}),onUnmounted(()=>jr.splice(0,jr.length)))}Hr&&Dr.isHydrating&&Br()?(Nr.pending.value=!1,Nr.status.value=Nr.error.value?"error":"success"):Ur&&(Dr.payload.serverRendered&&Dr.isHydrating||Rr.lazy)&&Rr.immediate?Ur._nuxtOnBeforeMountCbs.push(Lr):Rr.immediate&&Lr(),Rr.watch&&watch(Rr.watch,()=>Nr.refresh());const Vr=Dr.hook("app:data:refresh",jr=>{if(!jr||jr.includes($r))return Nr.refresh()});Ur&&onUnmounted(Vr)}const zr=Promise.resolve(Dr._asyncDataPromises[$r]).then(()=>Nr);return Object.assign(zr,Nr),zr}function pick(Tr,Cr){const $r={};for(const Ar of Cr)$r[Ar]=Tr[Ar];return $r}function useRequestHeaders(Tr){return{}}const CookieDefaults={path:"/",watch:!0,decode:Tr=>destr(decodeURIComponent(Tr)),encode:Tr=>encodeURIComponent(typeof Tr=="string"?Tr:JSON.stringify(Tr))};function useCookie(Tr,Cr){var Dr;const $r={...CookieDefaults,...Cr},Ar=readRawCookies($r)||{},Rr=ref(Ar[Tr]??((Dr=$r.default)==null?void 0:Dr.call($r)));{const Mr=typeof BroadcastChannel>"u"?null:new BroadcastChannel(`nuxt:cookies:${Tr}`);getCurrentInstance()&&onUnmounted(()=>{Mr==null||Mr.close()});const Br=()=>{writeClientCookie(Tr,Rr.value,$r),Mr==null||Mr.postMessage(toRaw(Rr.value))};let Nr=!1;Mr&&(Mr.onmessage=Lr=>{Nr=!0,Rr.value=Lr.data,nextTick(()=>{Nr=!1})}),$r.watch?watch(Rr,()=>{Nr||Br()},{deep:$r.watch!=="shallow"}):Br()}return Rr}function readRawCookies(Tr={}){return parse$3(document.cookie,Tr)}function serializeCookie(Tr,Cr,$r={}){return Cr==null?serialize(Tr,Cr,{...$r,maxAge:-1}):serialize(Tr,Cr,$r)}function writeClientCookie(Tr,Cr,$r={}){document.cookie=serializeCookie(Tr,Cr,$r)}function reloadNuxtApp(Tr={}){const Cr=Tr.path||window.location.pathname;let $r={};try{$r=destr(sessionStorage.getItem("nuxt:reload")||"{}")}catch{}if(Tr.force||($r==null?void 0:$r.path)!==Cr||($r==null?void 0:$r.expires)Dr?_importPayload($r).then(Mr=>Mr||(delete Rr[$r],null)):(Rr[$r]=null,null))),Rr[$r]}const extension="json";function _getPayloadURL(Tr,Cr={}){const $r=new URL(Tr,"http://localhost");if($r.search)throw new Error("Payload URL cannot contain search params: "+Tr);if($r.host!=="localhost"||hasProtocol($r.pathname,{acceptRelative:!0}))throw new Error("Payload URL must not include hostname: "+Tr);const Ar=Cr.hash||(Cr.fresh?Date.now():"");return joinURL(useRuntimeConfig().app.baseURL,$r.pathname,Ar?`_payload.${Ar}.${extension}`:`_payload.${extension}`)}async function _importPayload(Tr){const Cr=fetch(Tr).then($r=>$r.text().then(parsePayload));try{return await Cr}catch($r){console.warn("[nuxt] Cannot load payload ",Tr,$r)}return null}async function isPrerendered(Tr=useRoute$1().path){return!!useNuxtApp().payload.prerenderedAt}let payloadCache=null;async function getNuxtClientPayload(){if(payloadCache)return payloadCache;const Tr=document.getElementById("__NUXT_DATA__");if(!Tr)return{};const Cr=parsePayload(Tr.textContent||""),$r=Tr.dataset.src?await _importPayload(Tr.dataset.src):void 0;return payloadCache={...Cr,...$r,...window.__NUXT__},payloadCache}function parsePayload(Tr){return parse$4(Tr,useNuxtApp()._payloadRevivers)}function definePayloadReviver(Tr,Cr){useNuxtApp()._payloadRevivers[Tr]=Cr}const revivers={NuxtError:Tr=>createError(Tr),EmptyShallowRef:Tr=>shallowRef(Tr==="_"?void 0:Tr==="0n"?BigInt(0):destr(Tr)),EmptyRef:Tr=>ref(Tr==="_"?void 0:Tr==="0n"?BigInt(0):destr(Tr)),ShallowRef:Tr=>shallowRef(Tr),ShallowReactive:Tr=>shallowReactive(Tr),Ref:Tr=>ref(Tr),Reactive:Tr=>reactive(Tr)},revive_payload_client_LfbzBmzgKb=defineNuxtPlugin({name:"nuxt:revive-payload:client",order:-30,async setup(Tr){let Cr,$r;for(const Ar in revivers)definePayloadReviver(Ar,revivers[Ar]);Object.assign(Tr.payload,([Cr,$r]=executeAsync(()=>Tr.runWithContext(getNuxtClientPayload)),Cr=await Cr,$r(),Cr)),window.__NUXT__=Tr.payload}}),unheadPlugins=[],unhead_rdNvA7eRRi=defineNuxtPlugin({name:"nuxt:head",enforce:"pre",setup(Tr){const Cr=createHead({plugins:unheadPlugins});setHeadInjectionHandler(()=>useNuxtApp().vueApp._context.provides.usehead),Tr.vueApp.use(Cr);{let $r=!0;const Ar=async()=>{$r=!1,await renderDOMHead(Cr)};Cr.hooks.hook("dom:beforeRender",Rr=>{Rr.shouldRender=!$r}),Tr.hooks.hook("page:start",()=>{$r=!0}),Tr.hooks.hook("page:finish",()=>{Tr.isHydrating||Ar()}),Tr.hooks.hook("app:error",Ar),Tr.hooks.hook("app:suspense:resolve",Ar)}}});/*! * vue-router v4.1.5 * (c) 2022 Eduardo San Martin Morote * @license MIT */const isBrowser$3=typeof window<"u";function isESModule(Tr){return Tr.__esModule||Tr[Symbol.toStringTag]==="Module"}const assign$6=Object.assign;function applyToParams(Tr,Cr){const $r={};for(const Ar in Cr){const Rr=Cr[Ar];$r[Ar]=isArray$3(Rr)?Rr.map(Tr):Tr(Rr)}return $r}const noop$5=()=>{},isArray$3=Array.isArray,TRAILING_SLASH_RE=/\/$/,removeTrailingSlash$1=Tr=>Tr.replace(TRAILING_SLASH_RE,"");function parseURL(Tr,Cr,$r="/"){let Ar,Rr={},Dr="",Mr="";const Br=Cr.indexOf("#");let Nr=Cr.indexOf("?");return Br=0&&(Nr=-1),Nr>-1&&(Ar=Cr.slice(0,Nr),Dr=Cr.slice(Nr+1,Br>-1?Br:Cr.length),Rr=Tr(Dr)),Br>-1&&(Ar=Ar||Cr.slice(0,Br),Mr=Cr.slice(Br,Cr.length)),Ar=resolveRelativePath(Ar??Cr,$r),{fullPath:Ar+(Dr&&"?")+Dr+Mr,path:Ar,query:Rr,hash:Mr}}function stringifyURL(Tr,Cr){const $r=Cr.query?Tr(Cr.query):"";return Cr.path+($r&&"?")+$r+(Cr.hash||"")}function stripBase(Tr,Cr){return!Cr||!Tr.toLowerCase().startsWith(Cr.toLowerCase())?Tr:Tr.slice(Cr.length)||"/"}function isSameRouteLocation(Tr,Cr,$r){const Ar=Cr.matched.length-1,Rr=$r.matched.length-1;return Ar>-1&&Ar===Rr&&isSameRouteRecord(Cr.matched[Ar],$r.matched[Rr])&&isSameRouteLocationParams(Cr.params,$r.params)&&Tr(Cr.query)===Tr($r.query)&&Cr.hash===$r.hash}function isSameRouteRecord(Tr,Cr){return(Tr.aliasOf||Tr)===(Cr.aliasOf||Cr)}function isSameRouteLocationParams(Tr,Cr){if(Object.keys(Tr).length!==Object.keys(Cr).length)return!1;for(const $r in Tr)if(!isSameRouteLocationParamsValue(Tr[$r],Cr[$r]))return!1;return!0}function isSameRouteLocationParamsValue(Tr,Cr){return isArray$3(Tr)?isEquivalentArray(Tr,Cr):isArray$3(Cr)?isEquivalentArray(Cr,Tr):Tr===Cr}function isEquivalentArray(Tr,Cr){return isArray$3(Cr)?Tr.length===Cr.length&&Tr.every(($r,Ar)=>$r===Cr[Ar]):Tr.length===1&&Tr[0]===Cr}function resolveRelativePath(Tr,Cr){if(Tr.startsWith("/"))return Tr;if(!Tr)return Cr;const $r=Cr.split("/"),Ar=Tr.split("/");let Rr=$r.length-1,Dr,Mr;for(Dr=0;Dr1&&Rr--;else break;return $r.slice(0,Rr).join("/")+"/"+Ar.slice(Dr-(Dr===Ar.length?1:0)).join("/")}var NavigationType;(function(Tr){Tr.pop="pop",Tr.push="push"})(NavigationType||(NavigationType={}));var NavigationDirection;(function(Tr){Tr.back="back",Tr.forward="forward",Tr.unknown=""})(NavigationDirection||(NavigationDirection={}));function normalizeBase(Tr){if(!Tr)if(isBrowser$3){const Cr=document.querySelector("base");Tr=Cr&&Cr.getAttribute("href")||"/",Tr=Tr.replace(/^\w+:\/\/[^\/]+/,"")}else Tr="/";return Tr[0]!=="/"&&Tr[0]!=="#"&&(Tr="/"+Tr),removeTrailingSlash$1(Tr)}const BEFORE_HASH_RE=/^[^#]+#/;function createHref(Tr,Cr){return Tr.replace(BEFORE_HASH_RE,"#")+Cr}function getElementPosition(Tr,Cr){const $r=document.documentElement.getBoundingClientRect(),Ar=Tr.getBoundingClientRect();return{behavior:Cr.behavior,left:Ar.left-$r.left-(Cr.left||0),top:Ar.top-$r.top-(Cr.top||0)}}const computeScrollPosition=()=>({left:window.pageXOffset,top:window.pageYOffset});function scrollToPosition(Tr){let Cr;if("el"in Tr){const $r=Tr.el,Ar=typeof $r=="string"&&$r.startsWith("#"),Rr=typeof $r=="string"?Ar?document.getElementById($r.slice(1)):document.querySelector($r):$r;if(!Rr)return;Cr=getElementPosition(Rr,Tr)}else Cr=Tr;"scrollBehavior"in document.documentElement.style?window.scrollTo(Cr):window.scrollTo(Cr.left!=null?Cr.left:window.pageXOffset,Cr.top!=null?Cr.top:window.pageYOffset)}function getScrollKey(Tr,Cr){return(history.state?history.state.position-Cr:-1)+Tr}const scrollPositions=new Map;function saveScrollPosition(Tr,Cr){scrollPositions.set(Tr,Cr)}function getSavedScrollPosition(Tr){const Cr=scrollPositions.get(Tr);return scrollPositions.delete(Tr),Cr}let createBaseLocation=()=>location.protocol+"//"+location.host;function createCurrentLocation$1(Tr,Cr){const{pathname:$r,search:Ar,hash:Rr}=Cr,Dr=Tr.indexOf("#");if(Dr>-1){let Br=Rr.includes(Tr.slice(Dr))?Tr.slice(Dr).length:1,Nr=Rr.slice(Br);return Nr[0]!=="/"&&(Nr="/"+Nr),stripBase(Nr,"")}return stripBase($r,Tr)+Ar+Rr}function useHistoryListeners(Tr,Cr,$r,Ar){let Rr=[],Dr=[],Mr=null;const Br=({state:Ur})=>{const Vr=createCurrentLocation$1(Tr,location),jr=$r.value,Gr=Cr.value;let Xr=0;if(Ur){if($r.value=Vr,Cr.value=Ur,Mr&&Mr===jr){Mr=null;return}Xr=Gr?Ur.position-Gr.position:0}else Ar(Vr);Rr.forEach(Kr=>{Kr($r.value,jr,{delta:Xr,type:NavigationType.pop,direction:Xr?Xr>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})})};function Nr(){Mr=$r.value}function Lr(Ur){Rr.push(Ur);const Vr=()=>{const jr=Rr.indexOf(Ur);jr>-1&&Rr.splice(jr,1)};return Dr.push(Vr),Vr}function Hr(){const{history:Ur}=window;Ur.state&&Ur.replaceState(assign$6({},Ur.state,{scroll:computeScrollPosition()}),"")}function zr(){for(const Ur of Dr)Ur();Dr=[],window.removeEventListener("popstate",Br),window.removeEventListener("beforeunload",Hr)}return window.addEventListener("popstate",Br),window.addEventListener("beforeunload",Hr),{pauseListeners:Nr,listen:Lr,destroy:zr}}function buildState(Tr,Cr,$r,Ar=!1,Rr=!1){return{back:Tr,current:Cr,forward:$r,replaced:Ar,position:window.history.length,scroll:Rr?computeScrollPosition():null}}function useHistoryStateNavigation(Tr){const{history:Cr,location:$r}=window,Ar={value:createCurrentLocation$1(Tr,$r)},Rr={value:Cr.state};Rr.value||Dr(Ar.value,{back:null,current:Ar.value,forward:null,position:Cr.length-1,replaced:!0,scroll:null},!0);function Dr(Nr,Lr,Hr){const zr=Tr.indexOf("#"),Ur=zr>-1?($r.host&&document.querySelector("base")?Tr:Tr.slice(zr))+Nr:createBaseLocation()+Tr+Nr;try{Cr[Hr?"replaceState":"pushState"](Lr,"",Ur),Rr.value=Lr}catch(Vr){console.error(Vr),$r[Hr?"replace":"assign"](Ur)}}function Mr(Nr,Lr){const Hr=assign$6({},Cr.state,buildState(Rr.value.back,Nr,Rr.value.forward,!0),Lr,{position:Rr.value.position});Dr(Nr,Hr,!0),Ar.value=Nr}function Br(Nr,Lr){const Hr=assign$6({},Rr.value,Cr.state,{forward:Nr,scroll:computeScrollPosition()});Dr(Hr.current,Hr,!0);const zr=assign$6({},buildState(Ar.value,Nr,null),{position:Hr.position+1},Lr);Dr(Nr,zr,!1),Ar.value=Nr}return{location:Ar,state:Rr,push:Br,replace:Mr}}function createWebHistory(Tr){Tr=normalizeBase(Tr);const Cr=useHistoryStateNavigation(Tr),$r=useHistoryListeners(Tr,Cr.state,Cr.location,Cr.replace);function Ar(Dr,Mr=!0){Mr||$r.pauseListeners(),history.go(Dr)}const Rr=assign$6({location:"",base:Tr,go:Ar,createHref:createHref.bind(null,Tr)},Cr,$r);return Object.defineProperty(Rr,"location",{enumerable:!0,get:()=>Cr.location.value}),Object.defineProperty(Rr,"state",{enumerable:!0,get:()=>Cr.state.value}),Rr}function createWebHashHistory(Tr){return Tr=location.host?Tr||location.pathname+location.search:"",Tr.includes("#")||(Tr+="#"),createWebHistory(Tr)}function isRouteLocation(Tr){return typeof Tr=="string"||Tr&&typeof Tr=="object"}function isRouteName(Tr){return typeof Tr=="string"||typeof Tr=="symbol"}const START_LOCATION_NORMALIZED={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},NavigationFailureSymbol=Symbol("");var NavigationFailureType;(function(Tr){Tr[Tr.aborted=4]="aborted",Tr[Tr.cancelled=8]="cancelled",Tr[Tr.duplicated=16]="duplicated"})(NavigationFailureType||(NavigationFailureType={}));function createRouterError(Tr,Cr){return assign$6(new Error,{type:Tr,[NavigationFailureSymbol]:!0},Cr)}function isNavigationFailure(Tr,Cr){return Tr instanceof Error&&NavigationFailureSymbol in Tr&&(Cr==null||!!(Tr.type&Cr))}const BASE_PARAM_PATTERN="[^/]+?",BASE_PATH_PARSER_OPTIONS={sensitive:!1,strict:!1,start:!0,end:!0},REGEX_CHARS_RE=/[.+*?^${}()[\]/\\]/g;function tokensToParser(Tr,Cr){const $r=assign$6({},BASE_PATH_PARSER_OPTIONS,Cr),Ar=[];let Rr=$r.start?"^":"";const Dr=[];for(const Lr of Tr){const Hr=Lr.length?[]:[90];$r.strict&&!Lr.length&&(Rr+="/");for(let zr=0;zrCr.length?Cr.length===1&&Cr[0]===40+40?1:-1:0}function comparePathParserScore(Tr,Cr){let $r=0;const Ar=Tr.score,Rr=Cr.score;for(;$r0&&Cr[Cr.length-1]<0}const ROOT_TOKEN={type:0,value:""},VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(Tr){if(!Tr)return[[]];if(Tr==="/")return[[ROOT_TOKEN]];if(!Tr.startsWith("/"))throw new Error(`Invalid path "${Tr}"`);function Cr(Vr){throw new Error(`ERR (${$r})/"${Lr}": ${Vr}`)}let $r=0,Ar=$r;const Rr=[];let Dr;function Mr(){Dr&&Rr.push(Dr),Dr=[]}let Br=0,Nr,Lr="",Hr="";function zr(){Lr&&($r===0?Dr.push({type:0,value:Lr}):$r===1||$r===2||$r===3?(Dr.length>1&&(Nr==="*"||Nr==="+")&&Cr(`A repeatable param (${Lr}) must be alone in its segment. eg: '/:ids+.`),Dr.push({type:1,value:Lr,regexp:Hr,repeatable:Nr==="*"||Nr==="+",optional:Nr==="*"||Nr==="?"})):Cr("Invalid state to consume buffer"),Lr="")}function Ur(){Lr+=Nr}for(;Br{Mr(Zr)}:noop$5}function Mr(Hr){if(isRouteName(Hr)){const zr=Ar.get(Hr);zr&&(Ar.delete(Hr),$r.splice($r.indexOf(zr),1),zr.children.forEach(Mr),zr.alias.forEach(Mr))}else{const zr=$r.indexOf(Hr);zr>-1&&($r.splice(zr,1),Hr.record.name&&Ar.delete(Hr.record.name),Hr.children.forEach(Mr),Hr.alias.forEach(Mr))}}function Br(){return $r}function Nr(Hr){let zr=0;for(;zr<$r.length&&comparePathParserScore(Hr,$r[zr])>=0&&(Hr.record.path!==$r[zr].record.path||!isRecordChildOf(Hr,$r[zr]));)zr++;$r.splice(zr,0,Hr),Hr.record.name&&!isAliasRecord(Hr)&&Ar.set(Hr.record.name,Hr)}function Lr(Hr,zr){let Ur,Vr={},jr,Gr;if("name"in Hr&&Hr.name){if(Ur=Ar.get(Hr.name),!Ur)throw createRouterError(1,{location:Hr});Gr=Ur.record.name,Vr=assign$6(paramsFromLocation(zr.params,Ur.keys.filter(Zr=>!Zr.optional).map(Zr=>Zr.name)),Hr.params&¶msFromLocation(Hr.params,Ur.keys.map(Zr=>Zr.name))),jr=Ur.stringify(Vr)}else if("path"in Hr)jr=Hr.path,Ur=$r.find(Zr=>Zr.re.test(jr)),Ur&&(Vr=Ur.parse(jr),Gr=Ur.record.name);else{if(Ur=zr.name?Ar.get(zr.name):$r.find(Zr=>Zr.re.test(zr.path)),!Ur)throw createRouterError(1,{location:Hr,currentLocation:zr});Gr=Ur.record.name,Vr=assign$6({},zr.params,Hr.params),jr=Ur.stringify(Vr)}const Xr=[];let Kr=Ur;for(;Kr;)Xr.unshift(Kr.record),Kr=Kr.parent;return{name:Gr,path:jr,params:Vr,matched:Xr,meta:mergeMetaFields(Xr)}}return Tr.forEach(Hr=>Dr(Hr)),{addRoute:Dr,resolve:Lr,removeRoute:Mr,getRoutes:Br,getRecordMatcher:Rr}}function paramsFromLocation(Tr,Cr){const $r={};for(const Ar of Cr)Ar in Tr&&($r[Ar]=Tr[Ar]);return $r}function normalizeRouteRecord(Tr){return{path:Tr.path,redirect:Tr.redirect,name:Tr.name,meta:Tr.meta||{},aliasOf:void 0,beforeEnter:Tr.beforeEnter,props:normalizeRecordProps(Tr),children:Tr.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in Tr?Tr.components||null:Tr.component&&{default:Tr.component}}}function normalizeRecordProps(Tr){const Cr={},$r=Tr.props||!1;if("component"in Tr)Cr.default=$r;else for(const Ar in Tr.components)Cr[Ar]=typeof $r=="boolean"?$r:$r[Ar];return Cr}function isAliasRecord(Tr){for(;Tr;){if(Tr.record.aliasOf)return!0;Tr=Tr.parent}return!1}function mergeMetaFields(Tr){return Tr.reduce((Cr,$r)=>assign$6(Cr,$r.meta),{})}function mergeOptions(Tr,Cr){const $r={};for(const Ar in Tr)$r[Ar]=Ar in Cr?Cr[Ar]:Tr[Ar];return $r}function isRecordChildOf(Tr,Cr){return Cr.children.some($r=>$r===Tr||isRecordChildOf(Tr,$r))}const HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(Tr){return encodeURI(""+Tr).replace(ENC_PIPE_RE,"|").replace(ENC_BRACKET_OPEN_RE,"[").replace(ENC_BRACKET_CLOSE_RE,"]")}function encodeHash(Tr){return commonEncode(Tr).replace(ENC_CURLY_OPEN_RE,"{").replace(ENC_CURLY_CLOSE_RE,"}").replace(ENC_CARET_RE,"^")}function encodeQueryValue(Tr){return commonEncode(Tr).replace(PLUS_RE,"%2B").replace(ENC_SPACE_RE,"+").replace(HASH_RE,"%23").replace(AMPERSAND_RE,"%26").replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,"{").replace(ENC_CURLY_CLOSE_RE,"}").replace(ENC_CARET_RE,"^")}function encodeQueryKey(Tr){return encodeQueryValue(Tr).replace(EQUAL_RE,"%3D")}function encodePath(Tr){return commonEncode(Tr).replace(HASH_RE,"%23").replace(IM_RE,"%3F")}function encodeParam(Tr){return Tr==null?"":encodePath(Tr).replace(SLASH_RE,"%2F")}function decode$4(Tr){try{return decodeURIComponent(""+Tr)}catch{}return""+Tr}function parseQuery$1(Tr){const Cr={};if(Tr===""||Tr==="?")return Cr;const Ar=(Tr[0]==="?"?Tr.slice(1):Tr).split("&");for(let Rr=0;RrDr&&encodeQueryValue(Dr)):[Ar&&encodeQueryValue(Ar)]).forEach(Dr=>{Dr!==void 0&&(Cr+=(Cr.length?"&":"")+$r,Dr!=null&&(Cr+="="+Dr))})}return Cr}function normalizeQuery(Tr){const Cr={};for(const $r in Tr){const Ar=Tr[$r];Ar!==void 0&&(Cr[$r]=isArray$3(Ar)?Ar.map(Rr=>Rr==null?null:""+Rr):Ar==null?Ar:""+Ar)}return Cr}const matchedRouteKey=Symbol(""),viewDepthKey=Symbol(""),routerKey=Symbol(""),routeLocationKey=Symbol(""),routerViewLocationKey=Symbol("");function useCallbacks(){let Tr=[];function Cr(Ar){return Tr.push(Ar),()=>{const Rr=Tr.indexOf(Ar);Rr>-1&&Tr.splice(Rr,1)}}function $r(){Tr=[]}return{add:Cr,list:()=>Tr,reset:$r}}function guardToPromiseFn(Tr,Cr,$r,Ar,Rr){const Dr=Ar&&(Ar.enterCallbacks[Rr]=Ar.enterCallbacks[Rr]||[]);return()=>new Promise((Mr,Br)=>{const Nr=zr=>{zr===!1?Br(createRouterError(4,{from:$r,to:Cr})):zr instanceof Error?Br(zr):isRouteLocation(zr)?Br(createRouterError(2,{from:Cr,to:zr})):(Dr&&Ar.enterCallbacks[Rr]===Dr&&typeof zr=="function"&&Dr.push(zr),Mr())},Lr=Tr.call(Ar&&Ar.instances[Rr],Cr,$r,Nr);let Hr=Promise.resolve(Lr);Tr.length<3&&(Hr=Hr.then(Nr)),Hr.catch(zr=>Br(zr))})}function extractComponentsGuards(Tr,Cr,$r,Ar){const Rr=[];for(const Dr of Tr)for(const Mr in Dr.components){let Br=Dr.components[Mr];if(!(Cr!=="beforeRouteEnter"&&!Dr.instances[Mr]))if(isRouteComponent(Br)){const Lr=(Br.__vccOpts||Br)[Cr];Lr&&Rr.push(guardToPromiseFn(Lr,$r,Ar,Dr,Mr))}else{let Nr=Br();Rr.push(()=>Nr.then(Lr=>{if(!Lr)return Promise.reject(new Error(`Couldn't resolve component "${Mr}" at "${Dr.path}"`));const Hr=isESModule(Lr)?Lr.default:Lr;Dr.components[Mr]=Hr;const Ur=(Hr.__vccOpts||Hr)[Cr];return Ur&&guardToPromiseFn(Ur,$r,Ar,Dr,Mr)()}))}}return Rr}function isRouteComponent(Tr){return typeof Tr=="object"||"displayName"in Tr||"props"in Tr||"__vccOpts"in Tr}function useLink(Tr){const Cr=inject(routerKey),$r=inject(routeLocationKey),Ar=computed(()=>Cr.resolve(unref(Tr.to))),Rr=computed(()=>{const{matched:Nr}=Ar.value,{length:Lr}=Nr,Hr=Nr[Lr-1],zr=$r.matched;if(!Hr||!zr.length)return-1;const Ur=zr.findIndex(isSameRouteRecord.bind(null,Hr));if(Ur>-1)return Ur;const Vr=getOriginalPath(Nr[Lr-2]);return Lr>1&&getOriginalPath(Hr)===Vr&&zr[zr.length-1].path!==Vr?zr.findIndex(isSameRouteRecord.bind(null,Nr[Lr-2])):Ur}),Dr=computed(()=>Rr.value>-1&&includesParams($r.params,Ar.value.params)),Mr=computed(()=>Rr.value>-1&&Rr.value===$r.matched.length-1&&isSameRouteLocationParams($r.params,Ar.value.params));function Br(Nr={}){return guardEvent(Nr)?Cr[unref(Tr.replace)?"replace":"push"](unref(Tr.to)).catch(noop$5):Promise.resolve()}return{route:Ar,href:computed(()=>Ar.value.href),isActive:Dr,isExactActive:Mr,navigate:Br}}const RouterLinkImpl=defineComponent({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink,setup(Tr,{slots:Cr}){const $r=reactive(useLink(Tr)),{options:Ar}=inject(routerKey),Rr=computed(()=>({[getLinkClass(Tr.activeClass,Ar.linkActiveClass,"router-link-active")]:$r.isActive,[getLinkClass(Tr.exactActiveClass,Ar.linkExactActiveClass,"router-link-exact-active")]:$r.isExactActive}));return()=>{const Dr=Cr.default&&Cr.default($r);return Tr.custom?Dr:h$5("a",{"aria-current":$r.isExactActive?Tr.ariaCurrentValue:null,href:$r.href,onClick:$r.navigate,class:Rr.value},Dr)}}}),RouterLink=RouterLinkImpl;function guardEvent(Tr){if(!(Tr.metaKey||Tr.altKey||Tr.ctrlKey||Tr.shiftKey)&&!Tr.defaultPrevented&&!(Tr.button!==void 0&&Tr.button!==0)){if(Tr.currentTarget&&Tr.currentTarget.getAttribute){const Cr=Tr.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(Cr))return}return Tr.preventDefault&&Tr.preventDefault(),!0}}function includesParams(Tr,Cr){for(const $r in Cr){const Ar=Cr[$r],Rr=Tr[$r];if(typeof Ar=="string"){if(Ar!==Rr)return!1}else if(!isArray$3(Rr)||Rr.length!==Ar.length||Ar.some((Dr,Mr)=>Dr!==Rr[Mr]))return!1}return!0}function getOriginalPath(Tr){return Tr?Tr.aliasOf?Tr.aliasOf.path:Tr.path:""}const getLinkClass=(Tr,Cr,$r)=>Tr??Cr??$r,RouterViewImpl=defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(Tr,{attrs:Cr,slots:$r}){const Ar=inject(routerViewLocationKey),Rr=computed(()=>Tr.route||Ar.value),Dr=inject(viewDepthKey,0),Mr=computed(()=>{let Lr=unref(Dr);const{matched:Hr}=Rr.value;let zr;for(;(zr=Hr[Lr])&&!zr.components;)Lr++;return Lr}),Br=computed(()=>Rr.value.matched[Mr.value]);provide(viewDepthKey,computed(()=>Mr.value+1)),provide(matchedRouteKey,Br),provide(routerViewLocationKey,Rr);const Nr=ref();return watch(()=>[Nr.value,Br.value,Tr.name],([Lr,Hr,zr],[Ur,Vr,jr])=>{Hr&&(Hr.instances[zr]=Lr,Vr&&Vr!==Hr&&Lr&&Lr===Ur&&(Hr.leaveGuards.size||(Hr.leaveGuards=Vr.leaveGuards),Hr.updateGuards.size||(Hr.updateGuards=Vr.updateGuards))),Lr&&Hr&&(!Vr||!isSameRouteRecord(Hr,Vr)||!Ur)&&(Hr.enterCallbacks[zr]||[]).forEach(Gr=>Gr(Lr))},{flush:"post"}),()=>{const Lr=Rr.value,Hr=Tr.name,zr=Br.value,Ur=zr&&zr.components[Hr];if(!Ur)return normalizeSlot($r.default,{Component:Ur,route:Lr});const Vr=zr.props[Hr],jr=Vr?Vr===!0?Lr.params:typeof Vr=="function"?Vr(Lr):Vr:null,Xr=h$5(Ur,assign$6({},jr,Cr,{onVnodeUnmounted:Kr=>{Kr.component.isUnmounted&&(zr.instances[Hr]=null)},ref:Nr}));return normalizeSlot($r.default,{Component:Xr,route:Lr})||Xr}}});function normalizeSlot(Tr,Cr){if(!Tr)return null;const $r=Tr(Cr);return $r.length===1?$r[0]:$r}const RouterView=RouterViewImpl;function createRouter(Tr){const Cr=createRouterMatcher(Tr.routes,Tr),$r=Tr.parseQuery||parseQuery$1,Ar=Tr.stringifyQuery||stringifyQuery,Rr=Tr.history,Dr=useCallbacks(),Mr=useCallbacks(),Br=useCallbacks(),Nr=shallowRef(START_LOCATION_NORMALIZED);let Lr=START_LOCATION_NORMALIZED;isBrowser$3&&Tr.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const Hr=applyToParams.bind(null,Eo=>""+Eo),zr=applyToParams.bind(null,encodeParam),Ur=applyToParams.bind(null,decode$4);function Vr(Eo,Mo){let Ro,Ao;return isRouteName(Eo)?(Ro=Cr.getRecordMatcher(Eo),Ao=Mo):Ao=Eo,Cr.addRoute(Ao,Ro)}function jr(Eo){const Mo=Cr.getRecordMatcher(Eo);Mo&&Cr.removeRoute(Mo)}function Gr(){return Cr.getRoutes().map(Eo=>Eo.record)}function Xr(Eo){return!!Cr.getRecordMatcher(Eo)}function Kr(Eo,Mo){if(Mo=assign$6({},Mo||Nr.value),typeof Eo=="string"){const bo=parseURL($r,Eo,Mo.path),vo=Cr.resolve({path:bo.path},Mo),Io=Rr.createHref(bo.fullPath);return assign$6(bo,vo,{params:Ur(vo.params),hash:decode$4(bo.hash),redirectedFrom:void 0,href:Io})}let Ro;if("path"in Eo)Ro=assign$6({},Eo,{path:parseURL($r,Eo.path,Mo.path).path});else{const bo=assign$6({},Eo.params);for(const vo in bo)bo[vo]==null&&delete bo[vo];Ro=assign$6({},Eo,{params:zr(Eo.params)}),Mo.params=zr(Mo.params)}const Ao=Cr.resolve(Ro,Mo),zo=Eo.hash||"";Ao.params=Hr(Ur(Ao.params));const Oo=stringifyURL(Ar,assign$6({},Eo,{hash:encodeHash(zo),path:Ao.path})),Bo=Rr.createHref(Oo);return assign$6({fullPath:Oo,hash:zo,query:Ar===stringifyQuery?normalizeQuery(Eo.query):Eo.query||{}},Ao,{redirectedFrom:void 0,href:Bo})}function Zr(Eo){return typeof Eo=="string"?parseURL($r,Eo,Nr.value.path):assign$6({},Eo)}function eo(Eo,Mo){if(Lr!==Eo)return createRouterError(8,{from:Mo,to:Eo})}function Wr(Eo){return no(Eo)}function Yr(Eo){return Wr(assign$6(Zr(Eo),{replace:!0}))}function Jr(Eo){const Mo=Eo.matched[Eo.matched.length-1];if(Mo&&Mo.redirect){const{redirect:Ro}=Mo;let Ao=typeof Ro=="function"?Ro(Eo):Ro;return typeof Ao=="string"&&(Ao=Ao.includes("?")||Ao.includes("#")?Ao=Zr(Ao):{path:Ao},Ao.params={}),assign$6({query:Eo.query,hash:Eo.hash,params:"path"in Ao?{}:Eo.params},Ao)}}function no(Eo,Mo){const Ro=Lr=Kr(Eo),Ao=Nr.value,zo=Eo.state,Oo=Eo.force,Bo=Eo.replace===!0,bo=Jr(Ro);if(bo)return no(assign$6(Zr(bo),{state:typeof bo=="object"?assign$6({},zo,bo.state):zo,force:Oo,replace:Bo}),Mo||Ro);const vo=Ro;vo.redirectedFrom=Mo;let Io;return!Oo&&isSameRouteLocation(Ar,Ao,Ro)&&(Io=createRouterError(16,{to:vo,from:Ao}),So(Ao,Ao,!0,!1)),(Io?Promise.resolve(Io):so(vo,Ao)).catch(To=>isNavigationFailure(To)?isNavigationFailure(To,2)?To:yo(To):uo(To,vo,Ao)).then(To=>{if(To){if(isNavigationFailure(To,2))return no(assign$6({replace:Bo},Zr(To.to),{state:typeof To.to=="object"?assign$6({},zo,To.to.state):zo,force:Oo}),Mo||vo)}else To=lo(vo,Ao,!0,Bo,zo);return ao(vo,Ao,To),To})}function ro(Eo,Mo){const Ro=eo(Eo,Mo);return Ro?Promise.reject(Ro):Promise.resolve()}function so(Eo,Mo){let Ro;const[Ao,zo,Oo]=extractChangingRecords(Eo,Mo);Ro=extractComponentsGuards(Ao.reverse(),"beforeRouteLeave",Eo,Mo);for(const bo of Ao)bo.leaveGuards.forEach(vo=>{Ro.push(guardToPromiseFn(vo,Eo,Mo))});const Bo=ro.bind(null,Eo,Mo);return Ro.push(Bo),runGuardQueue(Ro).then(()=>{Ro=[];for(const bo of Dr.list())Ro.push(guardToPromiseFn(bo,Eo,Mo));return Ro.push(Bo),runGuardQueue(Ro)}).then(()=>{Ro=extractComponentsGuards(zo,"beforeRouteUpdate",Eo,Mo);for(const bo of zo)bo.updateGuards.forEach(vo=>{Ro.push(guardToPromiseFn(vo,Eo,Mo))});return Ro.push(Bo),runGuardQueue(Ro)}).then(()=>{Ro=[];for(const bo of Eo.matched)if(bo.beforeEnter&&!Mo.matched.includes(bo))if(isArray$3(bo.beforeEnter))for(const vo of bo.beforeEnter)Ro.push(guardToPromiseFn(vo,Eo,Mo));else Ro.push(guardToPromiseFn(bo.beforeEnter,Eo,Mo));return Ro.push(Bo),runGuardQueue(Ro)}).then(()=>(Eo.matched.forEach(bo=>bo.enterCallbacks={}),Ro=extractComponentsGuards(Oo,"beforeRouteEnter",Eo,Mo),Ro.push(Bo),runGuardQueue(Ro))).then(()=>{Ro=[];for(const bo of Mr.list())Ro.push(guardToPromiseFn(bo,Eo,Mo));return Ro.push(Bo),runGuardQueue(Ro)}).catch(bo=>isNavigationFailure(bo,8)?bo:Promise.reject(bo))}function ao(Eo,Mo,Ro){for(const Ao of Br.list())Ao(Eo,Mo,Ro)}function lo(Eo,Mo,Ro,Ao,zo){const Oo=eo(Eo,Mo);if(Oo)return Oo;const Bo=Mo===START_LOCATION_NORMALIZED,bo=isBrowser$3?history.state:{};Ro&&(Ao||Bo?Rr.replace(Eo.fullPath,assign$6({scroll:Bo&&bo&&bo.scroll},zo)):Rr.push(Eo.fullPath,zo)),Nr.value=Eo,So(Eo,Mo,Ro,Bo),yo()}let po;function go(){po||(po=Rr.listen((Eo,Mo,Ro)=>{if(!No.listening)return;const Ao=Kr(Eo),zo=Jr(Ao);if(zo){no(assign$6(zo,{replace:!0}),Ao).catch(noop$5);return}Lr=Ao;const Oo=Nr.value;isBrowser$3&&saveScrollPosition(getScrollKey(Oo.fullPath,Ro.delta),computeScrollPosition()),so(Ao,Oo).catch(Bo=>isNavigationFailure(Bo,12)?Bo:isNavigationFailure(Bo,2)?(no(Bo.to,Ao).then(bo=>{isNavigationFailure(bo,20)&&!Ro.delta&&Ro.type===NavigationType.pop&&Rr.go(-1,!1)}).catch(noop$5),Promise.reject()):(Ro.delta&&Rr.go(-Ro.delta,!1),uo(Bo,Ao,Oo))).then(Bo=>{Bo=Bo||lo(Ao,Oo,!1),Bo&&(Ro.delta&&!isNavigationFailure(Bo,8)?Rr.go(-Ro.delta,!1):Ro.type===NavigationType.pop&&isNavigationFailure(Bo,20)&&Rr.go(-1,!1)),ao(Ao,Oo,Bo)}).catch(noop$5)}))}let co=useCallbacks(),mo=useCallbacks(),io;function uo(Eo,Mo,Ro){yo(Eo);const Ao=mo.list();return Ao.length?Ao.forEach(zo=>zo(Eo,Mo,Ro)):console.error(Eo),Promise.reject(Eo)}function ho(){return io&&Nr.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise((Eo,Mo)=>{co.add([Eo,Mo])})}function yo(Eo){return io||(io=!Eo,go(),co.list().forEach(([Mo,Ro])=>Eo?Ro(Eo):Mo()),co.reset()),Eo}function So(Eo,Mo,Ro,Ao){const{scrollBehavior:zo}=Tr;if(!isBrowser$3||!zo)return Promise.resolve();const Oo=!Ro&&getSavedScrollPosition(getScrollKey(Eo.fullPath,0))||(Ao||!Ro)&&history.state&&history.state.scroll||null;return nextTick().then(()=>zo(Eo,Mo,Oo)).then(Bo=>Bo&&scrollToPosition(Bo)).catch(Bo=>uo(Bo,Eo,Mo))}const ko=Eo=>Rr.go(Eo);let $o;const Go=new Set,No={currentRoute:Nr,listening:!0,addRoute:Vr,removeRoute:jr,hasRoute:Xr,getRoutes:Gr,resolve:Kr,options:Tr,push:Wr,replace:Yr,go:ko,back:()=>ko(-1),forward:()=>ko(1),beforeEach:Dr.add,beforeResolve:Mr.add,afterEach:Br.add,onError:mo.add,isReady:ho,install(Eo){const Mo=this;Eo.component("RouterLink",RouterLink),Eo.component("RouterView",RouterView),Eo.config.globalProperties.$router=Mo,Object.defineProperty(Eo.config.globalProperties,"$route",{enumerable:!0,get:()=>unref(Nr)}),isBrowser$3&&!$o&&Nr.value===START_LOCATION_NORMALIZED&&($o=!0,Wr(Rr.location).catch(zo=>{}));const Ro={};for(const zo in START_LOCATION_NORMALIZED)Ro[zo]=computed(()=>Nr.value[zo]);Eo.provide(routerKey,Mo),Eo.provide(routeLocationKey,reactive(Ro)),Eo.provide(routerViewLocationKey,Nr);const Ao=Eo.unmount;Go.add(Eo),Eo.unmount=function(){Go.delete(Eo),Go.size<1&&(Lr=START_LOCATION_NORMALIZED,po&&po(),po=null,Nr.value=START_LOCATION_NORMALIZED,$o=!1,io=!1),Ao()}}};return No}function runGuardQueue(Tr){return Tr.reduce((Cr,$r)=>Cr.then(()=>$r()),Promise.resolve())}function extractChangingRecords(Tr,Cr){const $r=[],Ar=[],Rr=[],Dr=Math.max(Cr.matched.length,Tr.matched.length);for(let Mr=0;MrisSameRouteRecord(Lr,Br))?Ar.push(Br):$r.push(Br));const Nr=Tr.matched[Mr];Nr&&(Cr.matched.find(Lr=>isSameRouteRecord(Lr,Nr))||Rr.push(Nr))}return[$r,Ar,Rr]}function useRouter(){return inject(routerKey)}function useRoute(){return inject(routeLocationKey)}const _routes=[{name:"genericRoute",path:"/:genericRoute?",meta:{},alias:[],redirect:void 0,component:()=>__vitePreload(()=>import("./_genericRoute_.437ae049.js").then(Tr=>Tr.a),["./_genericRoute_.437ae049.js","./UseCases.b569d4c6.js","./UseCases.49d21505.css","./_genericRoute_.975e4745.css"],import.meta.url).then(Tr=>Tr.default||Tr)},{name:"a-artBoardDeckId",path:"/a/:artBoardDeckId()",meta:{},alias:[],redirect:void 0,component:()=>__vitePreload(()=>import("./_artBoardDeckId_.4496204e.js"),["./_artBoardDeckId_.4496204e.js","./decks.be08960c.js","./NotFound.vue.2c054d2b.js","./AppBuilder.3d13e5af.js","./InputPage.f05ce050.js","./UseCases.b569d4c6.js","./UseCases.49d21505.css","./InputPage.5c75f7cc.css","./index.d24c0c98.js","./index.fa56bddb.css","./AppBuilder.d83194f2.css"],import.meta.url).then(Tr=>Tr.default||Tr)},{name:"a-access-accessDeckId",path:"/a/access/:accessDeckId()",meta:{},alias:[],redirect:void 0,component:()=>__vitePreload(()=>import("./_accessDeckId_.99dd7c23.js"),["./_accessDeckId_.99dd7c23.js","./decks.be08960c.js","./NotFound.vue.2c054d2b.js"],import.meta.url).then(Tr=>Tr.default||Tr)},{name:"join-orgId-inviteKey",path:"/join/:orgId()/:inviteKey()",meta:{},alias:[],redirect:void 0,component:()=>__vitePreload(()=>import("./_inviteKey_.cc2196c0.js"),["./_inviteKey_.cc2196c0.js","./_inviteKey_.63b3cf6e.css"],import.meta.url).then(Tr=>Tr.default||Tr)},{name:"pdf-hexCipher-hexIv",path:"/pdf/:hexCipher()/:hexIv()",meta:{},alias:[],redirect:void 0,component:()=>__vitePreload(()=>import("./_hexIv_.68b83cf0.js"),["./_hexIv_.68b83cf0.js","./AppBuilder.3d13e5af.js","./InputPage.f05ce050.js","./UseCases.b569d4c6.js","./UseCases.49d21505.css","./InputPage.5c75f7cc.css","./index.d24c0c98.js","./index.fa56bddb.css","./NotFound.vue.2c054d2b.js","./AppBuilder.d83194f2.css"],import.meta.url).then(Tr=>Tr.default||Tr)},{name:"public-publicDeckId",path:"/public/:publicDeckId()",meta:{},alias:[],redirect:void 0,component:()=>__vitePreload(()=>import("./_publicDeckId_.e3a1e207.js"),["./_publicDeckId_.e3a1e207.js","./decks.be08960c.js","./NotFound.vue.2c054d2b.js","./AppBuilder.3d13e5af.js","./InputPage.f05ce050.js","./UseCases.b569d4c6.js","./UseCases.49d21505.css","./InputPage.5c75f7cc.css","./index.d24c0c98.js","./index.fa56bddb.css","./AppBuilder.d83194f2.css"],import.meta.url).then(Tr=>Tr.default||Tr)},{name:"screenshot-hexCipher-hexIv",path:"/screenshot/:hexCipher()/:hexIv()",meta:{},alias:[],redirect:void 0,component:()=>__vitePreload(()=>import("./_hexIv_.2f6584b8.js"),["./_hexIv_.2f6584b8.js","./AppBuilder.3d13e5af.js","./InputPage.f05ce050.js","./UseCases.b569d4c6.js","./UseCases.49d21505.css","./InputPage.5c75f7cc.css","./index.d24c0c98.js","./index.fa56bddb.css","./NotFound.vue.2c054d2b.js","./AppBuilder.d83194f2.css"],import.meta.url).then(Tr=>Tr.default||Tr)}],routerOptions0={scrollBehavior(Tr,Cr,$r){var Lr;const Ar=useNuxtApp(),Rr=((Lr=useRouter$1().options)==null?void 0:Lr.scrollBehaviorType)??"auto";let Dr=$r||void 0;const Mr=typeof Tr.meta.scrollToTop=="function"?Tr.meta.scrollToTop(Tr,Cr):Tr.meta.scrollToTop;if(!Dr&&Cr&&Tr&&Mr!==!1&&_isDifferentRoute(Cr,Tr)&&(Dr={left:0,top:0}),Tr.path===Cr.path){if(Cr.hash&&!Tr.hash)return{left:0,top:0};if(Tr.hash)return{el:Tr.hash,top:_getHashElementScrollMarginTop(Tr.hash),behavior:Rr}}const Br=Hr=>!!(Hr.meta.pageTransition??appPageTransition),Nr=Br(Cr)&&Br(Tr)?"page:transition:finish":"page:finish";return new Promise(Hr=>{Ar.hooks.hookOnce(Nr,async()=>{await nextTick(),Tr.hash&&(Dr={el:Tr.hash,top:_getHashElementScrollMarginTop(Tr.hash),behavior:Rr}),Hr(Dr)})})}};function _getHashElementScrollMarginTop(Tr){try{const Cr=document.querySelector(Tr);if(Cr)return parseFloat(getComputedStyle(Cr).scrollMarginTop)}catch{}return 0}function _isDifferentRoute(Tr,Cr){return Cr.path!==Tr.path||JSON.stringify(Tr.params)!==JSON.stringify(Cr.params)}const configRouterOptions={},routerOptions={...configRouterOptions,...routerOptions0},validate=async Tr=>{var Nr;let Cr,$r;if(!((Nr=Tr.meta)!=null&&Nr.validate))return;const Ar=useNuxtApp(),Rr=useRouter$1();if(([Cr,$r]=executeAsync(()=>Promise.resolve(Tr.meta.validate(Tr))),Cr=await Cr,$r(),Cr)===!0)return;const Mr=createError({statusCode:404,statusMessage:`Page Not Found: ${Tr.fullPath}`}),Br=Rr.beforeResolve(Lr=>{if(Br(),Lr===Tr){const Hr=Rr.afterEach(async()=>{Hr(),await Ar.runWithContext(()=>showError(Mr)),window.history.pushState({},"",Tr.fullPath)});return!1}})};function e$6(Tr,Cr){var $r=Object.keys(Tr);if(Object.getOwnPropertySymbols){var Ar=Object.getOwnPropertySymbols(Tr);Cr&&(Ar=Ar.filter(function(Rr){return Object.getOwnPropertyDescriptor(Tr,Rr).enumerable})),$r.push.apply($r,Ar)}return $r}function t$6(Tr){for(var Cr=1;Cr=0||(Hr[Nr]=Mr[Nr]);return Hr}(Tr,Cr);if(Object.getOwnPropertySymbols){var Dr=Object.getOwnPropertySymbols(Tr);for(Ar=0;Ar=0||Object.prototype.propertyIsEnumerable.call(Tr,$r)&&(Rr[$r]=Tr[$r])}return Rr}function d$9(Tr,Cr){if(Cr&&(typeof Cr=="object"||typeof Cr=="function"))return Cr;if(Cr!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function($r){if($r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $r}(Tr)}function f$8(Tr){var Cr=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var $r,Ar=u$a(Tr);if(Cr){var Rr=u$a(this).constructor;$r=Reflect.construct(Ar,arguments,Rr)}else $r=Ar.apply(this,arguments);return d$9(this,$r)}}function h$4(Tr,Cr){return function($r){if(Array.isArray($r))return $r}(Tr)||function($r,Ar){var Rr=$r==null?null:typeof Symbol<"u"&&$r[Symbol.iterator]||$r["@@iterator"];if(Rr!=null){var Dr,Mr,Br=[],Nr=!0,Lr=!1;try{for(Rr=Rr.call($r);!(Nr=(Dr=Rr.next()).done)&&(Br.push(Dr.value),!Ar||Br.length!==Ar);Nr=!0);}catch(Hr){Lr=!0,Mr=Hr}finally{try{Nr||Rr.return==null||Rr.return()}finally{if(Lr)throw Mr}}return Br}}(Tr,Cr)||g$7(Tr,Cr)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function p$8(Tr){return function(Cr){if(Array.isArray(Cr))return _$3(Cr)}(Tr)||function(Cr){if(typeof Symbol<"u"&&Cr[Symbol.iterator]!=null||Cr["@@iterator"]!=null)return Array.from(Cr)}(Tr)||g$7(Tr)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function g$7(Tr,Cr){if(Tr){if(typeof Tr=="string")return _$3(Tr,Cr);var $r=Object.prototype.toString.call(Tr).slice(8,-1);return $r==="Object"&&Tr.constructor&&($r=Tr.constructor.name),$r==="Map"||$r==="Set"?Array.from(Tr):$r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test($r)?_$3(Tr,Cr):void 0}}function _$3(Tr,Cr){(Cr==null||Cr>Tr.length)&&(Cr=Tr.length);for(var $r=0,Ar=new Array(Cr);$r=Tr.length?{done:!0}:{done:!1,value:Tr[Ar++]}},e:function(Nr){throw Nr},f:Rr}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Dr,Mr=!0,Br=!1;return{s:function(){$r=$r.call(Tr)},n:function(){var Nr=$r.next();return Mr=Nr.done,Nr},e:function(Nr){Br=!0,Dr=Nr},f:function(){try{Mr||$r.return==null||$r.return()}finally{if(Br)throw Dr}}}}var m$8={DEBUG:!1,LIB_VERSION:"1.81.2"},y$6=Array.prototype,b$7=Object.prototype,w$5=b$7.toString,k$3=b$7.hasOwnProperty,S$6=typeof window<"u"?window:{},E$5=S$6.navigator||{userAgent:""},x$5=S$6.document||{},P$7=E$5.userAgent,F$4=["localhost","127.0.0.1"],I$2=y$6.forEach,O$4=y$6.indexOf,$$2=Array.isArray,R$4={},T$5={log:function(){if(m$8.DEBUG&&!B$3(window.console)&&window.console){for(var Tr=("__rrweb_original__"in window.console.log)?window.console.log.__rrweb_original__:window.console.log,Cr=arguments.length,$r=new Array(Cr),Ar=0;Ar1?Cr-1:0),Ar=1;Ar0&&(Cr[Ar]=$r)}),Cr},W$4=["$performance_raw"];function Y$2(Tr,Cr){return $r=Tr,Ar=function(Dr,Mr){return Mr&&W$4.indexOf(Mr)>-1?Dr:typeof Dr=="string"&&Cr!==null?Dr.slice(0,Cr):Dr},Rr=new Set,function Dr(Mr,Br){return Mr!==Object(Mr)?Ar?Ar(Mr,Br):Mr:Rr.has(Mr)?void 0:(Rr.add(Mr),j$3(Mr)?(Nr=[],A$4(Mr,function(Lr){Nr.push(Dr(Lr))})):(Nr={},C$4(Mr,function(Lr,Hr){Rr.has(Lr)||(Nr[Hr]=Dr(Lr,Hr))})),Nr);var Nr}($r);var $r,Ar,Rr}function Q$3(Tr){var Cr,$r,Ar,Rr,Dr,Mr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Br=0,Nr=0,Lr="",Hr=[];if(!Tr)return Tr;Tr=J$3(Tr);do Cr=(Dr=Tr.charCodeAt(Br++)<<16|Tr.charCodeAt(Br++)<<8|Tr.charCodeAt(Br++))>>18&63,$r=Dr>>12&63,Ar=Dr>>6&63,Rr=63&Dr,Hr[Nr++]=Mr.charAt(Cr)+Mr.charAt($r)+Mr.charAt(Ar)+Mr.charAt(Rr);while(Br127&&Mr<2048?String.fromCharCode(Mr>>6|192,63&Mr|128):String.fromCharCode(Mr>>12|224,Mr>>6&63|128,63&Mr|128),Br!==null&&($r>Cr&&(Dr+=Tr.substring(Cr,$r)),Dr+=Br,Cr=$r=Rr+1)}return $r>Cr&&(Dr+=Tr.substring(Cr,Tr.length)),Dr},X$3=["ahrefsbot","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","duckduckbot","facebookexternal","facebookcatalog","gptbot","hubspot","linkedinbot","mj12bot","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","twitterbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"],K$3=function(Tr,Cr){return X$3.concat(Cr).some(function($r){return Tr.includes?Tr.includes($r):Tr.indexOf($r)!==-1})},Z$4=function(Tr,Cr){var $r=Cr.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),Ar=new RegExp("[\\?&]"+$r+"=([^&#]*)").exec(Tr);if(Ar===null||Ar&&typeof Ar[1]!="string"&&Ar[1].length)return"";var Rr=Ar[1];try{Rr=decodeURIComponent(Rr)}catch{T$5.error("Skipping decoding for malformed query param: "+Rr)}return Rr.replace(/\+/g," ")},ee$2=function(Tr,Cr){var $r=Tr.match(new RegExp(Cr+"=([^&]*)"));return $r?$r[1]:null},te$2=function(){function Tr(Cr){return Cr&&(Cr.preventDefault=Tr.preventDefault,Cr.stopPropagation=Tr.stopPropagation),Cr}return Tr.preventDefault=function(){this.returnValue=!1},Tr.stopPropagation=function(){this.cancelBubble=!0},function(Cr,$r,Ar,Rr,Dr){if(Cr)if(Cr.addEventListener&&!Rr)Cr.addEventListener($r,Ar,!!Dr);else{var Mr="on"+$r,Br=Cr[Mr];Cr[Mr]=function(Nr,Lr,Hr){return function(zr){if(zr=zr||Tr(window.event)){var Ur,Vr=!0;N$4(Hr)&&(Ur=Hr(zr));var jr=Lr.call(Nr,zr);return Ur!==!1&&jr!==!1||(Vr=!1),Vr}}}(Cr,Ar,Br)}else T$5.error("No valid element provided to register_event")}}();function ne$4(Tr,Cr){var $r=function(){var Ar=x$5.createElement("script");Ar.type="text/javascript",Ar.src=Tr,Ar.onload=function(Mr){return Cr(void 0,Mr)},Ar.onerror=function(Mr){return Cr(Mr)};var Rr,Dr=x$5.querySelectorAll("body > script");Dr.length>0?(Rr=Dr[0].parentNode)===null||Rr===void 0||Rr.insertBefore(Ar,Dr[0]):x$5.body.appendChild(Ar)};x$5.body?$r():x$5.addEventListener("DOMContentLoaded",$r)}var re$3={campaignParams:function(Tr){var Cr=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(Tr||[]),$r={};return C$4(Cr,function(Ar){var Rr=Z$4(x$5.URL,Ar);Rr.length&&($r[Ar]=Rr)}),$r},searchEngine:function(){var Tr=x$5.referrer;return Tr?Tr.search("https?://(.*)google.([^/?]*)")===0?"google":Tr.search("https?://(.*)bing.com")===0?"bing":Tr.search("https?://(.*)yahoo.com")===0?"yahoo":Tr.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var Tr=re$3.searchEngine(),Cr=Tr!="yahoo"?"q":"p",$r={};if(Tr!==null){$r.$search_engine=Tr;var Ar=Z$4(x$5.referrer,Cr);Ar.length&&($r.ph_keyword=Ar)}return $r},browser:function(Tr,Cr,$r){return Cr=Cr||"",$r||H$5(Tr," OPR/")?H$5(Tr,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(Tr)?"BlackBerry":H$5(Tr,"IEMobile")||H$5(Tr,"WPDesktop")?"Internet Explorer Mobile":H$5(Tr,"SamsungBrowser/")?"Samsung Internet":H$5(Tr,"Edge")||H$5(Tr,"Edg/")?"Microsoft Edge":H$5(Tr,"FBIOS")?"Facebook Mobile":H$5(Tr,"Chrome")?"Chrome":H$5(Tr,"CriOS")?"Chrome iOS":H$5(Tr,"UCWEB")||H$5(Tr,"UCBrowser")?"UC Browser":H$5(Tr,"FxiOS")?"Firefox iOS":H$5(Cr,"Apple")?H$5(Tr,"Mobile")?"Mobile Safari":"Safari":H$5(Tr,"Android")?"Android Mobile":H$5(Tr,"Konqueror")?"Konqueror":H$5(Tr,"Firefox")?"Firefox":H$5(Tr,"MSIE")||H$5(Tr,"Trident/")?"Internet Explorer":H$5(Tr,"Gecko")?"Mozilla":""},browserVersion:function(Tr,Cr,$r){var Ar={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[re$3.browser(Tr,Cr,$r)];if(Ar===void 0)return null;var Rr=Tr.match(Ar);return Rr?parseFloat(Rr[Rr.length-2]):null},browserLanguage:function(){return E$5.language||E$5.userLanguage},os:function(Tr){if(/Windows/i.test(Tr)){if(/Phone/.test(Tr)||/WPDesktop/.test(Tr))return{os_name:"Windows Phone",os_version:""};var Cr=/Windows NT ([0-9.]+)/i.exec(Tr);return Cr&&Cr[1]?{os_name:"Windows",os_version:Cr[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(Tr)){var $r=/OS (\d+)_(\d+)_?(\d+)?/i.exec(Tr);return $r&&$r[1]?{os_name:"iOS",os_version:[$r[1],$r[2],$r[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(Tr)){var Ar=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(Tr);return Ar&&Ar[1]?{os_name:"Android",os_version:[Ar[1],Ar[2],Ar[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(Tr))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(Tr)){var Rr=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(Tr);return Rr&&Rr[1]?{os_name:"Mac OS X",os_version:[Rr[1],Rr[2],Rr[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(Tr)?{os_name:"Linux",os_version:""}:/CrOS/.test(Tr)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(Tr){return/Windows Phone/i.test(Tr)||/WPDesktop/.test(Tr)?"Windows Phone":/iPad/.test(Tr)?"iPad":/iPod/.test(Tr)?"iPod Touch":/iPhone/.test(Tr)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(Tr)?"BlackBerry":/Android/.test(Tr)&&!/Mobile/.test(Tr)?"Android Tablet":/Android/.test(Tr)?"Android":""},deviceType:function(Tr){var Cr=this.device(Tr);return Cr==="iPad"||Cr==="Android Tablet"?"Tablet":Cr?"Mobile":"Desktop"},referrer:function(){return x$5.referrer||"$direct"},referringDomain:function(){if(!x$5.referrer)return"$direct";var Tr=x$5.createElement("a");return Tr.href=x$5.referrer,Tr.host},properties:function(){var Tr=re$3.os(P$7),Cr=Tr.os_name,$r=Tr.os_version;return D$3(z$2({$os:Cr,$os_version:$r,$browser:re$3.browser(P$7,E$5.vendor,S$6.opera),$device:re$3.device(P$7),$device_type:re$3.deviceType(P$7)}),{$current_url:S$6==null?void 0:S$6.location.href,$host:S$6==null?void 0:S$6.location.host,$pathname:S$6==null?void 0:S$6.location.pathname,$browser_version:re$3.browserVersion(P$7,E$5.vendor,S$6.opera),$browser_language:re$3.browserLanguage(),$screen_height:S$6==null?void 0:S$6.screen.height,$screen_width:S$6==null?void 0:S$6.screen.width,$viewport_height:S$6==null?void 0:S$6.innerHeight,$viewport_width:S$6==null?void 0:S$6.innerWidth,$lib:"web",$lib_version:m$8.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:V$1()/1e3})},people_properties:function(){var Tr=re$3.os(P$7),Cr=Tr.os_name,$r=Tr.os_version;return D$3(z$2({$os:Cr,$os_version:$r,$browser:re$3.browser(P$7,E$5.vendor,S$6.opera)}),{$browser_version:re$3.browserVersion(P$7,E$5.vendor,S$6.opera)})}};function ie$4(Tr){switch(n$9(Tr.className)){case"string":return Tr.className;case"object":return("baseVal"in Tr.className?Tr.className.baseVal:null)||Tr.getAttribute("class")||"";default:return""}}function oe$3(Tr){var Cr="";return de$4(Tr)&&!fe$3(Tr)&&Tr.childNodes&&Tr.childNodes.length&&C$4(Tr.childNodes,function($r){ue$2($r)&&$r.textContent&&(Cr+=M$3($r.textContent).split(/(\s+)/).filter(he$3).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),M$3(Cr)}function se$3(Tr){return!!Tr&&Tr.nodeType===1}function ae$2(Tr,Cr){return!!Tr&&!!Tr.tagName&&Tr.tagName.toLowerCase()===Cr.toLowerCase()}function ue$2(Tr){return!!Tr&&Tr.nodeType===3}function ce$4(Tr){return!!Tr&&Tr.nodeType===11}var le$5=["a","button","form","input","select","textarea","label"];function de$4(Tr){for(var Cr=Tr;Cr.parentNode&&!ae$2(Cr,"body");Cr=Cr.parentNode){var $r=ie$4(Cr).split(" ");if(H$5($r,"ph-sensitive")||H$5($r,"ph-no-capture"))return!1}if(H$5(ie$4(Tr).split(" "),"ph-include"))return!0;var Ar=Tr.type||"";if(typeof Ar=="string")switch(Ar.toLowerCase()){case"hidden":case"password":return!1}var Rr=Tr.name||Tr.id||"";return!(typeof Rr=="string"&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(Rr.replace(/[^a-zA-Z0-9]/g,"")))}function fe$3(Tr){return!!(ae$2(Tr,"input")&&!["button","checkbox","submit","reset"].includes(Tr.type)||ae$2(Tr,"select")||ae$2(Tr,"textarea")||Tr.getAttribute("contenteditable")==="true")}function he$3(Tr){return!(Tr===null||B$3(Tr)||typeof Tr=="string"&&(Tr=M$3(Tr),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((Tr||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(Tr)))}function pe$4(Tr){var Cr=oe$3(Tr);return he$3(Cr="".concat(Cr," ").concat(ge$5(Tr)).trim())?Cr:""}function ge$5(Tr){var Cr="";return Tr&&Tr.childNodes&&Tr.childNodes.length&&C$4(Tr.childNodes,function($r){var Ar;if($r&&((Ar=$r.tagName)===null||Ar===void 0?void 0:Ar.toLowerCase())==="span")try{var Rr=oe$3($r);Cr="".concat(Cr," ").concat(Rr).trim(),$r.childNodes&&$r.childNodes.length&&(Cr="".concat(Cr," ").concat(ge$5($r)).trim())}catch(Dr){console.error(Dr)}}),Cr}var _e$3=function(){function Tr(Cr){r$7(this,Tr),this.clicks=[],this.enabled=Cr}return o$6(Tr,[{key:"isRageClick",value:function(Cr,$r,Ar){if(!this.enabled)return!1;var Rr=this.clicks[this.clicks.length-1];if(Rr&&Math.abs(Cr-Rr.x)+Math.abs($r-Rr.y)<30&&Ar-Rr.timestamp<1e3){if(this.clicks.push({x:Cr,y:$r,timestamp:Ar}),this.clicks.length===3)return!0}else this.clicks=[{x:Cr,y:$r,timestamp:Ar}];return!1}}]),Tr}(),ve$3="$people_distinct_id",me$3="__alias",ye$2="__timers",be$3="$autocapture_disabled_server_side",we$2="$session_recording_enabled_server_side",ke$1="$console_log_recording_enabled_server_side",Se$4="$session_recording_recorder_version_server_side",Ee$2="$sesid",xe$1="$enabled_feature_flags",Pe$3="$early_access_features",Fe$2="$stored_person_properties",Ie$1="$stored_group_properties",Oe$1="$surveys",$e$2="$flag_call_reported",Re$2="$user_state",Te$3="$posthog_quota_limited",Me$2=[ve$3,me$3,"__cmpns",ye$2,we$2,Ee$2,xe$1,Re$2,Te$3,Pe$3,Ie$1,Fe$2,Oe$1,$e$2];function Ae$3(Tr,Cr){return Cr.length>Tr?Cr.slice(0,Tr)+"...":Cr}var Ce$2={_initializedTokens:[],_isDisabledServerSide:null,_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(Tr){var Cr,$r=this._isDisabledServerSide===null?!((Cr=Tr.persistence)===null||Cr===void 0||!Cr.props[be$3]):this._isDisabledServerSide,Ar=!!Tr.config.autocapture;this._isAutocaptureEnabled=Ar&&!$r},_previousElementSibling:function(Tr){if(Tr.previousElementSibling)return Tr.previousElementSibling;var Cr=Tr;do Cr=Cr.previousSibling;while(Cr&&!se$3(Cr));return Cr},_getAugmentPropertiesFromElement:function(Tr){if(!de$4(Tr))return{};var Cr={};return C$4(Tr.attributes,function($r){if($r.name.indexOf("data-ph-capture-attribute")===0){var Ar=$r.name.replace("data-ph-capture-attribute-",""),Rr=$r.value;Ar&&Rr&&he$3(Rr)&&(Cr[Ar]=Rr)}}),Cr},_getPropertiesFromElement:function(Tr,Cr,$r){var Ar,Rr=Tr.tagName.toLowerCase(),Dr={tag_name:Rr};le$5.indexOf(Rr)>-1&&!$r&&(Rr.toLowerCase()==="a"||Rr.toLowerCase()==="button"?Dr.$el_text=Ae$3(1024,pe$4(Tr)):Dr.$el_text=Ae$3(1024,oe$3(Tr)));var Mr=ie$4(Tr);Mr.length>0&&(Dr.classes=Mr.split(" ").filter(function(zr){return zr!==""}));var Br=(Ar=this.config)===null||Ar===void 0?void 0:Ar.element_attribute_ignorelist;C$4(Tr.attributes,function(zr){var Ur;fe$3(Tr)&&["name","id","class"].indexOf(zr.name)===-1||Br!=null&&Br.includes(zr.name)||!Cr&&he$3(zr.value)&&(typeof(Ur=zr.name)!="string"||Ur.substring(0,10)!=="_ngcontent"&&Ur.substring(0,7)!=="_nghost")&&(Dr["attr__"+zr.name]=Ae$3(1024,zr.value))});for(var Nr=1,Lr=1,Hr=Tr;Hr=this._previousElementSibling(Hr);)Nr++,Hr.tagName===Tr.tagName&&Lr++;return Dr.nth_child=Nr,Dr.nth_of_type=Lr,Dr},_getDefaultProperties:function(Tr){return{$event_type:Tr,$ce_version:1}},_extractCustomPropertyValue:function(Tr){var Cr=[];return C$4(document.querySelectorAll(Tr.css_selector),function($r){var Ar;["input","select"].indexOf($r.tagName.toLowerCase())>-1?Ar=$r.value:$r.textContent&&(Ar=$r.textContent),he$3(Ar)&&Cr.push(Ar)}),Cr.join(", ")},_getCustomProperties:function(Tr){var Cr=this,$r={};return C$4(this._customProperties,function(Ar){C$4(Ar.event_selectors,function(Rr){C$4(document.querySelectorAll(Rr),function(Dr){H$5(Tr,Dr)&&de$4(Dr)&&($r[Ar.name]=Cr._extractCustomPropertyValue(Ar))})})}),$r},_getEventTarget:function(Tr){return Tr.target===void 0?Tr.srcElement||null:(Cr=Tr.target)!==null&&Cr!==void 0&&Cr.shadowRoot?Tr.composedPath()[0]||null:Tr.target||null;var Cr},_captureEvent:function(Tr,Cr){var $r,Ar=this,Rr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"$autocapture",Dr=this._getEventTarget(Tr);if(ue$2(Dr)&&(Dr=Dr.parentNode||null),Rr==="$autocapture"&&Tr.type==="click"&&Tr instanceof MouseEvent&&($r=this.rageclicks)!==null&&$r!==void 0&&$r.isRageClick(Tr.clientX,Tr.clientY,new Date().getTime())&&this._captureEvent(Tr,Cr,"$rageclick"),Dr&&function(Gr,Xr){var Kr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!Gr||ae$2(Gr,"html")||!se$3(Gr))return!1;if(Kr!=null&&Kr.url_allowlist){var Zr=window.location.href,eo=Kr.url_allowlist;if(eo&&!eo.some(function(co){return Zr.match(co)}))return!1}if(Kr!=null&&Kr.dom_event_allowlist){var Wr=Kr.dom_event_allowlist;if(Wr&&!Wr.some(function(co){return Xr.type===co}))return!1}if(Kr!=null&&Kr.element_allowlist){var Yr=Kr.element_allowlist;if(Yr&&!Yr.some(function(co){return Gr.tagName.toLowerCase()===co}))return!1}if(Kr!=null&&Kr.css_selector_allowlist){var Jr=Kr.css_selector_allowlist;if(Jr&&!Jr.some(function(co){return Gr.matches(co)}))return!1}for(var no=!1,ro=[Gr],so=!0,ao=Gr;ao.parentNode&&!ae$2(ao,"body");)if(ce$4(ao.parentNode))ro.push(ao.parentNode.host),ao=ao.parentNode.host;else{if(!(so=ao.parentNode||!1))break;if(le$5.indexOf(so.tagName.toLowerCase())>-1)no=!0;else{var lo=window.getComputedStyle(so);lo&&lo.getPropertyValue("cursor")==="pointer"&&(no=!0)}ro.push(so),ao=so}var po=window.getComputedStyle(Gr);if(po&&po.getPropertyValue("cursor")==="pointer"&&Xr.type==="click")return!0;var go=Gr.tagName.toLowerCase();switch(go){case"html":return!1;case"form":return Xr.type==="submit";case"input":case"select":case"textarea":return Xr.type==="change"||Xr.type==="click";default:return no?Xr.type==="click":Xr.type==="click"&&(le$5.indexOf(go)>-1||Gr.getAttribute("contenteditable")==="true")}}(Dr,Tr,this.config)){for(var Mr,Br,Nr=[Dr],Lr=Dr;Lr.parentNode&&!ae$2(Lr,"body");)ce$4(Lr.parentNode)?(Nr.push(Lr.parentNode.host),Lr=Lr.parentNode.host):(Nr.push(Lr.parentNode),Lr=Lr.parentNode);var Hr,zr=[],Ur={},Vr=!1;if(C$4(Nr,function(Gr){var Xr=de$4(Gr);Gr.tagName.toLowerCase()==="a"&&(Hr=Gr.getAttribute("href"),Hr=Xr&&he$3(Hr)&&Hr),H$5(ie$4(Gr).split(" "),"ph-no-capture")&&(Vr=!0),zr.push(Ar._getPropertiesFromElement(Gr,Cr.config.mask_all_element_attributes,Cr.config.mask_all_text));var Kr=Ar._getAugmentPropertiesFromElement(Gr);D$3(Ur,Kr)}),Cr.config.mask_all_text||(Dr.tagName.toLowerCase()==="a"||Dr.tagName.toLowerCase()==="button"?zr[0].$el_text=pe$4(Dr):zr[0].$el_text=oe$3(Dr)),Hr&&(zr[0].attr__href=Hr),Vr)return!1;var jr=D$3(this._getDefaultProperties(Tr.type),{$elements:zr},(Mr=zr[0])!==null&&Mr!==void 0&&Mr.$el_text?{$el_text:(Br=zr[0])===null||Br===void 0?void 0:Br.$el_text}:{},this._getCustomProperties(Nr),Ur);return Cr.capture(Rr,jr),!0}},_navigate:function(Tr){window.location.href=Tr},_addDomEventHandlers:function(Tr){var Cr=this,$r=function(Ar){Ar=Ar||window.event,Cr._captureEvent(Ar,Tr)};te$2(document,"submit",$r,!1,!0),te$2(document,"change",$r,!1,!0),te$2(document,"click",$r,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(Tr){var Cr;typeof Tr.__autocapture!="boolean"&&(this.config=Tr.__autocapture),(Cr=this.config)!==null&&Cr!==void 0&&Cr.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function($r){return new RegExp($r)})),this.rageclicks=new _e$3(Tr.config.rageclick)},afterDecideResponse:function(Tr,Cr){var $r=Cr.config.token;this._initializedTokens.indexOf($r)>-1?T$5.log('autocapture already initialized for token "'+$r+'"'):(Cr.persistence&&Cr.persistence.register(s$5({},be$3,!!Tr.autocapture_opt_out)),this._isDisabledServerSide=!!Tr.autocapture_opt_out,this._setIsAutocaptureEnabled(Cr),this._initializedTokens.push($r),Tr&&Tr.config&&Tr.config.enable_collect_everything&&this._isAutocaptureEnabled?(Tr.custom_properties&&(this._customProperties=Tr.custom_properties),this._addDomEventHandlers(Cr)):Cr.__autocapture=!1)},enabledForProject:function(Tr,Cr,$r){if(!Tr)return!0;Cr=B$3(Cr)?10:Cr,$r=B$3($r)?10:$r;for(var Ar=0,Rr=0;Rr1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var Ar,Rr=this.getFlagVariants()[Cr],Dr="".concat(Rr),Mr=this.instance.get_property($e$2)||{};return($r.send_event||!("send_event"in $r))&&(!(Cr in Mr)||!Mr[Cr].includes(Dr))&&(Array.isArray(Mr[Cr])?Mr[Cr].push(Dr):Mr[Cr]=[Dr],(Ar=this.instance.persistence)===null||Ar===void 0||Ar.register(s$5({},$e$2,Mr)),this.instance.capture("$feature_flag_called",{$feature_flag:Cr,$feature_flag_response:Rr})),Rr}console.warn('getFeatureFlag for key "'+Cr+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(Cr){return this.getFlagPayloads()[Cr]}},{key:"isFeatureEnabled",value:function(Cr){var $r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(Cr,$r);console.warn('isFeatureEnabled for key "'+Cr+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(Cr){this.featureFlagEventHandlers.push(Cr)}},{key:"removeFeatureFlagsHandler",value:function(Cr){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function($r){return $r!==Cr})}},{key:"receivedFeatureFlags",value:function(Cr){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var $r=this.getFlagVariants(),Ar=this.getFlagPayloads();(function(Rr,Dr){var Mr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Br=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},Nr=Rr.featureFlags,Lr=Rr.featureFlagPayloads;if(Nr)if(Array.isArray(Nr)){var Hr,zr={};if(Nr)for(var Ur=0;Ur1&&arguments[1]!==void 0&&arguments[1],Rr=this.instance.get_property(Pe$3);if(Rr&&!Ar)return Cr(Rr);this.instance._send_request("".concat(this.instance.config.api_host,"/api/early_access_features/?token=").concat(this.instance.config.token),{},{method:"GET"},function(Dr){var Mr,Br=Dr.earlyAccessFeatures;return(Mr=$r.instance.persistence)===null||Mr===void 0||Mr.register(s$5({},Pe$3,Br)),Cr(Br)})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var Cr=this.getFlags(),$r=this.getFlagVariants();return{flags:Cr.filter(function(Ar){return $r[Ar]}),flagVariants:Object.keys($r).filter(function(Ar){return $r[Ar]}).reduce(function(Ar,Rr){return Ar[Rr]=$r[Rr],Ar},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var Cr=this._prepareFeatureFlagsForCallbacks(),$r=Cr.flags,Ar=Cr.flagVariants;this.featureFlagEventHandlers.forEach(function(Rr){return Rr($r,Ar)})}},{key:"setPersonPropertiesForFlags",value:function(Cr){var $r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],Ar=this.instance.get_property(Fe$2)||{};this.instance.register(s$5({},Fe$2,t$6(t$6({},Ar),Cr))),$r&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Fe$2)}},{key:"setGroupPropertiesForFlags",value:function(Cr){var $r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],Ar=this.instance.get_property(Ie$1)||{};Object.keys(Ar).length!==0&&Object.keys(Ar).forEach(function(Rr){Ar[Rr]=t$6(t$6({},Ar[Rr]),Cr[Rr]),delete Cr[Rr]}),this.instance.register(s$5({},Ie$1,t$6(t$6({},Ar),Cr))),$r&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(Cr){if(Cr){var $r=this.instance.get_property(Ie$1)||{};this.instance.register(s$5({},Ie$1,t$6(t$6({},$r),{},s$5({},Cr,{}))))}else this.instance.unregister(Ie$1)}}]),Tr}(),Be$3=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,qe$1={is_supported:function(){return!0},error:function(Tr){T$5.error("cookieStore error: "+Tr)},get:function(Tr){try{for(var Cr=Tr+"=",$r=document.cookie.split(";").filter(function(Dr){return Dr.length}),Ar=0;Ar<$r.length;Ar++){for(var Rr=$r[Ar];Rr.charAt(0)==" ";)Rr=Rr.substring(1,Rr.length);if(Rr.indexOf(Cr)===0)return decodeURIComponent(Rr.substring(Cr.length,Rr.length))}}catch{}return null},parse:function(Tr){var Cr;try{Cr=JSON.parse(qe$1.get(Tr))||{}}catch{}return Cr},set:function(Tr,Cr,$r,Ar,Rr){try{var Dr="",Mr="",Br="";if(Ar){var Nr=document.location.hostname.match(Be$3),Lr=Nr?Nr[0]:"";Dr=Lr?"; domain=."+Lr:""}if($r){var Hr=new Date;Hr.setTime(Hr.getTime()+24*$r*60*60*1e3),Mr="; expires="+Hr.toUTCString()}Rr&&(Br="; secure");var zr=Tr+"="+encodeURIComponent(JSON.stringify(Cr))+Mr+"; SameSite=Lax; path=/"+Dr+Br;return document.cookie=zr,zr}catch{return}},remove:function(Tr,Cr){try{qe$1.set(Tr,"",-1,Cr)}catch{return}}},Ue$1=null,Ve$1={is_supported:function(){if(Ue$1!==null)return Ue$1;var Tr=!0;if(typeof window<"u")try{var Cr="__mplssupport__";Ve$1.set(Cr,"xyz"),Ve$1.get(Cr)!=='"xyz"'&&(Tr=!1),Ve$1.remove(Cr)}catch{Tr=!1}else Tr=!1;return Tr||T$5.error("localStorage unsupported; falling back to cookie store"),Ue$1=Tr,Tr},error:function(Tr){T$5.error("localStorage error: "+Tr)},get:function(Tr){try{return window.localStorage.getItem(Tr)}catch(Cr){Ve$1.error(Cr)}return null},parse:function(Tr){try{return JSON.parse(Ve$1.get(Tr))||{}}catch{}return null},set:function(Tr,Cr){try{window.localStorage.setItem(Tr,JSON.stringify(Cr))}catch($r){Ve$1.error($r)}},remove:function(Tr){try{window.localStorage.removeItem(Tr)}catch(Cr){Ve$1.error(Cr)}}},Ge$1=["distinct_id",Ee$2],ze$2=t$6(t$6({},Ve$1),{},{parse:function(Tr){try{var Cr={};try{Cr=qe$1.parse(Tr)||{}}catch{}var $r=D$3(Cr,JSON.parse(Ve$1.get(Tr)||"{}"));return Ve$1.set(Tr,$r),$r}catch{}return null},set:function(Tr,Cr,$r,Ar,Rr){try{Ve$1.set(Tr,Cr);var Dr={};Ge$1.forEach(function(Mr){Cr[Mr]&&(Dr[Mr]=Cr[Mr])}),Object.keys(Dr).length&&qe$1.set(Tr,Dr,$r,Ar,Rr)}catch(Mr){Ve$1.error(Mr)}},remove:function(Tr,Cr){try{window.localStorage.removeItem(Tr),qe$1.remove(Tr,Cr)}catch($r){Ve$1.error($r)}}}),We$1={},Ye$1={is_supported:function(){return!0},error:function(Tr){T$5.error("memoryStorage error: "+Tr)},get:function(Tr){return We$1[Tr]||null},parse:function(Tr){return We$1[Tr]||null},set:function(Tr,Cr){We$1[Tr]=Cr},remove:function(Tr){delete We$1[Tr]}},Qe$2=null,Je$2={is_supported:function(){if(Qe$2!==null)return Qe$2;if(Qe$2=!0,typeof window<"u")try{var Tr="__support__";Je$2.set(Tr,"xyz"),Je$2.get(Tr)!=='"xyz"'&&(Qe$2=!1),Je$2.remove(Tr)}catch{Qe$2=!1}else Qe$2=!1;return Qe$2},error:function(Tr){m$8.DEBUG&&T$5.error("sessionStorage error: ",Tr)},get:function(Tr){try{return window.sessionStorage.getItem(Tr)}catch(Cr){Je$2.error(Cr)}return null},parse:function(Tr){try{return JSON.parse(Je$2.get(Tr))||null}catch{}return null},set:function(Tr,Cr){try{window.sessionStorage.setItem(Tr,JSON.stringify(Cr))}catch($r){Je$2.error($r)}},remove:function(Tr){try{window.sessionStorage.removeItem(Tr)}catch(Cr){Je$2.error(Cr)}}},Xe$1=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Ke$1=function(){function Tr(Cr){r$7(this,Tr);var $r="";Cr.token&&($r=Cr.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,this.custom_campaign_params=Cr.custom_campaign_params||[],Cr.persistence_name?this.name="ph_"+Cr.persistence_name:this.name="ph_"+$r+"_posthog",Xe$1.indexOf(Cr.persistence.toLowerCase())===-1&&(T$5.critical("Unknown persistence type "+Cr.persistence+"; falling back to cookie"),Cr.persistence="cookie");var Ar=Cr.persistence.toLowerCase();Ar==="localstorage"&&Ve$1.is_supported()?this.storage=Ve$1:Ar==="localstorage+cookie"&&ze$2.is_supported()?this.storage=ze$2:Ar==="sessionstorage"&&Je$2.is_supported()?this.storage=Je$2:this.storage=Ar==="memory"?Ye$1:qe$1,this.user_state="anonymous",this.load(),this.update_config(Cr),this.save()}return o$6(Tr,[{key:"properties",value:function(){var Cr={};return C$4(this.props,function($r,Ar){if(Ar===xe$1&&n$9($r)==="object")for(var Rr=Object.keys($r),Dr=0;Dr1&&arguments[1]!==void 0?arguments[1]:{};r$7(this,Tr),s$5(this,"bucketSize",100),s$5(this,"refillRate",10),s$5(this,"mutationBuckets",{}),s$5(this,"loggedTracker",{}),s$5(this,"refillBuckets",function(){Object.keys(Rr.mutationBuckets).forEach(function(Mr){Rr.mutationBuckets[Mr]=Rr.mutationBuckets[Mr]+Rr.refillRate,Rr.mutationBuckets[Mr]>=Rr.bucketSize&&delete Rr.mutationBuckets[Mr]})}),s$5(this,"getNodeOrRelevantParent",function(Mr){var Br=Rr.rrweb.mirror.getNode(Mr);if((Br==null?void 0:Br.nodeName)!=="svg"&&Br instanceof Element){var Nr=Br.closest("svg");if(Nr)return[Rr.rrweb.mirror.getId(Nr),Nr]}return[Mr,Br]}),s$5(this,"numberOfChanges",function(Mr){var Br,Nr,Lr,Hr,zr,Ur,Vr,jr;return((Br=(Nr=Mr.removes)===null||Nr===void 0?void 0:Nr.length)!==null&&Br!==void 0?Br:0)+((Lr=(Hr=Mr.attributes)===null||Hr===void 0?void 0:Hr.length)!==null&&Lr!==void 0?Lr:0)+((zr=(Ur=Mr.texts)===null||Ur===void 0?void 0:Ur.length)!==null&&zr!==void 0?zr:0)+((Vr=(jr=Mr.adds)===null||jr===void 0?void 0:jr.length)!==null&&Vr!==void 0?Vr:0)}),s$5(this,"throttleMutations",function(Mr){if(Mr.type!==nt$2||Mr.data.source!==it$3)return Mr;var Br=Mr.data,Nr=Rr.numberOfChanges(Br);Br.attributes&&(Br.attributes=Br.attributes.filter(function(Hr){var zr,Ur,Vr,jr=h$4(Rr.getNodeOrRelevantParent(Hr.id),2),Gr=jr[0],Xr=jr[1];return Rr.mutationBuckets[Gr]===0?!1:(Rr.mutationBuckets[Gr]=(zr=Rr.mutationBuckets[Gr])!==null&&zr!==void 0?zr:Rr.bucketSize,Rr.mutationBuckets[Gr]=Math.max(Rr.mutationBuckets[Gr]-1,0),Rr.mutationBuckets[Gr]===0&&(Rr.loggedTracker[Gr]||(Rr.loggedTracker[Gr]=!0,(Ur=(Vr=Rr.options).onBlockedNode)===null||Ur===void 0||Ur.call(Vr,Gr,Xr))),Hr)}));var Lr=Rr.numberOfChanges(Br);return Lr!==0||Nr===Lr?Mr:void 0}),this.rrweb=Cr,this.options=Dr,this.refillRate=($r=this.options.refillRate)!==null&&$r!==void 0?$r:this.refillRate,this.bucketSize=(Ar=this.options.bucketSize)!==null&&Ar!==void 0?Ar:this.bucketSize,setInterval(function(){Rr.refillBuckets()},1e3)}),ct$2=function(Tr){return Tr[Tr.DomContentLoaded=0]="DomContentLoaded",Tr[Tr.Load=1]="Load",Tr[Tr.FullSnapshot=2]="FullSnapshot",Tr[Tr.IncrementalSnapshot=3]="IncrementalSnapshot",Tr[Tr.Meta=4]="Meta",Tr[Tr.Custom=5]="Custom",Tr[Tr.Plugin=6]="Plugin",Tr}(ct$2||{}),lt$3="/s/";(function(Tr){Tr[Tr.Mutation=0]="Mutation",Tr[Tr.MouseMove=1]="MouseMove",Tr[Tr.MouseInteraction=2]="MouseInteraction",Tr[Tr.Scroll=3]="Scroll",Tr[Tr.ViewportResize=4]="ViewportResize",Tr[Tr.Input=5]="Input",Tr[Tr.TouchMove=6]="TouchMove",Tr[Tr.MediaInteraction=7]="MediaInteraction",Tr[Tr.StyleSheetRule=8]="StyleSheetRule",Tr[Tr.CanvasMutation=9]="CanvasMutation",Tr[Tr.Font=10]="Font",Tr[Tr.Log=11]="Log",Tr[Tr.Drag=12]="Drag",Tr[Tr.StyleDeclaration=13]="StyleDeclaration",Tr[Tr.Selection=14]="Selection",Tr[Tr.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(at$2||(at$2={}));var dt$2=[at$2.MouseMove,at$2.MouseInteraction,at$2.Scroll,at$2.ViewportResize,at$2.Input,at$2.TouchMove,at$2.MediaInteraction,at$2.Drag],ft$2=function(){function Tr(Cr){var $r=this;r$7(this,Tr),s$5(this,"lastActivityTimestamp",Date.now()),s$5(this,"isIdle",!1),this.instance=Cr,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint=lt$3,this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1,window.addEventListener("beforeunload",function(){$r._flushBuffer()})}return o$6(Tr,[{key:"getSessionManager",value:function(){if(this.instance.sessionManager)return this.instance.sessionManager;T$5.error("Session recording started without valid sessionManager")}},{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var Cr=!!this.instance.get_property(we$2),$r=!this.instance.config.disable_session_recording;return Cr&&$r}},{key:"isConsoleLogCaptureEnabled",value:function(){var Cr=!!this.instance.get_property(ke$1),$r=this.instance.config.enable_recording_console_log;return $r??Cr}},{key:"getRecordingVersion",value:function(){var Cr,$r=this.instance.get_property(Se$4);return((Cr=this.instance.config.session_recording)===null||Cr===void 0?void 0:Cr.recorderVersion)||$r||"v1"}},{key:"afterDecideResponse",value:function(Cr){var $r,Ar,Rr,Dr,Mr,Br;this.receivedDecide=!0,this.instance.persistence&&this.instance.persistence.register((s$5(Mr={},we$2,!!Cr.sessionRecording),s$5(Mr,ke$1,(Rr=Cr.sessionRecording)===null||Rr===void 0?void 0:Rr.consoleLogRecordingEnabled),s$5(Mr,Se$4,(Dr=Cr.sessionRecording)===null||Dr===void 0?void 0:Dr.recorderVersion),Mr)),($r=Cr.sessionRecording)!==null&&$r!==void 0&&$r.endpoint&&(this.endpoint=(Br=Cr.sessionRecording)===null||Br===void 0?void 0:Br.endpoint),(Ar=Cr.sessionRecording)!==null&&Ar!==void 0&&Ar.recorderVersion&&(this.recorderVersion=Cr.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"log",value:function(Cr){var $r,Ar=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";($r=this.instance.sessionRecording)===null||$r===void 0||$r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:Ar,trace:[],payload:[JSON.stringify(Cr)]}},timestamp:V$1()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var Cr=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach(function($r){return Cr._captureSnapshotBuffered($r)})),this._startCapture()}},{key:"_startCapture",value:function(){var Cr=this,$r=this.getSessionManager();if($r&&Object.assign!==void 0&&!this.captureStarted&&!this.instance.config.disable_session_recording){this.captureStarted=!0,$r.checkAndGetSessionAndWindowId();var Ar=this.getRecordingVersion()==="v2"?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?ne$4(this.instance.config.api_host+"/static/".concat(Ar,"?v=").concat(m$8.LIB_VERSION),function(Rr){if(Rr)return T$5.error("Could not load ".concat(Ar),Rr);Cr._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(Cr){var $r;return Cr.type===nt$2&&dt$2.indexOf(($r=Cr.data)===null||$r===void 0?void 0:$r.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(Cr){var $r=this.getSessionManager();if($r){var Ar=this._isInteractiveEvent(Cr);if(Ar||this.isIdle||Cr.timestamp-this.lastActivityTimestamp>3e5&&(this.isIdle=!0),Ar&&(this.lastActivityTimestamp=Cr.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var Rr=$r.checkAndGetSessionAndWindowId(!Ar,Cr.timestamp),Dr=Rr.windowId,Mr=Rr.sessionId;[et$2,tt$3].indexOf(Cr.type)!==-1||this.windowId===Dr&&this.sessionId===Mr||this._tryTakeFullSnapshot(),this.windowId=Dr,this.sessionId=Mr}}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this.captureStarted)return!1;try{var Cr;return(Cr=this.rrwebRecord)===null||Cr===void 0||Cr.takeFullSnapshot(),!0}catch($r){return T$5.error("Error taking full snapshot.",$r),!1}}},{key:"_onScriptLoaded",value:function(){var Cr,$r=this,Ar={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var Rr=this.instance.config.session_recording,Dr=0,Mr=Object.entries(Rr||{});Drot$2){var Hr,zr=v$7(Lr.matchAll(/data:([\w/\-.]+);(\w+),([^)"]*)/gim));try{for(zr.s();!(Hr=zr.n()).done;){var Ur=Hr.value;Lr=Ur[1].toLocaleLowerCase().slice(0,6)==="image/"?Lr.replace(Ur[0],Ze$2):Lr.replace(Ur[0],"")}}catch(Vr){zr.e(Vr)}finally{zr.f()}}return{event:JSON.parse(Lr),size:Lr.length}}(function(Nr){var Lr=Nr;if(Lr&&n$9(Lr)==="object"&&Lr.type===rt$2&&n$9(Lr.data)==="object"&&Lr.data.plugin===st$2){Lr.data.payload.payload.length>10&&(Lr.data.payload.payload=Lr.data.payload.payload.slice(0,10),Lr.data.payload.payload.push("...[truncated]"));for(var Hr=[],zr=0;zr2e3?Hr.push(Lr.data.payload.payload[zr].slice(0,2e3)+"...[truncated]"):Hr.push(Lr.data.payload.payload[zr]);return Lr.data.payload.payload=Hr,Nr}return Nr}(Ar)),Dr=Rr.event,Mr=Rr.size;if(this._updateWindowAndSessionIds(Dr),!this.isIdle){var Br={$snapshot_bytes:Mr,$snapshot_data:Dr,$session_id:this.sessionId,$window_id:this.windowId};this.emit?this._captureSnapshotBuffered(Br):this.snapshots.push(Br)}}}}},{key:"_maskUrl",value:function(Cr){var $r=this.instance.config.session_recording;if($r.maskNetworkRequestFn){var Ar,Rr={url:Cr};return(Ar=Rr=$r.maskNetworkRequestFn(Rr))===null||Ar===void 0?void 0:Ar.url}return Cr}},{key:"_flushBuffer",value:function(){return this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0),this.buffer&&this.buffer.data.length!==0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_captureSnapshotBuffered",value:function(Cr){var $r,Ar=this,Rr=2+((($r=this.buffer)===null||$r===void 0?void 0:$r.data.length)||0);(!this.buffer||this.buffer.size+Cr.$snapshot_bytes+Rr>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=Cr.$snapshot_bytes,this.buffer.data.push(Cr.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){Ar._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(Cr){this.instance.capture("$snapshot",Cr,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:"recordings",_metrics:{rrweb_full_snapshot:Cr.$snapshot_data.type===et$2}})}}]),Tr}(),ht$2={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},pt$2=["first-input","navigation","paint","resource"],gt$3=["/s/","/e/"],_t$2=function(){function Tr(Cr){r$7(this,Tr),s$5(this,"_forceAllowLocalhost",!1),this.instance=Cr}return o$6(Tr,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var Cr,$r,Ar=this;if(!this.observer)if(((Cr=window)===null||Cr===void 0||($r=Cr.PerformanceObserver)===null||$r===void 0?void 0:$r.supportedEntryTypes)!==void 0)if(!F$4.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver(function(Dr){Dr.getEntries().forEach(function(Mr){Ar._capturePerformanceEvent(Mr)})});var Rr=PerformanceObserver.supportedEntryTypes.filter(function(Dr){return pt$2.includes(Dr)});Rr.forEach(function(Dr){var Mr;(Mr=Ar.observer)===null||Mr===void 0||Mr.observe({type:Dr,buffered:!0})})}catch(Dr){console.error("PostHog failed to start performance observer",Dr),this.stopObserving()}else T$5.log("PostHog Peformance observer not started because we are on localhost.");else T$5.log("PostHog Performance observer not started because PerformanceObserver is not supported by this browser.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var Cr,$r;return(Cr=($r=this.instance.config.capture_performance)!==null&&$r!==void 0?$r:this.remoteEnabled)!==null&&Cr!==void 0&&Cr}},{key:"afterDecideResponse",value:function(Cr){this.remoteEnabled=Cr.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(Cr){if(Cr.name.indexOf(this.instance.config.api_host)===0){var $r=Cr.name.replace(this.instance.config.api_host,"");if(gt$3.find(function(Vr){return $r.indexOf(Vr)===0}))return}var Ar={url:Cr.name},Rr=this.instance.config.session_recording;if(Rr.maskNetworkRequestFn&&(Ar=Rr.maskNetworkRequestFn(Ar)),Ar){var Dr=Cr.toJSON();Dr.name=Ar.url;var Mr={},Br=Math.floor(Date.now()-performance.now());for(var Nr in Mr[ht$2.timeOrigin]=Br,Mr[ht$2.timestamp]=Math.floor(Br+Cr.startTime),ht$2)Dr[Nr]!==void 0&&(Mr[ht$2[Nr]]=Dr[Nr]);if(this.capturePerformanceEvent(Mr),vt$2(Cr)){var Lr,Hr=v$7(Cr.serverTiming||[]);try{for(Hr.s();!(Lr=Hr.n()).done;){var zr,Ur=Lr.value;this.capturePerformanceEvent((s$5(zr={},ht$2.timeOrigin,Br),s$5(zr,ht$2.timestamp,Math.floor(Br+Cr.startTime)),s$5(zr,ht$2.name,Ur.name),s$5(zr,ht$2.duration,Ur.duration),s$5(zr,ht$2.entryType,"serverTiming"),zr))}}catch(Vr){Hr.e(Vr)}finally{Hr.f()}}}}},{key:"capturePerformanceEvent",value:function(Cr){var $r,Ar=Cr[ht$2.timestamp];($r=this.instance.sessionRecording)===null||$r===void 0||$r.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:Cr},timestamp:Ar})}}]),Tr}(),vt$2=function(Tr){return Tr.entryType==="navigation"||Tr.entryType==="resource"},mt$2=function(){function Tr(Cr){r$7(this,Tr),this.instance=Cr,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return o$6(Tr,[{key:"call",value:function(){var Cr=this,$r=Q$3(JSON.stringify({token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Fe$2),group_properties:this.instance.get_property(Ie$1),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0}));this.instance._send_request("".concat(this.instance.config.api_host,"/decide/?v=3"),{data:$r,verbose:!0},{method:"POST"},function(Ar){return Cr.parseDecideResponse(Ar)})}},{key:"parseDecideResponse",value:function(Cr){var $r,Ar,Rr,Dr,Mr=this;if(this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer(),(Cr==null?void 0:Cr.status)!==0){if(!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){Mr.parseDecideResponse(Cr)},500);if(this.instance.toolbar.afterDecideResponse(Cr),($r=this.instance.sessionRecording)===null||$r===void 0||$r.afterDecideResponse(Cr),Ce$2.afterDecideResponse(Cr,this.instance),(Ar=this.instance.webPerformance)===null||Ar===void 0||Ar.afterDecideResponse(Cr),(Rr=this.instance.exceptionAutocapture)===null||Rr===void 0||Rr.afterDecideResponse(Cr),this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.featureFlags.receivedFeatureFlags(Cr),this.instance.compression={},Cr.supportedCompression&&!this.instance.config.disable_compression){var Br,Nr={},Lr=v$7(Cr.supportedCompression);try{for(Lr.s();!(Br=Lr.n()).done;)Nr[Br.value]=!0}catch(Gr){Lr.e(Gr)}finally{Lr.f()}this.instance.compression=Nr}var Hr=(Dr=window)===null||Dr===void 0?void 0:Dr.extendPostHogWithSurveys;if(Cr.surveys&&!Hr&&ne$4(this.instance.config.api_host+"/static/surveys.js",function(Gr){if(Gr)return console.error("Could not load surveys script",Gr);window.extendPostHogWithSurveys(Mr.instance)}),Cr.siteApps)if(this.instance.config.opt_in_site_apps){var zr,Ur=this.instance.config.api_host,Vr=v$7(Cr.siteApps);try{var jr=function(){var Gr=zr.value,Xr=Gr.id,Kr=Gr.url,Zr=[Ur,Ur[Ur.length-1]==="/"&&Kr[0]==="/"?Kr.substring(1):Kr].join("");window["__$$ph_site_app_".concat(Xr)]=Mr.instance,ne$4(Zr,function(eo){eo&&console.error("Error while initializing PostHog app with config id ".concat(Xr),eo)})};for(Vr.s();!(zr=Vr.n()).done;)jr()}catch(Gr){Vr.e(Gr)}finally{Vr.f()}}else Cr.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),Tr}(),yt$2=["https://app.posthog.com","https://eu.posthog.com"],bt$2=["source"],wt$2=function(){function Tr(Cr){r$7(this,Tr),this.instance=Cr}return o$6(Tr,[{key:"afterDecideResponse",value:function(Cr){var $r=Cr.toolbarParams||Cr.editorParams||(Cr.toolbarVersion?{toolbarVersion:Cr.toolbarVersion}:{});Cr.isAuthenticated&&$r.toolbarVersion&&$r.toolbarVersion.indexOf("toolbar")===0&&this.loadToolbar(t$6({},$r))}},{key:"maybeLoadToolbar",value:function(){var Cr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location,$r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,Ar=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window.history;try{if(!$r){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch{return!1}$r=window.localStorage}var Rr,Dr=ee$2(Cr.hash,"__posthog")||ee$2(Cr.hash,"state"),Mr=Dr?JSON.parse(decodeURIComponent(Dr)):null;return Mr&&Mr.action==="ph_authorize"?((Rr=Mr).source="url",Rr&&Object.keys(Rr).length>0&&(Mr.desiredHash?Cr.hash=Mr.desiredHash:Ar?Ar.replaceState("",document.title,Cr.pathname+Cr.search):Cr.hash="")):((Rr=JSON.parse($r.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete Rr.userIntent),!(!Rr.token||this.instance.config.token!==Rr.token)&&(this.loadToolbar(Rr),!0)}catch{return!1}}},{key:"loadToolbar",value:function(Cr){var $r=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var Ar=this.instance.config.api_host,Rr=3e5,Dr=Math.floor(Date.now()/Rr)*Rr,Mr="".concat(Ar).concat(Ar.endsWith("/")?"":"/","static/toolbar.js?t=").concat(Dr),Br=!yt$2.includes(this.instance.config.api_host)&&this.instance.config.advanced_disable_toolbar_metrics,Nr=t$6(t$6({token:this.instance.config.token},Cr),{},{apiURL:Ar},Br?{instrument:!1}:{});Nr.source;var Lr=l$7(Nr,bt$2);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(Lr)),ne$4(Mr,function(Hr){Hr?T$5.error("Failed to load toolbar",Hr):(window.ph_load_toolbar||window.ph_load_editor)(Nr,$r.instance)}),te$2(window,"turbolinks:load",function(){window._postHogToolbarLoaded=!1,$r.loadToolbar(Nr)}),!0}},{key:"_loadEditor",value:function(Cr){return this.loadToolbar(Cr)}},{key:"maybeLoadEditor",value:function(){var Cr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location,$r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,Ar=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window.history;return this.maybeLoadToolbar(Cr,$r,Ar)}}]),Tr}(),kt$1="__ph_opt_in_out_";function St$2(Tr,Cr){Rt$1(!0,Tr,Cr)}function Et$1(Tr,Cr){Rt$1(!1,Tr,Cr)}function xt$2(Tr,Cr){return $t$2(Tr,Cr)==="1"}function Pt$2(Tr,Cr){return!!function($r){if($r&&$r.respectDnt){var Ar=$r&&$r.window||S$6,Rr=Ar.navigator||{},Dr=!1;return C$4([Rr.doNotTrack,Rr.msDoNotTrack,Ar.doNotTrack],function(Mr){H$5([!0,1,"1","yes"],Mr)&&(Dr=!0)}),Dr}return!1}(Cr)||$t$2(Tr,Cr)==="0"}function Ft$1(Tr,Cr){It$1(Cr=Cr||{}).remove(Ot$1(Tr,Cr),!!Cr.crossSubdomainCookie)}function It$1(Tr){return(Tr=Tr||{}).persistenceType==="localStorage"?Ve$1:Tr.persistenceType==="localStorage+cookie"?ze$2:qe$1}function Ot$1(Tr,Cr){return((Cr=Cr||{}).persistencePrefix||kt$1)+Tr}function $t$2(Tr,Cr){return It$1(Cr).get(Ot$1(Tr,Cr))}function Rt$1(Tr,Cr,$r){q$3(Cr)&&Cr.length?(It$1($r=$r||{}).set(Ot$1(Cr,$r),Tr?1:0,U$4($r.cookieExpiration)?$r.cookieExpiration:null,$r.crossSubdomainCookie,$r.secureCookie),$r.capture&&Tr&&$r.capture($r.captureEventName||"$opt_in",$r.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(Tr?"optIn":"optOut")+" called with an invalid token")}var Tt$2=function(){function Tr(){var Cr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3e3;r$7(this,Tr),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=Cr}return o$6(Tr,[{key:"setPollInterval",value:function(Cr){this._pollInterval=Cr,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return new Date().getTime()}}]),Tr}(),Mt$1=function(Tr){a$8($r,Tt$2);var Cr=f$8($r);function $r(Ar){var Rr,Dr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3e3;return r$7(this,$r),(Rr=Cr.call(this,Dr)).handlePollRequest=Ar,Rr}return o$6($r,[{key:"enqueue",value:function(Ar,Rr,Dr){this._event_queue.push({url:Ar,data:Rr,options:Dr}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var Ar=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(Ar._event_queue.length>0){var Rr=Ar.formatQueue(),Dr=function(Br){var Nr=Rr[Br],Lr=Nr.url,Hr=Nr.data,zr=Nr.options;C$4(Hr,function(Ur,Vr){Hr[Vr].offset=Math.abs(Hr[Vr].timestamp-Ar.getTime()),delete Hr[Vr].timestamp}),Ar.handlePollRequest(Lr,Hr,zr)};for(var Mr in Rr)Dr(Mr);Ar._event_queue.length=0,Ar._empty_queue_count=0}else Ar._empty_queue_count++;Ar._empty_queue_count>4&&(Ar.isPolling=!1,Ar._empty_queue_count=0),Ar.isPolling&&Ar.poll()},this._pollInterval)}},{key:"unload",value:function(){var Ar=this;clearTimeout(this._poller);var Rr=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var Dr=Object.values(Rr);[].concat(p$8(Dr.filter(function(Mr){return Mr.url.indexOf("/e")===0})),p$8(Dr.filter(function(Mr){return Mr.url.indexOf("/e")!==0}))).map(function(Mr){var Br=Mr.url,Nr=Mr.data,Lr=Mr.options;Ar.handlePollRequest(Br,Nr,t$6(t$6({},Lr),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var Ar={};return C$4(this._event_queue,function(Rr){var Dr=Rr.url,Mr=Rr.data,Br=Rr.options,Nr=(Br?Br._batchKey:null)||Dr;Ar[Nr]===void 0&&(Ar[Nr]={data:[],url:Dr,options:Br}),Br&&Ar[Nr].options&&Ar[Nr].options._metrics&&!Ar[Nr].options._metrics.rrweb_full_snapshot&&(Ar[Nr].options._metrics.rrweb_full_snapshot=Br._metrics.rrweb_full_snapshot),Ar[Nr].data.push(Mr)}),Ar}}]),$r}(),At$1=Uint8Array,Ct$2=Uint16Array,Dt$1=Uint32Array,jt$1=new At$1([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]),Nt$1=new At$1([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]),Ht$1=new At$1([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Lt$2=function(Tr,Cr){for(var $r=new Ct$2(31),Ar=0;Ar<31;++Ar)$r[Ar]=Cr+=1<>>1|(21845&zt$2)<<1;Wt$1=(61680&(Wt$1=(52428&Wt$1)>>>2|(13107&Wt$1)<<2))>>>4|(3855&Wt$1)<<4,Gt$2[zt$2]=((65280&Wt$1)>>>8|(255&Wt$1)<<8)>>>1}var Yt$1=function(Tr,Cr,$r){for(var Ar=Tr.length,Rr=0,Dr=new Ct$2(Cr);Rr>>Nr]=Lr}else for(Mr=new Ct$2(Ar),Rr=0;Rr>>15-Tr[Rr];return Mr},Qt$1=new At$1(288);for(zt$2=0;zt$2<144;++zt$2)Qt$1[zt$2]=8;for(zt$2=144;zt$2<256;++zt$2)Qt$1[zt$2]=9;for(zt$2=256;zt$2<280;++zt$2)Qt$1[zt$2]=7;for(zt$2=280;zt$2<288;++zt$2)Qt$1[zt$2]=8;var Jt$1=new At$1(32);for(zt$2=0;zt$2<32;++zt$2)Jt$1[zt$2]=5;var Xt$1,Kt$1=Yt$1(Qt$1,9,0),Zt$1=Yt$1(Jt$1,5,0),en$1=function(Tr){return(Tr/8>>0)+(7&Tr&&1)},tn$1=function(Tr,Cr,$r){(Cr==null||Cr<0)&&(Cr=0),($r==null||$r>Tr.length)&&($r=Tr.length);var Ar=new(Tr instanceof Ct$2?Ct$2:Tr instanceof Dt$1?Dt$1:At$1)($r-Cr);return Ar.set(Tr.subarray(Cr,$r)),Ar},nn$1=function(Tr,Cr,$r){$r<<=7&Cr;var Ar=Cr/8>>0;Tr[Ar]|=$r,Tr[Ar+1]|=$r>>>8},rn$1=function(Tr,Cr,$r){$r<<=7&Cr;var Ar=Cr/8>>0;Tr[Ar]|=$r,Tr[Ar+1]|=$r>>>8,Tr[Ar+2]|=$r>>>16},on$2=function(Tr,Cr){for(var $r=[],Ar=0;ArUr&&(Ur=Dr[Ar].s);var Vr=new Ct$2(Ur+1),jr=sn$1($r[Hr-1],Vr,0);if(jr>Cr){Ar=0;var Gr=0,Xr=jr-Cr,Kr=1<Cr))break;Gr+=Kr-(1<>>=Xr;Gr>0;){var eo=Dr[Ar].s;Vr[eo]=0&&Gr;--Ar){var Wr=Dr[Ar].s;Vr[Wr]==Cr&&(--Vr[Wr],++Gr)}jr=Cr}return[new At$1(Vr),jr]},sn$1=function Tr(Cr,$r,Ar){return Cr.s==-1?Math.max(Tr(Cr.l,$r,Ar+1),Tr(Cr.r,$r,Ar+1)):$r[Cr.s]=Ar},an$1=function(Tr){for(var Cr=Tr.length;Cr&&!Tr[--Cr];);for(var $r=new Ct$2(++Cr),Ar=0,Rr=Tr[0],Dr=1,Mr=function(Nr){$r[Ar++]=Nr},Br=1;Br<=Cr;++Br)if(Tr[Br]==Rr&&Br!=Cr)++Dr;else{if(!Rr&&Dr>2){for(;Dr>138;Dr-=138)Mr(32754);Dr>2&&(Mr(Dr>10?Dr-11<<5|28690:Dr-3<<5|12305),Dr=0)}else if(Dr>3){for(Mr(Rr),--Dr;Dr>6;Dr-=6)Mr(8304);Dr>2&&(Mr(Dr-3<<5|8208),Dr=0)}for(;Dr--;)Mr(Rr);Dr=1,Rr=Tr[Br]}return[$r.subarray(0,Ar),Cr]},un$1=function(Tr,Cr){for(var $r=0,Ar=0;Ar>>8,Tr[Rr+2]=255^Tr[Rr],Tr[Rr+3]=255^Tr[Rr+1];for(var Dr=0;Dr4&&!ao[Ht$1[po-1]];--po);var go,co,mo,io,uo=Lr+5<<3,ho=un$1(Rr,Qt$1)+un$1(Dr,Jt$1)+Mr,yo=un$1(Rr,Ur)+un$1(Dr,Gr)+Mr+14+3*po+un$1(no,ao)+(2*no[16]+3*no[17]+7*no[18]);if(uo<=ho&&uo<=yo)return cn$1(Cr,Hr,Tr.subarray(Nr,Nr+Lr));if(nn$1(Cr,Hr,1+(yo15&&(nn$1(Cr,Hr,Go[ro]>>>5&127),Hr+=Go[ro]>>>12)}}}else go=Kt$1,co=Qt$1,mo=Zt$1,io=Jt$1;for(ro=0;ro255){No=Ar[ro]>>>18&31,rn$1(Cr,Hr,go[No+257]),Hr+=co[No+257],No>7&&(nn$1(Cr,Hr,Ar[ro]>>>23&31),Hr+=jt$1[No]);var Eo=31&Ar[ro];rn$1(Cr,Hr,mo[Eo]),Hr+=io[Eo],Eo>3&&(rn$1(Cr,Hr,Ar[ro]>>>5&8191),Hr+=Nt$1[Eo])}else rn$1(Cr,Hr,go[Ar[ro]]),Hr+=co[Ar[ro]];return rn$1(Cr,Hr,go[256]),Hr+co[256]},dn$1=new Dt$1([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),fn$1=new At$1(0),hn$1=function(){for(var Tr=new Dt$1(256),Cr=0;Cr<256;++Cr){for(var $r=Cr,Ar=9;--Ar;)$r=(1&$r&&3988292384)^$r>>>1;Tr[Cr]=$r}return Tr}(),pn$1=function(){var Tr=4294967295;return{p:function(Cr){for(var $r=Tr,Ar=0;Ar>>8;Tr=$r},d:function(){return 4294967295^Tr}}},gn$1=function(Tr,Cr,$r,Ar,Rr){return function(Dr,Mr,Br,Nr,Lr,Hr){var zr=Dr.length,Ur=new At$1(Nr+zr+5*(1+Math.floor(zr/7e3))+Lr),Vr=Ur.subarray(Nr,Ur.length-Lr),jr=0;if(!Mr||zr<8)for(var Gr=0;Gr<=zr;Gr+=65535){var Xr=Gr+65535;Xr>>13,eo=8191&Kr,Wr=(1<7e3||mo>24576)&&ko>423){jr=ln$1(Dr,Vr,0,ao,lo,po,co,mo,uo,Gr-uo,jr),mo=go=co=0,uo=Gr;for(var $o=0;$o<286;++$o)lo[$o]=0;for($o=0;$o<30;++$o)po[$o]=0}var Go=2,No=0,Eo=eo,Mo=yo-So&32767;if(ko>2&&ho==so(Gr-Mo))for(var Ro=Math.min(Zr,ko)-1,Ao=Math.min(32767,Gr),zo=Math.min(258,ko);Mo<=Ao&&--Eo&&yo!=So;){if(Dr[Gr+Go]==Dr[Gr+Go-Mo]){for(var Oo=0;OoGo){if(Go=Oo,No=Mo,Oo>Ro)break;var Bo=Math.min(Mo,Oo-2),bo=0;for($o=0;$obo&&(bo=Io,So=vo)}}}Mo+=(yo=So)-(So=Yr[yo])+32768&32767}if(No){ao[mo++]=268435456|Ut$1[Go]<<18|Vt$1[No];var To=31&Ut$1[Go],Co=31&Vt$1[No];co+=jt$1[To]+Nt$1[Co],++lo[257+To],++po[Co],io=Gr+Go,++go}else ao[mo++]=Dr[Gr],++lo[Dr[Gr]]}}jr=ln$1(Dr,Vr,Hr,ao,lo,po,co,mo,uo,Gr-uo,jr),Hr||(jr=cn$1(Vr,jr,fn$1))}return tn$1(Ur,0,Nr+en$1(jr)+Lr)}(Tr,Cr.level==null?6:Cr.level,Cr.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(Tr.length)))):12+Cr.mem,$r,Ar,!Rr)},_n$1=function(Tr,Cr,$r){for(;$r;++Cr)Tr[Cr]=$r,$r>>>=8},vn$1=function(Tr,Cr){var $r=Cr.filename;if(Tr[0]=31,Tr[1]=139,Tr[2]=8,Tr[8]=Cr.level<2?4:Cr.level==9?2:0,Tr[9]=3,Cr.mtime!=0&&_n$1(Tr,4,Math.floor(new Date(Cr.mtime||Date.now())/1e3)),$r){Tr[3]=8;for(var Ar=0;Ar<=$r.length;++Ar)Tr[Ar+10]=$r.charCodeAt(Ar)}},mn$1=function(Tr){return 10+(Tr.filename&&Tr.filename.length+1||0)};function yn$1(Tr,Cr){Cr===void 0&&(Cr={});var $r=pn$1(),Ar=Tr.length;$r.p(Tr);var Rr=gn$1(Tr,Cr,mn$1(Cr),8),Dr=Rr.length;return vn$1(Rr,Cr),_n$1(Rr,Dr-8,$r.d()),_n$1(Rr,Dr-4,Ar),Rr}function bn$1(Tr,Cr){var $r=Tr.length;if(!Cr&&typeof TextEncoder<"u")return new TextEncoder().encode(Tr);for(var Ar=new At$1(Tr.length+(Tr.length>>>1)),Rr=0,Dr=function(Lr){Ar[Rr++]=Lr},Mr=0;Mr<$r;++Mr){if(Rr+5>Ar.length){var Br=new At$1(Rr+8+($r-Mr<<1));Br.set(Ar),Ar=Br}var Nr=Tr.charCodeAt(Mr);Nr<128||Cr?Dr(Nr):Nr<2048?(Dr(192|Nr>>>6),Dr(128|63&Nr)):Nr>55295&&Nr<57344?(Dr(240|(Nr=65536+(1047552&Nr)|1023&Tr.charCodeAt(++Mr))>>>18),Dr(128|Nr>>>12&63),Dr(128|Nr>>>6&63),Dr(128|63&Nr)):(Dr(224|Nr>>>12),Dr(128|Nr>>>6&63),Dr(128|63&Nr))}return tn$1(Ar,0,Rr)}(function(Tr){Tr.GZipJS="gzip-js",Tr.Base64="base64"})(Xt$1||(Xt$1={}));var wn$1=function(Tr,Cr,$r){var Ar=Cr||{};Ar.ip=$r.ip?1:0,Ar._=new Date().getTime().toString(),Ar.ver=m$8.LIB_VERSION;var Rr=Tr.split("?");if(Rr.length>1){var Dr,Mr=v$7(Rr[1].split("&"));try{for(Mr.s();!(Dr=Mr.n()).done;){var Br=Dr.value.split("=")[0];Ar[Br]&&delete Ar[Br]}}catch(Lr){Mr.e(Lr)}finally{Mr.f()}}var Nr=Tr.indexOf("?")>-1?"&":"?";return Tr+Nr+function(Lr){var Hr,zr,Ur=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",Vr=[];return C$4(Lr,function(jr,Gr){Hr=encodeURIComponent(jr.toString()),zr=encodeURIComponent(Gr),Vr[Vr.length]=zr+"="+Hr}),Vr.join(Ur)}(Ar)},kn$1=function Tr(Cr,$r){if($r.blob&&Cr.buffer)return new Blob([Cr.buffer],{type:"text/plain"});if($r.sendBeacon||$r.blob){var Ar=Tr(Cr,{method:"POST"});return new Blob([Ar],{type:"application/x-www-form-urlencoded"})}if($r.method!=="POST")return null;var Rr,Dr;return Rr=Array.isArray(Cr)||(Dr=Cr,Object.prototype.toString.call(Dr)==="[object Uint8Array]")?"data="+encodeURIComponent(Cr):"data="+encodeURIComponent(Cr.data),"compression"in Cr&&Cr.compression&&(Rr+="&compression="+Cr.compression),Rr},Sn$1=function(Tr){var Cr=Tr.url,$r=Tr.data,Ar=Tr.headers,Rr=Tr.options,Dr=Tr.callback,Mr=Tr.retriesPerformedSoFar,Br=Tr.retryQueue,Nr=Tr.onXHRError,Lr=Tr.timeout,Hr=Lr===void 0?6e4:Lr,zr=Tr.onResponse,Ur=new XMLHttpRequest;Ur.open(Rr.method||"GET",Cr,!0);var Vr=kn$1($r,Rr);C$4(Ar,function(jr,Gr){Ur.setRequestHeader(Gr,jr)}),Rr.method!=="POST"||Rr.blob||Ur.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),Ur.timeout=Hr,Ur.withCredentials=!0,Ur.onreadystatechange=function(){if(Ur.readyState===4)if(zr==null||zr(Ur),Ur.status===200){if(Dr){var jr;try{jr=JSON.parse(Ur.responseText)}catch(Gr){return void T$5.error(Gr)}Dr(jr)}}else typeof Nr=="function"&&Nr(Ur),(Ur.status<400||Ur.status>500)&&Br.enqueue({url:Cr,data:$r,options:Rr,headers:Ar,retriesPerformedSoFar:(Mr||0)+1,callback:Dr}),Dr==null||Dr({status:0})},Ur.send(Vr)},En$1=18e5,xn$1=function(Tr){a$8($r,Tt$2);var Cr=f$8($r);function $r(Ar,Rr){var Dr;return r$7(this,$r),(Dr=Cr.call(this)).isPolling=!1,Dr.queue=[],Dr.areWeOnline=!0,Dr.onXHRError=Ar,Dr.rateLimiter=Rr,typeof window<"u"&&"onLine"in window.navigator&&(Dr.areWeOnline=window.navigator.onLine,window.addEventListener("online",function(){Dr._handleWeAreNowOnline()}),window.addEventListener("offline",function(){Dr.areWeOnline=!1})),Dr}return o$6($r,[{key:"enqueue",value:function(Ar){var Rr=Ar.retriesPerformedSoFar||0;if(!(Rr>=10)){var Dr=function(Br){var Nr=3e3*Math.pow(2,Br),Lr=Nr/2,Hr=Math.min(En$1,Nr),zr=(Math.random()-.5)*(Hr-Lr);return Math.ceil(Hr+zr)}(Rr),Mr=new Date(Date.now()+Dr);this.queue.push({retryAt:Mr,requestData:Ar}),console.warn("Enqueued failed request for retry in ".concat(Dr)),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var Ar=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){Ar.areWeOnline&&Ar.queue.length>0&&Ar.flush(),Ar.poll()},this._pollInterval)}},{key:"flush",value:function(){var Ar=new Date(Date.now()),Rr=this.queue.filter(function(Nr){return Nr.retryAt0){this.queue=this.queue.filter(function(Nr){return Nr.retryAt>=Ar});var Dr,Mr=v$7(Rr);try{for(Mr.s();!(Dr=Mr.n()).done;){var Br=Dr.value.requestData;this._executeXhrRequest(Br)}}catch(Nr){Mr.e(Nr)}finally{Mr.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var Ar,Rr=v$7(this.queue);try{for(Rr.s();!(Ar=Rr.n()).done;){var Dr=Ar.value.requestData,Mr=Dr.url,Br=Dr.data,Nr=Dr.options;if(this.rateLimiter.isRateLimited(Nr._batchKey))m$8.DEBUG&&console.warn("[PostHog RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(Mr,kn$1(Br,t$6(t$6({},Nr),{},{sendBeacon:!0})))}catch(Lr){m$8.DEBUG&&console.error(Lr)}}}catch(Lr){Rr.e(Lr)}finally{Rr.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(Ar){var Rr=Ar.url,Dr=Ar.data,Mr=Ar.options,Br=Ar.headers,Nr=Ar.callback,Lr=Ar.retriesPerformedSoFar;this.rateLimiter.isRateLimited(Mr._batchKey)||Sn$1({url:Rr,data:Dr||{},options:Mr||{},headers:Br||{},retriesPerformedSoFar:Lr||0,callback:Nr,retryQueue:this,onXHRError:this.onXHRError,onResponse:this.rateLimiter.checkForLimiting})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),$r}();/** * uuidv7: An experimental implementation of the proposed UUID Version 7 * * @license Apache-2.0 * @copyright 2021-2023 LiosK * @packageDocumentation * * from https://github.com/LiosK/uuidv7/blob/e501462ea3d23241de13192ceae726956f9b3b7d/src/index.ts */Math.trunc||(Math.trunc=function(Tr){return Tr<0?Math.ceil(Tr):Math.floor(Tr)}),Number.isInteger||(Number.isInteger=function(Tr){return typeof Tr=="number"&&isFinite(Tr)&&Math.floor(Tr)===Tr});var Pn$1="0123456789abcdef",Fn$1=function(){function Tr(Cr){if(r$7(this,Tr),this.bytes=Cr,Cr.length!==16)throw new TypeError("not 128-bit length")}return o$6(Tr,[{key:"toString",value:function(){for(var Cr="",$r=0;$r>>4)+Pn$1.charAt(15&this.bytes[$r]),$r!==3&&$r!==5&&$r!==7&&$r!==9||(Cr+="-");if(Cr.length!==36)throw new Error("Invalid UUIDv7 was generated");return Cr}},{key:"clone",value:function(){return new Tr(this.bytes.slice(0))}},{key:"equals",value:function(Cr){return this.compareTo(Cr)===0}},{key:"compareTo",value:function(Cr){for(var $r=0;$r<16;$r++){var Ar=this.bytes[$r]-Cr.bytes[$r];if(Ar!==0)return Math.sign(Ar)}return 0}}],[{key:"fromFieldsV7",value:function(Cr,$r,Ar,Rr){if(!Number.isInteger(Cr)||!Number.isInteger($r)||!Number.isInteger(Ar)||!Number.isInteger(Rr)||Cr<0||$r<0||Ar<0||Rr<0||Cr>0xffffffffffff||$r>4095||Ar>1073741823||Rr>4294967295)throw new RangeError("invalid field value");var Dr=new Uint8Array(16);return Dr[0]=Cr/Math.pow(2,40),Dr[1]=Cr/Math.pow(2,32),Dr[2]=Cr/Math.pow(2,24),Dr[3]=Cr/Math.pow(2,16),Dr[4]=Cr/Math.pow(2,8),Dr[5]=Cr,Dr[6]=112|$r>>>8,Dr[7]=$r,Dr[8]=128|Ar>>>24,Dr[9]=Ar>>>16,Dr[10]=Ar>>>8,Dr[11]=Ar,Dr[12]=Rr>>>24,Dr[13]=Rr>>>16,Dr[14]=Rr>>>8,Dr[15]=Rr,new Tr(Dr)}}]),Tr}(),In$1=function(){function Tr(){r$7(this,Tr),s$5(this,"timestamp",0),s$5(this,"counter",0),s$5(this,"random",new Rn$1)}return o$6(Tr,[{key:"generate",value:function(){var Cr=this.generateOrAbort();if(Cr!==void 0)return Cr;this.timestamp=0;var $r=this.generateOrAbort();if($r===void 0)throw new Error("Could not generate UUID after timestamp reset");return $r}},{key:"generateOrAbort",value:function(){var Cr=Date.now();if(Cr>this.timestamp)this.timestamp=Cr,this.resetCounter();else{if(!(Cr+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Fn$1.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),Tr}(),On$1=function(Tr){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var Cr=0;Cr=this.buffer.length&&(On$1(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),Tr}(),Tn$1=function(){return Mn$1().toString()},Mn$1=function(){return($n$1||($n$1=new In$1)).generate()},An$1=1800,Cn$1=60,Dn$1=864e5,jn$1=function(){function Tr(Cr,$r){r$7(this,Tr),s$5(this,"_sessionIdChangedHandlers",[]),this.config=Cr,this.persistence=$r,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var Ar=Cr.persistence_name||Cr.token,Rr=Cr.session_idle_timeout_seconds||An$1;if(typeof Rr!="number"?(console.warn("[PostHog] session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),Rr=An$1):Rr>An$1?console.warn("[PostHog] session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):Rr0&&arguments[0]!==void 0&&arguments[0],$r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),Ar=h$4(this._getSessionId(),3),Rr=Ar[0],Dr=Ar[1],Mr=Ar[2],Br=this._getWindowId(),Nr=Mr&&Mr>0&&Math.abs($r-Mr)>Dn$1,Lr=!1;!Dr||!Cr&&Math.abs($r-Rr)>this._sessionTimeoutMs||Nr?(Dr=Tn$1(),Br=Tn$1(),Mr=$r,Lr=!0):Br||(Br=Tn$1(),Lr=!0);var Hr=Rr===0||!Cr||Nr?$r:Rr,zr=Mr===0?new Date().getTime():Mr;return this._setWindowId(Br),this._setSessionId(Dr,Hr,zr),Lr&&this._sessionIdChangedHandlers.forEach(function(Ur){return Ur(Dr,Br)}),{sessionId:Dr,windowId:Br,sessionStartTimestamp:zr}}}]),Tr}(),Nn$1=o$6(function Tr(Cr,$r,Ar,Rr){r$7(this,Tr),this.name="posthog-js",this.setupOnce=function(Dr){Dr(function(Mr){var Br,Nr,Lr,Hr,zr;if(Mr.level!=="error"||!Cr.__loaded)return Mr;Mr.tags||(Mr.tags={});var Ur=Cr.config.ui_host||Cr.config.api_host;Mr.tags["PostHog Person URL"]=Ur+"/person/"+Cr.get_distinct_id(),Cr.sessionRecordingStarted()&&(Mr.tags["PostHog Recording URL"]=Cr.get_session_replay_url({withTimestamp:!0}));var Vr=((Br=Mr.exception)===null||Br===void 0?void 0:Br.values)||[],jr={$exception_message:(Nr=Vr[0])===null||Nr===void 0?void 0:Nr.value,$exception_type:(Lr=Vr[0])===null||Lr===void 0?void 0:Lr.type,$exception_personURL:Ur+"/person/"+Cr.get_distinct_id(),$sentry_event_id:Mr.event_id,$sentry_exception:Mr.exception,$sentry_exception_message:(Hr=Vr[0])===null||Hr===void 0?void 0:Hr.value,$sentry_exception_type:(zr=Vr[0])===null||zr===void 0?void 0:zr.type,$sentry_tags:Mr.tags};return $r&&Ar&&(jr.$sentry_url=(Rr||"https://sentry.io/organizations/")+$r+"/issues/?project="+Ar+"&query="+Mr.event_id),Cr.capture("$exception",jr),Mr})}}),Hn$1=function(Tr){Promise&&Promise.resolve||console.warn("This browser does not have Promise support, and can not use the segment integration");var Cr=function($r,Ar){$r.event.userId||$r.event.anonymousId===Tr.get_distinct_id()||Tr.reset(),$r.event.userId&&$r.event.userId!==Tr.get_distinct_id()&&(Tr.register({distinct_id:$r.event.userId}),Tr.reloadFeatureFlags());var Rr=Tr._calculate_event_properties(Ar,$r.event.properties);return $r.event.properties=Object.assign({},Rr,$r.event.properties),$r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function($r){return Cr($r,$r.event.event)},page:function($r){return Cr($r,"$pageview")},identify:function($r){return Cr($r,"$identify")},screen:function($r){return Cr($r,"$screen")}}},Ln$1=function(){function Tr(){var Cr=this;r$7(this,Tr),s$5(this,"_hasSeenPageView",!1),s$5(this,"_updateScrollData",function(){var $r,Ar,Rr,Dr;Cr._pageViewData||(Cr._pageViewData=Cr._createPageViewData());var Mr=Cr._pageViewData,Br=Cr._scrollY(),Nr=Cr._scrollHeight(),Lr=Cr._contentY(),Hr=Cr._contentHeight();Mr.lastScrollY=Br,Mr.maxScrollY=Math.max(Br,($r=Mr.maxScrollY)!==null&&$r!==void 0?$r:0),Mr.maxScrollHeight=Math.max(Nr,(Ar=Mr.maxScrollHeight)!==null&&Ar!==void 0?Ar:0),Mr.lastContentY=Lr,Mr.maxContentY=Math.max(Lr,(Rr=Mr.maxContentY)!==null&&Rr!==void 0?Rr:0),Mr.maxContentHeight=Math.max(Hr,(Dr=Mr.maxContentHeight)!==null&&Dr!==void 0?Dr:0)})}return o$6(Tr,[{key:"_createPageViewData",value:function(){return{pathname:S$6.location.pathname}}},{key:"doPageView",value:function(){var Cr,$r;return this._hasSeenPageView?($r=this._pageViewData,this._pageViewData=this._createPageViewData()):(this._hasSeenPageView=!0,$r=void 0,this._pageViewData||(this._pageViewData=this._createPageViewData())),setTimeout(this._updateScrollData,0),t$6({$prev_pageview_pathname:(Cr=$r)===null||Cr===void 0?void 0:Cr.pathname},this._calculatePrevPageScrollProperties($r))}},{key:"doPageLeave",value:function(){var Cr=this._pageViewData;return t$6({$prev_pageview_pathname:Cr==null?void 0:Cr.pathname},this._calculatePrevPageScrollProperties(Cr))}},{key:"_calculatePrevPageScrollProperties",value:function(Cr){if(!Cr||Cr.maxScrollHeight==null||Cr.lastScrollY==null||Cr.maxScrollY==null||Cr.maxContentHeight==null||Cr.lastContentY==null||Cr.maxContentY==null)return{};var $r=Cr.maxScrollHeight,Ar=Cr.lastScrollY,Rr=Cr.maxScrollY,Dr=Cr.maxContentHeight,Mr=Cr.lastContentY,Br=Cr.maxContentY;return $r=Math.ceil($r),Ar=Math.ceil(Ar),Rr=Math.ceil(Rr),Dr=Math.ceil(Dr),Mr=Math.ceil(Mr),Br=Math.ceil(Br),{$prev_pageview_last_scroll:Ar,$prev_pageview_last_scroll_percentage:$r<=1?1:Bn$1(Ar/$r,0,1),$prev_pageview_max_scroll:Rr,$prev_pageview_max_scroll_percentage:$r<=1?1:Bn$1(Rr/$r,0,1),$prev_pageview_last_content:Mr,$prev_pageview_last_content_percentage:Dr<=1?1:Bn$1(Mr/Dr,0,1),$prev_pageview_max_content:Br,$prev_pageview_max_content_percentage:Dr<=1?1:Bn$1(Br/Dr,0,1)}}},{key:"startMeasuringScrollPosition",value:function(){S$6.addEventListener("scroll",this._updateScrollData),S$6.addEventListener("scrollend",this._updateScrollData),S$6.addEventListener("resize",this._updateScrollData)}},{key:"stopMeasuringScrollPosition",value:function(){S$6.removeEventListener("scroll",this._updateScrollData),S$6.removeEventListener("scrollend",this._updateScrollData),S$6.removeEventListener("resize",this._updateScrollData)}},{key:"_scrollHeight",value:function(){return Math.max(0,S$6.document.documentElement.scrollHeight-S$6.document.documentElement.clientHeight)}},{key:"_scrollY",value:function(){return S$6.scrollY||S$6.pageYOffset||S$6.document.documentElement.scrollTop||0}},{key:"_contentHeight",value:function(){return S$6.document.documentElement.scrollHeight||0}},{key:"_contentY",value:function(){var Cr=S$6.document.documentElement.clientHeight||0;return this._scrollY()+Cr}}]),Tr}();function Bn$1(Tr,Cr,$r){return Math.max(Cr,Math.min(Tr,$r))}function qn$1(Tr){return typeof Event<"u"&&Un$1(Tr,Event)}function Un$1(Tr,Cr){try{return Tr instanceof Cr}catch{return!1}}function Vn$1(Tr){return Tr===null||n$9(Tr)!=="object"&&typeof Tr!="function"}function Gn$1(Tr,Cr){return Object.prototype.toString.call(Tr)==="[object ".concat(Cr,"]")}function zn$1(Tr){return Gn$1(Tr,"DOMError")}var Wn$1=/\(error: (.*)\)/,Yn$1=50,Qn$1="?";function Jn$1(Tr,Cr,$r,Ar){var Rr={filename:Tr,function:Cr,in_app:!0};return $r!==void 0&&(Rr.lineno=$r),Ar!==void 0&&(Rr.colno=Ar),Rr}var Xn$1=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Kn$1=/\((\S*)(?::(\d+))(?::(\d+))\)/,Zn$1=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,er$1=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tr$2=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,nr$1=(function(){for(var Tr=arguments.length,Cr=new Array(Tr),$r=0;$r1&&arguments[1]!==void 0?arguments[1]:0,Mr=[],Br=Rr.split(` `),Nr=Dr;Nr1024)){var Hr=Wn$1.test(Lr)?Lr.replace(Wn$1,"$1"):Lr;if(!Hr.match(/\S*Error: /)){var zr,Ur=v$7(Ar);try{for(Ur.s();!(zr=Ur.n()).done;){var Vr=(0,zr.value)(Hr);if(Vr){Mr.push(Vr);break}}}catch(jr){Ur.e(jr)}finally{Ur.f()}if(Mr.length>=Yn$1)break}}}return function(jr){if(!jr.length)return[];var Gr=jr.slice(0,Yn$1);return Gr.reverse(),Gr.map(function(Xr){return t$6(t$6({},Xr),{},{filename:Xr.filename||Gr[Gr.length-1].filename,function:Xr.function||"?"})})}(Mr)}}).apply(void 0,[[30,function(Tr){var Cr=Xn$1.exec(Tr);if(Cr){if(Cr[2]&&Cr[2].indexOf("eval")===0){var $r=Kn$1.exec(Cr[2]);$r&&(Cr[2]=$r[1],Cr[3]=$r[2],Cr[4]=$r[3])}var Ar=h$4(rr$1(Cr[1]||Qn$1,Cr[2]),2),Rr=Ar[0];return Jn$1(Ar[1],Rr,Cr[3]?+Cr[3]:void 0,Cr[4]?+Cr[4]:void 0)}}],[50,function(Tr){var Cr=Zn$1.exec(Tr);if(Cr){if(Cr[3]&&Cr[3].indexOf(" > eval")>-1){var $r=er$1.exec(Cr[3]);$r&&(Cr[1]=Cr[1]||"eval",Cr[3]=$r[1],Cr[4]=$r[2],Cr[5]="")}var Ar=Cr[3],Rr=Cr[1]||Qn$1,Dr=h$4(rr$1(Rr,Ar),2);return Rr=Dr[0],Jn$1(Ar=Dr[1],Rr,Cr[4]?+Cr[4]:void 0,Cr[5]?+Cr[5]:void 0)}}],[40,function(Tr){var Cr=tr$2.exec(Tr);return Cr?Jn$1(Cr[2],Cr[1]||Qn$1,+Cr[3],Cr[4]?+Cr[4]:void 0):void 0}]]),rr$1=function(Tr,Cr){var $r=Tr.indexOf("safari-extension")!==-1,Ar=Tr.indexOf("safari-web-extension")!==-1;return $r||Ar?[Tr.indexOf("@")!==-1?Tr.split("@")[0]:Qn$1,$r?"safari-extension:".concat(Cr):"safari-web-extension:".concat(Cr)]:[Tr,Cr]},ir$1=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,or$1=/Minified React error #\d+;/i;function sr$1(Tr){var Cr=Tr.stacktrace||Tr.stack||"",$r=function(Ar){if(Ar){if(typeof Ar.framesToPop=="number")return Ar.framesToPop;if(or$1.test(Ar.message))return 1}return 0}(Tr);try{return nr$1(Cr,$r)}catch{}return[]}function ar(Tr){var Cr=sr$1(Tr);return{$exception_type:Tr.name,$exception_message:Tr.message,$exception_stack_trace_raw:JSON.stringify(Cr)}}function ur(Tr){var Cr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:40,$r=Object.keys(Tr);if($r.sort(),!$r.length)return"[object has no keys]";for(var Ar=$r.length;Ar>0;Ar--){var Rr=$r.slice(0,Ar).join(", ");if(!(Rr.length>Cr))return Ar===$r.length||Rr.length<=Cr?Rr:"".concat(Rr.slice(0,Cr),"...")}return""}function cr(Tr){var Cr=h$4(Tr,5),$r=Cr[0],Ar=Cr[1],Rr=Cr[2],Dr=Cr[3],Mr=Cr[4],Br={};if(Mr===void 0&&typeof $r=="string"){var Nr="Error",Lr=$r,Hr=$r.match(ir$1);Hr&&(Nr=Hr[1],Lr=Hr[2]),Br={$exception_type:Nr,$exception_message:Lr}}var zr=Mr||$r;if(zn$1(zr)||function(Gr){return Gn$1(Gr,"DOMException")}(zr)){var Ur=zr;if(function(Gr){return"stack"in Gr}(zr))Br=ar(zr);else{var Vr=Ur.name||(zn$1(Ur)?"DOMError":"DOMException"),jr=Ur.message?"".concat(Vr,": ").concat(Ur.message):Vr;Br=function(Gr){return{$exception_type:"Error",$exception_message:Gr}}(jr),Br.$exception_type=zn$1(Ur)?"DOMError":"DOMException",Br.$exception_message=Br.$exception_message||jr}"code"in Ur&&(Br.$exception_DOMException_code="".concat(Ur.code))}else(function(Gr){return Gn$1(Gr,"ErrorEvent")})(zr)&&zr.error?Br=ar(zr.error):function(Gr){switch(Object.prototype.toString.call(Gr)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Un$1(Gr,Error)}}(zr)?Br=ar(zr):function(Gr){return Gn$1(Gr,"Object")}(zr)||qn$1(zr)?(Br=function(Gr){return{$exception_type:qn$1(Gr)?Gr.constructor.name:"Error",$exception_message:"Non-Error ".concat("exception"," captured with keys: ",ur(Gr))}}(zr),Br.$exception_is_synthetic=!0):(Br.$exception_type=Br.$exception_type||"Error",Br.$exception_message=Br.$exception_message||zr,Br.$exception_is_synthetic=!0);return t$6(t$6(t$6(t$6({},Br),{},{$exception_type:Br.$exception_type||"UnknownErrorType",$exception_message:Br.$exception_message||""},Ar?{$exception_source:Ar}:{}),Rr?{$exception_lineno:Rr}:{}),Dr?{$exception_colno:Dr}:{})}var lr,dr,fr,hr$2=function(){function Tr(Cr){r$7(this,Tr),s$5(this,"originalOnErrorHandler",void 0),s$5(this,"originalOnUnhandledRejectionHandler",void 0),s$5(this,"errorsToIgnore",[]),this.instance=Cr}return o$6(Tr,[{key:"debugLog",value:function(){if(this.instance.config.debug){for(var Cr,$r=arguments.length,Ar=new Array($r),Rr=0;Rr<$r;Rr++)Ar[Rr]=arguments[Rr];(Cr=console).log.apply(Cr,["PostHog.js [PostHog.ExceptionObserver]"].concat(Ar))}}},{key:"startCapturing",value:function(){var Cr;if(this.isEnabled()&&((Cr=S$6.onerror)===null||Cr===void 0||!Cr.__POSTHOG_INSTRUMENTED__))try{this.originalOnErrorHandler=S$6.onerror,S$6.onerror=(function(){for(var $r=arguments.length,Ar=new Array($r),Rr=0;Rr<$r;Rr++)Ar[Rr]=arguments[Rr];return this.captureException(Ar),!!this.originalOnErrorHandler&&this.originalOnErrorHandler.apply(this,Ar)}).bind(this),S$6.onerror.__POSTHOG_INSTRUMENTED__=!0,this.originalOnUnhandledRejectionHandler=S$6.onunhandledrejection,S$6.onunhandledrejection=(function(){for(var $r=arguments.length,Ar=new Array($r),Rr=0;Rr<$r;Rr++)Ar[Rr]=arguments[Rr];var Dr=function(Mr){var Br=h$4(Mr,1)[0],Nr=Br;try{"reason"in Br?Nr=Br.reason:"detail"in Br&&"reason"in Br.detail&&(Nr=Br.detail.reason)}catch{}var Lr={};return(Lr=Vn$1(Nr)?{$exception_message:"Non-Error promise rejection captured with value: ".concat(String(Nr))}:cr([Nr])).$exception_handled=!1,t$6(t$6({},Lr),{},{$exception_type:Lr.$exception_type="UnhandledRejection",$exception_message:Lr.$exception_message=Lr.$exception_message||Br.reason||String(Nr)})}(Ar);return this.sendExceptionEvent(Dr),!this.originalOnUnhandledRejectionHandler||this.originalOnUnhandledRejectionHandler.apply(S$6,Ar)}).bind(this),S$6.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0}catch($r){console.error("PostHog failed to start exception autocapture",$r),this.stopCapturing()}}},{key:"stopCapturing",value:function(){var Cr,$r;this.originalOnErrorHandler!==void 0&&(S$6.onerror=this.originalOnErrorHandler,this.originalOnErrorHandler=null),(Cr=S$6.onerror)===null||Cr===void 0||delete Cr.__POSTHOG_INSTRUMENTED__,this.originalOnUnhandledRejectionHandler!==void 0&&(S$6.onunhandledrejection=this.originalOnUnhandledRejectionHandler,this.originalOnUnhandledRejectionHandler=null),($r=S$6.onunhandledrejection)===null||$r===void 0||delete $r.__POSTHOG_INSTRUMENTED__}},{key:"isCapturing",value:function(){var Cr;return!((Cr=S$6.onerror)===null||Cr===void 0||!Cr.__POSTHOG_INSTRUMENTED__)}},{key:"isEnabled",value:function(){var Cr;return(Cr=this.remoteEnabled)!==null&&Cr!==void 0&&Cr}},{key:"afterDecideResponse",value:function(Cr){var $r=Cr.autocaptureExceptions;if(this.remoteEnabled=!!$r||!1,!Vn$1($r)&&"errors_to_ignore"in $r&&Array.isArray($r.errors_to_ignore)){var Ar=$r.errors_to_ignore;this.errorsToIgnore=Ar.map(function(Rr){return new RegExp(Rr)})}this.isEnabled()?(this.startCapturing(),this.debugLog("Remote config for exception autocapture is enabled, starting",$r)):this.debugLog("Remote config for exception autocapture is disabled, not starting",$r)}},{key:"captureException",value:function(Cr,$r){var Ar=cr(Cr);if(this.errorsToIgnore.some(function(Mr){return Mr.test(Ar.$exception_message||"")}))this.debugLog("Ignoring exception based on remote config",Ar);else{var Rr=t$6(t$6({},$r),Ar),Dr=this.instance.config.ui_host||this.instance.config.api_host;Ar.$exception_personURL=Dr+"/person/"+this.instance.get_distinct_id(),this.sendExceptionEvent(Rr)}}},{key:"sendExceptionEvent",value:function(Cr){this.instance.capture("$exception",Cr,{transport:"XHR",method:"POST",endpoint:"/e/",_noTruncate:!0,_batchKey:"exceptionEvent"})}}]),Tr}(),pr$1=function(){function Tr(Cr){r$7(this,Tr),this.instance=Cr}return o$6(Tr,[{key:"getSurveys",value:function(Cr){var $r=this,Ar=arguments.length>1&&arguments[1]!==void 0&&arguments[1],Rr=this.instance.get_property(Oe$1);if(Rr&&!Ar)return Cr(Rr);this.instance._send_request("".concat(this.instance.config.api_host,"/api/surveys/?token=").concat(this.instance.config.token),{},{method:"GET"},function(Dr){var Mr,Br=Dr.surveys;return(Mr=$r.instance.persistence)===null||Mr===void 0||Mr.register(s$5({},Oe$1,Br)),Cr(Br)})}},{key:"getActiveMatchingSurveys",value:function(Cr){var $r=this,Ar=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(Rr){var Dr=Rr.filter(function(Mr){return!(!Mr.start_date||Mr.end_date)}).filter(function(Mr){var Br,Nr;if(!Mr.conditions)return!0;var Lr=(Br=Mr.conditions)===null||Br===void 0||!Br.url||window.location.href.indexOf(Mr.conditions.url)>-1,Hr=(Nr=Mr.conditions)===null||Nr===void 0||!Nr.selector||document.querySelector(Mr.conditions.selector);return Lr&&Hr}).filter(function(Mr){if(!Mr.linked_flag_key&&!Mr.targeting_flag_key)return!0;var Br=!Mr.linked_flag_key||$r.instance.featureFlags.isFeatureEnabled(Mr.linked_flag_key),Nr=!Mr.targeting_flag_key||$r.instance.featureFlags.isFeatureEnabled(Mr.targeting_flag_key);return Br&&Nr});return Cr(Dr)},Ar)}}]),Tr}(),gr=6e4,_r=function(){function Tr(){var Cr=this;r$7(this,Tr),s$5(this,"limits",{}),s$5(this,"checkForLimiting",function($r){try{(JSON.parse($r.responseText).quota_limited||[]).forEach(function(Ar){T$5.log("[PostHog RateLimiter] ".concat(Ar||"events"," is quota limited.")),Cr.limits[Ar]=new Date().getTime()+gr})}catch(Ar){return void T$5.error(Ar)}})}return o$6(Tr,[{key:"isRateLimited",value:function(Cr){var $r=this.limits[Cr||"events"]||!1;return $r!==!1&&new Date().getTime()<$r}}]),Tr}();(function(Tr){Tr[Tr.INIT_MODULE=0]="INIT_MODULE",Tr[Tr.INIT_SNIPPET=1]="INIT_SNIPPET"})(lr||(lr={}));var vr=function(){},mr={},yr="posthog",br=S$6.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,wr$1=!br&&P$7.indexOf("MSIE")===-1&&P$7.indexOf("Mozilla")===-1,kr=function(){var Tr,Cr,$r;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(x$5==null||(Tr=x$5.location)===null||Tr===void 0||(Cr=Tr.hostname)===null||Cr===void 0?void 0:Cr.indexOf("herokuapp.com"))===-1,persistence:"cookie",persistence_name:"",cookie_name:"",loaded:vr,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:!0,debug:!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:(S$6==null||($r=S$6.location)===null||$r===void 0?void 0:$r.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(Ar){var Rr="Bad HTTP status: "+Ar.status+" "+Ar.statusText;console.error(Rr)},get_device_id:function(Ar){return Ar},_onCapture:vr,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800}},Sr=function(Tr,Cr,$r,Ar){var Rr,Dr=$r!==yr&&fr?$r?fr[$r]:void 0:fr,Mr={initComplete:!1,syncCode:!1},Br=function(Nr){return function(Lr){Mr[Nr]||(Mr[Nr]=!0,Mr.initComplete&&Mr.syncCode&&(Ar==null||Ar(Lr)))}};if(Dr&&dr===lr.INIT_MODULE)Rr=Dr;else{if(Dr&&!j$3(Dr))return void console.error("You have already initialized "+$r);Rr=new Er}return Rr._init(Tr,Cr,$r,Br("initComplete")),Rr.toolbar.maybeLoadToolbar(),Rr.sessionRecording=new ft$2(Rr),Rr.sessionRecording.startRecordingIfEnabled(),Rr.webPerformance=new _t$2(Rr),Rr.webPerformance.startObservingIfEnabled(),Rr.config.__preview_measure_pageview_stats&&Rr.pageViewManager.startMeasuringScrollPosition(),Rr.exceptionAutocapture=new hr$2(Rr),Rr.__autocapture=Rr.config.autocapture,Ce$2._setIsAutocaptureEnabled(Rr),Ce$2._isAutocaptureEnabled&&(Rr.__autocapture=Rr.config.autocapture,Ce$2.enabledForProject(Rr.config.token,100,100)?Ce$2.isBrowserSupported()?Ce$2.init(Rr):(Rr.__autocapture=!1,T$5.log("Disabling Automatic Event Collection because this browser is not supported")):(Rr.__autocapture=!1,T$5.log("Not in active bucket: disabling Automatic Event Collection."))),m$8.DEBUG=m$8.DEBUG||Rr.config.debug,Dr!==void 0&&j$3(Dr)&&(Rr._execute_array.call(Rr.people,Dr.people),Rr._execute_array(Dr)),Br("syncCode")(Rr),Rr},Er=function(){function Tr(){var Cr=this;r$7(this,Tr),this.config=kr(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=Nn$1,this.segmentIntegration=function(){return Hn$1(Cr)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.featureFlags=new Le$1(this),this.toolbar=new wt$2(this),this.pageViewManager=new Ln$1,this.surveys=new pr$1(this),this.rateLimiter=new _r,this.people={set:function($r,Ar,Rr){var Dr=typeof $r=="string"?s$5({},$r,Ar):$r;Cr.setPersonProperties(Dr),Rr==null||Rr({})},set_once:function($r,Ar,Rr){var Dr=typeof $r=="string"?s$5({},$r,Ar):$r;Cr.setPersonProperties(void 0,Dr),Rr==null||Rr({})}}}return o$6(Tr,[{key:"init",value:function(Cr,$r,Ar){if(B$3(Ar))console.error("You must name your new library: init(token, config, name)");else{if(Ar!==yr){var Rr=Sr(Cr,$r,Ar,function(Dr){fr[Ar]=Dr,Dr._loaded()});return fr[Ar]=Rr,Rr}console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(Cr){var $r,Ar,Rr=this,Dr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Mr=arguments.length>2?arguments[2]:void 0,Br=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var Nr,Lr={segmentRegister:!1,syncCode:!1},Hr=function(Wr){return function(){Lr[Wr]||(Lr[Wr]=!0,Lr.segmentRegister&&Lr.syncCode&&(Br==null||Br(Rr)))}};if(this.set_config(D$3({},kr(),Dr,{name:Mr,token:Cr,callback_fn:(Mr===yr?Mr:yr+"."+Mr)+"._jsc"})),this._jsc=function(){},(S$6!=null&&($r=S$6.rrweb)!==null&&$r!==void 0&&$r.record||S$6!=null&&S$6.rrwebRecord)&&(this.__loaded_recorder_version=S$6==null||(Nr=S$6.rrweb)===null||Nr===void 0?void 0:Nr.version),this.persistence=new Ke$1(this.config),this._requestQueue=new Mt$1(this._handle_queued_event.bind(this)),this._retryQueue=new xn$1(this.config.on_xhr_error,this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new jn$1(this.config,this.persistence),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new Ke$1(t$6(t$6({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),Dr.segment?(this.config.get_device_id=function(){return Dr.segment.user().anonymousId()},Dr.segment.user().id()&&(this.register({distinct_id:Dr.segment.user().id()}),this.persistence.set_user_state("identified")),Dr.segment.register(this.segmentIntegration()).then(Hr("segmentRegister"))):Hr("segmentRegister")(),((Ar=Dr.bootstrap)===null||Ar===void 0?void 0:Ar.distinctID)!==void 0){var zr,Ur,Vr=this.config.get_device_id(Tn$1()),jr=(zr=Dr.bootstrap)!==null&&zr!==void 0&&zr.isIdentifiedID?Vr:Dr.bootstrap.distinctID;this.persistence.set_user_state((Ur=Dr.bootstrap)!==null&&Ur!==void 0&&Ur.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:Dr.bootstrap.distinctID,$device_id:jr})}if(this._hasBootstrappedFeatureFlags()){var Gr,Xr,Kr=Object.keys(((Gr=Dr.bootstrap)===null||Gr===void 0?void 0:Gr.featureFlags)||{}).filter(function(Wr){var Yr,Jr;return!((Yr=Dr.bootstrap)===null||Yr===void 0||(Jr=Yr.featureFlags)===null||Jr===void 0||!Jr[Wr])}).reduce(function(Wr,Yr){var Jr,no;return Wr[Yr]=((Jr=Dr.bootstrap)===null||Jr===void 0||(no=Jr.featureFlags)===null||no===void 0?void 0:no[Yr])||!1,Wr},{}),Zr=Object.keys(((Xr=Dr.bootstrap)===null||Xr===void 0?void 0:Xr.featureFlagPayloads)||{}).filter(function(Wr){return Kr[Wr]}).reduce(function(Wr,Yr){var Jr,no,ro,so;return(Jr=Dr.bootstrap)!==null&&Jr!==void 0&&(no=Jr.featureFlagPayloads)!==null&&no!==void 0&&no[Yr]&&(Wr[Yr]=(ro=Dr.bootstrap)===null||ro===void 0||(so=ro.featureFlagPayloads)===null||so===void 0?void 0:so[Yr]),Wr},{});this.featureFlags.receivedFeatureFlags({featureFlags:Kr,featureFlagPayloads:Zr})}if(!this.get_distinct_id()){var eo=this.config.get_device_id(Tn$1());this.register_once({distinct_id:eo,$device_id:eo},""),this.persistence.set_user_state("anonymous")}S$6.addEventListener&&S$6.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),Hr("syncCode")()}},{key:"_loaded",value:function(){var Cr=this.config.advanced_disable_decide;Cr||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch($r){console.error("`loaded` function failed",$r)}this._start_queue_if_opted_in(),this.config.capture_pageview&&this.capture("$pageview",{title:x$5.title},{send_instantly:!0}),Cr||(new mt$2(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var Cr;this.has_opted_out_capturing()||this.config.request_batching&&((Cr=this._requestQueue)===null||Cr===void 0||Cr.poll())}},{key:"_dom_loaded",value:function(){var Cr=this;this.has_opted_out_capturing()||A$4(this.__request_queue,function($r){Cr._send_request.apply(Cr,p$8($r))}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(Cr,$r){if(B$3(Cr))return null;if(br)return function(Mr){Cr(Mr,$r)};var Ar=this._jsc,Rr=""+Math.floor(1e8*Math.random()),Dr=this.config.callback_fn+"["+Rr+"]";return Ar[Rr]=function(Mr){delete Ar[Rr],Cr(Mr,$r)},Dr}},{key:"_handle_unload",value:function(){var Cr,$r;this.config.request_batching?(this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave"),(Cr=this._requestQueue)===null||Cr===void 0||Cr.unload(),($r=this._retryQueue)===null||$r===void 0||$r.unload()):this.config.capture_pageview&&this.config.capture_pageleave&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(Cr,$r,Ar){var Rr=JSON.stringify($r);this.__compress_and_send_json_request(Cr,Rr,Ar||mr,vr)}},{key:"__compress_and_send_json_request",value:function(Cr,$r,Ar,Rr){var Dr=function(Lr,Hr,zr){return Lr===Xt$1.GZipJS?[yn$1(bn$1(Hr),{mtime:0}),t$6(t$6({},zr),{},{blob:!0,urlQueryArgs:{compression:Xt$1.GZipJS}})]:[{data:Q$3(Hr)},zr]}(this.compression[Xt$1.GZipJS]?Xt$1.GZipJS:Xt$1.Base64,$r,Ar),Mr=h$4(Dr,2),Br=Mr[0],Nr=Mr[1];this._send_request(Cr,Br,Nr,Rr)}},{key:"_send_request",value:function(Cr,$r,Ar,Rr){if(this.__loaded&&this._retryQueue&&!this.rateLimiter.isRateLimited(Ar._batchKey))if(wr$1)this.__request_queue.push([Cr,$r,Ar,Rr]);else{var Dr={method:this.config.api_method,transport:this.config.api_transport,verbose:this.config.verbose};Ar=D$3(Dr,Ar||{}),br||(Ar.method="GET");var Mr="sendBeacon"in S$6.navigator&&Ar.transport==="sendBeacon";if(Cr=wn$1(Cr,Ar.urlQueryArgs||{},{ip:this.config.ip}),Mr)try{S$6.navigator.sendBeacon(Cr,kn$1($r,t$6(t$6({},Ar),{},{sendBeacon:!0})))}catch{}else if(br)try{Sn$1({url:Cr,data:$r,headers:this.config.xhr_headers,options:Ar,callback:Rr,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.config.on_xhr_error,onResponse:this.rateLimiter.checkForLimiting})}catch(Hr){console.error(Hr)}else{var Br,Nr=x$5.createElement("script");Nr.type="text/javascript",Nr.async=!0,Nr.defer=!0,Nr.src=Cr;var Lr=x$5.getElementsByTagName("script")[0];(Br=Lr.parentNode)===null||Br===void 0||Br.insertBefore(Nr,Lr)}}}},{key:"_execute_array",value:function(Cr){var $r,Ar=this,Rr=[],Dr=[],Mr=[];A$4(Cr,function(Nr){Nr&&($r=Nr[0],j$3($r)?Mr.push(Nr):typeof Nr=="function"?Nr.call(Ar):j$3(Nr)&&$r==="alias"?Rr.push(Nr):j$3(Nr)&&$r.indexOf("capture")!==-1&&typeof Ar[$r]=="function"?Mr.push(Nr):Dr.push(Nr))});var Br=function(Nr,Lr){A$4(Nr,function(Hr){if(j$3(Hr[0])){var zr=Lr;C$4(Hr,function(Ur){zr=zr[Ur[0]].apply(zr,Ur.slice(1))})}else this[Hr[0]].apply(this,Hr.slice(1))},Lr)};Br(Rr,this),Br(Dr,this),Br(Mr,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var Cr,$r;return((Cr=this.config.bootstrap)===null||Cr===void 0?void 0:Cr.featureFlags)&&Object.keys(($r=this.config.bootstrap)===null||$r===void 0?void 0:$r.featureFlags).length>0||!1}},{key:"push",value:function(Cr){this._execute_array([Cr])}},{key:"captureException",value:function(Cr,$r){var Ar;(Ar=this.exceptionAutocapture)===null||Ar===void 0||Ar.captureException([Cr.name,void 0,void 0,void 0,Cr],$r)}},{key:"capture",value:function(Cr,$r){var Ar=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mr;if(!this.__loaded||!this.sessionPersistence||!this._requestQueue)return T$5.unintializedWarning("posthog.capture");if(!function(Lr,Hr){var zr=!1;try{var Ur=Lr.config.token,Vr=Lr.config.respect_dnt,jr=Lr.config.opt_out_capturing_persistence_type,Gr=Lr.config.opt_out_capturing_cookie_prefix||void 0,Xr=Lr.config.window;Ur&&(zr=Pt$2(Ur,{respectDnt:Vr,persistenceType:jr,persistencePrefix:Gr,window:Xr}))}catch(Kr){Hr||console.error("Unexpected error when checking capturing opt-out status: "+Kr)}return zr}(this,!1)){var Rr=(Ar=Ar||mr).transport;if(Rr&&(Ar.transport=Rr),B$3(Cr)||typeof Cr!="string")console.error("No event name provided to posthog.capture");else if(!K$3(P$7,this.config.custom_blocked_useragents)){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info();var Dr={uuid:Tn$1(),event:Cr,properties:this._calculate_event_properties(Cr,$r||{})};Cr==="$identify"&&(Dr.$set=Ar.$set,Dr.$set_once=Ar.$set_once),(Dr=Y$2(Dr,Ar._noTruncate?null:this.config.properties_string_max_length)).timestamp=Ar.timestamp||new Date,this.config.debug&&T$5.log("PostHog.js send",Dr);var Mr=JSON.stringify(Dr),Br=this.config.api_host+(Ar.endpoint||"/e/"),Nr=Ar!==mr;return!this.config.request_batching||Nr&&!Ar._batchKey||Ar.send_instantly?this.__compress_and_send_json_request(Br,Mr,Ar):this._requestQueue.enqueue(Br,Dr,Ar),this._invokeCaptureHooks(Cr,Dr),Dr}}}},{key:"_addCaptureHook",value:function(Cr){this.__captureHooks.push(Cr)}},{key:"_invokeCaptureHooks",value:function(Cr,$r){this.config._onCapture(Cr,$r),C$4(this.__captureHooks,function(Ar){return Ar(Cr)})}},{key:"_calculate_event_properties",value:function(Cr,$r){if(!this.persistence||!this.sessionPersistence)return $r;var Ar=this.persistence.remove_event_timer(Cr),Rr=t$6({},$r);if(Rr.token=this.config.token,Cr==="$snapshot"){var Dr=t$6(t$6({},this.persistence.properties()),this.sessionPersistence.properties());return Rr.distinct_id=Dr.distinct_id,Rr}var Mr=re$3.properties();if(this.sessionManager){var Br=this.sessionManager.checkAndGetSessionAndWindowId(),Nr=Br.sessionId,Lr=Br.windowId;Rr.$session_id=Nr,Rr.$window_id=Lr}if(this.config.__preview_measure_pageview_stats){var Hr={};Cr==="$pageview"?Hr=this.pageViewManager.doPageView():Cr==="$pageleave"&&(Hr=this.pageViewManager.doPageLeave()),Rr=D$3(Rr,Hr)}if(Cr==="$pageview"&&(Rr.title=x$5.title),Cr==="$performance_event"){var zr=this.persistence.properties();return Rr.distinct_id=zr.distinct_id,Rr.$current_url=Mr.$current_url,Rr}if(Ar!==void 0){var Ur=new Date().getTime()-Ar;Rr.$duration=parseFloat((Ur/1e3).toFixed(3))}Rr=D$3({},re$3.properties(),this.persistence.properties(),this.sessionPersistence.properties(),Rr);var Vr=this.config.property_blacklist;j$3(Vr)?C$4(Vr,function(Gr){delete Rr[Gr]}):console.error("Invalid value for property_blacklist config: "+Vr);var jr=this.config.sanitize_properties;return jr&&(Rr=jr(Rr,Cr)),Rr}},{key:"register",value:function(Cr,$r){var Ar;(Ar=this.persistence)===null||Ar===void 0||Ar.register(Cr,$r)}},{key:"register_once",value:function(Cr,$r,Ar){var Rr;(Rr=this.persistence)===null||Rr===void 0||Rr.register_once(Cr,$r,Ar)}},{key:"register_for_session",value:function(Cr){var $r;($r=this.sessionPersistence)===null||$r===void 0||$r.register(Cr)}},{key:"unregister",value:function(Cr){var $r;($r=this.persistence)===null||$r===void 0||$r.unregister(Cr)}},{key:"unregister_for_session",value:function(Cr){var $r;($r=this.sessionPersistence)===null||$r===void 0||$r.unregister(Cr)}},{key:"_register_single",value:function(Cr,$r){this.register(s$5({},Cr,$r))}},{key:"getFeatureFlag",value:function(Cr,$r){return this.featureFlags.getFeatureFlag(Cr,$r)}},{key:"getFeatureFlagPayload",value:function(Cr){var $r=this.featureFlags.getFeatureFlagPayload(Cr);try{return JSON.parse($r)}catch{return $r}}},{key:"isFeatureEnabled",value:function(Cr,$r){return this.featureFlags.isFeatureEnabled(Cr,$r)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(Cr,$r){this.featureFlags.updateEarlyAccessFeatureEnrollment(Cr,$r)}},{key:"getEarlyAccessFeatures",value:function(Cr){var $r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(Cr,$r)}},{key:"onFeatureFlags",value:function(Cr){return this.featureFlags.onFeatureFlags(Cr)}},{key:"onSessionId",value:function(Cr){var $r,Ar;return($r=(Ar=this.sessionManager)===null||Ar===void 0?void 0:Ar.onSessionId(Cr))!==null&&$r!==void 0?$r:function(){}}},{key:"getSurveys",value:function(Cr){var $r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(Cr,$r)}},{key:"getActiveMatchingSurveys",value:function(Cr){var $r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(Cr,$r)}},{key:"identify",value:function(Cr,$r,Ar){if(!this.__loaded||!this.persistence)return T$5.unintializedWarning("posthog.identify");if(Cr){var Rr=this.get_distinct_id();if(this.register({$user_id:Cr}),!this.get_property("$device_id")){var Dr=Rr;this.register_once({$had_persisted_distinct_id:!0,$device_id:Dr},"")}Cr!==Rr&&Cr!==this.get_property(me$3)&&(this.unregister(me$3),this.register({distinct_id:Cr}));var Mr=this.persistence.get_user_state()==="anonymous";Cr!==Rr&&Mr?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags($r||{},!1),this.capture("$identify",{distinct_id:Cr,$anon_distinct_id:Rr},{$set:$r||{},$set_once:Ar||{}}),this.featureFlags.setAnonymousDistinctId(Rr)):($r||Ar)&&this.setPersonProperties($r,Ar),Cr!==Rr&&(this.reloadFeatureFlags(),this.unregister($e$2))}else console.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(Cr,$r){(Cr||$r)&&(this.setPersonPropertiesForFlags(Cr||{}),this.capture("$set",{$set:Cr||{},$set_once:$r||{}}))}},{key:"group",value:function(Cr,$r,Ar){if(Cr&&$r){var Rr=this.getGroups();Rr[Cr]!==$r&&this.resetGroupPropertiesForFlags(Cr),this.register({$groups:t$6(t$6({},Rr),{},s$5({},Cr,$r))}),Ar&&(this.capture("$groupidentify",{$group_type:Cr,$group_key:$r,$group_set:Ar}),this.setGroupPropertiesForFlags(s$5({},Cr,Ar))),Rr[Cr]===$r||Ar||this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(Cr){var $r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(Cr,$r)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(Cr){var $r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setGroupPropertiesForFlags(Cr,$r)}},{key:"resetGroupPropertiesForFlags",value:function(Cr){this.featureFlags.resetGroupPropertiesForFlags(Cr)}},{key:"reset",value:function(Cr){var $r,Ar,Rr,Dr;if(!this.__loaded)return T$5.unintializedWarning("posthog.reset");var Mr=this.get_property("$device_id");($r=this.persistence)===null||$r===void 0||$r.clear(),(Ar=this.sessionPersistence)===null||Ar===void 0||Ar.clear(),(Rr=this.persistence)===null||Rr===void 0||Rr.set_user_state("anonymous"),(Dr=this.sessionManager)===null||Dr===void 0||Dr.resetSessionId();var Br=this.config.get_device_id(Tn$1());this.register_once({distinct_id:Br,$device_id:Cr?Br:Mr},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var Cr,$r;return(Cr=($r=this.sessionManager)===null||$r===void 0?void 0:$r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&Cr!==void 0?Cr:""}},{key:"get_session_replay_url",value:function(Cr){if(!this.sessionManager)return"";var $r=this.config.ui_host||this.config.api_host,Ar=this.sessionManager.checkAndGetSessionAndWindowId(!0),Rr=Ar.sessionId,Dr=Ar.sessionStartTimestamp,Mr=$r+"/replay/"+Rr;if(Cr!=null&&Cr.withTimestamp&&Dr){var Br,Nr=(Br=Cr.timestampLookBack)!==null&&Br!==void 0?Br:10;if(!Dr)return Mr;var Lr=Math.max(Math.floor((new Date().getTime()-Dr)/1e3)-Nr,0);Mr+="?t=".concat(Lr)}return Mr}},{key:"alias",value:function(Cr,$r){return Cr===this.get_property(ve$3)?(T$5.critical("Attempting to create alias for existing People user - aborting."),-2):(B$3($r)&&($r=this.get_distinct_id()),Cr!==$r?(this._register_single(me$3,Cr),this.capture("$create_alias",{alias:Cr,distinct_id:$r})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(Cr),-1))}},{key:"set_config",value:function(Cr){var $r,Ar,Rr=t$6({},this.config);L$6(Cr)&&(D$3(this.config,Cr),this.config.persistence_name||(this.config.persistence_name=this.config.cookie_name),this.config.disable_persistence||(this.config.disable_persistence=this.config.disable_cookie),($r=this.persistence)===null||$r===void 0||$r.update_config(this.config),(Ar=this.sessionPersistence)===null||Ar===void 0||Ar.update_config(this.config),Ve$1.is_supported()&&Ve$1.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(m$8.DEBUG=!0),this.sessionRecording&&Cr.disable_session_recording!==void 0&&Rr.disable_session_recording!==Cr.disable_session_recording&&(Cr.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var Cr;return!((Cr=this.sessionRecording)===null||Cr===void 0||!Cr.started())}},{key:"loadToolbar",value:function(Cr){return this.toolbar.loadToolbar(Cr)}},{key:"get_property",value:function(Cr){var $r;return($r=this.persistence)===null||$r===void 0?void 0:$r.props[Cr]}},{key:"getSessionProperty",value:function(Cr){var $r;return($r=this.sessionPersistence)===null||$r===void 0?void 0:$r.props[Cr]}},{key:"toString",value:function(){var Cr,$r=(Cr=this.config.name)!==null&&Cr!==void 0?Cr:yr;return $r!==yr&&($r=yr+"."+$r),$r}},{key:"_gdpr_init",value:function(){this.config.opt_out_capturing_persistence_type==="localStorage"&&Ve$1.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.config.opt_out_capturing_by_default&&!qe$1.get("ph_optout")||(qe$1.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.config.opt_out_persistence_by_default}))}},{key:"_gdpr_update_persistence",value:function(Cr){var $r,Ar,Rr,Dr,Mr;if(Cr&&Cr.clear_persistence)Rr=!0;else{if(!Cr||!Cr.enable_persistence)return;Rr=!1}this.config.disable_persistence||(($r=this.persistence)===null||$r===void 0?void 0:$r.disabled)===Rr||(Dr=this.persistence)===null||Dr===void 0||Dr.set_disabled(Rr),this.config.disable_persistence||((Ar=this.sessionPersistence)===null||Ar===void 0?void 0:Ar.disabled)===Rr||(Mr=this.sessionPersistence)===null||Mr===void 0||Mr.set_disabled(Rr)}},{key:"_gdpr_call_func",value:function(Cr,$r){return $r=D$3({capture:this.capture.bind(this),persistence_type:this.config.opt_out_capturing_persistence_type,cookie_prefix:this.config.opt_out_capturing_cookie_prefix,cookie_expiration:this.config.cookie_expiration,cross_subdomain_cookie:this.config.cross_subdomain_cookie,secure_cookie:this.config.secure_cookie},$r||{}),Ve$1.is_supported()||$r.persistence_type!=="localStorage"||($r.persistence_type="cookie"),Cr(this.config.token,{capture:$r.capture,captureEventName:$r.capture_event_name,captureProperties:$r.capture_properties,persistenceType:$r.persistence_type,persistencePrefix:$r.cookie_prefix,cookieExpiration:$r.cookie_expiration,crossSubdomainCookie:$r.cross_subdomain_cookie,secureCookie:$r.secure_cookie})}},{key:"opt_in_capturing",value:function(Cr){Cr=D$3({enable_persistence:!0},Cr||{}),this._gdpr_call_func(St$2,Cr),this._gdpr_update_persistence(Cr)}},{key:"opt_out_capturing",value:function(Cr){var $r=D$3({clear_persistence:!0},Cr||{});this._gdpr_call_func(Et$1,$r),this._gdpr_update_persistence($r)}},{key:"has_opted_in_capturing",value:function(Cr){return this._gdpr_call_func(xt$2,Cr)}},{key:"has_opted_out_capturing",value:function(Cr){return this._gdpr_call_func(Pt$2,Cr)}},{key:"clear_opt_in_out_capturing",value:function(Cr){var $r=D$3({enable_persistence:!0},Cr??{});this._gdpr_call_func(Ft$1,$r),this._gdpr_update_persistence($r)}},{key:"debug",value:function(Cr){Cr===!1?(S$6.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(S$6.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),Tr}();(function(Tr,Cr){for(var $r=0;$r{let Cr;return Tr?Cr=Tr:typeof fetch>"u"?Cr=(...$r)=>__vitePreload(()=>Promise.resolve().then(()=>browser$2),void 0,import.meta.url).then(({default:Ar})=>Ar(...$r)):Cr=fetch,(...$r)=>Cr(...$r)};class FunctionsError extends Error{constructor(Cr,$r="FunctionsError",Ar){super(Cr),this.name=$r,this.context=Ar}}class FunctionsFetchError extends FunctionsError{constructor(Cr){super("Failed to send a request to the Edge Function","FunctionsFetchError",Cr)}}class FunctionsRelayError extends FunctionsError{constructor(Cr){super("Relay Error invoking the Edge Function","FunctionsRelayError",Cr)}}class FunctionsHttpError extends FunctionsError{constructor(Cr){super("Edge Function returned a non-2xx status code","FunctionsHttpError",Cr)}}var __awaiter$9=globalThis&&globalThis.__awaiter||function(Tr,Cr,$r,Ar){function Rr(Dr){return Dr instanceof $r?Dr:new $r(function(Mr){Mr(Dr)})}return new($r||($r=Promise))(function(Dr,Mr){function Br(Hr){try{Lr(Ar.next(Hr))}catch(zr){Mr(zr)}}function Nr(Hr){try{Lr(Ar.throw(Hr))}catch(zr){Mr(zr)}}function Lr(Hr){Hr.done?Dr(Hr.value):Rr(Hr.value).then(Br,Nr)}Lr((Ar=Ar.apply(Tr,Cr||[])).next())})};class FunctionsClient{constructor(Cr,{headers:$r={},customFetch:Ar}={}){this.url=Cr,this.headers=$r,this.fetch=resolveFetch$3(Ar)}setAuth(Cr){this.headers.Authorization=`Bearer ${Cr}`}invoke(Cr,$r={}){var Ar;return __awaiter$9(this,void 0,void 0,function*(){try{const{headers:Rr,method:Dr,body:Mr}=$r;let Br={},Nr;Mr&&(Rr&&!Object.prototype.hasOwnProperty.call(Rr,"Content-Type")||!Rr)&&(typeof Blob<"u"&&Mr instanceof Blob||Mr instanceof ArrayBuffer?(Br["Content-Type"]="application/octet-stream",Nr=Mr):typeof Mr=="string"?(Br["Content-Type"]="text/plain",Nr=Mr):typeof FormData<"u"&&Mr instanceof FormData?Nr=Mr:(Br["Content-Type"]="application/json",Nr=JSON.stringify(Mr)));const Lr=yield this.fetch(`${this.url}/${Cr}`,{method:Dr||"POST",headers:Object.assign(Object.assign(Object.assign({},Br),this.headers),Rr),body:Nr}).catch(Vr=>{throw new FunctionsFetchError(Vr)}),Hr=Lr.headers.get("x-relay-error");if(Hr&&Hr==="true")throw new FunctionsRelayError(Lr);if(!Lr.ok)throw new FunctionsHttpError(Lr);let zr=((Ar=Lr.headers.get("Content-Type"))!==null&&Ar!==void 0?Ar:"text/plain").split(";")[0].trim(),Ur;return zr==="application/json"?Ur=yield Lr.json():zr==="application/octet-stream"?Ur=yield Lr.blob():zr==="multipart/form-data"?Ur=yield Lr.formData():Ur=yield Lr.text(),{data:Ur,error:null}}catch(Rr){return{data:null,error:Rr}}})}}var getGlobal=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},globalObject=getGlobal();const fetch$1=globalObject.fetch,nodeFetch=globalObject.fetch.bind(globalObject),Headers$1=globalObject.Headers,Request$1=globalObject.Request,Response$1=globalObject.Response,browser$2=Object.freeze(Object.defineProperty({__proto__:null,Headers:Headers$1,Request:Request$1,Response:Response$1,default:nodeFetch,fetch:fetch$1},Symbol.toStringTag,{value:"Module"}));class PostgrestBuilder{constructor(Cr){this.shouldThrowOnError=!1,this.method=Cr.method,this.url=Cr.url,this.headers=Cr.headers,this.schema=Cr.schema,this.body=Cr.body,this.shouldThrowOnError=Cr.shouldThrowOnError,this.signal=Cr.signal,this.isMaybeSingle=Cr.isMaybeSingle,Cr.fetch?this.fetch=Cr.fetch:typeof fetch>"u"?this.fetch=nodeFetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(Cr,$r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const Ar=this.fetch;let Rr=Ar(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async Dr=>{var Mr,Br,Nr;let Lr=null,Hr=null,zr=null,Ur=Dr.status,Vr=Dr.statusText;if(Dr.ok){if(this.method!=="HEAD"){const Kr=await Dr.text();Kr===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?Hr=Kr:Hr=JSON.parse(Kr))}const Gr=(Mr=this.headers.Prefer)===null||Mr===void 0?void 0:Mr.match(/count=(exact|planned|estimated)/),Xr=(Br=Dr.headers.get("content-range"))===null||Br===void 0?void 0:Br.split("/");Gr&&Xr&&Xr.length>1&&(zr=parseInt(Xr[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(Hr)&&(Hr.length>1?(Lr={code:"PGRST116",details:`Results contain ${Hr.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},Hr=null,zr=null,Ur=406,Vr="Not Acceptable"):Hr.length===1?Hr=Hr[0]:Hr=null)}else{const Gr=await Dr.text();try{Lr=JSON.parse(Gr),Array.isArray(Lr)&&Dr.status===404&&(Hr=[],Lr=null,Ur=200,Vr="OK")}catch{Dr.status===404&&Gr===""?(Ur=204,Vr="No Content"):Lr={message:Gr}}if(Lr&&this.isMaybeSingle&&(!((Nr=Lr==null?void 0:Lr.details)===null||Nr===void 0)&&Nr.includes("0 rows"))&&(Lr=null,Ur=200,Vr="OK"),Lr&&this.shouldThrowOnError)throw Lr}return{error:Lr,data:Hr,count:zr,status:Ur,statusText:Vr}});return this.shouldThrowOnError||(Rr=Rr.catch(Dr=>{var Mr,Br,Nr;return{error:{message:`${(Mr=Dr==null?void 0:Dr.name)!==null&&Mr!==void 0?Mr:"FetchError"}: ${Dr==null?void 0:Dr.message}`,details:`${(Br=Dr==null?void 0:Dr.stack)!==null&&Br!==void 0?Br:""}`,hint:"",code:`${(Nr=Dr==null?void 0:Dr.code)!==null&&Nr!==void 0?Nr:""}`},data:null,count:null,status:0,statusText:""}})),Rr.then(Cr,$r)}}class PostgrestTransformBuilder extends PostgrestBuilder{select(Cr){let $r=!1;const Ar=(Cr??"*").split("").map(Rr=>/\s/.test(Rr)&&!$r?"":(Rr==='"'&&($r=!$r),Rr)).join("");return this.url.searchParams.set("select",Ar),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(Cr,{ascending:$r=!0,nullsFirst:Ar,foreignTable:Rr,referencedTable:Dr=Rr}={}){const Mr=Dr?`${Dr}.order`:"order",Br=this.url.searchParams.get(Mr);return this.url.searchParams.set(Mr,`${Br?`${Br},`:""}${Cr}.${$r?"asc":"desc"}${Ar===void 0?"":Ar?".nullsfirst":".nullslast"}`),this}limit(Cr,{foreignTable:$r,referencedTable:Ar=$r}={}){const Rr=typeof Ar>"u"?"limit":`${Ar}.limit`;return this.url.searchParams.set(Rr,`${Cr}`),this}range(Cr,$r,{foreignTable:Ar,referencedTable:Rr=Ar}={}){const Dr=typeof Rr>"u"?"offset":`${Rr}.offset`,Mr=typeof Rr>"u"?"limit":`${Rr}.limit`;return this.url.searchParams.set(Dr,`${Cr}`),this.url.searchParams.set(Mr,`${$r-Cr+1}`),this}abortSignal(Cr){return this.signal=Cr,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:Cr=!1,verbose:$r=!1,settings:Ar=!1,buffers:Rr=!1,wal:Dr=!1,format:Mr="text"}={}){var Br;const Nr=[Cr?"analyze":null,$r?"verbose":null,Ar?"settings":null,Rr?"buffers":null,Dr?"wal":null].filter(Boolean).join("|"),Lr=(Br=this.headers.Accept)!==null&&Br!==void 0?Br:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${Mr}; for="${Lr}"; options=${Nr};`,Mr==="json"?this:this}rollback(){var Cr;return((Cr=this.headers.Prefer)!==null&&Cr!==void 0?Cr:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}class PostgrestFilterBuilder extends PostgrestTransformBuilder{eq(Cr,$r){return this.url.searchParams.append(Cr,`eq.${$r}`),this}neq(Cr,$r){return this.url.searchParams.append(Cr,`neq.${$r}`),this}gt(Cr,$r){return this.url.searchParams.append(Cr,`gt.${$r}`),this}gte(Cr,$r){return this.url.searchParams.append(Cr,`gte.${$r}`),this}lt(Cr,$r){return this.url.searchParams.append(Cr,`lt.${$r}`),this}lte(Cr,$r){return this.url.searchParams.append(Cr,`lte.${$r}`),this}like(Cr,$r){return this.url.searchParams.append(Cr,`like.${$r}`),this}likeAllOf(Cr,$r){return this.url.searchParams.append(Cr,`like(all).{${$r.join(",")}}`),this}likeAnyOf(Cr,$r){return this.url.searchParams.append(Cr,`like(any).{${$r.join(",")}}`),this}ilike(Cr,$r){return this.url.searchParams.append(Cr,`ilike.${$r}`),this}ilikeAllOf(Cr,$r){return this.url.searchParams.append(Cr,`ilike(all).{${$r.join(",")}}`),this}ilikeAnyOf(Cr,$r){return this.url.searchParams.append(Cr,`ilike(any).{${$r.join(",")}}`),this}is(Cr,$r){return this.url.searchParams.append(Cr,`is.${$r}`),this}in(Cr,$r){const Ar=$r.map(Rr=>typeof Rr=="string"&&new RegExp("[,()]").test(Rr)?`"${Rr}"`:`${Rr}`).join(",");return this.url.searchParams.append(Cr,`in.(${Ar})`),this}contains(Cr,$r){return typeof $r=="string"?this.url.searchParams.append(Cr,`cs.${$r}`):Array.isArray($r)?this.url.searchParams.append(Cr,`cs.{${$r.join(",")}}`):this.url.searchParams.append(Cr,`cs.${JSON.stringify($r)}`),this}containedBy(Cr,$r){return typeof $r=="string"?this.url.searchParams.append(Cr,`cd.${$r}`):Array.isArray($r)?this.url.searchParams.append(Cr,`cd.{${$r.join(",")}}`):this.url.searchParams.append(Cr,`cd.${JSON.stringify($r)}`),this}rangeGt(Cr,$r){return this.url.searchParams.append(Cr,`sr.${$r}`),this}rangeGte(Cr,$r){return this.url.searchParams.append(Cr,`nxl.${$r}`),this}rangeLt(Cr,$r){return this.url.searchParams.append(Cr,`sl.${$r}`),this}rangeLte(Cr,$r){return this.url.searchParams.append(Cr,`nxr.${$r}`),this}rangeAdjacent(Cr,$r){return this.url.searchParams.append(Cr,`adj.${$r}`),this}overlaps(Cr,$r){return typeof $r=="string"?this.url.searchParams.append(Cr,`ov.${$r}`):this.url.searchParams.append(Cr,`ov.{${$r.join(",")}}`),this}textSearch(Cr,$r,{config:Ar,type:Rr}={}){let Dr="";Rr==="plain"?Dr="pl":Rr==="phrase"?Dr="ph":Rr==="websearch"&&(Dr="w");const Mr=Ar===void 0?"":`(${Ar})`;return this.url.searchParams.append(Cr,`${Dr}fts${Mr}.${$r}`),this}match(Cr){return Object.entries(Cr).forEach(([$r,Ar])=>{this.url.searchParams.append($r,`eq.${Ar}`)}),this}not(Cr,$r,Ar){return this.url.searchParams.append(Cr,`not.${$r}.${Ar}`),this}or(Cr,{foreignTable:$r,referencedTable:Ar=$r}={}){const Rr=Ar?`${Ar}.or`:"or";return this.url.searchParams.append(Rr,`(${Cr})`),this}filter(Cr,$r,Ar){return this.url.searchParams.append(Cr,`${$r}.${Ar}`),this}}class PostgrestQueryBuilder{constructor(Cr,{headers:$r={},schema:Ar,fetch:Rr}){this.url=Cr,this.headers=$r,this.schema=Ar,this.fetch=Rr}select(Cr,{head:$r=!1,count:Ar}={}){const Rr=$r?"HEAD":"GET";let Dr=!1;const Mr=(Cr??"*").split("").map(Br=>/\s/.test(Br)&&!Dr?"":(Br==='"'&&(Dr=!Dr),Br)).join("");return this.url.searchParams.set("select",Mr),Ar&&(this.headers.Prefer=`count=${Ar}`),new PostgrestFilterBuilder({method:Rr,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(Cr,{count:$r,defaultToNull:Ar=!0}={}){const Rr="POST",Dr=[];if(this.headers.Prefer&&Dr.push(this.headers.Prefer),$r&&Dr.push(`count=${$r}`),Ar||Dr.push("missing=default"),this.headers.Prefer=Dr.join(","),Array.isArray(Cr)){const Mr=Cr.reduce((Br,Nr)=>Br.concat(Object.keys(Nr)),[]);if(Mr.length>0){const Br=[...new Set(Mr)].map(Nr=>`"${Nr}"`);this.url.searchParams.set("columns",Br.join(","))}}return new PostgrestFilterBuilder({method:Rr,url:this.url,headers:this.headers,schema:this.schema,body:Cr,fetch:this.fetch,allowEmpty:!1})}upsert(Cr,{onConflict:$r,ignoreDuplicates:Ar=!1,count:Rr,defaultToNull:Dr=!0}={}){const Mr="POST",Br=[`resolution=${Ar?"ignore":"merge"}-duplicates`];if($r!==void 0&&this.url.searchParams.set("on_conflict",$r),this.headers.Prefer&&Br.push(this.headers.Prefer),Rr&&Br.push(`count=${Rr}`),Dr||Br.push("missing=default"),this.headers.Prefer=Br.join(","),Array.isArray(Cr)){const Nr=Cr.reduce((Lr,Hr)=>Lr.concat(Object.keys(Hr)),[]);if(Nr.length>0){const Lr=[...new Set(Nr)].map(Hr=>`"${Hr}"`);this.url.searchParams.set("columns",Lr.join(","))}}return new PostgrestFilterBuilder({method:Mr,url:this.url,headers:this.headers,schema:this.schema,body:Cr,fetch:this.fetch,allowEmpty:!1})}update(Cr,{count:$r}={}){const Ar="PATCH",Rr=[];return this.headers.Prefer&&Rr.push(this.headers.Prefer),$r&&Rr.push(`count=${$r}`),this.headers.Prefer=Rr.join(","),new PostgrestFilterBuilder({method:Ar,url:this.url,headers:this.headers,schema:this.schema,body:Cr,fetch:this.fetch,allowEmpty:!1})}delete({count:Cr}={}){const $r="DELETE",Ar=[];return Cr&&Ar.push(`count=${Cr}`),this.headers.Prefer&&Ar.unshift(this.headers.Prefer),this.headers.Prefer=Ar.join(","),new PostgrestFilterBuilder({method:$r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}const version$6="1.9.1",DEFAULT_HEADERS$4={"X-Client-Info":`postgrest-js/${version$6}`};class PostgrestClient{constructor(Cr,{headers:$r={},schema:Ar,fetch:Rr}={}){this.url=Cr,this.headers=Object.assign(Object.assign({},DEFAULT_HEADERS$4),$r),this.schemaName=Ar,this.fetch=Rr}from(Cr){const $r=new URL(`${this.url}/${Cr}`);return new PostgrestQueryBuilder($r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(Cr){return new PostgrestClient(this.url,{headers:this.headers,schema:Cr,fetch:this.fetch})}rpc(Cr,$r={},{head:Ar=!1,count:Rr}={}){let Dr;const Mr=new URL(`${this.url}/rpc/${Cr}`);let Br;Ar?(Dr="HEAD",Object.entries($r).forEach(([Lr,Hr])=>{Mr.searchParams.append(Lr,`${Hr}`)})):(Dr="POST",Br=$r);const Nr=Object.assign({},this.headers);return Rr&&(Nr.Prefer=`count=${Rr}`),new PostgrestFilterBuilder({method:Dr,url:Mr,headers:Nr,schema:this.schemaName,body:Br,fetch:this.fetch,allowEmpty:!1})}}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(Tr){return Tr&&Tr.__esModule&&Object.prototype.hasOwnProperty.call(Tr,"default")?Tr.default:Tr}function getAugmentedNamespace(Tr){if(Tr.__esModule)return Tr;var Cr=Tr.default;if(typeof Cr=="function"){var $r=function Ar(){return this instanceof Ar?Reflect.construct(Cr,arguments,this.constructor):Cr.apply(this,arguments)};$r.prototype=Cr.prototype}else $r={};return Object.defineProperty($r,"__esModule",{value:!0}),Object.keys(Tr).forEach(function(Ar){var Rr=Object.getOwnPropertyDescriptor(Tr,Ar);Object.defineProperty($r,Ar,Rr.get?Rr:{enumerable:!0,get:function(){return Tr[Ar]}})}),$r}var global$1,hasRequiredGlobal;function requireGlobal(){if(hasRequiredGlobal)return global$1;hasRequiredGlobal=1;var Tr=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};return global$1=function(){if(this)return this;if(typeof globalThis=="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return Tr()}try{return __global__||Tr()}finally{delete Object.prototype.__global__}}(),global$1}const name="websocket",description="Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.",keywords=["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],author="Brian McKelvey (https://github.com/theturtle32)",contributors=["Iñaki Baz Castillo (http://dev.sipdoc.net)"],version$5="1.0.34",repository={type:"git",url:"https://github.com/theturtle32/WebSocket-Node.git"},homepage="https://github.com/theturtle32/WebSocket-Node",engines={node:">=4.0.0"},dependencies={bufferutil:"^4.0.1",debug:"^2.2.0","es5-ext":"^0.10.50","typedarray-to-buffer":"^3.1.5","utf-8-validate":"^5.0.2",yaeti:"^0.0.6"},devDependencies={"buffer-equal":"^1.0.0",gulp:"^4.0.2","gulp-jshint":"^2.0.4","jshint-stylish":"^2.2.1",jshint:"^2.0.0",tape:"^4.9.1"},config$3={verbose:!1},scripts={test:"tape test/unit/*.js",gulp:"gulp"},main="index",directories={lib:"./lib"},browser$1="lib/browser.js",license="Apache-2.0",require$$0$1={name,description,keywords,author,contributors,version:version$5,repository,homepage,engines,dependencies,devDependencies,config:config$3,scripts,main,directories,browser:browser$1,license};var version$4=require$$0$1.version,_globalThis;if(typeof globalThis=="object")_globalThis=globalThis;else try{_globalThis=requireGlobal()}catch{}finally{if(!_globalThis&&typeof window<"u"&&(_globalThis=window),!_globalThis)throw new Error("Could not determine global this")}var NativeWebSocket=_globalThis.WebSocket||_globalThis.MozWebSocket,websocket_version=version$4;function W3CWebSocket(Tr,Cr){var $r;return Cr?$r=new NativeWebSocket(Tr,Cr):$r=new NativeWebSocket(Tr),$r}NativeWebSocket&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(Tr){Object.defineProperty(W3CWebSocket,Tr,{get:function(){return NativeWebSocket[Tr]}})});var browser={w3cwebsocket:NativeWebSocket?W3CWebSocket:null,version:websocket_version};const version$3="2.7.4",DEFAULT_HEADERS$3={"X-Client-Info":`realtime-js/${version$3}`},VSN="1.0.0",DEFAULT_TIMEOUT=1e4,WS_CLOSE_NORMAL=1e3;var SOCKET_STATES;(function(Tr){Tr[Tr.connecting=0]="connecting",Tr[Tr.open=1]="open",Tr[Tr.closing=2]="closing",Tr[Tr.closed=3]="closed"})(SOCKET_STATES||(SOCKET_STATES={}));var CHANNEL_STATES;(function(Tr){Tr.closed="closed",Tr.errored="errored",Tr.joined="joined",Tr.joining="joining",Tr.leaving="leaving"})(CHANNEL_STATES||(CHANNEL_STATES={}));var CHANNEL_EVENTS;(function(Tr){Tr.close="phx_close",Tr.error="phx_error",Tr.join="phx_join",Tr.reply="phx_reply",Tr.leave="phx_leave",Tr.access_token="access_token"})(CHANNEL_EVENTS||(CHANNEL_EVENTS={}));var TRANSPORTS;(function(Tr){Tr.websocket="websocket"})(TRANSPORTS||(TRANSPORTS={}));var CONNECTION_STATE;(function(Tr){Tr.Connecting="connecting",Tr.Open="open",Tr.Closing="closing",Tr.Closed="closed"})(CONNECTION_STATE||(CONNECTION_STATE={}));class Timer{constructor(Cr,$r){this.callback=Cr,this.timerCalc=$r,this.timer=void 0,this.tries=0,this.callback=Cr,this.timerCalc=$r}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}class Serializer{constructor(){this.HEADER_LENGTH=1}decode(Cr,$r){return Cr.constructor===ArrayBuffer?$r(this._binaryDecode(Cr)):$r(typeof Cr=="string"?JSON.parse(Cr):{})}_binaryDecode(Cr){const $r=new DataView(Cr),Ar=new TextDecoder;return this._decodeBroadcast(Cr,$r,Ar)}_decodeBroadcast(Cr,$r,Ar){const Rr=$r.getUint8(1),Dr=$r.getUint8(2);let Mr=this.HEADER_LENGTH+2;const Br=Ar.decode(Cr.slice(Mr,Mr+Rr));Mr=Mr+Rr;const Nr=Ar.decode(Cr.slice(Mr,Mr+Dr));Mr=Mr+Dr;const Lr=JSON.parse(Ar.decode(Cr.slice(Mr,Cr.byteLength)));return{ref:null,topic:Br,event:Nr,payload:Lr}}}class Push{constructor(Cr,$r,Ar={},Rr=DEFAULT_TIMEOUT){this.channel=Cr,this.event=$r,this.payload=Ar,this.timeout=Rr,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null,this.rateLimited=!1}resend(Cr){this.timeout=Cr,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){if(this._hasReceived("timeout"))return;this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()})==="rate limited"&&(this.rateLimited=!0)}updatePayload(Cr){this.payload=Object.assign(Object.assign({},this.payload),Cr)}receive(Cr,$r){var Ar;return this._hasReceived(Cr)&&$r((Ar=this.receivedResp)===null||Ar===void 0?void 0:Ar.response),this.recHooks.push({status:Cr,callback:$r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const Cr=$r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=$r,this._matchReceive($r)};this.channel._on(this.refEvent,{},Cr),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(Cr,$r){this.refEvent&&this.channel._trigger(this.refEvent,{status:Cr,response:$r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:Cr,response:$r}){this.recHooks.filter(Ar=>Ar.status===Cr).forEach(Ar=>Ar.callback($r))}_hasReceived(Cr){return this.receivedResp&&this.receivedResp.status===Cr}}var REALTIME_PRESENCE_LISTEN_EVENTS;(function(Tr){Tr.SYNC="sync",Tr.JOIN="join",Tr.LEAVE="leave"})(REALTIME_PRESENCE_LISTEN_EVENTS||(REALTIME_PRESENCE_LISTEN_EVENTS={}));class RealtimePresence{constructor(Cr,$r){this.channel=Cr,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const Ar=($r==null?void 0:$r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(Ar.state,{},Rr=>{const{onJoin:Dr,onLeave:Mr,onSync:Br}=this.caller;this.joinRef=this.channel._joinRef(),this.state=RealtimePresence.syncState(this.state,Rr,Dr,Mr),this.pendingDiffs.forEach(Nr=>{this.state=RealtimePresence.syncDiff(this.state,Nr,Dr,Mr)}),this.pendingDiffs=[],Br()}),this.channel._on(Ar.diff,{},Rr=>{const{onJoin:Dr,onLeave:Mr,onSync:Br}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(Rr):(this.state=RealtimePresence.syncDiff(this.state,Rr,Dr,Mr),Br())}),this.onJoin((Rr,Dr,Mr)=>{this.channel._trigger("presence",{event:"join",key:Rr,currentPresences:Dr,newPresences:Mr})}),this.onLeave((Rr,Dr,Mr)=>{this.channel._trigger("presence",{event:"leave",key:Rr,currentPresences:Dr,leftPresences:Mr})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(Cr,$r,Ar,Rr){const Dr=this.cloneDeep(Cr),Mr=this.transformState($r),Br={},Nr={};return this.map(Dr,(Lr,Hr)=>{Mr[Lr]||(Nr[Lr]=Hr)}),this.map(Mr,(Lr,Hr)=>{const zr=Dr[Lr];if(zr){const Ur=Hr.map(Xr=>Xr.presence_ref),Vr=zr.map(Xr=>Xr.presence_ref),jr=Hr.filter(Xr=>Vr.indexOf(Xr.presence_ref)<0),Gr=zr.filter(Xr=>Ur.indexOf(Xr.presence_ref)<0);jr.length>0&&(Br[Lr]=jr),Gr.length>0&&(Nr[Lr]=Gr)}else Br[Lr]=Hr}),this.syncDiff(Dr,{joins:Br,leaves:Nr},Ar,Rr)}static syncDiff(Cr,$r,Ar,Rr){const{joins:Dr,leaves:Mr}={joins:this.transformState($r.joins),leaves:this.transformState($r.leaves)};return Ar||(Ar=()=>{}),Rr||(Rr=()=>{}),this.map(Dr,(Br,Nr)=>{var Lr;const Hr=(Lr=Cr[Br])!==null&&Lr!==void 0?Lr:[];if(Cr[Br]=this.cloneDeep(Nr),Hr.length>0){const zr=Cr[Br].map(Vr=>Vr.presence_ref),Ur=Hr.filter(Vr=>zr.indexOf(Vr.presence_ref)<0);Cr[Br].unshift(...Ur)}Ar(Br,Hr,Nr)}),this.map(Mr,(Br,Nr)=>{let Lr=Cr[Br];if(!Lr)return;const Hr=Nr.map(zr=>zr.presence_ref);Lr=Lr.filter(zr=>Hr.indexOf(zr.presence_ref)<0),Cr[Br]=Lr,Rr(Br,Lr,Nr),Lr.length===0&&delete Cr[Br]}),Cr}static map(Cr,$r){return Object.getOwnPropertyNames(Cr).map(Ar=>$r(Ar,Cr[Ar]))}static transformState(Cr){return Cr=this.cloneDeep(Cr),Object.getOwnPropertyNames(Cr).reduce(($r,Ar)=>{const Rr=Cr[Ar];return"metas"in Rr?$r[Ar]=Rr.metas.map(Dr=>(Dr.presence_ref=Dr.phx_ref,delete Dr.phx_ref,delete Dr.phx_ref_prev,Dr)):$r[Ar]=Rr,$r},{})}static cloneDeep(Cr){return JSON.parse(JSON.stringify(Cr))}onJoin(Cr){this.caller.onJoin=Cr}onLeave(Cr){this.caller.onLeave=Cr}onSync(Cr){this.caller.onSync=Cr}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var PostgresTypes;(function(Tr){Tr.abstime="abstime",Tr.bool="bool",Tr.date="date",Tr.daterange="daterange",Tr.float4="float4",Tr.float8="float8",Tr.int2="int2",Tr.int4="int4",Tr.int4range="int4range",Tr.int8="int8",Tr.int8range="int8range",Tr.json="json",Tr.jsonb="jsonb",Tr.money="money",Tr.numeric="numeric",Tr.oid="oid",Tr.reltime="reltime",Tr.text="text",Tr.time="time",Tr.timestamp="timestamp",Tr.timestamptz="timestamptz",Tr.timetz="timetz",Tr.tsrange="tsrange",Tr.tstzrange="tstzrange"})(PostgresTypes||(PostgresTypes={}));const convertChangeData=(Tr,Cr,$r={})=>{var Ar;const Rr=(Ar=$r.skipTypes)!==null&&Ar!==void 0?Ar:[];return Object.keys(Cr).reduce((Dr,Mr)=>(Dr[Mr]=convertColumn(Mr,Tr,Cr,Rr),Dr),{})},convertColumn=(Tr,Cr,$r,Ar)=>{const Rr=Cr.find(Br=>Br.name===Tr),Dr=Rr==null?void 0:Rr.type,Mr=$r[Tr];return Dr&&!Ar.includes(Dr)?convertCell(Dr,Mr):noop$4(Mr)},convertCell=(Tr,Cr)=>{if(Tr.charAt(0)==="_"){const $r=Tr.slice(1,Tr.length);return toArray$1(Cr,$r)}switch(Tr){case PostgresTypes.bool:return toBoolean(Cr);case PostgresTypes.float4:case PostgresTypes.float8:case PostgresTypes.int2:case PostgresTypes.int4:case PostgresTypes.int8:case PostgresTypes.numeric:case PostgresTypes.oid:return toNumber(Cr);case PostgresTypes.json:case PostgresTypes.jsonb:return toJson(Cr);case PostgresTypes.timestamp:return toTimestampString(Cr);case PostgresTypes.abstime:case PostgresTypes.date:case PostgresTypes.daterange:case PostgresTypes.int4range:case PostgresTypes.int8range:case PostgresTypes.money:case PostgresTypes.reltime:case PostgresTypes.text:case PostgresTypes.time:case PostgresTypes.timestamptz:case PostgresTypes.timetz:case PostgresTypes.tsrange:case PostgresTypes.tstzrange:return noop$4(Cr);default:return noop$4(Cr)}},noop$4=Tr=>Tr,toBoolean=Tr=>{switch(Tr){case"t":return!0;case"f":return!1;default:return Tr}},toNumber=Tr=>{if(typeof Tr=="string"){const Cr=parseFloat(Tr);if(!Number.isNaN(Cr))return Cr}return Tr},toJson=Tr=>{if(typeof Tr=="string")try{return JSON.parse(Tr)}catch(Cr){return console.log(`JSON parse error: ${Cr}`),Tr}return Tr},toArray$1=(Tr,Cr)=>{if(typeof Tr!="string")return Tr;const $r=Tr.length-1,Ar=Tr[$r];if(Tr[0]==="{"&&Ar==="}"){let Dr;const Mr=Tr.slice(1,$r);try{Dr=JSON.parse("["+Mr+"]")}catch{Dr=Mr?Mr.split(","):[]}return Dr.map(Br=>convertCell(Cr,Br))}return Tr},toTimestampString=Tr=>typeof Tr=="string"?Tr.replace(" ","T"):Tr;var __awaiter$8=globalThis&&globalThis.__awaiter||function(Tr,Cr,$r,Ar){function Rr(Dr){return Dr instanceof $r?Dr:new $r(function(Mr){Mr(Dr)})}return new($r||($r=Promise))(function(Dr,Mr){function Br(Hr){try{Lr(Ar.next(Hr))}catch(zr){Mr(zr)}}function Nr(Hr){try{Lr(Ar.throw(Hr))}catch(zr){Mr(zr)}}function Lr(Hr){Hr.done?Dr(Hr.value):Rr(Hr.value).then(Br,Nr)}Lr((Ar=Ar.apply(Tr,Cr||[])).next())})},REALTIME_POSTGRES_CHANGES_LISTEN_EVENT;(function(Tr){Tr.ALL="*",Tr.INSERT="INSERT",Tr.UPDATE="UPDATE",Tr.DELETE="DELETE"})(REALTIME_POSTGRES_CHANGES_LISTEN_EVENT||(REALTIME_POSTGRES_CHANGES_LISTEN_EVENT={}));var REALTIME_LISTEN_TYPES;(function(Tr){Tr.BROADCAST="broadcast",Tr.PRESENCE="presence",Tr.POSTGRES_CHANGES="postgres_changes"})(REALTIME_LISTEN_TYPES||(REALTIME_LISTEN_TYPES={}));var REALTIME_SUBSCRIBE_STATES;(function(Tr){Tr.SUBSCRIBED="SUBSCRIBED",Tr.TIMED_OUT="TIMED_OUT",Tr.CLOSED="CLOSED",Tr.CHANNEL_ERROR="CHANNEL_ERROR"})(REALTIME_SUBSCRIBE_STATES||(REALTIME_SUBSCRIBE_STATES={}));class RealtimeChannel{constructor(Cr,$r={config:{}},Ar){this.topic=Cr,this.params=$r,this.socket=Ar,this.bindings={},this.state=CHANNEL_STATES.closed,this.joinedOnce=!1,this.pushBuffer=[],this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""}},$r.config),this.timeout=this.socket.timeout,this.joinPush=new Push(this,CHANNEL_EVENTS.join,this.params,this.timeout),this.rejoinTimer=new Timer(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=CHANNEL_STATES.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(Rr=>Rr.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=CHANNEL_STATES.closed,this.socket._remove(this)}),this._onError(Rr=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,Rr),this.state=CHANNEL_STATES.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=CHANNEL_STATES.errored,this.rejoinTimer.scheduleTimeout())}),this._on(CHANNEL_EVENTS.reply,{},(Rr,Dr)=>{this._trigger(this._replyEventName(Dr),Rr)}),this.presence=new RealtimePresence(this)}subscribe(Cr,$r=this.timeout){var Ar,Rr;if(this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:Dr,presence:Mr}}=this.params;this._onError(Lr=>Cr&&Cr("CHANNEL_ERROR",Lr)),this._onClose(()=>Cr&&Cr("CLOSED"));const Br={},Nr={broadcast:Dr,presence:Mr,postgres_changes:(Rr=(Ar=this.bindings.postgres_changes)===null||Ar===void 0?void 0:Ar.map(Lr=>Lr.filter))!==null&&Rr!==void 0?Rr:[]};this.socket.accessToken&&(Br.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:Nr},Br)),this.joinedOnce=!0,this._rejoin($r),this.joinPush.receive("ok",({postgres_changes:Lr})=>{var Hr;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),Lr===void 0){Cr&&Cr("SUBSCRIBED");return}else{const zr=this.bindings.postgres_changes,Ur=(Hr=zr==null?void 0:zr.length)!==null&&Hr!==void 0?Hr:0,Vr=[];for(let jr=0;jr{Cr&&Cr("CHANNEL_ERROR",new Error(JSON.stringify(Object.values(Lr).join(", ")||"error")))}).receive("timeout",()=>{Cr&&Cr("TIMED_OUT")})}return this}presenceState(){return this.presence.state}track(Cr,$r={}){return __awaiter$8(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"track",payload:Cr},$r.timeout||this.timeout)})}untrack(Cr={}){return __awaiter$8(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"untrack"},Cr)})}on(Cr,$r,Ar){return this._on(Cr,$r,Ar)}send(Cr,$r={}){return new Promise(Ar=>{var Rr,Dr,Mr;const Br=this._push(Cr.type,Cr,$r.timeout||this.timeout);Br.rateLimited&&Ar("rate limited"),Cr.type==="broadcast"&&!(!((Mr=(Dr=(Rr=this.params)===null||Rr===void 0?void 0:Rr.config)===null||Dr===void 0?void 0:Dr.broadcast)===null||Mr===void 0)&&Mr.ack)&&Ar("ok"),Br.receive("ok",()=>Ar("ok")),Br.receive("timeout",()=>Ar("timed out"))})}updateJoinPayload(Cr){this.joinPush.updatePayload(Cr)}unsubscribe(Cr=this.timeout){this.state=CHANNEL_STATES.leaving;const $r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(CHANNEL_EVENTS.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(Ar=>{const Rr=new Push(this,CHANNEL_EVENTS.leave,{},Cr);Rr.receive("ok",()=>{$r(),Ar("ok")}).receive("timeout",()=>{$r(),Ar("timed out")}).receive("error",()=>{Ar("error")}),Rr.send(),this._canPush()||Rr.trigger("ok",{})})}_push(Cr,$r,Ar=this.timeout){if(!this.joinedOnce)throw`tried to push '${Cr}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let Rr=new Push(this,Cr,$r,Ar);return this._canPush()?Rr.send():(Rr.startTimeout(),this.pushBuffer.push(Rr)),Rr}_onMessage(Cr,$r,Ar){return $r}_isMember(Cr){return this.topic===Cr}_joinRef(){return this.joinPush.ref}_trigger(Cr,$r,Ar){var Rr,Dr;const Mr=Cr.toLocaleLowerCase(),{close:Br,error:Nr,leave:Lr,join:Hr}=CHANNEL_EVENTS;if(Ar&&[Br,Nr,Lr,Hr].indexOf(Mr)>=0&&Ar!==this._joinRef())return;let Ur=this._onMessage(Mr,$r,Ar);if($r&&!Ur)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(Mr)?(Rr=this.bindings.postgres_changes)===null||Rr===void 0||Rr.filter(Vr=>{var jr,Gr,Xr;return((jr=Vr.filter)===null||jr===void 0?void 0:jr.event)==="*"||((Xr=(Gr=Vr.filter)===null||Gr===void 0?void 0:Gr.event)===null||Xr===void 0?void 0:Xr.toLocaleLowerCase())===Mr}).map(Vr=>Vr.callback(Ur,Ar)):(Dr=this.bindings[Mr])===null||Dr===void 0||Dr.filter(Vr=>{var jr,Gr,Xr,Kr,Zr,eo;if(["broadcast","presence","postgres_changes"].includes(Mr))if("id"in Vr){const Wr=Vr.id,Yr=(jr=Vr.filter)===null||jr===void 0?void 0:jr.event;return Wr&&((Gr=$r.ids)===null||Gr===void 0?void 0:Gr.includes(Wr))&&(Yr==="*"||(Yr==null?void 0:Yr.toLocaleLowerCase())===((Xr=$r.data)===null||Xr===void 0?void 0:Xr.type.toLocaleLowerCase()))}else{const Wr=(Zr=(Kr=Vr==null?void 0:Vr.filter)===null||Kr===void 0?void 0:Kr.event)===null||Zr===void 0?void 0:Zr.toLocaleLowerCase();return Wr==="*"||Wr===((eo=$r==null?void 0:$r.event)===null||eo===void 0?void 0:eo.toLocaleLowerCase())}else return Vr.type.toLocaleLowerCase()===Mr}).map(Vr=>{if(typeof Ur=="object"&&"ids"in Ur){const jr=Ur.data,{schema:Gr,table:Xr,commit_timestamp:Kr,type:Zr,errors:eo}=jr;Ur=Object.assign(Object.assign({},{schema:Gr,table:Xr,commit_timestamp:Kr,eventType:Zr,new:{},old:{},errors:eo}),this._getPayloadRecords(jr))}Vr.callback(Ur,Ar)})}_isClosed(){return this.state===CHANNEL_STATES.closed}_isJoined(){return this.state===CHANNEL_STATES.joined}_isJoining(){return this.state===CHANNEL_STATES.joining}_isLeaving(){return this.state===CHANNEL_STATES.leaving}_replyEventName(Cr){return`chan_reply_${Cr}`}_on(Cr,$r,Ar){const Rr=Cr.toLocaleLowerCase(),Dr={type:Rr,filter:$r,callback:Ar};return this.bindings[Rr]?this.bindings[Rr].push(Dr):this.bindings[Rr]=[Dr],this}_off(Cr,$r){const Ar=Cr.toLocaleLowerCase();return this.bindings[Ar]=this.bindings[Ar].filter(Rr=>{var Dr;return!(((Dr=Rr.type)===null||Dr===void 0?void 0:Dr.toLocaleLowerCase())===Ar&&RealtimeChannel.isEqual(Rr.filter,$r))}),this}static isEqual(Cr,$r){if(Object.keys(Cr).length!==Object.keys($r).length)return!1;for(const Ar in Cr)if(Cr[Ar]!==$r[Ar])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(Cr){this._on(CHANNEL_EVENTS.close,{},Cr)}_onError(Cr){this._on(CHANNEL_EVENTS.error,{},$r=>Cr($r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(Cr=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=CHANNEL_STATES.joining,this.joinPush.resend(Cr))}_getPayloadRecords(Cr){const $r={new:{},old:{}};return(Cr.type==="INSERT"||Cr.type==="UPDATE")&&($r.new=convertChangeData(Cr.columns,Cr.record)),(Cr.type==="UPDATE"||Cr.type==="DELETE")&&($r.old=convertChangeData(Cr.columns,Cr.old_record)),$r}}var __awaiter$7=globalThis&&globalThis.__awaiter||function(Tr,Cr,$r,Ar){function Rr(Dr){return Dr instanceof $r?Dr:new $r(function(Mr){Mr(Dr)})}return new($r||($r=Promise))(function(Dr,Mr){function Br(Hr){try{Lr(Ar.next(Hr))}catch(zr){Mr(zr)}}function Nr(Hr){try{Lr(Ar.throw(Hr))}catch(zr){Mr(zr)}}function Lr(Hr){Hr.done?Dr(Hr.value):Rr(Hr.value).then(Br,Nr)}Lr((Ar=Ar.apply(Tr,Cr||[])).next())})};const noop$3=()=>{};class RealtimeClient{constructor(Cr,$r){var Ar,Rr;this.accessToken=null,this.channels=[],this.endPoint="",this.headers=DEFAULT_HEADERS$3,this.params={},this.timeout=DEFAULT_TIMEOUT,this.transport=browser.w3cwebsocket,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=noop$3,this.conn=null,this.sendBuffer=[],this.serializer=new Serializer,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.eventsPerSecondLimitMs=100,this.inThrottle=!1,this.endPoint=`${Cr}/${TRANSPORTS.websocket}`,$r!=null&&$r.params&&(this.params=$r.params),$r!=null&&$r.headers&&(this.headers=Object.assign(Object.assign({},this.headers),$r.headers)),$r!=null&&$r.timeout&&(this.timeout=$r.timeout),$r!=null&&$r.logger&&(this.logger=$r.logger),$r!=null&&$r.transport&&(this.transport=$r.transport),$r!=null&&$r.heartbeatIntervalMs&&(this.heartbeatIntervalMs=$r.heartbeatIntervalMs);const Dr=(Ar=$r==null?void 0:$r.params)===null||Ar===void 0?void 0:Ar.eventsPerSecond;Dr&&(this.eventsPerSecondLimitMs=Math.floor(1e3/Dr));const Mr=(Rr=$r==null?void 0:$r.params)===null||Rr===void 0?void 0:Rr.apikey;Mr&&(this.accessToken=Mr),this.reconnectAfterMs=$r!=null&&$r.reconnectAfterMs?$r.reconnectAfterMs:Br=>[1e3,2e3,5e3,1e4][Br-1]||1e4,this.encode=$r!=null&&$r.encode?$r.encode:(Br,Nr)=>Nr(JSON.stringify(Br)),this.decode=$r!=null&&$r.decode?$r.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new Timer(()=>__awaiter$7(this,void 0,void 0,function*(){this.disconnect(),this.connect()}),this.reconnectAfterMs)}connect(){this.conn||(this.conn=new this.transport(this._endPointURL(),[],null,this.headers),this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=Cr=>this._onConnError(Cr),this.conn.onmessage=Cr=>this._onConnMessage(Cr),this.conn.onclose=Cr=>this._onConnClose(Cr)))}disconnect(Cr,$r){this.conn&&(this.conn.onclose=function(){},Cr?this.conn.close(Cr,$r??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}removeChannel(Cr){return __awaiter$7(this,void 0,void 0,function*(){const $r=yield Cr.unsubscribe();return this.channels.length===0&&this.disconnect(),$r})}removeAllChannels(){return __awaiter$7(this,void 0,void 0,function*(){const Cr=yield Promise.all(this.channels.map($r=>$r.unsubscribe()));return this.disconnect(),Cr})}log(Cr,$r,Ar){this.logger(Cr,$r,Ar)}connectionState(){switch(this.conn&&this.conn.readyState){case SOCKET_STATES.connecting:return CONNECTION_STATE.Connecting;case SOCKET_STATES.open:return CONNECTION_STATE.Open;case SOCKET_STATES.closing:return CONNECTION_STATE.Closing;default:return CONNECTION_STATE.Closed}}isConnected(){return this.connectionState()===CONNECTION_STATE.Open}channel(Cr,$r={config:{}}){this.isConnected()||this.connect();const Ar=new RealtimeChannel(`realtime:${Cr}`,$r,this);return this.channels.push(Ar),Ar}push(Cr){const{topic:$r,event:Ar,payload:Rr,ref:Dr}=Cr;let Mr=()=>{this.encode(Cr,Br=>{var Nr;(Nr=this.conn)===null||Nr===void 0||Nr.send(Br)})};if(this.log("push",`${$r} ${Ar} (${Dr})`,Rr),this.isConnected())if(["broadcast","presence","postgres_changes"].includes(Ar)){if(this._throttle(Mr)())return"rate limited"}else Mr();else this.sendBuffer.push(Mr)}setAuth(Cr){this.accessToken=Cr,this.channels.forEach($r=>{Cr&&$r.updateJoinPayload({access_token:Cr}),$r.joinedOnce&&$r._isJoined()&&$r._push(CHANNEL_EVENTS.access_token,{access_token:Cr})})}_makeRef(){let Cr=this.ref+1;return Cr===this.ref?this.ref=0:this.ref=Cr,this.ref.toString()}_leaveOpenTopic(Cr){let $r=this.channels.find(Ar=>Ar.topic===Cr&&(Ar._isJoined()||Ar._isJoining()));$r&&(this.log("transport",`leaving duplicate topic "${Cr}"`),$r.unsubscribe())}_remove(Cr){this.channels=this.channels.filter($r=>$r._joinRef()!==Cr._joinRef())}_endPointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:VSN}))}_onConnMessage(Cr){this.decode(Cr.data,$r=>{let{topic:Ar,event:Rr,payload:Dr,ref:Mr}=$r;(Mr&&Mr===this.pendingHeartbeatRef||Rr===(Dr==null?void 0:Dr.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${Dr.status||""} ${Ar} ${Rr} ${Mr&&"("+Mr+")"||""}`,Dr),this.channels.filter(Br=>Br._isMember(Ar)).forEach(Br=>Br._trigger(Rr,Dr,Mr)),this.stateChangeCallbacks.message.forEach(Br=>Br($r))})}_onConnOpen(){this.log("transport",`connected to ${this._endPointURL()}`),this._flushSendBuffer(),this.reconnectTimer.reset(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this._sendHeartbeat(),this.heartbeatIntervalMs),this.stateChangeCallbacks.open.forEach(Cr=>Cr())}_onConnClose(Cr){this.log("transport","close",Cr),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach($r=>$r(Cr))}_onConnError(Cr){this.log("transport",Cr.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach($r=>$r(Cr))}_triggerChanError(){this.channels.forEach(Cr=>Cr._trigger(CHANNEL_EVENTS.error))}_appendParams(Cr,$r){if(Object.keys($r).length===0)return Cr;const Ar=Cr.match(/\?/)?"&":"?",Rr=new URLSearchParams($r);return`${Cr}${Ar}${Rr}`}_flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(Cr=>Cr()),this.sendBuffer=[])}_sendHeartbeat(){var Cr;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(Cr=this.conn)===null||Cr===void 0||Cr.close(WS_CLOSE_NORMAL,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}_throttle(Cr,$r=this.eventsPerSecondLimitMs){return()=>this.inThrottle?!0:(Cr(),$r>0&&(this.inThrottle=!0,setTimeout(()=>{this.inThrottle=!1},$r)),!1)}}class StorageError extends Error{constructor(Cr){super(Cr),this.__isStorageError=!0,this.name="StorageError"}}function isStorageError(Tr){return typeof Tr=="object"&&Tr!==null&&"__isStorageError"in Tr}class StorageApiError extends StorageError{constructor(Cr,$r){super(Cr),this.name="StorageApiError",this.status=$r}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class StorageUnknownError extends StorageError{constructor(Cr,$r){super(Cr),this.name="StorageUnknownError",this.originalError=$r}}var __awaiter$6=globalThis&&globalThis.__awaiter||function(Tr,Cr,$r,Ar){function Rr(Dr){return Dr instanceof $r?Dr:new $r(function(Mr){Mr(Dr)})}return new($r||($r=Promise))(function(Dr,Mr){function Br(Hr){try{Lr(Ar.next(Hr))}catch(zr){Mr(zr)}}function Nr(Hr){try{Lr(Ar.throw(Hr))}catch(zr){Mr(zr)}}function Lr(Hr){Hr.done?Dr(Hr.value):Rr(Hr.value).then(Br,Nr)}Lr((Ar=Ar.apply(Tr,Cr||[])).next())})};const resolveFetch$2=Tr=>{let Cr;return Tr?Cr=Tr:typeof fetch>"u"?Cr=(...$r)=>__vitePreload(()=>Promise.resolve().then(()=>browser$2),void 0,import.meta.url).then(({default:Ar})=>Ar(...$r)):Cr=fetch,(...$r)=>Cr(...$r)},resolveResponse=()=>__awaiter$6(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield __vitePreload(()=>Promise.resolve().then(()=>browser$2),void 0,import.meta.url)).Response:Response});var __awaiter$5=globalThis&&globalThis.__awaiter||function(Tr,Cr,$r,Ar){function Rr(Dr){return Dr instanceof $r?Dr:new $r(function(Mr){Mr(Dr)})}return new($r||($r=Promise))(function(Dr,Mr){function Br(Hr){try{Lr(Ar.next(Hr))}catch(zr){Mr(zr)}}function Nr(Hr){try{Lr(Ar.throw(Hr))}catch(zr){Mr(zr)}}function Lr(Hr){Hr.done?Dr(Hr.value):Rr(Hr.value).then(Br,Nr)}Lr((Ar=Ar.apply(Tr,Cr||[])).next())})};const _getErrorMessage$1=Tr=>Tr.msg||Tr.message||Tr.error_description||Tr.error||JSON.stringify(Tr),handleError$1=(Tr,Cr)=>__awaiter$5(void 0,void 0,void 0,function*(){const $r=yield resolveResponse();Tr instanceof $r?Tr.json().then(Ar=>{Cr(new StorageApiError(_getErrorMessage$1(Ar),Tr.status||500))}).catch(Ar=>{Cr(new StorageUnknownError(_getErrorMessage$1(Ar),Ar))}):Cr(new StorageUnknownError(_getErrorMessage$1(Tr),Tr))}),_getRequestParams$1=(Tr,Cr,$r,Ar)=>{const Rr={method:Tr,headers:(Cr==null?void 0:Cr.headers)||{}};return Tr==="GET"?Rr:(Rr.headers=Object.assign({"Content-Type":"application/json"},Cr==null?void 0:Cr.headers),Rr.body=JSON.stringify(Ar),Object.assign(Object.assign({},Rr),$r))};function _handleRequest$1(Tr,Cr,$r,Ar,Rr,Dr){return __awaiter$5(this,void 0,void 0,function*(){return new Promise((Mr,Br)=>{Tr($r,_getRequestParams$1(Cr,Ar,Rr,Dr)).then(Nr=>{if(!Nr.ok)throw Nr;return Ar!=null&&Ar.noResolveJson?Nr:Nr.json()}).then(Nr=>Mr(Nr)).catch(Nr=>handleError$1(Nr,Br))})})}function get$3(Tr,Cr,$r,Ar){return __awaiter$5(this,void 0,void 0,function*(){return _handleRequest$1(Tr,"GET",Cr,$r,Ar)})}function post(Tr,Cr,$r,Ar,Rr){return __awaiter$5(this,void 0,void 0,function*(){return _handleRequest$1(Tr,"POST",Cr,Ar,Rr,$r)})}function put(Tr,Cr,$r,Ar,Rr){return __awaiter$5(this,void 0,void 0,function*(){return _handleRequest$1(Tr,"PUT",Cr,Ar,Rr,$r)})}function remove(Tr,Cr,$r,Ar,Rr){return __awaiter$5(this,void 0,void 0,function*(){return _handleRequest$1(Tr,"DELETE",Cr,Ar,Rr,$r)})}var __awaiter$4=globalThis&&globalThis.__awaiter||function(Tr,Cr,$r,Ar){function Rr(Dr){return Dr instanceof $r?Dr:new $r(function(Mr){Mr(Dr)})}return new($r||($r=Promise))(function(Dr,Mr){function Br(Hr){try{Lr(Ar.next(Hr))}catch(zr){Mr(zr)}}function Nr(Hr){try{Lr(Ar.throw(Hr))}catch(zr){Mr(zr)}}function Lr(Hr){Hr.done?Dr(Hr.value):Rr(Hr.value).then(Br,Nr)}Lr((Ar=Ar.apply(Tr,Cr||[])).next())})};const DEFAULT_SEARCH_OPTIONS={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},DEFAULT_FILE_OPTIONS={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class StorageFileApi{constructor(Cr,$r={},Ar,Rr){this.url=Cr,this.headers=$r,this.bucketId=Ar,this.fetch=resolveFetch$2(Rr)}uploadOrUpdate(Cr,$r,Ar,Rr){return __awaiter$4(this,void 0,void 0,function*(){try{let Dr;const Mr=Object.assign(Object.assign({},DEFAULT_FILE_OPTIONS),Rr),Br=Object.assign(Object.assign({},this.headers),Cr==="POST"&&{"x-upsert":String(Mr.upsert)});typeof Blob<"u"&&Ar instanceof Blob?(Dr=new FormData,Dr.append("cacheControl",Mr.cacheControl),Dr.append("",Ar)):typeof FormData<"u"&&Ar instanceof FormData?(Dr=Ar,Dr.append("cacheControl",Mr.cacheControl)):(Dr=Ar,Br["cache-control"]=`max-age=${Mr.cacheControl}`,Br["content-type"]=Mr.contentType);const Nr=this._removeEmptyFolders($r),Lr=this._getFinalPath(Nr),Hr=yield this.fetch(`${this.url}/object/${Lr}`,Object.assign({method:Cr,body:Dr,headers:Br},Mr!=null&&Mr.duplex?{duplex:Mr.duplex}:{}));return Hr.ok?{data:{path:Nr},error:null}:{data:null,error:yield Hr.json()}}catch(Dr){if(isStorageError(Dr))return{data:null,error:Dr};throw Dr}})}upload(Cr,$r,Ar){return __awaiter$4(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",Cr,$r,Ar)})}uploadToSignedUrl(Cr,$r,Ar,Rr){return __awaiter$4(this,void 0,void 0,function*(){const Dr=this._removeEmptyFolders(Cr),Mr=this._getFinalPath(Dr),Br=new URL(this.url+`/object/upload/sign/${Mr}`);Br.searchParams.set("token",$r);try{let Nr;const Lr=Object.assign({upsert:DEFAULT_FILE_OPTIONS.upsert},Rr),Hr=Object.assign(Object.assign({},this.headers),{"x-upsert":String(Lr.upsert)});typeof Blob<"u"&&Ar instanceof Blob?(Nr=new FormData,Nr.append("cacheControl",Lr.cacheControl),Nr.append("",Ar)):typeof FormData<"u"&&Ar instanceof FormData?(Nr=Ar,Nr.append("cacheControl",Lr.cacheControl)):(Nr=Ar,Hr["cache-control"]=`max-age=${Lr.cacheControl}`,Hr["content-type"]=Lr.contentType);const zr=yield this.fetch(Br.toString(),{method:"PUT",body:Nr,headers:Hr});return zr.ok?{data:{path:Dr},error:null}:{data:null,error:yield zr.json()}}catch(Nr){if(isStorageError(Nr))return{data:null,error:Nr};throw Nr}})}createSignedUploadUrl(Cr){return __awaiter$4(this,void 0,void 0,function*(){try{let $r=this._getFinalPath(Cr);const Ar=yield post(this.fetch,`${this.url}/object/upload/sign/${$r}`,{},{headers:this.headers}),Rr=new URL(this.url+Ar.url),Dr=Rr.searchParams.get("token");if(!Dr)throw new StorageError("No token returned by API");return{data:{signedUrl:Rr.toString(),path:Cr,token:Dr},error:null}}catch($r){if(isStorageError($r))return{data:null,error:$r};throw $r}})}update(Cr,$r,Ar){return __awaiter$4(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",Cr,$r,Ar)})}move(Cr,$r){return __awaiter$4(this,void 0,void 0,function*(){try{return{data:yield post(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:Cr,destinationKey:$r},{headers:this.headers}),error:null}}catch(Ar){if(isStorageError(Ar))return{data:null,error:Ar};throw Ar}})}copy(Cr,$r){return __awaiter$4(this,void 0,void 0,function*(){try{return{data:{path:(yield post(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:Cr,destinationKey:$r},{headers:this.headers})).Key},error:null}}catch(Ar){if(isStorageError(Ar))return{data:null,error:Ar};throw Ar}})}createSignedUrl(Cr,$r,Ar){return __awaiter$4(this,void 0,void 0,function*(){try{let Rr=this._getFinalPath(Cr),Dr=yield post(this.fetch,`${this.url}/object/sign/${Rr}`,Object.assign({expiresIn:$r},Ar!=null&&Ar.transform?{transform:Ar.transform}:{}),{headers:this.headers});const Mr=Ar!=null&&Ar.download?`&download=${Ar.download===!0?"":Ar.download}`:"";return Dr={signedUrl:encodeURI(`${this.url}${Dr.signedURL}${Mr}`)},{data:Dr,error:null}}catch(Rr){if(isStorageError(Rr))return{data:null,error:Rr};throw Rr}})}createSignedUrls(Cr,$r,Ar){return __awaiter$4(this,void 0,void 0,function*(){try{const Rr=yield post(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:$r,paths:Cr},{headers:this.headers}),Dr=Ar!=null&&Ar.download?`&download=${Ar.download===!0?"":Ar.download}`:"";return{data:Rr.map(Mr=>Object.assign(Object.assign({},Mr),{signedUrl:Mr.signedURL?encodeURI(`${this.url}${Mr.signedURL}${Dr}`):null})),error:null}}catch(Rr){if(isStorageError(Rr))return{data:null,error:Rr};throw Rr}})}download(Cr,$r){return __awaiter$4(this,void 0,void 0,function*(){const Rr=typeof($r==null?void 0:$r.transform)<"u"?"render/image/authenticated":"object",Dr=this.transformOptsToQueryString(($r==null?void 0:$r.transform)||{}),Mr=Dr?`?${Dr}`:"";try{const Br=this._getFinalPath(Cr);return{data:yield(yield get$3(this.fetch,`${this.url}/${Rr}/${Br}${Mr}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(Br){if(isStorageError(Br))return{data:null,error:Br};throw Br}})}getPublicUrl(Cr,$r){const Ar=this._getFinalPath(Cr),Rr=[],Dr=$r!=null&&$r.download?`download=${$r.download===!0?"":$r.download}`:"";Dr!==""&&Rr.push(Dr);const Br=typeof($r==null?void 0:$r.transform)<"u"?"render/image":"object",Nr=this.transformOptsToQueryString(($r==null?void 0:$r.transform)||{});Nr!==""&&Rr.push(Nr);let Lr=Rr.join("&");return Lr!==""&&(Lr=`?${Lr}`),{data:{publicUrl:encodeURI(`${this.url}/${Br}/public/${Ar}${Lr}`)}}}remove(Cr){return __awaiter$4(this,void 0,void 0,function*(){try{return{data:yield remove(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:Cr},{headers:this.headers}),error:null}}catch($r){if(isStorageError($r))return{data:null,error:$r};throw $r}})}list(Cr,$r,Ar){return __awaiter$4(this,void 0,void 0,function*(){try{const Rr=Object.assign(Object.assign(Object.assign({},DEFAULT_SEARCH_OPTIONS),$r),{prefix:Cr||""});return{data:yield post(this.fetch,`${this.url}/object/list/${this.bucketId}`,Rr,{headers:this.headers},Ar),error:null}}catch(Rr){if(isStorageError(Rr))return{data:null,error:Rr};throw Rr}})}_getFinalPath(Cr){return`${this.bucketId}/${Cr}`}_removeEmptyFolders(Cr){return Cr.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(Cr){const $r=[];return Cr.width&&$r.push(`width=${Cr.width}`),Cr.height&&$r.push(`height=${Cr.height}`),Cr.resize&&$r.push(`resize=${Cr.resize}`),Cr.format&&$r.push(`format=${Cr.format}`),Cr.quality&&$r.push(`quality=${Cr.quality}`),$r.join("&")}}const version$2="2.5.4",DEFAULT_HEADERS$2={"X-Client-Info":`storage-js/${version$2}`};var __awaiter$3=globalThis&&globalThis.__awaiter||function(Tr,Cr,$r,Ar){function Rr(Dr){return Dr instanceof $r?Dr:new $r(function(Mr){Mr(Dr)})}return new($r||($r=Promise))(function(Dr,Mr){function Br(Hr){try{Lr(Ar.next(Hr))}catch(zr){Mr(zr)}}function Nr(Hr){try{Lr(Ar.throw(Hr))}catch(zr){Mr(zr)}}function Lr(Hr){Hr.done?Dr(Hr.value):Rr(Hr.value).then(Br,Nr)}Lr((Ar=Ar.apply(Tr,Cr||[])).next())})};class StorageBucketApi{constructor(Cr,$r={},Ar){this.url=Cr,this.headers=Object.assign(Object.assign({},DEFAULT_HEADERS$2),$r),this.fetch=resolveFetch$2(Ar)}listBuckets(){return __awaiter$3(this,void 0,void 0,function*(){try{return{data:yield get$3(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(Cr){if(isStorageError(Cr))return{data:null,error:Cr};throw Cr}})}getBucket(Cr){return __awaiter$3(this,void 0,void 0,function*(){try{return{data:yield get$3(this.fetch,`${this.url}/bucket/${Cr}`,{headers:this.headers}),error:null}}catch($r){if(isStorageError($r))return{data:null,error:$r};throw $r}})}createBucket(Cr,$r={public:!1}){return __awaiter$3(this,void 0,void 0,function*(){try{return{data:yield post(this.fetch,`${this.url}/bucket`,{id:Cr,name:Cr,public:$r.public,file_size_limit:$r.fileSizeLimit,allowed_mime_types:$r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(Ar){if(isStorageError(Ar))return{data:null,error:Ar};throw Ar}})}updateBucket(Cr,$r){return __awaiter$3(this,void 0,void 0,function*(){try{return{data:yield put(this.fetch,`${this.url}/bucket/${Cr}`,{id:Cr,name:Cr,public:$r.public,file_size_limit:$r.fileSizeLimit,allowed_mime_types:$r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(Ar){if(isStorageError(Ar))return{data:null,error:Ar};throw Ar}})}emptyBucket(Cr){return __awaiter$3(this,void 0,void 0,function*(){try{return{data:yield post(this.fetch,`${this.url}/bucket/${Cr}/empty`,{},{headers:this.headers}),error:null}}catch($r){if(isStorageError($r))return{data:null,error:$r};throw $r}})}deleteBucket(Cr){return __awaiter$3(this,void 0,void 0,function*(){try{return{data:yield remove(this.fetch,`${this.url}/bucket/${Cr}`,{},{headers:this.headers}),error:null}}catch($r){if(isStorageError($r))return{data:null,error:$r};throw $r}})}}class StorageClient extends StorageBucketApi{constructor(Cr,$r={},Ar){super(Cr,$r,Ar)}from(Cr){return new StorageFileApi(this.url,this.headers,Cr,this.fetch)}}const version$1="2.33.2",DEFAULT_HEADERS$1={"X-Client-Info":`supabase-js/${version$1}`};var __awaiter$2=globalThis&&globalThis.__awaiter||function(Tr,Cr,$r,Ar){function Rr(Dr){return Dr instanceof $r?Dr:new $r(function(Mr){Mr(Dr)})}return new($r||($r=Promise))(function(Dr,Mr){function Br(Hr){try{Lr(Ar.next(Hr))}catch(zr){Mr(zr)}}function Nr(Hr){try{Lr(Ar.throw(Hr))}catch(zr){Mr(zr)}}function Lr(Hr){Hr.done?Dr(Hr.value):Rr(Hr.value).then(Br,Nr)}Lr((Ar=Ar.apply(Tr,Cr||[])).next())})};const resolveFetch$1=Tr=>{let Cr;return Tr?Cr=Tr:typeof fetch>"u"?Cr=nodeFetch:Cr=fetch,(...$r)=>Cr(...$r)},resolveHeadersConstructor=()=>typeof Headers>"u"?Headers$1:Headers,fetchWithAuth=(Tr,Cr,$r)=>{const Ar=resolveFetch$1($r),Rr=resolveHeadersConstructor();return(Dr,Mr)=>__awaiter$2(void 0,void 0,void 0,function*(){var Br;const Nr=(Br=yield Cr())!==null&&Br!==void 0?Br:Tr;let Lr=new Rr(Mr==null?void 0:Mr.headers);return Lr.has("apikey")||Lr.set("apikey",Tr),Lr.has("Authorization")||Lr.set("Authorization",`Bearer ${Nr}`),Ar(Dr,Object.assign(Object.assign({},Mr),{headers:Lr}))})};function stripTrailingSlash(Tr){return Tr.replace(/\/$/,"")}function applySettingDefaults(Tr,Cr){const{db:$r,auth:Ar,realtime:Rr,global:Dr}=Tr,{db:Mr,auth:Br,realtime:Nr,global:Lr}=Cr;return{db:Object.assign(Object.assign({},Mr),$r),auth:Object.assign(Object.assign({},Br),Ar),realtime:Object.assign(Object.assign({},Nr),Rr),global:Object.assign(Object.assign({},Lr),Dr)}}function expiresAt(Tr){return Math.round(Date.now()/1e3)+Tr}function uuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(Tr){const Cr=Math.random()*16|0;return(Tr=="x"?Cr:Cr&3|8).toString(16)})}const isBrowser$2=()=>typeof document<"u",localStorageWriteTests={tested:!1,writable:!1},supportsLocalStorage=()=>{if(!isBrowser$2())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(localStorageWriteTests.tested)return localStorageWriteTests.writable;const Tr=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(Tr,Tr),globalThis.localStorage.removeItem(Tr),localStorageWriteTests.tested=!0,localStorageWriteTests.writable=!0}catch{localStorageWriteTests.tested=!0,localStorageWriteTests.writable=!1}return localStorageWriteTests.writable};function parseParametersFromURL(Tr){const Cr={},$r=new URL(Tr);if($r.hash&&$r.hash[0]==="#")try{new URLSearchParams($r.hash.substring(1)).forEach((Rr,Dr)=>{Cr[Dr]=Rr})}catch{}return $r.searchParams.forEach((Ar,Rr)=>{Cr[Rr]=Ar}),Cr}const resolveFetch=Tr=>{let Cr;return Tr?Cr=Tr:typeof fetch>"u"?Cr=(...$r)=>__vitePreload(()=>Promise.resolve().then(()=>browser$2),void 0,import.meta.url).then(({default:Ar})=>Ar(...$r)):Cr=fetch,(...$r)=>Cr(...$r)},looksLikeFetchResponse=Tr=>typeof Tr=="object"&&Tr!==null&&"status"in Tr&&"ok"in Tr&&"json"in Tr&&typeof Tr.json=="function",setItemAsync=async(Tr,Cr,$r)=>{await Tr.setItem(Cr,JSON.stringify($r))},getItemAsync=async(Tr,Cr)=>{const $r=await Tr.getItem(Cr);if(!$r)return null;try{return JSON.parse($r)}catch{return $r}},removeItemAsync=async(Tr,Cr)=>{await Tr.removeItem(Cr)};function decodeBase64URL(Tr){const Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let $r="",Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr=0;for(Tr=Tr.replace("-","+").replace("_","/");Hr>4,Rr=(Br&15)<<4|Nr>>2,Dr=(Nr&3)<<6|Lr,$r=$r+String.fromCharCode(Ar),Nr!=64&&Rr!=0&&($r=$r+String.fromCharCode(Rr)),Lr!=64&&Dr!=0&&($r=$r+String.fromCharCode(Dr));return $r}class Deferred{constructor(){this.promise=new Deferred.promiseConstructor((Cr,$r)=>{this.resolve=Cr,this.reject=$r})}}Deferred.promiseConstructor=Promise;function decodeJWTPayload(Tr){const Cr=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,$r=Tr.split(".");if($r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!Cr.test($r[1]))throw new Error("JWT is not valid: payload is not in base64url format");const Ar=$r[1];return JSON.parse(decodeBase64URL(Ar))}async function sleep$1(Tr){return await new Promise(Cr=>{setTimeout(()=>Cr(null),Tr)})}function retryable(Tr,Cr){return new Promise((Ar,Rr)=>{(async()=>{for(let Dr=0;Dr<1/0;Dr++)try{const Mr=await Tr(Dr);if(!Cr(Dr,null,Mr)){Ar(Mr);return}}catch(Mr){if(!Cr(Dr,Mr)){Rr(Mr);return}}})()})}function dec2hex(Tr){return("0"+Tr.toString(16)).substr(-2)}function generatePKCEVerifier(){const Cr=new Uint32Array(56);if(typeof crypto>"u"){const $r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",Ar=$r.length;let Rr="";for(let Dr=0;Dr<56;Dr++)Rr+=$r.charAt(Math.floor(Math.random()*Ar));return Rr}return crypto.getRandomValues(Cr),Array.from(Cr,dec2hex).join("")}async function sha256(Tr){const $r=new TextEncoder().encode(Tr),Ar=await crypto.subtle.digest("SHA-256",$r),Rr=new Uint8Array(Ar);return Array.from(Rr).map(Dr=>String.fromCharCode(Dr)).join("")}function base64urlencode(Tr){return btoa(Tr).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function generatePKCEChallenge(Tr){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),Tr;const $r=await sha256(Tr);return base64urlencode($r)}class AuthError extends Error{constructor(Cr,$r){super(Cr),this.__isAuthError=!0,this.name="AuthError",this.status=$r}}function isAuthError(Tr){return typeof Tr=="object"&&Tr!==null&&"__isAuthError"in Tr}class AuthApiError extends AuthError{constructor(Cr,$r){super(Cr,$r),this.name="AuthApiError",this.status=$r}toJSON(){return{name:this.name,message:this.message,status:this.status}}}function isAuthApiError(Tr){return isAuthError(Tr)&&Tr.name==="AuthApiError"}class AuthUnknownError extends AuthError{constructor(Cr,$r){super(Cr),this.name="AuthUnknownError",this.originalError=$r}}class CustomAuthError extends AuthError{constructor(Cr,$r,Ar){super(Cr),this.name=$r,this.status=Ar}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class AuthSessionMissingError extends CustomAuthError{constructor(){super("Auth session missing!","AuthSessionMissingError",400)}}class AuthInvalidTokenResponseError extends CustomAuthError{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500)}}class AuthInvalidCredentialsError extends CustomAuthError{constructor(Cr){super(Cr,"AuthInvalidCredentialsError",400)}}class AuthImplicitGrantRedirectError extends CustomAuthError{constructor(Cr,$r=null){super(Cr,"AuthImplicitGrantRedirectError",500),this.details=null,this.details=$r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class AuthPKCEGrantCodeExchangeError extends CustomAuthError{constructor(Cr,$r=null){super(Cr,"AuthPKCEGrantCodeExchangeError",500),this.details=null,this.details=$r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class AuthRetryableFetchError extends CustomAuthError{constructor(Cr,$r){super(Cr,"AuthRetryableFetchError",$r)}}function isAuthRetryableFetchError(Tr){return isAuthError(Tr)&&Tr.name==="AuthRetryableFetchError"}class AuthWeakPasswordError extends CustomAuthError{constructor(Cr,$r,Ar){super(Cr,"AuthWeakPasswordError",$r),this.reasons=Ar}}var __rest$3=globalThis&&globalThis.__rest||function(Tr,Cr){var $r={};for(var Ar in Tr)Object.prototype.hasOwnProperty.call(Tr,Ar)&&Cr.indexOf(Ar)<0&&($r[Ar]=Tr[Ar]);if(Tr!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Rr=0,Ar=Object.getOwnPropertySymbols(Tr);RrTr.msg||Tr.message||Tr.error_description||Tr.error||JSON.stringify(Tr),NETWORK_ERROR_CODES=[502,503,504];async function handleError(Tr){if(!looksLikeFetchResponse(Tr))throw new AuthRetryableFetchError(_getErrorMessage(Tr),0);if(NETWORK_ERROR_CODES.includes(Tr.status))throw new AuthRetryableFetchError(_getErrorMessage(Tr),Tr.status);let Cr;try{Cr=await Tr.json()}catch($r){throw new AuthUnknownError(_getErrorMessage($r),$r)}throw typeof Cr=="object"&&Cr&&typeof Cr.weak_password=="object"&&Cr.weak_password&&Array.isArray(Cr.weak_password.reasons)&&Cr.weak_password.reasons.length&&Cr.weak_password.reasons.reduce(($r,Ar)=>$r&&typeof Ar=="string",!0)?new AuthWeakPasswordError(_getErrorMessage(Cr),Tr.status,Cr.weak_password.reasons):new AuthApiError(_getErrorMessage(Cr),Tr.status||500)}const _getRequestParams=(Tr,Cr,$r,Ar)=>{const Rr={method:Tr,headers:(Cr==null?void 0:Cr.headers)||{}};return Tr==="GET"?Rr:(Rr.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},Cr==null?void 0:Cr.headers),Rr.body=JSON.stringify(Ar),Object.assign(Object.assign({},Rr),$r))};async function _request(Tr,Cr,$r,Ar){var Rr;const Dr=Object.assign({},Ar==null?void 0:Ar.headers);Ar!=null&&Ar.jwt&&(Dr.Authorization=`Bearer ${Ar.jwt}`);const Mr=(Rr=Ar==null?void 0:Ar.query)!==null&&Rr!==void 0?Rr:{};Ar!=null&&Ar.redirectTo&&(Mr.redirect_to=Ar.redirectTo);const Br=Object.keys(Mr).length?"?"+new URLSearchParams(Mr).toString():"",Nr=await _handleRequest(Tr,Cr,$r+Br,{headers:Dr,noResolveJson:Ar==null?void 0:Ar.noResolveJson},{},Ar==null?void 0:Ar.body);return Ar!=null&&Ar.xform?Ar==null?void 0:Ar.xform(Nr):{data:Object.assign({},Nr),error:null}}async function _handleRequest(Tr,Cr,$r,Ar,Rr,Dr){const Mr=_getRequestParams(Cr,Ar,Rr,Dr);let Br;try{Br=await Tr($r,Mr)}catch(Nr){throw console.error(Nr),new AuthRetryableFetchError(_getErrorMessage(Nr),0)}if(Br.ok||await handleError(Br),Ar!=null&&Ar.noResolveJson)return Br;try{return await Br.json()}catch(Nr){await handleError(Nr)}}function _sessionResponse(Tr){var Cr;let $r=null;hasSession(Tr)&&($r=Object.assign({},Tr),Tr.expires_at||($r.expires_at=expiresAt(Tr.expires_in)));const Ar=(Cr=Tr.user)!==null&&Cr!==void 0?Cr:Tr;return{data:{session:$r,user:Ar},error:null}}function _sessionResponsePassword(Tr){const Cr=_sessionResponse(Tr);return!Cr.error&&Tr.weak_password&&typeof Tr.weak_password=="object"&&Array.isArray(Tr.weak_password.reasons)&&Tr.weak_password.reasons.length&&Tr.weak_password.message&&typeof Tr.weak_password.message=="string"&&Tr.weak_password.reasons.reduce(($r,Ar)=>$r&&typeof Ar=="string",!0)&&(Cr.data.weak_password=Tr.weak_password),Cr}function _userResponse(Tr){var Cr;return{data:{user:(Cr=Tr.user)!==null&&Cr!==void 0?Cr:Tr},error:null}}function _ssoResponse(Tr){return{data:Tr,error:null}}function _generateLinkResponse(Tr){const{action_link:Cr,email_otp:$r,hashed_token:Ar,redirect_to:Rr,verification_type:Dr}=Tr,Mr=__rest$3(Tr,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),Br={action_link:Cr,email_otp:$r,hashed_token:Ar,redirect_to:Rr,verification_type:Dr},Nr=Object.assign({},Mr);return{data:{properties:Br,user:Nr},error:null}}function _noResolveJsonResponse(Tr){return Tr}function hasSession(Tr){return Tr.access_token&&Tr.refresh_token&&Tr.expires_in}var __rest$2=globalThis&&globalThis.__rest||function(Tr,Cr){var $r={};for(var Ar in Tr)Object.prototype.hasOwnProperty.call(Tr,Ar)&&Cr.indexOf(Ar)<0&&($r[Ar]=Tr[Ar]);if(Tr!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Rr=0,Ar=Object.getOwnPropertySymbols(Tr);Rr0&&(Vr.forEach(jr=>{const Gr=parseInt(jr.split(";")[0].split("=")[1].substring(0,1)),Xr=JSON.parse(jr.split(";")[1].split("=")[1]);Lr[`${Xr}Page`]=Gr}),Lr.total=parseInt(Ur)),{data:Object.assign(Object.assign({},zr),Lr),error:null}}catch(Lr){if(isAuthError(Lr))return{data:{users:[]},error:Lr};throw Lr}}async getUserById(Cr){try{return await _request(this.fetch,"GET",`${this.url}/admin/users/${Cr}`,{headers:this.headers,xform:_userResponse})}catch($r){if(isAuthError($r))return{data:{user:null},error:$r};throw $r}}async updateUserById(Cr,$r){try{return await _request(this.fetch,"PUT",`${this.url}/admin/users/${Cr}`,{body:$r,headers:this.headers,xform:_userResponse})}catch(Ar){if(isAuthError(Ar))return{data:{user:null},error:Ar};throw Ar}}async deleteUser(Cr,$r=!1){try{return await _request(this.fetch,"DELETE",`${this.url}/admin/users/${Cr}`,{headers:this.headers,body:{should_soft_delete:$r},xform:_userResponse})}catch(Ar){if(isAuthError(Ar))return{data:{user:null},error:Ar};throw Ar}}async _listFactors(Cr){try{const{data:$r,error:Ar}=await _request(this.fetch,"GET",`${this.url}/admin/users/${Cr.userId}/factors`,{headers:this.headers,xform:Rr=>({data:{factors:Rr},error:null})});return{data:$r,error:Ar}}catch($r){if(isAuthError($r))return{data:null,error:$r};throw $r}}async _deleteFactor(Cr){try{return{data:await _request(this.fetch,"DELETE",`${this.url}/admin/users/${Cr.userId}/factors/${Cr.id}`,{headers:this.headers}),error:null}}catch($r){if(isAuthError($r))return{data:null,error:$r};throw $r}}}const version="2.62.0",GOTRUE_URL="http://localhost:9999",STORAGE_KEY="supabase.auth.token",DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${version}`},EXPIRY_MARGIN=10,localStorageAdapter={getItem:Tr=>supportsLocalStorage()?globalThis.localStorage.getItem(Tr):null,setItem:(Tr,Cr)=>{supportsLocalStorage()&&globalThis.localStorage.setItem(Tr,Cr)},removeItem:Tr=>{supportsLocalStorage()&&globalThis.localStorage.removeItem(Tr)}};function memoryLocalStorageAdapter(Tr={}){return{getItem:Cr=>Tr[Cr]||null,setItem:(Cr,$r)=>{Tr[Cr]=$r},removeItem:Cr=>{delete Tr[Cr]}}}function polyfillGlobalThis(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const internals={debug:!!(globalThis&&supportsLocalStorage()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class LockAcquireTimeoutError extends Error{constructor(Cr){super(Cr),this.isAcquireTimeout=!0}}class NavigatorLockAcquireTimeoutError extends LockAcquireTimeoutError{}async function navigatorLock(Tr,Cr,$r){internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",Tr,Cr);const Ar=new globalThis.AbortController;return Cr>0&&setTimeout(()=>{Ar.abort(),internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",Tr)},Cr),await globalThis.navigator.locks.request(Tr,Cr===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:Ar.signal},async Rr=>{if(Rr){internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",Tr,Rr.name);try{return await $r()}finally{internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",Tr,Rr.name)}}else{if(Cr===0)throw internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",Tr),new NavigatorLockAcquireTimeoutError(`Acquiring an exclusive Navigator LockManager lock "${Tr}" immediately failed`);if(internals.debug)try{const Dr=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(Dr,null," "))}catch(Dr){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",Dr)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await $r()}})}polyfillGlobalThis();const DEFAULT_OPTIONS$1={url:GOTRUE_URL,storageKey:STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:DEFAULT_HEADERS,flowType:"implicit",debug:!1},AUTO_REFRESH_TICK_DURATION=30*1e3,AUTO_REFRESH_TICK_THRESHOLD=3;async function lockNoOp(Tr,Cr,$r){return await $r()}class GoTrueClient{constructor(Cr){var $r,Ar;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=GoTrueClient.nextInstanceID,GoTrueClient.nextInstanceID+=1,this.instanceID>0&&isBrowser$2()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const Rr=Object.assign(Object.assign({},DEFAULT_OPTIONS$1),Cr);if(this.logDebugMessages=!!Rr.debug,typeof Rr.debug=="function"&&(this.logger=Rr.debug),this.persistSession=Rr.persistSession,this.storageKey=Rr.storageKey,this.autoRefreshToken=Rr.autoRefreshToken,this.admin=new GoTrueAdminApi({url:Rr.url,headers:Rr.headers,fetch:Rr.fetch}),this.url=Rr.url,this.headers=Rr.headers,this.fetch=resolveFetch(Rr.fetch),this.lock=Rr.lock||lockNoOp,this.detectSessionInUrl=Rr.detectSessionInUrl,this.flowType=Rr.flowType,Rr.lock?this.lock=Rr.lock:isBrowser$2()&&(!(($r=globalThis==null?void 0:globalThis.navigator)===null||$r===void 0)&&$r.locks)?this.lock=navigatorLock:this.lock=lockNoOp,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?Rr.storage?this.storage=Rr.storage:supportsLocalStorage()?this.storage=localStorageAdapter:(this.memoryStorage={},this.storage=memoryLocalStorageAdapter(this.memoryStorage)):(this.memoryStorage={},this.storage=memoryLocalStorageAdapter(this.memoryStorage)),isBrowser$2()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(Dr){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",Dr)}(Ar=this.broadcastChannel)===null||Ar===void 0||Ar.addEventListener("message",async Dr=>{this._debug("received broadcast notification from other tab or client",Dr),await this._notifyAllSubscribers(Dr.data.event,Dr.data.session,!1)})}this.initialize()}_debug(...Cr){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${version}) ${new Date().toISOString()}`,...Cr),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{const Cr=isBrowser$2()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",Cr),Cr||this.detectSessionInUrl&&this._isImplicitGrantFlow()){const{data:$r,error:Ar}=await this._getSessionFromURL(Cr);if(Ar)return this._debug("#_initialize()","error detecting session from URL",Ar),(Ar==null?void 0:Ar.message)==="Identity is already linked"||(Ar==null?void 0:Ar.message)==="Identity is already linked to another user"?{error:Ar}:(await this._removeSession(),{error:Ar});const{session:Rr,redirectType:Dr}=$r;return this._debug("#_initialize()","detected session in URL",Rr,"redirect type",Dr),await this._saveSession(Rr),setTimeout(async()=>{Dr==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",Rr):await this._notifyAllSubscribers("SIGNED_IN",Rr)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(Cr){return isAuthError(Cr)?{error:Cr}:{error:new AuthUnknownError("Unexpected error during initialization",Cr)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signUp(Cr){var $r,Ar,Rr;try{await this._removeSession();let Dr;if("email"in Cr){const{email:Hr,password:zr,options:Ur}=Cr;let Vr=null,jr=null;if(this.flowType==="pkce"){const Gr=generatePKCEVerifier();await setItemAsync(this.storage,`${this.storageKey}-code-verifier`,Gr),Vr=await generatePKCEChallenge(Gr),jr=Gr===Vr?"plain":"s256"}Dr=await _request(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:Ur==null?void 0:Ur.emailRedirectTo,body:{email:Hr,password:zr,data:($r=Ur==null?void 0:Ur.data)!==null&&$r!==void 0?$r:{},gotrue_meta_security:{captcha_token:Ur==null?void 0:Ur.captchaToken},code_challenge:Vr,code_challenge_method:jr},xform:_sessionResponse})}else if("phone"in Cr){const{phone:Hr,password:zr,options:Ur}=Cr;Dr=await _request(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:Hr,password:zr,data:(Ar=Ur==null?void 0:Ur.data)!==null&&Ar!==void 0?Ar:{},channel:(Rr=Ur==null?void 0:Ur.channel)!==null&&Rr!==void 0?Rr:"sms",gotrue_meta_security:{captcha_token:Ur==null?void 0:Ur.captchaToken}},xform:_sessionResponse})}else throw new AuthInvalidCredentialsError("You must provide either an email or phone number and a password");const{data:Mr,error:Br}=Dr;if(Br||!Mr)return{data:{user:null,session:null},error:Br};const Nr=Mr.session,Lr=Mr.user;return Mr.session&&(await this._saveSession(Mr.session),await this._notifyAllSubscribers("SIGNED_IN",Nr)),{data:{user:Lr,session:Nr},error:null}}catch(Dr){if(isAuthError(Dr))return{data:{user:null,session:null},error:Dr};throw Dr}}async signInWithPassword(Cr){try{await this._removeSession();let $r;if("email"in Cr){const{email:Dr,password:Mr,options:Br}=Cr;$r=await _request(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:Dr,password:Mr,gotrue_meta_security:{captcha_token:Br==null?void 0:Br.captchaToken}},xform:_sessionResponsePassword})}else if("phone"in Cr){const{phone:Dr,password:Mr,options:Br}=Cr;$r=await _request(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:Dr,password:Mr,gotrue_meta_security:{captcha_token:Br==null?void 0:Br.captchaToken}},xform:_sessionResponsePassword})}else throw new AuthInvalidCredentialsError("You must provide either an email or phone number and a password");const{data:Ar,error:Rr}=$r;return Rr?{data:{user:null,session:null},error:Rr}:!Ar||!Ar.session||!Ar.user?{data:{user:null,session:null},error:new AuthInvalidTokenResponseError}:(Ar.session&&(await this._saveSession(Ar.session),await this._notifyAllSubscribers("SIGNED_IN",Ar.session)),{data:Object.assign({user:Ar.user,session:Ar.session},Ar.weak_password?{weakPassword:Ar.weak_password}:null),error:Rr})}catch($r){if(isAuthError($r))return{data:{user:null,session:null},error:$r};throw $r}}async signInWithOAuth(Cr){var $r,Ar,Rr,Dr;return await this._removeSession(),await this._handleProviderSignIn(Cr.provider,{redirectTo:($r=Cr.options)===null||$r===void 0?void 0:$r.redirectTo,scopes:(Ar=Cr.options)===null||Ar===void 0?void 0:Ar.scopes,queryParams:(Rr=Cr.options)===null||Rr===void 0?void 0:Rr.queryParams,skipBrowserRedirect:(Dr=Cr.options)===null||Dr===void 0?void 0:Dr.skipBrowserRedirect})}async exchangeCodeForSession(Cr){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(Cr))}async _exchangeCodeForSession(Cr){const $r=await getItemAsync(this.storage,`${this.storageKey}-code-verifier`),[Ar,Rr]=($r??"").split("/"),{data:Dr,error:Mr}=await _request(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:Cr,code_verifier:Ar},xform:_sessionResponse});return await removeItemAsync(this.storage,`${this.storageKey}-code-verifier`),Mr?{data:{user:null,session:null,redirectType:null},error:Mr}:!Dr||!Dr.session||!Dr.user?{data:{user:null,session:null,redirectType:null},error:new AuthInvalidTokenResponseError}:(Dr.session&&(await this._saveSession(Dr.session),await this._notifyAllSubscribers("SIGNED_IN",Dr.session)),{data:Object.assign(Object.assign({},Dr),{redirectType:Rr??null}),error:Mr})}async signInWithIdToken(Cr){await this._removeSession();try{const{options:$r,provider:Ar,token:Rr,access_token:Dr,nonce:Mr}=Cr,Br=await _request(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:Ar,id_token:Rr,access_token:Dr,nonce:Mr,gotrue_meta_security:{captcha_token:$r==null?void 0:$r.captchaToken}},xform:_sessionResponse}),{data:Nr,error:Lr}=Br;return Lr?{data:{user:null,session:null},error:Lr}:!Nr||!Nr.session||!Nr.user?{data:{user:null,session:null},error:new AuthInvalidTokenResponseError}:(Nr.session&&(await this._saveSession(Nr.session),await this._notifyAllSubscribers("SIGNED_IN",Nr.session)),{data:Nr,error:Lr})}catch($r){if(isAuthError($r))return{data:{user:null,session:null},error:$r};throw $r}}async signInWithOtp(Cr){var $r,Ar,Rr,Dr,Mr;try{if(await this._removeSession(),"email"in Cr){const{email:Br,options:Nr}=Cr;let Lr=null,Hr=null;if(this.flowType==="pkce"){const Ur=generatePKCEVerifier();await setItemAsync(this.storage,`${this.storageKey}-code-verifier`,Ur),Lr=await generatePKCEChallenge(Ur),Hr=Ur===Lr?"plain":"s256"}const{error:zr}=await _request(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:Br,data:($r=Nr==null?void 0:Nr.data)!==null&&$r!==void 0?$r:{},create_user:(Ar=Nr==null?void 0:Nr.shouldCreateUser)!==null&&Ar!==void 0?Ar:!0,gotrue_meta_security:{captcha_token:Nr==null?void 0:Nr.captchaToken},code_challenge:Lr,code_challenge_method:Hr},redirectTo:Nr==null?void 0:Nr.emailRedirectTo});return{data:{user:null,session:null},error:zr}}if("phone"in Cr){const{phone:Br,options:Nr}=Cr,{data:Lr,error:Hr}=await _request(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:Br,data:(Rr=Nr==null?void 0:Nr.data)!==null&&Rr!==void 0?Rr:{},create_user:(Dr=Nr==null?void 0:Nr.shouldCreateUser)!==null&&Dr!==void 0?Dr:!0,gotrue_meta_security:{captcha_token:Nr==null?void 0:Nr.captchaToken},channel:(Mr=Nr==null?void 0:Nr.channel)!==null&&Mr!==void 0?Mr:"sms"}});return{data:{user:null,session:null,messageId:Lr==null?void 0:Lr.message_id},error:Hr}}throw new AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(Br){if(isAuthError(Br))return{data:{user:null,session:null},error:Br};throw Br}}async verifyOtp(Cr){var $r,Ar;try{Cr.type!=="email_change"&&Cr.type!=="phone_change"&&await this._removeSession();let Rr,Dr;"options"in Cr&&(Rr=($r=Cr.options)===null||$r===void 0?void 0:$r.redirectTo,Dr=(Ar=Cr.options)===null||Ar===void 0?void 0:Ar.captchaToken);const{data:Mr,error:Br}=await _request(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},Cr),{gotrue_meta_security:{captcha_token:Dr}}),redirectTo:Rr,xform:_sessionResponse});if(Br)throw Br;if(!Mr)throw new Error("An error occurred on token verification.");const Nr=Mr.session,Lr=Mr.user;return Nr!=null&&Nr.access_token&&(await this._saveSession(Nr),await this._notifyAllSubscribers("SIGNED_IN",Nr)),{data:{user:Lr,session:Nr},error:null}}catch(Rr){if(isAuthError(Rr))return{data:{user:null,session:null},error:Rr};throw Rr}}async signInWithSSO(Cr){var $r,Ar,Rr;try{await this._removeSession();let Dr=null,Mr=null;if(this.flowType==="pkce"){const Br=generatePKCEVerifier();await setItemAsync(this.storage,`${this.storageKey}-code-verifier`,Br),Dr=await generatePKCEChallenge(Br),Mr=Br===Dr?"plain":"s256"}return await _request(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in Cr?{provider_id:Cr.providerId}:null),"domain"in Cr?{domain:Cr.domain}:null),{redirect_to:(Ar=($r=Cr.options)===null||$r===void 0?void 0:$r.redirectTo)!==null&&Ar!==void 0?Ar:void 0}),!((Rr=Cr==null?void 0:Cr.options)===null||Rr===void 0)&&Rr.captchaToken?{gotrue_meta_security:{captcha_token:Cr.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:Dr,code_challenge_method:Mr}),headers:this.headers,xform:_ssoResponse})}catch(Dr){if(isAuthError(Dr))return{data:null,error:Dr};throw Dr}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async Cr=>{const{data:{session:$r},error:Ar}=Cr;if(Ar)throw Ar;if(!$r)throw new AuthSessionMissingError;const{error:Rr}=await _request(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:$r.access_token});return{data:{user:null,session:null},error:Rr}})}catch(Cr){if(isAuthError(Cr))return{data:{user:null,session:null},error:Cr};throw Cr}}async resend(Cr){try{Cr.type!="email_change"&&Cr.type!="phone_change"&&await this._removeSession();const $r=`${this.url}/resend`;if("email"in Cr){const{email:Ar,type:Rr,options:Dr}=Cr,{error:Mr}=await _request(this.fetch,"POST",$r,{headers:this.headers,body:{email:Ar,type:Rr,gotrue_meta_security:{captcha_token:Dr==null?void 0:Dr.captchaToken}},redirectTo:Dr==null?void 0:Dr.emailRedirectTo});return{data:{user:null,session:null},error:Mr}}else if("phone"in Cr){const{phone:Ar,type:Rr,options:Dr}=Cr,{data:Mr,error:Br}=await _request(this.fetch,"POST",$r,{headers:this.headers,body:{phone:Ar,type:Rr,gotrue_meta_security:{captcha_token:Dr==null?void 0:Dr.captchaToken}}});return{data:{user:null,session:null,messageId:Mr==null?void 0:Mr.message_id},error:Br}}throw new AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch($r){if(isAuthError($r))return{data:{user:null,session:null},error:$r};throw $r}}async getSession(){return await this.initializePromise,this._acquireLock(-1,async()=>this._useSession(async Cr=>Cr))}async _acquireLock(Cr,$r){this._debug("#_acquireLock","begin",Cr);try{if(this.lockAcquired){const Ar=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),Rr=(async()=>(await Ar,await $r()))();return this.pendingInLock.push((async()=>{try{await Rr}catch{}})()),Rr}return await this.lock(`lock:${this.storageKey}`,Cr,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const Ar=$r();for(this.pendingInLock.push((async()=>{try{await Ar}catch{}})()),await Ar;this.pendingInLock.length;){const Rr=[...this.pendingInLock];await Promise.all(Rr),this.pendingInLock.splice(0,Rr.length)}return await Ar}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(Cr){this._debug("#_useSession","begin");try{const $r=await this.__loadSession();return await Cr($r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let Cr=null;const $r=await getItemAsync(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",$r),$r!==null&&(this._isValidSession($r)?Cr=$r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!Cr)return{data:{session:null},error:null};const Ar=Cr.expires_at?Cr.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${Ar?"":" not"} expired`,"expires_at",Cr.expires_at),!Ar)return{data:{session:Cr},error:null};const{session:Rr,error:Dr}=await this._callRefreshToken(Cr.refresh_token);return Dr?{data:{session:null},error:Dr}:{data:{session:Rr},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(Cr){return Cr?await this._getUser(Cr):(await this.initializePromise,this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(Cr){try{return Cr?await _request(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:Cr,xform:_userResponse}):await this._useSession(async $r=>{var Ar,Rr;const{data:Dr,error:Mr}=$r;if(Mr)throw Mr;return await _request(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(Rr=(Ar=Dr.session)===null||Ar===void 0?void 0:Ar.access_token)!==null&&Rr!==void 0?Rr:void 0,xform:_userResponse})})}catch($r){if(isAuthError($r))return{data:{user:null},error:$r};throw $r}}async updateUser(Cr,$r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(Cr,$r))}async _updateUser(Cr,$r={}){try{return await this._useSession(async Ar=>{const{data:Rr,error:Dr}=Ar;if(Dr)throw Dr;if(!Rr.session)throw new AuthSessionMissingError;const Mr=Rr.session;let Br=null,Nr=null;if(this.flowType==="pkce"&&Cr.email!=null){const zr=generatePKCEVerifier();await setItemAsync(this.storage,`${this.storageKey}-code-verifier`,zr),Br=await generatePKCEChallenge(zr),Nr=zr===Br?"plain":"s256"}const{data:Lr,error:Hr}=await _request(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:$r==null?void 0:$r.emailRedirectTo,body:Object.assign(Object.assign({},Cr),{code_challenge:Br,code_challenge_method:Nr}),jwt:Mr.access_token,xform:_userResponse});if(Hr)throw Hr;return Mr.user=Lr.user,await this._saveSession(Mr),await this._notifyAllSubscribers("USER_UPDATED",Mr),{data:{user:Mr.user},error:null}})}catch(Ar){if(isAuthError(Ar))return{data:{user:null},error:Ar};throw Ar}}_decodeJWT(Cr){return decodeJWTPayload(Cr)}async setSession(Cr){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(Cr))}async _setSession(Cr){try{if(!Cr.access_token||!Cr.refresh_token)throw new AuthSessionMissingError;const $r=Date.now()/1e3;let Ar=$r,Rr=!0,Dr=null;const Mr=decodeJWTPayload(Cr.access_token);if(Mr.exp&&(Ar=Mr.exp,Rr=Ar<=$r),Rr){const{session:Br,error:Nr}=await this._callRefreshToken(Cr.refresh_token);if(Nr)return{data:{user:null,session:null},error:Nr};if(!Br)return{data:{user:null,session:null},error:null};Dr=Br}else{const{data:Br,error:Nr}=await this._getUser(Cr.access_token);if(Nr)throw Nr;Dr={access_token:Cr.access_token,refresh_token:Cr.refresh_token,user:Br.user,token_type:"bearer",expires_in:Ar-$r,expires_at:Ar},await this._saveSession(Dr),await this._notifyAllSubscribers("SIGNED_IN",Dr)}return{data:{user:Dr.user,session:Dr},error:null}}catch($r){if(isAuthError($r))return{data:{session:null,user:null},error:$r};throw $r}}async refreshSession(Cr){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(Cr))}async _refreshSession(Cr){try{return await this._useSession(async $r=>{var Ar;if(!Cr){const{data:Mr,error:Br}=$r;if(Br)throw Br;Cr=(Ar=Mr.session)!==null&&Ar!==void 0?Ar:void 0}if(!(Cr!=null&&Cr.refresh_token))throw new AuthSessionMissingError;const{session:Rr,error:Dr}=await this._callRefreshToken(Cr.refresh_token);return Dr?{data:{user:null,session:null},error:Dr}:Rr?{data:{user:Rr.user,session:Rr},error:null}:{data:{user:null,session:null},error:null}})}catch($r){if(isAuthError($r))return{data:{user:null,session:null},error:$r};throw $r}}async _getSessionFromURL(Cr){try{if(!isBrowser$2())throw new AuthImplicitGrantRedirectError("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!Cr)throw new AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");const $r=parseParametersFromURL(window.location.href);if(Cr){if(!$r.code)throw new AuthPKCEGrantCodeExchangeError("No code detected.");const{data:Zr,error:eo}=await this._exchangeCodeForSession($r.code);if(eo)throw eo;const Wr=new URL(window.location.href);return Wr.searchParams.delete("code"),window.history.replaceState(window.history.state,"",Wr.toString()),{data:{session:Zr.session,redirectType:null},error:null}}if($r.error||$r.error_description||$r.error_code)throw new AuthImplicitGrantRedirectError($r.error_description||"Error in URL with unspecified error_description",{error:$r.error||"unspecified_error",code:$r.error_code||"unspecified_code"});const{provider_token:Ar,provider_refresh_token:Rr,access_token:Dr,refresh_token:Mr,expires_in:Br,expires_at:Nr,token_type:Lr}=$r;if(!Dr||!Br||!Mr||!Lr)throw new AuthImplicitGrantRedirectError("No session defined in URL");const Hr=Math.round(Date.now()/1e3),zr=parseInt(Br);let Ur=Hr+zr;Nr&&(Ur=parseInt(Nr));const Vr=Ur-Hr;Vr*1e3<=AUTO_REFRESH_TICK_DURATION&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${Vr}s, should have been closer to ${zr}s`);const jr=Ur-zr;Hr-jr>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",jr,Ur,Hr):Hr-jr<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clok for skew",jr,Ur,Hr);const{data:Gr,error:Xr}=await this._getUser(Dr);if(Xr)throw Xr;const Kr={provider_token:Ar,provider_refresh_token:Rr,access_token:Dr,expires_in:zr,expires_at:Ur,refresh_token:Mr,token_type:Lr,user:Gr.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:Kr,redirectType:$r.type},error:null}}catch($r){if(isAuthError($r))return{data:{session:null,redirectType:null},error:$r};throw $r}}_isImplicitGrantFlow(){const Cr=parseParametersFromURL(window.location.href);return!!(isBrowser$2()&&(Cr.access_token||Cr.error_description))}async _isPKCEFlow(){const Cr=parseParametersFromURL(window.location.href),$r=await getItemAsync(this.storage,`${this.storageKey}-code-verifier`);return!!(Cr.code&&$r)}async signOut(Cr={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(Cr))}async _signOut({scope:Cr}={scope:"global"}){return await this._useSession(async $r=>{var Ar;const{data:Rr,error:Dr}=$r;if(Dr)return{error:Dr};const Mr=(Ar=Rr.session)===null||Ar===void 0?void 0:Ar.access_token;if(Mr){const{error:Br}=await this.admin.signOut(Mr,Cr);if(Br&&!(isAuthApiError(Br)&&(Br.status===404||Br.status===401)))return{error:Br}}return Cr!=="others"&&(await this._removeSession(),await removeItemAsync(this.storage,`${this.storageKey}-code-verifier`),await this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}})}onAuthStateChange(Cr){const $r=uuid(),Ar={id:$r,callback:Cr,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",$r),this.stateChangeEmitters.delete($r)}};return this._debug("#onAuthStateChange()","registered callback with id",$r),this.stateChangeEmitters.set($r,Ar),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession($r)})))(),{data:{subscription:Ar}}}async _emitInitialSession(Cr){return await this._useSession(async $r=>{var Ar,Rr;try{const{data:{session:Dr},error:Mr}=$r;if(Mr)throw Mr;await((Ar=this.stateChangeEmitters.get(Cr))===null||Ar===void 0?void 0:Ar.callback("INITIAL_SESSION",Dr)),this._debug("INITIAL_SESSION","callback id",Cr,"session",Dr)}catch(Dr){await((Rr=this.stateChangeEmitters.get(Cr))===null||Rr===void 0?void 0:Rr.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",Cr,"error",Dr),console.error(Dr)}})}async resetPasswordForEmail(Cr,$r={}){let Ar=null,Rr=null;if(this.flowType==="pkce"){const Dr=generatePKCEVerifier();await setItemAsync(this.storage,`${this.storageKey}-code-verifier`,`${Dr}/PASSWORD_RECOVERY`),Ar=await generatePKCEChallenge(Dr),Rr=Dr===Ar?"plain":"s256"}try{return await _request(this.fetch,"POST",`${this.url}/recover`,{body:{email:Cr,code_challenge:Ar,code_challenge_method:Rr,gotrue_meta_security:{captcha_token:$r.captchaToken}},headers:this.headers,redirectTo:$r.redirectTo})}catch(Dr){if(isAuthError(Dr))return{data:null,error:Dr};throw Dr}}async getUserIdentities(){var Cr;try{const{data:$r,error:Ar}=await this.getUser();if(Ar)throw Ar;return{data:{identities:(Cr=$r.user.identities)!==null&&Cr!==void 0?Cr:[]},error:null}}catch($r){if(isAuthError($r))return{data:null,error:$r};throw $r}}async linkIdentity(Cr){var $r;try{const{data:Ar,error:Rr}=await this._useSession(async Dr=>{var Mr,Br,Nr,Lr,Hr;const{data:zr,error:Ur}=Dr;if(Ur)throw Ur;const Vr=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,Cr.provider,{redirectTo:(Mr=Cr.options)===null||Mr===void 0?void 0:Mr.redirectTo,scopes:(Br=Cr.options)===null||Br===void 0?void 0:Br.scopes,queryParams:(Nr=Cr.options)===null||Nr===void 0?void 0:Nr.queryParams,skipBrowserRedirect:!0});return await _request(this.fetch,"GET",Vr,{headers:this.headers,jwt:(Hr=(Lr=zr.session)===null||Lr===void 0?void 0:Lr.access_token)!==null&&Hr!==void 0?Hr:void 0})});if(Rr)throw Rr;return isBrowser$2()&&!(!(($r=Cr.options)===null||$r===void 0)&&$r.skipBrowserRedirect)&&window.location.assign(Ar==null?void 0:Ar.url),{data:{provider:Cr.provider,url:Ar==null?void 0:Ar.url},error:null}}catch(Ar){if(isAuthError(Ar))return{data:{provider:Cr.provider,url:null},error:Ar};throw Ar}}async unlinkIdentity(Cr){try{return await this._useSession(async $r=>{var Ar,Rr;const{data:Dr,error:Mr}=$r;if(Mr)throw Mr;return await _request(this.fetch,"DELETE",`${this.url}/user/identities/${Cr.identity_id}`,{headers:this.headers,jwt:(Rr=(Ar=Dr.session)===null||Ar===void 0?void 0:Ar.access_token)!==null&&Rr!==void 0?Rr:void 0})})}catch($r){if(isAuthError($r))return{data:null,error:$r};throw $r}}async _refreshAccessToken(Cr){const $r=`#_refreshAccessToken(${Cr.substring(0,5)}...)`;this._debug($r,"begin");try{const Ar=Date.now();return await retryable(async Rr=>(await sleep$1(Rr*200),this._debug($r,"refreshing attempt",Rr),await _request(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:Cr},headers:this.headers,xform:_sessionResponse})),(Rr,Dr,Mr)=>Mr&&Mr.error&&isAuthRetryableFetchError(Mr.error)&&Date.now()+(Rr+1)*200-Ar{try{await Br.callback(Cr,$r)}catch(Nr){Dr.push(Nr)}});if(await Promise.all(Mr),Dr.length>0){for(let Br=0;Brthis._autoRefreshTokenTick(),AUTO_REFRESH_TICK_DURATION);this.autoRefreshTicker=Cr,Cr&&typeof Cr=="object"&&typeof Cr.unref=="function"?Cr.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(Cr),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const Cr=this.autoRefreshTicker;this.autoRefreshTicker=null,Cr&&clearInterval(Cr)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const Cr=Date.now();try{return await this._useSession(async $r=>{const{data:{session:Ar}}=$r;if(!Ar||!Ar.refresh_token||!Ar.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const Rr=Math.floor((Ar.expires_at*1e3-Cr)/AUTO_REFRESH_TICK_DURATION);this._debug("#_autoRefreshTokenTick()",`access token expires in ${Rr} ticks, a tick lasts ${AUTO_REFRESH_TICK_DURATION}ms, refresh threshold is ${AUTO_REFRESH_TICK_THRESHOLD} ticks`),Rr<=AUTO_REFRESH_TICK_THRESHOLD&&await this._callRefreshToken(Ar.refresh_token)})}catch($r){console.error("Auto refresh tick failed with error. This is likely a transient error.",$r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(Cr){if(Cr.isAcquireTimeout||Cr instanceof LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw Cr}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!isBrowser$2()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(Cr){console.error("_handleVisibilityChange",Cr)}}async _onVisibilityChanged(Cr){const $r=`#_onVisibilityChanged(${Cr})`;this._debug($r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),Cr||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug($r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(Cr,$r,Ar){const Rr=[`provider=${encodeURIComponent($r)}`];if(Ar!=null&&Ar.redirectTo&&Rr.push(`redirect_to=${encodeURIComponent(Ar.redirectTo)}`),Ar!=null&&Ar.scopes&&Rr.push(`scopes=${encodeURIComponent(Ar.scopes)}`),this.flowType==="pkce"){const Dr=generatePKCEVerifier();await setItemAsync(this.storage,`${this.storageKey}-code-verifier`,Dr);const Mr=await generatePKCEChallenge(Dr),Br=Dr===Mr?"plain":"s256";this._debug("PKCE","code verifier",`${Dr.substring(0,5)}...`,"code challenge",Mr,"method",Br);const Nr=new URLSearchParams({code_challenge:`${encodeURIComponent(Mr)}`,code_challenge_method:`${encodeURIComponent(Br)}`});Rr.push(Nr.toString())}if(Ar!=null&&Ar.queryParams){const Dr=new URLSearchParams(Ar.queryParams);Rr.push(Dr.toString())}return Ar!=null&&Ar.skipBrowserRedirect&&Rr.push(`skip_http_redirect=${Ar.skipBrowserRedirect}`),`${Cr}?${Rr.join("&")}`}async _unenroll(Cr){try{return await this._useSession(async $r=>{var Ar;const{data:Rr,error:Dr}=$r;return Dr?{data:null,error:Dr}:await _request(this.fetch,"DELETE",`${this.url}/factors/${Cr.factorId}`,{headers:this.headers,jwt:(Ar=Rr==null?void 0:Rr.session)===null||Ar===void 0?void 0:Ar.access_token})})}catch($r){if(isAuthError($r))return{data:null,error:$r};throw $r}}async _enroll(Cr){try{return await this._useSession(async $r=>{var Ar,Rr;const{data:Dr,error:Mr}=$r;if(Mr)return{data:null,error:Mr};const{data:Br,error:Nr}=await _request(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:Cr.friendlyName,factor_type:Cr.factorType,issuer:Cr.issuer},headers:this.headers,jwt:(Ar=Dr==null?void 0:Dr.session)===null||Ar===void 0?void 0:Ar.access_token});return Nr?{data:null,error:Nr}:(!((Rr=Br==null?void 0:Br.totp)===null||Rr===void 0)&&Rr.qr_code&&(Br.totp.qr_code=`data:image/svg+xml;utf-8,${Br.totp.qr_code}`),{data:Br,error:null})})}catch($r){if(isAuthError($r))return{data:null,error:$r};throw $r}}async _verify(Cr){return this._acquireLock(-1,async()=>{try{return await this._useSession(async $r=>{var Ar;const{data:Rr,error:Dr}=$r;if(Dr)return{data:null,error:Dr};const{data:Mr,error:Br}=await _request(this.fetch,"POST",`${this.url}/factors/${Cr.factorId}/verify`,{body:{code:Cr.code,challenge_id:Cr.challengeId},headers:this.headers,jwt:(Ar=Rr==null?void 0:Rr.session)===null||Ar===void 0?void 0:Ar.access_token});return Br?{data:null,error:Br}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+Mr.expires_in},Mr)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",Mr),{data:Mr,error:Br})})}catch($r){if(isAuthError($r))return{data:null,error:$r};throw $r}})}async _challenge(Cr){return this._acquireLock(-1,async()=>{try{return await this._useSession(async $r=>{var Ar;const{data:Rr,error:Dr}=$r;return Dr?{data:null,error:Dr}:await _request(this.fetch,"POST",`${this.url}/factors/${Cr.factorId}/challenge`,{headers:this.headers,jwt:(Ar=Rr==null?void 0:Rr.session)===null||Ar===void 0?void 0:Ar.access_token})})}catch($r){if(isAuthError($r))return{data:null,error:$r};throw $r}})}async _challengeAndVerify(Cr){const{data:$r,error:Ar}=await this._challenge({factorId:Cr.factorId});return Ar?{data:null,error:Ar}:await this._verify({factorId:Cr.factorId,challengeId:$r.id,code:Cr.code})}async _listFactors(){const{data:{user:Cr},error:$r}=await this.getUser();if($r)return{data:null,error:$r};const Ar=(Cr==null?void 0:Cr.factors)||[],Rr=Ar.filter(Dr=>Dr.factor_type==="totp"&&Dr.status==="verified");return{data:{all:Ar,totp:Rr},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async Cr=>{var $r,Ar;const{data:{session:Rr},error:Dr}=Cr;if(Dr)return{data:null,error:Dr};if(!Rr)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const Mr=this._decodeJWT(Rr.access_token);let Br=null;Mr.aal&&(Br=Mr.aal);let Nr=Br;((Ar=($r=Rr.user.factors)===null||$r===void 0?void 0:$r.filter(zr=>zr.status==="verified"))!==null&&Ar!==void 0?Ar:[]).length>0&&(Nr="aal2");const Hr=Mr.amr||[];return{data:{currentLevel:Br,nextLevel:Nr,currentAuthenticationMethods:Hr},error:null}}))}}GoTrueClient.nextInstanceID=0;class SupabaseAuthClient extends GoTrueClient{constructor(Cr){super(Cr)}}var __awaiter$1=globalThis&&globalThis.__awaiter||function(Tr,Cr,$r,Ar){function Rr(Dr){return Dr instanceof $r?Dr:new $r(function(Mr){Mr(Dr)})}return new($r||($r=Promise))(function(Dr,Mr){function Br(Hr){try{Lr(Ar.next(Hr))}catch(zr){Mr(zr)}}function Nr(Hr){try{Lr(Ar.throw(Hr))}catch(zr){Mr(zr)}}function Lr(Hr){Hr.done?Dr(Hr.value):Rr(Hr.value).then(Br,Nr)}Lr((Ar=Ar.apply(Tr,Cr||[])).next())})};const DEFAULT_GLOBAL_OPTIONS={headers:DEFAULT_HEADERS$1},DEFAULT_DB_OPTIONS={schema:"public"},DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},DEFAULT_REALTIME_OPTIONS={};class SupabaseClient{constructor(Cr,$r,Ar){var Rr,Dr,Mr,Br,Nr,Lr,Hr,zr;if(this.supabaseUrl=Cr,this.supabaseKey=$r,!Cr)throw new Error("supabaseUrl is required.");if(!$r)throw new Error("supabaseKey is required.");const Ur=stripTrailingSlash(Cr);this.realtimeUrl=`${Ur}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${Ur}/auth/v1`,this.storageUrl=`${Ur}/storage/v1`,this.functionsUrl=`${Ur}/functions/v1`;const Vr=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,jr={db:DEFAULT_DB_OPTIONS,realtime:DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},DEFAULT_AUTH_OPTIONS),{storageKey:Vr}),global:DEFAULT_GLOBAL_OPTIONS},Gr=applySettingDefaults(Ar??{},jr);this.storageKey=(Dr=(Rr=Gr.auth)===null||Rr===void 0?void 0:Rr.storageKey)!==null&&Dr!==void 0?Dr:"",this.headers=(Br=(Mr=Gr.global)===null||Mr===void 0?void 0:Mr.headers)!==null&&Br!==void 0?Br:{},this.auth=this._initSupabaseAuthClient((Nr=Gr.auth)!==null&&Nr!==void 0?Nr:{},this.headers,(Lr=Gr.global)===null||Lr===void 0?void 0:Lr.fetch),this.fetch=fetchWithAuth($r,this._getAccessToken.bind(this),(Hr=Gr.global)===null||Hr===void 0?void 0:Hr.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},Gr.realtime)),this.rest=new PostgrestClient(`${Ur}/rest/v1`,{headers:this.headers,schema:(zr=Gr.db)===null||zr===void 0?void 0:zr.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new StorageClient(this.storageUrl,this.headers,this.fetch)}from(Cr){return this.rest.from(Cr)}schema(Cr){return this.rest.schema(Cr)}rpc(Cr,$r={},Ar){return this.rest.rpc(Cr,$r,Ar)}channel(Cr,$r={config:{}}){return this.realtime.channel(Cr,$r)}getChannels(){return this.realtime.getChannels()}removeChannel(Cr){return this.realtime.removeChannel(Cr)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var Cr,$r;return __awaiter$1(this,void 0,void 0,function*(){const{data:Ar}=yield this.auth.getSession();return($r=(Cr=Ar.session)===null||Cr===void 0?void 0:Cr.access_token)!==null&&$r!==void 0?$r:null})}_initSupabaseAuthClient({autoRefreshToken:Cr,persistSession:$r,detectSessionInUrl:Ar,storage:Rr,storageKey:Dr,flowType:Mr,debug:Br},Nr,Lr){const Hr={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},Hr),Nr),storageKey:Dr,autoRefreshToken:Cr,persistSession:$r,detectSessionInUrl:Ar,storage:Rr,flowType:Mr,debug:Br,fetch:Lr})}_initRealtimeClient(Cr){return new RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},Cr),{params:Object.assign({apikey:this.supabaseKey},Cr==null?void 0:Cr.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange(($r,Ar)=>{this._handleTokenChanged($r,"CLIENT",Ar==null?void 0:Ar.access_token)})}_handleTokenChanged(Cr,$r,Ar){(Cr==="TOKEN_REFRESHED"||Cr==="SIGNED_IN")&&this.changedAccessToken!==Ar?(this.realtime.setAuth(Ar??null),this.changedAccessToken=Ar):Cr==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),$r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const createClient=(Tr,Cr,$r)=>new SupabaseClient(Tr,Cr,$r),viteEnv="prod",vitePurpose={}.VITE_PURPOSE,featureFlags={caching:{develop:!1,staging:!1,prod:!1},aiContext:{develop:!0,staging:!0,prod:!1},magazineLayouts:{develop:!0,staging:!0,prod:!0},imageQuickMenu:{develop:!1,staging:!1,prod:!1},followupImages:{develop:!1,staging:!1,prod:!1},environments:{develop:!0,staging:!0,prod:!1},db:{develop:!0,staging:!0,prod:!1},cmdBar:{develop:!0,staging:!0,prod:!0},dynamicColorSwitching:{develop:!1,staging:!1,prod:!1},createStories:{develop:!0,staging:!0,prod:!1},renderStories:{develop:!0,staging:!0,prod:!0},deckTypes:{develop:!0,staging:!0,prod:!1},createProductSummary:{develop:!0,staging:!0,prod:!1},chatBox:{develop:!0,staging:!0,prod:!0},createFolders:{develop:!0,staging:!0,prod:!0},workspace:{develop:!1,staging:!1,prod:!1},billing:{develop:!0,staging:!0,prod:!0},gates:{develop:!0,staging:!0,prod:!0},internalLayoutTemplate:{develop:!0,staging:!0,prod:!1},internalVariableTuning:{develop:!0,staging:!0,prod:!1},shareTab:{develop:!0,staging:!0,prod:!0},websiteView:{develop:!0,staging:!0,prod:!0},blockShrinkingDuringDragging:{develop:!0,staging:!0,prod:!0},dividerGhostDirectionChange:{develop:!0,staging:!0,prod:!0},genCrispBookletFlow:{develop:!0,staging:!0,prod:!0},tableAICmdBar:{develop:!0,staging:!0,prod:!0},infiniteCanvas:{develop:!0,staging:!0,prod:!0},internalPrompt:{develop:!0,staging:!0,prod:!1},emptyPageState:{develop:!0,staging:!0,prod:!0},slideGenFlow:{develop:!0,staging:!0,prod:!0},templateSaver:{develop:!0,staging:!0,prod:!1},homepageDecksOptimization:{develop:!1,staging:!1,prod:!1}},isEnabled=Tr=>{const Cr=featureFlags[Tr];return Cr==null?!1:Cr[viteEnv]},isBehindProGate=Tr=>{const $r={develop:{pdf:!1,deckLimit:!1,logoChange:!1,inviteToWorkspace:!0,inviteToDeck:!0},staging:{pdf:!1,deckLimit:!1,logoChange:!1,inviteToWorkspace:!0,inviteToDeck:!0},prod:{pdf:!1,deckLimit:!1,logoChange:!1,inviteToWorkspace:!0,inviteToDeck:!0}}[viteEnv];return $r==null?!1:$r[Tr]||!1},isBlockEnabled=Tr=>{const $r={divider:{develop:!0,staging:!0,prod:!0},webpage:{develop:!0,staging:!0,prod:!0},bookmark:{develop:!0,staging:!0,prod:!0}}[Tr];return $r==null?!1:$r[viteEnv]},isStorytime=()=>vitePurpose==="storytime",canRenderStories=()=>isStorytime()||isEnabled("renderStories"),emptyFn=()=>{},log=emptyFn,SUPABASE_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im51Y2duYmhtbXFnd2dtaXZ6Y3J6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2NzAwMDkyMDQsImV4cCI6MTk4NTU4NTIwNH0.klzLVEUCwOHcV-aCU0zaWjWf57D9rp1hH-VhGuXKqIk",SUPABASE_URL$1="https://auth.prezo.ai",SUPABASE_URL_OG$1="https://nucgnbhmmqgwgmivzcrz.supabase.co",IS_DEV=!1,IS_STAGING=!1,IS_PROD=!0,IS_CLIENT=!0,APP_URL=()=>"https://prezo.ai";function getSupabaseConfig(){return{URL:SUPABASE_URL$1,KEY:SUPABASE_KEY,OG:SUPABASE_URL_OG$1}}isEnabled("environments");const{URL:URL$1,KEY,OG,FN_URL}=getSupabaseConfig();class SupabaseWrapper{static getTransformedUrl(Cr,$r){if(!Cr.includes("supabase.co"))return Cr;const Ar=Cr.split("/"),Rr=Ar.findIndex(Nr=>Nr==="users"),Dr=Ar.splice(Rr).join("/"),Mr="assets",{data:Br}=this.ogClient.storage.from(Mr).getPublicUrl(Dr,{transform:$r??{}});return Br.publicUrl}static getOptimizedImageUrl(Cr,$r){if(!Cr.includes("supabase.co")||Cr.includes("public/layouts-pro"))return Cr;if(Cr.includes(".heic")||Cr.includes(".heif"))return this.getTransformedUrl(Cr,$r);if(![".svg",".webp",".png",".jpg",".jpeg",".jfif",".pjpeg",".pjp",".gif"].some(Ar=>Cr.includes(Ar)))return Cr;{let Ar=Cr.replace("render/image","object");Cr.startsWith(this.cloudflareZone)&&(Ar=`https${Cr.split("https").slice(-1)[0]}`);const Rr=($r==null?void 0:$r.cfFormat)??"auto";return`${this.cloudflareZone}/cdn-cgi/image/format=${Rr}${$r!=null&&$r.background?`,background=${encodeURIComponent($r.background)}`:""}${$r!=null&&$r.width?`,width=${$r.width}`:""}${$r!=null&&$r.height?`,height=${$r.height}`:""},fit=scale-down/${Ar}`}}}Fa(SupabaseWrapper,"client",createClient(URL$1,KEY,{auth:{persistSession:IS_CLIENT}})),Fa(SupabaseWrapper,"ogClient",createClient(OG,KEY,{auth:{persistSession:IS_CLIENT}})),Fa(SupabaseWrapper,"cloudflareZone","https://prod.shareprezo.com");SupabaseWrapper.client.auth.onAuthStateChange((Tr,Cr)=>{if(IS_CLIENT)if(Tr==="SIGNED_OUT"){const $r=new Date(0).toUTCString();document.cookie=`access-token=; path=/; expires=${$r}; SameSite=Lax; secure`,document.cookie=`refresh-token=; path=/; expires=${$r}; SameSite=Lax; secure`}else(Tr==="SIGNED_IN"||Tr==="TOKEN_REFRESHED")&&Cr&&(document.cookie=`access-token=${Cr.access_token}; path=/; max-age=2592000; SameSite=Lax; secure`,document.cookie=`refresh-token=${Cr.refresh_token}; path=/; max-age=2592000; SameSite=Lax; secure`)});const isVue2=!1;/*! * pinia v2.0.21 * (c) 2022 Eduardo San Martin Morote * @license MIT */let activePinia;const setActivePinia=Tr=>activePinia=Tr,piniaSymbol=Symbol();function isPlainObject$2(Tr){return Tr&&typeof Tr=="object"&&Object.prototype.toString.call(Tr)==="[object Object]"&&typeof Tr.toJSON!="function"}var MutationType;(function(Tr){Tr.direct="direct",Tr.patchObject="patch object",Tr.patchFunction="patch function"})(MutationType||(MutationType={}));function createPinia(){const Tr=effectScope(!0),Cr=Tr.run(()=>ref({}));let $r=[],Ar=[];const Rr=markRaw({install(Dr){setActivePinia(Rr),Rr._a=Dr,Dr.provide(piniaSymbol,Rr),Dr.config.globalProperties.$pinia=Rr,Ar.forEach(Mr=>$r.push(Mr)),Ar=[]},use(Dr){return!this._a&&!isVue2?Ar.push(Dr):$r.push(Dr),this},_p:$r,_a:null,_e:Tr,_s:new Map,state:Cr});return Rr}const noop$2=()=>{};function addSubscription(Tr,Cr,$r,Ar=noop$2){Tr.push(Cr);const Rr=()=>{const Dr=Tr.indexOf(Cr);Dr>-1&&(Tr.splice(Dr,1),Ar())};return!$r&&getCurrentInstance()&&onUnmounted(Rr),Rr}function triggerSubscriptions(Tr,...Cr){Tr.slice().forEach($r=>{$r(...Cr)})}function mergeReactiveObjects(Tr,Cr){for(const $r in Cr){if(!Cr.hasOwnProperty($r))continue;const Ar=Cr[$r],Rr=Tr[$r];isPlainObject$2(Rr)&&isPlainObject$2(Ar)&&Tr.hasOwnProperty($r)&&!isRef(Ar)&&!isReactive(Ar)?Tr[$r]=mergeReactiveObjects(Rr,Ar):Tr[$r]=Ar}return Tr}const skipHydrateSymbol=Symbol();function shouldHydrate(Tr){return!isPlainObject$2(Tr)||!Tr.hasOwnProperty(skipHydrateSymbol)}const{assign:assign$5}=Object;function isComputed(Tr){return!!(isRef(Tr)&&Tr.effect)}function createOptionsStore(Tr,Cr,$r,Ar){const{state:Rr,actions:Dr,getters:Mr}=Cr,Br=$r.state.value[Tr];let Nr;function Lr(){Br||($r.state.value[Tr]=Rr?Rr():{});const Hr=toRefs$1($r.state.value[Tr]);return assign$5(Hr,Dr,Object.keys(Mr||{}).reduce((zr,Ur)=>(zr[Ur]=markRaw(computed(()=>{setActivePinia($r);const Vr=$r._s.get(Tr);return Mr[Ur].call(Vr,Vr)})),zr),{}))}return Nr=createSetupStore(Tr,Lr,Cr,$r,Ar,!0),Nr.$reset=function(){const zr=Rr?Rr():{};this.$patch(Ur=>{assign$5(Ur,zr)})},Nr}function createSetupStore(Tr,Cr,$r={},Ar,Rr,Dr){let Mr;const Br=assign$5({actions:{}},$r),Nr={deep:!0};let Lr,Hr,zr=markRaw([]),Ur=markRaw([]),Vr;const jr=Ar.state.value[Tr];!Dr&&!jr&&(Ar.state.value[Tr]={}),ref({});let Gr;function Xr(no){let ro;Lr=Hr=!1,typeof no=="function"?(no(Ar.state.value[Tr]),ro={type:MutationType.patchFunction,storeId:Tr,events:Vr}):(mergeReactiveObjects(Ar.state.value[Tr],no),ro={type:MutationType.patchObject,payload:no,storeId:Tr,events:Vr});const so=Gr=Symbol();nextTick().then(()=>{Gr===so&&(Lr=!0)}),Hr=!0,triggerSubscriptions(zr,ro,Ar.state.value[Tr])}const Kr=noop$2;function Zr(){Mr.stop(),zr=[],Ur=[],Ar._s.delete(Tr)}function eo(no,ro){return function(){setActivePinia(Ar);const so=Array.from(arguments),ao=[],lo=[];function po(mo){ao.push(mo)}function go(mo){lo.push(mo)}triggerSubscriptions(Ur,{args:so,name:no,store:Yr,after:po,onError:go});let co;try{co=ro.apply(this&&this.$id===Tr?this:Yr,so)}catch(mo){throw triggerSubscriptions(lo,mo),mo}return co instanceof Promise?co.then(mo=>(triggerSubscriptions(ao,mo),mo)).catch(mo=>(triggerSubscriptions(lo,mo),Promise.reject(mo))):(triggerSubscriptions(ao,co),co)}}const Wr={_p:Ar,$id:Tr,$onAction:addSubscription.bind(null,Ur),$patch:Xr,$reset:Kr,$subscribe(no,ro={}){const so=addSubscription(zr,no,ro.detached,()=>ao()),ao=Mr.run(()=>watch(()=>Ar.state.value[Tr],lo=>{(ro.flush==="sync"?Hr:Lr)&&no({storeId:Tr,type:MutationType.direct,events:Vr},lo)},assign$5({},Nr,ro)));return so},$dispose:Zr},Yr=reactive(assign$5({},Wr));Ar._s.set(Tr,Yr);const Jr=Ar._e.run(()=>(Mr=effectScope(),Mr.run(()=>Cr())));for(const no in Jr){const ro=Jr[no];if(isRef(ro)&&!isComputed(ro)||isReactive(ro))Dr||(jr&&shouldHydrate(ro)&&(isRef(ro)?ro.value=jr[no]:mergeReactiveObjects(ro,jr[no])),Ar.state.value[Tr][no]=ro);else if(typeof ro=="function"){const so=eo(no,ro);Jr[no]=so,Br.actions[no]=ro}}return assign$5(Yr,Jr),assign$5(toRaw(Yr),Jr),Object.defineProperty(Yr,"$state",{get:()=>Ar.state.value[Tr],set:no=>{Xr(ro=>{assign$5(ro,no)})}}),Ar._p.forEach(no=>{assign$5(Yr,Mr.run(()=>no({store:Yr,app:Ar._a,pinia:Ar,options:Br})))}),jr&&Dr&&$r.hydrate&&$r.hydrate(Yr.$state,jr),Lr=!0,Hr=!0,Yr}function defineStore(Tr,Cr,$r){let Ar,Rr;const Dr=typeof Cr=="function";typeof Tr=="string"?(Ar=Tr,Rr=Dr?$r:Cr):(Rr=Tr,Ar=Tr.id);function Mr(Br,Nr){const Lr=getCurrentInstance();return Br=Br||Lr&&inject(piniaSymbol),Br&&setActivePinia(Br),Br=activePinia,Br._s.has(Ar)||(Dr?createSetupStore(Ar,Cr,Rr,Br):createOptionsStore(Ar,Rr,Br)),Br._s.get(Ar)}return Mr.$id=Ar,Mr}const supabase$6=SupabaseWrapper.client,fetchProfile=async Tr=>{const{data:Cr,error:$r}=await supabase$6.from("user_profiles_with_credits").select("*").eq("id",Tr);return{data:Cr,error:$r}},updateProfile=async(Tr,Cr)=>{const{error:$r}=await supabase$6.from("profiles").update(Cr).eq("id",Tr);return{error:$r}};let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}const byteToHex=[];for(let Tr=0;Tr<256;++Tr)byteToHex.push((Tr+256).toString(16).slice(1));function unsafeStringify(Tr,Cr=0){return byteToHex[Tr[Cr+0]]+byteToHex[Tr[Cr+1]]+byteToHex[Tr[Cr+2]]+byteToHex[Tr[Cr+3]]+"-"+byteToHex[Tr[Cr+4]]+byteToHex[Tr[Cr+5]]+"-"+byteToHex[Tr[Cr+6]]+byteToHex[Tr[Cr+7]]+"-"+byteToHex[Tr[Cr+8]]+byteToHex[Tr[Cr+9]]+"-"+byteToHex[Tr[Cr+10]]+byteToHex[Tr[Cr+11]]+byteToHex[Tr[Cr+12]]+byteToHex[Tr[Cr+13]]+byteToHex[Tr[Cr+14]]+byteToHex[Tr[Cr+15]]}const randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),native={randomUUID};function v4(Tr,Cr,$r){if(native.randomUUID&&!Cr&&!Tr)return native.randomUUID();Tr=Tr||{};const Ar=Tr.random||(Tr.rng||rng)();if(Ar[6]=Ar[6]&15|64,Ar[8]=Ar[8]&63|128,Cr){$r=$r||0;for(let Rr=0;Rr<16;++Rr)Cr[$r+Rr]=Ar[Rr];return Cr}return unsafeStringify(Ar)}//! moment.js //! version : 2.29.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com var hookCallback;function hooks(){return hookCallback.apply(null,arguments)}function setHookCallback(Tr){hookCallback=Tr}function isArray$2(Tr){return Tr instanceof Array||Object.prototype.toString.call(Tr)==="[object Array]"}function isObject$4(Tr){return Tr!=null&&Object.prototype.toString.call(Tr)==="[object Object]"}function hasOwnProp(Tr,Cr){return Object.prototype.hasOwnProperty.call(Tr,Cr)}function isObjectEmpty(Tr){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(Tr).length===0;var Cr;for(Cr in Tr)if(hasOwnProp(Tr,Cr))return!1;return!0}function isUndefined(Tr){return Tr===void 0}function isNumber$3(Tr){return typeof Tr=="number"||Object.prototype.toString.call(Tr)==="[object Number]"}function isDate(Tr){return Tr instanceof Date||Object.prototype.toString.call(Tr)==="[object Date]"}function map$3(Tr,Cr){var $r=[],Ar;for(Ar=0;Ar>>0,Ar;for(Ar=0;Ar<$r;Ar++)if(Ar in Cr&&Tr.call(this,Cr[Ar],Ar,Cr))return!0;return!1};function isValid(Tr){if(Tr._isValid==null){var Cr=getParsingFlags(Tr),$r=some.call(Cr.parsedDateParts,function(Rr){return Rr!=null}),Ar=!isNaN(Tr._d.getTime())&&Cr.overflow<0&&!Cr.empty&&!Cr.invalidEra&&!Cr.invalidMonth&&!Cr.invalidWeekday&&!Cr.weekdayMismatch&&!Cr.nullInput&&!Cr.invalidFormat&&!Cr.userInvalidated&&(!Cr.meridiem||Cr.meridiem&&$r);if(Tr._strict&&(Ar=Ar&&Cr.charsLeftOver===0&&Cr.unusedTokens.length===0&&Cr.bigHour===void 0),Object.isFrozen==null||!Object.isFrozen(Tr))Tr._isValid=Ar;else return Ar}return Tr._isValid}function createInvalid(Tr){var Cr=createUTC(NaN);return Tr!=null?extend(getParsingFlags(Cr),Tr):getParsingFlags(Cr).userInvalidated=!0,Cr}var momentProperties=hooks.momentProperties=[],updateInProgress=!1;function copyConfig(Tr,Cr){var $r,Ar,Rr;if(isUndefined(Cr._isAMomentObject)||(Tr._isAMomentObject=Cr._isAMomentObject),isUndefined(Cr._i)||(Tr._i=Cr._i),isUndefined(Cr._f)||(Tr._f=Cr._f),isUndefined(Cr._l)||(Tr._l=Cr._l),isUndefined(Cr._strict)||(Tr._strict=Cr._strict),isUndefined(Cr._tzm)||(Tr._tzm=Cr._tzm),isUndefined(Cr._isUTC)||(Tr._isUTC=Cr._isUTC),isUndefined(Cr._offset)||(Tr._offset=Cr._offset),isUndefined(Cr._pf)||(Tr._pf=getParsingFlags(Cr)),isUndefined(Cr._locale)||(Tr._locale=Cr._locale),momentProperties.length>0)for($r=0;$r=0;return(Dr?$r?"+":"":"-")+Math.pow(10,Math.max(0,Rr)).toString().substr(1)+Ar}var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={};function addFormatToken(Tr,Cr,$r,Ar){var Rr=Ar;typeof Ar=="string"&&(Rr=function(){return this[Ar]()}),Tr&&(formatTokenFunctions[Tr]=Rr),Cr&&(formatTokenFunctions[Cr[0]]=function(){return zeroFill(Rr.apply(this,arguments),Cr[1],Cr[2])}),$r&&(formatTokenFunctions[$r]=function(){return this.localeData().ordinal(Rr.apply(this,arguments),Tr)})}function removeFormattingTokens(Tr){return Tr.match(/\[[\s\S]/)?Tr.replace(/^\[|\]$/g,""):Tr.replace(/\\/g,"")}function makeFormatFunction(Tr){var Cr=Tr.match(formattingTokens),$r,Ar;for($r=0,Ar=Cr.length;$r=0&&localFormattingTokens.test(Tr);)Tr=Tr.replace(localFormattingTokens,Ar),localFormattingTokens.lastIndex=0,$r-=1;return Tr}var defaultLongDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function longDateFormat(Tr){var Cr=this._longDateFormat[Tr],$r=this._longDateFormat[Tr.toUpperCase()];return Cr||!$r?Cr:(this._longDateFormat[Tr]=$r.match(formattingTokens).map(function(Ar){return Ar==="MMMM"||Ar==="MM"||Ar==="DD"||Ar==="dddd"?Ar.slice(1):Ar}).join(""),this._longDateFormat[Tr])}var defaultInvalidDate="Invalid date";function invalidDate(){return this._invalidDate}var defaultOrdinal="%d",defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal(Tr){return this._ordinal.replace("%d",Tr)}var defaultRelativeTime={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function relativeTime(Tr,Cr,$r,Ar){var Rr=this._relativeTime[$r];return isFunction$3(Rr)?Rr(Tr,Cr,$r,Ar):Rr.replace(/%d/i,Tr)}function pastFuture(Tr,Cr){var $r=this._relativeTime[Tr>0?"future":"past"];return isFunction$3($r)?$r(Cr):$r.replace(/%s/i,Cr)}var aliases={};function addUnitAlias(Tr,Cr){var $r=Tr.toLowerCase();aliases[$r]=aliases[$r+"s"]=aliases[Cr]=Tr}function normalizeUnits(Tr){return typeof Tr=="string"?aliases[Tr]||aliases[Tr.toLowerCase()]:void 0}function normalizeObjectUnits(Tr){var Cr={},$r,Ar;for(Ar in Tr)hasOwnProp(Tr,Ar)&&($r=normalizeUnits(Ar),$r&&(Cr[$r]=Tr[Ar]));return Cr}var priorities={};function addUnitPriority(Tr,Cr){priorities[Tr]=Cr}function getPrioritizedUnits(Tr){var Cr=[],$r;for($r in Tr)hasOwnProp(Tr,$r)&&Cr.push({unit:$r,priority:priorities[$r]});return Cr.sort(function(Ar,Rr){return Ar.priority-Rr.priority}),Cr}function isLeapYear(Tr){return Tr%4===0&&Tr%100!==0||Tr%400===0}function absFloor(Tr){return Tr<0?Math.ceil(Tr)||0:Math.floor(Tr)}function toInt(Tr){var Cr=+Tr,$r=0;return Cr!==0&&isFinite(Cr)&&($r=absFloor(Cr)),$r}function makeGetSet(Tr,Cr){return function($r){return $r!=null?(set$1$1(this,Tr,$r),hooks.updateOffset(this,Cr),this):get$1(this,Tr)}}function get$1(Tr,Cr){return Tr.isValid()?Tr._d["get"+(Tr._isUTC?"UTC":"")+Cr]():NaN}function set$1$1(Tr,Cr,$r){Tr.isValid()&&!isNaN($r)&&(Cr==="FullYear"&&isLeapYear(Tr.year())&&Tr.month()===1&&Tr.date()===29?($r=toInt($r),Tr._d["set"+(Tr._isUTC?"UTC":"")+Cr]($r,Tr.month(),daysInMonth($r,Tr.month()))):Tr._d["set"+(Tr._isUTC?"UTC":"")+Cr]($r))}function stringGet(Tr){return Tr=normalizeUnits(Tr),isFunction$3(this[Tr])?this[Tr]():this}function stringSet(Tr,Cr){if(typeof Tr=="object"){Tr=normalizeObjectUnits(Tr);var $r=getPrioritizedUnits(Tr),Ar;for(Ar=0;Ar<$r.length;Ar++)this[$r[Ar].unit](Tr[$r[Ar].unit])}else if(Tr=normalizeUnits(Tr),isFunction$3(this[Tr]))return this[Tr](Cr);return this}var match1=/\d/,match2=/\d\d/,match3=/\d{3}/,match4=/\d{4}/,match6=/[+-]?\d{6}/,match1to2=/\d\d?/,match3to4=/\d\d\d\d?/,match5to6=/\d\d\d\d\d\d?/,match1to3=/\d{1,3}/,match1to4=/\d{1,4}/,match1to6=/[+-]?\d{1,6}/,matchUnsigned=/\d+/,matchSigned=/[+-]?\d+/,matchOffset=/Z|[+-]\d\d:?\d\d/gi,matchShortOffset=/Z|[+-]\d\d(?::?\d\d)?/gi,matchTimestamp=/[+-]?\d+(\.\d{1,3})?/,matchWord=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,regexes;regexes={};function addRegexToken(Tr,Cr,$r){regexes[Tr]=isFunction$3(Cr)?Cr:function(Ar,Rr){return Ar&&$r?$r:Cr}}function getParseRegexForToken(Tr,Cr){return hasOwnProp(regexes,Tr)?regexes[Tr](Cr._strict,Cr._locale):new RegExp(unescapeFormat(Tr))}function unescapeFormat(Tr){return regexEscape(Tr.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(Cr,$r,Ar,Rr,Dr){return $r||Ar||Rr||Dr}))}function regexEscape(Tr){return Tr.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var tokens={};function addParseToken(Tr,Cr){var $r,Ar=Cr;for(typeof Tr=="string"&&(Tr=[Tr]),isNumber$3(Cr)&&(Ar=function(Rr,Dr){Dr[Cr]=toInt(Rr)}),$r=0;$r68?1900:2e3)};var getSetYear=makeGetSet("FullYear",!0);function getIsLeapYear(){return isLeapYear(this.year())}function createDate(Tr,Cr,$r,Ar,Rr,Dr,Mr){var Br;return Tr<100&&Tr>=0?(Br=new Date(Tr+400,Cr,$r,Ar,Rr,Dr,Mr),isFinite(Br.getFullYear())&&Br.setFullYear(Tr)):Br=new Date(Tr,Cr,$r,Ar,Rr,Dr,Mr),Br}function createUTCDate(Tr){var Cr,$r;return Tr<100&&Tr>=0?($r=Array.prototype.slice.call(arguments),$r[0]=Tr+400,Cr=new Date(Date.UTC.apply(null,$r)),isFinite(Cr.getUTCFullYear())&&Cr.setUTCFullYear(Tr)):Cr=new Date(Date.UTC.apply(null,arguments)),Cr}function firstWeekOffset(Tr,Cr,$r){var Ar=7+Cr-$r,Rr=(7+createUTCDate(Tr,0,Ar).getUTCDay()-Cr)%7;return-Rr+Ar-1}function dayOfYearFromWeeks(Tr,Cr,$r,Ar,Rr){var Dr=(7+$r-Ar)%7,Mr=firstWeekOffset(Tr,Ar,Rr),Br=1+7*(Cr-1)+Dr+Mr,Nr,Lr;return Br<=0?(Nr=Tr-1,Lr=daysInYear(Nr)+Br):Br>daysInYear(Tr)?(Nr=Tr+1,Lr=Br-daysInYear(Tr)):(Nr=Tr,Lr=Br),{year:Nr,dayOfYear:Lr}}function weekOfYear(Tr,Cr,$r){var Ar=firstWeekOffset(Tr.year(),Cr,$r),Rr=Math.floor((Tr.dayOfYear()-Ar-1)/7)+1,Dr,Mr;return Rr<1?(Mr=Tr.year()-1,Dr=Rr+weeksInYear(Mr,Cr,$r)):Rr>weeksInYear(Tr.year(),Cr,$r)?(Dr=Rr-weeksInYear(Tr.year(),Cr,$r),Mr=Tr.year()+1):(Mr=Tr.year(),Dr=Rr),{week:Dr,year:Mr}}function weeksInYear(Tr,Cr,$r){var Ar=firstWeekOffset(Tr,Cr,$r),Rr=firstWeekOffset(Tr+1,Cr,$r);return(daysInYear(Tr)-Ar+Rr)/7}addFormatToken("w",["ww",2],"wo","week");addFormatToken("W",["WW",2],"Wo","isoWeek");addUnitAlias("week","w");addUnitAlias("isoWeek","W");addUnitPriority("week",5);addUnitPriority("isoWeek",5);addRegexToken("w",match1to2);addRegexToken("ww",match1to2,match2);addRegexToken("W",match1to2);addRegexToken("WW",match1to2,match2);addWeekParseToken(["w","ww","W","WW"],function(Tr,Cr,$r,Ar){Cr[Ar.substr(0,1)]=toInt(Tr)});function localeWeek(Tr){return weekOfYear(Tr,this._week.dow,this._week.doy).week}var defaultLocaleWeek={dow:0,doy:6};function localeFirstDayOfWeek(){return this._week.dow}function localeFirstDayOfYear(){return this._week.doy}function getSetWeek(Tr){var Cr=this.localeData().week(this);return Tr==null?Cr:this.add((Tr-Cr)*7,"d")}function getSetISOWeek(Tr){var Cr=weekOfYear(this,1,4).week;return Tr==null?Cr:this.add((Tr-Cr)*7,"d")}addFormatToken("d",0,"do","day");addFormatToken("dd",0,0,function(Tr){return this.localeData().weekdaysMin(this,Tr)});addFormatToken("ddd",0,0,function(Tr){return this.localeData().weekdaysShort(this,Tr)});addFormatToken("dddd",0,0,function(Tr){return this.localeData().weekdays(this,Tr)});addFormatToken("e",0,0,"weekday");addFormatToken("E",0,0,"isoWeekday");addUnitAlias("day","d");addUnitAlias("weekday","e");addUnitAlias("isoWeekday","E");addUnitPriority("day",11);addUnitPriority("weekday",11);addUnitPriority("isoWeekday",11);addRegexToken("d",match1to2);addRegexToken("e",match1to2);addRegexToken("E",match1to2);addRegexToken("dd",function(Tr,Cr){return Cr.weekdaysMinRegex(Tr)});addRegexToken("ddd",function(Tr,Cr){return Cr.weekdaysShortRegex(Tr)});addRegexToken("dddd",function(Tr,Cr){return Cr.weekdaysRegex(Tr)});addWeekParseToken(["dd","ddd","dddd"],function(Tr,Cr,$r,Ar){var Rr=$r._locale.weekdaysParse(Tr,Ar,$r._strict);Rr!=null?Cr.d=Rr:getParsingFlags($r).invalidWeekday=Tr});addWeekParseToken(["d","e","E"],function(Tr,Cr,$r,Ar){Cr[Ar]=toInt(Tr)});function parseWeekday(Tr,Cr){return typeof Tr!="string"?Tr:isNaN(Tr)?(Tr=Cr.weekdaysParse(Tr),typeof Tr=="number"?Tr:null):parseInt(Tr,10)}function parseIsoWeekday(Tr,Cr){return typeof Tr=="string"?Cr.weekdaysParse(Tr)%7||7:isNaN(Tr)?null:Tr}function shiftWeekdays(Tr,Cr){return Tr.slice(Cr,7).concat(Tr.slice(0,Cr))}var defaultLocaleWeekdays="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),defaultLocaleWeekdaysShort="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),defaultLocaleWeekdaysMin="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),defaultWeekdaysRegex=matchWord,defaultWeekdaysShortRegex=matchWord,defaultWeekdaysMinRegex=matchWord;function localeWeekdays(Tr,Cr){var $r=isArray$2(this._weekdays)?this._weekdays:this._weekdays[Tr&&Tr!==!0&&this._weekdays.isFormat.test(Cr)?"format":"standalone"];return Tr===!0?shiftWeekdays($r,this._week.dow):Tr?$r[Tr.day()]:$r}function localeWeekdaysShort(Tr){return Tr===!0?shiftWeekdays(this._weekdaysShort,this._week.dow):Tr?this._weekdaysShort[Tr.day()]:this._weekdaysShort}function localeWeekdaysMin(Tr){return Tr===!0?shiftWeekdays(this._weekdaysMin,this._week.dow):Tr?this._weekdaysMin[Tr.day()]:this._weekdaysMin}function handleStrictParse$1(Tr,Cr,$r){var Ar,Rr,Dr,Mr=Tr.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],Ar=0;Ar<7;++Ar)Dr=createUTC([2e3,1]).day(Ar),this._minWeekdaysParse[Ar]=this.weekdaysMin(Dr,"").toLocaleLowerCase(),this._shortWeekdaysParse[Ar]=this.weekdaysShort(Dr,"").toLocaleLowerCase(),this._weekdaysParse[Ar]=this.weekdays(Dr,"").toLocaleLowerCase();return $r?Cr==="dddd"?(Rr=indexOf.call(this._weekdaysParse,Mr),Rr!==-1?Rr:null):Cr==="ddd"?(Rr=indexOf.call(this._shortWeekdaysParse,Mr),Rr!==-1?Rr:null):(Rr=indexOf.call(this._minWeekdaysParse,Mr),Rr!==-1?Rr:null):Cr==="dddd"?(Rr=indexOf.call(this._weekdaysParse,Mr),Rr!==-1||(Rr=indexOf.call(this._shortWeekdaysParse,Mr),Rr!==-1)?Rr:(Rr=indexOf.call(this._minWeekdaysParse,Mr),Rr!==-1?Rr:null)):Cr==="ddd"?(Rr=indexOf.call(this._shortWeekdaysParse,Mr),Rr!==-1||(Rr=indexOf.call(this._weekdaysParse,Mr),Rr!==-1)?Rr:(Rr=indexOf.call(this._minWeekdaysParse,Mr),Rr!==-1?Rr:null)):(Rr=indexOf.call(this._minWeekdaysParse,Mr),Rr!==-1||(Rr=indexOf.call(this._weekdaysParse,Mr),Rr!==-1)?Rr:(Rr=indexOf.call(this._shortWeekdaysParse,Mr),Rr!==-1?Rr:null))}function localeWeekdaysParse(Tr,Cr,$r){var Ar,Rr,Dr;if(this._weekdaysParseExact)return handleStrictParse$1.call(this,Tr,Cr,$r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),Ar=0;Ar<7;Ar++){if(Rr=createUTC([2e3,1]).day(Ar),$r&&!this._fullWeekdaysParse[Ar]&&(this._fullWeekdaysParse[Ar]=new RegExp("^"+this.weekdays(Rr,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[Ar]=new RegExp("^"+this.weekdaysShort(Rr,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[Ar]=new RegExp("^"+this.weekdaysMin(Rr,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[Ar]||(Dr="^"+this.weekdays(Rr,"")+"|^"+this.weekdaysShort(Rr,"")+"|^"+this.weekdaysMin(Rr,""),this._weekdaysParse[Ar]=new RegExp(Dr.replace(".",""),"i")),$r&&Cr==="dddd"&&this._fullWeekdaysParse[Ar].test(Tr))return Ar;if($r&&Cr==="ddd"&&this._shortWeekdaysParse[Ar].test(Tr))return Ar;if($r&&Cr==="dd"&&this._minWeekdaysParse[Ar].test(Tr))return Ar;if(!$r&&this._weekdaysParse[Ar].test(Tr))return Ar}}function getSetDayOfWeek(Tr){if(!this.isValid())return Tr!=null?this:NaN;var Cr=this._isUTC?this._d.getUTCDay():this._d.getDay();return Tr!=null?(Tr=parseWeekday(Tr,this.localeData()),this.add(Tr-Cr,"d")):Cr}function getSetLocaleDayOfWeek(Tr){if(!this.isValid())return Tr!=null?this:NaN;var Cr=(this.day()+7-this.localeData()._week.dow)%7;return Tr==null?Cr:this.add(Tr-Cr,"d")}function getSetISODayOfWeek(Tr){if(!this.isValid())return Tr!=null?this:NaN;if(Tr!=null){var Cr=parseIsoWeekday(Tr,this.localeData());return this.day(this.day()%7?Cr:Cr-7)}else return this.day()||7}function weekdaysRegex(Tr){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),Tr?this._weekdaysStrictRegex:this._weekdaysRegex):(hasOwnProp(this,"_weekdaysRegex")||(this._weekdaysRegex=defaultWeekdaysRegex),this._weekdaysStrictRegex&&Tr?this._weekdaysStrictRegex:this._weekdaysRegex)}function weekdaysShortRegex(Tr){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),Tr?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hasOwnProp(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=defaultWeekdaysShortRegex),this._weekdaysShortStrictRegex&&Tr?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function weekdaysMinRegex(Tr){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),Tr?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hasOwnProp(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=defaultWeekdaysMinRegex),this._weekdaysMinStrictRegex&&Tr?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function computeWeekdaysParse(){function Tr(Hr,zr){return zr.length-Hr.length}var Cr=[],$r=[],Ar=[],Rr=[],Dr,Mr,Br,Nr,Lr;for(Dr=0;Dr<7;Dr++)Mr=createUTC([2e3,1]).day(Dr),Br=regexEscape(this.weekdaysMin(Mr,"")),Nr=regexEscape(this.weekdaysShort(Mr,"")),Lr=regexEscape(this.weekdays(Mr,"")),Cr.push(Br),$r.push(Nr),Ar.push(Lr),Rr.push(Br),Rr.push(Nr),Rr.push(Lr);Cr.sort(Tr),$r.sort(Tr),Ar.sort(Tr),Rr.sort(Tr),this._weekdaysRegex=new RegExp("^("+Rr.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+Ar.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+$r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+Cr.join("|")+")","i")}function hFormat(){return this.hours()%12||12}function kFormat(){return this.hours()||24}addFormatToken("H",["HH",2],0,"hour");addFormatToken("h",["hh",2],0,hFormat);addFormatToken("k",["kk",2],0,kFormat);addFormatToken("hmm",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)});addFormatToken("hmmss",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});addFormatToken("Hmm",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)});addFormatToken("Hmmss",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});function meridiem(Tr,Cr){addFormatToken(Tr,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),Cr)})}meridiem("a",!0);meridiem("A",!1);addUnitAlias("hour","h");addUnitPriority("hour",13);function matchMeridiem(Tr,Cr){return Cr._meridiemParse}addRegexToken("a",matchMeridiem);addRegexToken("A",matchMeridiem);addRegexToken("H",match1to2);addRegexToken("h",match1to2);addRegexToken("k",match1to2);addRegexToken("HH",match1to2,match2);addRegexToken("hh",match1to2,match2);addRegexToken("kk",match1to2,match2);addRegexToken("hmm",match3to4);addRegexToken("hmmss",match5to6);addRegexToken("Hmm",match3to4);addRegexToken("Hmmss",match5to6);addParseToken(["H","HH"],HOUR);addParseToken(["k","kk"],function(Tr,Cr,$r){var Ar=toInt(Tr);Cr[HOUR]=Ar===24?0:Ar});addParseToken(["a","A"],function(Tr,Cr,$r){$r._isPm=$r._locale.isPM(Tr),$r._meridiem=Tr});addParseToken(["h","hh"],function(Tr,Cr,$r){Cr[HOUR]=toInt(Tr),getParsingFlags($r).bigHour=!0});addParseToken("hmm",function(Tr,Cr,$r){var Ar=Tr.length-2;Cr[HOUR]=toInt(Tr.substr(0,Ar)),Cr[MINUTE]=toInt(Tr.substr(Ar)),getParsingFlags($r).bigHour=!0});addParseToken("hmmss",function(Tr,Cr,$r){var Ar=Tr.length-4,Rr=Tr.length-2;Cr[HOUR]=toInt(Tr.substr(0,Ar)),Cr[MINUTE]=toInt(Tr.substr(Ar,2)),Cr[SECOND]=toInt(Tr.substr(Rr)),getParsingFlags($r).bigHour=!0});addParseToken("Hmm",function(Tr,Cr,$r){var Ar=Tr.length-2;Cr[HOUR]=toInt(Tr.substr(0,Ar)),Cr[MINUTE]=toInt(Tr.substr(Ar))});addParseToken("Hmmss",function(Tr,Cr,$r){var Ar=Tr.length-4,Rr=Tr.length-2;Cr[HOUR]=toInt(Tr.substr(0,Ar)),Cr[MINUTE]=toInt(Tr.substr(Ar,2)),Cr[SECOND]=toInt(Tr.substr(Rr))});function localeIsPM(Tr){return(Tr+"").toLowerCase().charAt(0)==="p"}var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet("Hours",!0);function localeMeridiem(Tr,Cr,$r){return Tr>11?$r?"pm":"PM":$r?"am":"AM"}var baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse},locales={},localeFamilies={},globalLocale;function commonPrefix(Tr,Cr){var $r,Ar=Math.min(Tr.length,Cr.length);for($r=0;$r0;){if(Rr=loadLocale(Dr.slice(0,$r).join("-")),Rr)return Rr;if(Ar&&Ar.length>=$r&&commonPrefix(Dr,Ar)>=$r-1)break;$r--}Cr++}return globalLocale}function loadLocale(Tr){var Cr=null,$r;if(locales[Tr]===void 0&&typeof module<"u"&&module&&module.exports)try{Cr=globalLocale._abbr,$r=require,$r("./locale/"+Tr),getSetGlobalLocale(Cr)}catch{locales[Tr]=null}return locales[Tr]}function getSetGlobalLocale(Tr,Cr){var $r;return Tr&&(isUndefined(Cr)?$r=getLocale(Tr):$r=defineLocale(Tr,Cr),$r?globalLocale=$r:typeof console<"u"&&console.warn&&console.warn("Locale "+Tr+" not found. Did you forget to load it?")),globalLocale._abbr}function defineLocale(Tr,Cr){if(Cr!==null){var $r,Ar=baseConfig;if(Cr.abbr=Tr,locales[Tr]!=null)deprecateSimple("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),Ar=locales[Tr]._config;else if(Cr.parentLocale!=null)if(locales[Cr.parentLocale]!=null)Ar=locales[Cr.parentLocale]._config;else if($r=loadLocale(Cr.parentLocale),$r!=null)Ar=$r._config;else return localeFamilies[Cr.parentLocale]||(localeFamilies[Cr.parentLocale]=[]),localeFamilies[Cr.parentLocale].push({name:Tr,config:Cr}),null;return locales[Tr]=new Locale(mergeConfigs(Ar,Cr)),localeFamilies[Tr]&&localeFamilies[Tr].forEach(function(Rr){defineLocale(Rr.name,Rr.config)}),getSetGlobalLocale(Tr),locales[Tr]}else return delete locales[Tr],null}function updateLocale(Tr,Cr){if(Cr!=null){var $r,Ar,Rr=baseConfig;locales[Tr]!=null&&locales[Tr].parentLocale!=null?locales[Tr].set(mergeConfigs(locales[Tr]._config,Cr)):(Ar=loadLocale(Tr),Ar!=null&&(Rr=Ar._config),Cr=mergeConfigs(Rr,Cr),Ar==null&&(Cr.abbr=Tr),$r=new Locale(Cr),$r.parentLocale=locales[Tr],locales[Tr]=$r),getSetGlobalLocale(Tr)}else locales[Tr]!=null&&(locales[Tr].parentLocale!=null?(locales[Tr]=locales[Tr].parentLocale,Tr===getSetGlobalLocale()&&getSetGlobalLocale(Tr)):locales[Tr]!=null&&delete locales[Tr]);return locales[Tr]}function getLocale(Tr){var Cr;if(Tr&&Tr._locale&&Tr._locale._abbr&&(Tr=Tr._locale._abbr),!Tr)return globalLocale;if(!isArray$2(Tr)){if(Cr=loadLocale(Tr),Cr)return Cr;Tr=[Tr]}return chooseLocale(Tr)}function listLocales(){return keys$2(locales)}function checkOverflow(Tr){var Cr,$r=Tr._a;return $r&&getParsingFlags(Tr).overflow===-2&&(Cr=$r[MONTH]<0||$r[MONTH]>11?MONTH:$r[DATE]<1||$r[DATE]>daysInMonth($r[YEAR],$r[MONTH])?DATE:$r[HOUR]<0||$r[HOUR]>24||$r[HOUR]===24&&($r[MINUTE]!==0||$r[SECOND]!==0||$r[MILLISECOND]!==0)?HOUR:$r[MINUTE]<0||$r[MINUTE]>59?MINUTE:$r[SECOND]<0||$r[SECOND]>59?SECOND:$r[MILLISECOND]<0||$r[MILLISECOND]>999?MILLISECOND:-1,getParsingFlags(Tr)._overflowDayOfYear&&(CrDATE)&&(Cr=DATE),getParsingFlags(Tr)._overflowWeeks&&Cr===-1&&(Cr=WEEK),getParsingFlags(Tr)._overflowWeekday&&Cr===-1&&(Cr=WEEKDAY),getParsingFlags(Tr).overflow=Cr),Tr}var extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tzRegex=/Z|[+-]\d\d(?::?\d\d)?/,isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],isoTimes=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],aspNetJsonRegex=/^\/?Date\((-?\d+)/i,rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,obsOffsets={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function configFromISO(Tr){var Cr,$r,Ar=Tr._i,Rr=extendedIsoRegex.exec(Ar)||basicIsoRegex.exec(Ar),Dr,Mr,Br,Nr;if(Rr){for(getParsingFlags(Tr).iso=!0,Cr=0,$r=isoDates.length;Cr<$r;Cr++)if(isoDates[Cr][1].exec(Rr[1])){Mr=isoDates[Cr][0],Dr=isoDates[Cr][2]!==!1;break}if(Mr==null){Tr._isValid=!1;return}if(Rr[3]){for(Cr=0,$r=isoTimes.length;Cr<$r;Cr++)if(isoTimes[Cr][1].exec(Rr[3])){Br=(Rr[2]||" ")+isoTimes[Cr][0];break}if(Br==null){Tr._isValid=!1;return}}if(!Dr&&Br!=null){Tr._isValid=!1;return}if(Rr[4])if(tzRegex.exec(Rr[4]))Nr="Z";else{Tr._isValid=!1;return}Tr._f=Mr+(Br||"")+(Nr||""),configFromStringAndFormat(Tr)}else Tr._isValid=!1}function extractFromRFC2822Strings(Tr,Cr,$r,Ar,Rr,Dr){var Mr=[untruncateYear(Tr),defaultLocaleMonthsShort.indexOf(Cr),parseInt($r,10),parseInt(Ar,10),parseInt(Rr,10)];return Dr&&Mr.push(parseInt(Dr,10)),Mr}function untruncateYear(Tr){var Cr=parseInt(Tr,10);return Cr<=49?2e3+Cr:Cr<=999?1900+Cr:Cr}function preprocessRFC2822(Tr){return Tr.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function checkWeekday(Tr,Cr,$r){if(Tr){var Ar=defaultLocaleWeekdaysShort.indexOf(Tr),Rr=new Date(Cr[0],Cr[1],Cr[2]).getDay();if(Ar!==Rr)return getParsingFlags($r).weekdayMismatch=!0,$r._isValid=!1,!1}return!0}function calculateOffset(Tr,Cr,$r){if(Tr)return obsOffsets[Tr];if(Cr)return 0;var Ar=parseInt($r,10),Rr=Ar%100,Dr=(Ar-Rr)/100;return Dr*60+Rr}function configFromRFC2822(Tr){var Cr=rfc2822.exec(preprocessRFC2822(Tr._i)),$r;if(Cr){if($r=extractFromRFC2822Strings(Cr[4],Cr[3],Cr[2],Cr[5],Cr[6],Cr[7]),!checkWeekday(Cr[1],$r,Tr))return;Tr._a=$r,Tr._tzm=calculateOffset(Cr[8],Cr[9],Cr[10]),Tr._d=createUTCDate.apply(null,Tr._a),Tr._d.setUTCMinutes(Tr._d.getUTCMinutes()-Tr._tzm),getParsingFlags(Tr).rfc2822=!0}else Tr._isValid=!1}function configFromString(Tr){var Cr=aspNetJsonRegex.exec(Tr._i);if(Cr!==null){Tr._d=new Date(+Cr[1]);return}if(configFromISO(Tr),Tr._isValid===!1)delete Tr._isValid;else return;if(configFromRFC2822(Tr),Tr._isValid===!1)delete Tr._isValid;else return;Tr._strict?Tr._isValid=!1:hooks.createFromInputFallback(Tr)}hooks.createFromInputFallback=deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(Tr){Tr._d=new Date(Tr._i+(Tr._useUTC?" UTC":""))});function defaults$1(Tr,Cr,$r){return Tr??Cr??$r}function currentDateArray(Tr){var Cr=new Date(hooks.now());return Tr._useUTC?[Cr.getUTCFullYear(),Cr.getUTCMonth(),Cr.getUTCDate()]:[Cr.getFullYear(),Cr.getMonth(),Cr.getDate()]}function configFromArray(Tr){var Cr,$r,Ar=[],Rr,Dr,Mr;if(!Tr._d){for(Rr=currentDateArray(Tr),Tr._w&&Tr._a[DATE]==null&&Tr._a[MONTH]==null&&dayOfYearFromWeekInfo(Tr),Tr._dayOfYear!=null&&(Mr=defaults$1(Tr._a[YEAR],Rr[YEAR]),(Tr._dayOfYear>daysInYear(Mr)||Tr._dayOfYear===0)&&(getParsingFlags(Tr)._overflowDayOfYear=!0),$r=createUTCDate(Mr,0,Tr._dayOfYear),Tr._a[MONTH]=$r.getUTCMonth(),Tr._a[DATE]=$r.getUTCDate()),Cr=0;Cr<3&&Tr._a[Cr]==null;++Cr)Tr._a[Cr]=Ar[Cr]=Rr[Cr];for(;Cr<7;Cr++)Tr._a[Cr]=Ar[Cr]=Tr._a[Cr]==null?Cr===2?1:0:Tr._a[Cr];Tr._a[HOUR]===24&&Tr._a[MINUTE]===0&&Tr._a[SECOND]===0&&Tr._a[MILLISECOND]===0&&(Tr._nextDay=!0,Tr._a[HOUR]=0),Tr._d=(Tr._useUTC?createUTCDate:createDate).apply(null,Ar),Dr=Tr._useUTC?Tr._d.getUTCDay():Tr._d.getDay(),Tr._tzm!=null&&Tr._d.setUTCMinutes(Tr._d.getUTCMinutes()-Tr._tzm),Tr._nextDay&&(Tr._a[HOUR]=24),Tr._w&&typeof Tr._w.d<"u"&&Tr._w.d!==Dr&&(getParsingFlags(Tr).weekdayMismatch=!0)}}function dayOfYearFromWeekInfo(Tr){var Cr,$r,Ar,Rr,Dr,Mr,Br,Nr,Lr;Cr=Tr._w,Cr.GG!=null||Cr.W!=null||Cr.E!=null?(Dr=1,Mr=4,$r=defaults$1(Cr.GG,Tr._a[YEAR],weekOfYear(createLocal(),1,4).year),Ar=defaults$1(Cr.W,1),Rr=defaults$1(Cr.E,1),(Rr<1||Rr>7)&&(Nr=!0)):(Dr=Tr._locale._week.dow,Mr=Tr._locale._week.doy,Lr=weekOfYear(createLocal(),Dr,Mr),$r=defaults$1(Cr.gg,Tr._a[YEAR],Lr.year),Ar=defaults$1(Cr.w,Lr.week),Cr.d!=null?(Rr=Cr.d,(Rr<0||Rr>6)&&(Nr=!0)):Cr.e!=null?(Rr=Cr.e+Dr,(Cr.e<0||Cr.e>6)&&(Nr=!0)):Rr=Dr),Ar<1||Ar>weeksInYear($r,Dr,Mr)?getParsingFlags(Tr)._overflowWeeks=!0:Nr!=null?getParsingFlags(Tr)._overflowWeekday=!0:(Br=dayOfYearFromWeeks($r,Ar,Rr,Dr,Mr),Tr._a[YEAR]=Br.year,Tr._dayOfYear=Br.dayOfYear)}hooks.ISO_8601=function(){};hooks.RFC_2822=function(){};function configFromStringAndFormat(Tr){if(Tr._f===hooks.ISO_8601){configFromISO(Tr);return}if(Tr._f===hooks.RFC_2822){configFromRFC2822(Tr);return}Tr._a=[],getParsingFlags(Tr).empty=!0;var Cr=""+Tr._i,$r,Ar,Rr,Dr,Mr,Br=Cr.length,Nr=0,Lr;for(Rr=expandFormat(Tr._f,Tr._locale).match(formattingTokens)||[],$r=0;$r0&&getParsingFlags(Tr).unusedInput.push(Mr),Cr=Cr.slice(Cr.indexOf(Ar)+Ar.length),Nr+=Ar.length),formatTokenFunctions[Dr]?(Ar?getParsingFlags(Tr).empty=!1:getParsingFlags(Tr).unusedTokens.push(Dr),addTimeToArrayFromToken(Dr,Ar,Tr)):Tr._strict&&!Ar&&getParsingFlags(Tr).unusedTokens.push(Dr);getParsingFlags(Tr).charsLeftOver=Br-Nr,Cr.length>0&&getParsingFlags(Tr).unusedInput.push(Cr),Tr._a[HOUR]<=12&&getParsingFlags(Tr).bigHour===!0&&Tr._a[HOUR]>0&&(getParsingFlags(Tr).bigHour=void 0),getParsingFlags(Tr).parsedDateParts=Tr._a.slice(0),getParsingFlags(Tr).meridiem=Tr._meridiem,Tr._a[HOUR]=meridiemFixWrap(Tr._locale,Tr._a[HOUR],Tr._meridiem),Lr=getParsingFlags(Tr).era,Lr!==null&&(Tr._a[YEAR]=Tr._locale.erasConvertYear(Lr,Tr._a[YEAR])),configFromArray(Tr),checkOverflow(Tr)}function meridiemFixWrap(Tr,Cr,$r){var Ar;return $r==null?Cr:Tr.meridiemHour!=null?Tr.meridiemHour(Cr,$r):(Tr.isPM!=null&&(Ar=Tr.isPM($r),Ar&&Cr<12&&(Cr+=12),!Ar&&Cr===12&&(Cr=0)),Cr)}function configFromStringAndArray(Tr){var Cr,$r,Ar,Rr,Dr,Mr,Br=!1;if(Tr._f.length===0){getParsingFlags(Tr).invalidFormat=!0,Tr._d=new Date(NaN);return}for(Rr=0;Rrthis?this:Tr:createInvalid()});function pickBy(Tr,Cr){var $r,Ar;if(Cr.length===1&&isArray$2(Cr[0])&&(Cr=Cr[0]),!Cr.length)return createLocal();for($r=Cr[0],Ar=1;Arthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined(this._isDSTShifted))return this._isDSTShifted;var Tr={},Cr;return copyConfig(Tr,this),Tr=prepareConfig(Tr),Tr._a?(Cr=Tr._isUTC?createUTC(Tr._a):createLocal(Tr._a),this._isDSTShifted=this.isValid()&&compareArrays(Tr._a,Cr.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function isLocal(){return this.isValid()?!this._isUTC:!1}function isUtcOffset(){return this.isValid()?this._isUTC:!1}function isUtc(){return this.isValid()?this._isUTC&&this._offset===0:!1}var aspNetRegex=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(Tr,Cr){var $r=Tr,Ar=null,Rr,Dr,Mr;return isDuration(Tr)?$r={ms:Tr._milliseconds,d:Tr._days,M:Tr._months}:isNumber$3(Tr)||!isNaN(+Tr)?($r={},Cr?$r[Cr]=+Tr:$r.milliseconds=+Tr):(Ar=aspNetRegex.exec(Tr))?(Rr=Ar[1]==="-"?-1:1,$r={y:0,d:toInt(Ar[DATE])*Rr,h:toInt(Ar[HOUR])*Rr,m:toInt(Ar[MINUTE])*Rr,s:toInt(Ar[SECOND])*Rr,ms:toInt(absRound(Ar[MILLISECOND]*1e3))*Rr}):(Ar=isoRegex.exec(Tr))?(Rr=Ar[1]==="-"?-1:1,$r={y:parseIso(Ar[2],Rr),M:parseIso(Ar[3],Rr),w:parseIso(Ar[4],Rr),d:parseIso(Ar[5],Rr),h:parseIso(Ar[6],Rr),m:parseIso(Ar[7],Rr),s:parseIso(Ar[8],Rr)}):$r==null?$r={}:typeof $r=="object"&&("from"in $r||"to"in $r)&&(Mr=momentsDifference(createLocal($r.from),createLocal($r.to)),$r={},$r.ms=Mr.milliseconds,$r.M=Mr.months),Dr=new Duration($r),isDuration(Tr)&&hasOwnProp(Tr,"_locale")&&(Dr._locale=Tr._locale),isDuration(Tr)&&hasOwnProp(Tr,"_isValid")&&(Dr._isValid=Tr._isValid),Dr}createDuration.fn=Duration.prototype;createDuration.invalid=createInvalid$1;function parseIso(Tr,Cr){var $r=Tr&&parseFloat(Tr.replace(",","."));return(isNaN($r)?0:$r)*Cr}function positiveMomentsDifference(Tr,Cr){var $r={};return $r.months=Cr.month()-Tr.month()+(Cr.year()-Tr.year())*12,Tr.clone().add($r.months,"M").isAfter(Cr)&&--$r.months,$r.milliseconds=+Cr-+Tr.clone().add($r.months,"M"),$r}function momentsDifference(Tr,Cr){var $r;return Tr.isValid()&&Cr.isValid()?(Cr=cloneWithOffset(Cr,Tr),Tr.isBefore(Cr)?$r=positiveMomentsDifference(Tr,Cr):($r=positiveMomentsDifference(Cr,Tr),$r.milliseconds=-$r.milliseconds,$r.months=-$r.months),$r):{milliseconds:0,months:0}}function createAdder(Tr,Cr){return function($r,Ar){var Rr,Dr;return Ar!==null&&!isNaN(+Ar)&&(deprecateSimple(Cr,"moment()."+Cr+"(period, number) is deprecated. Please use moment()."+Cr+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),Dr=$r,$r=Ar,Ar=Dr),Rr=createDuration($r,Ar),addSubtract(this,Rr,Tr),this}}function addSubtract(Tr,Cr,$r,Ar){var Rr=Cr._milliseconds,Dr=absRound(Cr._days),Mr=absRound(Cr._months);Tr.isValid()&&(Ar=Ar??!0,Mr&&setMonth(Tr,get$1(Tr,"Month")+Mr*$r),Dr&&set$1$1(Tr,"Date",get$1(Tr,"Date")+Dr*$r),Rr&&Tr._d.setTime(Tr._d.valueOf()+Rr*$r),Ar&&hooks.updateOffset(Tr,Dr||Mr))}var add=createAdder(1,"add"),subtract=createAdder(-1,"subtract");function isString$6(Tr){return typeof Tr=="string"||Tr instanceof String}function isMomentInput(Tr){return isMoment(Tr)||isDate(Tr)||isString$6(Tr)||isNumber$3(Tr)||isNumberOrStringArray(Tr)||isMomentInputObject(Tr)||Tr===null||Tr===void 0}function isMomentInputObject(Tr){var Cr=isObject$4(Tr)&&!isObjectEmpty(Tr),$r=!1,Ar=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],Rr,Dr;for(Rr=0;Rr$r.valueOf():$r.valueOf()9999?formatMoment($r,Cr?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):isFunction$3(Date.prototype.toISOString)?Cr?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",formatMoment($r,"Z")):formatMoment($r,Cr?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function inspect(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var Tr="moment",Cr="",$r,Ar,Rr,Dr;return this.isLocal()||(Tr=this.utcOffset()===0?"moment.utc":"moment.parseZone",Cr="Z"),$r="["+Tr+'("]',Ar=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",Rr="-MM-DD[T]HH:mm:ss.SSS",Dr=Cr+'[")]',this.format($r+Ar+Rr+Dr)}function format$3(Tr){Tr||(Tr=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat);var Cr=formatMoment(this,Tr);return this.localeData().postformat(Cr)}function from(Tr,Cr){return this.isValid()&&(isMoment(Tr)&&Tr.isValid()||createLocal(Tr).isValid())?createDuration({to:this,from:Tr}).locale(this.locale()).humanize(!Cr):this.localeData().invalidDate()}function fromNow(Tr){return this.from(createLocal(),Tr)}function to(Tr,Cr){return this.isValid()&&(isMoment(Tr)&&Tr.isValid()||createLocal(Tr).isValid())?createDuration({from:this,to:Tr}).locale(this.locale()).humanize(!Cr):this.localeData().invalidDate()}function toNow(Tr){return this.to(createLocal(),Tr)}function locale(Tr){var Cr;return Tr===void 0?this._locale._abbr:(Cr=getLocale(Tr),Cr!=null&&(this._locale=Cr),this)}var lang$1=deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(Tr){return Tr===void 0?this.localeData():this.locale(Tr)});function localeData(){return this._locale}var MS_PER_SECOND=1e3,MS_PER_MINUTE=60*MS_PER_SECOND,MS_PER_HOUR=60*MS_PER_MINUTE,MS_PER_400_YEARS=(365*400+97)*24*MS_PER_HOUR;function mod$1(Tr,Cr){return(Tr%Cr+Cr)%Cr}function localStartOfDate(Tr,Cr,$r){return Tr<100&&Tr>=0?new Date(Tr+400,Cr,$r)-MS_PER_400_YEARS:new Date(Tr,Cr,$r).valueOf()}function utcStartOfDate(Tr,Cr,$r){return Tr<100&&Tr>=0?Date.UTC(Tr+400,Cr,$r)-MS_PER_400_YEARS:Date.UTC(Tr,Cr,$r)}function startOf(Tr){var Cr,$r;if(Tr=normalizeUnits(Tr),Tr===void 0||Tr==="millisecond"||!this.isValid())return this;switch($r=this._isUTC?utcStartOfDate:localStartOfDate,Tr){case"year":Cr=$r(this.year(),0,1);break;case"quarter":Cr=$r(this.year(),this.month()-this.month()%3,1);break;case"month":Cr=$r(this.year(),this.month(),1);break;case"week":Cr=$r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":Cr=$r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":Cr=$r(this.year(),this.month(),this.date());break;case"hour":Cr=this._d.valueOf(),Cr-=mod$1(Cr+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case"minute":Cr=this._d.valueOf(),Cr-=mod$1(Cr,MS_PER_MINUTE);break;case"second":Cr=this._d.valueOf(),Cr-=mod$1(Cr,MS_PER_SECOND);break}return this._d.setTime(Cr),hooks.updateOffset(this,!0),this}function endOf(Tr){var Cr,$r;if(Tr=normalizeUnits(Tr),Tr===void 0||Tr==="millisecond"||!this.isValid())return this;switch($r=this._isUTC?utcStartOfDate:localStartOfDate,Tr){case"year":Cr=$r(this.year()+1,0,1)-1;break;case"quarter":Cr=$r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":Cr=$r(this.year(),this.month()+1,1)-1;break;case"week":Cr=$r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":Cr=$r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":Cr=$r(this.year(),this.month(),this.date()+1)-1;break;case"hour":Cr=this._d.valueOf(),Cr+=MS_PER_HOUR-mod$1(Cr+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case"minute":Cr=this._d.valueOf(),Cr+=MS_PER_MINUTE-mod$1(Cr,MS_PER_MINUTE)-1;break;case"second":Cr=this._d.valueOf(),Cr+=MS_PER_SECOND-mod$1(Cr,MS_PER_SECOND)-1;break}return this._d.setTime(Cr),hooks.updateOffset(this,!0),this}function valueOf(){return this._d.valueOf()-(this._offset||0)*6e4}function unix(){return Math.floor(this.valueOf()/1e3)}function toDate(){return new Date(this.valueOf())}function toArray(){var Tr=this;return[Tr.year(),Tr.month(),Tr.date(),Tr.hour(),Tr.minute(),Tr.second(),Tr.millisecond()]}function toObject(){var Tr=this;return{years:Tr.year(),months:Tr.month(),date:Tr.date(),hours:Tr.hours(),minutes:Tr.minutes(),seconds:Tr.seconds(),milliseconds:Tr.milliseconds()}}function toJSON(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid(this)}function parsingFlags(){return extend({},getParsingFlags(this))}function invalidAt(){return getParsingFlags(this).overflow}function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}addFormatToken("N",0,0,"eraAbbr");addFormatToken("NN",0,0,"eraAbbr");addFormatToken("NNN",0,0,"eraAbbr");addFormatToken("NNNN",0,0,"eraName");addFormatToken("NNNNN",0,0,"eraNarrow");addFormatToken("y",["y",1],"yo","eraYear");addFormatToken("y",["yy",2],0,"eraYear");addFormatToken("y",["yyy",3],0,"eraYear");addFormatToken("y",["yyyy",4],0,"eraYear");addRegexToken("N",matchEraAbbr);addRegexToken("NN",matchEraAbbr);addRegexToken("NNN",matchEraAbbr);addRegexToken("NNNN",matchEraName);addRegexToken("NNNNN",matchEraNarrow);addParseToken(["N","NN","NNN","NNNN","NNNNN"],function(Tr,Cr,$r,Ar){var Rr=$r._locale.erasParse(Tr,Ar,$r._strict);Rr?getParsingFlags($r).era=Rr:getParsingFlags($r).invalidEra=Tr});addRegexToken("y",matchUnsigned);addRegexToken("yy",matchUnsigned);addRegexToken("yyy",matchUnsigned);addRegexToken("yyyy",matchUnsigned);addRegexToken("yo",matchEraYearOrdinal);addParseToken(["y","yy","yyy","yyyy"],YEAR);addParseToken(["yo"],function(Tr,Cr,$r,Ar){var Rr;$r._locale._eraYearOrdinalRegex&&(Rr=Tr.match($r._locale._eraYearOrdinalRegex)),$r._locale.eraYearOrdinalParse?Cr[YEAR]=$r._locale.eraYearOrdinalParse(Tr,Rr):Cr[YEAR]=parseInt(Tr,10)});function localeEras(Tr,Cr){var $r,Ar,Rr,Dr=this._eras||getLocale("en")._eras;for($r=0,Ar=Dr.length;$r=0)return Dr[Ar]}function localeErasConvertYear(Tr,Cr){var $r=Tr.since<=Tr.until?1:-1;return Cr===void 0?hooks(Tr.since).year():hooks(Tr.since).year()+(Cr-Tr.offset)*$r}function getEraName(){var Tr,Cr,$r,Ar=this.localeData().eras();for(Tr=0,Cr=Ar.length;TrDr&&(Cr=Dr),setWeekAll.call(this,Tr,Cr,$r,Ar,Rr))}function setWeekAll(Tr,Cr,$r,Ar,Rr){var Dr=dayOfYearFromWeeks(Tr,Cr,$r,Ar,Rr),Mr=createUTCDate(Dr.year,0,Dr.dayOfYear);return this.year(Mr.getUTCFullYear()),this.month(Mr.getUTCMonth()),this.date(Mr.getUTCDate()),this}addFormatToken("Q",0,"Qo","quarter");addUnitAlias("quarter","Q");addUnitPriority("quarter",7);addRegexToken("Q",match1);addParseToken("Q",function(Tr,Cr){Cr[MONTH]=(toInt(Tr)-1)*3});function getSetQuarter(Tr){return Tr==null?Math.ceil((this.month()+1)/3):this.month((Tr-1)*3+this.month()%3)}addFormatToken("D",["DD",2],"Do","date");addUnitAlias("date","D");addUnitPriority("date",9);addRegexToken("D",match1to2);addRegexToken("DD",match1to2,match2);addRegexToken("Do",function(Tr,Cr){return Tr?Cr._dayOfMonthOrdinalParse||Cr._ordinalParse:Cr._dayOfMonthOrdinalParseLenient});addParseToken(["D","DD"],DATE);addParseToken("Do",function(Tr,Cr){Cr[DATE]=toInt(Tr.match(match1to2)[0])});var getSetDayOfMonth=makeGetSet("Date",!0);addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear");addUnitAlias("dayOfYear","DDD");addUnitPriority("dayOfYear",4);addRegexToken("DDD",match1to3);addRegexToken("DDDD",match3);addParseToken(["DDD","DDDD"],function(Tr,Cr,$r){$r._dayOfYear=toInt(Tr)});function getSetDayOfYear(Tr){var Cr=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return Tr==null?Cr:this.add(Tr-Cr,"d")}addFormatToken("m",["mm",2],0,"minute");addUnitAlias("minute","m");addUnitPriority("minute",14);addRegexToken("m",match1to2);addRegexToken("mm",match1to2,match2);addParseToken(["m","mm"],MINUTE);var getSetMinute=makeGetSet("Minutes",!1);addFormatToken("s",["ss",2],0,"second");addUnitAlias("second","s");addUnitPriority("second",15);addRegexToken("s",match1to2);addRegexToken("ss",match1to2,match2);addParseToken(["s","ss"],SECOND);var getSetSecond=makeGetSet("Seconds",!1);addFormatToken("S",0,0,function(){return~~(this.millisecond()/100)});addFormatToken(0,["SS",2],0,function(){return~~(this.millisecond()/10)});addFormatToken(0,["SSS",3],0,"millisecond");addFormatToken(0,["SSSS",4],0,function(){return this.millisecond()*10});addFormatToken(0,["SSSSS",5],0,function(){return this.millisecond()*100});addFormatToken(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});addFormatToken(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});addFormatToken(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});addFormatToken(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});addUnitAlias("millisecond","ms");addUnitPriority("millisecond",16);addRegexToken("S",match1to3,match1);addRegexToken("SS",match1to3,match2);addRegexToken("SSS",match1to3,match3);var token$1,getSetMillisecond;for(token$1="SSSS";token$1.length<=9;token$1+="S")addRegexToken(token$1,matchUnsigned);function parseMs(Tr,Cr){Cr[MILLISECOND]=toInt(("0."+Tr)*1e3)}for(token$1="S";token$1.length<=9;token$1+="S")addParseToken(token$1,parseMs);getSetMillisecond=makeGetSet("Milliseconds",!1);addFormatToken("z",0,0,"zoneAbbr");addFormatToken("zz",0,0,"zoneName");function getZoneAbbr(){return this._isUTC?"UTC":""}function getZoneName(){return this._isUTC?"Coordinated Universal Time":""}var proto=Moment.prototype;proto.add=add;proto.calendar=calendar$1;proto.clone=clone;proto.diff=diff;proto.endOf=endOf;proto.format=format$3;proto.from=from;proto.fromNow=fromNow;proto.to=to;proto.toNow=toNow;proto.get=stringGet;proto.invalidAt=invalidAt;proto.isAfter=isAfter;proto.isBefore=isBefore;proto.isBetween=isBetween;proto.isSame=isSame;proto.isSameOrAfter=isSameOrAfter;proto.isSameOrBefore=isSameOrBefore;proto.isValid=isValid$2;proto.lang=lang$1;proto.locale=locale;proto.localeData=localeData;proto.max=prototypeMax;proto.min=prototypeMin;proto.parsingFlags=parsingFlags;proto.set=stringSet;proto.startOf=startOf;proto.subtract=subtract;proto.toArray=toArray;proto.toObject=toObject;proto.toDate=toDate;proto.toISOString=toISOString;proto.inspect=inspect;typeof Symbol<"u"&&Symbol.for!=null&&(proto[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});proto.toJSON=toJSON;proto.toString=toString$2;proto.unix=unix;proto.valueOf=valueOf;proto.creationData=creationData;proto.eraName=getEraName;proto.eraNarrow=getEraNarrow;proto.eraAbbr=getEraAbbr;proto.eraYear=getEraYear;proto.year=getSetYear;proto.isLeapYear=getIsLeapYear;proto.weekYear=getSetWeekYear;proto.isoWeekYear=getSetISOWeekYear;proto.quarter=proto.quarters=getSetQuarter;proto.month=getSetMonth;proto.daysInMonth=getDaysInMonth;proto.week=proto.weeks=getSetWeek;proto.isoWeek=proto.isoWeeks=getSetISOWeek;proto.weeksInYear=getWeeksInYear;proto.weeksInWeekYear=getWeeksInWeekYear;proto.isoWeeksInYear=getISOWeeksInYear;proto.isoWeeksInISOWeekYear=getISOWeeksInISOWeekYear;proto.date=getSetDayOfMonth;proto.day=proto.days=getSetDayOfWeek;proto.weekday=getSetLocaleDayOfWeek;proto.isoWeekday=getSetISODayOfWeek;proto.dayOfYear=getSetDayOfYear;proto.hour=proto.hours=getSetHour;proto.minute=proto.minutes=getSetMinute;proto.second=proto.seconds=getSetSecond;proto.millisecond=proto.milliseconds=getSetMillisecond;proto.utcOffset=getSetOffset;proto.utc=setOffsetToUTC;proto.local=setOffsetToLocal;proto.parseZone=setOffsetToParsedOffset;proto.hasAlignedHourOffset=hasAlignedHourOffset;proto.isDST=isDaylightSavingTime;proto.isLocal=isLocal;proto.isUtcOffset=isUtcOffset;proto.isUtc=isUtc;proto.isUTC=isUtc;proto.zoneAbbr=getZoneAbbr;proto.zoneName=getZoneName;proto.dates=deprecate("dates accessor is deprecated. Use date instead.",getSetDayOfMonth);proto.months=deprecate("months accessor is deprecated. Use month instead",getSetMonth);proto.years=deprecate("years accessor is deprecated. Use year instead",getSetYear);proto.zone=deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",getSetZone);proto.isDSTShifted=deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",isDaylightSavingTimeShifted);function createUnix(Tr){return createLocal(Tr*1e3)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(Tr){return Tr}var proto$1=Locale.prototype;proto$1.calendar=calendar;proto$1.longDateFormat=longDateFormat;proto$1.invalidDate=invalidDate;proto$1.ordinal=ordinal;proto$1.preparse=preParsePostFormat;proto$1.postformat=preParsePostFormat;proto$1.relativeTime=relativeTime;proto$1.pastFuture=pastFuture;proto$1.set=set$1;proto$1.eras=localeEras;proto$1.erasParse=localeErasParse;proto$1.erasConvertYear=localeErasConvertYear;proto$1.erasAbbrRegex=erasAbbrRegex;proto$1.erasNameRegex=erasNameRegex;proto$1.erasNarrowRegex=erasNarrowRegex;proto$1.months=localeMonths;proto$1.monthsShort=localeMonthsShort;proto$1.monthsParse=localeMonthsParse;proto$1.monthsRegex=monthsRegex;proto$1.monthsShortRegex=monthsShortRegex;proto$1.week=localeWeek;proto$1.firstDayOfYear=localeFirstDayOfYear;proto$1.firstDayOfWeek=localeFirstDayOfWeek;proto$1.weekdays=localeWeekdays;proto$1.weekdaysMin=localeWeekdaysMin;proto$1.weekdaysShort=localeWeekdaysShort;proto$1.weekdaysParse=localeWeekdaysParse;proto$1.weekdaysRegex=weekdaysRegex;proto$1.weekdaysShortRegex=weekdaysShortRegex;proto$1.weekdaysMinRegex=weekdaysMinRegex;proto$1.isPM=localeIsPM;proto$1.meridiem=localeMeridiem;function get$1$1(Tr,Cr,$r,Ar){var Rr=getLocale(),Dr=createUTC().set(Ar,Cr);return Rr[$r](Dr,Tr)}function listMonthsImpl(Tr,Cr,$r){if(isNumber$3(Tr)&&(Cr=Tr,Tr=void 0),Tr=Tr||"",Cr!=null)return get$1$1(Tr,Cr,$r,"month");var Ar,Rr=[];for(Ar=0;Ar<12;Ar++)Rr[Ar]=get$1$1(Tr,Ar,$r,"month");return Rr}function listWeekdaysImpl(Tr,Cr,$r,Ar){typeof Tr=="boolean"?(isNumber$3(Cr)&&($r=Cr,Cr=void 0),Cr=Cr||""):(Cr=Tr,$r=Cr,Tr=!1,isNumber$3(Cr)&&($r=Cr,Cr=void 0),Cr=Cr||"");var Rr=getLocale(),Dr=Tr?Rr._week.dow:0,Mr,Br=[];if($r!=null)return get$1$1(Cr,($r+Dr)%7,Ar,"day");for(Mr=0;Mr<7;Mr++)Br[Mr]=get$1$1(Cr,(Mr+Dr)%7,Ar,"day");return Br}function listMonths(Tr,Cr){return listMonthsImpl(Tr,Cr,"months")}function listMonthsShort(Tr,Cr){return listMonthsImpl(Tr,Cr,"monthsShort")}function listWeekdays(Tr,Cr,$r){return listWeekdaysImpl(Tr,Cr,$r,"weekdays")}function listWeekdaysShort(Tr,Cr,$r){return listWeekdaysImpl(Tr,Cr,$r,"weekdaysShort")}function listWeekdaysMin(Tr,Cr,$r){return listWeekdaysImpl(Tr,Cr,$r,"weekdaysMin")}getSetGlobalLocale("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(Tr){var Cr=Tr%10,$r=toInt(Tr%100/10)===1?"th":Cr===1?"st":Cr===2?"nd":Cr===3?"rd":"th";return Tr+$r}});hooks.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",getSetGlobalLocale);hooks.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",getLocale);var mathAbs=Math.abs;function abs(){var Tr=this._data;return this._milliseconds=mathAbs(this._milliseconds),this._days=mathAbs(this._days),this._months=mathAbs(this._months),Tr.milliseconds=mathAbs(Tr.milliseconds),Tr.seconds=mathAbs(Tr.seconds),Tr.minutes=mathAbs(Tr.minutes),Tr.hours=mathAbs(Tr.hours),Tr.months=mathAbs(Tr.months),Tr.years=mathAbs(Tr.years),this}function addSubtract$1(Tr,Cr,$r,Ar){var Rr=createDuration(Cr,$r);return Tr._milliseconds+=Ar*Rr._milliseconds,Tr._days+=Ar*Rr._days,Tr._months+=Ar*Rr._months,Tr._bubble()}function add$1(Tr,Cr){return addSubtract$1(this,Tr,Cr,1)}function subtract$1(Tr,Cr){return addSubtract$1(this,Tr,Cr,-1)}function absCeil(Tr){return Tr<0?Math.floor(Tr):Math.ceil(Tr)}function bubble(){var Tr=this._milliseconds,Cr=this._days,$r=this._months,Ar=this._data,Rr,Dr,Mr,Br,Nr;return Tr>=0&&Cr>=0&&$r>=0||Tr<=0&&Cr<=0&&$r<=0||(Tr+=absCeil(monthsToDays($r)+Cr)*864e5,Cr=0,$r=0),Ar.milliseconds=Tr%1e3,Rr=absFloor(Tr/1e3),Ar.seconds=Rr%60,Dr=absFloor(Rr/60),Ar.minutes=Dr%60,Mr=absFloor(Dr/60),Ar.hours=Mr%24,Cr+=absFloor(Mr/24),Nr=absFloor(daysToMonths(Cr)),$r+=Nr,Cr-=absCeil(monthsToDays(Nr)),Br=absFloor($r/12),$r%=12,Ar.days=Cr,Ar.months=$r,Ar.years=Br,this}function daysToMonths(Tr){return Tr*4800/146097}function monthsToDays(Tr){return Tr*146097/4800}function as(Tr){if(!this.isValid())return NaN;var Cr,$r,Ar=this._milliseconds;if(Tr=normalizeUnits(Tr),Tr==="month"||Tr==="quarter"||Tr==="year")switch(Cr=this._days+Ar/864e5,$r=this._months+daysToMonths(Cr),Tr){case"month":return $r;case"quarter":return $r/3;case"year":return $r/12}else switch(Cr=this._days+Math.round(monthsToDays(this._months)),Tr){case"week":return Cr/7+Ar/6048e5;case"day":return Cr+Ar/864e5;case"hour":return Cr*24+Ar/36e5;case"minute":return Cr*1440+Ar/6e4;case"second":return Cr*86400+Ar/1e3;case"millisecond":return Math.floor(Cr*864e5)+Ar;default:throw new Error("Unknown unit "+Tr)}}function valueOf$1(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+toInt(this._months/12)*31536e6:NaN}function makeAs(Tr){return function(){return this.as(Tr)}}var asMilliseconds=makeAs("ms"),asSeconds=makeAs("s"),asMinutes=makeAs("m"),asHours=makeAs("h"),asDays=makeAs("d"),asWeeks=makeAs("w"),asMonths=makeAs("M"),asQuarters=makeAs("Q"),asYears=makeAs("y");function clone$1(){return createDuration(this)}function get$2(Tr){return Tr=normalizeUnits(Tr),this.isValid()?this[Tr+"s"]():NaN}function makeGetter(Tr){return function(){return this.isValid()?this._data[Tr]:NaN}}var milliseconds=makeGetter("milliseconds"),seconds=makeGetter("seconds"),minutes=makeGetter("minutes"),hours=makeGetter("hours"),days=makeGetter("days"),months=makeGetter("months"),years=makeGetter("years");function weeks(){return absFloor(this.days()/7)}var round=Math.round,thresholds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function substituteTimeAgo(Tr,Cr,$r,Ar,Rr){return Rr.relativeTime(Cr||1,!!$r,Tr,Ar)}function relativeTime$1(Tr,Cr,$r,Ar){var Rr=createDuration(Tr).abs(),Dr=round(Rr.as("s")),Mr=round(Rr.as("m")),Br=round(Rr.as("h")),Nr=round(Rr.as("d")),Lr=round(Rr.as("M")),Hr=round(Rr.as("w")),zr=round(Rr.as("y")),Ur=Dr<=$r.ss&&["s",Dr]||Dr<$r.s&&["ss",Dr]||Mr<=1&&["m"]||Mr<$r.m&&["mm",Mr]||Br<=1&&["h"]||Br<$r.h&&["hh",Br]||Nr<=1&&["d"]||Nr<$r.d&&["dd",Nr];return $r.w!=null&&(Ur=Ur||Hr<=1&&["w"]||Hr<$r.w&&["ww",Hr]),Ur=Ur||Lr<=1&&["M"]||Lr<$r.M&&["MM",Lr]||zr<=1&&["y"]||["yy",zr],Ur[2]=Cr,Ur[3]=+Tr>0,Ur[4]=Ar,substituteTimeAgo.apply(null,Ur)}function getSetRelativeTimeRounding(Tr){return Tr===void 0?round:typeof Tr=="function"?(round=Tr,!0):!1}function getSetRelativeTimeThreshold(Tr,Cr){return thresholds[Tr]===void 0?!1:Cr===void 0?thresholds[Tr]:(thresholds[Tr]=Cr,Tr==="s"&&(thresholds.ss=Cr-1),!0)}function humanize(Tr,Cr){if(!this.isValid())return this.localeData().invalidDate();var $r=!1,Ar=thresholds,Rr,Dr;return typeof Tr=="object"&&(Cr=Tr,Tr=!1),typeof Tr=="boolean"&&($r=Tr),typeof Cr=="object"&&(Ar=Object.assign({},thresholds,Cr),Cr.s!=null&&Cr.ss==null&&(Ar.ss=Cr.s-1)),Rr=this.localeData(),Dr=relativeTime$1(this,!$r,Ar,Rr),$r&&(Dr=Rr.pastFuture(+this,Dr)),Rr.postformat(Dr)}var abs$1=Math.abs;function sign(Tr){return(Tr>0)-(Tr<0)||+Tr}function toISOString$1(){if(!this.isValid())return this.localeData().invalidDate();var Tr=abs$1(this._milliseconds)/1e3,Cr=abs$1(this._days),$r=abs$1(this._months),Ar,Rr,Dr,Mr,Br=this.asSeconds(),Nr,Lr,Hr,zr;return Br?(Ar=absFloor(Tr/60),Rr=absFloor(Ar/60),Tr%=60,Ar%=60,Dr=absFloor($r/12),$r%=12,Mr=Tr?Tr.toFixed(3).replace(/\.?0+$/,""):"",Nr=Br<0?"-":"",Lr=sign(this._months)!==sign(Br)?"-":"",Hr=sign(this._days)!==sign(Br)?"-":"",zr=sign(this._milliseconds)!==sign(Br)?"-":"",Nr+"P"+(Dr?Lr+Dr+"Y":"")+($r?Lr+$r+"M":"")+(Cr?Hr+Cr+"D":"")+(Rr||Ar||Tr?"T":"")+(Rr?zr+Rr+"H":"")+(Ar?zr+Ar+"M":"")+(Tr?zr+Mr+"S":"")):"P0D"}var proto$2=Duration.prototype;proto$2.isValid=isValid$1;proto$2.abs=abs;proto$2.add=add$1;proto$2.subtract=subtract$1;proto$2.as=as;proto$2.asMilliseconds=asMilliseconds;proto$2.asSeconds=asSeconds;proto$2.asMinutes=asMinutes;proto$2.asHours=asHours;proto$2.asDays=asDays;proto$2.asWeeks=asWeeks;proto$2.asMonths=asMonths;proto$2.asQuarters=asQuarters;proto$2.asYears=asYears;proto$2.valueOf=valueOf$1;proto$2._bubble=bubble;proto$2.clone=clone$1;proto$2.get=get$2;proto$2.milliseconds=milliseconds;proto$2.seconds=seconds;proto$2.minutes=minutes;proto$2.hours=hours;proto$2.days=days;proto$2.weeks=weeks;proto$2.months=months;proto$2.years=years;proto$2.humanize=humanize;proto$2.toISOString=toISOString$1;proto$2.toString=toISOString$1;proto$2.toJSON=toISOString$1;proto$2.locale=locale;proto$2.localeData=localeData;proto$2.toIsoString=deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",toISOString$1);proto$2.lang=lang$1;addFormatToken("X",0,0,"unix");addFormatToken("x",0,0,"valueOf");addRegexToken("x",matchSigned);addRegexToken("X",matchTimestamp);addParseToken("X",function(Tr,Cr,$r){$r._d=new Date(parseFloat(Tr)*1e3)});addParseToken("x",function(Tr,Cr,$r){$r._d=new Date(toInt(Tr))});//! moment.js hooks.version="2.29.1";setHookCallback(createLocal);hooks.fn=proto;hooks.min=min$1;hooks.max=max$1;hooks.now=now;hooks.utc=createUTC;hooks.unix=createUnix;hooks.months=listMonths;hooks.isDate=isDate;hooks.locale=getSetGlobalLocale;hooks.invalid=createInvalid;hooks.duration=createDuration;hooks.isMoment=isMoment;hooks.weekdays=listWeekdays;hooks.parseZone=createInZone;hooks.localeData=getLocale;hooks.isDuration=isDuration;hooks.monthsShort=listMonthsShort;hooks.weekdaysMin=listWeekdaysMin;hooks.defineLocale=defineLocale;hooks.updateLocale=updateLocale;hooks.locales=listLocales;hooks.weekdaysShort=listWeekdaysShort;hooks.normalizeUnits=normalizeUnits;hooks.relativeTimeRounding=getSetRelativeTimeRounding;hooks.relativeTimeThreshold=getSetRelativeTimeThreshold;hooks.calendarFormat=getCalendarFormat;hooks.prototype=proto;hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const SCROLLBAR_MARGIN_RIGHT=4,STORYTIME_URL="https://storytime.prezo.ai",PDF_DIMS={leftPadding:120,topPadding:67.5,rightPadding:120,bottomPadding:17.5,footerHeight:50,scale:.9,offset:1.0204724409},guid=()=>v4(),sleep=async Tr=>{await new Promise(Cr=>setTimeout(Cr,Tr))},isObjectNullOrEmpty=Tr=>Tr==null||Object.keys(Tr).length===0&&Tr.constructor===Object,isEmail=Tr=>/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(Tr),isEmailValid=Tr=>{if(!isEmail(Tr))return!1;const Cr=Tr.split("@")[0];return/[a-zA-Z!#\$%&'\*\+\-\/=\?\^_`{\|}~]/.test(Cr)},debounce$1=(Tr,Cr)=>{let $r;return(...Ar)=>{window.clearTimeout($r),$r=window.setTimeout(()=>{Tr.apply(null,Ar)},Cr)}},logsnag=IS_CLIENT?new window.LogSnag({token:"9f0531931e4301952e8247eb3ab216f1",project:"prezo"}):{track:()=>{throw new Error("No-op")}};async function publishLog(Tr){try{const{channel:Cr,event:$r,description:Ar="",notify:Rr=!0,tags:Dr={}}=Tr;await logsnag.track({channel:Cr,event:$r,description:Ar,icon:"🔥",notify:Rr,tags:Dr})}catch(Cr){console.error(Cr)}}const FALLBACK_REGIONS=["us-east-1","us-west-2"],supabase$5=SupabaseWrapper.ogClient,{URL:SUPABASE_URL}=getSupabaseConfig(),MAX_RETRIES=3;function invokeWithRetries(Tr,Cr,$r){const Ar=async Rr=>{var Mr,Br,Nr;let Dr;for(let Lr=0;Lr0?{"x-region":FALLBACK_REGIONS[(Lr-1)%FALLBACK_REGIONS.length]}:{}});if(Hr.error)throw Hr.error;return{data:Hr.data,error:null}}catch(Hr){if(Dr||(Dr=Hr),Hr instanceof FunctionsHttpError&&((Mr=Hr.context)==null?void 0:Mr.status)===401)await getSessionWrapper();else{if(Hr instanceof FunctionsHttpError&&((Br=Hr.context)==null?void 0:Br.status)<500)break;if(Hr instanceof FunctionsHttpError&&((Nr=Hr.context)==null?void 0:Nr.status)>=500&&$r&&($r==null?void 0:$r.retryOn500)===!1)break}await sleep(2**Lr*1e3)}return console.error(Dr),await publishLog({channel:"custom-debugging",event:"edge-function-error-prod",description:`error: ${Dr==null?void 0:Dr.toString()} | data: ${JSON.stringify(Cr)} | function: ${Tr}`,notify:!1}),{data:null,error:Dr}};return Ar.url=`${SUPABASE_URL}/functions/v1/${Tr}`,Ar}const queryStripeLookup=invokeWithRetries("query-stripe"),queryStripePortal=invokeWithRetries("query-stripe-portal");invokeWithRetries("query-stripe-checkout");const queryPdf=invokeWithRetries("query-pdf-infinite",void 0,{retryOn500:!1}),queryChat=invokeWithRetries("query-chat"),queryGenerateDeck=invokeWithRetries("query-generate-deck",void 0,{retryOn500:!1}),queryGenerateSlide=invokeWithRetries("query-generate-slide",void 0,{retryOn500:!1}),queryCrispBooklet=invokeWithRetries("query-internal-crisp-deck"),websiteFuncName="query-websites",validateSubdomain=invokeWithRetries(websiteFuncName,{route:"validateSubdomain"}),updateSubdomain=invokeWithRetries(websiteFuncName,{route:"updateSubdomain"}),getPublicPath=invokeWithRetries(websiteFuncName,{route:"getPublicPath"}),getDeckIdFromSubdomainPath=invokeWithRetries(websiteFuncName,{route:"getDeckIdFromSubdomainPath"}),updatePathname=invokeWithRetries(websiteFuncName,{route:"updatePathname"}),validatePathname=invokeWithRetries(websiteFuncName,{route:"validatePathname"}),handlePublishing=invokeWithRetries(websiteFuncName,{route:"handlePublishing"}),deletePathname=invokeWithRetries(websiteFuncName,{route:"deletePathname"},{retryOn500:!1}),getHrefs=invokeWithRetries(websiteFuncName,{route:"getHrefs"}),getHref$1=invokeWithRetries(websiteFuncName,{route:"getHref"}),layoutPromptFuncName="query-layout-prompt";invokeWithRetries(layoutPromptFuncName,{route:"fetchLayout"});const fetchDeckTemplatePrompts=invokeWithRetries(layoutPromptFuncName,{route:"fetchDeckTemplatePrompts"}),fetchDeckTemplatePromptsWithGen=invokeWithRetries(layoutPromptFuncName,{route:"fetchDeckTemplatePromptsWithGen"}),generateFromLayout=invokeWithRetries(layoutPromptFuncName,{route:"generateFromLayout"}),updateLayout=invokeWithRetries(layoutPromptFuncName,{route:"updateLayout"}),updateDeckTemplate=invokeWithRetries(layoutPromptFuncName,{route:"updateDeckTemplate"}),updateGrpAssignment=invokeWithRetries(layoutPromptFuncName,{route:"updateGrpAssignment"});invokeWithRetries("query-generate-deck-template");const queryGenerateDeckTemplateGeneric=invokeWithRetries("query-generate-deck-template-generic");invokeWithRetries("query-generate-deck-use-case");const internalPromptFuncName="query-internal-prompt",createPromptSystem=invokeWithRetries(internalPromptFuncName,{route:"createPromptSystem"}),createPromptAction=invokeWithRetries(internalPromptFuncName,{route:"createPromptAction"}),deletePromptSystem=invokeWithRetries(internalPromptFuncName,{route:"deletePromptSystem"}),deletePromptAction=invokeWithRetries(internalPromptFuncName,{route:"deletePromptAction"}),fetchPromptSystems=invokeWithRetries(internalPromptFuncName,{route:"fetchPromptSystems"}),fetchPublishedPrompts=invokeWithRetries(internalPromptFuncName,{route:"fetchPublishedPrompts"}),updatePromptSystem=invokeWithRetries(internalPromptFuncName,{route:"updatePromptSystem"}),updatePromptAction=invokeWithRetries(internalPromptFuncName,{route:"updatePromptAction"}),generateFromAction=invokeWithRetries(internalPromptFuncName,{route:"generate"}),querySaveImg=invokeWithRetries("query-save-img"),queryStableDiffusionImg=invokeWithRetries("query-ai-image",void 0,{retryOn500:!1}),querySlideLayouts=invokeWithRetries("query-slide-layouts"),queryAddSlide=invokeWithRetries("query-add-slide"),queryForFonts=invokeWithRetries("query-google-fonts"),queryFetchHomePage=invokeWithRetries("query-workspace-fetch-org-homepage"),queryResourceSearchDecks=invokeWithRetries("query-resource-search-decks"),fetchOrgs=invokeWithRetries("query-workspace-fetch-orgs"),queryResourceUpdateFolder=invokeWithRetries("query-resource-update-folder"),queryWorkspaceUpdateOrg=invokeWithRetries("query-workspace-update-org"),queryResourceFetchOrg=invokeWithRetries("query-resource-fetch-specific-org"),queryWorkspaceCRUDMembers=invokeWithRetries("query-workspace-crud-member"),queryLayoutTemplate=invokeWithRetries("query-layout-template"),queryRequestProTier=invokeWithRetries("query-request-pro-tier"),queryRequestCustomFlow=invokeWithRetries("query-request-custom-flow");invokeWithRetries("query-request-template-flow");const queryRequestDemo=invokeWithRetries("query-request-demo"),queryWorkspaceFetchMeta=invokeWithRetries("query-workspace-fetch-meta"),fetchDeck=invokeWithRetries("query-resource-fetch-deck"),fetchPublicDeck=invokeWithRetries("query-public-decks"),fetchFolder$1=invokeWithRetries("query-resource-fetch-folder"),fetchSharedDecks=invokeWithRetries("query-fetch-shared-decks"),createDeck=invokeWithRetries("query-resource-create-deck"),duplicateDeck=invokeWithRetries("query-resource-duplicate-deck"),updateDeck=invokeWithRetries("query-resource-update-deck"),createSlide=invokeWithRetries("query-resource-create-slide"),duplicateSlide=invokeWithRetries("query-resource-duplicate-slide"),updateSlide=invokeWithRetries("query-resource-update-slide"),deleteSlide=invokeWithRetries("query-resource-delete-slide"),updateBlocks=invokeWithRetries("query-resource-update-blocks"),modifyBlocks=invokeWithRetries("query-resource-modify-blocks"),crudSlides=invokeWithRetries("query-resource-crud-slides"),createDeckPermission=invokeWithRetries("query-resource-deck-permission",{route:"create"}),createDeckPermissionWithRetries=invokeWithRetries("query-resource-deck-permission",{route:"create"}),updateDeckPermission=invokeWithRetries("query-resource-deck-permission",{route:"update"}),deleteDeckPermission=invokeWithRetries("query-resource-deck-permission",{route:"delete"}),verifyDeckPermission=invokeWithRetries("query-resource-deck-permission",{route:"verify"}),requestDeckAccess=invokeWithRetries("query-resource-deck-permission",{route:"requestAccess"}),createDeckPreview=invokeWithRetries("query-resource-create-deck-preview"),queryFetchWebpageMeta=invokeWithRetries("query-fetch-webpage-meta",void 0,{retryOn500:!1}),ORG_ID_EXCEPTIONS={crisp:"485c56d5-466b-4a33-8496-ab05e24f933e",emilFrey:"ebd2768f-8c37-4e46-b366-da97e6792654",devPrezo:"977a5679-b57f-4a8b-a133-5c263b9a0e7b",prezo:"0b758279-e9d9-4c4c-b6a4-e0d4d7ac36b2",localDev1:"0e71ed81-e1d3-44b9-a172-f72a99d5b2b9"},INTERNAL_ORG_IDS=["devPrezo","prezo","localDev1"].map(Tr=>ORG_ID_EXCEPTIONS[Tr]),showCrispDeckTheme=Tr=>INTERNAL_ORG_IDS.includes(Tr)||Tr===ORG_ID_EXCEPTIONS.crisp,showEmilFreyDeckTheme=Tr=>INTERNAL_ORG_IDS.includes(Tr)||Tr===ORG_ID_EXCEPTIONS.emilFrey,showGenBookletFlow=Tr=>Object.values(ORG_ID_EXCEPTIONS).includes(Tr),showTableCmdBar=Tr=>Object.values(ORG_ID_EXCEPTIONS).includes(Tr),showNewEmptyPageState=Tr=>Object.values(ORG_ID_EXCEPTIONS).includes(Tr)||isEnabled("emptyPageState"),showAssignedSysMenuBtn=()=>{const Tr=useUserStore().currentOrgId||"";return Object.values(ORG_ID_EXCEPTIONS).includes(Tr)},showInternalTool=()=>{const Tr=useUserStore().currentOrgId||"";return ORG_ID_EXCEPTIONS.devPrezo===Tr},queryTemplates=()=>{const Tr=useUserStore().currentOrgId||"";return ORG_ID_EXCEPTIONS.devPrezo===Tr},capitalizeFirstLetterOnly$1=Tr=>Tr==null?"":(Tr=Tr.toLowerCase(),Tr.charAt(0).toUpperCase()+Tr.slice(1)),MONTHLY_SUBSCRIPTION_PRICE=10,ANNUAL_SUBSCRIPTION_PRICE=8,PRICING_MAP={pro_plan_monthly:MONTHLY_SUBSCRIPTION_PRICE*2,pro_plan_annually:ANNUAL_SUBSCRIPTION_PRICE*2,pro_plan_basic_monthly:MONTHLY_SUBSCRIPTION_PRICE,pro_plan_basic_annually:ANNUAL_SUBSCRIPTION_PRICE},PRICING_TIERS={PRO_PLAN_MONTHLY:"pro_plan_monthly",PRO_PLAN_ANNUALLY:"pro_plan_annually",PRO_PLAN_BASIC_MONTHLY:"pro_plan_basic_monthly",PRO_PLAN_BASIC_ANNUALLY:"pro_plan_basic_annually"},PUBLISHED_DOMAIN={prod:"prezo.site",staging:"shareprezo.site",dev:"shareprezo.site"},getPublishedDomain=()=>PUBLISHED_DOMAIN.prod,extractUserDBData=Tr=>{const{id:Cr,first_name:$r,last_name:Ar,avatar_url:Rr,credits_allowed:Dr,email:Mr,created_at:Br}=Tr;return{id:Cr,email:Mr,first_name:$r,last_name:Ar,avatar_url:Rr,credits_allowed:Dr,created_at:Br??new Date().toISOString(),updated_at:new Date().toISOString()}},useUserStore=defineStore("userStore",{state:()=>({userData:{},allUsers:[],orgs:{},total_credits:0,currOrgId:null,usersOnDeck:{},orgFetchInProgress:!1,orgSubscriptions:{},loggedIn:!1,showCustomWorkflowForm:!0,analytics_properties:{}}),persist:!1,getters:{isLoggedIn:Tr=>Tr.loggedIn,pdfSettings(Tr){var Ar;const $r=this.getOrgName(Tr.currOrgId)||this.userFullName;return((Ar=Tr.userData.metadata)==null?void 0:Ar.pdfSettings)??{showAccLogo:!0,showAccName:!0,showCaption:!1,caption:`© ${new Date().getFullYear()} ${$r}. All rights reserved.`,showPageNum:!0}},userFullName(){return`${this.userFirstName} ${this.userLastName}`},userFirstName:Tr=>capitalizeFirstLetterOnly$1(Tr.userData.first_name??Tr.userData.email)??"",userLastName:Tr=>capitalizeFirstLetterOnly$1(Tr.userData.last_name??"")??"",userEmail:Tr=>Tr.userData.email,currentUser:Tr=>Tr.userData,currentUserId:Tr=>Tr.userData.id,currentUserEmail:Tr=>Tr.userData.email,userAvatarUrl:Tr=>Tr.userData.avatar_url??"",getUserFromId:Tr=>Cr=>Tr.allUsers.filter($r=>$r.id===Cr)[0],credits_remaining:Tr=>Tr.userData.credits_allowed==null?null:(Tr.userData.credits_allowed??500)-Tr.total_credits,currentOrgId:Tr=>Tr.currOrgId,getMemberCount:Tr=>Cr=>{var $r;return(($r=Tr.orgs[Cr])==null?void 0:$r.member_count)??1},getMembers:Tr=>Cr=>{var $r;return Cr==null?[]:(($r=Tr.orgs[Cr])==null?void 0:$r.members)??[]},getAllOrgsUniqueMembers(Tr){const Cr=new Set,$r=[];return Object.keys(Tr.orgs).forEach(Ar=>{this.getMembers(Ar).forEach(Rr=>{Cr.has(Rr.email)||(Cr.add(Rr.email),$r.push(Rr))})}),$r},getMemberName:Tr=>({orgId:Cr,userId:$r})=>{var Dr;if(Cr==null)return"";const Rr=(((Dr=Tr.orgs[Cr])==null?void 0:Dr.members)??[]).filter(Mr=>Mr.id===$r)[0];return Rr==null?"":`${capitalizeFirstLetterOnly$1(Rr.first_name)} ${capitalizeFirstLetterOnly$1(Rr.last_name)}`},getMemberAvatarUrl:Tr=>({orgId:Cr,userId:$r})=>{var Dr;if(Cr==null)return"";const Rr=(((Dr=Tr.orgs[Cr])==null?void 0:Dr.members)??[]).filter(Mr=>Mr.id===$r)[0];return Rr==null?"":Rr.avatar_url??""},getOrgAvatarUrl:Tr=>Cr=>{var $r,Ar;return Cr==null?"":((Ar=($r=Tr.orgs[Cr])==null?void 0:$r.orgs)==null?void 0:Ar.avatar_url)??""},getOrgName:Tr=>Cr=>{var $r,Ar;return Cr==null?"":((Ar=($r=Tr.orgs[Cr])==null?void 0:$r.orgs)==null?void 0:Ar.name)??""},getOrgActiveSubscription:Tr=>Cr=>{var $r;return Cr==null?null:((($r=Tr.orgSubscriptions[Cr])==null?void 0:$r.plans)??[]).find(Ar=>Ar.status==="active")??null},getOrgSubscriptions:Tr=>Cr=>Cr==null?{}:Tr.orgSubscriptions[Cr]??{},showWorkspaceView:Tr=>{var Cr;return Tr.currOrgId!=null&&(((Cr=Tr.orgs[Tr.currOrgId])==null?void 0:Cr.member_count)??1)>1},showWorkspaceViewForOrg:Tr=>Cr=>{var $r;return Cr!=null&&((($r=Tr.orgs[Cr])==null?void 0:$r.member_count)??1)>1},isAdmin:Tr=>Cr=>{var $r,Ar,Rr;return Cr==null?!1:(($r=Tr.orgs[Cr])==null?void 0:$r.membership)==="admin"||((Ar=Tr.orgs[Cr])==null?void 0:Ar.membership)==="owner"||((Rr=Tr.orgs[Cr])==null?void 0:Rr.member_count)===1},isMember:Tr=>Cr=>{var $r;return Cr==null?!1:(($r=Tr.orgs[Cr])==null?void 0:$r.membership)==="member"},isGuest:Tr=>Cr=>{var $r;return Cr==null?!1:(($r=Tr.orgs[Cr])==null?void 0:$r.membership)==="guest"},getUsersOnDeck:Tr=>Cr=>Tr.usersOnDeck[Cr]==null?[]:Tr.usersOnDeck[Cr],getOrgInviteLink:Tr=>Cr=>{var $r,Ar;return Cr==null?"":`${window.location.origin}/join/${Cr}/${new Date((Ar=($r=Tr.orgs[Cr])==null?void 0:$r.orgs)==null?void 0:Ar.created_at).getTime()}`},getSubscriptionTier:Tr=>Cr=>{var $r,Ar;return Cr==null?"free":((Ar=($r=Tr.orgs[Cr])==null?void 0:$r.orgs)==null?void 0:Ar.subscription_tier)??"free"},getSubscriptionPlan:Tr=>Cr=>{var Ar;if(Cr==null)return"";const $r=(((Ar=Tr.orgSubscriptions[Cr])==null?void 0:Ar.plans)??[]).find(Rr=>Rr.status==="active")??null;return $r!=null?$r.product_name:""},getOrgSubdomain:Tr=>Cr=>{var $r,Ar;return Cr==null?"":((Ar=($r=Tr.orgs[Cr])==null?void 0:$r.orgs)==null?void 0:Ar.subdomain)??""},isProSubscription:Tr=>Cr=>{var Dr,Mr,Br,Nr,Lr;if(Cr==null||((Dr=Tr.orgs[Cr])==null?void 0:Dr.orgs)==null)return!1;const $r=(Mr=Tr.userData)==null?void 0:Mr.email;return $r!=null&&($r!=null&&$r.endsWith("@prezo.ai")||$r!=null&&$r.endsWith("@dolphyn.io"))||showCrispDeckTheme(Cr)||showEmilFreyDeckTheme(Cr)||((((Br=Tr.orgSubscriptions[Cr])==null?void 0:Br.plans)??[]).find(Hr=>(Hr==null?void 0:Hr.status)==="active")??null)!=null?!0:isEnabled("billing")?!1:((Lr=(Nr=Tr.orgs[Cr])==null?void 0:Nr.orgs)==null?void 0:Lr.subscription_tier)==="pro"},isActionAllowed(Tr){return(Cr,$r)=>this.isProSubscription(Cr)?!0:!isBehindProGate($r)},isPDFDownloadAllowed(Tr){return Cr=>this.isActionAllowed(Cr,"pdf")},areUnlimitedDecksAllowed(Tr){return Cr=>this.isActionAllowed(Cr,"deckLimit")},isLogoChangeAllowed(Tr){return Cr=>this.isActionAllowed(Cr,"logoChange")},isInviteToWorkspaceAllowed(Tr){return Cr=>this.isActionAllowed(Cr,"inviteToWorkspace")},isInviteToDeckAllowed(Tr){return Cr=>this.isActionAllowed(Cr,"inviteToDeck")},getOrgDeckCount:Tr=>Cr=>{var $r;return Cr==null?0:(($r=Tr.orgs[Cr])==null?void 0:$r.deck_count)??0},getOrgFetchInProgress:Tr=>Tr.orgFetchInProgress,getShowCustomWorkflowForm:Tr=>Tr.showCustomWorkflowForm,getAnalyticsProperties:Tr=>Tr.analytics_properties},actions:{updateUserObject(Tr,Cr=!1){this.userData=Object.assign({},Tr),Cr&&updateProfile(Tr.id,extractUserDBData(Tr))},updateTotalCredits(Tr){this.total_credits=Tr},addToTotalCredits(Tr){this.total_credits+=Tr},updateOrgs(Tr){Tr.forEach(Cr=>{this.orgs[Cr.org_id]=Cr})},updateCurrentOrgId(Tr){if(this.currOrgId=Tr,!IS_CLIENT||this.currentUserId==null)return;const Cr=localStorage.getItem("user_org_map");if(Cr==null)localStorage.setItem("user_org_map",JSON.stringify({[this.currentUserId]:Tr}));else{const $r=JSON.parse(Cr);$r[this.currentUserId]=Tr,localStorage.setItem("user_org_map",JSON.stringify($r))}},async updateOrgSubscriptions(){const{data:Tr,error:Cr}=await queryStripeLookup({});Cr||!Tr||(this.orgSubscriptions=Tr)},useStoredOrgIdIfAvailable(){if(!IS_CLIENT)return null;const Tr=localStorage.getItem("user_org_map");if(Tr==null||this.currentUserId==null)return null;const Cr=JSON.parse(Tr);return Cr[this.currentUserId]==null||Cr[this.currentUserId]===""?null:(this.currOrgId=Cr[this.currentUserId],Cr[this.currentUserId])},async fetchAndHydrateOrgsForUser(Tr){var Nr;const Cr=useUserStore();this.orgFetchInProgress=!0;const $r=await Promise.allSettled([fetchOrgs({}),Cr.updateOrgSubscriptions()]);let Ar=null,Rr=null;if($r.forEach((Lr,Hr)=>{Lr.status==="fulfilled"&&Hr===0&&Lr.value&&(Ar=Lr.value.data,Rr=Lr.value.error)}),this.orgFetchInProgress=!1,Ar==null||Ar.orgs==null||Ar.orgs.length===0)return null;if(Rr)return console.error(Rr),null;if(Cr.updateOrgs(Ar.orgs),!IS_CLIENT)return null;const Dr=Ar.orgs,Mr=localStorage.getItem("user_org_map"),Br=Mr==null?null:JSON.parse(Mr)[Tr];Br!=null&&Dr.filter(Lr=>Lr.orgs.id===Br).length>0?Cr.updateCurrentOrgId(Br):Cr.updateCurrentOrgId((Nr=Dr[0])==null?void 0:Nr.org_id)},async updateOrg({orgId:Tr,name:Cr,avatar_url:$r}){const{data:Ar,error:Rr}=await queryWorkspaceUpdateOrg({orgId:Tr,name:Cr,avatar_url:$r});return Rr?(console.error(Rr),null):(this.orgs[Tr].orgs.name=Cr??this.orgs[Tr].orgs.name,this.orgs[Tr].orgs.avatar_url=$r??this.orgs[Tr].orgs.avatar_url,Ar)},setUsersOnDeck({deckId:Tr,value:Cr}){this.usersOnDeck[Tr]=Cr},setLoggedIn(Tr){this.loggedIn=Tr},setCustomWorkflowForm(Tr){this.showCustomWorkflowForm=Tr},setAnalyticsProperties(Tr){this.analytics_properties={...this.analytics_properties,...Tr}}}}),supabase$4=SupabaseWrapper.client,socialLoginForInvites=async({inviteId:Tr,inviteKey:Cr})=>{var Dr;let $r=`${((Dr=window==null?void 0:window.location)==null?void 0:Dr.origin)??"https://app.prezo.ai"}/oauth`;$r=`${$r}?inviteId=${Tr}&inviteKey=${Cr}`;const{data:Ar,error:Rr}=await supabase$4.auth.signInWithOAuth({provider:"google",options:{redirectTo:$r}});Rr&&router.push({path:"https://app.prezo.ai"})},logout=async()=>{const{error:Tr}=await supabase$4.auth.signOut();return Tr||(Ir.reset(),useUserStore().setLoggedIn(!1)),{error:Tr}},getSession=async()=>{const{data:Tr,error:Cr}=await supabase$4.auth.getSession();return{data:Tr,error:Cr}},getSessionWrapper=async()=>{const Tr=useUserStore(),{data:Cr,error:$r}=await supabase$4.auth.getSession(),Ar=(Cr==null?void 0:Cr.session)!=null;return Tr.setLoggedIn(Ar),{data:Cr,error:$r}};var lodash={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */lodash.exports;(function(Tr,Cr){(function(){var $r,Ar="4.17.20",Rr=200,Dr="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",Mr="Expected a function",Br="__lodash_hash_undefined__",Nr=500,Lr="__lodash_placeholder__",Hr=1,zr=2,Ur=4,Vr=1,jr=2,Gr=1,Xr=2,Kr=4,Zr=8,eo=16,Wr=32,Yr=64,Jr=128,no=256,ro=512,so=30,ao="...",lo=800,po=16,go=1,co=2,mo=3,io=1/0,uo=9007199254740991,ho=17976931348623157e292,yo=0/0,So=4294967295,ko=So-1,$o=So>>>1,Go=[["ary",Jr],["bind",Gr],["bindKey",Xr],["curry",Zr],["curryRight",eo],["flip",ro],["partial",Wr],["partialRight",Yr],["rearg",no]],No="[object Arguments]",Eo="[object Array]",Mo="[object AsyncFunction]",Ro="[object Boolean]",Ao="[object Date]",zo="[object DOMException]",Oo="[object Error]",Bo="[object Function]",bo="[object GeneratorFunction]",vo="[object Map]",Io="[object Number]",To="[object Null]",Co="[object Object]",Po="[object Promise]",Fo="[object Proxy]",Vo="[object RegExp]",Ko="[object Set]",Uo="[object String]",ei="[object Symbol]",qo="[object Undefined]",ri="[object WeakMap]",ki="[object WeakSet]",ti="[object ArrayBuffer]",ai="[object DataView]",Xo="[object Float32Array]",si="[object Float64Array]",vi="[object Int8Array]",Ci="[object Int16Array]",wi="[object Int32Array]",bi="[object Uint8Array]",li="[object Uint8ClampedArray]",ci="[object Uint16Array]",Ii="[object Uint32Array]",Ni=/\b__p \+= '';/g,Ei=/\b(__p \+=) '' \+/g,$i=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ri=/&(?:amp|lt|gt|quot|#39);/g,Fi=/[&<>"']/g,bs=RegExp(Ri.source),qi=RegExp(Fi.source),Mi=/<%-([\s\S]+?)%>/g,Ui=/<%([\s\S]+?)%>/g,Ki=/<%=([\s\S]+?)%>/g,Ss=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gs=/^\w*$/,Fs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yi=/[\\^$.*+?()[\]{}|]/g,vs=RegExp(Yi.source),fs=/^\s+|\s+$/g,da=/^\s+/,di=/\s+$/,ss=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ls=/\{\n\/\* \[wrapped with (.+)\] \*/,ha=/,? & /,na=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wa=/\\(\\)?/g,ys=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ls=/\w*$/,Hs=/^[-+]0x[0-9a-f]+$/i,ra=/^0b[01]+$/i,ps=/^\[object .+?Constructor\]$/,Ms=/^0o[0-7]+$/i,ds=/^(?:0|[1-9]\d*)$/,rs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zs=/($^)/,Js=/['\n\r\u2028\u2029\\]/g,Ai="\\ud800-\\udfff",$s="\\u0300-\\u036f",Ps="\\ufe20-\\ufe2f",Os="\\u20d0-\\u20ff",Bs=$s+Ps+Os,Es="\\u2700-\\u27bf",Xa="a-z\\xdf-\\xf6\\xf8-\\xff",cl="\\xac\\xb1\\xd7\\xf7",Za="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Da="\\u2000-\\u206f",Ja=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ma="A-Z\\xc0-\\xd6\\xd8-\\xde",Ba="\\ufe0e\\ufe0f",fa=cl+Za+Da+Ja,Ks="['’]",oa="["+Ai+"]",ja="["+fa+"]",Ia="["+Bs+"]",Qa="\\d+",ul="["+Es+"]",$l="["+Xa+"]",Al="[^"+Ai+fa+Qa+Es+Xa+Ma+"]",tl="\\ud83c[\\udffb-\\udfff]",Yl="(?:"+Ia+"|"+tl+")",Rl="[^"+Ai+"]",dl="(?:\\ud83c[\\udde6-\\uddff]){2}",pa="[\\ud800-\\udbff][\\udc00-\\udfff]",js="["+Ma+"]",Qs="\\u200d",Ws="(?:"+$l+"|"+Al+")",Pl="(?:"+js+"|"+Al+")",nl="(?:"+Ks+"(?:d|ll|m|re|s|t|ve))?",hl="(?:"+Ks+"(?:D|LL|M|RE|S|T|VE))?",rl=Yl+"?",Ol="["+Ba+"]?",ol="(?:"+Qs+"(?:"+[Rl,dl,pa].join("|")+")"+Ol+rl+")*",Fl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ml=Ol+rl+ol,Xl="(?:"+[ul,dl,pa].join("|")+")"+Ml,Ds="(?:"+[Rl+Ia+"?",Ia,dl,pa,oa].join("|")+")",Zl=RegExp(Ks,"g"),Bl=RegExp(Ia,"g"),ia=RegExp(tl+"(?="+tl+")|"+Ds+Ml,"g"),Jl=RegExp([js+"?"+$l+"+"+nl+"(?="+[ja,js,"$"].join("|")+")",Pl+"+"+hl+"(?="+[ja,js+Ws,"$"].join("|")+")",js+"?"+Ws+"+"+nl,js+"+"+hl,Dl,Fl,Qa,Xl].join("|"),"g"),Ql=RegExp("["+Qs+Ai+Bs+Ba+"]"),ec=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Hl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],fl=-1,xs={};xs[Xo]=xs[si]=xs[vi]=xs[Ci]=xs[wi]=xs[bi]=xs[li]=xs[ci]=xs[Ii]=!0,xs[No]=xs[Eo]=xs[ti]=xs[Ro]=xs[ai]=xs[Ao]=xs[Oo]=xs[Bo]=xs[vo]=xs[Io]=xs[Co]=xs[Vo]=xs[Ko]=xs[Uo]=xs[ri]=!1;var ws={};ws[No]=ws[Eo]=ws[ti]=ws[ai]=ws[Ro]=ws[Ao]=ws[Xo]=ws[si]=ws[vi]=ws[Ci]=ws[wi]=ws[vo]=ws[Io]=ws[Co]=ws[Vo]=ws[Ko]=ws[Uo]=ws[ei]=ws[bi]=ws[li]=ws[ci]=ws[Ii]=!0,ws[Oo]=ws[Bo]=ws[ri]=!1;var tc={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Oi={"&":"&","<":"<",">":">",'"':""","'":"'"},Zi={"&":"&","<":"<",">":">",""":'"',"'":"'"},ji={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},sa=parseFloat,Gs=parseInt,pl=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ml=typeof self=="object"&&self&&self.Object===Object&&self,Rs=pl||ml||Function("return this")(),zl=Cr&&!Cr.nodeType&&Cr,Wa=zl&&!0&&Tr&&!Tr.nodeType&&Tr,nc=Wa&&Wa.exports===zl,rc=nc&&pl.process,ma=function(){try{var Jo=Wa&&Wa.require&&Wa.require("util").types;return Jo||rc&&rc.binding&&rc.binding("util")}catch{}}(),oc=ma&&ma.isArrayBuffer,lc=ma&&ma.isDate,yc=ma&&ma.isMap,vl=ma&&ma.isRegExp,_c=ma&&ma.isSet,Mc=ma&&ma.isTypedArray;function aa(Jo,hi,oi){switch(oi.length){case 0:return Jo.call(hi);case 1:return Jo.call(hi,oi[0]);case 2:return Jo.call(hi,oi[0],oi[1]);case 3:return Jo.call(hi,oi[0],oi[1],oi[2])}return Jo.apply(hi,oi)}function Bc(Jo,hi,oi,Li){for(var Ji=-1,Ts=Jo==null?0:Jo.length;++Ji-1}function yi(Jo,hi,oi){for(var Li=-1,Ji=Jo==null?0:Jo.length;++Li-1;);return oi}function Wd(Jo,hi){for(var oi=Jo.length;oi--&&qs(hi,Jo[oi],0)>-1;);return oi}function Uf(Jo,hi){for(var oi=Jo.length,Li=0;oi--;)Jo[oi]===hi&&++Li;return Li}var Vf=kc(tc),jf=kc(Oi);function Wf(Jo){return"\\"+ji[Jo]}function Gf(Jo,hi){return Jo==null?$r:Jo[hi]}function wc(Jo){return Ql.test(Jo)}function qf(Jo){return ec.test(Jo)}function Kf(Jo){for(var hi,oi=[];!(hi=Jo.next()).done;)oi.push(hi.value);return oi}function ju(Jo){var hi=-1,oi=Array(Jo.size);return Jo.forEach(function(Li,Ji){oi[++hi]=[Ji,Li]}),oi}function Gd(Jo,hi){return function(oi){return Jo(hi(oi))}}function Ul(Jo,hi){for(var oi=-1,Li=Jo.length,Ji=0,Ts=[];++oi-1}function Np(qr,Qr){var oo=this.__data__,fo=vu(oo,qr);return fo<0?(++this.size,oo.push([qr,Qr])):oo[fo][1]=Qr,this}bl.prototype.clear=Fp,bl.prototype.delete=Dp,bl.prototype.get=Mp,bl.prototype.has=Bp,bl.prototype.set=Np;function kl(qr){var Qr=-1,oo=qr==null?0:qr.length;for(this.clear();++Qr=Qr?qr:Qr)),qr}function Ha(qr,Qr,oo,fo,_o,xo){var Lo,jo=Qr&Hr,Zo=Qr&zr,fi=Qr&Ur;if(oo&&(Lo=_o?oo(qr,fo,_o,xo):oo(qr)),Lo!==$r)return Lo;if(!Ns(qr))return qr;var mi=Qi(qr);if(mi){if(Lo=Wm(qr),!jo)return Ea(qr,Lo)}else{var _i=va(qr),Di=_i==Bo||_i==bo;if(Kl(qr))return Ch(qr,jo);if(_i==Co||_i==No||Di&&!_o){if(Lo=Zo||Di?{}:Gh(qr),!jo)return Zo?Fm(qr,em(Lo,qr)):Om(qr,rh(Lo,qr))}else{if(!ws[_i])return _o?qr:{};Lo=Gm(qr,_i,jo)}}xo||(xo=new qa);var Hi=xo.get(qr);if(Hi)return Hi;xo.set(qr,Lo),wf(qr)?qr.forEach(function(Wi){Lo.add(Ha(Wi,Qr,oo,Wi,qr,xo))}):kf(qr)&&qr.forEach(function(Wi,ms){Lo.set(ms,Ha(Wi,Qr,oo,ms,qr,xo))});var Gi=fi?Zo?vd:gd:Zo?Ta:ea,us=mi?$r:Gi(qr);return la(us||qr,function(Wi,ms){us&&(ms=Wi,Wi=qr[ms]),Wc(Lo,ms,Ha(Wi,Qr,oo,ms,qr,xo))}),Lo}function tm(qr){var Qr=ea(qr);return function(oo){return oh(oo,qr,Qr)}}function oh(qr,Qr,oo){var fo=oo.length;if(qr==null)return!fo;for(qr=As(qr);fo--;){var _o=oo[fo],xo=Qr[_o],Lo=qr[_o];if(Lo===$r&&!(_o in qr)||!xo(Lo))return!1}return!0}function ih(qr,Qr,oo){if(typeof qr!="function")throw new Na(Mr);return Jc(function(){qr.apply($r,oo)},Qr)}function Gc(qr,Qr,oo,fo){var _o=-1,xo=ui,Lo=!0,jo=qr.length,Zo=[],fi=Qr.length;if(!jo)return Zo;oo&&(Qr=gi(Qr,$a(oo))),fo?(xo=yi,Lo=!1):Qr.length>=Rr&&(xo=Lc,Lo=!1,Qr=new hc(Qr));e:for(;++_o_o?0:_o+oo),fo=fo===$r||fo>_o?_o:is(fo),fo<0&&(fo+=_o),fo=oo>fo?0:xf(fo);oo0&&oo(jo)?Qr>1?ua(jo,Qr-1,oo,fo,_o):Si(_o,jo):fo||(_o[_o.length]=jo)}return _o}var Zu=Oh(),lh=Oh(!0);function il(qr,Qr){return qr&&Zu(qr,Qr,ea)}function Ju(qr,Qr){return qr&&lh(qr,Qr,ea)}function _u(qr,Qr){return Qo(Qr,function(oo){return Tl(qr[oo])})}function pc(qr,Qr){Qr=Gl(Qr,qr);for(var oo=0,fo=Qr.length;qr!=null&&ooQr}function im(qr,Qr){return qr!=null&&Is.call(qr,Qr)}function sm(qr,Qr){return qr!=null&&Qr in As(qr)}function am(qr,Qr,oo){return qr>=ga(Qr,oo)&&qr=120&&mi.length>=120)?new hc(Lo&&mi):$r}mi=qr[0];var _i=-1,Di=jo[0];e:for(;++_i<_o&&fi.length-1;)jo!==qr&&cu.call(jo,Zo,1),cu.call(qr,Zo,1);return qr}function _h(qr,Qr){for(var oo=qr?Qr.length:0,fo=oo-1;oo--;){var _o=Qr[oo];if(oo==fo||_o!==xo){var xo=_o;xl(_o)?cu.call(qr,_o,1):ld(qr,_o)}}return qr}function id(qr,Qr){return qr+hu(Qd()*(Qr-qr+1))}function km(qr,Qr,oo,fo){for(var _o=-1,xo=Xs(du((Qr-qr)/(oo||1)),0),Lo=oi(xo);xo--;)Lo[fo?xo:++_o]=qr,qr+=oo;return Lo}function sd(qr,Qr){var oo="";if(!qr||Qr<1||Qr>uo)return oo;do Qr%2&&(oo+=qr),Qr=hu(Qr/2),Qr&&(qr+=qr);while(Qr);return oo}function hs(qr,Qr){return Ed(Yh(qr,Qr,Ca),qr+"")}function Sm(qr){return nh(Dc(qr))}function wm(qr,Qr){var oo=Dc(qr);return Au(oo,fc(Qr,0,oo.length))}function Yc(qr,Qr,oo,fo){if(!Ns(qr))return qr;Qr=Gl(Qr,qr);for(var _o=-1,xo=Qr.length,Lo=xo-1,jo=qr;jo!=null&&++_o_o?0:_o+Qr),oo=oo>_o?_o:oo,oo<0&&(oo+=_o),_o=Qr>oo?0:oo-Qr>>>0,Qr>>>=0;for(var xo=oi(_o);++fo<_o;)xo[fo]=qr[fo+Qr];return xo}function Tm(qr,Qr){var oo;return jl(qr,function(fo,_o,xo){return oo=Qr(fo,_o,xo),!oo}),!!oo}function ku(qr,Qr,oo){var fo=0,_o=qr==null?fo:qr.length;if(typeof Qr=="number"&&Qr===Qr&&_o<=$o){for(;fo<_o;){var xo=fo+_o>>>1,Lo=qr[xo];Lo!==null&&!Ra(Lo)&&(oo?Lo<=Qr:Lo=Rr){var fi=Qr?null:Nm(qr);if(fi)return eu(fi);Lo=!1,_o=Lc,Zo=new hc}else Zo=Qr?[]:jo;e:for(;++fo=fo?qr:za(qr,Qr,oo)}var Th=up||function(qr){return Rs.clearTimeout(qr)};function Ch(qr,Qr){if(Qr)return qr.slice();var oo=qr.length,fo=Kd?Kd(oo):new qr.constructor(oo);return qr.copy(fo),fo}function fd(qr){var Qr=new qr.constructor(qr.byteLength);return new au(Qr).set(new au(qr)),Qr}function $m(qr,Qr){var oo=Qr?fd(qr.buffer):qr.buffer;return new qr.constructor(oo,qr.byteOffset,qr.byteLength)}function Am(qr){var Qr=new qr.constructor(qr.source,ls.exec(qr));return Qr.lastIndex=qr.lastIndex,Qr}function Rm(qr){return jc?As(jc.call(qr)):{}}function Ih(qr,Qr){var oo=Qr?fd(qr.buffer):qr.buffer;return new qr.constructor(oo,qr.byteOffset,qr.length)}function $h(qr,Qr){if(qr!==Qr){var oo=qr!==$r,fo=qr===null,_o=qr===qr,xo=Ra(qr),Lo=Qr!==$r,jo=Qr===null,Zo=Qr===Qr,fi=Ra(Qr);if(!jo&&!fi&&!xo&&qr>Qr||xo&&Lo&&Zo&&!jo&&!fi||fo&&Lo&&Zo||!oo&&Zo||!_o)return 1;if(!fo&&!xo&&!fi&&qr=jo)return Zo;var fi=oo[fo];return Zo*(fi=="desc"?-1:1)}}return qr.index-Qr.index}function Ah(qr,Qr,oo,fo){for(var _o=-1,xo=qr.length,Lo=oo.length,jo=-1,Zo=Qr.length,fi=Xs(xo-Lo,0),mi=oi(Zo+fi),_i=!fo;++jo1?oo[_o-1]:$r,Lo=_o>2?oo[2]:$r;for(xo=qr.length>3&&typeof xo=="function"?(_o--,xo):$r,Lo&&ka(oo[0],oo[1],Lo)&&(xo=_o<3?$r:xo,_o=1),Qr=As(Qr);++fo<_o;){var jo=oo[fo];jo&&qr(Qr,jo,fo,xo)}return Qr})}function Ph(qr,Qr){return function(oo,fo){if(oo==null)return oo;if(!xa(oo))return qr(oo,fo);for(var _o=oo.length,xo=Qr?_o:-1,Lo=As(oo);(Qr?xo--:++xo<_o)&&fo(Lo[xo],xo,Lo)!==!1;);return oo}}function Oh(qr){return function(Qr,oo,fo){for(var _o=-1,xo=As(Qr),Lo=fo(Qr),jo=Lo.length;jo--;){var Zo=Lo[qr?jo:++_o];if(oo(xo[Zo],Zo,xo)===!1)break}return Qr}}function Dm(qr,Qr,oo){var fo=Qr&Gr,_o=Xc(qr);function xo(){var Lo=this&&this!==Rs&&this instanceof xo?_o:qr;return Lo.apply(fo?oo:this,arguments)}return xo}function Fh(qr){return function(Qr){Qr=Cs(Qr);var oo=wc(Qr)?Ga(Qr):$r,fo=oo?oo[0]:Qr.charAt(0),_o=oo?ql(oo,1).join(""):Qr.slice(1);return fo[qr]()+_o}}function Pc(qr){return function(Qr){return Do(Ff(Of(Qr).replace(Zl,"")),qr,"")}}function Xc(qr){return function(){var Qr=arguments;switch(Qr.length){case 0:return new qr;case 1:return new qr(Qr[0]);case 2:return new qr(Qr[0],Qr[1]);case 3:return new qr(Qr[0],Qr[1],Qr[2]);case 4:return new qr(Qr[0],Qr[1],Qr[2],Qr[3]);case 5:return new qr(Qr[0],Qr[1],Qr[2],Qr[3],Qr[4]);case 6:return new qr(Qr[0],Qr[1],Qr[2],Qr[3],Qr[4],Qr[5]);case 7:return new qr(Qr[0],Qr[1],Qr[2],Qr[3],Qr[4],Qr[5],Qr[6])}var oo=Ac(qr.prototype),fo=qr.apply(oo,Qr);return Ns(fo)?fo:oo}}function Mm(qr,Qr,oo){var fo=Xc(qr);function _o(){for(var xo=arguments.length,Lo=oi(xo),jo=xo,Zo=Oc(_o);jo--;)Lo[jo]=arguments[jo];var fi=xo<3&&Lo[0]!==Zo&&Lo[xo-1]!==Zo?[]:Ul(Lo,Zo);if(xo-=fi.length,xo-1?_o[xo?Qr[Lo]:Lo]:$r}}function Mh(qr){return El(function(Qr){var oo=Qr.length,fo=oo,_o=La.prototype.thru;for(qr&&Qr.reverse();fo--;){var xo=Qr[fo];if(typeof xo!="function")throw new Na(Mr);if(_o&&!Lo&&Iu(xo)=="wrapper")var Lo=new La([],!0)}for(fo=Lo?fo:oo;++fo1&&ks.reverse(),mi&&Zojo))return!1;var fi=xo.get(qr),mi=xo.get(Qr);if(fi&&mi)return fi==Qr&&mi==qr;var _i=-1,Di=!0,Hi=oo&jr?new hc:$r;for(xo.set(qr,Qr),xo.set(Qr,qr);++_i1?"& ":"")+Qr[fo],Qr=Qr.join(oo>2?", ":" "),qr.replace(ss,`{ /* [wrapped with `+Qr+`] */ `)}function Km(qr){return Qi(qr)||vc(qr)||!!(Zd&&qr&&qr[Zd])}function xl(qr,Qr){var oo=typeof qr;return Qr=Qr??uo,!!Qr&&(oo=="number"||oo!="symbol"&&ds.test(qr))&&qr>-1&&qr%1==0&&qr0){if(++Qr>=lo)return arguments[0]}else Qr=0;return qr.apply($r,arguments)}}function Au(qr,Qr){var oo=-1,fo=qr.length,_o=fo-1;for(Qr=Qr===$r?fo:Qr;++oo1?qr[Qr-1]:$r;return oo=typeof oo=="function"?(qr.pop(),oo):$r,cf(qr,oo)});function uf(qr){var Qr=wo(qr);return Qr.__chain__=!0,Qr}function cv(qr,Qr){return Qr(qr),qr}function Ru(qr,Qr){return Qr(qr)}var uv=El(function(qr){var Qr=qr.length,oo=Qr?qr[0]:0,fo=this.__wrapped__,_o=function(xo){return Xu(xo,qr)};return Qr>1||this.__actions__.length||!(fo instanceof _s)||!xl(oo)?this.thru(_o):(fo=fo.slice(oo,+oo+(Qr?1:0)),fo.__actions__.push({func:Ru,args:[_o],thisArg:$r}),new La(fo,this.__chain__).thru(function(xo){return Qr&&!xo.length&&xo.push($r),xo}))});function dv(){return uf(this)}function hv(){return new La(this.value(),this.__chain__)}function fv(){this.__values__===$r&&(this.__values__=Ef(this.value()));var qr=this.__index__>=this.__values__.length,Qr=qr?$r:this.__values__[this.__index__++];return{done:qr,value:Qr}}function pv(){return this}function mv(qr){for(var Qr,oo=this;oo instanceof gu;){var fo=tf(oo);fo.__index__=0,fo.__values__=$r,Qr?_o.__wrapped__=fo:Qr=fo;var _o=fo;oo=oo.__wrapped__}return _o.__wrapped__=qr,Qr}function gv(){var qr=this.__wrapped__;if(qr instanceof _s){var Qr=qr;return this.__actions__.length&&(Qr=new _s(this)),Qr=Qr.reverse(),Qr.__actions__.push({func:Ru,args:[xd],thisArg:$r}),new La(Qr,this.__chain__)}return this.thru(xd)}function vv(){return Eh(this.__wrapped__,this.__actions__)}var yv=wu(function(qr,Qr,oo){Is.call(qr,oo)?++qr[oo]:Sl(qr,oo,1)});function _v(qr,Qr,oo){var fo=Qi(qr)?Yo:nm;return oo&&ka(qr,Qr,oo)&&(Qr=$r),fo(qr,Vi(Qr,3))}function bv(qr,Qr){var oo=Qi(qr)?Qo:ah;return oo(qr,Vi(Qr,3))}var kv=Dh(nf),Sv=Dh(rf);function wv(qr,Qr){return ua(Pu(qr,Qr),1)}function Ev(qr,Qr){return ua(Pu(qr,Qr),io)}function xv(qr,Qr,oo){return oo=oo===$r?1:is(oo),ua(Pu(qr,Qr),oo)}function df(qr,Qr){var oo=Qi(qr)?la:jl;return oo(qr,Vi(Qr,3))}function hf(qr,Qr){var oo=Qi(qr)?Ho:sh;return oo(qr,Vi(Qr,3))}var Tv=wu(function(qr,Qr,oo){Is.call(qr,oo)?qr[oo].push(Qr):Sl(qr,oo,[Qr])});function Cv(qr,Qr,oo,fo){qr=xa(qr)?qr:Dc(qr),oo=oo&&!fo?is(oo):0;var _o=qr.length;return oo<0&&(oo=Xs(_o+oo,0)),Lu(qr)?oo<=_o&&qr.indexOf(Qr,oo)>-1:!!_o&&qs(qr,Qr,oo)>-1}var Iv=hs(function(qr,Qr,oo){var fo=-1,_o=typeof Qr=="function",xo=xa(qr)?oi(qr.length):[];return jl(qr,function(Lo){xo[++fo]=_o?aa(Qr,Lo,oo):qc(Lo,Qr,oo)}),xo}),$v=wu(function(qr,Qr,oo){Sl(qr,oo,Qr)});function Pu(qr,Qr){var oo=Qi(qr)?gi:fh;return oo(qr,Vi(Qr,3))}function Av(qr,Qr,oo,fo){return qr==null?[]:(Qi(Qr)||(Qr=Qr==null?[]:[Qr]),oo=fo?$r:oo,Qi(oo)||(oo=oo==null?[]:[oo]),vh(qr,Qr,oo))}var Rv=wu(function(qr,Qr,oo){qr[oo?0:1].push(Qr)},function(){return[[],[]]});function Pv(qr,Qr,oo){var fo=Qi(qr)?Do:Nc,_o=arguments.length<3;return fo(qr,Vi(Qr,4),oo,_o,jl)}function Ov(qr,Qr,oo){var fo=Qi(qr)?Wo:Nc,_o=arguments.length<3;return fo(qr,Vi(Qr,4),oo,_o,sh)}function Fv(qr,Qr){var oo=Qi(qr)?Qo:ah;return oo(qr,Du(Vi(Qr,3)))}function Dv(qr){var Qr=Qi(qr)?nh:Sm;return Qr(qr)}function Mv(qr,Qr,oo){(oo?ka(qr,Qr,oo):Qr===$r)?Qr=1:Qr=is(Qr);var fo=Qi(qr)?Zp:wm;return fo(qr,Qr)}function Bv(qr){var Qr=Qi(qr)?Jp:xm;return Qr(qr)}function Nv(qr){if(qr==null)return 0;if(xa(qr))return Lu(qr)?Ec(qr):qr.length;var Qr=va(qr);return Qr==vo||Qr==Ko?qr.size:nd(qr).length}function Lv(qr,Qr,oo){var fo=Qi(qr)?Bi:Tm;return oo&&ka(qr,Qr,oo)&&(Qr=$r),fo(qr,Vi(Qr,3))}var Hv=hs(function(qr,Qr){if(qr==null)return[];var oo=Qr.length;return oo>1&&ka(qr,Qr[0],Qr[1])?Qr=[]:oo>2&&ka(Qr[0],Qr[1],Qr[2])&&(Qr=[Qr[0]]),vh(qr,ua(Qr,1),[])}),Ou=dp||function(){return Rs.Date.now()};function zv(qr,Qr){if(typeof Qr!="function")throw new Na(Mr);return qr=is(qr),function(){if(--qr<1)return Qr.apply(this,arguments)}}function ff(qr,Qr,oo){return Qr=oo?$r:Qr,Qr=qr&&Qr==null?qr.length:Qr,wl(qr,Jr,$r,$r,$r,$r,Qr)}function pf(qr,Qr){var oo;if(typeof Qr!="function")throw new Na(Mr);return qr=is(qr),function(){return--qr>0&&(oo=Qr.apply(this,arguments)),qr<=1&&(Qr=$r),oo}}var Cd=hs(function(qr,Qr,oo){var fo=Gr;if(oo.length){var _o=Ul(oo,Oc(Cd));fo|=Wr}return wl(qr,fo,Qr,oo,_o)}),mf=hs(function(qr,Qr,oo){var fo=Gr|Xr;if(oo.length){var _o=Ul(oo,Oc(mf));fo|=Wr}return wl(Qr,fo,qr,oo,_o)});function gf(qr,Qr,oo){Qr=oo?$r:Qr;var fo=wl(qr,Zr,$r,$r,$r,$r,$r,Qr);return fo.placeholder=gf.placeholder,fo}function vf(qr,Qr,oo){Qr=oo?$r:Qr;var fo=wl(qr,eo,$r,$r,$r,$r,$r,Qr);return fo.placeholder=vf.placeholder,fo}function yf(qr,Qr,oo){var fo,_o,xo,Lo,jo,Zo,fi=0,mi=!1,_i=!1,Di=!0;if(typeof qr!="function")throw new Na(Mr);Qr=Va(Qr)||0,Ns(oo)&&(mi=!!oo.leading,_i="maxWait"in oo,xo=_i?Xs(Va(oo.maxWait)||0,Qr):xo,Di="trailing"in oo?!!oo.trailing:Di);function Hi(Vs){var Ya=fo,Il=_o;return fo=_o=$r,fi=Vs,Lo=qr.apply(Il,Ya),Lo}function Gi(Vs){return fi=Vs,jo=Jc(ms,Qr),mi?Hi(Vs):Lo}function us(Vs){var Ya=Vs-Zo,Il=Vs-fi,Bf=Qr-Ya;return _i?ga(Bf,xo-Il):Bf}function Wi(Vs){var Ya=Vs-Zo,Il=Vs-fi;return Zo===$r||Ya>=Qr||Ya<0||_i&&Il>=xo}function ms(){var Vs=Ou();if(Wi(Vs))return ks(Vs);jo=Jc(ms,us(Vs))}function ks(Vs){return jo=$r,Di&&fo?Hi(Vs):(fo=_o=$r,Lo)}function Pa(){jo!==$r&&Th(jo),fi=0,fo=Zo=_o=jo=$r}function Sa(){return jo===$r?Lo:ks(Ou())}function Oa(){var Vs=Ou(),Ya=Wi(Vs);if(fo=arguments,_o=this,Zo=Vs,Ya){if(jo===$r)return Gi(Zo);if(_i)return Th(jo),jo=Jc(ms,Qr),Hi(Zo)}return jo===$r&&(jo=Jc(ms,Qr)),Lo}return Oa.cancel=Pa,Oa.flush=Sa,Oa}var Uv=hs(function(qr,Qr){return ih(qr,1,Qr)}),Vv=hs(function(qr,Qr,oo){return ih(qr,Va(Qr)||0,oo)});function jv(qr){return wl(qr,ro)}function Fu(qr,Qr){if(typeof qr!="function"||Qr!=null&&typeof Qr!="function")throw new Na(Mr);var oo=function(){var fo=arguments,_o=Qr?Qr.apply(this,fo):fo[0],xo=oo.cache;if(xo.has(_o))return xo.get(_o);var Lo=qr.apply(this,fo);return oo.cache=xo.set(_o,Lo)||xo,Lo};return oo.cache=new(Fu.Cache||kl),oo}Fu.Cache=kl;function Du(qr){if(typeof qr!="function")throw new Na(Mr);return function(){var Qr=arguments;switch(Qr.length){case 0:return!qr.call(this);case 1:return!qr.call(this,Qr[0]);case 2:return!qr.call(this,Qr[0],Qr[1]);case 3:return!qr.call(this,Qr[0],Qr[1],Qr[2])}return!qr.apply(this,Qr)}}function Wv(qr){return pf(2,qr)}var Gv=Cm(function(qr,Qr){Qr=Qr.length==1&&Qi(Qr[0])?gi(Qr[0],$a(Vi())):gi(ua(Qr,1),$a(Vi()));var oo=Qr.length;return hs(function(fo){for(var _o=-1,xo=ga(fo.length,oo);++_o=Qr}),vc=uh(function(){return arguments}())?uh:function(qr){return zs(qr)&&Is.call(qr,"callee")&&!Xd.call(qr,"callee")},Qi=oi.isArray,a0=oc?$a(oc):cm;function xa(qr){return qr!=null&&Bu(qr.length)&&!Tl(qr)}function Us(qr){return zs(qr)&&xa(qr)}function l0(qr){return qr===!0||qr===!1||zs(qr)&&ba(qr)==Ro}var Kl=fp||Ld,c0=lc?$a(lc):um;function u0(qr){return zs(qr)&&qr.nodeType===1&&!Qc(qr)}function d0(qr){if(qr==null)return!0;if(xa(qr)&&(Qi(qr)||typeof qr=="string"||typeof qr.splice=="function"||Kl(qr)||Fc(qr)||vc(qr)))return!qr.length;var Qr=va(qr);if(Qr==vo||Qr==Ko)return!qr.size;if(Zc(qr))return!nd(qr).length;for(var oo in qr)if(Is.call(qr,oo))return!1;return!0}function h0(qr,Qr){return Kc(qr,Qr)}function f0(qr,Qr,oo){oo=typeof oo=="function"?oo:$r;var fo=oo?oo(qr,Qr):$r;return fo===$r?Kc(qr,Qr,$r,oo):!!fo}function $d(qr){if(!zs(qr))return!1;var Qr=ba(qr);return Qr==Oo||Qr==zo||typeof qr.message=="string"&&typeof qr.name=="string"&&!Qc(qr)}function p0(qr){return typeof qr=="number"&&Jd(qr)}function Tl(qr){if(!Ns(qr))return!1;var Qr=ba(qr);return Qr==Bo||Qr==bo||Qr==Mo||Qr==Fo}function bf(qr){return typeof qr=="number"&&qr==is(qr)}function Bu(qr){return typeof qr=="number"&&qr>-1&&qr%1==0&&qr<=uo}function Ns(qr){var Qr=typeof qr;return qr!=null&&(Qr=="object"||Qr=="function")}function zs(qr){return qr!=null&&typeof qr=="object"}var kf=yc?$a(yc):hm;function m0(qr,Qr){return qr===Qr||td(qr,Qr,_d(Qr))}function g0(qr,Qr,oo){return oo=typeof oo=="function"?oo:$r,td(qr,Qr,_d(Qr),oo)}function v0(qr){return Sf(qr)&&qr!=+qr}function y0(qr){if(Zm(qr))throw new Ji(Dr);return dh(qr)}function _0(qr){return qr===null}function b0(qr){return qr==null}function Sf(qr){return typeof qr=="number"||zs(qr)&&ba(qr)==Io}function Qc(qr){if(!zs(qr)||ba(qr)!=Co)return!1;var Qr=lu(qr);if(Qr===null)return!0;var oo=Is.call(Qr,"constructor")&&Qr.constructor;return typeof oo=="function"&&oo instanceof oo&&ou.call(oo)==sp}var Ad=vl?$a(vl):fm;function k0(qr){return bf(qr)&&qr>=-uo&&qr<=uo}var wf=_c?$a(_c):mm;function Lu(qr){return typeof qr=="string"||!Qi(qr)&&zs(qr)&&ba(qr)==Uo}function Ra(qr){return typeof qr=="symbol"||zs(qr)&&ba(qr)==ei}var Fc=Mc?$a(Mc):gm;function S0(qr){return qr===$r}function w0(qr){return zs(qr)&&va(qr)==ri}function E0(qr){return zs(qr)&&ba(qr)==ki}var x0=Cu(rd),T0=Cu(function(qr,Qr){return qr<=Qr});function Ef(qr){if(!qr)return[];if(xa(qr))return Lu(qr)?Ga(qr):Ea(qr);if(Hc&&qr[Hc])return Kf(qr[Hc]());var Qr=va(qr),oo=Qr==vo?ju:Qr==Ko?eu:Dc;return oo(qr)}function Cl(qr){if(!qr)return qr===0?qr:0;if(qr=Va(qr),qr===io||qr===-io){var Qr=qr<0?-1:1;return Qr*ho}return qr===qr?qr:0}function is(qr){var Qr=Cl(qr),oo=Qr%1;return Qr===Qr?oo?Qr-oo:Qr:0}function xf(qr){return qr?fc(is(qr),0,So):0}function Va(qr){if(typeof qr=="number")return qr;if(Ra(qr))return yo;if(Ns(qr)){var Qr=typeof qr.valueOf=="function"?qr.valueOf():qr;qr=Ns(Qr)?Qr+"":Qr}if(typeof qr!="string")return qr===0?qr:+qr;qr=qr.replace(fs,"");var oo=ra.test(qr);return oo||Ms.test(qr)?Gs(qr.slice(2),oo?2:8):Hs.test(qr)?yo:+qr}function Tf(qr){return sl(qr,Ta(qr))}function C0(qr){return qr?fc(is(qr),-uo,uo):qr===0?qr:0}function Cs(qr){return qr==null?"":Aa(qr)}var I0=Rc(function(qr,Qr){if(Zc(Qr)||xa(Qr)){sl(Qr,ea(Qr),qr);return}for(var oo in Qr)Is.call(Qr,oo)&&Wc(qr,oo,Qr[oo])}),Cf=Rc(function(qr,Qr){sl(Qr,Ta(Qr),qr)}),Hu=Rc(function(qr,Qr,oo,fo){sl(Qr,Ta(Qr),qr,fo)}),$0=Rc(function(qr,Qr,oo,fo){sl(Qr,ea(Qr),qr,fo)}),A0=El(Xu);function R0(qr,Qr){var oo=Ac(qr);return Qr==null?oo:rh(oo,Qr)}var P0=hs(function(qr,Qr){qr=As(qr);var oo=-1,fo=Qr.length,_o=fo>2?Qr[2]:$r;for(_o&&ka(Qr[0],Qr[1],_o)&&(fo=1);++oo1),xo}),sl(qr,vd(qr),oo),fo&&(oo=Ha(oo,Hr|zr|Ur,Lm));for(var _o=Qr.length;_o--;)ld(oo,Qr[_o]);return oo});function X0(qr,Qr){return $f(qr,Du(Vi(Qr)))}var Z0=El(function(qr,Qr){return qr==null?{}:_m(qr,Qr)});function $f(qr,Qr){if(qr==null)return{};var oo=gi(vd(qr),function(fo){return[fo]});return Qr=Vi(Qr),yh(qr,oo,function(fo,_o){return Qr(fo,_o[0])})}function J0(qr,Qr,oo){Qr=Gl(Qr,qr);var fo=-1,_o=Qr.length;for(_o||(_o=1,qr=$r);++fo<_o;){var xo=qr==null?$r:qr[al(Qr[fo])];xo===$r&&(fo=_o,xo=oo),qr=Tl(xo)?xo.call(qr):xo}return qr}function Q0(qr,Qr,oo){return qr==null?qr:Yc(qr,Qr,oo)}function ey(qr,Qr,oo,fo){return fo=typeof fo=="function"?fo:$r,qr==null?qr:Yc(qr,Qr,oo,fo)}var Af=Hh(ea),Rf=Hh(Ta);function ty(qr,Qr,oo){var fo=Qi(qr),_o=fo||Kl(qr)||Fc(qr);if(Qr=Vi(Qr,4),oo==null){var xo=qr&&qr.constructor;_o?oo=fo?new xo:[]:Ns(qr)?oo=Tl(xo)?Ac(lu(qr)):{}:oo={}}return(_o?la:il)(qr,function(Lo,jo,Zo){return Qr(oo,Lo,jo,Zo)}),oo}function ny(qr,Qr){return qr==null?!0:ld(qr,Qr)}function ry(qr,Qr,oo){return qr==null?qr:wh(qr,Qr,hd(oo))}function oy(qr,Qr,oo,fo){return fo=typeof fo=="function"?fo:$r,qr==null?qr:wh(qr,Qr,hd(oo),fo)}function Dc(qr){return qr==null?[]:Vu(qr,ea(qr))}function iy(qr){return qr==null?[]:Vu(qr,Ta(qr))}function sy(qr,Qr,oo){return oo===$r&&(oo=Qr,Qr=$r),oo!==$r&&(oo=Va(oo),oo=oo===oo?oo:0),Qr!==$r&&(Qr=Va(Qr),Qr=Qr===Qr?Qr:0),fc(Va(qr),Qr,oo)}function ay(qr,Qr,oo){return Qr=Cl(Qr),oo===$r?(oo=Qr,Qr=0):oo=Cl(oo),qr=Va(qr),am(qr,Qr,oo)}function ly(qr,Qr,oo){if(oo&&typeof oo!="boolean"&&ka(qr,Qr,oo)&&(Qr=oo=$r),oo===$r&&(typeof Qr=="boolean"?(oo=Qr,Qr=$r):typeof qr=="boolean"&&(oo=qr,qr=$r)),qr===$r&&Qr===$r?(qr=0,Qr=1):(qr=Cl(qr),Qr===$r?(Qr=qr,qr=0):Qr=Cl(Qr)),qr>Qr){var fo=qr;qr=Qr,Qr=fo}if(oo||qr%1||Qr%1){var _o=Qd();return ga(qr+_o*(Qr-qr+sa("1e-"+((_o+"").length-1))),Qr)}return id(qr,Qr)}var cy=Pc(function(qr,Qr,oo){return Qr=Qr.toLowerCase(),qr+(oo?Pf(Qr):Qr)});function Pf(qr){return Od(Cs(qr).toLowerCase())}function Of(qr){return qr=Cs(qr),qr&&qr.replace(rs,Vf).replace(Bl,"")}function uy(qr,Qr,oo){qr=Cs(qr),Qr=Aa(Qr);var fo=qr.length;oo=oo===$r?fo:fc(is(oo),0,fo);var _o=oo;return oo-=Qr.length,oo>=0&&qr.slice(oo,_o)==Qr}function dy(qr){return qr=Cs(qr),qr&&qi.test(qr)?qr.replace(Fi,jf):qr}function hy(qr){return qr=Cs(qr),qr&&vs.test(qr)?qr.replace(Yi,"\\$&"):qr}var fy=Pc(function(qr,Qr,oo){return qr+(oo?"-":"")+Qr.toLowerCase()}),py=Pc(function(qr,Qr,oo){return qr+(oo?" ":"")+Qr.toLowerCase()}),my=Fh("toLowerCase");function gy(qr,Qr,oo){qr=Cs(qr),Qr=is(Qr);var fo=Qr?Ec(qr):0;if(!Qr||fo>=Qr)return qr;var _o=(Qr-fo)/2;return Tu(hu(_o),oo)+qr+Tu(du(_o),oo)}function vy(qr,Qr,oo){qr=Cs(qr),Qr=is(Qr);var fo=Qr?Ec(qr):0;return Qr&&fo>>0,oo?(qr=Cs(qr),qr&&(typeof Qr=="string"||Qr!=null&&!Ad(Qr))&&(Qr=Aa(Qr),!Qr&&wc(qr))?ql(Ga(qr),0,oo):qr.split(Qr,oo)):[]}var Ey=Pc(function(qr,Qr,oo){return qr+(oo?" ":"")+Od(Qr)});function xy(qr,Qr,oo){return qr=Cs(qr),oo=oo==null?0:fc(is(oo),0,qr.length),Qr=Aa(Qr),qr.slice(oo,oo+Qr.length)==Qr}function Ty(qr,Qr,oo){var fo=wo.templateSettings;oo&&ka(qr,Qr,oo)&&(Qr=$r),qr=Cs(qr),Qr=Hu({},Qr,fo,zh);var _o=Hu({},Qr.imports,fo.imports,zh),xo=ea(_o),Lo=Vu(_o,xo),jo,Zo,fi=0,mi=Qr.interpolate||Zs,_i="__p += '",Di=Wu((Qr.escape||Zs).source+"|"+mi.source+"|"+(mi===Ki?ys:Zs).source+"|"+(Qr.evaluate||Zs).source+"|$","g"),Hi="//# sourceURL="+(Is.call(Qr,"sourceURL")?(Qr.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++fl+"]")+` `;qr.replace(Di,function(Wi,ms,ks,Pa,Sa,Oa){return ks||(ks=Pa),_i+=qr.slice(fi,Oa).replace(Js,Wf),ms&&(jo=!0,_i+=`' + __e(`+ms+`) + '`),Sa&&(Zo=!0,_i+=`'; `+Sa+`; __p += '`),ks&&(_i+=`' + ((__t = (`+ks+`)) == null ? '' : __t) + '`),fi=Oa+Wi.length,Wi}),_i+=`'; `;var Gi=Is.call(Qr,"variable")&&Qr.variable;Gi||(_i=`with (obj) { `+_i+` } `),_i=(Zo?_i.replace(Ni,""):_i).replace(Ei,"$1").replace($i,"$1;"),_i="function("+(Gi||"obj")+`) { `+(Gi?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(jo?", __e = _.escape":"")+(Zo?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+_i+`return __p }`;var us=Df(function(){return Ts(xo,Hi+"return "+_i).apply($r,Lo)});if(us.source=_i,$d(us))throw us;return us}function Cy(qr){return Cs(qr).toLowerCase()}function Iy(qr){return Cs(qr).toUpperCase()}function $y(qr,Qr,oo){if(qr=Cs(qr),qr&&(oo||Qr===$r))return qr.replace(fs,"");if(!qr||!(Qr=Aa(Qr)))return qr;var fo=Ga(qr),_o=Ga(Qr),xo=jd(fo,_o),Lo=Wd(fo,_o)+1;return ql(fo,xo,Lo).join("")}function Ay(qr,Qr,oo){if(qr=Cs(qr),qr&&(oo||Qr===$r))return qr.replace(di,"");if(!qr||!(Qr=Aa(Qr)))return qr;var fo=Ga(qr),_o=Wd(fo,Ga(Qr))+1;return ql(fo,0,_o).join("")}function Ry(qr,Qr,oo){if(qr=Cs(qr),qr&&(oo||Qr===$r))return qr.replace(da,"");if(!qr||!(Qr=Aa(Qr)))return qr;var fo=Ga(qr),_o=jd(fo,Ga(Qr));return ql(fo,_o).join("")}function Py(qr,Qr){var oo=so,fo=ao;if(Ns(Qr)){var _o="separator"in Qr?Qr.separator:_o;oo="length"in Qr?is(Qr.length):oo,fo="omission"in Qr?Aa(Qr.omission):fo}qr=Cs(qr);var xo=qr.length;if(wc(qr)){var Lo=Ga(qr);xo=Lo.length}if(oo>=xo)return qr;var jo=oo-Ec(fo);if(jo<1)return fo;var Zo=Lo?ql(Lo,0,jo).join(""):qr.slice(0,jo);if(_o===$r)return Zo+fo;if(Lo&&(jo+=Zo.length-jo),Ad(_o)){if(qr.slice(jo).search(_o)){var fi,mi=Zo;for(_o.global||(_o=Wu(_o.source,Cs(ls.exec(_o))+"g")),_o.lastIndex=0;fi=_o.exec(mi);)var _i=fi.index;Zo=Zo.slice(0,_i===$r?jo:_i)}}else if(qr.indexOf(Aa(_o),jo)!=jo){var Di=Zo.lastIndexOf(_o);Di>-1&&(Zo=Zo.slice(0,Di))}return Zo+fo}function Oy(qr){return qr=Cs(qr),qr&&bs.test(qr)?qr.replace(Ri,Jf):qr}var Fy=Pc(function(qr,Qr,oo){return qr+(oo?" ":"")+Qr.toUpperCase()}),Od=Fh("toUpperCase");function Ff(qr,Qr,oo){return qr=Cs(qr),Qr=oo?$r:Qr,Qr===$r?qf(qr)?tp(qr):cs(qr):qr.match(Qr)||[]}var Df=hs(function(qr,Qr){try{return aa(qr,$r,Qr)}catch(oo){return $d(oo)?oo:new Ji(oo)}}),Dy=El(function(qr,Qr){return la(Qr,function(oo){oo=al(oo),Sl(qr,oo,Cd(qr[oo],qr))}),qr});function My(qr){var Qr=qr==null?0:qr.length,oo=Vi();return qr=Qr?gi(qr,function(fo){if(typeof fo[1]!="function")throw new Na(Mr);return[oo(fo[0]),fo[1]]}):[],hs(function(fo){for(var _o=-1;++_ouo)return[];var oo=So,fo=ga(qr,So);Qr=Vi(Qr),qr-=So;for(var _o=Uu(fo,Qr);++oo0||Qr<0)?new _s(oo):(qr<0?oo=oo.takeRight(-qr):qr&&(oo=oo.drop(qr)),Qr!==$r&&(Qr=is(Qr),oo=Qr<0?oo.dropRight(-Qr):oo.take(Qr-qr)),oo)},_s.prototype.takeRightWhile=function(qr){return this.reverse().takeWhile(qr).reverse()},_s.prototype.toArray=function(){return this.take(So)},il(_s.prototype,function(qr,Qr){var oo=/^(?:filter|find|map|reject)|While$/.test(Qr),fo=/^(?:head|last)$/.test(Qr),_o=wo[fo?"take"+(Qr=="last"?"Right":""):Qr],xo=fo||/^find/.test(Qr);_o&&(wo.prototype[Qr]=function(){var Lo=this.__wrapped__,jo=fo?[1]:arguments,Zo=Lo instanceof _s,fi=jo[0],mi=Zo||Qi(Lo),_i=function(ms){var ks=_o.apply(wo,Si([ms],jo));return fo&&Di?ks[0]:ks};mi&&oo&&typeof fi=="function"&&fi.length!=1&&(Zo=mi=!1);var Di=this.__chain__,Hi=!!this.__actions__.length,Gi=xo&&!Di,us=Zo&&!Hi;if(!xo&&mi){Lo=us?Lo:new _s(this);var Wi=qr.apply(Lo,jo);return Wi.__actions__.push({func:Ru,args:[_i],thisArg:$r}),new La(Wi,Di)}return Gi&&us?qr.apply(this,jo):(Wi=this.thru(_i),Gi?fo?Wi.value()[0]:Wi.value():Wi)})}),la(["pop","push","shift","sort","splice","unshift"],function(qr){var Qr=tu[qr],oo=/^(?:push|sort|unshift)$/.test(qr)?"tap":"thru",fo=/^(?:pop|shift)$/.test(qr);wo.prototype[qr]=function(){var _o=arguments;if(fo&&!this.__chain__){var xo=this.value();return Qr.apply(Qi(xo)?xo:[],_o)}return this[oo](function(Lo){return Qr.apply(Qi(Lo)?Lo:[],_o)})}}),il(_s.prototype,function(qr,Qr){var oo=wo[Qr];if(oo){var fo=oo.name+"";Is.call($c,fo)||($c[fo]=[]),$c[fo].push({name:Qr,func:oo})}}),$c[Eu($r,Xr).name]=[{name:"wrapper",func:$r}],_s.prototype.clone=Tp,_s.prototype.reverse=Cp,_s.prototype.value=Ip,wo.prototype.at=uv,wo.prototype.chain=dv,wo.prototype.commit=hv,wo.prototype.next=fv,wo.prototype.plant=mv,wo.prototype.reverse=gv,wo.prototype.toJSON=wo.prototype.valueOf=wo.prototype.value=vv,wo.prototype.first=wo.prototype.head,Hc&&(wo.prototype[Hc]=pv),wo},xc=np();Wa?((Wa.exports=xc)._=xc,zl._=xc):Rs._=xc}).call(commonjsGlobal)})(lodash,lodash.exports);var lodashExports=lodash.exports;const NUMBER_OF_UNDO_ACTIONS=30,useUndoRedoStore=defineStore("undoRedoStore",{state:()=>({undoStack:[],redoStack:[]}),getters:{isUndoStackEmpty:Tr=>!Tr.undoStack.length,isRedoStackEmpty:Tr=>!Tr.redoStack.length},actions:{addToUndo(Tr,Cr=!0){this.undoStack.push(Tr),this.undoStack=this.undoStack.slice(-1*NUMBER_OF_UNDO_ACTIONS),Cr&&this.wipeRedo()},addToRedo(Tr){this.redoStack.push(Tr)},popFromUndo(){return this.undoStack.pop()},popFromRedo(){return this.redoStack.pop()},wipeUndo(){this.undoStack=[]},wipeRedo(){this.redoStack=[]},clear(){this.wipeUndo(),this.wipeRedo()},addSelectedPageActionToUndo({newId:Tr,oldId:Cr}){const $r={id:"selectedPageId",context:{undo:{changes:[{action:"selectSlide",id:Cr,type:"slide"}]},redo:{changes:[{action:"selectSlide",id:Tr,type:"slide"}]}}};this.addToUndo($r)}}}),allIconFileNames=["academic-cap.svg","adjustments-horizontal.svg","adjustments-vertical.svg","archive-box-arrow-down.svg","archive-box-x-mark.svg","archive-box.svg","arrow-down-circle.svg","arrow-down-left.svg","arrow-down-on-square-stack.svg","arrow-down-on-square.svg","arrow-down-right.svg","arrow-down-tray.svg","arrow-down.svg","arrow-left-circle.svg","arrow-left-on-rectangle.svg","arrow-left.svg","arrow-long-down.svg","arrow-long-left.svg","arrow-long-right.svg","arrow-long-up.svg","arrow-path-rounded-square.svg","arrow-path.svg","arrow-right-circle.svg","arrow-right-on-rectangle.svg","arrow-right.svg","arrow-small-down.svg","arrow-small-left.svg","arrow-small-right.svg","arrow-small-up.svg","arrow-top-right-on-square.svg","arrow-trending-down.svg","arrow-trending-up.svg","arrow-up-circle.svg","arrow-up-left.svg","arrow-up-on-square-stack.svg","arrow-up-on-square.svg","arrow-up-right.svg","arrow-up-tray.svg","arrow-up.svg","arrow-uturn-down.svg","arrow-uturn-left.svg","arrow-uturn-right.svg","arrow-uturn-up.svg","arrows-pointing-in.svg","arrows-pointing-out.svg","arrows-right-left.svg","arrows-up-down.svg","at-symbol.svg","backspace.svg","backward.svg","banknotes.svg","bars-2.svg","bars-3-bottom-left.svg","bars-3-bottom-right.svg","bars-3-center-left.svg","bars-3.svg","bars-4.svg","bars-arrow-down.svg","bars-arrow-up.svg","battery-0.svg","battery-100.svg","battery-50.svg","beaker.svg","bell-alert.svg","bell-slash.svg","bell-snooze.svg","bell.svg","bolt-slash.svg","bolt.svg","book-open.svg","bookmark-slash.svg","bookmark-square.svg","bookmark.svg","briefcase.svg","bug-ant.svg","building-library.svg","building-office-2.svg","building-office.svg","building-storefront.svg","cake.svg","calculator.svg","calendar-days.svg","calendar.svg","camera.svg","chart-bar-square.svg","chart-bar.svg","chart-pie.svg","chat-bubble-bottom-center-text.svg","chat-bubble-bottom-center.svg","chat-bubble-left-ellipsis.svg","chat-bubble-left-right.svg","chat-bubble-left.svg","chat-bubble-oval-left-ellipsis.svg","chat-bubble-oval-left.svg","check-badge.svg","check-circle.svg","check.svg","chevron-double-down.svg","chevron-double-left.svg","chevron-double-right.svg","chevron-double-up.svg","chevron-down.svg","chevron-left.svg","chevron-right.svg","chevron-up-down.svg","chevron-up.svg","circle-stack.svg","clipboard-document-check.svg","clipboard-document-list.svg","clipboard-document.svg","clipboard.svg","clock.svg","cloud-arrow-down.svg","cloud-arrow-up.svg","cloud.svg","code-bracket-square.svg","code-bracket.svg","cog-6-tooth.svg","cog-8-tooth.svg","cog.svg","command-line.svg","computer-desktop.svg","cpu-chip.svg","credit-card.svg","cube-transparent.svg","cube.svg","currency-bangladeshi.svg","currency-dollar.svg","currency-euro.svg","currency-pound.svg","currency-rupee.svg","currency-yen.svg","cursor-arrow-rays.svg","cursor-arrow-ripple.svg","device-phone-mobile.svg","device-tablet.svg","document-arrow-down.svg","document-arrow-up.svg","document-chart-bar.svg","document-check.svg","document-duplicate.svg","document-magnifying-glass.svg","document-minus.svg","document-plus.svg","document-text.svg","document.svg","ellipsis-horizontal-circle.svg","ellipsis-horizontal.svg","ellipsis-vertical.svg","envelope-open.svg","envelope.svg","exclamation-circle.svg","exclamation-triangle.svg","eye-dropper.svg","eye-slash.svg","eye.svg","face-frown.svg","face-smile.svg","film.svg","finger-print.svg","fire.svg","flag.svg","folder-arrow-down.svg","folder-minus.svg","folder-open.svg","folder-plus.svg","folder.svg","forward.svg","funnel.svg","gif.svg","gift-top.svg","gift.svg","globe-alt.svg","globe-americas.svg","globe-asia-australia.svg","globe-europe-africa.svg","hand-raised.svg","hand-thumb-down.svg","hand-thumb-up.svg","hashtag.svg","heart.svg","home-modern.svg","home.svg","identification.svg","inbox-arrow-down.svg","inbox-stack.svg","inbox.svg","information-circle.svg","key.svg","language.svg","lifebuoy.svg","light-bulb.svg","link.svg","list-bullet.svg","lock-closed.svg","lock-open.svg","magnifying-glass-circle.svg","magnifying-glass-minus.svg","magnifying-glass-plus.svg","magnifying-glass.svg","map-pin.svg","map.svg","megaphone.svg","microphone.svg","minus-circle.svg","minus-small.svg","minus.svg","moon.svg","musical-note.svg","newspaper.svg","no-symbol.svg","paint-brush.svg","paper-airplane.svg","paper-clip.svg","pause-circle.svg","pause.svg","pencil-square.svg","pencil.svg","phone-arrow-down-left.svg","phone-arrow-up-right.svg","phone-x-mark.svg","phone.svg","photo.svg","play-circle.svg","play-pause.svg","play.svg","plus-circle.svg","plus-small.svg","plus.svg","power.svg","presentation-chart-bar.svg","presentation-chart-line.svg","printer.svg","puzzle-piece.svg","qr-code.svg","question-mark-circle.svg","queue-list.svg","radio.svg","receipt-percent.svg","receipt-refund.svg","rectangle-group.svg","rectangle-stack.svg","rocket-launch.svg","rss.svg","scale.svg","scissors.svg","server-stack.svg","server.svg","share.svg","shield-check.svg","shield-exclamation.svg","shopping-bag.svg","shopping-cart.svg","signal-slash.svg","signal.svg","sparkles.svg","speaker-wave.svg","speaker-x-mark.svg","square-2-stack.svg","square-3-stack-3D.svg","squares-2X2.svg","squares-plus.svg","star.svg","stop-circle.svg","stop.svg","sun.svg","swatch.svg","table-cells.svg","tag.svg","ticket.svg","trash.svg","trophy.svg","truck.svg","tv.svg","user-circle.svg","user-group.svg","user-minus.svg","user-plus.svg","user.svg","users.svg","variable.svg","video-camera-slash.svg","video-camera.svg","view-columns.svg","viewfinder-circle.svg","wallet.svg","wifi.svg","window.svg","wrench-screwdriver.svg","wrench.svg","x-circle.svg","x-mark.svg"],camelize$1=Tr=>Tr.replace(/-./g,Cr=>Cr[1].toUpperCase()),capitalizeFirstChar$1=Tr=>`${Tr.charAt(0).toUpperCase()}${Tr.slice(1)}`,getHeroIconName=Tr=>{const Cr=Tr.split(".")[0];return`${capitalizeFirstChar$1(camelize$1(Cr))}Icon`},allIconNames=allIconFileNames.map(Tr=>getHeroIconName(Tr)),allIconObjects=allIconNames.map(Tr=>({id:Tr,name:Tr,value:Tr})),allEmojis={writing:"✍️",thumbs_up:"👍",thumbs_down:"👎",sob:"😭",confused:"😕",neutral_face:"😐",blush:"😊",heart_eyes:"😍",smile:"😄",smiley:"😃",grinning:"😀",wink:"😉",kissing_heart:"😘",kissing_closed_eyes:"😚",kissing:"😗",kissing_smiling_eyes:"😙",stuck_out_tongue_winking_eye:"😜",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue:"😛",flushed:"😳",grin:"😁",pensive:"😔",relieved:"😌",unamused:"😒",disappointed:"😞",persevere:"😣",cry:"😢",joy:"😂",sleepy:"😪",disappointed_relieved:"😥",cold_sweat:"😰",sweat_smile:"😅",sweat:"😓",weary:"😩",tired_face:"😫",fearful:"😨",scream:"😱",angry:"😠",rage:"😡",triumph:"😤",confounded:"😖",laughing:"😆",yum:"😋",mask:"😷",sunglasses:"😎",sleeping:"😴",dizzy_face:"😵",astonished:"😲",worried:"😟",frowning:"😦",anguished:"😧",imp:"👿",open_mouth:"😮",grimacing:"😬",hushed:"😯",smirk:"😏",expressionless:"😑",man_with_gua_pi_mao:"👲",man_with_turban:"👳",cop:"👮",construction_worker:"👷",guardsman:"💂",baby:"👶",boy:"👦",girl:"👧",man:"👨",woman:"👩",older_man:"👴",older_woman:"👵",person_with_blond_hair:"👱",angel:"👼",princess:"👸",smiley_cat:"😺",smile_cat:"😸",heart_eyes_cat:"😻",kissing_cat:"😽",smirk_cat:"😼",scream_cat:"🙀",crying_cat_face:"😿",joy_cat:"😹",pouting_cat:"😾",japanese_ogre:"👹",japanese_goblin:"👺",see_no_evil:"🙈",hear_no_evil:"🙉",speak_no_evil:"🙊",skull:"💀",alien:"👽",hankey:"💩",fire:"🔥",sparkles:"✨",star2:"🌟",dizzy:"💫",boom:"💥",anger:"💢",sweat_drops:"💦",droplet:"💧",zzz:"💤",dash:"💨",ear:"👂",eyes:"👀",nose:"👃",tongue:"👅",lips:"👄",ok_hand:"👌",facepunch:"👊",fist:"✊",wave:"👋",hand:"✋",open_hands:"👐",point_up_2:"👆",point_down:"👇",point_right:"👉",point_left:"👈",raised_hands:"🙌",pray:"🙏",clap:"👏",muscle:"💪",walking:"🚶",runner:"🏃",dancer:"💃",couple:"👫",family:"👪",couplekiss:"💏",couple_with_heart:"💑",dancers:"👯",ok_woman:"🙆",no_good:"🙅",information_desk_person:"💁",raising_hand:"🙋",massage:"💆",haircut:"💇",nail_care:"💅",bride_with_veil:"👰",person_with_pouting_face:"🙎",person_frowning:"🙍",bow:"🙇",tophat:"🎩",crown:"👑",womans_hat:"👒",athletic_shoe:"👟",mans_shoe:"👞",sandal:"👡",high_heel:"👠",boot:"👢",shirt:"👕",necktie:"👔",womans_clothes:"👚",dress:"👗",running_shirt_with_sash:"🎽",jeans:"👖",kimono:"👘",bikini:"👙",briefcase:"💼",handbag:"👜",pouch:"👝",purse:"👛",eyeglasses:"👓",ribbon:"🎀",closed_umbrella:"🌂",lipstick:"💄",yellow_heart:"💛",blue_heart:"💙",purple_heart:"💜",green_heart:"💚",broken_heart:"💔",heartpulse:"💗",heartbeat:"💓",two_hearts:"💕",sparkling_heart:"💖",revolving_hearts:"💞",cupid:"💘",love_letter:"💌",kiss:"💋",ring:"💍",gem:"💎",bust_in_silhouette:"👤",speech_balloon:"💬",footprints:"👣",dog:"🐶",wolf:"🐺",cat:"🐱",mouse:"🐭",hamster:"🐹",rabbit:"🐰",frog:"🐸",tiger:"🐯",koala:"🐨",bear:"🐻",pig:"🐷",pig_nose:"🐽",cow:"🐮",boar:"🐗",monkey_face:"🐵",monkey:"🐒",horse:"🐴",sheep:"🐑",elephant:"🐘",panda_face:"🐼",penguin:"🐧",bird:"🐦",baby_chick:"🐤",hatched_chick:"🐥",hatching_chick:"🐣",chicken:"🐔",snake:"🐍",turtle:"🐢",bug:"🐛",bee:"🐝",ant:"🐜",beetle:"🐞",snail:"🐌",octopus:"🐙",shell:"🐚",tropical_fish:"🐠",fish:"🐟",dolphin:"🐬",whale:"🐳",racehorse:"🐎",dragon_face:"🐲",blowfish:"🐡",camel:"🐫",poodle:"🐩",feet:"🐾",bouquet:"💐",cherry_blossom:"🌸",tulip:"🌷",four_leaf_clover:"🍀",rose:"🌹",sunflower:"🌻",hibiscus:"🌺",maple_leaf:"🍁",leaves:"🍃",fallen_leaf:"🍂",herb:"🌿",ear_of_rice:"🌾",mushroom:"🍄",cactus:"🌵",palm_tree:"🌴",chestnut:"🌰",seedling:"🌱",blossom:"🌼",new_moon:"🌑",first_quarter_moon:"🌓",moon:"🌔",full_moon:"🌕",first_quarter_moon_with_face:"🌛",crescent_moon:"🌙",earth_asia:"🌏",volcano:"🌋",milky_way:"🌌",stars:"🌠",partly_sunny:"⛅",snowman:"⛄",cyclone:"🌀",foggy:"🌁",rainbow:"🌈",ocean:"🌊",bamboo:"🎍",gift_heart:"💝",dolls:"🎎",school_satchel:"🎒",mortar_board:"🎓",flags:"🎏",fireworks:"🎆",sparkler:"🎇",wind_chime:"🎐",rice_scene:"🎑",jack_o_lantern:"🎃",ghost:"👻",santa:"🎅",christmas_tree:"🎄",gift:"🎁",tanabata_tree:"🎋",tada:"🎉",confetti_ball:"🎊",balloon:"🎈",crossed_flags:"🎌",crystal_ball:"🔮",movie_camera:"🎥",camera:"📷",video_camera:"📹",vhs:"📼",cd:"💿",dvd:"📀",minidisc:"💽",floppy_disk:"💾",computer:"💻",iphone:"📱",telephone_receiver:"📞",pager:"📟",fax:"📠",satellite:"📡",tv:"📺",radio:"📻",loud_sound:"🔊",bell:"🔔",loudspeaker:"📢",mega:"📣",hourglass_flowing_sand:"⏳",hourglass:"⌛",alarm_clock:"⏰",watch:"⌚",unlock:"🔓",lock:"🔒",lock_with_ink_pen:"🔏",closed_lock_with_key:"🔐",key:"🔑",mag_right:"🔎",bulb:"💡",flashlight:"🔦",electric_plug:"🔌",battery:"🔋",mag:"🔍",bath:"🛀",toilet:"🚽",wrench:"🔧",nut_and_bolt:"🔩",hammer:"🔨",door:"🚪",smoking:"🚬",bomb:"💣",gun:"🔫",hocho:"🔪",pill:"💊",syringe:"💉",moneybag:"💰",yen:"💴",dollar:"💵",credit_card:"💳",money_with_wings:"💸",calling:"📲","e-mail":"📧",inbox_tray:"📥",outbox_tray:"📤",envelope_with_arrow:"📩",incoming_envelope:"📨",mailbox:"📫",mailbox_closed:"📪",postbox:"📮",package:"📦",memo:"📝",page_facing_up:"📄",page_with_curl:"📃",bookmark_tabs:"📑",bar_chart:"📊",chart_with_upwards_trend:"📈",chart_with_downwards_trend:"📉",scroll:"📜",clipboard:"📋",date:"📅",calendar:"📆",card_index:"📇",file_folder:"📁",open_file_folder:"📂",pushpin:"📌",paperclip:"📎",straight_ruler:"📏",triangular_ruler:"📐",closed_book:"📕",green_book:"📗",blue_book:"📘",orange_book:"📙",notebook:"📓",notebook_with_decorative_cover:"📔",ledger:"📒",books:"📚",book:"📖",bookmark:"🔖",name_badge:"📛",newspaper:"📰",art:"🎨",clapper:"🎬",microphone:"🎤",headphones:"🎧",musical_score:"🎼",musical_note:"🎵",notes:"🎶",musical_keyboard:"🎹",violin:"🎻",trumpet:"🎺",saxophone:"🎷",guitar:"🎸",space_invader:"👾",video_game:"🎮",black_joker:"🃏",flower_playing_cards:"🎴",mahjong:"🀄",game_die:"🎲",dart:"🎯",football:"🏈",basketball:"🏀",soccer:"⚽",baseball:"⚾",tennis:"🎾","8ball":"🎱",bowling:"🎳",golf:"⛳",checkered_flag:"🏁",trophy:"🏆",ski:"🎿",snowboarder:"🏂",swimmer:"🏊",surfer:"🏄",fishing_pole_and_fish:"🎣",tea:"🍵",sake:"🍶",beer:"🍺",beers:"🍻",cocktail:"🍸",tropical_drink:"🍹",wine_glass:"🍷",fork_and_knife:"🍴",pizza:"🍕",hamburger:"🍔",fries:"🍟",poultry_leg:"🍗",meat_on_bone:"🍖",spaghetti:"🍝",curry:"🍛",fried_shrimp:"🍤",bento:"🍱",sushi:"🍣",fish_cake:"🍥",rice_ball:"🍙",rice_cracker:"🍘",rice:"🍚",ramen:"🍜",stew:"🍲",oden:"🍢",dango:"🍡",egg:"🍳",bread:"🍞",doughnut:"🍩",custard:"🍮",icecream:"🍦",ice_cream:"🍨",shaved_ice:"🍧",birthday:"🎂",cake:"🍰",cookie:"🍪",chocolate_bar:"🍫",candy:"🍬",lollipop:"🍭",honey_pot:"🍯",apple:"🍎",green_apple:"🍏",tangerine:"🍊",cherries:"🍒",grapes:"🍇",watermelon:"🍉",strawberry:"🍓",peach:"🍑",melon:"🍈",banana:"🍌",pineapple:"🍍",sweet_potato:"🍠",eggplant:"🍆",tomato:"🍅",corn:"🌽",house:"🏠",house_with_garden:"🏡",school:"🏫",office:"🏢",post_office:"🏣",hospital:"🏥",bank:"🏦",convenience_store:"🏪",love_hotel:"🏩",hotel:"🏨",wedding:"💒",church:"⛪",department_store:"🏬",city_sunrise:"🌇",city_sunset:"🌆",japanese_castle:"🏯",european_castle:"🏰",tent:"⛺",factory:"🏭",tokyo_tower:"🗼",japan:"🗾",mount_fuji:"🗻",sunrise_over_mountains:"🌄",sunrise:"🌅",night_with_stars:"🌃",statue_of_liberty:"🗽",bridge_at_night:"🌉",carousel_horse:"🎠",ferris_wheel:"🎡",fountain:"⛲",roller_coaster:"🎢",ship:"🚢",boat:"⛵",speedboat:"🚤",rocket:"🚀",seat:"💺",station:"🚉",bullettrain_side:"🚄",bullettrain_front:"🚅",metro:"🚇",railway_car:"🚃",bus:"🚌",blue_car:"🚙",car:"🚗",taxi:"🚕",truck:"🚚",rotating_light:"🚨",police_car:"🚓",fire_engine:"🚒",ambulance:"🚑",bike:"🚲",barber:"💈",busstop:"🚏",ticket:"🎫",traffic_light:"🚥",construction:"🚧",beginner:"🔰",fuelpump:"⛽",izakaya_lantern:"🏮",slot_machine:"🎰",moyai:"🗿",circus_tent:"🎪",performing_arts:"🎭",round_pushpin:"📍",triangular_flag_on_post:"🚩",keycap_ten:"🔟",1234:"🔢",symbols:"🔣",capital_abcd:"🔠",abcd:"🔡",abc:"🔤",arrow_up_small:"🔼",arrow_down_small:"🔽",rewind:"⏪",fast_forward:"⏩",arrow_double_up:"⏫",arrow_double_down:"⏬",ok:"🆗",new:"🆕",up:"🆙",cool:"🆒",free:"🆓",ng:"🆖",signal_strength:"📶",cinema:"🎦",koko:"🈁",u6307:"🈯",u7a7a:"🈳",u6e80:"🈵",u5408:"🈴",u7981:"🈲",ideograph_advantage:"🉐",u5272:"🈹",u55b6:"🈺",u6709:"🈶",u7121:"🈚",restroom:"🚻",mens:"🚹",womens:"🚺",baby_symbol:"🚼",wc:"🚾",no_smoking:"🚭",u7533:"🈸",accept:"🉑",cl:"🆑",sos:"🆘",id:"🆔",no_entry_sign:"🚫",underage:"🔞",no_entry:"⛔",negative_squared_cross_mark:"❎",white_check_mark:"✅",heart_decoration:"💟",vs:"🆚",vibration_mode:"📳",mobile_phone_off:"📴",ab:"🆎",diamond_shape_with_a_dot_inside:"💠",ophiuchus:"⛎",six_pointed_star:"🔯",atm:"🏧",chart:"💹",heavy_dollar_sign:"💲",currency_exchange:"💱",x:"❌",exclamation:"❗",question:"❓",grey_exclamation:"❕",grey_question:"❔",o:"⭕",top:"🔝",end:"🔚",back:"🔙",on:"🔛",soon:"🔜",arrows_clockwise:"🔃",clock12:"🕛",clock1:"🕐",clock2:"🕑",clock3:"🕒",clock4:"🕓",clock5:"🕔",clock6:"🕕",clock7:"🕖",clock8:"🕗",clock9:"🕘",clock10:"🕙",clock11:"🕚",heavy_plus_sign:"➕",heavy_minus_sign:"➖",heavy_division_sign:"➗",white_flower:"💮",100:"💯",radio_button:"🔘",link:"🔗",curly_loop:"➰",trident:"🔱",small_red_triangle:"🔺",black_square_button:"🔲",white_square_button:"🔳",red_circle:"🔴",large_blue_circle:"🔵",small_red_triangle_down:"🔻",white_large_square:"⬜",black_large_square:"⬛",large_orange_diamond:"🔶",large_blue_diamond:"🔷",small_orange_diamond:"🔸",small_blue_diamond:"🔹","rolling on the floor laughing":"🤣","slightly smiling face":"🙂","upside-down face":"🙃","melting face":"🫠","smiling face with halo":"😇","smiling face with hearts":"🥰","star-struck":"🤩","smiling face":"☺","smiling face with tear":"🥲","zany face":"🤪","money-mouth face":"🤑","smiling face with open hands":"🤗","face with hand over mouth":"🤭","face with open eyes and hand over mouth":"🫢","face with peeking eye":"🫣","shushing face":"🤫","thinking face":"🤔","saluting face":"🫡","zipper-mouth face":"🤐","face with raised eyebrow":"🤨","face without mouth":"😶","dotted line face":"🫥","face in clouds":"😶‍🌫️","face with rolling eyes":"🙄","face exhaling":"😮‍💨","lying face":"🤥","⊛ shaking face":"🫨","drooling face":"🤤","face with thermometer":"🤒","face with head-bandage":"🤕","nauseated face":"🤢","face vomiting":"🤮","sneezing face":"🤧","hot face":"🥵","cold face":"🥶","woozy face":"🥴","face with spiral eyes":"😵‍💫","exploding head":"🤯","cowboy hat face":"🤠","partying face":"🥳","disguised face":"🥸","nerd face":"🤓","face with monocle":"🧐","face with diagonal mouth":"🫤","slightly frowning face":"🙁","frowning face":"☹","pleading face":"🥺","face holding back tears":"🥹","yawning face":"🥱","face with symbols on mouth":"🤬","smiling face with horns":"😈","skull and crossbones":"☠","clown face":"🤡",robot:"🤖","heart exclamation":"❣","heart on fire":"❤️‍🔥","mending heart":"❤️‍🩹","red heart":"❤","⊛ pink heart":"🩷","orange heart":"🧡","⊛ light blue heart":"🩵","brown heart":"🤎","black heart":"🖤","⊛ grey heart":"🩶","white heart":"🤍",hole:"🕳","eye in speech bubble":"👁️‍🗨️","left speech bubble":"🗨","right anger bubble":"🗯","thought balloon":"💭","raised back of hand":"🤚","hand with fingers splayed":"🖐","vulcan salute":"🖖","rightwards hand":"🫱","leftwards hand":"🫲","palm down hand":"🫳","palm up hand":"🫴","⊛ leftwards pushing hand":"🫷","⊛ rightwards pushing hand":"🫸","pinched fingers":"🤌","pinching hand":"🤏","victory hand":"✌","crossed fingers":"🤞","hand with index finger and thumb crossed":"🫰","love-you gesture":"🤟","sign of the horns":"🤘","call me hand":"🤙","middle finger":"🖕","index pointing up":"☝","index pointing at the viewer":"🫵","left-facing fist":"🤛","right-facing fist":"🤜","heart hands":"🫶","palms up together":"🤲",handshake:"🤝",selfie:"🤳","mechanical arm":"🦾","mechanical leg":"🦿",leg:"🦵",foot:"🦶","ear with hearing aid":"🦻",brain:"🧠","anatomical heart":"🫀",lungs:"🫁",tooth:"🦷",bone:"🦴",eye:"👁","biting lip":"🫦",child:"🧒",person:"🧑","person: beard":"🧔","man: beard":"🧔‍♂️","woman: beard":"🧔‍♀️","man: red hair":"👨‍🦰","man: curly hair":"👨‍🦱","man: white hair":"👨‍🦳","man: bald":"👨‍🦲","woman: red hair":"👩‍🦰","person: red hair":"🧑‍🦰","woman: curly hair":"👩‍🦱","person: curly hair":"🧑‍🦱","woman: white hair":"👩‍🦳","person: white hair":"🧑‍🦳","woman: bald":"👩‍🦲","person: bald":"🧑‍🦲","woman: blond hair":"👱‍♀️","man: blond hair":"👱‍♂️","older person":"🧓","man frowning":"🙍‍♂️","woman frowning":"🙍‍♀️","man pouting":"🙎‍♂️","woman pouting":"🙎‍♀️","man gesturing NO":"🙅‍♂️","woman gesturing NO":"🙅‍♀️","man gesturing OK":"🙆‍♂️","woman gesturing OK":"🙆‍♀️","man tipping hand":"💁‍♂️","woman tipping hand":"💁‍♀️","man raising hand":"🙋‍♂️","woman raising hand":"🙋‍♀️","deaf person":"🧏","deaf man":"🧏‍♂️","deaf woman":"🧏‍♀️","man bowing":"🙇‍♂️","woman bowing":"🙇‍♀️","person facepalming":"🤦","man facepalming":"🤦‍♂️","woman facepalming":"🤦‍♀️","person shrugging":"🤷","man shrugging":"🤷‍♂️","woman shrugging":"🤷‍♀️","health worker":"🧑‍⚕️","man health worker":"👨‍⚕️","woman health worker":"👩‍⚕️",student:"🧑‍🎓","man student":"👨‍🎓","woman student":"👩‍🎓",teacher:"🧑‍🏫","man teacher":"👨‍🏫","woman teacher":"👩‍🏫",judge:"🧑‍⚖️","man judge":"👨‍⚖️","woman judge":"👩‍⚖️",farmer:"🧑‍🌾","man farmer":"👨‍🌾","woman farmer":"👩‍🌾",cook:"🧑‍🍳","man cook":"👨‍🍳","woman cook":"👩‍🍳",mechanic:"🧑‍🔧","man mechanic":"👨‍🔧","woman mechanic":"👩‍🔧","factory worker":"🧑‍🏭","man factory worker":"👨‍🏭","woman factory worker":"👩‍🏭","office worker":"🧑‍💼","man office worker":"👨‍💼","woman office worker":"👩‍💼",scientist:"🧑‍🔬","man scientist":"👨‍🔬","woman scientist":"👩‍🔬",technologist:"🧑‍💻","man technologist":"👨‍💻","woman technologist":"👩‍💻",singer:"🧑‍🎤","man singer":"👨‍🎤","woman singer":"👩‍🎤",artist:"🧑‍🎨","man artist":"👨‍🎨","woman artist":"👩‍🎨",pilot:"🧑‍✈️","man pilot":"👨‍✈️","woman pilot":"👩‍✈️",astronaut:"🧑‍🚀","man astronaut":"👨‍🚀","woman astronaut":"👩‍🚀",firefighter:"🧑‍🚒","man firefighter":"👨‍🚒","woman firefighter":"👩‍🚒","man police officer":"👮‍♂️","woman police officer":"👮‍♀️",detective:"🕵","man detective":"🕵️‍♂️","woman detective":"🕵️‍♀️","man guard":"💂‍♂️","woman guard":"💂‍♀️",ninja:"🥷","man construction worker":"👷‍♂️","woman construction worker":"👷‍♀️","person with crown":"🫅",prince:"🤴","man wearing turban":"👳‍♂️","woman wearing turban":"👳‍♀️","woman with headscarf":"🧕","person in tuxedo":"🤵","man in tuxedo":"🤵‍♂️","woman in tuxedo":"🤵‍♀️","man with veil":"👰‍♂️","woman with veil":"👰‍♀️","pregnant woman":"🤰","pregnant man":"🫃","pregnant person":"🫄","breast-feeding":"🤱","woman feeding baby":"👩‍🍼","man feeding baby":"👨‍🍼","person feeding baby":"🧑‍🍼","Mrs. Claus":"🤶","mx claus":"🧑‍🎄",superhero:"🦸","man superhero":"🦸‍♂️","woman superhero":"🦸‍♀️",supervillain:"🦹","man supervillain":"🦹‍♂️","woman supervillain":"🦹‍♀️",mage:"🧙","man mage":"🧙‍♂️","woman mage":"🧙‍♀️",fairy:"🧚","man fairy":"🧚‍♂️","woman fairy":"🧚‍♀️",vampire:"🧛","man vampire":"🧛‍♂️","woman vampire":"🧛‍♀️",merperson:"🧜",merman:"🧜‍♂️",mermaid:"🧜‍♀️",elf:"🧝","man elf":"🧝‍♂️","woman elf":"🧝‍♀️",genie:"🧞","man genie":"🧞‍♂️","woman genie":"🧞‍♀️",zombie:"🧟","man zombie":"🧟‍♂️","woman zombie":"🧟‍♀️",troll:"🧌","man getting massage":"💆‍♂️","woman getting massage":"💆‍♀️","man getting haircut":"💇‍♂️","woman getting haircut":"💇‍♀️","man walking":"🚶‍♂️","woman walking":"🚶‍♀️","person standing":"🧍","man standing":"🧍‍♂️","woman standing":"🧍‍♀️","person kneeling":"🧎","man kneeling":"🧎‍♂️","woman kneeling":"🧎‍♀️","person with white cane":"🧑‍🦯","man with white cane":"👨‍🦯","woman with white cane":"👩‍🦯","person in motorized wheelchair":"🧑‍🦼","man in motorized wheelchair":"👨‍🦼","woman in motorized wheelchair":"👩‍🦼","person in manual wheelchair":"🧑‍🦽","man in manual wheelchair":"👨‍🦽","woman in manual wheelchair":"👩‍🦽","man running":"🏃‍♂️","woman running":"🏃‍♀️","man dancing":"🕺","person in suit levitating":"🕴","men with bunny ears":"👯‍♂️","women with bunny ears":"👯‍♀️","person in steamy room":"🧖","man in steamy room":"🧖‍♂️","woman in steamy room":"🧖‍♀️","person climbing":"🧗","man climbing":"🧗‍♂️","woman climbing":"🧗‍♀️","person fencing":"🤺","horse racing":"🏇",skier:"⛷","person golfing":"🏌","man golfing":"🏌️‍♂️","woman golfing":"🏌️‍♀️","man surfing":"🏄‍♂️","woman surfing":"🏄‍♀️","person rowing boat":"🚣","man rowing boat":"🚣‍♂️","woman rowing boat":"🚣‍♀️","man swimming":"🏊‍♂️","woman swimming":"🏊‍♀️","person bouncing ball":"⛹","man bouncing ball":"⛹️‍♂️","woman bouncing ball":"⛹️‍♀️","person lifting weights":"🏋","man lifting weights":"🏋️‍♂️","woman lifting weights":"🏋️‍♀️","person biking":"🚴","man biking":"🚴‍♂️","woman biking":"🚴‍♀️","person mountain biking":"🚵","man mountain biking":"🚵‍♂️","woman mountain biking":"🚵‍♀️","person cartwheeling":"🤸","man cartwheeling":"🤸‍♂️","woman cartwheeling":"🤸‍♀️","people wrestling":"🤼","men wrestling":"🤼‍♂️","women wrestling":"🤼‍♀️","person playing water polo":"🤽","man playing water polo":"🤽‍♂️","woman playing water polo":"🤽‍♀️","person playing handball":"🤾","man playing handball":"🤾‍♂️","woman playing handball":"🤾‍♀️","person juggling":"🤹","man juggling":"🤹‍♂️","woman juggling":"🤹‍♀️","person in lotus position":"🧘","man in lotus position":"🧘‍♂️","woman in lotus position":"🧘‍♀️","person in bed":"🛌","people holding hands":"🧑‍🤝‍🧑","women holding hands":"👭","men holding hands":"👬","kiss: woman, man":"👩‍❤️‍💋‍👨","kiss: man, man":"👨‍❤️‍💋‍👨","kiss: woman, woman":"👩‍❤️‍💋‍👩","couple with heart: woman, man":"👩‍❤️‍👨","couple with heart: man, man":"👨‍❤️‍👨","couple with heart: woman, woman":"👩‍❤️‍👩","family: man, woman, boy":"👨‍👩‍👦","family: man, woman, girl":"👨‍👩‍👧","family: man, woman, girl, boy":"👨‍👩‍👧‍👦","family: man, woman, boy, boy":"👨‍👩‍👦‍👦","family: man, woman, girl, girl":"👨‍👩‍👧‍👧","family: man, man, boy":"👨‍👨‍👦","family: man, man, girl":"👨‍👨‍👧","family: man, man, girl, boy":"👨‍👨‍👧‍👦","family: man, man, boy, boy":"👨‍👨‍👦‍👦","family: man, man, girl, girl":"👨‍👨‍👧‍👧","family: woman, woman, boy":"👩‍👩‍👦","family: woman, woman, girl":"👩‍👩‍👧","family: woman, woman, girl, boy":"👩‍👩‍👧‍👦","family: woman, woman, boy, boy":"👩‍👩‍👦‍👦","family: woman, woman, girl, girl":"👩‍👩‍👧‍👧","family: man, boy":"👨‍👦","family: man, boy, boy":"👨‍👦‍👦","family: man, girl":"👨‍👧","family: man, girl, boy":"👨‍👧‍👦","family: man, girl, girl":"👨‍👧‍👧","family: woman, boy":"👩‍👦","family: woman, boy, boy":"👩‍👦‍👦","family: woman, girl":"👩‍👧","family: woman, girl, boy":"👩‍👧‍👦","family: woman, girl, girl":"👩‍👧‍👧","speaking head":"🗣","busts in silhouette":"👥","people hugging":"🫂","red hair":"🦰","curly hair":"🦱","white hair":"🦳",bald:"🦲",gorilla:"🦍",orangutan:"🦧","dog whole":"🐕","guide dog":"🦮","service dog":"🐕‍🦺",fox:"🦊",raccoon:"🦝","cat whole":"🐈","black cat":"🐈‍⬛",lion:"🦁","tiger whole":"🐅",leopard:"🐆","⊛ moose":"🫎","⊛ donkey":"🫏",unicorn:"🦄",zebra:"🦓",deer:"🦌",bison:"🦬",ox:"🐂","water buffalo":"🐃","cow whole":"🐄","pig whole":"🐖",ram:"🐏",goat:"🐐","camel one hump":"🐪",llama:"🦙",giraffe:"🦒",mammoth:"🦣",rhinoceros:"🦏",hippopotamus:"🦛","mouse whole":"🐁",rat:"🐀","rabbit whole":"🐇",chipmunk:"🐿",beaver:"🦫",hedgehog:"🦔",bat:"🦇","polar bear":"🐻‍❄️",sloth:"🦥",otter:"🦦",skunk:"🦨",kangaroo:"🦘",badger:"🦡",turkey:"🦃",rooster:"🐓",dove:"🕊",eagle:"🦅",duck:"🦆",swan:"🦢",owl:"🦉",dodo:"🦤",feather:"🪶",flamingo:"🦩",peacock:"🦚",parrot:"🦜","⊛ wing":"🪽","⊛ black bird":"🐦‍⬛","⊛ goose":"🪿",crocodile:"🐊",lizard:"🦎",dragon:"🐉",sauropod:"🦕","T-Rex":"🦖","whale whole":"🐋",seal:"🦭",shark:"🦈",coral:"🪸","⊛ jellyfish":"🪼",butterfly:"🦋","green beetle":"🪲",cricket:"🦗",cockroach:"🪳",spider:"🕷","spider web":"🕸",scorpion:"🦂",mosquito:"🦟",fly:"🪰",worm:"🪱",microbe:"🦠",lotus:"🪷",rosette:"🏵","wilted flower":"🥀","⊛ hyacinth":"🪻","potted plant":"🪴","evergreen tree":"🌲","deciduous tree":"🌳",shamrock:"☘","empty nest":"🪹","nest with eggs":"🪺",lemon:"🍋",mango:"🥭",pear:"🍐",blueberries:"🫐","kiwi fruit":"🥝",olive:"🫒",coconut:"🥥",avocado:"🥑",potato:"🥔",carrot:"🥕","hot pepper":"🌶","bell pepper":"🫑",cucumber:"🥒","leafy green":"🥬",broccoli:"🥦",garlic:"🧄",onion:"🧅",peanuts:"🥜",beans:"🫘","⊛ ginger root":"🫚","⊛ pea pod":"🫛",croissant:"🥐","baguette bread":"🥖",flatbread:"🫓",pretzel:"🥨",bagel:"🥯",pancakes:"🥞",waffle:"🧇","cheese wedge":"🧀","cut of meat":"🥩",bacon:"🥓","hot dog":"🌭",sandwich:"🥪",taco:"🌮",burrito:"🌯",tamale:"🫔","stuffed flatbread":"🥙",falafel:"🧆","white egg":"🥚","shallow pan of food":"🥘",fondue:"🫕","bowl with spoon":"🥣","green salad":"🥗",popcorn:"🍿",butter:"🧈",salt:"🧂","canned food":"🥫","moon cake":"🥮",dumpling:"🥟","fortune cookie":"🥠","takeout box":"🥡",crab:"🦀",lobster:"🦞",shrimp:"🦐",squid:"🦑",oyster:"🦪",cupcake:"🧁",pie:"🥧","baby bottle":"🍼","glass of milk":"🥛","hot beverage":"☕",teapot:"🫖","bottle with popping cork":"🍾","clinking glasses":"🥂","tumbler glass":"🥃","pouring liquid":"🫗","cup with straw":"🥤","bubble tea":"🧋","beverage box":"🧃",mate:"🧉",ice:"🧊",chopsticks:"🥢","fork and knife with plate":"🍽",spoon:"🥄",jar:"🫙",amphora:"🏺","globe showing Europe-Africa":"🌍","globe showing Americas":"🌎","globe with meridians":"🌐","world map":"🗺",compass:"🧭","snow-capped mountain":"🏔",mountain:"⛰",camping:"🏕","beach with umbrella":"🏖",desert:"🏜","desert island":"🏝","national park":"🏞",stadium:"🏟","classical building":"🏛","building construction":"🏗",brick:"🧱",rock:"🪨",wood:"🪵",hut:"🛖",houses:"🏘","derelict house":"🏚","post office":"🏤",mosque:"🕌","hindu temple":"🛕",synagogue:"🕍","shinto shrine":"⛩",kaaba:"🕋",cityscape:"🏙","hot springs":"♨","playground slide":"🛝",locomotive:"🚂",train:"🚆","light rail":"🚈",tram:"🚊",monorail:"🚝","mountain railway":"🚞","tram car":"🚋","oncoming bus":"🚍",trolleybus:"🚎",minibus:"🚐","oncoming police car":"🚔","oncoming taxi":"🚖","oncoming automobile":"🚘","pickup truck":"🛻","articulated lorry":"🚛",tractor:"🚜","racing car":"🏎",motorcycle:"🏍","motor scooter":"🛵","manual wheelchair":"🦽","motorized wheelchair":"🦼","auto rickshaw":"🛺","kick scooter":"🛴",skateboard:"🛹","roller skate":"🛼",motorway:"🛣","railway track":"🛤","oil drum":"🛢",wheel:"🛞","vertical traffic light":"🚦","stop sign":"🛑",anchor:"⚓","ring buoy":"🛟",canoe:"🛶","passenger ship":"🛳",ferry:"⛴","motor boat":"🛥",airplane:"✈","small airplane":"🛩","airplane departure":"🛫","airplane arrival":"🛬",parachute:"🪂",helicopter:"🚁","suspension railway":"🚟","mountain cableway":"🚠","aerial tramway":"🚡","space satellite":"🛰","flying saucer":"🛸","bellhop bell":"🛎",luggage:"🧳",stopwatch:"⏱","timer clock":"⏲","mantelpiece clock":"🕰","twelve-thirty":"🕧","one-thirty":"🕜","two-thirty":"🕝","three-thirty":"🕞","four-thirty":"🕟","five-thirty":"🕠","six-thirty":"🕡","seven-thirty":"🕢","eight-thirty":"🕣","nine-thirty":"🕤","ten-thirty":"🕥","eleven-thirty":"🕦","waxing crescent moon":"🌒","waning gibbous moon":"🌖","last quarter moon":"🌗","waning crescent moon":"🌘","new moon face":"🌚","last quarter moon face":"🌜",thermometer:"🌡",sun:"☀","full moon face":"🌝","sun with face":"🌞","ringed planet":"🪐",star:"⭐",cloud:"☁","cloud with lightning and rain":"⛈","sun behind small cloud":"🌤","sun behind large cloud":"🌥","sun behind rain cloud":"🌦","cloud with rain":"🌧","cloud with snow":"🌨","cloud with lightning":"🌩",tornado:"🌪",fog:"🌫","wind face":"🌬",umbrella:"☂","umbrella with rain drops":"☔","umbrella on ground":"⛱","high voltage":"⚡",snowflake:"❄","snowman four buttons":"☃",comet:"☄",firecracker:"🧨","red envelope":"🧧","reminder ribbon":"🎗","admission tickets":"🎟","military medal":"🎖","sports medal":"🏅","1st place medal":"🥇","2nd place medal":"🥈","3rd place medal":"🥉",softball:"🥎",volleyball:"🏐","rugby football":"🏉","flying disc":"🥏","cricket game":"🏏","field hockey":"🏑","ice hockey":"🏒",lacrosse:"🥍","ping pong":"🏓",badminton:"🏸","boxing glove":"🥊","martial arts uniform":"🥋","goal net":"🥅","ice skate":"⛸","diving mask":"🤿",sled:"🛷","curling stone":"🥌","yo-yo":"🪀",kite:"🪁","magic wand":"🪄",joystick:"🕹","puzzle piece":"🧩","teddy bear":"🧸",piñata:"🪅","mirror ball":"🪩","nesting dolls":"🪆","spade suit":"♠","heart suit":"♥","diamond suit":"♦","club suit":"♣","chess pawn":"♟","framed picture":"🖼",thread:"🧵","sewing needle":"🪡",yarn:"🧶",knot:"🪢","sunglasses shades":"🕶",goggles:"🥽","lab coat":"🥼","safety vest":"🦺",scarf:"🧣",gloves:"🧤",coat:"🧥",socks:"🧦",sari:"🥻","one-piece swimsuit":"🩱",briefs:"🩲",shorts:"🩳","⊛ folding hand fan":"🪭","shopping bags":"🛍","thong sandal":"🩴","hiking boot":"🥾","flat shoe":"🥿","ballet shoes":"🩰","⊛ hair pick":"🪮","billed cap":"🧢","military helmet":"🪖","rescue worker’s helmet":"⛑","prayer beads":"📿","muted speaker":"🔇","speaker low volume":"🔈","speaker medium volume":"🔉","postal horn":"📯","bell with slash":"🔕","studio microphone":"🎙","level slider":"🎚","control knobs":"🎛",accordion:"🪗",banjo:"🪕",drum:"🥁","long drum":"🪘","⊛ maracas":"🪇","⊛ flute":"🪈",telephone:"☎","low battery":"🪫","desktop computer":"🖥",printer:"🖨",keyboard:"⌨","computer mouse":"🖱",trackball:"🖲",abacus:"🧮","film frames":"🎞","film projector":"📽","camera with flash":"📸",candle:"🕯","diya lamp":"🪔","rolled-up newspaper":"🗞",label:"🏷",coin:"🪙","euro banknote":"💶","pound banknote":"💷",receipt:"🧾",envelope:"✉","open mailbox with raised flag":"📬","open mailbox with lowered flag":"📭","ballot box with ballot":"🗳",pencil:"✏","black nib":"✒","fountain pen":"🖋",pen:"🖊",paintbrush:"🖌",crayon:"🖍","card index dividers":"🗂","spiral notepad":"🗒","spiral calendar":"🗓","linked paperclips":"🖇",scissors:"✂","card file box":"🗃","file cabinet":"🗄",wastebasket:"🗑","old key":"🗝",axe:"🪓",pick:"⛏","hammer and pick":"⚒","hammer and wrench":"🛠",dagger:"🗡","crossed swords":"⚔",boomerang:"🪃","bow and arrow":"🏹",shield:"🛡","carpentry saw":"🪚",screwdriver:"🪛",gear:"⚙",clamp:"🗜","balance scale":"⚖","white cane":"🦯",chains:"⛓",hook:"🪝",toolbox:"🧰",magnet:"🧲",ladder:"🪜",alembic:"⚗","test tube":"🧪","petri dish":"🧫",dna:"🧬",microscope:"🔬",telescope:"🔭","drop of blood":"🩸","adhesive bandage":"🩹",crutch:"🩼",stethoscope:"🩺","x-ray":"🩻",elevator:"🛗",mirror:"🪞",window:"🪟",bed:"🛏","couch and lamp":"🛋",chair:"🪑",plunger:"🪠",shower:"🚿",bathtub:"🛁","mouse trap":"🪤",razor:"🪒","lotion bottle":"🧴","safety pin":"🧷",broom:"🧹",basket:"🧺","roll of paper":"🧻",bucket:"🪣",soap:"🧼",bubbles:"🫧",toothbrush:"🪥",sponge:"🧽","fire extinguisher":"🧯","shopping cart":"🛒",coffin:"⚰",headstone:"🪦","funeral urn":"⚱","nazar amulet":"🧿",hamsa:"🪬",placard:"🪧","identification card":"🪪","litter in bin sign":"🚮","potable water":"🚰","wheelchair symbol":"♿","passport control":"🛂",customs:"🛃","baggage claim":"🛄","left luggage":"🛅",warning:"⚠","children crossing":"🚸","no bicycles":"🚳","no littering":"🚯","non-potable water":"🚱","no pedestrians":"🚷","no mobile phones":"📵",radioactive:"☢",biohazard:"☣","up arrow":"⬆","up-right arrow":"↗","right arrow":"➡","down-right arrow":"↘","down arrow":"⬇","down-left arrow":"↙","left arrow":"⬅","up-left arrow":"↖","up-down arrow":"↕","left-right arrow":"↔","right arrow curving left":"↩","left arrow curving right":"↪","right arrow curving up":"⤴","right arrow curving down":"⤵","counterclockwise arrows button":"🔄","place of worship":"🛐","atom symbol":"⚛",om:"🕉","star of David":"✡","wheel of dharma":"☸","yin yang":"☯","latin cross":"✝","orthodox cross":"☦","star and crescent":"☪","peace symbol":"☮",menorah:"🕎","⊛ khanda":"🪯",Aries:"♈",Taurus:"♉",Gemini:"♊",Cancer:"♋",Leo:"♌",Virgo:"♍",Libra:"♎",Scorpio:"♏",Sagittarius:"♐",Capricorn:"♑",Aquarius:"♒",Pisces:"♓","shuffle tracks button":"🔀","repeat button":"🔁","repeat single button":"🔂","play button":"▶","next track button":"⏭","play or pause button":"⏯","reverse button":"◀","last track button":"⏮","pause button":"⏸","stop button":"⏹","record button":"⏺","eject button":"⏏","dim button":"🔅","bright button":"🔆","⊛ wireless":"🛜","female sign":"♀","male sign":"♂","transgender symbol":"⚧",multiply:"✖","heavy equals sign":"🟰",infinity:"♾","double exclamation mark":"‼","exclamation question mark":"⁉","wavy dash":"〰","medical symbol":"⚕","recycling symbol":"♻","fleur-de-lis":"⚜","check box with check":"☑","check mark":"✔","double curly loop":"➿","part alternation mark":"〽","eight-spoked asterisk":"✳","eight-pointed star":"✴",sparkle:"❇",copyright:"©",registered:"®","trade mark":"™","keycap: #":"#️⃣","keycap: *":"*️⃣","keycap: 0":"0️⃣","keycap: 1":"1️⃣","keycap: 2":"2️⃣","keycap: 3":"3️⃣","keycap: 4":"4️⃣","keycap: 5":"5️⃣","keycap: 6":"6️⃣","keycap: 7":"7️⃣","keycap: 8":"8️⃣","keycap: 9":"9️⃣","A button (blood type)":"🅰","B button (blood type)":"🅱",information:"ℹ","circled M":"Ⓜ","O button (blood type)":"🅾","P button":"🅿","Japanese “service charge” button":"🈂","Japanese “monthly amount” button":"🈷","Japanese “congratulations” button":"㊗","Japanese “secret” button":"㊙","orange circle":"🟠","yellow circle":"🟡","green circle":"🟢","purple circle":"🟣","brown circle":"🟤","black circle":"⚫","white circle":"⚪","red square":"🟥","orange square":"🟧","yellow square":"🟨","green square":"🟩","blue square":"🟦","purple square":"🟪","brown square":"🟫","black medium square":"◼","white medium square":"◻","black medium-small square":"◾","white medium-small square":"◽","black small square":"▪","white small square":"▫","black flag":"🏴","white flag":"🏳","rainbow flag":"🏳️‍🌈","transgender flag":"🏳️‍⚧️","pirate flag":"🏴‍☠️","flag: Ascension Island":"🇦🇨","flag: Andorra":"🇦🇩","flag: United Arab Emirates":"🇦🇪","flag: Afghanistan":"🇦🇫","flag: Antigua & Barbuda":"🇦🇬","flag: Anguilla":"🇦🇮","flag: Albania":"🇦🇱","flag: Armenia":"🇦🇲","flag: Angola":"🇦🇴","flag: Antarctica":"🇦🇶","flag: Argentina":"🇦🇷","flag: American Samoa":"🇦🇸","flag: Austria":"🇦🇹","flag: Australia":"🇦🇺","flag: Aruba":"🇦🇼","flag: Åland Islands":"🇦🇽","flag: Azerbaijan":"🇦🇿","flag: Bosnia & Herzegovina":"🇧🇦","flag: Barbados":"🇧🇧","flag: Bangladesh":"🇧🇩","flag: Belgium":"🇧🇪","flag: Burkina Faso":"🇧🇫","flag: Bulgaria":"🇧🇬","flag: Bahrain":"🇧🇭","flag: Burundi":"🇧🇮","flag: Benin":"🇧🇯","flag: St. Barthélemy":"🇧🇱","flag: Bermuda":"🇧🇲","flag: Brunei":"🇧🇳","flag: Bolivia":"🇧🇴","flag: Caribbean Netherlands":"🇧🇶","flag: Brazil":"🇧🇷","flag: Bahamas":"🇧🇸","flag: Bhutan":"🇧🇹","flag: Bouvet Island":"🇧🇻","flag: Botswana":"🇧🇼","flag: Belarus":"🇧🇾","flag: Belize":"🇧🇿","flag: Canada":"🇨🇦","flag: Cocos (Keeling) Islands":"🇨🇨","flag: Congo - Kinshasa":"🇨🇩","flag: Central African Republic":"🇨🇫","flag: Congo - Brazzaville":"🇨🇬","flag: Switzerland":"🇨🇭","flag: Côte d’Ivoire":"🇨🇮","flag: Cook Islands":"🇨🇰","flag: Chile":"🇨🇱","flag: Cameroon":"🇨🇲","flag: China":"🇨🇳","flag: Colombia":"🇨🇴","flag: Clipperton Island":"🇨🇵","flag: Costa Rica":"🇨🇷","flag: Cuba":"🇨🇺","flag: Cape Verde":"🇨🇻","flag: Curaçao":"🇨🇼","flag: Christmas Island":"🇨🇽","flag: Cyprus":"🇨🇾","flag: Czechia":"🇨🇿","flag: Germany":"🇩🇪","flag: Diego Garcia":"🇩🇬","flag: Djibouti":"🇩🇯","flag: Denmark":"🇩🇰","flag: Dominica":"🇩🇲","flag: Dominican Republic":"🇩🇴","flag: Algeria":"🇩🇿","flag: Ceuta & Melilla":"🇪🇦","flag: Ecuador":"🇪🇨","flag: Estonia":"🇪🇪","flag: Egypt":"🇪🇬","flag: Western Sahara":"🇪🇭","flag: Eritrea":"🇪🇷","flag: Spain":"🇪🇸","flag: Ethiopia":"🇪🇹","flag: European Union":"🇪🇺","flag: Finland":"🇫🇮","flag: Fiji":"🇫🇯","flag: Falkland Islands":"🇫🇰","flag: Micronesia":"🇫🇲","flag: Faroe Islands":"🇫🇴","flag: France":"🇫🇷","flag: Gabon":"🇬🇦","flag: United Kingdom":"🇬🇧","flag: Grenada":"🇬🇩","flag: Georgia":"🇬🇪","flag: French Guiana":"🇬🇫","flag: Guernsey":"🇬🇬","flag: Ghana":"🇬🇭","flag: Gibraltar":"🇬🇮","flag: Greenland":"🇬🇱","flag: Gambia":"🇬🇲","flag: Guinea":"🇬🇳","flag: Guadeloupe":"🇬🇵","flag: Equatorial Guinea":"🇬🇶","flag: Greece":"🇬🇷","flag: South Georgia & South Sandwich Islands":"🇬🇸","flag: Guatemala":"🇬🇹","flag: Guam":"🇬🇺","flag: Guinea-Bissau":"🇬🇼","flag: Guyana":"🇬🇾","flag: Hong Kong SAR China":"🇭🇰","flag: Heard & McDonald Islands":"🇭🇲","flag: Honduras":"🇭🇳","flag: Croatia":"🇭🇷","flag: Haiti":"🇭🇹","flag: Hungary":"🇭🇺","flag: Canary Islands":"🇮🇨","flag: Indonesia":"🇮🇩","flag: Ireland":"🇮🇪","flag: Israel":"🇮🇱","flag: Isle of Man":"🇮🇲","flag: India":"🇮🇳","flag: British Indian Ocean Territory":"🇮🇴","flag: Iraq":"🇮🇶","flag: Iran":"🇮🇷","flag: Iceland":"🇮🇸","flag: Italy":"🇮🇹","flag: Jersey":"🇯🇪","flag: Jamaica":"🇯🇲","flag: Jordan":"🇯🇴","flag: Japan":"🇯🇵","flag: Kenya":"🇰🇪","flag: Kyrgyzstan":"🇰🇬","flag: Cambodia":"🇰🇭","flag: Kiribati":"🇰🇮","flag: Comoros":"🇰🇲","flag: St. Kitts & Nevis":"🇰🇳","flag: North Korea":"🇰🇵","flag: South Korea":"🇰🇷","flag: Kuwait":"🇰🇼","flag: Cayman Islands":"🇰🇾","flag: Kazakhstan":"🇰🇿","flag: Laos":"🇱🇦","flag: Lebanon":"🇱🇧","flag: St. Lucia":"🇱🇨","flag: Liechtenstein":"🇱🇮","flag: Sri Lanka":"🇱🇰","flag: Liberia":"🇱🇷","flag: Lesotho":"🇱🇸","flag: Lithuania":"🇱🇹","flag: Luxembourg":"🇱🇺","flag: Latvia":"🇱🇻","flag: Libya":"🇱🇾","flag: Morocco":"🇲🇦","flag: Monaco":"🇲🇨","flag: Moldova":"🇲🇩","flag: Montenegro":"🇲🇪","flag: St. Martin":"🇲🇫","flag: Madagascar":"🇲🇬","flag: Marshall Islands":"🇲🇭","flag: North Macedonia":"🇲🇰","flag: Mali":"🇲🇱","flag: Myanmar (Burma)":"🇲🇲","flag: Mongolia":"🇲🇳","flag: Macao SAR China":"🇲🇴","flag: Northern Mariana Islands":"🇲🇵","flag: Martinique":"🇲🇶","flag: Mauritania":"🇲🇷","flag: Montserrat":"🇲🇸","flag: Malta":"🇲🇹","flag: Mauritius":"🇲🇺","flag: Maldives":"🇲🇻","flag: Malawi":"🇲🇼","flag: Mexico":"🇲🇽","flag: Malaysia":"🇲🇾","flag: Mozambique":"🇲🇿","flag: Namibia":"🇳🇦","flag: New Caledonia":"🇳🇨","flag: Niger":"🇳🇪","flag: Norfolk Island":"🇳🇫","flag: Nigeria":"🇳🇬","flag: Nicaragua":"🇳🇮","flag: Netherlands":"🇳🇱","flag: Norway":"🇳🇴","flag: Nepal":"🇳🇵","flag: Nauru":"🇳🇷","flag: Niue":"🇳🇺","flag: New Zealand":"🇳🇿","flag: Oman":"🇴🇲","flag: Panama":"🇵🇦","flag: Peru":"🇵🇪","flag: French Polynesia":"🇵🇫","flag: Papua New Guinea":"🇵🇬","flag: Philippines":"🇵🇭","flag: Pakistan":"🇵🇰","flag: Poland":"🇵🇱","flag: St. Pierre & Miquelon":"🇵🇲","flag: Pitcairn Islands":"🇵🇳","flag: Puerto Rico":"🇵🇷","flag: Palestinian Territories":"🇵🇸","flag: Portugal":"🇵🇹","flag: Palau":"🇵🇼","flag: Paraguay":"🇵🇾","flag: Qatar":"🇶🇦","flag: Réunion":"🇷🇪","flag: Romania":"🇷🇴","flag: Serbia":"🇷🇸","flag: Russia":"🇷🇺","flag: Rwanda":"🇷🇼","flag: Saudi Arabia":"🇸🇦","flag: Solomon Islands":"🇸🇧","flag: Seychelles":"🇸🇨","flag: Sudan":"🇸🇩","flag: Sweden":"🇸🇪","flag: Singapore":"🇸🇬","flag: St. Helena":"🇸🇭","flag: Slovenia":"🇸🇮","flag: Svalbard & Jan Mayen":"🇸🇯","flag: Slovakia":"🇸🇰","flag: Sierra Leone":"🇸🇱","flag: San Marino":"🇸🇲","flag: Senegal":"🇸🇳","flag: Somalia":"🇸🇴","flag: Suriname":"🇸🇷","flag: South Sudan":"🇸🇸","flag: São Tomé & Príncipe":"🇸🇹","flag: El Salvador":"🇸🇻","flag: Sint Maarten":"🇸🇽","flag: Syria":"🇸🇾","flag: Eswatini":"🇸🇿","flag: Tristan da Cunha":"🇹🇦","flag: Turks & Caicos Islands":"🇹🇨","flag: Chad":"🇹🇩","flag: French Southern Territories":"🇹🇫","flag: Togo":"🇹🇬","flag: Thailand":"🇹🇭","flag: Tajikistan":"🇹🇯","flag: Tokelau":"🇹🇰","flag: Timor-Leste":"🇹🇱","flag: Turkmenistan":"🇹🇲","flag: Tunisia":"🇹🇳","flag: Tonga":"🇹🇴","flag: Turkey":"🇹🇷","flag: Trinidad & Tobago":"🇹🇹","flag: Tuvalu":"🇹🇻","flag: Taiwan":"🇹🇼","flag: Tanzania":"🇹🇿","flag: Ukraine":"🇺🇦","flag: Uganda":"🇺🇬","flag: U.S. Outlying Islands":"🇺🇲","flag: United Nations":"🇺🇳","flag: United States":"🇺🇸","flag: Uruguay":"🇺🇾","flag: Uzbekistan":"🇺🇿","flag: Vatican City":"🇻🇦","flag: St. Vincent & Grenadines":"🇻🇨","flag: Venezuela":"🇻🇪","flag: British Virgin Islands":"🇻🇬","flag: U.S. Virgin Islands":"🇻🇮","flag: Vietnam":"🇻🇳","flag: Vanuatu":"🇻🇺","flag: Wallis & Futuna":"🇼🇫","flag: Samoa":"🇼🇸","flag: Kosovo":"🇽🇰","flag: Yemen":"🇾🇪","flag: Mayotte":"🇾🇹","flag: South Africa":"🇿🇦","flag: Zambia":"🇿🇲","flag: Zimbabwe":"🇿🇼","flag: England":"🏴󠁧󠁢󠁥󠁮󠁧󠁿","flag: Scotland":"🏴󠁧󠁢󠁳󠁣󠁴󠁿","flag: Wales":"🏴󠁧󠁢󠁷󠁬󠁳󠁿"},turnIntoKebab=Tr=>Tr.replaceAll("_","-"),camelize=Tr=>Tr.replace(/-./g,Cr=>Cr[1].toUpperCase()),capitalizeFirstChar=Tr=>`${Tr.charAt(0).toUpperCase()}${Tr.slice(1)}`,getEmojiName=Tr=>{const Cr=capitalizeFirstChar(camelize(turnIntoKebab(Tr))),$r=/([A-Z])([A-Z])([a-z])|([a-z])([A-Z])/g;return Cr.replace($r,"$1$4 $2$3$5")},allEmojiObjects=Object.keys(allEmojis).map(Tr=>({id:Tr,name:getEmojiName(Tr),value:allEmojis[Tr]})),getEmojiUrl=Tr=>{if(!Tr)return null;const Cr=document.createElement("canvas");Cr.width=32,Cr.height=32;const $r=Cr.getContext("2d");return $r?($r.font="32px serif",$r.fillText(Tr,0,28),Cr.toDataURL("image/png")):null},configPaneSkaffold$7=[{title:"Size & Position",wrapNeeded:!0,items:[{type:"keyValueStacked",label:"X",id:"positionX",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"Y",id:"positionY",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"W",id:"positionWidth",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"H",id:"positionHeight",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"Rotation Angle",icon:"icon-angle.svg",id:"positionAngle",value:null,valueType:"number",constraints:{min:0,max:360},isRequired:!0,isEditable:!0}]},{title:"Text",items:[{type:"keyValue",label:"Font family",id:"fontFamily",value:null,selectedId:"Switzer",options:[],isRequired:!0},{type:"keyValue",label:"",id:"color",value:null,selectedId:null,options:[],isRequired:!1},{type:"keyValue",label:"Font weight",id:"fontWeight",value:null,selectedId:null,options:[],isRequired:!0},{type:"keyValue",label:"Font size",id:"fontSize",value:null,selectedId:"16",options:[],isRequired:!0,allowNewCreation:!0},{type:"textAlignment",label:"Text Alignment",id:"textAlignment",value:null,selectedId:"left",options:[],isRequired:!0},{type:"verticalAlignment",label:"Vertical Alignment",id:"verticalAlignment",value:null,selectedId:"center",options:[],isRequired:!0}]}],AIConfigPaneSkaffold$5=[{title:"Action choice",items:[{type:"aiActionOnText",label:"AI action",id:"aiActionOnText",value:!1,selectedId:"rewrite",options:[{id:"textSuggestionRewrite",name:"Rewrite",label:"Rewrite",value:"textSuggestionRewrite"},{id:"textSuggestionReduce",name:"Reduce",label:"Reduce",value:"textSuggestionReduce"},{id:"textSuggestionMagic",name:"Shakespeare",label:"Shakespeare",value:"textSuggestionMagic"}],isRequired:!0}]}],defaultConfig$7={ai:{content:{results:[],lastUsedKey:null}},link:{id:"link",value:null},icon:{id:"icon",show:!1,emoji:null,image:null,type:"emoji",alignment:"vertical",size:"M"},backgroundColor:{id:"backgroundColor",value:null,selectedId:null},color:{id:"color",value:null,selectedId:null},content:{id:"content",value:""},textType:{id:"textType",value:null,selectedId:"title"},textAlignment:{id:"textAlignment",value:null,selectedId:"center"},verticalAlignment:{id:"verticalAlignment",value:null,selectedId:"center"},fontFamily:{id:"fontFamily",value:null,selectedId:"Switzer"},fontWeight:{id:"fontWeight",value:null,selectedId:"regular"},fontSize:{id:"fontSize",value:null,selectedId:"16"},lineHeight:{id:"lineHeight",value:1.2,selectedId:null},letterSpacing:{id:"letterSpacing",value:"0em",selectedId:null},tone:{id:"tone",value:null,selectedId:"friendly"},contentLength:{id:"contentLength",value:null,selectedId:"short"},showBulletPoints:{id:"showBulletPoints",value:!1},aiResultId:{id:"aiResultId",value:null},promptSentToAI:{id:"promptSentToAI",value:null},positionX:{id:"positionX",value:null},positionY:{id:"positionY",value:null},positionWidth:{id:"positionWidth",value:null},positionHeight:{id:"positionHeight",value:null},positionAngle:{id:"positionAngle",value:null},moveForward:{id:"moveForward",value:!1,selectedId:null},moveBackward:{id:"moveBackward",value:!1,selectedId:null},moveUp:{id:"moveUp",value:!1,selectedId:null},moveDown:{id:"moveDown",value:!1,selectedId:null}},defaultDimensions$7={desktop:{normal:{width:480,height:56},dense:{width:1600,height:180}},laptop:{normal:{width:6,height:2},dense:{width:12,height:4}},tablet:{normal:{width:3,height:1},dense:{width:6,height:2}},mobile:{normal:{width:3,height:1},dense:{width:6,height:2}}},metaData$7={icon:"icon-component-text.svg"},heightByTextType$1={coverTitle:4*16*1.2+8,title:3*16*1.2+8,heading:2*16*1.2+8,smallHeading:1.125*16*1.2+8,subtitle:1.125*16*1.2+8,caption:.875*16*1.2+8},fontSizeByTextType$1={coverTitle:4*16,title:3*16,heading:2*16,smallHeading:1.125*16,subtitle:1.125*16,caption:.875*16},fontWeightByTextType$1={coverTitle:"700",title:"700",heading:"700",smallHeading:"700",subtitle:"400",caption:"400"},aiMenuButtons$1=[{id:"regenerate",type:"button",content:"Regenerate"},{id:"decline",type:"button",content:"Decline"},{id:"accept",type:"button",content:"Accept",isPrimary:!0}],text$2=Object.freeze(Object.defineProperty({__proto__:null,AIConfigPaneSkaffold:AIConfigPaneSkaffold$5,aiMenuButtons:aiMenuButtons$1,configPaneSkaffold:configPaneSkaffold$7,defaultConfig:defaultConfig$7,defaultDimensions:defaultDimensions$7,fontSizeByTextType:fontSizeByTextType$1,fontWeightByTextType:fontWeightByTextType$1,heightByTextType:heightByTextType$1,metaData:metaData$7},Symbol.toStringTag,{value:"Module"})),IMAGE_THEMES=[{id:"digital_painting",label:"Digital",value:"digital_painting",preset:"digital-art"},{id:"realistic",label:"Realistic",value:"realistic",preset:"photographic"},{id:"futuristic",label:"Fantasy",value:"futuristic",preset:"fantasy-art"},{id:"anime",label:"Anime",value:"anime",preset:"anime"},{id:"comic",label:"Comic",value:"comic",preset:"comic-book"},{id:"3d-model",label:"3D Model",value:"3d-model",preset:"3d-model"},{id:"analog-film",label:"Analog Film",value:"analog-film",preset:"analog-film"},{id:"cinematic",label:"Cinematic",value:"cinematic",preset:"cinematic"},{id:"isometric",label:"Isometric",value:"isometric",preset:"isometric"},{id:"line-art",label:"Line Art",value:"line-art",preset:"line-art"},{id:"low-poly",label:"Low Poly",value:"low-poly",preset:"low-poly"},{id:"neon-punk",label:"Neon Punk",value:"neon-punk",preset:"neon-punk"},{id:"pixel-art",label:"Pixel Art",value:"pixel-art",preset:"pixel-art"},{id:"origami",label:"Origami",value:"origami",preset:"origami"},{id:"tile-texture",label:"Tile Texture",value:"tile-texture",preset:"tile-texture"},{id:"modeling-compound",label:"Craft Clay",value:"modeling-compound",preset:"modeling-compound"}],configPaneSkaffold$6=[{title:"Size & Position",wrapNeeded:!0,items:[{type:"keyValueStacked",label:"X",id:"positionX",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"Y",id:"positionY",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"W",id:"positionWidth",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"H",id:"positionHeight",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"Rotation Angle",icon:"icon-angle.svg",id:"positionAngle",value:null,valueType:"number",constraints:{min:0,max:360},isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"Border Radius",icon:"icon-border-radius.svg",id:"borderRadius",value:null,valueType:"number",isRequired:!0,isEditable:!0}]},{title:"Flip & Rotate",wrapNeeded:!0,items:[{type:"flipHorizontal",label:"Flip Horizontal",id:"flipHorizontal",value:!1,selectedId:null,options:[],isRequired:!1},{type:"flipVertical",label:"Flip Vertical",id:"flipVertical",value:!1,selectedId:null,options:[],isRequired:!1},{type:"rotateAngle",label:"Rotate Image",id:"rotateAngle",selectedId:null,options:[],value:0,isRequired:!1}]},{title:"Fill",wrapNeeded:!0,items:[{type:"keyValueStacked",label:"Fit",id:"objectFit",value:null,isRequired:!0,selectedId:null},{type:"keyValueStacked",label:"Opacity",id:"opacity",value:100,valueType:"number",constraints:{min:0,max:100},isRequired:!1}]}],AIConfigPaneSkaffold$4=[{title:"Basic",items:[{type:"keyValue",label:"Describe an image",id:"content",value:null,valueType:"prompt",additionalItem:{type:"theme",id:"theme",value:null,selectedId:"realistic",description:"Theme of AI-generated images.",options:IMAGE_THEMES},isRequired:!1,description:"Express what you want the AI to generate."}]}],defaultConfig$6={ai:{content:{results:[]}},source:{id:"source",value:""},content:{id:"content",value:""},backgroundColor:{id:"backgroundColor",value:null,selectedId:null},hasRequestedAIImages:{id:"hasRequestedAIImages",value:!1},generatedBy:{id:"generatedBy",value:null},theme:{id:"theme",selectedId:"digital_painting"},imageDimensions:{id:"imageDimensions",value:null,selectedId:"1024x1024"},prompt:{id:"prompt",value:""},numberOfImages:{id:"numberOfImages",value:null,selectedId:"1"},promptSentToAI:{id:"promptSentToAI",value:null},positionX:{id:"positionX",value:null},positionY:{id:"positionY",value:null},positionWidth:{id:"positionWidth",value:null},positionHeight:{id:"positionHeight",value:null},positionAngle:{id:"positionAngle",value:null},borderRadius:{id:"borderRadius",value:null},objectFit:{id:"objectFit",value:null,selectedId:"cover"},objectPositionX:{id:"objectPositionX",value:null},objectPositionY:{id:"objectPositionY",value:null},objectScale:{id:"objectScale",value:100},flipHorizontal:{id:"flipHorizontal",value:!1,selectedId:null},flipVertical:{id:"flipVertical",value:!1,selectedId:null},rotateAngle:{id:"rotateAngle",value:0},moveForward:{id:"moveForward",value:!1,selectedId:null},moveBackward:{id:"moveBackward",value:!1,selectedId:null},moveUp:{id:"moveUp",value:!1,selectedId:null},moveDown:{id:"moveDown",value:!1,selectedId:null},borderColor:{id:"borderColor",value:null,selectedId:"neutral 1000"},borderThickness:{id:"borderThickness",value:1},borderPosition:{id:"borderPosition",value:null,selectedId:"inside"},showBorder:{id:"showBorder",value:!1},opacity:{id:"opacity",value:100}},defaultDimensions$6={desktop:{normal:{width:290,height:290},dense:{width:960,height:660}},laptop:{normal:{width:6,height:2},dense:{width:12,height:4}},tablet:{normal:{width:3,height:1},dense:{width:6,height:2}},mobile:{normal:{width:3,height:1},dense:{width:6,height:2}}},metaData$6={icon:"icon-image.svg",allowedTypes:["image/apng","image/avif","image/gif","image/jpeg","image/png","image/webp","image/svg+xml","image/heic","image/heif"],extensionFromType:{"image/apng":"apng","image/avif":"avif","image/gif":"gif","image/jpeg":"jpeg","image/png":"png","image/webp":"webp","image/svg+xml":"svg","image/heic":"heic","image/heif":"heif"}},image$3=Object.freeze(Object.defineProperty({__proto__:null,AIConfigPaneSkaffold:AIConfigPaneSkaffold$4,IMAGE_THEMES,configPaneSkaffold:configPaneSkaffold$6,defaultConfig:defaultConfig$6,defaultDimensions:defaultDimensions$6,metaData:metaData$6},Symbol.toStringTag,{value:"Module"})),configPaneSkaffold$5=[{title:"Size & Position",wrapNeeded:!0,items:[{type:"keyValueStacked",label:"X",id:"positionX",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"Y",id:"positionY",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"W",id:"positionWidth",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"H",id:"positionHeight",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"Rotation Angle",icon:"icon-angle.svg",id:"positionAngle",value:null,valueType:"number",constraints:{min:0,max:360},isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"Border Radius",icon:"icon-border-radius.svg",id:"borderRadius",value:null,valueType:"number",isRequired:!0,isEditable:!0,isShown:Tr=>Tr==="rectangle"},{type:"keyValueStacked",label:"S",id:"numSides",value:null,valueType:"number",isRequired:!0,isEditable:!0,isShown:Tr=>Tr==="polygon"}]},{title:"Layer order",wrapNeeded:!0,items:[{type:"moveForward",label:"Move forward",id:"moveForward",value:!1,selectedId:null,options:[],isRequired:!1},{type:"moveBackward",label:"Move backward",id:"moveBackward",value:!1,selectedId:null,options:[],isRequired:!1},{type:"moveUp",label:"Move up",id:"moveUp",value:!1,selectedId:null,options:[],isRequired:!1},{type:"moveDown",label:"Move down",id:"moveDown",value:!1,selectedId:null,options:[],isRequired:!1}]}],defaultConfig$5={ai:{content:{results:[]}},positionX:{id:"positionX",value:null},positionY:{id:"positionY",value:null},positionWidth:{id:"positionWidth",value:null},positionHeight:{id:"positionHeight",value:null},positionAngle:{id:"positionAngle",value:null},borderRadius:{id:"borderRadius",value:null},numSides:{id:"numSides",value:3},rotateAngle:{id:"rotateAngle",value:0},borderColor:{id:"borderColor",value:null,selectedId:"neutral 1000"},borderThickness:{id:"borderThickness",value:1},borderPosition:{id:"borderPosition",value:null,selectedId:"inside"},showBorder:{id:"showBorder",value:!1},opacity:{id:"opacity",value:100},shapeType:{id:"shapeType",value:"rectangle"},background:{id:"background",value:null,selectedId:"neutral 100"},moveForward:{id:"moveForward",value:!1,selectedId:null},moveBackward:{id:"moveBackward",value:!1,selectedId:null},moveUp:{id:"moveUp",value:!1,selectedId:null},moveDown:{id:"moveDown",value:!1,selectedId:null}},defaultDimensions$5={desktop:{normal:{width:100,height:100},dense:{width:960,height:660}},laptop:{normal:{width:6,height:2},dense:{width:12,height:4}},tablet:{normal:{width:3,height:1},dense:{width:6,height:2}},mobile:{normal:{width:3,height:1},dense:{width:6,height:2}}},metaData$5={icon:"icon-shape-rectangle.svg"},shape=Object.freeze(Object.defineProperty({__proto__:null,configPaneSkaffold:configPaneSkaffold$5,defaultConfig:defaultConfig$5,defaultDimensions:defaultDimensions$5,metaData:metaData$5},Symbol.toStringTag,{value:"Module"})),state$7=reactive({leftStickyMenu:{items:[],width:198},stickyMenu:{items:[],width:90},floatingPanes:!0,showingAISuggestions:!1,showingAICommandBar:isEnabled("cmdBar"),isStorytime:isStorytime(),appFooterHeight:canRenderStories()?88:0,appClickableArea:128,rightSidePaneWidth:64,leftSidePaneWidth:130,websiteViewHorizontalPadding:84,artboardHorizontalPadding:280,artboardVerticalPadding:128,cmdBarOpenSlideBtm:280,appHeaderHeight:54,appHeaderContentHeight:38,appHeader:{titleWidth:260,contentHeight:38,height:54,mobileHeight:48},appPaddingTop:24,appPaddingBottom:24,appPaddingRight:24,appPaddingLeft:24,aiConfigHeight:300,aiSuggestionsHeight:163+24,aiCommandBarHeight:52+16,closedCmdBarWidth:240,appDeviceSVGTop:44,appDeviceSVGBottom:34,userAppHeaderHeight:44,userAppSearchBarHeight:52,userAppFooterHeight:44,userAppTabBarHeight:50,artboardInfCanvasPaddingY:84,stickyMenusKnowledge:{CommentHouse:{name:"CommentHouse",displayName:"Comments"},ConfigPane:{name:"ConfigPane",displayName:""},LeftPane:{name:"LeftPane",displayName:""}},isWideScreen:IS_CLIENT?(localStorage.getItem("d_is_wide_screen")??!1)==="true":!1,mdCutOffInTailwind:800,mdBigCutOffInTailwind:880,deviceCategoryConfig:{mobile:{breakpoint:550,maxWidth:390,defaultHeight:844},portraitTablet:{breakpoint:768,maxWidth:768,defaultHeight:1024},tablet:{breakpoint:1100,maxWidth:1024,defaultHeight:768},laptop:{breakpoint:1500,maxWidth:1200,defaultHeight:900},desktop:{breakpoint:1920,maxWidth:960,defaultHeight:540}},gridLevels:{sparse:{mobile:6,tablet:9,laptop:24,desktop:30},normal:{mobile:12,tablet:17,laptop:48,desktop:32},dense:{mobile:24,tablet:34,laptop:96,desktop:120}},gridSizes:{sparse:{mobile:24,tablet:24,laptop:24,desktop:24},normal:{mobile:16,tablet:16,laptop:16,desktop:16},dense:{mobile:8,tablet:8,laptop:8,desktop:8}},minUnits:{mobile:{sparse:{width:1,height:1},normal:{width:2,height:1},dense:{width:2,height:1}},tablet:{sparse:{width:1,height:1},normal:{width:2,height:1},dense:{width:2,height:1}},laptop:{sparse:{width:2,height:1},normal:{width:2,height:2},dense:{width:3,height:2}},desktop:{sparse:{width:2,height:1},normal:{width:3,height:2},dense:{width:3,height:2}}},mobile:{deviceConfig:{breakpoint:0,maxWith:0,defaultHeight:0},gridConfig:{sparse:0,normal:0,dense:0}},slideLayouts:{default:[{type:"title",position:{x:30,y:30,height:56,width:900}},{type:"subtitle",position:{x:30,y:110,height:400,width:360}}],cover:[{type:"title",position:{x:150,y:180,height:120,width:660}},{type:"subtitle",position:{x:240,y:300,height:90,width:480}}]}}),getAISuggestionHeight=()=>state$7.showingAISuggestions?state$7.aiSuggestionsHeight:0,getAICommandBarHeight=()=>state$7.showingAICommandBar?state$7.aiCommandBarHeight:0,getTranslateYValueForArtboard=()=>state$7.showingAISuggestions?-74:0,getPaddingTopForArtboard=()=>getTranslateYValueForArtboard()===0?state$7.appHeader.height+state$7.appPaddingTop:state$7.appHeader.height+state$7.appPaddingTop+state$7.appPaddingTop,getMinUnits=(Tr,Cr)=>state$7.minUnits[Tr][Cr],getStickyMenuKeyName=(Tr="right")=>{let Cr="stickyMenu";return Tr==="left"&&(Cr="leftStickyMenu"),Cr},isStickyMenuShowing=(Tr="right")=>{const Cr=getStickyMenuKeyName(Tr);return state$7[Cr].items.length>0},getStickyMenuWidth=(Tr="right")=>{const Cr=getStickyMenuKeyName(Tr);let $r=parseFloat(state$7[Cr].width);return Tr==="right"&&($r=state$7.rightSidePaneWidth),Tr==="left"&&($r=state$7.leftSidePaneWidth),isStickyMenuShowing(Tr)?$r:0},getStickyMenuWidthForced=(Tr="right")=>{const Cr=getStickyMenuKeyName(Tr);let $r=parseFloat(state$7[Cr].width);return Tr==="right"&&($r=state$7.rightSidePaneWidth),Tr==="left"&&($r=state$7.leftSidePaneWidth),$r},getTotalStickyMenuWidth=()=>state$7.floatingPanes?0:getStickyMenuWidth("left")+getStickyMenuWidth("right"),widthWithStickyPanes=()=>`calc(100vw - ${getTotalStickyMenuWidth()}px)`,getStickyMenuItems=(Tr="right")=>{const Cr=getStickyMenuKeyName(Tr);return state$7[Cr].items},updateSidebarWidth=(Tr,Cr)=>{state$7[Cr].width=Tr.toString()},setGlobalProperty$1=(Tr,Cr)=>{state$7[Tr]=Cr},pushStickyMenu=(Tr,Cr="right")=>{var Ar;const $r=getStickyMenuKeyName(Cr);(Ar=state$7[$r])!=null&&Ar.items&&(state$7[$r].items=[Tr])},popStickyMenu=(Tr="right")=>{var $r;const Cr=getStickyMenuKeyName(Tr);($r=state$7[Cr])!=null&&$r.items&&(state$7[Cr].items=[])},toggleStickyMenu=(Tr,Cr="right")=>{if(isStickyMenuShowing(Cr)){popStickyMenu(Cr);return}pushStickyMenu(Tr,Cr)},toggleInsideStickyMenu=(Tr,Cr="right")=>{var Rr,Dr,Mr;const $r=getStickyMenuKeyName(Cr);((Dr=(Rr=state$7[$r].items[0])==null?void 0:Rr.context)==null?void 0:Dr.selectedButtonId)===((Mr=Tr==null?void 0:Tr.context)==null?void 0:Mr.selectedButtonId)&&(Tr.context.selectedButtonId=null),pushStickyMenu(Tr,Cr)},setStickyMenus=(Tr,Cr="right")=>{const $r=getStickyMenuKeyName(Cr);let Ar=Tr.map(Rr=>state$7.stickyMenusKnowledge[Rr]);Ar=Ar.filter(Rr=>Rr!=null),state$7[$r].items=Ar},layout={state:readonly(state$7),updateSidebarWidth,setGlobalProperty:setGlobalProperty$1,pushStickyMenu,popStickyMenu,setStickyMenus,isStickyMenuShowing,getStickyMenuItems,widthWithStickyPanes,getTotalStickyMenuWidth,getStickyMenuWidth,getStickyMenuKeyName,getMinUnits,getAISuggestionHeight,getAICommandBarHeight,toggleStickyMenu,toggleInsideStickyMenu,getStickyMenuWidthForced,getTranslateYValueForArtboard,getPaddingTopForArtboard},configPaneSkaffold$4=[{title:"Basic",items:[{type:"keyValue",label:"Items",id:"content",value:"",isRequired:!1},{type:"keyValue",label:"Type",id:"collectionType",value:null,selectedId:null,options:[],isRequired:!0}]},{title:"Layer order",wrapNeeded:!0,items:[{type:"moveForward",label:"Move forward",id:"moveForward",value:!1,selectedId:null,options:[],isRequired:!1},{type:"moveBackward",label:"Move backward",id:"moveBackward",value:!1,selectedId:null,options:[],isRequired:!1},{type:"moveUp",label:"Move up",id:"moveUp",value:!1,selectedId:null,options:[],isRequired:!1},{type:"moveDown",label:"Move down",id:"moveDown",value:!1,selectedId:null,options:[],isRequired:!1}]}],defaultConfig$4={ai:{content:{results:[]}},content:{id:"content",value:"Items, separated by commas"},collectionType:{id:"collectionType",value:null,selectedId:"row"},moveForward:{id:"moveForward",value:!1,selectedId:null},moveBackward:{id:"moveBackward",value:!1,selectedId:null},moveUp:{id:"moveUp",value:!1,selectedId:null},moveDown:{id:"moveDown",value:!1,selectedId:null}},defaultDimensions$4={desktop:{normal:{width:layout.state.gridLevels.normal.desktop,height:10},dense:{width:layout.state.gridLevels.dense.desktop,height:20}},laptop:{normal:{width:6,height:2},dense:{width:12,height:4}},tablet:{normal:{width:3,height:1},dense:{width:6,height:2}},mobile:{normal:{width:3,height:1},dense:{width:6,height:2}}},metaData$4={icon:"icon-component-grid.svg"},collection=Object.freeze(Object.defineProperty({__proto__:null,configPaneSkaffold:configPaneSkaffold$4,defaultConfig:defaultConfig$4,defaultDimensions:defaultDimensions$4,metaData:metaData$4},Symbol.toStringTag,{value:"Module"})),configPaneSkaffold$3=[{title:"Size & Position",wrapNeeded:!0,items:[{type:"keyValueStacked",label:"X",id:"positionX",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"Y",id:"positionY",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"W",id:"positionWidth",value:null,valueType:"number",isRequired:!0,isEditable:!0},{type:"keyValueStacked",label:"H",id:"positionHeight",value:null,valueType:"number",isRequired:!0,isEditable:!0}]}],AIConfigPaneSkaffold$3=[{title:"Action choice",items:[{type:"aiActionOnText",label:"AI action",id:"aiActionOnText",value:!1,selectedId:null,options:[],isRequired:!0}]}],defaultTableConfig=()=>{const Tr=guid(),Cr=guid(),$r=guid(),Ar=guid(),Rr=guid(),Dr=guid(),Mr=guid();return{colStore:{id:"colStore",value:{store:{[Tr]:{id:Tr,name:"Column 1",type:"text",isHidden:!1,style:{},format:{},width:180},[Cr]:{id:Cr,name:"Column 2",type:"text",isHidden:!1,style:{},format:{},width:180},[$r]:{id:$r,name:"Column 3",type:"text",isHidden:!1,style:{},format:{},width:180}},order:[Tr,Cr,$r]}},rowStore:{id:"rowStore",value:{store:{[Ar]:{id:Ar,isHidden:!1,style:{}},[Rr]:{id:Rr,isHidden:!1,style:{}},[Dr]:{id:Dr,isHidden:!1,style:{}},[Mr]:{id:Mr,isHidden:!1,style:{}}},order:[Ar,Rr,Dr,Mr]}},cellStore:{id:"cellStore",value:{store:{[Tr]:{[Ar]:{value:null,style:{}},[Rr]:{value:null,style:{}},[Dr]:{value:null,style:{}},[Mr]:{value:null,style:{}}},[Cr]:{[Ar]:{value:null,style:{}},[Rr]:{value:null,style:{}},[Dr]:{value:null,style:{}},[Mr]:{value:null,style:{}}},[$r]:{[Ar]:{value:null,style:{}},[Rr]:{value:null,style:{}},[Dr]:{value:null,style:{}},[Mr]:{value:null,style:{}}}}}}}},defaultConfig$3=()=>{const Tr=defaultTableConfig();return{ai:{content:{results:[],lastUsedKey:null}},colStore:{id:"colStore",value:lodashExports.cloneDeep(Tr.colStore.value)},rowStore:{id:"rowStore",value:lodashExports.cloneDeep(Tr.rowStore.value)},cellStore:{id:"cellStore",value:lodashExports.cloneDeep(Tr.cellStore.value)},hasHeaderRow:{id:"hasHeaderRow",value:!1},hasHeaderColumn:{id:"hasHeaderColumn",value:!1},hasZebraStripes:{id:"hasZebraStripes",value:!1},verticalAlignment:{id:"verticalAlignment",value:null,selectedId:"center"},positionX:{id:"positionX",value:null},positionY:{id:"positionY",value:null},positionWidth:{id:"positionWidth",value:null},positionHeight:{id:"positionHeight",value:null},positionAngle:{id:"positionAngle",value:null},moveForward:{id:"moveForward",value:!1,selectedId:null},moveBackward:{id:"moveBackward",value:!1,selectedId:null},moveUp:{id:"moveUp",value:!1,selectedId:null},moveDown:{id:"moveDown",value:!1,selectedId:null}}},defaultDimensions$3={desktop:{normal:{width:480,height:56},dense:{width:1600,height:180}},laptop:{normal:{width:6,height:2},dense:{width:12,height:4}},tablet:{normal:{width:3,height:1},dense:{width:6,height:2}},mobile:{normal:{width:3,height:1},dense:{width:6,height:2}}},metaData$3={icon:"icon-table.svg"},heightByTextType={coverTitle:4*16*1.2+8,title:3*16*1.2+8,heading:2*16*1.2+8,smallHeading:1.125*16*1.2+8,subtitle:1.125*16*1.2+8,caption:.875*16*1.2+8},fontSizeByTextType={coverTitle:4*16,title:3*16,heading:2*16,smallHeading:1.125*16,subtitle:1.125*16,caption:.875*16},fontWeightByTextType={coverTitle:"700",title:"700",heading:"700",smallHeading:"700",subtitle:"400",caption:"400"},aiMenuButtons=[],table$2=Object.freeze(Object.defineProperty({__proto__:null,AIConfigPaneSkaffold:AIConfigPaneSkaffold$3,aiMenuButtons,configPaneSkaffold:configPaneSkaffold$3,defaultConfig:defaultConfig$3,defaultDimensions:defaultDimensions$3,defaultTableConfig,fontSizeByTextType,fontWeightByTextType,heightByTextType,metaData:metaData$3},Symbol.toStringTag,{value:"Module"})),configPaneSkaffold$2=[],AIConfigPaneSkaffold$2=[],defaultConfig$2={link:{id:"link",value:null},dividerType:{id:"dividerType",value:null,selectedId:"solid"},positionX:{id:"positionX",value:null},positionY:{id:"positionY",value:null},positionWidth:{id:"positionWidth",value:null},positionHeight:{id:"positionHeight",value:null},positionAngle:{id:"positionAngle",value:null}},defaultDimensions$2={desktop:{normal:{width:480,height:26},dense:{width:1600,height:180}},laptop:{normal:{width:6,height:2},dense:{width:12,height:4}},tablet:{normal:{width:3,height:1},dense:{width:6,height:2}},mobile:{normal:{width:3,height:1},dense:{width:6,height:2}}},metaData$2={icon:"icon-divider.svg"},divider=Object.freeze(Object.defineProperty({__proto__:null,AIConfigPaneSkaffold:AIConfigPaneSkaffold$2,configPaneSkaffold:configPaneSkaffold$2,defaultConfig:defaultConfig$2,defaultDimensions:defaultDimensions$2,metaData:metaData$2},Symbol.toStringTag,{value:"Module"})),configPaneSkaffold$1=[],AIConfigPaneSkaffold$1=[],defaultConfig$1={url:{id:"url",value:null,selectedId:null},metadata:{id:"metadata",value:null},positionX:{id:"positionX",value:null},positionY:{id:"positionY",value:null},positionWidth:{id:"positionWidth",value:null},positionHeight:{id:"positionHeight",value:null},positionAngle:{id:"positionAngle",value:null}},defaultDimensions$1={desktop:{normal:{width:480,height:26},dense:{width:1600,height:180}},laptop:{normal:{width:6,height:2},dense:{width:12,height:4}},tablet:{normal:{width:3,height:1},dense:{width:6,height:2}},mobile:{normal:{width:3,height:1},dense:{width:6,height:2}}},metaData$1={icon:"icon-webpage-embed.svg"},webpage=Object.freeze(Object.defineProperty({__proto__:null,AIConfigPaneSkaffold:AIConfigPaneSkaffold$1,configPaneSkaffold:configPaneSkaffold$1,defaultConfig:defaultConfig$1,defaultDimensions:defaultDimensions$1,metaData:metaData$1},Symbol.toStringTag,{value:"Module"})),configPaneSkaffold=[],AIConfigPaneSkaffold=[],KEYS_FOR_OPTIONS={ogImage:"showOgImage",favicon:"showFavicon",url:"showURL",description:"showDescription"},defaultConfig={url:{id:"url",value:null,selectedId:null},metadata:{id:"metadata",value:null},options:{id:"options",value:{[KEYS_FOR_OPTIONS.ogImage]:!0,[KEYS_FOR_OPTIONS.favicon]:!0,[KEYS_FOR_OPTIONS.url]:!0,[KEYS_FOR_OPTIONS.description]:!0}},positionX:{id:"positionX",value:null},positionY:{id:"positionY",value:null},positionWidth:{id:"positionWidth",value:null},positionHeight:{id:"positionHeight",value:null},positionAngle:{id:"positionAngle",value:null}},defaultDimensions={desktop:{normal:{width:480,height:26},dense:{width:1600,height:180}},laptop:{normal:{width:6,height:2},dense:{width:12,height:4}},tablet:{normal:{width:3,height:1},dense:{width:6,height:2}},mobile:{normal:{width:3,height:1},dense:{width:6,height:2}}},metaData={icon:"icon-link.svg"},bookmark=Object.freeze(Object.defineProperty({__proto__:null,AIConfigPaneSkaffold,KEYS_FOR_OPTIONS,configPaneSkaffold,defaultConfig,defaultDimensions,metaData},Symbol.toStringTag,{value:"Module"})),componentConfigs={text:text$2,image:image$3,shape,collection,table:table$2,divider,webpage,bookmark};var r$6={grad:.9,turn:360,rad:360/(2*Math.PI)},t$5=function(Tr){return typeof Tr=="string"?Tr.length>0:typeof Tr=="number"},n$8=function(Tr,Cr,$r){return Cr===void 0&&(Cr=0),$r===void 0&&($r=Math.pow(10,Cr)),Math.round($r*Tr)/$r+0},e$5=function(Tr,Cr,$r){return Cr===void 0&&(Cr=0),$r===void 0&&($r=1),Tr>$r?$r:Tr>Cr?Tr:Cr},u$9=function(Tr){return(Tr=isFinite(Tr)?Tr%360:0)>0?Tr:Tr+360},a$7=function(Tr){return{r:e$5(Tr.r,0,255),g:e$5(Tr.g,0,255),b:e$5(Tr.b,0,255),a:e$5(Tr.a)}},o$5=function(Tr){return{r:n$8(Tr.r),g:n$8(Tr.g),b:n$8(Tr.b),a:n$8(Tr.a,3)}},i$7=/^#([0-9a-f]{3,8})$/i,s$4=function(Tr){var Cr=Tr.toString(16);return Cr.length<2?"0"+Cr:Cr},h$3=function(Tr){var Cr=Tr.r,$r=Tr.g,Ar=Tr.b,Rr=Tr.a,Dr=Math.max(Cr,$r,Ar),Mr=Dr-Math.min(Cr,$r,Ar),Br=Mr?Dr===Cr?($r-Ar)/Mr:Dr===$r?2+(Ar-Cr)/Mr:4+(Cr-$r)/Mr:0;return{h:60*(Br<0?Br+6:Br),s:Dr?Mr/Dr*100:0,v:Dr/255*100,a:Rr}},b$6=function(Tr){var Cr=Tr.h,$r=Tr.s,Ar=Tr.v,Rr=Tr.a;Cr=Cr/360*6,$r/=100,Ar/=100;var Dr=Math.floor(Cr),Mr=Ar*(1-$r),Br=Ar*(1-(Cr-Dr)*$r),Nr=Ar*(1-(1-Cr+Dr)*$r),Lr=Dr%6;return{r:255*[Ar,Br,Mr,Mr,Nr,Ar][Lr],g:255*[Nr,Ar,Ar,Br,Mr,Mr][Lr],b:255*[Mr,Mr,Nr,Ar,Ar,Br][Lr],a:Rr}},g$6=function(Tr){return{h:u$9(Tr.h),s:e$5(Tr.s,0,100),l:e$5(Tr.l,0,100),a:e$5(Tr.a)}},d$8=function(Tr){return{h:n$8(Tr.h),s:n$8(Tr.s),l:n$8(Tr.l),a:n$8(Tr.a,3)}},f$7=function(Tr){return b$6(($r=(Cr=Tr).s,{h:Cr.h,s:($r*=((Ar=Cr.l)<50?Ar:100-Ar)/100)>0?2*$r/(Ar+$r)*100:0,v:Ar+$r,a:Cr.a}));var Cr,$r,Ar},c$6=function(Tr){return{h:(Cr=h$3(Tr)).h,s:(Rr=(200-($r=Cr.s))*(Ar=Cr.v)/100)>0&&Rr<200?$r*Ar/100/(Rr<=100?Rr:200-Rr)*100:0,l:Rr/2,a:Cr.a};var Cr,$r,Ar,Rr},l$6=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p$7=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v$6=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m$7=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y$5={string:[[function(Tr){var Cr=i$7.exec(Tr);return Cr?(Tr=Cr[1]).length<=4?{r:parseInt(Tr[0]+Tr[0],16),g:parseInt(Tr[1]+Tr[1],16),b:parseInt(Tr[2]+Tr[2],16),a:Tr.length===4?n$8(parseInt(Tr[3]+Tr[3],16)/255,2):1}:Tr.length===6||Tr.length===8?{r:parseInt(Tr.substr(0,2),16),g:parseInt(Tr.substr(2,2),16),b:parseInt(Tr.substr(4,2),16),a:Tr.length===8?n$8(parseInt(Tr.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(Tr){var Cr=v$6.exec(Tr)||m$7.exec(Tr);return Cr?Cr[2]!==Cr[4]||Cr[4]!==Cr[6]?null:a$7({r:Number(Cr[1])/(Cr[2]?100/255:1),g:Number(Cr[3])/(Cr[4]?100/255:1),b:Number(Cr[5])/(Cr[6]?100/255:1),a:Cr[7]===void 0?1:Number(Cr[7])/(Cr[8]?100:1)}):null},"rgb"],[function(Tr){var Cr=l$6.exec(Tr)||p$7.exec(Tr);if(!Cr)return null;var $r,Ar,Rr=g$6({h:($r=Cr[1],Ar=Cr[2],Ar===void 0&&(Ar="deg"),Number($r)*(r$6[Ar]||1)),s:Number(Cr[3]),l:Number(Cr[4]),a:Cr[5]===void 0?1:Number(Cr[5])/(Cr[6]?100:1)});return f$7(Rr)},"hsl"]],object:[[function(Tr){var Cr=Tr.r,$r=Tr.g,Ar=Tr.b,Rr=Tr.a,Dr=Rr===void 0?1:Rr;return t$5(Cr)&&t$5($r)&&t$5(Ar)?a$7({r:Number(Cr),g:Number($r),b:Number(Ar),a:Number(Dr)}):null},"rgb"],[function(Tr){var Cr=Tr.h,$r=Tr.s,Ar=Tr.l,Rr=Tr.a,Dr=Rr===void 0?1:Rr;if(!t$5(Cr)||!t$5($r)||!t$5(Ar))return null;var Mr=g$6({h:Number(Cr),s:Number($r),l:Number(Ar),a:Number(Dr)});return f$7(Mr)},"hsl"],[function(Tr){var Cr=Tr.h,$r=Tr.s,Ar=Tr.v,Rr=Tr.a,Dr=Rr===void 0?1:Rr;if(!t$5(Cr)||!t$5($r)||!t$5(Ar))return null;var Mr=function(Br){return{h:u$9(Br.h),s:e$5(Br.s,0,100),v:e$5(Br.v,0,100),a:e$5(Br.a)}}({h:Number(Cr),s:Number($r),v:Number(Ar),a:Number(Dr)});return b$6(Mr)},"hsv"]]},N$3=function(Tr,Cr){for(var $r=0;$r=.5},Tr.prototype.toHex=function(){return Cr=o$5(this.rgba),$r=Cr.r,Ar=Cr.g,Rr=Cr.b,Mr=(Dr=Cr.a)<1?s$4(n$8(255*Dr)):"","#"+s$4($r)+s$4(Ar)+s$4(Rr)+Mr;var Cr,$r,Ar,Rr,Dr,Mr},Tr.prototype.toRgb=function(){return o$5(this.rgba)},Tr.prototype.toRgbString=function(){return Cr=o$5(this.rgba),$r=Cr.r,Ar=Cr.g,Rr=Cr.b,(Dr=Cr.a)<1?"rgba("+$r+", "+Ar+", "+Rr+", "+Dr+")":"rgb("+$r+", "+Ar+", "+Rr+")";var Cr,$r,Ar,Rr,Dr},Tr.prototype.toHsl=function(){return d$8(c$6(this.rgba))},Tr.prototype.toHslString=function(){return Cr=d$8(c$6(this.rgba)),$r=Cr.h,Ar=Cr.s,Rr=Cr.l,(Dr=Cr.a)<1?"hsla("+$r+", "+Ar+"%, "+Rr+"%, "+Dr+")":"hsl("+$r+", "+Ar+"%, "+Rr+"%)";var Cr,$r,Ar,Rr,Dr},Tr.prototype.toHsv=function(){return Cr=h$3(this.rgba),{h:n$8(Cr.h),s:n$8(Cr.s),v:n$8(Cr.v),a:n$8(Cr.a,3)};var Cr},Tr.prototype.invert=function(){return w$4({r:255-(Cr=this.rgba).r,g:255-Cr.g,b:255-Cr.b,a:Cr.a});var Cr},Tr.prototype.saturate=function(Cr){return Cr===void 0&&(Cr=.1),w$4(M$2(this.rgba,Cr))},Tr.prototype.desaturate=function(Cr){return Cr===void 0&&(Cr=.1),w$4(M$2(this.rgba,-Cr))},Tr.prototype.grayscale=function(){return w$4(M$2(this.rgba,-1))},Tr.prototype.lighten=function(Cr){return Cr===void 0&&(Cr=.1),w$4($$1(this.rgba,Cr))},Tr.prototype.darken=function(Cr){return Cr===void 0&&(Cr=.1),w$4($$1(this.rgba,-Cr))},Tr.prototype.rotate=function(Cr){return Cr===void 0&&(Cr=15),this.hue(this.hue()+Cr)},Tr.prototype.alpha=function(Cr){return typeof Cr=="number"?w$4({r:($r=this.rgba).r,g:$r.g,b:$r.b,a:Cr}):n$8(this.rgba.a,3);var $r},Tr.prototype.hue=function(Cr){var $r=c$6(this.rgba);return typeof Cr=="number"?w$4({h:Cr,s:$r.s,l:$r.l,a:$r.a}):n$8($r.h)},Tr.prototype.isEqual=function(Cr){return this.toHex()===w$4(Cr).toHex()},Tr}(),w$4=function(Tr){return Tr instanceof j$2?Tr:new j$2(Tr)};const palette={primary:{50:"hsl(201, 100%, 96%)",100:"hsl(200, 88%, 90%)",200:"hsl(200, 71%, 80%)",300:"hsl(200, 66%, 69%)",400:"hsl(200, 60%, 58%)",500:"hsl(200, 54%, 49%)",600:"hsl(200, 59%, 43%)",700:"hsl(200, 68%, 35%)",800:"hsl(200, 72%, 31%)",900:"hsl(200, 82%, 24%)"},accent1:{50:"hsl(125, 65%, 93%)",100:"hsl(126, 49%, 84%)",200:"hsl(122, 42%, 75%)",300:"hsl(123, 38%, 63%)",400:"hsl(123, 35%, 51%)",500:"hsl(122, 39%, 41%)",600:"hsl(122, 47%, 35%)",700:"hsl(125, 56%, 29%)",800:"hsl(125, 73%, 20%)",900:"hsl(125, 86%, 14%)"},accent2:{50:"hsl(262, 61%, 93%)",100:"hsl(261, 68%, 84%)",200:"hsl(261, 54%, 68%)",300:"hsl(261, 47%, 58%)",400:"hsl(262, 43%, 51%)",500:"hsl(262, 48%, 46%)",600:"hsl(262, 60%, 38%)",700:"hsl(262, 69%, 31%)",800:"hsl(262, 72%, 25%)",900:"hsl(263, 85%, 18%)"},accent3:{50:"hsl(360, 100%, 97%)",100:"hsl(360, 82%, 89%)",200:"hsl(360, 77%, 78%)",300:"hsl(360, 71%, 66%)",400:"hsl(360, 64%, 55%)",500:"hsl(360, 67%, 44%)",600:"hsl(360, 72%, 38%)",700:"hsl(360, 79%, 32%)",800:"hsl(360, 85%, 25%)",900:"hsl(360, 92%, 20%)"},accent4:{50:"hsl(45, 100%, 96%)",100:"hsl(45, 90%, 88%)",200:"hsl(45, 86%, 81%)",300:"hsl(43, 90%, 76%)",400:"hsl(43, 89%, 70%)",500:"hsl(42, 78%, 60%)",600:"hsl(42, 63%, 48%)",700:"hsl(43, 72%, 37%)",800:"hsl(43, 77%, 27%)",900:"hsl(43, 86%, 17%)"},neutral:{0:"hsl(216, 0%, 100%)",5:"hsl(216, 0%, 98%)",10:"hsl(216, 0%, 95%)",50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.08)",200:"rgba(0, 0, 0, 0.12)",250:"hsl(213, 16%, 75%)",300:"hsl(211, 13%, 65%)",400:"hsl(211, 10%, 53%)",500:"hsl(211, 12%, 43%)",600:"hsl(209, 14%, 37%)",700:"hsl(209, 18%, 30%)",800:"hsl(209, 20%, 25%)",900:"hsl(210, 24%, 16%)",1e3:"hsl(210, 24%, 0%)"},success:{},danger:{},warning:{},supporting:{}};palette.success={...palette.accent1};palette.danger={...palette.accent3};palette.warning={...palette.accent4};palette.supporting={...palette.accent2,700:"hsl(271, 81%, 40%)"};const paletteExtensions={subtitleText:palette.neutral[300],buttonBoxShadow:"rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 2px 4px",inputBoxShadow:"rgba(15, 15, 15, 0.1) 0px 0px 0px 1px inset",dangerBoxShadow:"hsla(360, 67%, 44%, 1) 0px 0px 0px 1px inset",popupBoxShadow:"rgba(30, 29, 30, 0.05) 0px 0px 0px 1px, rgba(30, 29, 30, 0.1) 0px 5px 10px, rgba(30, 29, 30, 0.2) 0px 15px 40px",modalBoxShadow:"rgba(30, 29, 30, 0.05) 0px 0px 0px 1px, rgba(30, 29, 30, 0.1) 0px 5px 10px, rgba(30, 29, 30, 0.2) 0px 15px 40px"},paletteRepresentation={id:"light1",name:"Palette 20"},light1={palette,paletteExtensions,paletteRepresentation},allThemes$1={light1},spacing$1={s1:"4px",s2:"8px",s3:"12px",s4:"16px",s5:"24px",s6:"32px",s7:"48px"},fontSize$1={f1:"0.5rem",f2:"0.625rem",f3:"0.75rem",f4:"0.875rem",f5:"1rem",f6:"1.25rem",f7:"1.5rem",f8:"2rem"},opacity$1={soft:.16,active:.24,tag:.25,tableCell:.08,hover:.16,chart:.3},colors$1={blue:"rgb(0, 112, 245)",orange:"rgb(245, 139, 0)",yellow:"rgb(245, 194, 0)",green:"rgb(30, 195, 55)",red:"rgb(255, 49, 38)",gray:"rgb(132, 132, 137)",purple:"rgb(159, 75, 201)",mint:"rgb(0, 189, 180)",teal:"rgb(46, 167, 189)",cyan:"rgb(65, 175, 220)",indigo:"rgb(84, 82, 204)",pink:"rgb(245, 35, 75)",brown:"rgb(152, 122, 84)",brandPurple:"hsl(267, 100%, 70%)",brandPurpleHover:"hsl(267, 100%, 61%)",brandPurpleActive:"hsl(267, 100%, 52%)",neutral:{800:"hsl(0, 7%, 16%)"}},deckPalettes$1={p1:["hsl(348, 29%, 40%)","hsl(317, 29%, 40%)","hsl(17, 29%, 40%)","hsl(137, 29%, 40%)","hsl(197, 29%, 40%)"],p2:["hsl(267, 35%, 20%)","hsl(40, 35%, 20%)","hsl(133, 35%, 20%)","hsl(220, 35%, 20%)","hsl(313, 35%, 20%)"],p3:["hsl(34, 57%, 93%)","hsl(169, 57%, 93%)","hsl(260, 57%, 93%)","hsl(349, 57%, 93%)","hsl(80, 57%, 93%)"],p4:["hsl(34, 57%, 93%)","hsl(29, 57%, 93%)","hsl(40, 57%, 93%)","hsl(23, 57%, 93%)","hsl(43, 57%, 93%)"],p5:["hsl(122, 24%, 27%)","hsl(47, 24%, 27%)","hsl(197, 24%, 27%)","hsl(330, 24%, 27%)","hsl(274, 24%, 27%)"],p6:["hsl(34, 56%, 26%)","hsl(17, 56%, 26%)","hsl(51, 56%, 26%)","hsl(0, 56%, 26%)","hsl(67, 56%, 26%)"]},doodle$1={background:"hsl(30, 75%, 97%)"},fontFamilies={default:{id:"default",label:"Bold",icon:"icon-font-bold.svg",value:"Switzer",fonts:{heading:"General Sans",body:"Switzer"},tooltip:"Impactful and approachable to make a strong statement and capture attention",fontWeight:{title:600,h1:600,h2:600,h3:600,h4:550,h5:400,p:400},boldFontWeight:{heading:650,body:650},letterSpacing:{title:-.56,h1:-.36,h2:-.28,h3:-.23,h5:.21,p:.26}},minimal:{id:"minimal",label:"Minimal",icon:"icon-font-minimal.svg",value:"Switzer",fonts:{heading:"Switzer",body:"Switzer"},tooltip:"Simple and modern for clean designs to create elegant simplicity",fontWeight:{title:550,h1:550,h2:550,h3:550,h4:550,h5:400,p:400},boldFontWeight:{heading:650,body:600},letterSpacing:{title:-.56,h1:-.36,h2:-.28,h3:-.23,h5:.21,p:.26}},modern:{id:"modern",label:"Modern",icon:"icon-font-modern.svg",value:"Switzer",fonts:{heading:"Newsreader",body:"Switzer"},tooltip:"Elegant in contrast, unified in design for web-forward publishing",fontWeight:{title:500,h1:500,h2:500,h3:500,h4:500,h5:400,p:400},boldFontWeight:{heading:600,body:600},letterSpacing:{h5:.21,p:.26}},classic:{id:"classic",label:"Classica",icon:"icon-font-classica.svg",value:"Newsreader",fonts:{heading:"Newsreader",body:"Newsreader"},tooltip:"Timeless and elegant serif style, perfect for traditional or formal contexts",fontWeight:{title:500,h1:500,h2:500,h3:500,h4:500,h5:400,p:400},boldFontWeight:{heading:600,body:600}},futuristic:{id:"futuristic",label:"Futuristic",icon:"icon-font-futuristic.svg",value:"Space Grotesk",fonts:{heading:"Space Grotesk",body:"Space Grotesk"},tooltip:"Geometric and tech-inspired looks, suited for tech and innovative industries",fontWeight:{title:500,h1:500,h2:500,h3:500,h4:500,h5:400,p:400},boldFontWeight:{heading:700,body:700},letterSpacing:{title:-1.12,h1:-.72,h2:-.56,h3:-.46,h4:-.15}}},fontSizeMap={richText:{mobile:{title:60,h1:38,h2:29,h3:24,h4:19,h5:14,p:16,ul:16,ol:16},desktop:{smallText:{title:56,h1:36,h2:28,h3:23,h4:15,h5:10.5,p:13,ul:13,ol:13},regular:{title:75,h1:48,h2:37,h3:30,h4:20,h5:14,p:17,ul:17,ol:17}}},tables:{}},textMarginMap={richText:{mobile:{title:28,h1:24,h2:22,h3:18,h4:10,h5:6,p:8,ul:8,ol:8},desktop:{smallText:{title:28,h1:24,h2:22,h3:18,h4:10,h5:6,p:8,ul:8,ol:8},regular:{title:37,h1:32,h2:29,h3:24,h4:13,h5:8,p:10,ul:10,ol:10}}},tables:{}},cornerRadius={block:{small:9,default:12,mobile:9},element:{small:6,default:8,mobile:6},textIcon:{normal:{small:4.5,default:6,mobile:4.5},xs:{small:3,default:4,mobile:3}},table:{cell:{small:3,default:4,mobile:3}}},padding={block:{text:{bg:{small:12,default:16,mobile:12},noBg:{small:12,default:16,mobile:0}}},table:{cell:{vertical:{small:9,default:12,mobile:9},horizontal:{small:12,default:16,mobile:12}}}},OVERRIDE_DEFAULT_TOOLTIP_PROPS={delay:{show:150,hide:20}},alignmentButtons={text:[{id:"left",icon:"align-left",tooltip:"Left align"},{id:"center",icon:"align-center",tooltip:"Center align"},{id:"right",icon:"align-right",tooltip:"Right align"}],vertical:[{id:"top",icon:"align-top",tooltip:"Top align"},{id:"center",icon:"align-middle",tooltip:"Center align"},{id:"bottom",icon:"align-bottom",tooltip:"Bottom align"}]},buttonsForWebpageEmbed={main:[{id:"refresh",icon:"refresh-2",iconProp:"nestedFill",tooltip:"Refresh"},{id:"link",icon:"link",iconProp:"stroke",tooltip:"Link"}]};var Nf;const IS_MAC_OS=IS_CLIENT?((Nf=navigator==null?void 0:navigator.userAgent)==null?void 0:Nf.indexOf("Mac"))>=0:!1,META_KEY_MODIFIER=IS_MAC_OS?"⌘":"Ctrl",OPTION_KEY_MODIFIER=IS_MAC_OS?"⌥":"Alt",textButtons=[{id:"bold",icon:"format-bold",tooltip:{msg:"Bold",shortcut:`${META_KEY_MODIFIER}+B`}},{id:"italic",icon:"format-italic",tooltip:{msg:"Italicize",shortcut:`${META_KEY_MODIFIER}+I`}},{id:"strike",icon:"format-strike",tooltip:{msg:"Strike-through"}},{id:"link",icon:"link",tooltip:{msg:"Add link"}}],WORD_MAP={deck:{upper:"Prezo",lower:"prezo",pluralUpper:"Prezos",pluralLower:"prezos"},slide:{upper:"Page",lower:"page",pluralUpper:"Pages",pluralLower:"pages"}},ANIMATIONS={leftPane:{duration:100,enabled:!0}},design={WORD_MAP,ANIMATIONS,textButtons,alignmentButtons,OVERRIDE_DEFAULT_TOOLTIP_PROPS,allThemes:allThemes$1,spacing:spacing$1,fontSize:fontSize$1,opacity:opacity$1,colors:colors$1,deckPalettes:deckPalettes$1,doodle:doodle$1,fontFamilies,fontSizeMap,textMarginMap,cornerRadius,padding};async function initAppStore(){return __vitePreload(()=>Promise.resolve().then(()=>appStore),void 0,import.meta.url).then(Tr=>Tr.useAppStore)}const{allThemes,spacing,fontSize,opacity,colors,deckPalettes,doodle}=design,borderRadius={small:"2px",medium:"4px",large:"8px",extraLarge:"16px",giant:"32px"},state$6=reactive({themeName:"light1",themeList:Object.keys(allThemes).map(Tr=>allThemes[Tr].paletteRepresentation),deckThemeList:[{id:"light",background:"hsl(0, 0%, 100%)",color:"hsl(0, 0%, 0%)"},{id:"dark",background:"hsl(0, 0%, 9%)",color:"hsl(34, 53%, 91%)"}],deckThemeDetails:{red:{id:"red",label:"Red",value:"#F54B54",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#F54B54"},block:{bright:{background:"#F54B54",color:"#FFFFFF",lightUp:"#550707"},main:{background:"#FFEFF0",color:"#550707",lightUp:"#F54B54"},grey:{background:"#F9F9F9",color:"#0D0C0C",lightUp:"#F54B54"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#F54B54"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#F54B54",color:"#FFFFFF"},link:{color:"#FFFFFF"},block:{bright:{background:"#FFFFFF",color:"#550707",lightUp:"#550707"},main:{background:"#FFC0C4",color:"#550707",lightUp:"#550707"},grey:{background:"#E7353E",color:"#FFFFFF",lightUp:"#FFFFFF"},none:{background:"#F54B54",color:"#FFFFFF",lightUp:"#FFFFFF"}},table:{color:"#FFFFFF",defaultCellBackground:"#E7353E",headerCellBackground:"#DA2F38"}}},orange:{id:"orange",label:"Orange",value:"#FF8743",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#FF8743"},block:{bright:{background:"#FF8743",color:"#FFFFFF",lightUp:"#552307"},main:{background:"#FFEFE7",color:"#552307",lightUp:"#FF8743"},grey:{background:"#F9F9F9",color:"#0D0C0C",lightUp:"#FF8743"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#FF8743"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#FF8743",color:"#FFFFFF"},link:{color:"#FFFFFF"},block:{bright:{background:"#FFFFFF",color:"#552307",lightUp:"#552307"},main:{background:"#FFD5AC",color:"#552307",lightUp:"#552307"},grey:{background:"#F17833",color:"#FFFFFF",lightUp:"#FFFFFF"},none:{background:"#FF8743",color:"#FFFFFF",lightUp:"#FFFFFF"}},table:{color:"#FFFFFF",defaultCellBackground:"#F17833",headerCellBackground:"#E5661F"}}},yellow:{id:"yellow",label:"Yellow",value:"#FFCB44",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#C18B00"},block:{bright:{background:"#FFCB44",color:"#553107",lightUp:"#553107"},main:{background:"#FFF5DA",color:"#553107",lightUp:"#FFCB44"},grey:{background:"#F9F9F9",color:"#0D0C0C",lightUp:"#FFCB44"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#FFCB44"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#FFCB44",color:"#553107"},link:{color:"#553107"},block:{bright:{background:"#FFFFFF",color:"#553107",lightUp:"#553107"},main:{background:"#FFF3B2",color:"#553107",lightUp:"#553107"},grey:{background:"#FFD977",color:"#553107",lightUp:"#553107"},none:{background:"#FFCB44",color:"#553107",lightUp:"#553107"}},table:{color:"#553107",defaultCellBackground:"#FFD977",headerCellBackground:"#FFE39A"}}},green:{id:"green",label:"Green",value:"#69C567",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#69C567"},block:{bright:{background:"#69C567",color:"#FFFFFF",lightUp:"#053904"},main:{background:"#EEFAE8",color:"#053904",lightUp:"#69C567"},grey:{background:"#F9F9F9",color:"#0D0C0C",lightUp:"#69C567"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#69C567"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#69C567",color:"#FFFFFF"},link:{color:"#FFFFFF"},block:{bright:{background:"#FFFFFF",color:"#053904",lightUp:"#053904"},main:{background:"#BEEAA8",color:"#053904",lightUp:"#053904"},grey:{background:"#5CB75A",color:"#FFFFFF",lightUp:"#FFFFFF"},none:{background:"#69C567",color:"#FFFFFF",lightUp:"#FFFFFF"}},table:{color:"#FFFFFF",defaultCellBackground:"#5CB75A",headerCellBackground:"#4CA94A"}}},blue:{id:"blue",label:"Blue",value:"#2EA5FB",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#2EA5FB"},block:{bright:{background:"#2EA5FB",color:"#FFFFFF",lightUp:"#071855"},main:{background:"#E7F2FF",color:"#071855",lightUp:"#2EA5FB"},grey:{background:"#F9F9F9",color:"#0D0C0C",lightUp:"#2EA5FB"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#2EA5FB"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#2EA5FB",color:"#FFFFFF"},link:{color:"#FFFFFF"},block:{bright:{background:"#FFFFFF",color:"#071855",lightUp:"#071855"},main:{background:"#BFDDFF",color:"#071855",lightUp:"#071855"},grey:{background:"#2197ED",color:"#FFFFFF",lightUp:"#FFFFFF"},none:{background:"#2EA5FB",color:"#FFFFFF",lightUp:"#FFFFFF"}},table:{color:"#FFFFFF",defaultCellBackground:"#2197ED",headerCellBackground:"#138BE2"}}},navy:{id:"navy",label:"Navy",value:"#2D42B1",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#2D42B1"},block:{bright:{background:"#2D42B1",color:"#FFFFFF",lightUp:"#071855"},main:{background:"#EAEEFF",color:"#071855",lightUp:"#2D42B1"},grey:{background:"#F9F9F9",color:"#0D0C0C",lightUp:"#2D42B1"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#2D42B1"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#2D42B1",color:"#FFFFFF"},link:{color:"#FFFFFF"},block:{bright:{background:"#FFFFFF",color:"#071855",lightUp:"#071855"},main:{background:"#B1BCE9",color:"#071855",lightUp:"#FFFFFF"},grey:{background:"#2036A6",color:"#FFFFFF",lightUp:"#FFFFFF"},none:{background:"#2D42B1",color:"#FFFFFF",lightUp:"#FFFFFF"}},table:{color:"#FFFFFF",defaultCellBackground:"#2036A6",headerCellBackground:"#172C97"}}},purple:{id:"purple",label:"Purple",value:"#AB67FF",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#AB67FF"},block:{bright:{background:"#AB67FF",color:"#FFFFFF",lightUp:"#2E0755"},main:{background:"#F3E9FF",color:"#2E0755",lightUp:"#AB67FF"},grey:{background:"#F9F9F9",color:"#0D0C0C",lightUp:"#AB67FF"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#AB67FF"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#AB67FF",color:"#FFFFFF"},link:{color:"#FFFFFF"},block:{bright:{background:"#FFFFFF",color:"#2E0755",lightUp:"#2E0755"},main:{background:"#E8D7FF",color:"#2E0755",lightUp:"#2E0755"},grey:{background:"#9C56F1",color:"#FFFFFF",lightUp:"#FFFFFF"},none:{background:"#AB67FF",color:"#FFFFFF",lightUp:"#FFFFFF"}},table:{color:"#FFFFFF",defaultCellBackground:"#9C56F1",headerCellBackground:"#8F48E7"}}},pink:{id:"pink",label:"Pink",value:"#FF7EBC",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#FF7EBC"},block:{bright:{background:"#FF7EBC",color:"#FFFFFF",lightUp:"#550723"},main:{background:"#FFF1F8",color:"#550723",lightUp:"#FF7EBC"},grey:{background:"#F9F9F9",color:"#0D0C0C",lightUp:"#FF7EBC"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#FF7EBC"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#FF7EBC",color:"#FFFFFF"},link:{color:"#FFFFFF"},block:{bright:{background:"#FFFFFF",color:"#550723",lightUp:"#550723"},main:{background:"#FFDEEF",color:"#550723",lightUp:"#550723"},grey:{background:"#F569AD",color:"#FFFFFF",lightUp:"#FFFFFF"},none:{background:"#FF7EBC",color:"#FFFFFF",lightUp:"#FFFFFF"}},table:{color:"#FFFFFF",defaultCellBackground:"#F569AD",headerCellBackground:"#EF5AA1"}}},brown:{id:"brown",label:"Brown",value:"#7A4F27",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#7A4F27"},block:{bright:{background:"#7A4F27",color:"#FFFFFF",lightUp:"#422504"},main:{background:"#F8F3EF",color:"#553107",lightUp:"#7A4F27"},grey:{background:"#F9F9F9",color:"#0D0C0C",lightUp:"#7A4F27"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#7A4F27"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#7A4F27",color:"#FFFFFF"},link:{color:"#FFFFFF"},block:{bright:{background:"#FFFFFF",color:"#553107",lightUp:"#422504"},main:{background:"#E0D3C9",color:"#553107",lightUp:"#FFFFFF"},grey:{background:"#70461F",color:"#FFFFFF",lightUp:"#FFFFFF"},none:{background:"#7A4F27",color:"#FFFFFF",lightUp:"#FFFFFF"}},table:{color:"#FFFFFF",defaultCellBackground:"#70461F",headerCellBackground:"#623A16"}}},black:{id:"black",label:"Black & White",value:"#0D0C0C",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#0D0C0C"},block:{bright:{background:"#0D0C0C",color:"#FFFFFF",lightUp:"#7B7B7B"},main:{background:"#F3F3F3",color:"#0D0C0C",lightUp:"#0D0C0C"},grey:{background:"#F9F9F9",color:"#0D0C0C",lightUp:"#0D0C0C"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#0D0C0C"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#0D0C0C",color:"#FFFFFF"},link:{color:"#FFFFFF"},block:{bright:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#7B7B7B"},main:{background:"#312E2E",color:"#FFFFFF",lightUp:"#FFFFFF"},grey:{background:"#1F1C1C",color:"#FFFFFF",lightUp:"#FFFFFF"},none:{background:"#0D0C0C",color:"#FFFFFF",lightUp:"#FFFFFF"}},table:{color:"#FFFFFF",defaultCellBackground:"#1F1C1C",headerCellBackground:"#312E2E"}}},crisp:{id:"crisp",label:"Crisp",value:"#585CEB",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#585CEB"},block:{bright:{background:"#585CEB",color:"#FFFFFF",lightUp:"#0C0F7C"},main:{background:"#EEEEFF",color:"#0C0F7C",lightUp:"#585CEB"},grey:{background:"#F9F9F9",color:"#0D0C0C",lightUp:"#585CEB"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#585CEB"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#585CEB",color:"#FFFFFF"},link:{color:"#FFFFFF"},block:{bright:{background:"#FFFFFF",color:"#0C0F7C",lightUp:"#0C0F7C"},main:{background:"#D9DAFF",color:"#0C0F7C",lightUp:"#0C0F7C"},grey:{background:"#454ADB",color:"#FFFFFF",lightUp:"#FFFFFF"},none:{background:"#585CEB",color:"#FFFFFF",lightUp:"#FFFFFF"}},table:{color:"#FFFFFF",defaultCellBackground:"#454ADB",headerCellBackground:"#3439C8"}}},emilFrey:{id:"emilFrey",label:"Emil Frey",value:"#000E3D",regular:{artboard:{background:"#FFFFFF",color:"#0D0C0C"},link:{color:"#000E3D"},block:{bright:{background:"#000E3D",color:"#FFFFFF",lightUp:"#071855"},main:{background:"#DBE1F4",color:"#071855",lightUp:"#000E3D"},grey:{background:"#ECEFF4",color:"#0D0C0C",lightUp:"#000E3D"},none:{background:"#FFFFFF",color:"#0D0C0C",lightUp:"#000E3D"},brand:{background:"#0033A1",color:"#FFFFFF",lightUp:"#071855"}},table:{color:"#0D0C0C",defaultCellBackground:"#F9F9F9",headerCellBackground:"#F1F1F1"}},divider:{artboard:{background:"#000E3D",color:"#FFFFFF"},link:{color:"#FFFFFF"},block:{bright:{background:"#FFFFFF",color:"#071855",lightUp:"#071855"},main:{background:"#D2D9F0",color:"#071855",lightUp:"#FFFFFF"},grey:{background:"#14214C",color:"#FFFFFF",lightUp:"#FFFFFF"},none:{background:"#000E3D",color:"#FFFFFF",lightUp:"#FFFFFF"},brand:{background:"#003899",color:"#FFFFFF",lightUp:"#071855"}},table:{color:"#FFFFFF",defaultCellBackground:"#2036A6",headerCellBackground:"#172C97"}}}},softOpacity:.16}),highlightColors=[{id:"red",name:"Red",color:"#FFC8CB",textColor:"#550723"},{id:"yellow",name:"Yellow",color:"#FFE7AB",textColor:"#553107"},{id:"green",name:"Green",color:"#C5EBA7",textColor:"#053904"},{id:"blue",name:"Blue",color:"#B0E3FF",textColor:"#071855"},{id:"purple",name:"Purple",color:"#E6C7FF",textColor:"#2E0755"}],tableColors=[{id:"red",name:"Red",onDividerSlide:{color:"#FFC8CB",textColor:"#B82028"},onRegSlide:{color:"#FFDADC",textColor:"#B82028"}},{id:"yellow",name:"Yellow",onDividerSlide:{color:"#FFE7AB",textColor:"#A7580F"},onRegSlide:{color:"#FFEEC1",textColor:"#A7580F"}},{id:"green",name:"Green",onDividerSlide:{color:"#C5EBA7",textColor:"#1A8418"},onRegSlide:{color:"#D5F5BB",textColor:"#1A8418"}},{id:"blue",name:"Blue",onDividerSlide:{color:"#B0E3FF",textColor:"#005FA4"},onRegSlide:{color:"#C7EBFF",textColor:"#005FA4"}},{id:"purple",name:"Purple",onDividerSlide:{color:"#E6C7FF",textColor:"#692DB2"},onRegSlide:{color:"#EDD8FF",textColor:"#692DB2"}}],TABLE_DEFAULT_GREY="#F3F3F3",TABLE_DEFAULT_GREY_TEXT="#0D0C0C",textOpacities=[{id:"default",name:"Default"},{id:"grey",name:"Grey text"}],blockColorTypesFull=[{id:"none",name:"No color"},{id:"brand",name:"Brand"},{id:"grey",name:"Shade"},{id:"main",name:"Pale"},{id:"bright",name:"Bright"}],bookmarkColorOptions=[{id:"none",name:"No background"},{id:"outline",name:"Outline"},{id:"brand",name:"Brand"},{id:"grey",name:"Shade"},{id:"main",name:"Pale"},{id:"bright",name:"Bright"}],blockColorTypes=[...blockColorTypesFull,...bookmarkColorOptions].map(Tr=>Tr.id),getBackgroundFromDeckThemeId=async(Tr,Cr)=>{var $r;return Tr==="custom"?initAppStore().then(Ar=>{var Mr,Br,Nr;const Dr=(Br=(Mr=Ar().config(Cr))==null?void 0:Mr.deckTheme)==null?void 0:Br.value;return Dr?Dr.background:((Nr=state$6.deckThemeList.filter(Lr=>Lr.id===Tr)[0])==null?void 0:Nr.background)??state$6.deckThemeList[0].background}):(($r=state$6.deckThemeList.filter(Ar=>Ar.id===Tr)[0])==null?void 0:$r.background)??state$6.deckThemeList[0].background},getThemeObjectForDeckAndSlide=({deckTheme:Tr,slideType:Cr})=>(state$6.deckThemeDetails[Tr]??state$6.deckThemeDetails.purple)[Cr]??state$6.deckThemeDetails.purple.regular,doesThemeHaveBrandColor=Tr=>{var $r,Ar;const Cr=state$6.deckThemeDetails[Tr];return((Ar=($r=Cr==null?void 0:Cr.regular)==null?void 0:$r.block)==null?void 0:Ar.brand)!=null},initializeTheme=()=>{{state$6.themeName="light1";return}},changeTheme=Tr=>{const Cr=state$6.deckThemeList.length;for(let $r=0;$r{const{palette:Tr,paletteExtensions:Cr}=allThemes[state$6.themeName]??allThemes.light1;return readonly({...Cr,colors,spacing,borderRadius,fontSize,opacity,palette:Tr,deckPalettes,doodle,name:state$6.themeName})};function getColorFromDict(Tr){const{type:Cr,level:$r,color:Ar}=Tr;return Ar||(Cr==null||$r==null?null:appTheme$3().palette[Cr][$r])}function isDarkColor({color:Tr,type:Cr,level:$r}){const Ar=Tr??getColorFromDict({type:Cr,level:$r});return Ar==null?!1:w$4(Ar).isDark()}function isWhiteColor({color:Tr}){return w$4(Tr).toHex()==="#ffffff"}const IS_COLOR_SWITCHING_ENABLED=isEnabled("dynamicColorSwitching");function dropZoneMarker(Tr){return Tr?"rgba(255, 255, 255, 0.32)":"rgba(0, 0, 0, 0.24)"}function backgroundToUseNeutral(Tr){return Tr&&IS_COLOR_SWITCHING_ENABLED?appTheme$3().palette.neutral[900]:appTheme$3().palette.neutral[0]}function backgroundToUseCustom(Tr,Cr){return IS_COLOR_SWITCHING_ENABLED?getColorFromDict(Cr)??backgroundToUseNeutral(Tr):state$6.deckThemeList[0].background}function activeBackgroundToUse(Tr){return Tr&&IS_COLOR_SWITCHING_ENABLED?appTheme$3().palette.neutral[700]:appTheme$3().palette.neutral[100]}function hoverBackgroundToUse(Tr){return Tr&&IS_COLOR_SWITCHING_ENABLED?appTheme$3().palette.neutral[800]:appTheme$3().palette.neutral[50]}function selectedBackgroundToUse(Tr){return Tr&&IS_COLOR_SWITCHING_ENABLED?appTheme$3().palette.neutral[300]:appTheme$3().palette.neutral[600]}function secondaryBackgroundToUse(Tr){return Tr&&IS_COLOR_SWITCHING_ENABLED?appTheme$3().palette.neutral[700]:appTheme$3().palette.neutral[100]}function secondaryHoverBackgroundToUse(Tr){return Tr&&IS_COLOR_SWITCHING_ENABLED?appTheme$3().palette.neutral[600]:appTheme$3().palette.neutral[200]}function secondaryActiveBackgroundToUse(Tr){return Tr&&IS_COLOR_SWITCHING_ENABLED?appTheme$3().palette.neutral[500]:appTheme$3().palette.neutral[250]}function textBackgroundToUse(Tr){return Tr&&IS_COLOR_SWITCHING_ENABLED?appTheme$3().palette.neutral[800]:appTheme$3().palette.neutral[50]}function colorToUse(Tr){return Tr&&IS_COLOR_SWITCHING_ENABLED?appTheme$3().palette.neutral[100]:appTheme$3().colors.neutral[800]}function softColorToUse(Tr){return Tr&&IS_COLOR_SWITCHING_ENABLED?appTheme$3().palette.neutral[600]:appTheme$3().palette.neutral[300]}function borderToUseNeutral(Tr){return Tr&&IS_COLOR_SWITCHING_ENABLED?"rgba(228, 231, 235, 0.32)":"rgba(0, 0, 0, 0.08)"}function rgbWithOpacity(Tr,Cr){return Tr.includes("rgb")?Tr.replace(")",`, ${Cr})`).replace("rgb","rgba"):Tr.includes("hsl")?Tr.replace(")",`, ${Cr})`).replace("hsl","hsla"):Tr}function getSofterColor(Tr,Cr=.04){var Rr,Dr,Mr,Br,Nr,Lr,Hr,zr,Ur,Vr,jr,Gr;if(Tr===state$6.deckThemeDetails.black.value&&Cr===.04)return"rgb(29, 29, 29)";if(Tr===((Mr=(Dr=(Rr=state$6.deckThemeDetails.blue)==null?void 0:Rr.divider)==null?void 0:Dr.table)==null?void 0:Mr.defaultCellBackground))return"#1F8DDD";if(Tr===((Lr=(Nr=(Br=state$6.deckThemeDetails.blue)==null?void 0:Br.divider)==null?void 0:Nr.table)==null?void 0:Lr.headerCellBackground))return"#1282D3";if(Tr===((Ur=(zr=(Hr=state$6.deckThemeDetails.purple)==null?void 0:Hr.divider)==null?void 0:zr.table)==null?void 0:Ur.defaultCellBackground))return"#9050DE";if(Tr===((Gr=(jr=(Vr=state$6.deckThemeDetails.purple)==null?void 0:Vr.divider)==null?void 0:jr.table)==null?void 0:Gr.headerCellBackground))return"#8443D5";const Ar=w$4(Tr);return Ar.isDark()?Ar.lighten(Cr).toHslString():Ar.darken(Cr).toHslString()}function darken(Tr,Cr=.04){return w$4(Tr).darken(Cr).toHex()}function addOpacityToColor(Tr,Cr){return w$4(Tr).alpha(Cr).toHex()}const theme={state:state$6,appTheme:appTheme$3,initializeTheme,changeTheme,getBackgroundFromDeckThemeId,getColorFromDict,isDarkColor,rgbWithOpacity,appColors:{backgroundToUseNeutral,backgroundToUseCustom,activeBackgroundToUse,hoverBackgroundToUse,selectedBackgroundToUse,secondaryBackgroundToUse,secondaryHoverBackgroundToUse,secondaryActiveBackgroundToUse,textBackgroundToUse,colorToUse,softColorToUse,borderToUseNeutral,IS_COLOR_SWITCHING_ENABLED,dropZoneMarker},getSofterColor,getThemeObjectForDeckAndSlide,isWhiteColor,addOpacityToColor,highlightColors,tableColors,TABLE_DEFAULT_GREY,TABLE_DEFAULT_GREY_TEXT,textOpacities,darken,blockColorTypes,blockColorTypesFull,bookmarkColorOptions,doesThemeHaveBrandColor};theme.appTheme();const getColorConfig$3=()=>[{id:"hsla(0, 0%, 100%, 1)",name:"White",type:"light"},{id:"hsla(34, 53%, 91%, 1)",name:"color2",type:"light"},{id:"hsla(354, 100%, 98%, 1)",name:"color3",type:"light"},{id:"hsla(342, 100%, 98%, 1)",name:"color4",type:"light"},{id:"hsla(40, 100%, 96%, 1)",name:"color5",type:"light"},{id:"hsla(356, 100%, 97%, 1)",name:"color6",type:"light"},{id:"hsla(264, 100%, 98%, 1)",name:"color7",type:"light"},{id:"hsla(0, 0%, 0%, 1)",name:"color8",type:"dark"},{id:"hsla(0, 0%, 9%, 1)",name:"color9",type:"dark"},{id:"hsla(230, 46%, 34%, 1)",name:"color10",type:"dark"},{id:"hsla(241, 24%, 39%, 1)",name:"color11",type:"dark"},{id:"hsla(0, 17%, 43%, 1)",name:"color12",type:"dark"},{id:"hsla(350, 46%, 34%, 1)",name:"color13",type:"dark"},{id:"hsla(261, 46%, 34%, 1)",name:"color14",type:"dark"}],addSpacesToIconName=Tr=>Tr.replace(/([A-Z])/g," $1").replace(/^./,Cr=>Cr.toUpperCase()),getIconRepresentationFromId=Tr=>addSpacesToIconName(Tr).slice(0,-4),getEmojiRepresentationFromId=Tr=>{var Cr;return((Cr=allEmojiObjects.filter($r=>$r.id===Tr)[0])==null?void 0:Cr.name)??""},getEmojiValueFromId=Tr=>allEmojis[Tr],state$5=reactive({options:{colors:getColorConfig$3(),background:getColorConfig$3(),color:getColorConfig$3(),borderColor:getColorConfig$3(),icons:allIconObjects,emojis:allEmojiObjects,borderRadius:[{id:"friendly",label:"Friendly",value:"4px"},{id:"playful",label:"Playful",value:"8px"},{id:"bubble",label:"Bubble",value:"16px"}],appearance:[{id:"full",label:"Full",name:"Full",value:"full"},{id:"card",label:"Card",name:"Card",value:"card"},{id:"avatar",label:"Avatar",name:"Avatar",value:"avatar"}],textPosition:[{id:"below",label:"Below",name:"Below",value:"below"},{id:"overlay",label:"Overlay",name:"Overlay",value:"overlay"}],padding:[{id:"none",label:"None",name:"None",value:"0px"},{id:"standard",label:"Standard",name:"Standard",value:"8px"},{id:"loose",label:"Loose",name:"Loose",value:"16px"}],cardSize:[{id:"full",label:"Full Size",name:"Full Size",value:"full"},{id:"half",label:"Half Size",name:"Half Size",value:"half"}],orientation:[{id:"vertical",label:"Vertical",name:"Vertical",value:"vertical",icon:"icon-vertical.svg"},{id:"horizontal",label:"Horizontal",name:"Horizontal",value:"horizontal",icon:"icon-horizontal.svg"}],textAlignment:[{id:"left",label:"Align left",name:"Left",value:"left",icon:"icon-text-align-left.svg"},{id:"center",label:"Align center",name:"Center",value:"center",icon:"icon-text-align-center.svg"},{id:"right",label:"Align right",name:"Right",value:"right",icon:"icon-text-align-right.svg"}],verticalAlignment:[{id:"top",label:"Align top",name:"Top",value:"top",icon:"icon-align-top.svg"},{id:"center",label:"Align center",name:"Center",value:"center",icon:"icon-align-center.svg"},{id:"bottom",label:"Align bottom",name:"Bottom",value:"bottom",icon:"icon-align-bottom.svg"}],aspectRatio:[{id:"1",label:"Square (1:1)",name:"Square (1:1)",value:1},{id:"2",label:"Wide (2:1)",name:"Wide (2:1)",value:2},{id:"3",label:"Extra Wide (3:1)",name:"Extra Wide (3:1)",value:3},{id:"4",label:"Narrow (1:2)",name:"Narrow (1:2)",value:.5}],overlayButton:[{id:null,label:"-",name:"-",value:null},{id:"HeartIcon",label:"Favourite",name:"Favourite",value:"HeartIcon"}],scroll:[{id:"page",label:"Default",name:"Default",value:"page"},{id:"container",label:"Container",name:"Container",value:"container"}],buttonStates:[{id:"filled",label:"Filled",value:"solid"},{id:"bordered",label:"Bordered",value:"outline"},{id:"clear",label:"Clear",value:"clear"}],actions:[{id:null,name:"--",icon:"icon-zap.svg"},{id:"regular_confetti",name:"🎊 Confetti",icon:"icon-zap.svg"},{id:"fireworks_confetti",name:"🎊 Fireworks",icon:"icon-zap.svg"}],tableViewSwitcher:[{id:"list",name:"List",label:"List",icon:"icon-list.svg",value:"list"},{id:"card",name:"Cards",label:"Cards",icon:"icon-card.svg",value:"card"},{id:"tile",name:"Tiles",label:"Tiles",icon:"icon-grid.svg",value:"tile"},{id:"checkbox",name:"Checklist",label:"Checklist",icon:"icon-check-list.svg",value:"checkbox"}],textType:[{id:"coverTitle",name:"Cover",label:"Cover",icon:"icon-text-cover.svg",value:"coverTitle"},{id:"title",name:"Title",label:"Title",icon:"icon-text-title.svg",value:"title"},{id:"heading",name:"Heading",label:"Heading",icon:"icon-text-heading.svg",value:"heading"},{id:"smallHeading",name:"Subheading",label:"Subheading",icon:"icon-text-subheading.svg",value:"smallHeading"},{id:"subtitle",name:"Body",label:"Body",icon:"icon-text-body.svg",value:"subtitle"},{id:"caption",name:"Caption",label:"Caption",icon:"icon-text-caption.svg",value:"caption"}],shapeType:[{id:"rectangle",name:"Rectangle",label:"Rectangle",icon:"icon-shape-rectangle.svg",value:"rectangle"},{id:"ellipse",name:"Ellipse",label:"Ellipse",icon:"icon-shape-ellipse.svg",value:"ellipse"},{id:"polygon",name:"Polygon",label:"Polygon",icon:"icon-shape-rectangle.svg",value:"polygon"}],imageType:[{id:"normal",name:"Normal",label:"Normal",icon:"icon-image.svg",value:"normal"},{id:"rounded",name:"Rounded",label:"Rouded",icon:"icon-image.svg",value:"rounded"},{id:"playful",name:"Playful",label:"Playful",icon:"icon-image.svg",value:"playful"},{id:"avatar",name:"Avatar",label:"avatar",icon:"icon-image.svg",value:"avatar"}],objectFit:[{id:"cover",name:"Cover",label:"Cover",icon:"icon-image.svg",value:"cover"},{id:"fill",name:"Stretch",label:"Stretch",icon:"icon-image.svg",value:"fill"},{id:"contain",name:"Contain",label:"Contain",icon:"icon-image.svg",value:"contain"},{id:"reposition",name:"Reposition",label:"Reposition",icon:"icon-image.svg",value:"reposition"}],flipHorizontal:[{id:"flip",name:"Flip",label:"Flip horizontal",icon:"icon-flip-horizontal.svg",value:!0}],flipVertical:[{id:"flip",name:"Flip",label:"Flip vertical",icon:"icon-flip-vertical.svg",value:!0}],rotateAngle:[{id:"cw",name:"Rotate Clockwise",label:"Rotate clockwise",icon:"icon-rotate-image.svg",value:"cw"}],moveForward:[{id:"moveForward",name:"Move to top",label:"Move to top",icon:"icon-move-forward.svg",value:!0}],moveBackward:[{id:"moveBackward",name:"Move to bottom",label:"Move to bottom",icon:"icon-move-backward.svg",value:!0}],moveUp:[{id:"moveUp",name:"Move up",label:"Move up",icon:"icon-move-up.svg",value:!0}],moveDown:[{id:"moveDown",name:"Move down",label:"Move down",icon:"icon-move-down.svg",value:!0}],collectionType:[{id:"row",name:"Row",label:"Row",icon:"icon-component-grid.svg",value:"row"},{id:"column",name:"Column",label:"Column",icon:"icon-component-grid.svg",value:"column"}],tone:[{id:"friendly",name:"Friendly",label:"Friendly",value:"friendly"},{id:"professional",name:"Professional",label:"Professional",value:"professional"},{id:"witty",name:"Witty",label:"Witty",value:"witty"},{id:"persuasive",name:"Persuasive",label:"Persuaive",value:"persuasive"}],contentLength:[{id:"short",name:"Short & sweet",label:"Short & sweet",value:"short"},{id:"normal",name:"A little longer",label:"A little longer",value:"of normal length"},{id:"detailed",name:"Detailed",label:"Detailed",value:"detailed"}],theme:[...componentConfigs.image.IMAGE_THEMES],imageDimensions:[{id:"512x512",name:"512 X 512",label:"icon-28x28-ratio.svg",value:"512x512"},{id:"960x768",name:"960 X 768",label:"icon-32x28-ratio.svg",value:"960x768"},{id:"768x960",name:"768 X 960",label:"icon-25x24-ratio.svg",value:"768x960"}],borderPosition:[{id:"inside",name:"Inside",label:"Inside",value:"inside"},{id:"outside",name:"Outside",label:"Outside",value:"outside"}],fontSize:[{id:"10",name:"10",label:"10",value:10},{id:"11",name:"11",label:"11",value:11},{id:"12",name:"12",label:"12",value:12},{id:"13",name:"13",label:"13",value:13},{id:"14",name:"14",label:"14",value:14},{id:"15",name:"15",label:"15",value:15},{id:"16",name:"16",label:"16",value:16},{id:"18",name:"18",label:"18",value:18},{id:"20",name:"20",label:"20",value:20},{id:"24",name:"24",label:"24",value:24},{id:"32",name:"32",label:"32",value:32},{id:"36",name:"36",label:"36",value:36},{id:"40",name:"40",label:"40",value:40},{id:"48",name:"48",label:"48",value:48},{id:"64",name:"64",label:"64",value:64},{id:"96",name:"96",label:"96",value:96},{id:"128",name:"128",label:"128",value:128}],fontFamily:[],fontWeight:[{id:"regular",name:"Regular",label:"Regular",value:"400"}],aiActionOnText:[{id:"textSuggestionRewrite",name:"Rewrite",label:"Rewrite",value:"textSuggestionRewrite"},{id:"textSuggestionReduce",name:"Reduce",label:"Reduce",value:"textSuggestionReduce"},{id:"textSuggestionMagic",name:"Shakespeare",label:"Shakespeare",value:"textSuggestionMagic"}]},configs:componentConfigs}),getIconForComponent=(Tr="text")=>state$5.configs[Tr].metaData.icon??"",updateOptions=(Tr,Cr)=>{state$5.options[Tr]=Cr},getDefaultConfig=(Tr="text",Cr="title")=>{var Ar;const $r=((Ar=state$5.configs[Tr])==null?void 0:Ar.defaultConfig)??{};return Tr==="text"&&($r.textType.selectedId=Cr),Tr==="image"&&($r.generatedBy.value=Cr),Tr==="shape"&&($r.shapeType.selectedId=Cr),$r},blockConfig={state:state$5,addSpacesToIconName,getIconRepresentationFromId,getEmojiRepresentationFromId,getEmojiValueFromId,getIconForComponent,updateOptions,getDefaultConfig},fontWeightMap={100:"Thin",200:"Extra light",300:"Light",400:"Regular",regular:"Regular",500:"Medium",600:"Semi bold",700:"Bold",800:"Extra bold",900:"Black",950:"Extra black","100italic":"Thin Italic","200italic":"Extra light Italic","300italic":"Light Italic","400italic":"Regular Italic","500italic":"Medium Italic","600italic":"Semi bold Italic","700italic":"Bold Italic","800italic":"Extra bold Italic","900italic":"Black Italic","950italic":"Extra black Italic",italic:"Italic"},state$4=reactive({fonts:[],lastUsedFont:{fontFamily:"General Sans",fontWeight:"regular",fontSize:"32",color:"hsl(0, 0%, 0%)",textAlignment:"center",verticalAlignment:"center"}}),fontOptions=computed(()=>state$4.fonts.map(Tr=>({id:Tr.family,name:Tr.family,label:Tr.family,value:Tr.family}))),capitalizeFirstLetterOnly=Tr=>Tr==null?"":(Tr=Tr.toLowerCase(),Tr.charAt(0).toUpperCase()+Tr.slice(1)),fontWeightOptions=Tr=>{const Cr=state$4.fonts.find($r=>$r.family===Tr);return Cr==null?void 0:Cr.variants.map($r=>({id:$r,name:capitalizeFirstLetterOnly(fontWeightMap[$r]??$r),label:capitalizeFirstLetterOnly(fontWeightMap[$r]??$r),value:$r==="regular"?"400":$r}))},updateFontWeightOptions=Tr=>{blockConfig.updateOptions("fontWeight",fontWeightOptions(Tr))},fetchAllFonts=async()=>{const Tr=await queryForFonts(),Cr=Tr==null?void 0:Tr.data;Cr&&(state$4.fonts=Cr.items??[]),blockConfig.updateOptions("fontFamily",fontOptions.value)},updateLastUsedFont=Tr=>{state$4.lastUsedFont={...state$4.lastUsedFont,...Tr}},fonts={state:state$4,fetchAllFonts,fontOptions,fontWeightOptions,updateFontWeightOptions,updateLastUsedFont};class BlockUtil{static getConfig(Cr){var Br,Nr;const{type:$r="text",subtype:Ar="heading",config:Rr,position:Dr}=Cr,Mr=$r==="table"?blockConfig.state.configs[$r].defaultConfig():lodashExports.cloneDeep((Nr=(Br=blockConfig==null?void 0:blockConfig.state)==null?void 0:Br.configs[$r])==null?void 0:Nr.defaultConfig);return $r==="text"&&(Mr.textType.selectedId=Ar,Mr.fontFamily.selectedId=fonts.state.lastUsedFont.fontFamily,Mr.fontWeight.selectedId=fonts.state.lastUsedFont.fontWeight,Mr.fontSize.selectedId=fonts.state.lastUsedFont.fontSize,Mr.textAlignment.selectedId=fonts.state.lastUsedFont.textAlignment,Mr.verticalAlignment.selectedId=fonts.state.lastUsedFont.verticalAlignment),$r==="image"&&(Mr.generatedBy.value=Ar),$r==="shape"&&(Mr.shapeType.selectedId=Ar),$r==="divider"&&(Mr.dividerType.selectedId="solid"),{...Mr,...Rr,positionX:{id:"positionX",value:Dr.x},positionY:{id:"positionY",value:Dr.y},positionWidth:{id:"positionWidth",value:Dr.width},positionHeight:{id:"positionHeight",value:Dr.height}}}}Fa(BlockUtil,"getDefaultPosition",({x:Cr=30,y:$r=30,display:Ar="desktop",density:Rr="normal",blockType:Dr="text"})=>{const Mr={x:Cr,y:$r,density:"normal",setByUser:!1},Br={mobile:{...Mr,...blockConfig.state.configs[Dr].defaultDimensions.mobile.normal},tablet:{...Mr,...blockConfig.state.configs[Dr].defaultDimensions.tablet.normal},laptop:{...Mr,...blockConfig.state.configs[Dr].defaultDimensions.laptop.normal},desktop:{...Mr,...blockConfig.state.configs[Dr].defaultDimensions.desktop.normal}};if(Br[Ar]={...blockConfig.state.configs[Dr].defaultDimensions[Ar][Rr],x:Cr,y:$r,density:Rr,setByUser:!0},Dr==="image"&&(Br[Ar].x=325,Br[Ar].y=120),Dr==="shape"&&(Br[Ar].x=325,Br[Ar].y=120),Dr==="text"){const Nr=parseFloat(fonts.state.lastUsedFont.fontSize);Br[Ar].height=Nr*1.2+8,Br[Ar].x=240,Br[Ar].y=247}return Dr==="divider"&&(Br[Ar].height=100,Br[Ar].x=325,Br[Ar].y=120),Br});const useItemStore=defineStore("itemStore",{state:()=>({data:{}}),getters:{ITEM_MAP:Tr=>Cr=>Tr.data[Cr],directionForItem:Tr=>(Cr,$r)=>{var Dr;const Ar=Tr.data[$r];if(Ar==null||Ar[Cr]==null)return null;const Rr=Ar[Cr].groupId;return Rr==null?null:(Dr=Ar[Rr])==null?void 0:Dr.direction}},actions:{deleteSlideMap(Tr){delete this.data[Tr]},addOrUpdateSlideMap({slideId:Tr,itemMap:Cr,replace:$r=!1}){if($r){this.data[Tr]=Cr;return}isObjectNullOrEmpty(Cr)||(this.data[Tr]={...this.data[Tr],...Cr})},updateItemState({id:Tr,slideId:Cr,info:$r}){const Ar=this.data[Cr];Ar!=null&&(Ar[Tr]={...Ar[Tr],...$r})}}}),GROUP_PREFIX$1="g-",GROUP_PREFIX_ROW="g-h-",GROUP_PREFIX_COLUMN="g-v-";function isGroup$1({id:Tr}){return Tr==null?void 0:Tr.startsWith(GROUP_PREFIX$1)}function isRootGroup$1({groupId:Tr,ITEM_MAP:Cr}){return Tr==null||Cr[Tr]==null?!1:isGroup$1({id:Tr})&&Cr[Tr].groupId==null}function getGroupIdString({num:Tr,direction:Cr}){return`${Cr==="row"?GROUP_PREFIX_ROW:GROUP_PREFIX_COLUMN}${Tr}`}function getGroupIdUUID(){return`${GROUP_PREFIX$1}${guid()}`}function sortPositionsLeftRightTopBottom({positions:Tr}){return Tr.sort(($r,Ar)=>$r.yAr.y?1:$r.xAr.x?1:0)}function sortPositionsTopBottomLeftRight({positions:Tr}){return Tr.sort(($r,Ar)=>$r.xAr.x?1:$r.yAr.y?1:0)}function getGroupIds({ITEM_MAP:Tr}){return Tr?Object.keys(Tr).filter(Cr=>Cr.startsWith(GROUP_PREFIX$1)):[]}function getRootGroupId({ITEM_MAP:Tr}){return getGroupIds({ITEM_MAP:Tr}).find(Ar=>isRootGroup$1({groupId:Ar,ITEM_MAP:Tr}))}function getNewGroupId({ITEM_MAP:Tr,direction:Cr}){const Rr=getGroupIds({ITEM_MAP:Tr}).filter(Mr=>Tr[Mr].direction===Cr).map(Mr=>Mr.replace(Cr==="row"?GROUP_PREFIX_ROW:GROUP_PREFIX_COLUMN,""));return Rr.length===0?1:Math.max(...Rr.map(Mr=>parseInt(Mr,10)))+1}function deleteGroup({groupId:Tr,ITEM_MAP:Cr}){if(Cr[Tr]==null)return{ITEM_MAP:Cr,items:[]};const $r=lodashExports.cloneDeep(Cr[Tr].items);return delete Cr[Tr],{ITEM_MAP:Cr,items:$r}}const defaultGroupMap={"g-h-0":{type:"group",direction:"row",items:[],x:0,y:0,width:960,height:540,spacing:{padding:12,gap:12}}};function getAllGroups({slideId:Tr}){const Cr=useItemStore();return Cr.data[Tr]!=null?{ITEM_MAP:Cr.data[Tr]}:{ITEM_MAP:defaultGroupMap}}function getSumOfUnits({itemIds:Tr,ITEM_MAP:Cr,direction:$r}){return Tr.reduce((Rr,Dr)=>Rr+basicFlexLogic.getPositionObjectForItem({id:Dr,ITEM_MAP:Cr})[$r==="row"?"width":"height"],0)}function getOrderedChildren({id:Tr,ITEM_MAP:Cr}){if(isGroup$1({id:Tr})){const $r=Cr[Tr];if(!$r)return[];const{items:Ar}=$r,Rr=[];return Ar.forEach(Dr=>{const Mr=getOrderedChildren({id:Dr,ITEM_MAP:Cr});Rr.push(...Mr)}),Rr}return[Tr]}function orderBlocksGroupWise({slideId:Tr}){const Cr=useItemStore(),$r=usePageStore(),Ar=Cr.data[Tr];if(Ar==null)return $r.children(Tr);const Rr=getRootGroupId({ITEM_MAP:Ar});return Rr==null?$r.children(Tr):getOrderedChildren({id:Rr,ITEM_MAP:Ar})}const groupFlexLogic={getAllGroups,isGroup:isGroup$1,isRootGroup:isRootGroup$1,deleteGroup,getNewGroupId,getGroupIdString,getRootGroupId,GROUP_PREFIX:GROUP_PREFIX$1,getSumOfUnits,getGroupIds,sortPositionsLeftRightTopBottom,sortPositionsTopBottomLeftRight,orderBlocksGroupWise,getGroupIdUUID},RESIZER_THICKNESS$2=16,RESIZER_PADDING$2=6.5,RESIZER_SNAP_DISTANCE$2=8,MIN_RESIER_HEIGHT_WIDTH$2=48,canResize$1=Tr=>{const{x:Cr,y:$r,width:Ar,height:Rr,id:Dr}=Tr;return!(Ar{const{x:Cr,y:$r,width:Ar,height:Rr,id:Dr}=Tr;return!(Ar`${Tr}:${Cr}`,splitResizerId$1=Tr=>Tr==null?{groupId:null,index:null}:{groupId:Tr.split(":")[0],index:parseInt(Tr.split(":")[1],10)},getPositionForResizer$1=({groupId:Tr,index:Cr,slideId:$r})=>{const Rr=useItemStore().data[$r],Dr=Rr[Tr],Mr=Dr.items[Cr];if(!Mr)return null;const Br=basicFlexLogic.getPositionObjectForItem({id:Mr,ITEM_MAP:Rr,redoRootGroupCalc:!0}),Nr=Dr.direction;return Nr==="row"?{x:Br.x+Br.width+6,y:Br.y+Br.height*.5,height:Br.height*1,width:RESIZER_THICKNESS$2,direction:"row"}:Nr==="column"?{x:Br.x+Br.width*.5,y:Br.y+Br.height+6,height:RESIZER_THICKNESS$2,width:Br.width*1,direction:"column"}:null},getPositionForResizerAtBottom=({slideId:Tr})=>{const $r=useItemStore().data[Tr],Ar=basicFlexLogic.getPositionObjectForItem({id:"g-h-0",ITEM_MAP:$r,redoRootGroupCalc:!0});return{x:Ar.x+Ar.width*.5,y:Ar.y+Ar.height+0,height:RESIZER_THICKNESS$2,width:Ar.width*1,direction:"column"}},getPositionForResizerAtBottomStatic=({slideId:Tr})=>{const Cr={x:0,y:0,width:960,height:540};return{x:Cr.x+Cr.width*.5,y:Cr.y+Cr.height+0,height:RESIZER_THICKNESS$2,width:Cr.width*1,direction:"column"}},getBottomEdgeResizer=({slideId:Tr,scale:Cr,slideBoundingRectDirect:$r,slideBoundingRect:Ar,fixed:Rr=!1})=>{const Dr="g-h-0",Mr=Rr?getPositionForResizerAtBottomStatic({slideId:Tr}):getPositionForResizerAtBottom({slideId:Tr});if(Mr){const Br={id:getResizerId$1({groupId:Dr,index:-1}),position:{...Mr,x:Mr.x*Cr,y:Mr.y*Cr,width:Mr.width*Cr,height:Mr.height*Cr}};return $r&&Ar.height.value<=540*Cr?(Br.position.x+=$r.x,Br.position.y+=$r.y):Ar&&(Br.position.x+=Ar.x.value,Br.position.y+=Ar.y.value),Br}return null},getAllResizers$1=({slideId:Tr,start:Cr,slideBoundingRect:$r,slideBoundingRectDirect:Ar,scale:Rr})=>{if(!usePageStore().children(Tr).length)return[];const Mr=useItemStore().data[Tr],Br=[],Nr=Cr??groupFlexLogic.getRootGroupId({ITEM_MAP:Mr});if(!Nr)return[];if(!groupFlexLogic.isGroup({id:Nr}))return[];const Hr=Mr[Nr].items;if(Hr.slice(0,-1).forEach((Ur,Vr)=>{const jr=getPositionForResizer$1({groupId:Nr,index:Vr,slideId:Tr});if(!jr)return;const Gr={id:getResizerId$1({groupId:Nr,index:Vr}),position:{...jr,x:jr.x*Rr,y:jr.y*Rr,width:jr.width*Rr,height:jr.height*Rr}};Ar&&$r.height.value<=540*Rr?(Gr.position.x+=Ar.x,Gr.position.y+=Ar.y):$r&&(Gr.position.x+=$r.x.value,Gr.position.y+=$r.y.value),Br.push(Gr)}),Cr==null&&getPositionForResizerAtBottom({slideId:Tr})){const Vr=getBottomEdgeResizer({slideId:Tr,scale:Rr,slideBoundingRectDirect:Ar,slideBoundingRect:$r,fixed:!1});Vr&&Br.push(Vr)}return Hr.filter(Ur=>groupFlexLogic.isGroup({id:Ur})).forEach(Ur=>{const Vr=getAllResizers$1({slideId:Tr,start:Ur,slideBoundingRect:$r,slideBoundingRectDirect:Ar,scale:Rr});Br.push(...Vr)}),Br},getNearestResizerInSameDirection$1=({resizerId:Tr,allResizers:Cr,currentPos:$r,scale:Ar})=>{const Rr=Cr.find(Gr=>Gr.id===Tr);if(!Rr)return null;const Dr=Rr.position.direction,Mr=Dr==="row"?"x":"y",Br=$r[Mr],{groupId:Nr,index:Lr}=splitResizerId$1(Tr),Hr=Cr.filter(Gr=>Gr.id!==Tr&&Gr.id!=="g-h-0:-1").filter(Gr=>Gr.position.direction===Dr).filter(Gr=>!Gr.id.startsWith(Nr)).filter(Gr=>Math.abs(Gr.position[Mr]-Br)Math.abs(Gr.position[Ur]-$r[Ur])-Math.abs(Xr.position[Ur]-$r[Ur]))[0],jr=Hr.filter(Gr=>basicFlexLogic.closeBy(Gr.position[Mr],Vr.position[Mr]));return{anchor:Vr,ids:jr.map(Gr=>Gr.id)}},getNearestResizerInSameDirectionBottomEdge=({slideId:Tr,slideBoundingRectDirect:Cr,slideBoundingRect:$r,currentPos:Ar,scale:Rr})=>{const Dr=getBottomEdgeResizer({slideId:Tr,scale:Rr,slideBoundingRectDirect:Cr,slideBoundingRect:$r,fixed:!0});if(!Dr)return null;const Mr=Ar.y,Br=[Dr].filter(Nr=>Nr.position.direction==="column").filter(Nr=>Math.abs(Nr.position.y-Mr)Nr.id)}},groupResizer$1={getPositionForResizer:getPositionForResizer$1,getAllResizers:getAllResizers$1,splitResizerId:splitResizerId$1,canResize:canResize$1,canResizeX,getNearestResizerInSameDirection:getNearestResizerInSameDirection$1,getNearestResizerInSameDirectionBottomEdge,RESIZER_PADDING:RESIZER_PADDING$2,RESIZER_SNAP_DISTANCE:RESIZER_SNAP_DISTANCE$2,RESIZER_THICKNESS:RESIZER_THICKNESS$2,MIN_RESIER_HEIGHT_WIDTH:MIN_RESIER_HEIGHT_WIDTH$2};function posthogCapture(Tr,Cr=void 0){try{Ir.capture(Tr,Cr)}catch($r){console.error($r)}}const useTableStore=defineStore("tableStore",{state:()=>({rowIdsBeingDragged:[],colIdsBeingDragged:[]}),getters:{draggingTableEl:Tr=>Tr.rowIdsBeingDragged.length||Tr.colIdsBeingDragged.length},actions:{setRowIdsBeingDragged(Tr){this.rowIdsBeingDragged=Tr},setColIdsBeingDragged(Tr){this.colIdsBeingDragged=Tr}}}),DEFAULT_IMAGE_ID="realistic",DEFAULT_LANGUAGE_ID="english",DEFAULT_TONE_ID="professional",DEFAULT_AUDIENCE="",useArtboardStore=defineStore("artboardStore",{state:()=>({blockResizerId:null,slideIdAtTop:null,slideIdAtBottom:null,cmdBarContentHeight:24,dragShrinkingAffectedItems:null,activeSession:null,blockPositions:{},blockPositionChangeInProgress:!1,pageMountFlag:{},pdfViewerOptions:{slideIndices:[],bucketKey:540},mountedApp:!1,isPublicPath:!1,mountKeys:{},aiGenSettings:{selectedImageId:DEFAULT_IMAGE_ID,selectedLanguageId:DEFAULT_LANGUAGE_ID,audience:DEFAULT_AUDIENCE,selectedToneId:DEFAULT_TONE_ID}}),getters:{isAnyBlockResizing:Tr=>Tr.blockResizerId!=null,getBlockResizerId:Tr=>Tr.blockResizerId,getGroupBeingResized:Tr=>{if(Tr.blockResizerId==null)return null;const{groupId:Cr}=groupResizer$1.splitResizerId(Tr.blockResizerId);return Cr},getItemIndexBeingResized:Tr=>{if(Tr.blockResizerId==null)return-1;const{index:Cr}=groupResizer$1.splitResizerId(Tr.blockResizerId);return Cr},getItemsBeingResized:Tr=>Cr=>{if(Tr.blockResizerId==null)return null;const{groupId:$r,index:Ar}=groupResizer$1.splitResizerId(Tr.blockResizerId);return!$r||!Cr||!Cr[$r]?null:(Cr[$r].items??[]).slice(Ar,Ar+2)},getSlideIdAtTop:Tr=>Tr.slideIdAtTop,getSlideIdAtBottom:Tr=>Tr.slideIdAtBottom,getCommandBarContentHeight:Tr=>Tr.cmdBarContentHeight,getDragShrinkingAffectedItems:Tr=>Tr.dragShrinkingAffectedItems,getActiveSession:Tr=>Tr.activeSession,getLocalPositionObject:Tr=>Cr=>Tr.blockPositions[Cr]??{x:0,y:0,width:0,height:0},getBlockPositionChangeInProgress:Tr=>Tr.blockPositionChangeInProgress,isDraggingResizing(){return useBlockStore().isAnyBlockDragging||this.isAnyBlockResizing||useTableStore().draggingTableEl},isTableDragging(){return useTableStore().draggingTableEl},getPageMountFlag:Tr=>Cr=>Tr.pageMountFlag[Cr],getPdfViewerOptions:Tr=>Tr.pdfViewerOptions,getMountedApp:Tr=>Tr.mountedApp,getIsPublicPath:Tr=>Tr.isPublicPath,getMountKey:Tr=>Cr=>Tr.mountKeys[Cr]??"",getAIGenSettings:Tr=>({imageId:Tr.aiGenSettings.selectedImageId,languageId:Tr.aiGenSettings.selectedLanguageId,audience:Tr.aiGenSettings.audience,toneId:Tr.aiGenSettings.selectedToneId})},actions:{setMountKey({id:Tr,value:Cr}){this.mountKeys[Tr]=Cr},setBlockResizerId(Tr){this.blockResizerId=Tr},setSlideIdAtTop(Tr){this.slideIdAtTop=Tr},setSlideIdAtBottom(Tr){this.slideIdAtBottom=Tr},setCommandBarContentHeight(Tr){this.cmdBarContentHeight=Tr},setDragShrinkingAffectedItems(Tr){this.dragShrinkingAffectedItems=Tr},startActiveSession({sourceId:Tr}){this.activeSession={sessionId:guid(),sourceId:Tr,startedAt:new Date().getTime()};const Cr=useUserStore();posthogCapture("active session started",{sessionId:this.activeSession.sessionId,sourceId:this.activeSession.sourceId,startedAt:this.activeSession.startedAt,email:Cr.userEmail,userId:Cr.currentUserId}),IS_CLIENT&&window.addEventListener("beforeunload",this.endActiveSession)},endActiveSession(){if(this.activeSession==null)return;this.activeSession.endedAt=new Date().getTime();const Tr=useUserStore();posthogCapture("active session ended",{sessionId:this.activeSession.sessionId,sourceId:this.activeSession.sourceId,startedAt:this.activeSession.startedAt||new Date().getTime(),endedAt:this.activeSession.endedAt,timeDiff:this.activeSession.endedAt-this.activeSession.startedAt,email:Tr.userEmail,userId:Tr.currentUserId}),this.activeSession=null,IS_CLIENT&&window.removeEventListener("beforeunload",this.endActiveSession)},updatePositionObject({blockId:Tr,positionObject:Cr}){if(!this.blockPositions[Tr]){this.blockPositions[Tr]=Cr;return}this.blockPositions[Tr]={...this.blockPositions[Tr],...Cr}},roundToNearest(Tr){return Math.round(Tr/1e3)*1e3},setBlockPositionChangeInProgress(Tr){this.blockPositionChangeInProgress=Tr},savePosition({blockId:Tr}){const Cr=this.blockPositions[Tr];if(!Cr||isObjectNullOrEmpty(Cr))return;const $r={width:this.roundToNearest(Cr.width),height:this.roundToNearest(Cr.height),x:this.roundToNearest(Cr.x),y:this.roundToNearest(Cr.y)},Ar=useBlockStore(),Rr=useItemStore(),Dr=Ar.parentId(Tr);Rr.data[Dr],Ar.updatePosition(Tr,{positionObject:$r,saveInDatabase:!1,skipUndo:!0})},setPageMountFlag({pageId:Tr,value:Cr}){this.pageMountFlag[Tr]=Cr},setPdfViewerOptions({slideIndices:Tr,bucketKey:Cr}){this.pdfViewerOptions={slideIndices:Tr,bucketKey:Cr}},setMountedApp(Tr){this.mountedApp=Tr},setIsPublicPath(Tr){this.isPublicPath=Tr},setAIGenSettings({key:Tr,value:Cr}){this.aiGenSettings[Tr]=Cr},resetAIGenSettings(){this.aiGenSettings={selectedImageId:DEFAULT_IMAGE_ID,selectedLanguageId:DEFAULT_LANGUAGE_ID,audience:DEFAULT_AUDIENCE,selectedToneId:DEFAULT_TONE_ID}}}}),MAX_WIDTH=960,MAX_HEIGHT=540,SPACER_GAP=0,MAX_ITEMS_PER_ROW=4,MAX_ITEMS_PER_COLUMN=4,MIN_WIDTH_TEXT=99,MIN_WIDTH_IMAGE=99,MIN_WIDTH_TABLE=299,MIN_WIDTH_DIVIDER=26,MIN_WIDTH_WEBPAGE=374,MIN_WIDTH_BOOKMARK=274,MIN_HEIGHT_TEXT=51,MIN_HEIGHT_IMAGE=51,MIN_HEIGHT_TABLE=51,MIN_HEIGHT_DIVIDER=26,MIN_HEIGHT_WEBPAGE=280,MIN_HEIGHT_BOOKMARK=74,WAIT_TIME_FOR_BLOCK_RENDER=200,WAIT_TIME_FOR_BLOCK_RENDER_AFTER_ADDING_BLOCK=200,WAIT_TIME_FOR_BLOCK_RENDER_PAGE_LEVEL=300,MIN_HEIGHT_MAP={text:MIN_HEIGHT_TEXT,image:MIN_HEIGHT_IMAGE,table:MIN_HEIGHT_TABLE,divider:MIN_HEIGHT_DIVIDER,webpage:MIN_HEIGHT_WEBPAGE,bookmark:MIN_HEIGHT_BOOKMARK},MIN_WIDTH_MAP={text:MIN_WIDTH_TEXT,image:MIN_WIDTH_IMAGE,table:MIN_WIDTH_TABLE,divider:MIN_WIDTH_DIVIDER,webpage:MIN_WIDTH_WEBPAGE,bookmark:MIN_WIDTH_BOOKMARK},MIN_HEIGHT_MAP_DURING_DRAG_DROP={text:120,image:240,table:300,divider:26,webpage:280,bookmark:74},MIN_HEIGHT_MAP_DURING_ADD_BLOCK={text:100,image:240,table:300,divider:26,webpage:280,bookmark:74},GROUP_PREFIX="g-",designMinWidth=Tr=>{const Cr=useBlockStore();return MIN_WIDTH_MAP[Cr.type(Tr)??"text"]},designMinHeight=Tr=>{const Cr=useBlockStore();return MIN_HEIGHT_MAP[Cr.type(Tr)??"text"]},designHeightToUseWhenAddingBlock=Tr=>{const Cr=useBlockStore();return MIN_HEIGHT_MAP_DURING_ADD_BLOCK[Cr.type(Tr)??"text"]||MIN_HEIGHT_MAP_DURING_ADD_BLOCK.text};function getSlideSpacing({slideId:Tr}){const Cr=usePageStore(),$r=useAppStore(),Ar=Cr.parentId(Tr);return $r.deckSpacing(Ar)}function getGroupSpacing({groupId:Tr,slideId:Cr}){var Dr,Mr;const Ar=useItemStore().data[Cr];if(Ar==null)return{padding:0,gap:0};if(Ar[Tr]==null)return{padding:0,gap:0};const Rr=Ar[Tr];return{padding:((Dr=Rr.spacing)==null?void 0:Dr.padding)||0,gap:((Mr=Rr.spacing)==null?void 0:Mr.gap)||0}}function setGroupSpacing({groupId:Tr,slideId:Cr,padding:$r,gap:Ar}){const Dr=useItemStore().data[Cr];if(Dr==null||Dr[Tr]==null)return;const Mr=Dr[Tr];Mr.spacing={padding:$r,gap:Ar}}function getParentGroupId({itemId:Tr,slideId:Cr}){const Ar=useItemStore().data[Cr];return Ar==null||Ar[Tr]==null?null:Ar[Tr].groupId}function GET_SPACER_GAP({axis:Tr="x",slideId:Cr}){return SPACER_GAP}function GET_MAX_WIDTH({slideId:Tr}){return MAX_WIDTH-2*GET_SPACER_GAP({axis:"x",slideId:Tr})}function GET_MAX_HEIGHT({slideId:Tr}){return MAX_HEIGHT-2*GET_SPACER_GAP({axis:"y",slideId:Tr})}function roundValue(Tr){return Math.round(Tr*1e3)/1e3}function isGroup(Tr){return Tr==null?void 0:Tr.startsWith("g-")}function isRootGroup({groupId:Tr,ITEM_MAP:Cr}){return Tr==null||Cr[Tr]==null?!1:isGroup(Tr)&&Cr[Tr].groupId==null}function closeBy(Tr,Cr){return Math.abs(Tr-Cr)<.1}function getCounterDirection(Tr){return Tr==="row"?"column":"row"}function isBlockDescendantOfGroup({blockId:Tr,groupId:Cr,ITEM_MAP:$r}){if(Tr===Cr)return!0;if(Cr==null||$r[Cr]==null||!isGroup(Cr))return!1;const Ar=$r[Cr];return Ar.items==null?!1:Ar.items.includes(Tr)?!0:Ar.items.some(Rr=>isBlockDescendantOfGroup({blockId:Tr,groupId:Rr,ITEM_MAP:$r}))}function getAllLeafBlocksForItem({itemId:Tr,ITEM_MAP:Cr}){const $r=Cr[Tr];return $r==null?[]:$r.type==="group"?$r.items.reduce((Ar,Rr)=>[...Ar,...getAllLeafBlocksForItem({itemId:Rr,ITEM_MAP:Cr})],[]):[Tr]}function getPositionObjectForItem({id:Tr,ITEM_MAP:Cr,redoRootGroupCalc:$r=!0}){const Ar=useBlockStore();if(Tr==null)return{x:0,y:0,width:0,height:0};if(isGroup(Tr)){const Nr=Cr[Tr];if(!Nr)return{x:0,y:0,width:0,height:0};const{items:Lr,direction:Hr,spacing:zr}=Nr,Ur=isRootGroup({groupId:Tr,ITEM_MAP:Cr});if(Ur&&!$r)return{x:0,y:0,width:960,height:540};let Vr=0;zr&&(Vr=zr.padding||0,zr.gap);let jr={x:0,y:0,width:0,height:0};if(Hr==="row"){const Gr=Lr[0],Xr=Lr[Lr.length-1],Kr=getPositionObjectForItem({id:Gr,ITEM_MAP:Cr}),Zr=getPositionObjectForItem({id:Xr,ITEM_MAP:Cr});return jr={x:Ur?0:Kr.x-Vr,y:Ur?0:Kr.y-Vr,width:Ur?960:Zr.x+Zr.width-Kr.x+2*Vr,height:Math.max(Kr.height,Zr.height)+2*Vr},jr}if(Hr==="column"){const Gr=Lr[0],Xr=Lr[Lr.length-1],Kr=getPositionObjectForItem({id:Gr,ITEM_MAP:Cr}),Zr=getPositionObjectForItem({id:Xr,ITEM_MAP:Cr});return jr={x:Kr.x-Vr,y:Kr.y-Vr,width:Math.max(Kr.width,Zr.width)+2*Vr,height:Zr.y+Zr.height-Kr.y+2*Vr},jr}return jr}const{x:Rr,y:Dr,width:Mr,height:Br}=Ar.positionByDisplay(Tr);return Rr==null?{x:0,y:0,width:0,height:0}:{x:Rr,y:Dr,width:Mr,height:Br}}function setPositionObjectForItem({id:Tr,positionObject:Cr,ITEM_MAP:$r}){const Ar=useBlockStore();if(isGroup(Tr)){const Rr=$r[Tr];if(!Rr)return{x:0,y:0,width:0,height:0};const{items:Dr,direction:Mr,spacing:Br}=Rr;let Nr=0,Lr=0;Br&&(Nr=Br.padding||0,Lr=Br.gap||0);const Hr=getPositionObjectForItem({id:Tr,ITEM_MAP:$r,redoRootGroupCalc:!0});if(Mr==="row"){const zr=Hr.width-2*Nr-(Dr.length-1)*Lr,Vr=(Cr.width-2*Nr-(Dr.length-1)*Lr)/zr;let jr=Cr.x+Nr;Dr.forEach((Gr,Xr)=>{const Kr=getPositionObjectForItem({id:Gr,ITEM_MAP:$r,redoRootGroupCalc:!0}),Zr={...Kr,x:roundValue(jr),width:roundValue(Kr.width*Vr),y:roundValue(Cr.y+Nr),height:roundValue(Cr.height-2*Nr)};setPositionObjectForItem({id:Gr,positionObject:Zr,ITEM_MAP:$r}),jr+=Zr.width+Lr});return}if(Mr==="column"){const zr=Hr.height-2*Nr-(Dr.length-1)*Lr,Vr=(Cr.height-2*Nr-(Dr.length-1)*Lr)/zr;let jr=Cr.y+Nr;Dr.forEach((Gr,Xr)=>{const Kr=getPositionObjectForItem({id:Gr,ITEM_MAP:$r}),Zr={...Kr,y:roundValue(jr),height:roundValue(Kr.height*Vr),x:roundValue(Cr.x+Nr),width:roundValue(Cr.width-2*Nr)};setPositionObjectForItem({id:Gr,positionObject:Zr,ITEM_MAP:$r}),jr+=Zr.height+Lr});return}return}$r[Tr].x=Cr.x,$r[Tr].y=Cr.y,$r[Tr].width=Cr.width,$r[Tr].height=Cr.height,Ar.updatePosition(Tr,{positionObject:Cr,saveInDatabase:!1,skipUndo:!0})}function setPositionObjectForItemFromLocal({id:Tr,ITEM_MAP:Cr}){const $r=useBlockStore();if(isGroup(Tr)){const Rr=Cr[Tr];if(!Rr)return{x:0,y:0,width:0,height:0};const{items:Dr,direction:Mr}=Rr;if(Mr==="row"){Dr.forEach((Br,Nr)=>{setPositionObjectForItemFromLocal({id:Br,ITEM_MAP:Cr})});return}if(Mr==="column"){Dr.forEach((Br,Nr)=>{setPositionObjectForItemFromLocal({id:Br,ITEM_MAP:Cr})});return}return}const Ar=useArtboardStore().getLocalPositionObject(Tr);$r.updatePosition(Tr,{positionObject:Ar,saveInDatabase:!1,skipUndo:!0})}function adjustItemsWithNewSpacing({id:Tr,positionObject:Cr,newSpacing:$r,oldSpacing:Ar,ITEM_MAP:Rr}){const Dr=useBlockStore();if(Tr!=null){if(isGroup(Tr)){const Mr=Rr[Tr];if(!Mr)return{x:0,y:0,width:0,height:0};const{items:Br,direction:Nr}=Mr,{padding:Lr,gap:Hr}=Ar,{padding:zr,gap:Ur}=$r,Vr=getPositionObjectForItem({id:Tr,ITEM_MAP:Rr});if(Nr==="row"){const jr=Vr.width-2*Lr-(Br.length-1)*Hr,Xr=(Cr.width-2*zr-(Br.length-1)*Ur)/jr;let Kr=Cr.x+zr;Br.forEach((Zr,eo)=>{const Wr=getPositionObjectForItem({id:Zr,ITEM_MAP:Rr}),Yr={...Wr,x:roundValue(Kr),width:roundValue(Wr.width*Xr),y:roundValue(Cr.y+zr),height:roundValue(Cr.height-2*zr)};adjustItemsWithNewSpacing({id:Zr,positionObject:Yr,ITEM_MAP:Rr,newSpacing:{...$r,padding:0},oldSpacing:{...Ar,padding:0}}),Kr+=Yr.width+Ur});return}if(Nr==="column"){const jr=Vr.height-2*Lr-(Br.length-1)*Hr,Xr=(Cr.height-2*zr-(Br.length-1)*Ur)/jr;let Kr=Cr.y+zr;Br.forEach((Zr,eo)=>{const Wr=getPositionObjectForItem({id:Zr,ITEM_MAP:Rr}),Yr={...Wr,y:roundValue(Kr),height:roundValue(Wr.height*Xr),x:roundValue(Cr.x+zr),width:roundValue(Cr.width-2*zr)};adjustItemsWithNewSpacing({id:Zr,positionObject:Yr,ITEM_MAP:Rr,newSpacing:{...$r,padding:0},oldSpacing:{...Ar,padding:0}}),Kr+=Yr.height+Ur});return}return}Rr[Tr].x=Cr.x,Rr[Tr].y=Cr.y,Rr[Tr].width=Cr.width,Rr[Tr].height=Cr.height,Dr.updatePosition(Tr,{positionObject:Cr,saveInDatabase:!1})}}function getNextItemInGroup({itemId:Tr,direction:Cr,slideId:$r,ITEM_MAP:Ar}){const Rr=getParentGroupId({itemId:Tr,slideId:$r});if(Rr==null)return null;const Dr=Ar[Rr];if(Dr==null)return null;const Mr=Dr.items;if(Mr==null)return null;const Br=Mr.indexOf(Tr);if(Br===-1)return null;const Nr=Dr.direction;if(Nr==null)return null;if(Cr==="top"){if(Nr==="row")return null;if(Nr==="column")return Mr[Br-1]||null}if(Cr==="bottom"){if(Nr==="row")return null;if(Nr==="column")return Mr[Br+1]||null}if(Cr==="left"){if(Nr==="column")return null;if(Nr==="row")return Mr[Br-1]||null}if(Cr==="right"){if(Nr==="column")return null;if(Nr==="row")return Mr[Br+1]||null}return null}function isBlockAlreadyInCorrectPlace({blockId:Tr,dropId:Cr,direction:$r}){const Ar=useBlockStore();usePageStore();const Rr=Ar.parentId(Tr);if(Rr==null||Tr===Cr)return!0;const Mr=useItemStore().data[Rr];if(getNextItemInGroup({itemId:Cr,direction:$r,slideId:Rr,ITEM_MAP:Mr})===Tr)return!0;const Nr=Ar.positionByDisplay(Tr),Lr=Ar.positionByDisplay(Cr);if($r==="top"){const Hr=Nr.x===Lr.x,zr=Nr.y+Nr.height+SPACER_GAP===Lr.y;return Hr&&zr}if($r==="bottom"){const Hr=Nr.x===Lr.x,zr=Nr.y===Lr.y+Lr.height+SPACER_GAP;return Hr&&zr}if($r==="left"){const Hr=Nr.y===Lr.y,zr=Nr.x+Nr.width+SPACER_GAP===Lr.x;return Hr&&zr}if($r==="right"){const Hr=Nr.y===Lr.y,zr=Nr.x===Lr.x+Lr.width+SPACER_GAP;return Hr&&zr}return!0}function doBlocksShareBorder({blockId:Tr,dropId:Cr}){const $r=useBlockStore();if(usePageStore(),$r.parentId(Tr)==null)return!0;const Rr=$r.positionByDisplay(Tr),Dr=$r.positionByDisplay(Cr),Mr=Rr.x===Dr.x,Br=Rr.y===Dr.y,Nr=Rr.y+Rr.height+SPACER_GAP===Dr.y,Lr=Rr.y===Dr.y+Dr.height+SPACER_GAP,Hr=Rr.x+Rr.width+SPACER_GAP===Dr.x,zr=Rr.x===Dr.x+Dr.width+SPACER_GAP;return Mr&&(Nr||Lr)||Br&&(Hr||zr)}function getMinHeightForItem({id:Tr,ITEM_MAP:Cr,maintainBlockHeights:$r=!1}){const Ar=useBlockStore();if(Tr==null)return 0;if(isGroup(Tr)){const Rr=Cr[Tr];if(!Rr)return 0;const{direction:Dr,spacing:Mr}=Rr;let Br=0;return Dr==="row"?(Rr.items.forEach(Nr=>{const Lr=getMinHeightForItem({id:Nr,ITEM_MAP:Cr,maintainBlockHeights:$r});Lr>Br&&(Br=Lr)}),Br+2*((Mr==null?void 0:Mr.padding)||0)):Dr==="column"?(Rr.items.forEach(Nr=>{Br+=getMinHeightForItem({id:Nr,ITEM_MAP:Cr,maintainBlockHeights:$r})}),Br+2*((Mr==null?void 0:Mr.padding)||0)+(Rr.items.length-1)*((Mr==null?void 0:Mr.gap)||0)):Br}return $r?(log("min height special",{id:Tr,storedH:Ar.positionByDisplay(Tr).height,contentH:Ar.contentHeight(Tr),designMinH:designMinHeight(Tr)}),Math.max(Ar.contentHeight(Tr),designMinHeight(Tr),Ar.positionByDisplay(Tr).height)):Math.max(Ar.contentHeight(Tr),designMinHeight(Tr))}function getMinWidthForItem({id:Tr,ITEM_MAP:Cr}){if(useBlockStore(),Tr==null)return 0;if(isGroup(Tr)){const $r=Cr[Tr];if(!$r)return 0;const{direction:Ar,spacing:Rr}=$r;let Dr=0;return Ar==="column"?($r.items.forEach(Mr=>{const Br=getMinWidthForItem({id:Mr,ITEM_MAP:Cr});Br>Dr&&(Dr=Br)}),Dr+2*((Rr==null?void 0:Rr.padding)||0)):Ar==="row"?($r.items.forEach(Mr=>{Dr+=getMinWidthForItem({id:Mr,ITEM_MAP:Cr})}),Dr+2*((Rr==null?void 0:Rr.padding)||0)+($r.items.length-1)*((Rr==null?void 0:Rr.gap)||0)):Dr}return designMinWidth(Tr)}function getMinHeightOfSiblings({id:Tr,ITEM_MAP:Cr}){if(Tr==null)return 0;const $r=Cr[Tr].groupId;if($r==null)return 0;const Ar=Cr[$r];if(Ar==null)return 0;const{items:Rr}=Ar;if(Rr==null)return 0;let Dr=0;return Rr.filter(Mr=>Mr!==Tr).forEach(Mr=>{const Br=getMinHeightForItem({id:Mr,ITEM_MAP:Cr});Br>Dr&&(Dr=Br)}),Dr}function getSumOfStoredHeightsOfSiblings({id:Tr,ITEM_MAP:Cr}){if(Tr==null)return 0;const $r=Cr[Tr].groupId;if($r==null)return 0;const Ar=Cr[$r];if(Ar==null)return 0;const{items:Rr}=Ar;if(Rr==null)return 0;let Dr=0;return Rr.filter(Mr=>Mr!==Tr).forEach(Mr=>{Dr+=getPositionObjectForItem({id:Mr,ITEM_MAP:Cr}).height}),Dr}function getNewHeightForBlock({blockId:Tr,proposedHeight:Cr}){var Zr,eo,Wr;const $r=useBlockStore();usePageStore();const Ar=$r.parentId(Tr);if(Ar==null)return Math.max(Cr,designMinHeight(Tr));const Dr=useItemStore().data[Ar],Mr=getPositionObjectForItem({id:Tr,ITEM_MAP:Dr,redoRootGroupCalc:!0}),Br=getPositionObjectForItem({id:"g-h-0",ITEM_MAP:Dr,redoRootGroupCalc:!0}),Nr=getSlideSpacing({slideId:Ar}),Lr=(Zr=Dr[Tr])==null?void 0:Zr.groupId;if(Lr==null)return Math.max(Cr,designMinHeight(Tr));const Hr=Dr[Lr];if(Hr==null)return Math.max(Cr,designMinHeight(Tr));const{direction:zr}=Hr;if(zr==null)return Math.max(Cr,designMinHeight(Tr));const Ur=((eo=Hr.spacing)==null?void 0:eo.padding)||0,Vr=((Wr=Hr.spacing)==null?void 0:Wr.gap)||0,jr=zr==="row"?getMinHeightOfSiblings({id:Tr,ITEM_MAP:Dr}):getMinHeightOfSiblings({id:Lr,ITEM_MAP:Dr})-getSumOfStoredHeightsOfSiblings({id:Tr,ITEM_MAP:Dr})-(Hr.items.length-1)*Vr-2*Ur;let Gr=Cr;jr>Cr&&(Gr=jr);const Xr=Br.height,Kr=Xr+Gr-Mr.height;return log("addblock heights slide",{bh:Mr.height,blockId:Tr,ITEM_MAP:lodashExports.cloneDeep(Dr),rootGroupPosition:lodashExports.cloneDeep(Br),currentSlideHeight:Xr,proposedSlideHeight:Kr,spacing:Nr,proposedHeight:Cr,proposedHeightToUse:Gr,direction:zr,minHeightOfSiblings:jr}),Kr<540?Math.max(Mr.height+540-Xr,designMinHeight(Tr)):Math.max(Gr,designMinHeight(Tr))}function getNewHeightForItem({blockId:Tr,proposedHeight:Cr,slideId:$r}){if(useBlockStore(),usePageStore(),$r==null)return Math.max(Cr,designMinHeight(Tr));const Rr=useItemStore().data[$r],Dr=getPositionObjectForItem({id:Tr,ITEM_MAP:Rr,redoRootGroupCalc:!0}),Mr=getPositionObjectForItem({id:"g-h-0",ITEM_MAP:Rr,redoRootGroupCalc:!0}),Br=getMinHeightForItem({id:Tr,ITEM_MAP:Rr}),Nr=getSlideSpacing({slideId:$r}),Lr=Rr[Tr].groupId;if(Lr==null)return Math.max(Cr,Br);const Hr=Rr[Lr];if(Hr==null)return Math.max(Cr,Br);const{direction:zr}=Hr;if(zr==null)return Math.max(Cr,Br);const Ur=zr==="row"?getMinHeightOfSiblings({id:Tr,ITEM_MAP:Rr}):getMinHeightOfSiblings({id:Lr,ITEM_MAP:Rr})-getSumOfStoredHeightsOfSiblings({id:Tr,ITEM_MAP:Rr});let Vr=Cr;Ur>Cr&&(Vr=Ur);const jr=Mr.height,Gr=jr+Vr-Dr.height;return log("addblock heights slide",{ITEM_MAP:lodashExports.cloneDeep(Rr),rootGroupPosition:lodashExports.cloneDeep(Mr),currentSlideHeight:jr,proposedSlideHeight:Gr,spacing:Nr,proposedHeight:Cr,proposedHeightToUse:Vr,direction:zr,minHeightOfSiblings:Ur}),Gr<540?Math.max(Dr.height+540-jr,Br):Math.max(Vr,Br)}const basicFlexLogic={GROUP_PREFIX,MAX_WIDTH,MAX_HEIGHT,MIN_HEIGHT_TEXT,MIN_WIDTH_TEXT,GET_MAX_WIDTH,GET_MAX_HEIGHT,SPACER_GAP,GET_SPACER_GAP,MAX_ITEMS_PER_ROW,MAX_ITEMS_PER_COLUMN,WAIT_TIME_FOR_BLOCK_RENDER,WAIT_TIME_FOR_BLOCK_RENDER_AFTER_ADDING_BLOCK,WAIT_TIME_FOR_BLOCK_RENDER_PAGE_LEVEL,MIN_HEIGHT_MAP_DURING_DRAG_DROP,isBlockAlreadyInCorrectPlace,doBlocksShareBorder,isGroup,getPositionObjectForItem,setPositionObjectForItem,setPositionObjectForItemFromLocal,roundValue,closeBy,getCounterDirection,getSlideSpacing,getGroupSpacing,setGroupSpacing,adjustItemsWithNewSpacing,isBlockDescendantOfGroup,isRootGroup,getAllLeafBlocksForItem,getParentGroupId,getNewHeightForBlock,getMinHeightForItem,getNewHeightForItem,getMinWidthForItem,designMinWidth,designMinHeight,designHeightToUseWhenAddingBlock},getMinHeightForRelevantBlock=({relevantBlockId:Tr})=>{const $r=useBlockStore().type(Tr),Ar=basicFlexLogic.MIN_HEIGHT_MAP_DURING_DRAG_DROP;return typeof $r!="string"?Ar.text:Ar[$r]||Ar.text},getLocalPositionForItem$2=({id:Tr,ITEM_MAP:Cr})=>{if(Tr==null)return{x:0,y:0,width:0,height:0};if(basicFlexLogic.isGroup(Tr)){const Ar=Cr[Tr];if(!Ar)return{x:0,y:0,width:0,height:0};const{items:Rr,direction:Dr,spacing:Mr}=Ar,Br=basicFlexLogic.isRootGroup({groupId:Tr,ITEM_MAP:Cr});let Nr=0;Mr&&(Nr=Mr.padding||0,Mr.gap);let Lr={x:0,y:0,width:0,height:0};if(Dr==="row"){const Hr=Rr[0],zr=Rr[Rr.length-1],Ur=getLocalPositionForItem$2({id:Hr,ITEM_MAP:Cr}),Vr=getLocalPositionForItem$2({id:zr,ITEM_MAP:Cr});return Lr={x:Br?0:Ur.x-Nr,y:Br?0:Ur.y-Nr,width:Br?960:Vr.x+Vr.width-Ur.x+2*Nr,height:Ur.height+2*Nr},Lr}if(Dr==="column"){const Hr=Rr[0],zr=Rr[Rr.length-1],Ur=getLocalPositionForItem$2({id:Hr,ITEM_MAP:Cr}),Vr=getLocalPositionForItem$2({id:zr,ITEM_MAP:Cr});return Lr={x:Ur.x-Nr,y:Ur.y-Nr,width:Ur.width+2*Nr,height:Vr.y+Vr.height-Ur.y+2*Nr},Lr}return Lr}return useArtboardStore().getLocalPositionObject(Tr)},updateLocalPositionForItem$2=({id:Tr,newPosition:Cr,ITEM_MAP:$r,dimensionChanged:Ar})=>{const Rr=useArtboardStore();if(basicFlexLogic.isGroup(Tr)){if($r[Tr]==null)return;const{items:Mr,direction:Br}=$r[Tr],Nr=$r[Tr].spacing??{padding:0,gap:0},Lr=(Nr==null?void 0:Nr.padding)??0,Hr=(Nr==null?void 0:Nr.gap)??0,zr=basicFlexLogic.getPositionObjectForItem({id:Tr,ITEM_MAP:$r,redoRootGroupCalc:!0});if(Ar==="width"&&Br==="row"){const Ur=zr.width-2*Lr-(Mr.length-1)*Hr,jr=(Cr.width-2*Lr-(Mr.length-1)*Hr)/Ur;let Gr=Cr.x+Lr;Mr.forEach((Xr,Kr)=>{const Zr=basicFlexLogic.getPositionObjectForItem({id:Xr,ITEM_MAP:$r}),eo={...Zr,x:basicFlexLogic.roundValue(Gr),width:basicFlexLogic.roundValue(Zr.width*jr),y:basicFlexLogic.roundValue(Cr.y+Lr),height:basicFlexLogic.roundValue(Cr.height-2*Lr)};updateLocalPositionForItem$2({id:Xr,newPosition:eo,ITEM_MAP:$r,dimensionChanged:Ar}),Gr+=eo.width+Hr});return}if(Ar==="width"&&Br==="column"){const Ur=zr.width-2*Lr,jr=(Cr.width-2*Lr)/Ur;Mr.forEach((Gr,Xr)=>{const Kr=basicFlexLogic.getPositionObjectForItem({id:Gr,ITEM_MAP:$r}),Zr={...Kr,x:basicFlexLogic.roundValue(Cr.x+Lr),width:basicFlexLogic.roundValue(Kr.width*jr)};updateLocalPositionForItem$2({id:Gr,newPosition:Zr,ITEM_MAP:$r,dimensionChanged:Ar})});return}if(Ar==="height"&&Br==="row"){Mr.forEach((Ur,Vr)=>{const Gr={...basicFlexLogic.getPositionObjectForItem({id:Ur,ITEM_MAP:$r}),y:basicFlexLogic.roundValue(Cr.y+Lr),height:basicFlexLogic.roundValue(Cr.height-2*Lr)};updateLocalPositionForItem$2({id:Ur,newPosition:Gr,ITEM_MAP:$r,dimensionChanged:Ar})});return}if(Ar==="height"&&Br==="column"){const Ur=Cr.height-2*Lr-(Mr.length-1)*Hr,Vr=Mr.map((Yr,Jr)=>basicFlexLogic.getMinHeightForItem({id:Yr,ITEM_MAP:$r})),jr=Yr=>Yr.reduce((Jr,no)=>Jr+no,0),Gr=jr(Vr);if(Ur-Gr<-.1)return;let Kr=jr(Mr.map((Yr,Jr)=>getLocalPositionForItem$2({id:Yr,ITEM_MAP:$r}).height));if(basicFlexLogic.closeBy(Ur,Kr))return;const Zr=Mr.map((Yr,Jr)=>getLocalPositionForItem$2({id:Yr,ITEM_MAP:$r}).height);Zr.forEach((Yr,Jr)=>{const no=basicFlexLogic.getMinHeightForItem({id:Mr[Jr],ITEM_MAP:$r});Yr=0;Yr-=1){const Jr=Mr[Yr],no=basicFlexLogic.getMinHeightForItem({id:Jr,ITEM_MAP:$r});let ro=Zr[Yr];if(eo!==0){const so=basicFlexLogic.roundValue(Math.max(no,ro+eo));eo-=basicFlexLogic.roundValue(so-ro),ro=so,Zr[Yr]=so}}let Wr=Cr.y+Lr;Mr.forEach((Yr,Jr)=>{const no=basicFlexLogic.getPositionObjectForItem({id:Yr,ITEM_MAP:$r,redoRootGroupCalc:!0}),ro=basicFlexLogic.roundValue(Zr[Jr]),so={...no,y:basicFlexLogic.roundValue(Wr),height:ro,x:basicFlexLogic.roundValue(Cr.x+Lr),width:basicFlexLogic.roundValue(Cr.width-2*Lr)};updateLocalPositionForItem$2({id:Yr,newPosition:so,ITEM_MAP:$r,dimensionChanged:Ar}),Wr+=ro+Hr});return}return}Rr.updatePositionObject({blockId:Tr,positionObject:{...Cr}})},changeHeightOfItem$1=({itemId:Tr,slideId:Cr,proposedHeight:$r,skipUpdatingItem:Ar,itemPositionOG:Rr,save:Dr=!1,maintainBlockHeights:Mr=!1})=>{var Wr;const Br=useBlockStore();usePageStore();const Nr=Cr??Br.parentId(Tr);if(!Nr)return;const Hr=useItemStore().data[Nr];if(!Hr[Tr])return;const Ur=basicFlexLogic.getParentGroupId({itemId:Tr,slideId:Nr});if(!Ur)return;const Vr=lodashExports.cloneDeep(Hr[Ur]),jr=(Vr.items??[]).indexOf(Tr);if(jr<0)return;const Gr=Vr.direction;if(!Gr)return;const Xr=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Ur,ITEM_MAP:Hr,redoRootGroupCalc:!0})),Kr=Vr.spacing??{padding:0,gap:0},Zr=(Kr==null?void 0:Kr.padding)??0,eo=(Kr==null?void 0:Kr.gap)??0;if(Gr==="row"){const Jr={...Rr??lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Tr,ITEM_MAP:Hr,redoRootGroupCalc:!0})),height:$r};Ar||(updateLocalPositionForItem$2({id:Tr,newPosition:Jr,ITEM_MAP:Hr,dimensionChanged:"height"}),Dr&&!Mr&&basicFlexLogic.setPositionObjectForItem({id:Tr,positionObject:Jr,ITEM_MAP:Hr}),Dr&&Mr&&basicFlexLogic.setPositionObjectForItemFromLocal({id:Tr,ITEM_MAP:Hr})),Vr.items.filter(no=>no!==Tr).forEach(no=>{const ro=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:no,ITEM_MAP:Hr})),so={...ro,height:$r};so.height!==ro.height&&(updateLocalPositionForItem$2({id:no,newPosition:so,ITEM_MAP:Hr,dimensionChanged:"height"}),Dr&&!Mr&&basicFlexLogic.setPositionObjectForItem({id:no,positionObject:so,ITEM_MAP:Hr}),Dr&&Mr&&basicFlexLogic.setPositionObjectForItemFromLocal({id:no,ITEM_MAP:Hr}))}),changeHeightOfItem$1({itemId:Ur,proposedHeight:$r+2*(((Wr=Vr.spacing)==null?void 0:Wr.padding)??0),itemPositionOG:Xr,skipUpdatingItem:!0,slideId:Nr,save:Dr,maintainBlockHeights:Mr});return}if(Gr==="column"){const Jr={...Rr??lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Tr,ITEM_MAP:Hr,redoRootGroupCalc:!0})),height:$r};Ar||(updateLocalPositionForItem$2({id:Tr,newPosition:Jr,ITEM_MAP:Hr,dimensionChanged:"height"}),Dr&&!Mr&&basicFlexLogic.setPositionObjectForItem({id:Tr,positionObject:Jr,ITEM_MAP:Hr}),Dr&&Mr&&basicFlexLogic.setPositionObjectForItemFromLocal({id:Tr,ITEM_MAP:Hr}));let no=Xr.y+Zr;Vr.items.slice(0,jr).forEach(ro=>{no+=basicFlexLogic.getPositionObjectForItem({id:ro,ITEM_MAP:Hr}).height+eo}),no+=$r+eo,Vr.items.slice(jr+1).forEach(ro=>{const ao={...lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:ro,ITEM_MAP:Hr})),y:basicFlexLogic.roundValue(no)};updateLocalPositionForItem$2({id:ro,newPosition:ao,ITEM_MAP:Hr,dimensionChanged:"height"}),Dr&&!Mr&&basicFlexLogic.setPositionObjectForItem({id:ro,positionObject:ao,ITEM_MAP:Hr}),Dr&&Mr&&basicFlexLogic.setPositionObjectForItemFromLocal({id:ro,ITEM_MAP:Hr}),no+=ao.height+eo}),changeHeightOfItem$1({itemId:Ur,proposedHeight:no-Xr.y+Zr-eo,itemPositionOG:Xr,skipUpdatingItem:!0,slideId:Nr,save:Dr,maintainBlockHeights:Mr})}},cleanup=()=>{const Tr=useArtboardStore();useBlockStore().isAnyBlockDragging||setTimeout(()=>{Tr.setBlockPositionChangeInProgress(!1)},basicFlexLogic.WAIT_TIME_FOR_BLOCK_RENDER_PAGE_LEVEL)},setup=()=>{useArtboardStore().setBlockPositionChangeInProgress(!0)};function canReduceGroupHeight({groupId:Tr,slideId:Cr}){var zr,Ur,Vr,jr,Gr;const Ar=useItemStore().data[Cr],Dr=Ar["g-h-0"];if(Dr==null)return!1;const Mr=Dr.items,Br=Mr.length===1&&Mr[0]===Tr,Nr=((zr=Ar[Tr])==null?void 0:zr.items)??[],Hr=Nr.reduce((Xr,Kr)=>Xr+basicFlexLogic.getPositionObjectForItem({id:Kr,ITEM_MAP:Ar}).height,0)+2*(((Vr=(Ur=Ar[Tr])==null?void 0:Ur.spacing)==null?void 0:Vr.padding)??0)+(Nr.length-1)*(((Gr=(jr=Ar[Tr])==null?void 0:jr.spacing)==null?void 0:Gr.gap)??0);return Br&&Hr>540}async function fitChildrenDynamically({groupId:Tr,slideId:Cr,groupPos:$r,skipWaiting:Ar=!1,addingNewBlock:Rr=!1,action:Dr=null,relevantBlockId:Mr=null,initialHeightForRelevantBlock:Br=null,maintainBlockHeights:Nr=!1}){var ro,so;const Lr=useItemStore(),Hr=usePageStore(),zr=useBlockStore(),Ur=Lr.data[Cr],Vr=Ur[Tr];if(Vr==null)return;const jr=Vr.direction,Gr=Vr.items,Xr=Vr.items,Kr=Vr.spacing||{padding:0,gap:0},Zr=Kr.padding||0,eo=Kr.gap||0,Wr=basicFlexLogic.isRootGroup({groupId:Tr,ITEM_MAP:Ur}),Yr=Wr&&$r.height>540||!Wr&&$r.height>516,Jr=Wr&&Gr.length<=1&&((ro=Hr.children(Cr))==null?void 0:ro.length)<=1&&Rr;log("***** addblock basic start ********",Gr.length,{...$r}),setup();const no=$r.height-2*Zr;if(jr==="row"){if(!Ar){const co=Gr.filter(So=>zr.type(So)==="divider"),mo=co.reduce((So,ko)=>So+basicFlexLogic.designMinWidth(ko),0),io=Gr.filter(So=>zr.type(So)!=="divider"),uo=$r.width-2*Zr-(Gr.length-1)*eo-mo,ho=io.length===0?basicFlexLogic.roundValue(($r.width-2*Zr-(Gr.length-1)*eo)/Gr.length):basicFlexLogic.roundValue(uo/io.length);let yo=$r.x+Zr;Gr.forEach((So,ko)=>{const $o=Ur[So];if($o==null)return;let Go=ho;io.length===0?Go=ho:co.includes(So)?Go=basicFlexLogic.designMinWidth(So):Go=ho,$o.x=yo,$o.width=Go,$o.height=no,$o.y=$r.y+Zr,yo+=Go+eo,log("addblock",{...$o}),updateLocalPositionForItem$2({id:So,newPosition:{x:$o.x,y:$o.y,width:$o.width,height:$o.height},ITEM_MAP:Ur,dimensionChanged:"width"}),Nr?basicFlexLogic.setPositionObjectForItemFromLocal({id:So,ITEM_MAP:Ur}):basicFlexLogic.setPositionObjectForItem({id:So,positionObject:{x:$o.x,y:$o.y,width:$o.width,height:$o.height},ITEM_MAP:Ur})})}!Ar&&!Jr&&(log("sleep",{groupId:Tr,groupPos:lodashExports.cloneDeep($r)}),await sleep(Rr?basicFlexLogic.WAIT_TIME_FOR_BLOCK_RENDER_AFTER_ADDING_BLOCK:basicFlexLogic.WAIT_TIME_FOR_BLOCK_RENDER));let ao=no,lo=0;Gr.forEach(co=>{const mo=basicFlexLogic.getMinHeightForItem({id:co,ITEM_MAP:Ur});lo=Math.max(lo,mo)});const go=(((so=basicFlexLogic.getPositionObjectForItem({id:"g-h-0",ITEM_MAP:Ur}))==null?void 0:so.height)??540)-$r.height+lo+2*Zr;if(lo>no||Yr&&!Rr&&go>=540?ao=lo:Yr&&!Rr&&go<540?ao=lo+(540-go):ao=no,basicFlexLogic.closeBy(ao,no)){cleanup();return}if(Gr.forEach(co=>{const mo=getLocalPositionForItem$2({id:co,ITEM_MAP:Ur});updateLocalPositionForItem$2({id:co,newPosition:{...mo,height:ao},ITEM_MAP:Ur,dimensionChanged:"height"}),log("addblock children refine height",{childId:co,pos:{...mo,height:ao}}),Nr?basicFlexLogic.setPositionObjectForItemFromLocal({id:co,ITEM_MAP:Ur}):basicFlexLogic.setPositionObjectForItem({id:co,positionObject:{...mo,height:ao},ITEM_MAP:Ur})}),basicFlexLogic.closeBy($r.height,ao+2*Zr)){cleanup();return}changeHeightOfItem$1({itemId:Tr,proposedHeight:ao+2*Zr,itemPositionOG:$r,skipUpdatingItem:!0,slideId:Cr,save:!0,maintainBlockHeights:Nr})}if(jr==="column"){let ao=$r.y+Zr;const lo=Gr.map((ho,yo)=>basicFlexLogic.getPositionObjectForItem({id:ho,ITEM_MAP:Ur}).height),po=lo.reduce((ho,yo)=>ho+yo,0),go=$r.height-2*Zr-(Gr.length-1)*eo;let co=basicFlexLogic.roundValue(go-po);const mo=Nr||canReduceGroupHeight({groupId:Tr,slideId:Cr})&&Dr==="remove";if(mo&&(co=0),!Ar){for(let ho=Xr.length-1;ho>=0;ho-=1){const yo=Xr[ho],So=basicFlexLogic.getMinHeightForItem({id:yo,ITEM_MAP:Ur});let ko=lo[ho];if(co!==0){const $o=basicFlexLogic.roundValue(Math.max(So,ko+co));co-=basicFlexLogic.roundValue($o-ko),ko=$o,lo[ho]=$o}}Xr.forEach((ho,yo)=>{const So=basicFlexLogic.getPositionObjectForItem({id:ho,ITEM_MAP:Ur,redoRootGroupCalc:!0}),ko=basicFlexLogic.roundValue(lo[yo]),$o={...So,y:basicFlexLogic.roundValue(ao),height:ko,x:basicFlexLogic.roundValue($r.x+Zr),width:basicFlexLogic.roundValue($r.width-2*Zr)};updateLocalPositionForItem$2({id:ho,newPosition:{x:$o.x,y:$o.y,width:$o.width,height:$o.height},ITEM_MAP:Ur,dimensionChanged:"height"}),Nr?basicFlexLogic.setPositionObjectForItemFromLocal({id:ho,ITEM_MAP:Ur}):basicFlexLogic.setPositionObjectForItem({id:ho,positionObject:{x:$o.x,y:$o.y,width:$o.width,height:$o.height},ITEM_MAP:Ur}),ao+=ko+eo})}!Ar&&!Jr&&(log("sleep",{groupId:Tr,groupPos:lodashExports.cloneDeep($r)}),await sleep(Rr?basicFlexLogic.WAIT_TIME_FOR_BLOCK_RENDER_AFTER_ADDING_BLOCK:basicFlexLogic.WAIT_TIME_FOR_BLOCK_RENDER));let io=0,uo=$r.y+Zr;if(Gr.forEach((ho,yo)=>{const So=basicFlexLogic.getMinHeightForItem({id:ho,ITEM_MAP:Ur,maintainBlockHeights:Nr}),ko=Mr!=null&&Mr===ho?Math.max(Math.min(getMinHeightForRelevantBlock({relevantBlockId:Mr}),Br??getMinHeightForRelevantBlock({relevantBlockId:Mr})),So):So,$o=getLocalPositionForItem$2({id:ho,ITEM_MAP:Ur}),Go=$o.height;let No=basicFlexLogic.roundValue(Math.max(ko,Go));yo===Gr.length-1&&!mo&&(No=Math.max($r.y+$r.height-uo-Zr,No)),log("addblock groupPos child data after render",{...$o,minHAbsolute:So,childId:ho,height:No,minH:ko,currentChildHeight:Go,isTallGroup:Yr,groupId:Tr,isRootGroup:Wr,groupH:$r.height}),updateLocalPositionForItem$2({id:ho,newPosition:{...$o,height:No,y:basicFlexLogic.roundValue(uo)},ITEM_MAP:Ur,dimensionChanged:"height"}),Nr?basicFlexLogic.setPositionObjectForItemFromLocal({id:ho,ITEM_MAP:Ur}):basicFlexLogic.setPositionObjectForItem({id:ho,positionObject:{...$o,height:No,y:basicFlexLogic.roundValue(uo)},ITEM_MAP:Ur}),uo+=No+eo,io+=No}),basicFlexLogic.closeBy($r.height,io+2*Zr+(Gr.length-1)*eo)){cleanup();return}changeHeightOfItem$1({itemId:Tr,proposedHeight:io+2*Zr+(Gr.length-1)*eo,itemPositionOG:$r,skipUpdatingItem:!0,slideId:Cr,save:!0,maintainBlockHeights:Nr})}cleanup()}const fixSlideIfRequired$1=async({slideId:Tr,addingNewBlock:Cr=!1,maintainBlockHeights:$r=!1})=>{const Ar=usePageStore(),Dr=useItemStore().data[Tr];if(!Ar.pageObject(Tr).id)return;const Br=Ar.children(Tr),Nr=Hr=>basicFlexLogic.getMinHeightForItem({id:Hr,ITEM_MAP:Dr})>basicFlexLogic.getPositionObjectForItem({id:Hr,ITEM_MAP:Dr}).height,Lr=[];for(let Hr=0;Hr=basicFlexLogic.MAX_ITEMS_PER_ROW||Mr==="column"&&Br.length>=basicFlexLogic.MAX_ITEMS_PER_COLUMN)}function shouldCreateNewGroup({itemId:Tr,dropId:Cr,slideId:$r,edge:Ar}){const Rr=getDirectionForItem({id:Cr,slideId:$r});return Rr==null?!1:Rr==="row"&&(Ar==="top"||Ar==="bottom")||Rr==="column"&&(Ar==="left"||Ar==="right")}async function createGroupOutOf2Items({blockId:Tr,dropId:Cr,edge:$r,direction:Ar,slideId:Rr}){var Gr;const Mr=useItemStore().data[Rr],Br=groupFlexLogic.getGroupIdUUID();if(Mr[Br]!=null)return;const Nr=groupFlexLogic.isRootGroup({groupId:Cr,ITEM_MAP:Mr});let Lr=[Tr,Cr];($r==="bottom"||$r==="right")&&(Lr=[Cr,Tr]);const Hr=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Cr,ITEM_MAP:Mr,redoRootGroupCalc:!0})),zr=Mr[Cr].groupId,Ur=basicFlexLogic.getSlideSpacing({slideId:Rr});if(Nr&&Mr[Cr].items.length>1){const Xr=groupFlexLogic.getGroupIdUUID();if(Mr[Xr]!=null)return;Mr[Xr]={...Mr[Cr],groupId:Br,spacing:{padding:0,gap:Ur}},Mr[Xr].items.forEach(Kr=>{Mr[Kr].groupId=Xr}),Mr[Br]={direction:Ar,items:$r==="bottom"||$r==="right"?[Xr,Tr]:[Tr,Xr],type:"group",groupId:Cr,spacing:{padding:0,gap:Ur},x:Ur,y:Ur,width:Hr.width-2*Ur,height:Hr.height-2*Ur},Mr[Tr].groupId=Br,Mr[Cr].items=[Br],log({dropPosition:Hr,newGroupIdString:Br,replacementForRootGroupIdString:Xr,ITEM_MAP:lodashExports.cloneDeep(Mr)}),await groupSize.fitChildrenDynamically({groupId:Br,slideId:Rr,groupPos:{x:Hr.x+Ur,y:Hr.y+Ur,width:Hr.width-2*Ur,height:Hr.height-2*Ur}});return}if(Nr&&Mr[Cr].items.length<=1){const Xr=Mr[Cr].items;if(Xr.length===0||!Mr[Xr[0]])return;Mr[Br]={direction:Ar,items:$r==="bottom"||$r==="right"?[Xr[0],Tr]:[Tr,Xr[0]],type:"group",groupId:Cr,spacing:{padding:0,gap:Ur},x:Ur,y:Ur,width:Hr.width-2*Ur,height:Hr.height-2*Ur},Mr[Tr].groupId=Br,Mr[Cr].items=[Br],Mr[Xr[0]].groupId=Br,log({dropPosition:Hr,newGroupIdString:Br,ITEM_MAP:lodashExports.cloneDeep(Mr)}),await groupSize.fitChildrenDynamically({groupId:Br,slideId:Rr,groupPos:{x:Hr.x+Ur,y:Hr.y+Ur,width:Hr.width-2*Ur,height:Hr.height-2*Ur}});return}if(Mr[Br]={direction:Ar,items:Lr,type:"group",groupId:zr,spacing:{padding:0,gap:Ur},...Hr},Lr.forEach(Xr=>{Mr[Xr].groupId=Br}),log({ITEM_MAP:lodashExports.cloneDeep(Mr)}),zr==null){await groupSize.fitChildrenDynamically({groupId:Br,slideId:Rr,groupPos:Hr});return}const jr=(((Gr=Mr[zr])==null?void 0:Gr.items)??[]).indexOf(Cr);if(jr===-1){await groupSize.fitChildrenDynamically({groupId:Br,slideId:Rr,groupPos:Hr});return}Mr[zr].items[jr]=Br,await groupSize.fitChildrenDynamically({groupId:Br,slideId:Rr,groupPos:Hr})}async function createGroupWhenDroppingOnBottomEdge({blockId:Tr,slideId:Cr}){const Ar=useItemStore().data[Cr],Rr=groupFlexLogic.getGroupIdUUID();if(Ar[Rr]!=null)return;const Dr="g-h-0",Mr=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Dr,ITEM_MAP:Ar,redoRootGroupCalc:!0})),Br=basicFlexLogic.getSlideSpacing({slideId:Cr});if(Ar[Dr].items.length>1){const Nr=groupFlexLogic.getGroupIdUUID();if(Ar[Nr]!=null)return;Ar[Nr]={...Ar[Dr],groupId:Rr,spacing:{padding:0,gap:Br}},Ar[Nr].items.forEach(Lr=>{Ar[Lr].groupId=Nr}),Ar[Rr]={direction:"column",items:[Nr,Tr],type:"group",groupId:Dr,spacing:{padding:0,gap:Br},x:Br,y:Br,width:Mr.width-2*Br,height:Mr.height+basicFlexLogic.designHeightToUseWhenAddingBlock(Tr)+Br-2*Br},Ar[Dr].items=[Rr],log({dropPosition:Mr,newGroupIdString:Rr,replacementForRootGroupIdString:Nr,ITEM_MAP:lodashExports.cloneDeep(Ar)}),Ar[Tr]={...Ar[Tr],x:Mr.x+Br,y:Mr.y+Mr.height,width:Mr.width-2*Br,height:basicFlexLogic.designHeightToUseWhenAddingBlock(Tr),groupId:Rr};return}if(Ar[Dr].items.length<=1){const Nr=Ar[Dr].items;if(Nr.length===0||!Ar[Nr[0]])return;Ar[Rr]={direction:"column",items:[Nr[0],Tr],type:"group",groupId:Dr,spacing:{padding:0,gap:Br},x:Br,y:Br,width:Mr.width-2*Br,height:Mr.height-2*Br},Ar[Dr].items=[Rr],Ar[Nr[0]].groupId=Rr,log({dropPosition:Mr,newGroupIdString:Rr,ITEM_MAP:lodashExports.cloneDeep(Ar)}),Ar[Tr]={...Ar[Tr],x:Mr.x+Br,y:Mr.y+Mr.height,width:Mr.width-2*Br,height:basicFlexLogic.designHeightToUseWhenAddingBlock(Tr),groupId:Rr};return}}async function addToColumnWhenDroppingOnBottomEdge({blockId:Tr,slideId:Cr,groupId:$r}){const Rr=useItemStore().data[Cr],Dr=groupFlexLogic.getGroupIdUUID();if(Rr[Dr]!=null)return;const Mr=$r,Br=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Mr,ITEM_MAP:Rr,redoRootGroupCalc:!0}));basicFlexLogic.getSlideSpacing({slideId:Cr});const Nr=basicFlexLogic.getGroupSpacing({groupId:Mr,slideId:Cr}),Lr=Nr.padding??0,Hr=Nr.gap??0;Rr[Tr]={...Rr[Tr],x:Br.x+Lr,y:Br.y+Br.height+Hr,width:Br.width,height:basicFlexLogic.designHeightToUseWhenAddingBlock(Tr),groupId:Mr},Rr[Mr].items=[...Rr[Mr].items??[],Tr]}async function dropOnBottomEdgeOfLongSlide({blockId:Tr,slideId:Cr}){var Mr;const Ar=useItemStore().data[Cr],Rr=groupFlexLogic.getRootGroupId({ITEM_MAP:Ar})??"g-h-0",Dr=Ar[Rr];if(groupSize.setup(),((Mr=Dr==null?void 0:Dr.items)==null?void 0:Mr.length)===1){const Br=Dr.items[0],Nr=Ar[Br];return(Nr==null?void 0:Nr.type)==="group"&&(Nr==null?void 0:Nr.direction)==="column"?(await addToColumnWhenDroppingOnBottomEdge({blockId:Tr,slideId:Cr,groupId:Br}),groupSize.cleanup(),{positionObject:{x:Ar[Tr].x,y:Ar[Tr].y,width:Ar[Tr].width,height:Ar[Tr].height}}):(await createGroupWhenDroppingOnBottomEdge({blockId:Tr,slideId:Cr}),groupSize.cleanup(),{positionObject:{x:Ar[Tr].x,y:Ar[Tr].y,width:Ar[Tr].width,height:Ar[Tr].height}})}return await createGroupWhenDroppingOnBottomEdge({blockId:Tr,slideId:Cr}),groupSize.cleanup(),{positionObject:{x:Ar[Tr].x,y:Ar[Tr].y,width:Ar[Tr].width,height:Ar[Tr].height}}}async function addItemToGroup({itemId:Tr,groupId:Cr,index:$r=-1,slideId:Ar,addingNewBlock:Rr=!1}){const Mr=useItemStore().data[Ar];if(Tr==null||Cr==null)return{items:[]};if(Mr[Tr]==null)return{items:[]};if(Mr[Cr]==null||!groupFlexLogic.isGroup({id:Cr}))return{items:[]};const Br=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Cr,ITEM_MAP:Mr,redoRootGroupCalc:!0}));groupFlexLogic.isRootGroup({groupId:Cr,ITEM_MAP:Mr})&&(Br.x=0,Br.y=0,Br.width=960,Mr[Cr].items.length===0&&(Br.height=540)),Mr[Tr].groupId=Cr,$r===-1?Mr[Cr].items.push(Tr):Mr[Cr].items.splice($r,0,Tr),log({groupPos:Br,items:Mr[Cr].items});const Lr=useBlockStore().type(Tr);let Hr=null;Lr==="divider"&&(Hr=Tr),await groupSize.fitChildrenDynamically({groupId:Cr,slideId:Ar,groupPos:Br,addingNewBlock:Rr,relevantBlockId:Hr})}function dissolveGroupIfNeeded({groupId:Tr,slideId:Cr}){if(!shouldDissolveGroup({groupId:Tr,slideId:Cr}))return;const Ar=useItemStore().data[Cr],Dr=Ar[Tr].groupId,Mr=getIndexOfItemInGroup({id:Tr,groupId:Dr,slideId:Cr}),Br=lodashExports.cloneDeep(Ar[Tr].items);Br.forEach(Nr=>{Ar[Nr].groupId=Dr}),Mr>-1&&Ar[Dr].items.splice(Mr,1,...Br),delete Ar[Tr],log({ITEM_MAP:lodashExports.cloneDeep(Ar)}),Br.forEach(Nr=>{dissolveGroupIfNeeded({groupId:Nr,slideId:Cr})}),dissolveGroupIfNeeded({groupId:Dr,slideId:Cr})}async function removeItemFromGroup({itemId:Tr,groupId:Cr,slideId:$r,deleteItem:Ar=!1,dissolveGroup:Rr=!0}){const Mr=useItemStore().data[$r];if(Tr==null||Cr==null)return{items:[]};if(Mr[Tr]==null)return{items:[]};if(Mr[Cr]==null||!groupFlexLogic.isGroup({id:Cr}))return{items:[]};const Br=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Cr,ITEM_MAP:Mr,redoRootGroupCalc:!0}));groupFlexLogic.isRootGroup({groupId:Cr,ITEM_MAP:Mr})&&(Br.x=0,Br.y=0,Br.width=960,Mr[Cr].items.length===0&&(Br.height=540));const Nr=lodashExports.cloneDeep(Mr[Tr].items);return Mr[Cr].items=Mr[Cr].items.filter(Lr=>Lr!==Tr),Mr[Tr].groupId=null,Ar&&delete Mr[Tr],await groupSize.fitChildrenDynamically({groupId:Cr,slideId:$r,groupPos:Br,addingNewBlock:Ar,action:Ar?"remove":"rearrange"}),Rr&&dissolveGroupIfNeeded({groupId:Cr,slideId:$r}),{items:Nr}}async function dropBlockAtNewPosition({blockId:Tr,dropzoneId:Cr,slideId:$r}){if(Cr==null)return;const[Ar,Rr]=Cr.split(":");if(Rr!=="right"&&Rr!=="left"&&Rr!=="top"&&Rr!=="bottom"||Tr===Ar||basicFlexLogic.isBlockAlreadyInCorrectPlace({blockId:Tr,dropId:Ar,direction:Rr}))return;const Dr=useItemStore(),Mr=Dr.data[$r];if(Mr==null||Mr[Tr]==null||Mr[Ar]==null)return;const Br=useBlockStore(),Nr=usePageStore(),Lr=Br.getAffectedBlocks(Nr.children($r)),Hr=lodashExports.cloneDeep(Nr.pageObject($r)),zr=basicFlexLogic.getPositionObjectForItem({id:Tr,ITEM_MAP:Mr}).height,Ur=lodashExports.cloneDeep(Mr[Tr]).groupId;await removeItemFromGroup({itemId:Tr,groupId:Mr[Tr].groupId,slideId:$r,dissolveGroup:!1});const Vr=groupFlexLogic.isRootGroup({groupId:Ar,ITEM_MAP:Mr}),jr=Mr[Ar].groupId,Gr=Vr?0:getIndexOfItemInGroup({id:Ar,groupId:jr,slideId:$r}),Xr=Rr==="right"||Rr==="bottom"?Gr+1:Gr;if(shouldCreateNewGroup({itemId:Tr,dropId:Ar,slideId:$r,edge:Rr})){const Zr=basicFlexLogic.getCounterDirection(Vr?Mr[Ar].direction:Mr[jr].direction);await createGroupOutOf2Items({blockId:Tr,dropId:Ar,edge:Rr,direction:Zr,slideId:$r})}else await addItemToGroup({itemId:Tr,groupId:jr,index:Xr,slideId:$r});return dissolveGroupIfNeeded({groupId:Ur,slideId:$r}),jr!=null&&dissolveGroupIfNeeded({groupId:jr,slideId:$r}),await groupSize.fitChildrenDynamically({groupId:Mr[Tr].groupId,slideId:$r,groupPos:basicFlexLogic.getPositionObjectForItem({id:Mr[Tr].groupId,ITEM_MAP:Mr,redoRootGroupCalc:!0}),skipWaiting:!0,relevantBlockId:Tr,initialHeightForRelevantBlock:zr}),await groupSize.fixSlideIfRequired({slideId:$r}),Nr.pushGroupStateToDB({slideId:$r,originalBlocks:Lr,originalSlide:Hr}),Dr.data[$r]}async function addNewBlockToSlide({blockId:Tr,slideId:Cr,duplicating:$r=!1,groupIdForNewBlock:Ar=null,indexInGroup:Rr=-1}){const Dr=useItemStore(),Mr=usePageStore(),Br=useBlockStore(),Nr=Dr.data[Cr];if(Nr==null)return{positionObject:{x:0,y:0,width:basicFlexLogic.GET_MAX_WIDTH({slideId:Cr}),height:basicFlexLogic.GET_MAX_HEIGHT({slideId:Cr})}};const Lr=groupFlexLogic.getRootGroupId({ITEM_MAP:Nr});if(Lr==null)return{positionObject:{x:0,y:0,width:basicFlexLogic.GET_MAX_WIDTH({slideId:Cr}),height:basicFlexLogic.GET_MAX_HEIGHT({slideId:Cr})}};Nr[Tr]={type:"block",x:0,y:0,width:0,height:0,groupId:null};const Hr=Ar??Lr,zr=basicFlexLogic.getPositionObjectForItem({id:Lr,ITEM_MAP:Nr}),Ur=Br.type(Tr);return Ar==null&&!$r&&zr.height>540?{...await dropOnBottomEdgeOfLongSlide({blockId:Tr,slideId:Cr}),skipFixingSlide:!1}:Ar==null&&!$r&&Ur==="divider"&&Mr.children(Cr).length>0?{...await dropOnBottomEdgeOfLongSlide({blockId:Tr,slideId:Cr}),skipFixingSlide:!1}:(await addItemToGroup({itemId:Tr,groupId:Hr,index:Rr??-1,slideId:Cr,addingNewBlock:!0}),log("addblock new block",{pos:lodashExports.cloneDeep(Nr[Tr]),blockId:Tr}),{positionObject:{x:Nr[Tr].x,y:Nr[Tr].y,width:Nr[Tr].width,height:Nr[Tr].height}})}async function deleteBlockFromSlideGroup({blockId:Tr,slideId:Cr}){var Dr;const $r=useItemStore(),Ar=$r.data[Cr];if(Ar==null)return;const Rr=(Dr=Ar[Tr])==null?void 0:Dr.groupId;return await removeItemFromGroup({itemId:Tr,groupId:Rr,slideId:Cr,deleteItem:!0}),$r.data[Cr]}function updateBlockPositionsWithNewSpacing({slideId:Tr,newSpacing:Cr,oldSpacing:$r,save:Ar=!1}){const Dr=useItemStore().data[Tr],Mr=groupFlexLogic.getRootGroupId({ITEM_MAP:Dr});if(Mr==null)return;const Br=[...groupFlexLogic.getGroupIds({ITEM_MAP:Dr}).filter(Ur=>Ur!==Mr)],Nr=useBlockStore(),Lr=usePageStore(),Hr=Nr.getAffectedBlocks(Lr.children(Tr)),zr=lodashExports.cloneDeep(Lr.pageObject(Tr));log({rootGroupId:Mr,allGroupIds:Br,slideId:Tr,newSpacing:Cr,oldSpacing:$r,ITEM_MAP:lodashExports.cloneDeep(Dr)}),basicFlexLogic.adjustItemsWithNewSpacing({id:Mr,positionObject:{x:0,y:0,width:960,height:540},ITEM_MAP:Dr,oldSpacing:{padding:$r,gap:$r},newSpacing:{padding:Cr,gap:Cr}}),basicFlexLogic.setGroupSpacing({groupId:Mr,slideId:Tr,padding:Cr,gap:Cr}),Br.forEach(Ur=>{basicFlexLogic.setGroupSpacing({groupId:Ur,slideId:Tr,padding:0,gap:Cr})}),Ar&&Lr.pushGroupStateToDB({slideId:Tr,originalBlocks:Hr,originalSlide:zr})}const groupCRUD={getIndexOfItemInGroup,shouldDissolveGroup,removeItemFromGroup,addItemToGroup,dropBlockAtNewPosition,addNewBlockToSlide,canAddBlockToGroup,deleteBlockFromSlideGroup,updateBlockPositionsWithNewSpacing},e$4=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,t$4=Object.keys,n$7=Array.isArray;function r$5(Tr,Cr){return typeof Cr!="object"||t$4(Cr).forEach(function($r){Tr[$r]=Cr[$r]}),Tr}typeof Promise>"u"||e$4.Promise||(e$4.Promise=Promise);const s$3=Object.getPrototypeOf,i$6={}.hasOwnProperty;function o$4(Tr,Cr){return i$6.call(Tr,Cr)}function a$6(Tr,Cr){typeof Cr=="function"&&(Cr=Cr(s$3(Tr))),(typeof Reflect>"u"?t$4:Reflect.ownKeys)(Cr).forEach($r=>{l$5(Tr,$r,Cr[$r])})}const u$8=Object.defineProperty;function l$5(Tr,Cr,$r,Ar){u$8(Tr,Cr,r$5($r&&o$4($r,"get")&&typeof $r.get=="function"?{get:$r.get,set:$r.set,configurable:!0}:{value:$r,configurable:!0,writable:!0},Ar))}function c$5(Tr){return{from:function(Cr){return Tr.prototype=Object.create(Cr.prototype),l$5(Tr.prototype,"constructor",Tr),{extend:a$6.bind(null,Tr.prototype)}}}}const h$2=Object.getOwnPropertyDescriptor;function d$7(Tr,Cr){let $r;return h$2(Tr,Cr)||($r=s$3(Tr))&&d$7($r,Cr)}const f$6=[].slice;function p$6(Tr,Cr,$r){return f$6.call(Tr,Cr,$r)}function y$4(Tr,Cr){return Cr(Tr)}function m$6(Tr){if(!Tr)throw new Error("Assertion Failed")}function v$5(Tr){e$4.setImmediate?setImmediate(Tr):setTimeout(Tr,0)}function g$5(Tr,Cr){return Tr.reduce(($r,Ar,Rr)=>{var Dr=Cr(Ar,Rr);return Dr&&($r[Dr[0]]=Dr[1]),$r},{})}function b$5(Tr,Cr){if(o$4(Tr,Cr))return Tr[Cr];if(!Cr)return Tr;if(typeof Cr!="string"){for(var $r=[],Ar=0,Rr=Cr.length;Ar["Int","Uint","Float"].map(Cr=>Cr+Tr+"Array")))).filter(Tr=>e$4[Tr]),P$6=E$4.map(Tr=>e$4[Tr]);g$5(E$4,Tr=>[Tr,!0]);let K$2=null;function O$3(Tr){K$2=typeof WeakMap<"u"&&new WeakMap;const Cr=S$5(Tr);return K$2=null,Cr}function S$5(Tr){if(!Tr||typeof Tr!="object")return Tr;let Cr=K$2&&K$2.get(Tr);if(Cr)return Cr;if(n$7(Tr)){Cr=[],K$2&&K$2.set(Tr,Cr);for(var $r=0,Ar=Tr.length;$r=0)Cr=Tr;else{const Dr=s$3(Tr);for(var Rr in Cr=Dr===Object.prototype?{}:Object.create(Dr),K$2&&K$2.set(Tr,Cr),Tr)o$4(Tr,Rr)&&(Cr[Rr]=S$5(Tr[Rr]))}return Cr}const{toString:A$3}={};function C$3(Tr){return A$3.call(Tr).slice(8,-1)}const j$1=typeof Symbol<"u"?Symbol.iterator:"@@iterator",D$2=typeof j$1=="symbol"?function(Tr){var Cr;return Tr!=null&&(Cr=Tr[j$1])&&Cr.apply(Tr)}:function(){return null},I$1={};function B$2(Tr){var Cr,$r,Ar,Rr;if(arguments.length===1){if(n$7(Tr))return Tr.slice();if(this===I$1&&typeof Tr=="string")return[Tr];if(Rr=D$2(Tr)){for($r=[];!(Ar=Rr.next()).done;)$r.push(Ar.value);return $r}if(Tr==null)return[Tr];if(typeof(Cr=Tr.length)=="number"){for($r=new Array(Cr);Cr--;)$r[Cr]=Tr[Cr];return $r}return[Tr]}for(Cr=arguments.length,$r=new Array(Cr);Cr--;)$r[Cr]=arguments[Cr];return $r}const T$4=typeof Symbol<"u"?Tr=>Tr[Symbol.toStringTag]==="AsyncFunction":()=>!1;var R$3=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function F$3(Tr,Cr){R$3=Tr,M$1=Cr}var M$1=()=>!0;const N$2=!new Error("").stack;function q$2(){if(N$2)try{throw q$2.arguments,new Error}catch(Tr){return Tr}return new Error}function $(Tr,Cr){var $r=Tr.stack;return $r?(Cr=Cr||0,$r.indexOf(Tr.name)===0&&(Cr+=(Tr.name+Tr.message).split(` `).length),$r.split(` `).slice(Cr).filter(M$1).map(Ar=>` `+Ar).join("")):""}var U$3=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],L$5=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(U$3),V={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function W$3(Tr,Cr){this._e=q$2(),this.name=Tr,this.message=Cr}function Y$1(Tr,Cr){return Tr+". Errors: "+Object.keys(Cr).map($r=>Cr[$r].toString()).filter(($r,Ar,Rr)=>Rr.indexOf($r)===Ar).join(` `)}function z$1(Tr,Cr,$r,Ar){this._e=q$2(),this.failures=Cr,this.failedKeys=Ar,this.successCount=$r,this.message=Y$1(Tr,Cr)}function G$1(Tr,Cr){this._e=q$2(),this.name="BulkError",this.failures=Object.keys(Cr).map($r=>Cr[$r]),this.failuresByPos=Cr,this.message=Y$1(Tr,Cr)}c$5(W$3).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+$(this._e,2))}},toString:function(){return this.name+": "+this.message}}),c$5(z$1).from(W$3),c$5(G$1).from(W$3);var H$3=L$5.reduce((Tr,Cr)=>(Tr[Cr]=Cr+"Error",Tr),{});const Q$2=W$3;var X$2=L$5.reduce((Tr,Cr)=>{var $r=Cr+"Error";function Ar(Rr,Dr){this._e=q$2(),this.name=$r,Rr?typeof Rr=="string"?(this.message=`${Rr}${Dr?` `+Dr:""}`,this.inner=Dr||null):typeof Rr=="object"&&(this.message=`${Rr.name} ${Rr.message}`,this.inner=Rr):(this.message=V[Cr]||$r,this.inner=null)}return c$5(Ar).from(Q$2),Tr[Cr]=Ar,Tr},{});X$2.Syntax=SyntaxError,X$2.Type=TypeError,X$2.Range=RangeError;var J$2=U$3.reduce((Tr,Cr)=>(Tr[Cr+"Error"]=X$2[Cr],Tr),{}),Z$3=L$5.reduce((Tr,Cr)=>(["Syntax","Type","Range"].indexOf(Cr)===-1&&(Tr[Cr+"Error"]=X$2[Cr]),Tr),{});function ee$1(){}function te$1(Tr){return Tr}function ne$3(Tr,Cr){return Tr==null||Tr===te$1?Cr:function($r){return Cr(Tr($r))}}function re$2(Tr,Cr){return function(){Tr.apply(this,arguments),Cr.apply(this,arguments)}}function se$2(Tr,Cr){return Tr===ee$1?Cr:function(){var $r=Tr.apply(this,arguments);$r!==void 0&&(arguments[0]=$r);var Ar=this.onsuccess,Rr=this.onerror;this.onsuccess=null,this.onerror=null;var Dr=Cr.apply(this,arguments);return Ar&&(this.onsuccess=this.onsuccess?re$2(Ar,this.onsuccess):Ar),Rr&&(this.onerror=this.onerror?re$2(Rr,this.onerror):Rr),Dr!==void 0?Dr:$r}}function ie$3(Tr,Cr){return Tr===ee$1?Cr:function(){Tr.apply(this,arguments);var $r=this.onsuccess,Ar=this.onerror;this.onsuccess=this.onerror=null,Cr.apply(this,arguments),$r&&(this.onsuccess=this.onsuccess?re$2($r,this.onsuccess):$r),Ar&&(this.onerror=this.onerror?re$2(Ar,this.onerror):Ar)}}function oe$2(Tr,Cr){return Tr===ee$1?Cr:function($r){var Ar=Tr.apply(this,arguments);r$5($r,Ar);var Rr=this.onsuccess,Dr=this.onerror;this.onsuccess=null,this.onerror=null;var Mr=Cr.apply(this,arguments);return Rr&&(this.onsuccess=this.onsuccess?re$2(Rr,this.onsuccess):Rr),Dr&&(this.onerror=this.onerror?re$2(Dr,this.onerror):Dr),Ar===void 0?Mr===void 0?void 0:Mr:r$5(Ar,Mr)}}function ae$1(Tr,Cr){return Tr===ee$1?Cr:function(){return Cr.apply(this,arguments)!==!1&&Tr.apply(this,arguments)}}function ue$1(Tr,Cr){return Tr===ee$1?Cr:function(){var $r=Tr.apply(this,arguments);if($r&&typeof $r.then=="function"){for(var Ar=this,Rr=arguments.length,Dr=new Array(Rr);Rr--;)Dr[Rr]=arguments[Rr];return $r.then(function(){return Cr.apply(Ar,Dr)})}return Cr.apply(this,arguments)}}Z$3.ModifyError=z$1,Z$3.DexieError=W$3,Z$3.BulkError=G$1;var le$4={};const ce$3=100,[he$2,de$3,fe$2]=typeof Promise>"u"?[]:(()=>{let Tr=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[Tr,s$3(Tr),Tr];const Cr=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[Cr,s$3(Cr),Tr]})(),pe$3=de$3&&de$3.then,ye$1=he$2&&he$2.constructor,me$2=!!fe$2;var ve$2=!1,ge$4=fe$2?()=>{fe$2.then($e$1)}:e$4.setImmediate?setImmediate.bind(null,$e$1):e$4.MutationObserver?()=>{var Tr=document.createElement("div");new MutationObserver(()=>{$e$1(),Tr=null}).observe(Tr,{attributes:!0}),Tr.setAttribute("i","1")}:()=>{setTimeout($e$1,0)},be$2=function(Tr,Cr){Se$3.push([Tr,Cr]),we$1&&(ge$4(),we$1=!1)},_e$2=!0,we$1=!0,xe=[],ke=[],Ee$1=null,Pe$2=te$1,Ke={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:dt$1,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(Tr=>{try{dt$1(Tr[0],Tr[1])}catch{}})}},Oe=Ke,Se$3=[],Ae$2=0,Ce$1=[];function je$1(Tr){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=ee$1,this._lib=!1;var Cr=this._PSD=Oe;if(R$3&&(this._stackHolder=q$2(),this._prev=null,this._numPrev=0),typeof Tr!="function"){if(Tr!==le$4)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Te$2(this,this._value))}this._state=null,this._value=null,++Cr.ref,Be$2(this,Tr)}const De={get:function(){var Tr=Oe,Cr=Xe;function $r(Ar,Rr){var Dr=!Tr.global&&(Tr!==Oe||Cr!==Xe);const Mr=Dr&&!tt$2();var Br=new je$1((Nr,Lr)=>{Fe$1(this,new Ie(lt$2(Ar,Tr,Dr,Mr),lt$2(Rr,Tr,Dr,Mr),Nr,Lr,Tr))});return R$3&&qe(Br,this),Br}return $r.prototype=le$4,$r},set:function(Tr){l$5(this,"then",Tr&&Tr.prototype===le$4?De:{get:function(){return Tr},set:De.set})}};function Ie(Tr,Cr,$r,Ar,Rr){this.onFulfilled=typeof Tr=="function"?Tr:null,this.onRejected=typeof Cr=="function"?Cr:null,this.resolve=$r,this.reject=Ar,this.psd=Rr}function Be$2(Tr,Cr){try{Cr($r=>{if(Tr._state===null){if($r===Tr)throw new TypeError("A promise cannot be resolved with itself.");var Ar=Tr._lib&&Ue();$r&&typeof $r.then=="function"?Be$2(Tr,(Rr,Dr)=>{$r instanceof je$1?$r._then(Rr,Dr):$r.then(Rr,Dr)}):(Tr._state=!0,Tr._value=$r,Re$1(Tr)),Ar&&Le()}},Te$2.bind(null,Tr))}catch($r){Te$2(Tr,$r)}}function Te$2(Tr,Cr){if(ke.push(Cr),Tr._state===null){var $r=Tr._lib&&Ue();Cr=Pe$2(Cr),Tr._state=!1,Tr._value=Cr,R$3&&Cr!==null&&typeof Cr=="object"&&!Cr._promise&&function(Ar,Rr,Dr){try{Ar.apply(null,Dr)}catch(Mr){Rr&&Rr(Mr)}}(()=>{var Ar=d$7(Cr,"stack");Cr._promise=Tr,l$5(Cr,"stack",{get:()=>ve$2?Ar&&(Ar.get?Ar.get.apply(Cr):Ar.value):Tr.stack})}),function(Ar){xe.some(Rr=>Rr._value===Ar._value)||xe.push(Ar)}(Tr),Re$1(Tr),$r&&Le()}}function Re$1(Tr){var Cr=Tr._listeners;Tr._listeners=[];for(var $r=0,Ar=Cr.length;$r{--Ae$2==0&&Ve()},[]))}function Fe$1(Tr,Cr){if(Tr._state!==null){var $r=Tr._state?Cr.onFulfilled:Cr.onRejected;if($r===null)return(Tr._state?Cr.resolve:Cr.reject)(Tr._value);++Cr.psd.ref,++Ae$2,be$2(Me$1,[$r,Tr,Cr])}else Tr._listeners.push(Cr)}function Me$1(Tr,Cr,$r){try{Ee$1=Cr;var Ar,Rr=Cr._value;Cr._state?Ar=Tr(Rr):(ke.length&&(ke=[]),Ar=Tr(Rr),ke.indexOf(Rr)===-1&&function(Dr){for(var Mr=xe.length;Mr;)if(xe[--Mr]._value===Dr._value)return void xe.splice(Mr,1)}(Cr)),$r.resolve(Ar)}catch(Dr){$r.reject(Dr)}finally{Ee$1=null,--Ae$2==0&&Ve(),--$r.psd.ref||$r.psd.finalize()}}function Ne$1(Tr,Cr,$r){if(Cr.length===$r)return Cr;var Ar="";if(Tr._state===!1){var Rr,Dr,Mr=Tr._value;Mr!=null?(Rr=Mr.name||"Error",Dr=Mr.message||Mr,Ar=$(Mr,0)):(Rr=Mr,Dr=""),Cr.push(Rr+(Dr?": "+Dr:"")+Ar)}return R$3&&((Ar=$(Tr._stackHolder,2))&&Cr.indexOf(Ar)===-1&&Cr.push(Ar),Tr._prev&&Ne$1(Tr._prev,Cr,$r)),Cr}function qe(Tr,Cr){var $r=Cr?Cr._numPrev+1:0;$r<100&&(Tr._prev=Cr,Tr._numPrev=$r)}function $e$1(){Ue()&&Le()}function Ue(){var Tr=_e$2;return _e$2=!1,we$1=!1,Tr}function Le(){var Tr,Cr,$r;do for(;Se$3.length>0;)for(Tr=Se$3,Se$3=[],$r=Tr.length,Cr=0;Cr<$r;++Cr){var Ar=Tr[Cr];Ar[0].apply(null,Ar[1])}while(Se$3.length>0);_e$2=!0,we$1=!0}function Ve(){var Tr=xe;xe=[],Tr.forEach(Ar=>{Ar._PSD.onunhandled.call(null,Ar._value,Ar)});for(var Cr=Ce$1.slice(0),$r=Cr.length;$r;)Cr[--$r]()}function We(Tr){return new je$1(le$4,!1,Tr)}function Ye(Tr,Cr){var $r=Oe;return function(){var Ar=Ue(),Rr=Oe;try{return it$2($r,!0),Tr.apply(this,arguments)}catch(Dr){Cr&&Cr(Dr)}finally{it$2(Rr,!1),Ar&&Le()}}}a$6(je$1.prototype,{then:De,_then:function(Tr,Cr){Fe$1(this,new Ie(null,null,Tr,Cr,Oe))},catch:function(Tr){if(arguments.length===1)return this.then(null,Tr);var Cr=arguments[0],$r=arguments[1];return typeof Cr=="function"?this.then(null,Ar=>Ar instanceof Cr?$r(Ar):We(Ar)):this.then(null,Ar=>Ar&&Ar.name===Cr?$r(Ar):We(Ar))},finally:function(Tr){return this.then(Cr=>(Tr(),Cr),Cr=>(Tr(),We(Cr)))},stack:{get:function(){if(this._stack)return this._stack;try{ve$2=!0;var Tr=Ne$1(this,[],20).join(` From previous: `);return this._state!==null&&(this._stack=Tr),Tr}finally{ve$2=!1}}},timeout:function(Tr,Cr){return Tr<1/0?new je$1(($r,Ar)=>{var Rr=setTimeout(()=>Ar(new X$2.Timeout(Cr)),Tr);this.then($r,Ar).finally(clearTimeout.bind(null,Rr))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&l$5(je$1.prototype,Symbol.toStringTag,"Dexie.Promise"),Ke.env=ot$1(),a$6(je$1,{all:function(){var Tr=B$2.apply(null,arguments).map(nt$1);return new je$1(function(Cr,$r){Tr.length===0&&Cr([]);var Ar=Tr.length;Tr.forEach((Rr,Dr)=>je$1.resolve(Rr).then(Mr=>{Tr[Dr]=Mr,--Ar||Cr(Tr)},$r))})},resolve:Tr=>{if(Tr instanceof je$1)return Tr;if(Tr&&typeof Tr.then=="function")return new je$1(($r,Ar)=>{Tr.then($r,Ar)});var Cr=new je$1(le$4,!0,Tr);return qe(Cr,Ee$1),Cr},reject:We,race:function(){var Tr=B$2.apply(null,arguments).map(nt$1);return new je$1((Cr,$r)=>{Tr.map(Ar=>je$1.resolve(Ar).then(Cr,$r))})},PSD:{get:()=>Oe,set:Tr=>Oe=Tr},totalEchoes:{get:()=>Xe},newPSD:Ze$1,usePSD:at$1,scheduler:{get:()=>be$2,set:Tr=>{be$2=Tr}},rejectionMapper:{get:()=>Pe$2,set:Tr=>{Pe$2=Tr}},follow:(Tr,Cr)=>new je$1(($r,Ar)=>Ze$1((Rr,Dr)=>{var Mr=Oe;Mr.unhandleds=[],Mr.onunhandled=Dr,Mr.finalize=re$2(function(){(function(Br){function Nr(){Br(),Ce$1.splice(Ce$1.indexOf(Nr),1)}Ce$1.push(Nr),++Ae$2,be$2(()=>{--Ae$2==0&&Ve()},[])})(()=>{this.unhandleds.length===0?Rr():Dr(this.unhandleds[0])})},Mr.finalize),Tr()},Cr,$r,Ar))}),ye$1&&(ye$1.allSettled&&l$5(je$1,"allSettled",function(){const Tr=B$2.apply(null,arguments).map(nt$1);return new je$1(Cr=>{Tr.length===0&&Cr([]);let $r=Tr.length;const Ar=new Array($r);Tr.forEach((Rr,Dr)=>je$1.resolve(Rr).then(Mr=>Ar[Dr]={status:"fulfilled",value:Mr},Mr=>Ar[Dr]={status:"rejected",reason:Mr}).then(()=>--$r||Cr(Ar)))})}),ye$1.any&&typeof AggregateError<"u"&&l$5(je$1,"any",function(){const Tr=B$2.apply(null,arguments).map(nt$1);return new je$1((Cr,$r)=>{Tr.length===0&&$r(new AggregateError([]));let Ar=Tr.length;const Rr=new Array(Ar);Tr.forEach((Dr,Mr)=>je$1.resolve(Dr).then(Br=>Cr(Br),Br=>{Rr[Mr]=Br,--Ar||$r(new AggregateError(Rr))}))})}));const ze$1={awaits:0,echoes:0,id:0};var Ge=0,He$2=[],Qe$1=0,Xe=0,Je$1=0;function Ze$1(Tr,Cr,$r,Ar){var Rr=Oe,Dr=Object.create(Rr);Dr.parent=Rr,Dr.ref=0,Dr.global=!1,Dr.id=++Je$1;var Mr=Ke.env;Dr.env=me$2?{Promise:je$1,PromiseProp:{value:je$1,configurable:!0,writable:!0},all:je$1.all,race:je$1.race,allSettled:je$1.allSettled,any:je$1.any,resolve:je$1.resolve,reject:je$1.reject,nthen:ct$1(Mr.nthen,Dr),gthen:ct$1(Mr.gthen,Dr)}:{},Cr&&r$5(Dr,Cr),++Rr.ref,Dr.finalize=function(){--this.parent.ref||this.parent.finalize()};var Br=at$1(Dr,Tr,$r,Ar);return Dr.ref===0&&Dr.finalize(),Br}function et$1(){return ze$1.id||(ze$1.id=++Ge),++ze$1.awaits,ze$1.echoes+=ce$3,ze$1.id}function tt$2(){return!!ze$1.awaits&&(--ze$1.awaits==0&&(ze$1.id=0),ze$1.echoes=ze$1.awaits*ce$3,!0)}function nt$1(Tr){return ze$1.echoes&&Tr&&Tr.constructor===ye$1?(et$1(),Tr.then(Cr=>(tt$2(),Cr),Cr=>(tt$2(),ft$1(Cr)))):Tr}function rt$1(Tr){++Xe,ze$1.echoes&&--ze$1.echoes!=0||(ze$1.echoes=ze$1.id=0),He$2.push(Oe),it$2(Tr,!0)}function st$1(){var Tr=He$2[He$2.length-1];He$2.pop(),it$2(Tr,!1)}function it$2(Tr,Cr){var $r=Oe;if((Cr?!ze$1.echoes||Qe$1++&&Tr===Oe:!Qe$1||--Qe$1&&Tr===Oe)||ut$1(Cr?rt$1.bind(null,Tr):st$1),Tr!==Oe&&(Oe=Tr,$r===Ke&&(Ke.env=ot$1()),me$2)){var Ar=Ke.env.Promise,Rr=Tr.env;de$3.then=Rr.nthen,Ar.prototype.then=Rr.gthen,($r.global||Tr.global)&&(Object.defineProperty(e$4,"Promise",Rr.PromiseProp),Ar.all=Rr.all,Ar.race=Rr.race,Ar.resolve=Rr.resolve,Ar.reject=Rr.reject,Rr.allSettled&&(Ar.allSettled=Rr.allSettled),Rr.any&&(Ar.any=Rr.any))}}function ot$1(){var Tr=e$4.Promise;return me$2?{Promise:Tr,PromiseProp:Object.getOwnPropertyDescriptor(e$4,"Promise"),all:Tr.all,race:Tr.race,allSettled:Tr.allSettled,any:Tr.any,resolve:Tr.resolve,reject:Tr.reject,nthen:de$3.then,gthen:Tr.prototype.then}:{}}function at$1(Tr,Cr,$r,Ar,Rr){var Dr=Oe;try{return it$2(Tr,!0),Cr($r,Ar,Rr)}finally{it$2(Dr,!1)}}function ut$1(Tr){pe$3.call(he$2,Tr)}function lt$2(Tr,Cr,$r,Ar){return typeof Tr!="function"?Tr:function(){var Rr=Oe;$r&&et$1(),it$2(Cr,!0);try{return Tr.apply(this,arguments)}finally{it$2(Rr,!1),Ar&&ut$1(tt$2)}}}function ct$1(Tr,Cr){return function($r,Ar){return Tr.call(this,lt$2($r,Cr),lt$2(Ar,Cr))}}(""+pe$3).indexOf("[native code]")===-1&&(et$1=tt$2=ee$1);const ht$1="unhandledrejection";function dt$1(Tr,Cr){var $r;try{$r=Cr.onuncatched(Tr)}catch{}if($r!==!1)try{var Ar,Rr={promise:Cr,reason:Tr};if(e$4.document&&document.createEvent?((Ar=document.createEvent("Event")).initEvent(ht$1,!0,!0),r$5(Ar,Rr)):e$4.CustomEvent&&r$5(Ar=new CustomEvent(ht$1,{detail:Rr}),Rr),Ar&&e$4.dispatchEvent&&(dispatchEvent(Ar),!e$4.PromiseRejectionEvent&&e$4.onunhandledrejection))try{e$4.onunhandledrejection(Ar)}catch{}R$3&&Ar&&!Ar.defaultPrevented&&console.warn(`Unhandled rejection: ${Tr.stack||Tr}`)}catch{}}var ft$1=je$1.reject;function pt$1(Tr,Cr,$r,Ar){if(Tr.idbdb&&(Tr._state.openComplete||Oe.letThrough||Tr._vip)){var Rr=Tr._createTransaction(Cr,$r,Tr._dbSchema);try{Rr.create(),Tr._state.PR1398_maxLoop=3}catch(Dr){return Dr.name===H$3.InvalidState&&Tr.isOpen()&&--Tr._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),Tr._close(),Tr.open().then(()=>pt$1(Tr,Cr,$r,Ar))):ft$1(Dr)}return Rr._promise(Cr,(Dr,Mr)=>Ze$1(()=>(Oe.trans=Rr,Ar(Dr,Mr,Rr)))).then(Dr=>Rr._completion.then(()=>Dr))}if(Tr._state.openComplete)return ft$1(new X$2.DatabaseClosed(Tr._state.dbOpenError));if(!Tr._state.isBeingOpened){if(!Tr._options.autoOpen)return ft$1(new X$2.DatabaseClosed);Tr.open().catch(ee$1)}return Tr._state.dbReadyPromise.then(()=>pt$1(Tr,Cr,$r,Ar))}const yt$1="3.2.4",mt$1=String.fromCharCode(65535),vt$1=-1/0,gt$2="Invalid key provided. Keys must be of type string, number, Date or Array.",bt$1="String expected.",_t$1=[],wt$1=typeof navigator<"u"&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),xt$1=wt$1,kt=wt$1,Et=Tr=>!/(dexie\.js|dexie\.min\.js)/.test(Tr),Pt$1="__dbnames",Kt="readonly",Ot="readwrite";function St$1(Tr,Cr){return Tr?Cr?function(){return Tr.apply(this,arguments)&&Cr.apply(this,arguments)}:Tr:Cr}const At={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Ct$1(Tr){return typeof Tr!="string"||/\./.test(Tr)?Cr=>Cr:Cr=>(Cr[Tr]===void 0&&Tr in Cr&&delete(Cr=O$3(Cr))[Tr],Cr)}class jt{_trans(Cr,$r,Ar){const Rr=this._tx||Oe.trans,Dr=this.name;function Mr(Nr,Lr,Hr){if(!Hr.schema[Dr])throw new X$2.NotFound("Table "+Dr+" not part of transaction");return $r(Hr.idbtrans,Hr)}const Br=Ue();try{return Rr&&Rr.db===this.db?Rr===Oe.trans?Rr._promise(Cr,Mr,Ar):Ze$1(()=>Rr._promise(Cr,Mr,Ar),{trans:Rr,transless:Oe.transless||Oe}):pt$1(this.db,Cr,[this.name],Mr)}finally{Br&&Le()}}get(Cr,$r){return Cr&&Cr.constructor===Object?this.where(Cr).first($r):this._trans("readonly",Ar=>this.core.get({trans:Ar,key:Cr}).then(Rr=>this.hook.reading.fire(Rr))).then($r)}where(Cr){if(typeof Cr=="string")return new this.db.WhereClause(this,Cr);if(n$7(Cr))return new this.db.WhereClause(this,`[${Cr.join("+")}]`);const $r=t$4(Cr);if($r.length===1)return this.where($r[0]).equals(Cr[$r[0]]);const Ar=this.schema.indexes.concat(this.schema.primKey).filter(Lr=>Lr.compound&&$r.every(Hr=>Lr.keyPath.indexOf(Hr)>=0)&&Lr.keyPath.every(Hr=>$r.indexOf(Hr)>=0))[0];if(Ar&&this.db._maxKey!==mt$1)return this.where(Ar.name).equals(Ar.keyPath.map(Lr=>Cr[Lr]));!Ar&&R$3&&console.warn(`The query ${JSON.stringify(Cr)} on ${this.name} would benefit of a compound index [${$r.join("+")}]`);const{idxByName:Rr}=this.schema,Dr=this.db._deps.indexedDB;function Mr(Lr,Hr){try{return Dr.cmp(Lr,Hr)===0}catch{return!1}}const[Br,Nr]=$r.reduce(([Lr,Hr],zr)=>{const Ur=Rr[zr],Vr=Cr[zr];return[Lr||Ur,Lr||!Ur?St$1(Hr,Ur&&Ur.multi?jr=>{const Gr=b$5(jr,zr);return n$7(Gr)&&Gr.some(Xr=>Mr(Vr,Xr))}:jr=>Mr(Vr,b$5(jr,zr))):Hr]},[null,null]);return Br?this.where(Br.name).equals(Cr[Br.keyPath]).filter(Nr):Ar?this.filter(Nr):this.where($r).equals("")}filter(Cr){return this.toCollection().and(Cr)}count(Cr){return this.toCollection().count(Cr)}offset(Cr){return this.toCollection().offset(Cr)}limit(Cr){return this.toCollection().limit(Cr)}each(Cr){return this.toCollection().each(Cr)}toArray(Cr){return this.toCollection().toArray(Cr)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(Cr){return new this.db.Collection(new this.db.WhereClause(this,n$7(Cr)?`[${Cr.join("+")}]`:Cr))}reverse(){return this.toCollection().reverse()}mapToClass(Cr){this.schema.mappedClass=Cr;const $r=Ar=>{if(!Ar)return Ar;const Rr=Object.create(Cr.prototype);for(var Dr in Ar)if(o$4(Ar,Dr))try{Rr[Dr]=Ar[Dr]}catch{}return Rr};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=$r,this.hook("reading",$r),Cr}defineClass(){return this.mapToClass(function(Cr){r$5(this,Cr)})}add(Cr,$r){const{auto:Ar,keyPath:Rr}=this.schema.primKey;let Dr=Cr;return Rr&&Ar&&(Dr=Ct$1(Rr)(Cr)),this._trans("readwrite",Mr=>this.core.mutate({trans:Mr,type:"add",keys:$r!=null?[$r]:null,values:[Dr]})).then(Mr=>Mr.numFailures?je$1.reject(Mr.failures[0]):Mr.lastResult).then(Mr=>{if(Rr)try{_$2(Cr,Rr,Mr)}catch{}return Mr})}update(Cr,$r){if(typeof Cr!="object"||n$7(Cr))return this.where(":id").equals(Cr).modify($r);{const Ar=b$5(Cr,this.schema.primKey.keyPath);if(Ar===void 0)return ft$1(new X$2.InvalidArgument("Given object does not contain its primary key"));try{typeof $r!="function"?t$4($r).forEach(Rr=>{_$2(Cr,Rr,$r[Rr])}):$r(Cr,{value:Cr,primKey:Ar})}catch{}return this.where(":id").equals(Ar).modify($r)}}put(Cr,$r){const{auto:Ar,keyPath:Rr}=this.schema.primKey;let Dr=Cr;return Rr&&Ar&&(Dr=Ct$1(Rr)(Cr)),this._trans("readwrite",Mr=>this.core.mutate({trans:Mr,type:"put",values:[Dr],keys:$r!=null?[$r]:null})).then(Mr=>Mr.numFailures?je$1.reject(Mr.failures[0]):Mr.lastResult).then(Mr=>{if(Rr)try{_$2(Cr,Rr,Mr)}catch{}return Mr})}delete(Cr){return this._trans("readwrite",$r=>this.core.mutate({trans:$r,type:"delete",keys:[Cr]})).then($r=>$r.numFailures?je$1.reject($r.failures[0]):void 0)}clear(){return this._trans("readwrite",Cr=>this.core.mutate({trans:Cr,type:"deleteRange",range:At})).then(Cr=>Cr.numFailures?je$1.reject(Cr.failures[0]):void 0)}bulkGet(Cr){return this._trans("readonly",$r=>this.core.getMany({keys:Cr,trans:$r}).then(Ar=>Ar.map(Rr=>this.hook.reading.fire(Rr))))}bulkAdd(Cr,$r,Ar){const Rr=Array.isArray($r)?$r:void 0,Dr=(Ar=Ar||(Rr?void 0:$r))?Ar.allKeys:void 0;return this._trans("readwrite",Mr=>{const{auto:Br,keyPath:Nr}=this.schema.primKey;if(Nr&&Rr)throw new X$2.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(Rr&&Rr.length!==Cr.length)throw new X$2.InvalidArgument("Arguments objects and keys must have the same length");const Lr=Cr.length;let Hr=Nr&&Br?Cr.map(Ct$1(Nr)):Cr;return this.core.mutate({trans:Mr,type:"add",keys:Rr,values:Hr,wantResults:Dr}).then(({numFailures:zr,results:Ur,lastResult:Vr,failures:jr})=>{if(zr===0)return Dr?Ur:Vr;throw new G$1(`${this.name}.bulkAdd(): ${zr} of ${Lr} operations failed`,jr)})})}bulkPut(Cr,$r,Ar){const Rr=Array.isArray($r)?$r:void 0,Dr=(Ar=Ar||(Rr?void 0:$r))?Ar.allKeys:void 0;return this._trans("readwrite",Mr=>{const{auto:Br,keyPath:Nr}=this.schema.primKey;if(Nr&&Rr)throw new X$2.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(Rr&&Rr.length!==Cr.length)throw new X$2.InvalidArgument("Arguments objects and keys must have the same length");const Lr=Cr.length;let Hr=Nr&&Br?Cr.map(Ct$1(Nr)):Cr;return this.core.mutate({trans:Mr,type:"put",keys:Rr,values:Hr,wantResults:Dr}).then(({numFailures:zr,results:Ur,lastResult:Vr,failures:jr})=>{if(zr===0)return Dr?Ur:Vr;throw new G$1(`${this.name}.bulkPut(): ${zr} of ${Lr} operations failed`,jr)})})}bulkDelete(Cr){const $r=Cr.length;return this._trans("readwrite",Ar=>this.core.mutate({trans:Ar,type:"delete",keys:Cr})).then(({numFailures:Ar,lastResult:Rr,failures:Dr})=>{if(Ar===0)return Rr;throw new G$1(`${this.name}.bulkDelete(): ${Ar} of ${$r} operations failed`,Dr)})}}function Dt(Tr){var Cr={},$r=function(Mr,Br){if(Br){for(var Nr=arguments.length,Lr=new Array(Nr-1);--Nr;)Lr[Nr-1]=arguments[Nr];return Cr[Mr].subscribe.apply(null,Lr),Tr}if(typeof Mr=="string")return Cr[Mr]};$r.addEventType=Dr;for(var Ar=1,Rr=arguments.length;ArSt$1(Ar(),Cr()):Cr,Tr.justLimit=$r&&!Ar}function Ft(Tr,Cr){if(Tr.isPrimKey)return Cr.primaryKey;const $r=Cr.getIndexByKeyPath(Tr.index);if(!$r)throw new X$2.Schema("KeyPath "+Tr.index+" on object store "+Cr.name+" is not indexed");return $r}function Mt(Tr,Cr,$r){const Ar=Ft(Tr,Cr.schema);return Cr.openCursor({trans:$r,values:!Tr.keysOnly,reverse:Tr.dir==="prev",unique:!!Tr.unique,query:{index:Ar,range:Tr.range}})}function Nt(Tr,Cr,$r,Ar){const Rr=Tr.replayFilter?St$1(Tr.filter,Tr.replayFilter()):Tr.filter;if(Tr.or){const Dr={},Mr=(Br,Nr,Lr)=>{if(!Rr||Rr(Nr,Lr,Ur=>Nr.stop(Ur),Ur=>Nr.fail(Ur))){var Hr=Nr.primaryKey,zr=""+Hr;zr==="[object ArrayBuffer]"&&(zr=""+new Uint8Array(Hr)),o$4(Dr,zr)||(Dr[zr]=!0,Cr(Br,Nr,Lr))}};return Promise.all([Tr.or._iterate(Mr,$r),qt(Mt(Tr,Ar,$r),Tr.algorithm,Mr,!Tr.keysOnly&&Tr.valueMapper)])}return qt(Mt(Tr,Ar,$r),St$1(Tr.algorithm,Rr),Cr,!Tr.keysOnly&&Tr.valueMapper)}function qt(Tr,Cr,$r,Ar){var Rr=Ye(Ar?(Dr,Mr,Br)=>$r(Ar(Dr),Mr,Br):$r);return Tr.then(Dr=>{if(Dr)return Dr.start(()=>{var Mr=()=>Dr.continue();Cr&&!Cr(Dr,Br=>Mr=Br,Br=>{Dr.stop(Br),Mr=ee$1},Br=>{Dr.fail(Br),Mr=ee$1})||Rr(Dr.value,Dr,Br=>Mr=Br),Mr()})})}function $t$1(Tr,Cr){try{const $r=Ut(Tr),Ar=Ut(Cr);if($r!==Ar)return $r==="Array"?1:Ar==="Array"?-1:$r==="binary"?1:Ar==="binary"?-1:$r==="string"?1:Ar==="string"?-1:$r==="Date"?1:Ar!=="Date"?NaN:-1;switch($r){case"number":case"Date":case"string":return Tr>Cr?1:TrNt($r,Cr,Ar,$r.table.core))}count(Cr){return this._read($r=>{const Ar=this._ctx,Rr=Ar.table.core;if(Bt(Ar,!0))return Rr.count({trans:$r,query:{index:Ft(Ar,Rr.schema),range:Ar.range}}).then(Mr=>Math.min(Mr,Ar.limit));var Dr=0;return Nt(Ar,()=>(++Dr,!1),$r,Rr).then(()=>Dr)}).then(Cr)}sortBy(Cr,$r){const Ar=Cr.split(".").reverse(),Rr=Ar[0],Dr=Ar.length-1;function Mr(Lr,Hr){return Hr?Mr(Lr[Ar[Hr]],Hr-1):Lr[Rr]}var Br=this._ctx.dir==="next"?1:-1;function Nr(Lr,Hr){var zr=Mr(Lr,Dr),Ur=Mr(Hr,Dr);return zrUr?Br:0}return this.toArray(function(Lr){return Lr.sort(Nr)}).then($r)}toArray(Cr){return this._read($r=>{var Ar=this._ctx;if(Ar.dir==="next"&&Bt(Ar,!0)&&Ar.limit>0){const{valueMapper:Rr}=Ar,Dr=Ft(Ar,Ar.table.core.schema);return Ar.table.core.query({trans:$r,limit:Ar.limit,values:!0,query:{index:Dr,range:Ar.range}}).then(({result:Mr})=>Rr?Mr.map(Rr):Mr)}{const Rr=[];return Nt(Ar,Dr=>Rr.push(Dr),$r,Ar.table.core).then(()=>Rr)}},Cr)}offset(Cr){var $r=this._ctx;return Cr<=0||($r.offset+=Cr,Bt($r)?Rt($r,()=>{var Ar=Cr;return(Rr,Dr)=>Ar===0||(Ar===1?(--Ar,!1):(Dr(()=>{Rr.advance(Ar),Ar=0}),!1))}):Rt($r,()=>{var Ar=Cr;return()=>--Ar<0})),this}limit(Cr){return this._ctx.limit=Math.min(this._ctx.limit,Cr),Rt(this._ctx,()=>{var $r=Cr;return function(Ar,Rr,Dr){return--$r<=0&&Rr(Dr),$r>=0}},!0),this}until(Cr,$r){return Tt$1(this._ctx,function(Ar,Rr,Dr){return!Cr(Ar.value)||(Rr(Dr),$r)}),this}first(Cr){return this.limit(1).toArray(function($r){return $r[0]}).then(Cr)}last(Cr){return this.reverse().first(Cr)}filter(Cr){var $r,Ar;return Tt$1(this._ctx,function(Rr){return Cr(Rr.value)}),$r=this._ctx,Ar=Cr,$r.isMatch=St$1($r.isMatch,Ar),this}and(Cr){return this.filter(Cr)}or(Cr){return new this.db.WhereClause(this._ctx.table,Cr,this)}reverse(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(Cr){var $r=this._ctx;return $r.keysOnly=!$r.isMatch,this.each(function(Ar,Rr){Cr(Rr.key,Rr)})}eachUniqueKey(Cr){return this._ctx.unique="unique",this.eachKey(Cr)}eachPrimaryKey(Cr){var $r=this._ctx;return $r.keysOnly=!$r.isMatch,this.each(function(Ar,Rr){Cr(Rr.primaryKey,Rr)})}keys(Cr){var $r=this._ctx;$r.keysOnly=!$r.isMatch;var Ar=[];return this.each(function(Rr,Dr){Ar.push(Dr.key)}).then(function(){return Ar}).then(Cr)}primaryKeys(Cr){var $r=this._ctx;if($r.dir==="next"&&Bt($r,!0)&&$r.limit>0)return this._read(Rr=>{var Dr=Ft($r,$r.table.core.schema);return $r.table.core.query({trans:Rr,values:!1,limit:$r.limit,query:{index:Dr,range:$r.range}})}).then(({result:Rr})=>Rr).then(Cr);$r.keysOnly=!$r.isMatch;var Ar=[];return this.each(function(Rr,Dr){Ar.push(Dr.primaryKey)}).then(function(){return Ar}).then(Cr)}uniqueKeys(Cr){return this._ctx.unique="unique",this.keys(Cr)}firstKey(Cr){return this.limit(1).keys(function($r){return $r[0]}).then(Cr)}lastKey(Cr){return this.reverse().firstKey(Cr)}distinct(){var Cr=this._ctx,$r=Cr.index&&Cr.table.schema.idxByName[Cr.index];if(!$r||!$r.multi)return this;var Ar={};return Tt$1(this._ctx,function(Rr){var Dr=Rr.primaryKey.toString(),Mr=o$4(Ar,Dr);return Ar[Dr]=!0,!Mr}),this}modify(Cr){var $r=this._ctx;return this._write(Ar=>{var Rr;if(typeof Cr=="function")Rr=Cr;else{var Dr=t$4(Cr),Mr=Dr.length;Rr=function(Gr){for(var Xr=!1,Kr=0;Kr{const{failures:Kr,numFailures:Zr}=Xr;Ur+=Gr-Zr;for(let eo of t$4(Kr))zr.push(Kr[eo])};return this.clone().primaryKeys().then(Gr=>{const Xr=Kr=>{const Zr=Math.min(Hr,Gr.length-Kr);return Br.getMany({trans:Ar,keys:Gr.slice(Kr,Kr+Zr),cache:"immutable"}).then(eo=>{const Wr=[],Yr=[],Jr=Nr?[]:null,no=[];for(let so=0;so0&&Br.mutate({trans:Ar,type:"add",values:Wr}).then(so=>{for(let ao in so.failures)no.splice(parseInt(ao),1);jr(Wr.length,so)})).then(()=>(Yr.length>0||ro&&typeof Cr=="object")&&Br.mutate({trans:Ar,type:"put",keys:Jr,values:Yr,criteria:ro,changeSpec:typeof Cr!="function"&&Cr}).then(so=>jr(Yr.length,so))).then(()=>(no.length>0||ro&&Cr===Wt)&&Br.mutate({trans:Ar,type:"delete",keys:no,criteria:ro}).then(so=>jr(no.length,so))).then(()=>Gr.length>Kr+Zr&&Xr(Kr+Hr))})};return Xr(0).then(()=>{if(zr.length>0)throw new z$1("Error modifying one or more objects",zr,Ur,Vr);return Gr.length})})})}delete(){var Cr=this._ctx,$r=Cr.range;return Bt(Cr)&&(Cr.isPrimKey&&!kt||$r.type===3)?this._write(Ar=>{const{primaryKey:Rr}=Cr.table.core.schema,Dr=$r;return Cr.table.core.count({trans:Ar,query:{index:Rr,range:Dr}}).then(Mr=>Cr.table.core.mutate({trans:Ar,type:"deleteRange",range:Dr}).then(({failures:Br,lastResult:Nr,results:Lr,numFailures:Hr})=>{if(Hr)throw new z$1("Could not delete some values",Object.keys(Br).map(zr=>Br[zr]),Mr-Hr);return Mr-Hr}))}):this.modify(Wt)}}const Wt=(Tr,Cr)=>Cr.value=null;function Yt(Tr,Cr){return TrCr?-1:Tr===Cr?0:1}function Gt$1(Tr,Cr,$r){var Ar=Tr instanceof en?new Tr.Collection(Tr):Tr;return Ar._ctx.error=$r?new $r(Cr):new TypeError(Cr),Ar}function Ht(Tr){return new Tr.Collection(Tr,()=>Zt("")).limit(0)}function Qt(Tr,Cr,$r,Ar,Rr,Dr){for(var Mr=Math.min(Tr.length,Ar.length),Br=-1,Nr=0;Nr=0?Tr.substr(0,Br)+Cr[Br]+$r.substr(Br+1):null;Rr(Tr[Nr],Lr)<0&&(Br=Nr)}return Mrtypeof Gr=="string"))return Gt$1(Tr,bt$1);function Ur(Gr){Rr=function(Kr){return Kr==="next"?Zr=>Zr.toUpperCase():Zr=>Zr.toLowerCase()}(Gr),Dr=function(Kr){return Kr==="next"?Zr=>Zr.toLowerCase():Zr=>Zr.toUpperCase()}(Gr),Mr=Gr==="next"?Yt:zt$1;var Xr=$r.map(function(Kr){return{lower:Dr(Kr),upper:Rr(Kr)}}).sort(function(Kr,Zr){return Mr(Kr.lower,Zr.lower)});Br=Xr.map(function(Kr){return Kr.upper}),Nr=Xr.map(function(Kr){return Kr.lower}),Lr=Gr,Hr=Gr==="next"?"":Ar}Ur("next");var Vr=new Tr.Collection(Tr,()=>Jt(Br[0],Nr[zr-1]+Ar));Vr._ondirectionchange=function(Gr){Ur(Gr)};var jr=0;return Vr._addAlgorithm(function(Gr,Xr,Kr){var Zr=Gr.key;if(typeof Zr!="string")return!1;var eo=Dr(Zr);if(Cr(eo,Nr,jr))return!0;for(var Wr=null,Yr=jr;Yr0)&&(Wr=Jr)}return Xr(Wr!==null?function(){Gr.continue(Wr+Hr)}:Kr),!1}),Vr}function Jt(Tr,Cr,$r,Ar){return{type:2,lower:Tr,upper:Cr,lowerOpen:$r,upperOpen:Ar}}function Zt(Tr){return{type:1,lower:Tr,upper:Tr}}class en{get Collection(){return this._ctx.table.db.Collection}between(Cr,$r,Ar,Rr){Ar=Ar!==!1,Rr=Rr===!0;try{return this._cmp(Cr,$r)>0||this._cmp(Cr,$r)===0&&(Ar||Rr)&&(!Ar||!Rr)?Ht(this):new this.Collection(this,()=>Jt(Cr,$r,!Ar,!Rr))}catch{return Gt$1(this,gt$2)}}equals(Cr){return Cr==null?Gt$1(this,gt$2):new this.Collection(this,()=>Zt(Cr))}above(Cr){return Cr==null?Gt$1(this,gt$2):new this.Collection(this,()=>Jt(Cr,void 0,!0))}aboveOrEqual(Cr){return Cr==null?Gt$1(this,gt$2):new this.Collection(this,()=>Jt(Cr,void 0,!1))}below(Cr){return Cr==null?Gt$1(this,gt$2):new this.Collection(this,()=>Jt(void 0,Cr,!1,!0))}belowOrEqual(Cr){return Cr==null?Gt$1(this,gt$2):new this.Collection(this,()=>Jt(void 0,Cr))}startsWith(Cr){return typeof Cr!="string"?Gt$1(this,bt$1):this.between(Cr,Cr+mt$1,!0,!0)}startsWithIgnoreCase(Cr){return Cr===""?this.startsWith(Cr):Xt(this,($r,Ar)=>$r.indexOf(Ar[0])===0,[Cr],mt$1)}equalsIgnoreCase(Cr){return Xt(this,($r,Ar)=>$r===Ar[0],[Cr],"")}anyOfIgnoreCase(){var Cr=B$2.apply(I$1,arguments);return Cr.length===0?Ht(this):Xt(this,($r,Ar)=>Ar.indexOf($r)!==-1,Cr,"")}startsWithAnyOfIgnoreCase(){var Cr=B$2.apply(I$1,arguments);return Cr.length===0?Ht(this):Xt(this,($r,Ar)=>Ar.some(Rr=>$r.indexOf(Rr)===0),Cr,mt$1)}anyOf(){const Cr=B$2.apply(I$1,arguments);let $r=this._cmp;try{Cr.sort($r)}catch{return Gt$1(this,gt$2)}if(Cr.length===0)return Ht(this);const Ar=new this.Collection(this,()=>Jt(Cr[0],Cr[Cr.length-1]));Ar._ondirectionchange=Dr=>{$r=Dr==="next"?this._ascending:this._descending,Cr.sort($r)};let Rr=0;return Ar._addAlgorithm((Dr,Mr,Br)=>{const Nr=Dr.key;for(;$r(Nr,Cr[Rr])>0;)if(++Rr,Rr===Cr.length)return Mr(Br),!1;return $r(Nr,Cr[Rr])===0||(Mr(()=>{Dr.continue(Cr[Rr])}),!1)}),Ar}notEqual(Cr){return this.inAnyRange([[vt$1,Cr],[Cr,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const Cr=B$2.apply(I$1,arguments);if(Cr.length===0)return new this.Collection(this);try{Cr.sort(this._ascending)}catch{return Gt$1(this,gt$2)}const $r=Cr.reduce((Ar,Rr)=>Ar?Ar.concat([[Ar[Ar.length-1][1],Rr]]):[[vt$1,Rr]],null);return $r.push([Cr[Cr.length-1],this.db._maxKey]),this.inAnyRange($r,{includeLowers:!1,includeUppers:!1})}inAnyRange(Cr,$r){const Ar=this._cmp,Rr=this._ascending,Dr=this._descending,Mr=this._min,Br=this._max;if(Cr.length===0)return Ht(this);if(!Cr.every(Zr=>Zr[0]!==void 0&&Zr[1]!==void 0&&Rr(Zr[0],Zr[1])<=0))return Gt$1(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",X$2.InvalidArgument);const Nr=!$r||$r.includeLowers!==!1,Lr=$r&&$r.includeUppers===!0;let Hr,zr=Rr;function Ur(Zr,eo){return zr(Zr[0],eo[0])}try{Hr=Cr.reduce(function(Zr,eo){let Wr=0,Yr=Zr.length;for(;Wr0){Jr[0]=Mr(Jr[0],eo[0]),Jr[1]=Br(Jr[1],eo[1]);break}}return Wr===Yr&&Zr.push(eo),Zr},[]),Hr.sort(Ur)}catch{return Gt$1(this,gt$2)}let Vr=0;const jr=Lr?Zr=>Rr(Zr,Hr[Vr][1])>0:Zr=>Rr(Zr,Hr[Vr][1])>=0,Gr=Nr?Zr=>Dr(Zr,Hr[Vr][0])>0:Zr=>Dr(Zr,Hr[Vr][0])>=0;let Xr=jr;const Kr=new this.Collection(this,()=>Jt(Hr[0][0],Hr[Hr.length-1][1],!Nr,!Lr));return Kr._ondirectionchange=Zr=>{Zr==="next"?(Xr=jr,zr=Rr):(Xr=Gr,zr=Dr),Hr.sort(Ur)},Kr._addAlgorithm((Zr,eo,Wr)=>{for(var Yr=Zr.key;Xr(Yr);)if(++Vr,Vr===Hr.length)return eo(Wr),!1;return!!function(Jr){return!jr(Jr)&&!Gr(Jr)}(Yr)||(this._cmp(Yr,Hr[Vr][1])===0||this._cmp(Yr,Hr[Vr][0])===0||eo(()=>{zr===Rr?Zr.continue(Hr[Vr][0]):Zr.continue(Hr[Vr][1])}),!1)}),Kr}startsWithAnyOf(){const Cr=B$2.apply(I$1,arguments);return Cr.every($r=>typeof $r=="string")?Cr.length===0?Ht(this):this.inAnyRange(Cr.map($r=>[$r,$r+mt$1])):Gt$1(this,"startsWithAnyOf() only works with strings")}}function tn(Tr){return Ye(function(Cr){return nn(Cr),Tr(Cr.target.error),!1})}function nn(Tr){Tr.stopPropagation&&Tr.stopPropagation(),Tr.preventDefault&&Tr.preventDefault()}const rn="storagemutated",sn="x-storagemutated-1",on$1=Dt(null,rn);class an{_lock(){return m$6(!Oe.global),++this._reculock,this._reculock!==1||Oe.global||(Oe.lockOwnerFor=this),this}_unlock(){if(m$6(!Oe.global),--this._reculock==0)for(Oe.global||(Oe.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var Cr=this._blockedFuncs.shift();try{at$1(Cr[1],Cr[0])}catch{}}return this}_locked(){return this._reculock&&Oe.lockOwnerFor!==this}create(Cr){if(!this.mode)return this;const $r=this.db.idbdb,Ar=this.db._state.dbOpenError;if(m$6(!this.idbtrans),!Cr&&!$r)switch(Ar&&Ar.name){case"DatabaseClosedError":throw new X$2.DatabaseClosed(Ar);case"MissingAPIError":throw new X$2.MissingAPI(Ar.message,Ar);default:throw new X$2.OpenFailed(Ar)}if(!this.active)throw new X$2.TransactionInactive;return m$6(this._completion._state===null),(Cr=this.idbtrans=Cr||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):$r.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=Ye(Rr=>{nn(Rr),this._reject(Cr.error)}),Cr.onabort=Ye(Rr=>{nn(Rr),this.active&&this._reject(new X$2.Abort(Cr.error)),this.active=!1,this.on("abort").fire(Rr)}),Cr.oncomplete=Ye(()=>{this.active=!1,this._resolve(),"mutatedParts"in Cr&&on$1.storagemutated.fire(Cr.mutatedParts)}),this}_promise(Cr,$r,Ar){if(Cr==="readwrite"&&this.mode!=="readwrite")return ft$1(new X$2.ReadOnly("Transaction is readonly"));if(!this.active)return ft$1(new X$2.TransactionInactive);if(this._locked())return new je$1((Dr,Mr)=>{this._blockedFuncs.push([()=>{this._promise(Cr,$r,Ar).then(Dr,Mr)},Oe])});if(Ar)return Ze$1(()=>{var Dr=new je$1((Mr,Br)=>{this._lock();const Nr=$r(Mr,Br,this);Nr&&Nr.then&&Nr.then(Mr,Br)});return Dr.finally(()=>this._unlock()),Dr._lib=!0,Dr});var Rr=new je$1((Dr,Mr)=>{var Br=$r(Dr,Mr,this);Br&&Br.then&&Br.then(Dr,Mr)});return Rr._lib=!0,Rr}_root(){return this.parent?this.parent._root():this}waitFor(Cr){var $r=this._root();const Ar=je$1.resolve(Cr);if($r._waitingFor)$r._waitingFor=$r._waitingFor.then(()=>Ar);else{$r._waitingFor=Ar,$r._waitingQueue=[];var Rr=$r.idbtrans.objectStore($r.storeNames[0]);(function Mr(){for(++$r._spinCount;$r._waitingQueue.length;)$r._waitingQueue.shift()();$r._waitingFor&&(Rr.get(-1/0).onsuccess=Mr)})()}var Dr=$r._waitingFor;return new je$1((Mr,Br)=>{Ar.then(Nr=>$r._waitingQueue.push(Ye(Mr.bind(null,Nr))),Nr=>$r._waitingQueue.push(Ye(Br.bind(null,Nr)))).finally(()=>{$r._waitingFor===Dr&&($r._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new X$2.Abort))}table(Cr){const $r=this._memoizedTables||(this._memoizedTables={});if(o$4($r,Cr))return $r[Cr];const Ar=this.schema[Cr];if(!Ar)throw new X$2.NotFound("Table "+Cr+" not part of transaction");const Rr=new this.db.Table(Cr,Ar,this);return Rr.core=this.db.core.table(Cr),$r[Cr]=Rr,Rr}}function un(Tr,Cr,$r,Ar,Rr,Dr,Mr){return{name:Tr,keyPath:Cr,unique:$r,multi:Ar,auto:Rr,compound:Dr,src:($r&&!Mr?"&":"")+(Ar?"*":"")+(Rr?"++":"")+ln(Cr)}}function ln(Tr){return typeof Tr=="string"?Tr:Tr?"["+[].join.call(Tr,"+")+"]":""}function cn(Tr,Cr,$r){return{name:Tr,primKey:Cr,indexes:$r,mappedClass:null,idxByName:g$5($r,Ar=>[Ar.name,Ar])}}let hn=Tr=>{try{return Tr.only([[]]),hn=()=>[[]],[[]]}catch{return hn=()=>mt$1,mt$1}};function dn(Tr){return Tr==null?()=>{}:typeof Tr=="string"?function(Cr){return Cr.split(".").length===1?Ar=>Ar[Cr]:Ar=>b$5(Ar,Cr)}(Tr):Cr=>b$5(Cr,Tr)}function fn(Tr){return[].slice.call(Tr)}let pn=0;function yn(Tr){return Tr==null?":id":typeof Tr=="string"?Tr:`[${Tr.join("+")}]`}function mn(Tr,Cr,$r){function Ar(Nr){if(Nr.type===3)return null;if(Nr.type===4)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:Lr,upper:Hr,lowerOpen:zr,upperOpen:Ur}=Nr;return Lr===void 0?Hr===void 0?null:Cr.upperBound(Hr,!!Ur):Hr===void 0?Cr.lowerBound(Lr,!!zr):Cr.bound(Lr,Hr,!!zr,!!Ur)}const{schema:Rr,hasGetAll:Dr}=function(Nr,Lr){const Hr=fn(Nr.objectStoreNames);return{schema:{name:Nr.name,tables:Hr.map(zr=>Lr.objectStore(zr)).map(zr=>{const{keyPath:Ur,autoIncrement:Vr}=zr,jr=n$7(Ur),Gr=Ur==null,Xr={},Kr={name:zr.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:Gr,compound:jr,keyPath:Ur,autoIncrement:Vr,unique:!0,extractKey:dn(Ur)},indexes:fn(zr.indexNames).map(Zr=>zr.index(Zr)).map(Zr=>{const{name:eo,unique:Wr,multiEntry:Yr,keyPath:Jr}=Zr,no={name:eo,compound:n$7(Jr),keyPath:Jr,unique:Wr,multiEntry:Yr,extractKey:dn(Jr)};return Xr[yn(Jr)]=no,no}),getIndexByKeyPath:Zr=>Xr[yn(Zr)]};return Xr[":id"]=Kr.primaryKey,Ur!=null&&(Xr[yn(Ur)]=Kr.primaryKey),Kr})},hasGetAll:Hr.length>0&&"getAll"in Lr.objectStore(Hr[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(Tr,$r),Mr=Rr.tables.map(Nr=>function(Lr){const Hr=Lr.name;return{name:Hr,schema:Lr,mutate:function({trans:zr,type:Ur,keys:Vr,values:jr,range:Gr}){return new Promise((Xr,Kr)=>{Xr=Ye(Xr);const Zr=zr.objectStore(Hr),eo=Zr.keyPath==null,Wr=Ur==="put"||Ur==="add";if(!Wr&&Ur!=="delete"&&Ur!=="deleteRange")throw new Error("Invalid operation type: "+Ur);const{length:Yr}=Vr||jr||{length:1};if(Vr&&jr&&Vr.length!==jr.length)throw new Error("Given keys array must have same length as given values array.");if(Yr===0)return Xr({numFailures:0,failures:{},results:[],lastResult:void 0});let Jr;const no=[],ro=[];let so=0;const ao=po=>{++so,nn(po)};if(Ur==="deleteRange"){if(Gr.type===4)return Xr({numFailures:so,failures:ro,results:[],lastResult:void 0});Gr.type===3?no.push(Jr=Zr.clear()):no.push(Jr=Zr.delete(Ar(Gr)))}else{const[po,go]=Wr?eo?[jr,Vr]:[jr,null]:[Vr,null];if(Wr)for(let co=0;co{const go=po.target.result;no.forEach((co,mo)=>co.error!=null&&(ro[mo]=co.error)),Xr({numFailures:so,failures:ro,results:Ur==="delete"?Vr:no.map(co=>co.result),lastResult:go})};Jr.onerror=po=>{ao(po),lo(po)},Jr.onsuccess=lo})},getMany:({trans:zr,keys:Ur})=>new Promise((Vr,jr)=>{Vr=Ye(Vr);const Gr=zr.objectStore(Hr),Xr=Ur.length,Kr=new Array(Xr);let Zr,eo=0,Wr=0;const Yr=no=>{const ro=no.target;Kr[ro._pos]=ro.result,++Wr===eo&&Vr(Kr)},Jr=tn(jr);for(let no=0;nonew Promise((Vr,jr)=>{Vr=Ye(Vr);const Gr=zr.objectStore(Hr).get(Ur);Gr.onsuccess=Xr=>Vr(Xr.target.result),Gr.onerror=tn(jr)}),query:function(zr){return Ur=>new Promise((Vr,jr)=>{Vr=Ye(Vr);const{trans:Gr,values:Xr,limit:Kr,query:Zr}=Ur,eo=Kr===1/0?void 0:Kr,{index:Wr,range:Yr}=Zr,Jr=Gr.objectStore(Hr),no=Wr.isPrimaryKey?Jr:Jr.index(Wr.name),ro=Ar(Yr);if(Kr===0)return Vr({result:[]});if(zr){const so=Xr?no.getAll(ro,eo):no.getAllKeys(ro,eo);so.onsuccess=ao=>Vr({result:ao.target.result}),so.onerror=tn(jr)}else{let so=0;const ao=Xr||!("openKeyCursor"in no)?no.openCursor(ro):no.openKeyCursor(ro),lo=[];ao.onsuccess=po=>{const go=ao.result;return go?(lo.push(Xr?go.value:go.primaryKey),++so===Kr?Vr({result:lo}):void go.continue()):Vr({result:lo})},ao.onerror=tn(jr)}})}(Dr),openCursor:function({trans:zr,values:Ur,query:Vr,reverse:jr,unique:Gr}){return new Promise((Xr,Kr)=>{Xr=Ye(Xr);const{index:Zr,range:eo}=Vr,Wr=zr.objectStore(Hr),Yr=Zr.isPrimaryKey?Wr:Wr.index(Zr.name),Jr=jr?Gr?"prevunique":"prev":Gr?"nextunique":"next",no=Ur||!("openKeyCursor"in Yr)?Yr.openCursor(Ar(eo),Jr):Yr.openKeyCursor(Ar(eo),Jr);no.onerror=tn(Kr),no.onsuccess=Ye(ro=>{const so=no.result;if(!so)return void Xr(null);so.___id=++pn,so.done=!1;const ao=so.continue.bind(so);let lo=so.continuePrimaryKey;lo&&(lo=lo.bind(so));const po=so.advance.bind(so),go=()=>{throw new Error("Cursor not stopped")};so.trans=zr,so.stop=so.continue=so.continuePrimaryKey=so.advance=()=>{throw new Error("Cursor not started")},so.fail=Ye(Kr),so.next=function(){let co=1;return this.start(()=>co--?this.continue():this.stop()).then(()=>this)},so.start=co=>{const mo=new Promise((uo,ho)=>{uo=Ye(uo),no.onerror=tn(ho),so.fail=ho,so.stop=yo=>{so.stop=so.continue=so.continuePrimaryKey=so.advance=go,uo(yo)}}),io=()=>{if(no.result)try{co()}catch(uo){so.fail(uo)}else so.done=!0,so.start=()=>{throw new Error("Cursor behind last entry")},so.stop()};return no.onsuccess=Ye(uo=>{no.onsuccess=io,io()}),so.continue=ao,so.continuePrimaryKey=lo,so.advance=po,io(),mo},Xr(so)},Kr)})},count({query:zr,trans:Ur}){const{index:Vr,range:jr}=zr;return new Promise((Gr,Xr)=>{const Kr=Ur.objectStore(Hr),Zr=Vr.isPrimaryKey?Kr:Kr.index(Vr.name),eo=Ar(jr),Wr=eo?Zr.count(eo):Zr.count();Wr.onsuccess=Ye(Yr=>Gr(Yr.target.result)),Wr.onerror=tn(Xr)})}}}(Nr)),Br={};return Mr.forEach(Nr=>Br[Nr.name]=Nr),{stack:"dbcore",transaction:Tr.transaction.bind(Tr),table(Nr){if(!Br[Nr])throw new Error(`Table '${Nr}' not found`);return Br[Nr]},MIN_KEY:-1/0,MAX_KEY:hn(Cr),schema:Rr}}function vn({_novip:Tr},Cr){const $r=Cr.db,Ar=function(Rr,Dr,{IDBKeyRange:Mr,indexedDB:Br},Nr){return{dbcore:function(Hr,zr){return zr.reduce((Ur,{create:Vr})=>({...Ur,...Vr(Ur)}),Hr)}(mn(Dr,Mr,Nr),Rr.dbcore)}}(Tr._middlewares,$r,Tr._deps,Cr);Tr.core=Ar.dbcore,Tr.tables.forEach(Rr=>{const Dr=Rr.name;Tr.core.schema.tables.some(Mr=>Mr.name===Dr)&&(Rr.core=Tr.core.table(Dr),Tr[Dr]instanceof Tr.Table&&(Tr[Dr].core=Rr.core))})}function gn({_novip:Tr},Cr,$r,Ar){$r.forEach(Rr=>{const Dr=Ar[Rr];Cr.forEach(Mr=>{const Br=d$7(Mr,Rr);(!Br||"value"in Br&&Br.value===void 0)&&(Mr===Tr.Transaction.prototype||Mr instanceof Tr.Transaction?l$5(Mr,Rr,{get(){return this.table(Rr)},set(Nr){u$8(this,Rr,{value:Nr,writable:!0,configurable:!0,enumerable:!0})}}):Mr[Rr]=new Tr.Table(Rr,Dr))})})}function bn({_novip:Tr},Cr){Cr.forEach($r=>{for(let Ar in $r)$r[Ar]instanceof Tr.Table&&delete $r[Ar]})}function _n(Tr,Cr){return Tr._cfg.version-Cr._cfg.version}function wn(Tr,Cr,$r,Ar){const Rr=Tr._dbSchema,Dr=Tr._createTransaction("readwrite",Tr._storeNames,Rr);Dr.create($r),Dr._completion.catch(Ar);const Mr=Dr._reject.bind(Dr),Br=Oe.transless||Oe;Ze$1(()=>{Oe.trans=Dr,Oe.transless=Br,Cr===0?(t$4(Rr).forEach(Nr=>{kn($r,Nr,Rr[Nr].primKey,Rr[Nr].indexes)}),vn(Tr,$r),je$1.follow(()=>Tr.on.populate.fire(Dr)).catch(Mr)):function({_novip:Nr},Lr,Hr,zr){const Ur=[],Vr=Nr._versions;let jr=Nr._dbSchema=Pn(Nr,Nr.idbdb,zr),Gr=!1;const Xr=Vr.filter(Zr=>Zr._cfg.version>=Lr);function Kr(){return Ur.length?je$1.resolve(Ur.shift()(Hr.idbtrans)).then(Kr):je$1.resolve()}return Xr.forEach(Zr=>{Ur.push(()=>{const eo=jr,Wr=Zr._cfg.dbschema;Kn(Nr,eo,zr),Kn(Nr,Wr,zr),jr=Nr._dbSchema=Wr;const Yr=xn(eo,Wr);Yr.add.forEach(no=>{kn(zr,no[0],no[1].primKey,no[1].indexes)}),Yr.change.forEach(no=>{if(no.recreate)throw new X$2.Upgrade("Not yet support for changing primary key");{const ro=zr.objectStore(no.name);no.add.forEach(so=>En(ro,so)),no.change.forEach(so=>{ro.deleteIndex(so.name),En(ro,so)}),no.del.forEach(so=>ro.deleteIndex(so))}});const Jr=Zr._cfg.contentUpgrade;if(Jr&&Zr._cfg.version>Lr){vn(Nr,zr),Hr._memoizedTables={},Gr=!0;let no=w$3(Wr);Yr.del.forEach(lo=>{no[lo]=eo[lo]}),bn(Nr,[Nr.Transaction.prototype]),gn(Nr,[Nr.Transaction.prototype],t$4(no),no),Hr.schema=no;const ro=T$4(Jr);let so;ro&&et$1();const ao=je$1.follow(()=>{if(so=Jr(Hr),so&&ro){var lo=tt$2.bind(null,null);so.then(lo,lo)}});return so&&typeof so.then=="function"?je$1.resolve(so):ao.then(()=>so)}}),Ur.push(eo=>{(!Gr||!xt$1)&&function(Wr,Yr){[].slice.call(Yr.db.objectStoreNames).forEach(Jr=>Wr[Jr]==null&&Yr.db.deleteObjectStore(Jr))}(Zr._cfg.dbschema,eo),bn(Nr,[Nr.Transaction.prototype]),gn(Nr,[Nr.Transaction.prototype],Nr._storeNames,Nr._dbSchema),Hr.schema=Nr._dbSchema})}),Kr().then(()=>{var Zr,eo;eo=zr,t$4(Zr=jr).forEach(Wr=>{eo.db.objectStoreNames.contains(Wr)||kn(eo,Wr,Zr[Wr].primKey,Zr[Wr].indexes)})})}(Tr,Cr,Dr,$r).catch(Mr)})}function xn(Tr,Cr){const $r={del:[],add:[],change:[]};let Ar;for(Ar in Tr)Cr[Ar]||$r.del.push(Ar);for(Ar in Cr){const Rr=Tr[Ar],Dr=Cr[Ar];if(Rr){const Mr={name:Ar,def:Dr,recreate:!1,del:[],add:[],change:[]};if(""+(Rr.primKey.keyPath||"")!=""+(Dr.primKey.keyPath||"")||Rr.primKey.auto!==Dr.primKey.auto&&!wt$1)Mr.recreate=!0,$r.change.push(Mr);else{const Br=Rr.idxByName,Nr=Dr.idxByName;let Lr;for(Lr in Br)Nr[Lr]||Mr.del.push(Lr);for(Lr in Nr){const Hr=Br[Lr],zr=Nr[Lr];Hr?Hr.src!==zr.src&&Mr.change.push(zr):Mr.add.push(zr)}(Mr.del.length>0||Mr.add.length>0||Mr.change.length>0)&&$r.change.push(Mr)}}else $r.add.push([Ar,Dr])}return $r}function kn(Tr,Cr,$r,Ar){const Rr=Tr.db.createObjectStore(Cr,$r.keyPath?{keyPath:$r.keyPath,autoIncrement:$r.auto}:{autoIncrement:$r.auto});return Ar.forEach(Dr=>En(Rr,Dr)),Rr}function En(Tr,Cr){Tr.createIndex(Cr.name,Cr.keyPath,{unique:Cr.unique,multiEntry:Cr.multi})}function Pn(Tr,Cr,$r){const Ar={};return p$6(Cr.objectStoreNames,0).forEach(Rr=>{const Dr=$r.objectStore(Rr);let Mr=Dr.keyPath;const Br=un(ln(Mr),Mr||"",!1,!1,!!Dr.autoIncrement,Mr&&typeof Mr!="string",!0),Nr=[];for(let Hr=0;Hr{if(Cr[Ar]!==null){var Rr=Cr[Ar].split(",").map((Mr,Br)=>{const Nr=(Mr=Mr.trim()).replace(/([&*]|\+\+)/g,""),Lr=/^\[/.test(Nr)?Nr.match(/^\[(.*)\]$/)[1].split("+"):Nr;return un(Nr,Lr||null,/\&/.test(Mr),/\*/.test(Mr),/\+\+/.test(Mr),n$7(Lr),Br===0)}),Dr=Rr.shift();if(Dr.multi)throw new X$2.Schema("Primary key cannot be multi-valued");Rr.forEach(Mr=>{if(Mr.auto)throw new X$2.Schema("Only primary key can be marked as autoIncrement (++)");if(!Mr.keyPath)throw new X$2.Schema("Index must have a name and cannot be an empty string")}),$r[Ar]=cn(Ar,Dr,Rr)}})}stores(Cr){const $r=this.db;this._cfg.storesSource=this._cfg.storesSource?r$5(this._cfg.storesSource,Cr):Cr;const Ar=$r._versions,Rr={};let Dr={};return Ar.forEach(Mr=>{r$5(Rr,Mr._cfg.storesSource),Dr=Mr._cfg.dbschema={},Mr._parseStoresSpec(Rr,Dr)}),$r._dbSchema=Dr,bn($r,[$r._allTables,$r,$r.Transaction.prototype]),gn($r,[$r._allTables,$r,$r.Transaction.prototype,this._cfg.tables],t$4(Dr),Dr),$r._storeNames=t$4(Dr),this}upgrade(Cr){return this._cfg.contentUpgrade=ue$1(this._cfg.contentUpgrade||ee$1,Cr),this}}function Sn(Tr,Cr){let $r=Tr._dbNamesDB;return $r||($r=Tr._dbNamesDB=new Xn(Pt$1,{addons:[],indexedDB:Tr,IDBKeyRange:Cr}),$r.version(1).stores({dbnames:"name"})),$r.table("dbnames")}function An(Tr){return Tr&&typeof Tr.databases=="function"}function Cn(Tr){return Ze$1(function(){return Oe.letThrough=!0,Tr()})}function jn(){var Tr;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Cr){var $r=function(){return indexedDB.databases().finally(Cr)};Tr=setInterval($r,100),$r()}).finally(function(){return clearInterval(Tr)}):Promise.resolve()}function Dn(Tr){const Cr=Tr._state,{indexedDB:$r}=Tr._deps;if(Cr.isBeingOpened||Tr.idbdb)return Cr.dbReadyPromise.then(()=>Cr.dbOpenError?ft$1(Cr.dbOpenError):Tr);R$3&&(Cr.openCanceller._stackHolder=q$2()),Cr.isBeingOpened=!0,Cr.dbOpenError=null,Cr.openComplete=!1;const Ar=Cr.openCanceller;function Rr(){if(Cr.openCanceller!==Ar)throw new X$2.DatabaseClosed("db.open() was cancelled")}let Dr=Cr.dbReadyResolve,Mr=null,Br=!1;return je$1.race([Ar,(typeof navigator>"u"?je$1.resolve():jn()).then(()=>new je$1((Nr,Lr)=>{if(Rr(),!$r)throw new X$2.MissingAPI;const Hr=Tr.name,zr=Cr.autoSchema?$r.open(Hr):$r.open(Hr,Math.round(10*Tr.verno));if(!zr)throw new X$2.MissingAPI;zr.onerror=tn(Lr),zr.onblocked=Ye(Tr._fireOnBlocked),zr.onupgradeneeded=Ye(Ur=>{if(Mr=zr.transaction,Cr.autoSchema&&!Tr._options.allowEmptyDB){zr.onerror=nn,Mr.abort(),zr.result.close();const jr=$r.deleteDatabase(Hr);jr.onsuccess=jr.onerror=Ye(()=>{Lr(new X$2.NoSuchDatabase(`Database ${Hr} doesnt exist`))})}else{Mr.onerror=tn(Lr);var Vr=Ur.oldVersion>Math.pow(2,62)?0:Ur.oldVersion;Br=Vr<1,Tr._novip.idbdb=zr.result,wn(Tr,Vr/10,Mr,Lr)}},Lr),zr.onsuccess=Ye(()=>{Mr=null;const Ur=Tr._novip.idbdb=zr.result,Vr=p$6(Ur.objectStoreNames);if(Vr.length>0)try{const Gr=Ur.transaction((jr=Vr).length===1?jr[0]:jr,"readonly");Cr.autoSchema?function({_novip:Xr},Kr,Zr){Xr.verno=Kr.version/10;const eo=Xr._dbSchema=Pn(0,Kr,Zr);Xr._storeNames=p$6(Kr.objectStoreNames,0),gn(Xr,[Xr._allTables],t$4(eo),eo)}(Tr,Ur,Gr):(Kn(Tr,Tr._dbSchema,Gr),function(Xr,Kr){const Zr=xn(Pn(0,Xr.idbdb,Kr),Xr._dbSchema);return!(Zr.add.length||Zr.change.some(eo=>eo.add.length||eo.change.length))}(Tr,Gr)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),vn(Tr,Gr)}catch{}var jr;_t$1.push(Tr),Ur.onversionchange=Ye(Gr=>{Cr.vcFired=!0,Tr.on("versionchange").fire(Gr)}),Ur.onclose=Ye(Gr=>{Tr.on("close").fire(Gr)}),Br&&function({indexedDB:Gr,IDBKeyRange:Xr},Kr){!An(Gr)&&Kr!==Pt$1&&Sn(Gr,Xr).put({name:Kr}).catch(ee$1)}(Tr._deps,Hr),Nr()},Lr)}))]).then(()=>(Rr(),Cr.onReadyBeingFired=[],je$1.resolve(Cn(()=>Tr.on.ready.fire(Tr.vip))).then(function Nr(){if(Cr.onReadyBeingFired.length>0){let Lr=Cr.onReadyBeingFired.reduce(ue$1,ee$1);return Cr.onReadyBeingFired=[],je$1.resolve(Cn(()=>Lr(Tr.vip))).then(Nr)}}))).finally(()=>{Cr.onReadyBeingFired=null,Cr.isBeingOpened=!1}).then(()=>Tr).catch(Nr=>{Cr.dbOpenError=Nr;try{Mr&&Mr.abort()}catch{}return Ar===Cr.openCanceller&&Tr._close(),ft$1(Nr)}).finally(()=>{Cr.openComplete=!0,Dr()})}function In(Tr){var Cr=Dr=>Tr.next(Dr),$r=Rr(Cr),Ar=Rr(Dr=>Tr.throw(Dr));function Rr(Dr){return Mr=>{var Br=Dr(Mr),Nr=Br.value;return Br.done?Nr:Nr&&typeof Nr.then=="function"?Nr.then($r,Ar):n$7(Nr)?Promise.all(Nr).then($r,Ar):$r(Nr)}}return Rr(Cr)()}function Bn(Tr,Cr,$r){var Ar=arguments.length;if(Ar<2)throw new X$2.InvalidArgument("Too few arguments");for(var Rr=new Array(Ar-1);--Ar;)Rr[Ar-1]=arguments[Ar];return $r=Rr.pop(),[Tr,k$2(Rr),$r]}function Tn(Tr,Cr,$r,Ar,Rr){return je$1.resolve().then(()=>{const Dr=Oe.transless||Oe,Mr=Tr._createTransaction(Cr,$r,Tr._dbSchema,Ar),Br={trans:Mr,transless:Dr};if(Ar)Mr.idbtrans=Ar.idbtrans;else try{Mr.create(),Tr._state.PR1398_maxLoop=3}catch(zr){return zr.name===H$3.InvalidState&&Tr.isOpen()&&--Tr._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),Tr._close(),Tr.open().then(()=>Tn(Tr,Cr,$r,null,Rr))):ft$1(zr)}const Nr=T$4(Rr);let Lr;Nr&&et$1();const Hr=je$1.follow(()=>{if(Lr=Rr.call(Mr,Mr),Lr)if(Nr){var zr=tt$2.bind(null,null);Lr.then(zr,zr)}else typeof Lr.next=="function"&&typeof Lr.throw=="function"&&(Lr=In(Lr))},Br);return(Lr&&typeof Lr.then=="function"?je$1.resolve(Lr).then(zr=>Mr.active?zr:ft$1(new X$2.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):Hr.then(()=>Lr)).then(zr=>(Ar&&Mr._resolve(),Mr._completion.then(()=>zr))).catch(zr=>(Mr._reject(zr),ft$1(zr)))})}function Rn(Tr,Cr,$r){const Ar=n$7(Tr)?Tr.slice():[Tr];for(let Rr=0;Rr<$r;++Rr)Ar.push(Cr);return Ar}const Fn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(Tr){return{...Tr,table(Cr){const $r=Tr.table(Cr),{schema:Ar}=$r,Rr={},Dr=[];function Mr(Hr,zr,Ur){const Vr=yn(Hr),jr=Rr[Vr]=Rr[Vr]||[],Gr=Hr==null?0:typeof Hr=="string"?1:Hr.length,Xr=zr>0,Kr={...Ur,isVirtual:Xr,keyTail:zr,keyLength:Gr,extractKey:dn(Hr),unique:!Xr&&Ur.unique};return jr.push(Kr),Kr.isPrimaryKey||Dr.push(Kr),Gr>1&&Mr(Gr===2?Hr[0]:Hr.slice(0,Gr-1),zr+1,Ur),jr.sort((Zr,eo)=>Zr.keyTail-eo.keyTail),Kr}const Br=Mr(Ar.primaryKey.keyPath,0,Ar.primaryKey);Rr[":id"]=[Br];for(const Hr of Ar.indexes)Mr(Hr.keyPath,0,Hr);function Nr(Hr){const zr=Hr.query.index;return zr.isVirtual?{...Hr,query:{index:zr,range:(Ur=Hr.query.range,Vr=zr.keyTail,{type:Ur.type===1?2:Ur.type,lower:Rn(Ur.lower,Ur.lowerOpen?Tr.MAX_KEY:Tr.MIN_KEY,Vr),lowerOpen:!0,upper:Rn(Ur.upper,Ur.upperOpen?Tr.MIN_KEY:Tr.MAX_KEY,Vr),upperOpen:!0})}}:Hr;var Ur,Vr}return{...$r,schema:{...Ar,primaryKey:Br,indexes:Dr,getIndexByKeyPath:function(Hr){const zr=Rr[yn(Hr)];return zr&&zr[0]}},count:Hr=>$r.count(Nr(Hr)),query:Hr=>$r.query(Nr(Hr)),openCursor(Hr){const{keyTail:zr,isVirtual:Ur,keyLength:Vr}=Hr.query.index;return Ur?$r.openCursor(Nr(Hr)).then(jr=>jr&&function(Gr){return Object.create(Gr,{continue:{value:function(Kr){Kr!=null?Gr.continue(Rn(Kr,Hr.reverse?Tr.MAX_KEY:Tr.MIN_KEY,zr)):Hr.unique?Gr.continue(Gr.key.slice(0,Vr).concat(Hr.reverse?Tr.MIN_KEY:Tr.MAX_KEY,zr)):Gr.continue()}},continuePrimaryKey:{value(Kr,Zr){Gr.continuePrimaryKey(Rn(Kr,Tr.MAX_KEY,zr),Zr)}},primaryKey:{get:()=>Gr.primaryKey},key:{get(){const Kr=Gr.key;return Vr===1?Kr[0]:Kr.slice(0,Vr)}},value:{get:()=>Gr.value}})}(jr)):$r.openCursor(Hr)}}}}}};function Mn(Tr,Cr,$r,Ar){return $r=$r||{},Ar=Ar||"",t$4(Tr).forEach(Rr=>{if(o$4(Cr,Rr)){var Dr=Tr[Rr],Mr=Cr[Rr];if(typeof Dr=="object"&&typeof Mr=="object"&&Dr&&Mr){const Br=C$3(Dr);Br!==C$3(Mr)?$r[Ar+Rr]=Cr[Rr]:Br==="Object"?Mn(Dr,Mr,$r,Ar+Rr+"."):Dr!==Mr&&($r[Ar+Rr]=Cr[Rr])}else Dr!==Mr&&($r[Ar+Rr]=Cr[Rr])}else $r[Ar+Rr]=void 0}),t$4(Cr).forEach(Rr=>{o$4(Tr,Rr)||($r[Ar+Rr]=Cr[Rr])}),$r}const Nn={stack:"dbcore",name:"HooksMiddleware",level:2,create:Tr=>({...Tr,table(Cr){const $r=Tr.table(Cr),{primaryKey:Ar}=$r.schema;return{...$r,mutate(Dr){const Mr=Oe.trans,{deleting:Br,creating:Nr,updating:Lr}=Mr.table(Cr).hook;switch(Dr.type){case"add":if(Nr.fire===ee$1)break;return Mr._promise("readwrite",()=>Hr(Dr),!0);case"put":if(Nr.fire===ee$1&&Lr.fire===ee$1)break;return Mr._promise("readwrite",()=>Hr(Dr),!0);case"delete":if(Br.fire===ee$1)break;return Mr._promise("readwrite",()=>Hr(Dr),!0);case"deleteRange":if(Br.fire===ee$1)break;return Mr._promise("readwrite",()=>function(Ur){return zr(Ur.trans,Ur.range,1e4)}(Dr),!0)}return $r.mutate(Dr);function Hr(Ur){const Vr=Oe.trans,jr=Ur.keys||function(Gr,Xr){return Xr.type==="delete"?Xr.keys:Xr.keys||Xr.values.map(Gr.extractKey)}(Ar,Ur);if(!jr)throw new Error("Keys missing");return(Ur=Ur.type==="add"||Ur.type==="put"?{...Ur,keys:jr}:{...Ur}).type!=="delete"&&(Ur.values=[...Ur.values]),Ur.keys&&(Ur.keys=[...Ur.keys]),function(Gr,Xr,Kr){return Xr.type==="add"?Promise.resolve([]):Gr.getMany({trans:Xr.trans,keys:Kr,cache:"immutable"})}($r,Ur,jr).then(Gr=>{const Xr=jr.map((Kr,Zr)=>{const eo=Gr[Zr],Wr={onerror:null,onsuccess:null};if(Ur.type==="delete")Br.fire.call(Wr,Kr,eo,Vr);else if(Ur.type==="add"||eo===void 0){const Yr=Nr.fire.call(Wr,Kr,Ur.values[Zr],Vr);Kr==null&&Yr!=null&&(Kr=Yr,Ur.keys[Zr]=Kr,Ar.outbound||_$2(Ur.values[Zr],Ar.keyPath,Kr))}else{const Yr=Mn(eo,Ur.values[Zr]),Jr=Lr.fire.call(Wr,Yr,Kr,eo,Vr);if(Jr){const no=Ur.values[Zr];Object.keys(Jr).forEach(ro=>{o$4(no,ro)?no[ro]=Jr[ro]:_$2(no,ro,Jr[ro])})}}return Wr});return $r.mutate(Ur).then(({failures:Kr,results:Zr,numFailures:eo,lastResult:Wr})=>{for(let Yr=0;Yr(Xr.forEach(Zr=>Zr.onerror&&Zr.onerror(Kr)),Promise.reject(Kr)))})}function zr(Ur,Vr,jr){return $r.query({trans:Ur,values:!1,query:{index:Ar,range:Vr},limit:jr}).then(({result:Gr})=>Hr({type:"delete",keys:Gr,trans:Ur}).then(Xr=>Xr.numFailures>0?Promise.reject(Xr.failures[0]):Gr.length({table:Cr=>{const $r=Tr.table(Cr);return{...$r,getMany:Ar=>{if(!Ar.cache)return $r.getMany(Ar);const Rr=qn(Ar.keys,Ar.trans._cache,Ar.cache==="clone");return Rr?je$1.resolve(Rr):$r.getMany(Ar).then(Dr=>(Ar.trans._cache={keys:Ar.keys,values:Ar.cache==="clone"?O$3(Dr):Dr},Dr))},mutate:Ar=>(Ar.type!=="add"&&(Ar.trans._cache=null),$r.mutate(Ar))}}})};function Un(Tr){return!("from"in Tr)}const Ln=function(Tr,Cr){if(!this){const $r=new Ln;return Tr&&"d"in Tr&&r$5($r,Tr),$r}r$5(this,arguments.length?{d:1,from:Tr,to:arguments.length>1?Cr:Tr}:{d:0})};function Vn(Tr,Cr,$r){const Ar=$t$1(Cr,$r);if(isNaN(Ar))return;if(Ar>0)throw RangeError();if(Un(Tr))return r$5(Tr,{from:Cr,to:$r,d:1});const Rr=Tr.l,Dr=Tr.r;if($t$1($r,Tr.from)<0)return Rr?Vn(Rr,Cr,$r):Tr.l={from:Cr,to:$r,d:1,l:null,r:null},Gn(Tr);if($t$1(Cr,Tr.to)>0)return Dr?Vn(Dr,Cr,$r):Tr.r={from:Cr,to:$r,d:1,l:null,r:null},Gn(Tr);$t$1(Cr,Tr.from)<0&&(Tr.from=Cr,Tr.l=null,Tr.d=Dr?Dr.d+1:1),$t$1($r,Tr.to)>0&&(Tr.to=$r,Tr.r=null,Tr.d=Tr.l?Tr.l.d+1:1);const Mr=!Tr.r;Rr&&!Tr.l&&Wn(Tr,Rr),Dr&&Mr&&Wn(Tr,Dr)}function Wn(Tr,Cr){Un(Cr)||function $r(Ar,{from:Rr,to:Dr,l:Mr,r:Br}){Vn(Ar,Rr,Dr),Mr&&$r(Ar,Mr),Br&&$r(Ar,Br)}(Tr,Cr)}function Yn(Tr,Cr){const $r=zn(Cr);let Ar=$r.next();if(Ar.done)return!1;let Rr=Ar.value;const Dr=zn(Tr);let Mr=Dr.next(Rr.from),Br=Mr.value;for(;!Ar.done&&!Mr.done;){if($t$1(Br.from,Rr.to)<=0&&$t$1(Br.to,Rr.from)>=0)return!0;$t$1(Rr.from,Br.from)<0?Rr=(Ar=$r.next(Br.from)).value:Br=(Mr=Dr.next(Rr.from)).value}return!1}function zn(Tr){let Cr=Un(Tr)?null:{s:0,n:Tr};return{next($r){const Ar=arguments.length>0;for(;Cr;)switch(Cr.s){case 0:if(Cr.s=1,Ar)for(;Cr.n.l&&$t$1($r,Cr.n.from)<0;)Cr={up:Cr,n:Cr.n.l,s:1};else for(;Cr.n.l;)Cr={up:Cr,n:Cr.n.l,s:1};case 1:if(Cr.s=2,!Ar||$t$1($r,Cr.n.to)<=0)return{value:Cr.n,done:!1};case 2:if(Cr.n.r){Cr.s=3,Cr={up:Cr,n:Cr.n.r,s:0};continue}case 3:Cr=Cr.up}return{done:!0}}}}function Gn(Tr){var Cr,$r;const Ar=(((Cr=Tr.r)===null||Cr===void 0?void 0:Cr.d)||0)-((($r=Tr.l)===null||$r===void 0?void 0:$r.d)||0),Rr=Ar>1?"r":Ar<-1?"l":"";if(Rr){const Dr=Rr==="r"?"l":"r",Mr={...Tr},Br=Tr[Rr];Tr.from=Br.from,Tr.to=Br.to,Tr[Rr]=Br[Rr],Mr[Rr]=Br[Dr],Tr[Dr]=Mr,Mr.d=Hn(Mr)}Tr.d=Hn(Tr)}function Hn({r:Tr,l:Cr}){return(Tr?Cr?Math.max(Tr.d,Cr.d):Tr.d:Cr?Cr.d:0)+1}a$6(Ln.prototype,{add(Tr){return Wn(this,Tr),this},addKey(Tr){return Vn(this,Tr,Tr),this},addKeys(Tr){return Tr.forEach(Cr=>Vn(this,Cr,Cr)),this},[j$1](){return zn(this)}});const Qn={stack:"dbcore",level:0,create:Tr=>{const Cr=Tr.schema.name,$r=new Ln(Tr.MIN_KEY,Tr.MAX_KEY);return{...Tr,table:Ar=>{const Rr=Tr.table(Ar),{schema:Dr}=Rr,{primaryKey:Mr}=Dr,{extractKey:Br,outbound:Nr}=Mr,Lr={...Rr,mutate:Ur=>{const Vr=Ur.trans,jr=Vr.mutatedParts||(Vr.mutatedParts={}),Gr=Jr=>{const no=`idb://${Cr}/${Ar}/${Jr}`;return jr[no]||(jr[no]=new Ln)},Xr=Gr(""),Kr=Gr(":dels"),{type:Zr}=Ur;let[eo,Wr]=Ur.type==="deleteRange"?[Ur.range]:Ur.type==="delete"?[Ur.keys]:Ur.values.length<50?[[],Ur.values]:[];const Yr=Ur.trans._cache;return Rr.mutate(Ur).then(Jr=>{if(n$7(eo)){Zr!=="delete"&&(eo=Jr.results),Xr.addKeys(eo);const no=qn(eo,Yr);no||Zr==="add"||Kr.addKeys(eo),(no||Wr)&&function(ro,so,ao,lo){function po(go){const co=ro(go.name||"");function mo(uo){return uo!=null?go.extractKey(uo):null}const io=uo=>go.multiEntry&&n$7(uo)?uo.forEach(ho=>co.addKey(ho)):co.addKey(uo);(ao||lo).forEach((uo,ho)=>{const yo=ao&&mo(ao[ho]),So=lo&&mo(lo[ho]);$t$1(yo,So)!==0&&(yo!=null&&io(yo),So!=null&&io(So))})}so.indexes.forEach(po)}(Gr,Dr,no,Wr)}else if(eo){const no={from:eo.lower,to:eo.upper};Kr.add(no),Xr.add(no)}else Xr.add($r),Kr.add($r),Dr.indexes.forEach(no=>Gr(no.name).add($r));return Jr})}},Hr=({query:{index:Ur,range:Vr}})=>{var jr,Gr;return[Ur,new Ln((jr=Vr.lower)!==null&&jr!==void 0?jr:Tr.MIN_KEY,(Gr=Vr.upper)!==null&&Gr!==void 0?Gr:Tr.MAX_KEY)]},zr={get:Ur=>[Mr,new Ln(Ur.key)],getMany:Ur=>[Mr,new Ln().addKeys(Ur.keys)],count:Hr,query:Hr,openCursor:Hr};return t$4(zr).forEach(Ur=>{Lr[Ur]=function(Vr){const{subscr:jr}=Oe;if(jr){const Gr=Wr=>{const Yr=`idb://${Cr}/${Ar}/${Wr}`;return jr[Yr]||(jr[Yr]=new Ln)},Xr=Gr(""),Kr=Gr(":dels"),[Zr,eo]=zr[Ur](Vr);if(Gr(Zr.name||"").add(eo),!Zr.isPrimaryKey){if(Ur!=="count"){const Wr=Ur==="query"&&Nr&&Vr.values&&Rr.query({...Vr,values:!1});return Rr[Ur].apply(this,arguments).then(Yr=>{if(Ur==="query"){if(Nr&&Vr.values)return Wr.then(({result:no})=>(Xr.addKeys(no),Yr));const Jr=Vr.values?Yr.result.map(Br):Yr.result;Vr.values?Xr.addKeys(Jr):Kr.addKeys(Jr)}else if(Ur==="openCursor"){const Jr=Yr,no=Vr.values;return Jr&&Object.create(Jr,{key:{get:()=>(Kr.addKey(Jr.primaryKey),Jr.key)},primaryKey:{get(){const ro=Jr.primaryKey;return Kr.addKey(ro),ro}},value:{get:()=>(no&&Xr.addKey(Jr.primaryKey),Jr.value)}})}return Yr})}Kr.add($r)}}return Rr[Ur].apply(this,arguments)}}),Lr}}}};class Xn{constructor(Cr,$r){this._middlewares={},this.verno=0;const Ar=Xn.dependencies;this._options=$r={addons:Xn.addons,autoOpen:!0,indexedDB:Ar.indexedDB,IDBKeyRange:Ar.IDBKeyRange,...$r},this._deps={indexedDB:$r.indexedDB,IDBKeyRange:$r.IDBKeyRange};const{addons:Rr}=$r;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const Dr={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:ee$1,dbReadyPromise:null,cancelOpen:ee$1,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var Mr;Dr.dbReadyPromise=new je$1(Br=>{Dr.dbReadyResolve=Br}),Dr.openCanceller=new je$1((Br,Nr)=>{Dr.cancelOpen=Nr}),this._state=Dr,this.name=Cr,this.on=Dt(this,"populate","blocked","versionchange","close",{ready:[ue$1,ee$1]}),this.on.ready.subscribe=y$4(this.on.ready.subscribe,Br=>(Nr,Lr)=>{Xn.vip(()=>{const Hr=this._state;if(Hr.openComplete)Hr.dbOpenError||je$1.resolve().then(Nr),Lr&&Br(Nr);else if(Hr.onReadyBeingFired)Hr.onReadyBeingFired.push(Nr),Lr&&Br(Nr);else{Br(Nr);const zr=this;Lr||Br(function Ur(){zr.on.ready.unsubscribe(Nr),zr.on.ready.unsubscribe(Ur)})}})}),this.Collection=(Mr=this,It(Vt.prototype,function(Br,Nr){this.db=Mr;let Lr=At,Hr=null;if(Nr)try{Lr=Nr()}catch(jr){Hr=jr}const zr=Br._ctx,Ur=zr.table,Vr=Ur.hook.reading.fire;this._ctx={table:Ur,index:zr.index,isPrimKey:!zr.index||Ur.schema.primKey.keyPath&&zr.index===Ur.schema.primKey.name,range:Lr,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Hr,or:zr.or,valueMapper:Vr!==te$1?Vr:null}})),this.Table=function(Br){return It(jt.prototype,function(Nr,Lr,Hr){this.db=Br,this._tx=Hr,this.name=Nr,this.schema=Lr,this.hook=Br._allTables[Nr]?Br._allTables[Nr].hook:Dt(null,{creating:[se$2,ee$1],reading:[ne$3,te$1],updating:[oe$2,ee$1],deleting:[ie$3,ee$1]})})}(this),this.Transaction=function(Br){return It(an.prototype,function(Nr,Lr,Hr,zr,Ur){this.db=Br,this.mode=Nr,this.storeNames=Lr,this.schema=Hr,this.chromeTransactionDurability=zr,this.idbtrans=null,this.on=Dt(this,"complete","error","abort"),this.parent=Ur||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new je$1((Vr,jr)=>{this._resolve=Vr,this._reject=jr}),this._completion.then(()=>{this.active=!1,this.on.complete.fire()},Vr=>{var jr=this.active;return this.active=!1,this.on.error.fire(Vr),this.parent?this.parent._reject(Vr):jr&&this.idbtrans&&this.idbtrans.abort(),ft$1(Vr)})})}(this),this.Version=function(Br){return It(On.prototype,function(Nr){this.db=Br,this._cfg={version:Nr,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(Br){return It(en.prototype,function(Nr,Lr,Hr){this.db=Br,this._ctx={table:Nr,index:Lr===":id"?null:Lr,or:Hr};const zr=Br._deps.indexedDB;if(!zr)throw new X$2.MissingAPI;this._cmp=this._ascending=zr.cmp.bind(zr),this._descending=(Ur,Vr)=>zr.cmp(Vr,Ur),this._max=(Ur,Vr)=>zr.cmp(Ur,Vr)>0?Ur:Vr,this._min=(Ur,Vr)=>zr.cmp(Ur,Vr)<0?Ur:Vr,this._IDBKeyRange=Br._deps.IDBKeyRange})}(this),this.on("versionchange",Br=>{Br.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()}),this.on("blocked",Br=>{!Br.newVersion||Br.newVersionnew this.Transaction(Br,Nr,Lr,this._options.chromeTransactionDurability,Hr),this._fireOnBlocked=Br=>{this.on("blocked").fire(Br),_t$1.filter(Nr=>Nr.name===this.name&&Nr!==this&&!Nr._state.vcFired).map(Nr=>Nr.on("versionchange").fire(Br))},this.use(Fn),this.use(Nn),this.use(Qn),this.use($n),this.vip=Object.create(this,{_vip:{value:!0}}),Rr.forEach(Br=>Br(this))}version(Cr){if(isNaN(Cr)||Cr<.1)throw new X$2.Type("Given version is not a positive number");if(Cr=Math.round(10*Cr)/10,this.idbdb||this._state.isBeingOpened)throw new X$2.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,Cr);const $r=this._versions;var Ar=$r.filter(Rr=>Rr._cfg.version===Cr)[0];return Ar||(Ar=new this.Version(Cr),$r.push(Ar),$r.sort(_n),Ar.stores({}),this._state.autoSchema=!1,Ar)}_whenReady(Cr){return this.idbdb&&(this._state.openComplete||Oe.letThrough||this._vip)?Cr():new je$1(($r,Ar)=>{if(this._state.openComplete)return Ar(new X$2.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void Ar(new X$2.DatabaseClosed);this.open().catch(ee$1)}this._state.dbReadyPromise.then($r,Ar)}).then(Cr)}use({stack:Cr,create:$r,level:Ar,name:Rr}){Rr&&this.unuse({stack:Cr,name:Rr});const Dr=this._middlewares[Cr]||(this._middlewares[Cr]=[]);return Dr.push({stack:Cr,create:$r,level:Ar??10,name:Rr}),Dr.sort((Mr,Br)=>Mr.level-Br.level),this}unuse({stack:Cr,name:$r,create:Ar}){return Cr&&this._middlewares[Cr]&&(this._middlewares[Cr]=this._middlewares[Cr].filter(Rr=>Ar?Rr.create!==Ar:!!$r&&Rr.name!==$r)),this}open(){return Dn(this)}_close(){const Cr=this._state,$r=_t$1.indexOf(this);if($r>=0&&_t$1.splice($r,1),this.idbdb){try{this.idbdb.close()}catch{}this._novip.idbdb=null}Cr.dbReadyPromise=new je$1(Ar=>{Cr.dbReadyResolve=Ar}),Cr.openCanceller=new je$1((Ar,Rr)=>{Cr.cancelOpen=Rr})}close(){this._close();const Cr=this._state;this._options.autoOpen=!1,Cr.dbOpenError=new X$2.DatabaseClosed,Cr.isBeingOpened&&Cr.cancelOpen(Cr.dbOpenError)}delete(){const Cr=arguments.length>0,$r=this._state;return new je$1((Ar,Rr)=>{const Dr=()=>{this.close();var Mr=this._deps.indexedDB.deleteDatabase(this.name);Mr.onsuccess=Ye(()=>{(function({indexedDB:Br,IDBKeyRange:Nr},Lr){!An(Br)&&Lr!==Pt$1&&Sn(Br,Nr).delete(Lr).catch(ee$1)})(this._deps,this.name),Ar()}),Mr.onerror=tn(Rr),Mr.onblocked=this._fireOnBlocked};if(Cr)throw new X$2.InvalidArgument("Arguments not allowed in db.delete()");$r.isBeingOpened?$r.dbReadyPromise.then(Dr):Dr()})}backendDB(){return this.idbdb}isOpen(){return this.idbdb!==null}hasBeenClosed(){const Cr=this._state.dbOpenError;return Cr&&Cr.name==="DatabaseClosed"}hasFailed(){return this._state.dbOpenError!==null}dynamicallyOpened(){return this._state.autoSchema}get tables(){return t$4(this._allTables).map(Cr=>this._allTables[Cr])}transaction(){const Cr=Bn.apply(this,arguments);return this._transaction.apply(this,Cr)}_transaction(Cr,$r,Ar){let Rr=Oe.trans;Rr&&Rr.db===this&&Cr.indexOf("!")===-1||(Rr=null);const Dr=Cr.indexOf("?")!==-1;let Mr,Br;Cr=Cr.replace("!","").replace("?","");try{if(Br=$r.map(Lr=>{var Hr=Lr instanceof this.Table?Lr.name:Lr;if(typeof Hr!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return Hr}),Cr=="r"||Cr===Kt)Mr=Kt;else{if(Cr!="rw"&&Cr!=Ot)throw new X$2.InvalidArgument("Invalid transaction mode: "+Cr);Mr=Ot}if(Rr){if(Rr.mode===Kt&&Mr===Ot){if(!Dr)throw new X$2.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");Rr=null}Rr&&Br.forEach(Lr=>{if(Rr&&Rr.storeNames.indexOf(Lr)===-1){if(!Dr)throw new X$2.SubTransaction("Table "+Lr+" not included in parent transaction.");Rr=null}}),Dr&&Rr&&!Rr.active&&(Rr=null)}}catch(Lr){return Rr?Rr._promise(null,(Hr,zr)=>{zr(Lr)}):ft$1(Lr)}const Nr=Tn.bind(null,this,Mr,Br,Rr,Ar);return Rr?Rr._promise(Mr,Nr,"lock"):Oe.trans?at$1(Oe.transless,()=>this._whenReady(Nr)):this._whenReady(Nr)}table(Cr){if(!o$4(this._allTables,Cr))throw new X$2.InvalidTable(`Table ${Cr} does not exist`);return this._allTables[Cr]}}const Jn=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable";class Zn{constructor(Cr){this._subscribe=Cr}subscribe(Cr,$r,Ar){return this._subscribe(Cr&&typeof Cr!="function"?Cr:{next:Cr,error:$r,complete:Ar})}[Jn](){return this}}function er(Tr,Cr){return t$4(Cr).forEach($r=>{Wn(Tr[$r]||(Tr[$r]=new Ln),Cr[$r])}),Tr}function tr$1(Tr){let Cr,$r=!1;const Ar=new Zn(Rr=>{const Dr=T$4(Tr);let Mr=!1,Br={},Nr={};const Lr={get closed(){return Mr},unsubscribe:()=>{Mr=!0,on$1.storagemutated.unsubscribe(Vr)}};Rr.start&&Rr.start(Lr);let Hr=!1,zr=!1;function Ur(){return t$4(Nr).some(Gr=>Br[Gr]&&Yn(Br[Gr],Nr[Gr]))}const Vr=Gr=>{er(Br,Gr),Ur()&&jr()},jr=()=>{if(Hr||Mr)return;Br={};const Gr={},Xr=function(Kr){Dr&&et$1();const Zr=()=>Ze$1(Tr,{subscr:Kr,trans:null}),eo=Oe.trans?at$1(Oe.transless,Zr):Zr();return Dr&&eo.then(tt$2,tt$2),eo}(Gr);zr||(on$1(rn,Vr),zr=!0),Hr=!0,Promise.resolve(Xr).then(Kr=>{$r=!0,Cr=Kr,Hr=!1,Mr||(Ur()?jr():(Br={},Nr=Gr,Rr.next&&Rr.next(Kr)))},Kr=>{Hr=!1,$r=!1,Rr.error&&Rr.error(Kr),Lr.unsubscribe()})};return jr(),Lr});return Ar.hasValue=()=>$r,Ar.getValue=()=>Cr,Ar}let nr;try{nr={indexedDB:e$4.indexedDB||e$4.mozIndexedDB||e$4.webkitIndexedDB||e$4.msIndexedDB,IDBKeyRange:e$4.IDBKeyRange||e$4.webkitIDBKeyRange}}catch{nr={indexedDB:null,IDBKeyRange:null}}const rr=Xn;function sr(Tr){let Cr=ir;try{ir=!0,on$1.storagemutated.fire(Tr)}finally{ir=Cr}}a$6(rr,{...Z$3,delete:Tr=>new rr(Tr,{addons:[]}).delete(),exists:Tr=>new rr(Tr,{addons:[]}).open().then(Cr=>(Cr.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(Tr){try{return function({indexedDB:Cr,IDBKeyRange:$r}){return An(Cr)?Promise.resolve(Cr.databases()).then(Ar=>Ar.map(Rr=>Rr.name).filter(Rr=>Rr!==Pt$1)):Sn(Cr,$r).toCollection().primaryKeys()}(rr.dependencies).then(Tr)}catch{return ft$1(new X$2.MissingAPI)}},defineClass:()=>function(Tr){r$5(this,Tr)},ignoreTransaction:Tr=>Oe.trans?at$1(Oe.transless,Tr):Tr(),vip:Cn,async:function(Tr){return function(){try{var Cr=In(Tr.apply(this,arguments));return Cr&&typeof Cr.then=="function"?Cr:je$1.resolve(Cr)}catch($r){return ft$1($r)}}},spawn:function(Tr,Cr,$r){try{var Ar=In(Tr.apply($r,Cr||[]));return Ar&&typeof Ar.then=="function"?Ar:je$1.resolve(Ar)}catch(Rr){return ft$1(Rr)}},currentTransaction:{get:()=>Oe.trans||null},waitFor:function(Tr,Cr){const $r=je$1.resolve(typeof Tr=="function"?rr.ignoreTransaction(Tr):Tr).timeout(Cr||6e4);return Oe.trans?Oe.trans.waitFor($r):$r},Promise:je$1,debug:{get:()=>R$3,set:Tr=>{F$3(Tr,Tr==="dexie"?()=>!0:Et)}},derive:c$5,extend:r$5,props:a$6,override:y$4,Events:Dt,on:on$1,liveQuery:tr$1,extendObservabilitySet:er,getByKeyPath:b$5,setByKeyPath:_$2,delByKeyPath:function(Tr,Cr){typeof Cr=="string"?_$2(Tr,Cr,void 0):"length"in Cr&&[].map.call(Cr,function($r){_$2(Tr,$r,void 0)})},shallowClone:w$3,deepClone:O$3,getObjectDiff:Mn,cmp:$t$1,asap:v$5,minKey:vt$1,addons:[],connections:_t$1,errnames:H$3,dependencies:nr,semVer:yt$1,version:yt$1.split(".").map(Tr=>parseInt(Tr)).reduce((Tr,Cr,$r)=>Tr+Cr/Math.pow(10,2*$r))}),rr.maxKey=hn(rr.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(on$1(rn,Tr=>{if(!ir){let Cr;wt$1?(Cr=document.createEvent("CustomEvent"),Cr.initCustomEvent(sn,!0,!0,Tr)):Cr=new CustomEvent(sn,{detail:Tr}),ir=!0,dispatchEvent(Cr),ir=!1}}),addEventListener(sn,({detail:Tr})=>{ir||sr(Tr)}));let ir=!1;if(typeof BroadcastChannel<"u"){const Tr=new BroadcastChannel(sn);typeof Tr.unref=="function"&&Tr.unref(),on$1(rn,Cr=>{ir||Tr.postMessage(Cr)}),Tr.onmessage=Cr=>{Cr.data&&sr(Cr.data)}}else if(typeof self<"u"&&typeof navigator<"u"){on$1(rn,Cr=>{try{ir||(typeof localStorage<"u"&&localStorage.setItem(sn,JSON.stringify({trig:Math.random(),changedParts:Cr})),typeof self.clients=="object"&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach($r=>$r.postMessage({type:sn,changedParts:Cr})))}catch{}}),typeof addEventListener<"u"&&addEventListener("storage",Cr=>{if(Cr.key===sn){const $r=JSON.parse(Cr.newValue);$r&&sr($r.changedParts)}});const Tr=self.document&&navigator.serviceWorker;Tr&&Tr.addEventListener("message",function({data:Cr}){Cr&&Cr.type===sn&&sr(Cr.changedParts)})}je$1.rejectionMapper=function(Tr,Cr){if(!Tr||Tr instanceof W$3||Tr instanceof TypeError||Tr instanceof SyntaxError||!Tr.name||!J$2[Tr.name])return Tr;var $r=new J$2[Tr.name](Cr||Tr.message,Tr);return"stack"in Tr&&l$5($r,"stack",{get:function(){return this.inner.stack}}),$r},F$3(R$3,Et);class AsyncQueue{constructor(){Fa(this,"queue");Fa(this,"pending");Fa(this,"listeners");Fa(this,"oneshotListeners");this.queue=[],this.pending=!1,this.listeners=new Map,this.oneshotListeners=new Map}enqueue(Cr){return this.queue.push(Cr),this.dequeue()}async dequeue(){if(this.pending)return;let Cr=this.queue.shift();for(;typeof Cr!="function"&&this.queue.length>0;)Cr=this.queue.shift();if(Cr)try{this.pending=!0;const $r=await Cr();return this.pending=!1,this.emit("result"),$r}catch($r){this.pending=!1,console.error("[TransactionQueue] uncaught error in async function call:",$r),this.emit("error")}finally{this.queue.length===0&&this.emit("complete"),this.dequeue()}}on(Cr,$r){const Ar=this.listeners.get(Cr);return Ar?Ar.push($r):this.listeners.set(Cr,[$r]),()=>{const Rr=this.listeners.get(Cr);if(!Rr)return;const Dr=Rr.findIndex(Mr=>Mr===$r);Dr>=0&&Rr.splice(Dr,1)}}once(Cr,$r){const Ar=this.oneshotListeners.get(Cr);Ar?Ar.push($r):this.listeners.set(Cr,[$r])}emit(Cr){var Ar;(Ar=this.listeners.get(Cr))==null||Ar.forEach(Rr=>Rr());const $r=this.oneshotListeners.get(Cr);$r&&($r.forEach(Rr=>Rr()),this.oneshotListeners.delete(Cr))}}class ActionsCache extends Xn{constructor(){super("TransactionsCache");Fa(this,"decks");Fa(this,"slides");Fa(this,"blocks");Fa(this,"apiTransactions",new AsyncQueue);IS_CLIENT&&(this.version(1).stores({decks:"++pk, id, action, folderId",slides:"++pk, id, action, deckId",blocks:"++pk, id, action, slideId"}),this.open().catch($r=>console.error("Failed to open IndexedDB",$r)))}getKnownTable($r){const Ar=$r.toLowerCase();let Rr;if(Ar.endsWith("slide")||Ar.endsWith("slides"))Rr="slides";else if(Ar.endsWith("deck")||Ar.endsWith("decks"))Rr="decks";else if(Ar.endsWith("block")||Ar.endsWith("blocks"))Rr="blocks";else throw new Error(`[ActionsCache] cannot resolve table from action: ${$r}`);return Rr}isActionType($r,Ar){return Ar.action===$r}insert($r,Ar){const Rr={...Ar,action:$r,timestamp:Date.now()},Dr=this.getKnownTable($r);return this[Dr].add(Rr)}async defer($r){const Ar={...$r.data,action:$r.action,timestamp:Date.now()},Rr=this.getKnownTable($r.action);let Dr;try{Dr=await this[Rr].add(Ar)}catch(Mr){console.error("[ActionsCache] error writing to IndexedDB:",Mr),await publishLog({channel:"custom-debugging",event:"dexie-add-error",description:Mr==null?void 0:Mr.toString(),notify:!1})}this.apiTransactions.enqueue(async()=>{try{const Mr=await $r.query($r.data);if(Mr!=null&&Mr.error)throw Mr.error}catch(Mr){console.error("[ActionsCache] uncaught error in deferred state query:",Mr),await publishLog({channel:"custom-debugging",event:"api-transaction-error",description:`error: ${Mr==null?void 0:Mr.toString()} | data: ${JSON.stringify($r.data)} | action: ${$r.action}`,notify:!1})}finally{Dr!==void 0&&await this[Rr].delete(Dr)}})}}const actionsCache=new ActionsCache;async function safeAsync(Tr){try{return await Tr}catch{return}}const useBlockStore=defineStore("blockStore",{state:()=>({blockData:{},dragBlockId:null,resizeBlockId:null,repositionImg:null,lastSave:new Date,loading:{},updates:new Map,updateTimer:-1,updatePk:null}),getters:{allBlocks:Tr=>Cr=>Object.keys(Tr.blockData).filter($r=>{var Ar,Rr;return((Ar=Tr.blockData[$r])==null?void 0:Ar.parent_id)===Cr&&!((Rr=Tr.blockData[$r])!=null&&Rr.is_deleted)}),allBlockPages:Tr=>Object.values(Tr.blockData).filter(Cr=>!(Cr!=null&&Cr.is_deleted)),title:Tr=>Cr=>{var $r;return(($r=Tr.blockData[Cr])==null?void 0:$r.title)??""},isAnyBlockDragging:Tr=>Tr.dragBlockId!=null,isAnyBlockResizing:Tr=>Tr.resizeBlockId!=null,currentDragBlockId:Tr=>Tr.dragBlockId,currentResizeBlockId:Tr=>Tr.resizeBlockId,isResizing:Tr=>Cr=>Tr.resizeBlockId===Cr,isRepositioningImg:Tr=>Cr=>Tr.repositionImg===Cr,blockObject:Tr=>Cr=>Tr.blockData[Cr]??{},isDeleted:Tr=>Cr=>{var $r;return(($r=Tr.blockData[Cr])==null?void 0:$r.is_deleted)??!1},type:Tr=>Cr=>{var $r;return($r=Tr.blockData[Cr])==null?void 0:$r.type},subtype:Tr=>Cr=>{var $r;return($r=Tr.blockData[Cr])==null?void 0:$r.subtype},config:Tr=>Cr=>{var $r;return(($r=Tr.blockData[Cr])==null?void 0:$r.config)??{}},aiObject:Tr=>Cr=>{var $r,Ar;return((Ar=($r=Tr.blockData[Cr])==null?void 0:$r.config)==null?void 0:Ar.ai)??{}},position:Tr=>Cr=>{var $r;return(($r=Tr.blockData[Cr])==null?void 0:$r.position)??{}},positionByDisplay:Tr=>(Cr,$r="desktop")=>{var Ar;return(((Ar=Tr.blockData[Cr])==null?void 0:Ar.position)??{})[$r]??{}},parentId:Tr=>Cr=>{var $r;return($r=Tr.blockData[Cr])==null?void 0:$r.parent_id},contentHeight:Tr=>Cr=>{var $r,Ar,Rr;return((Rr=(Ar=($r=Tr.blockData[Cr])==null?void 0:$r.config)==null?void 0:Ar.contentHeight)==null?void 0:Rr.value)??0},assignedSystems:Tr=>Cr=>{var $r,Ar;return(Cr&&((Ar=($r=Tr.blockData[Cr])==null?void 0:$r.config)==null?void 0:Ar.assignedSystems))??[]},aiGenSettings:Tr=>Cr=>{var $r,Ar,Rr;return((Rr=(Ar=($r=Tr.blockData[Cr])==null?void 0:$r.config)==null?void 0:Ar.aiGenSettings)==null?void 0:Rr.value)??{}},aiGenEnabled(Tr){return Cr=>{var Ar;return Tr.blockData[Cr]==null?!1:((Ar=this.aiGenSettings(Cr))==null?void 0:Ar.enabled)??!1}}},actions:{hydrateWithUndoRedo(Tr){if(Tr==null)return;const Cr=[];Tr.forEach(Ar=>{Ar!=null&&Ar.id!=null&&(lodashExports.isEqual(this.blockData[Ar.id],Ar)||Cr.push(lodashExports.cloneDeep(this.blockData[Ar.id])))}),this.hydrate(Tr),useUndoRedoStore().addToUndo({id:"hydrateBlock",context:{undo:{changes:lodashExports.cloneDeep(Cr).map(Ar=>({type:"block",id:Ar.id,action:"hydrate",value:Ar}))},redo:{changes:lodashExports.cloneDeep(Tr).map(Ar=>({type:"block",id:Ar.id,action:"hydrate",value:Ar}))}}})},hydrate(Tr){Tr!=null&&Tr.forEach(Cr=>{Cr!=null&&Cr.id!=null&&(lodashExports.isEqual(this.blockData[Cr.id],Cr)||(this.blockData[Cr.id]=Cr))})},hydrateImageUrl({url:Tr,blockId:Cr,config:$r}){const Ar=this.blockData[Cr];Ar!=null&&Ar.type==="image"&&Ar.config!=null&&Ar.config.source!=null&&Ar.config.source.value!==Tr&&(Ar.config={...Ar.config,...$r},Ar.config.source.value=Tr)},updateDeckTimestamp({blockId:Tr}){const Cr=usePageStore(),$r=useAppStore(),Ar=this.blockData[Tr];if(Ar==null)return;const Rr=Cr.pageObject(Ar.parent_id);if(Rr==null)return;const Dr=$r.appObject(Rr.parent_id);Dr!=null&&(Dr.updated_at=new Date().toISOString())},updateProps(Tr,Cr){const{keyPath:$r=[],value:Ar,saveInDatabase:Rr=!0}=Cr,Dr=this.blockData[Tr];if(Dr!=null&&!(Tr.length<32))try{let Mr=Dr;for(let Hr=0;Hr<$r.length-1;Hr+=1)Mr[$r[Hr]]||(Mr[$r[Hr]]={}),Mr=Mr[$r[Hr]];if(lodashExports.isEqual(Mr[$r[$r.length-1]],Ar)){log("same value, not updating");return}const Br=lodashExports.cloneDeep(Mr[$r[$r.length-1]]);if(Mr[$r[$r.length-1]]=Ar,this.updateDeckTimestamp({blockId:Tr}),!Rr)return;if(!Cr.skipUndo&&(!$r.includes("content")&&Dr.type==="text"||Dr.type!=="text")){log("adding to undo stack");const Hr=useUndoRedoStore(),zr=useUserStore(),Ur=usePageStore();Hr.addToUndo({id:"updateBlock",userId:zr.currentUserId,orgId:zr.currentOrgId,context:{blockId:Tr,slideId:Dr.parent_id,deckId:Ur.pageObject(Dr.parent_id).parent_id,isTransaction:!1,undo:{changes:[{type:"block",id:Tr,action:"updateProps",keyPath:$r,value:Br}]},redo:{changes:[{type:"block",id:Tr,action:"updateProps",keyPath:$r,value:lodashExports.cloneDeep(Ar)}]}}})}const Lr=this.updates.get(Tr);Lr?Lr[$r[0]]=Dr[$r[0]]:this.updates.set(Tr,{[$r[0]]:Dr[$r[0]]}),this.updateTimer>=0&&clearTimeout(this.updateTimer),this.updateTimer=window.setTimeout(()=>this.persistUpdates(),100)}catch(Mr){console.error(`${Mr} keyPath = ${$r}`)}},setDragBlockId(Tr){this.dragBlockId=Tr},setResizeBlockId(Tr){this.resizeBlockId=Tr},setRepositionImg(Tr){this.repositionImg=Tr},updatePosition(Tr,{positionObject:Cr,display:$r="desktop",density:Ar="normal",setByUser:Rr=!0,saveInDatabase:Dr=!0,skipUndo:Mr=!1}){const Br={...Cr,density:Ar,setByUser:Rr};this.updateProps(Tr,{keyPath:["position",$r],value:Br,saveInDatabase:Dr,skipUndo:Mr});const Nr=lodashExports.cloneDeep(this.blockObject(Tr).config);Nr!=null&&(Nr.positionX.value=Br.x,Nr.positionY.value=Br.y,Nr.positionWidth.value=Br.width,Nr.positionHeight.value=Br.height,this.updateProps(Tr,{keyPath:["config"],value:Nr,saveInDatabase:Dr,skipUndo:Mr}))},updateTitle(Tr,Cr){this.updateProps(Tr,{keyPath:["title"],value:Cr})},updatePageSubtype(Tr,Cr){this.updateProps(Tr,{keyPath:["subtype"],value:Cr})},moveBlock({id:Tr,action:Cr}){const $r=this.blockData[Tr];if($r==null)return;const{parent_id:Ar}=$r;if(Ar==null)return;const Rr=usePageStore(),Dr=Rr.children(Ar),Mr=Dr.indexOf(Tr);if(Mr!==-1){if(Cr==="moveUp"){if(Mr===0)return;const Br=[...Dr.slice(0,Mr-1),Dr[Mr],Dr[Mr-1],...Dr.slice(Mr+1)];Rr.updateProps(Ar,{keyPath:["children"],value:Br});return}if(Cr==="moveDown"){if(Mr===Dr.length-1)return;const Br=[...Dr.slice(0,Mr),Dr[Mr+1],Dr[Mr],...Dr.slice(Mr+2)];Rr.updateProps(Ar,{keyPath:["children"],value:Br});return}if(Cr==="moveForward"){if(Mr===0)return;const Br=[Dr[Mr],...Dr.slice(0,Mr),...Dr.slice(Mr+1)];Rr.updateProps(Ar,{keyPath:["children"],value:Br});return}if(Cr==="moveBackward"){if(Mr===Dr.length-1)return;const Br=[...Dr.slice(0,Mr),...Dr.slice(Mr+1),Dr[Mr]];Rr.updateProps(Ar,{keyPath:["children"],value:Br})}}},async persistUpdates(){if(this.updates.size===0)return;const Tr=this.updatePk,Cr={};let $r,Ar=!1;if(Tr!=null){for(const[Dr,Mr]of this.updates.entries())Cr[`blocks.${Dr}`]=lodashExports.cloneDeep(Mr);if(await safeAsync(actionsCache.blocks.update(Tr,Cr))===1){const Dr=await safeAsync(actionsCache.blocks.get(Tr));Dr?$r=Dr:Ar=!0}else Ar=!0}else Ar=!0;if(Ar){const Rr=useUserStore(),Dr=usePageStore(),Mr=new Set;let Br="";for(const[Nr,Lr]of this.updates.entries()){Cr[Nr]=lodashExports.cloneDeep(Lr);const Hr=this.blockData[Nr].parent_id;Hr&&Mr.add(Hr),Br||(Br=Dr.pageObject(Hr).parent_id)}if(!Br){console.error("No deck id found for blocks:",[...this.updates.values()]);return}$r={deckId:Br,orgId:Rr.currentOrgId,slideIds:[...Mr],blocks:Cr},this.updatePk=await actionsCache.insert("updateBlocks",$r)}this.updates.clear()},async save(){if(this.updatePk==null)return;const Tr=this.updatePk;this.updatePk=null;const Cr=await safeAsync(actionsCache.blocks.get(Tr));Cr&&actionsCache.isActionType("updateBlocks",Cr)&&await actionsCache.apiTransactions.enqueue(async()=>{try{await updateBlocks({orgId:Cr.orgId,deckId:Cr.deckId,updates:Object.entries(Cr.blocks).map(([$r,Ar])=>({id:$r,...Ar}))}),this.lastSave=new Date}catch($r){console.error("Error processing block update transaction",$r)}finally{await actionsCache.blocks.delete(Tr)}})},getAffectedBlocks(Tr){return Tr?Tr.map($r=>{const{updated_at:Ar,...Rr}=this.blockData[$r]??{};return lodashExports.cloneDeep(Rr)}):[]},async createBlock(Tr){var lo,po;const{type:Cr="text",subtype:$r="heading",parent_id:Ar,title:Rr=Cr,configObject:Dr={},display:Mr="desktop",density:Br="normal",skipUndo:Nr=!1}=Tr;let{positionObject:Lr}=Tr;const Hr=useUserStore(),zr=usePageStore(),Ur=useItemStore(),{data:Vr,error:jr}=await getSession(),Gr=(Vr==null?void 0:Vr.session)!=null;if(Hr.setLoggedIn(Gr),!Gr){await logout();return}const Xr=new Date().toISOString(),Kr=guid(),Zr=zr.pageObject(Ar),eo=lodashExports.cloneDeep(Zr),Wr=this.getAffectedBlocks(Zr.children);this.blockData[Kr]={id:Kr,type:Cr,subtype:$r};let Yr=!1;if(!Lr){const go=await groupCRUD.addNewBlockToSlide({blockId:Kr,slideId:Zr.id,groupIdForNewBlock:Tr.groupIdForNewBlock,indexInGroup:Tr.indexInGroup??-1});Lr=go.positionObject,Yr="skipFixingSlide"in go?go.skipFixingSlide:!1}const Jr=BlockUtil.getDefaultPosition({blockType:Cr,display:Mr,density:Br});Jr[Mr]={...Jr[Mr],...Lr};const no=BlockUtil.getConfig({position:Jr[Mr],config:lodashExports.cloneDeep(Dr),type:Cr,subtype:$r}),ro={id:Kr,parent_id:Zr.id,owner_id:Hr.currentUserId,type:Cr,subtype:$r,title:Rr,is_deleted:!1,position:Jr,config:no,created_at:Xr,updated_at:Xr};Zr.children.push(ro.id),this.blockData[ro.id]=ro,Cr!=="image"&&((lo=Tr.sideEffectFn)==null||lo.call(Tr,ro.id)),Yr||(await sleep(basicFlexLogic.WAIT_TIME_FOR_BLOCK_RENDER_AFTER_ADDING_BLOCK),await groupSize.fixSlideIfRequired({slideId:Zr.id,addingNewBlock:!0})),Cr==="image"&&((po=Tr.sideEffectFn)==null||po.call(Tr,ro.id));const so=this.getAffectedBlocks(Zr.children).filter(go=>go.id!==ro.id);so.push(ro);const ao=lodashExports.cloneDeep(Ur.data[Zr.id]);return Zr.config.itemMap={id:"itemMap",value:ao},Nr||useUndoRedoStore().addToUndo({id:"addBlock",userId:Hr.currentUserId,orgId:Hr.currentOrgId,context:{blockId:ro.id,slideId:ro.parent_id,deckId:zr.pageObject(ro.parent_id).parent_id,isTransaction:!0,undo:{changes:[...Wr.map(co=>({type:"block",id:co.id,action:"hydrate",value:co})),{type:"block",id:ro.id,action:"hydrate",value:{...ro,is_deleted:!0}},{type:"slide",id:ro.parent_id,action:"hydrate",value:eo}],transaction:{action:"modifyBlocks",data:{blocks:[...Wr,{...ro,is_deleted:!0}],slide:eo,orgId:lodashExports.cloneDeep(Hr.currentOrgId)},query:co=>modifyBlocks(co)}},redo:{changes:[...so.map(co=>({type:"block",id:co.id,action:"hydrate",value:co})),{type:"slide",id:ro.parent_id,action:"hydrate",value:lodashExports.cloneDeep(Zr)}],transaction:{action:"modifyBlocks",data:{blocks:so,slide:lodashExports.cloneDeep(Zr),orgId:lodashExports.cloneDeep(Hr.currentOrgId)},query:co=>modifyBlocks(co)}}}}),await actionsCache.defer({action:"modifyBlocks",data:{blocks:so,slide:lodashExports.cloneDeep(Zr),orgId:Hr.currentOrgId},query:go=>modifyBlocks(go)}),ro.id},async deleteBlock(Tr){const Cr=this.blockData[Tr];if(!Cr)return;const $r=useUserStore(),Ar=usePageStore(),Rr=useItemStore(),Dr=Ar.pageObject(Cr.parent_id),Mr=lodashExports.cloneDeep(Dr),Br=this.getAffectedBlocks(Dr.children),Nr=Dr.children.indexOf(Cr.id);Nr>=0&&Dr.children.splice(Nr,1),await groupCRUD.deleteBlockFromSlideGroup({blockId:Cr.id,slideId:Cr.parent_id??""}),await sleep(basicFlexLogic.WAIT_TIME_FOR_BLOCK_RENDER_AFTER_ADDING_BLOCK),await groupSize.fixSlideIfRequired({slideId:Dr.id,addingNewBlock:!0});const Lr=lodashExports.cloneDeep(Rr.data[Dr.id]);Dr.config.itemMap={id:"itemMap",value:Lr},Cr.is_deleted=!0;const Hr=this.getAffectedBlocks(Dr.children);useUndoRedoStore().addToUndo({id:"deleteBlock",userId:$r.currentUserId,orgId:$r.currentOrgId,context:{blockId:Cr.id,slideId:Cr.parent_id,deckId:Ar.pageObject(Cr.parent_id).parent_id,isTransaction:!0,undo:{changes:[...Br.map(Ur=>({type:"block",id:Ur.id,action:"hydrate",value:Ur})),{type:"slide",id:Cr.parent_id,action:"hydrate",value:Mr}],transaction:{action:"modifyBlocks",data:{blocks:Br,slide:Mr,orgId:lodashExports.cloneDeep($r.currentOrgId)},query:Ur=>modifyBlocks(Ur)}},redo:{changes:[...Hr.map(Ur=>({type:"block",id:Ur.id,action:"hydrate",value:Ur})),{type:"slide",id:Cr.parent_id,action:"hydrate",value:lodashExports.cloneDeep(Dr)}],transaction:{action:"modifyBlocks",data:{blocks:Hr,slide:lodashExports.cloneDeep(Dr),orgId:lodashExports.cloneDeep($r.currentOrgId)},query:Ur=>modifyBlocks(Ur)}}}}),await actionsCache.defer({action:"modifyBlocks",data:{blocks:Hr,slide:lodashExports.cloneDeep(Dr),orgId:$r.currentOrgId},query:Ur=>modifyBlocks(Ur)})},async duplicateBlock({id:Tr,newParentId:Cr,sideEffectFn:$r}){const Ar=this.blockData[Tr];if(!Ar)return null;const Rr=useUserStore(),Dr=usePageStore(),Mr=useItemStore(),Br=Rr.currentUserId,Nr=Cr??Ar.parent_id;if(!Nr)return null;const Lr=Dr.pageObject(Nr),Hr=lodashExports.cloneDeep(Lr),zr=this.getAffectedBlocks(Lr.children),Ur=guid();this.blockData[Ur]={id:Ur,type:Ar.type,subtype:Ar.subtype};const Vr=lodashExports.cloneDeep({...Ar,id:Ur,owner_id:Br,parent_id:Nr}),jr=basicFlexLogic.getParentGroupId({itemId:Tr,slideId:Nr});let Gr=groupCRUD.getIndexOfItemInGroup({id:Tr,slideId:Nr,groupId:jr});Gr>=0&&(Gr+=1);const{positionObject:Xr}=await groupCRUD.addNewBlockToSlide({blockId:Ur,slideId:Nr,duplicating:!0,groupIdForNewBlock:jr,indexInGroup:Gr});Vr.config.positionX={id:"positionX",value:Xr.x},Vr.config.positionY={id:"positionY",value:Xr.y},Vr.position.desktop=Xr,Lr.children.push(Vr.id),this.blockData[Vr.id]=Vr,setTimeout(()=>{$r==null||$r(Vr.id)},0),await sleep(basicFlexLogic.WAIT_TIME_FOR_BLOCK_RENDER),await groupSize.fixSlideIfRequired({slideId:Lr.id,addingNewBlock:!0});const Kr=this.allBlocks(Lr.id).map(Wr=>lodashExports.cloneDeep(this.blockData[Wr])).filter(Wr=>Wr.id!==Vr.id);Kr.push(Vr);const Zr=lodashExports.cloneDeep(Mr.data[Lr.id]);return Lr.config.itemMap={id:"itemMap",value:Zr},useUndoRedoStore().addToUndo({id:"duplicateBlock",userId:Rr.currentUserId,orgId:Rr.currentOrgId,context:{blockId:Vr.id,slideId:Vr.parent_id,deckId:Dr.pageObject(Vr.parent_id).parent_id,isTransaction:!0,undo:{changes:[...zr.map(Wr=>({type:"block",id:Wr.id,action:"hydrate",value:Wr})),{type:"block",id:Vr.id,action:"hydrate",value:{...Vr,is_deleted:!0}},{type:"slide",id:Vr.parent_id,action:"hydrate",value:Hr}],transaction:{action:"modifyBlocks",data:{blocks:[...zr,{...Vr,is_deleted:!0}],slide:Hr,orgId:lodashExports.cloneDeep(Rr.currentOrgId)},query:Wr=>modifyBlocks(Wr)}},redo:{changes:[...Kr.map(Wr=>({type:"block",id:Wr.id,action:"hydrate",value:Wr})),{type:"slide",id:Vr.parent_id,action:"hydrate",value:lodashExports.cloneDeep(Lr)}],transaction:{action:"modifyBlocks",data:{blocks:Kr,slide:lodashExports.cloneDeep(Lr),orgId:lodashExports.cloneDeep(Rr.currentOrgId)},query:Wr=>modifyBlocks(Wr)}}}}),await actionsCache.defer({action:"modifyBlocks",data:{blocks:Kr,slide:lodashExports.cloneDeep(Lr),orgId:Rr.currentOrgId},query:Wr=>modifyBlocks(Wr)}),Vr.id}}});class SlideUtil{static createConfig(Cr){const{layoutId:$r=null,deckSpacing:Ar=12,isDivider:Rr=!1,isReady:Dr=!1,isHidden:Mr=!0}=Cr??{};return{itemMap:{id:"itemMap",value:{"g-h-0":{type:"group",direction:"row",items:[],x:0,y:0,width:960,height:540,spacing:{padding:Ar,gap:Ar}}}},slideSpacing:{id:"slideSpacing",value:0},isReady:{id:"isReady",value:Dr},isHidden:{id:"isHidden",value:Mr},layoutId:{id:"layoutId",value:$r},useDoodle:{id:"useDoodle",value:!1},background:{id:"background",value:null,selectedId:"hsl(216, 0%, 100%)"},isDividerSlide:{id:"isDividerSlide",value:Rr}}}}const usePageStore=defineStore("pageStore",{state:()=>({data:{}}),getters:{title:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.title)??""},config:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.config)??{}},pageObject:Tr=>Cr=>Tr.data[Cr]??{},allChildPages:Tr=>Cr=>Object.keys(Tr.data).filter($r=>{var Ar,Rr;return((Ar=Tr.data[$r])==null?void 0:Ar.parent_id)===Cr&&!((Rr=Tr.data[$r])!=null&&Rr.is_deleted)}),children:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.children)??[]},isHidden:Tr=>Cr=>{var $r,Ar,Rr;return((Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.isHidden)==null?void 0:Rr.value)??!1},allBlockIdsForADeck:Tr=>Cr=>Object.keys(Tr.data).filter(Rr=>{var Dr,Mr;return((Dr=Tr.data[Rr])==null?void 0:Dr.parent_id)===Cr&&!((Mr=Tr.data[Rr])!=null&&Mr.is_deleted)}).map(Rr=>{var Dr;return((Dr=Tr.data[Rr])==null?void 0:Dr.children)??[]}).flat(),isPageReady:Tr=>Cr=>{var $r,Ar,Rr;return(Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.isReady)==null?void 0:Rr.value},parentId:Tr=>Cr=>{var $r;return($r=Tr.data[Cr])==null?void 0:$r.parent_id},isDividerSlide:Tr=>Cr=>{var $r,Ar,Rr;return((Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.isDividerSlide)==null?void 0:Rr.value)??!1},aiSettings:Tr=>Cr=>{var $r,Ar,Rr;return((Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.aiSettings)==null?void 0:Rr.value)??{}}},actions:{hydrate(Tr){Tr.forEach(Cr=>{lodashExports.isEqual(this.data[Cr.id],Cr)||(this.pushGroupStateToItemStore({slideId:Cr.id,config:Cr.config}),this.data[Cr.id]=Cr)})},updateDeckTimestamp({slideId:Tr}){const Cr=useAppStore(),$r=this.data[Tr];if($r==null)return;const Ar=Cr.appObject($r.parent_id);Ar!=null&&(Ar.updated_at=new Date().toISOString())},updateTitle(Tr,Cr){usePageStore().updateProps(Tr,{keyPath:["title"],value:Cr})},async updateProps(Tr,{keyPath:Cr=[],value:$r,autoSave:Ar=!0,skipUndo:Rr=!0}){const Dr=this.data[Tr];if(Dr!=null&&!(Tr.length<32))try{let Mr=this.data[Tr];for(let Lr=0;LrupdateSlide({orgId:Hr,deckId:zr,slideId:Lr,update:Ur})})}catch(Mr){console.error(`${Mr} keyPath = ${Cr}`)}},newSlideData(Tr){const{id:Cr,deckId:$r,userId:Ar}=Tr,Rr=new Date().toISOString();return{children:[],config:SlideUtil.createConfig({isReady:!0,isHidden:!1,layoutId:null}),created_at:Rr,id:Cr,is_deleted:!1,owner_id:Ar,parent_id:$r,title:"",updated_at:Rr}},async createNewPage(Tr){return this.createSlide(Tr)},async createSlide(Tr){const{id:Cr=guid(),deckId:$r,index:Ar,skipUndo:Rr=!1}=Tr,Dr=useUserStore(),Mr=useAppStore(),Br=lodashExports.cloneDeep(Mr.appObject($r)),Nr=this.newSlideData({id:Cr,deckId:$r,userId:Dr.currentUserId});this.optimisticInsert({deckId:$r,slide:Nr,index:Ar});const Lr=Mr.appObject($r);return Rr||useUndoRedoStore().addToUndo({id:"addSlide",userId:Dr.currentUserId,orgId:Dr.currentOrgId,context:{slideId:Cr,deckId:$r,isTransaction:!0,undo:{changes:[{type:"slide",id:Cr,action:"hydrate",value:{...Nr,is_deleted:!0}},{type:"deck",id:$r,action:"hydrate",value:Br}],transaction:{action:"crudSlides",data:{slides:[{...Nr,is_deleted:!0}],deck:lodashExports.cloneDeep(Br),orgId:lodashExports.cloneDeep(Dr.currentOrgId)},query:zr=>crudSlides(zr)}},redo:{changes:[{type:"slide",id:Cr,action:"hydrate",value:lodashExports.cloneDeep(Nr)},{type:"deck",id:$r,action:"hydrate",value:lodashExports.cloneDeep(Lr)}],transaction:{action:"crudSlides",data:{slides:[lodashExports.cloneDeep(Nr)],deck:lodashExports.cloneDeep(Lr),orgId:lodashExports.cloneDeep(Dr.currentOrgId)},query:zr=>crudSlides(zr)}}}}),await actionsCache.defer({action:"addSlide",data:{id:Nr.id,orgId:Dr.currentOrgId,slide:Nr,deckId:$r,index:Ar},query:Hr=>createSlide({deckId:Hr.deckId,slide:Hr.slide,orgId:Hr.orgId,index:Hr.index})}),Nr.id},optimisticInsert(Tr){const{deckId:Cr,slide:$r,index:Ar}=Tr,Rr=useAppStore();this.hydrate([$r]);const Dr=Rr.children(Cr);Ar!==void 0&&Ar>=0&&Ar<=Dr.length?Dr.splice(Ar,0,$r.id):Dr.push($r.id)},async deletePage(Tr,Cr){const $r=this.data[Tr];if(!$r){if(Cr){const Ur=useAppStore(),Vr=lodashExports.cloneDeep(Ur.appObject(Cr)),jr=(Vr.children??[]).indexOf(Tr);jr>=0&&(Vr.children.splice(jr,1),Ur.updateProps(Cr,{keyPath:["children"],value:Vr.children}))}return null}const Ar=useAppStore(),Rr=useUserStore(),Dr=Ar.appObject($r.parent_id),Mr=lodashExports.cloneDeep($r),Br=lodashExports.cloneDeep(Dr);let Nr=null;$r.is_deleted=!0;const Lr=Dr.children.indexOf($r.id);Lr>=0&&Dr.children.splice(Lr,1);const Hr=Dr.children.length;return Hr>0&&(Nr=Dr.children[Math.min(Lr,Hr-1)]),useUndoRedoStore().addToUndo({id:"deleteSlide",userId:Rr.currentUserId,orgId:Rr.currentOrgId,context:{slideId:Tr,deckId:$r.parent_id,isTransaction:!0,undo:{changes:[{type:"slide",id:$r.id,action:"hydrate",value:Mr},{type:"deck",id:Dr.id,action:"hydrate",value:Br}],transaction:{action:"crudSlides",data:{slides:[Mr],deck:Br,orgId:lodashExports.cloneDeep(Rr.currentOrgId)},query:Ur=>crudSlides(Ur)}},redo:{changes:[{type:"slide",id:$r.id,action:"hydrate",value:lodashExports.cloneDeep($r)},{type:"deck",id:Dr.id,action:"hydrate",value:lodashExports.cloneDeep(Dr)}],transaction:{action:"crudSlides",data:{slides:[lodashExports.cloneDeep($r)],deck:lodashExports.cloneDeep(Dr),orgId:lodashExports.cloneDeep(Rr.currentOrgId)},query:Ur=>crudSlides(Ur)}}}}),await actionsCache.defer({action:"deleteSlide",data:{id:Tr,deckId:$r.parent_id,orgId:Rr.currentOrgId},query:({id:Ur,deckId:Vr,orgId:jr})=>deleteSlide({slideId:Ur,deckId:Vr,orgId:jr})}),Nr},dupPageHelper({id:Tr,newParentId:Cr}){const $r=this.data[Tr];if(!$r)return null;const Ar=useBlockStore(),Dr=useUserStore().currentUserId,Mr=Cr??$r.parent_id,Br=lodashExports.cloneDeep($r);Br.id=guid(),Br.parent_id=Mr,Br.owner_id=Dr;const Nr=$r.children||[],Lr={},Hr=Nr.map(Ur=>{const Vr=guid();return Lr[Ur]=Vr,{...lodashExports.cloneDeep(Ar.blockObject(Ur)),id:Vr,owner_id:Dr,parent_id:Br.id}});Br.children=Hr.map(Ur=>Ur.id);const zr=Br.config.itemMap.value;for(const Ur of Object.keys(zr)){const Vr=zr[Ur];if(Ur.startsWith("g-"))Vr.items=(Vr.items||[]).map(jr=>jr.startsWith("g-")?jr:Lr[jr]);else{const jr=Lr[Ur];zr[jr]=Vr,delete zr[Ur]}}return{newSlide:Br,newBlocks:Hr,blockIdMap:Lr}},async upsertSlides({deckId:Tr,upsertedSlides:Cr,upsertedBlocks:$r,ogFirstSlide:Ar,ogFirstTableBlock:Rr,ogFirstSlideChildren:Dr,startInd:Mr}){if(!Cr.length||!$r.length)return;const Br=useAppStore(),Nr=lodashExports.cloneDeep(Br.appObject(Tr));this.hydrate(Cr);const Lr=useBlockStore();Lr.hydrate($r);const Hr=Dr.map(Xr=>lodashExports.cloneDeep(Lr.blockObject(Xr.id))),zr=Br.children(Tr),Ur=Cr.slice(1);zr.splice(Mr,0,...Ur.map(Xr=>Xr.id));const Vr=lodashExports.cloneDeep(Br.appObject(Tr)),jr=useUserStore();useUndoRedoStore().addToUndo({id:"upsertSlides",userId:jr.currentUserId,orgId:jr.currentOrgId,context:{deckId:Tr,isTransaction:!0,undo:{changes:[...Cr.map((Xr,Kr)=>{let Zr={...Xr,is_deleted:!0};return Kr||(Zr=lodashExports.cloneDeep(Ar)),{type:"slide",id:Xr.id,action:"hydrate",value:Zr}}),...Dr.map(Xr=>({type:"block",id:Xr.id,action:"hydrate",value:Xr})),...$r.map((Xr,Kr)=>{let Zr={...Xr,is_deleted:!0};return Kr||(Zr=lodashExports.cloneDeep(Rr)),{type:"block",id:Xr.id,action:"hydrate",value:Zr}}),{type:"deck",id:Tr,action:"hydrate",value:Nr},{type:"slide",id:zr[Mr-1],action:"selectSlide"}],transaction:{action:"crudSlides",data:{blocks:[...Dr,...$r.map((Xr,Kr)=>{let Zr={...Xr,is_deleted:!0};return Kr||(Zr=lodashExports.cloneDeep(Rr)),Zr})],slides:Cr.map((Xr,Kr)=>{let Zr={...Xr,is_deleted:!0};return Kr||(Zr=lodashExports.cloneDeep(Ar)),Zr}),deck:lodashExports.cloneDeep(Nr),orgId:lodashExports.cloneDeep(jr.currentOrgId)},query:Xr=>crudSlides(Xr)}},redo:{changes:[...Cr.map(Xr=>({type:"slide",id:Xr.id,action:"hydrate",value:Xr})),...Hr.map(Xr=>({type:"block",id:Xr.id,action:"hydrate",value:lodashExports.cloneDeep(Xr)})),...$r.map(Xr=>({type:"block",id:Xr.id,action:"hydrate",value:lodashExports.cloneDeep(Xr)})),{type:"deck",id:Tr,action:"hydrate",value:lodashExports.cloneDeep(Vr)},{type:"slide",id:Vr.children[Mr-1],action:"selectSlide"}],transaction:{action:"crudSlides",data:{blocks:[...lodashExports.cloneDeep(Hr),...lodashExports.cloneDeep($r)],slides:lodashExports.cloneDeep(Cr),deck:lodashExports.cloneDeep(Vr),orgId:lodashExports.cloneDeep(jr.currentOrgId)},query:Xr=>crudSlides(Xr)}}}}),await actionsCache.defer({action:"crudSlides",data:{orgId:lodashExports.cloneDeep(useUserStore().currentOrgId),deck:lodashExports.cloneDeep(Br.appObject(Tr)),slides:lodashExports.cloneDeep(Cr),blocks:$r},query:Xr=>crudSlides(Xr)})},async duplicatePage(Tr){const{id:Cr,newParentId:$r,index:Ar}=Tr,Rr=this.dupPageHelper({id:Cr,newParentId:$r});if(!Rr)return;const{newSlide:Dr,newBlocks:Mr}=Rr,Br=useAppStore(),Nr=useBlockStore(),Lr=useUserStore(),Hr=Dr.parent_id,zr=lodashExports.cloneDeep(Br.appObject(Hr));this.optimisticInsert({deckId:Hr,slide:Dr,index:Ar}),Nr.hydrate(Mr);const Ur=Br.appObject(Hr),Vr=(Ur.children??[])[Ar!=null&&Ar>=1?Ar-1:Ur.children.length-2]??Cr;return useUndoRedoStore().addToUndo({id:"duplicateSlide",userId:Lr.currentUserId,orgId:Lr.currentOrgId,context:{slideId:Cr,deckId:Hr,isTransaction:!0,undo:{changes:[{type:"slide",id:Cr,action:"hydrate",value:{...Dr,is_deleted:!0}},{type:"deck",id:Hr,action:"hydrate",value:zr},{type:"slide",id:Vr,action:"selectSlide"}],transaction:{action:"crudSlides",data:{slides:[{...Dr,is_deleted:!0}],deck:lodashExports.cloneDeep(zr),orgId:lodashExports.cloneDeep(Lr.currentOrgId)},query:Gr=>crudSlides(Gr)}},redo:{changes:[{type:"slide",id:Cr,action:"hydrate",value:lodashExports.cloneDeep(Dr)},{type:"deck",id:Hr,action:"hydrate",value:lodashExports.cloneDeep(Ur)},{type:"slide",id:Dr.id,action:"selectSlide"}],transaction:{action:"crudSlides",data:{slides:[lodashExports.cloneDeep(Dr)],deck:lodashExports.cloneDeep(Ur),orgId:lodashExports.cloneDeep(Lr.currentOrgId)},query:Gr=>crudSlides(Gr)}}}}),await actionsCache.defer({action:"duplicateSlide",data:{id:Dr.id,slide:Dr,blocks:Mr,orgId:Lr.currentOrgId,deckId:Hr,index:Ar??Br.appObject(Hr).children.indexOf(Cr)+1},query:({id:Gr,...Xr})=>duplicateSlide(Xr)}),Dr.id},async duplicateFakePage(Tr){const{id:Cr,newParentId:$r}=Tr,Ar=this.dupPageHelper({id:Cr,newParentId:$r});if(!Ar)return;const{newSlide:Rr,newBlocks:Dr,blockIdMap:Mr}=Ar,Br=useBlockStore();return this.hydrate([Rr]),Br.hydrate(Dr),{newSlideId:Rr.id,blockIdMap:Mr}},async pushGroupStateToDB({slideId:Tr,originalBlocks:Cr,originalSlide:$r}){const Ar=this.data[Tr];if(!Ar)return;const Rr=useUserStore(),Dr=useItemStore(),Mr=useBlockStore(),Br=lodashExports.cloneDeep(Dr.data[Tr]);Ar.config.itemMap={id:"itemMap",value:Br};const Nr=Mr.getAffectedBlocks(Ar.children);useUndoRedoStore().addToUndo({id:"moveBlock",userId:Rr.currentUserId,orgId:Rr.currentOrgId,context:{slideId:Tr,deckId:this.pageObject(Tr).parent_id,isTransaction:!0,undo:{changes:[...Cr.map(Hr=>({type:"block",id:Hr.id,action:"hydrate",value:Hr})),{type:"slide",id:Tr,action:"hydrate",value:$r}],transaction:{action:"modifyBlocks",data:{blocks:Cr,slide:$r,orgId:lodashExports.cloneDeep(Rr.currentOrgId)},query:Hr=>modifyBlocks(Hr)}},redo:{changes:[...Nr.map(Hr=>({type:"block",id:Hr.id,action:"hydrate",value:Hr})),{type:"slide",id:Tr,action:"hydrate",value:lodashExports.cloneDeep(Ar)}],transaction:{action:"modifyBlocks",data:{blocks:lodashExports.cloneDeep(Nr),slide:lodashExports.cloneDeep(Ar),orgId:lodashExports.cloneDeep(Rr.currentOrgId)},query:Hr=>modifyBlocks(Hr)}}}}),await actionsCache.defer({action:"modifyBlocks",data:{slide:lodashExports.cloneDeep(Ar),blocks:Nr,orgId:Rr.currentOrgId},query:Hr=>modifyBlocks(Hr)})},pushGroupStateToItemStore({slideId:Tr,config:Cr}){var Rr;const $r=lodashExports.cloneDeep(((Rr=Cr==null?void 0:Cr.itemMap)==null?void 0:Rr.value)??{});useItemStore().addOrUpdateSlideMap({slideId:Tr,itemMap:$r,replace:!0})},async updateSlideSpacing({slideId:Tr,spacing:Cr}){const $r=this.data[Tr];if($r==null)return;const Ar=useUserStore();$r.config.slideSpacing={id:"slideSpacing",value:Cr},await actionsCache.defer({action:"updateSlide",data:{id:$r.id,deckId:$r.parent_id,orgId:Ar.currentOrgId,slide:lodashExports.cloneDeep({config:$r.config})},query:({id:Rr,orgId:Dr,deckId:Mr,slide:Br})=>updateSlide({orgId:Dr,deckId:Mr,slideId:Rr,update:Br})})}}}),useMiscStore=defineStore("miscStore",{state:()=>({showAuthModal:!1,showCustomWorkflowRequestModal:!1,showSettingsModal:!1,showProAccessModal:!1,showTemplateModal:!1,showTeamModal:!1,addNewTemplateSlide:!1,tableSelectionRange:{},isGeneratingNewSlide:!1,leftPanePreviewKeys:{},slideKeys:{},tableEditingState:{},isSlideInTransition:!1,isAIGeneratingSomething:!1,isSlideShowInProgress:!1,showingAIOnboarding:!0,isSlideBeingModified:{},showingColorTooltip:!1,lastUsedDeckTheme:"purple",lastUsedDeckFontFamily:"default",proAccessSource:"",disablUpgradeModal:!1,textIconPopupOpen:!1,textSelectionPopupOpen:!1,tableCellSelectionPopupOpen:!1,homeNotification:{text:"",showEmoji:!1,type:"error",persistent:!1,position:"bottomCenter",isProminent:!1,showInProgress:!1,showTag:!1},showHomeNotification:!1,showDeckInviteModal:!1,pastingTable:!1,undoRedoing:!1,universalTableKey:0,whichContextMenuOpen:null,showPDFModal:!1,routePathToOpen:null,showSearchDialog:!1,homepageItemsMode:"grid",hasScrolledHomepageList:!1,hasScrolledHomepageGrid:!1,homepageListScrollY:0,homepageGridScrollY:0,emptyPageErr:{},slideMountKeys:{}}),getters:{getShowAuthModal:Tr=>Tr.showAuthModal,getShowCustomWorkflowRequestModal:Tr=>Tr.showCustomWorkflowRequestModal,getShowSettingsModal:Tr=>Tr.showSettingsModal,getShowProAccessModal:Tr=>Tr.showProAccessModal,getShowTemplateModal:Tr=>Tr.showTemplateModal,getShowTeamModal:Tr=>Tr.showTeamModal,getAddNewTemplateSlide:Tr=>Tr.addNewTemplateSlide,getTableSelectionRange:Tr=>Cr=>Tr.tableSelectionRange[Cr]??{from:null,to:null},getIsAnyTableCellSelected:Tr=>Cr=>{var $r,Ar;return(($r=Tr.tableSelectionRange[Cr])==null?void 0:$r.from)!=null&&((Ar=Tr.tableSelectionRange[Cr])==null?void 0:Ar.to)!=null},getLeftPanePreviewKey:Tr=>Cr=>Tr.leftPanePreviewKeys[Cr]??-1,getSlideKey:Tr=>Cr=>Tr.slideKeys[Cr]??-1,getTableEditingState:Tr=>Cr=>Tr.tableEditingState[Cr]??!1,getIsSlideInTransition:Tr=>Tr.isSlideInTransition,getIsAIGeneratingSomething:Tr=>Tr.isAIGeneratingSomething,getIsSlideShowInProgress:Tr=>Tr.isSlideShowInProgress,getShowingAIOnboarding:Tr=>Tr.showingAIOnboarding,getIsSlideBeingModified:Tr=>Cr=>Tr.isSlideBeingModified[Cr]??!1,getIsShowingColorTooltip:Tr=>Tr.showingColorTooltip,getLastUsedDeckTheme:Tr=>Tr.lastUsedDeckTheme,getLastUsedFontFamily:Tr=>Tr.lastUsedDeckFontFamily,getProAccessSource:Tr=>Tr.proAccessSource,getDisableUpgradeModal:Tr=>Tr.disablUpgradeModal,isTextIconPopupOpen:Tr=>Tr.textIconPopupOpen,getShowDeckInviteModal:Tr=>Tr.showDeckInviteModal,isPastingTable:Tr=>Tr.pastingTable,isUndoRedoing:Tr=>Tr.undoRedoing,getUniversalTableKey:Tr=>Tr.universalTableKey,getShowPDFModal:Tr=>Tr.showPDFModal,getRoutePathToOpen:Tr=>Tr.routePathToOpen,getShowSearchDialog:Tr=>Tr.showSearchDialog,getHomepageItemsMode:Tr=>Tr.homepageItemsMode,getHasScrolledHomepageList:Tr=>Tr.hasScrolledHomepageList,getHasScrolledHomepageGrid:Tr=>Tr.hasScrolledHomepageGrid,getHomepageListScrollY:Tr=>Tr.homepageListScrollY,getHomepageGridScrollY:Tr=>Tr.homepageGridScrollY,getTableCellSelectionPopupOpen:Tr=>Tr.tableCellSelectionPopupOpen,getSlideMountKey:Tr=>Cr=>Tr.slideMountKeys[Cr]??-1},actions:{setShowAuthModal(Tr){this.showAuthModal=Tr},setEmptyPageErr(Tr,Cr){Cr?this.emptyPageErr[Tr]=Cr:delete this.emptyPageErr[Tr]},setContextMenuOpen(Tr){this.whichContextMenuOpen=Tr},setPastingTable(Tr){this.pastingTable=Tr},setUndoRedoing(Tr){this.undoRedoing=Tr},setShowDeckInviteModal({show:Tr}){this.showDeckInviteModal=Tr},setTextSelectionPopupOpen({open:Tr}){this.textSelectionPopupOpen=Tr},setTableCellSelectionPopupOpen({open:Tr}){this.tableCellSelectionPopupOpen=Tr},setTextIconPopup({open:Tr}){this.textIconPopupOpen=Tr},setShowSettingsModal({show:Tr,source:Cr,startingSectionId:$r}){if($r){this.settingsModalFirstSectId=$r,this.showSettingsModal=Tr;return}const Ar=isEnabled("billing");if(!Ar&&Tr&&Cr!==""){this.setProAccessSource(Cr??""),this.showProAccessModal=Tr;return}if(!Ar&&!Tr&&this.showProAccessModal){this.showProAccessModal=!1,this.setProAccessSource("");return}this.setProAccessSource(Cr??""),this.showSettingsModal=Tr},setShowProAccessModal({show:Tr,source:Cr}){this.showProAccessModal=Tr,this.setProAccessSource(Cr??"")},setProAccessSource(Tr){this.proAccessSource=Tr},setShowTemplateModal({show:Tr,addNew:Cr=!1}){this.showTemplateModal=Tr,this.addNewTemplateSlide=Cr},setTableSelectionRange({id:Tr,from:Cr,to:$r}){this.tableSelectionRange[Tr]={from:Cr,to:$r}},setLeftPanePreviewKey(Tr){this.leftPanePreviewKeys[Tr]==null?this.leftPanePreviewKeys[Tr]=0:this.leftPanePreviewKeys[Tr]+=1,console.log(this.leftPanePreviewKeys)},setSlideKey(Tr){this.slideKeys[Tr]==null&&(this.slideKeys[Tr]=0),this.slideKeys[Tr]+=1},setTableEditingState({tableId:Tr,isEditing:Cr}){this.tableEditingState[Tr]=Cr},setIsSlideInTransition(Tr){this.isSlideInTransition=Tr},setIsAIGeneratingSomething(Tr){this.isAIGeneratingSomething=Tr},setIsSlideShowInProgress(Tr){this.isSlideShowInProgress=Tr},setShowingAIOnboarding(Tr){this.showingAIOnboarding=Tr},setIsSlideBeingModified({slideId:Tr,value:Cr}){this.isSlideBeingModified[Tr]=Cr},setShowingColorTooltip(Tr){this.showingColorTooltip=Tr},setColorTooltipLocalStorage(){IS_CLIENT&&localStorage.setItem("colorTooltip","shown")},getColorTooltipLocalStorage(){return!(!IS_CLIENT||localStorage.getItem("colorTooltip")==null)},setLastUsedDeckTheme(Tr){this.lastUsedDeckTheme=Tr,IS_CLIENT&&localStorage.setItem("lastUsedDeckTheme",Tr)},getLastUsedDeckThemeLocalStorage(){if(!IS_CLIENT)return"purple";const Tr=localStorage.getItem("lastUsedDeckTheme");return Tr??"purple"},setLastUsedDeckFontFamily(Tr){this.lastUsedDeckFontFamily=Tr,IS_CLIENT&&localStorage.setItem("lastUsedDeckFontFamily",Tr)},getLastUsedDeckFontFamilyLocalStorage(){if(!IS_CLIENT)return"default";const Tr=localStorage.getItem("lastUsedDeckFontFamily");return Tr??"default"},setDisableUpgradeModal(Tr){this.disablUpgradeModal=Tr},setHomeNotification({show:Tr,noti:Cr}){this.homeNotification={...this.homeNotification,...Cr,action:Cr==null?void 0:Cr.action},this.showHomeNotification=Tr},incrementUniversalTableKey(){this.universalTableKey+=1},setShowCustomWorkflowRequestModal({show:Tr}){this.showCustomWorkflowRequestModal=Tr},setShowPDFModal(Tr){this.showPDFModal=Tr},setRoutePathToOpen(Tr){this.routePathToOpen=Tr},setShowSearchDialog(Tr){this.showSearchDialog=Tr},setHomepageItemsMode(Tr){this.homepageItemsMode=Tr},setHasScrolledHomepageList(Tr){this.hasScrolledHomepageList=Tr},setHasScrolledHomepageGrid(Tr){this.hasScrolledHomepageGrid=Tr},setHomepageListScrollY(Tr){this.homepageListScrollY=Tr},setHomepageGridScrollY(Tr){this.homepageGridScrollY=Tr},setShowTeamModal(Tr){this.showTeamModal=Tr},incrementSlideMountKey(Tr){if(this.slideMountKeys[Tr]==null||this.slideMountKeys[Tr]===void 0){this.slideMountKeys[Tr]=0;return}this.slideMountKeys[Tr]+=1}}}),useChatStore=defineStore("chatStore",{state:()=>({data:{}}),persist:!1,getters:{decksThreadId:Tr=>Cr=>{if(!(Cr in Tr.data))return null;const $r=Object.keys(Tr.data[Cr].threads);return $r.length?$r[$r.length-1]:null},msgs:Tr=>(Cr,$r)=>{var Ar,Rr;return(Rr=(Ar=Tr.data[Cr])==null?void 0:Ar.threads[$r])==null?void 0:Rr.msgs},loading:Tr=>(Cr,$r)=>{var Ar,Rr;return(Rr=(Ar=Tr.data[Cr])==null?void 0:Ar.threads[$r])==null?void 0:Rr.loading}},actions:{setMsgs(Tr,Cr,$r){this.data[Tr].threads[Cr].msgs=$r},setLoading(Tr,Cr,$r){this.data[Tr].threads[Cr].loading=$r},addDeck(Tr){this.data[Tr]||(this.data[Tr]={threads:{},avatarSlide:null,changedSlides:[],changedBlocks:[],prevDeckContent:[],prevSelectedPage:null,err:!1})},addThreadIdToDeck(Tr,Cr){this.addDeck(Tr),this.data[Tr].threads[Cr]={msgs:[],loading:!1}},setAvatarSlide(Tr,Cr){this.data[Tr].avatarSlide=Cr},setChanged(Tr,Cr,$r){this.data[Tr].changedSlides=Cr,this.data[Tr].changedBlocks=$r},setDeckState(Tr,Cr,$r){this.addDeck(Tr),this.data[Tr].prevDeckContent=Cr,this.data[Tr].prevSelectedPage=$r},setErr(Tr,Cr){this.data[Tr].err=Cr}}}),supabase$3=SupabaseWrapper.client,fetchThreadId=async Tr=>{const{data:Cr,error:$r}=await supabase$3.from("threads").select("id").eq("deck_id",Tr).order("updated_at",{ascending:!1}).limit(1);return{data:Cr,error:$r}},createThread=async Tr=>{const Cr=useChatStore(),{data:$r,error:Ar}=await fetchThreadId(Tr.deck_id);if(Ar)return console.error(Ar),{error:Ar};if($r!=null&&$r.length)return Cr.addThreadIdToDeck(Tr.deck_id,$r[0].id),{error:null};const{error:Rr}=await supabase$3.from("threads").insert(Tr);return{error:Rr}},fetchDecksById=async Tr=>{const{data:Cr,error:$r}=await supabase$3.from("decks").select("*").in("id",Tr).eq("is_deleted",!1);return{data:Cr,error:$r}},fetchDecksByOwnerId=async Tr=>{const{data:Cr,error:$r}=await supabase$3.from("decks").select("*").eq("owner_id",Tr).eq("is_deleted",!1);return{data:Cr,error:$r}},fetchEntireSlide=async Tr=>{const{data:Cr,error:$r}=await supabase$3.from("slides").select(` *, blocks ( "*" ) `).eq("is_deleted",!1).eq("blocks.is_deleted",!1).eq("id",Tr);return{data:Cr,error:$r}},fetchEntireSlidesFromList=async Tr=>{const{data:Cr,error:$r}=await supabase$3.from("slides").select(` *, blocks ( "*" ) `).eq("is_deleted",!1).eq("blocks.is_deleted",!1).in("id",Tr);return{data:Cr,error:$r}},fetchEntireDeckNew=async Tr=>{const{data:Cr,error:$r}=await supabase$3.from("decks").select(` *, slides ( "*", blocks ( "*" ) ) `).eq("is_deleted",!1).eq("slides.is_deleted",!1).eq("slides.blocks.is_deleted",!1).eq("id",Tr);return{data:Cr,error:$r}},fetchEntireDecksFromList=async Tr=>{const{data:Cr,error:$r}=await supabase$3.from("decks").select(` *, slides ( "*", blocks ( "*" ) ) `).eq("is_deleted",!1).eq("slides.is_deleted",!1).eq("slides.blocks.is_deleted",!1).in("id",Tr);return{data:Cr,error:$r}},supabase$2=SupabaseWrapper.client,fetchRootFolders=async({user_id:Tr,org_id:Cr})=>{const{data:$r,error:Ar}=await supabase$2.from("folders").select("*").eq("owner_id",Tr).eq("org_id",Cr).eq("is_deleted",!1).eq("is_system_folder",!0);return{data:$r,error:Ar}},createFolder=async Tr=>{const{error:Cr}=await supabase$2.from("folders").insert(Tr);return{error:Cr}},updateFolder=async(Tr,{columnKey:Cr,value:$r})=>{const Ar={};Ar[Cr]=$r;const{error:Rr}=await queryResourceUpdateFolder({orgId:useUserStore().currentOrgId,folderId:Tr,update:Ar});return{error:Rr}},fetchFolder=async Tr=>{const{data:Cr,error:$r}=await supabase$2.from("folders").select("*").eq("id",Tr).eq("is_deleted",!1).single();return{data:Cr,error:$r}},SHARED_FOLDER_ID="shared-with-me",SHARED_FOLDER_ICON="icon-shared-3.svg",useFolderStore=defineStore("folderStore",{state:()=>({data:{[SHARED_FOLDER_ID]:{id:SHARED_FOLDER_ID,owner_id:"",title:"Shared with me",access_level:"shared",deckIds:[]}},currFolderId:null}),getters:{rootFolderTooltip:()=>Tr=>{switch(Tr){case"private":return"Your private Prezos";case"workspace":return"Shared with your workspace";case"shared":return"Access shared content here";default:return null}},title:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.title)??""},folderObject:Tr=>Cr=>Tr.data[Cr]??{},accessLevel:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.access_level)??"private"},isSystemFolder:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.is_system_folder)??!1},currentFolderId:Tr=>Tr.currFolderId,privateSystemFolderId:Tr=>{var Cr;return((Cr=Object.values(Tr.data).find($r=>$r.is_system_folder&&$r.access_level==="private"))==null?void 0:Cr.id)??null},workspaceSystemFolderId:Tr=>{var Cr;return((Cr=Object.values(Tr.data).find($r=>$r.is_system_folder&&$r.access_level==="workspace"))==null?void 0:Cr.id)??null},sharedFolderId:()=>SHARED_FOLDER_ID,sharedFolder:Tr=>Tr.data[SHARED_FOLDER_ID],rootFolderIds:Tr=>Object.values(Tr.data).filter(Cr=>Cr.parent_id==null&&Cr.is_system_folder).map(Cr=>Cr.id),childFolders:Tr=>Cr=>Object.values(Tr.data).filter($r=>$r.parent_id===Cr&&!$r.is_deleted)},actions:{async fetchAndHydrateFolder(Tr){const{data:Cr,error:$r}=await fetchFolder(Tr);return Cr==null?null:$r?(console.error($r),null):(this.hydrate([Cr]),Cr)},async fetchAndHydrateFolderContents(Tr){const Cr=useUserStore(),$r=Tr===SHARED_FOLDER_ID,{data:Ar,error:Rr}=await($r?fetchSharedDecks({}):fetchFolder$1({userId:Cr.currentUserId,orgId:Cr.currentOrgId,folderId:Tr}));if(Rr||Ar==null)return console.error(Rr),null;const{decks:Dr,folders:Mr,slides:Br,...Nr}=Ar,Lr=useAppStore(),Hr=usePageStore(),zr=useBlockStore();$r&&(Nr.deckIds=Dr.map(Ur=>Ur.id)),this.hydrate([Nr]),Mr&&this.hydrate(Mr),Lr.hydrate(Dr),Br.forEach(({blocks:Ur,...Vr})=>{Hr.hydrate([Vr]),zr.hydrate(Ur)})},hydrate(Tr){Tr.forEach(Cr=>{lodashExports.isEqual(this.data[Cr.id],Cr)||Cr==null||Cr.id==null||(this.data[Cr.id]=Cr)})},updateTitle(Tr,Cr){this.updateProps(Tr,{keyPath:["title"],value:Cr})},async updateProps(Tr,{keyPath:Cr=[],value:$r,autoSave:Ar=!0}){if(this.data[Tr]!=null)try{let Rr=this.data[Tr];for(let Dr=0;DrRr.id))},async addNewFolder(Tr,{saveInDatabase:Cr=!0}={}){if(this.data[Tr.id]=Tr,!Cr)return{error:null};const{error:$r}=await createFolder(Tr);return console.log($r),{error:$r}},async createFolder({id:Tr,parent_id:Cr,saveInDatabase:$r}){const Ar=useUserStore(),Rr=Ar.currentUserId,Dr=Ar.currentOrgId??void 0,Mr=Tr??guid(),Br=this.data[Cr??""];if(Br==null)return null;const Nr={id:Mr,owner_id:Rr,org_id:Dr,parent_id:Cr,title:"",is_deleted:!1,is_public:!1,is_system_folder:!1,access_level:Br.access_level};return this.addNewFolder(Nr,{saveInDatabase:$r}),Mr},setCurrentFolderId(Tr){this.currFolderId=Tr},async fetchAndHydrateRootFolders({userId:Tr,orgId:Cr}){const{data:$r,error:Ar}=await fetchRootFolders({user_id:Tr,org_id:Cr});if($r==null||$r.length===0)return null;const Rr=useFolderStore();return Rr.hydrate($r),Rr.setCurrentFolderId(Rr.privateSystemFolderId),isEnabled("createFolders")||Rr.setCurrentFolderId(Rr.privateSystemFolderId),$r},async funcForSlides(Tr){log(`fetching ${Tr.length} slides`);const Cr=useAppStore(),$r=usePageStore(),Ar=useBlockStore(),{data:Rr,error:Dr}=await Cr.fetchEntireSlidesFromList(Tr);return Dr?Promise.reject(Dr):Rr==null?Promise.reject(new Error("No data returned")):(Rr[0]==null||Rr.forEach(({blocks:Mr,...Br})=>Mr==null?Promise.reject(new Error("No data returned")):(Ar.hydrate(Mr),$r.hydrate([Br]),null)),Promise.resolve())},breakSlidesIntoChunks(Tr,Cr){const $r=[];for(let Ar=0;Ar{Cr.push(this.funcForSlides(Ar))}),await Promise.allSettled(Cr)},async fetchDecks(){const Tr=useAppStore(),{data:Cr,error:$r}=await Tr.fetchDecksByOwnerId();return $r||Cr==null||Tr.hydrate(Cr),Cr},wipeFolderState(){this.data={[SHARED_FOLDER_ID]:this.data[SHARED_FOLDER_ID]},this.currFolderId=null}}});function computedWithControl(Tr,Cr){let $r,Ar,Rr;const Dr=ref(!0),Mr=()=>{Dr.value=!0,Rr()};watch(Tr,Mr,{flush:"sync"});const Br=typeof Cr=="function"?Cr:Cr.get,Nr=typeof Cr=="function"?void 0:Cr.set,Lr=customRef((Hr,zr)=>(Ar=Hr,Rr=zr,{get(){return Dr.value&&($r=Br(),Dr.value=!1),Ar(),$r},set(Ur){Nr==null||Nr(Ur)}}));return Object.isExtensible(Lr)&&(Lr.trigger=Mr),Lr}function tryOnScopeDispose(Tr){return getCurrentScope()?(onScopeDispose(Tr),!0):!1}function createEventHook(){const Tr=new Set,Cr=Rr=>{Tr.delete(Rr)};return{on:Rr=>{Tr.add(Rr);const Dr=()=>Cr(Rr);return tryOnScopeDispose(Dr),{off:Dr}},off:Cr,trigger:Rr=>Promise.all(Array.from(Tr).map(Dr=>Dr(Rr)))}}function toValue(Tr){return typeof Tr=="function"?Tr():unref(Tr)}const isClient$1=typeof window<"u",notNullish=Tr=>Tr!=null,toString$1=Object.prototype.toString,isObject$3=Tr=>toString$1.call(Tr)==="[object Object]",timestamp=()=>+Date.now(),noop$1=()=>{},hasOwn$1=(Tr,Cr)=>Object.prototype.hasOwnProperty.call(Tr,Cr),isIOS$1=getIsIOS();function getIsIOS(){var Tr;return isClient$1&&((Tr=window==null?void 0:window.navigator)==null?void 0:Tr.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent)}function createFilterWrapper(Tr,Cr){function $r(...Ar){return new Promise((Rr,Dr)=>{Promise.resolve(Tr(()=>Cr.apply(this,Ar),{fn:Cr,thisArg:this,args:Ar})).then(Rr).catch(Dr)})}return $r}function debounceFilter(Tr,Cr={}){let $r,Ar,Rr=noop$1;const Dr=Br=>{clearTimeout(Br),Rr(),Rr=noop$1};return Br=>{const Nr=toValue(Tr),Lr=toValue(Cr.maxWait);return $r&&Dr($r),Nr<=0||Lr!==void 0&&Lr<=0?(Ar&&(Dr(Ar),Ar=null),Promise.resolve(Br())):new Promise((Hr,zr)=>{Rr=Cr.rejectOnCancel?zr:Hr,Lr&&!Ar&&(Ar=setTimeout(()=>{$r&&Dr($r),Ar=null,Hr(Br())},Lr)),$r=setTimeout(()=>{Ar&&Dr(Ar),Ar=null,Hr(Br())},Nr)})}}function throttleFilter(Tr,Cr=!0,$r=!0,Ar=!1){let Rr=0,Dr,Mr=!0,Br=noop$1,Nr;const Lr=()=>{Dr&&(clearTimeout(Dr),Dr=void 0,Br(),Br=noop$1)};return zr=>{const Ur=toValue(Tr),Vr=Date.now()-Rr,jr=()=>Nr=zr();return Lr(),Ur<=0?(Rr=Date.now(),jr()):(Vr>Ur&&($r||!Mr)?(Rr=Date.now(),jr()):Cr&&(Nr=new Promise((Gr,Xr)=>{Br=Ar?Xr:Gr,Dr=setTimeout(()=>{Rr=Date.now(),Mr=!0,Gr(jr()),Lr()},Math.max(0,Ur-Vr))})),!$r&&!Dr&&(Dr=setTimeout(()=>Mr=!0,Ur)),Mr=!1,Nr)}}function promiseTimeout(Tr,Cr=!1,$r="Timeout"){return new Promise((Ar,Rr)=>{setTimeout(Cr?()=>Rr($r):Ar,Tr)})}function objectPick(Tr,Cr,$r=!1){return Cr.reduce((Ar,Rr)=>(Rr in Tr&&(!$r||Tr[Rr]!==void 0)&&(Ar[Rr]=Tr[Rr]),Ar),{})}function toRef(...Tr){if(Tr.length!==1)return toRef$1(...Tr);const Cr=Tr[0];return typeof Cr=="function"?readonly(customRef(()=>({get:Cr,set:noop$1}))):ref(Cr)}function useDebounceFn(Tr,Cr=200,$r={}){return createFilterWrapper(debounceFilter(Cr,$r),Tr)}function useThrottleFn(Tr,Cr=200,$r=!1,Ar=!0,Rr=!1){return createFilterWrapper(throttleFilter(Cr,$r,Ar,Rr),Tr)}var __defProp$9=Object.defineProperty,__defProps$7=Object.defineProperties,__getOwnPropDescs$7=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$b$1=Object.getOwnPropertySymbols,__hasOwnProp$b$1=Object.prototype.hasOwnProperty,__propIsEnum$b$1=Object.prototype.propertyIsEnumerable,__defNormalProp$9=(Tr,Cr,$r)=>Cr in Tr?__defProp$9(Tr,Cr,{enumerable:!0,configurable:!0,writable:!0,value:$r}):Tr[Cr]=$r,__spreadValues$9=(Tr,Cr)=>{for(var $r in Cr||(Cr={}))__hasOwnProp$b$1.call(Cr,$r)&&__defNormalProp$9(Tr,$r,Cr[$r]);if(__getOwnPropSymbols$b$1)for(var $r of __getOwnPropSymbols$b$1(Cr))__propIsEnum$b$1.call(Cr,$r)&&__defNormalProp$9(Tr,$r,Cr[$r]);return Tr},__spreadProps$7=(Tr,Cr)=>__defProps$7(Tr,__getOwnPropDescs$7(Cr));function toRefs(Tr){if(!isRef(Tr))return toRefs$1(Tr);const Cr=Array.isArray(Tr.value)?new Array(Tr.value.length):{};for(const $r in Tr.value)Cr[$r]=customRef(()=>({get(){return Tr.value[$r]},set(Ar){if(Array.isArray(Tr.value)){const Rr=[...Tr.value];Rr[$r]=Ar,Tr.value=Rr}else{const Rr=__spreadProps$7(__spreadValues$9({},Tr.value),{[$r]:Ar});Object.setPrototypeOf(Rr,Tr.value),Tr.value=Rr}}}));return Cr}function tryOnMounted$1(Tr,Cr=!0){getCurrentInstance()?onMounted(Tr):Cr?Tr():nextTick(Tr)}function createUntil(Tr,Cr=!1){function $r(zr,{flush:Ur="sync",deep:Vr=!1,timeout:jr,throwOnTimeout:Gr}={}){let Xr=null;const Zr=[new Promise(eo=>{Xr=watch(Tr,Wr=>{zr(Wr)!==Cr&&(Xr==null||Xr(),eo(Wr))},{flush:Ur,deep:Vr,immediate:!0})})];return jr!=null&&Zr.push(promiseTimeout(jr,Gr).then(()=>toValue(Tr)).finally(()=>Xr==null?void 0:Xr())),Promise.race(Zr)}function Ar(zr,Ur){if(!isRef(zr))return $r(Wr=>Wr===zr,Ur);const{flush:Vr="sync",deep:jr=!1,timeout:Gr,throwOnTimeout:Xr}=Ur??{};let Kr=null;const eo=[new Promise(Wr=>{Kr=watch([Tr,zr],([Yr,Jr])=>{Cr!==(Yr===Jr)&&(Kr==null||Kr(),Wr(Yr))},{flush:Vr,deep:jr,immediate:!0})})];return Gr!=null&&eo.push(promiseTimeout(Gr,Xr).then(()=>toValue(Tr)).finally(()=>(Kr==null||Kr(),toValue(Tr)))),Promise.race(eo)}function Rr(zr){return $r(Ur=>!!Ur,zr)}function Dr(zr){return Ar(null,zr)}function Mr(zr){return Ar(void 0,zr)}function Br(zr){return $r(Number.isNaN,zr)}function Nr(zr,Ur){return $r(Vr=>{const jr=Array.from(Vr);return jr.includes(zr)||jr.includes(toValue(zr))},Ur)}function Lr(zr){return Hr(1,zr)}function Hr(zr=1,Ur){let Vr=-1;return $r(()=>(Vr+=1,Vr>=zr),Ur)}return Array.isArray(toValue(Tr))?{toMatch:$r,toContains:Nr,changed:Lr,changedTimes:Hr,get not(){return createUntil(Tr,!Cr)}}:{toMatch:$r,toBe:Ar,toBeTruthy:Rr,toBeNull:Dr,toBeNaN:Br,toBeUndefined:Mr,changed:Lr,changedTimes:Hr,get not(){return createUntil(Tr,!Cr)}}}function until(Tr){return createUntil(Tr)}const REGEX_PARSE=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,REGEX_FORMAT=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;function defaultMeridiem(Tr,Cr,$r,Ar){let Rr=Tr<12?"AM":"PM";return Ar&&(Rr=Rr.split("").reduce((Dr,Mr)=>Dr+=`${Mr}.`,"")),$r?Rr.toLowerCase():Rr}function formatDate(Tr,Cr,$r={}){var Ar;const Rr=Tr.getFullYear(),Dr=Tr.getMonth(),Mr=Tr.getDate(),Br=Tr.getHours(),Nr=Tr.getMinutes(),Lr=Tr.getSeconds(),Hr=Tr.getMilliseconds(),zr=Tr.getDay(),Ur=(Ar=$r.customMeridiem)!=null?Ar:defaultMeridiem,Vr={YY:()=>String(Rr).slice(-2),YYYY:()=>Rr,M:()=>Dr+1,MM:()=>`${Dr+1}`.padStart(2,"0"),MMM:()=>Tr.toLocaleDateString($r.locales,{month:"short"}),MMMM:()=>Tr.toLocaleDateString($r.locales,{month:"long"}),D:()=>String(Mr),DD:()=>`${Mr}`.padStart(2,"0"),H:()=>String(Br),HH:()=>`${Br}`.padStart(2,"0"),h:()=>`${Br%12||12}`.padStart(1,"0"),hh:()=>`${Br%12||12}`.padStart(2,"0"),m:()=>String(Nr),mm:()=>`${Nr}`.padStart(2,"0"),s:()=>String(Lr),ss:()=>`${Lr}`.padStart(2,"0"),SSS:()=>`${Hr}`.padStart(3,"0"),d:()=>zr,dd:()=>Tr.toLocaleDateString($r.locales,{weekday:"narrow"}),ddd:()=>Tr.toLocaleDateString($r.locales,{weekday:"short"}),dddd:()=>Tr.toLocaleDateString($r.locales,{weekday:"long"}),A:()=>Ur(Br,Nr),AA:()=>Ur(Br,Nr,!1,!0),a:()=>Ur(Br,Nr,!0),aa:()=>Ur(Br,Nr,!0,!0)};return Cr.replace(REGEX_FORMAT,(jr,Gr)=>{var Xr;return Gr||((Xr=Vr[jr])==null?void 0:Xr.call(Vr))||jr})}function normalizeDate(Tr){if(Tr===null)return new Date(NaN);if(Tr===void 0)return new Date;if(Tr instanceof Date)return new Date(Tr);if(typeof Tr=="string"&&!/Z$/i.test(Tr)){const Cr=Tr.match(REGEX_PARSE);if(Cr){const $r=Cr[2]-1||0,Ar=(Cr[7]||"0").substring(0,3);return new Date(Cr[1],$r,Cr[3]||1,Cr[4]||0,Cr[5]||0,Cr[6]||0,Ar)}}return new Date(Tr)}function useDateFormat(Tr,Cr="HH:mm:ss",$r={}){return computed(()=>formatDate(normalizeDate(toValue(Tr)),toValue(Cr),$r))}function useIntervalFn(Tr,Cr=1e3,$r={}){const{immediate:Ar=!0,immediateCallback:Rr=!1}=$r;let Dr=null;const Mr=ref(!1);function Br(){Dr&&(clearInterval(Dr),Dr=null)}function Nr(){Mr.value=!1,Br()}function Lr(){const Hr=toValue(Cr);Hr<=0||(Mr.value=!0,Rr&&Tr(),Br(),Dr=setInterval(Tr,Hr))}if(Ar&&isClient$1&&Lr(),isRef(Cr)||typeof Cr=="function"){const Hr=watch(Cr,()=>{Mr.value&&isClient$1&&Lr()});tryOnScopeDispose(Hr)}return tryOnScopeDispose(Nr),{isActive:Mr,pause:Nr,resume:Lr}}function whenever(Tr,Cr,$r){return watch(Tr,(Ar,Rr,Dr)=>{Ar&&Cr(Ar,Rr,Dr)},$r)}function unrefElement(Tr){var Cr;const $r=toValue(Tr);return(Cr=$r==null?void 0:$r.$el)!=null?Cr:$r}const defaultWindow=isClient$1?window:void 0,defaultDocument=isClient$1?window.document:void 0;function useEventListener(...Tr){let Cr,$r,Ar,Rr;if(typeof Tr[0]=="string"||Array.isArray(Tr[0])?([$r,Ar,Rr]=Tr,Cr=defaultWindow):[Cr,$r,Ar,Rr]=Tr,!Cr)return noop$1;Array.isArray($r)||($r=[$r]),Array.isArray(Ar)||(Ar=[Ar]);const Dr=[],Mr=()=>{Dr.forEach(Hr=>Hr()),Dr.length=0},Br=(Hr,zr,Ur,Vr)=>(Hr.addEventListener(zr,Ur,Vr),()=>Hr.removeEventListener(zr,Ur,Vr)),Nr=watch(()=>[unrefElement(Cr),toValue(Rr)],([Hr,zr])=>{Mr(),Hr&&Dr.push(...$r.flatMap(Ur=>Ar.map(Vr=>Br(Hr,Ur,Vr,zr))))},{immediate:!0,flush:"post"}),Lr=()=>{Nr(),Mr()};return tryOnScopeDispose(Lr),Lr}let _iOSWorkaround=!1;function onClickOutside(Tr,Cr,$r={}){const{window:Ar=defaultWindow,ignore:Rr=[],capture:Dr=!0,detectIframe:Mr=!1}=$r;if(!Ar)return;isIOS$1&&!_iOSWorkaround&&(_iOSWorkaround=!0,Array.from(Ar.document.body.children).forEach(Ur=>Ur.addEventListener("click",noop$1)));let Br=!0;const Nr=Ur=>Rr.some(Vr=>{if(typeof Vr=="string")return Array.from(Ar.document.querySelectorAll(Vr)).some(jr=>jr===Ur.target||Ur.composedPath().includes(jr));{const jr=unrefElement(Vr);return jr&&(Ur.target===jr||Ur.composedPath().includes(jr))}}),Hr=[useEventListener(Ar,"click",Ur=>{const Vr=unrefElement(Tr);if(!(!Vr||Vr===Ur.target||Ur.composedPath().includes(Vr))){if(Ur.detail===0&&(Br=!Nr(Ur)),!Br){Br=!0;return}Cr(Ur)}},{passive:!0,capture:Dr}),useEventListener(Ar,"pointerdown",Ur=>{const Vr=unrefElement(Tr);Vr&&(Br=!Ur.composedPath().includes(Vr)&&!Nr(Ur))},{passive:!0}),Mr&&useEventListener(Ar,"blur",Ur=>{setTimeout(()=>{var Vr;const jr=unrefElement(Tr);((Vr=Ar.document.activeElement)==null?void 0:Vr.tagName)==="IFRAME"&&!(jr!=null&&jr.contains(Ar.document.activeElement))&&Cr(Ur)},0)})].filter(Boolean);return()=>Hr.forEach(Ur=>Ur())}function createKeyPredicate(Tr){return typeof Tr=="function"?Tr:typeof Tr=="string"?Cr=>Cr.key===Tr:Array.isArray(Tr)?Cr=>Tr.includes(Cr.key):()=>!0}function onKeyStroke(...Tr){let Cr,$r,Ar={};Tr.length===3?(Cr=Tr[0],$r=Tr[1],Ar=Tr[2]):Tr.length===2?typeof Tr[1]=="object"?(Cr=!0,$r=Tr[0],Ar=Tr[1]):(Cr=Tr[0],$r=Tr[1]):(Cr=!0,$r=Tr[0]);const{target:Rr=defaultWindow,eventName:Dr="keydown",passive:Mr=!1,dedupe:Br=!1}=Ar,Nr=createKeyPredicate(Cr);return useEventListener(Rr,Dr,Hr=>{Hr.repeat&&toValue(Br)||Nr(Hr)&&$r(Hr)},Mr)}function useActiveElement(Tr={}){var Cr;const{window:$r=defaultWindow}=Tr,Ar=(Cr=Tr.document)!=null?Cr:$r==null?void 0:$r.document,Rr=computedWithControl(()=>null,()=>Ar==null?void 0:Ar.activeElement);return $r&&(useEventListener($r,"blur",Dr=>{Dr.relatedTarget===null&&Rr.trigger()},!0),useEventListener($r,"focus",Rr.trigger,!0)),Rr}function useMounted(){const Tr=ref(!1);return getCurrentInstance()&&onMounted(()=>{Tr.value=!0}),Tr}function useSupported(Tr){const Cr=useMounted();return computed(()=>(Cr.value,!!Tr()))}function useRafFn(Tr,Cr={}){const{immediate:$r=!0,window:Ar=defaultWindow}=Cr,Rr=ref(!1);let Dr=0,Mr=null;function Br(Hr){if(!Rr.value||!Ar)return;const zr=Hr-Dr;Tr({delta:zr,timestamp:Hr}),Dr=Hr,Mr=Ar.requestAnimationFrame(Br)}function Nr(){!Rr.value&&Ar&&(Rr.value=!0,Mr=Ar.requestAnimationFrame(Br))}function Lr(){Rr.value=!1,Mr!=null&&Ar&&(Ar.cancelAnimationFrame(Mr),Mr=null)}return $r&&Nr(),tryOnScopeDispose(Lr),{isActive:readonly(Rr),pause:Lr,resume:Nr}}var __defProp$o=Object.defineProperty,__defProps$b=Object.defineProperties,__getOwnPropDescs$b=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$r=Object.getOwnPropertySymbols,__hasOwnProp$r=Object.prototype.hasOwnProperty,__propIsEnum$r=Object.prototype.propertyIsEnumerable,__defNormalProp$o=(Tr,Cr,$r)=>Cr in Tr?__defProp$o(Tr,Cr,{enumerable:!0,configurable:!0,writable:!0,value:$r}):Tr[Cr]=$r,__spreadValues$o=(Tr,Cr)=>{for(var $r in Cr||(Cr={}))__hasOwnProp$r.call(Cr,$r)&&__defNormalProp$o(Tr,$r,Cr[$r]);if(__getOwnPropSymbols$r)for(var $r of __getOwnPropSymbols$r(Cr))__propIsEnum$r.call(Cr,$r)&&__defNormalProp$o(Tr,$r,Cr[$r]);return Tr},__spreadProps$b=(Tr,Cr)=>__defProps$b(Tr,__getOwnPropDescs$b(Cr));function useAsyncState(Tr,Cr,$r){const{immediate:Ar=!0,delay:Rr=0,onError:Dr=noop$1,onSuccess:Mr=noop$1,resetOnExecute:Br=!0,shallow:Nr=!0,throwError:Lr}=$r??{},Hr=Nr?shallowRef(Cr):ref(Cr),zr=ref(!1),Ur=ref(!1),Vr=shallowRef(void 0);async function jr(Kr=0,...Zr){Br&&(Hr.value=Cr),Vr.value=void 0,zr.value=!1,Ur.value=!0,Kr>0&&await promiseTimeout(Kr);const eo=typeof Tr=="function"?Tr(...Zr):Tr;try{const Wr=await eo;Hr.value=Wr,zr.value=!0,Mr(Wr)}catch(Wr){if(Vr.value=Wr,Dr(Wr),Lr)throw Wr}finally{Ur.value=!1}return Hr.value}Ar&&jr(Rr);const Gr={state:Hr,isReady:zr,isLoading:Ur,error:Vr,execute:jr};function Xr(){return new Promise((Kr,Zr)=>{until(Ur).toBe(!1).then(()=>Kr(Gr)).catch(Zr)})}return __spreadProps$b(__spreadValues$o({},Gr),{then(Kr,Zr){return Xr().then(Kr,Zr)}})}function useMediaQuery(Tr,Cr={}){const{window:$r=defaultWindow}=Cr,Ar=useSupported(()=>$r&&"matchMedia"in $r&&typeof $r.matchMedia=="function");let Rr;const Dr=ref(!1),Mr=()=>{Rr&&("removeEventListener"in Rr?Rr.removeEventListener("change",Br):Rr.removeListener(Br))},Br=()=>{Ar.value&&(Mr(),Rr=$r.matchMedia(toRef(Tr).value),Dr.value=!!(Rr!=null&&Rr.matches),Rr&&("addEventListener"in Rr?Rr.addEventListener("change",Br):Rr.addListener(Br)))};return watchEffect(Br),tryOnScopeDispose(()=>Mr()),Dr}var __getOwnPropSymbols$m=Object.getOwnPropertySymbols,__hasOwnProp$m=Object.prototype.hasOwnProperty,__propIsEnum$m=Object.prototype.propertyIsEnumerable,__objRest$3=(Tr,Cr)=>{var $r={};for(var Ar in Tr)__hasOwnProp$m.call(Tr,Ar)&&Cr.indexOf(Ar)<0&&($r[Ar]=Tr[Ar]);if(Tr!=null&&__getOwnPropSymbols$m)for(var Ar of __getOwnPropSymbols$m(Tr))Cr.indexOf(Ar)<0&&__propIsEnum$m.call(Tr,Ar)&&($r[Ar]=Tr[Ar]);return $r};function useMutationObserver(Tr,Cr,$r={}){const Ar=$r,{window:Rr=defaultWindow}=Ar,Dr=__objRest$3(Ar,["window"]);let Mr;const Br=useSupported(()=>Rr&&"MutationObserver"in Rr),Nr=()=>{Mr&&(Mr.disconnect(),Mr=void 0)},Lr=watch(()=>unrefElement(Tr),zr=>{Nr(),Br.value&&Rr&&zr&&(Mr=new MutationObserver(Cr),Mr.observe(zr,Dr))},{immediate:!0}),Hr=()=>{Nr(),Lr()};return tryOnScopeDispose(Hr),{isSupported:Br,stop:Hr}}function useDocumentVisibility({document:Tr=defaultDocument}={}){if(!Tr)return ref("visible");const Cr=ref(Tr.visibilityState);return useEventListener(Tr,"visibilitychange",()=>{Cr.value=Tr.visibilityState}),Cr}var __getOwnPropSymbols$h=Object.getOwnPropertySymbols,__hasOwnProp$h=Object.prototype.hasOwnProperty,__propIsEnum$h=Object.prototype.propertyIsEnumerable,__objRest$2=(Tr,Cr)=>{var $r={};for(var Ar in Tr)__hasOwnProp$h.call(Tr,Ar)&&Cr.indexOf(Ar)<0&&($r[Ar]=Tr[Ar]);if(Tr!=null&&__getOwnPropSymbols$h)for(var Ar of __getOwnPropSymbols$h(Tr))Cr.indexOf(Ar)<0&&__propIsEnum$h.call(Tr,Ar)&&($r[Ar]=Tr[Ar]);return $r};function useResizeObserver(Tr,Cr,$r={}){const Ar=$r,{window:Rr=defaultWindow}=Ar,Dr=__objRest$2(Ar,["window"]);let Mr;const Br=useSupported(()=>Rr&&"ResizeObserver"in Rr),Nr=()=>{Mr&&(Mr.disconnect(),Mr=void 0)},Lr=computed(()=>Array.isArray(Tr)?Tr.map(Ur=>unrefElement(Ur)):[unrefElement(Tr)]),Hr=watch(Lr,Ur=>{if(Nr(),Br.value&&Rr){Mr=new ResizeObserver(Cr);for(const Vr of Ur)Vr&&Mr.observe(Vr,Dr)}},{immediate:!0,flush:"post",deep:!0}),zr=()=>{Nr(),Hr()};return tryOnScopeDispose(zr),{isSupported:Br,stop:zr}}function useElementBounding$1(Tr,Cr={}){const{reset:$r=!0,windowResize:Ar=!0,windowScroll:Rr=!0,immediate:Dr=!0}=Cr,Mr=ref(0),Br=ref(0),Nr=ref(0),Lr=ref(0),Hr=ref(0),zr=ref(0),Ur=ref(0),Vr=ref(0);function jr(){const Gr=unrefElement(Tr);if(!Gr){$r&&(Mr.value=0,Br.value=0,Nr.value=0,Lr.value=0,Hr.value=0,zr.value=0,Ur.value=0,Vr.value=0);return}const Xr=Gr.getBoundingClientRect();Mr.value=Xr.height,Br.value=Xr.bottom,Nr.value=Xr.left,Lr.value=Xr.right,Hr.value=Xr.top,zr.value=Xr.width,Ur.value=Xr.x,Vr.value=Xr.y}return useResizeObserver(Tr,jr),watch(()=>unrefElement(Tr),Gr=>!Gr&&jr()),Rr&&useEventListener("scroll",jr,{capture:!0,passive:!0}),Ar&&useEventListener("resize",jr,{passive:!0}),tryOnMounted$1(()=>{Dr&&jr()}),{height:Mr,bottom:Br,left:Nr,right:Lr,top:Hr,width:zr,x:Ur,y:Vr,update:jr}}function useElementSize(Tr,Cr={width:0,height:0},$r={}){const{window:Ar=defaultWindow,box:Rr="content-box"}=$r,Dr=computed(()=>{var Nr,Lr;return(Lr=(Nr=unrefElement(Tr))==null?void 0:Nr.namespaceURI)==null?void 0:Lr.includes("svg")}),Mr=ref(Cr.width),Br=ref(Cr.height);return useResizeObserver(Tr,([Nr])=>{const Lr=Rr==="border-box"?Nr.borderBoxSize:Rr==="content-box"?Nr.contentBoxSize:Nr.devicePixelContentBoxSize;if(Ar&&Dr.value){const Hr=unrefElement(Tr);if(Hr){const zr=Ar.getComputedStyle(Hr);Mr.value=Number.parseFloat(zr.width),Br.value=Number.parseFloat(zr.height)}}else if(Lr){const Hr=Array.isArray(Lr)?Lr:[Lr];Mr.value=Hr.reduce((zr,{inlineSize:Ur})=>zr+Ur,0),Br.value=Hr.reduce((zr,{blockSize:Ur})=>zr+Ur,0)}else Mr.value=Nr.contentRect.width,Br.value=Nr.contentRect.height},$r),watch(()=>unrefElement(Tr),Nr=>{Mr.value=Nr?Cr.width:0,Br.value=Nr?Cr.height:0}),{width:Mr,height:Br}}function useIntersectionObserver(Tr,Cr,$r={}){const{root:Ar,rootMargin:Rr="0px",threshold:Dr=.1,window:Mr=defaultWindow,immediate:Br=!0}=$r,Nr=useSupported(()=>Mr&&"IntersectionObserver"in Mr),Lr=computed(()=>{const jr=toValue(Tr);return(Array.isArray(jr)?jr:[jr]).map(unrefElement).filter(notNullish)});let Hr=noop$1;const zr=ref(Br),Ur=Nr.value?watch(()=>[Lr.value,unrefElement(Ar),zr.value],([jr,Gr])=>{if(Hr(),!zr.value||!jr.length)return;const Xr=new IntersectionObserver(Cr,{root:unrefElement(Gr),rootMargin:Rr,threshold:Dr});jr.forEach(Kr=>Kr&&Xr.observe(Kr)),Hr=()=>{Xr.disconnect(),Hr=noop$1}},{immediate:Br,flush:"post"}):noop$1,Vr=()=>{Hr(),Ur(),zr.value=!1};return tryOnScopeDispose(Vr),{isSupported:Nr,isActive:zr,pause(){Hr(),zr.value=!1},resume(){zr.value=!0},stop:Vr}}var __defProp$d=Object.defineProperty,__getOwnPropSymbols$e=Object.getOwnPropertySymbols,__hasOwnProp$e=Object.prototype.hasOwnProperty,__propIsEnum$e=Object.prototype.propertyIsEnumerable,__defNormalProp$d=(Tr,Cr,$r)=>Cr in Tr?__defProp$d(Tr,Cr,{enumerable:!0,configurable:!0,writable:!0,value:$r}):Tr[Cr]=$r,__spreadValues$d=(Tr,Cr)=>{for(var $r in Cr||(Cr={}))__hasOwnProp$e.call(Cr,$r)&&__defNormalProp$d(Tr,$r,Cr[$r]);if(__getOwnPropSymbols$e)for(var $r of __getOwnPropSymbols$e(Cr))__propIsEnum$e.call(Cr,$r)&&__defNormalProp$d(Tr,$r,Cr[$r]);return Tr};const DEFAULT_OPTIONS={multiple:!0,accept:"*",reset:!1};function useFileDialog(Tr={}){const{document:Cr=defaultDocument}=Tr,$r=ref(null),{on:Ar,trigger:Rr}=createEventHook();let Dr;Cr&&(Dr=Cr.createElement("input"),Dr.type="file",Dr.onchange=Nr=>{const Lr=Nr.target;$r.value=Lr.files,Rr($r.value)});const Mr=()=>{$r.value=null,Dr&&(Dr.value="")},Br=Nr=>{if(!Dr)return;const Lr=__spreadValues$d(__spreadValues$d(__spreadValues$d({},DEFAULT_OPTIONS),Tr),Nr);Dr.multiple=Lr.multiple,Dr.accept=Lr.accept,hasOwn$1(Lr,"capture")&&(Dr.capture=Lr.capture),Lr.reset&&Mr(),Dr.click()};return{files:readonly($r),open:Br,reset:Mr,onChange:Ar}}function useFocus(Tr,Cr={}){const{initialValue:$r=!1}=Cr,Ar=ref(!1),Rr=computed(()=>unrefElement(Tr));useEventListener(Rr,"focus",()=>Ar.value=!0),useEventListener(Rr,"blur",()=>Ar.value=!1);const Dr=computed({get:()=>Ar.value,set(Mr){var Br,Nr;!Mr&&Ar.value?(Br=Rr.value)==null||Br.blur():Mr&&!Ar.value&&((Nr=Rr.value)==null||Nr.focus())}});return watch(Rr,()=>{Dr.value=$r},{immediate:!0,flush:"post"}),{focused:Dr}}function useFocusWithin(Tr,Cr={}){const $r=useActiveElement(Cr),Ar=computed(()=>unrefElement(Tr));return{focused:computed(()=>Ar.value&&$r.value?Ar.value.contains($r.value):!1)}}const eventHandlers=["fullscreenchange","webkitfullscreenchange","webkitendfullscreen","mozfullscreenchange","MSFullscreenChange"];function useFullscreen(Tr,Cr={}){const{document:$r=defaultDocument,autoExit:Ar=!1}=Cr,Rr=computed(()=>{var Kr;return(Kr=unrefElement(Tr))!=null?Kr:$r==null?void 0:$r.querySelector("html")}),Dr=ref(!1),Mr=computed(()=>["requestFullscreen","webkitRequestFullscreen","webkitEnterFullscreen","webkitEnterFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].find(Kr=>$r&&Kr in $r||Rr.value&&Kr in Rr.value)),Br=computed(()=>["exitFullscreen","webkitExitFullscreen","webkitExitFullScreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].find(Kr=>$r&&Kr in $r||Rr.value&&Kr in Rr.value)),Nr=computed(()=>["fullScreen","webkitIsFullScreen","webkitDisplayingFullscreen","mozFullScreen","msFullscreenElement"].find(Kr=>$r&&Kr in $r||Rr.value&&Kr in Rr.value)),Lr=["fullscreenElement","webkitFullscreenElement","mozFullScreenElement","msFullscreenElement"].find(Kr=>$r&&Kr in $r),Hr=useSupported(()=>Rr.value&&$r&&Mr.value!==void 0&&Br.value!==void 0&&Nr.value!==void 0),zr=()=>Lr?($r==null?void 0:$r[Lr])===Rr.value:!1,Ur=()=>{if(Nr.value){if($r&&$r[Nr.value]!=null)return $r[Nr.value];{const Kr=Rr.value;if((Kr==null?void 0:Kr[Nr.value])!=null)return!!Kr[Nr.value]}}return!1};async function Vr(){if(Hr.value){if(Br.value)if(($r==null?void 0:$r[Br.value])!=null)await $r[Br.value]();else{const Kr=Rr.value;(Kr==null?void 0:Kr[Br.value])!=null&&await Kr[Br.value]()}Dr.value=!1}}async function jr(){if(!Hr.value)return;Ur()&&await Vr();const Kr=Rr.value;Mr.value&&(Kr==null?void 0:Kr[Mr.value])!=null&&(await Kr[Mr.value](),Dr.value=!0)}async function Gr(){await(Dr.value?Vr():jr())}const Xr=()=>{const Kr=Ur();(!Kr||Kr&&zr())&&(Dr.value=Kr)};return useEventListener($r,eventHandlers,Xr,!1),useEventListener(()=>unrefElement(Rr),eventHandlers,Xr,!1),Ar&&tryOnScopeDispose(Vr),{isSupported:Hr,isFullscreen:Dr,enter:jr,exit:Vr,toggle:Gr}}var __defProp$a=Object.defineProperty,__getOwnPropSymbols$b=Object.getOwnPropertySymbols,__hasOwnProp$b=Object.prototype.hasOwnProperty,__propIsEnum$b=Object.prototype.propertyIsEnumerable,__defNormalProp$a=(Tr,Cr,$r)=>Cr in Tr?__defProp$a(Tr,Cr,{enumerable:!0,configurable:!0,writable:!0,value:$r}):Tr[Cr]=$r,__spreadValues$a=(Tr,Cr)=>{for(var $r in Cr||(Cr={}))__hasOwnProp$b.call(Cr,$r)&&__defNormalProp$a(Tr,$r,Cr[$r]);if(__getOwnPropSymbols$b)for(var $r of __getOwnPropSymbols$b(Cr))__propIsEnum$b.call(Cr,$r)&&__defNormalProp$a(Tr,$r,Cr[$r]);return Tr};async function loadImage(Tr){return new Promise((Cr,$r)=>{const Ar=new Image,{src:Rr,srcset:Dr,sizes:Mr,class:Br,loading:Nr,crossorigin:Lr,referrerPolicy:Hr}=Tr;Ar.src=Rr,Dr&&(Ar.srcset=Dr),Mr&&(Ar.sizes=Mr),Br&&(Ar.className=Br),Nr&&(Ar.loading=Nr),Lr&&(Ar.crossOrigin=Lr),Hr&&(Ar.referrerPolicy=Hr),Ar.onload=()=>Cr(Ar),Ar.onerror=$r})}function useImage(Tr,Cr={}){const $r=useAsyncState(()=>loadImage(toValue(Tr)),void 0,__spreadValues$a({resetOnExecute:!0},Cr));return watch(()=>toValue(Tr),()=>$r.execute(Cr.delay),{deep:!0}),$r}const ARRIVED_STATE_THRESHOLD_PIXELS=1;function useScroll(Tr,Cr={}){const{throttle:$r=0,idle:Ar=200,onStop:Rr=noop$1,onScroll:Dr=noop$1,offset:Mr={left:0,right:0,top:0,bottom:0},eventListenerOptions:Br={capture:!1,passive:!0},behavior:Nr="auto"}=Cr,Lr=ref(0),Hr=ref(0),zr=computed({get(){return Lr.value},set(Yr){Vr(Yr,void 0)}}),Ur=computed({get(){return Hr.value},set(Yr){Vr(void 0,Yr)}});function Vr(Yr,Jr){var no,ro,so;const ao=toValue(Tr);ao&&((so=ao instanceof Document?document.body:ao)==null||so.scrollTo({top:(no=toValue(Jr))!=null?no:Ur.value,left:(ro=toValue(Yr))!=null?ro:zr.value,behavior:toValue(Nr)}))}const jr=ref(!1),Gr=reactive({left:!0,right:!1,top:!0,bottom:!1}),Xr=reactive({left:!1,right:!1,top:!1,bottom:!1}),Kr=Yr=>{jr.value&&(jr.value=!1,Xr.left=!1,Xr.right=!1,Xr.top=!1,Xr.bottom=!1,Rr(Yr))},Zr=useDebounceFn(Kr,$r+Ar),eo=Yr=>{const Jr=Yr===window?Yr.document.documentElement:Yr===document?Yr.documentElement:Yr,{display:no,flexDirection:ro}=getComputedStyle(Jr),so=Jr.scrollLeft;Xr.left=soLr.value;const ao=Math.abs(so)<=0+(Mr.left||0),lo=Math.abs(so)+Jr.clientWidth>=Jr.scrollWidth-(Mr.right||0)-ARRIVED_STATE_THRESHOLD_PIXELS;no==="flex"&&ro==="row-reverse"?(Gr.left=lo,Gr.right=ao):(Gr.left=ao,Gr.right=lo),Lr.value=so;let po=Jr.scrollTop;Yr===document&&!po&&(po=document.body.scrollTop),Xr.top=poHr.value;const go=Math.abs(po)<=0+(Mr.top||0),co=Math.abs(po)+Jr.clientHeight>=Jr.scrollHeight-(Mr.bottom||0)-ARRIVED_STATE_THRESHOLD_PIXELS;no==="flex"&&ro==="column-reverse"?(Gr.top=co,Gr.bottom=go):(Gr.top=go,Gr.bottom=co),Hr.value=po},Wr=Yr=>{const Jr=Yr.target===document?Yr.target.documentElement:Yr.target;eo(Jr),jr.value=!0,Zr(Yr),Dr(Yr)};return useEventListener(Tr,"scroll",$r?useThrottleFn(Wr,$r,!0,!1):Wr,Br),useEventListener(Tr,"scrollend",Kr,Br),{x:zr,y:Ur,isScrolling:jr,arrivedState:Gr,directions:Xr,measure(){const Yr=toValue(Tr);Yr&&eo(Yr)}}}const defaultEvents=["mousedown","mouseup","keydown","keyup"];function useKeyModifier(Tr,Cr={}){const{events:$r=defaultEvents,document:Ar=defaultDocument,initial:Rr=null}=Cr,Dr=ref(Rr);return Ar&&$r.forEach(Mr=>{useEventListener(Ar,Mr,Br=>{typeof Br.getModifierState=="function"&&(Dr.value=Br.getModifierState(Tr))})}),Dr}const DefaultMagicKeysAliasMap={ctrl:"control",command:"meta",cmd:"meta",option:"alt",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright"};function useMagicKeys(Tr={}){const{reactive:Cr=!1,target:$r=defaultWindow,aliasMap:Ar=DefaultMagicKeysAliasMap,passive:Rr=!0,onEventFired:Dr=noop$1}=Tr,Mr=reactive(new Set),Br={toJSON(){return{}},current:Mr},Nr=Cr?reactive(Br):Br,Lr=new Set,Hr=new Set;function zr(Gr,Xr){Gr in Nr&&(Cr?Nr[Gr]=Xr:Nr[Gr].value=Xr)}function Ur(){Mr.clear();for(const Gr of Hr)zr(Gr,!1)}function Vr(Gr,Xr){var Kr,Zr;const eo=(Kr=Gr.key)==null?void 0:Kr.toLowerCase(),Yr=[(Zr=Gr.code)==null?void 0:Zr.toLowerCase(),eo].filter(Boolean);eo&&(Xr?Mr.add(eo):Mr.delete(eo));for(const Jr of Yr)Hr.add(Jr),zr(Jr,Xr);eo==="meta"&&!Xr?(Lr.forEach(Jr=>{Mr.delete(Jr),zr(Jr,!1)}),Lr.clear()):typeof Gr.getModifierState=="function"&&Gr.getModifierState("Meta")&&Xr&&[...Mr,...Yr].forEach(Jr=>Lr.add(Jr))}useEventListener($r,"keydown",Gr=>(Vr(Gr,!0),Dr(Gr)),{passive:Rr}),useEventListener($r,"keyup",Gr=>(Vr(Gr,!1),Dr(Gr)),{passive:Rr}),useEventListener("blur",Ur,{passive:!0}),useEventListener("focus",Ur,{passive:!0});const jr=new Proxy(Nr,{get(Gr,Xr,Kr){if(typeof Xr!="string")return Reflect.get(Gr,Xr,Kr);if(Xr=Xr.toLowerCase(),Xr in Ar&&(Xr=Ar[Xr]),!(Xr in Nr))if(/[+_-]/.test(Xr)){const eo=Xr.split(/[+_-]/g).map(Wr=>Wr.trim());Nr[Xr]=computed(()=>eo.every(Wr=>toValue(jr[Wr])))}else Nr[Xr]=ref(!1);const Zr=Reflect.get(Gr,Xr,Kr);return Cr?toValue(Zr):Zr}});return jr}const BuiltinExtractors={page:Tr=>[Tr.pageX,Tr.pageY],client:Tr=>[Tr.clientX,Tr.clientY],screen:Tr=>[Tr.screenX,Tr.screenY],movement:Tr=>Tr instanceof Touch?null:[Tr.movementX,Tr.movementY]};function useMouse(Tr={}){const{type:Cr="page",touch:$r=!0,resetOnTouchEnds:Ar=!1,initialValue:Rr={x:0,y:0},window:Dr=defaultWindow,target:Mr=Dr,eventFilter:Br}=Tr,Nr=ref(Rr.x),Lr=ref(Rr.y),Hr=ref(null),zr=typeof Cr=="function"?Cr:BuiltinExtractors[Cr],Ur=Kr=>{const Zr=zr(Kr);Zr&&([Nr.value,Lr.value]=Zr,Hr.value="mouse")},Vr=Kr=>{if(Kr.touches.length>0){const Zr=zr(Kr.touches[0]);Zr&&([Nr.value,Lr.value]=Zr,Hr.value="touch")}},jr=()=>{Nr.value=Rr.x,Lr.value=Rr.y},Gr=Br?Kr=>Br(()=>Ur(Kr),{}):Kr=>Ur(Kr),Xr=Br?Kr=>Br(()=>Vr(Kr),{}):Kr=>Vr(Kr);return Mr&&(useEventListener(Mr,"mousemove",Gr,{passive:!0}),useEventListener(Mr,"dragover",Gr,{passive:!0}),$r&&Cr!=="movement"&&(useEventListener(Mr,"touchstart",Xr,{passive:!0}),useEventListener(Mr,"touchmove",Xr,{passive:!0}),Ar&&useEventListener(Mr,"touchend",jr,{passive:!0}))),{x:Nr,y:Lr,sourceType:Hr}}var __defProp$6=Object.defineProperty,__defProps$2=Object.defineProperties,__getOwnPropDescs$2=Object.getOwnPropertyDescriptors,__getOwnPropSymbols$6=Object.getOwnPropertySymbols,__hasOwnProp$6=Object.prototype.hasOwnProperty,__propIsEnum$6=Object.prototype.propertyIsEnumerable,__defNormalProp$6=(Tr,Cr,$r)=>Cr in Tr?__defProp$6(Tr,Cr,{enumerable:!0,configurable:!0,writable:!0,value:$r}):Tr[Cr]=$r,__spreadValues$6=(Tr,Cr)=>{for(var $r in Cr||(Cr={}))__hasOwnProp$6.call(Cr,$r)&&__defNormalProp$6(Tr,$r,Cr[$r]);if(__getOwnPropSymbols$6)for(var $r of __getOwnPropSymbols$6(Cr))__propIsEnum$6.call(Cr,$r)&&__defNormalProp$6(Tr,$r,Cr[$r]);return Tr},__spreadProps$2=(Tr,Cr)=>__defProps$2(Tr,__getOwnPropDescs$2(Cr));const defaultState={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},keys$1=Object.keys(defaultState);function usePointer(Tr={}){const{target:Cr=defaultWindow}=Tr,$r=ref(!1),Ar=ref(Tr.initialValue||{});Object.assign(Ar.value,defaultState,Ar.value);const Rr=Dr=>{$r.value=!0,!(Tr.pointerTypes&&!Tr.pointerTypes.includes(Dr.pointerType))&&(Ar.value=objectPick(Dr,keys$1,!1))};return Cr&&(useEventListener(Cr,"pointerdown",Rr,{passive:!0}),useEventListener(Cr,"pointermove",Rr,{passive:!0}),useEventListener(Cr,"pointerleave",()=>$r.value=!1,{passive:!0})),__spreadProps$2(__spreadValues$6({},toRefs(Ar)),{isInside:$r})}let _id$1=0;function useStyleTag(Tr,Cr={}){const $r=ref(!1),{document:Ar=defaultDocument,immediate:Rr=!0,manual:Dr=!1,id:Mr=`vueuse_styletag_${++_id$1}`}=Cr,Br=ref(Tr);let Nr=()=>{};const Lr=()=>{if(!Ar)return;const zr=Ar.getElementById(Mr)||Ar.createElement("style");zr.isConnected||(zr.type="text/css",zr.id=Mr,Cr.media&&(zr.media=Cr.media),Ar.head.appendChild(zr)),!$r.value&&(Nr=watch(Br,Ur=>{zr.textContent=Ur},{immediate:!0}),$r.value=!0)},Hr=()=>{!Ar||!$r.value||(Nr(),Ar.head.removeChild(Ar.getElementById(Mr)),$r.value=!1)};return Rr&&!Dr&&tryOnMounted$1(Lr),Dr||tryOnScopeDispose(Hr),{id:Mr,css:Br,unload:Hr,load:Lr,isLoaded:readonly($r)}}function getRangesFromSelection(Tr){var Cr;const $r=(Cr=Tr.rangeCount)!=null?Cr:0,Ar=new Array($r);for(let Rr=0;Rr<$r;Rr++){const Dr=Tr.getRangeAt(Rr);Ar[Rr]=Dr}return Ar}function useTextSelection(Tr={}){const{window:Cr=defaultWindow}=Tr,$r=ref(null),Ar=computed(()=>{var Br,Nr;return(Nr=(Br=$r.value)==null?void 0:Br.toString())!=null?Nr:""}),Rr=computed(()=>$r.value?getRangesFromSelection($r.value):[]),Dr=computed(()=>Rr.value.map(Br=>Br.getBoundingClientRect()));function Mr(){$r.value=null,Cr&&($r.value=Cr.getSelection())}return Cr&&useEventListener(Cr.document,"selectionchange",Mr),{text:Ar,rects:Dr,ranges:Rr,selection:$r}}var __defProp$1=Object.defineProperty,__getOwnPropSymbols$1=Object.getOwnPropertySymbols,__hasOwnProp$1=Object.prototype.hasOwnProperty,__propIsEnum$1=Object.prototype.propertyIsEnumerable,__defNormalProp$1=(Tr,Cr,$r)=>Cr in Tr?__defProp$1(Tr,Cr,{enumerable:!0,configurable:!0,writable:!0,value:$r}):Tr[Cr]=$r,__spreadValues$1=(Tr,Cr)=>{for(var $r in Cr||(Cr={}))__hasOwnProp$1.call(Cr,$r)&&__defNormalProp$1(Tr,$r,Cr[$r]);if(__getOwnPropSymbols$1)for(var $r of __getOwnPropSymbols$1(Cr))__propIsEnum$1.call(Cr,$r)&&__defNormalProp$1(Tr,$r,Cr[$r]);return Tr};function useTimestamp(Tr={}){const{controls:Cr=!1,offset:$r=0,immediate:Ar=!0,interval:Rr="requestAnimationFrame",callback:Dr}=Tr,Mr=ref(timestamp()+$r),Br=()=>Mr.value=timestamp()+$r,Nr=Dr?()=>{Br(),Dr(Mr.value)}:Br,Lr=Rr==="requestAnimationFrame"?useRafFn(Nr,{immediate:Ar}):useIntervalFn(Nr,Rr,{immediate:Ar});return Cr?__spreadValues$1({timestamp:Mr},Lr):Mr}function useTitle(Tr=null,Cr={}){var $r,Ar;const{document:Rr=defaultDocument}=Cr,Dr=toRef(($r=Tr??(Rr==null?void 0:Rr.title))!=null?$r:null),Mr=Tr&&typeof Tr=="function";function Br(Nr){if(!("titleTemplate"in Cr))return Nr;const Lr=Cr.titleTemplate||"%s";return typeof Lr=="function"?Lr(Nr):toValue(Lr).replace(/%s/g,Nr)}return watch(Dr,(Nr,Lr)=>{Nr!==Lr&&Rr&&(Rr.title=Br(typeof Nr=="string"?Nr:""))},{immediate:!0}),Cr.observe&&!Cr.titleTemplate&&Rr&&!Mr&&useMutationObserver((Ar=Rr.head)==null?void 0:Ar.querySelector("title"),()=>{Rr&&Rr.title!==Dr.value&&(Dr.value=Br(Rr.title))},{childList:!0}),Dr}function useWindowSize(Tr={}){const{window:Cr=defaultWindow,initialWidth:$r=1/0,initialHeight:Ar=1/0,listenOrientation:Rr=!0,includeScrollbar:Dr=!0}=Tr,Mr=ref($r),Br=ref(Ar),Nr=()=>{Cr&&(Dr?(Mr.value=Cr.innerWidth,Br.value=Cr.innerHeight):(Mr.value=Cr.document.documentElement.clientWidth,Br.value=Cr.document.documentElement.clientHeight))};if(Nr(),tryOnMounted$1(Nr),useEventListener("resize",Nr,{passive:!0}),Rr){const Lr=useMediaQuery("(orientation: portrait)");watch(Lr,()=>Nr())}return{width:Mr,height:Br}}const getFontString=(Tr,Cr)=>{let $r="";const Ar=fonts.state.fonts.findIndex(Lr=>Lr.family===Tr);if(Ar===-1)return null;const Rr=fonts.state.fonts[Ar];let Dr=Rr.files[Cr];if(Dr==null&&(Cr==="400"&&(Dr=Rr.files.regular),Dr==null))return console.log("font variant not found",Tr,Cr),null;Dr.startsWith("http://")&&(Dr=Dr.replace("http://","https://"));const Mr=Cr==="regular"?"400":Cr;let Br=Mr.includes("italic")?Mr.replace("italic",""):Mr;Br=Br===""?"400":Br;const Nr=Mr.includes("italic")?"italic":"normal";return $r=`@font-face { font-family: ${Tr}; font-weight: ${Br}; font-style: ${Nr}; src: url('${Dr}') format('opentype');}`,$r},useAddFontToHead=(Tr,Cr)=>{const $r=getFontString(Tr,Cr);$r!=null&&useStyleTag($r)},getFontsForDeck=Tr=>{const $r=usePageStore().allBlockIdsForADeck(Tr),Ar=useBlockStore();$r.forEach(Rr=>{var Mr,Br,Nr,Lr;const Dr=(Br=(Mr=Ar.config(Rr))==null?void 0:Mr.fontFamily)==null?void 0:Br.selectedId;Dr!=null&&useAddFontToHead(Dr,((Lr=(Nr=Ar.config(Rr))==null?void 0:Nr.fontWeight)==null?void 0:Lr.selectedId)??"regular")})},useOrgSetup=async()=>{const Tr=useUserStore();Tr.currentOrgId||await Tr.fetchAndHydrateOrgsForUser(Tr.currentUserId)},useOrgSetupDirect=async()=>{const Tr=useUserStore();await Tr.fetchAndHydrateOrgsForUser(Tr.currentUserId)},useFolderSetup=async()=>{const Tr=useUserStore(),Cr=useFolderStore();Tr.currentOrgId&&Cr.rootFolderIds.length===0&&await Cr.fetchAndHydrateRootFolders({userId:Tr.currentUserId,orgId:Tr.currentOrgId}),Cr.currentFolderId==null&&Cr.setCurrentFolderId(Cr.privateSystemFolderId)},useUserSetup=async Tr=>{var Kr,Zr,eo,Wr,Yr,Jr;performance.now();const Cr=useUserStore();useFolderStore();const{currentUser:$r,fromApp:Ar,fromDeck:Rr,fromEmailSignIn:Dr,deckId:Mr}=Tr,Br=ref(!0),Nr=await getSession(),Lr=(Zr=(Kr=Nr==null?void 0:Nr.data)==null?void 0:Kr.session)==null?void 0:Zr.user;if(!Lr){Cr.isLoggedIn&&Cr.setLoggedIn(!1);return}const Hr=((eo=Lr.user_metadata)==null?void 0:eo.full_name)??"",zr=Hr.split(" ")[0]??"",Ur=Hr.split(" ")[1]??"",Vr={id:Lr.id,first_name:zr,last_name:Ur,email:Lr.email??"",avatar_url:""};Cr.updateUserObject(Vr),Cr.setLoggedIn(!0);const{data:jr,error:Gr}=await fetchProfile((Wr=$r.value)==null?void 0:Wr.id),Xr=[];if((Rr||Dr)&&(Xr.push(useOrgSetup()),Xr.push(useFolderSetup())),Br.value=!1,Gr||jr==null){Cr.updateUserObject({...Vr,avatar_url:(Yr=Lr.user_metadata)==null?void 0:Yr.avatar_url});return}if(jr[0]==null||jr[0].id==null)Cr.updateUserObject({...$r.value,avatar_url:(Jr=Lr.user_metadata)==null?void 0:Jr.avatar_url,credits_allowed:500}),Cr.updateTotalCredits(0);else{const{total_credits:no,...ro}=jr[0];Cr.updateUserObject(ro),Cr.updateTotalCredits(no)}return Ir.identify(Cr.currentUserId,{email:Cr.currentUserEmail,name:Cr.userFullName,isPro:Cr.isProSubscription(Cr.currentOrgId)}),Promise.all(Xr)},fetchHomePageData=async({route:Tr})=>{const Cr=useAppStore(),$r=useFolderStore(),Ar=useUserStore(),Rr=computed(()=>$r.privateSystemFolderId),Dr=computed(()=>$r.workspaceSystemFolderId),Mr=computed(()=>Ar.showWorkspaceView),Br=computed(()=>Mr.value?Dr.value:Rr.value),Nr=()=>{if($r.currentFolderId)return $r.currentFolderId;if(Tr.path==="/")try{const Vr=window.location.hash.slice(1);if(Vr)return Vr}catch(Vr){console.error(Vr)}return Mr.value?$r.workspaceSystemFolderId:Br.value};Ar.useStoredOrgIdIfAvailable(),Ar.currentOrgId==null?await useOrgSetup():useOrgSetupDirect(),Cr.fetchWorkspaceMeta();const{data:Lr,error:Hr}=await queryFetchHomePage({userId:Ar.currentUserId,orgId:Ar.currentOrgId??""}),zr={error:null};if(Hr||!Lr)zr.error="Sorry, something went wrong. Please try refreshing the page. Or log in again.";else{const{root:Vr}=Lr,{rootFolders:jr}=Vr;$r.hydrate(jr),jr.forEach(Gr=>$r.hydrate(Gr.folders)),Cr.fetchSearchDecks()}const Ur=Nr();return await $r.fetchAndHydrateFolderContents(Ur||""),$r.setCurrentFolderId(Ur),zr},PATH_FOR_ARTBOARD="/a/",useRouteInfo=()=>{const Tr=useArtboardStore(),Cr=useRoute(),$r=computed(()=>Cr.path.startsWith("/pdf/")),Ar=computed(()=>Cr.path.startsWith("/screenshot/")),Rr=computed(()=>Cr.path.startsWith("/public/")||Tr.getIsPublicPath),Dr=computed(()=>Cr.path.startsWith("/home")&&!Rr.value);function Mr(Nr){return Array.isArray(Nr)?Nr.map(Lr=>(Lr==null?void 0:Lr.toString())??"").join(","):(Nr==null?void 0:Nr.toString())??""}const Br=computed(()=>{let Nr=Cr.path;const Lr=Cr.query,Hr=Object.keys(Lr);return Hr.length&&(Nr+="?",Nr+=Hr.map(zr=>{const Ur=Lr[zr];return`${encodeURIComponent(zr)}=${encodeURIComponent(Mr(Ur))}`}).join("&")),Nr});return{isPdf:$r,isScreenshot:Ar,isPublic:Rr,currentPathWithQuery:Br,isHome:Dr}},useDetermineRouteAfterLogin=async({route:Tr})=>{const Cr=useUserStore();let{redirect:$r,inviteId:Ar,inviteKey:Rr}=Tr.query;const{new:Dr}=Tr.query;if(Dr){const{error:Br}=await fetchHomePageData({route:Tr});if(Br)return{error:Br,path:null,query:null};const Nr=await createNewDeck();return{path:`${PATH_FOR_ARTBOARD}${Nr}`,query:{new:"true"}}}if(Array.isArray($r)&&($r=$r[0]),Array.isArray(Ar)&&(Ar=Ar[0]),Array.isArray(Rr)&&(Rr=Rr[0]),!(Tr.hash&&Tr.hash.length>0&&Tr.hash.includes("access_token"))&&!$r&&!Ar)return{path:"/home"};if(Ar){const Br=Ar,{data:Nr,error:Lr}=await queryResourceFetchOrg({orgId:Br});if(Lr||!Nr)return{path:"/home"};const Hr=Nr.creator_id;if(new Date(Nr.created_at).getTime().toString()!==Rr)return{path:"/home"};const{data:Ur,error:Vr}=await queryWorkspaceCRUDMembers({orgId:Br,userId:Hr,inviteeId:Cr.currentUserId,action:"addViaInvite"});return Vr||!Ur?(console.error("[workspace-crud-members] error:",Vr),{error:"workspace update failed",path:null,query:null}):(await Cr.fetchAndHydrateOrgsForUser(Cr.currentUserId),Cr.updateCurrentOrgId(Br),{path:`/home#${Ur.id}`})}if($r){if($r.includes("?")){const[Br,Nr]=$r.split("?");if(!Nr)return{path:Br};const Lr=new URLSearchParams(`?${Nr}`),Hr={};for(const[zr,Ur]of Lr.entries())Hr[zr]=Ur;if(Object.keys(Tr.query).length>0)for(const[zr,Ur]of Object.entries(Tr.query))zr!=="redirect"&&(Hr[zr]=Ur);return{path:Br,query:Hr}}return{path:$r}}return{path:"/home"}},createNewDeck=async()=>{const Tr=useAppStore(),Cr=useFolderStore(),$r=useUserStore(),Ar=computed(()=>Cr.currentFolderId),Rr=computed(()=>$r.currentUser),Dr=computed(()=>$r.currentOrgId);$r.currentUserId==null&&await useUserSetup({currentUser:Rr}),Dr.value==null&&await useOrgSetup(),Ar.value==null&&await useFolderSetup();const Mr=await Tr.createDeck();if(Mr!=null)return posthogCapture("deck_created"),Mr},handleDeckClick=(Tr,Cr)=>{if(Tr.ctrlKey||Tr.metaKey){const Rr=`${window.location.origin}${PATH_FOR_ARTBOARD}${Cr}`;window.open(Rr,"_blank");return}useMiscStore().setRoutePathToOpen(`${PATH_FOR_ARTBOARD}${Cr}`)},deleteDeckNotification=Tr=>{const Cr=useAppStore(),$r=useMiscStore();$r.setHomeNotification({noti:{type:"info",text:`Deleted "${Cr.title(Tr)}"`,hangTime:6e3,action:{text:"Undo",show:!0,callback:()=>{Cr.restoreDeck(Tr),$r.setHomeNotification({show:!1})}}},show:!0}),Cr.setNotif(Tr,{text:`Deleted "${Cr.title(Tr)}"`,showEmoji:!1,persistent:!1,isProminent:!1,showInProgress:!1,showTag:!1,type:"info",hangTime:6e3,action:{text:"Undo",show:!0,callback:()=>{Cr.restoreDeck(Tr),$r.setHomeNotification({show:!1}),Cr.setNotif(Tr,null)}}}),posthogCapture("deck_deleted")},navToHomeFromDeck=async Tr=>{var Vr;const{deckId:Cr,newTab:$r=!1,save:Ar}=Tr,Rr=useBlockStore(),Dr=useFolderStore(),Mr=useAppStore(),Br=useUserStore(),Nr=useArtboardStore(),Lr=useMiscStore();Ar&&(console.log("saving"),await Rr.save());const Hr=Mr.appObject(Cr);Dr.sharedFolder.owner_id===""&&Hr.owner_id!==Br.currentUserId&&await Dr.fetchAndHydrateFolderContents(Dr.sharedFolderId);let zr;(Vr=Dr.sharedFolder.deckIds)!=null&&Vr.includes(Hr.id)?(zr=`#${Dr.sharedFolderId}`,Dr.setCurrentFolderId(Dr.sharedFolderId)):Hr.parent_id&&(zr=`#${Hr.parent_id}`,Dr.setCurrentFolderId(Hr.parent_id)),Nr.endActiveSession();const Ur=`/home${zr}`;$r?window.open(Ur,"_blank"):Lr.setRoutePathToOpen(Ur)};class DeckUtil{static createConfig(Cr){const{deckTheme:$r="purple",fontFamily:Ar="default",customLogo:Rr,customLogoName:Dr}=Cr;return{borderRadius:{id:"borderRadius",value:16},deckSpacing:{id:"deckSpacing",value:12},background:{id:"background",selectedId:"neutral 0",value:null},isGenerating:{id:"isGenerating",selectedId:!1,value:null},theme:{id:"theme",selectedId:"light1",value:null},customStyle:{id:"customStyle",value:null},smallText:{id:"smallText",value:!1},deckTheme:{id:"deckTheme",selectedId:$r,value:null},fontFamily:{id:"fontFamily",value:null,selectedId:Ar},customLogo:{id:"customLogo",value:Rr},customDeckLogo:{id:"customDeckLogo",value:null},customLogoName:{id:"customLogoName",value:Dr},version:{id:"version",value:2},infiniteCanvas:{id:"infiniteCanvas",value:isEnabled("infiniteCanvas")}}}}const __vite_glob_0_0$1=""+new URL("gradient-globe-smiling-dark-2.ffe909ef.png",import.meta.url).href,__vite_glob_0_1$1=""+new URL("gradient-globe-smiling-dark-20.b6b895f1.svg",import.meta.url).href,__vite_glob_0_1=""+new URL("gradient-globe-smiling-dark-31.1b83231e.png",import.meta.url).href,__vite_glob_0_2=""+new URL("gradient-globe-smiling-dark.45bde374.png",import.meta.url).href,__vite_glob_0_4$1=""+new URL("gradient-globe-smiling-dark.43088b3a.svg",import.meta.url).href,__vite_glob_0_5$1=""+new URL("gradient-globe-smiling.44be95d9.svg",import.meta.url).href,__vite_glob_0_3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAVCAYAAABG1c6oAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAOKSURBVHgBzVTNixxFFP9VdfXM7MzOzG7cuFmiIVFEAoKgBBQE8Q/IWUQPHjzoQTAH7170kIOiVyHgRfEWc/IoGIhfIAbRVYhZdrMz2WR3vvp7uqrL917PrgcTwVt6qO6uqXrv9/FeNfCgX+p+C++dP99+8twjr632uo+ZZtiF9965apZG6e/Xvtu6fPHKleheceZ+CTfj3XeCHfP+reF1JGlO+YBOu4mTJ9b9n6OtC7Tl4/+TUJ88dealL7/+9i1b2V9sgGnovVYKK63Nm2dffOH5V3D1+j0Tqk/efrW3enz9jM1nD8dJoZ0rMBnnxwej0YW1leWPlFblKI7Wggr+2OrKsMyyY3fj7M3T62sXl5dbsyDooNdtkRt6tL2/vamuXb70aa/bfQMEX1UV6IaK9HkZFXb/uoHJ7R1aVljdeBQbpx+Xd/lpBS1DU5hHEkUfmsmdnSeKaSj18XLnJ79pGhWGw1u4vb0r5TvhgKVOs9bG4JRMzF1caVqcNdFk3C+bDWElKVVd+MN7HEVIi7kwTtMUs9G+LCrZUUMfJi3mbsOMDqaN0Og6nBBZDhagPI/iDJMoEaDmeEp+tVHn8JK0IlsOcxalDc1gcKcMAoWAfNCBrplRMJeUWe/tj3EwS4SVaTSxtHcge3iNgV3l4Mk/nrvKx8Rw/ButPG2CYMFQgwFEFCWdErvDhI2wgZZWRzKZJReSR2kr/v8Pk+TZIDQNyl7VleO96p8jlGUF8nkp79zgcRhKZcU9X0vnn3UeuS1vGme9t7YAOxGSZENDLyR7KabHWr9LTwf2mj2jGFnjZNSAKKwTwAYpM14HyllLCA55UUlQQPK1SAYe6nUQLhgVpUOaF6h7llgRiHN1BcPQSKtROLUvBRSFJXTQJvakrFuC5q2lSlhwWGgMkjgRFUoFNVvaFFJBl7j1+Cxb6xR71jABsqLElDwLFrI73T4+uPQFDBWDAbI0w7uvv0ye5gRqqRAOXfpgNIkdJ4YrYfKy9CzBEzNGbhNSRkWYO4vpcIhev09yGrBkC0sYjUfCNCQCnVYoMVxQR2TYU5PTCzNiT+qO9mjS5kDXID9+/wNa7Q61FHB3OCAlRhKaxWFglmSWtJwrnTdJMd/iplZHx6iuXiVzha8+/wxPnXuOkjv8fPWbuoGpgPzhsIvjKSdfCLgb0m7PnNp4tvJzjX9dIf77Ko/2Gfjsp529X/8GbJIABXBBucsAAAAASUVORK5CYII=",__vite_glob_0_4="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAVCAYAAABG1c6oAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJMSURBVHgBnVS7rlJREJ3D+xU4QKQ0EAmh0vgTxtj4DxY0lpY0NLRaaEVlZSwMf0Bjg8QfIECBJ3R0BMIbnLVzF3efQ+4luZNsZj/mrFmz9mwcUev1ei9isdjbaDQq4XBYaPv9Xubz+Wk4HM4Hg8Hfbrf7T25YBD+JROJ1KBT6pl7U3x9GIlIoFKRUKonruudGo/Gp0+l8eQzQfA1WYLdarWS9XsvhcDDreDwuuVxOqtWq1Ot1RxN+Ho/HH28CwhzHkXw+b0YmkzFJmAigtVrNxGgFX6fT6Qd5rGQCLpdLA0A7n89m4CyVSkk6nZbj8egkk8mOgm7K5fKPBxlCOwwAnE4nM6gj5igfekIWlSSsl/jd87z3DwLCNPuFIcExsAeW2WxWJpOJjEYjUbCogv9U/+aqZGgFALIBAD2AmABx/X5fdrudSb7dbhMqQ7fZbL5rt9u/ry6Fnsy4pgRISBmQDG222WzSs9nsV6vVSl0Y8kNbRwKCCfbIFmBgCLZ6OaJaIvaZzl9q+B9fyXZjMwEvCbdcLBalUqmYPQChnTDwver53AdIw5zs7LIBAMA7RmYPYOhZsNaWC/tKBhu8XZRoA2Mfe2Rpl86ScY75lYY8YKlYExQJsLY7AVpCJsSwSl8fIti+DCSxJeCaCfFyuCZghEDUhK1hg9je3g/GXGm4WCzME6M+FD/oCWKD+gAv9d+VAm3wFwZwjGDT32RIsfFWAW4H8E8iaEFmPkCwARBfQLDMoIbBcxBiu0U0POS5bk/1e4WeAvhTTNvIg/8PzUhNH6HwRs4AAAAASUVORK5CYII=",__vite_glob_0_5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAVCAYAAABG1c6oAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAP3SURBVHgBXVTPTxtHFH6zO7vrtWEhYK/tGpsE12AaGYvSEiJVlWiUVByqcmsVtT21h+bUP4Bj77lUyrV3zpUiKkWFS3EiwSFISVUVmTTE2LFdhyTGa+/sdt6sx+CMPLvP89773vd+7BDor/XvfrreelZ+Ep/NzVRrLw/T700lwes0Wo1OJJ0ec/cOj9ViZkr769nzXu5KOnLmv26OR6KpQib295+P/1389Zef/0AcRQLeWvv8x0SCfnDr5s3b78cjH6+ufvrFRDS58vXt9c+sRGblh6/WFy/nr964tpifv7qw9GWn3ppbKC5/s7m5OX/t+sr3EkcAbm9sXIm0X0SnFHN+zHlpj75pZSfZf7Z+8iRtntUS4Vo5abyuJS3nZDLhd1IjnYq9YI1mtGY5eiObnaanz+2du3eTiEXwcf/OnQe/HR0V0pSSqqJ0J31G26rm6B4ziEodx3V1S9O6dacTShgmO3r7xshalve43jA/smNs+0XF/HY+//vavXtrFAGpqsKH0agzaYZGY+12O0LppTbzPOr7I76iGF6v54d0PWQbRi9MqTFuGu4IUXQjmXhr63r4k6lUU1GC6glAIAQyY2OpSCoFCcOwWk+fwiVCQv2ymCQSAeBBhRO3nWQMeBCImqYwGFeUsHt2dgHQ90EbGRXGzHGAckPW6YDUEQ6EG2Wfg+FWeABAYNcF8BjXqzCo4Uml8oArVgkHDIVC4Hse+nJGBFzuQCkFT5z5nKgK3W4XNF3nOAy6nCkut9e7n5mZCWqI0Ui/Bio3xMVcBirlUTkYgmB8BFf5f51vTB/PODfgvMHo+wlAxiMhO2SAsjjjaQALgOXymAeMsAHrgT0ZmARziAwQUMpCgQxQJsEZOiuqIs7RFjeWAfWok/4KXFiy9RL0ooyMgh75AVsOJkA5a9QZhjGcsoyCMhphXTA1TBl1eOb5HihE4Y3oiuACVAnYVqvV4ZRl2vjWdE04YGRsDJ5RjQZpiV8AommaAGk0GlAqlc4ZilqI+SaDlN5ND7dsGMrNZgOqtRqUy2WoVCow/KVcAJWdk+n3+JwhU4cPvJzDV6ev4OGjR7C3tydscrkcFAqFc0DZOSnjFjPHnWUgHQe5P9z7+/uwu7sLlmXB3NycAIvH48NNkUs2SL7dnivqiEHw7Pj4GHa2dyBmx6BYLEI2m4WJiYnBFIinSlRgPhv6tAY10YKRwJTr9TpsbW3B9OVpWFpagtnZWX5T0cF8nteQy4p/PpKYHrLB7xrTxPQP/zmE0sMSpPiNlM/nIZ1Oi0AdfokIsL47xTug5vsbHCHez1lcVWJ8+O3QOj31Dw4OoMZHY3l5GWzbhnA4LPSy9v13Hd3/B8mO3gscqDPiAAAAAElFTkSuQmCC",__vite_glob_0_6="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAVCAYAAABG1c6oAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAL8SURBVHgBVVW9ihRBEK7q7nX9OU+OOzAxMFARDERMBBET4aJ7AxPxIXwRo3sDH0CMxUBR4dAzFozURBDm9Ga6u8r66Z4dZ7d3pnu6v/rqq59FkOvt0Zf7F9ZnDkJCCJjArwAhyC8RFJ1yW0VdlAfSr3yq/UIep5d3b996Y6dTPHsnrtfPUoyAgsKAsor21SsqHs9Tu1BfE8s7MVgKjIV+yrID5hgEKEJMKwj6DKETAkZn54DyQZ5BWRaJKgS5r1fB1gxQ1iDrSQ6QKBpoaAT1eFH35EElEFXg49cBnh5+azJUeHzvIjx5sLUBXEffqMNcEYuIaIBqV/ABm8v6nsX4SI223PVRNZ0BXSfRA0lYOLseBwVIzfWuYcAGpsMUF5cTbQCzRKpKNKOYCgJKGBbqOwPuypoHZEBs4sp+m9P/DD+dHsH74QOEFMzd/a1HcH1102iSaYhiSL3QOVlAsLFkmeeycLnkCp+nY3j++xD0hAJeTVfgWrxh7KoTsaCoqMxkw90mG2WpYRK6bH6hDXNGE7rSLKZFnBy8yjqys9SUMfBaFwypAaoxZAtEabqC6ombxK5EM0MLMpC5HryeHPCPJGKtbBZFKCOqc2Xza/8hlB/fPcLbl2Dv9Ttj3/VT2hrUvHQ5djbU88LKQEDF0MkANAzunlSTejPVDUts97+Flhp6+ajbc72Si10twmwJWc21OoNgS5sgTFawjDJBy3pwvUx8D4znIc/BUaMB3JgGD9u+FPLsnCWl6Wc5J5vIO4lbkAPYIt9y0PKwdQyyxGaY8oJh7ZvIa7inDWuvM+LcUsdd5CaHJTf43GLQATWHetr0VmjZb9Frxe9VKL2vSkpV1xg2iQ1LQHul6lfvcQqYpXpyzrpkw7qM6i3NlGrRA01HDxDBIrFH3SQAnBl6X8hTgZxG6ZNSMRYUz+5xHKVUR7EytiasHXuCXsxJ++aLYXgFXA528jlr93rt8krOnwpogrKzA/ZHcHkPUj4BzBPshqntrLAdzkA6vzrW2T9ankHpbTsWswAAAABJRU5ErkJggg==",__vite_glob_0_7=""+new URL("prezo.7f4430cd.png",import.meta.url).href,__vite_glob_0_11=""+new URL("prezoAI.4a75d89e.svg",import.meta.url).href,assetUrl=Tr=>`/icons/${Tr}`,images=Object.assign({"/assets/images/gradient-globe-smiling-dark-2.png":__vite_glob_0_0$1,"/assets/images/gradient-globe-smiling-dark-20.svg":__vite_glob_0_1$1,"/assets/images/gradient-globe-smiling-dark-31.png":__vite_glob_0_1,"/assets/images/gradient-globe-smiling-dark.png":__vite_glob_0_2,"/assets/images/gradient-globe-smiling-dark.svg":__vite_glob_0_4$1,"/assets/images/gradient-globe-smiling.svg":__vite_glob_0_5$1,"/assets/images/image-deck-type-about-us.png":__vite_glob_0_3,"/assets/images/image-deck-type-general.png":__vite_glob_0_4,"/assets/images/image-deck-type-marketing.png":__vite_glob_0_5,"/assets/images/image-deck-type-research.png":__vite_glob_0_6,"/assets/images/prezo.png":__vite_glob_0_7,"/assets/images/prezoAI.svg":__vite_glob_0_11}),imageUrl=Tr=>images[Object.keys(images).find(Cr=>Cr.endsWith(Tr))],NUM_FREE_DECKS=5,useAppStore=defineStore("appStore",{state:()=>({data:{},permissions:{},recentDecks:[],searchDecks:[],globalDeckCount:0,lastCreatedDeckId:null,notifs:{},associatedUsers:{},publicPaths:{},hyperlinkedDecks:{}}),getters:{shouldHideGeneralCmdBar(){return Tr=>{const Cr=useUserStore().currentOrgId;return!!(!Cr||ORG_ID_EXCEPTIONS.crisp===Cr||[ORG_ID_EXCEPTIONS.prezo,ORG_ID_EXCEPTIONS.devPrezo].includes(Cr)&&this.isCrispDeck(Tr))}},notif:Tr=>Cr=>Tr.notifs[Cr],pplWithAccessToDeck(){return Tr=>{const Cr={};this.associatedUsers[Tr]&&this.associatedUsers[Tr].forEach(Dr=>{Cr[Dr.id]={name:`${Dr.first_name} ${Dr.last_name}`,email:Dr.email,imgSrc:Dr.avatar_url,userId:Dr.id}}),useUserStore().getAllOrgsUniqueMembers.forEach(({id:Dr,avatar_url:Mr,email:Br,first_name:Nr,last_name:Lr})=>{Cr[Dr]={imgSrc:Mr,email:Br,name:`${Nr} ${Lr}`,userId:Dr}});const Ar=useAppStore().appObject(Tr).owner_id,Rr=[{...Cr[Ar],action:"owner",id:null}];return this.pplAccessForDeck(Tr).forEach(Dr=>{var Mr;Dr.granted_by===Ar&&(Dr.user_id?Rr.push({...Cr[Dr.user_id],action:Dr.action,id:Dr==null?void 0:Dr.id}):Rr.push({name:null,email:(Mr=Dr.metadata)==null?void 0:Mr.inviteEmail,imgSrc:assetUrl("icon-globe-2.svg"),userId:Dr.user_id,action:Dr.action,id:Dr==null?void 0:Dr.id}))}),Rr}},deckThemeKeys:Tr=>Cr=>{var Rr;const $r=Object.keys(theme.state.deckThemeDetails),Ar=((Rr=Tr.data[Cr])==null?void 0:Rr.org_id)??"";return!showCrispDeckTheme(Ar)&&!showEmilFreyDeckTheme(Ar)?$r.filter(Dr=>Dr!=="crisp"&&Dr!=="emilFrey"):showCrispDeckTheme(Ar)?showEmilFreyDeckTheme(Ar)?Object.keys(theme.state.deckThemeDetails):$r.filter(Dr=>Dr!=="emilFrey"):$r.filter(Dr=>Dr!=="crisp")},deckThemeValue(){return Tr=>{if(!Tr)return theme.state.deckThemeDetails.purple.value;const Cr=this.deckTheme(Tr);return theme.state.deckThemeDetails[Cr].value}},deckThemeDetails(){return Tr=>{if(!Tr)return theme.state.deckThemeDetails.purple;const Cr=this.deckTheme(Tr);return theme.state.deckThemeDetails[Cr]}},forPdf:()=>()=>{var Cr;const Tr=useRoute();return((Cr=Tr==null?void 0:Tr.path)==null?void 0:Cr.includes("/pdf/"))??!1},isCrispDeck:Tr=>Cr=>{var $r,Ar;return!!((Ar=($r=Tr.data[Cr])==null?void 0:$r.config)!=null&&Ar.crispMetadata)},createdAt:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.created_at)??null},title:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.title)??""},config:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.config)??{}},appObject:Tr=>Cr=>Tr.data[Cr]??{},permissionsForDeck:Tr=>Cr=>Tr.permissions[Cr]??[],pplAccessForDeck(){return Tr=>this.permissionsForDeck(Tr).filter(Cr=>{var $r;return($r=Cr.metadata)==null?void 0:$r.inviteEmail})},anyoneLinkAccessForDeck(){return Tr=>this.permissionsForDeck(Tr).find(Cr=>{var $r;return($r=Cr.metadata)==null?void 0:$r.linkAccess})},permissionsForUser:Tr=>(Cr,$r)=>{var Ar;return(Ar=(Tr.permissions[Cr]??[]).find(Rr=>Rr.user_id===$r&&Rr.granted_by!==$r))==null?void 0:Ar.action},isPublic:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.is_public)??!1},children:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.children)??[]},parentId:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.parent_id)??null},isWebsiteView:Tr=>Cr=>{var $r,Ar,Rr,Dr;return((Dr=(Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.publishSettings)==null?void 0:Rr.value)==null?void 0:Dr.mode)==="website"},publishSettings:Tr=>Cr=>{var $r,Ar,Rr;return((Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.publishSettings)==null?void 0:Rr.value)??{}},includeAccountLogo:Tr=>Cr=>{var $r,Ar,Rr,Dr,Mr;return((Mr=(Dr=(Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.publishSettings)==null?void 0:Rr.value)==null?void 0:Dr.display)==null?void 0:Mr.includeAccountLogo)??!0},includeAccountName:Tr=>Cr=>{var $r,Ar,Rr,Dr,Mr;return((Mr=(Dr=(Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.publishSettings)==null?void 0:Rr.value)==null?void 0:Dr.display)==null?void 0:Mr.includeAccountName)??!0},visibleChildren:Tr=>Cr=>{var Rr;const $r=(((Rr=Tr.data[Cr])==null?void 0:Rr.children)??[]).filter(Boolean),Ar=usePageStore();return $r.filter(Dr=>Ar.isHidden(Dr)===!1)},allDeckIds:Tr=>Object.keys(Tr.data).filter(Cr=>{var $r;return!(($r=Tr.data[Cr])!=null&&$r.is_deleted)}),allDeckObjects:Tr=>(Cr=!0)=>{const $r=useUserStore();return Cr?Object.values(Tr.data).filter(Ar=>{var Rr,Dr;return((Dr=(Rr=Ar==null?void 0:Ar.config)==null?void 0:Rr.version)==null?void 0:Dr.value)&&!(Ar!=null&&Ar.is_deleted)&&Ar.org_id===$r.currentOrgId}):Object.values(Tr.data).filter(Ar=>{var Rr,Dr;return!((Dr=(Rr=Ar==null?void 0:Ar.config)==null?void 0:Rr.version)!=null&&Dr.value)&&!(Ar!=null&&Ar.is_deleted)&&Ar.org_id===$r.currentOrgId})},totalNumDecks:Tr=>()=>Tr.globalDeckCount,isDeckReady:Tr=>Cr=>{const $r=usePageStore(),Ar=Tr.data[Cr];return Ar?Ar.children.every(Mr=>$r.isPageReady(Mr)):!1},isGenerating:Tr=>Cr=>{var $r,Ar,Rr;return((Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.isGenerating)==null?void 0:Rr.selectedId)??!1},variants:Tr=>Cr=>{var $r,Ar;return((Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.variants)??{type:null,chosenCopyId:null,value:Array(1).fill(null),selectedPageId:null,selectedBlockId:null,err:null,retryVisible:!1}},deckSpacing:Tr=>Cr=>{var $r,Ar,Rr;return((Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.deckSpacing)==null?void 0:Rr.value)??12},smallText:Tr=>Cr=>{var $r,Ar,Rr;return((Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.smallText)==null?void 0:Rr.value)??!1},borderRadius(){return Tr=>{var $r,Ar,Rr;const Cr=this.smallText(Tr);return((Rr=(Ar=($r=this.data[Tr])==null?void 0:$r.config)==null?void 0:Ar.borderRadius)==null?void 0:Rr.value)!==0?Cr?cornerRadius.block.small:cornerRadius.block.default:0}},deckTheme:Tr=>Cr=>{var Ar,Rr,Dr;const $r=((Dr=(Rr=(Ar=Tr.data[Cr])==null?void 0:Ar.config)==null?void 0:Rr.deckTheme)==null?void 0:Dr.selectedId)??"purple";return $r==="light"?"purple":$r},canGenerateDeck:Tr=>Cr=>{var Mr;const $r=((Mr=Tr.data[Cr])==null?void 0:Mr.children)??[];if($r.length>1)return!1;if($r.length===0)return!0;const Ar=$r[0];return usePageStore().children(Ar).length===0},decksForFolder:Tr=>Cr=>Object.values(Tr.data).filter($r=>$r.parent_id===Cr).filter($r=>!$r.is_deleted),getThemeObject:Tr=>(Cr,$r)=>{var Lr,Hr,zr,Ur,Vr;if($r==null)return theme.getThemeObjectForDeckAndSlide({deckTheme:"purple",slideType:"regular"});const Rr=usePageStore().pageObject($r),Dr=Tr.data[Cr];if(Rr==null||Dr==null)return theme.getThemeObjectForDeckAndSlide({deckTheme:"purple",slideType:"regular"});let Mr=((zr=(Hr=(Lr=Tr.data[Cr])==null?void 0:Lr.config)==null?void 0:Hr.deckTheme)==null?void 0:zr.selectedId)??"purple";Mr==="light"&&(Mr="purple");const Nr=((Vr=(Ur=Rr==null?void 0:Rr.config)==null?void 0:Ur.isDividerSlide)==null?void 0:Vr.value)??!1?"divider":"regular";return theme.getThemeObjectForDeckAndSlide({deckTheme:Mr,slideType:Nr})},getDeckFontFamily:Tr=>Cr=>{var $r,Ar,Rr;return((Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.fontFamily)==null?void 0:Rr.selectedId)??"default"},isSharedAsViewOnly(Tr){return Cr=>{var Rr;const $r=useUserStore(),Ar=(Tr.permissions[Cr]??[]).find(Dr=>{var Mr;return((Mr=Dr.metadata)==null?void 0:Mr.inviteEmail)===$r.userEmail&&Dr.granted_by!==$r.currentUserId});return(Ar==null?void 0:Ar.action)==="view"?!0:Ar?!1:((Rr=this.anyoneLinkAccessForDeck(Cr))==null?void 0:Rr.action)==="view"}},getRecentDecks:Tr=>()=>Tr.recentDecks,getSearchDecks:Tr=>()=>Tr.searchDecks,restrictDeckCreation:Tr=>{const Cr=useUserStore();return Cr.isProSubscription(Cr.currentOrgId)?!1:Tr.globalDeckCount>=NUM_FREE_DECKS},isViewOnly(Tr){return Cr=>{const $r=Tr.data[Cr];if(!$r)return!0;const Ar=useUserStore(),Rr=useFolderStore(),Dr=Ar.orgs[$r.org_id||""];return $r.owner_id===Ar.currentUserId||this.permissionsForUser(Cr,Ar.currentUserId)==="edit"||Dr&&Dr.membership!=="guest"&&Rr.accessLevel($r.parent_id)!=="private"?!1:this.isSharedAsViewOnly(Cr)?!0:!(Ar.isProSubscription(Ar.currentOrgId)||Tr.recentDecks.includes(Cr)||Tr.globalDeckCount<=NUM_FREE_DECKS)}},aiSettings:Tr=>Cr=>{var $r,Ar,Rr;return((Rr=(Ar=($r=Tr.data[Cr])==null?void 0:$r.config)==null?void 0:Ar.aiSettings)==null?void 0:Rr.value)??{}}},actions:{addToHyperlinkedDecks(Tr){var Ar,Rr;const Cr=useUserStore(),$r=(Rr=(Ar=Cr.orgs[Cr.currentOrgId??""])==null?void 0:Ar.orgs)==null?void 0:Rr.subdomain;if($r){const Dr=Tr.deck_paths.length?Tr.deck_paths[0].path:`${Tr.title}--${Tr.id}`;this.hyperlinkedDecks[Tr.id]=`https://${$r}.${getPublishedDomain()}/${Dr}`}else this.hyperlinkedDecks[Tr.id]=`${APP_URL()}/public/${Tr.title}--${Tr.id}`},setHyperlinkedDecks(Tr){if(!Tr.length)return;const Cr={},$r=Tr[0].orgs.subdomain;$r?Tr.forEach(Ar=>{const Rr=Ar.deck_paths.length?Ar.deck_paths[0].path:`${Ar.title}--${Ar.id}`;Cr[Ar.id]=`https://${$r}.${getPublishedDomain()}/${Rr}`}):Tr.forEach(Ar=>{Cr[Ar.id]=`${APP_URL()}/public/${Ar.title}--${Ar.id}`}),this.hyperlinkedDecks=Cr},setNotif(Tr,Cr){if(!Cr){delete this.notifs[Tr];return}this.notifs[Tr]=Cr},appendToPermissions(Tr,Cr){Tr in this.permissions?this.permissions[Tr].push(...Cr):this.permissions[Tr]=Cr},updateUserAccess(Tr,Cr,{action:$r,permissionId:Ar,userId:Rr}){if(!(Tr in this.permissions))return;const Dr=this.permissions[Tr].findIndex(Mr=>{var Br;return((Br=Mr.metadata)==null?void 0:Br.inviteEmail)===Cr});if(Dr===-1){if($r==="none")return;log(`ERROR: Couldn't find email ${Cr}'s permissions to update`,this.permissions[Tr]);return}if($r==="none"){this.permissions[Tr].splice(Dr,1);return}$r&&(this.permissions[Tr][Dr].action=$r),Ar&&(this.permissions[Tr][Dr].id=Ar),Rr&&(this.permissions[Tr][Dr].user_id=Rr)},addLinkPermission(Tr,Cr){Tr in this.permissions?this.permissions[Tr].push(Cr):this.permissions[Tr]=[Cr]},updateAnyoneLinkAccess(Tr,{action:Cr,permissionId:$r}){const Ar=this.permissions[Tr].findIndex(Rr=>{var Dr;return(Dr=Rr.metadata)==null?void 0:Dr.linkAccess});if(Ar===-1){if(Cr==="none")return;log("ERROR: Couldn't find anyone-link access to update",this.permissions[Tr]);return}if(Cr==="none"){this.permissions[Tr].splice(Ar,1);return}Cr&&(this.permissions[Tr][Ar].action=Cr),$r&&(this.permissions[Tr][Ar].id=$r)},updateRecentDecks(Tr){this.recentDecks=Tr},addToRecentDecks(Tr){this.recentDecks.push(Tr)},updateDeckCount(Tr){this.globalDeckCount=Tr},async fetchWorkspaceMeta(){const{data:Tr,error:Cr}=await queryWorkspaceFetchMeta({orgId:useUserStore().currentOrgId});if(Cr)return;const{recentDecks:$r,deckCount:Ar}=Tr;this.updateRecentDecks($r??[]),this.updateDeckCount(Ar??0)},async fetchEntireDeckNewOld(Tr){const{data:Cr,error:$r}=await fetchEntireDeckNew(Tr);return{data:Cr,error:$r}},async fetchEntireDeckNew(Tr){const{data:Cr,error:$r}=await fetchDeck({orgId:useUserStore().currentOrgId,deckId:Tr});return{data:Cr,error:$r}},async fetchEntireDecksFromList(Tr){const{data:Cr,error:$r}=await fetchEntireDecksFromList(Tr);return{data:Cr,error:$r}},async fetchBasicDeck(Tr){const{data:Cr,error:$r}=await fetchDecksById([Tr]);return{data:Cr,error:$r}},async fetchEntireSlide(Tr){const{data:Cr,error:$r}=await fetchEntireSlide(Tr);return{data:Cr,error:$r}},async fetchEntireSlidesFromList(Tr){const{data:Cr,error:$r}=await fetchEntireSlidesFromList(Tr);return{data:Cr,error:$r}},async fetchDecksByOwnerId(){const Cr=useUserStore().currentUserId,{data:$r,error:Ar}=await fetchDecksByOwnerId(Cr);return{data:$r,error:Ar}},hydrate(Tr){Tr.forEach(Cr=>{if(lodashExports.isEqual(this.data[Cr.id],Cr)||Cr==null||Cr.id==null)return;const{deck_permissions:$r,associated_users:Ar,...Rr}=Cr;this.data[Cr.id]=Rr,$r&&(this.permissions[Cr.id]=$r),Ar&&(this.associatedUsers[Cr.id]=Ar)})},updateTitle(Tr,Cr){useAppStore().updateProps(Tr,{keyPath:["title"],value:Cr})},async updateProps(Tr,{keyPath:Cr=[],value:$r,autoSave:Ar=!0,skipUndo:Rr=!0}){const Dr=this.data[Tr];if(Dr!=null)try{let Mr=Dr;for(let Lr=0;LrupdateDeck({deckId:Lr,orgId:Hr,update:zr})})}catch(Mr){console.error(`${Mr} keyPath = ${Cr}`)}},async deleteDeck(Tr){this.updateDeckCount(this.globalDeckCount-1),await this.updateProps(Tr,{keyPath:["is_deleted"],value:!0}),await deletePathname({deckId:Tr,orgId:useUserStore().currentOrgId}),await new Promise(Cr=>actionsCache.apiTransactions.once("complete",Cr)),await this.fetchWorkspaceMeta()},async restoreDeck(Tr){this.updateDeckCount(this.globalDeckCount+1),this.recentDecks.push(Tr),await this.updateProps(Tr,{keyPath:["is_deleted"],value:!1}),await new Promise(Cr=>actionsCache.apiTransactions.once("complete",Cr)),await this.fetchWorkspaceMeta()},async deleteMultipleDecks(Tr){this.updateDeckCount(this.globalDeckCount-Tr.length);for(let Cr=0;CractionsCache.apiTransactions.once("complete",Cr)),await this.fetchWorkspaceMeta()},threadSideEffect({deckId:Tr,threadId:Cr}){if(!Cr)return;useChatStore().addThreadIdToDeck(Tr,Cr)},async createThread({deckId:Tr}){const Cr=useUserStore(),$r=guid(),Ar={id:$r,deck_id:Tr,owner_id:Cr.currentUserId},{error:Rr}=await createThread(Ar);return Rr?(console.error(Rr),null):(this.threadSideEffect({deckId:Tr,threadId:$r}),$r)},async createDeck(){const Tr=useFolderStore(),Cr=useUserStore(),$r=useMiscStore(),Ar=usePageStore(),Rr=guid(),Dr=guid(),Mr=Tr.currentFolderId||Tr.privateSystemFolderId,Br={id:guid(),owner_id:Cr.currentUserId,org_id:Cr.currentOrgId,parent_id:Mr,title:`New ${WORD_MAP.deck.upper}`,is_deleted:!1,is_public:!1,children:[Dr],config:DeckUtil.createConfig({deckTheme:$r.lastUsedDeckTheme??"purple",fontFamily:$r.lastUsedDeckFontFamily??"default",customLogoName:Cr.userFullName}),created_at:new Date().toISOString(),updated_at:new Date().toISOString()},Nr=Ar.newSlideData({id:Dr,deckId:Br.id,userId:Cr.currentUserId});return this.data[Br.id]=Br,this.lastCreatedDeckId=Br.id,Ar.hydrate([Nr]),this.updateDeckCount(this.globalDeckCount+1),this.addToRecentDecks(Br.id),this.threadSideEffect({deckId:Br.id,threadId:Rr}),await actionsCache.defer({action:"addDeck",data:{id:Br.id,folderId:Mr,deck:Br,slide:Nr,threadId:Rr},query:({deck:Lr,slide:Hr,threadId:zr})=>createDeck({deck:Lr,slide:Hr,threadId:zr})}),Br.id},handleDeckHydration(Tr){const Cr=useBlockStore(),$r=usePageStore(),Ar=useAppStore(),{slides:Rr,recentDecks:Dr,...Mr}=Tr;return Rr==null?!1:(Rr.forEach(({blocks:Br,...Nr})=>{Cr.hydrate(Br),$r.hydrate([Nr])}),Ar.hydrate([Mr]),!0)},async duplicateDeck(Tr){const Cr=useUserStore(),$r=usePageStore(),Ar=useBlockStore(),Rr=useMiscStore();Rr.setHomeNotification({noti:{type:"info",text:`Duplicating ${WORD_MAP.deck.upper}...`,hangTime:6e4,showInProgress:!0},show:!0}),this.setNotif(Tr,{text:`Duplicating ${WORD_MAP.deck.upper}...`,showEmoji:!1,persistent:!1,isProminent:!1,showInProgress:!0,showTag:!1,type:"info",hangTime:6e4});const{data:Dr,error:Mr}=await duplicateDeck({deckId:Tr,orgId:Cr.currentOrgId});if(!Dr||Mr)return console.error(Mr),Rr.setHomeNotification({noti:{type:"error",text:`Error duplicating ${WORD_MAP.deck.upper}`,hangTime:4e3,showInProgress:!1},show:!0}),this.setNotif(Tr,{text:`Error duplicating ${WORD_MAP.deck.upper}`,showEmoji:!1,persistent:!1,isProminent:!1,showInProgress:!1,showTag:!1,type:"error",hangTime:4e3}),publishLog({event:"edge-function-tracking",channel:"custom-debugging",description:`query-duplicate-deck failed for deck ${Tr}, user: ${Cr.currentUserId}, ${Mr}`,notify:!1}),setTimeout(()=>{this.setNotif(Tr,null),Rr.setHomeNotification({show:!1})},4e3),null;const{deck:Br,slides:Nr,blocks:Lr,threadId:Hr}=Dr;return this.hydrate([Br]),$r.hydrate(Nr),Ar.hydrate(Lr),this.threadSideEffect({deckId:Br.id,threadId:Hr}),this.updateDeckCount(this.globalDeckCount+1),this.addToRecentDecks(Br.id),Rr.setHomeNotification({noti:{type:"info",text:`${WORD_MAP.deck.upper} duplicated`,hangTime:4e3,showInProgress:!1},show:!0}),this.setNotif(Tr,{text:`${WORD_MAP.deck.upper} duplicated`,showEmoji:!1,persistent:!1,isProminent:!1,showInProgress:!1,showTag:!1,type:"info",hangTime:6e3,action:{text:"Open",show:!0,callback:zr=>{handleDeckClick(zr,Br.id),this.setNotif(Br.id,null),Rr.setHomeNotification({show:!1})}}}),setTimeout(()=>{this.setNotif(Tr,null),Rr.setHomeNotification({show:!1})},4e3),Br.id},async updateDeckSpacing({appId:Tr,spacing:Cr}){const $r=this.data[Tr];if($r==null)return;$r.config.deckSpacing={id:"deckSpacing",value:Cr};const Ar=useUserStore();await actionsCache.defer({action:"updateDeck",data:{id:$r.id,orgId:Ar.currentOrgId,update:{config:lodashExports.cloneDeep($r.config)}},query:({id:Rr,orgId:Dr,update:Mr})=>updateDeck({deckId:Rr,orgId:Dr,update:Mr})})},cleanString(Tr){return Tr=Tr.replace(/\s+/g," "),Tr=Tr.replace(/\s/g,"-"),Tr=Tr.replace(/[^0-9a-zA-Z-]/g,""),Tr},getStoryURL({appId:Tr}){if(this.data[Tr]==null)return"https://app.prezo.ai";const{title:Cr}=this.data[Tr],$r=this.cleanString(Cr);return $r==null||$r===""?`${STORYTIME_URL}/${Tr}`:`${STORYTIME_URL}/${$r}--${Tr}`},getPublicURL({appId:Tr}){if(this.data[Tr]==null)return"https://app.prezo.ai";const{title:Cr}=this.data[Tr],$r=this.cleanString(Cr);return $r==null||$r===""?`${window.location.origin}/public/${Tr}`:`${window.location.origin}/public/${$r}--${Tr}`},async fetchHomepage(){const Tr=useUserStore(),Cr=useFolderStore();performance.now();const{data:$r,error:Ar}=await queryFetchHomePage({userId:Tr.currentUserId,orgId:Tr.currentOrgId});if(performance.now(),!Ar){const{root:Rr}=$r,{rootFolders:Dr}=Rr;Cr.hydrate(Dr),Dr.forEach(Mr=>Cr.hydrate(Mr.folders)),this.fetchSearchDecks()}return{error:Ar}},async fetchSearchDecks(){const Tr=useUserStore(),{data:Cr,error:$r}=await queryResourceSearchDecks({orgId:Tr.currentOrgId??""});if($r||!Cr)return;const{searchDecks:Ar}=Cr;this.setSearchDecks(Ar)},async handleOrgChange({newOrgId:Tr,fetchHomepage:Cr=!0}){const $r=useUserStore(),Ar=useFolderStore();if($r.currentOrgId===Tr)return{error:null};if($r.updateCurrentOrgId(Tr),Ar.wipeFolderState(),this.fetchWorkspaceMeta(),!Cr)return{error:null};const{error:Dr}=await this.fetchHomepage();return{error:Dr}},setSearchDecks(Tr){this.searchDecks=Tr}}}),appStore=Object.freeze(Object.defineProperty({__proto__:null,NUM_FREE_DECKS,useAppStore},Symbol.toStringTag,{value:"Module"})),getSubdomain=()=>{const Tr=useRequestURL(),Cr=useRequestHeaders();let $r="";return Tr.hostname.includes("prezo.site")?$r=Tr.hostname.split(".")[0]:Cr.subdomain&&($r=Cr.subdomain),$r},updateMeta=({title:Tr,description:Cr,imgUrl:$r,imgType:Ar="image/jpeg"})=>{},extractDataFromResult=Tr=>Tr==null?void 0:Tr.data,handlePublicDeck=async({deckId:Tr,imgUrlToUse:Cr})=>{var Ur;const $r=useAppStore(),Ar=usePageStore(),Rr=useBlockStore();useUserStore();const[Dr,Mr]=await Promise.all([fetchPublicDeck({deckId:Tr,cryptic:!1}),createDeckPreview({deckId:Tr,passive:!0})]),Br=extractDataFromResult(Dr);if(!Br||Br.length===0)return null;const[Nr]=Br;if(!Nr)return null;const{slides:Lr,...Hr}=Nr;if(!Lr)return null;Lr.forEach(({blocks:Vr,...jr})=>{Rr.hydrate(Vr),Ar.hydrate([jr])}),$r.hydrate([Hr]);const zr=(Ur=Mr==null?void 0:Mr.data)==null?void 0:Ur.url;return zr&&(Cr.value=zr),Br},usePublicViewSetup=({data:Tr,imgUrlToUse:Cr})=>{const $r=computed(()=>{var Lr,Hr;const Br=(Tr.value??[])[0];return Br?(Hr=(Lr=Br==null?void 0:Br.config)==null?void 0:Lr.customDeckLogo)==null?void 0:Hr.value:null});computed(()=>$r.value?$r.value.startsWith("http"):!1);const Ar=computed(()=>$r.value&&allEmojis[$r.value]||""),Rr=computed(()=>{var Br;return((Br=(Tr.value??[])[0])==null?void 0:Br.title)??null});computed(()=>!$r.value||Ar.value?{href:"/logo.png",type:"image/png"}:{href:$r.value,type:"image/jpg"});const Dr=()=>{var Br,Nr,Lr,Hr;updateMeta({title:`${((Br=(Tr.value??[])[0])==null?void 0:Br.title)??""} | Built with Prezo`,description:`${((Hr=(Lr=(Nr=(Tr.value??[])[0])==null?void 0:Nr.config)==null?void 0:Lr.customLogoName)==null?void 0:Hr.value)??""} on Prezo`,imgUrl:Cr.value})},Mr=()=>{useHead(()=>({htmlAttrs:{lang:"en"}}))};return onMounted(()=>{Rr.value&&useHead({titleTemplate:()=>Rr.value})}),{updateHeaderAfterFetch:Mr,updateMetaAfterFetch:Dr}},useMarketingSetup=()=>{useHead(()=>({htmlAttrs:{lang:"en"},title:"Create presentations, docs & websites with AI | Prezo",link:[{hid:"favicon",rel:"icon",type:"image/jpg",href:"/logo.png"}]}))},auth_45global=async(Tr,Cr)=>{let $r,Ar;const{data:Rr,error:Dr}=([$r,Ar]=executeAsync(()=>getSession()),$r=await $r,Ar(),$r),Mr=(Rr==null?void 0:Rr.session)!=null;useUserStore().setLoggedIn(Mr);const Lr=getSubdomain()==="";if(Tr.path.startsWith("/decks/public/")){const Hr=Tr.path.replace("/decks/public/","/public/");return navigateTo(Hr)}if(Tr.path.startsWith("/decks/")){const Hr=Tr.path.replace("/decks/",PATH_FOR_ARTBOARD);return navigateTo(Hr)}if(Lr){if(Tr.path==="/login"&&Mr||Tr.path==="/signup"&&Mr||Tr.fullPath==="/oauth"&&Mr)return navigateTo("/home");if(Tr.path==="/home"&&!Mr)return navigateTo("/login");if(Tr.path==="/"&&Mr)return navigateTo("/home");if(Tr.path.startsWith("/home/decks"))return navigateTo(Mr?"/home":"/login")}},globalMiddleware=[validate,auth_45global],namedMiddleware={};function createCurrentLocation(Tr,Cr,$r){const{pathname:Ar,search:Rr,hash:Dr}=Cr,Mr=Tr.indexOf("#");if(Mr>-1){const Lr=Dr.includes(Tr.slice(Mr))?Tr.slice(Mr).length:1;let Hr=Dr.slice(Lr);return Hr[0]!=="/"&&(Hr="/"+Hr),withoutBase(Hr,"")}const Br=withoutBase(Ar,Tr),Nr=!$r||isEqual(Br,$r,{trailingSlash:!0})?Br:$r;return Nr+(Nr.includes("?")?"":Rr)+Dr}const plugin$1=defineNuxtPlugin({name:"nuxt:router",enforce:"pre",async setup(Tr){var Gr,Xr;let Cr,$r,Ar=useRuntimeConfig().app.baseURL;routerOptions.hashMode&&!Ar.includes("#")&&(Ar+="#");const Rr=((Gr=routerOptions.history)==null?void 0:Gr.call(routerOptions,Ar))??(routerOptions.hashMode?createWebHashHistory(Ar):createWebHistory(Ar)),Dr=((Xr=routerOptions.routes)==null?void 0:Xr.call(routerOptions,_routes))??_routes;let Mr;const Br=createCurrentLocation(Ar,window.location,Tr.payload.path),Nr=createRouter({...routerOptions,scrollBehavior:(Kr,Zr,eo)=>{var Wr;if(Zr===START_LOCATION_NORMALIZED){Mr=eo;return}return Nr.options.scrollBehavior=routerOptions.scrollBehavior,(Wr=routerOptions.scrollBehavior)==null?void 0:Wr.call(routerOptions,Kr,START_LOCATION_NORMALIZED,Mr||eo)},history:Rr,routes:Dr});Tr.vueApp.use(Nr);const Lr=shallowRef(Nr.currentRoute.value);Nr.afterEach((Kr,Zr)=>{Lr.value=Zr}),Object.defineProperty(Tr.vueApp.config.globalProperties,"previousRoute",{get:()=>Lr.value});const Hr=shallowRef(Nr.resolve(Br)),zr=()=>{Hr.value=Nr.currentRoute.value};Tr.hook("page:finish",zr),Nr.afterEach((Kr,Zr)=>{var eo,Wr,Yr,Jr;((Wr=(eo=Kr.matched[0])==null?void 0:eo.components)==null?void 0:Wr.default)===((Jr=(Yr=Zr.matched[0])==null?void 0:Yr.components)==null?void 0:Jr.default)&&zr()});const Ur={};for(const Kr in Hr.value)Object.defineProperty(Ur,Kr,{get:()=>Hr.value[Kr]});Tr._route=shallowReactive(Ur),Tr._middleware=Tr._middleware||{global:[],named:{}};const Vr=useError();try{[Cr,$r]=executeAsync(()=>Nr.isReady()),await Cr,$r()}catch(Kr){[Cr,$r]=executeAsync(()=>Tr.runWithContext(()=>showError(Kr))),await Cr,$r()}const jr=Tr.payload.state._layout;return Nr.beforeEach(async(Kr,Zr)=>{var eo;Kr.meta=reactive(Kr.meta),Tr.isHydrating&&jr&&!isReadonly(Kr.meta.layout)&&(Kr.meta.layout=jr),Tr._processingMiddleware=!0;{const Wr=new Set([...globalMiddleware,...Tr._middleware.global]);for(const Yr of Kr.matched){const Jr=Yr.meta.middleware;if(Jr)if(Array.isArray(Jr))for(const no of Jr)Wr.add(no);else Wr.add(Jr)}for(const Yr of Wr){const Jr=typeof Yr=="string"?Tr._middleware.named[Yr]||await((eo=namedMiddleware[Yr])==null?void 0:eo.call(namedMiddleware).then(ro=>ro.default||ro)):Yr;if(!Jr)throw new Error(`Unknown route middleware: '${Yr}'.`);const no=await Tr.runWithContext(()=>Jr(Kr,Zr));if(!Tr.payload.serverRendered&&Tr.isHydrating&&(no===!1||no instanceof Error)){const ro=no||createError$1({statusCode:404,statusMessage:`Page Not Found: ${Br}`});return await Tr.runWithContext(()=>showError(ro)),!1}if(no!==!0&&(no||no===!1))return no}}}),Nr.onError(()=>{delete Tr._processingMiddleware}),Nr.afterEach(async(Kr,Zr,eo)=>{delete Tr._processingMiddleware,!Tr.isHydrating&&Vr.value&&await Tr.runWithContext(clearError),Kr.matched.length===0&&await Tr.runWithContext(()=>showError(createError$1({statusCode:404,fatal:!1,statusMessage:`Page not found: ${Kr.fullPath}`})))}),Tr.hooks.hookOnce("app:created",async()=>{try{await Nr.replace({...Nr.resolve(Br),name:void 0,force:!0}),Nr.options.scrollBehavior=routerOptions.scrollBehavior}catch(Kr){await Tr.runWithContext(()=>showError(Kr))}}),{provide:{router:Nr}}}}),payload_client_BepdcSrOvP=defineNuxtPlugin({name:"nuxt:payload",setup(Tr){useRouter$1().beforeResolve(async(Cr,$r)=>{if(Cr.path===$r.path)return;const Ar=await loadPayload(Cr.path);Ar&&Object.assign(Tr.static.data,Ar.data)}),onNuxtReady(()=>{Tr.hooks.hook("link:prefetch",async Cr=>{parseURL$1(Cr).protocol||await loadPayload(Cr)})})}}),plugin=defineNuxtPlugin(Tr=>{const Cr=createPinia();return Tr.vueApp.use(Cr),setActivePinia(Cr),Tr.payload&&Tr.payload.pinia&&(Cr.state.value=Tr.payload.pinia),{provide:{pinia:Cr}}}),components_plugin_KR1HBZs4kY=defineNuxtPlugin({name:"nuxt:global-components"}),layouts={},prefetch_client_HWMLMRgvmh=defineNuxtPlugin({name:"nuxt:prefetch",setup(Tr){const Cr=useRouter$1();Tr.hooks.hook("app:mounted",()=>{Cr.beforeEach(async $r=>{var Rr;const Ar=(Rr=$r==null?void 0:$r.meta)==null?void 0:Rr.layout;Ar&&typeof layouts[Ar]=="function"&&await layouts[Ar]()})}),Tr.hooks.hook("link:prefetch",$r=>{var Mr,Br,Nr,Lr;if(hasProtocol($r))return;const Ar=Cr.resolve($r);if(!Ar)return;const Rr=(Mr=Ar==null?void 0:Ar.meta)==null?void 0:Mr.layout;let Dr=Array.isArray((Br=Ar==null?void 0:Ar.meta)==null?void 0:Br.middleware)?(Nr=Ar==null?void 0:Ar.meta)==null?void 0:Nr.middleware:[(Lr=Ar==null?void 0:Ar.meta)==null?void 0:Lr.middleware];Dr=Dr.filter(Hr=>typeof Hr=="string");for(const Hr of Dr)typeof namedMiddleware[Hr]=="function"&&namedMiddleware[Hr]();Rr&&typeof layouts[Rr]=="function"&&layouts[Rr]()})}}),sides=["top","right","bottom","left"],alignments=["start","end"],placements=sides.reduce((Tr,Cr)=>Tr.concat(Cr,Cr+"-"+alignments[0],Cr+"-"+alignments[1]),[]),min=Math.min,max=Math.max,oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$2(Tr,Cr,$r){return max(Tr,min(Cr,$r))}function evaluate(Tr,Cr){return typeof Tr=="function"?Tr(Cr):Tr}function getSide$1(Tr){return Tr.split("-")[0]}function getAlignment(Tr){return Tr.split("-")[1]}function getOppositeAxis(Tr){return Tr==="x"?"y":"x"}function getAxisLength(Tr){return Tr==="y"?"height":"width"}function getSideAxis(Tr){return["top","bottom"].includes(getSide$1(Tr))?"y":"x"}function getAlignmentAxis(Tr){return getOppositeAxis(getSideAxis(Tr))}function getAlignmentSides(Tr,Cr,$r){$r===void 0&&($r=!1);const Ar=getAlignment(Tr),Rr=getAlignmentAxis(Tr),Dr=getAxisLength(Rr);let Mr=Rr==="x"?Ar===($r?"end":"start")?"right":"left":Ar==="start"?"bottom":"top";return Cr.reference[Dr]>Cr.floating[Dr]&&(Mr=getOppositePlacement(Mr)),[Mr,getOppositePlacement(Mr)]}function getExpandedPlacements(Tr){const Cr=getOppositePlacement(Tr);return[getOppositeAlignmentPlacement(Tr),Cr,getOppositeAlignmentPlacement(Cr)]}function getOppositeAlignmentPlacement(Tr){return Tr.replace(/start|end/g,Cr=>oppositeAlignmentMap[Cr])}function getSideList(Tr,Cr,$r){const Ar=["left","right"],Rr=["right","left"],Dr=["top","bottom"],Mr=["bottom","top"];switch(Tr){case"top":case"bottom":return $r?Cr?Rr:Ar:Cr?Ar:Rr;case"left":case"right":return Cr?Dr:Mr;default:return[]}}function getOppositeAxisPlacements(Tr,Cr,$r,Ar){const Rr=getAlignment(Tr);let Dr=getSideList(getSide$1(Tr),$r==="start",Ar);return Rr&&(Dr=Dr.map(Mr=>Mr+"-"+Rr),Cr&&(Dr=Dr.concat(Dr.map(getOppositeAlignmentPlacement)))),Dr}function getOppositePlacement(Tr){return Tr.replace(/left|right|bottom|top/g,Cr=>oppositeSideMap[Cr])}function expandPaddingObject(Tr){return{top:0,right:0,bottom:0,left:0,...Tr}}function getPaddingObject(Tr){return typeof Tr!="number"?expandPaddingObject(Tr):{top:Tr,right:Tr,bottom:Tr,left:Tr}}function rectToClientRect(Tr){return{...Tr,top:Tr.y,left:Tr.x,right:Tr.x+Tr.width,bottom:Tr.y+Tr.height}}function computeCoordsFromPlacement(Tr,Cr,$r){let{reference:Ar,floating:Rr}=Tr;const Dr=getSideAxis(Cr),Mr=getAlignmentAxis(Cr),Br=getAxisLength(Mr),Nr=getSide$1(Cr),Lr=Dr==="y",Hr=Ar.x+Ar.width/2-Rr.width/2,zr=Ar.y+Ar.height/2-Rr.height/2,Ur=Ar[Br]/2-Rr[Br]/2;let Vr;switch(Nr){case"top":Vr={x:Hr,y:Ar.y-Rr.height};break;case"bottom":Vr={x:Hr,y:Ar.y+Ar.height};break;case"right":Vr={x:Ar.x+Ar.width,y:zr};break;case"left":Vr={x:Ar.x-Rr.width,y:zr};break;default:Vr={x:Ar.x,y:Ar.y}}switch(getAlignment(Cr)){case"start":Vr[Mr]-=Ur*($r&&Lr?-1:1);break;case"end":Vr[Mr]+=Ur*($r&&Lr?-1:1);break}return Vr}const computePosition=async(Tr,Cr,$r)=>{const{placement:Ar="bottom",strategy:Rr="absolute",middleware:Dr=[],platform:Mr}=$r,Br=Dr.filter(Boolean),Nr=await(Mr.isRTL==null?void 0:Mr.isRTL(Cr));let Lr=await Mr.getElementRects({reference:Tr,floating:Cr,strategy:Rr}),{x:Hr,y:zr}=computeCoordsFromPlacement(Lr,Ar,Nr),Ur=Ar,Vr={},jr=0;for(let Gr=0;Gr({name:"arrow",options:Tr,async fn(Cr){const{x:$r,y:Ar,placement:Rr,rects:Dr,platform:Mr,elements:Br,middlewareData:Nr}=Cr,{element:Lr,padding:Hr=0}=evaluate(Tr,Cr)||{};if(Lr==null)return{};const zr=getPaddingObject(Hr),Ur={x:$r,y:Ar},Vr=getAlignmentAxis(Rr),jr=getAxisLength(Vr),Gr=await Mr.getDimensions(Lr),Xr=Vr==="y",Kr=Xr?"top":"left",Zr=Xr?"bottom":"right",eo=Xr?"clientHeight":"clientWidth",Wr=Dr.reference[jr]+Dr.reference[Vr]-Ur[Vr]-Dr.floating[jr],Yr=Ur[Vr]-Dr.reference[Vr],Jr=await(Mr.getOffsetParent==null?void 0:Mr.getOffsetParent(Lr));let no=Jr?Jr[eo]:0;(!no||!await(Mr.isElement==null?void 0:Mr.isElement(Jr)))&&(no=Br.floating[eo]||Dr.floating[jr]);const ro=Wr/2-Yr/2,so=no/2-Gr[jr]/2-1,ao=min(zr[Kr],so),lo=min(zr[Zr],so),po=ao,go=no-Gr[jr]-lo,co=no/2-Gr[jr]/2+ro,mo=clamp$2(po,co,go),io=!Nr.arrow&&getAlignment(Rr)!=null&&co!=mo&&Dr.reference[jr]/2-(cogetAlignment(Rr)===Tr),...$r.filter(Rr=>getAlignment(Rr)!==Tr)]:$r.filter(Rr=>getSide$1(Rr)===Rr)).filter(Rr=>Tr?getAlignment(Rr)===Tr||(Cr?getOppositeAlignmentPlacement(Rr)!==Rr:!1):!0)}const autoPlacement=function(Tr){return Tr===void 0&&(Tr={}),{name:"autoPlacement",options:Tr,async fn(Cr){var $r,Ar,Rr;const{rects:Dr,middlewareData:Mr,placement:Br,platform:Nr,elements:Lr}=Cr,{crossAxis:Hr=!1,alignment:zr,allowedPlacements:Ur=placements,autoAlignment:Vr=!0,...jr}=evaluate(Tr,Cr),Gr=zr!==void 0||Ur===placements?getPlacementList(zr||null,Vr,Ur):Ur,Xr=await detectOverflow(Cr,jr),Kr=(($r=Mr.autoPlacement)==null?void 0:$r.index)||0,Zr=Gr[Kr];if(Zr==null)return{};const eo=getAlignmentSides(Zr,Dr,await(Nr.isRTL==null?void 0:Nr.isRTL(Lr.floating)));if(Br!==Zr)return{reset:{placement:Gr[0]}};const Wr=[Xr[getSide$1(Zr)],Xr[eo[0]],Xr[eo[1]]],Yr=[...((Ar=Mr.autoPlacement)==null?void 0:Ar.overflows)||[],{placement:Zr,overflows:Wr}],Jr=Gr[Kr+1];if(Jr)return{data:{index:Kr+1,overflows:Yr},reset:{placement:Jr}};const no=Yr.map(ao=>{const lo=getAlignment(ao.placement);return[ao.placement,lo&&Hr?ao.overflows.slice(0,2).reduce((po,go)=>po+go,0):ao.overflows[0],ao.overflows]}).sort((ao,lo)=>ao[1]-lo[1]),so=((Rr=no.filter(ao=>ao[2].slice(0,getAlignment(ao[0])?2:3).every(lo=>lo<=0))[0])==null?void 0:Rr[0])||no[0][0];return so!==Br?{data:{index:Kr+1,overflows:Yr},reset:{placement:so}}:{}}}},flip=function(Tr){return Tr===void 0&&(Tr={}),{name:"flip",options:Tr,async fn(Cr){var $r,Ar;const{placement:Rr,middlewareData:Dr,rects:Mr,initialPlacement:Br,platform:Nr,elements:Lr}=Cr,{mainAxis:Hr=!0,crossAxis:zr=!0,fallbackPlacements:Ur,fallbackStrategy:Vr="bestFit",fallbackAxisSideDirection:jr="none",flipAlignment:Gr=!0,...Xr}=evaluate(Tr,Cr);if(($r=Dr.arrow)!=null&&$r.alignmentOffset)return{};const Kr=getSide$1(Rr),Zr=getSide$1(Br)===Br,eo=await(Nr.isRTL==null?void 0:Nr.isRTL(Lr.floating)),Wr=Ur||(Zr||!Gr?[getOppositePlacement(Br)]:getExpandedPlacements(Br));!Ur&&jr!=="none"&&Wr.push(...getOppositeAxisPlacements(Br,Gr,jr,eo));const Yr=[Br,...Wr],Jr=await detectOverflow(Cr,Xr),no=[];let ro=((Ar=Dr.flip)==null?void 0:Ar.overflows)||[];if(Hr&&no.push(Jr[Kr]),zr){const po=getAlignmentSides(Rr,Mr,eo);no.push(Jr[po[0]],Jr[po[1]])}if(ro=[...ro,{placement:Rr,overflows:no}],!no.every(po=>po<=0)){var so,ao;const po=(((so=Dr.flip)==null?void 0:so.index)||0)+1,go=Yr[po];if(go)return{data:{index:po,overflows:ro},reset:{placement:go}};let co=(ao=ro.filter(mo=>mo.overflows[0]<=0).sort((mo,io)=>mo.overflows[1]-io.overflows[1])[0])==null?void 0:ao.placement;if(!co)switch(Vr){case"bestFit":{var lo;const mo=(lo=ro.map(io=>[io.placement,io.overflows.filter(uo=>uo>0).reduce((uo,ho)=>uo+ho,0)]).sort((io,uo)=>io[1]-uo[1])[0])==null?void 0:lo[0];mo&&(co=mo);break}case"initialPlacement":co=Br;break}if(Rr!==co)return{reset:{placement:co}}}return{}}}};async function convertValueToCoords(Tr,Cr){const{placement:$r,platform:Ar,elements:Rr}=Tr,Dr=await(Ar.isRTL==null?void 0:Ar.isRTL(Rr.floating)),Mr=getSide$1($r),Br=getAlignment($r),Nr=getSideAxis($r)==="y",Lr=["left","top"].includes(Mr)?-1:1,Hr=Dr&&Nr?-1:1,zr=evaluate(Cr,Tr);let{mainAxis:Ur,crossAxis:Vr,alignmentAxis:jr}=typeof zr=="number"?{mainAxis:zr,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...zr};return Br&&typeof jr=="number"&&(Vr=Br==="end"?jr*-1:jr),Nr?{x:Vr*Hr,y:Ur*Lr}:{x:Ur*Lr,y:Vr*Hr}}const offset=function(Tr){return Tr===void 0&&(Tr=0),{name:"offset",options:Tr,async fn(Cr){var $r,Ar;const{x:Rr,y:Dr,placement:Mr,middlewareData:Br}=Cr,Nr=await convertValueToCoords(Cr,Tr);return Mr===(($r=Br.offset)==null?void 0:$r.placement)&&(Ar=Br.arrow)!=null&&Ar.alignmentOffset?{}:{x:Rr+Nr.x,y:Dr+Nr.y,data:{...Nr,placement:Mr}}}}},shift$1=function(Tr){return Tr===void 0&&(Tr={}),{name:"shift",options:Tr,async fn(Cr){const{x:$r,y:Ar,placement:Rr}=Cr,{mainAxis:Dr=!0,crossAxis:Mr=!1,limiter:Br={fn:Xr=>{let{x:Kr,y:Zr}=Xr;return{x:Kr,y:Zr}}},...Nr}=evaluate(Tr,Cr),Lr={x:$r,y:Ar},Hr=await detectOverflow(Cr,Nr),zr=getSideAxis(getSide$1(Rr)),Ur=getOppositeAxis(zr);let Vr=Lr[Ur],jr=Lr[zr];if(Dr){const Xr=Ur==="y"?"top":"left",Kr=Ur==="y"?"bottom":"right",Zr=Vr+Hr[Xr],eo=Vr-Hr[Kr];Vr=clamp$2(Zr,Vr,eo)}if(Mr){const Xr=zr==="y"?"top":"left",Kr=zr==="y"?"bottom":"right",Zr=jr+Hr[Xr],eo=jr-Hr[Kr];jr=clamp$2(Zr,jr,eo)}const Gr=Br.fn({...Cr,[Ur]:Vr,[zr]:jr});return{...Gr,data:{x:Gr.x-$r,y:Gr.y-Ar}}}}},size=function(Tr){return Tr===void 0&&(Tr={}),{name:"size",options:Tr,async fn(Cr){const{placement:$r,rects:Ar,platform:Rr,elements:Dr}=Cr,{apply:Mr=()=>{},...Br}=evaluate(Tr,Cr),Nr=await detectOverflow(Cr,Br),Lr=getSide$1($r),Hr=getAlignment($r),zr=getSideAxis($r)==="y",{width:Ur,height:Vr}=Ar.floating;let jr,Gr;Lr==="top"||Lr==="bottom"?(jr=Lr,Gr=Hr===(await(Rr.isRTL==null?void 0:Rr.isRTL(Dr.floating))?"start":"end")?"left":"right"):(Gr=Lr,jr=Hr==="end"?"top":"bottom");const Xr=Vr-Nr[jr],Kr=Ur-Nr[Gr],Zr=!Cr.middlewareData.shift;let eo=Xr,Wr=Kr;if(zr){const Jr=Ur-Nr.left-Nr.right;Wr=Hr||Zr?min(Kr,Jr):Jr}else{const Jr=Vr-Nr.top-Nr.bottom;eo=Hr||Zr?min(Xr,Jr):Jr}if(Zr&&!Hr){const Jr=max(Nr.left,0),no=max(Nr.right,0),ro=max(Nr.top,0),so=max(Nr.bottom,0);zr?Wr=Ur-2*(Jr!==0||no!==0?Jr+no:max(Nr.left,Nr.right)):eo=Vr-2*(ro!==0||so!==0?ro+so:max(Nr.top,Nr.bottom))}await Mr({...Cr,availableWidth:Wr,availableHeight:eo});const Yr=await Rr.getDimensions(Dr.floating);return Ur!==Yr.width||Vr!==Yr.height?{reset:{rects:!0}}:{}}}};function n$6(Tr){var Cr;return((Cr=Tr.ownerDocument)==null?void 0:Cr.defaultView)||window}function o$3(Tr){return n$6(Tr).getComputedStyle(Tr)}const i$5=Math.min,r$4=Math.max,l$4=Math.round;function c$4(Tr){const Cr=o$3(Tr);let $r=parseFloat(Cr.width),Ar=parseFloat(Cr.height);const Rr=Tr.offsetWidth,Dr=Tr.offsetHeight,Mr=l$4($r)!==Rr||l$4(Ar)!==Dr;return Mr&&($r=Rr,Ar=Dr),{width:$r,height:Ar,fallback:Mr}}function s$2(Tr){return h$1(Tr)?(Tr.nodeName||"").toLowerCase():""}let f$5;function u$7(){if(f$5)return f$5;const Tr=navigator.userAgentData;return Tr&&Array.isArray(Tr.brands)?(f$5=Tr.brands.map(Cr=>Cr.brand+"/"+Cr.version).join(" "),f$5):navigator.userAgent}function a$5(Tr){return Tr instanceof n$6(Tr).HTMLElement}function d$6(Tr){return Tr instanceof n$6(Tr).Element}function h$1(Tr){return Tr instanceof n$6(Tr).Node}function p$5(Tr){return typeof ShadowRoot>"u"?!1:Tr instanceof n$6(Tr).ShadowRoot||Tr instanceof ShadowRoot}function g$4(Tr){const{overflow:Cr,overflowX:$r,overflowY:Ar,display:Rr}=o$3(Tr);return/auto|scroll|overlay|hidden|clip/.test(Cr+Ar+$r)&&!["inline","contents"].includes(Rr)}function m$5(Tr){return["table","td","th"].includes(s$2(Tr))}function y$3(Tr){const Cr=/firefox/i.test(u$7()),$r=o$3(Tr),Ar=$r.backdropFilter||$r.WebkitBackdropFilter;return $r.transform!=="none"||$r.perspective!=="none"||!!Ar&&Ar!=="none"||Cr&&$r.willChange==="filter"||Cr&&!!$r.filter&&$r.filter!=="none"||["transform","perspective"].some(Rr=>$r.willChange.includes(Rr))||["paint","layout","strict","content"].some(Rr=>{const Dr=$r.contain;return Dr!=null&&Dr.includes(Rr)})}function x$2(){return!/^((?!chrome|android).)*safari/i.test(u$7())}function w$2(Tr){return["html","body","#document"].includes(s$2(Tr))}function v$4(Tr){return d$6(Tr)?Tr:Tr.contextElement}const b$4={x:1,y:1};function L$4(Tr){const Cr=v$4(Tr);if(!a$5(Cr))return b$4;const $r=Cr.getBoundingClientRect(),{width:Ar,height:Rr,fallback:Dr}=c$4(Cr);let Mr=(Dr?l$4($r.width):$r.width)/Ar,Br=(Dr?l$4($r.height):$r.height)/Rr;return Mr&&Number.isFinite(Mr)||(Mr=1),Br&&Number.isFinite(Br)||(Br=1),{x:Mr,y:Br}}function E$3(Tr,Cr,$r,Ar){var Rr,Dr;Cr===void 0&&(Cr=!1),$r===void 0&&($r=!1);const Mr=Tr.getBoundingClientRect(),Br=v$4(Tr);let Nr=b$4;Cr&&(Ar?d$6(Ar)&&(Nr=L$4(Ar)):Nr=L$4(Tr));const Lr=Br?n$6(Br):window,Hr=!x$2()&&$r;let zr=(Mr.left+(Hr&&((Rr=Lr.visualViewport)==null?void 0:Rr.offsetLeft)||0))/Nr.x,Ur=(Mr.top+(Hr&&((Dr=Lr.visualViewport)==null?void 0:Dr.offsetTop)||0))/Nr.y,Vr=Mr.width/Nr.x,jr=Mr.height/Nr.y;if(Br){const Gr=n$6(Br),Xr=Ar&&d$6(Ar)?n$6(Ar):Ar;let Kr=Gr.frameElement;for(;Kr&&Ar&&Xr!==Gr;){const Zr=L$4(Kr),eo=Kr.getBoundingClientRect(),Wr=getComputedStyle(Kr);eo.x+=(Kr.clientLeft+parseFloat(Wr.paddingLeft))*Zr.x,eo.y+=(Kr.clientTop+parseFloat(Wr.paddingTop))*Zr.y,zr*=Zr.x,Ur*=Zr.y,Vr*=Zr.x,jr*=Zr.y,zr+=eo.x,Ur+=eo.y,Kr=n$6(Kr).frameElement}}return{width:Vr,height:jr,top:Ur,right:zr+Vr,bottom:Ur+jr,left:zr,x:zr,y:Ur}}function R$2(Tr){return((h$1(Tr)?Tr.ownerDocument:Tr.document)||window.document).documentElement}function T$3(Tr){return d$6(Tr)?{scrollLeft:Tr.scrollLeft,scrollTop:Tr.scrollTop}:{scrollLeft:Tr.pageXOffset,scrollTop:Tr.pageYOffset}}function C$2(Tr){return E$3(R$2(Tr)).left+T$3(Tr).scrollLeft}function F$2(Tr){if(s$2(Tr)==="html")return Tr;const Cr=Tr.assignedSlot||Tr.parentNode||p$5(Tr)&&Tr.host||R$2(Tr);return p$5(Cr)?Cr.host:Cr}function W$2(Tr){const Cr=F$2(Tr);return w$2(Cr)?Cr.ownerDocument.body:a$5(Cr)&&g$4(Cr)?Cr:W$2(Cr)}function D$1(Tr,Cr){var $r;Cr===void 0&&(Cr=[]);const Ar=W$2(Tr),Rr=Ar===(($r=Tr.ownerDocument)==null?void 0:$r.body),Dr=n$6(Ar);return Rr?Cr.concat(Dr,Dr.visualViewport||[],g$4(Ar)?Ar:[]):Cr.concat(Ar,D$1(Ar))}function S$4(Tr,Cr,$r){return Cr==="viewport"?rectToClientRect(function(Ar,Rr){const Dr=n$6(Ar),Mr=R$2(Ar),Br=Dr.visualViewport;let Nr=Mr.clientWidth,Lr=Mr.clientHeight,Hr=0,zr=0;if(Br){Nr=Br.width,Lr=Br.height;const Ur=x$2();(Ur||!Ur&&Rr==="fixed")&&(Hr=Br.offsetLeft,zr=Br.offsetTop)}return{width:Nr,height:Lr,x:Hr,y:zr}}(Tr,$r)):d$6(Cr)?rectToClientRect(function(Ar,Rr){const Dr=E$3(Ar,!0,Rr==="fixed"),Mr=Dr.top+Ar.clientTop,Br=Dr.left+Ar.clientLeft,Nr=a$5(Ar)?L$4(Ar):{x:1,y:1};return{width:Ar.clientWidth*Nr.x,height:Ar.clientHeight*Nr.y,x:Br*Nr.x,y:Mr*Nr.y}}(Cr,$r)):rectToClientRect(function(Ar){const Rr=R$2(Ar),Dr=T$3(Ar),Mr=Ar.ownerDocument.body,Br=r$4(Rr.scrollWidth,Rr.clientWidth,Mr.scrollWidth,Mr.clientWidth),Nr=r$4(Rr.scrollHeight,Rr.clientHeight,Mr.scrollHeight,Mr.clientHeight);let Lr=-Dr.scrollLeft+C$2(Ar);const Hr=-Dr.scrollTop;return o$3(Mr).direction==="rtl"&&(Lr+=r$4(Rr.clientWidth,Mr.clientWidth)-Br),{width:Br,height:Nr,x:Lr,y:Hr}}(R$2(Tr)))}function A$2(Tr){return a$5(Tr)&&o$3(Tr).position!=="fixed"?Tr.offsetParent:null}function H$2(Tr){const Cr=n$6(Tr);let $r=A$2(Tr);for(;$r&&m$5($r)&&o$3($r).position==="static";)$r=A$2($r);return $r&&(s$2($r)==="html"||s$2($r)==="body"&&o$3($r).position==="static"&&!y$3($r))?Cr:$r||function(Ar){let Rr=F$2(Ar);for(;a$5(Rr)&&!w$2(Rr);){if(y$3(Rr))return Rr;Rr=F$2(Rr)}return null}(Tr)||Cr}function O$2(Tr,Cr,$r){const Ar=a$5(Cr),Rr=R$2(Cr),Dr=E$3(Tr,!0,$r==="fixed",Cr);let Mr={scrollLeft:0,scrollTop:0};const Br={x:0,y:0};if(Ar||!Ar&&$r!=="fixed")if((s$2(Cr)!=="body"||g$4(Rr))&&(Mr=T$3(Cr)),a$5(Cr)){const Nr=E$3(Cr,!0);Br.x=Nr.x+Cr.clientLeft,Br.y=Nr.y+Cr.clientTop}else Rr&&(Br.x=C$2(Rr));return{x:Dr.left+Mr.scrollLeft-Br.x,y:Dr.top+Mr.scrollTop-Br.y,width:Dr.width,height:Dr.height}}const P$5={getClippingRect:function(Tr){let{element:Cr,boundary:$r,rootBoundary:Ar,strategy:Rr}=Tr;const Dr=$r==="clippingAncestors"?function(Lr,Hr){const zr=Hr.get(Lr);if(zr)return zr;let Ur=D$1(Lr).filter(Xr=>d$6(Xr)&&s$2(Xr)!=="body"),Vr=null;const jr=o$3(Lr).position==="fixed";let Gr=jr?F$2(Lr):Lr;for(;d$6(Gr)&&!w$2(Gr);){const Xr=o$3(Gr),Kr=y$3(Gr);(jr?Kr||Vr:Kr||Xr.position!=="static"||!Vr||!["absolute","fixed"].includes(Vr.position))?Vr=Xr:Ur=Ur.filter(Zr=>Zr!==Gr),Gr=F$2(Gr)}return Hr.set(Lr,Ur),Ur}(Cr,this._c):[].concat($r),Mr=[...Dr,Ar],Br=Mr[0],Nr=Mr.reduce((Lr,Hr)=>{const zr=S$4(Cr,Hr,Rr);return Lr.top=r$4(zr.top,Lr.top),Lr.right=i$5(zr.right,Lr.right),Lr.bottom=i$5(zr.bottom,Lr.bottom),Lr.left=r$4(zr.left,Lr.left),Lr},S$4(Cr,Br,Rr));return{width:Nr.right-Nr.left,height:Nr.bottom-Nr.top,x:Nr.left,y:Nr.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(Tr){let{rect:Cr,offsetParent:$r,strategy:Ar}=Tr;const Rr=a$5($r),Dr=R$2($r);if($r===Dr)return Cr;let Mr={scrollLeft:0,scrollTop:0},Br={x:1,y:1};const Nr={x:0,y:0};if((Rr||!Rr&&Ar!=="fixed")&&((s$2($r)!=="body"||g$4(Dr))&&(Mr=T$3($r)),a$5($r))){const Lr=E$3($r);Br=L$4($r),Nr.x=Lr.x+$r.clientLeft,Nr.y=Lr.y+$r.clientTop}return{width:Cr.width*Br.x,height:Cr.height*Br.y,x:Cr.x*Br.x-Mr.scrollLeft*Br.x+Nr.x,y:Cr.y*Br.y-Mr.scrollTop*Br.y+Nr.y}},isElement:d$6,getDimensions:function(Tr){return a$5(Tr)?c$4(Tr):Tr.getBoundingClientRect()},getOffsetParent:H$2,getDocumentElement:R$2,getScale:L$4,async getElementRects(Tr){let{reference:Cr,floating:$r,strategy:Ar}=Tr;const Rr=this.getOffsetParent||H$2,Dr=this.getDimensions;return{reference:O$2(Cr,await Rr($r),Ar),floating:{x:0,y:0,...await Dr($r)}}},getClientRects:Tr=>Array.from(Tr.getClientRects()),isRTL:Tr=>o$3(Tr).direction==="rtl"},B$1=(Tr,Cr,$r)=>{const Ar=new Map,Rr={platform:P$5,...$r},Dr={...Rr.platform,_c:Ar};return computePosition(Tr,Cr,{...Rr,platform:Dr})};function fe$1(Tr,Cr){for(const $r in Cr)Object.prototype.hasOwnProperty.call(Cr,$r)&&(typeof Cr[$r]=="object"&&Tr[$r]?fe$1(Tr[$r],Cr[$r]):Tr[$r]=Cr[$r])}const u$6={disabled:!1,distance:5,skidding:0,container:"body",boundary:void 0,instantMove:!1,disposeTimeout:5e3,popperTriggers:[],strategy:"absolute",preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,themes:{tooltip:{placement:"top",triggers:["hover","focus","touch"],hideTriggers:Tr=>[...Tr,"click"],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:"..."},dropdown:{placement:"bottom",triggers:["click"],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:"dropdown",triggers:["hover","focus"],popperTriggers:["hover","focus"],delay:{show:0,hide:400}}}};function b$3(Tr,Cr){let $r=u$6.themes[Tr]||{},Ar;do Ar=$r[Cr],typeof Ar>"u"?$r.$extend?$r=u$6.themes[$r.$extend]||{}:($r=null,Ar=u$6[Cr]):$r=null;while($r);return Ar}function Je(Tr){const Cr=[Tr];let $r=u$6.themes[Tr]||{};do $r.$extend&&!$r.$resetCss?(Cr.push($r.$extend),$r=u$6.themes[$r.$extend]||{}):$r=null;while($r);return Cr.map(Ar=>`v-popper--theme-${Ar}`)}function oe$1(Tr){const Cr=[Tr];let $r=u$6.themes[Tr]||{};do $r.$extend?(Cr.push($r.$extend),$r=u$6.themes[$r.$extend]||{}):$r=null;while($r);return Cr}let _$1=!1;if(typeof window<"u"){_$1=!1;try{const Tr=Object.defineProperty({},"passive",{get(){_$1=!0}});window.addEventListener("test",null,Tr)}catch{}}let me$1=!1;typeof window<"u"&&typeof navigator<"u"&&(me$1=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const ge$3=["auto","top","bottom","left","right"].reduce((Tr,Cr)=>Tr.concat([Cr,`${Cr}-start`,`${Cr}-end`]),[]),ie$2={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},se$1={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"};function ne$2(Tr,Cr){const $r=Tr.indexOf(Cr);$r!==-1&&Tr.splice($r,1)}function W$1(){return new Promise(Tr=>requestAnimationFrame(()=>{requestAnimationFrame(Tr)}))}const d$5=[];let g$3=null;const re$1={};function pe$2(Tr){let Cr=re$1[Tr];return Cr||(Cr=re$1[Tr]=[]),Cr}let X$1=function(){};typeof window<"u"&&(X$1=window.Element);function n$5(Tr){return function(Cr){return b$3(Cr.theme,Tr)}}const G="__floating-vue__popper",K$1=()=>defineComponent({name:"VPopper",provide(){return{[G]:{parentPopper:this}}},inject:{[G]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:n$5("disabled")},positioningDisabled:{type:Boolean,default:n$5("positioningDisabled")},placement:{type:String,default:n$5("placement"),validator:Tr=>ge$3.includes(Tr)},delay:{type:[String,Number,Object],default:n$5("delay")},distance:{type:[Number,String],default:n$5("distance")},skidding:{type:[Number,String],default:n$5("skidding")},triggers:{type:Array,default:n$5("triggers")},showTriggers:{type:[Array,Function],default:n$5("showTriggers")},hideTriggers:{type:[Array,Function],default:n$5("hideTriggers")},popperTriggers:{type:Array,default:n$5("popperTriggers")},popperShowTriggers:{type:[Array,Function],default:n$5("popperShowTriggers")},popperHideTriggers:{type:[Array,Function],default:n$5("popperHideTriggers")},container:{type:[String,Object,X$1,Boolean],default:n$5("container")},boundary:{type:[String,X$1],default:n$5("boundary")},strategy:{type:String,validator:Tr=>["absolute","fixed"].includes(Tr),default:n$5("strategy")},autoHide:{type:[Boolean,Function],default:n$5("autoHide")},handleResize:{type:Boolean,default:n$5("handleResize")},instantMove:{type:Boolean,default:n$5("instantMove")},eagerMount:{type:Boolean,default:n$5("eagerMount")},popperClass:{type:[String,Array,Object],default:n$5("popperClass")},computeTransformOrigin:{type:Boolean,default:n$5("computeTransformOrigin")},autoMinSize:{type:Boolean,default:n$5("autoMinSize")},autoSize:{type:[Boolean,String],default:n$5("autoSize")},autoMaxSize:{type:Boolean,default:n$5("autoMaxSize")},autoBoundaryMaxSize:{type:Boolean,default:n$5("autoBoundaryMaxSize")},preventOverflow:{type:Boolean,default:n$5("preventOverflow")},overflowPadding:{type:[Number,String],default:n$5("overflowPadding")},arrowPadding:{type:[Number,String],default:n$5("arrowPadding")},arrowOverflow:{type:Boolean,default:n$5("arrowOverflow")},flip:{type:Boolean,default:n$5("flip")},shift:{type:Boolean,default:n$5("shift")},shiftCrossAxis:{type:Boolean,default:n$5("shiftCrossAxis")},noAutoFocus:{type:Boolean,default:n$5("noAutoFocus")},disposeTimeout:{type:Number,default:n$5("disposeTimeout")}},emits:["show","hide","update:shown","apply-show","apply-hide","close-group","close-directive","auto-hide","resize","dispose"],data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:"",strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},shownChildren:new Set,lastAutoHide:!0}},computed:{popperId(){return this.ariaId!=null?this.ariaId:this.randomId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide=="function"?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var Tr;return(Tr=this[G])==null?void 0:Tr.parentPopper},hasPopperShowTriggerHover(){var Tr,Cr;return((Tr=this.popperTriggers)==null?void 0:Tr.includes("hover"))||((Cr=this.popperShowTriggers)==null?void 0:Cr.includes("hover"))}},watch:{shown:"$_autoShowHide",disabled(Tr){Tr?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},...["triggers","positioningDisabled"].reduce((Tr,Cr)=>(Tr[Cr]="$_refreshListeners",Tr),{}),...["placement","distance","skidding","boundary","strategy","overflowPadding","arrowPadding","preventOverflow","shift","shiftCrossAxis","flip"].reduce((Tr,Cr)=>(Tr[Cr]="$_computePosition",Tr),{})},created(){this.$_isDisposed=!0,this.randomId=`popper_${[Math.random(),Date.now()].map(Tr=>Tr.toString(36).substring(2,10)).join("_")}`,this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:Tr=null,skipDelay:Cr=!1,force:$r=!1}={}){var Ar,Rr;(Ar=this.parentPopper)!=null&&Ar.lockedChild&&this.parentPopper.lockedChild!==this||(this.$_pendingHide=!1,($r||!this.disabled)&&(((Rr=this.parentPopper)==null?void 0:Rr.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(Tr,Cr),this.$emit("show"),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit("update:shown",!0))},hide({event:Tr=null,skipDelay:Cr=!1}={}){var $r;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.$_pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:Cr}),this.parentPopper.lockedChild=null)},1e3));return}(($r=this.parentPopper)==null?void 0:$r.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_pendingHide=!1,this.$_scheduleHide(Tr,Cr),this.$emit("hide"),this.$emit("update:shown",!1)}},init(){var Tr;this.$_isDisposed&&(this.$_isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=((Tr=this.referenceNode)==null?void 0:Tr.call(this))??this.$el,this.$_targetNodes=this.targetNodes().filter(Cr=>Cr.nodeType===Cr.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(".v-popper__inner"),this.$_arrowNode=this.$_popperNode.querySelector(".v-popper__arrow-container"),this.$_swapTargetAttrs("title","data-original-title"),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.$_isDisposed||(this.$_isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs("data-original-title","title"),this.$emit("dispose"))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit("resize"))},async $_computePosition(){if(this.$_isDisposed||this.positioningDisabled)return;const Tr={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&Tr.middleware.push(offset({mainAxis:this.distance,crossAxis:this.skidding}));const Cr=this.placement.startsWith("auto");if(Cr?Tr.middleware.push(autoPlacement({alignment:this.placement.split("-")[1]??""})):Tr.placement=this.placement,this.preventOverflow&&(this.shift&&Tr.middleware.push(shift$1({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!Cr&&this.flip&&Tr.middleware.push(flip({padding:this.overflowPadding,boundary:this.boundary}))),Tr.middleware.push(arrow$1({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&Tr.middleware.push({name:"arrowOverflow",fn:({placement:Ar,rects:Rr,middlewareData:Dr})=>{let Mr;const{centerOffset:Br}=Dr.arrow;return Ar.startsWith("top")||Ar.startsWith("bottom")?Mr=Math.abs(Br)>Rr.reference.width/2:Mr=Math.abs(Br)>Rr.reference.height/2,{data:{overflow:Mr}}}}),this.autoMinSize||this.autoSize){const Ar=this.autoSize?this.autoSize:this.autoMinSize?"min":null;Tr.middleware.push({name:"autoSize",fn:({rects:Rr,placement:Dr,middlewareData:Mr})=>{var Br;if((Br=Mr.autoSize)!=null&&Br.skip)return{};let Nr,Lr;return Dr.startsWith("top")||Dr.startsWith("bottom")?Nr=Rr.reference.width:Lr=Rr.reference.height,this.$_innerNode.style[Ar==="min"?"minWidth":Ar==="max"?"maxWidth":"width"]=Nr!=null?`${Nr}px`:null,this.$_innerNode.style[Ar==="min"?"minHeight":Ar==="max"?"maxHeight":"height"]=Lr!=null?`${Lr}px`:null,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,Tr.middleware.push(size({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:Ar,availableHeight:Rr})=>{this.$_innerNode.style.maxWidth=Ar!=null?`${Ar}px`:null,this.$_innerNode.style.maxHeight=Rr!=null?`${Rr}px`:null}})));const $r=await B$1(this.$_referenceNode,this.$_popperNode,Tr);Object.assign(this.result,{x:$r.x,y:$r.y,placement:$r.placement,strategy:$r.strategy,arrow:{...$r.middlewareData.arrow,...$r.middlewareData.arrowOverflow}})},$_scheduleShow(Tr=null,Cr=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),g$3&&this.instantMove&&g$3.instantMove&&g$3!==this.parentPopper){g$3.$_applyHide(!0),this.$_applyShow(!0);return}Cr?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay("show"))},$_scheduleHide(Tr=null,Cr=!1){if(this.shownChildren.size>0){this.$_pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(g$3=this),Cr?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay("hide"))},$_computeDelay(Tr){const Cr=this.delay;return parseInt(Cr&&Cr[Tr]||Cr||0)},async $_applyShow(Tr=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=Tr,!this.isShown&&(this.$_ensureTeleport(),await W$1(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...D$1(this.$_referenceNode),...D$1(this.$_popperNode)],"scroll",()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){const Cr=this.$_referenceNode.getBoundingClientRect(),$r=this.$_popperNode.querySelector(".v-popper__wrapper"),Ar=$r.parentNode.getBoundingClientRect(),Rr=Cr.x+Cr.width/2-(Ar.left+$r.offsetLeft),Dr=Cr.y+Cr.height/2-(Ar.top+$r.offsetTop);this.result.transformOrigin=`${Rr}px ${Dr}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":""});const Tr=this.showGroup;if(Tr){let Cr;for(let $r=0;$r0){this.$_pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=Tr,ne$2(d$5,this),d$5.length===0&&document.body.classList.remove("v-popper--some-open");for(const $r of oe$1(this.theme)){const Ar=pe$2($r);ne$2(Ar,this),Ar.length===0&&document.body.classList.remove(`v-popper--some-open--${$r}`)}g$3===this&&(g$3=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);const Cr=this.disposeTimeout;Cr!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},Cr)),this.$_removeEventListeners("scroll"),this.$emit("apply-hide"),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await W$1(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.$_isDisposed)return;let Tr=this.container;if(typeof Tr=="string"?Tr=window.document.querySelector(Tr):Tr===!1&&(Tr=this.$_targetNodes[0].parentNode),!Tr)throw new Error("No container for popover: "+this.container);Tr.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){const Tr=$r=>{this.isShown&&!this.$_hideInProgress||($r.usedByTooltip=!0,!this.$_preventShow&&this.show({event:$r}))};this.$_registerTriggerListeners(this.$_targetNodes,ie$2,this.triggers,this.showTriggers,Tr),this.$_registerTriggerListeners([this.$_popperNode],ie$2,this.popperTriggers,this.popperShowTriggers,Tr);const Cr=$r=>{$r.usedByTooltip||this.hide({event:$r})};this.$_registerTriggerListeners(this.$_targetNodes,se$1,this.triggers,this.hideTriggers,Cr),this.$_registerTriggerListeners([this.$_popperNode],se$1,this.popperTriggers,this.popperHideTriggers,Cr)},$_registerEventListeners(Tr,Cr,$r){this.$_events.push({targetNodes:Tr,eventType:Cr,handler:$r}),Tr.forEach(Ar=>Ar.addEventListener(Cr,$r,_$1?{passive:!0}:void 0))},$_registerTriggerListeners(Tr,Cr,$r,Ar,Rr){let Dr=$r;Ar!=null&&(Dr=typeof Ar=="function"?Ar(Dr):Ar),Dr.forEach(Mr=>{const Br=Cr[Mr];Br&&this.$_registerEventListeners(Tr,Br,Rr)})},$_removeEventListeners(Tr){const Cr=[];this.$_events.forEach($r=>{const{targetNodes:Ar,eventType:Rr,handler:Dr}=$r;!Tr||Tr===Rr?Ar.forEach(Mr=>Mr.removeEventListener(Rr,Dr)):Cr.push($r)}),this.$_events=Cr},$_refreshListeners(){this.$_isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(Tr,Cr=!1){this.$_showFrameLocked||(this.hide({event:Tr}),Tr.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),Cr&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(Tr,Cr){for(const $r of this.$_targetNodes){const Ar=$r.getAttribute(Tr);Ar&&($r.removeAttribute(Tr),$r.setAttribute(Cr,Ar))}},$_applyAttrsToTarget(Tr){for(const Cr of this.$_targetNodes)for(const $r in Tr){const Ar=Tr[$r];Ar==null?Cr.removeAttribute($r):Cr.setAttribute($r,Ar)}},$_updateParentShownChildren(Tr){let Cr=this.parentPopper;for(;Cr;)Tr?Cr.shownChildren.add(this.randomId):(Cr.shownChildren.delete(this.randomId),Cr.$_pendingHide&&Cr.hide()),Cr=Cr.parentPopper},$_isAimingPopper(){const Tr=this.$_referenceNode.getBoundingClientRect();if(v$3>=Tr.left&&v$3<=Tr.right&&y$2>=Tr.top&&y$2<=Tr.bottom){const Cr=this.$_popperNode.getBoundingClientRect(),$r=v$3-f$4,Ar=y$2-m$4,Rr=Cr.left+Cr.width/2-f$4+(Cr.top+Cr.height/2)-m$4+Cr.width+Cr.height,Dr=f$4+$r*Rr,Mr=m$4+Ar*Rr;return S$3(f$4,m$4,Dr,Mr,Cr.left,Cr.top,Cr.left,Cr.bottom)||S$3(f$4,m$4,Dr,Mr,Cr.left,Cr.top,Cr.right,Cr.top)||S$3(f$4,m$4,Dr,Mr,Cr.right,Cr.top,Cr.right,Cr.bottom)||S$3(f$4,m$4,Dr,Mr,Cr.left,Cr.bottom,Cr.right,Cr.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});typeof document<"u"&&typeof window<"u"&&(me$1?(document.addEventListener("touchstart",ae,_$1?{passive:!0,capture:!0}:!0),document.addEventListener("touchend",Ze,_$1?{passive:!0,capture:!0}:!0)):(window.addEventListener("mousedown",ae,!0),window.addEventListener("click",Qe,!0)),window.addEventListener("resize",ot));function ae(Tr){for(let Cr=0;Cr=0;Ar--){const Rr=d$5[Ar];try{const Dr=Rr.$_containsGlobalTarget=et(Rr,Tr);Rr.$_pendingHide=!1,requestAnimationFrame(()=>{if(Rr.$_pendingHide=!1,!$r[Rr.randomId]&&de$2(Rr,Dr,Tr)){if(Rr.$_handleGlobalClose(Tr,Cr),!Tr.closeAllPopover&&Tr.closePopover&&Dr){let Br=Rr.parentPopper;for(;Br;)$r[Br.randomId]=!0,Br=Br.parentPopper;return}let Mr=Rr.parentPopper;for(;Mr&&de$2(Mr,Mr.$_containsGlobalTarget,Tr);)Mr.$_handleGlobalClose(Tr,Cr),Mr=Mr.parentPopper}})}catch{}}}function et(Tr,Cr){const $r=Tr.popperNode();return Tr.$_mouseDownContains||$r.contains(Cr.target)}function de$2(Tr,Cr,$r){return $r.closeAllPopover||$r.closePopover&&Cr||tt$1(Tr,$r)&&!Cr}function tt$1(Tr,Cr){if(typeof Tr.autoHide=="function"){const $r=Tr.autoHide(Cr);return Tr.lastAutoHide=$r,$r}return Tr.autoHide}function ot(Tr){for(let Cr=0;Cr{f$4=v$3,m$4=y$2,v$3=Tr.clientX,y$2=Tr.clientY},_$1?{passive:!0}:void 0);function S$3(Tr,Cr,$r,Ar,Rr,Dr,Mr,Br){const Nr=((Mr-Rr)*(Cr-Dr)-(Br-Dr)*(Tr-Rr))/((Br-Dr)*($r-Tr)-(Mr-Rr)*(Ar-Cr)),Lr=(($r-Tr)*(Cr-Dr)-(Ar-Cr)*(Tr-Rr))/((Br-Dr)*($r-Tr)-(Mr-Rr)*(Ar-Cr));return Nr>=0&&Nr<=1&&Lr>=0&&Lr<=1}const it$1={extends:K$1()},k$1=(Tr,Cr)=>{const $r=Tr.__vccOpts||Tr;for(const[Ar,Rr]of Cr)$r[Ar]=Rr;return $r};function st(Tr,Cr,$r,Ar,Rr,Dr){return openBlock(),createElementBlock("div",{ref:"reference",class:normalizeClass(["v-popper",{"v-popper--shown":Tr.slotData.isShown}])},[renderSlot(Tr.$slots,"default",normalizeProps(guardReactiveProps(Tr.slotData)))],2)}const nt=k$1(it$1,[["render",st]]);function rt(){var Tr=window.navigator.userAgent,Cr=Tr.indexOf("MSIE ");if(Cr>0)return parseInt(Tr.substring(Cr+5,Tr.indexOf(".",Cr)),10);var $r=Tr.indexOf("Trident/");if($r>0){var Ar=Tr.indexOf("rv:");return parseInt(Tr.substring(Ar+3,Tr.indexOf(".",Ar)),10)}var Rr=Tr.indexOf("Edge/");return Rr>0?parseInt(Tr.substring(Rr+5,Tr.indexOf(".",Rr)),10):-1}let z;function U$2(){U$2.init||(U$2.init=!0,z=rt()!==-1)}var E$2={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){U$2(),nextTick(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const Tr=document.createElement("object");this._resizeObject=Tr,Tr.setAttribute("aria-hidden","true"),Tr.setAttribute("tabindex",-1),Tr.onload=this.addResizeHandlers,Tr.type="text/html",z&&this.$el.appendChild(Tr),Tr.data="about:blank",z||this.$el.appendChild(Tr)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!z&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const pt=withScopeId();pushScopeId("data-v-b329ee4c");const at={class:"resize-observer",tabindex:"-1"};popScopeId();const dt=pt((Tr,Cr,$r,Ar,Rr,Dr)=>(openBlock(),createBlock("div",at)));E$2.render=dt;E$2.__scopeId="data-v-b329ee4c";E$2.__file="src/components/ResizeObserver.vue";const J$1=(Tr="theme")=>({computed:{themeClass(){return Je(this[Tr])}}}),ht=defineComponent({name:"VPopperContent",components:{ResizeObserver:E$2},mixins:[J$1()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:["hide","resize"],methods:{toPx(Tr){return Tr!=null&&!isNaN(Tr)?`${Tr}px`:null}}}),lt$1=["id","aria-hidden","tabindex","data-popper-placement"],ut={ref:"inner",class:"v-popper__inner"},ct=createBaseVNode("div",{class:"v-popper__arrow-outer"},null,-1),ft=createBaseVNode("div",{class:"v-popper__arrow-inner"},null,-1),mt=[ct,ft];function gt$1(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("ResizeObserver");return openBlock(),createElementBlock("div",{id:Tr.popperId,ref:"popover",class:normalizeClass(["v-popper__popper",[Tr.themeClass,Tr.classes.popperClass,{"v-popper__popper--shown":Tr.shown,"v-popper__popper--hidden":!Tr.shown,"v-popper__popper--show-from":Tr.classes.showFrom,"v-popper__popper--show-to":Tr.classes.showTo,"v-popper__popper--hide-from":Tr.classes.hideFrom,"v-popper__popper--hide-to":Tr.classes.hideTo,"v-popper__popper--skip-transition":Tr.skipTransition,"v-popper__popper--arrow-overflow":Tr.result&&Tr.result.arrow.overflow,"v-popper__popper--no-positioning":!Tr.result}]]),style:normalizeStyle(Tr.result?{position:Tr.result.strategy,transform:`translate3d(${Math.round(Tr.result.x)}px,${Math.round(Tr.result.y)}px,0)`}:void 0),"aria-hidden":Tr.shown?"false":"true",tabindex:Tr.autoHide?0:void 0,"data-popper-placement":Tr.result?Tr.result.placement:void 0,onKeyup:Cr[2]||(Cr[2]=withKeys(Br=>Tr.autoHide&&Tr.$emit("hide"),["esc"]))},[createBaseVNode("div",{class:"v-popper__backdrop",onClick:Cr[0]||(Cr[0]=Br=>Tr.autoHide&&Tr.$emit("hide"))}),createBaseVNode("div",{class:"v-popper__wrapper",style:normalizeStyle(Tr.result?{transformOrigin:Tr.result.transformOrigin}:void 0)},[createBaseVNode("div",ut,[Tr.mounted?(openBlock(),createElementBlock(Fragment$1,{key:0},[createBaseVNode("div",null,[renderSlot(Tr.$slots,"default")]),Tr.handleResize?(openBlock(),createBlock(Mr,{key:0,onNotify:Cr[1]||(Cr[1]=Br=>Tr.$emit("resize",Br))})):createCommentVNode("",!0)],64)):createCommentVNode("",!0)],512),createBaseVNode("div",{ref:"arrow",class:"v-popper__arrow-container",style:normalizeStyle(Tr.result?{left:Tr.toPx(Tr.result.arrow.x),top:Tr.toPx(Tr.result.arrow.y)}:void 0)},mt,4)],4)],46,lt$1)}const Q$1=k$1(ht,[["render",gt$1]]),Z$2={methods:{show(...Tr){return this.$refs.popper.show(...Tr)},hide(...Tr){return this.$refs.popper.hide(...Tr)},dispose(...Tr){return this.$refs.popper.dispose(...Tr)},onResize(...Tr){return this.$refs.popper.onResize(...Tr)}}},$t=defineComponent({name:"VPopperWrapper",components:{Popper:nt,PopperContent:Q$1},mixins:[Z$2,J$1("finalTheme")],props:{theme:{type:String,default:null}},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(Tr=>Tr!==this.$refs.popperContent.$el)}}});function _t(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("PopperContent"),Br=resolveComponent("Popper");return openBlock(),createBlock(Br,{ref:"popper",theme:Tr.finalTheme,"target-nodes":Tr.getTargetNodes,"popper-node":()=>Tr.$refs.popperContent.$el,class:normalizeClass([Tr.themeClass])},{default:withCtx(({popperId:Nr,isShown:Lr,shouldMountContent:Hr,skipTransition:zr,autoHide:Ur,show:Vr,hide:jr,handleResize:Gr,onResize:Xr,classes:Kr,result:Zr})=>[renderSlot(Tr.$slots,"default",{shown:Lr,show:Vr,hide:jr}),createVNode(Mr,{ref:"popperContent","popper-id":Nr,theme:Tr.finalTheme,shown:Lr,mounted:Hr,"skip-transition":zr,"auto-hide":Ur,"handle-resize":Gr,classes:Kr,result:Zr,onHide:jr,onResize:Xr},{default:withCtx(()=>[renderSlot(Tr.$slots,"popper",{shown:Lr,hide:jr})]),_:2},1032,["popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:3},8,["theme","target-nodes","popper-node","class"])}const L$3=k$1($t,[["render",_t]]),_e$1={...L$3,name:"VDropdown",vPopperTheme:"dropdown"},we={...L$3,name:"VMenu",vPopperTheme:"menu"},ve$1={...L$3,name:"VTooltip",vPopperTheme:"tooltip"},wt=defineComponent({name:"VTooltipDirective",components:{Popper:K$1(),PopperContent:Q$1},mixins:[Z$2],inheritAttrs:!1,props:{theme:{type:String,default:"tooltip"},html:{type:Boolean,default:Tr=>b$3(Tr.theme,"html")},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:Tr=>b$3(Tr.theme,"loadingContent")},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content=="function"},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(Tr){if(typeof this.content=="function"&&this.$_isShown&&(Tr||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;const Cr=++this.$_fetchId,$r=this.content(this);$r.then?$r.then(Ar=>this.onResult(Cr,Ar)):this.onResult(Cr,$r)}},onResult(Tr,Cr){Tr===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=Cr)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}}),vt=["innerHTML"],yt=["textContent"];function Pt(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("PopperContent"),Br=resolveComponent("Popper");return openBlock(),createBlock(Br,mergeProps({ref:"popper"},Tr.$attrs,{theme:Tr.theme,"target-nodes":Tr.targetNodes,"popper-node":()=>Tr.$refs.popperContent.$el,onApplyShow:Tr.onShow,onApplyHide:Tr.onHide}),{default:withCtx(({popperId:Nr,isShown:Lr,shouldMountContent:Hr,skipTransition:zr,autoHide:Ur,hide:Vr,handleResize:jr,onResize:Gr,classes:Xr,result:Kr})=>[createVNode(Mr,{ref:"popperContent",class:normalizeClass({"v-popper--tooltip-loading":Tr.loading}),"popper-id":Nr,theme:Tr.theme,shown:Lr,mounted:Hr,"skip-transition":zr,"auto-hide":Ur,"handle-resize":jr,classes:Xr,result:Kr,onHide:Vr,onResize:Gr},{default:withCtx(()=>[Tr.html?(openBlock(),createElementBlock("div",{key:0,innerHTML:Tr.finalContent},null,8,vt)):(openBlock(),createElementBlock("div",{key:1,textContent:toDisplayString(Tr.finalContent)},null,8,yt))]),_:2},1032,["class","popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:1},16,["theme","target-nodes","popper-node","onApplyShow","onApplyHide"])}const ye=k$1(wt,[["render",Pt]]),Pe$1="v-popper--has-tooltip";function Tt(Tr,Cr){let $r=Tr.placement;if(!$r&&Cr)for(const Ar of ge$3)Cr[Ar]&&($r=Ar);return $r||($r=b$3(Tr.theme||"tooltip","placement")),$r}function Te$1(Tr,Cr,$r){let Ar;const Rr=typeof Cr;return Rr==="string"?Ar={content:Cr}:Cr&&Rr==="object"?Ar=Cr:Ar={content:!1},Ar.placement=Tt(Ar,$r),Ar.targetNodes=()=>[Tr],Ar.referenceNode=()=>Tr,Ar}let q$1,C$1,bt=0;function Ct(){if(q$1)return;C$1=ref([]),q$1=createApp({name:"VTooltipDirectiveApp",setup(){return{directives:C$1}},render(){return this.directives.map(Cr=>h$5(ye,{...Cr.options,shown:Cr.shown||Cr.options.shown,key:Cr.id}))},devtools:{hide:!0}});const Tr=document.createElement("div");document.body.appendChild(Tr),q$1.mount(Tr)}function St(Tr,Cr,$r){Ct();const Ar=ref(Te$1(Tr,Cr,$r)),Rr=ref(!1),Dr={id:bt++,options:Ar,shown:Rr};return C$1.value.push(Dr),Tr.classList&&Tr.classList.add(Pe$1),Tr.$_popper={options:Ar,item:Dr,show(){Rr.value=!0},hide(){Rr.value=!1}}}function be$1(Tr){if(Tr.$_popper){const Cr=C$1.value.indexOf(Tr.$_popper.item);Cr!==-1&&C$1.value.splice(Cr,1),delete Tr.$_popper,delete Tr.$_popperOldShown,delete Tr.$_popperMountTarget}Tr.classList&&Tr.classList.remove(Pe$1)}function he$1(Tr,{value:Cr,modifiers:$r}){const Ar=Te$1(Tr,Cr,$r);if(!Ar.content||b$3(Ar.theme||"tooltip","disabled"))be$1(Tr);else{let Rr;Tr.$_popper?(Rr=Tr.$_popper,Rr.options.value=Ar):Rr=St(Tr,Cr,$r),typeof Cr.shown<"u"&&Cr.shown!==Tr.$_popperOldShown&&(Tr.$_popperOldShown=Cr.shown,Cr.shown?Rr.show():Rr.hide())}}const Ce={beforeMount:he$1,updated:he$1,beforeUnmount(Tr){be$1(Tr)}};function le$3(Tr){Tr.addEventListener("click",Se$2),Tr.addEventListener("touchstart",ze,_$1?{passive:!0}:!1)}function ue(Tr){Tr.removeEventListener("click",Se$2),Tr.removeEventListener("touchstart",ze),Tr.removeEventListener("touchend",Ne),Tr.removeEventListener("touchcancel",Ae$1)}function Se$2(Tr){const Cr=Tr.currentTarget;Tr.closePopover=!Cr.$_vclosepopover_touch,Tr.closeAllPopover=Cr.$_closePopoverModifiers&&!!Cr.$_closePopoverModifiers.all}function ze(Tr){if(Tr.changedTouches.length===1){const Cr=Tr.currentTarget;Cr.$_vclosepopover_touch=!0;const $r=Tr.changedTouches[0];Cr.$_vclosepopover_touchPoint=$r,Cr.addEventListener("touchend",Ne),Cr.addEventListener("touchcancel",Ae$1)}}function Ne(Tr){const Cr=Tr.currentTarget;if(Cr.$_vclosepopover_touch=!1,Tr.changedTouches.length===1){const $r=Tr.changedTouches[0],Ar=Cr.$_vclosepopover_touchPoint;Tr.closePopover=Math.abs($r.screenY-Ar.screenY)<20&&Math.abs($r.screenX-Ar.screenX)<20,Tr.closeAllPopover=Cr.$_closePopoverModifiers&&!!Cr.$_closePopoverModifiers.all}}function Ae$1(Tr){const Cr=Tr.currentTarget;Cr.$_vclosepopover_touch=!1}const He$1={beforeMount(Tr,{value:Cr,modifiers:$r}){Tr.$_closePopoverModifiers=$r,(typeof Cr>"u"||Cr)&&le$3(Tr)},updated(Tr,{value:Cr,oldValue:$r,modifiers:Ar}){Tr.$_closePopoverModifiers=Ar,Cr!==$r&&(typeof Cr>"u"||Cr?le$3(Tr):ue(Tr))},beforeUnmount(Tr){ue(Tr)}};function zt(Tr,Cr={}){Tr.$_vTooltipInstalled||(Tr.$_vTooltipInstalled=!0,fe$1(u$6,Cr),Tr.directive("tooltip",Ce),Tr.directive("close-popper",He$1),Tr.component("VTooltip",ve$1),Tr.component("VDropdown",_e$1),Tr.component("VMenu",we))}const xt={version:"2.0.0-beta.24",install:zt,options:u$6},floating_vue_EIcJ7xiw0h=defineNuxtPlugin(Tr=>{Tr.vueApp.use(xt)}),chunk_reload_client_YuJIVqNNev=defineNuxtPlugin({name:"nuxt:chunk-reload",setup(Tr){const Cr=useRouter$1(),$r=useRuntimeConfig(),Ar=new Set;Cr.beforeEach(()=>{Ar.clear()}),Tr.hook("app:chunkError",({error:Dr})=>{Ar.add(Dr)});function Rr(Dr){const Br="href"in Dr&&Dr.href.startsWith("#")?$r.app.baseURL+Dr.href:joinURL($r.app.baseURL,Dr.fullPath);reloadNuxtApp({path:Br,persistState:!0})}Tr.hook("app:manifest:update",()=>{Cr.beforeResolve(Rr)}),Cr.onError((Dr,Mr)=>{Ar.has(Dr)&&Rr(Mr)})}});typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;function getLifeCycleTarget(Tr){return Tr||getCurrentInstance()}function tryOnUnmounted(Tr,Cr){getLifeCycleTarget(Cr)&&onUnmounted(Tr,Cr)}const defaultTimestep=1/60*1e3,getCurrentTime=typeof performance<"u"?()=>performance.now():()=>Date.now(),onNextFrame=typeof window<"u"?Tr=>window.requestAnimationFrame(Tr):Tr=>setTimeout(()=>Tr(getCurrentTime()),defaultTimestep);function createRenderStep(Tr){let Cr=[],$r=[],Ar=0,Rr=!1,Dr=!1;const Mr=new WeakSet,Br={schedule:(Nr,Lr=!1,Hr=!1)=>{const zr=Hr&&Rr,Ur=zr?Cr:$r;return Lr&&Mr.add(Nr),Ur.indexOf(Nr)===-1&&(Ur.push(Nr),zr&&Rr&&(Ar=Cr.length)),Nr},cancel:Nr=>{const Lr=$r.indexOf(Nr);Lr!==-1&&$r.splice(Lr,1),Mr.delete(Nr)},process:Nr=>{if(Rr){Dr=!0;return}if(Rr=!0,[Cr,$r]=[$r,Cr],$r.length=0,Ar=Cr.length,Ar)for(let Lr=0;Lr(Tr[Cr]=createRenderStep(()=>runNextFrame=!0),Tr),{}),sync=stepsOrder.reduce((Tr,Cr)=>{const $r=steps[Cr];return Tr[Cr]=(Ar,Rr=!1,Dr=!1)=>(runNextFrame||startLoop(),$r.schedule(Ar,Rr,Dr)),Tr},{}),cancelSync=stepsOrder.reduce((Tr,Cr)=>(Tr[Cr]=steps[Cr].cancel,Tr),{});stepsOrder.reduce((Tr,Cr)=>(Tr[Cr]=()=>steps[Cr].process(frame),Tr),{});const processStep=Tr=>steps[Tr].process(frame),processFrame=Tr=>{runNextFrame=!1,frame.delta=useDefaultElapsed?defaultTimestep:Math.max(Math.min(Tr-frame.timestamp,maxElapsed),1),frame.timestamp=Tr,isProcessing=!0,stepsOrder.forEach(processStep),isProcessing=!1,runNextFrame&&(useDefaultElapsed=!1,onNextFrame(processFrame))},startLoop=()=>{runNextFrame=!0,useDefaultElapsed=!0,isProcessing||onNextFrame(processFrame)},getFrameData=()=>frame;function __rest$1(Tr,Cr){var $r={};for(var Ar in Tr)Object.prototype.hasOwnProperty.call(Tr,Ar)&&Cr.indexOf(Ar)<0&&($r[Ar]=Tr[Ar]);if(Tr!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Rr=0,Ar=Object.getOwnPropertySymbols(Tr);RrMath.min(Math.max($r,Tr),Cr),safeMin=.001,minDuration=.01,maxDuration=10,minDamping=.05,maxDamping=1;function findSpring({duration:Tr=800,bounce:Cr=.25,velocity:$r=0,mass:Ar=1}){let Rr,Dr;warning(Tr<=maxDuration*1e3);let Mr=1-Cr;Mr=clamp$1(minDamping,maxDamping,Mr),Tr=clamp$1(minDuration,maxDuration,Tr/1e3),Mr<1?(Rr=Lr=>{const Hr=Lr*Mr,zr=Hr*Tr,Ur=Hr-$r,Vr=calcAngularFreq(Lr,Mr),jr=Math.exp(-zr);return safeMin-Ur/Vr*jr},Dr=Lr=>{const zr=Lr*Mr*Tr,Ur=zr*$r+$r,Vr=Math.pow(Mr,2)*Math.pow(Lr,2)*Tr,jr=Math.exp(-zr),Gr=calcAngularFreq(Math.pow(Lr,2),Mr);return(-Rr(Lr)+safeMin>0?-1:1)*((Ur-Vr)*jr)/Gr}):(Rr=Lr=>{const Hr=Math.exp(-Lr*Tr),zr=(Lr-$r)*Tr+1;return-safeMin+Hr*zr},Dr=Lr=>{const Hr=Math.exp(-Lr*Tr),zr=($r-Lr)*(Tr*Tr);return Hr*zr});const Br=5/Tr,Nr=approximateRoot(Rr,Dr,Br);if(Tr=Tr*1e3,isNaN(Nr))return{stiffness:100,damping:10,duration:Tr};{const Lr=Math.pow(Nr,2)*Ar;return{stiffness:Lr,damping:Mr*2*Math.sqrt(Ar*Lr),duration:Tr}}}const rootIterations=12;function approximateRoot(Tr,Cr,$r){let Ar=$r;for(let Rr=1;RrTr[$r]!==void 0)}function getSpringOptions(Tr){let Cr=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},Tr);if(!isSpringType(Tr,physicsKeys)&&isSpringType(Tr,durationKeys)){const $r=findSpring(Tr);Cr=Object.assign(Object.assign(Object.assign({},Cr),$r),{velocity:0,mass:1}),Cr.isResolvedFromDuration=!0}return Cr}function spring(Tr){var{from:Cr=0,to:$r=1,restSpeed:Ar=2,restDelta:Rr}=Tr,Dr=__rest$1(Tr,["from","to","restSpeed","restDelta"]);const Mr={done:!1,value:Cr};let{stiffness:Br,damping:Nr,mass:Lr,velocity:Hr,duration:zr,isResolvedFromDuration:Ur}=getSpringOptions(Dr),Vr=zero$1,jr=zero$1;function Gr(){const Xr=Hr?-(Hr/1e3):0,Kr=$r-Cr,Zr=Nr/(2*Math.sqrt(Br*Lr)),eo=Math.sqrt(Br/Lr)/1e3;if(Rr===void 0&&(Rr=Math.min(Math.abs($r-Cr)/100,.4)),Zr<1){const Wr=calcAngularFreq(eo,Zr);Vr=Yr=>{const Jr=Math.exp(-Zr*eo*Yr);return $r-Jr*((Xr+Zr*eo*Kr)/Wr*Math.sin(Wr*Yr)+Kr*Math.cos(Wr*Yr))},jr=Yr=>{const Jr=Math.exp(-Zr*eo*Yr);return Zr*eo*Jr*(Math.sin(Wr*Yr)*(Xr+Zr*eo*Kr)/Wr+Kr*Math.cos(Wr*Yr))-Jr*(Math.cos(Wr*Yr)*(Xr+Zr*eo*Kr)-Wr*Kr*Math.sin(Wr*Yr))}}else if(Zr===1)Vr=Wr=>$r-Math.exp(-eo*Wr)*(Kr+(Xr+eo*Kr)*Wr);else{const Wr=eo*Math.sqrt(Zr*Zr-1);Vr=Yr=>{const Jr=Math.exp(-Zr*eo*Yr),no=Math.min(Wr*Yr,300);return $r-Jr*((Xr+Zr*eo*Kr)*Math.sinh(no)+Wr*Kr*Math.cosh(no))/Wr}}}return Gr(),{next:Xr=>{const Kr=Vr(Xr);if(Ur)Mr.done=Xr>=zr;else{const Zr=jr(Xr)*1e3,eo=Math.abs(Zr)<=Ar,Wr=Math.abs($r-Kr)<=Rr;Mr.done=eo&&Wr}return Mr.value=Mr.done?$r:Kr,Mr},flipTarget:()=>{Hr=-Hr,[Cr,$r]=[$r,Cr],Gr()}}}spring.needsInterpolation=(Tr,Cr)=>typeof Tr=="string"||typeof Cr=="string";const zero$1=Tr=>0,progress=(Tr,Cr,$r)=>{const Ar=Cr-Tr;return Ar===0?1:($r-Tr)/Ar},mix=(Tr,Cr,$r)=>-$r*Tr+$r*Cr+Tr,clamp=(Tr,Cr)=>$r=>Math.max(Math.min($r,Cr),Tr),sanitize=Tr=>Tr%1?Number(Tr.toFixed(5)):Tr,floatRegex=/(-)?([\d]*\.?[\d])+/g,colorRegex=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,singleColorRegex=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function isString$5(Tr){return typeof Tr=="string"}const number={test:Tr=>typeof Tr=="number",parse:parseFloat,transform:Tr=>Tr},alpha$2=Object.assign(Object.assign({},number),{transform:clamp(0,1)}),scale=Object.assign(Object.assign({},number),{default:1}),createUnitType=Tr=>({test:Cr=>isString$5(Cr)&&Cr.endsWith(Tr)&&Cr.split(" ").length===1,parse:parseFloat,transform:Cr=>`${Cr}${Tr}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),progressPercentage=Object.assign(Object.assign({},percent),{parse:Tr=>percent.parse(Tr)/100,transform:Tr=>percent.transform(Tr*100)}),isColorString=(Tr,Cr)=>$r=>!!(isString$5($r)&&singleColorRegex.test($r)&&$r.startsWith(Tr)||Cr&&Object.prototype.hasOwnProperty.call($r,Cr)),splitColor=(Tr,Cr,$r)=>Ar=>{if(!isString$5(Ar))return Ar;const[Rr,Dr,Mr,Br]=Ar.match(floatRegex);return{[Tr]:parseFloat(Rr),[Cr]:parseFloat(Dr),[$r]:parseFloat(Mr),alpha:Br!==void 0?parseFloat(Br):1}},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:Tr,saturation:Cr,lightness:$r,alpha:Ar=1})=>"hsla("+Math.round(Tr)+", "+percent.transform(sanitize(Cr))+", "+percent.transform(sanitize($r))+", "+sanitize(alpha$2.transform(Ar))+")"},clampRgbUnit=clamp(0,255),rgbUnit=Object.assign(Object.assign({},number),{transform:Tr=>Math.round(clampRgbUnit(Tr))}),rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:Tr,green:Cr,blue:$r,alpha:Ar=1})=>"rgba("+rgbUnit.transform(Tr)+", "+rgbUnit.transform(Cr)+", "+rgbUnit.transform($r)+", "+sanitize(alpha$2.transform(Ar))+")"};function parseHex(Tr){let Cr="",$r="",Ar="",Rr="";return Tr.length>5?(Cr=Tr.substr(1,2),$r=Tr.substr(3,2),Ar=Tr.substr(5,2),Rr=Tr.substr(7,2)):(Cr=Tr.substr(1,1),$r=Tr.substr(2,1),Ar=Tr.substr(3,1),Rr=Tr.substr(4,1),Cr+=Cr,$r+=$r,Ar+=Ar,Rr+=Rr),{red:parseInt(Cr,16),green:parseInt($r,16),blue:parseInt(Ar,16),alpha:Rr?parseInt(Rr,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},color={test:Tr=>rgba.test(Tr)||hex.test(Tr)||hsla.test(Tr),parse:Tr=>rgba.test(Tr)?rgba.parse(Tr):hsla.test(Tr)?hsla.parse(Tr):hex.parse(Tr),transform:Tr=>isString$5(Tr)?Tr:Tr.hasOwnProperty("red")?rgba.transform(Tr):hsla.transform(Tr)},colorToken="${c}",numberToken="${n}";function test(Tr){var Cr,$r,Ar,Rr;return isNaN(Tr)&&isString$5(Tr)&&(($r=(Cr=Tr.match(floatRegex))===null||Cr===void 0?void 0:Cr.length)!==null&&$r!==void 0?$r:0)+((Rr=(Ar=Tr.match(colorRegex))===null||Ar===void 0?void 0:Ar.length)!==null&&Rr!==void 0?Rr:0)>0}function analyse$1(Tr){typeof Tr=="number"&&(Tr=`${Tr}`);const Cr=[];let $r=0;const Ar=Tr.match(colorRegex);Ar&&($r=Ar.length,Tr=Tr.replace(colorRegex,colorToken),Cr.push(...Ar.map(color.parse)));const Rr=Tr.match(floatRegex);return Rr&&(Tr=Tr.replace(floatRegex,numberToken),Cr.push(...Rr.map(number.parse))),{values:Cr,numColors:$r,tokenised:Tr}}function parse$2(Tr){return analyse$1(Tr).values}function createTransformer(Tr){const{values:Cr,numColors:$r,tokenised:Ar}=analyse$1(Tr),Rr=Cr.length;return Dr=>{let Mr=Ar;for(let Br=0;Brtypeof Tr=="number"?0:Tr;function getAnimatableNone$1(Tr){const Cr=parse$2(Tr);return createTransformer(Tr)(Cr.map(convertNumbersToZero))}const complex={test,parse:parse$2,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(Tr){let[Cr,$r]=Tr.slice(0,-1).split("(");if(Cr==="drop-shadow")return Tr;const[Ar]=$r.match(floatRegex)||[];if(!Ar)return Tr;const Rr=$r.replace(Ar,"");let Dr=maxDefaults.has(Cr)?1:0;return Ar!==$r&&(Dr*=100),Cr+"("+Dr+Rr+")"}const functionRegex=/([a-z-]*)\(.*?\)/g,filter=Object.assign(Object.assign({},complex),{getAnimatableNone:Tr=>{const Cr=Tr.match(functionRegex);return Cr?Cr.map(applyDefaultFilter).join(" "):Tr}});function hueToRgb(Tr,Cr,$r){return $r<0&&($r+=1),$r>1&&($r-=1),$r<1/6?Tr+(Cr-Tr)*6*$r:$r<1/2?Cr:$r<2/3?Tr+(Cr-Tr)*(2/3-$r)*6:Tr}function hslaToRgba({hue:Tr,saturation:Cr,lightness:$r,alpha:Ar}){Tr/=360,Cr/=100,$r/=100;let Rr=0,Dr=0,Mr=0;if(!Cr)Rr=Dr=Mr=$r;else{const Br=$r<.5?$r*(1+Cr):$r+Cr-$r*Cr,Nr=2*$r-Br;Rr=hueToRgb(Nr,Br,Tr+1/3),Dr=hueToRgb(Nr,Br,Tr),Mr=hueToRgb(Nr,Br,Tr-1/3)}return{red:Math.round(Rr*255),green:Math.round(Dr*255),blue:Math.round(Mr*255),alpha:Ar}}const mixLinearColor=(Tr,Cr,$r)=>{const Ar=Tr*Tr,Rr=Cr*Cr;return Math.sqrt(Math.max(0,$r*(Rr-Ar)+Ar))},colorTypes$3=[hex,rgba,hsla],getColorType=Tr=>colorTypes$3.find(Cr=>Cr.test(Tr)),mixColor=(Tr,Cr)=>{let $r=getColorType(Tr),Ar=getColorType(Cr),Rr=$r.parse(Tr),Dr=Ar.parse(Cr);$r===hsla&&(Rr=hslaToRgba(Rr),$r=rgba),Ar===hsla&&(Dr=hslaToRgba(Dr),Ar=rgba);const Mr=Object.assign({},Rr);return Br=>{for(const Nr in Mr)Nr!=="alpha"&&(Mr[Nr]=mixLinearColor(Rr[Nr],Dr[Nr],Br));return Mr.alpha=mix(Rr.alpha,Dr.alpha,Br),$r.transform(Mr)}},isNum=Tr=>typeof Tr=="number",combineFunctions=(Tr,Cr)=>$r=>Cr(Tr($r)),pipe=(...Tr)=>Tr.reduce(combineFunctions);function getMixer(Tr,Cr){return isNum(Tr)?$r=>mix(Tr,Cr,$r):color.test(Tr)?mixColor(Tr,Cr):mixComplex(Tr,Cr)}const mixArray=(Tr,Cr)=>{const $r=[...Tr],Ar=$r.length,Rr=Tr.map((Dr,Mr)=>getMixer(Dr,Cr[Mr]));return Dr=>{for(let Mr=0;Mr{const $r=Object.assign(Object.assign({},Tr),Cr),Ar={};for(const Rr in $r)Tr[Rr]!==void 0&&Cr[Rr]!==void 0&&(Ar[Rr]=getMixer(Tr[Rr],Cr[Rr]));return Rr=>{for(const Dr in Ar)$r[Dr]=Ar[Dr](Rr);return $r}};function analyse(Tr){const Cr=complex.parse(Tr),$r=Cr.length;let Ar=0,Rr=0,Dr=0;for(let Mr=0;Mr<$r;Mr++)Ar||typeof Cr[Mr]=="number"?Ar++:Cr[Mr].hue!==void 0?Dr++:Rr++;return{parsed:Cr,numNumbers:Ar,numRGB:Rr,numHSL:Dr}}const mixComplex=(Tr,Cr)=>{const $r=complex.createTransformer(Cr),Ar=analyse(Tr),Rr=analyse(Cr);return Ar.numHSL===Rr.numHSL&&Ar.numRGB===Rr.numRGB&&Ar.numNumbers>=Rr.numNumbers?pipe(mixArray(Ar.parsed,Rr.parsed),$r):Mr=>`${Mr>0?Cr:Tr}`},mixNumber=(Tr,Cr)=>$r=>mix(Tr,Cr,$r);function detectMixerFactory(Tr){if(typeof Tr=="number")return mixNumber;if(typeof Tr=="string")return color.test(Tr)?mixColor:mixComplex;if(Array.isArray(Tr))return mixArray;if(typeof Tr=="object")return mixObject}function createMixers(Tr,Cr,$r){const Ar=[],Rr=$r||detectMixerFactory(Tr[0]),Dr=Tr.length-1;for(let Mr=0;Mr$r(progress(Tr,Cr,Ar))}function slowInterpolate(Tr,Cr){const $r=Tr.length,Ar=$r-1;return Rr=>{let Dr=0,Mr=!1;if(Rr<=Tr[0]?Mr=!0:Rr>=Tr[Ar]&&(Dr=Ar-1,Mr=!0),!Mr){let Nr=1;for(;Nr<$r&&!(Tr[Nr]>Rr||Nr===Ar);Nr++);Dr=Nr-1}const Br=progress(Tr[Dr],Tr[Dr+1],Rr);return Cr[Dr](Br)}}function interpolate(Tr,Cr,{clamp:$r=!0,ease:Ar,mixer:Rr}={}){const Dr=Tr.length;invariant(Dr===Cr.length),invariant(!Ar||!Array.isArray(Ar)||Ar.length===Dr-1),Tr[0]>Tr[Dr-1]&&(Tr=[].concat(Tr),Cr=[].concat(Cr),Tr.reverse(),Cr.reverse());const Mr=createMixers(Cr,Ar,Rr),Br=Dr===2?fastInterpolate(Tr,Mr):slowInterpolate(Tr,Mr);return $r?Nr=>Br(clamp$1(Tr[0],Tr[Dr-1],Nr)):Br}const reverseEasing=Tr=>Cr=>1-Tr(1-Cr),mirrorEasing=Tr=>Cr=>Cr<=.5?Tr(2*Cr)/2:(2-Tr(2*(1-Cr)))/2,createExpoIn=Tr=>Cr=>Math.pow(Cr,Tr),createBackIn=Tr=>Cr=>Cr*Cr*((Tr+1)*Cr-Tr),createAnticipate=Tr=>{const Cr=createBackIn(Tr);return $r=>($r*=2)<1?.5*Cr($r):.5*(2-Math.pow(2,-10*($r-1)))},DEFAULT_OVERSHOOT_STRENGTH=1.525,BOUNCE_FIRST_THRESHOLD=4/11,BOUNCE_SECOND_THRESHOLD=8/11,BOUNCE_THIRD_THRESHOLD=9/10,linear=Tr=>Tr,easeIn=createExpoIn(2),easeOut=reverseEasing(easeIn),easeInOut=mirrorEasing(easeIn),circIn=Tr=>1-Math.sin(Math.acos(Tr)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circOut),backIn=createBackIn(DEFAULT_OVERSHOOT_STRENGTH),backOut=reverseEasing(backIn),backInOut=mirrorEasing(backIn),anticipate=createAnticipate(DEFAULT_OVERSHOOT_STRENGTH),ca=4356/361,cb=35442/1805,cc=16061/1805,bounceOut=Tr=>{if(Tr===1||Tr===0)return Tr;const Cr=Tr*Tr;return TrTr<.5?.5*(1-bounceOut(1-Tr*2)):.5*bounceOut(Tr*2-1)+.5;function defaultEasing(Tr,Cr){return Tr.map(()=>Cr||easeInOut).splice(0,Tr.length-1)}function defaultOffset(Tr){const Cr=Tr.length;return Tr.map(($r,Ar)=>Ar!==0?Ar/(Cr-1):0)}function convertOffsetToTimes(Tr,Cr){return Tr.map($r=>$r*Cr)}function keyframes$1({from:Tr=0,to:Cr=1,ease:$r,offset:Ar,duration:Rr=300}){const Dr={done:!1,value:Tr},Mr=Array.isArray(Cr)?Cr:[Tr,Cr],Br=convertOffsetToTimes(Ar&&Ar.length===Mr.length?Ar:defaultOffset(Mr),Rr);function Nr(){return interpolate(Br,Mr,{ease:Array.isArray($r)?$r:defaultEasing(Mr,$r)})}let Lr=Nr();return{next:Hr=>(Dr.value=Lr(Hr),Dr.done=Hr>=Rr,Dr),flipTarget:()=>{Mr.reverse(),Lr=Nr()}}}function decay({velocity:Tr=0,from:Cr=0,power:$r=.8,timeConstant:Ar=350,restDelta:Rr=.5,modifyTarget:Dr}){const Mr={done:!1,value:Cr};let Br=$r*Tr;const Nr=Cr+Br,Lr=Dr===void 0?Nr:Dr(Nr);return Lr!==Nr&&(Br=Lr-Cr),{next:Hr=>{const zr=-Br*Math.exp(-Hr/Ar);return Mr.done=!(zr>Rr||zr<-Rr),Mr.value=Mr.done?Lr:Lr+zr,Mr},flipTarget:()=>{}}}const types={keyframes:keyframes$1,spring,decay};function detectAnimationFromOptions(Tr){if(Array.isArray(Tr.to))return keyframes$1;if(types[Tr.type])return types[Tr.type];const Cr=new Set(Object.keys(Tr));return Cr.has("ease")||Cr.has("duration")&&!Cr.has("dampingRatio")?keyframes$1:Cr.has("dampingRatio")||Cr.has("stiffness")||Cr.has("mass")||Cr.has("damping")||Cr.has("restSpeed")||Cr.has("restDelta")?spring:keyframes$1}function loopElapsed(Tr,Cr,$r=0){return Tr-Cr-$r}function reverseElapsed(Tr,Cr,$r=0,Ar=!0){return Ar?loopElapsed(Cr+-Tr,Cr,$r):Cr-(Tr-Cr)+$r}function hasRepeatDelayElapsed(Tr,Cr,$r,Ar){return Ar?Tr>=Cr+$r:Tr<=-$r}const framesync=Tr=>{const Cr=({delta:$r})=>Tr($r);return{start:()=>sync.update(Cr,!0),stop:()=>cancelSync.update(Cr)}};function animate(Tr){var Cr,$r,{from:Ar,autoplay:Rr=!0,driver:Dr=framesync,elapsed:Mr=0,repeat:Br=0,repeatType:Nr="loop",repeatDelay:Lr=0,onPlay:Hr,onStop:zr,onComplete:Ur,onRepeat:Vr,onUpdate:jr}=Tr,Gr=__rest$1(Tr,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:Xr}=Gr,Kr,Zr=0,eo=Gr.duration,Wr,Yr=!1,Jr=!0,no;const ro=detectAnimationFromOptions(Gr);!(($r=(Cr=ro).needsInterpolation)===null||$r===void 0)&&$r.call(Cr,Ar,Xr)&&(no=interpolate([0,100],[Ar,Xr],{clamp:!1}),Ar=0,Xr=100);const so=ro(Object.assign(Object.assign({},Gr),{from:Ar,to:Xr}));function ao(){Zr++,Nr==="reverse"?(Jr=Zr%2===0,Mr=reverseElapsed(Mr,eo,Lr,Jr)):(Mr=loopElapsed(Mr,eo,Lr),Nr==="mirror"&&so.flipTarget()),Yr=!1,Vr&&Vr()}function lo(){Kr.stop(),Ur&&Ur()}function po(co){if(Jr||(co=-co),Mr+=co,!Yr){const mo=so.next(Math.max(0,Mr));Wr=mo.value,no&&(Wr=no(Wr)),Yr=Jr?mo.done:Mr<=0}jr==null||jr(Wr),Yr&&(Zr===0&&(eo??(eo=Mr)),Zr{zr==null||zr(),Kr.stop()}}}function velocityPerSecond(Tr,Cr){return Cr?Tr*(1e3/Cr):0}function inertia({from:Tr=0,velocity:Cr=0,min:$r,max:Ar,power:Rr=.8,timeConstant:Dr=750,bounceStiffness:Mr=500,bounceDamping:Br=10,restDelta:Nr=1,modifyTarget:Lr,driver:Hr,onUpdate:zr,onComplete:Ur,onStop:Vr}){let jr;function Gr(eo){return $r!==void 0&&eo<$r||Ar!==void 0&&eo>Ar}function Xr(eo){return $r===void 0?Ar:Ar===void 0||Math.abs($r-eo){var Yr;zr==null||zr(Wr),(Yr=eo.onUpdate)===null||Yr===void 0||Yr.call(eo,Wr)},onComplete:Ur,onStop:Vr}))}function Zr(eo){Kr(Object.assign({type:"spring",stiffness:Mr,damping:Br,restDelta:Nr},eo))}if(Gr(Tr))Zr({from:Tr,velocity:Cr,to:Xr(Tr)});else{let eo=Rr*Cr+Tr;typeof Lr<"u"&&(eo=Lr(eo));const Wr=Xr(eo),Yr=Wr===$r?-1:1;let Jr,no;const ro=so=>{Jr=no,no=so,Cr=velocityPerSecond(so-Jr,getFrameData().delta),(Yr===1&&so>Wr||Yr===-1&&sojr==null?void 0:jr.stop()}}const a$4=(Tr,Cr)=>1-3*Cr+3*Tr,b$2=(Tr,Cr)=>3*Cr-6*Tr,c$3=Tr=>3*Tr,calcBezier=(Tr,Cr,$r)=>((a$4(Cr,$r)*Tr+b$2(Cr,$r))*Tr+c$3(Cr))*Tr,getSlope=(Tr,Cr,$r)=>3*a$4(Cr,$r)*Tr*Tr+2*b$2(Cr,$r)*Tr+c$3(Cr),subdivisionPrecision=1e-7,subdivisionMaxIterations=10;function binarySubdivide(Tr,Cr,$r,Ar,Rr){let Dr,Mr,Br=0;do Mr=Cr+($r-Cr)/2,Dr=calcBezier(Mr,Ar,Rr)-Tr,Dr>0?$r=Mr:Cr=Mr;while(Math.abs(Dr)>subdivisionPrecision&&++Br=newtonMinSlope?newtonRaphsonIterate(Mr,zr,Tr,$r):Ur===0?zr:binarySubdivide(Mr,Br,Br+kSampleStepSize,Tr,$r)}return Mr=>Mr===0||Mr===1?Mr:calcBezier(Dr(Mr),Cr,Ar)}function makeMap(Tr,Cr){const $r=Object.create(null),Ar=Tr.split(",");for(let Rr=0;Rr!!$r[Rr.toLowerCase()]:Rr=>!!$r[Rr]}const HTML_TAGS="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",isHTMLTag=makeMap(HTML_TAGS),motionState={};class SubscriptionManager{constructor(){this.subscriptions=new Set}add(Cr){return this.subscriptions.add(Cr),()=>this.subscriptions.delete(Cr)}notify(Cr,$r,Ar){if(this.subscriptions.size)for(const Rr of this.subscriptions)Rr(Cr,$r,Ar)}clear(){this.subscriptions.clear()}}function isFloat(Tr){return!isNaN(parseFloat(Tr))}class MotionValue{constructor(Cr){this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new SubscriptionManager,this.canTrackVelocity=!1,this.updateAndNotify=$r=>{this.prev=this.current,this.current=$r;const{delta:Ar,timestamp:Rr}=getFrameData();this.lastUpdated!==Rr&&(this.timeDelta=Ar,this.lastUpdated=Rr),sync.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>sync.postRender(this.velocityCheck),this.velocityCheck=({timestamp:$r})=>{this.canTrackVelocity||(this.canTrackVelocity=isFloat(this.current)),$r!==this.lastUpdated&&(this.prev=this.current)},this.prev=this.current=Cr,this.canTrackVelocity=isFloat(this.current)}onChange(Cr){return this.updateSubscribers.add(Cr)}clearListeners(){this.updateSubscribers.clear()}set(Cr){this.updateAndNotify(Cr)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?velocityPerSecond(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(Cr){return this.stop(),new Promise($r=>{const{stop:Ar}=Cr($r);this.stopAnimation=Ar}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}}function getMotionValue(Tr){return new MotionValue(Tr)}const{isArray:isArray$1}=Array;function useMotionValues(){const Tr=ref({}),Cr=Ar=>{const Rr=Dr=>{Tr.value[Dr]&&(Tr.value[Dr].stop(),Tr.value[Dr].destroy(),delete Tr.value[Dr])};Ar?isArray$1(Ar)?Ar.forEach(Rr):Rr(Ar):Object.keys(Tr.value).forEach(Rr)},$r=(Ar,Rr,Dr)=>{if(Tr.value[Ar])return Tr.value[Ar];const Mr=getMotionValue(Rr);return Mr.onChange(Br=>Dr[Ar]=Br),Tr.value[Ar]=Mr,Mr};return tryOnUnmounted(Cr),{motionValues:Tr,get:$r,stop:Cr}}function isKeyframesTarget(Tr){return Array.isArray(Tr)}function underDampedSpring(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function criticallyDampedSpring(Tr){return{type:"spring",stiffness:550,damping:Tr===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function overDampedSpring(Tr){return{type:"spring",stiffness:550,damping:Tr===0?100:30,restDelta:.01,restSpeed:10}}function linearTween(){return{type:"keyframes",ease:"linear",duration:300}}function keyframes(Tr){return{type:"keyframes",duration:800,values:Tr}}const defaultTransitions={default:overDampedSpring,x:underDampedSpring,y:underDampedSpring,z:underDampedSpring,rotate:underDampedSpring,rotateX:underDampedSpring,rotateY:underDampedSpring,rotateZ:underDampedSpring,scaleX:criticallyDampedSpring,scaleY:criticallyDampedSpring,scale:criticallyDampedSpring,backgroundColor:linearTween,color:linearTween,opacity:linearTween};function getDefaultTransition(Tr,Cr){let $r;return isKeyframesTarget(Cr)?$r=keyframes:$r=defaultTransitions[Tr]||defaultTransitions.default,{to:Cr,...$r(Cr)}}const int$1={...number,transform:Math.round},valueTypes={color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha$2,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int$1,filter,WebkitFilter:filter,fillOpacity:alpha$2,strokeOpacity:alpha$2,numOctaves:int$1},getValueType=Tr=>valueTypes[Tr];function getValueAsType(Tr,Cr){return Cr&&typeof Tr=="number"&&Cr.transform?Cr.transform(Tr):Tr}function getAnimatableNone(Tr,Cr){let $r=getValueType(Tr);return $r!==filter&&($r=complex),$r.getAnimatableNone?$r.getAnimatableNone(Cr):void 0}const easingLookup={linear,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate,bounceIn,bounceInOut,bounceOut};function easingDefinitionToFunction(Tr){if(Array.isArray(Tr)){const[Cr,$r,Ar,Rr]=Tr;return cubicBezier(Cr,$r,Ar,Rr)}else if(typeof Tr=="string")return easingLookup[Tr];return Tr}function isEasingArray(Tr){return Array.isArray(Tr)&&typeof Tr[0]!="number"}function isAnimatable(Tr,Cr){return Tr==="zIndex"?!1:!!(typeof Cr=="number"||Array.isArray(Cr)||typeof Cr=="string"&&complex.test(Cr)&&!Cr.startsWith("url("))}function hydrateKeyframes(Tr){return Array.isArray(Tr.to)&&Tr.to[0]===null&&(Tr.to=[...Tr.to],Tr.to[0]=Tr.from),Tr}function convertTransitionToAnimationOptions({ease:Tr,times:Cr,delay:$r,...Ar}){const Rr={...Ar};return Cr&&(Rr.offset=Cr),Tr&&(Rr.ease=isEasingArray(Tr)?Tr.map(easingDefinitionToFunction):easingDefinitionToFunction(Tr)),$r&&(Rr.elapsed=-$r),Rr}function getPopmotionAnimationOptions(Tr,Cr,$r){return Array.isArray(Cr.to)&&(Tr.duration||(Tr.duration=800)),hydrateKeyframes(Cr),isTransitionDefined(Tr)||(Tr={...Tr,...getDefaultTransition($r,Cr.to)}),{...Cr,...convertTransitionToAnimationOptions(Tr)}}function isTransitionDefined({delay:Tr,repeat:Cr,repeatType:$r,repeatDelay:Ar,from:Rr,...Dr}){return!!Object.keys(Dr).length}function getValueTransition(Tr,Cr){return Tr[Cr]||Tr.default||Tr}function getAnimation(Tr,Cr,$r,Ar,Rr){const Dr=getValueTransition(Ar,Tr);let Mr=Dr.from===null||Dr.from===void 0?Cr.get():Dr.from;const Br=isAnimatable(Tr,$r);Mr==="none"&&Br&&typeof $r=="string"&&(Mr=getAnimatableNone(Tr,$r));const Nr=isAnimatable(Tr,Mr);function Lr(zr){const Ur={from:Mr,to:$r,velocity:Ar.velocity?Ar.velocity:Cr.getVelocity(),onUpdate:Vr=>Cr.set(Vr)};return Dr.type==="inertia"||Dr.type==="decay"?inertia({...Ur,...Dr}):animate({...getPopmotionAnimationOptions(Dr,Ur,Tr),onUpdate:Vr=>{Ur.onUpdate(Vr),Dr.onUpdate&&Dr.onUpdate(Vr)},onComplete:()=>{Ar.onComplete&&Ar.onComplete(),Rr&&Rr(),zr&&zr()}})}function Hr(zr){return Cr.set($r),Ar.onComplete&&Ar.onComplete(),Rr&&Rr(),zr&&zr(),{stop:()=>{}}}return!Nr||!Br||Dr.type===!1?Hr:Lr}function useMotionTransitions(){const{motionValues:Tr,stop:Cr,get:$r}=useMotionValues();return{motionValues:Tr,stop:Cr,push:(Rr,Dr,Mr,Br={},Nr)=>{const Lr=Mr[Rr],Hr=$r(Rr,Lr,Mr);if(Br&&Br.immediate){Hr.set(Dr);return}const zr=getAnimation(Rr,Hr,Dr,Br,Nr);Hr.start(zr)}}}function useMotionControls(Tr,Cr={},{motionValues:$r,push:Ar,stop:Rr}=useMotionTransitions()){const Dr=unref(Cr),Mr=ref(!1);watch($r,zr=>{Mr.value=Object.values(zr).filter(Ur=>Ur.isAnimating()).length>0},{immediate:!0,deep:!0});const Br=zr=>{if(!Dr||!Dr[zr])throw new Error(`The variant ${zr} does not exist.`);return Dr[zr]},Nr=zr=>(typeof zr=="string"&&(zr=Br(zr)),Promise.all(Object.entries(zr).map(([Ur,Vr])=>{if(Ur!=="transition")return new Promise(jr=>Ar(Ur,Vr,Tr,zr.transition||getDefaultTransition(Ur,zr[Ur]),jr))}).filter(Boolean)));return{isAnimating:Mr,apply:Nr,set:zr=>{const Ur=isObject$3(zr)?zr:Br(zr);Object.entries(Ur).forEach(([Vr,jr])=>{Vr!=="transition"&&Ar(Vr,jr,Tr,{immediate:!0})})},leave:async zr=>{let Ur;if(Dr&&(Dr.leave&&(Ur=Dr.leave),!Dr.leave&&Dr.initial&&(Ur=Dr.initial)),!Ur){zr();return}await Nr(Ur),zr()},stop:Rr}}const isBrowser$1=typeof window<"u",supportsPointerEvents=()=>isBrowser$1&&window.onpointerdown===null,supportsTouchEvents=()=>isBrowser$1&&window.ontouchstart===null,supportsMouseEvents=()=>isBrowser$1&&window.onmousedown===null;function registerEventListeners({target:Tr,state:Cr,variants:$r,apply:Ar}){const Rr=unref($r),Dr=ref(!1),Mr=ref(!1),Br=ref(!1),Nr=computed(()=>{let Hr=[];return Rr&&(Rr.hovered&&(Hr=[...Hr,...Object.keys(Rr.hovered)]),Rr.tapped&&(Hr=[...Hr,...Object.keys(Rr.tapped)]),Rr.focused&&(Hr=[...Hr,...Object.keys(Rr.focused)])),Hr}),Lr=computed(()=>{const Hr={};Object.assign(Hr,Cr.value),Dr.value&&Rr.hovered&&Object.assign(Hr,Rr.hovered),Mr.value&&Rr.tapped&&Object.assign(Hr,Rr.tapped),Br.value&&Rr.focused&&Object.assign(Hr,Rr.focused);for(const zr in Hr)Nr.value.includes(zr)||delete Hr[zr];return Hr});Rr.hovered&&(useEventListener(Tr,"mouseenter",()=>Dr.value=!0),useEventListener(Tr,"mouseleave",()=>{Dr.value=!1,Mr.value=!1}),useEventListener(Tr,"mouseout",()=>{Dr.value=!1,Mr.value=!1})),Rr.tapped&&(supportsMouseEvents()&&(useEventListener(Tr,"mousedown",()=>Mr.value=!0),useEventListener(Tr,"mouseup",()=>Mr.value=!1)),supportsPointerEvents()&&(useEventListener(Tr,"pointerdown",()=>Mr.value=!0),useEventListener(Tr,"pointerup",()=>Mr.value=!1)),supportsTouchEvents()&&(useEventListener(Tr,"touchstart",()=>Mr.value=!0),useEventListener(Tr,"touchend",()=>Mr.value=!1))),Rr.focused&&(useEventListener(Tr,"focus",()=>Br.value=!0),useEventListener(Tr,"blur",()=>Br.value=!1)),watch(Lr,Ar)}function registerLifeCycleHooks({set:Tr,target:Cr,variants:$r,variant:Ar}){const Rr=unref($r);watch(()=>Cr,()=>{Rr&&(Rr.initial&&Tr("initial"),Rr.enter&&(Ar.value="enter"))},{immediate:!0,flush:"pre"})}function registerVariantsSync({state:Tr,apply:Cr}){watch(Tr,$r=>{$r&&Cr($r)},{immediate:!0})}function registerVisibilityHooks({target:Tr,variants:Cr,variant:$r}){const Ar=unref(Cr);Ar&&(Ar.visible||Ar.visibleOnce)&&useIntersectionObserver(Tr,([{isIntersecting:Rr}])=>{Ar.visible?Rr?$r.value="visible":$r.value="initial":Ar.visibleOnce&&(Rr&&$r.value!=="visibleOnce"?$r.value="visibleOnce":$r.value||($r.value="initial"))})}function useMotionFeatures(Tr,Cr={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){Cr.lifeCycleHooks&®isterLifeCycleHooks(Tr),Cr.syncVariants&®isterVariantsSync(Tr),Cr.visibilityHooks&®isterVisibilityHooks(Tr),Cr.eventListeners&®isterEventListeners(Tr)}function reactiveStyle(Tr={}){const Cr=reactive({...Tr}),$r=ref({});return watch(Cr,()=>{const Ar={};for(const[Rr,Dr]of Object.entries(Cr)){const Mr=getValueType(Rr),Br=getValueAsType(Dr,Mr);Ar[Rr]=Br}$r.value=Ar},{immediate:!0,deep:!0}),{state:Cr,style:$r}}function usePermissiveTarget(Tr,Cr){watch(()=>unrefElement(Tr),$r=>{$r&&Cr($r)},{immediate:!0})}const translateAlias={x:"translateX",y:"translateY",z:"translateZ"};function reactiveTransform(Tr={},Cr=!0){const $r=reactive({...Tr}),Ar=ref("");return watch($r,Rr=>{let Dr="",Mr=!1;if(Cr&&(Rr.x||Rr.y||Rr.z)){const Br=[Rr.x||0,Rr.y||0,Rr.z||0].map(px.transform).join(",");Dr+=`translate3d(${Br}) `,Mr=!0}for(const[Br,Nr]of Object.entries(Rr)){if(Cr&&(Br==="x"||Br==="y"||Br==="z"))continue;const Lr=getValueType(Br),Hr=getValueAsType(Nr,Lr);Dr+=`${translateAlias[Br]||Br}(${Hr}) `}Cr&&!Mr&&(Dr+="translateZ(0px) "),Ar.value=Dr.trim()},{immediate:!0,deep:!0}),{state:$r,transform:Ar}}const transformAxes=["","X","Y","Z"],order$1=["perspective","translate","scale","rotate","skew"],transformProps=["transformPerspective","x","y","z"];order$1.forEach(Tr=>{transformAxes.forEach(Cr=>{const $r=Tr+Cr;transformProps.push($r)})});const transformPropSet=new Set(transformProps);function isTransformProp(Tr){return transformPropSet.has(Tr)}const transformOriginProps=new Set(["originX","originY","originZ"]);function isTransformOriginProp(Tr){return transformOriginProps.has(Tr)}function splitValues(Tr){const Cr={},$r={};return Object.entries(Tr).forEach(([Ar,Rr])=>{isTransformProp(Ar)||isTransformOriginProp(Ar)?Cr[Ar]=Rr:$r[Ar]=Rr}),{transform:Cr,style:$r}}function variantToStyle(Tr){const{transform:Cr,style:$r}=splitValues(Tr),{transform:Ar}=reactiveTransform(Cr),{style:Rr}=reactiveStyle($r);return Ar.value&&(Rr.value.transform=Ar.value),Rr.value}function useElementStyle(Tr,Cr){let $r,Ar;const{state:Rr,style:Dr}=reactiveStyle();return usePermissiveTarget(Tr,Mr=>{Ar=Mr;for(const Br of Object.keys(valueTypes))Mr.style[Br]===null||Mr.style[Br]===""||isTransformProp(Br)||isTransformOriginProp(Br)||(Rr[Br]=Mr.style[Br]);$r&&Object.entries($r).forEach(([Br,Nr])=>Mr.style[Br]=Nr),Cr&&Cr(Rr)}),watch(Dr,Mr=>{if(!Ar){$r=Mr;return}for(const Br in Mr)Ar.style[Br]=Mr[Br]},{immediate:!0}),{style:Rr}}function parseTransform(Tr){const Cr=Tr.trim().split(/\) |\)/);if(Cr.length===1)return{};const $r=Ar=>Ar.endsWith("px")||Ar.endsWith("deg")?parseFloat(Ar):isNaN(Number(Ar))?Number(Ar):Ar;return Cr.reduce((Ar,Rr)=>{if(!Rr)return Ar;const[Dr,Mr]=Rr.split("("),Nr=Mr.split(",").map(Hr=>$r(Hr.endsWith(")")?Hr.replace(")",""):Hr.trim())),Lr=Nr.length===1?Nr[0]:Nr;return{...Ar,[Dr]:Lr}},{})}function stateFromTransform(Tr,Cr){Object.entries(parseTransform(Cr)).forEach(([$r,Ar])=>{const Rr=["x","y","z"];if($r==="translate3d"){if(Ar===0){Rr.forEach(Dr=>Tr[Dr]=0);return}Ar.forEach((Dr,Mr)=>Tr[Rr[Mr]]=Dr);return}if(Ar=parseFloat(Ar),$r==="translateX"){Tr.x=Ar;return}if($r==="translateY"){Tr.y=Ar;return}if($r==="translateZ"){Tr.z=Ar;return}Tr[$r]=Ar})}function useElementTransform(Tr,Cr){let $r,Ar;const{state:Rr,transform:Dr}=reactiveTransform();return usePermissiveTarget(Tr,Mr=>{Ar=Mr,Mr.style.transform&&stateFromTransform(Rr,Mr.style.transform),$r&&(Mr.style.transform=$r),Cr&&Cr(Rr)}),watch(Dr,Mr=>{if(!Ar){$r=Mr;return}Ar.style.transform=Mr},{immediate:!0}),{transform:Rr}}function useMotionProperties(Tr,Cr){const $r=reactive({}),Ar=Mr=>Object.entries(Mr).forEach(([Br,Nr])=>$r[Br]=Nr),{style:Rr}=useElementStyle(Tr,Ar),{transform:Dr}=useElementTransform(Tr,Ar);return watch($r,Mr=>{Object.entries(Mr).forEach(([Br,Nr])=>{const Lr=isTransformProp(Br)?Dr:Rr;Lr[Br]&&Lr[Br]===Nr||(Lr[Br]=Nr)})},{immediate:!0,deep:!0}),usePermissiveTarget(Tr,()=>Cr&&Ar(Cr)),{motionProperties:$r,style:Rr,transform:Dr}}function useMotionVariants(Tr={}){const Cr=unref(Tr),$r=ref();return{state:computed(()=>{if($r.value)return Cr[$r.value]}),variant:$r}}function useMotion(Tr,Cr={},$r){const{motionProperties:Ar}=useMotionProperties(Tr),{variant:Rr,state:Dr}=useMotionVariants(Cr),Mr=useMotionControls(Ar,Cr),Br={target:Tr,variant:Rr,variants:Cr,state:Dr,motionProperties:Ar,...Mr};return useMotionFeatures(Br,$r),Br}const directivePropsKeys=["initial","enter","leave","visible","visible-once","hovered","tapped","focused","delay"];function resolveVariants(Tr,Cr){const $r=Tr.props?Tr.props:Tr.data&&Tr.data.attrs?Tr.data.attrs:{};$r&&($r.variants&&isObject$3($r.variants)&&(Cr.value={...Cr.value,...$r.variants}),directivePropsKeys.forEach(Ar=>{if(Ar==="delay"){if($r&&$r[Ar]&&typeof $r[Ar]=="number"){const Rr=$r[Ar];Cr&&Cr.value&&(Cr.value.enter&&(Cr.value.enter.transition||(Cr.value.enter.transition={}),Cr.value.enter.transition={delay:Rr,...Cr.value.enter.transition}),Cr.value.visible&&(Cr.value.visible.transition||(Cr.value.visible.transition={}),Cr.value.visible.transition={delay:Rr,...Cr.value.visible.transition}),Cr.value.visibleOnce&&(Cr.value.visibleOnce.transition||(Cr.value.visibleOnce.transition={}),Cr.value.visibleOnce.transition={delay:Rr,...Cr.value.visibleOnce.transition}))}return}Ar==="visible-once"&&(Ar="visibleOnce"),$r&&$r[Ar]&&isObject$3($r[Ar])&&(Cr.value[Ar]=$r[Ar])}))}function directive(Tr){return{created:($r,Ar,Rr)=>{const Dr=Ar.value&&typeof Ar.value=="string"?Ar.value:Rr.key;Dr&&motionState[Dr]&&motionState[Dr].stop();const Mr=ref(Tr||{});typeof Ar.value=="object"&&(Mr.value=Ar.value),resolveVariants(Rr,Mr);const Br=useMotion($r,Mr);$r.motionInstance=Br,Dr&&(motionState[Dr]=Br)},getSSRProps($r,Ar){let{initial:Rr}=$r.value||Ar&&(Ar==null?void 0:Ar.props)||{};Rr=unref(Rr);const Dr=defu((Tr==null?void 0:Tr.initial)||{},Rr||{});return!Dr||Object.keys(Dr).length===0?void 0:{style:variantToStyle(Dr)}}}}const fade={initial:{opacity:0},enter:{opacity:1}},fadeVisible={initial:{opacity:0},visible:{opacity:1}},fadeVisibleOnce={initial:{opacity:0},visibleOnce:{opacity:1}},pop={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},popVisible={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},popVisibleOnce={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},rollLeft={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},rollVisibleLeft={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},rollVisibleOnceLeft={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},rollRight={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},rollVisibleRight={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},rollVisibleOnceRight={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},rollTop={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},rollVisibleTop={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},rollVisibleOnceTop={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},rollBottom={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},rollVisibleBottom={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},rollVisibleOnceBottom={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},slideLeft={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},slideVisibleLeft={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},slideVisibleOnceLeft={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},slideRight={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},slideVisibleRight={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},slideVisibleOnceRight={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},slideTop={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},slideVisibleTop={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},slideVisibleOnceTop={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},slideBottom={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},slideVisibleBottom={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},slideVisibleOnceBottom={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},presets={__proto__:null,fade,fadeVisible,fadeVisibleOnce,pop,popVisible,popVisibleOnce,rollBottom,rollLeft,rollRight,rollTop,rollVisibleBottom,rollVisibleLeft,rollVisibleOnceBottom,rollVisibleOnceLeft,rollVisibleOnceRight,rollVisibleOnceTop,rollVisibleRight,rollVisibleTop,slideBottom,slideLeft,slideRight,slideTop,slideVisibleBottom,slideVisibleLeft,slideVisibleOnceBottom,slideVisibleOnceLeft,slideVisibleOnceRight,slideVisibleOnceTop,slideVisibleRight,slideVisibleTop},component=defineComponent({props:{is:{type:[String,Object],required:!1},preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1}},setup(Tr){var Br;const Cr=useSlots(),$r=reactive({});if(!Tr.is&&!Cr.default)return()=>h$5("div",{});const Ar=computed(()=>{let Nr;return Tr.preset&&(Nr=presets[Tr.preset]),Nr}),Rr=computed(()=>({initial:Tr.initial,enter:Tr.enter,leave:Tr.leave,visible:Tr.visible,visibleOnce:Tr.visibleOnce,hovered:Tr.hovered,tapped:Tr.tapped,focused:Tr.focused})),Dr=computed(()=>{const Nr={...Rr.value,...Ar.value||{},...Tr.variants||{}};return Tr.delay&&(Nr.enter.transition={...Nr.enter.transition},Nr.enter.transition.delay=parseInt(Tr.delay)),Nr}),Mr=computed(()=>{if(!Tr.is)return;let Nr=Tr.is;return typeof Mr.value=="string"&&!isHTMLTag(Nr)&&(Nr=resolveComponent(Nr)),Nr});if(((Br=process==null?void 0:process.env)==null?void 0:Br.NODE_ENV)==="development"||process!=null&&process.dev){const Nr=Lr=>{var Hr;(Hr=Lr.variants)!=null&&Hr.initial&&Lr.set("initial"),setTimeout(()=>{var zr,Ur,Vr;(zr=Lr.variants)!=null&&zr.enter&&Lr.apply("enter"),(Ur=Lr.variants)!=null&&Ur.visible&&Lr.apply("visible"),(Vr=Lr.variants)!=null&&Vr.visibleOnce&&Lr.apply("visibleOnce")},10)};onUpdated(()=>Object.entries($r).forEach(([Lr,Hr])=>Nr(Hr)))}return{slots:Cr,component:Mr,motionConfig:Dr,instances:$r}},render({slots:Tr,motionConfig:Cr,instances:$r,component:Ar}){var Br;const Rr=variantToStyle(Cr.initial||{}),Dr=(Nr,Lr)=>(Nr.props||(Nr.props={}),Nr.props.style=Rr,Nr.props.onVnodeMounted=({el:Hr})=>{const zr=useMotion(Hr,Cr);$r[Lr]=zr},Nr);if(Ar){const Nr=h$5(Ar,void 0,Tr);return Dr(Nr,0),Nr}return(((Br=Tr.default)==null?void 0:Br.call(Tr))||[]).map((Nr,Lr)=>Dr(Nr,Lr))}});function slugify(Tr){const Cr="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",$r="aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------",Ar=new RegExp(Cr.split("").join("|"),"g");return Tr.toString().replace(/[A-Z]/g,Rr=>`-${Rr}`).toLowerCase().replace(/\s+/g,"-").replace(Ar,Rr=>$r.charAt(Cr.indexOf(Rr))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}const MotionPlugin={install(Tr,Cr){if(Tr.directive("motion",directive()),Tr.component("Motion",component),!Cr||Cr&&!Cr.excludePresets)for(const $r in presets){const Ar=presets[$r];Tr.directive(`motion-${slugify($r)}`,directive(Ar))}if(Cr&&Cr.directives)for(const $r in Cr.directives){const Ar=Cr.directives[$r];!Ar.initial&&__DEV__&&console.warn(`Your directive v-motion-${$r} is missing initial variant!`),Tr.directive(`motion-${$r}`,directive(Ar))}}},cache={};function filterAttrs(Tr){return Object.keys(Tr).reduce((Cr,$r)=>(Tr[$r]!==!1&&Tr[$r]!==null&&Tr[$r]!==void 0&&(Cr[$r]=Tr[$r]),Cr),{})}const InlineSvg={name:"InlineSvg",inheritAttrs:!1,render(){return this.svgElSource?h$5("svg",Object.assign({},this.getSvgAttrs(this.svgElSource),filterAttrs(this.$attrs),{innerHTML:this.getSvgContent(this.svgElSource)})):null},props:{src:{type:String,required:!0},title:{type:String},transformSource:{type:Function,default:Tr=>Tr},keepDuringLoading:{type:Boolean,default:!0}},emits:["loaded","unloaded","error"],data(){return{svgElSource:null}},watch:{src(Tr){this.getSource(Tr)}},mounted(){this.getSource(this.src)},methods:{getSvgAttrs(Tr){let Cr={};const $r=Tr.attributes;if(!$r)return Cr;for(let Ar=$r.length-1;Ar>=0;Ar--)Cr[$r[Ar].name]=$r[Ar].value;return Cr},getSvgContent(Tr){return Tr=Tr.cloneNode(!0),Tr=this.transformSource(Tr),this.title&&setTitle(Tr,this.title),Tr.innerHTML},getSource(Tr){cache[Tr]||(cache[Tr]=this.download(Tr)),this.svgElSource&&cache[Tr].isPending()&&!this.keepDuringLoading&&(this.svgElSource=null,this.$emit("unloaded")),cache[Tr].then(Cr=>{this.svgElSource=Cr,this.$nextTick(()=>{this.$emit("loaded",this.$el)})}).catch(Cr=>{this.svgElSource&&(this.svgElSource=null,this.$emit("unloaded")),delete cache[Tr],this.$emit("error",Cr)})},download(Tr){return makePromiseState(new Promise((Cr,$r)=>{const Ar=new XMLHttpRequest;Ar.open("GET",Tr,!0),Ar.onload=()=>{if(Ar.status>=200&&Ar.status<400)try{let Mr=new DOMParser().parseFromString(Ar.responseText,"text/xml").getElementsByTagName("svg")[0];Mr?Cr(Mr):$r(new Error('Loaded file is not valid SVG"'))}catch(Rr){$r(Rr)}else $r(new Error("Error loading SVG"))},Ar.onerror=$r,Ar.send()}))}}};function setTitle(Tr,Cr){const $r=Tr.getElementsByTagName("title");if($r.length)$r[0].textContent=Cr;else{const Ar=document.createElementNS("http://www.w3.org/2000/svg","title");Ar.textContent=Cr,Tr.appendChild(Ar)}}function makePromiseState(Tr){if(Tr.isPending)return Tr;let Cr=!0,$r=Tr.then(Ar=>(Cr=!1,Ar),Ar=>{throw Cr=!1,Ar});return $r.isPending=function(){return Cr},$r}var showdown$1={exports:{}};(function(Tr){(function(){function Cr(Wr){var Yr={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,description:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,description:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,description:"Parses simple line breaks as
(GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex:
foo
",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `` and ``",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including ``, `` and `` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(Wr===!1)return JSON.parse(JSON.stringify(Yr));var Jr={};for(var no in Yr)Yr.hasOwnProperty(no)&&(Jr[no]=Yr[no].defaultValue);return Jr}function $r(){var Wr=Cr(!0),Yr={};for(var Jr in Wr)Wr.hasOwnProperty(Jr)&&(Yr[Jr]=!0);return Yr}var Ar={},Rr={},Dr={},Mr=Cr(!0),Br="vanilla",Nr={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:Cr(!0),allOn:$r()};Ar.helper={},Ar.extensions={},Ar.setOption=function(Wr,Yr){return Mr[Wr]=Yr,this},Ar.getOption=function(Wr){return Mr[Wr]},Ar.getOptions=function(){return Mr},Ar.resetOptions=function(){Mr=Cr(!0)},Ar.setFlavor=function(Wr){if(!Nr.hasOwnProperty(Wr))throw Error(Wr+" flavor was not found");Ar.resetOptions();var Yr=Nr[Wr];Br=Wr;for(var Jr in Yr)Yr.hasOwnProperty(Jr)&&(Mr[Jr]=Yr[Jr])},Ar.getFlavor=function(){return Br},Ar.getFlavorOptions=function(Wr){if(Nr.hasOwnProperty(Wr))return Nr[Wr]},Ar.getDefaultOptions=function(Wr){return Cr(Wr)},Ar.subParser=function(Wr,Yr){if(Ar.helper.isString(Wr))if(typeof Yr<"u")Rr[Wr]=Yr;else{if(Rr.hasOwnProperty(Wr))return Rr[Wr];throw Error("SubParser named "+Wr+" not registered!")}},Ar.extension=function(Wr,Yr){if(!Ar.helper.isString(Wr))throw Error("Extension 'name' must be a string");if(Wr=Ar.helper.stdExtName(Wr),Ar.helper.isUndefined(Yr)){if(!Dr.hasOwnProperty(Wr))throw Error("Extension named "+Wr+" is not registered!");return Dr[Wr]}else{typeof Yr=="function"&&(Yr=Yr()),Ar.helper.isArray(Yr)||(Yr=[Yr]);var Jr=Lr(Yr,Wr);if(Jr.valid)Dr[Wr]=Yr;else throw Error(Jr.error)}},Ar.getAllExtensions=function(){return Dr},Ar.removeExtension=function(Wr){delete Dr[Wr]},Ar.resetExtensions=function(){Dr={}};function Lr(Wr,Yr){var Jr=Yr?"Error in "+Yr+" extension->":"Error in unnamed extension",no={valid:!0,error:""};Ar.helper.isArray(Wr)||(Wr=[Wr]);for(var ro=0;ro"u"},Ar.helper.forEach=function(Wr,Yr){if(Ar.helper.isUndefined(Wr))throw new Error("obj param is required");if(Ar.helper.isUndefined(Yr))throw new Error("callback param is required");if(!Ar.helper.isFunction(Yr))throw new Error("callback param must be a function/closure");if(typeof Wr.forEach=="function")Wr.forEach(Yr);else if(Ar.helper.isArray(Wr))for(var Jr=0;Jr").replace(/&/g,"&")};var zr=function(Wr,Yr,Jr,no){var ro=no||"",so=ro.indexOf("g")>-1,ao=new RegExp(Yr+"|"+Jr,"g"+ro.replace(/g/g,"")),lo=new RegExp(Yr,ro.replace(/g/g,"")),po=[],go,co,mo,io,uo;do for(go=0;mo=ao.exec(Wr);)if(lo.test(mo[0]))go++||(co=ao.lastIndex,io=co-mo[0].length);else if(go&&!--go){uo=mo.index+mo[0].length;var ho={left:{start:io,end:co},match:{start:co,end:mo.index},right:{start:mo.index,end:uo},wholeMatch:{start:io,end:uo}};if(po.push(ho),!so)return po}while(go&&(ao.lastIndex=co));return po};Ar.helper.matchRecursiveRegExp=function(Wr,Yr,Jr,no){for(var ro=zr(Wr,Yr,Jr,no),so=[],ao=0;ao0){var go=[];ao[0].wholeMatch.start!==0&&go.push(Wr.slice(0,ao[0].wholeMatch.start));for(var co=0;co=0?no+(Jr||0):no},Ar.helper.splitAtIndex=function(Wr,Yr){if(!Ar.helper.isString(Wr))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[Wr.substring(0,Yr),Wr.substring(Yr)]},Ar.helper.encodeEmailAddress=function(Wr){var Yr=[function(Jr){return"&#"+Jr.charCodeAt(0)+";"},function(Jr){return"&#x"+Jr.charCodeAt(0).toString(16)+";"},function(Jr){return Jr}];return Wr=Wr.replace(/./g,function(Jr){if(Jr==="@")Jr=Yr[Math.floor(Math.random()*2)](Jr);else{var no=Math.random();Jr=no>.9?Yr[2](Jr):no>.45?Yr[1](Jr):Yr[0](Jr)}return Jr}),Wr},Ar.helper.padEnd=function(Yr,Jr,no){return Jr=Jr>>0,no=String(no||" "),Yr.length>Jr?String(Yr):(Jr=Jr-Yr.length,Jr>no.length&&(no+=no.repeat(Jr/no.length)),String(Yr)+no.slice(0,Jr))},typeof console>"u"&&(console={warn:function(Wr){alert(Wr)},log:function(Wr){alert(Wr)},error:function(Wr){throw Wr}}),Ar.helper.regexes={asteriskDashAndColon:/([*_:~])/g},Ar.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:':octocat:',showdown:`S`},Ar.Converter=function(Wr){var Yr={},Jr=[],no=[],ro={},so=Br,ao={parsed:{},raw:"",format:""};lo();function lo(){Wr=Wr||{};for(var io in Mr)Mr.hasOwnProperty(io)&&(Yr[io]=Mr[io]);if(typeof Wr=="object")for(var uo in Wr)Wr.hasOwnProperty(uo)&&(Yr[uo]=Wr[uo]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof Wr+" was passed instead.");Yr.extensions&&Ar.helper.forEach(Yr.extensions,po)}function po(io,uo){if(uo=uo||null,Ar.helper.isString(io))if(io=Ar.helper.stdExtName(io),uo=io,Ar.extensions[io]){console.warn("DEPRECATION WARNING: "+io+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),go(Ar.extensions[io],io);return}else if(!Ar.helper.isUndefined(Dr[io]))io=Dr[io];else throw Error('Extension "'+io+'" could not be loaded. It was either not found or is not a valid extension.');typeof io=="function"&&(io=io()),Ar.helper.isArray(io)||(io=[io]);var ho=Lr(io,uo);if(!ho.valid)throw Error(ho.error);for(var yo=0;yo[ \t]+¨NBSP;<"),!uo)if(window&&window.document)uo=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var ho=uo.createElement("div");ho.innerHTML=io;var yo={preList:No(ho)};Go(ho);for(var So=ho.childNodes,ko="",$o=0;$o'}else Ro.push(Mo[Ao].innerHTML),Mo[Ao].innerHTML="",Mo[Ao].setAttribute("prenum",Ao.toString());return Ro}return ko},this.setOption=function(io,uo){Yr[io]=uo},this.getOption=function(io){return Yr[io]},this.getOptions=function(){return Yr},this.addExtension=function(io,uo){uo=uo||null,po(io,uo)},this.useExtension=function(io){po(io)},this.setFlavor=function(io){if(!Nr.hasOwnProperty(io))throw Error(io+" flavor was not found");var uo=Nr[io];so=io;for(var ho in uo)uo.hasOwnProperty(ho)&&(Yr[ho]=uo[ho])},this.getFlavor=function(){return so},this.removeExtension=function(io){Ar.helper.isArray(io)||(io=[io]);for(var uo=0;uo? ?(['"].*['"])?\)$/m)>-1)lo="";else if(!lo)if(ao||(ao=so.toLowerCase().replace(/ ?\n/g," ")),lo="#"+ao,!Ar.helper.isUndefined(Jr.gUrls[ao]))lo=Jr.gUrls[ao],Ar.helper.isUndefined(Jr.gTitles[ao])||(co=Jr.gTitles[ao]);else return ro;lo=lo.replace(Ar.helper.regexes.asteriskDashAndColon,Ar.helper.escapeCharactersCallback);var mo='",mo};return Wr=Wr.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,no),Wr=Wr.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,no),Wr=Wr.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]??(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,no),Wr=Wr.replace(/\[([^\[\]]+)]()()()()()/g,no),Yr.ghMentions&&(Wr=Wr.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(ro,so,ao,lo,po){if(ao==="\\")return so+lo;if(!Ar.helper.isString(Yr.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var go=Yr.ghMentionsLink.replace(/\{u}/g,po),co="";return Yr.openLinksInNewWindow&&(co=' rel="noopener noreferrer" target="¨E95Eblank"'),so+'"+lo+""})),Wr=Jr.converter._dispatch("anchors.after",Wr,Yr,Jr),Wr});var Ur=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,Vr=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,jr=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,Gr=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,Xr=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,Kr=function(Wr){return function(Yr,Jr,no,ro,so,ao,lo){no=no.replace(Ar.helper.regexes.asteriskDashAndColon,Ar.helper.escapeCharactersCallback);var po=no,go="",co="",mo=Jr||"",io=lo||"";return/^www\./i.test(no)&&(no=no.replace(/^www\./i,"http://www.")),Wr.excludeTrailingPunctuationFromURLs&&ao&&(go=ao),Wr.openLinksInNewWindow&&(co=' rel="noopener noreferrer" target="¨E95Eblank"'),mo+'"+po+""+go+io}},Zr=function(Wr,Yr){return function(Jr,no,ro){var so="mailto:";return no=no||"",ro=Ar.subParser("unescapeSpecialChars")(ro,Wr,Yr),Wr.encodeEmails?(so=Ar.helper.encodeEmailAddress(so+ro),ro=Ar.helper.encodeEmailAddress(ro)):so=so+ro,no+''+ro+""}};Ar.subParser("autoLinks",function(Wr,Yr,Jr){return Wr=Jr.converter._dispatch("autoLinks.before",Wr,Yr,Jr),Wr=Wr.replace(jr,Kr(Yr)),Wr=Wr.replace(Xr,Zr(Yr,Jr)),Wr=Jr.converter._dispatch("autoLinks.after",Wr,Yr,Jr),Wr}),Ar.subParser("simplifiedAutoLinks",function(Wr,Yr,Jr){return Yr.simplifiedAutoLink&&(Wr=Jr.converter._dispatch("simplifiedAutoLinks.before",Wr,Yr,Jr),Yr.excludeTrailingPunctuationFromURLs?Wr=Wr.replace(Vr,Kr(Yr)):Wr=Wr.replace(Ur,Kr(Yr)),Wr=Wr.replace(Gr,Zr(Yr,Jr)),Wr=Jr.converter._dispatch("simplifiedAutoLinks.after",Wr,Yr,Jr)),Wr}),Ar.subParser("blockGamut",function(Wr,Yr,Jr){return Wr=Jr.converter._dispatch("blockGamut.before",Wr,Yr,Jr),Wr=Ar.subParser("blockQuotes")(Wr,Yr,Jr),Wr=Ar.subParser("headers")(Wr,Yr,Jr),Wr=Ar.subParser("horizontalRule")(Wr,Yr,Jr),Wr=Ar.subParser("lists")(Wr,Yr,Jr),Wr=Ar.subParser("codeBlocks")(Wr,Yr,Jr),Wr=Ar.subParser("tables")(Wr,Yr,Jr),Wr=Ar.subParser("hashHTMLBlocks")(Wr,Yr,Jr),Wr=Ar.subParser("paragraphs")(Wr,Yr,Jr),Wr=Jr.converter._dispatch("blockGamut.after",Wr,Yr,Jr),Wr}),Ar.subParser("blockQuotes",function(Wr,Yr,Jr){Wr=Jr.converter._dispatch("blockQuotes.before",Wr,Yr,Jr),Wr=Wr+` `;var no=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return Yr.splitAdjacentBlockquotes&&(no=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),Wr=Wr.replace(no,function(ro){return ro=ro.replace(/^[ \t]*>[ \t]?/gm,""),ro=ro.replace(/¨0/g,""),ro=ro.replace(/^[ \t]+$/gm,""),ro=Ar.subParser("githubCodeBlocks")(ro,Yr,Jr),ro=Ar.subParser("blockGamut")(ro,Yr,Jr),ro=ro.replace(/(^|\n)/g,"$1 "),ro=ro.replace(/(\s*
[^\r]+?<\/pre>)/gm,function(so,ao){var lo=ao;return lo=lo.replace(/^  /mg,"¨0"),lo=lo.replace(/¨0/g,""),lo}),Ar.subParser("hashBlock")(`
`+ro+`
`,Yr,Jr)}),Wr=Jr.converter._dispatch("blockQuotes.after",Wr,Yr,Jr),Wr}),Ar.subParser("codeBlocks",function(Wr,Yr,Jr){Wr=Jr.converter._dispatch("codeBlocks.before",Wr,Yr,Jr),Wr+="¨0";var no=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return Wr=Wr.replace(no,function(ro,so,ao){var lo=so,po=ao,go=` `;return lo=Ar.subParser("outdent")(lo,Yr,Jr),lo=Ar.subParser("encodeCode")(lo,Yr,Jr),lo=Ar.subParser("detab")(lo,Yr,Jr),lo=lo.replace(/^\n+/g,""),lo=lo.replace(/\n+$/g,""),Yr.omitExtraWLInCodeBlocks&&(go=""),lo="
"+lo+go+"
",Ar.subParser("hashBlock")(lo,Yr,Jr)+po}),Wr=Wr.replace(/¨0/,""),Wr=Jr.converter._dispatch("codeBlocks.after",Wr,Yr,Jr),Wr}),Ar.subParser("codeSpans",function(Wr,Yr,Jr){return Wr=Jr.converter._dispatch("codeSpans.before",Wr,Yr,Jr),typeof Wr>"u"&&(Wr=""),Wr=Wr.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(no,ro,so,ao){var lo=ao;return lo=lo.replace(/^([ \t]*)/g,""),lo=lo.replace(/[ \t]*$/g,""),lo=Ar.subParser("encodeCode")(lo,Yr,Jr),lo=ro+""+lo+"",lo=Ar.subParser("hashHTMLSpans")(lo,Yr,Jr),lo}),Wr=Jr.converter._dispatch("codeSpans.after",Wr,Yr,Jr),Wr}),Ar.subParser("completeHTMLDocument",function(Wr,Yr,Jr){if(!Yr.completeHTMLDocument)return Wr;Wr=Jr.converter._dispatch("completeHTMLDocument.before",Wr,Yr,Jr);var no="html",ro=` `,so="",ao=` `,lo="",po="";typeof Jr.metadata.parsed.doctype<"u"&&(ro=" `,no=Jr.metadata.parsed.doctype.toString().toLowerCase(),(no==="html"||no==="html5")&&(ao=''));for(var go in Jr.metadata.parsed)if(Jr.metadata.parsed.hasOwnProperty(go))switch(go.toLowerCase()){case"doctype":break;case"title":so=""+Jr.metadata.parsed.title+` `;break;case"charset":no==="html"||no==="html5"?ao=' `:ao=' `;break;case"language":case"lang":lo=' lang="'+Jr.metadata.parsed[go]+'"',po+=' `;break;default:po+=' `}return Wr=ro+" `+so+ao+po+` `+Wr.trim()+` `,Wr=Jr.converter._dispatch("completeHTMLDocument.after",Wr,Yr,Jr),Wr}),Ar.subParser("detab",function(Wr,Yr,Jr){return Wr=Jr.converter._dispatch("detab.before",Wr,Yr,Jr),Wr=Wr.replace(/\t(?=\t)/g," "),Wr=Wr.replace(/\t/g,"¨A¨B"),Wr=Wr.replace(/¨B(.+?)¨A/g,function(no,ro){for(var so=ro,ao=4-so.length%4,lo=0;lo/g,">"),Wr=Jr.converter._dispatch("encodeAmpsAndAngles.after",Wr,Yr,Jr),Wr}),Ar.subParser("encodeBackslashEscapes",function(Wr,Yr,Jr){return Wr=Jr.converter._dispatch("encodeBackslashEscapes.before",Wr,Yr,Jr),Wr=Wr.replace(/\\(\\)/g,Ar.helper.escapeCharactersCallback),Wr=Wr.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,Ar.helper.escapeCharactersCallback),Wr=Jr.converter._dispatch("encodeBackslashEscapes.after",Wr,Yr,Jr),Wr}),Ar.subParser("encodeCode",function(Wr,Yr,Jr){return Wr=Jr.converter._dispatch("encodeCode.before",Wr,Yr,Jr),Wr=Wr.replace(/&/g,"&").replace(//g,">").replace(/([*_{}\[\]\\=~-])/g,Ar.helper.escapeCharactersCallback),Wr=Jr.converter._dispatch("encodeCode.after",Wr,Yr,Jr),Wr}),Ar.subParser("escapeSpecialCharsWithinTagAttributes",function(Wr,Yr,Jr){Wr=Jr.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",Wr,Yr,Jr);var no=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,ro=/-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return Wr=Wr.replace(no,function(so){return so.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,Ar.helper.escapeCharactersCallback)}),Wr=Wr.replace(ro,function(so){return so.replace(/([\\`*_~=|])/g,Ar.helper.escapeCharactersCallback)}),Wr=Jr.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",Wr,Yr,Jr),Wr}),Ar.subParser("githubCodeBlocks",function(Wr,Yr,Jr){return Yr.ghCodeBlocks?(Wr=Jr.converter._dispatch("githubCodeBlocks.before",Wr,Yr,Jr),Wr+="¨0",Wr=Wr.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(no,ro,so,ao){var lo=Yr.omitExtraWLInCodeBlocks?"":` `;return ao=Ar.subParser("encodeCode")(ao,Yr,Jr),ao=Ar.subParser("detab")(ao,Yr,Jr),ao=ao.replace(/^\n+/g,""),ao=ao.replace(/\n+$/g,""),ao="
"+ao+lo+"
",ao=Ar.subParser("hashBlock")(ao,Yr,Jr),` ¨G`+(Jr.ghCodeBlocks.push({text:no,codeblock:ao})-1)+`G `}),Wr=Wr.replace(/¨0/,""),Jr.converter._dispatch("githubCodeBlocks.after",Wr,Yr,Jr)):Wr}),Ar.subParser("hashBlock",function(Wr,Yr,Jr){return Wr=Jr.converter._dispatch("hashBlock.before",Wr,Yr,Jr),Wr=Wr.replace(/(^\n+|\n+$)/g,""),Wr=` ¨K`+(Jr.gHtmlBlocks.push(Wr)-1)+`K `,Wr=Jr.converter._dispatch("hashBlock.after",Wr,Yr,Jr),Wr}),Ar.subParser("hashCodeTags",function(Wr,Yr,Jr){Wr=Jr.converter._dispatch("hashCodeTags.before",Wr,Yr,Jr);var no=function(ro,so,ao,lo){var po=ao+Ar.subParser("encodeCode")(so,Yr,Jr)+lo;return"¨C"+(Jr.gHtmlSpans.push(po)-1)+"C"};return Wr=Ar.helper.replaceRecursiveRegExp(Wr,no,"]*>","","gim"),Wr=Jr.converter._dispatch("hashCodeTags.after",Wr,Yr,Jr),Wr}),Ar.subParser("hashElement",function(Wr,Yr,Jr){return function(no,ro){var so=ro;return so=so.replace(/\n\n/g,` `),so=so.replace(/^\n/,""),so=so.replace(/\n+$/g,""),so=` ¨K`+(Jr.gHtmlBlocks.push(so)-1)+`K `,so}}),Ar.subParser("hashHTMLBlocks",function(Wr,Yr,Jr){Wr=Jr.converter._dispatch("hashHTMLBlocks.before",Wr,Yr,Jr);var no=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],ro=function(io,uo,ho,yo){var So=io;return ho.search(/\bmarkdown\b/)!==-1&&(So=ho+Jr.converter.makeHtml(uo)+yo),` ¨K`+(Jr.gHtmlBlocks.push(So)-1)+`K `};Yr.backslashEscapesHTMLTags&&(Wr=Wr.replace(/\\<(\/?[^>]+?)>/g,function(io,uo){return"<"+uo+">"}));for(var so=0;so]*>)","im"),po="<"+no[so]+"\\b[^>]*>",go="";(ao=Ar.helper.regexIndexOf(Wr,lo))!==-1;){var co=Ar.helper.splitAtIndex(Wr,ao),mo=Ar.helper.replaceRecursiveRegExp(co[1],ro,po,go,"im");if(mo===co[1])break;Wr=co[0].concat(mo)}return Wr=Wr.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,Ar.subParser("hashElement")(Wr,Yr,Jr)),Wr=Ar.helper.replaceRecursiveRegExp(Wr,function(io){return` ¨K`+(Jr.gHtmlBlocks.push(io)-1)+`K `},"^ {0,3}","gm"),Wr=Wr.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,Ar.subParser("hashElement")(Wr,Yr,Jr)),Wr=Jr.converter._dispatch("hashHTMLBlocks.after",Wr,Yr,Jr),Wr}),Ar.subParser("hashHTMLSpans",function(Wr,Yr,Jr){Wr=Jr.converter._dispatch("hashHTMLSpans.before",Wr,Yr,Jr);function no(ro){return"¨C"+(Jr.gHtmlSpans.push(ro)-1)+"C"}return Wr=Wr.replace(/<[^>]+?\/>/gi,function(ro){return no(ro)}),Wr=Wr.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(ro){return no(ro)}),Wr=Wr.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(ro){return no(ro)}),Wr=Wr.replace(/<[^>]+?>/gi,function(ro){return no(ro)}),Wr=Jr.converter._dispatch("hashHTMLSpans.after",Wr,Yr,Jr),Wr}),Ar.subParser("unhashHTMLSpans",function(Wr,Yr,Jr){Wr=Jr.converter._dispatch("unhashHTMLSpans.before",Wr,Yr,Jr);for(var no=0;no]*>\\s*]*>","^ {0,3}\\s*
","gim"),Wr=Jr.converter._dispatch("hashPreCodeTags.after",Wr,Yr,Jr),Wr}),Ar.subParser("headers",function(Wr,Yr,Jr){Wr=Jr.converter._dispatch("headers.before",Wr,Yr,Jr);var no=isNaN(parseInt(Yr.headerLevelStart))?1:parseInt(Yr.headerLevelStart),ro=Yr.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,so=Yr.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;Wr=Wr.replace(ro,function(po,go){var co=Ar.subParser("spanGamut")(go,Yr,Jr),mo=Yr.noHeaderId?"":' id="'+lo(go)+'"',io=no,uo=""+co+"";return Ar.subParser("hashBlock")(uo,Yr,Jr)}),Wr=Wr.replace(so,function(po,go){var co=Ar.subParser("spanGamut")(go,Yr,Jr),mo=Yr.noHeaderId?"":' id="'+lo(go)+'"',io=no+1,uo=""+co+"";return Ar.subParser("hashBlock")(uo,Yr,Jr)});var ao=Yr.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;Wr=Wr.replace(ao,function(po,go,co){var mo=co;Yr.customizedHeaderId&&(mo=co.replace(/\s?\{([^{]+?)}\s*$/,""));var io=Ar.subParser("spanGamut")(mo,Yr,Jr),uo=Yr.noHeaderId?"":' id="'+lo(co)+'"',ho=no-1+go.length,yo=""+io+"";return Ar.subParser("hashBlock")(yo,Yr,Jr)});function lo(po){var go,co;if(Yr.customizedHeaderId){var mo=po.match(/\{([^{]+?)}\s*$/);mo&&mo[1]&&(po=mo[1])}return go=po,Ar.helper.isString(Yr.prefixHeaderId)?co=Yr.prefixHeaderId:Yr.prefixHeaderId===!0?co="section-":co="",Yr.rawPrefixHeaderId||(go=co+go),Yr.ghCompatibleHeaderId?go=go.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():Yr.rawHeaderId?go=go.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():go=go.replace(/[^\w]/g,"").toLowerCase(),Yr.rawPrefixHeaderId&&(go=co+go),Jr.hashLinkCounts[go]?go=go+"-"+Jr.hashLinkCounts[go]++:Jr.hashLinkCounts[go]=1,go}return Wr=Jr.converter._dispatch("headers.after",Wr,Yr,Jr),Wr}),Ar.subParser("horizontalRule",function(Wr,Yr,Jr){Wr=Jr.converter._dispatch("horizontalRule.before",Wr,Yr,Jr);var no=Ar.subParser("hashBlock")("
",Yr,Jr);return Wr=Wr.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,no),Wr=Wr.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,no),Wr=Wr.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,no),Wr=Jr.converter._dispatch("horizontalRule.after",Wr,Yr,Jr),Wr}),Ar.subParser("images",function(Wr,Yr,Jr){Wr=Jr.converter._dispatch("images.before",Wr,Yr,Jr);var no=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,ro=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,so=/!\[([^\]]*?)][ \t]*()\([ \t]??(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,ao=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,lo=/!\[([^\[\]]+)]()()()()()/g;function po(co,mo,io,uo,ho,yo,So,ko){return uo=uo.replace(/\s/g,""),go(co,mo,io,uo,ho,yo,So,ko)}function go(co,mo,io,uo,ho,yo,So,ko){var $o=Jr.gUrls,Go=Jr.gTitles,No=Jr.gDimensions;if(io=io.toLowerCase(),ko||(ko=""),co.search(/\(? ?(['"].*['"])?\)$/m)>-1)uo="";else if(uo===""||uo===null)if((io===""||io===null)&&(io=mo.toLowerCase().replace(/ ?\n/g," ")),uo="#"+io,!Ar.helper.isUndefined($o[io]))uo=$o[io],Ar.helper.isUndefined(Go[io])||(ko=Go[io]),Ar.helper.isUndefined(No[io])||(ho=No[io].width,yo=No[io].height);else return co;mo=mo.replace(/"/g,""").replace(Ar.helper.regexes.asteriskDashAndColon,Ar.helper.escapeCharactersCallback),uo=uo.replace(Ar.helper.regexes.asteriskDashAndColon,Ar.helper.escapeCharactersCallback);var Eo=''+mo+'","
")}),Wr=Wr.replace(/\b__(\S[\s\S]*?)__\b/g,function(ro,so){return no(so,"","")}),Wr=Wr.replace(/\b_(\S[\s\S]*?)_\b/g,function(ro,so){return no(so,"","")})):(Wr=Wr.replace(/___(\S[\s\S]*?)___/g,function(ro,so){return/\S$/.test(so)?no(so,"",""):ro}),Wr=Wr.replace(/__(\S[\s\S]*?)__/g,function(ro,so){return/\S$/.test(so)?no(so,"",""):ro}),Wr=Wr.replace(/_([^\s_][\s\S]*?)_/g,function(ro,so){return/\S$/.test(so)?no(so,"",""):ro})),Yr.literalMidWordAsterisks?(Wr=Wr.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(ro,so,ao){return no(ao,so+"","")}),Wr=Wr.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(ro,so,ao){return no(ao,so+"","")}),Wr=Wr.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(ro,so,ao){return no(ao,so+"","")})):(Wr=Wr.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(ro,so){return/\S$/.test(so)?no(so,"",""):ro}),Wr=Wr.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(ro,so){return/\S$/.test(so)?no(so,"",""):ro}),Wr=Wr.replace(/\*([^\s*][\s\S]*?)\*/g,function(ro,so){return/\S$/.test(so)?no(so,"",""):ro})),Wr=Jr.converter._dispatch("italicsAndBold.after",Wr,Yr,Jr),Wr}),Ar.subParser("lists",function(Wr,Yr,Jr){function no(ao,lo){Jr.gListLevel++,ao=ao.replace(/\n{2,}$/,` `),ao+="¨0";var po=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,go=/\n[ \t]*\n(?!¨0)/.test(ao);return Yr.disableForced4SpacesIndentedSublists&&(po=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),ao=ao.replace(po,function(co,mo,io,uo,ho,yo,So){So=So&&So.trim()!=="";var ko=Ar.subParser("outdent")(ho,Yr,Jr),$o="";return yo&&Yr.tasklists&&($o=' class="task-list-item" style="list-style-type: none;"',ko=ko.replace(/^[ \t]*\[(x|X| )?]/m,function(){var Go='-1?(ko=Ar.subParser("githubCodeBlocks")(ko,Yr,Jr),ko=Ar.subParser("blockGamut")(ko,Yr,Jr)):(ko=Ar.subParser("lists")(ko,Yr,Jr),ko=ko.replace(/\n$/,""),ko=Ar.subParser("hashHTMLBlocks")(ko,Yr,Jr),ko=ko.replace(/\n\n+/g,` `),go?ko=Ar.subParser("paragraphs")(ko,Yr,Jr):ko=Ar.subParser("spanGamut")(ko,Yr,Jr)),ko=ko.replace("¨A",""),ko=""+ko+` `,ko}),ao=ao.replace(/¨0/g,""),Jr.gListLevel--,lo&&(ao=ao.replace(/\s+$/,"")),ao}function ro(ao,lo){if(lo==="ol"){var po=ao.match(/^ *(\d+)\./);if(po&&po[1]!=="1")return' start="'+po[1]+'"'}return""}function so(ao,lo,po){var go=Yr.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,co=Yr.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,mo=lo==="ul"?go:co,io="";if(ao.search(mo)!==-1)(function ho(yo){var So=yo.search(mo),ko=ro(ao,lo);So!==-1?(io+=` <`+lo+ko+`> `+no(yo.slice(0,So),!!po)+" `,lo=lo==="ul"?"ol":"ul",mo=lo==="ul"?go:co,ho(yo.slice(So))):io+=` <`+lo+ko+`> `+no(yo,!!po)+" `})(ao);else{var uo=ro(ao,lo);io=` <`+lo+uo+`> `+no(ao,!!po)+" `}return io}return Wr=Jr.converter._dispatch("lists.before",Wr,Yr,Jr),Wr+="¨0",Jr.gListLevel?Wr=Wr.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(ao,lo,po){var go=po.search(/[*+-]/g)>-1?"ul":"ol";return so(lo,go,!0)}):Wr=Wr.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(ao,lo,po,go){var co=go.search(/[*+-]/g)>-1?"ul":"ol";return so(po,co,!1)}),Wr=Wr.replace(/¨0/,""),Wr=Jr.converter._dispatch("lists.after",Wr,Yr,Jr),Wr}),Ar.subParser("metadata",function(Wr,Yr,Jr){if(!Yr.metadata)return Wr;Wr=Jr.converter._dispatch("metadata.before",Wr,Yr,Jr);function no(ro){Jr.metadata.raw=ro,ro=ro.replace(/&/g,"&").replace(/"/g,"""),ro=ro.replace(/\n {4}/g," "),ro.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(so,ao,lo){return Jr.metadata.parsed[ao]=lo,""})}return Wr=Wr.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(ro,so,ao){return no(ao),"¨M"}),Wr=Wr.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(ro,so,ao){return so&&(Jr.metadata.format=so),no(ao),"¨M"}),Wr=Wr.replace(/¨M/g,""),Wr=Jr.converter._dispatch("metadata.after",Wr,Yr,Jr),Wr}),Ar.subParser("outdent",function(Wr,Yr,Jr){return Wr=Jr.converter._dispatch("outdent.before",Wr,Yr,Jr),Wr=Wr.replace(/^(\t|[ ]{1,4})/gm,"¨0"),Wr=Wr.replace(/¨0/g,""),Wr=Jr.converter._dispatch("outdent.after",Wr,Yr,Jr),Wr}),Ar.subParser("paragraphs",function(Wr,Yr,Jr){Wr=Jr.converter._dispatch("paragraphs.before",Wr,Yr,Jr),Wr=Wr.replace(/^\n+/g,""),Wr=Wr.replace(/\n+$/g,"");for(var no=Wr.split(/\n{2,}/g),ro=[],so=no.length,ao=0;ao=0?ro.push(lo):lo.search(/\S/)>=0&&(lo=Ar.subParser("spanGamut")(lo,Yr,Jr),lo=lo.replace(/^([ \t]*)/g,"

"),lo+="

",ro.push(lo))}for(so=ro.length,ao=0;ao]*>\s*]*>/.test(go)&&(co=!0)}ro[ao]=go}return Wr=ro.join(` `),Wr=Wr.replace(/^\n+/g,""),Wr=Wr.replace(/\n+$/g,""),Jr.converter._dispatch("paragraphs.after",Wr,Yr,Jr)}),Ar.subParser("runExtension",function(Wr,Yr,Jr,no){if(Wr.filter)Yr=Wr.filter(Yr,no.converter,Jr);else if(Wr.regex){var ro=Wr.regex;ro instanceof RegExp||(ro=new RegExp(ro,"g")),Yr=Yr.replace(ro,Wr.replace)}return Yr}),Ar.subParser("spanGamut",function(Wr,Yr,Jr){return Wr=Jr.converter._dispatch("spanGamut.before",Wr,Yr,Jr),Wr=Ar.subParser("codeSpans")(Wr,Yr,Jr),Wr=Ar.subParser("escapeSpecialCharsWithinTagAttributes")(Wr,Yr,Jr),Wr=Ar.subParser("encodeBackslashEscapes")(Wr,Yr,Jr),Wr=Ar.subParser("images")(Wr,Yr,Jr),Wr=Ar.subParser("anchors")(Wr,Yr,Jr),Wr=Ar.subParser("autoLinks")(Wr,Yr,Jr),Wr=Ar.subParser("simplifiedAutoLinks")(Wr,Yr,Jr),Wr=Ar.subParser("emoji")(Wr,Yr,Jr),Wr=Ar.subParser("underline")(Wr,Yr,Jr),Wr=Ar.subParser("italicsAndBold")(Wr,Yr,Jr),Wr=Ar.subParser("strikethrough")(Wr,Yr,Jr),Wr=Ar.subParser("ellipsis")(Wr,Yr,Jr),Wr=Ar.subParser("hashHTMLSpans")(Wr,Yr,Jr),Wr=Ar.subParser("encodeAmpsAndAngles")(Wr,Yr,Jr),Yr.simpleLineBreaks?/\n\n¨K/.test(Wr)||(Wr=Wr.replace(/\n+/g,`
`)):Wr=Wr.replace(/ +\n/g,`
`),Wr=Jr.converter._dispatch("spanGamut.after",Wr,Yr,Jr),Wr}),Ar.subParser("strikethrough",function(Wr,Yr,Jr){function no(ro){return Yr.simplifiedAutoLink&&(ro=Ar.subParser("simplifiedAutoLinks")(ro,Yr,Jr)),""+ro+""}return Yr.strikethrough&&(Wr=Jr.converter._dispatch("strikethrough.before",Wr,Yr,Jr),Wr=Wr.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(ro,so){return no(so)}),Wr=Jr.converter._dispatch("strikethrough.after",Wr,Yr,Jr)),Wr}),Ar.subParser("stripLinkDefinitions",function(Wr,Yr,Jr){var no=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,ro=/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;Wr+="¨0";var so=function(ao,lo,po,go,co,mo,io){return lo=lo.toLowerCase(),po.match(/^data:.+?\/.+?;base64,/)?Jr.gUrls[lo]=po.replace(/\s/g,""):Jr.gUrls[lo]=Ar.subParser("encodeAmpsAndAngles")(po,Yr,Jr),mo?mo+io:(io&&(Jr.gTitles[lo]=io.replace(/"|'/g,""")),Yr.parseImgDimensions&&go&&co&&(Jr.gDimensions[lo]={width:go,height:co}),"")};return Wr=Wr.replace(ro,so),Wr=Wr.replace(no,so),Wr=Wr.replace(/¨0/,""),Wr}),Ar.subParser("tables",function(Wr,Yr,Jr){if(!Yr.tables)return Wr;var no=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,ro=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function so(co){return/^:[ \t]*--*$/.test(co)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(co)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(co)?' style="text-align:center;"':""}function ao(co,mo){var io="";return co=co.trim(),(Yr.tablesHeaderId||Yr.tableHeaderId)&&(io=' id="'+co.replace(/ /g,"_").toLowerCase()+'"'),co=Ar.subParser("spanGamut")(co,Yr,Jr),""+co+` `}function lo(co,mo){var io=Ar.subParser("spanGamut")(co,Yr,Jr);return""+io+` `}function po(co,mo){for(var io=` `,uo=co.length,ho=0;ho `,ho=0;ho `;for(var yo=0;yo `}return io+=`
`,io}function go(co){var mo,io=co.split(` `);for(mo=0;mo"+ro+""}),Wr=Wr.replace(/\b__(\S[\s\S]*?)__\b/g,function(no,ro){return""+ro+""})):(Wr=Wr.replace(/___(\S[\s\S]*?)___/g,function(no,ro){return/\S$/.test(ro)?""+ro+"":no}),Wr=Wr.replace(/__(\S[\s\S]*?)__/g,function(no,ro){return/\S$/.test(ro)?""+ro+"":no})),Wr=Wr.replace(/(_)/g,Ar.helper.escapeCharactersCallback),Wr=Jr.converter._dispatch("underline.after",Wr,Yr,Jr)),Wr}),Ar.subParser("unescapeSpecialChars",function(Wr,Yr,Jr){return Wr=Jr.converter._dispatch("unescapeSpecialChars.before",Wr,Yr,Jr),Wr=Wr.replace(/¨E(\d+)E/g,function(no,ro){var so=parseInt(ro);return String.fromCharCode(so)}),Wr=Jr.converter._dispatch("unescapeSpecialChars.after",Wr,Yr,Jr),Wr}),Ar.subParser("makeMarkdown.blockquote",function(Wr,Yr){var Jr="";if(Wr.hasChildNodes())for(var no=Wr.childNodes,ro=no.length,so=0;so "+Jr.split(` `).join(` > `),Jr}),Ar.subParser("makeMarkdown.codeBlock",function(Wr,Yr){var Jr=Wr.getAttribute("language"),no=Wr.getAttribute("precodenum");return"```"+Jr+` `+Yr.preList[no]+"\n```"}),Ar.subParser("makeMarkdown.codeSpan",function(Wr){return"`"+Wr.innerHTML+"`"}),Ar.subParser("makeMarkdown.emphasis",function(Wr,Yr){var Jr="";if(Wr.hasChildNodes()){Jr+="*";for(var no=Wr.childNodes,ro=no.length,so=0;so",Wr.hasAttribute("width")&&Wr.hasAttribute("height")&&(Yr+=" ="+Wr.getAttribute("width")+"x"+Wr.getAttribute("height")),Wr.hasAttribute("title")&&(Yr+=' "'+Wr.getAttribute("title")+'"'),Yr+=")"),Yr}),Ar.subParser("makeMarkdown.links",function(Wr,Yr){var Jr="";if(Wr.hasChildNodes()&&Wr.hasAttribute("href")){var no=Wr.childNodes,ro=no.length;Jr="[";for(var so=0;so",Wr.hasAttribute("title")&&(Jr+=' "'+Wr.getAttribute("title")+'"'),Jr+=")"}return Jr}),Ar.subParser("makeMarkdown.list",function(Wr,Yr,Jr){var no="";if(!Wr.hasChildNodes())return"";for(var ro=Wr.childNodes,so=ro.length,ao=Wr.getAttribute("start")||1,lo=0;lo"u"||ro[lo].tagName.toLowerCase()!=="li")){var po="";Jr==="ol"?po=ao.toString()+". ":po="- ",no+=po+Ar.subParser("makeMarkdown.listItem")(ro[lo],Yr),++ao}return no+=` `,no.trim()}),Ar.subParser("makeMarkdown.listItem",function(Wr,Yr){for(var Jr="",no=Wr.childNodes,ro=no.length,so=0;so `;if(Wr.nodeType!==1)return"";var ro=Wr.tagName.toLowerCase();switch(ro){case"h1":Jr||(no=Ar.subParser("makeMarkdown.header")(Wr,Yr,1)+` `);break;case"h2":Jr||(no=Ar.subParser("makeMarkdown.header")(Wr,Yr,2)+` `);break;case"h3":Jr||(no=Ar.subParser("makeMarkdown.header")(Wr,Yr,3)+` `);break;case"h4":Jr||(no=Ar.subParser("makeMarkdown.header")(Wr,Yr,4)+` `);break;case"h5":Jr||(no=Ar.subParser("makeMarkdown.header")(Wr,Yr,5)+` `);break;case"h6":Jr||(no=Ar.subParser("makeMarkdown.header")(Wr,Yr,6)+` `);break;case"p":Jr||(no=Ar.subParser("makeMarkdown.paragraph")(Wr,Yr)+` `);break;case"blockquote":Jr||(no=Ar.subParser("makeMarkdown.blockquote")(Wr,Yr)+` `);break;case"hr":Jr||(no=Ar.subParser("makeMarkdown.hr")(Wr,Yr)+` `);break;case"ol":Jr||(no=Ar.subParser("makeMarkdown.list")(Wr,Yr,"ol")+` `);break;case"ul":Jr||(no=Ar.subParser("makeMarkdown.list")(Wr,Yr,"ul")+` `);break;case"precode":Jr||(no=Ar.subParser("makeMarkdown.codeBlock")(Wr,Yr)+` `);break;case"pre":Jr||(no=Ar.subParser("makeMarkdown.pre")(Wr,Yr)+` `);break;case"table":Jr||(no=Ar.subParser("makeMarkdown.table")(Wr,Yr)+` `);break;case"code":no=Ar.subParser("makeMarkdown.codeSpan")(Wr,Yr);break;case"em":case"i":no=Ar.subParser("makeMarkdown.emphasis")(Wr,Yr);break;case"strong":case"b":no=Ar.subParser("makeMarkdown.strong")(Wr,Yr);break;case"del":no=Ar.subParser("makeMarkdown.strikethrough")(Wr,Yr);break;case"a":no=Ar.subParser("makeMarkdown.links")(Wr,Yr);break;case"img":no=Ar.subParser("makeMarkdown.image")(Wr,Yr);break;default:no=Wr.outerHTML+` `}return no}),Ar.subParser("makeMarkdown.paragraph",function(Wr,Yr){var Jr="";if(Wr.hasChildNodes())for(var no=Wr.childNodes,ro=no.length,so=0;so"+Yr.preList[Jr]+""}),Ar.subParser("makeMarkdown.strikethrough",function(Wr,Yr){var Jr="";if(Wr.hasChildNodes()){Jr+="~~";for(var no=Wr.childNodes,ro=no.length,so=0;sotr>th"),so=Wr.querySelectorAll("tbody>tr"),ao,lo;for(ao=0;aoho&&(ho=yo)}for(ao=0;ao/g,"\\$1>"),Yr=Yr.replace(/^#/gm,"\\#"),Yr=Yr.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),Yr=Yr.replace(/^( {0,3}\d+)\./gm,"$1\\."),Yr=Yr.replace(/^( {0,3})([+-])/gm,"$1\\$2"),Yr=Yr.replace(/]([\s]*)\(/g,"\\]$1\\("),Yr=Yr.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),Yr});var eo=this;Tr.exports?Tr.exports=Ar:eo.showdown=Ar}).call(commonjsGlobal)})(showdown$1);var showdownExports=showdown$1.exports;const showdown=getDefaultExportFromCjs(showdownExports),themeMixin=defineComponent({data(){return{mixinMdStyle:{margin:0,display:"inline-block"},tagOpacity:.25,tableCellOpacity:.08,softOpacity:.16,hoverOpacity:.16,activeOpacity:.24,chartOpacity:.3}},computed:{appTheme(){return theme.appTheme()},mixinWidthStyle(){return{width:"100%"}},widthWithSidebar(){return{width:"100vw"}}},methods:{mdToHtml(Tr){return new showdown.Converter().makeHtml(Tr)},rgbWithOpacity(Tr,Cr){return Tr.includes("rgb")?Tr.replace(")",`, ${Cr})`).replace("rgb","rgba"):Tr.includes("hsl")?Tr.replace(")",`, ${Cr})`).replace("hsl","hsla"):Tr},removeOpacity(Tr){return`${Tr.replace("rgba","rgb").split(", ").slice(0,3).join(", ")})`},addOpacityCleanly(Tr,Cr){if(Tr==null)return null;const $r=w$4(Tr).toHsl();return $r.a=Math.max(0,Math.min(1,Cr)),w$4($r).toHslString()},addSaturation(Tr,Cr=.2){return w$4(Tr).saturate(Cr).toHslString()},desaturate(Tr,Cr=.2){const Ar=w$4(Tr).lighten(.5).desaturate(Cr).toHslString();return console.log("desaturate",Tr,Ar),Ar},softenColors(Tr){const Cr={...Tr};return Object.keys(Cr).forEach(($r,Ar)=>{Cr[$r]=this.rgbWithOpacity(Cr[$r],this.softOpacity)}),Cr},isDarkColor({color:Tr,type:Cr,level:$r}){const Ar=Tr??this.getColorFromDict({type:Cr,level:$r});return Ar==null?!1:w$4(Ar).isDark()},getConstrastColor({color:Tr,type:Cr,level:$r}){const Ar=Tr??this.getColorFromDict({type:Cr,level:$r}),Rr=w$4(Ar),Dr=Rr.brightness();return Dr<.1?Rr.lighten(1-Dr).toHslString():Dr>.9?Rr.darken(Dr).toHslString():Rr.isDark()?Rr.lighten(.5).toHslString():Rr.darken(.5).toHslString()},getContrastColorDictFromBaseDict(Tr){const{level:Cr,type:$r}=Tr;let{color:Ar}=Tr;return Ar==null&&(Ar=this.getColorFromDict(Tr)),w$4(Ar).isDark()?{type:$r??"neutral",level:50}:{type:$r??"neutral",level:900}},getContrastSoftColorDictFromBaseDict(Tr){const{level:Cr,type:$r}=Tr;let{color:Ar}=Tr;return Ar==null&&(Ar=this.getColorFromDict(Tr)),w$4(Ar).isDark()?{type:$r??"neutral",level:200}:{type:$r??"neutral",level:300}},getColorFromDict(Tr){const{type:Cr,level:$r,color:Ar}=Tr;return Ar||(Cr==null||$r==null?null:this.appTheme.palette[Cr][$r])},getAutoColorPalette(Tr){return{coverTitle:this.getConstrastColor(Tr),title:this.getConstrastColor(Tr),heading:this.getConstrastColor(Tr),smallHeading:theme.getSofterColor(this.getConstrastColor(Tr),.2),subtitle:theme.getSofterColor(this.getConstrastColor(Tr),.2),caption:theme.getSofterColor(this.getConstrastColor(Tr),.5)}},extractHSLFromColorString(Tr){const Cr=$r=>$r.endsWith("%")?parseInt($r.slice(0,-1),10)??0:parseInt($r,10)??0;if(Tr.startsWith("hsla")){const[$r,Ar,Rr,Dr]=Tr.slice(5,-1).split(", ");return{h:Cr($r),s:Cr(Ar),l:Cr(Rr),a:Cr(Dr)}}if(Tr.startsWith("hsl")){const[$r,Ar,Rr]=Tr.slice(4,-1).split(", ");return{h:Cr($r),s:Cr(Ar),l:Cr(Rr)}}return{h:0,s:0,l:0}},hslToHex(Tr){const Cr=this.extractHSLFromColorString(Tr),{h:$r,s:Ar}=Cr;let{l:Rr}=Cr;Rr/=100;const Dr=Ar*Math.min(Rr,1-Rr)/100,Mr=Br=>{const Nr=(Br+$r/30)%12,Lr=Rr-Dr*Math.max(Math.min(Nr-3,9-Nr,1),-1);return Math.round(255*Lr).toString(16).padStart(2,"0").toUpperCase()};return`${Mr(0)}${Mr(8)}${Mr(4)}`},twoToneRgbMapping(Tr,Cr,$r){const Ar=Tr.slice(4,-1).split(", "),Rr=Cr.slice(4,-1).split(", ");if(Ar.length!==3||Rr.length!==3)return"";const Dr={red:parseInt(Ar[0],10),green:parseInt(Ar[1],10),blue:parseInt(Ar[2],10)},Mr={red:parseInt(Rr[0],10),green:parseInt(Rr[1],10),blue:parseInt(Rr[2],10)};let Br=Mr.red-Dr.red,Nr=Mr.green-Dr.green,Lr=Mr.blue-Dr.blue;return Br=Br*$r+Dr.red,Nr=Nr*$r+Dr.green,Lr=Lr*$r+Dr.blue,`rgb(${Br}, ${Nr}, ${Lr})`}}}),overlayMixin=defineComponent({data(){return{mixinDefaultModalStyle:{top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"},mixinEditorModalStyle:{top:"72px",left:"72px",right:"72px",height:"calc(100% - 144px)"}}},computed:{defaultEditorDialogStyle(){return{transition:"unset",background:"rgba(0, 0, 0, 0.4)",dialogStyle:{...this.mixinEditorModalStyle}}},defaultModalDialogStyle(){return{background:"rgba(0, 0, 0, 0.6)",dialogStyle:{...this.mixinDefaultModalStyle}}}},methods:{showModal(Tr,Cr,$r=!0){let Ar={...this.defaultEditorDialogStyle};$r||(Ar={...this.defaultModalDialogStyle});const Rr={componentName:Tr,componentData:{...Cr,inModal:!0,modalLevel:0},customStyle:Ar};this.emitter.emit("show-modal",Rr)},showModal2(Tr,Cr){const $r={...this.defaultModalDialogStyle},Ar={componentName:Tr,componentData:{...Cr,inModal:!0,modalLevel:1},customStyle:$r};this.emitter.emit("show-modal-2",Ar)},hideModal(Tr=0){Tr===0?this.emitter.emit("hide-modal"):this.emitter.emit("hide-modal-2")},showPopup(Tr,Cr,$r,Ar=null){let Rr={left:`${this.xOffsetForPopup(Cr,$r)}px`};Ar&&(Rr=Object.assign({},Ar)),this.emitter.emit("show-popup",{component:Tr,anchor:Cr,offset:Rr})},hidePopup(){this.emitter.emit("hide-popup")},showPopup2(Tr,Cr,$r){const Ar={left:`${this.xOffsetForPopup(Cr,$r)}px`};this.emitter.emit("show-popup-2",{component:Tr,anchor:Cr,offset:Ar})},hidePopup2(){this.emitter.emit("hide-popup-2")},hideRelevantPopup(){this.emitter.emit("close-popup")},showSecondaryPopup(Tr,Cr,$r=!1,Ar=!1){this.emitter.emit("show-secondary-popup",{component:Tr,anchor:Cr,isCovering:$r,withFade:Ar})},hideSecondaryPopup(){this.emitter.emit("hide-secondary-popup")},showNotification(Tr){this.emitter.emit("show-notification",Tr)},hideNotification(){this.emitter.emit("hide-notification")},xOffsetForPopup(Tr,Cr){const $r=Tr.left+Tr.width/2;return $r+Cr/2>window.innerWidth?-1*($r+Cr/2-window.innerWidth+12):$r-Cr/2<=0?-1*($r-Cr/2)+12:0}}}),main_V1WRBXUL9I=defineNuxtPlugin(Tr=>{const{vueApp:Cr}=Tr;Cr.use(xt),Cr.use(MotionPlugin),Cr.mixin(overlayMixin),Cr.mixin(themeMixin),Cr.component("inline-svg",InlineSvg)}),posthog_client_uL8DpUhgsW=defineNuxtPlugin(()=>{const Tr=useRuntimeConfig(),{posthogPublicKey:Cr,posthogHost:$r}=Tr.public;if(typeof Cr!="string")throw new Error("Missing posthog public key");if(typeof $r!="string")throw new Error("Missing posthog public key");const Ar=Ir.init(Cr,{api_host:$r,loaded:Dr=>{"prod".startsWith("dev")&&Dr.debug(!1)}});return useRouter$1().afterEach(Dr=>{Ir.capture("$pageview",{current_url:Dr.fullPath})}),{provide:{posthog:()=>Ar}}}),objectToString=Object.prototype.toString;function isError(Tr){switch(objectToString.call(Tr)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return isInstanceOf(Tr,Error)}}function isBuiltin(Tr,Cr){return objectToString.call(Tr)===`[object ${Cr}]`}function isErrorEvent$2(Tr){return isBuiltin(Tr,"ErrorEvent")}function isDOMError(Tr){return isBuiltin(Tr,"DOMError")}function isDOMException(Tr){return isBuiltin(Tr,"DOMException")}function isString$4(Tr){return isBuiltin(Tr,"String")}function isPrimitive(Tr){return Tr===null||typeof Tr!="object"&&typeof Tr!="function"}function isPlainObject$1(Tr){return isBuiltin(Tr,"Object")}function isEvent(Tr){return typeof Event<"u"&&isInstanceOf(Tr,Event)}function isElement$2(Tr){return typeof Element<"u"&&isInstanceOf(Tr,Element)}function isRegExp$3(Tr){return isBuiltin(Tr,"RegExp")}function isThenable(Tr){return!!(Tr&&Tr.then&&typeof Tr.then=="function")}function isSyntheticEvent(Tr){return isPlainObject$1(Tr)&&"nativeEvent"in Tr&&"preventDefault"in Tr&&"stopPropagation"in Tr}function isNaN$1(Tr){return typeof Tr=="number"&&Tr!==Tr}function isInstanceOf(Tr,Cr){try{return Tr instanceof Cr}catch{return!1}}function isVueViewModel(Tr){return!!(typeof Tr=="object"&&Tr!==null&&(Tr.__isVue||Tr._isVue))}function truncate(Tr,Cr=0){return typeof Tr!="string"||Cr===0||Tr.length<=Cr?Tr:`${Tr.slice(0,Cr)}...`}function safeJoin(Tr,Cr){if(!Array.isArray(Tr))return"";const $r=[];for(let Ar=0;ArisMatchingPattern(Tr,Ar,$r))}function applyAggregateErrorsToEvent(Tr,Cr,$r=250,Ar,Rr,Dr,Mr){if(!Dr.exception||!Dr.exception.values||!Mr||!isInstanceOf(Mr.originalException,Error))return;const Br=Dr.exception.values.length>0?Dr.exception.values[Dr.exception.values.length-1]:void 0;Br&&(Dr.exception.values=truncateAggregateExceptions(aggregateExceptionsFromError(Tr,Cr,Rr,Mr.originalException,Ar,Dr.exception.values,Br,0),$r))}function aggregateExceptionsFromError(Tr,Cr,$r,Ar,Rr,Dr,Mr,Br){if(Dr.length>=$r+1)return Dr;let Nr=[...Dr];if(isInstanceOf(Ar[Rr],Error)){applyExceptionGroupFieldsForParentException(Mr,Br);const Lr=Tr(Cr,Ar[Rr]),Hr=Nr.length;applyExceptionGroupFieldsForChildException(Lr,Rr,Hr,Br),Nr=aggregateExceptionsFromError(Tr,Cr,$r,Ar[Rr],Rr,[Lr,...Nr],Lr,Hr)}return Array.isArray(Ar.errors)&&Ar.errors.forEach((Lr,Hr)=>{if(isInstanceOf(Lr,Error)){applyExceptionGroupFieldsForParentException(Mr,Br);const zr=Tr(Cr,Lr),Ur=Nr.length;applyExceptionGroupFieldsForChildException(zr,`errors[${Hr}]`,Ur,Br),Nr=aggregateExceptionsFromError(Tr,Cr,$r,Lr,Rr,[zr,...Nr],zr,Ur)}}),Nr}function applyExceptionGroupFieldsForParentException(Tr,Cr){Tr.mechanism=Tr.mechanism||{type:"generic",handled:!0},Tr.mechanism={...Tr.mechanism,is_exception_group:!0,exception_id:Cr}}function applyExceptionGroupFieldsForChildException(Tr,Cr,$r,Ar){Tr.mechanism=Tr.mechanism||{type:"generic",handled:!0},Tr.mechanism={...Tr.mechanism,type:"chained",source:Cr,exception_id:$r,parent_id:Ar}}function truncateAggregateExceptions(Tr,Cr){return Tr.map($r=>($r.value&&($r.value=truncate($r.value,Cr)),$r))}function isGlobalObj(Tr){return Tr&&Tr.Math==Math?Tr:void 0}const GLOBAL_OBJ=typeof globalThis=="object"&&isGlobalObj(globalThis)||typeof window=="object"&&isGlobalObj(window)||typeof self=="object"&&isGlobalObj(self)||typeof global=="object"&&isGlobalObj(global)||function(){return this}()||{};function getGlobalObject(){return GLOBAL_OBJ}function getGlobalSingleton(Tr,Cr,$r){const Ar=$r||GLOBAL_OBJ,Rr=Ar.__SENTRY__=Ar.__SENTRY__||{};return Rr[Tr]||(Rr[Tr]=Cr())}const WINDOW$8=getGlobalObject(),DEFAULT_MAX_STRING_LENGTH=80;function htmlTreeAsString(Tr,Cr={}){try{let $r=Tr;const Ar=5,Rr=[];let Dr=0,Mr=0;const Br=" > ",Nr=Br.length;let Lr;const Hr=Array.isArray(Cr)?Cr:Cr.keyAttrs,zr=!Array.isArray(Cr)&&Cr.maxStringLength||DEFAULT_MAX_STRING_LENGTH;for(;$r&&Dr++1&&Mr+Rr.length*Nr+Lr.length>=zr));)Rr.push(Lr),Mr+=Lr.length,$r=$r.parentNode;return Rr.reverse().join(Br)}catch{return""}}function _htmlElementAsString(Tr,Cr){const $r=Tr,Ar=[];let Rr,Dr,Mr,Br,Nr;if(!$r||!$r.tagName)return"";Ar.push($r.tagName.toLowerCase());const Lr=Cr&&Cr.length?Cr.filter(zr=>$r.getAttribute(zr)).map(zr=>[zr,$r.getAttribute(zr)]):null;if(Lr&&Lr.length)Lr.forEach(zr=>{Ar.push(`[${zr[0]}="${zr[1]}"]`)});else if($r.id&&Ar.push(`#${$r.id}`),Rr=$r.className,Rr&&isString$4(Rr))for(Dr=Rr.split(/\s+/),Nr=0;Nr{const Dr=originalConsoleMethods[Rr];$r[Rr]=Cr[Rr],Cr[Rr]=Dr});try{return Tr()}finally{Ar.forEach(Rr=>{Cr[Rr]=$r[Rr]})}}function makeLogger(){let Tr=!1;const Cr={enable:()=>{Tr=!0},disable:()=>{Tr=!1}};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?CONSOLE_LEVELS.forEach($r=>{Cr[$r]=(...Ar)=>{Tr&&consoleSandbox(()=>{GLOBAL_OBJ.console[$r](`${PREFIX}[${$r}]:`,...Ar)})}}):CONSOLE_LEVELS.forEach($r=>{Cr[$r]=()=>{}}),Cr}const logger=makeLogger(),DSN_REGEX=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function isValidProtocol(Tr){return Tr==="http"||Tr==="https"}function dsnToString(Tr,Cr=!1){const{host:$r,path:Ar,pass:Rr,port:Dr,projectId:Mr,protocol:Br,publicKey:Nr}=Tr;return`${Br}://${Nr}${Cr&&Rr?`:${Rr}`:""}@${$r}${Dr?`:${Dr}`:""}/${Ar&&`${Ar}/`}${Mr}`}function dsnFromString(Tr){const Cr=DSN_REGEX.exec(Tr);if(!Cr){console.error(`Invalid Sentry Dsn: ${Tr}`);return}const[$r,Ar,Rr="",Dr,Mr="",Br]=Cr.slice(1);let Nr="",Lr=Br;const Hr=Lr.split("/");if(Hr.length>1&&(Nr=Hr.slice(0,-1).join("/"),Lr=Hr.pop()),Lr){const zr=Lr.match(/^\d+/);zr&&(Lr=zr[0])}return dsnFromComponents({host:Dr,pass:Rr,path:Nr,projectId:Lr,port:Mr,protocol:$r,publicKey:Ar})}function dsnFromComponents(Tr){return{protocol:Tr.protocol,publicKey:Tr.publicKey||"",pass:Tr.pass||"",host:Tr.host,port:Tr.port||"",path:Tr.path||"",projectId:Tr.projectId}}function validateDsn(Tr){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;const{port:Cr,projectId:$r,protocol:Ar}=Tr;return["protocol","publicKey","host","projectId"].find(Mr=>Tr[Mr]?!1:(logger.error(`Invalid Sentry Dsn: ${Mr} missing`),!0))?!1:$r.match(/^\d+$/)?isValidProtocol(Ar)?Cr&&isNaN(parseInt(Cr,10))?(logger.error(`Invalid Sentry Dsn: Invalid port ${Cr}`),!1):!0:(logger.error(`Invalid Sentry Dsn: Invalid protocol ${Ar}`),!1):(logger.error(`Invalid Sentry Dsn: Invalid projectId ${$r}`),!1)}function makeDsn(Tr){const Cr=typeof Tr=="string"?dsnFromString(Tr):dsnFromComponents(Tr);if(!(!Cr||!validateDsn(Cr)))return Cr}class SentryError extends Error{constructor(Cr,$r="warn"){super(Cr),this.message=Cr,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=$r}}function fill(Tr,Cr,$r){if(!(Cr in Tr))return;const Ar=Tr[Cr],Rr=$r(Ar);typeof Rr=="function"&&markFunctionWrapped(Rr,Ar),Tr[Cr]=Rr}function addNonEnumerableProperty(Tr,Cr,$r){try{Object.defineProperty(Tr,Cr,{value:$r,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`Failed to add non-enumerable property "${Cr}" to object`,Tr)}}function markFunctionWrapped(Tr,Cr){try{const $r=Cr.prototype||{};Tr.prototype=Cr.prototype=$r,addNonEnumerableProperty(Tr,"__sentry_original__",Cr)}catch{}}function getOriginalFunction(Tr){return Tr.__sentry_original__}function urlEncode(Tr){return Object.keys(Tr).map(Cr=>`${encodeURIComponent(Cr)}=${encodeURIComponent(Tr[Cr])}`).join("&")}function convertToPlainObject(Tr){if(isError(Tr))return{message:Tr.message,name:Tr.name,stack:Tr.stack,...getOwnProperties(Tr)};if(isEvent(Tr)){const Cr={type:Tr.type,target:serializeEventTarget(Tr.target),currentTarget:serializeEventTarget(Tr.currentTarget),...getOwnProperties(Tr)};return typeof CustomEvent<"u"&&isInstanceOf(Tr,CustomEvent)&&(Cr.detail=Tr.detail),Cr}else return Tr}function serializeEventTarget(Tr){try{return isElement$2(Tr)?htmlTreeAsString(Tr):Object.prototype.toString.call(Tr)}catch{return""}}function getOwnProperties(Tr){if(typeof Tr=="object"&&Tr!==null){const Cr={};for(const $r in Tr)Object.prototype.hasOwnProperty.call(Tr,$r)&&(Cr[$r]=Tr[$r]);return Cr}else return{}}function extractExceptionKeysForMessage(Tr,Cr=40){const $r=Object.keys(convertToPlainObject(Tr));if($r.sort(),!$r.length)return"[object has no keys]";if($r[0].length>=Cr)return truncate($r[0],Cr);for(let Ar=$r.length;Ar>0;Ar--){const Rr=$r.slice(0,Ar).join(", ");if(!(Rr.length>Cr))return Ar===$r.length?Rr:truncate(Rr,Cr)}return""}function dropUndefinedKeys(Tr){return _dropUndefinedKeys(Tr,new Map)}function _dropUndefinedKeys(Tr,Cr){if(isPlainObject$1(Tr)){const $r=Cr.get(Tr);if($r!==void 0)return $r;const Ar={};Cr.set(Tr,Ar);for(const Rr of Object.keys(Tr))typeof Tr[Rr]<"u"&&(Ar[Rr]=_dropUndefinedKeys(Tr[Rr],Cr));return Ar}if(Array.isArray(Tr)){const $r=Cr.get(Tr);if($r!==void 0)return $r;const Ar=[];return Cr.set(Tr,Ar),Tr.forEach(Rr=>{Ar.push(_dropUndefinedKeys(Rr,Cr))}),Ar}return Tr}const STACKTRACE_FRAME_LIMIT=50,WEBPACK_ERROR_REGEXP=/\(error: (.*)\)/,STRIP_FRAME_REGEXP=/captureMessage|captureException/;function createStackParser(...Tr){const Cr=Tr.sort(($r,Ar)=>$r[0]-Ar[0]).map($r=>$r[1]);return($r,Ar=0)=>{const Rr=[],Dr=$r.split(` `);for(let Mr=Ar;Mr1024)continue;const Nr=WEBPACK_ERROR_REGEXP.test(Br)?Br.replace(WEBPACK_ERROR_REGEXP,"$1"):Br;if(!Nr.match(/\S*Error: /)){for(const Lr of Cr){const Hr=Lr(Nr);if(Hr){Rr.push(Hr);break}}if(Rr.length>=STACKTRACE_FRAME_LIMIT)break}}return stripSentryFramesAndReverse(Rr)}}function stackParserFromStackParserOptions(Tr){return Array.isArray(Tr)?createStackParser(...Tr):Tr}function stripSentryFramesAndReverse(Tr){if(!Tr.length)return[];const Cr=Array.from(Tr);return/sentryWrapped/.test(Cr[Cr.length-1].function||"")&&Cr.pop(),Cr.reverse(),STRIP_FRAME_REGEXP.test(Cr[Cr.length-1].function||"")&&(Cr.pop(),STRIP_FRAME_REGEXP.test(Cr[Cr.length-1].function||"")&&Cr.pop()),Cr.slice(0,STACKTRACE_FRAME_LIMIT).map($r=>({...$r,filename:$r.filename||Cr[Cr.length-1].filename,function:$r.function||"?"}))}const defaultFunctionName="";function getFunctionName(Tr){try{return!Tr||typeof Tr!="function"?defaultFunctionName:Tr.name||defaultFunctionName}catch{return defaultFunctionName}}const WINDOW$7=getGlobalObject();function supportsFetch(){if(!("fetch"in WINDOW$7))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function isNativeFetch(Tr){return Tr&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(Tr.toString())}function supportsNativeFetch(){if(!supportsFetch())return!1;if(isNativeFetch(WINDOW$7.fetch))return!0;let Tr=!1;const Cr=WINDOW$7.document;if(Cr&&typeof Cr.createElement=="function")try{const $r=Cr.createElement("iframe");$r.hidden=!0,Cr.head.appendChild($r),$r.contentWindow&&$r.contentWindow.fetch&&(Tr=isNativeFetch($r.contentWindow.fetch)),Cr.head.removeChild($r)}catch($r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",$r)}return Tr}function supportsReportingObserver(){return"ReportingObserver"in WINDOW$7}const WINDOW$6=getGlobalObject();function supportsHistory(){const Tr=WINDOW$6.chrome,Cr=Tr&&Tr.app&&Tr.app.runtime,$r="history"in WINDOW$6&&!!WINDOW$6.history.pushState&&!!WINDOW$6.history.replaceState;return!Cr&&$r}const WINDOW$5=getGlobalObject(),SENTRY_XHR_DATA_KEY="__sentry_xhr_v2__",handlers$2={},instrumented={};function instrument(Tr){if(!instrumented[Tr])switch(instrumented[Tr]=!0,Tr){case"console":instrumentConsole();break;case"dom":instrumentDOM();break;case"xhr":instrumentXHR();break;case"fetch":instrumentFetch();break;case"history":instrumentHistory();break;case"error":instrumentError();break;case"unhandledrejection":instrumentUnhandledRejection();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("unknown instrumentation type:",Tr);return}}function addInstrumentationHandler(Tr,Cr){handlers$2[Tr]=handlers$2[Tr]||[],handlers$2[Tr].push(Cr),instrument(Tr)}function triggerHandlers(Tr,Cr){if(!(!Tr||!handlers$2[Tr]))for(const $r of handlers$2[Tr]||[])try{$r(Cr)}catch(Ar){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error(`Error while triggering instrumentation handler. Type: ${Tr} Name: ${getFunctionName($r)} Error:`,Ar)}}function instrumentConsole(){"console"in GLOBAL_OBJ&&CONSOLE_LEVELS.forEach(function(Tr){Tr in GLOBAL_OBJ.console&&fill(GLOBAL_OBJ.console,Tr,function(Cr){return originalConsoleMethods[Tr]=Cr,function(...$r){triggerHandlers("console",{args:$r,level:Tr});const Ar=originalConsoleMethods[Tr];Ar&&Ar.apply(GLOBAL_OBJ.console,$r)}})})}function instrumentFetch(){supportsNativeFetch()&&fill(GLOBAL_OBJ,"fetch",function(Tr){return function(...Cr){const{method:$r,url:Ar}=parseFetchArgs(Cr),Rr={args:Cr,fetchData:{method:$r,url:Ar},startTimestamp:Date.now()};return triggerHandlers("fetch",{...Rr}),Tr.apply(GLOBAL_OBJ,Cr).then(Dr=>(triggerHandlers("fetch",{...Rr,endTimestamp:Date.now(),response:Dr}),Dr),Dr=>{throw triggerHandlers("fetch",{...Rr,endTimestamp:Date.now(),error:Dr}),Dr})}})}function hasProp(Tr,Cr){return!!Tr&&typeof Tr=="object"&&!!Tr[Cr]}function getUrlFromResource(Tr){return typeof Tr=="string"?Tr:Tr?hasProp(Tr,"url")?Tr.url:Tr.toString?Tr.toString():"":""}function parseFetchArgs(Tr){if(Tr.length===0)return{method:"GET",url:""};if(Tr.length===2){const[$r,Ar]=Tr;return{url:getUrlFromResource($r),method:hasProp(Ar,"method")?String(Ar.method).toUpperCase():"GET"}}const Cr=Tr[0];return{url:getUrlFromResource(Cr),method:hasProp(Cr,"method")?String(Cr.method).toUpperCase():"GET"}}function instrumentXHR(){if(!WINDOW$5.XMLHttpRequest)return;const Tr=XMLHttpRequest.prototype;fill(Tr,"open",function(Cr){return function(...$r){const Ar=$r[1],Rr=this[SENTRY_XHR_DATA_KEY]={method:isString$4($r[0])?$r[0].toUpperCase():$r[0],url:$r[1],request_headers:{}};isString$4(Ar)&&Rr.method==="POST"&&Ar.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const Dr=()=>{const Mr=this[SENTRY_XHR_DATA_KEY];if(Mr&&this.readyState===4){try{Mr.status_code=this.status}catch{}triggerHandlers("xhr",{args:$r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?fill(this,"onreadystatechange",function(Mr){return function(...Br){return Dr(),Mr.apply(this,Br)}}):this.addEventListener("readystatechange",Dr),fill(this,"setRequestHeader",function(Mr){return function(...Br){const[Nr,Lr]=Br,Hr=this[SENTRY_XHR_DATA_KEY];return Hr&&(Hr.request_headers[Nr.toLowerCase()]=Lr),Mr.apply(this,Br)}}),Cr.apply(this,$r)}}),fill(Tr,"send",function(Cr){return function(...$r){const Ar=this[SENTRY_XHR_DATA_KEY];return Ar&&$r[0]!==void 0&&(Ar.body=$r[0]),triggerHandlers("xhr",{args:$r,startTimestamp:Date.now(),xhr:this}),Cr.apply(this,$r)}})}let lastHref;function instrumentHistory(){if(!supportsHistory())return;const Tr=WINDOW$5.onpopstate;WINDOW$5.onpopstate=function(...$r){const Ar=WINDOW$5.location.href,Rr=lastHref;if(lastHref=Ar,triggerHandlers("history",{from:Rr,to:Ar}),Tr)try{return Tr.apply(this,$r)}catch{}};function Cr($r){return function(...Ar){const Rr=Ar.length>2?Ar[2]:void 0;if(Rr){const Dr=lastHref,Mr=String(Rr);lastHref=Mr,triggerHandlers("history",{from:Dr,to:Mr})}return $r.apply(this,Ar)}}fill(WINDOW$5.history,"pushState",Cr),fill(WINDOW$5.history,"replaceState",Cr)}const debounceDuration=1e3;let debounceTimerID,lastCapturedEvent;function shouldShortcircuitPreviousDebounce(Tr,Cr){if(!Tr||Tr.type!==Cr.type)return!0;try{if(Tr.target!==Cr.target)return!0}catch{}return!1}function shouldSkipDOMEvent(Tr){if(Tr.type!=="keypress")return!1;try{const Cr=Tr.target;if(!Cr||!Cr.tagName)return!0;if(Cr.tagName==="INPUT"||Cr.tagName==="TEXTAREA"||Cr.isContentEditable)return!1}catch{}return!0}function makeDOMEventHandler(Tr,Cr=!1){return $r=>{if(!$r||lastCapturedEvent===$r||shouldSkipDOMEvent($r))return;const Ar=$r.type==="keypress"?"input":$r.type;debounceTimerID===void 0?(Tr({event:$r,name:Ar,global:Cr}),lastCapturedEvent=$r):shouldShortcircuitPreviousDebounce(lastCapturedEvent,$r)&&(Tr({event:$r,name:Ar,global:Cr}),lastCapturedEvent=$r),clearTimeout(debounceTimerID),debounceTimerID=WINDOW$5.setTimeout(()=>{debounceTimerID=void 0},debounceDuration)}}function instrumentDOM(){if(!WINDOW$5.document)return;const Tr=triggerHandlers.bind(null,"dom"),Cr=makeDOMEventHandler(Tr,!0);WINDOW$5.document.addEventListener("click",Cr,!1),WINDOW$5.document.addEventListener("keypress",Cr,!1),["EventTarget","Node"].forEach($r=>{const Ar=WINDOW$5[$r]&&WINDOW$5[$r].prototype;!Ar||!Ar.hasOwnProperty||!Ar.hasOwnProperty("addEventListener")||(fill(Ar,"addEventListener",function(Rr){return function(Dr,Mr,Br){if(Dr==="click"||Dr=="keypress")try{const Nr=this,Lr=Nr.__sentry_instrumentation_handlers__=Nr.__sentry_instrumentation_handlers__||{},Hr=Lr[Dr]=Lr[Dr]||{refCount:0};if(!Hr.handler){const zr=makeDOMEventHandler(Tr);Hr.handler=zr,Rr.call(this,Dr,zr,Br)}Hr.refCount++}catch{}return Rr.call(this,Dr,Mr,Br)}}),fill(Ar,"removeEventListener",function(Rr){return function(Dr,Mr,Br){if(Dr==="click"||Dr=="keypress")try{const Nr=this,Lr=Nr.__sentry_instrumentation_handlers__||{},Hr=Lr[Dr];Hr&&(Hr.refCount--,Hr.refCount<=0&&(Rr.call(this,Dr,Hr.handler,Br),Hr.handler=void 0,delete Lr[Dr]),Object.keys(Lr).length===0&&delete Nr.__sentry_instrumentation_handlers__)}catch{}return Rr.call(this,Dr,Mr,Br)}}))})}let _oldOnErrorHandler=null;function instrumentError(){_oldOnErrorHandler=WINDOW$5.onerror,WINDOW$5.onerror=function(Tr,Cr,$r,Ar,Rr){return triggerHandlers("error",{column:Ar,error:Rr,line:$r,msg:Tr,url:Cr}),_oldOnErrorHandler&&!_oldOnErrorHandler.__SENTRY_LOADER__?_oldOnErrorHandler.apply(this,arguments):!1},WINDOW$5.onerror.__SENTRY_INSTRUMENTED__=!0}let _oldOnUnhandledRejectionHandler=null;function instrumentUnhandledRejection(){_oldOnUnhandledRejectionHandler=WINDOW$5.onunhandledrejection,WINDOW$5.onunhandledrejection=function(Tr){return triggerHandlers("unhandledrejection",Tr),_oldOnUnhandledRejectionHandler&&!_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__?_oldOnUnhandledRejectionHandler.apply(this,arguments):!0},WINDOW$5.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function memoBuilder(){const Tr=typeof WeakSet=="function",Cr=Tr?new WeakSet:[];function $r(Rr){if(Tr)return Cr.has(Rr)?!0:(Cr.add(Rr),!1);for(let Dr=0;DrMath.random()*16;try{if(Cr&&Cr.randomUUID)return Cr.randomUUID().replace(/-/g,"");Cr&&Cr.getRandomValues&&($r=()=>Cr.getRandomValues(new Uint8Array(1))[0])}catch{}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,Ar=>(Ar^($r()&15)>>Ar/4).toString(16))}function getFirstException(Tr){return Tr.exception&&Tr.exception.values?Tr.exception.values[0]:void 0}function getEventDescription(Tr){const{message:Cr,event_id:$r}=Tr;if(Cr)return Cr;const Ar=getFirstException(Tr);return Ar?Ar.type&&Ar.value?`${Ar.type}: ${Ar.value}`:Ar.type||Ar.value||$r||"":$r||""}function addExceptionTypeValue(Tr,Cr,$r){const Ar=Tr.exception=Tr.exception||{},Rr=Ar.values=Ar.values||[],Dr=Rr[0]=Rr[0]||{};Dr.value||(Dr.value=Cr||""),Dr.type||(Dr.type=$r||"Error")}function addExceptionMechanism(Tr,Cr){const $r=getFirstException(Tr);if(!$r)return;const Ar={type:"generic",handled:!0},Rr=$r.mechanism;if($r.mechanism={...Ar,...Rr,...Cr},Cr&&"data"in Cr){const Dr={...Rr&&Rr.data,...Cr.data};$r.mechanism.data=Dr}}function checkOrSetAlreadyCaught(Tr){if(Tr&&Tr.__sentry_captured__)return!0;try{addNonEnumerableProperty(Tr,"__sentry_captured__",!0)}catch{}return!1}function arrayify(Tr){return Array.isArray(Tr)?Tr:[Tr]}function isBrowserBundle(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function getSDKSource(){return"npm"}function isNodeEnv(){return!isBrowserBundle()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function dynamicRequire(Tr,Cr){return Tr.require(Cr)}function normalize$3(Tr,Cr=100,$r=1/0){try{return visit("",Tr,Cr,$r)}catch(Ar){return{ERROR:`**non-serializable** (${Ar})`}}}function normalizeToSize(Tr,Cr=3,$r=100*1024){const Ar=normalize$3(Tr,Cr);return jsonSize(Ar)>$r?normalizeToSize(Tr,Cr-1,$r):Ar}function visit(Tr,Cr,$r=1/0,Ar=1/0,Rr=memoBuilder()){const[Dr,Mr]=Rr;if(Cr==null||["number","boolean","string"].includes(typeof Cr)&&!isNaN$1(Cr))return Cr;const Br=stringifyValue(Tr,Cr);if(!Br.startsWith("[object "))return Br;if(Cr.__sentry_skip_normalization__)return Cr;const Nr=typeof Cr.__sentry_override_normalization_depth__=="number"?Cr.__sentry_override_normalization_depth__:$r;if(Nr===0)return Br.replace("object ","");if(Dr(Cr))return"[Circular ~]";const Lr=Cr;if(Lr&&typeof Lr.toJSON=="function")try{const Vr=Lr.toJSON();return visit("",Vr,Nr-1,Ar,Rr)}catch{}const Hr=Array.isArray(Cr)?[]:{};let zr=0;const Ur=convertToPlainObject(Cr);for(const Vr in Ur){if(!Object.prototype.hasOwnProperty.call(Ur,Vr))continue;if(zr>=Ar){Hr[Vr]="[MaxProperties ~]";break}const jr=Ur[Vr];Hr[Vr]=visit(Vr,jr,Nr-1,Ar,Rr),zr++}return Mr(Cr),Hr}function stringifyValue(Tr,Cr){try{if(Tr==="domain"&&Cr&&typeof Cr=="object"&&Cr._events)return"[Domain]";if(Tr==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&Cr===global)return"[Global]";if(typeof window<"u"&&Cr===window)return"[Window]";if(typeof document<"u"&&Cr===document)return"[Document]";if(isVueViewModel(Cr))return"[VueViewModel]";if(isSyntheticEvent(Cr))return"[SyntheticEvent]";if(typeof Cr=="number"&&Cr!==Cr)return"[NaN]";if(typeof Cr=="function")return`[Function: ${getFunctionName(Cr)}]`;if(typeof Cr=="symbol")return`[${String(Cr)}]`;if(typeof Cr=="bigint")return`[BigInt: ${String(Cr)}]`;const $r=getConstructorName(Cr);return/^HTML(\w*)Element$/.test($r)?`[HTMLElement: ${$r}]`:`[object ${$r}]`}catch($r){return`**non-serializable** (${$r})`}}function getConstructorName(Tr){const Cr=Object.getPrototypeOf(Tr);return Cr?Cr.constructor.name:"null prototype"}function utf8Length(Tr){return~-encodeURI(Tr).split(/%..|./).length}function jsonSize(Tr){return utf8Length(JSON.stringify(Tr))}var States;(function(Tr){Tr[Tr.PENDING=0]="PENDING";const $r=1;Tr[Tr.RESOLVED=$r]="RESOLVED";const Ar=2;Tr[Tr.REJECTED=Ar]="REJECTED"})(States||(States={}));function resolvedSyncPromise(Tr){return new SyncPromise(Cr=>{Cr(Tr)})}function rejectedSyncPromise(Tr){return new SyncPromise((Cr,$r)=>{$r(Tr)})}class SyncPromise{constructor(Cr){SyncPromise.prototype.__init.call(this),SyncPromise.prototype.__init2.call(this),SyncPromise.prototype.__init3.call(this),SyncPromise.prototype.__init4.call(this),this._state=States.PENDING,this._handlers=[];try{Cr(this._resolve,this._reject)}catch($r){this._reject($r)}}then(Cr,$r){return new SyncPromise((Ar,Rr)=>{this._handlers.push([!1,Dr=>{if(!Cr)Ar(Dr);else try{Ar(Cr(Dr))}catch(Mr){Rr(Mr)}},Dr=>{if(!$r)Rr(Dr);else try{Ar($r(Dr))}catch(Mr){Rr(Mr)}}]),this._executeHandlers()})}catch(Cr){return this.then($r=>$r,Cr)}finally(Cr){return new SyncPromise(($r,Ar)=>{let Rr,Dr;return this.then(Mr=>{Dr=!1,Rr=Mr,Cr&&Cr()},Mr=>{Dr=!0,Rr=Mr,Cr&&Cr()}).then(()=>{if(Dr){Ar(Rr);return}$r(Rr)})})}__init(){this._resolve=Cr=>{this._setResult(States.RESOLVED,Cr)}}__init2(){this._reject=Cr=>{this._setResult(States.REJECTED,Cr)}}__init3(){this._setResult=(Cr,$r)=>{if(this._state===States.PENDING){if(isThenable($r)){$r.then(this._resolve,this._reject);return}this._state=Cr,this._value=$r,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===States.PENDING)return;const Cr=this._handlers.slice();this._handlers=[],Cr.forEach($r=>{$r[0]||(this._state===States.RESOLVED&&$r[1](this._value),this._state===States.REJECTED&&$r[2](this._value),$r[0]=!0)})}}}function makePromiseBuffer(Tr){const Cr=[];function $r(){return Tr===void 0||Cr.lengthAr(Br)).then(null,()=>Ar(Br).then(null,()=>{})),Br}function Dr(Mr){return new SyncPromise((Br,Nr)=>{let Lr=Cr.length;if(!Lr)return Br(!0);const Hr=setTimeout(()=>{Mr&&Mr>0&&Br(!1)},Mr);Cr.forEach(zr=>{resolvedSyncPromise(zr).then(()=>{--Lr||(clearTimeout(Hr),Br(!0))},Nr)})})}return{$:Cr,add:Rr,drain:Dr}}function parseUrl(Tr){if(!Tr)return{};const Cr=Tr.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!Cr)return{};const $r=Cr[6]||"",Ar=Cr[8]||"";return{host:Cr[4],path:Cr[5],protocol:Cr[2],search:$r,hash:Ar,relative:Cr[5]+$r+Ar}}const validSeverityLevels=["fatal","error","warning","log","info","debug"];function severityLevelFromString(Tr){return Tr==="warn"?"warning":validSeverityLevels.includes(Tr)?Tr:"log"}const WINDOW$4=getGlobalObject(),dateTimestampSource={nowSeconds:()=>Date.now()/1e3};function getBrowserPerformance(){const{performance:Tr}=WINDOW$4;if(!Tr||!Tr.now)return;const Cr=Date.now()-Tr.now();return{now:()=>Tr.now(),timeOrigin:Cr}}function getNodePerformance(){try{return dynamicRequire(module,"perf_hooks").performance}catch{return}}const platformPerformance=isNodeEnv()?getNodePerformance():getBrowserPerformance(),timestampSource=platformPerformance===void 0?dateTimestampSource:{nowSeconds:()=>(platformPerformance.timeOrigin+platformPerformance.now())/1e3},dateTimestampInSeconds=dateTimestampSource.nowSeconds.bind(dateTimestampSource),timestampInSeconds=timestampSource.nowSeconds.bind(timestampSource),browserPerformanceTimeOrigin=(()=>{const{performance:Tr}=WINDOW$4;if(!Tr||!Tr.now)return;const Cr=3600*1e3,$r=Tr.now(),Ar=Date.now(),Rr=Tr.timeOrigin?Math.abs(Tr.timeOrigin+$r-Ar):Cr,Dr=Rr{const Dr=baggageHeaderToObject(Rr);return{...Ar,...Dr}},{});else{if(!Tr)return;Cr=baggageHeaderToObject(Tr)}const $r=Object.entries(Cr).reduce((Ar,[Rr,Dr])=>{if(Rr.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)){const Mr=Rr.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);Ar[Mr]=Dr}return Ar},{});if(Object.keys($r).length>0)return $r}function dynamicSamplingContextToSentryBaggageHeader(Tr){if(!Tr)return;const Cr=Object.entries(Tr).reduce(($r,[Ar,Rr])=>(Rr&&($r[`${SENTRY_BAGGAGE_KEY_PREFIX}${Ar}`]=Rr),$r),{});return objectToBaggageHeader(Cr)}function baggageHeaderToObject(Tr){return Tr.split(",").map(Cr=>Cr.split("=").map($r=>decodeURIComponent($r.trim()))).reduce((Cr,[$r,Ar])=>(Cr[$r]=Ar,Cr),{})}function objectToBaggageHeader(Tr){if(Object.keys(Tr).length!==0)return Object.entries(Tr).reduce((Cr,[$r,Ar],Rr)=>{const Dr=`${encodeURIComponent($r)}=${encodeURIComponent(Ar)}`,Mr=Rr===0?Dr:`${Cr},${Dr}`;return Mr.length>MAX_BAGGAGE_STRING_LENGTH?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`Not adding key: ${$r} with val: ${Ar} to baggage header due to exceeding baggage size limits.`),Cr):Mr},"")}const TRACEPARENT_REGEXP=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function extractTraceparentData(Tr){if(!Tr)return;const Cr=Tr.match(TRACEPARENT_REGEXP);if(!Cr)return;let $r;return Cr[3]==="1"?$r=!0:Cr[3]==="0"&&($r=!1),{traceId:Cr[1],parentSampled:$r,parentSpanId:Cr[2]}}function tracingContextFromHeaders(Tr,Cr){const $r=extractTraceparentData(Tr),Ar=baggageHeaderToDynamicSamplingContext(Cr),{traceId:Rr,parentSpanId:Dr,parentSampled:Mr}=$r||{},Br={traceId:Rr||uuid4(),spanId:uuid4().substring(16),sampled:Mr};return Dr&&(Br.parentSpanId=Dr),Ar&&(Br.dsc=Ar),{traceparentData:$r,dynamicSamplingContext:Ar,propagationContext:Br}}function generateSentryTraceHeader(Tr=uuid4(),Cr=uuid4().substring(16),$r){let Ar="";return $r!==void 0&&(Ar=$r?"-1":"-0"),`${Tr}-${Cr}${Ar}`}function createEnvelope(Tr,Cr=[]){return[Tr,Cr]}function addItemToEnvelope(Tr,Cr){const[$r,Ar]=Tr;return[$r,[...Ar,Cr]]}function forEachEnvelopeItem(Tr,Cr){const $r=Tr[1];for(const Ar of $r){const Rr=Ar[0].type;if(Cr(Ar,Rr))return!0}return!1}function encodeUTF8(Tr,Cr){return(Cr||new TextEncoder).encode(Tr)}function serializeEnvelope(Tr,Cr){const[$r,Ar]=Tr;let Rr=JSON.stringify($r);function Dr(Mr){typeof Rr=="string"?Rr=typeof Mr=="string"?Rr+Mr:[encodeUTF8(Rr,Cr),Mr]:Rr.push(typeof Mr=="string"?encodeUTF8(Mr,Cr):Mr)}for(const Mr of Ar){const[Br,Nr]=Mr;if(Dr(` ${JSON.stringify(Br)} `),typeof Nr=="string"||Nr instanceof Uint8Array)Dr(Nr);else{let Lr;try{Lr=JSON.stringify(Nr)}catch{Lr=JSON.stringify(normalize$3(Nr))}Dr(Lr)}}return typeof Rr=="string"?Rr:concatBuffers(Rr)}function concatBuffers(Tr){const Cr=Tr.reduce((Rr,Dr)=>Rr+Dr.length,0),$r=new Uint8Array(Cr);let Ar=0;for(const Rr of Tr)$r.set(Rr,Ar),Ar+=Rr.length;return $r}function createAttachmentEnvelopeItem(Tr,Cr){const $r=typeof Tr.data=="string"?encodeUTF8(Tr.data,Cr):Tr.data;return[dropUndefinedKeys({type:"attachment",length:$r.length,filename:Tr.filename,content_type:Tr.contentType,attachment_type:Tr.attachmentType}),$r]}const ITEM_TYPE_TO_DATA_CATEGORY_MAP={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor"};function envelopeItemTypeToDataCategory(Tr){return ITEM_TYPE_TO_DATA_CATEGORY_MAP[Tr]}function getSdkMetadataForEnvelopeHeader(Tr){if(!Tr||!Tr.sdk)return;const{name:Cr,version:$r}=Tr.sdk;return{name:Cr,version:$r}}function createEventEnvelopeHeaders(Tr,Cr,$r,Ar){const Rr=Tr.sdkProcessingMetadata&&Tr.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:Tr.event_id,sent_at:new Date().toISOString(),...Cr&&{sdk:Cr},...!!$r&&Ar&&{dsn:dsnToString(Ar)},...Rr&&{trace:dropUndefinedKeys({...Rr})}}}function createClientReportEnvelope(Tr,Cr,$r){const Ar=[{type:"client_report"},{timestamp:$r||dateTimestampInSeconds(),discarded_events:Tr}];return createEnvelope(Cr?{dsn:Cr}:{},[Ar])}const DEFAULT_RETRY_AFTER=60*1e3;function parseRetryAfterHeader(Tr,Cr=Date.now()){const $r=parseInt(`${Tr}`,10);if(!isNaN($r))return $r*1e3;const Ar=Date.parse(`${Tr}`);return isNaN(Ar)?DEFAULT_RETRY_AFTER:Ar-Cr}function disabledUntil(Tr,Cr){return Tr[Cr]||Tr.all||0}function isRateLimited(Tr,Cr,$r=Date.now()){return disabledUntil(Tr,Cr)>$r}function updateRateLimits(Tr,{statusCode:Cr,headers:$r},Ar=Date.now()){const Rr={...Tr},Dr=$r&&$r["x-sentry-rate-limits"],Mr=$r&&$r["retry-after"];if(Dr)for(const Br of Dr.trim().split(",")){const[Nr,Lr]=Br.split(":",2),Hr=parseInt(Nr,10),zr=(isNaN(Hr)?60:Hr)*1e3;if(!Lr)Rr.all=Ar+zr;else for(const Ur of Lr.split(";"))Rr[Ur]=Ar+zr}else Mr?Rr.all=Ar+parseRetryAfterHeader(Mr,Ar):Cr===429&&(Rr.all=Ar+60*1e3);return Rr}class CaptureConsole{static __initStatic(){this.id="CaptureConsole"}constructor(Cr={}){this.name=CaptureConsole.id,this._levels=Cr.levels||CONSOLE_LEVELS}setupOnce(Cr,$r){if(!("console"in GLOBAL_OBJ))return;const Ar=this._levels;addInstrumentationHandler("console",({args:Rr,level:Dr})=>{if(!Ar.includes(Dr))return;const Mr=$r();Mr.getIntegration(CaptureConsole)&&consoleHandler(Mr,Rr,Dr)})}}CaptureConsole.__initStatic();function consoleHandler(Tr,Cr,$r){Tr.withScope(Ar=>{Ar.setLevel(severityLevelFromString($r)),Ar.setExtra("arguments",Cr),Ar.addEventProcessor(Mr=>(Mr.logger="console",addExceptionMechanism(Mr,{handled:!1,type:"console"}),Mr));let Rr=safeJoin(Cr," ");const Dr=Cr.find(Mr=>Mr instanceof Error);$r==="assert"?Cr[0]===!1&&(Rr=`Assertion failed: ${safeJoin(Cr.slice(1)," ")||"console.assert"}`,Ar.setExtra("arguments",Cr.slice(1)),Tr.captureMessage(Rr)):$r==="error"&&Dr?Tr.captureException(Dr):Tr.captureMessage(Rr)})}const WINDOW$3=GLOBAL_OBJ;class ReportingObserver{static __initStatic(){this.id="ReportingObserver"}constructor(Cr={}){this.name=ReportingObserver.id,this._types=Cr.types||["crash","deprecation","intervention"]}setupOnce(Cr,$r){if(!supportsReportingObserver())return;this._getCurrentHub=$r,new WINDOW$3.ReportingObserver(this.handler.bind(this),{buffered:!0,types:this._types}).observe()}handler(Cr){const $r=this._getCurrentHub&&this._getCurrentHub();if(!(!$r||!$r.getIntegration(ReportingObserver)))for(const Ar of Cr)$r.withScope(Rr=>{Rr.setExtra("url",Ar.url);const Dr=`ReportingObserver [${Ar.type}]`;let Mr="No details available";if(Ar.body){const Br={};for(const Nr in Ar.body)Br[Nr]=Ar.body[Nr];if(Rr.setExtra("body",Br),Ar.type==="crash"){const Nr=Ar.body;Mr=[Nr.crashId||"",Nr.reason||""].join(" ").trim()||Mr}else Mr=Ar.body.message||Mr}$r.captureMessage(`${Dr}: ${Mr}`)})}}ReportingObserver.__initStatic();const DEFAULT_ENVIRONMENT="production";function getGlobalEventProcessors(){return getGlobalSingleton("globalEventProcessors",()=>[])}function addGlobalEventProcessor(Tr){getGlobalEventProcessors().push(Tr)}function notifyEventProcessors(Tr,Cr,$r,Ar=0){return new SyncPromise((Rr,Dr)=>{const Mr=Tr[Ar];if(Cr===null||typeof Mr!="function")Rr(Cr);else{const Br=Mr({...Cr},$r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Mr.id&&Br===null&&logger.log(`Event processor "${Mr.id}" dropped event`),isThenable(Br)?Br.then(Nr=>notifyEventProcessors(Tr,Nr,$r,Ar+1).then(Rr)).then(null,Dr):notifyEventProcessors(Tr,Br,$r,Ar+1).then(Rr).then(null,Dr)}})}function makeSession$1(Tr){const Cr=timestampInSeconds(),$r={sid:uuid4(),init:!0,timestamp:Cr,started:Cr,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>sessionToJSON($r)};return Tr&&updateSession($r,Tr),$r}function updateSession(Tr,Cr={}){if(Cr.user&&(!Tr.ipAddress&&Cr.user.ip_address&&(Tr.ipAddress=Cr.user.ip_address),!Tr.did&&!Cr.did&&(Tr.did=Cr.user.id||Cr.user.email||Cr.user.username)),Tr.timestamp=Cr.timestamp||timestampInSeconds(),Cr.ignoreDuration&&(Tr.ignoreDuration=Cr.ignoreDuration),Cr.sid&&(Tr.sid=Cr.sid.length===32?Cr.sid:uuid4()),Cr.init!==void 0&&(Tr.init=Cr.init),!Tr.did&&Cr.did&&(Tr.did=`${Cr.did}`),typeof Cr.started=="number"&&(Tr.started=Cr.started),Tr.ignoreDuration)Tr.duration=void 0;else if(typeof Cr.duration=="number")Tr.duration=Cr.duration;else{const $r=Tr.timestamp-Tr.started;Tr.duration=$r>=0?$r:0}Cr.release&&(Tr.release=Cr.release),Cr.environment&&(Tr.environment=Cr.environment),!Tr.ipAddress&&Cr.ipAddress&&(Tr.ipAddress=Cr.ipAddress),!Tr.userAgent&&Cr.userAgent&&(Tr.userAgent=Cr.userAgent),typeof Cr.errors=="number"&&(Tr.errors=Cr.errors),Cr.status&&(Tr.status=Cr.status)}function closeSession(Tr,Cr){let $r={};Cr?$r={status:Cr}:Tr.status==="ok"&&($r={status:"exited"}),updateSession(Tr,$r)}function sessionToJSON(Tr){return dropUndefinedKeys({sid:`${Tr.sid}`,init:Tr.init,started:new Date(Tr.started*1e3).toISOString(),timestamp:new Date(Tr.timestamp*1e3).toISOString(),status:Tr.status,errors:Tr.errors,did:typeof Tr.did=="number"||typeof Tr.did=="string"?`${Tr.did}`:void 0,duration:Tr.duration,attrs:{release:Tr.release,environment:Tr.environment,ip_address:Tr.ipAddress,user_agent:Tr.userAgent}})}const DEFAULT_MAX_BREADCRUMBS=100;class Scope{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=generatePropagationContext()}static clone(Cr){const $r=new Scope;return Cr&&($r._breadcrumbs=[...Cr._breadcrumbs],$r._tags={...Cr._tags},$r._extra={...Cr._extra},$r._contexts={...Cr._contexts},$r._user=Cr._user,$r._level=Cr._level,$r._span=Cr._span,$r._session=Cr._session,$r._transactionName=Cr._transactionName,$r._fingerprint=Cr._fingerprint,$r._eventProcessors=[...Cr._eventProcessors],$r._requestSession=Cr._requestSession,$r._attachments=[...Cr._attachments],$r._sdkProcessingMetadata={...Cr._sdkProcessingMetadata},$r._propagationContext={...Cr._propagationContext}),$r}addScopeListener(Cr){this._scopeListeners.push(Cr)}addEventProcessor(Cr){return this._eventProcessors.push(Cr),this}setUser(Cr){return this._user=Cr||{},this._session&&updateSession(this._session,{user:Cr}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(Cr){return this._requestSession=Cr,this}setTags(Cr){return this._tags={...this._tags,...Cr},this._notifyScopeListeners(),this}setTag(Cr,$r){return this._tags={...this._tags,[Cr]:$r},this._notifyScopeListeners(),this}setExtras(Cr){return this._extra={...this._extra,...Cr},this._notifyScopeListeners(),this}setExtra(Cr,$r){return this._extra={...this._extra,[Cr]:$r},this._notifyScopeListeners(),this}setFingerprint(Cr){return this._fingerprint=Cr,this._notifyScopeListeners(),this}setLevel(Cr){return this._level=Cr,this._notifyScopeListeners(),this}setTransactionName(Cr){return this._transactionName=Cr,this._notifyScopeListeners(),this}setContext(Cr,$r){return $r===null?delete this._contexts[Cr]:this._contexts[Cr]=$r,this._notifyScopeListeners(),this}setSpan(Cr){return this._span=Cr,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const Cr=this.getSpan();return Cr&&Cr.transaction}setSession(Cr){return Cr?this._session=Cr:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(Cr){if(!Cr)return this;if(typeof Cr=="function"){const $r=Cr(this);return $r instanceof Scope?$r:this}return Cr instanceof Scope?(this._tags={...this._tags,...Cr._tags},this._extra={...this._extra,...Cr._extra},this._contexts={...this._contexts,...Cr._contexts},Cr._user&&Object.keys(Cr._user).length&&(this._user=Cr._user),Cr._level&&(this._level=Cr._level),Cr._fingerprint&&(this._fingerprint=Cr._fingerprint),Cr._requestSession&&(this._requestSession=Cr._requestSession),Cr._propagationContext&&(this._propagationContext=Cr._propagationContext)):isPlainObject$1(Cr)&&(Cr=Cr,this._tags={...this._tags,...Cr.tags},this._extra={...this._extra,...Cr.extra},this._contexts={...this._contexts,...Cr.contexts},Cr.user&&(this._user=Cr.user),Cr.level&&(this._level=Cr.level),Cr.fingerprint&&(this._fingerprint=Cr.fingerprint),Cr.requestSession&&(this._requestSession=Cr.requestSession),Cr.propagationContext&&(this._propagationContext=Cr.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=generatePropagationContext(),this}addBreadcrumb(Cr,$r){const Ar=typeof $r=="number"?$r:DEFAULT_MAX_BREADCRUMBS;if(Ar<=0)return this;const Rr={timestamp:dateTimestampInSeconds(),...Cr},Dr=this._breadcrumbs;return Dr.push(Rr),this._breadcrumbs=Dr.length>Ar?Dr.slice(-Ar):Dr,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(Cr){return this._attachments.push(Cr),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(Cr,$r={},Ar){if(this._extra&&Object.keys(this._extra).length&&(Cr.extra={...this._extra,...Cr.extra}),this._tags&&Object.keys(this._tags).length&&(Cr.tags={...this._tags,...Cr.tags}),this._user&&Object.keys(this._user).length&&(Cr.user={...this._user,...Cr.user}),this._contexts&&Object.keys(this._contexts).length&&(Cr.contexts={...this._contexts,...Cr.contexts}),this._level&&(Cr.level=this._level),this._transactionName&&(Cr.transaction=this._transactionName),this._span){Cr.contexts={trace:this._span.getTraceContext(),...Cr.contexts};const Mr=this._span.transaction;if(Mr){Cr.sdkProcessingMetadata={dynamicSamplingContext:Mr.getDynamicSamplingContext(),...Cr.sdkProcessingMetadata};const Br=Mr.name;Br&&(Cr.tags={transaction:Br,...Cr.tags})}}this._applyFingerprint(Cr);const Rr=this._getBreadcrumbs(),Dr=[...Cr.breadcrumbs||[],...Rr];return Cr.breadcrumbs=Dr.length>0?Dr:void 0,Cr.sdkProcessingMetadata={...Cr.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},notifyEventProcessors([...Ar||[],...getGlobalEventProcessors(),...this._eventProcessors],Cr,$r)}setSDKProcessingMetadata(Cr){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...Cr},this}setPropagationContext(Cr){return this._propagationContext=Cr,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(Cr=>{Cr(this)}),this._notifyingListeners=!1)}_applyFingerprint(Cr){Cr.fingerprint=Cr.fingerprint?arrayify(Cr.fingerprint):[],this._fingerprint&&(Cr.fingerprint=Cr.fingerprint.concat(this._fingerprint)),Cr.fingerprint&&!Cr.fingerprint.length&&delete Cr.fingerprint}}function generatePropagationContext(){return{traceId:uuid4(),spanId:uuid4().substring(16)}}const API_VERSION=4,DEFAULT_BREADCRUMBS=100;class Hub{constructor(Cr,$r=new Scope,Ar=API_VERSION){this._version=Ar,this._stack=[{scope:$r}],Cr&&this.bindClient(Cr)}isOlderThan(Cr){return this._version{Dr.captureException(Cr,{originalException:Cr,syntheticException:Rr,...$r,event_id:Ar},Mr)}),Ar}captureMessage(Cr,$r,Ar){const Rr=this._lastEventId=Ar&&Ar.event_id?Ar.event_id:uuid4(),Dr=new Error(Cr);return this._withClient((Mr,Br)=>{Mr.captureMessage(Cr,$r,{originalException:Cr,syntheticException:Dr,...Ar,event_id:Rr},Br)}),Rr}captureEvent(Cr,$r){const Ar=$r&&$r.event_id?$r.event_id:uuid4();return Cr.type||(this._lastEventId=Ar),this._withClient((Rr,Dr)=>{Rr.captureEvent(Cr,{...$r,event_id:Ar},Dr)}),Ar}lastEventId(){return this._lastEventId}addBreadcrumb(Cr,$r){const{scope:Ar,client:Rr}=this.getStackTop();if(!Rr)return;const{beforeBreadcrumb:Dr=null,maxBreadcrumbs:Mr=DEFAULT_BREADCRUMBS}=Rr.getOptions&&Rr.getOptions()||{};if(Mr<=0)return;const Nr={timestamp:dateTimestampInSeconds(),...Cr},Lr=Dr?consoleSandbox(()=>Dr(Nr,$r)):Nr;Lr!==null&&(Rr.emit&&Rr.emit("beforeAddBreadcrumb",Lr,$r),Ar.addBreadcrumb(Lr,Mr))}setUser(Cr){this.getScope().setUser(Cr)}setTags(Cr){this.getScope().setTags(Cr)}setExtras(Cr){this.getScope().setExtras(Cr)}setTag(Cr,$r){this.getScope().setTag(Cr,$r)}setExtra(Cr,$r){this.getScope().setExtra(Cr,$r)}setContext(Cr,$r){this.getScope().setContext(Cr,$r)}configureScope(Cr){const{scope:$r,client:Ar}=this.getStackTop();Ar&&Cr($r)}run(Cr){const $r=makeMain(this);try{Cr(this)}finally{makeMain($r)}}getIntegration(Cr){const $r=this.getClient();if(!$r)return null;try{return $r.getIntegration(Cr)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`Cannot retrieve integration ${Cr.id} from the current Hub`),null}}startTransaction(Cr,$r){const Ar=this._callExtensionMethod("startTransaction",Cr,$r);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!Ar){const Rr=this.getClient();console.warn(Rr?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init': Sentry.addTracingExtensions(); Sentry.init({...}); `:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return Ar}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(Cr=!1){if(Cr)return this.endSession();this._sendSessionUpdate()}endSession(){const $r=this.getStackTop().scope,Ar=$r.getSession();Ar&&closeSession(Ar),this._sendSessionUpdate(),$r.setSession()}startSession(Cr){const{scope:$r,client:Ar}=this.getStackTop(),{release:Rr,environment:Dr=DEFAULT_ENVIRONMENT}=Ar&&Ar.getOptions()||{},{userAgent:Mr}=GLOBAL_OBJ.navigator||{},Br=makeSession$1({release:Rr,environment:Dr,user:$r.getUser(),...Mr&&{userAgent:Mr},...Cr}),Nr=$r.getSession&&$r.getSession();return Nr&&Nr.status==="ok"&&updateSession(Nr,{status:"exited"}),this.endSession(),$r.setSession(Br),Br}shouldSendDefaultPii(){const Cr=this.getClient(),$r=Cr&&Cr.getOptions();return!!($r&&$r.sendDefaultPii)}_sendSessionUpdate(){const{scope:Cr,client:$r}=this.getStackTop(),Ar=Cr.getSession();Ar&&$r&&$r.captureSession&&$r.captureSession(Ar)}_withClient(Cr){const{scope:$r,client:Ar}=this.getStackTop();Ar&&Cr(Ar,$r)}_callExtensionMethod(Cr,...$r){const Rr=getMainCarrier().__SENTRY__;if(Rr&&Rr.extensions&&typeof Rr.extensions[Cr]=="function")return Rr.extensions[Cr].apply(this,$r);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`Extension method ${Cr} couldn't be found, doing nothing.`)}}function getMainCarrier(){return GLOBAL_OBJ.__SENTRY__=GLOBAL_OBJ.__SENTRY__||{extensions:{},hub:void 0},GLOBAL_OBJ}function makeMain(Tr){const Cr=getMainCarrier(),$r=getHubFromCarrier(Cr);return setHubOnCarrier(Cr,Tr),$r}function getCurrentHub(){const Tr=getMainCarrier();if(Tr.__SENTRY__&&Tr.__SENTRY__.acs){const Cr=Tr.__SENTRY__.acs.getCurrentHub();if(Cr)return Cr}return getGlobalHub(Tr)}function getGlobalHub(Tr=getMainCarrier()){return(!hasHubOnCarrier(Tr)||getHubFromCarrier(Tr).isOlderThan(API_VERSION))&&setHubOnCarrier(Tr,new Hub),getHubFromCarrier(Tr)}function hasHubOnCarrier(Tr){return!!(Tr&&Tr.__SENTRY__&&Tr.__SENTRY__.hub)}function getHubFromCarrier(Tr){return getGlobalSingleton("hub",()=>new Hub,Tr)}function setHubOnCarrier(Tr,Cr){if(!Tr)return!1;const $r=Tr.__SENTRY__=Tr.__SENTRY__||{};return $r.hub=Cr,!0}function hasTracingEnabled(Tr){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const Cr=getCurrentHub().getClient(),$r=Tr||Cr&&Cr.getOptions();return!!$r&&($r.enableTracing||"tracesSampleRate"in $r||"tracesSampler"in $r)}function getActiveTransaction$1(Tr){return(Tr||getCurrentHub()).getScope().getTransaction()}let errorsInstrumented=!1;function registerErrorInstrumentation(){errorsInstrumented||(errorsInstrumented=!0,addInstrumentationHandler("error",errorCallback),addInstrumentationHandler("unhandledrejection",errorCallback))}function errorCallback(){const Tr=getActiveTransaction$1();if(Tr){const Cr="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`[Tracing] Transaction: ${Cr} -> Global error occured`),Tr.setStatus(Cr)}}errorCallback.tag="sentry_tracingErrorCallback";class SpanRecorder{constructor(Cr=1e3){this._maxlen=Cr,this.spans=[]}add(Cr){this.spans.length>this._maxlen?Cr.spanRecorder=void 0:this.spans.push(Cr)}}class Span{constructor(Cr={}){this.traceId=Cr.traceId||uuid4(),this.spanId=Cr.spanId||uuid4().substring(16),this.startTimestamp=Cr.startTimestamp||timestampInSeconds(),this.tags=Cr.tags||{},this.data=Cr.data||{},this.instrumenter=Cr.instrumenter||"sentry",this.origin=Cr.origin||"manual",Cr.parentSpanId&&(this.parentSpanId=Cr.parentSpanId),"sampled"in Cr&&(this.sampled=Cr.sampled),Cr.op&&(this.op=Cr.op),Cr.description&&(this.description=Cr.description),Cr.name&&(this.description=Cr.name),Cr.status&&(this.status=Cr.status),Cr.endTimestamp&&(this.endTimestamp=Cr.endTimestamp)}get name(){return this.description||""}set name(Cr){this.setName(Cr)}startChild(Cr){const $r=new Span({...Cr,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if($r.spanRecorder=this.spanRecorder,$r.spanRecorder&&$r.spanRecorder.add($r),$r.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$r.transaction){const Ar=Cr&&Cr.op||"< unknown op >",Rr=$r.transaction.name||"< unknown name >",Dr=$r.transaction.spanId,Mr=`[Tracing] Starting '${Ar}' span on transaction '${Rr}' (${Dr}).`;$r.transaction.metadata.spanMetadata[$r.spanId]={logMessage:Mr},logger.log(Mr)}return $r}setTag(Cr,$r){return this.tags={...this.tags,[Cr]:$r},this}setData(Cr,$r){return this.data={...this.data,[Cr]:$r},this}setStatus(Cr){return this.status=Cr,this}setHttpStatus(Cr){this.setTag("http.status_code",String(Cr)),this.setData("http.response.status_code",Cr);const $r=spanStatusfromHttpCode(Cr);return $r!=="unknown_error"&&this.setStatus($r),this}setName(Cr){this.description=Cr}isSuccess(){return this.status==="ok"}finish(Cr){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:$r}=this.transaction.metadata.spanMetadata[this.spanId];$r&&logger.log($r.replace("Starting","Finishing"))}this.endTimestamp=typeof Cr=="number"?Cr:timestampInSeconds()}toTraceparent(){return generateSentryTraceHeader(this.traceId,this.spanId,this.sampled)}toContext(){return dropUndefinedKeys({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(Cr){return this.data=Cr.data||{},this.description=Cr.description,this.endTimestamp=Cr.endTimestamp,this.op=Cr.op,this.parentSpanId=Cr.parentSpanId,this.sampled=Cr.sampled,this.spanId=Cr.spanId||this.spanId,this.startTimestamp=Cr.startTimestamp||this.startTimestamp,this.status=Cr.status,this.tags=Cr.tags||{},this.traceId=Cr.traceId||this.traceId,this}getTraceContext(){return dropUndefinedKeys({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return dropUndefinedKeys({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}}function spanStatusfromHttpCode(Tr){if(Tr<400&&Tr>=100)return"ok";if(Tr>=400&&Tr<500)switch(Tr){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(Tr>=500&&Tr<600)switch(Tr){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function getDynamicSamplingContextFromClient(Tr,Cr,$r){const Ar=Cr.getOptions(),{publicKey:Rr}=Cr.getDsn()||{},{segment:Dr}=$r&&$r.getUser()||{},Mr=dropUndefinedKeys({environment:Ar.environment||DEFAULT_ENVIRONMENT,release:Ar.release,user_segment:Dr,public_key:Rr,trace_id:Tr});return Cr.emit&&Cr.emit("createDsc",Mr),Mr}let Transaction$1=class extends Span{constructor(Cr,$r){super(Cr),delete this.description,this._measurements={},this._contexts={},this._hub=$r||getCurrentHub(),this._name=Cr.name||"",this.metadata={source:"custom",...Cr.metadata,spanMetadata:{}},this._trimEnd=Cr.trimEnd,this.transaction=this;const Ar=this.metadata.dynamicSamplingContext;Ar&&(this._frozenDynamicSamplingContext={...Ar})}get name(){return this._name}set name(Cr){this.setName(Cr)}setName(Cr,$r="custom"){this._name=Cr,this.metadata.source=$r}initSpanRecorder(Cr=1e3){this.spanRecorder||(this.spanRecorder=new SpanRecorder(Cr)),this.spanRecorder.add(this)}setContext(Cr,$r){$r===null?delete this._contexts[Cr]:this._contexts[Cr]=$r}setMeasurement(Cr,$r,Ar=""){this._measurements[Cr]={value:$r,unit:Ar}}setMetadata(Cr){this.metadata={...this.metadata,...Cr}}finish(Cr){const $r=this._finishTransaction(Cr);if($r)return this._hub.captureEvent($r)}toContext(){const Cr=super.toContext();return dropUndefinedKeys({...Cr,name:this.name,trimEnd:this._trimEnd})}updateWithContext(Cr){return super.updateWithContext(Cr),this.name=Cr.name||"",this._trimEnd=Cr.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const Cr=this._hub||getCurrentHub(),$r=Cr.getClient();if(!$r)return{};const Ar=Cr.getScope(),Rr=getDynamicSamplingContextFromClient(this.traceId,$r,Ar),Dr=this.metadata.sampleRate;Dr!==void 0&&(Rr.sample_rate=`${Dr}`);const Mr=this.metadata.source;return Mr&&Mr!=="url"&&(Rr.transaction=this.name),this.sampled!==void 0&&(Rr.sampled=String(this.sampled)),Rr}setHub(Cr){this._hub=Cr}_finishTransaction(Cr){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("Transaction has no name, falling back to ``."),this.name=""),super.finish(Cr);const $r=this._hub.getClient();if($r&&$r.emit&&$r.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),$r&&$r.recordDroppedEvent("sample_rate","transaction");return}const Ar=this.spanRecorder?this.spanRecorder.spans.filter(Br=>Br!==this&&Br.endTimestamp):[];this._trimEnd&&Ar.length>0&&(this.endTimestamp=Ar.reduce((Br,Nr)=>Br.endTimestamp&&Nr.endTimestamp?Br.endTimestamp>Nr.endTimestamp?Br:Nr:Br).endTimestamp);const Rr=this.metadata,Dr={contexts:{...this._contexts,trace:this.getTraceContext()},spans:Ar,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...Rr,dynamicSamplingContext:this.getDynamicSamplingContext()},...Rr.source&&{transaction_info:{source:Rr.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),Dr.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),Dr}};const TRACING_DEFAULTS={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},FINISH_REASON_TAG="finishReason",IDLE_TRANSACTION_FINISH_REASONS=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class IdleTransactionSpanRecorder extends SpanRecorder{constructor(Cr,$r,Ar,Rr){super(Rr),this._pushActivity=Cr,this._popActivity=$r,this.transactionSpanId=Ar}add(Cr){Cr.spanId!==this.transactionSpanId&&(Cr.finish=$r=>{Cr.endTimestamp=typeof $r=="number"?$r:timestampInSeconds(),this._popActivity(Cr.spanId)},Cr.endTimestamp===void 0&&this._pushActivity(Cr.spanId)),super.add(Cr)}}class IdleTransaction extends Transaction$1{constructor(Cr,$r,Ar=TRACING_DEFAULTS.idleTimeout,Rr=TRACING_DEFAULTS.finalTimeout,Dr=TRACING_DEFAULTS.heartbeatInterval,Mr=!1){super(Cr,$r),this._idleHub=$r,this._idleTimeout=Ar,this._finalTimeout=Rr,this._heartbeatInterval=Dr,this._onScope=Mr,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=IDLE_TRANSACTION_FINISH_REASONS[4],Mr&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),$r.configureScope(Br=>Br.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=IDLE_TRANSACTION_FINISH_REASONS[3],this.finish())},this._finalTimeout)}finish(Cr=timestampInSeconds()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(FINISH_REASON_TAG,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Tracing] finishing IdleTransaction",new Date(Cr*1e3).toISOString(),this.op);for(const $r of this._beforeFinishCallbacks)$r(this,Cr);this.spanRecorder.spans=this.spanRecorder.spans.filter($r=>{if($r.spanId===this.spanId)return!0;$r.endTimestamp||($r.endTimestamp=Cr,$r.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Tracing] cancelling span since transaction ended early",JSON.stringify($r,void 0,2)));const Ar=$r.startTimestamp"u"||__SENTRY_DEBUG__){const Mr=JSON.stringify($r,void 0,2);Ar?Dr||logger.log("[Tracing] discarding Span since it finished after Transaction final timeout",Mr):logger.log("[Tracing] discarding Span since it happened after Transaction was finished",Mr)}return Ar&&Dr}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Tracing] No active IdleTransaction");if(this._onScope){const $r=this._idleHub.getScope();$r.getTransaction()===this&&$r.setSpan(void 0)}return super.finish(Cr)}registerBeforeFinishCallback(Cr){this._beforeFinishCallbacks.push(Cr)}initSpanRecorder(Cr){if(!this.spanRecorder){const $r=Rr=>{this._finished||this._pushActivity(Rr)},Ar=Rr=>{this._finished||this._popActivity(Rr)};this.spanRecorder=new IdleTransactionSpanRecorder($r,Ar,this.spanId,Cr),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(Cr,{restartOnChildSpanChange:$r}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=$r===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=IDLE_TRANSACTION_FINISH_REASONS[5],this.finish(Cr)))}setFinishReason(Cr){this._finishReason=Cr}_restartIdleTimeout(Cr){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=IDLE_TRANSACTION_FINISH_REASONS[1],this.finish(Cr))},this._idleTimeout)}_pushActivity(Cr){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`[Tracing] pushActivity: ${Cr}`),this.activities[Cr]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(Cr){if(this.activities[Cr]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`[Tracing] popActivity ${Cr}`),delete this.activities[Cr],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const $r=timestampInSeconds();this._idleTimeoutCanceledPermanently?(this._finishReason=IDLE_TRANSACTION_FINISH_REASONS[5],this.finish($r)):this._restartIdleTimeout($r+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const Cr=Object.keys(this.activities).join("");Cr===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=Cr,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=IDLE_TRANSACTION_FINISH_REASONS[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function traceHeaders(){const Cr=this.getScope().getSpan();return Cr?{"sentry-trace":Cr.toTraceparent()}:{}}function sample(Tr,Cr,$r){if(!hasTracingEnabled(Cr))return Tr.sampled=!1,Tr;if(Tr.sampled!==void 0)return Tr.setMetadata({sampleRate:Number(Tr.sampled)}),Tr;let Ar;return typeof Cr.tracesSampler=="function"?(Ar=Cr.tracesSampler($r),Tr.setMetadata({sampleRate:Number(Ar)})):$r.parentSampled!==void 0?Ar=$r.parentSampled:typeof Cr.tracesSampleRate<"u"?(Ar=Cr.tracesSampleRate,Tr.setMetadata({sampleRate:Number(Ar)})):(Ar=1,Tr.setMetadata({sampleRate:Ar})),isValidSampleRate(Ar)?Ar?(Tr.sampled=Math.random()"u"||__SENTRY_DEBUG__)&&logger.log(`[Tracing] starting ${Tr.op} transaction - ${Tr.name}`),Tr):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(Ar)})`),Tr)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`[Tracing] Discarding transaction because ${typeof Cr.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),Tr.sampled=!1,Tr):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("[Tracing] Discarding transaction because of invalid sample rate."),Tr.sampled=!1,Tr)}function isValidSampleRate(Tr){return isNaN$1(Tr)||!(typeof Tr=="number"||typeof Tr=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(Tr)} of type ${JSON.stringify(typeof Tr)}.`),!1):Tr<0||Tr>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${Tr}.`),!1):!0}function _startTransaction(Tr,Cr){const $r=this.getClient(),Ar=$r&&$r.getOptions()||{},Rr=Ar.instrumenter||"sentry",Dr=Tr.instrumenter||"sentry";Rr!==Dr&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error(`A transaction was started with instrumenter=\`${Dr}\`, but the SDK is configured with the \`${Rr}\` instrumenter. The transaction will not be sampled. Please use the ${Rr} instrumentation to start transactions.`),Tr.sampled=!1);let Mr=new Transaction$1(Tr,this);return Mr=sample(Mr,Ar,{parentSampled:Tr.parentSampled,transactionContext:Tr,...Cr}),Mr.sampled&&Mr.initSpanRecorder(Ar._experiments&&Ar._experiments.maxSpans),$r&&$r.emit&&$r.emit("startTransaction",Mr),Mr}function startIdleTransaction(Tr,Cr,$r,Ar,Rr,Dr,Mr){const Br=Tr.getClient(),Nr=Br&&Br.getOptions()||{};let Lr=new IdleTransaction(Cr,Tr,$r,Ar,Mr,Rr);return Lr=sample(Lr,Nr,{parentSampled:Cr.parentSampled,transactionContext:Cr,...Dr}),Lr.sampled&&Lr.initSpanRecorder(Nr._experiments&&Nr._experiments.maxSpans),Br&&Br.emit&&Br.emit("startTransaction",Lr),Lr}function addTracingExtensions(){const Tr=getMainCarrier();Tr.__SENTRY__&&(Tr.__SENTRY__.extensions=Tr.__SENTRY__.extensions||{},Tr.__SENTRY__.extensions.startTransaction||(Tr.__SENTRY__.extensions.startTransaction=_startTransaction),Tr.__SENTRY__.extensions.traceHeaders||(Tr.__SENTRY__.extensions.traceHeaders=traceHeaders),registerErrorInstrumentation())}function captureException(Tr,Cr){return getCurrentHub().captureException(Tr,{captureContext:Cr})}function setContext(Tr,Cr){getCurrentHub().setContext(Tr,Cr)}function withScope(Tr){getCurrentHub().withScope(Tr)}const SENTRY_API_VERSION="7";function getBaseApiEndpoint(Tr){const Cr=Tr.protocol?`${Tr.protocol}:`:"",$r=Tr.port?`:${Tr.port}`:"";return`${Cr}//${Tr.host}${$r}${Tr.path?`/${Tr.path}`:""}/api/`}function _getIngestEndpoint(Tr){return`${getBaseApiEndpoint(Tr)}${Tr.projectId}/envelope/`}function _encodedAuth(Tr,Cr){return urlEncode({sentry_key:Tr.publicKey,sentry_version:SENTRY_API_VERSION,...Cr&&{sentry_client:`${Cr.name}/${Cr.version}`}})}function getEnvelopeEndpointWithUrlEncodedAuth(Tr,Cr={}){const $r=typeof Cr=="string"?Cr:Cr.tunnel,Ar=typeof Cr=="string"||!Cr._metadata?void 0:Cr._metadata.sdk;return $r||`${_getIngestEndpoint(Tr)}?${_encodedAuth(Tr,Ar)}`}function enhanceEventWithSdkInfo(Tr,Cr){return Cr&&(Tr.sdk=Tr.sdk||{},Tr.sdk.name=Tr.sdk.name||Cr.name,Tr.sdk.version=Tr.sdk.version||Cr.version,Tr.sdk.integrations=[...Tr.sdk.integrations||[],...Cr.integrations||[]],Tr.sdk.packages=[...Tr.sdk.packages||[],...Cr.packages||[]]),Tr}function createSessionEnvelope(Tr,Cr,$r,Ar){const Rr=getSdkMetadataForEnvelopeHeader($r),Dr={sent_at:new Date().toISOString(),...Rr&&{sdk:Rr},...!!Ar&&Cr&&{dsn:dsnToString(Cr)}},Mr="aggregates"in Tr?[{type:"sessions"},Tr]:[{type:"session"},Tr.toJSON()];return createEnvelope(Dr,[Mr])}function createEventEnvelope(Tr,Cr,$r,Ar){const Rr=getSdkMetadataForEnvelopeHeader($r),Dr=Tr.type&&Tr.type!=="replay_event"?Tr.type:"event";enhanceEventWithSdkInfo(Tr,$r&&$r.sdk);const Mr=createEventEnvelopeHeaders(Tr,Rr,Ar,Cr);return delete Tr.sdkProcessingMetadata,createEnvelope(Mr,[[{type:Dr},Tr]])}const installedIntegrations=[];function filterDuplicates(Tr){const Cr={};return Tr.forEach($r=>{const{name:Ar}=$r,Rr=Cr[Ar];Rr&&!Rr.isDefaultInstance&&$r.isDefaultInstance||(Cr[Ar]=$r)}),Object.keys(Cr).map($r=>Cr[$r])}function getIntegrationsToSetup(Tr){const Cr=Tr.defaultIntegrations||[],$r=Tr.integrations;Cr.forEach(Mr=>{Mr.isDefaultInstance=!0});let Ar;Array.isArray($r)?Ar=[...Cr,...$r]:typeof $r=="function"?Ar=arrayify($r(Cr)):Ar=Cr;const Rr=filterDuplicates(Ar),Dr=findIndex(Rr,Mr=>Mr.name==="Debug");if(Dr!==-1){const[Mr]=Rr.splice(Dr,1);Rr.push(Mr)}return Rr}function setupIntegrations(Tr,Cr){const $r={};return Cr.forEach(Ar=>{Ar&&setupIntegration(Tr,Ar,$r)}),$r}function setupIntegration(Tr,Cr,$r){if($r[Cr.name]=Cr,installedIntegrations.indexOf(Cr.name)===-1&&(Cr.setupOnce(addGlobalEventProcessor,getCurrentHub),installedIntegrations.push(Cr.name)),Tr.on&&typeof Cr.preprocessEvent=="function"){const Ar=Cr.preprocessEvent.bind(Cr);Tr.on("preprocessEvent",(Rr,Dr)=>Ar(Rr,Dr,Tr))}if(Tr.addEventProcessor&&typeof Cr.processEvent=="function"){const Ar=Cr.processEvent.bind(Cr),Rr=Object.assign((Dr,Mr)=>Ar(Dr,Mr,Tr),{id:Cr.name});Tr.addEventProcessor(Rr)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`Integration installed: ${Cr.name}`)}function findIndex(Tr,Cr){for(let $r=0;$rUr.name);applyClientOptions(Br,Tr),applyIntegrationsMetadata(Br,Nr),Cr.type===void 0&&applyDebugIds(Br,Tr.stackParser);let Lr=Ar;$r.captureContext&&(Lr=Scope.clone(Lr).update($r.captureContext));let Hr=resolvedSyncPromise(Br);const zr=Rr&&Rr.getEventProcessors?Rr.getEventProcessors():[];if(Lr){if(Lr.getAttachments){const Ur=[...$r.attachments||[],...Lr.getAttachments()];Ur.length&&($r.attachments=Ur)}Hr=Lr.applyToEvent(Br,$r,zr)}else Hr=notifyEventProcessors([...zr,...getGlobalEventProcessors()],Br,$r);return Hr.then(Ur=>(Ur&&applyDebugMeta(Ur),typeof Dr=="number"&&Dr>0?normalizeEvent(Ur,Dr,Mr):Ur))}function applyClientOptions(Tr,Cr){const{environment:$r,release:Ar,dist:Rr,maxValueLength:Dr=250}=Cr;"environment"in Tr||(Tr.environment="environment"in Cr?$r:DEFAULT_ENVIRONMENT),Tr.release===void 0&&Ar!==void 0&&(Tr.release=Ar),Tr.dist===void 0&&Rr!==void 0&&(Tr.dist=Rr),Tr.message&&(Tr.message=truncate(Tr.message,Dr));const Mr=Tr.exception&&Tr.exception.values&&Tr.exception.values[0];Mr&&Mr.value&&(Mr.value=truncate(Mr.value,Dr));const Br=Tr.request;Br&&Br.url&&(Br.url=truncate(Br.url,Dr))}const debugIdStackParserCache=new WeakMap;function applyDebugIds(Tr,Cr){const $r=GLOBAL_OBJ._sentryDebugIds;if(!$r)return;let Ar;const Rr=debugIdStackParserCache.get(Cr);Rr?Ar=Rr:(Ar=new Map,debugIdStackParserCache.set(Cr,Ar));const Dr=Object.keys($r).reduce((Mr,Br)=>{let Nr;const Lr=Ar.get(Br);Lr?Nr=Lr:(Nr=Cr(Br),Ar.set(Br,Nr));for(let Hr=Nr.length-1;Hr>=0;Hr--){const zr=Nr[Hr];if(zr.filename){Mr[zr.filename]=$r[Br];break}}return Mr},{});try{Tr.exception.values.forEach(Mr=>{Mr.stacktrace.frames.forEach(Br=>{Br.filename&&(Br.debug_id=Dr[Br.filename])})})}catch{}}function applyDebugMeta(Tr){const Cr={};try{Tr.exception.values.forEach(Ar=>{Ar.stacktrace.frames.forEach(Rr=>{Rr.debug_id&&(Rr.abs_path?Cr[Rr.abs_path]=Rr.debug_id:Rr.filename&&(Cr[Rr.filename]=Rr.debug_id),delete Rr.debug_id)})})}catch{}if(Object.keys(Cr).length===0)return;Tr.debug_meta=Tr.debug_meta||{},Tr.debug_meta.images=Tr.debug_meta.images||[];const $r=Tr.debug_meta.images;Object.keys(Cr).forEach(Ar=>{$r.push({type:"sourcemap",code_file:Ar,debug_id:Cr[Ar]})})}function applyIntegrationsMetadata(Tr,Cr){Cr.length>0&&(Tr.sdk=Tr.sdk||{},Tr.sdk.integrations=[...Tr.sdk.integrations||[],...Cr])}function normalizeEvent(Tr,Cr,$r){if(!Tr)return null;const Ar={...Tr,...Tr.breadcrumbs&&{breadcrumbs:Tr.breadcrumbs.map(Rr=>({...Rr,...Rr.data&&{data:normalize$3(Rr.data,Cr,$r)}}))},...Tr.user&&{user:normalize$3(Tr.user,Cr,$r)},...Tr.contexts&&{contexts:normalize$3(Tr.contexts,Cr,$r)},...Tr.extra&&{extra:normalize$3(Tr.extra,Cr,$r)}};return Tr.contexts&&Tr.contexts.trace&&Ar.contexts&&(Ar.contexts.trace=Tr.contexts.trace,Tr.contexts.trace.data&&(Ar.contexts.trace.data=normalize$3(Tr.contexts.trace.data,Cr,$r))),Tr.spans&&(Ar.spans=Tr.spans.map(Rr=>(Rr.data&&(Rr.data=normalize$3(Rr.data,Cr,$r)),Rr))),Ar}const ALREADY_SEEN_ERROR="Not capturing exception because it's already been captured.";class BaseClient{constructor(Cr){if(this._options=Cr,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],Cr.dsn?this._dsn=makeDsn(Cr.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("No DSN provided, client will not send events."),this._dsn){const $r=getEnvelopeEndpointWithUrlEncodedAuth(this._dsn,Cr);this._transport=Cr.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...Cr.transportOptions,url:$r})}}captureException(Cr,$r,Ar){if(checkOrSetAlreadyCaught(Cr)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(ALREADY_SEEN_ERROR);return}let Rr=$r&&$r.event_id;return this._process(this.eventFromException(Cr,$r).then(Dr=>this._captureEvent(Dr,$r,Ar)).then(Dr=>{Rr=Dr})),Rr}captureMessage(Cr,$r,Ar,Rr){let Dr=Ar&&Ar.event_id;const Mr=isPrimitive(Cr)?this.eventFromMessage(String(Cr),$r,Ar):this.eventFromException(Cr,Ar);return this._process(Mr.then(Br=>this._captureEvent(Br,Ar,Rr)).then(Br=>{Dr=Br})),Dr}captureEvent(Cr,$r,Ar){if($r&&$r.originalException&&checkOrSetAlreadyCaught($r.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(ALREADY_SEEN_ERROR);return}let Rr=$r&&$r.event_id;return this._process(this._captureEvent(Cr,$r,Ar).then(Dr=>{Rr=Dr})),Rr}captureSession(Cr){typeof Cr.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("Discarded session because of missing or non-string release"):(this.sendSession(Cr),updateSession(Cr,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(Cr){const $r=this._transport;return $r?this._isClientDoneProcessing(Cr).then(Ar=>$r.flush(Cr).then(Rr=>Ar&&Rr)):resolvedSyncPromise(!0)}close(Cr){return this.flush(Cr).then($r=>(this.getOptions().enabled=!1,$r))}getEventProcessors(){return this._eventProcessors}addEventProcessor(Cr){this._eventProcessors.push(Cr)}setupIntegrations(Cr){(Cr&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=setupIntegrations(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(Cr){return this._integrations[Cr]}getIntegration(Cr){try{return this._integrations[Cr.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`Cannot retrieve integration ${Cr.id} from the current Client`),null}}addIntegration(Cr){setupIntegration(this,Cr,this._integrations)}sendEvent(Cr,$r={}){this.emit("beforeSendEvent",Cr,$r);let Ar=createEventEnvelope(Cr,this._dsn,this._options._metadata,this._options.tunnel);for(const Dr of $r.attachments||[])Ar=addItemToEnvelope(Ar,createAttachmentEnvelopeItem(Dr,this._options.transportOptions&&this._options.transportOptions.textEncoder));const Rr=this._sendEnvelope(Ar);Rr&&Rr.then(Dr=>this.emit("afterSendEvent",Cr,Dr),null)}sendSession(Cr){const $r=createSessionEnvelope(Cr,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope($r)}recordDroppedEvent(Cr,$r,Ar){if(this._options.sendClientReports){const Rr=`${Cr}:${$r}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`Adding outcome: "${Rr}"`),this._outcomes[Rr]=this._outcomes[Rr]+1||1}}on(Cr,$r){this._hooks[Cr]||(this._hooks[Cr]=[]),this._hooks[Cr].push($r)}emit(Cr,...$r){this._hooks[Cr]&&this._hooks[Cr].forEach(Ar=>Ar(...$r))}_updateSessionFromEvent(Cr,$r){let Ar=!1,Rr=!1;const Dr=$r.exception&&$r.exception.values;if(Dr){Rr=!0;for(const Nr of Dr){const Lr=Nr.mechanism;if(Lr&&Lr.handled===!1){Ar=!0;break}}}const Mr=Cr.status==="ok";(Mr&&Cr.errors===0||Mr&&Ar)&&(updateSession(Cr,{...Ar&&{status:"crashed"},errors:Cr.errors||Number(Rr||Ar)}),this.captureSession(Cr))}_isClientDoneProcessing(Cr){return new SyncPromise($r=>{let Ar=0;const Rr=1,Dr=setInterval(()=>{this._numProcessing==0?(clearInterval(Dr),$r(!0)):(Ar+=Rr,Cr&&Ar>=Cr&&(clearInterval(Dr),$r(!1)))},Rr)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(Cr,$r,Ar){const Rr=this.getOptions(),Dr=Object.keys(this._integrations);return!$r.integrations&&Dr.length>0&&($r.integrations=Dr),this.emit("preprocessEvent",Cr,$r),prepareEvent(Rr,Cr,$r,Ar,this).then(Mr=>{if(Mr===null)return Mr;const{propagationContext:Br}=Mr.sdkProcessingMetadata||{};if(!(Mr.contexts&&Mr.contexts.trace)&&Br){const{traceId:Lr,spanId:Hr,parentSpanId:zr,dsc:Ur}=Br;Mr.contexts={trace:{trace_id:Lr,span_id:Hr,parent_span_id:zr},...Mr.contexts};const Vr=Ur||getDynamicSamplingContextFromClient(Lr,this,Ar);Mr.sdkProcessingMetadata={dynamicSamplingContext:Vr,...Mr.sdkProcessingMetadata}}return Mr})}_captureEvent(Cr,$r={},Ar){return this._processEvent(Cr,$r,Ar).then(Rr=>Rr.event_id,Rr=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const Dr=Rr;Dr.logLevel==="log"?logger.log(Dr.message):logger.warn(Dr)}})}_processEvent(Cr,$r,Ar){const Rr=this.getOptions(),{sampleRate:Dr}=Rr,Mr=isTransactionEvent$1(Cr),Br=isErrorEvent$1(Cr),Nr=Cr.type||"error",Lr=`before send for type \`${Nr}\``;if(Br&&typeof Dr=="number"&&Math.random()>Dr)return this.recordDroppedEvent("sample_rate","error",Cr),rejectedSyncPromise(new SentryError(`Discarding event because it's not included in the random sample (sampling rate = ${Dr})`,"log"));const Hr=Nr==="replay_event"?"replay":Nr;return this._prepareEvent(Cr,$r,Ar).then(zr=>{if(zr===null)throw this.recordDroppedEvent("event_processor",Hr,Cr),new SentryError("An event processor returned `null`, will not send event.","log");if($r.data&&$r.data.__sentry__===!0)return zr;const Vr=processBeforeSend(Rr,zr,$r);return _validateBeforeSendResult(Vr,Lr)}).then(zr=>{if(zr===null)throw this.recordDroppedEvent("before_send",Hr,Cr),new SentryError(`${Lr} returned \`null\`, will not send event.`,"log");const Ur=Ar&&Ar.getSession();!Mr&&Ur&&this._updateSessionFromEvent(Ur,zr);const Vr=zr.transaction_info;if(Mr&&Vr&&zr.transaction!==Cr.transaction){const jr="custom";zr.transaction_info={...Vr,source:jr}}return this.sendEvent(zr,$r),zr}).then(null,zr=>{throw zr instanceof SentryError?zr:(this.captureException(zr,{data:{__sentry__:!0},originalException:zr}),new SentryError(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${zr}`))})}_process(Cr){this._numProcessing++,Cr.then($r=>(this._numProcessing--,$r),$r=>(this._numProcessing--,$r))}_sendEnvelope(Cr){if(this.emit("beforeEnvelope",Cr),this._isEnabled()&&this._transport)return this._transport.send(Cr).then(null,$r=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error("Error while sending event:",$r)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error("Transport disabled")}_clearOutcomes(){const Cr=this._outcomes;return this._outcomes={},Object.keys(Cr).map($r=>{const[Ar,Rr]=$r.split(":");return{reason:Ar,category:Rr,quantity:Cr[$r]}})}}function _validateBeforeSendResult(Tr,Cr){const $r=`${Cr} must return \`null\` or a valid event.`;if(isThenable(Tr))return Tr.then(Ar=>{if(!isPlainObject$1(Ar)&&Ar!==null)throw new SentryError($r);return Ar},Ar=>{throw new SentryError(`${Cr} rejected with ${Ar}`)});if(!isPlainObject$1(Tr)&&Tr!==null)throw new SentryError($r);return Tr}function processBeforeSend(Tr,Cr,$r){const{beforeSend:Ar,beforeSendTransaction:Rr}=Tr;return isErrorEvent$1(Cr)&&Ar?Ar(Cr,$r):isTransactionEvent$1(Cr)&&Rr?Rr(Cr,$r):Cr}function isErrorEvent$1(Tr){return Tr.type===void 0}function isTransactionEvent$1(Tr){return Tr.type==="transaction"}function initAndBind(Tr,Cr){Cr.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?logger.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const $r=getCurrentHub();$r.getScope().update(Cr.initialScope);const Rr=new Tr(Cr);$r.bindClient(Rr)}const DEFAULT_TRANSPORT_BUFFER_SIZE=30;function createTransport(Tr,Cr,$r=makePromiseBuffer(Tr.bufferSize||DEFAULT_TRANSPORT_BUFFER_SIZE)){let Ar={};const Rr=Mr=>$r.drain(Mr);function Dr(Mr){const Br=[];if(forEachEnvelopeItem(Mr,(zr,Ur)=>{const Vr=envelopeItemTypeToDataCategory(Ur);if(isRateLimited(Ar,Vr)){const jr=getEventForEnvelopeItem(zr,Ur);Tr.recordDroppedEvent("ratelimit_backoff",Vr,jr)}else Br.push(zr)}),Br.length===0)return resolvedSyncPromise();const Nr=createEnvelope(Mr[0],Br),Lr=zr=>{forEachEnvelopeItem(Nr,(Ur,Vr)=>{const jr=getEventForEnvelopeItem(Ur,Vr);Tr.recordDroppedEvent(zr,envelopeItemTypeToDataCategory(Vr),jr)})},Hr=()=>Cr({body:serializeEnvelope(Nr,Tr.textEncoder)}).then(zr=>(zr.statusCode!==void 0&&(zr.statusCode<200||zr.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`Sentry responded with status code ${zr.statusCode} to sent event.`),Ar=updateRateLimits(Ar,zr),zr),zr=>{throw Lr("network_error"),zr});return $r.add(Hr).then(zr=>zr,zr=>{if(zr instanceof SentryError)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error("Skipped sending event because buffer is full."),Lr("queue_overflow"),resolvedSyncPromise();throw zr})}return Dr.__sentry__baseTransport__=!0,{send:Dr,flush:Rr}}function getEventForEnvelopeItem(Tr,Cr){if(!(Cr!=="event"&&Cr!=="transaction"))return Array.isArray(Tr)?Tr[1]:void 0}const SDK_VERSION="7.73.0";let originalFunctionToString;class FunctionToString{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=FunctionToString.id}setupOnce(){originalFunctionToString=Function.prototype.toString;try{Function.prototype.toString=function(...Cr){const $r=getOriginalFunction(this)||this;return originalFunctionToString.apply($r,Cr)}}catch{}}}FunctionToString.__initStatic();const DEFAULT_IGNORE_ERRORS=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],DEFAULT_IGNORE_TRANSACTIONS=[/^.*healthcheck.*$/,/^.*healthy.*$/,/^.*live.*$/,/^.*ready.*$/,/^.*heartbeat.*$/,/^.*\/health$/,/^.*\/healthz$/];class InboundFilters{static __initStatic(){this.id="InboundFilters"}constructor(Cr={}){this.name=InboundFilters.id,this._options=Cr}setupOnce(Cr,$r){}processEvent(Cr,$r,Ar){const Rr=Ar.getOptions(),Dr=_mergeOptions(this._options,Rr);return _shouldDropEvent$1(Cr,Dr)?null:Cr}}InboundFilters.__initStatic();function _mergeOptions(Tr={},Cr={}){return{allowUrls:[...Tr.allowUrls||[],...Cr.allowUrls||[]],denyUrls:[...Tr.denyUrls||[],...Cr.denyUrls||[]],ignoreErrors:[...Tr.ignoreErrors||[],...Cr.ignoreErrors||[],...Tr.disableErrorDefaults?[]:DEFAULT_IGNORE_ERRORS],ignoreTransactions:[...Tr.ignoreTransactions||[],...Cr.ignoreTransactions||[],...Tr.disableTransactionDefaults?[]:DEFAULT_IGNORE_TRANSACTIONS],ignoreInternal:Tr.ignoreInternal!==void 0?Tr.ignoreInternal:!0}}function _shouldDropEvent$1(Tr,Cr){return Cr.ignoreInternal&&_isSentryError(Tr)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`Event dropped due to being internal Sentry Error. Event: ${getEventDescription(Tr)}`),!0):_isIgnoredError(Tr,Cr.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${getEventDescription(Tr)}`),!0):_isIgnoredTransaction(Tr,Cr.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${getEventDescription(Tr)}`),!0):_isDeniedUrl(Tr,Cr.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${getEventDescription(Tr)}. Url: ${_getEventFilterUrl(Tr)}`),!0):_isAllowedUrl(Tr,Cr.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${getEventDescription(Tr)}. Url: ${_getEventFilterUrl(Tr)}`),!0)}function _isIgnoredError(Tr,Cr){return Tr.type||!Cr||!Cr.length?!1:_getPossibleEventMessages(Tr).some($r=>stringMatchesSomePattern($r,Cr))}function _isIgnoredTransaction(Tr,Cr){if(Tr.type!=="transaction"||!Cr||!Cr.length)return!1;const $r=Tr.transaction;return $r?stringMatchesSomePattern($r,Cr):!1}function _isDeniedUrl(Tr,Cr){if(!Cr||!Cr.length)return!1;const $r=_getEventFilterUrl(Tr);return $r?stringMatchesSomePattern($r,Cr):!1}function _isAllowedUrl(Tr,Cr){if(!Cr||!Cr.length)return!0;const $r=_getEventFilterUrl(Tr);return $r?stringMatchesSomePattern($r,Cr):!0}function _getPossibleEventMessages(Tr){const Cr=[];Tr.message&&Cr.push(Tr.message);let $r;try{$r=Tr.exception.values[Tr.exception.values.length-1]}catch{}return $r&&$r.value&&(Cr.push($r.value),$r.type&&Cr.push(`${$r.type}: ${$r.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Cr.length===0&&logger.error(`Could not extract message for event ${getEventDescription(Tr)}`),Cr}function _isSentryError(Tr){try{return Tr.exception.values[0].type==="SentryError"}catch{}return!1}function _getLastValidUrl(Tr=[]){for(let Cr=Tr.length-1;Cr>=0;Cr--){const $r=Tr[Cr];if($r&&$r.filename!==""&&$r.filename!=="[native code]")return $r.filename||null}return null}function _getEventFilterUrl(Tr){try{let Cr;try{Cr=Tr.exception.values[0].stacktrace.frames}catch{}return Cr?_getLastValidUrl(Cr):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error(`Cannot extract url for event ${getEventDescription(Tr)}`),null}}function isSentryRequestUrl(Tr,Cr){const $r=Cr.getClient(),Ar=$r&&$r.getDsn(),Rr=$r&&$r.getOptions().tunnel;return checkDsn(Tr,Ar)||checkTunnel(Tr,Rr)}function checkTunnel(Tr,Cr){return Cr?removeTrailingSlash(Tr)===removeTrailingSlash(Cr):!1}function checkDsn(Tr,Cr){return Cr?Tr.includes(Cr.host):!1}function removeTrailingSlash(Tr){return Tr[Tr.length-1]==="/"?Tr.slice(0,-1):Tr}class HttpClient{static __initStatic(){this.id="HttpClient"}constructor(Cr){this.name=HttpClient.id,this._options={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...Cr}}setupOnce(Cr,$r){this._getCurrentHub=$r,this._wrapFetch(),this._wrapXHR()}_fetchResponseHandler(Cr,$r,Ar){if(this._getCurrentHub&&this._shouldCaptureResponse($r.status,$r.url)){const Rr=_getRequest(Cr,Ar),Dr=this._getCurrentHub();let Mr,Br,Nr,Lr;Dr.shouldSendDefaultPii()&&([{headers:Mr,cookies:Nr},{headers:Br,cookies:Lr}]=[{cookieHeader:"Cookie",obj:Rr},{cookieHeader:"Set-Cookie",obj:$r}].map(({cookieHeader:zr,obj:Ur})=>{const Vr=this._extractFetchHeaders(Ur.headers);let jr;try{const Gr=Vr[zr]||Vr[zr.toLowerCase()]||void 0;Gr&&(jr=this._parseCookieString(Gr))}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`Could not extract cookies from header ${zr}`)}return{headers:Vr,cookies:jr}}));const Hr=this._createEvent({url:Rr.url,method:Rr.method,status:$r.status,requestHeaders:Mr,responseHeaders:Br,requestCookies:Nr,responseCookies:Lr});Dr.captureEvent(Hr)}}_xhrResponseHandler(Cr,$r,Ar){if(this._getCurrentHub&&this._shouldCaptureResponse(Cr.status,Cr.responseURL)){let Rr,Dr,Mr;const Br=this._getCurrentHub();if(Br.shouldSendDefaultPii()){try{const Lr=Cr.getResponseHeader("Set-Cookie")||Cr.getResponseHeader("set-cookie")||void 0;Lr&&(Dr=this._parseCookieString(Lr))}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("Could not extract cookies from response headers")}try{Mr=this._getXHRResponseHeaders(Cr)}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("Could not extract headers from response")}Rr=Ar}const Nr=this._createEvent({url:Cr.responseURL,method:$r,status:Cr.status,requestHeaders:Rr,responseHeaders:Mr,responseCookies:Dr});Br.captureEvent(Nr)}}_getResponseSizeFromHeaders(Cr){if(Cr){const $r=Cr["Content-Length"]||Cr["content-length"];if($r)return parseInt($r,10)}}_parseCookieString(Cr){return Cr.split("; ").reduce(($r,Ar)=>{const[Rr,Dr]=Ar.split("=");return $r[Rr]=Dr,$r},{})}_extractFetchHeaders(Cr){const $r={};return Cr.forEach((Ar,Rr)=>{$r[Rr]=Ar}),$r}_getXHRResponseHeaders(Cr){const $r=Cr.getAllResponseHeaders();return $r?$r.split(`\r `).reduce((Ar,Rr)=>{const[Dr,Mr]=Rr.split(": ");return Ar[Dr]=Mr,Ar},{}):{}}_isInGivenRequestTargets(Cr){return this._options.failedRequestTargets?this._options.failedRequestTargets.some($r=>typeof $r=="string"?Cr.includes($r):$r.test(Cr)):!1}_isInGivenStatusRanges(Cr){return this._options.failedRequestStatusCodes?this._options.failedRequestStatusCodes.some($r=>typeof $r=="number"?$r===Cr:Cr>=$r[0]&&Cr<=$r[1]):!1}_wrapFetch(){supportsNativeFetch()&&addInstrumentationHandler("fetch",Cr=>{const{response:$r,args:Ar}=Cr,[Rr,Dr]=Ar;$r&&this._fetchResponseHandler(Rr,$r,Dr)})}_wrapXHR(){"XMLHttpRequest"in GLOBAL_OBJ&&addInstrumentationHandler("xhr",Cr=>{const{xhr:$r}=Cr,Ar=$r[SENTRY_XHR_DATA_KEY];if(!Ar)return;const{method:Rr,request_headers:Dr}=Ar;if(Rr)try{this._xhrResponseHandler($r,Rr,Dr)}catch(Mr){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("Error while extracting response event form XHR response",Mr)}})}_shouldCaptureResponse(Cr,$r){return this._isInGivenStatusRanges(Cr)&&this._isInGivenRequestTargets($r)&&!isSentryRequestUrl($r,getCurrentHub())}_createEvent(Cr){const $r=`HTTP Client Error with status code: ${Cr.status}`,Ar={message:$r,exception:{values:[{type:"Error",value:$r}]},request:{url:Cr.url,method:Cr.method,headers:Cr.requestHeaders,cookies:Cr.requestCookies},contexts:{response:{status_code:Cr.status,headers:Cr.responseHeaders,cookies:Cr.responseCookies,body_size:this._getResponseSizeFromHeaders(Cr.responseHeaders)}}};return addExceptionMechanism(Ar,{type:"http.client",handled:!1}),Ar}}HttpClient.__initStatic();function _getRequest(Tr,Cr){return!Cr&&Tr instanceof Request||Tr instanceof Request&&Tr.bodyUsed?Tr:new Request(Tr,Cr)}const WINDOW$2=GLOBAL_OBJ;let ignoreOnError=0;function shouldIgnoreOnError(){return ignoreOnError>0}function ignoreNextOnError(){ignoreOnError++,setTimeout(()=>{ignoreOnError--})}function wrap$1(Tr,Cr={},$r){if(typeof Tr!="function")return Tr;try{const Rr=Tr.__sentry_wrapped__;if(Rr)return Rr;if(getOriginalFunction(Tr))return Tr}catch{return Tr}const Ar=function(){const Rr=Array.prototype.slice.call(arguments);try{$r&&typeof $r=="function"&&$r.apply(this,arguments);const Dr=Rr.map(Mr=>wrap$1(Mr,Cr));return Tr.apply(this,Dr)}catch(Dr){throw ignoreNextOnError(),withScope(Mr=>{Mr.addEventProcessor(Br=>(Cr.mechanism&&(addExceptionTypeValue(Br,void 0,void 0),addExceptionMechanism(Br,Cr.mechanism)),Br.extra={...Br.extra,arguments:Rr},Br)),captureException(Dr)}),Dr}};try{for(const Rr in Tr)Object.prototype.hasOwnProperty.call(Tr,Rr)&&(Ar[Rr]=Tr[Rr])}catch{}markFunctionWrapped(Ar,Tr),addNonEnumerableProperty(Tr,"__sentry_wrapped__",Ar);try{Object.getOwnPropertyDescriptor(Ar,"name").configurable&&Object.defineProperty(Ar,"name",{get(){return Tr.name}})}catch{}return Ar}function exceptionFromError(Tr,Cr){const $r=parseStackFrames(Tr,Cr),Ar={type:Cr&&Cr.name,value:extractMessage(Cr)};return $r.length&&(Ar.stacktrace={frames:$r}),Ar.type===void 0&&Ar.value===""&&(Ar.value="Unrecoverable error caught"),Ar}function eventFromPlainObject(Tr,Cr,$r,Ar){const Dr=getCurrentHub().getClient(),Mr=Dr&&Dr.getOptions().normalizeDepth,Br={exception:{values:[{type:isEvent(Cr)?Cr.constructor.name:Ar?"UnhandledRejection":"Error",value:getNonErrorObjectExceptionValue(Cr,{isUnhandledRejection:Ar})}]},extra:{__serialized__:normalizeToSize(Cr,Mr)}};if($r){const Nr=parseStackFrames(Tr,$r);Nr.length&&(Br.exception.values[0].stacktrace={frames:Nr})}return Br}function eventFromError(Tr,Cr){return{exception:{values:[exceptionFromError(Tr,Cr)]}}}function parseStackFrames(Tr,Cr){const $r=Cr.stacktrace||Cr.stack||"",Ar=getPopSize(Cr);try{return Tr($r,Ar)}catch{}return[]}const reactMinifiedRegexp=/Minified React error #\d+;/i;function getPopSize(Tr){if(Tr){if(typeof Tr.framesToPop=="number")return Tr.framesToPop;if(reactMinifiedRegexp.test(Tr.message))return 1}return 0}function extractMessage(Tr){const Cr=Tr&&Tr.message;return Cr?Cr.error&&typeof Cr.error.message=="string"?Cr.error.message:Cr:"No error message"}function eventFromException(Tr,Cr,$r,Ar){const Rr=$r&&$r.syntheticException||void 0,Dr=eventFromUnknownInput(Tr,Cr,Rr,Ar);return addExceptionMechanism(Dr),Dr.level="error",$r&&$r.event_id&&(Dr.event_id=$r.event_id),resolvedSyncPromise(Dr)}function eventFromMessage(Tr,Cr,$r="info",Ar,Rr){const Dr=Ar&&Ar.syntheticException||void 0,Mr=eventFromString(Tr,Cr,Dr,Rr);return Mr.level=$r,Ar&&Ar.event_id&&(Mr.event_id=Ar.event_id),resolvedSyncPromise(Mr)}function eventFromUnknownInput(Tr,Cr,$r,Ar,Rr){let Dr;if(isErrorEvent$2(Cr)&&Cr.error)return eventFromError(Tr,Cr.error);if(isDOMError(Cr)||isDOMException(Cr)){const Mr=Cr;if("stack"in Cr)Dr=eventFromError(Tr,Cr);else{const Br=Mr.name||(isDOMError(Mr)?"DOMError":"DOMException"),Nr=Mr.message?`${Br}: ${Mr.message}`:Br;Dr=eventFromString(Tr,Nr,$r,Ar),addExceptionTypeValue(Dr,Nr)}return"code"in Mr&&(Dr.tags={...Dr.tags,"DOMException.code":`${Mr.code}`}),Dr}return isError(Cr)?eventFromError(Tr,Cr):isPlainObject$1(Cr)||isEvent(Cr)?(Dr=eventFromPlainObject(Tr,Cr,$r,Rr),addExceptionMechanism(Dr,{synthetic:!0}),Dr):(Dr=eventFromString(Tr,Cr,$r,Ar),addExceptionTypeValue(Dr,`${Cr}`,void 0),addExceptionMechanism(Dr,{synthetic:!0}),Dr)}function eventFromString(Tr,Cr,$r,Ar){const Rr={message:Cr};if(Ar&&$r){const Dr=parseStackFrames(Tr,$r);Dr.length&&(Rr.exception={values:[{value:Cr,stacktrace:{frames:Dr}}]})}return Rr}function getNonErrorObjectExceptionValue(Tr,{isUnhandledRejection:Cr}){const $r=extractExceptionKeysForMessage(Tr),Ar=Cr?"promise rejection":"exception";return isErrorEvent$2(Tr)?`Event \`ErrorEvent\` captured as ${Ar} with message \`${Tr.message}\``:isEvent(Tr)?`Event \`${getObjectClassName(Tr)}\` (type=${Tr.type}) captured as ${Ar}`:`Object captured as ${Ar} with keys: ${$r}`}function getObjectClassName(Tr){try{const Cr=Object.getPrototypeOf(Tr);return Cr?Cr.constructor.name:void 0}catch{}}function createUserFeedbackEnvelope(Tr,{metadata:Cr,tunnel:$r,dsn:Ar}){const Rr={event_id:Tr.event_id,sent_at:new Date().toISOString(),...Cr&&Cr.sdk&&{sdk:{name:Cr.sdk.name,version:Cr.sdk.version}},...!!$r&&!!Ar&&{dsn:dsnToString(Ar)}},Dr=createUserFeedbackEnvelopeItem(Tr);return createEnvelope(Rr,[Dr])}function createUserFeedbackEnvelopeItem(Tr){return[{type:"user_report"},Tr]}class BrowserClient extends BaseClient{constructor(Cr){const $r=WINDOW$2.SENTRY_SDK_SOURCE||getSDKSource();Cr._metadata=Cr._metadata||{},Cr._metadata.sdk=Cr._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${$r}:@sentry/browser`,version:SDK_VERSION}],version:SDK_VERSION},super(Cr),Cr.sendClientReports&&WINDOW$2.document&&WINDOW$2.document.addEventListener("visibilitychange",()=>{WINDOW$2.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(Cr,$r){return eventFromException(this._options.stackParser,Cr,$r,this._options.attachStacktrace)}eventFromMessage(Cr,$r="info",Ar){return eventFromMessage(this._options.stackParser,Cr,$r,Ar,this._options.attachStacktrace)}captureUserFeedback(Cr){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("SDK not enabled, will not capture user feedback.");return}const $r=createUserFeedbackEnvelope(Cr,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope($r)}_prepareEvent(Cr,$r,Ar){return Cr.platform=Cr.platform||"javascript",super._prepareEvent(Cr,$r,Ar)}_flushOutcomes(){const Cr=this._clearOutcomes();if(Cr.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("Sending outcomes:",Cr);const $r=createClientReportEnvelope(Cr,this._options.tunnel&&dsnToString(this._dsn));this._sendEnvelope($r)}}let cachedFetchImpl;function getNativeFetchImplementation(){if(cachedFetchImpl)return cachedFetchImpl;if(isNativeFetch(WINDOW$2.fetch))return cachedFetchImpl=WINDOW$2.fetch.bind(WINDOW$2);const Tr=WINDOW$2.document;let Cr=WINDOW$2.fetch;if(Tr&&typeof Tr.createElement=="function")try{const $r=Tr.createElement("iframe");$r.hidden=!0,Tr.head.appendChild($r);const Ar=$r.contentWindow;Ar&&Ar.fetch&&(Cr=Ar.fetch),Tr.head.removeChild($r)}catch($r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",$r)}return cachedFetchImpl=Cr.bind(WINDOW$2)}function clearCachedFetchImplementation(){cachedFetchImpl=void 0}function makeFetchTransport(Tr,Cr=getNativeFetchImplementation()){let $r=0,Ar=0;function Rr(Dr){const Mr=Dr.body.length;$r+=Mr,Ar++;const Br={body:Dr.body,method:"POST",referrerPolicy:"origin",headers:Tr.headers,keepalive:$r<=6e4&&Ar<15,...Tr.fetchOptions};try{return Cr(Tr.url,Br).then(Nr=>($r-=Mr,Ar--,{statusCode:Nr.status,headers:{"x-sentry-rate-limits":Nr.headers.get("X-Sentry-Rate-Limits"),"retry-after":Nr.headers.get("Retry-After")}}))}catch(Nr){return clearCachedFetchImplementation(),$r-=Mr,Ar--,rejectedSyncPromise(Nr)}}return createTransport(Tr,Rr)}const XHR_READYSTATE_DONE=4;function makeXHRTransport(Tr){function Cr($r){return new SyncPromise((Ar,Rr)=>{const Dr=new XMLHttpRequest;Dr.onerror=Rr,Dr.onreadystatechange=()=>{Dr.readyState===XHR_READYSTATE_DONE&&Ar({statusCode:Dr.status,headers:{"x-sentry-rate-limits":Dr.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":Dr.getResponseHeader("Retry-After")}})},Dr.open("POST",Tr.url);for(const Mr in Tr.headers)Object.prototype.hasOwnProperty.call(Tr.headers,Mr)&&Dr.setRequestHeader(Mr,Tr.headers[Mr]);Dr.send($r.body)})}return createTransport(Tr,Cr)}const UNKNOWN_FUNCTION="?",CHROME_PRIORITY=30,WINJS_PRIORITY=40,GECKO_PRIORITY=50;function createFrame(Tr,Cr,$r,Ar){const Rr={filename:Tr,function:Cr,in_app:!0};return $r!==void 0&&(Rr.lineno=$r),Ar!==void 0&&(Rr.colno=Ar),Rr}const chromeRegex=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,chromeEvalRegex=/\((\S*)(?::(\d+))(?::(\d+))\)/,chrome$1=Tr=>{const Cr=chromeRegex.exec(Tr);if(Cr){if(Cr[2]&&Cr[2].indexOf("eval")===0){const Dr=chromeEvalRegex.exec(Cr[2]);Dr&&(Cr[2]=Dr[1],Cr[3]=Dr[2],Cr[4]=Dr[3])}const[Ar,Rr]=extractSafariExtensionDetails(Cr[1]||UNKNOWN_FUNCTION,Cr[2]);return createFrame(Rr,Ar,Cr[3]?+Cr[3]:void 0,Cr[4]?+Cr[4]:void 0)}},chromeStackLineParser=[CHROME_PRIORITY,chrome$1],geckoREgex=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,geckoEvalRegex=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gecko$1=Tr=>{const Cr=geckoREgex.exec(Tr);if(Cr){if(Cr[3]&&Cr[3].indexOf(" > eval")>-1){const Dr=geckoEvalRegex.exec(Cr[3]);Dr&&(Cr[1]=Cr[1]||"eval",Cr[3]=Dr[1],Cr[4]=Dr[2],Cr[5]="")}let Ar=Cr[3],Rr=Cr[1]||UNKNOWN_FUNCTION;return[Rr,Ar]=extractSafariExtensionDetails(Rr,Ar),createFrame(Ar,Rr,Cr[4]?+Cr[4]:void 0,Cr[5]?+Cr[5]:void 0)}},geckoStackLineParser=[GECKO_PRIORITY,gecko$1],winjsRegex=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,winjs=Tr=>{const Cr=winjsRegex.exec(Tr);return Cr?createFrame(Cr[2],Cr[1]||UNKNOWN_FUNCTION,+Cr[3],Cr[4]?+Cr[4]:void 0):void 0},winjsStackLineParser=[WINJS_PRIORITY,winjs],defaultStackLineParsers=[chromeStackLineParser,geckoStackLineParser,winjsStackLineParser],defaultStackParser=createStackParser(...defaultStackLineParsers),extractSafariExtensionDetails=(Tr,Cr)=>{const $r=Tr.indexOf("safari-extension")!==-1,Ar=Tr.indexOf("safari-web-extension")!==-1;return $r||Ar?[Tr.indexOf("@")!==-1?Tr.split("@")[0]:UNKNOWN_FUNCTION,$r?`safari-extension:${Cr}`:`safari-web-extension:${Cr}`]:[Tr,Cr]};class GlobalHandlers{static __initStatic(){this.id="GlobalHandlers"}constructor(Cr){this.name=GlobalHandlers.id,this._options={onerror:!0,onunhandledrejection:!0,...Cr},this._installFunc={onerror:_installGlobalOnErrorHandler,onunhandledrejection:_installGlobalOnUnhandledRejectionHandler}}setupOnce(){Error.stackTraceLimit=50;const Cr=this._options;for(const $r in Cr){const Ar=this._installFunc[$r];Ar&&Cr[$r]&&(globalHandlerLog($r),Ar(),this._installFunc[$r]=void 0)}}}GlobalHandlers.__initStatic();function _installGlobalOnErrorHandler(){addInstrumentationHandler("error",Tr=>{const[Cr,$r,Ar]=getHubAndOptions();if(!Cr.getIntegration(GlobalHandlers))return;const{msg:Rr,url:Dr,line:Mr,column:Br,error:Nr}=Tr;if(shouldIgnoreOnError()||Nr&&Nr.__sentry_own_request__)return;const Lr=Nr===void 0&&isString$4(Rr)?_eventFromIncompleteOnError(Rr,Dr,Mr,Br):_enhanceEventWithInitialFrame(eventFromUnknownInput($r,Nr||Rr,void 0,Ar,!1),Dr,Mr,Br);Lr.level="error",addMechanismAndCapture(Cr,Nr,Lr,"onerror")})}function _installGlobalOnUnhandledRejectionHandler(){addInstrumentationHandler("unhandledrejection",Tr=>{const[Cr,$r,Ar]=getHubAndOptions();if(!Cr.getIntegration(GlobalHandlers))return;let Rr=Tr;try{"reason"in Tr?Rr=Tr.reason:"detail"in Tr&&"reason"in Tr.detail&&(Rr=Tr.detail.reason)}catch{}if(shouldIgnoreOnError()||Rr&&Rr.__sentry_own_request__)return!0;const Dr=isPrimitive(Rr)?_eventFromRejectionWithPrimitive(Rr):eventFromUnknownInput($r,Rr,void 0,Ar,!0);Dr.level="error",addMechanismAndCapture(Cr,Rr,Dr,"onunhandledrejection")})}function _eventFromRejectionWithPrimitive(Tr){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(Tr)}`}]}}}function _eventFromIncompleteOnError(Tr,Cr,$r,Ar){const Rr=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let Dr=isErrorEvent$2(Tr)?Tr.message:Tr,Mr="Error";const Br=Dr.match(Rr);return Br&&(Mr=Br[1],Dr=Br[2]),_enhanceEventWithInitialFrame({exception:{values:[{type:Mr,value:Dr}]}},Cr,$r,Ar)}function _enhanceEventWithInitialFrame(Tr,Cr,$r,Ar){const Rr=Tr.exception=Tr.exception||{},Dr=Rr.values=Rr.values||[],Mr=Dr[0]=Dr[0]||{},Br=Mr.stacktrace=Mr.stacktrace||{},Nr=Br.frames=Br.frames||[],Lr=isNaN(parseInt(Ar,10))?void 0:Ar,Hr=isNaN(parseInt($r,10))?void 0:$r,zr=isString$4(Cr)&&Cr.length>0?Cr:getLocationHref();return Nr.length===0&&Nr.push({colno:Lr,filename:zr,function:"?",in_app:!0,lineno:Hr}),Tr}function globalHandlerLog(Tr){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`Global Handler attached: ${Tr}`)}function addMechanismAndCapture(Tr,Cr,$r,Ar){addExceptionMechanism($r,{handled:!1,type:Ar}),Tr.captureEvent($r,{originalException:Cr})}function getHubAndOptions(){const Tr=getCurrentHub(),Cr=Tr.getClient(),$r=Cr&&Cr.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[Tr,$r.stackParser,$r.attachStacktrace]}const DEFAULT_EVENT_TARGET=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class TryCatch{static __initStatic(){this.id="TryCatch"}constructor(Cr){this.name=TryCatch.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...Cr}}setupOnce(){this._options.setTimeout&&fill(WINDOW$2,"setTimeout",_wrapTimeFunction),this._options.setInterval&&fill(WINDOW$2,"setInterval",_wrapTimeFunction),this._options.requestAnimationFrame&&fill(WINDOW$2,"requestAnimationFrame",_wrapRAF),this._options.XMLHttpRequest&&"XMLHttpRequest"in WINDOW$2&&fill(XMLHttpRequest.prototype,"send",_wrapXHR);const Cr=this._options.eventTarget;Cr&&(Array.isArray(Cr)?Cr:DEFAULT_EVENT_TARGET).forEach(_wrapEventTarget)}}TryCatch.__initStatic();function _wrapTimeFunction(Tr){return function(...Cr){const $r=Cr[0];return Cr[0]=wrap$1($r,{mechanism:{data:{function:getFunctionName(Tr)},handled:!1,type:"instrument"}}),Tr.apply(this,Cr)}}function _wrapRAF(Tr){return function(Cr){return Tr.apply(this,[wrap$1(Cr,{mechanism:{data:{function:"requestAnimationFrame",handler:getFunctionName(Tr)},handled:!1,type:"instrument"}})])}}function _wrapXHR(Tr){return function(...Cr){const $r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(Rr=>{Rr in $r&&typeof $r[Rr]=="function"&&fill($r,Rr,function(Dr){const Mr={mechanism:{data:{function:Rr,handler:getFunctionName(Dr)},handled:!1,type:"instrument"}},Br=getOriginalFunction(Dr);return Br&&(Mr.mechanism.data.handler=getFunctionName(Br)),wrap$1(Dr,Mr)})}),Tr.apply(this,Cr)}}function _wrapEventTarget(Tr){const Cr=WINDOW$2,$r=Cr[Tr]&&Cr[Tr].prototype;!$r||!$r.hasOwnProperty||!$r.hasOwnProperty("addEventListener")||(fill($r,"addEventListener",function(Ar){return function(Rr,Dr,Mr){try{typeof Dr.handleEvent=="function"&&(Dr.handleEvent=wrap$1(Dr.handleEvent,{mechanism:{data:{function:"handleEvent",handler:getFunctionName(Dr),target:Tr},handled:!1,type:"instrument"}}))}catch{}return Ar.apply(this,[Rr,wrap$1(Dr,{mechanism:{data:{function:"addEventListener",handler:getFunctionName(Dr),target:Tr},handled:!1,type:"instrument"}}),Mr])}}),fill($r,"removeEventListener",function(Ar){return function(Rr,Dr,Mr){const Br=Dr;try{const Nr=Br&&Br.__sentry_wrapped__;Nr&&Ar.call(this,Rr,Nr,Mr)}catch{}return Ar.call(this,Rr,Br,Mr)}}))}const MAX_ALLOWED_STRING_LENGTH=1024;class Breadcrumbs{static __initStatic(){this.id="Breadcrumbs"}constructor(Cr){this.name=Breadcrumbs.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...Cr}}setupOnce(){if(this.options.console&&addInstrumentationHandler("console",_consoleBreadcrumb),this.options.dom&&addInstrumentationHandler("dom",_domBreadcrumb(this.options.dom)),this.options.xhr&&addInstrumentationHandler("xhr",_xhrBreadcrumb),this.options.fetch&&addInstrumentationHandler("fetch",_fetchBreadcrumb),this.options.history&&addInstrumentationHandler("history",_historyBreadcrumb),this.options.sentry){const Cr=getCurrentHub().getClient();Cr&&Cr.on&&Cr.on("beforeSendEvent",addSentryBreadcrumb)}}}Breadcrumbs.__initStatic();function addSentryBreadcrumb(Tr){getCurrentHub().addBreadcrumb({category:`sentry.${Tr.type==="transaction"?"transaction":"event"}`,event_id:Tr.event_id,level:Tr.level,message:getEventDescription(Tr)},{event:Tr})}function _domBreadcrumb(Tr){function Cr($r){let Ar,Rr=typeof Tr=="object"?Tr.serializeAttribute:void 0,Dr=typeof Tr=="object"&&typeof Tr.maxStringLength=="number"?Tr.maxStringLength:void 0;Dr&&Dr>MAX_ALLOWED_STRING_LENGTH&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${Dr} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`),Dr=MAX_ALLOWED_STRING_LENGTH),typeof Rr=="string"&&(Rr=[Rr]);try{const Mr=$r.event;Ar=_isEvent(Mr)?htmlTreeAsString(Mr.target,{keyAttrs:Rr,maxStringLength:Dr}):htmlTreeAsString(Mr,{keyAttrs:Rr,maxStringLength:Dr})}catch{Ar=""}Ar.length!==0&&getCurrentHub().addBreadcrumb({category:`ui.${$r.name}`,message:Ar},{event:$r.event,name:$r.name,global:$r.global})}return Cr}function _consoleBreadcrumb(Tr){const Cr={category:"console",data:{arguments:Tr.args,logger:"console"},level:severityLevelFromString(Tr.level),message:safeJoin(Tr.args," ")};if(Tr.level==="assert")if(Tr.args[0]===!1)Cr.message=`Assertion failed: ${safeJoin(Tr.args.slice(1)," ")||"console.assert"}`,Cr.data.arguments=Tr.args.slice(1);else return;getCurrentHub().addBreadcrumb(Cr,{input:Tr.args,level:Tr.level})}function _xhrBreadcrumb(Tr){const{startTimestamp:Cr,endTimestamp:$r}=Tr,Ar=Tr.xhr[SENTRY_XHR_DATA_KEY];if(!Cr||!$r||!Ar)return;const{method:Rr,url:Dr,status_code:Mr,body:Br}=Ar,Nr={method:Rr,url:Dr,status_code:Mr},Lr={xhr:Tr.xhr,input:Br,startTimestamp:Cr,endTimestamp:$r};getCurrentHub().addBreadcrumb({category:"xhr",data:Nr,type:"http"},Lr)}function _fetchBreadcrumb(Tr){const{startTimestamp:Cr,endTimestamp:$r}=Tr;if($r&&!(Tr.fetchData.url.match(/sentry_key/)&&Tr.fetchData.method==="POST"))if(Tr.error){const Ar=Tr.fetchData,Rr={data:Tr.error,input:Tr.args,startTimestamp:Cr,endTimestamp:$r};getCurrentHub().addBreadcrumb({category:"fetch",data:Ar,level:"error",type:"http"},Rr)}else{const Ar={...Tr.fetchData,status_code:Tr.response&&Tr.response.status},Rr={input:Tr.args,response:Tr.response,startTimestamp:Cr,endTimestamp:$r};getCurrentHub().addBreadcrumb({category:"fetch",data:Ar,type:"http"},Rr)}}function _historyBreadcrumb(Tr){let Cr=Tr.from,$r=Tr.to;const Ar=parseUrl(WINDOW$2.location.href);let Rr=parseUrl(Cr);const Dr=parseUrl($r);Rr.path||(Rr=Ar),Ar.protocol===Dr.protocol&&Ar.host===Dr.host&&($r=Dr.relative),Ar.protocol===Rr.protocol&&Ar.host===Rr.host&&(Cr=Rr.relative),getCurrentHub().addBreadcrumb({category:"navigation",data:{from:Cr,to:$r}})}function _isEvent(Tr){return!!Tr&&!!Tr.target}const DEFAULT_KEY="cause",DEFAULT_LIMIT=5;class LinkedErrors{static __initStatic(){this.id="LinkedErrors"}constructor(Cr={}){this.name=LinkedErrors.id,this._key=Cr.key||DEFAULT_KEY,this._limit=Cr.limit||DEFAULT_LIMIT}setupOnce(){}preprocessEvent(Cr,$r,Ar){const Rr=Ar.getOptions();applyAggregateErrorsToEvent(exceptionFromError,Rr.stackParser,Rr.maxValueLength,this._key,this._limit,Cr,$r)}}LinkedErrors.__initStatic();class HttpContext{static __initStatic(){this.id="HttpContext"}constructor(){this.name=HttpContext.id}setupOnce(){}preprocessEvent(Cr){if(!WINDOW$2.navigator&&!WINDOW$2.location&&!WINDOW$2.document)return;const $r=Cr.request&&Cr.request.url||WINDOW$2.location&&WINDOW$2.location.href,{referrer:Ar}=WINDOW$2.document||{},{userAgent:Rr}=WINDOW$2.navigator||{},Dr={...Cr.request&&Cr.request.headers,...Ar&&{Referer:Ar},...Rr&&{"User-Agent":Rr}},Mr={...Cr.request,...$r&&{url:$r},headers:Dr};Cr.request=Mr}}HttpContext.__initStatic();class Dedupe{static __initStatic(){this.id="Dedupe"}constructor(){this.name=Dedupe.id}setupOnce(Cr,$r){}processEvent(Cr){if(Cr.type)return Cr;try{if(_shouldDropEvent(Cr,this._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return this._previousEvent=Cr}}Dedupe.__initStatic();function _shouldDropEvent(Tr,Cr){return Cr?!!(_isSameMessageEvent(Tr,Cr)||_isSameExceptionEvent(Tr,Cr)):!1}function _isSameMessageEvent(Tr,Cr){const $r=Tr.message,Ar=Cr.message;return!(!$r&&!Ar||$r&&!Ar||!$r&&Ar||$r!==Ar||!_isSameFingerprint(Tr,Cr)||!_isSameStacktrace(Tr,Cr))}function _isSameExceptionEvent(Tr,Cr){const $r=_getExceptionFromEvent(Cr),Ar=_getExceptionFromEvent(Tr);return!(!$r||!Ar||$r.type!==Ar.type||$r.value!==Ar.value||!_isSameFingerprint(Tr,Cr)||!_isSameStacktrace(Tr,Cr))}function _isSameStacktrace(Tr,Cr){let $r=_getFramesFromEvent(Tr),Ar=_getFramesFromEvent(Cr);if(!$r&&!Ar)return!0;if($r&&!Ar||!$r&&Ar||($r=$r,Ar=Ar,Ar.length!==$r.length))return!1;for(let Rr=0;Rr"u"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}const Tr=getCurrentHub();Tr.captureSession&&(startSessionOnHub(Tr),addInstrumentationHandler("history",({from:Cr,to:$r})=>{Cr===void 0||Cr===$r||startSessionOnHub(getCurrentHub())}))}const WINDOW$1=GLOBAL_OBJ,REPLAY_SESSION_KEY="sentryReplaySession",REPLAY_EVENT_NAME="replay_event",UNABLE_TO_SEND_REPLAY="Unable to send Replay",SESSION_IDLE_PAUSE_DURATION=3e5,SESSION_IDLE_EXPIRE_DURATION=9e5,DEFAULT_FLUSH_MIN_DELAY=5e3,DEFAULT_FLUSH_MAX_DELAY=5500,BUFFER_CHECKOUT_TIME=6e4,RETRY_BASE_INTERVAL=5e3,RETRY_MAX_COUNT=3,NETWORK_BODY_MAX_SIZE=15e4,CONSOLE_ARG_MAX_SIZE=5e3,SLOW_CLICK_THRESHOLD=3e3,SLOW_CLICK_SCROLL_TIMEOUT=300,REPLAY_MAX_EVENT_BUFFER_SIZE=2e7,MIN_REPLAY_DURATION=4999,MIN_REPLAY_DURATION_LIMIT=15e3,MAX_REPLAY_DURATION=36e5;var NodeType$1$1;(function(Tr){Tr[Tr.Document=0]="Document",Tr[Tr.DocumentType=1]="DocumentType",Tr[Tr.Element=2]="Element",Tr[Tr.Text=3]="Text",Tr[Tr.CDATA=4]="CDATA",Tr[Tr.Comment=5]="Comment"})(NodeType$1$1||(NodeType$1$1={}));function isElement$1(Tr){return Tr.nodeType===Tr.ELEMENT_NODE}function isShadowRoot(Tr){const Cr=Tr==null?void 0:Tr.host;return(Cr==null?void 0:Cr.shadowRoot)===Tr}function isNativeShadowDom(Tr){return Object.prototype.toString.call(Tr)==="[object ShadowRoot]"}function fixBrowserCompatibilityIssuesInCSS(Tr){return Tr.includes(" background-clip: text;")&&!Tr.includes(" -webkit-background-clip: text;")&&(Tr=Tr.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),Tr}function escapeImportStatement(Tr){const{cssText:Cr}=Tr;if(Cr.split('"').length<3)return Cr;const $r=["@import",`url(${JSON.stringify(Tr.href)})`];return Tr.layerName===""?$r.push("layer"):Tr.layerName&&$r.push(`layer(${Tr.layerName})`),Tr.supportsText&&$r.push(`supports(${Tr.supportsText})`),Tr.media.length&&$r.push(Tr.media.mediaText),$r.join(" ")+";"}function stringifyStylesheet(Tr){try{const Cr=Tr.rules||Tr.cssRules;return Cr?fixBrowserCompatibilityIssuesInCSS(Array.from(Cr,stringifyRule).join("")):null}catch{return null}}function stringifyRule(Tr){let Cr;if(isCSSImportRule(Tr))try{Cr=stringifyStylesheet(Tr.styleSheet)||escapeImportStatement(Tr)}catch{}else if(isCSSStyleRule(Tr)&&Tr.selectorText.includes(":"))return fixSafariColons(Tr.cssText);return Cr||Tr.cssText}function fixSafariColons(Tr){const Cr=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return Tr.replace(Cr,"$1\\$2")}function isCSSImportRule(Tr){return"styleSheet"in Tr}function isCSSStyleRule(Tr){return"selectorText"in Tr}class Mirror{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(Cr){var $r;if(!Cr)return-1;const Ar=($r=this.getMeta(Cr))===null||$r===void 0?void 0:$r.id;return Ar??-1}getNode(Cr){return this.idNodeMap.get(Cr)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(Cr){return this.nodeMetaMap.get(Cr)||null}removeNodeFromMap(Cr){const $r=this.getId(Cr);this.idNodeMap.delete($r),Cr.childNodes&&Cr.childNodes.forEach(Ar=>this.removeNodeFromMap(Ar))}has(Cr){return this.idNodeMap.has(Cr)}hasNode(Cr){return this.nodeMetaMap.has(Cr)}add(Cr,$r){const Ar=$r.id;this.idNodeMap.set(Ar,Cr),this.nodeMetaMap.set(Cr,$r)}replace(Cr,$r){const Ar=this.getNode(Cr);if(Ar){const Rr=this.nodeMetaMap.get(Ar);Rr&&this.nodeMetaMap.set($r,Rr)}this.idNodeMap.set(Cr,$r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function createMirror(){return new Mirror}function shouldMaskInput({maskInputOptions:Tr,tagName:Cr,type:$r}){return Cr==="OPTION"&&(Cr="SELECT"),!!(Tr[Cr.toLowerCase()]||$r&&Tr[$r]||$r==="password"||Cr==="INPUT"&&!$r&&Tr.text)}function maskInputValue({isMasked:Tr,element:Cr,value:$r,maskInputFn:Ar}){let Rr=$r||"";return Tr?(Ar&&(Rr=Ar(Rr,Cr)),"*".repeat(Rr.length)):Rr}function toLowerCase(Tr){return Tr.toLowerCase()}function toUpperCase(Tr){return Tr.toUpperCase()}const ORIGINAL_ATTRIBUTE_NAME="__rrweb_original__";function is2DCanvasBlank(Tr){const Cr=Tr.getContext("2d");if(!Cr)return!0;const $r=50;for(let Ar=0;ArNr!==0))return!1}return!0}function getInputType(Tr){const Cr=Tr.type;return Tr.hasAttribute("data-rr-is-password")?"password":Cr?toLowerCase(Cr):null}function getInputValue(Tr,Cr,$r){return Cr==="INPUT"&&($r==="radio"||$r==="checkbox")?Tr.getAttribute("value")||"":Tr.value}let _id=1;const tagNameRegex=new RegExp("[^a-z0-9-_:]"),IGNORED_NODE=-2;function genId(){return _id++}function getValidTagName(Tr){if(Tr instanceof HTMLFormElement)return"form";const Cr=toLowerCase(Tr.tagName);return tagNameRegex.test(Cr)?"div":Cr}function extractOrigin(Tr){let Cr="";return Tr.indexOf("//")>-1?Cr=Tr.split("/").slice(0,3).join("/"):Cr=Tr.split("/")[0],Cr=Cr.split("?")[0],Cr}let canvasService,canvasCtx;const URL_IN_CSS_REF=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,URL_PROTOCOL_MATCH=/^(?:[a-z+]+:)?\/\//i,URL_WWW_MATCH=/^www\..*/i,DATA_URI=/^(data:)([^,]*),(.*)/i;function absoluteToStylesheet(Tr,Cr){return(Tr||"").replace(URL_IN_CSS_REF,($r,Ar,Rr,Dr,Mr,Br)=>{const Nr=Rr||Mr||Br,Lr=Ar||Dr||"";if(!Nr)return $r;if(URL_PROTOCOL_MATCH.test(Nr)||URL_WWW_MATCH.test(Nr))return`url(${Lr}${Nr}${Lr})`;if(DATA_URI.test(Nr))return`url(${Lr}${Nr}${Lr})`;if(Nr[0]==="/")return`url(${Lr}${extractOrigin(Cr)+Nr}${Lr})`;const Hr=Cr.split("/"),zr=Nr.split("/");Hr.pop();for(const Ur of zr)Ur!=="."&&(Ur===".."?Hr.pop():Hr.push(Ur));return`url(${Lr}${Hr.join("/")}${Lr})`})}const SRCSET_NOT_SPACES=/^[^ \t\n\r\u000c]+/,SRCSET_COMMAS_OR_SPACES=/^[, \t\n\r\u000c]+/;function getAbsoluteSrcsetString(Tr,Cr){if(Cr.trim()==="")return Cr;let $r=0;function Ar(Dr){let Mr;const Br=Dr.exec(Cr.substring($r));return Br?(Mr=Br[0],$r+=Mr.length,Mr):""}const Rr=[];for(;Ar(SRCSET_COMMAS_OR_SPACES),!($r>=Cr.length);){let Dr=Ar(SRCSET_NOT_SPACES);if(Dr.slice(-1)===",")Dr=absoluteToDoc(Tr,Dr.substring(0,Dr.length-1)),Rr.push(Dr);else{let Mr="";Dr=absoluteToDoc(Tr,Dr);let Br=!1;for(;;){const Nr=Cr.charAt($r);if(Nr===""){Rr.push((Dr+Mr).trim());break}else if(Br)Nr===")"&&(Br=!1);else if(Nr===","){$r+=1,Rr.push((Dr+Mr).trim());break}else Nr==="("&&(Br=!0);Mr+=Nr,$r+=1}}}return Rr.join(", ")}function absoluteToDoc(Tr,Cr){if(!Cr||Cr.trim()==="")return Cr;const $r=Tr.createElement("a");return $r.href=Cr,$r.href}function isSVGElement(Tr){return!!(Tr.tagName==="svg"||Tr.ownerSVGElement)}function getHref(){const Tr=document.createElement("a");return Tr.href="",Tr.href}function transformAttribute(Tr,Cr,$r,Ar,Rr,Dr){return Ar&&($r==="src"||$r==="href"&&!(Cr==="use"&&Ar[0]==="#")||$r==="xlink:href"&&Ar[0]!=="#"||$r==="background"&&(Cr==="table"||Cr==="td"||Cr==="th")?absoluteToDoc(Tr,Ar):$r==="srcset"?getAbsoluteSrcsetString(Tr,Ar):$r==="style"?absoluteToStylesheet(Ar,getHref()):Cr==="object"&&$r==="data"?absoluteToDoc(Tr,Ar):typeof Dr=="function"?Dr($r,Ar,Rr):Ar)}function ignoreAttribute(Tr,Cr,$r){return(Tr==="video"||Tr==="audio")&&Cr==="autoplay"}function _isBlockedElement(Tr,Cr,$r,Ar){try{if(Ar&&Tr.matches(Ar))return!1;if(typeof Cr=="string"){if(Tr.classList.contains(Cr))return!0}else for(let Rr=Tr.classList.length;Rr--;){const Dr=Tr.classList[Rr];if(Cr.test(Dr))return!0}if($r)return Tr.matches($r)}catch{}return!1}function elementClassMatchesRegex(Tr,Cr){for(let $r=Tr.classList.length;$r--;){const Ar=Tr.classList[$r];if(Cr.test(Ar))return!0}return!1}function distanceToMatch(Tr,Cr,$r=1/0,Ar=0){return!Tr||Tr.nodeType!==Tr.ELEMENT_NODE||Ar>$r?-1:Cr(Tr)?Ar:distanceToMatch(Tr.parentNode,Cr,$r,Ar+1)}function createMatchPredicate(Tr,Cr){return $r=>{const Ar=$r;if(Ar===null)return!1;if(Tr){if(typeof Tr=="string"){if(Ar.matches(`.${Tr}`))return!0}else if(elementClassMatchesRegex(Ar,Tr))return!0}return!!(Cr&&Ar.matches(Cr))}}function needMaskingText(Tr,Cr,$r,Ar,Rr,Dr){try{const Mr=Tr.nodeType===Tr.ELEMENT_NODE?Tr:Tr.parentElement;if(Mr===null)return!1;let Br=-1,Nr=-1;if(Dr){if(Nr=distanceToMatch(Mr,createMatchPredicate(Ar,Rr)),Nr<0)return!0;Br=distanceToMatch(Mr,createMatchPredicate(Cr,$r),Nr>=0?Nr:1/0)}else{if(Br=distanceToMatch(Mr,createMatchPredicate(Cr,$r)),Br<0)return!1;Nr=distanceToMatch(Mr,createMatchPredicate(Ar,Rr),Br>=0?Br:1/0)}return Br>=0?Nr>=0?Br<=Nr:!0:Nr>=0?!1:!!Dr}catch{}return!!Dr}function onceIframeLoaded(Tr,Cr,$r){const Ar=Tr.contentWindow;if(!Ar)return;let Rr=!1,Dr;try{Dr=Ar.document.readyState}catch{return}if(Dr!=="complete"){const Br=setTimeout(()=>{Rr||(Cr(),Rr=!0)},$r);Tr.addEventListener("load",()=>{clearTimeout(Br),Rr=!0,Cr()});return}const Mr="about:blank";if(Ar.location.href!==Mr||Tr.src===Mr||Tr.src==="")return setTimeout(Cr,0),Tr.addEventListener("load",Cr);Tr.addEventListener("load",Cr)}function onceStylesheetLoaded(Tr,Cr,$r){let Ar=!1,Rr;try{Rr=Tr.sheet}catch{return}if(Rr)return;const Dr=setTimeout(()=>{Ar||(Cr(),Ar=!0)},$r);Tr.addEventListener("load",()=>{clearTimeout(Dr),Ar=!0,Cr()})}function serializeNode(Tr,Cr){const{doc:$r,mirror:Ar,blockClass:Rr,blockSelector:Dr,unblockSelector:Mr,maskAllText:Br,maskAttributeFn:Nr,maskTextClass:Lr,unmaskTextClass:Hr,maskTextSelector:zr,unmaskTextSelector:Ur,inlineStylesheet:Vr,maskInputOptions:jr={},maskTextFn:Gr,maskInputFn:Xr,dataURLOptions:Kr={},inlineImages:Zr,recordCanvas:eo,keepIframeSrcFn:Wr,newlyAddedElement:Yr=!1}=Cr,Jr=getRootId($r,Ar);switch(Tr.nodeType){case Tr.DOCUMENT_NODE:return Tr.compatMode!=="CSS1Compat"?{type:NodeType$1$1.Document,childNodes:[],compatMode:Tr.compatMode}:{type:NodeType$1$1.Document,childNodes:[]};case Tr.DOCUMENT_TYPE_NODE:return{type:NodeType$1$1.DocumentType,name:Tr.name,publicId:Tr.publicId,systemId:Tr.systemId,rootId:Jr};case Tr.ELEMENT_NODE:return serializeElementNode(Tr,{doc:$r,blockClass:Rr,blockSelector:Dr,unblockSelector:Mr,inlineStylesheet:Vr,maskAttributeFn:Nr,maskInputOptions:jr,maskInputFn:Xr,dataURLOptions:Kr,inlineImages:Zr,recordCanvas:eo,keepIframeSrcFn:Wr,newlyAddedElement:Yr,rootId:Jr,maskAllText:Br,maskTextClass:Lr,unmaskTextClass:Hr,maskTextSelector:zr,unmaskTextSelector:Ur});case Tr.TEXT_NODE:return serializeTextNode(Tr,{maskAllText:Br,maskTextClass:Lr,unmaskTextClass:Hr,maskTextSelector:zr,unmaskTextSelector:Ur,maskTextFn:Gr,maskInputOptions:jr,maskInputFn:Xr,rootId:Jr});case Tr.CDATA_SECTION_NODE:return{type:NodeType$1$1.CDATA,textContent:"",rootId:Jr};case Tr.COMMENT_NODE:return{type:NodeType$1$1.Comment,textContent:Tr.textContent||"",rootId:Jr};default:return!1}}function getRootId(Tr,Cr){if(!Cr.hasNode(Tr))return;const $r=Cr.getId(Tr);return $r===1?void 0:$r}function serializeTextNode(Tr,Cr){var $r;const{maskAllText:Ar,maskTextClass:Rr,unmaskTextClass:Dr,maskTextSelector:Mr,unmaskTextSelector:Br,maskTextFn:Nr,maskInputOptions:Lr,maskInputFn:Hr,rootId:zr}=Cr,Ur=Tr.parentNode&&Tr.parentNode.tagName;let Vr=Tr.textContent;const jr=Ur==="STYLE"?!0:void 0,Gr=Ur==="SCRIPT"?!0:void 0,Xr=Ur==="TEXTAREA"?!0:void 0;if(jr&&Vr){try{Tr.nextSibling||Tr.previousSibling||!(($r=Tr.parentNode.sheet)===null||$r===void 0)&&$r.cssRules&&(Vr=stringifyStylesheet(Tr.parentNode.sheet))}catch(Zr){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${Zr}`,Tr)}Vr=absoluteToStylesheet(Vr,getHref())}Gr&&(Vr="SCRIPT_PLACEHOLDER");const Kr=needMaskingText(Tr,Rr,Mr,Dr,Br,Ar);if(!jr&&!Gr&&!Xr&&Vr&&Kr&&(Vr=Nr?Nr(Vr):Vr.replace(/[\S]/g,"*")),Xr&&Vr&&(Lr.textarea||Kr)&&(Vr=Hr?Hr(Vr,Tr.parentNode):Vr.replace(/[\S]/g,"*")),Ur==="OPTION"&&Vr){const Zr=shouldMaskInput({type:null,tagName:Ur,maskInputOptions:Lr});Vr=maskInputValue({isMasked:needMaskingText(Tr,Rr,Mr,Dr,Br,Zr),element:Tr,value:Vr,maskInputFn:Hr})}return{type:NodeType$1$1.Text,textContent:Vr||"",isStyle:jr,rootId:zr}}function serializeElementNode(Tr,Cr){const{doc:$r,blockClass:Ar,blockSelector:Rr,unblockSelector:Dr,inlineStylesheet:Mr,maskInputOptions:Br={},maskAttributeFn:Nr,maskInputFn:Lr,dataURLOptions:Hr={},inlineImages:zr,recordCanvas:Ur,keepIframeSrcFn:Vr,newlyAddedElement:jr=!1,rootId:Gr,maskAllText:Xr,maskTextClass:Kr,unmaskTextClass:Zr,maskTextSelector:eo,unmaskTextSelector:Wr}=Cr,Yr=_isBlockedElement(Tr,Ar,Rr,Dr),Jr=getValidTagName(Tr);let no={};const ro=Tr.attributes.length;for(let ao=0;aopo.href===Tr.href);let lo=null;ao&&(lo=stringifyStylesheet(ao)),lo&&(delete no.rel,delete no.href,no._cssText=absoluteToStylesheet(lo,ao.href))}if(Jr==="style"&&Tr.sheet&&!(Tr.innerText||Tr.textContent||"").trim().length){const ao=stringifyStylesheet(Tr.sheet);ao&&(no._cssText=absoluteToStylesheet(ao,getHref()))}if(Jr==="input"||Jr==="textarea"||Jr==="select"||Jr==="option"){const ao=Tr,lo=getInputType(ao),po=getInputValue(ao,toUpperCase(Jr),lo),go=ao.checked;if(lo!=="submit"&&lo!=="button"&&po){const co=needMaskingText(ao,Kr,eo,Zr,Wr,shouldMaskInput({type:lo,tagName:toUpperCase(Jr),maskInputOptions:Br}));no.value=maskInputValue({isMasked:co,element:ao,value:po,maskInputFn:Lr})}go&&(no.checked=go)}if(Jr==="option"&&(Tr.selected&&!Br.select?no.selected=!0:delete no.selected),Jr==="canvas"&&Ur){if(Tr.__context==="2d")is2DCanvasBlank(Tr)||(no.rr_dataURL=Tr.toDataURL(Hr.type,Hr.quality));else if(!("__context"in Tr)){const ao=Tr.toDataURL(Hr.type,Hr.quality),lo=document.createElement("canvas");lo.width=Tr.width,lo.height=Tr.height;const po=lo.toDataURL(Hr.type,Hr.quality);ao!==po&&(no.rr_dataURL=ao)}}if(Jr==="img"&&zr){canvasService||(canvasService=$r.createElement("canvas"),canvasCtx=canvasService.getContext("2d"));const ao=Tr,lo=ao.crossOrigin;ao.crossOrigin="anonymous";const po=()=>{ao.removeEventListener("load",po);try{canvasService.width=ao.naturalWidth,canvasService.height=ao.naturalHeight,canvasCtx.drawImage(ao,0,0),no.rr_dataURL=canvasService.toDataURL(Hr.type,Hr.quality)}catch(go){console.warn(`Cannot inline img src=${ao.currentSrc}! Error: ${go}`)}lo?no.crossOrigin=lo:ao.removeAttribute("crossorigin")};ao.complete&&ao.naturalWidth!==0?po():ao.addEventListener("load",po)}if((Jr==="audio"||Jr==="video")&&(no.rr_mediaState=Tr.paused?"paused":"played",no.rr_mediaCurrentTime=Tr.currentTime),jr||(Tr.scrollLeft&&(no.rr_scrollLeft=Tr.scrollLeft),Tr.scrollTop&&(no.rr_scrollTop=Tr.scrollTop)),Yr){const{width:ao,height:lo}=Tr.getBoundingClientRect();no={class:no.class,rr_width:`${ao}px`,rr_height:`${lo}px`}}Jr==="iframe"&&!Vr(no.src)&&(Tr.contentDocument||(no.rr_src=no.src),delete no.src);let so;try{customElements.get(Jr)&&(so=!0)}catch{}return{type:NodeType$1$1.Element,tagName:Jr,attributes:no,childNodes:[],isSVG:isSVGElement(Tr)||void 0,needBlock:Yr,rootId:Gr,isCustom:so}}function lowerIfExists(Tr){return Tr==null?"":Tr.toLowerCase()}function slimDOMExcluded(Tr,Cr){if(Cr.comment&&Tr.type===NodeType$1$1.Comment)return!0;if(Tr.type===NodeType$1$1.Element){if(Cr.script&&(Tr.tagName==="script"||Tr.tagName==="link"&&(Tr.attributes.rel==="preload"||Tr.attributes.rel==="modulepreload")&&Tr.attributes.as==="script"||Tr.tagName==="link"&&Tr.attributes.rel==="prefetch"&&typeof Tr.attributes.href=="string"&&Tr.attributes.href.endsWith(".js")))return!0;if(Cr.headFavicon&&(Tr.tagName==="link"&&Tr.attributes.rel==="shortcut icon"||Tr.tagName==="meta"&&(lowerIfExists(Tr.attributes.name).match(/^msapplication-tile(image|color)$/)||lowerIfExists(Tr.attributes.name)==="application-name"||lowerIfExists(Tr.attributes.rel)==="icon"||lowerIfExists(Tr.attributes.rel)==="apple-touch-icon"||lowerIfExists(Tr.attributes.rel)==="shortcut icon")))return!0;if(Tr.tagName==="meta"){if(Cr.headMetaDescKeywords&&lowerIfExists(Tr.attributes.name).match(/^description|keywords$/))return!0;if(Cr.headMetaSocial&&(lowerIfExists(Tr.attributes.property).match(/^(og|twitter|fb):/)||lowerIfExists(Tr.attributes.name).match(/^(og|twitter):/)||lowerIfExists(Tr.attributes.name)==="pinterest"))return!0;if(Cr.headMetaRobots&&(lowerIfExists(Tr.attributes.name)==="robots"||lowerIfExists(Tr.attributes.name)==="googlebot"||lowerIfExists(Tr.attributes.name)==="bingbot"))return!0;if(Cr.headMetaHttpEquiv&&Tr.attributes["http-equiv"]!==void 0)return!0;if(Cr.headMetaAuthorship&&(lowerIfExists(Tr.attributes.name)==="author"||lowerIfExists(Tr.attributes.name)==="generator"||lowerIfExists(Tr.attributes.name)==="framework"||lowerIfExists(Tr.attributes.name)==="publisher"||lowerIfExists(Tr.attributes.name)==="progid"||lowerIfExists(Tr.attributes.property).match(/^article:/)||lowerIfExists(Tr.attributes.property).match(/^product:/)))return!0;if(Cr.headMetaVerification&&(lowerIfExists(Tr.attributes.name)==="google-site-verification"||lowerIfExists(Tr.attributes.name)==="yandex-verification"||lowerIfExists(Tr.attributes.name)==="csrf-token"||lowerIfExists(Tr.attributes.name)==="p:domain_verify"||lowerIfExists(Tr.attributes.name)==="verify-v1"||lowerIfExists(Tr.attributes.name)==="verification"||lowerIfExists(Tr.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function serializeNodeWithId(Tr,Cr){const{doc:$r,mirror:Ar,blockClass:Rr,blockSelector:Dr,unblockSelector:Mr,maskAllText:Br,maskTextClass:Nr,unmaskTextClass:Lr,maskTextSelector:Hr,unmaskTextSelector:zr,skipChild:Ur=!1,inlineStylesheet:Vr=!0,maskInputOptions:jr={},maskAttributeFn:Gr,maskTextFn:Xr,maskInputFn:Kr,slimDOMOptions:Zr,dataURLOptions:eo={},inlineImages:Wr=!1,recordCanvas:Yr=!1,onSerialize:Jr,onIframeLoad:no,iframeLoadTimeout:ro=5e3,onStylesheetLoad:so,stylesheetLoadTimeout:ao=5e3,keepIframeSrcFn:lo=()=>!1,newlyAddedElement:po=!1}=Cr;let{preserveWhiteSpace:go=!0}=Cr;const co=serializeNode(Tr,{doc:$r,mirror:Ar,blockClass:Rr,blockSelector:Dr,maskAllText:Br,unblockSelector:Mr,maskTextClass:Nr,unmaskTextClass:Lr,maskTextSelector:Hr,unmaskTextSelector:zr,inlineStylesheet:Vr,maskInputOptions:jr,maskAttributeFn:Gr,maskTextFn:Xr,maskInputFn:Kr,dataURLOptions:eo,inlineImages:Wr,recordCanvas:Yr,keepIframeSrcFn:lo,newlyAddedElement:po});if(!co)return console.warn(Tr,"not serialized"),null;let mo;Ar.hasNode(Tr)?mo=Ar.getId(Tr):slimDOMExcluded(co,Zr)||!go&&co.type===NodeType$1$1.Text&&!co.isStyle&&!co.textContent.replace(/^\s+|\s+$/gm,"").length?mo=IGNORED_NODE:mo=genId();const io=Object.assign(co,{id:mo});if(Ar.add(Tr,io),mo===IGNORED_NODE)return null;Jr&&Jr(Tr);let uo=!Ur;if(io.type===NodeType$1$1.Element){uo=uo&&!io.needBlock,delete io.needBlock;const ho=Tr.shadowRoot;ho&&isNativeShadowDom(ho)&&(io.isShadowHost=!0)}if((io.type===NodeType$1$1.Document||io.type===NodeType$1$1.Element)&&uo){Zr.headWhitespace&&io.type===NodeType$1$1.Element&&io.tagName==="head"&&(go=!1);const ho={doc:$r,mirror:Ar,blockClass:Rr,blockSelector:Dr,maskAllText:Br,unblockSelector:Mr,maskTextClass:Nr,unmaskTextClass:Lr,maskTextSelector:Hr,unmaskTextSelector:zr,skipChild:Ur,inlineStylesheet:Vr,maskInputOptions:jr,maskAttributeFn:Gr,maskTextFn:Xr,maskInputFn:Kr,slimDOMOptions:Zr,dataURLOptions:eo,inlineImages:Wr,recordCanvas:Yr,preserveWhiteSpace:go,onSerialize:Jr,onIframeLoad:no,iframeLoadTimeout:ro,onStylesheetLoad:so,stylesheetLoadTimeout:ao,keepIframeSrcFn:lo};for(const yo of Array.from(Tr.childNodes)){const So=serializeNodeWithId(yo,ho);So&&io.childNodes.push(So)}if(isElement$1(Tr)&&Tr.shadowRoot)for(const yo of Array.from(Tr.shadowRoot.childNodes)){const So=serializeNodeWithId(yo,ho);So&&(isNativeShadowDom(Tr.shadowRoot)&&(So.isShadow=!0),io.childNodes.push(So))}}return Tr.parentNode&&isShadowRoot(Tr.parentNode)&&isNativeShadowDom(Tr.parentNode)&&(io.isShadow=!0),io.type===NodeType$1$1.Element&&io.tagName==="iframe"&&onceIframeLoaded(Tr,()=>{const ho=Tr.contentDocument;if(ho&&no){const yo=serializeNodeWithId(ho,{doc:ho,mirror:Ar,blockClass:Rr,blockSelector:Dr,unblockSelector:Mr,maskAllText:Br,maskTextClass:Nr,unmaskTextClass:Lr,maskTextSelector:Hr,unmaskTextSelector:zr,skipChild:!1,inlineStylesheet:Vr,maskInputOptions:jr,maskAttributeFn:Gr,maskTextFn:Xr,maskInputFn:Kr,slimDOMOptions:Zr,dataURLOptions:eo,inlineImages:Wr,recordCanvas:Yr,preserveWhiteSpace:go,onSerialize:Jr,onIframeLoad:no,iframeLoadTimeout:ro,onStylesheetLoad:so,stylesheetLoadTimeout:ao,keepIframeSrcFn:lo});yo&&no(Tr,yo)}},ro),io.type===NodeType$1$1.Element&&io.tagName==="link"&&io.attributes.rel==="stylesheet"&&onceStylesheetLoaded(Tr,()=>{if(so){const ho=serializeNodeWithId(Tr,{doc:$r,mirror:Ar,blockClass:Rr,blockSelector:Dr,unblockSelector:Mr,maskAllText:Br,maskTextClass:Nr,unmaskTextClass:Lr,maskTextSelector:Hr,unmaskTextSelector:zr,skipChild:!1,inlineStylesheet:Vr,maskInputOptions:jr,maskAttributeFn:Gr,maskTextFn:Xr,maskInputFn:Kr,slimDOMOptions:Zr,dataURLOptions:eo,inlineImages:Wr,recordCanvas:Yr,preserveWhiteSpace:go,onSerialize:Jr,onIframeLoad:no,iframeLoadTimeout:ro,onStylesheetLoad:so,stylesheetLoadTimeout:ao,keepIframeSrcFn:lo});ho&&so(Tr,ho)}},ao),io}function snapshot(Tr,Cr){const{mirror:$r=new Mirror,blockClass:Ar="rr-block",blockSelector:Rr=null,unblockSelector:Dr=null,maskAllText:Mr=!1,maskTextClass:Br="rr-mask",unmaskTextClass:Nr=null,maskTextSelector:Lr=null,unmaskTextSelector:Hr=null,inlineStylesheet:zr=!0,inlineImages:Ur=!1,recordCanvas:Vr=!1,maskAllInputs:jr=!1,maskAttributeFn:Gr,maskTextFn:Xr,maskInputFn:Kr,slimDOM:Zr=!1,dataURLOptions:eo,preserveWhiteSpace:Wr,onSerialize:Yr,onIframeLoad:Jr,iframeLoadTimeout:no,onStylesheetLoad:ro,stylesheetLoadTimeout:so,keepIframeSrcFn:ao=()=>!1}=Cr||{};return serializeNodeWithId(Tr,{doc:Tr,mirror:$r,blockClass:Ar,blockSelector:Rr,unblockSelector:Dr,maskAllText:Mr,maskTextClass:Br,unmaskTextClass:Nr,maskTextSelector:Lr,unmaskTextSelector:Hr,skipChild:!1,inlineStylesheet:zr,maskInputOptions:jr===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:jr===!1?{}:jr,maskAttributeFn:Gr,maskTextFn:Xr,maskInputFn:Kr,slimDOMOptions:Zr===!0||Zr==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:Zr==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:Zr===!1?{}:Zr,dataURLOptions:eo,inlineImages:Ur,recordCanvas:Vr,preserveWhiteSpace:Wr,onSerialize:Yr,onIframeLoad:Jr,iframeLoadTimeout:no,onStylesheetLoad:ro,stylesheetLoadTimeout:so,keepIframeSrcFn:ao,newlyAddedElement:!1})}function on(Tr,Cr,$r=document){const Ar={capture:!0,passive:!0};return $r.addEventListener(Tr,Cr,Ar),()=>$r.removeEventListener(Tr,Cr,Ar)}const DEPARTED_MIRROR_ACCESS_WARNING=`Please stop import mirror directly. Instead of that,\r now you can use replayer.getMirror() to access the mirror instance of a replayer,\r or you can use record.mirror to access the mirror instance during recording.`;let _mirror={map:{},getId(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),-1},getNode(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),null},removeNodeFromMap(){console.error(DEPARTED_MIRROR_ACCESS_WARNING)},has(){return console.error(DEPARTED_MIRROR_ACCESS_WARNING),!1},reset(){console.error(DEPARTED_MIRROR_ACCESS_WARNING)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(_mirror=new Proxy(_mirror,{get(Tr,Cr,$r){return Cr==="map"&&console.error(DEPARTED_MIRROR_ACCESS_WARNING),Reflect.get(Tr,Cr,$r)}}));function throttle$1(Tr,Cr,$r={}){let Ar=null,Rr=0;return function(...Dr){const Mr=Date.now();!Rr&&$r.leading===!1&&(Rr=Mr);const Br=Cr-(Mr-Rr),Nr=this;Br<=0||Br>Cr?(Ar&&(clearTimeout(Ar),Ar=null),Rr=Mr,Tr.apply(Nr,Dr)):!Ar&&$r.trailing!==!1&&(Ar=setTimeout(()=>{Rr=$r.leading===!1?0:Date.now(),Ar=null,Tr.apply(Nr,Dr)},Br))}}function hookSetter(Tr,Cr,$r,Ar,Rr=window){const Dr=Rr.Object.getOwnPropertyDescriptor(Tr,Cr);return Rr.Object.defineProperty(Tr,Cr,Ar?$r:{set(Mr){setTimeout(()=>{$r.set.call(this,Mr)},0),Dr&&Dr.set&&Dr.set.call(this,Mr)}}),()=>hookSetter(Tr,Cr,Dr||{},!0)}function patch(Tr,Cr,$r){try{if(!(Cr in Tr))return()=>{};const Ar=Tr[Cr],Rr=$r(Ar);return typeof Rr=="function"&&(Rr.prototype=Rr.prototype||{},Object.defineProperties(Rr,{__rrweb_original__:{enumerable:!1,value:Ar}})),Tr[Cr]=Rr,()=>{Tr[Cr]=Ar}}catch{return()=>{}}}let nowTimestamp=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(nowTimestamp=()=>new Date().getTime());function getWindowScroll(Tr){var Cr,$r,Ar,Rr,Dr,Mr;const Br=Tr.document;return{left:Br.scrollingElement?Br.scrollingElement.scrollLeft:Tr.pageXOffset!==void 0?Tr.pageXOffset:(Br==null?void 0:Br.documentElement.scrollLeft)||(($r=(Cr=Br==null?void 0:Br.body)===null||Cr===void 0?void 0:Cr.parentElement)===null||$r===void 0?void 0:$r.scrollLeft)||((Ar=Br==null?void 0:Br.body)===null||Ar===void 0?void 0:Ar.scrollLeft)||0,top:Br.scrollingElement?Br.scrollingElement.scrollTop:Tr.pageYOffset!==void 0?Tr.pageYOffset:(Br==null?void 0:Br.documentElement.scrollTop)||((Dr=(Rr=Br==null?void 0:Br.body)===null||Rr===void 0?void 0:Rr.parentElement)===null||Dr===void 0?void 0:Dr.scrollTop)||((Mr=Br==null?void 0:Br.body)===null||Mr===void 0?void 0:Mr.scrollTop)||0}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function isBlocked(Tr,Cr,$r,Ar,Rr){if(!Tr)return!1;const Dr=Tr.nodeType===Tr.ELEMENT_NODE?Tr:Tr.parentElement;if(!Dr)return!1;const Mr=createMatchPredicate(Cr,$r);if(!Rr){const Lr=Ar&&Dr.matches(Ar);return Mr(Dr)&&!Lr}const Br=distanceToMatch(Dr,Mr);let Nr=-1;return Br<0?!1:(Ar&&(Nr=distanceToMatch(Dr,createMatchPredicate(null,Ar))),Br>-1&&Nr<0?!0:Br{let $r=Cr[0];if(!(0 in Cr))throw new TypeError("1 argument is required");do if(this===$r)return!0;while($r=$r&&$r.parentNode);return!1})}function isSerializedIframe(Tr,Cr){return!!(Tr.nodeName==="IFRAME"&&Cr.getMeta(Tr))}function isSerializedStylesheet(Tr,Cr){return!!(Tr.nodeName==="LINK"&&Tr.nodeType===Tr.ELEMENT_NODE&&Tr.getAttribute&&Tr.getAttribute("rel")==="stylesheet"&&Cr.getMeta(Tr))}function hasShadowRoot(Tr){return!!(Tr!=null&&Tr.shadowRoot)}class StyleSheetMirror{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(Cr){var $r;return($r=this.styleIDMap.get(Cr))!==null&&$r!==void 0?$r:-1}has(Cr){return this.styleIDMap.has(Cr)}add(Cr,$r){if(this.has(Cr))return this.getId(Cr);let Ar;return $r===void 0?Ar=this.id++:Ar=$r,this.styleIDMap.set(Cr,Ar),this.idStyleMap.set(Ar,Cr),Ar}getStyle(Cr){return this.idStyleMap.get(Cr)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function getShadowHost(Tr){var Cr,$r;let Ar=null;return(($r=(Cr=Tr.getRootNode)===null||Cr===void 0?void 0:Cr.call(Tr))===null||$r===void 0?void 0:$r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Tr.getRootNode().host&&(Ar=Tr.getRootNode().host),Ar}function getRootShadowHost(Tr){let Cr=Tr,$r;for(;$r=getShadowHost(Cr);)Cr=$r;return Cr}function shadowHostInDom(Tr){const Cr=Tr.ownerDocument;if(!Cr)return!1;const $r=getRootShadowHost(Tr);return Cr.contains($r)}function inDom(Tr){const Cr=Tr.ownerDocument;return Cr?Cr.contains(Tr)||shadowHostInDom(Tr):!1}var EventType=(Tr=>(Tr[Tr.DomContentLoaded=0]="DomContentLoaded",Tr[Tr.Load=1]="Load",Tr[Tr.FullSnapshot=2]="FullSnapshot",Tr[Tr.IncrementalSnapshot=3]="IncrementalSnapshot",Tr[Tr.Meta=4]="Meta",Tr[Tr.Custom=5]="Custom",Tr[Tr.Plugin=6]="Plugin",Tr))(EventType||{}),IncrementalSource=(Tr=>(Tr[Tr.Mutation=0]="Mutation",Tr[Tr.MouseMove=1]="MouseMove",Tr[Tr.MouseInteraction=2]="MouseInteraction",Tr[Tr.Scroll=3]="Scroll",Tr[Tr.ViewportResize=4]="ViewportResize",Tr[Tr.Input=5]="Input",Tr[Tr.TouchMove=6]="TouchMove",Tr[Tr.MediaInteraction=7]="MediaInteraction",Tr[Tr.StyleSheetRule=8]="StyleSheetRule",Tr[Tr.CanvasMutation=9]="CanvasMutation",Tr[Tr.Font=10]="Font",Tr[Tr.Log=11]="Log",Tr[Tr.Drag=12]="Drag",Tr[Tr.StyleDeclaration=13]="StyleDeclaration",Tr[Tr.Selection=14]="Selection",Tr[Tr.AdoptedStyleSheet=15]="AdoptedStyleSheet",Tr[Tr.CustomElement=16]="CustomElement",Tr))(IncrementalSource||{}),MouseInteractions=(Tr=>(Tr[Tr.MouseUp=0]="MouseUp",Tr[Tr.MouseDown=1]="MouseDown",Tr[Tr.Click=2]="Click",Tr[Tr.ContextMenu=3]="ContextMenu",Tr[Tr.DblClick=4]="DblClick",Tr[Tr.Focus=5]="Focus",Tr[Tr.Blur=6]="Blur",Tr[Tr.TouchStart=7]="TouchStart",Tr[Tr.TouchMove_Departed=8]="TouchMove_Departed",Tr[Tr.TouchEnd=9]="TouchEnd",Tr[Tr.TouchCancel=10]="TouchCancel",Tr))(MouseInteractions||{}),PointerTypes=(Tr=>(Tr[Tr.Mouse=0]="Mouse",Tr[Tr.Pen=1]="Pen",Tr[Tr.Touch=2]="Touch",Tr))(PointerTypes||{}),CanvasContext=(Tr=>(Tr[Tr["2D"]=0]="2D",Tr[Tr.WebGL=1]="WebGL",Tr[Tr.WebGL2=2]="WebGL2",Tr))(CanvasContext||{});function isNodeInLinkedList(Tr){return"__ln"in Tr}class DoubleLinkedList{constructor(){this.length=0,this.head=null,this.tail=null}get(Cr){if(Cr>=this.length)throw new Error("Position outside of list range");let $r=this.head;for(let Ar=0;Ar`${Tr}@${Cr}`;class MutationBuffer{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=Cr=>{Cr.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const Cr=[],$r=new Set,Ar=new DoubleLinkedList,Rr=Nr=>{let Lr=Nr,Hr=IGNORED_NODE;for(;Hr===IGNORED_NODE;)Lr=Lr&&Lr.nextSibling,Hr=Lr&&this.mirror.getId(Lr);return Hr},Dr=Nr=>{if(!Nr.parentNode||!inDom(Nr))return;const Lr=isShadowRoot(Nr.parentNode)?this.mirror.getId(getShadowHost(Nr)):this.mirror.getId(Nr.parentNode),Hr=Rr(Nr);if(Lr===-1||Hr===-1)return Ar.addNode(Nr);const zr=serializeNodeWithId(Nr,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:Ur=>{isSerializedIframe(Ur,this.mirror)&&this.iframeManager.addIframe(Ur),isSerializedStylesheet(Ur,this.mirror)&&this.stylesheetManager.trackLinkElement(Ur),hasShadowRoot(Nr)&&this.shadowDomManager.addShadowRoot(Nr.shadowRoot,this.doc)},onIframeLoad:(Ur,Vr)=>{this.iframeManager.attachIframe(Ur,Vr),this.shadowDomManager.observeAttachShadow(Ur)},onStylesheetLoad:(Ur,Vr)=>{this.stylesheetManager.attachLinkElement(Ur,Vr)}});zr&&(Cr.push({parentId:Lr,nextId:Hr,node:zr}),$r.add(zr.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const Nr of this.movedSet)isParentRemoved(this.removes,Nr,this.mirror)&&!this.movedSet.has(Nr.parentNode)||Dr(Nr);for(const Nr of this.addedSet)!isAncestorInSet(this.droppedSet,Nr)&&!isParentRemoved(this.removes,Nr,this.mirror)||isAncestorInSet(this.movedSet,Nr)?Dr(Nr):this.droppedSet.add(Nr);let Mr=null;for(;Ar.length;){let Nr=null;if(Mr){const Lr=this.mirror.getId(Mr.value.parentNode),Hr=Rr(Mr.value);Lr!==-1&&Hr!==-1&&(Nr=Mr)}if(!Nr){let Lr=Ar.tail;for(;Lr;){const Hr=Lr;if(Lr=Lr.previous,Hr){const zr=this.mirror.getId(Hr.value.parentNode);if(Rr(Hr.value)===-1)continue;if(zr!==-1){Nr=Hr;break}else{const Vr=Hr.value;if(Vr.parentNode&&Vr.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const jr=Vr.parentNode.host;if(this.mirror.getId(jr)!==-1){Nr=Hr;break}}}}}}if(!Nr){for(;Ar.head;)Ar.removeNode(Ar.head.value);break}Mr=Nr.previous,Ar.removeNode(Nr.value),Dr(Nr.value)}const Br={texts:this.texts.map(Nr=>({id:this.mirror.getId(Nr.node),value:Nr.value})).filter(Nr=>!$r.has(Nr.id)).filter(Nr=>this.mirror.has(Nr.id)),attributes:this.attributes.map(Nr=>{const{attributes:Lr}=Nr;if(typeof Lr.style=="string"){const Hr=JSON.stringify(Nr.styleDiff),zr=JSON.stringify(Nr._unchangedStyles);Hr.length!$r.has(Nr.id)).filter(Nr=>this.mirror.has(Nr.id)),removes:this.removes,adds:Cr};!Br.texts.length&&!Br.attributes.length&&!Br.removes.length&&!Br.adds.length||(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(Br))},this.processMutation=Cr=>{if(isIgnored(Cr.target,this.mirror))return;let $r;try{$r=document.implementation.createHTMLDocument()}catch{$r=this.doc}switch(Cr.type){case"characterData":{const Ar=Cr.target.textContent;!isBlocked(Cr.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&Ar!==Cr.oldValue&&this.texts.push({value:needMaskingText(Cr.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&Ar?this.maskTextFn?this.maskTextFn(Ar):Ar.replace(/[\S]/g,"*"):Ar,node:Cr.target});break}case"attributes":{const Ar=Cr.target;let Rr=Cr.attributeName,Dr=Cr.target.getAttribute(Rr);if(Rr==="value"){const Br=getInputType(Ar),Nr=Ar.tagName;Dr=getInputValue(Ar,Nr,Br);const Lr=shouldMaskInput({maskInputOptions:this.maskInputOptions,tagName:Nr,type:Br}),Hr=needMaskingText(Cr.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,Lr);Dr=maskInputValue({isMasked:Hr,element:Ar,value:Dr,maskInputFn:this.maskInputFn})}if(isBlocked(Cr.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Dr===Cr.oldValue)return;let Mr=this.attributes.find(Br=>Br.node===Cr.target);if(Ar.tagName==="IFRAME"&&Rr==="src"&&!this.keepIframeSrcFn(Dr))if(!Ar.contentDocument)Rr="rr_src";else return;if(Mr||(Mr={node:Cr.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(Mr)),Rr==="type"&&Ar.tagName==="INPUT"&&(Cr.oldValue||"").toLowerCase()==="password"&&Ar.setAttribute("data-rr-is-password","true"),!ignoreAttribute(Ar.tagName,Rr)&&(Mr.attributes[Rr]=transformAttribute(this.doc,toLowerCase(Ar.tagName),toLowerCase(Rr),Dr,Ar,this.maskAttributeFn),Rr==="style")){const Br=$r.createElement("span");Cr.oldValue&&Br.setAttribute("style",Cr.oldValue);for(const Nr of Array.from(Ar.style)){const Lr=Ar.style.getPropertyValue(Nr),Hr=Ar.style.getPropertyPriority(Nr);Lr!==Br.style.getPropertyValue(Nr)||Hr!==Br.style.getPropertyPriority(Nr)?Hr===""?Mr.styleDiff[Nr]=Lr:Mr.styleDiff[Nr]=[Lr,Hr]:Mr._unchangedStyles[Nr]=[Lr,Hr]}for(const Nr of Array.from(Br.style))Ar.style.getPropertyValue(Nr)===""&&(Mr.styleDiff[Nr]=!1)}break}case"childList":{if(isBlocked(Cr.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;Cr.addedNodes.forEach(Ar=>this.genAdds(Ar,Cr.target)),Cr.removedNodes.forEach(Ar=>{const Rr=this.mirror.getId(Ar),Dr=isShadowRoot(Cr.target)?this.mirror.getId(Cr.target.host):this.mirror.getId(Cr.target);isBlocked(Cr.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||isIgnored(Ar,this.mirror)||!isSerialized(Ar,this.mirror)||(this.addedSet.has(Ar)?(deepDelete(this.addedSet,Ar),this.droppedSet.add(Ar)):this.addedSet.has(Cr.target)&&Rr===-1||isAncestorRemoved(Cr.target,this.mirror)||(this.movedSet.has(Ar)&&this.movedMap[moveKey(Rr,Dr)]?deepDelete(this.movedSet,Ar):this.removes.push({parentId:Dr,id:Rr,isShadow:isShadowRoot(Cr.target)&&isNativeShadowDom(Cr.target)?!0:void 0})),this.mapRemoves.push(Ar))});break}}},this.genAdds=(Cr,$r)=>{if(!this.processedNodeManager.inOtherBuffer(Cr,this)&&!(this.addedSet.has(Cr)||this.movedSet.has(Cr))){if(this.mirror.hasNode(Cr)){if(isIgnored(Cr,this.mirror))return;this.movedSet.add(Cr);let Ar=null;$r&&this.mirror.hasNode($r)&&(Ar=this.mirror.getId($r)),Ar&&Ar!==-1&&(this.movedMap[moveKey(this.mirror.getId(Cr),Ar)]=!0)}else this.addedSet.add(Cr),this.droppedSet.delete(Cr);isBlocked(Cr,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(Cr.childNodes.forEach(Ar=>this.genAdds(Ar)),hasShadowRoot(Cr)&&Cr.shadowRoot.childNodes.forEach(Ar=>{this.processedNodeManager.add(Ar,this),this.genAdds(Ar,Cr)}))}}}init(Cr){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach($r=>{this[$r]=Cr[$r]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function deepDelete(Tr,Cr){Tr.delete(Cr),Cr.childNodes.forEach($r=>deepDelete(Tr,$r))}function isParentRemoved(Tr,Cr,$r){return Tr.length===0?!1:_isParentRemoved(Tr,Cr,$r)}function _isParentRemoved(Tr,Cr,$r){const{parentNode:Ar}=Cr;if(!Ar)return!1;const Rr=$r.getId(Ar);return Tr.some(Dr=>Dr.id===Rr)?!0:_isParentRemoved(Tr,Ar,$r)}function isAncestorInSet(Tr,Cr){return Tr.size===0?!1:_isAncestorInSet(Tr,Cr)}function _isAncestorInSet(Tr,Cr){const{parentNode:$r}=Cr;return $r?Tr.has($r)?!0:_isAncestorInSet(Tr,$r):!1}let errorHandler;function registerErrorHandler(Tr){errorHandler=Tr}function unregisterErrorHandler(){errorHandler=void 0}const callbackWrapper=Tr=>errorHandler?(...$r)=>{try{return Tr(...$r)}catch(Ar){if(errorHandler&&errorHandler(Ar)===!0)return()=>{};throw Ar}}:Tr,mutationBuffers=[];function getEventTarget(Tr){try{if("composedPath"in Tr){const Cr=Tr.composedPath();if(Cr.length)return Cr[0]}else if("path"in Tr&&Tr.path.length)return Tr.path[0]}catch{}return Tr&&Tr.target}function initMutationObserver(Tr,Cr){var $r,Ar;const Rr=new MutationBuffer;mutationBuffers.push(Rr),Rr.init(Tr);let Dr=window.MutationObserver||window.__rrMutationObserver;const Mr=(Ar=($r=window==null?void 0:window.Zone)===null||$r===void 0?void 0:$r.__symbol__)===null||Ar===void 0?void 0:Ar.call($r,"MutationObserver");Mr&&window[Mr]&&(Dr=window[Mr]);const Br=new Dr(callbackWrapper(Nr=>{Tr.onMutation&&Tr.onMutation(Nr)===!1||Rr.processMutations.bind(Rr)(Nr)}));return Br.observe(Cr,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),Br}function initMoveObserver({mousemoveCb:Tr,sampling:Cr,doc:$r,mirror:Ar}){if(Cr.mousemove===!1)return()=>{};const Rr=typeof Cr.mousemove=="number"?Cr.mousemove:50,Dr=typeof Cr.mousemoveCallback=="number"?Cr.mousemoveCallback:500;let Mr=[],Br;const Nr=throttle$1(callbackWrapper(zr=>{const Ur=Date.now()-Br;Tr(Mr.map(Vr=>(Vr.timeOffset-=Ur,Vr)),zr),Mr=[],Br=null}),Dr),Lr=callbackWrapper(throttle$1(callbackWrapper(zr=>{const Ur=getEventTarget(zr),{clientX:Vr,clientY:jr}=legacy_isTouchEvent(zr)?zr.changedTouches[0]:zr;Br||(Br=nowTimestamp()),Mr.push({x:Vr,y:jr,id:Ar.getId(Ur),timeOffset:nowTimestamp()-Br}),Nr(typeof DragEvent<"u"&&zr instanceof DragEvent?IncrementalSource.Drag:zr instanceof MouseEvent?IncrementalSource.MouseMove:IncrementalSource.TouchMove)}),Rr,{trailing:!1})),Hr=[on("mousemove",Lr,$r),on("touchmove",Lr,$r),on("drag",Lr,$r)];return callbackWrapper(()=>{Hr.forEach(zr=>zr())})}function initMouseInteractionObserver({mouseInteractionCb:Tr,doc:Cr,mirror:$r,blockClass:Ar,blockSelector:Rr,unblockSelector:Dr,sampling:Mr}){if(Mr.mouseInteraction===!1)return()=>{};const Br=Mr.mouseInteraction===!0||Mr.mouseInteraction===void 0?{}:Mr.mouseInteraction,Nr=[];let Lr=null;const Hr=zr=>Ur=>{const Vr=getEventTarget(Ur);if(isBlocked(Vr,Ar,Rr,Dr,!0))return;let jr=null,Gr=zr;if("pointerType"in Ur){switch(Ur.pointerType){case"mouse":jr=PointerTypes.Mouse;break;case"touch":jr=PointerTypes.Touch;break;case"pen":jr=PointerTypes.Pen;break}jr===PointerTypes.Touch?MouseInteractions[zr]===MouseInteractions.MouseDown?Gr="TouchStart":MouseInteractions[zr]===MouseInteractions.MouseUp&&(Gr="TouchEnd"):PointerTypes.Pen}else legacy_isTouchEvent(Ur)&&(jr=PointerTypes.Touch);jr!==null?(Lr=jr,(Gr.startsWith("Touch")&&jr===PointerTypes.Touch||Gr.startsWith("Mouse")&&jr===PointerTypes.Mouse)&&(jr=null)):MouseInteractions[zr]===MouseInteractions.Click&&(jr=Lr,Lr=null);const Xr=legacy_isTouchEvent(Ur)?Ur.changedTouches[0]:Ur;if(!Xr)return;const Kr=$r.getId(Vr),{clientX:Zr,clientY:eo}=Xr;callbackWrapper(Tr)(Object.assign({type:MouseInteractions[Gr],id:Kr,x:Zr,y:eo},jr!==null&&{pointerType:jr}))};return Object.keys(MouseInteractions).filter(zr=>Number.isNaN(Number(zr))&&!zr.endsWith("_Departed")&&Br[zr]!==!1).forEach(zr=>{let Ur=toLowerCase(zr);const Vr=Hr(zr);if(window.PointerEvent)switch(MouseInteractions[zr]){case MouseInteractions.MouseDown:case MouseInteractions.MouseUp:Ur=Ur.replace("mouse","pointer");break;case MouseInteractions.TouchStart:case MouseInteractions.TouchEnd:return}Nr.push(on(Ur,Vr,Cr))}),callbackWrapper(()=>{Nr.forEach(zr=>zr())})}function initScrollObserver({scrollCb:Tr,doc:Cr,mirror:$r,blockClass:Ar,blockSelector:Rr,unblockSelector:Dr,sampling:Mr}){const Br=callbackWrapper(throttle$1(callbackWrapper(Nr=>{const Lr=getEventTarget(Nr);if(!Lr||isBlocked(Lr,Ar,Rr,Dr,!0))return;const Hr=$r.getId(Lr);if(Lr===Cr&&Cr.defaultView){const zr=getWindowScroll(Cr.defaultView);Tr({id:Hr,x:zr.left,y:zr.top})}else Tr({id:Hr,x:Lr.scrollLeft,y:Lr.scrollTop})}),Mr.scroll||100));return on("scroll",Br,Cr)}function initViewportResizeObserver({viewportResizeCb:Tr},{win:Cr}){let $r=-1,Ar=-1;const Rr=callbackWrapper(throttle$1(callbackWrapper(()=>{const Dr=getWindowHeight(),Mr=getWindowWidth();($r!==Dr||Ar!==Mr)&&(Tr({width:Number(Mr),height:Number(Dr)}),$r=Dr,Ar=Mr)}),200));return on("resize",Rr,Cr)}function wrapEventWithUserTriggeredFlag(Tr,Cr){const $r=Object.assign({},Tr);return Cr||delete $r.userTriggered,$r}const INPUT_TAGS=["INPUT","TEXTAREA","SELECT"],lastInputValueMap=new WeakMap;function initInputObserver({inputCb:Tr,doc:Cr,mirror:$r,blockClass:Ar,blockSelector:Rr,unblockSelector:Dr,ignoreClass:Mr,ignoreSelector:Br,maskInputOptions:Nr,maskInputFn:Lr,sampling:Hr,userTriggeredOnInput:zr,maskTextClass:Ur,unmaskTextClass:Vr,maskTextSelector:jr,unmaskTextSelector:Gr}){function Xr(no){let ro=getEventTarget(no);const so=no.isTrusted,ao=ro&&toUpperCase(ro.tagName);if(ao==="OPTION"&&(ro=ro.parentElement),!ro||!ao||INPUT_TAGS.indexOf(ao)<0||isBlocked(ro,Ar,Rr,Dr,!0))return;const lo=ro;if(lo.classList.contains(Mr)||Br&&lo.matches(Br))return;const po=getInputType(ro);let go=getInputValue(lo,ao,po),co=!1;const mo=shouldMaskInput({maskInputOptions:Nr,tagName:ao,type:po}),io=needMaskingText(ro,Ur,jr,Vr,Gr,mo);(po==="radio"||po==="checkbox")&&(co=ro.checked),go=maskInputValue({isMasked:io,element:ro,value:go,maskInputFn:Lr}),Kr(ro,callbackWrapper(wrapEventWithUserTriggeredFlag)({text:go,isChecked:co,userTriggered:so},zr));const uo=ro.name;po==="radio"&&uo&&co&&Cr.querySelectorAll(`input[type="radio"][name="${uo}"]`).forEach(ho=>{if(ho!==ro){const yo=maskInputValue({isMasked:io,element:ho,value:getInputValue(ho,ao,po),maskInputFn:Lr});Kr(ho,callbackWrapper(wrapEventWithUserTriggeredFlag)({text:yo,isChecked:!co,userTriggered:!1},zr))}})}function Kr(no,ro){const so=lastInputValueMap.get(no);if(!so||so.text!==ro.text||so.isChecked!==ro.isChecked){lastInputValueMap.set(no,ro);const ao=$r.getId(no);callbackWrapper(Tr)(Object.assign(Object.assign({},ro),{id:ao}))}}const eo=(Hr.input==="last"?["change"]:["input","change"]).map(no=>on(no,callbackWrapper(Xr),Cr)),Wr=Cr.defaultView;if(!Wr)return()=>{eo.forEach(no=>no())};const Yr=Wr.Object.getOwnPropertyDescriptor(Wr.HTMLInputElement.prototype,"value"),Jr=[[Wr.HTMLInputElement.prototype,"value"],[Wr.HTMLInputElement.prototype,"checked"],[Wr.HTMLSelectElement.prototype,"value"],[Wr.HTMLTextAreaElement.prototype,"value"],[Wr.HTMLSelectElement.prototype,"selectedIndex"],[Wr.HTMLOptionElement.prototype,"selected"]];return Yr&&Yr.set&&eo.push(...Jr.map(no=>hookSetter(no[0],no[1],{set(){callbackWrapper(Xr)({target:this,isTrusted:!1})}},!1,Wr))),callbackWrapper(()=>{eo.forEach(no=>no())})}function getNestedCSSRulePositions(Tr){const Cr=[];function $r(Ar,Rr){if(hasNestedCSSRule("CSSGroupingRule")&&Ar.parentRule instanceof CSSGroupingRule||hasNestedCSSRule("CSSMediaRule")&&Ar.parentRule instanceof CSSMediaRule||hasNestedCSSRule("CSSSupportsRule")&&Ar.parentRule instanceof CSSSupportsRule||hasNestedCSSRule("CSSConditionRule")&&Ar.parentRule instanceof CSSConditionRule){const Mr=Array.from(Ar.parentRule.cssRules).indexOf(Ar);Rr.unshift(Mr)}else if(Ar.parentStyleSheet){const Mr=Array.from(Ar.parentStyleSheet.cssRules).indexOf(Ar);Rr.unshift(Mr)}return Rr}return $r(Tr,Cr)}function getIdAndStyleId(Tr,Cr,$r){let Ar,Rr;return Tr?(Tr.ownerNode?Ar=Cr.getId(Tr.ownerNode):Rr=$r.getId(Tr),{styleId:Rr,id:Ar}):{}}function initStyleSheetObserver({styleSheetRuleCb:Tr,mirror:Cr,stylesheetManager:$r},{win:Ar}){if(!Ar.CSSStyleSheet||!Ar.CSSStyleSheet.prototype)return()=>{};const Rr=Ar.CSSStyleSheet.prototype.insertRule;Ar.CSSStyleSheet.prototype.insertRule=new Proxy(Rr,{apply:callbackWrapper((Hr,zr,Ur)=>{const[Vr,jr]=Ur,{id:Gr,styleId:Xr}=getIdAndStyleId(zr,Cr,$r.styleMirror);return(Gr&&Gr!==-1||Xr&&Xr!==-1)&&Tr({id:Gr,styleId:Xr,adds:[{rule:Vr,index:jr}]}),Hr.apply(zr,Ur)})});const Dr=Ar.CSSStyleSheet.prototype.deleteRule;Ar.CSSStyleSheet.prototype.deleteRule=new Proxy(Dr,{apply:callbackWrapper((Hr,zr,Ur)=>{const[Vr]=Ur,{id:jr,styleId:Gr}=getIdAndStyleId(zr,Cr,$r.styleMirror);return(jr&&jr!==-1||Gr&&Gr!==-1)&&Tr({id:jr,styleId:Gr,removes:[{index:Vr}]}),Hr.apply(zr,Ur)})});let Mr;Ar.CSSStyleSheet.prototype.replace&&(Mr=Ar.CSSStyleSheet.prototype.replace,Ar.CSSStyleSheet.prototype.replace=new Proxy(Mr,{apply:callbackWrapper((Hr,zr,Ur)=>{const[Vr]=Ur,{id:jr,styleId:Gr}=getIdAndStyleId(zr,Cr,$r.styleMirror);return(jr&&jr!==-1||Gr&&Gr!==-1)&&Tr({id:jr,styleId:Gr,replace:Vr}),Hr.apply(zr,Ur)})}));let Br;Ar.CSSStyleSheet.prototype.replaceSync&&(Br=Ar.CSSStyleSheet.prototype.replaceSync,Ar.CSSStyleSheet.prototype.replaceSync=new Proxy(Br,{apply:callbackWrapper((Hr,zr,Ur)=>{const[Vr]=Ur,{id:jr,styleId:Gr}=getIdAndStyleId(zr,Cr,$r.styleMirror);return(jr&&jr!==-1||Gr&&Gr!==-1)&&Tr({id:jr,styleId:Gr,replaceSync:Vr}),Hr.apply(zr,Ur)})}));const Nr={};canMonkeyPatchNestedCSSRule("CSSGroupingRule")?Nr.CSSGroupingRule=Ar.CSSGroupingRule:(canMonkeyPatchNestedCSSRule("CSSMediaRule")&&(Nr.CSSMediaRule=Ar.CSSMediaRule),canMonkeyPatchNestedCSSRule("CSSConditionRule")&&(Nr.CSSConditionRule=Ar.CSSConditionRule),canMonkeyPatchNestedCSSRule("CSSSupportsRule")&&(Nr.CSSSupportsRule=Ar.CSSSupportsRule));const Lr={};return Object.entries(Nr).forEach(([Hr,zr])=>{Lr[Hr]={insertRule:zr.prototype.insertRule,deleteRule:zr.prototype.deleteRule},zr.prototype.insertRule=new Proxy(Lr[Hr].insertRule,{apply:callbackWrapper((Ur,Vr,jr)=>{const[Gr,Xr]=jr,{id:Kr,styleId:Zr}=getIdAndStyleId(Vr.parentStyleSheet,Cr,$r.styleMirror);return(Kr&&Kr!==-1||Zr&&Zr!==-1)&&Tr({id:Kr,styleId:Zr,adds:[{rule:Gr,index:[...getNestedCSSRulePositions(Vr),Xr||0]}]}),Ur.apply(Vr,jr)})}),zr.prototype.deleteRule=new Proxy(Lr[Hr].deleteRule,{apply:callbackWrapper((Ur,Vr,jr)=>{const[Gr]=jr,{id:Xr,styleId:Kr}=getIdAndStyleId(Vr.parentStyleSheet,Cr,$r.styleMirror);return(Xr&&Xr!==-1||Kr&&Kr!==-1)&&Tr({id:Xr,styleId:Kr,removes:[{index:[...getNestedCSSRulePositions(Vr),Gr]}]}),Ur.apply(Vr,jr)})})}),callbackWrapper(()=>{Ar.CSSStyleSheet.prototype.insertRule=Rr,Ar.CSSStyleSheet.prototype.deleteRule=Dr,Mr&&(Ar.CSSStyleSheet.prototype.replace=Mr),Br&&(Ar.CSSStyleSheet.prototype.replaceSync=Br),Object.entries(Nr).forEach(([Hr,zr])=>{zr.prototype.insertRule=Lr[Hr].insertRule,zr.prototype.deleteRule=Lr[Hr].deleteRule})})}function initAdoptedStyleSheetObserver({mirror:Tr,stylesheetManager:Cr},$r){var Ar,Rr,Dr;let Mr=null;$r.nodeName==="#document"?Mr=Tr.getId($r):Mr=Tr.getId($r.host);const Br=$r.nodeName==="#document"?(Ar=$r.defaultView)===null||Ar===void 0?void 0:Ar.Document:(Dr=(Rr=$r.ownerDocument)===null||Rr===void 0?void 0:Rr.defaultView)===null||Dr===void 0?void 0:Dr.ShadowRoot,Nr=Object.getOwnPropertyDescriptor(Br==null?void 0:Br.prototype,"adoptedStyleSheets");return Mr===null||Mr===-1||!Br||!Nr?()=>{}:(Object.defineProperty($r,"adoptedStyleSheets",{configurable:Nr.configurable,enumerable:Nr.enumerable,get(){var Lr;return(Lr=Nr.get)===null||Lr===void 0?void 0:Lr.call(this)},set(Lr){var Hr;const zr=(Hr=Nr.set)===null||Hr===void 0?void 0:Hr.call(this,Lr);if(Mr!==null&&Mr!==-1)try{Cr.adoptStyleSheets(Lr,Mr)}catch{}return zr}}),callbackWrapper(()=>{Object.defineProperty($r,"adoptedStyleSheets",{configurable:Nr.configurable,enumerable:Nr.enumerable,get:Nr.get,set:Nr.set})}))}function initStyleDeclarationObserver({styleDeclarationCb:Tr,mirror:Cr,ignoreCSSAttributes:$r,stylesheetManager:Ar},{win:Rr}){const Dr=Rr.CSSStyleDeclaration.prototype.setProperty;Rr.CSSStyleDeclaration.prototype.setProperty=new Proxy(Dr,{apply:callbackWrapper((Br,Nr,Lr)=>{var Hr;const[zr,Ur,Vr]=Lr;if($r.has(zr))return Dr.apply(Nr,[zr,Ur,Vr]);const{id:jr,styleId:Gr}=getIdAndStyleId((Hr=Nr.parentRule)===null||Hr===void 0?void 0:Hr.parentStyleSheet,Cr,Ar.styleMirror);return(jr&&jr!==-1||Gr&&Gr!==-1)&&Tr({id:jr,styleId:Gr,set:{property:zr,value:Ur,priority:Vr},index:getNestedCSSRulePositions(Nr.parentRule)}),Br.apply(Nr,Lr)})});const Mr=Rr.CSSStyleDeclaration.prototype.removeProperty;return Rr.CSSStyleDeclaration.prototype.removeProperty=new Proxy(Mr,{apply:callbackWrapper((Br,Nr,Lr)=>{var Hr;const[zr]=Lr;if($r.has(zr))return Mr.apply(Nr,[zr]);const{id:Ur,styleId:Vr}=getIdAndStyleId((Hr=Nr.parentRule)===null||Hr===void 0?void 0:Hr.parentStyleSheet,Cr,Ar.styleMirror);return(Ur&&Ur!==-1||Vr&&Vr!==-1)&&Tr({id:Ur,styleId:Vr,remove:{property:zr},index:getNestedCSSRulePositions(Nr.parentRule)}),Br.apply(Nr,Lr)})}),callbackWrapper(()=>{Rr.CSSStyleDeclaration.prototype.setProperty=Dr,Rr.CSSStyleDeclaration.prototype.removeProperty=Mr})}function initMediaInteractionObserver({mediaInteractionCb:Tr,blockClass:Cr,blockSelector:$r,unblockSelector:Ar,mirror:Rr,sampling:Dr,doc:Mr}){const Br=callbackWrapper(Lr=>throttle$1(callbackWrapper(Hr=>{const zr=getEventTarget(Hr);if(!zr||isBlocked(zr,Cr,$r,Ar,!0))return;const{currentTime:Ur,volume:Vr,muted:jr,playbackRate:Gr}=zr;Tr({type:Lr,id:Rr.getId(zr),currentTime:Ur,volume:Vr,muted:jr,playbackRate:Gr})}),Dr.media||500)),Nr=[on("play",Br(0),Mr),on("pause",Br(1),Mr),on("seeked",Br(2),Mr),on("volumechange",Br(3),Mr),on("ratechange",Br(4),Mr)];return callbackWrapper(()=>{Nr.forEach(Lr=>Lr())})}function initFontObserver({fontCb:Tr,doc:Cr}){const $r=Cr.defaultView;if(!$r)return()=>{};const Ar=[],Rr=new WeakMap,Dr=$r.FontFace;$r.FontFace=function(Nr,Lr,Hr){const zr=new Dr(Nr,Lr,Hr);return Rr.set(zr,{family:Nr,buffer:typeof Lr!="string",descriptors:Hr,fontSource:typeof Lr=="string"?Lr:JSON.stringify(Array.from(new Uint8Array(Lr)))}),zr};const Mr=patch(Cr.fonts,"add",function(Br){return function(Nr){return setTimeout(callbackWrapper(()=>{const Lr=Rr.get(Nr);Lr&&(Tr(Lr),Rr.delete(Nr))}),0),Br.apply(this,[Nr])}});return Ar.push(()=>{$r.FontFace=Dr}),Ar.push(Mr),callbackWrapper(()=>{Ar.forEach(Br=>Br())})}function initSelectionObserver(Tr){const{doc:Cr,mirror:$r,blockClass:Ar,blockSelector:Rr,unblockSelector:Dr,selectionCb:Mr}=Tr;let Br=!0;const Nr=callbackWrapper(()=>{const Lr=Cr.getSelection();if(!Lr||Br&&(Lr!=null&&Lr.isCollapsed))return;Br=Lr.isCollapsed||!1;const Hr=[],zr=Lr.rangeCount||0;for(let Ur=0;Ur{}:patch($r.customElements,"define",function(Rr){return function(Dr,Mr,Br){try{Cr({define:{name:Dr}})}catch{}return Rr.apply(this,[Dr,Mr,Br])}})}function mergeHooks(Tr,Cr){const{mutationCb:$r,mousemoveCb:Ar,mouseInteractionCb:Rr,scrollCb:Dr,viewportResizeCb:Mr,inputCb:Br,mediaInteractionCb:Nr,styleSheetRuleCb:Lr,styleDeclarationCb:Hr,canvasMutationCb:zr,fontCb:Ur,selectionCb:Vr,customElementCb:jr}=Tr;Tr.mutationCb=(...Gr)=>{Cr.mutation&&Cr.mutation(...Gr),$r(...Gr)},Tr.mousemoveCb=(...Gr)=>{Cr.mousemove&&Cr.mousemove(...Gr),Ar(...Gr)},Tr.mouseInteractionCb=(...Gr)=>{Cr.mouseInteraction&&Cr.mouseInteraction(...Gr),Rr(...Gr)},Tr.scrollCb=(...Gr)=>{Cr.scroll&&Cr.scroll(...Gr),Dr(...Gr)},Tr.viewportResizeCb=(...Gr)=>{Cr.viewportResize&&Cr.viewportResize(...Gr),Mr(...Gr)},Tr.inputCb=(...Gr)=>{Cr.input&&Cr.input(...Gr),Br(...Gr)},Tr.mediaInteractionCb=(...Gr)=>{Cr.mediaInteaction&&Cr.mediaInteaction(...Gr),Nr(...Gr)},Tr.styleSheetRuleCb=(...Gr)=>{Cr.styleSheetRule&&Cr.styleSheetRule(...Gr),Lr(...Gr)},Tr.styleDeclarationCb=(...Gr)=>{Cr.styleDeclaration&&Cr.styleDeclaration(...Gr),Hr(...Gr)},Tr.canvasMutationCb=(...Gr)=>{Cr.canvasMutation&&Cr.canvasMutation(...Gr),zr(...Gr)},Tr.fontCb=(...Gr)=>{Cr.font&&Cr.font(...Gr),Ur(...Gr)},Tr.selectionCb=(...Gr)=>{Cr.selection&&Cr.selection(...Gr),Vr(...Gr)},Tr.customElementCb=(...Gr)=>{Cr.customElement&&Cr.customElement(...Gr),jr(...Gr)}}function initObservers(Tr,Cr={}){const $r=Tr.doc.defaultView;if(!$r)return()=>{};mergeHooks(Tr,Cr);const Ar=initMutationObserver(Tr,Tr.doc),Rr=initMoveObserver(Tr),Dr=initMouseInteractionObserver(Tr),Mr=initScrollObserver(Tr),Br=initViewportResizeObserver(Tr,{win:$r}),Nr=initInputObserver(Tr),Lr=initMediaInteractionObserver(Tr),Hr=initStyleSheetObserver(Tr,{win:$r}),zr=initAdoptedStyleSheetObserver(Tr,Tr.doc),Ur=initStyleDeclarationObserver(Tr,{win:$r}),Vr=Tr.collectFonts?initFontObserver(Tr):()=>{},jr=initSelectionObserver(Tr),Gr=initCustomElementObserver(Tr),Xr=[];for(const Kr of Tr.plugins)Xr.push(Kr.observer(Kr.callback,$r,Kr.options));return callbackWrapper(()=>{mutationBuffers.forEach(Kr=>Kr.reset()),Ar.disconnect(),Rr(),Dr(),Mr(),Br(),Nr(),Lr(),Hr(),zr(),Ur(),Vr(),jr(),Gr(),Xr.forEach(Kr=>Kr())})}function hasNestedCSSRule(Tr){return typeof window[Tr]<"u"}function canMonkeyPatchNestedCSSRule(Tr){return!!(typeof window[Tr]<"u"&&window[Tr].prototype&&"insertRule"in window[Tr].prototype&&"deleteRule"in window[Tr].prototype)}class CrossOriginIframeMirror{constructor(Cr){this.generateIdFn=Cr,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(Cr,$r,Ar,Rr){const Dr=Ar||this.getIdToRemoteIdMap(Cr),Mr=Rr||this.getRemoteIdToIdMap(Cr);let Br=Dr.get($r);return Br||(Br=this.generateIdFn(),Dr.set($r,Br),Mr.set(Br,$r)),Br}getIds(Cr,$r){const Ar=this.getIdToRemoteIdMap(Cr),Rr=this.getRemoteIdToIdMap(Cr);return $r.map(Dr=>this.getId(Cr,Dr,Ar,Rr))}getRemoteId(Cr,$r,Ar){const Rr=Ar||this.getRemoteIdToIdMap(Cr);if(typeof $r!="number")return $r;const Dr=Rr.get($r);return Dr||-1}getRemoteIds(Cr,$r){const Ar=this.getRemoteIdToIdMap(Cr);return $r.map(Rr=>this.getRemoteId(Cr,Rr,Ar))}reset(Cr){if(!Cr){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(Cr),this.iframeRemoteIdToIdMap.delete(Cr)}getIdToRemoteIdMap(Cr){let $r=this.iframeIdToRemoteIdMap.get(Cr);return $r||($r=new Map,this.iframeIdToRemoteIdMap.set(Cr,$r)),$r}getRemoteIdToIdMap(Cr){let $r=this.iframeRemoteIdToIdMap.get(Cr);return $r||($r=new Map,this.iframeRemoteIdToIdMap.set(Cr,$r)),$r}}class IframeManager{constructor(Cr){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new CrossOriginIframeMirror(genId),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=Cr.mutationCb,this.wrappedEmit=Cr.wrappedEmit,this.stylesheetManager=Cr.stylesheetManager,this.recordCrossOriginIframes=Cr.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=Cr.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(Cr){this.iframes.set(Cr,!0),Cr.contentWindow&&this.crossOriginIframeMap.set(Cr.contentWindow,Cr)}addLoadListener(Cr){this.loadListener=Cr}attachIframe(Cr,$r){var Ar;this.mutationCb({adds:[{parentId:this.mirror.getId(Cr),nextId:null,node:$r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(Ar=this.loadListener)===null||Ar===void 0||Ar.call(this,Cr),Cr.contentDocument&&Cr.contentDocument.adoptedStyleSheets&&Cr.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(Cr.contentDocument.adoptedStyleSheets,this.mirror.getId(Cr.contentDocument))}handleMessage(Cr){const $r=Cr;if($r.data.type!=="rrweb"||$r.origin!==$r.data.origin||!Cr.source)return;const Rr=this.crossOriginIframeMap.get(Cr.source);if(!Rr)return;const Dr=this.transformCrossOriginEvent(Rr,$r.data.event);Dr&&this.wrappedEmit(Dr,$r.data.isCheckout)}transformCrossOriginEvent(Cr,$r){var Ar;switch($r.type){case EventType.FullSnapshot:{this.crossOriginIframeMirror.reset(Cr),this.crossOriginIframeStyleMirror.reset(Cr),this.replaceIdOnNode($r.data.node,Cr);const Rr=$r.data.node.id;return this.crossOriginIframeRootIdMap.set(Cr,Rr),this.patchRootIdOnNode($r.data.node,Rr),{timestamp:$r.timestamp,type:EventType.IncrementalSnapshot,data:{source:IncrementalSource.Mutation,adds:[{parentId:this.mirror.getId(Cr),nextId:null,node:$r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case EventType.Meta:case EventType.Load:case EventType.DomContentLoaded:return!1;case EventType.Plugin:return $r;case EventType.Custom:return this.replaceIds($r.data.payload,Cr,["id","parentId","previousId","nextId"]),$r;case EventType.IncrementalSnapshot:switch($r.data.source){case IncrementalSource.Mutation:return $r.data.adds.forEach(Rr=>{this.replaceIds(Rr,Cr,["parentId","nextId","previousId"]),this.replaceIdOnNode(Rr.node,Cr);const Dr=this.crossOriginIframeRootIdMap.get(Cr);Dr&&this.patchRootIdOnNode(Rr.node,Dr)}),$r.data.removes.forEach(Rr=>{this.replaceIds(Rr,Cr,["parentId","id"])}),$r.data.attributes.forEach(Rr=>{this.replaceIds(Rr,Cr,["id"])}),$r.data.texts.forEach(Rr=>{this.replaceIds(Rr,Cr,["id"])}),$r;case IncrementalSource.Drag:case IncrementalSource.TouchMove:case IncrementalSource.MouseMove:return $r.data.positions.forEach(Rr=>{this.replaceIds(Rr,Cr,["id"])}),$r;case IncrementalSource.ViewportResize:return!1;case IncrementalSource.MediaInteraction:case IncrementalSource.MouseInteraction:case IncrementalSource.Scroll:case IncrementalSource.CanvasMutation:case IncrementalSource.Input:return this.replaceIds($r.data,Cr,["id"]),$r;case IncrementalSource.StyleSheetRule:case IncrementalSource.StyleDeclaration:return this.replaceIds($r.data,Cr,["id"]),this.replaceStyleIds($r.data,Cr,["styleId"]),$r;case IncrementalSource.Font:return $r;case IncrementalSource.Selection:return $r.data.ranges.forEach(Rr=>{this.replaceIds(Rr,Cr,["start","end"])}),$r;case IncrementalSource.AdoptedStyleSheet:return this.replaceIds($r.data,Cr,["id"]),this.replaceStyleIds($r.data,Cr,["styleIds"]),(Ar=$r.data.styles)===null||Ar===void 0||Ar.forEach(Rr=>{this.replaceStyleIds(Rr,Cr,["styleId"])}),$r}}return!1}replace(Cr,$r,Ar,Rr){for(const Dr of Rr)!Array.isArray($r[Dr])&&typeof $r[Dr]!="number"||(Array.isArray($r[Dr])?$r[Dr]=Cr.getIds(Ar,$r[Dr]):$r[Dr]=Cr.getId(Ar,$r[Dr]));return $r}replaceIds(Cr,$r,Ar){return this.replace(this.crossOriginIframeMirror,Cr,$r,Ar)}replaceStyleIds(Cr,$r,Ar){return this.replace(this.crossOriginIframeStyleMirror,Cr,$r,Ar)}replaceIdOnNode(Cr,$r){this.replaceIds(Cr,$r,["id","rootId"]),"childNodes"in Cr&&Cr.childNodes.forEach(Ar=>{this.replaceIdOnNode(Ar,$r)})}patchRootIdOnNode(Cr,$r){Cr.type!==NodeType$1$1.Document&&!Cr.rootId&&(Cr.rootId=$r),"childNodes"in Cr&&Cr.childNodes.forEach(Ar=>{this.patchRootIdOnNode(Ar,$r)})}}class ShadowDomManager{constructor(Cr){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=Cr.mutationCb,this.scrollCb=Cr.scrollCb,this.bypassOptions=Cr.bypassOptions,this.mirror=Cr.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(Cr,$r){if(!isNativeShadowDom(Cr)||this.shadowDoms.has(Cr))return;this.shadowDoms.add(Cr);const Ar=initMutationObserver(Object.assign(Object.assign({},this.bypassOptions),{doc:$r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),Cr);this.restoreHandlers.push(()=>Ar.disconnect()),this.restoreHandlers.push(initScrollObserver(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:Cr,mirror:this.mirror}))),setTimeout(()=>{Cr.adoptedStyleSheets&&Cr.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(Cr.adoptedStyleSheets,this.mirror.getId(Cr.host)),this.restoreHandlers.push(initAdoptedStyleSheetObserver({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},Cr))},0)}observeAttachShadow(Cr){!Cr.contentWindow||!Cr.contentDocument||this.patchAttachShadow(Cr.contentWindow.Element,Cr.contentDocument)}patchAttachShadow(Cr,$r){const Ar=this;this.restoreHandlers.push(patch(Cr.prototype,"attachShadow",function(Rr){return function(Dr){const Mr=Rr.call(this,Dr);return this.shadowRoot&&inDom(this)&&Ar.addShadowRoot(this.shadowRoot,$r),Mr}}))}reset(){this.restoreHandlers.forEach(Cr=>{try{Cr()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function __rest(Tr,Cr){var $r={};for(var Ar in Tr)Object.prototype.hasOwnProperty.call(Tr,Ar)&&Cr.indexOf(Ar)<0&&($r[Ar]=Tr[Ar]);if(Tr!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Rr=0,Ar=Object.getOwnPropertySymbols(Tr);Rr"u"?[]:new Uint8Array(256);for(var i$4=0;i$4>2],Rr+=chars[(Cr[$r]&3)<<4|Cr[$r+1]>>4],Rr+=chars[(Cr[$r+1]&15)<<2|Cr[$r+2]>>6],Rr+=chars[Cr[$r+2]&63];return Ar%3===2?Rr=Rr.substring(0,Rr.length-1)+"=":Ar%3===1&&(Rr=Rr.substring(0,Rr.length-2)+"=="),Rr};const canvasVarMap=new Map;function variableListFor(Tr,Cr){let $r=canvasVarMap.get(Tr);return $r||($r=new Map,canvasVarMap.set(Tr,$r)),$r.has(Cr)||$r.set(Cr,[]),$r.get(Cr)}const saveWebGLVar=(Tr,Cr,$r)=>{if(!Tr||!(isInstanceOfWebGLObject(Tr,Cr)||typeof Tr=="object"))return;const Ar=Tr.constructor.name,Rr=variableListFor($r,Ar);let Dr=Rr.indexOf(Tr);return Dr===-1&&(Dr=Rr.length,Rr.push(Tr)),Dr};function serializeArg(Tr,Cr,$r){if(Tr instanceof Array)return Tr.map(Ar=>serializeArg(Ar,Cr,$r));if(Tr===null)return Tr;if(Tr instanceof Float32Array||Tr instanceof Float64Array||Tr instanceof Int32Array||Tr instanceof Uint32Array||Tr instanceof Uint8Array||Tr instanceof Uint16Array||Tr instanceof Int16Array||Tr instanceof Int8Array||Tr instanceof Uint8ClampedArray)return{rr_type:Tr.constructor.name,args:[Object.values(Tr)]};if(Tr instanceof ArrayBuffer){const Ar=Tr.constructor.name,Rr=encode$4(Tr);return{rr_type:Ar,base64:Rr}}else{if(Tr instanceof DataView)return{rr_type:Tr.constructor.name,args:[serializeArg(Tr.buffer,Cr,$r),Tr.byteOffset,Tr.byteLength]};if(Tr instanceof HTMLImageElement){const Ar=Tr.constructor.name,{src:Rr}=Tr;return{rr_type:Ar,src:Rr}}else if(Tr instanceof HTMLCanvasElement){const Ar="HTMLImageElement",Rr=Tr.toDataURL();return{rr_type:Ar,src:Rr}}else{if(Tr instanceof ImageData)return{rr_type:Tr.constructor.name,args:[serializeArg(Tr.data,Cr,$r),Tr.width,Tr.height]};if(isInstanceOfWebGLObject(Tr,Cr)||typeof Tr=="object"){const Ar=Tr.constructor.name,Rr=saveWebGLVar(Tr,Cr,$r);return{rr_type:Ar,index:Rr}}}}return Tr}const serializeArgs=(Tr,Cr,$r)=>[...Tr].map(Ar=>serializeArg(Ar,Cr,$r)),isInstanceOfWebGLObject=(Tr,Cr)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(Rr=>typeof Cr[Rr]=="function").find(Rr=>Tr instanceof Cr[Rr]);function initCanvas2DMutationObserver(Tr,Cr,$r,Ar,Rr){const Dr=[],Mr=Object.getOwnPropertyNames(Cr.CanvasRenderingContext2D.prototype);for(const Br of Mr)try{if(typeof Cr.CanvasRenderingContext2D.prototype[Br]!="function")continue;const Nr=patch(Cr.CanvasRenderingContext2D.prototype,Br,function(Lr){return function(...Hr){return isBlocked(this.canvas,$r,Ar,Rr,!0)||setTimeout(()=>{const zr=serializeArgs([...Hr],Cr,this);Tr(this.canvas,{type:CanvasContext["2D"],property:Br,args:zr})},0),Lr.apply(this,Hr)}});Dr.push(Nr)}catch{const Lr=hookSetter(Cr.CanvasRenderingContext2D.prototype,Br,{set(Hr){Tr(this.canvas,{type:CanvasContext["2D"],property:Br,args:[Hr],setter:!0})}});Dr.push(Lr)}return()=>{Dr.forEach(Br=>Br())}}function getNormalizedContextName(Tr){return Tr==="experimental-webgl"?"webgl":Tr}function initCanvasContextObserver(Tr,Cr,$r,Ar,Rr){const Dr=[];try{const Mr=patch(Tr.HTMLCanvasElement.prototype,"getContext",function(Br){return function(Nr,...Lr){if(!isBlocked(this,Cr,$r,Ar,!0)){const Hr=getNormalizedContextName(Nr);if("__context"in this||(this.__context=Hr),Rr&&["webgl","webgl2"].includes(Hr))if(Lr[0]&&typeof Lr[0]=="object"){const zr=Lr[0];zr.preserveDrawingBuffer||(zr.preserveDrawingBuffer=!0)}else Lr.splice(0,1,{preserveDrawingBuffer:!0})}return Br.apply(this,[Nr,...Lr])}});Dr.push(Mr)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{Dr.forEach(Mr=>Mr())}}function patchGLPrototype(Tr,Cr,$r,Ar,Rr,Dr,Mr,Br){const Nr=[],Lr=Object.getOwnPropertyNames(Tr);for(const Hr of Lr)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(Hr))try{if(typeof Tr[Hr]!="function")continue;const zr=patch(Tr,Hr,function(Ur){return function(...Vr){const jr=Ur.apply(this,Vr);if(saveWebGLVar(jr,Br,this),"tagName"in this.canvas&&!isBlocked(this.canvas,Ar,Rr,Dr,!0)){const Gr=serializeArgs([...Vr],Br,this),Xr={type:Cr,property:Hr,args:Gr};$r(this.canvas,Xr)}return jr}});Nr.push(zr)}catch{const Ur=hookSetter(Tr,Hr,{set(Vr){$r(this.canvas,{type:Cr,property:Hr,args:[Vr],setter:!0})}});Nr.push(Ur)}return Nr}function initCanvasWebGLMutationObserver(Tr,Cr,$r,Ar,Rr,Dr){const Mr=[];return Mr.push(...patchGLPrototype(Cr.WebGLRenderingContext.prototype,CanvasContext.WebGL,Tr,$r,Ar,Rr,Dr,Cr)),typeof Cr.WebGL2RenderingContext<"u"&&Mr.push(...patchGLPrototype(Cr.WebGL2RenderingContext.prototype,CanvasContext.WebGL2,Tr,$r,Ar,Rr,Dr,Cr)),()=>{Mr.forEach(Br=>Br())}}function decodeBase64(Tr,Cr){var $r=atob(Tr);if(Cr){for(var Ar=new Uint8Array($r.length),Rr=0,Dr=$r.length;Rr{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(Lr)||this.pendingCanvasMutations.set(Lr,[]),this.pendingCanvasMutations.get(Lr).push(Hr)};const{sampling:$r="all",win:Ar,blockClass:Rr,blockSelector:Dr,unblockSelector:Mr,recordCanvas:Br,dataURLOptions:Nr}=Cr;this.mutationCb=Cr.mutationCb,this.mirror=Cr.mirror,Br&&$r==="all"&&this.initCanvasMutationObserver(Ar,Rr,Dr,Mr),Br&&typeof $r=="number"&&this.initCanvasFPSObserver($r,Ar,Rr,Dr,Mr,{dataURLOptions:Nr})}initCanvasFPSObserver(Cr,$r,Ar,Rr,Dr,Mr){const Br=initCanvasContextObserver($r,Ar,Rr,Dr,!0),Nr=new Map,Lr=new WorkerFactory;Lr.onmessage=Gr=>{const{id:Xr}=Gr.data;if(Nr.set(Xr,!1),!("base64"in Gr.data))return;const{base64:Kr,type:Zr,width:eo,height:Wr}=Gr.data;this.mutationCb({id:Xr,type:CanvasContext["2D"],commands:[{property:"clearRect",args:[0,0,eo,Wr]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:Kr}],type:Zr}]},0,0]}]})};const Hr=1e3/Cr;let zr=0,Ur;const Vr=()=>{const Gr=[];return $r.document.querySelectorAll("canvas").forEach(Xr=>{isBlocked(Xr,Ar,Rr,Dr,!0)||Gr.push(Xr)}),Gr},jr=Gr=>{if(zr&&Gr-zr__awaiter(this,void 0,void 0,function*(){var Kr;const Zr=this.mirror.getId(Xr);if(Nr.get(Zr))return;if(Nr.set(Zr,!0),["webgl","webgl2"].includes(Xr.__context)){const Wr=Xr.getContext(Xr.__context);((Kr=Wr==null?void 0:Wr.getContextAttributes())===null||Kr===void 0?void 0:Kr.preserveDrawingBuffer)===!1&&Wr.clear(Wr.COLOR_BUFFER_BIT)}const eo=yield createImageBitmap(Xr);Lr.postMessage({id:Zr,bitmap:eo,width:Xr.width,height:Xr.height,dataURLOptions:Mr.dataURLOptions},[eo])})),Ur=requestAnimationFrame(jr)};Ur=requestAnimationFrame(jr),this.resetObservers=()=>{Br(),cancelAnimationFrame(Ur)}}initCanvasMutationObserver(Cr,$r,Ar,Rr){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const Dr=initCanvasContextObserver(Cr,$r,Ar,Rr,!1),Mr=initCanvas2DMutationObserver(this.processMutation.bind(this),Cr,$r,Ar,Rr),Br=initCanvasWebGLMutationObserver(this.processMutation.bind(this),Cr,$r,Ar,Rr,this.mirror);this.resetObservers=()=>{Dr(),Mr(),Br()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const Cr=$r=>{this.rafStamps.latestId=$r,requestAnimationFrame(Cr)};requestAnimationFrame(Cr)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((Cr,$r)=>{const Ar=this.mirror.getId($r);this.flushPendingCanvasMutationFor($r,Ar)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(Cr,$r){if(this.frozen||this.locked)return;const Ar=this.pendingCanvasMutations.get(Cr);if(!Ar||$r===-1)return;const Rr=Ar.map(Mr=>__rest(Mr,["type"])),{type:Dr}=Ar[0];this.mutationCb({id:$r,type:Dr,commands:Rr}),this.pendingCanvasMutations.delete(Cr)}}class StylesheetManager{constructor(Cr){this.trackedLinkElements=new WeakSet,this.styleMirror=new StyleSheetMirror,this.mutationCb=Cr.mutationCb,this.adoptedStyleSheetCb=Cr.adoptedStyleSheetCb}attachLinkElement(Cr,$r){"_cssText"in $r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:$r.id,attributes:$r.attributes}]}),this.trackLinkElement(Cr)}trackLinkElement(Cr){this.trackedLinkElements.has(Cr)||(this.trackedLinkElements.add(Cr),this.trackStylesheetInLinkElement(Cr))}adoptStyleSheets(Cr,$r){if(Cr.length===0)return;const Ar={id:$r,styleIds:[]},Rr=[];for(const Dr of Cr){let Mr;this.styleMirror.has(Dr)?Mr=this.styleMirror.getId(Dr):(Mr=this.styleMirror.add(Dr),Rr.push({styleId:Mr,rules:Array.from(Dr.rules||CSSRule,(Br,Nr)=>({rule:stringifyRule(Br),index:Nr}))})),Ar.styleIds.push(Mr)}Rr.length>0&&(Ar.styles=Rr),this.adoptedStyleSheetCb(Ar)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(Cr){}}class ProcessedNodeManager{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(Cr,$r){const Ar=this.nodeMap.get(Cr);return Ar&&Array.from(Ar).some(Rr=>Rr!==$r)}add(Cr,$r){this.nodeMap.set(Cr,(this.nodeMap.get(Cr)||new Set).add($r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function wrapEvent(Tr){return Object.assign(Object.assign({},Tr),{timestamp:nowTimestamp()})}let wrappedEmit,takeFullSnapshot,canvasManager,recording=!1;const mirror=createMirror();function record(Tr={}){const{emit:Cr,checkoutEveryNms:$r,checkoutEveryNth:Ar,blockClass:Rr="rr-block",blockSelector:Dr=null,unblockSelector:Mr=null,ignoreClass:Br="rr-ignore",ignoreSelector:Nr=null,maskAllText:Lr=!1,maskTextClass:Hr="rr-mask",unmaskTextClass:zr=null,maskTextSelector:Ur=null,unmaskTextSelector:Vr=null,inlineStylesheet:jr=!0,maskAllInputs:Gr,maskInputOptions:Xr,slimDOMOptions:Kr,maskAttributeFn:Zr,maskInputFn:eo,maskTextFn:Wr,hooks:Yr,packFn:Jr,sampling:no={},dataURLOptions:ro={},mousemoveWait:so,recordCanvas:ao=!1,recordCrossOriginIframes:lo=!1,recordAfter:po=Tr.recordAfter==="DOMContentLoaded"?Tr.recordAfter:"load",userTriggeredOnInput:go=!1,collectFonts:co=!1,inlineImages:mo=!1,plugins:io,keepIframeSrcFn:uo=()=>!1,ignoreCSSAttributes:ho=new Set([]),errorHandler:yo,onMutation:So}=Tr;registerErrorHandler(yo);const ko=lo?window.parent===window:!0;let $o=!1;if(!ko)try{window.parent.document&&($o=!1)}catch{$o=!0}if(ko&&!Cr)throw new Error("emit function is required");so!==void 0&&no.mousemove===void 0&&(no.mousemove=so),mirror.reset();const Go=Gr===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:Xr!==void 0?Xr:{},No=Kr===!0||Kr==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:Kr==="all",headMetaDescKeywords:Kr==="all"}:Kr||{};polyfill();let Eo,Mo=0;const Ro=Co=>{for(const Po of io||[])Po.eventProcessor&&(Co=Po.eventProcessor(Co));return Jr&&!$o&&(Co=Jr(Co)),Co};wrappedEmit=(Co,Po)=>{var Fo;if(!((Fo=mutationBuffers[0])===null||Fo===void 0)&&Fo.isFrozen()&&Co.type!==EventType.FullSnapshot&&!(Co.type===EventType.IncrementalSnapshot&&Co.data.source===IncrementalSource.Mutation)&&mutationBuffers.forEach(Vo=>Vo.unfreeze()),ko)Cr==null||Cr(Ro(Co),Po);else if($o){const Vo={type:"rrweb",event:Ro(Co),origin:window.location.origin,isCheckout:Po};window.parent.postMessage(Vo,"*")}if(Co.type===EventType.FullSnapshot)Eo=Co,Mo=0;else if(Co.type===EventType.IncrementalSnapshot){if(Co.data.source===IncrementalSource.Mutation&&Co.data.isAttachIframe)return;Mo++;const Vo=Ar&&Mo>=Ar,Ko=$r&&Co.timestamp-Eo.timestamp>$r;(Vo||Ko)&&takeFullSnapshot(!0)}};const Ao=Co=>{wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.Mutation},Co)}))},zo=Co=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.Scroll},Co)})),Oo=Co=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.CanvasMutation},Co)})),Bo=Co=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.AdoptedStyleSheet},Co)})),bo=new StylesheetManager({mutationCb:Ao,adoptedStyleSheetCb:Bo}),vo=new IframeManager({mirror,mutationCb:Ao,stylesheetManager:bo,recordCrossOriginIframes:lo,wrappedEmit});for(const Co of io||[])Co.getMirror&&Co.getMirror({nodeMirror:mirror,crossOriginIframeMirror:vo.crossOriginIframeMirror,crossOriginIframeStyleMirror:vo.crossOriginIframeStyleMirror});const Io=new ProcessedNodeManager;canvasManager=new CanvasManager({recordCanvas:ao,mutationCb:Oo,win:window,blockClass:Rr,blockSelector:Dr,unblockSelector:Mr,mirror,sampling:no.canvas,dataURLOptions:ro});const To=new ShadowDomManager({mutationCb:Ao,scrollCb:zo,bypassOptions:{onMutation:So,blockClass:Rr,blockSelector:Dr,unblockSelector:Mr,maskAllText:Lr,maskTextClass:Hr,unmaskTextClass:zr,maskTextSelector:Ur,unmaskTextSelector:Vr,inlineStylesheet:jr,maskInputOptions:Go,dataURLOptions:ro,maskAttributeFn:Zr,maskTextFn:Wr,maskInputFn:eo,recordCanvas:ao,inlineImages:mo,sampling:no,slimDOMOptions:No,iframeManager:vo,stylesheetManager:bo,canvasManager,keepIframeSrcFn:uo,processedNodeManager:Io},mirror});takeFullSnapshot=(Co=!1)=>{wrappedEmit(wrapEvent({type:EventType.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),Co),bo.reset(),To.init(),mutationBuffers.forEach(Fo=>Fo.lock());const Po=snapshot(document,{mirror,blockClass:Rr,blockSelector:Dr,unblockSelector:Mr,maskAllText:Lr,maskTextClass:Hr,unmaskTextClass:zr,maskTextSelector:Ur,unmaskTextSelector:Vr,inlineStylesheet:jr,maskAllInputs:Go,maskAttributeFn:Zr,maskInputFn:eo,maskTextFn:Wr,slimDOM:No,dataURLOptions:ro,recordCanvas:ao,inlineImages:mo,onSerialize:Fo=>{isSerializedIframe(Fo,mirror)&&vo.addIframe(Fo),isSerializedStylesheet(Fo,mirror)&&bo.trackLinkElement(Fo),hasShadowRoot(Fo)&&To.addShadowRoot(Fo.shadowRoot,document)},onIframeLoad:(Fo,Vo)=>{vo.attachIframe(Fo,Vo),To.observeAttachShadow(Fo)},onStylesheetLoad:(Fo,Vo)=>{bo.attachLinkElement(Fo,Vo)},keepIframeSrcFn:uo});if(!Po)return console.warn("Failed to snapshot the document");wrappedEmit(wrapEvent({type:EventType.FullSnapshot,data:{node:Po,initialOffset:getWindowScroll(window)}}),Co),mutationBuffers.forEach(Fo=>Fo.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&bo.adoptStyleSheets(document.adoptedStyleSheets,mirror.getId(document))};try{const Co=[],Po=Vo=>{var Ko;return callbackWrapper(initObservers)({onMutation:So,mutationCb:Ao,mousemoveCb:(Uo,ei)=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:{source:ei,positions:Uo}})),mouseInteractionCb:Uo=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.MouseInteraction},Uo)})),scrollCb:zo,viewportResizeCb:Uo=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.ViewportResize},Uo)})),inputCb:Uo=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.Input},Uo)})),mediaInteractionCb:Uo=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.MediaInteraction},Uo)})),styleSheetRuleCb:Uo=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.StyleSheetRule},Uo)})),styleDeclarationCb:Uo=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.StyleDeclaration},Uo)})),canvasMutationCb:Oo,fontCb:Uo=>wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.Font},Uo)})),selectionCb:Uo=>{wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.Selection},Uo)}))},customElementCb:Uo=>{wrappedEmit(wrapEvent({type:EventType.IncrementalSnapshot,data:Object.assign({source:IncrementalSource.CustomElement},Uo)}))},blockClass:Rr,ignoreClass:Br,ignoreSelector:Nr,maskAllText:Lr,maskTextClass:Hr,unmaskTextClass:zr,maskTextSelector:Ur,unmaskTextSelector:Vr,maskInputOptions:Go,inlineStylesheet:jr,sampling:no,recordCanvas:ao,inlineImages:mo,userTriggeredOnInput:go,collectFonts:co,doc:Vo,maskAttributeFn:Zr,maskInputFn:eo,maskTextFn:Wr,keepIframeSrcFn:uo,blockSelector:Dr,unblockSelector:Mr,slimDOMOptions:No,dataURLOptions:ro,mirror,iframeManager:vo,stylesheetManager:bo,shadowDomManager:To,processedNodeManager:Io,canvasManager,ignoreCSSAttributes:ho,plugins:((Ko=io==null?void 0:io.filter(Uo=>Uo.observer))===null||Ko===void 0?void 0:Ko.map(Uo=>({observer:Uo.observer,options:Uo.options,callback:ei=>wrappedEmit(wrapEvent({type:EventType.Plugin,data:{plugin:Uo.name,payload:ei}}))})))||[]},Yr)};vo.addLoadListener(Vo=>{try{Co.push(Po(Vo.contentDocument))}catch(Ko){console.warn(Ko)}});const Fo=()=>{takeFullSnapshot(),Co.push(Po(document)),recording=!0};return document.readyState==="interactive"||document.readyState==="complete"?Fo():(Co.push(on("DOMContentLoaded",()=>{wrappedEmit(wrapEvent({type:EventType.DomContentLoaded,data:{}})),po==="DOMContentLoaded"&&Fo()})),Co.push(on("load",()=>{wrappedEmit(wrapEvent({type:EventType.Load,data:{}})),po==="load"&&Fo()},window))),()=>{Co.forEach(Vo=>Vo()),Io.destroy(),recording=!1,unregisterErrorHandler()}}catch(Co){console.warn(Co)}}record.addCustomEvent=(Tr,Cr)=>{if(!recording)throw new Error("please add custom event after start recording");wrappedEmit(wrapEvent({type:EventType.Custom,data:{tag:Tr,payload:Cr}}))};record.freezePage=()=>{mutationBuffers.forEach(Tr=>Tr.freeze())};record.takeFullSnapshot=Tr=>{if(!recording)throw new Error("please take full snapshot after start recording");takeFullSnapshot(Tr)};record.mirror=mirror;function timestampToMs(Tr){return Tr>9999999999?Tr:Tr*1e3}function timestampToS(Tr){return Tr>9999999999?Tr/1e3:Tr}function addBreadcrumbEvent(Tr,Cr){Cr.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(Cr.category)?Tr.triggerUserActivity():Tr.checkAndHandleExpiredSession(),Tr.addUpdate(()=>(Tr.throttledAddEvent({type:EventType.Custom,timestamp:(Cr.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:normalize$3(Cr,10,1e3)}}),Cr.category==="console")))}const INTERACTIVE_SELECTOR="button,a";function getClickTargetNode(Tr){const Cr=getTargetNode(Tr);return!Cr||!(Cr instanceof Element)?Cr:Cr.closest(INTERACTIVE_SELECTOR)||Cr}function getTargetNode(Tr){return isEventWithTarget(Tr)?Tr.target:Tr}function isEventWithTarget(Tr){return typeof Tr=="object"&&!!Tr&&"target"in Tr}let handlers$1;function onWindowOpen(Tr){return handlers$1||(handlers$1=[],monkeyPatchWindowOpen()),handlers$1.push(Tr),()=>{const Cr=handlers$1?handlers$1.indexOf(Tr):-1;Cr>-1&&handlers$1.splice(Cr,1)}}function monkeyPatchWindowOpen(){fill(WINDOW$1,"open",function(Tr){return function(...Cr){if(handlers$1)try{handlers$1.forEach($r=>$r())}catch{}return Tr.apply(WINDOW$1,Cr)}})}function handleClick$1(Tr,Cr,$r){Tr.handleClick(Cr,$r)}class ClickDetector{constructor(Cr,$r,Ar=addBreadcrumbEvent){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=$r.timeout/1e3,this._threshold=$r.threshold/1e3,this._scollTimeout=$r.scrollTimeout/1e3,this._replay=Cr,this._ignoreSelector=$r.ignoreSelector,this._addBreadcrumbEvent=Ar}addListeners(){const Cr=()=>{this._lastMutation=nowInSeconds()},$r=()=>{this._lastScroll=nowInSeconds()},Ar=onWindowOpen(()=>{this._lastMutation=nowInSeconds()}),Rr=Mr=>{if(!Mr.target)return;const Br=getClickTargetNode(Mr);Br&&this._handleMultiClick(Br)},Dr=new MutationObserver(Cr);Dr.observe(WINDOW$1.document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),WINDOW$1.addEventListener("scroll",$r,{passive:!0}),WINDOW$1.addEventListener("click",Rr,{passive:!0}),this._teardown=()=>{WINDOW$1.removeEventListener("scroll",$r),WINDOW$1.removeEventListener("click",Rr),Ar(),Dr.disconnect(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(Cr,$r){if(ignoreElement($r,this._ignoreSelector)||!isClickBreadcrumb(Cr))return;const Ar={timestamp:timestampToS(Cr.timestamp),clickBreadcrumb:Cr,clickCount:0,node:$r};this._clicks.some(Rr=>Rr.node===Ar.node&&Math.abs(Rr.timestamp-Ar.timestamp)<1)||(this._clicks.push(Ar),this._clicks.length===1&&this._scheduleCheckClicks())}_handleMultiClick(Cr){this._getClicks(Cr).forEach($r=>{$r.clickCount++})}_getClicks(Cr){return this._clicks.filter($r=>$r.node===Cr)}_checkClicks(){const Cr=[],$r=nowInSeconds();this._clicks.forEach(Ar=>{!Ar.mutationAfter&&this._lastMutation&&(Ar.mutationAfter=Ar.timestamp<=this._lastMutation?this._lastMutation-Ar.timestamp:void 0),!Ar.scrollAfter&&this._lastScroll&&(Ar.scrollAfter=Ar.timestamp<=this._lastScroll?this._lastScroll-Ar.timestamp:void 0),Ar.timestamp+this._timeout<=$r&&Cr.push(Ar)});for(const Ar of Cr){const Rr=this._clicks.indexOf(Ar);Rr>-1&&(this._generateBreadcrumbs(Ar),this._clicks.splice(Rr,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(Cr){const $r=this._replay,Ar=Cr.scrollAfter&&Cr.scrollAfter<=this._scollTimeout,Rr=Cr.mutationAfter&&Cr.mutationAfter<=this._threshold,Dr=!Ar&&!Rr,{clickCount:Mr,clickBreadcrumb:Br}=Cr;if(Dr){const Nr=Math.min(Cr.mutationAfter||this._timeout,this._timeout)*1e3,Lr=Nr1){const Nr={type:"default",message:Br.message,timestamp:Br.timestamp,category:"ui.multiClick",data:{...Br.data,url:WINDOW$1.location.href,route:$r.getCurrentRoute(),clickCount:Mr,metric:!0}};this._addBreadcrumbEvent($r,Nr)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout(()=>this._checkClicks(),1e3)}}const SLOW_CLICK_TAGS=["A","BUTTON","INPUT"];function ignoreElement(Tr,Cr){return!!(!SLOW_CLICK_TAGS.includes(Tr.tagName)||Tr.tagName==="INPUT"&&!["submit","button"].includes(Tr.getAttribute("type")||"")||Tr.tagName==="A"&&(Tr.hasAttribute("download")||Tr.hasAttribute("target")&&Tr.getAttribute("target")!=="_self")||Cr&&Tr.matches(Cr))}function isClickBreadcrumb(Tr){return!!(Tr.data&&typeof Tr.data.nodeId=="number"&&Tr.timestamp)}function nowInSeconds(){return Date.now()/1e3}function createBreadcrumb(Tr){return{timestamp:Date.now()/1e3,type:"default",...Tr}}var NodeType$2;(function(Tr){Tr[Tr.Document=0]="Document",Tr[Tr.DocumentType=1]="DocumentType",Tr[Tr.Element=2]="Element",Tr[Tr.Text=3]="Text",Tr[Tr.CDATA=4]="CDATA",Tr[Tr.Comment=5]="Comment"})(NodeType$2||(NodeType$2={}));const ATTRIBUTES_TO_RECORD=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled"]);function getAttributesToRecord(Tr){const Cr={};for(const $r in Tr)if(ATTRIBUTES_TO_RECORD.has($r)){let Ar=$r;($r==="data-testid"||$r==="data-test-id")&&(Ar="testId"),Cr[Ar]=Tr[$r]}return Cr}const handleDomListener=Tr=>Cr=>{if(!Tr.isEnabled())return;const $r=handleDom(Cr);if(!$r)return;const Ar=Cr.name==="click",Rr=Ar&&Cr.event;Ar&&Tr.clickDetector&&Rr&&!Rr.altKey&&!Rr.metaKey&&!Rr.ctrlKey&&!Rr.shiftKey&&handleClick$1(Tr.clickDetector,$r,getClickTargetNode(Cr.event)),addBreadcrumbEvent(Tr,$r)};function getBaseDomBreadcrumb(Tr,Cr){const $r=record.mirror.getId(Tr),Ar=$r&&record.mirror.getNode($r),Rr=Ar&&record.mirror.getMeta(Ar),Dr=Rr&&isElement(Rr)?Rr:null;return{message:Cr,data:Dr?{nodeId:$r,node:{id:$r,tagName:Dr.tagName,textContent:Array.from(Dr.childNodes).map(Mr=>Mr.type===NodeType$2.Text&&Mr.textContent).filter(Boolean).map(Mr=>Mr.trim()).join(""),attributes:getAttributesToRecord(Dr.attributes)}}:{}}}function handleDom(Tr){const{target:Cr,message:$r}=getDomTarget(Tr);return createBreadcrumb({category:`ui.${Tr.name}`,...getBaseDomBreadcrumb(Cr,$r)})}function getDomTarget(Tr){const Cr=Tr.name==="click";let $r,Ar=null;try{Ar=Cr?getClickTargetNode(Tr.event):getTargetNode(Tr.event),$r=htmlTreeAsString(Ar,{maxStringLength:200})||""}catch{$r=""}return{target:Ar,message:$r}}function isElement(Tr){return Tr.type===NodeType$2.Element}function handleKeyboardEvent(Tr,Cr){if(!Tr.isEnabled())return;Tr.updateUserActivity();const $r=getKeyboardBreadcrumb(Cr);$r&&addBreadcrumbEvent(Tr,$r)}function getKeyboardBreadcrumb(Tr){const{metaKey:Cr,shiftKey:$r,ctrlKey:Ar,altKey:Rr,key:Dr,target:Mr}=Tr;if(!Mr||isInputElement(Mr)||!Dr)return null;const Br=Cr||Ar||Rr,Nr=Dr.length===1;if(!Br&&Nr)return null;const Lr=htmlTreeAsString(Mr,{maxStringLength:200})||"",Hr=getBaseDomBreadcrumb(Mr,Lr);return createBreadcrumb({category:"ui.keyDown",message:Lr,data:{...Hr.data,metaKey:Cr,shiftKey:$r,ctrlKey:Ar,altKey:Rr,key:Dr}})}function isInputElement(Tr){return Tr.tagName==="INPUT"||Tr.tagName==="TEXTAREA"||Tr.isContentEditable}const NAVIGATION_ENTRY_KEYS=["name","type","startTime","transferSize","duration"];function isNavigationEntryEqual(Tr){return function(Cr){return NAVIGATION_ENTRY_KEYS.every($r=>Tr[$r]===Cr[$r])}}function dedupePerformanceEntries(Tr,Cr){const[$r,Ar,Rr]=Tr.reduce((Nr,Lr)=>(Lr.entryType==="navigation"?Nr[0].push(Lr):Lr.entryType==="largest-contentful-paint"?Nr[1].push(Lr):Nr[2].push(Lr),Nr),[[],[],[]]),Dr=[],Mr=[];let Br=Ar.length?Ar[Ar.length-1]:void 0;return Cr.forEach(Nr=>{if(Nr.entryType==="largest-contentful-paint"){(!Br||Br.startTime0&&!$r.find(isNavigationEntryEqual(Lr))&&!Mr.find(isNavigationEntryEqual(Lr))&&Mr.push(Lr);return}Dr.push(Nr)}),[...Br?[Br]:[],...$r,...Rr,...Dr,...Mr].sort((Nr,Lr)=>Nr.startTime-Lr.startTime)}function setupPerformanceObserver(Tr){const Cr=Ar=>{const Rr=dedupePerformanceEntries(Tr.performanceEvents,Ar.getEntries());Tr.performanceEvents=Rr},$r=new PerformanceObserver(Cr);return["element","event","first-input","largest-contentful-paint","layout-shift","longtask","navigation","paint","resource"].forEach(Ar=>{try{$r.observe({type:Ar,buffered:!0})}catch{}}),$r}const r$3=`/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */ function t(t){let e=t.length;for(;--e>=0;)t[e]=0}const e=new Uint8Array([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]),a=new Uint8Array([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]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);const r=new Array(60);t(r);const o=new Array(512);t(o);const l=new Array(256);t(l);const h=new Array(29);t(h);const d=new Array(30);function _(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let f,c,u;function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);const m=t=>t<256?o[t]:o[256+(t>>>7)],b=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},g=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{g(t,a[2*e],a[2*e+1])},k=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},v=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=k(i[e]++,e))}},y=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},x=t=>{t.bi_valid>8?b(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},z=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let s,r,o,_,f=0;if(0!==t.sym_next)do{s=255&t.pending_buf[t.sym_buf+f++],s+=(255&t.pending_buf[t.sym_buf+f++])<<8,r=t.pending_buf[t.sym_buf+f++],0===s?p(t,r,i):(o=l[r],p(t,o+256+1,i),_=e[o],0!==_&&(r-=h[o],g(t,r,_)),s--,o=m(s),p(t,o,n),_=a[o],0!==_&&(s-=d[o],g(t,s,_)))}while(f{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r>1;r>=1;r--)A(t,a,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=o,a[2*l]=a[2*r]+a[2*o],t.depth[l]=(t.depth[r]>=t.depth[o]?t.depth[r]:t.depth[o])+1,a[2*r+1]=a[2*o+1]=l,t.heap[1]=l++,A(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,_,f,c,u,w=0;for(f=0;f<=15;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],f=a[2*a[2*d+1]+1]+1,f>l&&(f=l,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=o&&(c=r[d-o]),u=a[2*d],t.opt_len+=u*(f+c),s&&(t.static_len+=u*(n[2*d+1]+c)));if(0!==w){do{for(f=l-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(f=l;0!==f;f--)for(d=t.bl_count[f];0!==d;)_=t.heap[--h],_>i||(a[2*_+1]!==f&&(t.opt_len+=(f-a[2*_+1])*a[2*_],a[2*_+1]=f),d--)}})(t,e),v(a,h,t.bl_count)},Z=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++o{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++o{g(t,0+(i?1:0),3),x(t),b(t,a),b(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var T=(t,e,a,i)=>{let o,l,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),R(t,t.l_desc),R(t,t.d_desc),h=(t=>{let e;for(Z(t,t.dyn_ltree,t.l_desc.max_code),Z(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,l=t.static_len+3+7>>>3,l<=o&&(o=l)):o=l=a+5,a+4<=o&&-1!==e?D(t,e,a,i):4===t.strategy||l===o?(g(t,2+(i?1:0),3),E(t,s,r)):(g(t,4+(i?1:0),3),((t,e,a,i)=>{let s;for(g(t,e-257,5),g(t,a-1,5),g(t,i-4,4),s=0;s{S||((()=>{let t,n,w,m,b;const g=new Array(16);for(w=0,m=0;m<28;m++)for(h[m]=w,t=0;t<1<>=7;m<30;m++)for(d[m]=b<<7,t=0;t<1<(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(l[a]+256+1)]++,t.dyn_dtree[2*m(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{g(t,2,3),p(t,256,s),(t=>{16===t.bi_valid?(b(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var F=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const L=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var N=(t,e,a,i)=>{const n=L,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return-1^t},I={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},B={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:C,_tr_stored_block:H,_tr_flush_block:M,_tr_tally:j,_tr_align:K}=O,{Z_NO_FLUSH:P,Z_PARTIAL_FLUSH:Y,Z_FULL_FLUSH:G,Z_FINISH:X,Z_BLOCK:W,Z_OK:q,Z_STREAM_END:J,Z_STREAM_ERROR:Q,Z_DATA_ERROR:V,Z_BUF_ERROR:$,Z_DEFAULT_COMPRESSION:tt,Z_FILTERED:et,Z_HUFFMAN_ONLY:at,Z_RLE:it,Z_FIXED:nt,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:rt,Z_DEFLATED:ot}=B,lt=(t,e)=>(t.msg=I[e],e),ht=t=>2*t-(t>4?9:0),dt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},_t=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let ft=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},ut=(t,e)=>{M(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ct(t.strm)},wt=(t,e)=>{t.pending_buf[t.pending++]=e},mt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=F(t.adler,e,n,a):2===t.state.wrap&&(t.adler=N(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},gt=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+258;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=o)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>l&&0!=--n);return r<=t.lookahead?r:t.lookahead},pt=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),_t(t),i+=e),0===t.strm.avail_in)break;if(a=bt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ft(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ft(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,ct(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(bt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_watern&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(bt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===X)&&e!==P&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===X&&0===t.strm.avail_in&&a===i?1:0,H(t,t.block_start,a,r),t.block_start+=a,ct(t.strm)),r?3:1)},vt=(t,e)=>{let a,i;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a)),t.match_length>=3)if(i=j(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ft(t,t.ins_h,t.window[t.strstart+1]);else i=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2},yt=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=j(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(ut(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=j(t,0,t.window[t.strstart-1]),i&&ut(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=j(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2};function xt(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const zt=[new xt(0,0,0,0,kt),new xt(4,4,8,4,vt),new xt(4,5,16,8,vt),new xt(4,6,32,32,vt),new xt(4,4,16,16,yt),new xt(8,16,32,32,yt),new xt(8,16,128,128,yt),new xt(8,32,128,256,yt),new xt(32,128,258,1024,yt),new xt(32,258,258,4096,yt)];function At(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),dt(this.dyn_ltree),dt(this.dyn_dtree),dt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),dt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),dt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Et=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Rt=t=>{if(Et(t))return lt(t,Q);t.total_in=t.total_out=0,t.data_type=rt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,C(e),q},Zt=t=>{const e=Rt(t);var a;return e===q&&((a=t.state).window_size=2*a.w_size,dt(a.head),a.max_lazy_match=zt[a.level].max_lazy,a.good_match=zt[a.level].good_length,a.nice_match=zt[a.level].nice_length,a.max_chain_length=zt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ut=(t,e,a,i,n,s)=>{if(!t)return Q;let r=1;if(e===tt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==ot||i<8||i>15||e<0||e>9||s<0||s>nt||8===i&&1!==r)return lt(t,Q);8===i&&(i=9);const o=new At;return t.state=o,o.strm=t,o.status=42,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<Ut(t,e,ot,15,8,st),deflateInit2:Ut,deflateReset:Zt,deflateResetKeep:Rt,deflateSetHeader:(t,e)=>Et(t)||2!==t.state.wrap?Q:(t.state.gzhead=e,q),deflate:(t,e)=>{if(Et(t)||e>W||e<0)return t?lt(t,Q):Q;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===a.status&&e!==X)return lt(t,0===t.avail_out?$:Q);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(ct(t),0===t.avail_out)return a.last_flush=-1,q}else if(0===t.avail_in&&ht(e)<=ht(i)&&e!==X)return lt(t,$);if(666===a.status&&0!==t.avail_in)return lt(t,$);if(42===a.status&&0===a.wrap&&(a.status=113),42===a.status){let e=ot+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=at||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,mt(a,e),0!==a.strstart&&(mt(a,t.adler>>>16),mt(a,65535&t.adler)),t.adler=1,a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(57===a.status)if(t.adler=0,wt(a,31),wt(a,139),wt(a,8),a.gzhead)wt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),wt(a,255&a.gzhead.time),wt(a,a.gzhead.time>>8&255),wt(a,a.gzhead.time>>16&255),wt(a,a.gzhead.time>>24&255),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(wt(a,255&a.gzhead.extra.length),wt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=N(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,3),a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,ct(t),0!==a.pending)return a.last_flush=-1,q;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindexi&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindexi&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(ct(t),0!==a.pending))return a.last_flush=-1,q;wt(a,255&t.adler),wt(a,t.adler>>8&255),t.adler=0}if(a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(0!==t.avail_in||0!==a.lookahead||e!==P&&666!==a.status){let i=0===a.level?kt(a,e):a.strategy===at?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(pt(t),0===t.lookahead)){if(e===P)return 1;break}if(t.match_length=0,a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===it?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=258){if(pt(t),t.lookahead<=258&&e===P)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+258;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=j(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):zt[a.level].func(a,e);if(3!==i&&4!==i||(a.status=666),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),q;if(2===i&&(e===Y?K(a):e!==W&&(H(a,0,0,!1),e===G&&(dt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ct(t),0===t.avail_out))return a.last_flush=-1,q}return e!==X?q:a.wrap<=0?J:(2===a.wrap?(wt(a,255&t.adler),wt(a,t.adler>>8&255),wt(a,t.adler>>16&255),wt(a,t.adler>>24&255),wt(a,255&t.total_in),wt(a,t.total_in>>8&255),wt(a,t.total_in>>16&255),wt(a,t.total_in>>24&255)):(mt(a,t.adler>>>16),mt(a,65535&t.adler)),ct(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?q:J)},deflateEnd:t=>{if(Et(t))return Q;const e=t.state.status;return t.state=null,113===e?lt(t,V):q},deflateSetDictionary:(t,e)=>{let a=e.length;if(Et(t))return Q;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return Q;if(1===n&&(t.adler=F(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(dt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,pt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=ft(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,pt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,i.wrap=n,q},deflateInfo:"pako deflate (from Nodeca project)"};const Dt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Tt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Dt(a,e)&&(t[e]=a[e])}}return t},Ot=t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Lt[254]=Lt[254]=1;var Nt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,o=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},It=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Ft)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Lt[t[a]]>e?a:e};var Ct=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ht=Object.prototype.toString,{Z_NO_FLUSH:Mt,Z_SYNC_FLUSH:jt,Z_FULL_FLUSH:Kt,Z_FINISH:Pt,Z_OK:Yt,Z_STREAM_END:Gt,Z_DEFAULT_COMPRESSION:Xt,Z_DEFAULT_STRATEGY:Wt,Z_DEFLATED:qt}=B;function Jt(t){this.options=Tt({level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=St.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Yt)throw new Error(I[a]);if(e.header&&St.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Nt(e.dictionary):"[object ArrayBuffer]"===Ht.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=St.deflateSetDictionary(this.strm,t),a!==Yt)throw new Error(I[a]);this._dict_set=!0}}function Qt(t,e){const a=new Jt(e);if(a.push(t,!0),a.err)throw a.msg||I[a.err];return a.result}Jt.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Pt:Mt,"string"==typeof t?a.input=Nt(t):"[object ArrayBuffer]"===Ht.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===jt||s===Kt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=St.deflate(a,s),n===Gt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=St.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Yt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===Yt&&(this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Vt={Deflate:Jt,deflate:Qt,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Qt(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Qt(t,e)},constants:B};var $t=function(t,e){let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,m=(1<>>24,f>>>=p,c-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=u[(65535&g)+(f&(1<>>=p,c-=p),c<15&&(f+=z[a++]<>>24,f>>>=p,c-=p,p=g>>>16&255,!(16&p)){if(0==(64&p)){g=w[(65535&g)+(f&(1<o){t.msg="invalid distance too far back",E.mode=16209;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg="invalid distance too far back",E.mode=16209;break t}if(y=0,x=_,0===d){if(y+=l-p,p2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,a-=k,c-=k<<3,f&=(1<{const l=o.bits;let h,d,_,f,c,u,w=0,m=0,b=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=15;w++)E[w]=0;for(m=0;m=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(b=1;b0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+E[w];for(m=0;m852||2===t&&x>592)return 1;for(;;){Z=w-v,r[m]+1=u?(U=D[r[m]-u],S=A[r[m]-u]):(U=96,S=0),h=1<>v)+d]=Z<<24|U<<16|S|0}while(0!==d);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,m++,0==--E[w]){if(w===g)break;w=e[a+r[m]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=b,k=w-v,y=1<852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),o.bits=p,0};const{Z_FINISH:se,Z_BLOCK:re,Z_TREES:oe,Z_OK:le,Z_STREAM_END:he,Z_NEED_DICT:de,Z_STREAM_ERROR:_e,Z_DATA_ERROR:fe,Z_MEM_ERROR:ce,Z_BUF_ERROR:ue,Z_DEFLATED:we}=B,me=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ge(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const pe=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},ke=t=>{if(pe(t))return _e;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,le},ve=t=>{if(pe(t))return _e;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ke(t)},ye=(t,e)=>{let a;if(pe(t))return _e;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_e:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,ve(t))},xe=(t,e)=>{if(!t)return _e;const a=new ge;t.state=a,a.strm=t,a.window=null,a.mode=16180;const i=ye(t,e);return i!==le&&(t.state=null),i};let ze,Ae,Ee=!0;const Re=t=>{if(Ee){ze=new Int32Array(512),Ae=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ne(1,t.lens,0,288,ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ne(2,t.lens,0,32,Ae,0,t.work,{bits:5}),Ee=!1}t.lencode=ze,t.lenbits=9,t.distcode=Ae,t.distbits=5},Ze=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whavexe(t,15),inflateInit2:xe,inflate:(t,e)=>{let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pe(t)||!t.output||!t.input&&0!==t.avail_in)return _e;a=t.state,16191===a.mode&&(a.mode=16192),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=le;t:for(;;)switch(a.mode){case 16180:if(0===a.wrap){a.mode=16192;break}for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>>8&255,a.check=N(a.check,A,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=me;break}if((15&h)!==we){t.msg="unknown compression method",a.mode=me;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=me;break}a.dmax=1<>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=N(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(c=a.length,c>o&&(c=o),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=16191;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<>>=7&d,d-=7&d,a.mode=16206;break}for(;d<3;){if(0===o)break t;o--,h+=i[s++]<>>=1,d-=1,3&h){case 0:a.mode=16193;break;case 1:if(Re(a),a.mode=16199,e===oe){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=me}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=me;break}if(a.length=65535&h,h=0,d=0,a.mode=16194,e===oe)break t;case 16194:a.mode=16195;case 16195:if(c=a.length,c){if(c>o&&(c=o),c>l&&(c=l),0===c)break t;n.set(i.subarray(s,s+c),r),o-=c,s+=c,l-=c,r+=c,a.length-=c;break}a.mode=16191;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=i[s++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=me;break}a.have=0,a.mode=16197;case 16197:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=ne(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=me;break}a.have=0,a.mode=16198;case 16198:for(;a.have>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;d>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=me;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=m+3;d>>=m,d-=m,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=m+7;d>>=m,d-=m,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=me;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===me)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=me;break}if(a.lenbits=9,E={bits:a.lenbits},x=ne(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=me;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=ne(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=me;break}if(a.mode=16199,e===oe)break t;case 16199:a.mode=16200;case 16200:if(o>=6&&l>=258){t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,$t(t,f),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,16191===a.mode&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=16191;break}if(64&b){t.msg="invalid literal/length code",a.mode=me;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=me;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=me;break}a.mode=16204;case 16204:if(0===l)break t;if(c=f-l,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=me;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>l&&(c=l),l-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=16200);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=16200;break;case 16206:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[s++]<{if(pe(t))return _e;let e=t.state;return e.window&&(e.window=null),t.state=null,le},inflateGetHeader:(t,e)=>{if(pe(t))return _e;const a=t.state;return 0==(2&a.wrap)?_e:(a.head=e,e.done=!1,le)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return pe(t)?_e:(i=t.state,0!==i.wrap&&16190!==i.mode?_e:16190===i.mode&&(n=1,n=F(n,e,a,0),n!==i.check)?fe:(s=Ze(t,e,a,a),s?(i.mode=16210,ce):(i.havedict=1,le)))},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const De=Object.prototype.toString,{Z_NO_FLUSH:Te,Z_FINISH:Oe,Z_OK:Fe,Z_STREAM_END:Le,Z_NEED_DICT:Ne,Z_STREAM_ERROR:Ie,Z_DATA_ERROR:Be,Z_MEM_ERROR:Ce}=B;function He(t){this.options=Tt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=Ue.inflateInit2(this.strm,e.windowBits);if(a!==Fe)throw new Error(I[a]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Nt(e.dictionary):"[object ArrayBuffer]"===De.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ue.inflateSetDictionary(this.strm,e.dictionary),a!==Fe)))throw new Error(I[a])}He.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Oe:Te,"[object ArrayBuffer]"===De.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Ue.inflate(a,r),s===Ne&&n&&(s=Ue.inflateSetDictionary(a,n),s===Fe?s=Ue.inflate(a,r):s===Be&&(s=Ne));a.avail_in>0&&s===Le&&a.state.wrap>0&&0!==t[a.next_in];)Ue.inflateReset(a),s=Ue.inflate(a,r);switch(s){case Ie:case Be:case Ne:case Ce:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===Le))if("string"===this.options.to){let t=Bt(a.output,a.next_out),e=a.next_out-t,n=It(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Fe||0!==o){if(s===Le)return s=Ue.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},He.prototype.onData=function(t){this.chunks.push(t)},He.prototype.onEnd=function(t){t===Fe&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const{Deflate:Me,deflate:je,deflateRaw:Ke,gzip:Pe}=Vt;var Ye=Me,Ge=je,Xe=B;const We=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const e=this._hasEvents?",":"";this.deflate.push(e+t,Xe.Z_SYNC_FLUSH),this._hasEvents=!0}finish(){if(this.deflate.push("]",Xe.Z_FINISH),this.deflate.err)throw this.deflate.err;const t=this.deflate.result;return this._init(),t}_init(){this._hasEvents=!1,this.deflate=new Ye,this.deflate.push("[",Xe.Z_NO_FLUSH)}},qe={clear:()=>{We.clear()},addEvent:t=>We.addEvent(t),finish:()=>We.finish(),compress:t=>function(t){return Ge(t)}(t)};addEventListener("message",(function(t){const e=t.data.method,a=t.data.id,i=t.data.arg;if(e in qe&&"function"==typeof qe[e])try{const t=qe[e](i);postMessage({id:a,method:e,success:!0,response:t})}catch(t){postMessage({id:a,method:e,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});`;function e$3(){const Tr=new Blob([r$3]);return URL.createObjectURL(Tr)}function logInfo(Tr,Cr){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(logger.info(Tr),Cr&&addBreadcrumb(Tr))}function logInfoNextTick(Tr,Cr){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(logger.info(Tr),Cr&&setTimeout(()=>{addBreadcrumb(Tr)},0))}function addBreadcrumb(Tr){getCurrentHub().addBreadcrumb({category:"console",data:{logger:"replay"},level:"info",message:Tr},{level:"info"})}class EventBufferSizeExceededError extends Error{constructor(){super(`Event buffer exceeded maximum size of ${REPLAY_MAX_EVENT_BUFFER_SIZE}.`)}}class EventBufferArray{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(Cr){const $r=JSON.stringify(Cr).length;if(this._totalSize+=$r,this._totalSize>REPLAY_MAX_EVENT_BUFFER_SIZE)throw new EventBufferSizeExceededError;this.events.push(Cr)}finish(){return new Promise(Cr=>{const $r=this.events;this.clear(),Cr(JSON.stringify($r))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const Cr=this.events.map($r=>$r.timestamp).sort()[0];return Cr?timestampToMs(Cr):null}}class WorkerHandler{constructor(Cr){this._worker=Cr,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((Cr,$r)=>{this._worker.addEventListener("message",({data:Ar})=>{Ar.success?Cr():$r()},{once:!0}),this._worker.addEventListener("error",Ar=>{$r(Ar)},{once:!0})}),this._ensureReadyPromise)}destroy(){logInfo("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(Cr,$r){const Ar=this._getAndIncrementId();return new Promise((Rr,Dr)=>{const Mr=({data:Br})=>{const Nr=Br;if(Nr.method===Cr&&Nr.id===Ar){if(this._worker.removeEventListener("message",Mr),!Nr.success){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error("[Replay]",Nr.response),Dr(new Error("Error in compression worker"));return}Rr(Nr.response)}};this._worker.addEventListener("message",Mr),this._worker.postMessage({id:Ar,method:Cr,arg:$r})})}_getAndIncrementId(){return this._id++}}class EventBufferCompressionWorker{constructor(Cr){this._worker=new WorkerHandler(Cr),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(Cr){const $r=timestampToMs(Cr.timestamp);(!this._earliestTimestamp||$rREPLAY_MAX_EVENT_BUFFER_SIZE?Promise.reject(new EventBufferSizeExceededError):this._sendEventToWorker(Ar)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear")}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(Cr){return this._worker.postMessage("addEvent",Cr)}async _finishRequest(){const Cr=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,Cr}}class EventBufferProxy{constructor(Cr){this._fallback=new EventBufferArray,this._compression=new EventBufferCompressionWorker(Cr),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(Cr){this._used.hasCheckout=Cr}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(Cr){return this._used.addEvent(Cr)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch{logInfo("[Replay] Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:Cr,hasCheckout:$r}=this._fallback,Ar=[];for(const Rr of Cr)Ar.push(this._compression.addEvent(Rr));this._compression.hasCheckout=$r,this._used=this._compression;try{await Promise.all(Ar)}catch(Rr){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("[Replay] Failed to add events when switching buffers.",Rr)}}}function createEventBuffer({useCompression:Tr}){if(Tr&&window.Worker)try{const Cr=e$3();logInfo("[Replay] Using compression worker");const $r=new Worker(Cr);return new EventBufferProxy($r)}catch{logInfo("[Replay] Failed to create compression worker")}return logInfo("[Replay] Using simple buffer"),new EventBufferArray}function hasSessionStorage(){try{return"sessionStorage"in WINDOW$1&&!!WINDOW$1.sessionStorage}catch{return!1}}function clearSession(Tr){deleteSession(),Tr.session=void 0}function deleteSession(){if(hasSessionStorage())try{WINDOW$1.sessionStorage.removeItem(REPLAY_SESSION_KEY)}catch{}}function isSampled(Tr){return Tr===void 0?!1:Math.random()"u"||__SENTRY_DEBUG__)&&logger.error(Ar),await Tr.stop({reason:Rr});const Dr=getCurrentHub().getClient();Dr&&Dr.recordDroppedEvent("internal_sdk_error","replay")}}function shouldAddEvent(Tr,Cr){if(!Tr.eventBuffer||Tr.isPaused()||!Tr.isEnabled())return!1;const $r=timestampToMs(Cr.timestamp);return $r+Tr.timeouts.sessionIdlePauseTr.getContext().initialTimestamp+Tr.getOptions().maxReplayDuration?(logInfo(`[Replay] Skipping event with timestamp ${$r} because it is after maxReplayDuration`,Tr.getOptions()._experiments.traceInternals),!1):!0}function maybeApplyCallback(Tr,Cr){try{if(typeof Cr=="function"&&isCustomEvent(Tr))return Cr(Tr)}catch($r){return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",$r),null}return Tr}function isErrorEvent(Tr){return!Tr.type}function isTransactionEvent(Tr){return Tr.type==="transaction"}function isReplayEvent(Tr){return Tr.type==="replay_event"}function handleAfterSendEvent(Tr){const Cr=isBaseTransportSend();return($r,Ar)=>{if(!Tr.isEnabled()||!isErrorEvent($r)&&!isTransactionEvent($r))return;const Rr=Ar&&Ar.statusCode;if(!(Cr&&(!Rr||Rr<200||Rr>=300))){if(isTransactionEvent($r)){handleTransactionEvent(Tr,$r);return}handleErrorEvent(Tr,$r)}}}function handleTransactionEvent(Tr,Cr){const $r=Tr.getContext();Cr.contexts&&Cr.contexts.trace&&Cr.contexts.trace.trace_id&&$r.traceIds.size<100&&$r.traceIds.add(Cr.contexts.trace.trace_id)}function handleErrorEvent(Tr,Cr){const $r=Tr.getContext();Cr.event_id&&$r.errorIds.size<100&&$r.errorIds.add(Cr.event_id),Tr.recordingMode==="buffer"&&Cr.tags&&Cr.tags.replayId&&setTimeout(()=>{Tr.sendBufferedReplayOrFlush()})}function isBaseTransportSend(){const Tr=getCurrentHub().getClient();if(!Tr)return!1;const Cr=Tr.getTransport();return Cr&&Cr.send.__sentry__baseTransport__||!1}function isRrwebError(Tr,Cr){return Tr.type||!Tr.exception||!Tr.exception.values||!Tr.exception.values.length?!1:Cr.originalException&&Cr.originalException.__rrweb__?!0:Tr.exception.values.some($r=>!$r.stacktrace||!$r.stacktrace.frames||!$r.stacktrace.frames.length?!1:$r.stacktrace.frames.some(Ar=>Ar.filename&&Ar.filename.includes("/rrweb/src/")))}function shouldSampleForBufferEvent(Tr,Cr){return Tr.recordingMode!=="buffer"||Cr.message===UNABLE_TO_SEND_REPLAY||!Cr.exception||Cr.type?!1:isSampled(Tr.getOptions().errorSampleRate)}function handleGlobalEventListener(Tr,Cr=!1){const $r=Cr?handleAfterSendEvent(Tr):void 0;return Object.assign((Ar,Rr)=>Tr.isEnabled()?isReplayEvent(Ar)?(delete Ar.breadcrumbs,Ar):!isErrorEvent(Ar)&&!isTransactionEvent(Ar)||!Tr.checkAndHandleExpiredSession()?Ar:isRrwebError(Ar,Rr)&&!Tr.getOptions()._experiments.captureExceptions?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Replay] Ignoring error from rrweb internals",Ar),null):((shouldSampleForBufferEvent(Tr,Ar)||Tr.recordingMode==="session")&&(Ar.tags={...Ar.tags,replayId:Tr.getSessionId()}),$r&&$r(Ar,{statusCode:200}),Ar):Ar,{id:"Replay"})}function createPerformanceSpans(Tr,Cr){return Cr.map(({type:$r,start:Ar,end:Rr,name:Dr,data:Mr})=>{const Br=Tr.throttledAddEvent({type:EventType.Custom,timestamp:Ar,data:{tag:"performanceSpan",payload:{op:$r,description:Dr,startTimestamp:Ar,endTimestamp:Rr,data:Mr}}});return typeof Br=="string"?Promise.resolve(null):Br})}function handleHistory(Tr){const{from:Cr,to:$r}=Tr,Ar=Date.now()/1e3;return{type:"navigation.push",start:Ar,end:Ar,name:$r,data:{previous:Cr}}}function handleHistorySpanListener(Tr){return Cr=>{if(!Tr.isEnabled())return;const $r=handleHistory(Cr);$r!==null&&(Tr.getContext().urls.push($r.name),Tr.triggerUserActivity(),Tr.addUpdate(()=>(createPerformanceSpans(Tr,[$r]),!1)))}}function shouldFilterRequest(Tr,Cr){return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Tr.getOptions()._experiments.traceInternals?!1:isSentryRequestUrl(Cr,getCurrentHub())}function addNetworkBreadcrumb(Tr,Cr){Tr.isEnabled()&&Cr!==null&&(shouldFilterRequest(Tr,Cr.name)||Tr.addUpdate(()=>(createPerformanceSpans(Tr,[Cr]),!0)))}function handleFetch(Tr){const{startTimestamp:Cr,endTimestamp:$r,fetchData:Ar,response:Rr}=Tr;if(!$r)return null;const{method:Dr,url:Mr}=Ar;return{type:"resource.fetch",start:Cr/1e3,end:$r/1e3,name:Mr,data:{method:Dr,statusCode:Rr?Rr.status:void 0}}}function handleFetchSpanListener(Tr){return Cr=>{if(!Tr.isEnabled())return;const $r=handleFetch(Cr);addNetworkBreadcrumb(Tr,$r)}}function handleXhr(Tr){const{startTimestamp:Cr,endTimestamp:$r,xhr:Ar}=Tr,Rr=Ar[SENTRY_XHR_DATA_KEY];if(!Cr||!$r||!Rr)return null;const{method:Dr,url:Mr,status_code:Br}=Rr;return Mr===void 0?null:{type:"resource.xhr",name:Mr,start:Cr/1e3,end:$r/1e3,data:{method:Dr,statusCode:Br}}}function handleXhrSpanListener(Tr){return Cr=>{if(!Tr.isEnabled())return;const $r=handleXhr(Cr);addNetworkBreadcrumb(Tr,$r)}}const OBJ=10,OBJ_KEY=11,OBJ_KEY_STR=12,OBJ_VAL=13,OBJ_VAL_STR=14,OBJ_VAL_COMPLETED=15,ARR=20,ARR_VAL=21,ARR_VAL_STR=22,ARR_VAL_COMPLETED=23,ALLOWED_PRIMITIVES=["true","false","null"];function completeJson(Tr,Cr){if(!Cr.length)return Tr;let $r=Tr;const Ar=Cr.length-1,Rr=Cr[Ar];$r=_fixLastStep($r,Rr);for(let Dr=Ar;Dr>=0;Dr--)switch(Cr[Dr]){case OBJ:$r=`${$r}}`;break;case ARR:$r=`${$r}]`;break}return $r}function _fixLastStep(Tr,Cr){switch(Cr){case OBJ:return`${Tr}"~~":"~~"`;case OBJ_KEY:return`${Tr}:"~~"`;case OBJ_KEY_STR:return`${Tr}~~":"~~"`;case OBJ_VAL:return _maybeFixIncompleteObjValue(Tr);case OBJ_VAL_STR:return`${Tr}~~"`;case OBJ_VAL_COMPLETED:return`${Tr},"~~":"~~"`;case ARR:return`${Tr}"~~"`;case ARR_VAL:return _maybeFixIncompleteArrValue(Tr);case ARR_VAL_STR:return`${Tr}~~"`;case ARR_VAL_COMPLETED:return`${Tr},"~~"`}return Tr}function _maybeFixIncompleteArrValue(Tr){const Cr=_findLastArrayDelimiter(Tr);if(Cr>-1){const $r=Tr.slice(Cr+1);return ALLOWED_PRIMITIVES.includes($r.trim())?`${Tr},"~~"`:`${Tr.slice(0,Cr+1)}"~~"`}return Tr}function _findLastArrayDelimiter(Tr){for(let Cr=Tr.length-1;Cr>=0;Cr--){const $r=Tr[Cr];if($r===","||$r==="[")return Cr}return-1}function _maybeFixIncompleteObjValue(Tr){const Cr=Tr.lastIndexOf(":"),$r=Tr.slice(Cr+1);return ALLOWED_PRIMITIVES.includes($r.trim())?`${Tr},"~~":"~~"`:`${Tr.slice(0,Cr+1)}"~~"`}function evaluateJson(Tr){const Cr=[];for(let $r=0;$r0&&(Ar._meta={warnings:Dr}),Ar}function getAllowedHeaders(Tr,Cr){return Object.keys(Tr).reduce(($r,Ar)=>{const Rr=Ar.toLowerCase();return Cr.includes(Rr)&&Tr[Ar]&&($r[Rr]=Tr[Ar]),$r},{})}function _serializeFormData(Tr){return new URLSearchParams(Tr).toString()}function normalizeNetworkBody(Tr){if(!Tr||typeof Tr!="string")return{body:Tr,warnings:[]};const Cr=Tr.length>NETWORK_BODY_MAX_SIZE;if(_strIsProbablyJson(Tr))try{const $r=Cr?fixJson(Tr.slice(0,NETWORK_BODY_MAX_SIZE)):Tr;return{body:JSON.parse($r),warnings:Cr?["JSON_TRUNCATED"]:[]}}catch{return{body:Cr?`${Tr.slice(0,NETWORK_BODY_MAX_SIZE)}…`:Tr,warnings:Cr?["INVALID_JSON","TEXT_TRUNCATED"]:["INVALID_JSON"]}}return{body:Cr?`${Tr.slice(0,NETWORK_BODY_MAX_SIZE)}…`:Tr,warnings:Cr?["TEXT_TRUNCATED"]:[]}}function _strIsProbablyJson(Tr){const Cr=Tr[0],$r=Tr[Tr.length-1];return Cr==="["&&$r==="]"||Cr==="{"&&$r==="}"}function urlMatches(Tr,Cr){const $r=getFullUrl(Tr);return stringMatchesSomePattern($r,Cr)}function getFullUrl(Tr,Cr=WINDOW$1.document.baseURI){if(Tr.startsWith("http://")||Tr.startsWith("https://")||Tr.startsWith(WINDOW$1.location.origin))return Tr;const $r=new URL(Tr,Cr);if($r.origin!==new URL(Cr).origin)return Tr;const Ar=$r.href;return!Tr.endsWith("/")&&Ar.endsWith("/")?Ar.slice(0,-1):Ar}async function captureFetchBreadcrumbToReplay(Tr,Cr,$r){try{const Ar=await _prepareFetchData(Tr,Cr,$r),Rr=makeNetworkReplayBreadcrumb("resource.fetch",Ar);addNetworkBreadcrumb($r.replay,Rr)}catch(Ar){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error("[Replay] Failed to capture fetch breadcrumb",Ar)}}function enrichFetchBreadcrumb(Tr,Cr,$r){const{input:Ar,response:Rr}=Cr,Dr=_getFetchRequestArgBody(Ar),Mr=getBodySize(Dr,$r.textEncoder),Br=Rr?parseContentLengthHeader(Rr.headers.get("content-length")):void 0;Mr!==void 0&&(Tr.data.request_body_size=Mr),Br!==void 0&&(Tr.data.response_body_size=Br)}async function _prepareFetchData(Tr,Cr,$r){const{startTimestamp:Ar,endTimestamp:Rr}=Cr,{url:Dr,method:Mr,status_code:Br=0,request_body_size:Nr,response_body_size:Lr}=Tr.data,Hr=urlMatches(Dr,$r.networkDetailAllowUrls)&&!urlMatches(Dr,$r.networkDetailDenyUrls),zr=Hr?_getRequestInfo($r,Cr.input,Nr):buildSkippedNetworkRequestOrResponse(Nr),Ur=await _getResponseInfo(Hr,$r,Cr.response,Lr);return{startTimestamp:Ar,endTimestamp:Rr,url:Dr,method:Mr,statusCode:Br,request:zr,response:Ur}}function _getRequestInfo({networkCaptureBodies:Tr,networkRequestHeaders:Cr},$r,Ar){const Rr=getRequestHeaders($r,Cr);if(!Tr)return buildNetworkRequestOrResponse(Rr,Ar,void 0);const Dr=_getFetchRequestArgBody($r),Mr=getBodyString(Dr);return buildNetworkRequestOrResponse(Rr,Ar,Mr)}async function _getResponseInfo(Tr,{networkCaptureBodies:Cr,textEncoder:$r,networkResponseHeaders:Ar},Rr,Dr){if(!Tr&&Dr!==void 0)return buildSkippedNetworkRequestOrResponse(Dr);const Mr=getAllHeaders(Rr.headers,Ar);if(!Cr&&Dr!==void 0)return buildNetworkRequestOrResponse(Mr,Dr,void 0);try{const Br=Rr.clone(),Nr=await _parseFetchBody(Br),Lr=Nr&&Nr.length&&Dr===void 0?getBodySize(Nr,$r):Dr;return Tr?Cr?buildNetworkRequestOrResponse(Mr,Lr,Nr):buildNetworkRequestOrResponse(Mr,Lr,void 0):buildSkippedNetworkRequestOrResponse(Lr)}catch{return buildNetworkRequestOrResponse(Mr,Dr,void 0)}}async function _parseFetchBody(Tr){try{return await Tr.text()}catch{return}}function _getFetchRequestArgBody(Tr=[]){if(!(Tr.length!==2||typeof Tr[1]!="object"))return Tr[1].body}function getAllHeaders(Tr,Cr){const $r={};return Cr.forEach(Ar=>{Tr.get(Ar)&&($r[Ar]=Tr.get(Ar))}),$r}function getRequestHeaders(Tr,Cr){return Tr.length===1&&typeof Tr[0]!="string"?getHeadersFromOptions(Tr[0],Cr):Tr.length===2?getHeadersFromOptions(Tr[1],Cr):{}}function getHeadersFromOptions(Tr,Cr){if(!Tr)return{};const $r=Tr.headers;return $r?$r instanceof Headers?getAllHeaders($r,Cr):Array.isArray($r)?{}:getAllowedHeaders($r,Cr):{}}async function captureXhrBreadcrumbToReplay(Tr,Cr,$r){try{const Ar=_prepareXhrData(Tr,Cr,$r),Rr=makeNetworkReplayBreadcrumb("resource.xhr",Ar);addNetworkBreadcrumb($r.replay,Rr)}catch(Ar){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error("[Replay] Failed to capture fetch breadcrumb",Ar)}}function enrichXhrBreadcrumb(Tr,Cr,$r){const{xhr:Ar,input:Rr}=Cr,Dr=getBodySize(Rr,$r.textEncoder),Mr=Ar.getResponseHeader("content-length")?parseContentLengthHeader(Ar.getResponseHeader("content-length")):getBodySize(Ar.response,$r.textEncoder);Dr!==void 0&&(Tr.data.request_body_size=Dr),Mr!==void 0&&(Tr.data.response_body_size=Mr)}function _prepareXhrData(Tr,Cr,$r){const{startTimestamp:Ar,endTimestamp:Rr,input:Dr,xhr:Mr}=Cr,{url:Br,method:Nr,status_code:Lr=0,request_body_size:Hr,response_body_size:zr}=Tr.data;if(!Br)return null;if(!urlMatches(Br,$r.networkDetailAllowUrls)||urlMatches(Br,$r.networkDetailDenyUrls)){const Kr=buildSkippedNetworkRequestOrResponse(Hr),Zr=buildSkippedNetworkRequestOrResponse(zr);return{startTimestamp:Ar,endTimestamp:Rr,url:Br,method:Nr,statusCode:Lr,request:Kr,response:Zr}}const Ur=Mr[SENTRY_XHR_DATA_KEY],Vr=Ur?getAllowedHeaders(Ur.request_headers,$r.networkRequestHeaders):{},jr=getAllowedHeaders(getResponseHeaders(Mr),$r.networkResponseHeaders),Gr=buildNetworkRequestOrResponse(Vr,Hr,$r.networkCaptureBodies?getBodyString(Dr):void 0),Xr=buildNetworkRequestOrResponse(jr,zr,$r.networkCaptureBodies?Cr.xhr.responseText:void 0);return{startTimestamp:Ar,endTimestamp:Rr,url:Br,method:Nr,statusCode:Lr,request:Gr,response:Xr}}function getResponseHeaders(Tr){const Cr=Tr.getAllResponseHeaders();return Cr?Cr.split(`\r `).reduce(($r,Ar)=>{const[Rr,Dr]=Ar.split(": ");return $r[Rr.toLowerCase()]=Dr,$r},{}):{}}function handleNetworkBreadcrumbs(Tr){const Cr=getCurrentHub().getClient();try{const $r=new TextEncoder,{networkDetailAllowUrls:Ar,networkDetailDenyUrls:Rr,networkCaptureBodies:Dr,networkRequestHeaders:Mr,networkResponseHeaders:Br}=Tr.getOptions(),Nr={replay:Tr,textEncoder:$r,networkDetailAllowUrls:Ar,networkDetailDenyUrls:Rr,networkCaptureBodies:Dr,networkRequestHeaders:Mr,networkResponseHeaders:Br};Cr&&Cr.on?Cr.on("beforeAddBreadcrumb",(Lr,Hr)=>beforeAddNetworkBreadcrumb(Nr,Lr,Hr)):(addInstrumentationHandler("fetch",handleFetchSpanListener(Tr)),addInstrumentationHandler("xhr",handleXhrSpanListener(Tr)))}catch{}}function beforeAddNetworkBreadcrumb(Tr,Cr,$r){if(Cr.data)try{_isXhrBreadcrumb(Cr)&&_isXhrHint($r)&&(enrichXhrBreadcrumb(Cr,$r,Tr),captureXhrBreadcrumbToReplay(Cr,$r,Tr)),_isFetchBreadcrumb(Cr)&&_isFetchHint($r)&&(enrichFetchBreadcrumb(Cr,$r,Tr),captureFetchBreadcrumbToReplay(Cr,$r,Tr))}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("Error when enriching network breadcrumb")}}function _isXhrBreadcrumb(Tr){return Tr.category==="xhr"}function _isFetchBreadcrumb(Tr){return Tr.category==="fetch"}function _isXhrHint(Tr){return Tr&&Tr.xhr}function _isFetchHint(Tr){return Tr&&Tr.response}let _LAST_BREADCRUMB=null;function isBreadcrumbWithCategory(Tr){return!!Tr.category}const handleScopeListener=Tr=>Cr=>{if(!Tr.isEnabled())return;const $r=handleScope(Cr);$r&&addBreadcrumbEvent(Tr,$r)};function handleScope(Tr){const Cr=Tr.getLastBreadcrumb&&Tr.getLastBreadcrumb();return _LAST_BREADCRUMB===Cr||!Cr||(_LAST_BREADCRUMB=Cr,!isBreadcrumbWithCategory(Cr)||["fetch","xhr","sentry.event","sentry.transaction"].includes(Cr.category)||Cr.category.startsWith("ui."))?null:Cr.category==="console"?normalizeConsoleBreadcrumb(Cr):createBreadcrumb(Cr)}function normalizeConsoleBreadcrumb(Tr){const Cr=Tr.data&&Tr.data.arguments;if(!Array.isArray(Cr)||Cr.length===0)return createBreadcrumb(Tr);let $r=!1;const Ar=Cr.map(Rr=>{if(!Rr)return Rr;if(typeof Rr=="string")return Rr.length>CONSOLE_ARG_MAX_SIZE?($r=!0,`${Rr.slice(0,CONSOLE_ARG_MAX_SIZE)}…`):Rr;if(typeof Rr=="object")try{const Dr=normalize$3(Rr,7),Mr=JSON.stringify(Dr);if(Mr.length>CONSOLE_ARG_MAX_SIZE){const Br=fixJson(Mr.slice(0,CONSOLE_ARG_MAX_SIZE)),Nr=JSON.parse(Br);return $r=!0,Nr}return Dr}catch{}return Rr});return createBreadcrumb({...Tr,data:{...Tr.data,arguments:Ar,...$r?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function addGlobalListeners(Tr){const Cr=getCurrentHub().getScope(),$r=getCurrentHub().getClient();Cr.addScopeListener(handleScopeListener(Tr)),addInstrumentationHandler("dom",handleDomListener(Tr)),addInstrumentationHandler("history",handleHistorySpanListener(Tr)),handleNetworkBreadcrumbs(Tr);const Ar=handleGlobalEventListener(Tr,!hasHooks($r));$r&&$r.addEventProcessor?$r.addEventProcessor(Ar):addGlobalEventProcessor(Ar),hasHooks($r)&&($r.on("afterSendEvent",handleAfterSendEvent(Tr)),$r.on("createDsc",Rr=>{const Dr=Tr.getSessionId();Dr&&Tr.isEnabled()&&Tr.recordingMode==="session"&&(Rr.replay_id=Dr)}),$r.on("startTransaction",Rr=>{Tr.lastTransaction=Rr}),$r.on("finishTransaction",Rr=>{Tr.lastTransaction=Rr}))}function hasHooks(Tr){return!!(Tr&&Tr.on)}async function addMemoryEntry(Tr){try{return Promise.all(createPerformanceSpans(Tr,[createMemoryEntry(WINDOW$1.performance.memory)]))}catch{return[]}}function createMemoryEntry(Tr){const{jsHeapSizeLimit:Cr,totalJSHeapSize:$r,usedJSHeapSize:Ar}=Tr,Rr=Date.now()/1e3;return{type:"memory",name:"memory",start:Rr,end:Rr,data:{memory:{jsHeapSizeLimit:Cr,totalJSHeapSize:$r,usedJSHeapSize:Ar}}}}const ENTRY_TYPES={resource:createResourceEntry,paint:createPaintEntry,navigation:createNavigationEntry,"largest-contentful-paint":createLargestContentfulPaint};function createPerformanceEntries(Tr){return Tr.map(createPerformanceEntry).filter(Boolean)}function createPerformanceEntry(Tr){return ENTRY_TYPES[Tr.entryType]===void 0?null:ENTRY_TYPES[Tr.entryType](Tr)}function getAbsoluteTime$1(Tr){return((browserPerformanceTimeOrigin||WINDOW$1.performance.timeOrigin)+Tr)/1e3}function createPaintEntry(Tr){const{duration:Cr,entryType:$r,name:Ar,startTime:Rr}=Tr,Dr=getAbsoluteTime$1(Rr);return{type:$r,name:Ar,start:Dr,end:Dr+Cr,data:void 0}}function createNavigationEntry(Tr){const{entryType:Cr,name:$r,decodedBodySize:Ar,duration:Rr,domComplete:Dr,encodedBodySize:Mr,domContentLoadedEventStart:Br,domContentLoadedEventEnd:Nr,domInteractive:Lr,loadEventStart:Hr,loadEventEnd:zr,redirectCount:Ur,startTime:Vr,transferSize:jr,type:Gr}=Tr;return Rr===0?null:{type:`${Cr}.${Gr}`,start:getAbsoluteTime$1(Vr),end:getAbsoluteTime$1(Dr),name:$r,data:{size:jr,decodedBodySize:Ar,encodedBodySize:Mr,duration:Rr,domInteractive:Lr,domContentLoadedEventStart:Br,domContentLoadedEventEnd:Nr,loadEventStart:Hr,loadEventEnd:zr,domComplete:Dr,redirectCount:Ur}}}function createResourceEntry(Tr){const{entryType:Cr,initiatorType:$r,name:Ar,responseEnd:Rr,startTime:Dr,decodedBodySize:Mr,encodedBodySize:Br,responseStatus:Nr,transferSize:Lr}=Tr;return["fetch","xmlhttprequest"].includes($r)?null:{type:`${Cr}.${$r}`,start:getAbsoluteTime$1(Dr),end:getAbsoluteTime$1(Rr),name:Ar,data:{size:Lr,statusCode:Nr,decodedBodySize:Mr,encodedBodySize:Br}}}function createLargestContentfulPaint(Tr){const{entryType:Cr,startTime:$r,size:Ar}=Tr;let Rr=0;if(WINDOW$1.performance){const Br=WINDOW$1.performance.getEntriesByType("navigation")[0];Rr=Br&&Br.activationStart||0}const Dr=Math.max($r-Rr,0),Mr=getAbsoluteTime$1(Rr)+Dr/1e3;return{type:Cr,name:Cr,start:Mr,end:Mr,data:{value:Dr,size:Ar,nodeId:record.mirror.getId(Tr.element)}}}function debounce(Tr,Cr,$r){let Ar,Rr,Dr;const Mr=$r&&$r.maxWait?Math.max($r.maxWait,Cr):0;function Br(){return Nr(),Ar=Tr(),Ar}function Nr(){Rr!==void 0&&clearTimeout(Rr),Dr!==void 0&&clearTimeout(Dr),Rr=Dr=void 0}function Lr(){return Rr!==void 0||Dr!==void 0?Br():Ar}function Hr(){return Rr&&clearTimeout(Rr),Rr=setTimeout(Br,Cr),Mr&&Dr===void 0&&(Dr=setTimeout(Br,Mr)),Ar}return Hr.cancel=Nr,Hr.flush=Lr,Hr}function getHandleRecordingEmit(Tr){let Cr=!1;return($r,Ar)=>{if(!Tr.checkAndHandleExpiredSession()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("[Replay] Received replay event after session expired.");return}const Rr=Ar||!Cr;Cr=!0,Tr.addUpdate(()=>{if(Tr.recordingMode==="buffer"&&Rr&&Tr.setInitialState(),!addEventSync(Tr,$r,Rr))return!0;if(!Rr)return!1;if(addSettingsEvent(Tr,Rr),Tr.session&&Tr.session.previousSessionId)return!0;if(Tr.recordingMode==="buffer"&&Tr.session&&Tr.eventBuffer){const Dr=Tr.eventBuffer.getEarliestTimestamp();Dr&&(logInfo(`[Replay] Updating session start time to earliest event in buffer to ${new Date(Dr)}`,Tr.getOptions()._experiments.traceInternals),Tr.session.started=Dr,Tr.getOptions().stickySession&&saveSession(Tr.session))}return Tr.recordingMode==="session"&&Tr.flush(),!0})}}function createOptionsEvent(Tr){const Cr=Tr.getOptions();return{type:EventType.Custom,timestamp:Date.now(),data:{tag:"options",payload:{sessionSampleRate:Cr.sessionSampleRate,errorSampleRate:Cr.errorSampleRate,useCompressionOption:Cr.useCompression,blockAllMedia:Cr.blockAllMedia,maskAllText:Cr.maskAllText,maskAllInputs:Cr.maskAllInputs,useCompression:Tr.eventBuffer?Tr.eventBuffer.type==="worker":!1,networkDetailHasUrls:Cr.networkDetailAllowUrls.length>0,networkCaptureBodies:Cr.networkCaptureBodies,networkRequestHasHeaders:Cr.networkRequestHeaders.length>0,networkResponseHasHeaders:Cr.networkResponseHeaders.length>0}}}}function addSettingsEvent(Tr,Cr){!Cr||!Tr.session||Tr.session.segmentId!==0||addEventSync(Tr,createOptionsEvent(Tr),!1)}function createReplayEnvelope(Tr,Cr,$r,Ar){return createEnvelope(createEventEnvelopeHeaders(Tr,getSdkMetadataForEnvelopeHeader(Tr),Ar,$r),[[{type:"replay_event"},Tr],[{type:"replay_recording",length:typeof Cr=="string"?new TextEncoder().encode(Cr).length:Cr.length},Cr]])}function prepareRecordingData({recordingData:Tr,headers:Cr}){let $r;const Ar=`${JSON.stringify(Cr)} `;if(typeof Tr=="string")$r=`${Ar}${Tr}`;else{const Dr=new TextEncoder().encode(Ar);$r=new Uint8Array(Dr.length+Tr.length),$r.set(Dr),$r.set(Tr,Dr.length)}return $r}async function prepareReplayEvent({client:Tr,scope:Cr,replayId:$r,event:Ar}){const Rr=typeof Tr._integrations=="object"&&Tr._integrations!==null&&!Array.isArray(Tr._integrations)?Object.keys(Tr._integrations):void 0,Dr={event_id:$r,integrations:Rr};Tr.emit&&Tr.emit("preprocessEvent",Ar,Dr);const Mr=await prepareEvent(Tr.getOptions(),Ar,Dr,Cr,Tr);if(!Mr)return null;Mr.platform=Mr.platform||"javascript";const Br=Tr.getSdkMetadata&&Tr.getSdkMetadata(),{name:Nr,version:Lr}=Br&&Br.sdk||{};return Mr.sdk={...Mr.sdk,name:Nr||"sentry.javascript.unknown",version:Lr||"0.0.0"},Mr}async function sendReplayRequest({recordingData:Tr,replayId:Cr,segmentId:$r,eventContext:Ar,timestamp:Rr,session:Dr}){const Mr=prepareRecordingData({recordingData:Tr,headers:{segment_id:$r}}),{urls:Br,errorIds:Nr,traceIds:Lr,initialTimestamp:Hr}=Ar,zr=getCurrentHub(),Ur=zr.getClient(),Vr=zr.getScope(),jr=Ur&&Ur.getTransport(),Gr=Ur&&Ur.getDsn();if(!Ur||!jr||!Gr||!Dr.sampled)return;const Xr={type:REPLAY_EVENT_NAME,replay_start_timestamp:Hr/1e3,timestamp:Rr/1e3,error_ids:Nr,trace_ids:Lr,urls:Br,replay_id:Cr,segment_id:$r,replay_type:Dr.sampled},Kr=await prepareReplayEvent({scope:Vr,client:Ur,replayId:Cr,event:Xr});if(!Kr){Ur.recordDroppedEvent("event_processor","replay",Xr),logInfo("An event processor returned `null`, will not send event.");return}delete Kr.sdkProcessingMetadata;const Zr=createReplayEnvelope(Kr,Mr,Gr,Ur.getOptions().tunnel);let eo;try{eo=await jr.send(Zr)}catch(Wr){const Yr=new Error(UNABLE_TO_SEND_REPLAY);try{Yr.cause=Wr}catch{}throw Yr}if(!eo)return eo;if(typeof eo.statusCode=="number"&&(eo.statusCode<200||eo.statusCode>=300))throw new TransportStatusCodeError(eo.statusCode);return eo}class TransportStatusCodeError extends Error{constructor(Cr){super(`Transport returned status code ${Cr}`)}}async function sendReplay(Tr,Cr={count:0,interval:RETRY_BASE_INTERVAL}){const{recordingData:$r,options:Ar}=Tr;if($r.length)try{return await sendReplayRequest(Tr),!0}catch(Rr){if(Rr instanceof TransportStatusCodeError)throw Rr;if(setContext("Replays",{_retryCount:Cr.count}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ar._experiments&&Ar._experiments.captureExceptions&&captureException(Rr),Cr.count>=RETRY_MAX_COUNT){const Dr=new Error(`${UNABLE_TO_SEND_REPLAY} - max retries exceeded`);try{Dr.cause=Rr}catch{}throw Dr}return Cr.interval*=++Cr.count,new Promise((Dr,Mr)=>{setTimeout(async()=>{try{await sendReplay(Tr,Cr),Dr(!0)}catch(Br){Mr(Br)}},Cr.interval)})}}const THROTTLED="__THROTTLED",SKIPPED="__SKIPPED";function throttle$2(Tr,Cr,$r){const Ar=new Map,Rr=Br=>{const Nr=Br-$r;Ar.forEach((Lr,Hr)=>{Hr[...Ar.values()].reduce((Br,Nr)=>Br+Nr,0);let Mr=!1;return(...Br)=>{const Nr=Math.floor(Date.now()/1e3);if(Rr(Nr),Dr()>=Cr){const Hr=Mr;return Mr=!0,Hr?SKIPPED:THROTTLED}Mr=!1;const Lr=Ar.get(Nr)||0;return Ar.set(Nr,Lr+1),Tr(...Br)}}class ReplayContainer{constructor({options:Cr,recordingOptions:$r}){ReplayContainer.prototype.__init.call(this),ReplayContainer.prototype.__init2.call(this),ReplayContainer.prototype.__init3.call(this),ReplayContainer.prototype.__init4.call(this),ReplayContainer.prototype.__init5.call(this),ReplayContainer.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEvents=[],this.recordingMode="session",this.timeouts={sessionIdlePause:SESSION_IDLE_PAUSE_DURATION,sessionIdleExpire:SESSION_IDLE_EXPIRE_DURATION},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=$r,this._options=Cr,this._debouncedFlush=debounce(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=throttle$2((Mr,Br)=>addEvent(this,Mr,Br),300,5);const{slowClickTimeout:Ar,slowClickIgnoreSelectors:Rr}=this.getOptions(),Dr=Ar?{threshold:Math.min(SLOW_CLICK_THRESHOLD,Ar),timeout:Ar,scrollTimeout:SLOW_CLICK_SCROLL_TIMEOUT,ignoreSelector:Rr?Rr.join(","):""}:void 0;Dr&&(this.clickDetector=new ClickDetector(this,Dr))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}getOptions(){return this._options}initializeSampling(Cr){const{errorSampleRate:$r,sessionSampleRate:Ar}=this._options;if(!($r<=0&&Ar<=0)){if(this._initializeSessionForSampling(Cr),!this.session){this._handleException(new Error("Unable to initialize and create session"));return}this.session.sampled!==!1&&(this.recordingMode=this.session.sampled==="buffer"&&this.session.segmentId===0?"buffer":"session",logInfoNextTick(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session")throw new Error("Replay recording is already in progress");if(this._isEnabled&&this.recordingMode==="buffer")throw new Error("Replay buffering is in progress, call `flush()` to save the replay");logInfoNextTick("[Replay] Starting replay in session mode",this._options._experiments.traceInternals);const Cr=loadOrCreateSession({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=Cr,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");logInfoNextTick("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);const Cr=loadOrCreateSession({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=Cr,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{this._stopRecording=record({...this._recordingOptions,...this.recordingMode==="buffer"&&{checkoutEveryNms:BUFFER_CHECKOUT_TIME},emit:getHandleRecordingEmit(this),onMutation:this._onMutationHandler})}catch(Cr){this._handleException(Cr)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(Cr){return this._handleException(Cr),!1}}async stop({forceFlush:Cr=!1,reason:$r}={}){if(this._isEnabled){this._isEnabled=!1;try{logInfo(`[Replay] Stopping Replay${$r?` triggered by ${$r}`:""}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),Cr&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,clearSession(this)}catch(Ar){this._handleException(Ar)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),logInfo("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),logInfo("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:Cr=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const $r=Date.now();logInfo("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();const Ar=this.stopRecording();!Cr||!Ar||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this._updateUserActivity($r),this._updateSessionActivity($r),this._maybeSaveSession()),this.startRecording())}addUpdate(Cr){const $r=Cr();this.recordingMode!=="buffer"&&$r!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}checkAndHandleExpiredSession(){if(this._lastActivity&&isExpired(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&this.session.sampled==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const Cr=`${WINDOW$1.location.pathname}${WINDOW$1.location.hash}${WINDOW$1.location.search}`,$r=`${WINDOW$1.location.origin}${Cr}`;this.performanceEvents=[],this._clearContext(),this._context.initialUrl=$r,this._context.initialTimestamp=Date.now(),this._context.urls.push($r)}throttledAddEvent(Cr,$r){const Ar=this._throttledAddEvent(Cr,$r);if(Ar===THROTTLED){const Rr=createBreadcrumb({category:"replay.throttled"});this.addUpdate(()=>!addEventSync(this,{type:ReplayEventTypeCustom,timestamp:Rr.timestamp||0,data:{tag:"breadcrumb",payload:Rr,metric:!0}}))}return Ar}getCurrentRoute(){const Cr=this.lastTransaction||getCurrentHub().getScope().getTransaction();if(!(!Cr||!["route","custom"].includes(Cr.metadata.source)))return Cr.name}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=createEventBuffer({useCompression:this._options.useCompression}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(Cr){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error("[Replay]",Cr),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._options._experiments&&this._options._experiments.captureExceptions&&captureException(Cr)}_initializeSessionForSampling(Cr){const $r=this._options.errorSampleRate>0,Ar=loadOrCreateSession({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:Cr},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:$r});this.session=Ar}_checkSession(){if(!this.session)return!1;const Cr=this.session;return shouldRefreshSession(Cr,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(Cr),!1):!0}async _refreshSession(Cr){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(Cr.id))}_addListeners(){try{WINDOW$1.document.addEventListener("visibilitychange",this._handleVisibilityChange),WINDOW$1.addEventListener("blur",this._handleWindowBlur),WINDOW$1.addEventListener("focus",this._handleWindowFocus),WINDOW$1.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(addGlobalListeners(this),this._hasInitializedCoreListeners=!0)}catch(Cr){this._handleException(Cr)}"PerformanceObserver"in WINDOW$1&&(this._performanceObserver=setupPerformanceObserver(this))}_removeListeners(){try{WINDOW$1.document.removeEventListener("visibilitychange",this._handleVisibilityChange),WINDOW$1.removeEventListener("blur",this._handleWindowBlur),WINDOW$1.removeEventListener("focus",this._handleWindowFocus),WINDOW$1.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceObserver&&(this._performanceObserver.disconnect(),this._performanceObserver=void 0)}catch(Cr){this._handleException(Cr)}}__init(){this._handleVisibilityChange=()=>{WINDOW$1.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const Cr=createBreadcrumb({category:"ui.blur"});this._doChangeToBackgroundTasks(Cr)}}__init3(){this._handleWindowFocus=()=>{const Cr=createBreadcrumb({category:"ui.focus"});this._doChangeToForegroundTasks(Cr)}}__init4(){this._handleKeyboardEvent=Cr=>{handleKeyboardEvent(this,Cr)}}_doChangeToBackgroundTasks(Cr){!this.session||isSessionExpired(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(Cr&&this._createCustomBreadcrumb(Cr),this.conditionalFlush())}_doChangeToForegroundTasks(Cr){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){logInfo("[Replay] Document has become active, but session has expired");return}Cr&&this._createCustomBreadcrumb(Cr)}_triggerFullSnapshot(Cr=!0){try{logInfo("[Replay] Taking full rrweb snapshot"),record.takeFullSnapshot(Cr)}catch($r){this._handleException($r)}}_updateUserActivity(Cr=Date.now()){this._lastActivity=Cr}_updateSessionActivity(Cr=Date.now()){this.session&&(this.session.lastActivity=Cr,this._maybeSaveSession())}_createCustomBreadcrumb(Cr){this.addUpdate(()=>{this.throttledAddEvent({type:EventType.Custom,timestamp:Cr.timestamp||0,data:{tag:"breadcrumb",payload:Cr}})})}_addPerformanceEntries(){const Cr=[...this.performanceEvents];return this.performanceEvents=[],Promise.all(createPerformanceSpans(this,createPerformanceEntries(Cr)))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:Cr,eventBuffer:$r}=this;if(!Cr||!$r||Cr.segmentId)return;const Ar=$r.getEarliestTimestamp();Ar&&Ar"u"||__SENTRY_DEBUG__)&&logger.error("[Replay] No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!(!this.eventBuffer||!this.eventBuffer.hasEvents)&&(await addMemoryEntry(this),!!this.eventBuffer&&Cr===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const $r=Date.now();if($r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const Ar=this._popEventContext(),Rr=this.session.segmentId++;this._maybeSaveSession();const Dr=await this.eventBuffer.finish();await sendReplay({replayId:Cr,recordingData:Dr,segmentId:Rr,eventContext:Ar,session:this.session,options:this.getOptions(),timestamp:$r})}catch($r){this._handleException($r),this.stop({reason:"sendReplay"});const Ar=getCurrentHub().getClient();Ar&&Ar.recordDroppedEvent("send_error","replay")}}__init5(){this._flush=async({force:Cr=!1}={})=>{if(!this._isEnabled&&!Cr)return;if(!this.checkAndHandleExpiredSession()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error("[Replay] Attempting to finish replay event after session expired.");return}if(!this.session){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error("[Replay] No session found to flush.");return}const $r=this.session.started,Rr=Date.now()-$r;this._debouncedFlush.cancel();const Dr=Rrthis._options.maxReplayDuration+5e3;if(Dr||Mr){logInfo(`[Replay] Session duration (${Math.floor(Rr/1e3)}s) is too ${Dr?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),Dr&&this._debouncedFlush();return}const Br=this.eventBuffer;if(Br&&this.session.segmentId===0&&!Br.hasCheckout&&logInfo("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),await this._flushLock,this._flushLock=void 0;return}try{await this._flushLock}catch(Nr){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.error(Nr)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&saveSession(this.session)}__init6(){this._onMutationHandler=Cr=>{const $r=Cr.length,Ar=this._options.mutationLimit,Rr=this._options.mutationBreadcrumbLimit,Dr=Ar&&$r>Ar;if($r>Rr||Dr){const Mr=createBreadcrumb({category:"replay.mutations",data:{count:$r,limit:Dr}});this._createCustomBreadcrumb(Mr)}return Dr?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}}function getOption(Tr,Cr,$r,Ar){const Rr=typeof Ar=="string"?Ar.split(","):[],Dr=[...Tr,...Rr,...Cr];return typeof $r<"u"&&(typeof $r=="string"&&Dr.push(`.${$r}`),console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")),Dr.join(",")}function getPrivacyOptions({mask:Tr,unmask:Cr,block:$r,unblock:Ar,ignore:Rr,blockClass:Dr,blockSelector:Mr,maskTextClass:Br,maskTextSelector:Nr,ignoreClass:Lr}){const Hr=['base[href="/"]'],zr=getOption(Tr,[".sentry-mask","[data-sentry-mask]"],Br,Nr),Ur=getOption(Cr,[".sentry-unmask","[data-sentry-unmask]"]),Vr={maskTextSelector:zr,unmaskTextSelector:Ur,blockSelector:getOption($r,[".sentry-block","[data-sentry-block]",...Hr],Dr,Mr),unblockSelector:getOption(Ar,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:getOption(Rr,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],Lr)};return Dr instanceof RegExp&&(Vr.blockClass=Dr),Br instanceof RegExp&&(Vr.maskTextClass=Br),Vr}function isBrowser(){return typeof window<"u"&&(!isNodeEnv()||isElectronNodeRenderer())}function isElectronNodeRenderer(){return typeof process<"u"&&process.type==="renderer"}function maskAttribute({el:Tr,key:Cr,maskAttributes:$r,maskAllText:Ar,privacyOptions:Rr,value:Dr}){return!Ar||Rr.unmaskTextSelector&&Tr.matches(Rr.unmaskTextSelector)?Dr:$r.includes(Cr)||Cr==="value"&&Tr.tagName==="INPUT"&&["submit","button"].includes(Tr.getAttribute("type")||"")?Dr.replace(/[\S]/g,"*"):Dr}const MEDIA_SELECTORS='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',DEFAULT_NETWORK_HEADERS=["content-length","content-type","accept"];let _initialized=!1;class Replay{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:Cr=DEFAULT_FLUSH_MIN_DELAY,flushMaxDelay:$r=DEFAULT_FLUSH_MAX_DELAY,minReplayDuration:Ar=MIN_REPLAY_DURATION,maxReplayDuration:Rr=MAX_REPLAY_DURATION,stickySession:Dr=!0,useCompression:Mr=!0,_experiments:Br={},sessionSampleRate:Nr,errorSampleRate:Lr,maskAllText:Hr=!0,maskAllInputs:zr=!0,blockAllMedia:Ur=!0,mutationBreadcrumbLimit:Vr=750,mutationLimit:jr=1e4,slowClickTimeout:Gr=7e3,slowClickIgnoreSelectors:Xr=[],networkDetailAllowUrls:Kr=[],networkDetailDenyUrls:Zr=[],networkCaptureBodies:eo=!0,networkRequestHeaders:Wr=[],networkResponseHeaders:Yr=[],mask:Jr=[],maskAttributes:no=["title","placeholder"],unmask:ro=[],block:so=[],unblock:ao=[],ignore:lo=[],maskFn:po,beforeAddRecordingEvent:go,blockClass:co,blockSelector:mo,maskInputOptions:io,maskTextClass:uo,maskTextSelector:ho,ignoreClass:yo}={}){this.name=Replay.id;const So=getPrivacyOptions({mask:Jr,unmask:ro,block:so,unblock:ao,ignore:lo,blockClass:co,blockSelector:mo,maskTextClass:uo,maskTextSelector:ho,ignoreClass:yo});if(this._recordingOptions={maskAllInputs:zr,maskAllText:Hr,maskInputOptions:{...io||{},password:!0},maskTextFn:po,maskInputFn:po,maskAttributeFn:(ko,$o,Go)=>maskAttribute({maskAttributes:no,maskAllText:Hr,privacyOptions:So,key:ko,value:$o,el:Go}),...So,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:ko=>{try{ko.__rrweb__=!0}catch{}return!0}},this._initialOptions={flushMinDelay:Cr,flushMaxDelay:$r,minReplayDuration:Math.min(Ar,MIN_REPLAY_DURATION_LIMIT),maxReplayDuration:Math.min(Rr,MAX_REPLAY_DURATION),stickySession:Dr,sessionSampleRate:Nr,errorSampleRate:Lr,useCompression:Mr,blockAllMedia:Ur,maskAllInputs:zr,maskAllText:Hr,mutationBreadcrumbLimit:Vr,mutationLimit:jr,slowClickTimeout:Gr,slowClickIgnoreSelectors:Xr,networkDetailAllowUrls:Kr,networkDetailDenyUrls:Zr,networkCaptureBodies:eo,networkRequestHeaders:_getMergedNetworkHeaders(Wr),networkResponseHeaders:_getMergedNetworkHeaders(Yr),beforeAddRecordingEvent:go,_experiments:Br},typeof Nr=="number"&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration. This option is deprecated and will be removed soon. Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.: Sentry.init({ replaysSessionSampleRate: ${Nr} })`),this._initialOptions.sessionSampleRate=Nr),typeof Lr=="number"&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration. This option is deprecated and will be removed soon. Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.: Sentry.init({ replaysOnErrorSampleRate: ${Lr} })`),this._initialOptions.errorSampleRate=Lr),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`:MEDIA_SELECTORS),this._isInitialized&&isBrowser())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return _initialized}set _isInitialized(Cr){_initialized=Cr}setupOnce(){isBrowser()&&(this._setup(),setTimeout(()=>this._initialize()))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(Cr){return!this._replay||!this._replay.isEnabled()?Promise.resolve():this._replay.sendBufferedReplayOrFlush(Cr)}getReplayId(){if(!(!this._replay||!this._replay.isEnabled()))return this._replay.getSessionId()}_initialize(){this._replay&&this._replay.initializeSampling()}_setup(){const Cr=loadReplayOptionsFromClient(this._initialOptions);this._replay=new ReplayContainer({options:Cr,recordingOptions:this._recordingOptions})}}Replay.__initStatic();function loadReplayOptionsFromClient(Tr){const Cr=getCurrentHub().getClient(),$r=Cr&&Cr.getOptions(),Ar={sessionSampleRate:0,errorSampleRate:0,...dropUndefinedKeys(Tr)};return $r?(Tr.sessionSampleRate==null&&Tr.errorSampleRate==null&&$r.replaysSessionSampleRate==null&&$r.replaysOnErrorSampleRate==null&&console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set."),typeof $r.replaysSessionSampleRate=="number"&&(Ar.sessionSampleRate=$r.replaysSessionSampleRate),typeof $r.replaysOnErrorSampleRate=="number"&&(Ar.errorSampleRate=$r.replaysOnErrorSampleRate),Ar):(console.warn("SDK client is not available."),Ar)}function _getMergedNetworkHeaders(Tr){return[...DEFAULT_NETWORK_HEADERS,...Tr.map(Cr=>Cr.toLowerCase())]}const WINDOW=GLOBAL_OBJ;function registerBackgroundTabDetection(){WINDOW&&WINDOW.document?WINDOW.document.addEventListener("visibilitychange",()=>{const Tr=getActiveTransaction$1();if(WINDOW.document.hidden&&Tr){const Cr="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`[Tracing] Transaction: ${Cr} -> since tab moved to the background, op: ${Tr.op}`),Tr.status||Tr.setStatus(Cr),Tr.setTag("visibilitychange","document.hidden"),Tr.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const bindReporter=(Tr,Cr,$r)=>{let Ar,Rr;return Dr=>{Cr.value>=0&&(Dr||$r)&&(Rr=Cr.value-(Ar||0),(Rr||Ar===void 0)&&(Ar=Cr.value,Cr.delta=Rr,Tr(Cr)))}},generateUniqueID=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,getNavigationEntryFromPerformanceTiming=()=>{const Tr=WINDOW.performance.timing,Cr=WINDOW.performance.navigation.type,$r={entryType:"navigation",startTime:0,type:Cr==2?"back_forward":Cr===1?"reload":"navigate"};for(const Ar in Tr)Ar!=="navigationStart"&&Ar!=="toJSON"&&($r[Ar]=Math.max(Tr[Ar]-Tr.navigationStart,0));return $r},getNavigationEntry=()=>WINDOW.__WEB_VITALS_POLYFILL__?WINDOW.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||getNavigationEntryFromPerformanceTiming()):WINDOW.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],getActivationStart=()=>{const Tr=getNavigationEntry();return Tr&&Tr.activationStart||0},initMetric=(Tr,Cr)=>{const $r=getNavigationEntry();let Ar="navigate";return $r&&(WINDOW.document.prerendering||getActivationStart()>0?Ar="prerender":Ar=$r.type.replace(/_/g,"-")),{name:Tr,value:typeof Cr>"u"?-1:Cr,rating:"good",delta:0,entries:[],id:generateUniqueID(),navigationType:Ar}},observe=(Tr,Cr,$r)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(Tr)){const Ar=new PerformanceObserver(Rr=>{Cr(Rr.getEntries())});return Ar.observe(Object.assign({type:Tr,buffered:!0},$r||{})),Ar}}catch{}},onHidden=(Tr,Cr)=>{const $r=Ar=>{(Ar.type==="pagehide"||WINDOW.document.visibilityState==="hidden")&&(Tr(Ar),Cr&&(removeEventListener("visibilitychange",$r,!0),removeEventListener("pagehide",$r,!0)))};addEventListener("visibilitychange",$r,!0),addEventListener("pagehide",$r,!0)},onCLS=Tr=>{const Cr=initMetric("CLS",0);let $r,Ar=0,Rr=[];const Dr=Br=>{Br.forEach(Nr=>{if(!Nr.hadRecentInput){const Lr=Rr[0],Hr=Rr[Rr.length-1];Ar&&Rr.length!==0&&Nr.startTime-Hr.startTime<1e3&&Nr.startTime-Lr.startTime<5e3?(Ar+=Nr.value,Rr.push(Nr)):(Ar=Nr.value,Rr=[Nr]),Ar>Cr.value&&(Cr.value=Ar,Cr.entries=Rr,$r&&$r())}})},Mr=observe("layout-shift",Dr);if(Mr){$r=bindReporter(Tr,Cr);const Br=()=>{Dr(Mr.takeRecords()),$r(!0)};return onHidden(Br),Br}};let firstHiddenTime=-1;const initHiddenTime=()=>WINDOW.document.visibilityState==="hidden"&&!WINDOW.document.prerendering?0:1/0,trackChanges=()=>{onHidden(({timeStamp:Tr})=>{firstHiddenTime=Tr},!0)},getVisibilityWatcher=()=>(firstHiddenTime<0&&(firstHiddenTime=initHiddenTime(),trackChanges()),{get firstHiddenTime(){return firstHiddenTime}}),onFID=Tr=>{const Cr=getVisibilityWatcher(),$r=initMetric("FID");let Ar;const Rr=Br=>{Br.startTime{Br.forEach(Rr)},Mr=observe("first-input",Dr);Ar=bindReporter(Tr,$r),Mr&&onHidden(()=>{Dr(Mr.takeRecords()),Mr.disconnect()},!0)},reportedMetricIDs={},onLCP=Tr=>{const Cr=getVisibilityWatcher(),$r=initMetric("LCP");let Ar;const Rr=Mr=>{const Br=Mr[Mr.length-1];if(Br){const Nr=Math.max(Br.startTime-getActivationStart(),0);Nr{reportedMetricIDs[$r.id]||(Rr(Dr.takeRecords()),Dr.disconnect(),reportedMetricIDs[$r.id]=!0,Ar(!0))};return["keydown","click"].forEach(Br=>{addEventListener(Br,Mr,{once:!0,capture:!0})}),onHidden(Mr,!0),Mr}};function isMeasurementValue(Tr){return typeof Tr=="number"&&isFinite(Tr)}function _startChild(Tr,{startTimestamp:Cr,...$r}){return Cr&&Tr.startTimestamp>Cr&&(Tr.startTimestamp=Cr),Tr.startChild({startTimestamp:Cr,...$r})}function msToSec(Tr){return Tr/1e3}function getBrowserPerformanceAPI(){return WINDOW&&WINDOW.addEventListener&&WINDOW.performance}let _performanceCursor=0,_measurements={},_lcpEntry,_clsEntry;function startTrackingWebVitals(){const Tr=getBrowserPerformanceAPI();if(Tr&&browserPerformanceTimeOrigin){Tr.mark&&WINDOW.performance.mark("sentry-tracing-init"),_trackFID();const Cr=_trackCLS(),$r=_trackLCP();return()=>{Cr&&Cr(),$r&&$r()}}return()=>{}}function startTrackingLongTasks(){observe("longtask",Cr=>{for(const $r of Cr){const Ar=getActiveTransaction$1();if(!Ar)return;const Rr=msToSec(browserPerformanceTimeOrigin+$r.startTime),Dr=msToSec($r.duration);Ar.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:Rr,endTimestamp:Rr+Dr})}})}function startTrackingInteractions(){observe("event",Cr=>{for(const $r of Cr){const Ar=getActiveTransaction$1();if(!Ar)return;if($r.name==="click"){const Rr=msToSec(browserPerformanceTimeOrigin+$r.startTime),Dr=msToSec($r.duration);Ar.startChild({description:htmlTreeAsString($r.target),op:`ui.interaction.${$r.name}`,origin:"auto.ui.browser.metrics",startTimestamp:Rr,endTimestamp:Rr+Dr})}}},{durationThreshold:0})}function _trackCLS(){return onCLS(Tr=>{const Cr=Tr.entries.pop();Cr&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Measurements] Adding CLS"),_measurements.cls={value:Tr.value,unit:""},_clsEntry=Cr)})}function _trackLCP(){return onLCP(Tr=>{const Cr=Tr.entries.pop();Cr&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Measurements] Adding LCP"),_measurements.lcp={value:Tr.value,unit:"millisecond"},_lcpEntry=Cr)})}function _trackFID(){onFID(Tr=>{const Cr=Tr.entries.pop();if(!Cr)return;const $r=msToSec(browserPerformanceTimeOrigin),Ar=msToSec(Cr.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Measurements] Adding FID"),_measurements.fid={value:Tr.value,unit:"millisecond"},_measurements["mark.fid"]={value:$r+Ar,unit:"second"}})}function addPerformanceEntries(Tr){const Cr=getBrowserPerformanceAPI();if(!Cr||!WINDOW.performance.getEntries||!browserPerformanceTimeOrigin)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Tracing] Adding & adjusting spans using Performance API");const $r=msToSec(browserPerformanceTimeOrigin),Ar=Cr.getEntries();let Rr,Dr;if(Ar.slice(_performanceCursor).forEach(Mr=>{const Br=msToSec(Mr.startTime),Nr=msToSec(Mr.duration);if(!(Tr.op==="navigation"&&$r+Br"u"||__SENTRY_DEBUG__)&&logger.log("[Measurements] Adding FP"),_measurements.fp={value:Mr.startTime,unit:"millisecond"}),Mr.name==="first-contentful-paint"&&Hr&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Measurements] Adding FCP"),_measurements.fcp={value:Mr.startTime,unit:"millisecond"});break}case"resource":{const Lr=Mr.name.replace(WINDOW.location.origin,"");_addResourceSpans(Tr,Mr,Lr,Br,Nr,$r);break}}}),_performanceCursor=Math.max(Ar.length-1,0),_trackNavigator(Tr),Tr.op==="pageload"){typeof Rr=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Measurements] Adding TTFB"),_measurements.ttfb={value:(Rr-Tr.startTimestamp)*1e3,unit:"millisecond"},typeof Dr=="number"&&Dr<=Rr&&(_measurements["ttfb.requestTime"]={value:(Rr-Dr)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(Br=>{if(!_measurements[Br]||$r>=Tr.startTimestamp)return;const Nr=_measurements[Br].value,Lr=$r+msToSec(Nr),Hr=Math.abs((Lr-Tr.startTimestamp)*1e3),zr=Hr-Nr;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`[Measurements] Normalized ${Br} from ${Nr} to ${Hr} (${zr})`),_measurements[Br].value=Hr});const Mr=_measurements["mark.fid"];Mr&&_measurements.fid&&(_startChild(Tr,{description:"first input delay",endTimestamp:Mr.value+msToSec(_measurements.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:Mr.value}),delete _measurements["mark.fid"]),"fcp"in _measurements||delete _measurements.cls,Object.keys(_measurements).forEach(Br=>{Tr.setMeasurement(Br,_measurements[Br].value,_measurements[Br].unit)}),_tagMetricInfo(Tr)}_lcpEntry=void 0,_clsEntry=void 0,_measurements={}}function _addMeasureSpans(Tr,Cr,$r,Ar,Rr){const Dr=Rr+$r,Mr=Dr+Ar;return _startChild(Tr,{description:Cr.name,endTimestamp:Mr,op:Cr.entryType,origin:"auto.resource.browser.metrics",startTimestamp:Dr}),Dr}function _addNavigationSpans(Tr,Cr,$r){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(Ar=>{_addPerformanceNavigationTiming(Tr,Cr,Ar,$r)}),_addPerformanceNavigationTiming(Tr,Cr,"secureConnection",$r,"TLS/SSL","connectEnd"),_addPerformanceNavigationTiming(Tr,Cr,"fetch",$r,"cache","domainLookupStart"),_addPerformanceNavigationTiming(Tr,Cr,"domainLookup",$r,"DNS"),_addRequest(Tr,Cr,$r)}function _addPerformanceNavigationTiming(Tr,Cr,$r,Ar,Rr,Dr){const Mr=Dr?Cr[Dr]:Cr[`${$r}End`],Br=Cr[`${$r}Start`];!Br||!Mr||_startChild(Tr,{op:"browser",origin:"auto.browser.browser.metrics",description:Rr||$r,startTimestamp:Ar+msToSec(Br),endTimestamp:Ar+msToSec(Mr)})}function _addRequest(Tr,Cr,$r){_startChild(Tr,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:$r+msToSec(Cr.requestStart),endTimestamp:$r+msToSec(Cr.responseEnd)}),_startChild(Tr,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:$r+msToSec(Cr.responseStart),endTimestamp:$r+msToSec(Cr.responseEnd)})}function _addResourceSpans(Tr,Cr,$r,Ar,Rr,Dr){if(Cr.initiatorType==="xmlhttprequest"||Cr.initiatorType==="fetch")return;const Mr={};"transferSize"in Cr&&(Mr["http.response_transfer_size"]=Cr.transferSize),"encodedBodySize"in Cr&&(Mr["http.response_content_length"]=Cr.encodedBodySize),"decodedBodySize"in Cr&&(Mr["http.decoded_response_content_length"]=Cr.decodedBodySize),"renderBlockingStatus"in Cr&&(Mr["resource.render_blocking_status"]=Cr.renderBlockingStatus);const Br=Dr+Ar,Nr=Br+Rr;_startChild(Tr,{description:$r,endTimestamp:Nr,op:Cr.initiatorType?`resource.${Cr.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:Br,data:Mr})}function _trackNavigator(Tr){const Cr=WINDOW.navigator;if(!Cr)return;const $r=Cr.connection;$r&&($r.effectiveType&&Tr.setTag("effectiveConnectionType",$r.effectiveType),$r.type&&Tr.setTag("connectionType",$r.type),isMeasurementValue($r.rtt)&&(_measurements["connection.rtt"]={value:$r.rtt,unit:"millisecond"})),isMeasurementValue(Cr.deviceMemory)&&Tr.setTag("deviceMemory",`${Cr.deviceMemory} GB`),isMeasurementValue(Cr.hardwareConcurrency)&&Tr.setTag("hardwareConcurrency",String(Cr.hardwareConcurrency))}function _tagMetricInfo(Tr){_lcpEntry&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Measurements] Adding LCP Data"),_lcpEntry.element&&Tr.setTag("lcp.element",htmlTreeAsString(_lcpEntry.element)),_lcpEntry.id&&Tr.setTag("lcp.id",_lcpEntry.id),_lcpEntry.url&&Tr.setTag("lcp.url",_lcpEntry.url.trim().slice(0,200)),Tr.setTag("lcp.size",_lcpEntry.size)),_clsEntry&&_clsEntry.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log("[Measurements] Adding CLS Data"),_clsEntry.sources.forEach((Cr,$r)=>Tr.setTag(`cls.source.${$r+1}`,htmlTreeAsString(Cr.node))))}const DEFAULT_TRACE_PROPAGATION_TARGETS=["localhost",/^\/(?!\/)/],defaultRequestInstrumentationOptions={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:DEFAULT_TRACE_PROPAGATION_TARGETS,tracePropagationTargets:DEFAULT_TRACE_PROPAGATION_TARGETS};function instrumentOutgoingRequests(Tr){const{traceFetch:Cr,traceXHR:$r,tracePropagationTargets:Ar,tracingOrigins:Rr,shouldCreateSpanForRequest:Dr,enableHTTPTimings:Mr}={traceFetch:defaultRequestInstrumentationOptions.traceFetch,traceXHR:defaultRequestInstrumentationOptions.traceXHR,...Tr},Br=typeof Dr=="function"?Dr:Hr=>!0,Nr=Hr=>shouldAttachHeaders(Hr,Ar||Rr),Lr={};Cr&&addInstrumentationHandler("fetch",Hr=>{const zr=fetchCallback(Hr,Br,Nr,Lr);Mr&&zr&&addHTTPTimings(zr)}),$r&&addInstrumentationHandler("xhr",Hr=>{const zr=xhrCallback(Hr,Br,Nr,Lr);Mr&&zr&&addHTTPTimings(zr)})}function isPerformanceResourceTiming(Tr){return Tr.entryType==="resource"&&"initiatorType"in Tr&&typeof Tr.nextHopProtocol=="string"&&(Tr.initiatorType==="fetch"||Tr.initiatorType==="xmlhttprequest")}function addHTTPTimings(Tr){const Cr=Tr.data.url,$r=new PerformanceObserver(Ar=>{Ar.getEntries().forEach(Dr=>{isPerformanceResourceTiming(Dr)&&Dr.name.endsWith(Cr)&&(resourceTimingEntryToSpanData(Dr).forEach(Br=>Tr.setData(...Br)),$r.disconnect())})});$r.observe({entryTypes:["resource"]})}function extractNetworkProtocol(Tr){let Cr="unknown",$r="unknown",Ar="";for(const Rr of Tr){if(Rr==="/"){[Cr,$r]=Tr.split("/");break}if(!isNaN(Number(Rr))){Cr=Ar==="h"?"http":Ar,$r=Tr.split(Ar)[1];break}Ar+=Rr}return Ar===Tr&&(Cr=Ar),{name:Cr,version:$r}}function getAbsoluteTime(Tr=0){return((browserPerformanceTimeOrigin||performance.timeOrigin)+Tr)/1e3}function resourceTimingEntryToSpanData(Tr){const{name:Cr,version:$r}=extractNetworkProtocol(Tr.nextHopProtocol),Ar=[];return Ar.push(["network.protocol.version",$r],["network.protocol.name",Cr]),browserPerformanceTimeOrigin?[...Ar,["http.request.redirect_start",getAbsoluteTime(Tr.redirectStart)],["http.request.fetch_start",getAbsoluteTime(Tr.fetchStart)],["http.request.domain_lookup_start",getAbsoluteTime(Tr.domainLookupStart)],["http.request.domain_lookup_end",getAbsoluteTime(Tr.domainLookupEnd)],["http.request.connect_start",getAbsoluteTime(Tr.connectStart)],["http.request.secure_connection_start",getAbsoluteTime(Tr.secureConnectionStart)],["http.request.connection_end",getAbsoluteTime(Tr.connectEnd)],["http.request.request_start",getAbsoluteTime(Tr.requestStart)],["http.request.response_start",getAbsoluteTime(Tr.responseStart)],["http.request.response_end",getAbsoluteTime(Tr.responseEnd)]]:Ar}function shouldAttachHeaders(Tr,Cr){return stringMatchesSomePattern(Tr,Cr||DEFAULT_TRACE_PROPAGATION_TARGETS)}function fetchCallback(Tr,Cr,$r,Ar){if(!hasTracingEnabled()||!Tr.fetchData)return;const Rr=Cr(Tr.fetchData.url);if(Tr.endTimestamp&&Rr){const Ur=Tr.fetchData.__span;if(!Ur)return;const Vr=Ar[Ur];if(Vr){if(Tr.response){Vr.setHttpStatus(Tr.response.status);const jr=Tr.response&&Tr.response.headers&&Tr.response.headers.get("content-length"),Gr=parseInt(jr);Gr>0&&Vr.setData("http.response_content_length",Gr)}else Tr.error&&Vr.setStatus("internal_error");Vr.finish(),delete Ar[Ur]}return}const Dr=getCurrentHub(),Mr=Dr.getScope(),Br=Dr.getClient(),Nr=Mr.getSpan(),{method:Lr,url:Hr}=Tr.fetchData,zr=Rr&&Nr?Nr.startChild({data:{url:Hr,type:"fetch","http.method":Lr},description:`${Lr} ${Hr}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(zr&&(Tr.fetchData.__span=zr.spanId,Ar[zr.spanId]=zr),$r(Tr.fetchData.url)&&Br){const Ur=Tr.args[0];Tr.args[1]=Tr.args[1]||{};const Vr=Tr.args[1];Vr.headers=addTracingHeadersToFetchRequest(Ur,Br,Mr,Vr,zr)}return zr}function addTracingHeadersToFetchRequest(Tr,Cr,$r,Ar,Rr){const Dr=Rr||$r.getSpan(),Mr=Dr&&Dr.transaction,{traceId:Br,sampled:Nr,dsc:Lr}=$r.getPropagationContext(),Hr=Dr?Dr.toTraceparent():generateSentryTraceHeader(Br,void 0,Nr),zr=Mr?Mr.getDynamicSamplingContext():Lr||getDynamicSamplingContextFromClient(Br,Cr,$r),Ur=dynamicSamplingContextToSentryBaggageHeader(zr),Vr=typeof Request<"u"&&isInstanceOf(Tr,Request)?Tr.headers:Ar.headers;if(Vr)if(typeof Headers<"u"&&isInstanceOf(Vr,Headers)){const jr=new Headers(Vr);return jr.append("sentry-trace",Hr),Ur&&jr.append(BAGGAGE_HEADER_NAME,Ur),jr}else if(Array.isArray(Vr)){const jr=[...Vr,["sentry-trace",Hr]];return Ur&&jr.push([BAGGAGE_HEADER_NAME,Ur]),jr}else{const jr="baggage"in Vr?Vr.baggage:void 0,Gr=[];return Array.isArray(jr)?Gr.push(...jr):jr&&Gr.push(jr),Ur&&Gr.push(Ur),{...Vr,"sentry-trace":Hr,baggage:Gr.length>0?Gr.join(","):void 0}}else return{"sentry-trace":Hr,baggage:Ur}}function xhrCallback(Tr,Cr,$r,Ar){const Rr=Tr.xhr,Dr=Rr&&Rr[SENTRY_XHR_DATA_KEY];if(!hasTracingEnabled()||Rr&&Rr.__sentry_own_request__||!Rr||!Dr)return;const Mr=Cr(Dr.url);if(Tr.endTimestamp&&Mr){const zr=Rr.__sentry_xhr_span_id__;if(!zr)return;const Ur=Ar[zr];Ur&&(Ur.setHttpStatus(Dr.status_code),Ur.finish(),delete Ar[zr]);return}const Br=getCurrentHub(),Nr=Br.getScope(),Lr=Nr.getSpan(),Hr=Mr&&Lr?Lr.startChild({data:{...Dr.data,type:"xhr","http.method":Dr.method,url:Dr.url},description:`${Dr.method} ${Dr.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(Hr&&(Rr.__sentry_xhr_span_id__=Hr.spanId,Ar[Rr.__sentry_xhr_span_id__]=Hr),Rr.setRequestHeader&&$r(Dr.url))if(Hr){const zr=Hr&&Hr.transaction,Ur=zr&&zr.getDynamicSamplingContext(),Vr=dynamicSamplingContextToSentryBaggageHeader(Ur);setHeaderOnXhr(Rr,Hr.toTraceparent(),Vr)}else{const zr=Br.getClient(),{traceId:Ur,sampled:Vr,dsc:jr}=Nr.getPropagationContext(),Gr=generateSentryTraceHeader(Ur,void 0,Vr),Xr=jr||(zr?getDynamicSamplingContextFromClient(Ur,zr,Nr):void 0),Kr=dynamicSamplingContextToSentryBaggageHeader(Xr);setHeaderOnXhr(Rr,Gr,Kr)}return Hr}function setHeaderOnXhr(Tr,Cr,$r){try{Tr.setRequestHeader("sentry-trace",Cr),$r&&Tr.setRequestHeader(BAGGAGE_HEADER_NAME,$r)}catch{}}function instrumentRoutingWithDefaults(Tr,Cr=!0,$r=!0){if(!WINDOW||!WINDOW.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn("Could not initialize routing instrumentation due to invalid location");return}let Ar=WINDOW.location.href,Rr;Cr&&(Rr=Tr({name:WINDOW.location.pathname,startTimestamp:browserPerformanceTimeOrigin?browserPerformanceTimeOrigin/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),$r&&addInstrumentationHandler("history",({to:Dr,from:Mr})=>{if(Mr===void 0&&Ar&&Ar.indexOf(Dr)!==-1){Ar=void 0;return}Mr!==Dr&&(Ar=void 0,Rr&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`[Tracing] Finishing current transaction with op: ${Rr.op}`),Rr.finish()),Rr=Tr({name:WINDOW.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}const BROWSER_TRACING_INTEGRATION_ID="BrowserTracing",DEFAULT_BROWSER_TRACING_OPTIONS={...TRACING_DEFAULTS,markBackgroundTransactions:!0,routingInstrumentation:instrumentRoutingWithDefaults,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...defaultRequestInstrumentationOptions};class BrowserTracing{constructor(Cr){this.name=BROWSER_TRACING_INTEGRATION_ID,this._hasSetTracePropagationTargets=!1,addTracingExtensions(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(Cr&&(Cr.tracePropagationTargets||Cr.tracingOrigins))),this.options={...DEFAULT_BROWSER_TRACING_OPTIONS,...Cr},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),Cr&&!Cr.tracePropagationTargets&&Cr.tracingOrigins&&(this.options.tracePropagationTargets=Cr.tracingOrigins),this._collectWebVitals=startTrackingWebVitals(),this.options.enableLongTask&&startTrackingLongTasks(),this.options._experiments.enableInteractions&&startTrackingInteractions()}setupOnce(Cr,$r){this._getCurrentHub=$r;const Rr=$r().getClient(),Dr=Rr&&Rr.getOptions(),{routingInstrumentation:Mr,startTransactionOnLocationChange:Br,startTransactionOnPageLoad:Nr,markBackgroundTransactions:Lr,traceFetch:Hr,traceXHR:zr,shouldCreateSpanForRequest:Ur,enableHTTPTimings:Vr,_experiments:jr}=this.options,Gr=Dr&&Dr.tracePropagationTargets,Xr=Gr||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&Gr&&logger.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),Mr(Kr=>{const Zr=this._createRouteTransaction(Kr);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(Zr,Kr,$r),Zr},Nr,Br),Lr&®isterBackgroundTabDetection(),jr.enableInteractions&&this._registerInteractionListener(),instrumentOutgoingRequests({traceFetch:Hr,traceXHR:zr,tracePropagationTargets:Xr,shouldCreateSpanForRequest:Ur,enableHTTPTimings:Vr})}_createRouteTransaction(Cr){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`[Tracing] Did not create ${Cr.op} transaction because _getCurrentHub is invalid.`);return}const $r=this._getCurrentHub(),{beforeNavigate:Ar,idleTimeout:Rr,finalTimeout:Dr,heartbeatInterval:Mr}=this.options,Br=Cr.op==="pageload",Nr=Br?getMetaContent("sentry-trace"):"",Lr=Br?getMetaContent("baggage"):"",{traceparentData:Hr,dynamicSamplingContext:zr,propagationContext:Ur}=tracingContextFromHeaders(Nr,Lr),Vr={...Cr,...Hr,metadata:{...Cr.metadata,dynamicSamplingContext:Hr&&!zr?{}:zr},trimEnd:!0},jr=typeof Ar=="function"?Ar(Vr):Vr,Gr=jr===void 0?{...Vr,sampled:!1}:jr;Gr.metadata=Gr.name!==Vr.name?{...Gr.metadata,source:"custom"}:Gr.metadata,this._latestRouteName=Gr.name,this._latestRouteSource=Gr.metadata&&Gr.metadata.source,Gr.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`[Tracing] Will not send ${Gr.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.log(`[Tracing] Starting ${Gr.op} transaction on scope`);const{location:Xr}=WINDOW,Kr=startIdleTransaction($r,Gr,Rr,Dr,!0,{location:Xr},Mr),Zr=$r.getScope();return Br&&Hr?Zr.setPropagationContext(Ur):Zr.setPropagationContext({traceId:Kr.traceId,spanId:Kr.spanId,parentSpanId:Kr.parentSpanId,sampled:Kr.sampled}),Kr.registerBeforeFinishCallback(eo=>{this._collectWebVitals(),addPerformanceEntries(eo)}),Kr}_registerInteractionListener(){let Cr;const $r=()=>{const{idleTimeout:Ar,finalTimeout:Rr,heartbeatInterval:Dr}=this.options,Mr="ui.action.click",Br=getActiveTransaction$1();if(Br&&Br.op&&["navigation","pageload"].includes(Br.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`[Tracing] Did not create ${Mr} transaction because a pageload or navigation transaction is in progress.`);return}if(Cr&&(Cr.setFinishReason("interactionInterrupted"),Cr.finish(),Cr=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`[Tracing] Did not create ${Mr} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`[Tracing] Did not create ${Mr} transaction because _latestRouteName is missing.`);return}const Nr=this._getCurrentHub(),{location:Lr}=WINDOW,Hr={name:this._latestRouteName,op:Mr,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};Cr=startIdleTransaction(Nr,Hr,Ar,Rr,!0,{location:Lr},Dr)};["click"].forEach(Ar=>{addEventListener(Ar,$r,{once:!1,capture:!0})})}}function getMetaContent(Tr){const Cr=getDomElement(`meta[name=${Tr}]`);return Cr?Cr.getAttribute("content"):void 0}const DEFAULT_HOOKS=["activate","mount","update"],classifyRE=/(?:^|[-_])(\w)/g,classify=Tr=>Tr.replace(classifyRE,Cr=>Cr.toUpperCase()).replace(/[-_]/g,""),ROOT_COMPONENT_NAME="",ANONYMOUS_COMPONENT_NAME="",repeat=(Tr,Cr)=>Tr.repeat?Tr.repeat(Cr):Tr,formatComponentName=(Tr,Cr)=>{if(!Tr)return ANONYMOUS_COMPONENT_NAME;if(Tr.$root===Tr)return ROOT_COMPONENT_NAME;if(!Tr.$options)return ANONYMOUS_COMPONENT_NAME;const $r=Tr.$options;let Ar=$r.name||$r._componentTag;const Rr=$r.__file;if(!Ar&&Rr){const Dr=Rr.match(/([^/\\]+)\.vue$/);Dr&&(Ar=Dr[1])}return(Ar?`<${classify(Ar)}>`:ANONYMOUS_COMPONENT_NAME)+(Rr&&Cr!==!1?` at ${Rr}`:"")},generateComponentTrace=Tr=>{if(Tr&&(Tr._isVue||Tr.__isVue)&&Tr.$parent){const Cr=[];let $r=0;for(;Tr;){if(Cr.length>0){const Rr=Cr[Cr.length-1];if(Rr.constructor===Tr.constructor){$r++,Tr=Tr.$parent;continue}else $r>0&&(Cr[Cr.length-1]=[Rr,$r],$r=0)}Cr.push(Tr),Tr=Tr.$parent}return` found in ${Cr.map((Rr,Dr)=>`${(Dr===0?"---> ":repeat(" ",5+Dr*2))+(Array.isArray(Rr)?`${formatComponentName(Rr[0])}... (${Rr[1]} recursive calls)`:formatComponentName(Rr))}`).join(` `)}`}return` (found in ${formatComponentName(Tr)})`},attachErrorHandler=(Tr,Cr)=>{const{errorHandler:$r,warnHandler:Ar,silent:Rr}=Tr.config;Tr.config.errorHandler=(Dr,Mr,Br)=>{const Nr=formatComponentName(Mr,!1),Lr=Mr?generateComponentTrace(Mr):"",Hr={componentName:Nr,lifecycleHook:Br,trace:Lr};if(Cr.attachProps&&Mr&&(Mr.$options&&Mr.$options.propsData?Hr.propsData=Mr.$options.propsData:Mr.$props&&(Hr.propsData=Mr.$props)),setTimeout(()=>{getCurrentHub().withScope(zr=>{zr.setContext("vue",Hr),zr.addEventProcessor(Ur=>(addExceptionMechanism(Ur,{handled:!1}),Ur)),getCurrentHub().captureException(Dr)})}),typeof $r=="function"&&$r.call(Tr,Dr,Mr,Br),Cr.logErrors){const zr=typeof console<"u",Ur=`Error in ${Br}: "${Dr&&Dr.toString()}"`;Ar?Ar.call(null,Ur,Mr,Lr):zr&&!Rr&&console.error(`[Vue warn]: ${Ur}${Lr}`)}}},VUE_OP="ui.vue",HOOKS={activate:["activated","deactivated"],create:["beforeCreate","created"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]};function getActiveTransaction(){return getCurrentHub().getScope().getTransaction()}function finishRootSpan(Tr,Cr,$r){Tr.$_sentryRootSpanTimer&&clearTimeout(Tr.$_sentryRootSpanTimer),Tr.$_sentryRootSpanTimer=setTimeout(()=>{Tr.$root&&Tr.$root.$_sentryRootSpan&&(Tr.$root.$_sentryRootSpan.finish(Cr),Tr.$root.$_sentryRootSpan=void 0)},$r)}const createTracingMixins=Tr=>{const Cr=(Tr.hooks||[]).concat(DEFAULT_HOOKS).filter((Ar,Rr,Dr)=>Dr.indexOf(Ar)===Rr),$r={};for(const Ar of Cr){const Rr=HOOKS[Ar];if(!Rr){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&logger.warn(`Unknown hook: ${Ar}`);continue}for(const Dr of Rr)$r[Dr]=function(){const Mr=this.$root===this;if(Mr){const Lr=getActiveTransaction();Lr&&(this.$_sentryRootSpan=this.$_sentryRootSpan||Lr.startChild({description:"Application Render",op:`${VUE_OP}.render`,origin:"auto.ui.vue"}))}const Br=formatComponentName(this,!1),Nr=Array.isArray(Tr.trackComponents)?Tr.trackComponents.indexOf(Br)>-1:Tr.trackComponents;if(!(!Mr&&!Nr))if(this.$_sentrySpans=this.$_sentrySpans||{},Dr==Rr[0]){const Lr=this.$root&&this.$root.$_sentryRootSpan||getActiveTransaction();if(Lr){const Hr=this.$_sentrySpans[Ar];Hr&&!Hr.endTimestamp&&Hr.finish(),this.$_sentrySpans[Ar]=Lr.startChild({description:`Vue <${Br}>`,op:`${VUE_OP}.${Ar}`,origin:"auto.ui.vue"})}}else{const Lr=this.$_sentrySpans[Ar];if(!Lr)return;Lr.finish(),finishRootSpan(this,timestampInSeconds(),Tr.timeout)}}}return $r},globalWithVue=GLOBAL_OBJ,DEFAULT_CONFIG={Vue:globalWithVue.Vue,attachProps:!0,logErrors:!0,hooks:DEFAULT_HOOKS,timeout:2e3,trackComponents:!1,_metadata:{sdk:{name:"sentry.javascript.vue",packages:[{name:"npm:@sentry/vue",version:SDK_VERSION}],version:SDK_VERSION}}};function init$3(Tr={}){const Cr={...DEFAULT_CONFIG,...Tr};if(init$4(Cr),!Cr.Vue&&!Cr.app){console.warn("[@sentry/vue]: Misconfigured SDK. Vue specific errors will not be captured.\nUpdate your `Sentry.init` call with an appropriate config option:\n`app` (Application Instance - Vue 3) or `Vue` (Vue Constructor - Vue 2).");return}Cr.app?arrayify(Cr.app).forEach(Ar=>vueInit(Ar,Cr)):Cr.Vue&&vueInit(Cr.Vue,Cr)}const vueInit=(Tr,Cr)=>{const $r=Tr;($r._instance&&$r._instance.isMounted)===!0&&console.warn("[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`."),attachErrorHandler(Tr,Cr),hasTracingEnabled(Cr)&&Tr.mixin(createTracingMixins({...Cr,...Cr.tracingOptions}))};function vueRouterInstrumentation(Tr,Cr={}){return($r,Ar=!0,Rr=!0)=>{const Dr={"routing.instrumentation":"vue-router"};Ar&&WINDOW$2&&WINDOW$2.location&&$r({name:WINDOW$2.location.pathname,op:"pageload",origin:"auto.pageload.vue",tags:Dr,metadata:{source:"url"}}),Tr.onError(Mr=>captureException(Mr,Br=>(Br.addEventProcessor(Nr=>(addExceptionMechanism(Nr,{handled:!1}),Nr)),Br))),Tr.beforeEach((Mr,Br,Nr)=>{const Lr=Br.name==null&&Br.matched.length===0,Hr={params:Mr.params,query:Mr.query};let zr=Mr.path,Ur="url";if(Mr.name&&Cr.routeLabel!=="path"?(zr=Mr.name.toString(),Ur="custom"):Mr.matched[0]&&Mr.matched[0].path&&(zr=Mr.matched[0].path,Ur="route"),Ar&&Lr){const Vr=getActiveTransaction();Vr&&(Vr.metadata.source!=="custom"&&Vr.setName(zr,Ur),Vr.setData("params",Hr.params),Vr.setData("query",Hr.query))}Rr&&!Lr&&$r({name:zr,op:"navigation",origin:"auto.navigation.vue",tags:Dr,data:Hr,metadata:{source:Ur}}),Nr&&Nr()})}}const sentry_client_KAXFuL2wum=defineNuxtPlugin({parallel:!0,setup:Tr=>{typeof window>"u"||(init$3({app:Tr.vueApp,enabled:!0,autoSessionTracking:!0,dsn:"https://a0bc50c725e04e4487a3cc3b20a65aef@o1358848.ingest.sentry.io/4504446056595456",integrations:[new BrowserTracing({routingInstrumentation:vueRouterInstrumentation(Tr.$router,{routeLabel:"path"})}),new CaptureConsole({levels:["log","info","warn","error","debug","assert"]}),new Replay({networkDetailAllowUrls:[`https//${Tr.$config.public.HOST_NAME}`]}),new HttpClient,new ReportingObserver],tracePropagationTargets:["prezo.ai","app.prezo.ai","dev.prezo.ai","staging.prezo.ai","staging-prezo-internal.prezo.ai","prezo.onrender.com",/^\//],trackComponents:!0,hooks:["activate","create","destroy","mount","update"],tracesSampleRate:1,replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1}),Tr.vueApp.config.errorHandler=(Cr,$r)=>{withScope(Ar=>{Ar.setExtra("context",$r),captureException(Cr)})},Tr.hook("app:error",Cr=>{captureException(Cr)}))}}),plugins=[revive_payload_client_LfbzBmzgKb,unhead_rdNvA7eRRi,plugin$1,payload_client_BepdcSrOvP,plugin,components_plugin_KR1HBZs4kY,prefetch_client_HWMLMRgvmh,floating_vue_EIcJ7xiw0h,chunk_reload_client_YuJIVqNNev,main_V1WRBXUL9I,posthog_client_uL8DpUhgsW,sentry_client_KAXFuL2wum],__nuxt_component_0=defineComponent({name:"ClientOnly",inheritAttrs:!1,props:["fallback","placeholder","placeholderTag","fallbackTag"],setup(Tr,{slots:Cr,attrs:$r}){const Ar=ref(!1);return onMounted(()=>{Ar.value=!0}),Rr=>{var Nr;if(Ar.value)return(Nr=Cr.default)==null?void 0:Nr.call(Cr);const Dr=Cr.fallback||Cr.placeholder;if(Dr)return Dr();const Mr=Rr.fallback||Rr.placeholder||"",Br=Rr.fallbackTag||Rr.placeholderTag||"span";return createElementBlock(Br,$r,Mr)}}}),_wrapIf=(Tr,Cr,$r)=>(Cr=Cr===!0?{}:Cr,{default:()=>{var Ar;return Cr?h$5(Tr,Cr,$r):(Ar=$r.default)==null?void 0:Ar.call($r)}}),LayoutLoader=defineComponent({name:"LayoutLoader",inheritAttrs:!1,props:{name:String,layoutProps:Object},async setup(Tr,Cr){const $r=await layouts[Tr.name]().then(Ar=>Ar.default||Ar);return()=>h$5($r,Tr.layoutProps,Cr.slots)}}),NuxtLayout=defineComponent({name:"NuxtLayout",inheritAttrs:!1,props:{name:{type:[String,Boolean,Object],default:null}},setup(Tr,Cr){const $r=useNuxtApp(),Ar=inject(PageRouteSymbol),Rr=Ar===useRoute$1()?useRoute():Ar,Dr=computed(()=>unref(Tr.name)??Rr.meta.layout??"default"),Mr=ref();Cr.expose({layoutRef:Mr});const Br=$r.deferHydration();return()=>{const Nr=Dr.value&&Dr.value in layouts,Lr=Rr.meta.layoutTransition??appLayoutTransition;return _wrapIf(Transition,Nr&&Lr,{default:()=>h$5(Suspense,{suspensible:!0,onResolve:()=>{nextTick(Br)}},{default:()=>h$5(LayoutProvider,{layoutProps:mergeProps(Cr.attrs,{ref:Mr}),key:Dr.value,name:Dr.value,shouldProvide:!Tr.name,hasTransition:!!Lr},Cr.slots)})}).default()}}}),LayoutProvider=defineComponent({name:"NuxtLayoutProvider",inheritAttrs:!1,props:{name:{type:[String,Boolean]},layoutProps:{type:Object},hasTransition:{type:Boolean},shouldProvide:{type:Boolean}},setup(Tr,Cr){const $r=Tr.name;return Tr.shouldProvide&&provide(LayoutMetaSymbol,{isCurrent:Ar=>$r===(Ar.meta.layout??"default")}),()=>{var Ar,Rr;return!$r||typeof $r=="string"&&!($r in layouts)?(Rr=(Ar=Cr.slots).default)==null?void 0:Rr.call(Ar):h$5(LayoutLoader,{key:$r,layoutProps:Tr.layoutProps,name:$r},Cr.slots)}}}),interpolatePath=(Tr,Cr)=>Cr.path.replace(/(:\w+)\([^)]+\)/g,"$1").replace(/(:\w+)[?+*]/g,"$1").replace(/:\w+/g,$r=>{var Ar;return((Ar=Tr.params[$r.slice(1)])==null?void 0:Ar.toString())||""}),generateRouteKey=(Tr,Cr)=>{const $r=Tr.route.matched.find(Rr=>{var Dr;return((Dr=Rr.components)==null?void 0:Dr.default)===Tr.Component.type}),Ar=Cr??($r==null?void 0:$r.meta.key)??($r&&interpolatePath(Tr.route,$r));return typeof Ar=="function"?Ar(Tr.route):Ar},wrapInKeepAlive=(Tr,Cr)=>({default:()=>Tr?h$5(KeepAlive,Tr===!0?{}:Tr,Cr):Cr}),RouteProvider=defineComponent({name:"RouteProvider",props:{vnode:{type:Object,required:!0},route:{type:Object,required:!0},vnodeRef:Object,renderKey:String,trackRootNodes:Boolean},setup(Tr){const Cr=Tr.renderKey,$r=Tr.route,Ar={};for(const Rr in Tr.route)Object.defineProperty(Ar,Rr,{get:()=>Cr===Tr.renderKey?Tr.route[Rr]:$r[Rr]});return provide(PageRouteSymbol,shallowReactive(Ar)),()=>h$5(Tr.vnode,{ref:Tr.vnodeRef})}}),NuxtPage=defineComponent({name:"NuxtPage",inheritAttrs:!1,props:{name:{type:String},transition:{type:[Boolean,Object],default:void 0},keepalive:{type:[Boolean,Object],default:void 0},route:{type:Object},pageKey:{type:[Function,String],default:null}},setup(Tr,{attrs:Cr,expose:$r}){const Ar=useNuxtApp(),Rr=ref(),Dr=inject(PageRouteSymbol,null);$r({pageRef:Rr});const Mr=inject(LayoutMetaSymbol,null);let Br;const Nr=Ar.deferHydration();return()=>h$5(RouterView,{name:Tr.name,route:Tr.route,...Cr},{default:Lr=>{const Hr=haveParentRoutesRendered(Dr,Lr.route,Lr.Component),zr=Dr&&Dr.matched.length===Lr.route.matched.length;if(!Lr.Component)return Br&&!zr?Br:void 0;if(Br&&Mr&&!Mr.isCurrent(Lr.route))return Br;if(Hr&&Dr&&(!Mr||Mr!=null&&Mr.isCurrent(Dr)))return zr?Br:null;const Ur=generateRouteKey(Lr,Tr.pageKey),Vr=!!(Tr.transition??Lr.route.meta.pageTransition??appPageTransition),jr=Vr&&_mergeTransitionProps([Tr.transition,Lr.route.meta.pageTransition,appPageTransition,{onAfterLeave:()=>{Ar.callHook("page:transition:finish",Lr.Component)}}].filter(Boolean));return Br=_wrapIf(Transition,Vr&&jr,wrapInKeepAlive(Tr.keepalive??Lr.route.meta.keepalive??appKeepalive,h$5(Suspense,{suspensible:!0,onPending:()=>Ar.callHook("page:start",Lr.Component),onResolve:()=>{nextTick(()=>Ar.callHook("page:finish",Lr.Component).finally(Nr))}},{default:()=>h$5(RouteProvider,{key:Ur,vnode:Lr.Component,route:Lr.route,renderKey:Ur,trackRootNodes:Vr,vnodeRef:Rr})}))).default(),Br}})}});function _toArray(Tr){return Array.isArray(Tr)?Tr:Tr?[Tr]:[]}function _mergeTransitionProps(Tr){const Cr=Tr.map($r=>({...$r,onAfterLeave:_toArray($r.onAfterLeave)}));return defu(...Cr)}function haveParentRoutesRendered(Tr,Cr,$r){if(!Tr)return!1;const Ar=Cr.matched.findIndex(Rr=>{var Dr;return((Dr=Rr.components)==null?void 0:Dr.default)===($r==null?void 0:$r.type)});return!Ar||Ar===-1?!1:Cr.matched.slice(0,Ar).some((Rr,Dr)=>{var Mr,Br,Nr;return((Mr=Rr.components)==null?void 0:Mr.default)!==((Nr=(Br=Tr.matched[Dr])==null?void 0:Br.components)==null?void 0:Nr.default)})||$r&&generateRouteKey({route:Cr,Component:$r})!==generateRouteKey({route:Tr,Component:$r})}const useCommandBarStore=defineStore("commandBarStore",{state:()=>({data:{},showSuggestions:{deckGen:!1,image:!0,text:!0},actionButtons:[{id:"tryAgain",text:"Try again (⌘G)"},{id:"accept",text:"Accept"},{id:"decline",text:"Decline"},{id:"holdState",text:"Choose the variant"}],isCommandBarOpen:!1,isCommandBarFocused:!1,isCommandBarPressed:!1,isCommandBarToBeActivated:!1,trigger:void 0,isTyping:!1,animationKey:{}}),getters:{getLatestCmd:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.latestCmd)||null},getMode:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.mode)||"input"},getNotification:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.notification)||{text:"",type:"neutral",actions:[]}},getIsNotifPopoverShowing:Tr=>Cr=>{var $r,Ar,Rr;return(($r=Tr.data[Cr])==null?void 0:$r.mode)==="notification"&&((Rr=(Ar=Tr.data[Cr])==null?void 0:Ar.notification)==null?void 0:Rr.type)!=="neutral"},getPopoverMode:Tr=>Cr=>{var $r;return(($r=Tr.data[Cr])==null?void 0:$r.popoverMode)||null},getIsCommandBarOpen:Tr=>Tr.isCommandBarOpen,getIsCommandBarFocused:Tr=>Tr.isCommandBarFocused,getIsCommandBarPressed:Tr=>Tr.isCommandBarPressed,getIsCommandBarToBeActivated:Tr=>Tr.isCommandBarToBeActivated,getIsTyping:Tr=>Tr.isTyping,getAnimationKey:Tr=>Cr=>Tr.animationKey[Cr],isShowingUsefulNoti(){return Tr=>this.getMode(Tr)==="notification"},getInProgressText:()=>Tr=>{if(!Tr)return"In progress";switch(Tr){case"rewrite":return"Rewriting...";case"make longer":return"Extending...";case"make shorter":return"Reducing...";case"add text block":return"Generating block...";case"change image style":case"regenerate image":case"add image":return"Generating images...";case"add new slide":case"regenerate slide":case"createNewSlide":return"Generating...";case"modifySlide":return"Modifying...";case"deleteSlide":return"Deleting...";case"summarize the deck":return"Summarizing...";default:return"In progress..."}},getDoneItems:()=>(Tr,{retry:Cr=!1,plural:$r=!1}={})=>{const Ar=["decline","tryAgain"];if(!Tr)return{text:"Done",actions:Ar};switch(Tr){case"rewrite":return{text:"Text was rewritten",actions:Ar};case"make longer":return{text:"Text was extended",actions:Ar};case"make shorter":return{text:"Text was reduced",actions:Ar};case"add text block":return Cr?{text:"Block was rewritten",actions:Ar}:{text:"Block was generated",actions:Ar};case"regenerate image":case"add image":return{text:"Image was generated",actions:Ar};case"regenerate slide":return{text:"Slide was regenerated",actions:Ar};case"summarize the deck":return{text:"Summary was generated",actions:Ar};case"add new slide":case"createNewSlide":return $r?{text:"Slides were generated",actions:Ar}:{text:"Slide was generated",actions:Ar};case"deleteSlide":{const Rr=["decline"];return $r?{text:"Slides were deleted",actions:Rr}:{text:"Slide was deleted",actions:Rr}}default:return{text:"Done",actions:Ar}}},getDoneItems2:Tr=>(Cr,$r)=>{const Ar=["decline","tryAgain"],Rr=Tr.data[$r].doneMsg??"Done";if(!Cr)return{text:Rr,actions:Ar};switch(Cr){case"deckGen":case"createNewPresentation":case"convertDocumentToPresentation":return{text:Rr,actions:[]};case"addSlides":case"modifySlides":return{text:Rr,actions:Ar};case"deleteSlide":return{text:Rr,actions:["decline"]};default:return{text:"Done",actions:["decline"]}}}},actions:{setDoneMsgToShow({deckId:Tr,msg:Cr}){this.data[Tr]==null&&this.initializeDeck({deckId:Tr}),this.data[Tr].doneMsg=Cr},initializeDeck({deckId:Tr}){this.data[Tr]==null&&(this.data[Tr]={latestCmd:null,mode:"input",notification:{text:"",subtext:"",type:"neutral",actions:[]},popoverMode:null,timeoutId:void 0})},setMode({mode:Tr,deckId:Cr}){this.data[Cr]==null&&this.initializeDeck({deckId:Cr}),this.data[Cr].mode=Tr},setPopoverMode({popoverMode:Tr,deckId:Cr}){this.data[Cr]==null&&this.initializeDeck({deckId:Cr}),this.data[Cr].popoverMode=Tr},setLatestCmd({cmd:Tr,deckId:Cr}){this.data[Cr]==null&&this.initializeDeck({deckId:Cr}),this.data[Cr].latestCmd=Tr},setNotification({notification:Tr,deckId:Cr}){this.data[Cr]==null&&this.initializeDeck({deckId:Cr}),this.data[Cr].notification=Tr},resetNotification({deckId:Tr}){this.data[Tr]==null&&this.initializeDeck({deckId:Tr}),this.data[Tr].notification={text:"",type:"neutral",actions:[]},this.setMode({mode:"input",deckId:Tr}),this.data[Tr].timeoutId&&clearTimeout(this.data[Tr].timeoutId)},getActionsFromIds(Tr){return Tr.map(Cr=>{const $r=this.actionButtons.find(Ar=>Ar.id===Cr);return $r||{id:Cr,text:Cr}})},setDoneNotification({deckId:Tr,text:Cr="Done",actions:$r=["tryAgain"],timeout:Ar}){this.data[Tr]==null&&this.initializeDeck({deckId:Tr}),this.data[Tr].notification={text:Cr,type:"success",actions:this.getActionsFromIds($r)},Ar===void 0?this.data[Tr].timeoutId=setTimeout(()=>{this.setMode({mode:"input",deckId:Tr})},6e4):Ar&&(this.data[Tr].timeoutId=setTimeout(()=>{this.setMode({mode:"input",deckId:Tr})},Ar)),this.setSuccessAnimationKey(Tr)},setInProgressNotification({deckId:Tr,subtext:Cr=null,text:$r="In progress",actions:Ar=[]}){this.data[Tr]==null&&this.initializeDeck({deckId:Tr}),this.data[Tr].notification={text:$r,subtext:Cr,type:"neutral",actions:this.getActionsFromIds(Ar)},this.setMode({mode:"notification",deckId:Tr}),this.data[Tr].timeoutId&&clearTimeout(this.data[Tr].timeoutId),this.setLoadingAnimationKey(Tr)},setErrorNotification({deckId:Tr,text:Cr="Sorry, something went wrong",actions:$r=["tryAgain"]}){this.data[Tr]==null&&this.initializeDeck({deckId:Tr}),this.data[Tr].notification={text:Cr,type:"error",actions:this.getActionsFromIds($r)},setTimeout(()=>{this.setMode({mode:"input",deckId:Tr})},6e4),this.setErrorAnimationKey(Tr)},toggleCommandBar(){this.isCommandBarOpen=!this.isCommandBarOpen},setCommandBarOpen(Tr){this.isCommandBarOpen=Tr},setCommandBarFocused(Tr){this.isCommandBarFocused=Tr},setCommandBarPressed(Tr){this.isCommandBarPressed=Tr},setCommandBarToBeActivated(Tr){this.isCommandBarToBeActivated=Tr},triggerOpen(Tr){this.trigger={id:guid(),...Tr}},setIsTyping(Tr){this.isTyping=Tr},setAnimationKey({id:Tr,key:Cr}){this.animationKey[Tr]=Cr},setErrorAnimationKey(Tr){this.animationKey[Tr]="chathouse_error"},setThinkingAnimationKey(Tr){this.animationKey[Tr]="chathouse_thinking_default_to_left"},setSuccessAnimationKey(Tr,Cr=!1){Cr?(this.animationKey[Tr]=void 0,setTimeout(()=>{this.animationKey[Tr]="chathouse_success"},100)):this.animationKey[Tr]="chathouse_success"},setLoadingAnimationKey(Tr){this.animationKey[Tr]="loading"},isAnimationAboutThinking(Tr){var Cr;return(Cr=this.animationKey[Tr])==null?void 0:Cr.includes("thinking")},setNextThinkingAnimationKey(Tr){if(this.animationKey[Tr]==null||!this.isAnimationAboutThinking(Tr))return;const Cr=["chathouse_thinking_default_to_left","chathouse_thinking_left_to_right","chathouse_thinking_right_to_left","chathouse_thinking_left_to_default","chathouse_thinking_right_to_default"],$r=Cr.findIndex(Rr=>Rr===this.animationKey[Tr]);if($r===-1)return;const Ar=($r+1)%Cr.length;this.animationKey[Tr]=Cr[Ar]}}}),resolveUnref$1=Tr=>typeof Tr=="function"?Tr():unref(Tr),getCategoryByWidth=Tr=>Tr{var Cr;return((Cr=layout.state.deviceCategoryConfig[Tr])==null?void 0:Cr.maxWidth)??1200},getDefaultHeightByCategory=Tr=>{var Cr;return((Cr=layout.state.deviceCategoryConfig[Tr])==null?void 0:Cr.defaultHeight)??700},useWindowCategory=Tr=>{const{width:Cr,height:$r}=useWindowSize(),Ar=ref(resolveUnref$1(Tr.displayMode)??"laptop");(resolveUnref$1(Tr.isFullScreen)??!1)||(resolveUnref$1(Tr.isFullPage)??!1)||resolveUnref$1(Tr.isEmbed),resolveUnref$1(Tr.isFullPage);const Rr=resolveUnref$1(Tr.isEmbed)??!1,Dr=useCommandBarStore(),Mr=computed(()=>Dr.getIsCommandBarOpen),Br=()=>{Ar.value=getCategoryByWidth(Cr.value),resolveUnref$1(Tr.displayMode)!=null&&(layout.state.deviceCategoryConfig[Ar.value].breakpoint>layout.state.deviceCategoryConfig[resolveUnref$1(Tr.displayMode)].breakpoint&&(Ar.value=resolveUnref$1(Tr.displayMode)),Ar.value=resolveUnref$1(Tr.displayMode),Rr||(Cr.value-=layout.state.artboardHorizontalPadding),$r.value-=layout.state.artboardVerticalPadding,$r.value*=.95,Cr.value*=.95)};return Br(),useEventListener("resize",Br,{passive:!0}),watch(Mr,Br),{category:Ar,width:Cr,height:$r}},useMaxAppWidth=Tr=>{const{category:Cr,width:$r,height:Ar}=useWindowCategory(Tr),Rr=ref(0),Dr=ref(0),Mr=ref(0),Br=ref(500),Nr=ref(1),Lr=ref(1),Hr=ref(1),zr=(resolveUnref$1(Tr.isFullScreen)??!1)||(resolveUnref$1(Tr.isFullPage)??!1)||(resolveUnref$1(Tr.isEmbed)??!1),Ur=useCommandBarStore(),Vr=computed(()=>Ur.getIsCommandBarOpen),jr=()=>{const Gr=Math.min($r.value,1.7777777777777777*Ar.value),Xr=Math.min(Ar.value,9/16*$r.value);Dr.value=zr?Gr:Math.min(getMaxWidthByCategory(Cr.value),Gr),Rr.value=zr?Gr:getMaxWidthByCategory(Cr.value),Br.value=zr?Xr:getDefaultHeightByCategory(Cr.value),Mr.value=zr?Xr:Math.min(getDefaultHeightByCategory(Cr.value),Xr),Dr.value=Gr,Rr.value=Gr,Br.value=Xr,Mr.value=Xr,Nr.value=Dr.value/getMaxWidthByCategory(Cr.value),Lr.value=Mr.value/getDefaultHeightByCategory(Cr.value),Hr.value=Math.min(Nr.value,Lr.value)};return jr(),useEventListener("resize",jr,{passive:!0}),watch(Vr,jr),{maxWidth:Rr,category:Cr,width:$r,scale:Hr,defaultHeight:Br}},useGridSetting=Tr=>{ref(resolveUnref$1(Tr.displayMode)??"desktop");const Cr=ref(960),$r=ref(0),Ar=ref(0),Rr=ref(0),Dr=ref(resolveUnref$1(Tr.displayMode)),Mr=ref(1),Br=useCommandBarStore(),Nr=computed(()=>Br.getIsCommandBarOpen),Lr=()=>{const Hr=useMaxAppWidth(Tr);Dr.value=Hr.category.value,Ar.value=Hr.maxWidth.value,Rr.value=Hr.defaultHeight.value,Mr.value=Hr.scale.value,layout.state.gridLevels[resolveUnref$1(Tr.density)],$r.value=Ar.value/Cr.value};return Lr(),useEventListener("resize",Lr,{passive:!0}),watch(()=>[resolveUnref$1(Tr.displayMode),resolveUnref$1(Tr.density),resolveUnref$1(Tr.totalStickyMenuWidth),resolveUnref$1(Tr.isFullScreen),resolveUnref$1(Tr.isFullPage),resolveUnref$1(Tr.isEmbed)],Lr),watch(Nr,Lr),{gridCount:Cr,columnWidth:$r,maxWidth:Ar,category:Dr,defaultHeight:Rr,scale:Mr}},usePointerWithinElement=Tr=>{const Cr=usePointer(),$r=useScroll(Tr,{behavior:"smooth"}),Ar=ref(0),Rr=ref(0),Dr=()=>{const Mr=useElementBounding$1(Tr);Ar.value=Cr.x.value-Mr.x.value+$r.x.value,Rr.value=Cr.y.value-Mr.y.value+$r.y.value};return useEventListener(Tr,"pointerdown",Dr,{passive:!0}),useEventListener(Tr,"pointermove",Dr,{passive:!0}),useEventListener(Tr,"pointerleave",Dr,{passive:!0}),useEventListener(Tr,"scroll",Dr,{passive:!0}),{x:Ar,y:Rr}},extendOrReduceListWithNewIdIfPossible=({currentList:Tr,newId:Cr})=>{var Hr,zr;const $r=useAppStore(),Rr=(Hr=usePageStore().pageObject(Cr))==null?void 0:Hr.parent_id;if(Rr==null)return Tr;const Dr=(zr=$r.appObject(Rr))==null?void 0:zr.children;if(Dr==null||Dr.length===0)return Tr;if(Tr.some(Ur=>!Dr.includes(Ur)))return[Cr];const Br=Dr.indexOf(Cr);if(Br===-1)return Tr;const Nr=Dr.indexOf(Tr[0]),Lr=Dr.indexOf(Tr.slice(-1)[0]);return Nr===-1||Lr===-1?[Cr]:Br>Lr?Dr.slice(Nr,Br+1):Br=Nr?Dr.slice(Nr,Br+1):Tr},useDeckState=()=>{const Tr=ref(!1),Cr=ref(!1),$r=ref(!1),Ar=ref(!1),Rr=so=>{Ar.value=so},Dr=ref(null),Mr=ref(null),Br=ref(null),Nr=ref([]),Lr=so=>{Nr.value=so??[]};watch(()=>Dr.value,so=>{so==null&&(Mr.value=null,Lr([]),Br.value=null),so!=null&&(Br.value=so)});const Hr=ref(null),zr=ref(null),Ur=so=>{zr.value=so},Vr=ref([]),jr=so=>{Vr.value=so??[]};watch(Hr,so=>{so==null&&(Ur(null),jr([])),so!=null&&(Dr.value=null)});const{shift:Gr}=useMagicKeys();watch(zr,so=>{if(so==null&&jr([]),so!=null){if(Vr.value.includes(so)&&Gr.value){const ao=extendOrReduceListWithNewIdIfPossible({currentList:Vr.value,newId:so});jr(ao);return}if(Vr.value.includes(so)&&!Gr.value){jr([so]);return}if(Vr.value.length===0){jr([so]);return}if(Gr.value){const ao=extendOrReduceListWithNewIdIfPossible({currentList:Vr.value,newId:so});jr(ao);return}jr([so])}});const Xr=ref(null),Kr=so=>{Xr.value=so};watch(Xr,()=>{Lr([])});const Zr=ref([]),eo=ref(!1),Wr=ref(0),Yr=()=>{Wr.value+=1},Jr=ref(null);return{updateCopiedState:so=>{navigator.clipboard.writeText(JSON.stringify(so))},componentMode:Jr,updateComponentMode:so=>{Jr.value=so},showingFullPage:$r,showingFullScreen:Tr,showingEmbed:Ar,updateShowingEmbed:Rr,downloadFile:Cr,selectedBlockId:Dr,editingBlockId:Mr,highlightedBlockIds:Nr,updateHighlightedBlockIds:Lr,selectionMenuBlockId:Br,selectedPageId:Hr,focusedPageId:zr,updateFocusedPageId:Ur,counterForAIGeneration:Wr,updateCounterForAIGeneration:Yr,currentAppId:Xr,updateCurrentAppId:Kr,shownSlideIds:Zr,slideShowInProgress:eo,highlightedPageIds:Vr,updateHighlightedPageIds:jr}},useSlideState=()=>{const Tr=ref([]),Cr=Rr=>{Tr.value=Rr},$r=ref([]);return{dropzoneBlockIds:Tr,setDropzoneBlockIds:Cr,movingBlockIds:$r,setMovingBlockIds:Rr=>{$r.value=Rr}}},useMiscState=()=>{const Tr=ref(null),Cr=Gr=>{Tr.value=Gr},$r=ref({text:"",showEmoji:!1,type:"error",persistent:!1,position:"bottomLeft",isProminent:!1,showInProgress:!1,showTag:!1,tagObject:null}),Ar=({appId:Gr,text:Xr,showEmoji:Kr=!1,type:Zr="neutral",persistent:eo=!1,position:Wr="bottomLeft",isProminent:Yr=!1,showInProgress:Jr=!1,showTag:no=!1,tagObject:ro=null})=>{$r.value={...$r.value,text:Xr,showEmoji:Kr,type:Zr,persistent:eo,position:Wr,isProminent:Yr,showInProgress:Jr,showTag:no,tagObject:ro},Tr.value=Gr},Rr=useKeyModifier("Alt"),{current:Dr}=useMagicKeys(),Mr=ref(null),Br=Gr=>{Mr.value=Gr},Nr=computed(()=>Mr.value==="singleSlide"),Lr=computed(()=>Mr.value==="wholeDeck"),Hr=ref(!1),zr=ref(!1),Ur=Gr=>{zr.value=Gr},Vr=ref({ai:!1,design:!1,addBlocks:!1,sharing:!1,layoutTemplate:!1});return{showGlobalNotification:Tr,updateShowGlobalNotification:Cr,globalNotification:$r,updateGlobalNotification:Ar,altKeyPressed:Rr,current:Dr,lastGenerationType:Mr,updateLastGenerationType:Br,isSingleSlideGeneration:Nr,isWholeDeckGeneration:Lr,isContextMenuOpen:zr,updateIsContextMenuOpen:Ur,popoverState:Vr,updatePopoverState:({id:Gr,isOpen:Xr})=>{Vr.value={...Vr.value,[Gr]:Xr}},userInterruptedSlideShow:Hr}},useDeviceState=()=>{const{width:Tr}=useWindowSize(),Cr=computed(()=>getCategoryByWidth(Tr.value)),$r=computed(()=>Cr.value==="mobile"),Ar=computed(()=>Cr.value==="portraitTablet"),Rr=computed(()=>Cr.value==="tablet");return{isMobile:$r,isPortraitTablet:Ar,isTablet:Rr}};function OrderedMap(Tr){this.content=Tr}OrderedMap.prototype={constructor:OrderedMap,find:function(Tr){for(var Cr=0;Cr>1}};OrderedMap.from=function(Tr){if(Tr instanceof OrderedMap)return Tr;var Cr=[];if(Tr)for(var $r in Tr)Cr.push($r,Tr[$r]);return new OrderedMap(Cr)};function findDiffStart(Tr,Cr,$r){for(let Ar=0;;Ar++){if(Ar==Tr.childCount||Ar==Cr.childCount)return Tr.childCount==Cr.childCount?null:$r;let Rr=Tr.child(Ar),Dr=Cr.child(Ar);if(Rr==Dr){$r+=Rr.nodeSize;continue}if(!Rr.sameMarkup(Dr))return $r;if(Rr.isText&&Rr.text!=Dr.text){for(let Mr=0;Rr.text[Mr]==Dr.text[Mr];Mr++)$r++;return $r}if(Rr.content.size||Dr.content.size){let Mr=findDiffStart(Rr.content,Dr.content,$r+1);if(Mr!=null)return Mr}$r+=Rr.nodeSize}}function findDiffEnd(Tr,Cr,$r,Ar){for(let Rr=Tr.childCount,Dr=Cr.childCount;;){if(Rr==0||Dr==0)return Rr==Dr?null:{a:$r,b:Ar};let Mr=Tr.child(--Rr),Br=Cr.child(--Dr),Nr=Mr.nodeSize;if(Mr==Br){$r-=Nr,Ar-=Nr;continue}if(!Mr.sameMarkup(Br))return{a:$r,b:Ar};if(Mr.isText&&Mr.text!=Br.text){let Lr=0,Hr=Math.min(Mr.text.length,Br.text.length);for(;LrCr&&Ar(Nr,Rr+Br,Dr||null,Mr)!==!1&&Nr.content.size){let Hr=Br+1;Nr.nodesBetween(Math.max(0,Cr-Hr),Math.min(Nr.content.size,$r-Hr),Ar,Rr+Hr)}Br=Lr}}descendants(Cr){this.nodesBetween(0,this.size,Cr)}textBetween(Cr,$r,Ar,Rr){let Dr="",Mr=!0;return this.nodesBetween(Cr,$r,(Br,Nr)=>{let Lr=Br.isText?Br.text.slice(Math.max(Cr,Nr)-Nr,$r-Nr):Br.isLeaf?Rr?typeof Rr=="function"?Rr(Br):Rr:Br.type.spec.leafText?Br.type.spec.leafText(Br):"":"";Br.isBlock&&(Br.isLeaf&&Lr||Br.isTextblock)&&Ar&&(Mr?Mr=!1:Dr+=Ar),Dr+=Lr},0),Dr}append(Cr){if(!Cr.size)return this;if(!this.size)return Cr;let $r=this.lastChild,Ar=Cr.firstChild,Rr=this.content.slice(),Dr=0;for($r.isText&&$r.sameMarkup(Ar)&&(Rr[Rr.length-1]=$r.withText($r.text+Ar.text),Dr=1);DrCr)for(let Dr=0,Mr=0;Mr<$r;Dr++){let Br=this.content[Dr],Nr=Mr+Br.nodeSize;Nr>Cr&&((Mr$r)&&(Br.isText?Br=Br.cut(Math.max(0,Cr-Mr),Math.min(Br.text.length,$r-Mr)):Br=Br.cut(Math.max(0,Cr-Mr-1),Math.min(Br.content.size,$r-Mr-1))),Ar.push(Br),Rr+=Br.nodeSize),Mr=Nr}return new Fragment(Ar,Rr)}cutByIndex(Cr,$r){return Cr==$r?Fragment.empty:Cr==0&&$r==this.content.length?this:new Fragment(this.content.slice(Cr,$r))}replaceChild(Cr,$r){let Ar=this.content[Cr];if(Ar==$r)return this;let Rr=this.content.slice(),Dr=this.size+$r.nodeSize-Ar.nodeSize;return Rr[Cr]=$r,new Fragment(Rr,Dr)}addToStart(Cr){return new Fragment([Cr].concat(this.content),this.size+Cr.nodeSize)}addToEnd(Cr){return new Fragment(this.content.concat(Cr),this.size+Cr.nodeSize)}eq(Cr){if(this.content.length!=Cr.content.length)return!1;for(let $r=0;$rthis.size||Cr<0)throw new RangeError(`Position ${Cr} outside of fragment (${this})`);for(let Ar=0,Rr=0;;Ar++){let Dr=this.child(Ar),Mr=Rr+Dr.nodeSize;if(Mr>=Cr)return Mr==Cr||$r>0?retIndex(Ar+1,Mr):retIndex(Ar,Rr);Rr=Mr}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(Cr=>Cr.toJSON()):null}static fromJSON(Cr,$r){if(!$r)return Fragment.empty;if(!Array.isArray($r))throw new RangeError("Invalid input for Fragment.fromJSON");return new Fragment($r.map(Cr.nodeFromJSON))}static fromArray(Cr){if(!Cr.length)return Fragment.empty;let $r,Ar=0;for(let Rr=0;Rrthis.type.rank&&($r||($r=Cr.slice(0,Rr)),$r.push(this),Ar=!0),$r&&$r.push(Dr)}}return $r||($r=Cr.slice()),Ar||$r.push(this),$r}removeFromSet(Cr){for(let $r=0;$rAr.type.rank-Rr.type.rank),$r}};Mark$1.none=[];class ReplaceError extends Error{}class Slice{constructor(Cr,$r,Ar){this.content=Cr,this.openStart=$r,this.openEnd=Ar}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(Cr,$r){let Ar=insertInto(this.content,Cr+this.openStart,$r);return Ar&&new Slice(Ar,this.openStart,this.openEnd)}removeBetween(Cr,$r){return new Slice(removeRange(this.content,Cr+this.openStart,$r+this.openStart),this.openStart,this.openEnd)}eq(Cr){return this.content.eq(Cr.content)&&this.openStart==Cr.openStart&&this.openEnd==Cr.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let Cr={content:this.content.toJSON()};return this.openStart>0&&(Cr.openStart=this.openStart),this.openEnd>0&&(Cr.openEnd=this.openEnd),Cr}static fromJSON(Cr,$r){if(!$r)return Slice.empty;let Ar=$r.openStart||0,Rr=$r.openEnd||0;if(typeof Ar!="number"||typeof Rr!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Slice(Fragment.fromJSON(Cr,$r.content),Ar,Rr)}static maxOpen(Cr,$r=!0){let Ar=0,Rr=0;for(let Dr=Cr.firstChild;Dr&&!Dr.isLeaf&&($r||!Dr.type.spec.isolating);Dr=Dr.firstChild)Ar++;for(let Dr=Cr.lastChild;Dr&&!Dr.isLeaf&&($r||!Dr.type.spec.isolating);Dr=Dr.lastChild)Rr++;return new Slice(Cr,Ar,Rr)}}Slice.empty=new Slice(Fragment.empty,0,0);function removeRange(Tr,Cr,$r){let{index:Ar,offset:Rr}=Tr.findIndex(Cr),Dr=Tr.maybeChild(Ar),{index:Mr,offset:Br}=Tr.findIndex($r);if(Rr==Cr||Dr.isText){if(Br!=$r&&!Tr.child(Mr).isText)throw new RangeError("Removing non-flat range");return Tr.cut(0,Cr).append(Tr.cut($r))}if(Ar!=Mr)throw new RangeError("Removing non-flat range");return Tr.replaceChild(Ar,Dr.copy(removeRange(Dr.content,Cr-Rr-1,$r-Rr-1)))}function insertInto(Tr,Cr,$r,Ar){let{index:Rr,offset:Dr}=Tr.findIndex(Cr),Mr=Tr.maybeChild(Rr);if(Dr==Cr||Mr.isText)return Ar&&!Ar.canReplace(Rr,Rr,$r)?null:Tr.cut(0,Cr).append($r).append(Tr.cut(Cr));let Br=insertInto(Mr.content,Cr-Dr-1,$r);return Br&&Tr.replaceChild(Rr,Mr.copy(Br))}function replace$1(Tr,Cr,$r){if($r.openStart>Tr.depth)throw new ReplaceError("Inserted content deeper than insertion position");if(Tr.depth-$r.openStart!=Cr.depth-$r.openEnd)throw new ReplaceError("Inconsistent open depths");return replaceOuter(Tr,Cr,$r,0)}function replaceOuter(Tr,Cr,$r,Ar){let Rr=Tr.index(Ar),Dr=Tr.node(Ar);if(Rr==Cr.index(Ar)&&Ar=0&&Tr.isText&&Tr.sameMarkup(Cr[$r])?Cr[$r]=Tr.withText(Cr[$r].text+Tr.text):Cr.push(Tr)}function addRange(Tr,Cr,$r,Ar){let Rr=(Cr||Tr).node($r),Dr=0,Mr=Cr?Cr.index($r):Rr.childCount;Tr&&(Dr=Tr.index($r),Tr.depth>$r?Dr++:Tr.textOffset&&(addNode(Tr.nodeAfter,Ar),Dr++));for(let Br=Dr;BrRr&&joinable$1(Tr,Cr,Rr+1),Mr=Ar.depth>Rr&&joinable$1($r,Ar,Rr+1),Br=[];return addRange(null,Tr,Rr,Br),Dr&&Mr&&Cr.index(Rr)==$r.index(Rr)?(checkJoin(Dr,Mr),addNode(close(Dr,replaceThreeWay(Tr,Cr,$r,Ar,Rr+1)),Br)):(Dr&&addNode(close(Dr,replaceTwoWay(Tr,Cr,Rr+1)),Br),addRange(Cr,$r,Rr,Br),Mr&&addNode(close(Mr,replaceTwoWay($r,Ar,Rr+1)),Br)),addRange(Ar,null,Rr,Br),new Fragment(Br)}function replaceTwoWay(Tr,Cr,$r){let Ar=[];if(addRange(null,Tr,$r,Ar),Tr.depth>$r){let Rr=joinable$1(Tr,Cr,$r+1);addNode(close(Rr,replaceTwoWay(Tr,Cr,$r+1)),Ar)}return addRange(Cr,null,$r,Ar),new Fragment(Ar)}function prepareSliceForReplace(Tr,Cr){let $r=Cr.depth-Tr.openStart,Rr=Cr.node($r).copy(Tr.content);for(let Dr=$r-1;Dr>=0;Dr--)Rr=Cr.node(Dr).copy(Fragment.from(Rr));return{start:Rr.resolveNoCache(Tr.openStart+$r),end:Rr.resolveNoCache(Rr.content.size-Tr.openEnd-$r)}}class ResolvedPos{constructor(Cr,$r,Ar){this.pos=Cr,this.path=$r,this.parentOffset=Ar,this.depth=$r.length/3-1}resolveDepth(Cr){return Cr==null?this.depth:Cr<0?this.depth+Cr:Cr}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(Cr){return this.path[this.resolveDepth(Cr)*3]}index(Cr){return this.path[this.resolveDepth(Cr)*3+1]}indexAfter(Cr){return Cr=this.resolveDepth(Cr),this.index(Cr)+(Cr==this.depth&&!this.textOffset?0:1)}start(Cr){return Cr=this.resolveDepth(Cr),Cr==0?0:this.path[Cr*3-1]+1}end(Cr){return Cr=this.resolveDepth(Cr),this.start(Cr)+this.node(Cr).content.size}before(Cr){if(Cr=this.resolveDepth(Cr),!Cr)throw new RangeError("There is no position before the top-level node");return Cr==this.depth+1?this.pos:this.path[Cr*3-1]}after(Cr){if(Cr=this.resolveDepth(Cr),!Cr)throw new RangeError("There is no position after the top-level node");return Cr==this.depth+1?this.pos:this.path[Cr*3-1]+this.path[Cr*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let Cr=this.parent,$r=this.index(this.depth);if($r==Cr.childCount)return null;let Ar=this.pos-this.path[this.path.length-1],Rr=Cr.child($r);return Ar?Cr.child($r).cut(Ar):Rr}get nodeBefore(){let Cr=this.index(this.depth),$r=this.pos-this.path[this.path.length-1];return $r?this.parent.child(Cr).cut(0,$r):Cr==0?null:this.parent.child(Cr-1)}posAtIndex(Cr,$r){$r=this.resolveDepth($r);let Ar=this.path[$r*3],Rr=$r==0?0:this.path[$r*3-1]+1;for(let Dr=0;Dr0;$r--)if(this.start($r)<=Cr&&this.end($r)>=Cr)return $r;return 0}blockRange(Cr=this,$r){if(Cr.pos=0;Ar--)if(Cr.pos<=this.end(Ar)&&(!$r||$r(this.node(Ar))))return new NodeRange(this,Cr,Ar);return null}sameParent(Cr){return this.pos-this.parentOffset==Cr.pos-Cr.parentOffset}max(Cr){return Cr.pos>this.pos?Cr:this}min(Cr){return Cr.pos=0&&$r<=Cr.content.size))throw new RangeError("Position "+$r+" out of range");let Ar=[],Rr=0,Dr=$r;for(let Mr=Cr;;){let{index:Br,offset:Nr}=Mr.content.findIndex(Dr),Lr=Dr-Nr;if(Ar.push(Mr,Br,Rr+Nr),!Lr||(Mr=Mr.child(Br),Mr.isText))break;Dr=Lr-1,Rr+=Nr+1}return new ResolvedPos($r,Ar,Dr)}static resolveCached(Cr,$r){for(let Rr=0;RrCr&&this.nodesBetween(Cr,$r,Dr=>(Ar.isInSet(Dr.marks)&&(Rr=!0),!Rr)),Rr}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let Cr=this.type.name;return this.content.size&&(Cr+="("+this.content.toStringInner()+")"),wrapMarks(this.marks,Cr)}contentMatchAt(Cr){let $r=this.type.contentMatch.matchFragment(this.content,0,Cr);if(!$r)throw new Error("Called contentMatchAt on a node with invalid content");return $r}canReplace(Cr,$r,Ar=Fragment.empty,Rr=0,Dr=Ar.childCount){let Mr=this.contentMatchAt(Cr).matchFragment(Ar,Rr,Dr),Br=Mr&&Mr.matchFragment(this.content,$r);if(!Br||!Br.validEnd)return!1;for(let Nr=Rr;Nr$r.type.name)}`);this.content.forEach($r=>$r.check())}toJSON(){let Cr={type:this.type.name};for(let $r in this.attrs){Cr.attrs=this.attrs;break}return this.content.size&&(Cr.content=this.content.toJSON()),this.marks.length&&(Cr.marks=this.marks.map($r=>$r.toJSON())),Cr}static fromJSON(Cr,$r){if(!$r)throw new RangeError("Invalid input for Node.fromJSON");let Ar=null;if($r.marks){if(!Array.isArray($r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");Ar=$r.marks.map(Cr.markFromJSON)}if($r.type=="text"){if(typeof $r.text!="string")throw new RangeError("Invalid text node in JSON");return Cr.text($r.text,Ar)}let Rr=Fragment.fromJSON(Cr,$r.content);return Cr.nodeType($r.type).create($r.attrs,Rr,Ar)}};Node$2.prototype.text=void 0;class TextNode extends Node$2{constructor(Cr,$r,Ar,Rr){if(super(Cr,$r,null,Rr),!Ar)throw new RangeError("Empty text nodes are not allowed");this.text=Ar}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):wrapMarks(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(Cr,$r){return this.text.slice(Cr,$r)}get nodeSize(){return this.text.length}mark(Cr){return Cr==this.marks?this:new TextNode(this.type,this.attrs,this.text,Cr)}withText(Cr){return Cr==this.text?this:new TextNode(this.type,this.attrs,Cr,this.marks)}cut(Cr=0,$r=this.text.length){return Cr==0&&$r==this.text.length?this:this.withText(this.text.slice(Cr,$r))}eq(Cr){return this.sameMarkup(Cr)&&this.text==Cr.text}toJSON(){let Cr=super.toJSON();return Cr.text=this.text,Cr}}function wrapMarks(Tr,Cr){for(let $r=Tr.length-1;$r>=0;$r--)Cr=Tr[$r].type.name+"("+Cr+")";return Cr}class ContentMatch{constructor(Cr){this.validEnd=Cr,this.next=[],this.wrapCache=[]}static parse(Cr,$r){let Ar=new TokenStream(Cr,$r);if(Ar.next==null)return ContentMatch.empty;let Rr=parseExpr(Ar);Ar.next&&Ar.err("Unexpected trailing text");let Dr=dfa(nfa(Rr));return checkForDeadEnds(Dr,Ar),Dr}matchType(Cr){for(let $r=0;$rLr.createAndFill()));for(let Lr=0;Lr=this.next.length)throw new RangeError(`There's no ${Cr}th edge in this content match`);return this.next[Cr]}toString(){let Cr=[];function $r(Ar){Cr.push(Ar);for(let Rr=0;Rr{let Dr=Rr+(Ar.validEnd?"*":" ")+" ";for(let Mr=0;Mr"+Cr.indexOf(Ar.next[Mr].next);return Dr}).join(` `)}}ContentMatch.empty=new ContentMatch(!0);class TokenStream{constructor(Cr,$r){this.string=Cr,this.nodeTypes=$r,this.inline=null,this.pos=0,this.tokens=Cr.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(Cr){return this.next==Cr&&(this.pos++||!0)}err(Cr){throw new SyntaxError(Cr+" (in content expression '"+this.string+"')")}}function parseExpr(Tr){let Cr=[];do Cr.push(parseExprSeq(Tr));while(Tr.eat("|"));return Cr.length==1?Cr[0]:{type:"choice",exprs:Cr}}function parseExprSeq(Tr){let Cr=[];do Cr.push(parseExprSubscript(Tr));while(Tr.next&&Tr.next!=")"&&Tr.next!="|");return Cr.length==1?Cr[0]:{type:"seq",exprs:Cr}}function parseExprSubscript(Tr){let Cr=parseExprAtom(Tr);for(;;)if(Tr.eat("+"))Cr={type:"plus",expr:Cr};else if(Tr.eat("*"))Cr={type:"star",expr:Cr};else if(Tr.eat("?"))Cr={type:"opt",expr:Cr};else if(Tr.eat("{"))Cr=parseExprRange(Tr,Cr);else break;return Cr}function parseNum(Tr){/\D/.test(Tr.next)&&Tr.err("Expected number, got '"+Tr.next+"'");let Cr=Number(Tr.next);return Tr.pos++,Cr}function parseExprRange(Tr,Cr){let $r=parseNum(Tr),Ar=$r;return Tr.eat(",")&&(Tr.next!="}"?Ar=parseNum(Tr):Ar=-1),Tr.eat("}")||Tr.err("Unclosed braced range"),{type:"range",min:$r,max:Ar,expr:Cr}}function resolveName(Tr,Cr){let $r=Tr.nodeTypes,Ar=$r[Cr];if(Ar)return[Ar];let Rr=[];for(let Dr in $r){let Mr=$r[Dr];Mr.groups.indexOf(Cr)>-1&&Rr.push(Mr)}return Rr.length==0&&Tr.err("No node type or group '"+Cr+"' found"),Rr}function parseExprAtom(Tr){if(Tr.eat("(")){let Cr=parseExpr(Tr);return Tr.eat(")")||Tr.err("Missing closing paren"),Cr}else if(/\W/.test(Tr.next))Tr.err("Unexpected token '"+Tr.next+"'");else{let Cr=resolveName(Tr,Tr.next).map($r=>(Tr.inline==null?Tr.inline=$r.isInline:Tr.inline!=$r.isInline&&Tr.err("Mixing inline and block content"),{type:"name",value:$r}));return Tr.pos++,Cr.length==1?Cr[0]:{type:"choice",exprs:Cr}}}function nfa(Tr){let Cr=[[]];return Rr(Dr(Tr,0),$r()),Cr;function $r(){return Cr.push([])-1}function Ar(Mr,Br,Nr){let Lr={term:Nr,to:Br};return Cr[Mr].push(Lr),Lr}function Rr(Mr,Br){Mr.forEach(Nr=>Nr.to=Br)}function Dr(Mr,Br){if(Mr.type=="choice")return Mr.exprs.reduce((Nr,Lr)=>Nr.concat(Dr(Lr,Br)),[]);if(Mr.type=="seq")for(let Nr=0;;Nr++){let Lr=Dr(Mr.exprs[Nr],Br);if(Nr==Mr.exprs.length-1)return Lr;Rr(Lr,Br=$r())}else if(Mr.type=="star"){let Nr=$r();return Ar(Br,Nr),Rr(Dr(Mr.expr,Nr),Nr),[Ar(Nr)]}else if(Mr.type=="plus"){let Nr=$r();return Rr(Dr(Mr.expr,Br),Nr),Rr(Dr(Mr.expr,Nr),Nr),[Ar(Nr)]}else{if(Mr.type=="opt")return[Ar(Br)].concat(Dr(Mr.expr,Br));if(Mr.type=="range"){let Nr=Br;for(let Lr=0;Lr{Tr[Mr].forEach(({term:Br,to:Nr})=>{if(!Br)return;let Lr;for(let Hr=0;Hr{Lr||Rr.push([Br,Lr=[]]),Lr.indexOf(Hr)==-1&&Lr.push(Hr)})})});let Dr=Cr[Ar.join(",")]=new ContentMatch(Ar.indexOf(Tr.length-1)>-1);for(let Mr=0;Mr-1}allowsMarks(Cr){if(this.markSet==null)return!0;for(let $r=0;$rAr[Dr]=new Lf(Dr,$r,Mr));let Rr=$r.spec.topNode||"doc";if(!Ar[Rr])throw new RangeError("Schema is missing its top node type ('"+Rr+"')");if(!Ar.text)throw new RangeError("Every schema needs a 'text' type");for(let Dr in Ar.text.attrs)throw new RangeError("The text node type should not have attributes");return Ar}};class Attribute{constructor(Cr){this.hasDefault=Object.prototype.hasOwnProperty.call(Cr,"default"),this.default=Cr.default}get isRequired(){return!this.hasDefault}}class MarkType{constructor(Cr,$r,Ar,Rr){this.name=Cr,this.rank=$r,this.schema=Ar,this.spec=Rr,this.attrs=initAttrs(Rr.attrs),this.excluded=null;let Dr=defaultAttrs(this.attrs);this.instance=Dr?new Mark$1(this,Dr):null}create(Cr=null){return!Cr&&this.instance?this.instance:new Mark$1(this,computeAttrs(this.attrs,Cr))}static compile(Cr,$r){let Ar=Object.create(null),Rr=0;return Cr.forEach((Dr,Mr)=>Ar[Dr]=new MarkType(Dr,Rr++,$r,Mr)),Ar}removeFromSet(Cr){for(var $r=0;$r-1}}class Schema{constructor(Cr){this.cached=Object.create(null);let $r=this.spec={};for(let Rr in Cr)$r[Rr]=Cr[Rr];$r.nodes=OrderedMap.from(Cr.nodes),$r.marks=OrderedMap.from(Cr.marks||{}),this.nodes=NodeType$1.compile(this.spec.nodes,this),this.marks=MarkType.compile(this.spec.marks,this);let Ar=Object.create(null);for(let Rr in this.nodes){if(Rr in this.marks)throw new RangeError(Rr+" can not be both a node and a mark");let Dr=this.nodes[Rr],Mr=Dr.spec.content||"",Br=Dr.spec.marks;Dr.contentMatch=Ar[Mr]||(Ar[Mr]=ContentMatch.parse(Mr,this.nodes)),Dr.inlineContent=Dr.contentMatch.inlineContent,Dr.markSet=Br=="_"?null:Br?gatherMarks(this,Br.split(" ")):Br==""||!Dr.inlineContent?[]:null}for(let Rr in this.marks){let Dr=this.marks[Rr],Mr=Dr.spec.excludes;Dr.excluded=Mr==null?[Dr]:Mr==""?[]:gatherMarks(this,Mr.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(Cr,$r=null,Ar,Rr){if(typeof Cr=="string")Cr=this.nodeType(Cr);else if(Cr instanceof NodeType$1){if(Cr.schema!=this)throw new RangeError("Node type from different schema used ("+Cr.name+")")}else throw new RangeError("Invalid node type: "+Cr);return Cr.createChecked($r,Ar,Rr)}text(Cr,$r){let Ar=this.nodes.text;return new TextNode(Ar,Ar.defaultAttrs,Cr,Mark$1.setFrom($r))}mark(Cr,$r){return typeof Cr=="string"&&(Cr=this.marks[Cr]),Cr.create($r)}nodeFromJSON(Cr){return Node$2.fromJSON(this,Cr)}markFromJSON(Cr){return Mark$1.fromJSON(this,Cr)}nodeType(Cr){let $r=this.nodes[Cr];if(!$r)throw new RangeError("Unknown node type: "+Cr);return $r}}function gatherMarks(Tr,Cr){let $r=[];for(let Ar=0;Ar-1)&&$r.push(Mr=Nr)}if(!Mr)throw new SyntaxError("Unknown mark type: '"+Cr[Ar]+"'")}return $r}let DOMParser$1=class Ud{constructor(Cr,$r){this.schema=Cr,this.rules=$r,this.tags=[],this.styles=[],$r.forEach(Ar=>{Ar.tag?this.tags.push(Ar):Ar.style&&this.styles.push(Ar)}),this.normalizeLists=!this.tags.some(Ar=>{if(!/^(ul|ol)\b/.test(Ar.tag)||!Ar.node)return!1;let Rr=Cr.nodes[Ar.node];return Rr.contentMatch.matchType(Rr)})}parse(Cr,$r={}){let Ar=new ParseContext(this,$r,!1);return Ar.addAll(Cr,$r.from,$r.to),Ar.finish()}parseSlice(Cr,$r={}){let Ar=new ParseContext(this,$r,!0);return Ar.addAll(Cr,$r.from,$r.to),Slice.maxOpen(Ar.finish())}matchTag(Cr,$r,Ar){for(let Rr=Ar?this.tags.indexOf(Ar)+1:0;RrCr.length&&(Br.charCodeAt(Cr.length)!=61||Br.slice(Cr.length+1)!=$r))){if(Mr.getAttrs){let Nr=Mr.getAttrs($r);if(Nr===!1)continue;Mr.attrs=Nr||void 0}return Mr}}}static schemaRules(Cr){let $r=[];function Ar(Rr){let Dr=Rr.priority==null?50:Rr.priority,Mr=0;for(;Mr<$r.length;Mr++){let Br=$r[Mr];if((Br.priority==null?50:Br.priority){Ar(Mr=copy$1(Mr)),Mr.mark||Mr.ignore||Mr.clearMark||(Mr.mark=Rr)})}for(let Rr in Cr.nodes){let Dr=Cr.nodes[Rr].spec.parseDOM;Dr&&Dr.forEach(Mr=>{Ar(Mr=copy$1(Mr)),Mr.node||Mr.ignore||Mr.mark||(Mr.node=Rr)})}return $r}static fromSchema(Cr){return Cr.cached.domParser||(Cr.cached.domParser=new Ud(Cr,Ud.schemaRules(Cr)))}};const blockTags={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ignoreTags={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},listTags={ol:!0,ul:!0},OPT_PRESERVE_WS=1,OPT_PRESERVE_WS_FULL=2,OPT_OPEN_LEFT=4;function wsOptionsFor(Tr,Cr,$r){return Cr!=null?(Cr?OPT_PRESERVE_WS:0)|(Cr==="full"?OPT_PRESERVE_WS_FULL:0):Tr&&Tr.whitespace=="pre"?OPT_PRESERVE_WS|OPT_PRESERVE_WS_FULL:$r&~OPT_OPEN_LEFT}class NodeContext{constructor(Cr,$r,Ar,Rr,Dr,Mr,Br){this.type=Cr,this.attrs=$r,this.marks=Ar,this.pendingMarks=Rr,this.solid=Dr,this.options=Br,this.content=[],this.activeMarks=Mark$1.none,this.stashMarks=[],this.match=Mr||(Br&OPT_OPEN_LEFT?null:Cr.contentMatch)}findWrapping(Cr){if(!this.match){if(!this.type)return[];let $r=this.type.contentMatch.fillBefore(Fragment.from(Cr));if($r)this.match=this.type.contentMatch.matchFragment($r);else{let Ar=this.type.contentMatch,Rr;return(Rr=Ar.findWrapping(Cr.type))?(this.match=Ar,Rr):null}}return this.match.findWrapping(Cr.type)}finish(Cr){if(!(this.options&OPT_PRESERVE_WS)){let Ar=this.content[this.content.length-1],Rr;if(Ar&&Ar.isText&&(Rr=/[ \t\r\n\u000c]+$/.exec(Ar.text))){let Dr=Ar;Ar.text.length==Rr[0].length?this.content.pop():this.content[this.content.length-1]=Dr.withText(Dr.text.slice(0,Dr.text.length-Rr[0].length))}}let $r=Fragment.from(this.content);return!Cr&&this.match&&($r=$r.append(this.match.fillBefore(Fragment.empty,!0))),this.type?this.type.create(this.attrs,$r,this.marks):$r}popFromStashMark(Cr){for(let $r=this.stashMarks.length-1;$r>=0;$r--)if(Cr.eq(this.stashMarks[$r]))return this.stashMarks.splice($r,1)[0]}applyPending(Cr){for(let $r=0,Ar=this.pendingMarks;$rthis.addAll(Cr)),Mr&&this.sync(Br),this.needsBlock=Nr}else this.withStyleRules(Cr,()=>{this.addElementByRule(Cr,Dr,Dr.consuming===!1?Rr:void 0)})}leafFallback(Cr){Cr.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(Cr.ownerDocument.createTextNode(` `))}ignoreFallback(Cr){Cr.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(Cr){let $r=Mark$1.none,Ar=Mark$1.none;for(let Rr=0;Rr{Mr.clearMark(Br)&&(Ar=Br.addToSet(Ar))}):$r=this.parser.schema.marks[Mr.mark].create(Mr.attrs).addToSet($r),Mr.consuming===!1)Dr=Mr;else break}return[$r,Ar]}addElementByRule(Cr,$r,Ar){let Rr,Dr,Mr;$r.node?(Dr=this.parser.schema.nodes[$r.node],Dr.isLeaf?this.insertNode(Dr.create($r.attrs))||this.leafFallback(Cr):Rr=this.enter(Dr,$r.attrs||null,$r.preserveWhitespace)):(Mr=this.parser.schema.marks[$r.mark].create($r.attrs),this.addPendingMark(Mr));let Br=this.top;if(Dr&&Dr.isLeaf)this.findInside(Cr);else if(Ar)this.addElement(Cr,Ar);else if($r.getContent)this.findInside(Cr),$r.getContent(Cr,this.parser.schema).forEach(Nr=>this.insertNode(Nr));else{let Nr=Cr;typeof $r.contentElement=="string"?Nr=Cr.querySelector($r.contentElement):typeof $r.contentElement=="function"?Nr=$r.contentElement(Cr):$r.contentElement&&(Nr=$r.contentElement),this.findAround(Cr,Nr,!0),this.addAll(Nr)}Rr&&this.sync(Br)&&this.open--,Mr&&this.removePendingMark(Mr,Br)}addAll(Cr,$r,Ar){let Rr=$r||0;for(let Dr=$r?Cr.childNodes[$r]:Cr.firstChild,Mr=Ar==null?null:Cr.childNodes[Ar];Dr!=Mr;Dr=Dr.nextSibling,++Rr)this.findAtPoint(Cr,Rr),this.addDOM(Dr);this.findAtPoint(Cr,Rr)}findPlace(Cr){let $r,Ar;for(let Rr=this.open;Rr>=0;Rr--){let Dr=this.nodes[Rr],Mr=Dr.findWrapping(Cr);if(Mr&&(!$r||$r.length>Mr.length)&&($r=Mr,Ar=Dr,!Mr.length)||Dr.solid)break}if(!$r)return!1;this.sync(Ar);for(let Rr=0;Rr<$r.length;Rr++)this.enterInner($r[Rr],null,!1);return!0}insertNode(Cr){if(Cr.isInline&&this.needsBlock&&!this.top.type){let $r=this.textblockFromContext();$r&&this.enterInner($r)}if(this.findPlace(Cr)){this.closeExtra();let $r=this.top;$r.applyPending(Cr.type),$r.match&&($r.match=$r.match.matchType(Cr.type));let Ar=$r.activeMarks;for(let Rr=0;Rrthis.open){for(;$r>this.open;$r--)this.nodes[$r-1].content.push(this.nodes[$r].finish(Cr));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(Cr){for(let $r=this.open;$r>=0;$r--)if(this.nodes[$r]==Cr)return this.open=$r,!0;return!1}get currentPos(){this.closeExtra();let Cr=0;for(let $r=this.open;$r>=0;$r--){let Ar=this.nodes[$r].content;for(let Rr=Ar.length-1;Rr>=0;Rr--)Cr+=Ar[Rr].nodeSize;$r&&Cr++}return Cr}findAtPoint(Cr,$r){if(this.find)for(let Ar=0;Ar-1)return Cr.split(/\s*\|\s*/).some(this.matchesContext,this);let $r=Cr.split("/"),Ar=this.options.context,Rr=!this.isOpen&&(!Ar||Ar.parent.type==this.nodes[0].type),Dr=-(Ar?Ar.depth+1:0)+(Rr?0:1),Mr=(Br,Nr)=>{for(;Br>=0;Br--){let Lr=$r[Br];if(Lr==""){if(Br==$r.length-1||Br==0)continue;for(;Nr>=Dr;Nr--)if(Mr(Br-1,Nr))return!0;return!1}else{let Hr=Nr>0||Nr==0&&Rr?this.nodes[Nr].type:Ar&&Nr>=Dr?Ar.node(Nr-Dr).type:null;if(!Hr||Hr.name!=Lr&&Hr.groups.indexOf(Lr)==-1)return!1;Nr--}}return!0};return Mr($r.length-1,this.open)}textblockFromContext(){let Cr=this.options.context;if(Cr)for(let $r=Cr.depth;$r>=0;$r--){let Ar=Cr.node($r).contentMatchAt(Cr.indexAfter($r)).defaultType;if(Ar&&Ar.isTextblock&&Ar.defaultAttrs)return Ar}for(let $r in this.parser.schema.nodes){let Ar=this.parser.schema.nodes[$r];if(Ar.isTextblock&&Ar.defaultAttrs)return Ar}}addPendingMark(Cr){let $r=findSameMarkInSet(Cr,this.top.pendingMarks);$r&&this.top.stashMarks.push($r),this.top.pendingMarks=Cr.addToSet(this.top.pendingMarks)}removePendingMark(Cr,$r){for(let Ar=this.open;Ar>=0;Ar--){let Rr=this.nodes[Ar];if(Rr.pendingMarks.lastIndexOf(Cr)>-1)Rr.pendingMarks=Cr.removeFromSet(Rr.pendingMarks);else{Rr.activeMarks=Cr.removeFromSet(Rr.activeMarks);let Mr=Rr.popFromStashMark(Cr);Mr&&Rr.type&&Rr.type.allowsMarkType(Mr.type)&&(Rr.activeMarks=Mr.addToSet(Rr.activeMarks))}if(Rr==$r)break}}}function normalizeList(Tr){for(let Cr=Tr.firstChild,$r=null;Cr;Cr=Cr.nextSibling){let Ar=Cr.nodeType==1?Cr.nodeName.toLowerCase():null;Ar&&listTags.hasOwnProperty(Ar)&&$r?($r.appendChild(Cr),Cr=$r):Ar=="li"?$r=Cr:Ar&&($r=null)}}function matches(Tr,Cr){return(Tr.matches||Tr.msMatchesSelector||Tr.webkitMatchesSelector||Tr.mozMatchesSelector).call(Tr,Cr)}function parseStyles(Tr){let Cr=/\s*([\w-]+)\s*:\s*([^;]+)/g,$r,Ar=[];for(;$r=Cr.exec(Tr);)Ar.push($r[1],$r[2].trim());return Ar}function copy$1(Tr){let Cr={};for(let $r in Tr)Cr[$r]=Tr[$r];return Cr}function markMayApply(Tr,Cr){let $r=Cr.schema.nodes;for(let Ar in $r){let Rr=$r[Ar];if(!Rr.allowsMarkType(Tr))continue;let Dr=[],Mr=Br=>{Dr.push(Br);for(let Nr=0;Nr{if(Dr.length||Mr.marks.length){let Br=0,Nr=0;for(;Br=0;Rr--){let Dr=this.serializeMark(Cr.marks[Rr],Cr.isInline,$r);Dr&&((Dr.contentDOM||Dr.dom).appendChild(Ar),Ar=Dr.dom)}return Ar}serializeMark(Cr,$r,Ar={}){let Rr=this.marks[Cr.type.name];return Rr&&DOMSerializer.renderSpec(doc$1(Ar),Rr(Cr,$r))}static renderSpec(Cr,$r,Ar=null){if(typeof $r=="string")return{dom:Cr.createTextNode($r)};if($r.nodeType!=null)return{dom:$r};if($r.dom&&$r.dom.nodeType!=null)return $r;let Rr=$r[0],Dr=Rr.indexOf(" ");Dr>0&&(Ar=Rr.slice(0,Dr),Rr=Rr.slice(Dr+1));let Mr,Br=Ar?Cr.createElementNS(Ar,Rr):Cr.createElement(Rr),Nr=$r[1],Lr=1;if(Nr&&typeof Nr=="object"&&Nr.nodeType==null&&!Array.isArray(Nr)){Lr=2;for(let Hr in Nr)if(Nr[Hr]!=null){let zr=Hr.indexOf(" ");zr>0?Br.setAttributeNS(Hr.slice(0,zr),Hr.slice(zr+1),Nr[Hr]):Br.setAttribute(Hr,Nr[Hr])}}for(let Hr=Lr;Hr<$r.length;Hr++){let zr=$r[Hr];if(zr===0){if(Hr<$r.length-1||Hr>Lr)throw new RangeError("Content hole must be the only child of its parent node");return{dom:Br,contentDOM:Br}}else{let{dom:Ur,contentDOM:Vr}=DOMSerializer.renderSpec(Cr,zr,Ar);if(Br.appendChild(Ur),Vr){if(Mr)throw new RangeError("Multiple content holes");Mr=Vr}}}return{dom:Br,contentDOM:Mr}}static fromSchema(Cr){return Cr.cached.domSerializer||(Cr.cached.domSerializer=new DOMSerializer(this.nodesFromSchema(Cr),this.marksFromSchema(Cr)))}static nodesFromSchema(Cr){let $r=gatherToDOM(Cr.nodes);return $r.text||($r.text=Ar=>Ar.text),$r}static marksFromSchema(Cr){return gatherToDOM(Cr.marks)}}function gatherToDOM(Tr){let Cr={};for(let $r in Tr){let Ar=Tr[$r].spec.toDOM;Ar&&(Cr[$r]=Ar)}return Cr}function doc$1(Tr){return Tr.document||window.document}const lower16=65535,factor16=Math.pow(2,16);function makeRecover(Tr,Cr){return Tr+Cr*factor16}function recoverIndex(Tr){return Tr&lower16}function recoverOffset(Tr){return(Tr-(Tr&lower16))/factor16}const DEL_BEFORE=1,DEL_AFTER=2,DEL_ACROSS=4,DEL_SIDE=8;class MapResult{constructor(Cr,$r,Ar){this.pos=Cr,this.delInfo=$r,this.recover=Ar}get deleted(){return(this.delInfo&DEL_SIDE)>0}get deletedBefore(){return(this.delInfo&(DEL_BEFORE|DEL_ACROSS))>0}get deletedAfter(){return(this.delInfo&(DEL_AFTER|DEL_ACROSS))>0}get deletedAcross(){return(this.delInfo&DEL_ACROSS)>0}}class StepMap{constructor(Cr,$r=!1){if(this.ranges=Cr,this.inverted=$r,!Cr.length&&StepMap.empty)return StepMap.empty}recover(Cr){let $r=0,Ar=recoverIndex(Cr);if(!this.inverted)for(let Rr=0;RrCr)break;let Lr=this.ranges[Br+Dr],Hr=this.ranges[Br+Mr],zr=Nr+Lr;if(Cr<=zr){let Ur=Lr?Cr==Nr?-1:Cr==zr?1:$r:$r,Vr=Nr+Rr+(Ur<0?0:Hr);if(Ar)return Vr;let jr=Cr==($r<0?Nr:zr)?null:makeRecover(Br/3,Cr-Nr),Gr=Cr==Nr?DEL_AFTER:Cr==zr?DEL_BEFORE:DEL_ACROSS;return($r<0?Cr!=Nr:Cr!=zr)&&(Gr|=DEL_SIDE),new MapResult(Vr,Gr,jr)}Rr+=Hr-Lr}return Ar?Cr+Rr:new MapResult(Cr+Rr,0,null)}touches(Cr,$r){let Ar=0,Rr=recoverIndex($r),Dr=this.inverted?2:1,Mr=this.inverted?1:2;for(let Br=0;BrCr)break;let Lr=this.ranges[Br+Dr],Hr=Nr+Lr;if(Cr<=Hr&&Br==Rr*3)return!0;Ar+=this.ranges[Br+Mr]-Lr}return!1}forEach(Cr){let $r=this.inverted?2:1,Ar=this.inverted?1:2;for(let Rr=0,Dr=0;Rr=0;$r--){let Rr=Cr.getMirror($r);this.appendMap(Cr.maps[$r].invert(),Rr!=null&&Rr>$r?Ar-Rr-1:void 0)}}invert(){let Cr=new Mapping;return Cr.appendMappingInverted(this),Cr}map(Cr,$r=1){if(this.mirror)return this._map(Cr,$r,!0);for(let Ar=this.from;ArDr&&Nr!Mr.isAtom||!Br.type.allowsMarkType(this.mark.type)?Mr:Mr.mark(this.mark.addToSet(Mr.marks)),Rr),$r.openStart,$r.openEnd);return StepResult.fromReplace(Cr,this.from,this.to,Dr)}invert(){return new RemoveMarkStep(this.from,this.to,this.mark)}map(Cr){let $r=Cr.mapResult(this.from,1),Ar=Cr.mapResult(this.to,-1);return $r.deleted&&Ar.deleted||$r.pos>=Ar.pos?null:new AddMarkStep($r.pos,Ar.pos,this.mark)}merge(Cr){return Cr instanceof AddMarkStep&&Cr.mark.eq(this.mark)&&this.from<=Cr.to&&this.to>=Cr.from?new AddMarkStep(Math.min(this.from,Cr.from),Math.max(this.to,Cr.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(Cr,$r){if(typeof $r.from!="number"||typeof $r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new AddMarkStep($r.from,$r.to,Cr.markFromJSON($r.mark))}}Step.jsonID("addMark",AddMarkStep);class RemoveMarkStep extends Step{constructor(Cr,$r,Ar){super(),this.from=Cr,this.to=$r,this.mark=Ar}apply(Cr){let $r=Cr.slice(this.from,this.to),Ar=new Slice(mapFragment($r.content,Rr=>Rr.mark(this.mark.removeFromSet(Rr.marks)),Cr),$r.openStart,$r.openEnd);return StepResult.fromReplace(Cr,this.from,this.to,Ar)}invert(){return new AddMarkStep(this.from,this.to,this.mark)}map(Cr){let $r=Cr.mapResult(this.from,1),Ar=Cr.mapResult(this.to,-1);return $r.deleted&&Ar.deleted||$r.pos>=Ar.pos?null:new RemoveMarkStep($r.pos,Ar.pos,this.mark)}merge(Cr){return Cr instanceof RemoveMarkStep&&Cr.mark.eq(this.mark)&&this.from<=Cr.to&&this.to>=Cr.from?new RemoveMarkStep(Math.min(this.from,Cr.from),Math.max(this.to,Cr.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(Cr,$r){if(typeof $r.from!="number"||typeof $r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new RemoveMarkStep($r.from,$r.to,Cr.markFromJSON($r.mark))}}Step.jsonID("removeMark",RemoveMarkStep);class AddNodeMarkStep extends Step{constructor(Cr,$r){super(),this.pos=Cr,this.mark=$r}apply(Cr){let $r=Cr.nodeAt(this.pos);if(!$r)return StepResult.fail("No node at mark step's position");let Ar=$r.type.create($r.attrs,null,this.mark.addToSet($r.marks));return StepResult.fromReplace(Cr,this.pos,this.pos+1,new Slice(Fragment.from(Ar),0,$r.isLeaf?0:1))}invert(Cr){let $r=Cr.nodeAt(this.pos);if($r){let Ar=this.mark.addToSet($r.marks);if(Ar.length==$r.marks.length){for(let Rr=0;Rr<$r.marks.length;Rr++)if(!$r.marks[Rr].isInSet(Ar))return new AddNodeMarkStep(this.pos,$r.marks[Rr]);return new AddNodeMarkStep(this.pos,this.mark)}}return new RemoveNodeMarkStep(this.pos,this.mark)}map(Cr){let $r=Cr.mapResult(this.pos,1);return $r.deletedAfter?null:new AddNodeMarkStep($r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(Cr,$r){if(typeof $r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new AddNodeMarkStep($r.pos,Cr.markFromJSON($r.mark))}}Step.jsonID("addNodeMark",AddNodeMarkStep);class RemoveNodeMarkStep extends Step{constructor(Cr,$r){super(),this.pos=Cr,this.mark=$r}apply(Cr){let $r=Cr.nodeAt(this.pos);if(!$r)return StepResult.fail("No node at mark step's position");let Ar=$r.type.create($r.attrs,null,this.mark.removeFromSet($r.marks));return StepResult.fromReplace(Cr,this.pos,this.pos+1,new Slice(Fragment.from(Ar),0,$r.isLeaf?0:1))}invert(Cr){let $r=Cr.nodeAt(this.pos);return!$r||!this.mark.isInSet($r.marks)?this:new AddNodeMarkStep(this.pos,this.mark)}map(Cr){let $r=Cr.mapResult(this.pos,1);return $r.deletedAfter?null:new RemoveNodeMarkStep($r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(Cr,$r){if(typeof $r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new RemoveNodeMarkStep($r.pos,Cr.markFromJSON($r.mark))}}Step.jsonID("removeNodeMark",RemoveNodeMarkStep);class ReplaceStep extends Step{constructor(Cr,$r,Ar,Rr=!1){super(),this.from=Cr,this.to=$r,this.slice=Ar,this.structure=Rr}apply(Cr){return this.structure&&contentBetween(Cr,this.from,this.to)?StepResult.fail("Structure replace would overwrite content"):StepResult.fromReplace(Cr,this.from,this.to,this.slice)}getMap(){return new StepMap([this.from,this.to-this.from,this.slice.size])}invert(Cr){return new ReplaceStep(this.from,this.from+this.slice.size,Cr.slice(this.from,this.to))}map(Cr){let $r=Cr.mapResult(this.from,1),Ar=Cr.mapResult(this.to,-1);return $r.deletedAcross&&Ar.deletedAcross?null:new ReplaceStep($r.pos,Math.max($r.pos,Ar.pos),this.slice)}merge(Cr){if(!(Cr instanceof ReplaceStep)||Cr.structure||this.structure)return null;if(this.from+this.slice.size==Cr.from&&!this.slice.openEnd&&!Cr.slice.openStart){let $r=this.slice.size+Cr.slice.size==0?Slice.empty:new Slice(this.slice.content.append(Cr.slice.content),this.slice.openStart,Cr.slice.openEnd);return new ReplaceStep(this.from,this.to+(Cr.to-Cr.from),$r,this.structure)}else if(Cr.to==this.from&&!this.slice.openStart&&!Cr.slice.openEnd){let $r=this.slice.size+Cr.slice.size==0?Slice.empty:new Slice(Cr.slice.content.append(this.slice.content),Cr.slice.openStart,this.slice.openEnd);return new ReplaceStep(Cr.from,this.to,$r,this.structure)}else return null}toJSON(){let Cr={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(Cr.slice=this.slice.toJSON()),this.structure&&(Cr.structure=!0),Cr}static fromJSON(Cr,$r){if(typeof $r.from!="number"||typeof $r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ReplaceStep($r.from,$r.to,Slice.fromJSON(Cr,$r.slice),!!$r.structure)}}Step.jsonID("replace",ReplaceStep);class ReplaceAroundStep extends Step{constructor(Cr,$r,Ar,Rr,Dr,Mr,Br=!1){super(),this.from=Cr,this.to=$r,this.gapFrom=Ar,this.gapTo=Rr,this.slice=Dr,this.insert=Mr,this.structure=Br}apply(Cr){if(this.structure&&(contentBetween(Cr,this.from,this.gapFrom)||contentBetween(Cr,this.gapTo,this.to)))return StepResult.fail("Structure gap-replace would overwrite content");let $r=Cr.slice(this.gapFrom,this.gapTo);if($r.openStart||$r.openEnd)return StepResult.fail("Gap is not a flat range");let Ar=this.slice.insertAt(this.insert,$r.content);return Ar?StepResult.fromReplace(Cr,this.from,this.to,Ar):StepResult.fail("Content does not fit in gap")}getMap(){return new StepMap([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(Cr){let $r=this.gapTo-this.gapFrom;return new ReplaceAroundStep(this.from,this.from+this.slice.size+$r,this.from+this.insert,this.from+this.insert+$r,Cr.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(Cr){let $r=Cr.mapResult(this.from,1),Ar=Cr.mapResult(this.to,-1),Rr=Cr.map(this.gapFrom,-1),Dr=Cr.map(this.gapTo,1);return $r.deletedAcross&&Ar.deletedAcross||Rr<$r.pos||Dr>Ar.pos?null:new ReplaceAroundStep($r.pos,Ar.pos,Rr,Dr,this.slice,this.insert,this.structure)}toJSON(){let Cr={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(Cr.slice=this.slice.toJSON()),this.structure&&(Cr.structure=!0),Cr}static fromJSON(Cr,$r){if(typeof $r.from!="number"||typeof $r.to!="number"||typeof $r.gapFrom!="number"||typeof $r.gapTo!="number"||typeof $r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ReplaceAroundStep($r.from,$r.to,$r.gapFrom,$r.gapTo,Slice.fromJSON(Cr,$r.slice),$r.insert,!!$r.structure)}}Step.jsonID("replaceAround",ReplaceAroundStep);function contentBetween(Tr,Cr,$r){let Ar=Tr.resolve(Cr),Rr=$r-Cr,Dr=Ar.depth;for(;Rr>0&&Dr>0&&Ar.indexAfter(Dr)==Ar.node(Dr).childCount;)Dr--,Rr--;if(Rr>0){let Mr=Ar.node(Dr).maybeChild(Ar.indexAfter(Dr));for(;Rr>0;){if(!Mr||Mr.isLeaf)return!0;Mr=Mr.firstChild,Rr--}}return!1}function addMark(Tr,Cr,$r,Ar){let Rr=[],Dr=[],Mr,Br;Tr.doc.nodesBetween(Cr,$r,(Nr,Lr,Hr)=>{if(!Nr.isInline)return;let zr=Nr.marks;if(!Ar.isInSet(zr)&&Hr.type.allowsMarkType(Ar.type)){let Ur=Math.max(Lr,Cr),Vr=Math.min(Lr+Nr.nodeSize,$r),jr=Ar.addToSet(zr);for(let Gr=0;GrTr.step(Nr)),Dr.forEach(Nr=>Tr.step(Nr))}function removeMark(Tr,Cr,$r,Ar){let Rr=[],Dr=0;Tr.doc.nodesBetween(Cr,$r,(Mr,Br)=>{if(!Mr.isInline)return;Dr++;let Nr=null;if(Ar instanceof MarkType){let Lr=Mr.marks,Hr;for(;Hr=Ar.isInSet(Lr);)(Nr||(Nr=[])).push(Hr),Lr=Hr.removeFromSet(Lr)}else Ar?Ar.isInSet(Mr.marks)&&(Nr=[Ar]):Nr=Mr.marks;if(Nr&&Nr.length){let Lr=Math.min(Br+Mr.nodeSize,$r);for(let Hr=0;HrTr.step(new RemoveMarkStep(Mr.from,Mr.to,Mr.style)))}function clearIncompatible(Tr,Cr,$r,Ar=$r.contentMatch){let Rr=Tr.doc.nodeAt(Cr),Dr=[],Mr=Cr+1;for(let Br=0;Br=0;Br--)Tr.step(Dr[Br])}function canCut(Tr,Cr,$r){return(Cr==0||Tr.canReplace(Cr,Tr.childCount))&&($r==Tr.childCount||Tr.canReplace(0,$r))}function liftTarget(Tr){let $r=Tr.parent.content.cutByIndex(Tr.startIndex,Tr.endIndex);for(let Ar=Tr.depth;;--Ar){let Rr=Tr.$from.node(Ar),Dr=Tr.$from.index(Ar),Mr=Tr.$to.indexAfter(Ar);if(Ar$r;jr--)Gr||Ar.index(jr)>0?(Gr=!0,Hr=Fragment.from(Ar.node(jr).copy(Hr)),zr++):Nr--;let Ur=Fragment.empty,Vr=0;for(let jr=Dr,Gr=!1;jr>$r;jr--)Gr||Rr.after(jr+1)=0;Mr--){if(Ar.size){let Br=$r[Mr].type.contentMatch.matchFragment(Ar);if(!Br||!Br.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}Ar=Fragment.from($r[Mr].type.create($r[Mr].attrs,Ar))}let Rr=Cr.start,Dr=Cr.end;Tr.step(new ReplaceAroundStep(Rr,Dr,Rr,Dr,new Slice(Ar,0,0),$r.length,!0))}function setBlockType$1(Tr,Cr,$r,Ar,Rr){if(!Ar.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let Dr=Tr.steps.length;Tr.doc.nodesBetween(Cr,$r,(Mr,Br)=>{if(Mr.isTextblock&&!Mr.hasMarkup(Ar,Rr)&&canChangeType(Tr.doc,Tr.mapping.slice(Dr).map(Br),Ar)){Tr.clearIncompatible(Tr.mapping.slice(Dr).map(Br,1),Ar);let Nr=Tr.mapping.slice(Dr),Lr=Nr.map(Br,1),Hr=Nr.map(Br+Mr.nodeSize,1);return Tr.step(new ReplaceAroundStep(Lr,Hr,Lr+1,Hr-1,new Slice(Fragment.from(Ar.create(Rr,null,Mr.marks)),0,0),1,!0)),!1}})}function canChangeType(Tr,Cr,$r){let Ar=Tr.resolve(Cr),Rr=Ar.index();return Ar.parent.canReplaceWith(Rr,Rr+1,$r)}function setNodeMarkup(Tr,Cr,$r,Ar,Rr){let Dr=Tr.doc.nodeAt(Cr);if(!Dr)throw new RangeError("No node at given position");$r||($r=Dr.type);let Mr=$r.create(Ar,null,Rr||Dr.marks);if(Dr.isLeaf)return Tr.replaceWith(Cr,Cr+Dr.nodeSize,Mr);if(!$r.validContent(Dr.content))throw new RangeError("Invalid content for node type "+$r.name);Tr.step(new ReplaceAroundStep(Cr,Cr+Dr.nodeSize,Cr+1,Cr+Dr.nodeSize-1,new Slice(Fragment.from(Mr),0,0),1,!0))}function canSplit(Tr,Cr,$r=1,Ar){let Rr=Tr.resolve(Cr),Dr=Rr.depth-$r,Mr=Ar&&Ar[Ar.length-1]||Rr.parent;if(Dr<0||Rr.parent.type.spec.isolating||!Rr.parent.canReplace(Rr.index(),Rr.parent.childCount)||!Mr.type.validContent(Rr.parent.content.cutByIndex(Rr.index(),Rr.parent.childCount)))return!1;for(let Lr=Rr.depth-1,Hr=$r-2;Lr>Dr;Lr--,Hr--){let zr=Rr.node(Lr),Ur=Rr.index(Lr);if(zr.type.spec.isolating)return!1;let Vr=zr.content.cutByIndex(Ur,zr.childCount),jr=Ar&&Ar[Hr+1];jr&&(Vr=Vr.replaceChild(0,jr.type.create(jr.attrs)));let Gr=Ar&&Ar[Hr]||zr;if(!zr.canReplace(Ur+1,zr.childCount)||!Gr.type.validContent(Vr))return!1}let Br=Rr.indexAfter(Dr),Nr=Ar&&Ar[0];return Rr.node(Dr).canReplaceWith(Br,Br,Nr?Nr.type:Rr.node(Dr+1).type)}function split(Tr,Cr,$r=1,Ar){let Rr=Tr.doc.resolve(Cr),Dr=Fragment.empty,Mr=Fragment.empty;for(let Br=Rr.depth,Nr=Rr.depth-$r,Lr=$r-1;Br>Nr;Br--,Lr--){Dr=Fragment.from(Rr.node(Br).copy(Dr));let Hr=Ar&&Ar[Lr];Mr=Fragment.from(Hr?Hr.type.create(Hr.attrs,Mr):Rr.node(Br).copy(Mr))}Tr.step(new ReplaceStep(Cr,Cr,new Slice(Dr.append(Mr),$r,$r),!0))}function canJoin(Tr,Cr){let $r=Tr.resolve(Cr),Ar=$r.index();return joinable($r.nodeBefore,$r.nodeAfter)&&$r.parent.canReplace(Ar,Ar+1)}function joinable(Tr,Cr){return!!(Tr&&Cr&&!Tr.isLeaf&&Tr.canAppend(Cr))}function joinPoint(Tr,Cr,$r=-1){let Ar=Tr.resolve(Cr);for(let Rr=Ar.depth;;Rr--){let Dr,Mr,Br=Ar.index(Rr);if(Rr==Ar.depth?(Dr=Ar.nodeBefore,Mr=Ar.nodeAfter):$r>0?(Dr=Ar.node(Rr+1),Br++,Mr=Ar.node(Rr).maybeChild(Br)):(Dr=Ar.node(Rr).maybeChild(Br-1),Mr=Ar.node(Rr+1)),Dr&&!Dr.isTextblock&&joinable(Dr,Mr)&&Ar.node(Rr).canReplace(Br,Br+1))return Cr;if(Rr==0)break;Cr=$r<0?Ar.before(Rr):Ar.after(Rr)}}function join(Tr,Cr,$r){let Ar=new ReplaceStep(Cr-$r,Cr+$r,Slice.empty,!0);Tr.step(Ar)}function insertPoint(Tr,Cr,$r){let Ar=Tr.resolve(Cr);if(Ar.parent.canReplaceWith(Ar.index(),Ar.index(),$r))return Cr;if(Ar.parentOffset==0)for(let Rr=Ar.depth-1;Rr>=0;Rr--){let Dr=Ar.index(Rr);if(Ar.node(Rr).canReplaceWith(Dr,Dr,$r))return Ar.before(Rr+1);if(Dr>0)return null}if(Ar.parentOffset==Ar.parent.content.size)for(let Rr=Ar.depth-1;Rr>=0;Rr--){let Dr=Ar.indexAfter(Rr);if(Ar.node(Rr).canReplaceWith(Dr,Dr,$r))return Ar.after(Rr+1);if(Dr=0;Mr--){let Br=Mr==Ar.depth?0:Ar.pos<=(Ar.start(Mr+1)+Ar.end(Mr+1))/2?-1:1,Nr=Ar.index(Mr)+(Br>0?1:0),Lr=Ar.node(Mr),Hr=!1;if(Dr==1)Hr=Lr.canReplace(Nr,Nr,Rr);else{let zr=Lr.contentMatchAt(Nr).findWrapping(Rr.firstChild.type);Hr=zr&&Lr.canReplaceWith(Nr,Nr,zr[0])}if(Hr)return Br==0?Ar.pos:Br<0?Ar.before(Mr+1):Ar.after(Mr+1)}return null}function replaceStep(Tr,Cr,$r=Cr,Ar=Slice.empty){if(Cr==$r&&!Ar.size)return null;let Rr=Tr.resolve(Cr),Dr=Tr.resolve($r);return fitsTrivially(Rr,Dr,Ar)?new ReplaceStep(Cr,$r,Ar):new Fitter(Rr,Dr,Ar).fit()}function fitsTrivially(Tr,Cr,$r){return!$r.openStart&&!$r.openEnd&&Tr.start()==Cr.start()&&Tr.parent.canReplace(Tr.index(),Cr.index(),$r.content)}class Fitter{constructor(Cr,$r,Ar){this.$from=Cr,this.$to=$r,this.unplaced=Ar,this.frontier=[],this.placed=Fragment.empty;for(let Rr=0;Rr<=Cr.depth;Rr++){let Dr=Cr.node(Rr);this.frontier.push({type:Dr.type,match:Dr.contentMatchAt(Cr.indexAfter(Rr))})}for(let Rr=Cr.depth;Rr>0;Rr--)this.placed=Fragment.from(Cr.node(Rr).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let Lr=this.findFittable();Lr?this.placeNodes(Lr):this.openMore()||this.dropNode()}let Cr=this.mustMoveInline(),$r=this.placed.size-this.depth-this.$from.depth,Ar=this.$from,Rr=this.close(Cr<0?this.$to:Ar.doc.resolve(Cr));if(!Rr)return null;let Dr=this.placed,Mr=Ar.depth,Br=Rr.depth;for(;Mr&&Br&&Dr.childCount==1;)Dr=Dr.firstChild.content,Mr--,Br--;let Nr=new Slice(Dr,Mr,Br);return Cr>-1?new ReplaceAroundStep(Ar.pos,Cr,this.$to.pos,this.$to.end(),Nr,$r):Nr.size||Ar.pos!=this.$to.pos?new ReplaceStep(Ar.pos,Rr.pos,Nr):null}findFittable(){let Cr=this.unplaced.openStart;for(let $r=this.unplaced.content,Ar=0,Rr=this.unplaced.openEnd;Ar1&&(Rr=0),Dr.type.spec.isolating&&Rr<=Ar){Cr=Ar;break}$r=Dr.content}for(let $r=1;$r<=2;$r++)for(let Ar=$r==1?Cr:this.unplaced.openStart;Ar>=0;Ar--){let Rr,Dr=null;Ar?(Dr=contentAt(this.unplaced.content,Ar-1).firstChild,Rr=Dr.content):Rr=this.unplaced.content;let Mr=Rr.firstChild;for(let Br=this.depth;Br>=0;Br--){let{type:Nr,match:Lr}=this.frontier[Br],Hr,zr=null;if($r==1&&(Mr?Lr.matchType(Mr.type)||(zr=Lr.fillBefore(Fragment.from(Mr),!1)):Dr&&Nr.compatibleContent(Dr.type)))return{sliceDepth:Ar,frontierDepth:Br,parent:Dr,inject:zr};if($r==2&&Mr&&(Hr=Lr.findWrapping(Mr.type)))return{sliceDepth:Ar,frontierDepth:Br,parent:Dr,wrap:Hr};if(Dr&&Lr.matchType(Dr.type))break}}}openMore(){let{content:Cr,openStart:$r,openEnd:Ar}=this.unplaced,Rr=contentAt(Cr,$r);return!Rr.childCount||Rr.firstChild.isLeaf?!1:(this.unplaced=new Slice(Cr,$r+1,Math.max(Ar,Rr.size+$r>=Cr.size-Ar?$r+1:0)),!0)}dropNode(){let{content:Cr,openStart:$r,openEnd:Ar}=this.unplaced,Rr=contentAt(Cr,$r);if(Rr.childCount<=1&&$r>0){let Dr=Cr.size-$r<=$r+Rr.size;this.unplaced=new Slice(dropFromFragment(Cr,$r-1,1),$r-1,Dr?$r-1:Ar)}else this.unplaced=new Slice(dropFromFragment(Cr,$r,1),$r,Ar)}placeNodes({sliceDepth:Cr,frontierDepth:$r,parent:Ar,inject:Rr,wrap:Dr}){for(;this.depth>$r;)this.closeFrontierNode();if(Dr)for(let Gr=0;Gr1||Nr==0||Gr.content.size)&&(zr=Xr,Hr.push(closeNodeStart(Gr.mark(Ur.allowedMarks(Gr.marks)),Lr==1?Nr:0,Lr==Br.childCount?Vr:-1)))}let jr=Lr==Br.childCount;jr||(Vr=-1),this.placed=addToFragment(this.placed,$r,Fragment.from(Hr)),this.frontier[$r].match=zr,jr&&Vr<0&&Ar&&Ar.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let Gr=0,Xr=Br;Gr1&&Rr==this.$to.end(--Ar);)++Rr;return Rr}findCloseLevel(Cr){e:for(let $r=Math.min(this.depth,Cr.depth);$r>=0;$r--){let{match:Ar,type:Rr}=this.frontier[$r],Dr=$r=0;Br--){let{match:Nr,type:Lr}=this.frontier[Br],Hr=contentAfterFits(Cr,Br,Lr,Nr,!0);if(!Hr||Hr.childCount)continue e}return{depth:$r,fit:Mr,move:Dr?Cr.doc.resolve(Cr.after($r+1)):Cr}}}}close(Cr){let $r=this.findCloseLevel(Cr);if(!$r)return null;for(;this.depth>$r.depth;)this.closeFrontierNode();$r.fit.childCount&&(this.placed=addToFragment(this.placed,$r.depth,$r.fit)),Cr=$r.move;for(let Ar=$r.depth+1;Ar<=Cr.depth;Ar++){let Rr=Cr.node(Ar),Dr=Rr.type.contentMatch.fillBefore(Rr.content,!0,Cr.index(Ar));this.openFrontierNode(Rr.type,Rr.attrs,Dr)}return Cr}openFrontierNode(Cr,$r=null,Ar){let Rr=this.frontier[this.depth];Rr.match=Rr.match.matchType(Cr),this.placed=addToFragment(this.placed,this.depth,Fragment.from(Cr.create($r,Ar))),this.frontier.push({type:Cr,match:Cr.contentMatch})}closeFrontierNode(){let $r=this.frontier.pop().match.fillBefore(Fragment.empty,!0);$r.childCount&&(this.placed=addToFragment(this.placed,this.frontier.length,$r))}}function dropFromFragment(Tr,Cr,$r){return Cr==0?Tr.cutByIndex($r,Tr.childCount):Tr.replaceChild(0,Tr.firstChild.copy(dropFromFragment(Tr.firstChild.content,Cr-1,$r)))}function addToFragment(Tr,Cr,$r){return Cr==0?Tr.append($r):Tr.replaceChild(Tr.childCount-1,Tr.lastChild.copy(addToFragment(Tr.lastChild.content,Cr-1,$r)))}function contentAt(Tr,Cr){for(let $r=0;$r1&&(Ar=Ar.replaceChild(0,closeNodeStart(Ar.firstChild,Cr-1,Ar.childCount==1?$r-1:0))),Cr>0&&(Ar=Tr.type.contentMatch.fillBefore(Ar).append(Ar),$r<=0&&(Ar=Ar.append(Tr.type.contentMatch.matchFragment(Ar).fillBefore(Fragment.empty,!0)))),Tr.copy(Ar)}function contentAfterFits(Tr,Cr,$r,Ar,Rr){let Dr=Tr.node(Cr),Mr=Rr?Tr.indexAfter(Cr):Tr.index(Cr);if(Mr==Dr.childCount&&!$r.compatibleContent(Dr.type))return null;let Br=Ar.fillBefore(Dr.content,!0,Mr);return Br&&!invalidMarks($r,Dr.content,Mr)?Br:null}function invalidMarks(Tr,Cr,$r){for(let Ar=$r;Ar0;Ur--,Vr--){let jr=Rr.node(Ur).type.spec;if(jr.defining||jr.definingAsContext||jr.isolating)break;Mr.indexOf(Ur)>-1?Br=Ur:Rr.before(Ur)==Vr&&Mr.splice(1,0,-Ur)}let Nr=Mr.indexOf(Br),Lr=[],Hr=Ar.openStart;for(let Ur=Ar.content,Vr=0;;Vr++){let jr=Ur.firstChild;if(Lr.push(jr),Vr==Ar.openStart)break;Ur=jr.content}for(let Ur=Hr-1;Ur>=0;Ur--){let Vr=Lr[Ur],jr=definesContent(Vr.type);if(jr&&!Vr.sameMarkup(Rr.node(Math.abs(Br)-1)))Hr=Ur;else if(jr||!Vr.type.isTextblock)break}for(let Ur=Ar.openStart;Ur>=0;Ur--){let Vr=(Ur+Hr+1)%(Ar.openStart+1),jr=Lr[Vr];if(jr)for(let Gr=0;Gr=0&&(Tr.replace(Cr,$r,Ar),!(Tr.steps.length>zr));Ur--){let Vr=Mr[Ur];Vr<0||(Cr=Rr.before(Vr),$r=Dr.after(Vr))}}function closeFragment(Tr,Cr,$r,Ar,Rr){if(Cr<$r){let Dr=Tr.firstChild;Tr=Tr.replaceChild(0,Dr.copy(closeFragment(Dr.content,Cr+1,$r,Ar,Dr)))}if(Cr>Ar){let Dr=Rr.contentMatchAt(0),Mr=Dr.fillBefore(Tr).append(Tr);Tr=Mr.append(Dr.matchFragment(Mr).fillBefore(Fragment.empty,!0))}return Tr}function replaceRangeWith(Tr,Cr,$r,Ar){if(!Ar.isInline&&Cr==$r&&Tr.doc.resolve(Cr).parent.content.size){let Rr=insertPoint(Tr.doc,Cr,Ar.type);Rr!=null&&(Cr=$r=Rr)}Tr.replaceRange(Cr,$r,new Slice(Fragment.from(Ar),0,0))}function deleteRange$1(Tr,Cr,$r){let Ar=Tr.doc.resolve(Cr),Rr=Tr.doc.resolve($r),Dr=coveredDepths(Ar,Rr);for(let Mr=0;Mr0&&(Nr||Ar.node(Br-1).canReplace(Ar.index(Br-1),Rr.indexAfter(Br-1))))return Tr.delete(Ar.before(Br),Rr.after(Br))}for(let Mr=1;Mr<=Ar.depth&&Mr<=Rr.depth;Mr++)if(Cr-Ar.start(Mr)==Ar.depth-Mr&&$r>Ar.end(Mr)&&Rr.end(Mr)-$r!=Rr.depth-Mr)return Tr.delete(Ar.before(Mr),$r);Tr.delete(Cr,$r)}function coveredDepths(Tr,Cr){let $r=[],Ar=Math.min(Tr.depth,Cr.depth);for(let Rr=Ar;Rr>=0;Rr--){let Dr=Tr.start(Rr);if(DrCr.pos+(Cr.depth-Rr)||Tr.node(Rr).type.spec.isolating||Cr.node(Rr).type.spec.isolating)break;(Dr==Cr.start(Rr)||Rr==Tr.depth&&Rr==Cr.depth&&Tr.parent.inlineContent&&Cr.parent.inlineContent&&Rr&&Cr.start(Rr-1)==Dr-1)&&$r.push(Rr)}return $r}class AttrStep extends Step{constructor(Cr,$r,Ar){super(),this.pos=Cr,this.attr=$r,this.value=Ar}apply(Cr){let $r=Cr.nodeAt(this.pos);if(!$r)return StepResult.fail("No node at attribute step's position");let Ar=Object.create(null);for(let Dr in $r.attrs)Ar[Dr]=$r.attrs[Dr];Ar[this.attr]=this.value;let Rr=$r.type.create(Ar,null,$r.marks);return StepResult.fromReplace(Cr,this.pos,this.pos+1,new Slice(Fragment.from(Rr),0,$r.isLeaf?0:1))}getMap(){return StepMap.empty}invert(Cr){return new AttrStep(this.pos,this.attr,Cr.nodeAt(this.pos).attrs[this.attr])}map(Cr){let $r=Cr.mapResult(this.pos,1);return $r.deletedAfter?null:new AttrStep($r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(Cr,$r){if(typeof $r.pos!="number"||typeof $r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new AttrStep($r.pos,$r.attr,$r.value)}}Step.jsonID("attr",AttrStep);class DocAttrStep extends Step{constructor(Cr,$r){super(),this.attr=Cr,this.value=$r}apply(Cr){let $r=Object.create(null);for(let Rr in Cr.attrs)$r[Rr]=Cr.attrs[Rr];$r[this.attr]=this.value;let Ar=Cr.type.create($r,Cr.content,Cr.marks);return StepResult.ok(Ar)}getMap(){return StepMap.empty}invert(Cr){return new DocAttrStep(this.attr,Cr.attrs[this.attr])}map(Cr){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(Cr,$r){if(typeof $r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new DocAttrStep($r.attr,$r.value)}}Step.jsonID("docAttr",DocAttrStep);let TransformError=class extends Error{};TransformError=function Tr(Cr){let $r=Error.call(this,Cr);return $r.__proto__=Tr.prototype,$r};TransformError.prototype=Object.create(Error.prototype);TransformError.prototype.constructor=TransformError;TransformError.prototype.name="TransformError";class Transform{constructor(Cr){this.doc=Cr,this.steps=[],this.docs=[],this.mapping=new Mapping}get before(){return this.docs.length?this.docs[0]:this.doc}step(Cr){let $r=this.maybeStep(Cr);if($r.failed)throw new TransformError($r.failed);return this}maybeStep(Cr){let $r=Cr.apply(this.doc);return $r.failed||this.addStep(Cr,$r.doc),$r}get docChanged(){return this.steps.length>0}addStep(Cr,$r){this.docs.push(this.doc),this.steps.push(Cr),this.mapping.appendMap(Cr.getMap()),this.doc=$r}replace(Cr,$r=Cr,Ar=Slice.empty){let Rr=replaceStep(this.doc,Cr,$r,Ar);return Rr&&this.step(Rr),this}replaceWith(Cr,$r,Ar){return this.replace(Cr,$r,new Slice(Fragment.from(Ar),0,0))}delete(Cr,$r){return this.replace(Cr,$r,Slice.empty)}insert(Cr,$r){return this.replaceWith(Cr,Cr,$r)}replaceRange(Cr,$r,Ar){return replaceRange(this,Cr,$r,Ar),this}replaceRangeWith(Cr,$r,Ar){return replaceRangeWith(this,Cr,$r,Ar),this}deleteRange(Cr,$r){return deleteRange$1(this,Cr,$r),this}lift(Cr,$r){return lift$2(this,Cr,$r),this}join(Cr,$r=1){return join(this,Cr,$r),this}wrap(Cr,$r){return wrap(this,Cr,$r),this}setBlockType(Cr,$r=Cr,Ar,Rr=null){return setBlockType$1(this,Cr,$r,Ar,Rr),this}setNodeMarkup(Cr,$r,Ar=null,Rr){return setNodeMarkup(this,Cr,$r,Ar,Rr),this}setNodeAttribute(Cr,$r,Ar){return this.step(new AttrStep(Cr,$r,Ar)),this}setDocAttribute(Cr,$r){return this.step(new DocAttrStep(Cr,$r)),this}addNodeMark(Cr,$r){return this.step(new AddNodeMarkStep(Cr,$r)),this}removeNodeMark(Cr,$r){if(!($r instanceof Mark$1)){let Ar=this.doc.nodeAt(Cr);if(!Ar)throw new RangeError("No node at position "+Cr);if($r=$r.isInSet(Ar.marks),!$r)return this}return this.step(new RemoveNodeMarkStep(Cr,$r)),this}split(Cr,$r=1,Ar){return split(this,Cr,$r,Ar),this}addMark(Cr,$r,Ar){return addMark(this,Cr,$r,Ar),this}removeMark(Cr,$r,Ar){return removeMark(this,Cr,$r,Ar),this}clearIncompatible(Cr,$r,Ar){return clearIncompatible(this,Cr,$r,Ar),this}}const classesById=Object.create(null);class Selection{constructor(Cr,$r,Ar){this.$anchor=Cr,this.$head=$r,this.ranges=Ar||[new SelectionRange(Cr.min($r),Cr.max($r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let Cr=this.ranges;for(let $r=0;$r=0;Dr--){let Mr=$r<0?findSelectionIn(Cr.node(0),Cr.node(Dr),Cr.before(Dr+1),Cr.index(Dr),$r,Ar):findSelectionIn(Cr.node(0),Cr.node(Dr),Cr.after(Dr+1),Cr.index(Dr)+1,$r,Ar);if(Mr)return Mr}return null}static near(Cr,$r=1){return this.findFrom(Cr,$r)||this.findFrom(Cr,-$r)||new AllSelection(Cr.node(0))}static atStart(Cr){return findSelectionIn(Cr,Cr,0,0,1)||new AllSelection(Cr)}static atEnd(Cr){return findSelectionIn(Cr,Cr,Cr.content.size,Cr.childCount,-1)||new AllSelection(Cr)}static fromJSON(Cr,$r){if(!$r||!$r.type)throw new RangeError("Invalid input for Selection.fromJSON");let Ar=classesById[$r.type];if(!Ar)throw new RangeError(`No selection type ${$r.type} defined`);return Ar.fromJSON(Cr,$r)}static jsonID(Cr,$r){if(Cr in classesById)throw new RangeError("Duplicate use of selection JSON ID "+Cr);return classesById[Cr]=$r,$r.prototype.jsonID=Cr,$r}getBookmark(){return TextSelection.between(this.$anchor,this.$head).getBookmark()}}Selection.prototype.visible=!0;class SelectionRange{constructor(Cr,$r){this.$from=Cr,this.$to=$r}}let warnedAboutTextSelection=!1;function checkTextSelection(Tr){!warnedAboutTextSelection&&!Tr.parent.inlineContent&&(warnedAboutTextSelection=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+Tr.parent.type.name+")"))}class TextSelection extends Selection{constructor(Cr,$r=Cr){checkTextSelection(Cr),checkTextSelection($r),super(Cr,$r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(Cr,$r){let Ar=Cr.resolve($r.map(this.head));if(!Ar.parent.inlineContent)return Selection.near(Ar);let Rr=Cr.resolve($r.map(this.anchor));return new TextSelection(Rr.parent.inlineContent?Rr:Ar,Ar)}replace(Cr,$r=Slice.empty){if(super.replace(Cr,$r),$r==Slice.empty){let Ar=this.$from.marksAcross(this.$to);Ar&&Cr.ensureMarks(Ar)}}eq(Cr){return Cr instanceof TextSelection&&Cr.anchor==this.anchor&&Cr.head==this.head}getBookmark(){return new TextBookmark(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(Cr,$r){if(typeof $r.anchor!="number"||typeof $r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new TextSelection(Cr.resolve($r.anchor),Cr.resolve($r.head))}static create(Cr,$r,Ar=$r){let Rr=Cr.resolve($r);return new this(Rr,Ar==$r?Rr:Cr.resolve(Ar))}static between(Cr,$r,Ar){let Rr=Cr.pos-$r.pos;if((!Ar||Rr)&&(Ar=Rr>=0?1:-1),!$r.parent.inlineContent){let Dr=Selection.findFrom($r,Ar,!0)||Selection.findFrom($r,-Ar,!0);if(Dr)$r=Dr.$head;else return Selection.near($r,Ar)}return Cr.parent.inlineContent||(Rr==0?Cr=$r:(Cr=(Selection.findFrom(Cr,-Ar,!0)||Selection.findFrom(Cr,Ar,!0)).$anchor,Cr.pos<$r.pos!=Rr<0&&(Cr=$r))),new TextSelection(Cr,$r)}}Selection.jsonID("text",TextSelection);class TextBookmark{constructor(Cr,$r){this.anchor=Cr,this.head=$r}map(Cr){return new TextBookmark(Cr.map(this.anchor),Cr.map(this.head))}resolve(Cr){return TextSelection.between(Cr.resolve(this.anchor),Cr.resolve(this.head))}}class NodeSelection extends Selection{constructor(Cr){let $r=Cr.nodeAfter,Ar=Cr.node(0).resolve(Cr.pos+$r.nodeSize);super(Cr,Ar),this.node=$r}map(Cr,$r){let{deleted:Ar,pos:Rr}=$r.mapResult(this.anchor),Dr=Cr.resolve(Rr);return Ar?Selection.near(Dr):new NodeSelection(Dr)}content(){return new Slice(Fragment.from(this.node),0,0)}eq(Cr){return Cr instanceof NodeSelection&&Cr.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new NodeBookmark(this.anchor)}static fromJSON(Cr,$r){if(typeof $r.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new NodeSelection(Cr.resolve($r.anchor))}static create(Cr,$r){return new NodeSelection(Cr.resolve($r))}static isSelectable(Cr){return!Cr.isText&&Cr.type.spec.selectable!==!1}}NodeSelection.prototype.visible=!1;Selection.jsonID("node",NodeSelection);class NodeBookmark{constructor(Cr){this.anchor=Cr}map(Cr){let{deleted:$r,pos:Ar}=Cr.mapResult(this.anchor);return $r?new TextBookmark(Ar,Ar):new NodeBookmark(Ar)}resolve(Cr){let $r=Cr.resolve(this.anchor),Ar=$r.nodeAfter;return Ar&&NodeSelection.isSelectable(Ar)?new NodeSelection($r):Selection.near($r)}}class AllSelection extends Selection{constructor(Cr){super(Cr.resolve(0),Cr.resolve(Cr.content.size))}replace(Cr,$r=Slice.empty){if($r==Slice.empty){Cr.delete(0,Cr.doc.content.size);let Ar=Selection.atStart(Cr.doc);Ar.eq(Cr.selection)||Cr.setSelection(Ar)}else super.replace(Cr,$r)}toJSON(){return{type:"all"}}static fromJSON(Cr){return new AllSelection(Cr)}map(Cr){return new AllSelection(Cr)}eq(Cr){return Cr instanceof AllSelection}getBookmark(){return AllBookmark}}Selection.jsonID("all",AllSelection);const AllBookmark={map(){return this},resolve(Tr){return new AllSelection(Tr)}};function findSelectionIn(Tr,Cr,$r,Ar,Rr,Dr=!1){if(Cr.inlineContent)return TextSelection.create(Tr,$r);for(let Mr=Ar-(Rr>0?0:1);Rr>0?Mr=0;Mr+=Rr){let Br=Cr.child(Mr);if(Br.isAtom){if(!Dr&&NodeSelection.isSelectable(Br))return NodeSelection.create(Tr,$r-(Rr<0?Br.nodeSize:0))}else{let Nr=findSelectionIn(Tr,Br,$r+Rr,Rr<0?Br.childCount:0,Rr,Dr);if(Nr)return Nr}$r+=Br.nodeSize*Rr}return null}function selectionToInsertionEnd$1(Tr,Cr,$r){let Ar=Tr.steps.length-1;if(Ar{Mr==null&&(Mr=Hr)}),Tr.setSelection(Selection.near(Tr.doc.resolve(Mr),$r))}const UPDATED_SEL=1,UPDATED_MARKS=2,UPDATED_SCROLL=4;class Transaction extends Transform{constructor(Cr){super(Cr.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=Cr.selection,this.storedMarks=Cr.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(Cr){return this.storedMarks=Cr,this.updated|=UPDATED_MARKS,this}ensureMarks(Cr){return Mark$1.sameSet(this.storedMarks||this.selection.$from.marks(),Cr)||this.setStoredMarks(Cr),this}addStoredMark(Cr){return this.ensureMarks(Cr.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(Cr){return this.ensureMarks(Cr.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&UPDATED_MARKS)>0}addStep(Cr,$r){super.addStep(Cr,$r),this.updated=this.updated&~UPDATED_MARKS,this.storedMarks=null}setTime(Cr){return this.time=Cr,this}replaceSelection(Cr){return this.selection.replace(this,Cr),this}replaceSelectionWith(Cr,$r=!0){let Ar=this.selection;return $r&&(Cr=Cr.mark(this.storedMarks||(Ar.empty?Ar.$from.marks():Ar.$from.marksAcross(Ar.$to)||Mark$1.none))),Ar.replaceWith(this,Cr),this}deleteSelection(){return this.selection.replace(this),this}insertText(Cr,$r,Ar){let Rr=this.doc.type.schema;if($r==null)return Cr?this.replaceSelectionWith(Rr.text(Cr),!0):this.deleteSelection();{if(Ar==null&&(Ar=$r),Ar=Ar??$r,!Cr)return this.deleteRange($r,Ar);let Dr=this.storedMarks;if(!Dr){let Mr=this.doc.resolve($r);Dr=Ar==$r?Mr.marks():Mr.marksAcross(this.doc.resolve(Ar))}return this.replaceRangeWith($r,Ar,Rr.text(Cr,Dr)),this.selection.empty||this.setSelection(Selection.near(this.selection.$to)),this}}setMeta(Cr,$r){return this.meta[typeof Cr=="string"?Cr:Cr.key]=$r,this}getMeta(Cr){return this.meta[typeof Cr=="string"?Cr:Cr.key]}get isGeneric(){for(let Cr in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=UPDATED_SCROLL,this}get scrolledIntoView(){return(this.updated&UPDATED_SCROLL)>0}}function bind(Tr,Cr){return!Cr||!Tr?Tr:Tr.bind(Cr)}class FieldDesc{constructor(Cr,$r,Ar){this.name=Cr,this.init=bind($r.init,Ar),this.apply=bind($r.apply,Ar)}}const baseFields=[new FieldDesc("doc",{init(Tr){return Tr.doc||Tr.schema.topNodeType.createAndFill()},apply(Tr){return Tr.doc}}),new FieldDesc("selection",{init(Tr,Cr){return Tr.selection||Selection.atStart(Cr.doc)},apply(Tr){return Tr.selection}}),new FieldDesc("storedMarks",{init(Tr){return Tr.storedMarks||null},apply(Tr,Cr,$r,Ar){return Ar.selection.$cursor?Tr.storedMarks:null}}),new FieldDesc("scrollToSelection",{init(){return 0},apply(Tr,Cr){return Tr.scrolledIntoView?Cr+1:Cr}})];class Configuration{constructor(Cr,$r){this.schema=Cr,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=baseFields.slice(),$r&&$r.forEach(Ar=>{if(this.pluginsByKey[Ar.key])throw new RangeError("Adding different instances of a keyed plugin ("+Ar.key+")");this.plugins.push(Ar),this.pluginsByKey[Ar.key]=Ar,Ar.spec.state&&this.fields.push(new FieldDesc(Ar.key,Ar.spec.state,Ar))})}}class EditorState{constructor(Cr){this.config=Cr}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(Cr){return this.applyTransaction(Cr).state}filterTransaction(Cr,$r=-1){for(let Ar=0;ArAr.toJSON())),Cr&&typeof Cr=="object")for(let Ar in Cr){if(Ar=="doc"||Ar=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let Rr=Cr[Ar],Dr=Rr.spec.state;Dr&&Dr.toJSON&&($r[Ar]=Dr.toJSON.call(Rr,this[Rr.key]))}return $r}static fromJSON(Cr,$r,Ar){if(!$r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!Cr.schema)throw new RangeError("Required config field 'schema' missing");let Rr=new Configuration(Cr.schema,Cr.plugins),Dr=new EditorState(Rr);return Rr.fields.forEach(Mr=>{if(Mr.name=="doc")Dr.doc=Node$2.fromJSON(Cr.schema,$r.doc);else if(Mr.name=="selection")Dr.selection=Selection.fromJSON(Dr.doc,$r.selection);else if(Mr.name=="storedMarks")$r.storedMarks&&(Dr.storedMarks=$r.storedMarks.map(Cr.schema.markFromJSON));else{if(Ar)for(let Br in Ar){let Nr=Ar[Br],Lr=Nr.spec.state;if(Nr.key==Mr.name&&Lr&&Lr.fromJSON&&Object.prototype.hasOwnProperty.call($r,Br)){Dr[Mr.name]=Lr.fromJSON.call(Nr,Cr,$r[Br],Dr);return}}Dr[Mr.name]=Mr.init(Cr,Dr)}}),Dr}}function bindProps(Tr,Cr,$r){for(let Ar in Tr){let Rr=Tr[Ar];Rr instanceof Function?Rr=Rr.bind(Cr):Ar=="handleDOMEvents"&&(Rr=bindProps(Rr,Cr,{})),$r[Ar]=Rr}return $r}class Plugin{constructor(Cr){this.spec=Cr,this.props={},Cr.props&&bindProps(Cr.props,this,this.props),this.key=Cr.key?Cr.key.key:createKey$1("plugin")}getState(Cr){return Cr[this.key]}}const keys=Object.create(null);function createKey$1(Tr){return Tr in keys?Tr+"$"+ ++keys[Tr]:(keys[Tr]=0,Tr+"$")}class PluginKey{constructor(Cr="key"){this.key=createKey$1(Cr)}get(Cr){return Cr.config.pluginsByKey[this.key]}getState(Cr){return Cr[this.key]}}const domIndex=function(Tr){for(var Cr=0;;Cr++)if(Tr=Tr.previousSibling,!Tr)return Cr},parentNode=function(Tr){let Cr=Tr.assignedSlot||Tr.parentNode;return Cr&&Cr.nodeType==11?Cr.host:Cr};let reusedRange=null;const textRange=function(Tr,Cr,$r){let Ar=reusedRange||(reusedRange=document.createRange());return Ar.setEnd(Tr,$r??Tr.nodeValue.length),Ar.setStart(Tr,Cr||0),Ar},isEquivalentPosition=function(Tr,Cr,$r,Ar){return $r&&(scanFor(Tr,Cr,$r,Ar,-1)||scanFor(Tr,Cr,$r,Ar,1))},atomElements=/^(img|br|input|textarea|hr)$/i;function scanFor(Tr,Cr,$r,Ar,Rr){for(;;){if(Tr==$r&&Cr==Ar)return!0;if(Cr==(Rr<0?0:nodeSize(Tr))){let Dr=Tr.parentNode;if(!Dr||Dr.nodeType!=1||hasBlockDesc(Tr)||atomElements.test(Tr.nodeName)||Tr.contentEditable=="false")return!1;Cr=domIndex(Tr)+(Rr<0?0:1),Tr=Dr}else if(Tr.nodeType==1){if(Tr=Tr.childNodes[Cr+(Rr<0?-1:0)],Tr.contentEditable=="false")return!1;Cr=Rr<0?nodeSize(Tr):0}else return!1}}function nodeSize(Tr){return Tr.nodeType==3?Tr.nodeValue.length:Tr.childNodes.length}function isOnEdge(Tr,Cr,$r){for(let Ar=Cr==0,Rr=Cr==nodeSize(Tr);Ar||Rr;){if(Tr==$r)return!0;let Dr=domIndex(Tr);if(Tr=Tr.parentNode,!Tr)return!1;Ar=Ar&&Dr==0,Rr=Rr&&Dr==nodeSize(Tr)}}function hasBlockDesc(Tr){let Cr;for(let $r=Tr;$r&&!(Cr=$r.pmViewDesc);$r=$r.parentNode);return Cr&&Cr.node&&Cr.node.isBlock&&(Cr.dom==Tr||Cr.contentDOM==Tr)}const selectionCollapsed=function(Tr){return Tr.focusNode&&isEquivalentPosition(Tr.focusNode,Tr.focusOffset,Tr.anchorNode,Tr.anchorOffset)};function keyEvent(Tr,Cr){let $r=document.createEvent("Event");return $r.initEvent("keydown",!0,!0),$r.keyCode=Tr,$r.key=$r.code=Cr,$r}function deepActiveElement(Tr){let Cr=Tr.activeElement;for(;Cr&&Cr.shadowRoot;)Cr=Cr.shadowRoot.activeElement;return Cr}function caretFromPoint(Tr,Cr,$r){if(Tr.caretPositionFromPoint)try{let Ar=Tr.caretPositionFromPoint(Cr,$r);if(Ar)return{node:Ar.offsetNode,offset:Ar.offset}}catch{}if(Tr.caretRangeFromPoint){let Ar=Tr.caretRangeFromPoint(Cr,$r);if(Ar)return{node:Ar.startContainer,offset:Ar.startOffset}}}const nav=typeof navigator<"u"?navigator:null,doc=typeof document<"u"?document:null,agent=nav&&nav.userAgent||"",ie_edge=/Edge\/(\d+)/.exec(agent),ie_upto10=/MSIE \d/.exec(agent),ie_11up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(agent),ie$1=!!(ie_upto10||ie_11up||ie_edge),ie_version=ie_upto10?document.documentMode:ie_11up?+ie_11up[1]:ie_edge?+ie_edge[1]:0,gecko=!ie$1&&/gecko\/(\d+)/i.test(agent);gecko&&+(/Firefox\/(\d+)/.exec(agent)||[0,0])[1];const _chrome=!ie$1&&/Chrome\/(\d+)/.exec(agent),chrome=!!_chrome,chrome_version=_chrome?+_chrome[1]:0,safari=!ie$1&&!!nav&&/Apple Computer/.test(nav.vendor),ios=safari&&(/Mobile\/\w+/.test(agent)||!!nav&&nav.maxTouchPoints>2),mac$2=ios||(nav?/Mac/.test(nav.platform):!1),windows=nav?/Win/.test(nav.platform):!1,android=/Android \d/.test(agent),webkit=!!doc&&"webkitFontSmoothing"in doc.documentElement.style,webkit_version=webkit?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function windowRect(Tr){return{left:0,right:Tr.documentElement.clientWidth,top:0,bottom:Tr.documentElement.clientHeight}}function getSide(Tr,Cr){return typeof Tr=="number"?Tr:Tr[Cr]}function clientRect(Tr){let Cr=Tr.getBoundingClientRect(),$r=Cr.width/Tr.offsetWidth||1,Ar=Cr.height/Tr.offsetHeight||1;return{left:Cr.left,right:Cr.left+Tr.clientWidth*$r,top:Cr.top,bottom:Cr.top+Tr.clientHeight*Ar}}function scrollRectIntoView(Tr,Cr,$r){let Ar=Tr.someProp("scrollThreshold")||0,Rr=Tr.someProp("scrollMargin")||5,Dr=Tr.dom.ownerDocument;for(let Mr=$r||Tr.dom;Mr;Mr=parentNode(Mr)){if(Mr.nodeType!=1)continue;let Br=Mr,Nr=Br==Dr.body,Lr=Nr?windowRect(Dr):clientRect(Br),Hr=0,zr=0;if(Cr.topLr.bottom-getSide(Ar,"bottom")&&(zr=Cr.bottom-Cr.top>Lr.bottom-Lr.top?Cr.top+getSide(Rr,"top")-Lr.top:Cr.bottom-Lr.bottom+getSide(Rr,"bottom")),Cr.leftLr.right-getSide(Ar,"right")&&(Hr=Cr.right-Lr.right+getSide(Rr,"right")),Hr||zr)if(Nr)Dr.defaultView.scrollBy(Hr,zr);else{let Ur=Br.scrollLeft,Vr=Br.scrollTop;zr&&(Br.scrollTop+=zr),Hr&&(Br.scrollLeft+=Hr);let jr=Br.scrollLeft-Ur,Gr=Br.scrollTop-Vr;Cr={left:Cr.left-jr,top:Cr.top-Gr,right:Cr.right-jr,bottom:Cr.bottom-Gr}}if(Nr||/^(fixed|sticky)$/.test(getComputedStyle(Mr).position))break}}function storeScrollPos(Tr){let Cr=Tr.dom.getBoundingClientRect(),$r=Math.max(0,Cr.top),Ar,Rr;for(let Dr=(Cr.left+Cr.right)/2,Mr=$r+1;Mr=$r-20){Ar=Br,Rr=Nr.top;break}}return{refDOM:Ar,refTop:Rr,stack:scrollStack(Tr.dom)}}function scrollStack(Tr){let Cr=[],$r=Tr.ownerDocument;for(let Ar=Tr;Ar&&(Cr.push({dom:Ar,top:Ar.scrollTop,left:Ar.scrollLeft}),Tr!=$r);Ar=parentNode(Ar));return Cr}function resetScrollPos({refDOM:Tr,refTop:Cr,stack:$r}){let Ar=Tr?Tr.getBoundingClientRect().top:0;restoreScrollStack($r,Ar==0?0:Ar-Cr)}function restoreScrollStack(Tr,Cr){for(let $r=0;$r=Br){Mr=Math.max(jr.bottom,Mr),Br=Math.min(jr.top,Br);let Gr=jr.left>Cr.left?jr.left-Cr.left:jr.right=(jr.left+jr.right)/2?1:0));continue}}else jr.top>Cr.top&&!Nr&&jr.left<=Cr.left&&jr.right>=Cr.left&&(Nr=Hr,Lr={left:Math.max(jr.left,Math.min(jr.right,Cr.left)),top:jr.top});!$r&&(Cr.left>=jr.right&&Cr.top>=jr.top||Cr.left>=jr.left&&Cr.top>=jr.bottom)&&(Dr=zr+1)}}return!$r&&Nr&&($r=Nr,Rr=Lr,Ar=0),$r&&$r.nodeType==3?findOffsetInText($r,Rr):!$r||Ar&&$r.nodeType==1?{node:Tr,offset:Dr}:findOffsetInNode($r,Rr)}function findOffsetInText(Tr,Cr){let $r=Tr.nodeValue.length,Ar=document.createRange();for(let Rr=0;Rr<$r;Rr++){Ar.setEnd(Tr,Rr+1),Ar.setStart(Tr,Rr);let Dr=singleRect(Ar,1);if(Dr.top!=Dr.bottom&&inRect(Cr,Dr))return{node:Tr,offset:Rr+(Cr.left>=(Dr.left+Dr.right)/2?1:0)}}return{node:Tr,offset:0}}function inRect(Tr,Cr){return Tr.left>=Cr.left-1&&Tr.left<=Cr.right+1&&Tr.top>=Cr.top-1&&Tr.top<=Cr.bottom+1}function targetKludge(Tr,Cr){let $r=Tr.parentNode;return $r&&/^li$/i.test($r.nodeName)&&Cr.left(Mr.left+Mr.right)/2?1:-1}return Tr.docView.posFromDOM(Ar,Rr,Dr)}function posFromCaret(Tr,Cr,$r,Ar){let Rr=-1;for(let Dr=Cr,Mr=!1;Dr!=Tr.dom;){let Br=Tr.docView.nearestDesc(Dr,!0);if(!Br)return null;if(Br.dom.nodeType==1&&(Br.node.isBlock&&Br.parent&&!Mr||!Br.contentDOM)){let Nr=Br.dom.getBoundingClientRect();if(Br.node.isBlock&&Br.parent&&!Mr&&(Mr=!0,Nr.left>Ar.left||Nr.top>Ar.top?Rr=Br.posBefore:(Nr.right-1?Rr:Tr.docView.posFromDOM(Cr,$r,-1)}function elementFromPoint(Tr,Cr,$r){let Ar=Tr.childNodes.length;if(Ar&&$r.top<$r.bottom)for(let Rr=Math.max(0,Math.min(Ar-1,Math.floor(Ar*(Cr.top-$r.top)/($r.bottom-$r.top))-2)),Dr=Rr;;){let Mr=Tr.childNodes[Dr];if(Mr.nodeType==1){let Br=Mr.getClientRects();for(let Nr=0;NrCr.top&&Rr++}let Lr;webkit&&Rr&&Ar.nodeType==1&&(Lr=Ar.childNodes[Rr-1]).nodeType==1&&Lr.contentEditable=="false"&&Lr.getBoundingClientRect().top>=Cr.top&&Rr--,Ar==Tr.dom&&Rr==Ar.childNodes.length-1&&Ar.lastChild.nodeType==1&&Cr.top>Ar.lastChild.getBoundingClientRect().bottom?Br=Tr.state.doc.content.size:(Rr==0||Ar.nodeType!=1||Ar.childNodes[Rr-1].nodeName!="BR")&&(Br=posFromCaret(Tr,Ar,Rr,Cr))}Br==null&&(Br=posFromElement(Tr,Mr,Cr));let Nr=Tr.docView.nearestDesc(Mr,!0);return{pos:Br,inside:Nr?Nr.posAtStart-Nr.border:-1}}function nonZero(Tr){return Tr.top=0&&Rr==Ar.nodeValue.length?(Nr--,Hr=1):$r<0?Nr--:Lr++,flattenV(singleRect(textRange(Ar,Nr,Lr),Hr),Hr<0)}if(!Tr.state.doc.resolve(Cr-(Dr||0)).parent.inlineContent){if(Dr==null&&Rr&&($r<0||Rr==nodeSize(Ar))){let Nr=Ar.childNodes[Rr-1];if(Nr.nodeType==1)return flattenH(Nr.getBoundingClientRect(),!1)}if(Dr==null&&Rr=0)}if(Dr==null&&Rr&&($r<0||Rr==nodeSize(Ar))){let Nr=Ar.childNodes[Rr-1],Lr=Nr.nodeType==3?textRange(Nr,nodeSize(Nr)-(Mr?0:1)):Nr.nodeType==1&&(Nr.nodeName!="BR"||!Nr.nextSibling)?Nr:null;if(Lr)return flattenV(singleRect(Lr,1),!1)}if(Dr==null&&Rr=0)}function flattenV(Tr,Cr){if(Tr.width==0)return Tr;let $r=Cr?Tr.left:Tr.right;return{top:Tr.top,bottom:Tr.bottom,left:$r,right:$r}}function flattenH(Tr,Cr){if(Tr.height==0)return Tr;let $r=Cr?Tr.top:Tr.bottom;return{top:$r,bottom:$r,left:Tr.left,right:Tr.right}}function withFlushedState(Tr,Cr,$r){let Ar=Tr.state,Rr=Tr.root.activeElement;Ar!=Cr&&Tr.updateState(Cr),Rr!=Tr.dom&&Tr.focus();try{return $r()}finally{Ar!=Cr&&Tr.updateState(Ar),Rr!=Tr.dom&&Rr&&Rr.focus()}}function endOfTextblockVertical(Tr,Cr,$r){let Ar=Cr.selection,Rr=$r=="up"?Ar.$from:Ar.$to;return withFlushedState(Tr,Cr,()=>{let{node:Dr}=Tr.docView.domFromPos(Rr.pos,$r=="up"?-1:1);for(;;){let Br=Tr.docView.nearestDesc(Dr,!0);if(!Br)break;if(Br.node.isBlock){Dr=Br.contentDOM||Br.dom;break}Dr=Br.dom.parentNode}let Mr=coordsAtPos(Tr,Rr.pos,1);for(let Br=Dr.firstChild;Br;Br=Br.nextSibling){let Nr;if(Br.nodeType==1)Nr=Br.getClientRects();else if(Br.nodeType==3)Nr=textRange(Br,0,Br.nodeValue.length).getClientRects();else continue;for(let Lr=0;LrHr.top+1&&($r=="up"?Mr.top-Hr.top>(Hr.bottom-Mr.top)*2:Hr.bottom-Mr.bottom>(Mr.bottom-Hr.top)*2))return!1}}return!0})}const maybeRTL=/[\u0590-\u08ac]/;function endOfTextblockHorizontal(Tr,Cr,$r){let{$head:Ar}=Cr.selection;if(!Ar.parent.isTextblock)return!1;let Rr=Ar.parentOffset,Dr=!Rr,Mr=Rr==Ar.parent.content.size,Br=Tr.domSelection();return!maybeRTL.test(Ar.parent.textContent)||!Br.modify?$r=="left"||$r=="backward"?Dr:Mr:withFlushedState(Tr,Cr,()=>{let{focusNode:Nr,focusOffset:Lr,anchorNode:Hr,anchorOffset:zr}=Tr.domSelectionRange(),Ur=Br.caretBidiLevel;Br.modify("move",$r,"character");let Vr=Ar.depth?Tr.docView.domAfterPos(Ar.before()):Tr.dom,{focusNode:jr,focusOffset:Gr}=Tr.domSelectionRange(),Xr=jr&&!Vr.contains(jr.nodeType==1?jr:jr.parentNode)||Nr==jr&&Lr==Gr;try{Br.collapse(Hr,zr),Nr&&(Nr!=Hr||Lr!=zr)&&Br.extend&&Br.extend(Nr,Lr)}catch{}return Ur!=null&&(Br.caretBidiLevel=Ur),Xr})}let cachedState=null,cachedDir=null,cachedResult=!1;function endOfTextblock(Tr,Cr,$r){return cachedState==Cr&&cachedDir==$r?cachedResult:(cachedState=Cr,cachedDir=$r,cachedResult=$r=="up"||$r=="down"?endOfTextblockVertical(Tr,Cr,$r):endOfTextblockHorizontal(Tr,Cr,$r))}const NOT_DIRTY=0,CHILD_DIRTY=1,CONTENT_DIRTY=2,NODE_DIRTY=3;class ViewDesc{constructor(Cr,$r,Ar,Rr){this.parent=Cr,this.children=$r,this.dom=Ar,this.contentDOM=Rr,this.dirty=NOT_DIRTY,Ar.pmViewDesc=this}matchesWidget(Cr){return!1}matchesMark(Cr){return!1}matchesNode(Cr,$r,Ar){return!1}matchesHack(Cr){return!1}parseRule(){return null}stopEvent(Cr){return!1}get size(){let Cr=0;for(let $r=0;$rdomIndex(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))Rr=Cr.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if($r==0)for(let Dr=Cr;;Dr=Dr.parentNode){if(Dr==this.dom){Rr=!1;break}if(Dr.previousSibling)break}if(Rr==null&&$r==Cr.childNodes.length)for(let Dr=Cr;;Dr=Dr.parentNode){if(Dr==this.dom){Rr=!0;break}if(Dr.nextSibling)break}}return Rr??Ar>0?this.posAtEnd:this.posAtStart}nearestDesc(Cr,$r=!1){for(let Ar=!0,Rr=Cr;Rr;Rr=Rr.parentNode){let Dr=this.getDesc(Rr),Mr;if(Dr&&(!$r||Dr.node))if(Ar&&(Mr=Dr.nodeDOM)&&!(Mr.nodeType==1?Mr.contains(Cr.nodeType==1?Cr:Cr.parentNode):Mr==Cr))Ar=!1;else return Dr}}getDesc(Cr){let $r=Cr.pmViewDesc;for(let Ar=$r;Ar;Ar=Ar.parent)if(Ar==this)return $r}posFromDOM(Cr,$r,Ar){for(let Rr=Cr;Rr;Rr=Rr.parentNode){let Dr=this.getDesc(Rr);if(Dr)return Dr.localPosFromDOM(Cr,$r,Ar)}return-1}descAt(Cr){for(let $r=0,Ar=0;$rCr||Mr instanceof TrailingHackViewDesc){Rr=Cr-Dr;break}Dr=Br}if(Rr)return this.children[Ar].domFromPos(Rr-this.children[Ar].border,$r);for(let Dr;Ar&&!(Dr=this.children[Ar-1]).size&&Dr instanceof WidgetViewDesc&&Dr.side>=0;Ar--);if($r<=0){let Dr,Mr=!0;for(;Dr=Ar?this.children[Ar-1]:null,!(!Dr||Dr.dom.parentNode==this.contentDOM);Ar--,Mr=!1);return Dr&&$r&&Mr&&!Dr.border&&!Dr.domAtom?Dr.domFromPos(Dr.size,$r):{node:this.contentDOM,offset:Dr?domIndex(Dr.dom)+1:0}}else{let Dr,Mr=!0;for(;Dr=Ar=Hr&&$r<=Lr-Nr.border&&Nr.node&&Nr.contentDOM&&this.contentDOM.contains(Nr.contentDOM))return Nr.parseRange(Cr,$r,Hr);Cr=Mr;for(let zr=Br;zr>0;zr--){let Ur=this.children[zr-1];if(Ur.size&&Ur.dom.parentNode==this.contentDOM&&!Ur.emptyChildAt(1)){Rr=domIndex(Ur.dom)+1;break}Cr-=Ur.size}Rr==-1&&(Rr=0)}if(Rr>-1&&(Lr>$r||Br==this.children.length-1)){$r=Lr;for(let Hr=Br+1;HrVr&&Mr$r){let Vr=Br;Br=Nr,Nr=Vr}let Ur=document.createRange();Ur.setEnd(Nr.node,Nr.offset),Ur.setStart(Br.node,Br.offset),Lr.removeAllRanges(),Lr.addRange(Ur)}}ignoreMutation(Cr){return!this.contentDOM&&Cr.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(Cr,$r){for(let Ar=0,Rr=0;Rr=Ar:CrAr){let Br=Ar+Dr.border,Nr=Mr-Dr.border;if(Cr>=Br&&$r<=Nr){this.dirty=Cr==Ar||$r==Mr?CONTENT_DIRTY:CHILD_DIRTY,Cr==Br&&$r==Nr&&(Dr.contentLost||Dr.dom.parentNode!=this.contentDOM)?Dr.dirty=NODE_DIRTY:Dr.markDirty(Cr-Br,$r-Br);return}else Dr.dirty=Dr.dom==Dr.contentDOM&&Dr.dom.parentNode==this.contentDOM&&!Dr.children.length?CONTENT_DIRTY:NODE_DIRTY}Ar=Mr}this.dirty=CONTENT_DIRTY}markParentsDirty(){let Cr=1;for(let $r=this.parent;$r;$r=$r.parent,Cr++){let Ar=Cr==1?CONTENT_DIRTY:CHILD_DIRTY;$r.dirty{if(!Dr)return Rr;if(Dr.parent)return Dr.parent.posBeforeChild(Dr)})),!$r.type.spec.raw){if(Mr.nodeType!=1){let Br=document.createElement("span");Br.appendChild(Mr),Mr=Br}Mr.contentEditable="false",Mr.classList.add("ProseMirror-widget")}super(Cr,[],Mr,null),this.widget=$r,this.widget=$r,Dr=this}matchesWidget(Cr){return this.dirty==NOT_DIRTY&&Cr.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(Cr){let $r=this.widget.spec.stopEvent;return $r?$r(Cr):!1}ignoreMutation(Cr){return Cr.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class CompositionViewDesc extends ViewDesc{constructor(Cr,$r,Ar,Rr){super(Cr,[],$r,null),this.textDOM=Ar,this.text=Rr}get size(){return this.text.length}localPosFromDOM(Cr,$r){return Cr!=this.textDOM?this.posAtStart+($r?this.size:0):this.posAtStart+$r}domFromPos(Cr){return{node:this.textDOM,offset:Cr}}ignoreMutation(Cr){return Cr.type==="characterData"&&Cr.target.nodeValue==Cr.oldValue}}class MarkViewDesc extends ViewDesc{constructor(Cr,$r,Ar,Rr){super(Cr,[],Ar,Rr),this.mark=$r}static create(Cr,$r,Ar,Rr){let Dr=Rr.nodeViews[$r.type.name],Mr=Dr&&Dr($r,Rr,Ar);return(!Mr||!Mr.dom)&&(Mr=DOMSerializer.renderSpec(document,$r.type.spec.toDOM($r,Ar))),new MarkViewDesc(Cr,$r,Mr.dom,Mr.contentDOM||Mr.dom)}parseRule(){return this.dirty&NODE_DIRTY||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(Cr){return this.dirty!=NODE_DIRTY&&this.mark.eq(Cr)}markDirty(Cr,$r){if(super.markDirty(Cr,$r),this.dirty!=NOT_DIRTY){let Ar=this.parent;for(;!Ar.node;)Ar=Ar.parent;Ar.dirty0&&(Dr=replaceNodes(Dr,0,Cr,Ar));for(let Br=0;Br{if(!Nr)return Mr;if(Nr.parent)return Nr.parent.posBeforeChild(Nr)},Ar,Rr),Hr=Lr&&Lr.dom,zr=Lr&&Lr.contentDOM;if($r.isText){if(!Hr)Hr=document.createTextNode($r.text);else if(Hr.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else Hr||({dom:Hr,contentDOM:zr}=DOMSerializer.renderSpec(document,$r.type.spec.toDOM($r)));!zr&&!$r.isText&&Hr.nodeName!="BR"&&(Hr.hasAttribute("contenteditable")||(Hr.contentEditable="false"),$r.type.spec.draggable&&(Hr.draggable=!0));let Ur=Hr;return Hr=applyOuterDeco(Hr,Ar,$r),Lr?Nr=new CustomNodeViewDesc(Cr,$r,Ar,Rr,Hr,zr||null,Ur,Lr,Dr,Mr+1):$r.isText?new TextViewDesc(Cr,$r,Ar,Rr,Hr,Ur,Dr):new NodeViewDesc(Cr,$r,Ar,Rr,Hr,zr||null,Ur,Dr,Mr+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let Cr={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(Cr.preserveWhitespace="full"),!this.contentDOM)Cr.getContent=()=>this.node.content;else if(!this.contentLost)Cr.contentElement=this.contentDOM;else{for(let $r=this.children.length-1;$r>=0;$r--){let Ar=this.children[$r];if(this.dom.contains(Ar.dom.parentNode)){Cr.contentElement=Ar.dom.parentNode;break}}Cr.contentElement||(Cr.getContent=()=>Fragment.empty)}return Cr}matchesNode(Cr,$r,Ar){return this.dirty==NOT_DIRTY&&Cr.eq(this.node)&&sameOuterDeco($r,this.outerDeco)&&Ar.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(Cr,$r){let Ar=this.node.inlineContent,Rr=$r,Dr=Cr.composing?this.localCompositionInfo(Cr,$r):null,Mr=Dr&&Dr.pos>-1?Dr:null,Br=Dr&&Dr.pos<0,Nr=new ViewTreeUpdater(this,Mr&&Mr.node,Cr);iterDeco(this.node,this.innerDeco,(Lr,Hr,zr)=>{Lr.spec.marks?Nr.syncToMarks(Lr.spec.marks,Ar,Cr):Lr.type.side>=0&&!zr&&Nr.syncToMarks(Hr==this.node.childCount?Mark$1.none:this.node.child(Hr).marks,Ar,Cr),Nr.placeWidget(Lr,Cr,Rr)},(Lr,Hr,zr,Ur)=>{Nr.syncToMarks(Lr.marks,Ar,Cr);let Vr;Nr.findNodeMatch(Lr,Hr,zr,Ur)||Br&&Cr.state.selection.from>Rr&&Cr.state.selection.to-1&&Nr.updateNodeAt(Lr,Hr,zr,Vr,Cr)||Nr.updateNextNode(Lr,Hr,zr,Cr,Ur,Rr)||Nr.addNode(Lr,Hr,zr,Cr,Rr),Rr+=Lr.nodeSize}),Nr.syncToMarks([],Ar,Cr),this.node.isTextblock&&Nr.addTextblockHacks(),Nr.destroyRest(),(Nr.changed||this.dirty==CONTENT_DIRTY)&&(Mr&&this.protectLocalComposition(Cr,Mr),renderDescs(this.contentDOM,this.children,Cr),ios&&iosHacks(this.dom))}localCompositionInfo(Cr,$r){let{from:Ar,to:Rr}=Cr.state.selection;if(!(Cr.state.selection instanceof TextSelection)||Ar<$r||Rr>$r+this.node.content.size)return null;let Dr=Cr.domSelectionRange(),Mr=nearbyTextNode(Dr.focusNode,Dr.focusOffset);if(!Mr||!this.dom.contains(Mr.parentNode))return null;if(this.node.inlineContent){let Br=Mr.nodeValue,Nr=findTextInFragment(this.node.content,Br,Ar-$r,Rr-$r);return Nr<0?null:{node:Mr,pos:Nr,text:Br}}else return{node:Mr,pos:-1,text:""}}protectLocalComposition(Cr,{node:$r,pos:Ar,text:Rr}){if(this.getDesc($r))return;let Dr=$r;for(;Dr.parentNode!=this.contentDOM;Dr=Dr.parentNode){for(;Dr.previousSibling;)Dr.parentNode.removeChild(Dr.previousSibling);for(;Dr.nextSibling;)Dr.parentNode.removeChild(Dr.nextSibling);Dr.pmViewDesc&&(Dr.pmViewDesc=void 0)}let Mr=new CompositionViewDesc(this,Dr,$r,Rr);Cr.input.compositionNodes.push(Mr),this.children=replaceNodes(this.children,Ar,Ar+Rr.length,Cr,Mr)}update(Cr,$r,Ar,Rr){return this.dirty==NODE_DIRTY||!Cr.sameMarkup(this.node)?!1:(this.updateInner(Cr,$r,Ar,Rr),!0)}updateInner(Cr,$r,Ar,Rr){this.updateOuterDeco($r),this.node=Cr,this.innerDeco=Ar,this.contentDOM&&this.updateChildren(Rr,this.posAtStart),this.dirty=NOT_DIRTY}updateOuterDeco(Cr){if(sameOuterDeco(Cr,this.outerDeco))return;let $r=this.nodeDOM.nodeType!=1,Ar=this.dom;this.dom=patchOuterDeco(this.dom,this.nodeDOM,computeOuterDeco(this.outerDeco,this.node,$r),computeOuterDeco(Cr,this.node,$r)),this.dom!=Ar&&(Ar.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=Cr}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function docViewDesc(Tr,Cr,$r,Ar,Rr){applyOuterDeco(Ar,Cr,Tr);let Dr=new NodeViewDesc(void 0,Tr,Cr,$r,Ar,Ar,Ar,Rr,0);return Dr.contentDOM&&Dr.updateChildren(Rr,0),Dr}class TextViewDesc extends NodeViewDesc{constructor(Cr,$r,Ar,Rr,Dr,Mr,Br){super(Cr,$r,Ar,Rr,Dr,null,Mr,Br,0)}parseRule(){let Cr=this.nodeDOM.parentNode;for(;Cr&&Cr!=this.dom&&!Cr.pmIsDeco;)Cr=Cr.parentNode;return{skip:Cr||!0}}update(Cr,$r,Ar,Rr){return this.dirty==NODE_DIRTY||this.dirty!=NOT_DIRTY&&!this.inParent()||!Cr.sameMarkup(this.node)?!1:(this.updateOuterDeco($r),(this.dirty!=NOT_DIRTY||Cr.text!=this.node.text)&&Cr.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=Cr.text,Rr.trackWrites==this.nodeDOM&&(Rr.trackWrites=null)),this.node=Cr,this.dirty=NOT_DIRTY,!0)}inParent(){let Cr=this.parent.contentDOM;for(let $r=this.nodeDOM;$r;$r=$r.parentNode)if($r==Cr)return!0;return!1}domFromPos(Cr){return{node:this.nodeDOM,offset:Cr}}localPosFromDOM(Cr,$r,Ar){return Cr==this.nodeDOM?this.posAtStart+Math.min($r,this.node.text.length):super.localPosFromDOM(Cr,$r,Ar)}ignoreMutation(Cr){return Cr.type!="characterData"&&Cr.type!="selection"}slice(Cr,$r,Ar){let Rr=this.node.cut(Cr,$r),Dr=document.createTextNode(Rr.text);return new TextViewDesc(this.parent,Rr,this.outerDeco,this.innerDeco,Dr,Dr,Ar)}markDirty(Cr,$r){super.markDirty(Cr,$r),this.dom!=this.nodeDOM&&(Cr==0||$r==this.nodeDOM.nodeValue.length)&&(this.dirty=NODE_DIRTY)}get domAtom(){return!1}}class TrailingHackViewDesc extends ViewDesc{parseRule(){return{ignore:!0}}matchesHack(Cr){return this.dirty==NOT_DIRTY&&this.dom.nodeName==Cr}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class CustomNodeViewDesc extends NodeViewDesc{constructor(Cr,$r,Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr){super(Cr,$r,Ar,Rr,Dr,Mr,Br,Lr,Hr),this.spec=Nr}update(Cr,$r,Ar,Rr){if(this.dirty==NODE_DIRTY)return!1;if(this.spec.update){let Dr=this.spec.update(Cr,$r,Ar);return Dr&&this.updateInner(Cr,$r,Ar,Rr),Dr}else return!this.contentDOM&&!Cr.isLeaf?!1:super.update(Cr,$r,Ar,Rr)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(Cr,$r,Ar,Rr){this.spec.setSelection?this.spec.setSelection(Cr,$r,Ar):super.setSelection(Cr,$r,Ar,Rr)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(Cr){return this.spec.stopEvent?this.spec.stopEvent(Cr):!1}ignoreMutation(Cr){return this.spec.ignoreMutation?this.spec.ignoreMutation(Cr):super.ignoreMutation(Cr)}}function renderDescs(Tr,Cr,$r){let Ar=Tr.firstChild,Rr=!1;for(let Dr=0;Dr>1,Mr=Math.min(Dr,Cr.length);for(;Rr-1)Br>this.index&&(this.changed=!0,this.destroyBetween(this.index,Br)),this.top=this.top.children[this.index];else{let Nr=MarkViewDesc.create(this.top,Cr[Dr],$r,Ar);this.top.children.splice(this.index,0,Nr),this.top=Nr,this.changed=!0}this.index=0,Dr++}}findNodeMatch(Cr,$r,Ar,Rr){let Dr=-1,Mr;if(Rr>=this.preMatch.index&&(Mr=this.preMatch.matches[Rr-this.preMatch.index]).parent==this.top&&Mr.matchesNode(Cr,$r,Ar))Dr=this.top.children.indexOf(Mr,this.index);else for(let Br=this.index,Nr=Math.min(this.top.children.length,Br+5);Br0;){let Br;for(;;)if(Ar){let Lr=$r.children[Ar-1];if(Lr instanceof MarkViewDesc)$r=Lr,Ar=Lr.children.length;else{Br=Lr,Ar--;break}}else{if($r==Cr)break e;Ar=$r.parent.children.indexOf($r),$r=$r.parent}let Nr=Br.node;if(Nr){if(Nr!=Tr.child(Rr-1))break;--Rr,Dr.set(Br,Rr),Mr.push(Br)}}return{index:Rr,matched:Dr,matches:Mr.reverse()}}function compareSide(Tr,Cr){return Tr.type.side-Cr.type.side}function iterDeco(Tr,Cr,$r,Ar){let Rr=Cr.locals(Tr),Dr=0;if(Rr.length==0){for(let Lr=0;LrDr;)Br.push(Rr[Mr++]);let jr=Dr+Ur.nodeSize;if(Ur.isText){let Xr=jr;Mr!Xr.inline):Br.slice();Ar(Ur,Gr,Cr.forChild(Dr,Ur),Vr),Dr=jr}}function iosHacks(Tr){if(Tr.nodeName=="UL"||Tr.nodeName=="OL"){let Cr=Tr.style.cssText;Tr.style.cssText=Cr+"; list-style: square !important",window.getComputedStyle(Tr).listStyle,Tr.style.cssText=Cr}}function nearbyTextNode(Tr,Cr){for(;;){if(Tr.nodeType==3)return Tr;if(Tr.nodeType==1&&Cr>0){if(Tr.childNodes.length>Cr&&Tr.childNodes[Cr].nodeType==3)return Tr.childNodes[Cr];Tr=Tr.childNodes[Cr-1],Cr=nodeSize(Tr)}else if(Tr.nodeType==1&&Cr=$r){if(Dr>=Ar&&Nr.slice(Ar-Cr.length-Br,Ar-Br)==Cr)return Ar-Cr.length;let Lr=Br=0&&Lr+Cr.length+Br>=$r)return Br+Lr;if($r==Ar&&Nr.length>=Ar+Cr.length-Br&&Nr.slice(Ar-Br,Ar-Br+Cr.length)==Cr)return Ar}}return-1}function replaceNodes(Tr,Cr,$r,Ar,Rr){let Dr=[];for(let Mr=0,Br=0;Mr=$r||Hr<=Cr?Dr.push(Nr):(Lr$r&&Dr.push(Nr.slice($r-Lr,Nr.size,Ar)))}return Dr}function selectionFromDOM(Tr,Cr=null){let $r=Tr.domSelectionRange(),Ar=Tr.state.doc;if(!$r.focusNode)return null;let Rr=Tr.docView.nearestDesc($r.focusNode),Dr=Rr&&Rr.size==0,Mr=Tr.docView.posFromDOM($r.focusNode,$r.focusOffset,1);if(Mr<0)return null;let Br=Ar.resolve(Mr),Nr,Lr;if(selectionCollapsed($r)){for(Nr=Br;Rr&&!Rr.node;)Rr=Rr.parent;let Hr=Rr.node;if(Rr&&Hr.isAtom&&NodeSelection.isSelectable(Hr)&&Rr.parent&&!(Hr.isInline&&isOnEdge($r.focusNode,$r.focusOffset,Rr.dom))){let zr=Rr.posBefore;Lr=new NodeSelection(Mr==zr?Br:Ar.resolve(zr))}}else{let Hr=Tr.docView.posFromDOM($r.anchorNode,$r.anchorOffset,1);if(Hr<0)return null;Nr=Ar.resolve(Hr)}if(!Lr){let Hr=Cr=="pointer"||Tr.state.selection.head{($r.anchorNode!=Ar||$r.anchorOffset!=Rr)&&(Cr.removeEventListener("selectionchange",Tr.input.hideSelectionGuard),setTimeout(()=>{(!editorOwnsSelection(Tr)||Tr.state.selection.visible)&&Tr.dom.classList.remove("ProseMirror-hideselection")},20))})}function selectCursorWrapper(Tr){let Cr=Tr.domSelection(),$r=document.createRange(),Ar=Tr.cursorWrapper.dom,Rr=Ar.nodeName=="IMG";Rr?$r.setEnd(Ar.parentNode,domIndex(Ar)+1):$r.setEnd(Ar,0),$r.collapse(!1),Cr.removeAllRanges(),Cr.addRange($r),!Rr&&!Tr.state.selection.visible&&ie$1&&ie_version<=11&&(Ar.disabled=!0,Ar.disabled=!1)}function syncNodeSelection(Tr,Cr){if(Cr instanceof NodeSelection){let $r=Tr.docView.descAt(Cr.from);$r!=Tr.lastSelectedViewDesc&&(clearNodeSelection(Tr),$r&&$r.selectNode(),Tr.lastSelectedViewDesc=$r)}else clearNodeSelection(Tr)}function clearNodeSelection(Tr){Tr.lastSelectedViewDesc&&(Tr.lastSelectedViewDesc.parent&&Tr.lastSelectedViewDesc.deselectNode(),Tr.lastSelectedViewDesc=void 0)}function selectionBetween(Tr,Cr,$r,Ar){return Tr.someProp("createSelectionBetween",Rr=>Rr(Tr,Cr,$r))||TextSelection.between(Cr,$r,Ar)}function hasFocusAndSelection(Tr){return Tr.editable&&!Tr.hasFocus()?!1:hasSelection(Tr)}function hasSelection(Tr){let Cr=Tr.domSelectionRange();if(!Cr.anchorNode)return!1;try{return Tr.dom.contains(Cr.anchorNode.nodeType==3?Cr.anchorNode.parentNode:Cr.anchorNode)&&(Tr.editable||Tr.dom.contains(Cr.focusNode.nodeType==3?Cr.focusNode.parentNode:Cr.focusNode))}catch{return!1}}function anchorInRightPlace(Tr){let Cr=Tr.docView.domFromPos(Tr.state.selection.anchor,0),$r=Tr.domSelectionRange();return isEquivalentPosition(Cr.node,Cr.offset,$r.anchorNode,$r.anchorOffset)}function moveSelectionBlock(Tr,Cr){let{$anchor:$r,$head:Ar}=Tr.selection,Rr=Cr>0?$r.max(Ar):$r.min(Ar),Dr=Rr.parent.inlineContent?Rr.depth?Tr.doc.resolve(Cr>0?Rr.after():Rr.before()):null:Rr;return Dr&&Selection.findFrom(Dr,Cr)}function apply(Tr,Cr){return Tr.dispatch(Tr.state.tr.setSelection(Cr).scrollIntoView()),!0}function selectHorizontally(Tr,Cr,$r){let Ar=Tr.state.selection;if(Ar instanceof TextSelection)if($r.indexOf("s")>-1){let{$head:Rr}=Ar,Dr=Rr.textOffset?null:Cr<0?Rr.nodeBefore:Rr.nodeAfter;if(!Dr||Dr.isText||!Dr.isLeaf)return!1;let Mr=Tr.state.doc.resolve(Rr.pos+Dr.nodeSize*(Cr<0?-1:1));return apply(Tr,new TextSelection(Ar.$anchor,Mr))}else if(Ar.empty){if(Tr.endOfTextblock(Cr>0?"forward":"backward")){let Rr=moveSelectionBlock(Tr.state,Cr);return Rr&&Rr instanceof NodeSelection?apply(Tr,Rr):!1}else if(!(mac$2&&$r.indexOf("m")>-1)){let Rr=Ar.$head,Dr=Rr.textOffset?null:Cr<0?Rr.nodeBefore:Rr.nodeAfter,Mr;if(!Dr||Dr.isText)return!1;let Br=Cr<0?Rr.pos-Dr.nodeSize:Rr.pos;return Dr.isAtom||(Mr=Tr.docView.descAt(Br))&&!Mr.contentDOM?NodeSelection.isSelectable(Dr)?apply(Tr,new NodeSelection(Cr<0?Tr.state.doc.resolve(Rr.pos-Dr.nodeSize):Rr)):webkit?apply(Tr,new TextSelection(Tr.state.doc.resolve(Cr<0?Br:Br+Dr.nodeSize))):!1:!1}}else return!1;else{if(Ar instanceof NodeSelection&&Ar.node.isInline)return apply(Tr,new TextSelection(Cr>0?Ar.$to:Ar.$from));{let Rr=moveSelectionBlock(Tr.state,Cr);return Rr?apply(Tr,Rr):!1}}}function nodeLen(Tr){return Tr.nodeType==3?Tr.nodeValue.length:Tr.childNodes.length}function isIgnorable(Tr,Cr){let $r=Tr.pmViewDesc;return $r&&$r.size==0&&(Cr<0||Tr.nextSibling||Tr.nodeName!="BR")}function skipIgnoredNodes(Tr,Cr){return Cr<0?skipIgnoredNodesBefore(Tr):skipIgnoredNodesAfter(Tr)}function skipIgnoredNodesBefore(Tr){let Cr=Tr.domSelectionRange(),$r=Cr.focusNode,Ar=Cr.focusOffset;if(!$r)return;let Rr,Dr,Mr=!1;for(gecko&&$r.nodeType==1&&Ar0){if($r.nodeType!=1)break;{let Br=$r.childNodes[Ar-1];if(isIgnorable(Br,-1))Rr=$r,Dr=--Ar;else if(Br.nodeType==3)$r=Br,Ar=$r.nodeValue.length;else break}}else{if(isBlockNode($r))break;{let Br=$r.previousSibling;for(;Br&&isIgnorable(Br,-1);)Rr=$r.parentNode,Dr=domIndex(Br),Br=Br.previousSibling;if(Br)$r=Br,Ar=nodeLen($r);else{if($r=$r.parentNode,$r==Tr.dom)break;Ar=0}}}Mr?setSelFocus(Tr,$r,Ar):Rr&&setSelFocus(Tr,Rr,Dr)}function skipIgnoredNodesAfter(Tr){let Cr=Tr.domSelectionRange(),$r=Cr.focusNode,Ar=Cr.focusOffset;if(!$r)return;let Rr=nodeLen($r),Dr,Mr;for(;;)if(Ar{Tr.state==Rr&&selectionToDOM(Tr)},50)}function findDirection(Tr,Cr){let $r=Tr.state.doc.resolve(Cr);if(!(chrome||windows)&&$r.parent.inlineContent){let Rr=Tr.coordsAtPos(Cr);if(Cr>$r.start()){let Dr=Tr.coordsAtPos(Cr-1),Mr=(Dr.top+Dr.bottom)/2;if(Mr>Rr.top&&Mr1)return Dr.leftRr.top&&Mr1)return Dr.left>Rr.left?"ltr":"rtl"}}return getComputedStyle(Tr.dom).direction=="rtl"?"rtl":"ltr"}function selectVertically(Tr,Cr,$r){let Ar=Tr.state.selection;if(Ar instanceof TextSelection&&!Ar.empty||$r.indexOf("s")>-1||mac$2&&$r.indexOf("m")>-1)return!1;let{$from:Rr,$to:Dr}=Ar;if(!Rr.parent.inlineContent||Tr.endOfTextblock(Cr<0?"up":"down")){let Mr=moveSelectionBlock(Tr.state,Cr);if(Mr&&Mr instanceof NodeSelection)return apply(Tr,Mr)}if(!Rr.parent.inlineContent){let Mr=Cr<0?Rr:Dr,Br=Ar instanceof AllSelection?Selection.near(Mr,Cr):Selection.findFrom(Mr,Cr);return Br?apply(Tr,Br):!1}return!1}function stopNativeHorizontalDelete(Tr,Cr){if(!(Tr.state.selection instanceof TextSelection))return!0;let{$head:$r,$anchor:Ar,empty:Rr}=Tr.state.selection;if(!$r.sameParent(Ar))return!0;if(!Rr)return!1;if(Tr.endOfTextblock(Cr>0?"forward":"backward"))return!0;let Dr=!$r.textOffset&&(Cr<0?$r.nodeBefore:$r.nodeAfter);if(Dr&&!Dr.isText){let Mr=Tr.state.tr;return Cr<0?Mr.delete($r.pos-Dr.nodeSize,$r.pos):Mr.delete($r.pos,$r.pos+Dr.nodeSize),Tr.dispatch(Mr),!0}return!1}function switchEditable(Tr,Cr,$r){Tr.domObserver.stop(),Cr.contentEditable=$r,Tr.domObserver.start()}function safariDownArrowBug(Tr){if(!safari||Tr.state.selection.$head.parentOffset>0)return!1;let{focusNode:Cr,focusOffset:$r}=Tr.domSelectionRange();if(Cr&&Cr.nodeType==1&&$r==0&&Cr.firstChild&&Cr.firstChild.contentEditable=="false"){let Ar=Cr.firstChild;switchEditable(Tr,Ar,"true"),setTimeout(()=>switchEditable(Tr,Ar,"false"),20)}return!1}function getMods(Tr){let Cr="";return Tr.ctrlKey&&(Cr+="c"),Tr.metaKey&&(Cr+="m"),Tr.altKey&&(Cr+="a"),Tr.shiftKey&&(Cr+="s"),Cr}function captureKeyDown(Tr,Cr){let $r=Cr.keyCode,Ar=getMods(Cr);if($r==8||mac$2&&$r==72&&Ar=="c")return stopNativeHorizontalDelete(Tr,-1)||skipIgnoredNodes(Tr,-1);if($r==46&&!Cr.shiftKey||mac$2&&$r==68&&Ar=="c")return stopNativeHorizontalDelete(Tr,1)||skipIgnoredNodes(Tr,1);if($r==13||$r==27)return!0;if($r==37||mac$2&&$r==66&&Ar=="c"){let Rr=$r==37?findDirection(Tr,Tr.state.selection.from)=="ltr"?-1:1:-1;return selectHorizontally(Tr,Rr,Ar)||skipIgnoredNodes(Tr,Rr)}else if($r==39||mac$2&&$r==70&&Ar=="c"){let Rr=$r==39?findDirection(Tr,Tr.state.selection.from)=="ltr"?1:-1:1;return selectHorizontally(Tr,Rr,Ar)||skipIgnoredNodes(Tr,Rr)}else{if($r==38||mac$2&&$r==80&&Ar=="c")return selectVertically(Tr,-1,Ar)||skipIgnoredNodes(Tr,-1);if($r==40||mac$2&&$r==78&&Ar=="c")return safariDownArrowBug(Tr)||selectVertically(Tr,1,Ar)||skipIgnoredNodes(Tr,1);if(Ar==(mac$2?"m":"c")&&($r==66||$r==73||$r==89||$r==90))return!0}return!1}function serializeForClipboard(Tr,Cr){Tr.someProp("transformCopied",Vr=>{Cr=Vr(Cr,Tr)});let $r=[],{content:Ar,openStart:Rr,openEnd:Dr}=Cr;for(;Rr>1&&Dr>1&&Ar.childCount==1&&Ar.firstChild.childCount==1;){Rr--,Dr--;let Vr=Ar.firstChild;$r.push(Vr.type.name,Vr.attrs!=Vr.type.defaultAttrs?Vr.attrs:null),Ar=Vr.content}let Mr=Tr.someProp("clipboardSerializer")||DOMSerializer.fromSchema(Tr.state.schema),Br=detachedDoc(),Nr=Br.createElement("div");Nr.appendChild(Mr.serializeFragment(Ar,{document:Br}));let Lr=Nr.firstChild,Hr,zr=0;for(;Lr&&Lr.nodeType==1&&(Hr=wrapMap[Lr.nodeName.toLowerCase()]);){for(let Vr=Hr.length-1;Vr>=0;Vr--){let jr=Br.createElement(Hr[Vr]);for(;Nr.firstChild;)jr.appendChild(Nr.firstChild);Nr.appendChild(jr),zr++}Lr=Nr.firstChild}Lr&&Lr.nodeType==1&&Lr.setAttribute("data-pm-slice",`${Rr} ${Dr}${zr?` -${zr}`:""} ${JSON.stringify($r)}`);let Ur=Tr.someProp("clipboardTextSerializer",Vr=>Vr(Cr,Tr))||Cr.content.textBetween(0,Cr.content.size,` `);return{dom:Nr,text:Ur}}function parseFromClipboard(Tr,Cr,$r,Ar,Rr){let Dr=Rr.parent.type.spec.code,Mr,Br;if(!$r&&!Cr)return null;let Nr=Cr&&(Ar||Dr||!$r);if(Nr){if(Tr.someProp("transformPastedText",Ur=>{Cr=Ur(Cr,Dr||Ar,Tr)}),Dr)return Cr?new Slice(Fragment.from(Tr.state.schema.text(Cr.replace(/\r\n?/g,` `))),0,0):Slice.empty;let zr=Tr.someProp("clipboardTextParser",Ur=>Ur(Cr,Rr,Ar,Tr));if(zr)Br=zr;else{let Ur=Rr.marks(),{schema:Vr}=Tr.state,jr=DOMSerializer.fromSchema(Vr);Mr=document.createElement("div"),Cr.split(/(?:\r\n?|\n)+/).forEach(Gr=>{let Xr=Mr.appendChild(document.createElement("p"));Gr&&Xr.appendChild(jr.serializeNode(Vr.text(Gr,Ur)))})}}else Tr.someProp("transformPastedHTML",zr=>{$r=zr($r,Tr)}),Mr=readHTML($r),webkit&&restoreReplacedSpaces(Mr);let Lr=Mr&&Mr.querySelector("[data-pm-slice]"),Hr=Lr&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(Lr.getAttribute("data-pm-slice")||"");if(Hr&&Hr[3])for(let zr=+Hr[3];zr>0;zr--){let Ur=Mr.firstChild;for(;Ur&&Ur.nodeType!=1;)Ur=Ur.nextSibling;if(!Ur)break;Mr=Ur}if(Br||(Br=(Tr.someProp("clipboardParser")||Tr.someProp("domParser")||DOMParser$1.fromSchema(Tr.state.schema)).parseSlice(Mr,{preserveWhitespace:!!(Nr||Hr),context:Rr,ruleFromNode(Ur){return Ur.nodeName=="BR"&&!Ur.nextSibling&&Ur.parentNode&&!inlineParents.test(Ur.parentNode.nodeName)?{ignore:!0}:null}})),Hr)Br=addContext(closeSlice(Br,+Hr[1],+Hr[2]),Hr[4]);else if(Br=Slice.maxOpen(normalizeSiblings(Br.content,Rr),!0),Br.openStart||Br.openEnd){let zr=0,Ur=0;for(let Vr=Br.content.firstChild;zr{Br=zr(Br,Tr)}),Br}const inlineParents=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function normalizeSiblings(Tr,Cr){if(Tr.childCount<2)return Tr;for(let $r=Cr.depth;$r>=0;$r--){let Rr=Cr.node($r).contentMatchAt(Cr.index($r)),Dr,Mr=[];if(Tr.forEach(Br=>{if(!Mr)return;let Nr=Rr.findWrapping(Br.type),Lr;if(!Nr)return Mr=null;if(Lr=Mr.length&&Dr.length&&addToSibling(Nr,Dr,Br,Mr[Mr.length-1],0))Mr[Mr.length-1]=Lr;else{Mr.length&&(Mr[Mr.length-1]=closeRight(Mr[Mr.length-1],Dr.length));let Hr=withWrappers(Br,Nr);Mr.push(Hr),Rr=Rr.matchType(Hr.type),Dr=Nr}}),Mr)return Fragment.from(Mr)}return Tr}function withWrappers(Tr,Cr,$r=0){for(let Ar=Cr.length-1;Ar>=$r;Ar--)Tr=Cr[Ar].create(null,Fragment.from(Tr));return Tr}function addToSibling(Tr,Cr,$r,Ar,Rr){if(Rr1&&(Dr=0),Rr=$r&&(Br=Cr<0?Mr.contentMatchAt(0).fillBefore(Br,Dr<=Rr).append(Br):Br.append(Mr.contentMatchAt(Mr.childCount).fillBefore(Fragment.empty,!0))),Tr.replaceChild(Cr<0?0:Tr.childCount-1,Mr.copy(Br))}function closeSlice(Tr,Cr,$r){return Cr]*>)*/.exec(Tr);Cr&&(Tr=Tr.slice(Cr[0].length));let $r=detachedDoc().createElement("div"),Ar=/<([a-z][^>\s]+)/i.exec(Tr),Rr;if((Rr=Ar&&wrapMap[Ar[1].toLowerCase()])&&(Tr=Rr.map(Dr=>"<"+Dr+">").join("")+Tr+Rr.map(Dr=>"").reverse().join("")),$r.innerHTML=Tr,Rr)for(let Dr=0;Dr=0;Br-=2){let Nr=$r.nodes[Ar[Br]];if(!Nr||Nr.hasRequiredAttrs())break;Rr=Fragment.from(Nr.create(Ar[Br+1],Rr)),Dr++,Mr++}return new Slice(Rr,Dr,Mr)}const handlers={},editHandlers={},passiveHandlers={touchstart:!0,touchmove:!0};class InputState{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function initInput(Tr){for(let Cr in handlers){let $r=handlers[Cr];Tr.dom.addEventListener(Cr,Tr.input.eventHandlers[Cr]=Ar=>{eventBelongsToView(Tr,Ar)&&!runCustomHandler(Tr,Ar)&&(Tr.editable||!(Ar.type in editHandlers))&&$r(Tr,Ar)},passiveHandlers[Cr]?{passive:!0}:void 0)}safari&&Tr.dom.addEventListener("input",()=>null),ensureListeners(Tr)}function setSelectionOrigin(Tr,Cr){Tr.input.lastSelectionOrigin=Cr,Tr.input.lastSelectionTime=Date.now()}function destroyInput(Tr){Tr.domObserver.stop();for(let Cr in Tr.input.eventHandlers)Tr.dom.removeEventListener(Cr,Tr.input.eventHandlers[Cr]);clearTimeout(Tr.input.composingTimeout),clearTimeout(Tr.input.lastIOSEnterFallbackTimeout)}function ensureListeners(Tr){Tr.someProp("handleDOMEvents",Cr=>{for(let $r in Cr)Tr.input.eventHandlers[$r]||Tr.dom.addEventListener($r,Tr.input.eventHandlers[$r]=Ar=>runCustomHandler(Tr,Ar))})}function runCustomHandler(Tr,Cr){return Tr.someProp("handleDOMEvents",$r=>{let Ar=$r[Cr.type];return Ar?Ar(Tr,Cr)||Cr.defaultPrevented:!1})}function eventBelongsToView(Tr,Cr){if(!Cr.bubbles)return!0;if(Cr.defaultPrevented)return!1;for(let $r=Cr.target;$r!=Tr.dom;$r=$r.parentNode)if(!$r||$r.nodeType==11||$r.pmViewDesc&&$r.pmViewDesc.stopEvent(Cr))return!1;return!0}function dispatchEvent$1(Tr,Cr){!runCustomHandler(Tr,Cr)&&handlers[Cr.type]&&(Tr.editable||!(Cr.type in editHandlers))&&handlers[Cr.type](Tr,Cr)}editHandlers.keydown=(Tr,Cr)=>{let $r=Cr;if(Tr.input.shiftKey=$r.keyCode==16||$r.shiftKey,!inOrNearComposition(Tr,$r)&&(Tr.input.lastKeyCode=$r.keyCode,Tr.input.lastKeyCodeTime=Date.now(),!(android&&chrome&&$r.keyCode==13)))if($r.keyCode!=229&&Tr.domObserver.forceFlush(),ios&&$r.keyCode==13&&!$r.ctrlKey&&!$r.altKey&&!$r.metaKey){let Ar=Date.now();Tr.input.lastIOSEnter=Ar,Tr.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{Tr.input.lastIOSEnter==Ar&&(Tr.someProp("handleKeyDown",Rr=>Rr(Tr,keyEvent(13,"Enter"))),Tr.input.lastIOSEnter=0)},200)}else Tr.someProp("handleKeyDown",Ar=>Ar(Tr,$r))||captureKeyDown(Tr,$r)?$r.preventDefault():setSelectionOrigin(Tr,"key")};editHandlers.keyup=(Tr,Cr)=>{Cr.keyCode==16&&(Tr.input.shiftKey=!1)};editHandlers.keypress=(Tr,Cr)=>{let $r=Cr;if(inOrNearComposition(Tr,$r)||!$r.charCode||$r.ctrlKey&&!$r.altKey||mac$2&&$r.metaKey)return;if(Tr.someProp("handleKeyPress",Rr=>Rr(Tr,$r))){$r.preventDefault();return}let Ar=Tr.state.selection;if(!(Ar instanceof TextSelection)||!Ar.$from.sameParent(Ar.$to)){let Rr=String.fromCharCode($r.charCode);!/[\r\n]/.test(Rr)&&!Tr.someProp("handleTextInput",Dr=>Dr(Tr,Ar.$from.pos,Ar.$to.pos,Rr))&&Tr.dispatch(Tr.state.tr.insertText(Rr).scrollIntoView()),$r.preventDefault()}};function eventCoords(Tr){return{left:Tr.clientX,top:Tr.clientY}}function isNear(Tr,Cr){let $r=Cr.x-Tr.clientX,Ar=Cr.y-Tr.clientY;return $r*$r+Ar*Ar<100}function runHandlerOnContext(Tr,Cr,$r,Ar,Rr){if(Ar==-1)return!1;let Dr=Tr.state.doc.resolve(Ar);for(let Mr=Dr.depth+1;Mr>0;Mr--)if(Tr.someProp(Cr,Br=>Mr>Dr.depth?Br(Tr,$r,Dr.nodeAfter,Dr.before(Mr),Rr,!0):Br(Tr,$r,Dr.node(Mr),Dr.before(Mr),Rr,!1)))return!0;return!1}function updateSelection(Tr,Cr,$r){Tr.focused||Tr.focus();let Ar=Tr.state.tr.setSelection(Cr);$r=="pointer"&&Ar.setMeta("pointer",!0),Tr.dispatch(Ar)}function selectClickedLeaf(Tr,Cr){if(Cr==-1)return!1;let $r=Tr.state.doc.resolve(Cr),Ar=$r.nodeAfter;return Ar&&Ar.isAtom&&NodeSelection.isSelectable(Ar)?(updateSelection(Tr,new NodeSelection($r),"pointer"),!0):!1}function selectClickedNode(Tr,Cr){if(Cr==-1)return!1;let $r=Tr.state.selection,Ar,Rr;$r instanceof NodeSelection&&(Ar=$r.node);let Dr=Tr.state.doc.resolve(Cr);for(let Mr=Dr.depth+1;Mr>0;Mr--){let Br=Mr>Dr.depth?Dr.nodeAfter:Dr.node(Mr);if(NodeSelection.isSelectable(Br)){Ar&&$r.$from.depth>0&&Mr>=$r.$from.depth&&Dr.before($r.$from.depth+1)==$r.$from.pos?Rr=Dr.before($r.$from.depth):Rr=Dr.before(Mr);break}}return Rr!=null?(updateSelection(Tr,NodeSelection.create(Tr.state.doc,Rr),"pointer"),!0):!1}function handleSingleClick(Tr,Cr,$r,Ar,Rr){return runHandlerOnContext(Tr,"handleClickOn",Cr,$r,Ar)||Tr.someProp("handleClick",Dr=>Dr(Tr,Cr,Ar))||(Rr?selectClickedNode(Tr,$r):selectClickedLeaf(Tr,$r))}function handleDoubleClick(Tr,Cr,$r,Ar){return runHandlerOnContext(Tr,"handleDoubleClickOn",Cr,$r,Ar)||Tr.someProp("handleDoubleClick",Rr=>Rr(Tr,Cr,Ar))}function handleTripleClick(Tr,Cr,$r,Ar){return runHandlerOnContext(Tr,"handleTripleClickOn",Cr,$r,Ar)||Tr.someProp("handleTripleClick",Rr=>Rr(Tr,Cr,Ar))||defaultTripleClick(Tr,$r,Ar)}function defaultTripleClick(Tr,Cr,$r){if($r.button!=0)return!1;let Ar=Tr.state.doc;if(Cr==-1)return Ar.inlineContent?(updateSelection(Tr,TextSelection.create(Ar,0,Ar.content.size),"pointer"),!0):!1;let Rr=Ar.resolve(Cr);for(let Dr=Rr.depth+1;Dr>0;Dr--){let Mr=Dr>Rr.depth?Rr.nodeAfter:Rr.node(Dr),Br=Rr.before(Dr);if(Mr.inlineContent)updateSelection(Tr,TextSelection.create(Ar,Br+1,Br+1+Mr.content.size),"pointer");else if(NodeSelection.isSelectable(Mr))updateSelection(Tr,NodeSelection.create(Ar,Br),"pointer");else continue;return!0}}function forceDOMFlush(Tr){return endComposition(Tr)}const selectNodeModifier=mac$2?"metaKey":"ctrlKey";handlers.mousedown=(Tr,Cr)=>{let $r=Cr;Tr.input.shiftKey=$r.shiftKey;let Ar=forceDOMFlush(Tr),Rr=Date.now(),Dr="singleClick";Rr-Tr.input.lastClick.time<500&&isNear($r,Tr.input.lastClick)&&!$r[selectNodeModifier]&&(Tr.input.lastClick.type=="singleClick"?Dr="doubleClick":Tr.input.lastClick.type=="doubleClick"&&(Dr="tripleClick")),Tr.input.lastClick={time:Rr,x:$r.clientX,y:$r.clientY,type:Dr};let Mr=Tr.posAtCoords(eventCoords($r));Mr&&(Dr=="singleClick"?(Tr.input.mouseDown&&Tr.input.mouseDown.done(),Tr.input.mouseDown=new MouseDown(Tr,Mr,$r,!!Ar)):(Dr=="doubleClick"?handleDoubleClick:handleTripleClick)(Tr,Mr.pos,Mr.inside,$r)?$r.preventDefault():setSelectionOrigin(Tr,"pointer"))};class MouseDown{constructor(Cr,$r,Ar,Rr){this.view=Cr,this.pos=$r,this.event=Ar,this.flushed=Rr,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=Cr.state.doc,this.selectNode=!!Ar[selectNodeModifier],this.allowDefault=Ar.shiftKey;let Dr,Mr;if($r.inside>-1)Dr=Cr.state.doc.nodeAt($r.inside),Mr=$r.inside;else{let Hr=Cr.state.doc.resolve($r.pos);Dr=Hr.parent,Mr=Hr.depth?Hr.before():0}const Br=Rr?null:Ar.target,Nr=Br?Cr.docView.nearestDesc(Br,!0):null;this.target=Nr?Nr.dom:null;let{selection:Lr}=Cr.state;(Ar.button==0&&Dr.type.spec.draggable&&Dr.type.spec.selectable!==!1||Lr instanceof NodeSelection&&Lr.from<=Mr&&Lr.to>Mr)&&(this.mightDrag={node:Dr,pos:Mr,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&gecko&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Cr.root.addEventListener("mouseup",this.up=this.up.bind(this)),Cr.root.addEventListener("mousemove",this.move=this.move.bind(this)),setSelectionOrigin(Cr,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>selectionToDOM(this.view)),this.view.input.mouseDown=null}up(Cr){if(this.done(),!this.view.dom.contains(Cr.target))return;let $r=this.pos;this.view.state.doc!=this.startDoc&&($r=this.view.posAtCoords(eventCoords(Cr))),this.updateAllowDefault(Cr),this.allowDefault||!$r?setSelectionOrigin(this.view,"pointer"):handleSingleClick(this.view,$r.pos,$r.inside,Cr,this.selectNode)?Cr.preventDefault():Cr.button==0&&(this.flushed||safari&&this.mightDrag&&!this.mightDrag.node.isAtom||chrome&&!this.view.state.selection.visible&&Math.min(Math.abs($r.pos-this.view.state.selection.from),Math.abs($r.pos-this.view.state.selection.to))<=2)?(updateSelection(this.view,Selection.near(this.view.state.doc.resolve($r.pos)),"pointer"),Cr.preventDefault()):setSelectionOrigin(this.view,"pointer")}move(Cr){this.updateAllowDefault(Cr),setSelectionOrigin(this.view,"pointer"),Cr.buttons==0&&this.done()}updateAllowDefault(Cr){!this.allowDefault&&(Math.abs(this.event.x-Cr.clientX)>4||Math.abs(this.event.y-Cr.clientY)>4)&&(this.allowDefault=!0)}}handlers.touchstart=Tr=>{Tr.input.lastTouch=Date.now(),forceDOMFlush(Tr),setSelectionOrigin(Tr,"pointer")};handlers.touchmove=Tr=>{Tr.input.lastTouch=Date.now(),setSelectionOrigin(Tr,"pointer")};handlers.contextmenu=Tr=>forceDOMFlush(Tr);function inOrNearComposition(Tr,Cr){return Tr.composing?!0:safari&&Math.abs(Cr.timeStamp-Tr.input.compositionEndedAt)<500?(Tr.input.compositionEndedAt=-2e8,!0):!1}const timeoutComposition=android?5e3:-1;editHandlers.compositionstart=editHandlers.compositionupdate=Tr=>{if(!Tr.composing){Tr.domObserver.flush();let{state:Cr}=Tr,$r=Cr.selection.$from;if(Cr.selection.empty&&(Cr.storedMarks||!$r.textOffset&&$r.parentOffset&&$r.nodeBefore.marks.some(Ar=>Ar.type.spec.inclusive===!1)))Tr.markCursor=Tr.state.storedMarks||$r.marks(),endComposition(Tr,!0),Tr.markCursor=null;else if(endComposition(Tr),gecko&&Cr.selection.empty&&$r.parentOffset&&!$r.textOffset&&$r.nodeBefore.marks.length){let Ar=Tr.domSelectionRange();for(let Rr=Ar.focusNode,Dr=Ar.focusOffset;Rr&&Rr.nodeType==1&&Dr!=0;){let Mr=Dr<0?Rr.lastChild:Rr.childNodes[Dr-1];if(!Mr)break;if(Mr.nodeType==3){Tr.domSelection().collapse(Mr,Mr.nodeValue.length);break}else Rr=Mr,Dr=-1}}Tr.input.composing=!0}scheduleComposeEnd(Tr,timeoutComposition)};editHandlers.compositionend=(Tr,Cr)=>{Tr.composing&&(Tr.input.composing=!1,Tr.input.compositionEndedAt=Cr.timeStamp,Tr.input.compositionPendingChanges=Tr.domObserver.pendingRecords().length?Tr.input.compositionID:0,Tr.input.compositionPendingChanges&&Promise.resolve().then(()=>Tr.domObserver.flush()),Tr.input.compositionID++,scheduleComposeEnd(Tr,20))};function scheduleComposeEnd(Tr,Cr){clearTimeout(Tr.input.composingTimeout),Cr>-1&&(Tr.input.composingTimeout=setTimeout(()=>endComposition(Tr),Cr))}function clearComposition(Tr){for(Tr.composing&&(Tr.input.composing=!1,Tr.input.compositionEndedAt=timestampFromCustomEvent());Tr.input.compositionNodes.length>0;)Tr.input.compositionNodes.pop().markParentsDirty()}function timestampFromCustomEvent(){let Tr=document.createEvent("Event");return Tr.initEvent("event",!0,!0),Tr.timeStamp}function endComposition(Tr,Cr=!1){if(!(android&&Tr.domObserver.flushingSoon>=0)){if(Tr.domObserver.forceFlush(),clearComposition(Tr),Cr||Tr.docView&&Tr.docView.dirty){let $r=selectionFromDOM(Tr);return $r&&!$r.eq(Tr.state.selection)?Tr.dispatch(Tr.state.tr.setSelection($r)):Tr.updateState(Tr.state),!0}return!1}}function captureCopy(Tr,Cr){if(!Tr.dom.parentNode)return;let $r=Tr.dom.parentNode.appendChild(document.createElement("div"));$r.appendChild(Cr),$r.style.cssText="position: fixed; left: -10000px; top: 10px";let Ar=getSelection(),Rr=document.createRange();Rr.selectNodeContents(Cr),Tr.dom.blur(),Ar.removeAllRanges(),Ar.addRange(Rr),setTimeout(()=>{$r.parentNode&&$r.parentNode.removeChild($r),Tr.focus()},50)}const brokenClipboardAPI=ie$1&&ie_version<15||ios&&webkit_version<604;handlers.copy=editHandlers.cut=(Tr,Cr)=>{let $r=Cr,Ar=Tr.state.selection,Rr=$r.type=="cut";if(Ar.empty)return;let Dr=brokenClipboardAPI?null:$r.clipboardData,Mr=Ar.content(),{dom:Br,text:Nr}=serializeForClipboard(Tr,Mr);Dr?($r.preventDefault(),Dr.clearData(),Dr.setData("text/html",Br.innerHTML),Dr.setData("text/plain",Nr)):captureCopy(Tr,Br),Rr&&Tr.dispatch(Tr.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function sliceSingleNode(Tr){return Tr.openStart==0&&Tr.openEnd==0&&Tr.content.childCount==1?Tr.content.firstChild:null}function capturePaste(Tr,Cr){if(!Tr.dom.parentNode)return;let $r=Tr.input.shiftKey||Tr.state.selection.$from.parent.type.spec.code,Ar=Tr.dom.parentNode.appendChild(document.createElement($r?"textarea":"div"));$r||(Ar.contentEditable="true"),Ar.style.cssText="position: fixed; left: -10000px; top: 10px",Ar.focus();let Rr=Tr.input.shiftKey&&Tr.input.lastKeyCode!=45;setTimeout(()=>{Tr.focus(),Ar.parentNode&&Ar.parentNode.removeChild(Ar),$r?doPaste(Tr,Ar.value,null,Rr,Cr):doPaste(Tr,Ar.textContent,Ar.innerHTML,Rr,Cr)},50)}function doPaste(Tr,Cr,$r,Ar,Rr){let Dr=parseFromClipboard(Tr,Cr,$r,Ar,Tr.state.selection.$from);if(Tr.someProp("handlePaste",Nr=>Nr(Tr,Rr,Dr||Slice.empty)))return!0;if(!Dr)return!1;let Mr=sliceSingleNode(Dr),Br=Mr?Tr.state.tr.replaceSelectionWith(Mr,Ar):Tr.state.tr.replaceSelection(Dr);return Tr.dispatch(Br.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function getText$1(Tr){let Cr=Tr.getData("text/plain")||Tr.getData("Text");if(Cr)return Cr;let $r=Tr.getData("text/uri-list");return $r?$r.replace(/\r?\n/g," "):""}editHandlers.paste=(Tr,Cr)=>{let $r=Cr;if(Tr.composing&&!android)return;let Ar=brokenClipboardAPI?null:$r.clipboardData,Rr=Tr.input.shiftKey&&Tr.input.lastKeyCode!=45;Ar&&doPaste(Tr,getText$1(Ar),Ar.getData("text/html"),Rr,$r)?$r.preventDefault():capturePaste(Tr,$r)};class Dragging{constructor(Cr,$r,Ar){this.slice=Cr,this.move=$r,this.node=Ar}}const dragCopyModifier=mac$2?"altKey":"ctrlKey";handlers.dragstart=(Tr,Cr)=>{let $r=Cr,Ar=Tr.input.mouseDown;if(Ar&&Ar.done(),!$r.dataTransfer)return;let Rr=Tr.state.selection,Dr=Rr.empty?null:Tr.posAtCoords(eventCoords($r)),Mr;if(!(Dr&&Dr.pos>=Rr.from&&Dr.pos<=(Rr instanceof NodeSelection?Rr.to-1:Rr.to))){if(Ar&&Ar.mightDrag)Mr=NodeSelection.create(Tr.state.doc,Ar.mightDrag.pos);else if($r.target&&$r.target.nodeType==1){let Hr=Tr.docView.nearestDesc($r.target,!0);Hr&&Hr.node.type.spec.draggable&&Hr!=Tr.docView&&(Mr=NodeSelection.create(Tr.state.doc,Hr.posBefore))}}let Br=(Mr||Tr.state.selection).content(),{dom:Nr,text:Lr}=serializeForClipboard(Tr,Br);$r.dataTransfer.clearData(),$r.dataTransfer.setData(brokenClipboardAPI?"Text":"text/html",Nr.innerHTML),$r.dataTransfer.effectAllowed="copyMove",brokenClipboardAPI||$r.dataTransfer.setData("text/plain",Lr),Tr.dragging=new Dragging(Br,!$r[dragCopyModifier],Mr)};handlers.dragend=Tr=>{let Cr=Tr.dragging;window.setTimeout(()=>{Tr.dragging==Cr&&(Tr.dragging=null)},50)};editHandlers.dragover=editHandlers.dragenter=(Tr,Cr)=>Cr.preventDefault();editHandlers.drop=(Tr,Cr)=>{let $r=Cr,Ar=Tr.dragging;if(Tr.dragging=null,!$r.dataTransfer)return;let Rr=Tr.posAtCoords(eventCoords($r));if(!Rr)return;let Dr=Tr.state.doc.resolve(Rr.pos),Mr=Ar&&Ar.slice;Mr?Tr.someProp("transformPasted",jr=>{Mr=jr(Mr,Tr)}):Mr=parseFromClipboard(Tr,getText$1($r.dataTransfer),brokenClipboardAPI?null:$r.dataTransfer.getData("text/html"),!1,Dr);let Br=!!(Ar&&!$r[dragCopyModifier]);if(Tr.someProp("handleDrop",jr=>jr(Tr,$r,Mr||Slice.empty,Br))){$r.preventDefault();return}if(!Mr)return;$r.preventDefault();let Nr=Mr?dropPoint(Tr.state.doc,Dr.pos,Mr):Dr.pos;Nr==null&&(Nr=Dr.pos);let Lr=Tr.state.tr;if(Br){let{node:jr}=Ar;jr?jr.replace(Lr):Lr.deleteSelection()}let Hr=Lr.mapping.map(Nr),zr=Mr.openStart==0&&Mr.openEnd==0&&Mr.content.childCount==1,Ur=Lr.doc;if(zr?Lr.replaceRangeWith(Hr,Hr,Mr.content.firstChild):Lr.replaceRange(Hr,Hr,Mr),Lr.doc.eq(Ur))return;let Vr=Lr.doc.resolve(Hr);if(zr&&NodeSelection.isSelectable(Mr.content.firstChild)&&Vr.nodeAfter&&Vr.nodeAfter.sameMarkup(Mr.content.firstChild))Lr.setSelection(new NodeSelection(Vr));else{let jr=Lr.mapping.map(Nr);Lr.mapping.maps[Lr.mapping.maps.length-1].forEach((Gr,Xr,Kr,Zr)=>jr=Zr),Lr.setSelection(selectionBetween(Tr,Vr,Lr.doc.resolve(jr)))}Tr.focus(),Tr.dispatch(Lr.setMeta("uiEvent","drop"))};handlers.focus=Tr=>{Tr.input.lastFocus=Date.now(),Tr.focused||(Tr.domObserver.stop(),Tr.dom.classList.add("ProseMirror-focused"),Tr.domObserver.start(),Tr.focused=!0,setTimeout(()=>{Tr.docView&&Tr.hasFocus()&&!Tr.domObserver.currentSelection.eq(Tr.domSelectionRange())&&selectionToDOM(Tr)},20))};handlers.blur=(Tr,Cr)=>{let $r=Cr;Tr.focused&&(Tr.domObserver.stop(),Tr.dom.classList.remove("ProseMirror-focused"),Tr.domObserver.start(),$r.relatedTarget&&Tr.dom.contains($r.relatedTarget)&&Tr.domObserver.currentSelection.clear(),Tr.focused=!1)};handlers.beforeinput=(Tr,Cr)=>{if(chrome&&android&&Cr.inputType=="deleteContentBackward"){Tr.domObserver.flushSoon();let{domChangeCount:Ar}=Tr.input;setTimeout(()=>{if(Tr.input.domChangeCount!=Ar||(Tr.dom.blur(),Tr.focus(),Tr.someProp("handleKeyDown",Dr=>Dr(Tr,keyEvent(8,"Backspace")))))return;let{$cursor:Rr}=Tr.state.selection;Rr&&Rr.pos>0&&Tr.dispatch(Tr.state.tr.delete(Rr.pos-1,Rr.pos).scrollIntoView())},50)}};for(let Tr in editHandlers)handlers[Tr]=editHandlers[Tr];function compareObjs(Tr,Cr){if(Tr==Cr)return!0;for(let $r in Tr)if(Tr[$r]!==Cr[$r])return!1;for(let $r in Cr)if(!($r in Tr))return!1;return!0}class WidgetType{constructor(Cr,$r){this.toDOM=Cr,this.spec=$r||noSpec,this.side=this.spec.side||0}map(Cr,$r,Ar,Rr){let{pos:Dr,deleted:Mr}=Cr.mapResult($r.from+Rr,this.side<0?-1:1);return Mr?null:new Decoration(Dr-Ar,Dr-Ar,this)}valid(){return!0}eq(Cr){return this==Cr||Cr instanceof WidgetType&&(this.spec.key&&this.spec.key==Cr.spec.key||this.toDOM==Cr.toDOM&&compareObjs(this.spec,Cr.spec))}destroy(Cr){this.spec.destroy&&this.spec.destroy(Cr)}}class InlineType{constructor(Cr,$r){this.attrs=Cr,this.spec=$r||noSpec}map(Cr,$r,Ar,Rr){let Dr=Cr.map($r.from+Rr,this.spec.inclusiveStart?-1:1)-Ar,Mr=Cr.map($r.to+Rr,this.spec.inclusiveEnd?1:-1)-Ar;return Dr>=Mr?null:new Decoration(Dr,Mr,this)}valid(Cr,$r){return $r.from<$r.to}eq(Cr){return this==Cr||Cr instanceof InlineType&&compareObjs(this.attrs,Cr.attrs)&&compareObjs(this.spec,Cr.spec)}static is(Cr){return Cr.type instanceof InlineType}destroy(){}}class NodeType{constructor(Cr,$r){this.attrs=Cr,this.spec=$r||noSpec}map(Cr,$r,Ar,Rr){let Dr=Cr.mapResult($r.from+Rr,1);if(Dr.deleted)return null;let Mr=Cr.mapResult($r.to+Rr,-1);return Mr.deleted||Mr.pos<=Dr.pos?null:new Decoration(Dr.pos-Ar,Mr.pos-Ar,this)}valid(Cr,$r){let{index:Ar,offset:Rr}=Cr.content.findIndex($r.from),Dr;return Rr==$r.from&&!(Dr=Cr.child(Ar)).isText&&Rr+Dr.nodeSize==$r.to}eq(Cr){return this==Cr||Cr instanceof NodeType&&compareObjs(this.attrs,Cr.attrs)&&compareObjs(this.spec,Cr.spec)}destroy(){}}class Decoration{constructor(Cr,$r,Ar){this.from=Cr,this.to=$r,this.type=Ar}copy(Cr,$r){return new Decoration(Cr,$r,this.type)}eq(Cr,$r=0){return this.type.eq(Cr.type)&&this.from+$r==Cr.from&&this.to+$r==Cr.to}map(Cr,$r,Ar){return this.type.map(Cr,this,$r,Ar)}static widget(Cr,$r,Ar){return new Decoration(Cr,Cr,new WidgetType($r,Ar))}static inline(Cr,$r,Ar,Rr){return new Decoration(Cr,$r,new InlineType(Ar,Rr))}static node(Cr,$r,Ar,Rr){return new Decoration(Cr,$r,new NodeType(Ar,Rr))}get spec(){return this.type.spec}get inline(){return this.type instanceof InlineType}get widget(){return this.type instanceof WidgetType}}const none=[],noSpec={};class DecorationSet{constructor(Cr,$r){this.local=Cr.length?Cr:none,this.children=$r.length?$r:none}static create(Cr,$r){return $r.length?buildTree($r,Cr,0,noSpec):empty$1}find(Cr,$r,Ar){let Rr=[];return this.findInner(Cr??0,$r??1e9,Rr,0,Ar),Rr}findInner(Cr,$r,Ar,Rr,Dr){for(let Mr=0;Mr=Cr&&(!Dr||Dr(Br.spec))&&Ar.push(Br.copy(Br.from+Rr,Br.to+Rr))}for(let Mr=0;MrCr){let Br=this.children[Mr]+1;this.children[Mr+2].findInner(Cr-Br,$r-Br,Ar,Rr+Br,Dr)}}map(Cr,$r,Ar){return this==empty$1||Cr.maps.length==0?this:this.mapInner(Cr,$r,0,0,Ar||noSpec)}mapInner(Cr,$r,Ar,Rr,Dr){let Mr;for(let Br=0;Br{let Lr=Nr+Ar,Hr;if(Hr=takeSpansForNode($r,Br,Lr)){for(Rr||(Rr=this.children.slice());DrBr&&zr.to=Cr){this.children[Br]==Cr&&(Ar=this.children[Br+2]);break}let Dr=Cr+1,Mr=Dr+$r.content.size;for(let Br=0;BrDr&&Nr.type instanceof InlineType){let Lr=Math.max(Dr,Nr.from)-Dr,Hr=Math.min(Mr,Nr.to)-Dr;LrRr.map(Cr,$r,noSpec));return DecorationGroup.from(Ar)}forChild(Cr,$r){if($r.isLeaf)return DecorationSet.empty;let Ar=[];for(let Rr=0;Rr$r instanceof DecorationSet)?Cr:Cr.reduce(($r,Ar)=>$r.concat(Ar instanceof DecorationSet?Ar:Ar.members),[]))}}}function mapChildren(Tr,Cr,$r,Ar,Rr,Dr,Mr){let Br=Tr.slice();for(let Lr=0,Hr=Dr;Lr<$r.maps.length;Lr++){let zr=0;$r.maps[Lr].forEach((Ur,Vr,jr,Gr)=>{let Xr=Gr-jr-(Vr-Ur);for(let Kr=0;KrZr+Hr-zr)continue;let eo=Br[Kr]+Hr-zr;Vr>=eo?Br[Kr+1]=Ur<=eo?-2:-1:Ur>=Hr&&Xr&&(Br[Kr]+=Xr,Br[Kr+1]+=Xr)}zr+=Xr}),Hr=$r.maps[Lr].map(Hr,-1)}let Nr=!1;for(let Lr=0;Lr=Ar.content.size){Nr=!0;continue}let Ur=$r.map(Tr[Lr+1]+Dr,-1),Vr=Ur-Rr,{index:jr,offset:Gr}=Ar.content.findIndex(zr),Xr=Ar.maybeChild(jr);if(Xr&&Gr==zr&&Gr+Xr.nodeSize==Vr){let Kr=Br[Lr+2].mapInner($r,Xr,Hr+1,Tr[Lr]+Dr+1,Mr);Kr!=empty$1?(Br[Lr]=zr,Br[Lr+1]=Vr,Br[Lr+2]=Kr):(Br[Lr+1]=-2,Nr=!0)}else Nr=!0}if(Nr){let Lr=mapAndGatherRemainingDecorations(Br,Tr,Cr,$r,Rr,Dr,Mr),Hr=buildTree(Lr,Ar,0,Mr);Cr=Hr.local;for(let zr=0;zr$r&&Mr.to{let Lr=takeSpansForNode(Tr,Br,Nr+$r);if(Lr){Dr=!0;let Hr=buildTree(Lr,Br,$r+Nr+1,Ar);Hr!=empty$1&&Rr.push(Nr,Nr+Br.nodeSize,Hr)}});let Mr=moveSpans(Dr?withoutNulls(Tr):Tr,-$r).sort(byPos);for(let Br=0;Br0;)Cr++;Tr.splice(Cr,0,$r)}function viewDecorations(Tr){let Cr=[];return Tr.someProp("decorations",$r=>{let Ar=$r(Tr.state);Ar&&Ar!=empty$1&&Cr.push(Ar)}),Tr.cursorWrapper&&Cr.push(DecorationSet.create(Tr.state.doc,[Tr.cursorWrapper.deco])),DecorationGroup.from(Cr)}const observeOptions={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},useCharData=ie$1&&ie_version<=11;class SelectionState{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(Cr){this.anchorNode=Cr.anchorNode,this.anchorOffset=Cr.anchorOffset,this.focusNode=Cr.focusNode,this.focusOffset=Cr.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(Cr){return Cr.anchorNode==this.anchorNode&&Cr.anchorOffset==this.anchorOffset&&Cr.focusNode==this.focusNode&&Cr.focusOffset==this.focusOffset}}class DOMObserver{constructor(Cr,$r){this.view=Cr,this.handleDOMChange=$r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new SelectionState,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(Ar=>{for(let Rr=0;RrRr.type=="childList"&&Rr.removedNodes.length||Rr.type=="characterData"&&Rr.oldValue.length>Rr.target.nodeValue.length)?this.flushSoon():this.flush()}),useCharData&&(this.onCharData=Ar=>{this.queue.push({target:Ar.target,type:"characterData",oldValue:Ar.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,observeOptions)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let Cr=this.observer.takeRecords();if(Cr.length){for(let $r=0;$rthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(hasFocusAndSelection(this.view)){if(this.suppressingSelectionUpdates)return selectionToDOM(this.view);if(ie$1&&ie_version<=11&&!this.view.state.selection.empty){let Cr=this.view.domSelectionRange();if(Cr.focusNode&&isEquivalentPosition(Cr.focusNode,Cr.focusOffset,Cr.anchorNode,Cr.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(Cr){if(!Cr.focusNode)return!0;let $r=new Set,Ar;for(let Dr=Cr.focusNode;Dr;Dr=parentNode(Dr))$r.add(Dr);for(let Dr=Cr.anchorNode;Dr;Dr=parentNode(Dr))if($r.has(Dr)){Ar=Dr;break}let Rr=Ar&&this.view.docView.nearestDesc(Ar);if(Rr&&Rr.ignoreMutation({type:"selection",target:Ar.nodeType==3?Ar.parentNode:Ar}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let Cr of this.observer.takeRecords())this.queue.push(Cr);return this.queue}flush(){let{view:Cr}=this;if(!Cr.docView||this.flushingSoon>-1)return;let $r=this.pendingRecords();$r.length&&(this.queue=[]);let Ar=Cr.domSelectionRange(),Rr=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(Ar)&&hasFocusAndSelection(Cr)&&!this.ignoreSelectionChange(Ar),Dr=-1,Mr=-1,Br=!1,Nr=[];if(Cr.editable)for(let Hr=0;Hr<$r.length;Hr++){let zr=this.registerMutation($r[Hr],Nr);zr&&(Dr=Dr<0?zr.from:Math.min(zr.from,Dr),Mr=Mr<0?zr.to:Math.max(zr.to,Mr),zr.typeOver&&(Br=!0))}if(gecko&&Nr.length>1){let Hr=Nr.filter(zr=>zr.nodeName=="BR");if(Hr.length==2){let zr=Hr[0],Ur=Hr[1];zr.parentNode&&zr.parentNode.parentNode==Ur.parentNode?Ur.remove():zr.remove()}}let Lr=null;Dr<0&&Rr&&Cr.input.lastFocus>Date.now()-200&&Math.max(Cr.input.lastTouch,Cr.input.lastClick.time)-1||Rr)&&(Dr>-1&&(Cr.docView.markDirty(Dr,Mr),checkCSS(Cr)),this.handleDOMChange(Dr,Mr,Br,Nr),Cr.docView&&Cr.docView.dirty?Cr.updateState(Cr.state):this.currentSelection.eq(Ar)||selectionToDOM(Cr),this.currentSelection.set(Ar))}registerMutation(Cr,$r){if($r.indexOf(Cr.target)>-1)return null;let Ar=this.view.docView.nearestDesc(Cr.target);if(Cr.type=="attributes"&&(Ar==this.view.docView||Cr.attributeName=="contenteditable"||Cr.attributeName=="style"&&!Cr.oldValue&&!Cr.target.getAttribute("style"))||!Ar||Ar.ignoreMutation(Cr))return null;if(Cr.type=="childList"){for(let Hr=0;HrRr;Xr--){let Kr=Ar.childNodes[Xr-1],Zr=Kr.pmViewDesc;if(Kr.nodeName=="BR"&&!Zr){Dr=Xr;break}if(!Zr||Zr.size)break}let zr=Tr.state.doc,Ur=Tr.someProp("domParser")||DOMParser$1.fromSchema(Tr.state.schema),Vr=zr.resolve(Mr),jr=null,Gr=Ur.parse(Ar,{topNode:Vr.parent,topMatch:Vr.parent.contentMatchAt(Vr.index()),topOpen:!0,from:Rr,to:Dr,preserveWhitespace:Vr.parent.type.whitespace=="pre"?"full":!0,findPositions:Lr,ruleFromNode,context:Vr});if(Lr&&Lr[0].pos!=null){let Xr=Lr[0].pos,Kr=Lr[1]&&Lr[1].pos;Kr==null&&(Kr=Xr),jr={anchor:Xr+Mr,head:Kr+Mr}}return{doc:Gr,sel:jr,from:Mr,to:Br}}function ruleFromNode(Tr){let Cr=Tr.pmViewDesc;if(Cr)return Cr.parseRule();if(Tr.nodeName=="BR"&&Tr.parentNode){if(safari&&/^(ul|ol)$/i.test(Tr.parentNode.nodeName)){let $r=document.createElement("div");return $r.appendChild(document.createElement("li")),{skip:$r}}else if(Tr.parentNode.lastChild==Tr||safari&&/^(tr|table)$/i.test(Tr.parentNode.nodeName))return{ignore:!0}}else if(Tr.nodeName=="IMG"&&Tr.getAttribute("mark-placeholder"))return{ignore:!0};return null}const isInline$1=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function readDOMChange(Tr,Cr,$r,Ar,Rr){let Dr=Tr.input.compositionPendingChanges||(Tr.composing?Tr.input.compositionID:0);if(Tr.input.compositionPendingChanges=0,Cr<0){let so=Tr.input.lastSelectionTime>Date.now()-50?Tr.input.lastSelectionOrigin:null,ao=selectionFromDOM(Tr,so);if(ao&&!Tr.state.selection.eq(ao)){if(chrome&&android&&Tr.input.lastKeyCode===13&&Date.now()-100po(Tr,keyEvent(13,"Enter"))))return;let lo=Tr.state.tr.setSelection(ao);so=="pointer"?lo.setMeta("pointer",!0):so=="key"&&lo.scrollIntoView(),Dr&&lo.setMeta("composition",Dr),Tr.dispatch(lo)}return}let Mr=Tr.state.doc.resolve(Cr),Br=Mr.sharedDepth($r);Cr=Mr.before(Br+1),$r=Tr.state.doc.resolve($r).after(Br+1);let Nr=Tr.state.selection,Lr=parseBetween(Tr,Cr,$r),Hr=Tr.state.doc,zr=Hr.slice(Lr.from,Lr.to),Ur,Vr;Tr.input.lastKeyCode===8&&Date.now()-100Date.now()-225||android)&&Rr.some(so=>so.nodeType==1&&!isInline$1.test(so.nodeName))&&(!jr||jr.endA>=jr.endB)&&Tr.someProp("handleKeyDown",so=>so(Tr,keyEvent(13,"Enter")))){Tr.input.lastIOSEnter=0;return}if(!jr)if(Ar&&Nr instanceof TextSelection&&!Nr.empty&&Nr.$head.sameParent(Nr.$anchor)&&!Tr.composing&&!(Lr.sel&&Lr.sel.anchor!=Lr.sel.head))jr={start:Nr.from,endA:Nr.to,endB:Nr.to};else{if(Lr.sel){let so=resolveSelection(Tr,Tr.state.doc,Lr.sel);if(so&&!so.eq(Tr.state.selection)){let ao=Tr.state.tr.setSelection(so);Dr&&ao.setMeta("composition",Dr),Tr.dispatch(ao)}}return}if(chrome&&Tr.cursorWrapper&&Lr.sel&&Lr.sel.anchor==Tr.cursorWrapper.deco.from&&Lr.sel.head==Lr.sel.anchor){let so=jr.endB-jr.start;Lr.sel={anchor:Lr.sel.anchor+so,head:Lr.sel.anchor+so}}Tr.input.domChangeCount++,Tr.state.selection.fromTr.state.selection.from&&jr.start<=Tr.state.selection.from+2&&Tr.state.selection.from>=Lr.from?jr.start=Tr.state.selection.from:jr.endA=Tr.state.selection.to-2&&Tr.state.selection.to<=Lr.to&&(jr.endB+=Tr.state.selection.to-jr.endA,jr.endA=Tr.state.selection.to)),ie$1&&ie_version<=11&&jr.endB==jr.start+1&&jr.endA==jr.start&&jr.start>Lr.from&&Lr.doc.textBetween(jr.start-Lr.from-1,jr.start-Lr.from+1)=="  "&&(jr.start--,jr.endA--,jr.endB--);let Gr=Lr.doc.resolveNoCache(jr.start-Lr.from),Xr=Lr.doc.resolveNoCache(jr.endB-Lr.from),Kr=Hr.resolve(jr.start),Zr=Gr.sameParent(Xr)&&Gr.parent.inlineContent&&Kr.end()>=jr.endA,eo;if((ios&&Tr.input.lastIOSEnter>Date.now()-225&&(!Zr||Rr.some(so=>so.nodeName=="DIV"||so.nodeName=="P"))||!Zr&&Gr.posso(Tr,keyEvent(13,"Enter")))){Tr.input.lastIOSEnter=0;return}if(Tr.state.selection.anchor>jr.start&&looksLikeJoin(Hr,jr.start,jr.endA,Gr,Xr)&&Tr.someProp("handleKeyDown",so=>so(Tr,keyEvent(8,"Backspace")))){android&&chrome&&Tr.domObserver.suppressSelectionUpdates();return}chrome&&android&&jr.endB==jr.start&&(Tr.input.lastAndroidDelete=Date.now()),android&&!Zr&&Gr.start()!=Xr.start()&&Xr.parentOffset==0&&Gr.depth==Xr.depth&&Lr.sel&&Lr.sel.anchor==Lr.sel.head&&Lr.sel.head==jr.endA&&(jr.endB-=2,Xr=Lr.doc.resolveNoCache(jr.endB-Lr.from),setTimeout(()=>{Tr.someProp("handleKeyDown",function(so){return so(Tr,keyEvent(13,"Enter"))})},20));let Wr=jr.start,Yr=jr.endA,Jr,no,ro;if(Zr){if(Gr.pos==Xr.pos)ie$1&&ie_version<=11&&Gr.parentOffset==0&&(Tr.domObserver.suppressSelectionUpdates(),setTimeout(()=>selectionToDOM(Tr),20)),Jr=Tr.state.tr.delete(Wr,Yr),no=Hr.resolve(jr.start).marksAcross(Hr.resolve(jr.endA));else if(jr.endA==jr.endB&&(ro=isMarkChange(Gr.parent.content.cut(Gr.parentOffset,Xr.parentOffset),Kr.parent.content.cut(Kr.parentOffset,jr.endA-Kr.start()))))Jr=Tr.state.tr,ro.type=="add"?Jr.addMark(Wr,Yr,ro.mark):Jr.removeMark(Wr,Yr,ro.mark);else if(Gr.parent.child(Gr.index()).isText&&Gr.index()==Xr.index()-(Xr.textOffset?0:1)){let so=Gr.parent.textBetween(Gr.parentOffset,Xr.parentOffset);if(Tr.someProp("handleTextInput",ao=>ao(Tr,Wr,Yr,so)))return;Jr=Tr.state.tr.insertText(so,Wr,Yr)}}if(Jr||(Jr=Tr.state.tr.replace(Wr,Yr,Lr.doc.slice(jr.start-Lr.from,jr.endB-Lr.from))),Lr.sel){let so=resolveSelection(Tr,Jr.doc,Lr.sel);so&&!(chrome&&android&&Tr.composing&&so.empty&&(jr.start!=jr.endB||Tr.input.lastAndroidDeleteCr.content.size?null:selectionBetween(Tr,Cr.resolve($r.anchor),Cr.resolve($r.head))}function isMarkChange(Tr,Cr){let $r=Tr.firstChild.marks,Ar=Cr.firstChild.marks,Rr=$r,Dr=Ar,Mr,Br,Nr;for(let Hr=0;HrHr.mark(Br.addToSet(Hr.marks));else if(Rr.length==0&&Dr.length==1)Br=Dr[0],Mr="remove",Nr=Hr=>Hr.mark(Br.removeFromSet(Hr.marks));else return null;let Lr=[];for(let Hr=0;Hr$r||skipClosingAndOpening(Mr,!0,!1)<$r?!1:Ar.parent.content.cut(Ar.parentOffset).eq(Mr.parent.content)}function skipClosingAndOpening(Tr,Cr,$r){let Ar=Tr.depth,Rr=Cr?Tr.end():Tr.pos;for(;Ar>0&&(Cr||Tr.indexAfter(Ar)==Tr.node(Ar).childCount);)Ar--,Rr++,Cr=!1;if($r){let Dr=Tr.node(Ar).maybeChild(Tr.indexAfter(Ar));for(;Dr&&!Dr.isLeaf;)Dr=Dr.firstChild,Rr++}return Rr}function findDiff(Tr,Cr,$r,Ar,Rr){let Dr=Tr.findDiffStart(Cr,$r);if(Dr==null)return null;let{a:Mr,b:Br}=Tr.findDiffEnd(Cr,$r+Tr.size,$r+Cr.size);if(Rr=="end"){let Nr=Math.max(0,Dr-Math.min(Mr,Br));Ar-=Mr+Nr-Dr}if(Mr=Mr?Dr-Ar:0;Dr-=Nr,Dr&&Dr=Br?Dr-Ar:0;Dr-=Nr,Dr&&Dr=56320&&Cr<=57343&&$r>=55296&&$r<=56319}class EditorView{constructor(Cr,$r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new InputState,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=$r,this.state=$r.state,this.directPlugins=$r.plugins||[],this.directPlugins.forEach(checkStateComponent),this.dispatch=this.dispatch.bind(this),this.dom=Cr&&Cr.mount||document.createElement("div"),Cr&&(Cr.appendChild?Cr.appendChild(this.dom):typeof Cr=="function"?Cr(this.dom):Cr.mount&&(this.mounted=!0)),this.editable=getEditable(this),updateCursorWrapper(this),this.nodeViews=buildNodeViews(this),this.docView=docViewDesc(this.state.doc,computeDocDeco(this),viewDecorations(this),this.dom,this),this.domObserver=new DOMObserver(this,(Ar,Rr,Dr,Mr)=>readDOMChange(this,Ar,Rr,Dr,Mr)),this.domObserver.start(),initInput(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let Cr=this._props;this._props={};for(let $r in Cr)this._props[$r]=Cr[$r];this._props.state=this.state}return this._props}update(Cr){Cr.handleDOMEvents!=this._props.handleDOMEvents&&ensureListeners(this);let $r=this._props;this._props=Cr,Cr.plugins&&(Cr.plugins.forEach(checkStateComponent),this.directPlugins=Cr.plugins),this.updateStateInner(Cr.state,$r)}setProps(Cr){let $r={};for(let Ar in this._props)$r[Ar]=this._props[Ar];$r.state=this.state;for(let Ar in Cr)$r[Ar]=Cr[Ar];this.update($r)}updateState(Cr){this.updateStateInner(Cr,this._props)}updateStateInner(Cr,$r){var Ar;let Rr=this.state,Dr=!1,Mr=!1;Cr.storedMarks&&this.composing&&(clearComposition(this),Mr=!0),this.state=Cr;let Br=Rr.plugins!=Cr.plugins||this._props.plugins!=$r.plugins;if(Br||this._props.plugins!=$r.plugins||this._props.nodeViews!=$r.nodeViews){let Vr=buildNodeViews(this);changedNodeViews(Vr,this.nodeViews)&&(this.nodeViews=Vr,Dr=!0)}(Br||$r.handleDOMEvents!=this._props.handleDOMEvents)&&ensureListeners(this),this.editable=getEditable(this),updateCursorWrapper(this);let Nr=viewDecorations(this),Lr=computeDocDeco(this),Hr=Rr.plugins!=Cr.plugins&&!Rr.doc.eq(Cr.doc)?"reset":Cr.scrollToSelection>Rr.scrollToSelection?"to selection":"preserve",zr=Dr||!this.docView.matchesNode(Cr.doc,Lr,Nr);(zr||!Cr.selection.eq(Rr.selection))&&(Mr=!0);let Ur=Hr=="preserve"&&Mr&&this.dom.style.overflowAnchor==null&&storeScrollPos(this);if(Mr){this.domObserver.stop();let Vr=zr&&(ie$1||chrome)&&!this.composing&&!Rr.selection.empty&&!Cr.selection.empty&&selectionContextChanged(Rr.selection,Cr.selection);if(zr){let jr=chrome?this.trackWrites=this.domSelectionRange().focusNode:null;(Dr||!this.docView.update(Cr.doc,Lr,Nr,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=docViewDesc(Cr.doc,Lr,Nr,this.dom,this)),jr&&!this.trackWrites&&(Vr=!0)}Vr||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&anchorInRightPlace(this))?selectionToDOM(this,Vr):(syncNodeSelection(this,Cr.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(Rr),!((Ar=this.dragging)===null||Ar===void 0)&&Ar.node&&!Rr.doc.eq(Cr.doc)&&this.updateDraggedNode(this.dragging,Rr),Hr=="reset"?this.dom.scrollTop=0:Hr=="to selection"?this.scrollToSelection():Ur&&resetScrollPos(Ur)}scrollToSelection(){let Cr=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",$r=>$r(this)))if(this.state.selection instanceof NodeSelection){let $r=this.docView.domAfterPos(this.state.selection.from);$r.nodeType==1&&scrollRectIntoView(this,$r.getBoundingClientRect(),Cr)}else scrollRectIntoView(this,this.coordsAtPos(this.state.selection.head,1),Cr)}destroyPluginViews(){let Cr;for(;Cr=this.pluginViews.pop();)Cr.destroy&&Cr.destroy()}updatePluginViews(Cr){if(!Cr||Cr.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let $r=0;$r0&&this.state.doc.nodeAt(Dr))==Ar.node&&(Rr=Dr)}this.dragging=new Dragging(Cr.slice,Cr.move,Rr<0?void 0:NodeSelection.create(this.state.doc,Rr))}someProp(Cr,$r){let Ar=this._props&&this._props[Cr],Rr;if(Ar!=null&&(Rr=$r?$r(Ar):Ar))return Rr;for(let Mr=0;Mr$r.ownerDocument.getSelection()),this._root=$r}return Cr||document}updateRoot(){this._root=null}posAtCoords(Cr){return posAtCoords(this,Cr)}coordsAtPos(Cr,$r=1){return coordsAtPos(this,Cr,$r)}domAtPos(Cr,$r=0){return this.docView.domFromPos(Cr,$r)}nodeDOM(Cr){let $r=this.docView.descAt(Cr);return $r?$r.nodeDOM:null}posAtDOM(Cr,$r,Ar=-1){let Rr=this.docView.posFromDOM(Cr,$r,Ar);if(Rr==null)throw new RangeError("DOM position not inside the editor");return Rr}endOfTextblock(Cr,$r){return endOfTextblock(this,$r||this.state,Cr)}pasteHTML(Cr,$r){return doPaste(this,"",Cr,!1,$r||new ClipboardEvent("paste"))}pasteText(Cr,$r){return doPaste(this,Cr,null,!0,$r||new ClipboardEvent("paste"))}destroy(){this.docView&&(destroyInput(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],viewDecorations(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(Cr){return dispatchEvent$1(this,Cr)}dispatch(Cr){let $r=this._props.dispatchTransaction;$r?$r.call(this,Cr):this.updateState(this.state.apply(Cr))}domSelectionRange(){return safari&&this.root.nodeType===11&&deepActiveElement(this.dom.ownerDocument)==this.dom?safariShadowSelectionRange(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function computeDocDeco(Tr){let Cr=Object.create(null);return Cr.class="ProseMirror",Cr.contenteditable=String(Tr.editable),Tr.someProp("attributes",$r=>{if(typeof $r=="function"&&($r=$r(Tr.state)),$r)for(let Ar in $r)Ar=="class"?Cr.class+=" "+$r[Ar]:Ar=="style"?Cr.style=(Cr.style?Cr.style+";":"")+$r[Ar]:!Cr[Ar]&&Ar!="contenteditable"&&Ar!="nodeName"&&(Cr[Ar]=String($r[Ar]))}),Cr.translate||(Cr.translate="no"),[Decoration.node(0,Tr.state.doc.content.size,Cr)]}function updateCursorWrapper(Tr){if(Tr.markCursor){let Cr=document.createElement("img");Cr.className="ProseMirror-separator",Cr.setAttribute("mark-placeholder","true"),Cr.setAttribute("alt",""),Tr.cursorWrapper={dom:Cr,deco:Decoration.widget(Tr.state.selection.head,Cr,{raw:!0,marks:Tr.markCursor})}}else Tr.cursorWrapper=null}function getEditable(Tr){return!Tr.someProp("editable",Cr=>Cr(Tr.state)===!1)}function selectionContextChanged(Tr,Cr){let $r=Math.min(Tr.$anchor.sharedDepth(Tr.head),Cr.$anchor.sharedDepth(Cr.head));return Tr.$anchor.start($r)!=Cr.$anchor.start($r)}function buildNodeViews(Tr){let Cr=Object.create(null);function $r(Ar){for(let Rr in Ar)Object.prototype.hasOwnProperty.call(Cr,Rr)||(Cr[Rr]=Ar[Rr])}return Tr.someProp("nodeViews",$r),Tr.someProp("markViews",$r),Cr}function changedNodeViews(Tr,Cr){let $r=0,Ar=0;for(let Rr in Tr){if(Tr[Rr]!=Cr[Rr])return!0;$r++}for(let Rr in Cr)Ar++;return $r!=Ar}function checkStateComponent(Tr){if(Tr.spec.state||Tr.spec.filterTransaction||Tr.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var base$2={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shift={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mac$1=typeof navigator<"u"&&/Mac/.test(navigator.platform),ie=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var i$3=0;i$3<10;i$3++)base$2[48+i$3]=base$2[96+i$3]=String(i$3);for(var i$3=1;i$3<=24;i$3++)base$2[i$3+111]="F"+i$3;for(var i$3=65;i$3<=90;i$3++)base$2[i$3]=String.fromCharCode(i$3+32),shift[i$3]=String.fromCharCode(i$3);for(var code$2 in base$2)shift.hasOwnProperty(code$2)||(shift[code$2]=base$2[code$2]);function keyName(Tr){var Cr=mac$1&&Tr.metaKey&&Tr.shiftKey&&!Tr.ctrlKey&&!Tr.altKey||ie&&Tr.shiftKey&&Tr.key&&Tr.key.length==1||Tr.key=="Unidentified",$r=!Cr&&Tr.key||(Tr.shiftKey?shift:base$2)[Tr.keyCode]||Tr.key||"Unidentified";return $r=="Esc"&&($r="Escape"),$r=="Del"&&($r="Delete"),$r=="Left"&&($r="ArrowLeft"),$r=="Up"&&($r="ArrowUp"),$r=="Right"&&($r="ArrowRight"),$r=="Down"&&($r="ArrowDown"),$r}const mac=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function normalizeKeyName$1(Tr){let Cr=Tr.split(/-(?!$)/),$r=Cr[Cr.length-1];$r=="Space"&&($r=" ");let Ar,Rr,Dr,Mr;for(let Br=0;Br127)&&(Dr=base$2[Ar.keyCode])&&Dr!=Rr){let Br=Cr[modifiers(Dr,Ar)];if(Br&&Br($r.state,$r.dispatch,$r))return!0}}return!1}}const deleteSelection$1=(Tr,Cr)=>Tr.selection.empty?!1:(Cr&&Cr(Tr.tr.deleteSelection().scrollIntoView()),!0);function atBlockStart(Tr,Cr){let{$cursor:$r}=Tr.selection;return!$r||(Cr?!Cr.endOfTextblock("backward",Tr):$r.parentOffset>0)?null:$r}const joinBackward$1=(Tr,Cr,$r)=>{let Ar=atBlockStart(Tr,$r);if(!Ar)return!1;let Rr=findCutBefore(Ar);if(!Rr){let Mr=Ar.blockRange(),Br=Mr&&liftTarget(Mr);return Br==null?!1:(Cr&&Cr(Tr.tr.lift(Mr,Br).scrollIntoView()),!0)}let Dr=Rr.nodeBefore;if(!Dr.type.spec.isolating&&deleteBarrier(Tr,Rr,Cr))return!0;if(Ar.parent.content.size==0&&(textblockAt(Dr,"end")||NodeSelection.isSelectable(Dr))){let Mr=replaceStep(Tr.doc,Ar.before(),Ar.after(),Slice.empty);if(Mr&&Mr.slice.size{let{$head:Ar,empty:Rr}=Tr.selection,Dr=Ar;if(!Rr)return!1;if(Ar.parent.isTextblock){if($r?!$r.endOfTextblock("backward",Tr):Ar.parentOffset>0)return!1;Dr=findCutBefore(Ar)}let Mr=Dr&&Dr.nodeBefore;return!Mr||!NodeSelection.isSelectable(Mr)?!1:(Cr&&Cr(Tr.tr.setSelection(NodeSelection.create(Tr.doc,Dr.pos-Mr.nodeSize)).scrollIntoView()),!0)};function findCutBefore(Tr){if(!Tr.parent.type.spec.isolating)for(let Cr=Tr.depth-1;Cr>=0;Cr--){if(Tr.index(Cr)>0)return Tr.doc.resolve(Tr.before(Cr+1));if(Tr.node(Cr).type.spec.isolating)break}return null}function atBlockEnd(Tr,Cr){let{$cursor:$r}=Tr.selection;return!$r||(Cr?!Cr.endOfTextblock("forward",Tr):$r.parentOffset<$r.parent.content.size)?null:$r}const joinForward$1=(Tr,Cr,$r)=>{let Ar=atBlockEnd(Tr,$r);if(!Ar)return!1;let Rr=findCutAfter(Ar);if(!Rr)return!1;let Dr=Rr.nodeAfter;if(deleteBarrier(Tr,Rr,Cr))return!0;if(Ar.parent.content.size==0&&(textblockAt(Dr,"start")||NodeSelection.isSelectable(Dr))){let Mr=replaceStep(Tr.doc,Ar.before(),Ar.after(),Slice.empty);if(Mr&&Mr.slice.size{let{$head:Ar,empty:Rr}=Tr.selection,Dr=Ar;if(!Rr)return!1;if(Ar.parent.isTextblock){if($r?!$r.endOfTextblock("forward",Tr):Ar.parentOffset=0;Cr--){let $r=Tr.node(Cr);if(Tr.index(Cr)+1<$r.childCount)return Tr.doc.resolve(Tr.after(Cr+1));if($r.type.spec.isolating)break}return null}const joinUp$1=(Tr,Cr)=>{let $r=Tr.selection,Ar=$r instanceof NodeSelection,Rr;if(Ar){if($r.node.isTextblock||!canJoin(Tr.doc,$r.from))return!1;Rr=$r.from}else if(Rr=joinPoint(Tr.doc,$r.from,-1),Rr==null)return!1;if(Cr){let Dr=Tr.tr.join(Rr);Ar&&Dr.setSelection(NodeSelection.create(Dr.doc,Rr-Tr.doc.resolve(Rr).nodeBefore.nodeSize)),Cr(Dr.scrollIntoView())}return!0},joinDown$1=(Tr,Cr)=>{let $r=Tr.selection,Ar;if($r instanceof NodeSelection){if($r.node.isTextblock||!canJoin(Tr.doc,$r.to))return!1;Ar=$r.to}else if(Ar=joinPoint(Tr.doc,$r.to,1),Ar==null)return!1;return Cr&&Cr(Tr.tr.join(Ar).scrollIntoView()),!0},lift$1=(Tr,Cr)=>{let{$from:$r,$to:Ar}=Tr.selection,Rr=$r.blockRange(Ar),Dr=Rr&&liftTarget(Rr);return Dr==null?!1:(Cr&&Cr(Tr.tr.lift(Rr,Dr).scrollIntoView()),!0)},newlineInCode$1=(Tr,Cr)=>{let{$head:$r,$anchor:Ar}=Tr.selection;return!$r.parent.type.spec.code||!$r.sameParent(Ar)?!1:(Cr&&Cr(Tr.tr.insertText(` `).scrollIntoView()),!0)};function defaultBlockAt$1(Tr){for(let Cr=0;Cr{let{$head:$r,$anchor:Ar}=Tr.selection;if(!$r.parent.type.spec.code||!$r.sameParent(Ar))return!1;let Rr=$r.node(-1),Dr=$r.indexAfter(-1),Mr=defaultBlockAt$1(Rr.contentMatchAt(Dr));if(!Mr||!Rr.canReplaceWith(Dr,Dr,Mr))return!1;if(Cr){let Br=$r.after(),Nr=Tr.tr.replaceWith(Br,Br,Mr.createAndFill());Nr.setSelection(Selection.near(Nr.doc.resolve(Br),1)),Cr(Nr.scrollIntoView())}return!0},createParagraphNear$1=(Tr,Cr)=>{let $r=Tr.selection,{$from:Ar,$to:Rr}=$r;if($r instanceof AllSelection||Ar.parent.inlineContent||Rr.parent.inlineContent)return!1;let Dr=defaultBlockAt$1(Rr.parent.contentMatchAt(Rr.indexAfter()));if(!Dr||!Dr.isTextblock)return!1;if(Cr){let Mr=(!Ar.parentOffset&&Rr.index(){let{$cursor:$r}=Tr.selection;if(!$r||$r.parent.content.size)return!1;if($r.depth>1&&$r.after()!=$r.end(-1)){let Dr=$r.before();if(canSplit(Tr.doc,Dr))return Cr&&Cr(Tr.tr.split(Dr).scrollIntoView()),!0}let Ar=$r.blockRange(),Rr=Ar&&liftTarget(Ar);return Rr==null?!1:(Cr&&Cr(Tr.tr.lift(Ar,Rr).scrollIntoView()),!0)},selectParentNode$1=(Tr,Cr)=>{let{$from:$r,to:Ar}=Tr.selection,Rr,Dr=$r.sharedDepth(Ar);return Dr==0?!1:(Rr=$r.before(Dr),Cr&&Cr(Tr.tr.setSelection(NodeSelection.create(Tr.doc,Rr))),!0)};function joinMaybeClear(Tr,Cr,$r){let Ar=Cr.nodeBefore,Rr=Cr.nodeAfter,Dr=Cr.index();return!Ar||!Rr||!Ar.type.compatibleContent(Rr.type)?!1:!Ar.content.size&&Cr.parent.canReplace(Dr-1,Dr)?($r&&$r(Tr.tr.delete(Cr.pos-Ar.nodeSize,Cr.pos).scrollIntoView()),!0):!Cr.parent.canReplace(Dr,Dr+1)||!(Rr.isTextblock||canJoin(Tr.doc,Cr.pos))?!1:($r&&$r(Tr.tr.clearIncompatible(Cr.pos,Ar.type,Ar.contentMatchAt(Ar.childCount)).join(Cr.pos).scrollIntoView()),!0)}function deleteBarrier(Tr,Cr,$r){let Ar=Cr.nodeBefore,Rr=Cr.nodeAfter,Dr,Mr;if(Ar.type.spec.isolating||Rr.type.spec.isolating)return!1;if(joinMaybeClear(Tr,Cr,$r))return!0;let Br=Cr.parent.canReplace(Cr.index(),Cr.index()+1);if(Br&&(Dr=(Mr=Ar.contentMatchAt(Ar.childCount)).findWrapping(Rr.type))&&Mr.matchType(Dr[0]||Rr.type).validEnd){if($r){let zr=Cr.pos+Rr.nodeSize,Ur=Fragment.empty;for(let Gr=Dr.length-1;Gr>=0;Gr--)Ur=Fragment.from(Dr[Gr].create(null,Ur));Ur=Fragment.from(Ar.copy(Ur));let Vr=Tr.tr.step(new ReplaceAroundStep(Cr.pos-1,zr,Cr.pos,zr,new Slice(Ur,1,0),Dr.length,!0)),jr=zr+2*Dr.length;canJoin(Vr.doc,jr)&&Vr.join(jr),$r(Vr.scrollIntoView())}return!0}let Nr=Selection.findFrom(Cr,1),Lr=Nr&&Nr.$from.blockRange(Nr.$to),Hr=Lr&&liftTarget(Lr);if(Hr!=null&&Hr>=Cr.depth)return $r&&$r(Tr.tr.lift(Lr,Hr).scrollIntoView()),!0;if(Br&&textblockAt(Rr,"start",!0)&&textblockAt(Ar,"end")){let zr=Ar,Ur=[];for(;Ur.push(zr),!zr.isTextblock;)zr=zr.lastChild;let Vr=Rr,jr=1;for(;!Vr.isTextblock;Vr=Vr.firstChild)jr++;if(zr.canReplace(zr.childCount,zr.childCount,Vr.content)){if($r){let Gr=Fragment.empty;for(let Kr=Ur.length-1;Kr>=0;Kr--)Gr=Fragment.from(Ur[Kr].copy(Gr));let Xr=Tr.tr.step(new ReplaceAroundStep(Cr.pos-Ur.length,Cr.pos+Rr.nodeSize,Cr.pos+jr,Cr.pos+Rr.nodeSize-jr,new Slice(Gr,Ur.length,0),0,!0));$r(Xr.scrollIntoView())}return!0}}return!1}function selectTextblockSide(Tr){return function(Cr,$r){let Ar=Cr.selection,Rr=Tr<0?Ar.$from:Ar.$to,Dr=Rr.depth;for(;Rr.node(Dr).isInline;){if(!Dr)return!1;Dr--}return Rr.node(Dr).isTextblock?($r&&$r(Cr.tr.setSelection(TextSelection.create(Cr.doc,Tr<0?Rr.start(Dr):Rr.end(Dr)))),!0):!1}}const selectTextblockStart$1=selectTextblockSide(-1),selectTextblockEnd$1=selectTextblockSide(1);function wrapIn$1(Tr,Cr=null){return function($r,Ar){let{$from:Rr,$to:Dr}=$r.selection,Mr=Rr.blockRange(Dr),Br=Mr&&findWrapping(Mr,Tr,Cr);return Br?(Ar&&Ar($r.tr.wrap(Mr,Br).scrollIntoView()),!0):!1}}function setBlockType(Tr,Cr=null){return function($r,Ar){let Rr=!1;for(let Dr=0;Dr<$r.selection.ranges.length&&!Rr;Dr++){let{$from:{pos:Mr},$to:{pos:Br}}=$r.selection.ranges[Dr];$r.doc.nodesBetween(Mr,Br,(Nr,Lr)=>{if(Rr)return!1;if(!(!Nr.isTextblock||Nr.hasMarkup(Tr,Cr)))if(Nr.type==Tr)Rr=!0;else{let Hr=$r.doc.resolve(Lr),zr=Hr.index();Rr=Hr.parent.canReplaceWith(zr,zr+1,Tr)}})}if(!Rr)return!1;if(Ar){let Dr=$r.tr;for(let Mr=0;Mr<$r.selection.ranges.length;Mr++){let{$from:{pos:Br},$to:{pos:Nr}}=$r.selection.ranges[Mr];Dr.setBlockType(Br,Nr,Tr,Cr)}Ar(Dr.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function wrapInList$1(Tr,Cr=null){return function($r,Ar){let{$from:Rr,$to:Dr}=$r.selection,Mr=Rr.blockRange(Dr),Br=!1,Nr=Mr;if(!Mr)return!1;if(Mr.depth>=2&&Rr.node(Mr.depth-1).type.compatibleContent(Tr)&&Mr.startIndex==0){if(Rr.index(Mr.depth-1)==0)return!1;let Hr=$r.doc.resolve(Mr.start-2);Nr=new NodeRange(Hr,Hr,Mr.depth),Mr.endIndex=0;Hr--)Dr=Fragment.from($r[Hr].type.create($r[Hr].attrs,Dr));Tr.step(new ReplaceAroundStep(Cr.start-(Ar?2:0),Cr.end,Cr.start,Cr.end,new Slice(Dr,0,0),$r.length,!0));let Mr=0;for(let Hr=0;Hr<$r.length;Hr++)$r[Hr].type==Rr&&(Mr=Hr+1);let Br=$r.length-Mr,Nr=Cr.start+$r.length-(Ar?2:0),Lr=Cr.parent;for(let Hr=Cr.startIndex,zr=Cr.endIndex,Ur=!0;HrMr.childCount>0&&Mr.firstChild.type==Tr);return Dr?$r?Ar.node(Dr.depth-1).type==Tr?liftToOuterList(Cr,$r,Tr,Dr):liftOutOfList(Cr,$r,Dr):!0:!1}}function liftToOuterList(Tr,Cr,$r,Ar){let Rr=Tr.tr,Dr=Ar.end,Mr=Ar.$to.end(Ar.depth);DrGr;jr--)Vr-=Rr.child(jr).nodeSize,Ar.delete(Vr-1,Vr+1);let Dr=Ar.doc.resolve($r.start),Mr=Dr.nodeAfter;if(Ar.mapping.map($r.end)!=$r.start+Dr.nodeAfter.nodeSize)return!1;let Br=$r.startIndex==0,Nr=$r.endIndex==Rr.childCount,Lr=Dr.node(-1),Hr=Dr.index(-1);if(!Lr.canReplace(Hr+(Br?0:1),Hr+1,Mr.content.append(Nr?Fragment.empty:Fragment.from(Rr))))return!1;let zr=Dr.pos,Ur=zr+Mr.nodeSize;return Ar.step(new ReplaceAroundStep(zr-(Br?1:0),Ur+(Nr?1:0),zr+1,Ur-1,new Slice((Br?Fragment.empty:Fragment.from(Rr.copy(Fragment.empty))).append(Nr?Fragment.empty:Fragment.from(Rr.copy(Fragment.empty))),Br?0:1,Nr?0:1),Br?0:1)),Cr(Ar.scrollIntoView()),!0}function sinkListItem$1(Tr){return function(Cr,$r){let{$from:Ar,$to:Rr}=Cr.selection,Dr=Ar.blockRange(Rr,Lr=>Lr.childCount>0&&Lr.firstChild.type==Tr);if(!Dr)return!1;let Mr=Dr.startIndex;if(Mr==0)return!1;let Br=Dr.parent,Nr=Br.child(Mr-1);if(Nr.type!=Tr)return!1;if($r){let Lr=Nr.lastChild&&Nr.lastChild.type==Br.type,Hr=Fragment.from(Lr?Tr.create():null),zr=new Slice(Fragment.from(Tr.create(null,Fragment.from(Br.type.create(null,Hr)))),Lr?3:1,0),Ur=Dr.start,Vr=Dr.end;$r(Cr.tr.step(new ReplaceAroundStep(Ur-(Lr?3:1),Vr,Ur,Vr,zr,1,!0)).scrollIntoView())}return!0}}function createChainableState(Tr){const{state:Cr,transaction:$r}=Tr;let{selection:Ar}=$r,{doc:Rr}=$r,{storedMarks:Dr}=$r;return{...Cr,apply:Cr.apply.bind(Cr),applyTransaction:Cr.applyTransaction.bind(Cr),filterTransaction:Cr.filterTransaction,plugins:Cr.plugins,schema:Cr.schema,reconfigure:Cr.reconfigure.bind(Cr),toJSON:Cr.toJSON.bind(Cr),get storedMarks(){return Dr},get selection(){return Ar},get doc(){return Rr},get tr(){return Ar=$r.selection,Rr=$r.doc,Dr=$r.storedMarks,$r}}}class CommandManager{constructor(Cr){this.editor=Cr.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=Cr.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:Cr,editor:$r,state:Ar}=this,{view:Rr}=$r,{tr:Dr}=Ar,Mr=this.buildProps(Dr);return Object.fromEntries(Object.entries(Cr).map(([Br,Nr])=>[Br,(...Hr)=>{const zr=Nr(...Hr)(Mr);return!Dr.getMeta("preventDispatch")&&!this.hasCustomState&&Rr.dispatch(Dr),zr}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(Cr,$r=!0){const{rawCommands:Ar,editor:Rr,state:Dr}=this,{view:Mr}=Rr,Br=[],Nr=!!Cr,Lr=Cr||Dr.tr,Hr=()=>(!Nr&&$r&&!Lr.getMeta("preventDispatch")&&!this.hasCustomState&&Mr.dispatch(Lr),Br.every(Ur=>Ur===!0)),zr={...Object.fromEntries(Object.entries(Ar).map(([Ur,Vr])=>[Ur,(...Gr)=>{const Xr=this.buildProps(Lr,$r),Kr=Vr(...Gr)(Xr);return Br.push(Kr),zr}])),run:Hr};return zr}createCan(Cr){const{rawCommands:$r,state:Ar}=this,Rr=!1,Dr=Cr||Ar.tr,Mr=this.buildProps(Dr,Rr);return{...Object.fromEntries(Object.entries($r).map(([Nr,Lr])=>[Nr,(...Hr)=>Lr(...Hr)({...Mr,dispatch:void 0})])),chain:()=>this.createChain(Dr,Rr)}}buildProps(Cr,$r=!0){const{rawCommands:Ar,editor:Rr,state:Dr}=this,{view:Mr}=Rr,Br={tr:Cr,editor:Rr,view:Mr,state:createChainableState({state:Dr,transaction:Cr}),dispatch:$r?()=>{}:void 0,chain:()=>this.createChain(Cr,$r),can:()=>this.createCan(Cr),get commands(){return Object.fromEntries(Object.entries(Ar).map(([Nr,Lr])=>[Nr,(...Hr)=>Lr(...Hr)(Br)]))}};return Br}}class EventEmitter{constructor(){this.callbacks={}}on(Cr,$r){return this.callbacks[Cr]||(this.callbacks[Cr]=[]),this.callbacks[Cr].push($r),this}emit(Cr,...$r){const Ar=this.callbacks[Cr];return Ar&&Ar.forEach(Rr=>Rr.apply(this,$r)),this}off(Cr,$r){const Ar=this.callbacks[Cr];return Ar&&($r?this.callbacks[Cr]=Ar.filter(Rr=>Rr!==$r):delete this.callbacks[Cr]),this}removeAllListeners(){this.callbacks={}}}function getExtensionField(Tr,Cr,$r){return Tr.config[Cr]===void 0&&Tr.parent?getExtensionField(Tr.parent,Cr,$r):typeof Tr.config[Cr]=="function"?Tr.config[Cr].bind({...$r,parent:Tr.parent?getExtensionField(Tr.parent,Cr,$r):null}):Tr.config[Cr]}function splitExtensions(Tr){const Cr=Tr.filter(Rr=>Rr.type==="extension"),$r=Tr.filter(Rr=>Rr.type==="node"),Ar=Tr.filter(Rr=>Rr.type==="mark");return{baseExtensions:Cr,nodeExtensions:$r,markExtensions:Ar}}function getAttributesFromExtensions(Tr){const Cr=[],{nodeExtensions:$r,markExtensions:Ar}=splitExtensions(Tr),Rr=[...$r,...Ar],Dr={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return Tr.forEach(Mr=>{const Br={name:Mr.name,options:Mr.options,storage:Mr.storage},Nr=getExtensionField(Mr,"addGlobalAttributes",Br);if(!Nr)return;Nr().forEach(Hr=>{Hr.types.forEach(zr=>{Object.entries(Hr.attributes).forEach(([Ur,Vr])=>{Cr.push({type:zr,name:Ur,attribute:{...Dr,...Vr}})})})})}),Rr.forEach(Mr=>{const Br={name:Mr.name,options:Mr.options,storage:Mr.storage},Nr=getExtensionField(Mr,"addAttributes",Br);if(!Nr)return;const Lr=Nr();Object.entries(Lr).forEach(([Hr,zr])=>{const Ur={...Dr,...zr};typeof(Ur==null?void 0:Ur.default)=="function"&&(Ur.default=Ur.default()),Ur!=null&&Ur.isRequired&&(Ur==null?void 0:Ur.default)===void 0&&delete Ur.default,Cr.push({type:Mr.name,name:Hr,attribute:Ur})})}),Cr}function getNodeType(Tr,Cr){if(typeof Tr=="string"){if(!Cr.nodes[Tr])throw Error(`There is no node type named '${Tr}'. Maybe you forgot to add the extension?`);return Cr.nodes[Tr]}return Tr}function mergeAttributes(...Tr){return Tr.filter(Cr=>!!Cr).reduce((Cr,$r)=>{const Ar={...Cr};return Object.entries($r).forEach(([Rr,Dr])=>{if(!Ar[Rr]){Ar[Rr]=Dr;return}if(Rr==="class"){const Br=Dr?Dr.split(" "):[],Nr=Ar[Rr]?Ar[Rr].split(" "):[],Lr=Br.filter(Hr=>!Nr.includes(Hr));Ar[Rr]=[...Nr,...Lr].join(" ")}else Rr==="style"?Ar[Rr]=[Ar[Rr],Dr].join("; "):Ar[Rr]=Dr}),Ar},{})}function getRenderedAttributes(Tr,Cr){return Cr.filter($r=>$r.attribute.rendered).map($r=>$r.attribute.renderHTML?$r.attribute.renderHTML(Tr.attrs)||{}:{[$r.name]:Tr.attrs[$r.name]}).reduce(($r,Ar)=>mergeAttributes($r,Ar),{})}function isFunction$2(Tr){return typeof Tr=="function"}function callOrReturn(Tr,Cr=void 0,...$r){return isFunction$2(Tr)?Cr?Tr.bind(Cr)(...$r):Tr(...$r):Tr}function isEmptyObject(Tr={}){return Object.keys(Tr).length===0&&Tr.constructor===Object}function fromString(Tr){return typeof Tr!="string"?Tr:Tr.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(Tr):Tr==="true"?!0:Tr==="false"?!1:Tr}function injectExtensionAttributesToParseRule(Tr,Cr){return Tr.style?Tr:{...Tr,getAttrs:$r=>{const Ar=Tr.getAttrs?Tr.getAttrs($r):Tr.attrs;if(Ar===!1)return!1;const Rr=Cr.reduce((Dr,Mr)=>{const Br=Mr.attribute.parseHTML?Mr.attribute.parseHTML($r):fromString($r.getAttribute(Mr.name));return Br==null?Dr:{...Dr,[Mr.name]:Br}},{});return{...Ar,...Rr}}}}function cleanUpSchemaItem(Tr){return Object.fromEntries(Object.entries(Tr).filter(([Cr,$r])=>Cr==="attrs"&&isEmptyObject($r)?!1:$r!=null))}function getSchemaByResolvedExtensions(Tr,Cr){var $r;const Ar=getAttributesFromExtensions(Tr),{nodeExtensions:Rr,markExtensions:Dr}=splitExtensions(Tr),Mr=($r=Rr.find(Lr=>getExtensionField(Lr,"topNode")))===null||$r===void 0?void 0:$r.name,Br=Object.fromEntries(Rr.map(Lr=>{const Hr=Ar.filter(Kr=>Kr.type===Lr.name),zr={name:Lr.name,options:Lr.options,storage:Lr.storage,editor:Cr},Ur=Tr.reduce((Kr,Zr)=>{const eo=getExtensionField(Zr,"extendNodeSchema",zr);return{...Kr,...eo?eo(Lr):{}}},{}),Vr=cleanUpSchemaItem({...Ur,content:callOrReturn(getExtensionField(Lr,"content",zr)),marks:callOrReturn(getExtensionField(Lr,"marks",zr)),group:callOrReturn(getExtensionField(Lr,"group",zr)),inline:callOrReturn(getExtensionField(Lr,"inline",zr)),atom:callOrReturn(getExtensionField(Lr,"atom",zr)),selectable:callOrReturn(getExtensionField(Lr,"selectable",zr)),draggable:callOrReturn(getExtensionField(Lr,"draggable",zr)),code:callOrReturn(getExtensionField(Lr,"code",zr)),defining:callOrReturn(getExtensionField(Lr,"defining",zr)),isolating:callOrReturn(getExtensionField(Lr,"isolating",zr)),attrs:Object.fromEntries(Hr.map(Kr=>{var Zr;return[Kr.name,{default:(Zr=Kr==null?void 0:Kr.attribute)===null||Zr===void 0?void 0:Zr.default}]}))}),jr=callOrReturn(getExtensionField(Lr,"parseHTML",zr));jr&&(Vr.parseDOM=jr.map(Kr=>injectExtensionAttributesToParseRule(Kr,Hr)));const Gr=getExtensionField(Lr,"renderHTML",zr);Gr&&(Vr.toDOM=Kr=>Gr({node:Kr,HTMLAttributes:getRenderedAttributes(Kr,Hr)}));const Xr=getExtensionField(Lr,"renderText",zr);return Xr&&(Vr.toText=Xr),[Lr.name,Vr]})),Nr=Object.fromEntries(Dr.map(Lr=>{const Hr=Ar.filter(Xr=>Xr.type===Lr.name),zr={name:Lr.name,options:Lr.options,storage:Lr.storage,editor:Cr},Ur=Tr.reduce((Xr,Kr)=>{const Zr=getExtensionField(Kr,"extendMarkSchema",zr);return{...Xr,...Zr?Zr(Lr):{}}},{}),Vr=cleanUpSchemaItem({...Ur,inclusive:callOrReturn(getExtensionField(Lr,"inclusive",zr)),excludes:callOrReturn(getExtensionField(Lr,"excludes",zr)),group:callOrReturn(getExtensionField(Lr,"group",zr)),spanning:callOrReturn(getExtensionField(Lr,"spanning",zr)),code:callOrReturn(getExtensionField(Lr,"code",zr)),attrs:Object.fromEntries(Hr.map(Xr=>{var Kr;return[Xr.name,{default:(Kr=Xr==null?void 0:Xr.attribute)===null||Kr===void 0?void 0:Kr.default}]}))}),jr=callOrReturn(getExtensionField(Lr,"parseHTML",zr));jr&&(Vr.parseDOM=jr.map(Xr=>injectExtensionAttributesToParseRule(Xr,Hr)));const Gr=getExtensionField(Lr,"renderHTML",zr);return Gr&&(Vr.toDOM=Xr=>Gr({mark:Xr,HTMLAttributes:getRenderedAttributes(Xr,Hr)})),[Lr.name,Vr]}));return new Schema({topNode:Mr,nodes:Br,marks:Nr})}function getSchemaTypeByName(Tr,Cr){return Cr.nodes[Tr]||Cr.marks[Tr]||null}function isExtensionRulesEnabled(Tr,Cr){return Array.isArray(Cr)?Cr.some($r=>(typeof $r=="string"?$r:$r.name)===Tr.name):Cr}const getTextContentFromNodes=(Tr,Cr=500)=>{let $r="";const Ar=Tr.parentOffset;return Tr.parent.nodesBetween(Math.max(0,Ar-Cr),Ar,(Rr,Dr,Mr,Br)=>{var Nr,Lr;const Hr=((Lr=(Nr=Rr.type.spec).toText)===null||Lr===void 0?void 0:Lr.call(Nr,{node:Rr,pos:Dr,parent:Mr,index:Br}))||Rr.textContent||"%leaf%";$r+=Hr.slice(0,Math.max(0,Ar-Dr))}),$r};function isRegExp$2(Tr){return Object.prototype.toString.call(Tr)==="[object RegExp]"}class InputRule{constructor(Cr){this.find=Cr.find,this.handler=Cr.handler}}const inputRuleMatcherHandler=(Tr,Cr)=>{if(isRegExp$2(Cr))return Cr.exec(Tr);const $r=Cr(Tr);if(!$r)return null;const Ar=[$r.text];return Ar.index=$r.index,Ar.input=Tr,Ar.data=$r.data,$r.replaceWith&&($r.text.includes($r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),Ar.push($r.replaceWith)),Ar};function run$1$1(Tr){var Cr;const{editor:$r,from:Ar,to:Rr,text:Dr,rules:Mr,plugin:Br}=Tr,{view:Nr}=$r;if(Nr.composing)return!1;const Lr=Nr.state.doc.resolve(Ar);if(Lr.parent.type.spec.code||!((Cr=Lr.nodeBefore||Lr.nodeAfter)===null||Cr===void 0)&&Cr.marks.find(Ur=>Ur.type.spec.code))return!1;let Hr=!1;const zr=getTextContentFromNodes(Lr)+Dr;return Mr.forEach(Ur=>{if(Hr)return;const Vr=inputRuleMatcherHandler(zr,Ur.find);if(!Vr)return;const jr=Nr.state.tr,Gr=createChainableState({state:Nr.state,transaction:jr}),Xr={from:Ar-(Vr[0].length-Dr.length),to:Rr},{commands:Kr,chain:Zr,can:eo}=new CommandManager({editor:$r,state:Gr});Ur.handler({state:Gr,range:Xr,match:Vr,commands:Kr,chain:Zr,can:eo})===null||!jr.steps.length||(jr.setMeta(Br,{transform:jr,from:Ar,to:Rr,text:Dr}),Nr.dispatch(jr),Hr=!0)}),Hr}function inputRulesPlugin(Tr){const{editor:Cr,rules:$r}=Tr,Ar=new Plugin({state:{init(){return null},apply(Rr,Dr){const Mr=Rr.getMeta(Ar);return Mr||(Rr.selectionSet||Rr.docChanged?null:Dr)}},props:{handleTextInput(Rr,Dr,Mr,Br){return run$1$1({editor:Cr,from:Dr,to:Mr,text:Br,rules:$r,plugin:Ar})},handleDOMEvents:{compositionend:Rr=>(setTimeout(()=>{const{$cursor:Dr}=Rr.state.selection;Dr&&run$1$1({editor:Cr,from:Dr.pos,to:Dr.pos,text:"",rules:$r,plugin:Ar})}),!1)},handleKeyDown(Rr,Dr){if(Dr.key!=="Enter")return!1;const{$cursor:Mr}=Rr.state.selection;return Mr?run$1$1({editor:Cr,from:Mr.pos,to:Mr.pos,text:` `,rules:$r,plugin:Ar}):!1}},isInputRules:!0});return Ar}function isNumber$2(Tr){return typeof Tr=="number"}class PasteRule{constructor(Cr){this.find=Cr.find,this.handler=Cr.handler}}const pasteRuleMatcherHandler=(Tr,Cr)=>{if(isRegExp$2(Cr))return[...Tr.matchAll(Cr)];const $r=Cr(Tr);return $r?$r.map(Ar=>{const Rr=[Ar.text];return Rr.index=Ar.index,Rr.input=Tr,Rr.data=Ar.data,Ar.replaceWith&&(Ar.text.includes(Ar.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),Rr.push(Ar.replaceWith)),Rr}):[]};function run$2(Tr){const{editor:Cr,state:$r,from:Ar,to:Rr,rule:Dr}=Tr,{commands:Mr,chain:Br,can:Nr}=new CommandManager({editor:Cr,state:$r}),Lr=[];return $r.doc.nodesBetween(Ar,Rr,(zr,Ur)=>{if(!zr.isTextblock||zr.type.spec.code)return;const Vr=Math.max(Ar,Ur),jr=Math.min(Rr,Ur+zr.content.size),Gr=zr.textBetween(Vr-Ur,jr-Ur,void 0,"");pasteRuleMatcherHandler(Gr,Dr.find).forEach(Kr=>{if(Kr.index===void 0)return;const Zr=Vr+Kr.index+1,eo=Zr+Kr[0].length,Wr={from:$r.tr.mapping.map(Zr),to:$r.tr.mapping.map(eo)},Yr=Dr.handler({state:$r,range:Wr,match:Kr,commands:Mr,chain:Br,can:Nr});Lr.push(Yr)})}),Lr.every(zr=>zr!==null)}function pasteRulesPlugin(Tr){const{editor:Cr,rules:$r}=Tr;let Ar=null,Rr=!1,Dr=!1;return $r.map(Br=>new Plugin({view(Nr){const Lr=Hr=>{var zr;Ar=!((zr=Nr.dom.parentElement)===null||zr===void 0)&&zr.contains(Hr.target)?Nr.dom.parentElement:null};return window.addEventListener("dragstart",Lr),{destroy(){window.removeEventListener("dragstart",Lr)}}},props:{handleDOMEvents:{drop:Nr=>(Dr=Ar===Nr.dom.parentElement,!1),paste:(Nr,Lr)=>{var Hr;const zr=(Hr=Lr.clipboardData)===null||Hr===void 0?void 0:Hr.getData("text/html");return Rr=!!(zr!=null&&zr.includes("data-pm-slice")),!1}}},appendTransaction:(Nr,Lr,Hr)=>{const zr=Nr[0],Ur=zr.getMeta("uiEvent")==="paste"&&!Rr,Vr=zr.getMeta("uiEvent")==="drop"&&!Dr;if(!Ur&&!Vr)return;const jr=Lr.doc.content.findDiffStart(Hr.doc.content),Gr=Lr.doc.content.findDiffEnd(Hr.doc.content);if(!isNumber$2(jr)||!Gr||jr===Gr.b)return;const Xr=Hr.tr,Kr=createChainableState({state:Hr,transaction:Xr});if(!(!run$2({editor:Cr,state:Kr,from:Math.max(jr-1,0),to:Gr.b-1,rule:Br})||!Xr.steps.length))return Xr}}))}function findDuplicates(Tr){const Cr=Tr.filter(($r,Ar)=>Tr.indexOf($r)!==Ar);return[...new Set(Cr)]}class ExtensionManager{constructor(Cr,$r){this.splittableMarks=[],this.editor=$r,this.extensions=ExtensionManager.resolve(Cr),this.schema=getSchemaByResolvedExtensions(this.extensions,$r),this.extensions.forEach(Ar=>{var Rr;this.editor.extensionStorage[Ar.name]=Ar.storage;const Dr={name:Ar.name,options:Ar.options,storage:Ar.storage,editor:this.editor,type:getSchemaTypeByName(Ar.name,this.schema)};Ar.type==="mark"&&(!((Rr=callOrReturn(getExtensionField(Ar,"keepOnSplit",Dr)))!==null&&Rr!==void 0)||Rr)&&this.splittableMarks.push(Ar.name);const Mr=getExtensionField(Ar,"onBeforeCreate",Dr);Mr&&this.editor.on("beforeCreate",Mr);const Br=getExtensionField(Ar,"onCreate",Dr);Br&&this.editor.on("create",Br);const Nr=getExtensionField(Ar,"onUpdate",Dr);Nr&&this.editor.on("update",Nr);const Lr=getExtensionField(Ar,"onSelectionUpdate",Dr);Lr&&this.editor.on("selectionUpdate",Lr);const Hr=getExtensionField(Ar,"onTransaction",Dr);Hr&&this.editor.on("transaction",Hr);const zr=getExtensionField(Ar,"onFocus",Dr);zr&&this.editor.on("focus",zr);const Ur=getExtensionField(Ar,"onBlur",Dr);Ur&&this.editor.on("blur",Ur);const Vr=getExtensionField(Ar,"onDestroy",Dr);Vr&&this.editor.on("destroy",Vr)})}static resolve(Cr){const $r=ExtensionManager.sort(ExtensionManager.flatten(Cr)),Ar=findDuplicates($r.map(Rr=>Rr.name));return Ar.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${Ar.map(Rr=>`'${Rr}'`).join(", ")}]. This can lead to issues.`),$r}static flatten(Cr){return Cr.map($r=>{const Ar={name:$r.name,options:$r.options,storage:$r.storage},Rr=getExtensionField($r,"addExtensions",Ar);return Rr?[$r,...this.flatten(Rr())]:$r}).flat(10)}static sort(Cr){return Cr.sort((Ar,Rr)=>{const Dr=getExtensionField(Ar,"priority")||100,Mr=getExtensionField(Rr,"priority")||100;return Dr>Mr?-1:Dr{const Ar={name:$r.name,options:$r.options,storage:$r.storage,editor:this.editor,type:getSchemaTypeByName($r.name,this.schema)},Rr=getExtensionField($r,"addCommands",Ar);return Rr?{...Cr,...Rr()}:Cr},{})}get plugins(){const{editor:Cr}=this,$r=ExtensionManager.sort([...this.extensions].reverse()),Ar=[],Rr=[],Dr=$r.map(Mr=>{const Br={name:Mr.name,options:Mr.options,storage:Mr.storage,editor:Cr,type:getSchemaTypeByName(Mr.name,this.schema)},Nr=[],Lr=getExtensionField(Mr,"addKeyboardShortcuts",Br);let Hr={};if(Mr.type==="mark"&&Mr.config.exitable&&(Hr.ArrowRight=()=>Mark.handleExit({editor:Cr,mark:Mr})),Lr){const Gr=Object.fromEntries(Object.entries(Lr()).map(([Xr,Kr])=>[Xr,()=>Kr({editor:Cr})]));Hr={...Hr,...Gr}}const zr=keymap(Hr);Nr.push(zr);const Ur=getExtensionField(Mr,"addInputRules",Br);isExtensionRulesEnabled(Mr,Cr.options.enableInputRules)&&Ur&&Ar.push(...Ur());const Vr=getExtensionField(Mr,"addPasteRules",Br);isExtensionRulesEnabled(Mr,Cr.options.enablePasteRules)&&Vr&&Rr.push(...Vr());const jr=getExtensionField(Mr,"addProseMirrorPlugins",Br);if(jr){const Gr=jr();Nr.push(...Gr)}return Nr}).flat();return[inputRulesPlugin({editor:Cr,rules:Ar}),...pasteRulesPlugin({editor:Cr,rules:Rr}),...Dr]}get attributes(){return getAttributesFromExtensions(this.extensions)}get nodeViews(){const{editor:Cr}=this,{nodeExtensions:$r}=splitExtensions(this.extensions);return Object.fromEntries($r.filter(Ar=>!!getExtensionField(Ar,"addNodeView")).map(Ar=>{const Rr=this.attributes.filter(Nr=>Nr.type===Ar.name),Dr={name:Ar.name,options:Ar.options,storage:Ar.storage,editor:Cr,type:getNodeType(Ar.name,this.schema)},Mr=getExtensionField(Ar,"addNodeView",Dr);if(!Mr)return[];const Br=(Nr,Lr,Hr,zr)=>{const Ur=getRenderedAttributes(Nr,Rr);return Mr()({editor:Cr,node:Nr,getPos:Hr,decorations:zr,HTMLAttributes:Ur,extension:Ar})};return[Ar.name,Br]}))}}function getType(Tr){return Object.prototype.toString.call(Tr).slice(8,-1)}function isPlainObject(Tr){return getType(Tr)!=="Object"?!1:Tr.constructor===Object&&Object.getPrototypeOf(Tr)===Object.prototype}function mergeDeep(Tr,Cr){const $r={...Tr};return isPlainObject(Tr)&&isPlainObject(Cr)&&Object.keys(Cr).forEach(Ar=>{isPlainObject(Cr[Ar])?Ar in Tr?$r[Ar]=mergeDeep(Tr[Ar],Cr[Ar]):Object.assign($r,{[Ar]:Cr[Ar]}):Object.assign($r,{[Ar]:Cr[Ar]})}),$r}class Extension{constructor(Cr={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...Cr},this.name=this.config.name,Cr.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=callOrReturn(getExtensionField(this,"addOptions",{name:this.name}))),this.storage=callOrReturn(getExtensionField(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(Cr={}){return new Extension(Cr)}configure(Cr={}){const $r=this.extend();return $r.options=mergeDeep(this.options,Cr),$r.storage=callOrReturn(getExtensionField($r,"addStorage",{name:$r.name,options:$r.options})),$r}extend(Cr={}){const $r=new Extension(Cr);return $r.parent=this,this.child=$r,$r.name=Cr.name?Cr.name:$r.parent.name,Cr.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${$r.name}".`),$r.options=callOrReturn(getExtensionField($r,"addOptions",{name:$r.name})),$r.storage=callOrReturn(getExtensionField($r,"addStorage",{name:$r.name,options:$r.options})),$r}}function getTextBetween(Tr,Cr,$r){const{from:Ar,to:Rr}=Cr,{blockSeparator:Dr=` `,textSerializers:Mr={}}=$r||{};let Br="",Nr=!0;return Tr.nodesBetween(Ar,Rr,(Lr,Hr,zr,Ur)=>{var Vr;const jr=Mr==null?void 0:Mr[Lr.type.name];jr?(Lr.isBlock&&!Nr&&(Br+=Dr,Nr=!0),zr&&(Br+=jr({node:Lr,pos:Hr,parent:zr,index:Ur,range:Cr}))):Lr.isText?(Br+=(Vr=Lr==null?void 0:Lr.text)===null||Vr===void 0?void 0:Vr.slice(Math.max(Ar,Hr)-Hr,Rr-Hr),Nr=!1):Lr.isBlock&&!Nr&&(Br+=Dr,Nr=!0)}),Br}function getTextSerializersFromSchema(Tr){return Object.fromEntries(Object.entries(Tr.nodes).filter(([,Cr])=>Cr.spec.toText).map(([Cr,$r])=>[Cr,$r.spec.toText]))}const ClipboardTextSerializer=Extension.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:Tr}=this,{state:Cr,schema:$r}=Tr,{doc:Ar,selection:Rr}=Cr,{ranges:Dr}=Rr,Mr=Math.min(...Dr.map(Hr=>Hr.$from.pos)),Br=Math.max(...Dr.map(Hr=>Hr.$to.pos)),Nr=getTextSerializersFromSchema($r);return getTextBetween(Ar,{from:Mr,to:Br},{textSerializers:Nr})}}})]}}),blur=()=>({editor:Tr,view:Cr})=>(requestAnimationFrame(()=>{var $r;Tr.isDestroyed||(Cr.dom.blur(),($r=window==null?void 0:window.getSelection())===null||$r===void 0||$r.removeAllRanges())}),!0),clearContent=(Tr=!1)=>({commands:Cr})=>Cr.setContent("",Tr),clearNodes=()=>({state:Tr,tr:Cr,dispatch:$r})=>{const{selection:Ar}=Cr,{ranges:Rr}=Ar;return $r&&Rr.forEach(({$from:Dr,$to:Mr})=>{Tr.doc.nodesBetween(Dr.pos,Mr.pos,(Br,Nr)=>{if(Br.type.isText)return;const{doc:Lr,mapping:Hr}=Cr,zr=Lr.resolve(Hr.map(Nr)),Ur=Lr.resolve(Hr.map(Nr+Br.nodeSize)),Vr=zr.blockRange(Ur);if(!Vr)return;const jr=liftTarget(Vr);if(Br.type.isTextblock){const{defaultType:Gr}=zr.parent.contentMatchAt(zr.index());Cr.setNodeMarkup(Vr.start,Gr)}(jr||jr===0)&&Cr.lift(Vr,jr)})}),!0},command=Tr=>Cr=>Tr(Cr),createParagraphNear=()=>({state:Tr,dispatch:Cr})=>createParagraphNear$1(Tr,Cr),cut=(Tr,Cr)=>({editor:$r,tr:Ar})=>{const{state:Rr}=$r,Dr=Rr.doc.slice(Tr.from,Tr.to);Ar.deleteRange(Tr.from,Tr.to);const Mr=Ar.mapping.map(Cr);return Ar.insert(Mr,Dr.content),Ar.setSelection(new TextSelection(Ar.doc.resolve(Mr-1))),!0},deleteCurrentNode=()=>({tr:Tr,dispatch:Cr})=>{const{selection:$r}=Tr,Ar=$r.$anchor.node();if(Ar.content.size>0)return!1;const Rr=Tr.selection.$anchor;for(let Dr=Rr.depth;Dr>0;Dr-=1)if(Rr.node(Dr).type===Ar.type){if(Cr){const Br=Rr.before(Dr),Nr=Rr.after(Dr);Tr.delete(Br,Nr).scrollIntoView()}return!0}return!1},deleteNode=Tr=>({tr:Cr,state:$r,dispatch:Ar})=>{const Rr=getNodeType(Tr,$r.schema),Dr=Cr.selection.$anchor;for(let Mr=Dr.depth;Mr>0;Mr-=1)if(Dr.node(Mr).type===Rr){if(Ar){const Nr=Dr.before(Mr),Lr=Dr.after(Mr);Cr.delete(Nr,Lr).scrollIntoView()}return!0}return!1},deleteRange=Tr=>({tr:Cr,dispatch:$r})=>{const{from:Ar,to:Rr}=Tr;return $r&&Cr.delete(Ar,Rr),!0},deleteSelection=()=>({state:Tr,dispatch:Cr})=>deleteSelection$1(Tr,Cr),enter=()=>({commands:Tr})=>Tr.keyboardShortcut("Enter"),exitCode=()=>({state:Tr,dispatch:Cr})=>exitCode$1(Tr,Cr);function objectIncludes(Tr,Cr,$r={strict:!0}){const Ar=Object.keys(Cr);return Ar.length?Ar.every(Rr=>$r.strict?Cr[Rr]===Tr[Rr]:isRegExp$2(Cr[Rr])?Cr[Rr].test(Tr[Rr]):Cr[Rr]===Tr[Rr]):!0}function findMarkInSet(Tr,Cr,$r={}){return Tr.find(Ar=>Ar.type===Cr&&objectIncludes(Ar.attrs,$r))}function isMarkInSet(Tr,Cr,$r={}){return!!findMarkInSet(Tr,Cr,$r)}function getMarkRange(Tr,Cr,$r={}){if(!Tr||!Cr)return;let Ar=Tr.parent.childAfter(Tr.parentOffset);if(Tr.parentOffset===Ar.offset&&Ar.offset!==0&&(Ar=Tr.parent.childBefore(Tr.parentOffset)),!Ar.node)return;const Rr=findMarkInSet([...Ar.node.marks],Cr,$r);if(!Rr)return;let Dr=Ar.index,Mr=Tr.start()+Ar.offset,Br=Dr+1,Nr=Mr+Ar.node.nodeSize;for(findMarkInSet([...Ar.node.marks],Cr,$r);Dr>0&&Rr.isInSet(Tr.parent.child(Dr-1).marks);)Dr-=1,Mr-=Tr.parent.child(Dr).nodeSize;for(;Br({tr:$r,state:Ar,dispatch:Rr})=>{const Dr=getMarkType(Tr,Ar.schema),{doc:Mr,selection:Br}=$r,{$from:Nr,from:Lr,to:Hr}=Br;if(Rr){const zr=getMarkRange(Nr,Dr,Cr);if(zr&&zr.from<=Lr&&zr.to>=Hr){const Ur=TextSelection.create(Mr,zr.from,zr.to);$r.setSelection(Ur)}}return!0},first=Tr=>Cr=>{const $r=typeof Tr=="function"?Tr(Cr):Tr;for(let Ar=0;Ar<$r.length;Ar+=1)if($r[Ar](Cr))return!0;return!1};function isTextSelection(Tr){return Tr instanceof TextSelection}function minMax(Tr=0,Cr=0,$r=0){return Math.min(Math.max(Tr,Cr),$r)}function resolveFocusPosition(Tr,Cr=null){if(!Cr)return null;const $r=Selection.atStart(Tr),Ar=Selection.atEnd(Tr);if(Cr==="start"||Cr===!0)return $r;if(Cr==="end")return Ar;const Rr=$r.from,Dr=Ar.to;return Cr==="all"?TextSelection.create(Tr,minMax(0,Rr,Dr),minMax(Tr.content.size,Rr,Dr)):TextSelection.create(Tr,minMax(Cr,Rr,Dr),minMax(Cr,Rr,Dr))}function isiOS(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const focus=(Tr=null,Cr={})=>({editor:$r,view:Ar,tr:Rr,dispatch:Dr})=>{Cr={scrollIntoView:!0,...Cr};const Mr=()=>{isiOS()&&Ar.dom.focus(),requestAnimationFrame(()=>{$r.isDestroyed||(Ar.focus(),Cr!=null&&Cr.scrollIntoView&&$r.commands.scrollIntoView())})};if(Ar.hasFocus()&&Tr===null||Tr===!1)return!0;if(Dr&&Tr===null&&!isTextSelection($r.state.selection))return Mr(),!0;const Br=resolveFocusPosition(Rr.doc,Tr)||$r.state.selection,Nr=$r.state.selection.eq(Br);return Dr&&(Nr||Rr.setSelection(Br),Nr&&Rr.storedMarks&&Rr.setStoredMarks(Rr.storedMarks),Mr()),!0},forEach=(Tr,Cr)=>$r=>Tr.every((Ar,Rr)=>Cr(Ar,{...$r,index:Rr})),insertContent=(Tr,Cr)=>({tr:$r,commands:Ar})=>Ar.insertContentAt({from:$r.selection.from,to:$r.selection.to},Tr,Cr);function elementFromString$1(Tr){const Cr=`${Tr}`;return new window.DOMParser().parseFromString(Cr,"text/html").body}function createNodeFromContent(Tr,Cr,$r){if($r={slice:!0,parseOptions:{},...$r},typeof Tr=="object"&&Tr!==null)try{return Array.isArray(Tr)&&Tr.length>0?Fragment.fromArray(Tr.map(Ar=>Cr.nodeFromJSON(Ar))):Cr.nodeFromJSON(Tr)}catch(Ar){return console.warn("[tiptap warn]: Invalid content.","Passed value:",Tr,"Error:",Ar),createNodeFromContent("",Cr,$r)}if(typeof Tr=="string"){const Ar=DOMParser$1.fromSchema(Cr);return $r.slice?Ar.parseSlice(elementFromString$1(Tr),$r.parseOptions).content:Ar.parse(elementFromString$1(Tr),$r.parseOptions)}return createNodeFromContent("",Cr,$r)}function selectionToInsertionEnd(Tr,Cr,$r){const Ar=Tr.steps.length-1;if(Ar{Mr===0&&(Mr=Hr)}),Tr.setSelection(Selection.near(Tr.doc.resolve(Mr),$r))}const isFragment=Tr=>Tr.toString().startsWith("<"),insertContentAt=(Tr,Cr,$r)=>({tr:Ar,dispatch:Rr,editor:Dr})=>{if(Rr){$r={parseOptions:{},updateSelection:!0,...$r};const Mr=createNodeFromContent(Cr,Dr.schema,{parseOptions:{preserveWhitespace:"full",...$r.parseOptions}});if(Mr.toString()==="<>")return!0;let{from:Br,to:Nr}=typeof Tr=="number"?{from:Tr,to:Tr}:{from:Tr.from,to:Tr.to},Lr=!0,Hr=!0;if((isFragment(Mr)?Mr:[Mr]).forEach(Ur=>{Ur.check(),Lr=Lr?Ur.isText&&Ur.marks.length===0:!1,Hr=Hr?Ur.isBlock:!1}),Br===Nr&&Hr){const{parent:Ur}=Ar.doc.resolve(Br);Ur.isTextblock&&!Ur.type.spec.code&&!Ur.childCount&&(Br-=1,Nr+=1)}Lr?Array.isArray(Cr)?Ar.insertText(Cr.map(Ur=>Ur.text||"").join(""),Br,Nr):typeof Cr=="object"&&Cr&&Cr.text?Ar.insertText(Cr.text,Br,Nr):Ar.insertText(Cr,Br,Nr):Ar.replaceWith(Br,Nr,Mr),$r.updateSelection&&selectionToInsertionEnd(Ar,Ar.steps.length-1,-1)}return!0},joinUp=()=>({state:Tr,dispatch:Cr})=>joinUp$1(Tr,Cr),joinDown=()=>({state:Tr,dispatch:Cr})=>joinDown$1(Tr,Cr),joinBackward=()=>({state:Tr,dispatch:Cr})=>joinBackward$1(Tr,Cr),joinForward=()=>({state:Tr,dispatch:Cr})=>joinForward$1(Tr,Cr),joinItemBackward=()=>({tr:Tr,state:Cr,dispatch:$r})=>{try{const Ar=joinPoint(Cr.doc,Cr.selection.$from.pos,-1);return Ar==null?!1:(Tr.join(Ar,2),$r&&$r(Tr),!0)}catch{return!1}},joinItemForward=()=>({state:Tr,dispatch:Cr,tr:$r})=>{try{const Ar=joinPoint(Tr.doc,Tr.selection.$from.pos,1);return Ar==null?!1:($r.join(Ar,2),Cr&&Cr($r),!0)}catch{return!1}};function isMacOS(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function normalizeKeyName(Tr){const Cr=Tr.split(/-(?!$)/);let $r=Cr[Cr.length-1];$r==="Space"&&($r=" ");let Ar,Rr,Dr,Mr;for(let Br=0;Br({editor:Cr,view:$r,tr:Ar,dispatch:Rr})=>{const Dr=normalizeKeyName(Tr).split(/-(?!$)/),Mr=Dr.find(Lr=>!["Alt","Ctrl","Meta","Shift"].includes(Lr)),Br=new KeyboardEvent("keydown",{key:Mr==="Space"?" ":Mr,altKey:Dr.includes("Alt"),ctrlKey:Dr.includes("Ctrl"),metaKey:Dr.includes("Meta"),shiftKey:Dr.includes("Shift"),bubbles:!0,cancelable:!0}),Nr=Cr.captureTransaction(()=>{$r.someProp("handleKeyDown",Lr=>Lr($r,Br))});return Nr==null||Nr.steps.forEach(Lr=>{const Hr=Lr.map(Ar.mapping);Hr&&Rr&&Ar.maybeStep(Hr)}),!0};function isNodeActive(Tr,Cr,$r={}){const{from:Ar,to:Rr,empty:Dr}=Tr.selection,Mr=Cr?getNodeType(Cr,Tr.schema):null,Br=[];Tr.doc.nodesBetween(Ar,Rr,(zr,Ur)=>{if(zr.isText)return;const Vr=Math.max(Ar,Ur),jr=Math.min(Rr,Ur+zr.nodeSize);Br.push({node:zr,from:Vr,to:jr})});const Nr=Rr-Ar,Lr=Br.filter(zr=>Mr?Mr.name===zr.node.type.name:!0).filter(zr=>objectIncludes(zr.node.attrs,$r,{strict:!1}));return Dr?!!Lr.length:Lr.reduce((zr,Ur)=>zr+Ur.to-Ur.from,0)>=Nr}const lift=(Tr,Cr={})=>({state:$r,dispatch:Ar})=>{const Rr=getNodeType(Tr,$r.schema);return isNodeActive($r,Rr,Cr)?lift$1($r,Ar):!1},liftEmptyBlock=()=>({state:Tr,dispatch:Cr})=>liftEmptyBlock$1(Tr,Cr),liftListItem=Tr=>({state:Cr,dispatch:$r})=>{const Ar=getNodeType(Tr,Cr.schema);return liftListItem$1(Ar)(Cr,$r)},newlineInCode=()=>({state:Tr,dispatch:Cr})=>newlineInCode$1(Tr,Cr);function getSchemaTypeNameByName(Tr,Cr){return Cr.nodes[Tr]?"node":Cr.marks[Tr]?"mark":null}function deleteProps(Tr,Cr){const $r=typeof Cr=="string"?[Cr]:Cr;return Object.keys(Tr).reduce((Ar,Rr)=>($r.includes(Rr)||(Ar[Rr]=Tr[Rr]),Ar),{})}const resetAttributes=(Tr,Cr)=>({tr:$r,state:Ar,dispatch:Rr})=>{let Dr=null,Mr=null;const Br=getSchemaTypeNameByName(typeof Tr=="string"?Tr:Tr.name,Ar.schema);return Br?(Br==="node"&&(Dr=getNodeType(Tr,Ar.schema)),Br==="mark"&&(Mr=getMarkType(Tr,Ar.schema)),Rr&&$r.selection.ranges.forEach(Nr=>{Ar.doc.nodesBetween(Nr.$from.pos,Nr.$to.pos,(Lr,Hr)=>{Dr&&Dr===Lr.type&&$r.setNodeMarkup(Hr,void 0,deleteProps(Lr.attrs,Cr)),Mr&&Lr.marks.length&&Lr.marks.forEach(zr=>{Mr===zr.type&&$r.addMark(Hr,Hr+Lr.nodeSize,Mr.create(deleteProps(zr.attrs,Cr)))})})}),!0):!1},scrollIntoView=()=>({tr:Tr,dispatch:Cr})=>(Cr&&Tr.scrollIntoView(),!0),selectAll=()=>({tr:Tr,commands:Cr})=>Cr.setTextSelection({from:0,to:Tr.doc.content.size}),selectNodeBackward=()=>({state:Tr,dispatch:Cr})=>selectNodeBackward$1(Tr,Cr),selectNodeForward=()=>({state:Tr,dispatch:Cr})=>selectNodeForward$1(Tr,Cr),selectParentNode=()=>({state:Tr,dispatch:Cr})=>selectParentNode$1(Tr,Cr),selectTextblockEnd=()=>({state:Tr,dispatch:Cr})=>selectTextblockEnd$1(Tr,Cr),selectTextblockStart=()=>({state:Tr,dispatch:Cr})=>selectTextblockStart$1(Tr,Cr);function createDocument(Tr,Cr,$r={}){return createNodeFromContent(Tr,Cr,{slice:!1,parseOptions:$r})}const setContent=(Tr,Cr=!1,$r={})=>({tr:Ar,editor:Rr,dispatch:Dr})=>{const{doc:Mr}=Ar,Br=createDocument(Tr,Rr.schema,$r);return Dr&&Ar.replaceWith(0,Mr.content.size,Br).setMeta("preventUpdate",!Cr),!0};function getMarkAttributes(Tr,Cr){const $r=getMarkType(Cr,Tr.schema),{from:Ar,to:Rr,empty:Dr}=Tr.selection,Mr=[];Dr?(Tr.storedMarks&&Mr.push(...Tr.storedMarks),Mr.push(...Tr.selection.$head.marks())):Tr.doc.nodesBetween(Ar,Rr,Nr=>{Mr.push(...Nr.marks)});const Br=Mr.find(Nr=>Nr.type.name===$r.name);return Br?{...Br.attrs}:{}}function combineTransactionSteps(Tr,Cr){const $r=new Transform(Tr);return Cr.forEach(Ar=>{Ar.steps.forEach(Rr=>{$r.step(Rr)})}),$r}function defaultBlockAt(Tr){for(let Cr=0;Cr{$r(Rr)&&Ar.push({node:Rr,pos:Dr})}),Ar}function findParentNodeClosestToPos(Tr,Cr){for(let $r=Tr.depth;$r>0;$r-=1){const Ar=Tr.node($r);if(Cr(Ar))return{pos:$r>0?Tr.before($r):0,start:Tr.start($r),depth:$r,node:Ar}}}function findParentNode(Tr){return Cr=>findParentNodeClosestToPos(Cr.$from,Tr)}function getHTMLFromFragment(Tr,Cr){const $r=DOMSerializer.fromSchema(Cr).serializeFragment(Tr),Rr=document.implementation.createHTMLDocument().createElement("div");return Rr.appendChild($r),Rr.innerHTML}function getSchema(Tr,Cr){const $r=ExtensionManager.resolve(Tr);return getSchemaByResolvedExtensions($r,Cr)}function generateJSON(Tr,Cr){const $r=getSchema(Cr),Ar=elementFromString$1(Tr);return DOMParser$1.fromSchema($r).parse(Ar).toJSON()}function getText(Tr,Cr){const $r={from:0,to:Tr.content.size};return getTextBetween(Tr,$r,Cr)}function generateText(Tr,Cr,$r){const{blockSeparator:Ar=` `,textSerializers:Rr={}}=$r||{},Dr=getSchema(Cr),Mr=Node$2.fromJSON(Dr,Tr);return getText(Mr,{blockSeparator:Ar,textSerializers:{...getTextSerializersFromSchema(Dr),...Rr}})}function getNodeAttributes(Tr,Cr){const $r=getNodeType(Cr,Tr.schema),{from:Ar,to:Rr}=Tr.selection,Dr=[];Tr.doc.nodesBetween(Ar,Rr,Br=>{Dr.push(Br)});const Mr=Dr.reverse().find(Br=>Br.type.name===$r.name);return Mr?{...Mr.attrs}:{}}function getAttributes(Tr,Cr){const $r=getSchemaTypeNameByName(typeof Cr=="string"?Cr:Cr.name,Tr.schema);return $r==="node"?getNodeAttributes(Tr,Cr):$r==="mark"?getMarkAttributes(Tr,Cr):{}}function removeDuplicates(Tr,Cr=JSON.stringify){const $r={};return Tr.filter(Ar=>{const Rr=Cr(Ar);return Object.prototype.hasOwnProperty.call($r,Rr)?!1:$r[Rr]=!0})}function simplifyChangedRanges(Tr){const Cr=removeDuplicates(Tr);return Cr.length===1?Cr:Cr.filter(($r,Ar)=>!Cr.filter((Dr,Mr)=>Mr!==Ar).some(Dr=>$r.oldRange.from>=Dr.oldRange.from&&$r.oldRange.to<=Dr.oldRange.to&&$r.newRange.from>=Dr.newRange.from&&$r.newRange.to<=Dr.newRange.to))}function getChangedRanges(Tr){const{mapping:Cr,steps:$r}=Tr,Ar=[];return Cr.maps.forEach((Rr,Dr)=>{const Mr=[];if(Rr.ranges.length)Rr.forEach((Br,Nr)=>{Mr.push({from:Br,to:Nr})});else{const{from:Br,to:Nr}=$r[Dr];if(Br===void 0||Nr===void 0)return;Mr.push({from:Br,to:Nr})}Mr.forEach(({from:Br,to:Nr})=>{const Lr=Cr.slice(Dr).map(Br,-1),Hr=Cr.slice(Dr).map(Nr),zr=Cr.invert().map(Lr,-1),Ur=Cr.invert().map(Hr);Ar.push({oldRange:{from:zr,to:Ur},newRange:{from:Lr,to:Hr}})})}),simplifyChangedRanges(Ar)}function getMarksBetween(Tr,Cr,$r){const Ar=[];return Tr===Cr?$r.resolve(Tr).marks().forEach(Rr=>{const Dr=$r.resolve(Tr-1),Mr=getMarkRange(Dr,Rr.type);Mr&&Ar.push({mark:Rr,...Mr})}):$r.nodesBetween(Tr,Cr,(Rr,Dr)=>{Ar.push(...Rr.marks.map(Mr=>({from:Dr,to:Dr+Rr.nodeSize,mark:Mr})))}),Ar}function getSplittedAttributes(Tr,Cr,$r){return Object.fromEntries(Object.entries($r).filter(([Ar])=>{const Rr=Tr.find(Dr=>Dr.type===Cr&&Dr.name===Ar);return Rr?Rr.attribute.keepOnSplit:!1}))}function isMarkActive(Tr,Cr,$r={}){const{empty:Ar,ranges:Rr}=Tr.selection,Dr=Cr?getMarkType(Cr,Tr.schema):null;if(Ar)return!!(Tr.storedMarks||Tr.selection.$from.marks()).filter(zr=>Dr?Dr.name===zr.type.name:!0).find(zr=>objectIncludes(zr.attrs,$r,{strict:!1}));let Mr=0;const Br=[];if(Rr.forEach(({$from:zr,$to:Ur})=>{const Vr=zr.pos,jr=Ur.pos;Tr.doc.nodesBetween(Vr,jr,(Gr,Xr)=>{if(!Gr.isText&&!Gr.marks.length)return;const Kr=Math.max(Vr,Xr),Zr=Math.min(jr,Xr+Gr.nodeSize),eo=Zr-Kr;Mr+=eo,Br.push(...Gr.marks.map(Wr=>({mark:Wr,from:Kr,to:Zr})))})}),Mr===0)return!1;const Nr=Br.filter(zr=>Dr?Dr.name===zr.mark.type.name:!0).filter(zr=>objectIncludes(zr.mark.attrs,$r,{strict:!1})).reduce((zr,Ur)=>zr+Ur.to-Ur.from,0),Lr=Br.filter(zr=>Dr?zr.mark.type!==Dr&&zr.mark.type.excludes(Dr):!0).reduce((zr,Ur)=>zr+Ur.to-Ur.from,0);return(Nr>0?Nr+Lr:Nr)>=Mr}function isActive(Tr,Cr,$r={}){if(!Cr)return isNodeActive(Tr,null,$r)||isMarkActive(Tr,null,$r);const Ar=getSchemaTypeNameByName(Cr,Tr.schema);return Ar==="node"?isNodeActive(Tr,Cr,$r):Ar==="mark"?isMarkActive(Tr,Cr,$r):!1}function isList(Tr,Cr){const{nodeExtensions:$r}=splitExtensions(Cr),Ar=$r.find(Mr=>Mr.name===Tr);if(!Ar)return!1;const Rr={name:Ar.name,options:Ar.options,storage:Ar.storage},Dr=callOrReturn(getExtensionField(Ar,"group",Rr));return typeof Dr!="string"?!1:Dr.split(" ").includes("list")}function isNodeEmpty(Tr){var Cr;const $r=(Cr=Tr.type.createAndFill())===null||Cr===void 0?void 0:Cr.toJSON(),Ar=Tr.toJSON();return JSON.stringify($r)===JSON.stringify(Ar)}function canSetMark(Tr,Cr,$r){var Ar;const{selection:Rr}=Cr;let Dr=null;if(isTextSelection(Rr)&&(Dr=Rr.$cursor),Dr){const Br=(Ar=Tr.storedMarks)!==null&&Ar!==void 0?Ar:Dr.marks();return!!$r.isInSet(Br)||!Br.some(Nr=>Nr.type.excludes($r))}const{ranges:Mr}=Rr;return Mr.some(({$from:Br,$to:Nr})=>{let Lr=Br.depth===0?Tr.doc.inlineContent&&Tr.doc.type.allowsMarkType($r):!1;return Tr.doc.nodesBetween(Br.pos,Nr.pos,(Hr,zr,Ur)=>{if(Lr)return!1;if(Hr.isInline){const Vr=!Ur||Ur.type.allowsMarkType($r),jr=!!$r.isInSet(Hr.marks)||!Hr.marks.some(Gr=>Gr.type.excludes($r));Lr=Vr&&jr}return!Lr}),Lr})}const setMark=(Tr,Cr={})=>({tr:$r,state:Ar,dispatch:Rr})=>{const{selection:Dr}=$r,{empty:Mr,ranges:Br}=Dr,Nr=getMarkType(Tr,Ar.schema);if(Rr)if(Mr){const Lr=getMarkAttributes(Ar,Nr);$r.addStoredMark(Nr.create({...Lr,...Cr}))}else Br.forEach(Lr=>{const Hr=Lr.$from.pos,zr=Lr.$to.pos;Ar.doc.nodesBetween(Hr,zr,(Ur,Vr)=>{const jr=Math.max(Vr,Hr),Gr=Math.min(Vr+Ur.nodeSize,zr);Ur.marks.find(Kr=>Kr.type===Nr)?Ur.marks.forEach(Kr=>{Nr===Kr.type&&$r.addMark(jr,Gr,Nr.create({...Kr.attrs,...Cr}))}):$r.addMark(jr,Gr,Nr.create(Cr))})});return canSetMark(Ar,$r,Nr)},setMeta=(Tr,Cr)=>({tr:$r})=>($r.setMeta(Tr,Cr),!0),setNode=(Tr,Cr={})=>({state:$r,dispatch:Ar,chain:Rr})=>{const Dr=getNodeType(Tr,$r.schema);return Dr.isTextblock?Rr().command(({commands:Mr})=>setBlockType(Dr,Cr)($r)?!0:Mr.clearNodes()).command(({state:Mr})=>setBlockType(Dr,Cr)(Mr,Ar)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection=Tr=>({tr:Cr,dispatch:$r})=>{if($r){const{doc:Ar}=Cr,Rr=minMax(Tr,0,Ar.content.size),Dr=NodeSelection.create(Ar,Rr);Cr.setSelection(Dr)}return!0},setTextSelection=Tr=>({tr:Cr,dispatch:$r})=>{if($r){const{doc:Ar}=Cr,{from:Rr,to:Dr}=typeof Tr=="number"?{from:Tr,to:Tr}:Tr,Mr=TextSelection.atStart(Ar).from,Br=TextSelection.atEnd(Ar).to,Nr=minMax(Rr,Mr,Br),Lr=minMax(Dr,Mr,Br),Hr=TextSelection.create(Ar,Nr,Lr);Cr.setSelection(Hr)}return!0},sinkListItem=Tr=>({state:Cr,dispatch:$r})=>{const Ar=getNodeType(Tr,Cr.schema);return sinkListItem$1(Ar)(Cr,$r)};function ensureMarks(Tr,Cr){const $r=Tr.storedMarks||Tr.selection.$to.parentOffset&&Tr.selection.$from.marks();if($r){const Ar=$r.filter(Rr=>Cr==null?void 0:Cr.includes(Rr.type.name));Tr.tr.ensureMarks(Ar)}}const splitBlock=({keepMarks:Tr=!0}={})=>({tr:Cr,state:$r,dispatch:Ar,editor:Rr})=>{const{selection:Dr,doc:Mr}=Cr,{$from:Br,$to:Nr}=Dr,Lr=Rr.extensionManager.attributes,Hr=getSplittedAttributes(Lr,Br.node().type.name,Br.node().attrs);if(Dr instanceof NodeSelection&&Dr.node.isBlock)return!Br.parentOffset||!canSplit(Mr,Br.pos)?!1:(Ar&&(Tr&&ensureMarks($r,Rr.extensionManager.splittableMarks),Cr.split(Br.pos).scrollIntoView()),!0);if(!Br.parent.isBlock)return!1;if(Ar){const zr=Nr.parentOffset===Nr.parent.content.size;Dr instanceof TextSelection&&Cr.deleteSelection();const Ur=Br.depth===0?void 0:defaultBlockAt(Br.node(-1).contentMatchAt(Br.indexAfter(-1)));let Vr=zr&&Ur?[{type:Ur,attrs:Hr}]:void 0,jr=canSplit(Cr.doc,Cr.mapping.map(Br.pos),1,Vr);if(!Vr&&!jr&&canSplit(Cr.doc,Cr.mapping.map(Br.pos),1,Ur?[{type:Ur}]:void 0)&&(jr=!0,Vr=Ur?[{type:Ur,attrs:Hr}]:void 0),jr&&(Cr.split(Cr.mapping.map(Br.pos),1,Vr),Ur&&!zr&&!Br.parentOffset&&Br.parent.type!==Ur)){const Gr=Cr.mapping.map(Br.before()),Xr=Cr.doc.resolve(Gr);Br.node(-1).canReplaceWith(Xr.index(),Xr.index()+1,Ur)&&Cr.setNodeMarkup(Cr.mapping.map(Br.before()),Ur)}Tr&&ensureMarks($r,Rr.extensionManager.splittableMarks),Cr.scrollIntoView()}return!0},splitListItem=Tr=>({tr:Cr,state:$r,dispatch:Ar,editor:Rr})=>{var Dr;const Mr=getNodeType(Tr,$r.schema),{$from:Br,$to:Nr}=$r.selection,Lr=$r.selection.node;if(Lr&&Lr.isBlock||Br.depth<2||!Br.sameParent(Nr))return!1;const Hr=Br.node(-1);if(Hr.type!==Mr)return!1;const zr=Rr.extensionManager.attributes;if(Br.parent.content.size===0&&Br.node(-1).childCount===Br.indexAfter(-1)){if(Br.depth===2||Br.node(-3).type!==Mr||Br.index(-2)!==Br.node(-2).childCount-1)return!1;if(Ar){let Xr=Fragment.empty;const Kr=Br.index(-1)?1:Br.index(-2)?2:3;for(let no=Br.depth-Kr;no>=Br.depth-3;no-=1)Xr=Fragment.from(Br.node(no).copy(Xr));const Zr=Br.indexAfter(-1){if(Jr>-1)return!1;no.isTextblock&&no.content.size===0&&(Jr=ro+1)}),Jr>-1&&Cr.setSelection(TextSelection.near(Cr.doc.resolve(Jr))),Cr.scrollIntoView()}return!0}const Ur=Nr.pos===Br.end()?Hr.contentMatchAt(0).defaultType:null,Vr=getSplittedAttributes(zr,Hr.type.name,Hr.attrs),jr=getSplittedAttributes(zr,Br.node().type.name,Br.node().attrs);Cr.delete(Br.pos,Nr.pos);const Gr=Ur?[{type:Mr,attrs:Vr},{type:Ur,attrs:jr}]:[{type:Mr,attrs:Vr}];if(!canSplit(Cr.doc,Br.pos,2))return!1;if(Ar){const{selection:Xr,storedMarks:Kr}=$r,{splittableMarks:Zr}=Rr.extensionManager,eo=Kr||Xr.$to.parentOffset&&Xr.$from.marks();if(Cr.split(Br.pos,2,Gr).scrollIntoView(),!eo||!Ar)return!0;const Wr=eo.filter(Yr=>Zr.includes(Yr.type.name));Cr.ensureMarks(Wr)}return!0},joinListBackwards=(Tr,Cr)=>{const $r=findParentNode(Mr=>Mr.type===Cr)(Tr.selection);if(!$r)return!0;const Ar=Tr.doc.resolve(Math.max(0,$r.pos-1)).before($r.depth);if(Ar===void 0)return!0;const Rr=Tr.doc.nodeAt(Ar);return $r.node.type===(Rr==null?void 0:Rr.type)&&canJoin(Tr.doc,$r.pos)&&Tr.join($r.pos),!0},joinListForwards=(Tr,Cr)=>{const $r=findParentNode(Mr=>Mr.type===Cr)(Tr.selection);if(!$r)return!0;const Ar=Tr.doc.resolve($r.start).after($r.depth);if(Ar===void 0)return!0;const Rr=Tr.doc.nodeAt(Ar);return $r.node.type===(Rr==null?void 0:Rr.type)&&canJoin(Tr.doc,Ar)&&Tr.join(Ar),!0},toggleList=(Tr,Cr,$r,Ar={})=>({editor:Rr,tr:Dr,state:Mr,dispatch:Br,chain:Nr,commands:Lr,can:Hr})=>{const{extensions:zr,splittableMarks:Ur}=Rr.extensionManager,Vr=getNodeType(Tr,Mr.schema),jr=getNodeType(Cr,Mr.schema),{selection:Gr,storedMarks:Xr}=Mr,{$from:Kr,$to:Zr}=Gr,eo=Kr.blockRange(Zr),Wr=Xr||Gr.$to.parentOffset&&Gr.$from.marks();if(!eo)return!1;const Yr=findParentNode(Jr=>isList(Jr.type.name,zr))(Gr);if(eo.depth>=1&&Yr&&eo.depth-Yr.depth<=1){if(Yr.node.type===Vr)return Lr.liftListItem(jr);if(isList(Yr.node.type.name,zr)&&Vr.validContent(Yr.node.content)&&Br)return Nr().command(()=>(Dr.setNodeMarkup(Yr.pos,Vr),!0)).command(()=>joinListBackwards(Dr,Vr)).command(()=>joinListForwards(Dr,Vr)).run()}return!$r||!Wr||!Br?Nr().command(()=>Hr().wrapInList(Vr,Ar)?!0:Lr.clearNodes()).wrapInList(Vr,Ar).command(()=>joinListBackwards(Dr,Vr)).command(()=>joinListForwards(Dr,Vr)).run():Nr().command(()=>{const Jr=Hr().wrapInList(Vr,Ar),no=Wr.filter(ro=>Ur.includes(ro.type.name));return Dr.ensureMarks(no),Jr?!0:Lr.clearNodes()}).wrapInList(Vr,Ar).command(()=>joinListBackwards(Dr,Vr)).command(()=>joinListForwards(Dr,Vr)).run()},toggleMark=(Tr,Cr={},$r={})=>({state:Ar,commands:Rr})=>{const{extendEmptyMarkRange:Dr=!1}=$r,Mr=getMarkType(Tr,Ar.schema);return isMarkActive(Ar,Mr,Cr)?Rr.unsetMark(Mr,{extendEmptyMarkRange:Dr}):Rr.setMark(Mr,Cr)},toggleNode=(Tr,Cr,$r={})=>({state:Ar,commands:Rr})=>{const Dr=getNodeType(Tr,Ar.schema),Mr=getNodeType(Cr,Ar.schema);return isNodeActive(Ar,Dr,$r)?Rr.setNode(Mr):Rr.setNode(Dr,$r)},toggleWrap=(Tr,Cr={})=>({state:$r,commands:Ar})=>{const Rr=getNodeType(Tr,$r.schema);return isNodeActive($r,Rr,Cr)?Ar.lift(Rr):Ar.wrapIn(Rr,Cr)},undoInputRule=()=>({state:Tr,dispatch:Cr})=>{const $r=Tr.plugins;for(let Ar=0;Ar<$r.length;Ar+=1){const Rr=$r[Ar];let Dr;if(Rr.spec.isInputRules&&(Dr=Rr.getState(Tr))){if(Cr){const Mr=Tr.tr,Br=Dr.transform;for(let Nr=Br.steps.length-1;Nr>=0;Nr-=1)Mr.step(Br.steps[Nr].invert(Br.docs[Nr]));if(Dr.text){const Nr=Mr.doc.resolve(Dr.from).marks();Mr.replaceWith(Dr.from,Dr.to,Tr.schema.text(Dr.text,Nr))}else Mr.delete(Dr.from,Dr.to)}return!0}}return!1},unsetAllMarks=()=>({tr:Tr,dispatch:Cr})=>{const{selection:$r}=Tr,{empty:Ar,ranges:Rr}=$r;return Ar||Cr&&Rr.forEach(Dr=>{Tr.removeMark(Dr.$from.pos,Dr.$to.pos)}),!0},unsetMark=(Tr,Cr={})=>({tr:$r,state:Ar,dispatch:Rr})=>{var Dr;const{extendEmptyMarkRange:Mr=!1}=Cr,{selection:Br}=$r,Nr=getMarkType(Tr,Ar.schema),{$from:Lr,empty:Hr,ranges:zr}=Br;if(!Rr)return!0;if(Hr&&Mr){let{from:Ur,to:Vr}=Br;const jr=(Dr=Lr.marks().find(Xr=>Xr.type===Nr))===null||Dr===void 0?void 0:Dr.attrs,Gr=getMarkRange(Lr,Nr,jr);Gr&&(Ur=Gr.from,Vr=Gr.to),$r.removeMark(Ur,Vr,Nr)}else zr.forEach(Ur=>{$r.removeMark(Ur.$from.pos,Ur.$to.pos,Nr)});return $r.removeStoredMark(Nr),!0},updateAttributes=(Tr,Cr={})=>({tr:$r,state:Ar,dispatch:Rr})=>{let Dr=null,Mr=null;const Br=getSchemaTypeNameByName(typeof Tr=="string"?Tr:Tr.name,Ar.schema);return Br?(Br==="node"&&(Dr=getNodeType(Tr,Ar.schema)),Br==="mark"&&(Mr=getMarkType(Tr,Ar.schema)),Rr&&$r.selection.ranges.forEach(Nr=>{const Lr=Nr.$from.pos,Hr=Nr.$to.pos;Ar.doc.nodesBetween(Lr,Hr,(zr,Ur)=>{Dr&&Dr===zr.type&&$r.setNodeMarkup(Ur,void 0,{...zr.attrs,...Cr}),Mr&&zr.marks.length&&zr.marks.forEach(Vr=>{if(Mr===Vr.type){const jr=Math.max(Ur,Lr),Gr=Math.min(Ur+zr.nodeSize,Hr);$r.addMark(jr,Gr,Mr.create({...Vr.attrs,...Cr}))}})})}),!0):!1},wrapIn=(Tr,Cr={})=>({state:$r,dispatch:Ar})=>{const Rr=getNodeType(Tr,$r.schema);return wrapIn$1(Rr,Cr)($r,Ar)},wrapInList=(Tr,Cr={})=>({state:$r,dispatch:Ar})=>{const Rr=getNodeType(Tr,$r.schema);return wrapInList$1(Rr,Cr)($r,Ar)};var commands=Object.freeze({__proto__:null,blur,clearContent,clearNodes,command,createParagraphNear,cut,deleteCurrentNode,deleteNode,deleteRange,deleteSelection,enter,exitCode,extendMarkRange,first,focus,forEach,insertContent,insertContentAt,joinUp,joinDown,joinBackward,joinForward,joinItemBackward,joinItemForward,keyboardShortcut,lift,liftEmptyBlock,liftListItem,newlineInCode,resetAttributes,scrollIntoView,selectAll,selectNodeBackward,selectNodeForward,selectParentNode,selectTextblockEnd,selectTextblockStart,setContent,setMark,setMeta,setNode,setNodeSelection,setTextSelection,sinkListItem,splitBlock,splitListItem,toggleList,toggleMark,toggleNode,toggleWrap,undoInputRule,unsetAllMarks,unsetMark,updateAttributes,wrapIn,wrapInList});const Commands=Extension.create({name:"commands",addCommands(){return{...commands}}}),Editable=Extension.create({name:"editable",addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("editable"),props:{editable:()=>this.editor.options.editable}})]}}),FocusEvents=Extension.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:Tr}=this;return[new Plugin({key:new PluginKey("focusEvents"),props:{handleDOMEvents:{focus:(Cr,$r)=>{Tr.isFocused=!0;const Ar=Tr.state.tr.setMeta("focus",{event:$r}).setMeta("addToHistory",!1);return Cr.dispatch(Ar),!1},blur:(Cr,$r)=>{Tr.isFocused=!1;const Ar=Tr.state.tr.setMeta("blur",{event:$r}).setMeta("addToHistory",!1);return Cr.dispatch(Ar),!1}}}})]}}),Keymap=Extension.create({name:"keymap",addKeyboardShortcuts(){const Tr=()=>this.editor.commands.first(({commands:Mr})=>[()=>Mr.undoInputRule(),()=>Mr.command(({tr:Br})=>{const{selection:Nr,doc:Lr}=Br,{empty:Hr,$anchor:zr}=Nr,{pos:Ur,parent:Vr}=zr,jr=zr.parent.isTextblock?Br.doc.resolve(Ur-1):zr,Gr=jr.parent.type.spec.isolating,Xr=zr.pos-zr.parentOffset,Kr=Gr&&jr.parent.childCount===1?Xr===zr.pos:Selection.atStart(Lr).from===Ur;return!Hr||!Kr||!Vr.type.isTextblock||Vr.textContent.length?!1:Mr.clearNodes()}),()=>Mr.deleteSelection(),()=>Mr.joinBackward(),()=>Mr.selectNodeBackward()]),Cr=()=>this.editor.commands.first(({commands:Mr})=>[()=>Mr.deleteSelection(),()=>Mr.deleteCurrentNode(),()=>Mr.joinForward(),()=>Mr.selectNodeForward()]),Ar={Enter:()=>this.editor.commands.first(({commands:Mr})=>[()=>Mr.newlineInCode(),()=>Mr.createParagraphNear(),()=>Mr.liftEmptyBlock(),()=>Mr.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:Tr,"Mod-Backspace":Tr,"Shift-Backspace":Tr,Delete:Cr,"Mod-Delete":Cr,"Mod-a":()=>this.editor.commands.selectAll()},Rr={...Ar},Dr={...Ar,"Ctrl-h":Tr,"Alt-Backspace":Tr,"Ctrl-d":Cr,"Ctrl-Alt-Backspace":Cr,"Alt-Delete":Cr,"Alt-d":Cr,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return isiOS()||isMacOS()?Dr:Rr},addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("clearDocument"),appendTransaction:(Tr,Cr,$r)=>{if(!(Tr.some(jr=>jr.docChanged)&&!Cr.doc.eq($r.doc)))return;const{empty:Rr,from:Dr,to:Mr}=Cr.selection,Br=Selection.atStart(Cr.doc).from,Nr=Selection.atEnd(Cr.doc).to;if(Rr||!(Dr===Br&&Mr===Nr)||!($r.doc.textBetween(0,$r.doc.content.size," "," ").length===0))return;const zr=$r.tr,Ur=createChainableState({state:$r,transaction:zr}),{commands:Vr}=new CommandManager({editor:this.editor,state:Ur});if(Vr.clearNodes(),!!zr.steps.length)return zr}})]}}),Tabindex=Extension.create({name:"tabindex",addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var extensions=Object.freeze({__proto__:null,ClipboardTextSerializer,Commands,Editable,FocusEvents,Keymap,Tabindex});const style$1=`.ProseMirror { position: relative; } .ProseMirror { word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; -webkit-font-variant-ligatures: none; font-variant-ligatures: none; font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ } .ProseMirror [contenteditable="false"] { white-space: normal; } .ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; } .ProseMirror pre { white-space: pre-wrap; } img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 1px !important; height: 1px !important; } .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; margin: 0; } .ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; } @keyframes ProseMirror-cursor-blink { to { visibility: hidden; } } .ProseMirror-hideselection *::selection { background: transparent; } .ProseMirror-hideselection *::-moz-selection { background: transparent; } .ProseMirror-hideselection * { caret-color: transparent; } .ProseMirror-focused .ProseMirror-gapcursor { display: block; } .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 }`;function createStyleTag(Tr,Cr,$r){const Ar=document.querySelector(`style[data-tiptap-style${$r?`-${$r}`:""}]`);if(Ar!==null)return Ar;const Rr=document.createElement("style");return Cr&&Rr.setAttribute("nonce",Cr),Rr.setAttribute(`data-tiptap-style${$r?`-${$r}`:""}`,""),Rr.innerHTML=Tr,document.getElementsByTagName("head")[0].appendChild(Rr),Rr}let Editor$1=class extends EventEmitter{constructor(Cr={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(Cr),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=createStyleTag(style$1,this.options.injectNonce))}setOptions(Cr={}){this.options={...this.options,...Cr},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(Cr,$r=!0){this.setOptions({editable:Cr}),$r&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(Cr,$r){const Ar=isFunction$2($r)?$r(Cr,[...this.state.plugins]):[...this.state.plugins,Cr],Rr=this.state.reconfigure({plugins:Ar});this.view.updateState(Rr)}unregisterPlugin(Cr){if(this.isDestroyed)return;const $r=typeof Cr=="string"?`${Cr}$`:Cr.key,Ar=this.state.reconfigure({plugins:this.state.plugins.filter(Rr=>!Rr.key.startsWith($r))});this.view.updateState(Ar)}createExtensionManager(){const $r=[...this.options.enableCoreExtensions?Object.values(extensions):[],...this.options.extensions].filter(Ar=>["extension","node","mark"].includes(Ar==null?void 0:Ar.type));this.extensionManager=new ExtensionManager($r,this)}createCommandManager(){this.commandManager=new CommandManager({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const Cr=createDocument(this.options.content,this.schema,this.options.parseOptions),$r=resolveFocusPosition(Cr,this.options.autofocus);this.view=new EditorView(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:EditorState.create({doc:Cr,selection:$r||void 0})});const Ar=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(Ar),this.createNodeViews(),this.prependClass();const Rr=this.view.dom;Rr.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(Cr){this.isCapturingTransaction=!0,Cr(),this.isCapturingTransaction=!1;const $r=this.capturedTransaction;return this.capturedTransaction=null,$r}dispatchTransaction(Cr){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=Cr;return}Cr.steps.forEach(Mr=>{var Br;return(Br=this.capturedTransaction)===null||Br===void 0?void 0:Br.step(Mr)});return}const $r=this.state.apply(Cr),Ar=!this.state.selection.eq($r.selection);this.view.updateState($r),this.emit("transaction",{editor:this,transaction:Cr}),Ar&&this.emit("selectionUpdate",{editor:this,transaction:Cr});const Rr=Cr.getMeta("focus"),Dr=Cr.getMeta("blur");Rr&&this.emit("focus",{editor:this,event:Rr.event,transaction:Cr}),Dr&&this.emit("blur",{editor:this,event:Dr.event,transaction:Cr}),!(!Cr.docChanged||Cr.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:Cr})}getAttributes(Cr){return getAttributes(this.state,Cr)}isActive(Cr,$r){const Ar=typeof Cr=="string"?Cr:null,Rr=typeof Cr=="string"?$r:Cr;return isActive(this.state,Ar,Rr)}getJSON(){return this.state.doc.toJSON()}getHTML(){return getHTMLFromFragment(this.state.doc.content,this.schema)}getText(Cr){const{blockSeparator:$r=` `,textSerializers:Ar={}}=Cr||{};return getText(this.state.doc,{blockSeparator:$r,textSerializers:{...getTextSerializersFromSchema(this.schema),...Ar}})}get isEmpty(){return isNodeEmpty(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var Cr;return!(!((Cr=this.view)===null||Cr===void 0)&&Cr.docView)}};function markInputRule(Tr){return new InputRule({find:Tr.find,handler:({state:Cr,range:$r,match:Ar})=>{const Rr=callOrReturn(Tr.getAttributes,void 0,Ar);if(Rr===!1||Rr===null)return null;const{tr:Dr}=Cr,Mr=Ar[Ar.length-1],Br=Ar[0];if(Mr){const Nr=Br.search(/\S/),Lr=$r.from+Br.indexOf(Mr),Hr=Lr+Mr.length;if(getMarksBetween($r.from,$r.to,Cr.doc).filter(Vr=>Vr.mark.type.excluded.find(Gr=>Gr===Tr.type&&Gr!==Vr.mark.type)).filter(Vr=>Vr.to>Lr).length)return null;Hr<$r.to&&Dr.delete(Hr,$r.to),Lr>$r.from&&Dr.delete($r.from+Nr,Lr);const Ur=$r.from+Nr+Mr.length;Dr.addMark($r.from+Nr,Ur,Tr.type.create(Rr||{})),Dr.removeStoredMark(Tr.type)}}})}function nodeInputRule(Tr){return new InputRule({find:Tr.find,handler:({state:Cr,range:$r,match:Ar})=>{const Rr=callOrReturn(Tr.getAttributes,void 0,Ar)||{},{tr:Dr}=Cr,Mr=$r.from;let Br=$r.to;const Nr=Tr.type.create(Rr);if(Ar[1]){const Lr=Ar[0].lastIndexOf(Ar[1]);let Hr=Mr+Lr;Hr>Br?Hr=Br:Br=Hr+Ar[1].length;const zr=Ar[0][Ar[0].length-1];Dr.insertText(zr,Mr+Ar[0].length-1),Dr.replaceWith(Hr,Br,Nr)}else Ar[0]&&Dr.insert(Mr-1,Tr.type.create(Rr)).delete(Dr.mapping.map(Mr),Dr.mapping.map(Br));Dr.scrollIntoView()}})}function textblockTypeInputRule(Tr){return new InputRule({find:Tr.find,handler:({state:Cr,range:$r,match:Ar})=>{const Rr=Cr.doc.resolve($r.from),Dr=callOrReturn(Tr.getAttributes,void 0,Ar)||{};if(!Rr.node(-1).canReplaceWith(Rr.index(-1),Rr.indexAfter(-1),Tr.type))return null;Cr.tr.delete($r.from,$r.to).setBlockType($r.from,$r.from,Tr.type,Dr)}})}function textInputRule(Tr){return new InputRule({find:Tr.find,handler:({state:Cr,range:$r,match:Ar})=>{let Rr=Tr.replace,Dr=$r.from;const Mr=$r.to;if(Ar[1]){const Br=Ar[0].lastIndexOf(Ar[1]);Rr+=Ar[0].slice(Br+Ar[1].length),Dr+=Br;const Nr=Dr-Mr;Nr>0&&(Rr=Ar[0].slice(Br-Nr,Br)+Rr,Dr=Mr)}Cr.tr.insertText(Rr,Dr,Mr)}})}function wrappingInputRule(Tr){return new InputRule({find:Tr.find,handler:({state:Cr,range:$r,match:Ar,chain:Rr})=>{const Dr=callOrReturn(Tr.getAttributes,void 0,Ar)||{},Mr=Cr.tr.delete($r.from,$r.to),Nr=Mr.doc.resolve($r.from).blockRange(),Lr=Nr&&findWrapping(Nr,Tr.type,Dr);if(!Lr)return null;if(Mr.wrap(Nr,Lr),Tr.keepMarks&&Tr.editor){const{selection:zr,storedMarks:Ur}=Cr,{splittableMarks:Vr}=Tr.editor.extensionManager,jr=Ur||zr.$to.parentOffset&&zr.$from.marks();if(jr){const Gr=jr.filter(Xr=>Vr.includes(Xr.type.name));Mr.ensureMarks(Gr)}}if(Tr.keepAttributes){const zr=Tr.type.name==="bulletList"||Tr.type.name==="orderedList"?"listItem":"taskList";Rr().updateAttributes(zr,Dr).run()}const Hr=Mr.doc.resolve($r.from-1).nodeBefore;Hr&&Hr.type===Tr.type&&canJoin(Mr.doc,$r.from-1)&&(!Tr.joinPredicate||Tr.joinPredicate(Ar,Hr))&&Mr.join($r.from-1)}})}class Mark{constructor(Cr={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...Cr},this.name=this.config.name,Cr.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=callOrReturn(getExtensionField(this,"addOptions",{name:this.name}))),this.storage=callOrReturn(getExtensionField(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(Cr={}){return new Mark(Cr)}configure(Cr={}){const $r=this.extend();return $r.options=mergeDeep(this.options,Cr),$r.storage=callOrReturn(getExtensionField($r,"addStorage",{name:$r.name,options:$r.options})),$r}extend(Cr={}){const $r=new Mark(Cr);return $r.parent=this,this.child=$r,$r.name=Cr.name?Cr.name:$r.parent.name,Cr.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${$r.name}".`),$r.options=callOrReturn(getExtensionField($r,"addOptions",{name:$r.name})),$r.storage=callOrReturn(getExtensionField($r,"addStorage",{name:$r.name,options:$r.options})),$r}static handleExit({editor:Cr,mark:$r}){const{tr:Ar}=Cr.state,Rr=Cr.state.selection.$from;if(Rr.pos===Rr.end()){const Mr=Rr.marks();if(!!!Mr.find(Lr=>(Lr==null?void 0:Lr.type.name)===$r.name))return!1;const Nr=Mr.find(Lr=>(Lr==null?void 0:Lr.type.name)===$r.name);return Nr&&Ar.removeStoredMark(Nr),Ar.insertText(" ",Rr.pos),Cr.view.dispatch(Ar),!0}return!1}}let Node$1=class Vd{constructor(Cr={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...Cr},this.name=this.config.name,Cr.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=callOrReturn(getExtensionField(this,"addOptions",{name:this.name}))),this.storage=callOrReturn(getExtensionField(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(Cr={}){return new Vd(Cr)}configure(Cr={}){const $r=this.extend();return $r.options=mergeDeep(this.options,Cr),$r.storage=callOrReturn(getExtensionField($r,"addStorage",{name:$r.name,options:$r.options})),$r}extend(Cr={}){const $r=new Vd(Cr);return $r.parent=this,this.child=$r,$r.name=Cr.name?Cr.name:$r.parent.name,Cr.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${$r.name}".`),$r.options=callOrReturn(getExtensionField($r,"addOptions",{name:$r.name})),$r.storage=callOrReturn(getExtensionField($r,"addStorage",{name:$r.name,options:$r.options})),$r}};function markPasteRule(Tr){return new PasteRule({find:Tr.find,handler:({state:Cr,range:$r,match:Ar})=>{const Rr=callOrReturn(Tr.getAttributes,void 0,Ar);if(Rr===!1||Rr===null)return null;const{tr:Dr}=Cr,Mr=Ar[Ar.length-1],Br=Ar[0];let Nr=$r.to;if(Mr){const Lr=Br.search(/\S/),Hr=$r.from+Br.indexOf(Mr),zr=Hr+Mr.length;if(getMarksBetween($r.from,$r.to,Cr.doc).filter(Vr=>Vr.mark.type.excluded.find(Gr=>Gr===Tr.type&&Gr!==Vr.mark.type)).filter(Vr=>Vr.to>Hr).length)return null;zr<$r.to&&Dr.delete(zr,$r.to),Hr>$r.from&&Dr.delete($r.from+Lr,Hr),Nr=$r.from+Lr+Mr.length,Dr.addMark($r.from+Lr,Nr,Tr.type.create(Rr||{})),Dr.removeStoredMark(Tr.type)}}})}const TextStyle$2=Mark.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:Tr=>Tr.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:Tr}){return["span",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:Tr,commands:Cr})=>{const $r=getMarkAttributes(Tr,this.type);return Object.entries($r).some(([,Rr])=>!!Rr)?!0:Cr.unsetMark(this.name)}}}}),inputRegex$8=/^\s*([-+*])\s$/,customLiftListItem=Tr=>{let Cr=null;Tr.state.doc.nodesBetween(Tr.state.selection.$from.pos,Tr.state.selection.$to.pos,(Ar,Rr,Dr)=>{Ar.attrs.listContentType&&(Cr=Ar.attrs.listContentType)});const $r=Tr.commands.liftListItem("listItem");return Cr&&!Tr.isActive("bulletList")&&!Tr.isActive("orderedList")&&(Cr==="paragraph"||(Cr==="h1"?Tr.commands.setHeading({level:1}):Cr==="h2"?Tr.commands.setHeading({level:2}):Cr==="h3"?Tr.commands.setHeading({level:3}):Cr==="h4"?Tr.commands.setHeading({level:4}):Cr==="h5"?Tr.commands.setHeading({level:5}):Cr==="title"&&Tr.commands.setTitle())),$r},BulletList$3=Node$1.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1,listContentTypes:["paragraph","h1","h2","h3","h4","h5","title"],listContentSymbols:["disc","arrow"]}},addAttributes(){return{listContentType:{default:this.options.listContentTypes[0],rendered:!1},listContentSymbol:{default:this.options.listContentSymbols[0],rendered:!1}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){const Tr=this.options.listContentTypes.map($r=>({tag:`ul[data-list-content-type="${$r}"]`,attrs:{listContentType:$r}})),Cr=this.options.listContentSymbols.map($r=>({tag:`ul[data-list-content-symbol="${$r}"]`,attrs:{listContentSymbol:$r}}));return[...Tr,...Cr]},renderHTML({node:Tr,HTMLAttributes:Cr}){const Ar=this.options.listContentTypes.includes(Tr.attrs.listContentType)?Tr.attrs.listContentType:this.options.listContentTypes[0],Dr=this.options.listContentSymbols.includes(Tr.attrs.listContentSymbol)?Tr.attrs.listContentSymbol:this.options.listContentSymbols[0];return["ul",mergeAttributes({"data-list-content-type":Ar,"data-list-content-symbol":Dr},this.options.HTMLAttributes,Cr),0]},addCommands(){return{toggleBulletListCustom:(Tr,Cr)=>({commands:$r,chain:Ar})=>{let Rr=Tr?{listContentType:Tr}:void 0;return Cr&&(Rr?Rr={...Rr,listContentSymbol:Cr}:Rr={listContentSymbol:Cr}),this.options.keepAttributes?Ar().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(this.name,{...this.editor.getAttributes(TextStyle$2.name),...Rr}).run():$r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)},setListContentTypeForBulletListCustom:Tr=>({commands:Cr,chain:$r})=>{if(!Tr)return;if(!this.options.listContentTypes.includes(Tr))return!1;const Ar=Tr?{listContentType:Tr}:void 0;return $r().updateAttributes(this.name,{...this.editor.getAttributes(TextStyle$2.name),...Ar}).run()},setListContentSymbolForBulletListCustom:Tr=>({commands:Cr,chain:$r})=>{if(!Tr)return;if(!this.options.listContentSymbols.includes(Tr))return!1;const Ar=Tr?{listContentSymbol:Tr}:void 0;return $r().updateAttributes(this.name,{...this.editor.getAttributes(TextStyle$2.name),...Ar}).run()}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>{let Tr=null;this.editor.state.doc.nodesBetween(this.editor.state.selection.$from.pos,this.editor.state.selection.$to.pos,($r,Ar,Rr)=>{$r.attrs.listContentType&&(Tr=$r.attrs.listContentType)});const Cr=this.editor.commands.sinkListItem("listItem");return Tr&&this.editor.isActive("bulletList")?this.editor.commands.updateAttributes("bulletList",{listContentType:Tr}):Tr&&this.editor.isActive("orderedList")&&this.editor.commands.updateAttributes("orderedList",{listContentType:Tr}),Cr},"Shift-Tab":()=>customLiftListItem(this.editor)}},addInputRules(){let Tr=wrappingInputRule({find:inputRegex$8,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(Tr=wrappingInputRule({find:inputRegex$8,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>({...this.editor.getAttributes(TextStyle$2.name)}),editor:this.editor})),[Tr]}}),Heading$3=Node$1.create({name:"heading",content:"inline*",group:"block",defining:!0,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(Tr=>({tag:`h${Tr}`,attrs:{level:Tr}}))},renderHTML({node:Tr,HTMLAttributes:Cr}){return[`h${this.options.levels.includes(Tr.attrs.level)?Tr.attrs.level:this.options.levels[0]}`,mergeAttributes(this.options.HTMLAttributes,Cr),0]},addCommands(){return{setHeading:Tr=>({commands:Cr})=>this.options.levels.includes(Tr.level)?Cr.setNode(this.name,Tr):!1,toggleHeading:Tr=>({commands:Cr})=>this.options.levels.includes(Tr.level)?Cr.toggleNode(this.name,"paragraph",Tr):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((Tr,Cr)=>({...Tr,[`Mod-Alt-${Cr}`]:()=>this.editor.commands.toggleHeading({level:Cr})}),{})},addInputRules(){return this.options.levels.map(Tr=>textblockTypeInputRule({find:new RegExp(`^(#{1,${Tr}})\\s$`),type:this.type,getAttributes:{level:Tr}}))}}),TitleNode=Node$1.create({name:"title",addOptions(){return{HTMLAttributes:{}}},group:"block list",content:"inline*",inline:!1,marks:"_",selectable:!0,atom:!1,defining:!0,priority:1e3,addAttributes(){return{}},parseHTML(){return[{tag:`h1[data-type="${this.name}"]`}]},renderHTML({node:Tr,HTMLAttributes:Cr}){return["h1",mergeAttributes({"data-type":this.name},this.options.HTMLAttributes,Cr),0]},addCommands(){return{setTitle:Tr=>({commands:Cr})=>Cr.setNode(this.name,Tr),toggleTitle:Tr=>({commands:Cr})=>Cr.toggleNode(this.name,"paragraph",Tr)}}}),ListItem$5=Node$1.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"(paragraph|heading|title) block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({node:Tr,HTMLAttributes:Cr}){return["li",mergeAttributes(this.options.HTMLAttributes,Cr),0]},addKeyboardShortcuts(){return{}}}),inputRegex$7=/^(\d+)\.\s$/,OrderedList$3=Node$1.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1,listContentTypes:["paragraph","h1","h2","h3","h4","h5","title"]}},addAttributes(){return{listContentType:{default:this.options.listContentTypes[0],rendered:!1}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return this.options.listContentTypes.map(Tr=>({tag:`ol[data-list-content-type="${Tr}"]`,attrs:{listContentType:Tr}}))},renderHTML({node:Tr,HTMLAttributes:Cr}){const Ar=this.options.listContentTypes.includes(Tr.attrs.listContentType)?Tr.attrs.listContentType:this.options.listContentTypes[0];return["ol",mergeAttributes({"data-list-content-type":Ar},this.options.HTMLAttributes,Cr),0]},addCommands(){return{toggleOrderedListCustom:Tr=>({commands:Cr,chain:$r})=>{const Ar=Tr?{listContentType:Tr}:void 0;return this.options.keepAttributes?$r().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(this.name,{...this.editor.getAttributes(TextStyle$2.name),...Ar}).run():Cr.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)},setListContentTypeForOrderedListCustom:Tr=>({commands:Cr,chain:$r})=>{if(!this.options.listContentTypes.includes(Tr))return!1;const Ar=Tr?{listContentType:Tr}:void 0;return $r().updateAttributes(this.name,{...this.editor.getAttributes(TextStyle$2.name),...Ar}).run()}}},addKeyboardShortcuts(){return{}},addInputRules(){let Tr=wrappingInputRule({find:inputRegex$7,type:this.type,getAttributes:Cr=>({start:+Cr[1]}),joinPredicate:(Cr,$r)=>$r.childCount+$r.attrs.start===+Cr[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(Tr=wrappingInputRule({find:inputRegex$7,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:Cr=>({start:+Cr[1],...this.editor.getAttributes(TextStyle$2.name)}),joinPredicate:(Cr,$r)=>$r.childCount+$r.attrs.start===+Cr[1],editor:this.editor})),[Tr]}}),textTypes=[{id:"title",name:"Page Title",type:"title",level:6,icon:"texttype-title"},{id:"h1",name:"Heading 1",type:"heading",level:1,icon:"texttype-h1"},{id:"h2",name:"Heading 2",type:"heading",level:2,icon:"texttype-h2"},{id:"h3",name:"Heading 3",type:"heading",level:3,icon:"texttype-h3"},{id:"h4",name:"Subheading",type:"heading",level:4,icon:"texttype-subtitle"},{id:"paragraph",name:"Text",type:"paragraph",icon:"texttype-body"},{id:"h5",name:"Caption",type:"heading",level:5,icon:"texttype-caption"},{id:"noList",name:"None",type:"paragraph",icon:"list-none"},{id:"bulletList",name:"Bullet",type:"paragraph",icon:"list-disc",symbol:"disc"},{id:"bulletList",name:"Arrow",type:"paragraph",icon:"list-arrow",symbol:"arrow"},{id:"orderedList",name:"Number",type:"paragraph",icon:"list-number-2"}],isActiveList=({editor:Tr,type:Cr,attrs:$r})=>Cr.startsWith("bulletList")?Tr.isActive("bulletList",$r):Cr.startsWith("orderedList")?Tr.isActive("orderedList"):!1,getCurrentNode=Tr=>Tr?(log(Tr.state.selection.$anchor),log("*****",Tr.state.selection.$anchor.parent),Tr.state.selection.$anchor.parent):null,getCurrentNodeType=Tr=>{var $r;if(!Tr)return;const Cr=getCurrentNode(Tr);return($r=Cr==null?void 0:Cr.type)==null?void 0:$r.name},getAttributesOfCurrentNode=Tr=>{if(!Tr)return;const Cr=getCurrentNode(Tr);return JSON.parse(JSON.stringify((Cr==null?void 0:Cr.attrs)??{}))},getCurrentTag=(Tr,Cr)=>Tr==="heading"?`h${Cr.level||1}`:Tr==="title"?"title":Tr==="bulletList"?"ul":Tr==="orderedList"?"ol":"paragraph",runFuncOverAllSelectedNodes=(Tr,Cr)=>{const{from:$r,to:Ar}=Tr.state.selection;Tr.state.doc.nodesBetween($r,Ar,Cr)},setAllSelectedNodesToTextType=(Tr,Cr)=>{runFuncOverAllSelectedNodes(Tr,(Ar,Rr,Dr)=>{log("select",Ar.type.name),(Ar.type.name==="bulletList"||Ar.type.name==="orderedList")&&(Tr.state.tr.setNodeAttribute(Rr,"listContentType",Cr),Ar.attrs={...Ar.attrs,listContentType:Cr},log("select listContentType",Ar.attrs))})},changeTextType=({editor:Tr,textType:Cr,textAlignment:$r,selectedTextTypes:Ar})=>{var Vr,jr;const Rr=Tr.isActive("bulletList"),Dr=Tr.isActive("bulletList",{listContentSymbol:"disc"}),Mr=Tr.isActive("bulletList",{listContentSymbol:"arrow"}),Br=Tr.isActive("orderedList"),Nr=getCurrentNodeType(Tr),Lr=getAttributesOfCurrentNode(Tr);let Hr=getCurrentTag(Nr,Lr);const zr=(jr=(Vr=Ar.value.values().next())==null?void 0:Vr.value)==null?void 0:jr.id;(Rr||Br)&&zr&&(Hr=zr);const Ur=Tr.chain().focus();if(Cr.type==="heading"){if(!Rr&&!Br)setAllSelectedNodesToTextType(Tr,Cr.id),Ur.setHeading({level:Cr.level});else if(Rr){const Gr=getCurrentTag("heading",{level:Cr.level});Ur.setListContentTypeForBulletListCustom(Gr)}else if(Br){const Gr=getCurrentTag("heading",{level:Cr.level});Ur.setListContentTypeForOrderedListCustom(Gr)}}else if(Cr.type==="title"){if(!Rr&&!Br)setAllSelectedNodesToTextType(Tr,Cr.id),Ur.setNode("title");else if(Rr){const Gr=getCurrentTag("title",{});Ur.setListContentTypeForBulletListCustom(Gr)}else if(Br){const Gr=getCurrentTag("title",{});Ur.setListContentTypeForOrderedListCustom(Gr)}}else if(Cr.id==="paragraph"){if(!Rr&&!Br)Ur.clearNodes();else if(Rr){const Gr=getCurrentTag("paragraph",{});Ur.setListContentTypeForBulletListCustom(Gr)}else if(Br){const Gr=getCurrentTag("paragraph",{});Ur.setListContentTypeForOrderedListCustom(Gr)}}else if(Cr.id==="bulletList"){if(log(`currentTag: ${Hr}, isBulletListActive: ${Rr}, isOrderedListActive: ${Br}, currentType: ${Nr}, currentAttrs: ${JSON.stringify(Lr)}`),!Rr&&!Br)Ur.clearNodes();else if(Rr){if(Cr.symbol==="disc"&&Dr||Cr.symbol==="arrow"&&Mr){customLiftListItem(Tr),Ur.run();return}Ur.setListContentSymbolForBulletListCustom(Cr.symbol),Ur.run();return}Ur.toggleBulletListCustom(Hr,Cr.symbol)}else if(Cr.id==="orderedList"){if(log(`currentTag: ${Hr}, isBulletListActive: ${Rr}, isOrderedListActive: ${Br}, currentType: ${Nr}, currentAttrs: ${JSON.stringify(Lr)}`),!Br&&!Rr)Ur.clearNodes();else if(Br){customLiftListItem(Tr);return}Ur.toggleOrderedListCustom(Hr)}else if(Cr.id==="noList"){customLiftListItem(Tr);return}else Ur.clearNodes();$r&&Ur.setTextAlign($r),Ur.run()},determineSelectedNodeTypes=({editor:Tr,selectedTextTypes:Cr,displayedTextType:$r})=>{const{from:Ar,to:Rr}=Tr.state.selection;if(Cr.value.clear(),Tr.state.doc.nodesBetween(Ar,Rr,(Dr,Mr,Br)=>{var Hr,zr,Ur,Vr,jr;const Nr=((Hr=Br==null?void 0:Br.type)==null?void 0:Hr.name)==="doc"||((zr=Br==null?void 0:Br.type)==null?void 0:zr.name.startsWith("bulletList"))||((Ur=Br==null?void 0:Br.type)==null?void 0:Ur.name.startsWith("orderedList"));if(Dr.isText||Dr.type.name==="text"||!Nr)return;const Lr=(Vr=Br==null?void 0:Br.type)==null?void 0:Vr.name;if(Lr!=null&&Lr.startsWith("bulletList")||Lr!=null&&Lr.startsWith("orderedList")){const Gr=(jr=Br==null?void 0:Br.attrs)==null?void 0:jr.listContentType;if(Gr){const Xr=textTypes.find(({id:Kr})=>Kr===Gr);Xr&&Cr.value.set(Gr,{...Xr,fromList:!0,pos:Mr})}}Dr.type.name==="paragraph"&&!Cr.value.has(Dr.type.name)?Cr.value.set(Dr.type.name,textTypes.find(({id:Gr})=>Gr===Dr.type.name)):Dr.type.name==="heading"&&Dr.attrs.level&&Dr.attrs.level<=5?Cr.value.set(`h${Dr.attrs.level}`,textTypes.find(({type:Gr,level:Xr})=>Gr==="heading"&&Xr===Dr.attrs.level)):(Dr.type.name==="title"||Dr.type.name==="heading"&&Dr.attrs.level===6)&&Cr.value.set("title",textTypes.find(({id:Gr})=>Gr==="title"))}),Cr.value.size===0)$r.value="Text",Cr.value.set("paragraph",textTypes.find(({id:Dr})=>Dr==="text"));else if(Cr.value.size>1){const Dr=[...Cr.value].filter(([Br,Nr])=>Nr.fromList).slice(-1)[0],Mr=[...Cr.value].filter(([Br,Nr])=>!Nr.fromList);if(Dr&&(Cr.value=new Map([Dr,...Mr])),Cr.value.size>1)$r.value="Mixed";else{const[Br]=Cr.value.values();if(Br.id.includes("List")){const Nr=textTypes.find(Lr=>Lr.id===Br.type);if(Nr){$r.value=Nr.name;return}}$r.value=Br.name}}else{const[Dr]=Cr.value.values();if(Dr.id.includes("List")){const Mr=textTypes.find(Br=>Br.id===Dr.type);if(Mr){$r.value=Mr.name;return}}$r.value=Dr.name}},useEditorStore=defineStore("editorStore",{state:()=>({current:null,selection:null,blockIdToFocus:null,editors:{},highlighterPosition:{},focused:{},isLinkButtonPressed:!1,linkPreview:{url:"",show:!1,position:{x:0,y:0}},tableEditors:{},currentTableEditor:null}),getters:{selectedText:Tr=>Cr=>{var Mr,Br,Nr,Lr;const $r=Tr.editors[Cr];if(!$r)return"";const Ar=$r.state.selection;if(Ar==null)return"";const Rr=((Br=(Mr=Ar.ranges[0])==null?void 0:Mr.$from)==null?void 0:Br.pos)||0,Dr=((Lr=(Nr=Ar.ranges[0])==null?void 0:Nr.$to)==null?void 0:Lr.pos)||0;return $r.state.doc.textBetween(Rr,Dr,` `)},isLinking:Tr=>Tr.isLinkButtonPressed,getLinkPreview:Tr=>Tr.linkPreview,getTableEditor:Tr=>Cr=>Tr.tableEditors[Cr]},actions:{setRef(Tr){this.current=Tr},setTableRef(Tr){this.currentTableEditor=Tr},setEditors(Tr,Cr){this.editors[Tr]=Cr},setTableEditors(Tr,{blockId:Cr,colId:$r,rowId:Ar}){this.tableEditors[`${Cr}-${$r}-${Ar}`]=Tr},hasSelection(Tr){var Cr,$r;return Tr&&Tr.state.selection&&Tr.state.selection.ranges&&Tr.state.selection.ranges[0]&&!(($r=(Cr=Tr==null?void 0:Tr.state)==null?void 0:Cr.selection)!=null&&$r.empty)},hasContent(Tr){if(Array.isArray(Tr)){const Cr=Tr.length>1,$r=Tr.some(Ar=>this.hasContent(Ar.content)||Ar.text);return Cr||$r}return!1},isNodeType(Tr,Cr){return Tr?isActiveList({editor:Tr,type:Cr}):!1},getSelectionPosition(Tr){var Ar,Rr,Dr,Mr;const Cr=this.editors[Tr],$r=Cr.state.selection.ranges[0];return this.hasSelection(Cr)?{nodeFrom:$r.$from.index(0),nodeTo:$r.$to.index(0),from:((Rr=$r.$from)==null?void 0:Rr.pos)||1,to:((Dr=$r.$to)==null?void 0:Dr.pos)||1,content:(Mr=Cr.state.selection.content().toJSON())==null?void 0:Mr.content}:this.focused[Tr]&&Cr?{nodeFrom:$r.$from.index(0),nodeTo:$r.$to.index(0),from:$r.$from.start(1),to:$r.$to.end(1),content:(Ar=Cr.getJSON().content)==null?void 0:Ar.slice($r.$from.index(0),$r.$to.index(0)+1)}:{from:1,to:1}},removeHighlightMarks(Tr){return Tr&&(Tr.forEach(Cr=>{Cr.content&&Cr.content.forEach($r=>{$r.marks&&($r.marks=$r.marks.filter(Ar=>!(Ar.type==="highlight"&&Ar.attrs.color==null)))})}),Tr)},getContentToSave(Tr){const Cr=lodashExports.cloneDeep(Tr.getJSON());return Cr.content=this.removeHighlightMarks(Cr.content),Cr},getRootNodeTextAlignment(Tr){var $r,Ar;return(Ar=($r=Tr.getJSON().content[0])==null?void 0:$r.attrs)==null?void 0:Ar.textAlign},getLastNodeTextAlignment(Tr){var $r,Ar;return(Ar=($r=Tr.getJSON().content[Tr.getJSON().content.length-1])==null?void 0:$r.attrs)==null?void 0:Ar.textAlign},isAlignmentMismatchOnAnyNode(Tr,Cr){let $r=!1;return Tr.getJSON().content.forEach(Ar=>{var Rr,Dr;console.log(Ar),(Rr=Ar.attrs)!=null&&Rr.textAlign&&((Dr=Ar.attrs)==null?void 0:Dr.textAlign)!==Cr&&($r=!0)}),$r},setHighlighterPosition(Tr,Cr){this.highlighterPosition[Tr]=Cr},getHighlighterPosition(Tr){return this.highlighterPosition[Tr]},createTextAnimation(Tr,{from:Cr,to:$r,newText:Ar}){Tr.commands.setTextSelection({from:Cr,to:$r}),Tr.chain().focus().deleteSelection().insertContent(Ar).run()},async insertWithTypewriterEffect(Tr,{from:Cr,to:$r,content:Ar},Rr,Dr){$r&&Tr.chain().deleteRange({from:Cr,to:$r}).run();let Mr=0;return new Promise(Br=>{const Nr=setInterval(()=>{Tr.chain().insertContentAt(Cr+Mr,Ar.charAt(Mr)).setTextSelection({from:Cr,to:Cr+Mr}).run(),Rr&&Rr(),Mr+=1,Mr>=Ar.length&&(clearInterval(Nr),Tr.commands.focus(),Tr.commands.setTextSelection({from:Cr,to:Cr+Ar.length}),Dr&&Dr(),Br())},10)})},async insertWithFadeEffectOld(Tr,{from:Cr,to:$r,content:Ar},Rr,Dr){$r&&Tr.chain().deleteRange({from:Cr,to:$r}).run();let Mr=0;const Br=Ar.split(" ");return new Promise(Nr=>{const Lr=setInterval(()=>{Tr.chain().insertContent({type:"animated-node",attrs:{label:`${Br[Mr]} `}}).run(),Rr&&Rr(),Mr+=1,Mr>=Br.length&&(clearInterval(Lr),Tr.commands.focus(),Tr.commands.setTextSelection({from:Cr,to:Cr+Ar.length}),Dr&&Dr(),Nr())},100)})},splitString(Tr){return Tr=Tr.replace(/\n+/g,` `),Tr.split(/(\s|\n)/)},async insertWithFadeEffect(Tr,{from:Cr,to:$r,content:Ar},Rr,Dr){$r&&Tr.chain().deleteRange({from:Cr,to:$r}).run();let Mr=0;const Nr=this.splitString(Ar).filter(Lr=>Lr!==" ");return new Promise(Lr=>{const Hr=setInterval(()=>{let zr={type:"animated-node",attrs:{label:`${Nr[Mr]} `}};Nr[Mr]===` `&&(zr={type:"paragraph",content:[{type:"text",text:" "}]}),Tr.chain().insertContent(zr).run(),Rr&&Rr(),Mr+=1,Mr>=Nr.length&&(clearInterval(Hr),Tr.commands.focus(),Tr.commands.setTextSelection({from:Cr,to:Cr+Ar.length}),Dr&&Dr(),Lr())},100)})},setFocused(Tr,Cr){this.focused[Tr]=Cr},setIsLinkButtonPressed(Tr){this.isLinkButtonPressed=Tr},hideLinkPreview(){this.linkPreview.show=!1,this.linkPreview.url="",this.linkPreview.position={x:0,y:0}},showLinkPreview({url:Tr,position:Cr}){this.linkPreview.url=Tr,this.linkPreview.position={...Cr},this.linkPreview.show=!0}}}),supabase$1=SupabaseWrapper.client,fetchBlock=async Tr=>{const{data:Cr,error:$r}=await supabase$1.from("blocks").select("*").eq("id",Tr).eq("is_deleted",!1).single();return{data:Cr,error:$r}},CUTOFF=144,useScrollIntoView=({update:Tr})=>({scrollIntoView:({elRef:$r})=>{if($r.value&&window){const Ar=$r.value.getBoundingClientRect();if(Ar.bottom>window.innerHeight-CUTOFF){const Rr=document.getElementById("editorWrapper");Rr&&(Rr.scrollTo({top:Rr.scrollTop+Ar.bottom-(window.innerHeight-CUTOFF),behavior:"smooth"}),Tr())}}}}),Document$1=Node$1.create({name:"doc",topNode:!0,content:"block+"}),Paragraph$2=Node$1.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:Tr}){return["p",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{setParagraph:()=>({commands:Tr})=>Tr.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Text$3=Node$1.create({name:"text",group:"inline"}),ListItem$4=Node$1.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:Tr}){return["li",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),TextStyle$1=Mark.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:Tr=>Tr.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:Tr}){return["span",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:Tr,commands:Cr})=>{const $r=getMarkAttributes(Tr,this.type);return Object.entries($r).some(([,Rr])=>!!Rr)?!0:Cr.unsetMark(this.name)}}}}),inputRegex$6=/^\s*([-+*])\s$/,BulletList$2=Node$1.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:Tr}){return["ul",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{toggleBulletList:()=>({commands:Tr,chain:Cr})=>this.options.keepAttributes?Cr().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ListItem$4.name,this.editor.getAttributes(TextStyle$1.name)).run():Tr.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let Tr=wrappingInputRule({find:inputRegex$6,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(Tr=wrappingInputRule({find:inputRegex$6,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(TextStyle$1.name),editor:this.editor})),[Tr]}}),ListItem$3=Node$1.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:Tr}){return["li",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),TextStyle=Mark.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:Tr=>Tr.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:Tr}){return["span",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:Tr,commands:Cr})=>{const $r=getMarkAttributes(Tr,this.type);return Object.entries($r).some(([,Rr])=>!!Rr)?!0:Cr.unsetMark(this.name)}}}}),inputRegex$5=/^(\d+)\.\s$/,OrderedList$2=Node$1.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:Tr=>Tr.hasAttribute("start")?parseInt(Tr.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:Tr}){const{start:Cr,...$r}=Tr;return Cr===1?["ol",mergeAttributes(this.options.HTMLAttributes,$r),0]:["ol",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{toggleOrderedList:()=>({commands:Tr,chain:Cr})=>this.options.keepAttributes?Cr().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ListItem$3.name,this.editor.getAttributes(TextStyle.name)).run():Tr.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let Tr=wrappingInputRule({find:inputRegex$5,type:this.type,getAttributes:Cr=>({start:+Cr[1]}),joinPredicate:(Cr,$r)=>$r.childCount+$r.attrs.start===+Cr[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(Tr=wrappingInputRule({find:inputRegex$5,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:Cr=>({start:+Cr[1],...this.editor.getAttributes(TextStyle.name)}),joinPredicate:(Cr,$r)=>$r.childCount+$r.attrs.start===+Cr[1],editor:this.editor})),[Tr]}}),ListItem$2=Node$1.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:Tr}){return["li",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),starInputRegex$1=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,starPasteRegex$1=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,underscoreInputRegex$1=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,underscorePasteRegex$1=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Bold$2=Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:Tr=>Tr.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:Tr=>/^(bold(er)?|[5-9]\d{2,})$/.test(Tr)&&null}]},renderHTML({HTMLAttributes:Tr}){return["strong",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{setBold:()=>({commands:Tr})=>Tr.setMark(this.name),toggleBold:()=>({commands:Tr})=>Tr.toggleMark(this.name),unsetBold:()=>({commands:Tr})=>Tr.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[markInputRule({find:starInputRegex$1,type:this.type}),markInputRule({find:underscoreInputRegex$1,type:this.type})]},addPasteRules(){return[markPasteRule({find:starPasteRegex$1,type:this.type}),markPasteRule({find:underscorePasteRegex$1,type:this.type})]}}),starInputRegex=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,starPasteRegex=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,underscoreInputRegex=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,underscorePasteRegex=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,Italic$2=Mark.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:Tr=>Tr.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:Tr}){return["em",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{setItalic:()=>({commands:Tr})=>Tr.setMark(this.name),toggleItalic:()=>({commands:Tr})=>Tr.toggleMark(this.name),unsetItalic:()=>({commands:Tr})=>Tr.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[markInputRule({find:starInputRegex,type:this.type}),markInputRule({find:underscoreInputRegex,type:this.type})]},addPasteRules(){return[markPasteRule({find:starPasteRegex,type:this.type}),markPasteRule({find:underscorePasteRegex,type:this.type})]}}),inputRegex$4=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,pasteRegex$3=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,Strike$2=Mark.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:Tr=>Tr.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:Tr}){return["s",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{setStrike:()=>({commands:Tr})=>Tr.setMark(this.name),toggleStrike:()=>({commands:Tr})=>Tr.toggleMark(this.name),unsetStrike:()=>({commands:Tr})=>Tr.unsetMark(this.name)}},addKeyboardShortcuts(){const Tr={};return isMacOS()?Tr["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():Tr["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),Tr},addInputRules(){return[markInputRule({find:inputRegex$4,type:this.type})]},addPasteRules(){return[markPasteRule({find:pasteRegex$3,type:this.type})]}}),inputRegex$3=/^\s*>\s$/,Blockquote$2=Node$1.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:Tr}){return["blockquote",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{setBlockquote:()=>({commands:Tr})=>Tr.wrapIn(this.name),toggleBlockquote:()=>({commands:Tr})=>Tr.toggleWrap(this.name),unsetBlockquote:()=>({commands:Tr})=>Tr.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[wrappingInputRule({find:inputRegex$3,type:this.type})]}}),inputRegex$2=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,pasteRegex$2=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Code$2=Mark.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:Tr}){return["code",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{setCode:()=>({commands:Tr})=>Tr.setMark(this.name),toggleCode:()=>({commands:Tr})=>Tr.toggleMark(this.name),unsetCode:()=>({commands:Tr})=>Tr.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[markInputRule({find:inputRegex$2,type:this.type})]},addPasteRules(){return[markPasteRule({find:pasteRegex$2,type:this.type})]}}),backtickInputRegex=/^```([a-z]+)?[\s\n]$/,tildeInputRegex=/^~~~([a-z]+)?[\s\n]$/,CodeBlock$2=Node$1.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:Tr=>{var Cr;const{languageClassPrefix:$r}=this.options,Dr=[...((Cr=Tr.firstElementChild)===null||Cr===void 0?void 0:Cr.classList)||[]].filter(Mr=>Mr.startsWith($r)).map(Mr=>Mr.replace($r,""))[0];return Dr||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:Tr,HTMLAttributes:Cr}){return["pre",mergeAttributes(this.options.HTMLAttributes,Cr),["code",{class:Tr.attrs.language?this.options.languageClassPrefix+Tr.attrs.language:null},0]]},addCommands(){return{setCodeBlock:Tr=>({commands:Cr})=>Cr.setNode(this.name,Tr),toggleCodeBlock:Tr=>({commands:Cr})=>Cr.toggleNode(this.name,"paragraph",Tr)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:Tr,$anchor:Cr}=this.editor.state.selection,$r=Cr.pos===1;return!Tr||Cr.parent.type.name!==this.name?!1:$r||!Cr.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:Tr})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:Cr}=Tr,{selection:$r}=Cr,{$from:Ar,empty:Rr}=$r;if(!Rr||Ar.parent.type!==this.type)return!1;const Dr=Ar.parentOffset===Ar.parent.nodeSize-2,Mr=Ar.parent.textContent.endsWith(` `);return!Dr||!Mr?!1:Tr.chain().command(({tr:Br})=>(Br.delete(Ar.pos-2,Ar.pos),!0)).exitCode().run()},ArrowDown:({editor:Tr})=>{if(!this.options.exitOnArrowDown)return!1;const{state:Cr}=Tr,{selection:$r,doc:Ar}=Cr,{$from:Rr,empty:Dr}=$r;if(!Dr||Rr.parent.type!==this.type||!(Rr.parentOffset===Rr.parent.nodeSize-2))return!1;const Br=Rr.after();return Br===void 0||Ar.nodeAt(Br)?!1:Tr.commands.exitCode()}}},addInputRules(){return[textblockTypeInputRule({find:backtickInputRegex,type:this.type,getAttributes:Tr=>({language:Tr[1]})}),textblockTypeInputRule({find:tildeInputRegex,type:this.type,getAttributes:Tr=>({language:Tr[1]})})]},addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:(Tr,Cr)=>{if(!Cr.clipboardData||this.editor.isActive(this.type.name))return!1;const $r=Cr.clipboardData.getData("text/plain"),Ar=Cr.clipboardData.getData("vscode-editor-data"),Rr=Ar?JSON.parse(Ar):void 0,Dr=Rr==null?void 0:Rr.mode;if(!$r||!Dr)return!1;const{tr:Mr}=Tr.state;return Mr.replaceSelectionWith(this.type.create({language:Dr})),Mr.setSelection(TextSelection.near(Mr.doc.resolve(Math.max(0,Mr.selection.from-2)))),Mr.insertText($r.replace(/\r\n?/g,` `)),Mr.setMeta("paste",!0),Tr.dispatch(Mr),!0}}})]}});function dropCursor(Tr={}){return new Plugin({view(Cr){return new DropCursorView(Cr,Tr)}})}class DropCursorView{constructor(Cr,$r){var Ar;this.editorView=Cr,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(Ar=$r.width)!==null&&Ar!==void 0?Ar:1,this.color=$r.color===!1?void 0:$r.color||"black",this.class=$r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(Rr=>{let Dr=Mr=>{this[Rr](Mr)};return Cr.dom.addEventListener(Rr,Dr),{name:Rr,handler:Dr}})}destroy(){this.handlers.forEach(({name:Cr,handler:$r})=>this.editorView.dom.removeEventListener(Cr,$r))}update(Cr,$r){this.cursorPos!=null&&$r.doc!=Cr.state.doc&&(this.cursorPos>Cr.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(Cr){Cr!=this.cursorPos&&(this.cursorPos=Cr,Cr==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let Cr=this.editorView.state.doc.resolve(this.cursorPos),$r=!Cr.parent.inlineContent,Ar;if($r){let Br=Cr.nodeBefore,Nr=Cr.nodeAfter;if(Br||Nr){let Lr=this.editorView.nodeDOM(this.cursorPos-(Br?Br.nodeSize:0));if(Lr){let Hr=Lr.getBoundingClientRect(),zr=Br?Hr.bottom:Hr.top;Br&&Nr&&(zr=(zr+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),Ar={left:Hr.left,right:Hr.right,top:zr-this.width/2,bottom:zr+this.width/2}}}}if(!Ar){let Br=this.editorView.coordsAtPos(this.cursorPos);Ar={left:Br.left-this.width/2,right:Br.left+this.width/2,top:Br.top,bottom:Br.bottom}}let Rr=this.editorView.dom.offsetParent;this.element||(this.element=Rr.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",$r),this.element.classList.toggle("prosemirror-dropcursor-inline",!$r);let Dr,Mr;if(!Rr||Rr==document.body&&getComputedStyle(Rr).position=="static")Dr=-pageXOffset,Mr=-pageYOffset;else{let Br=Rr.getBoundingClientRect();Dr=Br.left-Rr.scrollLeft,Mr=Br.top-Rr.scrollTop}this.element.style.left=Ar.left-Dr+"px",this.element.style.top=Ar.top-Mr+"px",this.element.style.width=Ar.right-Ar.left+"px",this.element.style.height=Ar.bottom-Ar.top+"px"}scheduleRemoval(Cr){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),Cr)}dragover(Cr){if(!this.editorView.editable)return;let $r=this.editorView.posAtCoords({left:Cr.clientX,top:Cr.clientY}),Ar=$r&&$r.inside>=0&&this.editorView.state.doc.nodeAt($r.inside),Rr=Ar&&Ar.type.spec.disableDropCursor,Dr=typeof Rr=="function"?Rr(this.editorView,$r,Cr):Rr;if($r&&!Dr){let Mr=$r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let Br=dropPoint(this.editorView.state.doc,Mr,this.editorView.dragging.slice);Br!=null&&(Mr=Br)}this.setCursor(Mr),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(Cr){(Cr.target==this.editorView.dom||!this.editorView.dom.contains(Cr.relatedTarget))&&this.setCursor(null)}}const Dropcursor=Extension.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[dropCursor(this.options)]}});class GapCursor extends Selection{constructor(Cr){super(Cr,Cr)}map(Cr,$r){let Ar=Cr.resolve($r.map(this.head));return GapCursor.valid(Ar)?new GapCursor(Ar):Selection.near(Ar)}content(){return Slice.empty}eq(Cr){return Cr instanceof GapCursor&&Cr.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(Cr,$r){if(typeof $r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new GapCursor(Cr.resolve($r.pos))}getBookmark(){return new GapBookmark(this.anchor)}static valid(Cr){let $r=Cr.parent;if($r.isTextblock||!closedBefore(Cr)||!closedAfter(Cr))return!1;let Ar=$r.type.spec.allowGapCursor;if(Ar!=null)return Ar;let Rr=$r.contentMatchAt(Cr.index()).defaultType;return Rr&&Rr.isTextblock}static findGapCursorFrom(Cr,$r,Ar=!1){e:for(;;){if(!Ar&&GapCursor.valid(Cr))return Cr;let Rr=Cr.pos,Dr=null;for(let Mr=Cr.depth;;Mr--){let Br=Cr.node(Mr);if($r>0?Cr.indexAfter(Mr)0){Dr=Br.child($r>0?Cr.indexAfter(Mr):Cr.index(Mr)-1);break}else if(Mr==0)return null;Rr+=$r;let Nr=Cr.doc.resolve(Rr);if(GapCursor.valid(Nr))return Nr}for(;;){let Mr=$r>0?Dr.firstChild:Dr.lastChild;if(!Mr){if(Dr.isAtom&&!Dr.isText&&!NodeSelection.isSelectable(Dr)){Cr=Cr.doc.resolve(Rr+Dr.nodeSize*$r),Ar=!1;continue e}break}Dr=Mr,Rr+=$r;let Br=Cr.doc.resolve(Rr);if(GapCursor.valid(Br))return Br}return null}}}GapCursor.prototype.visible=!1;GapCursor.findFrom=GapCursor.findGapCursorFrom;Selection.jsonID("gapcursor",GapCursor);class GapBookmark{constructor(Cr){this.pos=Cr}map(Cr){return new GapBookmark(Cr.map(this.pos))}resolve(Cr){let $r=Cr.resolve(this.pos);return GapCursor.valid($r)?new GapCursor($r):Selection.near($r)}}function closedBefore(Tr){for(let Cr=Tr.depth;Cr>=0;Cr--){let $r=Tr.index(Cr),Ar=Tr.node(Cr);if($r==0){if(Ar.type.spec.isolating)return!0;continue}for(let Rr=Ar.child($r-1);;Rr=Rr.lastChild){if(Rr.childCount==0&&!Rr.inlineContent||Rr.isAtom||Rr.type.spec.isolating)return!0;if(Rr.inlineContent)return!1}}return!0}function closedAfter(Tr){for(let Cr=Tr.depth;Cr>=0;Cr--){let $r=Tr.indexAfter(Cr),Ar=Tr.node(Cr);if($r==Ar.childCount){if(Ar.type.spec.isolating)return!0;continue}for(let Rr=Ar.child($r);;Rr=Rr.firstChild){if(Rr.childCount==0&&!Rr.inlineContent||Rr.isAtom||Rr.type.spec.isolating)return!0;if(Rr.inlineContent)return!1}}return!0}function gapCursor(){return new Plugin({props:{decorations:drawGapCursor,createSelectionBetween(Tr,Cr,$r){return Cr.pos==$r.pos&&GapCursor.valid($r)?new GapCursor($r):null},handleClick,handleKeyDown,handleDOMEvents:{beforeinput}}})}const handleKeyDown=keydownHandler({ArrowLeft:arrow("horiz",-1),ArrowRight:arrow("horiz",1),ArrowUp:arrow("vert",-1),ArrowDown:arrow("vert",1)});function arrow(Tr,Cr){const $r=Tr=="vert"?Cr>0?"down":"up":Cr>0?"right":"left";return function(Ar,Rr,Dr){let Mr=Ar.selection,Br=Cr>0?Mr.$to:Mr.$from,Nr=Mr.empty;if(Mr instanceof TextSelection){if(!Dr.endOfTextblock($r)||Br.depth==0)return!1;Nr=!1,Br=Ar.doc.resolve(Cr>0?Br.after():Br.before())}let Lr=GapCursor.findGapCursorFrom(Br,Cr,Nr);return Lr?(Rr&&Rr(Ar.tr.setSelection(new GapCursor(Lr))),!0):!1}}function handleClick(Tr,Cr,$r){if(!Tr||!Tr.editable)return!1;let Ar=Tr.state.doc.resolve(Cr);if(!GapCursor.valid(Ar))return!1;let Rr=Tr.posAtCoords({left:$r.clientX,top:$r.clientY});return Rr&&Rr.inside>-1&&NodeSelection.isSelectable(Tr.state.doc.nodeAt(Rr.inside))?!1:(Tr.dispatch(Tr.state.tr.setSelection(new GapCursor(Ar))),!0)}function beforeinput(Tr,Cr){if(Cr.inputType!="insertCompositionText"||!(Tr.state.selection instanceof GapCursor))return!1;let{$from:$r}=Tr.state.selection,Ar=$r.parent.contentMatchAt($r.index()).findWrapping(Tr.state.schema.nodes.text);if(!Ar)return!1;let Rr=Fragment.empty;for(let Mr=Ar.length-1;Mr>=0;Mr--)Rr=Fragment.from(Ar[Mr].createAndFill(null,Rr));let Dr=Tr.state.tr.replace($r.pos,$r.pos,new Slice(Rr,0,0));return Dr.setSelection(TextSelection.near(Dr.doc.resolve($r.pos+1))),Tr.dispatch(Dr),!1}function drawGapCursor(Tr){if(!(Tr.selection instanceof GapCursor))return null;let Cr=document.createElement("div");return Cr.className="ProseMirror-gapcursor",DecorationSet.create(Tr.doc,[Decoration.widget(Tr.selection.head,Cr,{key:"gapcursor"})])}const Gapcursor=Extension.create({name:"gapCursor",addProseMirrorPlugins(){return[gapCursor()]},extendNodeSchema(Tr){var Cr;const $r={name:Tr.name,options:Tr.options,storage:Tr.storage};return{allowGapCursor:(Cr=callOrReturn(getExtensionField(Tr,"allowGapCursor",$r)))!==null&&Cr!==void 0?Cr:null}}}),HardBreak$2=Node$1.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:Tr}){return["br",mergeAttributes(this.options.HTMLAttributes,Tr)]},renderText(){return` `},addCommands(){return{setHardBreak:()=>({commands:Tr,chain:Cr,state:$r,editor:Ar})=>Tr.first([()=>Tr.exitCode(),()=>Tr.command(()=>{const{selection:Rr,storedMarks:Dr}=$r;if(Rr.$from.parent.type.spec.isolating)return!1;const{keepMarks:Mr}=this.options,{splittableMarks:Br}=Ar.extensionManager,Nr=Dr||Rr.$to.parentOffset&&Rr.$from.marks();return Cr().insertContent({type:this.name}).command(({tr:Lr,dispatch:Hr})=>{if(Hr&&Nr&&Mr){const zr=Nr.filter(Ur=>Br.includes(Ur.type.name));Lr.ensureMarks(zr)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Heading$2=Node$1.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(Tr=>({tag:`h${Tr}`,attrs:{level:Tr}}))},renderHTML({node:Tr,HTMLAttributes:Cr}){return[`h${this.options.levels.includes(Tr.attrs.level)?Tr.attrs.level:this.options.levels[0]}`,mergeAttributes(this.options.HTMLAttributes,Cr),0]},addCommands(){return{setHeading:Tr=>({commands:Cr})=>this.options.levels.includes(Tr.level)?Cr.setNode(this.name,Tr):!1,toggleHeading:Tr=>({commands:Cr})=>this.options.levels.includes(Tr.level)?Cr.toggleNode(this.name,"paragraph",Tr):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((Tr,Cr)=>({...Tr,[`Mod-Alt-${Cr}`]:()=>this.editor.commands.toggleHeading({level:Cr})}),{})},addInputRules(){return this.options.levels.map(Tr=>textblockTypeInputRule({find:new RegExp(`^(#{1,${Tr}})\\s$`),type:this.type,getAttributes:{level:Tr}}))}});var GOOD_LEAF_SIZE=200,RopeSequence=function(){};RopeSequence.prototype.append=function(Cr){return Cr.length?(Cr=RopeSequence.from(Cr),!this.length&&Cr||Cr.length=$r?RopeSequence.empty:this.sliceInner(Math.max(0,Cr),Math.min(this.length,$r))};RopeSequence.prototype.get=function(Cr){if(!(Cr<0||Cr>=this.length))return this.getInner(Cr)};RopeSequence.prototype.forEach=function(Cr,$r,Ar){$r===void 0&&($r=0),Ar===void 0&&(Ar=this.length),$r<=Ar?this.forEachInner(Cr,$r,Ar,0):this.forEachInvertedInner(Cr,$r,Ar,0)};RopeSequence.prototype.map=function(Cr,$r,Ar){$r===void 0&&($r=0),Ar===void 0&&(Ar=this.length);var Rr=[];return this.forEach(function(Dr,Mr){return Rr.push(Cr(Dr,Mr))},$r,Ar),Rr};RopeSequence.from=function(Cr){return Cr instanceof RopeSequence?Cr:Cr&&Cr.length?new Leaf(Cr):RopeSequence.empty};var Leaf=function(Tr){function Cr(Ar){Tr.call(this),this.values=Ar}Tr&&(Cr.__proto__=Tr),Cr.prototype=Object.create(Tr&&Tr.prototype),Cr.prototype.constructor=Cr;var $r={length:{configurable:!0},depth:{configurable:!0}};return Cr.prototype.flatten=function(){return this.values},Cr.prototype.sliceInner=function(Rr,Dr){return Rr==0&&Dr==this.length?this:new Cr(this.values.slice(Rr,Dr))},Cr.prototype.getInner=function(Rr){return this.values[Rr]},Cr.prototype.forEachInner=function(Rr,Dr,Mr,Br){for(var Nr=Dr;Nr=Mr;Nr--)if(Rr(this.values[Nr],Br+Nr)===!1)return!1},Cr.prototype.leafAppend=function(Rr){if(this.length+Rr.length<=GOOD_LEAF_SIZE)return new Cr(this.values.concat(Rr.flatten()))},Cr.prototype.leafPrepend=function(Rr){if(this.length+Rr.length<=GOOD_LEAF_SIZE)return new Cr(Rr.flatten().concat(this.values))},$r.length.get=function(){return this.values.length},$r.depth.get=function(){return 0},Object.defineProperties(Cr.prototype,$r),Cr}(RopeSequence);RopeSequence.empty=new Leaf([]);var Append=function(Tr){function Cr($r,Ar){Tr.call(this),this.left=$r,this.right=Ar,this.length=$r.length+Ar.length,this.depth=Math.max($r.depth,Ar.depth)+1}return Tr&&(Cr.__proto__=Tr),Cr.prototype=Object.create(Tr&&Tr.prototype),Cr.prototype.constructor=Cr,Cr.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},Cr.prototype.getInner=function(Ar){return ArBr&&this.right.forEachInner(Ar,Math.max(Rr-Br,0),Math.min(this.length,Dr)-Br,Mr+Br)===!1)return!1},Cr.prototype.forEachInvertedInner=function(Ar,Rr,Dr,Mr){var Br=this.left.length;if(Rr>Br&&this.right.forEachInvertedInner(Ar,Rr-Br,Math.max(Dr,Br)-Br,Mr+Br)===!1||Dr=Dr?this.right.slice(Ar-Dr,Rr-Dr):this.left.slice(Ar,Dr).append(this.right.slice(0,Rr-Dr))},Cr.prototype.leafAppend=function(Ar){var Rr=this.right.leafAppend(Ar);if(Rr)return new Cr(this.left,Rr)},Cr.prototype.leafPrepend=function(Ar){var Rr=this.left.leafPrepend(Ar);if(Rr)return new Cr(Rr,this.right)},Cr.prototype.appendInner=function(Ar){return this.left.depth>=Math.max(this.right.depth,Ar.depth)+1?new Cr(this.left,new Cr(this.right,Ar)):new Cr(this,Ar)},Cr}(RopeSequence);const max_empty_items=500;class Branch{constructor(Cr,$r){this.items=Cr,this.eventCount=$r}popEvent(Cr,$r){if(this.eventCount==0)return null;let Ar=this.items.length;for(;;Ar--)if(this.items.get(Ar-1).selection){--Ar;break}let Rr,Dr;$r&&(Rr=this.remapping(Ar,this.items.length),Dr=Rr.maps.length);let Mr=Cr.tr,Br,Nr,Lr=[],Hr=[];return this.items.forEach((zr,Ur)=>{if(!zr.step){Rr||(Rr=this.remapping(Ar,Ur+1),Dr=Rr.maps.length),Dr--,Hr.push(zr);return}if(Rr){Hr.push(new Item(zr.map));let Vr=zr.step.map(Rr.slice(Dr)),jr;Vr&&Mr.maybeStep(Vr).doc&&(jr=Mr.mapping.maps[Mr.mapping.maps.length-1],Lr.push(new Item(jr,void 0,void 0,Lr.length+Hr.length))),Dr--,jr&&Rr.appendMap(jr,Dr)}else Mr.maybeStep(zr.step);if(zr.selection)return Br=Rr?zr.selection.map(Rr.slice(Dr)):zr.selection,Nr=new Branch(this.items.slice(0,Ar).append(Hr.reverse().concat(Lr)),this.eventCount-1),!1},this.items.length,0),{remaining:Nr,transform:Mr,selection:Br}}addTransform(Cr,$r,Ar,Rr){let Dr=[],Mr=this.eventCount,Br=this.items,Nr=!Rr&&Br.length?Br.get(Br.length-1):null;for(let Hr=0;HrDEPTH_OVERFLOW&&(Br=cutOffEvents(Br,Lr),Mr-=Lr),new Branch(Br.append(Dr),Mr)}remapping(Cr,$r){let Ar=new Mapping;return this.items.forEach((Rr,Dr)=>{let Mr=Rr.mirrorOffset!=null&&Dr-Rr.mirrorOffset>=Cr?Ar.maps.length-Rr.mirrorOffset:void 0;Ar.appendMap(Rr.map,Mr)},Cr,$r),Ar}addMaps(Cr){return this.eventCount==0?this:new Branch(this.items.append(Cr.map($r=>new Item($r))),this.eventCount)}rebased(Cr,$r){if(!this.eventCount)return this;let Ar=[],Rr=Math.max(0,this.items.length-$r),Dr=Cr.mapping,Mr=Cr.steps.length,Br=this.eventCount;this.items.forEach(Ur=>{Ur.selection&&Br--},Rr);let Nr=$r;this.items.forEach(Ur=>{let Vr=Dr.getMirror(--Nr);if(Vr==null)return;Mr=Math.min(Mr,Vr);let jr=Dr.maps[Vr];if(Ur.step){let Gr=Cr.steps[Vr].invert(Cr.docs[Vr]),Xr=Ur.selection&&Ur.selection.map(Dr.slice(Nr+1,Vr));Xr&&Br++,Ar.push(new Item(jr,Gr,Xr))}else Ar.push(new Item(jr))},Rr);let Lr=[];for(let Ur=$r;Urmax_empty_items&&(zr=zr.compress(this.items.length-Ar.length)),zr}emptyItemCount(){let Cr=0;return this.items.forEach($r=>{$r.step||Cr++}),Cr}compress(Cr=this.items.length){let $r=this.remapping(0,Cr),Ar=$r.maps.length,Rr=[],Dr=0;return this.items.forEach((Mr,Br)=>{if(Br>=Cr)Rr.push(Mr),Mr.selection&&Dr++;else if(Mr.step){let Nr=Mr.step.map($r.slice(Ar)),Lr=Nr&&Nr.getMap();if(Ar--,Lr&&$r.appendMap(Lr,Ar),Nr){let Hr=Mr.selection&&Mr.selection.map($r.slice(Ar));Hr&&Dr++;let zr=new Item(Lr.invert(),Nr,Hr),Ur,Vr=Rr.length-1;(Ur=Rr.length&&Rr[Vr].merge(zr))?Rr[Vr]=Ur:Rr.push(zr)}}else Mr.map&&Ar--},this.items.length,0),new Branch(RopeSequence.from(Rr.reverse()),Dr)}}Branch.empty=new Branch(RopeSequence.empty,0);function cutOffEvents(Tr,Cr){let $r;return Tr.forEach((Ar,Rr)=>{if(Ar.selection&&Cr--==0)return $r=Rr,!1}),Tr.slice($r)}class Item{constructor(Cr,$r,Ar,Rr){this.map=Cr,this.step=$r,this.selection=Ar,this.mirrorOffset=Rr}merge(Cr){if(this.step&&Cr.step&&!Cr.selection){let $r=Cr.step.merge(this.step);if($r)return new Item($r.getMap().invert(),$r,this.selection)}}}class HistoryState{constructor(Cr,$r,Ar,Rr,Dr){this.done=Cr,this.undone=$r,this.prevRanges=Ar,this.prevTime=Rr,this.prevComposition=Dr}}const DEPTH_OVERFLOW=20;function applyTransaction(Tr,Cr,$r,Ar){let Rr=$r.getMeta(historyKey),Dr;if(Rr)return Rr.historyState;$r.getMeta(closeHistoryKey)&&(Tr=new HistoryState(Tr.done,Tr.undone,null,0,-1));let Mr=$r.getMeta("appendedTransaction");if($r.steps.length==0)return Tr;if(Mr&&Mr.getMeta(historyKey))return Mr.getMeta(historyKey).redo?new HistoryState(Tr.done.addTransform($r,void 0,Ar,mustPreserveItems(Cr)),Tr.undone,rangesFor($r.mapping.maps[$r.steps.length-1]),Tr.prevTime,Tr.prevComposition):new HistoryState(Tr.done,Tr.undone.addTransform($r,void 0,Ar,mustPreserveItems(Cr)),null,Tr.prevTime,Tr.prevComposition);if($r.getMeta("addToHistory")!==!1&&!(Mr&&Mr.getMeta("addToHistory")===!1)){let Br=$r.getMeta("composition"),Nr=Tr.prevTime==0||!Mr&&Tr.prevComposition!=Br&&(Tr.prevTime<($r.time||0)-Ar.newGroupDelay||!isAdjacentTo($r,Tr.prevRanges)),Lr=Mr?mapRanges(Tr.prevRanges,$r.mapping):rangesFor($r.mapping.maps[$r.steps.length-1]);return new HistoryState(Tr.done.addTransform($r,Nr?Cr.selection.getBookmark():void 0,Ar,mustPreserveItems(Cr)),Branch.empty,Lr,$r.time,Br??Tr.prevComposition)}else return(Dr=$r.getMeta("rebased"))?new HistoryState(Tr.done.rebased($r,Dr),Tr.undone.rebased($r,Dr),mapRanges(Tr.prevRanges,$r.mapping),Tr.prevTime,Tr.prevComposition):new HistoryState(Tr.done.addMaps($r.mapping.maps),Tr.undone.addMaps($r.mapping.maps),mapRanges(Tr.prevRanges,$r.mapping),Tr.prevTime,Tr.prevComposition)}function isAdjacentTo(Tr,Cr){if(!Cr)return!1;if(!Tr.docChanged)return!0;let $r=!1;return Tr.mapping.maps[0].forEach((Ar,Rr)=>{for(let Dr=0;Dr=Cr[Dr]&&($r=!0)}),$r}function rangesFor(Tr){let Cr=[];return Tr.forEach(($r,Ar,Rr,Dr)=>Cr.push(Rr,Dr)),Cr}function mapRanges(Tr,Cr){if(!Tr)return null;let $r=[];for(let Ar=0;Ar{let $r=historyKey.getState(Tr);return!$r||$r.done.eventCount==0?!1:(Cr&&histTransaction($r,Tr,Cr,!1),!0)},redo=(Tr,Cr)=>{let $r=historyKey.getState(Tr);return!$r||$r.undone.eventCount==0?!1:(Cr&&histTransaction($r,Tr,Cr,!0),!0)},History=Extension.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:Tr,dispatch:Cr})=>undo(Tr,Cr),redo:()=>({state:Tr,dispatch:Cr})=>redo(Tr,Cr)}},addProseMirrorPlugins(){return[history$1(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),HorizontalRule$2=Node$1.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:Tr}){return["hr",mergeAttributes(this.options.HTMLAttributes,Tr)]},addCommands(){return{setHorizontalRule:()=>({chain:Tr,state:Cr})=>{const{$to:$r}=Cr.selection,Ar=Tr();return $r.parentOffset===0?Ar.insertContentAt(Math.max($r.pos-2,0),{type:this.name}):Ar.insertContent({type:this.name}),Ar.command(({tr:Rr,dispatch:Dr})=>{var Mr;if(Dr){const{$to:Br}=Rr.selection,Nr=Br.end();if(Br.nodeAfter)Br.nodeAfter.isTextblock?Rr.setSelection(TextSelection.create(Rr.doc,Br.pos+1)):Br.nodeAfter.isBlock?Rr.setSelection(NodeSelection.create(Rr.doc,Br.pos)):Rr.setSelection(TextSelection.create(Rr.doc,Br.pos));else{const Lr=(Mr=Br.parent.type.contentMatch.defaultType)===null||Mr===void 0?void 0:Mr.create();Lr&&(Rr.insert(Nr,Lr),Rr.setSelection(TextSelection.create(Rr.doc,Nr+1)))}Rr.scrollIntoView()}return!0}).run()}}},addInputRules(){return[nodeInputRule({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),StarterKit=Extension.create({name:"starterKit",addExtensions(){var Tr,Cr,$r,Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr,zr,Ur,Vr,jr,Gr,Xr,Kr;const Zr=[];return this.options.blockquote!==!1&&Zr.push(Blockquote$2.configure((Tr=this.options)===null||Tr===void 0?void 0:Tr.blockquote)),this.options.bold!==!1&&Zr.push(Bold$2.configure((Cr=this.options)===null||Cr===void 0?void 0:Cr.bold)),this.options.bulletList!==!1&&Zr.push(BulletList$2.configure(($r=this.options)===null||$r===void 0?void 0:$r.bulletList)),this.options.code!==!1&&Zr.push(Code$2.configure((Ar=this.options)===null||Ar===void 0?void 0:Ar.code)),this.options.codeBlock!==!1&&Zr.push(CodeBlock$2.configure((Rr=this.options)===null||Rr===void 0?void 0:Rr.codeBlock)),this.options.document!==!1&&Zr.push(Document$1.configure((Dr=this.options)===null||Dr===void 0?void 0:Dr.document)),this.options.dropcursor!==!1&&Zr.push(Dropcursor.configure((Mr=this.options)===null||Mr===void 0?void 0:Mr.dropcursor)),this.options.gapcursor!==!1&&Zr.push(Gapcursor.configure((Br=this.options)===null||Br===void 0?void 0:Br.gapcursor)),this.options.hardBreak!==!1&&Zr.push(HardBreak$2.configure((Nr=this.options)===null||Nr===void 0?void 0:Nr.hardBreak)),this.options.heading!==!1&&Zr.push(Heading$2.configure((Lr=this.options)===null||Lr===void 0?void 0:Lr.heading)),this.options.history!==!1&&Zr.push(History.configure((Hr=this.options)===null||Hr===void 0?void 0:Hr.history)),this.options.horizontalRule!==!1&&Zr.push(HorizontalRule$2.configure((zr=this.options)===null||zr===void 0?void 0:zr.horizontalRule)),this.options.italic!==!1&&Zr.push(Italic$2.configure((Ur=this.options)===null||Ur===void 0?void 0:Ur.italic)),this.options.listItem!==!1&&Zr.push(ListItem$2.configure((Vr=this.options)===null||Vr===void 0?void 0:Vr.listItem)),this.options.orderedList!==!1&&Zr.push(OrderedList$2.configure((jr=this.options)===null||jr===void 0?void 0:jr.orderedList)),this.options.paragraph!==!1&&Zr.push(Paragraph$2.configure((Gr=this.options)===null||Gr===void 0?void 0:Gr.paragraph)),this.options.strike!==!1&&Zr.push(Strike$2.configure((Xr=this.options)===null||Xr===void 0?void 0:Xr.strike)),this.options.text!==!1&&Zr.push(Text$3.configure((Kr=this.options)===null||Kr===void 0?void 0:Kr.text)),Zr}}),encodedTlds="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",encodedUtlds="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",assign$4=(Tr,Cr)=>{for(const $r in Cr)Tr[$r]=Cr[$r];return Tr},numeric="numeric",ascii="ascii",alpha$1="alpha",asciinumeric="asciinumeric",alphanumeric="alphanumeric",domain="domain",emoji="emoji",scheme="scheme",slashscheme="slashscheme",whitespace="whitespace";function registerGroup(Tr,Cr){return Tr in Cr||(Cr[Tr]=[]),Cr[Tr]}function addToGroups(Tr,Cr,$r){Cr[numeric]&&(Cr[asciinumeric]=!0,Cr[alphanumeric]=!0),Cr[ascii]&&(Cr[asciinumeric]=!0,Cr[alpha$1]=!0),Cr[asciinumeric]&&(Cr[alphanumeric]=!0),Cr[alpha$1]&&(Cr[alphanumeric]=!0),Cr[alphanumeric]&&(Cr[domain]=!0),Cr[emoji]&&(Cr[domain]=!0);for(const Ar in Cr){const Rr=registerGroup(Ar,$r);Rr.indexOf(Tr)<0&&Rr.push(Tr)}}function flagsForToken(Tr,Cr){const $r={};for(const Ar in Cr)Cr[Ar].indexOf(Tr)>=0&&($r[Ar]=!0);return $r}function State(Tr){Tr===void 0&&(Tr=null),this.j={},this.jr=[],this.jd=null,this.t=Tr}State.groups={};State.prototype={accepts(){return!!this.t},go(Tr){const Cr=this,$r=Cr.j[Tr];if($r)return $r;for(let Ar=0;ArTr.ta(Cr,$r,Ar,Rr),tr=(Tr,Cr,$r,Ar,Rr)=>Tr.tr(Cr,$r,Ar,Rr),ts=(Tr,Cr,$r,Ar,Rr)=>Tr.ts(Cr,$r,Ar,Rr),tt=(Tr,Cr,$r,Ar,Rr)=>Tr.tt(Cr,$r,Ar,Rr),WORD="WORD",UWORD="UWORD",LOCALHOST="LOCALHOST",TLD="TLD",UTLD="UTLD",SCHEME="SCHEME",SLASH_SCHEME="SLASH_SCHEME",NUM="NUM",WS="WS",NL$1="NL",OPENBRACE="OPENBRACE",CLOSEBRACE="CLOSEBRACE",OPENBRACKET="OPENBRACKET",CLOSEBRACKET="CLOSEBRACKET",OPENPAREN="OPENPAREN",CLOSEPAREN="CLOSEPAREN",OPENANGLEBRACKET="OPENANGLEBRACKET",CLOSEANGLEBRACKET="CLOSEANGLEBRACKET",FULLWIDTHLEFTPAREN="FULLWIDTHLEFTPAREN",FULLWIDTHRIGHTPAREN="FULLWIDTHRIGHTPAREN",LEFTCORNERBRACKET="LEFTCORNERBRACKET",RIGHTCORNERBRACKET="RIGHTCORNERBRACKET",LEFTWHITECORNERBRACKET="LEFTWHITECORNERBRACKET",RIGHTWHITECORNERBRACKET="RIGHTWHITECORNERBRACKET",FULLWIDTHLESSTHAN="FULLWIDTHLESSTHAN",FULLWIDTHGREATERTHAN="FULLWIDTHGREATERTHAN",AMPERSAND="AMPERSAND",APOSTROPHE$2="APOSTROPHE",ASTERISK="ASTERISK",AT="AT",BACKSLASH="BACKSLASH",BACKTICK="BACKTICK",CARET="CARET",COLON="COLON",COMMA="COMMA",DOLLAR="DOLLAR",DOT="DOT",EQUALS="EQUALS",EXCLAMATION="EXCLAMATION",HYPHEN="HYPHEN",PERCENT="PERCENT",PIPE="PIPE",PLUS="PLUS",POUND="POUND",QUERY="QUERY",QUOTE="QUOTE",SEMI="SEMI",SLASH="SLASH",TILDE="TILDE",UNDERSCORE="UNDERSCORE",EMOJI$1="EMOJI",SYM="SYM";var tk=Object.freeze({__proto__:null,WORD,UWORD,LOCALHOST,TLD,UTLD,SCHEME,SLASH_SCHEME,NUM,WS,NL:NL$1,OPENBRACE,CLOSEBRACE,OPENBRACKET,CLOSEBRACKET,OPENPAREN,CLOSEPAREN,OPENANGLEBRACKET,CLOSEANGLEBRACKET,FULLWIDTHLEFTPAREN,FULLWIDTHRIGHTPAREN,LEFTCORNERBRACKET,RIGHTCORNERBRACKET,LEFTWHITECORNERBRACKET,RIGHTWHITECORNERBRACKET,FULLWIDTHLESSTHAN,FULLWIDTHGREATERTHAN,AMPERSAND,APOSTROPHE:APOSTROPHE$2,ASTERISK,AT,BACKSLASH,BACKTICK,CARET,COLON,COMMA,DOLLAR,DOT,EQUALS,EXCLAMATION,HYPHEN,PERCENT,PIPE,PLUS,POUND,QUERY,QUOTE,SEMI,SLASH,TILDE,UNDERSCORE,EMOJI:EMOJI$1,SYM});const ASCII_LETTER=/[a-z]/,LETTER=/\p{L}/u,EMOJI=/\p{Emoji}/u,DIGIT=/\d/,SPACE$1=/\s/,NL=` `,EMOJI_VARIATION="️",EMOJI_JOINER="‍";let tlds=null,utlds=null;function init$2(Tr){Tr===void 0&&(Tr=[]);const Cr={};State.groups=Cr;const $r=new State;tlds==null&&(tlds=decodeTlds(encodedTlds)),utlds==null&&(utlds=decodeTlds(encodedUtlds)),tt($r,"'",APOSTROPHE$2),tt($r,"{",OPENBRACE),tt($r,"}",CLOSEBRACE),tt($r,"[",OPENBRACKET),tt($r,"]",CLOSEBRACKET),tt($r,"(",OPENPAREN),tt($r,")",CLOSEPAREN),tt($r,"<",OPENANGLEBRACKET),tt($r,">",CLOSEANGLEBRACKET),tt($r,"(",FULLWIDTHLEFTPAREN),tt($r,")",FULLWIDTHRIGHTPAREN),tt($r,"「",LEFTCORNERBRACKET),tt($r,"」",RIGHTCORNERBRACKET),tt($r,"『",LEFTWHITECORNERBRACKET),tt($r,"』",RIGHTWHITECORNERBRACKET),tt($r,"<",FULLWIDTHLESSTHAN),tt($r,">",FULLWIDTHGREATERTHAN),tt($r,"&",AMPERSAND),tt($r,"*",ASTERISK),tt($r,"@",AT),tt($r,"`",BACKTICK),tt($r,"^",CARET),tt($r,":",COLON),tt($r,",",COMMA),tt($r,"$",DOLLAR),tt($r,".",DOT),tt($r,"=",EQUALS),tt($r,"!",EXCLAMATION),tt($r,"-",HYPHEN),tt($r,"%",PERCENT),tt($r,"|",PIPE),tt($r,"+",PLUS),tt($r,"#",POUND),tt($r,"?",QUERY),tt($r,'"',QUOTE),tt($r,"/",SLASH),tt($r,";",SEMI),tt($r,"~",TILDE),tt($r,"_",UNDERSCORE),tt($r,"\\",BACKSLASH);const Ar=tr($r,DIGIT,NUM,{[numeric]:!0});tr(Ar,DIGIT,Ar);const Rr=tr($r,ASCII_LETTER,WORD,{[ascii]:!0});tr(Rr,ASCII_LETTER,Rr);const Dr=tr($r,LETTER,UWORD,{[alpha$1]:!0});tr(Dr,ASCII_LETTER),tr(Dr,LETTER,Dr);const Mr=tr($r,SPACE$1,WS,{[whitespace]:!0});tt($r,NL,NL$1,{[whitespace]:!0}),tt(Mr,NL),tr(Mr,SPACE$1,Mr);const Br=tr($r,EMOJI,EMOJI$1,{[emoji]:!0});tr(Br,EMOJI,Br),tt(Br,EMOJI_VARIATION,Br);const Nr=tt(Br,EMOJI_JOINER);tr(Nr,EMOJI,Br);const Lr=[[ASCII_LETTER,Rr]],Hr=[[ASCII_LETTER,null],[LETTER,Dr]];for(let zr=0;zrzr[0]>Ur[0]?1:-1);for(let zr=0;zr=0?jr[domain]=!0:ASCII_LETTER.test(Ur)?DIGIT.test(Ur)?jr[asciinumeric]=!0:jr[ascii]=!0:jr[numeric]=!0,ts($r,Ur,Ur,jr)}return ts($r,"localhost",LOCALHOST,{ascii:!0}),$r.jd=new State(SYM),{start:$r,tokens:assign$4({groups:Cr},tk)}}function run$1(Tr,Cr){const $r=stringToArray(Cr.replace(/[A-Z]/g,Br=>Br.toLowerCase())),Ar=$r.length,Rr=[];let Dr=0,Mr=0;for(;Mr=0&&(zr+=$r[Mr].length,Ur++),Lr+=$r[Mr].length,Dr+=$r[Mr].length,Mr++;Dr-=zr,Mr-=Ur,Lr-=zr,Rr.push({t:Hr.t,v:Cr.slice(Dr-Lr,Dr),s:Dr-Lr,e:Dr})}return Rr}function stringToArray(Tr){const Cr=[],$r=Tr.length;let Ar=0;for(;Ar<$r;){let Rr=Tr.charCodeAt(Ar),Dr,Mr=Rr<55296||Rr>56319||Ar+1===$r||(Dr=Tr.charCodeAt(Ar+1))<56320||Dr>57343?Tr[Ar]:Tr.slice(Ar,Ar+2);Cr.push(Mr),Ar+=Mr.length}return Cr}function fastts(Tr,Cr,$r,Ar,Rr){let Dr;const Mr=Cr.length;for(let Br=0;Br=0;)Dr++;if(Dr>0){Cr.push($r.join(""));for(let Mr=parseInt(Tr.substring(Ar,Ar+Dr),10);Mr>0;Mr--)$r.pop();Ar+=Dr}else $r.push(Tr[Ar]),Ar++}return Cr}const defaults={defaultProtocol:"http",events:null,format:noop,formatHref:noop,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Options(Tr,Cr){Cr===void 0&&(Cr=null);let $r=assign$4({},defaults);Tr&&($r=assign$4($r,Tr instanceof Options?Tr.o:Tr));const Ar=$r.ignoreTags,Rr=[];for(let Dr=0;Dr$r?Ar.substring(0,$r)+"…":Ar},toFormattedHref(Tr){return Tr.get("formatHref",this.toHref(Tr.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(Tr){return Tr===void 0&&(Tr=defaults.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(Tr),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(Tr){return{type:this.t,value:this.toFormattedString(Tr),isLink:this.isLink,href:this.toFormattedHref(Tr),start:this.startIndex(),end:this.endIndex()}},validate(Tr){return Tr.get("validate",this.toString(),this)},render(Tr){const Cr=this,$r=this.toHref(Tr.get("defaultProtocol")),Ar=Tr.get("formatHref",$r,this),Rr=Tr.get("tagName",$r,Cr),Dr=this.toFormattedString(Tr),Mr={},Br=Tr.get("className",$r,Cr),Nr=Tr.get("target",$r,Cr),Lr=Tr.get("rel",$r,Cr),Hr=Tr.getObj("attributes",$r,Cr),zr=Tr.getObj("events",$r,Cr);return Mr.href=Ar,Br&&(Mr.class=Br),Nr&&(Mr.target=Nr),Lr&&(Mr.rel=Lr),Hr&&assign$4(Mr,Hr),{tagName:Rr,attributes:Mr,content:Dr,eventListeners:zr}}};function createTokenClass(Tr,Cr){class $r extends MultiToken{constructor(Rr,Dr){super(Rr,Dr),this.t=Tr}}for(const Ar in Cr)$r.prototype[Ar]=Cr[Ar];return $r.t=Tr,$r}const Email=createTokenClass("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Text$2=createTokenClass("text"),Nl=createTokenClass("nl"),Url$2=createTokenClass("url",{isLink:!0,toHref(Tr){return Tr===void 0&&(Tr=defaults.defaultProtocol),this.hasProtocol()?this.v:`${Tr}://${this.v}`},hasProtocol(){const Tr=this.tk;return Tr.length>=2&&Tr[0].t!==LOCALHOST&&Tr[1].t===COLON}}),makeState=Tr=>new State(Tr);function init$1(Tr){let{groups:Cr}=Tr;const $r=Cr.domain.concat([AMPERSAND,ASTERISK,AT,BACKSLASH,BACKTICK,CARET,DOLLAR,EQUALS,HYPHEN,NUM,PERCENT,PIPE,PLUS,POUND,SLASH,SYM,TILDE,UNDERSCORE]),Ar=[APOSTROPHE$2,COLON,COMMA,DOT,EXCLAMATION,QUERY,QUOTE,SEMI,OPENANGLEBRACKET,CLOSEANGLEBRACKET,OPENBRACE,CLOSEBRACE,CLOSEBRACKET,OPENBRACKET,OPENPAREN,CLOSEPAREN,FULLWIDTHLEFTPAREN,FULLWIDTHRIGHTPAREN,LEFTCORNERBRACKET,RIGHTCORNERBRACKET,LEFTWHITECORNERBRACKET,RIGHTWHITECORNERBRACKET,FULLWIDTHLESSTHAN,FULLWIDTHGREATERTHAN],Rr=[AMPERSAND,APOSTROPHE$2,ASTERISK,BACKSLASH,BACKTICK,CARET,DOLLAR,EQUALS,HYPHEN,OPENBRACE,CLOSEBRACE,PERCENT,PIPE,PLUS,POUND,QUERY,SLASH,SYM,TILDE,UNDERSCORE],Dr=makeState(),Mr=tt(Dr,TILDE);ta(Mr,Rr,Mr),ta(Mr,Cr.domain,Mr);const Br=makeState(),Nr=makeState(),Lr=makeState();ta(Dr,Cr.domain,Br),ta(Dr,Cr.scheme,Nr),ta(Dr,Cr.slashscheme,Lr),ta(Br,Rr,Mr),ta(Br,Cr.domain,Br);const Hr=tt(Br,AT);tt(Mr,AT,Hr),tt(Nr,AT,Hr),tt(Lr,AT,Hr);const zr=tt(Mr,DOT);ta(zr,Rr,Mr),ta(zr,Cr.domain,Mr);const Ur=makeState();ta(Hr,Cr.domain,Ur),ta(Ur,Cr.domain,Ur);const Vr=tt(Ur,DOT);ta(Vr,Cr.domain,Ur);const jr=makeState(Email);ta(Vr,Cr.tld,jr),ta(Vr,Cr.utld,jr),tt(Hr,LOCALHOST,jr);const Gr=tt(Ur,HYPHEN);ta(Gr,Cr.domain,Ur),ta(jr,Cr.domain,Ur),tt(jr,DOT,Vr),tt(jr,HYPHEN,Gr);const Xr=tt(jr,COLON);ta(Xr,Cr.numeric,Email);const Kr=tt(Br,HYPHEN),Zr=tt(Br,DOT);ta(Kr,Cr.domain,Br),ta(Zr,Rr,Mr),ta(Zr,Cr.domain,Br);const eo=makeState(Url$2);ta(Zr,Cr.tld,eo),ta(Zr,Cr.utld,eo),ta(eo,Cr.domain,Br),ta(eo,Rr,Mr),tt(eo,DOT,Zr),tt(eo,HYPHEN,Kr),tt(eo,AT,Hr);const Wr=tt(eo,COLON),Yr=makeState(Url$2);ta(Wr,Cr.numeric,Yr);const Jr=makeState(Url$2),no=makeState();ta(Jr,$r,Jr),ta(Jr,Ar,no),ta(no,$r,Jr),ta(no,Ar,no),tt(eo,SLASH,Jr),tt(Yr,SLASH,Jr);const ro=tt(Nr,COLON),so=tt(Lr,COLON),ao=tt(so,SLASH),lo=tt(ao,SLASH);ta(Nr,Cr.domain,Br),tt(Nr,DOT,Zr),tt(Nr,HYPHEN,Kr),ta(Lr,Cr.domain,Br),tt(Lr,DOT,Zr),tt(Lr,HYPHEN,Kr),ta(ro,Cr.domain,Jr),tt(ro,SLASH,Jr),ta(lo,Cr.domain,Jr),ta(lo,$r,Jr),tt(lo,SLASH,Jr);const po=[[OPENBRACE,CLOSEBRACE],[OPENBRACKET,CLOSEBRACKET],[OPENPAREN,CLOSEPAREN],[OPENANGLEBRACKET,CLOSEANGLEBRACKET],[FULLWIDTHLEFTPAREN,FULLWIDTHRIGHTPAREN],[LEFTCORNERBRACKET,RIGHTCORNERBRACKET],[LEFTWHITECORNERBRACKET,RIGHTWHITECORNERBRACKET],[FULLWIDTHLESSTHAN,FULLWIDTHGREATERTHAN]];for(let go=0;go=0&&Ur++,Rr++,Hr++;if(Ur<0)Rr-=Hr,Rr0&&(Dr.push(initMultiToken(Text$2,Cr,Mr)),Mr=[]),Rr-=Ur,Hr-=Ur;const Vr=zr.t,jr=$r.slice(Rr-Hr,Rr);Dr.push(initMultiToken(Vr,Cr,jr))}}return Mr.length>0&&Dr.push(initMultiToken(Text$2,Cr,Mr)),Dr}function initMultiToken(Tr,Cr,$r){const Ar=$r[0].s,Rr=$r[$r.length-1].e,Dr=Cr.slice(Ar,Rr);return new Tr(Dr,$r)}const warn=typeof console<"u"&&console&&console.warn||(()=>{}),warnAdvice="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",INIT={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function reset(){State.groups={},INIT.scanner=null,INIT.parser=null,INIT.tokenQueue=[],INIT.pluginQueue=[],INIT.customSchemes=[],INIT.initialized=!1}function registerCustomProtocol(Tr,Cr){if(Cr===void 0&&(Cr=!1),INIT.initialized&&warn(`linkifyjs: already initialized - will not register custom scheme "${Tr}" ${warnAdvice}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(Tr))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" 3. "-" cannot repeat`);INIT.customSchemes.push([Tr,Cr])}function init(){INIT.scanner=init$2(INIT.customSchemes);for(let Tr=0;Tr{const Rr=Cr.some(Lr=>Lr.docChanged)&&!$r.doc.eq(Ar.doc),Dr=Cr.some(Lr=>Lr.getMeta("preventAutolink"));if(!Rr||Dr)return;const{tr:Mr}=Ar,Br=combineTransactionSteps($r.doc,[...Cr]);if(getChangedRanges(Br).forEach(({newRange:Lr})=>{const Hr=findChildrenInRange(Ar.doc,Lr,Vr=>Vr.isTextblock);let zr,Ur;if(Hr.length>1?(zr=Hr[0],Ur=Ar.doc.textBetween(zr.pos,zr.pos+zr.node.nodeSize,void 0," ")):Hr.length&&Ar.doc.textBetween(Lr.from,Lr.to," "," ").endsWith(" ")&&(zr=Hr[0],Ur=Ar.doc.textBetween(zr.pos,Lr.to,void 0," ")),zr&&Ur){const Vr=Ur.split(" ").filter(Xr=>Xr!=="");if(Vr.length<=0)return!1;const jr=Vr[Vr.length-1],Gr=zr.pos+Ur.lastIndexOf(jr);if(!jr)return!1;find(jr).filter(Xr=>Xr.isLink).map(Xr=>({...Xr,from:Gr+Xr.start+1,to:Gr+Xr.end+1})).filter(Xr=>Ar.schema.marks.code?!Ar.doc.rangeHasMark(Xr.from,Xr.to,Ar.schema.marks.code):!0).filter(Xr=>Tr.validate?Tr.validate(Xr.value):!0).forEach(Xr=>{getMarksBetween(Xr.from,Xr.to,Ar.doc).some(Kr=>Kr.mark.type===Tr.type)||Mr.addMark(Xr.from,Xr.to,Tr.type.create({href:Xr.href}))})}}),!!Mr.steps.length)return Mr}})}function clickHandler(Tr){return new Plugin({key:new PluginKey("handleClickLink"),props:{handleClick:(Cr,$r,Ar)=>{var Rr,Dr;if(Ar.button!==0)return!1;const Mr=getAttributes(Cr.state,Tr.type.name),Br=Ar.target,Nr=(Rr=Br==null?void 0:Br.href)!==null&&Rr!==void 0?Rr:Mr.href,Lr=(Dr=Br==null?void 0:Br.target)!==null&&Dr!==void 0?Dr:Mr.target;return Br&&Nr?(Cr.editable&&window.open(Nr,Lr),!0):!1}}})}function pasteHandler(Tr){return new Plugin({key:new PluginKey("handlePasteLink"),props:{handlePaste:(Cr,$r,Ar)=>{var Rr,Dr;const{state:Mr}=Cr,{selection:Br}=Mr;if(Mr.doc.resolve(Br.from).parent.type.spec.code)return!1;let Nr="";Ar.content.forEach(Zr=>{Nr+=Zr.textContent});let Lr=!1;if(Ar.content.descendants(Zr=>{Zr.marks.some(eo=>eo.type.name===Tr.type.name)&&(Lr=!0)}),Lr)return;const Hr=find(Nr).find(Zr=>Zr.isLink&&Zr.value===Nr);if(!Br.empty&&Tr.linkOnPaste){const Zr=(Hr==null?void 0:Hr.href)||null;if(Zr)return Tr.editor.commands.setMark(Tr.type,{href:Zr}),!0}const zr=((Rr=Ar.content.firstChild)===null||Rr===void 0?void 0:Rr.type.name)==="text",Ur=(Dr=Ar.content.firstChild)===null||Dr===void 0?void 0:Dr.marks.some(Zr=>Zr.type.name===Tr.type.name);if(zr&&Ur||!Tr.linkOnPaste)return!1;if(Hr&&Br.empty)return Tr.editor.commands.insertContent(`${Hr.href}`),!0;const{tr:Vr}=Mr;let jr=!1;Br.empty||(jr=!0,Vr.delete(Br.from,Br.to));let Gr=Br.from,Xr=[];Ar.content.forEach(Zr=>{Xr=find(Zr.textContent),Vr.insert(Gr-1,Zr),Xr.length>0&&(jr=!1,Xr.forEach(eo=>{const Wr=Gr+eo.start,Yr=Gr+eo.end;Vr.doc.rangeHasMark(Wr,Yr,Tr.type)||Vr.addMark(Wr,Yr,Tr.type.create({href:eo.href}))})),Gr+=Zr.nodeSize});const Kr=Xr.length>0;return Vr.docChanged&&!jr&&Kr?(Tr.editor.view.dispatch(Vr),!0):!1}}})}const Link$2=Mark.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(Tr=>{if(typeof Tr=="string"){registerCustomProtocol(Tr);return}registerCustomProtocol(Tr.scheme,Tr.optionalSlashes)})},onDestroy(){reset()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:Tr}){return["a",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{setLink:Tr=>({chain:Cr})=>Cr().setMark(this.name,Tr).setMeta("preventAutolink",!0).run(),toggleLink:Tr=>({chain:Cr})=>Cr().toggleMark(this.name,Tr,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:Tr})=>Tr().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addProseMirrorPlugins(){const Tr=[];return this.options.autolink&&Tr.push(autolink$2({type:this.type,validate:this.options.validate})),this.options.openOnClick&&Tr.push(clickHandler({type:this.type})),Tr.push(pasteHandler({editor:this.editor,type:this.type,linkOnPaste:this.options.linkOnPaste})),Tr}}),inputRegex$1=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,pasteRegex$1=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,Highlight$1=Mark.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:Tr=>Tr.getAttribute("data-color")||Tr.style.backgroundColor,renderHTML:Tr=>Tr.color?{"data-color":Tr.color,style:`background-color: ${Tr.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:Tr}){return["mark",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{setHighlight:Tr=>({commands:Cr})=>Cr.setMark(this.name,Tr),toggleHighlight:Tr=>({commands:Cr})=>Cr.toggleMark(this.name,Tr),unsetHighlight:()=>({commands:Tr})=>Tr.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[markInputRule({find:inputRegex$1,type:this.type})]},addPasteRules(){return[markPasteRule({find:pasteRegex$1,type:this.type})]}}),emDash=Tr=>textInputRule({find:/--$/,replace:Tr??"—"}),ellipsis=Tr=>textInputRule({find:/\.\.\.$/,replace:Tr??"…"}),openDoubleQuote=Tr=>textInputRule({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:Tr??"“"}),closeDoubleQuote=Tr=>textInputRule({find:/"$/,replace:Tr??"”"}),openSingleQuote=Tr=>textInputRule({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:Tr??"‘"}),closeSingleQuote=Tr=>textInputRule({find:/'$/,replace:Tr??"’"}),leftArrow=Tr=>textInputRule({find:/<-$/,replace:Tr??"←"}),rightArrow=Tr=>textInputRule({find:/->$/,replace:Tr??"→"}),copyright=Tr=>textInputRule({find:/\(c\)$/,replace:Tr??"©"}),trademark=Tr=>textInputRule({find:/\(tm\)$/,replace:Tr??"™"}),servicemark=Tr=>textInputRule({find:/\(sm\)$/,replace:Tr??"℠"}),registeredTrademark=Tr=>textInputRule({find:/\(r\)$/,replace:Tr??"®"}),oneHalf=Tr=>textInputRule({find:/(?:^|\s)(1\/2)$/,replace:Tr??"½"}),plusMinus=Tr=>textInputRule({find:/\+\/-$/,replace:Tr??"±"}),notEqual=Tr=>textInputRule({find:/!=$/,replace:Tr??"≠"}),laquo$1=Tr=>textInputRule({find:/<<$/,replace:Tr??"«"}),raquo$1=Tr=>textInputRule({find:/>>$/,replace:Tr??"»"}),multiplication=Tr=>textInputRule({find:/\d+\s?([*x])\s?\d+$/,replace:Tr??"×"}),superscriptTwo=Tr=>textInputRule({find:/\^2$/,replace:Tr??"²"}),superscriptThree=Tr=>textInputRule({find:/\^3$/,replace:Tr??"³"}),oneQuarter=Tr=>textInputRule({find:/(?:^|\s)(1\/4)$/,replace:Tr??"¼"}),threeQuarters=Tr=>textInputRule({find:/(?:^|\s)(3\/4)$/,replace:Tr??"¾"}),Typography=Extension.create({name:"typography",addInputRules(){const Tr=[];return this.options.emDash!==!1&&Tr.push(emDash(this.options.emDash)),this.options.ellipsis!==!1&&Tr.push(ellipsis(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&Tr.push(openDoubleQuote(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&Tr.push(closeDoubleQuote(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&Tr.push(openSingleQuote(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&Tr.push(closeSingleQuote(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&Tr.push(leftArrow(this.options.leftArrow)),this.options.rightArrow!==!1&&Tr.push(rightArrow(this.options.rightArrow)),this.options.copyright!==!1&&Tr.push(copyright(this.options.copyright)),this.options.trademark!==!1&&Tr.push(trademark(this.options.trademark)),this.options.servicemark!==!1&&Tr.push(servicemark(this.options.servicemark)),this.options.registeredTrademark!==!1&&Tr.push(registeredTrademark(this.options.registeredTrademark)),this.options.oneHalf!==!1&&Tr.push(oneHalf(this.options.oneHalf)),this.options.plusMinus!==!1&&Tr.push(plusMinus(this.options.plusMinus)),this.options.notEqual!==!1&&Tr.push(notEqual(this.options.notEqual)),this.options.laquo!==!1&&Tr.push(laquo$1(this.options.laquo)),this.options.raquo!==!1&&Tr.push(raquo$1(this.options.raquo)),this.options.multiplication!==!1&&Tr.push(multiplication(this.options.multiplication)),this.options.superscriptTwo!==!1&&Tr.push(superscriptTwo(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&Tr.push(superscriptThree(this.options.superscriptThree)),this.options.oneQuarter!==!1&&Tr.push(oneQuarter(this.options.oneQuarter)),this.options.threeQuarters!==!1&&Tr.push(threeQuarters(this.options.threeQuarters)),Tr}}),TextAlign=Extension.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:Tr=>Tr.style.textAlign||this.options.defaultAlignment,renderHTML:Tr=>Tr.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${Tr.textAlign}`}}}}]},addCommands(){return{setTextAlign:Tr=>({commands:Cr})=>this.options.alignments.includes(Tr)?this.options.types.every($r=>Cr.updateAttributes($r,{textAlign:Tr})):!1,unsetTextAlign:()=>({commands:Tr})=>this.options.types.every(Cr=>Tr.resetAttributes(Cr,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),constructTiptapContentFromJSON=Tr=>Tr==null?"":typeof Tr=="string"?Tr:generateText(Tr,[StarterKit,TextStyle$2,Link$2,Highlight$1,TitleNode]),constructTitptapJSONFromContent=Tr=>{if(typeof Tr=="object")return Tr;const Cr=`

${Tr}

`;return generateJSON(Cr,[Document$1,Paragraph$2,Text$3,BulletList$2,OrderedList$2,ListItem$2,Bold$2,Italic$2,Strike$2,Highlight$1,HardBreak$2,Typography,TextAlign,TitleNode])},isTextEmbed=Tr=>(Tr==null?void 0:Tr.type)==="text",isCoverTitleEmbed=Tr=>{var Cr,$r;return(($r=(Cr=Tr==null?void 0:Tr.config)==null?void 0:Cr.textType)==null?void 0:$r.selectedId)==="coverTitle"},isTitleEmbed=Tr=>{var Cr,$r;return(($r=(Cr=Tr==null?void 0:Tr.config)==null?void 0:Cr.textType)==null?void 0:$r.selectedId)==="title"},isHeadingEmbed=Tr=>{var Cr,$r;return(($r=(Cr=Tr==null?void 0:Tr.config)==null?void 0:Cr.textType)==null?void 0:$r.selectedId)==="heading"},isSmallHeadingEmbed=Tr=>{var Cr,$r;return(($r=(Cr=Tr==null?void 0:Tr.config)==null?void 0:Cr.textType)==null?void 0:$r.selectedId)==="subheading"},isSubtitleEmbed=Tr=>{var Cr,$r;return(($r=(Cr=Tr==null?void 0:Tr.config)==null?void 0:Cr.textType)==null?void 0:$r.selectedId)==="subtitle"},isCaptionEmbed=Tr=>{var Cr,$r;return(($r=(Cr=Tr==null?void 0:Tr.config)==null?void 0:Cr.textType)==null?void 0:$r.selectedId)==="caption"},isImageEmbed=Tr=>(Tr==null?void 0:Tr.type)==="image",isShapeEmbed=Tr=>(Tr==null?void 0:Tr.type)==="shape",isCollectionEmbed=Tr=>(Tr==null?void 0:Tr.type)==="collection",isTableEmbed=Tr=>(Tr==null?void 0:Tr.type)==="table",isDividerEmbed=Tr=>(Tr==null?void 0:Tr.type)==="divider",isWebpageEmbed=Tr=>(Tr==null?void 0:Tr.type)==="webpage",isBookmarkEmbed=Tr=>(Tr==null?void 0:Tr.type)==="bookmark",isEmbedEmpty=Tr=>{var Cr,$r,Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr,zr,Ur,Vr,jr,Gr,Xr,Kr,Zr;if(isTextEmbed(Tr)){if(($r=(Cr=Tr==null?void 0:Tr.config)==null?void 0:Cr.icon)!=null&&$r.show||((Rr=(Ar=Tr==null?void 0:Tr.config)==null?void 0:Ar.icon)==null?void 0:Rr.show)===void 0&&((Mr=(Dr=Tr==null?void 0:Tr.config)==null?void 0:Dr.icon)!=null&&Mr.image||(Nr=(Br=Tr==null?void 0:Tr.config)==null?void 0:Br.icon)!=null&&Nr.emoji))return!1;try{const eo=constructTiptapContentFromJSON((Hr=(Lr=Tr==null?void 0:Tr.config)==null?void 0:Lr.content)==null?void 0:Hr.value);return((Ur=(zr=Tr==null?void 0:Tr.config)==null?void 0:zr.content)==null?void 0:Ur.value)===""||eo.trim()===""}catch{return((jr=(Vr=Tr==null?void 0:Tr.config)==null?void 0:Vr.content)==null?void 0:jr.value)===""}}return isImageEmbed(Tr)?((Xr=(Gr=Tr==null?void 0:Tr.config)==null?void 0:Gr.source)==null?void 0:Xr.value)==null||((Zr=(Kr=Tr==null?void 0:Tr.config)==null?void 0:Kr.source)==null?void 0:Zr.value)==="":(isShapeEmbed(Tr),!1)},useDeleteBlockWrapper=Tr=>{const{selectedBlockId:Cr}=Tr;if(Cr.value==null)return;const $r=useBlockStore();$r.parentId(Cr.value)!=null&&($r.deleteBlock(Cr.value),Cr.value=null)},useDuplicateBlockWrapper=async Tr=>{const{selectedBlockId:Cr,editingBlockId:$r,addViaPaste:Ar=!1,prevSelectedBlockId:Rr}=Tr;if(Cr.value==null)return;const Dr=useBlockStore();Dr.type(Cr.value);const Mr=Lr=>{useEditorStore(),Cr.value=Lr};if(Dr.parentId(Cr.value)==null)return;const Nr=await Dr.duplicateBlock({id:Ar&&Rr||Cr.value,sideEffectFn:Mr});Cr.value=Nr},useFixSlideAfterAddingBlock=async Tr=>{await sleep(basicFlexLogic.WAIT_TIME_FOR_BLOCK_RENDER_AFTER_ADDING_BLOCK),await groupSize.fixSlideIfRequired({slideId:Tr,addingNewBlock:!0})},useAddBlockWrapper=async Tr=>{const{selectedBlockId:Cr,editingBlockId:$r,slideId:Ar,type:Rr="text",config:Dr,prevSelectedBlockId:Mr,addViaPaste:Br}=Tr,Nr=Xr=>{const Kr=useEditorStore();Kr.blockIdToFocus=Xr,Cr.value=Xr,Rr==="text"&&($r!=null&&$r.value)&&($r.value=Xr)},Lr=useBlockStore(),Hr=Rr==="text"?"heading":"ai",zr=Mr||Cr.value,Ur=zr?basicFlexLogic.getParentGroupId({itemId:zr,slideId:Ar}):null;let Vr=-1;Ur&&(Vr=groupCRUD.getIndexOfItemInGroup({id:zr,slideId:Ar,groupId:Ur}),Vr>=0&&(Vr+=1)),Br&&(Vr=-1);const jr=await Lr.createBlock({parent_id:Ar,type:Rr,subtype:Hr,configObject:Dr,sideEffectFn:Nr,groupIdForNewBlock:Ur,indexInGroup:Vr});Br&&await useFixSlideAfterAddingBlock(Ar),Cr.value=jr,Rr==="text"&&($r!=null&&$r.value)&&($r.value=jr);const Gr=document.querySelector(`*[data-block-id="${jr}"]`);if(Gr){const{scrollIntoView:Xr}=useScrollIntoView({update:()=>{}});Xr({elRef:toRef$1(Gr)})}return jr},useCopyBlockWrapper=Tr=>{const{selectedBlockId:Cr,updateCopiedState:$r}=Tr;Cr.value!=null&&$r({prezoObj:!0,value:[{type:"block",id:Cr.value,object:useBlockStore().blockObject(Cr.value)}]})},usePasteBlockWrapper=async Tr=>{var Nr;const{selectedBlockId:Cr,copiedState:$r,selectedPageId:Ar,currentAppId:Rr}=Tr,Dr=useBlockStore();if($r.value.length===0||$r.value[0]==null||$r.value[0].type!=="block"||Rr.value==null||Ar.value==null)return;const Mr=(Nr=$r.value[0])==null?void 0:Nr.id;if(Mr==null)return;let Br=Dr.blockObject(Mr);if((Br==null?void 0:Br.id)==null){const{data:Lr,error:Hr}=await fetchBlock(Mr);if(Hr||!Lr)return;Dr.hydrate([Lr]),Br=Lr}if(Br!=null){if(Br.parent_id!==Ar.value){useAddBlockWrapper({selectedBlockId:Cr,slideId:Ar.value,type:Br.type,config:Br.config,addViaPaste:!0,prevSelectedBlockId:Mr});return}useDuplicateBlockWrapper({selectedBlockId:Cr,slideId:Ar.value,type:Br.type,config:Br.config,addViaPaste:!0,prevSelectedBlockId:Mr})}},cleanupAfterPasteTable=()=>{const Tr=useMiscStore();Tr.incrementUniversalTableKey(),setTimeout(()=>{Tr.setPastingTable(!1)},1e3)},addColsIfNeeded=(Tr,Cr,$r)=>{for(let Ar=0;Ar{Dr[Mr]={value:null,style:{}}}),$r.cellStore.value.store[Rr]=Dr}},deleteColsIfNeeded=(Tr,Cr)=>{if(Cr.colStore.value.order.length>Tr){for(let $r=Tr;$r{for(let Dr=0;Dr=Rr.rowStore.value.order.length){const Hr=guid();Rr.rowStore.value.order.push(Hr),Rr.rowStore.value.store[Hr]={id:Hr,isHidden:!1,style:{}}}const Nr=Rr.rowStore.value.order[Br],Lr=constructTitptapJSONFromContent(Ar[Br][Dr]);Lr.content[0].attrs={textAlign:"left"},Rr.cellStore.value.store[Mr][Nr]={value:Lr,style:{}}}}},calcRowsPerPage=(Tr,Cr,$r)=>{const Ar=[[0,0]];let Rr=0,Dr=Tr;return $r.rowStore.value.order.forEach(async(Mr,Br)=>{const Nr=document.getElementById(`row-${Mr}`);if(Nr){const Lr=Nr.getBoundingClientRect().height;if(Ar[Rr][0]!==Ar[Rr][1]&&Dr+Lr>Cr){const Hr=Ar[Rr][1]+1;Rr+=1,Ar.push([Hr,Hr]),Dr=Lr+Tr}else Ar[Rr][1]=Br,Dr+=Lr+Tr}}),Ar},rmExtraRowsAndCells=(Tr,Cr,$r,Ar,Rr)=>{$r.value.order.slice(0,Tr).forEach(Mr=>{delete $r.value.store[Mr],Rr.colStore.value.order.forEach(Br=>{delete Ar.value.store[Br][Mr]})});const Dr=Cr+1;$r.value.order.slice(Dr).forEach(Mr=>{delete $r.value.store[Mr],Rr.colStore.value.order.forEach(Br=>{delete Ar.value.store[Br][Mr]})}),$r.value.order=$r.value.order.slice(Tr,Dr)},createTableForEachPage=(Tr,Cr,$r,Ar,Rr,Dr)=>{const Mr=useBlockStore(),Br=usePageStore();$r.forEach(async([Nr,Lr],Hr)=>{const zr=lodashExports.cloneDeep(Ar.rowStore),Ur=lodashExports.cloneDeep(Ar.cellStore);if(rmExtraRowsAndCells(Nr,Lr,zr,Ur,Ar),Hr){const Vr=Br.dupPageHelper({id:Cr});if(!Vr){cleanupAfterPasteTable();return}const{newSlide:jr,newBlocks:Gr,blockIdMap:Xr}=Vr,Kr=Gr.findIndex(Zr=>Zr.id===Xr[Tr]);if(Kr===-1){console.error("Something went wrong while duplicating page",Cr,jr,Gr,Xr,Tr,Xr[Tr]),cleanupAfterPasteTable();return}Gr[Kr].config||(Gr[Kr].config=Ar),Gr[Kr].config.rowStore=zr,Gr[Kr].config.cellStore=Ur,Dr.push(jr),Rr.push(...Gr)}else{const Vr=lodashExports.cloneDeep(Mr.blockObject(Tr));if(!Vr.config){console.error("Encountered malformed table embed while updating contents",Vr,Tr),cleanupAfterPasteTable();return}Vr.config.rowStore=zr,Vr.config.cellStore=Ur,Rr.push(Vr),Dr.push(Br.pageObject(Cr))}})},usePasteTableOG=async({appId:Tr,selectedBlockId:Cr,selectedPageId:$r,tsv:Ar})=>{var po,go;useMiscStore().setPastingTable(!0);const Dr=usePageStore(),Mr=useBlockStore();let Br=!1;if(!$r.value){const co=await Dr.createSlide({deckId:Tr.value,skipUndo:!0});$r.value=co,Br=!0}const Nr=lodashExports.cloneDeep(Dr.pageObject($r.value));Br?Nr.is_deleted=!0:Nr.is_deleted=!1;let Lr=Dr.children($r.value).map(co=>lodashExports.cloneDeep(Mr.blockObject(co)));const Hr=useAppStore(),zr=$r.value,Ur=Hr.children(Tr.value).findIndex(co=>co===zr),Vr=Ar.length;if(!Vr){cleanupAfterPasteTable();return}const jr=Math.min(Ar[0].length,8);if(!jr){cleanupAfterPasteTable();return}let Gr=!1,Xr=Cr.value;const Kr=Mr.blockObject(Xr);if(!Xr||Kr.is_deleted||!isTableEmbed(Kr)){const co=lodashExports.cloneDeep(defaultConfig$3);Xr=await Mr.createBlock({parent_id:zr,type:"table",subtype:"user",configObject:co,skipUndo:!1}),Gr=!0}const Zr=lodashExports.cloneDeep(Mr.blockObject(Xr));Gr?Zr.is_deleted=!0:(Zr.is_deleted=!1,Lr=Lr.filter(co=>co.id!==Zr.id));const eo=lodashExports.cloneDeep(Mr.config(Xr)),Wr=lodashExports.cloneDeep(eo);if(!Wr){console.error("Malformed table embed",Xr),cleanupAfterPasteTable();return}const Yr=960/jr;addColsIfNeeded(jr,Yr,Wr),deleteColsIfNeeded(jr,Wr),fillContentAddRows(Vr,jr,Yr,Ar,Wr),Mr.updateProps(Xr,{keyPath:["config"],value:Wr,skipUndo:!0}),await nextTick();const Jr=(go=(po=document.getElementById(`tableBlock-${Xr}`))==null?void 0:po.getBoundingClientRect())==null?void 0:go.height;if(!Jr){Mr.updateProps(Xr,{keyPath:["config"],value:eo,skipUndo:!0}),cleanupAfterPasteTable();return}const no=document.getElementById(`mainTable-${Xr}`);if(!no){console.error(`Can't find tables for block ${Xr}`),cleanupAfterPasteTable();return}const ro=parseInt(no.style.gap,10),so=calcRowsPerPage(ro,Jr,Wr),ao=[],lo=[];createTableForEachPage(Xr,zr,so,Wr,lo,ao),await Dr.upsertSlides({deckId:Tr.value,upsertedSlides:ao,upsertedBlocks:lo,ogFirstTableBlock:Zr,ogFirstSlide:Nr,ogFirstSlideChildren:Lr,startInd:Ur+1}),ao.length>1&&Hr.setNotif(Tr.value,{text:"Table rows overflowed to new page",showEmoji:!1,persistent:!1,isProminent:!1,showInProgress:!1,showTag:!1}),cleanupAfterPasteTable()},usePasteTable=async({appId:Tr,selectedBlockId:Cr,selectedPageId:$r,tsv:Ar})=>{var Jr,no;if(!isEnabled("infiniteCanvas")){await usePasteTableOG({appId:Tr,selectedBlockId:Cr,selectedPageId:$r,tsv:Ar});return}useMiscStore().setPastingTable(!0);const Dr=usePageStore(),Mr=useBlockStore();let Br=!1;if(!$r.value){const ro=await Dr.createSlide({deckId:Tr.value,skipUndo:!0});$r.value=ro,Br=!0}const Nr=lodashExports.cloneDeep(Dr.pageObject($r.value));Br?Nr.is_deleted=!0:Nr.is_deleted=!1;let Lr=Dr.children($r.value).map(ro=>lodashExports.cloneDeep(Mr.blockObject(ro)));const Hr=useAppStore(),zr=$r.value;Hr.children(Tr.value).findIndex(ro=>ro===zr);const Ur=Ar.length;if(!Ur){cleanupAfterPasteTable();return}const Vr=Math.min(Ar[0].length,8);if(!Vr){cleanupAfterPasteTable();return}let jr=!1,Gr=Cr.value;const Xr=Mr.blockObject(Gr);if(!Gr||Xr.is_deleted||!isTableEmbed(Xr)){const ro=lodashExports.cloneDeep(defaultConfig$3);Gr=await Mr.createBlock({parent_id:zr,type:"table",subtype:"user",configObject:ro,skipUndo:!1}),jr=!0}const Kr=lodashExports.cloneDeep(Mr.blockObject(Gr));jr?Kr.is_deleted=!0:(Kr.is_deleted=!1,Lr=Lr.filter(ro=>ro.id!==Kr.id));const Zr=lodashExports.cloneDeep(Mr.config(Gr)),eo=lodashExports.cloneDeep(Zr);if(!eo){console.error("Malformed table embed",Gr),cleanupAfterPasteTable();return}const Wr=960/Vr;if(addColsIfNeeded(Vr,Wr,eo),deleteColsIfNeeded(Vr,eo),fillContentAddRows(Ur,Vr,Wr,Ar,eo),eo.aiResultId={id:"aiResultId",value:guid()},Mr.updateProps(Gr,{keyPath:["config"],value:eo,skipUndo:!0}),await nextTick(),await useFixSlideAfterAddingBlock($r.value),!((no=(Jr=document.getElementById(`tableBlock-${Gr}`))==null?void 0:Jr.getBoundingClientRect())==null?void 0:no.height)){Mr.updateProps(Gr,{keyPath:["config"],value:Zr,skipUndo:!0}),cleanupAfterPasteTable();return}cleanupAfterPasteTable()},corePasteSlideFlow=async({slideIdToCopy:Tr,deckIdOfSlideIdToCopy:Cr,appId:$r,selectedPageId:Ar,updateFocusedPageId:Rr})=>{if(Tr==null||$r==null||Ar.value==null)return;const Dr=useBlockStore(),Mr=usePageStore(),Br=useAppStore();let Nr=Mr.pageObject(Tr);if((Nr==null?void 0:Nr.id)==null){const{data:Vr,error:jr}=await Br.fetchEntireDeckNew(Cr);if(jr||!Vr||!Vr[0]){console.error(`Failed to fetch deck ${Cr}`);return}const{slides:Gr}=Vr[0],Xr=Gr.find(Kr=>Kr.id===Tr);if(!Xr){console.error(`Failed to find slide ${Tr} to copy in deck ${Cr}`);return}Nr=Xr,Mr.hydrate(Gr),Dr.hydrate(Gr.flatMap(Kr=>Kr==null?void 0:Kr.blocks))}const Lr=Nr.parent_id!==$r,zr=Br.appObject($r).children.indexOf(Ar.value),Ur=await Mr.duplicatePage({id:Tr,newParentId:Lr?$r:void 0,index:zr+1});Ur&&!Lr&&(Rr(Ur),Ar.value=Ur)},usePasteSlideWrapper=async Tr=>{var Dr;const{updateFocusedPageId:Cr,copiedState:$r,currentAppId:Ar,selectedPageId:Rr}=Tr;if($r.value.length!==0&&$r.value[0]!=null)for(let Mr=0;Mr<$r.value.length;Mr+=1){if($r.value[Mr]==null)continue;const{type:Br}=$r.value[Mr];if(Br!=="slide")continue;const Nr=$r.value[Mr].id;await corePasteSlideFlow({slideIdToCopy:Nr,deckIdOfSlideIdToCopy:(Dr=$r.value[Mr])==null?void 0:Dr.deckId,appId:Ar.value,selectedPageId:Rr,updateFocusedPageId:Cr})}},useCopySlideWrapper=Tr=>{var Br;const{focusedPageId:Cr,highlightedPageIds:$r,selectedPageId:Ar,updateCopiedState:Rr}=Tr,Dr=Cr.value??Ar.value;if(Dr==null)return;const Mr=(Br=Tr.currentAppId)==null?void 0:Br.value;if($r.value.length>0&&$r.value.includes(Dr)){Rr({prezoObj:!0,value:$r.value.map(Nr=>({type:"slide",id:Nr,deckId:Mr}))});return}Rr({prezoObj:!0,value:[{type:"slide",id:Dr,deckId:Mr}]})},useDeletePageWrapper=async Tr=>{var Nr;const{focusedPageId:Cr,updateFocusedPageId:$r,selectedPageId:Ar,currentAppId:Rr}=Tr;if(Cr.value==null||useAppStore().children(Rr.value).length<=1)return;const Br=await usePageStore().deletePage(Cr.value,(Nr=Tr.currentAppId)==null?void 0:Nr.value);setTimeout(()=>{Ar.value=Br,$r(Ar.value)},ANIMATIONS.leftPane.enabled?ANIMATIONS.leftPane.duration:0)},useDuplicatePageWrapper=async Tr=>{const{focusedPageId:Cr,updateFocusedPageId:$r,selectedPageId:Ar,currentAppId:Rr}=Tr;if(Cr.value==null||Rr.value==null)return;const Dr=useAppStore(),Mr=usePageStore();Ar.value=await Mr.duplicatePage({id:Cr.value,index:Dr.children(Rr.value).indexOf(Ar.value)+1}),$r(Ar.value)},useBlockLayoutsStore=defineStore("blockLayoutsStore",{state:()=>({selected:null,layoutPrompts:{},templateDecks:{},inTestMode:!1,testSlide:void 0,singleBarToShow:null,calculatedGrps:{},generatingBlockDescriptions:{},inTemplateMode:!1}),getters:{bIdToGrpId:Tr=>Cr=>{var Ar,Rr;const $r={};return Object.entries(((Rr=(Ar=Tr.layoutPrompts[Cr])==null?void 0:Ar.config)==null?void 0:Rr.groups)??{}).forEach(([Dr,{blocks:Mr}])=>{Mr.forEach(Br=>{$r[Br.id]=Dr})}),$r},getBlockLayoutHash:Tr=>Cr=>{var Mr,Br,Nr,Lr;const $r=useBlockStore();if(!Cr||!Tr.inTemplateMode||!((Br=(Mr=$r.config(Cr).content)==null?void 0:Mr.value)!=null&&Br.content))return null;let Ar=$r.config(Cr).content.value.content.map(Hr=>{let zr="";return Hr.type==="heading"?zr+=`h${Hr.attrs.level}`:Hr.type==="bulletList"?zr+="ul":Hr.type==="orderedList"?zr+="ol":zr+="p",zr}).join(",");switch((Nr=$r.config(Cr).content.value.content[0])==null?void 0:Nr.attrs.textAlign){case"center":Ar+="C";break;case"right":Ar+="R";break;default:Ar+="L"}switch(((Lr=$r.config(Cr).verticalAlignment)==null?void 0:Lr.value)??"top"){case"top":return`${Ar}T`;case"center":return`${Ar}C`;default:return`${Ar}B`}}},actions:{setTemplateDeck(Tr){this.templateDecks[Tr.deck_id]=Tr},setInTemplateMode(Tr){this.inTemplateMode=Tr,Tr||(this.selected=null)},setLayoutPrompt(Tr){this.layoutPrompts[Tr.slide_id]=Tr},setLayoutPrompts(Tr){Tr.forEach(Cr=>{this.layoutPrompts[Cr.slide_id]=Cr})},setInTestMode(Tr){this.inTestMode=Tr},setTestSlide(Tr){this.testSlide=Tr},setSingleBarToShow(Tr){this.singleBarToShow=Tr},setCalculatedGrps(Tr){this.calculatedGrps=Tr},setGeneratingBlockDescriptions(Tr,Cr){this.generatingBlockDescriptions[Tr]=Cr}}}),cleanUpAfterUndoRedo=()=>{const Tr=useMiscStore();nextTick(()=>{Tr.setUndoRedoing(!1)})},applyUndoRedo=async({action:Tr,options:Cr,isUndo:$r=!0})=>{if(useBlockLayoutsStore().inTemplateMode)return;if(useMiscStore().setUndoRedoing(!0),!Tr){cleanUpAfterUndoRedo();return}const Rr=Tr.context;if(!Rr){cleanUpAfterUndoRedo();return}const Dr=$r?Rr.undo:Rr.redo;if(!Dr){cleanUpAfterUndoRedo();return}const Mr=Dr.changes;if(!Mr){cleanUpAfterUndoRedo();return}const Br=useAppStore(),Nr=usePageStore(),Lr=useBlockStore(),Hr={deck:Br,slide:Nr,block:Lr};useItemStore(),log("undo action",lodashExports.cloneDeep(Tr)),Mr.forEach(zr=>{const Ur=Hr[zr.type];if(!Ur)return;const Vr=zr.id;if(!Vr)return;const jr=zr.action;jr&&(jr==="updateProps"&&Ur.updateProps(Vr,{keyPath:zr.keyPath,value:zr.value,skipUndo:!0,saveInDatabase:!Rr.isTransaction,autoSave:!Rr.isTransaction}),jr==="hydrate"&&Ur.hydrate([zr.value]),jr==="selectSlide"&&Cr.selectedPageId&&(Cr.selectedPageId.value=Vr))}),Dr.transaction&&Rr.isTransaction&&await actionsCache.defer(lodashExports.cloneDeep(Dr.transaction)),cleanUpAfterUndoRedo()},takeUndoAction=Tr=>{const Cr=useUndoRedoStore(),$r=Cr.popFromUndo();$r&&(Cr.addToRedo($r),applyUndoRedo({action:$r,options:Tr,isUndo:!0}))},takeRedoAction=Tr=>{const Cr=useUndoRedoStore(),$r=Cr.popFromRedo();$r&&(Cr.addToUndo($r,!1),applyUndoRedo({action:$r,options:Tr,isUndo:!1}))},getPlatform=()=>IS_CLIENT?typeof navigator.userAgentData<"u"&&navigator.userAgentData!=null?navigator.userAgentData.platform:typeof navigator.platform<"u"?typeof navigator.userAgent<"u"&&/android/.test(navigator.userAgent.toLowerCase())?"android":navigator.platform:"unknown":"unknown",platform=getPlatform().toLowerCase(),isOSX=/mac/.test(platform),isIOS=["iphone","ipad","ipod"].indexOf(platform),isApple=isOSX||isIOS,usingTextOrInput=Tr=>{var Cr,$r,Ar,Rr,Dr,Mr,Br;return((Cr=Tr.value)==null?void 0:Cr.classList.contains("ProseMirror"))||(($r=Tr.value)==null?void 0:$r.classList.contains("input-container"))||((Ar=Tr.value)==null?void 0:Ar.classList.contains("input-field"))||((Rr=Tr.value)==null?void 0:Rr.tagName)==="INPUT"||((Dr=Tr.value)==null?void 0:Dr.tagName)==="TEXTAREA"||((Mr=Tr.value)==null?void 0:Mr.tagName)==="SELECT"||((Br=Tr.value)==null?void 0:Br.isContentEditable)},useBackspaceKey=Tr=>{const Cr=useActiveElement(),{backspace:$r}=useMagicKeys(),Ar=useMiscStore(),Rr=useAppStore();whenever($r,()=>{var Dr,Mr,Br;if(!Tr.inTemplateMode.value&&!Rr.isViewOnly(Tr.currentAppId.value)&&!usingTextOrInput(Cr)&&!Ar.getTableEditingState(Tr.selectedBlockId.value)){if(Tr.selectedBlockId.value||((Mr=(Dr=Tr.highlightedBlockIds)==null?void 0:Dr.value)==null?void 0:Mr.length)>0){useDeleteBlockWrapper({selectedBlockId:Tr.selectedBlockId,highlightedBlockIds:Tr.highlightedBlockIds,updateHighlightedBlockIds:Tr.updateHighlightedBlockIds});return}if(Tr.focusedPageId.value){const Lr=usePageStore().pageObject(Tr.selectedPageId.value).parent_id;useDeletePageWrapper({focusedPageId:Tr.focusedPageId,updateFocusedPageId:Tr.updateFocusedPageId,selectedPageId:Tr.selectedPageId,currentAppId:Tr.currentAppId}),Ir.capture("delete slide",{appId:Lr,slideId:(Br=Tr==null?void 0:Tr.selectedPageId)==null?void 0:Br.value})}}})},useEnterKey=Tr=>{const Cr=useActiveElement(),{enter:$r}=useMagicKeys();whenever($r,()=>{usingTextOrInput(Cr)})},useLeftKey=Tr=>{const Cr=useActiveElement();onKeyStroke("ArrowLeft",$r=>{usingTextOrInput(Cr)},{eventName:"keydown"}),onKeyStroke("ArrowLeft",$r=>{usingTextOrInput(Cr)},{eventName:"keyup"})},useRightKey=Tr=>{const Cr=useActiveElement();onKeyStroke("ArrowRight",$r=>{usingTextOrInput(Cr)},{eventName:"keydown"}),onKeyStroke("ArrowRight",$r=>{usingTextOrInput(Cr)},{eventName:"keyup"})},useUpKey=Tr=>{const Cr=useActiveElement();onKeyStroke("ArrowUp",$r=>{usingTextOrInput(Cr)},{eventName:"keydown"}),onKeyStroke("ArrowUp",$r=>{usingTextOrInput(Cr)},{eventName:"keyup"})},useDownKey=Tr=>{const Cr=useActiveElement();onKeyStroke("ArrowDown",$r=>{usingTextOrInput(Cr)},{eventName:"keydown"}),onKeyStroke("ArrowDown",$r=>{usingTextOrInput(Cr)},{eventName:"keyup"})},useEscKey=Tr=>{const Cr=useEditorStore(),$r=useMiscStore(),Ar=useCommandBarStore(),Rr=useActiveElement(),{escape:Dr}=useMagicKeys();whenever(Dr,()=>{if(usingTextOrInput(Rr))return;const{selectedBlockId:Mr,selectionMenuBlockId:Br,editingBlockId:Nr}=Tr;if(Cr.getLinkPreview.show){Cr.hideLinkPreview();return}if($r.getShowTemplateModal){$r.setShowTemplateModal({show:!1,addNew:!1});return}if($r.isTextIconPopupOpen?$r.setTextIconPopup({open:!1}):Mr.value&&(Cr.current&&Nr.value?(Nr.value=null,$r.setTextSelectionPopupOpen({open:!1})):(Br.value=null,Mr.value=null)),Ar.isCommandBarOpen){Ar.setCommandBarOpen(!1);return}})},useCommandEnterKey=Tr=>{const Cr=useActiveElement(),{current:$r}=useMagicKeys(),Ar=()=>{var Mr,Br,Nr;const Dr=isApple?"meta":"control";$r.has(Dr)&&(usingTextOrInput(Cr)||!((Mr=Tr.currentAppId)!=null&&Mr.value)||(Br=Tr.isMobile)!=null&&Br.value||Tr.showingFullPage&&!((Nr=Tr.showingFullScreen)!=null&&Nr.value)&&(Tr.showingFullPage.value=!0))};if(isApple){const{meta_enter:Dr}=useMagicKeys({passive:!1,onEventFired(Mr){Mr.metaKey&&Mr.key==="enter"&&Mr.type==="keydown"&&Mr.preventDefault()}});whenever(Dr,Ar);return}const{ctrl_enter:Rr}=useMagicKeys({passive:!1,onEventFired(Dr){Dr.ctrlKey&&Dr.key==="enter"&&Dr.type==="keydown"&&Dr.preventDefault()}});whenever(Rr,Ar)},useCommandKKey=Tr=>{const Cr=useActiveElement(),{current:$r}=useMagicKeys(),Ar=useMiscStore(),Rr=()=>{var Br;const Mr=isApple?"meta":"control";$r.has(Mr)&&(usingTextOrInput(Cr)||(Br=Tr.currentAppId)!=null&&Br.value||Ar.setShowSearchDialog(!0))};if(isApple){const{meta_k:Mr}=useMagicKeys({passive:!1,onEventFired(Br){Br.metaKey&&Br.key==="k"&&Br.type==="keydown"&&Br.preventDefault()}});whenever(Mr,Rr);return}const{ctrl_k:Dr}=useMagicKeys({passive:!1,onEventFired(Mr){Mr.ctrlKey&&Mr.key==="k"&&Mr.type==="keydown"&&Mr.preventDefault()}});whenever(Dr,Rr)},useCommandDKey=Tr=>{const Cr=useActiveElement(),{current:$r}=useMagicKeys(),Ar=useAppStore(),Rr=()=>{var Mr,Br;const Dr=isApple?"meta":"control";if($r.has(Dr)&&!$r.has("alt")&&!Tr.inTemplateMode.value&&!usingTextOrInput(Cr)&&!Ar.isViewOnly(Tr.currentAppId.value)&&!(Tr.showingFullPage&&Tr.showingFullPage.value)){if(Tr.selectedBlockId.value||((Br=(Mr=Tr.highlightedBlockIds)==null?void 0:Mr.value)==null?void 0:Br.length)>0){useDuplicateBlockWrapper(Tr);return}Tr.focusedPageId.value&&useDuplicatePageWrapper(Tr)}};if(isApple){useMagicKeys({passive:!1,onEventFired(Dr){Dr.metaKey&&Dr.key==="d"&&Dr.type==="keydown"&&!Dr.altKey&&Dr.preventDefault()}}),onKeyStroke("d",Rr,{dedupe:!0,eventName:"keydown"});return}useMagicKeys({passive:!1,onEventFired(Dr){Dr.ctrlKey&&Dr.key==="d"&&Dr.type==="keydown"&&Dr.preventDefault()}}),onKeyStroke("d",Rr,{dedupe:!0,eventName:"keydown"})},useCommandCKey=Tr=>{const Cr=useActiveElement();function $r(){let Dr="";return typeof window.getSelection<"u"&&(Dr=window.getSelection().toString()),Dr}const Ar=()=>{var Mr;if(log(Cr.value),!(usingTextOrInput(Cr)||(Mr=Cr.value)!=null&&Mr.classList.contains("chatbox-popover")||$r().length)){if(Tr.selectedBlockId.value){useCopyBlockWrapper(Tr);return}(Tr.focusedPageId.value||Tr.selectedPageId.value)&&useCopySlideWrapper(Tr)}};if(isApple){const{meta_c:Dr}=useMagicKeys({passive:!1,onEventFired(Mr){Mr.metaKey&&Mr.key==="c"&&Mr.type}});whenever(Dr,Ar);return}const{ctrl_c:Rr}=useMagicKeys({passive:!1,onEventFired(Dr){Dr.ctrlKey&&Dr.key==="c"&&Dr.type}});whenever(Rr,Ar)},useCommandZKey=Tr=>{const Cr=useActiveElement(),{current:$r}=useMagicKeys(),Ar=useAppStore(),Rr=()=>{const Dr=isApple?"meta":"control";$r.has(Dr)&&($r.has("shift")||usingTextOrInput(Cr)||Ar.isViewOnly(Tr.currentAppId.value)||Tr.showingFullPage&&Tr.showingFullPage.value||(posthogCapture("undo",{source:"keyboard"}),takeUndoAction(Tr)))};if(isApple){onKeyStroke("z",Rr,{dedupe:!0,eventName:"keydown"});return}onKeyStroke("z",Rr,{dedupe:!0,eventName:"keydown"})},useCommandYKey=Tr=>{const Cr=useActiveElement(),{current:$r}=useMagicKeys(),Ar=useAppStore(),Rr=()=>{const Dr=isApple?"meta":"control";$r.has(Dr)&&(usingTextOrInput(Cr)||Ar.isViewOnly(Tr.currentAppId.value)||Tr.showingFullPage&&Tr.showingFullPage.value||(posthogCapture("redo",{source:"keyboard"}),takeRedoAction(Tr)))};if(isApple){useMagicKeys({passive:!1,onEventFired(Dr){Dr.metaKey&&Dr.key==="y"&&Dr.type==="keydown"&&Dr.preventDefault()}}),onKeyStroke("y",Rr,{dedupe:!0,eventName:"keydown"});return}useMagicKeys({passive:!1,onEventFired(Dr){Dr.ctrlKey&&Dr.key==="y"&&Dr.type==="keydown"&&Dr.preventDefault()}}),onKeyStroke("y",Rr,{dedupe:!0,eventName:"keydown"})},useCommandShiftZKey=Tr=>{const Cr=useActiveElement(),{current:$r}=useMagicKeys(),Ar=useAppStore(),Rr=()=>{const Dr=isApple?"meta":"control",Mr="shift";!$r.has(Dr)||!$r.has(Mr)||usingTextOrInput(Cr)||Ar.isViewOnly(Tr.currentAppId.value)||Tr.showingFullPage&&Tr.showingFullPage.value||(posthogCapture("redo",{source:"keyboard"}),takeRedoAction(Tr))};if(isApple){onKeyStroke("z",Rr,{dedupe:!0,eventName:"keydown"});return}onKeyStroke("z",Rr,{dedupe:!0,eventName:"keydown"})},useCommandShiftHKey=()=>{if(isApple){useMagicKeys({passive:!1,onEventFired(Tr){Tr.metaKey&&Tr.shiftKey&&Tr.key==="h"&&Tr.type==="keydown"&&Tr.preventDefault()}});return}useMagicKeys({passive:!1,onEventFired(Tr){Tr.ctrlKey&&Tr.shiftKey&&Tr.key==="h"&&Tr.type==="keydown"&&Tr.preventDefault()}})},useCommandOptionKeys=(Tr,Cr)=>{const $r={t:{code:"KeyT",type:"text"},s:{code:"KeyS",type:"divider"},b:{code:"KeyB",type:"table"},i:{code:"KeyI",type:"image"},w:{code:"KeyW",type:"webpage"}},Ar=useActiveElement(),{current:Rr}=useMagicKeys(),Dr=useAppStore(),Mr=()=>{const Br=isApple?"meta":"control",Nr="alt";!Rr.has(Br)||!Rr.has(Nr)||usingTextOrInput(Ar)||Dr.isViewOnly(Tr.currentAppId.value)||Tr.showingFullPage&&Tr.showingFullPage.value||(posthogCapture("add block via keyboard",{type:$r[Cr].type}),useAddBlockWrapper({type:$r[Cr].type,slideId:Tr==null?void 0:Tr.selectedPageId.value,selectedBlockId:Tr.selectedBlockId,editingBlockId:Tr.editingBlockId,prevSelectedBlockId:null}))};if(isApple){useMagicKeys({passive:!1,onEventFired(Br){Br.metaKey&&Br.altKey&&Br.code===$r[Cr].code&&Br.type==="keydown"&&Br.preventDefault()}}),onKeyStroke(Br=>Br.code===$r[Cr].code,Mr,{dedupe:!0,eventName:"keydown"});return}useMagicKeys({passive:!1,onEventFired(Br){Br.metaKey&&Br.altKey&&Br.code===$r[Cr].code&&Br.type==="keydown"&&Br.preventDefault()}}),onKeyStroke(Br=>Br.code===$r[Cr].code,Mr,{dedupe:!0,eventName:"keydown"})},useCommandOptionT=Tr=>{useCommandOptionKeys(Tr,"t")},useCommandOptionS=Tr=>{useCommandOptionKeys(Tr,"s")},useCommandOptionB=Tr=>{useCommandOptionKeys(Tr,"b")},useCommandOptionI=Tr=>{useCommandOptionKeys(Tr,"i")},useAllKeyHandlers=Tr=>{useCommandEnterKey(Tr),useBackspaceKey(Tr),useEnterKey(),useLeftKey(),useRightKey(),useUpKey(),useDownKey(),useEscKey(Tr),useCommandDKey(Tr),useCommandCKey(Tr),useCommandZKey(Tr),useCommandYKey(Tr),useCommandShiftZKey(Tr),useCommandShiftHKey(),useCommandKKey(Tr),useCommandOptionT(Tr),useCommandOptionS(Tr),useCommandOptionB(Tr),useCommandOptionI(Tr)},BLOCK_UPDATE_INTERVAL=1e4,state$3=reactive({userName:"Prezo",openAsPage:!1,openAsPageNextPath:"/",badPath:!1,notAllowed:!1,showingPopup:!1}),set=function(Tr){state$3.userName=Tr},setOpenAsPage=function(Tr){state$3.openAsPage=Tr},setOpenAsPageNextPath=function(Tr){state$3.openAsPageNextPath=Tr},setBadPath=function(Tr){state$3.badPath=Tr},setNotAllowed=function(Tr){state$3.notAllowed=Tr},forceRouteChange=function(Tr){router.push({path:Tr})},goRouteChange=Tr=>{router.go(Tr)},setShowingPopup=Tr=>{state$3.showingPopup=Tr},setGlobalProperty=(Tr,Cr)=>{state$3[Tr]=Cr},ourGlobal={state:readonly(state$3),set,setOpenAsPage,setOpenAsPageNextPath,setBadPath,setNotAllowed,forceRouteChange,goRouteChange,setShowingPopup,setGlobalProperty},appTheme$2=theme.appTheme(),allowedLevelsForColors$2=[900,800,700,600,500,400,300,200,100,50],colorTypes$2=["primary","neutral","success","warning","danger","supporting"],getColorConfig$2=()=>{let Tr=[];return colorTypes$2.forEach(Cr=>{const $r=`${Cr.charAt(0).toUpperCase()}${Cr.slice(1)}`,Ar=Object.keys(appTheme$2.palette[Cr]).filter(Rr=>allowedLevelsForColors$2.includes(parseInt(Rr,10))).map(Rr=>({id:`${Cr} ${Rr}`,name:`${$r} ${Rr}`}));Tr=[...Tr,...Ar]}),Tr},state$2=reactive({options:{colors:getColorConfig$2(),background:getColorConfig$2(),theme:theme.state.themeList,headerStyle:[{id:"none",label:"",value:"none"},{id:"plainWithBorder",label:"",value:"plainWithBorder"},{id:"plainWithoutBorder",label:"",value:"plainWithoutBorder"},{id:"colored",label:"",value:"colored"}],deckThemeOld:[{id:"light",label:"Light",value:"light"},{id:"dark",label:"Dark",value:"dark"}],deckTheme:[]},configs:{app:{configPaneSkaffold:[{title:"Theme",items:[{type:"keyValue",label:"",id:"deckTheme",value:null,selectedId:null,options:[],isRequired:!0}]}],defaultConfig:{borderRadius:{id:"borderRadius",value:16},deckSpacing:{id:"deckSpacing",value:12},background:{id:"background",selectedId:"neutral 0",value:null},isGenerating:{id:"isGenerating",selectedId:!1,value:null},theme:{id:"theme",selectedId:"light1",value:null},deckTheme:{id:"deckTheme",selectedId:"purple",value:null},customStyle:{id:"customStyle",value:null},customLogo:{id:"customLogo",value:null},customDeckLogo:{id:"customDeckLogo",value:null},customLogoName:{id:"customLogoName",value:null},smallText:{id:"smallText",value:!1},fontFamily:{id:"fontFamily",value:null,selectedId:"default"},publishSettings:{id:"publishSettings",value:{mode:"slide",display:{includeAccountLogo:!0,includeAccountName:!0}}}}}}}),appConfig={state:readonly(state$2),defaultDeckSpacing:state$2.configs.app.defaultConfig.deckSpacing.value},appTheme$1=theme.appTheme(),allowedLevelsForColors$1=[900,800,700,600,500,400,300,200,100,50],colorTypes$1=["primary","neutral","success","warning","danger","supporting"],getColorConfig$1=()=>{let Tr=[];return colorTypes$1.forEach(Cr=>{const $r=`${Cr.charAt(0).toUpperCase()}${Cr.slice(1)}`,Ar=Object.keys(appTheme$1.palette[Cr]).filter(Rr=>allowedLevelsForColors$1.includes(parseInt(Rr,10))).map(Rr=>({id:`${Cr} ${Rr}`,name:`${$r} ${Rr}`}));Tr=[...Tr,...Ar]}),Tr},state$1=reactive({options:{colors:getColorConfig$1(),background:getColorConfig$1()},configs:{page:{configPaneSkaffold:[{title:"Background",items:[{type:"keyValue",label:"",id:"background",value:null,selectedId:null,options:[],isRequired:!0}]}],defaultConfig:{itemMap:{id:"itemMap",value:{"g-h-0":{type:"group",direction:"row",items:[],x:0,y:0,width:960,height:540,spacing:{padding:12,gap:12}}}},slideSpacing:{id:"slideSpacing",value:12},background:{id:"background",selectedId:null,value:null},useDoodle:{id:"useDoodle",value:!1},isHidden:{id:"isHidden",value:!1},isReady:{id:"isReady",value:!0},layoutId:{id:"layoutId",value:null},isDividerSlide:{id:"isDividerSlide",value:!1}}}}}),pageConfig={state:state$1},appTheme=theme.appTheme(),allowedLevelsForColors=[900,500,300,100,50],colorTypes=["primary","neutral","success","warning","danger","supporting"],getColorConfig=()=>{let Tr=[];return colorTypes.forEach(Cr=>{const $r=`${Cr.charAt(0).toUpperCase()}${Cr.slice(1)}`,Ar=Object.keys(appTheme.palette[Cr]).filter(Rr=>allowedLevelsForColors.includes(parseInt(Rr,10))).map(Rr=>({id:`${Cr} ${Rr}`,name:`${$r} ${Rr}`}));Tr=[...Tr,...Ar]}),Tr},state=reactive({options:{colors:getColorConfig(),background:getColorConfig(),theme:theme.state.themeList}}),getAIGeneratedStyleFromPrompt=async Tr=>Tr.includes("rounded")?{borderRadius:"16px"}:Tr.includes("circular")?{borderRadius:"50%"}:Tr.includes("josh comeau")?{background:"linear-gradient(268.67deg, rgb(255, 255, 255) 3.43%, rgb(255, 240, 102) 15.69%, rgb(255, 163, 26) 55.54%, rgb(255, 0, 115) 99%)",backgroundSize:"100%",backgroundClip:"text","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}:Tr.includes("gradient background")||Tr.includes("vercel")?{background:"linear-gradient(268.67deg, rgba(2,0,36,1) 3.43%, rgba(121,9,102,0.6629245448179272) 15.69%, rgba(0,212,255,1) 99%)",backgroundSize:"100%",backgroundClip:"text","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"}:{},aiForStyle={state:readonly(state),getAIGeneratedStyleFromPrompt},useUsageStore=defineStore("usageStore",{state:()=>({generations:{},currentSlideIndex:1,slideCount:1,deckCompletionKey:0}),getters:{currentSlideIndexValue:Tr=>Tr.currentSlideIndex,slideCountValue:Tr=>Tr.slideCount,deckCompletionKeyValue:Tr=>Tr.deckCompletionKey},actions:{addGeneration(Tr){const{id:Cr}=Tr;this.generations[Cr]={...Tr}},updateSlideIndex(Tr){this.currentSlideIndex=Tr},updateSlideCount(Tr){this.slideCount=Tr},resetSlideIndices(){this.currentSlideIndex=1,this.slideCount=1},updateDeckCompletionKey(){this.deckCompletionKey+=1}}}),_sfc_main$1v=defineComponent({__name:"Icon",props:{src:{},flipColor:{type:Boolean,default:!1},isSecondary:{type:Boolean,default:!1},isFromLibrary:{type:Boolean,default:!1},isEmoji:{type:Boolean,default:!1},vProps:{default:()=>({})}},setup(Tr){useCssVars(Mr=>({"2168102c":$r.value,c06c3304:Cr.vProps.nestedFill}));const Cr=Tr,$r=computed(()=>{var Mr,Br;return(Mr=Cr.vProps)!=null&&Mr.stroke?Cr.vProps.stroke:Cr.isSecondary?theme.appTheme().palette.neutral[300]:Cr.flipColor?theme.appTheme().palette.neutral[0]:(Br=Cr.vProps)!=null&&Br.isGradient?"none":theme.appTheme().palette.neutral[900]}),Ar=computed(()=>{var Mr,Br;return typeof((Mr=Cr.vProps)==null?void 0:Mr.width)=="number"?`${Cr.vProps.width}px`:typeof((Br=Cr.vProps)==null?void 0:Br.width)=="string"?Cr.vProps.width:"18px"}),Rr=computed(()=>{var Mr,Br;return typeof((Mr=Cr.vProps)==null?void 0:Mr.width)=="number"?`${Cr.vProps.width-2}px`:typeof((Br=Cr.vProps)==null?void 0:Br.width)=="string"?Cr.vProps.width:"18px"}),Dr=computed(()=>{var Mr,Br;return typeof((Mr=Cr.vProps)==null?void 0:Mr.height)=="number"?`${Cr.vProps.height}px`:typeof((Br=Cr.vProps)==null?void 0:Br.height)=="string"?Cr.vProps.height:"18px"});return(Mr,Br)=>{var Lr,Hr,zr,Ur,Vr,jr,Gr,Xr,Kr,Zr,eo;const Nr=resolveComponent("inline-svg");return Mr.isFromLibrary?(openBlock(),createElementBlock("div",{key:0,style:normalizeStyle({height:((Lr=Mr.vProps)==null?void 0:Lr.height)??"18px",width:Mr.vProps.width??"18px",color:((Hr=Mr.vProps)==null?void 0:Hr.fill)??((zr=Mr.vProps)==null?void 0:zr.stroke)??"stroke"})},null,4)):Mr.isEmoji?(openBlock(),createElementBlock("div",{key:1,style:normalizeStyle({display:"flex",alignItems:"center",justifyContent:"center",fontSize:Rr.value,width:Ar.value,height:Dr.value})},toDisplayString(Mr.src),5)):(openBlock(),createElementBlock("div",{key:2,style:normalizeStyle({minWidth:Ar.value,minHeight:Dr.value})},[createVNode(Nr,{src:Mr.src,height:(Ur=Mr.vProps)==null?void 0:Ur.height,width:(Vr=Mr.vProps)==null?void 0:Vr.width,fill:(jr=Mr.vProps)==null?void 0:jr.fill,stroke:(Gr=Mr.vProps)==null?void 0:Gr.stroke,class:normalizeClass({"is-gradient":(Xr=Mr.vProps)==null?void 0:Xr.isGradient,"is-not-gradient":!((Kr=Mr.vProps)!=null&&Kr.isGradient),"has-nested-fill":!!Cr.vProps.nestedFill,"has-stroke":!!Cr.vProps.stroke}),style:normalizeStyle({...((Zr=Mr.vProps)==null?void 0:Zr.width)&&{minWidth:(eo=Mr.vProps)==null?void 0:eo.width}})},null,8,["src","height","width","fill","stroke","class","style"])],4))}}}),Icon_vue_vue_type_style_index_0_lang="",LoaderCircle_vue_vue_type_style_index_0_scoped_f600c068_lang="",_export_sfc=(Tr,Cr)=>{const $r=Tr.__vccOpts||Tr;for(const[Ar,Rr]of Cr)$r[Ar]=Rr;return $r},_sfc_main$1u={name:"LoaderCircle",setup(){return{assetUrl}},props:{color:{type:String,default:"gradient"},size:{default:"20"},stroke:{default:"2"},borderTopColor:{type:String},borderColor:{type:String},isNeutral:{type:Boolean,default:!1},padding:{type:String,default:"20px 24px"}},components:{Icon:_sfc_main$1v},data(){return{containerStyle:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:`${this.size}px`,padding:this.padding}}},computed:{styles(){return{width:`${this.size}px`,height:`${this.size}px`,border:`${this.stroke}px solid ${this.borderColor??this.appTheme.palette.primary[500]}`,borderTopColor:this.borderTopColor??this.appTheme.palette.neutral[0],borderRightColor:this.borderTopColor??this.appTheme.palette.neutral[0]}}}},_withScopeId$a=Tr=>(pushScopeId("data-v-f600c068"),Tr=Tr(),popScopeId(),Tr),_hoisted_1$11=["width","height"],_hoisted_2$P=_withScopeId$a(()=>createBaseVNode("path",{d:"M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM1.6 8C1.6 11.5346 4.46538 14.4 8 14.4C11.5346 14.4 14.4 11.5346 14.4 8C14.4 4.46538 11.5346 1.6 8 1.6C4.46538 1.6 1.6 4.46538 1.6 8Z",fill:"#100F0F","fill-opacity":"0.16"},null,-1)),_hoisted_3$E=[_hoisted_2$P];function _sfc_render$l(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("Icon");return openBlock(),createElementBlock("div",{style:normalizeStyle(Rr.containerStyle)},[(openBlock(),createElementBlock("svg",{width:$r.size,height:$r.size,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_hoisted_3$E,8,_hoisted_1$11)),createVNode(Mr,{src:Ar.assetUrl("icon-loader-circle.svg"),class:"loader",vProps:{height:$r.size,width:$r.size,stroke:"transparent",nestedFill:$r.color},style:{position:"absolute"}},null,8,["src","vProps"])],4)}const LoaderCircle=_export_sfc(_sfc_main$1u,[["render",_sfc_render$l],["__scopeId","data-v-f600c068"]]);if(typeof window<"u"){var passiveTestOptions={get passive(){}};window.addEventListener("testPassive",null,passiveTestOptions),window.removeEventListener("testPassive",null,passiveTestOptions)}const clickOutside={beforeMount:(Tr,Cr)=>{Tr.clickOutsideEvent=$r=>{Tr===$r.target||Tr.contains($r.target)||Cr.value()},document.addEventListener("click",Tr.clickOutsideEvent)},unmounted:Tr=>{document.removeEventListener("click",Tr.clickOutsideEvent)}},Button_vue_vue_type_style_index_0_scoped_6bac4c45_lang="",_sfc_main$1t={name:"Button",components:{Icon:_sfc_main$1v},emits:["clicked-outside"],directives:{"click-outside":clickOutside},props:{title:{type:String,default:""},isSubtitle:{type:Boolean,default:!1},leftIcon:{type:Object,default(){return{}}},rightIcon:{type:Object,default(){return{}}},purpose:{type:String,default:"normal"},size:{type:String,default:"normal"},state:{type:String,default:"normal"},hasBorder:{type:Boolean,default:!1},alignment:{type:String,default:"center"},currentBackgroundColorDict:{type:Object,default(){return{}}},useGradient:{type:Boolean,default:!1},colorOverride:{type:String,default:null},backgroundOverride:{type:String,default:null},hoverBackgroundOverride:{type:String,default:null},activeBackgroundOverride:{type:String,default:null},selectedBackgroundOverride:{type:String,default:null},useTextGradient:{type:Boolean,default:!1},hoverStyle:{type:Object,default(){return{}}},activeStyle:{type:Object,default(){return{}}},border:{type:String,default:null},hoverBorderOverride:{type:String,default:null},activeBorderOverride:{type:String,default:null}},data(){return{hovering:!1,active:!1,defaultStyle:{transition:"background 20ms ease-in 0s, border 20ms ease-in 0s",display:"flex",alignItems:"center",padding:"0 10px",height:"24px",userSelect:"none",cursor:"pointer",borderRadius:"8px",justifyContent:"center",gap:"8px"},defaultTextStyle:{display:"flex",alignItems:"center",justifyContent:"center",flex:"1 1 auto",whiteSpace:"nowrap",minWidth:"0",textOverflow:"ellipsis",overflow:"hidden",fontSize:"0.875rem",fontWeight:"500",fontFamily:"inherit"},iconStyle:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:"0"}}},computed:{purposeMap(){return{helpful:{color:this.appTheme.palette.primary[500],activeColor:this.appTheme.palette.primary[500],hoverColor:this.appTheme.palette.primary[500],background:this.appTheme.palette.neutral[0],activeBackground:this.appTheme.palette.primary[700],hoverBackground:this.appTheme.palette.primary[600],border:this.hasBorder?`0.5px solid ${this.appTheme.palette.primary[500]}`:null},harmful:{color:"rgba(238, 82, 83, 1.0)",activeColor:"rgba(238, 82, 83, 1.0)",hoverColor:"rgba(238, 82, 83, 1.0)",background:this.appTheme.palette.neutral[0],activeBackground:"rgba(238, 82, 83, 0.2)",hoverBackground:"rgba(238, 82, 83, 0.2)",border:this.hasBorder?"0.5px solid rgba(238, 82, 83, 0.5)":null},primary:{color:this.appTheme.palette.neutral[0],activeColor:this.appTheme.palette.neutral[0],hoverColor:this.appTheme.palette.neutral[0],background:this.gradientBackground,activeBackground:this.gradientBackgroundActive,hoverBackground:this.gradientBackgroundHover,border:null},secondary:{color:this.state==="selected"?"white":this.colorToUse,activeColor:this.colorToUse,hoverColor:this.state==="selected"?"white":this.colorToUse,background:this.state==="selected"?this.selectedBackgroundToUse:this.backgroundOverride??this.secondaryBackgroundToUse,activeBackground:this.activeBackgroundOverride??this.secondaryActiveBackgroundToUse,hoverBackground:this.state==="selected"?this.selectedBackgroundToUse:this.hoverBackgroundOverride??this.secondaryHoverBackgroundToUse,border:null},normal:{color:this.isSubtitle?this.softColorToUse:this.colorToUse,activeColor:this.useGradient?this.backgroundToUse:this.isSubtitle?this.softColorToUse:this.colorToUse,hoverColor:this.useGradient?this.backgroundToUse:this.isSubtitle?this.softColorToUse:this.colorToUse,background:this.backgroundOverride?this.backgroundOverride:this.state==="selected"?this.useGradient?this.gradientBackground:this.hoverBackgroundToUse:this.backgroundToUse,activeBackground:this.activeBackgroundOverride?this.activeBackgroundOverride:this.useGradient?this.gradientBackground:this.activeBackgroundToUse,hoverBackground:this.hoverBackgroundOverride?this.hoverBackgroundOverride:this.useGradient&&this.state==="selected"?this.gradientBackground:this.hoverBackgroundToUse,border:this.border},dynamicBorder:{color:this.colorInTheme,activeColor:this.colorInTheme,hoverColor:this.colorInTheme,background:this.backgroundOverride??"transparent",activeBackground:this.activeBackgroundOverride??"transparent",hoverBackground:this.hoverBackgroundOverride??"transparent",border:`1px solid ${this.appTheme.palette.neutral[100]}`,hoverBorder:this.hoverBorderOverride,activeBorder:this.activeBorderOverride},outline:{color:this.colorToUse,activeColor:this.colorToUse,hoverColor:this.colorToUse,background:this.state==="selected"?this.selectedBackgroundToUse:this.backgroundOverride??this.backgroundToUse,activeBackground:this.state==="selected"?this.selectedBackgroundToUse:this.activeBackgroundOverride??this.backgroundToUse,hoverBackground:this.state==="selected"?this.selectedBackgroundToUse:this.hoverBackgroundOverride??this.backgroundToUse,border:this.state==="selected"?this.activeBorderOverride||"1px solid rgba(0, 0, 0, 0.32)":this.border||"1px solid rgba(0, 0, 0, 0.08)",hoverBorder:this.hoverBorderOverride||"1px solid rgba(0, 0, 0, 0.24)",activeBorder:this.activeBorderOverride||"1px solid rgba(0, 0, 0, 0.32)"},transparent:{color:this.colorInTheme,activeColor:this.colorInTheme,hoverColor:this.colorInTheme,background:this.backgroundOverride??(this.useGradient&&this.state==="selected"?this.gradientBackground:"transparent"),activeBackground:this.activeBackgroundOverride??(this.useGradient&&this.state==="selected"?this.gradientBackground:"transparent"),hoverBackground:this.hoverBackgroundOverride??(this.useGradient&&this.state==="selected"?this.gradientBackground:"transparent"),border:this.border,hoverBorder:this.hoverBorderOverride,activeBorder:this.activeBorderOverride}}},purposeToUse(){return Object.keys(this.purposeMap).includes(this.purpose)?this.purpose:"normal"},activeBackground(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.activeBackground},activeColor(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.activeColor},hoverBackground(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.hoverBackground},hoverColor(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.hoverColor},normalBackground(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.background},normalColor(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.color},normalBorder(){var Tr,Cr,$r,Ar;return this.purposeToUse==="dynamicBorder"?this.active?`1px solid ${this.appTheme.palette.neutral[500]}`:this.hovering?`1px solid ${this.appTheme.palette.neutral[300]}`:`1px solid ${this.appTheme.palette.neutral[200]}`:this.purposeToUse==="secondary"&&this.hasBorder?this.active?`1px solid ${this.appTheme.palette.neutral[200]}`:this.state==="selected"?`1px solid ${this.selectedBackgroundToUse}`:`1px solid ${this.appTheme.palette.neutral[100]}`:this.purposeToUse==="transparent"?this.active?this.activeBorderOverride:this.hovering?this.hoverBorderOverride:this.border:this.purposeToUse==="outline"?this.active?(Tr=this.purposeMap.outline)==null?void 0:Tr.activeBorder:this.hovering?(Cr=this.purposeMap.outline)==null?void 0:Cr.hoverBorder:($r=this.purposeMap.outline)==null?void 0:$r.border:(Ar=this.purposeMap[this.purposeToUse])==null?void 0:Ar.border},hasNoTitle(){return this.title.length===0},hasLeftIcon(){var Tr;return((Tr=this.leftIcon)==null?void 0:Tr.icon)!=null},hasRightIcon(){var Tr;return((Tr=this.rightIcon)==null?void 0:Tr.icon)!=null},hasOnlyOneIcon(){return this.hasLeftIcon&&!this.hasRightIcon||this.hasRightIcon&&!this.hasLeftIcon},isIconButton(){return this.hasNoTitle&&this.hasOnlyOneIcon},paddingToUse(){return this.size==="small"?"0 6px":this.size==="large"||this.size==="extraLarge"?"0 12px":"0 10px"},heightToUse(){return this.size==="small"?"24px":this.size==="large"?"28px":this.size==="extraLarge"?"36px":"26px"},fontSizeToUse(){return this.size==="small"?"0.75rem":"0.875rem"},buttonStyle(){return this.state==="disabled"?{...this.defaultStyle,pointerEvents:"none",justifyContent:this.alignment,background:this.backgroundOverride??this.hoverBackgroundToUse,color:this.colorOverride??this.colorToUse,border:this.normalBorder,padding:this.paddingToUse,height:this.heightToUse}:this.active?{...this.defaultStyle,justifyContent:this.alignment,background:this.activeBackground,color:this.activeColor,border:this.normalBorder,padding:this.paddingToUse,height:this.heightToUse,...this.activeStyle}:this.hovering?{...this.defaultStyle,justifyContent:this.alignment,background:this.hoverBackground,color:this.hoverColor,border:this.normalBorder,padding:this.paddingToUse,height:this.heightToUse,...this.hoverStyle}:{...this.defaultStyle,justifyContent:this.alignment,background:this.normalBackground,color:this.normalColor,border:this.normalBorder,padding:this.paddingToUse,height:this.heightToUse}},textStyle(){return{...this.defaultTextStyle,justifyContent:this.alignment,fontSize:this.fontSizeToUse,cursor:"pointer"}},iconStyleLeft(){return{...this.iconStyle,marginRight:"0px"}},iconStyleRight(){return{...this.iconStyle,marginLeft:"0px"}},gradientBackground(){return this.appTheme.colors.brandPurple},gradientBackgroundHover(){return this.appTheme.colors.brandPurpleHover},gradientBackgroundActive(){return this.appTheme.colors.brandPurpleActive},darkTheme(){return this.isDarkColor({color:this.getColorFromDict(this.currentBackgroundColorDict)})},backgroundToUse(){return theme.appColors.backgroundToUseCustom(this.darkTheme,this.currentBackgroundColorDict)},activeBackgroundToUse(){return theme.appColors.activeBackgroundToUse(this.darkTheme)},hoverBackgroundToUse(){return theme.appColors.hoverBackgroundToUse(this.darkTheme)},selectedBackgroundToUse(){return this.selectedBackgroundOverride??theme.appColors.selectedBackgroundToUse(this.darkTheme)},secondaryBackgroundToUse(){return theme.appColors.secondaryBackgroundToUse(this.darkTheme)},secondaryHoverBackgroundToUse(){return theme.appColors.secondaryHoverBackgroundToUse(this.darkTheme)},secondaryActiveBackgroundToUse(){return theme.appColors.secondaryActiveBackgroundToUse(this.darkTheme)},textBackgroundToUse(){return theme.appColors.textBackgroundToUse(this.darkTheme)},colorToUse(){return theme.appColors.colorToUse(this.darkTheme)},colorInTheme(){return this.colorToUse},softColorToUse(){return theme.appColors.softColorToUse(this.darkTheme)}},methods:{mouseOver(){this.hovering=!0},mouseLeave(){this.active=!1,this.hovering=!1},mouseDown(){this.active=!0},mouseUp(){this.active=!1},handleClickOutside(){this.mouseUp(),this.$emit("clicked-outside")}}},_hoisted_1$10={class:"ellipsis"};function _sfc_render$k(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("Icon"),Br=resolveDirective("click-outside");return withDirectives((openBlock(),createElementBlock("div",{style:normalizeStyle(Dr.buttonStyle),onMouseover:Cr[0]||(Cr[0]=Nr=>Dr.mouseOver()),onMouseleave:Cr[1]||(Cr[1]=Nr=>Dr.mouseLeave()),onMousedown:Cr[2]||(Cr[2]=Nr=>Dr.mouseDown()),onClick:Cr[3]||(Cr[3]=Nr=>Dr.mouseUp()),onMouseup:Cr[4]||(Cr[4]=Nr=>Dr.mouseUp()),onTouchstartPassive:Cr[5]||(Cr[5]=Nr=>Dr.mouseDown()),onTouchendPassive:Cr[6]||(Cr[6]=Nr=>Dr.mouseUp()),onContextmenu:Cr[7]||(Cr[7]=(...Nr)=>Dr.mouseUp&&Dr.mouseUp(...Nr)),onDragend:Cr[8]||(Cr[8]=(...Nr)=>Dr.mouseUp&&Dr.mouseUp(...Nr)),role:"button"},[renderSlot(Tr.$slots,"left",{hovering:Rr.hovering,active:Rr.active},()=>[$r.leftIcon.icon?(openBlock(),createBlock(Mr,{key:0,src:$r.leftIcon.icon,isSecondary:$r.leftIcon.isSecondary,height:$r.leftIcon.iconSize??14,width:$r.leftIcon.iconSize??14,style:normalizeStyle(Dr.iconStyleLeft),vProps:$r.leftIcon.vProps,isFromLibrary:$r.leftIcon.isFromLibrary,isEmoji:$r.leftIcon.isEmoji},null,8,["src","isSecondary","height","width","style","vProps","isFromLibrary","isEmoji"])):createCommentVNode("",!0)],!0),renderSlot(Tr.$slots,"content",{hovering:Rr.hovering,textStyle:Dr.textStyle,active:Rr.active},()=>[$r.title?(openBlock(),createElementBlock("div",{key:0,style:normalizeStyle(Dr.textStyle),class:normalizeClass({textGradient:$r.useTextGradient})},[createBaseVNode("div",_hoisted_1$10,toDisplayString($r.title),1)],6)):createCommentVNode("",!0)],!0),renderSlot(Tr.$slots,"right",{hovering:Rr.hovering,active:Rr.active},()=>[$r.rightIcon.icon?(openBlock(),createBlock(Mr,{key:0,src:$r.rightIcon.icon,isSecondary:$r.rightIcon.isSecondary,height:$r.rightIcon.iconSize??14,width:$r.rightIcon.iconSize??14,style:normalizeStyle(Dr.iconStyleRight),vProps:$r.rightIcon.vProps,isFromLibrary:$r.rightIcon.isFromLibrary,isEmoji:$r.rightIcon.isEmoji},null,8,["src","isSecondary","height","width","style","vProps","isFromLibrary","isEmoji"])):createCommentVNode("",!0)],!0)],36)),[[Br,Dr.handleClickOutside]])}const Button=_export_sfc(_sfc_main$1t,[["render",_sfc_render$k],["__scopeId","data-v-6bac4c45"]]),Notification_vue_vue_type_style_index_0_scoped_ddfe6a11_lang="",_sfc_main$1s={name:"Notification",setup(){const Tr=useUsageStore(),Cr=computed(()=>Tr.currentSlideIndexValue===1&&Tr.slideCountValue===1||Tr.slideCountValue==="many"||Tr.currentSlideIndexValue>parseInt(Tr.slideCountValue,10)?"":`${Tr.currentSlideIndexValue}/${Tr.slideCountValue}`),{isMobile:$r}=useDeviceState(),Ar=ref(null),Rr=ref(null);return{isMobile:$r,notiRef:Rr,timeoutId:Ar,usageStore:Tr,tagContentToUse:Cr,assetUrl}},props:{notification:Object,fromApp:{type:Boolean,default:!1}},emits:["hide"],components:{LoaderCircle,Button,Icon:_sfc_main$1v},data(){return{modalStyle:{pointerEvents:"auto",position:"relative",zIndex:"0"},defaultContainerStyle:{position:"fixed",width:"100%",display:"flex"},defaultDialogStyle:{borderRadius:"4px",padding:"6px 12px",fontSize:"0.875rem",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}}},computed:{emojiToUse(){return this.notification.type==="success"?"🎉":this.notification.type==="error"?"😢":this.notification.type==="warning"?"😱":""},containerStyle(){return this.notification.position==="bottomRight"?{...this.defaultContainerStyle,bottom:"24px",right:"4px",opacity:"1",zIndex:"1000",justifyContent:"flex-end"}:this.notification.position==="bottomLeft"?{...this.defaultContainerStyle,bottom:"24px",left:"4px",opacity:"1",zIndex:"1000",justifyContent:"flex-start"}:this.notification.position==="bottomCenter"||this.notification.position==null?{...this.defaultContainerStyle,bottom:"24px",left:"0px",opacity:"1",zIndex:"1000",justifyContent:"center"}:{...this.defaultContainerStyle,left:"0px",top:"48px",opacity:"1",justifyContent:"center"}},dialogStyle(){let Tr="#FFF",Cr=this.notification.isProminent?"600":"500";const $r=this.notification.isProminent?"1.125rem":"1rem",Ar=this.notification.isProminent?"24px 28px":"12px 16px";let Rr="rgba(31, 31, 31, 1)";return this.notification.type==="error"&&(Tr="#FFF",Cr="500",Rr="rgba(219, 48, 51, 1)"),this.notification.type==="warning"&&(Tr=this.appTheme.palette.warning[500],Cr="600",Rr=this.appTheme.palette.warning[100]),this.notification.type==="success"&&(Tr=this.appTheme.palette.success[500],Cr="600",Rr=this.appTheme.palette.success[100]),{...this.defaultDialogStyle,width:(this.notification.isProminent,"fit-content"),maxWidth:this.isMobile?"calc(100% - 32px)":"100%",overflowWrap:"break-word",hyphens:"auto",borderRadius:this.notification.isProminent?"16px":"12px",fontWeight:Cr,fontSize:$r,padding:Ar,background:Rr,color:Tr,boxShadow:"0px 5px 12px 0px rgba(0, 0, 0, 0.08)",lineHeight:1.16}}},watch:{notification:{handler(){this.prepareToHide()},deep:!0}},methods:{hideHandler(){this.notiRef&&this.notiRef.removeEventListener("animationend",this.hideHandler),this.$emit("hide")},prepareToHide(){if(this.notification.persistent)return;let Tr=4e3;this.notification.hangTime&&(Tr=this.notification.hangTime),clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.notiRef&&(this.notiRef.classList.add("hide"),this.notiRef.addEventListener("animationend",this.hideHandler))},Tr)}},mounted(){this.prepareToHide()},beforeUnmount(){clearTimeout(this.timeoutId),this.$emit("hide")}},_withScopeId$9=Tr=>(pushScopeId("data-v-ddfe6a11"),Tr=Tr(),popScopeId(),Tr),_hoisted_1$$={key:0},_hoisted_2$O=_withScopeId$9(()=>createBaseVNode("div",{class:"dot",style:{marginRight:"2px"}},null,-1)),_hoisted_3$D=_withScopeId$9(()=>createBaseVNode("div",{class:"dot",style:{marginRight:"2px"}},null,-1)),_hoisted_4$u=_withScopeId$9(()=>createBaseVNode("div",{class:"dot"},null,-1)),_hoisted_5$n=[_hoisted_2$O,_hoisted_3$D,_hoisted_4$u],_hoisted_6$m={key:2};function _sfc_render$j(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("LoaderCircle"),Br=resolveComponent("Icon"),Nr=resolveComponent("Button");return $r.fromApp?(openBlock(),createElementBlock("div",{key:0,style:normalizeStyle(Dr.containerStyle),id:"global-notif"},[createBaseVNode("div",{style:normalizeStyle(Dr.dialogStyle)},[createBaseVNode("label",null,toDisplayString($r.notification.text),1),$r.notification.showEmoji?(openBlock(),createElementBlock("label",_hoisted_1$$,toDisplayString(Dr.emojiToUse),1)):createCommentVNode("",!0),$r.notification.showInProgress?(openBlock(),createElementBlock("div",{key:1,class:"animationContainer",style:normalizeStyle({display:"flex",alignItems:"center",justifyContent:"center",transform:"translate(-4px, 5px)"})},_hoisted_5$n,4)):createCommentVNode("",!0),$r.notification.showTag&&Ar.tagContentToUse.length>0?(openBlock(),createElementBlock("div",{key:2,style:normalizeStyle({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",background:Tr.appTheme.palette.neutral[500],fontSize:"16px",fontWeight:"600",color:Tr.appTheme.palette.neutral[0],padding:"4px 8px"})},[createBaseVNode("label",null,toDisplayString(Ar.tagContentToUse),1)],4)):createCommentVNode("",!0)],4)],4)):(openBlock(),createElementBlock("div",{key:1,style:normalizeStyle(Rr.modalStyle)},[createBaseVNode("div",null,[(openBlock(),createBlock(Teleport,{to:"#main-app"},[createBaseVNode("div",{ref:"notiRef",style:normalizeStyle(Dr.containerStyle),class:"reveal"},[createBaseVNode("div",{style:normalizeStyle(Dr.dialogStyle)},[$r.notification.showInProgress?(openBlock(),createBlock(Mr,{key:0,color:"white",size:"16",padding:"0 2px 0 0"})):createCommentVNode("",!0),$r.notification.type==="error"?(openBlock(),createBlock(Br,{key:1,src:Ar.assetUrl("icon-cross-circle-white.svg"),vProps:{height:16,width:16}},null,8,["src"])):createCommentVNode("",!0),createBaseVNode("label",null,toDisplayString($r.notification.text),1),$r.notification.showEmoji?(openBlock(),createElementBlock("label",_hoisted_6$m,toDisplayString(Dr.emojiToUse),1)):createCommentVNode("",!0),$r.notification.showTag&&Ar.tagContentToUse.length>0?(openBlock(),createElementBlock("div",{key:3,style:normalizeStyle({display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",background:Tr.appTheme.palette.neutral[500],fontSize:"16px",fontWeight:"600",color:Tr.appTheme.palette.neutral[0],padding:"4px 8px"})},[createBaseVNode("label",null,toDisplayString(Ar.tagContentToUse),1)],4)):createCommentVNode("",!0),$r.notification.action?(openBlock(),createBlock(Nr,{key:4,style:{marginLeft:"auto",color:"white"},title:$r.notification.action.text,backgroundOverride:"rgba(255, 255, 255, 0.12)",hoverBackgroundOverride:"rgba(255, 255, 255, 0.16)",activeBackgroundOverride:"rgba(255, 255, 255, 0.24)",onClick:Cr[0]||(Cr[0]=Lr=>{var Hr;return(Hr=$r.notification.action)==null?void 0:Hr.callback(Lr)})},null,8,["title","backgroundOverride","hoverBackgroundOverride","activeBackgroundOverride"])):createCommentVNode("",!0)],4)],4)]))])],4))}const Notification=_export_sfc(_sfc_main$1s,[["render",_sfc_render$j],["__scopeId","data-v-ddfe6a11"]]),convertTableToMatrix=Tr=>{const Ar=new DOMParser().parseFromString(Tr,"text/html").querySelector("table");let Rr=null;if(Ar){const Dr=Ar.querySelectorAll("tr");Rr=new Array(Dr.length),Dr.forEach((Mr,Br)=>{const Nr=Mr.querySelectorAll("td");let Lr=[];Nr.forEach(Hr=>{Lr.push(Hr.textContent)}),Rr&&(Rr[Br]=Lr)})}return Rr},useCopyPaste=({appId:Tr,editingBlockId:Cr,keyHandlerOptions:$r})=>{const Ar=useAppStore(),Rr=useBlockLayoutsStore(),Dr=useBlockStore(),Mr=useMiscStore(),Br=computed(()=>Rr.inTemplateMode),Nr=async Hr=>{const zr=Hr.clipboardData.getData("text/html"),Ur=Hr.clipboardData.getData("text/plain");if(Ur)try{const Vr=JSON.parse(Ur);if(Vr.prezoObj)return Vr}catch{return{prezoObj:!1,html:zr,text:Ur}}return{prezoObj:!1,html:zr,text:""}},Lr=async Hr=>{const zr=useActiveElement();Br.value||!Tr.value||Ar.isViewOnly(Tr.value)||usingTextOrInput(zr)||Mr.getShowingAIOnboarding||Nr(Hr).then(Ur=>{if(!Tr.value)return;if(Ur.prezoObj){const eo=Ur.value;if(eo.length===0||eo[0]==null)return;eo[0].type==="block"?usePasteBlockWrapper({...$r,copiedState:Ur}):eo[0].type==="slide"&&usePasteSlideWrapper({...$r,copiedState:Ur});return}const Vr=convertTableToMatrix(Ur.html),{selectedBlockId:jr,selectedPageId:Gr}=$r;if(Vr){usePasteTable({appId:Tr,selectedBlockId:jr,selectedPageId:Gr,tsv:Vr});return}if(Ur.text.length){const eo={...defaultConfig$7,content:{...defaultConfig$7.content,value:generateJSON(Ur.html,[Document$1,Paragraph$2,Text$3,BulletList$2,OrderedList$2,ListItem$2,Bold$2,Italic$2,Strike$2,Link$2])}};useAddBlockWrapper({selectedBlockId:jr,slideId:Gr.value,type:"text",config:eo,addViaPaste:!0})}const Xr=/]+src="(.*?)"[^>]*>/g,Kr=[];let Zr=Xr.exec(Ur.html);for(;Zr!=null;)Kr.push(Zr[1]),Zr=Xr.exec(Ur.html);Kr.forEach(eo=>{useAddBlockWrapper({type:"image",slideId:Gr.value,selectedBlockId:jr,editingBlockId:Cr,addViaPaste:!0}).then(async Yr=>{const{data:Jr,error:no}=await querySaveImg({url:eo,opts:{blockId:Yr},type:"block"});if(no||!Jr)console.error(no);else{const ro=Jr.url;Dr.updateProps(Yr||"",{keyPath:["config"],value:{...Dr.config(Yr||""),source:{id:"source",value:ro},content:{id:"content",value:ro}}})}})})})};document.addEventListener("paste",Lr),onBeforeUnmount(()=>{document.removeEventListener("paste",Lr)})},_hoisted_1$_=["src"],_hoisted_2$N={key:1,class:"w-[24px] h-[24px]"},_sfc_main$1r=defineComponent({__name:"UserProfile",props:{avatarUrl:{},showBlank:{type:Boolean},name:{},isRegularSquare:{type:Boolean},isSmallSquare:{type:Boolean}},setup(Tr){return computed(()=>theme.appTheme()),(Cr,$r)=>Cr.avatarUrl?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["w-[28px] h-[28px] overflow-hidden flex items-center border border-gray-100",{"rounded-full":!Cr.isRegularSquare&&!Cr.isSmallSquare,"rounded-[8px]":Cr.isRegularSquare,"rounded-[4px]":Cr.isSmallSquare}])},[createBaseVNode("img",{src:Cr.avatarUrl,referrerpolicy:"no-referrer"},null,8,_hoisted_1$_)],2)):Cr.showBlank?(openBlock(),createElementBlock("div",_hoisted_2$N)):(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(["w-[28px] h-[28px] flex justify-center items-center border border-gray-100",{"rounded-full":!Cr.isRegularSquare&&!Cr.isSmallSquare,"rounded-[8px]":Cr.isRegularSquare,"rounded-[4px]":Cr.isSmallSquare}])},toDisplayString((Cr.name??"A").charAt(0).toUpperCase()),3))}});function u$5(Tr,Cr,...$r){if(Tr in Cr){let Rr=Cr[Tr];return typeof Rr=="function"?Rr(...$r):Rr}let Ar=new Error(`Tried to handle "${Tr}" but there is no handler defined. Only defined handlers are: ${Object.keys(Cr).map(Rr=>`"${Rr}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(Ar,u$5),Ar}var N$1=(Tr=>(Tr[Tr.None=0]="None",Tr[Tr.RenderStrategy=1]="RenderStrategy",Tr[Tr.Static=2]="Static",Tr))(N$1||{}),S$2=(Tr=>(Tr[Tr.Unmount=0]="Unmount",Tr[Tr.Hidden=1]="Hidden",Tr))(S$2||{});function H$1({visible:Tr=!0,features:Cr=0,ourProps:$r,theirProps:Ar,...Rr}){var Dr;let Mr=j(Ar,$r),Br=Object.assign(Rr,{props:Mr});if(Tr||Cr&2&&Mr.static)return y$1(Br);if(Cr&1){let Nr=(Dr=Mr.unmount)==null||Dr?0:1;return u$5(Nr,{0(){return null},1(){return y$1({...Rr,props:{...Mr,hidden:!0,style:{display:"none"}}})}})}return y$1(Br)}function y$1({props:Tr,attrs:Cr,slots:$r,slot:Ar,name:Rr}){var Dr,Mr;let{as:Br,...Nr}=T$2(Tr,["unmount","static"]),Lr=(Dr=$r.default)==null?void 0:Dr.call($r,Ar),Hr={};if(Ar){let zr=!1,Ur=[];for(let[Vr,jr]of Object.entries(Ar))typeof jr=="boolean"&&(zr=!0),jr===!0&&Ur.push(Vr);zr&&(Hr["data-headlessui-state"]=Ur.join(" "))}if(Br==="template"){if(Lr=b$1(Lr??[]),Object.keys(Nr).length>0||Object.keys(Cr).length>0){let[zr,...Ur]=Lr??[];if(!v$2(zr)||Ur.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${Rr} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(Nr).concat(Object.keys(Cr)).map(Gr=>Gr.trim()).filter((Gr,Xr,Kr)=>Kr.indexOf(Gr)===Xr).sort((Gr,Xr)=>Gr.localeCompare(Xr)).map(Gr=>` - ${Gr}`).join(` `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(Gr=>` - ${Gr}`).join(` `)].join(` `));let Vr=j((Mr=zr.props)!=null?Mr:{},Nr),jr=cloneVNode(zr,Vr);for(let Gr in Vr)Gr.startsWith("on")&&(jr.props||(jr.props={}),jr.props[Gr]=Vr[Gr]);return jr}return Array.isArray(Lr)&&Lr.length===1?Lr[0]:Lr}return h$5(Br,Object.assign({},Nr,Hr),{default:()=>Lr})}function b$1(Tr){return Tr.flatMap(Cr=>Cr.type===Fragment$1?b$1(Cr.children):[Cr])}function j(...Tr){if(Tr.length===0)return{};if(Tr.length===1)return Tr[0];let Cr={},$r={};for(let Ar of Tr)for(let Rr in Ar)Rr.startsWith("on")&&typeof Ar[Rr]=="function"?($r[Rr]!=null||($r[Rr]=[]),$r[Rr].push(Ar[Rr])):Cr[Rr]=Ar[Rr];if(Cr.disabled||Cr["aria-disabled"])return Object.assign(Cr,Object.fromEntries(Object.keys($r).map(Ar=>[Ar,void 0])));for(let Ar in $r)Object.assign(Cr,{[Ar](Rr,...Dr){let Mr=$r[Ar];for(let Br of Mr){if(Rr instanceof Event&&Rr.defaultPrevented)return;Br(Rr,...Dr)}}});return Cr}function K(Tr){let Cr=Object.assign({},Tr);for(let $r in Cr)Cr[$r]===void 0&&delete Cr[$r];return Cr}function T$2(Tr,Cr=[]){let $r=Object.assign({},Tr);for(let Ar of Cr)Ar in $r&&delete $r[Ar];return $r}function v$2(Tr){return Tr==null?!1:typeof Tr.type=="string"||typeof Tr.type=="object"||typeof Tr.type=="function"}let e$2=0;function n$4(){return++e$2}function t$3(){return n$4()}var o$2=(Tr=>(Tr.Space=" ",Tr.Enter="Enter",Tr.Escape="Escape",Tr.Backspace="Backspace",Tr.Delete="Delete",Tr.ArrowLeft="ArrowLeft",Tr.ArrowUp="ArrowUp",Tr.ArrowRight="ArrowRight",Tr.ArrowDown="ArrowDown",Tr.Home="Home",Tr.End="End",Tr.PageUp="PageUp",Tr.PageDown="PageDown",Tr.Tab="Tab",Tr))(o$2||{});function f$3(Tr){throw new Error("Unexpected object: "+Tr)}var a$3=(Tr=>(Tr[Tr.First=0]="First",Tr[Tr.Previous=1]="Previous",Tr[Tr.Next=2]="Next",Tr[Tr.Last=3]="Last",Tr[Tr.Specific=4]="Specific",Tr[Tr.Nothing=5]="Nothing",Tr))(a$3||{});function x$1(Tr,Cr){let $r=Cr.resolveItems();if($r.length<=0)return null;let Ar=Cr.resolveActiveIndex(),Rr=Ar??-1,Dr=(()=>{switch(Tr.focus){case 0:return $r.findIndex(Mr=>!Cr.resolveDisabled(Mr));case 1:{let Mr=$r.slice().reverse().findIndex((Br,Nr,Lr)=>Rr!==-1&&Lr.length-Nr-1>=Rr?!1:!Cr.resolveDisabled(Br));return Mr===-1?Mr:$r.length-1-Mr}case 2:return $r.findIndex((Mr,Br)=>Br<=Rr?!1:!Cr.resolveDisabled(Mr));case 3:{let Mr=$r.slice().reverse().findIndex(Br=>!Cr.resolveDisabled(Br));return Mr===-1?Mr:$r.length-1-Mr}case 4:return $r.findIndex(Mr=>Cr.resolveId(Mr)===Tr.id);case 5:return null;default:f$3(Tr)}})();return Dr===-1?Ar:Dr}function o$1(Tr){var Cr;return Tr==null||Tr.value==null?null:(Cr=Tr.value.$el)!=null?Cr:Tr.value}let n$3=Symbol("Context");var l$3=(Tr=>(Tr[Tr.Open=1]="Open",Tr[Tr.Closed=2]="Closed",Tr[Tr.Closing=4]="Closing",Tr[Tr.Opening=8]="Opening",Tr))(l$3||{});function C(){return p$4()!==null}function p$4(){return inject(n$3,null)}function c$2(Tr){provide(n$3,Tr)}function r$2(Tr,Cr){if(Tr)return Tr;let $r=Cr??"button";if(typeof $r=="string"&&$r.toLowerCase()==="button")return"button"}function b(Tr,Cr){let $r=ref(r$2(Tr.value.type,Tr.value.as));return onMounted(()=>{$r.value=r$2(Tr.value.type,Tr.value.as)}),watchEffect(()=>{var Ar;$r.value||!o$1(Cr)||o$1(Cr)instanceof HTMLButtonElement&&!((Ar=o$1(Cr))!=null&&Ar.hasAttribute("type"))&&($r.value="button")}),$r}let t$2=class{constructor(){this.current=this.detect(),this.currentId=0}set(Cr){this.current!==Cr&&(this.currentId=0,this.current=Cr)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}},n$2=new t$2;function m$3(Tr){if(n$2.isServer)return null;if(Tr instanceof Node)return Tr.ownerDocument;if(Tr!=null&&Tr.hasOwnProperty("value")){let Cr=o$1(Tr);if(Cr)return Cr.ownerDocument}return document}function p$3({container:Tr,accept:Cr,walk:$r,enabled:Ar}){watchEffect(()=>{let Rr=Tr.value;if(!Rr||Ar!==void 0&&!Ar.value)return;let Dr=m$3(Tr);if(!Dr)return;let Mr=Object.assign(Nr=>Cr(Nr),{acceptNode:Cr}),Br=Dr.createTreeWalker(Rr,NodeFilter.SHOW_ELEMENT,Mr,!1);for(;Br.nextNode();)$r(Br.currentNode)})}let f$2=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(Tr=>`${Tr}:not([tabindex='-1'])`).join(",");var N=(Tr=>(Tr[Tr.First=1]="First",Tr[Tr.Previous=2]="Previous",Tr[Tr.Next=4]="Next",Tr[Tr.Last=8]="Last",Tr[Tr.WrapAround=16]="WrapAround",Tr[Tr.NoScroll=32]="NoScroll",Tr))(N||{}),T$1=(Tr=>(Tr[Tr.Error=0]="Error",Tr[Tr.Overflow=1]="Overflow",Tr[Tr.Success=2]="Success",Tr[Tr.Underflow=3]="Underflow",Tr))(T$1||{}),h=(Tr=>(Tr[Tr.Previous=-1]="Previous",Tr[Tr.Next=1]="Next",Tr))(h||{});function d$4(Tr=document.body){return Tr==null?[]:Array.from(Tr.querySelectorAll(f$2)).sort((Cr,$r)=>Math.sign((Cr.tabIndex||Number.MAX_SAFE_INTEGER)-($r.tabIndex||Number.MAX_SAFE_INTEGER)))}var F$1=(Tr=>(Tr[Tr.Strict=0]="Strict",Tr[Tr.Loose=1]="Loose",Tr))(F$1||{});function S$1(Tr,Cr=0){var $r;return Tr===(($r=m$3(Tr))==null?void 0:$r.body)?!1:u$5(Cr,{0(){return Tr.matches(f$2)},1(){let Ar=Tr;for(;Ar!==null;){if(Ar.matches(f$2))return!0;Ar=Ar.parentElement}return!1}})}function v$1(Tr){let Cr=m$3(Tr);nextTick(()=>{Cr&&!S$1(Cr.activeElement,0)&&H(Tr)})}function H(Tr){Tr==null||Tr.focus({preventScroll:!0})}let w$1=["textarea","input"].join(",");function A$1(Tr){var Cr,$r;return($r=(Cr=Tr==null?void 0:Tr.matches)==null?void 0:Cr.call(Tr,w$1))!=null?$r:!1}function I(Tr,Cr=$r=>$r){return Tr.slice().sort(($r,Ar)=>{let Rr=Cr($r),Dr=Cr(Ar);if(Rr===null||Dr===null)return 0;let Mr=Rr.compareDocumentPosition(Dr);return Mr&Node.DOCUMENT_POSITION_FOLLOWING?-1:Mr&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function D(Tr,Cr){return O$1(d$4(),Cr,{relativeTo:Tr})}function O$1(Tr,Cr,{sorted:$r=!0,relativeTo:Ar=null,skipElements:Rr=[]}={}){var Dr;let Mr=(Dr=Array.isArray(Tr)?Tr.length>0?Tr[0].ownerDocument:document:Tr==null?void 0:Tr.ownerDocument)!=null?Dr:document,Br=Array.isArray(Tr)?$r?I(Tr):Tr:d$4(Tr);Rr.length>0&&Br.length>1&&(Br=Br.filter(jr=>!Rr.includes(jr))),Ar=Ar??Mr.activeElement;let Nr=(()=>{if(Cr&5)return 1;if(Cr&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),Lr=(()=>{if(Cr&1)return 0;if(Cr&2)return Math.max(0,Br.indexOf(Ar))-1;if(Cr&4)return Math.max(0,Br.indexOf(Ar))+1;if(Cr&8)return Br.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),Hr=Cr&32?{preventScroll:!0}:{},zr=0,Ur=Br.length,Vr;do{if(zr>=Ur||zr+Ur<=0)return 0;let jr=Lr+zr;if(Cr&16)jr=(jr+Ur)%Ur;else{if(jr<0)return 3;if(jr>=Ur)return 1}Vr=Br[jr],Vr==null||Vr.focus(Hr),zr+=Nr}while(Vr!==Mr.activeElement);return Cr&6&&A$1(Vr)&&Vr.select(),Vr.hasAttribute("tabindex")||Vr.setAttribute("tabindex","0"),2}function u$4(Tr,Cr,$r){n$2.isServer||watchEffect(Ar=>{document.addEventListener(Tr,Cr,$r),Ar(()=>document.removeEventListener(Tr,Cr,$r))})}function y(Tr,Cr,$r=computed(()=>!0)){function Ar(Dr,Mr){if(!$r.value||Dr.defaultPrevented)return;let Br=Mr(Dr);if(Br===null||!Br.getRootNode().contains(Br))return;let Nr=function Lr(Hr){return typeof Hr=="function"?Lr(Hr()):Array.isArray(Hr)||Hr instanceof Set?Hr:[Hr]}(Tr);for(let Lr of Nr){if(Lr===null)continue;let Hr=Lr instanceof HTMLElement?Lr:o$1(Lr);if(Hr!=null&&Hr.contains(Br)||Dr.composed&&Dr.composedPath().includes(Hr))return}return!S$1(Br,F$1.Loose)&&Br.tabIndex!==-1&&Dr.preventDefault(),Cr(Dr,Br)}let Rr=ref(null);u$4("mousedown",Dr=>{var Mr,Br;$r.value&&(Rr.value=((Br=(Mr=Dr.composedPath)==null?void 0:Mr.call(Dr))==null?void 0:Br[0])||Dr.target)},!0),u$4("click",Dr=>{!Rr.value||(Ar(Dr,()=>Rr.value),Rr.value=null)},!0),u$4("blur",Dr=>Ar(Dr,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}var a$2=(Tr=>(Tr[Tr.None=1]="None",Tr[Tr.Focusable=2]="Focusable",Tr[Tr.Hidden=4]="Hidden",Tr))(a$2||{});let f$1=defineComponent({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(Tr,{slots:Cr,attrs:$r}){return()=>{let{features:Ar,...Rr}=Tr,Dr={"aria-hidden":(Ar&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(Ar&4)===4&&(Ar&2)!==2&&{display:"none"}}};return H$1({ourProps:Dr,theirProps:Rr,slot:{},attrs:$r,slots:Cr,name:"Hidden"})}}});function e$1(Tr={},Cr=null,$r=[]){for(let[Ar,Rr]of Object.entries(Tr))f($r,s$1(Cr,Ar),Rr);return $r}function s$1(Tr,Cr){return Tr?Tr+"["+Cr+"]":Cr}function f(Tr,Cr,$r){if(Array.isArray($r))for(let[Ar,Rr]of $r.entries())f(Tr,s$1(Cr,Ar.toString()),Rr);else $r instanceof Date?Tr.push([Cr,$r.toISOString()]):typeof $r=="boolean"?Tr.push([Cr,$r?"1":"0"]):typeof $r=="string"?Tr.push([Cr,$r]):typeof $r=="number"?Tr.push([Cr,`${$r}`]):$r==null?Tr.push([Cr,""]):e$1($r,Cr,Tr)}function d$3(Tr,Cr,$r){let Ar=ref($r==null?void 0:$r.value),Rr=computed(()=>Tr.value!==void 0);return[computed(()=>Rr.value?Tr.value:Ar.value),function(Dr){return Rr.value||(Ar.value=Dr),Cr==null?void 0:Cr(Dr)}]}function r$1(Tr){return[Tr.screenX,Tr.screenY]}function u$3(){let Tr=ref([-1,-1]);return{wasMoved(Cr){let $r=r$1(Cr);return Tr.value[0]===$r[0]&&Tr.value[1]===$r[1]?!1:(Tr.value=$r,!0)},update(Cr){Tr.value=r$1(Cr)}}}function t$1(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function i$2(){return/Android/gi.test(window.navigator.userAgent)}function n$1(){return t$1()||i$2()}function w(Tr,Cr,$r){n$2.isServer||watchEffect(Ar=>{window.addEventListener(Tr,Cr,$r),Ar(()=>window.removeEventListener(Tr,Cr,$r))})}var d$2=(Tr=>(Tr[Tr.Forwards=0]="Forwards",Tr[Tr.Backwards=1]="Backwards",Tr))(d$2||{});function n(){let Tr=ref(0);return w("keydown",Cr=>{Cr.key==="Tab"&&(Tr.value=Cr.shiftKey?1:0)}),Tr}function E$1(Tr,Cr,$r,Ar){n$2.isServer||watchEffect(Rr=>{Tr=Tr??window,Tr.addEventListener(Cr,$r,Ar),Rr(()=>Tr.removeEventListener(Cr,$r,Ar))})}function t(Tr){typeof queueMicrotask=="function"?queueMicrotask(Tr):Promise.resolve().then(Tr).catch(Cr=>setTimeout(()=>{throw Cr}))}var P$4=(Tr=>(Tr[Tr.None=1]="None",Tr[Tr.InitialFocus=2]="InitialFocus",Tr[Tr.TabLock=4]="TabLock",Tr[Tr.FocusLock=8]="FocusLock",Tr[Tr.RestoreFocus=16]="RestoreFocus",Tr[Tr.All=30]="All",Tr))(P$4||{});let le$2=Object.assign(defineComponent({name:"FocusTrap",props:{as:{type:[Object,String],default:"div"},initialFocus:{type:Object,default:null},features:{type:Number,default:30},containers:{type:Object,default:ref(new Set)}},inheritAttrs:!1,setup(Tr,{attrs:Cr,slots:$r,expose:Ar}){let Rr=ref(null);Ar({el:Rr,$el:Rr});let Dr=computed(()=>m$3(Rr));U$1({ownerDocument:Dr},computed(()=>!!(Tr.features&16)));let Mr=_({ownerDocument:Dr,container:Rr,initialFocus:computed(()=>Tr.initialFocus)},computed(()=>!!(Tr.features&2)));q({ownerDocument:Dr,container:Rr,containers:Tr.containers,previousActiveElement:Mr},computed(()=>!!(Tr.features&8)));let Br=n();function Nr(Ur){let Vr=o$1(Rr);Vr&&(jr=>jr())(()=>{u$5(Br.value,{[d$2.Forwards]:()=>{O$1(Vr,N.First,{skipElements:[Ur.relatedTarget]})},[d$2.Backwards]:()=>{O$1(Vr,N.Last,{skipElements:[Ur.relatedTarget]})}})})}let Lr=ref(!1);function Hr(Ur){Ur.key==="Tab"&&(Lr.value=!0,requestAnimationFrame(()=>{Lr.value=!1}))}function zr(Ur){var Vr;let jr=new Set((Vr=Tr.containers)==null?void 0:Vr.value);jr.add(Rr);let Gr=Ur.relatedTarget;Gr instanceof HTMLElement&&Gr.dataset.headlessuiFocusGuard!=="true"&&(B(jr,Gr)||(Lr.value?O$1(o$1(Rr),u$5(Br.value,{[d$2.Forwards]:()=>N.Next,[d$2.Backwards]:()=>N.Previous})|N.WrapAround,{relativeTo:Ur.target}):Ur.target instanceof HTMLElement&&H(Ur.target)))}return()=>{let Ur={},Vr={ref:Rr,onKeydown:Hr,onFocusout:zr},{features:jr,initialFocus:Gr,containers:Xr,...Kr}=Tr;return h$5(Fragment$1,[!!(jr&4)&&h$5(f$1,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:Nr,features:a$2.Focusable}),H$1({ourProps:Vr,theirProps:{...Cr,...Kr},slot:Ur,attrs:Cr,slots:$r,name:"FocusTrap"}),!!(jr&4)&&h$5(f$1,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:Nr,features:a$2.Focusable})])}}}),{features:P$4});function U$1({ownerDocument:Tr},Cr){let $r=ref(null);function Ar(){var Dr;$r.value||($r.value=(Dr=Tr.value)==null?void 0:Dr.activeElement)}function Rr(){!$r.value||(H($r.value),$r.value=null)}onMounted(()=>{watch(Cr,(Dr,Mr)=>{Dr!==Mr&&(Dr?Ar():Rr())},{immediate:!0})}),onUnmounted(Rr)}function _({ownerDocument:Tr,container:Cr,initialFocus:$r},Ar){let Rr=ref(null),Dr=ref(!1);return onMounted(()=>Dr.value=!0),onUnmounted(()=>Dr.value=!1),onMounted(()=>{watch([Cr,$r,Ar],(Mr,Br)=>{if(Mr.every((Lr,Hr)=>(Br==null?void 0:Br[Hr])===Lr)||!Ar.value)return;let Nr=o$1(Cr);!Nr||t(()=>{var Lr,Hr;if(!Dr.value)return;let zr=o$1($r),Ur=(Lr=Tr.value)==null?void 0:Lr.activeElement;if(zr){if(zr===Ur){Rr.value=Ur;return}}else if(Nr.contains(Ur)){Rr.value=Ur;return}zr?H(zr):O$1(Nr,N.First|N.NoScroll)===T$1.Error&&console.warn("There are no focusable elements inside the "),Rr.value=(Hr=Tr.value)==null?void 0:Hr.activeElement})},{immediate:!0,flush:"post"})}),Rr}function q({ownerDocument:Tr,container:Cr,containers:$r,previousActiveElement:Ar},Rr){var Dr;E$1((Dr=Tr.value)==null?void 0:Dr.defaultView,"focus",Mr=>{if(!Rr.value)return;let Br=new Set($r==null?void 0:$r.value);Br.add(Cr);let Nr=Ar.value;if(!Nr)return;let Lr=Mr.target;Lr&&Lr instanceof HTMLElement?B(Br,Lr)?(Ar.value=Lr,H(Lr)):(Mr.preventDefault(),Mr.stopPropagation(),H(Nr)):H(Ar.value)},!0)}function B(Tr,Cr){var $r;for(let Ar of Tr)if(($r=Ar.value)!=null&&$r.contains(Cr))return!0;return!1}let l$2="body > *",i$1=new Set,r=new Map;function u$2(Tr){Tr.setAttribute("aria-hidden","true"),Tr.inert=!0}function s(Tr){let Cr=r.get(Tr);!Cr||(Cr["aria-hidden"]===null?Tr.removeAttribute("aria-hidden"):Tr.setAttribute("aria-hidden",Cr["aria-hidden"]),Tr.inert=Cr.inert)}function g$2(Tr,Cr=ref(!0)){watchEffect($r=>{if(!Cr.value||!Tr.value)return;let Ar=Tr.value,Rr=m$3(Ar);if(Rr){i$1.add(Ar);for(let Dr of r.keys())Dr.contains(Ar)&&(s(Dr),r.delete(Dr));Rr.querySelectorAll(l$2).forEach(Dr=>{if(Dr instanceof HTMLElement){for(let Mr of i$1)if(Dr.contains(Mr))return;i$1.size===1&&(r.set(Dr,{"aria-hidden":Dr.getAttribute("aria-hidden"),inert:Dr.inert}),u$2(Dr))}}),$r(()=>{if(i$1.delete(Ar),i$1.size>0)Rr.querySelectorAll(l$2).forEach(Dr=>{if(Dr instanceof HTMLElement&&!r.has(Dr)){for(let Mr of i$1)if(Dr.contains(Mr))return;r.set(Dr,{"aria-hidden":Dr.getAttribute("aria-hidden"),inert:Dr.inert}),u$2(Dr)}});else for(let Dr of r.keys())s(Dr),r.delete(Dr)})}})}let e=Symbol("ForcePortalRootContext");function u$1(){return inject(e,!1)}let P$3=defineComponent({name:"ForcePortalRoot",props:{as:{type:[Object,String],default:"template"},force:{type:Boolean,default:!1}},setup(Tr,{slots:Cr,attrs:$r}){return provide(e,Tr.force),()=>{let{force:Ar,...Rr}=Tr;return H$1({theirProps:Rr,ourProps:{},slot:{},slots:Cr,attrs:$r,name:"ForcePortalRoot"})}}});function c$1(Tr){let Cr=m$3(Tr);if(!Cr){if(Tr===null)return null;throw new Error(`[Headless UI]: Cannot find ownerDocument for contextElement: ${Tr}`)}let $r=Cr.getElementById("headlessui-portal-root");if($r)return $r;let Ar=Cr.createElement("div");return Ar.setAttribute("id","headlessui-portal-root"),Cr.body.appendChild(Ar)}let R$1=defineComponent({name:"Portal",props:{as:{type:[Object,String],default:"div"}},setup(Tr,{slots:Cr,attrs:$r}){let Ar=ref(null),Rr=computed(()=>m$3(Ar)),Dr=u$1(),Mr=inject(g$1,null),Br=ref(Dr===!0||Mr==null?c$1(Ar.value):Mr.resolveTarget());return watchEffect(()=>{Dr||Mr!=null&&(Br.value=Mr.resolveTarget())}),onUnmounted(()=>{var Nr,Lr;let Hr=(Nr=Rr.value)==null?void 0:Nr.getElementById("headlessui-portal-root");!Hr||Br.value===Hr&&Br.value.children.length<=0&&((Lr=Br.value.parentElement)==null||Lr.removeChild(Br.value))}),()=>{if(Br.value===null)return null;let Nr={ref:Ar,"data-headlessui-portal":""};return h$5(Teleport,{to:Br.value},H$1({ourProps:Nr,theirProps:Tr,slot:{},attrs:$r,slots:Cr,name:"Portal"}))}}}),g$1=Symbol("PortalGroupContext"),L$2=defineComponent({name:"PortalGroup",props:{as:{type:[Object,String],default:"template"},target:{type:Object,default:null}},setup(Tr,{attrs:Cr,slots:$r}){let Ar=reactive({resolveTarget(){return Tr.target}});return provide(g$1,Ar),()=>{let{target:Rr,...Dr}=Tr;return H$1({theirProps:Dr,ourProps:{},slot:{},attrs:Cr,slots:$r,name:"PortalGroup"})}}}),u=Symbol("StackContext");var p$2=(Tr=>(Tr[Tr.Add=0]="Add",Tr[Tr.Remove=1]="Remove",Tr))(p$2||{});function v(){return inject(u,()=>{})}function S({type:Tr,enabled:Cr,element:$r,onUpdate:Ar}){let Rr=v();function Dr(...Mr){Ar==null||Ar(...Mr),Rr(...Mr)}onMounted(()=>{watch(Cr,(Mr,Br)=>{Mr?Dr(0,Tr,$r):Br===!0&&Dr(1,Tr,$r)},{immediate:!0,flush:"sync"})}),onUnmounted(()=>{Cr.value&&Dr(1,Tr,$r)}),provide(u,Dr)}let p$1=Symbol("DescriptionContext");function M({slot:Tr=ref({}),name:Cr="Description",props:$r={}}={}){let Ar=ref([]);function Rr(Dr){return Ar.value.push(Dr),()=>{let Mr=Ar.value.indexOf(Dr);Mr!==-1&&Ar.value.splice(Mr,1)}}return provide(p$1,{register:Rr,slot:Tr,name:Cr,props:$r}),computed(()=>Ar.value.length>0?Ar.value.join(" "):void 0)}function m$2(Tr){let Cr=shallowRef(Tr.getSnapshot());return onUnmounted(Tr.subscribe(()=>{Cr.value=Tr.getSnapshot()})),Cr}function o(){let Tr=[],Cr=[],$r={enqueue(Ar){Cr.push(Ar)},addEventListener(Ar,Rr,Dr,Mr){return Ar.addEventListener(Rr,Dr,Mr),$r.add(()=>Ar.removeEventListener(Rr,Dr,Mr))},requestAnimationFrame(...Ar){let Rr=requestAnimationFrame(...Ar);$r.add(()=>cancelAnimationFrame(Rr))},nextFrame(...Ar){$r.requestAnimationFrame(()=>{$r.requestAnimationFrame(...Ar)})},setTimeout(...Ar){let Rr=setTimeout(...Ar);$r.add(()=>clearTimeout(Rr))},add(Ar){Tr.push(Ar)},style(Ar,Rr,Dr){let Mr=Ar.style.getPropertyValue(Rr);return Object.assign(Ar.style,{[Rr]:Dr}),this.add(()=>{Object.assign(Ar.style,{[Rr]:Mr})})},dispose(){for(let Ar of Tr.splice(0))Ar()},async workQueue(){for(let Ar of Cr.splice(0))await Ar()}};return $r}function a$1(Tr,Cr){let $r=Tr(),Ar=new Set;return{getSnapshot(){return $r},subscribe(Rr){return Ar.add(Rr),()=>Ar.delete(Rr)},dispatch(Rr,...Dr){let Mr=Cr[Rr].call($r,...Dr);Mr&&($r=Mr,Ar.forEach(Br=>Br()))}}}function c(){let Tr;return{before({doc:Cr}){var $r;let Ar=Cr.documentElement;Tr=(($r=Cr.defaultView)!=null?$r:window).innerWidth-Ar.clientWidth},after({doc:Cr,d:$r}){let Ar=Cr.documentElement,Rr=Ar.clientWidth-Ar.offsetWidth,Dr=Tr-Rr;$r.style(Ar,"paddingRight",`${Dr}px`)}}}function p(){if(!t$1())return{};let Tr;return{before(){Tr=window.pageYOffset},after({doc:Cr,d:$r,meta:Ar}){function Rr(Mr){return Ar.containers.flatMap(Br=>Br()).some(Br=>Br.contains(Mr))}$r.style(Cr.body,"marginTop",`-${Tr}px`),window.scrollTo(0,0);let Dr=null;$r.addEventListener(Cr,"click",Mr=>{if(Mr.target instanceof HTMLElement)try{let Br=Mr.target.closest("a");if(!Br)return;let{hash:Nr}=new URL(Br.href),Lr=Cr.querySelector(Nr);Lr&&!Rr(Lr)&&(Dr=Lr)}catch{}},!0),$r.addEventListener(Cr,"touchmove",Mr=>{Mr.target instanceof HTMLElement&&!Rr(Mr.target)&&Mr.preventDefault()},{passive:!1}),$r.add(()=>{window.scrollTo(0,window.pageYOffset+Tr),Dr&&Dr.isConnected&&(Dr.scrollIntoView({block:"nearest"}),Dr=null)})}}}function l$1(){return{before({doc:Tr,d:Cr}){Cr.style(Tr.documentElement,"overflow","hidden")}}}function m$1(Tr){let Cr={};for(let $r of Tr)Object.assign(Cr,$r(Cr));return Cr}let a=a$1(()=>new Map,{PUSH(Tr,Cr){var $r;let Ar=($r=this.get(Tr))!=null?$r:{doc:Tr,count:0,d:o(),meta:new Set};return Ar.count++,Ar.meta.add(Cr),this.set(Tr,Ar),this},POP(Tr,Cr){let $r=this.get(Tr);return $r&&($r.count--,$r.meta.delete(Cr)),this},SCROLL_PREVENT({doc:Tr,d:Cr,meta:$r}){let Ar={doc:Tr,d:Cr,meta:m$1($r)},Rr=[p(),c(),l$1()];Rr.forEach(({before:Dr})=>Dr==null?void 0:Dr(Ar)),Rr.forEach(({after:Dr})=>Dr==null?void 0:Dr(Ar))},SCROLL_ALLOW({d:Tr}){Tr.dispose()},TEARDOWN({doc:Tr}){this.delete(Tr)}});a.subscribe(()=>{let Tr=a.getSnapshot(),Cr=new Map;for(let[$r]of Tr)Cr.set($r,$r.documentElement.style.overflow);for(let $r of Tr.values()){let Ar=Cr.get($r.doc)==="hidden",Rr=$r.count!==0;(Rr&&!Ar||!Rr&&Ar)&&a.dispatch($r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",$r),$r.count===0&&a.dispatch("TEARDOWN",$r)}});function d$1(Tr,Cr,$r){let Ar=m$2(a),Rr=computed(()=>{let Dr=Tr.value?Ar.value.get(Tr.value):void 0;return Dr?Dr.count>0:!1});return watch([Tr,Cr],([Dr,Mr],[Br],Nr)=>{if(!Dr||!Mr)return;a.dispatch("PUSH",Dr,$r);let Lr=!1;Nr(()=>{Lr||(a.dispatch("POP",Br??Dr,$r),Lr=!0)})},{immediate:!0}),Rr}var ve=(Tr=>(Tr[Tr.Open=0]="Open",Tr[Tr.Closed=1]="Closed",Tr))(ve||{});let L$1=Symbol("DialogContext");function P$2(Tr){let Cr=inject(L$1,null);if(Cr===null){let $r=new Error(`<${Tr} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace($r,P$2),$r}return Cr}let k="DC8F892D-2EBD-447C-A4C8-A03058436FF4",je=defineComponent({name:"Dialog",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:[Boolean,String],default:k},initialFocus:{type:Object,default:null},id:{type:String,default:()=>`headlessui-dialog-${t$3()}`}},emits:{close:Tr=>!0},setup(Tr,{emit:Cr,attrs:$r,slots:Ar,expose:Rr}){var Dr;let Mr=ref(!1);onMounted(()=>{Mr.value=!0});let Br=ref(0),Nr=p$4(),Lr=computed(()=>Tr.open===k&&Nr!==null?(Nr.value&l$3.Open)===l$3.Open:Tr.open),Hr=ref(new Set),zr=ref(null),Ur=ref(null),Vr=computed(()=>m$3(zr));if(Rr({el:zr,$el:zr}),!(Tr.open!==k||Nr!==null))throw new Error("You forgot to provide an `open` prop to the `Dialog`.");if(typeof Lr.value!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${Lr.value===k?void 0:Tr.open}`);let jr=computed(()=>Mr.value&&Lr.value?0:1),Gr=computed(()=>jr.value===0),Xr=computed(()=>Br.value>1),Kr=inject(L$1,null)!==null,Zr=computed(()=>Xr.value?"parent":"leaf"),eo=computed(()=>Nr!==null?(Nr.value&l$3.Closing)===l$3.Closing:!1),Wr=computed(()=>!Xr.value||eo.value?!1:Gr.value);g$2(zr,Wr),S({type:"Dialog",enabled:computed(()=>jr.value===0),element:zr,onUpdate:(po,go,co)=>{if(go==="Dialog")return u$5(po,{[p$2.Add](){Hr.value.add(co),Br.value+=1},[p$2.Remove](){Hr.value.delete(co),Br.value-=1}})}});let Yr=M({name:"DialogDescription",slot:computed(()=>({open:Lr.value}))}),Jr=ref(null),no={titleId:Jr,panelRef:ref(null),dialogState:jr,setTitleId(po){Jr.value!==po&&(Jr.value=po)},close(){Cr("close",!1)}};provide(L$1,no);function ro(){var po,go,co;return[...Array.from((go=(po=Vr.value)==null?void 0:po.querySelectorAll("html > *, body > *, [data-headlessui-portal]"))!=null?go:[]).filter(mo=>!(mo===document.body||mo===document.head||!(mo instanceof HTMLElement)||mo.contains(o$1(Ur))||no.panelRef.value&&mo.contains(no.panelRef.value))),(co=no.panelRef.value)!=null?co:zr.value]}let so=computed(()=>!(!Gr.value||Xr.value));y(()=>ro(),(po,go)=>{no.close(),nextTick(()=>go==null?void 0:go.focus())},so);let ao=computed(()=>!(Xr.value||jr.value!==0));E$1((Dr=Vr.value)==null?void 0:Dr.defaultView,"keydown",po=>{!ao.value||po.defaultPrevented||po.key===o$2.Escape&&(po.preventDefault(),po.stopPropagation(),no.close())});let lo=computed(()=>!(eo.value||jr.value!==0||Kr));return d$1(Vr,lo,po=>{var go;return{containers:[...(go=po.containers)!=null?go:[],ro]}}),watchEffect(po=>{if(jr.value!==0)return;let go=o$1(zr);if(!go)return;let co=new IntersectionObserver(mo=>{for(let io of mo)io.boundingClientRect.x===0&&io.boundingClientRect.y===0&&io.boundingClientRect.width===0&&io.boundingClientRect.height===0&&no.close()});co.observe(go),po(()=>co.disconnect())}),()=>{let{id:po,open:go,initialFocus:co,...mo}=Tr,io={...$r,ref:zr,id:po,role:"dialog","aria-modal":jr.value===0?!0:void 0,"aria-labelledby":Jr.value,"aria-describedby":Yr.value},uo={open:jr.value===0};return h$5(P$3,{force:!0},()=>[h$5(R$1,()=>h$5(L$2,{target:zr.value},()=>h$5(P$3,{force:!1},()=>h$5(le$2,{initialFocus:co,containers:Hr,features:Gr.value?u$5(Zr.value,{parent:le$2.features.RestoreFocus,leaf:le$2.features.All&~le$2.features.FocusLock}):le$2.features.None},()=>H$1({ourProps:io,theirProps:mo,slot:uo,attrs:$r,slots:Ar,visible:jr.value===0,features:N$1.RenderStrategy|N$1.Static,name:"Dialog"}))))),h$5(f$1,{features:a$2.Hidden,ref:Ur})])}}}),_e=defineComponent({name:"DialogPanel",props:{as:{type:[Object,String],default:"div"},id:{type:String,default:()=>`headlessui-dialog-panel-${t$3()}`}},setup(Tr,{attrs:Cr,slots:$r,expose:Ar}){let Rr=P$2("DialogPanel");Ar({el:Rr.panelRef,$el:Rr.panelRef});function Dr(Mr){Mr.stopPropagation()}return()=>{let{id:Mr,...Br}=Tr,Nr={id:Mr,ref:Rr.panelRef,onClick:Dr};return H$1({ourProps:Nr,theirProps:Br,slot:{open:Rr.dialogState.value===0},attrs:Cr,slots:$r,name:"DialogPanel"})}}});function se(Tr,Cr){return Tr===Cr}var de$1=(Tr=>(Tr[Tr.Open=0]="Open",Tr[Tr.Closed=1]="Closed",Tr))(de$1||{}),fe=(Tr=>(Tr[Tr.Single=0]="Single",Tr[Tr.Multi=1]="Multi",Tr))(fe||{}),pe$1=(Tr=>(Tr[Tr.Pointer=0]="Pointer",Tr[Tr.Other=1]="Other",Tr))(pe$1||{});function ce$2(Tr){requestAnimationFrame(()=>requestAnimationFrame(Tr))}let U=Symbol("ListboxContext");function E(Tr){let Cr=inject(U,null);if(Cr===null){let $r=new Error(`<${Tr} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace($r,E),$r}return Cr}let Ee=defineComponent({name:"Listbox",emits:{"update:modelValue":Tr=>!0},props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},by:{type:[String,Function],default:()=>se},horizontal:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean],default:void 0},defaultValue:{type:[Object,String,Number,Boolean],default:void 0},name:{type:String,optional:!0},multiple:{type:[Boolean],default:!1}},inheritAttrs:!1,setup(Tr,{slots:Cr,attrs:$r,emit:Ar}){let Rr=ref(1),Dr=ref(null),Mr=ref(null),Br=ref(null),Nr=ref([]),Lr=ref(""),Hr=ref(null),zr=ref(1);function Ur(Zr=eo=>eo){let eo=Hr.value!==null?Nr.value[Hr.value]:null,Wr=I(Zr(Nr.value.slice()),Jr=>o$1(Jr.dataRef.domRef)),Yr=eo?Wr.indexOf(eo):null;return Yr===-1&&(Yr=null),{options:Wr,activeOptionIndex:Yr}}let Vr=computed(()=>Tr.multiple?1:0),[jr,Gr]=d$3(computed(()=>Tr.modelValue===void 0?u$5(Vr.value,{1:[],0:void 0}):Tr.modelValue),Zr=>Ar("update:modelValue",Zr),computed(()=>Tr.defaultValue)),Xr={listboxState:Rr,value:jr,mode:Vr,compare(Zr,eo){if(typeof Tr.by=="string"){let Wr=Tr.by;return(Zr==null?void 0:Zr[Wr])===(eo==null?void 0:eo[Wr])}return Tr.by(Zr,eo)},orientation:computed(()=>Tr.horizontal?"horizontal":"vertical"),labelRef:Dr,buttonRef:Mr,optionsRef:Br,disabled:computed(()=>Tr.disabled),options:Nr,searchQuery:Lr,activeOptionIndex:Hr,activationTrigger:zr,closeListbox(){Tr.disabled||Rr.value!==1&&(Rr.value=1,Hr.value=null)},openListbox(){Tr.disabled||Rr.value!==0&&(Rr.value=0)},goToOption(Zr,eo,Wr){if(Tr.disabled||Rr.value===1)return;let Yr=Ur(),Jr=x$1(Zr===a$3.Specific?{focus:a$3.Specific,id:eo}:{focus:Zr},{resolveItems:()=>Yr.options,resolveActiveIndex:()=>Yr.activeOptionIndex,resolveId:no=>no.id,resolveDisabled:no=>no.dataRef.disabled});Lr.value="",Hr.value=Jr,zr.value=Wr??1,Nr.value=Yr.options},search(Zr){if(Tr.disabled||Rr.value===1)return;let eo=Lr.value!==""?0:1;Lr.value+=Zr.toLowerCase();let Wr=(Hr.value!==null?Nr.value.slice(Hr.value+eo).concat(Nr.value.slice(0,Hr.value+eo)):Nr.value).find(Jr=>Jr.dataRef.textValue.startsWith(Lr.value)&&!Jr.dataRef.disabled),Yr=Wr?Nr.value.indexOf(Wr):-1;Yr===-1||Yr===Hr.value||(Hr.value=Yr,zr.value=1)},clearSearch(){Tr.disabled||Rr.value!==1&&Lr.value!==""&&(Lr.value="")},registerOption(Zr,eo){let Wr=Ur(Yr=>[...Yr,{id:Zr,dataRef:eo}]);Nr.value=Wr.options,Hr.value=Wr.activeOptionIndex},unregisterOption(Zr){let eo=Ur(Wr=>{let Yr=Wr.findIndex(Jr=>Jr.id===Zr);return Yr!==-1&&Wr.splice(Yr,1),Wr});Nr.value=eo.options,Hr.value=eo.activeOptionIndex,zr.value=1},select(Zr){Tr.disabled||Gr(u$5(Vr.value,{0:()=>Zr,1:()=>{let eo=toRaw(Xr.value.value).slice(),Wr=toRaw(Zr),Yr=eo.findIndex(Jr=>Xr.compare(Wr,toRaw(Jr)));return Yr===-1?eo.push(Wr):eo.splice(Yr,1),eo}}))}};y([Mr,Br],(Zr,eo)=>{var Wr;Xr.closeListbox(),S$1(eo,F$1.Loose)||(Zr.preventDefault(),(Wr=o$1(Mr))==null||Wr.focus())},computed(()=>Rr.value===0)),provide(U,Xr),c$2(computed(()=>u$5(Rr.value,{0:l$3.Open,1:l$3.Closed})));let Kr=computed(()=>{var Zr;return(Zr=o$1(Mr))==null?void 0:Zr.closest("form")});return onMounted(()=>{watch([Kr],()=>{if(!Kr.value||Tr.defaultValue===void 0)return;function Zr(){Xr.select(Tr.defaultValue)}return Kr.value.addEventListener("reset",Zr),()=>{var eo;(eo=Kr.value)==null||eo.removeEventListener("reset",Zr)}},{immediate:!0})}),()=>{let{name:Zr,modelValue:eo,disabled:Wr,...Yr}=Tr,Jr={open:Rr.value===0,disabled:Wr,value:jr.value};return h$5(Fragment$1,[...Zr!=null&&jr.value!=null?e$1({[Zr]:jr.value}).map(([no,ro])=>h$5(f$1,K({features:a$2.Hidden,key:no,as:"input",type:"hidden",hidden:!0,readOnly:!0,name:no,value:ro}))):[],H$1({ourProps:{},theirProps:{...$r,...T$2(Yr,["defaultValue","onUpdate:modelValue","horizontal","multiple","by"])},slot:Jr,slots:Cr,attrs:$r,name:"Listbox"})])}}}),Ae=defineComponent({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"},id:{type:String,default:()=>`headlessui-listbox-button-${t$3()}`}},setup(Tr,{attrs:Cr,slots:$r,expose:Ar}){let Rr=E("ListboxButton");Ar({el:Rr.buttonRef,$el:Rr.buttonRef});function Dr(Lr){switch(Lr.key){case o$2.Space:case o$2.Enter:case o$2.ArrowDown:Lr.preventDefault(),Rr.openListbox(),nextTick(()=>{var Hr;(Hr=o$1(Rr.optionsRef))==null||Hr.focus({preventScroll:!0}),Rr.value.value||Rr.goToOption(a$3.First)});break;case o$2.ArrowUp:Lr.preventDefault(),Rr.openListbox(),nextTick(()=>{var Hr;(Hr=o$1(Rr.optionsRef))==null||Hr.focus({preventScroll:!0}),Rr.value.value||Rr.goToOption(a$3.Last)});break}}function Mr(Lr){switch(Lr.key){case o$2.Space:Lr.preventDefault();break}}function Br(Lr){Rr.disabled.value||(Rr.listboxState.value===0?(Rr.closeListbox(),nextTick(()=>{var Hr;return(Hr=o$1(Rr.buttonRef))==null?void 0:Hr.focus({preventScroll:!0})})):(Lr.preventDefault(),Rr.openListbox(),ce$2(()=>{var Hr;return(Hr=o$1(Rr.optionsRef))==null?void 0:Hr.focus({preventScroll:!0})})))}let Nr=b(computed(()=>({as:Tr.as,type:Cr.type})),Rr.buttonRef);return()=>{var Lr,Hr;let zr={open:Rr.listboxState.value===0,disabled:Rr.disabled.value,value:Rr.value.value},{id:Ur,...Vr}=Tr,jr={ref:Rr.buttonRef,id:Ur,type:Nr.value,"aria-haspopup":"listbox","aria-controls":(Lr=o$1(Rr.optionsRef))==null?void 0:Lr.id,"aria-expanded":Rr.disabled.value?void 0:Rr.listboxState.value===0,"aria-labelledby":Rr.labelRef.value?[(Hr=o$1(Rr.labelRef))==null?void 0:Hr.id,Ur].join(" "):void 0,disabled:Rr.disabled.value===!0?!0:void 0,onKeydown:Dr,onKeyup:Mr,onClick:Br};return H$1({ourProps:jr,theirProps:Vr,slot:zr,attrs:Cr,slots:$r,name:"ListboxButton"})}}}),Fe=defineComponent({name:"ListboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},id:{type:String,default:()=>`headlessui-listbox-options-${t$3()}`}},setup(Tr,{attrs:Cr,slots:$r,expose:Ar}){let Rr=E("ListboxOptions"),Dr=ref(null);Ar({el:Rr.optionsRef,$el:Rr.optionsRef});function Mr(Lr){switch(Dr.value&&clearTimeout(Dr.value),Lr.key){case o$2.Space:if(Rr.searchQuery.value!=="")return Lr.preventDefault(),Lr.stopPropagation(),Rr.search(Lr.key);case o$2.Enter:if(Lr.preventDefault(),Lr.stopPropagation(),Rr.activeOptionIndex.value!==null){let Hr=Rr.options.value[Rr.activeOptionIndex.value];Rr.select(Hr.dataRef.value)}Rr.mode.value===0&&(Rr.closeListbox(),nextTick(()=>{var Hr;return(Hr=o$1(Rr.buttonRef))==null?void 0:Hr.focus({preventScroll:!0})}));break;case u$5(Rr.orientation.value,{vertical:o$2.ArrowDown,horizontal:o$2.ArrowRight}):return Lr.preventDefault(),Lr.stopPropagation(),Rr.goToOption(a$3.Next);case u$5(Rr.orientation.value,{vertical:o$2.ArrowUp,horizontal:o$2.ArrowLeft}):return Lr.preventDefault(),Lr.stopPropagation(),Rr.goToOption(a$3.Previous);case o$2.Home:case o$2.PageUp:return Lr.preventDefault(),Lr.stopPropagation(),Rr.goToOption(a$3.First);case o$2.End:case o$2.PageDown:return Lr.preventDefault(),Lr.stopPropagation(),Rr.goToOption(a$3.Last);case o$2.Escape:Lr.preventDefault(),Lr.stopPropagation(),Rr.closeListbox(),nextTick(()=>{var Hr;return(Hr=o$1(Rr.buttonRef))==null?void 0:Hr.focus({preventScroll:!0})});break;case o$2.Tab:Lr.preventDefault(),Lr.stopPropagation();break;default:Lr.key.length===1&&(Rr.search(Lr.key),Dr.value=setTimeout(()=>Rr.clearSearch(),350));break}}let Br=p$4(),Nr=computed(()=>Br!==null?(Br.value&l$3.Open)===l$3.Open:Rr.listboxState.value===0);return()=>{var Lr,Hr,zr,Ur;let Vr={open:Rr.listboxState.value===0},{id:jr,...Gr}=Tr,Xr={"aria-activedescendant":Rr.activeOptionIndex.value===null||(Lr=Rr.options.value[Rr.activeOptionIndex.value])==null?void 0:Lr.id,"aria-multiselectable":Rr.mode.value===1?!0:void 0,"aria-labelledby":(Ur=(Hr=o$1(Rr.labelRef))==null?void 0:Hr.id)!=null?Ur:(zr=o$1(Rr.buttonRef))==null?void 0:zr.id,"aria-orientation":Rr.orientation.value,id:jr,onKeydown:Mr,role:"listbox",tabIndex:0,ref:Rr.optionsRef};return H$1({ourProps:Xr,theirProps:Gr,slot:Vr,attrs:Cr,slots:$r,features:N$1.RenderStrategy|N$1.Static,visible:Nr.value,name:"ListboxOptions"})}}}),Be$1=defineComponent({name:"ListboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String,Number,Boolean]},disabled:{type:Boolean,default:!1},id:{type:String,default:()=>`headlessui-listbox.option-${t$3()}`}},setup(Tr,{slots:Cr,attrs:$r,expose:Ar}){let Rr=E("ListboxOption"),Dr=ref(null);Ar({el:Dr,$el:Dr});let Mr=computed(()=>Rr.activeOptionIndex.value!==null?Rr.options.value[Rr.activeOptionIndex.value].id===Tr.id:!1),Br=computed(()=>u$5(Rr.mode.value,{0:()=>Rr.compare(toRaw(Rr.value.value),toRaw(Tr.value)),1:()=>toRaw(Rr.value.value).some(Xr=>Rr.compare(toRaw(Xr),toRaw(Tr.value)))})),Nr=computed(()=>u$5(Rr.mode.value,{1:()=>{var Xr;let Kr=toRaw(Rr.value.value);return((Xr=Rr.options.value.find(Zr=>Kr.some(eo=>Rr.compare(toRaw(eo),toRaw(Zr.dataRef.value)))))==null?void 0:Xr.id)===Tr.id},0:()=>Br.value})),Lr=computed(()=>({disabled:Tr.disabled,value:Tr.value,textValue:"",domRef:Dr}));onMounted(()=>{var Xr,Kr;let Zr=(Kr=(Xr=o$1(Dr))==null?void 0:Xr.textContent)==null?void 0:Kr.toLowerCase().trim();Zr!==void 0&&(Lr.value.textValue=Zr)}),onMounted(()=>Rr.registerOption(Tr.id,Lr)),onUnmounted(()=>Rr.unregisterOption(Tr.id)),onMounted(()=>{watch([Rr.listboxState,Br],()=>{Rr.listboxState.value===0&&(!Br.value||u$5(Rr.mode.value,{1:()=>{Nr.value&&Rr.goToOption(a$3.Specific,Tr.id)},0:()=>{Rr.goToOption(a$3.Specific,Tr.id)}}))},{immediate:!0})}),watchEffect(()=>{Rr.listboxState.value===0&&(!Mr.value||Rr.activationTrigger.value!==0&&nextTick(()=>{var Xr,Kr;return(Kr=(Xr=o$1(Dr))==null?void 0:Xr.scrollIntoView)==null?void 0:Kr.call(Xr,{block:"nearest"})}))});function Hr(Xr){if(Tr.disabled)return Xr.preventDefault();Rr.select(Tr.value),Rr.mode.value===0&&(Rr.closeListbox(),nextTick(()=>{var Kr;return(Kr=o$1(Rr.buttonRef))==null?void 0:Kr.focus({preventScroll:!0})}))}function zr(){if(Tr.disabled)return Rr.goToOption(a$3.Nothing);Rr.goToOption(a$3.Specific,Tr.id)}let Ur=u$3();function Vr(Xr){Ur.update(Xr)}function jr(Xr){!Ur.wasMoved(Xr)||Tr.disabled||Mr.value||Rr.goToOption(a$3.Specific,Tr.id,0)}function Gr(Xr){!Ur.wasMoved(Xr)||Tr.disabled||!Mr.value||Rr.goToOption(a$3.Nothing)}return()=>{let{disabled:Xr}=Tr,Kr={active:Mr.value,selected:Br.value,disabled:Xr},{id:Zr,value:eo,disabled:Wr,...Yr}=Tr,Jr={id:Zr,ref:Dr,role:"option",tabIndex:Xr===!0?void 0:-1,"aria-disabled":Xr===!0?!0:void 0,"aria-selected":Br.value,disabled:void 0,onClick:Hr,onFocus:zr,onPointerenter:Vr,onMouseenter:Vr,onPointermove:jr,onMousemove:jr,onPointerleave:Gr,onMouseleave:Gr};return H$1({ourProps:Jr,theirProps:Yr,slot:Kr,attrs:$r,slots:Cr,name:"ListboxOption"})}}});var X=(Tr=>(Tr[Tr.Open=0]="Open",Tr[Tr.Closed=1]="Closed",Tr))(X||{}),Y=(Tr=>(Tr[Tr.Pointer=0]="Pointer",Tr[Tr.Other=1]="Other",Tr))(Y||{});function Z$1(Tr){requestAnimationFrame(()=>requestAnimationFrame(Tr))}let A=Symbol("MenuContext");function P$1(Tr){let Cr=inject(A,null);if(Cr===null){let $r=new Error(`<${Tr} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace($r,P$1),$r}return Cr}let ge$2=defineComponent({name:"Menu",props:{as:{type:[Object,String],default:"template"}},setup(Tr,{slots:Cr,attrs:$r}){let Ar=ref(1),Rr=ref(null),Dr=ref(null),Mr=ref([]),Br=ref(""),Nr=ref(null),Lr=ref(1);function Hr(Ur=Vr=>Vr){let Vr=Nr.value!==null?Mr.value[Nr.value]:null,jr=I(Ur(Mr.value.slice()),Xr=>o$1(Xr.dataRef.domRef)),Gr=Vr?jr.indexOf(Vr):null;return Gr===-1&&(Gr=null),{items:jr,activeItemIndex:Gr}}let zr={menuState:Ar,buttonRef:Rr,itemsRef:Dr,items:Mr,searchQuery:Br,activeItemIndex:Nr,activationTrigger:Lr,closeMenu:()=>{Ar.value=1,Nr.value=null},openMenu:()=>Ar.value=0,goToItem(Ur,Vr,jr){let Gr=Hr(),Xr=x$1(Ur===a$3.Specific?{focus:a$3.Specific,id:Vr}:{focus:Ur},{resolveItems:()=>Gr.items,resolveActiveIndex:()=>Gr.activeItemIndex,resolveId:Kr=>Kr.id,resolveDisabled:Kr=>Kr.dataRef.disabled});Br.value="",Nr.value=Xr,Lr.value=jr??1,Mr.value=Gr.items},search(Ur){let Vr=Br.value!==""?0:1;Br.value+=Ur.toLowerCase();let jr=(Nr.value!==null?Mr.value.slice(Nr.value+Vr).concat(Mr.value.slice(0,Nr.value+Vr)):Mr.value).find(Xr=>Xr.dataRef.textValue.startsWith(Br.value)&&!Xr.dataRef.disabled),Gr=jr?Mr.value.indexOf(jr):-1;Gr===-1||Gr===Nr.value||(Nr.value=Gr,Lr.value=1)},clearSearch(){Br.value=""},registerItem(Ur,Vr){let jr=Hr(Gr=>[...Gr,{id:Ur,dataRef:Vr}]);Mr.value=jr.items,Nr.value=jr.activeItemIndex,Lr.value=1},unregisterItem(Ur){let Vr=Hr(jr=>{let Gr=jr.findIndex(Xr=>Xr.id===Ur);return Gr!==-1&&jr.splice(Gr,1),jr});Mr.value=Vr.items,Nr.value=Vr.activeItemIndex,Lr.value=1}};return y([Rr,Dr],(Ur,Vr)=>{var jr;zr.closeMenu(),S$1(Vr,F$1.Loose)||(Ur.preventDefault(),(jr=o$1(Rr))==null||jr.focus())},computed(()=>Ar.value===0)),provide(A,zr),c$2(computed(()=>u$5(Ar.value,{0:l$3.Open,1:l$3.Closed}))),()=>{let Ur={open:Ar.value===0,close:zr.closeMenu};return H$1({ourProps:{},theirProps:Tr,slot:Ur,slots:Cr,attrs:$r,name:"Menu"})}}}),Se$1=defineComponent({name:"MenuButton",props:{disabled:{type:Boolean,default:!1},as:{type:[Object,String],default:"button"},id:{type:String,default:()=>`headlessui-menu-button-${t$3()}`}},setup(Tr,{attrs:Cr,slots:$r,expose:Ar}){let Rr=P$1("MenuButton");Ar({el:Rr.buttonRef,$el:Rr.buttonRef});function Dr(Lr){switch(Lr.key){case o$2.Space:case o$2.Enter:case o$2.ArrowDown:Lr.preventDefault(),Lr.stopPropagation(),Rr.openMenu(),nextTick(()=>{var Hr;(Hr=o$1(Rr.itemsRef))==null||Hr.focus({preventScroll:!0}),Rr.goToItem(a$3.First)});break;case o$2.ArrowUp:Lr.preventDefault(),Lr.stopPropagation(),Rr.openMenu(),nextTick(()=>{var Hr;(Hr=o$1(Rr.itemsRef))==null||Hr.focus({preventScroll:!0}),Rr.goToItem(a$3.Last)});break}}function Mr(Lr){switch(Lr.key){case o$2.Space:Lr.preventDefault();break}}function Br(Lr){Tr.disabled||(Rr.menuState.value===0?(Rr.closeMenu(),nextTick(()=>{var Hr;return(Hr=o$1(Rr.buttonRef))==null?void 0:Hr.focus({preventScroll:!0})})):(Lr.preventDefault(),Rr.openMenu(),Z$1(()=>{var Hr;return(Hr=o$1(Rr.itemsRef))==null?void 0:Hr.focus({preventScroll:!0})})))}let Nr=b(computed(()=>({as:Tr.as,type:Cr.type})),Rr.buttonRef);return()=>{var Lr;let Hr={open:Rr.menuState.value===0},{id:zr,...Ur}=Tr,Vr={ref:Rr.buttonRef,id:zr,type:Nr.value,"aria-haspopup":"menu","aria-controls":(Lr=o$1(Rr.itemsRef))==null?void 0:Lr.id,"aria-expanded":Tr.disabled?void 0:Rr.menuState.value===0,onKeydown:Dr,onKeyup:Mr,onClick:Br};return H$1({ourProps:Vr,theirProps:Ur,slot:Hr,attrs:Cr,slots:$r,name:"MenuButton"})}}}),be=defineComponent({name:"MenuItems",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},id:{type:String,default:()=>`headlessui-menu-items-${t$3()}`}},setup(Tr,{attrs:Cr,slots:$r,expose:Ar}){let Rr=P$1("MenuItems"),Dr=ref(null);Ar({el:Rr.itemsRef,$el:Rr.itemsRef}),p$3({container:computed(()=>o$1(Rr.itemsRef)),enabled:computed(()=>Rr.menuState.value===0),accept(Hr){return Hr.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:Hr.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(Hr){Hr.setAttribute("role","none")}});function Mr(Hr){var zr;switch(Dr.value&&clearTimeout(Dr.value),Hr.key){case o$2.Space:if(Rr.searchQuery.value!=="")return Hr.preventDefault(),Hr.stopPropagation(),Rr.search(Hr.key);case o$2.Enter:if(Hr.preventDefault(),Hr.stopPropagation(),Rr.activeItemIndex.value!==null){let Ur=Rr.items.value[Rr.activeItemIndex.value];(zr=o$1(Ur.dataRef.domRef))==null||zr.click()}Rr.closeMenu(),v$1(o$1(Rr.buttonRef));break;case o$2.ArrowDown:return Hr.preventDefault(),Hr.stopPropagation(),Rr.goToItem(a$3.Next);case o$2.ArrowUp:return Hr.preventDefault(),Hr.stopPropagation(),Rr.goToItem(a$3.Previous);case o$2.Home:case o$2.PageUp:return Hr.preventDefault(),Hr.stopPropagation(),Rr.goToItem(a$3.First);case o$2.End:case o$2.PageDown:return Hr.preventDefault(),Hr.stopPropagation(),Rr.goToItem(a$3.Last);case o$2.Escape:Hr.preventDefault(),Hr.stopPropagation(),Rr.closeMenu(),nextTick(()=>{var Ur;return(Ur=o$1(Rr.buttonRef))==null?void 0:Ur.focus({preventScroll:!0})});break;case o$2.Tab:Hr.preventDefault(),Hr.stopPropagation(),Rr.closeMenu(),nextTick(()=>D(o$1(Rr.buttonRef),Hr.shiftKey?N.Previous:N.Next));break;default:Hr.key.length===1&&(Rr.search(Hr.key),Dr.value=setTimeout(()=>Rr.clearSearch(),350));break}}function Br(Hr){switch(Hr.key){case o$2.Space:Hr.preventDefault();break}}let Nr=p$4(),Lr=computed(()=>Nr!==null?(Nr.value&l$3.Open)===l$3.Open:Rr.menuState.value===0);return()=>{var Hr,zr;let Ur={open:Rr.menuState.value===0},{id:Vr,...jr}=Tr,Gr={"aria-activedescendant":Rr.activeItemIndex.value===null||(Hr=Rr.items.value[Rr.activeItemIndex.value])==null?void 0:Hr.id,"aria-labelledby":(zr=o$1(Rr.buttonRef))==null?void 0:zr.id,id:Vr,onKeydown:Mr,onKeyup:Br,role:"menu",tabIndex:0,ref:Rr.itemsRef};return H$1({ourProps:Gr,theirProps:jr,slot:Ur,attrs:Cr,slots:$r,features:N$1.RenderStrategy|N$1.Static,visible:Lr.value,name:"MenuItems"})}}}),Me=defineComponent({name:"MenuItem",inheritAttrs:!1,props:{as:{type:[Object,String],default:"template"},disabled:{type:Boolean,default:!1},id:{type:String,default:()=>`headlessui-menu-item-${t$3()}`}},setup(Tr,{slots:Cr,attrs:$r,expose:Ar}){let Rr=P$1("MenuItem"),Dr=ref(null);Ar({el:Dr,$el:Dr});let Mr=computed(()=>Rr.activeItemIndex.value!==null?Rr.items.value[Rr.activeItemIndex.value].id===Tr.id:!1),Br=computed(()=>({disabled:Tr.disabled,textValue:"",domRef:Dr}));onMounted(()=>{var jr,Gr;let Xr=(Gr=(jr=o$1(Dr))==null?void 0:jr.textContent)==null?void 0:Gr.toLowerCase().trim();Xr!==void 0&&(Br.value.textValue=Xr)}),onMounted(()=>Rr.registerItem(Tr.id,Br)),onUnmounted(()=>Rr.unregisterItem(Tr.id)),watchEffect(()=>{Rr.menuState.value===0&&(!Mr.value||Rr.activationTrigger.value!==0&&nextTick(()=>{var jr,Gr;return(Gr=(jr=o$1(Dr))==null?void 0:jr.scrollIntoView)==null?void 0:Gr.call(jr,{block:"nearest"})}))});function Nr(jr){if(Tr.disabled)return jr.preventDefault();Rr.closeMenu(),v$1(o$1(Rr.buttonRef))}function Lr(){if(Tr.disabled)return Rr.goToItem(a$3.Nothing);Rr.goToItem(a$3.Specific,Tr.id)}let Hr=u$3();function zr(jr){Hr.update(jr)}function Ur(jr){!Hr.wasMoved(jr)||Tr.disabled||Mr.value||Rr.goToItem(a$3.Specific,Tr.id,0)}function Vr(jr){!Hr.wasMoved(jr)||Tr.disabled||!Mr.value||Rr.goToItem(a$3.Nothing)}return()=>{let{disabled:jr}=Tr,Gr={active:Mr.value,disabled:jr,close:Rr.closeMenu},{id:Xr,...Kr}=Tr;return H$1({ourProps:{id:Xr,ref:Dr,role:"menuitem",tabIndex:jr===!0?void 0:-1,"aria-disabled":jr===!0?!0:void 0,disabled:void 0,onClick:Nr,onFocus:Lr,onPointerenter:zr,onMouseenter:zr,onPointermove:Ur,onMousemove:Ur,onPointerleave:Vr,onMouseleave:Vr},theirProps:{...$r,...Kr},slot:Gr,attrs:$r,slots:Cr,name:"MenuItem"})}}});var ce$1=(Tr=>(Tr[Tr.Open=0]="Open",Tr[Tr.Closed=1]="Closed",Tr))(ce$1||{});let te=Symbol("PopoverContext");function W(Tr){let Cr=inject(te,null);if(Cr===null){let $r=new Error(`<${Tr} /> is missing a parent <${Pe.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace($r,W),$r}return Cr}let oe=Symbol("PopoverGroupContext");function ne$1(){return inject(oe,null)}let le$1=Symbol("PopoverPanelContext");function de(){return inject(le$1,null)}let Pe=defineComponent({name:"Popover",props:{as:{type:[Object,String],default:"div"}},setup(Tr,{slots:Cr,attrs:$r,expose:Ar}){var Rr;let Dr=ref(null);Ar({el:Dr,$el:Dr});let Mr=ref(1),Br=ref(null),Nr=ref(null),Lr=ref(null),Hr=ref(null),zr=computed(()=>m$3(Dr)),Ur=computed(()=>{var Zr,eo;if(!o$1(Br)||!o$1(Hr))return!1;for(let ao of document.querySelectorAll("body > *"))if(Number(ao==null?void 0:ao.contains(o$1(Br)))^Number(ao==null?void 0:ao.contains(o$1(Hr))))return!0;let Wr=d$4(),Yr=Wr.indexOf(o$1(Br)),Jr=(Yr+Wr.length-1)%Wr.length,no=(Yr+1)%Wr.length,ro=Wr[Jr],so=Wr[no];return!((Zr=o$1(Hr))!=null&&Zr.contains(ro))&&!((eo=o$1(Hr))!=null&&eo.contains(so))}),Vr={popoverState:Mr,buttonId:ref(null),panelId:ref(null),panel:Hr,button:Br,isPortalled:Ur,beforePanelSentinel:Nr,afterPanelSentinel:Lr,togglePopover(){Mr.value=u$5(Mr.value,{0:1,1:0})},closePopover(){Mr.value!==1&&(Mr.value=1)},close(Zr){Vr.closePopover();let eo=(()=>Zr?Zr instanceof HTMLElement?Zr:Zr.value instanceof HTMLElement?o$1(Zr):o$1(Vr.button):o$1(Vr.button))();eo==null||eo.focus()}};provide(te,Vr),c$2(computed(()=>u$5(Mr.value,{0:l$3.Open,1:l$3.Closed})));let jr={buttonId:Vr.buttonId,panelId:Vr.panelId,close(){Vr.closePopover()}},Gr=ne$1(),Xr=Gr==null?void 0:Gr.registerPopover;function Kr(){var Zr,eo,Wr,Yr;return(Yr=Gr==null?void 0:Gr.isFocusWithinPopoverGroup())!=null?Yr:((Zr=zr.value)==null?void 0:Zr.activeElement)&&(((eo=o$1(Br))==null?void 0:eo.contains(zr.value.activeElement))||((Wr=o$1(Hr))==null?void 0:Wr.contains(zr.value.activeElement)))}return watchEffect(()=>Xr==null?void 0:Xr(jr)),E$1((Rr=zr.value)==null?void 0:Rr.defaultView,"focus",Zr=>{var eo,Wr;Mr.value===0&&(Kr()||!Br||!Hr||Zr.target!==window&&((eo=o$1(Vr.beforePanelSentinel))!=null&&eo.contains(Zr.target)||(Wr=o$1(Vr.afterPanelSentinel))!=null&&Wr.contains(Zr.target)||Vr.closePopover()))},!0),y([Br,Hr],(Zr,eo)=>{var Wr;Vr.closePopover(),S$1(eo,F$1.Loose)||(Zr.preventDefault(),(Wr=o$1(Br))==null||Wr.focus())},computed(()=>Mr.value===0)),()=>{let Zr={open:Mr.value===0,close:Vr.close};return H$1({theirProps:Tr,ourProps:{ref:Dr},slot:Zr,slots:Cr,attrs:$r,name:"Popover"})}}}),Be=defineComponent({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1},id:{type:String,default:()=>`headlessui-popover-button-${t$3()}`}},inheritAttrs:!1,setup(Tr,{attrs:Cr,slots:$r,expose:Ar}){let Rr=W("PopoverButton"),Dr=computed(()=>m$3(Rr.button));Ar({el:Rr.button,$el:Rr.button}),onMounted(()=>{Rr.buttonId.value=Tr.id}),onUnmounted(()=>{Rr.buttonId.value=null});let Mr=ne$1(),Br=Mr==null?void 0:Mr.closeOthers,Nr=de(),Lr=computed(()=>Nr===null?!1:Nr.value===Rr.panelId.value),Hr=ref(null),zr=`headlessui-focus-sentinel-${t$3()}`;Lr.value||watchEffect(()=>{Rr.button.value=Hr.value});let Ur=b(computed(()=>({as:Tr.as,type:Cr.type})),Hr);function Vr(Kr){var Zr,eo,Wr,Yr,Jr;if(Lr.value){if(Rr.popoverState.value===1)return;switch(Kr.key){case o$2.Space:case o$2.Enter:Kr.preventDefault(),(eo=(Zr=Kr.target).click)==null||eo.call(Zr),Rr.closePopover(),(Wr=o$1(Rr.button))==null||Wr.focus();break}}else switch(Kr.key){case o$2.Space:case o$2.Enter:Kr.preventDefault(),Kr.stopPropagation(),Rr.popoverState.value===1&&(Br==null||Br(Rr.buttonId.value)),Rr.togglePopover();break;case o$2.Escape:if(Rr.popoverState.value!==0)return Br==null?void 0:Br(Rr.buttonId.value);if(!o$1(Rr.button)||(Yr=Dr.value)!=null&&Yr.activeElement&&!((Jr=o$1(Rr.button))!=null&&Jr.contains(Dr.value.activeElement)))return;Kr.preventDefault(),Kr.stopPropagation(),Rr.closePopover();break}}function jr(Kr){Lr.value||Kr.key===o$2.Space&&Kr.preventDefault()}function Gr(Kr){var Zr,eo;Tr.disabled||(Lr.value?(Rr.closePopover(),(Zr=o$1(Rr.button))==null||Zr.focus()):(Kr.preventDefault(),Kr.stopPropagation(),Rr.popoverState.value===1&&(Br==null||Br(Rr.buttonId.value)),Rr.togglePopover(),(eo=o$1(Rr.button))==null||eo.focus()))}function Xr(Kr){Kr.preventDefault(),Kr.stopPropagation()}return()=>{let Kr=Rr.popoverState.value===0,Zr={open:Kr},{id:eo,...Wr}=Tr,Yr=Lr.value?{ref:Hr,type:Ur.value,onKeydown:Vr,onClick:Gr}:{ref:Hr,id:eo,type:Ur.value,"aria-expanded":Tr.disabled?void 0:Rr.popoverState.value===0,"aria-controls":o$1(Rr.panel)?Rr.panelId.value:void 0,disabled:Tr.disabled?!0:void 0,onKeydown:Vr,onKeyup:jr,onClick:Gr,onMousedown:Xr},Jr=n();function no(){let ro=o$1(Rr.panel);if(!ro)return;function so(){u$5(Jr.value,{[d$2.Forwards]:()=>O$1(ro,N.First),[d$2.Backwards]:()=>O$1(ro,N.Last)})===T$1.Error&&O$1(d$4().filter(ao=>ao.dataset.headlessuiFocusGuard!=="true"),u$5(Jr.value,{[d$2.Forwards]:N.Next,[d$2.Backwards]:N.Previous}),{relativeTo:o$1(Rr.button)})}so()}return h$5(Fragment$1,[H$1({ourProps:Yr,theirProps:{...Cr,...Wr},slot:Zr,attrs:Cr,slots:$r,name:"PopoverButton"}),Kr&&!Lr.value&&Rr.isPortalled.value&&h$5(f$1,{id:zr,features:a$2.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:no})])}}}),He=defineComponent({name:"PopoverPanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},focus:{type:Boolean,default:!1},id:{type:String,default:()=>`headlessui-popover-panel-${t$3()}`}},inheritAttrs:!1,setup(Tr,{attrs:Cr,slots:$r,expose:Ar}){let{focus:Rr}=Tr,Dr=W("PopoverPanel"),Mr=computed(()=>m$3(Dr.panel)),Br=`headlessui-focus-sentinel-before-${t$3()}`,Nr=`headlessui-focus-sentinel-after-${t$3()}`;Ar({el:Dr.panel,$el:Dr.panel}),onMounted(()=>{Dr.panelId.value=Tr.id}),onUnmounted(()=>{Dr.panelId.value=null}),provide(le$1,Dr.panelId),watchEffect(()=>{var Xr,Kr;if(!Rr||Dr.popoverState.value!==0||!Dr.panel)return;let Zr=(Xr=Mr.value)==null?void 0:Xr.activeElement;(Kr=o$1(Dr.panel))!=null&&Kr.contains(Zr)||O$1(o$1(Dr.panel),N.First)});let Lr=p$4(),Hr=computed(()=>Lr!==null?(Lr.value&l$3.Open)===l$3.Open:Dr.popoverState.value===0);function zr(Xr){var Kr,Zr;switch(Xr.key){case o$2.Escape:if(Dr.popoverState.value!==0||!o$1(Dr.panel)||Mr.value&&!((Kr=o$1(Dr.panel))!=null&&Kr.contains(Mr.value.activeElement)))return;Xr.preventDefault(),Xr.stopPropagation(),Dr.closePopover(),(Zr=o$1(Dr.button))==null||Zr.focus();break}}function Ur(Xr){var Kr,Zr,eo,Wr,Yr;let Jr=Xr.relatedTarget;!Jr||!o$1(Dr.panel)||(Kr=o$1(Dr.panel))!=null&&Kr.contains(Jr)||(Dr.closePopover(),((eo=(Zr=o$1(Dr.beforePanelSentinel))==null?void 0:Zr.contains)!=null&&eo.call(Zr,Jr)||(Yr=(Wr=o$1(Dr.afterPanelSentinel))==null?void 0:Wr.contains)!=null&&Yr.call(Wr,Jr))&&Jr.focus({preventScroll:!0}))}let Vr=n();function jr(){let Xr=o$1(Dr.panel);if(!Xr)return;function Kr(){u$5(Vr.value,{[d$2.Forwards]:()=>{var Zr;O$1(Xr,N.First)===T$1.Error&&((Zr=o$1(Dr.afterPanelSentinel))==null||Zr.focus())},[d$2.Backwards]:()=>{var Zr;(Zr=o$1(Dr.button))==null||Zr.focus({preventScroll:!0})}})}Kr()}function Gr(){let Xr=o$1(Dr.panel);if(!Xr)return;function Kr(){u$5(Vr.value,{[d$2.Forwards]:()=>{let Zr=o$1(Dr.button),eo=o$1(Dr.panel);if(!Zr)return;let Wr=d$4(),Yr=Wr.indexOf(Zr),Jr=Wr.slice(0,Yr+1),no=[...Wr.slice(Yr+1),...Jr];for(let ro of no.slice())if(ro.dataset.headlessuiFocusGuard==="true"||eo!=null&&eo.contains(ro)){let so=no.indexOf(ro);so!==-1&&no.splice(so,1)}O$1(no,N.First,{sorted:!1})},[d$2.Backwards]:()=>{var Zr;O$1(Xr,N.Previous)===T$1.Error&&((Zr=o$1(Dr.button))==null||Zr.focus())}})}Kr()}return()=>{let Xr={open:Dr.popoverState.value===0,close:Dr.close},{id:Kr,focus:Zr,...eo}=Tr,Wr={ref:Dr.panel,id:Kr,onKeydown:zr,onFocusout:Rr&&Dr.popoverState.value===0?Ur:void 0,tabIndex:-1};return H$1({ourProps:Wr,theirProps:{...Cr,...eo},attrs:Cr,slot:Xr,slots:{...$r,default:(...Yr)=>{var Jr;return[h$5(Fragment$1,[Hr.value&&Dr.isPortalled.value&&h$5(f$1,{id:Br,ref:Dr.beforePanelSentinel,features:a$2.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:jr}),(Jr=$r.default)==null?void 0:Jr.call($r,...Yr),Hr.value&&Dr.isPortalled.value&&h$5(f$1,{id:Nr,ref:Dr.afterPanelSentinel,features:a$2.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:Gr})])]}},features:N$1.RenderStrategy|N$1.Static,visible:Hr.value,name:"PopoverPanel"})}}});function l(Tr){let Cr={called:!1};return(...$r)=>{if(!Cr.called)return Cr.called=!0,Tr(...$r)}}function m(Tr,...Cr){Tr&&Cr.length>0&&Tr.classList.add(...Cr)}function d(Tr,...Cr){Tr&&Cr.length>0&&Tr.classList.remove(...Cr)}var g=(Tr=>(Tr.Finished="finished",Tr.Cancelled="cancelled",Tr))(g||{});function F(Tr,Cr){let $r=o();if(!Tr)return $r.dispose;let{transitionDuration:Ar,transitionDelay:Rr}=getComputedStyle(Tr),[Dr,Mr]=[Ar,Rr].map(Br=>{let[Nr=0]=Br.split(",").filter(Boolean).map(Lr=>Lr.includes("ms")?parseFloat(Lr):parseFloat(Lr)*1e3).sort((Lr,Hr)=>Hr-Lr);return Nr});return Dr!==0?$r.setTimeout(()=>Cr("finished"),Dr+Mr):Cr("finished"),$r.add(()=>Cr("cancelled")),$r.dispose}function L(Tr,Cr,$r,Ar,Rr,Dr){let Mr=o(),Br=Dr!==void 0?l(Dr):()=>{};return d(Tr,...Rr),m(Tr,...Cr,...$r),Mr.nextFrame(()=>{d(Tr,...$r),m(Tr,...Ar),Mr.add(F(Tr,Nr=>(d(Tr,...Ar,...Cr),m(Tr,...Rr),Br(Nr))))}),Mr.add(()=>d(Tr,...Cr,...$r,...Ar,...Rr)),Mr.add(()=>Br("cancelled")),Mr.dispose}function T(Tr=""){return Tr.split(" ").filter(Cr=>Cr.trim().length>1)}let O=Symbol("TransitionContext");var pe=(Tr=>(Tr.Visible="visible",Tr.Hidden="hidden",Tr))(pe||{});function me(){return inject(O,null)!==null}function Te(){let Tr=inject(O,null);if(Tr===null)throw new Error("A is used but it is missing a parent .");return Tr}function ge$1(){let Tr=inject(R,null);if(Tr===null)throw new Error("A is used but it is missing a parent .");return Tr}let R=Symbol("NestingContext");function x(Tr){return"children"in Tr?x(Tr.children):Tr.value.filter(({state:Cr})=>Cr==="visible").length>0}function J(Tr){let Cr=ref([]),$r=ref(!1);onMounted(()=>$r.value=!0),onUnmounted(()=>$r.value=!1);function Ar(Dr,Mr=S$2.Hidden){let Br=Cr.value.findIndex(({id:Nr})=>Nr===Dr);Br!==-1&&(u$5(Mr,{[S$2.Unmount](){Cr.value.splice(Br,1)},[S$2.Hidden](){Cr.value[Br].state="hidden"}}),!x(Cr)&&$r.value&&(Tr==null||Tr()))}function Rr(Dr){let Mr=Cr.value.find(({id:Br})=>Br===Dr);return Mr?Mr.state!=="visible"&&(Mr.state="visible"):Cr.value.push({id:Dr,state:"visible"}),()=>Ar(Dr,S$2.Unmount)}return{children:Cr,register:Rr,unregister:Ar}}let Q=N$1.RenderStrategy,he=defineComponent({props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:""},enterFrom:{type:[String],default:""},enterTo:{type:[String],default:""},entered:{type:[String],default:""},leave:{type:[String],default:""},leaveFrom:{type:[String],default:""},leaveTo:{type:[String],default:""}},emits:{beforeEnter:()=>!0,afterEnter:()=>!0,beforeLeave:()=>!0,afterLeave:()=>!0},setup(Tr,{emit:Cr,attrs:$r,slots:Ar,expose:Rr}){let Dr=ref(0);function Mr(){Dr.value|=l$3.Opening,Cr("beforeEnter")}function Br(){Dr.value&=~l$3.Opening,Cr("afterEnter")}function Nr(){Dr.value|=l$3.Closing,Cr("beforeLeave")}function Lr(){Dr.value&=~l$3.Closing,Cr("afterLeave")}if(!me()&&C())return()=>h$5(Se,{...Tr,onBeforeEnter:Mr,onAfterEnter:Br,onBeforeLeave:Nr,onAfterLeave:Lr},Ar);let Hr=ref(null),zr=ref("visible"),Ur=computed(()=>Tr.unmount?S$2.Unmount:S$2.Hidden);Rr({el:Hr,$el:Hr});let{show:Vr,appear:jr}=Te(),{register:Gr,unregister:Xr}=ge$1(),Kr={value:!0},Zr=t$3(),eo={value:!1},Wr=J(()=>{!eo.value&&zr.value!=="hidden"&&(zr.value="hidden",Xr(Zr),Lr())});onMounted(()=>{let go=Gr(Zr);onUnmounted(go)}),watchEffect(()=>{if(Ur.value===S$2.Hidden&&Zr){if(Vr&&zr.value!=="visible"){zr.value="visible";return}u$5(zr.value,{hidden:()=>Xr(Zr),visible:()=>Gr(Zr)})}});let Yr=T(Tr.enter),Jr=T(Tr.enterFrom),no=T(Tr.enterTo),ro=T(Tr.entered),so=T(Tr.leave),ao=T(Tr.leaveFrom),lo=T(Tr.leaveTo);onMounted(()=>{watchEffect(()=>{if(zr.value==="visible"){let go=o$1(Hr);if(go instanceof Comment&&go.data==="")throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}})});function po(go){let co=Kr.value&&!jr.value,mo=o$1(Hr);!mo||!(mo instanceof HTMLElement)||co||(eo.value=!0,Vr.value&&Mr(),Vr.value||Nr(),go(Vr.value?L(mo,Yr,Jr,no,ro,io=>{eo.value=!1,io===g.Finished&&Br()}):L(mo,so,ao,lo,ro,io=>{eo.value=!1,io===g.Finished&&(x(Wr)||(zr.value="hidden",Xr(Zr),Lr()))})))}return onMounted(()=>{watch([Vr],(go,co,mo)=>{po(mo),Kr.value=!1},{immediate:!0})}),provide(R,Wr),c$2(computed(()=>u$5(zr.value,{visible:l$3.Open,hidden:l$3.Closed})|Dr.value)),()=>{let{appear:go,show:co,enter:mo,enterFrom:io,enterTo:uo,entered:ho,leave:yo,leaveFrom:So,leaveTo:ko,...$o}=Tr,Go={ref:Hr},No={...$o,...jr&&Vr&&n$2.isServer?{class:normalizeClass([$o.class,...Yr,...Jr])}:{}};return H$1({theirProps:No,ourProps:Go,slot:{},slots:Ar,attrs:$r,features:Q,visible:zr.value==="visible",name:"TransitionChild"})}}}),ce=he,Se=defineComponent({inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:""},enterFrom:{type:[String],default:""},enterTo:{type:[String],default:""},entered:{type:[String],default:""},leave:{type:[String],default:""},leaveFrom:{type:[String],default:""},leaveTo:{type:[String],default:""}},emits:{beforeEnter:()=>!0,afterEnter:()=>!0,beforeLeave:()=>!0,afterLeave:()=>!0},setup(Tr,{emit:Cr,attrs:$r,slots:Ar}){let Rr=p$4(),Dr=computed(()=>Tr.show===null&&Rr!==null?(Rr.value&l$3.Open)===l$3.Open:Tr.show);watchEffect(()=>{if(![!0,!1].includes(Dr.value))throw new Error('A is used but it is missing a `:show="true | false"` prop.')});let Mr=ref(Dr.value?"visible":"hidden"),Br=J(()=>{Mr.value="hidden"}),Nr=ref(!0),Lr={show:Dr,appear:computed(()=>Tr.appear||!Nr.value)};return onMounted(()=>{watchEffect(()=>{Nr.value=!1,Dr.value?Mr.value="visible":x(Br)||(Mr.value="hidden")})}),provide(R,Br),provide(O,Lr),()=>{let Hr=T$2(Tr,["show","appear","unmount","onBeforeEnter","onBeforeLeave","onAfterEnter","onAfterLeave"]),zr={unmount:Tr.unmount};return H$1({ourProps:{...zr,as:"template"},theirProps:{},slot:{},slots:{...Ar,default:()=>[h$5(ce,{onBeforeEnter:()=>Cr("beforeEnter"),onAfterEnter:()=>Cr("afterEnter"),onBeforeLeave:()=>Cr("beforeLeave"),onAfterLeave:()=>Cr("afterLeave"),...$r,...zr,...Hr},Ar.default)]},attrs:{},features:Q,visible:Mr.value==="visible",name:"Transition"})}}});const _sfc_main$1q=defineComponent({__name:"PrezoSlideIn",props:{show:{type:Boolean}},emits:["close"],setup(Tr,{emit:Cr}){const $r=Cr;inject("isMobile");const Ar=Tr,{show:Rr}=toRefs$1(Ar);useUserStore(),ref(!0);const Dr=()=>{$r("close")};return(Mr,Br)=>(openBlock(),createBlock(unref(Se),{appear:"",show:unref(Rr),as:"template",class:"dialog"},{default:withCtx(()=>[createVNode(unref(je),{as:"div",style:{position:"fixed",inset:0,zIndex:999}},{default:withCtx(()=>[createVNode(unref(he),{as:"template",enter:"duration-500 transition-for-slide-in","enter-from":"opacity-0","enter-to":"opacity-50",leave:"duration-300 ease-in","leave-from":"opacity-50","leave-to":"opacity-0"},{default:withCtx(()=>[createBaseVNode("div",{class:"w-full h-full slide-in-bg",onClick:Dr})]),_:1}),createVNode(unref(he),{as:"template",enter:"duration-300 transition-for-slide-in","enter-from":"opacity-0 translate-y-full","enter-to":"opacity-1 translate-y-0",leave:"duration-300 ease-in","leave-from":"opacity-100 translate-y-0","leave-to":"opacity-0 translate-y-full",ref:"dialogPanelRef"},{default:withCtx(()=>[createVNode(unref(_e),{class:"absolute w-full bottom-0 rounded-t-xl bg-white overflow-hidden"},{default:withCtx(()=>[renderSlot(Mr.$slots,"content",{close:Dr,open:unref(Rr)},void 0,!0)]),_:3})]),_:3},512)]),_:3})]),_:3},8,["show"]))}}),PrezoSlideIn_vue_vue_type_style_index_0_scoped_9aec8a06_lang="",PrezoSlideIn=_export_sfc(_sfc_main$1q,[["__scopeId","data-v-9aec8a06"]]),_hoisted_1$Z={class:"flex justify-between items-center self-stretch p-2"},_hoisted_2$M=createBaseVNode("div",{class:"flex justify-center items-center py-2 px-2.5 w-[36px] h-[36px] gap-2"},null,-1),_hoisted_3$C={class:"text-base font-semibold text-neutralSolid-1000"},_sfc_main$1p=defineComponent({__name:"MobileSlideOutHeader",props:{title:{}},emits:["tapped-close"],setup(Tr,{emit:Cr}){const $r=Cr;return(Ar,Rr)=>(openBlock(),createElementBlock("div",_hoisted_1$Z,[_hoisted_2$M,createBaseVNode("label",_hoisted_3$C,toDisplayString(Ar.title),1),createBaseVNode("button",{onClick:Rr[0]||(Rr[0]=Dr=>$r("tapped-close")),class:normalizeClass(["w-[36px] h-[36px] flex items-center justify-center rounded-lg p-1.5 gap-2.5",{"hover:bg-neutral-100":!0,"active:bg-neutral-200":!0}])},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-close-mobile.svg"),vProps:{width:20,height:20}},null,8,["src"])])]))}});var SLIDE_IN_COMPONENTS=(Tr=>(Tr.ORG_SWITCHER="ORG_SWITCHER",Tr.UPGRADE_TO_TEAMS="UPGRADE_TO_TEAMS",Tr.TEAM_REQUEST_FORM="TEAM_REQUEST_FORM",Tr.VIEW_ONLY="VIEW_ONLY",Tr.FOLDER_LIST="FOLDER_LIST",Tr.SHARING_MENU="SHARING_MENU",Tr.ICON_PICKER="ICON_PICKER",Tr.PDF_SETTINGS="PDF_SETTINGS",Tr.PUBLISH_SETTINGS="PUBLISH_SETTINGS",Tr.SUBDOMAIN_SETTINGS="SUBDOMAIN_SETTINGS",Tr.AI_GEN_SETTINGS="AI_GEN_SETTINGS",Tr.SIGN_IN="SIGN_IN",Tr))(SLIDE_IN_COMPONENTS||{});const useOverlayStore=defineStore("overlayStore",{state:()=>({componentsShowing:[]}),getters:{isSlideInComponentShowing:Tr=>Cr=>Tr.componentsShowing.includes(Cr)},actions:{hideSlideInComponents(Tr){this.componentsShowing=this.componentsShowing.filter(Cr=>Cr!==Tr)},async showSlideInComponent(Tr,Cr){if(Cr&&Cr.replace){this.hideSlideInComponents(Cr.replace),window.setTimeout(()=>{this.componentsShowing.includes(Tr)||this.componentsShowing.push(Tr)},300);return}this.componentsShowing.includes(Tr)||this.componentsShowing.push(Tr)}}}),_hoisted_1$Y={class:"flex flex-col items-center justify-start"},_hoisted_2$L={class:"flex flex-col items-start gap-3 self-stretch p-3 pt-0 sm:p-2 text-[14px] sm:custom-truncate"},_hoisted_3$B={class:"flex flex-col items-start self-stretch"},_hoisted_4$t={class:"flex items-center self-stretch h-7 py-[5px] pl-2 grow"},_hoisted_5$m={class:"text-neutralSolid-500 text-sm font-medium"},_hoisted_6$l=["onClick"],_hoisted_7$i={class:"text-base sm:text-sm font-medium truncate"},_hoisted_8$d={class:"flex flex-col items-start w-full"},_hoisted_9$d=createBaseVNode("label",{class:"text-base text-neutralSolid-1000 font-medium"},"Upgrade for teams",-1),_hoisted_10$b=createBaseVNode("label",{class:"text-base text-neutralSolid-1000 font-medium"},"Log out",-1),_sfc_main$1o=defineComponent({__name:"OrgSwitcher",emits:["change-org","user-profile-option-clicked"],setup(Tr,{emit:Cr}){const $r=Cr,Ar=useUserStore(),Rr=useOverlayStore(),Dr=useFolderStore(),Mr=useAppStore(),Br=inject("isMobile"),Nr=computed(()=>Ar.currentOrgId),Lr=computed(()=>Ar.userData.email),Hr=computed(()=>Ar.userFullName),zr=computed(()=>Ar.getOrgName(Nr.value)),Ur=computed(()=>Dr.privateSystemFolderId),Vr=computed(()=>Dr.workspaceSystemFolderId);computed(()=>Dr.sharedFolderId);const jr=computed(()=>Ar.showWorkspaceView),Gr=computed(()=>jr.value?Vr.value:Ur.value);computed(()=>zr.value||Hr.value);const Xr=computed(()=>{const ro={};return Object.values(Ar.orgs).forEach(so=>{so.membership!=="guest"&&(ro[so.id]=so)}),ro}),Kr=computed(()=>Rr.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.ORG_SWITCHER)),Zr=()=>{Rr.hideSlideInComponents(SLIDE_IN_COMPONENTS.ORG_SWITCHER)},eo=async()=>{await Rr.showSlideInComponent(SLIDE_IN_COMPONENTS.UPGRADE_TO_TEAMS,{replace:SLIDE_IN_COMPONENTS.ORG_SWITCHER})},Wr=ro=>Ar.getOrgAvatarUrl(ro),Yr=async()=>{Zr(),await logout()},Jr=async ro=>{const so=ro.orgs.id;await Mr.handleOrgChange({newOrgId:so});const ao=Gr.value;ao&&(await Dr.fetchAndHydrateFolderContents(ao),Dr.setCurrentFolderId(ao))},no=ro=>{$r("change-org",ro),Jr(ro),Zr()};return(ro,so)=>(openBlock(),createBlock(PrezoSlideIn,{show:Kr.value,onClose:Zr},{content:withCtx(({close:ao})=>[createBaseVNode("div",_hoisted_1$Y,[unref(Br)?(openBlock(),createBlock(_sfc_main$1p,{key:0,title:"Account",onTappedClose:lo=>ao()},null,8,["onTappedClose"])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_2$L,[createBaseVNode("div",_hoisted_3$B,[createBaseVNode("div",_hoisted_4$t,[createBaseVNode("label",_hoisted_5$m,toDisplayString(Lr.value),1)]),(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Xr.value,lo=>{var po,go;return openBlock(),createElementBlock("div",{key:lo.id,class:normalizeClass(["three-part-btn gap-2 relative p-2 rounded-[8px] cursor-default mb-1",{"bg-neutral-100":Nr.value===lo.orgs.id,"bg-white hover:bg-neutral-50 active:bg-neutral-100":Nr.value!==lo.orgs.id}]),onClick:co=>no(lo)},[createVNode(_sfc_main$1r,{avatarUrl:Wr(lo.org_id),name:(po=lo.orgs)==null?void 0:po.name,isSmallSquare:!0,style:{width:"32px",height:"32px","min-width":"32px"}},null,8,["avatarUrl","name"]),createBaseVNode("label",_hoisted_7$i,toDisplayString((go=lo.orgs)==null?void 0:go.name),1),Nr.value===lo.orgs.id?(openBlock(),createBlock(_sfc_main$1v,{key:0,style:{paddingRight:"4px"},src:unref(assetUrl)("icon-check.svg"),vProps:{width:16,height:16}},null,8,["src"])):createCommentVNode("",!0)],10,_hoisted_6$l)}),128))]),createBaseVNode("div",_hoisted_8$d,[createBaseVNode("button",{class:normalizeClass(["flex w-full items-center px-2 py-3 rounded-lg gap-2",{"hover:bg-neutral-100":!0,"active:bg-neutral-200":!0}]),onClick:eo},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-briefcase.svg"),vProps:{width:24,height:24}},null,8,["src"]),_hoisted_9$d]),createBaseVNode("button",{class:normalizeClass(["flex w-full items-center px-2 py-3 rounded-lg gap-2",{"hover:bg-neutral-100":!0,"active:bg-neutral-200":!0}]),onClick:Yr},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-log-out.svg"),vProps:{width:24,height:24}},null,8,["src"]),_hoisted_10$b])])])])]),_:1},8,["show"]))}}),_imports_0$2=""+globalThis.__publicAssetsURL("icons/upgrade.gif"),_withScopeId$8=Tr=>(pushScopeId("data-v-c60eb638"),Tr=Tr(),popScopeId(),Tr),_hoisted_1$X={key:1,class:"py-4 px-6 font-[500] text-[18px] flex items-center justify-center md:justify-start"},_hoisted_2$K={class:"sm:p-3 pt-0 flex flex-col items-center"},_hoisted_3$A={class:"py-6 px-4 flex flex-col items-center justify-center gap-6"},_hoisted_4$s=_withScopeId$8(()=>createBaseVNode("div",{class:"flex flex-col items-center justify-center gap-3"},[createBaseVNode("img",{src:_imports_0$2,alt:"Be patient...",class:"w-10 h-10"}),createBaseVNode("p",{class:"text-style-clipped text-[28px] font-[500] font-heading leading-[28px] mt-1"},"Prezo for teams"),createBaseVNode("p",{class:"text-[#9E9E9E] text-[14px] leading-[1.32] font-[400]"},"Get more out of Prezo as a team, use advanced AI features for your business.")],-1)),_hoisted_5$l={class:"flex items-center justify-center w-full gap-3 flex-wrap"},_hoisted_6$k={class:"flex items-center gap-2"},_hoisted_7$h={class:"text-[#0D0C0C] text-[14px] leading-[1.32] font-[500]"},_hoisted_8$c={class:"text-[#9E9E9E] text-[12px] leading-[1.32] font-[400]"},_hoisted_9$c={class:"text-[16px] leading-[1.32]"},_sfc_main$1n=defineComponent({__name:"UpgradeAISettings",emits:["close","clicked-team-request"],setup(Tr,{emit:Cr}){const $r=Cr,Ar=useMiscStore();useRouteInfo(),inject("currentAppId");const Rr=inject("isMobile"),Dr=ref([{id:"team",label:"Collaboration",icon:"icon-briefcase.svg",description:"Invite your team to collaborate on your prezos. Receive version history, analytics, comments and more."},{id:"branding",label:"Branding",icon:"icon-star-in-a-box.svg",description:"Set your brand colors, fonts and logos. Make prezos that reflect your brand identity."},{id:"templates",label:"AI Templates",icon:"icon-library.svg",description:"Use advanced AI to create and fill templates for your specific use cases. Save hours of repetitive work and let AI do the heavy lifting."}]),Mr=ref(!1),Br=()=>{if(Rr.value){$r("clicked-team-request");return}Ar.setShowTeamModal(!0)};return(Nr,Lr)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["flex flex-col w-full h-full overflow-auto md:overflow-hidden hide-scrollbar",{"max-h-[calc(100dvh-24px)]":unref(Rr)}])},[unref(Rr)?(openBlock(),createBlock(_sfc_main$1p,{key:0,title:"Upgrade for teams",onTappedClose:Lr[0]||(Lr[0]=Hr=>$r("close"))})):(openBlock(),createElementBlock("div",_hoisted_1$X,"Upgrade for teams")),createBaseVNode("div",_hoisted_2$K,[createBaseVNode("div",_hoisted_3$A,[_hoisted_4$s,createBaseVNode("div",_hoisted_5$l,[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(unref(Dr),Hr=>(openBlock(),createElementBlock("div",{key:Hr.id,class:"flex-1 flex flex-col p-4 gap-2 min-w-[200px] card-for-value self-stretch"},[createBaseVNode("div",_hoisted_6$k,[createVNode(_sfc_main$1v,{src:unref(assetUrl)(Hr.icon),vProps:{width:20,height:20}},null,8,["src"]),createBaseVNode("p",_hoisted_7$h,toDisplayString(Hr.label),1)]),createBaseVNode("p",_hoisted_8$c,toDisplayString(Hr.description),1)]))),128))]),createVNode(Button,{purpose:"primary",disabled:unref(Mr),style:normalizeStyle([{padding:"8px 16px",height:"38px",borderRadius:"12px"},unref(Mr)?{pointerEvents:"none",opacity:.5}:{}]),onClick:Br},{content:withCtx(()=>[createBaseVNode("p",_hoisted_9$c,toDisplayString(unref(Mr)?"Sent request":"Request a demo"),1)]),_:1},8,["disabled","style"])])])],2))}}),UpgradeAISettings_vue_vue_type_style_index_0_scoped_c60eb638_lang="",UpgradeAISettings=_export_sfc(_sfc_main$1n,[["__scopeId","data-v-c60eb638"]]),_sfc_main$1m=defineComponent({__name:"UpgradeAISettingsWrapper",emits:["change-org","user-profile-option-clicked"],setup(Tr,{emit:Cr}){useUserStore();const $r=useOverlayStore();inject("isMobile");const Ar=computed(()=>$r.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.UPGRADE_TO_TEAMS)),Rr=()=>{$r.hideSlideInComponents(SLIDE_IN_COMPONENTS.UPGRADE_TO_TEAMS)},Dr=()=>{$r.showSlideInComponent(SLIDE_IN_COMPONENTS.TEAM_REQUEST_FORM)};return(Mr,Br)=>(openBlock(),createBlock(PrezoSlideIn,{show:Ar.value,onClose:Rr},{content:withCtx(({})=>[createVNode(UpgradeAISettings,{onClose:Rr,onClickedTeamRequest:Dr})]),_:1},8,["show"]))}}),showNotiForSuccess=({deckId:Tr,isHome:Cr,text:$r})=>{const Ar=useMiscStore(),Rr=useAppStore();if(Cr){Ar.setHomeNotification({noti:{type:"info",text:$r,hangTime:5e3,showInProgress:!1},show:!0});return}Tr&&Rr.setNotif(Tr,{text:$r,showEmoji:!1,persistent:!1,isProminent:!1,showInProgress:!1,showTag:!1,hangTime:5e3})};function getInternetExplorerVersion(){var Tr=window.navigator.userAgent,Cr=Tr.indexOf("MSIE ");if(Cr>0)return parseInt(Tr.substring(Cr+5,Tr.indexOf(".",Cr)),10);var $r=Tr.indexOf("Trident/");if($r>0){var Ar=Tr.indexOf("rv:");return parseInt(Tr.substring(Ar+3,Tr.indexOf(".",Ar)),10)}var Rr=Tr.indexOf("Edge/");return Rr>0?parseInt(Tr.substring(Rr+5,Tr.indexOf(".",Rr)),10):-1}let isIE;function initCompat(){initCompat.init||(initCompat.init=!0,isIE=getInternetExplorerVersion()!==-1)}var script={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){initCompat(),nextTick(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const Tr=document.createElement("object");this._resizeObject=Tr,Tr.setAttribute("aria-hidden","true"),Tr.setAttribute("tabindex",-1),Tr.onload=this.addResizeHandlers,Tr.type="text/html",isIE&&this.$el.appendChild(Tr),Tr.data="about:blank",isIE||this.$el.appendChild(Tr)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!isIE&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const _withId=withScopeId();pushScopeId("data-v-b329ee4c");const _hoisted_1$W={class:"resize-observer",tabindex:"-1"};popScopeId();const render=_withId((Tr,Cr,$r,Ar,Rr,Dr)=>(openBlock(),createBlock("div",_hoisted_1$W)));script.render=render;script.__scopeId="data-v-b329ee4c";script.__file="src/components/ResizeObserver.vue";function _typeof$1(Tr){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$1=function(Cr){return typeof Cr}:_typeof$1=function(Cr){return Cr&&typeof Symbol=="function"&&Cr.constructor===Symbol&&Cr!==Symbol.prototype?"symbol":typeof Cr},_typeof$1(Tr)}function _classCallCheck$1(Tr,Cr){if(!(Tr instanceof Cr))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(Tr,Cr){for(var $r=0;$rTr.length)&&(Cr=Tr.length);for(var $r=0,Ar=new Array(Cr);$r2&&arguments[2]!==void 0?arguments[2]:{},Ar,Rr,Dr,Mr=function(Nr){for(var Lr=arguments.length,Hr=new Array(Lr>1?Lr-1:0),zr=1;zr1){var Lr=Br.find(function(zr){return zr.isIntersecting});Lr&&(Nr=Lr)}if(Rr.callback){var Hr=Nr.isIntersecting&&Nr.intersectionRatio>=Rr.threshold;if(Hr===Rr.oldResult)return;Rr.oldResult=Hr,Rr.callback(Hr,Nr)}},this.options.intersection),nextTick(function(){Rr.observer&&Rr.observer.observe(Rr.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),Tr}();function beforeMount(Tr,Cr,$r){var Ar=Cr.value;if(Ar)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var Rr=new VisibilityState(Tr,Ar,$r);Tr._vue_visibilityState=Rr}}function updated(Tr,Cr,$r){var Ar=Cr.value,Rr=Cr.oldValue;if(!deepEqual(Ar,Rr)){var Dr=Tr._vue_visibilityState;if(!Ar){unmounted(Tr);return}Dr?Dr.createObserver(Ar,$r):beforeMount(Tr,{value:Ar},$r)}}function unmounted(Tr){var Cr=Tr._vue_visibilityState;Cr&&(Cr.destroyObserver(),delete Tr._vue_visibilityState)}var ObserveVisibility={beforeMount,updated,unmounted},config$2={itemsLimit:1e3},regex$6=/(auto|scroll)/;function parents(Tr,Cr){return Tr.parentNode===null?Cr:parents(Tr.parentNode,Cr.concat([Tr]))}var style=function(Cr,$r){return getComputedStyle(Cr,null).getPropertyValue($r)},overflow=function(Cr){return style(Cr,"overflow")+style(Cr,"overflow-y")+style(Cr,"overflow-x")},scroll=function(Cr){return regex$6.test(overflow(Cr))};function getScrollParent(Tr){if(Tr instanceof HTMLElement||Tr instanceof SVGElement){for(var Cr=parents(Tr.parentNode,[]),$r=0;$r{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const Tr=this.$_lastUpdateScrollPosition;typeof Tr=="number"&&this.$nextTick(()=>{this.scrollToPosition(Tr)})},beforeUnmount(){this.removeListeners()},methods:{addView(Tr,Cr,$r,Ar,Rr){const Dr=markRaw({id:uid++,index:Cr,used:!0,key:Ar,type:Rr}),Mr=shallowReactive({item:$r,position:0,nr:Dr});return Tr.push(Mr),Mr},unuseView(Tr,Cr=!1){const $r=this.$_unusedViews,Ar=Tr.nr.type;let Rr=$r.get(Ar);Rr||(Rr=[],$r.set(Ar,Rr)),Rr.push(Tr),Cr||(Tr.nr.used=!1,Tr.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(Tr){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const Cr=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:$r}=this.updateVisibleItems(!1,!0);$r||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});Cr(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&Cr()},this.updateInterval))}},handleVisibilityChange(Tr,Cr){this.ready&&(Tr||Cr.boundingClientRect.width!==0||Cr.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(Tr,Cr=!1){const $r=this.itemSize,Ar=this.gridItems||1,Rr=this.itemSecondarySize||$r,Dr=this.$_computedMinItemSize,Mr=this.typeField,Br=this.simpleArray?null:this.keyField,Nr=this.items,Lr=Nr.length,Hr=this.sizes,zr=this.$_views,Ur=this.$_unusedViews,Vr=this.pool,jr=this.itemIndexByKey;let Gr,Xr,Kr,Zr,eo;if(!Lr)Gr=Xr=Zr=eo=Kr=0;else if(this.$_prerender)Gr=Zr=0,Xr=eo=Math.min(this.prerender,Nr.length),Kr=null;else{const ao=this.getScroll();if(Cr){let go=ao.start-this.$_lastUpdateScrollPosition;if(go<0&&(go=-go),$r===null&&goao.start&&(mo=io),io=~~((co+mo)/2);while(io!==uo);for(io<0&&(io=0),Gr=io,Kr=Hr[Lr-1].accumulator,Xr=io;XrLr&&(Xr=Lr)),Zr=Gr;ZrLr&&(Xr=Lr),Zr<0&&(Zr=0),eo>Lr&&(eo=Lr),Kr=Math.ceil(Lr/Ar)*$r}}Xr-Gr>config$2.itemsLimit&&this.itemsLimitError(),this.totalSize=Kr;let Wr;const Yr=Gr<=this.$_endIndex&&Xr>=this.$_startIndex;if(Yr)for(let ao=0,lo=Vr.length;ao=Xr)&&this.unuseView(Wr));const Jr=Yr?null:new Map;let no,ro,so;for(let ao=Gr;ao=po.length)&&(Wr=this.addView(Vr,ao,no,lo,ro),this.unuseView(Wr,!0),po=Ur.get(ro)),Wr=po[so],Jr.set(ro,so+1)),zr.delete(Wr.nr.key),Wr.nr.used=!0,Wr.nr.index=ao,Wr.nr.key=lo,Wr.nr.type=ro,zr.set(lo,Wr),go=!0;else if(!Wr.nr.used&&(Wr.nr.used=!0,go=!0,po)){const co=po.indexOf(Wr);co!==-1&&po.splice(co,1)}Wr.item=no,go&&(ao===Nr.length-1&&this.$emit("scroll-end"),ao===0&&this.$emit("scroll-start")),$r===null?(Wr.position=Hr[ao-1].accumulator,Wr.offset=0):(Wr.position=Math.floor(ao/Ar)*$r,Wr.offset=ao%Ar*Rr)}return this.$_startIndex=Gr,this.$_endIndex=Xr,this.emitUpdate&&this.$emit("update",Gr,Xr,Zr,eo),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:Yr}},getListenerTarget(){let Tr=getScrollParent(this.$el);return window.document&&(Tr===window.document.documentElement||Tr===window.document.body)&&(Tr=window),Tr},getScroll(){const{$el:Tr,direction:Cr}=this,$r=Cr==="vertical";let Ar;if(this.pageMode){const Rr=Tr.getBoundingClientRect(),Dr=$r?Rr.height:Rr.width;let Mr=-($r?Rr.top:Rr.left),Br=$r?window.innerHeight:window.innerWidth;Mr<0&&(Br+=Mr,Mr=0),Mr+Br>Dr&&(Br=Dr-Mr),Ar={start:Mr,end:Mr+Br}}else $r?Ar={start:Tr.scrollTop,end:Tr.scrollTop+Tr.clientHeight}:Ar={start:Tr.scrollLeft,end:Tr.scrollLeft+Tr.clientWidth};return Ar},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,supportsPassive?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(Tr){let Cr;const $r=this.gridItems||1;this.itemSize===null?Cr=Tr>0?this.sizes[Tr-1].accumulator:0:Cr=Math.floor(Tr/$r)*this.itemSize,this.scrollToPosition(Cr)},scrollToPosition(Tr){const Cr=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let $r,Ar,Rr;if(this.pageMode){const Dr=getScrollParent(this.$el),Mr=Dr.tagName==="HTML"?0:Dr[Cr.scroll],Br=Dr.getBoundingClientRect(),Lr=this.$el.getBoundingClientRect()[Cr.start]-Br[Cr.start];$r=Dr,Ar=Cr.scroll,Rr=Tr+Mr+Lr}else $r=this.$el,Ar=Cr.scroll,Rr=Tr;$r[Ar]=Rr},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((Tr,Cr)=>Tr.nr.index-Cr.nr.index)}}};const _hoisted_1$V={key:0,ref:"before",class:"vue-recycle-scroller__slot"},_hoisted_2$J={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function render$1(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("ResizeObserver"),Br=resolveDirective("observe-visibility");return withDirectives((openBlock(),createElementBlock("div",{class:normalizeClass(["vue-recycle-scroller",{ready:Rr.ready,"page-mode":$r.pageMode,[`direction-${Tr.direction}`]:!0}]),onScrollPassive:Cr[0]||(Cr[0]=(...Nr)=>Dr.handleScroll&&Dr.handleScroll(...Nr))},[Tr.$slots.before?(openBlock(),createElementBlock("div",_hoisted_1$V,[renderSlot(Tr.$slots,"before")],512)):createCommentVNode("v-if",!0),(openBlock(),createBlock(resolveDynamicComponent($r.listTag),{ref:"wrapper",style:normalizeStyle({[Tr.direction==="vertical"?"minHeight":"minWidth"]:Rr.totalSize+"px"}),class:normalizeClass(["vue-recycle-scroller__item-wrapper",$r.listClass])},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Rr.pool,Nr=>(openBlock(),createBlock(resolveDynamicComponent($r.itemTag),mergeProps({key:Nr.nr.id,style:Rr.ready?{transform:`translate${Tr.direction==="vertical"?"Y":"X"}(${Nr.position}px) translate${Tr.direction==="vertical"?"X":"Y"}(${Nr.offset}px)`,width:$r.gridItems?`${Tr.direction==="vertical"&&$r.itemSecondarySize||$r.itemSize}px`:void 0,height:$r.gridItems?`${Tr.direction==="horizontal"&&$r.itemSecondarySize||$r.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[$r.itemClass,{hover:!$r.skipHover&&Rr.hoverKey===Nr.nr.key}]]},toHandlers($r.skipHover?{}:{mouseenter:()=>{Rr.hoverKey=Nr.nr.key},mouseleave:()=>{Rr.hoverKey=null}})),{default:withCtx(()=>[renderSlot(Tr.$slots,"default",{item:Nr.item,index:Nr.nr.index,active:Nr.nr.used})]),_:2},1040,["style","class"]))),128)),renderSlot(Tr.$slots,"empty")]),_:3},8,["style","class"])),Tr.$slots.after?(openBlock(),createElementBlock("div",_hoisted_2$J,[renderSlot(Tr.$slots,"after")],512)):createCommentVNode("v-if",!0),createVNode(Mr,{onNotify:Dr.handleResize},null,8,["onNotify"])],34)),[[Br,Dr.handleVisibilityChange]])}script$2.render=render$1;script$2.__file="src/components/RecycleScroller.vue";const vueVirtualScroller="";function isArray(Tr){return Array.isArray?Array.isArray(Tr):getTag(Tr)==="[object Array]"}const INFINITY=1/0;function baseToString(Tr){if(typeof Tr=="string")return Tr;let Cr=Tr+"";return Cr=="0"&&1/Tr==-INFINITY?"-0":Cr}function toString(Tr){return Tr==null?"":baseToString(Tr)}function isString$3(Tr){return typeof Tr=="string"}function isNumber$1(Tr){return typeof Tr=="number"}function isBoolean(Tr){return Tr===!0||Tr===!1||isObjectLike(Tr)&&getTag(Tr)=="[object Boolean]"}function isObject$2(Tr){return typeof Tr=="object"}function isObjectLike(Tr){return isObject$2(Tr)&&Tr!==null}function isDefined(Tr){return Tr!=null}function isBlank(Tr){return!Tr.trim().length}function getTag(Tr){return Tr==null?Tr===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(Tr)}const EXTENDED_SEARCH_UNAVAILABLE="Extended search is not available",INCORRECT_INDEX_TYPE="Incorrect 'index' type",LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY=Tr=>`Invalid value for key ${Tr}`,PATTERN_LENGTH_TOO_LARGE=Tr=>`Pattern length exceeds max of ${Tr}.`,MISSING_KEY_PROPERTY=Tr=>`Missing ${Tr} property in key`,INVALID_KEY_WEIGHT_VALUE=Tr=>`Property 'weight' in key '${Tr}' must be a positive integer`,hasOwn=Object.prototype.hasOwnProperty;class KeyStore{constructor(Cr){this._keys=[],this._keyMap={};let $r=0;Cr.forEach(Ar=>{let Rr=createKey(Ar);$r+=Rr.weight,this._keys.push(Rr),this._keyMap[Rr.id]=Rr,$r+=Rr.weight}),this._keys.forEach(Ar=>{Ar.weight/=$r})}get(Cr){return this._keyMap[Cr]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function createKey(Tr){let Cr=null,$r=null,Ar=null,Rr=1,Dr=null;if(isString$3(Tr)||isArray(Tr))Ar=Tr,Cr=createKeyPath(Tr),$r=createKeyId(Tr);else{if(!hasOwn.call(Tr,"name"))throw new Error(MISSING_KEY_PROPERTY("name"));const Mr=Tr.name;if(Ar=Mr,hasOwn.call(Tr,"weight")&&(Rr=Tr.weight,Rr<=0))throw new Error(INVALID_KEY_WEIGHT_VALUE(Mr));Cr=createKeyPath(Mr),$r=createKeyId(Mr),Dr=Tr.getFn}return{path:Cr,id:$r,weight:Rr,src:Ar,getFn:Dr}}function createKeyPath(Tr){return isArray(Tr)?Tr:Tr.split(".")}function createKeyId(Tr){return isArray(Tr)?Tr.join("."):Tr}function get(Tr,Cr){let $r=[],Ar=!1;const Rr=(Dr,Mr,Br)=>{if(isDefined(Dr))if(!Mr[Br])$r.push(Dr);else{let Nr=Mr[Br];const Lr=Dr[Nr];if(!isDefined(Lr))return;if(Br===Mr.length-1&&(isString$3(Lr)||isNumber$1(Lr)||isBoolean(Lr)))$r.push(toString(Lr));else if(isArray(Lr)){Ar=!0;for(let Hr=0,zr=Lr.length;HrTr.score===Cr.score?Tr.idx{this._keysMap[$r.id]=Ar})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,isString$3(this.docs[0])?this.docs.forEach((Cr,$r)=>{this._addString(Cr,$r)}):this.docs.forEach((Cr,$r)=>{this._addObject(Cr,$r)}),this.norm.clear())}add(Cr){const $r=this.size();isString$3(Cr)?this._addString(Cr,$r):this._addObject(Cr,$r)}removeAt(Cr){this.records.splice(Cr,1);for(let $r=Cr,Ar=this.size();$r{let Mr=Rr.getFn?Rr.getFn(Cr):this.getFn(Cr,Rr.path);if(isDefined(Mr)){if(isArray(Mr)){let Br=[];const Nr=[{nestedArrIndex:-1,value:Mr}];for(;Nr.length;){const{nestedArrIndex:Lr,value:Hr}=Nr.pop();if(isDefined(Hr))if(isString$3(Hr)&&!isBlank(Hr)){let zr={v:Hr,i:Lr,n:this.norm.get(Hr)};Br.push(zr)}else isArray(Hr)&&Hr.forEach((zr,Ur)=>{Nr.push({nestedArrIndex:Ur,value:zr})})}Ar.$[Dr]=Br}else if(isString$3(Mr)&&!isBlank(Mr)){let Br={v:Mr,n:this.norm.get(Mr)};Ar.$[Dr]=Br}}}),this.records.push(Ar)}toJSON(){return{keys:this.keys,records:this.records}}}function createIndex(Tr,Cr,{getFn:$r=Config.getFn,fieldNormWeight:Ar=Config.fieldNormWeight}={}){const Rr=new FuseIndex({getFn:$r,fieldNormWeight:Ar});return Rr.setKeys(Tr.map(createKey)),Rr.setSources(Cr),Rr.create(),Rr}function parseIndex(Tr,{getFn:Cr=Config.getFn,fieldNormWeight:$r=Config.fieldNormWeight}={}){const{keys:Ar,records:Rr}=Tr,Dr=new FuseIndex({getFn:Cr,fieldNormWeight:$r});return Dr.setKeys(Ar),Dr.setIndexRecords(Rr),Dr}function computeScore$1(Tr,{errors:Cr=0,currentLocation:$r=0,expectedLocation:Ar=0,distance:Rr=Config.distance,ignoreLocation:Dr=Config.ignoreLocation}={}){const Mr=Cr/Tr.length;if(Dr)return Mr;const Br=Math.abs(Ar-$r);return Rr?Mr+Br/Rr:Br?1:Mr}function convertMaskToIndices(Tr=[],Cr=Config.minMatchCharLength){let $r=[],Ar=-1,Rr=-1,Dr=0;for(let Mr=Tr.length;Dr=Cr&&$r.push([Ar,Rr]),Ar=-1)}return Tr[Dr-1]&&Dr-Ar>=Cr&&$r.push([Ar,Dr-1]),$r}const MAX_BITS=32;function search(Tr,Cr,$r,{location:Ar=Config.location,distance:Rr=Config.distance,threshold:Dr=Config.threshold,findAllMatches:Mr=Config.findAllMatches,minMatchCharLength:Br=Config.minMatchCharLength,includeMatches:Nr=Config.includeMatches,ignoreLocation:Lr=Config.ignoreLocation}={}){if(Cr.length>MAX_BITS)throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));const Hr=Cr.length,zr=Tr.length,Ur=Math.max(0,Math.min(Ar,zr));let Vr=Dr,jr=Ur;const Gr=Br>1||Nr,Xr=Gr?Array(zr):[];let Kr;for(;(Kr=Tr.indexOf(Cr,jr))>-1;){let no=computeScore$1(Cr,{currentLocation:Kr,expectedLocation:Ur,distance:Rr,ignoreLocation:Lr});if(Vr=Math.min(no,Vr),jr=Kr+Hr,Gr){let ro=0;for(;ro=ao;co-=1){let mo=co-1,io=$r[Tr.charAt(mo)];if(Gr&&(Xr[mo]=+!!io),po[co]=(po[co+1]<<1|1)&io,no&&(po[co]|=(Zr[co+1]|Zr[co])<<1|1|Zr[co+1]),po[co]&Yr&&(eo=computeScore$1(Cr,{errors:no,currentLocation:mo,expectedLocation:Ur,distance:Rr,ignoreLocation:Lr}),eo<=Vr)){if(Vr=eo,jr=mo,jr<=Ur)break;ao=Math.max(1,2*Ur-jr)}}if(computeScore$1(Cr,{errors:no+1,currentLocation:Ur,expectedLocation:Ur,distance:Rr,ignoreLocation:Lr})>Vr)break;Zr=po}const Jr={isMatch:jr>=0,score:Math.max(.001,eo)};if(Gr){const no=convertMaskToIndices(Xr,Br);no.length?Nr&&(Jr.indices=no):Jr.isMatch=!1}return Jr}function createPatternAlphabet(Tr){let Cr={};for(let $r=0,Ar=Tr.length;$r{this.chunks.push({pattern:Ur,alphabet:createPatternAlphabet(Ur),startIndex:Vr})},zr=this.pattern.length;if(zr>MAX_BITS){let Ur=0;const Vr=zr%MAX_BITS,jr=zr-Vr;for(;Ur{const{isMatch:Kr,score:Zr,indices:eo}=search(Cr,jr,Gr,{location:Rr+Xr,distance:Dr,threshold:Mr,findAllMatches:Br,minMatchCharLength:Nr,includeMatches:Ar,ignoreLocation:Lr});Kr&&(Ur=!0),zr+=Zr,Kr&&eo&&(Hr=[...Hr,...eo])});let Vr={isMatch:Ur,score:Ur?zr/this.chunks.length:1};return Ur&&Ar&&(Vr.indices=Hr),Vr}}class BaseMatch{constructor(Cr){this.pattern=Cr}static isMultiMatch(Cr){return getMatch(Cr,this.multiRegex)}static isSingleMatch(Cr){return getMatch(Cr,this.singleRegex)}search(){}}function getMatch(Tr,Cr){const $r=Tr.match(Cr);return $r?$r[1]:null}class ExactMatch extends BaseMatch{constructor(Cr){super(Cr)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(Cr){const $r=Cr===this.pattern;return{isMatch:$r,score:$r?0:1,indices:[0,this.pattern.length-1]}}}class InverseExactMatch extends BaseMatch{constructor(Cr){super(Cr)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(Cr){const Ar=Cr.indexOf(this.pattern)===-1;return{isMatch:Ar,score:Ar?0:1,indices:[0,Cr.length-1]}}}class PrefixExactMatch extends BaseMatch{constructor(Cr){super(Cr)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(Cr){const $r=Cr.startsWith(this.pattern);return{isMatch:$r,score:$r?0:1,indices:[0,this.pattern.length-1]}}}class InversePrefixExactMatch extends BaseMatch{constructor(Cr){super(Cr)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(Cr){const $r=!Cr.startsWith(this.pattern);return{isMatch:$r,score:$r?0:1,indices:[0,Cr.length-1]}}}class SuffixExactMatch extends BaseMatch{constructor(Cr){super(Cr)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(Cr){const $r=Cr.endsWith(this.pattern);return{isMatch:$r,score:$r?0:1,indices:[Cr.length-this.pattern.length,Cr.length-1]}}}class InverseSuffixExactMatch extends BaseMatch{constructor(Cr){super(Cr)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(Cr){const $r=!Cr.endsWith(this.pattern);return{isMatch:$r,score:$r?0:1,indices:[0,Cr.length-1]}}}class FuzzyMatch extends BaseMatch{constructor(Cr,{location:$r=Config.location,threshold:Ar=Config.threshold,distance:Rr=Config.distance,includeMatches:Dr=Config.includeMatches,findAllMatches:Mr=Config.findAllMatches,minMatchCharLength:Br=Config.minMatchCharLength,isCaseSensitive:Nr=Config.isCaseSensitive,ignoreLocation:Lr=Config.ignoreLocation}={}){super(Cr),this._bitapSearch=new BitapSearch(Cr,{location:$r,threshold:Ar,distance:Rr,includeMatches:Dr,findAllMatches:Mr,minMatchCharLength:Br,isCaseSensitive:Nr,ignoreLocation:Lr})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(Cr){return this._bitapSearch.searchIn(Cr)}}class IncludeMatch extends BaseMatch{constructor(Cr){super(Cr)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(Cr){let $r=0,Ar;const Rr=[],Dr=this.pattern.length;for(;(Ar=Cr.indexOf(this.pattern,$r))>-1;)$r=Ar+Dr,Rr.push([Ar,$r-1]);const Mr=!!Rr.length;return{isMatch:Mr,score:Mr?0:1,indices:Rr}}}const searchers=[ExactMatch,IncludeMatch,PrefixExactMatch,InversePrefixExactMatch,InverseSuffixExactMatch,SuffixExactMatch,InverseExactMatch,FuzzyMatch],searchersLen=searchers.length,SPACE_RE=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,OR_TOKEN="|";function parseQuery(Tr,Cr={}){return Tr.split(OR_TOKEN).map($r=>{let Ar=$r.trim().split(SPACE_RE).filter(Dr=>Dr&&!!Dr.trim()),Rr=[];for(let Dr=0,Mr=Ar.length;Dr!!(Tr[LogicalOperator.AND]||Tr[LogicalOperator.OR]),isPath=Tr=>!!Tr[KeyType.PATH],isLeaf=Tr=>!isArray(Tr)&&isObject$2(Tr)&&!isExpression(Tr),convertToExplicit=Tr=>({[LogicalOperator.AND]:Object.keys(Tr).map(Cr=>({[Cr]:Tr[Cr]}))});function parse$1(Tr,Cr,{auto:$r=!0}={}){const Ar=Rr=>{let Dr=Object.keys(Rr);const Mr=isPath(Rr);if(!Mr&&Dr.length>1&&!isExpression(Rr))return Ar(convertToExplicit(Rr));if(isLeaf(Rr)){const Nr=Mr?Rr[KeyType.PATH]:Dr[0],Lr=Mr?Rr[KeyType.PATTERN]:Rr[Nr];if(!isString$3(Lr))throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(Nr));const Hr={keyId:createKeyId(Nr),pattern:Lr};return $r&&(Hr.searcher=createSearcher(Lr,Cr)),Hr}let Br={children:[],operator:Dr[0]};return Dr.forEach(Nr=>{const Lr=Rr[Nr];isArray(Lr)&&Lr.forEach(Hr=>{Br.children.push(Ar(Hr))})}),Br};return isExpression(Tr)||(Tr=convertToExplicit(Tr)),Ar(Tr)}function computeScore(Tr,{ignoreFieldNorm:Cr=Config.ignoreFieldNorm}){Tr.forEach($r=>{let Ar=1;$r.matches.forEach(({key:Rr,norm:Dr,score:Mr})=>{const Br=Rr?Rr.weight:null;Ar*=Math.pow(Mr===0&&Br?Number.EPSILON:Mr,(Br||1)*(Cr?1:Dr))}),$r.score=Ar})}function transformMatches(Tr,Cr){const $r=Tr.matches;Cr.matches=[],isDefined($r)&&$r.forEach(Ar=>{if(!isDefined(Ar.indices)||!Ar.indices.length)return;const{indices:Rr,value:Dr}=Ar;let Mr={indices:Rr,value:Dr};Ar.key&&(Mr.key=Ar.key.src),Ar.idx>-1&&(Mr.refIndex=Ar.idx),Cr.matches.push(Mr)})}function transformScore(Tr,Cr){Cr.score=Tr.score}function format$2(Tr,Cr,{includeMatches:$r=Config.includeMatches,includeScore:Ar=Config.includeScore}={}){const Rr=[];return $r&&Rr.push(transformMatches),Ar&&Rr.push(transformScore),Tr.map(Dr=>{const{idx:Mr}=Dr,Br={item:Cr[Mr],refIndex:Mr};return Rr.length&&Rr.forEach(Nr=>{Nr(Dr,Br)}),Br})}class Fuse{constructor(Cr,$r={},Ar){this.options={...Config,...$r},this.options.useExtendedSearch,this._keyStore=new KeyStore(this.options.keys),this.setCollection(Cr,Ar)}setCollection(Cr,$r){if(this._docs=Cr,$r&&!($r instanceof FuseIndex))throw new Error(INCORRECT_INDEX_TYPE);this._myIndex=$r||createIndex(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(Cr){isDefined(Cr)&&(this._docs.push(Cr),this._myIndex.add(Cr))}remove(Cr=()=>!1){const $r=[];for(let Ar=0,Rr=this._docs.length;Ar-1&&(Nr=Nr.slice(0,$r)),format$2(Nr,this._docs,{includeMatches:Ar,includeScore:Rr})}_searchStringList(Cr){const $r=createSearcher(Cr,this.options),{records:Ar}=this._myIndex,Rr=[];return Ar.forEach(({v:Dr,i:Mr,n:Br})=>{if(!isDefined(Dr))return;const{isMatch:Nr,score:Lr,indices:Hr}=$r.searchIn(Dr);Nr&&Rr.push({item:Dr,idx:Mr,matches:[{score:Lr,value:Dr,norm:Br,indices:Hr}]})}),Rr}_searchLogical(Cr){const $r=parse$1(Cr,this.options),Ar=(Br,Nr,Lr)=>{if(!Br.children){const{keyId:zr,searcher:Ur}=Br,Vr=this._findMatches({key:this._keyStore.get(zr),value:this._myIndex.getValueForItemAtKeyId(Nr,zr),searcher:Ur});return Vr&&Vr.length?[{idx:Lr,item:Nr,matches:Vr}]:[]}const Hr=[];for(let zr=0,Ur=Br.children.length;zr{if(isDefined(Br)){let Lr=Ar($r,Br,Nr);Lr.length&&(Dr[Nr]||(Dr[Nr]={idx:Nr,item:Br,matches:[]},Mr.push(Dr[Nr])),Lr.forEach(({matches:Hr})=>{Dr[Nr].matches.push(...Hr)}))}}),Mr}_searchObjectList(Cr){const $r=createSearcher(Cr,this.options),{keys:Ar,records:Rr}=this._myIndex,Dr=[];return Rr.forEach(({$:Mr,i:Br})=>{if(!isDefined(Mr))return;let Nr=[];Ar.forEach((Lr,Hr)=>{Nr.push(...this._findMatches({key:Lr,value:Mr[Hr],searcher:$r}))}),Nr.length&&Dr.push({idx:Br,item:Mr,matches:Nr})}),Dr}_findMatches({key:Cr,value:$r,searcher:Ar}){if(!isDefined($r))return[];let Rr=[];if(isArray($r))$r.forEach(({v:Dr,i:Mr,n:Br})=>{if(!isDefined(Dr))return;const{isMatch:Nr,score:Lr,indices:Hr}=Ar.searchIn(Dr);Nr&&Rr.push({score:Lr,key:Cr,value:Dr,idx:Mr,norm:Br,indices:Hr})});else{const{v:Dr,n:Mr}=$r,{isMatch:Br,score:Nr,indices:Lr}=Ar.searchIn(Dr);Br&&Rr.push({score:Nr,key:Cr,value:Dr,norm:Mr,indices:Lr})}return Rr}}Fuse.version="6.6.2";Fuse.createIndex=createIndex;Fuse.parseIndex=parseIndex;Fuse.config=Config;Fuse.parseQuery=parse$1;register(ExtendedSearch);var _a$1;const isClient=typeof window<"u";isClient&&((_a$1=window==null?void 0:window.navigator)!=null&&_a$1.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function resolveUnref(Tr){return typeof Tr=="function"?Tr():unref(Tr)}function tryOnMounted(Tr,Cr=!0){getCurrentInstance()?onMounted(Tr):Cr?Tr():nextTick(Tr)}function useFuse(Tr,Cr,$r){const Ar=()=>{var Mr,Br;return new Fuse((Mr=resolveUnref(Cr))!=null?Mr:[],(Br=resolveUnref($r))==null?void 0:Br.fuseOptions)},Rr=ref(Ar());watch(()=>{var Mr;return(Mr=resolveUnref($r))==null?void 0:Mr.fuseOptions},()=>{Rr.value=Ar()},{deep:!0}),watch(()=>resolveUnref(Cr),Mr=>{Rr.value.setCollection(Mr)},{deep:!0});const Dr=computed(()=>{const Mr=resolveUnref($r);if(Mr!=null&&Mr.matchAllWhenSearchEmpty&&!unref(Tr))return resolveUnref(Cr).map((Nr,Lr)=>({item:Nr,refIndex:Lr}));const Br=Mr==null?void 0:Mr.resultLimit;return Rr.value.search(resolveUnref(Tr),Br?{limit:Br}:void 0)});return{fuse:Rr,results:Dr}}const StyledSelect_vue_vue_type_style_index_0_scoped_fdb8c1b8_lang="",_sfc_main$1l={setup(Tr,Cr){const{selectedId:$r,items:Ar,isDropdownSameWidthAsParent:Rr,widthOfDropdown:Dr,heightOfButton:Mr,heightOfDropdown:Br}=toRefs$1(Tr),Nr=Math.max(Ar.value.map(Wr=>Wr.id).indexOf($r.value),-1),Lr=ref(Ar.value[Nr]),Hr=computed(()=>{var Wr;return(Wr=Lr==null?void 0:Lr.value)==null?void 0:Wr.id}),zr=computed(()=>{var Wr;return(Wr=Lr==null?void 0:Lr.value)==null?void 0:Wr.icon});watch(()=>Hr.value,()=>{Cr.emit("selected-item-id",Hr.value)});const{height:Ur}=useWindowSize(),Vr=ref(null),jr=ref(Br.value),Gr=ref({top:0,left:0,width:0}),Xr=ref(!1),Kr=computed(()=>({top:`${Gr.value.top}px`,left:`${Gr.value.left}px`,width:Rr.value?`${Gr.value.width}px`:`${Dr.value}`})),Zr=Wr=>{if(Vr.value==null)return;const{bottom:Yr,left:Jr,width:no,top:ro}=Vr.value.getBoundingClientRect();Gr.value={top:Yr+4,left:Jr,width:no},Xr.value=Gr.value.top+Br.value>Ur.value,Xr.value?jr.value=ro-60:jr.value=Br.value},eo=computed(()=>{const Wr=jr.value-10;return Ar.value.length*Mr.value>Wr?`${Wr}px`:`${Ar.value.length*Mr.value}px`});return{maxHeightToUse:jr,heightOfScroller:eo,el:Vr,handleClickOnButton:Zr,position:Gr,styleFromPosition:Kr,showAbove:Xr,selectedItem:Lr,selectedItemIcon:zr,assetUrl}},emits:["selected-item-id"],components:{Listbox:Ee,ListboxOptions:Fe,ListboxOption:Be$1,ListboxButton:Ae,Icon:_sfc_main$1v,Button,RecycleScroller:script$2},props:{items:{type:Array},selectedId:{type:String},placeholder:{type:String,default:"Select an item"},teleportTo:{type:String,default:"#main-app"},widthOfDropdown:{type:String,default:"100%"},heightOfDropdown:{type:Number,default:500},isDropdownSameWidthAsParent:{type:Boolean,default:!0},heightOfButton:{type:Number,default:36},heightOfButtonIcon:{type:Number,default:14},showIcon:{type:Boolean,default:!0}},computed:{darkTheme(){return!1},backgroundToUse(){return theme.appColors.backgroundToUseNeutral(this.darkTheme)},activeBackgroundToUse(){return theme.appColors.activeBackgroundToUse(this.darkTheme)},hoverBackgroundToUse(){return theme.appColors.hoverBackgroundToUse(this.darkTheme)},textBackgroundToUse(){return theme.appColors.textBackgroundToUse(this.darkTheme)},colorToUse(){return theme.appColors.colorToUse(this.darkTheme)},softColorToUse(){return theme.appColors.softColorToUse(this.darkTheme)}}},__injectCSSVars__$7=()=>{useCssVars(Tr=>({"047f2913":`${Tr.appTheme.spacing.s2} ${Tr.appTheme.spacing.s3}`,"355ea494":Tr.appTheme.fontSize.f4,d7f702a0:Tr.hoverBackgroundToUse,"4e241f4a":Tr.activeBackgroundToUse}))},__setup__$7=_sfc_main$1l.setup;_sfc_main$1l.setup=__setup__$7?(Tr,Cr)=>(__injectCSSVars__$7(),__setup__$7(Tr,Cr)):__injectCSSVars__$7;const _hoisted_1$U={ref:"el",style:{position:"relative",width:"100%"}},_hoisted_2$I={key:0},_hoisted_3$z={class:"ellipsis"};function _sfc_render$i(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("Icon"),Br=resolveComponent("Button"),Nr=resolveComponent("ListboxButton"),Lr=resolveComponent("ListboxOption"),Hr=resolveComponent("RecycleScroller"),zr=resolveComponent("ListboxOptions"),Ur=resolveComponent("Listbox");return openBlock(),createBlock(Ur,{modelValue:Ar.selectedItem,"onUpdate:modelValue":Cr[0]||(Cr[0]=Vr=>Ar.selectedItem=Vr),as:"div",style:normalizeStyle({height:`${$r.heightOfButton}px`,width:"100%"}),nullable:""},{default:withCtx(({open:Vr})=>[createBaseVNode("div",{style:normalizeStyle({position:"relative",zIndex:Vr?2:0})},[createBaseVNode("div",_hoisted_1$U,[createVNode(Nr,{style:normalizeStyle({fontFamily:"inherit",display:"flex",flexDirection:"row",alignItems:"center",padding:0,height:`${$r.heightOfButton}px`,width:"100%",borderRadius:Tr.appTheme.borderRadius.large,border:"none",background:Dr.backgroundToUse,fontSize:Tr.appTheme.fontSize.f4,select:"none",position:"relative"}),onClick:Ar.handleClickOnButton},{default:withCtx(()=>[renderSlot(Tr.$slots,"button",{selectedItemIcon:Ar.selectedItemIcon,selectedItem:Ar.selectedItem},()=>[createVNode(Br,{alignment:"flex-start",style:normalizeStyle({height:`${$r.heightOfButton}px`,width:"100%",borderRadius:Tr.appTheme.borderRadius.large,border:`1px solid ${Tr.appTheme.palette.neutral[100]}`,padding:`${Tr.appTheme.spacing.s2} ${Tr.appTheme.spacing.s3}`,fontSize:Tr.appTheme.fontSize.f4,select:"none",position:"relative",gap:"16px"})},{left:withCtx(()=>[Ar.selectedItemIcon?(openBlock(),createBlock(Mr,{key:0,src:Ar.assetUrl(Ar.selectedItemIcon),vProps:{height:14,width:14},style:{}},null,8,["src"])):createCommentVNode("",!0)]),content:withCtx(()=>{var jr,Gr;return[(jr=Ar.selectedItem)!=null&&jr.name?(openBlock(),createElementBlock("span",_hoisted_2$I,toDisplayString((Gr=Ar.selectedItem)==null?void 0:Gr.name),1)):(openBlock(),createElementBlock("span",{key:1,style:normalizeStyle({color:Tr.appTheme.palette.neutral[300]})},toDisplayString($r.placeholder),5))]}),_:1},8,["style"])],!0),$r.showIcon?(openBlock(),createElementBlock("div",{key:0,style:normalizeStyle({position:"absolute",right:"8px",top:`${($r.heightOfButton-$r.heightOfButtonIcon)/2}px`,cursor:"pointer"})},[renderSlot(Tr.$slots,"icon",{},()=>[createVNode(Mr,{src:Ar.assetUrl(Vr?"icon-chevron-up.svg":"icon-chevron-down.svg"),vProps:{height:$r.heightOfButtonIcon,width:$r.heightOfButtonIcon,nestedFill:Tr.appTheme.palette.neutral[300]}},null,8,["src","vProps"])],!0)],4)):createCommentVNode("",!0)]),_:2},1032,["style","onClick"])],512),(openBlock(),createBlock(Teleport,{to:$r.teleportTo},[createVNode(Transition,{name:"fade"},{default:withCtx(()=>[Vr?(openBlock(),createBlock(zr,{key:0,as:"div",style:normalizeStyle({background:Dr.backgroundToUse,borderRadius:Tr.appTheme.borderRadius.large,padding:`${Tr.appTheme.spacing.s1} 0`,marginTop:Tr.appTheme.spacing.s1,boxShadow:"var(--shadow-elevation-medium)",border:`1px solid ${Tr.appTheme.palette.neutral[100]}`,position:"absolute",zIndex:Vr?1e3:0,maxHeight:`${Ar.maxHeightToUse}px`,transform:`translateY(${Ar.showAbove?"calc(-100% - 50px)":"0px"})`,...Ar.styleFromPosition}),class:"dialogOverride"},{default:withCtx(()=>[$r.items.length===0?(openBlock(),createElementBlock("div",{key:0,style:normalizeStyle({position:"relative",cursor:"default",select:"none",color:Tr.appTheme.palette.neutral[700],padding:`${Tr.appTheme.spacing.s2} ${Tr.appTheme.spacing.s3}`,fontSize:Tr.appTheme.fontSize.f4})}," Nothing found. ",4)):createCommentVNode("",!0),createVNode(Hr,{class:"scroller",items:$r.items,"item-size":$r.heightOfButton,buffer:200,"key-field":"id",style:normalizeStyle({height:Ar.heightOfScroller,width:"100%",overflow:"hidden auto",padding:"0px 4px",display:"flex",flexDirection:"column",gap:"4px"})},{default:withCtx(({item:jr})=>[createVNode(Lr,{value:jr,as:"template"},{default:withCtx(({selected:Gr})=>[createBaseVNode("div",{class:normalizeClass(["list-item",{"list-item-selected":Gr}]),style:normalizeStyle({height:`${$r.heightOfButton}px`})},[jr.icon?(openBlock(),createBlock(Mr,{key:0,src:Ar.assetUrl(jr.icon),vProps:{height:14,width:14}},null,8,["src"])):createCommentVNode("",!0),createBaseVNode("span",_hoisted_3$z,toDisplayString((jr==null?void 0:jr.name)||(jr==null?void 0:jr.label)),1),Gr?(openBlock(),createBlock(Mr,{key:1,src:Ar.assetUrl("icon-check.svg"),vProps:{height:14,width:14},style:normalizeStyle({position:"absolute",right:Tr.appTheme.spacing.s2,top:Tr.appTheme.spacing.s3})},null,8,["src","style"])):createCommentVNode("",!0)],6)]),_:2},1032,["value"])]),_:1},8,["items","item-size","style"])]),_:2},1032,["style"])):createCommentVNode("",!0)]),_:2},1024)],8,["to"]))],4)]),_:3},8,["modelValue","style"])}const StyledSelect=_export_sfc(_sfc_main$1l,[["render",_sfc_render$i],["__scopeId","data-v-fdb8c1b8"]]),_withScopeId$7=Tr=>(pushScopeId("data-v-f9b6946b"),Tr=Tr(),popScopeId(),Tr),_hoisted_1$T={key:1,class:"text-[16px] font-[600] leading-[1.32] mb-1"},_hoisted_2$H={class:"flex flex-col p-4 pt-0 w-full items-end gap-6"},_hoisted_3$y={class:"flex flex-col items-start self-stretch"},_hoisted_4$r=_withScopeId$7(()=>createBaseVNode("p",{class:"text-sm mb-1"},"Contact name",-1)),_hoisted_5$k={key:0,class:"error-text"},_hoisted_6$j={class:"flex flex-col items-start self-stretch"},_hoisted_7$g=_withScopeId$7(()=>createBaseVNode("p",{class:"text-sm mb-1"},"Business email",-1)),_hoisted_8$b={key:0,class:"error-text"},_hoisted_9$b={key:0,class:"flex flex-col items-start self-stretch"},_hoisted_10$a=_withScopeId$7(()=>createBaseVNode("p",{class:"text-sm mb-1"},"Team size",-1)),_hoisted_11$6={class:"text-sm font-normal"},_hoisted_12$6={key:0,class:"error-text"},_hoisted_13$6={class:"flex flex-col items-start self-stretch"},_hoisted_14$6=_withScopeId$7(()=>createBaseVNode("p",{class:"text-sm mb-1"},[createTextVNode("Message "),createBaseVNode("span",{class:"text-[#868585]"},"(optional)")],-1)),_hoisted_15$5=_withScopeId$7(()=>createBaseVNode("label",{class:"text-white text-base font-medium"},"Send",-1)),_sfc_main$1k=defineComponent({__name:"TeamRequestForm",emits:["close"],setup(Tr,{emit:Cr}){const $r=Cr,Ar=computed(()=>theme.appTheme()),{isHome:Rr}=useRouteInfo(),{currentAppId:Dr}=inject("currentAppId"),Mr=inject("isMobile"),Br=useMiscStore(),Nr=useUserStore(),Lr=computed(()=>Br.getProAccessSource),Hr=[{id:"small",label:"1-10",value:"1-10"},{id:"medium",label:"11-50",value:"11-50"},{id:"large",label:"51-250",value:"51-250"},{id:"big",label:">250",value:">250"}],zr=ref("small"),Ur=ref(!1),Vr=ref(""),jr=ref(""),Gr=ref(""),Xr=Yr=>{zr.value=Yr};ref("");const Kr=ref(!1),Zr=ref({name:"",email:"",teamSize:""}),eo=()=>{Zr.value={name:"",email:"",teamSize:""}},Wr=async()=>{var Jr;if(Kr.value)return;eo(),zr.value||(Zr.value.teamSize="Please select team size"),jr.value||(Zr.value.name="Please enter your name");const Yr=/^(?![^@]+@(?:(?:gmail\.com|yahoo\.com|hotmail\.com)$)).*$/i;if(!Gr.value||!isEmail(Gr.value)?Zr.value.email="Please enter a valid email":Yr.test(Gr.value)||(Zr.value.email="Please enter your business email"),!(Zr.value.name||Zr.value.email||Zr.value.teamSize)){Kr.value=!0;try{const{error:no}=await queryRequestDemo({context:{teamSize:((Jr=Hr.find(ro=>ro.id===zr.value))==null?void 0:Jr.value)||zr.value,name:jr.value,businessEmail:Gr.value,msg:Vr.value}});Kr.value=!1,no?posthogCapture(`team_access_modal_error_${Lr.value}`,{email:Nr.userEmail}):posthogCapture(`team_access_modal_success_${Lr.value}`,{email:Nr.userEmail})}catch{posthogCapture(`team_access_modal_error_${Lr.value}`,{email:Nr.userEmail}),Kr.value=!1;return}Ur.value=!0,showNotiForSuccess({deckId:Dr.value,isHome:Rr.value,text:"Request received, we will get in touch with you shortly."}),$r("close")}};return onMounted(()=>{Ur.value=!1,Kr.value=!1,posthogCapture(`pro_access_modal_opened_${Lr.value}`)}),(Yr,Jr)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["bg-white flex flex-col",{"w-[420px] p-4 rounded-2xl gap-1 shadow-[0_16px_32px_rgba(0,0,0,0.04)] transition-all duration-1000":!unref(Mr),"w-full items-start max-h-[calc(100dvh-24px)]":unref(Mr)}])},[unref(Mr)?(openBlock(),createBlock(_sfc_main$1p,{key:0,title:"Request demo",onTappedClose:Jr[0]||(Jr[0]=no=>$r("close"))})):(openBlock(),createElementBlock("div",_hoisted_1$T,"Request demo")),createBaseVNode("div",_hoisted_2$H,[createBaseVNode("div",_hoisted_3$y,[_hoisted_4$r,withDirectives(createBaseVNode("input",{"onUpdate:modelValue":Jr[1]||(Jr[1]=no=>jr.value=no),class:normalizeClass(["resize-none rounded-lg bg-[#F3F3F3] px-3 py-[10px] h-[42px] w-full font-medium border",{"border-[#DB3033]":Zr.value.name,"boder-transparent":!Zr.value.name}])},null,2),[[vModelText,jr.value]]),Zr.value.name?(openBlock(),createElementBlock("p",_hoisted_5$k,toDisplayString(Zr.value.name),1)):createCommentVNode("",!0)]),createBaseVNode("div",_hoisted_6$j,[_hoisted_7$g,withDirectives(createBaseVNode("input",{"onUpdate:modelValue":Jr[2]||(Jr[2]=no=>Gr.value=no),class:normalizeClass(["resize-none rounded-lg bg-[#F3F3F3] px-3 py-[10px] h-[42px] w-full font-medium border",{"border-[#DB3033]":Zr.value.email,"boder-transparent":!Zr.value.email}])},null,2),[[vModelText,Gr.value]]),Zr.value.email?(openBlock(),createElementBlock("p",_hoisted_8$b,toDisplayString(Zr.value.email),1)):createCommentVNode("",!0)]),unref(Mr)?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_9$b,[_hoisted_10$a,createVNode(StyledSelect,{items:Hr,selectedId:zr.value,heightOfDropdown:212,heightOfButton:42,showIcon:!1,onSelectedItemId:Xr,dropdownButtonHeight:42,style:{}},{button:withCtx(no=>[createVNode(Button,{alignment:"flex-start",purpose:"secondary","background-override":"rgba(0, 0, 0, 0.04)","hover-background-override":"rgba(0, 0, 0, 0.08)","active-background-override":"rgba(0, 0, 0, 0.12)",style:normalizeStyle({padding:"8px 8px 8px 12px",height:"42px",fontWeight:400,fontSize:"14px",width:"100%",border:Zr.value.teamSize?"1px solid #DB3033":"1px solid transparent"}),size:"large"},{content:withCtx(()=>{var ro,so;return[createBaseVNode("div",{class:normalizeClass(["text-base flex-auto flex",{"text-[#0d0c0c]/[.42]":!((ro=no.selectedItem)!=null&&ro.label)}])},toDisplayString(((so=no.selectedItem)==null?void 0:so.label)??"Select option"),3)]}),right:withCtx(()=>[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-chevron-down.svg"),vProps:{nestedFill:Ar.value.palette.neutral[300],width:16,height:16}},null,8,["src","vProps"])]),_:2},1032,["background-override","hover-background-override","active-background-override","style"])]),listItem:withCtx(({item:no,selectedItemId:ro})=>[createBaseVNode("div",{class:"h-[34px] w-full py-2 px-3 text-sm cursor-default select-none relative flex items-center gap-2 rounded-lg",style:normalizeStyle({background:ro===no.id?"rgba(0, 0, 0, 0.04)":Ar.value.palette.neutral[0]})},[createBaseVNode("span",_hoisted_11$6,toDisplayString((no==null?void 0:no.name)??(no==null?void 0:no.label)),1),ro===no.id?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)("icon-check-2.svg"),style:normalizeStyle({position:"absolute",right:Ar.value.spacing.s2,top:"9px"})},null,8,["src","style"])):createCommentVNode("",!0)],4)]),_:1},8,["selectedId"]),Zr.value.teamSize?(openBlock(),createElementBlock("p",_hoisted_12$6,toDisplayString(Zr.value.teamSize),1)):createCommentVNode("",!0)])),createBaseVNode("div",_hoisted_13$6,[_hoisted_14$6,withDirectives(createBaseVNode("textarea",{"onUpdate:modelValue":Jr[3]||(Jr[3]=no=>Vr.value=no),class:"resize-none rounded-lg bg-[#F3F3F3] px-3 py-2.5 h-[142px] w-full font-medium"},null,512),[[vModelText,Vr.value]])]),createBaseVNode("button",{onClick:Wr,class:"flex justify-center items-center self-stretch gap-1 h-[42px] px-4 py-2 rounded-xl bg-brand-purple hover:bg-brand-purpleHover active:bg-brand-purpleActive"},[Kr.value?(openBlock(),createBlock(LoaderCircle,{key:0,color:"white",width:"fit-content",padding:"0 8px 0 0"})):createCommentVNode("",!0),_hoisted_15$5])])],2))}}),TeamRequestForm_vue_vue_type_style_index_0_scoped_f9b6946b_lang="",TeamRequestForm=_export_sfc(_sfc_main$1k,[["__scopeId","data-v-f9b6946b"]]),_sfc_main$1j=defineComponent({__name:"TeamRequestFormWrapper",setup(Tr){const Cr=useOverlayStore();inject("isMobile");const $r=computed(()=>Cr.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.TEAM_REQUEST_FORM)),Ar=()=>{Cr.hideSlideInComponents(SLIDE_IN_COMPONENTS.TEAM_REQUEST_FORM)};return(Rr,Dr)=>(openBlock(),createBlock(PrezoSlideIn,{show:$r.value,onClose:Ar},{content:withCtx(({})=>[createVNode(TeamRequestForm,{onClose:Ar})]),_:1},8,["show"]))}}),_hoisted_1$S={class:"flex flex-col items-start w-full bg-white"},_hoisted_2$G={class:"flex flex-col items-center self-stretch gap-3 py-2 pb-10 px-4"},_hoisted_3$x=createBaseVNode("label",{class:"self-stretch text-center text-neutralSolid-600 text-sm"}," The mobile version is for viewing only. To make any changes, please use the desktop app. ",-1),_sfc_main$1i=defineComponent({__name:"ViewOnly",emits:["close"],setup(Tr,{emit:Cr}){const $r=Cr;return(Ar,Rr)=>(openBlock(),createElementBlock("div",_hoisted_1$S,[createVNode(_sfc_main$1p,{title:"View only",onTappedClose:Rr[0]||(Rr[0]=Dr=>$r("close"))}),createBaseVNode("div",_hoisted_2$G,[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-purple-view-only.svg"),vProps:{width:60,height:60}},null,8,["src"]),_hoisted_3$x])]))}}),_sfc_main$1h=defineComponent({__name:"ViewOnlyWrapper",setup(Tr){const Cr=useOverlayStore();inject("isMobile");const $r=computed(()=>Cr.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.VIEW_ONLY)),Ar=()=>{Cr.hideSlideInComponents(SLIDE_IN_COMPONENTS.VIEW_ONLY)};return(Rr,Dr)=>(openBlock(),createBlock(PrezoSlideIn,{show:$r.value,onClose:Ar},{content:withCtx(({})=>[createVNode(_sfc_main$1i,{onClose:Ar})]),_:1},8,["show"]))}}),StyledPopOver_vue_vue_type_style_index_0_scoped_be8995df_lang="",_sfc_main$1g={setup(Tr){const{styleProps:Cr,popupOverrideSelector:$r}=toRefs$1(Tr),Ar=computed(()=>Cr.value.popoverButtonHeight??"36px"),Rr=ref(null),Dr=useWindowSize(),Mr=ref({top:0,left:0,right:0,width:0,elementWidth:0}),Br=ref(!1),Nr=ref(!1),Lr=ref(!1),Hr=ref(!1),zr=computed(()=>Cr.value.showAcrossLeft??!1),Ur=computed(()=>Cr.value.showAcrossLeftCenter??!1),Vr=computed(()=>Cr.value.popoverYAdjustment??"0px"),jr=computed(()=>Cr.value.popoverXAdjustment??"0px"),Gr=computed(()=>Cr.value.distanceFromButton??16),Xr=computed(()=>Cr.value.static??!1),Kr=theme.appTheme(),Zr=computed(()=>Cr.value.panelBorder??`1px solid ${Kr.palette.neutral[100]}`),eo=computed(()=>Cr.value.panelBorderRadius??"8px"),Wr=computed(()=>Cr.value.panelOverFlow??"hidden auto"),Yr=computed(()=>Cr.value.menuYGap??0),Jr=computed(()=>Cr.value.buttonBackground??Kr.palette.neutral[0]),no=computed(()=>Cr.value.panelBackground??Kr.palette.neutral[0]),ro=computed(()=>Cr.value.animationDirection??"right"),so=computed(()=>ro.value==="right"?"70px":"0px"),ao=ref(0),lo=16,po=54,go=()=>{if(!Rr.value)return;const{top:So,bottom:ko,left:$o,right:Go,width:No,height:Eo}=Rr.value.getBoundingClientRect();Mr.value={top:ko+4,left:$o,right:Dr.width.value-Go,elementWidth:No,elementTop:Math.floor(So+Eo/2)},Br.value=Cr.value.showAbove||Mr.value.top+Yr.value+ao.value+lo>Dr.height.value,Nr.value=Mr.value.left+ao.value>Dr.width.value||Cr.value.alignRightEdge,Lr.value=Mr.value.left{var Mo;ao.value=((Mo=document.querySelector(".regular-popover"))==null?void 0:Mo.getBoundingClientRect().height)??0,Br.value=Cr.value.showAbove||Mr.value.top+Yr.value+ao.value+lo>Dr.height.value,Nr.value=Mr.value.left+ao.value>Dr.width.value||Cr.value.alignRightEdge,Lr.value=Mr.value.left{if(Ur.value)return`calc(-50% + ${Vr.value})`;if(zr.value){const So=Mr.value.elementTop+ao.value-Dr.height.value+32;return`${Br.value?-1*So:0}px`}return`${Br.value?`calc(-100% - ${Yr.value+36}px)`:"0px"}`}),mo=computed(()=>{if(Hr.value){let So="translateX(calc(-50% + 16px))";return Br.value&&(So+=" translateY(calc(-100% - 50px))"),{top:`${Mr.value.top+Yr.value}px`,left:Cr.value.positionOverride.left??`${Mr.value.left}px`,transform:So}}if(Ur.value){const So=Mr.value.elementTop+.5*ao.value+lo>Dr.height.value,ko=Mr.value.elementTop-.5*ao.value{if($r.value==null)return;[...document.querySelectorAll($r.value)].some(Go=>Go.contains(So.target))&&So.stopPropagation()},{passive:$r.value==null});const uo=ref(!1);return{popoverHeight:ao,translateXForAnimation:so,removeFinalState:()=>{uo.value=!1},useTranslateUp:uo,applyFinalState:()=>{uo.value=!0},translateYValue:co,panelBackground:no,buttonBackground:Jr,panelOverFlow:Wr,panelBorder:Zr,panelBorderRadius:eo,popoverRef:io,popoverButtonHeight:Ar,el:Rr,showAbove:Br,styleFromPosition:mo,handleClickOnButton:go,isStatic:Xr}},components:{Popover:Pe,PopoverButton:Be,PopoverPanel:He},props:{teleportTo:{type:String,default:"#main-app"},styleProps:{type:Object,default:()=>({})},popupOverrideSelector:{type:String,default:null}}},__injectCSSVars__$6=()=>{useCssVars(Tr=>({"17f3ebbd":Tr.translateXForAnimation,"3e040564":Tr.translateYValue}))},__setup__$6=_sfc_main$1g.setup;_sfc_main$1g.setup=__setup__$6?(Tr,Cr)=>(__injectCSSVars__$6(),__setup__$6(Tr,Cr)):__injectCSSVars__$6;const _hoisted_1$R={ref:"el",style:{position:"relative",width:"100%"}};function _sfc_render$h(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("PopoverButton"),Br=resolveComponent("PopoverPanel"),Nr=resolveComponent("Popover");return openBlock(),createBlock(Nr,{style:{position:"relative"}},{default:withCtx(({open:Lr,close:Hr})=>[createBaseVNode("div",_hoisted_1$R,[createVNode(Mr,{style:normalizeStyle({fontFamily:"inherit",background:Ar.buttonBackground,padding:0,height:Ar.popoverButtonHeight,width:"100%",marginLeft:"auto",borderRadius:Tr.appTheme.borderRadius.large,border:"none",fontSize:Tr.appTheme.fontSize.f4,display:"flex",alignItems:"center",gap:Tr.appTheme.spacing.s2}),onClick:Ar.handleClickOnButton},{default:withCtx(()=>[renderSlot(Tr.$slots,"button",{open:Lr,close:Hr},void 0,!0)]),_:2},1032,["style","onClick"])],512),(openBlock(),createBlock(Teleport,{to:$r.teleportTo},[createVNode(Transition,{name:"fade",onAfterEnter:Ar.applyFinalState,onAfterLeave:Ar.removeFinalState},{default:withCtx(()=>[createVNode(Br,{ref:"popoverRef",class:normalizeClass(["headless-tracker regular-popover",{translateUp:Ar.useTranslateUp}]),style:normalizeStyle({background:Ar.panelBackground,boxShadow:"0px 20px 32px rgba(0, 0, 0, 0.06)",border:Ar.panelBorder,borderRadius:Ar.panelBorderRadius,position:"absolute",zIndex:100,overflow:Ar.panelOverFlow,...Ar.styleFromPosition})},{default:withCtx(()=>[renderSlot(Tr.$slots,"content",{close:Hr,open:Lr},void 0,!0)]),_:2},1032,["class","style"])]),_:2},1032,["onAfterEnter","onAfterLeave"])],8,["to"]))]),_:3})}const StyledPopOver$1=_export_sfc(_sfc_main$1g,[["render",_sfc_render$h],["__scopeId","data-v-be8995df"]]),_sfc_main$1f={name:"Toggle",components:{},props:{isOn:Boolean,coloredBackground:{type:String,default:"default"}},data(){return{containerStyle:{display:"flex",alignItems:"center",flexShrink:"0",marginLeft:"8px"},toggleStyle:{userSelect:"none",transition:"background 20ms ease-in 0s",cursor:"pointer",borderRadius:"44px"},defaultRollerStyle:{display:"flex",flexShrink:"0",height:"14px",width:"26px",borderRadius:"44px",padding:"2px",boxSizing:"content-box",transition:"background 30ms ease 0s, box-shadow 30ms ease 0s"},defaultPinStyle:{width:"14px",height:"14px",borderRadius:"44px",background:"white",transition:"transform 30ms ease-out 0s, background 30ms ease-out 0s",transform:"translateX(0px) translateY(0px)"}}},computed:{pinStyle(){return this.isOn?{...this.defaultPinStyle,transform:"translateX(12px) translateY(0px)"}:this.defaultPinStyle},rollerStyle(){return this.isOn?{...this.defaultRollerStyle,background:this.coloredBackground==="default"?this.appTheme.colors.brandPurple:this.coloredBackground}:{...this.defaultRollerStyle,background:this.appTheme.palette.neutral[100]}}},methods:{}};function _sfc_render$g(Tr,Cr,$r,Ar,Rr,Dr){return openBlock(),createElementBlock("div",{style:normalizeStyle(Rr.containerStyle)},[createBaseVNode("div",{role:"button",style:normalizeStyle(Rr.toggleStyle)},[createBaseVNode("div",{style:normalizeStyle(Dr.rollerStyle)},[createBaseVNode("div",{style:normalizeStyle(Dr.pinStyle),ref:"togglePin"},null,4)],4)],4)],4)}const Toggle=_export_sfc(_sfc_main$1f,[["render",_sfc_render$g]]),_sfc_main$1e=defineComponent({__name:"BaseButton",props:{variant:{},width:{},height:{},title:{},icon:{},editable:{type:Boolean,default:!0}},emits:["click","mousedown","mouseup","mouseenter","mouseleave","mouseout","mouseover","dblclick","clicked-outside"],setup(Tr,{emit:Cr}){useCssVars(Xr=>({a4214eec:$r.width,"13a6823a":$r.height,"0c613e4a":Gr.value.palette.neutral[100]}));const $r=Tr,Ar=Cr,Rr=ref(!1),Dr=ref(!1),Mr=Xr=>{Ar("click",Xr)},Br=Xr=>{Dr.value=!0,Ar("mousedown",Xr)},Nr=Xr=>{Dr.value=!1,Ar("mouseup",Xr)},Lr=Xr=>{Rr.value=!0,Ar("mouseenter",Xr)},Hr=Xr=>{Rr.value=!1,Ar("mouseleave",Xr)},zr=Xr=>Ar("mouseout",Xr),Ur=Xr=>{Rr.value=!0,Ar("mouseover",Xr)},Vr=Xr=>Ar("dblclick",Xr),jr=()=>{Dr.value=!1,Ar("clicked-outside")},Gr=computed(()=>theme.appTheme());return(Xr,Kr)=>withDirectives((openBlock(),createElementBlock("div",{class:"button-wrapper",onClick:Mr,onMousedown:Br,onMouseup:Nr,onMouseenter:Lr,onMouseleave:Hr,onMouseout:zr,onMouseover:Ur,onDblclick:Vr},[createBaseVNode("div",{class:normalizeClass([{"opacity-60":!Xr.editable,"opacity-100":Xr.editable},"h-full"])},[renderSlot(Xr.$slots,"content",{hovering:Rr.value,active:Dr.value},()=>[createBaseVNode("button",{class:normalizeClass(["button",{"primary-gradient":Xr.variant==="primary"}])},[Xr.icon?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:Xr.icon.url,isSecondary:Xr.icon.isSecondary,height:Xr.icon.size??14,width:Xr.icon.size??14,vProps:Xr.icon.vProps,isFromLibrary:Xr.icon.isFromLibrary,isEmoji:Xr.icon.isEmoji},null,8,["src","isSecondary","height","width","vProps","isFromLibrary","isEmoji"])):createCommentVNode("",!0),createTextVNode(" "+toDisplayString(Xr.title),1)],2)],!0)],2)],32)),[[jr,clickOutside]])}}),BaseButton_vue_vue_type_style_index_0_scoped_feb8155d_lang="",BaseButton=_export_sfc(_sfc_main$1e,[["__scopeId","data-v-feb8155d"]]),_hoisted_1$Q=["onClick"],_hoisted_2$F=["onClick"],_hoisted_3$w={style:{minWidth:"14px",display:"inline-flex",alignItems:"center"}},_sfc_main$1d=defineComponent({__name:"StyledMoreMenu",props:{items:{default:()=>[]},dropdownWidth:{default:180},menuYGap:{default:4},placement:{},fallbackButtonProps:{},menuItemStyle:{},paddingBottomForMenu:{}},emits:["selected-item-id"],setup(Tr,{emit:Cr}){useCssVars(Kr=>({"6958cd95":Lr.value.palette.neutral[0],"1e6dc0cc":Lr.value.borderRadius.large,"6fbaf84a":Lr.value.spacing.s1,"4404cc6a":Lr.value.fontSize.f4}));const $r=Cr,Ar=Tr,{items:Rr,fallbackButtonProps:Dr,menuYGap:Mr,dropdownWidth:Br}=toRefs$1(Ar),Nr=ref(null),Lr=computed(()=>theme.appTheme()),Hr=useWindowSize(),zr=computed(()=>{var Kr;return((Kr=Dr==null?void 0:Dr.value)==null?void 0:Kr.iconSize)??18}),Ur=computed(()=>Rr.value.length*36+10),Vr=ref({top:0,left:0}),jr=Kr=>{Kr.preventDefault();const{top:Zr,bottom:eo,right:Wr,left:Yr,height:Jr}=Nr.value.getBoundingClientRect();if(Ar.placement==="cover"){Vr.value={top:Zr,left:Yr};return}const no=eo+Mr.value;if(no+Ur.value>Hr.height.value?Vr.value.top=Zr-Ur.value-Mr.value:Vr.value.top=no,Ar.placement==="center"){Vr.value.left=Yr+(Wr-Yr)/2-Br.value/2;return}if(Ar.placement==="left"){Vr.value.left=Yr;return}if(Ar.placement==="top"){Vr.value={left:Yr,bottom:Hr.height.value-eo+Jr+Mr.value,top:void 0};return}Vr.value.left=Wr-Br.value},Gr=computed(()=>{const Kr={};return Vr.value.top!=null&&(Kr.top=`${Vr.value.top}px`),Vr.value.bottom!=null&&(Kr.bottom=`${Vr.value.bottom}px`),Vr.value.left!=null&&(Kr.left=`${Vr.value.left}px`),Vr.value.right!=null&&(Kr.right=`${Vr.value.right}px`),Kr}),Xr=(Kr,Zr)=>{$r("selected-item-id",Zr==null?void 0:Zr.id)};return(Kr,Zr)=>{const eo=__nuxt_component_0;return openBlock(),createBlock(unref(ge$2),{as:"div",class:"menu",nullable:""},{default:withCtx(({open:Wr,close:Yr})=>[createBaseVNode("div",{ref_key:"element",ref:Nr,onClick:jr,style:{display:"flex"}},[createVNode(unref(Se$1),{class:"menu-button"},{default:withCtx(()=>[renderSlot(Kr.$slots,"button",{open:Wr},()=>[createVNode(BaseButton,{icon:{url:unref(assetUrl)("icon-more.svg"),size:`${zr.value}px`},width:"24px",height:"24px"},null,8,["icon"])],!0)]),_:2},1024)],512),createVNode(eo,null,{default:withCtx(()=>[(openBlock(),createBlock(Teleport,{to:"#main-app"},[createVNode(Transition,{name:"fade"},{default:withCtx(()=>[createVNode(unref(be),{as:"div",class:"menu-items headless-tracker",style:normalizeStyle({zIndex:Wr?1:0,...Gr.value,width:`${unref(Br)}px`,paddingBottom:Kr.paddingBottomForMenu?`${Kr.paddingBottomForMenu}px`:void 0})},{default:withCtx(()=>[renderSlot(Kr.$slots,"custom-items",{close:Yr},void 0,!0),(openBlock(!0),createElementBlock(Fragment$1,null,renderList(unref(Rr),Jr=>(openBlock(),createBlock(unref(Me),{as:"template",key:Jr==null?void 0:Jr.id,value:Jr},{default:withCtx(({active:no})=>[(Jr==null?void 0:Jr.type)==="boolean"?(openBlock(),createElementBlock("div",{key:0,class:"menu-item-toggle",style:normalizeStyle({background:no?Lr.value.palette.neutral[50]:Lr.value.palette.neutral[0]})},[(Jr==null?void 0:Jr.type)==="boolean"?(openBlock(),createElementBlock("div",{key:0,class:"menu-item-toggle",style:normalizeStyle({background:no?Lr.value.palette.neutral[50]:Lr.value.palette.neutral[0]})},[createBaseVNode("div",{onClick:withModifiers(ro=>Xr(ro,Jr),["stop"]),class:"menu-item",style:normalizeStyle({background:no?Lr.value.palette.neutral[100]:Lr.value.palette.neutral[0]})},[createBaseVNode("span",null,toDisplayString(Jr==null?void 0:Jr.name),1),createVNode(Toggle,{isOn:!!Jr.value,style:{marginLeft:"0px"}},null,8,["isOn"])],12,_hoisted_1$Q)],4)):createCommentVNode("",!0)],4)):(openBlock(),createElementBlock("div",{key:1,onClick:ro=>Xr(ro,Jr),class:"menu-item custom-truncate",style:normalizeStyle({...Kr.menuItemStyle,background:no?Lr.value.palette.neutral[50]:Lr.value.palette.neutral[0]})},[createBaseVNode("span",_hoisted_3$w,[Jr.icon?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)(Jr.icon),vProps:{height:Jr.isBig?18:14,width:Jr.isBig?18:14}},null,8,["src","vProps"])):createCommentVNode("",!0)]),createBaseVNode("div",{class:normalizeClass({"text-[#DB3033]":Jr.id==="delete"})},toDisplayString(Jr==null?void 0:Jr.name),3)],12,_hoisted_2$F))]),_:2},1032,["value"]))),128))]),_:2},1032,["style"])]),_:2},1024)]))]),_:2},1024)]),_:3})}}}),StyledMoreMenu_vue_vue_type_style_index_0_scoped_38079826_lang="",StyledMoreMenu=_export_sfc(_sfc_main$1d,[["__scopeId","data-v-38079826"]]),_sfc_main$1c={name:"StackedButton",components:{Icon:_sfc_main$1v},directives:{"click-outside":clickOutside},props:{title:{type:String,default:""},topIcon:{type:Object,default(){return{}}},isSelected:{type:Boolean,default:!1},currentBackgroundColorDict:{type:Object,default(){return{}}}},data(){return{hovering:!1,active:!1,defaultStyle:{transition:"background 20ms ease-in 0s",display:"flex",flexDirection:"column",alignItems:"center",padding:"0 10px",height:"24px",userSelect:"none",cursor:"pointer",borderRadius:"6px",justifyContent:"center"},defaultTextStyle:{display:"flex",alignItems:"center",justifyContent:"center",flex:"1 1 auto",whiteSpace:"nowrap",minWidth:"0",textOverflow:"ellipsis",overflow:"hidden",fontSize:"0.875rem",fontWeight:"500"},iconStyle:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:"0"}}},computed:{purposeMap(){return{normal:{color:this.colorToUse,activeColor:this.colorToUse,hoverColor:this.colorToUse,background:this.isSelected?this.hoverBackgroundToUse:this.backgroundToUse,activeBackground:this.activeBackgroundToUse,hoverBackground:this.backgroundToUse}}},purposeToUse(){return"normal"},activeBackground(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.activeBackground},activeColor(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.activeColor},hoverBackground(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.hoverBackground},hoverColor(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.hoverColor},normalBackground(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.background},normalColor(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.color},normalBorder(){var Tr;return(Tr=this.purposeMap[this.purposeToUse])==null?void 0:Tr.border},hasNoTitle(){return this.title.length===0},paddingToUse(){return"0 10px"},heightToUse(){return"26px"},fontSizeToUse(){return"0.875rem"},buttonStyle(){return this.active?{...this.defaultStyle,background:this.activeBackground,color:this.activeColor,border:this.normalBorder,padding:this.paddingToUse,height:this.heightToUse}:this.hovering?{...this.defaultStyle,background:this.hoverBackground,color:this.hoverColor,border:this.normalBorder,padding:this.paddingToUse,height:this.heightToUse}:{...this.defaultStyle,background:this.normalBackground,color:this.normalColor,border:this.normalBorder,padding:this.paddingToUse,height:this.heightToUse}},textStyle(){return{...this.defaultTextStyle,fontSize:this.fontSizeToUse}},iconStyleTop(){return{...this.iconStyle}},darkTheme(){return this.isDarkColor({color:this.getColorFromDict(this.currentBackgroundColorDict)})},backgroundToUse(){return theme.appColors.backgroundToUseCustom(this.darkTheme,this.currentBackgroundColorDict)},activeBackgroundToUse(){return theme.appColors.activeBackgroundToUse(this.darkTheme)},hoverBackgroundToUse(){return theme.appColors.hoverBackgroundToUse(this.darkTheme)},selectedBackgroundToUse(){return theme.appColors.selectedBackgroundToUse(this.darkTheme)},secondaryBackgroundToUse(){return theme.appColors.secondaryBackgroundToUse(this.darkTheme)},secondaryHoverBackgroundToUse(){return theme.appColors.secondaryHoverBackgroundToUse(this.darkTheme)},secondaryActiveBackgroundToUse(){return theme.appColors.secondaryActiveBackgroundToUse(this.darkTheme)},textBackgroundToUse(){return theme.appColors.textBackgroundToUse(this.darkTheme)},colorToUse(){return theme.appColors.colorToUse(this.darkTheme)},colorInTheme(){return this.colorToUse},softColorToUse(){return theme.appColors.softColorToUse(this.darkTheme)}},methods:{mouseOver(){this.hovering=!0},mouseLeave(){this.hovering=!1},mouseDown(){this.active=!0},mouseUp(){this.active=!1}}};function _sfc_render$f(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("Icon"),Br=resolveDirective("click-outside");return withDirectives((openBlock(),createElementBlock("div",{style:normalizeStyle(Dr.buttonStyle),onMouseover:Cr[0]||(Cr[0]=Nr=>Dr.mouseOver()),onMouseleave:Cr[1]||(Cr[1]=Nr=>Dr.mouseLeave()),onMousedown:Cr[2]||(Cr[2]=Nr=>Dr.mouseDown()),onClick:Cr[3]||(Cr[3]=Nr=>Dr.mouseUp()),role:"button"},[renderSlot(Tr.$slots,"top",{},()=>[$r.topIcon.icon?(openBlock(),createBlock(Mr,{key:0,src:$r.topIcon.icon,isSecondary:$r.topIcon.isSecondary,height:$r.topIcon.iconSize??14,width:$r.topIcon.iconSize??14,style:normalizeStyle(Dr.iconStyleTop),vProps:$r.topIcon.vProps,isFromLibrary:$r.topIcon.isFromLibrary,isEmoji:$r.topIcon.isEmoji},null,8,["src","isSecondary","height","width","style","vProps","isFromLibrary","isEmoji"])):createCommentVNode("",!0)]),renderSlot(Tr.$slots,"content",{},()=>[$r.title?(openBlock(),createElementBlock("div",{key:0,style:normalizeStyle(Dr.textStyle)},toDisplayString($r.title),5)):createCommentVNode("",!0)])],36)),[[Br,Dr.mouseUp]])}const StackedButton=_export_sfc(_sfc_main$1c,[["render",_sfc_render$f]]),Input_vue_vue_type_style_index_0_scoped_3c6c3dd1_lang="",_sfc_main$1b={name:"Input",setup(Tr,Cr){const{selectOnClick:$r}=toRefs$1(Tr),Ar=ref(null),Rr=ref(null),{focused:Dr}=useFocusWithin(Rr);onMounted(()=>{Tr.focused&&setTimeout(()=>{Ar.value&&Ar.value.focus()},0)}),watch(Dr,Nr=>{Nr?(Cr.emit("focused",!0),$r.value&&Ar.value.select()):Cr.emit("focused",!1)});const Mr=ref(!1),Br=ref(!1);return{input:Ar,target:Rr,hovering:Mr,active:Br}},emits:["update:modelValue","did-enter","did-blur","focused"],components:{Icon:_sfc_main$1v},props:{placeholderStyle:{type:Object,default(){return{color:""}}},inputAddStyle:{type:Object,default(){return{}}},width:Number,height:{type:Number,default:32},leftIcon:{type:Object,default(){return{}}},rightIcon:{type:Object,default(){return{}}},placeholder:String,fontSize:{type:Number,default:14},focused:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},modelValue:{type:[String,Number]},hasCloseButton:{type:Boolean,default:!1},valueIsErroneous:{type:Boolean,default:!1},clearInputOnEscape:{type:Boolean,default:!1},isTransparent:{type:Boolean,default:!1},inputType:{type:String,default:"text"},constraints:{type:Object,default(){return{}}},selectOnClick:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showHoverEffect:{type:Boolean,default:!0}},computed:{localValue:{get(){var Tr;return((Tr=this.modelValue)==null?void 0:Tr.length)===0?this.localValueBackup:this.modelValue},set(Tr){Tr.length>0?this.showInputClose=!0:this.showInputClose=!1,this.localValueBackup=Tr,this.$emit("update:modelValue",Tr)}},inputTypeToUse(){return this.inputType},containerStyle(){let Tr="100%";this.width&&(Tr=`${this.width}px`);let Cr=this.appTheme.palette.neutral[0];return this.isTransparent&&(Cr="transparent"),{lineHeight:"1.5",height:`${this.height}px`,fontSize:`${this.fontSize}px`,color:this.appTheme.palette.neutral[900],background:Cr,width:Tr}},closeButtonStyle(){return{...this.defaultCloseButtonStyle,fill:this.appTheme.palette.neutral[400],"--fillActive":this.appTheme.palette.neutral[300]}},infoIconContainerStyle(){return{position:"absolute",display:"flex",cursor:"pointer",top:"50%",right:"8px",transform:"translateY(-50%)"}},placeholderColor(){return this.placeholderStyle.color},borderToUse(){return this.valueIsErroneous?`1px solid ${this.appTheme.palette.danger[500]}`:this.showHoverEffect?`1px solid ${this.appTheme.palette.neutral[300]}`:this.hovering?`1px solif ${this.appTheme.palette.neutral[300]}`:this.active?`1px solid ${this.appTheme.palette.primary[800]}`:`1px solid ${this.appTheme.palette.neutral[100]}`},darkBorderColor(){return this.appTheme.palette.neutral[100]},hoverBorderColor(){return this.appTheme.palette.neutral[100]},regularBorderColor(){return this.appTheme.palette.neutral[100]},iconStyle(){return{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:"0"}},iconStyleLeft(){return{...this.iconStyle,marginRight:"0px"}},iconStyleRight(){return{...this.iconStyle,marginLeft:"0px"}}},watch:{localValue(Tr,Cr){Tr===this.modelValue&&Cr===""&&(this.setupComplete=!0)},setupComplete(Tr){Tr&&this.handleFocusAndSelection()},focused(){this.focused&&this.$refs.input.focus()},selected(){this.selected&&this.$refs.input.select()}},data(){return{localValueBackup:"",hideText:!1,color:"red",setupComplete:!1,showInputClose:!1,inputStyle:{position:"relative",font:"inherit",color:"inherit",fontSize:"1rem",fontWeight:"500",fontFamily:"inherit",border:"0",background:"none",width:"100%",flexShrink:1,padding:"0",resize:"none",whiteSpace:"pre-wrap",wordBreak:"break-word",flexGrow:"1"},defaultCloseButtonStyle:{position:"absolute",display:"flex",cursor:"pointer",top:"50%",right:"10px",transform:"translateY(-50%)"}}},methods:{focus(Tr){var Cr;Tr.preventDefault(),(Cr=this.$refs.input)==null||Cr.focus()},didEnter(){this.$emit("did-enter",this.localValueBackup)},didBlur(){this.$emit("did-blur",this.localValueBackup)},clearInput(){this.localValue=""},clearInputViaEscape(Tr){this.clearInputOnEscape&&this.localValue!==""&&(Tr.stopPropagation(),this.clearInput())},handleFocusAndSelection(){var Tr,Cr;this.focused&&((Tr=this.$refs.input)==null||Tr.focus()),this.selected&&((Cr=this.$refs.input)==null||Cr.select())},updateContainerWidth(){const Tr=this.$refs.hiddenSpan;console.log(Tr),Tr.textContent=this.localValue||this.placeholder||"",this.$el.style.width=`${Tr.offsetWidth+16}px`,console.log(this.$el.style.width)}},created(){this.hideText=this.inputType==="password",this.localValueBackup=this.modelValue},mounted(){this.handleFocusAndSelection()}},__injectCSSVars__$5=()=>{useCssVars(Tr=>({a8c4c2a8:Tr.regularBorderColor,e21c5d68:Tr.hoverBorderColor,"9dac4ce0":Tr.darkBorderColor,66097341:Tr.placeholderColor}))},__setup__$5=_sfc_main$1b.setup;_sfc_main$1b.setup=__setup__$5?(Tr,Cr)=>(__injectCSSVars__$5(),__setup__$5(Tr,Cr)):__injectCSSVars__$5;const _hoisted_1$P=["placeholder","type","disabled"];function _sfc_render$e(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("Icon");return openBlock(),createElementBlock("div",{style:normalizeStyle(Dr.containerStyle),class:"input-container relative flex items-center rounded-lg p-2 cursor-text gap-2",ref:"target",onMouseover:Cr[4]||(Cr[4]=Br=>Ar.hovering=!0),onMouseleave:Cr[5]||(Cr[5]=Br=>Ar.hovering=!1),onMousedown:Cr[6]||(Cr[6]=Br=>Ar.active=!0),onMouseup:Cr[7]||(Cr[7]=Br=>Ar.active=!1)},[renderSlot(Tr.$slots,"left",{hovering:Ar.hovering,active:Ar.active,focus:Dr.focus},()=>[$r.leftIcon.icon?(openBlock(),createBlock(Mr,{key:0,src:$r.leftIcon.icon,isSecondary:$r.leftIcon.isSecondary,height:$r.leftIcon.iconSize??16,width:$r.leftIcon.iconSize??16,style:normalizeStyle(Dr.iconStyleLeft),vProps:$r.leftIcon.vProps,isFromLibrary:$r.leftIcon.isFromLibrary,isEmoji:$r.leftIcon.isEmoji},null,8,["src","isSecondary","height","width","style","vProps","isFromLibrary","isEmoji"])):createCommentVNode("",!0)],!0),withDirectives(createBaseVNode("input",mergeProps({"onUpdate:modelValue":Cr[0]||(Cr[0]=Br=>Dr.localValue=Br),style:[Rr.inputStyle,$r.inputAddStyle],class:{"placeholder-color":$r.placeholderStyle.color},spellcheck:!1,placeholder:$r.placeholder,onKeyup:Cr[1]||(Cr[1]=withKeys((...Br)=>Dr.didEnter&&Dr.didEnter(...Br),["enter"])),onBlur:Cr[2]||(Cr[2]=(...Br)=>Dr.didBlur&&Dr.didBlur(...Br)),onKeydown:Cr[3]||(Cr[3]=withKeys((...Br)=>Dr.clearInputViaEscape&&Dr.clearInputViaEscape(...Br),["esc"])),type:$r.inputType},$r.constraints,{ref:"input",class:"input-field",disabled:$r.disabled}),null,16,_hoisted_1$P),[[vModelDynamic,Dr.localValue]]),renderSlot(Tr.$slots,"right",{hovering:Ar.hovering,active:Ar.active},()=>[$r.rightIcon.icon?(openBlock(),createBlock(Mr,{key:0,src:$r.rightIcon.icon,isSecondary:$r.rightIcon.isSecondary,height:$r.rightIcon.iconSize??16,width:$r.rightIcon.iconSize??16,style:normalizeStyle(Dr.iconStyleRight),vProps:$r.rightIcon.vProps,isFromLibrary:$r.rightIcon.isFromLibrary,isEmoji:$r.rightIcon.isEmoji},null,8,["src","isSecondary","height","width","style","vProps","isFromLibrary","isEmoji"])):createCommentVNode("",!0)],!0)],36)}const Input=_export_sfc(_sfc_main$1b,[["render",_sfc_render$e],["__scopeId","data-v-3c6c3dd1"]]);function useVirtualListVertical(Tr,Cr){const $r=ref(),Ar=useElementSize($r),Rr=ref([]),Dr=shallowRef(Tr),Mr=ref({start:0,end:10}),{itemHeight:Br,overscan:Nr=5}=Cr,Lr=Zr=>{if(typeof Br=="number")return Math.ceil(Zr/Br);const{start:eo=0}=Mr.value;let Wr=0,Yr=0;for(let Jr=eo;Jr=Zr)return Yr=Jr,Yr-eo;Yr+=1}return Yr},Hr=Zr=>{if(typeof Br=="number")return Math.floor(Zr/Br)+1;let eo=0,Wr=0;for(let Yr=0;Yr=Zr){Wr=Yr;break}}return Wr+1},zr=()=>{const Zr=$r.value;if(Zr){const eo=Hr(Zr.scrollTop),Wr=Lr(Zr.clientHeight),Yr=eo-Nr,Jr=eo+Wr+Nr;Mr.value={start:Yr<0?0:Yr,end:Jr>Dr.value.length?Dr.value.length:Jr},Rr.value=Dr.value.slice(Mr.value.start,Mr.value.end).map((no,ro)=>({data:no,index:ro+Mr.value.start}))}};watch([Ar.width,Ar.height,Tr],()=>{zr()});const Ur=computed(()=>typeof Br=="number"?Dr.value.length*Br:Dr.value.reduce((Zr,eo,Wr)=>Zr+Br(Wr),0)),Vr=Zr=>typeof Br=="number"?Zr*Br:Dr.value.slice(0,Zr).reduce((Wr,Yr,Jr)=>Wr+Br(Jr),0),jr=Zr=>{$r.value&&($r.value.scrollTop=Vr(Zr),zr())},Gr=computed(()=>Vr(Mr.value.start)),Xr=computed(()=>({style:{width:"100%",height:`${Ur.value-Gr.value}px`,marginTop:`${Gr.value}px`}}));return{list:Rr,scrollTo:jr,containerProps:{ref:$r,onScroll:()=>{zr()},style:{overflowY:"auto"}},wrapperProps:Xr}}const supabase=SupabaseWrapper.client;let SUPABASE_URL_OG;SUPABASE_URL_OG="https://nucgnbhmmqgwgmivzcrz.supabase.co";const storagePrefix="storage/v1/object/public",getAssetUrl=({id:Tr,owner_id:Cr,type:$r="image",extension:Ar="png",bucket:Rr="assets",filename:Dr})=>{Dr=Dr??`${Tr}.${Ar}`;const Mr=Cr?`users/${Cr}/${$r}s`:"users/anonymous";return`${SUPABASE_URL_OG}/${storagePrefix}/${Rr}/${Mr}/${Dr}`},uploadImageToSupabase=async(Tr,Cr,{bucket:$r="assets",prefix:Ar="users",contentType:Rr="image/png"})=>{const{data:Dr,error:Mr}=await supabase.storage.from($r).upload(`${Ar}/${Tr}`,Cr,{cacheControl:"3600",upsert:!0,contentType:Rr});return{data:Dr,error:Mr}},createDataURI=(Tr,Cr="image/png")=>`data:${Cr};base64,${Tr}`,convertBase64ToBlob=Tr=>{const Cr=Tr.split(";base64,"),$r=Cr[0].split(":")[1],Ar=window.atob(Cr[1]),Rr=new Uint8Array(Ar.length);for(let Dr=0;Dr{if(Tr==null)return null;const $r=createDataURI(Tr,Cr),Ar=convertBase64ToBlob($r);return URL.createObjectURL(Ar)},getFileExtensionFromType=Tr=>{var $r,Ar,Rr,Dr;return(((Dr=(Rr=(Ar=($r=blockConfig==null?void 0:blockConfig.state)==null?void 0:$r.configs)==null?void 0:Ar.image)==null?void 0:Rr.metaData)==null?void 0:Dr.extensionFromType)??{})[Tr]??"png"},uploadAIImageToSupabase=async(Tr,{bucket:Cr="assets",contentType:$r="image/png",id:Ar="",owner_id:Rr})=>{var Ur,Vr,jr,Gr;if(Tr==null)return{id:null,url:null};const Dr=createDataURI(Tr,$r),Mr=convertBase64ToBlob(Dr),Br=Ar===""?guid():Ar,Nr=(((Gr=(jr=(Vr=(Ur=blockConfig==null?void 0:blockConfig.state)==null?void 0:Ur.configs)==null?void 0:Vr.image)==null?void 0:jr.metaData)==null?void 0:Gr.extensionFromType)??{})[$r]??"png",Lr=`${Br}.${Nr}`,Hr=Rr?`users/${Rr}/images`:"users/anonymous",{error:zr}=await uploadImageToSupabase(Lr,Mr,{bucket:Cr,prefix:Hr,contentType:$r});return zr?(console.log(zr),{id:null,url:null}):{id:Br,url:`${SUPABASE_URL_OG}/${storagePrefix}/${Cr}/${Hr}/${Lr}`}},uploadUGCImageToSupabase=async(Tr,{bucket:Cr="assets",contentType:$r="image/png",id:Ar="",owner_id:Rr})=>{var Hr,zr,Ur,Vr;const Dr=Ar===""?guid():Ar,Mr=(((Vr=(Ur=(zr=(Hr=blockConfig==null?void 0:blockConfig.state)==null?void 0:Hr.configs)==null?void 0:zr.image)==null?void 0:Ur.metaData)==null?void 0:Vr.extensionFromType)??{})[$r]??"png",Br=`${Dr}.${Mr}`,Nr=Rr?`users/${Rr}/images`:"users/anonymous",{error:Lr}=await uploadImageToSupabase(Br,Tr,{bucket:Cr,prefix:Nr,contentType:$r});return Lr?(console.log(Lr),{id:null,url:null}):{id:Dr,url:`${SUPABASE_URL_OG}/${storagePrefix}/${Cr}/${Nr}/${Br}`}},fileStorageUtils={uploadImageToSupabase,createDataURI,uploadAIImageToSupabase,uploadUGCImageToSupabase,getURIFromBase64,getAssetUrl,getFileExtensionFromType},IconPicker2_vue_vue_type_style_index_0_scoped_39252787_lang="",_sfc_main$1a={setup(Tr,Cr){var ko;const $r=useAppStore(),Ar=useBlockStore(),Rr=useMiscStore(),Dr=useUserStore(),{width:Mr}=useWindowSize(),Br=inject("blockConfig"),Nr=inject("isMobile"),Lr=computed(()=>Nr.value?8:10),Hr=computed(()=>Ar.config(Tr.blockId).icon??{}),zr=computed(()=>{var $o;return(($o=Hr.value)==null?void 0:$o.alignment)??"vertical"}),Ur=computed(()=>Br.state.options.icons.slice(0,560)),Vr=computed(()=>Br.state.options.emojis),jr=ref(!((ko=Hr.value)!=null&&ko.type)||Hr.value.type==="emoji"?"emojis":"custom"),Gr=computed(()=>jr.value==="icons"?Ur.value:Vr.value),Xr=computed(()=>Nr.value?(Mr.value-16*2-7*12)/8:20),Kr={height:"24px",width:"24px",borderRadius:"4px",fontFamily:"General Sans",padding:0},Zr=ref(""),{results:eo}=useFuse(Zr,Gr,{fuseOptions:{keys:[{name:"id",weight:1}],includeScore:!0},matchAllWhenSearchEmpty:!0}),Wr=computed(()=>eo.value.filter($o=>$o.score<.3||$o.score==null).map($o=>$o.item)),Yr=computed(()=>{const $o=[],Go=Math.ceil(Wr.value.length/Lr.value);for(let No=0;NoYr.value.map($o=>({height:Xr.value}))),{list:no,containerProps:ro,wrapperProps:so,scrollTo:ao}=useVirtualListVertical(Jr,{itemHeight:$o=>Jr.value[$o].height+8,overscan:2}),{files:lo,open:po,reset:go}=useFileDialog({accept:"image/*,image/heic,image/heif"});watch(lo,()=>{if(lo.value==null||lo.value.length!==1)return;const $o=Dr.currentUserId,Go=fileStorageUtils.getFileExtensionFromType(lo.value[0].type),No=`icon-${new Date().getTime()}.${Go}`;fileStorageUtils.uploadImageToSupabase(No,lo.value[0],{prefix:`users/${$o}/icons`,contentType:lo.value[0].type}).then(()=>{let Eo=fileStorageUtils.getAssetUrl({filename:No,type:"icon",owner_id:$o});Eo=SupabaseWrapper.getOptimizedImageUrl(Eo,{width:960}),Cr.emit("selected-img",Eo),go()})});const co=()=>{po()},mo=()=>{jr.value="emojis",Cr.emit("switch-tab","emoji")},io=()=>{jr.value="custom",Cr.emit("switch-tab","custom")},uo=()=>{const $o={...Hr.value};zr.value==="horizontal"?$o.alignment="vertical":$o.alignment="horizontal",Ar.updateProps(Tr.blockId,{keyPath:["config","icon"],value:$o})},ho=$o=>{const Go={...Hr.value,size:$o};Ar.updateProps(Tr.blockId,{keyPath:["config","icon"],value:Go})},yo=()=>{Cr.emit("close")};onKeyStroke(["Escape"],()=>{yo()}),onBeforeUnmount(()=>{Rr.setTextIconPopup({open:!1})});const So=computed(()=>$r.deckThemeValue(Tr.appId));return{sizeOfEmoji:Xr,isMobile:Nr,deckThemeValue:So,btnStyle:Kr,icon:Hr,alignment:zr,updateAlignment:uo,updateSize:ho,close:yo,clickEmojiTab:mo,clickCustomTab:io,openFileUploader:co,assetUrl,selectedType:jr,query:Zr,filteredItems:Wr,itemRows:Yr,containerProps:ro,wrapperProps:so,list:no}},components:{MobileSlideOutHeader:_sfc_main$1p,StackedButton,Input,Icon:_sfc_main$1v},emits:["selected-item-id","selected-img","remove","switch-tab","close"],props:{selectedId:{type:String},open:{type:Boolean},blockId:{type:String,default:null},appId:{type:String},showCustomImagePicker:{type:Boolean,default:!1}},data(){return{}},computed:{sectionStyle(){return{padding:`0px ${this.appTheme.spacing.s4}`,width:"100%"}}},methods:{},mounted(){}},_withScopeId$6=Tr=>(pushScopeId("data-v-39252787"),Tr=Tr(),popScopeId(),Tr),_hoisted_1$O={key:0,id:"icon-picker",class:"inline-flex flex-col items-start w-full sm:w-[296px] h-[400px] sm:h-auto",style:{padding:"0px"}},_hoisted_2$E={key:1,class:"flex justify-between items-start self-stretch p-2 pb-0"},_hoisted_3$v={class:"flex gap-1.5 items-center"},_hoisted_4$q=_withScopeId$6(()=>createBaseVNode("div",{class:"w-[1px] h-[16px] bg-[#E7E7E7]"},null,-1)),_hoisted_5$j={class:"flex gap-0.5"},_hoisted_6$i=["onClick"],_hoisted_7$f={class:"text-sm font-medium font-heading -tracking-[0.42px] cursor-pointer"},_hoisted_8$a=_withScopeId$6(()=>createBaseVNode("label",{class:"text-base sm:text-sm font-medium truncate text-neutralSolid-700 cursor-pointer"},"Remove",-1)),_hoisted_9$a=[_hoisted_8$a],_hoisted_10$9={class:"flex justify-between items-start self-stretch p-2 pb-0 border-b border-b-neutralSolid-100"},_hoisted_11$5={class:"flex items-start gap-1"},_hoisted_12$5={class:"flex flex-col items-start"},_hoisted_13$5={key:0,class:"flex flex-col justify-end items-start self-stretch h-3 sm:h-2 px-2"},_hoisted_14$5={key:0,class:"flex flex-col items-start"},_hoisted_15$4={key:0,class:"flex flex-col justify-end items-start self-stretch h-3 sm:h-2 px-2"},_hoisted_16$3=_withScopeId$6(()=>createBaseVNode("label",{class:"text-base sm:text-sm font-medium truncate text-neutralSolid-700 cursor-pointer"},"Reset",-1)),_hoisted_17$3=[_hoisted_16$3],_hoisted_18$3={key:2,class:"flex flex-col items-start gap-3 p-3 pb-0 w-full"},_hoisted_19$3={key:0,style:{marginLeft:"8px",height:"24px"}},_hoisted_20$2={key:3,class:"flex flex-col justify-center items-center gap-3 p-3 w-full"},_hoisted_21$2=_withScopeId$6(()=>createBaseVNode("label",{class:"text-base font-medium cursor-pointer"},"Upload picture",-1)),_hoisted_22$2=[_hoisted_21$2],_hoisted_23$1=_withScopeId$6(()=>createBaseVNode("label",{class:"label-normal text-neutralSolid-500"},"Recommended size is 880x880 pixels.",-1));function _sfc_render$d(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("MobileSlideOutHeader"),Br=resolveComponent("Icon"),Nr=resolveComponent("Input"),Lr=resolveComponent("StackedButton");return $r.open||Ar.isMobile?(openBlock(),createElementBlock("div",_hoisted_1$O,[Ar.isMobile?(openBlock(),createBlock(Mr,{key:0,title:"File logo",onTappedClose:Cr[0]||(Cr[0]=Hr=>Tr.$emit("close")),class:"mb-0"})):createCommentVNode("",!0),$r.blockId?(openBlock(),createElementBlock("div",_hoisted_2$E,[createBaseVNode("div",_hoisted_3$v,[createBaseVNode("button",{class:"flex items-center justify-center p-1 gap-1 w-[26px] h-[26px] rounded-lg hover:bg-neutralSolid-50 active:bg-neutralSolid-100",onClick:Cr[1]||(Cr[1]=withModifiers((...Hr)=>Ar.updateAlignment&&Ar.updateAlignment(...Hr),["stop"]))},[createVNode(Br,{src:Ar.assetUrl(`icon-align-${Ar.alignment}.svg`),vProps:{width:20,height:20}},null,8,["src"])]),_hoisted_4$q,createBaseVNode("div",_hoisted_5$j,[(openBlock(),createElementBlock(Fragment$1,null,renderList(["XS","S","M","L"],Hr=>createBaseVNode("button",{class:normalizeClass(["flex items-center justify-center p-1 gap-1 w-[26px] h-[26px] rounded-lg active:bg-neutralSolid-100",{"bg-neutralSolid-50":Ar.icon.size===Hr,"hover:bg-neutralSolid-50":Ar.icon.size!==Hr}]),key:Hr,onClick:withModifiers(()=>Ar.updateSize(Hr),["stop"])},[createBaseVNode("label",_hoisted_7$f,toDisplayString(Hr),1)],10,_hoisted_6$i)),64))])]),createBaseVNode("button",{class:"flex items-center justify-center bg-[#F5F5F5] hover:bg-neutral-50 active:bg-neutral-100 transition px-2 py-1 rounded-lg",onClick:Cr[2]||(Cr[2]=Hr=>Tr.$emit("remove"))},_hoisted_9$a)])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_10$9,[createBaseVNode("div",_hoisted_11$5,[createBaseVNode("div",_hoisted_12$5,[createBaseVNode("button",{onClick:Cr[3]||(Cr[3]=withModifiers((...Hr)=>Ar.clickEmojiTab&&Ar.clickEmojiTab(...Hr),["stop"])),class:normalizeClass(["flex items-center px-2 py-1 rounded-lg active:bg-neutral-100",{"hover:bg-neutral-50":Ar.selectedType!=="emojis"}])},[createBaseVNode("label",{class:normalizeClass(["text-base sm:text-sm font-medium truncate cursor-pointer",{"text-black":Ar.selectedType==="emojis","text-neutralSolid-500":Ar.selectedType!=="emojis"}])}," Emoji ",2)],2),Ar.selectedType==="emojis"?(openBlock(),createElementBlock("div",_hoisted_13$5,[createBaseVNode("div",{class:"h-0.5 shrink-0 self-stretch",style:normalizeStyle({background:`${Ar.deckThemeValue}`})},null,4)])):createCommentVNode("",!0)]),$r.blockId||$r.showCustomImagePicker?(openBlock(),createElementBlock("div",_hoisted_14$5,[createBaseVNode("button",{onClick:Cr[4]||(Cr[4]=withModifiers((...Hr)=>Ar.clickCustomTab&&Ar.clickCustomTab(...Hr),["stop"])),class:normalizeClass(["flex items-center px-2 py-1 rounded-lg active:bg-neutral-100",{"hover:bg-neutral-50":Ar.selectedType!=="custom"}])},[createBaseVNode("label",{class:normalizeClass(["text-base sm:text-sm font-medium truncate cursor-pointer",{"text-black":Ar.selectedType==="custom","text-neutralSolid-500":Ar.selectedType!=="custom"}])}," Custom ",2)],2),Ar.selectedType==="custom"?(openBlock(),createElementBlock("div",_hoisted_15$4,[createBaseVNode("div",{class:"h-0.5 shrink-0 self-stretch",style:normalizeStyle({background:`${Ar.deckThemeValue}`})},null,4)])):createCommentVNode("",!0)])):createCommentVNode("",!0)]),$r.blockId?createCommentVNode("",!0):(openBlock(),createElementBlock("button",{key:0,class:"flex items-center justify-center bg-[#F5F5F5] hover:bg-neutral-50 active:bg-neutral-100 transition px-2 py-1 rounded-lg",onClick:Cr[5]||(Cr[5]=Hr=>Tr.$emit("selected-item-id",null))},_hoisted_17$3))]),Ar.selectedType==="emojis"?(openBlock(),createElementBlock("div",_hoisted_18$3,[createVNode(Nr,{focused:!Ar.isMobile,onKeydown:withKeys(Ar.close,["esc"]),placeholder:"Filter...",modelValue:Ar.query,"onUpdate:modelValue":Cr[6]||(Cr[6]=Hr=>Ar.query=Hr),style:normalizeStyle({height:"38px",width:"100%",background:"rgba(0, 0, 0, 0.04)",padding:"7px",borderRadius:"12px",border:0}),leftIcon:{icon:Ar.assetUrl("icon-search.svg"),vProps:{height:"16px",width:"16px",stroke:"#888888"}}},null,8,["focused","onKeydown","modelValue","style","leftIcon"]),createBaseVNode("div",mergeProps(Ar.containerProps,{style:{width:"100%",height:Ar.isMobile?"300px":"177px",marginBottom:Ar.isMobile?"auto":"0px"},class:"overflow-x-hidden hide-scrollbar"}),[createBaseVNode("div",mergeProps(Ar.wrapperProps,{class:"flex flex-col items-center gap-3 sm:gap-2 mb-3 min-h-[24px]"}),[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Ar.list,({index:Hr})=>(openBlock(),createElementBlock("div",{key:Hr,class:"flex gap-3 sm:gap-2 items-center"},[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Ar.itemRows[Hr],zr=>(openBlock(),createBlock(Lr,{key:zr==null?void 0:zr.id,style:normalizeStyle({height:`${Ar.sizeOfEmoji}px`,width:`${Ar.sizeOfEmoji}px`,padding:0,textAlign:"center"}),isSelected:(zr==null?void 0:zr.id)===$r.selectedId,onClick:Ur=>Tr.$emit("selected-item-id",{item:zr,selectedType:Ar.selectedType})},{top:withCtx(()=>[createVNode(Br,{src:zr.value,isFromLibrary:Ar.selectedType==="icons",isEmoji:Ar.selectedType==="emojis",vProps:{height:Ar.sizeOfEmoji,width:Ar.sizeOfEmoji}},null,8,["src","isFromLibrary","isEmoji","vProps"])]),_:2},1032,["style","isSelected","onClick"]))),128))]))),128)),Ar.list.length===0?(openBlock(),createElementBlock("div",_hoisted_19$3,"No matching "+toDisplayString(Ar.selectedType)+" found.",1)):createCommentVNode("",!0)],16)],16)])):(openBlock(),createElementBlock("div",_hoisted_20$2,[createBaseVNode("button",{class:"flex items-center justify-center py-2 px-3 w-full h-[38px] gap-2 rounded-lg border border-neutral-100",onClick:Cr[7]||(Cr[7]=(...Hr)=>Ar.openFileUploader&&Ar.openFileUploader(...Hr))},_hoisted_22$2),_hoisted_23$1]))])):createCommentVNode("",!0)}const IconPicker=_export_sfc(_sfc_main$1a,[["render",_sfc_render$d],["__scopeId","data-v-39252787"]]),_hoisted_1$N=["onClick"],_hoisted_2$D={class:"flex gap-2 grow"},_hoisted_3$u={key:0,class:"label-medium text-neutralSolid-400",style:{cursor:"inherit"}},_sfc_main$19=defineComponent({__name:"StyledRightClickMenu",props:{visible:{type:Boolean},positionX:{},positionY:{},items:{},iconSize:{},width:{default:214}},emits:["selected-item-id","close"],setup(Tr,{emit:Cr}){useCssVars(Hr=>({"0a6e207a":Nr.value.palette.neutral[0],a0443a0c:Nr.value.borderRadius.large}));const $r=Tr,Ar=Cr,Rr=useWindowSize(),Dr=ref(null),Mr=computed(()=>{if(!Dr.value)return $r.positionX;const Hr=Dr.value.getBoundingClientRect();return $r.positionX+Hr.width>Rr.width.value?$r.positionX-Hr.width-4:$r.positionX}),Br=computed(()=>{if(!Dr.value)return $r.positionY;const Hr=Dr.value.getBoundingClientRect();return $r.positionY+Hr.height>Rr.height.value?$r.positionY-Hr.height-4:$r.positionY}),Nr=computed(()=>theme.appTheme()),Lr=Hr=>{Ar("selected-item-id",Hr),Ar("close")};return IS_CLIENT&&(useEventListener(document,"keydown",Hr=>{$r.visible&&Hr.key==="Escape"&&Ar("close")}),onClickOutside(Dr,()=>{Ar("close")})),(Hr,zr)=>{const Ur=__nuxt_component_0;return openBlock(),createBlock(Ur,null,{default:withCtx(()=>[(openBlock(),createBlock(Teleport,{to:"#main-app"},[createVNode(Transition,{name:"fade"},{default:withCtx(()=>[$r.visible?(openBlock(),createElementBlock("div",{key:0,ref_key:"menuElement",ref:Dr,class:"headless-tracker right-click-pane absolute flex flex-col rounded-[12px] max-h-[500px] z-[100] bg-white overflow-x-hidden overflow-y-auto",style:normalizeStyle({left:`${Mr.value}px`,top:`${Br.value}px`,boxShadow:"0px 20px 32px 0px rgba(0, 0, 0, 0.06)",border:"1px solid #f2f2f2",width:`${$r.width}px`})},[createVNode(unref(ge$2),null,{default:withCtx(()=>[createVNode(unref(be),{static:"",as:"div",class:"menu-items bg-white"},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Hr.items,Vr=>(openBlock(),createBlock(unref(Me),{key:Vr.id,value:Vr.name,as:"template"},{default:withCtx(({active:jr})=>[createBaseVNode("div",{class:normalizeClass(["menu-item",{"hover:bg-neutralSolid-50":!Vr.disabled,"bg-neutralSolid-100":jr&&!Vr.disabled}]),style:normalizeStyle(Vr.disabled?{cursor:"not-allowed"}:{}),onClick:Gr=>Lr(Vr.id)},[createBaseVNode("div",_hoisted_2$D,[Vr.icon?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)(Vr.icon),vProps:{height:20,width:20,...Vr.iconProps??{}}},null,8,["src","vProps"])):createCommentVNode("",!0),createBaseVNode("label",{class:normalizeClass(["label-medium",{"text-[#DB3033]":Vr.id==="delete"}]),style:normalizeStyle([(Vr==null?void 0:Vr.textStyles)??{},{cursor:"inherit"}])},toDisplayString(Vr==null?void 0:Vr.name),7)]),Vr!=null&&Vr.shortcut?(openBlock(),createElementBlock("label",_hoisted_3$u,toDisplayString(Vr==null?void 0:Vr.shortcut),1)):createCommentVNode("",!0)],14,_hoisted_1$N)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})],4)):createCommentVNode("",!0)]),_:1})]))]),_:1})}}}),StyledRightClickMenu_vue_vue_type_style_index_0_scoped_5063409f_lang="",StyledRightClickMenu=_export_sfc(_sfc_main$19,[["__scopeId","data-v-5063409f"]]),_hoisted_1$M={class:"p-4 bg-white border border-[#E9E9E9] shadow-[0_16px_32px_rgba(0,0,0,0.04)] rounded-2xl transition-all duration-1000 flex flex-col gap-2"},_hoisted_2$C={class:"font-[600] text-[16px]"},_hoisted_3$t={class:"font-[400]"},_hoisted_4$p={class:"flex flex-row items-center justify-between gap-2 mt-4"},_sfc_main$18=defineComponent({__name:"DialogForDeleteConfirmation",props:{showConfirmation:{type:Boolean},purpose:{},context:{}},emits:["close","clicked-delete"],setup(Tr,{emit:Cr}){const $r=Cr,Ar=Tr,{showConfirmation:Rr,purpose:Dr,context:Mr}=toRefs$1(Ar),Br=useFolderStore(),Nr=computed(()=>({deleteFolder:{title:Mr.value.folderId?`Delete ${Br.title(Mr.value.folderId)}`:"Delete folder",description:Mr.value.folderId?`Are you sure you want to delete ${Br.title(Mr.value.folderId)}?`:"Are you sure you want to delete this folder?",confirmText:"Delete",cancelText:"Cancel"},removeMember:{title:"Remove member",description:"Are you sure you want to remove this member?",confirmText:"Remove",cancelText:"Cancel"}})),Lr=computed(()=>Nr.value[Dr.value].title),Hr=computed(()=>Nr.value[Dr.value].description),zr=computed(()=>Nr.value[Dr.value].confirmText),Ur=computed(()=>Nr.value[Dr.value].cancelText),Vr=()=>{$r("close")},jr=()=>{$r("clicked-delete",Mr.value),Vr()};return(Gr,Xr)=>(openBlock(),createBlock(unref(Se),{appear:"",show:unref(Rr),as:"template",class:"dialog"},{default:withCtx(()=>[createVNode(unref(je),{as:"div",style:{position:"fixed",inset:0,zIndex:10}},{default:withCtx(()=>[createVNode(unref(he),{as:"template",enter:"duration-300 ease-out","enter-from":"opacity-0","enter-to":"opacity-100"},{default:withCtx(()=>[createBaseVNode("div",{class:"w-full h-full frosted-glass",onClick:Vr})]),_:1}),createVNode(unref(he),{as:"template",enter:"duration-300 ease-out","enter-from":"translate-btm","enter-to":"translate-top",leave:"duration-200 ease-in","leave-from":"opacity-100 scale-100","leave-to":"opacity-0 scale-95",id:"dialog-btn",ref:"dialogPanelRef"},{default:withCtx(()=>[createVNode(unref(_e),{class:"absolute left-1/2 top-1/2 translate-y-[-50%] translate-x-[-50%]"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$M,[createBaseVNode("label",_hoisted_2$C,toDisplayString(Lr.value),1),createBaseVNode("label",_hoisted_3$t,toDisplayString(Hr.value),1),createBaseVNode("div",_hoisted_4$p,[createVNode(Button,{style:{height:"48px",width:"100%",borderRadius:"16px",padding:0,flex:1},purpose:"outline",selectedBackgroundOverride:"transparent","background-override":"#f3f3f3","hover-background-override":"#00000014","active-background-override":"#00000014",onClick:Vr},{content:withCtx(({titleStyle:Kr})=>[createBaseVNode("div",{style:normalizeStyle({...Kr,fontSize:"16px"})},toDisplayString(Ur.value),5)]),_:1}),createVNode(Button,{style:{height:"48px",width:"100%",borderRadius:"16px",padding:0,flex:1,color:"white"},purpose:"outline","background-override":"#DB3033","hover-background-override":"#CE1F22","active-background-override":"#CE1F22",selectedBackgroundOverride:"transparent",onClick:jr},{content:withCtx(({titleStyle:Kr})=>[createBaseVNode("div",{style:normalizeStyle({...Kr,fontSize:"16px"})},toDisplayString(zr.value),5)]),_:1})])])]),_:1})]),_:1},512)]),_:1})]),_:1},8,["show"]))}}),DialogForDeleteConfirmation_vue_vue_type_style_index_0_lang="",_withScopeId$5=Tr=>(pushScopeId("data-v-4d3b3a4f"),Tr=Tr(),popScopeId(),Tr),_hoisted_1$L={class:"flex flex-col w-full"},_hoisted_2$B={class:"flex items-center justify-center gap-[2px] cursor-pointer"},_hoisted_3$s={key:0,class:"flex flex-col w-full"},_hoisted_4$o=_withScopeId$5(()=>createBaseVNode("div",null,toDisplayString("General"),-1)),_hoisted_5$i=[_hoisted_4$o],_hoisted_6$h={key:0,class:"w-[131px]"},_hoisted_7$e=["id","onKeyup","onBlur","onKeydown"],_hoisted_8$9={key:2,class:"h-5 flex items-center absolute right-0"},_hoisted_9$9=_withScopeId$5(()=>createBaseVNode("div",null,"Create folder",-1)),_hoisted_10$8=[_hoisted_9$9],_sfc_main$17=defineComponent({__name:"HomeRootFolderWrapper",props:{rootId:{},isDarkBtn:{type:Boolean,default:!1},showFolderIcon:{type:Boolean,default:!0},isMobile:{type:Boolean},isWorkspace:{type:Boolean},canCreateFolders:{type:Boolean,default:!0}},emits:["update-new-projs","folder-clicked","new-deck-click"],setup(Tr,{emit:Cr}){const $r=Tr,Ar=computed(()=>theme.appTheme()),{isMobile:Rr}=toRefs$1($r),Dr=Cr,Mr=useAppStore(),Br=useFolderStore(),Nr=useUserStore();computed(()=>Nr.isProSubscription(Nr.currentOrgId));const Lr=computed(()=>Nr.areUnlimitedDecksAllowed(Nr.currentOrgId)),Hr=computed(()=>Mr.restrictDeckCreation&&!Lr.value),zr=computed(()=>Br.currentFolderId),Ur=computed(()=>isEnabled("createFolders")&&$r.canCreateFolders&&!Rr.value),Vr=computed(()=>Br.folderObject($r.rootId)),jr=computed(()=>Vr.value.id===Br.sharedFolderId),Gr=computed(()=>Vr.value.access_level==="private");computed(()=>Vr.value.access_level==="workspace");const Xr=computed(()=>{let Ro="#868585";return zr.value===$r.rootId&&jr.value?Ro="#0D0C0C":jr.value&&(Ro="#565555"),{fontSize:jr.value&&Rr.value?"16px":"14px",fontWeight:500,color:Ro}}),Kr=computed(()=>{let Ro="2px";jr.value?Ro="12px":Rr.value&&(Ro="5px");let Ao;return jr.value&&(Rr.value?Ao="48px":Ao="34px"),{height:Ao,width:jr.value?"100%":"fit-content",paddingLeft:"8px",borderRadius:"8px",paddingTop:Ro,paddingBottom:Ro}}),Zr=computed(()=>Rr.value?24:16),eo=(Ro,Ao="updated_at",zo=!0)=>Ro.sort((Bo,bo)=>Date.parse(Bo[Ao])Date.parse(bo[Ao])?zo?-1:1:0),Wr=computed(()=>[...eo(Br.childFolders($r.rootId),"created_at",!1)]),Yr=computed(()=>{let Ro=[{id:"newDeck",name:`New ${WORD_MAP.deck.upper}`,icon:"icon-add-16.svg"},{id:"rename",name:"Rename",icon:"icon-edit.svg"},{id:"delete",name:"Delete",icon:"icon-trash-16px-1.svg"}];return Hr.value&&(Ro=Ro.filter(Ao=>Ao.id!=="newDeck")),Ro}),Jr=computed(()=>$r.isWorkspace?"icon-briefcase.svg":Vr.value.id===Br.sharedFolderId?SHARED_FOLDER_ICON:"icon-lock.svg"),no=computed(()=>Rr.value?"icon-projects-2-mobile.svg":"icon-projects-2.svg"),ro=inject("headlessTracker"),so=ref(null),ao=ref(!1),lo=ref(null),po=ref("");watch(ro,Ro=>{Ro||(so.value=null)});const go=async Ro=>{Dr("folder-clicked",Ro)},co=async(Ro=$r.rootId)=>{const Ao=await Br.createFolder({parent_id:Ro,saveInDatabase:!0});if(Ao==null)return;Br.setCurrentFolderId(Ao),await nextTick(),po.value=Br.title(Ao)??"",lo.value=Ao,ao.value=!0,await nextTick();const zo=document.getElementById(`folder-${Ao}-title`);zo&&zo.focus()};watch(zr,()=>{if(zr.value!=null&&zr.value!=="undefined"&&Ur.value){const Ro=`${window.location.pathname}#${zr.value}`;Ro!=="undefined"&&Ro!=null&&window.history.replaceState({},"",Ro)}});const mo=(Ro,Ao)=>{Br.updateProps(Ro,{keyPath:["title"],value:Ao===""?"Untitled":Ao}),ao.value=!1},io=(Ro,Ao)=>{Br.updateProps(Ro,{keyPath:["metadata","icon"],value:Ao})},uo=ref(!1),ho=ref(0),yo=ref(0),So=(Ro,Ao)=>{so.value=Ao,uo.value=!0,yo.value=Ro.clientX,ho.value=Ro.clientY},ko=ref(!1),$o=ref(null),Go=({folderId:Ro})=>{Ro!=null&&(Br.deleteFolder(Ro),Br.setCurrentFolderId($r.rootId),ko.value=!1,$o.value=null)},No=async(Ro,Ao)=>{if(uo.value=!1,so.value=null,Ro!=null){if(Ao==="delete"){$o.value=Ro,ko.value=!0;return}if(Ao==="newDeck"){Dr("new-deck-click");return}if(Ao==="copyLink"&&navigator.clipboard.writeText(window.location.href),Ao==="rename"){po.value=Br.title(Ro)??"",lo.value=Ro,ao.value=!0,await nextTick();const zo=document.getElementById(`folder-${Ro}-title`);zo&&zo.focus()}}},Eo=ref(!0),Mo=()=>{if(jr.value){go(Vr.value.id);return}Eo.value=!Eo.value};return(Ro,Ao)=>{const zo=resolveDirective("tooltip");return openBlock(),createElementBlock("div",_hoisted_1$L,[withDirectives(createVNode(Button,{alignment:"flex-start",style:normalizeStyle({...Kr.value}),backgroundOverride:zr.value===Ro.rootId&&jr.value?"rgba(0, 0, 0, 0.08)":void 0,hoverBackgroundOverride:"rgba(0, 0, 0, 0.04)",activeBackgroundOverride:"rgba(0, 0, 0, 0.08)",onClick:Ao[0]||(Ao[0]=withModifiers(Oo=>Mo(),["stop"]))},createSlots({content:withCtx(({textStyle:Oo,hovering:Bo})=>[createBaseVNode("div",_hoisted_2$B,[createBaseVNode("div",{style:normalizeStyle({...Oo,...Xr.value}),class:"custom-truncate"},[createBaseVNode("div",null,toDisplayString(Vr.value.title),1)],4),Bo&&!jr.value?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)(Eo.value?"icon-chevron-down-3.svg":"icon-chevron-right-3.svg"),vProps:{width:14,height:14,nestedFill:"#868585"},class:"cursor-pointer"},null,8,["src"])):createCommentVNode("",!0)])]),_:2},[Ro.showFolderIcon?{name:"left",fn:withCtx(()=>[createVNode(_sfc_main$1v,{src:unref(assetUrl)(Jr.value),vProps:{stroke:Xr.value.color,width:Zr.value,height:Zr.value}},null,8,["src","vProps"])]),key:"0"}:void 0]),1032,["style","backgroundOverride"]),[[zo,{content:unref(Br).rootFolderTooltip(Vr.value.access_level),placement:jr.value?"right":"top-start"}]]),Eo.value?(openBlock(),createElementBlock("div",_hoisted_3$s,[jr.value?createCommentVNode("",!0):(openBlock(),createBlock(Button,{key:0,alignment:"flex-start",style:normalizeStyle({height:unref(Rr)?"48px":"34px",padding:unref(Rr)?"12px 8px":"8px",borderRadius:"8px",color:"#868585"}),purpose:"normal",backgroundOverride:zr.value===Ro.rootId?"rgba(0, 0, 0, 0.08)":void 0,hoverBackgroundOverride:"rgba(0, 0, 0, 0.04)",activeBackgroundOverride:"rgba(0, 0, 0, 0.08)",onClick:Ao[1]||(Ao[1]=Oo=>go(Ro.rootId))},{left:withCtx(()=>[createVNode(_sfc_main$1v,{src:unref(assetUrl)(unref(Rr)&&Gr.value?"icon-general-folder-private.svg":"icon-general-folder-2.svg"),vProps:{width:Zr.value,height:Zr.value}},null,8,["src","vProps"])]),content:withCtx(({textStyle:Oo})=>[createBaseVNode("div",{style:normalizeStyle({...Oo,color:zr.value===Ro.rootId?"#0D0C0C":"#565555",fontSize:unref(Rr)?"16px":"14px",fontWeight:500}),class:"custom-truncate"},_hoisted_5$i,4)]),_:1},8,["style","backgroundOverride"])),(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Wr.value,Oo=>(openBlock(),createBlock(Button,{key:Oo.id,alignment:"flex-start",style:normalizeStyle({height:unref(Rr)?"48px":"34px",padding:unref(Rr)?"12px 8px":"8px",borderRadius:"8px"}),purpose:"normal","background-override":zr.value===Oo.id?"rgba(0, 0, 0, 0.08)":so.value===Oo.id?"rgba(0, 0, 0, 0.04)":void 0,hoverBackgroundOverride:"rgba(0, 0, 0, 0.04)",activeBackgroundOverride:"rgba(0, 0, 0, 0.08)",onClick:Bo=>go(Oo.id),onContextmenu:withModifiers(Bo=>So(Bo,Oo.id),["prevent"])},{left:withCtx(()=>{var Bo,bo,vo,Io,To,Co,Po;return[unref(Rr)?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(["rounded-[4px] bg-transparent hover:bg-[#00000014] flex justify-center items-center",{"w-4 h-4":!unref(Rr),"w-6 h-6":unref(Rr)}])},[createVNode(_sfc_main$1v,{src:((vo=(bo=(Bo=Oo.metadata)==null?void 0:Bo.icon)==null?void 0:bo.item)==null?void 0:vo.value)??unref(assetUrl)(no.value),isFromLibrary:((To=(Io=Oo.metadata)==null?void 0:Io.icon)==null?void 0:To.selectedType)==="icons",isEmoji:((Po=(Co=Oo.metadata)==null?void 0:Co.icon)==null?void 0:Po.selectedType)==="emojis",vProps:{nestedFill:zr.value===Oo.id?"#0D0C0C":"#565555",width:Zr.value,height:Zr.value}},null,8,["src","isFromLibrary","isEmoji","vProps"])],2)):(openBlock(),createBlock(StyledPopOver$1,{key:0,popupOverrideSelector:".popoverOverride",style:normalizeStyle({width:`${Zr.value}px`}),styleProps:{popoverWidth:264,alignLeftEdge:!0,animationDirection:"top",buttonBackground:"transparent",positionOverride:{}}},{button:withCtx(({})=>{var Fo,Vo,Ko,Uo,ei,qo,ri;return[createBaseVNode("div",{class:normalizeClass(["rounded-[4px] bg-transparent hover:bg-[#00000014] flex justify-center items-center",{"w-4 h-4":!unref(Rr),"w-6 h-6":unref(Rr)}])},[createVNode(_sfc_main$1v,{src:((Ko=(Vo=(Fo=Oo.metadata)==null?void 0:Fo.icon)==null?void 0:Vo.item)==null?void 0:Ko.value)??unref(assetUrl)(no.value),isFromLibrary:((ei=(Uo=Oo.metadata)==null?void 0:Uo.icon)==null?void 0:ei.selectedType)==="icons",isEmoji:((ri=(qo=Oo.metadata)==null?void 0:qo.icon)==null?void 0:ri.selectedType)==="emojis",vProps:{nestedFill:zr.value===Oo.id?"#0D0C0C":"#565555",width:Zr.value,height:Zr.value}},null,8,["src","isFromLibrary","isEmoji","vProps"])],2)]}),content:withCtx(()=>{var Fo,Vo,Ko;return[createVNode(IconPicker,{selectedId:(Ko=(Vo=(Fo=Oo.metadata)==null?void 0:Fo.icon)==null?void 0:Vo.item)==null?void 0:Ko.id,onSelectedItemId:Uo=>io(Oo.id,Uo),open:!0},null,8,["selectedId","onSelectedItemId"])]}),_:2},1032,["popupOverrideSelector","style"]))]}),content:withCtx(Bo=>[createBaseVNode("div",{class:normalizeClass(["flex items-center space-between flex-1 relative",{"max-w-[calc(100%-32px)]":unref(Rr)}])},[ao.value&&lo.value===Oo.id&&!unref(Rr)?(openBlock(),createElementBlock("div",_hoisted_6$h,[withDirectives(createBaseVNode("input",{"onUpdate:modelValue":Ao[2]||(Ao[2]=bo=>po.value=bo),class:"text-[14px] border-none flex-1",style:normalizeStyle({background:"transparent",...Bo.textStyle}),spellcheck:!1,placeholder:"Enter a title",id:`folder-${Oo.id}-title`,onKeyup:withKeys(bo=>mo(Oo.id,po.value),["enter"]),onBlur:bo=>mo(Oo.id,po.value),onKeydown:withKeys(bo=>mo(Oo.id,po.value),["esc"])},null,44,_hoisted_7$e),[[vModelText,po.value]])])):(openBlock(),createElementBlock("label",{key:1,class:normalizeClass(["truncate font-[500] cursor-pointer",{"w-[155px]":!Bo.hovering,"w-[131px]":Bo.hovering,"w-full":unref(Rr),"text-[#0D0C0C]":zr.value===Oo.id,"text-[#565555]":zr.value!==Oo.id,"text-[14px]":!unref(Rr),"text-[16px]":unref(Rr)}])},toDisplayString(Oo.title),3)),!ao.value&&!unref(Rr)?(openBlock(),createElementBlock("div",_hoisted_8$9,[withDirectives(createVNode(StyledMoreMenu,{onSelectedItemId:bo=>No(Oo.id,bo),items:Yr.value,"fallback-button-props":{style:{backgroundColor:"transparent",padding:"0 4px"},hoverStyle:{backgroundColor:Ar.value.palette.neutral[100]}},onClick:withModifiers(bo=>so.value=Oo.id,["stop"]),onClose:Ao[3]||(Ao[3]=bo=>so.value=null)},{button:withCtx(({open:bo})=>[createVNode(BaseButton,{icon:{url:unref(assetUrl)("icon-more.svg"),vProps:{width:20,height:20}},width:"20px",height:"20px",id:`${Oo.id}-more-menu-${bo?"open":"close"}`,style:normalizeStyle({visibility:unref(Rr)||Bo.hovering?"visible":"hidden"})},null,8,["icon","id","style"])]),_:2},1032,["onSelectedItemId","items","fallback-button-props","onClick"]),[[zo,{content:"Rename, delete, etc.",placement:"right"}]])])):createCommentVNode("",!0)],2)]),_:2},1032,["style","background-override","onClick","onContextmenu"]))),128)),Ur.value&&Lr.value?(openBlock(),createBlock(Button,{key:1,alignment:"flex-start",style:normalizeStyle({height:unref(Rr)?"48px":"34px",padding:"8px",borderRadius:"8px",color:"#868585",fontSize:"14px"}),purpose:"normal",hoverBackgroundOverride:"rgba(0, 0, 0, 0.04)",activeBackgroundOverride:"rgba(0, 0, 0, 0.08)",onClick:Ao[4]||(Ao[4]=Oo=>co())},{left:withCtx(()=>[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-folder-soft-2.svg"),vProps:{width:Zr.value,height:Zr.value}},null,8,["src","vProps"])]),content:withCtx(({textStyle:Oo})=>[createBaseVNode("div",{style:normalizeStyle({...Oo,color:"#868585",fontWeight:500}),class:"custom-truncate"},_hoisted_10$8,4)]),_:1},8,["style"])):createCommentVNode("",!0),unref(Rr)?createCommentVNode("",!0):(openBlock(),createBlock(StyledRightClickMenu,{key:2,items:Yr.value,visible:uo.value,"position-x":yo.value,"position-y":ho.value,onClose:Ao[5]||(Ao[5]=Oo=>uo.value=!1),onSelectedItemId:Ao[6]||(Ao[6]=Oo=>No(so.value,Oo))},null,8,["items","visible","position-x","position-y"])),$o.value&&!unref(Rr)?(openBlock(),createBlock(_sfc_main$18,{key:3,"show-confirmation":ko.value,context:{folderId:$o.value},purpose:"deleteFolder",onClose:Ao[7]||(Ao[7]=Oo=>ko.value=!1),onClickedDelete:Ao[8]||(Ao[8]=Oo=>Go(Oo))},null,8,["show-confirmation","context"])):createCommentVNode("",!0)])):createCommentVNode("",!0)])}}}),HomeRootFolderWrapper_vue_vue_type_style_index_0_scoped_4d3b3a4f_lang="",HomeRootFolderWrapper=_export_sfc(_sfc_main$17,[["__scopeId","data-v-4d3b3a4f"]]),_hoisted_1$K={class:"flex flex-col px-3 gap-3 pb-3"},_sfc_main$16=defineComponent({__name:"HomeFolderList",emits:["close"],setup(Tr,{emit:Cr}){const $r=useFolderStore(),Ar=useUserStore(),Rr=useRouter(),Dr=Cr,Mr=inject("isMobile"),Br=ref(null),Nr=computed(()=>isEnabled("createFolders")),Lr=computed(()=>$r.currentFolderId),Hr=computed(()=>$r.privateSystemFolderId),zr=computed(()=>$r.workspaceSystemFolderId),Ur=computed(()=>$r.sharedFolderId),Vr=computed(()=>Ar.showWorkspaceView);computed(()=>Vr.value?zr.value:Hr.value);const{y:jr}=useScroll(Br),Gr=async Kr=>{if(Kr===Lr.value){Dr("close");return}$r.setCurrentFolderId(Kr),$r.fetchAndHydrateFolderContents(Kr),Dr("close")},Xr=async()=>{const Kr=await createNewDeck();Rr.push({path:`${PATH_FOR_ARTBOARD}${Kr}`})};return(Kr,Zr)=>(openBlock(),createElementBlock("div",{ref_key:"el",ref:Br,class:"flex flex-col max-h-[calc(100dvh-24px)] overflow-auto"},[unref(Mr)?(openBlock(),createBlock(_sfc_main$1p,{key:0,title:"Folders",onTappedClose:Zr[0]||(Zr[0]=eo=>Dr("close")),class:normalizeClass(["sticky top-0 bg-white z-[100]",{"border-b border-neutralSolid-100":unref(jr)>0}])},null,8,["class"])):createCommentVNode("",!0),createBaseVNode("div",_hoisted_1$K,[Nr.value&&Ur.value?(openBlock(),createBlock(HomeRootFolderWrapper,{key:0,rootId:Ur.value,isMobile:unref(Mr),isWorkspace:!1,showFolderIcon:!0,isDarkBtn:!0,canCreateFolders:!unref(Mr),onFolderClicked:Gr},null,8,["rootId","isMobile","canCreateFolders"])):createCommentVNode("",!0),Vr.value&&Nr.value&&zr.value?(openBlock(),createBlock(HomeRootFolderWrapper,{key:1,rootId:zr.value,isMobile:unref(Mr),isWorkspace:!0,showFolderIcon:!1,canCreateFolders:!unref(Mr),onNewDeckClick:Xr,onFolderClicked:Gr},null,8,["rootId","isMobile","canCreateFolders"])):createCommentVNode("",!0),Nr.value&&Hr.value?(openBlock(),createBlock(HomeRootFolderWrapper,{key:2,rootId:Hr.value,isMobile:unref(Mr),isWorkspace:!1,showFolderIcon:!1,canCreateFolders:!unref(Mr),onNewDeckClick:Xr,onFolderClicked:Gr},null,8,["rootId","isMobile","canCreateFolders"])):createCommentVNode("",!0)])],512))}}),_sfc_main$15=defineComponent({__name:"HomeFolderListWrapper",setup(Tr){const Cr=useOverlayStore();inject("isMobile");const $r=computed(()=>Cr.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.FOLDER_LIST)),Ar=()=>{Cr.hideSlideInComponents(SLIDE_IN_COMPONENTS.FOLDER_LIST)};return(Rr,Dr)=>(openBlock(),createBlock(PrezoSlideIn,{show:$r.value,onClose:Ar},{content:withCtx(({})=>[createVNode(_sfc_main$16,{onClose:Ar})]),_:1},8,["show"]))}}),_hoisted_1$J={class:"w-full flex flex-col items-center"},_hoisted_2$A={class:"flex flex-col p-3 pt-0 items-center w-full"},_hoisted_3$r=createBaseVNode("p",{class:"text-base text-neutralSolid-1000 font-medium"},"Publish to web",-1),_hoisted_4$n=createBaseVNode("p",{class:"text-base text-neutralSolid-1000 font-medium"},"Export PDF",-1),_sfc_main$14=defineComponent({__name:"SharingNavigation",setup(Tr){const Cr=useOverlayStore(),$r=inject("isMobile"),Ar=Rr=>{if(Rr==="pdf"){Cr.showSlideInComponent(SLIDE_IN_COMPONENTS.PDF_SETTINGS,{replace:SLIDE_IN_COMPONENTS.SHARING_MENU});return}Rr==="publish"&&Cr.showSlideInComponent(SLIDE_IN_COMPONENTS.PUBLISH_SETTINGS,{replace:SLIDE_IN_COMPONENTS.SHARING_MENU})};return(Rr,Dr)=>(openBlock(),createElementBlock("div",_hoisted_1$J,[unref($r)?(openBlock(),createBlock(_sfc_main$1p,{key:0,title:"Share",onTappedClose:Dr[0]||(Dr[0]=Mr=>Rr.$emit("close")),class:"mb-0"})):createCommentVNode("",!0),createBaseVNode("div",_hoisted_2$A,[createBaseVNode("button",{class:"flex items-center w-full py-3 px-2 gap-2",onClick:Dr[1]||(Dr[1]=Mr=>Ar("publish"))},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-link-24.svg"),vProps:{width:24,height:24}},null,8,["src"]),_hoisted_3$r]),createBaseVNode("button",{class:"flex items-center w-full py-3 px-2 gap-2",onClick:Dr[2]||(Dr[2]=Mr=>Ar("pdf"))},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-pdf-24.svg"),vProps:{width:24,height:24}},null,8,["src"]),_hoisted_4$n])])]))}}),_sfc_main$13=defineComponent({__name:"SharingNavigationWrapper",setup(Tr){const Cr=useOverlayStore();inject("isMobile");const{currentAppId:$r}=inject("currentAppId"),Ar=computed(()=>Cr.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.SHARING_MENU)),Rr=()=>{Cr.hideSlideInComponents(SLIDE_IN_COMPONENTS.SHARING_MENU)};return(Dr,Mr)=>(openBlock(),createBlock(PrezoSlideIn,{show:Ar.value,onClose:Rr},{content:withCtx(({})=>[createVNode(_sfc_main$14,{onClose:Rr,deckId:unref($r),open:Ar.value},null,8,["deckId","open"])]),_:1},8,["show"]))}}),_sfc_main$12=defineComponent({__name:"IconPicker2Wrapper",setup(Tr){const Cr=useOverlayStore(),$r=useAppStore();inject("isMobile");const{currentAppId:Ar}=inject("currentAppId"),Rr=computed(()=>Cr.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.ICON_PICKER)),Dr=()=>{Cr.hideSlideInComponents(SLIDE_IN_COMPONENTS.ICON_PICKER)},Mr=Nr=>{Ar.value&&($r.updateProps(Ar.value,{keyPath:["config","customDeckLogo","value"],value:Nr}),Dr())},Br=Nr=>{var Lr;Ar.value&&($r.updateProps(Ar.value,{keyPath:["config","customDeckLogo","value"],value:(Lr=Nr==null?void 0:Nr.item)==null?void 0:Lr.id}),Dr())};return(Nr,Lr)=>(openBlock(),createBlock(PrezoSlideIn,{show:Rr.value,onClose:Dr},{content:withCtx(({})=>[createVNode(IconPicker,{onClose:Dr,onSelectedImg:Mr,onSelectedItemId:Br,appId:unref(Ar)??void 0,open:Rr.value,showCustomImagePicker:!0},null,8,["appId","open"])]),_:1},8,["show"]))}}),showPDFGeneratingNoti=Tr=>{const Cr=useMiscStore(),$r=useAppStore();Cr.setHomeNotification({noti:{type:"info",text:"Generating PDF",hangTime:6e4,showInProgress:!0},show:!0}),$r.setNotif(Tr,{text:"Generating PDF",showEmoji:!1,persistent:!1,isProminent:!1,showInProgress:!0,showTag:!1,type:"info",hangTime:6e4})},showPDFCompleteNoti=Tr=>{const Cr=useMiscStore(),$r=useAppStore();Cr.setHomeNotification({noti:{type:"info",text:"PDF generated",hangTime:4e3,showInProgress:!1},show:!0}),$r.setNotif(Tr,{text:"PDF generated",showEmoji:!1,persistent:!1,isProminent:!1,showInProgress:!1,showTag:!1,type:"info",hangTime:4e3}),setTimeout(()=>{$r.setNotif(Tr,null),Cr.setHomeNotification({show:!1})},4e3)},showPDFErrorNoti=Tr=>{const Cr=useMiscStore();Cr.setHomeNotification({noti:{type:"error",text:"Error generating PDF",hangTime:4e3,showInProgress:!1},show:!0});const $r=useAppStore();$r.setNotif(Tr,{text:"Error generating PDF",showEmoji:!1,persistent:!1,isProminent:!1,showInProgress:!1,showTag:!1,type:"error",hangTime:4e3}),setTimeout(()=>{$r.setNotif(Tr,null),Cr.setHomeNotification({show:!1})},4e3)},usePDF=()=>{const Tr=useUserStore(),Cr=useAppStore();useMiscStore();const $r=ref(!1),Ar=computed(()=>Tr.isPDFDownloadAllowed(Tr.currentOrgId)),Rr=async Mr=>{const Br=Tr.currentOrgId,Nr=Mr.pdfSettings??Tr.pdfSettings,{deckId:Lr,showNotification:Hr}=Mr,{data:zr,error:Ur}=await queryPdf({deckId:Lr,orgId:Br,footerSettings:Nr,pdfDims:PDF_DIMS}),Vr=Cr.title(Lr);if($r.value=!1,Ur){console.error(Ur),Hr&&showPDFErrorNoti(Lr);return}try{const jr=URL.createObjectURL(zr),Gr=document.createElement("a");Gr.href=jr,Gr.download=`${Vr}.pdf`,Gr.style.visibility="hidden",document.body.appendChild(Gr),Gr.click(),Gr.remove(),URL.revokeObjectURL(jr)}catch(jr){console.error(jr),Hr&&showPDFErrorNoti(Lr);return}Hr&&showPDFCompleteNoti(Lr)};return{initDownload:async Mr=>{const{deckId:Br,showNotification:Nr}=Mr,Lr=Cr.title(Br);try{posthogCapture(`try export ${Ar.value?"pro":"not pro"} from ${Mr.from||"unknown"}`,{appId:Br,title:Cr.title(Br),current_time:new Date().getTime(),created_at:new Date(Cr.createdAt(Br)||Date.now()).getTime(),time_diff:new Date().getTime()-new Date(Cr.createdAt(Br)||Date.now()).getTime(),deckTitle:Lr,isPro:Ar.value,pdfSettings:Mr.pdfSettings})}catch(Ur){console.error(Ur)}if(!Ar.value)return!1;try{posthogCapture("pdf export",{appId:Br,title:Cr.title(Br),current_time:new Date().getTime(),created_at:new Date(Cr.createdAt(Br)||Date.now()).getTime(),time_diff:new Date().getTime()-new Date(Cr.createdAt(Br)||Date.now()).getTime(),deckTitle:Lr,isPro:Ar.value,pdfSettings:Mr.pdfSettings,subdomain:Tr.getOrgSubdomain(Tr.currentOrgId)})}catch(Ur){console.error(Ur)}Nr&&showPDFGeneratingNoti(Br),$r.value=!0;const Hr=Tr.getOrgAvatarUrl(Tr.currentOrgId);let zr;zr="https://nucgnbhmmqgwgmivzcrz.supabase.co";try{if(Hr!==""&&!Hr.startsWith(zr)&&Tr.currentOrgId){const{data:Ur,error:Vr}=await querySaveImg({url:Hr,type:"logo"});Vr?console.error(Vr):Tr.updateOrg({orgId:Tr.currentOrgId,avatar_url:Ur.url})}}catch(Ur){console.error(Ur)}return Rr(Mr),!0},generatingPdf:$r}};function useElementBounding(Tr,Cr={}){const{reset:$r=!0,windowResize:Ar=!0,windowScroll:Rr=!0,immediate:Dr=!0}=Cr,Mr=ref(0),Br=ref(0),Nr=ref(0),Lr=ref(0),Hr=ref(0),zr=ref(0),Ur=ref(0),Vr=ref(0);function jr(){const Gr=unrefElement(Tr);if(!Gr){$r&&(Mr.value=0,Br.value=0,Nr.value=0,Lr.value=0,Hr.value=0,zr.value=0,Ur.value=0,Vr.value=0);return}const Xr=Gr.getBoundingClientRect();Mr.value=Xr.height,Br.value=Xr.bottom,Nr.value=Xr.left,Lr.value=Xr.right,Hr.value=Xr.top,zr.value=Xr.width,Ur.value=Xr.x,Vr.value=Xr.y}return useResizeObserver(Tr,jr),watch(()=>unrefElement(Tr),Gr=>!Gr&&jr()),Rr&&useEventListener("scroll",jr,{capture:!0,passive:!0}),Ar&&useEventListener("resize",jr,{passive:!0}),useEventListener(Tr,"transitionend",jr,{passive:!0}),useEventListener(Tr,"animationend",jr,{passive:!0}),tryOnMounted(()=>{Dr&&jr()}),{height:Mr,bottom:Br,left:Nr,right:Lr,top:Hr,width:zr,x:Ur,y:Vr,update:jr}}function useDropZone(Tr,Cr){const $r=ref(!1);let Ar=0;const Rr=ref(0),Dr=ref(0);return isClient&&(useEventListener(Tr,"dragenter",Mr=>{Mr.preventDefault(),Ar+=1,$r.value=!0}),useEventListener(Tr,"dragover",Mr=>{Mr.preventDefault()}),useEventListener(Tr,"dragleave",Mr=>{Mr.preventDefault(),Ar-=1,Ar===0&&($r.value=!1)}),useEventListener(Tr,"drop",Mr=>{var Lr;Mr.preventDefault(),Ar=0,$r.value=!1;const Br=Array.from(((Lr=Mr.dataTransfer)==null?void 0:Lr.files)??[]),Nr=useElementBounding$1(Tr);Rr.value=Mr.x-Nr.x.value,Dr.value=Mr.y-Nr.y.value,Cr==null||Cr(Br.length===0?null:Br,{dropX:Rr,dropY:Dr})})),{isOverDropZone:$r}}const VERTICAL_EDGE_CUTOFF=120,SCROLL_SPEED_MAX=150,SCROLL_SPEED_MIN=10,SCROLL_INTERVAL=20,useElScroll=({update:Tr})=>{const Cr=ref(null),$r=ref(0),Ar=Nr=>{const Lr=Math.min(Math.abs(Nr.clientY),Math.abs(Nr.clientY-window.innerHeight)),Hr=Math.max(1-Lr/VERTICAL_EDGE_CUTOFF,0);return Math.round(Hr*(SCROLL_SPEED_MAX-SCROLL_SPEED_MIN)+SCROLL_SPEED_MIN)};function Rr(Nr){const Lr=document.getElementById("editorWrapper");Lr&&(Lr.scrollTop+=Nr,Tr())}const Dr=()=>{Cr.value!==null&&clearInterval(Cr.value),Cr.value=setInterval(()=>{Rr($r.value)},SCROLL_INTERVAL)},Mr=()=>{Cr.value!=null&&(clearInterval(Cr.value),Cr.value=null,$r.value=0)};return{calculateScrollSpeed:Ar,startScrolling:Dr,stopScrolling:Mr,scrollElIfNeeded:Nr=>{if(window)if(Nr.clientYwindow.innerHeight-VERTICAL_EDGE_CUTOFF){const Lr=Nr.clientY{if(Tr==null)return{x:0,y:0,width:0,height:0};if(basicFlexLogic.isGroup(Tr)){const Br=Cr[Tr];if(!Br)return{x:0,y:0,width:0,height:0};const{items:Nr,direction:Lr,spacing:Hr}=Br,zr=basicFlexLogic.isRootGroup({groupId:Tr,ITEM_MAP:Cr});let Ur=0;Hr&&(Ur=Hr.padding||0,Hr.gap);let Vr={x:0,y:0,width:0,height:0};if(Lr==="row"){const jr=Nr[0],Gr=Nr[Nr.length-1],Xr=getLocalPositionForItem$1({id:jr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar}),Kr=getLocalPositionForItem$1({id:Gr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar});return Vr={x:zr?0:Xr.x-Ur,y:zr?0:Xr.y-Ur,width:zr?960:Kr.x+Kr.width-Xr.x+2*Ur,height:Xr.height+2*Ur},Vr}if(Lr==="column"){const jr=Nr[0],Gr=Nr[Nr.length-1],Xr=getLocalPositionForItem$1({id:jr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar}),Kr=getLocalPositionForItem$1({id:Gr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar});return Vr={x:Xr.x-Ur,y:Xr.y-Ur,width:Xr.width+2*Ur,height:Kr.y+Kr.height-Xr.y+2*Ur},Vr}return Vr}const Rr=Ar.indexOf(Tr);if(Rr<0)return{x:0,y:0,width:0,height:0};const Dr=$r[Rr];return Dr?Dr.positionObject:{x:0,y:0,width:0,height:0}},updateLocalYPositionForItem=({id:Tr,newY:Cr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr})=>{if(basicFlexLogic.isGroup(Tr)){if($r[Tr]==null)return;const{items:Br,direction:Nr}=$r[Tr],Lr=$r[Tr].spacing??{padding:0,gap:0},Hr=(Lr==null?void 0:Lr.padding)??0,zr=(Lr==null?void 0:Lr.gap)??0;if(Nr==="row"){Br.forEach((Ur,Vr)=>{const Gr={...basicFlexLogic.getPositionObjectForItem({id:Ur,ITEM_MAP:$r,redoRootGroupCalc:!0}),y:basicFlexLogic.roundValue(Cr+Hr)};updateLocalYPositionForItem({id:Ur,newY:Gr.y,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr})});return}if(Nr==="column"){let Ur=Cr+Hr;Br.forEach((Vr,jr)=>{const Gr=getLocalPositionForItem$1({id:Vr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr}),Xr={...Gr,y:basicFlexLogic.roundValue(Ur)};updateLocalYPositionForItem({id:Vr,newY:Xr.y,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr}),Ur+=Gr.height+zr})}return}const Mr=Rr.indexOf(Tr);Mr<0||Ar[Mr]!=null&&Ar[Mr].updatePositionObject({...getLocalPositionForItem$1({id:Tr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr}),y:basicFlexLogic.roundValue(Cr)})},updateLocalPositionForItem$1=({id:Tr,newPosition:Cr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr,dimensionChanged:Dr})=>{if(basicFlexLogic.isGroup(Tr)){if($r[Tr]==null)return;const{items:Nr,direction:Lr}=$r[Tr],Hr=$r[Tr].spacing??{padding:0,gap:0},zr=(Hr==null?void 0:Hr.padding)??0,Ur=(Hr==null?void 0:Hr.gap)??0,Vr=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Tr,ITEM_MAP:$r,redoRootGroupCalc:!0}));if(Dr==="width"&&Lr==="row"){const jr=Vr.width-2*zr-(Nr.length-1)*Ur,Xr=(Cr.width-2*zr-(Nr.length-1)*Ur)/jr,Kr=Nr.reduce((Wr,Yr)=>Math.max(Wr,basicFlexLogic.getMinHeightForItem({id:Yr,ITEM_MAP:$r})),0),Zr=Math.max(Cr.height-2*zr,Kr);let eo=Cr.x+zr;Nr.forEach((Wr,Yr)=>{const Jr=basicFlexLogic.getPositionObjectForItem({id:Wr,ITEM_MAP:$r,redoRootGroupCalc:!0}),no={...Jr,x:basicFlexLogic.roundValue(eo),width:basicFlexLogic.roundValue(Jr.width*Xr),y:basicFlexLogic.roundValue(Cr.y+zr),height:basicFlexLogic.roundValue(Zr)};updateLocalPositionForItem$1({id:Wr,newPosition:no,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr,dimensionChanged:Dr}),eo+=no.width+Ur});return}if(Dr==="width"&&Lr==="column"){let jr=Cr.y+zr;const Gr=Nr.map((Wr,Yr)=>basicFlexLogic.getMinHeightForItem({id:Wr,ITEM_MAP:$r})),Xr=Wr=>Wr.reduce((Yr,Jr)=>Yr+Jr,0),Kr=Xr(Gr);if(Cr.height-2*zr-(Nr.length-1)*Ur-Kr<-.1)return;Xr(Nr.map((Wr,Yr)=>basicFlexLogic.getPositionObjectForItem({id:Wr,ITEM_MAP:$r}).height)),Xr(Nr.map((Wr,Yr)=>getLocalPositionForItem$1({id:Wr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr}).height)),Nr.forEach((Wr,Yr)=>{const Jr=getLocalPositionForItem$1({id:Wr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr}),no=basicFlexLogic.roundValue(Math.max(Jr.height,basicFlexLogic.getMinHeightForItem({id:Wr,ITEM_MAP:$r}))),ro={...Jr,x:basicFlexLogic.roundValue(Cr.x+zr),width:basicFlexLogic.roundValue(Cr.width-2*zr),y:jr,height:no};updateLocalPositionForItem$1({id:Wr,newPosition:ro,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr,dimensionChanged:Dr}),jr+=no+Ur});return}if(Dr==="height"&&Lr==="row"){const jr=Cr.height-2*zr,Gr=Nr.reduce((Kr,Zr)=>Math.max(Kr,basicFlexLogic.getMinHeightForItem({id:Zr,ITEM_MAP:$r})),0),Xr=Math.max(jr,Gr);Nr.forEach((Kr,Zr)=>{const Wr={...basicFlexLogic.getPositionObjectForItem({id:Kr,ITEM_MAP:$r,redoRootGroupCalc:!0}),y:basicFlexLogic.roundValue(Cr.y+zr),height:basicFlexLogic.roundValue(Xr)};updateLocalPositionForItem$1({id:Kr,newPosition:Wr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr,dimensionChanged:Dr})});return}if(Dr==="height"&&Lr==="column"){const jr=Cr.height-2*zr-(Nr.length-1)*Ur,Gr=Nr.map((ro,so)=>basicFlexLogic.getMinHeightForItem({id:ro,ITEM_MAP:$r})),Xr=ro=>ro.reduce((so,ao)=>so+ao,0),Kr=Xr(Gr),Zr=basicFlexLogic.closeBy(Cr.y,Vr.y);if(jr-Kr<-.1)return;const Wr=Xr(Nr.map((ro,so)=>getLocalPositionForItem$1({id:ro,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr}).height));if(basicFlexLogic.closeBy(jr,Wr)&&Zr)return;const Yr=Nr.map((ro,so)=>getLocalPositionForItem$1({id:ro,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr}).height);let Jr=basicFlexLogic.roundValue(jr-Wr);for(let ro=Nr.length-1;ro>=0;ro-=1){const so=Nr[ro],ao=basicFlexLogic.getMinHeightForItem({id:so,ITEM_MAP:$r});let lo=Yr[ro];if(Jr!==0){const po=basicFlexLogic.roundValue(Math.max(ao,lo+Jr));Jr-=basicFlexLogic.roundValue(po-lo),lo=po,Yr[ro]=po}}let no=Cr.y+zr;Nr.forEach((ro,so)=>{const ao=basicFlexLogic.getPositionObjectForItem({id:ro,ITEM_MAP:$r,redoRootGroupCalc:!0}),lo=basicFlexLogic.roundValue(Yr[so]),po={...ao,y:basicFlexLogic.roundValue(no),height:lo,x:basicFlexLogic.roundValue(Cr.x+zr),width:basicFlexLogic.roundValue(Cr.width-2*zr)};updateLocalPositionForItem$1({id:ro,newPosition:po,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr,dimensionChanged:Dr}),no+=lo+Ur});return}return}const Br=Rr.indexOf(Tr);Br<0||Ar[Br]!=null&&Ar[Br].updatePositionObject({...Cr,width:basicFlexLogic.roundValue(Cr.width),height:basicFlexLogic.roundValue(Cr.height),x:basicFlexLogic.roundValue(Cr.x),y:basicFlexLogic.roundValue(Cr.y)})},savePositionForItem$1=({id:Tr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar})=>{var Mr;if(basicFlexLogic.isGroup(Tr)){(((Mr=Cr[Tr])==null?void 0:Mr.items)||[]).forEach(Nr=>{savePositionForItem$1({id:Nr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar})});return}const Dr=Ar.indexOf(Tr);Dr<0||$r[Dr]!=null&&$r[Dr].savePosition({action:"resize",fromOutside:!0})},changeHeightOfItem=({itemId:Tr,slideId:Cr,itemRefs:$r,proposedHeight:Ar,skipUpdatingItem:Rr,itemPositionOG:Dr,save:Mr=!1})=>{var Jr,no;const Br=useBlockStore(),Nr=usePageStore(),Lr=Cr??Br.parentId(Tr);if(!Lr)return;const zr=useItemStore().data[Lr];if(!zr[Tr])return;const Vr=basicFlexLogic.getParentGroupId({itemId:Tr,slideId:Lr});if(!Vr)return;const jr=lodashExports.cloneDeep(Nr.children(Lr)).reverse(),Gr=lodashExports.cloneDeep(zr[Vr]),Xr=(Gr.items??[]).indexOf(Tr);if(Xr<0)return;const Kr=Gr.direction;if(!Kr)return;const Zr=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Vr,ITEM_MAP:zr,redoRootGroupCalc:!0})),eo=Gr.spacing??{padding:0,gap:0},Wr=(eo==null?void 0:eo.padding)??0,Yr=(eo==null?void 0:eo.gap)??0;if(Kr==="row"){const ro=Dr??lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Tr,ITEM_MAP:zr,redoRootGroupCalc:!0}));let so=Ar,ao=0;Gr.items.forEach(po=>{const go=basicFlexLogic.getMinHeightForItem({id:po,ITEM_MAP:zr});ao=Math.max(ao,go)}),ao>Ar&&(so=ao),log("resizeall abc",{itemId:Tr,proposedHeight:Ar,renderedHeightToUse:so,maxOfMinItemHeights:ao,itemPositionOGToUse:ro,groupCurrentPosition:Zr,group:Gr,newEffH:so+2*(((Jr=Gr.spacing)==null?void 0:Jr.padding)??0)});const lo={...ro,height:so};Rr||(updateLocalPositionForItem$1({id:Tr,newPosition:lo,ITEM_MAP:zr,itemRefs:$r,allBlocks:jr,dimensionChanged:"height"}),Mr&&savePositionForItem$1({id:Tr,ITEM_MAP:zr,itemRefs:$r,allBlocks:jr})),Gr.items.filter(po=>po!==Tr).forEach(po=>{const go=lodashExports.cloneDeep(getLocalPositionForItem$1({id:po,ITEM_MAP:zr,itemRefs:$r,allBlocks:jr}));if(go.height===so)return;const co={...go,height:so};updateLocalPositionForItem$1({id:po,newPosition:co,ITEM_MAP:zr,itemRefs:$r,allBlocks:jr,dimensionChanged:"height"}),Mr&&savePositionForItem$1({id:po,ITEM_MAP:zr,itemRefs:$r,allBlocks:jr})}),changeHeightOfItem({itemId:Vr,itemRefs:$r,proposedHeight:so+2*(((no=Gr.spacing)==null?void 0:no.padding)??0),itemPositionOG:Zr,skipUpdatingItem:!0,slideId:Lr,save:Mr});return}if(Kr==="column"){const ro=Dr??lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Tr,ITEM_MAP:zr,redoRootGroupCalc:!0})),so={...ro,height:Ar};Rr||(updateLocalPositionForItem$1({id:Tr,newPosition:so,ITEM_MAP:zr,itemRefs:$r,allBlocks:jr,dimensionChanged:"height"}),Mr&&savePositionForItem$1({id:Tr,ITEM_MAP:zr,itemRefs:$r,allBlocks:jr}));let lo=basicFlexLogic.roundValue(Ar-ro.height),po=Zr.y+Wr;Gr.items.slice(0,Xr).forEach(go=>{po+=basicFlexLogic.getPositionObjectForItem({id:go,ITEM_MAP:zr}).height+Yr}),po+=Ar+Yr,Gr.items.slice(Xr+1).forEach(go=>{const co=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:go,ITEM_MAP:zr,redoRootGroupCalc:!0})),mo=basicFlexLogic.getMinHeightForItem({id:go,ITEM_MAP:zr});let io=co.height;if(lo!==0){const ho=Math.max(mo,io-lo);lo-=io-ho,io=ho}const uo={...co,y:po,height:io};updateLocalPositionForItem$1({id:go,newPosition:uo,ITEM_MAP:zr,itemRefs:$r,allBlocks:jr,dimensionChanged:"height"}),Mr&&savePositionForItem$1({id:go,ITEM_MAP:zr,itemRefs:$r,allBlocks:jr}),po+=uo.height+Yr}),log("resizeall pqr",{changeHeightOfItem,itemId:Tr,proposedHeight:Ar,itemPositionOGToUse:ro,groupCurrentPosition:Zr,group:Gr,newEffH:po-Zr.y+Wr-Yr}),changeHeightOfItem({itemId:Vr,itemRefs:$r,proposedHeight:po-Zr.y+Wr-Yr,itemPositionOG:Zr,skipUpdatingItem:!0,slideId:Lr,save:Mr})}},changeHeightOfItemWrapper=({itemId:Tr,slideId:Cr,itemRefs:$r,proposedHeight:Ar,skipUpdatingItem:Rr=!1,itemPositionOG:Dr,save:Mr=!1})=>{const Br=usePageStore(),Nr=useBlockStore(),Lr=useArtboardStore(),Hr=Cr??Nr.parentId(Tr);if(!Hr)return;Lr.setBlockPositionChangeInProgress(!0);const zr=lodashExports.cloneDeep(Nr.getAffectedBlocks(Br.children(Hr))),Ur=lodashExports.cloneDeep(Br.pageObject(Hr));changeHeightOfItem({itemId:Tr,slideId:Hr,itemRefs:$r,proposedHeight:Ar,skipUpdatingItem:Rr,itemPositionOG:Dr,save:Mr}),Lr.setBlockPositionChangeInProgress(!1),Mr&&Br.pushGroupStateToDB({slideId:Hr,originalBlocks:zr,originalSlide:Ur})},fixSlideIfRequired=async({slideId:Tr,itemRefs:Cr,saveToDb:$r=!0,onLoad:Ar=!1})=>{const Rr=usePageStore(),Dr=useBlockStore(),Mr=useItemStore(),Br=useArtboardStore(),Nr=Mr.data[Tr];if(!Rr.pageObject(Tr).id)return;const Hr=Rr.children(Tr),zr=Gr=>{var Xr;return((Xr=Dr.blockObject(Gr))==null?void 0:Xr.id)!=null&&basicFlexLogic.getMinHeightForItem({id:Gr,ITEM_MAP:Nr})>basicFlexLogic.getPositionObjectForItem({id:Gr,ITEM_MAP:Nr}).height},Ur=[];for(let Gr=0;GrGr.id==null)&&publishLog({channel:"custom-debugging",event:"empty-blocks-when-fixing-slide",description:`Empty blocks when fixing slide: ${JSON.stringify(Vr)}, ${JSON.stringify(jr)}`,notify:!1}),$r&&Rr.pushGroupStateToDB({slideId:Tr,originalBlocks:Vr,originalSlide:jr})},groupResizerLogic={fixSlideIfRequired,updateLocalPositionForItem:updateLocalPositionForItem$1,updateLocalYPositionForItem,getLocalPositionForItem:getLocalPositionForItem$1,savePositionForItem:savePositionForItem$1,RESIZER_PADDING:RESIZER_PADDING$1,RESIZER_SNAP_DISTANCE:RESIZER_SNAP_DISTANCE$1,RESIZER_THICKNESS:RESIZER_THICKNESS$1,MIN_RESIER_HEIGHT_WIDTH:MIN_RESIER_HEIGHT_WIDTH$1,changeHeightOfItem,changeHeightOfItemWrapper},useBlockResizer=Tr=>{const Cr=useArtboardStore(),$r=useEditorStore(),Ar=useMiscStore();usePageStore();const{isReadOnly:Rr,isPreview:Dr,scale:Mr,pageId:Br,ITEM_MAP:Nr,itemRefs:Lr,allBlocks:Hr,editingBlockId:zr,isDragging:Ur,deepInnerParentEl:Vr,deepInnerParentElBoundingRect:jr,isSlideBeingAnimated:Gr}=Tr,Xr=computed(()=>Ar.getIsSlideInTransition),Kr=computed(()=>Cr.getBlockResizerId),Zr=ref(0),eo=ref([]),Wr=ref([]),Yr=ref(null),Jr=ref([]),no=computed(()=>{const Ro=[];return Jr.value.forEach(Ao=>{var Io,To;const zo=groupResizer$1.splitResizerId(Ao),Oo=zo==null?void 0:zo.groupId;if(Oo==null)return;const Bo=zo==null?void 0:zo.index;if(Bo==null)return;const bo=(((Io=Nr.value[Oo])==null?void 0:Io.items)??[])[Bo],vo=(((To=Nr.value[Oo])==null?void 0:To.items)??[])[Bo+1];bo&&Ro.push(...basicFlexLogic.getAllLeafBlocksForItem({itemId:bo,ITEM_MAP:Nr.value})),vo&&Ro.push(...basicFlexLogic.getAllLeafBlocksForItem({itemId:vo,ITEM_MAP:Nr.value}))}),Ro}),ro=ref(null),so=ref(null),ao=ref(null),lo=ref(0),po=computed(()=>{var Oo;const Ro=Cr.getGroupBeingResized;if(Ro==null)return null;const Ao=(Oo=Nr.value[Ro])==null?void 0:Oo.direction,zo=Cr.getItemIndexBeingResized;return Ao==null?null:Ao==="row"&&zo===-1?"ns-resize":Ao==="row"?"ew-resize":Ao==="column"?"ns-resize":null}),go=(Ro,Ao)=>{Rr.value||Kr.value==null&&(Wr.value[Ao]=!0)},co=(Ro,Ao)=>{Rr.value||Kr.value==null&&(Wr.value[Ao]=!1)},mo=()=>{if(Rr.value){eo.value=[],Jr.value=[];return}let Ro=null;Vr.value&&(Ro=Vr.value.getBoundingClientRect()),eo.value=[],eo.value=groupResizer$1.getAllResizers({slideId:Br.value||"",slideBoundingRect:jr,slideBoundingRectDirect:Ro,scale:Mr.value}),jr.x.value,Ro==null||Ro.x,Zr.value+=1,Wr.value=eo.value.map(()=>!1),Jr.value=[]},{scrollElIfNeeded:io,scrollSpeed:uo,stopScrolling:ho}=useElScroll({update:()=>{}}),yo=(Ro,Ao)=>Rr.value||Ur.value?!1:groupResizer$1.canResize(Ro)&&groupResizer$1.canResizeX(Ao),So=Ro=>Rr.value||Ur.value?!1:groupResizer$1.canResize(Ro),ko=(Ro,Ao,zo,Oo)=>{var To,Co,Po;Cr.setBlockResizerId(zo),Yr.value=null,zr.value&&(zr.value=null,(To=$r.current)==null||To.commands.blur()),Ar.setTextSelectionPopupOpen({open:!1}),Cr.setBlockPositionChangeInProgress(!0),posthogCapture("resize blocks",{slideId:Br.value});const{groupId:Bo,index:bo}=groupResizer$1.splitResizerId(zo);if(Bo==null)return;if(bo===-1&&Bo==="g-h-0"){const Fo="g-h-0";ro.value=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Fo,ITEM_MAP:Nr.value})),ao.value=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Bo,ITEM_MAP:Nr.value})),lo.value=eo.value[Oo].position.y;return}const vo=(((Co=Nr.value[Bo])==null?void 0:Co.items)??[])[bo],Io=(((Po=Nr.value[Bo])==null?void 0:Po.items)??[])[bo+1];ro.value=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:vo,ITEM_MAP:Nr.value})),so.value=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Io,ITEM_MAP:Nr.value})),ao.value=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Bo,ITEM_MAP:Nr.value})),lo.value=eo.value[Oo].position.y},$o=(Ro,Ao,zo,Oo)=>{const{groupId:Bo,index:bo}=groupResizer$1.splitResizerId(zo);if(Bo==null)return;const vo=Nr.value[Bo];if(vo==null||vo.items==null)return;const Io="g-h-0",To="column";let Co=Ro.y-eo.value[Oo].position.y;Co/=Mr.value;const Po="height",Fo="y",Vo="x",Ko=basicFlexLogic.getPositionObjectForItem({id:Io,ITEM_MAP:Nr.value}),Uo={...Ko,[Po]:Ko[Po]+Co};if(!So(Uo))return!1;const ei=basicFlexLogic.getMinHeightForItem({id:Io,ITEM_MAP:Nr.value});if(Uo.height{var Xo,si,vi;const{groupId:Bo,index:bo}=groupResizer$1.splitResizerId(zo);if(Bo==null)return;const vo=Nr.value[Bo];if(vo==null||vo.items==null)return;if(bo===-1&&Bo==="g-h-0")return $o(Ro,Ao,zo,Oo);const Io=((vo==null?void 0:vo.items)??[])[bo],To=((vo==null?void 0:vo.items)??[])[bo+1],Co=vo==null?void 0:vo.direction;let Po=Co==="column"?Ro.y-eo.value[Oo].position.y:Ro.x-eo.value[Oo].position.x;Po/=Mr.value;const Fo=Co==="column"?"height":"width",Vo=Co==="column"?"y":"x",Ko=Co==="column"?"x":"y",Uo=basicFlexLogic.getPositionObjectForItem({id:Io,ITEM_MAP:Nr.value}),ei=basicFlexLogic.getPositionObjectForItem({id:To,ITEM_MAP:Nr.value}),qo={...Uo,[Fo]:Uo[Fo]+Po},ri={...ei,[Fo]:ei[Fo]-Po,[Vo]:ei[Vo]+Po};if(!yo({...qo,id:Io},{...ri,id:To})||qo.widthli!==Io&&li!==To).forEach(li=>{const Ii={...lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:li,ITEM_MAP:Nr.value})),height:Ci};groupResizerLogic.updateLocalPositionForItem({id:li,newPosition:Ii,ITEM_MAP:Nr.value,itemRefs:Lr.value,allBlocks:Hr.value,dimensionChanged:"height"})}),groupResizerLogic.changeHeightOfItem({itemId:Bo,itemRefs:Lr.value,proposedHeight:Ci+2*(((Xo=vo.spacing)==null?void 0:Xo.padding)??0),itemPositionOG:ao.value,skipUpdatingItem:!0,slideId:Br.value||"",save:!1});return}if(Co==="column"){groupResizerLogic.updateLocalPositionForItem({id:Io,ITEM_MAP:Nr.value,itemRefs:Lr.value,allBlocks:Hr.value,newPosition:qo,dimensionChanged:Fo});const Ci=groupResizerLogic.getLocalPositionForItem({id:Io,ITEM_MAP:Nr.value,itemRefs:Lr.value,allBlocks:Hr.value}),wi=Ci.y+Ci.height+(((si=vo.spacing)==null?void 0:si.gap)??0);ri.y=wi,groupResizerLogic.updateLocalPositionForItem({id:To,ITEM_MAP:Nr.value,itemRefs:Lr.value,allBlocks:Hr.value,newPosition:ri,dimensionChanged:Fo});const bi=groupResizerLogic.getLocalPositionForItem({id:To,ITEM_MAP:Nr.value,itemRefs:Lr.value,allBlocks:Hr.value}),li=((vi=vo.spacing)==null?void 0:vi.gap)??0;let ci=basicFlexLogic.roundValue(bi.y+bi.height+li);vo.items.slice(bo+2).forEach(Ni=>{const Ei=lodashExports.cloneDeep(basicFlexLogic.getPositionObjectForItem({id:Ni,ITEM_MAP:Nr.value}));groupResizerLogic.updateLocalYPositionForItem({id:Ni,newY:ci,ITEM_MAP:Nr.value,itemRefs:Lr.value,allBlocks:Hr.value}),ci+=basicFlexLogic.roundValue(Ei.height+li)});const Ii=lodashExports.cloneDeep(groupResizerLogic.getLocalPositionForItem({id:Bo,ITEM_MAP:Nr.value,itemRefs:Lr.value,allBlocks:Hr.value}));groupResizerLogic.changeHeightOfItem({itemId:Bo,itemRefs:Lr.value,proposedHeight:Ii.height,itemPositionOG:ao.value,skipUpdatingItem:!0,slideId:Br.value||"",save:!1})}},No=()=>{mo(),ro.value=null,so.value=null,ao.value=null,lo.value=0,Cr.setBlockPositionChangeInProgress(!1),ho()},Eo=(Ro,Ao,zo,Oo)=>{var Fo;const{groupId:Bo,index:bo}=groupResizer$1.splitResizerId(zo);if(Bo==null)return;const vo=useBlockStore(),Io=usePageStore(),To=vo.getAffectedBlocks(Io.children(Br.value)),Co=lodashExports.cloneDeep(Io.pageObject(Br.value));if(bo===-1&&Bo==="g-h-0"){Cr.setBlockResizerId(null),groupResizerLogic.savePositionForItem({id:"g-h-0",ITEM_MAP:Nr.value,itemRefs:Lr.value,allBlocks:Hr.value}),groupResizerLogic.fixSlideIfRequired({slideId:Br.value||"",itemRefs:Lr.value,saveToDb:!1}),Io.pushGroupStateToDB({slideId:Br.value,originalBlocks:To,originalSlide:Co}),No();return}Cr.setBlockResizerId(null),(((Fo=Nr.value[Bo])==null?void 0:Fo.items)??[]).forEach(Vo=>{groupResizerLogic.savePositionForItem({id:Vo,ITEM_MAP:Nr.value,itemRefs:Lr.value,allBlocks:Hr.value})}),groupResizerLogic.savePositionForItem({id:"g-h-0",ITEM_MAP:Nr.value,itemRefs:Lr.value,allBlocks:Hr.value}),groupResizerLogic.fixSlideIfRequired({slideId:Br.value||"",itemRefs:Lr.value,saveToDb:!1}),Io.pushGroupStateToDB({slideId:Br.value,originalBlocks:To,originalSlide:Co}),No()},Mo=(Ro,Ao)=>{};return onMounted(()=>{mo()}),watchEffect(()=>{Rr.value||mo()}),watch(Xr,()=>{Rr.value||mo()}),watch(Gr,()=>{Rr.value||mo()}),watch(Rr,()=>{mo()}),{blockResizerId:Kr,allResizers:eo,resizerKey:Zr,hoveringStateForResizers:Wr,positionForActiveResizeMarker:Yr,nearestResizerIds:Jr,blocksInNearestResizerIds:no,cursorForResizer:po,handleMouseOverOnResizer:go,handleMouseLeaveOnResizer:co,onResizerStart:ko,onResizerMove:Go,onResizerEnd:Eo,onResizerCleanup:Mo}},useInternalVariableTuning=defineStore("internalVariableTuning",{state:()=>({sections:{dragAndDrop:{id:"dragAndDrop",title:"Drag and Drop",settings:{scaleDownFactor:{id:"scaleDownFactor",value:.4,type:"slider",min:.1,max:1,step:.05,title:"Scale Down Factor",hidden:!0},transitionForScaleDown:{id:"transitionForScaleDown",value:120,type:"slider",min:10,max:500,step:10,title:"Transition for Scale Down",hidden:!0},allowShrinking:{id:"allowShrinking",value:!0,type:"boolean",title:"Allow Shrinking",hidden:!0},shrinkBlocksBy:{id:"shrinkBlocksBy",value:6,type:"slider",min:0,max:48,step:2,title:"Shrink Blocks By",hidden:!0},shrinkDuration:{id:"shrinkDuration",value:170,type:"slider",min:10,max:400,step:10,title:"Shrink Duration"},shrinkDelay:{id:"shrinkDelay",value:180,type:"slider",min:0,max:300,step:10,title:"Shrink Delay"},allowDividerChangeDirection:{id:"allowDividerChangeDirection",value:!0,type:"boolean",title:"Allow Divider To Change Direction"},transitionForDividerGhost:{id:"transitionForDividerGhost",value:150,type:"slider",min:10,max:500,step:10,title:"Transition for divider ghost"},transitionDelayForDividerGhost:{id:"transitionDelayForDividerGhost",value:250,type:"slider",min:0,max:500,step:10,title:"Transition delay for divider ghost"}}},blocks:{id:"blocks",title:"Block settings",settings:{cornerRadius:{id:"cornerRadius",value:12,type:"slider",min:0,max:96,step:2,title:"Corner Radius"},showDimensions:{id:"showDimensions",value:!1,type:"boolean",title:"Show Dimensions"}}},decks:{id:"decks",title:"Deck settings",settings:{spacing:{id:"spacing",value:12,type:"slider",min:0,max:48,step:2,title:"Deck spacing"}}}}}),getters:{scaleDownFactor:Tr=>Tr.sections.dragAndDrop.settings.scaleDownFactor.value,transitionForScaleDown:Tr=>Tr.sections.dragAndDrop.settings.transitionForScaleDown.value,allowShrinking:Tr=>Tr.sections.dragAndDrop.settings.allowShrinking.value,blockShrinkingDelay:Tr=>Tr.sections.dragAndDrop.settings.shrinkDelay.value,blockShrinkingDuration:Tr=>Tr.sections.dragAndDrop.settings.shrinkDuration.value,blockShrinkingBy:Tr=>Tr.sections.dragAndDrop.settings.shrinkBlocksBy.value,cornerRadius:Tr=>Tr.sections.blocks.settings.cornerRadius.value,deckSpacing:Tr=>Tr.sections.decks.settings.spacing.value,showDimensions:Tr=>Tr.sections.blocks.settings.showDimensions.value,allowDividerChangeDirection:Tr=>Tr.sections.dragAndDrop.settings.allowDividerChangeDirection.value,transitionForDividerGhost:Tr=>Tr.sections.dragAndDrop.settings.transitionForDividerGhost.value,transitionDelayForDividerGhost:Tr=>Tr.sections.dragAndDrop.settings.transitionDelayForDividerGhost.value},actions:{setVariableValue({section:Tr,variable:Cr,value:$r}){!this.sections[Tr]||!this.sections[Tr].settings[Cr]||(this.sections[Tr].settings[Cr].value=$r)}}}),RESIZER_THICKNESS=16,RESIZER_PADDING=6.5,RESIZER_SNAP_DISTANCE=8,MIN_RESIER_HEIGHT_WIDTH=48,canResize=Tr=>{const{x:Cr,y:$r,width:Ar,height:Rr}=Tr;return!(Ar`${Tr}:${Cr}`,splitResizerId=Tr=>Tr==null?{groupId:null,index:null}:{groupId:Tr.split(":")[0],index:parseInt(Tr.split(":")[1],10)},getPositionForResizer=({groupId:Tr,index:Cr,slideId:$r})=>{const Rr=useItemStore().data[$r],Dr=Rr[Tr],Mr=Dr.items[Cr];if(!Mr)return null;const Br=basicFlexLogic.getPositionObjectForItem({id:Mr,ITEM_MAP:Rr,redoRootGroupCalc:!0}),Nr=Dr.direction;return Nr==="row"?{x:Br.x+Br.width+6,y:Br.y+Br.height*.5,height:Br.height*1,width:RESIZER_THICKNESS,direction:"row"}:Nr==="column"?{x:Br.x+Br.width*.5,y:Br.y+Br.height+6,height:RESIZER_THICKNESS,width:Br.width*1,direction:"column"}:null},getAllResizers=({slideId:Tr,start:Cr,slideBoundingRect:$r,slideBoundingRectDirect:Ar,scale:Rr})=>{const Mr=useItemStore().data[Tr],Br=[],Nr=Cr??groupFlexLogic.getRootGroupId({ITEM_MAP:Mr});if(!Nr)return[];if(!groupFlexLogic.isGroup({id:Nr}))return[];const Hr=Mr[Nr].items;return Hr.slice(0,-1).forEach((Ur,Vr)=>{const jr=getPositionForResizer({groupId:Nr,index:Vr,slideId:Tr});if(!jr)return;const Gr={id:getResizerId({groupId:Nr,index:Vr}),position:{...jr,x:jr.x*Rr,y:jr.y*Rr,width:jr.width*Rr,height:jr.height*Rr}};Ar?(Gr.position.x+=Ar.x,Gr.position.y+=Ar.y):$r&&(Gr.position.x+=$r.x.value,Gr.position.y+=$r.y.value),Br.push(Gr)}),Hr.filter(Ur=>groupFlexLogic.isGroup({id:Ur})).forEach(Ur=>{const Vr=getAllResizers({slideId:Tr,start:Ur,slideBoundingRect:$r,slideBoundingRectDirect:Ar,scale:Rr});Br.push(...Vr)}),Br},updateLocalPositionForItem=({id:Tr,newPosition:Cr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr,dimensionChanged:Dr})=>{if(basicFlexLogic.isGroup(Tr)){if($r[Tr]==null)return;const{items:Nr,direction:Lr}=$r[Tr],Hr=$r[Tr].spacing??{padding:0,gap:0},zr=(Hr==null?void 0:Hr.padding)??0,Ur=(Hr==null?void 0:Hr.gap)??0,Vr=basicFlexLogic.getPositionObjectForItem({id:Tr,ITEM_MAP:$r,redoRootGroupCalc:!0});if(Dr==="width"&&Lr==="row"){const jr=Vr.width-2*zr-(Nr.length-1)*Ur,Xr=(Cr.width-2*zr-(Nr.length-1)*Ur)/jr;let Kr=Cr.x+zr;Nr.forEach((Zr,eo)=>{const Wr=basicFlexLogic.getPositionObjectForItem({id:Zr,ITEM_MAP:$r,redoRootGroupCalc:!0}),Yr={...Wr,x:basicFlexLogic.roundValue(Kr),width:basicFlexLogic.roundValue(Wr.width*Xr),y:basicFlexLogic.roundValue(Cr.y+zr),height:basicFlexLogic.roundValue(Cr.height-2*zr)};updateLocalPositionForItem({id:Zr,newPosition:Yr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr,dimensionChanged:Dr}),Kr+=Yr.width+Ur});return}if(Dr==="width"&&Lr==="column"){const jr=Vr.width-2*zr,Xr=(Cr.width-2*zr)/jr;Nr.forEach((Kr,Zr)=>{const eo=basicFlexLogic.getPositionObjectForItem({id:Kr,ITEM_MAP:$r,redoRootGroupCalc:!0}),Wr={...eo,x:basicFlexLogic.roundValue(Cr.x+zr),width:basicFlexLogic.roundValue(eo.width*Xr)};updateLocalPositionForItem({id:Kr,newPosition:Wr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr,dimensionChanged:Dr})});return}if(Dr==="height"&&Lr==="row"){const jr=Vr.height-2*zr,Xr=(Cr.height-2*zr)/jr;Nr.forEach((Kr,Zr)=>{const eo=basicFlexLogic.getPositionObjectForItem({id:Kr,ITEM_MAP:$r,redoRootGroupCalc:!0}),Wr={...eo,y:basicFlexLogic.roundValue(Cr.y+zr),height:basicFlexLogic.roundValue(eo.height*Xr)};updateLocalPositionForItem({id:Kr,newPosition:Wr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr,dimensionChanged:Dr})});return}if(Dr==="height"&&Lr==="column"){const jr=Vr.height-2*zr-(Nr.length-1)*Ur,Xr=(Cr.height-2*zr-(Nr.length-1)*Ur)/jr;let Kr=Cr.y;Nr.forEach((Zr,eo)=>{const Wr=basicFlexLogic.getPositionObjectForItem({id:Zr,ITEM_MAP:$r,redoRootGroupCalc:!0}),Yr={...Wr,y:basicFlexLogic.roundValue(Kr),height:basicFlexLogic.roundValue(Wr.height*Xr),x:basicFlexLogic.roundValue(Cr.x+zr),width:basicFlexLogic.roundValue(Cr.width-2*zr)};updateLocalPositionForItem({id:Zr,newPosition:Yr,ITEM_MAP:$r,itemRefs:Ar,allBlocks:Rr,dimensionChanged:Dr}),Kr+=Yr.height+Ur});return}return}const Br=Rr.indexOf(Tr);Br<0||Ar[Br]!=null&&Ar[Br].updatePositionObject({...Cr})},getLocalPositionForItem=({id:Tr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar})=>{if(Tr==null)return{x:0,y:0,width:0,height:0};if(basicFlexLogic.isGroup(Tr)){const Br=Cr[Tr];if(!Br)return{x:0,y:0,width:0,height:0};const{items:Nr,direction:Lr,spacing:Hr}=Br;if(basicFlexLogic.isRootGroup({groupId:Tr,ITEM_MAP:Cr}))return{x:0,y:0,width:960,height:540};let zr=0;Hr&&(zr=Hr.padding||0,Hr.gap);let Ur={x:0,y:0,width:0,height:0};if(Lr==="row"){const Vr=Nr[0],jr=Nr[Nr.length-1],Gr=getLocalPositionForItem({id:Vr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar}),Xr=getLocalPositionForItem({id:jr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar});return Ur={x:Gr.x-zr,y:Gr.y-zr,width:Xr.x+Xr.width-Gr.x+2*zr,height:Gr.height+2*zr},Ur}if(Lr==="column"){const Vr=Nr[0],jr=Nr[Nr.length-1],Gr=getLocalPositionForItem({id:Vr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar}),Xr=getLocalPositionForItem({id:jr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar});return Ur={x:Gr.x-zr,y:Gr.y-zr,width:Gr.width+2*zr,height:Xr.y+Xr.height-Gr.y+2*zr},Ur}return Ur}const Rr=Ar.indexOf(Tr);if(Rr<0)return{x:0,y:0,width:0,height:0};const Dr=$r[Rr];return Dr?Dr.positionObject:{x:0,y:0,width:0,height:0}},savePositionForItem=({id:Tr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar})=>{var Mr;if(basicFlexLogic.isGroup(Tr)){(((Mr=Cr[Tr])==null?void 0:Mr.items)||[]).forEach(Nr=>{savePositionForItem({id:Nr,ITEM_MAP:Cr,itemRefs:$r,allBlocks:Ar})});return}const Dr=Ar.indexOf(Tr);Dr<0||$r[Dr].savePosition({action:"resize",fromOutside:!0})},getNearestResizerInSameDirection=({resizerId:Tr,allResizers:Cr,currentPos:$r,scale:Ar})=>{const Rr=Cr.find(Vr=>Vr.id===Tr);if(!Rr)return null;const Dr=Rr.position.direction,Mr=Dr==="row"?"x":"y",Br=$r[Mr],Nr=Cr.filter(Vr=>Vr.id!==Tr).filter(Vr=>Vr.position.direction===Dr).filter(Vr=>Math.abs(Vr.position[Mr]-Br)Math.abs(Vr.position[Hr]-$r[Hr])-Math.abs(jr.position[Hr]-$r[Hr]))[0],Ur=Nr.filter(Vr=>basicFlexLogic.closeBy(Vr.position[Mr],zr.position[Mr]));return{anchor:zr,ids:Ur.map(Vr=>Vr.id)}},groupResizer={getPositionForResizer,getAllResizers,splitResizerId,updateLocalPositionForItem,getLocalPositionForItem,canResize,savePositionForItem,getNearestResizerInSameDirection,RESIZER_PADDING,RESIZER_SNAP_DISTANCE,RESIZER_THICKNESS,MIN_RESIER_HEIGHT_WIDTH},SAVED_SCALE_DOWN_FACTOR=.4,SAVED_TRANSITION_FOR_SCALE_DOWN=120,DROP_ZONE_TIE_BREAKER_DISTANCE=24,DROP_ZONE_TIE_BREAKER_PERCENTAGE=.1,DROP_TRANSITION_DELAY=100,GHOST_OPACITY$1=.8,GHOST_SHADOW$1="0px 12px 32px 0px rgba(0, 0, 0, 0.24)",GHOST_TRANSITION_TIMING_FUNCTION="cubic-bezier(0.38, 0, 0.31, 1)",IS_BLOCK_SHRINKING_ALLOWED=computed(()=>isEnabled("blockShrinkingDuringDragging")&&useInternalVariableTuning().allowShrinking),IS_DIVIDER_GHOST_CHANGING_DIRECTION=computed(()=>isEnabled("dividerGhostDirectionChange")&&useInternalVariableTuning().allowDividerChangeDirection),DROP_ZONE_MARKER_THICKNESS=3,SHRINK_IMMEDIATELY=!0,IS_INTERNAL_TUNING_COMPUTED=computed(()=>isEnabled("internalVariableTuning")),BLOCK_SHRINKING_DURATION=computed(()=>IS_BLOCK_SHRINKING_ALLOWED.value?IS_INTERNAL_TUNING_COMPUTED.value?useInternalVariableTuning().blockShrinkingDuration:170:0),BLOCK_SHRINKING_DELAY=computed(()=>IS_BLOCK_SHRINKING_ALLOWED.value?IS_INTERNAL_TUNING_COMPUTED.value?useInternalVariableTuning().blockShrinkingDelay:180:0),DROP_ZONE_SHRINK=computed(()=>IS_BLOCK_SHRINKING_ALLOWED.value?IS_INTERNAL_TUNING_COMPUTED.value?useInternalVariableTuning().blockShrinkingBy:6:0),DIVIDER_GHOST_TRANSITION_DURATION=computed(()=>IS_DIVIDER_GHOST_CHANGING_DIRECTION.value?IS_INTERNAL_TUNING_COMPUTED.value?useInternalVariableTuning().transitionForDividerGhost:150:0),DIVIDER_GHOST_TRANSITION_DELAY=computed(()=>IS_DIVIDER_GHOST_CHANGING_DIRECTION.value?IS_INTERNAL_TUNING_COMPUTED.value?useInternalVariableTuning().transitionDelayForDividerGhost:250:0),useBlockDragAndDrop=Tr=>{const Cr=useBlockStore(),$r=usePageStore(),Ar=useAppStore(),Rr=useArtboardStore(),Dr=useInternalVariableTuning(),{appId:Mr,scale:Br,pageId:Nr,themeObject:Lr,allowDragging:Hr,ITEM_MAP:zr,itemRefs:Ur,movingBlockIds:Vr,setMovingBlockIds:jr,dropzoneBlockIds:Gr,setDropzoneBlockIds:Xr,allBlocks:Kr,dragBlockId:Zr,deepInnerParentElBoundingRect:eo}=Tr,Wr=isEnabled("internalVariableTuning"),Yr=computed(()=>Wr?Dr.scaleDownFactor:SAVED_SCALE_DOWN_FACTOR),Jr=computed(()=>Wr?Dr.transitionForScaleDown:SAVED_TRANSITION_FOR_SCALE_DOWN),no=computed(()=>{var li,ci;return(ci=(li=Ar.config(Mr.value))==null?void 0:li.smallText)==null?void 0:ci.value}),ro=useWindowSize(),so=ref(!1),ao=ref(0),lo=ref(null),po=ref(0);ref(null);const go=ref(null),co=ref(null);ref(null),ref(null);const mo=ref([]),io=ref({x:0,y:0}),uo=ref(!1),ho=ref(null),yo=ref(1),So=ref(1);ref(null);const ko=ref(!1),$o=ref(null),Go=ref(null),No=ref(null),Eo=ref(null),Mo=ref(null),Ro=ref(null),Ao=ref({}),zo=DROP_TRANSITION_DELAY,Oo=()=>{const li=document.getElementById("ghost");if(!li)return;const ci=document.getElementById("main-app");ci!=null?ci.removeChild(li):document.body.removeChild(li)},Bo=(li,ci)=>{var fs,da;const Ii=document.getElementById(ci);if(Ii==null)return{newEl:null,newX:0,newY:0};const Ni=Ii.querySelectorAll(".generic-block")[0];if(Ni==null)return{newEl:null,newX:0,newY:0};const Ei=Ni.cloneNode(!0);Ei.id="ghost",Ei.style.position="absolute",Ei.style.willChange="transform, opacity",Ei.style.transition=`transform ${Jr.value}ms ${GHOST_TRANSITION_TIMING_FUNCTION}`,Ei.style.zIndex="1000";const $i=Cr.positionByDisplay(ci);So.value=Yr.value,$i.width*Yr.value<80&&(So.value=Math.min(.8,80/$i.width)),$i.height*So.value<40&&(So.value=Math.min(.8,40/$i.height)),$i.height*So.value*Br.value>.9*ro.height.value&&(So.value=.9*ro.height.value/($i.height*Br.value));const Ri=Ni.getBoundingClientRect(),Fi=li.clientY-Ri.top,bs=li.clientX-Ri.left;po.value=Fi,ao.value=bs;const qi=Ar.borderRadius(Mr.value)*Br.value,Mi=ref(1),Ui=((da=(fs=Cr.config(ci))==null?void 0:fs.backgroundColor)==null?void 0:da.selectedId)??"none",Ki=$r.isDividerSlide(Nr.value),Ss=Ui==="none"||!Ki&&Ui==="grey";if(Ss&&(Ei.style.background=Lr.value.artboard.background),Ei.style.top=`${Ri.top}px`,Ei.style.left=`${Ri.left}px`,Ei.style.width=`${Ri.width*Mi.value}px`,Ei.style.height=`${Ri.height*Mi.value}px`,Ei.style.minHeight="0px",Ei.style.transformOrigin=`${bs}px ${Fi}px`,Ei.style.transform="scale(1)",Ei.style.opacity=`${GHOST_OPACITY$1}`,Ei.style.cursor="grabbing",Ei.style.borderRadius=`${qi}px`,Ei.style.border="none",Ei.querySelectorAll(".dragContainer")!=null){const di=Ei.querySelectorAll(".dragContainer")[0];if(di){const ss=di.querySelectorAll(".editor-wrapper")[0];ss&&(ss.style.cursor="grabbing");const Ls=di.querySelectorAll(".divider-embed")[0];Ls&&(Ls.style.cursor="grabbing"),di.style.borderRadius=`${qi}px`,di.style.border="none",di.style.cursor="grabbing",di.style.minHeight="0px",Ss&&(di.style.background=Lr.value.artboard.background),di.style.boxShadow=GHOST_SHADOW$1;const ha=Array.from(di.querySelectorAll('h1[data-type="title"]')),na=Array.from(di.querySelectorAll("h1")).filter(rs=>!ha.includes(rs)),wa=[...Array.from(di.querySelectorAll("h2")),...Array.from(di.querySelectorAll('.ProseMirror ul[data-list-content-type="h2"] > li > p')),...Array.from(di.querySelectorAll('.ProseMirror ol[data-list-content-type="h2"] > li > p'))],ys=[...Array.from(di.querySelectorAll("h3")),...Array.from(di.querySelectorAll('.ProseMirror ul[data-list-content-type="h3"] > li > p')),...Array.from(di.querySelectorAll('.ProseMirror ol[data-list-content-type="h3"] > li > p'))],ls=[...Array.from(di.querySelectorAll("h4")),...Array.from(di.querySelectorAll('.ProseMirror ul[data-list-content-type="h4"] > li > p')),...Array.from(di.querySelectorAll('.ProseMirror ol[data-list-content-type="h4"] > li > p'))],Hs=[...Array.from(di.querySelectorAll("h5")),...Array.from(di.querySelectorAll('.ProseMirror ul[data-list-content-type="h5"] > li > p')),...Array.from(di.querySelectorAll('.ProseMirror ol[data-list-content-type="h5"] > li > p'))],ra=[...Array.from(di.querySelectorAll("p"))].filter(rs=>!ha.includes(rs)&&!na.includes(rs)&&!wa.includes(rs)&&!ys.includes(rs)&&!ls.includes(rs)&&!Hs.includes(rs)),ps=[...Array.from(di.querySelectorAll("ul"))],Ms=[...Array.from(di.querySelectorAll("ol"))],ds=design.fontSizeMap.richText.desktop[no.value?"smallText":"regular"];ha.forEach(rs=>{rs.style.fontSize=`${Br.value*Mi.value*ds.title}px`}),na.forEach(rs=>{rs.style.fontSize=`${Br.value*Mi.value*ds.h1}px`}),wa.forEach(rs=>{rs.style.fontSize=`${Br.value*Mi.value*ds.h2}px`}),ys.forEach(rs=>{rs.style.fontSize=`${Br.value*Mi.value*ds.h3}px`}),ls.forEach(rs=>{rs.style.fontSize=`${Br.value*Mi.value*ds.h4}px`}),Hs.forEach(rs=>{rs.style.fontSize=`${Br.value*Mi.value*ds.h5}px`}),ra.forEach(rs=>{rs.style.fontSize=`${Br.value*Mi.value*ds.p}px`}),ps.forEach(rs=>{rs.style.fontSize=`${Br.value*Mi.value*ds.ul}px`}),Ms.forEach(rs=>{rs.style.fontSize=`${Br.value*Mi.value*ds.ol}px`})}}const gs=Ei.querySelectorAll(".dragContainer img");if(gs!=null&&gs.length>0)for(let di=0;di{ss.style.display="none"}),Ei.querySelectorAll(".selection-pane")!=null){const di=Ei.querySelectorAll(".selection-pane")[0];di!=null&&(di.style.display="none")}Ei.querySelectorAll(".table-buttons")!=null&&[...Array.from(Ei.querySelectorAll(".table-buttons"))].forEach(ss=>{ss.style.display="none"});const Fs=document.getElementById("main-app");Fs!=null?Fs.appendChild(Ei):document.body.appendChild(Ei),setTimeout(()=>{Ei.style.transform=`scale(${So.value})`},0);const Yi=ao.value*So.value,vs=po.value*So.value;return{newEl:Ei,newX:Yi,newY:vs}},bo=async li=>{if(!lo.value||li==null)return;lo.value.getBoundingClientRect();const{top:ci,left:Ii,width:Ni,height:Ei}=li,$i=lo.value.style.transform,Ri=$i.includes("rotate"),Fi=$i.replace(/rotate\([0-9]+deg\)/,"");Ri&&(lo.value.style.transition="transform 0ms ease-out, opacity 0ms ease-out",lo.value.style.opacity="0",lo.value.style.transform=`${Fi}`,lo.value.style.opacity="0",await sleep(100)),lo.value.style.zIndex="3000",lo.value.style.opacity=ko.value?"0":"1",lo.value.style.transition=`all ${zo}ms ease-out, background 0ms ease-out`,setTimeout(()=>{lo.value&&(lo.value.style.top=`${ci}px`,lo.value.style.left=`${Ii}px`,lo.value.style.width=`${Ni}px`,lo.value.style.height=`${Ei}px`,lo.value.style.transform="scale(1)")},0),setTimeout(()=>{Oo()},zo)},vo=li=>{const ci=document.getElementById(li);if(ci==null)return null;const Ii=ci.children[0];return Ii==null?null:Ii.getBoundingClientRect()},Io=({id:li,parentId:ci,edge:Ii})=>{const Ni=zr.value[li],Ei=zr.value[ci];if(Ni==null||Ei==null)return!1;const $i=Ei.items;if($i==null)return!1;const Ri=$i.indexOf(li);if(Ri===-1)return!1;const Fi=Ei.direction;return Fi==="row"&&["top","bottom"].includes(Ii)?!0:Fi==="row"&&Ii==="left"?Ri===0:Fi==="row"&&Ii==="right"?Ri===$i.length-1:Fi==="column"&&["left","right"].includes(Ii)?!0:Fi==="column"&&Ii==="top"?Ri===0:Fi==="column"&&Ii==="bottom"?Ri===$i.length-1:!1},To=(li,ci)=>Vr.value[0]==null||ci==null?!0:basicFlexLogic.isBlockAlreadyInCorrectPlace({blockId:Vr.value[0],direction:li,dropId:ci.split(":")[0]}),Co=(li,ci)=>ci.includes(`:${li}`)&&!To(li,ci),Po=()=>{Ao.value.head&&groupResizer.updateLocalPositionForItem({id:Ao.value.head.id,ITEM_MAP:zr.value,itemRefs:Ur.value,allBlocks:Kr.value,newPosition:basicFlexLogic.getPositionObjectForItem({id:Ao.value.head.id,ITEM_MAP:zr.value,redoRootGroupCalc:!0}),dimensionChanged:Ao.value.dimensionChanged}),Ao.value.tail&&groupResizer.updateLocalPositionForItem({id:Ao.value.tail.id,ITEM_MAP:zr.value,itemRefs:Ur.value,allBlocks:Kr.value,newPosition:basicFlexLogic.getPositionObjectForItem({id:Ao.value.tail.id,ITEM_MAP:zr.value,redoRootGroupCalc:!0}),dimensionChanged:Ao.value.dimensionChanged}),Rr.setDragShrinkingAffectedItems([])},Fo=({id:li,parentId:ci,edge:Ii})=>{if(!["top","bottom","left","right"].includes(Ii))return null;const Ni=zr.value[li];if(Ni==null)return null;const{groupId:Ei}=Ni;let $i=ci;if($i||($i=Ei),$i==null)return null;const Ri=zr.value[$i];if(Ri==null)return null;const Fi=Ri.direction;if(Fi==="column"&&["top","bottom"].includes(Ii)){const qi=Io({id:li,parentId:$i,edge:Ii}),Mi=Io({id:$i,parentId:Ri.groupId,edge:Ii}),Ui=qi&&Mi;return Ri.groupId&&Ui?Ri.groupId:null}if(Fi==="row"&&["left","right"].includes(Ii)){const qi=Io({id:li,parentId:$i,edge:Ii}),Mi=Io({id:$i,parentId:Ri.groupId,edge:Ii}),Ui=qi&&Mi;return Ri.groupId&&Ui?Ri.groupId:null}return Io({id:li,parentId:$i,edge:Ii})?$i:null},Vo=({dropId:li,dropEdge:ci,x:Ii,y:Ni})=>{const Ei=basicFlexLogic.getPositionObjectForItem({id:li,ITEM_MAP:zr.value,redoRootGroupCalc:!0});if(eo.x.value==null||eo.y.value==null)return!1;const $i=zr.value[li];if($i==null)return!1;$i.type;const{x:Ri,y:Fi}=eo,bs=Ii-Ri.value,qi=Ni-Fi.value,Mi=bs/Br.value,Ui=qi/Br.value,{x:Ki,y:Ss,width:gs,height:Fs}=Ei;if(ci==="top"||ci==="bottom")return Mi>=Ki&&Mi<=Ki+gs&&SHRINK_IMMEDIATELY;if(ci==="left"){const Yi=SHRINK_IMMEDIATELY,vs=Ui>=Ss&&Ui<=Ss+Fs;return Yi&&vs}if(ci==="right"){const Yi=SHRINK_IMMEDIATELY,vs=Ui>=Ss&&Ui<=Ss+Fs;return Yi&&vs}},Ko=({dropId:li,dropEdge:ci})=>{var Ui,Ki,Ss,gs,Fs;const Ii=zr.value[li];if(Ii==null)return{};const Ni=ci==="top"||ci==="bottom"?"height":"width",Ei=Ii.type==="group";if(Ii.groupId==null&&Ei){if(ci==="top")return{tail:{id:li,type:"tail"},head:null,dimensionChanged:Ni};if(ci==="bottom")return{tail:null,head:{id:li,type:"head"},dimensionChanged:Ni};if(ci==="left")return{tail:{id:li,type:"tail"},head:null,dimensionChanged:Ni};if(ci==="right")return{tail:null,head:{id:li,type:"head"},dimensionChanged:Ni}}const Ri=zr.value[Ii.groupId],Fi=Ri==null?void 0:Ri.direction;if((((Ui=Ri==null?void 0:Ri.items)==null?void 0:Ui.indexOf(li))??-1)===-1)return{};if(Fi==null)return{};let qi=null,Mi=null;if(ci==="top"&&Fi==="column"){Mi={id:li,type:"tail"};const Yi=((Ki=zr.value[Ii.groupId])==null?void 0:Ki.items)??[],vs=Yi.indexOf(li);if(vs===-1)return{};const fs=Yi[vs-1];return fs==null?{tail:Mi,head:null}:(qi={id:fs,type:"head"},{tail:Mi,head:qi})}if(ci==="top"&&Fi==="row")return Mi={id:li,type:"tail"},{tail:Mi,head:null};if(ci==="bottom"&&Fi==="column"){qi={id:li,type:"head"};const Yi=((Ss=zr.value[Ii.groupId])==null?void 0:Ss.items)??[],vs=Yi.indexOf(li);if(vs===-1)return{};const fs=Yi[vs+1];return fs==null?{tail:null,head:qi}:(Mi={id:fs,type:"tail"},{tail:Mi,head:qi})}if(ci==="bottom"&&Fi==="row")return qi={id:li,type:"head"},{tail:null,head:qi};if(ci==="left"&&Fi==="row"){Mi={id:li,type:"tail"};const Yi=((gs=zr.value[Ii.groupId])==null?void 0:gs.items)??[],vs=Yi.indexOf(li);if(vs===-1)return{};const fs=Yi[vs-1];return fs==null?{tail:Mi,head:null}:(qi={id:fs,type:"head"},{tail:Mi,head:qi})}if(ci==="left"&&Fi==="column")return Mi={id:li,type:"tail"},{tail:Mi,head:null};if(ci==="right"&&Fi==="row"){qi={id:li,type:"head"};const Yi=((Fs=zr.value[Ii.groupId])==null?void 0:Fs.items)??[],vs=Yi.indexOf(li);if(vs===-1)return{};const fs=Yi[vs+1];return fs==null?{tail:null,head:qi}:(Mi={id:fs,type:"tail"},{tail:Mi,head:qi})}if(ci==="right"&&Fi==="column")return qi={id:li,type:"head"},{tail:null,head:qi}},Uo=(li,ci)=>{var rs,Zs,Js;if(!Hr.value)return;so.value&&(go.value=li.clientX,co.value=li.clientY);const Ii=vo(ci);if(Ii==null)return!1;const{top:Ni,left:Ei,bottom:$i,right:Ri}=Ii,Fi=li.pageY-Ni,bs=li.pageX-Ei,qi=$i-li.pageY,Mi=Ri-li.pageX,Ui=Fi/($i-Ni),Ki=bs/(Ri-Ei),Ss=qi/($i-Ni),gs=Mi/(Ri-Ei),Fs=(rs=zr.value[ci])==null?void 0:rs.groupId;(Zs=zr.value[Vr.value[0]])==null||Zs.groupId,(Js=zr.value[Fs])==null||Js.direction;const Yi=Fo({id:ci,edge:"top"}),vs=Fo({id:ci,edge:"bottom"}),fs=Fo({id:ci,edge:"left"}),da=Fo({id:ci,edge:"right"}),di=Cr.positionByDisplay(ci);let ss=Math.min(Ui,Ss,Ki,gs);const Ls=di.widthdi.height?"width":"height",na=.5-(di[ha]-di[Ls])*.2/di[ha];if(Ls==="height"?ss=Math.min(Ui,Ss,Ki<=na?Ki:1,gs<=na?gs:1):ss=Math.min(Ui<=na?Ui:1,Ss<=na?Ss:1,Ki,gs),Ui===ss?Fi{const $s=lo.value;if($s==null)return!1;const Ps=ps[Ai%3].duration,Os=0;$s.style.transition=`transform ${Ps}ms ease-out`,$s.style.transitionDelay=`${Os}ms`},ds=Ai=>{let $s=0;for(let Ps=0;Ps{Ms(0),Ai.style.transform=`scaleX(${So.value*Os}) scaleY(${So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="vertical"},ps[0].delay),Eo.value=setTimeout(()=>{Ms(1),Ai.style.opacity="0",Ai.style.transform=`rotate(90deg) scaleX(${So.value*Os}) scaleY(${So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="vertical"},ds(1)),Mo.value=setTimeout(()=>{Ms(2),Ai.style.opacity="1",Ai.style.transform=`rotate(90deg) scaleX(${So.value*.5}) scaleY(${1*So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="vertical"},ds(2)),Ro.value=setTimeout(()=>{Ai.style.opacity="1",Ai.style.transition=`transform ${Jr.value}ms ${GHOST_TRANSITION_TIMING_FUNCTION}`,Ai.style.transitionDelay="0ms",Go.value="vertical"},ds(3))):$o.value==="vertical"&&Bs&&(No.value=setTimeout(()=>{Ms(0),Ai.style.transform=`rotate(90deg) scaleY(${So.value*Os}) scaleX(${So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="vertical"},ps[0].delay),Eo.value=setTimeout(()=>{Ms(1),Ai.style.opacity="0",Ai.style.transform=`scaleY(${So.value*Os}) scaleX(${So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="vertical"},ds(1)),Mo.value=setTimeout(()=>{Ms(2),Ai.style.opacity="1",Ai.style.transform=`scaleY(${So.value*.5}) scaleX(${So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="vertical"},ds(2)),Ro.value=setTimeout(()=>{Ai.style.opacity="1",Ai.style.transition=`transform ${Jr.value}ms ${GHOST_TRANSITION_TIMING_FUNCTION}`,Ai.style.transitionDelay="0ms",Go.value="vertical"},ds(3))),Go.value="vertical"}if(IS_DIVIDER_GHOST_CHANGING_DIRECTION.value&&Hs==="height"&&ko.value&&Go.value==="vertical"){const Ai=lo.value;if(Ai==null)return!1;No.value&&clearTimeout(No.value),Eo.value&&clearTimeout(Eo.value),Mo.value&&clearTimeout(Mo.value),Ro.value&&clearTimeout(Ro.value);const $s=Ai.offsetWidth,Ps=Ai.offsetHeight,Os=Math.min(Ps/$s,$s/Ps),Bs=Ai.style.transform.includes("rotate(90deg"),Es=Ar.borderRadius(Mr.value)*Br.value;Ai.style.borderRadius=`${Es}px`,$o.value==="horizontal"&&Bs?(No.value=setTimeout(()=>{Ms(0),Ai.style.transform=`rotate(90deg) scaleX(${So.value*Os}) scaleY(${So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="horizontal"},ps[0].delay),Eo.value=setTimeout(()=>{Ms(1),Ai.style.opacity="0",Ai.style.transform=`scaleX(${So.value*Os}) scaleY(${So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="horizontal"},ds(1)),Mo.value=setTimeout(()=>{Ms(2),Ai.style.opacity="1",Ai.style.transform=`scaleX(${So.value}) scaleY(${So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="horizontal"},ds(2)),Ro.value=setTimeout(()=>{Ai.style.opacity="1",Ai.style.transition=`transform ${Jr.value}ms ${GHOST_TRANSITION_TIMING_FUNCTION}`,Ai.style.transitionDelay="0ms",Go.value="horizontal"},ds(3))):$o.value==="vertical"&&!Bs&&(No.value=setTimeout(()=>{Ms(0),Ai.style.transform=`scaleY(${So.value*Os}) scaleX(${So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="horizontal"},ps[0].delay),Eo.value=setTimeout(()=>{Ms(1),Ai.style.opacity="0",Ai.style.transform=`rotate(90deg) scaleY(${So.value*Os}) scaleX(${So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="horizontal"},ds(1)),Mo.value=setTimeout(()=>{Ms(2),Ai.style.opacity="1",Ai.style.transform=`rotate(90deg) scaleY(${So.value*.5}) scaleX(${1*So.value})`,Ai.style.borderRadius=`${Es}px`,Go.value="horizontal"},ds(2)),Ro.value=setTimeout(()=>{Ai.style.opacity="1",Ai.style.transition=`transform ${Jr.value}ms ${GHOST_TRANSITION_TIMING_FUNCTION}`,Ai.style.transitionDelay="0ms",Go.value="horizontal"},ds(3))),Go.value="horizontal"}return!1},ei=(li,ci)=>{Uo(li,ci)},qo=(li,ci)=>{for(let Ii=0;Ii=Ni.left&&li<=Ni.right&&ci>=Ni.top&&ci<=Ni.bottom)return Kr.value[Ii]??null}return null},ri=()=>{mo.value=[],Kr.value.forEach(li=>{const ci=vo(li);ci!=null&&mo.value.push(ci)})},{scrollElIfNeeded:ki,stopScrolling:ti}=useElScroll({update:ri}),ai=li=>{if(li.preventDefault(),!lo.value)return;lo.value.style.top=`${li.pageY-po.value}px`,lo.value.style.left=`${li.pageX-ao.value}px`;const ci=li.clientX,Ii=li.clientY;ki(li);const Ni=qo(ci,Ii);Ni&&ei(li,Ni)},Xo=()=>{Po(),Cr.setDragBlockId(null),Oo(),Xr([]),jr([]),so.value=!1,ti(),Rr.setBlockPositionChangeInProgress(!1),ko.value=!1,$o.value=null,Go.value=null,No.value&&clearTimeout(No.value),Eo.value&&clearTimeout(Eo.value),Mo.value&&clearTimeout(Mo.value),Ro.value&&clearTimeout(Ro.value)},si=async li=>{if(li.preventDefault(),document.removeEventListener("mousemove",ai),document.removeEventListener("mouseup",si),Po(),log("dragend",zr.value),!so.value){Xo();return}if(Zr.value==null){Xo();return}if(Gr.value[0]==null){Xo();return}if(Zr.value===Gr.value[0]){Xo();return}Rr.setBlockPositionChangeInProgress(!0);const ci=await groupCRUD.dropBlockAtNewPosition({blockId:Vr.value[0],dropzoneId:Gr.value[0],slideId:Nr.value});Xr([]),await nextTick();const Ii=basicFlexLogic.getPositionObjectForItem({id:Zr.value,ITEM_MAP:ci??zr.value,redoRootGroupCalc:!0}),Ni=eo.y.value+Ii.y*Br.value,Ei=eo.x.value+Ii.x*Br.value,$i=Ii.width*Br.value,Ri=Ii.height*Br.value;bo({top:Ni,left:Ei,width:$i,height:Ri}),await sleep(zo),Xo(),posthogCapture("drag_block_end")},vi=async(li,ci)=>{var Ei;if(Cr.type(ci)==="image"&&Cr.isRepositioningImg(ci)||Rr.isTableDragging)return;if(so.value=!0,Cr.setDragBlockId(ci),jr([ci]),Cr.type(ci)==="divider"){ko.value=!0;const $i=zr.value[ci].groupId,Ri=(Ei=zr.value[$i])==null?void 0:Ei.direction;Ri==="row"?$o.value="vertical":Ri==="column"?$o.value="horizontal":$o.value=null,Go.value=$o.value}if(!document.getElementById(ci))return;ri(),document.addEventListener("mousemove",ai),document.addEventListener("mouseup",si);const Ni=await Bo(li,ci);Ni.newEl!=null&&(lo.value=Ni.newEl)},Ci=li=>li.target==null?!1:["resizable-t","resizable-b","resizable-l","resizable-r"].some(Ni=>li.target&&li.target.classList.contains(Ni)),wi=async li=>{if(!uo.value||ho.value==null)return!1;const ci=Math.abs(li.clientX-io.value.x),Ii=Math.abs(li.clientY-io.value.y);if(ci>yo.value||Ii>yo.value){const Ni=ho.value;uo.value=!1,ho.value=null,document.removeEventListener("mousemove",wi),li.preventDefault(),await vi(li,Ni)}},bi=li=>{ho.value=null,uo.value=!1,document.removeEventListener("mouseup",bi),document.removeEventListener("mousemove",wi)};return{scaleForDragEl:Yr,transitionForScaleDown:Jr,isEventOnResizer:Ci,startDragPosition:io,mousePressed:uo,tempDragId:ho,checkIfMousePressedAndMovedEnough:wi,handleMouseUpForTempDrag:bi,isDragging:so}},useContextMenu=Tr=>{const Cr=ref(0),$r=ref(0),Ar=useMiscStore(),Rr=computed(()=>Ar.whichContextMenuOpen===Tr),Dr=Lr=>{const{clientX:Hr,clientY:zr}=Lr;Cr.value=Hr,$r.value=zr},Mr=()=>{Ar.setContextMenuOpen(null)},Br=()=>{Ar.setContextMenuOpen(Tr)},Nr=computed(()=>useArtboardStore().isDraggingResizing);return watch(Nr,Lr=>{Lr&&Mr()}),{contextMenuX:Cr,contextMenuY:$r,isContextMenuOpen:Rr,calcMenuPos:Dr,closeContextMenu:Mr,openContextMenu:Br}},useUploadToFileStorageUGCWrapper=(Tr,{id:Cr,independent:$r=!1,appId:Ar=""})=>{const Rr=useBlockStore(),Dr=useUserStore(),Mr=useAppStore(),Br=Dr.currentUserId;fileStorageUtils.uploadUGCImageToSupabase(Tr,{contentType:Tr.type,owner_id:Br}).then(Nr=>{$r&&(log("result.url",Nr.url),Mr.updateProps(Ar,{keyPath:["config","customDeckLogo","value"],value:Nr.url})),Nr.url&&(log("result.url",Nr.url),Rr.updateProps(Cr,{keyPath:["config","source","value"],value:Nr.url}))})},useImageUploadFlow=Tr=>{const Cr=useBlockStore(),{selectedBlockId:$r,pageId:Ar,updateExistingBlock:Rr=!1,independentUpload:Dr=!1,independentId:Mr=null,appId:Br}=Tr,Nr=ref(!1),Lr=ref("");return{showNotiForUpload:Nr,errorDuringUpload:Lr,handleUploadedFile:(zr,{x:Ur=null,y:Vr=null}={})=>{var Zr,eo,Wr,Yr;if(!(((Yr=(Wr=(eo=(Zr=blockConfig==null?void 0:blockConfig.state)==null?void 0:Zr.configs)==null?void 0:eo.image)==null?void 0:Wr.metaData)==null?void 0:Yr.allowedTypes)??[]).includes(zr.type)){Lr.value="File type not allowed",Nr.value=!0;return}Lr.value="";const Gr=URL.createObjectURL(zr),Xr=new Image;Xr.src=Gr;const Kr=()=>{if(Xr.naturalWidth,Xr.naturalHeight,Ur!=null&&Vr!=null?(Math.max(Math.floor(Math.floor(Ur)-Xr.naturalWidth/2),0),Math.max(Math.floor(Math.floor(Vr)-Xr.naturalHeight/2),0)):(Math.max(Math.floor(480-Xr.naturalWidth/2),0),Math.max(Math.floor(270-Xr.naturalHeight/2),0)),Dr){useUploadToFileStorageUGCWrapper(zr,{id:Mr,independent:!0,appId:Br});return}if(Rr&&$r.value){useUploadToFileStorageUGCWrapper(zr,{id:$r.value});return}Cr.createBlock({parent_id:Ar.value,type:"image",subtype:"user",configObject:{source:{id:"source",value:Gr},content:{id:"content",value:zr.name},generatedBy:{id:"generatedBy",value:"user"}}}).then(no=>{$r.value=no,useUploadToFileStorageUGCWrapper(zr,{id:no})})};if(zr.type==="image/heic"||zr.type==="image/heif"){Kr();return}Xr.onload=()=>{Kr()}}}},hasClassOrAncestorHasClass=(Tr,Cr)=>{for(;Tr;){if(Tr.classList.contains(Cr))return Tr;Tr=Tr.parentElement}return null},HORIZONTAL_SAFETY_MARGIN=16,VERTICAL_SAFETY_MARGIN=16,HEADER_HEIGHT=54,updatePositionForMenu=(Tr,Cr,$r,Ar)=>{const Rr=document.querySelectorAll(Cr)[0],Dr=(Ar==null?void 0:Ar.menuHeight)||(Rr==null?void 0:Rr.offsetHeight)||0,Mr=(Ar==null?void 0:Ar.menuWidth)||(Rr==null?void 0:Rr.offsetWidth)||0,{bottom:Br,left:Nr,height:Lr}=Tr,Hr=(Ar==null?void 0:Ar.hAlign)??"left",zr=Ar==null?void 0:Ar.yGap;let Ur={left:0};if(Hr==="left"&&Nr+Mr+HORIZONTAL_SAFETY_MARGIN>window.innerWidth&&(Ur={left:window.innerWidth-Mr-HORIZONTAL_SAFETY_MARGIN-Nr}),Hr==="right"&&(Ur={right:0}),Br+Dr+(zr??0)+VERTICAL_SAFETY_MARGIN>window.innerHeight){if(Br-Lr-Dr-(zr??0)>HEADER_HEIGHT){$r.value={top:-1*Dr-(zr??0)-VERTICAL_SAFETY_MARGIN,...Ur};return}$r.value={top:window.innerHeight-VERTICAL_SAFETY_MARGIN-Br-Dr-(zr??0),...Ur};return}zr!==void 0?$r.value={top:Lr+zr,...Ur}:$r.value={top:44,...Ur}},updatePositionForMenuWrtWindow=(Tr,Cr,$r,Ar={hAlign:"left",yGap:16})=>{const Rr=document.querySelectorAll(Cr)[0],Dr=(Rr==null?void 0:Rr.offsetHeight)||0,Mr=(Rr==null?void 0:Rr.offsetWidth)||0,{bottom:Br,left:Nr,right:Lr,top:Hr}=Tr;let zr={left:Nr};if((Nr+Mr>window.innerWidth||Ar.hAlign==="right")&&(zr={right:window.innerWidth-Lr}),Br+Dr+Ar.yGap>window.innerHeight){$r.value={top:Hr-Dr-Ar.yGap,...zr};return}$r.value={top:Br+Ar.yGap,...zr}},Placeholder$1=Extension.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Add text...",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("placeholder"),props:{decorations:({doc:Tr,selection:Cr})=>{const $r=!this.editor.isFocused,{anchor:Ar}=Cr,Rr=[];if(!$r)return null;const Dr=Tr.textContent.length===0;return Tr.descendants((Mr,Br)=>{const Nr=Ar>=Br&&Ar<=Br+Mr.nodeSize,Lr=!Mr.isLeaf&&!Mr.childCount;if((Nr||!this.options.showOnlyCurrent)&&Lr){const Hr=[this.options.emptyNodeClass];Dr&&Hr.push(this.options.emptyEditorClass);const zr=Decoration.node(Br,Br+Mr.nodeSize,{class:Hr.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:Mr,pos:Br,hasAnchor:Nr}):this.options.placeholder});Rr.push(zr)}return this.options.includeChildren}),DecorationSet.create(Tr,Rr)}}})]}}),inputRegex=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,pasteRegex=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,Highlight=Mark.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:Tr=>Tr.getAttribute("data-color")||Tr.style.backgroundColor,renderHTML:Tr=>Tr.color?{"data-color":Tr.color}:{}},textColor:{default:null,parseHTML:Tr=>Tr.getAttribute("data-text-color")||Tr.style.color,renderHTML:Tr=>Tr.textColor?{"data-text-color":Tr.textColor}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:Tr}){return["mark",mergeAttributes(this.options.HTMLAttributes,Tr),0]},addCommands(){return{setHighlight:Tr=>({commands:Cr})=>Cr.setMark(this.name,Tr),toggleHighlight:Tr=>({commands:Cr})=>Cr.toggleMark(this.name,Tr),unsetHighlight:()=>({commands:Tr})=>Tr.unsetMark(this.name)}},addKeyboardShortcuts(){return{}},addInputRules(){return[markInputRule({find:inputRegex,type:this.type})]},addPasteRules(){return[markPasteRule({find:pasteRegex,type:this.type})]}}),CustomHighlight=Highlight.extend({priority:1e3}),StyledPopOver2_vue_vue_type_style_index_0_scoped_df367d7a_lang="",BUFFER$1=20,_sfc_main$11={setup(Tr,Cr){const{styleProps:$r,popupOverrideSelector:Ar}=toRefs$1(Tr),Rr=computed(()=>$r.value.popoverButtonHeight??"36px"),Dr=computed(()=>({marginRight:0,marginLeft:0,marginTop:0,marginBottom:0})),Mr=computed(()=>$r.value.popoverHeight??36),Br=computed(()=>$r.value.popoverMaxHeight??Mr.value),Nr=computed(()=>$r.value.popoverWidth??36),Lr=computed(()=>$r.value.preferShowAbove??!1),Hr=ref(null),zr=useWindowSize(),Ur=computed(()=>$r.value.static??!1),Vr=useElementBounding$1(Hr),jr=theme.appTheme(),Gr=computed(()=>$r.value.panelBorder??`1px solid ${jr.palette.neutral[100]}`),Xr=computed(()=>$r.value.panelBorderRadius??"8px"),Kr=computed(()=>$r.value.panelOverFlow??"hidden auto"),Zr=computed(()=>$r.value.menuYGap??0),eo=computed(()=>$r.value.buttonBackground??jr.palette.neutral[0]),Wr=computed(()=>$r.value.panelBackground??jr.palette.neutral[0]),Yr=computed(()=>$r.value.animationDirection??"right"),Jr=computed(()=>Yr.value==="right"?`${Vr.width.value}px`:"0px"),no=computed(()=>$r.value.translateX??0),ro=computed(()=>Vr.top.value-Br.value-BUFFER$1>0),so=computed(()=>Vr.bottom.value+Br.value+BUFFER$1Vr.left.value-Nr.value-BUFFER$1>0),lo=computed(()=>Vr.right.value+Nr.value+BUFFER$1>zr.width.value||$r.value.alignToBtnRight),po=computed(()=>Vr.left.value-Nr.value-BUFFER$1<0||$r.value.alignToBtnLeft),go=computed(()=>!so.value||Lr.value&&ro.value),{top:co,bottom:mo,left:io,right:uo,width:ho,height:yo,update:So}=Vr,ko=computed(()=>{var Bo;if(!ro.value&&!so.value){const bo={};return Vr.top.value+Dr.value.marginTop+Mr.value+BUFFER$1Tr.contentOpen||!Ur.value?{}:{display:"none"}),Go=Oo=>{Ur.value&&(Oo.shouldBlurActiveElement&&document.activeElement.blur(),Cr.emit("close",Oo.target))},No=ref(null);onClickOutside(No,Oo=>{if(Ar.value==null)return;[...document.querySelectorAll(Ar.value)].some(vo=>vo.contains(Oo.target))?(Oo.stopPropagation(),Cr.emit("click-popover-override",Oo.target)):Go({target:Oo.target,shouldBlurActiveElement:!1})},{passive:Ar.value==null});const Eo=ref(!1);return{openPopover:()=>{So()},handleEscape:()=>{Go({target:null,shouldBlurActiveElement:!0})},closeStyle:$o,translateXForAnimation:Jr,removeFinalState:()=>{Eo.value=!1},useTranslateUp:Eo,applyFinalState:()=>{Eo.value=!0},panelBackground:Wr,buttonBackground:eo,panelOverFlow:Kr,panelBorder:Gr,panelBorderRadius:Xr,popoverRef:No,popoverButtonHeight:Rr,el:Hr,styleFromPosition:ko,isStatic:Ur}},components:{Popover:Pe,PopoverButton:Be,PopoverPanel:He},emits:["close","click-popover-override"],props:{teleportTo:{type:String,default:"#main-app"},styleProps:{type:Object,default:()=>({})},popupOverrideSelector:{type:String,default:null},contentOpen:{type:Boolean,default:!1},animateWith:{type:String,default:"fade"}}},__injectCSSVars__$4=()=>{useCssVars(Tr=>({"648231d7":Tr.translateXForAnimation}))},__setup__$4=_sfc_main$11.setup;_sfc_main$11.setup=__setup__$4?(Tr,Cr)=>(__injectCSSVars__$4(),__setup__$4(Tr,Cr)):__injectCSSVars__$4;const _hoisted_1$I={ref:"el",style:{position:"relative",width:"100%"}};function _sfc_render$c(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("PopoverButton"),Br=resolveComponent("PopoverPanel"),Nr=resolveComponent("Popover");return openBlock(),createBlock(Nr,{style:{position:"relative"}},{default:withCtx(({open:Lr,close:Hr})=>[createBaseVNode("div",_hoisted_1$I,[createVNode(Mr,{style:normalizeStyle({fontFamily:"inherit",background:Ar.buttonBackground,padding:0,height:Ar.popoverButtonHeight,width:"100%",marginLeft:"auto",borderRadius:Tr.appTheme.borderRadius.large,border:"none",fontSize:Tr.appTheme.fontSize.f4,display:"flex",alignItems:"center",gap:Tr.appTheme.spacing.s2}),onClick:Ar.openPopover,onKeydown:withKeys(withModifiers(Ar.handleEscape,["stop"]),["esc"])},{default:withCtx(()=>[renderSlot(Tr.$slots,"button",{open:Lr,close:Hr},void 0,!0)]),_:2},1032,["style","onClick","onKeydown"])],512),(openBlock(),createBlock(Teleport,{to:$r.teleportTo},[createVNode(Transition,{name:$r.animateWith,onAfterEnter:Ar.applyFinalState,onAfterLeave:Ar.removeFinalState},{default:withCtx(()=>[createVNode(Br,{static:Ar.isStatic,ref:"popoverRef",class:"headless-tracker popover-2",style:normalizeStyle({background:Ar.panelBackground,boxShadow:"0px 20px 32px rgba(0, 0, 0, 0.06)",border:Ar.panelBorder,borderRadius:Ar.panelBorderRadius,position:"absolute",zIndex:100,overflow:Ar.panelOverFlow,...Ar.styleFromPosition,...Ar.closeStyle}),onKeydown:withKeys(withModifiers(Ar.handleEscape,["stop"]),["esc"]),tabindex:"-1"},{default:withCtx(()=>[renderSlot(Tr.$slots,"content",{close:Hr,open:Lr},void 0,!0)]),_:2},1032,["static","style","onKeydown"])]),_:2},1032,["name","onAfterEnter","onAfterLeave"])],8,["to"]))]),_:3})}const StyledPopOver=_export_sfc(_sfc_main$11,[["render",_sfc_render$c],["__scopeId","data-v-df367d7a"]]);function useDebouncedRef(Tr){return customRef((Cr,$r)=>({get(){return Cr(),Tr},set(Ar){Tr=Ar,requestAnimationFrame(()=>{requestAnimationFrame(()=>{$r()})})}}))}class Editor extends Editor$1{constructor(Cr={}){return super(Cr),this.vueRenderers=reactive(new Map),this.contentComponent=null,this.reactiveState=useDebouncedRef(this.view.state),this.reactiveExtensionStorage=useDebouncedRef(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(Cr,$r){super.registerPlugin(Cr,$r),this.reactiveState.value=this.view.state}unregisterPlugin(Cr){super.unregisterPlugin(Cr),this.reactiveState.value=this.view.state}}const EditorContent=defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(Tr){const Cr=ref(),$r=getCurrentInstance();return watchEffect(()=>{const Ar=Tr.editor;Ar&&Ar.options.element&&Cr.value&&nextTick(()=>{if(!Cr.value||!Ar.options.element.firstChild)return;const Rr=unref(Cr.value);Cr.value.append(...Ar.options.element.childNodes),Ar.contentComponent=$r.ctx._,Ar.setOptions({element:Rr}),Ar.createNodeViews()})}),onBeforeUnmount(()=>{const Ar=Tr.editor;if(!Ar||(Ar.isDestroyed||Ar.view.setProps({nodeViews:{}}),Ar.contentComponent=null,!Ar.options.element.firstChild))return;const Rr=document.createElement("div");Rr.append(...Ar.options.element.childNodes),Ar.setOptions({element:Rr})}),{rootEl:Cr}},render(){const Tr=[];return this.editor&&this.editor.vueRenderers.forEach(Cr=>{const $r=h$5(Teleport,{to:Cr.teleportElement,key:Cr.id},h$5(Cr.component,{ref:Cr.id,...Cr.props}));Tr.push($r)}),h$5("div",{ref:Cr=>{this.rootEl=Cr}},...Tr)}}),useEditor=(Tr={})=>{const Cr=shallowRef();return onMounted(()=>{Cr.value=new Editor(Tr)}),onBeforeUnmount(()=>{var $r;($r=Cr.value)===null||$r===void 0||$r.destroy()}),Cr},_hoisted_1$H=["id"],_hoisted_2$z=["id"],enablePaddingShrink=!0,_sfc_main$10=defineComponent({__name:"RichTextEmbed",props:{blockId:{},content:{},backgroundColor:{},color:{},fontFamily:{},fontSize:{},fontWeight:{},isActive:{type:Boolean},isEditable:{type:Boolean},isLoading:{type:Boolean},isPreview:{type:Boolean},letterSpacing:{},lineHeight:{},scale:{},textAlignment:{},textType:{},verticalAlignment:{},classObject:{},appId:{},isBeingModified:{type:Boolean}},emits:["change","changed-height"],setup(Tr,{emit:Cr}){var Si;useCssVars(Do=>{var Wo,Bi;return{48668166:$o.value,13101650:Ko.value,bea49580:cl.value,"10d26207":Po.value,"00e7da24":Zs.value,"606e50b9":ai.value,"09c09dff":li.value,"6a099225":Ao.value,"006059e3":Ps.value,"578bfd2a":bo.value,a1252daa:ra.value,c559e894:ei.value,"475ca5e2":si.value,"544d89ae":Ro.value,"0811ff42":Os.value,"391ddb09":vo.value,"43b1d82c":ps.value,"3237be77":qo.value,"293a6f81":vi.value,"0fc3a4a1":Bs.value,"1aafb8e8":Io.value,"501371a6":Ms.value,"71c71d90":ri.value,"0b183920":Ci.value,"17754a00":Es.value,"077cd272":To.value,"6c3ab62e":ds.value,"5c0123f9":ki.value,"2613fa82":wi.value,"1f26ef5f":Xa.value,"445916b4":Co.value,"007f252f":rs.value,"1e34528c":ti.value,62586744:bi.value,"7c8e9958":$s.value,ea190bc2:Bo.value,"5efb65d6":Hs.value,bd56ecbe:Uo.value,"70f8dc17":Xo.value,"4c29cb26":Nr.textAlignment,"71fc1737":ci.value,"6ef85482":Xl.value,"857d1bbe":ho.value,"2ba4ac80":(Wo=uo.value)==null?void 0:Wo.left,"494744c3":(Bi=uo.value)==null?void 0:Bi.right,"5addb2ed":Rl.value,"6932c8c4":Go.value,"00d48efc":ul.value,"00d492bd":$l.value,"00d4967e":Al.value,"00d49a3f":tl.value,"00d49e00":Yl.value,"7bfcc855":Qa.value,"128b1b5c":Ii.value,"42edbcf9":Js.value,"0ee37af7":Oo.value,"0dbcaf97":nl.value,"610426ba":Ml.value,ed95d382:Ai.value,"65050cfb":zo.value,ac4d7afc:pa.value,"80fea082":rl.value,ac4d7afa:js.value,"80fea080":Ol.value,ac4d7af8:Qs.value,"80fea07e":ol.value,ac4d7af6:Ws.value,"80fea07c":Fl.value,ac4d7af4:Pl.value,"80fea07a":Dl.value,"7a86e5ff":dl.value,"612813a2":hl.value,b4ce0e12:wa.value,"0af59c89":ss.value,"431a9fbb":Bl.value,"0372673c":Ei.value,"5ffa77da":ha.value,"598d1137":Ls.value,"63be124e":$i.value,"2985909f":Jl.value,d9579510:Ql.value,"35462d26":ec.value,"08f51e52":Hl.value,"209a5da0":fl.value,"66b4680c":xs.value,"61418eca":Ja.value,"2b4e1da7":ro.value,bc7a02ba:no.value,"22182c4c":so.value,"3d1c0468":Vo.value,"7306ac7a":Fo.value}});const{currentAppId:$r}=inject("currentAppId"),Ar=inject("selectedBlockId"),Rr=inject("editingBlockId"),Dr=inject("showingFullScreen"),Mr=inject("showingFullPage"),{isMobile:Br}=useDeviceState(),Nr=Tr,Lr=Cr,Hr=useAppStore(),zr=useBlockLayoutsStore(),Ur=usePageStore(),Vr=useBlockStore(),jr=useEditorStore(),Gr=useMiscStore(),Xr=useArtboardStore(),Kr=useItemStore(),Zr=computed(()=>Vr.parentId(Nr.blockId)),eo=inject("isReadOnly"),Wr=computed(()=>Zr.value==null?{}:Kr.data[Zr.value]??{}),Yr=computed(()=>Xr.getDragShrinkingAffectedItems),Jr=computed(()=>{var Wo,Bi;if(!Yr.value)return null;const Do=Yr.value.find(zi=>zi.id===Nr.blockId);return Do?Do.direction:basicFlexLogic.isBlockDescendantOfGroup({blockId:Nr.blockId,groupId:(Wo=Yr.value[0])==null?void 0:Wo.id,ITEM_MAP:Wr.value})?Yr.value[0].direction:basicFlexLogic.isBlockDescendantOfGroup({blockId:Nr.blockId,groupId:(Bi=Yr.value[1])==null?void 0:Bi.id,ITEM_MAP:Wr.value})?Yr.value[1].direction:null}),no=computed(()=>GHOST_TRANSITION_TIMING_FUNCTION),ro=computed(()=>`${BLOCK_SHRINKING_DURATION.value}ms`),so=computed(()=>`${BLOCK_SHRINKING_DELAY.value}ms`),ao=ref(null),lo=computed(()=>Nr.blockId===Ar.value),po=computed(()=>{if(Nr.verticalAlignment==="top")return"start";if(Nr.verticalAlignment==="bottom")return"end"}),go=computed(()=>Nr.textAlignment==="right"?"end":Nr.textAlignment==="center"?"center":"start"),co=computed(()=>Vr.config(Nr.blockId).icon),mo=computed(()=>{if(co.value){const{image:Do,emoji:Wo}=co.value;if(Do||Wo)return!0}return!1}),io=computed(()=>{if(co.value){const{show:Do}=co.value;return Do===void 0&&mo.value?!0:Do}return!1}),uo=computed(()=>{if(Nr.textAlignment==="center")return{left:"50%",transform:"translateX(-50%)"};if(Nr.textAlignment==="right")return io.value?{right:0}:{right:"24px"}}),ho=computed(()=>Nr.isEditable?"contents":"none"),{scale:yo,isPreview:So}=toRefs$1(Nr),ko=computed(()=>Dr.value?yo.value:So.value?Math.max(yo.value,1):yo.value),$o=computed(()=>Nr.textAlignment==="right"?"right":Nr.textAlignment==="left"?"left":"center"),Go=computed(()=>Nr.textAlignment==="right"?"flex-end":Nr.textAlignment==="center"?"center":"flex-start"),No=computed(()=>Hr.getDeckFontFamily(Nr.appId)),Eo=computed(()=>(design.fontFamilies[No.value]??design.fontFamilies.default).fonts.heading),Mo=computed(()=>(design.fontFamilies[No.value]??design.fontFamilies.default).fonts.body),Ro=computed(()=>`${Eo.value}, 'Inter', -apple-system, 'Verdana'`),Ao=computed(()=>`${Mo.value}, 'Inter', -apple-system, 'Verdana'`),zo=computed(()=>`${Eo.value}, 'Satoshi', 'Inter', -apple-system, 'Verdana'`),Oo=computed(()=>`${Mo.value}, 'Satoshi', 'Inter', -apple-system, 'Verdana'`),Bo=computed(()=>{var Do,Wo;return((Wo=(Do=design.fontFamilies[No.value])==null?void 0:Do.fontWeight)==null?void 0:Wo.title)??600}),bo=computed(()=>{var Do,Wo;return((Wo=(Do=design.fontFamilies[No.value])==null?void 0:Do.fontWeight)==null?void 0:Wo.h1)??600}),vo=computed(()=>{var Do,Wo;return((Wo=(Do=design.fontFamilies[No.value])==null?void 0:Do.fontWeight)==null?void 0:Wo.h2)??600}),Io=computed(()=>{var Do,Wo;return((Wo=(Do=design.fontFamilies[No.value])==null?void 0:Do.fontWeight)==null?void 0:Wo.h3)??600}),To=computed(()=>{var Do,Wo;return((Wo=(Do=design.fontFamilies[No.value])==null?void 0:Do.fontWeight)==null?void 0:Wo.h4)??500}),Co=computed(()=>{var Do,Wo;return((Wo=(Do=design.fontFamilies[No.value])==null?void 0:Do.fontWeight)==null?void 0:Wo.h5)??400}),Po=computed(()=>{var Do,Wo;return((Wo=(Do=design.fontFamilies[No.value])==null?void 0:Do.fontWeight)==null?void 0:Wo.p)??400}),Fo=computed(()=>{var Do,Wo;return((Wo=(Do=design.fontFamilies[No.value])==null?void 0:Do.boldFontWeight)==null?void 0:Wo.heading)??600}),Vo=computed(()=>{var Do,Wo;return((Wo=(Do=design.fontFamilies[No.value])==null?void 0:Do.boldFontWeight)==null?void 0:Wo.body)??600}),Ko=computed(()=>Mo.value==="Aspekta"?"'ss02' on":"inherit"),Uo=computed(()=>1.4),ei=computed(()=>1.4),qo=computed(()=>1.4),ri=computed(()=>1.4),ki=computed(()=>1.5),ti=computed(()=>1.5),ai=computed(()=>1.5),Xo=computed(()=>{var Wo;const Do=(Wo=design.fontFamilies[No.value])==null?void 0:Wo.letterSpacing;return!Do||!Do.title?"normal":`${Do.title}px`}),si=computed(()=>{var Wo;const Do=(Wo=design.fontFamilies[No.value])==null?void 0:Wo.letterSpacing;return!Do||!Do.h1?"normal":`${Do.h1}px`}),vi=computed(()=>{var Wo;const Do=(Wo=design.fontFamilies[No.value])==null?void 0:Wo.letterSpacing;return!Do||!Do.h2?"normal":`${Do.h2}px`}),Ci=computed(()=>{var Wo;const Do=(Wo=design.fontFamilies[No.value])==null?void 0:Wo.letterSpacing;return!Do||!Do.h3?"normal":`${Do.h3}px`}),wi=computed(()=>{var Wo;const Do=(Wo=design.fontFamilies[No.value])==null?void 0:Wo.letterSpacing;return!Do||!Do.h4?"normal":`${Do.h4}px`}),bi=computed(()=>{var Wo;const Do=(Wo=design.fontFamilies[No.value])==null?void 0:Wo.letterSpacing;return!Do||!Do.h5?"normal":`${Do.h5}px`}),li=computed(()=>{var Wo;const Do=(Wo=design.fontFamilies[No.value])==null?void 0:Wo.letterSpacing;return!Do||!Do.p?"normal":`${Do.p}px`}),ci=computed(()=>Nr.textAlignment==="left"?"100%":"auto"),Ii=computed(()=>Nr.textAlignment==="left"?"auto":"fit-content"),Ni=computed(()=>Hr.borderRadius(Nr.appId)>0),Ei=computed(()=>Ni.value?`${ko.value*6}px`:"0px"),$i=computed(()=>Ni.value?`${ko.value*3}px`:"0px"),Ri=computed(()=>{var Do,Wo;return(Wo=(Do=Hr.config(Nr.appId))==null?void 0:Do.smallText)==null?void 0:Wo.value}),Fi=computed(()=>{let Do=1;return(Ri.value||Br.value)&&(Do=.8),{XS:20*Do,S:32*Do,M:53*Do,L:94*Do}}),bs={XS:12,S:16,M:20,L:24},qi={XS:8,S:12,M:16,L:20},Mi=ref(!1),Ui=ref(!1),Ki=ref(!1),Ss=computed(()=>{var Do;return((Do=co.value)==null?void 0:Do.alignment)==="vertical"?go.value:"start"}),gs=computed(()=>Hr.getThemeObject(Nr.appId,Zr.value||"")),Fs=computed(()=>Hr.deckTheme(Nr.appId)),Yi=computed(()=>{var Do,Wo;return((Wo=(Do=Vr.config(Nr.blockId))==null?void 0:Do.backgroundColor)==null?void 0:Wo.selectedId)??"none"}),vs=computed(()=>Vr.isAnyBlockDragging),fs=computed(()=>Xr.isDraggingResizing),da=computed(()=>Xr.getBlockPositionChangeInProgress),di=computed(()=>{const Do=Ur.isDividerSlide(Zr.value||"")&&Fs.value!=="yellow"&&Yi.value!=="bright",Wo=!Ur.isDividerSlide(Zr.value||"")&&Fs.value!=="yellow"&&Yi.value==="bright";return Do||Wo}),ss=computed(()=>di.value?"rgba(255, 255, 255, 0.24)":theme.rgbWithOpacity(theme.appTheme().colors.brandPurple,theme.state.softOpacity)),Ls=computed(()=>di.value&&Yi.value!=="main"?"white":"rgba(245, 75, 84, 1)"),ha=computed(()=>di.value&&Yi.value!=="main"?"rgba(255, 255, 255, 0.24)":"rgba(0, 0, 0, 0.04)"),na=computed(()=>{var Do,Wo,Bi;return(Bi=(Wo=(Do=Vr.blockData[Nr.blockId])==null?void 0:Do.config)==null?void 0:Wo.backgroundColor)==null?void 0:Bi.selectedId}),wa=computed(()=>{var Do,Wo;return na.value==="bright"?Ur.isDividerSlide(Zr.value||"")?gs.value.value:"#FFF":((Wo=(Do=gs.value)==null?void 0:Do.link)==null?void 0:Wo.color)??theme.appTheme().colors.brandPurple}),ys=computed(()=>{var Bi,zi;const Do=design.fontSizeMap.richText;if(Br.value){const Ti=Do.mobile;return{title:ko.value*Ti.title,h1:Ti.h1,h2:Ti.h2,h3:Ti.h3,h4:Ti.h4,p:Ti.p,h5:Ti.h5,ul:Ti.ul,ol:Ti.ol}}if((zi=(Bi=Hr.config(Nr.appId))==null?void 0:Bi.smallText)!=null&&zi.value){const Ti=Do.desktop.smallText;return{title:ko.value*Ti.title,h1:ko.value*Ti.h1,h2:ko.value*Ti.h2,h3:ko.value*Ti.h3,h4:ko.value*Ti.h4,p:ko.value*Ti.p,h5:ko.value*Ti.h5,ul:ko.value*Ti.ul,ol:ko.value*Ti.ol}}const Wo=Do.desktop.regular;return{title:ko.value*Wo.title,h1:ko.value*Wo.h1,h2:ko.value*Wo.h2,h3:ko.value*Wo.h3,h4:ko.value*Wo.h4,p:ko.value*Wo.p,h5:ko.value*Wo.h5,ul:ko.value*Wo.ul,ol:ko.value*Wo.ol}}),ls=computed(()=>{var Bi,zi;const Do=design.textMarginMap.richText;if(Br.value){const Ti=Do.mobile;return{title:`${ko.value*Ti.title}px`,h1:`${Ti.h1}px`,h2:`${Ti.h2}px`,h3:`${Ti.h3}px`,h4:`${Ti.h4}px`,p:`${Ti.p}px`,h5:`${Ti.h5}px`,ul:`${Ti.ul}px`,ol:`${Ti.ol}px`}}if((zi=(Bi=Hr.config(Nr.appId))==null?void 0:Bi.smallText)!=null&&zi.value){const Ti=Do.desktop.smallText;return{title:`${ko.value*Ti.title}px`,h1:`${ko.value*Ti.h1}px`,h2:`${ko.value*Ti.h2}px`,h3:`${ko.value*Ti.h3}px`,h4:`${ko.value*Ti.h4}px`,p:`${ko.value*Ti.p}px`,h5:`${ko.value*Ti.h5}px`,ul:`${ko.value*Ti.ul}px`,ol:`${ko.value*Ti.ol}px`}}const Wo=Do.desktop.regular;return{title:`${ko.value*Wo.title}px`,h1:`${ko.value*Wo.h1}px`,h2:`${ko.value*Wo.h2}px`,h3:`${ko.value*Wo.h3}px`,h4:`${ko.value*Wo.h4}px`,p:`${ko.value*Wo.p}px`,h5:`${ko.value*Wo.h5}px`,ul:`${ko.value*Wo.ul}px`,ol:`${ko.value*Wo.ol}px`}}),Hs=computed(()=>`${ys.value.title}px`),ra=computed(()=>`${ys.value.h1}px`),ps=computed(()=>`${ys.value.h2}px`),Ms=computed(()=>`${ys.value.h3}px`),ds=computed(()=>`${ys.value.h4}px`),rs=computed(()=>`${ys.value.h5}px`),Zs=computed(()=>`${ys.value.p}px`),Js=computed(()=>`${ys.value.ul}px`),Ai=computed(()=>`${ys.value.ol}px`),$s=computed(()=>ls.value.title),Ps=computed(()=>ls.value.h1),Os=computed(()=>ls.value.h2),Bs=computed(()=>ls.value.h3),Es=computed(()=>ls.value.h4),Xa=computed(()=>ls.value.h5),cl=computed(()=>ls.value.p);computed(()=>ls.value.ul),computed(()=>ls.value.ol);const Za=computed(()=>{var Do,Wo;return((Wo=(Do=Vr.config(Nr.blockId))==null?void 0:Do.backgroundColor)==null?void 0:Wo.selectedId)??"none"}),Da=computed(()=>{const Do=ko.value,Wo=Za.value==="none",Bi=IS_BLOCK_SHRINKING_ALLOWED.value&&vs.value&&enablePaddingShrink,zi=Bi&&Jr.value==="right"?DROP_ZONE_SHRINK.value:0,Ti=Bi&&Jr.value==="left"?DROP_ZONE_SHRINK.value:0;if(Br.value)return Wo?"8px 0px":"12px";let cs=Ri.value?design.padding.block.text.bg.small:design.padding.block.text.bg.default;return Wo&&(cs=Ri.value?design.padding.block.text.noBg.small:design.padding.block.text.noBg.default),`${cs*Do}px ${(cs-zi)*Do}px ${cs*Do}px ${(cs-Ti)*Do}px`}),Ja=computed(()=>Br.value?"16px":`${16*ko.value}px`),Ma=computed(()=>ys.value.title*Uo.value),Ba=computed(()=>ys.value.h1*ei.value),fa=computed(()=>ys.value.h2*qo.value),Ks=computed(()=>ys.value.h3*ri.value),oa=computed(()=>ys.value.h4*ki.value),ja=computed(()=>ys.value.h5*ti.value),Ia=computed(()=>ys.value.p*ai.value),Qa=computed(()=>`${Ma.value}px`),ul=computed(()=>`${Ba.value}px`),$l=computed(()=>`${fa.value}px`),Al=computed(()=>`${Ks.value}px`),tl=computed(()=>`${oa.value}px`),Yl=computed(()=>`${ja.value}px`),Rl=computed(()=>`${Ia.value}px`),dl=computed(()=>`${-1*Ma.value/2}px`),pa=computed(()=>`${-1*Ba.value/2}px`),js=computed(()=>`${-1*fa.value/2}px`),Qs=computed(()=>`${-1*Ks.value/2}px`),Ws=computed(()=>`${-1*oa.value/2}px`),Pl=computed(()=>`${-1*ja.value/2}px`),nl=computed(()=>`${-1*Ia.value/2}px`),hl=computed(()=>`${-1*Ma.value}px`),rl=computed(()=>`${-1*Ba.value}px`),Ol=computed(()=>`${-1*fa.value}px`),ol=computed(()=>`${-1*Ks.value}px`),Fl=computed(()=>`${-1*oa.value}px`),Dl=computed(()=>`${-1*ja.value}px`),Ml=computed(()=>`${-1*Ia.value}px`),Xl=computed(()=>di.value?"rgba(255, 255, 255, 0.32)":"rgba(0, 0, 0, 0.16)"),Ds=computed(()=>{var Do,Wo;return(Wo=(Do=Vr.config(Nr.blockId))==null?void 0:Do.aiResultId)==null?void 0:Wo.value}),Zl=computed(()=>Nr.color),Bl=computed(()=>Nr.isBeingModified?"#808080":Zl.value),ia=computed(()=>!So.value&&!Dr.value&&!Mr.value),Jl=computed(()=>Nr.backgroundColor==="#FFFFFF"||Nr.backgroundColor==="none"&&!di.value?"#FFDADC":"#FFC8CB"),Ql=computed(()=>Nr.backgroundColor==="#FFFFFF"||Nr.backgroundColor==="none"&&!di.value?"#FFEEC1":"#FFE7AB"),ec=computed(()=>Nr.backgroundColor==="#FFFFFF"||Nr.backgroundColor==="none"&&!di.value?"#D5F5BB":"#C5EBA7"),Hl=computed(()=>Nr.backgroundColor==="#FFFFFF"||Nr.backgroundColor==="none"&&!di.value?"#C7EBFF":"#B0E3FF"),fl=computed(()=>Nr.backgroundColor==="#FFFFFF"||Nr.backgroundColor==="none"&&!di.value?"#EDD8FF":"#E6C7FF"),xs=computed(()=>["yellow","navy","brown","black"].includes(Fs.value)?.5:!di.value&&na.value==="bright"||di.value&&["none","grey"].includes(na.value)?.7:.5),ws=lodashExports.debounce(Do=>{Lr("change",{value:jr.getContentToSave(Do)})},500),tc=Do=>{Vr.updateProps(Nr.blockId,{keyPath:["config","textAlignment","selectedId"],value:Do})},Oi=ref(!1),Zi=ref(!1),ji=useEditor({content:Nr.content,editable:Nr.isEditable,autofocus:jr.blockIdToFocus===Nr.blockId,extensions:[Document$1,Paragraph$2.extend({addKeyboardShortcuts(){return{"Cmd-Shift-L":()=>!0,"Cmd-Shift-R":()=>!0,"Cmd-Shift-E":()=>!0,"Cmd-Shift-J":()=>!0}}}),Text$3,Bold$2.configure({HTMLAttributes:{class:"text-bold"}}),Italic$2.configure({HTMLAttributes:{class:"text-italic"}}),Strike$2,History.configure({depth:100,newGroupDelay:100}),BulletList$3.configure({keepMarks:!0,keepAttributes:!0}),OrderedList$3.configure({keepMarks:!0,keepAttributes:!0}),TextAlign.configure({types:["paragraph","heading","title","code"],alignments:["left","center","right"],defaultAlignment:"center"}),TextStyle$2,Typography,ListItem$5,Heading$3,Placeholder$1,Blockquote$2,CustomHighlight.configure({HTMLAttributes:{class:"prezo-highlight"},multicolor:!0}),Link$2.configure({HTMLAttributes:{class:"prezo-link"},protocols:["ftp","mailto"],openOnClick:!1}),CodeBlock$2,Code$2,TitleNode,HardBreak$2.extend({addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.isActive("orderedList")||this.editor.isActive("bulletList")?this.editor.commands.setHardBreak():this.editor.commands.setHardBreak()}}})],editorProps:{attributes:{},handleDOMEvents:{dragstart:(Do,Wo)=>{lo.value&&Wo.stopPropagation()},dragover:(Do,Wo)=>{Vr.dragBlockId===Nr.blockId&&Wo.stopImmediatePropagation()},mousedown:(Do,Wo)=>{lo.value&&(Wo.stopPropagation(),Oi.value=!0)}},handleKeyDown:(Do,Wo)=>{Wo.key==="Escape"?Do.dom.blur():(Wo.key==="ArrowUp"||Wo.key==="ArrowDown"||Wo.key==="ArrowLeft"||Wo.key==="ArrowRight")&&setTimeout(()=>{Gr.setTextSelectionPopupOpen({open:!!jr.selection&&!jr.selection.empty})},10)},handlePaste:(Do,Wo,Bi)=>{var cs,es;const zi=(Bi==null?void 0:Bi.content.toJSON())??[];if(!jr.hasContent(Do.state.doc.content.toJSON())){let ns=(es=(cs=zi[0])==null?void 0:cs.attrs)==null?void 0:es.textAlign;return ns==="start"&&(ns="left"),ns==="end"&&(ns="right"),(ns==="justify"||ns==="justify-all")&&(ns="center"),ns==="match-parent"&&(ns=Nr.textAlignment??"center"),ns&&tc(ns),!1}Bi.content.descendants((ns,qs,ya,yl)=>(ns.attrs={...ns.attrs,textAlign:Nr.textAlignment},!1))},transformPasted:(Do,Wo)=>{function Bi(Ti){var cs,es,ns;if(Ti instanceof Fragment){const qs=Ti.content.map(Bi);return Fragment.from(qs)}if(Ti instanceof Node$2){const qs=Bi(Ti.content);let ya;return Ti.type.isBlock&&Ti.content.size===1&&((ns=(es=(((cs=Ti.content)==null?void 0:cs.content)??[])[0])==null?void 0:es.type)==null?void 0:ns.name)==="hardBreak"?ya=Ti.copy():ya=Ti.copy(qs),ya}}const zi=Bi(Do.content);return new Slice(zi,Do.openStart,Do.openEnd)},scrollThreshold:108,scrollMargin:108},onCreate:({editor:Do})=>{ia.value&&jr.blockIdToFocus===Nr.blockId&&(Do.setOptions({autofocus:!1}),jr.blockIdToFocus=null,jr.editors[Nr.blockId]=Do)},onSelectionUpdate:({transaction:Do})=>{var Bi,zi;const Wo=window.getSelection();if(Do.selection.empty){const Ti=hasClassOrAncestorHasClass((Bi=Wo==null?void 0:Wo.anchorNode)==null?void 0:Bi.parentElement,"prezo-link");if(Ti&&Ti.href&&((zi=Wo==null?void 0:Wo.anchorNode)!=null&&zi.textContent)){const cs=Ti.getBoundingClientRect();jr.showLinkPreview({url:Ti.href,position:{x:cs.left+cs.width/2,y:cs.bottom+8}})}else jr.hideLinkPreview()}else jr.hideLinkPreview();Oi.value||Gr.setTextSelectionPopupOpen({open:!!Do.selection&&!Do.selection.empty}),ia.value&&(jr.selection=Do.selection)},onFocus:({editor:Do,event:Wo})=>{if(Zi.value&&Wo.target instanceof HTMLElement&&(!jr.current||!Rr.value)){Wo.target.blur(),Zi.value=!1;return}if(Zi.value=!1,!ia.value)return;if(jr.setFocused(Nr.blockId,!0),jr.setRef(Do),log("editor focused",Nr.blockId,Ar.value),Ar.value!==Nr.blockId&&(Wo.preventDefault(),Wo.target instanceof HTMLElement)){Wo.target.blur();return}Rr.value=Nr.blockId;const Bi=jr.getHighlighterPosition(Nr.blockId);if(Bi==null)return;const{from:zi,to:Ti}=Bi;zi!==Ti&&(Do.chain().setTextSelection({from:zi,to:Ti}).unsetHighlight().setTextSelection({from:1,to:1}).run(),jr.setHighlighterPosition(Nr.blockId,null))},onBlur:({editor:Do})=>{ia.value&&(log("editor blurred",Nr.blockId),Lr("change",{value:jr.getContentToSave(Do)}),jr.setFocused(Nr.blockId,!1))},onUpdate:({editor:Do})=>{ia.value&&ws(Do)}}),sa=computed(()=>{var Wo;if(!((Wo=co.value)!=null&&Wo.size))return{};const Do={margin:0,marginTop:Math.max(1,1.5*ko.value)};return co.value.alignment==="vertical"?{...Do,marginTop:"0px",marginBottom:bs[co.value.size]*ko.value}:{...Do,marginRight:qi[co.value.size]*ko.value}}),Gs=computed(()=>io.value?sa.value:{margin:0}),pl=computed(()=>{if(!Gs.value)return{};const Do={};return Object.entries(Gs.value).forEach(([Wo,Bi])=>{Do[Wo]=`${Bi}px`}),Do}),ml=computed(()=>Hr.forPdf()),Rs=computed(()=>{let Do={width:"0px",height:"0px",minWidth:"0px",minHeight:"0px",overflow:"hidden",transition:["font-size","height","width","max-width","min-height","min-width"].map(Ti=>`${Ti} 200ms ease`).join(", ")};if(!co.value||co.value.show===!1)return Do;const Wo=`${Fi.value[co.value.size]*ko.value}px`,Bi=`${(Fi.value[co.value.size]+1)*ko.value}px`,zi=Hr.forPdf()?`${Fi.value[co.value.size]*ko.value*.82}px`:Wo;if(Do={...Do,height:Bi,width:Bi,minHeight:Wo,minWidth:Wo,fontSize:zi,lineHeight:zi},Ni.value){let Ti=(co.value.size==="XS"?4:6)*ko.value;const cs=design.cornerRadius.textIcon;let es="normal";co.value.size==="XS"&&(es="xs"),Br.value?Ti=cs[es].mobile:Hr.smallText(Nr.appId)?Ti=cs[es].small:Ti=cs[es].default,Ti*=ko.value,Do.borderRadius=`${Ti}px`}return Do}),zl=computed(()=>{if(!co.value)return{};const Do={};return(Ki.value||Ui.value)&&(Do.backgroundColor="rgba(0, 0, 0, 0.08)"),co.value.type==="image"&&(Do.backgroundImage=`url("${co.value.image}")`,Do.backgroundSize="contain",Do.backgroundPosition="center",Do.backgroundRepeat="no-repeat"),Do}),Wa=computed(()=>{var Bi,zi;if(!co.value||!Gs.value)return{};let Do=Rs.value.width;"marginRight"in Gs.value&&(Do+=` - ${Gs.value.marginRight}`);const Wo={};return io.value?((Bi=ji.value)!=null&&Bi.getText()||co.value.alignment==="horizontal"&&(Wo.width="fit-content"),{...Wo,maxWidth:((zi=co.value)==null?void 0:zi.alignment)==="horizontal"?`calc(100% - ${Do})`:"100%"}):Wo}),nc=ref(((Si=co.value)==null?void 0:Si.type)??"emoji"),rc=computed(()=>co.value?nc.value==="emoji"?341:196:0),ma=computed(()=>341),oc=computed(()=>zr.inTemplateMode);ia.value&&jr.setEditors(Nr.blockId,ji);const lc=Do=>{Do.button===0&&lo.value&&ji.value&&Rr.value&&(ji.value.commands.blur(),Rr.value=null,setTimeout(()=>{Rr.value=null},0),Gr.setTextSelectionPopupOpen({open:!1}))};eo.value||watch(Ar,(Do,Wo)=>{Do&&Wo&&Wo===Nr.blockId&&ji.value&&(Rr.value=null,ji.value.commands.blur())});const yc=Do=>{Do.button===0&&lo.value&&ji.value&&!Rr.value&&!Ui.value&&!Mi.value&&(ji.value.commands.focus("end"),setTimeout(()=>{Rr.value=Nr.blockId},0))};eo.value||watch(Ui,Do=>{Do&&(Mi.value=!1)});const vl=Do=>{const Wo={...co.value,type:"image",image:Do};Vr.updateProps(Nr.blockId,{keyPath:["config","icon"],value:Wo})},_c=({item:{id:Do}})=>{const Wo={...co.value,type:"emoji",emoji:Do};Vr.updateProps(Nr.blockId,{keyPath:["config","icon"],value:Wo})},Mc=()=>{const Do={...co.value,show:!1};Vr.updateProps(Nr.blockId,{keyPath:["config","icon"],value:Do}),Ui.value=!1,Gr.setTextIconPopup({open:!1})},aa=Do=>{Do==="custom"&&co.value.image?Vr.updateProps(Nr.blockId,{keyPath:["config","icon"],value:{...co.value,type:"image"}}):Do==="emoji"&&Vr.updateProps(Nr.blockId,{keyPath:["config","icon"],value:{...co.value,type:"emoji"}}),nc.value=Do},Bc=()=>{$r.value&&lo.value&&(Ki.value=!0)},la=()=>{Gr.setTextIconPopup({open:!0}),Ui.value=!0,Ar.value=Nr.blockId},Ho=()=>{Ui.value=!1,lo.value&&Gr.setTextIconPopup({open:!1})};watch(fs,Do=>{Do&&Ho()}),eo.value||useEventListener("mouseup",()=>{Oi.value=!1,setTimeout(()=>{Gr.setTextSelectionPopupOpen({open:!!jr.selection&&!jr.selection.empty})},10)}),onBeforeMount(()=>{Gr.isTextIconPopupOpen&&lo.value&&(Ui.value=!0)}),onMounted(()=>{ji.value&&Nr.textAlignment&&(ji.value.chain().selectAll().setTextAlign(Nr.textAlignment).run(),ji.value.commands.setTextSelection({from:1,to:1}))}),eo.value||(watch(()=>Gr.isTextIconPopupOpen,()=>{Gr.isTextIconPopupOpen&&lo.value&&(Ui.value=!0),Gr.isTextIconPopupOpen||(Ui.value=!1)}),watch(()=>Nr.textAlignment,()=>{ji.value&&Nr.textAlignment&&(Zi.value=!0,ji.value.chain().focus().selectAll().setTextAlign(Nr.textAlignment).run(),ji.value.commands.setTextSelection({from:1,to:1}))}),watch(Ds,()=>{if(ji.value&&Nr.content){const Do=Vr.config(Nr.blockId).content.value;ji.value.commands.setContent(Do)}})),eo.value||watch(Ar,()=>{if(lo.value&&!So.value){if(!ia.value)return;jr.setRef(ji.value)}lo.value||Gr.setTextSelectionPopupOpen({open:!1})}),onMounted(()=>{}),eo.value||watchEffect(()=>{ji.value&&Nr.isEditable!==ji.value.isEditable&&ji.value.setEditable(Nr.isEditable)}),eo.value||onClickOutside(ao,()=>{ia.value&&ji.value&&Nr.isActive&&Nr.isEditable&&!So.value&&(log(`clicked outside editor, saving content, isActive: ${Nr.isActive}, isPreview: ${So.value}, isEditable: ${Nr.isEditable}`),Lr("change",{value:jr.getContentToSave(ji.value)}))});const Yo=ref(0),Qo=ref(null),ui=ref(null),yi=useElementBounding(ui),gi=()=>{var Bi,zi;const Do=yi.height.value,Wo=parseFloat(((Bi=ao.value)==null?void 0:Bi.style.paddingTop)??"0")+parseFloat(((zi=ao.value)==null?void 0:zi.style.paddingBottom)??"0");Yo.value!==Do&&(Yo.value=Do,Lr("changed-height",Do/ko.value+Wo/ko.value))};return(!eo.value||oc.value)&&useResizeObserver(ui,async Do=>{gi()}),(Do,Wo)=>{var Bi,zi,Ti,cs,es,ns,qs,ya,yl;return openBlock(),createElementBlock("div",{ref_key:"wrapperElement",ref:ao,class:normalizeClass(["editor-wrapper flex flex-col grow text-neutral-1000",{"cursor-grab":Nr.isEditable&&!unref(So)&&(unref(Rr)===Nr.blockId||unref(Ar)==Nr.blockId)&&unref(Vr).dragBlockId!==Nr.blockId,"cursor-grabbing":!unref(So)&&unref(Vr).dragBlockId===Nr.blockId,blockAnimations:vs.value&&unref(IS_BLOCK_SHRINKING_ALLOWED)}]),style:normalizeStyle({padding:Da.value,color:Bl.value}),onMousedown:lc,onMouseup:yc},[createBaseVNode("div",{ref_key:"editorRefWrapper",ref:ui,class:normalizeClass(["flex items-center",{"mt-auto":po.value==="end","relative top-1/2":!po.value&&!unref(Br),"flex-col":!io.value||((Bi=co.value)==null?void 0:Bi.alignment)==="vertical","mx-auto":((zi=co.value)==null?void 0:zi.alignment)==="horizontal"&&go.value==="center"&&(unref(Rr)===Do.blockId||unref(Mr))&&!ml.value,"ml-auto":((Ti=co.value)==null?void 0:Ti.alignment)==="horizontal"&&go.value==="end"&&(unref(Rr)===Do.blockId||unref(Mr))&&!ml.value,"justify-center":((cs=co.value)==null?void 0:cs.alignment)==="horizontal"&&go.value==="center"&&(unref(Rr)!==Do.blockId||ml.value),"justify-end":((es=co.value)==null?void 0:es.alignment)==="horizontal"&&go.value==="end"&&(unref(Rr)!==Do.blockId||ml.value)}]),style:normalizeStyle(!po.value&&!unref(Br)?{transform:"translateY(-50%)"}:{})},[Rs.value&&unref($r)&&!unref(So)&&!unref(Mr)&&!unref(Br)&&!unref(Dr)&&(unref(Rr)===Nr.blockId||unref(Ar)==Nr.blockId)?(openBlock(),createBlock(StyledPopOver,{key:0,style:normalizeStyle({background:"transparent",alignSelf:((ns=co.value)==null?void 0:ns.alignment)==="vertical"?go.value:Ss.value,...Rs.value,...pl.value}),styleProps:{menuYGap:8,popoverButtonMargin:Gs.value,popoverWidth:296,popoverHeight:rc.value,popoverMaxHeight:ma.value,popoverButtonHeight:"fit-content",alignToBtnLeft:!0,animationDirection:"top",buttonBackground:"transparent",positionOverride:{},static:!0},popupOverrideSelector:".popoverOverride",onClose:Ho,contentOpen:Ui.value,onContextmenu:withModifiers(la,["stop","prevent"])},{button:withCtx(()=>[createBaseVNode("div",{style:normalizeStyle([Rs.value,zl.value,{cursor:lo.value?"pointer":"default"}]),class:normalizeClass([{"opacity-80":Ki.value},"flex items-center justify-center"]),onMouseenter:Bc,onMouseleave:Wo[0]||(Wo[0]=_l=>Ki.value=!1),id:`icon-${Do.blockId}${unref(So)?"-preview":""}`,onClick:la,tabindex:"-1"},toDisplayString(mo.value&&co.value.type==="emoji"?unref(allEmojis)[co.value.emoji]:""),47,_hoisted_1$H)]),content:withCtx(()=>{var _l;return[createVNode(IconPicker,{blockId:Do.blockId,selectedId:(_l=co.value)==null?void 0:_l.emoji,onSelectedImg:vl,onSelectedItemId:_c,onRemove:Mc,onSwitchTab:aa,onClose:Ho,open:Ui.value,appId:Do.appId},null,8,["blockId","selectedId","open","appId"])]}),_:1},8,["style","styleProps","popupOverrideSelector","contentOpen"])):io.value&&Rs.value?(openBlock(),createElementBlock("div",{key:1,style:normalizeStyle({background:"transparent",alignSelf:((qs=co.value)==null?void 0:qs.alignment)==="vertical"?go.value:Ss.value}),class:"flex items-center justify-center",onContextmenu:Wo[1]||(Wo[1]=withModifiers(()=>{},["stop","prevent"]))},[createBaseVNode("div",{style:normalizeStyle([Rs.value,zl.value,pl.value]),class:"flex items-center justify-center",id:`icon-${Do.blockId}${unref(So)?"-preview":""}`},toDisplayString(mo.value&&co.value.type==="emoji"?unref(allEmojis)[co.value.emoji]:""),13,_hoisted_2$z)],36)):createCommentVNode("",!0),createVNode(unref(EditorContent),{ref_key:"editorRef",ref:Qo,editor:unref(ji),class:normalizeClass(["text-clip",{grow:!io.value||io.value&&((ya=co.value)==null?void 0:ya.alignment)==="horizontal"&&Do.isActive,"w-full":!io.value||((yl=co.value)==null?void 0:yl.alignment)==="vertical",editable:!unref(Mr)&&!unref(Br),"cursor-auto":Nr.isEditable&&!unref(So)&&(unref(Rr)===Nr.blockId||unref(Ar)==Nr.blockId)&&unref(Vr).dragBlockId!==Nr.blockId,"cursor-grabbing":!unref(So)&&unref(Vr).dragBlockId===Nr.blockId,blockAnimations:vs.value&&!da.value&&unref(IS_BLOCK_SHRINKING_ALLOWED)}]),style:normalizeStyle(Wa.value)},null,8,["editor","class","style"])],6)],38)}}}),RichTextEmbed_vue_vue_type_style_index_0_lang="",_sfc_main$$=defineComponent({__name:"Skeleton",props:{interval:{default:1e3},isWhite:{type:Boolean,default:!1}},setup(Tr){useCssVars(Ar=>({41892840:$r.value}));const Cr=Tr,$r=computed(()=>Cr.interval==null?"1000ms":`${Cr.interval}ms`);return(Ar,Rr)=>(openBlock(),createElementBlock("div",{class:normalizeClass({skeleton:!Cr.isWhite,"skeleton-white":Cr.isWhite})},null,2))}}),Skeleton_vue_vue_type_style_index_0_scoped_0a695145_lang="",Skeleton=_export_sfc(_sfc_main$$,[["__scopeId","data-v-0a695145"]]),ResizerOG_vue_vue_type_style_index_0_scoped_c96e6eaf_lang="",ELEMENT_MASK={"resizable-r":{bit:1,cursor:"ew-resize"},"resizable-rb":{bit:3,cursor:"nwse-resize"},"resizable-b":{bit:2,cursor:"ns-resize"},"resizable-lb":{bit:6,cursor:"nesw-resize"},"resizable-l":{bit:4,cursor:"ew-resize"},"resizable-lt":{bit:12,cursor:"nwse-resize"},"resizable-t":{bit:8,cursor:"ns-resize"},"resizable-rt":{bit:9,cursor:"nesw-resize"},"drag-el":{bit:15,cursor:"move"}},CALC_MASK={l:1,t:2,w:4,h:8},_sfc_main$_={name:"VResizable",props:{isVisible:{default:!0,type:Boolean},width:{default:void 0,type:[Number,String]},minWidth:{default:0,type:Number},maxWidth:{default:void 0,type:Number},height:{default:void 0,type:[Number,String]},minHeight:{default:0,type:Number},maxHeight:{default:void 0,type:Number},left:{default:0,type:[Number,String]},top:{default:0,type:[Number,String]},active:{default:()=>["r","rb","b","lb","l","lt","t","rt"],validator:Tr=>["r","rb","b","lb","l","lt","t","rt"].filter(Cr=>Tr.indexOf(Cr)!==-1).length===Tr.length,type:Array},fitParent:{default:!1,type:Boolean},dragSelector:{default:void 0,type:String},maximize:{default:!1,type:Boolean},disableAttributes:{default:()=>[],validator:Tr=>["l","t","w","h"].filter(Cr=>Tr.indexOf(Cr)!==-1).length===Tr.length,type:Array},disableResizing:{default:!1,type:Boolean},scale:{type:Number,default:1}},emits:["mount","destroy","resize:start","resize:move","resize:end","drag:start","drag:move","drag:end","maximize"],data(){return{aspectRatio:this.width/this.height,w:this.width,h:this.height,minW:this.minWidth,minH:this.minHeight,maxW:this.maxWidth,maxH:this.maxHeight,l:this.left,t:this.top,mouseX:0,mouseY:0,offsetX:0,offsetY:0,parent:{width:0,height:0},resizeState:0,dragElements:[],dragState:!1,calcMap:15}},computed:{cornerPosition(){return`-${8/this.scale}px`},cornerDims(){return{width:`${16/this.scale}px`,height:`${16/this.scale}px`}},style(){return{...this.calcMap&CALC_MASK.w&&{width:typeof this.w=="number"?this.w+"px":this.w},...this.calcMap&CALC_MASK.h&&{height:typeof this.h=="number"?this.h+"px":this.h},...this.calcMap&CALC_MASK.l&&{left:typeof this.l=="number"?this.l+"px":this.l},...this.calcMap&CALC_MASK.t&&{top:typeof this.t=="number"?this.t+"px":this.t}}}},watch:{maxWidth(Tr){this.maxW=Tr},maxHeight(Tr){this.maxH=Tr},minWidth(Tr){this.minW=Tr},minHeight(Tr){this.minH=Tr},width(Tr){typeof Tr=="number"&&(this.w=Tr)},height(Tr){typeof Tr=="number"&&(this.h=Tr)},left(Tr){typeof Tr=="number"&&(this.l=Tr)},top(Tr){typeof Tr=="number"&&(this.t=Tr)},dragSelector(Tr){this.setupDragElements(Tr)},maximize(Tr){this.setMaximize(Tr),this.emitEvent("maximize",{state:Tr})}},mounted(){this.width?this.width!=="auto"&&typeof this.width!="number"&&(this.w=this.$el.clientWidth):this.w=this.$el.parentElement.clientWidth,this.height?this.height!=="auto"&&typeof this.height!="number"&&(this.h=this.$el.clientHeight):this.h=this.$el.parentElement.clientHeight,typeof this.left!="number"&&(this.l=this.$el.offsetLeft-this.$el.parentElement.offsetLeft),typeof this.top!="number"&&(this.t=this.$el.offsetTop-this.$el.parentElement.offsetTop),this.minW&&this.wthis.maxW&&(this.w=this.maxW),this.maxH&&this.h>this.maxH&&(this.h=this.maxH),this.setMaximize(this.maximize),this.disableAttributes.forEach(Tr=>{switch(Tr){case"l":this.calcMap&=~CALC_MASK.l;break;case"t":this.calcMap&=~CALC_MASK.t;break;case"w":this.calcMap&=~CALC_MASK.w;break;case"h":this.calcMap&=~CALC_MASK.h}}),document.documentElement.addEventListener("mousemove",this.handleMove,!0),document.documentElement.addEventListener("mousedown",this.handleDown,!0),document.documentElement.addEventListener("mouseup",this.handleUp,!0),document.documentElement.addEventListener("touchmove",this.handleMove,!0),document.documentElement.addEventListener("touchstart",this.handleDown,!0),document.documentElement.addEventListener("touchend",this.handleUp,!0),this.emitEvent("mount")},beforeUnmount(){document.documentElement.removeEventListener("mousemove",this.handleMove,!0),document.documentElement.removeEventListener("mousedown",this.handleDown,!0),document.documentElement.removeEventListener("mouseup",this.handleUp,!0),document.documentElement.removeEventListener("touchmove",this.handleMove,!0),document.documentElement.removeEventListener("touchstart",this.handleDown,!0),document.documentElement.removeEventListener("touchend",this.handleUp,!0),this.emitEvent("destroy")},methods:{setMaximize(Tr){const Cr=this.$el.parentElement;Tr?(this.prevState={w:this.w,h:this.h,l:this.l,t:this.t},this.t=this.l=0,this.w=Cr.clientWidth,this.h=Cr.clientHeight):this.restoreSize()},restoreSize(){this.prevState&&(this.l=this.prevState.l,this.t=this.prevState.t,this.h=this.prevState.h,this.w=this.prevState.w)},setupDragElements(Tr){this.$el.querySelectorAll(".drag-el").forEach(Ar=>{Ar.classList.remove("drag-el")});const $r=this.$el.querySelectorAll(Tr);$r.forEach(Ar=>{Ar.classList.add("drag-el")}),this.dragElements=Array.prototype.slice.call($r)},emitEvent(Tr,Cr){this.$emit(Tr,{eventName:Tr,left:this.l,top:this.t,width:this.w,height:this.h,cmp:this,...Cr})},handleMove(Tr){if(this.resizeState!==0){this.dragState||(Number.isNaN(this.w)&&(this.w=this.$el.clientWidth),Number.isNaN(this.h)&&(this.h=this.$el.clientHeight));let Cr,$r;if(Tr.touches&&Tr.touches.length>=0?(Cr=Tr.touches[0].clientY,$r=Tr.touches[0].clientX):(Cr=Tr.clientY,$r=Tr.clientX),this.maximize&&this.prevState){const Nr=this.parent.width,Lr=this.parent.height;this.restoreSize(),this.prevState=void 0,this.t=Cr>Lr/2?Lr-this.h:0,this.l=$r>Nr/2?Nr-this.w:0,this.emitEvent("maximize",{state:!1})}let Ar=$r-this.mouseX+this.offsetX,Rr=Cr-this.mouseY+this.offsetY;const Dr=this.$el.getBoundingClientRect(),Mr=this.$el.parentElement.getBoundingClientRect();if(Dr){const Nr=Dr.width/this.$el.offsetWidth||1,Lr=Dr.height/this.$el.offsetHeight||1;Ar/=Nr,Rr/=Lr}if(Ar*=this.scale,Rr*=this.scale,this.offsetX=this.offsetY=0,Dr&&Mr&&this.resizeState){const{left:Nr,top:Lr,right:Hr,bottom:zr}=Dr,Ur=this.$el.parentElement.getBoundingClientRect(),{left:Vr,top:jr,right:Gr,bottom:Xr}=Ur;!this.dragState&&this.w+Arthis.maxW&&(!this.fitParent||this.w+this.lthis.parent.width&&(this.offsetX=Ar-(Ar=this.parent.width-this.l-this.w)),Hr+Arthis.maxW&&this.l>=0?this.offsetX=Ar-(Ar=this.w-this.maxW):this.fitParent&&this.l+Ar<0&&(this.offsetX=Ar-(Ar=-this.l)),Vrthis.maxH&&(!this.fitParent||this.h+this.tthis.parent.height&&(this.offsetY=Rr-(Rr=this.parent.height-this.t-this.h)),zr+Rrthis.maxH&&this.t>=0?this.offsetY=Rr-(Rr=this.h-this.maxH):this.fitParent&&this.t+Rr<0&&(this.offsetY=Rr-(Rr=-this.t)),jr=1?(this.mouseX=Tr.touches[0].clientX,this.mouseY=Tr.touches[0].clientY):(Tr.preventDefault&&Tr.preventDefault(),this.mouseX=Tr.clientX,this.mouseY=Tr.clientY),this.offsetX=this.offsetY=0,this.resizeState=this.disableResizing?0:ELEMENT_MASK[$r].bit,this.parent.height=this.$el.parentElement.clientHeight,this.parent.width=this.$el.parentElement.clientWidth;const Ar=this.dragState?"drag:start":"resize:start";if(Ar==="resize:start"&&this.disableResizing)break;this.emitEvent(Ar);break}}},handleUp(){if(this.resizeState!==0){this.resizeState=0,document.body.style.cursor="";const Tr=this.dragState?"drag:end":"resize:end";this.emitEvent(Tr),this.dragState=!1}}}},_hoisted_1$G={class:"drag-el"};function _sfc_render$b(Tr,Cr,$r,Ar,Rr,Dr){return openBlock(),createElementBlock("div",{ref:"parent",class:"resizable-component",style:normalizeStyle(Dr.style)},[createBaseVNode("div",_hoisted_1$G,[renderSlot(Tr.$slots,"default",{},void 0,!0)]),(openBlock(!0),createElementBlock(Fragment$1,null,renderList($r.active,Mr=>withDirectives((openBlock(),createElementBlock("div",{key:Mr,class:normalizeClass("resizable-"+Mr)},null,2)),[[vShow,!$r.maximize]])),128)),$r.isVisible?(openBlock(),createElementBlock(Fragment$1,{key:0},[createBaseVNode("div",{class:"rounded-full absolute outline-2 outline-[#AB67FF] outline bg-white",style:normalizeStyle([Dr.cornerDims,{left:Dr.cornerPosition,top:Dr.cornerPosition}])},null,4),createBaseVNode("div",{class:"rounded-full absolute outline-2 outline-[#AB67FF] outline bg-white",style:normalizeStyle([Dr.cornerDims,{right:Dr.cornerPosition,top:Dr.cornerPosition}])},null,4),createBaseVNode("div",{class:"rounded-full absolute outline-2 outline-[#AB67FF] outline bg-white",style:normalizeStyle([Dr.cornerDims,{left:Dr.cornerPosition,bottom:Dr.cornerPosition}])},null,4),createBaseVNode("div",{class:"rounded-full absolute outline-2 outline-[#AB67FF] outline bg-white",style:normalizeStyle([Dr.cornerDims,{right:Dr.cornerPosition,bottom:Dr.cornerPosition}])},null,4)],64)):createCommentVNode("",!0)],4)}const Resizer=_export_sfc(_sfc_main$_,[["render",_sfc_render$b],["__scopeId","data-v-c96e6eaf"]]),queryHref=async Tr=>{const Cr=useAppStore();if(Tr.startsWith("prezo:")){const $r=Tr.slice(6);if(!Cr.hyperlinkedDecks[$r]){const{data:Ar,error:Rr}=await getHref$1({deckId:$r});if(Rr)return console.error(Rr),Tr;Cr.addToHyperlinkedDecks(Ar)}return Cr.hyperlinkedDecks[$r]}return Tr},SliderNew_vue_vue_type_style_index_0_scoped_38e90d6b_lang="",_sfc_main$Z={name:"Slider",emits:["update:modelValue","did-change"],props:{min:{type:Number,default:0},max:{type:Number,default:10},step:{type:Number,default:1},modelValue:Number,showLabels:{type:Boolean,default:!0},accentColor:String},setup(Tr){return{scalePercentage:computed(()=>`${102*((Tr.modelValue-Tr.min)/(Tr.max-Tr.min))}px`)}},computed:{localValue:{get(){return this.modelValue},set(Tr){this.$emit("update:modelValue",parseFloat(Tr))}},containerStyle(){return{accentColor:this.accentColor||this.appTheme.palette.primary[500]}}},methods:{handleChange(Tr){this.localValue=parseFloat(Tr.target.value),this.$emit("did-change",parseFloat(Tr.target.value))}}},__injectCSSVars__$3=()=>{useCssVars(Tr=>({"55d20075":Tr.scalePercentage,"1f2e53ac":Tr.accentColor}))},__setup__$3=_sfc_main$Z.setup;_sfc_main$Z.setup=__setup__$3?(Tr,Cr)=>(__injectCSSVars__$3(),__setup__$3(Tr,Cr)):__injectCSSVars__$3;const _hoisted_1$F={class:"flex flex-col items-center"},_hoisted_2$y={key:0,class:"text-[#000]"},_hoisted_3$q={key:0,class:"text-[#000]"},_hoisted_4$m={class:"slider-wrapper"},_hoisted_5$h={class:"slider-track"},_hoisted_6$g=["min","max","step"],_hoisted_7$d={key:1};function _sfc_render$a(Tr,Cr,$r,Ar,Rr,Dr){return openBlock(),createElementBlock("div",_hoisted_1$F,[$r.showLabels?(openBlock(),createElementBlock("label",_hoisted_2$y,toDisplayString(Dr.localValue),1)):createCommentVNode("",!0),createBaseVNode("div",{class:"flex items-center justify-center gap-2",style:normalizeStyle(Dr.containerStyle)},[$r.showLabels?(openBlock(),createElementBlock("label",_hoisted_3$q,toDisplayString($r.min),1)):createCommentVNode("",!0),createBaseVNode("div",_hoisted_4$m,[createBaseVNode("div",_hoisted_5$h,[withDirectives(createBaseVNode("input",{type:"range",min:$r.min,max:$r.max,step:$r.step,"onUpdate:modelValue":Cr[0]||(Cr[0]=Mr=>Dr.localValue=Mr),class:"slider",onChange:Cr[1]||(Cr[1]=Mr=>Dr.handleChange(Mr))},null,40,_hoisted_6$g),[[vModelText,Dr.localValue]])])]),$r.showLabels?(openBlock(),createElementBlock("label",_hoisted_7$d,toDisplayString($r.max),1)):createCommentVNode("",!0)],4)])}const Slider=_export_sfc(_sfc_main$Z,[["render",_sfc_render$a],["__scopeId","data-v-38e90d6b"]]),BUFFER=20,_sfc_main$Y=defineComponent({__name:"StyledPopOver3",props:{teleportTo:{default:"#main-app"},styleProps:{},popupOverrideSelector:{default:null},contentOpen:{type:Boolean,default:!1}},emits:["close","click-popover-override"],setup(Tr,{emit:Cr}){useCssVars(Io=>({a0305bcc:uo.value}));const $r=Cr,Ar={popoverButtonHeight:"36px",popoverMaxHeight:void 0,popoverWidth:36,preferShowAbove:!1,static:!1,panelBorder:"1px solid rgba(0, 0, 0, 0.08)",panelBorderRadius:"8px",panelOverFlow:"hidden auto",menuYGap:0,buttonBackground:"hsl(216, 0%, 100%)",panelBackground:"hsl(216, 0%, 100%)",animationDirection:"right",translateX:0,alignToBtnRight:!1,alignToBtnLeft:!1,positionOverride:{}},Rr=Tr,Dr=ref(0),Mr=ref(null),Br=ref({top:0,left:0}),Nr=ref(!1),Lr=ref(),{top:Hr,bottom:zr,left:Ur,right:Vr,width:jr,height:Gr,update:Xr}=useElementBounding$1(Mr),Kr=computed(()=>{const{styleProps:Io}=Rr;return Io?(Object.entries(Ar).forEach(([To,Co])=>{To in Io||(Io[To]=Co)}),Io):Ar}),Zr=computed(()=>Kr.value.popoverButtonHeight),eo=computed(()=>({marginRight:0,marginLeft:0,marginTop:0,marginBottom:0})),Wr=computed(()=>Kr.value.popoverMaxHeight??Dr.value),Yr=computed(()=>Kr.value.popoverWidth),Jr=computed(()=>Kr.value.preferShowAbove),no=useWindowSize(),ro=computed(()=>Kr.value.static),so=theme.appTheme(),ao=computed(()=>Kr.value.panelBorder),lo=computed(()=>Kr.value.panelBorderRadius),po=computed(()=>Kr.value.panelOverFlow),go=computed(()=>Kr.value.menuYGap),co=computed(()=>Kr.value.buttonBackground),mo=computed(()=>Kr.value.panelBackground),io=computed(()=>Kr.value.animationDirection),uo=computed(()=>io.value==="right"?`${jr.value}px`:"0px"),ho=computed(()=>Kr.value.translateX),yo=computed(()=>Hr.value-Wr.value-BUFFER>0),So=computed(()=>zr.value+Wr.value+BUFFERVr.value-Yr.value-BUFFER>0),$o=computed(()=>Ur.value+Yr.value+BUFFERHr.value-BUFFER),No=computed(()=>no.height.value-zr.value-BUFFER),Eo=computed(()=>Kr.value.alignToBtnRight&&ko.value),Mo=computed(()=>Kr.value.alignToBtnLeft&&$o.value),Ro=computed(()=>!So.value||Jr.value&&yo.value),Ao=()=>{var Co,Po;if(!yo.value&&!So.value){const Fo={};return Go.value>No.value?(Fo.top=`${Hr.value+eo.value.marginTop-go.value}px`,Fo.transform="translateY(-100%)",Fo.maxHeight=`${Go.value-go.value}px`):(Fo.top=`${Math.max(16,zr.value-eo.value.marginBottom+go.value)}px`,Fo.maxHeight=`${No.value-go.value}px`),ko.value?Fo.left=`${Vr.value-Yr.value}px`:Fo.left=`${Ur.value}px`,Fo}let Io={};const To={left:Ur.value,right:no.width.value-Vr.value,elementWidth:jr.value,elementTop:Math.floor(Hr.value+Gr.value/2)};return Ro.value?(To.top=Hr.value+eo.value.marginTop-go.value,Io={transform:"translateY(-100%)"}):To.top=zr.value-eo.value.marginBottom+go.value,Eo.value?{...Io,top:`${To.top}px`,right:((Co=Kr.value.positionOverride)==null?void 0:Co.right)??`${To.right+ho.value}px`}:Mo.value?{...Io,top:`${To.top}px`,left:((Po=Kr.value.positionOverride)==null?void 0:Po.left)??`${To.left+ho.value}px`}:{...Io,top:`${To.top}px`,left:`${Ur.value+jr.value/2-Yr.value/2}px`}},zo=computed(()=>Rr.contentOpen||!ro.value?{}:{display:"none"});onClickOutside(Lr,Io=>{if(Rr.popupOverrideSelector==null)return;[...document.querySelectorAll(Rr.popupOverrideSelector)].some(Po=>Po.contains(Io.target))?(Io.stopPropagation(),$r("click-popover-override",Io.target)):ro.value&&$r("close",Io.target)});const Oo=()=>{Nr.value=!0},Bo=()=>{Nr.value=!1},bo=()=>{Xr(),setTimeout(()=>{var Io;Dr.value=((Io=document.querySelector(".popover-3"))==null?void 0:Io.getBoundingClientRect().height)??0,Br.value=Ao()},100)},vo=()=>{var Io;ro.value&&((Io=document.activeElement)==null||Io.blur(),$r("close"))};return watch([Hr,zr,Ur,Vr,jr,Gr],()=>{nextTick(()=>{Br.value=Ao()})}),(Io,To)=>(openBlock(),createBlock(unref(Pe),{style:{position:"relative"}},{default:withCtx(({open:Co,close:Po})=>[createBaseVNode("div",{ref_key:"el",ref:Mr,style:{position:"relative",width:"100%"}},[createVNode(unref(Be),{onClick:bo,style:normalizeStyle({fontFamily:"inherit",background:co.value,padding:0,height:Zr.value,width:"100%",marginLeft:"auto",borderRadius:unref(so).borderRadius.large,border:"none",fontSize:unref(so).fontSize.f4,display:"flex",alignItems:"center",gap:unref(so).spacing.s2}),onKeydown:withKeys(withModifiers(vo,["stop"]),["esc"])},{default:withCtx(()=>[renderSlot(Io.$slots,"button",{open:Co,close:Po},void 0,!0)]),_:2},1032,["style","onKeydown"])],512),(openBlock(),createBlock(Teleport,{to:Io.teleportTo},[createVNode(Transition,{name:"fade",onAfterEnter:Oo,onAfterLeave:Bo},{default:withCtx(()=>[createVNode(unref(He),{static:ro.value,ref_key:"popoverRef",ref:Lr,class:"headless-tracker popover-3",style:normalizeStyle({background:mo.value,boxShadow:"0px 20px 32px rgba(0, 0, 0, 0.06)",border:ao.value,borderRadius:lo.value,position:"absolute",zIndex:100,overflow:po.value,...Br.value,...zo.value}),onKeydown:withKeys(withModifiers(vo,["stop"]),["esc"]),tabindex:"-1"},{default:withCtx(()=>[renderSlot(Io.$slots,"content",{close:Po,open:Co},void 0,!0)]),_:2},1032,["static","style","onKeydown"])]),_:2},1024)],8,["to"]))]),_:3}))}}),StyledPopOver3_vue_vue_type_style_index_0_scoped_775e205f_lang="",StyledPopOver3=_export_sfc(_sfc_main$Y,[["__scopeId","data-v-775e205f"]]),_hoisted_1$E=["value","readonly","placeholder","spellcheck"],_sfc_main$X=defineComponent({__name:"TextareaFitContent",props:{content:{},editable:{type:Boolean},placeholder:{},minHeight:{default:0},customStyle:{default:()=>({})},spellcheck:{type:Boolean}},emits:["update:content","update:scrollHeight"],setup(Tr,{expose:Cr,emit:$r}){const Ar=Tr,Rr=$r,Dr=ref(),Mr=ref(0),{focused:Br}=useFocusWithin(Dr),Nr=Hr=>{var zr;Rr("update:content",(zr=Hr.target)==null?void 0:zr.value)},Lr=()=>{Dr.value&&(Mr.value=Dr.value.scrollHeight)};return watch(()=>Ar.minHeight,Hr=>{Dr.value.style.height="0px",Dr.value.style.height=`${Math.max(Dr.value.scrollHeight,Hr)}px`}),watch(Mr,Hr=>{Rr("update:scrollHeight",Hr)}),watch(()=>Ar.content,()=>{Lr()}),onMounted(()=>{Lr()}),Cr({el:Dr}),(Hr,zr)=>(openBlock(),createElementBlock("textarea",{ref_key:"textareaEl",ref:Dr,class:normalizeClass(["w-full resize-none bg-transparent hide-scrollbar",{"placeholder:text-neutralSolid-400":unref(Br)&&Hr.editable}]),value:Ar.content,onInput:Nr,readonly:!Hr.editable,placeholder:Hr.placeholder,style:normalizeStyle(Hr.customStyle),spellcheck:Hr.spellcheck},` `,46,_hoisted_1$E))}}),_hoisted_1$D={class:"flex flex-col gap-0.5"},_hoisted_2$x=["type","value","readonly","placeholder"],_hoisted_3$p={key:0,class:"text-[#DB3033] text-[11px]"},_hoisted_4$l={key:1,class:"text-neutralSolid-500 text-[11px]"},_sfc_main$W=defineComponent({__name:"DesignLibraryInput",props:{content:{},placeholder:{},disabled:{type:Boolean,default:!1},textareaStyle:{default:()=>({})},wrapperStyle:{default:()=>({})},supportingText:{},errorText:{},inputType:{default:"textarea"},focusOnMount:{type:Boolean,default:!1},innerInputType:{default:"text"}},emits:["update:content"],setup(Tr,{expose:Cr,emit:$r}){useCssVars(Ur=>({"132bfa4c":Hr.value}));const Ar=Tr,Rr=$r,Dr=useAppStore(),Mr=ref(),Br=ref(),{focused:Nr}=useFocusWithin(Mr),{currentAppId:Lr}=inject("currentAppId"),Hr=computed(()=>Dr.deckThemeValue(Lr.value)),zr=Ur=>{Rr("update:content",Ur)};return onMounted(()=>{Ar.focusOnMount&&Br.value&&Br.value.focus()}),Cr({el:Br}),(Ur,Vr)=>(openBlock(),createElementBlock("div",_hoisted_1$D,[createBaseVNode("div",{ref_key:"inputWrapper",ref:Mr,class:normalizeClass(["py-2.5 px-3 flex items-center justify-between rounded-lg border-[1px]",{"border-neutralSolid-50 bg-neutralSolid-50":!unref(Nr)||Ur.disabled,"dynamic-border-color":unref(Nr)&&!Ur.disabled,"bg-white":unref(Nr)&&!Ur.disabled,"text-neutralSolid-400":Ur.disabled,"text-neutralSolid-600":!unref(Nr)&&!Ur.disabled}]),style:normalizeStyle([Ur.errorText?{border:"1px solid #DB3033"}:{},Ur.wrapperStyle])},[Ur.inputType==="textarea"?(openBlock(),createBlock(_sfc_main$X,{key:0,minHeight:18,content:Ur.content,editable:!Ur.disabled,placeholder:Ur.placeholder,"onUpdate:content":zr,textareaStyle:{lineHeight:1.12,...Ur.textareaStyle}},null,8,["content","editable","placeholder","textareaStyle"])):(openBlock(),createElementBlock("input",{key:1,type:Ur.innerInputType,ref_key:"inputEl",ref:Br,class:normalizeClass(["w-full bg-transparent",{"placeholder:text-neutralSolid-500":unref(Nr)&&!Ur.disabled,"placeholder:text-neutralSolid-600":!unref(Nr)&&!Ur.disabled}]),value:Ur.content,onInput:Vr[0]||(Vr[0]=jr=>{jr.target&&zr(jr.target.value)}),readonly:Ur.disabled,placeholder:Ur.placeholder,spellcheck:"false"},null,42,_hoisted_2$x)),renderSlot(Ur.$slots,"right",{},void 0,!0)],6),Ur.errorText?(openBlock(),createElementBlock("p",_hoisted_3$p,toDisplayString(Ur.errorText),1)):Ur.supportingText?(openBlock(),createElementBlock("p",_hoisted_4$l,toDisplayString(Ur.supportingText),1)):createCommentVNode("",!0)]))}}),DesignLibraryInput_vue_vue_type_style_index_0_scoped_38388b65_lang="",DesignLibraryInput=_export_sfc(_sfc_main$W,[["__scopeId","data-v-38388b65"]]),_hoisted_1$C={class:"flex items-start gap-1"},_hoisted_2$w=["onClick"],_hoisted_3$o={class:"custom-truncate h-full flex items-center"},_hoisted_4$k={key:0,class:"flex items-center h-[17px] px-1 bg-[#F3E8FD] rounded border border-[#AB67FF]"},_hoisted_5$g=createBaseVNode("label",{class:"uppercase truncate text-[#AB67FF] text-[10px]"},"pro",-1),_hoisted_6$f=[_hoisted_5$g],_hoisted_7$c={key:0,class:"flex flex-col justify-end items-start self-stretch h-2 px-2"},_sfc_main$V=defineComponent({__name:"Tabs",props:{currTabId:{},tabs:{},activeColor:{},isSizeBase:{type:Boolean,default:!1}},emits:["click"],setup(Tr,{emit:Cr}){const $r=Tr,Ar=Cr,Rr=Dr=>Dr===$r.currTabId;return(Dr,Mr)=>(openBlock(),createElementBlock("div",_hoisted_1$C,[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Dr.tabs,(Br,Nr)=>(openBlock(),createElementBlock("div",{class:"group flex flex-col items-start",key:Nr},[createBaseVNode("button",{onClick:()=>Ar("click",Nr),class:normalizeClass(["flex items-center px-2 py-1 gap-1 rounded-lg hover:bg-neutral-50 active:bg-neutral-100",{"h-8":Dr.isSizeBase,"h-[28px]":!Dr.isSizeBase}])},[createBaseVNode("div",_hoisted_3$o,[createBaseVNode("label",{class:normalizeClass(["font-medium truncate cursor-pointer",{"text-sm":!Dr.isSizeBase,"text-base":Dr.isSizeBase,"text-black":Rr(Br.id),"text-neutralSolid-500":!Rr(Br.id)}])},toDisplayString(Br.label),3)]),Br.showProTag?(openBlock(),createElementBlock("div",_hoisted_4$k,_hoisted_6$f)):createCommentVNode("",!0)],10,_hoisted_2$w),Rr(Br.id)?(openBlock(),createElementBlock("div",_hoisted_7$c,[createBaseVNode("div",{class:"h-0.5 shrink-0 self-stretch",style:normalizeStyle({background:Dr.activeColor})},null,4)])):createCommentVNode("",!0)]))),128))]))}}),_hoisted_1$B={key:0,class:"hidden"},_hoisted_2$v={class:"translate-y-[0.5px]"},_sfc_main$U=defineComponent({__name:"AppLogo",props:{deckId:{},size:{default:24},name:{},customColor:{},showFallback:{type:Boolean,default:!0},useThickStroke:{type:Boolean}},setup(Tr){const Cr=Tr,$r=inject("isMobile"),Ar=inject("selectedPageId"),Rr=useAppStore(),Dr=usePageStore(),Mr=computed(()=>{var Gr;return(Gr=Rr.config(Cr.deckId).customDeckLogo)==null?void 0:Gr.value}),Br=computed(()=>Mr.value?Mr.value.startsWith("http"):!1),Nr=computed(()=>Mr.value&&allEmojis[Mr.value]||""),Lr=computed(()=>Rr.getThemeObject(Cr.deckId,Ar.value||"")),Hr=computed(()=>Dr.isDividerSlide(Ar.value||"")),zr=computed(()=>Rr.deckTheme(Cr.deckId)),Ur=computed(()=>Hr.value&&zr.value!=="yellow"),Vr=computed(()=>{var Gr,Xr;if(Cr.customColor)return Cr.customColor;if($r.value)return"#0D0C0C";const jr=Ur.value?.6:.3;return theme.addOpacityToColor(((Xr=(Gr=Lr.value)==null?void 0:Gr.artboard)==null?void 0:Xr.color)||"#0D0C0C",jr)});return(jr,Gr)=>(Mr.value===""||Mr.value==null)&&!jr.showFallback?(openBlock(),createElementBlock("div",_hoisted_1$B)):(Mr.value===""||Mr.value==null)&&jr.showFallback?(openBlock(),createBlock(_sfc_main$1v,{key:1,src:unref(assetUrl)(jr.useThickStroke?"icon-file.svg":"icon-file-name.svg"),vProps:{width:jr.size,height:jr.size,[jr.useThickStroke?"nestedFill":"stroke"]:Vr.value},style:{borderRadius:"4px"}},null,8,["src","vProps"])):Br.value?(openBlock(),createBlock(_sfc_main$1r,{key:2,avatarUrl:Mr.value,name:jr.name,style:normalizeStyle({width:`${jr.size}px`,height:`${jr.size}px`})},null,8,["avatarUrl","name","style"])):(openBlock(),createElementBlock("div",{key:3,class:"flex items-center justify-center rounded-[4px] leading-[1] align-middle",style:normalizeStyle({width:`${jr.size}px`,height:`${jr.size}px`,fontSize:`${jr.size}px`}),tabindex:"-1"},[createBaseVNode("div",_hoisted_2$v,toDisplayString(Nr.value),1)],4))}});function formattedTimeBetween(Tr,Cr){const $r=hooks(Tr),Ar=hooks(Cr),Rr=["years","months","weeks","days","hours","minutes"];for(const Dr of Rr){const Mr=Ar.diff($r,Dr);if(Mr>0)return`${Mr} ${Mr===1?Dr.slice(0,-1):Dr} ago`}return"just now"}function formattedTimeBetweenforMobile(Tr,Cr){const $r=hooks(Tr),Ar=hooks(Cr),Rr=["years","months","weeks","days","hours","minutes"],Dr={years:"y",months:"mo",weeks:"w",days:"d",hours:"h",minutes:"m"};for(const Mr of Rr){const Br=Ar.diff($r,Mr);if(Br>0)return`${Br}${Dr[Mr]} ago`}return"Just now"}const _hoisted_1$A={key:0,class:"text-sm font-medium py-1 px-2 text-[#9E9E9E]"},_hoisted_2$u=["onClick","onMouseover","onMouseleave"],_hoisted_3$n={class:"text-sm font-medium text-[#9E9E9E] cursor-pointer"},_hoisted_4$j=["id","href","onMouseover"],_hoisted_5$f=["id","onMouseover"],_hoisted_6$e={class:"flex items-center gap-2 flex-1 shrink"},_hoisted_7$b={class:"text-[14px] leading-[18.36px] font-[400] text-[#0D0C0C] ellipsis"},_hoisted_8$8={class:"text-[14px] leading-[18.36px] font-[400] text-[#9E9E9E] ellipsis"},_hoisted_9$8={key:0,class:"ml-auto text-[#9E9E9E] text-[12px] font-[500] shrink-0 self-start"},_hoisted_10$7=["id","onMouseover"],_hoisted_11$4={class:"flex items-center gap-2 flex-1 shrink"},_hoisted_12$4={class:"text-[14px] leading-[18.36px] font-[400] text-[#0D0C0C] ellipsis"},_hoisted_13$4={class:"text-[14px] leading-[18.36px] font-[400] text-[#9E9E9E] ellipsis"},_hoisted_14$4={key:0,class:"ml-auto text-[#9E9E9E] text-[12px] font-[500] shrink-0 self-start"},_sfc_main$T=defineComponent({__name:"PrezoSearch",props:{searchTerm:{},wrapperStyle:{default:()=>({})},scrollerStyle:{default:()=>({})},searchResultStyle:{default:()=>({content:{}})},resultsLimit:{},hoveredIndex:{},blockMouseHover:{type:Boolean},onClickSearchRes:{},from:{}},emits:["update:hover"],setup(Tr,{expose:Cr,emit:$r}){const Ar=$r,Rr=Tr,{searchTerm:Dr}=toRefs$1(Rr),Mr=useAppStore(),Br=ref([]),Nr=ref({workspace:{open:!0,hovered:!1},private:{open:!0,hovered:!1}}),Lr=computed(()=>Rr.from==="home"),Hr=computed(()=>Rr.from==="home"),zr=computed(()=>Rr.from==="home"),Ur=computed(()=>[...Br.value].sort((co,mo)=>Date.parse(mo.updated_at)-Date.parse(co.updated_at))),{results:Vr}=useFuse(Dr,Ur,{fuseOptions:{keys:[{name:"title",weight:1},{name:"subtitle",weight:1},{name:"timestamp",weight:1}],includeScore:!0},matchAllWhenSearchEmpty:!0}),jr=computed(()=>Vr.value.filter(co=>co.score==null||co.score<.5).map(co=>co.item)),Gr=computed(()=>Ur.value.slice(0,3)),Xr=computed(()=>{if(Rr.searchTerm===""){if(Rr.from==="home")return[Gr.value.length>0&&{label:"Recent files",id:"recent",files:Gr.value}].filter(Boolean);const co=[{id:"recent",title:"Recent files",subtitle:"",updated_at:"",timestamp:"",href:"",size:28,is_label:!0}];return co.push(...Gr.value.map(mo=>({...mo,size:56,is_label:!1}))),co}if(jr.value.length===0)return[];if(Rr.from==="home"){const co=jr.value.filter(io=>io.access_level==="workspace"),mo=jr.value.filter(io=>io.access_level==="private");return[co.length>0&&{label:"Workspace",id:"workspace",files:jr.value.filter(io=>io.access_level==="workspace")},mo.length>0&&{label:"Private",id:"private",files:jr.value.filter(io=>io.access_level==="private")}].filter(Boolean)}return jr.value.slice(0,Rr.resultsLimit).map(co=>({...co,size:56,is_label:!1}))}),Kr=computed(()=>Xr.value.length>1),Zr=computed(()=>{const co=[];return Xr.value.forEach((mo,io)=>{if(co.push({id:mo.id,title:mo.label,subtitle:"",updated_at:"",timestamp:"",mode:void 0,access_level:void 0,href:"",size:io>0?38:28,is_label:!0}),mo.id==="workspace"||mo.id==="private"){(Nr.value[mo.id].open||!Kr.value)&&mo.files.forEach(uo=>{co.push({...uo,size:56,is_label:!1})});return}mo.files.forEach(uo=>{co.push({...uo,size:56,is_label:!1})})}),co}),eo=computed(()=>Rr.from==="home"?Xr.value.reduce((co,mo)=>[...co,...mo.files],[]):Xr.value.filter(co=>!co.is_label)),Wr=computed(()=>{var co;return(co=eo.value[Rr.hoveredIndex])==null?void 0:co.id}),Yr=co=>{co!=="workspace"&&co!=="private"||(Nr.value[co].open=!Nr.value[co].open)},Jr=co=>{co!=="workspace"&&co!=="private"||(Nr.value[co].hovered=!0)},no=co=>{co!=="workspace"&&co!=="private"||(Nr.value[co].hovered=!1)},ro=co=>co!=="workspace"&&co!=="private"?!1:Nr.value[co].hovered,so=co=>co!=="workspace"&&co!=="private"?!0:Nr.value[co].open,ao=co=>{Rr.blockMouseHover||Ar("update:hover",eo.value.findIndex(mo=>mo.id===co))},lo=()=>{Rr.blockMouseHover||Ar("update:hover",-1)},po=(co,mo)=>formattedTimeBetween(co[mo]==null?new Date:new Date(co[mo]),new Date),go=()=>{const mo=Mr.getSearchDecks().map(io=>{var uo,ho,yo;return{id:io.id,title:io.title||"Untitled",subtitle:io.parent.title??"Untitled",updated_at:io.updated_at??new Date().getTime().toString(),timestamp:po(io,"created_at"),mode:((yo=(ho=(uo=io.config)==null?void 0:uo.publishSettings)==null?void 0:ho.value)==null?void 0:yo.mode)??"slide",access_level:io.parent.access_level??"private",href:`${PATH_FOR_ARTBOARD}${io.id}`}});Br.value=mo};return watch(Dr,()=>{Ar("update:hover",0)}),onMounted(()=>{go()}),Cr({shownResultsUnwrapped:eo,allFiles:Br}),(co,mo)=>(openBlock(),createElementBlock("div",{class:"flex-1 flex flex-col w-full",style:normalizeStyle(co.wrapperStyle)},[eo.value.length>0?(openBlock(),createBlock(unref(script$2),{key:0,class:"scroller",items:co.from==="home"?Zr.value:Xr.value,buffer:300,"key-field":"id",style:normalizeStyle({width:"100%",overflow:"hidden auto",...co.scrollerStyle})},{default:withCtx(({item:io})=>[io.is_label&&(io.id==="recent"||!Kr.value)?(openBlock(),createElementBlock("p",_hoisted_1$A,toDisplayString(io.title),1)):io.is_label&&(io.id==="workspace"||io.id==="private")&&Kr.value?(openBlock(),createElementBlock("div",{key:1,class:normalizeClass(["flex items-center py-1 px-2 hover:bg-neutral-50 active:bg-neutral-100 w-fit cursor-pointer rounded-[8px]",{"mt-[10px]":io.id==="private"&&Kr.value}]),onClick:uo=>Yr(io.id),onMouseover:uo=>Jr(io.id),onMouseleave:uo=>no(io.id)},[createBaseVNode("p",_hoisted_3$n,toDisplayString(io.title),1),ro(io.id)?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)(so(io.id)?"icon-chevron-down.svg":"icon-chevron-right.svg"),vProps:{width:14,height:14,nestedFill:"#868585"},class:"ml-1 cursor-pointer"},null,8,["src"])):createCommentVNode("",!0)],42,_hoisted_2$u)):Hr.value?(openBlock(),createElementBlock("a",{key:2,id:`search-result-${io.id}`,href:io.href,target:"_blank",onMouseover:uo=>ao(io.id),onMouseleave:mo[2]||(mo[2]=uo=>lo())},[createBaseVNode("div",{class:normalizeClass(["flex items-center p-2 cursor-pointer active:bg-neutral-100 rounded-[8px] w-full gap-1",{"bg-neutral-50":Wr.value===io.id}]),id:`search-result-${io.id}`,onMouseover:uo=>ao(io.id),onMouseleave:mo[0]||(mo[0]=uo=>lo()),onClick:mo[1]||(mo[1]=(...uo)=>co.onClickSearchRes&&co.onClickSearchRes(...uo))},[createBaseVNode("div",_hoisted_6$e,[createVNode(_sfc_main$U,{deckId:io.id,size:16,useThickStroke:!0,style:{flexShrink:0},customColor:"#000",class:"self-start translate-y-[1px]"},null,8,["deckId"]),createBaseVNode("div",{class:"flex flex-col gap-[2px] max-w-[420px] pr-5",style:normalizeStyle(co.searchResultStyle.content)},[createBaseVNode("p",_hoisted_7$b,toDisplayString(io.title),1),createBaseVNode("p",_hoisted_8$8,toDisplayString(io.subtitle),1)],4)]),Lr.value&&Wr.value!==io.id?(openBlock(),createElementBlock("p",_hoisted_9$8,toDisplayString(io.timestamp),1)):createCommentVNode("",!0),Wr.value===io.id?(openBlock(),createBlock(_sfc_main$1v,{key:1,src:unref(assetUrl)("icon-enter-3.svg"),vProps:{width:16,height:16,nestedFill:"#868585"},class:"self-start"},null,8,["src"])):createCommentVNode("",!0)],42,_hoisted_5$f)],40,_hoisted_4$j)):(openBlock(),createElementBlock("div",{key:3,class:normalizeClass(["flex items-center p-2 cursor-pointer active:bg-neutral-100 rounded-[8px] w-full gap-1",{"bg-neutral-50":Wr.value===io.id}]),id:`search-result-${io.id}`,onMouseover:uo=>ao(io.id),onMouseleave:mo[3]||(mo[3]=uo=>lo()),onClick:mo[4]||(mo[4]=(...uo)=>co.onClickSearchRes&&co.onClickSearchRes(...uo))},[createBaseVNode("div",_hoisted_11$4,[createVNode(_sfc_main$U,{deckId:io.id,size:16,useThickStroke:!0,style:{flexShrink:0},customColor:"#000",class:"self-start translate-y-[1px]"},null,8,["deckId"]),createBaseVNode("div",{class:"flex flex-col gap-[2px] max-w-[420px] pr-5",style:normalizeStyle(co.searchResultStyle.content)},[createBaseVNode("p",_hoisted_12$4,toDisplayString(io.title),1),createBaseVNode("p",_hoisted_13$4,toDisplayString(io.subtitle),1)],4)]),Lr.value&&Wr.value!==io.id?(openBlock(),createElementBlock("p",_hoisted_14$4,toDisplayString(io.timestamp),1)):createCommentVNode("",!0),zr.value&&Wr.value===io.id?(openBlock(),createBlock(_sfc_main$1v,{key:1,src:unref(assetUrl)("icon-enter-3.svg"),vProps:{width:16,height:16,nestedFill:"#868585"},class:"self-start"},null,8,["src"])):createCommentVNode("",!0)],42,_hoisted_10$7))]),_:1},8,["items","style"])):createCommentVNode("",!0),renderSlot(co.$slots,"postResults",{numResults:eo.value.length,numFiles:Br.value.length,searchTerm:unref(Dr)})],4))}}),_hoisted_1$z={class:"translate-y-[0.5px]"},_hoisted_2$t=["href"],linkedIconSize="16px",_sfc_main$S=defineComponent({__name:"LinkPreview",props:{savedLink:{},showBorder:{type:Boolean},wrapperStyle:{default:()=>({})}},emits:["delete:link"],setup(Tr,{emit:Cr}){const $r=Cr,Ar=Tr,Rr=useAppStore();useUserStore();const Dr=computed(()=>{var zr;const Hr=Ar.savedLink.split("prezo:");return Hr.length>1&&!Hr[0]?((zr=Rr.config(Hr[1]).customDeckLogo)==null?void 0:zr.value)??"icon-file.svg":Ar.savedLink.startsWith("tel:")?"icon-phone.svg":Ar.savedLink.startsWith("mailto:")?"icon-mail-2.svg":"icon-small-globe.svg"}),Mr=computed(()=>Dr.value?Dr.value.startsWith("http"):!1),Br=computed(()=>Dr.value&&allEmojis[Dr.value]||""),Nr=computed(()=>Ar.savedLink.startsWith("prezo:")?Rr.hyperlinkedDecks[Ar.savedLink.slice(6)]:Ar.savedLink),Lr=computed(()=>{const Hr=Ar.savedLink.split("tel:");if(Hr.length>1&&!Hr[0])return Hr[1];const zr=Ar.savedLink.split("mailto:");return zr.length>1&&!zr[0]?zr[1]:Nr.value.startsWith("https://")?Nr.value.slice(8):Nr.value});return(Hr,zr)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["link-preview three-part-btn px-3 gap-2 h-[48px] rounded-xl max-w-[320px] bg-white",{"border-neutral-100 border":Hr.showBorder}]),style:normalizeStyle([{boxShadow:"0px 16px 32px 0px rgba(0, 0, 0, 0.04)"},Hr.wrapperStyle])},[Mr.value?(openBlock(),createBlock(_sfc_main$1r,{key:0,avatarUrl:Dr.value,name:"",style:normalizeStyle({width:linkedIconSize,height:linkedIconSize})},null,8,["avatarUrl","style"])):Br.value?(openBlock(),createElementBlock("div",{key:1,class:"flex items-center justify-center rounded-[4px] leading-[1] align-middle",style:normalizeStyle({width:linkedIconSize,height:linkedIconSize,fontSize:linkedIconSize}),tabindex:"-1"},[createBaseVNode("div",_hoisted_1$z,toDisplayString(Br.value),1)],4)):(openBlock(),createBlock(_sfc_main$1v,{key:2,src:unref(assetUrl)(Dr.value),vProps:{width:20,height:20}},null,8,["src"])),createBaseVNode("a",{class:"text-sm underline decoration-inherit text-blue-100",href:Nr.value,target:"_blank"},toDisplayString(Lr.value),9,_hoisted_2$t),createVNode(Button,{onClick:zr[0]||(zr[0]=Ur=>$r("delete:link")),leftIcon:{icon:unref(assetUrl)("icon-trash-20px-1.svg")},style:{flexShrink:0,width:"28px",height:"28px",borderRadius:"8px"}},null,8,["leftIcon"])],6))}}),useSearch=({hoveredId:Tr,hoveredIndex:Cr,numResults:$r,blockMouseHover:Ar,timeoutId:Rr})=>{const Dr=()=>{const Nr=document.getElementById(`search-result-${Tr.value}`);Nr&&Nr.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})};return{handleDownKey:async Nr=>{if(Nr.preventDefault(),Cr.value===$r.value-1){Cr.value=0,await nextTick(),Dr();return}Ar.value=!0,Cr.value+=1,await nextTick(),Dr(),Rr.value&&clearTimeout(Rr.value),Rr.value=setTimeout(()=>{Ar.value=!1},1e3)},handleUpKey:async Nr=>{if(Nr.preventDefault(),Cr.value===0){Cr.value=$r.value-1,await nextTick(),Dr();return}Ar.value=!0,Cr.value-=1,await nextTick(),Dr(),Rr.value&&clearTimeout(Rr.value),Rr.value=setTimeout(()=>{Ar.value=!1},1e3)}}},_hoisted_1$y={class:"flex items-start self-stretch p-2 pb-0 border-b border-b-neutralSolid-100"},_hoisted_2$s={key:0,class:"flex flex-col items-start self-stretch gap-2 p-2 pt-0"},_hoisted_3$m={class:"flex gap-2 flex-1 shrink"},_hoisted_4$i={class:"flex flex-col gap-[2px] max-w-[260px]"},_hoisted_5$e={class:"text-[14px] leading-[18.36px] font-[400] text-[#0D0C0C] ellipsis"},_hoisted_6$d={class:"text-[14px] leading-[18.36px] font-[400] text-[#9E9E9E] ellipsis"},popoverWidth$1=320,_sfc_main$R=defineComponent({__name:"LinkBtnContent",props:{appId:{},tooltip:{},savedLink:{},close:{}},emits:["btn:click","save:link","btn:mousedown","btn:mouseup","close:popup"],setup(Tr,{emit:Cr}){const $r=Cr,Ar=Tr,Rr=[{id:"link",label:"Link"},{id:"email",label:"Email"},{id:"phone",label:"Phone"}],Dr={content:{maxWidth:"280px"}},Mr=/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?\/[a-zA-Z0-9]{2,}|((https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?)|(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})?$/,Br={padding:"8px 12px"},Nr=useAppStore(),Lr=useBlockStore(),Hr=inject("selectedBlockId"),zr=ref(""),Ur=ref(""),Vr=ref(""),jr=ref("link"),Gr=ref(0),Xr=ref(!1),Kr=ref(null),Zr=ref(),eo=computed(()=>Mr.test(zr.value)),Wr=computed(()=>{var co;return(co=Zr.value.shownResultsUnwrapped[Gr.value])==null?void 0:co.id}),Yr=computed(()=>Nr.deckThemeValue(Ar.appId)),Jr=computed(()=>Zr.value.shownResultsUnwrapped.length),no=computed(()=>{const co=Jr.value;return eo.value?co+1:co}),{handleDownKey:ro,handleUpKey:so}=useSearch({hoveredId:Wr,hoveredIndex:Gr,numResults:no,blockMouseHover:Xr,timeoutId:Kr}),ao=co=>co?(co=co.trim(),co.startsWith("http://")||co.startsWith("https://")||co.startsWith("prezo:")||co.startsWith("tel:")||co.startsWith("mailto:")||co.startsWith("ftp:")?co:`https://${co}`):"",lo=(co,mo)=>{if(!Hr.value)return;const io=ao(co);$r("save:link",io,mo),zr.value=""},po=co=>{var mo,io;jr.value==="link"?(io=(mo=Zr.value)==null?void 0:mo.shownResultsUnwrapped[Gr.value])!=null&&io.id?lo(`prezo:${Zr.value.shownResultsUnwrapped[Gr.value].id}`,co):lo(zr.value,co):jr.value==="email"?lo(`mailto:${Ur.value}`,co):jr.value==="phone"&&lo(`tel:${Vr.value}`,co),co&&co()},go=co=>{Hr.value&&(Lr.updateProps(Hr.value,{keyPath:["config","link","value"],value:null}),co&&co())};return watch([eo,zr],co=>{co&&nextTick(()=>{var mo,io;Gr.value=((io=(mo=Zr.value)==null?void 0:mo.shownResultsUnwrapped)==null?void 0:io.length)??0})}),onUnmounted(()=>{$r("close:popup")}),(co,mo)=>co.savedLink?(openBlock(),createElementBlock("div",{key:1,class:"link-wrapper-prevent-close flex flex-col items-start gap-3",style:normalizeStyle({width:`${popoverWidth$1}px`})},[createVNode(_sfc_main$S,{savedLink:co.savedLink,showBorder:!1,"onDelete:link":mo[11]||(mo[11]=io=>go(io))},null,8,["savedLink"])],4)):(openBlock(),createElementBlock("div",{key:0,class:"link-wrapper-prevent-close flex flex-col items-start gap-3",style:normalizeStyle({width:`${popoverWidth$1}px`})},[createBaseVNode("div",_hoisted_1$y,[createVNode(_sfc_main$V,{currTabId:jr.value,tabs:Rr,activeColor:Yr.value,onClick:mo[0]||(mo[0]=io=>jr.value=Rr[io].id)},null,8,["currTabId","activeColor"])]),createBaseVNode("div",{class:normalizeClass(["flex flex-col items-start self-stretch px-3",{"pb-3":jr.value!=="link"}])},[jr.value==="link"?(openBlock(),createBlock(DesignLibraryInput,{key:0,class:"w-full",focusOnMount:!0,content:zr.value,placeholder:"Paste link or search Prezos...",inputType:"input",wrapperStyle:Br,"onUpdate:content":mo[1]||(mo[1]=io=>zr.value=io),onKeydown:[mo[2]||(mo[2]=withKeys(()=>po(co.close),["enter"])),withKeys(unref(ro),["down"]),withKeys(unref(so),["up"])]},null,8,["content","onKeydown"])):jr.value==="email"?(openBlock(),createBlock(DesignLibraryInput,{key:1,class:"w-full",innerInputType:"email",focusOnMount:!0,content:Ur.value,placeholder:"Paste email...",inputType:"input",wrapperStyle:Br,"onUpdate:content":mo[3]||(mo[3]=io=>Ur.value=io),onKeydown:mo[4]||(mo[4]=withKeys(()=>po(co.close),["enter"]))},null,8,["content"])):(openBlock(),createBlock(DesignLibraryInput,{key:2,class:"w-full",innerInputType:"phone",focusOnMount:!0,content:Vr.value,placeholder:"Paste phone number...",inputType:"input",wrapperStyle:Br,"onUpdate:content":mo[5]||(mo[5]=io=>Vr.value=io),onKeydown:mo[6]||(mo[6]=withKeys(()=>po(co.close),["enter"]))},null,8,["content"]))],2),jr.value==="link"?(openBlock(),createElementBlock("div",_hoisted_2$s,[createVNode(_sfc_main$T,{ref_key:"prezoSearch",ref:Zr,searchTerm:zr.value,searchResultStyle:Dr,resultsLimit:5,hoveredIndex:Gr.value,blockMouseHover:Xr.value,"onUpdate:hover":mo[10]||(mo[10]=io=>Gr.value=io),onClickSearchRes:()=>po(co.close),from:"hyperlink"},{postResults:withCtx(()=>[zr.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["flex items-center p-2 rounded-[8px] gap-1",{"cursor-pointer bg-neutralSolid-50":eo.value&&Gr.value===Jr.value}]),onMouseenter:mo[7]||(mo[7]=io=>Gr.value=Jr.value),onMouseleave:mo[8]||(mo[8]=io=>Gr.value=-1),onClick:mo[9]||(mo[9]=()=>po(co.close))},[createBaseVNode("div",_hoisted_3$m,[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-small-globe.svg"),vProps:{width:16,height:16},style:{"margin-top":"2px"}},null,8,["src"]),createBaseVNode("div",_hoisted_4$i,[createBaseVNode("p",_hoisted_5$e,toDisplayString(zr.value),1),createBaseVNode("p",_hoisted_6$d,toDisplayString(eo.value?"Link to web page":"Type a complete URL to link"),1)])])],34)):createCommentVNode("",!0)]),_:1},8,["searchTerm","hoveredIndex","blockMouseHover","onClickSearchRes"])])):createCommentVNode("",!0)],4))}}),_hoisted_1$x=["onClick"],popoverWidth=320,_sfc_main$Q=defineComponent({__name:"LinkBtn",props:{appId:{},tooltip:{},savedLink:{}},emits:["btn:click","save:link","btn:mousedown","btn:mouseup","close:popup"],setup(Tr,{emit:Cr}){const $r=Cr,Ar=/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?\/[a-zA-Z0-9]{2,}|((https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?)|(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})?$/,Rr=inject("selectedBlockId"),Dr=ref(""),Mr=ref(0),Br=ref(),Nr=computed(()=>Ar.test(Dr.value)),Lr=zr=>zr?(zr=zr.trim(),zr.startsWith("http://")||zr.startsWith("https://")||zr.startsWith("prezo:")||zr.startsWith("tel:")||zr.startsWith("mailto:")||zr.startsWith("ftp:")?zr:`https://${zr}`):"",Hr=(zr,Ur)=>{if(!Rr.value)return;const Vr=Lr(zr);$r("save:link",Vr,Ur),Dr.value=""};return watch([Nr,Dr],zr=>{zr&&nextTick(()=>{var Ur,Vr;Mr.value=((Vr=(Ur=Br.value)==null?void 0:Ur.shownResultsUnwrapped)==null?void 0:Vr.length)??0})}),(zr,Ur)=>{const Vr=resolveDirective("tooltip");return openBlock(),createBlock(StyledPopOver3,{style:{height:"32px",justifyContent:"center",alignItems:"center",display:"flex"},styleProps:{preferShowAbove:!1,animationDirection:"top",buttonBackground:"transparent",menuYGap:12,popoverButtonHeight:"32px",panelBorderRadius:"12px",popoverMaxHeight:447,popoverWidth},popupOverrideSelector:".popoverOverride"},{button:withCtx(({open:jr,close:Gr})=>[withDirectives(createBaseVNode("button",{class:normalizeClass(["block-menu-icon-button active:bg-neutralSolid-100",{"bg-neutralSolid-100":zr.savedLink||jr,"hover:bg-neutralSolid-50":!zr.savedLink&&!jr}]),style:{minWidth:"32px",height:"32px"},onClick:Xr=>$r("btn:click",Gr),onMousedown:Ur[0]||(Ur[0]=Xr=>$r("btn:mousedown")),onMouseup:Ur[1]||(Ur[1]=Xr=>$r("btn:mouseup"))},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-link.svg")},null,8,["src"])],42,_hoisted_1$x),[[Vr,{content:zr.tooltip,placement:"bottom"}]])]),content:withCtx(({close:jr})=>[createVNode(_sfc_main$R,{close:jr,appId:zr.appId,tooltip:zr.tooltip,savedLink:zr.savedLink,"onSave:link":Hr,"onClose:popup":Ur[2]||(Ur[2]=Gr=>$r("close:popup"))},null,8,["close","appId","tooltip","savedLink"])]),_:1},8,["styleProps","popupOverrideSelector"])}}}),headlessCleanup=()=>{var Tr;IS_CLIENT&&((Tr=document.activeElement)!=null&&Tr.parentElement)&&document.activeElement.parentElement.focus()},APP_HEADER_HEIGHT=layout.state.appHeader.height,MAX_BLOCK_WIDTH=960,MAX_BLOCK_HEIGHT=540,H_MARGIN_OF_SAFETY=16,V_MARGIN_OF_SAFETY=16;function calculatePostionForMenuNoOverlapHorizontal({blockRect:Tr,paneRect:Cr,windowSize:$r,blockId:Ar}){const Rr=useBlockStore(),Dr=usePageStore(),Mr=useAppStore(),Br=Rr.parentId(Ar),Nr=Dr.parentId(Br);Mr.deckSpacing(Nr),Rr.positionByDisplay(Ar);let Lr=0,Hr=0;return Hr=Tr.y,Lr=Tr.x+Tr.width+4,Lr+Cr.width.value+H_MARGIN_OF_SAFETY>$r.width.value&&(Lr=Tr.x-Cr.width.value-4),Hr+Cr.height.value+V_MARGIN_OF_SAFETY>$r.height.value&&(Hr=$r.height.value-Cr.height.value-V_MARGIN_OF_SAFETY),{x:Lr,y:Hr}}function calculatePostionForMenuNoOverlapHorizontalReactive({blockRect:Tr,paneRect:Cr,windowSize:$r}){let Ar=0,Rr=0;Rr=Tr.y.value,Ar=Tr.x.value+Tr.width.value+4;let Dr=!1;Ar+Cr.width.value+H_MARGIN_OF_SAFETY>$r.width.value&&(Ar=Tr.x.value-Cr.width.value-4),Rr+Cr.height.value+V_MARGIN_OF_SAFETY>$r.height.value&&(Rr=$r.height.value-Cr.height.value-V_MARGIN_OF_SAFETY,Dr=!0);const Mr=Rr;return Rr=Math.max(Rr,V_MARGIN_OF_SAFETY),(Rr!==Mr||Rr$r.height.value&&(Hr=Tr.y-Cr.height.value-4,Hr<16&&(Hr=$r.height.value-Cr.height.value-16,Lr=Math.max(H_MARGIN_OF_SAFETY,Tr.x-Cr.width.value-H_MARGIN_OF_SAFETY))),{x:Lr,y:Hr}}function calculatePostionForMenuNoOverlapVerticalReactive({blockRect:Tr,paneRect:Cr,windowSize:$r}){let Ar=0,Rr=0;return Rr=Tr.y.value+Tr.height.value+4,Ar=Tr.x.value,Rr+Cr.height.value+16>$r.height.value&&(Rr=Tr.y.value-Cr.height.value-4,Rr<16&&(Rr=$r.height.value-Cr.height.value-16,Ar=Math.max(H_MARGIN_OF_SAFETY,Tr.x.value-Cr.width.value-H_MARGIN_OF_SAFETY))),{x:Ar,y:Rr}}function calculatePostionForMenuOnTop({blockRect:Tr,paneRect:Cr,windowSize:$r,blockId:Ar,gap:Rr=4,hAlign:Dr="center"}){const Mr=useBlockStore(),Br=usePageStore(),Nr=useAppStore(),Lr=Mr.parentId(Ar),Hr=Br.parentId(Lr);Nr.deckSpacing(Hr),Mr.positionByDisplay(Ar);let zr=0,Ur=0;return Ur=Tr.y-Rr,Dr==="center"?zr=Tr.x+Tr.width/2:Dr==="left"?zr=Tr.x:zr=Tr.x+Tr.width,Dr==="center"?(zr+Cr.width.value/2+H_MARGIN_OF_SAFETY>$r.width.value?(log({x:zr,windowWidth:$r.width.value,paneWidth:Cr.width.value}),zr=Math.max($r.width.value-Cr.width.value/2-H_MARGIN_OF_SAFETY,H_MARGIN_OF_SAFETY+Cr.width.value/2)):zr-Cr.width.value/2-H_MARGIN_OF_SAFETY<0&&(zr=H_MARGIN_OF_SAFETY+Cr.width.value/2),{x:zr,y:Ur}):Dr==="left"?(zr+Cr.width.value+H_MARGIN_OF_SAFETY>$r.width.value?(log({x:zr,windowWidth:$r.width.value,paneWidth:Cr.width.value}),zr=Math.max($r.width.value-Cr.width.value-H_MARGIN_OF_SAFETY,H_MARGIN_OF_SAFETY)):zr-H_MARGIN_OF_SAFETY<0&&(zr=H_MARGIN_OF_SAFETY),{x:zr,y:Ur}):Dr==="right"?(zr+H_MARGIN_OF_SAFETY>$r.width.value?(log({x:zr,windowWidth:$r.width.value,paneWidth:Cr.width.value}),zr=Math.max($r.width.value-H_MARGIN_OF_SAFETY,H_MARGIN_OF_SAFETY)):zr-Cr.width.value-H_MARGIN_OF_SAFETY<0&&(zr=H_MARGIN_OF_SAFETY+Cr.width.value),{x:zr,y:Ur}):{x:zr,y:Ur}}function calculatePostionForMenuOnTopReactive({blockRect:Tr,paneRect:Cr,limitingRect:$r,windowSize:Ar,blockId:Rr,gap:Dr=4,hAlign:Mr="center"}){const Br=useBlockStore(),Nr=usePageStore(),Lr=useAppStore(),Hr=Br.parentId(Rr),zr=Nr.parentId(Hr);Lr.deckSpacing(zr),Br.positionByDisplay(Rr);let Ur=0,Vr=0,jr=0,Gr=!1;return Vr=Tr.y.value-Dr,jr=Vr,$r?(Vr=Math.max(Vr,$r.y.value-Dr),Vr=Math.min(Vr,$r.bottom.value+Dr+Cr.height.value)):(Vr=Math.max(Vr,APP_HEADER_HEIGHT),Vr=Math.min(Vr,Ar.height.value-16),(Vr!==jr||VrAr.width.value?(log({x:Ur,windowWidth:Ar.width.value,paneWidth:Cr.width.value}),Ur=Math.max(Ar.width.value-Cr.width.value/2-H_MARGIN_OF_SAFETY,H_MARGIN_OF_SAFETY+Cr.width.value/2)):Ur-Cr.width.value/2-H_MARGIN_OF_SAFETY<0&&(Ur=H_MARGIN_OF_SAFETY+Cr.width.value/2),{x:Ur,y:Vr,isClampedY:Gr}):Mr==="left"?(Ur+Cr.width.value+H_MARGIN_OF_SAFETY>Ar.width.value?(log({x:Ur,windowWidth:Ar.width.value,paneWidth:Cr.width.value}),Ur=Math.max(Ar.width.value-Cr.width.value-H_MARGIN_OF_SAFETY,H_MARGIN_OF_SAFETY)):Ur-H_MARGIN_OF_SAFETY<0&&(Ur=H_MARGIN_OF_SAFETY),{x:Ur,y:Vr,isClampedY:Gr}):Mr==="right"?(Ur+H_MARGIN_OF_SAFETY>Ar.width.value?(log({x:Ur,windowWidth:Ar.width.value,paneWidth:Cr.width.value}),Ur=Math.max(Ar.width.value-H_MARGIN_OF_SAFETY,H_MARGIN_OF_SAFETY)):Ur-Cr.width.value-H_MARGIN_OF_SAFETY<0&&(Ur=H_MARGIN_OF_SAFETY+Cr.width.value),{x:Ur,y:Vr,isClampedY:Gr}):{x:Ur,y:Vr}}const colorButtons={basic:["#FFFFFF","#181818"],pale:["#F3F3F3","#FBF3DB","#EDF3EC","#E7F3F8","#E1F1FF","#EDE7F6","#FDEBEC"],bright:["#E1772C","#19835E","#1A558C","#426EE1","#8242E1","#D83A3A"]},colorKeys=Object.keys(colorButtons),colorMap={"#FFFFFF":"White","#181818":"Black","#F3F3F3":"Grey","#FBF3DB":"Yellow","#EDF3EC":"Green","#E7F3F8":"Light blue","#E1F1FF":"Light cyan","#EDE7F6":"Lavender","#FDEBEC":"Light red","#E1772C":"Orange","#19835E":"Green","#1A558C":"Dark blue","#426EE1":"Blue","#8242E1":"Purple","#D83A3A":"Red"};function getBlockSlideEdges(Tr){const Cr=useBlockStore(),$r=usePageStore(),Ar=useAppStore(),Rr=Cr.parentId(Tr),Dr=$r.parentId(Rr),Mr=Ar.deckSpacing(Dr),Br=Cr.positionByDisplay(Tr),Nr={top:!1,bottom:!1,left:!1,right:!1};return basicFlexLogic.closeBy(Br.y-Mr,0)&&(Nr.top=!0),basicFlexLogic.closeBy(Br.y+Br.height+Mr,MAX_BLOCK_HEIGHT)&&(Nr.bottom=!0),basicFlexLogic.closeBy(Br.x-Mr,0)&&(Nr.left=!0),basicFlexLogic.closeBy(Br.x+Br.width+Mr,MAX_BLOCK_WIDTH)&&(Nr.right=!0),Nr}function getBlockGroupEdges({blockId:Tr,slideId:Cr}){var Br;if(!Cr)return{top:!1,bottom:!1,left:!1,right:!1};const Ar=useItemStore().data[Cr],Rr=(Br=Ar[Tr])==null?void 0:Br.groupId;if(!Rr)return{top:!1,bottom:!1,left:!1,right:!1};if(!Ar[Rr])return{top:!1,bottom:!1,left:!1,right:!1};const Dr=Ar[Rr].direction,Mr=(Ar[Rr].items??[]).indexOf(Tr);if((Ar[Rr].items??[]).length===1)return{top:!1,bottom:!1,left:!1,right:!1};if(Mr<0)return{top:!1,bottom:!1,left:!1,right:!1};if(Mr===0){const Nr=getBlockGroupEdges({blockId:Rr,slideId:Cr});return{top:Dr==="column"||Nr.top,bottom:Dr==="column"?!1:Nr.bottom,left:Dr==="row"||Nr.left,right:Dr==="row"?!1:Nr.right}}if(Mr===Ar[Rr].items.length-1){const Nr=getBlockGroupEdges({blockId:Rr,slideId:Cr});return{top:Dr==="column"?!1:Nr.top,bottom:Dr==="column"||Nr.bottom,left:Dr==="row"?!1:Nr.left,right:Dr==="row"||Nr.right}}return{top:!1,bottom:!1,left:!1,right:!1}}const artboardLogic={calculatePostionForMenuOnTop,calculatePostionForMenuOnTopReactive,calculatePostionForMenuNoOverlapVertical,calculatePostionForMenuNoOverlapVerticalReactive,calculatePostionForMenuNoOverlapHorizontal,calculatePostionForMenuNoOverlapHorizontalReactive,colorButtons,colorKeys,colorMap,getBlockSlideEdges,getBlockGroupEdges},_withScopeId$4=Tr=>(pushScopeId("data-v-a0d082ec"),Tr=Tr(),popScopeId(),Tr),_hoisted_1$w={key:0,class:"flex items-center gap-1"},_hoisted_2$r={key:1,class:"block-menu-divider"},_hoisted_3$l={class:"flex items-center"},_hoisted_4$h=_withScopeId$4(()=>createBaseVNode("label",{class:"label-medium"},"Upload",-1)),_hoisted_5$d=_withScopeId$4(()=>createBaseVNode("div",{class:"block-menu-divider"},null,-1)),_hoisted_6$c=_withScopeId$4(()=>createBaseVNode("label",{class:"label-medium"},"AI",-1)),_hoisted_7$a=_withScopeId$4(()=>createBaseVNode("div",{class:"block-menu-divider"},null,-1)),_hoisted_8$7={key:2,class:"block-menu-divider"},_hoisted_9$7={key:3,class:"flex items-center"},_hoisted_10$6={class:"relative flex"},_hoisted_11$3={class:"flex items-center w-5 h-5 gap-2"},_hoisted_12$3=["onClick"],_hoisted_13$3={class:"flex items-center gap-2"},_hoisted_14$3={class:"label-medium"},_hoisted_15$3=_withScopeId$4(()=>createBaseVNode("div",{class:"block-menu-divider"},null,-1)),_hoisted_16$2={key:1,class:"flex items-center"},_hoisted_17$2={class:"px-2"},_hoisted_18$2={class:"slider-wrapper pr-1"},_hoisted_19$2={class:"slider-track"},_hoisted_20$1=_withScopeId$4(()=>createBaseVNode("div",{class:"block-menu-divider"},null,-1)),_hoisted_21$1=_withScopeId$4(()=>createBaseVNode("label",{class:"label-medium"},"Confirm",-1)),_hoisted_22$1=[_hoisted_21$1],_sfc_main$P=defineComponent({__name:"ImageSelectionPane",props:{selectedBlockId:{},appId:{}},emits:["changed-img-scale"],setup(Tr,{emit:Cr}){var ai;useCssVars(Xo=>({"024a8b4a":Uo.value,"20fad302":Ko.value}));const $r=inject("selectedBlockId"),Ar=inject("showingFullScreen"),Rr=inject("showingFullPage"),Dr=inject("downloadFile"),Mr=Tr,Br=Cr,Nr=useAppStore(),Lr=useBlockStore(),Hr=useCommandBarStore(),zr=useMiscStore(),Ur=useArtboardStore(),Vr=useWindowSize(),jr=ref(!1),Gr=ref(null),Xr=ref(null),Kr=ref(((ai=Lr.config(Mr.selectedBlockId).objectScale)==null?void 0:ai.value)??100),Zr=computed(()=>Ar.value||Dr.value||Rr.value),eo=computed(()=>Lr.isRepositioningImg(Mr.selectedBlockId)),Wr=useElementBounding$1(Gr),Yr=useElementBounding$1(Xr),Jr=computed(()=>{if(!Xr.value||!Gr.value||!(document.querySelector(`*[data-block-id="${Mr.selectedBlockId}"]`)instanceof HTMLElement))return;const si=artboardLogic.calculatePostionForMenuOnTopReactive({blockRect:Yr,paneRect:Wr,windowSize:Vr,blockId:Mr.selectedBlockId??"",gap:24});if(si==null)return;const{x:vi,y:Ci}=si;return{left:`${vi}px`,top:`${Ci}px`}}),no=computed(()=>{const{x:Xo,y:si,isClampedY:vi}=artboardLogic.calculatePostionForMenuOnTopReactive({blockRect:Yr,paneRect:Wr,windowSize:Vr,blockId:Mr.selectedBlockId||"",gap:24});return{top:vi?si:si-Yr.top.value,left:vi?Xo:Xo-Yr.left.value,isClampedY:vi,showing:!(Yr.bottom.value<0||Yr.top.value>Vr.height.value)}}),ro=computed(()=>{var Xo,si;return Mr.selectedBlockId?!!((si=(Xo=Lr.blockData[Mr.selectedBlockId].config)==null?void 0:Xo.source)!=null&&si.value):!1}),so=computed(()=>{var Xo,si;return Mr.selectedBlockId?(si=(Xo=Lr.config(Mr.selectedBlockId))==null?void 0:Xo.objectFit)==null?void 0:si.selectedId:"cover"}),ao=computed(()=>Ur.isAnyBlockResizing),lo=Xo=>{Mr.selectedBlockId&&(Lr.updateProps(Mr.selectedBlockId,{keyPath:["config","objectFit","selectedId"],value:Xo}),Ir.capture("change_image_fill_type",{id:Xo,blockId:Mr.selectedBlockId}))},po=()=>{$r&&(layout.pushStickyMenu({name:"ConfigPane",displayName:"",context:{id:$r.value,type:"block",selectedButtonId:"ai"}},"right"),Ir.capture("open_image_ai_pane",{blockId:$r.value}))},{isContextMenuOpen:go}=inject("isContextMenuOpen"),co=inject("selectionMenuBlockId"),mo=computed(()=>zr.getIsSlideInTransition),{popoverState:io}=inject("popoverState"),uo=computed(()=>Object.values(io.value).some(Xo=>Xo));watch(uo,()=>{log(`is any popover showing, ${uo.value}`),uo.value?co.value=null:co.value=Mr.selectedBlockId}),watch(go,()=>{log(`context menu watcher image pane, ${go.value}`),go.value?co.value=null:co.value=Mr.selectedBlockId});const ho=computed(()=>Hr.getIsCommandBarOpen);watch(ho,()=>{ho.value&&(co.value=null)}),watch(Kr,Xo=>{Mr.selectedBlockId&&Br("changed-img-scale",Xo)}),watch(()=>{var Xo;return(Xo=Lr.config(Mr.selectedBlockId).objectScale)==null?void 0:Xo.value},Xo=>{Kr.value=Xo??100});const yo=(Xo,si)=>{Xo.style.transition="all 300ms ease",si.style.transition="all 300ms ease",setTimeout(()=>{Xo.style.transition="",si.style.transition=""},300)},So=()=>{var bi;if(!Mr.selectedBlockId)return;const Xo=document.getElementById("CLEAR"),si=document.getElementById("OPAQUE"),vi=Xo==null?void 0:Xo.getBoundingClientRect(),Ci=(bi=Xo==null?void 0:Xo.parentElement)==null?void 0:bi.getBoundingClientRect(),wi=lodashExports.cloneDeep(Lr.config(Mr.selectedBlockId));if(Xo&&si&&vi&&Ci){const{width:li,height:ci,left:Ii,right:Ni,top:Ei,bottom:$i}=vi,{width:Ri,height:Fi,left:bs,right:qi,top:Mi,bottom:Ui}=Ci;let Ki,Ss;bsMi?Ss=ci/2/Fi:$i{Mr.selectedBlockId&&So()};watchEffect(()=>{const Xo=!!Mr.selectedBlockId&&!Lr.isDeleted(Mr.selectedBlockId)&&!!co.value&&Mr.selectedBlockId===co.value&&!Zr.value&&!Lr.dragBlockId&&!ao.value&&!mo.value,si=document.querySelector(`*[data-block-id="${Mr.selectedBlockId}"]`);si instanceof HTMLElement&&(Xr.value=si),nextTick(()=>{if(jr.value=Xo,jr.value){const vi=document.querySelector(`*[data-block-id="${Mr.selectedBlockId}"]`);vi instanceof HTMLElement&&(Xr.value=vi)}})}),watch(()=>Mr.selectedBlockId,(Xo,si)=>{Xo&&si&&(jr.value=!1)});const $o=inject("selectedPageId"),Go=ref("desktop"),No=ref("normal"),Eo=inject("selectedBlockId"),Mo=computed(()=>Nr.getThemeObject(Mr.appId,$o.value||"")),Ro=Xo=>{var Ci,wi;if(!Mr.selectedBlockId)return;const si=((Ci=Mo.value.block[Xo])==null?void 0:Ci.background)||Mo.value.block.none.background,vi=((wi=Mo.value.block[Xo])==null?void 0:wi.color)||Mo.value.block.none.color;Lr.updateProps(Mr.selectedBlockId,{keyPath:["config","backgroundColor"],value:{id:"backgroundColor",selectedId:Xo,value:si}}),Ir.capture("change_image_background_color",{color:vi,blockId:Mr.selectedBlockId}),headlessCleanup()},Ao=Xo=>{var si;return((si=Mo.value.block[Xo])==null?void 0:si.background)||Mo.value.block.none.background},zo=computed(()=>{var Xo,si;return Mr.selectedBlockId?((si=(Xo=Lr.blockData[Mr.selectedBlockId].config)==null?void 0:Xo.backgroundColor)==null?void 0:si.selectedId)??"none":"none"}),Oo=computed(()=>{var Xo,si;return Mr.selectedBlockId?zo.value==="none"?"#FFFFFF":theme.blockColorTypes.includes(zo.value)?Ao(zo.value):((si=(Xo=Lr.blockData[Mr.selectedBlockId].config)==null?void 0:Xo.backgroundColor)==null?void 0:si.value)||"White":""}),Bo=()=>{Mr.selectedBlockId&&(useDeleteBlockWrapper({selectedBlockId:$r}),$r&&($r.value=null))},{showNotiForUpload:bo,errorDuringUpload:vo,handleUploadedFile:Io}=useImageUploadFlow({pageId:$o,displayMode:Go,density:No,selectedBlockId:Eo,updateExistingBlock:!0}),{files:To,open:Co,reset:Po}=useFileDialog();watch(To,()=>{if(To.value==null||To.value.length===0)return;if(Array.from(To.value).reduce((si,vi)=>si+vi.size,0)>25e6){vo.value="Total file size cannot exceed 25MB",bo.value=!0;return}for(let si=0;si{Co(),$r&&Ir.capture("open_image_file_uploader",{blockId:$r.value})},Vo=computed(()=>{var Xo;return Mr.selectedBlockId?((Xo=Lr.config(Mr.selectedBlockId).link)==null?void 0:Xo.value)??"":""}),Ko=computed(()=>Mo.value.artboard.background==="#FFFFFF"?Mo.value.block.main.lightUp:Mo.value.artboard.background),Uo=computed(()=>`calc(${(Kr.value-100)/2}% - ${(Kr.value-100)/200*18}px)`),ei=ref({top:0}),qo=ref(null),ri=Xo=>{if(!Xo.target)return;const si=Xo.target.getBoundingClientRect();updatePositionForMenu(si,".bg-color-menu",ei),nextTick(()=>{updatePositionForMenu(si,".bg-color-menu",ei)})},ki=async Xo=>{Mr.selectedBlockId&&(await queryHref(Xo),Lr.updateProps(Mr.selectedBlockId,{keyPath:["config","link"],value:{id:"link",value:Xo}}))},ti=computed(()=>{const Xo=theme.blockColorTypesFull;return theme.doesThemeHaveBrandColor(Nr.deckTheme(Mr.appId))?Xo:Xo.filter(si=>si.id!=="brand")});return(Xo,si)=>{const vi=resolveDirective("tooltip");return openBlock(),createBlock(Teleport,{to:(no.value.isClampedY,"#main-app")},[createVNode(Transition,{name:"pane-fade"},{default:withCtx(()=>[jr.value&&no.value.showing?(openBlock(),createElementBlock("div",{key:0,ref_key:"paneElement",ref:Gr,id:"img-selection-pane",class:"selection-pane",style:normalizeStyle({...Jr.value,position:"absolute",transform:"translateX(-50%) translateY(-100%)"})},[eo.value?(openBlock(),createElementBlock("div",_hoisted_16$2,[createBaseVNode("p",_hoisted_17$2,toDisplayString(Kr.value)+"%",1),createBaseVNode("div",_hoisted_18$2,[createBaseVNode("div",_hoisted_19$2,[createVNode(Slider,{min:100,max:300,"show-labels":!1,"model-value":Kr.value,"accent-color":Ko.value,onMouseup:ko,"onUpdate:modelValue":si[3]||(si[3]=Ci=>Kr.value=parseInt(Ci,10)),id:"img-scale-slider"},null,8,["model-value","accent-color"])])]),_hoisted_20$1,createBaseVNode("button",{class:"block-menu-button hover:bg-neutralSolid-50 active:bg-neutralSolid-100",onClick:si[4]||(si[4]=Ci=>unref(Lr).setRepositionImg(null))},_hoisted_22$1)])):(openBlock(),createElementBlock(Fragment$1,{key:0},[ro.value?(openBlock(),createElementBlock("div",_hoisted_1$w,[withDirectives(createBaseVNode("button",{class:"block-menu-icon-button hover:bg-neutralSolid-50 active:bg-neutralSolid-100",style:normalizeStyle(so.value==="contain"?{background:"#E7E7E7"}:{}),onClick:si[0]||(si[0]=Ci=>lo("contain"))},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-contain.svg"),vProps:{width:20,height:20}},null,8,["src"])],4),[[vi,{content:"Fit",placement:"bottom"}]]),withDirectives(createBaseVNode("button",{class:"block-menu-icon-button hover:bg-neutralSolid-50 active:bg-neutralSolid-100",style:normalizeStyle(so.value==="cover"?{background:"#E7E7E7"}:{}),onClick:si[1]||(si[1]=Ci=>lo("cover"))},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-cover.svg"),vProps:{width:20,height:20}},null,8,["src"])],4),[[vi,{content:"Fill",placement:"bottom"}]]),withDirectives(createBaseVNode("button",{class:"block-menu-icon-button hover:bg-neutralSolid-50 active:bg-neutralSolid-100",style:normalizeStyle(so.value==="reposition"?{background:"#E7E7E7"}:{}),onClick:si[2]||(si[2]=()=>{lo("reposition"),unref(Lr).setRepositionImg(unref($r))})},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-reposition.svg"),vProps:{width:20,height:20}},null,8,["src"])],4),[[vi,{content:"Crop",placement:"bottom"}]])])):createCommentVNode("",!0),ro.value?(openBlock(),createElementBlock("div",_hoisted_2$r)):createCommentVNode("",!0),createBaseVNode("div",_hoisted_3$l,[withDirectives(createBaseVNode("button",{class:"block-menu-button hover:bg-neutralSolid-50 active:bg-neutralSolid-100",onClick:Fo},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-upload-5.svg"),vProps:{width:"20px",height:"20px"}},null,8,["src"]),_hoisted_4$h],512),[[vi,{content:"Upload image",placement:"bottom"}]]),_hoisted_5$d,withDirectives(createBaseVNode("button",{class:"block-menu-button hover:bg-neutralSolid-50 active:bg-neutralSolid-100",onClick:po},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-stars.svg"),vProps:{width:"20px",height:"20px"}},null,8,["src"]),_hoisted_6$c],512),[[vi,{content:"Ask AI to generate images",placement:"bottom"}]])]),_hoisted_7$a,createVNode(_sfc_main$Q,{appId:Xo.appId,tooltip:"Add link to block",savedLink:Vo.value,"onSave:link":ki},null,8,["appId","savedLink"]),ro.value?(openBlock(),createElementBlock("div",_hoisted_8$7)):createCommentVNode("",!0),ro.value?(openBlock(),createElementBlock("div",_hoisted_9$7,[createVNode(unref(ge$2),null,{default:withCtx(()=>[createBaseVNode("div",_hoisted_10$6,[withDirectives(createVNode(unref(Se$1),{class:"block-menu-icon-button hover:bg-neutralSolid-50 active:bg-neutralSolid-100",style:{fontFamily:"inherit"},onClick:ri},{default:withCtx(()=>[createBaseVNode("span",_hoisted_11$3,[createBaseVNode("span",{class:"w-5 h-5 bg-white rounded-[5px] border border-[#0000001F]",style:normalizeStyle({background:Oo.value})},null,4)])]),_:1},512),[[vi,{content:"Block background",placement:"bottom"}]]),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[createVNode(unref(be),{as:"ul",ref_key:"bgColorMenu",ref:qo,class:"bg-color-menu dropdown-menu absolute w-[169px]",style:normalizeStyle({top:`${ei.value.top}px`,zIndex:1e3,..."left"in ei.value?{left:`${ei.value.left}px`}:{},..."right"in ei.value?{right:`${ei.value.right}px`}:{}})},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(ti.value,Ci=>(openBlock(),createBlock(unref(Me),{key:Ci.id},{default:withCtx(()=>[createBaseVNode("li",{class:"dropdown-menu-button",onClick:wi=>Ro(Ci.id)},[createBaseVNode("div",_hoisted_13$3,[createBaseVNode("div",{class:"bg-white rounded-[5px] border border-[#0000001F]",style:normalizeStyle({width:"20px",height:"20px",background:Ao(Ci.id)})},null,4),createBaseVNode("label",_hoisted_14$3,toDisplayString(Ci.name),1)]),zo.value===Ci.id?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)("icon-check.svg"),"v-props":{width:"16px",height:"16px",stroke:"#323F4B"}},null,8,["src"])):createCommentVNode("",!0)],8,_hoisted_12$3)]),_:2},1024))),128))]),_:1},8,["style"])]),_:1})])]),_:1})])):createCommentVNode("",!0),_hoisted_15$3,withDirectives(createBaseVNode("button",{class:"block-menu-icon-button hover:bg-neutralSolid-50 active:bg-neutralSolid-100",onClick:Bo},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-trash-20px-1.svg"),vProps:{width:20,height:20}},null,8,["src"])],512),[[vi,{content:"Delete block",placement:"bottom"}]])],64))],4)):createCommentVNode("",!0)]),_:1})],8,["to"])}}}),ImageSelectionPane_vue_vue_type_style_index_0_scoped_a0d082ec_lang="",ImageSelectionPane=_export_sfc(_sfc_main$P,[["__scopeId","data-v-a0d082ec"]]),USE_BLOCK_DIMENSIONS=!1;async function isImageTransparent(Tr,Cr=250){return new Promise(($r,Ar)=>{const Rr=new Image;Rr.crossOrigin="Anonymous",Rr.src=Tr,Rr.onload=()=>{const Dr=document.createElement("canvas");Dr.width=Rr.width,Dr.height=Rr.height;const Mr=Dr.getContext("2d");if(!Mr)return Ar(new Error("Could not get the canvas context."));Mr.drawImage(Rr,0,0);const Nr=Mr.getImageData(0,0,Dr.width,Dr.height).data;for(let Lr=0;Lr{Ar(new Error("Error loading the image."))}})}const useImageOptimization=({imgSrc:Tr,isPdf:Cr,isScreenshot:$r,blockWidth:Ar,blockHeight:Rr,imgRatio:Dr,isTransparent:Mr})=>{const{isMobile:Br,isPortraitTablet:Nr,isTablet:Lr}=useDeviceState();let zr=(Vr=>Vr&&Vr<480?960:1920)(Ar);Br.value||Nr.value?zr=640:Lr.value&&(zr=960);let Ur;return Rr&&Ar&&Dr&&USE_BLOCK_DIMENSIONS&&(Ar/Rr>=Dr?(zr=Math.ceil(Ar),Ur=void 0):(zr=void 0,Ur=Math.ceil(Rr))),SupabaseWrapper.getOptimizedImageUrl(Tr,{cfFormat:(Cr.value||$r.value)&&!Mr?"jpeg":"auto",width:Cr.value||$r.value?960:zr,height:Cr.value||$r.value?void 0:Ur})},ImageEmbed_vue_vue_type_style_index_0_scoped_cd36ab1f_lang="",_sfc_main$O={setup(Tr,Cr){const $r=useAppStore(),Ar=useArtboardStore(),Rr=useBlockStore(),Dr=inject("isMobile"),Mr=inject("selectedBlockId"),Br=inject("showingFullPage");inject("showingFullScreen");const Nr=inject("isReadOnly"),Lr=computed(()=>Ar.isDraggingResizing),{isPdf:Hr,isPublic:zr,isScreenshot:Ur,currentPathWithQuery:Vr,isHome:jr}=useRouteInfo(),Gr=ref(!1),Xr=Object.assign({"/assets/images/gradient-globe-smiling-dark-2.png":__vite_glob_0_0$1,"/assets/images/gradient-globe-smiling-dark-31.png":__vite_glob_0_1,"/assets/images/gradient-globe-smiling-dark.png":__vite_glob_0_2,"/assets/images/image-deck-type-about-us.png":__vite_glob_0_3,"/assets/images/image-deck-type-general.png":__vite_glob_0_4,"/assets/images/image-deck-type-marketing.png":__vite_glob_0_5,"/assets/images/image-deck-type-research.png":__vite_glob_0_6,"/assets/images/prezo.png":__vite_glob_0_7}),Kr=Po=>Xr[Object.keys(Xr).find(Fo=>Fo.endsWith(Po))],Zr=ref("https://nucgnbhmmqgwgmivzcrz.supabase.co/storage/v1/render/image/public/public/app/sample_image_5.png"),eo=ref(null),Wr=computed(()=>Tr.isPreview?1:Tr.scale),Yr=computed(()=>{var Po,Fo;return(Fo=(Po=Tr.blockDims)==null?void 0:Po.height)!=null&&Fo.value?Tr.isPreview&&!Dr.value?Rr.positionByDisplay(Tr.blockId).height:Tr.blockDims.height.value:Rr.positionByDisplay(Tr.blockId).height*Wr.value}),Jr=computed(()=>{var Po,Fo;return(Fo=(Po=Tr.blockDims)==null?void 0:Po.width)!=null&&Fo.value?Tr.isPreview&&!Dr.value?Rr.positionByDisplay(Tr.blockId).width:Tr.blockDims.width.value:Rr.positionByDisplay(Tr.blockId).width*Wr.value}),{source:no}=toRefs$1(Tr);computed(()=>$r.getThemeObject(Tr.appId,Rr.parentId(Tr.blockId)||""));const ro=ref(()=>({width:Jr.value,height:Yr.value})),so=computed(()=>no.value==null||no.value.length===0?Zr.value:useImageOptimization({imgSrc:no.value,isPdf:Hr,isScreenshot:Ur,blockWidth:Jr.value,blockHeight:Yr.value,imgRatio:ro.value().width/ro.value().height,isTransparent:Gr.value})),{preloadImage:ao,cachedImages:lo}=inject("cachedImages"),po=ref(so.value),go=ref(po.value in lo.value),co=computed(()=>{var Po;return((Po=Rr.config(Tr.blockId).objectPositionX)==null?void 0:Po.value)??null}),mo=computed(()=>{var Po;return((Po=Rr.config(Tr.blockId).objectPositionY)==null?void 0:Po.value)??null}),io=computed(()=>{var Po;return(((Po=Rr.config(Tr.blockId).objectScale)==null?void 0:Po.value)??100)/100}),uo=ref(io.value);Nr.value||watch(io,Po=>{uo.value=Po});const ho=Po=>{uo.value=parseInt(Po,10)/100},yo=ref({width:0,height:0,left:0,top:0}),So=ref(""),ko=(Po=!1)=>{const{height:Fo,width:Vo}=ro.value,Ko=Jr.value/Yr.value,Uo=Vo/Fo,ei={};if(Tr.objectFit==="contain"&&Ko=Uo?(ei.width=Jr.value,ei.height=Jr.value*Fo/Vo):(ei.height=Yr.value,ei.width=Yr.value*Vo/Fo),Tr.objectFit!=="reposition"||co.value===null||mo.value===null)ei.top=.5*Yr.value-ei.height/2,ei.left=.5*Jr.value-ei.width/2;else{ei.left=co.value*Jr.value*uo.value-ei.width/2+Jr.value/2,ei.top=mo.value*Yr.value*uo.value-ei.height/2+Yr.value/2;const qo=mo.value*Yr.value*uo.value,ri=Yr.value/2;ri+qo-ei.height/2*uo.value>0&&(ei.top=0+ei.height/2*uo.value-ei.height/2),ri+qo+ei.height/2*uo.value0&&(ei.left=0+ei.width/2*uo.value-ei.width/2),Xo+ai+ei.width/2*uo.value{So.value=""},300)),yo.value={...ei}},$o=()=>{const Po=lo.value[po.value].width,Fo=lo.value[po.value].height;ro.value.width=Po,ro.value.height=Fo,ko()},Go=async()=>{go.value=!0,Cr.emit("load"),po.value!==Zr.value&&$o()},No=async()=>{po.value=so.value,ao(po.value);const Po=lo.value[po.value];Po!=null&&Po.complete&&Po.naturalHeight!==0&&po.value!==Zr.value?($o(),Go()):lo.value[po.value].addEventListener("load",Go)};(async()=>{if(Hr.value||Ur.value)try{Gr.value=await isImageTransparent(Tr.source),Gr.value&&(log("transparent image",Tr.source),No())}catch{Gr.value=!1}})();const Mo=ref(!1),Ro=!0;(!Nr.value||Ro)&&watch(()=>no.value,(Po,Fo)=>{if(No(),Fo==null&&(Mo.value=!0),Nr.value)return;const Vo=lodashExports.cloneDeep(Rr.config(Tr.blockId));Vo.objectPositionX={id:"objectPositionX",value:null},Vo.objectPositionY={id:"objectPositionY",value:null},Vo.objectScale={id:"objectScale",value:100},Rr.updateProps(Tr.blockId,{keyPath:["config"],value:Vo})});const Ao=ref("100%"),zo=computed(()=>Rr.isRepositioningImg(Tr.blockId)&&!Tr.isPreview);onMounted(async()=>{await No()});const Oo=computed(()=>({src:po.value})),{error:Bo,isLoading:bo}=useImage(Oo),vo=ref(""),Io=()=>{Cr.emit("open-config-pane")};Nr.value||(watch([Jr,Yr],()=>{go.value&&po.value!==Zr.value&&ko(!0)}),watch([co,mo,()=>Tr.scale,()=>Tr.objectFit],()=>{ko()})),Nr.value||(onClickOutside(eo,Po=>{if(Tr.isPreview||!Rr.isRepositioningImg(Tr.blockId))return;const Fo=[...document.querySelectorAll(`.img-${Tr.blockId}`),document.getElementById("img-selection-pane")];Po.target.id!=="img-scale-slider"&&(Fo.some(Vo=>Vo&&Vo.contains(Po.target))||Array.from(Po.target.classList).includes(`img-${Tr.blockId}`)||Rr.setRepositionImg(null))}),useEventListener(document,"keydown",Po=>{(Po.key==="Escape"||Po.key==="Enter")&&Rr.setRepositionImg(null)}));const To=computed(()=>Nr.value||Dr.value);return{showingFullPage:Br,isMobile:Dr,isDraggingResizing:Lr,isViewOnly:To,onDblClick:()=>{if(!To.value){if(!Mr.value)return;Rr.updateProps(Mr.value,{keyPath:["config","objectFit","selectedId"],value:"reposition"}),posthogCapture("change_image_fill_type",{id:"reposition",blockId:Mr.value}),Rr.setRepositionImg(Mr.value)}},updateImgScale:ho,selectedBlockId:Mr,el:eo,transition:So,blockHeight:Yr,blockWidth:Jr,imgScale:uo,render:yo,repositioning:zo,intrinsic:ro,maxWidth:Ao,fromNull:Mo,imageLoaded:go,openConfigPane:Io,prompt:vo,assetUrl,srcToUse:po,imageUrl:Kr,src:so,isLoading:bo,error:Bo}},props:{blockId:{type:String},scale:{type:Number},source:{type:String,default:""},content:{type:String,default:""},imageType:{type:String,default:"normal"},objectFit:{type:String,default:"cover"},flipHorizontal:{type:Boolean,default:!1},flipVertical:{type:Boolean,default:!1},rotateAngle:{type:Number,default:0},borderColorDict:{type:Object,default:()=>({type:"neutral",level:100})},borderThickness:{type:Number,default:0},borderPosition:{type:String,default:"inside"},showBorder:{type:Boolean,default:!1},opacity:{type:Number,default:100},generatedBy:{type:String,default:"ai"},hasAIResults:{type:Boolean,default:!1},isPreview:{type:Boolean,default:!1},hasRequestedAIImages:{type:Boolean,default:!1},appId:{type:String,default:""},blockDims:{type:Object,default:null}},emits:["open-config-pane","load"],components:{Icon:_sfc_main$1v,Skeleton,Resizer,ImageSelectionPane},computed:{isMobileArtboard(){return this.isMobile&&!this.isPreview},mobileHeight(){return Math.max(180,this.intrinsic().height/this.intrinsic().width*240)},rootHeight(){return this.isMobileArtboard?this.mobileHeight:this.render.height},hasSelectedImage(){const Tr=useBlockStore().blockObject(this.selectedBlockId);return Tr==null?!1:Tr.type==="image"},colorToUse(){const Tr=useAppStore(),Cr=useBlockStore();return Tr.getThemeObject(this.appId,Cr.parentId(this.blockId)).block.main.lightUp},styleForObjectFit(){if(this.objectFit==="fill")return{width:this.isMobileArtboard?void 0:"100%",height:this.isMobileArtboard?void 0:"100%"};if(this.objectFit==="cover"||this.objectFit==="reposition"){const Tr=this.blockWidth/this.blockHeight,Cr=this.intrinsic().width/this.intrinsic().height,$r={transform:this.isMobileArtboard?void 0:`${this.styleForFlipHorizontal} ${this.styleForFlipVertical} ${this.styleForRotateImage}`,opacity:.6,minWidth:this.isMobileArtboard?void 0:`${this.render.width}px`,minHeight:this.isMobileArtboard?void 0:`${this.render.height}px`};return TrAr.onDblClick&&Ar.onDblClick(...Hr))},[Ar.repositioning?(openBlock(),createBlock(Mr,{key:0,id:"OPAQUE",minWidth:Ar.blockWidth,minHeight:Ar.blockHeight,maxWidth:Ar.blockWidth*3,maxHeight:Ar.blockHeight*3,width:Ar.render.width,height:Ar.render.height,left:Ar.render.left,top:Ar.render.top,scale:Ar.imgScale,"onResize:move":Dr.resizeHandler,"onResize:end":Dr.resizeEndHandler,"onDrag:move":Dr.dragHandler,"onDrag:end":Dr.dragEndHandler,active:[],isVisible:!1,class:"popoverOverrideNotUsed",style:normalizeStyle({transform:`scale(${Ar.imgScale})`,position:"absolute"})},{default:withCtx(()=>[createBaseVNode("img",{draggable:!1,style:normalizeStyle([Dr.styleForRepositionImg,{outline:`2px solid ${Dr.colorToUse}`}]),src:Ar.srcToUse,alt:$r.content,class:normalizeClass(`img-${$r.blockId}`)},null,14,_hoisted_1$v)]),_:1},8,["minWidth","minHeight","maxWidth","maxHeight","width","height","left","top","scale","onResize:move","onResize:end","onDrag:move","onDrag:end","style"])):createCommentVNode("",!0),createBaseVNode("div",{style:normalizeStyle({borderRadius:"inherit",position:"relative",...Dr.styleForBorderObject}),class:"overflow-hidden w-full h-full",draggable:!1},[($r.source===""||$r.source==null)&&$r.generatedBy==="ai"?(openBlock(),createElementBlock("div",_hoisted_2$q,[Ar.isLoading&&!Ar.imageLoaded||Ar.isLoading&&Ar.fromNull||!$r.hasAIResults&&$r.hasRequestedAIImages?(openBlock(),createBlock(Br,{key:0,interval:1500,style:{height:"100%"}})):(openBlock(),createElementBlock("div",_hoisted_3$k,[createVNode(Nr,{src:Ar.assetUrl("icon-image-thick.svg"),vProps:{height:"48px",width:"48px"}},null,8,["src"])]))])):(openBlock(),createElementBlock(Fragment$1,{key:1},[Ar.isLoading&&!Ar.imageLoaded||Ar.isLoading&&Ar.fromNull||!$r.hasAIResults&&$r.hasRequestedAIImages?(openBlock(),createBlock(Br,{key:0,interval:1500,style:{height:"100%"}})):Ar.error?(openBlock(),createElementBlock("div",_hoisted_4$g,[createVNode(Nr,{src:Ar.assetUrl("icon-image-error.svg"),vProps:{nestedFill:Tr.appTheme.palette.neutral[300],stroke:Tr.appTheme.palette.neutral[300],height:"32px",width:"32px"}},null,8,["src","vProps"])])):Ar.repositioning?(openBlock(),createBlock(Mr,{key:2,id:"CLEAR",isVisible:!1,minWidth:Ar.blockWidth,minHeight:Ar.blockHeight,maxWidth:Ar.blockWidth*3,maxHeight:Ar.blockHeight*3,width:Ar.render.width,height:Ar.render.height,left:Ar.render.left,top:Ar.render.top,scale:Ar.imgScale,active:[],"onDrag:move":Dr.dragHandler,"onDrag:end":Dr.dragEndHandler,class:"popoverOverrideNotUsed",style:normalizeStyle({transform:`scale(${Ar.imgScale})`,position:"absolute"})},{default:withCtx(()=>[createBaseVNode("img",{draggable:!1,style:normalizeStyle([Dr.styleForRepositionImg,{opacity:1}]),src:Ar.srcToUse,alt:$r.content,class:normalizeClass(`img-${$r.blockId}`)},null,14,_hoisted_5$c)]),_:1},8,["minWidth","minHeight","maxWidth","maxHeight","width","height","left","top","scale","onDrag:move","onDrag:end","style"])):(openBlock(),createElementBlock("img",{key:3,draggable:!1,style:normalizeStyle([Dr.styleForImage,{transition:Ar.transition}]),src:Ar.srcToUse,alt:$r.content},null,12,_hoisted_6$b))],64))],4)],34),Dr.hasSelectedImage&&Ar.selectedBlockId===$r.blockId&&!Ar.isViewOnly&&!Ar.isDraggingResizing?(openBlock(),createBlock(Lr,{key:0,selectedBlockId:Ar.selectedBlockId,appId:$r.appId,onChangedImgScale:Ar.updateImgScale},null,8,["selectedBlockId","appId","onChangedImgScale"])):createCommentVNode("",!0)],4)}const ImageEmbed=_export_sfc(_sfc_main$O,[["render",_sfc_render$9],["__scopeId","data-v-cd36ab1f"]]),ShapeEmbed_vue_vue_type_style_index_0_scoped_c492bf43_lang="",_sfc_main$N={setup(Tr,Cr){return{}},props:{borderRadius:{type:[Number,String],default:0},rotateAngle:{type:Number,default:0},borderColorDict:{type:Object,default:()=>({type:"neutral",level:100})},borderThickness:{type:Number,default:0},borderPosition:{type:String,default:"inside"},showBorder:{type:Boolean,default:!1},opacity:{type:Number,default:100},shapeType:{type:String,default:"rectangle"},numSides:{type:Number,default:3},bgColorDict:{type:Object},classObject:{type:Object,default:()=>({})}},components:{},computed:{classObjectToUse(){var Tr;return{...this.classObject,"doodle-border":(Tr=this.classObject)==null?void 0:Tr.doodle,polygon:this.shapeType==="polygon",custom:this.shapeType==="polygon"}},borderRadiusToUse(){return typeof this.borderRadius=="string"?this.borderRadius:this.shapeType==="ellipse"?"50%":`${this.borderRadius}px`},styleForBorderObject(){if(this.showBorder===!1)return{};const Tr=this.getColorFromDict(this.borderColorDict);return this.borderPosition==="outside"?{outline:`${this.borderThickness}px solid ${Tr}`}:{border:`${this.borderThickness}px solid ${Tr}`}},styleForShape(){return{background:this.getColorFromDict(this.bgColorDict??{type:"neutral",level:100})}},styleForRotate(){return this.shapeType==="polygon"?{transform:"rotate(-90deg)"}:{transform:"rotate(0deg)"}},polygonClipPath(){let Tr="polygon(";for(let Rr=0;Rr{useCssVars(Tr=>({"40d016cc":Tr.polygonClipPath}))},__setup__$2=_sfc_main$N.setup;_sfc_main$N.setup=__setup__$2?(Tr,Cr)=>(__injectCSSVars__$2(),__setup__$2(Tr,Cr)):__injectCSSVars__$2;function _sfc_render$8(Tr,Cr,$r,Ar,Rr,Dr){return openBlock(),createElementBlock("div",{style:normalizeStyle({width:"100%",height:"100%",borderRadius:Dr.borderRadiusToUse,overflow:"hidden",...Dr.styleForBorderObject,...Dr.styleForRotate}),class:normalizeClass(Dr.classObjectToUse)},[createBaseVNode("div",{style:normalizeStyle({width:"100%",height:"100%",...Dr.styleForShape})},null,4)],6)}const ShapeEmbed=_export_sfc(_sfc_main$N,[["render",_sfc_render$8],["__scopeId","data-v-c492bf43"]]),_sfc_main$M={setup(){return{}},props:{collectionType:{type:String,default:"row"},content:{type:String,default:""}},computed:{collectionStyle(){return{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-around",alignItems:"stretch",width:"100%",height:"100%",gap:"16px",padding:"8px"}},items(){return this.content.split(",").map(Cr=>({content:Cr}))}}};function _sfc_render$7(Tr,Cr,$r,Ar,Rr,Dr){return openBlock(),createElementBlock("div",{style:normalizeStyle(Dr.collectionStyle)},[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Dr.items,(Mr,Br)=>(openBlock(),createElementBlock("div",{key:Br,style:normalizeStyle({padding:"16px",flexBasis:0,flexGrow:1,flexShrink:1,display:"flex",justifyContent:"center",alignItems:"center",background:Tr.appTheme.palette.primary[100],borderRadius:"16px"})},[createBaseVNode("label",null,toDisplayString(Mr.content),1)],4))),128))],4)}const CollectionEmbed=_export_sfc(_sfc_main$M,[["render",_sfc_render$7]]),MIN_TABLE_COLUMN_WIDTH=40,ADD_BUTTON_DIM=28,ADD_BUTTON_GAP=12,MAX_COLUMNS=8,DEFAULT_COLUMMN_WIDTH=180,useUpdateTableCell=({tableId:Tr,colId:Cr,rowId:$r,value:Ar})=>{useBlockStore().updateProps(Tr,{keyPath:["config","cellStore","value","store",Cr,$r,"value"],value:Ar})},useUpdateTableColumnName=({tableId:Tr,colId:Cr,value:$r})=>{useBlockStore().updateProps(Tr,{keyPath:["config","colStore","value","store",Cr,"name"],value:$r})},useUpdateTableColumnWidths=({tableId:Tr,columnWidths:Cr})=>{var Rr,Dr;const $r=useBlockStore(),Ar=lodashExports.cloneDeep(((Dr=(Rr=$r.config(Tr).colStore)==null?void 0:Rr.value)==null?void 0:Dr.store)??{});Cr.forEach(({id:Mr,width:Br})=>{Ar[Mr].width=Br}),$r.updateProps(Tr,{keyPath:["config","colStore","value","store"],value:Ar})},useAddEmptyTableRow=({tableId:Tr,index:Cr})=>{const $r=useBlockStore(),Ar=guid(),Rr=lodashExports.cloneDeep($r.config(Tr)),Dr=Rr.cellStore.value.store;Object.keys(Dr).forEach(Br=>{Dr[Br][Ar]={value:null}}),$r.updateProps(Tr,{keyPath:["config","cellStore","value","store"],value:Dr});const Mr=Rr.rowStore.value;return Mr.store[Ar]={id:Ar,isHidden:!1,style:{}},Cr==null||Cr===-1?Mr.order.push(Ar):Mr.order.splice(Cr,0,Ar),$r.updateProps(Tr,{keyPath:["config","rowStore","value"],value:Mr}),Ar},useAddEmptyTableColumn=({tableId:Tr,index:Cr})=>{const $r=useBlockStore(),Ar=guid(),Rr=lodashExports.cloneDeep($r.config(Tr)),Dr=Rr.cellStore.value.store,Mr=Rr.rowStore.value.store;Dr[Ar]={},Object.keys(Mr).forEach(Nr=>{Dr[Ar][Nr]={value:null}});const Br=Rr.colStore.value;return Br.store[Ar]={id:Ar,name:"New Column",type:"text",style:{},format:{},isHidden:!1,width:DEFAULT_COLUMMN_WIDTH},Cr==null||Cr===-1?Br.order.push(Ar):Br.order.splice(Cr,0,Ar),$r.updateProps(Tr,{keyPath:["config"],value:Rr}),Ar},useDeleteTableColumn=({tableId:Tr,colId:Cr})=>{const $r=useBlockStore(),Ar=lodashExports.cloneDeep($r.config(Tr)),Rr=Ar.colStore.value;delete Rr.store[Cr],Rr.order=Rr.order.filter(Mr=>Mr!==Cr);const Dr=Ar.cellStore.value.store;delete Dr[Cr],$r.updateProps(Tr,{keyPath:["config"],value:Ar})},useDeleteTableRow=({tableId:Tr,rowId:Cr})=>{const $r=useBlockStore(),Ar=lodashExports.cloneDeep($r.config(Tr)),Rr=Ar.rowStore.value;delete Rr.store[Cr],Rr.order=Rr.order.filter(Mr=>Mr!==Cr);const Dr=Ar.cellStore.value.store;Object.keys(Dr).forEach(Mr=>{delete Dr[Mr][Cr]}),$r.updateProps(Tr,{keyPath:["config"],value:Ar})},useClearColumnContents=({tableId:Tr,colId:Cr})=>{const $r=useBlockStore(),Rr=lodashExports.cloneDeep($r.config(Tr)).cellStore.value.store;Object.keys(Rr[Cr]).forEach(Dr=>{Rr[Cr][Dr]={value:null}}),$r.updateProps(Tr,{keyPath:["config","cellStore","value","store"],value:Rr})},useClearRowContents=({tableId:Tr,rowId:Cr})=>{const $r=useBlockStore(),Rr=lodashExports.cloneDeep($r.config(Tr)).cellStore.value.store;Object.keys(Rr).forEach(Dr=>{Rr[Dr][Cr]={value:null}}),$r.updateProps(Tr,{keyPath:["config","cellStore","value","store"],value:Rr})},useDuplicateTableColumn=({tableId:Tr,colId:Cr})=>{const $r=useBlockStore(),Ar=lodashExports.cloneDeep($r.config(Tr)),Rr=Ar.cellStore.value.store,Dr=guid(),Mr=Ar.colStore.value.order.indexOf(Cr);if(Mr===-1)return;Rr[Dr]={},Rr[Dr]=lodashExports.cloneDeep(Rr[Cr]);const Br=Ar.colStore.value;Br.store[Dr]=lodashExports.cloneDeep(Br.store[Cr]),Br.store[Dr].id=Dr,Mr==null||Mr===-1?Br.order.push(Dr):Br.order.splice(Mr,0,Dr),$r.updateProps(Tr,{keyPath:["config"],value:Ar})},useDuplicateTableRow=({tableId:Tr,rowId:Cr})=>{const $r=useBlockStore(),Ar=lodashExports.cloneDeep($r.config(Tr)),Rr=Ar.cellStore.value.store,Dr=guid(),Mr=Ar.rowStore.value.order.indexOf(Cr);if(Mr===-1)return;Object.keys(Rr).forEach(Nr=>{Rr[Nr][Dr]=lodashExports.cloneDeep(Rr[Nr][Cr])});const Br=Ar.rowStore.value;Br.store[Dr]=lodashExports.cloneDeep(Br.store[Cr]),Br.store[Dr].id=Dr,Mr==null||Mr===-1?Br.order.push(Dr):Br.order.splice(Mr,0,Dr),$r.updateProps(Tr,{keyPath:["config"],value:Ar})},useAnimationForTable=Tr=>{const{isPreview:Cr,blockId:$r,isReadOnly:Ar,rows:Rr,columns:Dr}=Tr,Mr=useBlockStore(),Br=ref(!1),Nr=ref(150),Lr=ref(300),Hr=ref(75),zr=ref(75),Ur=(Gr,Xr)=>Nr.value+Gr*zr.value+Xr*Hr.value,Vr=()=>{Cr.value||(Br.value=!0,setTimeout(()=>{Br.value=!1},Nr.value+Lr.value+Hr.value*Rr.value.length+Hr.value*Dr.value.length))},jr=computed(()=>{var Gr,Xr;return(Xr=(Gr=Mr.config($r.value))==null?void 0:Gr.aiResultId)==null?void 0:Xr.value});return Ar.value||watch(jr,()=>{Vr()}),{isAnimationInPrgress:Br,getAnimationDelay:Ur,startAnimation:Vr,animationDuration:Lr}},GHOST_OPACITY=.8,GHOST_SHADOW="0px 12px 32px 0px rgba(0, 0, 0, 0.16)",useTableDragAndDrop=Tr=>{const Cr=useAppStore(),$r=useBlockStore(),Ar=useTableStore(),{appId:Rr,scale:Dr,blockId:Mr,borderColor:Br,allowDragging:Nr,rowIds:Lr,colCellIds:Hr,mainTable:zr,deselectAll:Ur}=Tr,Vr=computed(()=>{var ti,ai;return(ai=(ti=Cr.config(Rr.value))==null?void 0:ti.smallText)==null?void 0:ai.value}),jr=computed(()=>$r.parentId(Mr.value)??""),Gr=computed(()=>Cr.getThemeObject(Rr.value,jr.value)),Xr=ref(0),Kr=ref(),Zr=ref(0),eo=ref(null),Wr=ref(null),Yr=ref([]),Jr=ref({x:0,y:0}),no=ref(!1),ro=ref(null),so=ref(1),ao=ref(null),lo=ref(null),po=computed(()=>Yr.value.length+2),go=ref([]),co=ref(null),mo=ref(null),io=computed(()=>mo.value?go.value.findIndex(ti=>ti===mo.value):null),uo=computed(()=>io.value===null?!1:co.value==="rows"?ao.value!==null&&ao.value!==io.value&&ao.value!==io.value+1:lo.value!==null&&lo.value!==io.value&&lo.value!==io.value+1),ho=computed(()=>go.value.length),yo=computed(()=>Math.max(...Yr.value.map(ti=>ti.bottom))+1),So=computed(()=>Math.min(...Yr.value.map(ti=>ti.top))-1),ko=computed(()=>Math.max(...Yr.value.map(ti=>ti.right))+1),$o=computed(()=>Math.min(...Yr.value.map(ti=>ti.left))-1),Go=computed(()=>[{top:So.value,bottom:So.value,left:$o.value,right:$o.value},...Yr.value,{top:yo.value,bottom:yo.value,left:ko.value,right:ko.value}]),No=()=>{const ti=document.getElementById("ghost");if(!ti)return;const ai=document.getElementById("main-app");ai!=null?ai.removeChild(ti):document.body.removeChild(ti)},Eo=ti=>{const ai=document.getElementById(ti);if(ai==null)return null;const Xo=ai.children[0];return Xo==null?null:Xo.getBoundingClientRect()},Mo=ti=>{var bs,qi;if(!Kr.value||!mo.value)return;Kr.value.id="ghost",Kr.value.style.position="absolute",Kr.value.style.willChange="transform, opacity",Kr.value.style.zIndex="1000",Kr.value.style.width="fit-content",Kr.value.style.background=((qi=(bs=Gr.value)==null?void 0:bs.artboard)==null?void 0:qi.background)??"white";const ai=Eo(mo.value);if(!ai)return;const Xo=ti.clientY-ai.top,si=ti.clientX-ai.left;Zr.value=Xo,Xr.value=si;const vi=1;Kr.value.style.top=`${ai.top}px`,Kr.value.style.left=`${ai.left}px`,Kr.value.style.opacity=`${GHOST_OPACITY}`,Kr.value.style.cursor="grabbing",Kr.value.style.overflow="hidden",Kr.value.querySelectorAll(".cell-curtain").forEach(Mi=>{Mi.style.display="none"});const Ci=Kr.value.querySelectorAll(":scope > div"),wi=`${4*Dr.value}px`;Ci.forEach(Mi=>{Mi.style.borderRadius=wi}),Kr.value.style.borderRadius=wi;const bi=document.createElement("div");bi.style.position="absolute",bi.style.top="0px",bi.style.bottom="0px",bi.style.left="0px",bi.style.right="0px",bi.style.border=`${2*Dr.value}px solid ${Br.value}`,bi.style.borderRadius=wi,Kr.value.appendChild(bi);const li=Kr.value.querySelectorAll(".editor-wrapper")[0];li&&(li.style.cursor="grabbing"),Kr.value.style.boxShadow=GHOST_SHADOW;const ci=[...Array.from(Kr.value.querySelectorAll("p"))],Ii=[...Array.from(Kr.value.querySelectorAll("ul"))],Ni=[...Array.from(Kr.value.querySelectorAll("ol"))],Ei=design.fontSizeMap.richText.desktop[Vr.value?"smallText":"regular"];if(ci.forEach(Mi=>{Mi.style.fontSize=`${Dr.value*vi*Ei.p}px`}),Ii.forEach(Mi=>{Mi.style.fontSize=`${Dr.value*vi*Ei.ul}px`}),Ni.forEach(Mi=>{Mi.style.fontSize=`${Dr.value*vi*Ei.ol}px`}),Kr.value.querySelectorAll(".resizable-secondary")!=null&&[...Array.from(Kr.value.querySelectorAll(".resizable-secondary"))].forEach(Ui=>{Ui.style.display="none"}),Kr.value.querySelectorAll(".selection-pane")!=null){const Mi=Kr.value.querySelectorAll(".selection-pane")[0];Mi!=null&&(Mi.style.display="none")}const $i=document.getElementById("main-app");$i!=null?$i.appendChild(Kr.value):document.body.appendChild(Kr.value),setTimeout(()=>{Kr.value&&(Kr.value.style.transform=`scale(${vi})`)},0);const Ri=Xr.value*vi,Fi=Zr.value*vi;return{newX:Ri,newY:Fi}},Ro=(ti,ai,Xo,si)=>{ti{if(!mo.value)return;const Xo=Eo(mo.value);if(!Xo)return!1;let si=!1;ti=vi.difference)break;Ro(bi,li,Ci,vi)}ao.value=vi.index},zo=({left:ti,right:ai})=>{if(!mo.value)return;const Xo=Eo(mo.value);if(!Xo)return!1;let si=!1;ti=vi.difference)break;Ro(bi,li,Ci,vi)}lo.value=vi.index},Oo=(ti,ai)=>{const Xo=[...$r.config(Mr.value)[ai].value.order],[si]=Xo.splice(io.value,1);ti>io.value&&(ti-=1),Xo.splice(ti,0,si),$r.updateProps(Mr.value,{keyPath:["config",ai,"value","order"],value:Xo}),posthogCapture(`drag_${co.value}_end`)},Bo=()=>{let ti,ai;if(ao.value!==null){if(ao.value>=Yr.value.length){const Xo=Yr.value.slice(-1)[0];ti={...Xo,top:Xo.bottom}}else ti=Yr.value[ao.value];ai=ao.value}else if(lo.value!==null){if(lo.value>=Yr.value.length){const Xo=Yr.value.slice(-1)[0];ti={...Xo,left:Xo.right}}else ti=Yr.value[lo.value];ai=lo.value}return{newPos:ti,newDropzoneInd:ai}},bo=()=>{Yr.value=[],go.value.forEach(ti=>{const ai=document.getElementById(ti),Xo=ai==null?void 0:ai.getBoundingClientRect();Xo!=null&&Yr.value.push(Xo)})},{scrollElIfNeeded:vo,stopScrolling:Io}=useElScroll({update:bo}),To=(ti,ai)=>{if(ti==="drag-move"){if(!Kr.value)return;const Xo=ai[0];co.value==="rows"?Kr.value.style.top=`${Xo.pageY-Zr.value}px`:Kr.value.style.left=`${Xo.pageX-Xr.value}px`;return}if(co.value==="rows")switch(ti){case"drag-over":Ao(...ai);break;case"save":Oo(...ai,"rowStore");break}else switch(ti){case"drag-over":zo(...ai);break;case"save":Oo(...ai,"colStore");break}},Co=ti=>{if(!Nr.value)return;co.value&&(eo.value=ti.clientX,Wr.value=ti.clientY);const ai=Eo("ghost");if(ai==null)return!1;To("drag-over",[ai])},Po=ti=>{ti.preventDefault(),vo(ti),To("drag-move",[ti]),Co(ti)},Fo=()=>{Ar.setRowIdsBeingDragged([]),Ar.setColIdsBeingDragged([]),No(),mo.value=null,ao.value=null,lo.value=null,co.value=null,Io()},Vo=async ti=>{if(ti.preventDefault(),document.removeEventListener("mousemove",Po),document.removeEventListener("mouseup",Vo),!co.value){Fo();return}if(mo.value===null){Fo();return}if(ao.value==null&&lo.value==null){Fo();return}if(!uo.value){Fo();return}if(!Eo("ghost")){Fo();return}const{newPos:Xo,newDropzoneInd:si}=Bo();if(si===null){Fo();return}ao.value=null,lo.value=null,await nextTick(),To("save",[si]),Fo()},Ko=async(ti,ai)=>{const Xo=ai.map(vi=>document.getElementById(vi));if(Xo.some(vi=>!vi))return;Ur(),bo();const si=zr.value.cloneNode(!1);Xo.forEach(vi=>{var bi;let Ci;co.value==="rows"?Ci=`${vi.getBoundingClientRect().height}px`:Ci=`${(bi=vi.parentElement)==null?void 0:bi.getBoundingClientRect().height}px`;const wi=vi.cloneNode(!0);wi.style.height=Ci,si.appendChild(wi)}),Kr.value=si,Mo(ti),document.addEventListener("mousemove",Po),document.addEventListener("mouseup",Vo)},Uo=ref([]),ei=ref(null),qo=async ti=>{var si,vi;if(!no.value||!((si=ro.value)!=null&&si.length))return!1;const ai=Math.abs(ti.clientX-Jr.value.x),Xo=Math.abs(ti.clientY-Jr.value.y);if(ai>so.value||Xo>so.value){co.value=ei.value;const Ci=[...ro.value];if(mo.value=Ci[0],co.value==="rows")go.value=Lr.value,Ar.setRowIdsBeingDragged(Ci);else{if(!((vi=Hr.value)!=null&&vi.length))return!1;go.value=Hr.value,Ar.setColIdsBeingDragged(Uo.value)}document.removeEventListener("mousemove",qo),ti.preventDefault(),await Ko(ti,Ci)}},ri=()=>{ro.value=null,no.value=!1,ei.value=null,document.removeEventListener("mouseup",ri),document.removeEventListener("mousemove",qo)};return{dropzoneNotAroundDraggedEl:uo,startDragPosition:Jr,dropzoneRowInd:ao,dropzoneColInd:lo,draggingType:co,mousePressed:no,tempDragIds:ro,dragTableSetup:(ti,ai,Xo,si)=>{Jr.value={x:ti.clientX,y:ti.clientY},no.value=!0,ro.value=Xo,ei.value=ai,Uo.value=si,ti.preventDefault(),document.addEventListener("mousemove",qo),document.addEventListener("mouseup",ri)}}},Placeholder=Extension.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("placeholder"),props:{decorations:({doc:Tr,selection:Cr})=>{const $r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:Ar}=Cr,Rr=[];if(!$r)return null;const Dr=Tr.type.createAndFill(),Mr=(Dr==null?void 0:Dr.sameMarkup(Tr))&&Dr.content.findDiffStart(Tr.content)===null;return Tr.descendants((Br,Nr)=>{const Lr=Ar>=Nr&&Ar<=Nr+Br.nodeSize,Hr=!Br.isLeaf&&!Br.childCount;if((Lr||!this.options.showOnlyCurrent)&&Hr){const zr=[this.options.emptyNodeClass];Mr&&zr.push(this.options.emptyEditorClass);const Ur=Decoration.node(Nr,Nr+Br.nodeSize,{class:zr.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:Br,pos:Nr,hasAnchor:Lr}):this.options.placeholder});Rr.push(Ur)}return this.options.includeChildren}),DecorationSet.create(Tr,Rr)}}})]}}),decodeCache$1={};function getDecodeCache$1(Tr){let Cr=decodeCache$1[Tr];if(Cr)return Cr;Cr=decodeCache$1[Tr]=[];for(let $r=0;$r<128;$r++){const Ar=String.fromCharCode($r);Cr.push(Ar)}for(let $r=0;$r=55296&&Hr<=57343?Rr+="���":Rr+=String.fromCharCode(Hr),Dr+=6;continue}}if((Br&248)===240&&Dr+91114111?Rr+="����":(zr-=65536,Rr+=String.fromCharCode(55296+(zr>>10),56320+(zr&1023))),Dr+=9;continue}}Rr+="�"}return Rr})}decode$3.defaultChars=";/?:@&=+$,#";decode$3.componentChars="";const encodeCache$1={};function getEncodeCache$1(Tr){let Cr=encodeCache$1[Tr];if(Cr)return Cr;Cr=encodeCache$1[Tr]=[];for(let $r=0;$r<128;$r++){const Ar=String.fromCharCode($r);/^[0-9a-z]$/i.test(Ar)?Cr.push(Ar):Cr.push("%"+("0"+$r.toString(16).toUpperCase()).slice(-2))}for(let $r=0;$r"u"&&($r=!0);const Ar=getEncodeCache$1(Cr);let Rr="";for(let Dr=0,Mr=Tr.length;Dr=55296&&Br<=57343){if(Br>=55296&&Br<=56319&&Dr+1=56320&&Nr<=57343){Rr+=encodeURIComponent(Tr[Dr]+Tr[Dr+1]),Dr++;continue}}Rr+="%EF%BF%BD";continue}Rr+=encodeURIComponent(Tr[Dr])}return Rr}encode$3.defaultChars=";/?:@&=+$,-_.!~*'()#";encode$3.componentChars="-_.!~*'()";function format$1(Tr){let Cr="";return Cr+=Tr.protocol||"",Cr+=Tr.slashes?"//":"",Cr+=Tr.auth?Tr.auth+"@":"",Tr.hostname&&Tr.hostname.indexOf(":")!==-1?Cr+="["+Tr.hostname+"]":Cr+=Tr.hostname||"",Cr+=Tr.port?":"+Tr.port:"",Cr+=Tr.pathname||"",Cr+=Tr.search||"",Cr+=Tr.hash||"",Cr}function Url$1(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const protocolPattern$1=/^([a-z0-9.+-]+:)/i,portPattern$1=/:[0-9]*$/,simplePathPattern$1=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims$1=["<",">",'"',"`"," ","\r",` `," "],unwise$1=["{","}","|","\\","^","`"].concat(delims$1),autoEscape$1=["'"].concat(unwise$1),nonHostChars$1=["%","/","?",";","#"].concat(autoEscape$1),hostEndingChars$1=["/","?","#"],hostnameMaxLen$1=255,hostnamePartPattern$1=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart$1=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,hostlessProtocol$1={javascript:!0,"javascript:":!0},slashedProtocol$1={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function urlParse$1(Tr,Cr){if(Tr&&Tr instanceof Url$1)return Tr;const $r=new Url$1;return $r.parse(Tr,Cr),$r}Url$1.prototype.parse=function(Tr,Cr){let $r,Ar,Rr,Dr=Tr;if(Dr=Dr.trim(),!Cr&&Tr.split("#").length===1){const Lr=simplePathPattern$1.exec(Dr);if(Lr)return this.pathname=Lr[1],Lr[2]&&(this.search=Lr[2]),this}let Mr=protocolPattern$1.exec(Dr);if(Mr&&(Mr=Mr[0],$r=Mr.toLowerCase(),this.protocol=Mr,Dr=Dr.substr(Mr.length)),(Cr||Mr||Dr.match(/^\/\/[^@\/]+@[^@\/]+/))&&(Rr=Dr.substr(0,2)==="//",Rr&&!(Mr&&hostlessProtocol$1[Mr])&&(Dr=Dr.substr(2),this.slashes=!0)),!hostlessProtocol$1[Mr]&&(Rr||Mr&&!slashedProtocol$1[Mr])){let Lr=-1;for(let jr=0;jr127?Zr+="x":Zr+=Kr[eo];if(!Zr.match(hostnamePartPattern$1)){const eo=jr.slice(0,Gr),Wr=jr.slice(Gr+1),Yr=Kr.match(hostnamePartStart$1);Yr&&(eo.push(Yr[1]),Wr.unshift(Yr[2])),Wr.length&&(Dr=Wr.join(".")+Dr),this.hostname=eo.join(".");break}}}}this.hostname.length>hostnameMaxLen$1&&(this.hostname=""),Vr&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const Br=Dr.indexOf("#");Br!==-1&&(this.hash=Dr.substr(Br),Dr=Dr.slice(0,Br));const Nr=Dr.indexOf("?");return Nr!==-1&&(this.search=Dr.substr(Nr),Dr=Dr.slice(0,Nr)),Dr&&(this.pathname=Dr),slashedProtocol$1[$r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Url$1.prototype.parseHost=function(Tr){let Cr=portPattern$1.exec(Tr);Cr&&(Cr=Cr[0],Cr!==":"&&(this.port=Cr.substr(1)),Tr=Tr.substr(0,Tr.length-Cr.length)),Tr&&(this.hostname=Tr)};const mdurl$2=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$3,encode:encode$3,format:format$1,parse:urlParse$1},Symbol.toStringTag,{value:"Module"})),Any=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc=/[\0-\x1F\x7F-\x9F]/,regex$5=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Z=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,ucmicro=Object.freeze(Object.defineProperty({__proto__:null,Any,Cc,Cf:regex$5,P,Z},Symbol.toStringTag,{value:"Module"})),htmlDecodeTree=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(Tr=>Tr.charCodeAt(0))),xmlDecodeTree=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(Tr=>Tr.charCodeAt(0)));var _a;const decodeMap=new Map([[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]]),fromCodePoint$2=(_a=String.fromCodePoint)!==null&&_a!==void 0?_a:function(Tr){let Cr="";return Tr>65535&&(Tr-=65536,Cr+=String.fromCharCode(Tr>>>10&1023|55296),Tr=56320|Tr&1023),Cr+=String.fromCharCode(Tr),Cr};function replaceCodePoint(Tr){var Cr;return Tr>=55296&&Tr<=57343||Tr>1114111?65533:(Cr=decodeMap.get(Tr))!==null&&Cr!==void 0?Cr:Tr}var CharCodes;(function(Tr){Tr[Tr.NUM=35]="NUM",Tr[Tr.SEMI=59]="SEMI",Tr[Tr.EQUALS=61]="EQUALS",Tr[Tr.ZERO=48]="ZERO",Tr[Tr.NINE=57]="NINE",Tr[Tr.LOWER_A=97]="LOWER_A",Tr[Tr.LOWER_F=102]="LOWER_F",Tr[Tr.LOWER_X=120]="LOWER_X",Tr[Tr.LOWER_Z=122]="LOWER_Z",Tr[Tr.UPPER_A=65]="UPPER_A",Tr[Tr.UPPER_F=70]="UPPER_F",Tr[Tr.UPPER_Z=90]="UPPER_Z"})(CharCodes||(CharCodes={}));const TO_LOWER_BIT=32;var BinTrieFlags;(function(Tr){Tr[Tr.VALUE_LENGTH=49152]="VALUE_LENGTH",Tr[Tr.BRANCH_LENGTH=16256]="BRANCH_LENGTH",Tr[Tr.JUMP_TABLE=127]="JUMP_TABLE"})(BinTrieFlags||(BinTrieFlags={}));function isNumber(Tr){return Tr>=CharCodes.ZERO&&Tr<=CharCodes.NINE}function isHexadecimalCharacter(Tr){return Tr>=CharCodes.UPPER_A&&Tr<=CharCodes.UPPER_F||Tr>=CharCodes.LOWER_A&&Tr<=CharCodes.LOWER_F}function isAsciiAlphaNumeric(Tr){return Tr>=CharCodes.UPPER_A&&Tr<=CharCodes.UPPER_Z||Tr>=CharCodes.LOWER_A&&Tr<=CharCodes.LOWER_Z||isNumber(Tr)}function isEntityInAttributeInvalidEnd(Tr){return Tr===CharCodes.EQUALS||isAsciiAlphaNumeric(Tr)}var EntityDecoderState;(function(Tr){Tr[Tr.EntityStart=0]="EntityStart",Tr[Tr.NumericStart=1]="NumericStart",Tr[Tr.NumericDecimal=2]="NumericDecimal",Tr[Tr.NumericHex=3]="NumericHex",Tr[Tr.NamedEntity=4]="NamedEntity"})(EntityDecoderState||(EntityDecoderState={}));var DecodingMode;(function(Tr){Tr[Tr.Legacy=0]="Legacy",Tr[Tr.Strict=1]="Strict",Tr[Tr.Attribute=2]="Attribute"})(DecodingMode||(DecodingMode={}));class EntityDecoder{constructor(Cr,$r,Ar){this.decodeTree=Cr,this.emitCodePoint=$r,this.errors=Ar,this.state=EntityDecoderState.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=DecodingMode.Strict}startEntity(Cr){this.decodeMode=Cr,this.state=EntityDecoderState.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(Cr,$r){switch(this.state){case EntityDecoderState.EntityStart:return Cr.charCodeAt($r)===CharCodes.NUM?(this.state=EntityDecoderState.NumericStart,this.consumed+=1,this.stateNumericStart(Cr,$r+1)):(this.state=EntityDecoderState.NamedEntity,this.stateNamedEntity(Cr,$r));case EntityDecoderState.NumericStart:return this.stateNumericStart(Cr,$r);case EntityDecoderState.NumericDecimal:return this.stateNumericDecimal(Cr,$r);case EntityDecoderState.NumericHex:return this.stateNumericHex(Cr,$r);case EntityDecoderState.NamedEntity:return this.stateNamedEntity(Cr,$r)}}stateNumericStart(Cr,$r){return $r>=Cr.length?-1:(Cr.charCodeAt($r)|TO_LOWER_BIT)===CharCodes.LOWER_X?(this.state=EntityDecoderState.NumericHex,this.consumed+=1,this.stateNumericHex(Cr,$r+1)):(this.state=EntityDecoderState.NumericDecimal,this.stateNumericDecimal(Cr,$r))}addToNumericResult(Cr,$r,Ar,Rr){if($r!==Ar){const Dr=Ar-$r;this.result=this.result*Math.pow(Rr,Dr)+parseInt(Cr.substr($r,Dr),Rr),this.consumed+=Dr}}stateNumericHex(Cr,$r){const Ar=$r;for(;$r>14;for(;$r>14,Dr!==0){if(Mr===CharCodes.SEMI)return this.emitNamedEntityData(this.treeIndex,Dr,this.consumed+this.excess);this.decodeMode!==DecodingMode.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var Cr;const{result:$r,decodeTree:Ar}=this,Rr=(Ar[$r]&BinTrieFlags.VALUE_LENGTH)>>14;return this.emitNamedEntityData($r,Rr,this.consumed),(Cr=this.errors)===null||Cr===void 0||Cr.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(Cr,$r,Ar){const{decodeTree:Rr}=this;return this.emitCodePoint($r===1?Rr[Cr]&~BinTrieFlags.VALUE_LENGTH:Rr[Cr+1],Ar),$r===3&&this.emitCodePoint(Rr[Cr+2],Ar),Ar}end(){var Cr;switch(this.state){case EntityDecoderState.NamedEntity:return this.result!==0&&(this.decodeMode!==DecodingMode.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case EntityDecoderState.NumericDecimal:return this.emitNumericEntity(0,2);case EntityDecoderState.NumericHex:return this.emitNumericEntity(0,3);case EntityDecoderState.NumericStart:return(Cr=this.errors)===null||Cr===void 0||Cr.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case EntityDecoderState.EntityStart:return 0}}}function getDecoder(Tr){let Cr="";const $r=new EntityDecoder(Tr,Ar=>Cr+=fromCodePoint$2(Ar));return function(Rr,Dr){let Mr=0,Br=0;for(;(Br=Rr.indexOf("&",Br))>=0;){Cr+=Rr.slice(Mr,Br),$r.startEntity(Dr);const Lr=$r.write(Rr,Br+1);if(Lr<0){Mr=Br+$r.end();break}Mr=Br+Lr,Br=Lr===0?Mr+1:Mr}const Nr=Cr+Rr.slice(Mr);return Cr="",Nr}}function determineBranch(Tr,Cr,$r,Ar){const Rr=(Cr&BinTrieFlags.BRANCH_LENGTH)>>7,Dr=Cr&BinTrieFlags.JUMP_TABLE;if(Rr===0)return Dr!==0&&Ar===Dr?$r:-1;if(Dr){const Nr=Ar-Dr;return Nr<0||Nr>=Rr?-1:Tr[$r+Nr]-1}let Mr=$r,Br=Mr+Rr-1;for(;Mr<=Br;){const Nr=Mr+Br>>>1,Lr=Tr[Nr];if(LrAr)Br=Nr-1;else return Tr[Nr+Rr]}return-1}const htmlDecoder=getDecoder(htmlDecodeTree);getDecoder(xmlDecodeTree);function decodeHTML(Tr,Cr=DecodingMode.Legacy){return htmlDecoder(Tr,Cr)}function _class$2(Tr){return Object.prototype.toString.call(Tr)}function isString$2(Tr){return _class$2(Tr)==="[object String]"}const _hasOwnProperty=Object.prototype.hasOwnProperty;function has$1(Tr,Cr){return _hasOwnProperty.call(Tr,Cr)}function assign$3(Tr){return Array.prototype.slice.call(arguments,1).forEach(function($r){if($r){if(typeof $r!="object")throw new TypeError($r+"must be object");Object.keys($r).forEach(function(Ar){Tr[Ar]=$r[Ar]})}}),Tr}function arrayReplaceAt$1(Tr,Cr,$r){return[].concat(Tr.slice(0,Cr),$r,Tr.slice(Cr+1))}function isValidEntityCode$1(Tr){return!(Tr>=55296&&Tr<=57343||Tr>=64976&&Tr<=65007||(Tr&65535)===65535||(Tr&65535)===65534||Tr>=0&&Tr<=8||Tr===11||Tr>=14&&Tr<=31||Tr>=127&&Tr<=159||Tr>1114111)}function fromCodePoint$1(Tr){if(Tr>65535){Tr-=65536;const Cr=55296+(Tr>>10),$r=56320+(Tr&1023);return String.fromCharCode(Cr,$r)}return String.fromCharCode(Tr)}const UNESCAPE_MD_RE=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,ENTITY_RE=/&([a-z#][a-z0-9]{1,31});/gi,UNESCAPE_ALL_RE=new RegExp(UNESCAPE_MD_RE.source+"|"+ENTITY_RE.source,"gi"),DIGITAL_ENTITY_TEST_RE=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function replaceEntityPattern(Tr,Cr){if(Cr.charCodeAt(0)===35&&DIGITAL_ENTITY_TEST_RE.test(Cr)){const Ar=Cr[1].toLowerCase()==="x"?parseInt(Cr.slice(2),16):parseInt(Cr.slice(1),10);return isValidEntityCode$1(Ar)?fromCodePoint$1(Ar):Tr}const $r=decodeHTML(Tr);return $r!==Tr?$r:Tr}function unescapeMd(Tr){return Tr.indexOf("\\")<0?Tr:Tr.replace(UNESCAPE_MD_RE,"$1")}function unescapeAll$3(Tr){return Tr.indexOf("\\")<0&&Tr.indexOf("&")<0?Tr:Tr.replace(UNESCAPE_ALL_RE,function(Cr,$r,Ar){return $r||replaceEntityPattern(Cr,Ar)})}const HTML_ESCAPE_TEST_RE=/[&<>"]/,HTML_ESCAPE_REPLACE_RE=/[&<>"]/g,HTML_REPLACEMENTS={"&":"&","<":"<",">":">",'"':"""};function replaceUnsafeChar(Tr){return HTML_REPLACEMENTS[Tr]}function escapeHtml$1(Tr){return HTML_ESCAPE_TEST_RE.test(Tr)?Tr.replace(HTML_ESCAPE_REPLACE_RE,replaceUnsafeChar):Tr}const REGEXP_ESCAPE_RE=/[.?*+^$[\]\\(){}|-]/g;function escapeRE$2(Tr){return Tr.replace(REGEXP_ESCAPE_RE,"\\$&")}function isSpace$b(Tr){switch(Tr){case 9:case 32:return!0}return!1}function isWhiteSpace$2(Tr){if(Tr>=8192&&Tr<=8202)return!0;switch(Tr){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function isPunctChar$2(Tr){return P.test(Tr)}function isMdAsciiPunct$2(Tr){switch(Tr){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function normalizeReference$3(Tr){return Tr=Tr.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(Tr=Tr.replace(/ẞ/g,"ß")),Tr.toLowerCase().toUpperCase()}const lib$1={mdurl:mdurl$2,ucmicro},utils$2=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:arrayReplaceAt$1,assign:assign$3,escapeHtml:escapeHtml$1,escapeRE:escapeRE$2,fromCodePoint:fromCodePoint$1,has:has$1,isMdAsciiPunct:isMdAsciiPunct$2,isPunctChar:isPunctChar$2,isSpace:isSpace$b,isString:isString$2,isValidEntityCode:isValidEntityCode$1,isWhiteSpace:isWhiteSpace$2,lib:lib$1,normalizeReference:normalizeReference$3,unescapeAll:unescapeAll$3,unescapeMd},Symbol.toStringTag,{value:"Module"}));function parseLinkLabel(Tr,Cr,$r){let Ar,Rr,Dr,Mr;const Br=Tr.posMax,Nr=Tr.pos;for(Tr.pos=Cr+1,Ar=1;Tr.pos32))return Dr;if(Ar===41){if(Mr===0)break;Mr--}Rr++}return Cr===Rr||Mr!==0||(Dr.str=unescapeAll$3(Tr.slice(Cr,Rr)),Dr.pos=Rr,Dr.ok=!0),Dr}function parseLinkTitle(Tr,Cr,$r){let Ar,Rr,Dr=0,Mr=Cr;const Br={ok:!1,pos:0,lines:0,str:""};if(Mr>=$r||(Rr=Tr.charCodeAt(Mr),Rr!==34&&Rr!==39&&Rr!==40))return Br;for(Mr++,Rr===40&&(Rr=41);Mr<$r;){if(Ar=Tr.charCodeAt(Mr),Ar===Rr)return Br.pos=Mr+1,Br.lines=Dr,Br.str=unescapeAll$3(Tr.slice(Cr+1,Mr)),Br.ok=!0,Br;if(Ar===40&&Rr===41)return Br;Ar===10?Dr++:Ar===92&&Mr+1<$r&&(Mr++,Tr.charCodeAt(Mr)===10&&Dr++),Mr++}return Br}const helpers$2=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination,parseLinkLabel,parseLinkTitle},Symbol.toStringTag,{value:"Module"})),default_rules$1={};default_rules$1.code_inline=function(Tr,Cr,$r,Ar,Rr){const Dr=Tr[Cr];return""+escapeHtml$1(Dr.content)+""};default_rules$1.code_block=function(Tr,Cr,$r,Ar,Rr){const Dr=Tr[Cr];return""+escapeHtml$1(Tr[Cr].content)+` `};default_rules$1.fence=function(Tr,Cr,$r,Ar,Rr){const Dr=Tr[Cr],Mr=Dr.info?unescapeAll$3(Dr.info).trim():"";let Br="",Nr="";if(Mr){const Hr=Mr.split(/(\s+)/g);Br=Hr[0],Nr=Hr.slice(2).join("")}let Lr;if($r.highlight?Lr=$r.highlight(Dr.content,Br,Nr)||escapeHtml$1(Dr.content):Lr=escapeHtml$1(Dr.content),Lr.indexOf("${Lr} `}return`
${Lr}
`};default_rules$1.image=function(Tr,Cr,$r,Ar,Rr){const Dr=Tr[Cr];return Dr.attrs[Dr.attrIndex("alt")][1]=Rr.renderInlineAsText(Dr.children,$r,Ar),Rr.renderToken(Tr,Cr,$r)};default_rules$1.hardbreak=function(Tr,Cr,$r){return $r.xhtmlOut?`
`:`
`};default_rules$1.softbreak=function(Tr,Cr,$r){return $r.breaks?$r.xhtmlOut?`
`:`
`:` `};default_rules$1.text=function(Tr,Cr){return escapeHtml$1(Tr[Cr].content)};default_rules$1.html_block=function(Tr,Cr){return Tr[Cr].content};default_rules$1.html_inline=function(Tr,Cr){return Tr[Cr].content};function Renderer$2(){this.rules=assign$3({},default_rules$1)}Renderer$2.prototype.renderAttrs=function(Cr){let $r,Ar,Rr;if(!Cr.attrs)return"";for(Rr="",$r=0,Ar=Cr.attrs.length;$r `:">",Dr};Renderer$2.prototype.renderInline=function(Tr,Cr,$r){let Ar="";const Rr=this.rules;for(let Dr=0,Mr=Tr.length;Dr=0&&(Ar=this.attrs[$r][1]),Ar};Token$4.prototype.attrJoin=function(Cr,$r){const Ar=this.attrIndex(Cr);Ar<0?this.attrPush([Cr,$r]):this.attrs[Ar][1]=this.attrs[Ar][1]+" "+$r};function StateCore$1(Tr,Cr,$r){this.src=Tr,this.env=$r,this.tokens=[],this.inlineMode=!1,this.md=Cr}StateCore$1.prototype.Token=Token$4;const NEWLINES_RE$1=/\r\n?|\n/g,NULL_RE$1=/\0/g;function normalize$1(Tr){let Cr;Cr=Tr.src.replace(NEWLINES_RE$1,` `),Cr=Cr.replace(NULL_RE$1,"�"),Tr.src=Cr}function block$2(Tr){let Cr;Tr.inlineMode?(Cr=new Tr.Token("inline","",0),Cr.content=Tr.src,Cr.map=[0,1],Cr.children=[],Tr.tokens.push(Cr)):Tr.md.block.parse(Tr.src,Tr.md,Tr.env,Tr.tokens)}function inline$1(Tr){const Cr=Tr.tokens;for(let $r=0,Ar=Cr.length;$r\s]/i.test(Tr)}function isLinkClose$3(Tr){return/^<\/a\s*>/i.test(Tr)}function linkify$3(Tr){const Cr=Tr.tokens;if(Tr.md.options.linkify)for(let $r=0,Ar=Cr.length;$r=0;Mr--){const Br=Rr[Mr];if(Br.type==="link_close"){for(Mr--;Rr[Mr].level!==Br.level&&Rr[Mr].type!=="link_open";)Mr--;continue}if(Br.type==="html_inline"&&(isLinkOpen$3(Br.content)&&Dr>0&&Dr--,isLinkClose$3(Br.content)&&Dr++),!(Dr>0)&&Br.type==="text"&&Tr.md.linkify.test(Br.content)){const Nr=Br.content;let Lr=Tr.md.linkify.match(Nr);const Hr=[];let zr=Br.level,Ur=0;Lr.length>0&&Lr[0].index===0&&Mr>0&&Rr[Mr-1].type==="text_special"&&(Lr=Lr.slice(1));for(let Vr=0;VrUr){const Yr=new Tr.Token("text","",0);Yr.content=Nr.slice(Ur,Kr),Yr.level=zr,Hr.push(Yr)}const Zr=new Tr.Token("link_open","a",1);Zr.attrs=[["href",Gr]],Zr.level=zr++,Zr.markup="linkify",Zr.info="auto",Hr.push(Zr);const eo=new Tr.Token("text","",0);eo.content=Xr,eo.level=zr,Hr.push(eo);const Wr=new Tr.Token("link_close","a",-1);Wr.level=--zr,Wr.markup="linkify",Wr.info="auto",Hr.push(Wr),Ur=Lr[Vr].lastIndex}if(Ur=0;$r--){const Ar=Tr[$r];Ar.type==="text"&&!Cr&&(Ar.content=Ar.content.replace(SCOPED_ABBR_RE$1,replaceFn$1)),Ar.type==="link_open"&&Ar.info==="auto"&&Cr--,Ar.type==="link_close"&&Ar.info==="auto"&&Cr++}}function replace_rare$1(Tr){let Cr=0;for(let $r=Tr.length-1;$r>=0;$r--){const Ar=Tr[$r];Ar.type==="text"&&!Cr&&RARE_RE$1.test(Ar.content)&&(Ar.content=Ar.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),Ar.type==="link_open"&&Ar.info==="auto"&&Cr--,Ar.type==="link_close"&&Ar.info==="auto"&&Cr++}}function replace(Tr){let Cr;if(Tr.md.options.typographer)for(Cr=Tr.tokens.length-1;Cr>=0;Cr--)Tr.tokens[Cr].type==="inline"&&(SCOPED_ABBR_TEST_RE$1.test(Tr.tokens[Cr].content)&&replace_scoped$1(Tr.tokens[Cr].children),RARE_RE$1.test(Tr.tokens[Cr].content)&&replace_rare$1(Tr.tokens[Cr].children))}const QUOTE_TEST_RE$1=/['"]/,QUOTE_RE$1=/['"]/g,APOSTROPHE$1="’";function replaceAt$1(Tr,Cr,$r){return Tr.slice(0,Cr)+$r+Tr.slice(Cr+1)}function process_inlines$1(Tr,Cr){let $r;const Ar=[];for(let Rr=0;Rr=0&&!(Ar[$r].level<=Mr);$r--);if(Ar.length=$r+1,Dr.type!=="text")continue;let Br=Dr.content,Nr=0,Lr=Br.length;e:for(;Nr=0)jr=Br.charCodeAt(Hr.index-1);else for($r=Rr-1;$r>=0&&!(Tr[$r].type==="softbreak"||Tr[$r].type==="hardbreak");$r--)if(Tr[$r].content){jr=Tr[$r].content.charCodeAt(Tr[$r].content.length-1);break}let Gr=32;if(Nr=48&&jr<=57&&(Ur=zr=!1),zr&&Ur&&(zr=Xr,Ur=Kr),!zr&&!Ur){Vr&&(Dr.content=replaceAt$1(Dr.content,Hr.index,APOSTROPHE$1));continue}if(Ur)for($r=Ar.length-1;$r>=0;$r--){let Wr=Ar[$r];if(Ar[$r].level=0;Cr--)Tr.tokens[Cr].type!=="inline"||!QUOTE_TEST_RE$1.test(Tr.tokens[Cr].content)||process_inlines$1(Tr.tokens[Cr].children,Tr)}function text_join$1(Tr){let Cr,$r;const Ar=Tr.tokens,Rr=Ar.length;for(let Dr=0;Dr0&&this.level++,this.tokens.push(Ar),Ar};StateBlock$1.prototype.isEmpty=function(Cr){return this.bMarks[Cr]+this.tShift[Cr]>=this.eMarks[Cr]};StateBlock$1.prototype.skipEmptyLines=function(Cr){for(let $r=this.lineMax;Cr<$r&&!(this.bMarks[Cr]+this.tShift[Cr]$r;)if(!isSpace$b(this.src.charCodeAt(--Cr)))return Cr+1;return Cr};StateBlock$1.prototype.skipChars=function(Cr,$r){for(let Ar=this.src.length;CrAr;)if($r!==this.src.charCodeAt(--Cr))return Cr+1;return Cr};StateBlock$1.prototype.getLines=function(Cr,$r,Ar,Rr){if(Cr>=$r)return"";const Dr=new Array($r-Cr);for(let Mr=0,Br=Cr;Br<$r;Br++,Mr++){let Nr=0;const Lr=this.bMarks[Br];let Hr=Lr,zr;for(Br+1<$r||Rr?zr=this.eMarks[Br]+1:zr=this.eMarks[Br];HrAr?Dr[Mr]=new Array(Nr-Ar+1).join(" ")+this.src.slice(Hr,zr):Dr[Mr]=this.src.slice(Hr,zr)}return Dr.join("")};StateBlock$1.prototype.Token=Token$4;function getLine$1(Tr,Cr){const $r=Tr.bMarks[Cr]+Tr.tShift[Cr],Ar=Tr.eMarks[Cr];return Tr.src.slice($r,Ar)}function escapedSplit$1(Tr){const Cr=[],$r=Tr.length;let Ar=0,Rr=Tr.charCodeAt(Ar),Dr=!1,Mr=0,Br="";for(;Ar<$r;)Rr===124&&(Dr?(Br+=Tr.substring(Mr,Ar-1),Mr=Ar):(Cr.push(Br+Tr.substring(Mr,Ar)),Br="",Mr=Ar+1)),Dr=Rr===92,Ar++,Rr=Tr.charCodeAt(Ar);return Cr.push(Br+Tr.substring(Mr)),Cr}function table$1(Tr,Cr,$r,Ar){if(Cr+2>$r)return!1;let Rr=Cr+1;if(Tr.sCount[Rr]=4)return!1;let Dr=Tr.bMarks[Rr]+Tr.tShift[Rr];if(Dr>=Tr.eMarks[Rr])return!1;const Mr=Tr.src.charCodeAt(Dr++);if(Mr!==124&&Mr!==45&&Mr!==58||Dr>=Tr.eMarks[Rr])return!1;const Br=Tr.src.charCodeAt(Dr++);if(Br!==124&&Br!==45&&Br!==58&&!isSpace$b(Br)||Mr===45&&isSpace$b(Br))return!1;for(;Dr=4)return!1;Lr=escapedSplit$1(Nr),Lr.length&&Lr[0]===""&&Lr.shift(),Lr.length&&Lr[Lr.length-1]===""&&Lr.pop();const zr=Lr.length;if(zr===0||zr!==Hr.length)return!1;if(Ar)return!0;const Ur=Tr.parentType;Tr.parentType="table";const Vr=Tr.md.block.ruler.getRules("blockquote"),jr=Tr.push("table_open","table",1),Gr=[Cr,0];jr.map=Gr;const Xr=Tr.push("thead_open","thead",1);Xr.map=[Cr,Cr+1];const Kr=Tr.push("tr_open","tr",1);Kr.map=[Cr,Cr+1];for(let eo=0;eo=4)break;if(Lr=escapedSplit$1(Nr),Lr.length&&Lr[0]===""&&Lr.shift(),Lr.length&&Lr[Lr.length-1]===""&&Lr.pop(),Rr===Cr+2){const Yr=Tr.push("tbody_open","tbody",1);Yr.map=Zr=[Cr+2,0]}const Wr=Tr.push("tr_open","tr",1);Wr.map=[Rr,Rr+1];for(let Yr=0;Yr=4){Ar++,Rr=Ar;continue}break}Tr.line=Rr;const Dr=Tr.push("code_block","code",0);return Dr.content=Tr.getLines(Cr,Rr,4+Tr.blkIndent,!1)+` `,Dr.map=[Cr,Tr.line],!0}function fence$1(Tr,Cr,$r,Ar){let Rr=Tr.bMarks[Cr]+Tr.tShift[Cr],Dr=Tr.eMarks[Cr];if(Tr.sCount[Cr]-Tr.blkIndent>=4||Rr+3>Dr)return!1;const Mr=Tr.src.charCodeAt(Rr);if(Mr!==126&&Mr!==96)return!1;let Br=Rr;Rr=Tr.skipChars(Rr,Mr);let Nr=Rr-Br;if(Nr<3)return!1;const Lr=Tr.src.slice(Br,Rr),Hr=Tr.src.slice(Rr,Dr);if(Mr===96&&Hr.indexOf(String.fromCharCode(Mr))>=0)return!1;if(Ar)return!0;let zr=Cr,Ur=!1;for(;zr++,!(zr>=$r||(Rr=Br=Tr.bMarks[zr]+Tr.tShift[zr],Dr=Tr.eMarks[zr],Rr=4)&&(Rr=Tr.skipChars(Rr,Mr),!(Rr-Br=4||Tr.src.charCodeAt(Rr)!==62)return!1;if(Ar)return!0;const Br=[],Nr=[],Lr=[],Hr=[],zr=Tr.md.block.ruler.getRules("blockquote"),Ur=Tr.parentType;Tr.parentType="blockquote";let Vr=!1,jr;for(jr=Cr;jr<$r;jr++){const eo=Tr.sCount[jr]=Dr)break;if(Tr.src.charCodeAt(Rr++)===62&&!eo){let Yr=Tr.sCount[jr]+1,Jr,no;Tr.src.charCodeAt(Rr)===32?(Rr++,Yr++,no=!1,Jr=!0):Tr.src.charCodeAt(Rr)===9?(Jr=!0,(Tr.bsCount[jr]+Yr)%4===3?(Rr++,Yr++,no=!1):no=!0):Jr=!1;let ro=Yr;for(Br.push(Tr.bMarks[jr]),Tr.bMarks[jr]=Rr;Rr=Dr,Nr.push(Tr.bsCount[jr]),Tr.bsCount[jr]=Tr.sCount[jr]+1+(Jr?1:0),Lr.push(Tr.sCount[jr]),Tr.sCount[jr]=ro-Yr,Hr.push(Tr.tShift[jr]),Tr.tShift[jr]=Rr-Tr.bMarks[jr];continue}if(Vr)break;let Wr=!1;for(let Yr=0,Jr=zr.length;Yr";const Kr=[Cr,0];Xr.map=Kr,Tr.md.block.tokenize(Tr,Cr,jr);const Zr=Tr.push("blockquote_close","blockquote",-1);Zr.markup=">",Tr.lineMax=Mr,Tr.parentType=Ur,Kr[1]=Tr.line;for(let eo=0;eo=4)return!1;let Dr=Tr.bMarks[Cr]+Tr.tShift[Cr];const Mr=Tr.src.charCodeAt(Dr++);if(Mr!==42&&Mr!==45&&Mr!==95)return!1;let Br=1;for(;Dr=Ar)return-1;let Dr=Tr.src.charCodeAt(Rr++);if(Dr<48||Dr>57)return-1;for(;;){if(Rr>=Ar)return-1;if(Dr=Tr.src.charCodeAt(Rr++),Dr>=48&&Dr<=57){if(Rr-$r>=10)return-1;continue}if(Dr===41||Dr===46)break;return-1}return Rr=4||Tr.listIndent>=0&&Tr.sCount[Nr]-Tr.listIndent>=4&&Tr.sCount[Nr]=Tr.blkIndent&&(Hr=!0);let zr,Ur,Vr;if((Vr=skipOrderedListMarker$1(Tr,Nr))>=0){if(zr=!0,Mr=Tr.bMarks[Nr]+Tr.tShift[Nr],Ur=Number(Tr.src.slice(Mr,Vr-1)),Hr&&Ur!==1)return!1}else if((Vr=skipBulletListMarker$1(Tr,Nr))>=0)zr=!1;else return!1;if(Hr&&Tr.skipSpaces(Vr)>=Tr.eMarks[Nr])return!1;if(Ar)return!0;const jr=Tr.src.charCodeAt(Vr-1),Gr=Tr.tokens.length;zr?(Br=Tr.push("ordered_list_open","ol",1),Ur!==1&&(Br.attrs=[["start",Ur]])):Br=Tr.push("bullet_list_open","ul",1);const Xr=[Nr,0];Br.map=Xr,Br.markup=String.fromCharCode(jr);let Kr=!1;const Zr=Tr.md.block.ruler.getRules("list"),eo=Tr.parentType;for(Tr.parentType="list";Nr<$r;){Dr=Vr,Rr=Tr.eMarks[Nr];const Wr=Tr.sCount[Nr]+Vr-(Tr.bMarks[Nr]+Tr.tShift[Nr]);let Yr=Wr;for(;Dr=Rr?no=1:no=Yr-Wr,no>4&&(no=1);const ro=Wr+no;Br=Tr.push("list_item_open","li",1),Br.markup=String.fromCharCode(jr);const so=[Nr,0];Br.map=so,zr&&(Br.info=Tr.src.slice(Mr,Vr-1));const ao=Tr.tight,lo=Tr.tShift[Nr],po=Tr.sCount[Nr],go=Tr.listIndent;if(Tr.listIndent=Tr.blkIndent,Tr.blkIndent=ro,Tr.tight=!0,Tr.tShift[Nr]=Jr-Tr.bMarks[Nr],Tr.sCount[Nr]=Yr,Jr>=Rr&&Tr.isEmpty(Nr+1)?Tr.line=Math.min(Tr.line+2,$r):Tr.md.block.tokenize(Tr,Nr,$r,!0),(!Tr.tight||Kr)&&(Lr=!1),Kr=Tr.line-Nr>1&&Tr.isEmpty(Tr.line-1),Tr.blkIndent=Tr.listIndent,Tr.listIndent=go,Tr.tShift[Nr]=lo,Tr.sCount[Nr]=po,Tr.tight=ao,Br=Tr.push("list_item_close","li",-1),Br.markup=String.fromCharCode(jr),Nr=Tr.line,so[1]=Nr,Nr>=$r||Tr.sCount[Nr]=4)break;let co=!1;for(let mo=0,io=Zr.length;mo=4||Tr.src.charCodeAt(Dr)!==91)return!1;for(;++Dr3||Tr.sCount[Br]<0)continue;let Yr=!1;for(let Jr=0,no=Lr.length;Jr"u"&&(Tr.env.references={}),typeof Tr.env.references[Wr]>"u"&&(Tr.env.references[Wr]={title:eo,href:jr}),Tr.parentType=Hr,Tr.line=Cr+Rr+1),!0):!1}const block_names$1=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],attr_name$1="[a-zA-Z_:][a-zA-Z0-9:._-]*",unquoted$1="[^\"'=<>`\\x00-\\x20]+",single_quoted$1="'[^']*'",double_quoted$1='"[^"]*"',attr_value$1="(?:"+unquoted$1+"|"+single_quoted$1+"|"+double_quoted$1+")",attribute$1="(?:\\s+"+attr_name$1+"(?:\\s*=\\s*"+attr_value$1+")?)",open_tag$1="<[A-Za-z][A-Za-z0-9\\-]*"+attribute$1+"*\\s*\\/?>",close_tag$1="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",comment$1="|",processing$1="<[?][\\s\\S]*?[?]>",declaration$1="]*>",cdata$1="",HTML_TAG_RE$2=new RegExp("^(?:"+open_tag$1+"|"+close_tag$1+"|"+comment$1+"|"+processing$1+"|"+declaration$1+"|"+cdata$1+")"),HTML_OPEN_CLOSE_TAG_RE$2=new RegExp("^(?:"+open_tag$1+"|"+close_tag$1+")"),HTML_SEQUENCES$1=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(HTML_OPEN_CLOSE_TAG_RE$2.source+"\\s*$"),/^$/,!1]];function html_block$1(Tr,Cr,$r,Ar){let Rr=Tr.bMarks[Cr]+Tr.tShift[Cr],Dr=Tr.eMarks[Cr];if(Tr.sCount[Cr]-Tr.blkIndent>=4||!Tr.md.options.html||Tr.src.charCodeAt(Rr)!==60)return!1;let Mr=Tr.src.slice(Rr,Dr),Br=0;for(;Br=4)return!1;let Mr=Tr.src.charCodeAt(Rr);if(Mr!==35||Rr>=Dr)return!1;let Br=1;for(Mr=Tr.src.charCodeAt(++Rr);Mr===35&&Rr6||RrRr&&isSpace$b(Tr.src.charCodeAt(Nr-1))&&(Dr=Nr),Tr.line=Cr+1;const Lr=Tr.push("heading_open","h"+String(Br),1);Lr.markup="########".slice(0,Br),Lr.map=[Cr,Tr.line];const Hr=Tr.push("inline","",0);Hr.content=Tr.src.slice(Rr,Dr).trim(),Hr.map=[Cr,Tr.line],Hr.children=[];const zr=Tr.push("heading_close","h"+String(Br),-1);return zr.markup="########".slice(0,Br),!0}function lheading$1(Tr,Cr,$r){const Ar=Tr.md.block.ruler.getRules("paragraph");if(Tr.sCount[Cr]-Tr.blkIndent>=4)return!1;const Rr=Tr.parentType;Tr.parentType="paragraph";let Dr=0,Mr,Br=Cr+1;for(;Br<$r&&!Tr.isEmpty(Br);Br++){if(Tr.sCount[Br]-Tr.blkIndent>3)continue;if(Tr.sCount[Br]>=Tr.blkIndent){let Vr=Tr.bMarks[Br]+Tr.tShift[Br];const jr=Tr.eMarks[Br];if(Vr=jr))){Dr=Mr===61?1:2;break}}if(Tr.sCount[Br]<0)continue;let Ur=!1;for(let Vr=0,jr=Ar.length;Vr3||Tr.sCount[Dr]<0)continue;let Lr=!1;for(let Hr=0,zr=Ar.length;Hr=$r||Tr.sCount[Mr]=Dr){Tr.line=$r;break}const Nr=Tr.line;let Lr=!1;for(let Hr=0;Hr=Tr.line)throw new Error("block rule didn't increment state.line");break}if(!Lr)throw new Error("none of the block rules matched");Tr.tight=!Br,Tr.isEmpty(Tr.line-1)&&(Br=!0),Mr=Tr.line,Mr<$r&&Tr.isEmpty(Mr)&&(Br=!0,Mr++,Tr.line=Mr)}};ParserBlock$2.prototype.parse=function(Tr,Cr,$r,Ar){if(!Tr)return;const Rr=new this.State(Tr,Cr,$r,Ar);this.tokenize(Rr,Rr.line,Rr.lineMax)};ParserBlock$2.prototype.State=StateBlock$1;function StateInline$1(Tr,Cr,$r,Ar){this.src=Tr,this.env=$r,this.md=Cr,this.tokens=Ar,this.tokens_meta=Array(Ar.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}StateInline$1.prototype.pushPending=function(){const Tr=new Token$4("text","",0);return Tr.content=this.pending,Tr.level=this.pendingLevel,this.tokens.push(Tr),this.pending="",Tr};StateInline$1.prototype.push=function(Tr,Cr,$r){this.pending&&this.pushPending();const Ar=new Token$4(Tr,Cr,$r);let Rr=null;return $r<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),Ar.level=this.level,$r>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],Rr={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(Ar),this.tokens_meta.push(Rr),Ar};StateInline$1.prototype.scanDelims=function(Tr,Cr){let $r,Ar,Rr=!0,Dr=!0;const Mr=this.posMax,Br=this.src.charCodeAt(Tr),Nr=Tr>0?this.src.charCodeAt(Tr-1):32;let Lr=Tr;for(;Lr0)return!1;const $r=Tr.pos,Ar=Tr.posMax;if($r+3>Ar||Tr.src.charCodeAt($r)!==58||Tr.src.charCodeAt($r+1)!==47||Tr.src.charCodeAt($r+2)!==47)return!1;const Rr=Tr.pending.match(SCHEME_RE$1);if(!Rr)return!1;const Dr=Rr[1],Mr=Tr.md.linkify.matchAtStart(Tr.src.slice($r-Dr.length));if(!Mr)return!1;let Br=Mr.url;if(Br.length<=Dr.length)return!1;Br=Br.replace(/\*+$/,"");const Nr=Tr.md.normalizeLink(Br);if(!Tr.md.validateLink(Nr))return!1;if(!Cr){Tr.pending=Tr.pending.slice(0,-Dr.length);const Lr=Tr.push("link_open","a",1);Lr.attrs=[["href",Nr]],Lr.markup="linkify",Lr.info="auto";const Hr=Tr.push("text","",0);Hr.content=Tr.md.normalizeLinkText(Br);const zr=Tr.push("link_close","a",-1);zr.markup="linkify",zr.info="auto"}return Tr.pos+=Br.length-Dr.length,!0}function newline$1(Tr,Cr){let $r=Tr.pos;if(Tr.src.charCodeAt($r)!==10)return!1;const Ar=Tr.pending.length-1,Rr=Tr.posMax;if(!Cr)if(Ar>=0&&Tr.pending.charCodeAt(Ar)===32)if(Ar>=1&&Tr.pending.charCodeAt(Ar-1)===32){let Dr=Ar-1;for(;Dr>=1&&Tr.pending.charCodeAt(Dr-1)===32;)Dr--;Tr.pending=Tr.pending.slice(0,Dr),Tr.push("hardbreak","br",0)}else Tr.pending=Tr.pending.slice(0,-1),Tr.push("softbreak","br",0);else Tr.push("softbreak","br",0);for($r++;$r?@[]^_`{|}~-".split("").forEach(function(Tr){ESCAPED$1[Tr.charCodeAt(0)]=1});function escape(Tr,Cr){let $r=Tr.pos;const Ar=Tr.posMax;if(Tr.src.charCodeAt($r)!==92||($r++,$r>=Ar))return!1;let Rr=Tr.src.charCodeAt($r);if(Rr===10){for(Cr||Tr.push("hardbreak","br",0),$r++;$r=55296&&Rr<=56319&&$r+1=56320&&Br<=57343&&(Dr+=Tr.src[$r+1],$r++)}const Mr="\\"+Dr;if(!Cr){const Br=Tr.push("text_special","",0);Rr<256&&ESCAPED$1[Rr]!==0?Br.content=Dr:Br.content=Mr,Br.markup=Mr,Br.info="escape"}return Tr.pos=$r+1,!0}function backtick(Tr,Cr){let $r=Tr.pos;if(Tr.src.charCodeAt($r)!==96)return!1;const Rr=$r;$r++;const Dr=Tr.posMax;for(;$r=0;Ar--){const Rr=Cr[Ar];if(Rr.marker!==95&&Rr.marker!==42||Rr.end===-1)continue;const Dr=Cr[Rr.end],Mr=Ar>0&&Cr[Ar-1].end===Rr.end+1&&Cr[Ar-1].marker===Rr.marker&&Cr[Ar-1].token===Rr.token-1&&Cr[Rr.end+1].token===Dr.token+1,Br=String.fromCharCode(Rr.marker),Nr=Tr.tokens[Rr.token];Nr.type=Mr?"strong_open":"em_open",Nr.tag=Mr?"strong":"em",Nr.nesting=1,Nr.markup=Mr?Br+Br:Br,Nr.content="";const Lr=Tr.tokens[Dr.token];Lr.type=Mr?"strong_close":"em_close",Lr.tag=Mr?"strong":"em",Lr.nesting=-1,Lr.markup=Mr?Br+Br:Br,Lr.content="",Mr&&(Tr.tokens[Cr[Ar-1].token].content="",Tr.tokens[Cr[Rr.end+1].token].content="",Ar--)}}function emphasis_post_process(Tr){const Cr=Tr.tokens_meta,$r=Tr.tokens_meta.length;postProcess$2(Tr,Tr.delimiters);for(let Ar=0;Ar<$r;Ar++)Cr[Ar]&&Cr[Ar].delimiters&&postProcess$2(Tr,Cr[Ar].delimiters)}const r_emphasis={tokenize:emphasis_tokenize,postProcess:emphasis_post_process};function link$1(Tr,Cr){let $r,Ar,Rr,Dr,Mr="",Br="",Nr=Tr.pos,Lr=!0;if(Tr.src.charCodeAt(Tr.pos)!==91)return!1;const Hr=Tr.pos,zr=Tr.posMax,Ur=Tr.pos+1,Vr=Tr.md.helpers.parseLinkLabel(Tr,Tr.pos,!0);if(Vr<0)return!1;let jr=Vr+1;if(jr=zr)return!1;if(Nr=jr,Rr=Tr.md.helpers.parseLinkDestination(Tr.src,jr,Tr.posMax),Rr.ok){for(Mr=Tr.md.normalizeLink(Rr.str),Tr.md.validateLink(Mr)?jr=Rr.pos:Mr="",Nr=jr;jr=zr||Tr.src.charCodeAt(jr)!==41)&&(Lr=!0),jr++}if(Lr){if(typeof Tr.env.references>"u")return!1;if(jr=0?Ar=Tr.src.slice(Nr,jr++):jr=Vr+1):jr=Vr+1,Ar||(Ar=Tr.src.slice(Ur,Vr)),Dr=Tr.env.references[normalizeReference$3(Ar)],!Dr)return Tr.pos=Hr,!1;Mr=Dr.href,Br=Dr.title}if(!Cr){Tr.pos=Ur,Tr.posMax=Vr;const Gr=Tr.push("link_open","a",1),Xr=[["href",Mr]];Gr.attrs=Xr,Br&&Xr.push(["title",Br]),Tr.linkLevel++,Tr.md.inline.tokenize(Tr),Tr.linkLevel--,Tr.push("link_close","a",-1)}return Tr.pos=jr,Tr.posMax=zr,!0}function image$2(Tr,Cr){let $r,Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr="";const zr=Tr.pos,Ur=Tr.posMax;if(Tr.src.charCodeAt(Tr.pos)!==33||Tr.src.charCodeAt(Tr.pos+1)!==91)return!1;const Vr=Tr.pos+2,jr=Tr.md.helpers.parseLinkLabel(Tr,Tr.pos+1,!1);if(jr<0)return!1;if(Dr=jr+1,Dr=Ur)return!1;for(Lr=Dr,Br=Tr.md.helpers.parseLinkDestination(Tr.src,Dr,Tr.posMax),Br.ok&&(Hr=Tr.md.normalizeLink(Br.str),Tr.md.validateLink(Hr)?Dr=Br.pos:Hr=""),Lr=Dr;Dr=Ur||Tr.src.charCodeAt(Dr)!==41)return Tr.pos=zr,!1;Dr++}else{if(typeof Tr.env.references>"u")return!1;if(Dr=0?Rr=Tr.src.slice(Lr,Dr++):Dr=jr+1):Dr=jr+1,Rr||(Rr=Tr.src.slice(Vr,jr)),Mr=Tr.env.references[normalizeReference$3(Rr)],!Mr)return Tr.pos=zr,!1;Hr=Mr.href,Nr=Mr.title}if(!Cr){Ar=Tr.src.slice(Vr,jr);const Gr=[];Tr.md.inline.parse(Ar,Tr.md,Tr.env,Gr);const Xr=Tr.push("image","img",0),Kr=[["src",Hr],["alt",""]];Xr.attrs=Kr,Xr.children=Gr,Xr.content=Ar,Nr&&Kr.push(["title",Nr])}return Tr.pos=Dr,Tr.posMax=Ur,!0}const EMAIL_RE$1=/^([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])?)*)$/,AUTOLINK_RE$1=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function autolink$1(Tr,Cr){let $r=Tr.pos;if(Tr.src.charCodeAt($r)!==60)return!1;const Ar=Tr.pos,Rr=Tr.posMax;for(;;){if(++$r>=Rr)return!1;const Mr=Tr.src.charCodeAt($r);if(Mr===60)return!1;if(Mr===62)break}const Dr=Tr.src.slice(Ar+1,$r);if(AUTOLINK_RE$1.test(Dr)){const Mr=Tr.md.normalizeLink(Dr);if(!Tr.md.validateLink(Mr))return!1;if(!Cr){const Br=Tr.push("link_open","a",1);Br.attrs=[["href",Mr]],Br.markup="autolink",Br.info="auto";const Nr=Tr.push("text","",0);Nr.content=Tr.md.normalizeLinkText(Dr);const Lr=Tr.push("link_close","a",-1);Lr.markup="autolink",Lr.info="auto"}return Tr.pos+=Dr.length+2,!0}if(EMAIL_RE$1.test(Dr)){const Mr=Tr.md.normalizeLink("mailto:"+Dr);if(!Tr.md.validateLink(Mr))return!1;if(!Cr){const Br=Tr.push("link_open","a",1);Br.attrs=[["href",Mr]],Br.markup="autolink",Br.info="auto";const Nr=Tr.push("text","",0);Nr.content=Tr.md.normalizeLinkText(Dr);const Lr=Tr.push("link_close","a",-1);Lr.markup="autolink",Lr.info="auto"}return Tr.pos+=Dr.length+2,!0}return!1}function isLinkOpen$2(Tr){return/^\s]/i.test(Tr)}function isLinkClose$2(Tr){return/^<\/a\s*>/i.test(Tr)}function isLetter$1(Tr){const Cr=Tr|32;return Cr>=97&&Cr<=122}function html_inline$1(Tr,Cr){if(!Tr.md.options.html)return!1;const $r=Tr.posMax,Ar=Tr.pos;if(Tr.src.charCodeAt(Ar)!==60||Ar+2>=$r)return!1;const Rr=Tr.src.charCodeAt(Ar+1);if(Rr!==33&&Rr!==63&&Rr!==47&&!isLetter$1(Rr))return!1;const Dr=Tr.src.slice(Ar).match(HTML_TAG_RE$2);if(!Dr)return!1;if(!Cr){const Mr=Tr.push("html_inline","",0);Mr.content=Dr[0],isLinkOpen$2(Mr.content)&&Tr.linkLevel++,isLinkClose$2(Mr.content)&&Tr.linkLevel--}return Tr.pos+=Dr[0].length,!0}const DIGITAL_RE$1=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,NAMED_RE$1=/^&([a-z][a-z0-9]{1,31});/i;function entity$1(Tr,Cr){const $r=Tr.pos,Ar=Tr.posMax;if(Tr.src.charCodeAt($r)!==38||$r+1>=Ar)return!1;if(Tr.src.charCodeAt($r+1)===35){const Dr=Tr.src.slice($r).match(DIGITAL_RE$1);if(Dr){if(!Cr){const Mr=Dr[1][0].toLowerCase()==="x"?parseInt(Dr[1].slice(1),16):parseInt(Dr[1],10),Br=Tr.push("text_special","",0);Br.content=isValidEntityCode$1(Mr)?fromCodePoint$1(Mr):fromCodePoint$1(65533),Br.markup=Dr[0],Br.info="entity"}return Tr.pos+=Dr[0].length,!0}}else{const Dr=Tr.src.slice($r).match(NAMED_RE$1);if(Dr){const Mr=decodeHTML(Dr[0]);if(Mr!==Dr[0]){if(!Cr){const Br=Tr.push("text_special","",0);Br.content=Mr,Br.markup=Dr[0],Br.info="entity"}return Tr.pos+=Dr[0].length,!0}}}return!1}function processDelimiters$1(Tr){const Cr={},$r=Tr.length;if(!$r)return;let Ar=0,Rr=-2;const Dr=[];for(let Mr=0;Mr<$r;Mr++){const Br=Tr[Mr];if(Dr.push(0),(Tr[Ar].marker!==Br.marker||Rr!==Br.token-1)&&(Ar=Mr),Rr=Br.token,Br.length=Br.length||0,!Br.close)continue;Cr.hasOwnProperty(Br.marker)||(Cr[Br.marker]=[-1,-1,-1,-1,-1,-1]);const Nr=Cr[Br.marker][(Br.open?3:0)+Br.length%3];let Lr=Ar-Dr[Ar]-1,Hr=Lr;for(;Lr>Nr;Lr-=Dr[Lr]+1){const zr=Tr[Lr];if(zr.marker===Br.marker&&zr.open&&zr.end<0){let Ur=!1;if((zr.close||Br.open)&&(zr.length+Br.length)%3===0&&(zr.length%3!==0||Br.length%3!==0)&&(Ur=!0),!Ur){const Vr=Lr>0&&!Tr[Lr-1].open?Dr[Lr-1]+1:0;Dr[Mr]=Mr-Lr+Vr,Dr[Lr]=Vr,Br.open=!1,zr.end=Mr,zr.close=!1,Hr=-1,Rr=-2;break}}}Hr!==-1&&(Cr[Br.marker][(Br.open?3:0)+(Br.length||0)%3]=Hr)}}function link_pairs(Tr){const Cr=Tr.tokens_meta,$r=Tr.tokens_meta.length;processDelimiters$1(Tr.delimiters);for(let Ar=0;Ar<$r;Ar++)Cr[Ar]&&Cr[Ar].delimiters&&processDelimiters$1(Cr[Ar].delimiters)}function fragments_join$1(Tr){let Cr,$r,Ar=0;const Rr=Tr.tokens,Dr=Tr.tokens.length;for(Cr=$r=0;Cr0&&Ar++,Rr[Cr].type==="text"&&Cr+1=Tr.pos)throw new Error("inline rule didn't increment state.pos");break}}else Tr.pos=Tr.posMax;Mr||Tr.pos++,Dr[Cr]=Tr.pos};ParserInline$2.prototype.tokenize=function(Tr){const Cr=this.ruler.getRules(""),$r=Cr.length,Ar=Tr.posMax,Rr=Tr.md.options.maxNesting;for(;Tr.pos=Tr.pos)throw new Error("inline rule didn't increment state.pos");break}}if(Mr){if(Tr.pos>=Ar)break;continue}Tr.pending+=Tr.src[Tr.pos++]}Tr.pending&&Tr.pushPending()};ParserInline$2.prototype.parse=function(Tr,Cr,$r,Ar){const Rr=new this.State(Tr,Cr,$r,Ar);this.tokenize(Rr);const Dr=this.ruler2.getRules(""),Mr=Dr.length;for(let Br=0;Br|$))",Cr.tpl_email_fuzzy="(^|"+$r+'|"|\\(|'+Cr.src_ZCc+")("+Cr.src_email_name+"@"+Cr.tpl_host_fuzzy_strict+")",Cr.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+Cr.src_ZPCc+"))((?![$+<=>^`||])"+Cr.tpl_host_port_fuzzy_strict+Cr.src_path+")",Cr.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+Cr.src_ZPCc+"))((?![$+<=>^`||])"+Cr.tpl_host_port_no_ip_fuzzy_strict+Cr.src_path+")",Cr}function assign$2(Tr){return Array.prototype.slice.call(arguments,1).forEach(function($r){$r&&Object.keys($r).forEach(function(Ar){Tr[Ar]=$r[Ar]})}),Tr}function _class$1(Tr){return Object.prototype.toString.call(Tr)}function isString$1(Tr){return _class$1(Tr)==="[object String]"}function isObject$1(Tr){return _class$1(Tr)==="[object Object]"}function isRegExp$1(Tr){return _class$1(Tr)==="[object RegExp]"}function isFunction$1(Tr){return _class$1(Tr)==="[object Function]"}function escapeRE$1(Tr){return Tr.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const defaultOptions$1={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function isOptionsObj$1(Tr){return Object.keys(Tr||{}).reduce(function(Cr,$r){return Cr||defaultOptions$1.hasOwnProperty($r)},!1)}const defaultSchemas$1={"http:":{validate:function(Tr,Cr,$r){const Ar=Tr.slice(Cr);return $r.re.http||($r.re.http=new RegExp("^\\/\\/"+$r.re.src_auth+$r.re.src_host_port_strict+$r.re.src_path,"i")),$r.re.http.test(Ar)?Ar.match($r.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(Tr,Cr,$r){const Ar=Tr.slice(Cr);return $r.re.no_http||($r.re.no_http=new RegExp("^"+$r.re.src_auth+"(?:localhost|(?:(?:"+$r.re.src_domain+")\\.)+"+$r.re.src_domain_root+")"+$r.re.src_port+$r.re.src_host_terminator+$r.re.src_path,"i")),$r.re.no_http.test(Ar)?Cr>=3&&Tr[Cr-3]===":"||Cr>=3&&Tr[Cr-3]==="/"?0:Ar.match($r.re.no_http)[0].length:0}},"mailto:":{validate:function(Tr,Cr,$r){const Ar=Tr.slice(Cr);return $r.re.mailto||($r.re.mailto=new RegExp("^"+$r.re.src_email_name+"@"+$r.re.src_host_strict,"i")),$r.re.mailto.test(Ar)?Ar.match($r.re.mailto)[0].length:0}}},tlds_2ch_src_re$1="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",tlds_default$1="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function resetScanCache$1(Tr){Tr.__index__=-1,Tr.__text_cache__=""}function createValidator$1(Tr){return function(Cr,$r){const Ar=Cr.slice($r);return Tr.test(Ar)?Ar.match(Tr)[0].length:0}}function createNormalizer$1(){return function(Tr,Cr){Cr.normalize(Tr)}}function compile$1(Tr){const Cr=Tr.re=reFactory(Tr.__opts__),$r=Tr.__tlds__.slice();Tr.onCompile(),Tr.__tlds_replaced__||$r.push(tlds_2ch_src_re$1),$r.push(Cr.src_xn),Cr.src_tlds=$r.join("|");function Ar(Br){return Br.replace("%TLDS%",Cr.src_tlds)}Cr.email_fuzzy=RegExp(Ar(Cr.tpl_email_fuzzy),"i"),Cr.link_fuzzy=RegExp(Ar(Cr.tpl_link_fuzzy),"i"),Cr.link_no_ip_fuzzy=RegExp(Ar(Cr.tpl_link_no_ip_fuzzy),"i"),Cr.host_fuzzy_test=RegExp(Ar(Cr.tpl_host_fuzzy_test),"i");const Rr=[];Tr.__compiled__={};function Dr(Br,Nr){throw new Error('(LinkifyIt) Invalid schema "'+Br+'": '+Nr)}Object.keys(Tr.__schemas__).forEach(function(Br){const Nr=Tr.__schemas__[Br];if(Nr===null)return;const Lr={validate:null,link:null};if(Tr.__compiled__[Br]=Lr,isObject$1(Nr)){isRegExp$1(Nr.validate)?Lr.validate=createValidator$1(Nr.validate):isFunction$1(Nr.validate)?Lr.validate=Nr.validate:Dr(Br,Nr),isFunction$1(Nr.normalize)?Lr.normalize=Nr.normalize:Nr.normalize?Dr(Br,Nr):Lr.normalize=createNormalizer$1();return}if(isString$1(Nr)){Rr.push(Br);return}Dr(Br,Nr)}),Rr.forEach(function(Br){Tr.__compiled__[Tr.__schemas__[Br]]&&(Tr.__compiled__[Br].validate=Tr.__compiled__[Tr.__schemas__[Br]].validate,Tr.__compiled__[Br].normalize=Tr.__compiled__[Tr.__schemas__[Br]].normalize)}),Tr.__compiled__[""]={validate:null,normalize:createNormalizer$1()};const Mr=Object.keys(Tr.__compiled__).filter(function(Br){return Br.length>0&&Tr.__compiled__[Br]}).map(escapeRE$1).join("|");Tr.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+Cr.src_ZPCc+"))("+Mr+")","i"),Tr.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+Cr.src_ZPCc+"))("+Mr+")","ig"),Tr.re.schema_at_start=RegExp("^"+Tr.re.schema_search.source,"i"),Tr.re.pretest=RegExp("("+Tr.re.schema_test.source+")|("+Tr.re.host_fuzzy_test.source+")|@","i"),resetScanCache$1(Tr)}function Match$1(Tr,Cr){const $r=Tr.__index__,Ar=Tr.__last_index__,Rr=Tr.__text_cache__.slice($r,Ar);this.schema=Tr.__schema__.toLowerCase(),this.index=$r+Cr,this.lastIndex=Ar+Cr,this.raw=Rr,this.text=Rr,this.url=Rr}function createMatch$1(Tr,Cr){const $r=new Match$1(Tr,Cr);return Tr.__compiled__[$r.schema].normalize($r,Tr),$r}function LinkifyIt$2(Tr,Cr){if(!(this instanceof LinkifyIt$2))return new LinkifyIt$2(Tr,Cr);Cr||isOptionsObj$1(Tr)&&(Cr=Tr,Tr={}),this.__opts__=assign$2({},defaultOptions$1,Cr),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=assign$2({},defaultSchemas$1,Tr),this.__compiled__={},this.__tlds__=tlds_default$1,this.__tlds_replaced__=!1,this.re={},compile$1(this)}LinkifyIt$2.prototype.add=function(Cr,$r){return this.__schemas__[Cr]=$r,compile$1(this),this};LinkifyIt$2.prototype.set=function(Cr){return this.__opts__=assign$2(this.__opts__,Cr),this};LinkifyIt$2.prototype.test=function(Cr){if(this.__text_cache__=Cr,this.__index__=-1,!Cr.length)return!1;let $r,Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr;if(this.re.schema_test.test(Cr)){for(Nr=this.re.schema_search,Nr.lastIndex=0;($r=Nr.exec(Cr))!==null;)if(Dr=this.testSchemaAt(Cr,$r[2],Nr.lastIndex),Dr){this.__schema__=$r[2],this.__index__=$r.index+$r[1].length,this.__last_index__=$r.index+$r[0].length+Dr;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(Lr=Cr.search(this.re.host_fuzzy_test),Lr>=0&&(this.__index__<0||Lr=0&&(Rr=Cr.match(this.re.email_fuzzy))!==null&&(Mr=Rr.index+Rr[1].length,Br=Rr.index+Rr[0].length,(this.__index__<0||Mrthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=Mr,this.__last_index__=Br))),this.__index__>=0};LinkifyIt$2.prototype.pretest=function(Cr){return this.re.pretest.test(Cr)};LinkifyIt$2.prototype.testSchemaAt=function(Cr,$r,Ar){return this.__compiled__[$r.toLowerCase()]?this.__compiled__[$r.toLowerCase()].validate(Cr,Ar,this):0};LinkifyIt$2.prototype.match=function(Cr){const $r=[];let Ar=0;this.__index__>=0&&this.__text_cache__===Cr&&($r.push(createMatch$1(this,Ar)),Ar=this.__last_index__);let Rr=Ar?Cr.slice(Ar):Cr;for(;this.test(Rr);)$r.push(createMatch$1(this,Ar)),Rr=Rr.slice(this.__last_index__),Ar+=this.__last_index__;return $r.length?$r:null};LinkifyIt$2.prototype.matchAtStart=function(Cr){if(this.__text_cache__=Cr,this.__index__=-1,!Cr.length)return null;const $r=this.re.schema_at_start.exec(Cr);if(!$r)return null;const Ar=this.testSchemaAt(Cr,$r[2],$r[0].length);return Ar?(this.__schema__=$r[2],this.__index__=$r.index+$r[1].length,this.__last_index__=$r.index+$r[0].length+Ar,createMatch$1(this,0)):null};LinkifyIt$2.prototype.tlds=function(Cr,$r){return Cr=Array.isArray(Cr)?Cr:[Cr],$r?(this.__tlds__=this.__tlds__.concat(Cr).sort().filter(function(Ar,Rr,Dr){return Ar!==Dr[Rr-1]}).reverse(),compile$1(this),this):(this.__tlds__=Cr.slice(),this.__tlds_replaced__=!0,compile$1(this),this)};LinkifyIt$2.prototype.normalize=function(Cr){Cr.schema||(Cr.url="http://"+Cr.url),Cr.schema==="mailto:"&&!/^mailto:/i.test(Cr.url)&&(Cr.url="mailto:"+Cr.url)};LinkifyIt$2.prototype.onCompile=function(){};const maxInt$1=2147483647,base$1=36,tMin$1=1,tMax$1=26,skew$1=38,damp$1=700,initialBias$1=72,initialN$1=128,delimiter$1="-",regexPunycode$1=/^xn--/,regexNonASCII$1=/[^\0-\x7F]/,regexSeparators$1=/[\x2E\u3002\uFF0E\uFF61]/g,errors$1={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin$1=base$1-tMin$1,floor$1=Math.floor,stringFromCharCode$1=String.fromCharCode;function error$1(Tr){throw new RangeError(errors$1[Tr])}function map$2(Tr,Cr){const $r=[];let Ar=Tr.length;for(;Ar--;)$r[Ar]=Cr(Tr[Ar]);return $r}function mapDomain$1(Tr,Cr){const $r=Tr.split("@");let Ar="";$r.length>1&&(Ar=$r[0]+"@",Tr=$r[1]),Tr=Tr.replace(regexSeparators$1,".");const Rr=Tr.split("."),Dr=map$2(Rr,Cr).join(".");return Ar+Dr}function ucs2decode$1(Tr){const Cr=[];let $r=0;const Ar=Tr.length;for(;$r=55296&&Rr<=56319&&$rString.fromCodePoint(...Tr),basicToDigit$1=function(Tr){return Tr>=48&&Tr<58?26+(Tr-48):Tr>=65&&Tr<91?Tr-65:Tr>=97&&Tr<123?Tr-97:base$1},digitToBasic$1=function(Tr,Cr){return Tr+22+75*(Tr<26)-((Cr!=0)<<5)},adapt$1=function(Tr,Cr,$r){let Ar=0;for(Tr=$r?floor$1(Tr/damp$1):Tr>>1,Tr+=floor$1(Tr/Cr);Tr>baseMinusTMin$1*tMax$1>>1;Ar+=base$1)Tr=floor$1(Tr/baseMinusTMin$1);return floor$1(Ar+(baseMinusTMin$1+1)*Tr/(Tr+skew$1))},decode$2=function(Tr){const Cr=[],$r=Tr.length;let Ar=0,Rr=initialN$1,Dr=initialBias$1,Mr=Tr.lastIndexOf(delimiter$1);Mr<0&&(Mr=0);for(let Br=0;Br=128&&error$1("not-basic"),Cr.push(Tr.charCodeAt(Br));for(let Br=Mr>0?Mr+1:0;Br<$r;){const Nr=Ar;for(let Hr=1,zr=base$1;;zr+=base$1){Br>=$r&&error$1("invalid-input");const Ur=basicToDigit$1(Tr.charCodeAt(Br++));Ur>=base$1&&error$1("invalid-input"),Ur>floor$1((maxInt$1-Ar)/Hr)&&error$1("overflow"),Ar+=Ur*Hr;const Vr=zr<=Dr?tMin$1:zr>=Dr+tMax$1?tMax$1:zr-Dr;if(Urfloor$1(maxInt$1/jr)&&error$1("overflow"),Hr*=jr}const Lr=Cr.length+1;Dr=adapt$1(Ar-Nr,Lr,Nr==0),floor$1(Ar/Lr)>maxInt$1-Rr&&error$1("overflow"),Rr+=floor$1(Ar/Lr),Ar%=Lr,Cr.splice(Ar++,0,Rr)}return String.fromCodePoint(...Cr)},encode$2=function(Tr){const Cr=[];Tr=ucs2decode$1(Tr);const $r=Tr.length;let Ar=initialN$1,Rr=0,Dr=initialBias$1;for(const Nr of Tr)Nr<128&&Cr.push(stringFromCharCode$1(Nr));const Mr=Cr.length;let Br=Mr;for(Mr&&Cr.push(delimiter$1);Br<$r;){let Nr=maxInt$1;for(const Hr of Tr)Hr>=Ar&&Hrfloor$1((maxInt$1-Rr)/Lr)&&error$1("overflow"),Rr+=(Nr-Ar)*Lr,Ar=Nr;for(const Hr of Tr)if(HrmaxInt$1&&error$1("overflow"),Hr===Ar){let zr=Rr;for(let Ur=base$1;;Ur+=base$1){const Vr=Ur<=Dr?tMin$1:Ur>=Dr+tMax$1?tMax$1:Ur-Dr;if(zr=0))try{Cr.hostname=punycode$2.toASCII(Cr.hostname)}catch{}return encode$3(format$1(Cr))}function normalizeLinkText$1(Tr){const Cr=urlParse$1(Tr,!0);if(Cr.hostname&&(!Cr.protocol||RECODE_HOSTNAME_FOR$1.indexOf(Cr.protocol)>=0))try{Cr.hostname=punycode$2.toUnicode(Cr.hostname)}catch{}return decode$3(format$1(Cr),decode$3.defaultChars+"%")}function MarkdownIt$1(Tr,Cr){if(!(this instanceof MarkdownIt$1))return new MarkdownIt$1(Tr,Cr);Cr||isString$2(Tr)||(Cr=Tr||{},Tr="default"),this.inline=new ParserInline$2,this.block=new ParserBlock$2,this.core=new Core$1,this.renderer=new Renderer$2,this.linkify=new LinkifyIt$2,this.validateLink=validateLink$1,this.normalizeLink=normalizeLink$1,this.normalizeLinkText=normalizeLinkText$1,this.utils=utils$2,this.helpers=assign$3({},helpers$2),this.options={},this.configure(Tr),Cr&&this.set(Cr)}MarkdownIt$1.prototype.set=function(Tr){return assign$3(this.options,Tr),this};MarkdownIt$1.prototype.configure=function(Tr){const Cr=this;if(isString$2(Tr)){const $r=Tr;if(Tr=config$1[$r],!Tr)throw new Error('Wrong `markdown-it` preset "'+$r+'", check name')}if(!Tr)throw new Error("Wrong `markdown-it` preset, can't be empty");return Tr.options&&Cr.set(Tr.options),Tr.components&&Object.keys(Tr.components).forEach(function($r){Tr.components[$r].rules&&Cr[$r].ruler.enableOnly(Tr.components[$r].rules),Tr.components[$r].rules2&&Cr[$r].ruler2.enableOnly(Tr.components[$r].rules2)}),this};MarkdownIt$1.prototype.enable=function(Tr,Cr){let $r=[];Array.isArray(Tr)||(Tr=[Tr]),["core","block","inline"].forEach(function(Rr){$r=$r.concat(this[Rr].ruler.enable(Tr,!0))},this),$r=$r.concat(this.inline.ruler2.enable(Tr,!0));const Ar=Tr.filter(function(Rr){return $r.indexOf(Rr)<0});if(Ar.length&&!Cr)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+Ar);return this};MarkdownIt$1.prototype.disable=function(Tr,Cr){let $r=[];Array.isArray(Tr)||(Tr=[Tr]),["core","block","inline"].forEach(function(Rr){$r=$r.concat(this[Rr].ruler.disable(Tr,!0))},this),$r=$r.concat(this.inline.ruler2.disable(Tr,!0));const Ar=Tr.filter(function(Rr){return $r.indexOf(Rr)<0});if(Ar.length&&!Cr)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+Ar);return this};MarkdownIt$1.prototype.use=function(Tr){const Cr=[this].concat(Array.prototype.slice.call(arguments,1));return Tr.apply(Tr,Cr),this};MarkdownIt$1.prototype.parse=function(Tr,Cr){if(typeof Tr!="string")throw new Error("Input data should be a String");const $r=new this.core.State(Tr,this,Cr);return this.core.process($r),$r.tokens};MarkdownIt$1.prototype.render=function(Tr,Cr){return Cr=Cr||{},this.renderer.render(this.parse(Tr,Cr),this.options,Cr)};MarkdownIt$1.prototype.parseInline=function(Tr,Cr){const $r=new this.core.State(Tr,this,Cr);return $r.inlineMode=!0,this.core.process($r),$r.tokens};MarkdownIt$1.prototype.renderInline=function(Tr,Cr){return Cr=Cr||{},this.renderer.render(this.parseInline(Tr,Cr),this.options,Cr)};const schema=new Schema({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(Tr){return["h"+Tr.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:Tr=>({params:Tr.getAttribute("data-params")||""})}],toDOM(Tr){return["pre",Tr.attrs.params?{"data-params":Tr.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(Tr){return{order:Tr.hasAttribute("start")?+Tr.getAttribute("start"):1,tight:Tr.hasAttribute("data-tight")}}}],toDOM(Tr){return["ol",{start:Tr.attrs.order==1?null:Tr.attrs.order,"data-tight":Tr.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:Tr=>({tight:Tr.hasAttribute("data-tight")})}],toDOM(Tr){return["ul",{"data-tight":Tr.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(Tr){return{src:Tr.getAttribute("src"),title:Tr.getAttribute("title"),alt:Tr.getAttribute("alt")}}}],toDOM(Tr){return["img",Tr.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:Tr=>Tr.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:Tr=>Tr.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:Tr=>Tr.type.name=="strong"},{style:"font-weight",getAttrs:Tr=>/^(bold(er)?|[5-9]\d{2,})$/.test(Tr)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(Tr){return{href:Tr.getAttribute("href"),title:Tr.getAttribute("title")}}}],toDOM(Tr){return["a",Tr.attrs]}},code:{parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function maybeMerge(Tr,Cr){if(Tr.isText&&Cr.isText&&Mark$1.sameSet(Tr.marks,Cr.marks))return Tr.withText(Tr.text+Cr.text)}class MarkdownParseState{constructor(Cr,$r){this.schema=Cr,this.tokenHandlers=$r,this.stack=[{type:Cr.topNodeType,attrs:null,content:[],marks:Mark$1.none}]}top(){return this.stack[this.stack.length-1]}push(Cr){this.stack.length&&this.top().content.push(Cr)}addText(Cr){if(!Cr)return;let $r=this.top(),Ar=$r.content,Rr=Ar[Ar.length-1],Dr=this.schema.text(Cr,$r.marks),Mr;Rr&&(Mr=maybeMerge(Rr,Dr))?Ar[Ar.length-1]=Mr:Ar.push(Dr)}openMark(Cr){let $r=this.top();$r.marks=Cr.addToSet($r.marks)}closeMark(Cr){let $r=this.top();$r.marks=Cr.removeFromSet($r.marks)}parseTokens(Cr){for(let $r=0;$r{Mr.openNode(Dr,attrs(Rr,Br,Nr,Lr)),Mr.addText(withoutTrailingNewline(Br.content)),Mr.closeNode()}:($r[Ar+"_open"]=(Mr,Br,Nr,Lr)=>Mr.openNode(Dr,attrs(Rr,Br,Nr,Lr)),$r[Ar+"_close"]=Mr=>Mr.closeNode())}else if(Rr.node){let Dr=Tr.nodeType(Rr.node);$r[Ar]=(Mr,Br,Nr,Lr)=>Mr.addNode(Dr,attrs(Rr,Br,Nr,Lr))}else if(Rr.mark){let Dr=Tr.marks[Rr.mark];noCloseToken(Rr,Ar)?$r[Ar]=(Mr,Br,Nr,Lr)=>{Mr.openMark(Dr.create(attrs(Rr,Br,Nr,Lr))),Mr.addText(withoutTrailingNewline(Br.content)),Mr.closeMark(Dr)}:($r[Ar+"_open"]=(Mr,Br,Nr,Lr)=>Mr.openMark(Dr.create(attrs(Rr,Br,Nr,Lr))),$r[Ar+"_close"]=Mr=>Mr.closeMark(Dr))}else if(Rr.ignore)noCloseToken(Rr,Ar)?$r[Ar]=noOp:($r[Ar+"_open"]=noOp,$r[Ar+"_close"]=noOp);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(Rr))}return $r.text=(Ar,Rr)=>Ar.addText(Rr.content),$r.inline=(Ar,Rr)=>Ar.parseTokens(Rr.children),$r.softbreak=$r.softbreak||(Ar=>Ar.addText(" ")),$r}let MarkdownParser$1=class{constructor(Cr,$r,Ar){this.schema=Cr,this.tokenizer=$r,this.tokens=Ar,this.tokenHandlers=tokenHandlers(Cr,Ar)}parse(Cr,$r={}){let Ar=new MarkdownParseState(this.schema,this.tokenHandlers),Rr;Ar.parseTokens(this.tokenizer.parse(Cr,$r));do Rr=Ar.closeNode();while(Ar.stack.length);return Rr||this.schema.topNodeType.createAndFill()}};function listIsTight(Tr,Cr){for(;++Cr({tight:listIsTight(Cr,$r)})},ordered_list:{block:"ordered_list",getAttrs:(Tr,Cr,$r)=>({order:+Tr.attrGet("start")||1,tight:listIsTight(Cr,$r)})},heading:{block:"heading",getAttrs:Tr=>({level:+Tr.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:Tr=>({params:Tr.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:Tr=>({src:Tr.attrGet("src"),title:Tr.attrGet("title")||null,alt:Tr.children[0]&&Tr.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:Tr=>({href:Tr.attrGet("href"),title:Tr.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});let MarkdownSerializer$1=class{constructor(Cr,$r,Ar={}){this.nodes=Cr,this.marks=$r,this.options=Ar}serialize(Cr,$r={}){$r=Object.assign({},this.options,$r);let Ar=new MarkdownSerializerState$1(this.nodes,this.marks,$r);return Ar.renderContent(Cr),Ar.out}};const defaultMarkdownSerializer=new MarkdownSerializer$1({blockquote(Tr,Cr){Tr.wrapBlock("> ",null,Cr,()=>Tr.renderContent(Cr))},code_block(Tr,Cr){const $r=Cr.textContent.match(/`{3,}/gm),Ar=$r?$r.sort().slice(-1)[0]+"`":"```";Tr.write(Ar+(Cr.attrs.params||"")+` `),Tr.text(Cr.textContent,!1),Tr.write(` `),Tr.write(Ar),Tr.closeBlock(Cr)},heading(Tr,Cr){Tr.write(Tr.repeat("#",Cr.attrs.level)+" "),Tr.renderInline(Cr,!1),Tr.closeBlock(Cr)},horizontal_rule(Tr,Cr){Tr.write(Cr.attrs.markup||"---"),Tr.closeBlock(Cr)},bullet_list(Tr,Cr){Tr.renderList(Cr," ",()=>(Cr.attrs.bullet||"*")+" ")},ordered_list(Tr,Cr){let $r=Cr.attrs.order||1,Ar=String($r+Cr.childCount-1).length,Rr=Tr.repeat(" ",Ar+2);Tr.renderList(Cr,Rr,Dr=>{let Mr=String($r+Dr);return Tr.repeat(" ",Ar-Mr.length)+Mr+". "})},list_item(Tr,Cr){Tr.renderContent(Cr)},paragraph(Tr,Cr){Tr.renderInline(Cr),Tr.closeBlock(Cr)},image(Tr,Cr){Tr.write("!["+Tr.esc(Cr.attrs.alt||"")+"]("+Cr.attrs.src.replace(/[\(\)]/g,"\\$&")+(Cr.attrs.title?' "'+Cr.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(Tr,Cr,$r,Ar){for(let Rr=Ar+1;Rr<$r.childCount;Rr++)if($r.child(Rr).type!=Cr.type){Tr.write(`\\ `);return}},text(Tr,Cr){Tr.text(Cr.text,!Tr.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(Tr,Cr,$r,Ar){return Tr.inAutolink=isPlainURL(Cr,$r,Ar),Tr.inAutolink?"<":"["},close(Tr,Cr,$r,Ar){let{inAutolink:Rr}=Tr;return Tr.inAutolink=void 0,Rr?">":"]("+Cr.attrs.href.replace(/[\(\)"]/g,"\\$&")+(Cr.attrs.title?` "${Cr.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(Tr,Cr,$r,Ar){return backticksFor($r.child(Ar),-1)},close(Tr,Cr,$r,Ar){return backticksFor($r.child(Ar-1),1)},escape:!1}});function backticksFor(Tr,Cr){let $r=/`+/g,Ar,Rr=0;if(Tr.isText)for(;Ar=$r.exec(Tr.text);)Rr=Math.max(Rr,Ar[0].length);let Dr=Rr>0&&Cr>0?" `":"`";for(let Mr=0;Mr0&&Cr<0&&(Dr+=" "),Dr}function isPlainURL(Tr,Cr,$r){if(Tr.attrs.title||!/^\w+:/.test(Tr.attrs.href))return!1;let Ar=Cr.child($r);return!Ar.isText||Ar.text!=Tr.attrs.href||Ar.marks[Ar.marks.length-1]!=Tr?!1:$r==Cr.childCount-1||!Tr.isInSet(Cr.child($r+1).marks)}let MarkdownSerializerState$1=class{constructor(Cr,$r,Ar){this.nodes=Cr,this.marks=$r,this.options=Ar,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(Cr=2){if(this.closed){if(this.atBlank()||(this.out+=` `),Cr>1){let $r=this.delim,Ar=/\s+$/.exec($r);Ar&&($r=$r.slice(0,$r.length-Ar[0].length));for(let Rr=1;Rrthis.render($r,Cr,Rr))}renderInline(Cr,$r=!0){this.atBlockStart=$r;let Ar=[],Rr="",Dr=(Mr,Br,Nr)=>{let Lr=Mr?Mr.marks:[];Mr&&Mr.type.name===this.options.hardBreakNodeName&&(Lr=Lr.filter(Gr=>{if(Nr+1==Cr.childCount)return!1;let Xr=Cr.child(Nr+1);return Gr.isInSet(Xr.marks)&&(!Xr.isText||/\S/.test(Xr.text))}));let Hr=Rr;if(Rr="",Mr&&Mr.isText&&Lr.some(Gr=>{let Xr=this.marks[Gr.type.name];return Xr&&Xr.expelEnclosingWhitespace&&!Gr.isInSet(Ar)})){let[Gr,Xr,Kr]=/^(\s*)(.*)$/m.exec(Mr.text);Xr&&(Hr+=Xr,Mr=Kr?Mr.withText(Kr):null,Mr||(Lr=Ar))}if(Mr&&Mr.isText&&Lr.some(Gr=>{let Xr=this.marks[Gr.type.name];return Xr&&Xr.expelEnclosingWhitespace&&(Nr==Cr.childCount-1||!Gr.isInSet(Cr.child(Nr+1).marks))})){let[Gr,Xr,Kr]=/^(.*?)(\s*)$/m.exec(Mr.text);Kr&&(Rr=Kr,Mr=Xr?Mr.withText(Xr):null,Mr||(Lr=Ar))}let zr=Lr.length?Lr[Lr.length-1]:null,Ur=zr&&this.marks[zr.type.name].escape===!1,Vr=Lr.length-(Ur?1:0);e:for(let Gr=0;GrKr?Lr=Lr.slice(0,Kr).concat(Xr).concat(Lr.slice(Kr,Gr)).concat(Lr.slice(Gr+1,Vr)):Kr>Gr&&(Lr=Lr.slice(0,Gr).concat(Lr.slice(Gr+1,Kr)).concat(Xr).concat(Lr.slice(Kr,Vr)));continue e}}}let jr=0;for(;jr0&&(this.atBlockStart=!1)};Cr.forEach(Dr),Dr(null,0,Cr.childCount),this.atBlockStart=!1}renderList(Cr,$r,Ar){this.closed&&this.closed.type==Cr.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let Rr=typeof Cr.attrs.tight<"u"?Cr.attrs.tight:this.options.tightLists,Dr=this.inTightList;this.inTightList=Rr,Cr.forEach((Mr,Br,Nr)=>{Nr&&Rr&&this.flushClose(1),this.wrapBlock($r,Ar(Nr),Cr,()=>this.render(Mr,Cr,Nr))}),this.inTightList=Dr}esc(Cr,$r=!1){return Cr=Cr.replace(/[`*\\~\[\]_]/g,(Ar,Rr)=>Ar=="_"&&Rr>0&&Rr+1])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(Cr=Cr.replace(this.options.escapeExtraCharacters,"\\$&")),Cr}quote(Cr){let $r=Cr.indexOf('"')==-1?'""':Cr.indexOf("'")==-1?"''":"()";return $r[0]+Cr+$r[1]}repeat(Cr,$r){let Ar="";for(let Rr=0;Rr<$r;Rr++)Ar+=Cr;return Ar}markString(Cr,$r,Ar,Rr){let Dr=this.marks[Cr.type.name],Mr=$r?Dr.open:Dr.close;return typeof Mr=="string"?Mr:Mr(this,Cr,Ar,Rr)}getEnclosingWhitespace(Cr){return{leading:(Cr.match(/^(\s+)/)||[void 0])[0],trailing:(Cr.match(/(\s+)$/)||[void 0])[0]}}};var utils$1={};const Aacute="Á",aacute="á",Abreve="Ă",abreve="ă",ac="∾",acd="∿",acE="∾̳",Acirc="Â",acirc="â",acute="´",Acy="А",acy="а",AElig="Æ",aelig="æ",af="⁡",Afr="𝔄",afr="𝔞",Agrave="À",agrave="à",alefsym="ℵ",aleph="ℵ",Alpha="Α",alpha="α",Amacr="Ā",amacr="ā",amalg="⨿",amp="&",AMP="&",andand="⩕",And="⩓",and="∧",andd="⩜",andslope="⩘",andv="⩚",ang="∠",ange="⦤",angle="∠",angmsdaa="⦨",angmsdab="⦩",angmsdac="⦪",angmsdad="⦫",angmsdae="⦬",angmsdaf="⦭",angmsdag="⦮",angmsdah="⦯",angmsd="∡",angrt="∟",angrtvb="⊾",angrtvbd="⦝",angsph="∢",angst="Å",angzarr="⍼",Aogon="Ą",aogon="ą",Aopf="𝔸",aopf="𝕒",apacir="⩯",ap="≈",apE="⩰",ape="≊",apid="≋",apos="'",ApplyFunction="⁡",approx="≈",approxeq="≊",Aring="Å",aring="å",Ascr="𝒜",ascr="𝒶",Assign="≔",ast="*",asymp="≈",asympeq="≍",Atilde="Ã",atilde="ã",Auml="Ä",auml="ä",awconint="∳",awint="⨑",backcong="≌",backepsilon="϶",backprime="‵",backsim="∽",backsimeq="⋍",Backslash="∖",Barv="⫧",barvee="⊽",barwed="⌅",Barwed="⌆",barwedge="⌅",bbrk="⎵",bbrktbrk="⎶",bcong="≌",Bcy="Б",bcy="б",bdquo="„",becaus="∵",because="∵",Because="∵",bemptyv="⦰",bepsi="϶",bernou="ℬ",Bernoullis="ℬ",Beta="Β",beta="β",beth="ℶ",between="≬",Bfr="𝔅",bfr="𝔟",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$1="█",bne="=⃥",bnequiv="≡⃥",bNot="⫭",bnot="⌐",Bopf="𝔹",bopf="𝕓",bot="⊥",bottom="⊥",bowtie="⋈",boxbox="⧉",boxdl="┐",boxdL="╕",boxDl="╖",boxDL="╗",boxdr="┌",boxdR="╒",boxDr="╓",boxDR="╔",boxh="─",boxH="═",boxhd="┬",boxHd="╤",boxhD="╥",boxHD="╦",boxhu="┴",boxHu="╧",boxhU="╨",boxHU="╩",boxminus="⊟",boxplus="⊞",boxtimes="⊠",boxul="┘",boxuL="╛",boxUl="╜",boxUL="╝",boxur="└",boxuR="╘",boxUr="╙",boxUR="╚",boxv="│",boxV="║",boxvh="┼",boxvH="╪",boxVh="╫",boxVH="╬",boxvl="┤",boxvL="╡",boxVl="╢",boxVL="╣",boxvr="├",boxvR="╞",boxVr="╟",boxVR="╠",bprime="‵",breve="˘",Breve="˘",brvbar="¦",bscr="𝒷",Bscr="ℬ",bsemi="⁏",bsim="∽",bsime="⋍",bsolb="⧅",bsol="\\",bsolhsub="⟈",bull="•",bullet="•",bump="≎",bumpE="⪮",bumpe="≏",Bumpeq="≎",bumpeq="≏",Cacute="Ć",cacute="ć",capand="⩄",capbrcup="⩉",capcap="⩋",cap="∩",Cap="⋒",capcup="⩇",capdot="⩀",CapitalDifferentialD="ⅅ",caps="∩︀",caret="⁁",caron="ˇ",Cayleys="ℭ",ccaps="⩍",Ccaron="Č",ccaron="č",Ccedil="Ç",ccedil="ç",Ccirc="Ĉ",ccirc="ĉ",Cconint="∰",ccups="⩌",ccupssm="⩐",Cdot="Ċ",cdot="ċ",cedil="¸",Cedilla="¸",cemptyv="⦲",cent="¢",centerdot="·",CenterDot="·",cfr="𝔠",Cfr="ℭ",CHcy="Ч",chcy="ч",check="✓",checkmark="✓",Chi="Χ",chi="χ",circ="ˆ",circeq="≗",circlearrowleft="↺",circlearrowright="↻",circledast="⊛",circledcirc="⊚",circleddash="⊝",CircleDot="⊙",circledR="®",circledS="Ⓢ",CircleMinus="⊖",CirclePlus="⊕",CircleTimes="⊗",cir="○",cirE="⧃",cire="≗",cirfnint="⨐",cirmid="⫯",cirscir="⧂",ClockwiseContourIntegral="∲",CloseCurlyDoubleQuote="”",CloseCurlyQuote="’",clubs="♣",clubsuit="♣",colon=":",Colon="∷",Colone="⩴",colone="≔",coloneq="≔",comma=",",commat="@",comp="∁",compfn="∘",complement="∁",complexes="ℂ",cong="≅",congdot="⩭",Congruent="≡",conint="∮",Conint="∯",ContourIntegral="∮",copf="𝕔",Copf="ℂ",coprod="∐",Coproduct="∐",copy="©",COPY="©",copysr="℗",CounterClockwiseContourIntegral="∳",crarr="↵",cross="✗",Cross="⨯",Cscr="𝒞",cscr="𝒸",csub="⫏",csube="⫑",csup="⫐",csupe="⫒",ctdot="⋯",cudarrl="⤸",cudarrr="⤵",cuepr="⋞",cuesc="⋟",cularr="↶",cularrp="⤽",cupbrcap="⩈",cupcap="⩆",CupCap="≍",cup="∪",Cup="⋓",cupcup="⩊",cupdot="⊍",cupor="⩅",cups="∪︀",curarr="↷",curarrm="⤼",curlyeqprec="⋞",curlyeqsucc="⋟",curlyvee="⋎",curlywedge="⋏",curren="¤",curvearrowleft="↶",curvearrowright="↷",cuvee="⋎",cuwed="⋏",cwconint="∲",cwint="∱",cylcty="⌭",dagger="†",Dagger="‡",daleth="ℸ",darr="↓",Darr="↡",dArr="⇓",dash="‐",Dashv="⫤",dashv="⊣",dbkarow="⤏",dblac="˝",Dcaron="Ď",dcaron="ď",Dcy="Д",dcy="д",ddagger="‡",ddarr="⇊",DD="ⅅ",dd="ⅆ",DDotrahd="⤑",ddotseq="⩷",deg="°",Del="∇",Delta="Δ",delta="δ",demptyv="⦱",dfisht="⥿",Dfr="𝔇",dfr="𝔡",dHar="⥥",dharl="⇃",dharr="⇂",DiacriticalAcute="´",DiacriticalDot="˙",DiacriticalDoubleAcute="˝",DiacriticalGrave="`",DiacriticalTilde="˜",diam="⋄",diamond="⋄",Diamond="⋄",diamondsuit="♦",diams="♦",die="¨",DifferentialD="ⅆ",digamma="ϝ",disin="⋲",div="÷",divide="÷",divideontimes="⋇",divonx="⋇",DJcy="Ђ",djcy="ђ",dlcorn="⌞",dlcrop="⌍",dollar="$",Dopf="𝔻",dopf="𝕕",Dot="¨",dot="˙",DotDot="⃜",doteq="≐",doteqdot="≑",DotEqual="≐",dotminus="∸",dotplus="∔",dotsquare="⊡",doublebarwedge="⌆",DoubleContourIntegral="∯",DoubleDot="¨",DoubleDownArrow="⇓",DoubleLeftArrow="⇐",DoubleLeftRightArrow="⇔",DoubleLeftTee="⫤",DoubleLongLeftArrow="⟸",DoubleLongLeftRightArrow="⟺",DoubleLongRightArrow="⟹",DoubleRightArrow="⇒",DoubleRightTee="⊨",DoubleUpArrow="⇑",DoubleUpDownArrow="⇕",DoubleVerticalBar="∥",DownArrowBar="⤓",downarrow="↓",DownArrow="↓",Downarrow="⇓",DownArrowUpArrow="⇵",DownBreve="̑",downdownarrows="⇊",downharpoonleft="⇃",downharpoonright="⇂",DownLeftRightVector="⥐",DownLeftTeeVector="⥞",DownLeftVectorBar="⥖",DownLeftVector="↽",DownRightTeeVector="⥟",DownRightVectorBar="⥗",DownRightVector="⇁",DownTeeArrow="↧",DownTee="⊤",drbkarow="⤐",drcorn="⌟",drcrop="⌌",Dscr="𝒟",dscr="𝒹",DScy="Ѕ",dscy="ѕ",dsol="⧶",Dstrok="Đ",dstrok="đ",dtdot="⋱",dtri="▿",dtrif="▾",duarr="⇵",duhar="⥯",dwangle="⦦",DZcy="Џ",dzcy="џ",dzigrarr="⟿",Eacute="É",eacute="é",easter="⩮",Ecaron="Ě",ecaron="ě",Ecirc="Ê",ecirc="ê",ecir="≖",ecolon="≕",Ecy="Э",ecy="э",eDDot="⩷",Edot="Ė",edot="ė",eDot="≑",ee="ⅇ",efDot="≒",Efr="𝔈",efr="𝔢",eg="⪚",Egrave="È",egrave="è",egs="⪖",egsdot="⪘",el="⪙",Element$1="∈",elinters="⏧",ell="ℓ",els="⪕",elsdot="⪗",Emacr="Ē",emacr="ē",empty="∅",emptyset="∅",EmptySmallSquare="◻",emptyv="∅",EmptyVerySmallSquare="▫",emsp13=" ",emsp14=" ",emsp=" ",ENG="Ŋ",eng="ŋ",ensp=" ",Eogon="Ę",eogon="ę",Eopf="𝔼",eopf="𝕖",epar="⋕",eparsl="⧣",eplus="⩱",epsi="ε",Epsilon="Ε",epsilon="ε",epsiv="ϵ",eqcirc="≖",eqcolon="≕",eqsim="≂",eqslantgtr="⪖",eqslantless="⪕",Equal="⩵",equals="=",EqualTilde="≂",equest="≟",Equilibrium="⇌",equiv="≡",equivDD="⩸",eqvparsl="⧥",erarr="⥱",erDot="≓",escr="ℯ",Escr="ℰ",esdot="≐",Esim="⩳",esim="≂",Eta="Η",eta="η",ETH="Ð",eth="ð",Euml="Ë",euml="ë",euro="€",excl="!",exist="∃",Exists="∃",expectation="ℰ",exponentiale="ⅇ",ExponentialE="ⅇ",fallingdotseq="≒",Fcy="Ф",fcy="ф",female="♀",ffilig="ffi",fflig="ff",ffllig="ffl",Ffr="𝔉",ffr="𝔣",filig="fi",FilledSmallSquare="◼",FilledVerySmallSquare="▪",fjlig="fj",flat="♭",fllig="fl",fltns="▱",fnof="ƒ",Fopf="𝔽",fopf="𝕗",forall="∀",ForAll="∀",fork="⋔",forkv="⫙",Fouriertrf="ℱ",fpartint="⨍",frac12="½",frac13="⅓",frac14="¼",frac15="⅕",frac16="⅙",frac18="⅛",frac23="⅔",frac25="⅖",frac34="¾",frac35="⅗",frac38="⅜",frac45="⅘",frac56="⅚",frac58="⅝",frac78="⅞",frasl="⁄",frown="⌢",fscr="𝒻",Fscr="ℱ",gacute="ǵ",Gamma="Γ",gamma="γ",Gammad="Ϝ",gammad="ϝ",gap="⪆",Gbreve="Ğ",gbreve="ğ",Gcedil="Ģ",Gcirc="Ĝ",gcirc="ĝ",Gcy="Г",gcy="г",Gdot="Ġ",gdot="ġ",ge="≥",gE="≧",gEl="⪌",gel="⋛",geq="≥",geqq="≧",geqslant="⩾",gescc="⪩",ges="⩾",gesdot="⪀",gesdoto="⪂",gesdotol="⪄",gesl="⋛︀",gesles="⪔",Gfr="𝔊",gfr="𝔤",gg="≫",Gg="⋙",ggg="⋙",gimel="ℷ",GJcy="Ѓ",gjcy="ѓ",gla="⪥",gl="≷",glE="⪒",glj="⪤",gnap="⪊",gnapprox="⪊",gne="⪈",gnE="≩",gneq="⪈",gneqq="≩",gnsim="⋧",Gopf="𝔾",gopf="𝕘",grave="`",GreaterEqual="≥",GreaterEqualLess="⋛",GreaterFullEqual="≧",GreaterGreater="⪢",GreaterLess="≷",GreaterSlantEqual="⩾",GreaterTilde="≳",Gscr="𝒢",gscr="ℊ",gsim="≳",gsime="⪎",gsiml="⪐",gtcc="⪧",gtcir="⩺",gt=">",GT=">",Gt="≫",gtdot="⋗",gtlPar="⦕",gtquest="⩼",gtrapprox="⪆",gtrarr="⥸",gtrdot="⋗",gtreqless="⋛",gtreqqless="⪌",gtrless="≷",gtrsim="≳",gvertneqq="≩︀",gvnE="≩︀",Hacek="ˇ",hairsp=" ",half="½",hamilt="ℋ",HARDcy="Ъ",hardcy="ъ",harrcir="⥈",harr="↔",hArr="⇔",harrw="↭",Hat="^",hbar="ℏ",Hcirc="Ĥ",hcirc="ĥ",hearts="♥",heartsuit="♥",hellip="…",hercon="⊹",hfr="𝔥",Hfr="ℌ",HilbertSpace="ℋ",hksearow="⤥",hkswarow="⤦",hoarr="⇿",homtht="∻",hookleftarrow="↩",hookrightarrow="↪",hopf="𝕙",Hopf="ℍ",horbar="―",HorizontalLine="─",hscr="𝒽",Hscr="ℋ",hslash="ℏ",Hstrok="Ħ",hstrok="ħ",HumpDownHump="≎",HumpEqual="≏",hybull="⁃",hyphen="‐",Iacute="Í",iacute="í",ic="⁣",Icirc="Î",icirc="î",Icy="И",icy="и",Idot="İ",IEcy="Е",iecy="е",iexcl="¡",iff="⇔",ifr="𝔦",Ifr="ℑ",Igrave="Ì",igrave="ì",ii="ⅈ",iiiint="⨌",iiint="∭",iinfin="⧜",iiota="℩",IJlig="IJ",ijlig="ij",Imacr="Ī",imacr="ī",image$1="ℑ",ImaginaryI="ⅈ",imagline="ℐ",imagpart="ℑ",imath="ı",Im="ℑ",imof="⊷",imped="Ƶ",Implies="⇒",incare="℅",infin="∞",infintie="⧝",inodot="ı",intcal="⊺",int="∫",Int="∬",integers="ℤ",Integral="∫",intercal="⊺",Intersection="⋂",intlarhk="⨗",intprod="⨼",InvisibleComma="⁣",InvisibleTimes="⁢",IOcy="Ё",iocy="ё",Iogon="Į",iogon="į",Iopf="𝕀",iopf="𝕚",Iota="Ι",iota="ι",iprod="⨼",iquest="¿",iscr="𝒾",Iscr="ℐ",isin="∈",isindot="⋵",isinE="⋹",isins="⋴",isinsv="⋳",isinv="∈",it="⁢",Itilde="Ĩ",itilde="ĩ",Iukcy="І",iukcy="і",Iuml="Ï",iuml="ï",Jcirc="Ĵ",jcirc="ĵ",Jcy="Й",jcy="й",Jfr="𝔍",jfr="𝔧",jmath="ȷ",Jopf="𝕁",jopf="𝕛",Jscr="𝒥",jscr="𝒿",Jsercy="Ј",jsercy="ј",Jukcy="Є",jukcy="є",Kappa="Κ",kappa="κ",kappav="ϰ",Kcedil="Ķ",kcedil="ķ",Kcy="К",kcy="к",Kfr="𝔎",kfr="𝔨",kgreen="ĸ",KHcy="Х",khcy="х",KJcy="Ќ",kjcy="ќ",Kopf="𝕂",kopf="𝕜",Kscr="𝒦",kscr="𝓀",lAarr="⇚",Lacute="Ĺ",lacute="ĺ",laemptyv="⦴",lagran="ℒ",Lambda="Λ",lambda="λ",lang="⟨",Lang="⟪",langd="⦑",langle="⟨",lap="⪅",Laplacetrf="ℒ",laquo="«",larrb="⇤",larrbfs="⤟",larr="←",Larr="↞",lArr="⇐",larrfs="⤝",larrhk="↩",larrlp="↫",larrpl="⤹",larrsim="⥳",larrtl="↢",latail="⤙",lAtail="⤛",lat="⪫",late="⪭",lates="⪭︀",lbarr="⤌",lBarr="⤎",lbbrk="❲",lbrace="{",lbrack="[",lbrke="⦋",lbrksld="⦏",lbrkslu="⦍",Lcaron="Ľ",lcaron="ľ",Lcedil="Ļ",lcedil="ļ",lceil="⌈",lcub="{",Lcy="Л",lcy="л",ldca="⤶",ldquo="“",ldquor="„",ldrdhar="⥧",ldrushar="⥋",ldsh="↲",le="≤",lE="≦",LeftAngleBracket="⟨",LeftArrowBar="⇤",leftarrow="←",LeftArrow="←",Leftarrow="⇐",LeftArrowRightArrow="⇆",leftarrowtail="↢",LeftCeiling="⌈",LeftDoubleBracket="⟦",LeftDownTeeVector="⥡",LeftDownVectorBar="⥙",LeftDownVector="⇃",LeftFloor="⌊",leftharpoondown="↽",leftharpoonup="↼",leftleftarrows="⇇",leftrightarrow="↔",LeftRightArrow="↔",Leftrightarrow="⇔",leftrightarrows="⇆",leftrightharpoons="⇋",leftrightsquigarrow="↭",LeftRightVector="⥎",LeftTeeArrow="↤",LeftTee="⊣",LeftTeeVector="⥚",leftthreetimes="⋋",LeftTriangleBar="⧏",LeftTriangle="⊲",LeftTriangleEqual="⊴",LeftUpDownVector="⥑",LeftUpTeeVector="⥠",LeftUpVectorBar="⥘",LeftUpVector="↿",LeftVectorBar="⥒",LeftVector="↼",lEg="⪋",leg="⋚",leq="≤",leqq="≦",leqslant="⩽",lescc="⪨",les="⩽",lesdot="⩿",lesdoto="⪁",lesdotor="⪃",lesg="⋚︀",lesges="⪓",lessapprox="⪅",lessdot="⋖",lesseqgtr="⋚",lesseqqgtr="⪋",LessEqualGreater="⋚",LessFullEqual="≦",LessGreater="≶",lessgtr="≶",LessLess="⪡",lesssim="≲",LessSlantEqual="⩽",LessTilde="≲",lfisht="⥼",lfloor="⌊",Lfr="𝔏",lfr="𝔩",lg="≶",lgE="⪑",lHar="⥢",lhard="↽",lharu="↼",lharul="⥪",lhblk="▄",LJcy="Љ",ljcy="љ",llarr="⇇",ll="≪",Ll="⋘",llcorner="⌞",Lleftarrow="⇚",llhard="⥫",lltri="◺",Lmidot="Ŀ",lmidot="ŀ",lmoustache="⎰",lmoust="⎰",lnap="⪉",lnapprox="⪉",lne="⪇",lnE="≨",lneq="⪇",lneqq="≨",lnsim="⋦",loang="⟬",loarr="⇽",lobrk="⟦",longleftarrow="⟵",LongLeftArrow="⟵",Longleftarrow="⟸",longleftrightarrow="⟷",LongLeftRightArrow="⟷",Longleftrightarrow="⟺",longmapsto="⟼",longrightarrow="⟶",LongRightArrow="⟶",Longrightarrow="⟹",looparrowleft="↫",looparrowright="↬",lopar="⦅",Lopf="𝕃",lopf="𝕝",loplus="⨭",lotimes="⨴",lowast="∗",lowbar="_",LowerLeftArrow="↙",LowerRightArrow="↘",loz="◊",lozenge="◊",lozf="⧫",lpar="(",lparlt="⦓",lrarr="⇆",lrcorner="⌟",lrhar="⇋",lrhard="⥭",lrm="‎",lrtri="⊿",lsaquo="‹",lscr="𝓁",Lscr="ℒ",lsh="↰",Lsh="↰",lsim="≲",lsime="⪍",lsimg="⪏",lsqb="[",lsquo="‘",lsquor="‚",Lstrok="Ł",lstrok="ł",ltcc="⪦",ltcir="⩹",lt="<",LT="<",Lt="≪",ltdot="⋖",lthree="⋋",ltimes="⋉",ltlarr="⥶",ltquest="⩻",ltri="◃",ltrie="⊴",ltrif="◂",ltrPar="⦖",lurdshar="⥊",luruhar="⥦",lvertneqq="≨︀",lvnE="≨︀",macr="¯",male="♂",malt="✠",maltese="✠",map$1="↦",mapsto="↦",mapstodown="↧",mapstoleft="↤",mapstoup="↥",marker="▮",mcomma="⨩",Mcy="М",mcy="м",mdash="—",mDDot="∺",measuredangle="∡",MediumSpace=" ",Mellintrf="ℳ",Mfr="𝔐",mfr="𝔪",mho="℧",micro="µ",midast="*",midcir="⫰",mid="∣",middot="·",minusb="⊟",minus="−",minusd="∸",minusdu="⨪",MinusPlus="∓",mlcp="⫛",mldr="…",mnplus="∓",models="⊧",Mopf="𝕄",mopf="𝕞",mp="∓",mscr="𝓂",Mscr="ℳ",mstpos="∾",Mu="Μ",mu="μ",multimap="⊸",mumap="⊸",nabla="∇",Nacute="Ń",nacute="ń",nang="∠⃒",nap="≉",napE="⩰̸",napid="≋̸",napos="ʼn",napprox="≉",natural="♮",naturals="ℕ",natur="♮",nbsp=" ",nbump="≎̸",nbumpe="≏̸",ncap="⩃",Ncaron="Ň",ncaron="ň",Ncedil="Ņ",ncedil="ņ",ncong="≇",ncongdot="⩭̸",ncup="⩂",Ncy="Н",ncy="н",ndash="–",nearhk="⤤",nearr="↗",neArr="⇗",nearrow="↗",ne="≠",nedot="≐̸",NegativeMediumSpace="​",NegativeThickSpace="​",NegativeThinSpace="​",NegativeVeryThinSpace="​",nequiv="≢",nesear="⤨",nesim="≂̸",NestedGreaterGreater="≫",NestedLessLess="≪",NewLine=` `,nexist="∄",nexists="∄",Nfr="𝔑",nfr="𝔫",ngE="≧̸",nge="≱",ngeq="≱",ngeqq="≧̸",ngeqslant="⩾̸",nges="⩾̸",nGg="⋙̸",ngsim="≵",nGt="≫⃒",ngt="≯",ngtr="≯",nGtv="≫̸",nharr="↮",nhArr="⇎",nhpar="⫲",ni="∋",nis="⋼",nisd="⋺",niv="∋",NJcy="Њ",njcy="њ",nlarr="↚",nlArr="⇍",nldr="‥",nlE="≦̸",nle="≰",nleftarrow="↚",nLeftarrow="⇍",nleftrightarrow="↮",nLeftrightarrow="⇎",nleq="≰",nleqq="≦̸",nleqslant="⩽̸",nles="⩽̸",nless="≮",nLl="⋘̸",nlsim="≴",nLt="≪⃒",nlt="≮",nltri="⋪",nltrie="⋬",nLtv="≪̸",nmid="∤",NoBreak="⁠",NonBreakingSpace=" ",nopf="𝕟",Nopf="ℕ",Not="⫬",not="¬",NotCongruent="≢",NotCupCap="≭",NotDoubleVerticalBar="∦",NotElement="∉",NotEqual="≠",NotEqualTilde="≂̸",NotExists="∄",NotGreater="≯",NotGreaterEqual="≱",NotGreaterFullEqual="≧̸",NotGreaterGreater="≫̸",NotGreaterLess="≹",NotGreaterSlantEqual="⩾̸",NotGreaterTilde="≵",NotHumpDownHump="≎̸",NotHumpEqual="≏̸",notin="∉",notindot="⋵̸",notinE="⋹̸",notinva="∉",notinvb="⋷",notinvc="⋶",NotLeftTriangleBar="⧏̸",NotLeftTriangle="⋪",NotLeftTriangleEqual="⋬",NotLess="≮",NotLessEqual="≰",NotLessGreater="≸",NotLessLess="≪̸",NotLessSlantEqual="⩽̸",NotLessTilde="≴",NotNestedGreaterGreater="⪢̸",NotNestedLessLess="⪡̸",notni="∌",notniva="∌",notnivb="⋾",notnivc="⋽",NotPrecedes="⊀",NotPrecedesEqual="⪯̸",NotPrecedesSlantEqual="⋠",NotReverseElement="∌",NotRightTriangleBar="⧐̸",NotRightTriangle="⋫",NotRightTriangleEqual="⋭",NotSquareSubset="⊏̸",NotSquareSubsetEqual="⋢",NotSquareSuperset="⊐̸",NotSquareSupersetEqual="⋣",NotSubset="⊂⃒",NotSubsetEqual="⊈",NotSucceeds="⊁",NotSucceedsEqual="⪰̸",NotSucceedsSlantEqual="⋡",NotSucceedsTilde="≿̸",NotSuperset="⊃⃒",NotSupersetEqual="⊉",NotTilde="≁",NotTildeEqual="≄",NotTildeFullEqual="≇",NotTildeTilde="≉",NotVerticalBar="∤",nparallel="∦",npar="∦",nparsl="⫽⃥",npart="∂̸",npolint="⨔",npr="⊀",nprcue="⋠",nprec="⊀",npreceq="⪯̸",npre="⪯̸",nrarrc="⤳̸",nrarr="↛",nrArr="⇏",nrarrw="↝̸",nrightarrow="↛",nRightarrow="⇏",nrtri="⋫",nrtrie="⋭",nsc="⊁",nsccue="⋡",nsce="⪰̸",Nscr="𝒩",nscr="𝓃",nshortmid="∤",nshortparallel="∦",nsim="≁",nsime="≄",nsimeq="≄",nsmid="∤",nspar="∦",nsqsube="⋢",nsqsupe="⋣",nsub="⊄",nsubE="⫅̸",nsube="⊈",nsubset="⊂⃒",nsubseteq="⊈",nsubseteqq="⫅̸",nsucc="⊁",nsucceq="⪰̸",nsup="⊅",nsupE="⫆̸",nsupe="⊉",nsupset="⊃⃒",nsupseteq="⊉",nsupseteqq="⫆̸",ntgl="≹",Ntilde="Ñ",ntilde="ñ",ntlg="≸",ntriangleleft="⋪",ntrianglelefteq="⋬",ntriangleright="⋫",ntrianglerighteq="⋭",Nu="Ν",nu="ν",num="#",numero="№",numsp=" ",nvap="≍⃒",nvdash="⊬",nvDash="⊭",nVdash="⊮",nVDash="⊯",nvge="≥⃒",nvgt=">⃒",nvHarr="⤄",nvinfin="⧞",nvlArr="⤂",nvle="≤⃒",nvlt="<⃒",nvltrie="⊴⃒",nvrArr="⤃",nvrtrie="⊵⃒",nvsim="∼⃒",nwarhk="⤣",nwarr="↖",nwArr="⇖",nwarrow="↖",nwnear="⤧",Oacute="Ó",oacute="ó",oast="⊛",Ocirc="Ô",ocirc="ô",ocir="⊚",Ocy="О",ocy="о",odash="⊝",Odblac="Ő",odblac="ő",odiv="⨸",odot="⊙",odsold="⦼",OElig="Œ",oelig="œ",ofcir="⦿",Ofr="𝔒",ofr="𝔬",ogon="˛",Ograve="Ò",ograve="ò",ogt="⧁",ohbar="⦵",ohm="Ω",oint="∮",olarr="↺",olcir="⦾",olcross="⦻",oline="‾",olt="⧀",Omacr="Ō",omacr="ō",Omega="Ω",omega="ω",Omicron="Ο",omicron="ο",omid="⦶",ominus="⊖",Oopf="𝕆",oopf="𝕠",opar="⦷",OpenCurlyDoubleQuote="“",OpenCurlyQuote="‘",operp="⦹",oplus="⊕",orarr="↻",Or="⩔",or="∨",ord="⩝",order="ℴ",orderof="ℴ",ordf="ª",ordm="º",origof="⊶",oror="⩖",orslope="⩗",orv="⩛",oS="Ⓢ",Oscr="𝒪",oscr="ℴ",Oslash="Ø",oslash="ø",osol="⊘",Otilde="Õ",otilde="õ",otimesas="⨶",Otimes="⨷",otimes="⊗",Ouml="Ö",ouml="ö",ovbar="⌽",OverBar="‾",OverBrace="⏞",OverBracket="⎴",OverParenthesis="⏜",para="¶",parallel="∥",par="∥",parsim="⫳",parsl="⫽",part="∂",PartialD="∂",Pcy="П",pcy="п",percnt="%",period=".",permil="‰",perp="⊥",pertenk="‱",Pfr="𝔓",pfr="𝔭",Phi="Φ",phi="φ",phiv="ϕ",phmmat="ℳ",phone="☎",Pi="Π",pi="π",pitchfork="⋔",piv="ϖ",planck="ℏ",planckh="ℎ",plankv="ℏ",plusacir="⨣",plusb="⊞",pluscir="⨢",plus="+",plusdo="∔",plusdu="⨥",pluse="⩲",PlusMinus="±",plusmn="±",plussim="⨦",plustwo="⨧",pm="±",Poincareplane="ℌ",pointint="⨕",popf="𝕡",Popf="ℙ",pound="£",prap="⪷",Pr="⪻",pr="≺",prcue="≼",precapprox="⪷",prec="≺",preccurlyeq="≼",Precedes="≺",PrecedesEqual="⪯",PrecedesSlantEqual="≼",PrecedesTilde="≾",preceq="⪯",precnapprox="⪹",precneqq="⪵",precnsim="⋨",pre="⪯",prE="⪳",precsim="≾",prime="′",Prime="″",primes="ℙ",prnap="⪹",prnE="⪵",prnsim="⋨",prod="∏",Product="∏",profalar="⌮",profline="⌒",profsurf="⌓",prop="∝",Proportional="∝",Proportion="∷",propto="∝",prsim="≾",prurel="⊰",Pscr="𝒫",pscr="𝓅",Psi="Ψ",psi="ψ",puncsp=" ",Qfr="𝔔",qfr="𝔮",qint="⨌",qopf="𝕢",Qopf="ℚ",qprime="⁗",Qscr="𝒬",qscr="𝓆",quaternions="ℍ",quatint="⨖",quest="?",questeq="≟",quot='"',QUOT='"',rAarr="⇛",race="∽̱",Racute="Ŕ",racute="ŕ",radic="√",raemptyv="⦳",rang="⟩",Rang="⟫",rangd="⦒",range="⦥",rangle="⟩",raquo="»",rarrap="⥵",rarrb="⇥",rarrbfs="⤠",rarrc="⤳",rarr="→",Rarr="↠",rArr="⇒",rarrfs="⤞",rarrhk="↪",rarrlp="↬",rarrpl="⥅",rarrsim="⥴",Rarrtl="⤖",rarrtl="↣",rarrw="↝",ratail="⤚",rAtail="⤜",ratio="∶",rationals="ℚ",rbarr="⤍",rBarr="⤏",RBarr="⤐",rbbrk="❳",rbrace="}",rbrack="]",rbrke="⦌",rbrksld="⦎",rbrkslu="⦐",Rcaron="Ř",rcaron="ř",Rcedil="Ŗ",rcedil="ŗ",rceil="⌉",rcub="}",Rcy="Р",rcy="р",rdca="⤷",rdldhar="⥩",rdquo="”",rdquor="”",rdsh="↳",real="ℜ",realine="ℛ",realpart="ℜ",reals="ℝ",Re="ℜ",rect="▭",reg="®",REG="®",ReverseElement="∋",ReverseEquilibrium="⇋",ReverseUpEquilibrium="⥯",rfisht="⥽",rfloor="⌋",rfr="𝔯",Rfr="ℜ",rHar="⥤",rhard="⇁",rharu="⇀",rharul="⥬",Rho="Ρ",rho="ρ",rhov="ϱ",RightAngleBracket="⟩",RightArrowBar="⇥",rightarrow="→",RightArrow="→",Rightarrow="⇒",RightArrowLeftArrow="⇄",rightarrowtail="↣",RightCeiling="⌉",RightDoubleBracket="⟧",RightDownTeeVector="⥝",RightDownVectorBar="⥕",RightDownVector="⇂",RightFloor="⌋",rightharpoondown="⇁",rightharpoonup="⇀",rightleftarrows="⇄",rightleftharpoons="⇌",rightrightarrows="⇉",rightsquigarrow="↝",RightTeeArrow="↦",RightTee="⊢",RightTeeVector="⥛",rightthreetimes="⋌",RightTriangleBar="⧐",RightTriangle="⊳",RightTriangleEqual="⊵",RightUpDownVector="⥏",RightUpTeeVector="⥜",RightUpVectorBar="⥔",RightUpVector="↾",RightVectorBar="⥓",RightVector="⇀",ring="˚",risingdotseq="≓",rlarr="⇄",rlhar="⇌",rlm="‏",rmoustache="⎱",rmoust="⎱",rnmid="⫮",roang="⟭",roarr="⇾",robrk="⟧",ropar="⦆",ropf="𝕣",Ropf="ℝ",roplus="⨮",rotimes="⨵",RoundImplies="⥰",rpar=")",rpargt="⦔",rppolint="⨒",rrarr="⇉",Rrightarrow="⇛",rsaquo="›",rscr="𝓇",Rscr="ℛ",rsh="↱",Rsh="↱",rsqb="]",rsquo="’",rsquor="’",rthree="⋌",rtimes="⋊",rtri="▹",rtrie="⊵",rtrif="▸",rtriltri="⧎",RuleDelayed="⧴",ruluhar="⥨",rx="℞",Sacute="Ś",sacute="ś",sbquo="‚",scap="⪸",Scaron="Š",scaron="š",Sc="⪼",sc="≻",sccue="≽",sce="⪰",scE="⪴",Scedil="Ş",scedil="ş",Scirc="Ŝ",scirc="ŝ",scnap="⪺",scnE="⪶",scnsim="⋩",scpolint="⨓",scsim="≿",Scy="С",scy="с",sdotb="⊡",sdot="⋅",sdote="⩦",searhk="⤥",searr="↘",seArr="⇘",searrow="↘",sect="§",semi=";",seswar="⤩",setminus="∖",setmn="∖",sext="✶",Sfr="𝔖",sfr="𝔰",sfrown="⌢",sharp="♯",SHCHcy="Щ",shchcy="щ",SHcy="Ш",shcy="ш",ShortDownArrow="↓",ShortLeftArrow="←",shortmid="∣",shortparallel="∥",ShortRightArrow="→",ShortUpArrow="↑",shy="­",Sigma="Σ",sigma="σ",sigmaf="ς",sigmav="ς",sim="∼",simdot="⩪",sime="≃",simeq="≃",simg="⪞",simgE="⪠",siml="⪝",simlE="⪟",simne="≆",simplus="⨤",simrarr="⥲",slarr="←",SmallCircle="∘",smallsetminus="∖",smashp="⨳",smeparsl="⧤",smid="∣",smile="⌣",smt="⪪",smte="⪬",smtes="⪬︀",SOFTcy="Ь",softcy="ь",solbar="⌿",solb="⧄",sol="/",Sopf="𝕊",sopf="𝕤",spades="♠",spadesuit="♠",spar="∥",sqcap="⊓",sqcaps="⊓︀",sqcup="⊔",sqcups="⊔︀",Sqrt="√",sqsub="⊏",sqsube="⊑",sqsubset="⊏",sqsubseteq="⊑",sqsup="⊐",sqsupe="⊒",sqsupset="⊐",sqsupseteq="⊒",square="□",Square="□",SquareIntersection="⊓",SquareSubset="⊏",SquareSubsetEqual="⊑",SquareSuperset="⊐",SquareSupersetEqual="⊒",SquareUnion="⊔",squarf="▪",squ="□",squf="▪",srarr="→",Sscr="𝒮",sscr="𝓈",ssetmn="∖",ssmile="⌣",sstarf="⋆",Star="⋆",star="☆",starf="★",straightepsilon="ϵ",straightphi="ϕ",strns="¯",sub="⊂",Sub="⋐",subdot="⪽",subE="⫅",sube="⊆",subedot="⫃",submult="⫁",subnE="⫋",subne="⊊",subplus="⪿",subrarr="⥹",subset="⊂",Subset="⋐",subseteq="⊆",subseteqq="⫅",SubsetEqual="⊆",subsetneq="⊊",subsetneqq="⫋",subsim="⫇",subsub="⫕",subsup="⫓",succapprox="⪸",succ="≻",succcurlyeq="≽",Succeeds="≻",SucceedsEqual="⪰",SucceedsSlantEqual="≽",SucceedsTilde="≿",succeq="⪰",succnapprox="⪺",succneqq="⪶",succnsim="⋩",succsim="≿",SuchThat="∋",sum="∑",Sum="∑",sung="♪",sup1="¹",sup2="²",sup3="³",sup="⊃",Sup="⋑",supdot="⪾",supdsub="⫘",supE="⫆",supe="⊇",supedot="⫄",Superset="⊃",SupersetEqual="⊇",suphsol="⟉",suphsub="⫗",suplarr="⥻",supmult="⫂",supnE="⫌",supne="⊋",supplus="⫀",supset="⊃",Supset="⋑",supseteq="⊇",supseteqq="⫆",supsetneq="⊋",supsetneqq="⫌",supsim="⫈",supsub="⫔",supsup="⫖",swarhk="⤦",swarr="↙",swArr="⇙",swarrow="↙",swnwar="⤪",szlig="ß",Tab=" ",target="⌖",Tau="Τ",tau="τ",tbrk="⎴",Tcaron="Ť",tcaron="ť",Tcedil="Ţ",tcedil="ţ",Tcy="Т",tcy="т",tdot="⃛",telrec="⌕",Tfr="𝔗",tfr="𝔱",there4="∴",therefore="∴",Therefore="∴",Theta="Θ",theta="θ",thetasym="ϑ",thetav="ϑ",thickapprox="≈",thicksim="∼",ThickSpace="  ",ThinSpace=" ",thinsp=" ",thkap="≈",thksim="∼",THORN="Þ",thorn="þ",tilde="˜",Tilde="∼",TildeEqual="≃",TildeFullEqual="≅",TildeTilde="≈",timesbar="⨱",timesb="⊠",times="×",timesd="⨰",tint="∭",toea="⤨",topbot="⌶",topcir="⫱",top="⊤",Topf="𝕋",topf="𝕥",topfork="⫚",tosa="⤩",tprime="‴",trade="™",TRADE="™",triangle="▵",triangledown="▿",triangleleft="◃",trianglelefteq="⊴",triangleq="≜",triangleright="▹",trianglerighteq="⊵",tridot="◬",trie="≜",triminus="⨺",TripleDot="⃛",triplus="⨹",trisb="⧍",tritime="⨻",trpezium="⏢",Tscr="𝒯",tscr="𝓉",TScy="Ц",tscy="ц",TSHcy="Ћ",tshcy="ћ",Tstrok="Ŧ",tstrok="ŧ",twixt="≬",twoheadleftarrow="↞",twoheadrightarrow="↠",Uacute="Ú",uacute="ú",uarr="↑",Uarr="↟",uArr="⇑",Uarrocir="⥉",Ubrcy="Ў",ubrcy="ў",Ubreve="Ŭ",ubreve="ŭ",Ucirc="Û",ucirc="û",Ucy="У",ucy="у",udarr="⇅",Udblac="Ű",udblac="ű",udhar="⥮",ufisht="⥾",Ufr="𝔘",ufr="𝔲",Ugrave="Ù",ugrave="ù",uHar="⥣",uharl="↿",uharr="↾",uhblk="▀",ulcorn="⌜",ulcorner="⌜",ulcrop="⌏",ultri="◸",Umacr="Ū",umacr="ū",uml="¨",UnderBar="_",UnderBrace="⏟",UnderBracket="⎵",UnderParenthesis="⏝",Union="⋃",UnionPlus="⊎",Uogon="Ų",uogon="ų",Uopf="𝕌",uopf="𝕦",UpArrowBar="⤒",uparrow="↑",UpArrow="↑",Uparrow="⇑",UpArrowDownArrow="⇅",updownarrow="↕",UpDownArrow="↕",Updownarrow="⇕",UpEquilibrium="⥮",upharpoonleft="↿",upharpoonright="↾",uplus="⊎",UpperLeftArrow="↖",UpperRightArrow="↗",upsi="υ",Upsi="ϒ",upsih="ϒ",Upsilon="Υ",upsilon="υ",UpTeeArrow="↥",UpTee="⊥",upuparrows="⇈",urcorn="⌝",urcorner="⌝",urcrop="⌎",Uring="Ů",uring="ů",urtri="◹",Uscr="𝒰",uscr="𝓊",utdot="⋰",Utilde="Ũ",utilde="ũ",utri="▵",utrif="▴",uuarr="⇈",Uuml="Ü",uuml="ü",uwangle="⦧",vangrt="⦜",varepsilon="ϵ",varkappa="ϰ",varnothing="∅",varphi="ϕ",varpi="ϖ",varpropto="∝",varr="↕",vArr="⇕",varrho="ϱ",varsigma="ς",varsubsetneq="⊊︀",varsubsetneqq="⫋︀",varsupsetneq="⊋︀",varsupsetneqq="⫌︀",vartheta="ϑ",vartriangleleft="⊲",vartriangleright="⊳",vBar="⫨",Vbar="⫫",vBarv="⫩",Vcy="В",vcy="в",vdash="⊢",vDash="⊨",Vdash="⊩",VDash="⊫",Vdashl="⫦",veebar="⊻",vee="∨",Vee="⋁",veeeq="≚",vellip="⋮",verbar="|",Verbar="‖",vert="|",Vert="‖",VerticalBar="∣",VerticalLine="|",VerticalSeparator="❘",VerticalTilde="≀",VeryThinSpace=" ",Vfr="𝔙",vfr="𝔳",vltri="⊲",vnsub="⊂⃒",vnsup="⊃⃒",Vopf="𝕍",vopf="𝕧",vprop="∝",vrtri="⊳",Vscr="𝒱",vscr="𝓋",vsubnE="⫋︀",vsubne="⊊︀",vsupnE="⫌︀",vsupne="⊋︀",Vvdash="⊪",vzigzag="⦚",Wcirc="Ŵ",wcirc="ŵ",wedbar="⩟",wedge="∧",Wedge="⋀",wedgeq="≙",weierp="℘",Wfr="𝔚",wfr="𝔴",Wopf="𝕎",wopf="𝕨",wp="℘",wr="≀",wreath="≀",Wscr="𝒲",wscr="𝓌",xcap="⋂",xcirc="◯",xcup="⋃",xdtri="▽",Xfr="𝔛",xfr="𝔵",xharr="⟷",xhArr="⟺",Xi="Ξ",xi="ξ",xlarr="⟵",xlArr="⟸",xmap="⟼",xnis="⋻",xodot="⨀",Xopf="𝕏",xopf="𝕩",xoplus="⨁",xotime="⨂",xrarr="⟶",xrArr="⟹",Xscr="𝒳",xscr="𝓍",xsqcup="⨆",xuplus="⨄",xutri="△",xvee="⋁",xwedge="⋀",Yacute="Ý",yacute="ý",YAcy="Я",yacy="я",Ycirc="Ŷ",ycirc="ŷ",Ycy="Ы",ycy="ы",yen="¥",Yfr="𝔜",yfr="𝔶",YIcy="Ї",yicy="ї",Yopf="𝕐",yopf="𝕪",Yscr="𝒴",yscr="𝓎",YUcy="Ю",yucy="ю",yuml="ÿ",Yuml="Ÿ",Zacute="Ź",zacute="ź",Zcaron="Ž",zcaron="ž",Zcy="З",zcy="з",Zdot="Ż",zdot="ż",zeetrf="ℨ",ZeroWidthSpace="​",Zeta="Ζ",zeta="ζ",zfr="𝔷",Zfr="ℨ",ZHcy="Ж",zhcy="ж",zigrarr="⇝",zopf="𝕫",Zopf="ℤ",Zscr="𝒵",zscr="𝓏",zwj="‍",zwnj="‌",require$$0={Aacute,aacute,Abreve,abreve,ac,acd,acE,Acirc,acirc,acute,Acy,acy,AElig,aelig,af,Afr,afr,Agrave,agrave,alefsym,aleph,Alpha,alpha,Amacr,amacr,amalg,amp,AMP,andand,And,and,andd,andslope,andv,ang,ange,angle,angmsdaa,angmsdab,angmsdac,angmsdad,angmsdae,angmsdaf,angmsdag,angmsdah,angmsd,angrt,angrtvb,angrtvbd,angsph,angst,angzarr,Aogon,aogon,Aopf,aopf,apacir,ap,apE,ape,apid,apos,ApplyFunction,approx,approxeq,Aring,aring,Ascr,ascr,Assign,ast,asymp,asympeq,Atilde,atilde,Auml,auml,awconint,awint,backcong,backepsilon,backprime,backsim,backsimeq,Backslash,Barv,barvee,barwed,Barwed,barwedge,bbrk,bbrktbrk,bcong,Bcy,bcy,bdquo,becaus,because,Because,bemptyv,bepsi,bernou,Bernoullis,Beta,beta,beth,between,Bfr,bfr,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:block$1,bne,bnequiv,bNot,bnot,Bopf,bopf,bot,bottom,bowtie,boxbox,boxdl,boxdL,boxDl,boxDL,boxdr,boxdR,boxDr,boxDR,boxh,boxH,boxhd,boxHd,boxhD,boxHD,boxhu,boxHu,boxhU,boxHU,boxminus,boxplus,boxtimes,boxul,boxuL,boxUl,boxUL,boxur,boxuR,boxUr,boxUR,boxv,boxV,boxvh,boxvH,boxVh,boxVH,boxvl,boxvL,boxVl,boxVL,boxvr,boxvR,boxVr,boxVR,bprime,breve,Breve,brvbar,bscr,Bscr,bsemi,bsim,bsime,bsolb,bsol,bsolhsub,bull,bullet,bump,bumpE,bumpe,Bumpeq,bumpeq,Cacute,cacute,capand,capbrcup,capcap,cap,Cap,capcup,capdot,CapitalDifferentialD,caps,caret,caron,Cayleys,ccaps,Ccaron,ccaron,Ccedil,ccedil,Ccirc,ccirc,Cconint,ccups,ccupssm,Cdot,cdot,cedil,Cedilla,cemptyv,cent,centerdot,CenterDot,cfr,Cfr,CHcy,chcy,check,checkmark,Chi,chi,circ,circeq,circlearrowleft,circlearrowright,circledast,circledcirc,circleddash,CircleDot,circledR,circledS,CircleMinus,CirclePlus,CircleTimes,cir,cirE,cire,cirfnint,cirmid,cirscir,ClockwiseContourIntegral,CloseCurlyDoubleQuote,CloseCurlyQuote,clubs,clubsuit,colon,Colon,Colone,colone,coloneq,comma,commat,comp,compfn,complement,complexes,cong,congdot,Congruent,conint,Conint,ContourIntegral,copf,Copf,coprod,Coproduct,copy,COPY,copysr,CounterClockwiseContourIntegral,crarr,cross,Cross,Cscr,cscr,csub,csube,csup,csupe,ctdot,cudarrl,cudarrr,cuepr,cuesc,cularr,cularrp,cupbrcap,cupcap,CupCap,cup,Cup,cupcup,cupdot,cupor,cups,curarr,curarrm,curlyeqprec,curlyeqsucc,curlyvee,curlywedge,curren,curvearrowleft,curvearrowright,cuvee,cuwed,cwconint,cwint,cylcty,dagger,Dagger,daleth,darr,Darr,dArr,dash,Dashv,dashv,dbkarow,dblac,Dcaron,dcaron,Dcy,dcy,ddagger,ddarr,DD,dd,DDotrahd,ddotseq,deg,Del,Delta,delta,demptyv,dfisht,Dfr,dfr,dHar,dharl,dharr,DiacriticalAcute,DiacriticalDot,DiacriticalDoubleAcute,DiacriticalGrave,DiacriticalTilde,diam,diamond,Diamond,diamondsuit,diams,die,DifferentialD,digamma,disin,div,divide,divideontimes,divonx,DJcy,djcy,dlcorn,dlcrop,dollar,Dopf,dopf,Dot,dot,DotDot,doteq,doteqdot,DotEqual,dotminus,dotplus,dotsquare,doublebarwedge,DoubleContourIntegral,DoubleDot,DoubleDownArrow,DoubleLeftArrow,DoubleLeftRightArrow,DoubleLeftTee,DoubleLongLeftArrow,DoubleLongLeftRightArrow,DoubleLongRightArrow,DoubleRightArrow,DoubleRightTee,DoubleUpArrow,DoubleUpDownArrow,DoubleVerticalBar,DownArrowBar,downarrow,DownArrow,Downarrow,DownArrowUpArrow,DownBreve,downdownarrows,downharpoonleft,downharpoonright,DownLeftRightVector,DownLeftTeeVector,DownLeftVectorBar,DownLeftVector,DownRightTeeVector,DownRightVectorBar,DownRightVector,DownTeeArrow,DownTee,drbkarow,drcorn,drcrop,Dscr,dscr,DScy,dscy,dsol,Dstrok,dstrok,dtdot,dtri,dtrif,duarr,duhar,dwangle,DZcy,dzcy,dzigrarr,Eacute,eacute,easter,Ecaron,ecaron,Ecirc,ecirc,ecir,ecolon,Ecy,ecy,eDDot,Edot,edot,eDot,ee,efDot,Efr,efr,eg,Egrave,egrave,egs,egsdot,el,Element:Element$1,elinters,ell,els,elsdot,Emacr,emacr,empty,emptyset,EmptySmallSquare,emptyv,EmptyVerySmallSquare,emsp13,emsp14,emsp,ENG,eng,ensp,Eogon,eogon,Eopf,eopf,epar,eparsl,eplus,epsi,Epsilon,epsilon,epsiv,eqcirc,eqcolon,eqsim,eqslantgtr,eqslantless,Equal,equals,EqualTilde,equest,Equilibrium,equiv,equivDD,eqvparsl,erarr,erDot,escr,Escr,esdot,Esim,esim,Eta,eta,ETH,eth,Euml,euml,euro,excl,exist,Exists,expectation,exponentiale,ExponentialE,fallingdotseq,Fcy,fcy,female,ffilig,fflig,ffllig,Ffr,ffr,filig,FilledSmallSquare,FilledVerySmallSquare,fjlig,flat,fllig,fltns,fnof,Fopf,fopf,forall,ForAll,fork,forkv,Fouriertrf,fpartint,frac12,frac13,frac14,frac15,frac16,frac18,frac23,frac25,frac34,frac35,frac38,frac45,frac56,frac58,frac78,frasl,frown,fscr,Fscr,gacute,Gamma,gamma,Gammad,gammad,gap,Gbreve,gbreve,Gcedil,Gcirc,gcirc,Gcy,gcy,Gdot,gdot,ge,gE,gEl,gel,geq,geqq,geqslant,gescc,ges,gesdot,gesdoto,gesdotol,gesl,gesles,Gfr,gfr,gg,Gg,ggg,gimel,GJcy,gjcy,gla,gl,glE,glj,gnap,gnapprox,gne,gnE,gneq,gneqq,gnsim,Gopf,gopf,grave,GreaterEqual,GreaterEqualLess,GreaterFullEqual,GreaterGreater,GreaterLess,GreaterSlantEqual,GreaterTilde,Gscr,gscr,gsim,gsime,gsiml,gtcc,gtcir,gt,GT,Gt,gtdot,gtlPar,gtquest,gtrapprox,gtrarr,gtrdot,gtreqless,gtreqqless,gtrless,gtrsim,gvertneqq,gvnE,Hacek,hairsp,half,hamilt,HARDcy,hardcy,harrcir,harr,hArr,harrw,Hat,hbar,Hcirc,hcirc,hearts,heartsuit,hellip,hercon,hfr,Hfr,HilbertSpace,hksearow,hkswarow,hoarr,homtht,hookleftarrow,hookrightarrow,hopf,Hopf,horbar,HorizontalLine,hscr,Hscr,hslash,Hstrok,hstrok,HumpDownHump,HumpEqual,hybull,hyphen,Iacute,iacute,ic,Icirc,icirc,Icy,icy,Idot,IEcy,iecy,iexcl,iff,ifr,Ifr,Igrave,igrave,ii,iiiint,iiint,iinfin,iiota,IJlig,ijlig,Imacr,imacr,image:image$1,ImaginaryI,imagline,imagpart,imath,Im,imof,imped,Implies,incare,in:"∈",infin,infintie,inodot,intcal,int,Int,integers,Integral,intercal,Intersection,intlarhk,intprod,InvisibleComma,InvisibleTimes,IOcy,iocy,Iogon,iogon,Iopf,iopf,Iota,iota,iprod,iquest,iscr,Iscr,isin,isindot,isinE,isins,isinsv,isinv,it,Itilde,itilde,Iukcy,iukcy,Iuml,iuml,Jcirc,jcirc,Jcy,jcy,Jfr,jfr,jmath,Jopf,jopf,Jscr,jscr,Jsercy,jsercy,Jukcy,jukcy,Kappa,kappa,kappav,Kcedil,kcedil,Kcy,kcy,Kfr,kfr,kgreen,KHcy,khcy,KJcy,kjcy,Kopf,kopf,Kscr,kscr,lAarr,Lacute,lacute,laemptyv,lagran,Lambda,lambda,lang,Lang,langd,langle,lap,Laplacetrf,laquo,larrb,larrbfs,larr,Larr,lArr,larrfs,larrhk,larrlp,larrpl,larrsim,larrtl,latail,lAtail,lat,late,lates,lbarr,lBarr,lbbrk,lbrace,lbrack,lbrke,lbrksld,lbrkslu,Lcaron,lcaron,Lcedil,lcedil,lceil,lcub,Lcy,lcy,ldca,ldquo,ldquor,ldrdhar,ldrushar,ldsh,le,lE,LeftAngleBracket,LeftArrowBar,leftarrow,LeftArrow,Leftarrow,LeftArrowRightArrow,leftarrowtail,LeftCeiling,LeftDoubleBracket,LeftDownTeeVector,LeftDownVectorBar,LeftDownVector,LeftFloor,leftharpoondown,leftharpoonup,leftleftarrows,leftrightarrow,LeftRightArrow,Leftrightarrow,leftrightarrows,leftrightharpoons,leftrightsquigarrow,LeftRightVector,LeftTeeArrow,LeftTee,LeftTeeVector,leftthreetimes,LeftTriangleBar,LeftTriangle,LeftTriangleEqual,LeftUpDownVector,LeftUpTeeVector,LeftUpVectorBar,LeftUpVector,LeftVectorBar,LeftVector,lEg,leg,leq,leqq,leqslant,lescc,les,lesdot,lesdoto,lesdotor,lesg,lesges,lessapprox,lessdot,lesseqgtr,lesseqqgtr,LessEqualGreater,LessFullEqual,LessGreater,lessgtr,LessLess,lesssim,LessSlantEqual,LessTilde,lfisht,lfloor,Lfr,lfr,lg,lgE,lHar,lhard,lharu,lharul,lhblk,LJcy,ljcy,llarr,ll,Ll,llcorner,Lleftarrow,llhard,lltri,Lmidot,lmidot,lmoustache,lmoust,lnap,lnapprox,lne,lnE,lneq,lneqq,lnsim,loang,loarr,lobrk,longleftarrow,LongLeftArrow,Longleftarrow,longleftrightarrow,LongLeftRightArrow,Longleftrightarrow,longmapsto,longrightarrow,LongRightArrow,Longrightarrow,looparrowleft,looparrowright,lopar,Lopf,lopf,loplus,lotimes,lowast,lowbar,LowerLeftArrow,LowerRightArrow,loz,lozenge,lozf,lpar,lparlt,lrarr,lrcorner,lrhar,lrhard,lrm,lrtri,lsaquo,lscr,Lscr,lsh,Lsh,lsim,lsime,lsimg,lsqb,lsquo,lsquor,Lstrok,lstrok,ltcc,ltcir,lt,LT,Lt,ltdot,lthree,ltimes,ltlarr,ltquest,ltri,ltrie,ltrif,ltrPar,lurdshar,luruhar,lvertneqq,lvnE,macr,male,malt,maltese,Map:"⤅",map:map$1,mapsto,mapstodown,mapstoleft,mapstoup,marker,mcomma,Mcy,mcy,mdash,mDDot,measuredangle,MediumSpace,Mellintrf,Mfr,mfr,mho,micro,midast,midcir,mid,middot,minusb,minus,minusd,minusdu,MinusPlus,mlcp,mldr,mnplus,models,Mopf,mopf,mp,mscr,Mscr,mstpos,Mu,mu,multimap,mumap,nabla,Nacute,nacute,nang,nap,napE,napid,napos,napprox,natural,naturals,natur,nbsp,nbump,nbumpe,ncap,Ncaron,ncaron,Ncedil,ncedil,ncong,ncongdot,ncup,Ncy,ncy,ndash,nearhk,nearr,neArr,nearrow,ne,nedot,NegativeMediumSpace,NegativeThickSpace,NegativeThinSpace,NegativeVeryThinSpace,nequiv,nesear,nesim,NestedGreaterGreater,NestedLessLess,NewLine,nexist,nexists,Nfr,nfr,ngE,nge,ngeq,ngeqq,ngeqslant,nges,nGg,ngsim,nGt,ngt,ngtr,nGtv,nharr,nhArr,nhpar,ni,nis,nisd,niv,NJcy,njcy,nlarr,nlArr,nldr,nlE,nle,nleftarrow,nLeftarrow,nleftrightarrow,nLeftrightarrow,nleq,nleqq,nleqslant,nles,nless,nLl,nlsim,nLt,nlt,nltri,nltrie,nLtv,nmid,NoBreak,NonBreakingSpace,nopf,Nopf,Not,not,NotCongruent,NotCupCap,NotDoubleVerticalBar,NotElement,NotEqual,NotEqualTilde,NotExists,NotGreater,NotGreaterEqual,NotGreaterFullEqual,NotGreaterGreater,NotGreaterLess,NotGreaterSlantEqual,NotGreaterTilde,NotHumpDownHump,NotHumpEqual,notin,notindot,notinE,notinva,notinvb,notinvc,NotLeftTriangleBar,NotLeftTriangle,NotLeftTriangleEqual,NotLess,NotLessEqual,NotLessGreater,NotLessLess,NotLessSlantEqual,NotLessTilde,NotNestedGreaterGreater,NotNestedLessLess,notni,notniva,notnivb,notnivc,NotPrecedes,NotPrecedesEqual,NotPrecedesSlantEqual,NotReverseElement,NotRightTriangleBar,NotRightTriangle,NotRightTriangleEqual,NotSquareSubset,NotSquareSubsetEqual,NotSquareSuperset,NotSquareSupersetEqual,NotSubset,NotSubsetEqual,NotSucceeds,NotSucceedsEqual,NotSucceedsSlantEqual,NotSucceedsTilde,NotSuperset,NotSupersetEqual,NotTilde,NotTildeEqual,NotTildeFullEqual,NotTildeTilde,NotVerticalBar,nparallel,npar,nparsl,npart,npolint,npr,nprcue,nprec,npreceq,npre,nrarrc,nrarr,nrArr,nrarrw,nrightarrow,nRightarrow,nrtri,nrtrie,nsc,nsccue,nsce,Nscr,nscr,nshortmid,nshortparallel,nsim,nsime,nsimeq,nsmid,nspar,nsqsube,nsqsupe,nsub,nsubE,nsube,nsubset,nsubseteq,nsubseteqq,nsucc,nsucceq,nsup,nsupE,nsupe,nsupset,nsupseteq,nsupseteqq,ntgl,Ntilde,ntilde,ntlg,ntriangleleft,ntrianglelefteq,ntriangleright,ntrianglerighteq,Nu,nu,num,numero,numsp,nvap,nvdash,nvDash,nVdash,nVDash,nvge,nvgt,nvHarr,nvinfin,nvlArr,nvle,nvlt,nvltrie,nvrArr,nvrtrie,nvsim,nwarhk,nwarr,nwArr,nwarrow,nwnear,Oacute,oacute,oast,Ocirc,ocirc,ocir,Ocy,ocy,odash,Odblac,odblac,odiv,odot,odsold,OElig,oelig,ofcir,Ofr,ofr,ogon,Ograve,ograve,ogt,ohbar,ohm,oint,olarr,olcir,olcross,oline,olt,Omacr,omacr,Omega,omega,Omicron,omicron,omid,ominus,Oopf,oopf,opar,OpenCurlyDoubleQuote,OpenCurlyQuote,operp,oplus,orarr,Or,or,ord,order,orderof,ordf,ordm,origof,oror,orslope,orv,oS,Oscr,oscr,Oslash,oslash,osol,Otilde,otilde,otimesas,Otimes,otimes,Ouml,ouml,ovbar,OverBar,OverBrace,OverBracket,OverParenthesis,para,parallel,par,parsim,parsl,part,PartialD,Pcy,pcy,percnt,period,permil,perp,pertenk,Pfr,pfr,Phi,phi,phiv,phmmat,phone,Pi,pi,pitchfork,piv,planck,planckh,plankv,plusacir,plusb,pluscir,plus,plusdo,plusdu,pluse,PlusMinus,plusmn,plussim,plustwo,pm,Poincareplane,pointint,popf,Popf,pound,prap,Pr,pr,prcue,precapprox,prec,preccurlyeq,Precedes,PrecedesEqual,PrecedesSlantEqual,PrecedesTilde,preceq,precnapprox,precneqq,precnsim,pre,prE,precsim,prime,Prime,primes,prnap,prnE,prnsim,prod,Product,profalar,profline,profsurf,prop,Proportional,Proportion,propto,prsim,prurel,Pscr,pscr,Psi,psi,puncsp,Qfr,qfr,qint,qopf,Qopf,qprime,Qscr,qscr,quaternions,quatint,quest,questeq,quot,QUOT,rAarr,race,Racute,racute,radic,raemptyv,rang,Rang,rangd,range,rangle,raquo,rarrap,rarrb,rarrbfs,rarrc,rarr,Rarr,rArr,rarrfs,rarrhk,rarrlp,rarrpl,rarrsim,Rarrtl,rarrtl,rarrw,ratail,rAtail,ratio,rationals,rbarr,rBarr,RBarr,rbbrk,rbrace,rbrack,rbrke,rbrksld,rbrkslu,Rcaron,rcaron,Rcedil,rcedil,rceil,rcub,Rcy,rcy,rdca,rdldhar,rdquo,rdquor,rdsh,real,realine,realpart,reals,Re,rect,reg,REG,ReverseElement,ReverseEquilibrium,ReverseUpEquilibrium,rfisht,rfloor,rfr,Rfr,rHar,rhard,rharu,rharul,Rho,rho,rhov,RightAngleBracket,RightArrowBar,rightarrow,RightArrow,Rightarrow,RightArrowLeftArrow,rightarrowtail,RightCeiling,RightDoubleBracket,RightDownTeeVector,RightDownVectorBar,RightDownVector,RightFloor,rightharpoondown,rightharpoonup,rightleftarrows,rightleftharpoons,rightrightarrows,rightsquigarrow,RightTeeArrow,RightTee,RightTeeVector,rightthreetimes,RightTriangleBar,RightTriangle,RightTriangleEqual,RightUpDownVector,RightUpTeeVector,RightUpVectorBar,RightUpVector,RightVectorBar,RightVector,ring,risingdotseq,rlarr,rlhar,rlm,rmoustache,rmoust,rnmid,roang,roarr,robrk,ropar,ropf,Ropf,roplus,rotimes,RoundImplies,rpar,rpargt,rppolint,rrarr,Rrightarrow,rsaquo,rscr,Rscr,rsh,Rsh,rsqb,rsquo,rsquor,rthree,rtimes,rtri,rtrie,rtrif,rtriltri,RuleDelayed,ruluhar,rx,Sacute,sacute,sbquo,scap,Scaron,scaron,Sc,sc,sccue,sce,scE,Scedil,scedil,Scirc,scirc,scnap,scnE,scnsim,scpolint,scsim,Scy,scy,sdotb,sdot,sdote,searhk,searr,seArr,searrow,sect,semi,seswar,setminus,setmn,sext,Sfr,sfr,sfrown,sharp,SHCHcy,shchcy,SHcy,shcy,ShortDownArrow,ShortLeftArrow,shortmid,shortparallel,ShortRightArrow,ShortUpArrow,shy,Sigma,sigma,sigmaf,sigmav,sim,simdot,sime,simeq,simg,simgE,siml,simlE,simne,simplus,simrarr,slarr,SmallCircle,smallsetminus,smashp,smeparsl,smid,smile,smt,smte,smtes,SOFTcy,softcy,solbar,solb,sol,Sopf,sopf,spades,spadesuit,spar,sqcap,sqcaps,sqcup,sqcups,Sqrt,sqsub,sqsube,sqsubset,sqsubseteq,sqsup,sqsupe,sqsupset,sqsupseteq,square,Square,SquareIntersection,SquareSubset,SquareSubsetEqual,SquareSuperset,SquareSupersetEqual,SquareUnion,squarf,squ,squf,srarr,Sscr,sscr,ssetmn,ssmile,sstarf,Star,star,starf,straightepsilon,straightphi,strns,sub,Sub,subdot,subE,sube,subedot,submult,subnE,subne,subplus,subrarr,subset,Subset,subseteq,subseteqq,SubsetEqual,subsetneq,subsetneqq,subsim,subsub,subsup,succapprox,succ,succcurlyeq,Succeeds,SucceedsEqual,SucceedsSlantEqual,SucceedsTilde,succeq,succnapprox,succneqq,succnsim,succsim,SuchThat,sum,Sum,sung,sup1,sup2,sup3,sup,Sup,supdot,supdsub,supE,supe,supedot,Superset,SupersetEqual,suphsol,suphsub,suplarr,supmult,supnE,supne,supplus,supset,Supset,supseteq,supseteqq,supsetneq,supsetneqq,supsim,supsub,supsup,swarhk,swarr,swArr,swarrow,swnwar,szlig,Tab,target,Tau,tau,tbrk,Tcaron,tcaron,Tcedil,tcedil,Tcy,tcy,tdot,telrec,Tfr,tfr,there4,therefore,Therefore,Theta,theta,thetasym,thetav,thickapprox,thicksim,ThickSpace,ThinSpace,thinsp,thkap,thksim,THORN,thorn,tilde,Tilde,TildeEqual,TildeFullEqual,TildeTilde,timesbar,timesb,times,timesd,tint,toea,topbot,topcir,top,Topf,topf,topfork,tosa,tprime,trade,TRADE,triangle,triangledown,triangleleft,trianglelefteq,triangleq,triangleright,trianglerighteq,tridot,trie,triminus,TripleDot,triplus,trisb,tritime,trpezium,Tscr,tscr,TScy,tscy,TSHcy,tshcy,Tstrok,tstrok,twixt,twoheadleftarrow,twoheadrightarrow,Uacute,uacute,uarr,Uarr,uArr,Uarrocir,Ubrcy,ubrcy,Ubreve,ubreve,Ucirc,ucirc,Ucy,ucy,udarr,Udblac,udblac,udhar,ufisht,Ufr,ufr,Ugrave,ugrave,uHar,uharl,uharr,uhblk,ulcorn,ulcorner,ulcrop,ultri,Umacr,umacr,uml,UnderBar,UnderBrace,UnderBracket,UnderParenthesis,Union,UnionPlus,Uogon,uogon,Uopf,uopf,UpArrowBar,uparrow,UpArrow,Uparrow,UpArrowDownArrow,updownarrow,UpDownArrow,Updownarrow,UpEquilibrium,upharpoonleft,upharpoonright,uplus,UpperLeftArrow,UpperRightArrow,upsi,Upsi,upsih,Upsilon,upsilon,UpTeeArrow,UpTee,upuparrows,urcorn,urcorner,urcrop,Uring,uring,urtri,Uscr,uscr,utdot,Utilde,utilde,utri,utrif,uuarr,Uuml,uuml,uwangle,vangrt,varepsilon,varkappa,varnothing,varphi,varpi,varpropto,varr,vArr,varrho,varsigma,varsubsetneq,varsubsetneqq,varsupsetneq,varsupsetneqq,vartheta,vartriangleleft,vartriangleright,vBar,Vbar,vBarv,Vcy,vcy,vdash,vDash,Vdash,VDash,Vdashl,veebar,vee,Vee,veeeq,vellip,verbar,Verbar,vert,Vert,VerticalBar,VerticalLine,VerticalSeparator,VerticalTilde,VeryThinSpace,Vfr,vfr,vltri,vnsub,vnsup,Vopf,vopf,vprop,vrtri,Vscr,vscr,vsubnE,vsubne,vsupnE,vsupne,Vvdash,vzigzag,Wcirc,wcirc,wedbar,wedge,Wedge,wedgeq,weierp,Wfr,wfr,Wopf,wopf,wp,wr,wreath,Wscr,wscr,xcap,xcirc,xcup,xdtri,Xfr,xfr,xharr,xhArr,Xi,xi,xlarr,xlArr,xmap,xnis,xodot,Xopf,xopf,xoplus,xotime,xrarr,xrArr,Xscr,xscr,xsqcup,xuplus,xutri,xvee,xwedge,Yacute,yacute,YAcy,yacy,Ycirc,ycirc,Ycy,ycy,yen,Yfr,yfr,YIcy,yicy,Yopf,yopf,Yscr,yscr,YUcy,yucy,yuml,Yuml,Zacute,zacute,Zcaron,zcaron,Zcy,zcy,Zdot,zdot,zeetrf,ZeroWidthSpace,Zeta,zeta,zfr,Zfr,ZHcy,zhcy,zigrarr,zopf,Zopf,Zscr,zscr,zwj,zwnj};var entities$1=require$$0,regex$4=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,mdurl$1={},encodeCache={};function getEncodeCache(Tr){var Cr,$r,Ar=encodeCache[Tr];if(Ar)return Ar;for(Ar=encodeCache[Tr]=[],Cr=0;Cr<128;Cr++)$r=String.fromCharCode(Cr),/^[0-9a-z]$/i.test($r)?Ar.push($r):Ar.push("%"+("0"+Cr.toString(16).toUpperCase()).slice(-2));for(Cr=0;Cr"u"&&($r=!0),Br=getEncodeCache(Cr),Ar=0,Rr=Tr.length;Ar=55296&&Dr<=57343){if(Dr>=55296&&Dr<=56319&&Ar+1=56320&&Mr<=57343)){Nr+=encodeURIComponent(Tr[Ar]+Tr[Ar+1]),Ar++;continue}Nr+="%EF%BF%BD";continue}Nr+=encodeURIComponent(Tr[Ar])}return Nr}encode$1.defaultChars=";/?:@&=+$,-_.!~*'()#";encode$1.componentChars="-_.!~*'()";var encode_1=encode$1,decodeCache={};function getDecodeCache(Tr){var Cr,$r,Ar=decodeCache[Tr];if(Ar)return Ar;for(Ar=decodeCache[Tr]=[],Cr=0;Cr<128;Cr++)$r=String.fromCharCode(Cr),Ar.push($r);for(Cr=0;Cr=55296&&Hr<=57343?zr+="���":zr+=String.fromCharCode(Hr),Rr+=6;continue}if((Mr&248)===240&&Rr+91114111?zr+="����":(Hr-=65536,zr+=String.fromCharCode(55296+(Hr>>10),56320+(Hr&1023))),Rr+=9;continue}zr+="�"}return zr})}decode$1.defaultChars=";/?:@&=+$,#";decode$1.componentChars="";var decode_1=decode$1,format=function(Cr){var $r="";return $r+=Cr.protocol||"",$r+=Cr.slashes?"//":"",$r+=Cr.auth?Cr.auth+"@":"",Cr.hostname&&Cr.hostname.indexOf(":")!==-1?$r+="["+Cr.hostname+"]":$r+=Cr.hostname||"",$r+=Cr.port?":"+Cr.port:"",$r+=Cr.pathname||"",$r+=Cr.search||"",$r+=Cr.hash||"",$r};function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r",` `," "],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function urlParse(Tr,Cr){if(Tr&&Tr instanceof Url)return Tr;var $r=new Url;return $r.parse(Tr,Cr),$r}Url.prototype.parse=function(Tr,Cr){var $r,Ar,Rr,Dr,Mr,Br=Tr;if(Br=Br.trim(),!Cr&&Tr.split("#").length===1){var Nr=simplePathPattern.exec(Br);if(Nr)return this.pathname=Nr[1],Nr[2]&&(this.search=Nr[2]),this}var Lr=protocolPattern.exec(Br);if(Lr&&(Lr=Lr[0],Rr=Lr.toLowerCase(),this.protocol=Lr,Br=Br.substr(Lr.length)),(Cr||Lr||Br.match(/^\/\/[^@\/]+@[^@\/]+/))&&(Mr=Br.substr(0,2)==="//",Mr&&!(Lr&&hostlessProtocol[Lr])&&(Br=Br.substr(2),this.slashes=!0)),!hostlessProtocol[Lr]&&(Mr||Lr&&!slashedProtocol[Lr])){var Hr=-1;for($r=0;$r127?Kr+="x":Kr+=Xr[Zr];if(!Kr.match(hostnamePartPattern)){var Wr=Gr.slice(0,$r),Yr=Gr.slice($r+1),Jr=Xr.match(hostnamePartStart);Jr&&(Wr.push(Jr[1]),Yr.unshift(Jr[2])),Yr.length&&(Br=Yr.join(".")+Br),this.hostname=Wr.join(".");break}}}}this.hostname.length>hostnameMaxLen&&(this.hostname=""),jr&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var no=Br.indexOf("#");no!==-1&&(this.hash=Br.substr(no),Br=Br.slice(0,no));var ro=Br.indexOf("?");return ro!==-1&&(this.search=Br.substr(ro),Br=Br.slice(0,ro)),Br&&(this.pathname=Br),slashedProtocol[Rr]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Url.prototype.parseHost=function(Tr){var Cr=portPattern.exec(Tr);Cr&&(Cr=Cr[0],Cr!==":"&&(this.port=Cr.substr(1)),Tr=Tr.substr(0,Tr.length-Cr.length)),Tr&&(this.hostname=Tr)};var parse=urlParse;mdurl$1.encode=encode_1;mdurl$1.decode=decode_1;mdurl$1.format=format;mdurl$1.parse=parse;var uc_micro={},regex$3,hasRequiredRegex$3;function requireRegex$3(){return hasRequiredRegex$3||(hasRequiredRegex$3=1,regex$3=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),regex$3}var regex$2,hasRequiredRegex$2;function requireRegex$2(){return hasRequiredRegex$2||(hasRequiredRegex$2=1,regex$2=/[\0-\x1F\x7F-\x9F]/),regex$2}var regex$1,hasRequiredRegex$1;function requireRegex$1(){return hasRequiredRegex$1||(hasRequiredRegex$1=1,regex$1=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/),regex$1}var regex,hasRequiredRegex;function requireRegex(){return hasRequiredRegex||(hasRequiredRegex=1,regex=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),regex}var hasRequiredUc_micro;function requireUc_micro(){return hasRequiredUc_micro||(hasRequiredUc_micro=1,uc_micro.Any=requireRegex$3(),uc_micro.Cc=requireRegex$2(),uc_micro.Cf=requireRegex$1(),uc_micro.P=regex$4,uc_micro.Z=requireRegex()),uc_micro}(function(Tr){function Cr(co){return Object.prototype.toString.call(co)}function $r(co){return Cr(co)==="[object String]"}var Ar=Object.prototype.hasOwnProperty;function Rr(co,mo){return Ar.call(co,mo)}function Dr(co){var mo=Array.prototype.slice.call(arguments,1);return mo.forEach(function(io){if(io){if(typeof io!="object")throw new TypeError(io+"must be object");Object.keys(io).forEach(function(uo){co[uo]=io[uo]})}}),co}function Mr(co,mo,io){return[].concat(co.slice(0,mo),io,co.slice(mo+1))}function Br(co){return!(co>=55296&&co<=57343||co>=64976&&co<=65007||(co&65535)===65535||(co&65535)===65534||co>=0&&co<=8||co===11||co>=14&&co<=31||co>=127&&co<=159||co>1114111)}function Nr(co){if(co>65535){co-=65536;var mo=55296+(co>>10),io=56320+(co&1023);return String.fromCharCode(mo,io)}return String.fromCharCode(co)}var Lr=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,Hr=/&([a-z#][a-z0-9]{1,31});/gi,zr=new RegExp(Lr.source+"|"+Hr.source,"gi"),Ur=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i,Vr=entities$1;function jr(co,mo){var io;return Rr(Vr,mo)?Vr[mo]:mo.charCodeAt(0)===35&&Ur.test(mo)&&(io=mo[1].toLowerCase()==="x"?parseInt(mo.slice(2),16):parseInt(mo.slice(1),10),Br(io))?Nr(io):co}function Gr(co){return co.indexOf("\\")<0?co:co.replace(Lr,"$1")}function Xr(co){return co.indexOf("\\")<0&&co.indexOf("&")<0?co:co.replace(zr,function(mo,io,uo){return io||jr(mo,uo)})}var Kr=/[&<>"]/,Zr=/[&<>"]/g,eo={"&":"&","<":"<",">":">",'"':"""};function Wr(co){return eo[co]}function Yr(co){return Kr.test(co)?co.replace(Zr,Wr):co}var Jr=/[.?*+^$[\]\\(){}|-]/g;function no(co){return co.replace(Jr,"\\$&")}function ro(co){switch(co){case 9:case 32:return!0}return!1}function so(co){if(co>=8192&&co<=8202)return!0;switch(co){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}var ao=regex$4;function lo(co){return ao.test(co)}function po(co){switch(co){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function go(co){return co=co.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(co=co.replace(/ẞ/g,"ß")),co.toLowerCase().toUpperCase()}Tr.lib={},Tr.lib.mdurl=mdurl$1,Tr.lib.ucmicro=requireUc_micro(),Tr.assign=Dr,Tr.isString=$r,Tr.has=Rr,Tr.unescapeMd=Gr,Tr.unescapeAll=Xr,Tr.isValidEntityCode=Br,Tr.fromCodePoint=Nr,Tr.escapeHtml=Yr,Tr.arrayReplaceAt=Mr,Tr.isSpace=ro,Tr.isWhiteSpace=so,Tr.isMdAsciiPunct=po,Tr.isPunctChar=lo,Tr.escapeRE=no,Tr.normalizeReference=go})(utils$1);var helpers$1={},parse_link_label=function(Cr,$r,Ar){var Rr,Dr,Mr,Br,Nr=-1,Lr=Cr.posMax,Hr=Cr.pos;for(Cr.pos=$r+1,Rr=1;Cr.pos32))return Br;if(Rr===41){if(Dr===0)break;Dr--}Mr++}return $r===Mr||Dr!==0||(Br.str=unescapeAll$2(Cr.slice($r,Mr)),Br.pos=Mr,Br.ok=!0),Br},unescapeAll$1=utils$1.unescapeAll,parse_link_title=function(Cr,$r,Ar){var Rr,Dr,Mr=0,Br=$r,Nr={ok:!1,pos:0,lines:0,str:""};if(Br>=Ar||(Dr=Cr.charCodeAt(Br),Dr!==34&&Dr!==39&&Dr!==40))return Nr;for(Br++,Dr===40&&(Dr=41);Br"+escapeHtml(Dr.content)+""};default_rules.code_block=function(Tr,Cr,$r,Ar,Rr){var Dr=Tr[Cr];return""+escapeHtml(Tr[Cr].content)+` `};default_rules.fence=function(Tr,Cr,$r,Ar,Rr){var Dr=Tr[Cr],Mr=Dr.info?unescapeAll(Dr.info).trim():"",Br="",Nr="",Lr,Hr,zr,Ur,Vr;return Mr&&(zr=Mr.split(/(\s+)/g),Br=zr[0],Nr=zr.slice(2).join("")),$r.highlight?Lr=$r.highlight(Dr.content,Br,Nr)||escapeHtml(Dr.content):Lr=escapeHtml(Dr.content),Lr.indexOf(""+Lr+` `):"
"+Lr+`
`};default_rules.image=function(Tr,Cr,$r,Ar,Rr){var Dr=Tr[Cr];return Dr.attrs[Dr.attrIndex("alt")][1]=Rr.renderInlineAsText(Dr.children,$r,Ar),Rr.renderToken(Tr,Cr,$r)};default_rules.hardbreak=function(Tr,Cr,$r){return $r.xhtmlOut?`
`:`
`};default_rules.softbreak=function(Tr,Cr,$r){return $r.breaks?$r.xhtmlOut?`
`:`
`:` `};default_rules.text=function(Tr,Cr){return escapeHtml(Tr[Cr].content)};default_rules.html_block=function(Tr,Cr){return Tr[Cr].content};default_rules.html_inline=function(Tr,Cr){return Tr[Cr].content};function Renderer$1(){this.rules=assign$1({},default_rules)}Renderer$1.prototype.renderAttrs=function(Cr){var $r,Ar,Rr;if(!Cr.attrs)return"";for(Rr="",$r=0,Ar=Cr.attrs.length;$r `:">",Dr)};Renderer$1.prototype.renderInline=function(Tr,Cr,$r){for(var Ar,Rr="",Dr=this.rules,Mr=0,Br=Tr.length;Mr\s]/i.test(Tr)}function isLinkClose$1(Tr){return/^<\/a\s*>/i.test(Tr)}var linkify$1=function(Cr){var $r,Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr,zr,Ur,Vr,jr,Gr,Xr,Kr,Zr=Cr.tokens,eo;if(Cr.md.options.linkify){for(Ar=0,Rr=Zr.length;Ar=0;$r--){if(Br=Dr[$r],Br.type==="link_close"){for($r--;Dr[$r].level!==Br.level&&Dr[$r].type!=="link_open";)$r--;continue}if(Br.type==="html_inline"&&(isLinkOpen$1(Br.content)&&jr>0&&jr--,isLinkClose$1(Br.content)&&jr++),!(jr>0)&&Br.type==="text"&&Cr.md.linkify.test(Br.content)){for(Hr=Br.content,eo=Cr.md.linkify.match(Hr),Nr=[],Vr=Br.level,Ur=0,eo.length>0&&eo[0].index===0&&$r>0&&Dr[$r-1].type==="text_special"&&(eo=eo.slice(1)),Lr=0;LrUr&&(Mr=new Cr.Token("text","",0),Mr.content=Hr.slice(Ur,zr),Mr.level=Vr,Nr.push(Mr)),Mr=new Cr.Token("link_open","a",1),Mr.attrs=[["href",Xr]],Mr.level=Vr++,Mr.markup="linkify",Mr.info="auto",Nr.push(Mr),Mr=new Cr.Token("text","",0),Mr.content=Kr,Mr.level=Vr,Nr.push(Mr),Mr=new Cr.Token("link_close","a",-1),Mr.level=--Vr,Mr.markup="linkify",Mr.info="auto",Nr.push(Mr),Ur=eo[Lr].lastIndex);Ur=0;Cr--)$r=Tr[Cr],$r.type==="text"&&!Ar&&($r.content=$r.content.replace(SCOPED_ABBR_RE,replaceFn)),$r.type==="link_open"&&$r.info==="auto"&&Ar--,$r.type==="link_close"&&$r.info==="auto"&&Ar++}function replace_rare(Tr){var Cr,$r,Ar=0;for(Cr=Tr.length-1;Cr>=0;Cr--)$r=Tr[Cr],$r.type==="text"&&!Ar&&RARE_RE.test($r.content)&&($r.content=$r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),$r.type==="link_open"&&$r.info==="auto"&&Ar--,$r.type==="link_close"&&$r.info==="auto"&&Ar++}var replacements=function(Cr){var $r;if(Cr.md.options.typographer)for($r=Cr.tokens.length-1;$r>=0;$r--)Cr.tokens[$r].type==="inline"&&(SCOPED_ABBR_TEST_RE.test(Cr.tokens[$r].content)&&replace_scoped(Cr.tokens[$r].children),RARE_RE.test(Cr.tokens[$r].content)&&replace_rare(Cr.tokens[$r].children))},isWhiteSpace$1=utils$1.isWhiteSpace,isPunctChar$1=utils$1.isPunctChar,isMdAsciiPunct$1=utils$1.isMdAsciiPunct,QUOTE_TEST_RE=/['"]/,QUOTE_RE=/['"]/g,APOSTROPHE="’";function replaceAt(Tr,Cr,$r){return Tr.slice(0,Cr)+$r+Tr.slice(Cr+1)}function process_inlines(Tr,Cr){var $r,Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr,zr,Ur,Vr,jr,Gr,Xr,Kr,Zr,eo,Wr,Yr,Jr;for(Wr=[],$r=0;$r=0&&!(Wr[Zr].level<=Nr);Zr--);if(Wr.length=Zr+1,Ar.type==="text"){Rr=Ar.content,Mr=0,Br=Rr.length;e:for(;Mr=0)Hr=Rr.charCodeAt(Dr.index-1);else for(Zr=$r-1;Zr>=0&&!(Tr[Zr].type==="softbreak"||Tr[Zr].type==="hardbreak");Zr--)if(Tr[Zr].content){Hr=Tr[Zr].content.charCodeAt(Tr[Zr].content.length-1);break}if(zr=32,Mr=48&&Hr<=57&&(Kr=Xr=!1),Xr&&Kr&&(Xr=Ur,Kr=Vr),!Xr&&!Kr){eo&&(Ar.content=replaceAt(Ar.content,Dr.index,APOSTROPHE));continue}if(Kr){for(Zr=Wr.length-1;Zr>=0&&(Lr=Wr[Zr],!(Wr[Zr].level=0;$r--)Cr.tokens[$r].type!=="inline"||!QUOTE_TEST_RE.test(Cr.tokens[$r].content)||process_inlines(Cr.tokens[$r].children,Cr)},text_join=function(Cr){var $r,Ar,Rr,Dr,Mr,Br,Nr=Cr.tokens;for($r=0,Ar=Nr.length;$r=0&&(Ar=this.attrs[$r][1]),Ar};Token$3.prototype.attrJoin=function(Cr,$r){var Ar=this.attrIndex(Cr);Ar<0?this.attrPush([Cr,$r]):this.attrs[Ar][1]=this.attrs[Ar][1]+" "+$r};var token=Token$3,Token$2=token;function StateCore(Tr,Cr,$r){this.src=Tr,this.env=$r,this.tokens=[],this.inlineMode=!1,this.md=Cr}StateCore.prototype.Token=Token$2;var state_core=StateCore,Ruler$2=ruler,_rules$2=[["normalize",normalize],["block",block],["inline",inline],["linkify",linkify$1],["replacements",replacements],["smartquotes",smartquotes],["text_join",text_join]];function Core(){this.ruler=new Ruler$2;for(var Tr=0;Tr<_rules$2.length;Tr++)this.ruler.push(_rules$2[Tr][0],_rules$2[Tr][1])}Core.prototype.process=function(Tr){var Cr,$r,Ar;for(Ar=this.ruler.getRules(""),Cr=0,$r=Ar.length;Cr<$r;Cr++)Ar[Cr](Tr)};Core.prototype.State=state_core;var parser_core=Core,isSpace$a=utils$1.isSpace;function getLine(Tr,Cr){var $r=Tr.bMarks[Cr]+Tr.tShift[Cr],Ar=Tr.eMarks[Cr];return Tr.src.slice($r,Ar)}function escapedSplit(Tr){var Cr=[],$r=0,Ar=Tr.length,Rr,Dr=!1,Mr=0,Br="";for(Rr=Tr.charCodeAt($r);$rAr||(Hr=$r+1,Cr.sCount[Hr]=4||(Br=Cr.bMarks[Hr]+Cr.tShift[Hr],Br>=Cr.eMarks[Hr])||(Yr=Cr.src.charCodeAt(Br++),Yr!==124&&Yr!==45&&Yr!==58)||Br>=Cr.eMarks[Hr]||(Jr=Cr.src.charCodeAt(Br++),Jr!==124&&Jr!==45&&Jr!==58&&!isSpace$a(Jr))||Yr===45&&isSpace$a(Jr))return!1;for(;Br=4||(zr=escapedSplit(Mr),zr.length&&zr[0]===""&&zr.shift(),zr.length&&zr[zr.length-1]===""&&zr.pop(),Ur=zr.length,Ur===0||Ur!==jr.length))return!1;if(Rr)return!0;for(Zr=Cr.parentType,Cr.parentType="table",Wr=Cr.md.block.ruler.getRules("blockquote"),Vr=Cr.push("table_open","table",1),Vr.map=Xr=[$r,0],Vr=Cr.push("thead_open","thead",1),Vr.map=[$r,$r+1],Vr=Cr.push("tr_open","tr",1),Vr.map=[$r,$r+1],Nr=0;Nr=4)break;for(zr=escapedSplit(Mr),zr.length&&zr[0]===""&&zr.shift(),zr.length&&zr[zr.length-1]===""&&zr.pop(),Hr===$r+2&&(Vr=Cr.push("tbody_open","tbody",1),Vr.map=Kr=[$r+2,0]),Vr=Cr.push("tr_open","tr",1),Vr.map=[Hr,Hr+1],Nr=0;Nr=4){Rr++,Dr=Rr;continue}break}return Cr.line=Dr,Mr=Cr.push("code_block","code",0),Mr.content=Cr.getLines($r,Dr,4+Cr.blkIndent,!1)+` `,Mr.map=[$r,Cr.line],!0},fence=function(Cr,$r,Ar,Rr){var Dr,Mr,Br,Nr,Lr,Hr,zr,Ur=!1,Vr=Cr.bMarks[$r]+Cr.tShift[$r],jr=Cr.eMarks[$r];if(Cr.sCount[$r]-Cr.blkIndent>=4||Vr+3>jr||(Dr=Cr.src.charCodeAt(Vr),Dr!==126&&Dr!==96)||(Lr=Vr,Vr=Cr.skipChars(Vr,Dr),Mr=Vr-Lr,Mr<3)||(zr=Cr.src.slice(Lr,Vr),Br=Cr.src.slice(Vr,jr),Dr===96&&Br.indexOf(String.fromCharCode(Dr))>=0))return!1;if(Rr)return!0;for(Nr=$r;Nr++,!(Nr>=Ar||(Vr=Lr=Cr.bMarks[Nr]+Cr.tShift[Nr],jr=Cr.eMarks[Nr],Vr=4)&&(Vr=Cr.skipChars(Vr,Dr),!(Vr-Lr=4||Cr.src.charCodeAt(ao)!==62)return!1;if(Rr)return!0;for(jr=[],Gr=[],Zr=[],eo=[],Jr=Cr.md.block.ruler.getRules("blockquote"),Kr=Cr.parentType,Cr.parentType="blockquote",Ur=$r;Ur=lo));Ur++){if(Cr.src.charCodeAt(ao++)===62&&!ro){for(Nr=Cr.sCount[Ur]+1,Cr.src.charCodeAt(ao)===32?(ao++,Nr++,Dr=!1,Wr=!0):Cr.src.charCodeAt(ao)===9?(Wr=!0,(Cr.bsCount[Ur]+Nr)%4===3?(ao++,Nr++,Dr=!1):Dr=!0):Wr=!1,Vr=Nr,jr.push(Cr.bMarks[Ur]),Cr.bMarks[Ur]=ao;ao=lo,Gr.push(Cr.bsCount[Ur]),Cr.bsCount[Ur]=Cr.sCount[Ur]+1+(Wr?1:0),Zr.push(Cr.sCount[Ur]),Cr.sCount[Ur]=Vr-Nr,eo.push(Cr.tShift[Ur]),Cr.tShift[Ur]=ao-Cr.bMarks[Ur];continue}if(Hr)break;for(Yr=!1,Br=0,Lr=Jr.length;Br",no.map=zr=[$r,0],Cr.md.block.tokenize(Cr,$r,Ur),no=Cr.push("blockquote_close","blockquote",-1),no.markup=">",Cr.lineMax=so,Cr.parentType=Kr,zr[1]=Cr.line,Br=0;Br=4||(Dr=Cr.src.charCodeAt(Lr++),Dr!==42&&Dr!==45&&Dr!==95))return!1;for(Mr=1;Lr=Dr||($r=Tr.src.charCodeAt(Rr++),$r<48||$r>57))return-1;for(;;){if(Rr>=Dr)return-1;if($r=Tr.src.charCodeAt(Rr++),$r>=48&&$r<=57){if(Rr-Ar>=10)return-1;continue}if($r===41||$r===46)break;return-1}return Rr=4||Cr.listIndent>=0&&Cr.sCount[io]-Cr.listIndent>=4&&Cr.sCount[io]=Cr.blkIndent&&(uo=!0),(ao=skipOrderedListMarker(Cr,io))>=0){if(zr=!0,po=Cr.bMarks[io]+Cr.tShift[io],Kr=Number(Cr.src.slice(po,ao-1)),uo&&Kr!==1)return!1}else if((ao=skipBulletListMarker(Cr,io))>=0)zr=!1;else return!1;if(uo&&Cr.skipSpaces(ao)>=Cr.eMarks[io])return!1;if(Rr)return!0;for(Xr=Cr.src.charCodeAt(ao-1),Gr=Cr.tokens.length,zr?(mo=Cr.push("ordered_list_open","ol",1),Kr!==1&&(mo.attrs=[["start",Kr]])):mo=Cr.push("bullet_list_open","ul",1),mo.map=jr=[io,0],mo.markup=String.fromCharCode(Xr),lo=!1,co=Cr.md.block.ruler.getRules("list"),Yr=Cr.parentType,Cr.parentType="list";io=Zr?Lr=1:Lr=eo-Hr,Lr>4&&(Lr=1),Nr=Hr+Lr,mo=Cr.push("list_item_open","li",1),mo.markup=String.fromCharCode(Xr),mo.map=Ur=[io,0],zr&&(mo.info=Cr.src.slice(po,ao-1)),ro=Cr.tight,no=Cr.tShift[io],Jr=Cr.sCount[io],Wr=Cr.listIndent,Cr.listIndent=Cr.blkIndent,Cr.blkIndent=Nr,Cr.tight=!0,Cr.tShift[io]=Mr-Cr.bMarks[io],Cr.sCount[io]=eo,Mr>=Zr&&Cr.isEmpty(io+1)?Cr.line=Math.min(Cr.line+2,Ar):Cr.md.block.tokenize(Cr,io,Ar,!0),(!Cr.tight||lo)&&(ho=!1),lo=Cr.line-io>1&&Cr.isEmpty(Cr.line-1),Cr.blkIndent=Cr.listIndent,Cr.listIndent=Wr,Cr.tShift[io]=no,Cr.sCount[io]=Jr,Cr.tight=ro,mo=Cr.push("list_item_close","li",-1),mo.markup=String.fromCharCode(Xr),io=Cr.line,Ur[1]=io,io>=Ar||Cr.sCount[io]=4)break;for(go=!1,Br=0,Vr=co.length;Br=4||Cr.src.charCodeAt(Jr)!==91)return!1;for(;++Jr3)&&!(Cr.sCount[ro]<0)){for(Zr=!1,Hr=0,zr=eo.length;Hr"u"&&(Cr.env.references={}),typeof Cr.env.references[Ur]>"u"&&(Cr.env.references[Ur]={title:Wr,href:Lr}),Cr.parentType=jr,Cr.line=$r+Yr+1),!0)},html_blocks=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],html_re={},attr_name="[a-zA-Z_:][a-zA-Z0-9:._-]*",unquoted="[^\"'=<>`\\x00-\\x20]+",single_quoted="'[^']*'",double_quoted='"[^"]*"',attr_value="(?:"+unquoted+"|"+single_quoted+"|"+double_quoted+")",attribute="(?:\\s+"+attr_name+"(?:\\s*=\\s*"+attr_value+")?)",open_tag="<[A-Za-z][A-Za-z0-9\\-]*"+attribute+"*\\s*\\/?>",close_tag="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",comment="|",processing="<[?][\\s\\S]*?[?]>",declaration="]*>",cdata="",HTML_TAG_RE$1=new RegExp("^(?:"+open_tag+"|"+close_tag+"|"+comment+"|"+processing+"|"+declaration+"|"+cdata+")"),HTML_OPEN_CLOSE_TAG_RE$1=new RegExp("^(?:"+open_tag+"|"+close_tag+")");html_re.HTML_TAG_RE=HTML_TAG_RE$1;html_re.HTML_OPEN_CLOSE_TAG_RE=HTML_OPEN_CLOSE_TAG_RE$1;var block_names=html_blocks,HTML_OPEN_CLOSE_TAG_RE=html_re.HTML_OPEN_CLOSE_TAG_RE,HTML_SEQUENCES=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(HTML_OPEN_CLOSE_TAG_RE.source+"\\s*$"),/^$/,!1]],html_block=function(Cr,$r,Ar,Rr){var Dr,Mr,Br,Nr,Lr=Cr.bMarks[$r]+Cr.tShift[$r],Hr=Cr.eMarks[$r];if(Cr.sCount[$r]-Cr.blkIndent>=4||!Cr.md.options.html||Cr.src.charCodeAt(Lr)!==60)return!1;for(Nr=Cr.src.slice(Lr,Hr),Dr=0;Dr=4||(Dr=Cr.src.charCodeAt(Lr),Dr!==35||Lr>=Hr))return!1;for(Mr=1,Dr=Cr.src.charCodeAt(++Lr);Dr===35&&Lr6||LrLr&&isSpace$5(Cr.src.charCodeAt(Br-1))&&(Hr=Br),Cr.line=$r+1,Nr=Cr.push("heading_open","h"+String(Mr),1),Nr.markup="########".slice(0,Mr),Nr.map=[$r,Cr.line],Nr=Cr.push("inline","",0),Nr.content=Cr.src.slice(Lr,Hr).trim(),Nr.map=[$r,Cr.line],Nr.children=[],Nr=Cr.push("heading_close","h"+String(Mr),-1),Nr.markup="########".slice(0,Mr)),!0)},lheading=function(Cr,$r,Ar){var Rr,Dr,Mr,Br,Nr,Lr,Hr,zr,Ur,Vr=$r+1,jr,Gr=Cr.md.block.ruler.getRules("paragraph");if(Cr.sCount[$r]-Cr.blkIndent>=4)return!1;for(jr=Cr.parentType,Cr.parentType="paragraph";Vr3)){if(Cr.sCount[Vr]>=Cr.blkIndent&&(Lr=Cr.bMarks[Vr]+Cr.tShift[Vr],Hr=Cr.eMarks[Vr],Lr=Hr)))){zr=Ur===61?1:2;break}if(!(Cr.sCount[Vr]<0)){for(Dr=!1,Mr=0,Br=Gr.length;Mr3)&&!(Cr.sCount[Hr]<0)){for(Dr=!1,Mr=0,Br=zr.length;Mr0&&this.level++,this.tokens.push(Ar),Ar};StateBlock.prototype.isEmpty=function(Cr){return this.bMarks[Cr]+this.tShift[Cr]>=this.eMarks[Cr]};StateBlock.prototype.skipEmptyLines=function(Cr){for(var $r=this.lineMax;Cr<$r&&!(this.bMarks[Cr]+this.tShift[Cr]$r;)if(!isSpace$4(this.src.charCodeAt(--Cr)))return Cr+1;return Cr};StateBlock.prototype.skipChars=function(Cr,$r){for(var Ar=this.src.length;CrAr;)if($r!==this.src.charCodeAt(--Cr))return Cr+1;return Cr};StateBlock.prototype.getLines=function(Cr,$r,Ar,Rr){var Dr,Mr,Br,Nr,Lr,Hr,zr,Ur=Cr;if(Cr>=$r)return"";for(Hr=new Array($r-Cr),Dr=0;Ur<$r;Ur++,Dr++){for(Mr=0,zr=Nr=this.bMarks[Ur],Ur+1<$r||Rr?Lr=this.eMarks[Ur]+1:Lr=this.eMarks[Ur];NrAr?Hr[Dr]=new Array(Mr-Ar+1).join(" ")+this.src.slice(Nr,Lr):Hr[Dr]=this.src.slice(Nr,Lr)}return Hr.join("")};StateBlock.prototype.Token=Token$1;var state_block=StateBlock,Ruler$1=ruler,_rules$1=[["table",table,["paragraph","reference"]],["code",code],["fence",fence,["paragraph","reference","blockquote","list"]],["blockquote",blockquote,["paragraph","reference","blockquote","list"]],["hr",hr,["paragraph","reference","blockquote","list"]],["list",list,["paragraph","reference","blockquote"]],["reference",reference],["html_block",html_block,["paragraph","reference","blockquote"]],["heading",heading,["paragraph","reference","blockquote"]],["lheading",lheading],["paragraph",paragraph]];function ParserBlock$1(){this.ruler=new Ruler$1;for(var Tr=0;Tr<_rules$1.length;Tr++)this.ruler.push(_rules$1[Tr][0],_rules$1[Tr][1],{alt:(_rules$1[Tr][2]||[]).slice()})}ParserBlock$1.prototype.tokenize=function(Tr,Cr,$r){for(var Ar,Rr,Dr,Mr=this.ruler.getRules(""),Br=Mr.length,Nr=Cr,Lr=!1,Hr=Tr.md.options.maxNesting;Nr<$r&&(Tr.line=Nr=Tr.skipEmptyLines(Nr),!(Nr>=$r||Tr.sCount[Nr]=Hr){Tr.line=$r;break}for(Dr=Tr.line,Rr=0;Rr=Tr.line)throw new Error("block rule didn't increment state.line");break}if(!Ar)throw new Error("none of the block rules matched");Tr.tight=!Lr,Tr.isEmpty(Tr.line-1)&&(Lr=!0),Nr=Tr.line,Nr<$r&&Tr.isEmpty(Nr)&&(Lr=!0,Nr++,Tr.line=Nr)}};ParserBlock$1.prototype.parse=function(Tr,Cr,$r,Ar){var Rr;Tr&&(Rr=new this.State(Tr,Cr,$r,Ar),this.tokenize(Rr,Rr.line,Rr.lineMax))};ParserBlock$1.prototype.State=state_block;var parser_block=ParserBlock$1;function isTerminatorChar(Tr){switch(Tr){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}var text=function(Cr,$r){for(var Ar=Cr.pos;Ar0||(Ar=Cr.pos,Rr=Cr.posMax,Ar+3>Rr)||Cr.src.charCodeAt(Ar)!==58||Cr.src.charCodeAt(Ar+1)!==47||Cr.src.charCodeAt(Ar+2)!==47||(Dr=Cr.pending.match(SCHEME_RE),!Dr)||(Mr=Dr[1],Br=Cr.md.linkify.matchAtStart(Cr.src.slice(Ar-Mr.length)),!Br)||(Nr=Br.url,Nr.length<=Mr.length)||(Nr=Nr.replace(/\*+$/,""),Lr=Cr.md.normalizeLink(Nr),!Cr.md.validateLink(Lr))?!1:($r||(Cr.pending=Cr.pending.slice(0,-Mr.length),Hr=Cr.push("link_open","a",1),Hr.attrs=[["href",Lr]],Hr.markup="linkify",Hr.info="auto",Hr=Cr.push("text","",0),Hr.content=Cr.md.normalizeLinkText(Nr),Hr=Cr.push("link_close","a",-1),Hr.markup="linkify",Hr.info="auto"),Cr.pos+=Nr.length-Mr.length,!0)},isSpace$3=utils$1.isSpace,newline=function(Cr,$r){var Ar,Rr,Dr,Mr=Cr.pos;if(Cr.src.charCodeAt(Mr)!==10)return!1;if(Ar=Cr.pending.length-1,Rr=Cr.posMax,!$r)if(Ar>=0&&Cr.pending.charCodeAt(Ar)===32)if(Ar>=1&&Cr.pending.charCodeAt(Ar-1)===32){for(Dr=Ar-1;Dr>=1&&Cr.pending.charCodeAt(Dr-1)===32;)Dr--;Cr.pending=Cr.pending.slice(0,Dr),Cr.push("hardbreak","br",0)}else Cr.pending=Cr.pending.slice(0,-1),Cr.push("softbreak","br",0);else Cr.push("softbreak","br",0);for(Mr++;Mr?@[]^_`{|}~-".split("").forEach(function(Tr){ESCAPED[Tr.charCodeAt(0)]=1});var _escape=function(Cr,$r){var Ar,Rr,Dr,Mr,Br,Nr=Cr.pos,Lr=Cr.posMax;if(Cr.src.charCodeAt(Nr)!==92||(Nr++,Nr>=Lr))return!1;if(Ar=Cr.src.charCodeAt(Nr),Ar===10){for($r||Cr.push("hardbreak","br",0),Nr++;Nr=55296&&Ar<=56319&&Nr+1=56320&&Rr<=57343&&(Mr+=Cr.src[Nr+1],Nr++)),Dr="\\"+Mr,$r||(Br=Cr.push("text_special","",0),Ar<256&&ESCAPED[Ar]!==0?Br.content=Mr:Br.content=Dr,Br.markup=Dr,Br.info="escape"),Cr.pos=Nr+1,!0},backticks=function(Cr,$r){var Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr,zr=Cr.pos,Ur=Cr.src.charCodeAt(zr);if(Ur!==96)return!1;for(Ar=zr,zr++,Rr=Cr.posMax;zr=0;$r--)Ar=Cr[$r],!(Ar.marker!==95&&Ar.marker!==42)&&Ar.end!==-1&&(Rr=Cr[Ar.end],Br=$r>0&&Cr[$r-1].end===Ar.end+1&&Cr[$r-1].marker===Ar.marker&&Cr[$r-1].token===Ar.token-1&&Cr[Ar.end+1].token===Rr.token+1,Mr=String.fromCharCode(Ar.marker),Dr=Tr.tokens[Ar.token],Dr.type=Br?"strong_open":"em_open",Dr.tag=Br?"strong":"em",Dr.nesting=1,Dr.markup=Br?Mr+Mr:Mr,Dr.content="",Dr=Tr.tokens[Rr.token],Dr.type=Br?"strong_close":"em_close",Dr.tag=Br?"strong":"em",Dr.nesting=-1,Dr.markup=Br?Mr+Mr:Mr,Dr.content="",Br&&(Tr.tokens[Cr[$r-1].token].content="",Tr.tokens[Cr[Ar.end+1].token].content="",$r--))}emphasis.postProcess=function(Cr){var $r,Ar=Cr.tokens_meta,Rr=Cr.tokens_meta.length;for(postProcess(Cr,Cr.delimiters),$r=0;$r=Gr)return!1;if(Xr=Nr,Lr=Cr.md.helpers.parseLinkDestination(Cr.src,Nr,Cr.posMax),Lr.ok){for(Ur=Cr.md.normalizeLink(Lr.str),Cr.md.validateLink(Ur)?Nr=Lr.pos:Ur="",Xr=Nr;Nr=Gr||Cr.src.charCodeAt(Nr)!==41)&&(Kr=!0),Nr++}if(Kr){if(typeof Cr.env.references>"u")return!1;if(Nr=0?Dr=Cr.src.slice(Xr,Nr++):Nr=Mr+1):Nr=Mr+1,Dr||(Dr=Cr.src.slice(Br,Mr)),Hr=Cr.env.references[normalizeReference$1(Dr)],!Hr)return Cr.pos=jr,!1;Ur=Hr.href,Vr=Hr.title}return $r||(Cr.pos=Br,Cr.posMax=Mr,zr=Cr.push("link_open","a",1),zr.attrs=Ar=[["href",Ur]],Vr&&Ar.push(["title",Vr]),Cr.linkLevel++,Cr.md.inline.tokenize(Cr),Cr.linkLevel--,zr=Cr.push("link_close","a",-1)),Cr.pos=Nr,Cr.posMax=Gr,!0},normalizeReference=utils$1.normalizeReference,isSpace=utils$1.isSpace,image=function(Cr,$r){var Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr,zr,Ur,Vr,jr,Gr,Xr="",Kr=Cr.pos,Zr=Cr.posMax;if(Cr.src.charCodeAt(Cr.pos)!==33||Cr.src.charCodeAt(Cr.pos+1)!==91||(Nr=Cr.pos+2,Br=Cr.md.helpers.parseLinkLabel(Cr,Cr.pos+1,!1),Br<0))return!1;if(Lr=Br+1,Lr=Zr)return!1;for(Gr=Lr,zr=Cr.md.helpers.parseLinkDestination(Cr.src,Lr,Cr.posMax),zr.ok&&(Xr=Cr.md.normalizeLink(zr.str),Cr.md.validateLink(Xr)?Lr=zr.pos:Xr=""),Gr=Lr;Lr=Zr||Cr.src.charCodeAt(Lr)!==41)return Cr.pos=Kr,!1;Lr++}else{if(typeof Cr.env.references>"u")return!1;if(Lr=0?Mr=Cr.src.slice(Gr,Lr++):Lr=Br+1):Lr=Br+1,Mr||(Mr=Cr.src.slice(Nr,Br)),Hr=Cr.env.references[normalizeReference(Mr)],!Hr)return Cr.pos=Kr,!1;Xr=Hr.href,Ur=Hr.title}return $r||(Dr=Cr.src.slice(Nr,Br),Cr.md.inline.parse(Dr,Cr.md,Cr.env,jr=[]),Vr=Cr.push("image","img",0),Vr.attrs=Ar=[["src",Xr],["alt",""]],Vr.children=jr,Vr.content=Dr,Ur&&Ar.push(["title",Ur])),Cr.pos=Lr,Cr.posMax=Zr,!0},EMAIL_RE=/^([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])?)*)$/,AUTOLINK_RE=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,autolink=function(Cr,$r){var Ar,Rr,Dr,Mr,Br,Nr,Lr=Cr.pos;if(Cr.src.charCodeAt(Lr)!==60)return!1;for(Br=Cr.pos,Nr=Cr.posMax;;){if(++Lr>=Nr||(Mr=Cr.src.charCodeAt(Lr),Mr===60))return!1;if(Mr===62)break}return Ar=Cr.src.slice(Br+1,Lr),AUTOLINK_RE.test(Ar)?(Rr=Cr.md.normalizeLink(Ar),Cr.md.validateLink(Rr)?($r||(Dr=Cr.push("link_open","a",1),Dr.attrs=[["href",Rr]],Dr.markup="autolink",Dr.info="auto",Dr=Cr.push("text","",0),Dr.content=Cr.md.normalizeLinkText(Ar),Dr=Cr.push("link_close","a",-1),Dr.markup="autolink",Dr.info="auto"),Cr.pos+=Ar.length+2,!0):!1):EMAIL_RE.test(Ar)?(Rr=Cr.md.normalizeLink("mailto:"+Ar),Cr.md.validateLink(Rr)?($r||(Dr=Cr.push("link_open","a",1),Dr.attrs=[["href",Rr]],Dr.markup="autolink",Dr.info="auto",Dr=Cr.push("text","",0),Dr.content=Cr.md.normalizeLinkText(Ar),Dr=Cr.push("link_close","a",-1),Dr.markup="autolink",Dr.info="auto"),Cr.pos+=Ar.length+2,!0):!1):!1},HTML_TAG_RE=html_re.HTML_TAG_RE;function isLinkOpen(Tr){return/^\s]/i.test(Tr)}function isLinkClose(Tr){return/^<\/a\s*>/i.test(Tr)}function isLetter(Tr){var Cr=Tr|32;return Cr>=97&&Cr<=122}var html_inline=function(Cr,$r){var Ar,Rr,Dr,Mr,Br=Cr.pos;return!Cr.md.options.html||(Dr=Cr.posMax,Cr.src.charCodeAt(Br)!==60||Br+2>=Dr)||(Ar=Cr.src.charCodeAt(Br+1),Ar!==33&&Ar!==63&&Ar!==47&&!isLetter(Ar))||(Rr=Cr.src.slice(Br).match(HTML_TAG_RE),!Rr)?!1:($r||(Mr=Cr.push("html_inline","",0),Mr.content=Rr[0],isLinkOpen(Mr.content)&&Cr.linkLevel++,isLinkClose(Mr.content)&&Cr.linkLevel--),Cr.pos+=Rr[0].length,!0)},entities=entities$1,has=utils$1.has,isValidEntityCode=utils$1.isValidEntityCode,fromCodePoint=utils$1.fromCodePoint,DIGITAL_RE=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,NAMED_RE=/^&([a-z][a-z0-9]{1,31});/i,entity=function(Cr,$r){var Ar,Rr,Dr,Mr,Br=Cr.pos,Nr=Cr.posMax;if(Cr.src.charCodeAt(Br)!==38||Br+1>=Nr)return!1;if(Ar=Cr.src.charCodeAt(Br+1),Ar===35){if(Dr=Cr.src.slice(Br).match(DIGITAL_RE),Dr)return $r||(Rr=Dr[1][0].toLowerCase()==="x"?parseInt(Dr[1].slice(1),16):parseInt(Dr[1],10),Mr=Cr.push("text_special","",0),Mr.content=isValidEntityCode(Rr)?fromCodePoint(Rr):fromCodePoint(65533),Mr.markup=Dr[0],Mr.info="entity"),Cr.pos+=Dr[0].length,!0}else if(Dr=Cr.src.slice(Br).match(NAMED_RE),Dr&&has(entities,Dr[1]))return $r||(Mr=Cr.push("text_special","",0),Mr.content=entities[Dr[1]],Mr.markup=Dr[0],Mr.info="entity"),Cr.pos+=Dr[0].length,!0;return!1};function processDelimiters(Tr){var Cr,$r,Ar,Rr,Dr,Mr,Br,Nr,Lr={},Hr=Tr.length;if(Hr){var zr=0,Ur=-2,Vr=[];for(Cr=0;CrDr;$r-=Vr[$r]+1)if(Rr=Tr[$r],Rr.marker===Ar.marker&&Rr.open&&Rr.end<0&&(Br=!1,(Rr.close||Ar.open)&&(Rr.length+Ar.length)%3===0&&(Rr.length%3!==0||Ar.length%3!==0)&&(Br=!0),!Br)){Nr=$r>0&&!Tr[$r-1].open?Vr[$r-1]+1:0,Vr[Cr]=Cr-$r+Nr,Vr[$r]=Nr,Ar.open=!1,Rr.end=Cr,Rr.close=!1,Mr=-1,Ur=-2;break}Mr!==-1&&(Lr[Ar.marker][(Ar.open?3:0)+(Ar.length||0)%3]=Mr)}}}var balance_pairs=function(Cr){var $r,Ar=Cr.tokens_meta,Rr=Cr.tokens_meta.length;for(processDelimiters(Cr.delimiters),$r=0;$r0&&Rr++,Dr[$r].type==="text"&&$r+10&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],Rr={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(Ar),this.tokens_meta.push(Rr),Ar};StateInline.prototype.scanDelims=function(Tr,Cr){var $r=Tr,Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr,zr,Ur=!0,Vr=!0,jr=this.posMax,Gr=this.src.charCodeAt(Tr);for(Ar=Tr>0?this.src.charCodeAt(Tr-1):32;$r=Tr.pos)throw new Error("inline rule didn't increment state.pos");break}}else Tr.pos=Tr.posMax;Cr||Tr.pos++,Br[Ar]=Tr.pos};ParserInline$1.prototype.tokenize=function(Tr){for(var Cr,$r,Ar,Rr=this.ruler.getRules(""),Dr=Rr.length,Mr=Tr.posMax,Br=Tr.md.options.maxNesting;Tr.pos=Tr.pos)throw new Error("inline rule didn't increment state.pos");break}}if(Cr){if(Tr.pos>=Mr)break;continue}Tr.pending+=Tr.src[Tr.pos++]}Tr.pending&&Tr.pushPending()};ParserInline$1.prototype.parse=function(Tr,Cr,$r,Ar){var Rr,Dr,Mr,Br=new this.State(Tr,Cr,$r,Ar);for(this.tokenize(Br),Dr=this.ruler2.getRules(""),Mr=Dr.length,Rr=0;Rr|$))",Cr.tpl_email_fuzzy="(^|"+$r+'|"|\\(|'+Cr.src_ZCc+")("+Cr.src_email_name+"@"+Cr.tpl_host_fuzzy_strict+")",Cr.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+Cr.src_ZPCc+"))((?![$+<=>^`||])"+Cr.tpl_host_port_fuzzy_strict+Cr.src_path+")",Cr.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+Cr.src_ZPCc+"))((?![$+<=>^`||])"+Cr.tpl_host_port_no_ip_fuzzy_strict+Cr.src_path+")",Cr}),re}function assign(Tr){var Cr=Array.prototype.slice.call(arguments,1);return Cr.forEach(function($r){$r&&Object.keys($r).forEach(function(Ar){Tr[Ar]=$r[Ar]})}),Tr}function _class(Tr){return Object.prototype.toString.call(Tr)}function isString(Tr){return _class(Tr)==="[object String]"}function isObject(Tr){return _class(Tr)==="[object Object]"}function isRegExp(Tr){return _class(Tr)==="[object RegExp]"}function isFunction(Tr){return _class(Tr)==="[object Function]"}function escapeRE(Tr){return Tr.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var defaultOptions={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function isOptionsObj(Tr){return Object.keys(Tr||{}).reduce(function(Cr,$r){return Cr||defaultOptions.hasOwnProperty($r)},!1)}var defaultSchemas={"http:":{validate:function(Tr,Cr,$r){var Ar=Tr.slice(Cr);return $r.re.http||($r.re.http=new RegExp("^\\/\\/"+$r.re.src_auth+$r.re.src_host_port_strict+$r.re.src_path,"i")),$r.re.http.test(Ar)?Ar.match($r.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(Tr,Cr,$r){var Ar=Tr.slice(Cr);return $r.re.no_http||($r.re.no_http=new RegExp("^"+$r.re.src_auth+"(?:localhost|(?:(?:"+$r.re.src_domain+")\\.)+"+$r.re.src_domain_root+")"+$r.re.src_port+$r.re.src_host_terminator+$r.re.src_path,"i")),$r.re.no_http.test(Ar)?Cr>=3&&Tr[Cr-3]===":"||Cr>=3&&Tr[Cr-3]==="/"?0:Ar.match($r.re.no_http)[0].length:0}},"mailto:":{validate:function(Tr,Cr,$r){var Ar=Tr.slice(Cr);return $r.re.mailto||($r.re.mailto=new RegExp("^"+$r.re.src_email_name+"@"+$r.re.src_host_strict,"i")),$r.re.mailto.test(Ar)?Ar.match($r.re.mailto)[0].length:0}}},tlds_2ch_src_re="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",tlds_default="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function resetScanCache(Tr){Tr.__index__=-1,Tr.__text_cache__=""}function createValidator(Tr){return function(Cr,$r){var Ar=Cr.slice($r);return Tr.test(Ar)?Ar.match(Tr)[0].length:0}}function createNormalizer(){return function(Tr,Cr){Cr.normalize(Tr)}}function compile(Tr){var Cr=Tr.re=requireRe()(Tr.__opts__),$r=Tr.__tlds__.slice();Tr.onCompile(),Tr.__tlds_replaced__||$r.push(tlds_2ch_src_re),$r.push(Cr.src_xn),Cr.src_tlds=$r.join("|");function Ar(Br){return Br.replace("%TLDS%",Cr.src_tlds)}Cr.email_fuzzy=RegExp(Ar(Cr.tpl_email_fuzzy),"i"),Cr.link_fuzzy=RegExp(Ar(Cr.tpl_link_fuzzy),"i"),Cr.link_no_ip_fuzzy=RegExp(Ar(Cr.tpl_link_no_ip_fuzzy),"i"),Cr.host_fuzzy_test=RegExp(Ar(Cr.tpl_host_fuzzy_test),"i");var Rr=[];Tr.__compiled__={};function Dr(Br,Nr){throw new Error('(LinkifyIt) Invalid schema "'+Br+'": '+Nr)}Object.keys(Tr.__schemas__).forEach(function(Br){var Nr=Tr.__schemas__[Br];if(Nr!==null){var Lr={validate:null,link:null};if(Tr.__compiled__[Br]=Lr,isObject(Nr)){isRegExp(Nr.validate)?Lr.validate=createValidator(Nr.validate):isFunction(Nr.validate)?Lr.validate=Nr.validate:Dr(Br,Nr),isFunction(Nr.normalize)?Lr.normalize=Nr.normalize:Nr.normalize?Dr(Br,Nr):Lr.normalize=createNormalizer();return}if(isString(Nr)){Rr.push(Br);return}Dr(Br,Nr)}}),Rr.forEach(function(Br){Tr.__compiled__[Tr.__schemas__[Br]]&&(Tr.__compiled__[Br].validate=Tr.__compiled__[Tr.__schemas__[Br]].validate,Tr.__compiled__[Br].normalize=Tr.__compiled__[Tr.__schemas__[Br]].normalize)}),Tr.__compiled__[""]={validate:null,normalize:createNormalizer()};var Mr=Object.keys(Tr.__compiled__).filter(function(Br){return Br.length>0&&Tr.__compiled__[Br]}).map(escapeRE).join("|");Tr.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+Cr.src_ZPCc+"))("+Mr+")","i"),Tr.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+Cr.src_ZPCc+"))("+Mr+")","ig"),Tr.re.schema_at_start=RegExp("^"+Tr.re.schema_search.source,"i"),Tr.re.pretest=RegExp("("+Tr.re.schema_test.source+")|("+Tr.re.host_fuzzy_test.source+")|@","i"),resetScanCache(Tr)}function Match(Tr,Cr){var $r=Tr.__index__,Ar=Tr.__last_index__,Rr=Tr.__text_cache__.slice($r,Ar);this.schema=Tr.__schema__.toLowerCase(),this.index=$r+Cr,this.lastIndex=Ar+Cr,this.raw=Rr,this.text=Rr,this.url=Rr}function createMatch(Tr,Cr){var $r=new Match(Tr,Cr);return Tr.__compiled__[$r.schema].normalize($r,Tr),$r}function LinkifyIt$1(Tr,Cr){if(!(this instanceof LinkifyIt$1))return new LinkifyIt$1(Tr,Cr);Cr||isOptionsObj(Tr)&&(Cr=Tr,Tr={}),this.__opts__=assign({},defaultOptions,Cr),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=assign({},defaultSchemas,Tr),this.__compiled__={},this.__tlds__=tlds_default,this.__tlds_replaced__=!1,this.re={},compile(this)}LinkifyIt$1.prototype.add=function(Cr,$r){return this.__schemas__[Cr]=$r,compile(this),this};LinkifyIt$1.prototype.set=function(Cr){return this.__opts__=assign(this.__opts__,Cr),this};LinkifyIt$1.prototype.test=function(Cr){if(this.__text_cache__=Cr,this.__index__=-1,!Cr.length)return!1;var $r,Ar,Rr,Dr,Mr,Br,Nr,Lr,Hr;if(this.re.schema_test.test(Cr)){for(Nr=this.re.schema_search,Nr.lastIndex=0;($r=Nr.exec(Cr))!==null;)if(Dr=this.testSchemaAt(Cr,$r[2],Nr.lastIndex),Dr){this.__schema__=$r[2],this.__index__=$r.index+$r[1].length,this.__last_index__=$r.index+$r[0].length+Dr;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(Lr=Cr.search(this.re.host_fuzzy_test),Lr>=0&&(this.__index__<0||Lr=0&&(Rr=Cr.match(this.re.email_fuzzy))!==null&&(Mr=Rr.index+Rr[1].length,Br=Rr.index+Rr[0].length,(this.__index__<0||Mrthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=Mr,this.__last_index__=Br))),this.__index__>=0};LinkifyIt$1.prototype.pretest=function(Cr){return this.re.pretest.test(Cr)};LinkifyIt$1.prototype.testSchemaAt=function(Cr,$r,Ar){return this.__compiled__[$r.toLowerCase()]?this.__compiled__[$r.toLowerCase()].validate(Cr,Ar,this):0};LinkifyIt$1.prototype.match=function(Cr){var $r=0,Ar=[];this.__index__>=0&&this.__text_cache__===Cr&&(Ar.push(createMatch(this,$r)),$r=this.__last_index__);for(var Rr=$r?Cr.slice($r):Cr;this.test(Rr);)Ar.push(createMatch(this,$r)),Rr=Rr.slice(this.__last_index__),$r+=this.__last_index__;return Ar.length?Ar:null};LinkifyIt$1.prototype.matchAtStart=function(Cr){if(this.__text_cache__=Cr,this.__index__=-1,!Cr.length)return null;var $r=this.re.schema_at_start.exec(Cr);if(!$r)return null;var Ar=this.testSchemaAt(Cr,$r[2],$r[0].length);return Ar?(this.__schema__=$r[2],this.__index__=$r.index+$r[1].length,this.__last_index__=$r.index+$r[0].length+Ar,createMatch(this,0)):null};LinkifyIt$1.prototype.tlds=function(Cr,$r){return Cr=Array.isArray(Cr)?Cr:[Cr],$r?(this.__tlds__=this.__tlds__.concat(Cr).sort().filter(function(Ar,Rr,Dr){return Ar!==Dr[Rr-1]}).reverse(),compile(this),this):(this.__tlds__=Cr.slice(),this.__tlds_replaced__=!0,compile(this),this)};LinkifyIt$1.prototype.normalize=function(Cr){Cr.schema||(Cr.url="http://"+Cr.url),Cr.schema==="mailto:"&&!/^mailto:/i.test(Cr.url)&&(Cr.url="mailto:"+Cr.url)};LinkifyIt$1.prototype.onCompile=function(){};var linkifyIt=LinkifyIt$1;const maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexPunycode=/^xn--/,regexNonASCII=/[^\0-\x7F]/,regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g,errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode;function error(Tr){throw new RangeError(errors[Tr])}function map(Tr,Cr){const $r=[];let Ar=Tr.length;for(;Ar--;)$r[Ar]=Cr(Tr[Ar]);return $r}function mapDomain(Tr,Cr){const $r=Tr.split("@");let Ar="";$r.length>1&&(Ar=$r[0]+"@",Tr=$r[1]),Tr=Tr.replace(regexSeparators,".");const Rr=Tr.split("."),Dr=map(Rr,Cr).join(".");return Ar+Dr}function ucs2decode(Tr){const Cr=[];let $r=0;const Ar=Tr.length;for(;$r=55296&&Rr<=56319&&$rString.fromCodePoint(...Tr),basicToDigit=function(Tr){return Tr>=48&&Tr<58?26+(Tr-48):Tr>=65&&Tr<91?Tr-65:Tr>=97&&Tr<123?Tr-97:base},digitToBasic=function(Tr,Cr){return Tr+22+75*(Tr<26)-((Cr!=0)<<5)},adapt=function(Tr,Cr,$r){let Ar=0;for(Tr=$r?floor(Tr/damp):Tr>>1,Tr+=floor(Tr/Cr);Tr>baseMinusTMin*tMax>>1;Ar+=base)Tr=floor(Tr/baseMinusTMin);return floor(Ar+(baseMinusTMin+1)*Tr/(Tr+skew))},decode=function(Tr){const Cr=[],$r=Tr.length;let Ar=0,Rr=initialN,Dr=initialBias,Mr=Tr.lastIndexOf(delimiter);Mr<0&&(Mr=0);for(let Br=0;Br=128&&error("not-basic"),Cr.push(Tr.charCodeAt(Br));for(let Br=Mr>0?Mr+1:0;Br<$r;){const Nr=Ar;for(let Hr=1,zr=base;;zr+=base){Br>=$r&&error("invalid-input");const Ur=basicToDigit(Tr.charCodeAt(Br++));Ur>=base&&error("invalid-input"),Ur>floor((maxInt-Ar)/Hr)&&error("overflow"),Ar+=Ur*Hr;const Vr=zr<=Dr?tMin:zr>=Dr+tMax?tMax:zr-Dr;if(Urfloor(maxInt/jr)&&error("overflow"),Hr*=jr}const Lr=Cr.length+1;Dr=adapt(Ar-Nr,Lr,Nr==0),floor(Ar/Lr)>maxInt-Rr&&error("overflow"),Rr+=floor(Ar/Lr),Ar%=Lr,Cr.splice(Ar++,0,Rr)}return String.fromCodePoint(...Cr)},encode=function(Tr){const Cr=[];Tr=ucs2decode(Tr);const $r=Tr.length;let Ar=initialN,Rr=0,Dr=initialBias;for(const Nr of Tr)Nr<128&&Cr.push(stringFromCharCode(Nr));const Mr=Cr.length;let Br=Mr;for(Mr&&Cr.push(delimiter);Br<$r;){let Nr=maxInt;for(const Hr of Tr)Hr>=Ar&&Hrfloor((maxInt-Rr)/Lr)&&error("overflow"),Rr+=(Nr-Ar)*Lr,Ar=Nr;for(const Hr of Tr)if(HrmaxInt&&error("overflow"),Hr===Ar){let zr=Rr;for(let Ur=base;;Ur+=base){const Vr=Ur<=Dr?tMin:Ur>=Dr+tMax?tMax:Ur-Dr;if(zr=0))try{Cr.hostname=punycode.toASCII(Cr.hostname)}catch{}return mdurl.encode(mdurl.format(Cr))}function normalizeLinkText(Tr){var Cr=mdurl.parse(Tr,!0);if(Cr.hostname&&(!Cr.protocol||RECODE_HOSTNAME_FOR.indexOf(Cr.protocol)>=0))try{Cr.hostname=punycode.toUnicode(Cr.hostname)}catch{}return mdurl.decode(mdurl.format(Cr),mdurl.decode.defaultChars+"%")}function MarkdownIt(Tr,Cr){if(!(this instanceof MarkdownIt))return new MarkdownIt(Tr,Cr);Cr||utils.isString(Tr)||(Cr=Tr||{},Tr="default"),this.inline=new ParserInline,this.block=new ParserBlock,this.core=new ParserCore,this.renderer=new Renderer,this.linkify=new LinkifyIt,this.validateLink=validateLink,this.normalizeLink=normalizeLink,this.normalizeLinkText=normalizeLinkText,this.utils=utils,this.helpers=utils.assign({},helpers),this.options={},this.configure(Tr),Cr&&this.set(Cr)}MarkdownIt.prototype.set=function(Tr){return utils.assign(this.options,Tr),this};MarkdownIt.prototype.configure=function(Tr){var Cr=this,$r;if(utils.isString(Tr)&&($r=Tr,Tr=config[$r],!Tr))throw new Error('Wrong `markdown-it` preset "'+$r+'", check name');if(!Tr)throw new Error("Wrong `markdown-it` preset, can't be empty");return Tr.options&&Cr.set(Tr.options),Tr.components&&Object.keys(Tr.components).forEach(function(Ar){Tr.components[Ar].rules&&Cr[Ar].ruler.enableOnly(Tr.components[Ar].rules),Tr.components[Ar].rules2&&Cr[Ar].ruler2.enableOnly(Tr.components[Ar].rules2)}),this};MarkdownIt.prototype.enable=function(Tr,Cr){var $r=[];Array.isArray(Tr)||(Tr=[Tr]),["core","block","inline"].forEach(function(Rr){$r=$r.concat(this[Rr].ruler.enable(Tr,!0))},this),$r=$r.concat(this.inline.ruler2.enable(Tr,!0));var Ar=Tr.filter(function(Rr){return $r.indexOf(Rr)<0});if(Ar.length&&!Cr)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+Ar);return this};MarkdownIt.prototype.disable=function(Tr,Cr){var $r=[];Array.isArray(Tr)||(Tr=[Tr]),["core","block","inline"].forEach(function(Rr){$r=$r.concat(this[Rr].ruler.disable(Tr,!0))},this),$r=$r.concat(this.inline.ruler2.disable(Tr,!0));var Ar=Tr.filter(function(Rr){return $r.indexOf(Rr)<0});if(Ar.length&&!Cr)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+Ar);return this};MarkdownIt.prototype.use=function(Tr){var Cr=[this].concat(Array.prototype.slice.call(arguments,1));return Tr.apply(Tr,Cr),this};MarkdownIt.prototype.parse=function(Tr,Cr){if(typeof Tr!="string")throw new Error("Input data should be a String");var $r=new this.core.State(Tr,this,Cr);return this.core.process($r),$r.tokens};MarkdownIt.prototype.render=function(Tr,Cr){return Cr=Cr||{},this.renderer.render(this.parse(Tr,Cr),this.options,Cr)};MarkdownIt.prototype.parseInline=function(Tr,Cr){var $r=new this.core.State(Tr,this,Cr);return $r.inlineMode=!0,this.core.process($r),$r.tokens};MarkdownIt.prototype.renderInline=function(Tr,Cr){return Cr=Cr||{},this.renderer.render(this.parseInline(Tr,Cr),this.options,Cr)};var lib=MarkdownIt,markdownIt=lib;const markdownit=getDefaultExportFromCjs(markdownIt);var disableCheckboxes=!0,useLabelWrapper=!1,useLabelAfter=!1,markdownItTaskLists=function(Tr,Cr){Cr&&(disableCheckboxes=!Cr.enabled,useLabelWrapper=!!Cr.label,useLabelAfter=!!Cr.labelAfter),Tr.core.ruler.after("inline","github-task-lists",function($r){for(var Ar=$r.tokens,Rr=2;Rr=0;Ar--)if(Tr[Ar].level===$r)return Ar;return-1}function isTodoItem(Tr,Cr){return isInline(Tr[Cr])&&isParagraph(Tr[Cr-1])&&isListItem(Tr[Cr-2])&&startsWithTodoMarkdown(Tr[Cr])}function todoify(Tr,Cr){if(Tr.children.unshift(makeCheckbox(Tr,Cr)),Tr.children[1].content=Tr.children[1].content.slice(3),Tr.content=Tr.content.slice(3),useLabelWrapper)if(useLabelAfter){Tr.children.pop();var $r="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);Tr.children[0].content=Tr.children[0].content.slice(0,-1)+' id="'+$r+'">',Tr.children.push(afterLabel(Tr.content,$r,Cr))}else Tr.children.unshift(beginLabel(Cr)),Tr.children.push(endLabel(Cr))}function makeCheckbox(Tr,Cr){var $r=new Cr("html_inline","",0),Ar=disableCheckboxes?' disabled="" ':"";return Tr.content.indexOf("[ ] ")===0?$r.content='':(Tr.content.indexOf("[x] ")===0||Tr.content.indexOf("[X] ")===0)&&($r.content=''),$r}function beginLabel(Tr){var Cr=new Tr("html_inline","",0);return Cr.content="",Cr}function afterLabel(Tr,Cr,$r){var Ar=new $r("html_inline","",0);return Ar.content='",Ar.attrs=[{for:Cr}],Ar}function isInline(Tr){return Tr.type==="inline"}function isParagraph(Tr){return Tr.type==="paragraph_open"}function isListItem(Tr){return Tr.type==="list_item_open"}function startsWithTodoMarkdown(Tr){return Tr.content.indexOf("[ ] ")===0||Tr.content.indexOf("[x] ")===0||Tr.content.indexOf("[X] ")===0}const taskListPlugin=getDefaultExportFromCjs(markdownItTaskLists);function ownKeys(Tr,Cr){var $r=Object.keys(Tr);if(Object.getOwnPropertySymbols){var Ar=Object.getOwnPropertySymbols(Tr);Cr&&(Ar=Ar.filter(function(Rr){return Object.getOwnPropertyDescriptor(Tr,Rr).enumerable})),$r.push.apply($r,Ar)}return $r}function _objectSpread2(Tr){for(var Cr=1;Cr"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _assertThisInitialized(Tr){if(Tr===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Tr}function _possibleConstructorReturn(Tr,Cr){if(Cr&&(typeof Cr=="object"||typeof Cr=="function"))return Cr;if(Cr!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(Tr)}function _createSuper(Tr){var Cr=_isNativeReflectConstruct();return function(){var Ar=_getPrototypeOf(Tr),Rr;if(Cr){var Dr=_getPrototypeOf(this).constructor;Rr=Reflect.construct(Ar,arguments,Dr)}else Rr=Ar.apply(this,arguments);return _possibleConstructorReturn(this,Rr)}}function _superPropBase(Tr,Cr){for(;!Object.prototype.hasOwnProperty.call(Tr,Cr)&&(Tr=_getPrototypeOf(Tr),Tr!==null););return Tr}function _get(){return typeof Reflect<"u"&&Reflect.get?_get=Reflect.get.bind():_get=function(Cr,$r,Ar){var Rr=_superPropBase(Cr,$r);if(Rr){var Dr=Object.getOwnPropertyDescriptor(Rr,$r);return Dr.get?Dr.get.call(arguments.length<3?Cr:Ar):Dr.value}},_get.apply(this,arguments)}function _toConsumableArray(Tr){return _arrayWithoutHoles(Tr)||_iterableToArray(Tr)||_unsupportedIterableToArray(Tr)||_nonIterableSpread()}function _arrayWithoutHoles(Tr){if(Array.isArray(Tr))return _arrayLikeToArray(Tr)}function _iterableToArray(Tr){if(typeof Symbol<"u"&&Tr[Symbol.iterator]!=null||Tr["@@iterator"]!=null)return Array.from(Tr)}function _unsupportedIterableToArray(Tr,Cr){if(Tr){if(typeof Tr=="string")return _arrayLikeToArray(Tr,Cr);var $r=Object.prototype.toString.call(Tr).slice(8,-1);if($r==="Object"&&Tr.constructor&&($r=Tr.constructor.name),$r==="Map"||$r==="Set")return Array.from(Tr);if($r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test($r))return _arrayLikeToArray(Tr,Cr)}}function _arrayLikeToArray(Tr,Cr){(Cr==null||Cr>Tr.length)&&(Cr=Tr.length);for(var $r=0,Ar=new Array(Cr);$r0&&arguments[0]!==void 0?arguments[0]:null;return function(Rr){var Dr=Rr.editor,Mr=Rr.commands;function Br(Nr){if(!Dr.isActive(Nr))return!1;var Lr=Dr.getAttributes(Nr);return Mr.updateAttributes(Nr,{tight:Ar??!(Lr!=null&&Lr.tight)})}return Cr.options.listTypes.some(function(Nr){return Br(Nr)})}}}}});function scanDelims(Tr,Cr){var $r=new(markdownit()).inline.State(Tr,null,null,[]);return $r.scanDelims(Cr,!0)}function shiftDelim(Tr,Cr,$r,Ar){var Rr=Tr.substring(0,$r)+Tr.substring($r+Cr.length);return Rr=Rr.substring(0,$r+Ar)+Cr+Rr.substring($r+Ar),Rr}function trimStart(Tr,Cr,$r,Ar){for(var Rr=$r,Dr=Tr;Rr$r&&!scanDelims(Dr,Rr).can_close;)Dr=shiftDelim(Dr,Cr,Rr,-1),Rr--;return{text:Dr,from:$r,to:Rr}}function trimInline(Tr,Cr,$r,Ar){var Rr={text:Tr,from:$r,to:Ar};return Rr=trimStart(Rr.text,Cr,Rr.from,Rr.to),Rr=trimEnd(Rr.text,Cr,Rr.from,Rr.to),Rr.to-Rr.from) (<\/.*?>)$/);return Rr?[Rr[1],Rr[2]]:null}function elementFromString(Tr){var Cr="".concat(Tr,"");return new window.DOMParser().parseFromString(Cr,"text/html").body}function escapeHTML(Tr){return Tr==null?void 0:Tr.replace(//g,">")}function extractElement(Tr){for(var Cr=Tr.parentElement,$r=Cr.cloneNode();Cr.firstChild&&Cr.firstChild!==Tr;)$r.appendChild(Cr.firstChild);$r.childNodes.length>0&&Cr.parentElement.insertBefore($r,Cr),Cr.parentElement.insertBefore(Tr,Cr),Cr.childNodes.length===0&&Cr.remove()}function unwrapElement(Tr){for(var Cr=Tr.parentNode;Tr.firstChild;)Cr.insertBefore(Tr.firstChild,Tr);Cr.removeChild(Tr)}var HTMLNode=Node$1.create({name:"markdownHTMLNode",addStorage:function(){return{markdown:{serialize:function($r,Ar,Rr){this.editor.storage.markdown.options.html?$r.write(serializeHTML(Ar,Rr)):(console.warn('Tiptap Markdown: "'.concat(Ar.type.name,'" node is only available in html mode')),$r.write("[".concat(Ar.type.name,"]"))),Ar.isBlock&&$r.closeBlock(Ar)},parse:{}}}}});function serializeHTML(Tr,Cr){var $r=Tr.type.schema,Ar=withInitialSchema($r,function(Rr){return getHTMLFromFragment(Fragment.from(Tr),Rr)});return Tr.isBlock&&Cr.type.name===$r.topNodeType.name?formatBlock(Ar):Ar}function formatBlock(Tr){var Cr=elementFromString(Tr),$r=Cr.firstElementChild;return $r.innerHTML=$r.innerHTML.trim()?` `.concat($r.innerHTML,` `):` `,$r.outerHTML}var Blockquote=Node$1.create({name:"blockquote"}),Blockquote$1=Blockquote.extend({addStorage:function(){return{markdown:{serialize:defaultMarkdownSerializer.nodes.blockquote,parse:{}}}}}),BulletList=Node$1.create({name:"bulletList"}),BulletList$1=BulletList.extend({addStorage:function(){return{markdown:{serialize:function($r,Ar){var Rr=this;return $r.renderList(Ar," ",function(){return(Rr.editor.storage.markdown.options.bulletListMarker||"-")+" "})},parse:{}}}}}),CodeBlock=Node$1.create({name:"codeBlock"}),CodeBlock$1=CodeBlock.extend({addStorage:function(){return{markdown:{serialize:function($r,Ar){$r.write("```"+(Ar.attrs.language||"")+` `),$r.text(Ar.textContent,!1),$r.ensureNewLine(),$r.write("```"),$r.closeBlock(Ar)},parse:{setup:function($r){var Ar;$r.set({langPrefix:(Ar=this.options.languageClassPrefix)!==null&&Ar!==void 0?Ar:"language-"})},updateDOM:function($r){$r.innerHTML=$r.innerHTML.replace(/\n<\/code><\/pre>/g,"")}}}}}}),Heading=Node$1.create({name:"heading"}),Heading$1=Heading.extend({addStorage:function(){return{markdown:{serialize:defaultMarkdownSerializer.nodes.heading,parse:{}}}}}),HorizontalRule=Node$1.create({name:"horizontalRule"}),HorizontalRule$1=HorizontalRule.extend({addStorage:function(){return{markdown:{serialize:defaultMarkdownSerializer.nodes.horizontal_rule,parse:{}}}}}),Image$1=Node$1.create({name:"image"}),Image$1$1=Image$1.extend({addStorage:function(){return{markdown:{serialize:defaultMarkdownSerializer.nodes.image,parse:{}}}}}),ListItem=Node$1.create({name:"listItem"}),ListItem$1=ListItem.extend({addStorage:function(){return{markdown:{serialize:defaultMarkdownSerializer.nodes.list_item,parse:{}}}}}),OrderedList=Node$1.create({name:"orderedList"}),OrderedList$1=OrderedList.extend({addStorage:function(){return{markdown:{serialize:defaultMarkdownSerializer.nodes.ordered_list,parse:{}}}}}),Paragraph=Node$1.create({name:"paragraph"}),Paragraph$1=Paragraph.extend({addStorage:function(){return{markdown:{serialize:defaultMarkdownSerializer.nodes.paragraph,parse:{}}}}});function childNodes(Tr){var Cr,$r;return(Cr=Tr==null||($r=Tr.content)===null||$r===void 0?void 0:$r.content)!==null&&Cr!==void 0?Cr:[]}var Table=Node$1.create({name:"table"}),Table$1=Table.extend({addStorage:function(){return{markdown:{serialize:function($r,Ar,Rr){if(!isMarkdownSerializable(Ar)){HTMLNode.storage.markdown.serialize.call(this,$r,Ar,Rr);return}Ar.forEach(function(Dr,Mr,Br){if($r.write("| "),Dr.forEach(function(Lr,Hr,zr){zr&&$r.write(" | ");var Ur=Lr.firstChild;Ur.textContent.trim()&&$r.renderInline(Ur)}),$r.write(" |"),$r.ensureNewLine(),!Br){var Nr=Array.from({length:Dr.childCount}).map(function(){return"---"}).join(" | ");$r.write("| ".concat(Nr," |")),$r.ensureNewLine()}}),$r.closeBlock(Ar)},parse:{}}}}});function hasSpan(Tr){return Tr.attrs.colspan>1||Tr.attrs.rowspan>1}function isMarkdownSerializable(Tr){var Cr=childNodes(Tr),$r=Cr[0],Ar=Cr.slice(1);return!(childNodes($r).some(function(Rr){return Rr.type.name!=="tableHeader"||hasSpan(Rr)})||Ar.some(function(Rr){return childNodes(Rr).some(function(Dr){return Dr.type.name==="tableHeader"||hasSpan(Dr)})}))}var TaskItem=Node$1.create({name:"taskItem"}),TaskItem$1=TaskItem.extend({addStorage:function(){return{markdown:{serialize:function($r,Ar){var Rr=Ar.attrs.checked?"[x]":"[ ]";$r.write("".concat(Rr," ")),$r.renderContent(Ar)},parse:{updateDOM:function($r){_toConsumableArray($r.querySelectorAll(".task-list-item")).forEach(function(Ar){var Rr=Ar.querySelector("input");Ar.setAttribute("data-type","taskItem"),Rr&&(Ar.setAttribute("data-checked",Rr.checked),Rr.remove())})}}}}}}),TaskList=Node$1.create({name:"taskList"}),TaskList$1=TaskList.extend({addStorage:function(){return{markdown:{serialize:BulletList$1.storage.markdown.serialize,parse:{setup:function($r){$r.use(taskListPlugin)},updateDOM:function($r){_toConsumableArray($r.querySelectorAll(".contains-task-list")).forEach(function(Ar){Ar.setAttribute("data-type","taskList")})}}}}}}),Text=Node$1.create({name:"text"}),Text$1=Text.extend({addStorage:function(){return{markdown:{serialize:function($r,Ar){$r.text(escapeHTML(Ar.text))},parse:{}}}}}),Bold=Mark.create({name:"bold"}),Bold$1=Bold.extend({addStorage:function(){return{markdown:{serialize:defaultMarkdownSerializer.marks.strong,parse:{}}}}}),Code=Mark.create({name:"code"}),Code$1=Code.extend({addStorage:function(){return{markdown:{serialize:defaultMarkdownSerializer.marks.code,parse:{}}}}}),Italic=Mark.create({name:"italic"}),Italic$1=Italic.extend({addStorage:function(){return{markdown:{serialize:defaultMarkdownSerializer.marks.em,parse:{}}}}}),Link=Mark.create({name:"link"}),Link$1=Link.extend({addStorage:function(){return{markdown:{serialize:defaultMarkdownSerializer.marks.link,parse:{}}}}}),Strike=Mark.create({name:"strike"}),Strike$1=Strike.extend({addStorage:function(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),markdownExtensions=[Blockquote$1,BulletList$1,CodeBlock$1,HardBreak$1,Heading$1,HorizontalRule$1,HTMLNode,Image$1$1,ListItem$1,OrderedList$1,Paragraph$1,Table$1,TaskItem$1,TaskList$1,Text$1,Bold$1,Code$1,HTMLMark,Italic$1,Link$1,Strike$1];function getMarkdownSpec(Tr){var Cr,$r,Ar=(Cr=Tr.storage)===null||Cr===void 0?void 0:Cr.markdown,Rr=($r=markdownExtensions.find(function(Dr){return Dr.name===Tr.name}))===null||$r===void 0?void 0:$r.storage.markdown;return Ar||Rr?_objectSpread2(_objectSpread2({},Rr),Ar):null}var MarkdownSerializer=function(){function Tr(Cr){_classCallCheck(this,Tr),_defineProperty(this,"editor",null),this.editor=Cr}return _createClass(Tr,[{key:"serialize",value:function($r){var Ar=new MarkdownSerializerState(this.nodes,this.marks);return Ar.renderContent($r),Ar.out}},{key:"nodes",get:function(){var $r=this,Ar;return _objectSpread2(_objectSpread2({},Object.fromEntries(Object.keys(this.editor.schema.nodes).map(function(Rr){return[Rr,$r.serializeNode(HTMLNode)]}))),Object.fromEntries((Ar=this.editor.extensionManager.extensions.filter(function(Rr){return Rr.type==="node"&&$r.serializeNode(Rr)}).map(function(Rr){return[Rr.name,$r.serializeNode(Rr)]}))!==null&&Ar!==void 0?Ar:[]))}},{key:"marks",get:function(){var $r=this,Ar;return _objectSpread2(_objectSpread2({},Object.fromEntries(Object.keys(this.editor.schema.marks).map(function(Rr){return[Rr,$r.serializeMark(HTMLMark)]}))),Object.fromEntries((Ar=this.editor.extensionManager.extensions.filter(function(Rr){return Rr.type==="mark"&&$r.serializeMark(Rr)}).map(function(Rr){return[Rr.name,$r.serializeMark(Rr)]}))!==null&&Ar!==void 0?Ar:[]))}},{key:"serializeNode",value:function($r){var Ar,Rr;return(Ar=getMarkdownSpec($r))===null||Ar===void 0||(Rr=Ar.serialize)===null||Rr===void 0?void 0:Rr.bind({editor:this.editor,options:$r.options})}},{key:"serializeMark",value:function($r){var Ar,Rr=(Ar=getMarkdownSpec($r))===null||Ar===void 0?void 0:Ar.serialize;return Rr?{open:typeof Rr.open=="function"?Rr.open.bind({editor:this.editor,options:$r.options}):Rr.open,close:typeof Rr.close=="function"?Rr.close.bind({editor:this.editor,options:$r.options}):Rr.close}:null}}]),Tr}(),MarkdownParser=function(){function Tr(Cr){_classCallCheck(this,Tr),_defineProperty(this,"editor",null),this.editor=Cr}return _createClass(Tr,[{key:"parse",value:function($r){var Ar=this,Rr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Dr=Rr.inline,Mr=this.editor.storage.markdown.options,Br=Mr.html,Nr=Mr.linkify,Lr=Mr.breaks;if(typeof $r=="string"){var Hr=markdownit({html:Br,linkify:Nr,breaks:Lr});this.editor.extensionManager.extensions.forEach(function(Vr){var jr,Gr,Xr;return(jr=getMarkdownSpec(Vr))===null||jr===void 0||(Gr=jr.parse)===null||Gr===void 0||(Xr=Gr.setup)===null||Xr===void 0?void 0:Xr.call({editor:Ar.editor,options:Vr.options},Hr)});var zr=Hr.render($r),Ur=elementFromString(zr);return this.editor.extensionManager.extensions.forEach(function(Vr){var jr,Gr,Xr;return(jr=getMarkdownSpec(Vr))===null||jr===void 0||(Gr=jr.parse)===null||Gr===void 0||(Xr=Gr.updateDOM)===null||Xr===void 0?void 0:Xr.call({editor:Ar.editor,options:Vr.options},Ur)}),this.normalizeDOM(Ur,{inline:Dr,content:$r}),Ur.innerHTML}return $r}},{key:"normalizeDOM",value:function($r){var Ar=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Rr=Ar.inline,Dr=Ar.content;return this.normalizeBlocks($r),Rr&&this.normalizeInline($r,Dr),$r}},{key:"normalizeBlocks",value:function($r){var Ar=Object.values(this.editor.schema.nodes).filter(function(Dr){return Dr.isBlock}),Rr=Ar.map(function(Dr){var Mr;return(Mr=Dr.spec.parseDOM)===null||Mr===void 0?void 0:Mr.map(function(Br){return Br.tag})}).flat().filter(Boolean).join(",");Rr&&_toConsumableArray($r.querySelectorAll(Rr)).forEach(function(Dr){Dr.parentElement.matches("p")&&extractElement(Dr)})}},{key:"normalizeInline",value:function($r,Ar){if($r.firstElementChild.matches("p")){var Rr,Dr,Mr,Br,Nr=$r.firstElementChild,Lr=Nr.nextSibling,Hr=Nr.nextElementSibling,zr=(Rr=(Dr=Ar.match(/^\s+/))===null||Dr===void 0?void 0:Dr[0])!==null&&Rr!==void 0?Rr:"",Ur=Hr?"":(Mr=(Br=Ar.match(/\s+$/))===null||Br===void 0?void 0:Br[0])!==null&&Mr!==void 0?Mr:"";if((Lr==null?void 0:Lr.nodeType)===Node.TEXT_NODE&&(Lr.textContent=Lr.textContent.replace(/^\n/,"")),Ar.match(/^\n\n/)){Nr.innerHTML="".concat(Nr.innerHTML).concat(Ur);return}unwrapElement(Nr),$r.innerHTML="".concat(zr).concat($r.innerHTML).concat(Ur)}}}]),Tr}(),Markdown=Extension.create({name:"markdown",priority:50,addOptions:function(){return{content:null,html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1}},addCommands:function(){var Cr=extensions.Commands.config.addCommands();return{setContent:function(Ar,Rr,Dr){return function(Mr){return Cr.setContent(Mr.editor.storage.markdown.parser.parse(Ar),Rr,Dr)(Mr)}},insertContentAt:function(Ar,Rr,Dr){return function(Mr){return Cr.insertContentAt(Ar,Mr.editor.storage.markdown.parser.parse(Rr,{inline:!0}),Dr)(Mr)}}}},onBeforeCreate:function(){var Cr=this;this.editor.storage.markdown={options:_objectSpread2({},this.options),parser:new MarkdownParser(this.editor),serializer:new MarkdownSerializer(this.editor),getMarkdown:function(){return Cr.editor.storage.markdown.serializer.serialize(Cr.editor.state.doc)}},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate:function(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage:function(){return{}},addExtensions:function(){return[MarkdownTightLists.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass})]}});const _sfc_main$L=defineComponent({__name:"RichTextCell",props:{content:{},isEditable:{type:Boolean},allowEnter:{type:Boolean},placeholder:{},scale:{},isPreview:{type:Boolean},isHeaderCell:{type:Boolean},formatAsString:{type:Boolean},idToUse:{},blockId:{},colId:{},rowId:{},textAlignment:{},color:{},appId:{},active:{type:Boolean}},emits:["change","focus","blur","keydown"],setup(Tr,{emit:Cr}){useCssVars(wi=>({f1269ffa:si.value,db137fd2:zo.value,"5388f1d6":Uo.value,ec3f3cc0:ko.value,f50ba7c4:Fo.value,90653618:ei.value,"1e24d0a1":$o.value,cd417a5a:qo.value,"9b2d80bc":Go.value,"7af120b2":ri.value,"46adaea3":No.value,"04646ebc":ki.value,"4564904e":Eo.value,"0a036560":Vo.value,"628a6137":ti.value,14832596:Zr.value,"03fef3ca":bo.value,"1d60b56e":Mo.value,"434fcee2":Ko.value,"302833fa":Io.value,"2c719230":vo.value,"63a80eb4":Ro.value,"8ef97b82":Oo.value,f94ac43c:Xo.value,"099d527e":ao.value,fbbc1db2:go.value,"03f88914":mo.value,"86d9263a":io.value,"2218cebc":uo.value,"7ce1347d":ho.value,"18f2089b":yo.value,"4abf0392":co.value}));const $r=inject("isMobile"),Ar=inject("showingFullScreen"),Rr=inject("showingFullPage"),Dr=inject("appId"),Mr=useEditorStore(),Br=useAppStore(),Nr=useBlockStore(),Lr=Tr,{isPreview:Hr,isHeaderCell:zr,formatAsString:Ur,idToUse:Vr}=toRefs$1(Lr),jr=computed(()=>!Hr.value&&!Ar.value&&!Rr.value),Gr=inject("isReadOnly"),Xr=Cr,Kr=ref(null);computed(()=>"start");const Zr=computed(()=>Lr.isEditable?"inline":"none"),{current:eo}=useMagicKeys(),Wr=computed(()=>{var wi,bi;return(bi=(wi=Nr.config(Lr.blockId))==null?void 0:wi.aiResultId)==null?void 0:bi.value}),Yr=inject("selectedBlockId");computed(()=>Yr.value===Lr.blockId);const Jr=usePageStore(),no=computed(()=>Nr.parentId(Lr.blockId)),ro=computed(()=>Br.deckTheme(Lr.appId)),so=computed(()=>Jr.isDividerSlide(no.value||"")&&ro.value!=="yellow"),ao=computed(()=>so.value?"rgba(255, 255, 255, 0.24)":theme.rgbWithOpacity(theme.appTheme().colors.brandPurple,theme.state.softOpacity)),lo=computed(()=>{const wi=Jr.isDividerSlide(no.value||"")&&ro.value!=="yellow",bi=!Jr.isDividerSlide(no.value||"")&&ro.value!=="yellow";return wi||bi}),po=computed(()=>Br.borderRadius(Lr.appId)>0),go=computed(()=>po.value?`${Lr.scale*3}px`:"0px");computed(()=>po.value?`${Lr.scale*3}px`:"0px");const co=computed(()=>["yellow","navy","brown","black"].includes(ro.value)?.5:lo.value?.7:.5),mo=computed(()=>lo.value?"#FFC8CB":"#FFDADC"),io=computed(()=>lo.value?"#FFE7AB":"#FFEEC1"),uo=computed(()=>lo.value?"#C5EBA7":"#D5F5BB"),ho=computed(()=>lo.value?"#C7EBFF":"#B0E3FF"),yo=computed(()=>lo.value?"#E6C7FF":"#EDD8FF"),So=computed(()=>{var li,ci;const wi=(ci=(li=Br.config(Dr))==null?void 0:li.smallText)==null?void 0:ci.value;let bi=`${17*Lr.scale}px`;return $r.value?bi="0.875rem":wi&&(bi=`${14*Lr.scale}px`),{h1:$r.value?`${2.625*Lr.scale}rem`:`${2.625*Lr.scale}rem`,h2:($r.value,"2rem"),h3:$r.value?"1.5rem":"1.25rem",h4:$r.value?"1.188rem":"1.25rem",p:bi,ul:bi,ol:bi}}),ko=computed(()=>So.value.h1),$o=computed(()=>So.value.h2),Go=computed(()=>So.value.h3),No=computed(()=>So.value.h4),Eo=computed(()=>So.value.p),Mo=computed(()=>So.value.ul),Ro=computed(()=>So.value.ol),Ao=computed(()=>12),zo=computed(()=>`${Ao.value}px`),Oo=computed(()=>($r.value,"20px")),Bo=computed(()=>24*Lr.scale),bo=computed(()=>`${Bo.value}px`),vo=computed(()=>`${-1*Bo.value}px`),Io=computed(()=>`${-1*.5*Bo.value}px`),To=computed(()=>Br.getDeckFontFamily(Lr.appId)),Co=computed(()=>(design.fontFamilies[To.value]??design.fontFamilies.default).fonts.heading),Po=computed(()=>(design.fontFamilies[To.value]??design.fontFamilies.default).fonts.body),Fo=computed(()=>`${Co.value}, 'Inter', -apple-system, 'Verdana'`),Vo=computed(()=>`${Po.value}, 'Inter', -apple-system, 'Verdana'`);computed(()=>`${Co.value}, 'Satoshi', 'Inter', -apple-system, 'Verdana'`);const Ko=computed(()=>`${Po.value}, 'Satoshi', 'Inter', -apple-system, 'Verdana'`),Uo=computed(()=>{var wi,bi;return((bi=(wi=design.fontFamilies[To.value])==null?void 0:wi.fontWeight)==null?void 0:bi.h1)??600}),ei=computed(()=>{var wi,bi;return((bi=(wi=design.fontFamilies[To.value])==null?void 0:wi.fontWeight)==null?void 0:bi.h2)??600}),qo=computed(()=>{var wi,bi;return((bi=(wi=design.fontFamilies[To.value])==null?void 0:wi.fontWeight)==null?void 0:bi.h3)??600}),ri=computed(()=>{var wi,bi;return((bi=(wi=design.fontFamilies[To.value])==null?void 0:wi.fontWeight)==null?void 0:bi.h4)??500});computed(()=>{var wi,bi;return((bi=(wi=design.fontFamilies[To.value])==null?void 0:wi.fontWeight)==null?void 0:bi.h5)??400});const ki=computed(()=>{var wi,bi;return((bi=(wi=design.fontFamilies[To.value])==null?void 0:wi.fontWeight)==null?void 0:bi.p)??400}),ti=computed(()=>"rgba(0, 0, 0, 0.16)"),ai=computed(()=>Br.getThemeObject(Lr.appId,no.value||"")),Xo=computed(()=>{var wi,bi;return((bi=(wi=ai.value)==null?void 0:wi.link)==null?void 0:bi.color)??theme.appTheme().colors.brandPurple}),si=computed(()=>Po.value==="Aspekta"?"'ss02' on":"inherit");Extension.create({name:"keymapCustom",addKeyboardShortcuts(){return{"Shift-Enter":()=>(this.editor.commands.enter(),!0)}}});const vi=wi=>{if(Ur!=null&&Ur.value){Xr("change",{value:wi.getText()});return}Xr("change",{value:Mr.getContentToSave(wi)})},Ci=useEditor({content:Lr.content,editable:Lr.isEditable,autofocus:!1,extensions:[StarterKit.configure({dropcursor:{width:2,color:!1,class:"editor-drop-cursor"},hardBreak:!1,heading:!1,history:{depth:100,newGroupDelay:100},horizontalRule:!1,bulletList:!1,orderedList:!1}),BulletList$3.configure({keepMarks:!0,keepAttributes:!0}),OrderedList$3.configure({keepMarks:!0,keepAttributes:!0}),TextAlign.configure({types:["paragraph","heading"],alignments:["left","center","right"],defaultAlignment:"left"}),TextStyle$2,Typography,Heading$3,CustomHighlight.configure({HTMLAttributes:{class:"prezo-highlight"},multicolor:!0}),Link$2.configure({HTMLAttributes:{class:"prezo-link"},protocols:["ftp","mailto"],openOnClick:!1}),Markdown.configure({html:!1}),Placeholder.configure({placeholder:()=>Lr.placeholder,showOnlyCurrent:!1,includeChildren:!0}),HardBreak$2.extend({addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.isActive("orderedList")||this.editor.isActive("bulletList")?this.editor.commands.setHardBreak():this.editor.commands.setHardBreak()}}})],editorProps:{attributes:{},handleKeyDown:(wi,bi)=>{if(bi.key==="Escape"&&wi.dom.blur(),!(!Lr.allowEnter&&bi.key==="Enter"&&eo.has("shift"))){if(!Lr.allowEnter&&bi.key==="Enter"&&!eo.has("shift"))return bi.preventDefault(),Xr("keydown",bi),!0;Xr("keydown",bi)}},scrollThreshold:108,scrollMargin:108},onFocus:({editor:wi})=>{Xr("focus"),jr.value&&Mr.setTableRef(wi)},onBlur:()=>{Xr("blur"),Mr.hideLinkPreview()},onUpdate:({editor:wi})=>{jr.value&&vi(wi)},onSelectionUpdate:({transaction:wi})=>{var li;const bi=window.getSelection();if(wi.selection.empty){const ci=hasClassOrAncestorHasClass((li=bi==null?void 0:bi.anchorNode)==null?void 0:li.parentElement,"prezo-link");if(ci){const Ii=ci.getBoundingClientRect();Mr.showLinkPreview({url:ci.href,position:{x:Ii.left+Ii.width/2,y:Ii.bottom+8}})}else Mr.hideLinkPreview()}else Mr.hideLinkPreview()}});return jr.value&&Mr.setTableEditors(Ci,{blockId:Lr.blockId,colId:Lr.colId,rowId:Lr.rowId}),watchEffect(()=>{Ci.value&&Lr.isEditable!==Ci.value.isEditable&&Ci.value.setEditable(Lr.isEditable)}),onMounted(()=>{Ci.value&&Lr.textAlignment&&Ci.value.chain().selectAll().setTextAlign(Lr.textAlignment).run()}),watch(()=>Lr.textAlignment,()=>{Ci.value&&Lr.textAlignment&&Ci.value.chain().selectAll().setTextAlign(Lr.textAlignment).run()}),Gr.value||(watch(Wr,()=>{Ci.value&&Lr.content&&Ci.value.commands.setContent(Lr.content)}),watch(()=>Lr.active,wi=>{var bi;wi||(bi=Ci.value)==null||bi.commands.blur()})),(wi,bi)=>(openBlock(),createElementBlock("div",{ref_key:"wrapperElement",ref:Kr,class:normalizeClass(["rich-input editor-wrapper w-full h-full flex flex-col grow justify-start",{"cursor-auto":Lr.isEditable,"header-cell":Lr.isHeaderCell}]),style:normalizeStyle({color:Lr.color})},[createVNode(unref(EditorContent),{editor:unref(Ci),class:normalizeClass(["h-full",{"my-auto":!0,"rich-input":!0,editable:!unref(Rr)}]),spellcheck:"false"},null,8,["editor","class"])],6))}}),RichTextCell_vue_vue_type_style_index_0_lang="",_hoisted_1$u={key:0,class:"shadow-class",style:{zIndex:10,top:0,left:0,width:"100%",height:"100%"}},_hoisted_2$p={key:1,class:"cell-curtain"},_sfc_main$K=defineComponent({__name:"TableCell",props:{row:{},col:{},cell:{},scale:{},isPreview:{type:Boolean},isEditable:{type:Boolean},showSelection:{type:Boolean},isHeaderCell:{type:Boolean},isBottomLeftCorner:{type:Boolean},isBottomRightCorner:{type:Boolean},isTopLeftCorner:{type:Boolean},isTopRightCorner:{type:Boolean},borderRadius:{},blockId:{},cellTextColor:{},lightUpColor:{},deckHasBorderRadius:{type:Boolean},background:{},animationDelay:{default:0},animationDuration:{default:300},showAnimation:{type:Boolean,default:!1}},emits:["change","focus","blur"],setup(Tr,{emit:Cr}){useCssVars(io=>({dcb267ac:Kr.value,"9abe3bc8":eo.value,dafbc0ea:Wr.value,"0a017796":Yr.value,27343951:Jr.value,"5a5e1e86":mo.value,"070fdacd":Xr.value,"211eeab2":Gr.value,"485d359e":jr.value}));const $r=Tr,{cell:Ar,showSelection:Rr,isHeaderCell:Dr,scale:Mr}=toRefs$1($r),Br=inject("isMobile"),Nr=inject("appId"),Lr=Cr,Hr=useAppStore(),zr=useBlockStore(),Ur=usePageStore(),Vr=useTableStore(),jr=computed(()=>`${$r.animationDelay}ms`),Gr=computed(()=>`${$r.animationDuration}ms`),Xr=computed(()=>`inset 0 0 0 ${2*$r.scale}px ${$r.lightUpColor}`),Kr=computed(()=>$r.deckHasBorderRadius?Br.value?design.cornerRadius.table.cell.mobile:Hr.smallText(Nr)?design.cornerRadius.table.cell.small:design.cornerRadius.table.cell.default:"0px"),Zr=computed(()=>$r.deckHasBorderRadius?`${$r.borderRadius*$r.scale}px`:"0px"),eo=computed(()=>$r.isBottomLeftCorner?Zr.value:Kr.value),Wr=computed(()=>$r.isBottomRightCorner?Zr.value:Kr.value),Yr=computed(()=>$r.isTopLeftCorner?Zr.value:Kr.value),Jr=computed(()=>$r.isTopRightCorner?Zr.value:Kr.value),no=computed(()=>{var io,uo;return(uo=(io=Hr.config(Nr))==null?void 0:io.smallText)==null?void 0:uo.value}),ro=computed(()=>{if(Br.value)return`${design.padding.table.cell.vertical.mobile}px ${design.padding.table.cell.horizontal.mobile}px`;let io=design.padding.table.cell.vertical.default,uo=design.padding.table.cell.horizontal.default;return no.value&&(io=design.padding.table.cell.vertical.small,uo=design.padding.table.cell.horizontal.small),`${$r.scale*io}px ${$r.scale*uo}px`}),so=io=>typeof io=="number"?io.toString():io??"",ao=computed(()=>Vr.rowIdsBeingDragged),lo=computed(()=>Vr.colIdsBeingDragged),po=computed(()=>!$r.isPreview&&ao.value.includes(`row-${$r.row.id}`)||lo.value.includes($r.col.id)),go=computed(()=>Hr.deckTheme(Nr)),co=computed(()=>Ur.isDividerSlide(zr.parentId($r.blockId)||"")),mo=computed(()=>{if(!co.value)return"#F9F9F9";switch(go.value){case"red":return"#E7353E";case"orange":return"#F17833";case"yellow":return"#FFD977";case"green":return"#5CB75A";case"blue":return"#2197ED";case"navy":return"#2036A6";case"purple":return"#9C56F1";case"pink":return"#F569AD";case"brown":return"#70461F";case"black":return"#1F1C1C";default:return"#F9F9F9"}});return(io,uo)=>{var ho;return openBlock(),createElementBlock("div",{class:normalizeClass(["w-full sm:h-full flex items-center text-start relative",{"bring-in-cell":io.showAnimation}]),style:normalizeStyle({background:po.value?mo.value:io.background})},[createVNode(_sfc_main$L,{onFocus:uo[0]||(uo[0]=yo=>Lr("focus")),onBlur:uo[1]||(uo[1]=yo=>Lr("blur")),onClick:uo[2]||(uo[2]=yo=>Lr("focus")),onChange:uo[3]||(uo[3]=yo=>Lr("change",yo.value)),isEditable:io.isEditable,isPreview:io.isPreview,allowEnter:io.col.type==="text",content:so(unref(Ar).value),placeholder:"",style:normalizeStyle({padding:ro.value}),scale:unref(Mr),isHeaderCell:unref(Dr),blockId:$r.blockId,colId:io.col.id,rowId:io.row.id,textAlignment:((ho=io.col.style)==null?void 0:ho.textAlignment)??"left",color:io.cellTextColor,appId:unref(Nr)??"",active:unref(Rr)},null,8,["isEditable","isPreview","allowEnter","content","style","scale","isHeaderCell","blockId","colId","rowId","textAlignment","color","appId","active"]),unref(Rr)?(openBlock(),createElementBlock("div",_hoisted_1$u)):createCommentVNode("",!0),po.value?(openBlock(),createElementBlock("div",_hoisted_2$p)):createCommentVNode("",!0)],6)}}}),TableCell_vue_vue_type_style_index_0_scoped_104f2568_lang="",TableCell=_export_sfc(_sfc_main$K,[["__scopeId","data-v-104f2568"]]);function useDraggable(Tr,Cr={}){const{pointerTypes:$r,preventDefault:Ar,stopPropagation:Rr,exact:Dr,onMove:Mr,onEnd:Br,onStart:Nr,initialValue:Lr,axis:Hr="both",draggingElement:zr=window,handle:Ur=Tr}=Cr,Vr=ref(toValue(Lr)??{x:0,y:0}),jr=ref(),Gr=Yr=>$r?$r.includes(Yr.pointerType):!0,Xr=Yr=>{toValue(Ar)&&Yr.preventDefault(),toValue(Rr)&&Yr.stopPropagation()},Kr=Yr=>isRef(Yr)?toValue(Yr):typeof Yr=="function"?toValue(Yr()):Yr,Zr=Yr=>{if(!Gr(Yr)||toValue(Dr)&&Yr.target!==Kr(Tr))return;const Jr=Kr(Tr).getBoundingClientRect(),no={x:Yr.clientX-Jr.left,y:Yr.clientY-Jr.top};(Nr==null?void 0:Nr(no,Yr))!==!1&&(jr.value=no,Xr(Yr))},eo=Yr=>{if(!Gr(Yr)||!jr.value)return;let{x:Jr,y:no}=Vr.value;(Hr==="x"||Hr==="both")&&(Jr=Yr.clientX-jr.value.x),(Hr==="y"||Hr==="both")&&(no=Yr.clientY-jr.value.y),(Mr==null?void 0:Mr({x:Jr,y:no},Yr))!==!1&&(Vr.value={x:Jr,y:no},Xr(Yr))},Wr=Yr=>{Gr(Yr)&&jr.value&&(jr.value=void 0,Br==null||Br(Vr.value,Yr),Xr(Yr))};if(isClient$1){const Yr={capture:Cr.capture??!0};useEventListener(Ur,"pointerdown",Zr,Yr),useEventListener(zr,"pointermove",eo,Yr),useEventListener(zr,"pointerup",Wr,Yr)}return{...toRefs(Vr),position:Vr,isDragging:computed(()=>!!jr.value),style:computed(()=>`left:${Vr.value.x}px;top:${Vr.value.y}px;`)}}const _sfc_main$J=defineComponent({__name:"TableResizer",props:{onStart:{type:Function},onMove:{type:Function},onEnd:{type:Function},cleanup:{type:Function},initialValue:{},height:{},width:{},paddingX:{},opacity:{},isDark:{type:Boolean},fullTableX:{},fullTableY:{}},emits:["mouseover","mouseleave"],setup(Tr,{emit:Cr}){const $r=Tr,{initialValue:Ar}=toRefs$1($r),Rr=ref(null),{position:Dr}=useDraggable(Rr,{initialValue:Ar,preventDefault:!0,axis:"x",onStart:$r.onStart,onMove:$r.onMove,onEnd:$r.onEnd});onBeforeUnmount(()=>{$r.cleanup()});const Mr=ref(null),Br=ref(!1);return useEventListener(document,"wheel",Nr=>{Br.value=!0,Mr.value!=null&&clearTimeout(Mr.value),Mr.value=setTimeout(()=>{Mr.value=null,Br.value=!1},100)},{passive:!1}),(Nr,Lr)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["fixed z-[9] select-none cursor-move table-buttons",{"pointer-events-none":Br.value,"pointer-events-auto":!Br.value}]),style:normalizeStyle([{"touch-action":"none"},{left:`${unref(Dr).x-Nr.fullTableX}px`,top:`${unref(Dr).y-Nr.fullTableY}px`,height:Nr.height,width:Nr.width,paddingRight:Nr.paddingX,paddingLeft:Nr.paddingX,opacity:Nr.opacity,cursor:"col-resize"}]),ref_key:"resizerRef",ref:Rr,onMouseover:Lr[0]||(Lr[0]=Hr=>Nr.$emit("mouseover")),onMouseleave:Lr[1]||(Lr[1]=Hr=>Nr.$emit("mouseleave"))},[createBaseVNode("div",{class:"w-full h-full rounded-lg",style:normalizeStyle({background:Nr.isDark?"rgba(255, 255, 255, 0.32)":"hsla(0, 0%, 0%, 0.16)"})},null,4)],38))}}),_sfc_main$I={},_hoisted_1$t={class:"h-[17px] font-semibold text-center px-1 text-[#AB67FF] text-[10px] bg-[#F3E8FD] rounded flex items-center custom-truncate",style:{"max-width":"40px"}},_hoisted_2$o=createBaseVNode("div",null,"PRO",-1),_hoisted_3$j=[_hoisted_2$o];function _sfc_render$6(Tr,Cr){return openBlock(),createElementBlock("div",_hoisted_1$t,_hoisted_3$j)}const PROTag=_export_sfc(_sfc_main$I,[["render",_sfc_render$6]]),_hoisted_1$s=["onClick"],_hoisted_2$n={class:"flex items-center gap-2"},_hoisted_3$i={class:"label-medium"},_hoisted_4$f=createBaseVNode("div",{class:"flex items-center self-stretch gap-1 rounded-lg py-2 px-1"},[createBaseVNode("hr",{class:"h-[1px] grow shrink-0 basis-0 bg-neutralSolid-50"})],-1),_hoisted_5$b=["onClick"],_hoisted_6$a={class:"flex items-center gap-2"},_hoisted_7$9={class:"label-medium"},_sfc_main$H=defineComponent({__name:"ColorsList",props:{position:{},colorId:{},colors:{},isHighlight:{type:Boolean}},emits:["highlight"],setup(Tr,{emit:Cr}){const $r=Cr,Ar=lodashExports.cloneDeep(theme.textOpacities),Rr=Dr=>{$r("highlight",Dr)};return(Dr,Mr)=>(openBlock(),createBlock(unref(be),{as:"ul",class:"highlight-menu dropdown-menu absolute w-[198px]",style:normalizeStyle({top:`${Dr.position.top}px`,..."left"in Dr.position?{left:`${Dr.position.left}px`}:{},..."right"in Dr.position?{right:`${Dr.position.right}px`}:{},zIndex:1})},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(unref(Ar),Br=>(openBlock(),createBlock(unref(Me),{key:Br.id},{default:withCtx(({})=>[createBaseVNode("li",{class:"dropdown-menu-button",onClick:Nr=>Rr(Br.id)},[createBaseVNode("div",_hoisted_2$n,[createVNode(_sfc_main$1v,{src:unref(assetUrl)(`icon-text-${Br.id}.svg`),vProps:{width:20,height:20}},null,8,["src"]),createBaseVNode("label",_hoisted_3$i,toDisplayString(Br.name),1)]),Dr.colorId===Br.id?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)("icon-check.svg"),"v-props":{width:"16px",height:"16px",stroke:"#323F4B"}},null,8,["src"])):createCommentVNode("",!0)],8,_hoisted_1$s)]),_:2},1024))),128)),_hoisted_4$f,(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Dr.colors,Br=>(openBlock(),createBlock(unref(Me),{key:Br.id},{default:withCtx(({})=>[createBaseVNode("li",{class:"dropdown-menu-button",onClick:Nr=>Rr(Br.id)},[createBaseVNode("div",_hoisted_6$a,[createVNode(_sfc_main$1v,{src:unref(assetUrl)(`icon-inner-highlight-${Br.id}.svg`),vProps:{width:20,height:20}},null,8,["src"]),createBaseVNode("label",_hoisted_7$9,toDisplayString(Br.name)+" "+toDisplayString(Dr.isHighlight?"highlight":"background"),1)]),Dr.colorId===Br.id?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)("icon-check.svg"),"v-props":{width:"16px",height:"16px",stroke:"#323F4B"}},null,8,["src"])):createCommentVNode("",!0)],8,_hoisted_5$b)]),_:2},1024))),128))]),_:1},8,["style"]))}}),_hoisted_1$r=["onClick"],_hoisted_2$m={class:"relative flex w-full"},_hoisted_3$h={class:"flex items-center grow shrink-0 basis-0 gap-2"},_hoisted_4$e={class:"text-left grow shrink-0 basis-0 label-medium text-neutralSolid-1000"},_hoisted_5$a=["onClick"],_hoisted_6$9={class:"flex items-center grow shrink-0 basis-0 gap-2"},COLOR_LIST_WIDTH=208,_sfc_main$G=defineComponent({__name:"MenuWithExpandOption",props:{idToUse:{},items:{default:()=>[]},dropdownWidth:{default:180},open:{type:Boolean},blockId:{},colorId:{default:"default"},colors:{default:()=>lodashExports.cloneDeep(theme.tableColors)},shouldShiftSecondaryMenu:{type:Boolean}},emits:["selected-item-id","clicked-outside","close"],setup(Tr,{expose:Cr,emit:$r}){useCssVars(jr=>({"5ac4ea1c":Nr.value.fontSize.f4}));const Ar=$r,Rr=Tr,{items:Dr,dropdownWidth:Mr,open:Br}=toRefs$1(Rr),Nr=computed(()=>theme.appTheme()),Lr=ref(null),Hr=(jr,Gr)=>{Ar("selected-item-id",{id:Gr==null?void 0:Gr.id})},zr=ref(null);onClickOutside(zr,()=>{Ar("clicked-outside")});const Ur=useElementBounding$1(zr);Cr({menuItems:zr,menuItemsBounding:Ur});const Vr=jr=>{Ar("selected-item-id",{id:"color",color:jr})};return(jr,Gr)=>(openBlock(),createBlock(Transition,{label:"fade"},{default:withCtx(()=>[createVNode(unref(ge$2),{as:"div",class:"menu",nullable:""},{default:withCtx(()=>[createVNode(unref(be),{as:"div",class:"menu-items headless-tracker",style:normalizeStyle({zIndex:unref(Br)?1:0,width:`${unref(Mr)}px`}),ref_key:"menuItems",ref:zr,static:"",onKeydown:Gr[1]||(Gr[1]=withKeys(Xr=>Ar("close"),["esc"]))},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(unref(Dr),Xr=>(openBlock(),createBlock(unref(Me),{as:"template",key:Xr==null?void 0:Xr.id,value:Xr},{default:withCtx(({active:Kr})=>[(Xr==null?void 0:Xr.type)==="boolean"?(openBlock(),createElementBlock("div",{key:0,class:"menu-item-toggle",style:normalizeStyle({background:Kr?Nr.value.palette.neutral[50]:Nr.value.palette.neutral[0]})},[createBaseVNode("div",{onClick:withModifiers(Zr=>Hr(Zr,Xr),["stop"]),class:"menu-item",style:normalizeStyle({background:Kr?Nr.value.palette.neutral[100]:Nr.value.palette.neutral[0]})},[createBaseVNode("span",null,toDisplayString(Xr==null?void 0:Xr.label),1),createVNode(Toggle,{isOn:!!Xr.value,style:{marginLeft:"0px"}},null,8,["isOn"])],12,_hoisted_1$r)],4)):(Xr==null?void 0:Xr.type)==="menu"?(openBlock(),createBlock(unref(ge$2),{key:1,as:"div"},{default:withCtx(()=>[createBaseVNode("div",_hoisted_2$m,[createVNode(unref(Se$1),{class:"w-full",onKeydown:Gr[0]||(Gr[0]=withKeys(Zr=>Ar("close"),["esc"]))},{default:withCtx(()=>[createBaseVNode("div",{ref_for:!0,ref_key:"secondaryMenuButton",ref:Lr,class:"secondary-menu-button menu-item hover:bg-neutralSolid-50 active:bg-neutralSolid-100"},[createBaseVNode("div",_hoisted_3$h,[Xr.icon?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)(Xr.icon),vProps:{height:20,width:20}},null,8,["src"])):createCommentVNode("",!0),createBaseVNode("label",_hoisted_4$e,toDisplayString(Xr==null?void 0:Xr.label),1)]),createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-chevron-right-2.svg"),vProps:{height:16,width:16}},null,8,["src"])],512)]),_:2},1024),createVNode(Transition,{label:"fade"},{default:withCtx(()=>[Xr.id==="color"?(openBlock(),createBlock(_sfc_main$H,{key:0,colorId:jr.colorId,colors:jr.colors,position:{left:jr.shouldShiftSecondaryMenu?-5-COLOR_LIST_WIDTH:unref(Mr)-5,top:-5},onHighlight:Vr},null,8,["colorId","colors","position"])):createCommentVNode("",!0)]),_:2},1024)])]),_:2},1024)):(openBlock(),createElementBlock("div",{key:2,onClick:Zr=>Hr(Zr,Xr),class:"menu-item hover:bg-neutralSolid-50 active:bg-neutralSolid-100"},[createBaseVNode("div",_hoisted_6$9,[Xr.icon?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)(Xr.icon),vProps:{height:20,width:20}},null,8,["src"])):createCommentVNode("",!0),createBaseVNode("label",{class:normalizeClass(["grow shrink-0 basis-0 label-medium",{"text-[#DB3033]":Xr.id==="delete","text-neutralSolid-1000":Xr.id!="delete"}])},toDisplayString(Xr==null?void 0:Xr.label),3),Xr.isProFeature?(openBlock(),createBlock(PROTag,{key:1})):createCommentVNode("",!0)])],8,_hoisted_5$a))]),_:2},1032,["value"]))),128))]),_:1},8,["style"])]),_:1})]),_:1}))}}),MenuWithExpandOption_vue_vue_type_style_index_0_scoped_de09461e_lang="",MenuWithExpandOption=_export_sfc(_sfc_main$G,[["__scopeId","data-v-de09461e"]]),_withScopeId$3=Tr=>(pushScopeId("data-v-7b215394"),Tr=Tr(),popScopeId(),Tr),_hoisted_1$q=["onClick"],_hoisted_2$l=_withScopeId$3(()=>createBaseVNode("div",{class:"flex items-center self-stretch gap-1 rounded-lg py-2 px-1"},[createBaseVNode("hr",{class:"h-[1px] grow shrink-0 basis-0 bg-neutralSolid-50"})],-1)),MENU_WIDTH$1=182,SECONDARY_MENU_MAX_WIDTH$1=208,_sfc_main$F=defineComponent({__name:"TableColumnSelectionPane",props:{selectedBlockId:{},selectedColumnId:{},rowId:{},showAddButtons:{type:Boolean},showDeleteButton:{type:Boolean}},emits:["close","insertLeft","insertRight","duplicate","clearContent","delete"],setup(Tr,{emit:Cr}){const $r=Tr,{selectedBlockId:Ar,showAddButtons:Rr,showDeleteButton:Dr}=toRefs$1($r),Mr=Cr,Br=useBlockStore(),Nr=useCommandBarStore(),Lr=useMiscStore(),Hr=useArtboardStore(),zr=useWindowSize(),Ur=ref(!1),Vr=ref(null),jr=ref(null),Gr=ref(null),Xr=inject("showingFullPage"),Kr=inject("showingFullScreen"),Zr=computed(()=>`${$r.selectedBlockId}-${$r.selectedColumnId}-${$r.rowId}`),eo=computed(()=>Kr.value||Xr.value),Wr=useElementBounding$1(Vr),Yr=useElementBounding$1(jr),Jr=useElementBounding$1(Gr),no=computed(()=>{const{x:vo,y:Io,isClampedY:To}=artboardLogic.calculatePostionForMenuNoOverlapHorizontalReactive({blockRect:Yr,paneRect:Wr,windowSize:zr});return{top:To?Io:Io-Jr.top.value,left:To?vo:vo-Jr.left.value,width:MENU_WIDTH$1,isClampedY:To,showing:!(Jr.bottom.value<0||Yr.top.value>zr.height.value)}}),ro=computed(()=>{if(no.value===void 0)return!1;const{left:vo}=no.value;return no.value.isClampedY?vo+MENU_WIDTH$1+SECONDARY_MENU_MAX_WIDTH$1+16>zr.width.value:Jr.left.value+vo+MENU_WIDTH$1+SECONDARY_MENU_MAX_WIDTH$1+16>zr.width.value}),so=lodashExports.cloneDeep(theme.tableColors),ao=lodashExports.cloneDeep(theme.textOpacities),lo=ao.map(vo=>vo.id),po=vo=>{var Co,Po,Fo,Vo,Ko,Uo,ei;if(!$r.selectedBlockId||$r.selectedColumnId==null)return;const Io=((Co=so.find(qo=>qo.id===vo))==null?void 0:Co.id)??"#FFFFFF",To=((Po=so.find(qo=>qo.id===vo))==null?void 0:Po.id)??"#0D0C0C";Br.updateProps($r.selectedBlockId,{keyPath:["config","colStore","value","store",$r.selectedColumnId,"style"],value:{...(ei=(Uo=(Ko=(Vo=(Fo=Br.config($r.selectedBlockId))==null?void 0:Fo.colStore)==null?void 0:Vo.value)==null?void 0:Ko.store)==null?void 0:Uo[$r.selectedColumnId])==null?void 0:ei.style,background:Io,color:To,timestamp:Date.now()}}),Ir.capture("change_table_column_background_color",{color:vo,blockId:Ar.value})},go=vo=>{var To,Co,Po,Fo,Vo,Ko;if(!$r.selectedBlockId||$r.selectedColumnId==null)return;const Io=((To=ao.find(Uo=>Uo.id===vo))==null?void 0:To.id)??"default";Br.updateProps($r.selectedBlockId,{keyPath:["config","colStore","value","store",$r.selectedColumnId,"style"],value:{...(Ko=(Vo=(Fo=(Po=(Co=Br.config($r.selectedBlockId))==null?void 0:Co.colStore)==null?void 0:Po.value)==null?void 0:Fo.store)==null?void 0:Vo[$r.selectedColumnId])==null?void 0:Ko.style,color:Io,timestamp:Date.now()}}),Ir.capture("change_table_column_text_opacity",{color:vo,blockId:Ar.value})},{isContextMenuOpen:co}=inject("isContextMenuOpen"),mo=inject("selectionMenuBlockId"),{popoverState:io}=inject("popoverState"),uo=computed(()=>Object.values(io.value).some(vo=>vo));watch(uo,()=>{log(`is any popover showing, ${uo.value}`),uo.value&&(mo.value=null)}),watch(co,()=>{co.value&&(mo.value=null)});const ho=computed(()=>Nr.getIsCommandBarOpen);watch(ho,()=>{ho.value&&(mo.value=null)});const yo=computed(()=>Lr.getIsSlideInTransition),So=computed(()=>Hr.isAnyBlockResizing);watchEffect(()=>{if(Ur.value=!!$r.selectedBlockId&&!!mo.value&&$r.selectedBlockId===mo.value&&!eo.value&&!Br.dragBlockId&&!So.value&&!yo.value,Ur.value){const vo=document.getElementById(Zr.value);vo instanceof HTMLElement&&(jr.value=vo);const Io=document.getElementById(`tableBlock-${$r.selectedBlockId}`);Io instanceof HTMLElement&&(Gr.value=Io)}});const ko=()=>{Mr("close")},$o=()=>{nextTick(()=>{var vo;Ur.value&&((vo=Vr.value)==null||vo.focus())})};onMounted(()=>{$o()}),watch(Ur,()=>{$o()});const Go=computed(()=>{var vo,Io,To,Co,Po,Fo;return $r.selectedColumnId?((Fo=(Po=(Co=(To=(Io=(vo=Br.config($r.selectedBlockId))==null?void 0:vo.colStore)==null?void 0:Io.value)==null?void 0:To.store)==null?void 0:Co[$r.selectedColumnId])==null?void 0:Po.style)==null?void 0:Fo.background)??"":""}),No=computed(()=>{var vo,Io,To,Co,Po,Fo;return $r.selectedColumnId?((Fo=(Po=(Co=(To=(Io=(vo=Br.config($r.selectedBlockId))==null?void 0:vo.colStore)==null?void 0:Io.value)==null?void 0:To.store)==null?void 0:Co[$r.selectedColumnId])==null?void 0:Po.style)==null?void 0:Fo.color)??"":""}),Eo=computed(()=>!No.value&&!Go.value?"default":lo.includes(No.value)?No.value:Go.value),Mo=computed(()=>lo.includes(Eo.value)?`icon-highlighter-${Eo.value}.svg`:`icon-highlighter-${Eo.value}-v2.svg`),Ro=computed(()=>{let vo=[{id:"color",type:"menu",label:"Color",icon:Mo.value},{id:"insertLeft",label:"Insert left",icon:"icon-prev.svg"},{id:"insertRight",label:"Insert right",icon:"icon-next.svg"},{id:"duplicate",label:"Duplicate",icon:"icon-duplicate.svg"},{id:"clearContent",label:"Clear content",icon:"icon-clear-circle.svg"},{id:"delete",label:"Delete",icon:"icon-trash-16px-1.svg"}];return Rr.value||(vo=vo.filter(Io=>Io.id!=="insertLeft"&&Io.id!=="insertRight"&&Io.id!=="duplicate")),Dr.value||(vo=vo.filter(Io=>Io.id!=="delete")),vo}),Ao=({id:vo,...Io})=>{$r.selectedBlockId&&$r.selectedColumnId!=null&&(vo==="insertLeft"&&Mr("insertLeft",{colId:$r.selectedColumnId}),vo==="insertRight"&&Mr("insertRight",{colId:$r.selectedColumnId}),vo==="duplicate"&&Mr("duplicate",{colId:$r.selectedColumnId}),vo==="clearContent"&&(Mr("clearContent",{colId:$r.selectedColumnId}),ko()),vo==="delete"&&Mr("delete",{colId:$r.selectedColumnId}),vo==="color"&&(lo.includes(Io.color)?go(Io.color):po(Io.color),ko()))},zo={text:[{id:"left",icon:"text-align-left-2"},{id:"center",icon:"text-align-center-2"},{id:"right",icon:"text-align-right-2"}]},Oo=vo=>{$r.selectedBlockId&&$r.selectedColumnId!=null&&(Br.updateProps($r.selectedBlockId,{keyPath:["config","colStore","value","store",$r.selectedColumnId,"style","textAlignment"],value:vo}),Ir.capture("change_text_alignment_table",{alignment:vo,blockId:$r.selectedBlockId,source:"row menu"}))},Bo=vo=>{var To,Co,Po,Fo,Vo,Ko;return!$r.selectedBlockId||!$r.selectedColumnId?!1:(((Ko=(Vo=(Fo=(Po=(Co=(To=Br.config($r.selectedBlockId))==null?void 0:To.colStore)==null?void 0:Co.value)==null?void 0:Po.store)==null?void 0:Fo[$r.selectedColumnId])==null?void 0:Vo.style)==null?void 0:Ko.textAlignment)??"left")===vo},bo=vo=>{vo.stopPropagation(),ko()};return(vo,Io)=>(openBlock(),createBlock(Teleport,{to:no.value.isClampedY?"#main-app":`#teleport-${unref(Ar)}`},[createVNode(Transition,{name:"pane-fade",appear:""},{default:withCtx(()=>[Ur.value&&no.value.showing?(openBlock(),createElementBlock("div",{key:0,tabindex:"0",ref_key:"paneElement",ref:Vr,onKeydown:withKeys(bo,["esc"]),class:"block-menu table-menu",style:normalizeStyle({top:`${no.value.top}px`,left:`${no.value.left}px`,width:`${no.value.width}px`,position:no.value.isClampedY?"fixed":"absolute"})},[(openBlock(),createElementBlock(Fragment$1,null,renderList(zo,(To,Co)=>createBaseVNode("div",{key:Co,class:"flex items-center self-stretch gap-1 p-1 pb-0"},[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(To,Po=>(openBlock(),createElementBlock("button",{key:Po.id,class:normalizeClass(["flex justify-center items-center h-8 grow shrink-0 basis-0 py-1.5 px-4 rounded-lg active:bg-neutralSolid-100 transition",{"bg-neutralSolid-100":Co==="text"&&Bo(Po.id),"hover:bg-neutralSolid-50":!(Co==="text"&&Bo(Po.id))}]),onClick:Fo=>Oo(Po.id)},[createVNode(_sfc_main$1v,{src:unref(assetUrl)(`icon-${Po.icon}.svg`),vProps:{width:16,height:16}},null,8,["src"])],10,_hoisted_1$q))),128))])),64)),_hoisted_2$l,createVNode(MenuWithExpandOption,{items:Ro.value,dropdownWidth:MENU_WIDTH$1,open:Ur.value,block:unref(Ar),idToUse:Zr.value,onSelectedItemId:Ao,onClose:Io[0]||(Io[0]=To=>Mr("close")),colorId:Eo.value,colors:unref(so),shouldShiftSecondaryMenu:ro.value},null,8,["items","open","block","idToUse","colorId","colors","shouldShiftSecondaryMenu"])],36)):createCommentVNode("",!0)]),_:1})],8,["to"]))}}),TableColumnSelectionPane_vue_vue_type_style_index_0_scoped_7b215394_lang="",TableColumnSelectionPane=_export_sfc(_sfc_main$F,[["__scopeId","data-v-7b215394"]]),MENU_WIDTH=168,SECONDARY_MENU_MAX_WIDTH=208,_sfc_main$E=defineComponent({__name:"TableRowSelectionPane",props:{selectedBlockId:{},selectedRowId:{},columnId:{},showAddButtons:{type:Boolean},showDeleteButton:{type:Boolean}},emits:["close","insertAbove","insertBelow","duplicate","clearContent","delete"],setup(Tr,{emit:Cr}){const $r=Tr,Ar=Cr,{selectedBlockId:Rr,showAddButtons:Dr,showDeleteButton:Mr}=toRefs$1($r),Br=useBlockStore(),Nr=useCommandBarStore(),Lr=useMiscStore(),Hr=useArtboardStore(),zr=useWindowSize(),Ur=ref(!1),Vr=ref(null),jr=ref(null),Gr=ref(null),Xr=inject("showingFullPage"),Kr=inject("showingFullScreen"),Zr=computed(()=>Kr.value||Xr.value),eo=useElementBounding$1(Vr),Wr=useElementBounding$1(jr),Yr=useElementBounding$1(Gr),Jr=computed(()=>`${$r.selectedBlockId}-${$r.columnId}-${$r.selectedRowId}`),no=computed(()=>{const{x:Oo,y:Bo}=artboardLogic.calculatePostionForMenuNoOverlapVerticalReactive({blockRect:Wr,paneRect:eo,windowSize:zr});return{top:Bo-Yr.top.value,left:Oo-Yr.left.value,width:MENU_WIDTH,showing:!(Wr.bottom.value<0||Wr.top.value>zr.height.value)}}),ro=computed(()=>{if(no.value===void 0)return!1;const{left:Oo}=no.value;return Yr.left.value+Oo+MENU_WIDTH+SECONDARY_MENU_MAX_WIDTH+16>zr.width.value}),so=lodashExports.cloneDeep(theme.tableColors),ao=lodashExports.cloneDeep(theme.textOpacities),lo=ao.map(Oo=>Oo.id),po=Oo=>{var vo,Io,To,Co,Po,Fo,Vo;if(!$r.selectedBlockId||$r.selectedRowId==null)return;const Bo=((vo=so.find(Ko=>Ko.id===Oo))==null?void 0:vo.id)??"#FFFFFF",bo=((Io=so.find(Ko=>Ko.id===Oo))==null?void 0:Io.id)??"#0D0C0C";Br.updateProps($r.selectedBlockId,{keyPath:["config","rowStore","value","store",$r.selectedRowId,"style"],value:{...(Vo=(Fo=(Po=(Co=(To=Br.config($r.selectedBlockId))==null?void 0:To.rowStore)==null?void 0:Co.value)==null?void 0:Po.store)==null?void 0:Fo[$r.selectedRowId])==null?void 0:Vo.style,background:Bo,color:bo,timestamp:Date.now()}}),Ir.capture("change_table_row_background_color",{color:Oo,blockId:Rr.value})},go=Oo=>{var bo,vo,Io,To,Co,Po;if(!$r.selectedBlockId||$r.selectedRowId==null)return;const Bo=((bo=ao.find(Fo=>Fo.id===Oo))==null?void 0:bo.id)??"default";Br.updateProps($r.selectedBlockId,{keyPath:["config","rowStore","value","store",$r.selectedRowId,"style"],value:{...(Po=(Co=(To=(Io=(vo=Br.config($r.selectedBlockId))==null?void 0:vo.rowStore)==null?void 0:Io.value)==null?void 0:To.store)==null?void 0:Co[$r.selectedRowId])==null?void 0:Po.style,color:Bo,timestamp:Date.now()}}),Ir.capture("change_table_row_text_opacity",{color:Oo,blockId:Rr.value})},{isContextMenuOpen:co}=inject("isContextMenuOpen"),mo=inject("selectionMenuBlockId"),{popoverState:io}=inject("popoverState"),uo=computed(()=>Object.values(io.value).some(Oo=>Oo));watch(uo,()=>{log(`is any popover showing, ${uo.value}`),uo.value&&(mo.value=null)}),watch(co,()=>{co.value&&(mo.value=null)});const ho=computed(()=>Nr.getIsCommandBarOpen);watch(ho,()=>{ho.value&&(mo.value=null)});const yo=computed(()=>Lr.getIsSlideInTransition),So=computed(()=>Hr.isAnyBlockResizing);watchEffect(()=>{if(Ur.value=!!$r.selectedBlockId&&!!mo.value&&$r.selectedBlockId===mo.value&&!Zr.value&&!Br.dragBlockId&&!So.value&&!yo.value,Ur.value){const Oo=document.getElementById(Jr.value);Oo instanceof HTMLElement&&(jr.value=Oo);const Bo=document.getElementById(`tableBlock-${$r.selectedBlockId}`);Bo instanceof HTMLElement&&(Gr.value=Bo)}});const ko=()=>{Ar("close")},$o=()=>{nextTick(()=>{var Oo;Ur.value&&((Oo=Vr.value)==null||Oo.focus())})};onMounted(()=>{$o()}),watch(Ur,()=>{$o()});const Go=computed(()=>{var Oo,Bo,bo,vo,Io,To;return $r.selectedRowId?((To=(Io=(vo=(bo=(Bo=(Oo=Br.config($r.selectedBlockId))==null?void 0:Oo.rowStore)==null?void 0:Bo.value)==null?void 0:bo.store)==null?void 0:vo[$r.selectedRowId])==null?void 0:Io.style)==null?void 0:To.background)??"":""}),No=computed(()=>{var Oo,Bo,bo,vo,Io,To;return $r.selectedRowId?((To=(Io=(vo=(bo=(Bo=(Oo=Br.config($r.selectedBlockId))==null?void 0:Oo.rowStore)==null?void 0:Bo.value)==null?void 0:bo.store)==null?void 0:vo[$r.selectedRowId])==null?void 0:Io.style)==null?void 0:To.color)??"":""}),Eo=computed(()=>!No.value&&!Go.value?"default":lo.includes(No.value)?No.value:Go.value),Mo=computed(()=>lo.includes(Eo.value)?`icon-highlighter-${Eo.value}.svg`:`icon-highlighter-${Eo.value}-v2.svg`),Ro=computed(()=>{let Oo=[{id:"color",type:"menu",label:"Color",icon:Mo.value},{id:"insertAbove",label:"Insert above",icon:"icon-arrow-up.svg"},{id:"insertBelow",label:"Insert below",icon:"icon-arrow-down.svg"},{id:"duplicate",label:"Duplicate",icon:"icon-duplicate.svg"},{id:"clearContent",label:"Clear content",icon:"icon-clear-circle.svg"},{id:"delete",label:"Delete",icon:"icon-trash-16px-1.svg"}];return Dr.value||(Oo=Oo.filter(Bo=>Bo.id!=="insertAbove"&&Bo.id!=="insertBelow"&&Bo.id!=="duplicate")),Mr.value||(Oo=Oo.filter(Bo=>Bo.id!=="delete")),Oo}),Ao=({id:Oo,...Bo})=>{$r.selectedBlockId!=null&&$r.selectedRowId!=null&&(Oo==="insertAbove"&&Ar("insertAbove",{rowId:$r.selectedRowId}),Oo==="insertBelow"&&Ar("insertBelow",{rowId:$r.selectedRowId}),Oo==="duplicate"&&Ar("duplicate",{rowId:$r.selectedRowId}),Oo==="clearContent"&&Ar("clearContent",{rowId:$r.selectedRowId}),Oo==="delete"&&Ar("delete",{rowId:$r.selectedRowId}),Oo==="color"&&(lo.includes(Bo.color)?go(Bo.color):po(Bo.color),ko()))},zo=Oo=>{Oo.stopPropagation(),ko()};return(Oo,Bo)=>(openBlock(),createBlock(Teleport,{to:`#teleport-${unref(Rr)}`},[createVNode(Transition,{name:"pane-fade"},{default:withCtx(()=>[Ur.value&&no.value.showing?(openBlock(),createElementBlock("div",{key:0,tabindex:"0",ref_key:"paneElement",ref:Vr,class:"block-menu table-menu absolute",style:normalizeStyle({top:`${no.value.top}px`,left:`${no.value.left}px`,width:`${no.value.width}px`}),onKeydown:withKeys(zo,["esc"])},[createVNode(MenuWithExpandOption,{items:Ro.value,dropdownWidth:MENU_WIDTH,open:Ur.value,block:unref(Rr),idToUse:Jr.value,onSelectedItemId:Ao,onClose:Bo[0]||(Bo[0]=bo=>Ar("close")),colorId:Eo.value,colors:unref(so),shouldShiftSecondaryMenu:ro.value},null,8,["items","open","block","idToUse","colorId","colors","shouldShiftSecondaryMenu"])],36)):createCommentVNode("",!0)]),_:1})],8,["to"]))}}),TableRowSelectionPane_vue_vue_type_style_index_0_scoped_a0e6d641_lang="",TableRowSelectionPane=_export_sfc(_sfc_main$E,[["__scopeId","data-v-a0e6d641"]]),blockTypes=[{id:"text",icon:"icon-text.svg"},{id:"table",icon:"icon-table-3.svg"}],deleteTransitionDuration=200,paneMargin="80px",panePadding=16,usePromptStore=defineStore("promptsStore",{state:()=>({promptSystems:{},promptActions:{},publishedSystems:[],publishedActions:{text:[],table:[]},loading:!1,isReady:!1,isPromptPaneOpen:!1}),getters:{displayedSystems:Tr=>Cr=>{let $r=Tr.publishedSystems;return Cr&&($r=$r.filter(Ar=>Ar.block_type===Cr)),$r},displayedActions:Tr=>Cr=>{if(!Cr)return[];const $r=useBlockStore(),Ar=$r.type(Cr);if(!Ar)return[];const Rr=$r.assignedSystems(Cr),Dr=Tr.publishedActions[Ar].filter(Br=>Rr.includes(Br.parent_id)),Mr=Dr.find(Br=>Br.name.toLowerCase().includes("create"));return Mr?[Mr,...Dr.filter(Br=>Br.id!==Mr.id)]:Dr}},actions:{setPromptPaneOpenState(Tr){this.isPromptPaneOpen=Tr},async fetchPublishedPrompts(){if(this.publishedSystems.length||!showAssignedSysMenuBtn())return;const{data:Tr,error:Cr}=await fetchPublishedPrompts();if(Cr||!Tr)throw new Error("Could not get internal prompts");this.publishedSystems=Tr;const $r={text:[],table:[]};for(const Ar of Tr)for(const Rr of Ar.prompt_actions)$r[Ar.block_type].push(Rr);this.publishedActions=$r},async fetchPromptSystems(){if(Object.keys(this.promptSystems).length||!showAssignedSysMenuBtn())return;const{data:Tr,error:Cr}=await fetchPromptSystems();if(Cr||!Tr)throw new Error("Could not get internal prompts");for(const $r of Tr){this.promptSystems[$r.id]=$r;for(const Ar of $r.prompt_actions)this.promptActions[Ar.id]=Ar}},async createPromptSystem(Tr){const Cr=useUserStore(),$r=new Date().toISOString(),Ar=crypto.randomUUID(),Rr={...Tr,id:Ar,created_at:$r,updated_at:$r,is_deleted:!1,org_id:Cr.currentOrgId,owner_id:Cr.currentUserId};return this.promptSystems[Ar]=Rr,(Tr.published||!IS_PROD)&&this.publishedSystems.push(Rr),await createPromptSystem(Rr),Rr},async createPromptAction(Tr){const{example:Cr,placeholder:$r=null,parent_id:Ar,published:Rr,config:Dr,...Mr}=Tr,Br=crypto.randomUUID(),Nr=new Date().toISOString(),Lr=Cr?[Cr]:null,Hr={...Mr,created_at:Nr,examples:Lr,id:Br,is_deleted:!1,parent_id:Ar,placeholder:$r,published:Rr,updated_at:Nr,config:Dr};if(await createPromptAction(Hr),Rr||!IS_PROD){const{block_type:zr}=this.promptSystems[Ar];this.publishedActions[zr].push({id:Br,parent_id:Ar,placeholder:$r,name:Mr.name,examples:Lr,published:Rr,config:Dr})}return this.promptActions[Br]=Hr,Hr},updateLocalPrompt(Tr,Cr){for(const $r of Object.keys(Tr))Tr[$r]=Cr[$r]},async updatePromptSystem(Tr,Cr){const Ar={...this.promptSystems[Tr],...Cr};this.promptSystems[Tr]=Ar;const Rr=this.publishedSystems.find(Dr=>Dr.id===Tr);return Rr&&this.updateLocalPrompt(Rr,Ar),await updatePromptSystem({id:Tr,...Cr}),Ar},updateLocalPublishedAction(Tr){const Cr=this.promptSystems[Tr.parent_id].block_type,$r=this.publishedActions[Cr].find(Ar=>Ar.id===Tr.id);$r&&this.updateLocalPrompt($r,Tr)},async updatePromptAction(Tr,Cr){const{example:$r,...Ar}=Cr,Rr=this.promptActions[Tr];$r?Rr.examples=[$r]:Rr.examples=null;const Dr={...Rr,...Ar};return this.promptActions[Tr]=Dr,this.updateLocalPublishedAction(Dr),await updatePromptAction(Dr),Dr},async deletePromptSystem(Tr){this.promptSystems[Tr]&&(await deletePromptSystem({id:Tr}),setTimeout(()=>{this.publishedSystems=this.publishedSystems.filter($r=>$r.id!==Tr);for(const[$r,Ar]of Object.entries(this.promptActions))Ar.parent_id===Tr&&(this.unpublishActionLocally(Ar,!1),delete this.promptActions[$r]);delete this.promptSystems[Tr]},deleteTransitionDuration))},async deletePromptAction(Tr){const Cr=this.promptActions[Tr];Cr&&(await deletePromptAction({id:Tr}),setTimeout(()=>{this.unpublishActionLocally(Cr,!1),delete this.promptActions[Tr]},deleteTransitionDuration))},async togglePublish(Tr,Cr){if(Cr==="system"){const Ar=this.promptSystems[Tr];if(Ar.published=!Ar.published,Ar.published){this.publishedSystems.find(({id:Rr})=>Rr===Ar.id)||this.publishedSystems.push({id:Ar.id,block_type:Ar.block_type,name:Ar.name,published:!0});for(const Rr of Object.values(this.promptActions)){const Dr=this.publishedActions[Ar.block_type].findIndex(Mr=>Mr.id===Rr.id);Rr.published||!IS_PROD?Dr===-1&&this.publishedActions[Ar.block_type].push(Rr):Dr!==-1&&this.publishedActions[Ar.block_type].splice(Dr,1)}}else this.publishedSystems=this.publishedSystems.filter(Rr=>Rr.id!==Tr);await updatePromptSystem({published:Ar.published,id:Tr});return}const $r=this.promptActions[Tr];$r.published=!$r.published,$r.published?this.publishActionLocally($r):this.unpublishActionLocally($r,!0),await updatePromptAction({published:$r.published,id:Tr})},publishActionLocally(Tr){const{id:Cr}=Tr,{block_type:$r}=this.promptSystems[Tr.parent_id],Ar=this.publishedActions[$r];Ar.find(Dr=>Dr.id===Cr)||Ar.push(Tr)},unpublishActionLocally(Tr,Cr){if(Cr)return;const{id:$r}=Tr,{block_type:Ar}=this.promptSystems[Tr.parent_id],Rr=this.publishedActions[Ar],Dr=Rr.findIndex(Mr=>Mr.id===$r);Dr>=0&&Rr.splice(Dr,1)}}}),_hoisted_1$p={class:"relative"},_hoisted_2$k={class:"label-medium"},_hoisted_3$g=["onClick"],_hoisted_4$d={class:"label-normal"},_hoisted_5$9={key:0,style:{minWidth:"16px"}},_hoisted_6$8={key:0,class:"h-[170px] flex flex-col justify-center items-center text-center"},_hoisted_7$8=createBaseVNode("label",{class:"text-base font-semibold"},"No block role created",-1),_hoisted_8$6=createBaseVNode("label",{class:"mt-1 mb-4 text-neutralSolid-500 text-sm font-medium"},"Add new block system to assign custom action",-1),_hoisted_9$6=createBaseVNode("span",{class:"text-base text-neutralSolid-500 font-medium"},"Add new system",-1),_sfc_main$D=defineComponent({__name:"AssignSystemButton",setup(Tr){const Cr=useBlockStore(),$r=usePromptStore(),Ar=inject("selectedBlockId"),Rr=ref({top:0}),Dr=ref(null);useAsyncData($r.fetchPublishedPrompts,"$7R37lgQXOp");const Mr=computed(()=>Cr.type(Ar.value)),Br=computed(()=>$r.displayedSystems(Mr.value)),Nr=computed(()=>Cr.assignedSystems(Ar.value)),Lr=computed(()=>Nr.value.length?$r.publishedSystems.find(({id:Vr})=>Vr===Nr.value[0])??null:null),Hr=computed(()=>{var Vr;return((Vr=Lr.value)==null?void 0:Vr.name)??"System"}),zr=Vr=>{if(!Vr.target)return;const jr=Vr.target.getBoundingClientRect();nextTick(()=>{updatePositionForMenu(jr,".bg-color-menu",Rr)})},Ur=Vr=>{var jr;Ar.value&&(((jr=Lr.value)==null?void 0:jr.id)===Vr?Cr.updateProps(Ar.value,{keyPath:["config","assignedSystems"],value:[]}):Cr.updateProps(Ar.value,{keyPath:["config","assignedSystems"],value:[Vr]}))};return(Vr,jr)=>{const Gr=resolveDirective("tooltip");return openBlock(),createBlock(unref(ge$2),null,{default:withCtx(({open:Xr})=>[createBaseVNode("div",_hoisted_1$p,[withDirectives(createVNode(unref(Se$1),{class:normalizeClass(["block-menu-button active:bg-neutralSolid-100",{"bg-neutralSolid-100":Xr,"hover:bg-neutralSolid-50":!Xr}]),onClick:zr},{default:withCtx(()=>[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-stars-2.svg"),"v-props":{width:"20px",height:"20px",...Lr.value?{fill:"#AB67FF",nestedFill:"#AB67FF"}:{}}},null,8,["src","v-props"]),createBaseVNode("label",_hoisted_2$k,toDisplayString(Hr.value),1)]),_:2},1032,["class"]),[[Gr,{content:"Assign a prompt to this block",placement:"bottom"}]]),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[createVNode(unref(be),{as:"ul",ref_key:"sysMenu",ref:Dr,class:"sys-menu dropdown-menu absolute w-52",style:normalizeStyle({top:`${Rr.value.top}px`,width:Br.value.length?"240px":"285px",zIndex:1e3,..."left"in Rr.value?{left:`${Rr.value.left}px`}:{},..."right"in Rr.value?{right:`${Rr.value.right}px`}:{}})},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Br.value,Kr=>(openBlock(),createBlock(unref(Me),{key:Kr.id},{default:withCtx(()=>[createBaseVNode("li",{class:"dropdown-menu-button",onClick:withModifiers(()=>Ur(Kr.id),["prevent"])},[createBaseVNode("label",_hoisted_4$d,toDisplayString(Kr.name),1),Nr.value.includes(Kr.id)?(openBlock(),createElementBlock("div",_hoisted_5$9,[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-check.svg"),"v-props":{width:"16px",height:"16px"}},null,8,["src"])])):createCommentVNode("",!0)],8,_hoisted_3$g)]),_:2},1024))),128)),Br.value.length?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_6$8,[_hoisted_7$8,_hoisted_8$6,createBaseVNode("button",{class:"px-4 h-[42px] flex gap-1 justify-center items-center text-neutralSolid-100 border-[1px] border-neutralSolid-100 hover:border-neutral-300 rounded-xl",onClick:jr[0]||(jr[0]=Kr=>unref($r).setPromptPaneOpenState(!0))},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-add.svg"),"v-props":{nestedFill:"#868585",width:"20px",height:"20px"}},null,8,["src"]),_hoisted_9$6])]))]),_:1},8,["style"])]),_:1})])]),_:1})}}}),_withScopeId$2=Tr=>(pushScopeId("data-v-b9564057"),Tr=Tr(),popScopeId(),Tr),_hoisted_1$o=_withScopeId$2(()=>createBaseVNode("div",{class:"block-menu-divider"},null,-1)),_hoisted_2$j={class:"flex gap-1 items-center"},_hoisted_3$f=["onClick"],_hoisted_4$c=_withScopeId$2(()=>createBaseVNode("div",{class:"block-menu-divider"},null,-1)),_hoisted_5$8={class:"flex items-center gap-1"},_hoisted_6$7=["onClick"],_hoisted_7$7=_withScopeId$2(()=>createBaseVNode("div",{class:"block-menu-divider"},null,-1)),_sfc_main$C=defineComponent({__name:"TableSelectionPane",props:{selectedBlockId:{}},setup(Tr){const Cr=inject("showingFullScreen"),$r=inject("showingFullPage"),Ar=inject("downloadFile"),Rr=Tr,Dr=inject("selectedBlockId"),Mr=useBlockStore(),Br=useCommandBarStore(),Nr=useMiscStore(),Lr=useArtboardStore(),Hr=useTableStore(),zr=useWindowSize(),Ur=ref(!1),Vr=ref(null),jr=ref(null),Gr=ref(null),Xr=computed(()=>Cr.value||Ar.value||$r.value),Kr=useElementBounding$1(Vr),Zr=useElementBounding$1(jr),eo=useElementBounding$1(Gr),Wr=computed(()=>Mr.config(Dr.value)),Yr=computed(()=>{var No,Eo;const So=((Eo=(No=Wr==null?void 0:Wr.value)==null?void 0:No.verticalAlignment)==null?void 0:Eo.selectedId)==="top",{x:ko,y:$o,isClampedY:Go}=artboardLogic.calculatePostionForMenuOnTopReactive({blockRect:Zr,paneRect:Kr,windowSize:zr,blockId:Rr.selectedBlockId||"",gap:24});return{top:Go?$o:$o-eo.top.value,left:Go?ko:ko-eo.left.value,isClampedY:Go,showing:!(Zr.bottom.value<0||Zr.top.value>zr.height.value)}}),{isContextMenuOpen:Jr}=inject("isContextMenuOpen"),no=inject("selectionMenuBlockId"),{popoverState:ro}=inject("popoverState"),so=computed(()=>Object.values(ro.value).some(So=>So));watch(so,()=>{log(`is any popover showing, ${so.value}`),so.value?no.value=null:no.value=Rr.selectedBlockId}),watch(Jr,()=>{Jr.value&&(no.value=null)});const ao=computed(()=>Br.getIsCommandBarOpen);watch(ao,()=>{ao.value&&(no.value=null)});const lo=computed(()=>Nr.getIsSlideInTransition),po=computed(()=>Lr.isAnyBlockResizing);watchEffect(async()=>{if(Ur.value=!!Rr.selectedBlockId&&!Mr.isDeleted(Rr.selectedBlockId)&&!!no.value&&Rr.selectedBlockId===no.value&&!Xr.value&&!Mr.dragBlockId&&!po.value&&!Hr.draggingTableEl&&!lo.value,Ur.value){let So=document.querySelector(`*[data-block-id="${Rr.selectedBlockId}"]`);So||(await nextTick(),So=document.querySelector(`*[data-block-id="${Rr.selectedBlockId}"]`)),So instanceof HTMLElement&&(jr.value=So);const ko=document.getElementById(`tableBlock-${Rr.selectedBlockId}`);ko instanceof HTMLElement&&(Gr.value=ko)}});const go=ref([{id:"hasHeaderColumn",label:"Header column",icon:"header-column"},{id:"hasHeaderRow",label:"Header row",icon:"header-row"},{id:"hasZebraStripes",label:"Zebra rows",icon:"zebra-strip"}]),co=computed(()=>{const So=Wr.value;return go.value.map($o=>{const{id:Go}=$o,No=So[Go];return{...$o,...No}})}),mo=(So,ko)=>{Dr.value!=null&&Mr.updateProps(Dr.value,{keyPath:["config",So,"value"],value:ko})},io=So=>{if(!Rr.selectedBlockId)return!1;const{verticalAlignment:ko}=Wr.value;return(ko==null?void 0:ko.selectedId)===So},uo=So=>{Dr.value!=null&&Mr.updateProps(Dr.value,{keyPath:["config","verticalAlignment","selectedId"],value:So})},ho=()=>{Rr.selectedBlockId&&(useDeleteBlockWrapper({selectedBlockId:Dr}),Dr&&(Dr.value=null))},yo=alignmentButtons.vertical;return(So,ko)=>{const $o=resolveDirective("tooltip");return openBlock(),createBlock(Teleport,{to:Yr.value.isClampedY?"#main-app":`#teleport-${unref(Dr)}`},[createVNode(Transition,{name:"pane-fade"},{default:withCtx(()=>[Ur.value&&Yr.value.showing?(openBlock(),createElementBlock("div",{key:0,ref_key:"paneElement",ref:Vr,class:"selection-pane",style:normalizeStyle({top:`${Yr.value.top}px`,left:`${Yr.value.left}px`,transform:"translateX(-50%) translateY(-100%)",position:Yr.value.isClampedY?"fixed":"absolute"})},[unref(showAssignedSysMenuBtn)()?(openBlock(),createElementBlock(Fragment$1,{key:0},[createVNode(_sfc_main$D),_hoisted_1$o],64)):createCommentVNode("",!0),createBaseVNode("div",_hoisted_2$j,[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(co.value,Go=>withDirectives((openBlock(),createElementBlock("button",{key:Go.id,class:normalizeClass(["block-menu-icon-button active:bg-neutralSolid-100",{"bg-neutralSolid-100":Go.value,"hover:bg-neutralSolid-50":!Go.value}]),onClick:No=>mo(Go.id,!Go.value)},[createVNode(_sfc_main$1v,{src:unref(assetUrl)(`icon-${Go.icon}.svg`)},null,8,["src"])],10,_hoisted_3$f)),[[$o,{content:Go.label,placement:"bottom"}]])),128))]),_hoisted_4$c,createBaseVNode("div",_hoisted_5$8,[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(unref(yo),Go=>withDirectives((openBlock(),createElementBlock("button",{key:Go.id,class:normalizeClass(["block-menu-icon-button active:bg-neutralSolid-100",{"bg-neutralSolid-100":io(Go.id),"hover:bg-neutralSolid-50":!io(Go.id)}]),onClick:No=>uo(Go.id)},[createVNode(_sfc_main$1v,{src:unref(assetUrl)(`icon-${Go.icon}.svg`)},null,8,["src"])],10,_hoisted_6$7)),[[$o,{content:Go.tooltip,placement:"bottom"}]])),128))]),_hoisted_7$7,withDirectives(createBaseVNode("button",{class:"block-menu-icon-button hover:bg-neutralSolid-50 active:bg-neutralSolid-100",onClick:ho},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-trash-20px-1.svg"),vProps:{width:20,height:20}},null,8,["src"])],512),[[$o,{content:"Delete block",placement:"bottom"}]])],4)):createCommentVNode("",!0)]),_:1})],8,["to"])}}}),TableSelectionPane_vue_vue_type_style_index_0_scoped_b9564057_lang="",TableSelectionPane=_export_sfc(_sfc_main$C,[["__scopeId","data-v-b9564057"]]),_hoisted_1$n={class:"relative flex"},_hoisted_2$i=["onClick"],_hoisted_3$e={class:"flex items-center gap-2 grow shrink-0 basis-0"},_hoisted_4$b={class:"label-medium"},_sfc_main$B=defineComponent({__name:"ListTypeMenu",props:{selectedBlockId:{},selectedTextTypes:{},getEditor:{type:Function}},setup(Tr){const Cr=Tr,$r=useBlockStore(),Ar=textTypes.filter(Hr=>Hr.id.includes("List")),Rr=ref({top:0}),Dr=ref(null),Mr=Hr=>{const zr=Hr.currentTarget||Hr.target;if(!zr)return;const Ur=zr.getBoundingClientRect();updatePositionForMenu(Ur,".list-type-menu",Rr),nextTick(()=>{updatePositionForMenu(Ur,".list-type-menu",Rr)}),setTimeout(()=>updatePositionForMenu(Ur,".list-type-menu",Rr),0)},Br=(Hr,zr)=>{const Ur=Cr.getEditor();return Ur?isActiveList({editor:Ur,type:Hr,attrs:zr}):!1},Nr=(Hr,zr)=>Hr==="noList"?!Br("bulletList")&&!Br("orderedList"):Hr!=="bulletList"&&Hr!=="orderedList"?!1:Br(Hr,zr?{listContentSymbol:zr}:void 0),Lr=Hr=>{var Ur,Vr,jr;const zr=Cr.getEditor();!zr||!Cr.selectedBlockId||(changeTextType({editor:zr,textType:Hr,textAlignment:(jr=(Vr=(Ur=$r.blockData[Cr.selectedBlockId])==null?void 0:Ur.config)==null?void 0:Vr.textAlignment)==null?void 0:jr.value,selectedTextTypes:toRefs$1(Cr).selectedTextTypes}),posthogCapture("change_text_type",{textType:Hr.id,blockId:Cr.selectedBlockId}))};return(Hr,zr)=>{const Ur=resolveDirective("tooltip");return openBlock(),createBlock(unref(ge$2),null,{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$n,[withDirectives(createVNode(unref(Se$1),{class:normalizeClass(["block-menu-button hover:bg-neutralSolid-50 active:bg-neutralSolid-100",{"bg-neutralSolid-100":Br("orderedList")||Br("bulletList")}]),style:{fontFamily:"inherit"},onClick:Mr},{default:withCtx(()=>[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-format-list-bullet-v2.svg"),vProps:{width:20,height:20}},null,8,["src"])]),_:1},8,["class"]),[[Ur,{content:"Change list type",placement:"bottom"}]]),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[createVNode(unref(be),{as:"ul",ref_key:"listTypeMenu",ref:Dr,class:"list-type-menu dropdown-menu absolute w-[169px]",style:normalizeStyle({top:`${Rr.value.top}px`,..."left"in Rr.value?{left:`${Rr.value.left}px`}:{},..."right"in Rr.value?{right:`${Rr.value.right}px`}:{},zIndex:1e3})},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(unref(Ar),Vr=>(openBlock(),createBlock(unref(Me),{key:Vr.name},{default:withCtx(()=>[createBaseVNode("li",{class:"dropdown-menu-button",onClick:jr=>Lr(Vr)},[createBaseVNode("div",_hoisted_3$e,[createVNode(_sfc_main$1v,{src:unref(assetUrl)(`icon-${Vr.icon}.svg`)},null,8,["src"]),createBaseVNode("label",_hoisted_4$b,toDisplayString(Vr.name),1)]),Nr(Vr.id,Vr.symbol)?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)("icon-check.svg"),"v-props":{width:"16px",height:"16px"}},null,8,["src"])):createCommentVNode("",!0)],8,_hoisted_2$i)]),_:2},1024))),128))]),_:1},8,["style"])]),_:1})])]),_:1})}}}),_hoisted_1$m={class:"flex items-center"},_hoisted_2$h={class:"flex gap-1 items-center border-b-neutral-50"},_hoisted_3$d={class:"flex items-center gap-1"},_hoisted_4$a={class:"relative flex"},_sfc_main$A=defineComponent({__name:"TableCellSelectionPane",props:{selectedBlockId:{},rowId:{},columnId:{},isFirstRow:{type:Boolean}},setup(Tr){const Cr=inject("showingFullScreen"),$r=inject("showingFullPage"),Ar=inject("downloadFile"),Rr=Tr,Dr=inject("selectedBlockId");inject("appId"),useAppStore();const Mr=useBlockStore(),Br=useCommandBarStore(),Nr=useEditorStore(),Lr=useMiscStore(),Hr=useArtboardStore();useUserStore();const zr=useWindowSize(),Ur=ref(!1),Vr=ref(null),jr=ref(null),Gr=ref(null),Xr=computed(()=>Cr.value||Ar.value||$r.value),Kr=computed(()=>`${Rr.selectedBlockId}-${Rr.columnId}-${Rr.rowId}`),Zr=useElementBounding(Vr),eo=useElementBounding(jr),Wr=useElementBounding(Gr),Yr=computed(()=>{const{x:Ao,y:zo,isClampedY:Oo}=artboardLogic.calculatePostionForMenuOnTopReactive({blockRect:eo,paneRect:Zr,windowSize:zr,blockId:Rr.selectedBlockId??"",gap:24});return{top:Oo?zo:zo-Wr.top.value,left:Oo?Ao:Ao-Wr.left.value,isClampedY:Oo,showing:!(eo.bottom.value<0||eo.top.value>zr.height.value)}}),Jr=lodashExports.cloneDeep(theme.tableColors),no=lodashExports.cloneDeep(theme.textOpacities),ro=no.map(Ao=>Ao.id),so=Ao=>theme.tableColors.find(({id:zo})=>zo===Ao),ao=(Ao,zo)=>{var Co,Po,Fo,Vo,Ko,Uo,ei;const Oo=Mr.config(Dr.value??""),Bo=(Vo=(Fo=(Po=(Co=Oo==null?void 0:Oo.cellStore)==null?void 0:Co.value)==null?void 0:Po.store)==null?void 0:Fo[Ao])==null?void 0:Vo[zo],bo=(Ko=Bo==null?void 0:Bo.style)==null?void 0:Ko.color,vo=((Uo=Bo==null?void 0:Bo.style)==null?void 0:Uo.timestamp)??0;if(ro.includes(bo))return{id:bo,timestamp:vo};const Io=(ei=Bo==null?void 0:Bo.style)==null?void 0:ei.background;return so(Io)?{id:Io,timestamp:vo}:{id:"default",timestamp:vo}},lo=Ao=>{var To,Co,Po,Fo,Vo,Ko;const zo=Mr.config(Dr.value??""),Oo=(Po=(Co=(To=zo==null?void 0:zo.colStore)==null?void 0:To.value)==null?void 0:Co.store)==null?void 0:Po[Ao],Bo=((Fo=Oo==null?void 0:Oo.style)==null?void 0:Fo.color)??"default",bo=((Vo=Oo==null?void 0:Oo.style)==null?void 0:Vo.timestamp)??0;if(ro.includes(Bo))return{id:Bo,timestamp:bo};const vo=(Ko=Oo==null?void 0:Oo.style)==null?void 0:Ko.background;return so(vo)?{id:vo,timestamp:bo}:{id:"default",timestamp:bo}},po=Ao=>{var To,Co,Po,Fo,Vo,Ko;const zo=Mr.config(Dr.value??""),Oo=(Po=(Co=(To=zo==null?void 0:zo.rowStore)==null?void 0:To.value)==null?void 0:Co.store)==null?void 0:Po[Ao],Bo=((Fo=Oo==null?void 0:Oo.style)==null?void 0:Fo.color)??"default",bo=((Vo=Oo==null?void 0:Oo.style)==null?void 0:Vo.timestamp)??0;if(ro.includes(Bo))return{id:Bo,timestamp:bo};const vo=(Ko=Oo==null?void 0:Oo.style)==null?void 0:Ko.background;return so(vo)?{id:vo,timestamp:bo}:{id:"default",timestamp:bo}},go=computed(()=>{if(!Rr.selectedBlockId||!Rr.columnId||!Rr.rowId)return"default";const{id:Ao,timestamp:zo}=lo(Rr.columnId),{id:Oo,timestamp:Bo}=po(Rr.rowId),{id:bo,timestamp:vo}=ao(Rr.columnId,Rr.rowId);return vo===0&&zo===0&&Bo===0?bo||Ao||Oo||"default":vo>=zo&&vo>=Bo?bo||"default":zo>=vo&&zo>=Bo?Ao||"default":Bo>=vo&&Bo>=zo&&Oo||"default"}),co=computed(()=>go.value==="default"||go.value==="grey"?`icon-highlighter-${go.value}.svg`:`icon-highlighter-${go.value}-v2.svg`),mo=Ao=>{var Bo,bo,vo,Io,To,Co,Po,Fo,Vo,Ko,Uo,ei,qo,ri;if(!Rr.selectedBlockId||Rr.columnId==null||Rr.rowId==null)return;const zo=(Bo=no.find(ki=>ki.id===Ao))==null?void 0:Bo.id;if(zo){Mr.updateProps(Rr.selectedBlockId,{keyPath:["config","cellStore","value","store",Rr.columnId,Rr.rowId,"style"],value:{...(Po=(Co=(To=(Io=(vo=(bo=Mr.config(Rr.selectedBlockId))==null?void 0:bo.cellStore)==null?void 0:vo.value)==null?void 0:Io.store)==null?void 0:To[Rr.columnId])==null?void 0:Co[Rr.rowId])==null?void 0:Po.style,background:zo,color:zo,timestamp:Date.now()}});return}const Oo=((Fo=Jr.find(ki=>ki.id===Ao))==null?void 0:Fo.id)??"default";Mr.updateProps(Rr.selectedBlockId,{keyPath:["config","cellStore","value","store",Rr.columnId,Rr.rowId,"style"],value:{...(ri=(qo=(ei=(Uo=(Ko=(Vo=Mr.config(Rr.selectedBlockId))==null?void 0:Vo.cellStore)==null?void 0:Ko.value)==null?void 0:Uo.store)==null?void 0:ei[Rr.columnId])==null?void 0:qo[Rr.rowId])==null?void 0:ri.style,background:Oo,color:Oo,timestamp:Date.now()}}),Ir.capture("change_table_cell_background_color",{color:Ao,blockId:Dr.value}),headlessCleanup()},{isContextMenuOpen:io}=inject("isContextMenuOpen"),uo=inject("selectionMenuBlockId"),{popoverState:ho}=inject("popoverState"),yo=computed(()=>Object.values(ho.value).some(Ao=>Ao));watch(yo,()=>{log(`is any popover showing, ${yo.value}`),yo.value&&(uo.value=null)}),watch(io,()=>{io.value&&(uo.value=null)});const So=computed(()=>Br.getIsCommandBarOpen);watch(So,()=>{So.value&&(uo.value=null)});const ko=computed(()=>Lr.getIsSlideInTransition),$o=computed(()=>Hr.isAnyBlockResizing);watchEffect(()=>{if(Ur.value=!!Rr.selectedBlockId&&!!uo.value&&Rr.selectedBlockId===uo.value&&!Xr.value&&!Mr.dragBlockId&&!$o.value&&!ko.value,Ur.value){const Ao=document.querySelector(`*[data-block-id="${Rr.selectedBlockId}"]`);Ao instanceof HTMLElement&&(jr.value=Ao);const zo=document.getElementById(`tableBlock-${Rr.selectedBlockId}`);zo instanceof HTMLElement&&(Gr.value=zo)}});const Go=[{id:"noList",name:"None",type:"paragraph",icon:"list-none"},{id:"bulletList",name:"Bullet",type:"paragraph",icon:"list-disc",symbol:"disc"},{id:"bulletList",name:"Arrow",type:"paragraph",icon:"list-arrow",symbol:"arrow"},{id:"orderedList",name:"Number",type:"paragraph",icon:"list-number-2"}],No=ref(Go[0].name),Eo=ref(new Map);watchEffect(()=>{const Ao=Nr.getTableEditor(Kr.value);if(!Ur.value||!Ao)return;const{from:zo,to:Oo}=Ao.state.selection;if(Eo.value.clear(),Ao.state.doc.nodesBetween(zo,Oo,(Bo,bo,vo)=>{Bo.isText||Bo.type.name==="text"||vo&&vo.type.name!=="doc"||((Bo.type.name==="paragraph"||Bo.type.name==="bulletList"||Bo.type.name==="orderedList")&&!Eo.value.has(Bo.type.name)?Eo.value.set(Bo.type.name,Go.find(({id:Io})=>Io===Bo.type.name)):Bo.type.name==="heading"&&Eo.value.set(`h${Bo.attrs.level}`,Go.find(({type:Io,level:To})=>Io==="heading"&&To===Bo.attrs.level)))}),Eo.value.size===0)No.value="Text",Eo.value.set("paragraph",Go.find(({id:Bo})=>Bo==="text"));else if(Eo.value.size>1)No.value="Mixed";else{const[Bo]=Eo.value.values();No.value=(Bo==null?void 0:Bo.name)??"Text"}});const Mo=computed(()=>Nr.getTableEditor(Kr.value)),Ro=()=>Mo.value;return(Ao,zo)=>{const Oo=resolveDirective("tooltip");return openBlock(),createBlock(Teleport,{to:Yr.value.isClampedY?"#main-app":`#teleport-${unref(Dr)}`},[createVNode(Transition,{name:"pane-fade"},{default:withCtx(()=>[Ur.value&&Yr.value.showing?(openBlock(),createElementBlock("div",{key:0,ref_key:"paneElement",ref:Vr,class:"selection-pane table-menu",style:normalizeStyle({top:`${Yr.value.top}px`,left:`${Yr.value.left}px`,position:Yr.value.isClampedY?"fixed":"absolute",transform:"translateX(-50%) translateY(-100%)"})},[createBaseVNode("div",_hoisted_1$m,[createBaseVNode("div",_hoisted_2$h,[createVNode(_sfc_main$B,{selectedBlockId:unref(Dr)??null,selectedTextTypes:Eo.value,getEditor:Ro},null,8,["selectedBlockId","selectedTextTypes"]),createBaseVNode("div",_hoisted_3$d,[createVNode(unref(ge$2),null,{default:withCtx(()=>[createBaseVNode("div",_hoisted_4$a,[withDirectives(createVNode(unref(Se$1),{class:normalizeClass(["flex justify-center items-center rounded-lg hover:bg-neutralSolid-50 active:bg-neutralSolid-100 transition",{"bg-neutralSolid-100":go.value!=="default"&&go.value!=="grey"}]),style:{minWidth:"32px",height:"32px",fontFamily:"inherit"}},{default:withCtx(()=>[createVNode(_sfc_main$1v,{src:unref(assetUrl)(co.value)},null,8,["src"])]),_:1},8,["class"]),[[Oo,{content:"Cell background",placement:"bottom"}]]),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[createVNode(_sfc_main$H,{colorId:go.value,colors:unref(theme).tableColors,position:{left:0,top:32+16},onHighlight:mo},null,8,["colorId","colors"])]),_:1})])]),_:1})])])])],4)):createCommentVNode("",!0)]),_:1})],8,["to"])}}}),TableCellSelectionPane_vue_vue_type_style_index_0_scoped_5abb457a_lang="",TableCellSelectionPane=_export_sfc(_sfc_main$A,[["__scopeId","data-v-5abb457a"]]),_hoisted_1$l={class:"tooltip-content flex gap-2"},_hoisted_2$g={key:0,style:{color:"rgba(255, 255, 255, 0.52)"}},_sfc_main$z=defineComponent({__name:"Tooltip2",props:{msg:{},shortcut:{},placement:{default:"bottom"}},setup(Tr){const Cr=Tr;return($r,Ar)=>{const Rr=resolveComponent("VTooltip");return openBlock(),createBlock(Rr,{placement:$r.placement},{popper:withCtx(()=>[createBaseVNode("div",_hoisted_1$l,[createBaseVNode("p",null,toDisplayString(Cr.msg),1),Cr.shortcut?(openBlock(),createElementBlock("p",_hoisted_2$g,toDisplayString(Cr.shortcut),1)):createCommentVNode("",!0)])]),default:withCtx(()=>[renderSlot($r.$slots,"trigger")]),_:3},8,["placement"])}}}),_hoisted_1$k={class:"relative flex"},_sfc_main$y=defineComponent({__name:"ColorListMenu",props:{colorId:{}},emits:["highlight"],setup(Tr,{emit:Cr}){const $r=Tr,{colorId:Ar}=toRefs$1($r),Rr=Cr,Dr=ref({top:0}),Mr=ref(null),Br=computed(()=>Ar.value==="default"||Ar.value==="grey"?`icon-highlighter-${Ar.value}.svg`:`icon-highlighter-${Ar.value}-v2.svg`),Nr=Lr=>{const Hr=Lr.currentTarget||Lr.target;if(!Hr)return;const zr=Hr.getBoundingClientRect();updatePositionForMenu(zr,".highlight-menu",Dr,{menuHeight:279})};return(Lr,Hr)=>{const zr=resolveDirective("tooltip");return openBlock(),createBlock(unref(ge$2),null,{default:withCtx(()=>[createBaseVNode("div",_hoisted_1$k,[withDirectives(createVNode(unref(Se$1),{class:normalizeClass(["flex justify-center items-center rounded-lg hover:bg-neutralSolid-50 active:bg-neutralSolid-100 transition",{"bg-neutralSolid-100":unref(Ar)!=="default"&&unref(Ar)!=="grey"}]),style:{minWidth:"32px",height:"32px",fontFamily:"inherit"},onClick:Nr},{default:withCtx(()=>[createVNode(_sfc_main$1v,{src:unref(assetUrl)(Br.value)},null,8,["src"])]),_:1},8,["class"]),[[zr,{content:"Text highlight",placement:"bottom"}]]),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[createVNode(_sfc_main$H,{colorId:unref(Ar),colors:unref(theme).tableColors,position:Dr.value,isHighlight:!0,onHighlight:Hr[0]||(Hr[0]=Ur=>Rr("highlight",Ur)),ref_key:"highlightMenu",ref:Mr},null,8,["colorId","colors","position"])]),_:1})])]),_:1})}}}),_hoisted_1$j={class:"flex items-center"},_hoisted_2$f={class:"flex gap-1 items-center border-b-neutral-50"},_hoisted_3$c={class:"flex items-center gap-1"},_hoisted_4$9=["onClick"],_sfc_main$x=defineComponent({__name:"TableCellTextSelectionPane",props:{selectedBlockId:{},appId:{},rowId:{},columnId:{},isFirstRow:{type:Boolean}},setup(Tr){const Cr=inject("showingFullScreen"),$r=inject("showingFullPage"),Ar=inject("downloadFile"),Rr=Tr,Dr=inject("selectedBlockId"),Mr=inject("appId"),Br=useBlockStore(),Nr=useCommandBarStore(),Lr=useEditorStore(),Hr=useMiscStore(),zr=useArtboardStore(),Ur=useWindowSize(),Vr=ref(!1),jr=ref(null),Gr=ref(null),Xr=computed(()=>Cr.value||Ar.value||$r.value),Kr=computed(()=>`${Rr.selectedBlockId}-${Rr.columnId}-${Rr.rowId}`),Zr=useElementBounding(jr),eo=useElementBounding(Gr),Wr=ref({}),Yr=ref(!1),Jr=lodashExports.cloneDeep(theme.textOpacities),ro=[...lodashExports.cloneDeep(theme.highlightColors),...Jr],so=computed(()=>{const To=Lr.getTableEditor(Kr.value);if(To==null)return"default";for(let Co=0;Coso.value),lo=To=>{var Ko,Uo;const Co=Lr.getTableEditor(Kr.value);if(!Co||!Rr.selectedBlockId)return;const Po=Co.chain().focus();if(To==="none"){Po.unsetHighlight().run(),headlessCleanup();return}const Fo=((Ko=ro.find(ei=>ei.id===To))==null?void 0:Ko.id)??"#FFFFFF",Vo=((Uo=ro.find(ei=>ei.id===To))==null?void 0:Uo.id)??"#0D0C0C";Po.setHighlight({color:Fo,textColor:Vo}).run(),headlessCleanup()},{isContextMenuOpen:po}=inject("isContextMenuOpen"),go=inject("selectionMenuBlockId"),{popoverState:co}=inject("popoverState"),mo=computed(()=>Object.values(co.value).some(To=>To));watch(mo,()=>{log(`is any popover showing, ${mo.value}`),mo.value&&(go.value=null)}),watch(po,()=>{po.value&&(go.value=null)});const io=computed(()=>Nr.getIsCommandBarOpen);watch(io,()=>{io.value&&(go.value=null)});const uo=computed(()=>Hr.getIsSlideInTransition),ho=computed(()=>zr.isAnyBlockResizing),yo=To=>{const Co=To==null?void 0:To.view.coordsAtPos(To.view.state.tr.selection.$from.pos);if(!Co)return null;const{top:Po,left:Fo,bottom:Vo,right:Ko}=Co;if(!Po||!Fo||!Vo||!Ko)return null;const Uo=Ko-Fo;let ei=Vo-Po;const qo=To==null?void 0:To.view.coordsAtPos(To.view.state.tr.selection.$to.pos);return qo&&qo.bottom>Vo&&(ei=qo.bottom-Po),{top:Po,left:Fo,bottom:Vo,right:Ko,width:Uo,height:ei,x:Fo,y:Po}},So=()=>{if(jr.value){const To=Lr.getTableEditor(Kr.value),Co=window.getSelection();if(Co!=null&&Co.rangeCount){const Po=yo(To);if(log(`selectionrect is ${JSON.stringify(Po)}`),!Po)return;const Fo=document.getElementById(Rr.selectedBlockId??"");if(!Fo||!(Fo==null?void 0:Fo.querySelectorAll(".generic-block")[0]))return;const Ko={...eo,x:ref(Math.max(Po.x,eo.x.value)),y:ref(Math.max(Po.y,eo.y.value)),width:ref(Po.width),height:ref(Po.height)},Uo=artboardLogic.calculatePostionForMenuOnTopReactive({blockRect:Ko,paneRect:Zr,windowSize:Ur,blockId:Rr.selectedBlockId??"",gap:12,hAlign:"left"});if(Uo){const{x:ei,y:qo,isClampedY:ri}=Uo;Wr.value={top:ri?qo:qo-eo.top.value,left:ri?ei:ei-eo.left.value,isClampedY:ri,showing:Wr.value.showing},setTimeout(()=>{Wr.value.showing=!(Ko.y.value+Ko.height.value<0||Ko.y.value>Ur.height.value)},100)}}else Hr.setTableCellSelectionPopupOpen({open:!1})}},ko=To=>{if(!Yr.value){if(Vr.value=To,To||(setTimeout(()=>{Hr.setTableCellSelectionPopupOpen({open:!1})},100),Wr.value.showing=!1),To&&setTimeout(()=>{Hr.setTableCellSelectionPopupOpen({open:!0})},100),Vr.value){const Co=document.querySelector(`*[data-block-id="${Rr.selectedBlockId}"]`);Co instanceof HTMLElement&&(Gr.value=Co),nextTick(()=>{setTimeout(()=>{So()},50)})}if(Br.dragBlockId||ho.value||!Rr.selectedBlockId){const Co=window.getSelection();Co&&Co.removeAllRanges(),Lr.selection=null}}},$o=useTextSelection();watch($o.ranges,()=>{log("boop selectionState.ranges",$o.ranges.value,$o.text.value,$o.text.value.length,$o.text.value.trim().length,$o.ranges.value.length>0&&$o.text.value.length>0),$o.ranges.value.length>0&&$o.text.value.trim().length>0?ko(!0):ko(!1)},{deep:!0}),useEventListener("scroll",So,{capture:!0,passive:!0});const Go=lodashExports.debounce(ko,10),No=()=>{const To=!!Rr.selectedBlockId&&!!go.value&&Rr.selectedBlockId===go.value&&!Xr.value&&!Br.dragBlockId&&!ho.value&&!uo.value&&$o.ranges.value.length>0&&$o.text.value.length>0;To?Go(To):ko(To)},Eo=ref("");onMounted(()=>{if(Rr.selectedBlockId){Eo.value=`${Rr.selectedBlockId}-${Rr.columnId}-${Rr.rowId}`;const To=document.getElementById(Eo.value);To&&To.addEventListener("mouseup",No)}}),onBeforeUnmount(()=>{if(Eo.value){const To=document.getElementById(Eo.value);To&&To.removeEventListener("mouseup",No)}}),onKeyStroke(["ArrowLeft","ArrowUp","ArrowRight","ArrowDown"],()=>{No()}),watchEffect(()=>{No()});const Mo=[{id:"noList",name:"None",type:"paragraph",icon:"list-none"},{id:"bulletList",name:"Bullet",type:"paragraph",icon:"list-disc",symbol:"disc"},{id:"bulletList",name:"Arrow",type:"paragraph",icon:"list-arrow",symbol:"arrow"},{id:"orderedList",name:"Number",type:"paragraph",icon:"list-number-2"}],Ro=ref(Mo[0].name),Ao=ref(new Map),zo=To=>{var Co;return((Co=Lr.getTableEditor(Kr.value))==null?void 0:Co.isActive(To))??!1},Oo=async(To,Co)=>{const Po=Lr.getTableEditor(Kr.value);if(!Po||!Rr.selectedBlockId)return;const Fo=await queryHref(To);Po.chain().focus().toggleLink({href:Fo,target:"_blank"}).run(),Co(),Yr.value=!1},Bo=To=>{var Vo,Ko,Uo;const Co=Lr.getTableEditor(Kr.value);if(!Co||!Rr.selectedBlockId)return;const Po=(Uo=(Ko=(Vo=Co.view)==null?void 0:Vo.state)==null?void 0:Ko.selection)==null?void 0:Uo.empty;let Fo=Co.chain().focus();switch(Po&&(Fo=Co.chain().focus().selectAll()),To){case"bold":return Fo.toggleBold().run();case"italic":return Fo.toggleItalic().run();case"strike":return Fo.toggleStrike().run();case"link":return zo("link")?Fo.unsetLink().run():void 0}Ir.capture("change_text_style",{style:To,blockId:Rr.selectedBlockId})},bo=To=>{if(zo("link")){To(),Yr.value=!1;return}Bo("link")};watchEffect(()=>{const To=Lr.getTableEditor(Kr.value);if(!Vr.value||!To)return;const{from:Co,to:Po}=To.state.selection;if(Ao.value.clear(),To.state.doc.nodesBetween(Co,Po,(Fo,Vo,Ko)=>{Fo.isText||Fo.type.name==="text"||Ko&&Ko.type.name!=="doc"||((Fo.type.name==="paragraph"||Fo.type.name==="bulletList"||Fo.type.name==="orderedList")&&!Ao.value.has(Fo.type.name)?Ao.value.set(Fo.type.name,Mo.find(({id:Uo})=>Uo===Fo.type.name)):Fo.type.name==="heading"&&Ao.value.set(`h${Fo.attrs.level}`,Mo.find(({type:Uo,level:ei})=>Uo==="heading"&&ei===Fo.attrs.level)))}),Ao.value.size===0)Ro.value="Text",Ao.value.set("paragraph",Mo.find(({id:Fo})=>Fo==="text"));else if(Ao.value.size>1)Ro.value="Mixed";else{const[Fo]=Ao.value.values();Ro.value=(Fo==null?void 0:Fo.name)??"Text"}});const vo=computed(()=>Lr.getTableEditor(Kr.value)),Io=()=>vo.value;return(To,Co)=>(openBlock(),createBlock(Teleport,{to:Wr.value.isClampedY?"#main-app":`#teleport-${unref(Dr)}`},[createVNode(Transition,{name:"pane-fade"},{default:withCtx(()=>[Vr.value?(openBlock(),createElementBlock("div",{key:0,ref_key:"paneElement",ref:jr,class:"selection-pane table-menu",style:normalizeStyle({top:`${Wr.value.top}px`,left:`${Wr.value.left}px`,position:Wr.value.isClampedY?"fixed":"absolute",transform:"translateY(-100%)",opacity:Wr.value.showing?1:0})},[createBaseVNode("div",_hoisted_1$j,[createBaseVNode("div",_hoisted_2$f,[createVNode(_sfc_main$B,{selectedBlockId:unref(Dr)??null,selectedTextTypes:Ao.value,getEditor:Io},null,8,["selectedBlockId","selectedTextTypes"]),createBaseVNode("div",_hoisted_3$c,[createVNode(_sfc_main$y,{colorId:ao.value,onHighlight:lo},null,8,["colorId"]),(openBlock(!0),createElementBlock(Fragment$1,null,renderList(unref(textButtons),Po=>(openBlock(),createElementBlock(Fragment$1,{key:Po.id},[Po.id!=="link"?(openBlock(),createBlock(_sfc_main$z,{key:0,msg:Po.tooltip.msg,shortcut:Po.tooltip.shortcut},{trigger:withCtx(()=>[createBaseVNode("button",{class:normalizeClass(["flex justify-center items-center rounded-lg active:bg-neutralSolid-100 transition h-8 w-8",{"bg-neutralSolid-100":zo(Po.id),"hover:bg-neutralSolid-50":!zo(Po.id)}]),onClick:Fo=>Bo(Po.id)},[createVNode(_sfc_main$1v,{src:unref(assetUrl)(`icon-${Po.icon}.svg`)},null,8,["src"])],10,_hoisted_4$9)]),_:2},1032,["msg","shortcut"])):(openBlock(),createBlock(_sfc_main$Q,{key:1,appId:unref(Mr),tooltip:Po.tooltip.msg,savedLink:zo("link")?"link":"","onBtn:click":Co[0]||(Co[0]=Fo=>bo(Fo)),"onBtn:mousedown":Co[1]||(Co[1]=Fo=>Yr.value=!0),"onSave:link":Co[2]||(Co[2]=(Fo,Vo)=>Oo(Fo,Vo)),"onClose:popup":Co[3]||(Co[3]=Fo=>Yr.value=!1)},null,8,["appId","tooltip","savedLink"]))],64))),128))])])])],4)):createCommentVNode("",!0)]),_:1})],8,["to"]))}}),TableCellTextSelectionPane_vue_vue_type_style_index_0_scoped_92d77561_lang="",TableCellTextSelectionPane=_export_sfc(_sfc_main$x,[["__scopeId","data-v-92d77561"]]),_hoisted_1$i=["id"],_hoisted_2$e=["id"],_hoisted_3$b=["id","onMouseover"],TABLE_RESIZER_PADDING=8,TABLE_RESIZER_WIDTH=3,DIFF_BT_COL_RESIZER_AND_DROPZONE_HEIGHTS=0,_sfc_main$w=defineComponent({__name:"TableEmbed",props:{blockId:{},borderRadius:{default:16},gap:{default:4},textAlignment:{default:"left"},verticalAlignment:{default:"center"},scale:{default:1},isPreview:{type:Boolean},isActive:{type:Boolean},hasZebraStripes:{type:Boolean},hasHeaderColumn:{type:Boolean,default:!1},hasHeaderRow:{type:Boolean,default:!0},appId:{}},emits:["change","changed-height"],setup(Tr,{emit:Cr}){const $r=Tr,{textAlignment:Ar,verticalAlignment:Rr,borderRadius:Dr,gap:Mr,scale:Br,isPreview:Nr,isActive:Lr,hasHeaderRow:Hr,hasHeaderColumn:zr,hasZebraStripes:Ur}=toRefs$1($r),Vr=Cr;provide("appId",$r.appId);const{width:jr}=useWindowSize(),Gr=computed(()=>getCategoryByWidth(jr.value)),Xr=computed(()=>Gr.value==="mobile"),Kr=ref(!1),Zr=ref(!1),eo=inject("showingFullPage"),Wr=inject("showingFullScreen"),Yr=inject("selectedBlockId"),Jr=inject("selectionMenuBlockId"),no=inject("isReadOnly"),ro=useAppStore(),so=useBlockStore(),ao=usePageStore(),lo=useMiscStore(),po=useCommandBarStore(),go=useArtboardStore(),co=useEditorStore(),mo=computed(()=>ro.isViewOnly($r.appId)),io=computed(()=>Nr.value?1:Br.value),uo=computed(()=>ro.borderRadius($r.appId)),ho=computed(()=>go.isAnyBlockResizing),yo=computed(()=>{if(Mr.value<=0||uo.value<=0)return"0px";let Ho=design.cornerRadius.table.cell.default;return Xr.value&&(Ho=design.cornerRadius.table.cell.mobile),ro.smallText($r.appId)&&(Ho=design.cornerRadius.table.cell.small),Ho*io.value}),So=computed(()=>Mr.value===0?"#ccc":"transparent"),ko=computed(()=>so.config($r.blockId)),$o=computed(()=>so.positionByDisplay($r.blockId)),Go=computed(()=>{var Ho,Yo,Qo;return(Yo=(Ho=ko.value)==null?void 0:Ho.colStore)!=null&&Yo.value?(Qo=ko.value.colStore)==null?void 0:Qo.value:{}}),No=computed(()=>Go.value.order.map(Ho=>Go.value.store[Ho]).filter(Ho=>!Ho.isHidden)),Eo=computed(()=>Go.value.order),Mo=ref([]),Ro=computed(()=>{const Ho=so.positionByDisplay($r.blockId).width*io.value;return Xr.value?Ho:Ho-Mr.value*io.value*(No.value.length-1)}),Ao=ref(No.value.map(Ho=>({id:Ho.id,width:Ho.width})));onMounted(()=>{Mo.value=No.value.map(Ho=>Ho.name),Ao.value=No.value.map(Ho=>({id:Ho.id,width:Ho.width}))}),no.value||watch(Eo,()=>{Mo.value=No.value.map(Ho=>Ho.name)});const zo=computed(()=>Xr.value?Ro.value:Ao.value.reduce((Ho,Yo)=>Ho+Yo.width,0)),Oo=computed(()=>Xr.value?0:0*io.value),Bo=computed(()=>{let Ho=4;return ro.smallText($r.appId)&&(Ho=4),`${Ho*io.value}px`}),bo=computed(()=>{var Ho,Yo,Qo;return(Yo=(Ho=ko.value)==null?void 0:Ho.rowStore)!=null&&Yo.value?(Qo=ko.value.rowStore)==null?void 0:Qo.value:{}}),vo=computed(()=>bo.value.order.map(Ho=>bo.value.store[Ho]).filter(Ho=>!Ho.isHidden)),Io=computed(()=>vo.value.length>1&&No.value.length>1&&!no.value&&!Xr.value),To=computed(()=>vo.value.map(Ho=>`row-${Ho.id}`)),Co=computed(()=>No.value.map(Ho=>Ho.id)),Po=computed(()=>{if(!vo.value.length)return[];const Ho=vo.value[0].id;return No.value.map(Yo=>`${$r.blockId}-${Yo.id}-${Ho}`)}),Fo=theme.appTheme(),Vo=computed(()=>so.parentId($r.blockId)??""),Ko=computed(()=>ro.getThemeObject($r.appId,Vo.value)),Uo=computed(()=>{var Ho,Yo,Qo;return((Qo=(Yo=(Ho=Ko.value)==null?void 0:Ho.block)==null?void 0:Yo.none)==null?void 0:Qo.lightUp)??Fo.colors.brandPurple}),ei=computed(()=>{var Ho,Yo,Qo;return((Qo=(Yo=(Ho=Ko.value)==null?void 0:Ho.block)==null?void 0:Yo.none)==null?void 0:Qo.background)??"#FFFFFF"}),qo=ref(null),ri=ref(null),ki=ref(null),ti=ref(""),ai=ref(null),Xo=ref(null),si=ref(""),vi=ref(null),Ci=ref(null),wi=()=>{lo.setTableSelectionRange({id:$r.blockId,from:null,to:null}),ai.value=null,vi.value=null,Ci.value=null},{draggingType:bi,dropzoneColInd:li,dropzoneNotAroundDraggedEl:ci,dropzoneRowInd:Ii,dragTableSetup:Ni}=useTableDragAndDrop({appId:toRef$1($r.appId),allowDragging:Io,blockId:toRef$1($r.blockId),borderColor:Uo,colIds:Co,colCellIds:Po,mainTable:qo,rowIds:To,scale:Br,deselectAll:wi}),Ei=computed(()=>!eo.value&&!Wr.value&&!mo.value&&!Nr.value&&!Xr.value&&!bi.value),$i=computed(()=>{var Ho,Yo,Qo;return(Yo=(Ho=ko.value)==null?void 0:Ho.cellStore)!=null&&Yo.value?(Qo=ko.value.cellStore)==null?void 0:Qo.value:{}}),Ri=computed(()=>{const Ho={justifyContent:"flex-start"};return(Rr==null?void 0:Rr.value)==="center"?Ho.justifyContent="center":(Rr==null?void 0:Rr.value)==="bottom"&&(Ho.justifyContent="flex-end"),Ho}),Fi=computed(()=>ao.isDividerSlide(Vo.value)),bs=computed(()=>ro.deckTheme($r.appId)),qi=computed(()=>{var Qo,ui,yi,gi,Si;const Ho=((ui=(Qo=so.config($r.blockId))==null?void 0:Qo.backgroundColor)==null?void 0:ui.selectedId)??"none";return!theme.blockColorTypes.includes(Ho)&&Ho!=null?theme.isWhiteColor({color:Ho})?((gi=(yi=Ko.value.block)==null?void 0:yi.none)==null?void 0:gi.background)??Ho:Ho:((Si=Ko.value.block[Ho])==null?void 0:Si.background)||Ko.value.block.none.background}),Mi=computed(()=>{var Ho,Yo;return((Yo=(Ho=Ko.value)==null?void 0:Ho.table)==null?void 0:Yo.defaultCellBackground)??"#F9F9F9"}),Ui=computed(()=>{var Ho,Yo;return((Yo=(Ho=Ko.value)==null?void 0:Ho.table)==null?void 0:Yo.headerCellBackground)??"#F1F1F1"}),Ki=computed(()=>{let Ho=Mi.value;return Ur!=null&&Ur.value&&Hr.value&&(Ho=Ui.value),Ho}),Ss=computed(()=>{let Ho=Mi.value;return Ur!=null&&Ur.value&&Hr.value&&(Ho=Mi.value),Ur!=null&&Ur.value&&!Hr.value&&(Ho=Ui.value),Ho}),gs=computed(()=>Ui.value),Fs=computed(()=>{const Ho=qi.value;return Kr.value&&!Zr.value&&!Lr.value&&Ei.value?theme.getSofterColor(Ho,.04):Zr.value&&!Lr.value&&Ei.value?theme.getSofterColor(Ho,.08):Ho}),Yi=Ho=>theme.tableColors.find(({id:Yo})=>Yo===Ho),vs=theme.textOpacities.map(Ho=>Ho.id),fs=(Ho,Yo)=>Hr.value&&Yo===0||zr.value&&Ho===0?gs.value:Yo%2===0?Ki.value:Ss.value,da=(Ho,Yo,Qo,ui)=>{var Bi,zi,Ti,cs,es,ns,qs,ya;const yi=so.config($r.blockId),gi=(cs=(Ti=(zi=(Bi=yi==null?void 0:yi.cellStore)==null?void 0:Bi.value)==null?void 0:zi.store)==null?void 0:Ti[Ho])==null?void 0:cs[Yo],Si=(es=gi==null?void 0:gi.style)==null?void 0:es.color,Do=((ns=gi==null?void 0:gi.style)==null?void 0:ns.timestamp)??0;if(vs.includes(Si))return{value:fs(Qo,ui),timestamp:Do};const Wo=Yi((qs=gi==null?void 0:gi.style)==null?void 0:qs.background);return Wo?{value:Wo[Fi.value?"onDividerSlide":"onRegSlide"].color,timestamp:Do}:{value:(ya=gi==null?void 0:gi.style)==null?void 0:ya.background,timestamp:Do}},di=(Ho,Yo,Qo)=>{var Wo,Bi,zi,Ti,cs,es;const ui=so.config($r.blockId),yi=(Ti=(zi=(Bi=(Wo=ui==null?void 0:ui.cellStore)==null?void 0:Wo.value)==null?void 0:Bi.store)==null?void 0:zi[Ho])==null?void 0:Ti[Yo],gi=(cs=yi==null?void 0:yi.style)==null?void 0:cs.color,Si=((es=yi==null?void 0:yi.style)==null?void 0:es.timestamp)??0;if(gi==="default")return{value:"#0D0C0C",timestamp:Si};if(gi==="grey")return["red","orange","green","blue","purple","pink"].includes(bs.value)&&Fi.value?Ur.value&&Qo%2?{value:"rgba(255, 255, 255, 0.6)",timestamp:Si}:{value:"rgba(255, 255, 255, 0.7)",timestamp:Si}:{value:"rgba(0, 0, 0, 0.5)",timestamp:Si};const Do=Yi(gi);return Do?{value:Do[Fi.value?"onDividerSlide":"onRegSlide"].textColor,timestamp:Si}:{value:gi,timestamp:Si}},ss=(Ho,Yo,Qo)=>{var Wo,Bi,zi,Ti,cs,es,ns;const ui=so.config($r.blockId),yi=(zi=(Bi=(Wo=ui==null?void 0:ui.colStore)==null?void 0:Wo.value)==null?void 0:Bi.store)==null?void 0:zi[Ho],gi=(Ti=yi==null?void 0:yi.style)==null?void 0:Ti.color,Si=((cs=yi==null?void 0:yi.style)==null?void 0:cs.timestamp)??0;if(vs.includes(gi))return{value:fs(Yo,Qo),timestamp:Si};const Do=Yi((es=yi==null?void 0:yi.style)==null?void 0:es.background);return Do?{value:Do[Fi.value?"onDividerSlide":"onRegSlide"].color,timestamp:Si}:{value:(ns=yi==null?void 0:yi.style)==null?void 0:ns.background,timestamp:Si}},Ls=(Ho,Yo)=>{var Do,Wo,Bi,zi,Ti;const Qo=so.config($r.blockId),ui=(Bi=(Wo=(Do=Qo==null?void 0:Qo.colStore)==null?void 0:Do.value)==null?void 0:Wo.store)==null?void 0:Bi[Ho],yi=(zi=ui==null?void 0:ui.style)==null?void 0:zi.color,gi=((Ti=ui==null?void 0:ui.style)==null?void 0:Ti.timestamp)??0;if(yi==="default")return{value:"#0D0C0C",timestamp:gi};if(yi==="grey")return["red","orange","green","blue","purple","pink"].includes(bs.value)&&Fi.value?Ur.value&&Yo%2?{value:"rgba(255, 255, 255, 0.6)",timestamp:gi}:{value:"rgba(255, 255, 255, 0.7)",timestamp:gi}:{value:"rgba(0, 0, 0, 0.5)",timestamp:gi};const Si=Yi(yi);return Si?{value:Si[Fi.value?"onDividerSlide":"onRegSlide"].textColor,timestamp:gi}:{value:yi,timestamp:gi}},ha=(Ho,Yo,Qo)=>{var Bi,zi,Ti,cs,es,ns;const ui=so.config($r.blockId),yi=(Ti=(zi=(Bi=ui==null?void 0:ui.rowStore)==null?void 0:Bi.value)==null?void 0:zi.store)==null?void 0:Ti[Ho],gi=(cs=yi==null?void 0:yi.style)==null?void 0:cs.color,Si=((es=yi==null?void 0:yi.style)==null?void 0:es.timestamp)??0;if(vs.includes(gi))return{value:fs(Yo,Qo),timestamp:Si};const Do=(ns=yi==null?void 0:yi.style)==null?void 0:ns.background,Wo=Yi(Do);return Wo?{value:Wo[Fi.value?"onDividerSlide":"onRegSlide"].color,timestamp:Si}:{value:Do,timestamp:Si}},na=(Ho,Yo)=>{var Do,Wo,Bi,zi,Ti;const Qo=so.config($r.blockId),ui=(Bi=(Wo=(Do=Qo==null?void 0:Qo.rowStore)==null?void 0:Do.value)==null?void 0:Wo.store)==null?void 0:Bi[Ho],yi=(zi=ui==null?void 0:ui.style)==null?void 0:zi.color,gi=((Ti=ui==null?void 0:ui.style)==null?void 0:Ti.timestamp)??0;if(yi==="default")return{value:"#0D0C0C",timestamp:gi};if(yi==="grey")return["red","orange","green","blue","purple","pink"].includes(bs.value)&&Fi.value?Ur.value&&Yo%2?{value:"rgba(255, 255, 255, 0.6)",timestamp:gi}:{value:"rgba(255, 255, 255, 0.7)",timestamp:gi}:{value:"rgba(0, 0, 0, 0.5)",timestamp:gi};const Si=Yi(yi);return Si?{value:Si[Fi.value?"onDividerSlide":"onRegSlide"].textColor,timestamp:gi}:{value:yi,timestamp:gi}},wa=(Ho,Yo)=>{var yi,gi;const Qo=(yi=No.value[Ho])==null?void 0:yi.id,ui=(gi=vo.value[Yo])==null?void 0:gi.id;if(Qo!=null&&ui!=null){const Si=da(Qo,ui,Ho,Yo),Do=ss(Qo,Ho,Yo),Wo=ha(ui,Ho,Yo);if(Si.timestamp===0&&Do.timestamp===0&&Wo.timestamp===0)return Si.value!=null&&Si.value!==theme.TABLE_DEFAULT_GREY?Si.value:Si.value!=null&&Si.value===theme.TABLE_DEFAULT_GREY?fs(Ho,Yo):Do.value!=null&&Do.value!==theme.TABLE_DEFAULT_GREY?Do.value:Do.value!=null&&Do.value===theme.TABLE_DEFAULT_GREY?fs(Ho,Yo):Wo.value!=null&&Wo.value!==theme.TABLE_DEFAULT_GREY?Wo.value:fs(Ho,Yo);if(Si.value==null&&Do.value==null&&Wo.value==null)return fs(Ho,Yo);if(Si.timestamp>=Do.timestamp&&Si.timestamp>=Wo.timestamp)return Si.value!=null&&Si.value!==theme.TABLE_DEFAULT_GREY?Si.value:fs(Ho,Yo);if(Do.timestamp>=Si.timestamp&&Do.timestamp>=Wo.timestamp)return Do.value!=null&&Do.value!==theme.TABLE_DEFAULT_GREY?Do.value:fs(Ho,Yo);if(Wo.timestamp>=Si.timestamp&&Wo.timestamp>=Do.timestamp)return Wo.value!=null&&Wo.value!==theme.TABLE_DEFAULT_GREY?Wo.value:fs(Ho,Yo)}return fs(Ho,Yo)},ys=(Ho,Yo)=>{const Qo=wa(Ho,Yo);return Kr.value&&!Zr.value&&!Lr.value&&Ei.value?theme.getSofterColor(Qo,.04):Zr.value&&!Lr.value&&Ei.value?theme.getSofterColor(Qo,.08):Qo},ls=(Ho,Yo)=>{var Qo,ui;return((ui=(Qo=Ko.value)==null?void 0:Qo.table)==null?void 0:ui.color)??"#0D0C0C"},Hs=(Ho,Yo)=>{var yi,gi;const Qo=(yi=No.value[Ho])==null?void 0:yi.id,ui=(gi=vo.value[Yo])==null?void 0:gi.id;if(Qo!=null&&ui!=null){const Si=di(Qo,ui,Yo),Do=Ls(Qo,Yo),Wo=na(ui,Yo);if(Si.timestamp===0&&Do.timestamp===0&&Wo.timestamp===0)return Si.value!=null&&Si.value!==theme.TABLE_DEFAULT_GREY_TEXT?Si.value:Si.value!=null&&Si.value===theme.TABLE_DEFAULT_GREY_TEXT?ls():Do.value!=null&&Do.value!==theme.TABLE_DEFAULT_GREY_TEXT?Do.value:Do.value!=null&&Do.value===theme.TABLE_DEFAULT_GREY_TEXT?ls():Wo.value!=null&&Wo.value!==theme.TABLE_DEFAULT_GREY_TEXT?Wo.value:ls();if(Si.value==null&&Do.value==null&&Wo.value==null)return ls();if(Si.timestamp>=Do.timestamp&&Si.timestamp>=Wo.timestamp)return Si.value!=null&&Si.value!==theme.TABLE_DEFAULT_GREY_TEXT?Si.value:ls();if(Do.timestamp>=Si.timestamp&&Do.timestamp>=Wo.timestamp)return Do.value!=null&&Do.value!==theme.TABLE_DEFAULT_GREY_TEXT?Do.value:ls();if(Wo.timestamp>=Si.timestamp&&Wo.timestamp>=Do.timestamp)return Wo.value!=null&&Wo.value!==theme.TABLE_DEFAULT_GREY_TEXT?Wo.value:ls()}return ls()},ra=computed(()=>uo.value>0?`${Dr.value*$r.scale}px`:"0px"),ps=computed(()=>lo.getTableSelectionRange($r.blockId)),Ms=computed(()=>!Nr.value&&!eo.value&&!Wr.value&&!mo.value&&ps.value.from!=null&&ps.value.to!=null),ds=computed(()=>{var Ho,Yo;return{colId:(Ho=ps.value.from)==null?void 0:Ho.col,rowId:(Yo=ps.value.from)==null?void 0:Yo.row}}),rs=computed(()=>po.getIsCommandBarOpen),Zs=ref({top:0,left:0,width:0,height:0}),Js=useElementBounding$1(qo),Ai=useElementBounding$1(ri),$s=ref({top:0,left:0,width:0}),Ps=ref({top:0,left:0,height:0}),Os=()=>{if(!qo.value)return;const Ho=document.getElementById(`mainTable-${$r.blockId}`);if(!Ho)return;const Yo=Ho.getBoundingClientRect(),Qo=document.getElementById(`tableBlock-${$r.blockId}`);if(!Qo)return;const ui=Qo.getBoundingClientRect();$s.value={top:(Yo.bottom+ADD_BUTTON_GAP+2+ADD_BUTTON_DIM>ui.bottom?ui.bottom:Yo.bottom)+ADD_BUTTON_GAP+2-Ai.top.value,left:Yo.left+4-Ai.left.value,width:Yo.width-8}},Bs=()=>{var Do;if(!qo.value)return;const Ho=document.getElementById(`mainTable-${$r.blockId}`);if(!Ho)return;const Yo=Ho.getBoundingClientRect(),Qo=(Do=ri.value)==null?void 0:Do.parentElement;if(!Qo)return;const ui=Qo.getBoundingClientRect(),yi=Math.max(Yo.top,ui.top),Si=Math.min(Yo.bottom,ui.bottom)-yi;Ps.value={top:yi-Ai.top.value,left:Yo.left+Yo.width+ADD_BUTTON_GAP+2-Ai.left.value,height:Si}};onMounted(()=>{Os(),Bs()}),no.value||(watchEffect(()=>{Os(),Bs()}),watch(Rr,async()=>{await nextTick(),Os(),Bs()}),watch($o,async()=>{await nextTick(),Os(),Bs()},{deep:!0}),watch(Js.bottom,()=>{Os(),Bs()}),watch(Js.top,()=>{Os(),Bs()}));const Es=computed(()=>vi.value!=null||ai.value!=null),Xa=ref(!1),cl=ref(!1),Za=ref(!1),Da=ref(!1),Ja=computed(()=>Ei.value),Ma=ref({top:0,left:0}),Ba=ref({top:0,left:0}),fa=(Ho,Yo)=>`${$r.blockId}-${Ho}-${Yo}`,Ks=()=>{if(ki.value==null||ai.value!=null||!qo.value||No.value.findIndex(ui=>ui.id===ki.value)===-1)return;const Yo=document.getElementById(fa(ki.value,vo.value[0].id));if(!Yo)return;const Qo=Yo.getBoundingClientRect();Ma.value={top:Qo.top-Ai.top.value,left:Qo.left-Ai.left.value+Qo.width/2}};watch(ki,Ho=>{Ks(),Ho!=null&&(ti.value=Ho)});const oa=()=>{if(Xo.value==null||vi.value!=null||!qo.value||vo.value.findIndex(ui=>ui.id===Xo.value)===-1)return;const Yo=document.getElementById(fa(No.value[0].id,Xo.value));if(!Yo)return;const Qo=Yo.getBoundingClientRect();Ba.value={top:Qo.top-Ai.top.value+Qo.height/2,left:Qo.left-Ai.left.value}};onMounted(()=>{Ks(),oa()}),no.value||(watch(Xo,Ho=>{oa(),Ho!=null&&(si.value=Ho)}),watchEffect(()=>{Ks(),oa()}),watch(Rr,async()=>{await nextTick(),Ks(),oa()}),watch(Js.bottom,()=>{Ks(),oa()}),watch(Js.top,()=>{Ks(),oa()}),watch($o,async()=>{await nextTick(),Ks(),oa()},{deep:!0}),watch(No,async()=>{await nextTick(),Ks(),oa()},{deep:!0}));const ja=computed(()=>Ei.value),Ia=computed(()=>Ei.value),Qa=Ho=>{var yi;if(Ho.from==null||Ho.to==null){Zs.value={top:0,left:0,width:0,height:0},lo.setTableEditingState({tableId:$r.blockId,isEditing:!1});return}const Yo=(yi=qo.value)==null?void 0:yi.getBoundingClientRect();if(!Yo)return;const Qo=document.getElementById(fa(Ho.from.col,Ho.from.row)),ui=document.getElementById(fa(Ho.to.col,Ho.to.row));if(Qo&&ui){const gi=Qo.getBoundingClientRect(),Si=ui.getBoundingClientRect();Zs.value={top:Math.min(gi.top,Si.top)-Yo.top,left:Math.min(gi.left,Si.left)-Yo.left,width:Math.abs(gi.left-Si.left)+Si.width,height:Math.abs(gi.top-Si.top)+Si.height},lo.setTableEditingState({tableId:$r.blockId,isEditing:!0})}};no.value||(watch(ps,Ho=>{Qa(Ho)},{deep:!0}),watch(Br,async()=>{await nextTick(),Qa(ps.value)})),computed(()=>({top:`${Zs.value.top}px`,left:`${Zs.value.left}px`,width:`${Zs.value.width}px`,height:`${Zs.value.height}px`,zIndex:10}));const ul=(Ho,Yo)=>{if(!Nr.value){if(Yr.value!==$r.blockId){Yr.value=$r.blockId;return}lo.setTableSelectionRange({id:$r.blockId,from:{col:Ho,row:Yo},to:{col:Ho,row:Yo}}),ai.value=null,vi.value=null,Ci.value={colId:Ho,rowId:Yo},Jr.value=$r.blockId}},$l=(Ho,Yo)=>{};watchEffect(()=>{$r.isActive||wi()});const Al=lodashExports.debounce((Ho,Yo,Qo)=>{useUpdateTableCell({tableId:$r.blockId,colId:Ho,rowId:Yo,value:Qo})},500),tl=(Ho,Yo,Qo)=>{lo.isPastingTable||lo.isUndoRedoing||(Al(Ho,Yo,Qo),Qa(ps.value))};lodashExports.debounce((Ho,Yo)=>{useUpdateTableColumnName({tableId:$r.blockId,colId:Ho,value:Yo})},500);const Yl=computed(()=>({fontSize:"16px"})),Rl=({colId:Ho,changeX:Yo,positionX:Qo})=>{const ui=No.value.findIndex(es=>es.id===Ho);if(ui===-1)return!1;const yi=Yo*zo.value/Ro.value,Si=No.value[ui].width+yi;if(Sies+ns.width,0),Bi=Do.map(es=>es.width),zi=Wo-yi,Ti=Bi.map(es=>es/Wo*zi);return Ti.some(es=>es{Ao.value[ui+1+ns].width=Ti[ns]}),!0)},dl=()=>{useUpdateTableColumnWidths({tableId:$r.blockId,columnWidths:Ao.value})},pa=ref(No.value.slice(0,-1).map(()=>!1)),js=ref(No.value.slice(0,-1).map(()=>!1)),Qs=computed(()=>js.value.some(Ho=>Ho));no.value||watch(No,()=>{Qs.value||(Ao.value=No.value.map(Ho=>({id:Ho.id,width:Ho.width})))},{deep:!0});const Ws=ref(No.value.slice(0,-1).map(Ho=>({x:0,y:0}))),Pl=ref(0),nl=ref([]),hl=ref([{x:0,y:0},...vo.value.map(()=>({x:0,y:0}))]),rl=ref([]),Ol=(Ho,Yo,Qo)=>{Ws.value[Ho]||(Ws.value[Ho]={x:0,y:0});let ui=Yo;for(let yi=0;yi0&&(ui+=Mr.value*io.value);Ws.value[Ho].x=ui-(TABLE_RESIZER_PADDING+TABLE_RESIZER_WIDTH/2-Mr.value/2)*io.value,Ws.value[Ho].y=Qo},ol=computed(()=>TABLE_RESIZER_WIDTH*Br.value),Fl=computed(()=>`${ol.value}px`),Dl=ref(0),Ml=computed(()=>`${Js.width.value??0}px`),Xl=Ho=>{var Yo,Qo;if((Yo=rl.value)!=null&&Yo.length){let ui=Ho.top;const yi=.5*ol.value,gi=[{x:Ho.left,y:ui-1.25*ol.value}],Si=.5*Mr.value*io.value;for(let Do=0;Do{if(Qs.value||Nr.value||!qo.value)return;const Ho=qo.value.getBoundingClientRect();if(!Ho)return;const Yo=qo.value.parentElement;if(!Yo)return;const Qo=Yo.getBoundingClientRect();if(!Qo)return;const ui=Math.max(Ho.top-DIFF_BT_COL_RESIZER_AND_DROPZONE_HEIGHTS/2,Qo.top),yi=Math.max(Ho.top,Qo.top);No.value.slice(0,-1).forEach((gi,Si)=>{Ol(Si,Qo.left,ui)}),Xl(Ho),Pl.value=Math.min(Ho.height+DIFF_BT_COL_RESIZER_AND_DROPZONE_HEIGHTS,Qo.height),Dl.value=Math.min(Ho.height,Qo.height),nl.value=[{x:Ho.left,y:yi},...Ws.value.map(gi=>({...gi,y:yi})),{x:Ho.right-ol.value,y:yi}]};no.value||watch(()=>lo.isPastingTable,()=>{wi(),Ds()});const Zl=async()=>{Ci.value=null,useAddEmptyTableColumn({tableId:$r.blockId}),Ws.value.push({x:0,y:0}),pa.value.push(!1),js.value.push(!1),await nextTick(),Ds()},Bl=async({colId:Ho})=>{const Yo=No.value.findIndex(Qo=>Qo.id===Ho);useDeleteTableColumn({tableId:$r.blockId,colId:Ho}),ai.value=null,Ws.value.splice(Yo,1),pa.value.splice(Yo,1),js.value.splice(Yo,1),await nextTick(),Ds()},ia=async({colId:Ho,direction:Yo})=>{const Qo=No.value.findIndex(gi=>gi.id===Ho);if(Qo===-1)return;ai.value=null;const ui=Yo==="right"?Qo+1:Qo,yi=useAddEmptyTableColumn({tableId:$r.blockId,index:ui});Ws.value.splice(ui,0,{x:0,y:0}),pa.value.splice(ui,0,!1),js.value.splice(ui,0,!1),await nextTick(),Ds(),ul(yi,vo.value[0].id),co.tableEditors[`${Yr.value}-${yi}-${vo.value[0].id}`].commands.focus(),ki.value=yi,Ks()},{scrollIntoView:Jl}=useScrollIntoView({update:()=>Ds()}),Ql=async()=>{Ci.value=null,useAddEmptyTableRow({tableId:$r.blockId}),await nextTick(),Ds(),await nextTick(),setTimeout(()=>{Jl({elRef:qo})},0)},ec=async({rowId:Ho})=>{useDeleteTableRow({tableId:$r.blockId,rowId:Ho}),vi.value=null,await nextTick(),Ds()},Hl=async({rowId:Ho,direction:Yo})=>{const Qo=vo.value.findIndex(gi=>gi.id===Ho);if(Qo===-1)return;vi.value=null;const ui=Yo==="below"?Qo+1:Qo,yi=useAddEmptyTableRow({tableId:$r.blockId,index:ui});await nextTick(),Ds(),ul(No.value[0].id,yi),co.tableEditors[`${Yr.value}-${No.value[0].id}-${yi}`].commands.focus(),Xo.value=yi,oa()};no.value||(watch(Rr,async()=>{await nextTick(),Ds()}),watch(Js.bottom,async()=>{await nextTick(),Ds()}),watch(Js.top,async()=>{await nextTick(),Ds()}),watch($o,async()=>{await nextTick(),Ds()},{deep:!0}),watch(No,async()=>{await nextTick(),Ds()},{deep:!0}));const fl=ref(0),xs=async({rowId:Ho})=>{useClearRowContents({tableId:$r.blockId,rowId:Ho}),fl.value+=1},ws=async({colId:Ho})=>{useClearColumnContents({tableId:$r.blockId,colId:Ho}),fl.value+=1},tc=async({colId:Ho})=>{const Yo=No.value.findIndex(ui=>ui.id===Ho);if(Yo===-1)return;ai.value=null;const Qo=Yo+1;useDuplicateTableColumn({tableId:$r.blockId,colId:Ho}),Ws.value.splice(Qo,0,{x:0,y:0}),pa.value.splice(Qo,0,!1),js.value.splice(Qo,0,!1),await nextTick(),Ds()},Oi=async({rowId:Ho})=>{vo.value.findIndex(Qo=>Qo.id===Ho)!==-1&&(vi.value=null,useDuplicateTableRow({tableId:$r.blockId,rowId:Ho}),await nextTick(),Ds())},Zi=(Ho,Yo,Qo)=>{js.value[Qo]=!0},ji=(Ho,Yo,Qo)=>Rl({colId:No.value[Qo].id,changeX:Math.floor(Ho.x)-Ws.value[Qo].x,positionX:Ho.x}),sa=async(Ho,Yo,Qo)=>{js.value[Qo]=!1,dl(),Yr.value=$r.blockId,await nextTick(),await nextTick(),Ds()},Gs=ref(!1);onMounted(()=>{Nr.value||setTimeout(()=>{Ds(),Gs.value=!0},100)});const pl=({rowId:Ho,colId:Yo})=>{var Bi,zi,Ti,cs,es,ns,qs,ya,yl,_l,bc,kc,Nc;const Qo=((Bi=ps.value.from)==null?void 0:Bi.row)===Ho&&((zi=ps.value.from)==null?void 0:zi.col)===Yo,ui=((Ti=ps.value.to)==null?void 0:Ti.row)===Ho&&((cs=ps.value.to)==null?void 0:cs.col)===Yo,yi=((es=ps.value.from)==null?void 0:es.col)===Yo&&((ns=ps.value.to)==null?void 0:ns.col)===Yo,gi=((qs=ps.value.from)==null?void 0:qs.row)==null,Si=((ya=ps.value.from)==null?void 0:ya.row)===Ho&&((yl=ps.value.to)==null?void 0:yl.row)===Ho,Do=((_l=ps.value.from)==null?void 0:_l.col)!==((bc=ps.value.to)==null?void 0:bc.col),Wo=((kc=ps.value.from)==null?void 0:kc.row)!==((Nc=ps.value.to)==null?void 0:Nc.row);return Qo||ui||yi&&gi&&Wo||Si&&Do},ml=ref(!1);computed(()=>lo.getIsSlideInTransition);const Rs=()=>{nextTick(()=>{ml.value=!1,lo.setTableSelectionRange({id:$r.blockId,from:{col:ti.value,row:null},to:{col:ti.value,row:vo.value[vo.value.length-1].id}}),vi.value=null,Ci.value=null,ai.value=ti.value,Jr.value=$r.blockId})},zl=()=>{nextTick(()=>{ml.value=!1,lo.setTableSelectionRange({id:$r.blockId,from:{col:No.value[0].id,row:si.value},to:{col:No.value[No.value.length-1].id,row:si.value}}),ai.value=null,Ci.value=null,vi.value=si.value,Jr.value=$r.blockId})},Wa=Ho=>{Ho.target.classList.contains("full-table")&&(ai.value=null,vi.value=null,Ci.value=null,lo.setTableSelectionRange({id:$r.blockId,from:null,to:null}),Jr.value=$r.blockId)},nc=ref(0),rc=()=>{const Ho=Js.height.value/io.value;nc.value!==Ho&&Vr("changed-height",Js.height.value/io.value+(Oo.value+Oo.value)/io.value)};no.value||useResizeObserver(qo,()=>{Nr.value||rc()});const ma=computed(()=>go.isDraggingResizing);no.value||watch(ma,Ho=>{Ho||setTimeout(()=>{Ds(),Os(),Bs()},DROP_TRANSITION_DELAY)}),no.value||watch(bi,Ho=>{Ho||(Yr.value=$r.blockId)});const oc=(Ho,Yo,Qo)=>{Ho.stopPropagation(),!(!Io.value||!Qo)&&(Yo==="row"?Ni(Ho,"rows",[`row-${Qo}`],Co.value):Ni(Ho,"cols",vo.value.map(ui=>`${$r.blockId}-${Qo}-${ui.id}`),[Qo]))},lc=Ho=>{lo.setTableSelectionRange({id:$r.blockId,from:null,to:null}),Ho==="row"?vi.value=null:ai.value=null},yc=()=>{Kr.value=!1,ki.value=null,Xo.value=null,Zr.value=!1},vl=Ho=>{var Yo;return((Yo=Ao.value[Ho])==null?void 0:Yo.width)??180},{isAnimationInPrgress:_c,startAnimation:Mc,getAnimationDelay:aa,animationDuration:Bc}=useAnimationForTable({blockId:toRefs$1($r).blockId,isPreview:Nr,isReadOnly:no,rows:vo,columns:No}),la=computed(()=>lo.tableCellSelectionPopupOpen);return no.value||watch(Yr,Ho=>{Ho!==$r.blockId&&lo.setTableCellSelectionPopupOpen({open:!1})}),(Ho,Yo)=>(openBlock(),createElementBlock("div",{ref_key:"fullTable",ref:ri,id:`${unref(Nr)?"preview-":""}tableBlock-${$r.blockId}`,class:"flex flex-col w-full h-full sm:max-h-full sm:overflow-y-hidden sm:overflow-x-hidden overflow-auto custom-scrollbar relative full-table",style:normalizeStyle({padding:`${Oo.value}px 0px`,...Ri.value,background:Fs.value}),onMouseover:Yo[22]||(Yo[22]=Qo=>Kr.value=!0),onMouseleave:yc,onClick:Wa,onMousedown:Yo[23]||(Yo[23]=Qo=>Zr.value=!0),onMouseup:Yo[24]||(Yo[24]=Qo=>Zr.value=!1)},[createBaseVNode("div",{ref_key:"mainTable",ref:qo,id:`${unref(Nr)?"preview-":""}mainTable-${Ho.blockId}`,class:"flex flex-col w-full sm:justify-center items-center relative",style:normalizeStyle({gap:Bo.value})},[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(vo.value,(Qo,ui)=>(openBlock(),createElementBlock("div",{key:Qo.id,class:"w-full flex flex-col",ref_for:!0,ref:yi=>{yi&&(rl.value[ui]=yi)}},[createBaseVNode("div",{id:`${unref(Nr)?"preview-":""}row-${Qo.id}`,class:"flex sm:items-center items-stretch min-h-[32px]",style:normalizeStyle({gap:Bo.value,borderColor:So.value}),onMouseover:yi=>Xo.value=Qo.id},[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(No.value,(yi,gi)=>(openBlock(),createBlock(TableCell,{key:`${yi.id}-${fl.value}`,row:Qo,col:yi,"block-id":$r.blockId,cell:$i.value.store[yi.id][Qo.id],scale:io.value,isPreview:unref(Nr),isEditable:Ei.value&&unref(Yr)===$r.blockId,isTopLeftCorner:ui===0&&gi===0,isTopRightCorner:ui===0&&gi===No.value.length-1,isBottomLeftCorner:ui===vo.value.length-1&&gi===0,isBottomRightCorner:ui===vo.value.length-1&&gi===No.value.length-1,"border-radius":unref(Dr),deckHasBorderRadius:uo.value>0,cellTextColor:Hs(gi,ui),id:`${unref(Nr)?"preview-":""}${fa(yi.id,Qo.id)}`,"light-up-color":Uo.value,animationDelay:unref(aa)(gi,ui),showAnimation:unref(_c),animationDuration:unref(Bc),onFocus:Si=>ul(yi.id,Qo.id),onBlur:Si=>$l(yi.id,Qo.id),onChange:Si=>tl(yi.id,Qo.id,Si),onMouseover:Si=>ki.value=yi.id,style:normalizeStyle([{width:Xr.value?`min(${vl(gi)}px, 100%)`:`${vl(gi)/zo.value*Ro.value}px`,minWidth:Xr.value?`min(${vl(gi)}px, 100%)`:null,maxWidth:Xr.value?`min(${vl(gi)}px, 100%)`:null,borderColor:So.value,borderRadius:`${yo.value}px`,borderTopLeftRadius:ui===0&&gi===0?ra.value:"default",borderTopRightRadius:ui===0&&gi===No.value.length-1?ra.value:"default",borderBottomLeftRadius:ui===vo.value.length-1&&gi===0?ra.value:"default",borderBottomRightRadius:ui===vo.value.length-1&&gi===No.value.length-1?ra.value:"default"},unref(zr)&&gi===0?{...Yl.value}:{}]),class:normalizeClass(["border-r-[1px] border-b-[1px] relative",{"border-l-[1px]":gi===0,"header-style":unref(Hr)&&ui===0}]),background:ys(gi,ui),"is-header-cell":unref(zr)&&gi===0||unref(Hr)&&ui===0,showSelection:Ms.value&&pl({rowId:Qo.id,colId:yi.id}),appId:$r.appId},null,8,["row","col","block-id","cell","scale","isPreview","isEditable","isTopLeftCorner","isTopRightCorner","isBottomLeftCorner","isBottomRightCorner","border-radius","deckHasBorderRadius","cellTextColor","id","light-up-color","animationDelay","showAnimation","animationDuration","onFocus","onBlur","onChange","onMouseover","style","class","background","is-header-cell","showSelection","appId"]))),128))],44,_hoisted_3$b)]))),128))],12,_hoisted_2$e),Ja.value&&unref(Lr)&&!Es.value&&!Qs.value&&Gs.value?(openBlock(),createBlock(Teleport,{key:0,to:`#teleport-${Ho.blockId}`},[Ja.value&&unref(Lr)&&!Es.value&&!Qs.value?(openBlock(),createBlock(Button,{key:0,onMouseover:Yo[0]||(Yo[0]=Qo=>cl.value=!0),onMouseleave:Yo[1]||(Yo[1]=Qo=>cl.value=!1),backgroundOverride:Fi.value?"rgba(255, 255, 255, 0.16)":"rgba(255, 255, 255, 1)",hoverBackgroundOverride:Fi.value?"rgba(255, 255, 255, 0.24)":"#F5F5F5",activeBackgroundOverride:Fi.value?"rgba(255, 255, 255, 0.32)":"#EBEBEB",style:normalizeStyle({height:`${unref(ADD_BUTTON_DIM)}px`,borderRadius:"8px",flexShrink:0,position:"absolute",zIndex:10,border:Fi.value?null:"1px solid #E4E7EB",top:`${$s.value.top}px`,left:`${$s.value.left}px`,width:`${$s.value.width}px`,opacity:cl.value||Xo.value===vo.value[vo.value.length-1].id?1:0}),leftIcon:{icon:unref(assetUrl)("icon-plus.svg"),vProps:{width:16,height:16,nestedFill:Fi.value?"#FFF":"hsla(211, 12%, 43%, 1)"}},onClick:Ql,class:"table-buttons"},null,8,["backgroundOverride","hoverBackgroundOverride","activeBackgroundOverride","style","leftIcon"])):createCommentVNode("",!0)],8,["to"])):createCommentVNode("",!0),!unref(Nr)&&No.value.length<=unref(MAX_COLUMNS)-1&&!unref(eo)&&!unref(Wr)&&!mo.value&&unref(Lr)&&!Es.value&&!Qs.value&&Gs.value?(openBlock(),createBlock(Teleport,{key:1,to:`#teleport-${Ho.blockId}`},[!unref(Nr)&&No.value.length<=unref(MAX_COLUMNS)-1&&!unref(eo)&&!unref(Wr)&&!mo.value&&unref(Lr)&&!Es.value&&!Qs.value?(openBlock(),createBlock(Button,{key:0,onMouseover:Yo[2]||(Yo[2]=Qo=>Xa.value=!0),onMouseleave:Yo[3]||(Yo[3]=Qo=>Xa.value=!1),backgroundOverride:Fi.value?"rgba(255, 255, 255, 0.16)":"rgba(255, 255, 255, 1)",hoverBackgroundOverride:Fi.value?"rgba(255, 255, 255, 0.24)":"#F5F5F5",activeBackgroundOverride:Fi.value?"rgba(255, 255, 255, 0.32)":"#EBEBEB",style:normalizeStyle({width:`${unref(ADD_BUTTON_DIM)}px`,borderRadius:"8px",border:Fi.value?null:"1px solid #E4E7EB",flexShrink:0,position:"absolute",zIndex:10,top:`${Ps.value.top}px`,left:`${Ps.value.left}px`,height:`${Ps.value.height}px`,opacity:Xa.value||ki.value===No.value[No.value.length-1].id?1:0}),leftIcon:{icon:unref(assetUrl)("icon-plus.svg"),vProps:{width:16,height:16,nestedFill:Fi.value?"#FFF":"hsla(211, 12%, 43%, 1)"}},onClick:Zl,class:"table-buttons"},null,8,["backgroundOverride","hoverBackgroundOverride","activeBackgroundOverride","style","leftIcon"])):createCommentVNode("",!0)],8,["to"])):createCommentVNode("",!0),Ei.value&&unref(Lr)&&ja.value&&!rs.value&&!Qs.value&&Gs.value?(openBlock(),createBlock(Teleport,{key:2,to:`#teleport-${Ho.blockId}`},[Ei.value&&unref(Lr)&&ja.value&&!rs.value?(openBlock(),createBlock(Button,{key:0,onMousedown:Yo[4]||(Yo[4]=Qo=>oc(Qo,"col",ti.value)),onMouseover:Yo[5]||(Yo[5]=Qo=>Za.value=!0),onMouseleave:Yo[6]||(Yo[6]=Qo=>Za.value=!1),onClick:Rs,leftIcon:{icon:unref(assetUrl)("icon-drag-drop.svg"),vProps:{width:20,height:20,nestedFill:ai.value?ei.value:"hsla(211, 12%, 43%, 0.32)"}},backgroundOverride:ai.value?Uo.value:"rgba(255, 255, 255, 1)",hoverBackgroundOverride:ai.value?Uo.value:"#F5F5F5",activeBackgroundOverride:ai.value?Uo.value:"#EBEBEB",style:normalizeStyle({position:"absolute",padding:"0px 12px",height:"20px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,transform:"translateX(-50%) translateY(-50%)",border:"1px solid hsla(214, 15%, 91%, 1)",transitionDelay:"300ms",transition:"opacity 100ms ease",opacity:ki.value!=null||Za.value||ai.value!=null?1:0,top:`${Ma.value.top}px`,left:`${Ma.value.left}px`}),class:"table-buttons",ref:"columnMenuButtonRef"},null,8,["leftIcon","backgroundOverride","hoverBackgroundOverride","activeBackgroundOverride","style"])):createCommentVNode("",!0)],8,["to"])):createCommentVNode("",!0),Ei.value&&unref(Lr)&&Ia.value&&!rs.value&&!Qs.value&&Gs.value?(openBlock(),createBlock(Teleport,{key:3,to:`#teleport-${Ho.blockId}`},[Ei.value&&unref(Lr)&&Ia.value&&!rs.value?(openBlock(),createBlock(Button,{key:0,onMousedown:Yo[7]||(Yo[7]=Qo=>oc(Qo,"row",si.value)),onMouseover:Yo[8]||(Yo[8]=Qo=>Da.value=!0),onMouseleave:Yo[9]||(Yo[9]=Qo=>Da.value=!1),onClick:zl,leftIcon:{icon:unref(assetUrl)("icon-drag-drop.svg"),vProps:{width:20,height:20,nestedFill:vi.value?ei.value:"hsla(211, 12%, 43%, 0.32)"}},backgroundOverride:vi.value?Uo.value:"rgba(255, 255, 255, 1)",hoverBackgroundOverride:vi.value?Uo.value:"#F5F5F5",activeBackgroundOverride:vi.value?Uo.value:"#EBEBEB",style:normalizeStyle({position:"absolute",padding:"0px 8px",height:"20px",width:"40px",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,transform:"translate(-50%, -50%) rotate(90deg)",border:"1px solid hsla(214, 15%, 91%, 1)",transitionDelay:"300ms",transition:"opacity 100ms ease",opacity:Xo.value!=null||Da.value||vi.value!=null?1:0,top:`${Ba.value.top}px`,left:`${Ba.value.left}px`}),class:"table-buttons"},null,8,["leftIcon","backgroundOverride","hoverBackgroundOverride","activeBackgroundOverride","style"])):createCommentVNode("",!0)],8,["to"])):createCommentVNode("",!0),ai.value&&!vi.value&&Ei.value&&unref(Lr)?(openBlock(),createBlock(TableColumnSelectionPane,{key:4,"selected-block-id":unref(Yr),"selected-column-id":ai.value,"show-add-buttons":No.value.length<=unref(MAX_COLUMNS)-1,"row-id":vo.value[0].id,"show-delete-button":No.value.length>1,onInsertLeft:Yo[10]||(Yo[10]=Qo=>ia({colId:ai.value,direction:"left"})),onInsertRight:Yo[11]||(Yo[11]=Qo=>ia({colId:ai.value,direction:"right"})),onDelete:Yo[12]||(Yo[12]=Qo=>Bl({colId:ai.value})),onClearContent:Yo[13]||(Yo[13]=Qo=>ws({colId:ai.value})),onDuplicate:Yo[14]||(Yo[14]=Qo=>tc({colId:ai.value})),onClose:Yo[15]||(Yo[15]=()=>lc("col"))},null,8,["selected-block-id","selected-column-id","show-add-buttons","row-id","show-delete-button"])):createCommentVNode("",!0),vi.value&&!ai.value&&Ei.value&&unref(Lr)?(openBlock(),createBlock(TableRowSelectionPane,{key:5,"selected-block-id":unref(Yr),"selected-row-id":vi.value,"column-id":No.value[0].id,"show-add-buttons":Ja.value,"show-delete-button":vo.value.length>1,onInsertAbove:Yo[16]||(Yo[16]=Qo=>Hl({rowId:vi.value,direction:"above"})),onInsertBelow:Yo[17]||(Yo[17]=Qo=>Hl({rowId:vi.value,direction:"below"})),onDelete:Yo[18]||(Yo[18]=Qo=>ec({rowId:vi.value})),onClearContent:Yo[19]||(Yo[19]=Qo=>xs({rowId:vi.value})),onDuplicate:Yo[20]||(Yo[20]=Qo=>Oi({rowId:vi.value})),onClose:Yo[21]||(Yo[21]=()=>lc("row"))},null,8,["selected-block-id","selected-row-id","column-id","show-add-buttons","show-delete-button"])):createCommentVNode("",!0),!ai.value&&!vi.value&&!Ci.value&&Ei.value&&unref(Lr)?(openBlock(),createBlock(TableSelectionPane,{key:6,"selected-block-id":unref(Yr)},null,8,["selected-block-id"])):createCommentVNode("",!0),(openBlock(!0),createElementBlock(Fragment$1,null,renderList(No.value.slice(0,-1),(Qo,ui)=>{var yi,gi;return openBlock(),createElementBlock(Fragment$1,{key:`${Qo.id}-${((yi=Ws.value[ui])==null?void 0:yi.x)??0}-${((gi=Ws.value[ui])==null?void 0:gi.y)??0}`},[Ei.value&&unref(Lr)&&!Es.value&&!ho.value?(openBlock(),createBlock(_sfc_main$J,{key:0,onMouseover:Si=>pa.value[ui]=!0,onMouseleave:Si=>pa.value[ui]=!1,initialValue:Ws.value[ui]||{x:0,y:0},onStart:(Si,Do)=>Zi(Si,Do,ui),onMove:(Si,Do)=>ji(Si,Do,ui),onEnd:(Si,Do)=>sa(Si,Do,ui),cleanup:()=>{js.value[ui]=!1,pa.value[ui]=!1},height:`${Pl.value}px`,width:`${io.value*(2*TABLE_RESIZER_PADDING+TABLE_RESIZER_WIDTH)}px`,"full-table-x":unref(Ai).left.value,"full-table-y":unref(Ai).top.value,paddingX:`${io.value*TABLE_RESIZER_PADDING}px`,opacity:pa.value[ui]&&!Qs.value||js.value[ui]?1:0,isDark:Fi.value&&bs.value!=="yellow"},null,8,["onMouseover","onMouseleave","initialValue","onStart","onMove","onEnd","cleanup","height","width","full-table-x","full-table-y","paddingX","opacity","isDark"])):createCommentVNode("",!0)],64)}),128)),(openBlock(),createBlock(Teleport,{to:"#main-app"},[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(nl.value,(Qo,ui)=>(openBlock(),createElementBlock(Fragment$1,{key:`col-dropzone-${Qo.x}`},[!unref(Nr)&&unref(li)===ui&&unref(ci)?(openBlock(),createElementBlock("div",{key:0,class:"rounded-lg fixed z-[1]",style:normalizeStyle([{background:Uo.value,width:Fl.value,height:`${Dl.value}px`,left:`${Qo.x}px`,top:`${Qo.y}px`},0(openBlock(),createElementBlock(Fragment$1,{key:`row-dropzone-${Qo.y}`},[!unref(Nr)&&unref(Ii)===ui&&unref(ci)?(openBlock(),createElementBlock("div",{key:0,class:"row-dropzone rounded-lg fixed z-[1]",style:normalizeStyle({background:Uo.value,height:Fl.value,width:Ml.value,left:`${Qo.x}px`,top:`${Qo.y}px`})},null,4)):createCommentVNode("",!0)],64))),128))])),!ai.value&&!vi.value&&Ci.value&&ds.value.rowId&&!Qs.value&&Ei.value&&unref(Lr)&&!la.value?(openBlock(),createBlock(TableCellSelectionPane,{key:7,"selected-block-id":unref(Yr),"column-id":ds.value.colId??null,"row-id":ds.value.rowId??null,"is-first-row":ds.value.rowId===vo.value[0].id},null,8,["selected-block-id","column-id","row-id","is-first-row"])):createCommentVNode("",!0),!ai.value&&!vi.value&&Ci.value&&ds.value.rowId&&!Qs.value&&Ei.value&&unref(Lr)?(openBlock(),createBlock(TableCellTextSelectionPane,{key:8,"selected-block-id":unref(Yr),"column-id":ds.value.colId??null,"row-id":ds.value.rowId??null,"is-first-row":ds.value.rowId===vo.value[0].id,"app-id":$r.appId},null,8,["selected-block-id","column-id","row-id","is-first-row","app-id"])):createCommentVNode("",!0)],44,_hoisted_1$i))}}),TableEmbed_vue_vue_type_style_index_0_scoped_c14e32fd_lang="",TableEmbed=_export_sfc(_sfc_main$w,[["__scopeId","data-v-c14e32fd"]]),_sfc_main$v=defineComponent({__name:"DividerEmbed",props:{blockId:{},appId:{},scale:{},isActive:{type:Boolean},isPreview:{type:Boolean}},setup(Tr){useCssVars(Eo=>({"78de5a68":Jr.value}));const Cr={solid:{name:"Solid",description:"A solid line",thickness:1,paddingY:12,paddingX:16,distance:0,color:{light:"#E7E7E7",dark1:"rgba(255, 255, 255, 0.16)",dark2:"rgba(255, 255, 255, 0.32)",dark3:"rgba(85, 49, 7, 0.16)"}},thick:{name:"Thick",description:"A thick line",thickness:2,paddingY:12,paddingX:16,distance:0,color:{light:"#6E6D6D",dark1:"rgba(255, 255, 255, 0.70)",dark2:"rgba(255, 255, 255, 0.70)",dark3:"#553107"}},dashed:{name:"Dashed",description:"A dashed line",thickness:1.5,paddingY:0,paddingX:16,distance:8,color:{light:"#B6B6B6",dark1:"rgba(255, 255, 255, 0.52)",dark2:"rgba(255, 255, 255, 0.72)",dark3:"rgba(85, 49, 7, 0.52)"}},dotted:{name:"Dotted",description:"A dotted line",thickness:1.5,paddingY:0,paddingX:16,distance:5,color:{light:"#CFCECE",dark1:"rgba(255, 255, 255, 0.32)",dark2:"rgba(255, 255, 255, 0.42)",dark3:"rgba(85, 49, 7, 0.32)"}}},$r=Tr,Ar=useAppStore(),Rr=usePageStore(),Dr=useBlockStore(),Mr=useItemStore(),Br=useBlockLayoutsStore(),Nr=inject("isMobile");inject("showingFullPage");const Lr=inject("isReadOnly"),Hr=inject("showingFullScreen"),zr=ref(null),Ur=computed(()=>Dr.parentId($r.blockId));computed(()=>Ar.getThemeObject($r.appId,Ur.value||""));const Vr=computed(()=>Ar.deckTheme($r.appId)),jr=computed(()=>Rr.isDividerSlide(Ur.value||"")&&["navy","purple","black","brown"].includes(Vr.value)),Gr=computed(()=>Rr.isDividerSlide(Ur.value||"")&&["red","orange","green","blue","pink"].includes(Vr.value)),Xr=computed(()=>{var Eo;return((Eo=Dr.config($r.blockId).dividerType)==null?void 0:Eo.selectedId)??"solid"}),Kr=computed(()=>Dr.isAnyBlockDragging),Zr=computed(()=>Mr.data[Ur.value??""]??{}),eo=computed(()=>Zr.value[$r.blockId]==null?null:Zr.value[$r.blockId].groupId),Wr=computed(()=>{var Eo;return eo.value==null?null:(Eo=Zr.value[eo.value])==null?void 0:Eo.direction}),Yr=computed(()=>Nr.value||Wr.value==null?"horizontal":Wr.value==="row"?"vertical":"horizontal"),Jr=computed(()=>Rr.isDividerSlide(Ur.value||"")?jr.value?Cr[Xr.value].color.dark1:Gr.value?Cr[Xr.value].color.dark2:Vr.value==="yellow"?Cr[Xr.value].color.dark3:Cr[Xr.value].color.light:Cr[Xr.value].color.light),no=computed(()=>{const Eo=Ar.smallText($r.appId)?.75:1;return Yr.value==="horizontal"?Cr[Xr.value].paddingY*$r.scale*Eo:Cr[Xr.value].paddingX*$r.scale*Eo}),ro=computed(()=>{const Eo=Ar.smallText($r.appId)?.75:1;return Yr.value==="horizontal"?Cr[Xr.value].paddingX*$r.scale*Eo:Cr[Xr.value].paddingY*$r.scale*Eo}),so=computed(()=>Hr.value?$r.scale:$r.isPreview?Math.max($r.scale,1):$r.scale);computed(()=>Br.inTemplateMode);const ao=computed(()=>Cr.dashed.thickness*so.value);computed(()=>`${ao.value}px`);const lo=computed(()=>Cr.dashed.distance*so.value);computed(()=>`${lo.value}px`);const po=computed(()=>Cr.dotted.thickness*so.value);computed(()=>`${po.value}px`);const go=computed(()=>Cr.dotted.distance*so.value);computed(()=>`${go.value}px`);const co=computed(()=>go.value+po.value);computed(()=>`${co.value}px`);const mo=computed(()=>go.value*2);computed(()=>`${mo.value}px`);const io=()=>{if(log("cycleDividerType",{dividerType:Xr.value,isActive:$r.isActive}),!$r.isActive)return;const Eo=["solid","thick","dashed","dotted"],Ro=(Eo.indexOf(Xr.value)+1)%Eo.length;Dr.updateProps($r.blockId,{keyPath:["config","dividerType","selectedId"],value:Eo[Ro]})},uo=ref(null),ho=ref(null),yo=ref(null),So=ref(null),ko=Eo=>{uo.value&&(uo.value.style.display="none"),ho.value&&(ho.value.style.display="none"),yo.value&&(yo.value.style.display="none"),So.value&&(So.value.style.display="none"),Eo==="solid"?uo.value&&(uo.value.style.display="block"):Eo==="thick"?ho.value&&(ho.value.style.display="block"):Eo==="dashed"?yo.value&&(yo.value.style.display="flex"):Eo==="dotted"&&So.value&&(So.value.style.display="flex")};watch(Xr,Eo=>{ko(Eo)}),onMounted(()=>{nextTick(()=>{ko(Xr.value)})});const $o=computed(()=>{const Eo=Dr.positionByDisplay($r.blockId);return((Eo==null?void 0:Eo.width)??0)*so.value-ro.value*2}),Go=computed(()=>{const Eo=Dr.positionByDisplay($r.blockId);return((Eo==null?void 0:Eo.height)??0)*so.value-no.value*2}),No=computed(()=>Yr.value==="horizontal"?$o.value:Go.value);return(Eo,Mo)=>{const Ro=resolveComponent("inline-svg"),Ao=__nuxt_component_0;return openBlock(),createBlock(Ao,null,{default:withCtx(()=>[createBaseVNode("div",{class:normalizeClass(["flex items-center justify-center grow divider-embed",{"cursor-pointer":Eo.isActive&&!Kr.value&&!unref(Lr)}]),ref_key:"dividerRefWrapper",ref:zr,style:normalizeStyle({paddingTop:`${no.value}px`,paddingBottom:`${no.value}px`,paddingLeft:`${ro.value}px`,paddingRight:`${ro.value}px`}),onClick:io},[createBaseVNode("div",{ref_key:"solidDividerRef",ref:uo,style:normalizeStyle({background:Jr.value,height:Yr.value==="horizontal"?`${so.value}px`:"100%",width:Yr.value==="horizontal"?"100%":`${so.value}px`,borderRadius:`${so.value}px`}),class:"dissolve"},null,4),createBaseVNode("div",{ref_key:"thickDividerRef",ref:ho,style:normalizeStyle({background:Jr.value,height:Yr.value==="horizontal"?`${2*so.value}px`:"100%",width:Yr.value==="horizontal"?"100%":`${2*so.value}px`,borderRadius:`${2*so.value}px`}),class:"dissolve"},null,4),createBaseVNode("div",{ref_key:"dashedDividerRef",ref:yo,style:normalizeStyle({height:Yr.value==="horizontal"?`${24*so.value}px`:"100%",width:Yr.value==="horizontal"?"100%":`${24*so.value}px`,maxHeight:"100%",maxWidth:"100%",overflow:"hidden"}),class:"dissolve flex items-center justify-center"},[createBaseVNode("div",{class:"flex items-center justify-center",style:normalizeStyle({transform:Yr.value=="horizontal"?`scale(${Math.max(1,No.value/960)})`:`scale(${Math.max(1,No.value/960)}) rotate(90deg)`})},[createVNode(Ro,{src:unref(assetUrl)("icon-dotted-divider-single.svg"),fill:Jr.value,class:normalizeClass({"has-nested-fill is-not-gradient":!0})},null,8,["src","fill"])],4)],4),createBaseVNode("div",{ref_key:"dottedDividerRef",ref:So,style:normalizeStyle({height:Yr.value==="horizontal"?`${24*so.value}px`:"100%",width:Yr.value==="horizontal"?"100%":`${24*so.value}px`,maxHeight:"100%",maxWidth:"100%",overflow:"hidden"}),class:"dissolve flex items-center justify-center"},[createBaseVNode("div",{class:"flex items-center justify-center",style:normalizeStyle({transform:Yr.value=="horizontal"?`scale(${Math.max(1,No.value/960)})`:`scale(${Math.max(1,No.value/960)}) rotate(90deg)`})},[createVNode(Ro,{src:unref(assetUrl)("icon-dotted-divider.svg"),fill:Jr.value,class:normalizeClass({"has-nested-fill is-not-gradient":!0})},null,8,["src","fill"])],4)],4)],6)]),_:1})}}}),DividerEmbed_vue_vue_type_style_index_0_scoped_17c78375_lang="",DividerEmbed=_export_sfc(_sfc_main$v,[["__scopeId","data-v-17c78375"]]),_hoisted_1$h=["src"],_hoisted_2$d=["href"],_sfc_main$u=defineComponent({__name:"WebpageEmbed",props:{blockId:{},appId:{},scale:{},isActive:{type:Boolean},isPreview:{type:Boolean}},setup(Tr){const Cr=Tr,$r=useAppStore(),Ar=useBlockStore(),Rr=usePageStore();useInternalVariableTuning();const Dr=useArtboardStore(),Mr=inject("showingFullPage"),Br=inject("isMobile"),Nr=inject("showingFullScreen");isEnabled("internalVariableTuning");const Lr=ref(!1),Hr=ref(!1),{isPdf:zr,isScreenshot:Ur}=useRouteInfo(),Vr=computed(()=>Dr.getMountKey(Cr.blockId)),jr=computed(()=>Nr.value?Cr.scale:Cr.isPreview?Math.max(Cr.scale,1):Cr.scale),Gr=computed(()=>Ar.parentId(Cr.blockId)),Xr=computed(()=>$r.getThemeObject(Cr.appId,Gr.value||"")),Kr=computed(()=>$r.deckTheme(Cr.appId)),Zr=computed(()=>Rr.isDividerSlide(Gr.value||"")&&Kr.value!=="yellow"),eo=computed(()=>Ar.isAnyBlockDragging),Wr=computed(()=>$r.borderRadius(Cr.appId)),Yr=computed(()=>Wr.value),Jr=computed(()=>Yr.value*jr.value),no=computed(()=>Zr.value?"rgba(255, 255, 255, 0.42)":"rgba(0, 0, 0, 0.12)"),ro=computed(()=>{var Eo,Mo,Ro;return Zr.value?((Ro=(Mo=(Eo=Xr.value)==null?void 0:Eo.block)==null?void 0:Mo.grey)==null?void 0:Ro.background)??"rgba(255, 255, 255, 0.04)":"rgba(0, 0, 0, 0.04)"}),so=computed(()=>(Zr.value,"#0D0C0C")),ao=computed(()=>(Zr.value,"#9E9E9E")),lo=computed(()=>{var Eo,Mo;return((Mo=(Eo=Ar.config(Cr.blockId))==null?void 0:Eo.url)==null?void 0:Mo.value)??""}),po=computed(()=>{var Eo,Mo;return((Mo=(Eo=Ar.config(Cr.blockId))==null?void 0:Eo.metadata)==null?void 0:Mo.value)??{}}),go=computed(()=>{var Eo;return(((Eo=po.value)==null?void 0:Eo.canEmbed)??!0)&&!zr.value&&!Ur.value}),co=computed(()=>Br.value||Mr.value||lo.value===""||!Cr.isPreview&&Cr.isActive),mo=computed(()=>!co.value&&lo&&go&&!Cr.isActive&&!Cr.isPreview),io=["prezo.ai","app.prezo.ai","prezo.site","shareprezo.site","staging.shareprezo.com"],uo=computed(()=>!!(io.some(Eo=>lo.value.startsWith(`https://${Eo}`))||io.some(Eo=>lo.value.includes(Eo)))),ho=computed(()=>{if(!uo.value)return lo.value;let Eo=lo.value;return Eo.includes("/a/")&&(Eo=Eo.replace("/a/","/public/")),`${Eo}?embed=true`}),yo=computed(()=>{const Eo=new URL(lo.value);return`${Eo.protocol}//${Eo.hostname}`}),So=computed(()=>{var Eo;return!(lo.value===""||!go.value||Cr.isPreview||io.some(Mo=>lo.value.startsWith(`https://${Mo}`))||io.some(Mo=>lo.value.includes(Mo))||!((Eo=po.value)!=null&&Eo.title))}),ko=computed(()=>{let Eo=design.fontSizeMap.richText.desktop.regular.p;return Br.value&&(Eo=design.fontSizeMap.richText.mobile.p),$r.smallText(Cr.appId)&&(Eo=design.fontSizeMap.richText.desktop.smallText.p),`${Eo*jr.value}px`}),$o=computed(()=>{let Eo=design.fontSizeMap.richText.desktop.regular.h5;return Br.value&&(Eo=design.fontSizeMap.richText.mobile.h5),$r.smallText(Cr.appId)&&(Eo=design.fontSizeMap.richText.desktop.smallText.h5),`${Eo*jr.value}px`}),Go=computed(()=>{let Eo=design.padding.block.text.bg.default;return Br.value&&(Eo=design.padding.block.text.bg.mobile),$r.smallText(Cr.appId)&&(Eo=design.padding.block.text.bg.small),`${Eo/2*jr.value}px ${Eo*jr.value}px ${Eo*jr.value}px`}),No=()=>{eo.value||co.value&&lo.value!==""&&go.value&&window.open(lo.value,"_blank")};return(Eo,Mo)=>{const Ro=__nuxt_component_0;return openBlock(),createBlock(Ro,null,{default:withCtx(()=>[createBaseVNode("div",{class:"flex flex-col items-center justify-center grow border overflow-hidden relative",style:normalizeStyle({borderRadius:`${Jr.value}px`,borderColor:no.value}),onMouseover:Mo[0]||(Mo[0]=Ao=>Lr.value=!0),onMouseleave:Mo[1]||(Mo[1]=Ao=>Lr.value=!1),onMousedown:Mo[2]||(Mo[2]=Ao=>Hr.value=!0),onMouseup:Mo[3]||(Mo[3]=Ao=>Hr.value=!1)},[lo.value&&go.value?(openBlock(),createElementBlock("iframe",{key:Vr.value,src:ho.value,referrerpolicy:"no-referrer",sandbox:"allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts ",loading:"lazy",class:normalizeClass(["w-full h-full",{"pointer-events-none":!co.value}])},` `,10,_hoisted_1$h)):lo.value&&!go.value?(openBlock(),createElementBlock("div",{key:1,class:"w-full h-full flex flex-col gap-2 items-center justify-center",style:normalizeStyle({backgroundColor:ro.value})},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-broken-link-2.svg"),vProps:{width:38*jr.value,height:38*jr.value,nestedFill:Zr.value?"#FFF":"#868585"}},null,8,["src","vProps"]),unref(zr)||unref(Ur)?(openBlock(),createElementBlock("a",{key:0,href:lo.value,target:"_blank"},[createBaseVNode("p",{class:normalizeClass(["font-[400] text-[14px] leading-[1.36]",{"text-[#868585]":!Zr.value,"text-[#ffffff]":Zr.value}])},toDisplayString("Click to go to live embed"),2)],8,_hoisted_2$d)):(openBlock(),createElementBlock("p",{key:1,class:normalizeClass(["font-[400] text-[14px] leading-[1.36]",{"text-[#868585]":!Zr.value,"text-[#ffffff]":Zr.value}])},toDisplayString("This URL does not allow embeds"),2))],4)):(openBlock(),createElementBlock("div",{key:2,class:"w-full h-full flex items-center justify-center",style:normalizeStyle({backgroundColor:ro.value})},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-webpage-default-2.svg"),vProps:{width:38*jr.value,height:38*jr.value,nestedFill:Zr.value?"#FFF":"#868585"}},null,8,["src","vProps"])],4)),So.value?(openBlock(),createElementBlock("div",{key:3,style:normalizeStyle({padding:Go.value}),class:normalizeClass(["shrink-0 flex flex-col justify-center border-t border-[#E7E7E7] w-full bg-[#FFF]",{"cursor-pointer":So.value&&co.value,"hover:bg-[#0000000a] active:bg-[#00000014]":So.value&&co.value&&!Zr.value,"hover:bg-[#F5F5F5] active:bg-[#EBEBEB]":So.value&&co.value&&Zr.value}]),onClick:No},[createBaseVNode("p",{class:"leading-[1.36] font-[500] ellipsis",style:normalizeStyle({fontSize:ko.value,color:so.value})},toDisplayString(po.value.title),5),createBaseVNode("p",{class:"mt-[2px] leading-[1.28] font-[400] ellipsis",style:normalizeStyle({fontSize:$o.value,color:ao.value})},toDisplayString(yo.value),5)],6)):createCommentVNode("",!0),mo.value&&Lr.value?(openBlock(),createElementBlock("div",{key:4,class:normalizeClass(["absolute top-0 left-0 w-full h-full",{"bg-[#0000000a]":Lr.value,"bg-[#00000014]":Hr.value}])},null,2)):createCommentVNode("",!0)],36)]),_:1})}}}),_hoisted_1$g=["src"],_hoisted_2$c=["src"],_hoisted_3$a={class:"flex flex-col gap-2 justify-center grow max-w-[calc(100%-40px)]"},_hoisted_4$8={key:0,class:"flex items-start shrink-0"},_hoisted_5$7=["src"],_hoisted_6$6=["src"],_hoisted_7$6={class:"flex flex-col justify-center w-full gap-2"},_hoisted_8$5=["src"],_hoisted_9$5=["src"],_hoisted_10$5=["src"],HEIGHT_CUTOFF_FOR_IMAGE=144,HEIGHT_CUTOFF_FOR_TITLE_ISLAND=120,WIDTH_HEIGHT_RATIO=1.9,IMAGE_MAX_WIDTH=900,IMAGE_MAX_HEIGHT=500,_sfc_main$t=defineComponent({__name:"BookmarkEmbed",props:{blockId:{},appId:{},scale:{},isActive:{type:Boolean},isPreview:{type:Boolean}},emits:["change","changed-height"],setup(Tr,{emit:Cr}){useCssVars(qo=>({"224b7f08":so.value}));const $r=Tr,Ar=useAppStore(),Rr=useBlockStore(),Dr=usePageStore();useInternalVariableTuning();const Mr=useArtboardStore(),Br=inject("showingFullPage"),Nr=inject("isMobile"),Lr=inject("showingFullScreen");inject("isReadOnly"),isEnabled("internalVariableTuning");const Hr=ref(!1),zr=ref(!1),{isPdf:Ur,isScreenshot:Vr}=useRouteInfo();computed(()=>Mr.getMountKey($r.blockId));const jr=computed(()=>Lr.value?$r.scale:$r.isPreview?Math.max($r.scale,1):$r.scale);computed(()=>Mr.isAnyBlockResizing);const Gr=computed(()=>Rr.parentId($r.blockId)),Xr=computed(()=>Ar.getThemeObject($r.appId,Gr.value||"")),Kr=computed(()=>Ar.deckTheme($r.appId)),Zr=computed(()=>{var qo,ri;return((ri=(qo=Rr.config($r.blockId))==null?void 0:qo.backgroundColor)==null?void 0:ri.selectedId)??"none"}),eo=computed(()=>{const qo=Dr.isDividerSlide(Gr.value||"")&&Kr.value!=="yellow"&&Zr.value!=="bright",ri=!Dr.isDividerSlide(Gr.value||"")&&Kr.value!=="yellow"&&Zr.value==="bright";return qo||ri}),Wr=computed(()=>Rr.isAnyBlockDragging),Yr=computed(()=>Ar.borderRadius($r.appId)),Jr=computed(()=>Yr.value),no=computed(()=>Jr.value*jr.value),ro=computed(()=>Zr.value!=="outline"?"transparent":eo.value?"rgba(255, 255, 255, 0.42)":"rgba(0, 0, 0, 0.12)"),so=computed(()=>eo.value?"rgba(255, 255, 255, 0.42)":"#E7E7E7");computed(()=>{var qo,ri,ki;return eo.value?((ki=(ri=(qo=Xr.value)==null?void 0:qo.block)==null?void 0:ri.grey)==null?void 0:ki.background)??"rgba(255, 255, 255, 0.04)":"rgba(0, 0, 0, 0.04)"});const ao=computed(()=>eo.value?"#FFF":"#0D0C0C"),lo=computed(()=>eo.value?"#ffffff80":"#9E9E9E"),po=computed(()=>eo.value?"#FFF":"#C2C2C2"),go=computed(()=>28*jr.value),co=computed(()=>Mr.getLocalPositionObject($r.blockId)),mo=computed(()=>{var qo;return((qo=co.value)==null?void 0:qo.width)??0}),io=computed(()=>{var qo;return((qo=co.value)==null?void 0:qo.height)??0}),uo=computed(()=>{var qo,ri;return((ri=(qo=Rr.config($r.blockId))==null?void 0:qo.options)==null?void 0:ri.value)??{}}),ho=computed(()=>!Nr.value&&io.valueuo.value[KEYS_FOR_OPTIONS.url]),So=computed(()=>Nr.value?"vertical":io.valueHEIGHT_CUTOFF_FOR_TITLE_ISLAND?"horizontal":!ho.value||io.valueWIDTH_HEIGHT_RATIO*io.value?"horizontal":"vertical"),ko=computed(()=>{var qo,ri;return((ri=(qo=Rr.config($r.blockId))==null?void 0:qo.url)==null?void 0:ri.value)??""}),$o=computed(()=>{var qo,ri;return((ri=(qo=Rr.config($r.blockId))==null?void 0:qo.metadata)==null?void 0:ri.value)??{}}),Go=["prezo.ai","app.prezo.ai","prezo.site","shareprezo.site","staging.shareprezo.com"],No=computed(()=>!!(Go.some(qo=>ko.value.startsWith(`https://${qo}`))||Go.some(qo=>ko.value.includes(qo))));computed(()=>{if(!No.value)return ko.value;let qo=ko.value;return qo.includes("/a/")&&(qo=qo.replace("/a/","/public/")),`${qo}?embed=true`});const Eo=computed(()=>ko.value===""),Mo=computed(()=>{let qo=design.padding.block.text.bg.default;return Nr.value&&(qo=design.padding.block.text.bg.mobile),Ar.smallText($r.appId)&&(qo=design.padding.block.text.bg.small),qo*jr.value}),Ro=computed(()=>{if(ko.value==="")return"";const qo=new URL(ko.value);return`${qo.protocol}//${qo.hostname}`}),Ao=computed(()=>$o.value.favicon?$o.value.favicon.startsWith("data:")||$o.value.favicon.startsWith("https://")?$o.value.favicon:`${Ro.value}${$o.value.favicon}`:""),zo=computed(()=>$o.value.ogImage?$o.value.ogImage.startsWith("data:")||$o.value.ogImage.startsWith("https://")?$o.value.ogImage:`${Ro.value}${$o.value.ogImage}`:""),Oo=computed(()=>$o.value.description),Bo=computed(()=>uo.value[KEYS_FOR_OPTIONS.description]),bo=computed(()=>uo.value[KEYS_FOR_OPTIONS.favicon]),vo=computed(()=>!Ur.value&&!Vr.value),Io=computed(()=>Nr.value||Br.value||ko.value===""||!$r.isPreview&&$r.isActive),To=computed(()=>!Io.value&&ko&&vo&&!$r.isActive&&!$r.isPreview),Co=computed(()=>{let qo=design.cornerRadius.element.default;return Nr.value&&(qo=design.cornerRadius.element.small),Ar.smallText($r.appId)&&(qo=design.cornerRadius.element.small),qo*=jr.value,qo=Math.round(qo*100)/100,`${qo}px`}),Po=computed(()=>{let qo=design.fontSizeMap.richText.desktop.regular.p;return Nr.value&&(qo=design.fontSizeMap.richText.mobile.p),Ar.smallText($r.appId)&&(qo=design.fontSizeMap.richText.desktop.smallText.p),`${qo*jr.value}px`}),Fo=computed(()=>{let qo=design.fontSizeMap.richText.desktop.regular.h5;return Nr.value&&(qo=design.fontSizeMap.richText.mobile.h5),Ar.smallText($r.appId)&&(qo=design.fontSizeMap.richText.desktop.smallText.h5),qo*jr.value}),Vo=computed(()=>`${Fo.value}px`),Ko=computed(()=>`${Fo.value*17/14}px`),Uo=()=>{Wr.value||Io.value&&ko.value!==""&&window.open(ko.value,"_blank")},ei=computed(()=>ho.value?mo.value-Mo.value*2-(io.value-Mo.value*2)*(16/9):mo.value-Mo.value*2);return(qo,ri)=>{const ki=__nuxt_component_0;return openBlock(),createBlock(ki,null,{default:withCtx(()=>[createBaseVNode("div",{ref:"wrapperElement",class:normalizeClass(["flex grow border overflow-hidden relative",{"flex-col items-start justify-end gap-4":So.value==="vertical"&&(!Eo.value||Eo.value)&&io.value>HEIGHT_CUTOFF_FOR_TITLE_ISLAND&&ho.value,"flex-col items-start justify-center gap-4":So.value==="vertical"&&(!Eo.value||Eo.value)&&(io.value<=HEIGHT_CUTOFF_FOR_TITLE_ISLAND||!ho.value),"flex-row items-end gap-4":So.value==="horizontal"&&(!Eo.value||Eo.value),"cursor-pointer":Io.value}]),style:normalizeStyle({borderRadius:`${no.value}px`,padding:`${Mo.value}px`,borderColor:ro.value}),onMouseover:ri[0]||(ri[0]=ti=>Hr.value=!0),onMouseleave:ri[1]||(ri[1]=ti=>Hr.value=!1),onMousedown:ri[2]||(ri[2]=ti=>zr.value=!0),onMouseup:ri[3]||(ri[3]=ti=>zr.value=!1),onClick:Uo},[So.value==="vertical"?(openBlock(),createElementBlock(Fragment$1,{key:0},[ho.value&&$o.value.ogImage&&!unref(Nr)?(openBlock(),createElementBlock("div",{key:0,class:"ogimage-island rounded-[8px] og-image-border overflow-hidden shrink flex items-end justify-end w-full aspect-video",style:normalizeStyle({maxHeight:unref(Nr)?"244px":`${IMAGE_MAX_HEIGHT*jr.value}px`,borderRadius:Co.value})},[createBaseVNode("img",{src:zo.value,class:"h-full w-full object-cover object-center",style:normalizeStyle({maxWidth:`${mo.value*jr.value-24-2}px`})},null,12,_hoisted_1$g)],4)):createCommentVNode("",!0),ho.value&&!$o.value.ogImage?(openBlock(),createElementBlock("div",{key:1,class:"ogimage-island og-image-border rounded-[16px] overflow-hidden shrink flex items-end justify-start w-full aspect-video",style:normalizeStyle({maxHeight:unref(Nr)?"244px":`${IMAGE_MAX_HEIGHT*jr.value}px`})},[createBaseVNode("img",{src:"/images/bookmark-empty-3.png",class:"w-full object-cover object-center",style:normalizeStyle({maxWidth:`${mo.value*jr.value-24-2}px`})},null,12,_hoisted_2$c)],4)):createCommentVNode("",!0),$o.value.title||Eo.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(["title-island flex",{"flex-row-reverse w-full gap-3 max-w-full overflow-hidden shrink-0":So.value==="vertical"&&!ho.value,"flex-row w-full gap-3 max-w-full overflow-hidden shrink-0":So.value==="vertical"&&ho.value,"mb-8 sm:mb-auto":ho.value}])},[createBaseVNode("div",_hoisted_3$a,[createBaseVNode("p",{class:"leading-[1.36] font-[500]",style:normalizeStyle({fontSize:Po.value,color:ao.value})},toDisplayString($o.value.title||"Site Title (link a site to view content)"),5),Bo.value&&Oo.value?(openBlock(),createElementBlock("p",{key:0,class:"leading-[1.5] font-[400] description-ellipsis text-[#0F0E0E]",style:normalizeStyle({fontSize:Ko.value,color:lo.value})},toDisplayString(Oo.value),5)):createCommentVNode("",!0),yo.value?(openBlock(),createElementBlock("p",{key:1,class:"leading-[1.28] font-[400] ellipsis",style:normalizeStyle({fontSize:Vo.value,color:lo.value})},toDisplayString(Ro.value||"https://url.com"),5)):createCommentVNode("",!0)]),Eo.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_4$8,[bo.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["flex items-center justify-center shrink-0 overflow-hidden rounded-[6px] border",{"border-[#00000014]":!Ao.value&&!eo.value,"border-transparent":!!Ao.value||eo.value,"translate-y-[2px]":yo.value,"bg-[#ffffff1f]":!Ao.value&&eo.value}]),style:normalizeStyle({width:`${go.value}px`,height:`${go.value}px`})},[$o.value.favicon?(openBlock(),createElementBlock("img",{key:0,src:Ao.value,class:"w-full h-full"},null,8,_hoisted_5$7)):(openBlock(),createBlock(_sfc_main$1v,{key:1,src:unref(assetUrl)("icon-image-broken-2.svg"),vProps:{width:16,height:16,nestedFill:po.value}},null,8,["src","vProps"]))],6)):createCommentVNode("",!0)]))],2)):createCommentVNode("",!0),ho.value&&$o.value.ogImage&&unref(Nr)?(openBlock(),createElementBlock("div",{key:3,class:"ogimage-island mt-8 sm:mt-auto rounded-[8px] og-image-border overflow-hidden shrink grow flex items-center justify-center max-h-[244px] w-full",style:normalizeStyle({borderRadius:Co.value})},[createBaseVNode("img",{src:zo.value,class:"w-full object-contain"},null,8,_hoisted_6$6)],4)):createCommentVNode("",!0)],64)):So.value==="horizontal"?(openBlock(),createElementBlock(Fragment$1,{key:1},[$o.value.title||Eo.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["title-island flex",{"flex-col h-full shrink min-w-[80px]":So.value==="horizontal"&&ho.value,"flex-col h-full shrink w-full":So.value==="horizontal"&&!ho.value}]),style:normalizeStyle({maxWidth:`${ei.value}px`})},[createBaseVNode("div",_hoisted_7$6,[createBaseVNode("p",{class:"leading-[1.36] font-[500]",style:normalizeStyle({fontSize:Po.value,color:ao.value})},toDisplayString($o.value.title||"Site Title (link a site to view content)"),5),Bo.value&&Oo.value?(openBlock(),createElementBlock("p",{key:0,class:"leading-[1.5] font-[400] description-ellipsis text-[#0F0E0E]",style:normalizeStyle({fontSize:Ko.value,color:lo.value})},toDisplayString(Oo.value),5)):createCommentVNode("",!0),yo.value?(openBlock(),createElementBlock("p",{key:1,class:"mt-[2px] leading-[1.28] font-[400] ellipsis",style:normalizeStyle({fontSize:Vo.value,color:lo.value})},toDisplayString(Ro.value||"https://url.com"),5)):createCommentVNode("",!0)]),bo.value&&!Eo.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["flex items-center justify-center shrink-0 mt-auto w-7 h-7 overflow-hidden rounded-[6px] border",{"border-[#00000014]":!Ao.value&&!eo.value,"border-transparent":!!Ao.value||eo.value,"translate-y-[2px]":yo.value,"bg-[#ffffff1f]":!Ao.value&&eo.value}]),style:normalizeStyle({width:`${go.value}px`,height:`${go.value}px`})},[$o.value.favicon?(openBlock(),createElementBlock("img",{key:0,src:Ao.value,class:"w-full h-full"},null,8,_hoisted_8$5)):(openBlock(),createBlock(_sfc_main$1v,{key:1,src:unref(assetUrl)("icon-image-broken-2.svg"),vProps:{width:16,height:16,nestedFill:po.value}},null,8,["src","vProps"]))],6)):createCommentVNode("",!0)],6)):createCommentVNode("",!0),ho.value&&$o.value.ogImage?(openBlock(),createElementBlock("div",{key:1,class:"ogimage-island ml-auto og-image-border overflow-hidden shrink flex items-end justify-end h-full aspect-video",style:normalizeStyle({maxWidth:`${IMAGE_MAX_WIDTH*jr.value}px`,borderRadius:Co.value})},[createBaseVNode("img",{src:zo.value,class:"h-full w-full object-cover object-center",style:normalizeStyle({maxHeight:`${io.value*jr.value-24-2}px`})},null,12,_hoisted_9$5)],4)):createCommentVNode("",!0),ho.value&&!$o.value.ogImage?(openBlock(),createElementBlock("div",{key:2,class:"ogimage-island og-image-border ml-auto rounded-[16px] overflow-hidden shrink flex items-end justify-end aspect-video h-full",style:normalizeStyle({maxWidth:`${IMAGE_MAX_WIDTH*jr.value}px`})},[createBaseVNode("img",{src:"/images/bookmark-empty-3.png",class:"h-full w-full object-cover object-center",style:normalizeStyle({maxHeight:`${io.value*jr.value-24-2}px`})},null,12,_hoisted_10$5)],4)):createCommentVNode("",!0)],64)):createCommentVNode("",!0),(To.value||unref(Br)||unref(Lr))&&Hr.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(["absolute top-0 left-0 w-full h-full",{"bg-[#f5f5f50a]":Hr.value,"bg-[#f5f5f514]":zr.value}])},null,2)):createCommentVNode("",!0)],38)]),_:1})}}}),BookmarkEmbed_vue_vue_type_style_index_0_scoped_3f6e2d53_lang="",BookmarkEmbed=_export_sfc(_sfc_main$t,[["__scopeId","data-v-3f6e2d53"]]),Embed_vue_vue_type_style_index_0_scoped_62e8cfe8_lang="",_sfc_main$s={name:"Embed",components:{Button},props:{blockId:{type:String},scale:{type:Number,default:1},classObject:{type:Object},preferredHeight:{type:Number},appId:{type:String},isBeingModified:{type:Boolean,default:!1}},emits:["activate-edit-mode"],inject:["blockConfig"],setup(Tr){const Cr=useBlockLayoutsStore(),$r=useBlockStore(),Ar=useArtboardStore(),Rr=useMiscStore(),Dr=inject("selectedBlockId"),Mr=inject("editingBlockId"),Br=inject("isReadOnly"),Nr=inject("isPreview"),Lr=inject("isMobile"),{updateCounterForAIGeneration:Hr}=inject("counterForAIGeneration"),{blockId:zr}=toRefs$1(Tr),Ur=computed(()=>{var io,uo;return((uo=(io=$r.aiObject(zr.value))==null?void 0:io.content)==null?void 0:uo.results)??[]}),Vr=computed(()=>Ur.value.length>0),jr=ref(null),Gr=useElementBounding$1(jr),Xr=Gr==null?void 0:Gr.height,Kr=useAppStore(),Zr=computed(()=>$r.parentId(zr.value)??""),eo=computed(()=>Kr.getThemeObject(Tr.appId,Zr.value||"")),Wr=computed(()=>$r.isAnyBlockDragging),Yr=computed(()=>Ar.isAnyBlockResizing),Jr=computed(()=>Ar.getBlockResizerId),no=computed(()=>Ar.getBlockPositionChangeInProgress),ro=computed(()=>Ar.getPageMountFlag(Zr.value)),so=computed(()=>Rr.isAIGeneratingSomething),ao=computed(()=>Rr.isSlideShowInProgress),lo=computed(()=>Rr.isUndoRedoing),po=computed(()=>Cr.inTemplateMode),{isPdf:go,isScreenshot:co}=useRouteInfo(),mo=inject("itemRefs");return{inTemplateMode:po,isMobile:Lr,isPdf:go,isScreenshot:co,isUndoRedoInProgress:lo,isAIGeneratingSomething:so,isSlideShowInProgress:ao,isPageMounting:ro,blockPositionChangeInProgress:no,blockResizerId:Jr,isAnyBlockResizing:Yr,isAnyBlockDragging:Wr,itemRefs:mo,isPreview:Nr,hasAIResults:Vr,updateCounterForAIGeneration:Hr,isReadOnly:Br,editingBlockId:Mr,embed:jr,height:Xr,blockDims:Gr,blockStore:$r,selectedBlockId:Dr,themeObject:eo}},data(){return{containerStyleDefault:{fontFamily:"inherit"}}},computed:{lookupKey(){return this.blockStore.type(this.blockId)},page(){return this.blockStore.blockObject(this.blockId)??{}},config(){return this.blockStore.config(this.blockId)},isTextEmbed(){return isTextEmbed(this.page)},isCoverTitleEmbed(){return isCoverTitleEmbed(this.page)},isTitleEmbed(){return isTitleEmbed(this.page)},isHeadingEmbed(){return isHeadingEmbed(this.page)},isSmallHeadingEmbed(){return isSmallHeadingEmbed(this.page)},isSubtitleEmbed(){return isSubtitleEmbed(this.page)},isCaptionEmbed(){return isCaptionEmbed(this.page)},isImageEmbed(){return isImageEmbed(this.page)},isShapeEmbed(){return isShapeEmbed(this.page)},isCollectionEmbed(){return isCollectionEmbed(this.page)},isTableEmbed(){return isTableEmbed(this.page)},isDividerEmbed(){return isDividerEmbed(this.page)},isWebpageEmbed(){return isWebpageEmbed(this.page)},isBookmarkEmbed(){return isBookmarkEmbed(this.page)},currentDragBlockId(){return this.blockStore.currentDragBlockId},allBlocks(){return lodashExports.cloneDeep(this.pageStore.children(this.pageId)).reverse()},indexInAllBlocks(){return this.allBlocks.indexOf(this.blockId)},containerStyle(){return this.isTextEmbed?this.containerStyleDefault:{...this.containerStyleDefault,height:`${this.preferredHeight}px`||"100%",width:"100%"}},wrapperStyle(){var Rr,Dr,Mr,Br,Nr,Lr;const Tr={};((Dr=(Rr=this.config)==null?void 0:Rr.scroll)==null?void 0:Dr.selectedId)==="container"&&(Tr.overflow="auto");const $r=(Br=(Mr=this.config)==null?void 0:Mr.padding)==null?void 0:Br.selectedId,Ar=(Lr=(Nr=this.config)==null?void 0:Nr.appearance)==null?void 0:Lr.selectedId;return $r==="none"||Ar==="full"?(Tr.paddingRight="0px",Tr.paddingLeft="0px",Tr.paddingTop="0px",Tr.paddingBottom="0px"):$r==="standard"||Ar==="card"?(Tr.paddingRight="8px",Tr.paddingLeft="8px",Tr.paddingTop="8px",Tr.paddingBottom="8px"):$r==="loose"&&(Tr.paddingRight="16px",Tr.paddingLeft="16px",Tr.paddingTop="16px",Tr.paddingBottom="16px"),(this.isImageEmbed||this.isShapeEmbed)&&(Tr.paddingRight="0px",Tr.paddingLeft="0px",Tr.paddingTop="0px",Tr.paddingBottom="0px"),this.isImageEmbed&&(Tr.borderRadius="inherit"),Tr}},methods:{componentFor(Tr){return this.isTextEmbed?_sfc_main$10:this.isTableEmbed?TableEmbed:this.isImageEmbed?ImageEmbed:this.isShapeEmbed?ShapeEmbed:this.isCollectionEmbed?CollectionEmbed:this.isDividerEmbed?DividerEmbed:this.isWebpageEmbed?_sfc_main$u:this.isBookmarkEmbed?BookmarkEmbed:_sfc_main$10},getValueFromSelectedOption(Tr,{keyIn:Cr,keyOut:$r}){if($r==null&&($r=Cr),this.blockConfig.state.options[Cr]==null)return{};const Ar={},Rr=this.blockConfig.state.options[Cr].map(Dr=>Dr.id).indexOf(Tr[Cr].selectedId);return Rr>=0?Ar[$r]=this.blockConfig.state.options[Cr][Rr].value:Cr==="fontFamily"&&(Ar[$r]=Tr[Cr].selectedId),Ar},getValueDirectly(Tr,{keyIn:Cr,keyOut:$r}){$r==null&&($r=Cr);const Ar={};return Ar[$r]=Tr[Cr].value,Ar},transformConfig(Tr){var Rr,Dr,Mr,Br,Nr,Lr,Hr,zr,Ur,Vr,jr;let Cr={};if("background"in Tr&&Tr.background.selectedId!=null&&(Tr.background.selectedId.startsWith("hsl")?Cr.bgColorDict={color:Tr.background.selectedId}:Number.isNaN(parseInt(Tr.background.selectedId.split(" ")[1],10))?Cr.bgColorDict={color:Tr.background.selectedId}:Cr.bgColorDict={type:Tr.background.selectedId.split(" ")[0],level:parseInt(Tr.background.selectedId.split(" ")[1],10)}),"borderColor"in Tr&&Tr.borderColor.selectedId!=null&&(Tr.borderColor.selectedId.startsWith("hsl")?Cr.borderColorDict={color:Tr.borderColor.selectedId}:Cr.borderColorDict={type:Tr.borderColor.selectedId.split(" ")[0],level:parseInt(Tr.borderColor.selectedId.split(" ")[1],10)}),"icons"in Tr){const Gr=this.blockConfig.state.options.icons.map(Xr=>Xr.id).indexOf(Tr.icons.selectedId);if(Gr>=0)Cr.iconObject={icon:this.blockConfig.state.options.icons[Gr].value,slot:(Cr.title??"").length>0?"start":"icon-only",isFromLibrary:!0};else{const Xr=this.blockConfig.state.options.emojis.map(Kr=>Kr.id).indexOf(Tr.icons.selectedId);Xr>=0&&(Cr.iconObject={icon:this.blockConfig.state.options.emojis[Xr].value,slot:(Cr.title??"").length>0?"start":"icon-only",isEmoji:!0})}}if("fontSize"in Tr&&(Cr.fontSize=parseFloat(Tr.fontSize.selectedId,10)),"backgroundColor"in Tr){const Gr=(Rr=Tr.backgroundColor)==null?void 0:Rr.selectedId;if(!theme.blockColorTypes.includes(Gr)&&Gr!=null)theme.isWhiteColor({color:Gr})?Cr.backgroundColor=((Br=(Mr=(Dr=this.themeObject)==null?void 0:Dr.block)==null?void 0:Mr.none)==null?void 0:Br.background)??Gr:Cr.backgroundColor=Gr;else{const Xr=((Nr=this.themeObject.block[Gr]??this.themeObject.block.none)==null?void 0:Nr.background)||this.themeObject.block.none.background;Cr.backgroundColor=Xr}}if("color"in Tr){const Gr="#0D0C0C",Xr=(Lr=Tr.backgroundColor)==null?void 0:Lr.selectedId,Kr=((Hr=Tr.color)==null?void 0:Hr.selectedId)??Gr;if(!theme.blockColorTypes.includes(Xr)&&Xr!=null)theme.isWhiteColor({color:Xr})?Cr.color=((Vr=(Ur=(zr=this.themeObject)==null?void 0:zr.block)==null?void 0:Ur.none)==null?void 0:Vr.color)??Kr:Cr.color=Kr,Cr.color==="#000"&&(Cr.color=Gr);else{const Zr=((jr=this.themeObject.block[Xr]??this.themeObject.block.none)==null?void 0:jr.color)||this.themeObject.block.none.color;Cr.color=Zr||Gr,Cr.color==="#000"&&(Cr.color=Gr)}}return"textAlignment"in Tr&&(Cr.textAlignment=Tr.textAlignment.selectedId),[{keyIn:"buttonStates",keyOut:"fill"},{keyIn:"aspectRatio"},{keyIn:"cardSize"},{keyIn:"textPosition"},{keyIn:"orientation"},{keyIn:"overlayButton"},{keyIn:"appearance"},{keyIn:"textType"},{keyIn:"shapeType"},{keyIn:"imageType"},{keyIn:"collectionType"},{keyIn:"verticalAlignment"},{keyIn:"objectFit"},{keyIn:"flipHorizontal"},{keyIn:"flipVertical"},{keyIn:"borderPosition"},{keyIn:"fontFamily"},{keyIn:"fontWeight"}].forEach(({keyIn:Gr,keyOut:Xr})=>{if(Tr[Gr]==null)return;const Kr=this.getValueFromSelectedOption(Tr,{keyIn:Gr,keyOut:Xr});Cr={...Cr,...Kr}}),[{keyIn:"overlayTag"},{keyIn:"overlayAvatarText"},{keyIn:"overlayCaption"},{keyIn:"tilesPerRow"},{keyIn:"label"},{keyIn:"content"},{keyIn:"customStyle"},{keyIn:"source"},{keyIn:"aiResultId"},{keyIn:"numSides"},{keyIn:"borderRadius"},{keyIn:"borderObject"},{keyIn:"rotateAngle"},{keyIn:"generatedBy"},{keyIn:"borderThickness"},{keyIn:"showBorder"},{keyIn:"opacity"},{keyIn:"hasRequestedAIImages"},{keyIn:"lineHeight"},{keyIn:"letterSpacing"},{keyIn:"hasHeaderRow"},{keyIn:"hasHeaderColumn"},{keyIn:"hasZebraStripes"}].forEach(({keyIn:Gr,keyOut:Xr})=>{if(Tr[Gr]==null)return;const Kr=this.getValueDirectly(Tr,{keyIn:Gr,keyOut:Xr});Cr={...Cr,...Kr}}),Cr},propsForComponent(Tr){let Cr=!1;this.isTextEmbed?Cr=this.blockId===this.selectedBlockId&&this.blockId===this.editingBlockId:Cr=this.blockId===this.selectedBlockId,Cr=Cr&&!this.isReadOnly;let $r={blockId:this.blockId,isActive:Cr,isEditable:!this.isReadOnly&&this.selectedBlockId===this.blockId,scale:this.scale,isPreview:this.isPreview,classObject:this.classObject,isLoading:this.blockStore.loading[this.blockId],appId:this.appId,isBeingModified:this.isBeingModified};return $r={...$r,...this.transformConfig(this.config)},this.isTextEmbed&&!$r.content&&($r.content=void 0),this.isImageEmbed&&($r.hasAIResults=this.hasAIResults,$r.blockDims=this.isMobile?{}:this.blockDims,$r.appId=this.appId,$r.height=this.preferredHeight),$r},handleContentChange({value:Tr}){this.blockStore.updateProps(this.blockId,{keyPath:["config","content","value"],value:Tr})},handleUpdateSource({value:Tr}){this.blockStore.updateProps(this.blockId,{keyPath:["config","source","value"],value:Tr})},scrollToBottom(Tr){Tr&&Tr.scrollTo({behavior:"smooth",top:Tr.scrollHeight})},async handleChangedHeight(Tr){if(!isEnabled("infiniteCanvas")||this.isReadOnly&&!this.inTemplateMode||this.isMobile||this.isPdf||this.isScreenshot)return;const Cr=basicFlexLogic.roundValue(Tr),$r=basicFlexLogic.getNewHeightForBlock({blockId:this.blockId,proposedHeight:Cr}),Ar=this.blockStore.positionByDisplay(this.blockId,"desktop"),Rr=this.blockStore.contentHeight(this.blockId);let Dr=Ar.height;if(Cr>=Ar.height?Dr=Cr:Cr>=Rr-.1||Rr(openBlock(),createElementBlock("div",_hoisted_1$f,[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-loader-circle-gradient.svg"),class:"loader p-1",vProps:{height:Cr.size,width:Cr.size}},null,8,["src","vProps"])]))}}),LoaderCircle2_vue_vue_type_style_index_0_scoped_f7d15bae_lang="",LoaderCircle2=_export_sfc(_sfc_main$r,[["__scopeId","data-v-f7d15bae"]]),_sfc_main$q=defineComponent({__name:"GradientBorderWrapper",props:{borderWidth:{default:2},borderRadius:{default:8},isOutline:{type:Boolean,default:!1},width:{default:"100%"},height:{default:"100%"}},setup(Tr){const Cr=Tr;return($r,Ar)=>(openBlock(),createElementBlock("div",{class:"flex justify-center items-center gradient",style:normalizeStyle({width:Cr.width,height:Cr.height,padding:`${Cr.borderWidth}px`,borderRadius:`${Cr.borderRadius}px`})},[renderSlot($r.$slots,"default",{},void 0,!0)],4))}}),GradientBorderWrapper_vue_vue_type_style_index_0_scoped_eb1d38c0_lang="",GradientBorderWrapper=_export_sfc(_sfc_main$q,[["__scopeId","data-v-eb1d38c0"]]),_sfc_main$p={setup(Tr){var Lr,Hr,zr;const{blockId:Cr}=toRefs$1(Tr),$r=useBlockStore(),Ar=computed(()=>{var Ur,Vr;return((Vr=(Ur=$r.aiObject(Cr.value))==null?void 0:Ur.content)==null?void 0:Vr.results)??[]}),Rr=ref(((zr=(Hr=(Lr=$r.blockObject(Cr.value))==null?void 0:Lr.config)==null?void 0:Hr.aiResultId)==null?void 0:zr.value)??""),Dr=computed(()=>{if(!Ar.value.length)return 0;let Ur=52;const{size:Vr}=Ar.value[0];return Vr==="960x768"?Ur=38:Vr==="768x960"&&(Ur=63),Ur}),Mr=ref(null),Br=(Ur,Vr)=>{$r.updateProps(Cr.value,{keyPath:Ur,value:Vr})};return{aiResults:Ar,aiResultUsedId:Rr,assetUrl,imageHeight:Dr,imageHoverId:Mr,useAIResult:Ur=>{Rr.value=Ur.id,Br(["config","source","value"],Ur.source),Br(["config","aiResultId","value"],Ur.id)}}},data(){return{hovering:!1}},props:{blockId:{type:String},pos:{type:Object}},components:{GradientBorderWrapper,Icon:_sfc_main$1v,ImageEmbed}};function _sfc_render$4(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("ImageEmbed"),Br=resolveComponent("GradientBorderWrapper"),Nr=resolveComponent("Icon");return Ar.aiResults&&Ar.aiResults.length?(openBlock(),createElementBlock("div",{key:0,onMouseover:Cr[2]||(Cr[2]=Lr=>Rr.hovering=!0),onMouseleave:Cr[3]||(Cr[3]=Lr=>Rr.hovering=!1),style:normalizeStyle([{background:"white",padding:"4px",position:"absolute",gap:"4px",display:"flex",flexDirection:"column",borderRadius:"10px",opacity:Rr.hovering?1:.38},$r.pos])},[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Ar.aiResults,Lr=>(openBlock(),createElementBlock("div",{style:normalizeStyle({position:"relative",height:`${Ar.imageHeight}px`,minWidth:"52px",maxWidth:"52px",aspectRatio:1/1,display:"flex",gap:"8px",justifyContent:"space-between",alignItems:"center"}),key:Lr.id},[Ar.imageHoverId===Lr.id||Ar.aiResultUsedId===Lr.id?(openBlock(),createBlock(Br,{key:0,width:"100%",style:{borderRadius:"8px",zIndex:0}},{default:withCtx(()=>[createVNode(Mr,{onClick:Hr=>Ar.useAIResult(Lr),source:Lr.source,style:normalizeStyle({borderRadius:"8px",width:"114px",height:`${Ar.imageHeight-4}px`}),onMouseover:Hr=>Ar.imageHoverId=Lr.id,onMouseleave:Cr[0]||(Cr[0]=Hr=>Ar.imageHoverId=null)},null,8,["onClick","source","style","onMouseover"])]),_:2},1024)):(openBlock(),createBlock(Mr,{key:1,onClick:Hr=>Ar.useAIResult(Lr),source:Lr.source,style:{borderRadius:"8px"},onMouseover:Hr=>Ar.imageHoverId=Lr.id,onMouseleave:Cr[1]||(Cr[1]=Hr=>Ar.imageHoverId=null)},null,8,["onClick","source","onMouseover"])),Ar.aiResultUsedId===Lr.id?(openBlock(),createElementBlock("div",{key:2,style:normalizeStyle({position:"absolute",right:"calc(50% - 8px)",width:"16px",height:"16px",borderRadius:"50%",background:Tr.appTheme.palette.neutral[0],display:"flex",justifyContent:"center",alignItems:"center"})},[createVNode(Nr,{src:Ar.assetUrl("icon-gradient-check.svg"),vProps:{height:8,width:8}},null,8,["src"])],4)):createCommentVNode("",!0)],4))),128))],36)):createCommentVNode("",!0)}const ImagesPane=_export_sfc(_sfc_main$p,[["render",_sfc_render$4]]),_hoisted_1$e={style:{cursor:"inherit"}},_hoisted_2$b=["onClick"],_hoisted_3$9={style:{minWidth:"16px"}},_sfc_main$o=defineComponent({__name:"LayoutGrpTypeDropdown",props:{layoutBtnStyle:{},blockId:{},hovering:{type:Boolean}},setup(Tr){const Cr=Tr,$r={id:"static",iconId:null,name:"Static"},Ar=useBlockLayoutsStore(),Rr=ref(!1),Dr=ref({top:0}),Mr=ref(null),Br=inject("scale"),Nr=inject("selectedPageId"),Lr=computed(()=>Ar.inTemplateMode),Hr=computed(()=>Ar.inTestMode),zr=computed(()=>Ar.bIdToGrpId(Nr.value)),Ur=computed(()=>zr.value[Cr.blockId??""]),Vr=computed(()=>Ar.layoutPrompts[Nr.value]),jr=computed(()=>{var Wr,Yr;return((Yr=(Wr=Vr.value)==null?void 0:Wr.config)==null?void 0:Yr.groups)??{}}),Gr=computed(()=>{var Wr;return(Wr=jr.value[Ur.value])==null?void 0:Wr.hash}),Xr=computed(()=>{var Wr;return((Wr=jr.value[Ur.value])==null?void 0:Wr.blocks.length)>=2?Ur.value:"static"}),Kr=computed(()=>{const Wr=[$r];return Object.entries(jr.value).forEach(([Yr,{hash:Jr,blocks:no}])=>{if(Jr!==Gr.value)return;const ro={id:Yr,iconId:null};Yr!==Ur.value?Wr.push({...ro,name:no.length>=2?"Group":"1 Other Block"}):Xr.value!=="static"&&Wr.push({...ro,name:"Group"})}),Wr}),Zr=computed(()=>Kr.value.length>1),eo=async Wr=>{if(Xr.value===Wr)return;const{data:Yr,error:Jr}=await updateGrpAssignment({layoutId:Vr.value.id,groupId:Ur.value,blockId:Cr.blockId,desiredGroup:Wr});if(Jr||!Yr){console.error(Jr);return}Ar.setLayoutPrompt(Yr)};return(Wr,Yr)=>(openBlock(),createBlock(unref(ge$2),{as:"div",style:normalizeStyle({visibility:Lr.value&&!Hr.value&&(Wr.hovering||Rr.value)?"visible":"hidden"})},{default:withCtx(()=>[createVNode(unref(Se$1),{class:normalizeClass({"cursor-pointer":Zr.value,"cursor-default":!Zr.value})},{default:withCtx(()=>[createBaseVNode("div",{onMouseenter:Yr[0]||(Yr[0]=Jr=>Rr.value=!0),onMouseleave:Yr[1]||(Yr[1]=Jr=>Rr.value=!1),class:"absolute left-0 top-0 -translate-y-full whitespace-nowrap",style:normalizeStyle({paddingBottom:`${2*unref(Br)+4}px`,paddingRight:`${16*unref(Br)}px`})},[createBaseVNode("div",{class:"rounded-lg text-xs font-medium px-2 py-1 flex gap-1 items-center",style:normalizeStyle(Wr.layoutBtnStyle)},[createBaseVNode("label",_hoisted_1$e,toDisplayString(Xr.value==="static"?"Static block":"Group of blocks"),1),Zr.value?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)("icon-chevron-down-3.svg"),vProps:{width:"10px",height:"10px",nestedFill:Wr.layoutBtnStyle.color},style:{padding:"1px"}},null,8,["src","vProps"])):createCommentVNode("",!0)],4)],36)]),_:1},8,["class"]),createVNode(Transition,{label:"fade"},{default:withCtx(()=>[Zr.value?(openBlock(),createBlock(unref(be),{key:0,as:"ul",ref_key:"layoutGrpMenu",ref:Mr,class:"misc-artboard-menu absolute w-52 overflow-auto rounded-xl bg-white shadow-lg border border-neutral-100 flex flex-col gap-1 p-1",style:normalizeStyle({top:`${Dr.value.top}px`,width:"189px",..."left"in Dr.value?{left:`${Dr.value.left}px`}:{},..."right"in Dr.value?{right:`${Dr.value.right}px`}:{}})},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Kr.value,Jr=>(openBlock(),createBlock(unref(Me),{key:Jr.id},{default:withCtx(({active:no})=>[createBaseVNode("li",{class:normalizeClass(["px-3 py-2 hover:bg-neutral-50 rounded-lg flex justify-between items-center text-sm cursor-pointer",{"bg-neutral-100":no}]),onClick:()=>eo(Jr.id)},[createBaseVNode("div",{class:normalizeClass(["flex items-center gap-2",{"two-part-btn":!Jr.iconId,"three-part-btn":Jr.iconId}])},[Jr.iconId?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)(`icon-${Jr.iconId}.svg`),vProps:{width:"16px",height:"16px"}},null,8,["src"])):createCommentVNode("",!0),createBaseVNode("span",null,toDisplayString(Jr.name),1),createBaseVNode("div",_hoisted_3$9,[Jr.id===Xr.value?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)("icon-check.svg"),"v-props":{width:"16px",height:"16px",stroke:"#323F4B"}},null,8,["src"])):createCommentVNode("",!0)])],2)],10,_hoisted_2$b)]),_:2},1024))),128))]),_:1},8,["style"])):createCommentVNode("",!0)]),_:1})]),_:1},8,["style"]))}}),GenericBlock_vue_vue_type_style_index_0_scoped_43f216b6_lang="",_sfc_main$n={setup(Tr){const Ar=isEnabled("internalVariableTuning"),{scale:Rr}=toRefs$1(Tr),Dr=ref(null),Mr=ref({density:Tr.density,display:Tr.category}),Br=ref(0),Nr=ref(!1),Lr=useBlockStore(),Hr=useArtboardStore(),zr=useTableStore(),Ur=usePageStore(),Vr=useAppStore(),jr=useMiscStore(),Gr=useBlockLayoutsStore(),Xr=useInternalVariableTuning(),Kr=useItemStore(),Zr=inject("isReadOnly"),eo=inject("maxHeight"),Wr=inject("showingFullScreen"),Yr=inject("showingFullPage"),Jr=inject("selectedBlockId"),no=inject("itemRefs"),ro=inject("allBlocks"),{highlightedBlockIds:so}=inject("highlightedBlockIds"),ao=inject("selectedPageId"),lo=inject("isMobile"),po=inject("isPreview"),go=inject("currentDraggingElementPosition"),co=inject("showCenterVertical"),mo=inject("showCenterHorizontal"),{dropzoneBlockIds:io,setDropzoneBlockIds:uo}=inject("dropzoneBlockIds"),{movingBlockIds:ho,setMovingBlockIds:yo}=inject("movingBlockIds"),{focused:So}=useFocus(Dr),{isPdf:ko,isScreenshot:$o}=useRouteInfo();provide("scale",Rr),provide("editorInstances",{});const Go=computed(()=>ko.value||$o.value||Wr.value||Yr.value||Lr.type(Tr.blockId)==="bookmark"),No=computed(()=>Jr.value===Tr.blockId),Eo=computed(()=>Lr.title(Tr.blockId)),Mo=computed(()=>Lr.title(Tr.blockId)),Ro=computed(()=>Lr.blockObject(Tr.blockId).subtype),Ao=computed(()=>!!Lr.loading[Tr.blockId]),zo=computed(()=>Lr.positionByDisplay(Tr.blockId,Tr.category)),Oo=computed(()=>zo.value.width),Bo=computed(()=>zo.value.height),bo=computed(()=>zo.value.x),vo=computed(()=>zo.value.y),Io=computed(()=>Lr.contentHeight(Tr.blockId)),To=computed(()=>Hr.getLocalPositionObject(Tr.blockId)),Co=computed(()=>Zr.value||Lr.isRepositioningImg(Tr.blockId)),Po=computed(()=>Lr.isAnyBlockDragging),Fo=computed(()=>Hr.isAnyBlockResizing),Vo=computed(()=>Hr.getBlockPositionChangeInProgress),Ko=computed(()=>zr.draggingTableEl),Uo=computed(()=>Hr.isDraggingResizing),ei=computed(()=>Lr.currentDragBlockId),qo=computed(()=>{var di;return(di=Lr.blockObject(Tr.blockId))==null?void 0:di.config}),ri=computed(()=>{var di,ss;return((ss=(di=qo.value)==null?void 0:di.positionAngle)==null?void 0:ss.value)??0}),ki=computed(()=>GHOST_TRANSITION_TIMING_FUNCTION),ti=computed(()=>`${BLOCK_SHRINKING_DURATION.value}ms`),ai=computed(()=>`${BLOCK_SHRINKING_DELAY.value}ms`),Xo=computed(()=>Ar&&!po.value&&Xr.showDimensions),si=computed(()=>Gr.inTemplateMode),vi=computed(()=>Gr.bIdToGrpId(ao.value)),Ci=computed(()=>vi.value[Tr.blockId??""]),wi=computed(()=>Gr.layoutPrompts[ao.value]),bi=computed(()=>{var di,ss;return((ss=(di=wi.value)==null?void 0:di.config)==null?void 0:ss.groups)??{}}),li=computed(()=>{var di;return si.value?bi.value[Ci.value]?bi.value[Ci.value].blocks.length>=2:((di=Tr.layoutGrp.bIds)==null?void 0:di.length)>=2:!1}),ci=computed(()=>Lr.parentId(Tr.blockId)),Ii=computed(()=>Kr.data[ci.value]??{}),Ni=computed(()=>{var di;return(di=Ur.pageObject(ci.value))==null?void 0:di.parent_id}),Ei=computed(()=>Vr.borderRadius(Ni.value)),$i=computed(()=>Ei.value),Ri=computed(()=>Vr.deckThemeValue(Ni.value)),Fi=computed(()=>Wr.value?Rr.value:po.value?Math.max(Rr.value,1):Rr.value),bs=computed(()=>Fi.value*To.value.height),qi=computed(()=>`${bs.value}px`),Mi=computed(()=>{var ss,Ls;const di=(Ls=(ss=Lr.config(Tr.blockId))==null?void 0:ss.link)==null?void 0:Ls.value;if(di!=null&&di.startsWith("prezo:")){const ha=di.slice(6);return{prezo:!0,val:Vr.hyperlinkedDecks[ha]}}return{prezo:!1,val:di}}),Ui=computed(()=>isEnabled("imageQuickMenu"));Hr.updatePositionObject({blockId:Tr.blockId,positionObject:{width:Oo.value,height:Bo.value,x:bo.value,y:vo.value}});const Ki=di=>{Hr.updatePositionObject({blockId:Tr.blockId,positionObject:{...To.value,...di}})};Zr.value||watch(No,()=>{So.value=No.value});const Ss=(di,ss=1)=>Math.round(di*1e3)/1e3;watch(ei,di=>{Nr.value=!1});const gs=ref(null),{height:Fs}=useElementBounding$1(gs),Yi=ref(Fs.value);return Zr.value||watch(()=>qo.value,async()=>{var di,ss,Ls;await nextTick(),await sleep(10),Yi.value=(Ls=(ss=(di=gs==null?void 0:gs.value)==null?void 0:di.embed)==null?void 0:ss.getBoundingClientRect())==null?void 0:Ls.height},{deep:!0}),onMounted(async()=>{var di,ss,Ls;await nextTick(),await sleep(10),Yi.value=(Ls=(ss=(di=gs==null?void 0:gs.value)==null?void 0:di.embed)==null?void 0:ss.getBoundingClientRect())==null?void 0:Ls.height}),Zr.value||(watch(bo,di=>{di!==To.value.x&&Ki({x:di})}),watch(vo,di=>{di!==To.value.y&&Ki({y:di})}),watch(Oo,di=>{di!==To.value.width&&Ki({width:di})}),watch(Bo,di=>{di!==To.value.height&&Ki({height:di})})),{selectBlockLayoutGroup:()=>{if(!(!si.value||po.value)){if(li.value){Gr.selected={type:"group",id:"gId",blockId:Tr.blockId};return}Gr.selected={type:"static",id:Tr.blockId,blockId:Tr.blockId}}},deckThemeValue:Ri,inLayoutGrp:li,inTemplateMode:si,showDimensions:Xo,restrictViewOfBlock:Go,blockPositionsChanging:Vo,blockHeightPx:qi,blockHeight:bs,IS_DEV,blockContentHeight:Io,draggingTableEl:Ko,isDraggingResizing:Uo,blockSelected:No,isPdf:ko,isScreenshot:$o,IS_BLOCK_SHRINKING_ALLOWED,BLOCK_SHRINKING_DELAY_MS:ai,BLOCK_SHRINKING_DURATION_MS:ti,BLOCK_SHRINKING_TIMING_FUNCTION:ki,borderRadiusStored:$i,link:Mi,goToLink:di=>{di.preventDefault();const ss=hasClassOrAncestorHasClass(di.target,"prezo-link");ss?window.open(ss.href,"_blank"):window.open(Mi.value.val,Mi.value.prezo?"_self":"_blank")},dragBlockId:ei,isMobile:lo,assetUrl,pageStore:Ur,appStore:Vr,isAnyBlockResizing:Fo,pressed:Nr,slideId:ci,itemStore:Kr,ITEM_MAP:Ii,movingBlockIds:ho,setMovingBlockIds:yo,dropzoneBlockIds:io,setDropzoneBlockIds:uo,isImageQuickMenuEnabled:Ui,BORDER_WIDTH:1,showingFullScreen:Wr,showingFullPage:Yr,RESIZER_GAP:5,genericBlock:Dr,isPreview:po,mountKey:Br,disableResizing:Co,scaleToUse:Fi,highlightedBlockIds:so,updatePositionObject:Ki,allBlocks:ro,itemRefs:no,showCenterHorizontal:mo,showCenterVertical:co,positionByDisplay:zo,focused:So,rotateAngle:ri,roundToNearest:Ss,isReadOnly:Zr,maxHeight:eo,embed:gs,heightToUse:Yi,blockStore:Lr,title:Eo,content:Mo,storedWidth:Oo,storedHeight:Bo,storedX:bo,storedY:vo,currentDraggingElementPosition:go,positionObject:To,prevDensityDisplay:Mr,componentType:Ro,isLoading:Ao,onLoaderDoubleClick:di=>{di.preventDefault(),di.stopPropagation()},miscStore:jr,isAnyBlockDragging:Po,selectedPageId:ao,artboardStore:Hr}},inject:["layout"],emits:["toggleSettingsMenu"],props:{blockId:{type:String},layoutGrp:{type:Object},category:{type:String,default:"desktop"},density:{type:String,default:"normal"},contentHeight:{type:Number},isTight:{type:Boolean,default:!1},scale:{type:Number,default:1},columnWidth:{type:Number,default:1},classObject:{type:Object},isBeingModified:{type:Boolean,default:!1},isPartOfSnappingGroup:{type:Boolean,default:!1}},data(){return{hovering:!1}},components:{ImagesPane,Embed,LoaderCircle2,LayoutGrpTypeDropdown:_sfc_main$o},computed:{page(){return this.blockStore.blockObject(this.blockId)??{}},isImageEmpty(){return isImageEmbed(this.page)&&isEmbedEmpty(this.page)},isImageEmbed(){return isImageEmbed(this.page)},isTextEmbed(){return isTextEmbed(this.page)},isTableEmbed(){return isTableEmbed(this.page)},isViewOnly(){return this.appStore.isViewOnly(this.appId)},pageId(){var Tr;return(Tr=this.blockStore.blockObject(this.blockId))==null?void 0:Tr.parent_id},appId(){var Tr;return(Tr=this.pageStore.pageObject(this.pageId))==null?void 0:Tr.parent_id},widthUnits(){return this.positionObject.width},heightUnits(){return this.positionObject.height},xUnits(){return this.positionObject.x},yUnits(){return this.positionObject.y},snappedX(){return this.xUnits*this.columnWidth},snappedY(){return this.yUnits*this.columnWidth},groupIdForBlock(){return this.ITEM_MAP[this.blockId]==null?null:this.ITEM_MAP[this.blockId].groupId},groupBeingResized(){return this.artboardStore.getGroupBeingResized},directionOfResizing(){var Tr;return this.groupBeingResized==null?null:(Tr=this.ITEM_MAP[this.groupBeingResized])==null?void 0:Tr.direction},cursorForResizing(){return this.directionOfResizing==null?"revert":this.directionOfResizing==="row"?"ew-resize":"ns-resize"},itemsBeingResized(){return this.artboardStore.getItemsBeingResized(this.ITEM_MAP)??[]},isBlockInGroupBeingResized(){return this.groupBeingResized===this.groupIdForBlock},blockResizerId(){return this.artboardStore.getBlockResizerId},isBlockInItemsBeingResized(){return basicFlexLogic.isBlockDescendantOfGroup({blockId:this.blockId,groupId:this.itemsBeingResized[0],ITEM_MAP:this.ITEM_MAP})||basicFlexLogic.isBlockDescendantOfGroup({blockId:this.blockId,groupId:this.itemsBeingResized[1],ITEM_MAP:this.ITEM_MAP})||this.blockResizerId==="g-h-0:-1"},groupDirectionForBlock(){var Tr;return(Tr=this.ITEM_MAP[this.groupIdForBlock])==null?void 0:Tr.direction},activeResizers(){const Tr=artboardLogic.getBlockSlideEdges(this.blockId),Cr=artboardLogic.getBlockGroupEdges({blockId:this.blockId,slideId:this.slideId}),$r=[];return!Tr.left&&!Cr.left&&$r.push("l"),!Tr.top&&!Cr.top&&$r.push("t"),!Tr.right&&!Cr.right&&$r.push("r"),!Tr.bottom&&!Cr.bottom&&$r.push("b"),$r},isDynamicColorSwitching(){return theme.appColors.IS_COLOR_SWITCHING_ENABLED},borderRadiusToUse(){return this.isPreview&&!(this.isPdf||this.isScreenshot)&&this.borderRadiusStored>0?this.scale>=.25?6/this.scale:4/this.scale:this.borderRadiusStored*this.scaleToUse},borderRadiusToUsePx(){return`${this.borderRadiusToUse}px`},themeObject(){return this.appStore.getThemeObject(this.appId,this.pageId)},isDividerSlide(){return this.pageStore.isDividerSlide(this.pageId)},backgroundType(){var Tr,Cr;return((Cr=(Tr=this.blockStore.config(this.blockId))==null?void 0:Tr.backgroundColor)==null?void 0:Cr.selectedId)??"none"},backgroundColorToUse(){var $r,Ar,Rr,Dr,Mr,Br;const Tr=((Ar=($r=this.blockStore.config(this.blockId))==null?void 0:$r.backgroundColor)==null?void 0:Ar.selectedId)??"none";return!theme.blockColorTypes.includes(Tr)&&Tr!=null?theme.isWhiteColor({color:Tr})?((Mr=(Dr=(Rr=this.themeObject)==null?void 0:Rr.block)==null?void 0:Dr.none)==null?void 0:Mr.background)??Tr:Tr:((Br=this.themeObject.block[Tr])==null?void 0:Br.background)||this.themeObject.block.none.background},deckTheme(){return this.appStore.deckTheme(this.appId)},isDarkBG(){return this.isDividerSlide&&this.deckTheme!=="yellow"},hoverBackgroundOverrideToUse(){return this.isDividerSlide&&this.backgroundType==="grey"?theme.darken(this.backgroundColorToUse,.04):theme.getSofterColor(this.backgroundColorToUse,.04)},neutralHoverColor(){var Tr,Cr;return theme.getSofterColor((Cr=(Tr=this.themeObject)==null?void 0:Tr.artboard)==null?void 0:Cr.background,.04)},activeBackgroundOverrideToUse(){return this.isDividerSlide&&this.backgroundType==="grey"?theme.darken(this.backgroundColorToUse,.08):theme.getSofterColor(this.backgroundColorToUse,.08)},lightUp(){return this.isActive&&!(this.isPreview||this.isReadOnly)},isAnyTableCellSelected(){return this.miscStore.getIsAnyTableCellSelected(this.blockId)},blockBackgroundType(){var Tr,Cr;return((Cr=(Tr=this.blockStore.config(this.blockId))==null?void 0:Tr.backgroundColor)==null?void 0:Cr.selectedId)??"none"},lightUpColor(){var Cr,$r;const Tr=theme.blockColorTypes.includes(this.blockBackgroundType)?this.blockBackgroundType:"none";return(($r=(Cr=this.themeObject)==null?void 0:Cr.block[Tr])==null?void 0:$r.lightUp)??this.appTheme.colors.brandPurple},lightUpColorOpaque(){return theme.addOpacityToColor(this.lightUpColor,.2)},layoutBtnStyle(){return this.inLayoutGrp?{color:this.isDividerSlide?this.deckThemeValue:"white",background:this.isDividerSlide?"white":this.deckThemeValue}:{color:"white",background:this.isDividerSlide?"#0D0C0C":"#C2C2C2"}},boxShadowToUse(){var Tr,Cr,$r,Ar;if(this.inTemplateMode){let Rr;return this.isDividerSlide?this.inLayoutGrp?Rr=this.hovering?"white":"rgba(255, 255, 255, 0.50)":Rr=this.hovering?"black":"rgba(0, 0, 0, 0.40)":this.inLayoutGrp?Rr=this.hovering?(Cr=(Tr=this.themeObject.block)==null?void 0:Tr.none)==null?void 0:Cr.lightUp:theme.addOpacityToColor((Ar=($r=this.themeObject.block)==null?void 0:$r.none)==null?void 0:Ar.lightUp,.5):Rr=this.hovering?"#C2C2C2":"rgba(207, 206, 206, 0.70)",`inset 0 0 0 ${2*this.scale}px ${Rr}`}return this.isTableEmbed&&this.lightUp&&(this.isAnyTableCellSelected||this.draggingTableEl)?`inset 0 0 0 ${2*this.scale}px ${this.lightUpColorOpaque}`:this.lightUp?`inset 0 0 0 ${2*this.scale}px ${this.lightUpColor}`:(this.showingFullPage||this.showingFullScreen,"none")},showHoverStyle(){const Tr=this.hovering&&!this.isAnyBlockResizing&&!this.draggingTableEl,Cr=this.isBlockInItemsBeingResized,$r=!this.lightUp&&!this.isPreview&&(!this.isReadOnly||this.link.val);return(Tr||Cr||this.isPartOfSnappingGroup||this.isAnyBlockDragging)&&$r},containerStyle(){const Tr={borderRadius:`${this.borderRadiusToUse}px`,transition:"background 0ms ease",background:this.backgroundColorToUse,minHeight:this.restrictViewOfBlock?null:`${this.scaleToUse*this.positionObject.height}px`};return this.showHoverStyle&&(Tr.background=this.hoverBackgroundOverrideToUse),this.pressed&&!this.blockSelected&&!this.isPreview&&(!this.isReadOnly||this.link.val)&&!this.isTableEmbed&&(Tr.background=this.activeBackgroundOverrideToUse),this.isAnyBlockResizing?Tr.cursor=this.cursorForResizing:this.isReadOnly?this.link.val&&(this.showingFullPage||this.showingFullScreen)||this.isPreview?Tr.cursor="pointer":Tr.cursor="default":Tr.cursor="grab",Tr.userSelect=this.isPreview?"none":"revert",Tr},isActive(){return this.blockSelected&&!this.isReadOnly},MIN_WIDTH_BLOCK(){return basicFlexLogic.getMinWidthForItem(this.blockId)},MIN_HEIGHT_BLOCK(){return basicFlexLogic.getMinHeightForItem(this.blockId)}},methods:{isAiImage(Tr){var Cr,$r;return isImageEmbed(this.page)&&(($r=(Cr=this.blockStore.config(Tr))==null?void 0:Cr.generatedBy)==null?void 0:$r.value)==="ai"},savePosition({action:Tr="drag",fromOutside:Cr=!1}){const $r={width:this.roundToNearest(this.positionObject.width),height:this.roundToNearest(this.positionObject.height),x:this.roundToNearest(this.positionObject.x),y:this.roundToNearest(this.positionObject.y)};this.blockStore.updatePosition(this.blockId,{positionObject:$r,display:this.category,density:this.density,saveInDatabase:!1,skipUndo:!0}),this.itemStore.updateItemState({id:this.blockId,slideId:this.slideId,info:{...this.ITEM_MAP[this.blockId],...$r}})},toggleSettingsMenu(){this.$emit("toggleSettingsMenu")}}},__injectCSSVars__$1=()=>{useCssVars(Tr=>({"217ed282":Tr.BLOCK_SHRINKING_DURATION_MS,"71b9a88a":Tr.BLOCK_SHRINKING_TIMING_FUNCTION,"53e60a34":Tr.BLOCK_SHRINKING_DELAY_MS,ffafda7c:Tr.blockHeightPx,"56418f8a":Tr.boxShadowToUse,"7b9ea37c":Tr.borderRadiusToUsePx,"35512f34":Tr.neutralHoverColor}))},__setup__$1=_sfc_main$n.setup;_sfc_main$n.setup=__setup__$1?(Tr,Cr)=>(__injectCSSVars__$1(),__setup__$1(Tr,Cr)):__injectCSSVars__$1;const _hoisted_1$d={key:1,style:{position:"absolute",top:"8px",right:"8px",color:"black",background:"white",zIndex:10,fontSize:"12px"}},_hoisted_2$a=["href","target"],_hoisted_3$8=["data-block-id"],_hoisted_4$7=["data-block-id"],_hoisted_5$6={key:4,class:"shadow-class"},_hoisted_6$5={key:5,class:"block-curtain"},_hoisted_7$5=["id"];function _sfc_render$3(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("LoaderCircle2"),Br=resolveComponent("Embed"),Nr=resolveComponent("LayoutGrpTypeDropdown"),Lr=resolveComponent("ImagesPane");return openBlock(),createElementBlock("div",null,[(openBlock(),createElementBlock("div",{onClick:Cr[10]||(Cr[10]=(...Hr)=>Ar.selectBlockLayoutGroup&&Ar.selectBlockLayoutGroup(...Hr)),onMouseover:Cr[11]||(Cr[11]=Hr=>Rr.hovering=!0),onMouseleave:Cr[12]||(Cr[12]=Hr=>Rr.hovering=!1),key:Ar.mountKey,style:normalizeStyle({position:"absolute",transform:`rotate(${Ar.rotateAngle}deg)`,zIndex:Dr.isActive||Ar.inTemplateMode&&Rr.hovering?2:1,width:`${Ar.scaleToUse*Ar.positionObject.width}px`,height:Ar.restrictViewOfBlock?`${Ar.scaleToUse*Ar.positionObject.height}px`:null,minHeight:Ar.restrictViewOfBlock?null:`${Ar.scaleToUse*Ar.positionObject.height}px`,left:`${Ar.scaleToUse*Ar.positionObject.x}px`,top:`${Ar.scaleToUse*Ar.positionObject.y}px`}),class:normalizeClass(["popoverOverrideNotUsed generic-block",{"slide-animate":!Ar.isDraggingResizing,blockAnimations:Ar.isAnyBlockDragging&&!Ar.blockPositionsChanging&&Ar.IS_BLOCK_SHRINKING_ALLOWED}])},[Ar.isLoading?(openBlock(),createElementBlock("div",{key:0,onDblclick:Cr[0]||(Cr[0]=(...Hr)=>Ar.onLoaderDoubleClick&&Ar.onLoaderDoubleClick(...Hr)),style:{position:"absolute",zIndex:2,width:"100%",height:"100%",userSelect:"none"}},[createVNode(Mr)],32)):createCommentVNode("",!0),Ar.showDimensions?(openBlock(),createElementBlock("div",_hoisted_1$d,[createBaseVNode("p",null,toDisplayString($r.blockId.slice(0,12)),1),createBaseVNode("p",null,toDisplayString(`content: ${Ar.blockContentHeight}`),1),createBaseVNode("p",null,toDisplayString(`h: ${Ar.positionObject.height}`),1),createBaseVNode("p",null,toDisplayString(`w: ${Ar.positionObject.width}`),1)])):createCommentVNode("",!0),Ar.showingFullPage&&Ar.link.val?(openBlock(),createElementBlock("a",{key:2,href:Ar.link.val,target:Ar.link.prezo?"_self":"_blank",onClick:Cr[5]||(Cr[5]=(...Hr)=>Ar.goToLink&&Ar.goToLink(...Hr))},[createBaseVNode("div",{class:normalizeClass(["dragContainer flex rounded-sm w-full h-full",{"overflow-hidden":!Ar.blockStore.isRepositioningImg($r.blockId)&&!Ar.isPreview}]),style:normalizeStyle(Dr.containerStyle),"data-block-id":Ar.isPreview?`${$r.blockId}-preview`:$r.blockId,onMouseover:Cr[1]||(Cr[1]=Hr=>Rr.hovering=!0),onMouseleave:Cr[2]||(Cr[2]=Hr=>{Rr.hovering=!1,Ar.pressed=!1}),onMousedown:Cr[3]||(Cr[3]=Hr=>Ar.pressed=!0),onMouseup:Cr[4]||(Cr[4]=Hr=>Ar.pressed=!1),ref:"genericBlock"},[(openBlock(),createBlock(Br,{ref:"embed",key:Ar.mountKey,classObject:$r.classObject,blockId:$r.blockId,scale:$r.scale,"preferred-height":Ar.scaleToUse*Ar.positionObject.height,isBeingModified:$r.isBeingModified,appId:Dr.appId},null,8,["classObject","blockId","scale","preferred-height","isBeingModified","appId"]))],46,_hoisted_3$8)],8,_hoisted_2$a)):(openBlock(),createElementBlock("div",{key:3,class:normalizeClass(["dragContainer flex rounded-sm w-full h-full",{"overflow-hidden":!Ar.blockStore.isRepositioningImg($r.blockId)&&!Ar.isPreview}]),style:normalizeStyle(Dr.containerStyle),"data-block-id":Ar.isPreview?`${$r.blockId}-preview`:$r.blockId,onMouseover:Cr[6]||(Cr[6]=Hr=>Rr.hovering=!0),onMouseleave:Cr[7]||(Cr[7]=Hr=>{Rr.hovering=!1,Ar.pressed=!1}),onMousedown:Cr[8]||(Cr[8]=Hr=>Ar.pressed=!0),onMouseup:Cr[9]||(Cr[9]=Hr=>Ar.pressed=!1),ref:"genericBlock"},[(openBlock(),createBlock(Br,{ref:"embed",key:Ar.mountKey,classObject:$r.classObject,blockId:$r.blockId,scale:$r.scale,"preferred-height":Ar.scaleToUse*Ar.positionObject.height,isBeingModified:$r.isBeingModified,appId:Dr.appId},null,8,["classObject","blockId","scale","preferred-height","isBeingModified","appId"]))],46,_hoisted_4$7)),Ar.dragBlockId!==$r.blockId&&(!Ar.isReadOnly||Ar.inTemplateMode)?(openBlock(),createElementBlock("div",_hoisted_5$6)):createCommentVNode("",!0),Ar.dragBlockId===$r.blockId&&!Ar.isReadOnly?(openBlock(),createElementBlock("div",_hoisted_6$5)):createCommentVNode("",!0),createBaseVNode("div",{class:"absolute top-0 left-0 z-[100] overflow-visible",id:`teleport-${$r.blockId}`},[Ar.isPreview?createCommentVNode("",!0):(openBlock(),createBlock(Nr,{key:0,hovering:Rr.hovering,blockId:$r.blockId,layoutBtnStyle:Dr.layoutBtnStyle},null,8,["hovering","blockId","layoutBtnStyle"]))],8,_hoisted_7$5),Ar.isImageQuickMenuEnabled&&Ar.blockSelected&&!Ar.isPreview&&!Ar.showingFullPage&&!Ar.showingFullScreen&&!Dr.isViewOnly?(openBlock(),createBlock(Teleport,{key:6,to:"#editor"},[createVNode(Transition,{name:"fade-y",appear:""},{default:withCtx(()=>[Dr.isAiImage($r.blockId)&&!Ar.isPreview&&!Ar.showingFullPage&&!Ar.showingFullScreen?(openBlock(),createBlock(Lr,{key:0,blockId:$r.blockId,pos:{left:`${Ar.scaleToUse*(Ar.positionObject.width+Ar.positionObject.x)+12}px`,top:`${Ar.scaleToUse*Ar.positionObject.y}px`},active:Rr.hovering||Dr.isActive},null,8,["blockId","pos","active"])):createCommentVNode("",!0)]),_:1})])):createCommentVNode("",!0)],38))])}const GenericBlock=_export_sfc(_sfc_main$n,[["render",_sfc_render$3],["__scopeId","data-v-43f216b6"]]),_sfc_main$m=defineComponent({__name:"GenericBlockResizer",props:{onStart:{type:Function},onMove:{type:Function},onEnd:{type:Function},cleanup:{type:Function},initialValue:{},height:{},width:{},scale:{},opacity:{},isDark:{type:Boolean},direction:{},backgroundColor:{},positionForMarker:{},cursor:{}},emits:["mouseover","mouseleave"],setup(Tr,{emit:Cr}){const $r=Tr,{initialValue:Ar}=toRefs$1($r),Rr=ref(null),{position:Dr}=useDraggable(Rr,{initialValue:Ar,preventDefault:!0,axis:$r.direction==="row"?"x":"y",onStart:$r.onStart,onMove:$r.onMove,onEnd:$r.onEnd});onBeforeUnmount(()=>{$r.cleanup()});const Mr=computed(()=>$r.direction==="row"?"x":"y"),Br=computed(()=>$r.direction==="row"?"y":"x"),Nr=computed(()=>$r.direction==="row"?"left":"top"),Lr=computed(()=>$r.direction==="row"?"top":"left"),Hr=computed(()=>$r.direction==="row"?"width":"height"),zr=computed(()=>$r.positionForMarker==null?{[$r.direction==="row"?"minHeight":"minWidth"]:`${groupResizer$1.MIN_RESIER_HEIGHT_WIDTH*$r.scale}px`}:{[Nr.value]:`${$r.positionForMarker[Mr.value]}`,[Lr.value]:`${$r.positionForMarker[Br.value]}`,[Hr.value]:`${groupResizer$1.RESIZER_THICKNESS*$r.scale-2*groupResizer$1.RESIZER_PADDING*$r.scale}px`,transform:$r.direction==="row"?"translate(0%, -50%)":"translate(-50%, 0%)",[$r.direction==="row"?"minHeight":"minWidth"]:`${groupResizer$1.MIN_RESIER_HEIGHT_WIDTH*$r.scale}px`}),Ur=useArtboardStore(),Vr=computed(()=>!Ur.isDraggingResizing||Ur.isAnyBlockResizing),jr=ref(null),Gr=ref(!1);return useEventListener(document,"wheel",Xr=>{Gr.value=!0,jr.value!=null&&clearTimeout(jr.value),jr.value=setTimeout(()=>{jr.value=null,Gr.value=!1},100)},{passive:!1}),(Xr,Kr)=>Vr.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["fixed z-[1] select-none cursor-move generic-resizer rounded-full translate-x-[-50%] translate-y-[-50%] flex justify-center items-center",{"pointer-events-none":Gr.value,"pointer-events-auto":!Gr.value}]),style:normalizeStyle([{"touch-action":"none"},{left:`${unref(Dr).x}px`,top:`${unref(Dr).y}px`,height:Xr.height,width:Xr.width,paddingLeft:Xr.direction==="row"?`${unref(groupResizer$1).RESIZER_PADDING*Xr.scale}px`:"0px",paddingRight:Xr.direction==="row"?`${unref(groupResizer$1).RESIZER_PADDING*Xr.scale}px`:"0px",paddingTop:Xr.direction==="column"?`${unref(groupResizer$1).RESIZER_PADDING*Xr.scale}px`:"0px",paddingBottom:Xr.direction==="column"?`${unref(groupResizer$1).RESIZER_PADDING*Xr.scale}px`:"0px",opacity:Xr.opacity,cursor:Xr.cursor??(Xr.direction==="row"?"ew-resize":"ns-resize"),background:"transparent"}]),ref_key:"resizerRef",ref:Rr,onMouseover:Kr[0]||(Kr[0]=Zr=>Xr.$emit("mouseover")),onMouseleave:Kr[1]||(Kr[1]=Zr=>Xr.$emit("mouseleave")),onContextmenu:Kr[2]||(Kr[2]=withModifiers(()=>{},["prevent"]))},[createBaseVNode("div",{class:normalizeClass(["rounded-full",{"w-full h-[30%]":Xr.direction==="row"&&!Xr.positionForMarker,"w-[30%] h-full":Xr.direction==="column"&&!Xr.positionForMarker,"w-1 h-[30%]":Xr.direction==="row"&&Xr.positionForMarker,"w-[30%] h-1":Xr.direction==="column"&&Xr.positionForMarker}]),style:normalizeStyle({background:Xr.backgroundColor??"#AB65FF",position:Xr.positionForMarker?"absolute":"relative",...zr.value})},null,6)],38)):createCommentVNode("",!0)}}),_sfc_main$l={setup(Tr){const Cr=useBlockStore(),$r=useArtboardStore();toRefs$1(Tr);const Ar=computed(()=>Cr.isAnyBlockDragging),Rr=computed(()=>$r.isAnyBlockResizing),Dr=inject("selectedBlockId"),Mr=inject("currentDraggingElementPosition"),Br=ref(960),Nr=ref(1),Lr=inject("maxHeight"),Hr=inject("showCenterHorizontal"),zr=inject("showCenterVertical"),Ur=inject("guardLines"),Vr=inject("distanceLines"),jr=inject("hoverId"),Gr=()=>{if(jr.value!=="page"){Vr.value=[];return}const{x:eo,y:Wr,width:Yr,height:Jr}=Cr.positionByDisplay(Dr.value,"desktop"),no={from:{x:eo+Yr,y:Wr+Jr/2},to:{x:960,y:Wr+Jr/2},distance:Math.floor(960-(eo+Yr)),type:"right"},ro={from:{x:eo+Yr/2,y:Wr+Jr},to:{x:eo+Yr/2,y:540},distance:Math.floor(540-(Wr+Jr)),type:"bottom"},so={from:{x:eo,y:Wr+Jr/2},to:{x:0,y:Wr+Jr/2},distance:Math.floor(eo),type:"left"},ao={from:{x:eo+Yr/2,y:Wr},to:{x:eo+Yr/2,y:0},distance:Math.floor(Wr),type:"top"};Vr.value=[no,ro,so,ao]},Xr=eo=>eo==="left"?{}:eo==="right"?{transform:"rotate(180deg) translateY(calc(100% + 16px))"}:eo==="top"?{transform:"rotate(270deg) translateX(calc(100% + 10px))"}:eo==="bottom"?{transform:"rotate(90deg) translateX(calc(6px))"}:{};watch(jr,()=>{Gr()});const Kr=inject("currentKeyPressed"),Zr=computed(()=>Kr==null?void 0:Kr.has("alt"));return{transformStyleForDistanceLine:Xr,hoverId:jr,distanceLines:Vr,pressedAlt:Zr,guardLines:Ur,showCenterHorizontal:Hr,showCenterVertical:zr,assetUrl,isAnyBlockDragging:Ar,isAnyBlockResizing:Rr,selectedBlockId:Dr,currentDraggingElementPosition:Mr,gridCount:Br,columnWidth:Nr,maxHeight:Lr}},components:{},props:{scale:{type:Number,default:1}},emits:["clicked-grid-cell"],computed:{gridContainterStyle(){return{position:"absolute",width:"100%",display:"block"}},firstThirdLine(){const Tr=this.gridCount/3,$r={height:"100%",transform:`translateX(${this.columnWidth*Tr}px)`,width:"0px",borderLeft:`1px solid ${this.appTheme.palette.primary[500]}`,position:"absolute"};return Number.isInteger(Tr)||($r.display="none"),$r},centerVerticalLine(){const Tr=this.gridCount/2,$r={height:"100%",transform:`translateX(${this.columnWidth*Tr*this.scale}px)`,width:"0px",borderLeft:`1px solid ${this.appTheme.palette.danger[500]}`,position:"absolute",zIndex:100};return Number.isInteger(Tr)||($r.display="none"),$r},centerHorizontalLine(){const Tr=this.gridCount*.5625*.5;return{width:"100%",transform:`translateY(${this.columnWidth*Tr*this.scale}px)`,height:"0px",borderTop:`1px solid ${this.appTheme.palette.danger[500]}`,position:"absolute",zIndex:100}},secondThirdLine(){const Tr=2*this.gridCount/3,$r={height:"100%",transform:`translateX(${this.columnWidth*Tr}px)`,width:"0px",border:`1px solid ${this.appTheme.palette.primary[500]}`,position:"absolute"};return Number.isInteger(Tr)||($r.display="none"),$r}},methods:{connect(Tr,Cr,$r,Ar){const{x:Rr,y:Dr}=Tr,{x:Mr,y:Br}=Cr,Nr=Math.sqrt((Mr-Rr)*(Mr-Rr)+(Br-Dr)*(Br-Dr)),Lr=(Rr+Mr)/2-Nr/2,Hr=(Dr+Br)/2-Ar/2,zr=Math.atan2(Dr-Br,Rr-Mr)*(180/Math.PI);return{width:`${Nr}px`,height:`${Ar}px`,transform:`rotate(${zr}deg)`,lineHeight:"1px",left:`${Lr}px`,top:`${Hr}px`,backgroundColor:$r,position:"absolute",padding:"0px",margin:"0px",zIndex:100}},scaleLine(Tr){return{...Tr,from:{x:Tr.from.x*this.scale,y:Tr.from.y*this.scale},to:{x:Tr.to.x*this.scale,y:Tr.to.y*this.scale},distance:Math.floor(Tr.distance*this.scale)}},styleForGuardLine(Tr){return Tr=this.scaleLine(Tr),{...this.connect(Tr.from,Tr.to,this.appTheme.palette.danger[500],1)}},styleForDistanceLine(Tr){return Tr=this.scaleLine(Tr),{...this.connect(Tr.from,Tr.to,this.appTheme.palette.primary[500],2)}}}};function _sfc_render$2(Tr,Cr,$r,Ar,Rr,Dr){return openBlock(),createElementBlock("div",{style:normalizeStyle(Dr.gridContainterStyle)},null,4)}const AppGrid=_export_sfc(_sfc_main$l,[["render",_sfc_render$2]]),_hoisted_1$c={class:"bg-white"},_sfc_main$k=defineComponent({__name:"SlideAnimation",props:{scale:{}},setup(Tr){useCssVars(jr=>({"529b03b8":Dr.value,"4f31527a":Mr.value,"4bc7a13c":Br.value,"485deffe":Nr.value,"44f43ec0":Lr.value,"55c11d02":Hr.value,"52576bc4":zr.value,"4eedba86":Ur.value,"4b840948":Vr.value,"76fd2654":unref($r)}));const Cr=Tr,{scale:$r}=toRefs$1(Cr);function Ar(jr,Gr,Xr){const Kr=[];for(let Zr=0;Zr`${Rr[0]}ms`),Mr=computed(()=>`${Rr[1]}ms`),Br=computed(()=>`${Rr[2]}ms`),Nr=computed(()=>`${Rr[3]}ms`),Lr=computed(()=>`${Rr[4]}ms`),Hr=computed(()=>`${Rr[5]}ms`),zr=computed(()=>`${Rr[6]}ms`),Ur=computed(()=>`${Rr[7]}ms`),Vr=computed(()=>`${Rr[8]}ms`);return(jr,Gr)=>(openBlock(),createElementBlock("div",_hoisted_1$c,[createBaseVNode("div",{class:"absolute reveal-emojis emojicon pencil apply-scale",style:normalizeStyle({top:`${155*unref($r)}px`,left:`${44*unref($r)}px`})},"✏️",4),createBaseVNode("div",{class:"absolute reveal-emojis emojicon hourglass apply-scale",style:normalizeStyle({top:`${415*unref($r)}px`,left:`${112*unref($r)}px`})},"⏳",4),createBaseVNode("div",{class:"absolute reveal-emojis emojicon search apply-scale",style:normalizeStyle({top:`${196*unref($r)}px`,left:`${443*unref($r)}px`})},"🔍",4),createBaseVNode("div",{class:"absolute reveal-emojis emojicon bulb apply-scale",style:normalizeStyle({top:`${439*unref($r)}px`,left:`${551*unref($r)}px`})},"💡",4),createBaseVNode("div",{class:"absolute reveal-emojis emojicon books apply-scale",style:normalizeStyle({top:`${48*unref($r)}px`,left:`${842*unref($r)}px`})},"📚",4),createVNode(_sfc_main$1v,{class:"absolute reveal-icons filter-for-icons icon1",style:normalizeStyle({top:`${135*unref($r)}px`,left:`${140*unref($r)}px`}),src:unref(assetUrl)("animation-1.svg")},null,8,["style","src"]),createVNode(_sfc_main$1v,{class:"absolute reveal-icons filter-for-icons icon2",style:normalizeStyle({top:`${323*unref($r)}px`,left:`${323*unref($r)}px`}),src:unref(assetUrl)("animation-2.svg")},null,8,["style","src"]),createVNode(_sfc_main$1v,{class:"absolute reveal-icons filter-for-icons icon3",style:normalizeStyle({top:`${61*unref($r)}px`,left:`${599*unref($r)}px`}),src:unref(assetUrl)("animation-3.svg")},null,8,["style","src"]),createVNode(_sfc_main$1v,{class:"absolute reveal-icons filter-for-icons icon4",style:normalizeStyle({top:`${273*unref($r)}px`,left:`${641*unref($r)}px`}),src:unref(assetUrl)("animation-4.svg")},null,8,["style","src"])]))}}),SlideAnimation_vue_vue_type_style_index_0_scoped_3284e40d_lang="",SlideAnimation=_export_sfc(_sfc_main$k,[["__scopeId","data-v-3284e40d"]]),AppPage_vue_vue_type_style_index_0_scoped_0c121152_lang="",_sfc_main$j={setup(Tr){const Cr=ref([]);onBeforeUpdate(()=>{Cr.value=[]}),provide("itemRefs",Cr);const $r=useAppStore(),Ar=useBlockLayoutsStore(),Rr=usePageStore(),Dr=useArtboardStore(),Mr=useMiscStore(),Br=computed(()=>{var Oi;return(Oi=Rr.pageObject(Tr.pageId))==null?void 0:Oi.parent_id}),Nr=computed(()=>$r.isViewOnly(Br.value)),Lr=inject("showingFullScreen"),Hr=inject("showingFullPage"),zr=inject("downloadFile"),Ur=computed(()=>Mr.getShowPDFModal),{isPreview:Vr,scale:jr,displayMode:Gr,density:Xr,columnWidth:Kr,defaultHeight:Zr,pageId:eo}=toRefs$1(Tr),{isPdf:Wr,isScreenshot:Yr}=useRouteInfo(),Jr=computed(()=>Ar.inTemplateMode),no=computed(()=>Jr.value||Vr.value||Lr.value||zr.value||Hr.value||Nr.value||Wr.value||Yr.value||Ur.value);provide("isReadOnly",no),provide("isPreview",Vr);const ro=useItemStore(),so=computed(()=>ro.data[eo.value]??{}),ao=useWindowSize(),lo=computed(()=>Math.min(ao.height.value,ao.width.value*9/16)),po=computed(()=>{var Oi;return((Oi=basicFlexLogic.getPositionObjectForItem({id:"g-h-0",ITEM_MAP:so.value,redoRootGroupCalc:!0}))==null?void 0:Oi.height)||540}),go=computed(()=>Lr.value&&po.value*jr.value+20>lo.value),co=useEditorStore(),mo=computed(()=>{var Oi;return(Oi=Rr.pageObject(Tr.pageId))==null?void 0:Oi.label}),{contextMenuX:io,contextMenuY:uo,isContextMenuOpen:ho,calcMenuPos:yo,closeContextMenu:So,openContextMenu:ko}=useContextMenu("AppPage"),$o=inject("selectedBlockId"),Go=(Oi,Zi)=>{Oi.preventDefault(),!hasClassOrAncestorHasClass(Oi.target,"left-pane-slide-wrapper")&&(hasClassOrAncestorHasClass(Oi.target,"deck-preview")||(Oi.stopPropagation(),!no.value&&(Mr.getTableEditingState(Zi)||(yo(Oi),ko(),$o.value=Zi))))},No=inject("selectedPageId"),Eo=ref("ios"),Mo=ref(!1),Ro=computed(()=>Zr.value),Ao=computed(()=>Ro.value),zo=ref(null),Oo=ref(null),{x:Bo,y:bo}=usePointerWithinElement(Oo);useElementBounding(Oo);const vo=ref(null),Io=useElementBounding(vo),To=computed(()=>(Gr.value==="mobile",Math.ceil(1*Ao.value/Kr.value))),Co=useBlockStore(),Po=computed(()=>Rr.children(Tr.pageId)),Fo=computed(()=>{const Oi=[];return Po.value.forEach((Zi,ji)=>{const sa=Po.value[Po.value.length-1-ji];(!Tr.imagesOnly||Co.type(sa)==="image")&&Oi.push(sa)}),Oi});provide("allBlocks",Fo);const Vo=ref(10),Ko=ref(10),Uo=ref({x:0,y:0}),ei=computed(()=>Math.abs(960-2*Uo.value.x-Uo.value.width)<=Vo.value),qo=computed(()=>Math.abs(540-2*Uo.value.y-Uo.value.height)<=Ko.value);provide("showCenterVertical",ei),provide("showCenterHorizontal",qo);const ri=computed(()=>Dr.isAnyBlockResizing),ki=computed(()=>Dr.isDraggingResizing),ti=computed(()=>Co.currentDragBlockId),ai=computed(()=>ti.value===null?null:Fo.value.indexOf(ti.value)),Xo=computed(()=>Co.currentResizeBlockId),si=computed(()=>Xo.value===null?null:Fo.value.indexOf(Xo.value));computed(()=>{var Oi,Zi;return ti.value==null&&Xo.value==null?null:ti.value!=null?(Oi=Cr.value[ai.value])==null?void 0:Oi.positionObject:Xo.value!=null?(Zi=Cr.value[si.value])==null?void 0:Zi.positionObject:null});const vi=computed(()=>[]);provide("guardLines",vi);const Ci=ref([]);computed(()=>Ci.value),provide("distanceLines",Ci);const{movingBlockIds:wi,setMovingBlockIds:bi}=inject("movingBlockIds"),{dropzoneBlockIds:li,setDropzoneBlockIds:ci}=inject("dropzoneBlockIds"),Ii=Oi=>isTextEmbed(Co.blockObject(Oi));provide("maxHeight",Ao),provide("displayMode",Gr),provide("numRows",To),provide("currentDraggingElementPosition",Uo);const Ni=inject("editingBlockId"),{highlightedBlockIds:Ei,updateHighlightedBlockIds:$i}=inject("highlightedBlockIds"),Ri=inject("selectionMenuBlockId"),{showNotiForUpload:Fi,errorDuringUpload:bs,handleUploadedFile:qi}=useImageUploadFlow({pageId:eo,displayMode:Gr,density:Xr,selectedBlockId:$o});useDropZone(Oo,(Oi,{dropX:Zi,dropY:ji})=>{if(Oi==null||Oi.length===0)return;if(Oi.reduce((Gs,pl)=>Gs+pl.size,0)>1e7){bs.value="Total file size cannot exceed 10MB",Fi.value=!0;return}Fi.value=!1;for(let Gs=0;Gs{Zi!=null&&(Ki.value[Zi]==null?Ki.value[Zi]=0:Ki.value[Zi]+=1)});const Ss=computed(()=>{var Oi,Zi;return{doodle:(Zi=(Oi=Rr.config(eo.value))==null?void 0:Oi.useDoodle)==null?void 0:Zi.value}}),gs=computed(()=>$r.getThemeObject(Br.value,eo.value)),Fs=computed(()=>{var Oi,Zi;return(Zi=(Oi=$r.config(Br.value))==null?void 0:Oi.deckSpacing)==null?void 0:Zi.value}),Yi=computed(()=>Rr.isDividerSlide(eo.value)),vs=computed(()=>$r.deckTheme(Br.value)),fs=computed(()=>Yi.value&&vs.value!=="yellow"),da=computed(()=>theme.appColors.dropZoneMarker(fs.value)),di=computed(()=>{var Oi,Zi,ji;return(ji=(Zi=(Oi=gs.value)==null?void 0:Oi.block)==null?void 0:Zi.none)==null?void 0:ji.lightUp}),ss=inject("altKeyPressed"),Ls=inject("currentKeyPressed"),ha=ref([{id:"duplicate",icon:"icon-duplicate.svg",name:"Duplicate",shortcut:`${META_KEY_MODIFIER}+D`},{id:"delete",icon:"icon-trash.svg",name:"Delete",shortcut:"del"}]),na=Oi=>{no.value||(Oi==="delete"&&useDeleteBlockWrapper({selectedBlockId:$o,highlightedBlockIds:Ei,updateHighlightedBlockIds:$i}),Oi==="duplicate"&&useDuplicateBlockWrapper({selectedBlockId:$o,highlightedBlockIds:Ei,updateHighlightedBlockIds:$i,editingBlockId:Ni}))},wa=ref(null);provide("hoverId",wa);const ys=Oi=>Co.allBlocks(Oi).length===0,{lastGenerationType:ls}=inject("lastGenerationType"),{isWholeDeckGeneration:Hs}=inject("lastGenerationType"),ra=computed(()=>Mr.isGeneratingNewSlide&&No.value===eo.value),ps=computed(()=>$r.isGenerating(Br.value)||Hs.value),Ms=computed(()=>Mr.getLeftPanePreviewKey(eo.value)),ds=computed(()=>Mr.isAIGeneratingSomething),rs=computed(()=>Mr.isSlideShowInProgress);watch(Ms,Oi=>{if(!Vr.value)return;Rr.children(eo.value).forEach(ji=>{Ki.value[ji]==null?Ki.value[ji]=0:Ki.value[ji]+=1})}),Vr.value||watchEffect(()=>{Mr.getSlideKey(eo.value)!=null&&Rr.children(eo.value).forEach(ji=>{Ui.value[ji]==null?Ui.value[ji]=0:Ui.value[ji]+=1})});const Zs=computed(()=>no.value?!1:!!(eo.value===$r.children(Br.value)[0]&&ys(eo.value)&&Rr.isPageReady(eo.value)===!1&&$r.isGenerating(Br.value)&&ls.value!==null||ys(eo.value)&&$r.isGenerating(Br.value)&&ls.value!==null)),Js=ref((window==null?void 0:window.matchMedia("(orientation: portrait)").matches)??!0);Vr.value||useEventListener(window,"orientationchange",function(Oi){Oi.target.orientation===90||Oi.target.orientation===270?this.portrait=!1:this.portrait=!0});const Ai=useCommandBarStore(),$s=()=>{posthogCapture("clicked-on-ask-ai"),Ai.setCommandBarOpen(!0),Ai.setCommandBarFocused(!0),Ai.triggerOpen({itemId:"slide-add"})},{width:Ps}=useWindowSize(),Os=computed(()=>getCategoryByWidth(Ps.value)),Bs=computed(()=>Os.value==="mobile"),Es=computed(()=>Ar.inTestMode),Xa=computed(()=>Ar.calculatedGrps),cl=()=>{if(Vr.value||no.value||Bs.value)return;log("heights changing, pgee mounted",performance.now()),Dr.setPageMountFlag({pageId:Tr.pageId,value:!0});const Oi=Tr.pageId;setTimeout(()=>{Dr.setPageMountFlag({pageId:Oi,value:!1}),groupResizerLogic.fixSlideIfRequired({slideId:Oi,itemRefs:Cr.value,onLoad:!0})},basicFlexLogic.WAIT_TIME_FOR_BLOCK_RENDER_PAGE_LEVEL),setTimeout(()=>{Dr.setPageMountFlag({pageId:Oi,value:!1}),groupResizerLogic.fixSlideIfRequired({slideId:Oi,itemRefs:Cr.value,onLoad:!0})},basicFlexLogic.WAIT_TIME_FOR_BLOCK_RENDER_PAGE_LEVEL+1e3)},Za=ref({}),Da=()=>{if(Vr.value||No.value!==Tr.pageId&&!Es.value)return;const Oi={},Zi={};Fo.value.forEach(ji=>{if(Co.type(ji)!=="text")return;const sa=Ar.getBlockLayoutHash(ji);Zi[ji]=sa,sa&&(sa in Oi?Oi[sa].push(ji):Oi[sa]=[ji])}),Ar.setCalculatedGrps(Oi),Za.value=Zi};onMounted(()=>{cl(),Fo.value.forEach(Oi=>{Ui.value[Oi]=0,Ki.value[Oi]=0}),bi([]),ci([]),Es.value&&Da()});const Ja=1100,Ma=computed(()=>`${Ja}ms`),Ba=computed(()=>Mr.getSlideMountKey(Tr.pageId));Vr.value||watch(Ba,()=>{setTimeout(()=>{groupResizerLogic.fixSlideIfRequired({slideId:Tr.pageId,itemRefs:Cr.value,onLoad:!0})},Ja)}),Vr.value||(watch(()=>Tr.pageId,Oi=>{Es.value&&Oi&&Da()}),watch(Jr,Oi=>{Oi&&Da()}),watch(Es,()=>{Jr.value&&Da()}));const fa=computed(()=>Fo.value.length>1&&!no.value&&!Vr.value&&!(Hr.value||Lr.value||Bs.value)),Ks=useBlockDragAndDrop({allowDragging:fa,appId:Br,scale:jr,pageId:eo,themeObject:gs,ITEM_MAP:so,movingBlockIds:wi,setMovingBlockIds:bi,dropzoneBlockIds:li,setDropzoneBlockIds:ci,allBlocks:Fo,dragBlockId:ti,itemRefs:Cr,deepInnerParentElBoundingRect:Io}),{scaleForDragEl:oa,isEventOnResizer:ja,startDragPosition:Ia,mousePressed:Qa,tempDragId:ul,checkIfMousePressedAndMovedEnough:$l,handleMouseUpForTempDrag:Al,isDragging:tl}=Ks,Yl=async(Oi,Zi)=>{Vr.value||Hr.value||Lr.value||fa.value&&(ri.value||ja(Oi)||Zi!==Ni.value&&(Mr.getTableEditingState(Zi)||(Ia.value={x:Oi.clientX,y:Oi.clientY},Qa.value=!0,ul.value=Zi,Oi.preventDefault(),document.addEventListener("mousemove",$l),document.addEventListener("mouseup",Al))))},Rl=computed(()=>Mr.getShowingAIOnboarding),dl=computed(()=>Mr.getIsSlideBeingModified(eo.value)),pa=computed(()=>rs.value&&!ds.value),js=useBlockResizer({isReadOnly:no,isPreview:Vr,scale:jr,pageId:eo,ITEM_MAP:so,itemRefs:Cr,allBlocks:Fo,editingBlockId:Ni,isDragging:tl,deepInnerParentEl:vo,deepInnerParentElBoundingRect:Io,isSlideBeingAnimated:pa}),{blocksInNearestResizerIds:Qs,cursorForResizer:Ws,handleMouseOverOnResizer:Pl,handleMouseLeaveOnResizer:nl,nearestResizerIds:hl,positionForActiveResizeMarker:rl,blockResizerId:Ol,hoveringStateForResizers:ol,resizerKey:Fl,onResizerStart:Dl,onResizerMove:Ml,onResizerEnd:Xl,onResizerCleanup:Ds,allResizers:Zl}=js,Bl=Oi=>{const Zi=groupResizer$1.splitResizerId(Oi);if(Zi==null)return di.value;const ji=Zi.groupId,sa=Zi.index;return ji==null||sa==null||Fs.value!==0?di.value:da.value},ia=computed(()=>Fs.value!==0?di.value:da.value),Jl=inject("layout"),Ql=useInternalVariableTuning(),ec=isEnabled("internalVariableTuning"),Hl=computed(()=>ec&&!Vr.value&&Ql.showDimensions),fl=computed(()=>showNewEmptyPageState(useUserStore().currentOrgId)),xs=computed(()=>Fo.value.length===0&&!ps.value&&!ra.value&&!Bs.value&&!(Hr.value||Lr.value||Vr.value||Nr.value||no.value)&&!ds.value),ws=computed(()=>$r.isWebsiteView(Br.value)),tc=computed(()=>isEnabled("websiteView"));return{SLIDE_ANIMATION_DURATION_MS:Ma,isWebsiteView:ws,canShowWebsiteView:tc,showPDFModal:Ur,blockLayoutHashes:Za,groupedBlockLayouts:Xa,showingEmptyPageView:xs,layout:Jl,showPaddingInFullScreen:go,showNewEmptyPageStateEnabled:fl,showDimensions:Hl,IS_DEV,IS_STAGING,isDraggingResizing:ki,keysForLeftPaneBlockIds:Ki,deckSpacing:Fs,getBackgroundForResizer:Bl,themeObject:gs,isDividerSlide:Yi,deckTheme:vs,darkTheme:fs,dropZoneMarkerColor:ia,deepInnerParentEl:vo,blocksInNearestResizerIds:Qs,cursorForResizer:Ws,handleMouseOverOnResizer:Pl,handleMouseLeaveOnResizer:nl,nearestResizerIds:hl,positionForActiveResizeMarker:rl,blockResizerId:Ol,isAnyBlockResizing:ri,hoveringStateForResizers:ol,resizerKey:Fl,onResizerStart:Dl,onResizerMove:Ml,onResizerEnd:Xl,onResizerCleanup:Ds,allResizers:Zl,appStore:$r,appId:Br,isGenerating:ps,isGeneratingNewSlide:ra,selectedPageId:No,hovering:Mo,isSlideEmpty:ys,allowDragging:fa,scaleForDragEl:oa,isDragging:tl,movingBlockIds:wi,ITEM_MAP:so,setMovingBlockIds:bi,dropzoneBlockIds:li,setDropzoneBlockIds:ci,isMobile:Bs,portrait:Js,showingFullScreen:Lr,showingFullPage:Hr,showLoaderForSlide:Zs,hoverId:wa,distanceLines:Ci,handleMoreMenuActionOnBlock:na,moreMenuItemsForBlocks:ha,contextMenuX:io,contextMenuY:uo,currentKeyPressed:Ls,altKeyPressed:ss,classObject:Ss,keysForBlockIds:Ui,itemRefs:Cr,highlightedBlockIds:Ei,updateHighlightedBlockIds:$i,showNotiForUpload:Fi,errorDuringUpload:bs,isReadOnly:no,blockStore:Co,editingBlockId:Ni,hasText:Ii,pageTitle:mo,contentHeight:Ro,x:Bo,y:bo,el:zo,deepInnerEl:Oo,mode:Eo,selectedBlockId:$o,maxHeight:Ao,allBlocks:Fo,pageStore:Rr,isContextMenuOpen:ho,handleContextMenuOpen:Go,closeContextMenu:So,selectionMenuBlockId:Ri,editorStore:co,assetUrl,handleClickOnAskAI:$s,leftPaneKeyForSlide:Ms,miscStore:Mr,handleMouseDownOnGenericBlock:Yl,dragBlockId:ti,isAIGeneratingSomething:ds,isSlideShowInProgress:rs,showingAIOnboarding:Rl,isSlideBeingModified:dl,isViewOnly:Nr}},components:{Icon:_sfc_main$1v,AppGrid,GenericBlock,GenericBlockResizer:_sfc_main$m,Notification,StyledRightClickMenu,Skeleton,SlideAnimation},props:{previewKey:{type:String,default:""},imagesOnly:{type:Boolean,default:!1},displayMode:{type:String,default:"desktop"},density:{type:String,default:"normal"},pageId:{type:String},scale:{type:Number,default:1},columnWidth:{type:Number,default:1},defaultHeight:{type:Number,default:540},appCustomStyle:{type:Object},isPreview:{type:Boolean,default:!1},cursor:{type:String},showVariableLength:{type:Boolean,default:!1}},computed:{showingWebsite(){return this.isWebsiteView&&this.showingFullPage&&this.canShowWebsiteView},appBackground(){var Tr,Cr;return((Cr=(Tr=this.themeObject)==null?void 0:Tr.artboard)==null?void 0:Cr.background)??"#fff"},hoverBackgroundOverrideToUse(){return this.darkTheme?"rgba(255, 255, 255, 0.08)":"rgba(0, 0, 0, 0.04)"},activeBackgroundOverrideToUse(){return this.darkTheme?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.08)"},deepInnerContainerStyle(){const Tr={position:"relative",display:"flex",flexDirection:"column",width:"100%",height:"100%",minHeight:`${this.contentHeight}px`,background:this.appBackground,overflow:"visible",cursor:this.cursor??"default",transition:"background 0ms ease",borderRadius:this.showingFullPage?"16px":"0px"};return this.isPreview&&(Tr.borderRadius="32px"),this.hovering&&this.isSlideEmpty(this.pageId)&&!this.isPreview&&!this.isReadOnly&&!this.showingFullPage&&!this.showingFullScreen&&!this.showNewEmptyPageStateEnabled&&(Tr.background=this.hoverBackgroundOverrideToUse,Tr.borderRadius="16px"),Tr},pageStyle(){let Tr=this.pageHeight*this.scale,Cr="100%";return this.isPreview&&this.showVariableLength?(Tr=Math.min(this.contentHeight*3,this.pageHeight),Cr="960px"):this.isPreview&&!this.showVariableLength&&(Tr=this.contentHeight,Cr="960px"),{height:`${Tr}px`,width:Cr}},showDropZoneMarker(){return this.dropzoneBlockIds.length>0},isDropzoneOnGroup(){if(this.dropzoneBlockIds.length===0)return!1;const Tr=this.dropzoneBlockIds[0].split(":")[0];if(Tr==null)return!1;const Cr=this.ITEM_MAP[Tr];return Cr==null?!1:Cr.type==="group"},dropzoneLengthFraction(){return this.isDropzoneOnGroup,1},effectivePaddingY(){return this.isMobile?0:this.layout.state.artboardInfCanvasPaddingY},pageHeight(){const Tr=basicFlexLogic.getPositionObjectForItem({id:"g-h-0",ITEM_MAP:this.ITEM_MAP,redoRootGroupCalc:!0});return Math.max(basicFlexLogic.roundValue((Tr==null?void 0:Tr.height)||540),540)},dropzoneStyleForTop(){return{position:"absolute",top:`${(this.dropPosition.y-(6+DROP_ZONE_MARKER_THICKNESS/2))*this.scale}px`,left:`${this.dropPosition.x*this.scale+.5*this.dropPosition.width*this.scale}px`,width:`${Math.max(this.dropPosition.width*this.scale*this.dropzoneLengthFraction,48*this.scale)}px`,transform:"translateX(-50%)",height:`${DROP_ZONE_MARKER_THICKNESS*this.scale}px`,background:this.dropZoneMarkerColor,borderRadius:"16px",zIndex:100}},dropzoneStyleForBottom(){return{position:"absolute",top:`${(this.dropPosition.y+this.dropPosition.height+(6-DROP_ZONE_MARKER_THICKNESS/2))*this.scale}px`,left:`${this.dropPosition.x*this.scale+.5*this.dropPosition.width*this.scale}px`,width:`${Math.max(this.dropPosition.width*this.scale*this.dropzoneLengthFraction,48*this.scale)}px`,transform:"translateX(-50%)",height:`${DROP_ZONE_MARKER_THICKNESS*this.scale}px`,background:this.dropZoneMarkerColor,borderRadius:"16px",zIndex:100}},dropzoneStyleForRight(){return{position:"absolute",top:`${this.dropPosition.y*this.scale+.5*this.dropPosition.height*this.scale}px`,left:`${(this.dropPosition.x+this.dropPosition.width+(6-DROP_ZONE_MARKER_THICKNESS/2))*this.scale}px`,height:`${Math.max(this.dropPosition.height*this.scale*this.dropzoneLengthFraction,48*this.scale)}px`,transform:"translateY(-50%)",width:`${DROP_ZONE_MARKER_THICKNESS*this.scale}px`,background:this.dropZoneMarkerColor,borderRadius:"16px",zIndex:100}},dropzoneStyleForLeft(){return{position:"absolute",top:`${this.dropPosition.y*this.scale+.5*this.dropPosition.height*this.scale}px`,left:`${(this.dropPosition.x-(6+DROP_ZONE_MARKER_THICKNESS/2))*this.scale}px`,height:`${Math.max(this.dropPosition.height*this.scale*this.dropzoneLengthFraction,48*this.scale)}px`,transform:"translateY(-50%)",width:`${DROP_ZONE_MARKER_THICKNESS*this.scale}px`,background:this.dropZoneMarkerColor,borderRadius:"16px",zIndex:100}},dropPosition(){if(this.dropzoneBlockIds.length===0)return{x:0,y:0,width:0,height:0};if(this.dropzoneBlockIds[0]==null)return{x:0,y:0,width:0,height:0};const Tr=this.dropzoneBlockIds[0].split(":")[0];if(Tr==null)return{x:0,y:0,width:0,height:0};const Cr=groupFlexLogic.isRootGroup({groupId:Tr,ITEM_MAP:this.ITEM_MAP}),$r=basicFlexLogic.getPositionObjectForItem({id:Tr,ITEM_MAP:this.ITEM_MAP,redoRootGroupCalc:!0});return Cr?{x:$r.x+this.deckSpacing,y:$r.y+this.deckSpacing,width:$r.width-2*this.deckSpacing,height:$r.height-2*this.deckSpacing}:$r}},methods:{handleClickOnGhost(Tr){this.selectedBlockId=null},mouseOverGenericBlock(Tr){var Cr;this.isPreview||Tr.stopPropagation(),(Cr=this.currentKeyPressed)==null||Cr.has("alt"),this.hoverId=null},handleMouseUpOnGenericBlock(Tr,Cr){},handleClick(Tr,Cr){var $r,Ar;this.isReadOnly||((Ar=($r=document.activeElement)==null?void 0:$r.id)!=null&&Ar.startsWith("headless")&&document.activeElement.blur(),this.selectedBlockId!==Cr&&this.editingBlockId&&(this.editingBlockId=null),this.selectedBlockId=Cr)},getElementFromBlockId(Tr){return document.getElementById(Tr)},getAllElements(){return this.allBlocks.map(Cr=>this.getElementFromBlockId(Cr))},handleMouseDownOnEditor(Tr){(Tr.target.id==="gridForEditor"||Tr.target.id==="deepInnerEditor")&&this.updateHighlightedBlockIds([])},handleMouseOverOnEditor(Tr){this.hovering=!0,this.selectedBlockId!=null&&(this.hoverId="page")},handleMouseLeaveOnEditor(Tr){this.hovering=!1,this.hoverId=null},isSharingBorder(Tr,Cr){return this.movingBlockIds[0]==null||Cr==null?!0:basicFlexLogic.isBlockAlreadyInCorrectPlace({blockId:this.movingBlockIds[0],direction:Tr,dropId:Cr.split(":")[0]})},handleToggleSettingsMenu(Tr){this.selectedBlockId===Tr&&(this.selectionMenuBlockId==null?this.selectionMenuBlockId=Tr:this.selectionMenuBlockId=null)}}},__injectCSSVars__=()=>{useCssVars(Tr=>({"45d96f01":Tr.SLIDE_ANIMATION_DURATION_MS}))},__setup__=_sfc_main$j.setup;_sfc_main$j.setup=__setup__?(Tr,Cr)=>(__injectCSSVars__(),__setup__(Tr,Cr)):__injectCSSVars__;const _hoisted_1$b=["id"],_hoisted_2$9={key:5,style:{position:"fixed",top:"60px",right:"20px",color:"black"}};function _sfc_render$1(Tr,Cr,$r,Ar,Rr,Dr){const Mr=resolveComponent("AppGrid"),Br=resolveComponent("Notification"),Nr=resolveComponent("GenericBlock"),Lr=resolveComponent("GenericBlockResizer"),Hr=resolveComponent("StyledRightClickMenu"),zr=resolveComponent("SlideAnimation");return openBlock(),createElementBlock("div",{style:normalizeStyle(Ar.showingFullScreen||Ar.showingFullPage&&!Ar.isMobile?{width:Ar.showingFullScreen&&Ar.portrait?"calc(min(95vw, (16/9 * 95vh)))":"100%",margin:Ar.showingFullScreen?"0px":"auto",borderRadius:"16px",overflow:"visible",...Dr.pageStyle}:{...Dr.pageStyle}),class:normalizeClass(["relative deepInnerEditorParent",{"slide-animation":!$r.isPreview&&Ar.isSlideShowInProgress&&!Ar.isAIGeneratingSomething,"is-preview":$r.isPreview,"is-not-preview":!$r.isPreview}]),ref:"deepInnerParentEl"},[createBaseVNode("div",{style:normalizeStyle(Dr.deepInnerContainerStyle),ref:"deepInnerEl",id:`deepInnerEditor${$r.isPreview?"-preview":""}`,onMousedown:Cr[6]||(Cr[6]=Ur=>Dr.handleMouseDownOnEditor(Ur)),onMouseover:Cr[7]||(Cr[7]=Ur=>Dr.handleMouseOverOnEditor(Ur)),onMouseleave:Cr[8]||(Cr[8]=Ur=>Dr.handleMouseLeaveOnEditor(Ur))},[Ar.showNewEmptyPageStateEnabled?createCommentVNode("",!0):(openBlock(),createElementBlock("div",{key:0,style:{position:"absolute",top:0,bottom:0,width:"100%"},onClick:Cr[0]||(Cr[0]=Ur=>Dr.handleClickOnGhost(Ur))})),!Ar.isReadOnly&&!Ar.showNewEmptyPageStateEnabled?(openBlock(),createBlock(Mr,{key:1,id:"gridForEditor",style:{height:"100%"},scale:$r.scale,onClick:Cr[1]||(Cr[1]=Ur=>Dr.handleClickOnGhost(Ur))},null,8,["scale"])):createCommentVNode("",!0),Ar.showNotiForUpload?(openBlock(),createBlock(Br,{key:2,notification:{text:Ar.errorDuringUpload,type:Ar.errorDuringUpload.length>0?"error":"neutral"},onHide:Cr[2]||(Cr[2]=Ur=>Ar.showNotiForUpload=!1)},null,8,["notification"])):createCommentVNode("",!0),(openBlock(!0),createElementBlock(Fragment$1,null,renderList(Ar.allBlocks,Ur=>(openBlock(),createBlock(Nr,{layoutGrp:{id:Ar.blockLayoutHashes[Ur],bIds:Ar.groupedBlockLayouts[Ar.blockLayoutHashes[Ur]]},blockId:Ur,category:$r.displayMode,density:$r.density,key:`${Ur}${$r.isPreview?Ar.leftPaneKeyForSlide+Ar.keysForLeftPaneBlockIds[Ur]:Ar.keysForBlockIds[Ur]??0}`,id:`${Ur}${$r.isPreview?"-preview":""}`,contentHeight:Ar.contentHeight,columnWidth:$r.columnWidth,scale:$r.scale,isPartOfSnappingGroup:Ar.blocksInNearestResizerIds.includes(Ur),ref_for:!0,ref:"itemRefs",draggable:!1,onClick:Vr=>Dr.handleClick(Vr,Ur),onMouseup:Vr=>Dr.handleMouseUpOnGenericBlock(Vr,Ur),onMousedown:Vr=>Ar.handleMouseDownOnGenericBlock(Vr,Ur),onMouseover:Dr.mouseOverGenericBlock,onContextmenu:Vr=>Ar.handleContextMenuOpen(Vr,Ur),class:normalizeClass(Ar.classObject),classObject:Ar.classObject,onToggleSettingsMenu:Vr=>Dr.handleToggleSettingsMenu(Ur),isBeingModified:Ar.isSlideBeingModified||Ar.isGeneratingNewSlide},null,8,["layoutGrp","blockId","category","density","id","contentHeight","columnWidth","scale","isPartOfSnappingGroup","onClick","onMouseup","onMousedown","onMouseover","onContextmenu","class","classObject","onToggleSettingsMenu","isBeingModified"]))),128)),!$r.isPreview&&Dr.pageHeight>540&&!Ar.showingFullScreen&&!Dr.showingWebsite?(openBlock(),createElementBlock("div",{key:3,class:"absolute",style:normalizeStyle({top:`${Dr.pageHeight*$r.scale}px`,left:"0px",height:`${Dr.effectivePaddingY}px`,width:`${960*$r.scale}px`}),onClick:Cr[3]||(Cr[3]=Ur=>Dr.handleClickOnGhost(Ur))},null,4)):createCommentVNode("",!0),!$r.isPreview&&Ar.showingFullScreen&&Ar.showPaddingInFullScreen&&!Dr.showingWebsite?(openBlock(),createElementBlock("div",{key:4,class:"absolute",style:normalizeStyle({top:`${Dr.pageHeight*$r.scale}px`,left:"0px",height:"60px",width:`${960*$r.scale}px`}),onClick:Cr[4]||(Cr[4]=Ur=>Dr.handleClickOnGhost(Ur))},null,4)):createCommentVNode("",!0),Ar.showDimensions?(openBlock(),createElementBlock("div",_hoisted_2$9,[createBaseVNode("p",null,toDisplayString(Ar.selectedBlockId),1),createBaseVNode("p",null,toDisplayString(`slide h: ${Dr.pageHeight}`),1)])):createCommentVNode("",!0),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[!$r.isPreview&&Dr.showDropZoneMarker&&Ar.dropzoneBlockIds[0].includes(":top")&&!Dr.isSharingBorder("top",Ar.dropzoneBlockIds[0])?(openBlock(),createElementBlock("div",{key:0,style:normalizeStyle(Dr.dropzoneStyleForTop)},null,4)):createCommentVNode("",!0)]),_:1}),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[!$r.isPreview&&Dr.showDropZoneMarker&&Ar.dropzoneBlockIds[0].includes(":right")&&!Dr.isSharingBorder("right",Ar.dropzoneBlockIds[0])?(openBlock(),createElementBlock("div",{key:0,style:normalizeStyle(Dr.dropzoneStyleForRight)},null,4)):createCommentVNode("",!0)]),_:1}),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[!$r.isPreview&&Dr.showDropZoneMarker&&Ar.dropzoneBlockIds[0].includes(":bottom")&&!Dr.isSharingBorder("bottom",Ar.dropzoneBlockIds[0])?(openBlock(),createElementBlock("div",{key:0,style:normalizeStyle(Dr.dropzoneStyleForBottom)},null,4)):createCommentVNode("",!0)]),_:1}),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[!$r.isPreview&&Dr.showDropZoneMarker&&Ar.dropzoneBlockIds[0].includes(":left")&&!Dr.isSharingBorder("left",Ar.dropzoneBlockIds[0])?(openBlock(),createElementBlock("div",{key:0,style:normalizeStyle(Dr.dropzoneStyleForLeft)},null,4)):createCommentVNode("",!0)]),_:1}),!Ar.isAIGeneratingSomething&&!Ar.isSlideShowInProgress&&!Ar.isReadOnly&&!Ar.showPDFModal?(openBlock(!0),createElementBlock(Fragment$1,{key:6},renderList(Ar.allResizers,(Ur,Vr)=>(openBlock(),createBlock(Lr,{key:`${Ur.id}-${Ar.resizerKey}`,initialValue:{x:Ur.position.x,y:Ur.position.y},width:`${Ur.position.width}px`,height:`${Ur.position.height}px`,direction:Ur.position.direction,isDark:Ar.darkTheme,scale:$r.scale,positionForMarker:Ar.blockResizerId===Ur.id?Ar.positionForActiveResizeMarker:null,backgroundColor:Ar.getBackgroundForResizer(Ur.id),cursor:Ar.cursorForResizer,onStart:(jr,Gr)=>Ar.onResizerStart(jr,Gr,Ur.id,Vr),onMove:(jr,Gr)=>Ar.onResizerMove(jr,Gr,Ur.id,Vr),onEnd:(jr,Gr)=>Ar.onResizerEnd(jr,Gr,Ur.id,Vr),cleanup:()=>Ar.onResizerCleanup(Ur.id,Vr),onMouseover:jr=>Ar.handleMouseOverOnResizer(Ur.id,Vr),onMouseleave:jr=>Ar.handleMouseLeaveOnResizer(Ur.id,Vr),opacity:Ar.hoveringStateForResizers[Vr]||Ar.blockResizerId===Ur.id||Ar.nearestResizerIds.includes(Ur.id)?1:0},null,8,["initialValue","width","height","direction","isDark","scale","positionForMarker","backgroundColor","cursor","onStart","onMove","onEnd","cleanup","onMouseover","onMouseleave","opacity"]))),128)):createCommentVNode("",!0),!$r.isPreview&&!Ar.isViewOnly?(openBlock(),createBlock(Hr,{key:7,visible:Ar.isContextMenuOpen&&Ar.selectedPageId===$r.pageId&&$r.isPreview===!1&&!Ar.isViewOnly&&!Ar.isDraggingResizing,items:Ar.moreMenuItemsForBlocks,positionX:Ar.contextMenuX,positionY:Ar.contextMenuY,onClose:Ar.closeContextMenu,onSelectedItemId:Cr[5]||(Cr[5]=Ur=>Ar.handleMoreMenuActionOnBlock(Ur))},null,8,["visible","items","positionX","positionY","onClose"])):createCommentVNode("",!0)],44,_hoisted_1$b),!$r.isPreview&&Ar.isAIGeneratingSomething&&!Ar.showingAIOnboarding?(openBlock(),createBlock(zr,{key:0,style:normalizeStyle({width:`${960*$r.scale}px`,height:`${540*$r.scale}px`}),class:"absolute top-0 left-0 z-[100]",scale:$r.scale},null,8,["style","scale"])):createCommentVNode("",!0)],6)}const AppPage=_export_sfc(_sfc_main$j,[["render",_sfc_render$1],["__scopeId","data-v-0c121152"]]),_sfc_main$i={},_hoisted_1$a={class:"w-fit font-semibold text-center px-1 text-[#AB67FF] text-[12px] bg-[#F3E8FD] rounded flex items-center"},_hoisted_2$8=createBaseVNode("div",null,"UPCOMING",-1);function _sfc_render(Tr,Cr){return openBlock(),createElementBlock("div",_hoisted_1$a,[renderSlot(Tr.$slots,"default",{},()=>[_hoisted_2$8])])}const AccentTag=_export_sfc(_sfc_main$i,[["render",_sfc_render]]),_withScopeId$1=Tr=>(pushScopeId("data-v-79b911b7"),Tr=Tr(),popScopeId(),Tr),_hoisted_1$9={class:"flex flex-col items-center gap-4 w-full px-4 pt-0 sm:pt-4 pb-4"},_hoisted_2$7={key:0,class:"flex items-center justify-between w-full"},_hoisted_3$7=_withScopeId$1(()=>createBaseVNode("p",{class:"text-[16px] font-[500] leading-[1.32]"},"Export PDF",-1)),_hoisted_4$6=["src"],_hoisted_5$5={key:0,class:"flex gap-2 items-center"},_hoisted_6$4={key:1},_hoisted_7$4={key:1},_hoisted_8$4={key:2,class:"absolute left-1/2 -translate-x-1/2"},_hoisted_9$4={class:"absolute right-0"},_hoisted_10$4={key:0},_hoisted_11$2={key:1},_hoisted_12$2={class:"flex flex-col items-start justify-start w-full gap-2"},_hoisted_13$2=_withScopeId$1(()=>createBaseVNode("p",{class:"text-[14px] font-[500] text-[#00000085]"},"Footer settings",-1)),_hoisted_14$2={class:"flex flex-wrap gap-2 items-center justify-center w-full"},_hoisted_15$2=["onClick"],_hoisted_16$1={class:"text-[12px] font-[500] cursor-pointer"},_hoisted_17$1={class:"flex flex-col items-start justify-start w-full gap-2"},_hoisted_18$1=_withScopeId$1(()=>createBaseVNode("p",{class:"text-[14px] font-[500] text-[#00000085]"},"Custom caption",-1)),_hoisted_19$1={key:1,class:"flex items-center justify-center gap-2"},_sfc_main$h=defineComponent({__name:"PDFPicker",props:{deckId:{},showHeader:{type:Boolean},showDialog:{type:Boolean}},emits:["close"],setup(Tr,{emit:Cr}){const $r=Tr,Ar=Cr,Rr=useMiscStore(),Dr=useUserStore(),Mr=useAppStore(),Br=usePageStore();useItemStore();const Nr=inject("isMobile"),Lr=inject("selectedPageId");ref("");const Hr=ref(!1),zr=ref(!1);computed(()=>theme.appTheme());const Ur=computed(()=>Dr.isPDFDownloadAllowed(Dr.currentOrgId)),Vr=computed(()=>Mr.deckThemeValue($r.deckId)),jr=computed(()=>Ur.value?Vr.value:"#AB67FF"),Gr=computed(()=>Mr.children($r.deckId).indexOf(Lr.value||"")),Xr=computed(()=>Mr.deckTheme($r.deckId)),Kr=ref(Dr.pdfSettings),Zr=computed(()=>Kr.value.showAccLogo),eo=computed(()=>Kr.value.showAccName),Wr=computed(()=>Kr.value.showCaption),Yr=computed(()=>Kr.value.showPageNum),Jr=computed(()=>Zr.value||eo.value||Wr.value||Yr.value),no=useWindowSize();computed(()=>608/(960*PDF_DIMS.scale+PDF_DIMS.leftPadding+PDF_DIMS.rightPadding));const ro=computed(()=>Nr.value?(no.width.value-32-34)/608:1),so=computed(()=>Nr.value?no.width.value-32-72:486),ao=zo=>{var Bo;if(!zo)return"#fff";const Oo=Mr.getThemeObject($r.deckId,zo);return((Bo=Oo==null?void 0:Oo.artboard)==null?void 0:Bo.background)||"#fff"},lo=zo=>{if(!Br.isDividerSlide(zo))return"#9E9E9E";switch(Xr.value){case"yellow":return"rgba(13, 12, 12, 0.42)";case"orange":case"red":case"green":case"blue":case"pink":return"rgba(255, 255, 255, 0.54)";case"purple":return"rgba(255, 255, 255, 0.38)";case"navy":return"rgba(255, 255, 255, 0.32)";case"brown":case"black":return"rgba(255, 255, 255, 0.24)";default:return"#9E9E9E"}},po=zo=>zo?Br.children(zo).length===0:!0,go=computed(()=>Dr.getOrgAvatarUrl(Dr.currentOrgId)),co=computed(()=>[{name:"Workspace logo",setting:"accLogo",icon:"icon-export.svg",value:Zr.value},{name:"Account name",setting:"accName",icon:"icon-person-2.svg",value:eo.value},{name:"Caption",setting:"caption",icon:"icon-caption-2.svg",value:Wr.value},{name:"Page number",setting:"pageNum",icon:"icon-page-num.svg",value:Yr.value}]),mo=computed(()=>Kr.value.caption),io=computed(()=>typeof mo.value=="string"&&mo.value.length>100),uo=computed(()=>{const zo={height:"38px",borderRadius:"12px",border:"1px solid #F3F3F3",background:"#F3F3F3",color:"#0D0C0C"};return io.value?zo.border="1px solid #DB3033":zr.value&&(zo.border=`1px solid ${jr.value}`),(io.value||zr.value)&&(zo.background="white"),zo}),ho=computed(()=>{var Oo,Bo,bo;const zo=(bo=(Bo=(Oo=Mr.appObject($r.deckId))==null?void 0:Oo.config)==null?void 0:Bo.customLogoName)==null?void 0:bo.value;return(zo==null?void 0:zo.trim().length)>0?zo:"Prezo"});computed(()=>{var zo;return((zo=Mr.appObject($r.deckId))==null?void 0:zo.title)||"Prezo"});const yo=computed(()=>{const zo=Zr.value||eo.value;return!zo&&!Yr.value?"center":zo?zo&&!Yr.value?"right":"center":"left"}),So=()=>{Ar("close")},ko=zo=>{zo==="accLogo"?Kr.value.showAccLogo=!Zr.value:zo==="accName"?Kr.value.showAccName=!eo.value:zo==="caption"?Kr.value.showCaption=!Wr.value:zo==="pageNum"&&(Kr.value.showPageNum=!Yr.value)},$o=zo=>{Kr.value.caption=zo},Go=ref(null),{focused:No}=useFocus(Go,{initialValue:!1});watch(()=>$r.showDialog,zo=>{zo&&nextTick(()=>{No.value=!0})});const Eo=()=>{Rr.setShowSettingsModal({show:!0,source:"pdfGate"})},{initDownload:Mo,generatingPdf:Ro}=usePDF(),Ao=()=>{if(!Ur.value){Eo();return}Ro.value||(Hr.value=!0,Mo({deckId:$r.deckId,pdfSettings:Kr.value,showNotification:!0,from:"sharing"}),Ar("close"))};return watch(Ro,zo=>{zo||(Hr.value=!1,Ar("close"))}),(zo,Oo)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["bg-white rounded-2xl flex flex-col items-center",{"w-[640px]":!unref(Nr),"w-full":unref(Nr),"shadow-[0_16px_32px_rgba(0,0,0,0.04)] transition-all duration-1000":!unref(Nr)}])},[unref(Nr)?(openBlock(),createBlock(_sfc_main$1p,{key:0,title:"Export PDF",onTappedClose:Oo[0]||(Oo[0]=Bo=>zo.$emit("close")),class:"mb-0"})):createCommentVNode("",!0),createBaseVNode("div",_hoisted_1$9,[zo.showHeader?(openBlock(),createElementBlock("div",_hoisted_2$7,[_hoisted_3$7,createVNode(Button,{leftIcon:{icon:unref(assetUrl)("icon-close.svg"),isSecondary:!0,vProps:{width:"16px",height:"16px"}},style:{height:"32px",width:"32px"},onClick:So},null,8,["leftIcon"]),createBaseVNode("button",{ref_key:"tabBtn",ref:Go,class:"absolute"},null,512)])):createCommentVNode("",!0),createBaseVNode("div",{class:"flex flex-col items-center justify-center rounded-[12px] border border-[#E7E7E7] gap-2 w-full",style:normalizeStyle({background:ao(unref(Lr))})},[createBaseVNode("div",{class:"h-[108px]",style:normalizeStyle({width:`${so.value}px`,background:ao(unref(Lr)),overflow:"hidden",pointerEvents:"none"})},[unref(Nr)?(openBlock(),createElementBlock("img",{key:0,src:"https://auth.prezo.ai/storage/v1/object/public/public/product/pdf-example.jpeg",class:"object-cover w-full h-full object-left-bottom"},null,8,_hoisted_4$6)):po(unref(Lr))?createCommentVNode("",!0):(openBlock(),createBlock(AppPage,{key:1,isPreview:!1,columnWidth:1,defaultHeight:540*(so.value/960),scale:so.value/960,pageId:unref(Lr),density:"normal",displayMode:"desktop",style:normalizeStyle({width:`${so.value}px`,transformOrigin:"top left",transform:"translate(0px, calc(-100% + 108px))"})},null,8,["defaultHeight","scale","pageId","style"]))],4),createBaseVNode("div",{class:"flex items-center relative",style:normalizeStyle({height:`${unref(PDF_DIMS).footerHeight}px`,maxHeight:`${unref(PDF_DIMS).footerHeight}px`,marginLeft:"17px",marginRight:"17px",color:lo(unref(Lr)),width:`${608-34}px`,transform:unref(Nr)?`scale(${ro.value}) translateY(30%) scaleX(1.1)`:`scale(${ro.value})`,fontSize:"10px"})},[Jr.value?(openBlock(),createElementBlock(Fragment$1,{key:0},[Zr.value||eo.value?(openBlock(),createElementBlock("div",_hoisted_5$5,[Zr.value?(openBlock(),createBlock(_sfc_main$1r,{key:0,avatarUrl:go.value,name:ho.value,style:{width:"20px",height:"20px"},isSmallSquare:!0,class:"rounded-[2px]"},null,8,["avatarUrl","name"])):createCommentVNode("",!0),eo.value?(openBlock(),createElementBlock("p",_hoisted_6$4,toDisplayString(ho.value),1)):createCommentVNode("",!0)])):yo.value==="left"&&Wr.value?(openBlock(),createElementBlock("p",_hoisted_7$4,toDisplayString(mo.value),1)):createCommentVNode("",!0),yo.value==="center"&&Wr.value?(openBlock(),createElementBlock("p",_hoisted_8$4,toDisplayString(mo.value),1)):createCommentVNode("",!0),createBaseVNode("div",_hoisted_9$4,[Yr.value?(openBlock(),createElementBlock("p",_hoisted_10$4,toDisplayString(Gr.value+1),1)):yo.value==="right"&&Wr.value?(openBlock(),createElementBlock("p",_hoisted_11$2,toDisplayString(mo.value),1)):createCommentVNode("",!0)])],64)):createCommentVNode("",!0)],4)],4),createBaseVNode("div",_hoisted_12$2,[_hoisted_13$2,createBaseVNode("div",_hoisted_14$2,[(openBlock(!0),createElementBlock(Fragment$1,null,renderList(co.value,Bo=>(openBlock(),createElementBlock("div",{key:Bo.setting,class:normalizeClass(["relative min-w-[150px] sm:min-w-[120px] flex flex-col flex-1 h-[76px] items-center justify-center rounded-[12px] p-3 border border-[#E7E7E7] gap-1 cursor-pointer",{"bg-[#F3F3F3]":Bo.value,"hover:bg-[#0000000a]":!0,"active:bg-[#00000014]":!0}]),onClick:bo=>ko(Bo.setting)},[Bo.setting==="accLogo"?(openBlock(),createBlock(_sfc_main$1r,{key:0,avatarUrl:go.value,name:ho.value,isSmallSquare:!0,class:"w-[24px] h-[24px] rounded-[2px]",style:{width:"24px",height:"24px"}},null,8,["avatarUrl","name"])):(openBlock(),createBlock(_sfc_main$1v,{key:1,src:unref(assetUrl)(Bo.icon),vProps:{width:24,height:24},class:"cursor-pointer"},null,8,["src"])),createBaseVNode("p",_hoisted_16$1,toDisplayString(Bo.name),1),Bo.value?(openBlock(),createBlock(_sfc_main$1v,{key:2,src:unref(assetUrl)("icon-check.svg"),vProps:{width:16,height:16},style:{position:"absolute",top:"12px",right:"12px"}},null,8,["src"])):createCommentVNode("",!0)],10,_hoisted_15$2))),128))])]),createBaseVNode("div",_hoisted_17$1,[_hoisted_18$1,createVNode(Input,{modelValue:mo.value,"onUpdate:modelValue":$o,disabled:!Wr.value,focused:!1,onFocused:Oo[1]||(Oo[1]=Bo=>zr.value=Bo),style:normalizeStyle(uo.value)},null,8,["modelValue","disabled","style"])]),(openBlock(),createBlock(Button,{key:5,style:{height:"42px",minHeight:"42px",cursor:"pointer",borderRadius:"12px",transition:"all 0.1s ease",alignSelf:"flex-end",padding:"10px 16px"},backgroundOverride:jr.value,hoverBackgroundOverride:unref(theme).getSofterColor(jr.value,.04),activeBackgroundOverride:unref(theme).getSofterColor(jr.value,.08),onClick:Ao},createSlots({content:withCtx(({textStyle:Bo})=>[Ur.value?(openBlock(),createElementBlock("label",{key:0,style:normalizeStyle({...Bo,fontSize:"1rem",fontWeight:500,color:"#FFF"})}," Download PDF ",4)):(openBlock(),createElementBlock("div",_hoisted_19$1,[createBaseVNode("label",{style:normalizeStyle({...Bo,fontSize:"1rem",fontWeight:500,color:"#FFF"})},"Upgrade to download",4),createVNode(AccentTag,{class:"text-[#AB67FF] bg-[#F3E8FD]"},{default:withCtx(()=>[createTextVNode(" PRO ")]),_:1})]))]),_:2},[Hr.value?{name:"left",fn:withCtx(()=>[createVNode(LoaderCircle,{color:"white",width:"fit-content",padding:"0 0 0 0"})]),key:"0"}:void 0]),1032,["backgroundOverride","hoverBackgroundOverride","activeBackgroundOverride"]))])],2))}}),PDFPicker_vue_vue_type_style_index_0_scoped_79b911b7_lang="",PDFPicker=_export_sfc(_sfc_main$h,[["__scopeId","data-v-79b911b7"]]),_sfc_main$g=defineComponent({__name:"PDFPickerWrapper",setup(Tr){const Cr=useOverlayStore(),$r=inject("isMobile"),{currentAppId:Ar}=inject("currentAppId"),Rr=computed(()=>Cr.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.PDF_SETTINGS)),Dr=()=>{Cr.hideSlideInComponents(SLIDE_IN_COMPONENTS.PDF_SETTINGS)};return(Mr,Br)=>(openBlock(),createBlock(PrezoSlideIn,{show:Rr.value,onClose:Dr},{content:withCtx(({})=>[createVNode(PDFPicker,{onClose:Dr,deckId:unref(Ar)??"",showHeader:!unref($r)},null,8,["deckId","showHeader"])]),_:1},8,["show"]))}}),cleanPartOfLink=Tr=>Tr.replaceAll(" ","-").replace(/[^-a-zA-Z0-9]/gi,""),encodeQueryParams=Tr=>{const Cr=new URLSearchParams;Object.keys(Tr).forEach(Ar=>{Tr[Ar]&&Cr.append(`${Ar}`,Tr[Ar])});const $r=Cr.toString();return $r&&`?${$r}`},__vite_glob_0_0=""+new URL("globe.e1badec7.json",import.meta.url).href;var lottie$1={exports:{}};(function(module,exports){typeof navigator<"u"&&function(Tr,Cr){module.exports=Cr()}(commonjsGlobal,function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(Cr){_useWebWorker=!!Cr},getWebWorker=function(){return _useWebWorker},setLocationHref=function(Cr){locationHref=Cr},getLocationHref=function(){return locationHref};function createTag(Tr){return document.createElement(Tr)}function extendPrototype(Tr,Cr){var $r,Ar=Tr.length,Rr;for($r=0;$r1?$r[1]=1:$r[1]<=0&&($r[1]=0),HSVtoRGB($r[0],$r[1],$r[2])}function addBrightnessToRGB(Tr,Cr){var $r=RGBtoHSV(Tr[0]*255,Tr[1]*255,Tr[2]*255);return $r[2]+=Cr,$r[2]>1?$r[2]=1:$r[2]<0&&($r[2]=0),HSVtoRGB($r[0],$r[1],$r[2])}function addHueToRGB(Tr,Cr){var $r=RGBtoHSV(Tr[0]*255,Tr[1]*255,Tr[2]*255);return $r[0]+=Cr/360,$r[0]>1?$r[0]-=1:$r[0]<0&&($r[0]+=1),HSVtoRGB($r[0],$r[1],$r[2])}var rgbToHex=function(){var Tr=[],Cr,$r;for(Cr=0;Cr<256;Cr+=1)$r=Cr.toString(16),Tr[Cr]=$r.length===1?"0"+$r:$r;return function(Ar,Rr,Dr){return Ar<0&&(Ar=0),Rr<0&&(Rr=0),Dr<0&&(Dr=0),"#"+Tr[Ar]+Tr[Rr]+Tr[Dr]}}(),setSubframeEnabled=function(Cr){subframeEnabled=!!Cr},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(Cr){expressionsPlugin=Cr},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(Cr){expressionsInterfaces=Cr},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(Cr){defaultCurveSegments=Cr},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(Cr){idPrefix$1=Cr};function createNS(Tr){return document.createElementNS(svgNS,Tr)}function _typeof$5(Tr){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$5=function($r){return typeof $r}:_typeof$5=function($r){return $r&&typeof Symbol=="function"&&$r.constructor===Symbol&&$r!==Symbol.prototype?"symbol":typeof $r},_typeof$5(Tr)}var dataManager=function(){var Tr=1,Cr=[],$r,Ar,Rr={onmessage:function(){},postMessage:function(Vr){$r({data:Vr})}},Dr={postMessage:function(Vr){Rr.onmessage({data:Vr})}};function Mr(Ur){if(window.Worker&&window.Blob&&getWebWorker()){var Vr=new Blob(["var _workerSelf = self; self.onmessage = ",Ur.toString()],{type:"text/javascript"}),jr=URL.createObjectURL(Vr);return new Worker(jr)}return $r=Ur,Rr}function Br(){Ar||(Ar=Mr(function(Vr){function jr(){function Xr(mo,io){var uo,ho,yo=mo.length,So,ko,$o,Go;for(ho=0;ho=0;io-=1)if(mo[io].ty==="sh")if(mo[io].ks.k.i)Yr(mo[io].ks.k);else for(yo=mo[io].ks.k.length,ho=0;houo[0]?!0:uo[0]>mo[0]?!1:mo[1]>uo[1]?!0:uo[1]>mo[1]?!1:mo[2]>uo[2]?!0:uo[2]>mo[2]?!1:null}var no=function(){var mo=[4,4,14];function io(ho){var yo=ho.t.d;ho.t.d={k:[{s:yo,t:0}]}}function uo(ho){var yo,So=ho.length;for(yo=0;yo=0;yo-=1)if(ho[yo].ty==="sh")if(ho[yo].ks.k.i)ho[yo].ks.k.c=ho[yo].closed;else for($o=ho[yo].ks.k.length,ko=0;ko<$o;ko+=1)ho[yo].ks.k[ko].s&&(ho[yo].ks.k[ko].s[0].c=ho[yo].closed),ho[yo].ks.k[ko].e&&(ho[yo].ks.k[ko].e[0].c=ho[yo].closed);else ho[yo].ty==="gr"&&io(ho[yo].it)}function uo(ho){var yo,So,ko=ho.length,$o,Go,No,Eo;for(So=0;So500)&&(this._imageLoaded(),clearInterval(eo)),Zr+=1}).bind(this),50)}function Dr(Kr){var Zr=Ar(Kr,this.assetsPath,this.path),eo=createNS("image");isSafari?this.testImageLoaded(eo):eo.addEventListener("load",this._imageLoaded,!1),eo.addEventListener("error",(function(){Wr.img=Tr,this._imageLoaded()}).bind(this),!1),eo.setAttributeNS("http://www.w3.org/1999/xlink","href",Zr),this._elementHelper.append?this._elementHelper.append(eo):this._elementHelper.appendChild(eo);var Wr={img:eo,assetData:Kr};return Wr}function Mr(Kr){var Zr=Ar(Kr,this.assetsPath,this.path),eo=createTag("img");eo.crossOrigin="anonymous",eo.addEventListener("load",this._imageLoaded,!1),eo.addEventListener("error",(function(){Wr.img=Tr,this._imageLoaded()}).bind(this),!1),eo.src=Zr;var Wr={img:eo,assetData:Kr};return Wr}function Br(Kr){var Zr={assetData:Kr},eo=Ar(Kr,this.assetsPath,this.path);return dataManager.loadData(eo,(function(Wr){Zr.img=Wr,this._footageLoaded()}).bind(this),(function(){Zr.img={},this._footageLoaded()}).bind(this)),Zr}function Nr(Kr,Zr){this.imagesLoadedCb=Zr;var eo,Wr=Kr.length;for(eo=0;eothis.animationData.op&&(this.animationData.op=Tr.op,this.totalFrames=Math.floor(Tr.op-this.animationData.ip));var Cr=this.animationData.layers,$r,Ar=Cr.length,Rr=Tr.layers,Dr,Mr=Rr.length;for(Dr=0;Drthis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(Tr){this.triggerRenderFrameError(Tr)}},AnimationItem.prototype.play=function(Tr){Tr&&this.name!==Tr||this.isPaused===!0&&(this.isPaused=!1,this.trigger("_pause"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(Tr){Tr&&this.name!==Tr||this.isPaused===!1&&(this.isPaused=!0,this.trigger("_play"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(Tr){Tr&&this.name!==Tr||(this.isPaused===!0?this.play():this.pause())},AnimationItem.prototype.stop=function(Tr){Tr&&this.name!==Tr||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(Tr){for(var Cr,$r=0;$r=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(Cr>this.totalFrames?Cr%this.totalFrames:0)||($r=!0,Cr=this.totalFrames-1):Cr>=this.totalFrames?(this.playCount+=1,this.checkSegments(Cr%this.totalFrames)||(this.setCurrentRawFrameValue(Cr%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(Cr):Cr<0?this.checkSegments(Cr%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+Cr%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):($r=!0,Cr=0)):this.setCurrentRawFrameValue(Cr),$r&&(this.setCurrentRawFrameValue(Cr),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(Tr,Cr){this.playCount=0,Tr[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=Tr[0]-Tr[1],this.timeCompleted=this.totalFrames,this.firstFrame=Tr[1],this.setCurrentRawFrameValue(this.totalFrames-.001-Cr)):Tr[1]>Tr[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=Tr[1]-Tr[0],this.timeCompleted=this.totalFrames,this.firstFrame=Tr[0],this.setCurrentRawFrameValue(.001+Cr)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(Tr,Cr){var $r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrameCr&&($r=Cr-Tr)),this.firstFrame=Tr,this.totalFrames=Cr-Tr,this.timeCompleted=this.totalFrames,$r!==-1&&this.goToAndStop($r,!0)},AnimationItem.prototype.playSegments=function(Tr,Cr){if(Cr&&(this.segments.length=0),_typeof$4(Tr[0])==="object"){var $r,Ar=Tr.length;for($r=0;$r=0;uo-=1)Cr[uo].animation.destroy(io)}function ro(io,uo,ho){var yo=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),So,ko=yo.length;for(So=0;So0?Wr=ro:eo=ro;while(Math.abs(no)>Dr&&++so=Rr?Xr(eo,lo,Wr,Yr):po===0?lo:Gr(eo,no,no+Nr,Wr,Yr)}},Tr}(),pooling=function(){function Tr(Cr){return Cr.concat(createSizedArray(Cr.length))}return{double:Tr}}(),poolFactory=function(){return function(Tr,Cr,$r){var Ar=0,Rr=Tr,Dr=createSizedArray(Rr),Mr={newElement:Br,release:Nr};function Br(){var Lr;return Ar?(Ar-=1,Lr=Dr[Ar]):Lr=Cr(),Lr}function Nr(Lr){Ar===Rr&&(Dr=pooling.double(Dr),Rr*=2),$r&&$r(Lr),Dr[Ar]=Lr,Ar+=1}return Mr}}(),bezierLengthPool=function(){function Tr(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}}return poolFactory(8,Tr)}(),segmentsLengthPool=function(){function Tr(){return{lengths:[],totalLength:0}}function Cr($r){var Ar,Rr=$r.lengths.length;for(Ar=0;Ar-.001&&Zr<.001}function $r(Ur,Vr,jr,Gr,Xr,Kr,Zr,eo,Wr){if(jr===0&&Kr===0&&Wr===0)return Cr(Ur,Vr,Gr,Xr,Zr,eo);var Yr=Tr.sqrt(Tr.pow(Gr-Ur,2)+Tr.pow(Xr-Vr,2)+Tr.pow(Kr-jr,2)),Jr=Tr.sqrt(Tr.pow(Zr-Ur,2)+Tr.pow(eo-Vr,2)+Tr.pow(Wr-jr,2)),no=Tr.sqrt(Tr.pow(Zr-Gr,2)+Tr.pow(eo-Xr,2)+Tr.pow(Wr-Kr,2)),ro;return Yr>Jr?Yr>no?ro=Yr-Jr-no:ro=no-Jr-Yr:no>Jr?ro=no-Jr-Yr:ro=Jr-Yr-no,ro>-1e-4&&ro<1e-4}var Ar=function(){return function(Ur,Vr,jr,Gr){var Xr=getDefaultCurveSegments(),Kr,Zr,eo,Wr,Yr,Jr=0,no,ro=[],so=[],ao=bezierLengthPool.newElement();for(eo=jr.length,Kr=0;KrZr?-1:1,Yr=!0;Yr;)if(Gr[Kr]<=Zr&&Gr[Kr+1]>Zr?(eo=(Zr-Gr[Kr])/(Gr[Kr+1]-Gr[Kr]),Yr=!1):Kr+=Wr,Kr<0||Kr>=Xr-1){if(Kr===Xr-1)return jr[Kr];Yr=!1}return jr[Kr]+(jr[Kr+1]-jr[Kr])*eo}function Lr(Ur,Vr,jr,Gr,Xr,Kr){var Zr=Nr(Xr,Kr),eo=1-Zr,Wr=Tr.round((eo*eo*eo*Ur[0]+(Zr*eo*eo+eo*Zr*eo+eo*eo*Zr)*jr[0]+(Zr*Zr*eo+eo*Zr*Zr+Zr*eo*Zr)*Gr[0]+Zr*Zr*Zr*Vr[0])*1e3)/1e3,Yr=Tr.round((eo*eo*eo*Ur[1]+(Zr*eo*eo+eo*Zr*eo+eo*eo*Zr)*jr[1]+(Zr*Zr*eo+eo*Zr*Zr+Zr*eo*Zr)*Gr[1]+Zr*Zr*Zr*Vr[1])*1e3)/1e3;return[Wr,Yr]}var Hr=createTypedArray("float32",8);function zr(Ur,Vr,jr,Gr,Xr,Kr,Zr){Xr<0?Xr=0:Xr>1&&(Xr=1);var eo=Nr(Xr,Zr);Kr=Kr>1?1:Kr;var Wr=Nr(Kr,Zr),Yr,Jr=Ur.length,no=1-eo,ro=1-Wr,so=no*no*no,ao=eo*no*no*3,lo=eo*eo*no*3,po=eo*eo*eo,go=no*no*ro,co=eo*no*ro+no*eo*ro+no*no*Wr,mo=eo*eo*ro+no*eo*Wr+eo*no*Wr,io=eo*eo*Wr,uo=no*ro*ro,ho=eo*ro*ro+no*Wr*ro+no*ro*Wr,yo=eo*Wr*ro+no*Wr*Wr+eo*ro*Wr,So=eo*Wr*Wr,ko=ro*ro*ro,$o=Wr*ro*ro+ro*Wr*ro+ro*ro*Wr,Go=Wr*Wr*ro+ro*Wr*Wr+Wr*ro*Wr,No=Wr*Wr*Wr;for(Yr=0;Yr=Lr.t-$r){Nr.h&&(Nr=Lr),Rr=0;break}if(Lr.t-$r>Tr){Rr=Dr;break}Dr=Kr||Tr=Kr?Wr.points.length-1:0;for(Ur=Wr.points[Yr].point.length,zr=0;zr=ro&&Jr=Kr)Ar[0]=eo[0],Ar[1]=eo[1],Ar[2]=eo[2];else if(Tr<=Zr)Ar[0]=Nr.s[0],Ar[1]=Nr.s[1],Ar[2]=Nr.s[2];else{var co=createQuaternion(Nr.s),mo=createQuaternion(eo),io=(Tr-Zr)/(Kr-Zr);quaternionToEuler(Ar,slerp(co,mo,io))}else for(Dr=0;Dr=Kr?Vr=1:Tr1e-6?(Ur=Math.acos(Vr),jr=Math.sin(Ur),Gr=Math.sin((1-$r)*Ur)/jr,Xr=Math.sin($r*Ur)/jr):(Gr=1-$r,Xr=$r),Ar[0]=Gr*Rr+Xr*Nr,Ar[1]=Gr*Dr+Xr*Lr,Ar[2]=Gr*Mr+Xr*Hr,Ar[3]=Gr*Br+Xr*zr,Ar}function quaternionToEuler(Tr,Cr){var $r=Cr[0],Ar=Cr[1],Rr=Cr[2],Dr=Cr[3],Mr=Math.atan2(2*Ar*Dr-2*$r*Rr,1-2*Ar*Ar-2*Rr*Rr),Br=Math.asin(2*$r*Ar+2*Rr*Dr),Nr=Math.atan2(2*$r*Dr-2*Ar*Rr,1-2*$r*$r-2*Rr*Rr);Tr[0]=Mr/degToRads,Tr[1]=Br/degToRads,Tr[2]=Nr/degToRads}function createQuaternion(Tr){var Cr=Tr[0]*degToRads,$r=Tr[1]*degToRads,Ar=Tr[2]*degToRads,Rr=Math.cos(Cr/2),Dr=Math.cos($r/2),Mr=Math.cos(Ar/2),Br=Math.sin(Cr/2),Nr=Math.sin($r/2),Lr=Math.sin(Ar/2),Hr=Rr*Dr*Mr-Br*Nr*Lr,zr=Br*Nr*Mr+Rr*Dr*Lr,Ur=Br*Dr*Mr+Rr*Nr*Lr,Vr=Rr*Nr*Mr-Br*Dr*Lr;return[zr,Ur,Vr,Hr]}function getValueAtCurrentTime(){var Tr=this.comp.renderedFrame-this.offsetTime,Cr=this.keyframes[0].t-this.offsetTime,$r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(Tr===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=$r&&Tr>=$r||this._caching.lastFrame=Tr&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var Ar=this.interpolateValue(Tr,this._caching);this.pv=Ar}return this._caching.lastFrame=Tr,this.pv}function setVValue(Tr){var Cr;if(this.propType==="unidimensional")Cr=Tr*this.mult,mathAbs(this.v-Cr)>1e-5&&(this.v=Cr,this._mdf=!0);else for(var $r=0,Ar=this.v.length;$r1e-5&&(this.v[$r]=Cr,this._mdf=!0),$r+=1}function processEffectsSequence(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var Tr,Cr=this.effectsSequence.length,$r=this.kf?this.pv:this.data.k;for(Tr=0;Tr=this._maxLength&&this.doubleArrayLength(),$r){case"v":Dr=this.v;break;case"i":Dr=this.i;break;case"o":Dr=this.o;break;default:Dr=[];break}(!Dr[Ar]||Dr[Ar]&&!Rr)&&(Dr[Ar]=pointPool.newElement()),Dr[Ar][0]=Tr,Dr[Ar][1]=Cr},ShapePath.prototype.setTripleAt=function(Tr,Cr,$r,Ar,Rr,Dr,Mr,Br){this.setXYAt(Tr,Cr,"v",Mr,Br),this.setXYAt($r,Ar,"o",Mr,Br),this.setXYAt(Rr,Dr,"i",Mr,Br)},ShapePath.prototype.reverse=function(){var Tr=new ShapePath;Tr.setPathData(this.c,this._length);var Cr=this.v,$r=this.o,Ar=this.i,Rr=0;this.c&&(Tr.setTripleAt(Cr[0][0],Cr[0][1],Ar[0][0],Ar[0][1],$r[0][0],$r[0][1],0,!1),Rr=1);var Dr=this._length-1,Mr=this._length,Br;for(Br=Rr;Br=co[co.length-1].t-this.offsetTime)Yr=co[co.length-1].s?co[co.length-1].s[0]:co[co.length-2].e[0],no=!0;else{for(var mo=Wr,io=co.length-1,uo=!0,ho,yo,So;uo&&(ho=co[mo],yo=co[mo+1],!(yo.t-this.offsetTime>Kr));)mo=yo.t-this.offsetTime)po=1;else if(Kreo&&Kr>eo)||(this._caching.lastIndex=Wr0||uo>-1e-6&&uo<0?Ar(uo*ho)/ho:uo}function io(){var uo=this.props,ho=mo(uo[0]),yo=mo(uo[1]),So=mo(uo[4]),ko=mo(uo[5]),$o=mo(uo[12]),Go=mo(uo[13]);return"matrix("+ho+","+yo+","+So+","+ko+","+$o+","+Go+")"}return function(){this.reset=Rr,this.rotate=Dr,this.rotateX=Mr,this.rotateY=Br,this.rotateZ=Nr,this.skew=Hr,this.skewFromAxis=zr,this.shear=Lr,this.scale=Ur,this.setTransform=Vr,this.translate=jr,this.transform=Gr,this.applyToPoint=Wr,this.applyToX=Yr,this.applyToY=Jr,this.applyToZ=no,this.applyToPointArray=po,this.applyToTriplePoints=lo,this.applyToPointStringified=go,this.toCSS=co,this.to2dCSS=io,this.clone=Zr,this.cloneFromProps=eo,this.equals=Kr,this.inversePoints=ao,this.inversePoint=so,this.getInverseMatrix=ro,this._t=this.transform,this.isIdentity=Xr,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(Tr){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function($r){return typeof $r}:_typeof$3=function($r){return $r&&typeof Symbol=="function"&&$r.constructor===Symbol&&$r!==Symbol.prototype?"symbol":typeof $r},_typeof$3(Tr)}var lottie={};function setLocation(Tr){setLocationHref(Tr)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(Tr){setSubframeEnabled(Tr)}function setPrefix(Tr){setIdPrefix(Tr)}function loadAnimation(Tr){return animationManager.loadAnimation(Tr)}function setQuality(Tr){if(typeof Tr=="string")switch(Tr){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10);break}else!isNaN(Tr)&&Tr>1&&setDefaultCurveSegments(Tr)}function inBrowser(){return typeof navigator<"u"}function installPlugin(Tr,Cr){Tr==="expressions"&&setExpressionsPlugin(Cr)}function getFactory(Tr){switch(Tr){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.11.0";function checkReady(){document.readyState==="complete"&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(Tr){for(var Cr=queryString.split("&"),$r=0;$r=1?Dr.push({s:Tr-1,e:Cr-1}):(Dr.push({s:Tr,e:1}),Dr.push({s:0,e:Cr-1}));var Mr=[],Br,Nr=Dr.length,Lr;for(Br=0;BrAr+$r)){var Hr,zr;Lr.s*Rr<=Ar?Hr=0:Hr=(Lr.s*Rr-Ar)/$r,Lr.e*Rr>=Ar+$r?zr=1:zr=(Lr.e*Rr-Ar)/$r,Mr.push([Hr,zr])}return Mr.length||Mr.push([0,0]),Mr},TrimModifier.prototype.releasePathsData=function(Tr){var Cr,$r=Tr.length;for(Cr=0;Cr<$r;Cr+=1)segmentsLengthPool.release(Tr[Cr]);return Tr.length=0,Tr},TrimModifier.prototype.processShapes=function(Tr){var Cr,$r;if(this._mdf||Tr){var Ar=this.o.v%360/360;if(Ar<0&&(Ar+=1),this.s.v>1?Cr=1+Ar:this.s.v<0?Cr=0+Ar:Cr=this.s.v+Ar,this.e.v>1?$r=1+Ar:this.e.v<0?$r=0+Ar:$r=this.e.v+Ar,Cr>$r){var Rr=Cr;Cr=$r,$r=Rr}Cr=Math.round(Cr*1e4)*1e-4,$r=Math.round($r*1e4)*1e-4,this.sValue=Cr,this.eValue=$r}else Cr=this.sValue,$r=this.eValue;var Dr,Mr,Br=this.shapes.length,Nr,Lr,Hr,zr,Ur,Vr=0;if($r===Cr)for(Mr=0;Mr=0;Mr-=1)if(Gr=this.shapes[Mr],Gr.shape._mdf){for(Xr=Gr.localShapeCollection,Xr.releaseShapes(),this.m===2&&Br>1?(Wr=this.calculateShapeEdges(Cr,$r,Gr.totalShapeLength,eo,Vr),eo+=Gr.totalShapeLength):Wr=[[Kr,Zr]],Lr=Wr.length,Nr=0;Nr=1?jr.push({s:Gr.totalShapeLength*(Kr-1),e:Gr.totalShapeLength*(Zr-1)}):(jr.push({s:Gr.totalShapeLength*Kr,e:Gr.totalShapeLength}),jr.push({s:0,e:Gr.totalShapeLength*(Zr-1)}));var Yr=this.addShapes(Gr,jr[0]);if(jr[0].s!==jr[0].e){if(jr.length>1){var Jr=Gr.shape.paths.shapes[Gr.shape.paths._length-1];if(Jr.c){var no=Yr.pop();this.addPaths(Yr,Xr),Yr=this.addShapes(Gr,jr[1],no)}else this.addPaths(Yr,Xr),Yr=this.addShapes(Gr,jr[1])}this.addPaths(Yr,Xr)}}Gr.shape.paths=Xr}}},TrimModifier.prototype.addPaths=function(Tr,Cr){var $r,Ar=Tr.length;for($r=0;$rCr.e){$r.c=!1;break}else Cr.s<=Lr&&Cr.e>=Lr+Hr.addedLength?(this.addSegment(Rr[Dr].v[Br-1],Rr[Dr].o[Br-1],Rr[Dr].i[Br],Rr[Dr].v[Br],$r,zr,Xr),Xr=!1):(Vr=bez.getNewSegment(Rr[Dr].v[Br-1],Rr[Dr].v[Br],Rr[Dr].o[Br-1],Rr[Dr].i[Br],(Cr.s-Lr)/Hr.addedLength,(Cr.e-Lr)/Hr.addedLength,Ur[Br-1]),this.addSegmentFromArray(Vr,$r,zr,Xr),Xr=!1,$r.c=!1),Lr+=Hr.addedLength,zr+=1;if(Rr[Dr].c&&Ur.length){if(Hr=Ur[Br-1],Lr<=Cr.e){var Kr=Ur[Br-1].addedLength;Cr.s<=Lr&&Cr.e>=Lr+Kr?(this.addSegment(Rr[Dr].v[Br-1],Rr[Dr].o[Br-1],Rr[Dr].i[0],Rr[Dr].v[0],$r,zr,Xr),Xr=!1):(Vr=bez.getNewSegment(Rr[Dr].v[Br-1],Rr[Dr].v[0],Rr[Dr].o[Br-1],Rr[Dr].i[0],(Cr.s-Lr)/Kr,(Cr.e-Lr)/Kr,Ur[Br-1]),this.addSegmentFromArray(Vr,$r,zr,Xr),Xr=!1,$r.c=!1)}else $r.c=!1;Lr+=Hr.addedLength,zr+=1}if($r._length&&($r.setXYAt($r.v[Gr][0],$r.v[Gr][1],"i",Gr),$r.setXYAt($r.v[$r._length-1][0],$r.v[$r._length-1][1],"o",$r._length-1)),Lr>Cr.e)break;Dr=this.p.keyframes[this.p.keyframes.length-1].t?(Hr=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/Lr,0),zr=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/Lr,0)):(Hr=this.p.pv,zr=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/Lr,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){Hr=[],zr=[];var Ur=this.px,Vr=this.py;Ur._caching.lastFrame+Ur.offsetTime<=Ur.keyframes[0].t?(Hr[0]=Ur.getValueAtTime((Ur.keyframes[0].t+.01)/Lr,0),Hr[1]=Vr.getValueAtTime((Vr.keyframes[0].t+.01)/Lr,0),zr[0]=Ur.getValueAtTime(Ur.keyframes[0].t/Lr,0),zr[1]=Vr.getValueAtTime(Vr.keyframes[0].t/Lr,0)):Ur._caching.lastFrame+Ur.offsetTime>=Ur.keyframes[Ur.keyframes.length-1].t?(Hr[0]=Ur.getValueAtTime(Ur.keyframes[Ur.keyframes.length-1].t/Lr,0),Hr[1]=Vr.getValueAtTime(Vr.keyframes[Vr.keyframes.length-1].t/Lr,0),zr[0]=Ur.getValueAtTime((Ur.keyframes[Ur.keyframes.length-1].t-.01)/Lr,0),zr[1]=Vr.getValueAtTime((Vr.keyframes[Vr.keyframes.length-1].t-.01)/Lr,0)):(Hr=[Ur.pv,Vr.pv],zr[0]=Ur.getValueAtTime((Ur._caching.lastFrame+Ur.offsetTime-.01)/Lr,Ur.offsetTime),zr[1]=Vr.getValueAtTime((Vr._caching.lastFrame+Vr.offsetTime-.01)/Lr,Vr.offsetTime))}else zr=Tr,Hr=zr;this.v.rotate(-Math.atan2(Hr[1]-zr[1],Hr[0]-zr[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function Ar(){if(!this.a.k)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function Rr(){}function Dr(Nr){this._addDynamicProperty(Nr),this.elem.addDynamicProperty(Nr),this._isDirty=!0}function Mr(Nr,Lr,Hr){if(this.elem=Nr,this.frameId=-1,this.propType="transform",this.data=Lr,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(Hr||Nr),Lr.p&&Lr.p.s?(this.px=PropertyFactory.getProp(Nr,Lr.p.x,0,0,this),this.py=PropertyFactory.getProp(Nr,Lr.p.y,0,0,this),Lr.p.z&&(this.pz=PropertyFactory.getProp(Nr,Lr.p.z,0,0,this))):this.p=PropertyFactory.getProp(Nr,Lr.p||{k:[0,0,0]},1,0,this),Lr.rx){if(this.rx=PropertyFactory.getProp(Nr,Lr.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(Nr,Lr.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(Nr,Lr.rz,0,degToRads,this),Lr.or.k[0].ti){var zr,Ur=Lr.or.k.length;for(zr=0;zr0;)$r-=1,this._elements.unshift(Cr[$r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(Tr){var Cr,$r=Tr.length;for(Cr=0;Cr<$r;Cr+=1)Tr[Cr]._processed=!1,Tr[Cr].ty==="gr"&&this.resetElements(Tr[Cr].it)},RepeaterModifier.prototype.cloneElements=function(Tr){var Cr=JSON.parse(JSON.stringify(Tr));return this.resetElements(Cr),Cr},RepeaterModifier.prototype.changeGroupRender=function(Tr,Cr){var $r,Ar=Tr.length;for($r=0;$r0?Math.floor(Ur):Math.ceil(Ur),Gr=this.pMatrix.props,Xr=this.rMatrix.props,Kr=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var Zr=0;if(Ur>0){for(;Zrjr;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),Zr-=1;Vr&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-Vr,!0),Zr-=Vr)}Ar=this.data.m===1?0:this._currentCopies-1,Rr=this.data.m===1?1:-1,Dr=this._currentCopies;for(var eo,Wr;Dr;){if(Cr=this.elemsData[Ar].it,$r=Cr[Cr.length-1].transform.mProps.v.props,Wr=$r.length,Cr[Cr.length-1].transform.mProps._mdf=!0,Cr[Cr.length-1].transform.op._mdf=!0,Cr[Cr.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(Ar/(this._currentCopies-1)),Zr!==0){for((Ar!==0&&Rr===1||Ar!==this._currentCopies-1&&Rr===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(Xr[0],Xr[1],Xr[2],Xr[3],Xr[4],Xr[5],Xr[6],Xr[7],Xr[8],Xr[9],Xr[10],Xr[11],Xr[12],Xr[13],Xr[14],Xr[15]),this.matrix.transform(Kr[0],Kr[1],Kr[2],Kr[3],Kr[4],Kr[5],Kr[6],Kr[7],Kr[8],Kr[9],Kr[10],Kr[11],Kr[12],Kr[13],Kr[14],Kr[15]),this.matrix.transform(Gr[0],Gr[1],Gr[2],Gr[3],Gr[4],Gr[5],Gr[6],Gr[7],Gr[8],Gr[9],Gr[10],Gr[11],Gr[12],Gr[13],Gr[14],Gr[15]),eo=0;eo0&&Ar<1?[Cr]:[]:[Cr-Ar,Cr+Ar].filter(function(Rr){return Rr>0&&Rr<1})},PolynomialBezier.prototype.split=function(Tr){if(Tr<=0)return[singlePoint(this.points[0]),this];if(Tr>=1)return[this,singlePoint(this.points[this.points.length-1])];var Cr=lerpPoint(this.points[0],this.points[1],Tr),$r=lerpPoint(this.points[1],this.points[2],Tr),Ar=lerpPoint(this.points[2],this.points[3],Tr),Rr=lerpPoint(Cr,$r,Tr),Dr=lerpPoint($r,Ar,Tr),Mr=lerpPoint(Rr,Dr,Tr);return[new PolynomialBezier(this.points[0],Cr,Rr,Mr,!0),new PolynomialBezier(Mr,Dr,Ar,this.points[3],!0)]};function extrema(Tr,Cr){var $r=Tr.points[0][Cr],Ar=Tr.points[Tr.points.length-1][Cr];if($r>Ar){var Rr=Ar;Ar=$r,$r=Rr}for(var Dr=quadRoots(3*Tr.a[Cr],2*Tr.b[Cr],Tr.c[Cr]),Mr=0;Mr0&&Dr[Mr]<1){var Br=Tr.point(Dr[Mr])[Cr];Br<$r?$r=Br:Br>Ar&&(Ar=Br)}return{min:$r,max:Ar}}PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var Tr=this.bounds();return{left:Tr.x.min,right:Tr.x.max,top:Tr.y.min,bottom:Tr.y.max,width:Tr.x.max-Tr.x.min,height:Tr.y.max-Tr.y.min,cx:(Tr.x.max+Tr.x.min)/2,cy:(Tr.y.max+Tr.y.min)/2}};function intersectData(Tr,Cr,$r){var Ar=Tr.boundingBox();return{cx:Ar.cx,cy:Ar.cy,width:Ar.width,height:Ar.height,bez:Tr,t:(Cr+$r)/2,t1:Cr,t2:$r}}function splitData(Tr){var Cr=Tr.bez.split(.5);return[intersectData(Cr[0],Tr.t1,Tr.t),intersectData(Cr[1],Tr.t,Tr.t2)]}function boxIntersect(Tr,Cr){return Math.abs(Tr.cx-Cr.cx)*2=Dr||Tr.width<=Ar&&Tr.height<=Ar&&Cr.width<=Ar&&Cr.height<=Ar){Rr.push([Tr.t,Cr.t]);return}var Mr=splitData(Tr),Br=splitData(Cr);intersectsImpl(Mr[0],Br[0],$r+1,Ar,Rr,Dr),intersectsImpl(Mr[0],Br[1],$r+1,Ar,Rr,Dr),intersectsImpl(Mr[1],Br[0],$r+1,Ar,Rr,Dr),intersectsImpl(Mr[1],Br[1],$r+1,Ar,Rr,Dr)}}PolynomialBezier.prototype.intersections=function(Tr,Cr,$r){Cr===void 0&&(Cr=2),$r===void 0&&($r=7);var Ar=[];return intersectsImpl(intersectData(this,0,1),intersectData(Tr,0,1),0,Cr,Ar,$r),Ar},PolynomialBezier.shapeSegment=function(Tr,Cr){var $r=(Cr+1)%Tr.length();return new PolynomialBezier(Tr.v[Cr],Tr.o[Cr],Tr.i[$r],Tr.v[$r],!0)},PolynomialBezier.shapeSegmentInverted=function(Tr,Cr){var $r=(Cr+1)%Tr.length();return new PolynomialBezier(Tr.v[$r],Tr.i[$r],Tr.o[Cr],Tr.v[Cr],!0)};function crossProduct(Tr,Cr){return[Tr[1]*Cr[2]-Tr[2]*Cr[1],Tr[2]*Cr[0]-Tr[0]*Cr[2],Tr[0]*Cr[1]-Tr[1]*Cr[0]]}function lineIntersection(Tr,Cr,$r,Ar){var Rr=[Tr[0],Tr[1],1],Dr=[Cr[0],Cr[1],1],Mr=[$r[0],$r[1],1],Br=[Ar[0],Ar[1],1],Nr=crossProduct(crossProduct(Rr,Dr),crossProduct(Mr,Br));return floatZero(Nr[2])?null:[Nr[0]/Nr[2],Nr[1]/Nr[2]]}function polarOffset(Tr,Cr,$r){return[Tr[0]+Math.cos(Cr)*$r,Tr[1]-Math.sin(Cr)*$r]}function pointDistance(Tr,Cr){return Math.hypot(Tr[0]-Cr[0],Tr[1]-Cr[1])}function pointEqual(Tr,Cr){return floatEqual(Tr[0],Cr[0])&&floatEqual(Tr[1],Cr[1])}function ZigZagModifier(){}extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(Tr,Cr){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(Tr,Cr.s,0,null,this),this.frequency=PropertyFactory.getProp(Tr,Cr.r,0,null,this),this.pointsType=PropertyFactory.getProp(Tr,Cr.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function setPoint(Tr,Cr,$r,Ar,Rr,Dr,Mr){var Br=$r-Math.PI/2,Nr=$r+Math.PI/2,Lr=Cr[0]+Math.cos($r)*Ar*Rr,Hr=Cr[1]-Math.sin($r)*Ar*Rr;Tr.setTripleAt(Lr,Hr,Lr+Math.cos(Br)*Dr,Hr-Math.sin(Br)*Dr,Lr+Math.cos(Nr)*Mr,Hr-Math.sin(Nr)*Mr,Tr.length())}function getPerpendicularVector(Tr,Cr){var $r=[Cr[0]-Tr[0],Cr[1]-Tr[1]],Ar=-Math.PI*.5,Rr=[Math.cos(Ar)*$r[0]-Math.sin(Ar)*$r[1],Math.sin(Ar)*$r[0]+Math.cos(Ar)*$r[1]];return Rr}function getProjectingAngle(Tr,Cr){var $r=Cr===0?Tr.length()-1:Cr-1,Ar=(Cr+1)%Tr.length(),Rr=Tr.v[$r],Dr=Tr.v[Ar],Mr=getPerpendicularVector(Rr,Dr);return Math.atan2(0,1)-Math.atan2(Mr[1],Mr[0])}function zigZagCorner(Tr,Cr,$r,Ar,Rr,Dr,Mr){var Br=getProjectingAngle(Cr,$r),Nr=Cr.v[$r%Cr._length],Lr=Cr.v[$r===0?Cr._length-1:$r-1],Hr=Cr.v[($r+1)%Cr._length],zr=Dr===2?Math.sqrt(Math.pow(Nr[0]-Lr[0],2)+Math.pow(Nr[1]-Lr[1],2)):0,Ur=Dr===2?Math.sqrt(Math.pow(Nr[0]-Hr[0],2)+Math.pow(Nr[1]-Hr[1],2)):0;setPoint(Tr,Cr.v[$r%Cr._length],Br,Mr,Ar,Ur/((Rr+1)*2),zr/((Rr+1)*2))}function zigZagSegment(Tr,Cr,$r,Ar,Rr,Dr){for(var Mr=0;Mr1&&Cr.length>1&&(Rr=getIntersection(Tr[0],Cr[Cr.length-1]),Rr)?[[Tr[0].split(Rr[0])[0]],[Cr[Cr.length-1].split(Rr[1])[1]]]:[$r,Ar]}function pruneIntersections(Tr){for(var Cr,$r=1;$r1&&(Cr=pruneSegmentIntersection(Tr[Tr.length-1],Tr[0]),Tr[Tr.length-1]=Cr[0],Tr[0]=Cr[1]),Tr}function offsetSegmentSplit(Tr,Cr){var $r=Tr.inflectionPoints(),Ar,Rr,Dr,Mr;if($r.length===0)return[offsetSegment(Tr,Cr)];if($r.length===1||floatEqual($r[1],1))return Dr=Tr.split($r[0]),Ar=Dr[0],Rr=Dr[1],[offsetSegment(Ar,Cr),offsetSegment(Rr,Cr)];Dr=Tr.split($r[0]),Ar=Dr[0];var Br=($r[1]-$r[0])/(1-$r[0]);return Dr=Dr[1].split(Br),Mr=Dr[0],Rr=Dr[1],[offsetSegment(Ar,Cr),offsetSegment(Mr,Cr),offsetSegment(Rr,Cr)]}function OffsetPathModifier(){}extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(Tr,Cr){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(Tr,Cr.a,0,null,this),this.miterLimit=PropertyFactory.getProp(Tr,Cr.ml,0,null,this),this.lineJoin=Cr.lj,this._isAnimated=this.amount.effectsSequence.length!==0},OffsetPathModifier.prototype.processPath=function(Tr,Cr,$r,Ar){var Rr=shapePool.newElement();Rr.c=Tr.c;var Dr=Tr.length();Tr.c||(Dr-=1);var Mr,Br,Nr,Lr=[];for(Mr=0;Mr=0;Mr-=1)Nr=PolynomialBezier.shapeSegmentInverted(Tr,Mr),Lr.push(offsetSegmentSplit(Nr,Cr));Lr=pruneIntersections(Lr);var Hr=null,zr=null;for(Mr=0;Mr0&&(ao=!1),ao){var go=createTag("style");go.setAttribute("f-forigin",Jr[no].fOrigin),go.setAttribute("f-origin",Jr[no].origin),go.setAttribute("f-family",Jr[no].fFamily),go.type="text/css",go.innerText="@font-face {font-family: "+Jr[no].fFamily+"; font-style: normal; src: url('"+Jr[no].fPath+"');}",Yr.appendChild(go)}}else if(Jr[no].fOrigin==="g"||Jr[no].origin===1){for(lo=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),po=0;poCr?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var Cr,$r=this.renderableComponents.length;for(Cr=0;Cr<$r;Cr+=1)this.renderableComponents[Cr].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return this.data.ty===5?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=function(){var Tr={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"};return function(Cr){return Tr[Cr]||""}}();function SliderEffect(Tr,Cr,$r){this.p=PropertyFactory.getProp(Cr,Tr.v,0,0,$r)}function AngleEffect(Tr,Cr,$r){this.p=PropertyFactory.getProp(Cr,Tr.v,0,0,$r)}function ColorEffect(Tr,Cr,$r){this.p=PropertyFactory.getProp(Cr,Tr.v,1,0,$r)}function PointEffect(Tr,Cr,$r){this.p=PropertyFactory.getProp(Cr,Tr.v,1,0,$r)}function LayerIndexEffect(Tr,Cr,$r){this.p=PropertyFactory.getProp(Cr,Tr.v,0,0,$r)}function MaskIndexEffect(Tr,Cr,$r){this.p=PropertyFactory.getProp(Cr,Tr.v,0,0,$r)}function CheckboxEffect(Tr,Cr,$r){this.p=PropertyFactory.getProp(Cr,Tr.v,0,0,$r)}function NoValueEffect(){this.p={}}function EffectsManager(Tr,Cr){var $r=Tr.ef||[];this.effectElements=[];var Ar,Rr=$r.length,Dr;for(Ar=0;Ar.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(Tr){this.audio.rate(Tr)},AudioElement.prototype.volume=function(Tr){this._volumeMultiplier=Tr,this._previousVolume=Tr*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){};function BaseRenderer(){}BaseRenderer.prototype.checkLayers=function(Tr){var Cr,$r=this.layers.length,Ar;for(this.completeLayers=!0,Cr=$r-1;Cr>=0;Cr-=1)this.elements[Cr]||(Ar=this.layers[Cr],Ar.ip-Ar.st<=Tr-this.layers[Cr].st&&Ar.op-Ar.st>Tr-this.layers[Cr].st&&this.buildItem(Cr)),this.completeLayers=this.elements[Cr]?this.completeLayers:!1;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(Tr){switch(Tr.ty){case 2:return this.createImage(Tr);case 0:return this.createComp(Tr);case 1:return this.createSolid(Tr);case 3:return this.createNull(Tr);case 4:return this.createShape(Tr);case 5:return this.createText(Tr);case 6:return this.createAudio(Tr);case 13:return this.createCamera(Tr);case 15:return this.createFootage(Tr);default:return this.createNull(Tr)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(Tr){return new AudioElement(Tr,this.globalData,this)},BaseRenderer.prototype.createFootage=function(Tr){return new FootageElement(Tr,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var Tr,Cr=this.layers.length;for(Tr=0;Tr0&&(this.maskElement.setAttribute("id",Ur),this.element.maskedElement.setAttribute(Zr,"url("+getLocationHref()+"#"+Ur+")"),Ar.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}MaskElement.prototype.getMaskProperty=function(Tr){return this.viewData[Tr].prop},MaskElement.prototype.renderFrame=function(Tr){var Cr=this.element.finalTransform.mat,$r,Ar=this.masksProperties.length;for($r=0;$r1&&(Ar+=" C"+Cr.o[Rr-1][0]+","+Cr.o[Rr-1][1]+" "+Cr.i[0][0]+","+Cr.i[0][1]+" "+Cr.v[0][0]+","+Cr.v[0][1]),$r.lastPath!==Ar){var Mr="";$r.elem&&(Cr.c&&(Mr=Tr.inv?this.solidPath+Ar:Ar),$r.elem.setAttribute("d",Mr)),$r.lastPath=Ar}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var Tr={};Tr.createFilter=Cr,Tr.createAlphaToLuminanceFilter=$r;function Cr(Ar,Rr){var Dr=createNS("filter");return Dr.setAttribute("id",Ar),Rr!==!0&&(Dr.setAttribute("filterUnits","objectBoundingBox"),Dr.setAttribute("x","0%"),Dr.setAttribute("y","0%"),Dr.setAttribute("width","100%"),Dr.setAttribute("height","100%")),Dr}function $r(){var Ar=createNS("feColorMatrix");return Ar.setAttribute("type","matrix"),Ar.setAttribute("color-interpolation-filters","sRGB"),Ar.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),Ar}return Tr}(),featureSupport=function(){var Tr={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<"u"};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(Tr.maskType=!1),/firefox/i.test(navigator.userAgent)&&(Tr.svgLumaHidden=!1),Tr}(),registeredEffects={},idPrefix="filter_result_";function SVGEffects(Tr){var Cr,$r="SourceGraphic",Ar=Tr.data.ef?Tr.data.ef.length:0,Rr=createElementID(),Dr=filtersFactory.createFilter(Rr,!0),Mr=0;this.filters=[];var Br;for(Cr=0;Cr=0&&(Ar=this.shapeModifiers[Cr].processShapes(this._isFirstFrame),!Ar);Cr-=1);}},searchProcessedElement:function(Cr){for(var $r=this.processedElements,Ar=0,Rr=$r.length;Ar.01)return!1;$r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!==this.c.length/4)return!1;if(this.data.k.k[0].s)for(var Tr=0,Cr=this.data.k.k.length;Tr0;)Kr=Ur.transformers[ao].mProps._mdf||Kr,so-=1,ao-=1;if(Kr)for(so=Yr-Ur.styles[eo].lvl,ao=Ur.transformers.length-1;so>0;)ro=Ur.transformers[ao].mProps.v.props,no.transform(ro[0],ro[1],ro[2],ro[3],ro[4],ro[5],ro[6],ro[7],ro[8],ro[9],ro[10],ro[11],ro[12],ro[13],ro[14],ro[15]),so-=1,ao-=1}else no=Tr;if(Jr=Ur.sh.paths,Gr=Jr._length,Kr){for(Xr="",jr=0;jr=1?go=.99:go<=-1&&(go=-.99);var co=lo*go,mo=Math.cos(po+Ur.a.v)*co+Xr[0],io=Math.sin(po+Ur.a.v)*co+Xr[1];jr.setAttribute("fx",mo),jr.setAttribute("fy",io),Gr&&!Ur.g._collapsable&&(Ur.of.setAttribute("fx",mo),Ur.of.setAttribute("fy",io))}}}function Hr(zr,Ur,Vr){var jr=Ur.style,Gr=Ur.d;Gr&&(Gr._mdf||Vr)&&Gr.dashStr&&(jr.pElem.setAttribute("stroke-dasharray",Gr.dashStr),jr.pElem.setAttribute("stroke-dashoffset",Gr.dashoffset[0])),Ur.c&&(Ur.c._mdf||Vr)&&jr.pElem.setAttribute("stroke","rgb("+bmFloor(Ur.c.v[0])+","+bmFloor(Ur.c.v[1])+","+bmFloor(Ur.c.v[2])+")"),(Ur.o._mdf||Vr)&&jr.pElem.setAttribute("stroke-opacity",Ur.o.v),(Ur.w._mdf||Vr)&&(jr.pElem.setAttribute("stroke-width",Ur.w.v),jr.msElem&&jr.msElem.setAttribute("stroke-width",Ur.w.v))}return $r}();function SVGShapeElement(Tr,Cr,$r){this.shapes=[],this.shapesData=Tr.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(Tr,Cr,$r),this.prevViewData=[]}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var Tr,Cr=this.shapes.length,$r,Ar,Rr=this.stylesList.length,Dr,Mr=[],Br=!1;for(Ar=0;Ar1&&Br&&this.setShapesAsAnimated(Mr)}},SVGShapeElement.prototype.setShapesAsAnimated=function(Tr){var Cr,$r=Tr.length;for(Cr=0;Cr<$r;Cr+=1)Tr[Cr].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(Tr,Cr){var $r,Ar=new SVGStyleData(Tr,Cr),Rr=Ar.pElem;if(Tr.ty==="st")$r=new SVGStrokeStyleData(this,Tr,Ar);else if(Tr.ty==="fl")$r=new SVGFillStyleData(this,Tr,Ar);else if(Tr.ty==="gf"||Tr.ty==="gs"){var Dr=Tr.ty==="gf"?SVGGradientFillStyleData:SVGGradientStrokeStyleData;$r=new Dr(this,Tr,Ar),this.globalData.defs.appendChild($r.gf),$r.maskId&&(this.globalData.defs.appendChild($r.ms),this.globalData.defs.appendChild($r.of),Rr.setAttribute("mask","url("+getLocationHref()+"#"+$r.maskId+")"))}else Tr.ty==="no"&&($r=new SVGNoStyleData(this,Tr,Ar));return(Tr.ty==="st"||Tr.ty==="gs")&&(Rr.setAttribute("stroke-linecap",lineCapEnum[Tr.lc||2]),Rr.setAttribute("stroke-linejoin",lineJoinEnum[Tr.lj||2]),Rr.setAttribute("fill-opacity","0"),Tr.lj===1&&Rr.setAttribute("stroke-miterlimit",Tr.ml)),Tr.r===2&&Rr.setAttribute("fill-rule","evenodd"),Tr.ln&&Rr.setAttribute("id",Tr.ln),Tr.cl&&Rr.setAttribute("class",Tr.cl),Tr.bm&&(Rr.style["mix-blend-mode"]=getBlendMode(Tr.bm)),this.stylesList.push(Ar),this.addToAnimatedContents(Tr,$r),$r},SVGShapeElement.prototype.createGroupElement=function(Tr){var Cr=new ShapeGroupData;return Tr.ln&&Cr.gr.setAttribute("id",Tr.ln),Tr.cl&&Cr.gr.setAttribute("class",Tr.cl),Tr.bm&&(Cr.gr.style["mix-blend-mode"]=getBlendMode(Tr.bm)),Cr},SVGShapeElement.prototype.createTransformElement=function(Tr,Cr){var $r=TransformPropertyFactory.getTransformProperty(this,Tr,this),Ar=new SVGTransformData($r,$r.o,Cr);return this.addToAnimatedContents(Tr,Ar),Ar},SVGShapeElement.prototype.createShapeElement=function(Tr,Cr,$r){var Ar=4;Tr.ty==="rc"?Ar=5:Tr.ty==="el"?Ar=6:Tr.ty==="sr"&&(Ar=7);var Rr=ShapePropertyFactory.getShapeProp(this,Tr,Ar,this),Dr=new SVGShapeData(Cr,$r,Rr);return this.shapes.push(Dr),this.addShapeToModifiers(Dr),this.addToAnimatedContents(Tr,Dr),Dr},SVGShapeElement.prototype.addToAnimatedContents=function(Tr,Cr){for(var $r=0,Ar=this.animatedContents.length;$r=0;Nr-=1){if(Xr=this.searchProcessedElement(Tr[Nr]),Xr?Cr[Nr]=$r[Xr-1]:Tr[Nr]._render=Mr,Tr[Nr].ty==="fl"||Tr[Nr].ty==="st"||Tr[Nr].ty==="gf"||Tr[Nr].ty==="gs"||Tr[Nr].ty==="no")Xr?Cr[Nr].style.closed=!1:Cr[Nr]=this.createStyleElement(Tr[Nr],Rr),Tr[Nr]._render&&Cr[Nr].style.pElem.parentNode!==Ar&&Ar.appendChild(Cr[Nr].style.pElem),Ur.push(Cr[Nr].style);else if(Tr[Nr].ty==="gr"){if(!Xr)Cr[Nr]=this.createGroupElement(Tr[Nr]);else for(zr=Cr[Nr].it.length,Hr=0;Hr1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(Tr){this.effectsSequence.push(Tr),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(Tr){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!Tr)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var Cr=this.currentData,$r=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var Ar,Rr=this.effectsSequence.length,Dr=Tr||this.data.d.k[this.keysIndex].s;for(Ar=0;ArCr);)$r+=1;return this.keysIndex!==$r&&(this.keysIndex=$r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(Tr){for(var Cr=[],$r=0,Ar=Tr.length,Rr,Dr,Mr=!1;$r=55296&&Rr<=56319?(Dr=Tr.charCodeAt($r+1),Dr>=56320&&Dr<=57343?(Mr||FontManager.isModifier(Rr,Dr)?(Cr[Cr.length-1]+=Tr.substr($r,2),Mr=!1):Cr.push(Tr.substr($r,2)),$r+=1):Cr.push(Tr.charAt($r))):Rr>56319?(Dr=Tr.charCodeAt($r+1),FontManager.isZeroWidthJoiner(Rr,Dr)?(Mr=!0,Cr[Cr.length-1]+=Tr.substr($r,2),$r+=1):Cr.push(Tr.charAt($r))):FontManager.isZeroWidthJoiner(Rr)?(Cr[Cr.length-1]+=Tr.charAt($r),Mr=!0):Cr.push(Tr.charAt($r)),$r+=1;return Cr},TextProperty.prototype.completeTextData=function(Tr){Tr.__complete=!0;var Cr=this.elem.globalData.fontManager,$r=this.data,Ar=[],Rr,Dr,Mr,Br=0,Nr,Lr=$r.m.g,Hr=0,zr=0,Ur=0,Vr=[],jr=0,Gr=0,Xr,Kr,Zr=Cr.getFontByName(Tr.f),eo,Wr=0,Yr=getFontProperties(Zr);Tr.fWeight=Yr.weight,Tr.fStyle=Yr.style,Tr.finalSize=Tr.s,Tr.finalText=this.buildFinalText(Tr.t),Dr=Tr.finalText.length,Tr.finalLineHeight=Tr.lh;var Jr=Tr.tr/1e3*Tr.finalSize,no;if(Tr.sz)for(var ro=!0,so=Tr.sz[0],ao=Tr.sz[1],lo,po;ro;){po=this.buildFinalText(Tr.t),lo=0,jr=0,Dr=po.length,Jr=Tr.tr/1e3*Tr.finalSize;var go=-1;for(Rr=0;Rrso&&po[Rr]!==" "?(go===-1?Dr+=1:Rr=go,lo+=Tr.finalLineHeight||Tr.finalSize*1.2,po.splice(Rr,go===Rr?1:0,"\r"),go=-1,jr=0):(jr+=Wr,jr+=Jr);lo+=Zr.ascent*Tr.finalSize/100,this.canResize&&Tr.finalSize>this.minimumFontSize&&aoGr?jr:Gr,jr=-2*Jr,Nr="",Mr=!0,Ur+=1):Nr=mo,Cr.chars?(eo=Cr.getCharData(mo,Zr.fStyle,Cr.getFontByName(Tr.f).fFamily),Wr=Mr?0:eo.w*Tr.finalSize/100):Wr=Cr.measureText(Nr,Tr.f,Tr.finalSize),mo===" "?co+=Wr+Jr:(jr+=Wr+Jr+co,co=0),Ar.push({l:Wr,an:Wr,add:Hr,n:Mr,anIndexes:[],val:Nr,line:Ur,animatorJustifyOffset:0}),Lr==2){if(Hr+=Wr,Nr===""||Nr===" "||Rr===Dr-1){for((Nr===""||Nr===" ")&&(Hr-=Wr);zr<=Rr;)Ar[zr].an=Hr,Ar[zr].ind=Br,Ar[zr].extra=Wr,zr+=1;Br+=1,Hr=0}}else if(Lr==3){if(Hr+=Wr,Nr===""||Rr===Dr-1){for(Nr===""&&(Hr-=Wr);zr<=Rr;)Ar[zr].an=Hr,Ar[zr].ind=Br,Ar[zr].extra=Wr,zr+=1;Hr=0,Br+=1}}else Ar[Br].ind=Br,Ar[Br].extra=0,Br+=1;if(Tr.l=Ar,Gr=jr>Gr?jr:Gr,Vr.push(jr),Tr.sz)Tr.boxWidth=Tr.sz[0],Tr.justifyOffset=0;else switch(Tr.boxWidth=Gr,Tr.j){case 1:Tr.justifyOffset=-Tr.boxWidth;break;case 2:Tr.justifyOffset=-Tr.boxWidth/2;break;default:Tr.justifyOffset=0}Tr.lineWidths=Vr;var io=$r.a,uo,ho;Kr=io.length;var yo,So,ko=[];for(Xr=0;Xr0?Br=this.ne.v/100:Nr=-this.ne.v/100,this.xe.v>0?Lr=1-this.xe.v/100:Hr=1+this.xe.v/100;var zr=BezierFactory.getBezierEasing(Br,Nr,Lr,Hr).get,Ur=0,Vr=this.finalS,jr=this.finalE,Gr=this.data.sh;if(Gr===2)jr===Vr?Ur=Mr>=jr?1:0:Ur=Tr(0,Cr(.5/(jr-Vr)+(Mr-Vr)/(jr-Vr),1)),Ur=zr(Ur);else if(Gr===3)jr===Vr?Ur=Mr>=jr?0:1:Ur=1-Tr(0,Cr(.5/(jr-Vr)+(Mr-Vr)/(jr-Vr),1)),Ur=zr(Ur);else if(Gr===4)jr===Vr?Ur=0:(Ur=Tr(0,Cr(.5/(jr-Vr)+(Mr-Vr)/(jr-Vr),1)),Ur<.5?Ur*=2:Ur=1-2*(Ur-.5)),Ur=zr(Ur);else if(Gr===5){if(jr===Vr)Ur=0;else{var Xr=jr-Vr;Mr=Cr(Tr(0,Mr+.5-Vr),jr-Vr);var Kr=-Xr/2+Mr,Zr=Xr/2;Ur=Math.sqrt(1-Kr*Kr/(Zr*Zr))}Ur=zr(Ur)}else Gr===6?(jr===Vr?Ur=0:(Mr=Cr(Tr(0,Mr+.5-Vr),jr-Vr),Ur=(1+Math.cos(Math.PI+Math.PI*2*Mr/(jr-Vr)))/2),Ur=zr(Ur)):(Mr>=$r(Vr)&&(Mr-Vr<0?Ur=Tr(0,Cr(Cr(jr,1)-(Vr-Mr),1)):Ur=Tr(0,Cr(jr-Mr,1))),Ur=zr(Ur));if(this.sm.v!==100){var eo=this.sm.v*.01;eo===0&&(eo=1e-8);var Wr=.5-eo*.5;Ur1&&(Ur=1))}return Ur*this.a.v},getValue:function(Mr){this.iterateDynamicProperties(),this._mdf=Mr||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,Mr&&this.data.r===2&&(this.e.v=this._currentTextLength);var Br=this.data.r===2?1:100/this.data.totalChars,Nr=this.o.v/Br,Lr=this.s.v/Br+Nr,Hr=this.e.v/Br+Nr;if(Lr>Hr){var zr=Lr;Lr=Hr,Hr=zr}this.finalS=Lr,this.finalE=Hr}},extendPrototype([DynamicPropertyContainer],Ar);function Rr(Dr,Mr,Br){return new Ar(Dr,Mr)}return{getTextSelectorProp:Rr}}();function TextAnimatorDataProperty(Tr,Cr,$r){var Ar={propType:!1},Rr=PropertyFactory.getProp,Dr=Cr.a;this.a={r:Dr.r?Rr(Tr,Dr.r,0,degToRads,$r):Ar,rx:Dr.rx?Rr(Tr,Dr.rx,0,degToRads,$r):Ar,ry:Dr.ry?Rr(Tr,Dr.ry,0,degToRads,$r):Ar,sk:Dr.sk?Rr(Tr,Dr.sk,0,degToRads,$r):Ar,sa:Dr.sa?Rr(Tr,Dr.sa,0,degToRads,$r):Ar,s:Dr.s?Rr(Tr,Dr.s,1,.01,$r):Ar,a:Dr.a?Rr(Tr,Dr.a,1,0,$r):Ar,o:Dr.o?Rr(Tr,Dr.o,0,.01,$r):Ar,p:Dr.p?Rr(Tr,Dr.p,1,0,$r):Ar,sw:Dr.sw?Rr(Tr,Dr.sw,0,0,$r):Ar,sc:Dr.sc?Rr(Tr,Dr.sc,1,0,$r):Ar,fc:Dr.fc?Rr(Tr,Dr.fc,1,0,$r):Ar,fh:Dr.fh?Rr(Tr,Dr.fh,0,0,$r):Ar,fs:Dr.fs?Rr(Tr,Dr.fs,0,.01,$r):Ar,fb:Dr.fb?Rr(Tr,Dr.fb,0,.01,$r):Ar,t:Dr.t?Rr(Tr,Dr.t,0,0,$r):Ar},this.s=TextSelectorProp.getTextSelectorProp(Tr,Cr.s,$r),this.s.t=Cr.s.t}function TextAnimatorProperty(Tr,Cr,$r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=Tr,this._renderType=Cr,this._elem=$r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer($r)}TextAnimatorProperty.prototype.searchProperties=function(){var Tr,Cr=this._textData.a.length,$r,Ar=PropertyFactory.getProp;for(Tr=0;Tr=jr+ti||!Yr?(so=(jr+ti-Xr)/Gr.partialLength,No=Wr.point[0]+(Gr.point[0]-Wr.point[0])*so,Eo=Wr.point[1]+(Gr.point[1]-Wr.point[1])*so,Dr.translate(-$r[0]*Ur[Hr].an*.005,-($r[1]*co)*.01),Kr=!1):Yr&&(Xr+=Gr.partialLength,Zr+=1,Zr>=Yr.length&&(Zr=0,eo+=1,Jr[eo]?Yr=Jr[eo].points:lo.v.c?(Zr=0,eo=0,Yr=Jr[eo].points):(Xr-=Gr.partialLength,Yr=null)),Yr&&(Wr=Gr,Gr=Yr[Zr],no=Gr.partialLength));Go=Ur[Hr].an/2-Ur[Hr].add,Dr.translate(-Go,0,0)}else Go=Ur[Hr].an/2-Ur[Hr].add,Dr.translate(-Go,0,0),Dr.translate(-$r[0]*Ur[Hr].an*.005,-$r[1]*co*.01,0);for(ho=0;hoTr?this.textSpans[Tr].span:createNS(Br?"g":"text"),eo<=Tr){if(Nr.setAttribute("stroke-linecap","butt"),Nr.setAttribute("stroke-linejoin","round"),Nr.setAttribute("stroke-miterlimit","4"),this.textSpans[Tr].span=Nr,Br){var Yr=createNS("g");Nr.appendChild(Yr),this.textSpans[Tr].childSpan=Yr}this.textSpans[Tr].span=Nr,this.layerElement.appendChild(Nr)}Nr.style.display="inherit"}if(Lr.reset(),zr&&(Mr[Tr].n&&(Ur=-Gr,Vr+=$r.yOffset,Vr+=jr?1:0,jr=!1),this.applyTextPropertiesToMatrix($r,Lr,Mr[Tr].line,Ur,Vr),Ur+=Mr[Tr].l||0,Ur+=Gr),Br){Wr=this.globalData.fontManager.getCharData($r.finalText[Tr],Ar.fStyle,this.globalData.fontManager.getFontByName($r.f).fFamily);var Jr;if(Wr.t===1)Jr=new SVGCompElement(Wr.data,this.globalData,this);else{var no=emptyShapeData;Wr.data&&Wr.data.shapes&&(no=this.buildShapeData(Wr.data,$r.finalSize)),Jr=new SVGShapeElement(no,this.globalData,this)}if(this.textSpans[Tr].glyph){var ro=this.textSpans[Tr].glyph;this.textSpans[Tr].childSpan.removeChild(ro.layerElement),ro.destroy()}this.textSpans[Tr].glyph=Jr,Jr._debug=!0,Jr.prepareFrame(0),Jr.renderFrame(),this.textSpans[Tr].childSpan.appendChild(Jr.layerElement),Wr.t===1&&this.textSpans[Tr].childSpan.setAttribute("transform","scale("+$r.finalSize/100+","+$r.finalSize/100+")")}else zr&&Nr.setAttribute("transform","translate("+Lr.props[12]+","+Lr.props[13]+")"),Nr.textContent=Mr[Tr].val,Nr.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}zr&&Nr&&Nr.setAttribute("d",Hr)}for(;Tr=0;Cr-=1)(this.completeLayers||this.elements[Cr])&&this.elements[Cr].prepareFrame(Tr-this.layers[Cr].st);if(this.globalData._mdf)for(Cr=0;Cr<$r;Cr+=1)(this.completeLayers||this.elements[Cr])&&this.elements[Cr].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(Tr,Cr){var $r=Tr.getBaseElement();if($r){for(var Ar=0,Rr;Ar=0;$r-=1)(this.completeLayers||this.elements[$r])&&(this.elements[$r].prepareFrame(this.renderedFrame-this.layers[$r].st),this.elements[$r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var Tr,Cr=this.layers.length;for(Tr=0;Tr=0;Ar-=1)Mr=Cr.transforms[Ar].transform.mProps.v.props,Cr.finalTransform.transform(Mr[0],Mr[1],Mr[2],Mr[3],Mr[4],Mr[5],Mr[6],Mr[7],Mr[8],Mr[9],Mr[10],Mr[11],Mr[12],Mr[13],Mr[14],Mr[15])}Cr._mdf=Dr},processSequences:function(Cr){var $r,Ar=this.sequenceList.length;for($r=0;$r=1){this.buffers=[];var Cr=this.globalData.canvasContext,$r=assetLoader.createCanvas(Cr.canvas.width,Cr.canvas.height);this.buffers.push($r);var Ar=assetLoader.createCanvas(Cr.canvas.width,Cr.canvas.height);this.buffers.push(Ar),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects},createContent:function(){},setBlendMode:function(){var Cr=this.globalData;if(Cr.blendMode!==this.data.bm){Cr.blendMode=this.data.bm;var $r=getBlendMode(this.data.bm);Cr.canvasContext.globalCompositeOperation=$r}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(Cr){Cr.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var Cr=this.buffers[0],$r=Cr.getContext("2d");this.clearCanvas($r),$r.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var Cr=this.buffers[1],$r=Cr.getContext("2d");this.clearCanvas($r),$r.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform);var Ar=this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1);if(Ar.renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var Rr=assetLoader.getLumaCanvas(this.canvasContext.canvas),Dr=Rr.getContext("2d");Dr.drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(Rr,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(Cr,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(Cr){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!Cr)){this.renderTransform(),this.renderRenderable(),this.setBlendMode();var $r=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save($r),this.globalData.renderer.ctxTransform(this.finalTransform.mat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v),this.renderInnerContent(),this.globalData.renderer.restore($r),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement;function CVShapeData(Tr,Cr,$r,Ar){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var Rr=4;Cr.ty==="rc"?Rr=5:Cr.ty==="el"?Rr=6:Cr.ty==="sr"&&(Rr=7),this.sh=ShapePropertyFactory.getShapeProp(Tr,Cr,Rr,Tr);var Dr,Mr=$r.length,Br;for(Dr=0;Dr=0;Dr-=1){if(zr=this.searchProcessedElement(Tr[Dr]),zr?Cr[Dr]=$r[zr-1]:Tr[Dr]._shouldRender=Ar,Tr[Dr].ty==="fl"||Tr[Dr].ty==="st"||Tr[Dr].ty==="gf"||Tr[Dr].ty==="gs")zr?Cr[Dr].style.closed=!1:Cr[Dr]=this.createStyleElement(Tr[Dr],jr),Lr.push(Cr[Dr].style);else if(Tr[Dr].ty==="gr"){if(!zr)Cr[Dr]=this.createGroupElement(Tr[Dr]);else for(Nr=Cr[Dr].it.length,Br=0;Br=0;Rr-=1)Cr[Rr].ty==="tr"?(Mr=$r[Rr].transform,this.renderShapeTransform(Tr,Mr)):Cr[Rr].ty==="sh"||Cr[Rr].ty==="el"||Cr[Rr].ty==="rc"||Cr[Rr].ty==="sr"?this.renderPath(Cr[Rr],$r[Rr]):Cr[Rr].ty==="fl"?this.renderFill(Cr[Rr],$r[Rr],Mr):Cr[Rr].ty==="st"?this.renderStroke(Cr[Rr],$r[Rr],Mr):Cr[Rr].ty==="gf"||Cr[Rr].ty==="gs"?this.renderGradientFill(Cr[Rr],$r[Rr],Mr):Cr[Rr].ty==="gr"?this.renderShape(Mr,Cr[Rr].it,$r[Rr].it):Cr[Rr].ty;Ar&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(Tr,Cr){if(this._isFirstFrame||Cr._mdf||Tr.transforms._mdf){var $r=Tr.trNodes,Ar=Cr.paths,Rr,Dr,Mr,Br=Ar._length;$r.length=0;var Nr=Tr.transforms.finalTransform;for(Mr=0;Mr=1?Hr=.99:Hr<=-1&&(Hr=-.99);var zr=Nr*Hr,Ur=Math.cos(Lr+Cr.a.v)*zr+Mr[0],Vr=Math.sin(Lr+Cr.a.v)*zr+Mr[1];Rr=Dr.createRadialGradient(Ur,Vr,0,Mr[0],Mr[1],Nr)}var jr,Gr=Tr.g.p,Xr=Cr.g.c,Kr=1;for(jr=0;jrDr&&Nr==="xMidYMid slice"||RrRr&&Br==="meet"||DrRr&&Br==="slice")?this.transformCanvas.tx=($r-this.transformCanvas.w*(Ar/this.transformCanvas.h))/2*this.renderConfig.dpr:Lr==="xMax"&&(DrRr&&Br==="slice")?this.transformCanvas.tx=($r-this.transformCanvas.w*(Ar/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,Hr==="YMid"&&(Dr>Rr&&Br==="meet"||DrRr&&Br==="meet"||Dr=0;Tr-=1)this.elements[Tr]&&this.elements[Tr].destroy&&this.elements[Tr].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(Tr,Cr){if(!(this.renderedFrame===Tr&&this.renderConfig.clearCanvas===!0&&!Cr||this.destroyed||Tr===-1)){this.renderedFrame=Tr,this.globalData.frameNum=Tr-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||Cr,this.globalData.projectInterface.currentFrame=Tr;var $r,Ar=this.layers.length;for(this.completeLayers||this.checkLayers(Tr),$r=0;$r=0;$r-=1)(this.completeLayers||this.elements[$r])&&this.elements[$r].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(Tr){var Cr=this.elements;if(!(Cr[Tr]||this.layers[Tr].ty===99)){var $r=this.createItem(this.layers[Tr],this,this.globalData);Cr[Tr]=$r,$r.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var Tr=this.pendingElements.pop();Tr.checkParenting()}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"};function CVCompElement(Tr,Cr,$r){this.completeLayers=!1,this.layers=Tr.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(Tr,Cr,$r),this.tm=Tr.tm?PropertyFactory.getProp(this,Tr.tm,0,Cr.frameRate,this):{_placeholder:!0}}extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var Tr=this.canvasContext;Tr.beginPath(),Tr.moveTo(0,0),Tr.lineTo(this.data.w,0),Tr.lineTo(this.data.w,this.data.h),Tr.lineTo(0,this.data.h),Tr.lineTo(0,0),Tr.clip();var Cr,$r=this.layers.length;for(Cr=$r-1;Cr>=0;Cr-=1)(this.completeLayers||this.elements[Cr])&&this.elements[Cr].renderFrame()},CVCompElement.prototype.destroy=function(){var Tr,Cr=this.layers.length;for(Tr=Cr-1;Tr>=0;Tr-=1)this.elements[Tr]&&this.elements[Tr].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(Tr){return new CVCompElement(Tr,this.globalData,this)};function CanvasRenderer(Tr,Cr){this.animationItem=Tr,this.renderConfig={clearCanvas:Cr&&Cr.clearCanvas!==void 0?Cr.clearCanvas:!0,context:Cr&&Cr.context||null,progressiveLoad:Cr&&Cr.progressiveLoad||!1,preserveAspectRatio:Cr&&Cr.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:Cr&&Cr.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:Cr&&Cr.contentVisibility||"visible",className:Cr&&Cr.className||"",id:Cr&&Cr.id||"",runExpressions:!Cr||Cr.runExpressions===void 0||Cr.runExpressions},this.renderConfig.dpr=Cr&&Cr.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=Cr&&Cr.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas"}extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(Tr){return new CVCompElement(Tr,this.globalData,this)};function HBaseElement(){}HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects,this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),this.data.bm!==0&&this.setBlendMode()},renderElement:function(){var Cr=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var $r=this.finalTransform.mat.toCSS();Cr.transform=$r,Cr.webkitTransform=$r}this.finalTransform._opMdf&&(Cr.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting;function HSolidElement(Tr,Cr,$r){this.initElement(Tr,Cr,$r)}extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var Tr;this.data.hasMask?(Tr=createNS("rect"),Tr.setAttribute("width",this.data.sw),Tr.setAttribute("height",this.data.sh),Tr.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):(Tr=createTag("div"),Tr.style.width=this.data.sw+"px",Tr.style.height=this.data.sh+"px",Tr.style.backgroundColor=this.data.sc),this.layerElement.appendChild(Tr)};function HShapeElement(Tr,Cr,$r){this.shapes=[],this.shapesData=Tr.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(Tr,Cr,$r),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var Tr;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),Tr=this.svgElement;else{Tr=createNS("svg");var Cr=this.comp.data?this.comp.data:this.globalData.compSize;Tr.setAttribute("width",Cr.w),Tr.setAttribute("height",Cr.h),Tr.appendChild(this.shapesContainer),this.layerElement.appendChild(Tr)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=Tr},HShapeElement.prototype.getTransformedPoint=function(Tr,Cr){var $r,Ar=Tr.length;for($r=0;$r0&&Nr<1&&Rr[Ur].push(this.calculateF(Nr,Tr,Cr,$r,Ar,Ur))):(Lr=Mr*Mr-4*Br*Dr,Lr>=0&&(Hr=(-Mr+bmSqrt(Lr))/(2*Dr),Hr>0&&Hr<1&&Rr[Ur].push(this.calculateF(Hr,Tr,Cr,$r,Ar,Ur)),zr=(-Mr-bmSqrt(Lr))/(2*Dr),zr>0&&zr<1&&Rr[Ur].push(this.calculateF(zr,Tr,Cr,$r,Ar,Ur)))));this.shapeBoundingBox.left=bmMin.apply(null,Rr[0]),this.shapeBoundingBox.top=bmMin.apply(null,Rr[1]),this.shapeBoundingBox.right=bmMax.apply(null,Rr[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,Rr[1])},HShapeElement.prototype.calculateF=function(Tr,Cr,$r,Ar,Rr,Dr){return bmPow(1-Tr,3)*Cr[Dr]+3*bmPow(1-Tr,2)*Tr*$r[Dr]+3*(1-Tr)*bmPow(Tr,2)*Ar[Dr]+bmPow(Tr,3)*Rr[Dr]},HShapeElement.prototype.calculateBoundingBox=function(Tr,Cr){var $r,Ar=Tr.length;for($r=0;$r$r&&($r=Rr)}$r*=Tr.mult}else $r=Tr.v*Tr.mult;Cr.x-=$r,Cr.xMax+=$r,Cr.y-=$r,Cr.yMax+=$r},HShapeElement.prototype.currentBoxContains=function(Tr){return this.currentBBox.x<=Tr.x&&this.currentBBox.y<=Tr.y&&this.currentBBox.width+this.currentBBox.x>=Tr.x+Tr.width&&this.currentBBox.height+this.currentBBox.y>=Tr.y+Tr.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var Tr=this.tempBoundingBox,Cr=999999;if(Tr.x=Cr,Tr.xMax=-Cr,Tr.y=Cr,Tr.yMax=-Cr,this.calculateBoundingBox(this.itemsData,Tr),Tr.width=Tr.xMax=0;Cr-=1){var Ar=this.hierarchy[Cr].finalTransform.mProp;this.mat.translate(-Ar.p.v[0],-Ar.p.v[1],Ar.p.v[2]),this.mat.rotateX(-Ar.or.v[0]).rotateY(-Ar.or.v[1]).rotateZ(Ar.or.v[2]),this.mat.rotateX(-Ar.rx.v).rotateY(-Ar.ry.v).rotateZ(Ar.rz.v),this.mat.scale(1/Ar.s.v[0],1/Ar.s.v[1],1/Ar.s.v[2]),this.mat.translate(Ar.a.v[0],Ar.a.v[1],Ar.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var Rr;this.p?Rr=[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:Rr=[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var Dr=Math.sqrt(Math.pow(Rr[0],2)+Math.pow(Rr[1],2)+Math.pow(Rr[2],2)),Mr=[Rr[0]/Dr,Rr[1]/Dr,Rr[2]/Dr],Br=Math.sqrt(Mr[2]*Mr[2]+Mr[0]*Mr[0]),Nr=Math.atan2(Mr[1],Br),Lr=Math.atan2(Mr[0],-Mr[2]);this.mat.rotateY(Lr).rotateX(-Nr)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var Hr=!this._prevMat.equals(this.mat);if((Hr||this.pe._mdf)&&this.comp.threeDElements){$r=this.comp.threeDElements.length;var zr,Ur,Vr;for(Cr=0;Cr<$r;Cr+=1)if(zr=this.comp.threeDElements[Cr],zr.type==="3d"){if(Hr){var jr=this.mat.toCSS();Vr=zr.container.style,Vr.transform=jr,Vr.webkitTransform=jr}this.pe._mdf&&(Ur=zr.perspectiveElem.style,Ur.perspective=this.pe.v+"px",Ur.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(Tr){this.prepareProperties(Tr,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null};function HImageElement(Tr,Cr,$r){this.assetData=Cr.getAssetData(Tr.refId),this.initElement(Tr,Cr,$r)}extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var Tr=this.globalData.getAssetsPath(this.assetData),Cr=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",Tr),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(Cr),Cr.crossOrigin="anonymous",Cr.src=Tr,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)};function HybridRendererBase(Tr,Cr){this.animationItem=Tr,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:Cr&&Cr.className||"",imagePreserveAspectRatio:Cr&&Cr.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(Cr&&Cr.hideOnTransparent===!1),filterSize:{width:Cr&&Cr.filterSize&&Cr.filterSize.width||"400%",height:Cr&&Cr.filterSize&&Cr.filterSize.height||"400%",x:Cr&&Cr.filterSize&&Cr.filterSize.x||"-100%",y:Cr&&Cr.filterSize&&Cr.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var Tr=this.pendingElements.pop();Tr.checkParenting()}},HybridRendererBase.prototype.appendElementInPos=function(Tr,Cr){var $r=Tr.getBaseElement();if($r){var Ar=this.layers[Cr];if(!Ar.ddd||!this.supports3d)if(this.threeDElements)this.addTo3dContainer($r,Cr);else{for(var Rr=0,Dr,Mr,Br;Rr=Tr)return this.threeDElements[Cr].perspectiveElem;Cr+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(Tr,Cr){var $r=createTag("div"),Ar,Rr;styleDiv($r);var Dr=createTag("div");if(styleDiv(Dr),Cr==="3d"){Ar=$r.style,Ar.width=this.globalData.compSize.w+"px",Ar.height=this.globalData.compSize.h+"px";var Mr="50% 50%";Ar.webkitTransformOrigin=Mr,Ar.mozTransformOrigin=Mr,Ar.transformOrigin=Mr,Rr=Dr.style;var Br="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";Rr.transform=Br,Rr.webkitTransform=Br}$r.appendChild(Dr);var Nr={container:Dr,perspectiveElem:$r,startPos:Tr,endPos:Tr,type:Cr};return this.threeDElements.push(Nr),Nr},HybridRendererBase.prototype.build3dContainers=function(){var Tr,Cr=this.layers.length,$r,Ar="";for(Tr=0;Tr=0;Tr-=1)this.resizerElem.appendChild(this.threeDElements[Tr].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(Tr,Cr){for(var $r=0,Ar=this.threeDElements.length;$r$r?(Rr=Tr/this.globalData.compSize.w,Dr=Tr/this.globalData.compSize.w,Mr=0,Br=(Cr-this.globalData.compSize.h*(Tr/this.globalData.compSize.w))/2):(Rr=Cr/this.globalData.compSize.h,Dr=Cr/this.globalData.compSize.h,Mr=(Tr-this.globalData.compSize.w*(Cr/this.globalData.compSize.h))/2,Br=0);var Nr=this.resizerElem.style;Nr.webkitTransform="matrix3d("+Rr+",0,0,0,0,"+Dr+",0,0,0,0,1,0,"+Mr+","+Br+",0,1)",Nr.transform=Nr.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var Tr=this.globalData.compSize.w,Cr=this.globalData.compSize.h,$r,Ar=this.threeDElements.length;for($r=0;$r=Lr;)lo/=2,po/=2,go>>>=1;return(lo+go)/po};return so.int32=function(){return ro.g(4)|0},so.quick=function(){return ro.g(4)/4294967296},so.double=so,Xr(Zr(ro.S),Tr),(Wr.pass||Yr||function(ao,lo,po,go){return go&&(go.S&&jr(go,ro),ao.state=function(){return jr(ro,{})}),po?(Cr[Mr]=ao,lo):ao})(so,no,"global"in Wr?Wr.global:this==Cr,Wr.state)}Cr["seed"+Mr]=Ur;function Vr(eo){var Wr,Yr=eo.length,Jr=this,no=0,ro=Jr.i=Jr.j=0,so=Jr.S=[];for(Yr||(eo=[Yr++]);no$r){var Ar=$r;$r=Cr,Cr=Ar}return Math.min(Math.max(Tr,Cr),$r)}function radiansToDegrees(Tr){return Tr/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(Tr){return Tr*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(Tr,Cr){if(typeof Tr=="number"||Tr instanceof Number)return Cr=Cr||0,Math.abs(Tr-Cr);Cr||(Cr=helperLengthArray);var $r,Ar=Math.min(Tr.length,Cr.length),Rr=0;for($r=0;$r.5?Lr/(2-Rr-Dr):Lr/(Rr+Dr),Rr){case Cr:Mr=($r-Ar)/Lr+($r1&&($r-=1),$r<1/6?Tr+(Cr-Tr)*6*$r:$r<1/2?Cr:$r<2/3?Tr+(Cr-Tr)*(2/3-$r)*6:Tr}function hslToRgb(Tr){var Cr=Tr[0],$r=Tr[1],Ar=Tr[2],Rr,Dr,Mr;if($r===0)Rr=Ar,Mr=Ar,Dr=Ar;else{var Br=Ar<.5?Ar*(1+$r):Ar+$r-Ar*$r,Nr=2*Ar-Br;Rr=hue2rgb(Nr,Br,Cr+1/3),Dr=hue2rgb(Nr,Br,Cr),Mr=hue2rgb(Nr,Br,Cr-1/3)}return[Rr,Dr,Mr,Tr[3]]}function linear(Tr,Cr,$r,Ar,Rr){if((Ar===void 0||Rr===void 0)&&(Ar=Cr,Rr=$r,Cr=0,$r=1),$r=$r)return Rr;var Mr=$r===Cr?0:(Tr-Cr)/($r-Cr);if(!Ar.length)return Ar+(Rr-Ar)*Mr;var Br,Nr=Ar.length,Lr=createTypedArray("float32",Nr);for(Br=0;Br1){for(Rr=0;Rr1?Cr=1:Cr<0&&(Cr=0);var Mr=Tr(Cr);if($bm_isInstanceOfArray(Rr)){var Br,Nr=Rr.length,Lr=createTypedArray("float32",Nr);for(Br=0;Brdata.k[Cr].t&&Trdata.k[Cr+1].t-Tr?(Ar=Cr+2,Rr=data.k[Cr+1].t):(Ar=Cr+1,Rr=data.k[Cr].t);break}Ar===-1&&(Ar=Cr+1,Rr=data.k[Cr].t)}var Dr={};return Dr.index=Ar,Dr.time=Rr/elem.comp.globalData.frameRate,Dr}function key(Tr){var Cr,$r,Ar;if(!data.k.length||typeof data.k[0]=="number")throw new Error("The property has no keyframe at index "+Tr);Tr-=1,Cr={time:data.k[Tr].t/elem.comp.globalData.frameRate,value:[]};var Rr=Object.prototype.hasOwnProperty.call(data.k[Tr],"s")?data.k[Tr].s:data.k[Tr-1].e;for(Ar=Rr.length,$r=0;$rXr.length-1)&&(Vr=Xr.length-1),eo=Xr[Xr.length-1-Vr].t,Zr=Kr-eo);var Wr,Yr,Jr;if(Ur==="pingpong"){var no=Math.floor((Gr-eo)/Zr);if(no%2!==0)return this.getValueAtTime((Zr-(Gr-eo)%Zr+eo)/this.comp.globalData.frameRate,0)}else if(Ur==="offset"){var ro=this.getValueAtTime(eo/this.comp.globalData.frameRate,0),so=this.getValueAtTime(Kr/this.comp.globalData.frameRate,0),ao=this.getValueAtTime(((Gr-eo)%Zr+eo)/this.comp.globalData.frameRate,0),lo=Math.floor((Gr-eo)/Zr);if(this.pv.length){for(Jr=new Array(ro.length),Yr=Jr.length,Wr=0;Wr=Kr)return this.pv;var Zr,eo;jr?(Vr?Zr=Math.abs(this.elem.comp.globalData.frameRate*Vr):Zr=Math.max(0,this.elem.data.op-Kr),eo=Kr+Zr):((!Vr||Vr>Xr.length-1)&&(Vr=Xr.length-1),eo=Xr[Vr].t,Zr=eo-Kr);var Wr,Yr,Jr;if(Ur==="pingpong"){var no=Math.floor((Kr-Gr)/Zr);if(no%2===0)return this.getValueAtTime(((Kr-Gr)%Zr+Kr)/this.comp.globalData.frameRate,0)}else if(Ur==="offset"){var ro=this.getValueAtTime(Kr/this.comp.globalData.frameRate,0),so=this.getValueAtTime(eo/this.comp.globalData.frameRate,0),ao=this.getValueAtTime((Zr-(Kr-Gr)%Zr+Kr)/this.comp.globalData.frameRate,0),lo=Math.floor((Kr-Gr)/Zr)+1;if(this.pv.length){for(Jr=new Array(ro.length),Yr=Jr.length,Wr=0;Wr1?(Xr-Gr)/(Vr-1):1,Zr=0,eo=0,Wr;this.pv.length?Wr=createTypedArray("float32",this.pv.length):Wr=0;for(var Yr;ZrZr){var no=eo,ro=Gr.c&&eo===Wr-1?0:eo+1,so=(Zr-Yr)/Kr[eo].addedLength;Jr=bez.getPointInSegment(Gr.v[no],Gr.v[ro],Gr.o[no],Gr.i[ro],so,Kr[eo]);break}else Yr+=Kr[eo].addedLength;eo+=1}return Jr||(Jr=Gr.c?[Gr.v[0][0],Gr.v[0][1]]:[Gr.v[Gr._length-1][0],Gr.v[Gr._length-1][1]]),Jr},vectorOnPath:function(Vr,jr,Gr){Vr==1?Vr=this.v.c:Vr==0&&(Vr=.999);var Xr=this.pointOnPath(Vr,jr),Kr=this.pointOnPath(Vr+.001,jr),Zr=Kr[0]-Xr[0],eo=Kr[1]-Xr[1],Wr=Math.sqrt(Math.pow(Zr,2)+Math.pow(eo,2));if(Wr===0)return[0,0];var Yr=Gr==="tangent"?[Zr/Wr,eo/Wr]:[-eo/Wr,Zr/Wr];return Yr},tangentOnPath:function(Vr,jr){return this.vectorOnPath(Vr,jr,"tangent")},normalOnPath:function(Vr,jr){return this.vectorOnPath(Vr,jr,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([Hr],Nr),extendPrototype([Hr],Lr),Lr.prototype.getValueAtTime=Br,Lr.prototype.initiateExpression=ExpressionManager.initiateExpression;var zr=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(Ur,Vr,jr,Gr,Xr){var Kr=zr(Ur,Vr,jr,Gr,Xr);return Kr.propertyIndex=Vr.ix,Kr.lock=!1,jr===3?expressionHelpers.searchExpressions(Ur,Vr.pt,Kr):jr===4&&expressionHelpers.searchExpressions(Ur,Vr.ks,Kr),Kr.k&&Ur.addDynamicProperty(Kr),Kr}}function initialize$1(){addPropertyDecorator()}function addDecorator(){function Tr(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(Cr,$r){var Ar=this.calculateExpression($r);if(Cr.t!==Ar){var Rr={};return this.copyData(Rr,Cr),Rr.t=Ar.toString(),Rr.__complete=!1,Rr}return Cr},TextProperty.prototype.searchProperty=function(){var Cr=this.searchKeyframes(),$r=this.searchExpressions();return this.kf=Cr||$r,this.kf},TextProperty.prototype.searchExpressions=Tr}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function Tr(Cr,$r){var Ar=createNS("feMerge");Ar.setAttribute("result",Cr);var Rr,Dr;for(Dr=0;Dr<$r.length;Dr+=1)Rr=createNS("feMergeNode"),Rr.setAttribute("in",$r[Dr]),Ar.appendChild(Rr),Ar.appendChild(Rr);return Ar}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(Tr,Cr,$r,Ar,Rr){this.filterManager=Cr;var Dr=createNS("feColorMatrix");Dr.setAttribute("type","matrix"),Dr.setAttribute("color-interpolation-filters","linearRGB"),Dr.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=Dr,Dr.setAttribute("result",Ar+"_tint_1"),Tr.appendChild(Dr),Dr=createNS("feColorMatrix"),Dr.setAttribute("type","matrix"),Dr.setAttribute("color-interpolation-filters","sRGB"),Dr.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),Dr.setAttribute("result",Ar+"_tint_2"),Tr.appendChild(Dr),this.matrixFilter=Dr;var Mr=this.createMergeNode(Ar,[Rr,Ar+"_tint_1",Ar+"_tint_2"]);Tr.appendChild(Mr)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(Tr){if(Tr||this.filterManager._mdf){var Cr=this.filterManager.effectElements[0].p.v,$r=this.filterManager.effectElements[1].p.v,Ar=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+Ar+" 0"),this.matrixFilter.setAttribute("values",$r[0]-Cr[0]+" 0 0 0 "+Cr[0]+" "+($r[1]-Cr[1])+" 0 0 0 "+Cr[1]+" "+($r[2]-Cr[2])+" 0 0 0 "+Cr[2]+" 0 0 0 1 0")}};function SVGFillFilter(Tr,Cr,$r,Ar){this.filterManager=Cr;var Rr=createNS("feColorMatrix");Rr.setAttribute("type","matrix"),Rr.setAttribute("color-interpolation-filters","sRGB"),Rr.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),Rr.setAttribute("result",Ar),Tr.appendChild(Rr),this.matrixFilter=Rr}SVGFillFilter.prototype.renderFrame=function(Tr){if(Tr||this.filterManager._mdf){var Cr=this.filterManager.effectElements[2].p.v,$r=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+Cr[0]+" 0 0 0 0 "+Cr[1]+" 0 0 0 0 "+Cr[2]+" 0 0 0 "+$r+" 0")}};function SVGStrokeEffect(Tr,Cr,$r){this.initialized=!1,this.filterManager=Cr,this.elem=$r,this.paths=[]}SVGStrokeEffect.prototype.initialize=function(){var Tr=this.elem.layerElement.children||this.elem.layerElement.childNodes,Cr,$r,Ar,Rr;for(this.filterManager.effectElements[1].p.v===1?(Rr=this.elem.maskManager.masksProperties.length,Ar=0):(Ar=this.filterManager.effectElements[0].p.v-1,Rr=Ar+1),$r=createNS("g"),$r.setAttribute("fill","none"),$r.setAttribute("stroke-linecap","round"),$r.setAttribute("stroke-dashoffset",1),Ar;Ar=Lr?zr=jr<0?Ar:Rr:zr=Ar+Vr*Math.pow((Br-Tr)/jr,1/$r),Hr[Ur]=zr,Ur+=1,Dr+=256/(Mr-1);return Hr.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(Tr){if(Tr||this.filterManager._mdf){var Cr,$r=this.filterManager.effectElements;this.feFuncRComposed&&(Tr||$r[3].p._mdf||$r[4].p._mdf||$r[5].p._mdf||$r[6].p._mdf||$r[7].p._mdf)&&(Cr=this.getTableValue($r[3].p.v,$r[4].p.v,$r[5].p.v,$r[6].p.v,$r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",Cr),this.feFuncGComposed.setAttribute("tableValues",Cr),this.feFuncBComposed.setAttribute("tableValues",Cr)),this.feFuncR&&(Tr||$r[10].p._mdf||$r[11].p._mdf||$r[12].p._mdf||$r[13].p._mdf||$r[14].p._mdf)&&(Cr=this.getTableValue($r[10].p.v,$r[11].p.v,$r[12].p.v,$r[13].p.v,$r[14].p.v),this.feFuncR.setAttribute("tableValues",Cr)),this.feFuncG&&(Tr||$r[17].p._mdf||$r[18].p._mdf||$r[19].p._mdf||$r[20].p._mdf||$r[21].p._mdf)&&(Cr=this.getTableValue($r[17].p.v,$r[18].p.v,$r[19].p.v,$r[20].p.v,$r[21].p.v),this.feFuncG.setAttribute("tableValues",Cr)),this.feFuncB&&(Tr||$r[24].p._mdf||$r[25].p._mdf||$r[26].p._mdf||$r[27].p._mdf||$r[28].p._mdf)&&(Cr=this.getTableValue($r[24].p.v,$r[25].p.v,$r[26].p.v,$r[27].p.v,$r[28].p.v),this.feFuncB.setAttribute("tableValues",Cr)),this.feFuncA&&(Tr||$r[31].p._mdf||$r[32].p._mdf||$r[33].p._mdf||$r[34].p._mdf||$r[35].p._mdf)&&(Cr=this.getTableValue($r[31].p.v,$r[32].p.v,$r[33].p.v,$r[34].p.v,$r[35].p.v),this.feFuncA.setAttribute("tableValues",Cr))}};function SVGDropShadowEffect(Tr,Cr,$r,Ar,Rr){var Dr=Cr.container.globalData.renderConfig.filterSize,Mr=Cr.data.fs||Dr;Tr.setAttribute("x",Mr.x||Dr.x),Tr.setAttribute("y",Mr.y||Dr.y),Tr.setAttribute("width",Mr.width||Dr.width),Tr.setAttribute("height",Mr.height||Dr.height),this.filterManager=Cr;var Br=createNS("feGaussianBlur");Br.setAttribute("in","SourceAlpha"),Br.setAttribute("result",Ar+"_drop_shadow_1"),Br.setAttribute("stdDeviation","0"),this.feGaussianBlur=Br,Tr.appendChild(Br);var Nr=createNS("feOffset");Nr.setAttribute("dx","25"),Nr.setAttribute("dy","0"),Nr.setAttribute("in",Ar+"_drop_shadow_1"),Nr.setAttribute("result",Ar+"_drop_shadow_2"),this.feOffset=Nr,Tr.appendChild(Nr);var Lr=createNS("feFlood");Lr.setAttribute("flood-color","#00ff00"),Lr.setAttribute("flood-opacity","1"),Lr.setAttribute("result",Ar+"_drop_shadow_3"),this.feFlood=Lr,Tr.appendChild(Lr);var Hr=createNS("feComposite");Hr.setAttribute("in",Ar+"_drop_shadow_3"),Hr.setAttribute("in2",Ar+"_drop_shadow_2"),Hr.setAttribute("operator","in"),Hr.setAttribute("result",Ar+"_drop_shadow_4"),Tr.appendChild(Hr);var zr=this.createMergeNode(Ar,[Ar+"_drop_shadow_4",Rr]);Tr.appendChild(zr)}extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(Tr){if(Tr||this.filterManager._mdf){if((Tr||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),Tr||this.filterManager.effectElements[0].p._mdf){var Cr=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(Cr[0]*255),Math.round(Cr[1]*255),Math.round(Cr[2]*255)))}if((Tr||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),Tr||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var $r=this.filterManager.effectElements[3].p.v,Ar=(this.filterManager.effectElements[2].p.v-90)*degToRads,Rr=$r*Math.cos(Ar),Dr=$r*Math.sin(Ar);this.feOffset.setAttribute("dx",Rr),this.feOffset.setAttribute("dy",Dr)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(Tr,Cr,$r){this.initialized=!1,this.filterManager=Cr,this.filterElem=Tr,this.elem=$r,$r.matteElement=createNS("g"),$r.matteElement.appendChild($r.layerElement),$r.matteElement.appendChild($r.transformedElement),$r.baseElement=$r.matteElement}SVGMatte3Effect.prototype.findSymbol=function(Tr){for(var Cr=0,$r=_svgMatteSymbols.length;Cr<$r;){if(_svgMatteSymbols[Cr]===Tr)return _svgMatteSymbols[Cr];Cr+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(Tr,Cr){var $r=Tr.layerElement.parentNode;if($r){for(var Ar=$r.children,Rr=0,Dr=Ar.length;Rr{var Rr;Cr.value.style.display="block",(Rr=$r.value)==null||Rr.play()};return onMounted(()=>{$r.value=lottie.loadAnimation({container:Cr.value,path:Object.values(Object.assign({"/assets/animations/globe.json":__vite_glob_0_0}))[0],renderer:"svg",loop:!0,autoplay:!0}),Ar()}),(Rr,Dr)=>(openBlock(),createElementBlock("div",_hoisted_1$8,[createBaseVNode("div",{ref_key:"lottieEl",ref:Cr,class:"lottie-container"},null,512)]))}}),GlobeAnimation_vue_vue_type_style_index_0_scoped_6e500e21_lang="",GlobeAnimation=_export_sfc(_sfc_main$f,[["__scopeId","data-v-6e500e21"]]),_hoisted_1$7={class:"w-full p-4"},_hoisted_2$6={key:0,class:"flex flex-col gap-3"},_hoisted_3$6=createBaseVNode("div",{class:"flex flex-col text-[#2EA5FB] gap-1"},[createBaseVNode("div",{class:"font-medium text-sm flex items-center gap-1 cursor-pointer"},[createTextVNode(" Customize your URL "),createBaseVNode("label",{class:"flex items-center bg-[#69C567] text-[10px] text-white h-4 px-1 rounded"},"New")]),createBaseVNode("label",{class:"text-xs cursor-pointer"},"Go to settings to set up your domain")],-1),_hoisted_4$5={class:"flex items-center gap-1 custom-truncate px-2 py-2.5 bg-neutralSolid-50 rounded-lg"},_hoisted_5$4={class:"text-neutralSolid-500 text-sm"},_hoisted_6$3={key:1,class:"flex flex-col gap-1.5"},_hoisted_7$3={class:"flex items-center sm:max-w-[165px]"},_hoisted_8$3={class:"text-neutralSolid-500 cursor-default text-ellipsis ellipsis shrink ml-auto"},_hoisted_9$3={class:"text-neutralSolid-500 cursor-default shrink-0"},_hoisted_10$3={class:"flex grow whitespace-nowrap overflow-hidden text-sm font-medium"},_hoisted_11$1=["value","readonly"],_hoisted_12$1={key:0,class:"rounded-full min-w-[18px] min-h-[18px] flex items-center justify-center bg-[#19835E]"},_hoisted_13$1={key:1,class:"rounded-full min-w-[18px] min-h-[18px] flex items-center justify-center"},_hoisted_14$1={class:"flex justify-between text-xs whitespace-nowrap flex-col sm:flex-row"},_hoisted_15$1={key:0,class:"text-[#DB3033]"},_sfc_main$e=defineComponent({__name:"PublishLink",props:{appId:{},open:{type:Boolean}},emits:["close","clicked-settings"],setup(Tr,{expose:Cr,emit:$r}){const Ar=Tr,Rr=$r,Dr=inject("isMobile"),Mr=ref(""),Br=ref(""),Nr=ref(),Lr=ref(),Hr=ref(!1),zr=ref(!1),Ur=ref(!1),Vr=useAppStore(),jr=useMiscStore(),Gr=useUserStore(),Xr=computed(()=>Gr.isAdmin(Gr.currentOrgId)),Kr=computed(()=>Gr.currentOrgId||""),Zr=computed(()=>{var mo;return(mo=Gr.orgs[Kr.value])==null?void 0:mo.orgs.subdomain}),eo=computed(()=>Vr.getPublicURL({appId:Ar.appId})),Wr=computed(()=>!!Zr.value),Yr=computed(()=>getPublishedDomain()),Jr=computed(()=>Zr.value?`${Zr.value}.${Yr.value}`:eo.value.split("/").slice(0,-1).join("/")??""),no=computed(()=>Vr.publicPaths[Ar.appId]),{focused:ro}=useFocusWithin(Nr),so=()=>{posthogCapture("publish-link-customize-url-banner-clicked"),Lr.value.el&&Lr.value.el.focus()},ao=debounce$1(async mo=>{const io=cleanPartOfLink(mo),{data:uo,error:ho}=await updatePathname({deckId:Ar.appId,path:io});if(ho){console.error(ho);return}zr.value=!1;const yo=uo;Vr.publicPaths[Ar.appId]=yo},250),lo=debounce$1(async mo=>{const io=cleanPartOfLink(mo),{data:uo,error:ho}=await validatePathname({deckId:Ar.appId,orgId:Kr.value,path:io});if(ho){console.error(ho);return}Hr.value=!1;const{status:yo,msg:So}=uo;yo===200?(Mr.value="",zr.value=!0,ao(io)):Mr.value=So},500),po=mo=>{const io=cleanPartOfLink(mo);Lr.value.value=io,Br.value=io,Hr.value=!0,lo(io)},go=()=>{if(posthogCapture("publish-link-customize-url-button-clicked"),Dr.value){Rr("clicked-settings");return}Rr("close"),jr.setShowSettingsModal({show:!0,startingSectionId:"workspace"})},co=()=>{no.value!=null?Br.value=no.value:Br.value=eo.value.split("/").slice(-1)[0]??"",Mr.value=""};return onMounted(()=>{co()}),watch(()=>Ar.open,mo=>{mo&&co()}),Cr({localSuffix:Br}),(mo,io)=>(openBlock(),createElementBlock("div",_hoisted_1$7,[Zr.value?(openBlock(),createElementBlock("div",_hoisted_6$3,[createBaseVNode("div",{class:normalizeClass(["flex items-center w-full",{"flex-col":unref(Dr)}])},[createBaseVNode("div",{class:normalizeClass(["flex items-center gap-1 px-2 py-2.5 h-[38px] bg-neutralSolid-50 text-sm",{"border-[1px] border-neutralSolid-50 border-r-0 rounded-l-lg":!unref(Dr),"rounded-t-lg w-full":unref(Dr)}]),style:normalizeStyle(unref(Dr)?{}:{maxWidth:"199px"})},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-globe-gray.svg"),class:"flex items-center justify-center shrink-0"},null,8,["src"]),createBaseVNode("div",_hoisted_7$3,[createBaseVNode("div",_hoisted_8$3,toDisplayString(Zr.value),1),createBaseVNode("div",_hoisted_9$3,"."+toDisplayString(Yr.value)+"/",1)])],6),createBaseVNode("div",{class:normalizeClass(["flex grow items-center gap-1 py-2 px-2.5 border-[1px]",{"border-brand-purple":unref(ro)&&Wr.value,"border-neutralSolid-50 bg-neutralSolid-50 text-neutralSolid-600":!unref(ro),"border-l-[#0000001F]":!unref(ro)&&!unref(Dr),"rounded-r-lg":!unref(Dr),"bg-neutralSolid-50":!Wr.value,"border-[#0000001F]":unref(ro)&&!Wr.value,"w-full rounded-b-lg":unref(Dr),"border-t-[#0000001F]":unref(Dr)&&!unref(ro)}]),style:normalizeStyle(Mr.value?{border:"1px solid #DB3033"}:{}),ref_key:"inputWrapper",ref:Nr,onClick:so},[createBaseVNode("p",_hoisted_10$3,[createBaseVNode("input",{ref_key:"input",ref:Lr,value:Br.value,readonly:!Wr.value,spellcheck:"false",class:normalizeClass(["bg-transparent grow",{"text-neutralSolid-1000":Wr.value,"text-neutralSolid-400":!Wr.value}]),onInput:io[2]||(io[2]=uo=>{if(uo.preventDefault(),!uo.target)return;const ho=uo.target.value;po(ho)}),onKeydown:io[3]||(io[3]=withKeys(withModifiers(()=>{po(Br.value),Lr.value.blur()},["prevent"]),["enter"]))},null,42,_hoisted_11$1)]),Wr.value&&!Mr.value&&!zr.value&&!Hr.value?(openBlock(),createElementBlock("div",_hoisted_12$1,[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-check.svg"),vProps:{width:14,height:14,stroke:"white"}},null,8,["src"])])):Wr.value&&Mr.value&&!Hr.value?(openBlock(),createElementBlock("div",_hoisted_13$1,[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-warning-2.svg"),vProps:{width:18,height:18}},null,8,["src"])])):Wr.value?(openBlock(),createBlock(LoaderCircle,{key:2,color:"#AB67FF",padding:"0"})):createCommentVNode("",!0)],6)],2),createBaseVNode("div",_hoisted_14$1,[createBaseVNode("p",{class:"text-neutralSolid-600"},[createTextVNode(" Customize your domain in "),createBaseVNode("span",{class:"font-medium underline cursor-pointer",onClick:go},"settings")]),Mr.value?(openBlock(),createElementBlock("p",_hoisted_15$1,toDisplayString(Mr.value),1)):createCommentVNode("",!0)])])):(openBlock(),createElementBlock("div",_hoisted_2$6,[Xr.value?(openBlock(),createElementBlock("div",{key:0,onMouseenter:io[0]||(io[0]=uo=>Ur.value=!0),onMouseleave:io[1]||(io[1]=uo=>Ur.value=!1),style:normalizeStyle({background:Ur.value?unref(theme).getSofterColor("#E7F2FF",.04):"#E7F2FF"}),onClick:go,class:"three-part-btn rounded-xl p-4 pr-2 gap-3"},[createVNode(GlobeAnimation),_hoisted_3$6,createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-chevron-right.svg"),vProps:{width:16,height:16,nestedFill:"#2EA5FB"}},null,8,["src"])],36)):createCommentVNode("",!0),createBaseVNode("div",_hoisted_4$5,[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-globe-gray.svg")},null,8,["src"]),createBaseVNode("div",_hoisted_5$4,toDisplayString(Jr.value)+"/"+toDisplayString(Br.value),1)])]))]))}}),usePublishSettings=({deckId:Tr})=>{const Cr=useAppStore(),$r=useUserStore(),Ar=ref(!1),Rr=ref(!1);ref(!1);const Dr=ref(null);computed(()=>window.location.href);const Mr=computed(()=>$r.currentOrgId||""),Br=computed(()=>{var Kr;return(Kr=$r.orgs[Mr.value])==null?void 0:Kr.orgs.subdomain}),Nr=computed(()=>Cr.getPublicURL({appId:Tr})),Lr=computed(()=>Br.value?`https://${Br.value}.${getPublishedDomain()}`:Nr.value.split("/").slice(0,-1).join("/").toLowerCase()??""),Hr=computed(()=>{var Kr;return Br.value&&Cr.publicPaths[Tr]!=null?Cr.publicPaths[Tr]:((Kr=Nr.value.split("/").slice(-1)[0])==null?void 0:Kr.toLowerCase())??""}),zr=computed(()=>`${Lr.value}/${Hr.value}`),Ur=computed(()=>Cr.deckThemeValue(Tr)),Vr=computed(()=>Cr.appObject(Tr).owner_id===$r.currentUserId),jr=async Kr=>{var Zr;if(await Cr.updateProps(Tr,{keyPath:["is_public"],value:Kr}),Kr){const eo=(Zr=Dr.value)==null?void 0:Zr.localSuffix;$r.currentOrgId&&await handlePublishing({deckId:Tr,orgId:$r.currentOrgId,path:eo??""})}posthogCapture(`share ${Kr?"on":"off"}`,{app_id:Tr,is_public:Kr})},Gr=async(Kr,Zr=!0)=>{var eo;if(Ar.value=Kr,Ar.value&&Zr&&(Rr.value=!0),await jr(Ar.value),Ar.value&&Zr&&(Rr.value=!1),Br.value&&!Cr.publicPaths[Tr]){const Wr=(eo=Dr.value)==null?void 0:eo.localSuffix;Wr&&(Cr.publicPaths[Tr]=Wr)}if(Ar.value)try{posthogCapture("published prezo",{link:zr.value,appId:Tr,subdomain:Br.value,title:Cr.title(Tr),current_time:new Date().getTime(),created_at:new Date(Cr.createdAt(Tr)??"").getTime(),time_diff:new Date().getTime()-new Date(Cr.createdAt(Tr)??"").getTime()})}catch(Wr){console.error("error in posthog capture",Wr)}},Xr=()=>{Gr(!Ar.value)};return onMounted(()=>{var Kr;Ar.value=((Kr=Cr.appObject(Tr))==null?void 0:Kr.is_public)??!1}),{clickedPublish:Gr,togglePublish:Xr,isPublished:Ar,deckThemeValue:Ur,isDeckOwner:Vr,publishLink:zr}},_hoisted_1$6={class:"flex flex-col"},_hoisted_2$5={class:"flex items-center justify-between p-2"},_hoisted_3$5={class:"flex gap-2 items-center justify-center relative"},_hoisted_4$4=createBaseVNode("p",{class:"font-[500] text-[16px] leading-[21.12px] text-[#0D0C0C]"},"Publish to web",-1),_hoisted_5$3=createBaseVNode("p",{class:"text-base font-medium"},"Share link",-1),_sfc_main$d=defineComponent({__name:"SharingPublish",props:{deckId:{},open:{type:Boolean}},emits:["close","clicked-settings"],setup(Tr,{emit:Cr}){const $r=Tr,Ar=Cr,Rr=inject("isMobile"),{deckThemeValue:Dr,isDeckOwner:Mr,togglePublish:Br,isPublished:Nr,publishLink:Lr}=usePublishSettings({deckId:$r.deckId}),Hr=()=>{Rr.value&&(navigator&&navigator.share({url:Lr.value}),Ar("close"))};return(zr,Ur)=>(openBlock(),createElementBlock("div",_hoisted_1$6,[unref(Rr)?(openBlock(),createBlock(_sfc_main$1p,{key:0,title:"Publish to web",onTappedClose:Ur[0]||(Ur[0]=Vr=>zr.$emit("close")),class:"mb-0"})):createCommentVNode("",!0),createVNode(_sfc_main$e,{ref:"publishLinkUI",appId:zr.deckId,style:{"border-bottom":"1px solid #e7e7e7"},open:zr.open,onClose:Ur[1]||(Ur[1]=Vr=>Ar("close")),onClickedSettings:Ur[2]||(Ur[2]=Vr=>Ar("clicked-settings"))},null,8,["appId","open"]),createBaseVNode("div",_hoisted_2$5,[createVNode(Button,{purpose:"transparent",hoverBackgroundOverride:unref(Rr)?"transparent":"rgba(0, 0, 0, 0.04)",activeBackgroundOverride:"rgba(0, 0, 0, 0.08)",style:normalizeStyle([{height:"38px",padding:"0"},{overflow:"hidden",borderRadius:"8px",padding:"8px 8px"}]),onClick:unref(Br)},{content:withCtx(({})=>[createBaseVNode("div",_hoisted_3$5,[createVNode(Toggle,{isOn:unref(Nr),coloredBackground:unref(Dr),style:{height:"32px",borderRadius:"8px",cursor:"pointer",marginLeft:"0px"},disabled:!unref(Mr)},null,8,["isOn","coloredBackground","disabled"]),_hoisted_4$4])]),_:1},8,["hoverBackgroundOverride","activeBackgroundOverride","onClick"]),createBaseVNode("button",{class:"flex items-center gap-1 py-1 px-2",onClick:Hr},[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-link.svg"),vProps:{width:20,height:20}},null,8,["src"]),_hoisted_5$3])])]))}}),_sfc_main$c=defineComponent({__name:"SharingPublishWrapper",setup(Tr){const Cr=useOverlayStore();inject("isMobile");const{currentAppId:$r}=inject("currentAppId"),Ar=computed(()=>Cr.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.PUBLISH_SETTINGS)),Rr=()=>{Cr.hideSlideInComponents(SLIDE_IN_COMPONENTS.PUBLISH_SETTINGS)},Dr=()=>{Cr.showSlideInComponent(SLIDE_IN_COMPONENTS.SUBDOMAIN_SETTINGS,{replace:SLIDE_IN_COMPONENTS.PUBLISH_SETTINGS})};return(Mr,Br)=>(openBlock(),createBlock(PrezoSlideIn,{show:Ar.value,onClose:Rr},{content:withCtx(({})=>[createVNode(_sfc_main$d,{onClose:Rr,onClickedSettings:Dr,deckId:unref($r)??"",open:Ar.value},null,8,["deckId","open"])]),_:1},8,["show"]))}}),_hoisted_1$5={class:"flex flex-col items-center"},_hoisted_2$4={class:"p-4 pt-0 flex flex-col items-center gap-3"},_hoisted_3$4=createBaseVNode("p",{class:"mb-3"},"this is the beginning of URL of all the published link",-1),_sfc_main$b=defineComponent({__name:"SubdomainEdit",setup(Tr){const Cr=inject("isMobile");useMiscStore();const $r=useUserStore(),Ar=ref(""),Rr=ref(""),Dr=ref(!1),Mr=ref(!1),Br=ref();ref("view"),ref("This is the beginning of the URL for all your published links."),inject("currentAppId");const Nr=computed(()=>$r.isAdmin($r.currentOrgId)),Lr=computed(()=>$r.currentOrgId||""),Hr=computed(()=>{var jr;return(jr=$r.orgs[Lr.value])==null?void 0:jr.orgs.subdomain}),zr=lodashExports.debounce(async jr=>{Mr.value=!0;const{data:Gr,error:Xr}=await validateSubdomain({subdomain:jr,orgId:Lr.value});if(Mr.value=!1,Xr||!Gr){console.error(Xr);return}const{valid:Kr,msg:Zr}=Gr;Kr?(Rr.value="",Dr.value=Ar.value!==Hr.value):(Rr.value=Zr,Dr.value=!1)},500),Ur=async()=>{if(!Dr.value)return;posthogCapture("workspace-settings-subdomain-save-clicked",{subdomain:Ar.value}),publishLog({channel:"custom-debugging",description:`subdomain: ${Ar.value}, userId: ${$r.currentUserId}`,event:"Subdomain setup by user"}),Dr.value=!1;const{data:jr,error:Gr}=await updateSubdomain({orgId:Lr.value,subdomain:Ar.value});if(Gr||!jr){console.error(Gr),Dr.value=!0;return}Dr.value=!0;const Xr=jr;if(!$r.orgs[Xr.id]){console.error(`Org ${Xr.id} not in pinia`);return}$r.orgs[Xr.id].orgs=Xr},Vr=jr=>{Dr.value=!1;const Gr=cleanPartOfLink(jr).toLowerCase();Ar.value=Gr,zr(Gr)};return onMounted(()=>{Hr.value!==null&&(Ar.value=Hr.value)}),(jr,Gr)=>(openBlock(),createElementBlock("div",_hoisted_1$5,[unref(Cr)?(openBlock(),createBlock(_sfc_main$1p,{key:0,title:"Setup domain",onTappedClose:Gr[0]||(Gr[0]=Xr=>jr.$emit("close")),class:"mb-0"})):createCommentVNode("",!0),createBaseVNode("div",_hoisted_2$4,[_hoisted_3$4,createVNode(DesignLibraryInput,{ref_key:"input",ref:Br,inputType:"input",disabled:!Nr.value,content:Ar.value,textareaStyle:{lineHeight:"21px",maxHeight:"21px"},wrapperStyle:{padding:"8px 10px",fontWeight:500},style:{flex:"1",width:"100%"},supportingText:"This will be the start of all your published websites' URLs",errorText:Rr.value,"onUpdate:content":Vr},{right:withCtx(()=>[createBaseVNode("label",{class:normalizeClass({"text-neutralSolid-400":!Nr.value,"text-neutralSolid-600":Nr.value})}," ."+toDisplayString(unref(getPublishedDomain)()),3)]),_:1},8,["disabled","content","errorText"]),Nr.value?(openBlock(),createBlock(Button,{key:0,style:normalizeStyle([{width:"100%",height:"42px",padding:"8px 16px",borderRadius:"8px"},Dr.value?{}:{pointerEvents:"none",opacity:.5}]),purpose:"primary",onClick:Ur},{content:withCtx(({textStyle:Xr})=>[Mr.value?(openBlock(),createBlock(LoaderCircle,{key:0,color:"white",padding:"0"})):(openBlock(),createElementBlock("label",{key:1,style:normalizeStyle([Xr,{fontSize:"16px"}])}," Save ",4))]),_:1},8,["style"])):createCommentVNode("",!0)])]))}}),_sfc_main$a=defineComponent({__name:"SubdomainEditWrapper",setup(Tr){const Cr=useOverlayStore();inject("isMobile"),inject("currentAppId");const $r=computed(()=>Cr.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.SUBDOMAIN_SETTINGS)),Ar=()=>{Cr.hideSlideInComponents(SLIDE_IN_COMPONENTS.SUBDOMAIN_SETTINGS)};return(Rr,Dr)=>(openBlock(),createBlock(PrezoSlideIn,{show:$r.value,onClose:Ar},{content:withCtx(({})=>[createVNode(_sfc_main$b,{onClose:Ar})]),_:1},8,["show"]))}}),_hoisted_1$4=["onClick"],_hoisted_2$3=["onClick"],_hoisted_3$3={key:0,style:{minWidth:"14px",display:"inline-flex",alignItems:"center"}},_hoisted_4$3={style:{minWidth:"16px",marginLeft:"auto"}},_sfc_main$9=defineComponent({__name:"StyledDropdownMenu",props:{items:{default:()=>[]},dropdownWidth:{default:180},useSameWidth:{type:Boolean},menuYGap:{default:4},placement:{},fallbackButtonProps:{},menuItemStyle:{},paddingBottomForMenu:{},selectedItemId:{},maxHeightProp:{default:500}},emits:["selected-item-id"],setup(Tr,{emit:Cr}){useCssVars(Yr=>({fc4f2cac:Lr.value.palette.neutral[0],"36ed5ce1":Lr.value.borderRadius.large,"08f99455":zr.value,f30b8954:Lr.value.fontSize.f4}));const $r=Cr,Ar=Tr,{items:Rr,fallbackButtonProps:Dr,menuYGap:Mr,dropdownWidth:Br}=toRefs$1(Ar),Nr=ref(null),Lr=computed(()=>theme.appTheme()),Hr=ref(Ar.maxHeightProp),zr=computed(()=>`${Hr.value}px`),Ur=useWindowSize(),Vr=computed(()=>{var Yr;return((Yr=Dr==null?void 0:Dr.value)==null?void 0:Yr.iconSize)??18}),jr=computed(()=>Math.min(Rr.value.length*36+10,Hr.value)),Gr=ref({top:0,left:0}),Xr=ref(0),Kr=async()=>{await nextTick();const Yr=Rr.value.find(ao=>ao.id===Ar.selectedItemId);if(!Yr)return;const Jr=Rr.value.indexOf(Yr),no=document.querySelector(".menu-items"),ro=no==null?void 0:no.querySelectorAll(".menu-item");if(!ro)return;const so=ro[Jr];so&&so.scrollIntoView({block:"nearest",behavior:"instant"})},Zr=Yr=>{Yr.preventDefault();const{top:Jr,bottom:no,right:ro,left:so,height:ao,width:lo}=Nr.value.getBoundingClientRect();Xr.value=lo;const po=Ar.useSameWidth?lo:Br.value;if(Ar.placement==="cover"){Gr.value={top:Jr,left:so},Kr();return}const go=no+Mr.value;if(Hr.value=Ar.maxHeightProp,go+jr.value>Ur.height.value?(Gr.value.top=Jr-jr.value-Mr.value,Gr.value.top<16&&(Hr.value=Jr-16-Mr.value,Gr.value.top=16)):Gr.value.top=go,Ar.placement==="center"){Gr.value.left=so+(ro-so)/2-po/2,Kr();return}if(Ar.placement==="left"){Gr.value.left=so,Kr();return}if(Ar.placement==="top"){Gr.value={left:so,bottom:Ur.height.value-no+ao+Mr.value,top:void 0},Kr();return}Gr.value.left=ro-po,Kr()},eo=computed(()=>{const Yr={};return Gr.value.top!=null&&(Yr.top=`${Gr.value.top}px`),Gr.value.bottom!=null&&(Yr.bottom=`${Gr.value.bottom}px`),Gr.value.left!=null&&(Yr.left=`${Gr.value.left}px`),Gr.value.right!=null&&(Yr.right=`${Gr.value.right}px`),Yr}),Wr=(Yr,Jr)=>{$r("selected-item-id",Jr==null?void 0:Jr.id)};return onMounted(()=>{if(!Nr.value)return;const{width:Yr}=Nr.value.getBoundingClientRect();Xr.value=Yr}),(Yr,Jr)=>{const no=__nuxt_component_0;return openBlock(),createBlock(unref(ge$2),{as:"div",class:"menu",nullable:""},{default:withCtx(({open:ro,close:so})=>[createBaseVNode("div",{ref_key:"element",ref:Nr,onClick:Zr,class:"flex w-full"},[createVNode(unref(Se$1),{class:"menu-button w-full"},{default:withCtx(()=>[renderSlot(Yr.$slots,"button",{open:ro},()=>[createVNode(BaseButton,{icon:{url:unref(assetUrl)("icon-more.svg"),size:`${Vr.value}px`},width:"24px",height:"24px"},null,8,["icon"])],!0)]),_:2},1024)],512),createVNode(no,null,{default:withCtx(()=>[(openBlock(),createBlock(Teleport,{to:"#main-app"},[createVNode(Transition,{name:"fade"},{default:withCtx(()=>[createVNode(unref(be),{as:"div",class:"menu-items headless-tracker popover-dropdown",style:normalizeStyle({zIndex:ro?1e3:0,...eo.value,width:Yr.useSameWidth?`${Xr.value}px`:`${unref(Br)}px`,paddingBottom:Yr.paddingBottomForMenu?`${Yr.paddingBottomForMenu}px`:void 0})},{default:withCtx(()=>[renderSlot(Yr.$slots,"custom-items",{close:so},void 0,!0),(openBlock(!0),createElementBlock(Fragment$1,null,renderList(unref(Rr),ao=>(openBlock(),createBlock(unref(Me),{as:"template",key:ao==null?void 0:ao.id,value:ao,class:"popover-dropdown"},{default:withCtx(({active:lo})=>[(ao==null?void 0:ao.type)==="boolean"?(openBlock(),createElementBlock("div",{key:0,class:"menu-item-toggle",style:normalizeStyle({background:lo?Lr.value.palette.neutral[50]:Lr.value.palette.neutral[0]})},[(ao==null?void 0:ao.type)==="boolean"?(openBlock(),createElementBlock("div",{key:0,class:"menu-item-toggle",style:normalizeStyle({background:lo?Lr.value.palette.neutral[50]:Lr.value.palette.neutral[0]})},[createBaseVNode("div",{onClick:withModifiers(po=>Wr(po,ao),["stop"]),class:"menu-item",style:normalizeStyle({background:lo?Lr.value.palette.neutral[100]:Lr.value.palette.neutral[0]})},[createBaseVNode("span",null,toDisplayString((ao==null?void 0:ao.name)||(ao==null?void 0:ao.label)),1),createVNode(Toggle,{isOn:!!ao.value,style:{marginLeft:"0px"}},null,8,["isOn"])],12,_hoisted_1$4)],4)):createCommentVNode("",!0)],4)):(openBlock(),createElementBlock("div",{key:1,onClick:po=>Wr(po,ao),class:"menu-item custom-truncate popover-dropdown",style:normalizeStyle({...Yr.menuItemStyle,background:lo?Lr.value.palette.neutral[50]:Lr.value.palette.neutral[0]})},[ao.icon?(openBlock(),createElementBlock("span",_hoisted_3$3,[createVNode(_sfc_main$1v,{src:unref(assetUrl)(ao.icon),vProps:{height:ao.isBig?18:14,width:ao.isBig?18:14}},null,8,["src","vProps"])])):createCommentVNode("",!0),createBaseVNode("div",{class:normalizeClass([{"text-[#DB3033]":ao.id==="delete"},"text-[14px] font-[400]"])},toDisplayString((ao==null?void 0:ao.name)||(ao==null?void 0:ao.label)),3),createBaseVNode("div",_hoisted_4$3,[Yr.selectedItemId===ao.id?(openBlock(),createBlock(_sfc_main$1v,{key:0,src:unref(assetUrl)("icon-check.svg"),"v-props":{width:"16px",height:"16px"}},null,8,["src"])):createCommentVNode("",!0)])],12,_hoisted_2$3))]),_:2},1032,["value"]))),128))]),_:2},1032,["style"])]),_:2},1024)]))]),_:2},1024)]),_:3})}}}),StyledDropdownMenu_vue_vue_type_style_index_0_scoped_cfe769bd_lang="",StyledDropdownMenu=_export_sfc(_sfc_main$9,[["__scopeId","data-v-cfe769bd"]]),_sfc_main$8=defineComponent({__name:"StyledDropdownMenuWrapper",props:{items:{default:()=>[]},selectedItemId:{},maxHeightProp:{},lightUpColor:{default:"#AB67FF"}},emits:["selected-item-id"],setup(Tr,{emit:Cr}){const $r=Cr,Ar=Tr,Rr=computed(()=>Ar.items.find(Dr=>Dr.id===Ar.selectedItemId));return(Dr,Mr)=>(openBlock(),createBlock(StyledDropdownMenu,{onSelectedItemId:Mr[0]||(Mr[0]=Br=>$r("selected-item-id",Br)),items:Dr.items,"fallback-button-props":{style:{backgroundColor:"transparent",padding:"0 4px",width:"100%"},hoverStyle:{backgroundColor:"rgba(0, 0, 0, 0.08)"}},"use-same-width":!0,"selected-item-id":Dr.selectedItemId,maxHeightProp:Dr.maxHeightProp},{button:withCtx(({open:Br})=>[createVNode(Button,{alignment:"flex-start",purpose:"secondary","background-override":Br?"transparent":"rgba(0, 0, 0, 0.04)","hover-background-override":"rgba(0, 0, 0, 0.08)","active-background-override":"rgba(0, 0, 0, 0.12)",style:normalizeStyle({padding:"8px 12px",height:"100%",fontWeight:500,fontSize:"16px",width:"100%",borderColor:Br?Dr.lightUpColor:"transparent"}),size:"large",class:"popoverOverrideAI border border-transparent"},{content:withCtx(()=>[createBaseVNode("div",{class:normalizeClass(["text-base flex-auto flex popoverOverrideAI font-[500] text-[16px]",{"text-[#0d0c0c]/[.42]":!Rr.value.label,"text-[#0D0C0C]":Rr.value.label}])},toDisplayString(Rr.value.label??"Select option"),3)]),right:withCtx(()=>[createVNode(_sfc_main$1v,{src:unref(assetUrl)("icon-chevron-down.svg"),vProps:{nestedFill:"#0D0C0C",width:16,height:16},class:"popoverOverrideAI"},null,8,["src"])]),_:2},1032,["background-override","hover-background-override","active-background-override","style"])]),_:1},8,["items","fallback-button-props","selected-item-id","maxHeightProp"]))}}),{width,height}=useWindowSize(),isSmallScreen=computed(()=>width.value<768||height.value<840);computed(()=>{const Tr=useUserStore(),Cr=Tr.currentOrgId,$r=Cr&&showGenBookletFlow(Cr)&&isEnabled("genCrispBookletFlow");return[{id:"1",type:"system",content:{text:`Hi there 👋. My name is Prezo AI and I'm here to assist you in creating your presentation.`},style:{"--stagger":2}},{id:"2",type:"system",content:{text:$r?"First, choose whether you want to generate a booklet or a presentation.":"To begin, you can either start with a short description or convert a document into a presentation."},style:{"--stagger":3}},{id:"3",type:"system",tags:["presentationType"],options:$r?[{id:"booklet",text:"Booklet",icon:"🎬",subtitle:"Start with notes"},{id:"prompt",text:"Presentation",icon:"📊",subtitle:isSmallScreen.value?"Start with description":"Start with a description"},{id:"document",text:"Presentation",icon:"📄",subtitle:isSmallScreen.value?"Start with document":"Start with a document"}]:[{id:"prompt",text:"Short description",icon:"✍️"},{id:"document",text:"Document",icon:"📄"},...Tr.getShowCustomWorkflowForm?[{id:"templateForm",text:"Templates with AI",icon:"📕",showAccent:!0}]:[]],style:{"--stagger":4},selectedId:null}]});const LANGUAGE_OPTIONS={english:{label:"English"},"simplified chinese":{label:"簡体中文"},"traditional chinese":{label:"繁體中文"},hindi:{label:"हिन्दी"},spanish:{label:"Español"},arabic:{label:"العربية"},russian:{label:"Русский"},portuguese:{label:"Português"},japanese:{label:"日本語"},german:{label:"Deutsch"},italian:{label:"Italiano"},czech:{label:"Čeština"},hungarian:{label:"Magyar"},croatian:{label:"Hrvatski"},romanian:{label:"Română"},belarusian:{label:"Беларуская"},bulgarian:{label:"Български"},korean:{label:"한국어"},french:{label:"Français"},turkish:{label:"Türkçe"},vietnamese:{label:"Tiếng Việt"},polish:{label:"Polski"},dutch:{label:"Nederlands"},thai:{label:"ไทย"},filipino:{label:"Tagalog"},greek:{label:"ελληνικά"},finnish:{label:"Suomi"},norwegian:{label:"Norsk"},swedish:{label:"Svenska"},danish:{label:"Dansk"},malaysian:{label:"Bahasa Melayu"},indonesian:{label:"Bahasa Indonesia"},ukrainian:{label:"Українська"},serbian:{label:"Српски"}},TONE_OPTIONS={friendly:{label:"Friendly"},professional:{label:"Professional"},educational:{label:"Educational"},humorous:{label:"Humorous"}},_hoisted_1$3={class:"flex flex-col items-center gap-3 w-full px-3"},_hoisted_2$2={class:"flex items-center w-full gap-3"},_hoisted_3$2={class:"flex flex-col gap-1 flex-1"},_hoisted_4$2=createBaseVNode("label",{class:"small-title"},"Image type",-1),_hoisted_5$2={class:"flex flex-col gap-1 flex-1"},_hoisted_6$2=createBaseVNode("label",{class:"small-title"},"Tone",-1),_hoisted_7$2={class:"flex flex-col gap-1 flex-1 w-full"},_hoisted_8$2=createBaseVNode("label",{class:"small-title"},"Language",-1),_hoisted_9$2={class:"flex flex-col gap-1 flex-1 w-full"},_hoisted_10$2=createBaseVNode("label",{class:"small-title"},"Audience",-1),PLACEHOLDER_FOR_AUDIENCE="Describe your audience so AI can customize the content.",_sfc_main$7=defineComponent({__name:"AIGenSettings",props:{appId:{}},emits:["close"],setup(Tr,{emit:Cr}){const $r=Tr,Ar=Cr,Rr=useAppStore(),Dr=useArtboardStore(),Mr=inject("selectedPageId"),Br=IMAGE_THEMES.map(ao=>({id:ao.id,label:ao.label,source:""})),Lr=[...Object.keys(LANGUAGE_OPTIONS)].sort((ao,lo)=>{const po=LANGUAGE_OPTIONS[ao].label,go=LANGUAGE_OPTIONS[lo].label;return po.localeCompare(go)}).map(ao=>({id:ao,label:LANGUAGE_OPTIONS[ao].label})),Hr=Object.keys(TONE_OPTIONS).map(ao=>({id:ao,label:TONE_OPTIONS[ao].label})),zr=computed(()=>Dr.aiGenSettings.selectedImageId),Ur=computed(()=>Dr.aiGenSettings.selectedLanguageId),Vr=computed(()=>Dr.aiGenSettings.selectedToneId),jr=computed(()=>Dr.aiGenSettings.audience),Gr=ref(jr.value),Xr=ref(),Kr=computed(()=>theme.appTheme()),Zr=computed(()=>Rr.getThemeObject($r.appId,Mr.value??"")),eo=computed(()=>{var ao,lo,po;return((po=(lo=(ao=Zr.value)==null?void 0:ao.block)==null?void 0:lo.none)==null?void 0:po.lightUp)??Kr.value.colors.brandPurple}),Wr=computed(()=>Rr.deckThemeValue($r.appId)),Yr=inject("isMobile"),Jr=ref(null),{focused:no}=useFocus(Jr),ro=({key:ao,value:lo})=>{Dr.setAIGenSettings({key:ao,value:lo})},so=()=>{Ar("close")};return watch(Gr,ao=>{Xr.value&&clearTimeout(Xr.value),Xr.value=setTimeout(()=>{ro({key:"audience",value:ao})},500)}),onMounted(()=>{const ao=Rr.aiSettings($r.appId);ao.imageId&&ro({key:"selectedImageId",value:ao.imageId}),ao.languageId&&ro({key:"selectedLanguageId",value:ao.languageId}),ao.audience&&ro({key:"audience",value:ao.audience}),ao.toneId&&ro({key:"selectedToneId",value:ao.toneId})}),(ao,lo)=>(openBlock(),createElementBlock("div",{class:normalizeClass(["gap-3 flex flex-col items-center",{"w-[100vw] py-3 pt-0 rounded-t-2xl bg-white":unref(Yr),"w-[350px] py-3 rounded-2xl":!unref(Yr)}])},[unref(Yr)?(openBlock(),createBlock(_sfc_main$1p,{key:0,title:"AI Settings",onTappedClose:lo[0]||(lo[0]=po=>Ar("close"))})):createCommentVNode("",!0),createBaseVNode("div",_hoisted_1$3,[createBaseVNode("div",_hoisted_2$2,[createBaseVNode("div",_hoisted_3$2,[_hoisted_4$2,createVNode(_sfc_main$8,{onSelectedItemId:lo[1]||(lo[1]=po=>ro({key:"selectedImageId",value:po})),items:unref(Br),"selected-item-id":zr.value,lightUpColor:eo.value,"max-height-prop":unref(Yr)?300:400},null,8,["items","selected-item-id","lightUpColor","max-height-prop"])]),createBaseVNode("div",_hoisted_5$2,[_hoisted_6$2,createVNode(_sfc_main$8,{onSelectedItemId:lo[2]||(lo[2]=po=>ro({key:"selectedToneId",value:po})),items:unref(Hr),"selected-item-id":Vr.value,lightUpColor:eo.value,"max-height-prop":unref(Yr)?300:400},null,8,["items","selected-item-id","lightUpColor","max-height-prop"])])]),createBaseVNode("div",_hoisted_7$2,[_hoisted_8$2,createVNode(_sfc_main$8,{onSelectedItemId:lo[3]||(lo[3]=po=>ro({key:"selectedLanguageId",value:po})),items:unref(Lr),"selected-item-id":Ur.value,lightUpColor:eo.value,"max-height-prop":unref(Yr)?300:400},null,8,["items","selected-item-id","lightUpColor","max-height-prop"])]),createBaseVNode("div",_hoisted_9$2,[_hoisted_10$2,withDirectives(createBaseVNode("textarea",{"onUpdate:modelValue":lo[4]||(lo[4]=po=>Gr.value=po),ref_key:"audienceTextArea",ref:Jr,class:"w-full rounded-[8px] h-[104px] resize-none py-2 px-3 bg-neutralSolid-50 focus-within:bg-white border border-transparent",style:normalizeStyle({borderColor:unref(no)?eo.value:"transparent"}),placeholder:PLACEHOLDER_FOR_AUDIENCE},null,4),[[vModelText,Gr.value]])]),unref(Yr)?(openBlock(),createBlock(Button,{key:0,style:{width:"100%",height:"38px",padding:"8px 16px","border-radius":"12px"},onClick:so,backgroundOverride:Wr.value,hoverBackgroundOverride:unref(theme).getSofterColor(Wr.value,.04),activeBackgroundOverride:unref(theme).getSofterColor(Wr.value,.08)},{content:withCtx(({textStyle:po})=>[createBaseVNode("p",{style:normalizeStyle({...po,color:"#FFF",fontWeight:"500",fontSize:"16px"})},"Save",4)]),_:1},8,["backgroundOverride","hoverBackgroundOverride","activeBackgroundOverride"])):createCommentVNode("",!0)])],2))}}),_sfc_main$6=defineComponent({__name:"AIGenSettingsWrapper",setup(Tr){const Cr=useOverlayStore();inject("isMobile");const{currentAppId:$r}=inject("currentAppId"),Ar=computed(()=>Cr.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.AI_GEN_SETTINGS)),Rr=()=>{Cr.hideSlideInComponents(SLIDE_IN_COMPONENTS.AI_GEN_SETTINGS)};return(Dr,Mr)=>(openBlock(),createBlock(PrezoSlideIn,{show:Ar.value,onClose:Rr},{content:withCtx(({})=>[createVNode(_sfc_main$7,{appId:unref($r)??"",onClose:Rr},null,8,["appId"])]),_:1},8,["show"]))}}),_imports_0$1=""+globalThis.__publicAssetsURL("icons/ending.gif"),_withScopeId=Tr=>(pushScopeId("data-v-dcabecf6"),Tr=Tr(),popScopeId(),Tr),_hoisted_1$2={class:"flex flex-col items-center gap-6 w-full sm:w-[420px] p-4"},_hoisted_2$1={key:0,class:"flex flex-col items-center gap-2 self-stretch pt-4"},_hoisted_3$1={class:"font-heading font-medium leading-[112%] text-[24px] sm:text-[28px] text-neutralSolid-1000"},_hoisted_4$1={class:"text-sm text-neutralSolid-400"},_hoisted_5$1={key:0,class:"text-sm font-medium leading-normal"},_hoisted_6$1={key:1,class:"flex flex-col items-center justify-center self-stretch shrink-0 gap-3"},_hoisted_7$1={class:"w-6 h-6 p-[1px] flex items-center justify-center"},_hoisted_8$1=["src"],_hoisted_9$1=_withScopeId(()=>createBaseVNode("label",{class:"text-neutralSolid-1000 text-base text-medium leading-[112%]"},"Continue with Google",-1)),_hoisted_10$1={key:2,class:"self-stretch h-[1px] border-b border-neutralSolid-100"},_hoisted_11={key:3,class:"self-stretch flex flex-col items-center gap-3"},_hoisted_12={class:"self-stretch flex flex-col items-start"},_hoisted_13={class:"mt-[2px] flex shrink-0 basis-0"},_hoisted_14={class:"text-[11px] leading-[1.36] text-danger-100"},_hoisted_15={key:1,class:"text-neutralSolid-1000 text-base text-medium leading-[112%]"},_hoisted_16={key:4,class:"flex mb-2"},_hoisted_17=_withScopeId(()=>createBaseVNode("br",null,null,-1)),_hoisted_18={key:5,class:"flex flex-col items-center self-stretch gap-6 py-4"},_hoisted_19={class:"flex flex-col gap-1 items-center justify-center"},_hoisted_20=["onPaste","onUpdate:modelValue","onInput","onFocus"],_hoisted_21={class:"flex grow shrink-0 basis-0 font-normal text-[11px] leading-[1.36] min-h-[15px] text-danger-100"},_hoisted_22={class:"text-sm text-neutralSolid-400 font-normal"},_hoisted_23={class:"font-medium"},_hoisted_24={key:6},_hoisted_25=_withScopeId(()=>createBaseVNode("div",{class:"flex flex-col items-center gap-2 my-[36px]"},[createBaseVNode("img",{src:_imports_0$1,alt:"Successful login...",class:"w-[100px] h-[100px]"}),createBaseVNode("label",{class:"font-heading font-medium leading-[112%] text-[24px] sm:text-[28px] text-neutralSolid-1000"}," Login successful "),createBaseVNode("label",{class:"text-sm text-neutralSolid-400"}," Welcome to Prezo ")],-1)),_hoisted_26=[_hoisted_25],DEFAULT_TITLE="Welcome to Prezo",OTP_TITLE="Enter security code",DEFAULT_CTA="Sign up or login to continue",OTP_CTA="Please type the code sent to",otpErrorMessage="Invalide code, please try again.",TERMS_AND_CONDITIONS_LEAD_IN='By clicking "Continue with Google/Email" above, you agree to our ',termsLink="https://comms.prezo.site/terms",_sfc_main$5=defineComponent({__name:"SignIn",setup(Tr){const Cr=inject("isMobile"),$r=useRoute$1(),Ar=useRouter$1(),Rr=useUserStore(),Dr={invalid_email:"Invalid format, please try again",fail_to_send_email:"Failed to send email, please try again"},Mr=ref(),Br=ref(""),Nr=ref(!1),Lr=ref(null),Hr=ref(!1),zr=ref(["","","","","",""]),Ur=computed(()=>zr.value.join("")),Vr=ref(!1),jr=ref({focusedInput:null,isInvalid:!1,isCheckingValidation:!1}),Gr=ref(!0),Xr=ref(!1),Kr=ref(!1),Zr=ref(!1),eo=ref(60),Wr=ref(),Yr=computed(()=>Rr.currentUser),Jr=computed(()=>eo.value===0?"":`(${eo.value})`),no=computed(()=>Xr.value?OTP_TITLE:DEFAULT_TITLE),ro=computed(()=>Xr.value?`${OTP_CTA} ${Br.value}`:DEFAULT_CTA),so=Mo=>{Br.value=Mo},ao=Mo=>{if(Mr.value)return Mr.value.querySelectorAll("input")[Mo]},lo=Mo=>{if(jr.value.focusedInput=Mo,zr.value[Mo-1].length){const Ro=ao(Mo-1);Ro==null||Ro.select()}},po=Mo=>{let Ro="#F3F3F3",Ao="1px solid";return jr.value.focusedInput===Mo&&(Ao="2px solid",Ro="#AB67FF"),jr.value.isInvalid&&(Ao="2px solid",Ro="#DB3033"),jr.value.isCheckingValidation&&(Ro="#F3F3F3"),{display:"flex",width:"100%",padding:"12px 0",justifyContent:"center",alignItems:"center",gap:"10px",flex:"1 0 0",borderRadius:"8px",border:Ao,borderColor:Ro,background:jr.value.isInvalid||jr.value.focusedInput===Mo?"#FFF":"#F3F3F3",color:"#0D0C0C",textAlign:"center",fontSize:Cr?"24px":"32px",lineHeight:"normal"}},go=()=>zr.value.join("").length===6,co=async()=>{const Mo=zr.value.join(""),{data:{session:Ro},error:Ao}=await SupabaseWrapper.client.auth.verifyOtp({email:Br.value,token:Mo,type:"email"});return Ao||!Ro||!(Ro!=null&&Ro.access_token)?(console.log(Ao),publishLog({channel:"custom-debugging",description:`Error verifying OTP: ${(Ao==null?void 0:Ao.message)??"No error message"}, email: ${Br.value}`,event:"OTP Verification Error"}),!1):!0},mo=async(Mo,Ro)=>{if(log("handleOTPInput",Ro,zr.value[Ro-1].length),zr.value[Ro-1]=zr.value[Ro-1].replace(/[^0-9]/g,""),zr.value[Ro-1].length===1&&(jr.value.focusedInput=Ro+1,Ro<6)){const Ao=ao(Ro);Ao==null||Ao.select()}},io=()=>{Gr.value=!0,Xr.value=!1},uo=()=>{jr.value={focusedInput:null,isInvalid:!1,isCheckingValidation:!1},Vr.value=!1,zr.value=["","","","","",""]};async function ho(){Hr.value=!0;const{data:Mo,error:Ro}=await SupabaseWrapper.client.auth.signInWithOtp({email:Br.value,options:{shouldCreateUser:!0}});return Hr.value=!1,Ro?(console.log(Ro),publishLog({channel:"custom-debugging",description:`Error sending OTP: ${(Ro==null?void 0:Ro.message)??"No error message"}, email: ${Br.value}`,event:"OTP Send Email Error"}),!1):!0}const yo=()=>{Gr.value=!1,Xr.value=!0,nextTick(()=>{const Mo=ao(0);Mo==null||Mo.focus()})},So=()=>{Zr.value=!0,Wr.value&&clearInterval(Wr.value),eo.value=60,Wr.value=setInterval(()=>{eo.value-=1,eo.value===0&&(clearInterval(Wr.value),Zr.value=!1)},1e3)},ko=async()=>{if(So(),!await ho()){Lr.value="fail_to_send_email",Zr.value=!1,Wr.value&&clearInterval(Wr.value),eo.value=60;return}Lr.value=null,yo()},$o=async()=>{if(!isEmailValid(Br.value)){Lr.value="invalid_email",Nr.value=!0;return}if(Lr.value=null,uo(),!await ho()){Lr.value="fail_to_send_email";return}Lr.value=null,yo()};async function Go(){var Oo;const Ro=`${((Oo=window==null?void 0:window.location)==null?void 0:Oo.origin)??"https://app.prezo.ai"}/oauth${encodeQueryParams({redirect:$r.query.redirect,new:$r.query.new})}`,Ao=$r.fullPath,{error:zo}=await SupabaseWrapper.client.auth.signInWithOAuth({provider:"google",options:{redirectTo:Ro}});zo&&Ar.push({path:Ao})}const No=(Mo,Ro)=>{if(Ro!==1||!Mo.clipboardData)return;Mo.preventDefault(),Mo.clipboardData.getData("text").split("").forEach((Bo,bo)=>{bo>=6||(zr.value[bo]=Bo)});const Oo=ao(5);Oo==null||Oo.focus()},Eo=async()=>{const{path:Mo,query:Ro,error:Ao}=await useDetermineRouteAfterLogin({route:$r});if(Ao||!Mo){publishLog({channel:"custom-debugging",description:`Error determining route after login via OTP: ${JSON.stringify(Ao)??"No error message"}, userId: ${Yr.value.id}, orgId: ${Rr.currentOrgId}, email: ${Br.value}`,event:"OTP Route handling Error"});return}Ar.push({path:Mo,query:Ro||{}})};return onMounted(()=>{const Mo=new Image;Mo.src="/icons/ending.gif",watch(Ur,async()=>{if(!go())return;if(await sleep(500),jr.value.isCheckingValidation=!0,!await co()){jr.value.isInvalid=!0,Vr.value=!0,jr.value.isCheckingValidation=!1;return}jr.value.isCheckingValidation=!1,Xr.value=!1,Kr.value=!0;const Ao=performance.now();try{let{data:{session:Bo}}=await SupabaseWrapper.client.auth.getSession();Bo&&(Bo=(await SupabaseWrapper.ogClient.auth.setSession({refresh_token:Bo.refresh_token,access_token:Bo.access_token})).data.session),await useUserSetup({currentUser:Yr,fromDeck:!1,fromEmailSignIn:!0})}catch(Bo){console.log(Bo),publishLog({channel:"custom-debugging",description:`Error getting user data after login via OTP: ${JSON.stringify(Bo)??"No error message"}, userId: ${Yr.value.id}, orgId: ${Rr.currentOrgId}, email: ${Br.value}`,event:"OTP Login - user data Error"})}const Oo=3e3-(performance.now()-Ao);setTimeout(()=>{Eo()},Math.max(300,Oo))})}),onBeforeUnmount(()=>{Wr.value&&clearInterval(Wr.value)}),(Mo,Ro)=>(openBlock(),createElementBlock("div",_hoisted_1$2,[Kr.value?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_2$1,[createBaseVNode("label",_hoisted_3$1,toDisplayString(no.value),1),createBaseVNode("label",_hoisted_4$1,toDisplayString(ro.value),1),Xr.value?(openBlock(),createElementBlock("label",_hoisted_5$1,[createBaseVNode("a",{onClick:io,class:"text-neutralSolid-1000 underline cursor-pointer"}," change email ")])):createCommentVNode("",!0)])),Gr.value?(openBlock(),createElementBlock("div",_hoisted_6$1,[createBaseVNode("button",{class:"social-button flex items-center justify-center self-stretch border border-solid border-neutral-100 bg-white hover:bg-gray-50 active:bg-gray-100 transition-colors duration-100 rounded-xl px-4 py-2 gap-1",onClick:Go},[createBaseVNode("div",_hoisted_7$1,[createBaseVNode("img",{src:"/images/logo-google.png",class:"w-[22px] h-[22px] object-scale-down"},null,8,_hoisted_8$1)]),_hoisted_9$1])])):createCommentVNode("",!0),Gr.value?(openBlock(),createElementBlock("div",_hoisted_10$1)):createCommentVNode("",!0),Gr.value?(openBlock(),createElementBlock("div",_hoisted_11,[createBaseVNode("div",_hoisted_12,[createVNode(Input,{modelValue:Br.value,"onUpdate:modelValue":so,onDidEnter:$o,focused:!1,onFocused:Ro[0]||(Ro[0]=Ao=>Nr.value=Ao),placeholder:"Enter your email address",style:normalizeStyle({height:"40px",borderRadius:"8px",border:"1px solid",borderColor:Lr.value?"#DB3033":Nr.value?"#AB67FF":"#F3F3F3",background:Lr.value||Nr.value?"#FFF":"#F3F3F3",color:"#0D0C0C"}),placeholderStyle:{color:"#6E6D6D"}},null,8,["modelValue","style"]),createBaseVNode("div",_hoisted_13,[createBaseVNode("p",_hoisted_14,toDisplayString(Lr.value?Dr[Lr.value]:""),1)])]),createBaseVNode("button",{class:"social-button flex items-center justify-center self-stretch border h-[42px] border-solid border-neutral-100 bg-white hover:bg-gray-50 active:bg-gray-100 transition-colors duration-100 rounded-xl px-4 py-2 gap-1",onClick:$o},[Hr.value?(openBlock(),createBlock(LoaderCircle,{key:0,color:"#AB67FF",padding:"0"})):(openBlock(),createElementBlock("label",_hoisted_15,"Continue with Email"))])])):createCommentVNode("",!0),Gr.value?(openBlock(),createElementBlock("div",_hoisted_16,[createBaseVNode("label",{class:"text-center text-xs text-neutralSolid-400"},[createTextVNode(toDisplayString(TERMS_AND_CONDITIONS_LEAD_IN)),_hoisted_17,createBaseVNode("a",{class:"underline cursor-pointer",href:termsLink},"Terms & Privacy")])])):createCommentVNode("",!0),Xr.value?(openBlock(),createElementBlock("div",_hoisted_18,[createBaseVNode("div",_hoisted_19,[createBaseVNode("div",{ref_key:"otpContainer",ref:Mr,class:"flex justify-center items-start gap-2 self-stretch px-6"},[(openBlock(),createElementBlock(Fragment$1,null,renderList(6,Ao=>withDirectives(createBaseVNode("input",{onPaste:zo=>No(zo,Ao),key:Ao,"onUpdate:modelValue":zo=>zr.value[Ao-1]=zo,type:"tel",inputmode:"numeric",pattern:"[0-9]*",maxlength:1,style:normalizeStyle(po(Ao)),class:normalizeClass({"opacity-30":jr.value.isCheckingValidation}),onInput:zo=>mo(zo,Ao),onFocus:zo=>lo(Ao)},null,46,_hoisted_20),[[vModelText,zr.value[Ao-1]]])),64))],512),createBaseVNode("div",_hoisted_21,toDisplayString(Vr.value?otpErrorMessage:""),1)]),createBaseVNode("label",_hoisted_22,[createTextVNode(" Didn't receive the email? "),createBaseVNode("span",_hoisted_23,[createBaseVNode("a",{onClick:ko,class:normalizeClass({"text-neutralSolid-1000 underline cursor-pointer":!Zr.value,"text-neutralSolid-400 no-underline pointer-events-none":Zr.value})}," Resend "+toDisplayString(Zr.value?Jr.value:""),3)])])])):createCommentVNode("",!0),Kr.value?(openBlock(),createElementBlock("div",_hoisted_24,_hoisted_26)):createCommentVNode("",!0)]))}}),SignIn_vue_vue_type_style_index_0_scoped_dcabecf6_lang="",SignIn=_export_sfc(_sfc_main$5,[["__scopeId","data-v-dcabecf6"]]),_sfc_main$4=defineComponent({__name:"SignInWrapper",setup(Tr){const Cr=useOverlayStore();inject("isMobile");const $r=computed(()=>Cr.isSlideInComponentShowing(SLIDE_IN_COMPONENTS.SIGN_IN)),Ar=()=>{Cr.hideSlideInComponents(SLIDE_IN_COMPONENTS.SIGN_IN)};return(Rr,Dr)=>(openBlock(),createBlock(PrezoSlideIn,{show:$r.value,onClose:Ar},{content:withCtx(({})=>[createVNode(SignIn,{onClose:Ar})]),_:1},8,["show"]))}}),_sfc_main$3=defineComponent({__name:"MobileSlideIn",setup(Tr){return(Cr,$r)=>(openBlock(),createElementBlock(Fragment$1,null,[createVNode(_sfc_main$1o),createVNode(_sfc_main$1m),createVNode(_sfc_main$1j),createVNode(_sfc_main$1h),createVNode(_sfc_main$15),createVNode(_sfc_main$13),createVNode(_sfc_main$12),createVNode(_sfc_main$g),createVNode(_sfc_main$c),createVNode(_sfc_main$a),createVNode(_sfc_main$6),createVNode(_sfc_main$4)],64))}}),_hoisted_1$1={id:"dolphyn-app-inner"},_sfc_main$2=defineComponent({__name:"App",async setup(Tr){let Cr,$r;const Ar=useBlockLayoutsStore(),Rr=useUserStore(),Dr=useMiscStore(),Mr=useRoute$1(),Br=useRouter$1(),Nr=useCookie("access-token"),Lr=useCookie("refresh-token");[Cr,$r]=withAsyncContext(async()=>useAsyncData("user-setup",async()=>{var qi,Mi;if((qi=Mr==null?void 0:Mr.path)!=null&&qi.includes("/pdf/")||(Mi=Mr==null?void 0:Mr.path)!=null&&Mi.includes("/screenshot/"))return;let{data:{session:$i}}=await SupabaseWrapper.client.auth.getSession();if($i)$i=(await SupabaseWrapper.ogClient.auth.setSession({refresh_token:$i.refresh_token,access_token:$i.access_token})).data.session;else{if(!Nr.value||!Lr.value)return;$i=(await SupabaseWrapper.ogClient.auth.setSession({refresh_token:Lr.value,access_token:Nr.value})).data.session}if(!$i){Rr.setLoggedIn(!1);return}Rr.setLoggedIn(!0);const{user:Ri}=$i,{data:Fi,error:bs}=await SupabaseWrapper.client.from("user_profiles_with_credits").select().eq("id",Ri.id).single();if(!(!Fi||bs))return Rr.updateUserObject(Fi),Rr.updateTotalCredits(Fi.total_credits||0),Ir.identify(Rr.currentUserId,{email:Rr.currentUserEmail,name:Rr.userFullName,isPro:Rr.isProSubscription(Rr.currentOrgId)}),await Rr.fetchAndHydrateOrgsForUser(Ri.id),!0})),await Cr,$r();const Hr=computed(()=>{var Ri;const $i=((Ri=Mr==null?void 0:Mr.path)==null?void 0:Ri.split("/"))||[];return $i.length===3&&$i[1]==="public"||$i.length===3&&$i[1]==="a"?$i[2]:null}),zr=computed(()=>Rr.isLoggedIn),Ur=computed(()=>Dr.getRoutePathToOpen),Vr=computed(()=>Ar.inTemplateMode),{isPdf:jr,isPublic:Gr,isScreenshot:Xr,currentPathWithQuery:Kr,isHome:Zr}=useRouteInfo();IS_CLIENT&&(watch(zr,$i=>{if(getSubdomain()===""&&!$i){if(jr.value||Gr.value||Xr.value)return;Br.push({path:"/login",query:{redirect:Kr.value}})}}),watch(Ur,$i=>{$i&&(Br.push($i),Dr.setRoutePathToOpen(null))}));const{showingFullScreen:eo,showingFullPage:Wr,showingEmbed:Yr,updateShowingEmbed:Jr,downloadFile:no,selectedBlockId:ro,editingBlockId:so,highlightedBlockIds:ao,updateHighlightedBlockIds:lo,selectionMenuBlockId:po,selectedPageId:go,focusedPageId:co,updateFocusedPageId:mo,counterForAIGeneration:io,updateCounterForAIGeneration:uo,componentMode:ho,updateComponentMode:yo,updateCopiedState:So,currentAppId:ko,updateCurrentAppId:$o,shownSlideIds:Go,slideShowInProgress:No,highlightedPageIds:Eo,updateHighlightedPageIds:Mo}=useDeckState();provide("showingFullScreen",eo),provide("showingFullPage",Wr),provide("showingEmbed",{showingEmbed:Yr,updateShowingEmbed:Jr}),provide("downloadFile",no),provide("selectedBlockId",ro),provide("editingBlockId",so),provide("highlightedBlockIds",{highlightedBlockIds:ao,updateHighlightedBlockIds:lo}),provide("selectionMenuBlockId",po),provide("focusedPageId",{focusedPageId:co,updateFocusedPageId:mo}),provide("selectedPageId",go),provide("highlightedPageIds",{highlightedPageIds:Eo,updateHighlightedPageIds:Mo}),provide("currentAppId",{currentAppId:ko,updateCurrentAppId:$o}),provide("shownSlideIds",Go),provide("counterForAIGeneration",{counterForAIGeneration:io,updateCounterForAIGeneration:uo}),provide("componentMode",{componentMode:ho,updateComponentMode:yo}),provide("slideShowInProgress",No);const{dropzoneBlockIds:Ro,setDropzoneBlockIds:Ao,movingBlockIds:zo,setMovingBlockIds:Oo}=useSlideState();provide("dropzoneBlockIds",{dropzoneBlockIds:Ro,setDropzoneBlockIds:Ao}),provide("movingBlockIds",{movingBlockIds:zo,setMovingBlockIds:Oo});const{showGlobalNotification:Bo,updateShowGlobalNotification:bo,globalNotification:vo,updateGlobalNotification:Io,altKeyPressed:To,current:Co,lastGenerationType:Po,updateLastGenerationType:Fo,isSingleSlideGeneration:Vo,isWholeDeckGeneration:Ko,isContextMenuOpen:Uo,updateIsContextMenuOpen:ei,popoverState:qo,updatePopoverState:ri,userInterruptedSlideShow:ki}=useMiscState();provide("showGlobalNotification",{showGlobalNotification:Bo,updateShowGlobalNotification:bo}),provide("globalNotification",{globalNotification:vo,updateGlobalNotification:Io}),provide("altKeyPressed",To),provide("currentKeyPressed",Co),provide("lastGenerationType",{lastGenerationType:Po,updateLastGenerationType:Fo,isSingleSlideGeneration:Vo,isWholeDeckGeneration:Ko}),provide("isContextMenuOpen",{isContextMenuOpen:Uo,updateIsContextMenuOpen:ei}),provide("popoverState",{popoverState:qo,updatePopoverState:ri}),provide("userInterruptedSlideShow",ki);const ti=ref({});provide("cachedImages",{cachedImages:ti,preloadImage:$i=>{if(!($i in ti.value)&&$i!=null)try{const Ri=new Image;Ri.src=useImageOptimization({imgSrc:$i,isPdf:jr,isScreenshot:Xr}),ti.value[$i]=Ri}catch(Ri){console.error(Ri)}}});const{isMobile:Xo,isPortraitTablet:si,isTablet:vi}=useDeviceState();provide("isMobile",Xo),provide("isPortraitTablet",si),provide("isTablet",vi);const Ci={inTemplateMode:Vr,showingFullScreen:eo,showingFullPage:Wr,downloadFile:no,selectedBlockId:ro,editingBlockId:so,highlightedBlockIds:ao,updateHighlightedBlockIds:lo,selectionMenuBlockId:po,selectedPageId:go,focusedPageId:co,updateFocusedPageId:mo,highlightedPageIds:Eo,updateHighlightedPageIds:Mo,componentMode:ho,updateComponentMode:yo,updateCopiedState:So,currentAppId:ko,updateCurrentAppId:$o,isMobile:Xo};useAllKeyHandlers(Ci),IS_CLIENT&&useCopyPaste({appId:Hr,editingBlockId:so,keyHandlerOptions:Ci});const wi=computed(()=>Rr.currentUserId);provide("currentUserId",wi);const bi=computed(()=>{var $i;return(($i=Mr.query)==null?void 0:$i.embed)==="true"});Jr(bi.value),Yr.value&&(Wr.value=!0);const li=ref(null),ci=ref(null),Ii=ref(null);onMounted(async()=>{await Br.isReady(),Jr(bi.value),Yr.value&&(Wr.value=!0);let $i=!1;const Ri=useBlockStore();li.value=setInterval(async()=>{$i||($i=!0,await Ri.save(),$i=!1)},BLOCK_UPDATE_INTERVAL)}),onBeforeUnmount(()=>{li.value!==null&&clearInterval(li.value),ci.value!==null&&clearInterval(ci.value),Ii.value!==null&&clearInterval(Ii.value)});const Ni=ref(null),Ei=ref(!1);return provide("headlessTracker",Ei),useMutationObserver(Ni,$i=>{try{$i.forEach(Ri=>{var qi,Mi;if(Ri.addedNodes.length===0&&Ri.removedNodes.length===0)return;const Fi=[...Ri.addedNodes][0];Fi&&((qi=Fi.classList)!=null&&qi.contains("headless-tracker"))&&(Ei.value=!0);const bs=[...Ri.removedNodes][0];bs&&((Mi=bs.classList)!=null&&Mi.contains("headless-tracker"))&&(Ei.value=!1)})}catch(Ri){console.error(Ri),Ei.value=!1}},{childList:!0}),provide("global",ourGlobal),provide("theme",theme),provide("layout",layout),provide("blockConfig",blockConfig),provide("appConfig",appConfig),provide("pageConfig",pageConfig),provide("aiForStyle",aiForStyle),($i,Ri)=>{const Fi=__nuxt_component_0;return openBlock(),createElementBlock("div",_hoisted_1$1,[createBaseVNode("div",{class:"flex flex-col flex-1 relative overflow-hidden",id:"main-app",ref_key:"mainApp",ref:Ni},[createVNode(unref(NuxtLayout),null,{default:withCtx(()=>[createVNode(unref(NuxtPage))]),_:1}),createVNode(Fi,null,{default:withCtx(()=>[Hr.value&&unref(Bo)===Hr.value&&!unref(Zr)?(openBlock(),createBlock(Notification,{key:0,notification:unref(vo),fromApp:!0,onHide:Ri[0]||(Ri[0]=bs=>unref(bo)(null))},null,8,["notification"])):createCommentVNode("",!0),unref(Xo)?(openBlock(),createBlock(_sfc_main$3,{key:1})):createCommentVNode("",!0)]),_:1})],512)])}}}),_imports_0=""+globalThis.__publicAssetsURL("favicon.svg"),_hoisted_1={class:"w-full"},_hoisted_2={class:"fixed z-[99] w-full"},_hoisted_3={class:"whitespace-nowrap top-0 w-full flex flex-col items-center justify-center text-[1rem]"},_hoisted_4={class:"flex items-center justify-center w-full max-w-[1300px] px-5 h-20 relative overflow-hidden"},_hoisted_5=createBaseVNode("div",{class:"flex items-center"},[createBaseVNode("img",{alt:"logo",src:_imports_0,class:"w-[30px] h-[30px] shrink-0 mr-3"}),createBaseVNode("div",{class:"font-medium text-base text-neutral-900"},"Prezo")],-1),_hoisted_6=[_hoisted_5],_hoisted_7={class:"flex flex-1 justify-end"},_hoisted_8={key:0,href:"/login",class:"font-medium"},_hoisted_9=createStaticVNode('

404

Page not found

Sorry, the page you're looking for doesn't exist.

Go back to home
',1),_hoisted_10=["src"],_sfc_main$1=defineComponent({__name:"error",props:{error:{}},setup(Tr){const Cr=useUserStore(),$r="https://app.prezo.ai/home";return(Ar,Rr)=>(openBlock(),createElementBlock("div",_hoisted_1,[createBaseVNode("header",_hoisted_2,[createBaseVNode("div",_hoisted_3,[createBaseVNode("nav",_hoisted_4,[createBaseVNode("div",{style:{"flex-shrink":"0"}},[createBaseVNode("a",{href:$r,class:"no-underline select-none text-[#333]"},_hoisted_6)]),createBaseVNode("div",_hoisted_7,[unref(Cr).currentUser?createCommentVNode("",!0):(openBlock(),createElementBlock("a",_hoisted_8,"Login"))])])])]),_hoisted_9,createBaseVNode("img",{class:"absolute top-0 left-0 w-full h-full object-cover z-0",src:"https://auth.prezo.ai/storage/v1/render/image/public/public/product/gradient-full-1.svg"},null,8,_hoisted_10)]))}}),_sfc_main={__name:"nuxt-root",setup(Tr){const Cr=()=>null,$r=useNuxtApp(),Ar=$r.deferHydration(),Rr=!1;provide(PageRouteSymbol,useRoute$1()),$r.hooks.callHookWith(Br=>Br.map(Nr=>Nr()),"vue:setup");const Dr=useError();onErrorCaptured((Br,Nr,Lr)=>{if($r.hooks.callHook("vue:error",Br,Nr,Lr).catch(Hr=>console.error("[nuxt] Error in `vue:error` hook",Hr)),isNuxtError(Br)&&(Br.fatal||Br.unhandled))return $r.runWithContext(()=>showError(Br)),!1});const Mr=!1;return(Br,Nr)=>(openBlock(),createBlock(Suspense,{onResolve:unref(Ar)},{default:withCtx(()=>[unref(Dr)?(openBlock(),createBlock(unref(_sfc_main$1),{key:0,error:unref(Dr)},null,8,["error"])):unref(Mr)?(openBlock(),createBlock(unref(Cr),{key:1,context:unref(Mr)},null,8,["context"])):unref(Rr)?(openBlock(),createBlock(resolveDynamicComponent(unref(Rr)),{key:2})):(openBlock(),createBlock(unref(_sfc_main$2),{key:3}))]),_:1},8,["onResolve"]))}},RootComponent=_sfc_main;globalThis.$fetch||(globalThis.$fetch=$fetch.create({baseURL:baseURL()}));let entry;{let Tr;entry=async function(){var Dr,Mr;if(Tr)return Tr;const Ar=!!((Dr=window.__NUXT__)!=null&&Dr.serverRendered||((Mr=document.getElementById("__NUXT_DATA__"))==null?void 0:Mr.dataset.ssr)==="true")?createSSRApp(RootComponent):createApp(RootComponent),Rr=createNuxtApp({vueApp:Ar});try{await applyPlugins(Rr,plugins)}catch(Br){await Rr.callHook("app:error",Br),Rr.payload.error=Rr.payload.error||Br}try{await Rr.hooks.callHook("app:created",Ar),await Rr.hooks.callHook("app:beforeMount",Ar),Ar.mount(vueAppRootContainer),await Rr.hooks.callHook("app:mounted",Ar),await nextTick()}catch(Br){await Rr.callHook("app:error",Br),Rr.payload.error=Rr.payload.error||Br}return Ar},Tr=entry().catch(Cr=>{console.error("Error while mounting app:",Cr)})}export{useArtboardStore as $,normalizeClass as A,Be as B,createCommentVNode as C,__nuxt_component_0 as D,pushScopeId as E,popScopeId as F,useWindowSize as G,He as H,Fragment$1 as I,renderList as J,toRefs$1 as K,useUserStore as L,he as M,_e as N,SignIn as O,Pe as P,je as Q,Se as R,StyledPopOver as S,Teleport as T,useOverlayStore as U,useMiscStore as V,defineAsyncComponent as W,__vitePreload as X,SLIDE_IN_COMPONENTS as Y,useRoute$1 as Z,_export_sfc as _,useElementBounding$1 as a,vModelText as a$,withAsyncContext as a0,useMarketingSetup as a1,usePublicViewSetup as a2,normalizeProps as a3,guardReactiveProps as a4,resolveDynamicComponent as a5,useAsyncData as a6,useRequestURL as a7,getSubdomain as a8,publishLog as a9,c$2 as aA,l$3 as aB,o$1 as aC,h$5 as aD,e$1 as aE,f$1 as aF,K as aG,a$2 as aH,H$1 as aI,T$2 as aJ,t$3 as aK,b as aL,N$1 as aM,watchEffect as aN,p$4 as aO,p$3 as aP,nextTick as aQ,u$3 as aR,I as aS,o$2 as aT,n$1 as aU,allEmojis as aV,getEmojiUrl as aW,useBlockLayoutsStore as aX,queryLayoutTemplate as aY,SCROLLBAR_MARGIN_RIGHT as aZ,withDirectives as a_,handlePublicDeck as aa,getDeckIdFromSubdomainPath as ab,useAppStore as ac,useBlockStore as ad,usePageStore as ae,useRouter$1 as af,useRouteInfo as ag,verifyDeckPermission as ah,getCategoryByWidth as ai,theme as aj,useAsyncState as ak,useHead as al,_sfc_main$1r as am,createTextVNode as an,socialLoginForInvites as ao,queryWorkspaceCRUDMembers as ap,queryResourceFetchOrg as aq,log as ar,fetchPublicDeck as as,d$3 as at,u$5 as au,toRaw as av,x$1 as aw,a$3 as ax,y as ay,provide as az,createBlock as b,useElementBounding as b$,mergeProps as b0,Ee as b1,Fe as b2,Be$1 as b3,Ae as b4,resolveComponent as b5,useFuse as b6,script$2 as b7,guid as b8,useUsageStore as b9,design as bA,useImageUploadFlow as bB,useFileDialog as bC,Se$1 as bD,be as bE,Me as bF,ge$2 as bG,posthogCapture as bH,usePromptStore as bI,blockTypes as bJ,deleteTransitionDuration as bK,paneMargin as bL,panePadding as bM,useFocusWithin as bN,vShow as bO,useInternalVariableTuning as bP,useDebounceFn as bQ,Slider as bR,appConfig as bS,groupCRUD as bT,LoaderCircle2 as bU,DesignLibraryInput as bV,updateDeckTemplate as bW,showInternalTool as bX,layout as bY,useEventListener as bZ,StyledPopOver$1 as b_,defineStore as ba,SupabaseWrapper as bb,queryStableDiffusionImg as bc,useChatStore as bd,useCommandBarStore as be,queryAddSlide as bf,sleep as bg,useEditorStore as bh,lodashExports as bi,isImageEmbed as bj,isTextEmbed as bk,isShapeEmbed as bl,onBeforeUnmount as bm,Input as bn,Toggle as bo,LoaderCircle as bp,GradientBorderWrapper as bq,resolveDirective as br,constructTitptapJSONFromContent as bs,Ir as bt,constructTiptapContentFromJSON as bu,isBlockEnabled as bv,META_KEY_MODIFIER as bw,OPTION_KEY_MODIFIER as bx,useAddBlockWrapper as by,isEnabled as bz,computed as c,SlideAnimation as c$,ANIMATIONS as c0,useScroll as c1,useUndoRedoStore as c2,onClickOutside as c3,useContextMenu as c4,imageUrl as c5,StyledRightClickMenu as c6,_sfc_main$z as c7,useItemStore as c8,basicFlexLogic as c9,updateDeckPermission as cA,handlePublishing as cB,createDeckPreview as cC,AccentTag as cD,deleteDeckNotification as cE,navToHomeFromDeck as cF,takeRedoAction as cG,takeUndoAction as cH,fetchDeckTemplatePromptsWithGen as cI,useFolderStore as cJ,Notification as cK,getPublicPath as cL,_sfc_main$U as cM,IconPicker as cN,isStorytime as cO,formattedTimeBetweenforMobile as cP,APP_URL as cQ,PATH_FOR_ARTBOARD as cR,useMouse as cS,IS_CLIENT as cT,lottie as cU,useFullscreen as cV,useActiveElement as cW,onKeyStroke as cX,queryTemplates as cY,fetchDeckTemplatePrompts as cZ,AppPage as c_,TransitionGroup as ca,isEmbedEmpty as cb,useDeletePageWrapper as cc,useMagicKeys as cd,hasClassOrAncestorHasClass as ce,generateFromAction as cf,requestDeckAccess as cg,commonjsGlobal as ch,getDefaultExportFromCjs as ci,Skeleton as cj,useGridSetting as ck,useRoute as cl,updatePositionForMenu as cm,isEmail as cn,createDeckPermission as co,vModelDynamic as cp,getPublishedDomain as cq,useFocus as cr,WORD_MAP as cs,_sfc_main$e as ct,PDFPicker as cu,_sfc_main$V as cv,createSlots as cw,updatePositionForMenuWrtWindow as cx,deleteDeckPermission as cy,createDeckPermissionWithRetries as cz,defineComponent as d,logout as d$,usingTextOrInput as d0,artboardLogic as d1,textTypes as d2,IS_DEV as d3,showAssignedSysMenuBtn as d4,_sfc_main$D as d5,_sfc_main$B as d6,alignmentButtons as d7,_sfc_main$Q as d8,changeTextType as d9,isBookmarkEmbed as dA,cornerRadius as dB,_sfc_main$10 as dC,ImageEmbed as dD,TableEmbed as dE,DividerEmbed as dF,_sfc_main$u as dG,BookmarkEmbed as dH,canRenderStories as dI,groupFlexLogic as dJ,PDF_DIMS as dK,themeMixin as dL,overlayMixin as dM,querySlideLayouts as dN,StyledSelect as dO,queryRequestCustomFlow as dP,updateLayout as dQ,generateFromLayout as dR,groupSize as dS,useDocumentVisibility as dT,useTitle as dU,isObjectNullOrEmpty as dV,useOrgSetup as dW,useOrgSetupDirect as dX,FunctionsHttpError as dY,ourGlobal as dZ,getFontsForDeck as d_,headlessCleanup as da,useDeleteBlockWrapper as db,determineSelectedNodeTypes as dc,queryHref as dd,useTextSelection as de,textButtons as df,buttonsForWebpageEmbed as dg,queryFetchWebpageMeta as dh,KEYS_FOR_OPTIONS as di,useTimestamp as dj,useDateFormat as dk,usePointerWithinElement as dl,_sfc_main$S as dm,ImageSelectionPane as dn,clickOutside as dp,isCoverTitleEmbed as dq,isTitleEmbed as dr,isHeadingEmbed as ds,isSmallHeadingEmbed as dt,isSubtitleEmbed as du,isCaptionEmbed as dv,isCollectionEmbed as dw,isTableEmbed as dx,isDividerEmbed as dy,isWebpageEmbed as dz,createBaseVNode as e,getHrefs as e0,showTableCmdBar as e1,_imports_0 as e2,PROTag as e3,BaseButton as e4,NUM_FREE_DECKS as e5,createStaticVNode as e6,formattedTimeBetween as e7,_sfc_main$T as e8,useSearch as e9,queryGenerateDeckTemplateGeneric as eA,queryGenerateDeck as eB,fetchThreadId as eC,queryGenerateSlide as eD,_sfc_main$X as eE,StyledPopOver3 as eF,SHARED_FOLDER_ICON as ea,usePDF as eb,useFolderSetup as ec,StyledMoreMenu as ed,HomeRootFolderWrapper as ee,createNewDeck as ef,fetchHomePageData as eg,fileStorageUtils as eh,MONTHLY_SUBSCRIPTION_PRICE as ei,queryRequestProTier as ej,toRef$1 as ek,validateSubdomain as el,cleanPartOfLink as em,updateSubdomain as en,PRICING_MAP as eo,PRICING_TIERS as ep,queryStripePortal as eq,UpgradeAISettings as er,_sfc_main$1p as es,queryRequestDemo as et,showNotiForSuccess as eu,useDetermineRouteAfterLogin as ev,blockConfig as ew,queryCrispBooklet as ex,queryChat as ey,_sfc_main$7 as ez,createVNode as f,renderSlot as g,withKeys as h,inject as i,withModifiers as j,unref as k,Transition as l,createElementBlock as m,normalizeStyle as n,openBlock as o,assetUrl as p,_sfc_main$1v as q,ref as r,useRouter as s,onUnmounted as t,useCssVars as u,Button as v,withCtx as w,toDisplayString as x,watch as y,onMounted as z};