mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-03-29 16:50:44 +00:00
8 lines
81 KiB
JavaScript
8 lines
81 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/src-BXss9Jhd.js","assets/src-XkKNkxz7.js","assets/use-app-Brp2GW0k.js","assets/Container-B6WpfP9L.js","assets/use-component-status-BZBleBjR.js","assets/src-DEYQBGfh.js","assets/IteratorContainer-B85QPVJk.js","assets/src-BJeftTdO.js","assets/src-tqomN4QE.js","assets/PageFragment-hbRs0O1t.js","assets/PageFragmentContainer-LPPEzQLU.js","assets/PageFragmentContainer-D6rGFdL4.css","assets/src-U7-wytBs.js","assets/src-Atml0YQg.js"])))=>i.map(i=>d[i]);
|
|
import'data:text/javascript,if(!import.meta.resolve)throw Error("import.meta.resolve not supported")';export function __vite_legacy_guard(){import(`_`).catch(()=>1),(async function*(){})().next()}import{$ as includeBooleanAttr,A as inject,D as defineAsyncComponent,G as reactive,J as unref,K as ref,M as onBeforeUnmount,O as defineComponent,P as openBlock,Q as hyphenate,R as resolveDirective,S as createBlock,T as createRenderer,U as withDirectives,X as capitalize,Y as camelize,Z as extend$1,_ as _defineProperty,a as getUrlParam,at as isString$1,b as callWithAsyncErrorHandling,c as isPageFragment,dt as __exportAll,et as isArray$1,g as registerDataSourceOnDemand,h as DataSourceManager,it as isSpecialBooleanAttr,j as nextTick,l as replaceChildNode,nt as isModelListener,ot as isSymbol,rt as isOn,s as isPage,t as src_default,tt as isFunction$2,u as toLine,v as ObservedData,z as resolveDynamicComponent}from"./src-XkKNkxz7.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var policy=void 0,tt=typeof window<`u`&&window.trustedTypes;if(tt)try{policy=tt.createPolicy(`vue`,{createHTML:e=>e})}catch{}var unsafeToTrustedHTML=policy?e=>policy.createHTML(e):e=>e,svgNS=`http://www.w3.org/2000/svg`,mathmlNS=`http://www.w3.org/1998/Math/MathML`,doc=typeof document<`u`?document:null,templateContainer=doc&&doc.createElement(`template`),nodeOps={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?doc.createElementNS(svgNS,e):t===`mathml`?doc.createElementNS(mathmlNS,e):n?doc.createElement(e,{is:n}):doc.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>doc.createTextNode(e),createComment:e=>doc.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>doc.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{templateContainer.innerHTML=unsafeToTrustedHTML(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=templateContainer.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},vtcKey=Symbol(`_vtc`);function patchClass(e,t,n){let r=e[vtcKey];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var vShowOriginalDisplay=Symbol(`_vod`),vShowHidden=Symbol(`_vsh`),CSS_VAR_TEXT=Symbol(``),displayRE=/(?:^|;)\s*display\s*:/;function patchStyle(e,t,n){let r=e.style,i=isString$1(n),a=!1;if(n&&!i){if(t)if(isString$1(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??setStyle(r,t,``)}else for(let e in t)n[e]??setStyle(r,e,``);for(let e in n)e===`display`&&(a=!0),setStyle(r,e,n[e])}else if(i){if(t!==n){let e=r[CSS_VAR_TEXT];e&&(n+=`;`+e),r.cssText=n,a=displayRE.test(n)}}else t&&e.removeAttribute(`style`);vShowOriginalDisplay in e&&(e[vShowOriginalDisplay]=a?r.display:``,e[vShowHidden]&&(r.display=`none`))}var importantRE=/\s*!important$/;function setStyle(e,t,n){if(isArray$1(n))n.forEach(n=>setStyle(e,t,n));else if(n??(n=``),t.startsWith(`--`))e.setProperty(t,n);else{let r=autoPrefix(e,t);importantRE.test(n)?e.setProperty(hyphenate(r),n.replace(importantRE,``),`important`):e[r]=n}}var prefixes=[`Webkit`,`Moz`,`ms`],prefixCache={};function autoPrefix(e,t){let n=prefixCache[t];if(n)return n;let r=camelize(t);if(r!==`filter`&&r in e)return prefixCache[t]=r;r=capitalize(r);for(let n=0;n<prefixes.length;n++){let i=prefixes[n]+r;if(i in e)return prefixCache[t]=i}return t}var xlinkNS=`http://www.w3.org/1999/xlink`;function patchAttr(e,t,n,r,i,a=isSpecialBooleanAttr(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(xlinkNS,t.slice(6,t.length)):e.setAttributeNS(xlinkNS,t,n):n==null||a&&!includeBooleanAttr(n)?e.removeAttribute(t):e.setAttribute(t,a?``:isSymbol(n)?String(n):n)}function patchDOMProp(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?unsafeToTrustedHTML(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=includeBooleanAttr(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function addEventListener(e,t,n,r){e.addEventListener(t,n,r)}function removeEventListener(e,t,n,r){e.removeEventListener(t,n,r)}var veiKey=Symbol(`_vei`);function patchEvent(e,t,n,r,i=null){let a=e[veiKey]||(e[veiKey]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=parseName(t);r?addEventListener(e,n,a[t]=createInvoker(r,i),s):o&&(removeEventListener(e,n,o,s),a[t]=void 0)}}var optionsModifierRE=/(?:Once|Passive|Capture)$/;function parseName(e){let t;if(optionsModifierRE.test(e)){t={};let n;for(;n=e.match(optionsModifierRE);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===`:`?e.slice(3):hyphenate(e.slice(2)),t]}var cachedNow=0,p=Promise.resolve(),getNow=()=>cachedNow||(p.then(()=>cachedNow=0),cachedNow=Date.now());function createInvoker(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;callWithAsyncErrorHandling(patchStopImmediatePropagation(e,n.value),t,5,[e])};return n.value=e,n.attached=getNow(),n}function patchStopImmediatePropagation(e,t){if(isArray$1(t)){let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}else return t}var isNativeOn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,patchProp=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?patchClass(e,r,o):t===`style`?patchStyle(e,n,r):isOn(t)?isModelListener(t)||patchEvent(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):shouldSetAsProp(e,t,r,o))?(patchDOMProp(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&patchAttr(e,t,r,o,a,t!==`value`)):e._isVueCE&&(/[A-Z]/.test(t)||!isString$1(r))?patchDOMProp(e,camelize(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),patchAttr(e,t,r,o))};function shouldSetAsProp(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&isNativeOn(t)&&isFunction$2(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return isNativeOn(t)&&isString$1(n)?!1:t in e}var rendererOptions=extend$1({patchProp},nodeOps),renderer;function ensureRenderer(){return renderer||(renderer=createRenderer(rendererOptions))}var createApp=((...e)=>{let t=ensureRenderer().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=normalizeContainer(e);if(!r)return;let i=t._component;!isFunction$2(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,resolveRootNamespace(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function resolveRootNamespace(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function normalizeContainer(e){return isString$1(e)?document.querySelector(e):e}function __awaiter(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var segments=[];function Match(e,t,n=`*`){if(e===n)return!0;segments.length=0;let r=0,i=0,a=0,o=0;for(let t=0,i=e.length;t<i;t+=1){let i=e[t];i===n&&(r+=1,t>o&&segments.push(e.substring(o,t)),segments.push(i),o=t+1)}if(o<e.length&&segments.push(e.substring(o)),r?(i=e.length-r,a=1/0):a=i=e.length,segments.length===0)return e===t;let s=t.length;if(s<i||s>a)return!1;let c=0,l=segments.length-1,u=t.length-1,d=!1;for(;;){let e=segments[l];if(--l,e===n)d=!0;else{let n=u+1-e.length,r=t.lastIndexOf(e,n);if(r===-1||r>n)return!1;if(d)u=r-1,d=!1;else{if(r!==n)return!1;u-=e.length}}if(0>l)break}return!0}var WildcardObject=class{constructor(e,t,n,r=void 0){this.obj=e,this.delimiter=t,this.wildcard=n,this.is_match=r}shortMatch(e,t){if(e===t||e===this.wildcard)return!0;if(this.is_match)return this.is_match(e,t);let n=e.indexOf(this.wildcard);if(n>-1){let r=e.substr(n+1);if(n===0||t.substring(0,n)===e.substring(0,n)){let e=r.length;return e>0?t.substr(-e)===r:!0}}return!1}match(e,t){return this.is_match?this.is_match(e,t):e===t||e===this.wildcard||t===this.wildcard||this.shortMatch(e,t)||Match(e,t,this.wildcard)}handleArray(e,t,n,r,i={}){let a=e.indexOf(this.delimiter,n),o=!1;a===-1&&(o=!0,a=e.length);let s=e.substring(n,a),c=0;for(let n of t){let t=c.toString(),l=r===``?t:r+this.delimiter+c;(s===this.wildcard||s===t||this.shortMatch(s,t))&&(o?i[l]=n:this.goFurther(e,n,a+1,l,i)),c++}return i}handleObject(e,t,n,r,i={}){let a=e.indexOf(this.delimiter,n),o=!1;a===-1&&(o=!0,a=e.length);let s=e.substring(n,a);for(let n in t){n=n.toString();let c=r===``?n:r+this.delimiter+n;(s===this.wildcard||s===n||this.shortMatch(s,n))&&(o?i[c]=t[n]:this.goFurther(e,t[n],a+1,c,i))}return i}goFurther(e,t,n,r,i={}){return Array.isArray(t)?this.handleArray(e,t,n,r,i):this.handleObject(e,t,n,r,i)}get(e){return this.goFurther(e,this.obj,0,``)}},ObjectPath=class e{static get(e,t,n=!1){if(!t)return;let r=t;for(let t of e)if(t in r)r=r[t];else if(n)r[t]=Object.create({}),r=r[t];else return;return r}static set(t,n,r){if(!r)return;if(t.length===0){for(let e in r)delete r[e];for(let e in n)r[e]=n[e];return}let i=t.slice(),a=i.pop(),o=e.get(i,r,!0);return typeof o==`object`&&(o[a]=n),n}},wasm,WASM_VECTOR_LEN=0,cachegetUint8Memory0=null;function getUint8Memory0(){return(cachegetUint8Memory0===null||cachegetUint8Memory0.buffer!==wasm.memory.buffer)&&(cachegetUint8Memory0=new Uint8Array(wasm.memory.buffer)),cachegetUint8Memory0}var cachedTextEncoder=new TextEncoder(`utf-8`),encodeString=typeof cachedTextEncoder.encodeInto==`function`?function(e,t){return cachedTextEncoder.encodeInto(e,t)}:function(e,t){let n=cachedTextEncoder.encode(e);return t.set(n),{read:e.length,written:n.length}};function passStringToWasm0(e,t,n){if(n===void 0){let n=cachedTextEncoder.encode(e),r=t(n.length);return getUint8Memory0().subarray(r,r+n.length).set(n),WASM_VECTOR_LEN=n.length,r}let r=e.length,i=t(r),a=getUint8Memory0(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3);let t=getUint8Memory0().subarray(i+o,i+r),a=encodeString(e,t);o+=a.written}return WASM_VECTOR_LEN=o,i}function is_match(e,t){var n=passStringToWasm0(e,wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),r=WASM_VECTOR_LEN,i=passStringToWasm0(t,wasm.__wbindgen_malloc,wasm.__wbindgen_realloc),a=WASM_VECTOR_LEN;return wasm.is_match(n,r,i,a)!==0}async function load(e,t){if(typeof Response==`function`&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming==`function`)try{return await WebAssembly.instantiateStreaming(e,t)}catch(t){if(e.headers.get(`Content-Type`)!=`application/wasm`)console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}async function init(e){let t={};(typeof e==`string`||typeof Request==`function`&&e instanceof Request||typeof URL==`function`&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await load(await e,t);return wasm=n.exports,init.__wbindgen_wasm_module=r,wasm}var defaultUpdateOptions={only:[],source:``,debug:!1,data:void 0,queue:!1,force:!1};function log(e,t){console.debug(e,t)}function getDefaultOptions(){return{delimiter:`.`,debug:!1,extraDebug:!1,useMute:!0,notRecursive:`;`,param:`:`,wildcard:`*`,experimentalMatch:!1,queue:!1,defaultBulkValue:!0,useCache:!1,useSplitCache:!1,useIndicesCache:!1,maxSimultaneousJobs:1e3,maxQueueRuns:1e3,log,Promise}}function isObject$1(e){return e&&e.constructor?e.constructor.name===`Object`:typeof e==`object`&&!!e}var DeepState=class{constructor(e={},t={}){this.jobsRunning=0,this.updateQueue=[],this.subscribeQueue=[],this.listenersIgnoreCache=new WeakMap,this.is_match=null,this.destroyed=!1,this.queueRuns=0,this.groupId=0,this.namedGroups=[],this.numberGroups=[],this.traceId=0,this.traceMap=new Map,this.tracing=[],this.savedTrace=[],this.collection=null,this.collections=0,this.cache=new Map,this.splitCache=new Map,this.indices=new Map,this.indicesCount=new Map,this.lastExecs=new WeakMap,this.listeners=new Map,this.waitingListeners=new Map,this.options=Object.assign(Object.assign({},getDefaultOptions()),t),this.data=e,this.id=0,this.options.useCache?(this.pathGet=this.cacheGet,this.pathSet=this.cacheSet):(this.pathGet=ObjectPath.get,this.pathSet=ObjectPath.set),t.Promise?this.resolved=t.Promise.resolve():this.resolved=Promise.resolve(),this.muted=new Set,this.mutedListeners=new Set,this.scan=new WildcardObject(this.data,this.options.delimiter,this.options.wildcard),this.destroyed=!1}getDefaultListenerOptions(){return{bulk:!1,bulkValue:this.options.defaultBulkValue,debug:!1,source:``,data:void 0,queue:!1,group:!1}}cacheGet(e,t=this.data,n=!1){let r=e.join(this.options.delimiter),i=this.cache.get(r);if(i){let e=i.deref();if(e)return e}let a=ObjectPath.get(e,t,n);return(isObject$1(a)||Array.isArray(a))&&this.cache.set(r,new WeakRef(a)),a}cacheSet(e,t,n=this.data){let r=e.join(this.options.delimiter);return isObject$1(t)||Array.isArray(t)?this.cache.set(r,new WeakRef(t)):this.cache.delete(r),ObjectPath.set(e,t,n)}silentSet(e,t){return this.pathSet(this.split(e),t,this.data)}loadWasmMatcher(e){return __awaiter(this,void 0,void 0,function*(){yield init(e),this.is_match=is_match,this.scan=new WildcardObject(this.data,this.options.delimiter,this.options.wildcard,this.is_match)})}same(e,t){return([`number`,`string`,`undefined`,`boolean`].includes(typeof e)||e===null)&&t===e}getListeners(){return this.listeners}destroy(){this.destroyed=!0,this.data=void 0,this.listeners=new Map,this.waitingListeners=new Map,this.updateQueue=[],this.jobsRunning=0}match(e,t,n=!0){return this.is_match?this.is_match(e,t):e===t||e===this.options.wildcard||t===this.options.wildcard?!0:!n&&this.getIndicesCount(this.options.delimiter,e)<this.getIndicesCount(this.options.delimiter,t)?!1:this.scan.match(e,t)}getIndicesOf(e,t){if(this.options.useIndicesCache&&this.indices.has(t))return this.indices.get(t);let n=e.length;if(n==0)return[];let r=0,i,a=[];for(;(i=t.indexOf(e,r))>-1;)a.push(i),r=i+n;return this.options.useIndicesCache&&this.indices.set(t,a),a}getIndicesCount(e,t){if(this.options.useIndicesCache&&this.indicesCount.has(t))return this.indicesCount.get(t);let n=e.length;if(n==0)return 0;let r=0,i,a=0;for(;(i=t.indexOf(e,r))>-1;)a++,r=i+n;return this.options.useIndicesCache&&this.indicesCount.set(t,a),a}cutPath(e,t){if(t===``)return``;if(e=this.cleanNotRecursivePath(e),t=this.cleanNotRecursivePath(t),e===t)return e;let n=this.getIndicesCount(this.options.delimiter,t),r=this.getIndicesOf(this.options.delimiter,e);return e.substring(0,r[n])}trimPath(e){return e=this.cleanNotRecursivePath(e),e.charAt(0)===this.options.delimiter?e.substr(1):e}split(e){if(e===``)return[];if(!this.options.useSplitCache)return e.split(this.options.delimiter);let t=this.splitCache.get(e);if(t)return t.slice();let n=e.split(this.options.delimiter);return this.splitCache.set(e,n.slice()),n}isWildcard(e){return e.includes(this.options.wildcard)||this.hasParams(e)}isNotRecursive(e){return e.endsWith(this.options.notRecursive)}cleanNotRecursivePath(e){return this.isNotRecursive(e)?e.substring(0,e.length-1):e}hasParams(e){return e.includes(this.options.param)}getParamsInfo(e){let t={replaced:``,original:e,params:{}},n=0,r=[];for(let i of this.split(e)){t.params[n]={original:i,replaced:``,name:``};let e=RegExp(`\\${this.options.param}([^\\${this.options.delimiter}\\${this.options.param}]+)`,`g`),a=e.exec(i);if(a)t.params[n].name=a[1];else{delete t.params[n],r.push(i),n++;continue}e.lastIndex=0,t.params[n].replaced=i.replace(e,this.options.wildcard),r.push(t.params[n].replaced),n++}return t.replaced=r.join(this.options.delimiter),t}getParams(e,t){if(!e)return;let n=this.split(t),r={};for(let t in e.params){let i=e.params[t];r[i.name]=n[t]}return r}waitForAll(e,t){let n={};for(let t of e)n[t]={dirty:!1},this.hasParams(t)&&(n[t].paramsInfo=this.getParamsInfo(t)),n[t].isWildcard=this.isWildcard(t),n[t].isRecursive=!this.isNotRecursive(t);return this.waitingListeners.set(e,{fn:t,paths:n}),t(n),function(){this.waitingListeners.delete(e)}}executeWaitingListeners(e){if(!this.destroyed)for(let t of this.waitingListeners.values()){let{fn:n,paths:r}=t,i=0,a=0;for(let t in r){let n=r[t],o=!1;n.isRecursive&&(e=this.cutPath(e,t)),n.isWildcard&&this.match(t,e)&&(o=!0),e===t&&(o=!0),o&&(n.dirty=!0),n.dirty&&i++,a++}i===a&&n(r)}}subscribeAll(e,t,n=this.getDefaultListenerOptions()){if(this.destroyed)return()=>{};let r=[],i=0,a=null;typeof n.group==`boolean`&&n.group?(this.groupId++,a=this.groupId,n.bulk=!0):typeof n.group==`string`&&(n.bulk=!0,a=n.group);for(let o of e)r.push(this.subscribe(o,t,n,{all:e,index:i,groupId:a})),i++;return function(){for(let e of r)e()}}getCleanListenersCollection(e={}){return Object.assign({listeners:new Map,isRecursive:!1,isWildcard:!1,hasParams:!1,match:void 0,paramsInfo:void 0,path:void 0,originalPath:void 0,count:0},e)}getCleanListener(e,t=this.getDefaultListenerOptions()){return{fn:e,options:Object.assign(Object.assign({},this.getDefaultListenerOptions()),t),groupId:null}}getListenerCollectionMatch(e,t,n){e=this.cleanNotRecursivePath(e);let r=this;return function(i,a=!1){let o=e;return t?i=r.cutPath(i,e):o=r.cutPath(r.cleanNotRecursivePath(e),i),a&&console.log(`[getListenerCollectionMatch]`,{listenerPath:e,scopedListenerPath:o,path:i,isRecursive:t,isWildcard:n}),n&&r.match(o,i,t)?!0:o===i}}getListenersCollection(e,t){if(this.listeners.has(e)){let n=this.listeners.get(e);return n.listeners.set(++this.id,t),t.id=this.id,n}let n=this.hasParams(e),r;n&&(r=this.getParamsInfo(e));let i={isRecursive:!this.isNotRecursive(e),isWildcard:this.isWildcard(e),hasParams:n,paramsInfo:r,originalPath:e,path:n?r.replaced:e};i.isRecursive||(i.path=this.cleanNotRecursivePath(i.path));let a=this.getCleanListenersCollection(Object.assign(Object.assign({},i),{match:this.getListenerCollectionMatch(i.path,i.isRecursive,i.isWildcard)}));return this.id++,a.listeners.set(this.id,t),t.id=this.id,this.listeners.set(i.originalPath,a),a}subscribe(e,t,n=this.getDefaultListenerOptions(),r={all:[e],index:0,groupId:null}){if(this.destroyed)return()=>{};this.jobsRunning++;let i=`subscribe`,a=this.getCleanListener(t,n);n.group&&(n.bulk=!0,typeof n.group==`string`?a.groupId=n.group:r.groupId&&(a.groupId=r.groupId)),this.listenersIgnoreCache.set(a,{truthy:[],falsy:[]});let o=this.getListenersCollection(e,a);n.debug&&console.log(`[subscribe]`,{listenerPath:e,options:n}),o.count++;let s=!0;if(a.groupId&&(typeof a.groupId==`string`?this.namedGroups.includes(a.groupId)?s=!1:this.namedGroups.push(a.groupId):typeof a.groupId==`number`&&(this.numberGroups.includes(a.groupId)?s=!1:this.numberGroups.push(a.groupId))),s){let r=this.cleanNotRecursivePath(o.path),s=this.split(r);if(!o.isWildcard)!this.isMuted(r)&&!this.isMuted(t)&&t(this.pathGet(s,this.data),{type:i,listener:a,listenersCollection:o,path:{listener:e,update:void 0,resolved:this.cleanNotRecursivePath(e)},params:this.getParams(o.paramsInfo,r),options:n});else{let s=this.scan.get(r);if(n.bulk){let r=[];for(let e in s)this.isMuted(e)||r.push({path:e,params:this.getParams(o.paramsInfo,e),value:s[e]});this.isMuted(t)||t(r,{type:i,listener:a,listenersCollection:o,path:{listener:e,update:void 0,resolved:void 0},options:n,params:void 0})}else for(let r in s)!this.isMuted(r)&&!this.isMuted(t)&&t(s[r],{type:i,listener:a,listenersCollection:o,path:{listener:e,update:void 0,resolved:this.cleanNotRecursivePath(r)},params:this.getParams(o.paramsInfo,r),options:n})}}return this.debugSubscribe(a,o,e),this.jobsRunning--,this.unsubscribe(e,this.id)}unsubscribe(e,t){let n=this.listeners,r=n.get(e);return function(){r.listeners.delete(t),r.count--,r.count===0&&n.delete(e)}}runQueuedListeners(){if(!this.destroyed&&this.subscribeQueue.length!==0)if(this.jobsRunning===0){this.queueRuns=0;let e=[...this.subscribeQueue];for(let t=0,n=e.length;t<n;t++)e[t]();this.subscribeQueue.length=0}else{if(this.queueRuns++,this.queueRuns>=this.options.maxQueueRuns)throw this.queueRuns=0,Error(`Maximal number of queue runs exhausted.`);Promise.resolve().then(()=>this.runQueuedListeners()).catch(e=>{throw e})}}getQueueNotifyListeners(e,t=[]){for(let n in e){if(this.isMuted(n))continue;let{single:r,bulk:i}=e[n];for(let e of r){let n=!1,r=e.listener.id+`:`+e.eventInfo.path.resolved;e.eventInfo.path.resolved||(r=e.listener.id+`:`+e.eventInfo.path.listener);for(let e of t)if(r===e.resolvedIdPath){n=!0;break}if(n)continue;let i=this.debugTime(e);if(!this.isMuted(e.listener.fn))if(e.listener.options.queue&&this.jobsRunning)this.subscribeQueue.push(()=>{e.listener.fn(e.value?e.value():void 0,e.eventInfo)});else{let n=e.listener.id+`:`+e.eventInfo.path.resolved;e.eventInfo.path.resolved||(n=e.listener.id+`:`+e.eventInfo.path.listener),t.push({id:e.listener.id,resolvedPath:e.eventInfo.path.resolved,resolvedIdPath:n,originalFn:e.listener.fn,fn:()=>{e.listener.fn(e.value?e.value():void 0,e.eventInfo)},options:e.listener.options,groupId:e.listener.groupId})}this.debugListener(i,e)}for(let e of i){let n=!1;for(let r of t)if(r.id===e.listener.id){n=!0;break}if(n)continue;let r=this.debugTime(e),i=[];for(let t of e.value)i.push(Object.assign(Object.assign({},t),{value:t.value?t.value():void 0}));if(!this.isMuted(e.listener.fn))if(e.listener.options.queue&&this.jobsRunning)this.subscribeQueue.push(()=>this.jobsRunning?!1:(e.listener.fn(i,e.eventInfo),!0));else{let n=e.listener.id+`:`+e.eventInfo.path.resolved;e.eventInfo.path.resolved||(n=e.listener.id+`:`+e.eventInfo.path.listener),t.push({id:e.listener.id,resolvedPath:e.eventInfo.path.resolved,resolvedIdPath:n,originalFn:e.listener.fn,fn:()=>{e.listener.fn(i,e.eventInfo)},options:e.listener.options,groupId:e.listener.groupId})}this.debugListener(r,e)}}return Promise.resolve().then(()=>this.runQueuedListeners()),t}shouldIgnore(e,t){if(!e.options.ignore)return!1;for(let n of e.options.ignore){if(t.startsWith(n)||this.is_match&&this.is_match(n,t))return!0;{let e=this.cutPath(t,n);if(this.match(n,e))return!0}}return!1}getSubscribedListeners(e,t,n,r=`update`,i=null){n=Object.assign(Object.assign({},defaultUpdateOptions),n);let a={};for(let[o,s]of this.listeners)if(s.match(e)){a[o]={single:[],bulk:[],bulkData:[]};let c=s.paramsInfo?this.getParams(s.paramsInfo,e):void 0,l=this.cutPath(e,o),u=s.isRecursive||s.isWildcard?()=>this.get(l):()=>t,d=[{value:u,path:e,params:c}];for(let t of s.listeners.values()){if(this.shouldIgnore(t,e)){t.options.debug&&console.log(`[getSubscribedListeners] Listener was not fired because it was ignored.`,{listener:t,listenersCollection:s});continue}t.options.bulk?a[o].bulk.push({listener:t,listenersCollection:s,eventInfo:{type:r,listener:t,path:{listener:o,update:i||e,resolved:void 0},params:c,options:n},value:d}):a[o].single.push({listener:t,listenersCollection:s,eventInfo:{type:r,listener:t,path:{listener:o,update:i||e,resolved:this.cleanNotRecursivePath(e)},params:c,options:n},value:u})}}else if(this.options.extraDebug){let t=!1;for(let n of s.listeners.values())n.options.debug&&(t=!0,console.log(`[getSubscribedListeners] Listener was not fired because there was no match.`,{listener:n,listenersCollection:s,updatePath:e}));t&&s.match(e,!0)}return a}notifySubscribedListeners(e,t,n,r=`update`,i=null){return this.getQueueNotifyListeners(this.getSubscribedListeners(e,t,n,r,i))}useBulkValue(e){for(let[t,n]of e.listeners)if(n.options.bulk&&n.options.bulkValue||!n.options.bulk)return!0;return!1}getNestedListeners(e,t,n,r=`update`,i=null){let a={},o={};for(let[s,c]of this.listeners){if(!c.isRecursive)continue;let l=this.cutPath(s,e);if(this.match(l,e)){a[s]={single:[],bulk:[]};let u=this.trimPath(s.substr(l.length)),d=this.useBulkValue(c),f;d&&(f=o[u]?o[u]:new WildcardObject(t,this.options.delimiter,this.options.wildcard).get(u),o[u]=f);let m=c.paramsInfo?this.getParams(c.paramsInfo,e):void 0,h=[],g={};for(let[t,o]of c.listeners)if(d)for(let l in f){let u=()=>f[l],d=[e,l].join(this.options.delimiter),_={type:r,listener:o,listenersCollection:c,path:{listener:s,update:i||e,resolved:this.cleanNotRecursivePath(d)},params:m,options:n};this.shouldIgnore(o,e)||(o.options.bulk?(h.push({value:u,path:d,params:m}),g[t]=o):a[s].single.push({listener:o,listenersCollection:c,eventInfo:_,value:u}))}else{let l={type:r,listener:o,listenersCollection:c,path:{listener:s,update:i||e,resolved:void 0},params:m,options:n};if(this.shouldIgnore(o,e))continue;o.options.bulk?(h.push({value:void 0,path:void 0,params:m}),g[t]=o):a[s].single.push({listener:o,listenersCollection:c,eventInfo:l,value:void 0})}for(let t in g){let i=g[t],o={type:r,listener:i,listenersCollection:c,path:{listener:s,update:e,resolved:void 0},options:n,params:m};a[s].bulk.push({listener:i,listenersCollection:c,eventInfo:o,value:h})}}else if(this.options.extraDebug)for(let t of c.listeners.values())t.options.debug&&console.log(`[getNestedListeners] Listener was not fired because there was no match.`,{listener:t,listenersCollection:c,currentCutPath:l,updatePath:e})}return a}notifyNestedListeners(e,t,n,r=`update`,i,a=null){return this.getQueueNotifyListeners(this.getNestedListeners(e,t,n,r,a),i)}getNotifyOnlyListeners(e,t,n,r=`update`,i=null){let a={};if(typeof n.only!=`object`||!Array.isArray(n.only)||n.only[0]===void 0||!this.canBeNested(t))return a;for(let o of n.only){let s=new WildcardObject(t,this.options.delimiter,this.options.wildcard).get(o);a[o]={bulk:[],single:[]};for(let t in s){let c=e+this.options.delimiter+t;for(let[l,u]of this.listeners){let d=u.paramsInfo?this.getParams(u.paramsInfo,c):void 0;if(this.match(l,c)){let f=()=>s[t],m=[{value:f,path:c,params:d}];for(let t of u.listeners.values()){let s={type:r,listener:t,listenersCollection:u,path:{listener:l,update:i||e,resolved:this.cleanNotRecursivePath(c)},params:d,options:n};this.shouldIgnore(t,e)||(t.options.bulk?a[o].bulk.some(e=>e.listener===t)||a[o].bulk.push({listener:t,listenersCollection:u,eventInfo:s,value:m}):a[o].single.push({listener:t,listenersCollection:u,eventInfo:s,value:f}))}}}}}return a}runQueue(e){let t=[];for(let n of e)n.options.group?t.includes(n.groupId)||(n.fn(),t.push(n.groupId)):n.fn()}sortAndRunQueue(e,t){e.sort(function(e,t){return e.id-t.id}),this.options.debug&&console.log(`[deep-state-observer] queue for ${t}`,e),this.runQueue(e)}notifyOnly(e,t,n,r=`update`,i=``){let a=this.getQueueNotifyListeners(this.getNotifyOnlyListeners(e,t,n,r,i));this.sortAndRunQueue(a,e)}canBeNested(e){return typeof e==`object`&&!!e}getUpdateValues(e,t){let n=t;return typeof t==`function`&&(n=t(e)),{newValue:n,oldValue:e}}wildcardNotify(e,t){let n=[];for(let t of e)this.getQueueNotifyListeners(t,n);for(let e of t)this.executeWaitingListeners(e);return this.jobsRunning--,n}wildcardUpdate(e,t,n=defaultUpdateOptions,r=!1){++this.jobsRunning,n=Object.assign(Object.assign({},defaultUpdateOptions),n);let i=this.scan.get(e),a={};for(let e in i){let r=this.split(e),{oldValue:o,newValue:s}=this.getUpdateValues(i[e],t);(!this.same(s,o)||n.force)&&(this.pathSet(r,s,this.data),a[e]=s)}let o=[],s=[];for(let t in a){let r=a[t];n.only.length?o.push(this.getNotifyOnlyListeners(t,r,n,`update`,e)):(o.push(this.getSubscribedListeners(t,r,n,`update`,e)),this.canBeNested(r)&&o.push(this.getNestedListeners(t,r,n,`update`,e))),n.debug&&this.options.log(`Wildcard update`,{path:t,newValue:r}),s.push(t)}if(r){let t=this;return function(){let n=t.wildcardNotify(o,s);t.sortAndRunQueue(n,e)}}let c=this.wildcardNotify(o,s);this.sortAndRunQueue(c,e)}runUpdateQueue(){if(!this.destroyed)for(;this.updateQueue.length&&this.updateQueue.length<this.options.maxSimultaneousJobs;){let e=this.updateQueue.shift();e.options.queue=!1,this.update(e.updatePath,e.fnOrValue,e.options,e.multi)}}updateNotify(e,t,n){let r=this.notifySubscribedListeners(e,t,n);this.canBeNested(t)&&this.notifyNestedListeners(e,t,n,`update`,r),this.sortAndRunQueue(r,e),this.executeWaitingListeners(e)}updateNotifyAll(e){let t=[];for(let n of e){let e=n.newValue;if(this.tracing.length){let t=this.tracing[this.tracing.length-1],r=this.traceMap.get(t);r.changed.push({traceId:t,updatePath:n.updatePath,fnOrValue:e,options:n.options}),this.traceMap.set(t,r)}t=t.concat(this.notifySubscribedListeners(n.updatePath,e,n.options)),this.canBeNested(n.newValue)&&this.notifyNestedListeners(n.updatePath,e,n.options,`update`,t)}this.runQueue(t)}updateNotifyOnly(e,t,n){this.notifyOnly(e,t,n),this.executeWaitingListeners(e)}update(e,t,n=Object.assign({},defaultUpdateOptions),r=!1){if(this.destroyed)return;if(this.collection)return this.collection.update(e,t,n);if(this.tracing.length){let r=this.tracing[this.tracing.length-1],i=this.traceMap.get(r);i.changed.push({traceId:r,updatePath:e,fnOrValue:t,options:n}),this.traceMap.set(r,i)}let i=this.jobsRunning;if((this.options.queue||n.queue)&&i){if(i>this.options.maxSimultaneousJobs)throw Error(`Maximal simultaneous jobs limit reached.`);this.updateQueue.push({updatePath:e,fnOrValue:t,options:n,multi:r});let a=Promise.resolve().then(()=>{this.runUpdateQueue()});return r?function(){return a}:a}if(this.isWildcard(e))return this.wildcardUpdate(e,t,n,r);++this.jobsRunning;let a=this.split(e),o=this.pathGet(a,this.data),{oldValue:s,newValue:c}=this.getUpdateValues(o,t);if(n.debug&&this.options.log(`Updating ${e} ${n.source?`from ${n.source}`:``}`,{oldValue:s,newValue:c}),this.same(c,s)&&!n.force)return--this.jobsRunning,r?function(){return c}:c;if(this.pathSet(a,c,this.data),n=Object.assign(Object.assign({},defaultUpdateOptions),n),n.only===null)return--this.jobsRunning,r?function(){}:c;if(n.only.length){if(--this.jobsRunning,r){let t=this;return function(){return t.updateNotifyOnly(e,c,n)}}return this.updateNotifyOnly(e,c,n),c}if(r){--this.jobsRunning;let t=this;return function(){return t.updateNotify(e,c,n)}}return this.updateNotify(e,c,n),--this.jobsRunning,c}multi(e=!1){if(this.destroyed)return{update(){return this},done(){},getStack(){return[]}};if(this.collection)return this.collection;let t=this,n=[],r=[];return{update(i,a,o=defaultUpdateOptions){if(e){let e=t.split(i),r=a,s=t.pathGet(e,t.data);typeof r==`function`&&(r=r(s)),t.pathSet(e,r,t.data),n.push({updatePath:i,newValue:r,options:o})}else r.push(t.update(i,a,o,!0));return this},done(){if(t.collections===0){if(e)t.updateNotifyAll(n);else for(let e of r)e();n.length=0}},getStack(){return n}}}collect(){return this.collections++,this.collection||(this.collection=this.multi(!0)),this.collection}executeCollected(){if(this.collections--,this.collections===0&&this.collection){let e=this.collection;this.collection=null,e.done()}}getCollectedCount(){return this.collections}getCollectedStack(){return this.collection?this.collection.getStack():[]}get(e=void 0){if(!this.destroyed)return e===void 0||e===``?this.data:this.isWildcard(e)?this.scan.get(e):this.pathGet(this.split(e),this.data)}last(e){let t=this.lastExecs.get(e);t||(t={calls:0},this.lastExecs.set(e,t));let n=++t.calls;this.resolved.then(()=>{n===t.calls&&(this.lastExecs.set(e,{calls:0}),e())})}isMuted(e){if(!this.options.useMute)return!1;if(typeof e==`function`)return this.isMutedListener(e);for(let t of this.muted){let n=!this.isNotRecursive(t),r=this.trimPath(t);if(this.match(e,r)||this.match(r,e))return!0;if(n){let n=this.cutPath(r,e);if(this.match(n,t)||this.match(t,n))return!0}}return!1}isMutedListener(e){return this.mutedListeners.has(e)}mute(e){if(typeof e==`function`)return this.mutedListeners.add(e);this.muted.add(e)}unmute(e){if(typeof e==`function`)return this.mutedListeners.delete(e);this.muted.delete(e)}debugSubscribe(e,t,n){e.options.debug&&this.options.log(`listener subscribed`,{listenerPath:n,listener:e,listenersCollection:t})}debugListener(e,t){(t.eventInfo.options.debug||t.listener.options.debug)&&this.options.log(`Listener fired`,{time:Date.now()-e,info:t})}debugTime(e){return e.listener.options.debug||e.eventInfo.options.debug?Date.now():0}startTrace(e,t=null){this.traceId++;let n=this.traceId+`:`+e;return this.traceMap.set(n,{id:n,sort:this.traceId,stack:this.tracing.map(e=>e),additionalData:t,changed:[]}),this.tracing.push(n),n}stopTrace(e){let t=this.traceMap.get(e);return this.tracing.pop(),this.traceMap.delete(e),t}saveTrace(e){let t=this.traceMap.get(e);return this.tracing.pop(),this.traceMap.delete(e),this.savedTrace.push(t),t}getSavedTraces(){let e=this.savedTrace.map(e=>e);return e.sort((e,t)=>e.sort-t.sort),this.savedTrace=[],e}},ignoreFirstCall=e=>{let t=0;return(...n)=>{if(t===0){t+=1;return}return e(...n)}},DeepObservedData=class extends ObservedData{constructor(e){super(),_defineProperty(this,`state`,void 0),_defineProperty(this,`subscribers`,new Map),_defineProperty(this,`update`,(e,t)=>{this.state?.update(t??``,e)}),_defineProperty(this,`on`,(e,t,n)=>{let r=this.state.subscribe(e,n?.immediate?t:ignoreFirstCall(t)),i=this.subscribers.get(e)??new Map;i.set(t,r),this.subscribers.set(e,i)}),_defineProperty(this,`off`,(e,t)=>{let n=this.subscribers.get(e);n&&(n.get(t)?.(),n.delete(t))}),_defineProperty(this,`getData`,e=>this.state?this.state?.get(e):{}),_defineProperty(this,`destroy`,()=>{this.subscribers.forEach(e=>{e.forEach(e=>e())})}),this.state=new DeepState(e)}},scriptRel=`modulepreload`,assetsURL=function(e){return`/tmagic-editor/playground/runtime/vue/page/`+e},seen={},__vitePreload=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=assetsURL(t,n),t in seen)return;seen[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:scriptRel,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},components={button:()=>__vitePreload(()=>import(`./src-BXss9Jhd.js`),__vite__mapDeps([0,1,2])),container:()=>__vitePreload(()=>import(`./Container-B6WpfP9L.js`),__vite__mapDeps([3,1,2,4])),img:()=>__vitePreload(()=>import(`./src-DEYQBGfh.js`),__vite__mapDeps([5,1,2])),"iterator-container":()=>__vitePreload(()=>import(`./IteratorContainer-B85QPVJk.js`),__vite__mapDeps([6,1,2,4])),overlay:()=>__vitePreload(()=>import(`./src-BJeftTdO.js`),__vite__mapDeps([7,1,2])),page:()=>__vitePreload(()=>import(`./src-tqomN4QE.js`),__vite__mapDeps([8,1,2,4])),"page-fragment":()=>__vitePreload(()=>import(`./PageFragment-hbRs0O1t.js`),__vite__mapDeps([9,1,2,4])),"page-fragment-container":()=>__vitePreload(()=>import(`./PageFragmentContainer-LPPEzQLU.js`),__vite__mapDeps([10,1,2,11])),qrcode:()=>__vitePreload(()=>import(`./src-U7-wytBs.js`),__vite__mapDeps([12,1,2])),text:()=>__vitePreload(()=>import(`./src-Atml0YQg.js`),__vite__mapDeps([13,1,2]))},datasources={},plugins={};function bind(e,t){return function(){return e.apply(t,arguments)}}var{toString}=Object.prototype,{getPrototypeOf}=Object,{iterator,toStringTag}=Symbol,kindOf=(e=>t=>{let n=toString.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=e=>(e=e.toLowerCase(),t=>kindOf(t)===e),typeOfTest=e=>t=>typeof t===e,{isArray}=Array,isUndefined=typeOfTest(`undefined`);function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction$1(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var isArrayBuffer=kindOfTest(`ArrayBuffer`);function isArrayBufferView(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&isArrayBuffer(e.buffer),t}var isString=typeOfTest(`string`),isFunction$1=typeOfTest(`function`),isNumber=typeOfTest(`number`),isObject=e=>typeof e==`object`&&!!e,isBoolean=e=>e===!0||e===!1,isPlainObject=e=>{if(kindOf(e)!==`object`)return!1;let t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(toStringTag in e)&&!(iterator in e)},isEmptyObject=e=>{if(!isObject(e)||isBuffer(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},isDate=kindOfTest(`Date`),isFile=kindOfTest(`File`),isBlob=kindOfTest(`Blob`),isFileList=kindOfTest(`FileList`),isStream=e=>isObject(e)&&isFunction$1(e.pipe),isFormData=e=>{let t;return e&&(typeof FormData==`function`&&e instanceof FormData||isFunction$1(e.append)&&((t=kindOf(e))===`formdata`||t===`object`&&isFunction$1(e.toString)&&e.toString()===`[object FormData]`))},isURLSearchParams=kindOfTest(`URLSearchParams`),[isReadableStream,isRequest,isResponse,isHeaders]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(kindOfTest),trim=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function forEach(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),isArray(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(isBuffer(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function findKey(e,t){if(isBuffer(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}var _global=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,isContextDefined=e=>!isUndefined(e)&&e!==_global;function merge(){let{caseless:e,skipUndefined:t}=isContextDefined(this)&&this||{},n={},r=(r,i)=>{let a=e&&findKey(n,i)||i;isPlainObject(n[a])&&isPlainObject(r)?n[a]=merge(n[a],r):isPlainObject(r)?n[a]=merge({},r):isArray(r)?n[a]=r.slice():(!t||!isUndefined(r))&&(n[a]=r)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&forEach(arguments[e],r);return n}var extend=(e,t,n,{allOwnKeys:r}={})=>(forEach(t,(t,r)=>{n&&isFunction$1(t)?e[r]=bind(t,n):e[r]=t},{allOwnKeys:r}),e),stripBOM=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),inherits=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,`super`,{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject=(e,t,n,r)=>{let i,a,o,s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},endsWith=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},toArray=e=>{if(!e)return null;if(isArray(e))return e;let t=e.length;if(!isNumber(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},isTypedArray=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&getPrototypeOf(Uint8Array)),forEachEntry=(e,t)=>{let n=(e&&e[iterator]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},matchAll=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},isHTMLForm=kindOfTest(`HTMLFormElement`),toCamelCase=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),hasOwnProperty=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),isRegExp=kindOfTest(`RegExp`),reduceDescriptors=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};forEach(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},freezeMethods=e=>{reduceDescriptors(e,(t,n)=>{if(isFunction$1(e)&&[`arguments`,`caller`,`callee`].indexOf(n)!==-1)return!1;let r=e[n];if(isFunction$1(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)})}})},toObjectSet=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return isArray(e)?r(e):r(String(e).split(t)),n},noop=()=>{},toFiniteNumber=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function isSpecCompliantForm(e){return!!(e&&isFunction$1(e.append)&&e[toStringTag]===`FormData`&&e[iterator])}var toJSONObject=e=>{let t=Array(10),n=(e,r)=>{if(isObject(e)){if(t.indexOf(e)>=0)return;if(isBuffer(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=isArray(e)?[]:{};return forEach(e,(e,t)=>{let a=n(e,r+1);!isUndefined(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn=kindOfTest(`AsyncFunction`),isThenable=e=>e&&(isObject(e)||isFunction$1(e))&&isFunction$1(e.then)&&isFunction$1(e.catch),_setImmediate=((e,t)=>e?setImmediate:t?((e,t)=>(_global.addEventListener(`message`,({source:n,data:r})=>{n===_global&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),_global.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,isFunction$1(_global.postMessage)),asap=typeof queueMicrotask<`u`?queueMicrotask.bind(_global):typeof process<`u`&&process.nextTick||_setImmediate,isIterable=e=>e!=null&&isFunction$1(e[iterator]),utils_default={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isBoolean,isObject,isPlainObject,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile,isBlob,isRegExp,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge,extend,trim,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};function AxiosError(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name=`AxiosError`,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}utils_default.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils_default.toJSONObject(this.config),code:this.code,status:this.status}}});var prototype$1=AxiosError.prototype,descriptors={};[`ERR_BAD_OPTION_VALUE`,`ERR_BAD_OPTION`,`ECONNABORTED`,`ETIMEDOUT`,`ERR_NETWORK`,`ERR_FR_TOO_MANY_REDIRECTS`,`ERR_DEPRECATED`,`ERR_BAD_RESPONSE`,`ERR_BAD_REQUEST`,`ERR_CANCELED`,`ERR_NOT_SUPPORT`,`ERR_INVALID_URL`].forEach(e=>{descriptors[e]={value:e}}),Object.defineProperties(AxiosError,descriptors),Object.defineProperty(prototype$1,`isAxiosError`,{value:!0}),AxiosError.from=(e,t,n,r,i,a)=>{let o=Object.create(prototype$1);utils_default.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>e!==`isAxiosError`);let s=e&&e.message?e.message:`Error`,c=t==null&&e?e.code:t;return AxiosError.call(o,s,c,n,r,i),e&&o.cause==null&&Object.defineProperty(o,`cause`,{value:e,configurable:!0}),o.name=e&&e.name||`Error`,a&&Object.assign(o,a),o};function isVisitable(e){return utils_default.isPlainObject(e)||utils_default.isArray(e)}function removeBrackets(e){return utils_default.endsWith(e,`[]`)?e.slice(0,-2):e}function renderKey(e,t,n){return e?e.concat(t).map(function(e,t){return e=removeBrackets(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function isFlatArray(e){return utils_default.isArray(e)&&!e.some(isVisitable)}var predicates=utils_default.toFlatObject(utils_default,{},null,function(e){return/^is[A-Z]/.test(e)});function toFormData(e,t,n){if(!utils_default.isObject(e))throw TypeError(`target must be an object`);t=t||new FormData,n=utils_default.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!utils_default.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||l,a=n.dots,o=n.indexes,s=(n.Blob||typeof Blob<`u`&&Blob)&&utils_default.isSpecCompliantForm(t);if(!utils_default.isFunction(i))throw TypeError(`visitor must be a function`);function c(e){if(e===null)return``;if(utils_default.isDate(e))return e.toISOString();if(utils_default.isBoolean(e))return e.toString();if(!s&&utils_default.isBlob(e))throw new AxiosError(`Blob is not supported. Use a Buffer instead.`);return utils_default.isArrayBuffer(e)||utils_default.isTypedArray(e)?s&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let s=e;if(e&&!i&&typeof e==`object`){if(utils_default.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(utils_default.isArray(e)&&isFlatArray(e)||(utils_default.isFileList(e)||utils_default.endsWith(n,`[]`))&&(s=utils_default.toArray(e)))return n=removeBrackets(n),s.forEach(function(e,r){!(utils_default.isUndefined(e)||e===null)&&t.append(o===!0?renderKey([n],r,a):o===null?n:n+`[]`,c(e))}),!1}return isVisitable(e)?!0:(t.append(renderKey(i,n,a),c(e)),!1)}let u=[],d=Object.assign(predicates,{defaultVisitor:l,convertValue:c,isVisitable});function f(e,n){if(!utils_default.isUndefined(e)){if(u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),utils_default.forEach(e,function(e,r){(!(utils_default.isUndefined(e)||e===null)&&i.call(t,e,utils_default.isString(r)?r.trim():r,n,d))===!0&&f(e,n?n.concat(r):[r])}),u.pop()}}if(!utils_default.isObject(e))throw TypeError(`data must be an object`);return f(e),t}function encode$1(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function AxiosURLSearchParams(e,t){this._pairs=[],e&&toFormData(e,this,t)}var prototype=AxiosURLSearchParams.prototype;prototype.append=function(e,t){this._pairs.push([e,t])},prototype.toString=function(e){let t=e?function(t){return e.call(this,t,encode$1)}:encode$1;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function buildURL(e,t,n){if(!t)return e;let r=n&&n.encode||encode;utils_default.isFunction(n)&&(n={serialize:n});let i=n&&n.serialize,a;if(a=i?i(t,n):utils_default.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,n).toString(r),a){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+a}return e}var InterceptorManager=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){utils_default.forEach(this.handlers,function(t){t!==null&&e(t)})}},transitional_default={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams_default=typeof URLSearchParams<`u`?URLSearchParams:AxiosURLSearchParams,FormData_default=typeof FormData<`u`?FormData:null,Blob_default=typeof Blob<`u`?Blob:null,browser_default={isBrowser:!0,classes:{URLSearchParams:URLSearchParams_default,FormData:FormData_default,Blob:Blob_default},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},utils_exports=__exportAll({hasBrowserEnv:()=>hasBrowserEnv,hasStandardBrowserEnv:()=>hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv:()=>hasStandardBrowserWebWorkerEnv,navigator:()=>_navigator,origin:()=>origin}),hasBrowserEnv=typeof window<`u`&&typeof document<`u`,_navigator=typeof navigator==`object`&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||[`ReactNative`,`NativeScript`,`NS`].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,origin=hasBrowserEnv&&window.location.href||`http://localhost`,platform_default={...utils_exports,...browser_default};function toURLEncodedForm(e,t){return toFormData(e,new platform_default.classes.URLSearchParams,{visitor:function(e,t,n,r){return platform_default.isNode&&utils_default.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function parsePropPath(e){return utils_default.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function arrayToObject(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function formDataToJSON(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&utils_default.isArray(r)?r.length:a,s?(utils_default.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):((!r[a]||!utils_default.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&utils_default.isArray(r[a])&&(r[a]=arrayToObject(r[a])),!o)}if(utils_default.isFormData(e)&&utils_default.isFunction(e.entries)){let n={};return utils_default.forEachEntry(e,(e,r)=>{t(parsePropPath(e),r,n,0)}),n}return null}function stringifySafely(e,t,n){if(utils_default.isString(e))try{return(t||JSON.parse)(e),utils_default.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var defaults={transitional:transitional_default,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=utils_default.isObject(e);if(i&&utils_default.isHTMLForm(e)&&(e=new FormData(e)),utils_default.isFormData(e))return r?JSON.stringify(formDataToJSON(e)):e;if(utils_default.isArrayBuffer(e)||utils_default.isBuffer(e)||utils_default.isStream(e)||utils_default.isFile(e)||utils_default.isBlob(e)||utils_default.isReadableStream(e))return e;if(utils_default.isArrayBufferView(e))return e.buffer;if(utils_default.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return toURLEncodedForm(e,this.formSerializer).toString();if((a=utils_default.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let t=this.env&&this.env.FormData;return toFormData(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType(`application/json`,!1),stringifySafely(e)):e}],transformResponse:[function(e){let t=this.transitional||defaults.transitional,n=t&&t.forcedJSONParsing,r=this.responseType===`json`;if(utils_default.isResponse(e)||utils_default.isReadableStream(e))return e;if(e&&utils_default.isString(e)&&(n&&!this.responseType||r)){let n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n)throw e.name===`SyntaxError`?AxiosError.from(e,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform_default.classes.FormData,Blob:platform_default.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};utils_default.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`],e=>{defaults.headers[e]={}});var ignoreDuplicateOf=utils_default.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),parseHeaders_default=e=>{let t={},n,r,i;return e&&e.split(`
|
|
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&ignoreDuplicateOf[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},$internals=Symbol(`internals`);function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){return e===!1||e==null?e:utils_default.isArray(e)?e.map(normalizeValue):String(e)}function parseTokens(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var isValidHeaderName=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function matchHeaderValue(e,t,n,r,i){if(utils_default.isFunction(r))return r.call(this,t,n);if(i&&(t=n),utils_default.isString(t)){if(utils_default.isString(r))return t.indexOf(r)!==-1;if(utils_default.isRegExp(r))return r.test(t)}}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function buildAccessors(e,t){let n=utils_default.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var AxiosHeaders=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=normalizeHeader(t);if(!i)throw Error(`header name must be a non-empty string`);let a=utils_default.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=normalizeValue(e))}let a=(e,t)=>utils_default.forEach(e,(e,n)=>i(e,n,t));if(utils_default.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(utils_default.isString(e)&&(e=e.trim())&&!isValidHeaderName(e))a(parseHeaders_default(e),t);else if(utils_default.isObject(e)&&utils_default.isIterable(e)){let n={},r,i;for(let t of e){if(!utils_default.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?utils_default.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=normalizeHeader(e),e){let n=utils_default.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return parseTokens(e);if(utils_default.isFunction(t))return t.call(this,e,n);if(utils_default.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=normalizeHeader(e),e){let n=utils_default.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||matchHeaderValue(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=normalizeHeader(e),e){let i=utils_default.findKey(n,e);i&&(!t||matchHeaderValue(n,n[i],i,t))&&(delete n[i],r=!0)}}return utils_default.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||matchHeaderValue(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return utils_default.forEach(this,(r,i)=>{let a=utils_default.findKey(n,i);if(a){t[a]=normalizeValue(r),delete t[i];return}let o=e?formatHeader(i):String(i).trim();o!==i&&delete t[i],t[o]=normalizeValue(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return utils_default.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&utils_default.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
|
|
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[$internals]=this[$internals]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=normalizeHeader(e);t[r]||(buildAccessors(n,e),t[r]=!0)}return utils_default.isArray(e)?e.forEach(r):r(e),this}};AxiosHeaders.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),utils_default.reduceDescriptors(AxiosHeaders.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),utils_default.freezeMethods(AxiosHeaders);function transformData(e,t){let n=this||defaults,r=t||n,i=AxiosHeaders.from(r.headers),a=r.data;return utils_default.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function isCancel(e){return!!(e&&e.__CANCEL__)}function CanceledError(e,t,n){AxiosError.call(this,e??`canceled`,AxiosError.ERR_CANCELED,t,n),this.name=`CanceledError`}utils_default.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new AxiosError(`Request failed with status code `+n.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function parseProtocol(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function speedometer(e,t){e=e||10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||(o=c),n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function throttle(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&(clearTimeout(a),a=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||(a=setTimeout(()=>{a=null,o(i)},r-s)))},()=>i&&o(i)]}var progressEventReducer=(e,t,n=3)=>{let r=0,i=speedometer(50,250);return throttle(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=a-r,c=i(s),l=a<=o;r=a,e({loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},progressEventDecorator=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},asyncDecorator=e=>(...t)=>utils_default.asap(()=>e(...t)),isURLSameOrigin_default=platform_default.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,platform_default.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(platform_default.origin),platform_default.navigator&&/(msie|trident)/i.test(platform_default.navigator.userAgent)):()=>!0,cookies_default=platform_default.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];utils_default.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),utils_default.isString(r)&&s.push(`path=${r}`),utils_default.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),utils_default.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function buildFullPath(e,t,n){let r=!isAbsoluteURL(t);return e&&(r||n==0)?combineURLs(e,t):t}var headersToObject=e=>e instanceof AxiosHeaders?{...e}:e;function mergeConfig(e,t){t=t||{};let n={};function r(e,t,n,r){return utils_default.isPlainObject(e)&&utils_default.isPlainObject(t)?utils_default.merge.call({caseless:r},e,t):utils_default.isPlainObject(t)?utils_default.merge({},t):utils_default.isArray(t)?t.slice():t}function i(e,t,n,i){if(!utils_default.isUndefined(t))return r(e,t,n,i);if(!utils_default.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!utils_default.isUndefined(t))return r(void 0,t)}function o(e,t){if(!utils_default.isUndefined(t))return r(void 0,t);if(!utils_default.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(a in t)return r(n,i);if(a in e)return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(headersToObject(e),headersToObject(t),n,!0)};return utils_default.forEach(Object.keys({...e,...t}),function(r){let a=c[r]||i,o=a(e[r],t[r],r);utils_default.isUndefined(o)&&a!==s||(n[r]=o)}),n}var resolveConfig_default=e=>{let t=mergeConfig({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=AxiosHeaders.from(o),t.url=buildURL(buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set(`Authorization`,`Basic `+btoa((s.username||``)+`:`+(s.password?unescape(encodeURIComponent(s.password)):``))),utils_default.isFormData(n)){if(platform_default.hasStandardBrowserEnv||platform_default.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(utils_default.isFunction(n.getHeaders)){let e=n.getHeaders(),t=[`content-type`,`content-length`];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)})}}if(platform_default.hasStandardBrowserEnv&&(r&&utils_default.isFunction(r)&&(r=r(t)),r||r!==!1&&isURLSameOrigin_default(t.url))){let e=i&&a&&cookies_default.read(a);e&&o.set(i,e)}return t},isXHRAdapterSupported=typeof XMLHttpRequest<`u`,xhr_default=isXHRAdapterSupported&&function(e){return new Promise(function(t,n){let r=resolveConfig_default(e),i=r.data,a=AxiosHeaders.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,m;function h(){f&&f(),m&&m(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let g=new XMLHttpRequest;g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout;function _(){if(!g)return;let r=AxiosHeaders.from(`getAllResponseHeaders`in g&&g.getAllResponseHeaders());settle(function(e){t(e),h()},function(e){n(e),h()},{data:!o||o===`text`||o===`json`?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:r,config:e,request:g}),g=null}`onloadend`in g?g.onloadend=_:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf(`file:`)===0)||setTimeout(_)},g.onabort=function(){g&&(n(new AxiosError(`Request aborted`,AxiosError.ECONNABORTED,e,g)),g=null)},g.onerror=function(t){let r=new AxiosError(t&&t.message?t.message:`Network Error`,AxiosError.ERR_NETWORK,e,g);r.event=t||null,n(r),g=null},g.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||transitional_default;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new AxiosError(t,i.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,e,g)),g=null},i===void 0&&a.setContentType(null),`setRequestHeader`in g&&utils_default.forEach(a.toJSON(),function(e,t){g.setRequestHeader(t,e)}),utils_default.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),o&&o!==`json`&&(g.responseType=r.responseType),c&&([d,m]=progressEventReducer(c,!0),g.addEventListener(`progress`,d)),s&&g.upload&&([u,f]=progressEventReducer(s),g.upload.addEventListener(`progress`,u),g.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{g&&(n(!t||t.type?new CanceledError(null,e,g):t),g.abort(),g=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let v=parseProtocol(r.url);if(v&&platform_default.protocols.indexOf(v)===-1){n(new AxiosError(`Unsupported protocol `+v+`:`,AxiosError.ERR_BAD_REQUEST,e));return}g.send(i||null)})},composeSignals=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof AxiosError?t:new CanceledError(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new AxiosError(`timeout ${t} of ms exceeded`,AxiosError.ETIMEDOUT))},t),o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),e=null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>utils_default.asap(o),s}},streamChunk=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},readBytes=async function*(e,t){for await(let n of readStream(e))yield*streamChunk(n,t)},readStream=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},trackStream=(e,t,n,r)=>{let i=readBytes(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},DEFAULT_CHUNK_SIZE=64*1024,{isFunction}=utils_default,globalFetchAPI=(({Request:e,Response:t})=>({Request:e,Response:t}))(utils_default.global),{ReadableStream:ReadableStream$1,TextEncoder:TextEncoder$1}=utils_default.global,test=(e,...t)=>{try{return!!e(...t)}catch{return!1}},factory=e=>{e=utils_default.merge.call({skipUndefined:!0},globalFetchAPI,e);let{fetch:t,Request:n,Response:r}=e,i=t?isFunction(t):typeof fetch==`function`,a=isFunction(n),o=isFunction(r);if(!i)return!1;let s=i&&isFunction(ReadableStream$1),c=i&&(typeof TextEncoder$1==`function`?(e=>t=>e.encode(t))(new TextEncoder$1):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=a&&s&&test(()=>{let e=!1,t=new n(platform_default.origin,{body:new ReadableStream$1,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`);return e&&!t}),u=o&&s&&test(()=>utils_default.isReadableStream(new r(``).body)),d={stream:u&&(e=>e.body)};i&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new AxiosError(`Response type '${e}' is not supported`,AxiosError.ERR_NOT_SUPPORT,n)})});let f=async e=>{if(e==null)return 0;if(utils_default.isBlob(e))return e.size;if(utils_default.isSpecCompliantForm(e))return(await new n(platform_default.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(utils_default.isArrayBufferView(e)||utils_default.isArrayBuffer(e))return e.byteLength;if(utils_default.isURLSearchParams(e)&&(e+=``),utils_default.isString(e))return(await c(e)).byteLength},m=async(e,t)=>utils_default.toFiniteNumber(e.getContentLength())??f(t);return async e=>{let{url:i,method:o,data:s,signal:c,cancelToken:f,timeout:h,onDownloadProgress:g,onUploadProgress:_,responseType:v,headers:y,withCredentials:b=`same-origin`,fetchOptions:x}=resolveConfig_default(e),S=t||fetch;v=v?(v+``).toLowerCase():`text`;let C=composeSignals([c,f&&f.toAbortSignal()],h),w=null,T=C&&C.unsubscribe&&(()=>{C.unsubscribe()}),E;try{if(_&&l&&o!==`get`&&o!==`head`&&(E=await m(y,s))!==0){let e=new n(i,{method:`POST`,body:s,duplex:`half`}),t;if(utils_default.isFormData(s)&&(t=e.headers.get(`content-type`))&&y.setContentType(t),e.body){let[t,n]=progressEventDecorator(E,progressEventReducer(asyncDecorator(_)));s=trackStream(e.body,DEFAULT_CHUNK_SIZE,t,n)}}utils_default.isString(b)||(b=b?`include`:`omit`);let t=a&&`credentials`in n.prototype,c={...x,signal:C,method:o.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:`half`,credentials:t?b:void 0};w=a&&new n(i,c);let f=await(a?S(w,x):S(i,c)),h=u&&(v===`stream`||v===`response`);if(u&&(g||h&&T)){let e={};[`status`,`statusText`,`headers`].forEach(t=>{e[t]=f[t]});let t=utils_default.toFiniteNumber(f.headers.get(`content-length`)),[n,i]=g&&progressEventDecorator(t,progressEventReducer(asyncDecorator(g),!0))||[];f=new r(trackStream(f.body,DEFAULT_CHUNK_SIZE,n,()=>{i&&i(),T&&T()}),e)}v=v||`text`;let D=await d[utils_default.findKey(d,v)||`text`](f,e);return!h&&T&&T(),await new Promise((t,n)=>{settle(t,n,{data:D,headers:AxiosHeaders.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:w})})}catch(t){throw T&&T(),t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new AxiosError(`Network Error`,AxiosError.ERR_NETWORK,e,w),{cause:t.cause||t}):AxiosError.from(t,t&&t.code,e,w)}}},seedCache=new Map,getFetch=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=seedCache;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:factory(t)),l=c;return c},adapter=getFetch(),knownAdapters={http:null,xhr:xhr_default,fetch:{get:getFetch}};utils_default.forEach(knownAdapters,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{value:t})}catch{}Object.defineProperty(e,`adapterName`,{value:t})}});var renderReason=e=>`- ${e}`,isResolvedHandle=e=>utils_default.isFunction(e)||e===null||e===!1;function getAdapter(e,t){e=utils_default.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!isResolvedHandle(r)&&(i=knownAdapters[(n=String(r)).toLowerCase()],i===void 0))throw new AxiosError(`Unknown adapter '${n}'`);if(i&&(utils_default.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new AxiosError(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
|
|
`+e.map(renderReason).join(`
|
|
`):` `+renderReason(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var adapters_default={getAdapter,adapters:knownAdapters};function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError(null,e)}function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=AxiosHeaders.from(e.headers),e.data=transformData.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),adapters_default.getAdapter(e.adapter||defaults.adapter,e)(e).then(function(t){return throwIfCancellationRequested(e),t.data=transformData.call(e,e.transformResponse,t),t.headers=AxiosHeaders.from(t.headers),t},function(t){return isCancel(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=transformData.call(e,e.transformResponse,t.response),t.response.headers=AxiosHeaders.from(t.response.headers))),Promise.reject(t)})}var VERSION=`1.13.2`,validators$1={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{validators$1[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var deprecatedWarnings={};validators$1.transitional=function(e,t,n){function r(e,t){return`[Axios v`+VERSION+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new AxiosError(r(i,` has been removed`+(t?` in `+t:``)),AxiosError.ERR_DEPRECATED);return t&&!deprecatedWarnings[i]&&(deprecatedWarnings[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},validators$1.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function assertOptions(e,t,n){if(typeof e!=`object`)throw new AxiosError(`options must be an object`,AxiosError.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=t[a];if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new AxiosError(`option `+a+` must be `+n,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new AxiosError(`Unknown option `+a,AxiosError.ERR_BAD_OPTION)}}var validator_default={assertOptions,validators:validators$1},validators=validator_default.validators,Axios=class{constructor(e){this.defaults=e||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=t.stack?t.stack.replace(/^.+\n/,``):``;try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,``))&&(e.stack+=`
|
|
`+n):e.stack=n}catch{}}throw e}}_request(e,t){typeof e==`string`?(t=t||{},t.url=e):t=e||{},t=mergeConfig(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&validator_default.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),r!=null&&(utils_default.isFunction(r)?t.paramsSerializer={serialize:r}:validator_default.assertOptions(r,{encode:validators.function,serialize:validators.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),validator_default.assertOptions(t,{baseUrl:validators.spelling(`baseURL`),withXsrfToken:validators.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&utils_default.merge(i.common,i[t.method]);i&&utils_default.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=AxiosHeaders.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){typeof e.runWhen==`function`&&e.runWhen(t)===!1||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[dispatchRequest.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=dispatchRequest.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=mergeConfig(this.defaults,e),buildURL(buildFullPath(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};utils_default.forEach([`delete`,`get`,`head`,`options`],function(e){Axios.prototype[e]=function(t,n){return this.request(mergeConfig(n||{},{method:e,url:t,data:(n||{}).data}))}}),utils_default.forEach([`post`,`put`,`patch`],function(e){function t(t){return function(n,r,i){return this.request(mergeConfig(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}Axios.prototype[e]=t(),Axios.prototype[e+`Form`]=t(!0)});var CancelToken=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new CanceledError(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function spread(e){return function(t){return e.apply(null,t)}}function isAxiosError(e){return utils_default.isObject(e)&&e.isAxiosError===!0}var HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(HttpStatusCode).forEach(([e,t])=>{HttpStatusCode[t]=e});function createInstance(e){let t=new Axios(e),n=bind(Axios.prototype.request,t);return utils_default.extend(n,Axios.prototype,t,{allOwnKeys:!0}),utils_default.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return createInstance(mergeConfig(e,t))},n}var axios=createInstance(defaults);axios.Axios=Axios,axios.CanceledError=CanceledError,axios.CancelToken=CancelToken,axios.isCancel=isCancel,axios.VERSION=VERSION,axios.toFormData=toFormData,axios.AxiosError=AxiosError,axios.Cancel=axios.CanceledError,axios.all=function(e){return Promise.all(e)},axios.spread=spread,axios.isAxiosError=isAxiosError,axios.mergeConfig=mergeConfig,axios.AxiosHeaders=AxiosHeaders,axios.formToJSON=e=>formDataToJSON(utils_default.isHTMLForm(e)?new FormData(e):e),axios.getAdapter=adapters_default.getAdapter,axios.HttpStatusCode=HttpStatusCode,axios.default=axios;var requestHandler=function(e){return e},responseHandler=function(e){return e},service=axios.create({withCredentials:!0,timeout:7e3});service.interceptors.request.use(requestHandler),service.interceptors.response.use(responseHandler);var request_default={install(e){e.provide(`request`,service)}},useDsl=(e=inject(`app`),t)=>{if(!e)throw Error(`useDsl must be used after MagicApp is created`);let n=t?e.pageFragments.get(t):null,r=ref(t?n?.data:e.page?.data);if(t){let t=()=>{r.value=n?.data};e.on(`dsl-change`,t),onBeforeUnmount(()=>{e.off(`dsl-change`,t)})}else{let t=()=>{r.value=e.page?.data};e.on(`page-change`,t),onBeforeUnmount(()=>{e.off(`page-change`,t)})}let i=(i,a,o,s)=>{if(!(!i.length||t&&n?.data.id!==s||!t&&e.page?.data.id!==s)){for(let e of i)isPage(e)&&!t&&e.id===s||isPageFragment(e)&&t?r.value=e:replaceChildNode(reactive(e),[r.value]);nextTick(()=>{e.emit(`replaced-node`,{nodes:i,sourceId:a,...o})})}};return e.dataSourceManager&&(e.dataSourceManager.on(`update-data`,i),onBeforeUnmount(()=>{e.dataSourceManager.off(`update-data`,i)})),{app:e,pageConfig:r}};function useComponent(e=``){let t,n,r;return typeof e==`string`?t=e:{componentType:t,app:n}=e,(!t||t===``)&&(t=`container`),n||(n=inject(`app`)),r=n?.resolveComponent(t),!r&&!t.startsWith(`magic-ui-`)&&(t=`magic-ui-${toLine(t)}`,r=n?.resolveComponent(t)),r??t}var App_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`App`,setup(e){let{pageConfig:t,app:n}=useDsl(),r=useComponent(`page`);return(e,n)=>(openBlock(),createBlock(resolveDynamicComponent(unref(r)),{config:unref(t)},null,8,[`config`]))}}),App_default=App_vue_vue_type_script_setup_true_lang_default,getLocalConfig=()=>{const configStr=localStorage.getItem(`magicDSL`);if(!configStr)return[];try{return[eval(`(${configStr})`)]}catch(e){return console.error(`Error parsing localStorage magicDSL:`,e),[]}};DataSourceManager.registerObservedData(DeepObservedData);var vueApp=createApp(App_default);vueApp.use(request_default);var dsl=((getUrlParam(`localPreview`)?getLocalConfig():window.magicDSL)||[])[0]||{},app=new src_default({ua:window.navigator.userAgent,config:dsl,request:service,curPage:getUrlParam(`page`),useMock:!!getUrlParam(`useMock`)});app.setDesignWidth(app.env.isWeb?window.document.documentElement.getBoundingClientRect().width:375),Object.entries(components).forEach(([e,t])=>{app.registerComponent(e,defineAsyncComponent(t))}),Object.values(plugins).forEach(e=>{vueApp.use(e,{app})}),vueApp.provide(`userRender`,({h:e,type:t,props:n={},attrs:r={},style:i,className:a,on:o,directives:s=[]})=>{let c={...n,...r,style:i,class:a};if(o)for(let[e,t]of Object.entries(o))c[`on${e[0].toLocaleUpperCase()}${e.substring(1)}`]=t;return s.length?withDirectives(e(t,c),s.map(e=>[resolveDirective(e.name),e.value,e.modifiers])):e(t,c)}),registerDataSourceOnDemand(dsl,datasources).then(e=>{Object.entries(e).forEach(([e,t])=>{DataSourceManager.register(e,t)}),vueApp.config.globalProperties.app=app,vueApp.provide(`app`,app),vueApp.mount(`#app`)});export{useDsl as n,useComponent as t};
|
|
//# sourceMappingURL=index-BOI1j6Pm.js.map
|