@base-framework/base 3.9.23 → 3.9.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.js +1 -1
- package/dist/chunks/chunk-6N533MOU.js +2 -0
- package/dist/chunks/chunk-DNPDLUU4.js +2 -0
- package/dist/chunks/chunk-HL52UJBX.js +2 -0
- package/dist/chunks/chunk-KB5AL3PM.js +2 -0
- package/dist/chunks/chunk-KMMYW6DR.js +2 -0
- package/dist/chunks/chunk-YTWFPMDY.js +2 -0
- package/dist/chunks/chunk-ZUB7I6Z4.js +2 -0
- package/dist/modules/ajax.js +1 -1
- package/dist/modules/component.js +1 -1
- package/dist/modules/data.js +1 -1
- package/dist/modules/date.js +1 -1
- package/dist/modules/html.js +1 -1
- package/dist/modules/router.js +1 -1
- package/dist/modules/state.js +1 -1
- package/dist/types/main/data-tracker/data-tracker.d.ts +9 -14
- package/dist/types/modules/data/types/basic-data.d.ts +30 -0
- package/dist/types/modules/data/types/deep-data/deep-data.d.ts +20 -0
- package/dist/types/modules/data-binder/data-pub-sub.d.ts +39 -1
- package/dist/types/modules/router/router.d.ts +29 -0
- package/dist/types/modules/router/routes/component-helper.d.ts +107 -2
- package/dist/types/modules/router/routes/page-cache.d.ts +6 -0
- package/dist/types/modules/router/routes/route.d.ts +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as v,b as w,c as h,d as O}from"./chunk-ZUB7I6Z4.js";var m=class{static toArray(t){return Array.from(t)}static inArray(t,e,r){return Array.isArray(t)?t.indexOf(e,r):-1}};var T=Object.prototype.toString,x=Object.prototype.hasOwnProperty,g={create(n){return Object.create(n||null)},extendObject(n,t){if(!n||typeof n!="object"||!t||typeof t!="object")return!1;for(let e in n)x.call(n,e)&&!x.call(t,e)&&(t[e]=n[e]);return t},clone(n){if(!n||typeof n!="object")return{};try{return structuredClone(n)}catch{return JSON.parse(JSON.stringify(n))}},getClassObject(n){return typeof n=="function"?n.prototype:n},extendClass(n,t){let e=this.getClassObject(n),r=this.getClassObject(t);if(typeof e!="object"||typeof r!="object")return!1;let i=Object.create(e);for(let s in r)i[s]=r[s];return i},hasOwnProp(n,t){return x.call(n,t)},isPlainObject(n){return!!n&&T.call(n)==="[object Object]"},isEmpty(n){if(!n||typeof n!="object"||Array.isArray(n))return!0;if(n instanceof Map||n instanceof Set)return n.size===0;for(let t in n)if(x.call(n,t))return!1;return!0}};var p=class{constructor(){this.errors=[],this.dataTracker=w}augment(t){if(!v.isObject(t))return this;let e=this.constructor.prototype;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return this}override(t,e,r,i){return(t[e]=r).apply(t,m.toArray(i))}getLastError(){let t=this.errors;return t.length?t.pop():!1}addError(t){this.errors.push(t)}getProperty(t,e,r){if(v.isObject(t)===!1)return"";let i=t[e];return typeof i<"u"?i:typeof r<"u"?r:""}createCallBack(t,e,r=[],i=!1){return typeof e!="function"?!1:(...s)=>(i===!0&&(r=r.concat(s)),e.apply(t,r))}bind(t,e){return e.bind(t)}};p.prototype.extend=(function(){return p.prototype})();var d=new p;var y={url:"",responseType:"json",method:"POST",fixedParams:"",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},beforeSend:[],async:!0,crossDomain:!1,withCredentials:!1,completed:null,failed:null,aborted:null,progress:null};var b=class{constructor(t){this.settings=null,this.xhr=null,this.setup(t)}setup(t){this.getXhrSettings(t);let e=this.xhr=this.createXHR(),{method:r,url:i,async:s}=this.settings;e.open(r,i,s),this.setupHeaders(),this.addXhrEvents(),this.beforeSend(),e.send(this.getParams())}beforeSend(){let t=y.beforeSend;if(t.length<1)return;let e=this.xhr,r=this.settings;for(var i=0,s=t.length;i<s;i++){var o=t[i];o&&o(e,r)}}objectToString(t){let e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e.join("&")}setupParams(t,e=null){let r=typeof t;if(!e)return!(t instanceof FormData)&&r==="object"&&(t=this.objectToString(t)),t;let i=typeof e;if(r==="string")return i!=="string"&&(e=this.objectToString(e)),t+=(t===""?"?":"&")+e,t;if(i==="string"&&(e=O.parseQueryString(e,!1)),t instanceof FormData)for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.append(s,e[s]);else r==="object"&&(t=Object.assign({},e,t),t=this.objectToString(t));return t}getParams(){let t=this.settings,e=t.fixedParams,r=t.params;return r?r=this.setupParams(r,e):e&&(r=this.setupParams(e)),r}getXhrSettings(t){let e=this.settings={...d.xhrSettings};if(t.length>=2&&typeof t[0]!="object")for(var r=0,i=t.length;r<i;r++){var s=t[r];switch(r){case 0:e.url=s;break;case 1:e.params=s;break;case 2:e.completed=s,e.failed=s;break;case 3:e.responseType=s||"json";break;case 4:e.method=s?s.toUpperCase():"POST";break;case 5:e.async=typeof s<"u"?s:!0;break}}else e=this.settings=g.extendClass(this.settings,t[0]),typeof e.completed=="function"&&(typeof e.failed!="function"&&(e.failed=e.completed),typeof e.aborted!="function"&&(e.aborted=e.failed))}createXHR(){let t=this.settings,e=new XMLHttpRequest;return e.responseType=t.responseType,t.withCredentials===!0&&(e.withCredentials=!0),e}setupHeaders(){let t=this.settings;if(!t||typeof t.headers!="object")return;let e=t.headers;for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.xhr?.setRequestHeader(r,e[r])}update(t,e){let r=this.xhr,i=()=>{h.removeEvents(r?.upload),h.removeEvents(r)},s=this.settings;if(!s)return!1;switch(e||t.type){case"load":{if((r?.status??0)>=400){typeof s.failed=="function"&&s.failed(!1,this.xhr),i();break}if(typeof s.completed=="function"){let a=this.getResponseData();s.completed(a,this.xhr)}i();break}case"error":typeof s.failed=="function"&&s.failed(!1,this.xhr),i();break;case"progress":typeof s.progress=="function"&&s.progress(t);break;case"abort":typeof s.aborted=="function"&&s.aborted(!1,this.xhr),i();break}}getResponseData(){let t=this.xhr;if(!t)return null;let e=t.responseType;return!e||e==="text"?t.responseText:t.response}addXhrEvents(){if(!this.settings)return;let e=this.xhr;if(!e)return;let r=this.update.bind(this);h.on(["load","error","abort"],e,r),h.on("progress",e.upload,r)}};var j=()=>{d.augment({xhrSettings:y,addFixedParams(n){this.xhrSettings.fixedParams=n},beforeSend(n){this.xhrSettings.beforeSend.push(n)},ajaxSettings(n){typeof n=="object"&&(this.xhrSettings=g.extendClass(d.xhrSettings,n))},resetAjaxSettings(){this.xhrSettings=y}})};j();var L=(...n)=>new b(n).xhr;var E=(n,t)=>{if(n===t)return!1;try{return JSON.stringify(n)!==JSON.stringify(t)}catch{return!0}},S=class{constructor({max:t=100,ttl:e=3e4}={}){this.entries=new Map,this.max=t,this.defaultTtl=e}get size(){return this.entries.size}setMax(t){this.max=Math.max(1,Number(t)||1),this.evict()}getEntry(t){let e=this.entries.get(t);return e?(this.entries.delete(t),this.entries.set(t,e),e):null}createEntry(t){let e={value:void 0,meta:null,time:0,ttl:this.defaultTtl,hasValue:!1,promise:null};return this.entries.delete(t),this.entries.set(t,e),this.evict(),e}evict(){let t=Math.max(1,this.max);for(;this.entries.size>t;){let e=this.entries.keys().next().value;this.entries.delete(e)}}isFresh(t){return!!t&&t.hasValue&&Date.now()-t.time<t.ttl}has(t){return this.isFresh(this.entries.get(t)||null)}get(t){let e=this.getEntry(t);return this.isFresh(e)?e.value:void 0}set(t,e,r,i=null){let s=this.getEntry(t)||this.createEntry(t);s.value=e,s.meta=i,s.time=Date.now(),s.ttl=typeof r=="number"?r:this.defaultTtl,s.hasValue=!0}invalidate(t){if(Array.isArray(t))return t.reduce((i,s)=>i+this.invalidate(s),0);let e=null;if(typeof t=="string"?e=i=>i.startsWith(t):t instanceof RegExp?e=i=>t.test(i):typeof t=="function"&&(e=t),!e)return 0;let r=0;for(let[i,s]of Array.from(this.entries))e(i,s)&&(this.entries.delete(i),r++);return r}clear(){this.entries.clear()}fetch(t,e,r,i){let s,o=e.promise=new Promise(f=>s=f),l=!1,a=(f,u,c)=>{l||(l=!0,s({ok:f===!0,value:u,meta:c}))};o.then(f=>{if(e.promise===o&&(e.promise=null),this.entries.get(t)===e){if(f.ok){e.value=f.value,e.meta=f.meta,e.time=Date.now(),e.ttl=i,e.hasValue=!0;return}e.hasValue||this.entries.delete(t)}});try{return r(a)}catch(f){return a(!1,void 0,f),null}}resolve(t,e,r,i){r=r||{};let s=typeof r.ttl=="number"?r.ttl:this.defaultTtl,o=this.getEntry(t);if(o&&o.hasValue){if(this.isFresh(o)){let{value:a,meta:f}=o;return queueMicrotask(()=>i(a,f,!0)),null}if(r.swr===!0){let{value:a,meta:f}=o;queueMicrotask(()=>i(a,f,!0));let u=o.promise?null:this.fetch(t,o,e,s);return o.promise.then(c=>{c.ok&&E(a,c.value)&&i(c.value,c.meta,!0)}),u}}if(o&&o.promise)return o.promise.then(a=>i(a.value,a.meta,a.ok)),null;o=o||this.createEntry(t);let l=this.fetch(t,o,e,s);return o.promise.then(a=>i(a.value,a.meta,a.ok)),l}load(t,e,r={}){return new Promise((i,s)=>{let o=!0,l=a=>{Promise.resolve().then(e).then(f=>a(!0,f,null),f=>a(!1,void 0,f))};this.resolve(t,l,r,(a,f,u)=>{if(o)return o=!1,u?i(a):s(f);typeof r.onUpdate=="function"&&r.onUpdate(a)})})}},W=new S;export{g as a,d as b,b as c,L as d,S as e,W as f};
|
|
2
|
+
//# sourceMappingURL=chunk-6N533MOU.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as A}from"./chunk-HL52UJBX.js";import{a as E,b as Et,c as Lt,d as Mt,e as R,f as S,g as L}from"./chunk-KB5AL3PM.js";import{a as W,b as At}from"./chunk-6N533MOU.js";import{a as bt,d as I,e as It,g as q}from"./chunk-KMMYW6DR.js";import{b as f,c as p}from"./chunk-ZUB7I6Z4.js";var F={items:new Map,add(n,t){return this.items.set(n,t),this},get(n){return this.items.get(n)??null}};var g=[],z=0,ut=!1,We=typeof queueMicrotask=="function"?queueMicrotask:n=>Promise.resolve().then(n),qe=n=>{let t=n.panel,e=0;for(;t&&t.isUnit===!0&&e++<50;)t=t.panel;return t||n.container||null},Fe=n=>{n._mountPending=!1;try{n.afterMount()}catch(t){console.error("Error in afterMount:",t)}},_t=()=>{ut=!1;let n=g;if(n.length===0)return;g=[];let t=[];for(let e=0,r=n.length;e<r;e++){let s=n[e];if(s.rendered!==!0||s._mountPending!==!0){s._mountPending=!1;continue}let o=qe(s);if(o&&o.isConnected===!0){Fe(s);continue}t.push(s)}t.length&&(g=g.length?t.concat(g):t),g.length&&z===0&&g.length!==t.length&&dt()},dt=()=>{ut||(ut=!0,We(_t))},v={add(n){n._mountPending!==!0&&(n._mountPending=!0,g.push(n))},enter(){z++},leave(){--z>0||(z=0,g.length&&dt())},schedule(){g.length&&dt()},flush(){_t()},get size(){return g.length}};f.addType("components",n=>{if(!n)return;let t=n.component;!t||!t.isUnit||(t.persistToken&&t.parent&&t.parent.removePersistedChild(t.persistToken,t),t.rendered===!0&&(t.prepareDestroy(),t.cleanUpAfterDestroy()))});var Ge=0,Q=class{constructor(t,e,r){this.isUnit=!0,this.data=null,this.persist=null,this.nest=null,this.state=null,this.panel=null,this.parent=null,this.unitType=null,this._classId,this.id="",this.cached=[],this.init();let s,o;if(t==null)s={},o=[];else{let i=typeof t;i==="string"||i==="number"?(s={},o=[{tag:"text",textContent:t}]):Array.isArray(t)?(s={},o=t):(s=t||{},o=typeof e=="string"?[{tag:"text",textContent:e}]:e)}this.setupProps(s),this.children=o||[],this.persistedChildren={},this.persistedCount=0,this.onCreated(),this.rendered=!1,this.container=null}init(){this.id="cp-"+Ge++,this.unitType=this._classId||this.constructor.name.toLowerCase()}declareProps(){}addPersistedChild(t){let e=t.key,r=t.cache,s;r!=null&&e!=null?s="pk:"+r+":"+e:r!=null?s="pk:"+r:e!=null?s="pk:"+e:s="pc"+this.persistedCount++;let o=this.persistedChildren[s];return o&&t.unitType===o.unitType&&t.resumeScope(o),t.persistToken=s,this.persistedChildren[s]=t,s}removePersistedChild(t,e){if(!this.rendered)return;let r=t?this.persistedChildren[t]:null;r&&(e&&r!==e||delete this.persistedChildren[t])}setupProps(t){if(this.declareProps(),!(!t||typeof t!="object"))for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this[e]=t[e],e==="data"&&(this._externalData=!0))}getChildScope(){return this}getParentContext(){return this.parent?this.parent.getContext():null}setupContext(){if(this._contextResumed)return;let t=this.getParentContext(),e=this.setContext(t);if(e){this.context=e;return}this.context=t,this.setupAddingContext()}setupAddingContext(){let t=this.context,e=this.addContext(t);if(!e)return;let r=e[0];r&&(this.addingContext=!0,this.contextBranchName=r,this.addContextBranch(r,e[1]))}addContextBranch(t,e){this.context??={},this.context[t]=e}setContext(t){return null}addContext(t){return null}removeContext(){this.addingContext&&this.removeContextBranch(this.contextBranchName)}removeContextBranch(t){t&&delete this.context[t]}getContext(){return this.context}onCreated(){}render(){return{}}_cacheRoot(t){return t&&(t.id||(t.id=this.getId()),t.cache="panel",t)}_createLayout(){return this.render()}prepareLayout(){let t=this._createLayout();return this._cacheRoot(t)}afterBuild(){f.add(this.panel,"components",{component:this}),this.rendered=!0,this.afterLayout(),typeof this.afterMount=="function"&&v.add(this)}afterLayout(){this.afterSetup()}if(t,e){return t?e||t:null}map(t,e){let r=[];if(!t||t.length<1)return r;for(let s=0,o=t.length;s<o;s++){let i=e(t[s],s);r.push(i)}return r}removeAll(t){return q.removeAll(t)}getId(t){let e=this.id;return typeof t=="string"&&(e+="-"+t),e}cacheEle(t,e){e&&(this[e]=t,this.cached.push(e))}initialize(){this.setupContext(),this.beforeSetup()}beforeSetup(){}afterSetup(){}setup(t){this.setContainer(t),this.initialize()}setContainer(t){this.container=t}_remove(){this.prepareDestroy();let t=this.panel;t&&q.removeElement(t),this.cleanUpAfterDestroy()}cleanUpAfterDestroy(){this.panel=null,this.container=null;let t=this.cached;for(let e=0,r=t.length;e<r;e++)this[t[e]]=null;this.cached=[],this.persist!==!0&&(this.persistedChildren={},this.persistToken=null)}prepareDestroy(){this.persistedCount=0,this.rendered=!1;try{this.beforeDestroy()}catch(t){console.error("Error in beforeDestroy:",t)}this.removeContext(),this.data&&this.persist!==!0&&typeof this.data.unlink=="function"&&this.data.unlink()}beforeDestroy(){}destroy(){this._remove()}};var M=class{static resume(t,e){if(t._externalData){this._resumeExternal(t,e);return}this._resumeOwned(t,e)}static _releaseLinks(t,e){!t||t===e||typeof t.unlink!="function"||t.unlink()}static refresh(t){let e=t.setData();e&&t.data&&t.data.set(e.stage),this.refreshContext(t)}static refreshContext(t){let e=t.context;if(!e||!e.data)return;let r=t.getParentContext();if(!r||!r.data)return;let s=r.data.stage,o=e.data.stage,i=null;for(let a in s){if(!Object.prototype.hasOwnProperty.call(s,a))continue;let l=s[a];l!==o[a]&&(i===null&&(i={}),i[a]=l)}i!==null&&(typeof e.data._silentSet=="function"?e.data._silentSet(i):e.data.set(i))}static _resumeExternal(t,e){let r=t.setData();if(!r){t.data=e;return}if(this._releaseLinks(e,r),e&&e.stage){let s=e._retainState||r._retainState,o=!s&&(e._refreshState||r._refreshState),i=this._buildExternalUpdates(e.stage,r.stage,s,o);W.isEmpty(i)||r._silentSet(i)}typeof r.flushPending=="function"&&r.flushPending(),t.data=r}static _buildExternalUpdates(t,e,r,s){let o={};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;if(s){Object.prototype.hasOwnProperty.call(e,i)||(o[i]=t[i]);continue}let a=t[i];!r&&a==null||a!==e[i]&&(o[i]=a)}return o}static _resumeOwned(t,e){let r=t.data;if(!r){this._releaseLinks(e),t.data=e;return}if(e&&e._retainState){this._releaseLinks(r,e),this._releaseLinks(e),t.data=e;return}if(this._releaseLinks(e,r),e&&e.stage){let s=e._refreshState||t.data._refreshState,o=this._buildOwnedUpdates(e.stage,t.data.stage,s);W.isEmpty(o)||t.data._silentSet(o)}t.data&&typeof t.data.flushPending=="function"&&t.data.flushPending()}static _buildOwnedUpdates(t,e,r){let s={};for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;if(r){Object.prototype.hasOwnProperty.call(e,o)||(s[o]=t[o]);continue}let i=t[o];i!=null&&i!==e[o]&&(s[o]=i)}return s}};var j=class{constructor(){this.events=[]}addEvents(t){let e=t.length;if(!(e<1))for(let r=0;r<e;r++){let s=t[r];this.on(s[0],s[1],s[2],s[3])}}on(t,e,r,s){p.on(t,e,r,s),this.events.push({event:t,obj:e,callBack:r,capture:s})}off(t,e,r,s){p.off(t,e,r,s);let o,i=this.events;for(let a=0,l=i.length;a<l;a++)if(o=i[a],o.event===t&&o.obj===e&&o.callBack===r&&o.capture===s){i.splice(a,1);break}}set(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let s=t[e];p.on(s.event,s.obj,s.callBack,s.capture)}}unset(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let s=t[e];p.off(s.event,s.obj,s.callBack,s.capture)}}reset(){this.unset(),this.events=[]}};var V=class{constructor(t,e){this.remoteStates=[],this.callBackStates=[];let r=this.convertStates(e);this.addStatesToTarget(t,r)}addStates(t,e){let r=this.convertStates(e);this.addStatesToTarget(t,r)}createState(t,e,r,s){return{action:t,state:e,callBack:r,targetId:s,token:null,callBackToken:null}}convertStates(t){let e=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(r==="remotes"){this.setupRemoteStates(t[r],e);continue}let s=null,o=null,i=t[r];i&&typeof i=="object"&&(o=i.callBack,s=i.id||i.targetId,i=i.state),e.push(this.createState(r,i,o,s))}return e}setupRemoteStates(t,e){for(let r=0,s=t.length;r<s;r++){let o=t[r];if(o)for(let i in o){if(!Object.prototype.hasOwnProperty.call(o,i)||i==="id")continue;let a=null,l=o[i],c=l!==null?l:void 0;c&&typeof c=="object"&&(a=c.callBack,c=c.state),e.push(this.createState(i,c,a,o.id))}}}removeRemoteStates(t){let e=this.remoteStates;e&&this.removeActions(t,e)}removeLocalStates(t){let e=this.callBackStates;if(e)for(let r=0,s=e.length;r<s;r++){let o=e[r];o.callBackToken&&(t.off(o.action,o.callBackToken),o.callBackToken=null)}}removeActions(t,e){if(!(e.length<1))for(let r=0,s=e.length;r<s;r++){let o=e[r];o.token&&this.unbindRemoteState(t,o.token),o.targetId&&A.remove(o.targetId,o.action,o.token)}}restore(t){A.restore(t.id,t);let e=this.callBackStates;if(e)for(let s=0,o=e.length;s<o;s++){let i=e[s];i.callBackToken=t.on(i.action,i.callBack)}let r=this.remoteStates;if(r)for(let s=0,o=r.length;s<o;s++){let i=r[s];i.token=this.bindRemoteState(t,i.action,i.targetId)}}bindRemoteState(t,e,r){let s=A.getTarget(r);return t.link(s,e)}unbindRemoteState(t,e){t.unlink(e)}addStatesToTarget(t,e){let r=this.remoteStates;for(let s=0,o=e.length;s<o;s++){let i=e[s],a=this.addAction(t,i);i.targetId&&(i.token=a,r.push(i))}}addAction(t,e){let r,s=e.action,o=e.targetId;o&&(r=this.bindRemoteState(t,s,o)),typeof e.state<"u"&&t.addAction(s,e.state);let i=e.callBack;return typeof i=="function"&&(e.callBackToken=t.on(s,i),this.callBackStates.push(e)),r||null}};var x=class extends Q{constructor(t,e,r){super(t,e,r),this.isComponent=!0,this.stateResumed=!1,this.stateTargetId=null,this._externalData=this._externalData??!1,this._setupData()}setData(){return null}_setupData(){if(this.data)return;let t=this.setData();t&&(this.data=t)}resumeScope(t){if(this._resumeData(t.data),this.state=t.state,this.stateHelper=t.stateHelper,this.persistedChildren=t.persistedChildren,t.context){let e=t.context.data;e&&e._refreshState===!0&&e._retainState!==!0||(this.context=t.context,this._contextResumed=!0)}this.id=t.id,this._refreshContextData()}_resumeData(t){M.resume(this,t)}_refreshData(){M.refresh(this)}_refreshContextData(){M.refreshContext(this)}initialize(){this.setupContext(),this.addStates(),this.beforeSetup()}afterLayout(){this.addEvents(),this.afterSetup()}setupStateTarget(t){let e=t||this.stateTargetId||this.id;this.state=A.attach(String(e))}setupStates(){return{}}addStates(){let t=this.state;if(t){this.stateResumed=!0,this.stateHelper?.restore(t);return}let e=this.setupStates();W.isEmpty(e)||this.setStateHelper(e)}setStateHelper(t={}){this.state||(this.setupStateTarget(),this.stateHelper=new V(this.state??{},t))}addState(t){!this.stateHelper||this.stateResumed===!0||this.stateHelper.addStates(this.state,t)}removeStates(){let t=this.state;if(!t)return;let e=this.stateHelper;e&&(e.removeRemoteStates(t),e.removeLocalStates(t)),A.detach(String(t.id)),this.stateResumed=!1}onFlush(t){let e=this.data??this?.context?.data??null;e&&e.onFlush(t)}setEventHelper(){this.events||(this.events=new j)}setupEvents(){return[]}addEvents(){let t=this.setupEvents();t.length<1||(this.setEventHelper(),this.events&&this.events.addEvents(t))}removeEvents(){let t=this.events;t&&t.reset()}prepareDestroy(){this.persistedCount=0,this.rendered=!1;try{this.beforeDestroy()}catch(t){console.error("Error in beforeDestroy:",t)}this.removeEvents(),this.removeStates(),this.removeContext(),this.data&&this.persist!==!0&&typeof this.data.unlink=="function"&&this.data.unlink()}};var Dt={created:"onCreated",setStates:"setupStates",state:"setupStates",events:"setupEvents",before:"beforeSetup",render:"render",after:"afterSetup",mounted:"afterMount",destroy:"beforeDestroy"},Ot=(n,t)=>typeof n!="function"&&t==="setupStates"?()=>n:n;var ft=(n,t)=>{if(!n)return t;let e=Object.keys(n);for(let r=0,s=e.length;r<s;r++){let o=e[r],i=n[o],a=Dt[o]||o;t[a]=Ot(i,a)}return t},Ke=n=>ft(n,{}),ze=0,Bt=(n,t)=>{class e extends n{}return Object.assign(e.prototype,t),e.prototype._classId="jot"+ze++,e},_=(n,t=x)=>{n||(n={});let e,r=typeof n;return r==="object"&&n.render?(e=Ke(n),Bt(t,e)):(e={render:r==="function"?n:()=>n},Bt(t,e))};var pt=(n,t)=>({attr:n,directive:t});var k=(n,t)=>({key:n,value:t});var Ht=(n,t,e,r)=>({tag:n,attr:t,directives:e,children:r});var Ut=null,Qe=()=>Ut||(Ut=F.get("watch")),w=class{static getTag(t){return t.tag||"div"}static setupChildren(t){t.nest&&(t.children=t.nest,delete t.nest)}static setElementContent(t,e,r,s){return t==="text"?(s.push({tag:"text",textContent:e}),!0):t==="html"||t==="innerHTML"?(r.push(k("innerHTML",e)),!0):!1}static setTextAsWatcher(t,e,r){t.push(pt(k(e,L.getWatcherSettings(r,It(e))),Qe()))}static setButtonType(t,e,r){if(t==="button"){let s=e.type||"button";r.push(k("type",s))}}static parse(t,e){let r=[],s=[],o=t.tag||"div";o==="button"&&r.push(k("type",t.type||"button"));let i=[],a,l;for(let c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||c==="tag"||(a=t[c],a==null))continue;if(c==="children"||c==="nest"){if(Array.isArray(a))for(let u=0;u<a.length;u++)i.push(a[u]);else i.push(a);continue}if((l=F.get(c))!==null){s.push(pt(k(c,a),l));continue}let h=typeof a;if(h==="object"){if(L.isWatching(a)){this.setTextAsWatcher(s,c,a);continue}i.push(a);continue}if(h==="function"){let u=a,m=function(y){u.call(this,y,e)};m.originalCallback=u,r.push(k(c,m));continue}if(h==="string"&&a.includes("[[")){this.setTextAsWatcher(s,c,a);continue}if(c==="text"){i.push({tag:"text",textContent:a});continue}if(c==="html"||c==="innerHTML"){r.push(k("innerHTML",a));continue}r.push(k(c,a))}return Ht(o,r,s,i)}};var D=class{build(t,e,r){}setupComponent(t,e,r){let s=r?.getChildScope();t.parent=s,s&&s.persist===!0&&t.persist!==!1&&(t.persist=!0,t.parent.addPersistedChild(t)),t.cache&&s&&(s[t.cache]=t),t.setup(e)}buildComponent(t){let e=t.prepareLayout(),r=this.build(e,t.container,t);return t.afterBuild(),t.component&&typeof t.onCreated=="function"&&t.onCreated(t),r}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t),t}setDirectives(t,e,r){}removeNode(t){}removeAll(t){}};var je=n=>{for(let e in n)if(e!=="tag"&&e!=="textContent")return!1;let t=n.textContent;return typeof t=="string"?t.indexOf("[[")===-1:typeof t!="object"},Y=class extends D{build(t,e,r){let s=S.createDocFragment();if(Array.isArray(t))for(let o=0,i=t.length;o<i;o++)this.buildElement(t[o],s,r);else this.buildElement(t,s,r);return e&&typeof e=="object"&&e.appendChild(s),s}buildElement(t,e,r){if(t){if(t.isUnit===!0){this.createComponent(t,e,r);return}this.createElement(t,e,r)}}createElement(t,e,r){if(t.tag==="text"&&je(t)){let c=t.textContent;S.createText(c??"",e);return}let s=r?.getChildScope();if(t.data||t.state){this.createTempComponent(t,e,s);return}let o=w.parse(t,s),i=this.createNode(o,e,s);this.cache(i,t.cache,r);let a=o.children;for(let c=0,h=a.length;c<h;c++){let u=a[c];u!==null&&this.buildElement(u,i,r)}let l=o.directives;l.length&&this.setDirectives(i,l,s)}createTempComponent(t,e,r){let s={cache:t.cache,key:t.key,persist:t.persist,_externalData:!0,setData:()=>t.data,...ft(t.methods||{},{}),render(){return{...t,data:null,state:null,methods:null,key:null,persist:null}}};t.state&&(s.setupStateTarget=function(i){this.state=t.state});let o=new x(s);this.createComponent(o,e,r)}setDirectives(t,e,r){for(let s=0,o=e.length;s<o;s++)this.handleDirective(t,e[s],r)}handleDirective(t,e,r){e.directive(t,e.attr.value,r)}cache(t,e,r){r&&e&&r.cacheEle(t,e)}createNode(t,e,r){let s=t.tag;if(s==="text"){let o=t.attr[0],i=o?o.value:"";return S.createText(i,e)}else if(s==="comment"){let o=t.attr[0],i=o?o.value:"";return S.createComment(i,e)}return S.create(s,t.attr,e,r)}removeNode(t){S.removeElement(t)}removeAll(t){S.removeAll(t)}};var Ve=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source"]),Ye=/[&<>"]/,mt=n=>{let t=typeof n=="string"?n:String(n);return Ye.test(t)?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):t},O=class{static create(t,e=[],r=""){let s="",o="";for(let i=0,a=e.length;i<a;i++){let l=e[i],c=l.key,h=l.value;if(c==="text"||c==="textContent"){s+=mt(h);continue}if(c==="html"||c==="innerHTML"){s+=h;continue}if(typeof h=="function")continue;let u=c+'="'+mt(h)+'"';o?o+=" "+u:o=u}return Ve.has(t)?"<"+t+" "+o+" />":"<"+t+" "+o+">"+s+r+"</"+t+">"}static createText(t){return mt(t)}static createComment(t){return"<!-- "+t+" -->"}};var $=class extends D{build(t,e,r){if(Array.isArray(t)){let s="";for(let o=0,i=t.length;o<i;o++)s+=this.buildElement(t[o],r);return s}return this.buildElement(t,r)}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t)}buildElement(t,e){return t?t.isUnit===!0?this.createComponent(t,{},e):this.createElement(t,e):""}createElement(t,e){let r=w.parse(t,e),s=r.children,o="";for(let i=0,a=s.length;i<a;i++){let l=s[i];l!==null&&(o+=this.buildElement(l,e))}return this.createNode(r,o)}createNode(t,e){let r=t.tag;if(r==="text"){let s=t.attr[0],o=s?s.value:"";return O.createText(o)}else if(r==="comment"){let s=t.attr[0],o=s?s.value:"";return O.createComment(o)}return O.create(r,t.attr,e)}removeAll(t){}};var J=class{static browserIsSupported(){return typeof window<"u"&&typeof document=="object"}static setup(){return this.browserIsSupported()?new Y:new $}};var b=J.setup(),$e=n=>typeof n=="object"&&n.isUnit===!0,Nt=new WeakMap,Je=n=>{let t=Nt.get(n);if(!t){if(t=_(n),!t)return null;Nt.set(n,t)}return new t},d=class{static render(t,e,r){if(!t||($e(t)||(t=Je(t)),!t))return null;v.enter();try{return b.createComponent(t,e,r)}finally{v.leave()}}static build(t,e,r){v.enter();try{return b.build(t,e,r)}finally{v.leave()}}static rebuild(t,e,r){return b.removeAll(e),this.build(t,e,r)}static setDirectives(t,e,r){b.setDirectives(t,e,r)}static createNode(t,e,r){return b.createNode(t,e,r)}static removeNode(t){b.removeNode(t)}static removeAll(t){b.removeAll(t)}};At.augment({buildLayout(n,t,e){d.build(n,t,e)}});var gt=[],Xe=n=>gt.indexOf(n)!==-1,Ze=n=>({tag:"script",src:n.src,async:!1,load(t){gt.push(n.src);let e=n.load;e&&e()}}),tr=n=>({tag:"link",rel:"stylesheet",type:"text/css",href:n.src,load(t){gt.push(n.src);let e=n.load;e&&e()}}),X=class{constructor(t){this.percent=0,this.loaded=0,this.total=0,this.callBack=t||null}add(t){this.total++;let e,r=this.update.bind(this);t.indexOf(".css")!==-1?e=tr({load:r,src:t}):e=Ze({load:r,src:t}),d.build(e,document.head)}addFiles(t){t&&t.forEach(e=>{Xe(e)||this.add(e)})}update(){if(this.updateProgress()<100)return;let e=this.callBack;e&&e()}updateProgress(){return++this.loaded,this.percent=Math.floor(this.loaded/this.total*100)}};var er=n=>n?typeof n?.prototype?.constructor=="function":!1,C=class{static process(t,e){let r=t.default;return r?e.callback?e.callback(r):(er(r)?r=new r:r=r(),r.isUnit===!0&&(r.route=e.route,e.persist&&(r.persist=!0)),r):null}static render(t,e,r){return this.renderNodes(t,e,r)[0]||null}static renderNodes(t,e,r){let s=d.build(t,null,r),o=Array.from(s.childNodes);return o.length===0&&t?.panel&&o.push(t.panel),e.after(s),o}};var Z=class{static load(t,e,r){return t.then(s=>(e&&e(s),s)).catch(s=>{console.error("Error loading module:",s),r&&r(s)})}};var rr=n=>({tag:"comment",textContent:"import placeholder",onCreated:n.onCreated}),T=new E(100),Wt=n=>{if(T.has(n)){let r=T.get(n);return r&&typeof r.then!="function"?Promise.resolve(r):r}let t=typeof n,e;if(t==="string")e=import(n);else if(t==="function")e=n();else return n;return e.then(r=>{T.set(n,r)}).catch(()=>{T.delete(n)}),T.set(n,e),e},qt=n=>{if(!T.has(n))return null;let t=T.get(n);return t&&typeof t.then=="function"?null:t||null},Ft=n=>{let t=typeof n;if(t!=="string"&&t!=="function")return null;if(qt(n))return Promise.resolve(T.get(n));let e;try{e=Wt(n)}catch{return null}return e.catch(()=>null)},yt=n=>{for(let t=0,e=n.length;t<e;t++){let r=n[t];r&&d.removeNode(r)}},Gt=_({declareProps(){this.loaded=!1,this.errorRoot=null,this.loadingRoots=null,this.generation=0},render(){return rr({onCreated:n=>{if(this.src){if(this.layout){this.setLayoutRoots(C.renderNodes(this.layout,this.panel,this.parent));return}if(this.depends){this.renderLoading(n),new X(()=>{this.loadAndRender(n)}).addFiles(this.depends);return}this.loadAndRender(n)}}})},loadAndRender(n){let t=this.generation,e=qt(this.src);if(e){this.renderModule(n,e);return}this.renderLoading(n),Z.load(Wt(this.src),r=>{t===this.generation&&this.renderModule(n,r)},r=>{t===this.generation&&(this.loaded=!1,this.removeLoadingLayout(),this.renderError(n,r))})},renderLoading(n){let t=this.loading;if(!t||this.loadingRoots)return;let e=typeof t=="function"?t():t;e&&(this.loadingRoots=C.renderNodes(e,n,this.parent))},removeLoadingLayout(){let n=this.loadingRoots;return n?(this.loadingRoots=null,yt(n),!0):!1},renderError(n,t){let e=()=>this.retry(n),r=this.fallback,s=typeof r=="function"?r(t,e):r||{class:"base-import-error",children:[{tag:"span",text:"Failed to load content."},{tag:"button",type:"button",text:"Retry",click:e}]};if(!s)return;let o=C.renderNodes(s,n,this.parent);this.errorRoots=o,this.errorRoot=o[0]||null},setLayoutRoots(n){this.layoutRoots=n,this.layoutRoot=n[0]||null},retry(n){this.removeErrorLayout(),this.loadAndRender(n)},removeErrorLayout(){this.errorRoot&&(yt(this.errorRoots||[this.errorRoot]),this.errorRoot=null,this.errorRoots=null)},renderModule(n,t){this.loaded=!0;let e=this.layout||C.process(t,{callback:this.callback,route:this.route,persist:this.persist});this.layout=e,this.setLayoutRoots(C.renderNodes(e,n,this.parent)),this.removeLoadingLayout()&&typeof this.onReplaceLoading=="function"&&this.onReplaceLoading(this.layoutRoots,e),typeof this.onModuleRender=="function"&&this.onModuleRender(e)},shouldUpdate(n){return this.updateLayout===!0?!0:this.updateLayout=n&&n.isUnit&&typeof n.update=="function"},updateModuleLayout(n){let t=this.layout;this.shouldUpdate(t)&&t&&t.update(n)},update(n){this.loaded===!0&&this.updateModuleLayout(n)},destroy(){this.generation++,this.removeErrorLayout(),this.removeLoadingLayout(),this.layoutRoot&&(yt(this.layoutRoots||[this.layoutRoot]),this.persist!==!0&&(this.layoutRoot=null,this.layoutRoots=null,this.layout=null,this.loaded=!1,this.updateLayout=!1))}});var Kt=n=>{let t=typeof n;return(t==="string"||t==="function"||n instanceof Promise)&&(n={src:n}),new Gt(n)};var nr=0,B=class{constructor(t){this.router=t,this.locationId="base-app-router-"+nr++,this.callBack=this.check.bind(this)}setup(){return this.addEvent(),this}check(t){}getScrollPosition(){return{x:window.scrollX,y:window.scrollY}}scrollTo(t){window.scrollTo(t.x,t.y)}addEvent(){return this}};var sr=0,or=()=>Date.now().toString(36)+"-"+(sr++).toString(36)+"-"+Math.random().toString(36).substring(2,8),Qt=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent||"")&&!window.MSStream,zt=()=>{Qt&&requestAnimationFrame(()=>requestAnimationFrame(()=>{let n=window.scrollX,t=window.scrollY;window.scrollTo(0,t+1),document.documentElement.offsetHeight,window.scrollTo(n,t)}))},tt=class extends B{constructor(t){super(t),this.currentKey=null,this.positions=new E(200)}saveCurrentPosition(){let t=this.getScrollPosition(),e=this.currentKey;return e&&this.positions.set(e,t),t}addEvent(){p.on("popstate",window,this.callBack);let t=window.history;return t&&"scrollRestoration"in t&&(this.previousScrollRestoration=t.scrollRestoration,t.scrollRestoration="manual"),Qt&&(this.pageShowCallBack=this.onPageShow.bind(this),p.on("pageshow",window,this.pageShowCallBack)),this}removeEvent(){p.off("popstate",window,this.callBack);let t=window.history;return this.previousScrollRestoration&&t&&"scrollRestoration"in t&&(t.scrollRestoration=this.previousScrollRestoration,this.previousScrollRestoration=null),this.pageShowCallBack&&p.off("pageshow",window,this.pageShowCallBack),this}onPageShow(t){t.persisted&&zt()}check(t){let e=t.state;if(!e||e.location!==this.locationId)return!1;t.preventDefault(),t.stopPropagation(),this.saveCurrentPosition();let r=e.key||null;this.currentKey=r;let s=r&&this.positions.get(r)||e.scrollPosition,o=this.router;o.checkActiveRoutes(e.uri,!!s),s&&(typeof o.restoreScrollPosition=="function"?o.restoreScrollPosition(s):this.scrollTo(s)),zt()}createState(t,e={}){let r=this.getScrollPosition();return e=e===null?{}:e,{location:this.locationId,...e,key:or(),scrollPosition:r,uri:t}}addState(t,e,r=!1){let s=window.history,o=s.state;if(o&&o.uri===t)return o.key&&o.location===this.locationId&&(this.currentKey=o.key),this;!r&&o&&o.location===this.locationId&&(o.scrollPosition=this.saveCurrentPosition(),s.replaceState(o,"",window.location.href));let i=this.createState(t,e);return r||(i.scrollPosition={x:0,y:0}),s[r===!1?"pushState":"replaceState"](i,null,t),this.currentKey=i.key,this.positions.set(i.key,i.scrollPosition),this}};var et={removeSlashes(n){return typeof n!="string"?"":(n[0]==="/"&&(n=n.substring(1)),n[n.length-1]==="/"&&(n=n.substring(0,n.length-1)),n)},getHashUri(n){if(typeof n!="string")return"";let t=n.indexOf("#");return t===-1?"":n.substring(t+1)}};var rt=class extends B{addEvent(){return p.on("hashchange",window,this.callBack),this}removeEvent(){return p.off("hashchange",window,this.callBack),this}check(t){this.router.checkActiveRoutes(et.getHashUri(t.newURL))}addState(t,e,r){return window.location.hash=t,this}};var nt=class{static browserIsSupported(){return typeof window=="object"&&"history"in window&&"pushState"in window.history}static setup(t){return this.browserIsSupported()?new tt(t).setup():new rt(t).setup()}};var St=5,ir=200,st=class{constructor(t){this.owner=t||null,this.pages=new Set,this.scrollMemory=new E(ir),this.historyNavigation=!1}isEnabled(){let t=this.owner;return t!==null&&t.keepAlive===!0}getMode(){let t=this.owner;return t!==null&&t.keepAliveMode==="hide"?"hide":"detach"}getMax(){let t=this.owner,e=t?t.keepAliveMax:void 0;return typeof e=="number"&&e>=0?e:St}get size(){return this.pages.size}add(t){let e=this.pages;e.delete(t),e.add(t),this.trim()}delete(t){this.pages.delete(t)}trim(){let t=this.pages,e=this.getMax();for(;t.size>e;){let r=t.values().next().value;t.delete(r),r.evict()}}clear(){let t=Array.from(this.pages);this.pages.clear();for(let e=0,r=t.length;e<r;e++)t[e].evict()}saveScroll(t,e){if(e){this.scrollMemory.set(t,e);return}this.scrollMemory.has(t)&&this.scrollMemory.delete(t)}getScroll(t){return this.scrollMemory.get(t)||null}};var vt=class extends x{getChildScope(){return this.parent}},jt=n=>_(n,vt);var xt="data-scroll-key",ar="["+xt+"]",lr="[data-route-dormant]",Vt=n=>typeof n.closest=="function"&&n.closest(lr)!==null,Yt=(n,t)=>{for(let e=0,r=n.length;e<r;e++){let s=n[e];if(!s||s.nodeType!==1||Vt(s))continue;let o=s.getAttribute(xt);o!==null&&t(s,o);let i=s.querySelectorAll(ar);for(let a=0,l=i.length;a<l;a++){let c=i[a];Vt(c)||t(c,c.getAttribute(xt))}}},kt=n=>{let t=null;return Yt(n,(e,r)=>{let s=e.scrollTop||0,o=e.scrollLeft||0;s===0&&o===0||(t=t||{},t[r]=[s,o])}),t},ot=(n,t)=>{if(!t)return!0;let e={},r=0;for(let s in t)e[s]=!0,r++;return Yt(n,(s,o)=>{let i=t[o];if(!i)return;let a=i[0],l=i[1];s.scrollTop=a,s.scrollLeft=l,Math.abs((s.scrollTop||0)-a)<1&&Math.abs((s.scrollLeft||0)-l)<1&&e[o]&&(e[o]=!1,r--)}),r<=0};var cr=n=>{for(let t=0;t<n.length;t++){let e=n[t],r=e&&e.nodeType===8?e._prevNodes:null;if(!Array.isArray(r)||r.length===0)continue;let s=[];for(let o=0,i=r.length;o<i;o++){let a=r[o];a&&n.indexOf(a)===-1&&s.indexOf(a)===-1&&s.push(a)}n.splice(t+1,0,...s)}},G="data-route-dormant",it=[["content-visibility","hidden"],["position","absolute"],["top","0"],["left","0"],["width","100%"]],hr=n=>{let t=n.style,e=[];for(let r=0,s=it.length;r<s;r++){let[o,i]=it[r];e.push([o,t.getPropertyValue(o),t.getPropertyPriority(o)]),t.setProperty(o,i,"important")}return e.push(["aria-hidden",n.getAttribute("aria-hidden")]),n.setAttribute("aria-hidden","true"),n.setAttribute(G,""),n.inert=!0,e},ur=(n,t)=>{let e=n.style,r=t||[];for(let o=0,i=it.length;o<i;o++){let a=it[o][0],l=r.find(c=>c[0]===a);l&&l[1]?e.setProperty(a,l[1],l[2]||""):e.removeProperty(a)}let s=r.find(o=>o[0]==="aria-hidden");s&&s[1]!==null?n.setAttribute("aria-hidden",s[1]):n.removeAttribute("aria-hidden"),n.removeAttribute(G),n.inert=!1},dr=n=>/^class[\s{]/.test(Function.prototype.toString.call(n)),fr=1500,$t=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),pr=n=>{let t=n.panel,e=0;for(;t&&t.isUnit===!0&&e++<50;)t=t.panel;return t||null},wt=(n,t,e)=>{if(!(!n||typeof n[t]!="function"))try{n[t](...e)}catch(r){console.error("Error in "+t+":",r)}},at=class{constructor(t,e){this.route=t,this.template=e.component,this.component=null,this.hasTemplate=!1,this.setup=!1,this.container=e.container,this.persist=e.persist,this.parent=e.parent,this.keepAlive=typeof e.keepAlive=="boolean"?e.keepAlive:null,this.keepAliveMode=e.keepAliveMode==="hide"||e.keepAliveMode==="detach"?e.keepAliveMode:null,this.hiddenInPlace=!1,this.hiddenStyles=null,this.capturedScroll=null,this.pageCache=e.pageCache||null,this.detachedNodes=null,this.detachedParents=null,this.detachedPath=null,this.savedScroll=null,this.params=null,this.scrollToken=0}isKeepAlive(t){if(this.keepAlive!==null)return this.keepAlive;if(t=t||this.component,t){if(typeof t.keepAlive=="boolean")return t.keepAlive;let r=t.layout;if(r&&r.isUnit===!0&&typeof r.keepAlive=="boolean")return r.keepAlive}let e=this.pageCache;return e!==null&&e.isEnabled()}getKeepAliveMode(t){if(this.keepAliveMode!==null)return this.keepAliveMode;if(t=t||this.component,t){let r=t.keepAliveMode;if(r==="hide"||r==="detach")return r;let s=t.layout;if(s&&s.isUnit===!0&&(s.keepAliveMode==="hide"||s.keepAliveMode==="detach"))return s.keepAliveMode}let e=this.pageCache;return e!==null&&typeof e.getMode=="function"?e.getMode():"detach"}isDetached(){return this.detachedNodes!==null}captureScroll(){let t=this.component;if(this.setup!==!0||!t||t.rendered!==!0){this.capturedScroll=null;return}this.capturedScroll={value:kt(this.getRootNodes(t))}}releaseCapturedScroll(){this.capturedScroll=null}takeScroll(t){let e=this.capturedScroll;return this.capturedScroll=null,e?e.value:kt(this.getRootNodes(t))}focus(t){if(this.params=t,this.setup===!1){if(this.detachedNodes!==null&&this.detachedPath!==this.getPagePath()&&this.evict(),this.detachedNodes!==null&&this.reattach()){this.update(t),this.restoreDetachedScroll(),this.callPageHook("onActivate",[t,{restored:!0}]);return}this.route&&typeof this.route.flushPending=="function"&&this.route.flushPending(),this.create(),this.update(t),this.afterCreate(t);return}this.update(t)}setupTemplate(){let e=typeof this.template;e==="function"?this.initializeComponent():e==="object"&&this.initializeTemplateObject(),this.hasTemplate=!0}initializeComponent(){let t=this.template;this.template=dr(t)?new t:t(),this.initializeTemplateObject()}transferSettings(t){this.persist=this.persist&&t.persist!==!1,Object.assign(t,{route:this.route,persist:this.persist}),this.component=t}initializeTemplateObject(){let t=this.template;if(!t)return;t.isUnit||(this.template=new(jt(t)));let e=this.template;this.transferSettings(e)}create(){if(this.setupTemplate(),!this.hasTemplate)return;this.setup=!0;let t=this.component;d.render(t,this.container,this.parent)}afterCreate(t){let e=this.component;!e||this.pageCache===null||(e.loaded===!1&&e.src&&(e.onModuleRender=()=>this.onModuleRender(e)),this.isKeepAlive(e)&&this.callPageHook("onActivate",[t,{restored:!1}]),this.pageCache.historyNavigation===!0&&this.restoreHistoryScroll())}onModuleRender(t){if(this.setup!==!0||this.component!==t)return;let e=t.layout;e&&e.isUnit===!0&&this.isKeepAlive(t)&&wt(e,"onActivate",[this.params,{restored:!1}])}getScrollKey(){let t=this.route||{};return(t.routeId||"")+"|"+(t.path||"")}getPagePath(){let e=(this.route||{}).path||"",r=e.indexOf("#");return r>-1?e.substring(0,r):e}getRootNodes(t){let e=[],r=pr(t);r&&e.push(r);let s=t.layoutRoots||(t.layoutRoot?[t.layoutRoot]:null),o=t.errorRoots||(t.errorRoot?[t.errorRoot]:null),i=t.loadingRoots||null,a=[s,o,i];for(let l=0;l<3;l++){let c=a[l];if(c)for(let h=0,u=c.length;h<u;h++){let m=c[h];m&&e.indexOf(m)===-1&&e.push(m)}}return cr(e),e}callPageHook(t,e){let r=this.component;if(!r)return;wt(r,t,e);let s=r.layout;s&&s!==r&&s.isUnit===!0&&wt(s,t,e)}restoreHistoryScroll(){let t=this.pageCache.getScroll(this.getScrollKey());if(!t)return;let e=++this.scrollToken,r=this.component,s=()=>ot(this.getRootNodes(r),t);if(s()||typeof requestAnimationFrame>"u")return;let o=$t(),i=()=>{e!==this.scrollToken||this.setup!==!0||this.component!==r||s()||$t()-o>fr||requestAnimationFrame(i)};requestAnimationFrame(i)}restoreDetachedScroll(){let t=this.savedScroll;this.savedScroll=null;let e=this.component;if(!t||!e)return;if(typeof requestAnimationFrame>"u"){ot(this.getRootNodes(e),t);return}let r=++this.scrollToken;requestAnimationFrame(()=>{r!==this.scrollToken||this.setup!==!0||this.component!==e||ot(this.getRootNodes(e),t)})}detach(t){if(t.rendered!==!0)return!1;let e=this.getRootNodes(t);if(e.length===0)return!1;let r=this.takeScroll(t);return this.savedScroll=r,this.pageCache.saveScroll(this.getScrollKey(),r),this.getKeepAliveMode(t)==="hide"&&t.loaded!==!1?this.hideInPlace(e):this.removeNodes(e),this.detachedNodes=e,this.detachedPath=this.getPagePath(),this.callPageHook("onDeactivate",[]),this.pageCache.add(this),!0}removeNodes(t){let e=new WeakMap;for(let r=0,s=t.length;r<s;r++){let o=t[r],i=o.parentNode;i&&(e.set(o,i),i.removeChild(o))}this.detachedParents=e,this.hiddenInPlace=!1,this.hiddenStyles=null}hideInPlace(t){let e=new WeakMap;for(let r=0,s=t.length;r<s;r++){let o=t[r];o&&o.nodeType===1&&e.set(o,hr(o))}this.detachedParents=null,this.hiddenInPlace=!0,this.hiddenStyles=e}showInPlace(t,e){let r=this.hiddenStyles;for(let s=0,o=t.length;s<o;s++){let i=t[s];i.nodeType===1&&i.hasAttribute(G)&&ur(i,r?r.get(i):void 0),i.isConnected||e.appendChild(i)}}reattach(){let t=this.pageCache;t&&t.delete(this),this.detachedNodes=null;let e=this.detachedParents;this.detachedParents=null;let r=this.hiddenInPlace;this.hiddenInPlace=!1;let s=this.component,o=this.container;if(!s||s.rendered!==!0||!o||typeof o.appendChild!="function")return this.savedScroll=null,this.hiddenStyles=null,this.releaseComponent(),!1;if(r)return this.showInPlace(this.getRootNodes(s),o),this.hiddenStyles=null,this.setup=!0,v.schedule(),!0;let i=this.getRootNodes(s);for(let a=0,l=i.length;a<l;a++){let c=i[a],h=e?e.get(c):null;(h&&h.isConnected?h:o).appendChild(c)}return this.setup=!0,v.schedule(),!0}evict(){if(this.detachedNodes===null)return;let t=this.pageCache;t&&t.delete(this),this.detachedNodes=null,this.detachedParents=null,this.savedScroll=null,this.hiddenInPlace=!1,this.hiddenStyles=null,this.releaseComponent()}releaseComponent(){let t=this.component;this.component=null,t&&typeof t.destroy=="function"&&t.destroy()}remove(t){if(this.setup!==!0){t===!0&&this.evict();return}this.setup=!1,this.scrollToken++;let e=this.component;if(!e)return;let r=this.pageCache;if(t!==!0&&r!==null){if(this.isKeepAlive(e)&&this.detach(e))return;r.saveScroll(this.getScrollKey(),this.takeScroll(e))}this.capturedScroll=null,this.releaseComponent()}update(t){let e=this.component;e&&typeof e.update=="function"&&e.update(t)}};var Jt=n=>{if(!n.length)return null;let t={};for(let e=0,r=n.length;e<r;e++)t[n[e]]=null;return t},Xt=n=>{let t=[];if(!n)return t;let e=/[*?]/g;n=n.replace(e,"");let r=/:(.[^./?&($]+)\?*/g,s=n.match(r);if(s===null)return t;for(let o=0,i=s.length;o<i;o++){let a=s[o];a&&t.push(a.replace(":",""))}return t};var mr=/(\/):[^/(]*?\?/g,gr=/\//g,yr=/(\?\/+\*?)/g,Sr=/(:[^/?&($]+)/g,vr=/(\*)/g,xr=n=>n.replace(mr,t=>t.replace(gr,"(?:$|/)")),kr=n=>(n=n.replace(yr,"?/*"),n.replace(Sr,t=>t.indexOf(".")<0?"([^/|?]+)":"([^/|?]+.*)")),wr=n=>n.replace(vr,".*"),Cr=(n,t)=>n+=t[t.length-1]==="*"?"":"$",Zt=n=>{if(!n)return"";let t=n;return t=xr(t),t=kr(t),t=wr(t),t=Cr(t,n),t};var Tr=0,te=(n,t="")=>{let e=n||"",r=typeof t=="string"&&t?t:e,s=null,o=[],i=r.match(/#\{([^}]+)\}/);i&&i[1]&&(s=i[1].trim(),r=r.replace(i[0],""),e=e.replace(i[0],""));let a=r.indexOf("?");if(a>-1){let h=r.substring(a+1);if(h.indexOf("=")>-1){let u=h.split("&");for(let y=0,U=u.length;y<U;y++){let N=u[y];if(!N)continue;let[Ue,Ne=""]=N.split("="),Rt=(Ue||"").trim();Rt&&o.push({key:Rt,value:(Ne||"").trim()})}r=r.substring(0,a);let m=e.indexOf("?");m>-1&&(e=e.substring(0,m))}}let l=s!==null||o.length>0;return l&&!r&&(e="*"),{uriPath:e,requiredHash:s,requiredQuery:o,hasConditions:l}},ee=n=>{if(!n)return"";let t=n.indexOf("?"),e=n.indexOf("#"),r=n.length;return t>-1&&(r=t),e>-1&&e<r&&(r=e),n.substring(0,r).replace(/\/\.(?:\/|$)/g,"/")},Pr=n=>{if(!n)return"";let t=n.indexOf("#");return t===-1?"":n.substring(t+1)},Rr=n=>{if(!n)return"";let t=n.indexOf("?");if(t===-1)return"";let e=n.indexOf("#",t);return e===-1?n.substring(t+1):n.substring(t+1,e)},lt=class extends Lt{constructor(t,e,r=null){let s=t.baseUri,i=te(s,t.rawUri).uriPath,a=Xt(i),l=Jt(a),c=super(l);return this.uri=s,this.matchUri=i,this.paramKeys=a,this.titleCallBack=e,this.pageCache=r,this.setupRoute(t),this.set("active",!1),c}setup(){this.stage={},this.routeId=null,this.uri=null,this.rawUri=null,this.matchUri="",this.uriQuery=/$^/,this.controller=null,this.paramKeys=[],this.requiredHash=null,this.requiredQuery=[],this.hasConditions=!1,this.titleCallBack=()=>{},this.path=null,this.referralPath=null,this.params=null,this.callBack=null,this.title=null,this.preventScroll=!1,this.scrollTo=null,this.pageCache=null,this.importSrc=null}setupRoute(t){this.routeId=t.id||"bs-rte-"+Tr++,this.rawUri=t.rawUri||null,this.path=null,this.referralPath=null;let e=te(this.uri,this.rawUri||"");this.matchUri=e.uriPath,this.requiredHash=e.requiredHash,this.requiredQuery=e.requiredQuery,this.hasConditions=e.hasConditions;let r=Zt(this.matchUri);this.uriQuery=new RegExp("^"+r),this.params=null,this.setupComponentHelper(t),this.callBack=t.callBack,this.title=t.title,this.preventScroll=t.preventScroll||!1,this.scrollTo=t.scrollTo||null}setTitle(t){this.title=t,this.titleCallBack(this,t)}deactivate(t){this.set("active",!1);let e=this.controller;e&&e.remove(t===!0)}captureScroll(){let t=this.controller;t&&this.get("active")&&t.captureScroll()}releaseCapturedScroll(){let t=this.controller;t&&t.releaseCapturedScroll()}isDormant(){let t=this.controller;if(!t)return!1;let e=t.container;return e?e.isConnected===!1?!0:typeof e.closest=="function"&&e.closest("["+G+"]")!==null:!1}getLayout(t){if(t.component)return t.component;let e=t.import;if(!e)return null;let r=e&&typeof e=="object"&&!(e instanceof Promise)?e.src:e;return this.importSrc=typeof r=="string"||typeof r=="function"?r:null,Kt(e)}setupComponentHelper(t){let e=this.getLayout(t);if(!e)return;let{container:r,persist:s,parent:o,keepAlive:i,keepAliveMode:a}=t,l={component:e,container:r,persist:s,parent:o,keepAlive:i,keepAliveMode:a,pageCache:this.pageCache},c=Et(this);this.controller=new at(c,l)}resumeRoute(t){let e=this.controller;e&&(e.container=t)}setPath(t,e){this.path=t,this.referralPath=e}select(){this.set("active",!0);let t=this.stage,e=this.callBack;typeof e=="function"&&e(t);let r=this.controller;r&&r.focus(t);let s=this.path;if(!s)return;let o=s.split("#")[1];o&&this.scrollToId(o)}scrollToId(t){if(!t)return;let e=document.getElementById(t);e&&e.scrollIntoView(!0)}match(t){let e=!1,r=ee(t),s=this.uriQuery||/$^/,o=r.match(s);return o===null?(this.resetParams(),e):Array.isArray(o)?this.matchConditions(t)?(this.setParams(o,1),e=o,e):(this.resetParams(),!1):e}matches(t){return(this.uriQuery||/$^/).test(ee(t))&&this.matchConditions(t)}prefetch(){let t=this.importSrc;return t?Ft(t):null}matchConditions(t){if(!this.hasConditions)return!0;if(this.requiredHash!==null&&Pr(t)!==this.requiredHash)return!1;let e=this.requiredQuery||[];if(e.length>0){let r=Rr(t);if(!r)return!1;let s=new URLSearchParams(r);for(let o=0,i=e.length;o<i;o++){let a=e[o];if(!s.has(a.key)||s.get(a.key)!==a.value)return!1}}return!0}resetParams(){this.stage={}}setParams(t,e=0){if(!Array.isArray(t))return;let r=this.paramKeys;if(!r)return;let s={};for(let o=0,i=r.length;o<i;o++){let a=r[o];typeof a<"u"&&(s[a]=t[o+e])}this.set(s)}getParams(){return this.stage}};var Ar=n=>{let t=/\w\S*/;return n.replace(t,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())},br=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ir=(n,t)=>{if(n.indexOf(":")===-1)return n;let e=t.stage;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let s=new RegExp(":"+br(r),"gi");n=n.replace(s,()=>e[r])}return n},Er=(n,t)=>t&&(typeof t=="function"&&(t=t(n.stage)),t=Ir(t,n),Ar(t)),Lr=(n,t)=>(t!==""&&(n+=" - "+t),n),re=(n,t,e)=>t&&(t=Er(n,t),Lr(t,e));var Mr=()=>typeof window<"u"?window.location:{},_r=n=>{if(!n)return"";let t=n.indexOf("#");return t>-1?n.substring(t+1):""},Dr=1500,ct=["wheel","touchstart","keydown","pointerdown"],ne=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),Ct=class{constructor(){this.version="1.0.2",this.baseURI="/",this.title="",this.lastPath=null,this.path=null,this.lastMatchedRoute=null,this.lastScrollGroup=null,this.activeScrollGroups=new Set,this.scrollGroupsReady=new Set,this.currentGroupId=null,this.scrollWaitToken=0,this.cancelScrollWait=null,this.keepAlive=!1,this.keepAliveMax=St,this.keepAliveMode="detach",this.pageCache=new st(this),this.history=null,this.callBackLink=null,this.location=Mr(),this.routes=[],this.switches=new Map,this.switchCount=0,this.data=new Mt({path:""})}setupHistory(){this.history=nt.setup(this)}createRoute(t){let e=t.uri||"*";return t.rawUri=e,t.baseUri=this.createURI(e),new lt(t,this.updateTitle.bind(this),this.pageCache)}setKeepAlive(t,e){this.keepAlive=t===!0;let r=e?e.max:void 0;typeof r=="number"&&r>=0&&(this.keepAliveMax=r);let s=e?e.mode:void 0;return(s==="hide"||s==="detach")&&(this.keepAliveMode=s),this.pageCache.trim(),this}add(t){if(typeof t!="object"){let r=arguments;t={uri:r[0],component:r[1],callBack:r[2],title:r[3],id:r[4],container:r[5]}}let e=this.createRoute(t);return this.addRoute(e),e}addRoute(t){this.routes.push(t),this.checkRoute(t,this.getPath())}resume(t,e){t.resumeRoute(e),this.addRoute(t)}getBasePath(){if(!this.basePath){let t=this.baseURI||"";t[t.length-1]!=="/"&&(t+="/"),this.basePath=t}return this.basePath}createURI(t){let e=this.getBasePath(),r=et.removeSlashes(t);return r=r.replace(/^(?:\.\/)+/,""),r==="."&&(r=""),e+r}getRoute(t){let e=this.routes,r=e.length;if(r>0)for(let s=0;s<r;s++){let o=e[s];if(o.uri===t)return o}return null}getRouteById(t){let e=this.routes,r=e.length;if(r>0)for(let s=0;s<r;s++){let o=e[s];if(o.routeId===t)return o}return!1}removeRoute(t){let e=this.routes,r=e.indexOf(t);r>-1&&e.splice(r,1),this.lastMatchedRoute===t&&(this.lastMatchedRoute=null),t&&typeof t.deactivate=="function"&&t.deactivate(!0)}addSwitch(t){let e=this.switchCount++,r=this.getSwitchGroup(e);for(let s=0,o=t.length;s<o;s++){let i=t[s];if(!i)continue;let a=this.createRoute(i);r.push(a)}return this.checkGroupForRegistration(e,r),e}resumeSwitch(t,e){let r=this.switchCount++,s=this.getSwitchGroup(r);for(let o=0,i=t.length;o<i;o++){let l=t[o].component.route;l.resumeRoute(e),s.push(l)}return this.checkGroupForRegistration(r,s),r}checkGroupForRegistration(t,e){let r=this.scrollIntent,s=this.currentGroupId;this.scrollIntent=null,this.currentGroupId=t,this.checkGroup(e,this.getPath()),this.currentGroupId=s;let o=this.scrollIntent;o&&o.type==="target"&&o.groupId!==null&&o.groupId!==void 0&&(this.activeScrollGroups.add(o.groupId),this.lastScrollGroup=o.groupId),this.scrollIntent=r}getSwitchGroup(t){let e=this.switches.get(t);if(e)return e;let r=[];return this.switches.set(t,r),r}removeSwitch(t){this.activeScrollGroups.delete(t),this.lastScrollGroup===t&&(this.lastScrollGroup=null);let e=this.switches.get(t);if(this.switches.delete(t),!!e)for(let r=0,s=e.length;r<s;r++){let o=e[r];o&&typeof o.deactivate=="function"&&o.deactivate(!0)}}remove(t){t=this.createURI(t);let e=this.getRoute(t);return e&&this.removeRoute(e),this}setup(t,e){this.baseURI=t||"/",this.updateBaseTag(this.baseURI),this.title=typeof e<"u"?e:"",this.setupHistory(),this.data.path=this.getPath(),this.callBackLink=this.checkLink.bind(this),p.on("click",document,this.callBackLink);let r=this.getEndPoint();return this.navigate(r,null,!0),this}updateBaseTag(t){let e=document.getElementsByTagName("base");e.length&&(e[0].href=t)}getParentLink(t){return t.closest("a")}checkLink(t){if(t.defaultPrevented===!0||t.ctrlKey===!0||t.metaKey===!0||t.shiftKey===!0||t.altKey===!0||typeof t.button=="number"&&t.button!==0)return!0;let e=t.target&&t.target.closest?t.target.closest("a"):null;if(!e||e.dataset.cancelRoute||e.hasAttribute("download"))return!0;let r=e.getAttribute("target");if(r&&r!=="_self")return!0;let s=e.getAttribute("href");if(s===null)return!0;let o=this.getLinkPath(s);if(o===null)return!0;let i=e.dataset.replace==="true";return this.navigate(o,null,i),t.preventDefault(),t.stopPropagation(),!1}getLinkPath(t){let e=t;if(e.substring(0,2)==="//"||/^[a-z][a-z0-9+.-]*:/i.test(e)){let s=this.location;if(!s||!s.origin||typeof URL>"u")return null;let o;try{o=new URL(e,s.href)}catch{return null}if(o.origin!==s.origin)return null;e=o.pathname+o.search+o.hash}let r=this.baseURI;return r!=="/"&&e.indexOf(r)===0&&(e=e.substring(r.length)),e}reset(){let t=this.routes;for(let e=0,r=t.length;e<r;e++){let s=t[e];s&&typeof s.deactivate=="function"&&s.deactivate(!0)}return this.pageCache.clear(),this.routes=[],this.switches=new Map,this.switchCount=0,this.lastMatchedRoute=null,this}activate(){return this.checkActiveRoutes(),this}navigate(t,e,r){return t=this.createURI(t),this.history.addState(t,e,r),this.updatePath(),this.activate(),this}prefetch(t){if(typeof t!="string"||!t)return Promise.resolve([]);let e=this.getLinkPath(t);if(e===null)return Promise.resolve([]);let r=this.createURI(e),s=[],o=a=>{if(!a||!a.controller||typeof a.matches!="function"||!a.matches(r))return!1;let l=a.prefetch();return l&&s.push(l),!0},i=this.routes;for(let a=0,l=i.length;a<l;a++)o(i[a]);for(let a of this.switches.values())for(let l=0,c=a.length;l<c&&!o(a[l]);l++);return Promise.all(s)}updatePath(){let t=this.getPath();this.data.path=t}updateTitle(t){if(!t||!t.title)return this;let e=t.title;return document.title=re(t,e,this.title),this}checkActiveRoutes(t,e){t=t||this.getPath(),t!==this.path&&(this.lastPath=this.path),this.path=t,this.updatePath(),this.scrollIntent=null,this.scrollGroupsReady=new Set(this.activeScrollGroups),this.scrollWaitToken++;let r=this.pageCache;r.historyNavigation=e===!0;let s=this.captureActiveScroll(),o=this.routes;for(let i=0,a=o.length;i<a;i++){let l=o[i];typeof l>"u"||r.size>0&&l.isDormant()||this.checkRoute(l,t)}if(this.checkSwitches(t,!0),r.historyNavigation=!1,this.releaseCapturedScroll(s),e===!0){this.scrollIntent=null;return}this.applyScrollIntent()}captureActiveScroll(){let t=[],e=s=>{!s||!s.controller||!s.get("active")||s.isDormant()||(s.captureScroll(),t.push(s))},r=this.routes;for(let s=0,o=r.length;s<o;s++)e(r[s]);for(let s of this.switches.values())for(let o=0,i=s.length;o<i;o++)e(s[o]);return t}releaseCapturedScroll(t){for(let e=0,r=t.length;e<r;e++)t[e].releaseCapturedScroll()}checkSwitches(t,e){let r=this.switches;for(let[s,o]of r.entries())e===!0&&this.pageCache.size>0&&o.length&&o[0].isDormant()||(this.currentGroupId=s,this.checkGroup(o,t));this.currentGroupId=null}checkGroup(t,e){let r=t.length;if(!r)return;let s=null;for(let a=0;a<r;a++)if(t[a].get("active")){s=t[a];break}let o=!1;s&&(o=s.match(e)!==!1);let i;for(let a=0;a<r;a++){let l=t[a];if(typeof l>"u")continue;(l===s?o:l.match(e))!==!1&&i===void 0&&l.controller&&(i=l)}if(!i){s&&s!==t[0]&&s.deactivate(),this.select(t[0],!0);return}this.select(i),s&&s!==i&&s.deactivate();for(let a=0;a<r;a++){let l=t[a];l&&l!==i&&l!==s&&l.deactivate()}}checkRoute(t,e){let r=this.check(t,e);return r!==!1?(this.select(t),this.lastMatchedRoute=t):t.deactivate(),r}check(t,e){return t?(e=e||this.getPath(),t.match(e)!==!1):!1}select(t,e){if(!t||(t.setPath(this.path,this.lastPath),t.select(),this.updateTitle(t),e===!0))return;let r=this.scrollIntent;if(r&&r.type==="hash")return;let s=_r(this.path);if(s){this.scrollIntent={type:"hash",hash:s};return}t.scrollTo?(this.scrollIntent={type:"target",selector:t.scrollTo,groupId:this.currentGroupId},this.currentGroupId!==null&&this.currentGroupId!==void 0&&this.activeScrollGroups.add(this.currentGroupId)):t.preventScroll!==!0&&!this.scrollIntent&&(this.scrollIntent={type:"top"})}applyScrollIntent(){let t=this.scrollIntent;if(this.scrollIntent=null,!t)return;if(t.type==="hash"){this.lastScrollGroup=null,this.scrollToHash(t.hash);return}if(t.type==="top"){this.lastScrollGroup=null,this.checkToScroll(),this.reassertScrollTop();return}if(t.type!=="target")return;let e=t.groupId!==null&&t.groupId!==void 0,r=e&&this.scrollGroupsReady.has(t.groupId);if(this.lastScrollGroup=e?t.groupId:null,r){this.scrollToTarget(t.selector,t.groupId);return}typeof window<"u"&&window.scrollTo(0,0),this.reassertScrollTop()}reassertScrollTop(){if(typeof window>"u"||typeof requestAnimationFrame>"u")return;let t=++this.scrollWaitToken;requestAnimationFrame(()=>{t===this.scrollWaitToken&&(window.scrollY>0||window.pageYOffset>0)&&window.scrollTo(0,0)})}restoreScrollPosition(t){if(!t||typeof window>"u")return;let e=++this.scrollWaitToken;this.clearScrollWait();let r=t.x||0,s=t.y||0;if(typeof requestAnimationFrame>"u"||this.canReachScroll(r,s)){window.scrollTo(r,s);return}let o=()=>{e===this.scrollWaitToken&&this.scrollWaitToken++,this.clearScrollWait()},i={capture:!0,passive:!0};for(let c=0,h=ct.length;c<h;c++)window.addEventListener(ct[c],o,i);this.cancelScrollWait=()=>{for(let c=0,h=ct.length;c<h;c++)window.removeEventListener(ct[c],o,i)};let a=ne(),l=()=>{if(e!==this.scrollWaitToken){this.clearScrollWait();return}if(this.canReachScroll(r,s)||ne()-a>=Dr){this.clearScrollWait(),window.scrollTo(r,s);return}requestAnimationFrame(l)};requestAnimationFrame(l)}clearScrollWait(){let t=this.cancelScrollWait;t&&(this.cancelScrollWait=null,t())}canReachScroll(t,e){let r=document.documentElement;if(!r)return!0;let s=(r.scrollHeight||0)-(window.innerHeight||0),o=(r.scrollWidth||0)-(window.innerWidth||0);return(e<=0||e<=s+1)&&(t<=0||t<=o+1)}scrollToHash(t){if(!t||typeof document>"u")return;let e=()=>{let l=document.getElementById(t);if(l)return l;try{return document.getElementById(decodeURIComponent(t))}catch{return null}},r=e();if(r){r.scrollIntoView(!0);return}if(typeof requestAnimationFrame>"u")return;let s=++this.scrollWaitToken,o=30,i=0,a=()=>{if(s!==this.scrollWaitToken)return;let l=e();if(l){l.scrollIntoView(!0);return}++i<o&&requestAnimationFrame(a)};requestAnimationFrame(a)}findScrollTarget(t,e){if(typeof document>"u")return null;let r=this.findScopedScrollTarget(t,e);if(r)return r;let s=document.querySelectorAll(t);for(let o=0,i=s.length;o<i;o++){let a=s[o];if(a&&a.isConnected!==!1)return a}return null}findScopedScrollTarget(t,e){if(e==null||!this.switches)return null;let r=this.switches.get(e),s=r&&r[0],o=s&&s.controller&&s.controller.container;if(!o||o.nodeType!==1)return null;let i=o;for(let a=0;a<8;a++){let l=i.parentElement;if(!l||l===document.body||l===document.documentElement)break;let c=l.querySelector(t);if(c)return c;i=l}return null}readScrollTarget(t){let e=window.getComputedStyle(t),r=e.position==="sticky",s=r&&parseFloat(e.top)||0,o=(t.offsetWidth||0)>0||(t.offsetHeight||0)>0,i;if(r){let a=t.style.position;t.style.position="static",i=t.getBoundingClientRect().top+window.scrollY,t.style.position=a}else i=t.getBoundingClientRect().top+window.scrollY;return{sized:o,targetScroll:i-s}}scrollToTarget(t,e){if(typeof t!="string"||typeof document>"u")return;let r=c=>{window.scrollY>c&&window.scrollTo(0,Math.max(0,c))};if(typeof requestAnimationFrame>"u"){let c=this.findScrollTarget(t,e);if(c){let h=this.readScrollTarget(c);h.sized&&r(h.targetScroll)}return}let s=++this.scrollWaitToken,o=30,i=0,a=null,l=()=>{if(s!==this.scrollWaitToken)return;let c=this.findScrollTarget(t,e);if(c){let h=this.readScrollTarget(c);if(h.sized){if(a!==null&&Math.abs(a-h.targetScroll)<1){r(h.targetScroll);return}a=h.targetScroll}}if(++i<o){requestAnimationFrame(l);return}a!==null&&r(a)};requestAnimationFrame(l)}checkToScroll(){this.shouldScrollToTop()&&window.scrollTo(0,0)}cleanPath(t){return t?t.split("?")[0].split("#")[0]:"/"}shouldScrollToTop(){let t=this.cleanPath(this.getPath()),r=this.cleanPath(this.lastPath).split("/"),s=t.split("/");if(r.length!==s.length)return!0;let o=r[r.length-1],i=s[s.length-1];return o!==i}getEndPoint(){return this.getPath().replace(this.baseURI,"")||"/"}destroy(){typeof this.callBackLink=="function"&&p.off("click",document,this.callBackLink);let t=this.history;t&&typeof t.removeEvent=="function"&&t.removeEvent(),this.clearScrollWait(),this.pageCache.clear()}getPath(){let t=this.location,e=this.history;return e&&e.type==="hash"?t.hash.replace("#",""):t.pathname+t.search+t.hash}},P=new Ct;var se=(n,t)=>({attr:n,value:t}),Or=(n,t)=>{if(!t.startsWith(n))return!1;let e=t[n.length];return e===void 0||e==="/"||e==="#"||e==="."||e==="?"},Tt=class extends x{beforeSetup(){this.selectedClass=this.activeClass||"active"}render(){let t=this.href,e=this.text,r=this.setupWatchers(t,e);return{tag:"a",class:this.class||this.className||null,onState:["selected",{[this.selectedClass]:!0}],href:this.getString(t),text:this.getString(e),nest:this.nest||this.children,dataStateSet:this.dataSet,"data-replace":this.replace?"true":null,watch:r}}getLinkPath(){return this?.panel?.pathname||null}getString(t){let e=typeof t;return e!=="object"&&e!=="undefined"?t:null}setupWatchers(t,e){let r=this.exact===!0,s=P.data,o=[];t&&typeof t=="object"&&o.push(se("href",t)),e&&typeof e=="object"&&o.push(se("text",e));let i=null,a="",l="";return o.push({value:["[[path]]",s],callBack:(c,h)=>{if(typeof h.pathname>"u")return;let u=h.getAttribute("href");if(u!==i){i=u;let y=h.pathname+h.search+h.hash;a=y,l=h.hash||h.search?y:h.pathname}let m=r?c===a:Or(l,c);this.update(m)}}),o}setupStates(){return{selected:!1}}update(t){this.state&&(this.state.selected=t)}};var oe=(n,t,e=null)=>{if(!n)return;let r=null,s=!1,o=()=>{s||(s=!0,r&&(clearTimeout(r),r=null),p.off("animationend",n,i),n&&n.classList.remove(t),e&&e())},i=l=>{l.target===n&&o()};p.on("animationend",n,i),n.classList.add(t);let a=()=>{if(!s)try{let l=window.getComputedStyle(n),c=parseFloat(l.animationDuration)*1e3||1e3,h=parseFloat(l.animationDelay)*1e3||0;r=setTimeout(o,c+h+100)}catch{r=setTimeout(o,1e3)}};if(typeof requestAnimationFrame>"u"){r=setTimeout(o,1e3);return}requestAnimationFrame(()=>requestAnimationFrame(a))},ie=(n,t,e)=>{oe(n,t)},ae=(n,t,e)=>{let r=()=>{n&&n.remove&&n.remove()};Br(n,()=>oe(n,t,r),e)};f.addType("manual-destroy",n=>{if(!n)return!1;n.callBack(n.ele,n.parent)});var Br=(n,t,e)=>{f.add(n,"manual-destroy",{ele:n,callBack:t,parent:e})};var K=(n,t,e,r)=>{if(Array.isArray(e[0])){e.forEach(s=>{s&&K(n,t,s,r)});return}Hr(n,t,e,r)},Hr=(n,t,e,r)=>{let s,o;if(e.length<3?[s,o]=e:[t,s,o]=e,!t||!s)return;if(typeof t.on!="function"){console.warn('Watcher directive: Data source does not have an "on" method. Make sure your component has data, state, or context.data initialized before using watchers like onSet, watch, or [[prop]] syntax.',n,t);return}let i=Ur(n,s,o,r);I.watch(n,t,s,i)},Ur=(n,t,e,r)=>typeof e=="object"?s=>{qr(n,e,s)}:s=>{Wr(n,e,t,s,r)},le=new WeakSet,Nr=(n,t,e)=>{!n||!n.isUnit&&!n.isComponent||le.has(e)||le.add(e)},Wr=(n,t,e,r,s)=>{let o=t(r,n,s);switch(typeof o){case"object":if(o===null)break;Nr(o,e,n),d.rebuild(o,n,s);break;case"string":let i=bt(n);if(i!=="textContent"){n.setAttribute(i,o);break}q.addHtml(n,o);break}},qr=(n,t,e)=>{let r=Object.keys(t);for(let s=0,o=r.length;s<o;s++){let i=r[s];i&&(t[i]===e?n.classList.add(i):n.classList.remove(i))}};var H=(n,t,e)=>{let r=R(e);K(n,r,t,e)};var ce=(n,t,e)=>{t&&n.setAttribute("role",t)},Fr=n=>(t,e)=>{let r=t?"true":"false";e.setAttribute(n,r)},he=(n,t,e)=>{if(!t)return;let r=t.role;r&&(n.setAttribute("role",r),t.role=null);let s=Object.keys(t);for(let o=0,i=s.length;o<i;o++){let a=s[o],l=t[a];if(l===null)continue;let c="aria-"+a;if(Array.isArray(l)){let h=l.slice();h.push(Fr(c)),H(n,h,e)}else n.setAttribute(c,l)}};var ue=(n,t,e)=>{if(!t)return;let r=w.parse(t,e);S.addAttributes(n,r.attr,e),d.setDirectives(n,r.directives,e)};f.addType("context",n=>{if(!n)return!1;n.parent.removeContextBranch(n.branch)});var Pt=n=>n?n.getContext():null,de=(n,t,e)=>{if(typeof t!="function")return;let r=Pt(e),s=t(r);ue(n,s,e)},fe=(n,t,e)=>{if(typeof t!="function")return;let r=Pt(e);t(r)},pe=(n,t,e)=>{if(typeof t!="function"||!e)return;let r=Pt(e),s=t(r);if(!s)return;let o=s[0];o&&(e.addContextBranch(o,s[1]),Gr(n,o,e))},Gr=(n,t,e)=>{f.add(n,"context",{branch:t,parent:e})};var me=(n,t,e)=>{};var ge=(n,t,e)=>{if(!e)return;let r=e._layout?e._layout:e.render();console.log("Debug: ","ele: ",n),console.log("Data: ",t),console.log("Layout: ",r),console.log("parent: ",e)};var ye=(n,t,e)=>{},Se=(n,t,e)=>{if(!t||!e)return;let r=t(e,n);r&&d.build(r,n,e)},ve=(n,t,e)=>{if(!t||!e)return;let r=e.getId(t);n.id=r},xe=(n,t,e)=>{if(!t||!e)return;let r=t(e.data,n);r&&d.build(r,n,e)},ke=(n,t,e)=>{if(!t||!e)return;let r=t(e.state,n);r&&d.build(r,n,e)},we=(n,t,e)=>{if(!t||!e)return;let r=e.state,s=t(r);if(!e.state){e.setStateHelper(s);return}e.addState(s)},Ce=(n,t,e)=>{if(!t||!e)return;e.events||e.setEventHelper();let r=t[2];if(r){let s=r;r=o=>{s(o,e)}}e.events.on(t[0],t[1],r,t[3])};var Te=(n,t,e)=>{let r,s,o;if(typeof t=="string"){if(r=R(e),!r)return;s=t}else if(Array.isArray(t))if(typeof t[0]!="object"){let i=R(e);if(!i)return;r=i,s=t[0],o=t[1]}else[r,s,o]=t;I.bind(n,r,s,o)};var ht=(n,t,e)=>{K(n,e.state,t,e)};var Pe=n=>(t,e)=>{let[r,s,o="active"]=n,i=t===s?o:"";e.dataset[r]=i},Re=(n,t,e)=>{if(!t)return;let r=t.length-1,s=t[r],o=t.slice(0,r);o.push(Pe(s)),H(n,o,e)},Ae=(n,t,e)=>{if(!t)return;let r=t.length-1,s=t[r],o=t.slice(0,r);o.push(Pe(s)),ht(n,o,e)};var be=n=>{for(let t=0,e=n.length;t<e;t++){let r=n[t];r&&r.remove()}n.length=0};f.addType("forScopes",n=>{if(!n)return!1;be(n.scopes)});var Ie=(n,t,e)=>{let r,s,o,i;if(typeof t[0]=="string"||t.length<3){let h=R(e);if(!h)return;r=h,[s,o,i]=t}else[r,s,o,i]=t;let a=i!==!1,l=s+"[",c=a?{scopes:[]}:null;c&&f.add(n,"forScopes",c),I.watch(n,r,s,h=>{if(d.removeAll(n),c&&be(c.scopes),!h||h.length<1)return;let u=[];for(let m=0,y=h.length;m<y;m++){let U=a?r.scope(l+m+"]"):null;U&&c&&c.scopes.push(U);let N=o(h[m],m,U,u);N!==null&&u.push(N)}return d.build(u,n,e)})};var Ee=(n,t,e)=>{let r=t[0];if(!r||r.length<1)return;let s=t[1],o=[];for(let i=0,a=r.length;i<a;i++){let l=r[i];if(!l)continue;let c=s(l,i);c!==null&&o.push(c)}d.build(o,n,e)};var Le=(n,t,e)=>{t(n,e)};f.addType("destroyed",n=>{if(!n)return!1;n.callBack(n.ele,n.parent)});var Me=(n,t,e)=>{Kr(n,t,e)},Kr=(n,t,e)=>{f.add(n,"destroyed",{ele:n,callBack:t,parent:e})};var _e=(n,t,e)=>{if(t)if(Array.isArray(t)&&typeof t[0]!="string")for(let r=0,s=t.length;r<s;r++)L.setup(n,t[r],e);else L.setup(n,t,e)};f.addType("routes",n=>{if(!n)return!1;let t=n.route;t&&P.removeRoute(t)});var Oe=(n,t,e)=>{if(t)if(Array.isArray(t))for(let r=0,s=t.length;r<s;r++){let o=t[r];o&&De(n,o,e)}else De(n,t,e)},De=(n,t,e)=>{t.container=n,t.parent=e;let r=P.add(t);zr(n,r)},zr=(n,t)=>{f.add(n,"routes",{route:t})};var Be=(n,t,e)=>{};f.addType("switch",n=>{if(!n)return!1;let t=n.id;P.removeSwitch(t)});var He=(n,t,e)=>{let r=t[0];for(let o=0,i=t.length;o<i;o++){let a=t[o];a&&(a.container=n,a.parent=e)}let s=P.addSwitch(t);Qr(n,s)},Qr=(n,t)=>{f.add(n,"switch",{id:t})};F.add("cache",ye).add("onCreated",Le).add("onDestroyed",Me).add("bind",Te).add("data",me).add("state",Be).add("onSet",H).add("onState",ht).add("animateIn",ie).add("animateOut",ae).add("watch",_e).add("useParent",Se).add("useData",xe).add("useState",ke).add("getId",ve).add("addState",we).add("addEvent",Ce).add("map",Ee).add("for",Ie).add("useContext",fe).add("addContext",pe).add("context",de).add("role",ce).add("aria",he).add("route",Oe).add("debug",ge).add("dataSet",Re).add("dataStateSet",Ae).add("switch",He);export{F as a,Q as b,x as c,Dt as d,Ot as e,_ as f,d as g,Kt as h,Tt as i,Ct as j,P as k};
|
|
2
|
+
//# sourceMappingURL=chunk-DNPDLUU4.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as g}from"./chunk-KB5AL3PM.js";var i=class extends g{setup(){this.stage={}}addAction(t,e){return typeof e<"u"&&this.set(t,e),this}getState(t){return this.get(t)}removeAction(t,e){if(e)return this.off(t,e),this;let s=this.stage;return typeof s[t]<"u"&&delete s[t],this}};var n=class extends i{constructor(t){super(),this.id=t}setup(){this.stage={},this.id=""}};var h=class{static targets=new Map;static ownerCounts=new Map;static restore(t,e){this.targets.set(t,e),this.addOwner(t)}static getTarget(t){return this.targets.has(t)||this.targets.set(t,new n(t)),this.targets.get(t)}static attach(t){let e=this.getTarget(t);return this.addOwner(t),e}static addOwner(t){this.ownerCounts.set(t,(this.ownerCounts.get(t)||0)+1)}static detach(t){let e=this.ownerCounts.get(t);if(e===void 0)return;if(e>1){this.ownerCounts.set(t,e-1);return}this.ownerCounts.delete(t);let s=this.targets.get(t);s&&(s.remove(),this.targets.delete(t))}static getActionState(t,e){return this.getTarget(t).get(e)}static add(t,e,s){let r=this.getTarget(t);return e&&r.addAction(e,s),r}static addAction(t,e,s){return this.add(t,e,s)}static removeAction(t,e,s){if(s){this.off(t,e,s);return}let r=this.getTarget(t);r&&e&&r.removeAction(e)}static on(t,e,s){let r=this.getTarget(t);return e?r.on(e,s):null}static off(t,e,s){this.remove(t,e,s)}static remove(t,e,s){let r=this.targets,o=r.get(t);if(o){if(e){o.off(e,s);return}this.targets.delete(t),this.ownerCounts.delete(t)}}static set(t,e,s){this.getTarget(t).set(e,s)}};export{i as a,h as b};
|
|
2
|
+
//# sourceMappingURL=chunk-HL52UJBX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as D,d as E,f as R}from"./chunk-6N533MOU.js";import{b as J,c as P,d as g,e as w,f as $,g as K}from"./chunk-KMMYW6DR.js";import{a as O,c as j,d as U}from"./chunk-ZUB7I6Z4.js";var b=class{constructor(t=1e3){this.cache=new Map,this.maxSize=t,this.evictCount=t>=8?t>>3:1}get(t){let e=this.cache.get(t);if(e!==void 0)return e.used=!0,e.value}has(t){return this.cache.has(t)}set(t,e){let s=this.cache,r=s.get(t);if(r!==void 0){r.value=e,r.used=!0;return}s.set(t,{value:e,used:!1}),s.size>this.maxSize&&this.evict()}evict(){let t=this.cache,e=this.maxSize-this.evictCount+1;for(let s=0;s<2&&t.size>e;s++){let r=t.keys(),i=t.size;for(;i-- >0&&t.size>e;){let o=r.next().value,c=t.get(o);if(c!==void 0&&c.used){c.used=!1;continue}t.delete(o)}}}delete(t){this.cache.delete(t)}clear(){this.cache.clear()}};var W=new WeakMap,H=new WeakMap;function Y(n){if(!n||typeof n!="object")return n;let t=H.get(n);return t!==void 0?t:n}var X=new WeakMap;function ut(n,t,e,s){let r=W.get(n);r||(r=new Map,W.set(n,r));let i=r.get(e);if(i)return i;let o=new Proxy(n,Z(t,e,s));return r.set(e,o),H.set(o,n),o}function lt(n){n&&typeof n=="object"&&W.delete(n)}function Q(n,t){let e=t.charCodeAt(0),s=e>=48&&e<=57;return n===""?s?"["+t+"]":t:s?n+"["+t+"]":n+"."+t}function Z(n,t="",e=""){return{get(s,r,i){let o=s[r];if(t===""&&r in s){if(typeof o=="function"){let u=X.get(s);u||(u=new Map,X.set(s,u));let l=u.get(r);if(l)return l;let h=o.bind(s);return u.set(r,h),h}return o}if(o=(s[e]||s)[r],o!==null&&typeof o=="object"){let u=Q(t,r);return ut(o,n,u,e)}return o},set(s,r,i,o){if(t===""&&r in s)return s[r]=i,!0;let u=(s[e]||s)[r],l=Q(t,r);return n.set(l,i),u!==i&&u!==null&&typeof u=="object"&<(u),!0}}}var tt=(n,t="stage")=>{let e=new Proxy(n,Z(n,"",t));return H.set(e,n),e};var S=class{static resume(t,e){if(!t)return null;let s=localStorage.getItem(t);if(s===null)return e!==void 0?e:void 0;try{let r=JSON.parse(s);return r===null&&e!==void 0?e:r}catch(r){return console.warn('[LocalData] Failed to parse stored value for key "'+t+'". Removing corrupted entry.',r),localStorage.removeItem(t),e!==void 0?e:void 0}}static store(t,e){if(!t||!e)return!1;try{let s=JSON.stringify(e);return localStorage.setItem(t,s),!0}catch(s){return console.error('[LocalData] Failed to store data for key "'+t+'".',s),!1}}static remove(t){return t?(localStorage.removeItem(t),!0):!1}};var T=(n={})=>{let t={};if(!O.isObject(n))return t;let e=Object.keys(n);for(let s=0,r=e.length;s<r;s++){let i=e[s],o=n[i];typeof o!="function"&&(t[i]=o)}return t};var ht=0,et=new b(2e3),A={CHANGE:"change",DELETE:"delete"},q=(n,t)=>{let e=et.get(n);return e||(e={change:`${n}:change`,delete:`${n}:delete`},et.set(n,e)),t==="change"?e.change:e.delete},_=class n{constructor(t={}){this.dirty=!1,this._retainState=!1,this._refreshState=!1,this.links=new Map,this._init(),this.setup(),this.dataTypeId="bd",this.eventSub=this.createEventSub();let e=T(t);this._initAttributes(e);let s=tt(this);return this._proxy=s,s}retainState(){return this._retainState=!0,this._proxy||this}refreshState(){return this._refreshState=!0,this._proxy||this}setup(){this.stage={}}createEventSub(){return new P}_canSilentInit(){let t=n.prototype;return this.set===t.set&&this._setAttr===t._setAttr&&this._publish===t._publish}_initAttributes(t){if(this._canSilentInit()===!1){this.set(t);return}let e=this.stage,s=Object.keys(t);for(let r=0,i=s.length;r<i;r++){let o=s[r],c=t[o];c!==void 0&&(e[o]=c)}}_init(){let t=++ht;this._dataNumber=t,this._id=`dt-${t}`,this._dataId=`${this._id}:`}onFlush(t){this.eventSub.onFlush(t)}flushPending(){this.eventSub.flush()}getDataId(){return String(this._id)}remove(){this.unlink(),this.eventSub.reset()}on(t,e){let s=q(t,A.CHANGE);return this.eventSub.on(s,e)}off(t,e){let s=q(t,A.CHANGE);this.eventSub.off(s,e)}_setAttr(t,e,s=this,r=!1){let i=this.stage[t];e!==i&&(this.stage[t]=e,this._publish(t,e,s,A.CHANGE))}publishLocalEvent(t,e,s,r){let i=q(t,r);this.eventSub.publish(i,e,s)}_publish(t,e,s,r){this.publishLocalEvent(t,e,s,r),g.getPrefixMessages(this._dataId)!==null&&(s=s||this,g.publish(this._dataId+t,e,s))}set(t,e,s){if(typeof t!="object")return this._setAttr(t,e,s),this;let r=Object.keys(t);for(let i=0;i<r.length;i++){let o=r[i],c=t[o];typeof c!="function"&&this._setAttr(o,c,e,s)}return this}_silentSet(t){let e=this.stage,s=Object.keys(t);for(let r=0,i=s.length;r<i;r++){let o=s[r];e[o]=t[o]}}getModelData(){return this.stage}_deleteAttr(t,e,s=this){delete t[e],this.publishLocalEvent(e,null,s,A.DELETE)}toggle(t){return typeof t>"u"?this:(this.set(t,!this.get(t)),this)}increment(t,e=null){if(typeof t>"u")return this;e=e!==null&&typeof e=="number"?e:1;let s=this.get(t);return this.set(t,s+e),this}decrement(t,e=null){if(typeof t>"u")return this;e=e!==null&&typeof e=="number"?e:1;let s=this.get(t);return this.set(t,s-e),this}concat(t,e){if(typeof t>"u")return this;let s=this.get(t);return this.set(t,s+e),this}ifNull(t,e){return this.get(t)===null&&this.set(t,e),this}setKey(t,e){return this.key=e!=null?t+":v"+e:t,this}resume(t){let e=S.resume(String(this.key),t);return e?(this.set(e),this):this}store(){let t=this.get();return S.store(String(this.key),t)}delete(t){return typeof t=="string"?(this._deleteAttr(this.stage,t),this):(this.setup(),this)}_getAttr(t,e){return t[e]}get(t){return typeof t<"u"?this._getAttr(this.stage,t):this.getModelData()}link(t,e,s){if(arguments.length===1&&t.isData===!0&&(e=t.get()),typeof e!="object")return this.remoteLink(t,e,s);let r=[];return Object.entries(e).forEach(([i])=>{r.push(this.remoteLink(t,i))}),r}remoteLink(t,e,s){let r=s||e,i=t.get(e);typeof i<"u"&&this.get(r)!==i&&this.set(r,i);let o=t.on(e,(u,l)=>{if(l===this)return!1;this.set(r,u,t)}),c=this.on(r,(u,l)=>{if(l===t)return!1;t.set(e,u,this)});return this.addLink(o,t,e,c),t.addLink(c,this,r,o),o}addLink(t,e,s,r){this.links.set(t,{data:e,attr:s,pair:r})}unlink(t){if(t){this.removeLink(t);return}let e=this.links;e.size!==0&&(e.forEach((s,r)=>{this.removeLink(r,!1)}),e.clear())}removeLink(t,e=!0){let s=this.links.get(t);if(s){let r=s.data;s.attr&&r.off(s.attr,t);let i=s.pair,o=i&&r.links;if(o){let c=o.get(i);c&&(o.delete(i),c.attr&&this.off(c.attr,i))}}e!==!1&&this.links.delete(t)}};_.prototype.isData=!0;var st=new Set(["__proto__","prototype","constructor"]),at=n=>{let t=[],e=n.length,s=0;for(let r=0;r<e;r++){let i=n.charCodeAt(r);i!==46&&i!==91&&i!==93||(r>s&&t.push(n.substring(s,r)),s=r+1)}return e>s&&t.push(n.substring(s)),t.length>0?t:null},d={deepDataPattern:/(\w+)|(?:\[(\d)\))/g,segmentCache:new b(1e3),hasDeepData(n){return n.indexOf(".")!==-1||n.indexOf("[")!==-1},isSafeAttr(n){return!st.has(n)},getSegments(n){let t=this.segmentCache.get(n);if(t!==void 0)return t;if(t=at(n),t){for(let e=0,s=t.length;e<s;e++)if(st.has(t[e])){console.warn("[Data] Blocked unsafe path segment in: "+n),t=null;break}}return this.segmentCache.set(n,t),t}};var m=class{static set(t,e,s){if(!d.hasDeepData(e)){if(!d.isSafeAttr(e))return;t[e]=s;return}let r,i=d.getSegments(e);if(!i)return;let o=i.length,c=o-1;for(let u=0;u<o;u++){let l=i[u];if(u===c){t[l]=s;break}if(t[l]===void 0){let h=l.charCodeAt(0);t[l]=h<48||h>57?{}:[]}t=t[l]}}static delete(t,e){if(!d.hasDeepData(e)){if(!d.isSafeAttr(e))return;delete t[e];return}let s=d.getSegments(e);if(!s)return;let r=s.length,i=r-1;for(let o=0;o<r;o++){let c=s[o],u=t[c];if(u===void 0)break;if(o===i){if(Array.isArray(t)){let l=Number(c);Number.isInteger(l)&&l>=0&&l<t.length&&t.splice(l,1);break}delete t[c];break}t=u}}static get(t,e){if(!d.hasDeepData(e))return t[e]??void 0;let s=d.getSegments(e);if(!s)return;let r=s.length,i=r-1;for(let o=0;o<r;o++){let c=s[o],u=t[c]??void 0;if(u===void 0)break;if(t=u,o===i)return t}}};var rt=new Set,L=class{static MAX_DEPTH=50;static publishDeep(t,e,s,r){if(!d.hasDeepData(e)){this.publish(e,s,r);return}let i,o=d.getSegments(e);if(!o)return;let c=o.length,u=c-1,l="";for(let h=0;h<c;h++){let a=o[h];t=t[a];let f=a.charCodeAt(0);h>0?(f<48||f>57)&&(l+="."+a):l=a;let p;if(h===u)p=s;else{let y=o[h+1],x=y.charCodeAt(0);if(x>=48&&x<=57){l+="["+y+"]";continue}let k={};k[y]=t[y],p=k}this.publish(l,p,r)}}static publish(t,e,s,r=null,i=0){if(t=t||"",s(t,e),!(!e||typeof e!="object"||(e=Y(e),r===null&&(rt.clear(),r=rt),!r))){if(r.has(e)){console.warn("[Publisher] Circular reference detected at path:",t);return}if(i>=this.MAX_DEPTH){console.warn("[Publisher] Max depth exceeded at path:",t,"- stopping recursion");return}r.add(e),Array.isArray(e)?this.publishArray(t,e,s,r,i):this.publishObject(t,e,s,r,i)}}static publishArray(t,e,s,r,i){let o=e.length;for(let c=0;c<o;c++){let u=e[c],l=t+"["+c+"]";this._checkPublish(l,u,s,r,i)}}static publishObject(t,e,s,r,i){let o=Object.keys(e);for(let c=0,u=o.length;c<u;c++){let l=o[c],h=e[l],a=t+"."+l;this._checkPublish(a,h,s,r,i)}}static _checkPublish(t,e,s,r,i){if(!e||typeof e!="object"){s(t,e);return}this.publish(t,e,s,r,i+1)}};var C=class n extends _{setup(){this.attributes={},this.stage={}}createEventSub(){return new P(!1,!0)}_canSilentInit(){let t=n.prototype;return this.set===_.prototype.set&&this._setAttr===t._setAttr&&this._publish===t._publish}_initAttributes(t){if(this._canSilentInit()===!1){this.set(t);return}let e=this.stage,s=this.attributes,r=Object.keys(t);for(let i=0,o=r.length;i<o;i++){let c=r[i],u=t[c];if(u!==void 0){if(d.hasDeepData(c)){m.set(s,c,u),m.set(e,c,u);continue}d.isSafeAttr(c)&&(s[c]=u,e[c]=u)}}}_setAttr(t,e,s,r){if(typeof e!="object"&&e===this.get(t))return;!s&&r!==!0?m.set(this.attributes,t,e):this.dirty===!1&&(this.dirty=!0),m.set(this.stage,t,e);let i=this._upstream,o=s;s=s||this,this._publish(t,e,s,A.CHANGE),i&&o!==i.data&&i.keys.has(t)&&i.data.set(i.prefix+t,e,this)}_silentSet(t){let e=this.stage,s=this.attributes,r=Object.keys(t);for(let i=0,o=r.length;i<o;i++){let c=r[i],u=t[c];e[c]=u,s[c]=u}}linkAttr(t,e){let s=t.get(e);if(!s)return;let r=Object.keys(s);for(let i=0,o=r.length;i<o;i++){let c=r[i];this.link(t,e+"."+c,c)}}scope(t,e){let s=this.get(t);if(!s)return!1;e=e||this.constructor;let r=new e(s);return typeof r.linkScope=="function"?r.linkScope(this,t):r.linkAttr(this,t),r}linkScope(t,e){let s=t.get(e);if(!s)return;let r=e+".",i=new Set(Object.keys(s));for(let o of i){let c=r+o,u=t.on(c,(l,h)=>{if(h===this)return!1;this.set(o,l,t)});this.addLink(u,t,c,null)}this._upstream={data:t,prefix:r,keys:i}}unlink(t){t||(this._upstream=null),super.unlink(t)}splice(t,e){return this.delete(t+"["+e+"]"),this.refresh(t),this}push(t,e){let s=this.get(t);return Array.isArray(s)===!1&&(s=[]),s.push(e),this.set(t,s),this}concat(t,e){let s=this.get(t);return Array.isArray(s)===!1&&(s=[]),s=s.concat(e),this.set(t,s),this}unshift(t,e){let s=this.get(t);return Array.isArray(s)===!1&&(s=[]),s.unshift(e),this.set(t,s),this}shift(t){let e=this.get(t);if(Array.isArray(e)===!1)return null;let s=e.shift();return this.set(t,e),s}getIndex(t,e,s){let r=this.get(t);return Array.isArray(r)===!1?-1:typeof r[0]!="object"?r.indexOf(e):r.findIndex(o=>o[e]===s)}pop(t){let e=this.get(t);if(Array.isArray(e)===!1)return null;let s=e.pop();return this.set(t,e),s}refresh(t){return this.set(t,this.get(t)),this}_publish(t,e,s,r){if(this._publishAttr(t,e,s,r),!e||typeof e!="object")return;let i=t.length,o=r===A.CHANGE?":change":":"+r,c=o.length,u=i+c,l=this.eventSub.getRootMessages(J(t))||[];for(let a of l){if(a.length<=u||!a.endsWith(o)||!a.startsWith(t))continue;let f=a.charCodeAt(i);if(f!==46&&f!==91)continue;let p=a.slice(0,a.length-c);this._publishAttr(p,this.get(p),s,r)}let h=g.getPrefixMessages(this._dataId);if(h){let a=this._dataId.length;for(let f of h){if(f.length-a<=i||!f.startsWith(t,a))continue;let y=f.charCodeAt(a+i);if(y!==46&&y!==91)continue;let x=f.slice(a);g.publish(f,this.get(x),s)}}}_publishAttr(t,e,s,r){g.getPrefixMessages(this._dataId)!==null&&g.publish(this._dataId+t,e,s),this.publishLocalEvent(t,e,s,r)}mergeStage(){this.attributes=D.clone(this.stage),this.dirty=!1}getModelData(){return this.mergeStage(),this.attributes}revert(){this.set(this.attributes),this.dirty=!1}_deleteAttr(t,e,s=this){m.delete(t,e),this._delCommitter=s;let r=this._deleteCb||(this._deleteCb=i=>this._publishAttr(i,null,this._delCommitter,A.DELETE));L.publish(e,null,r)}_getAttr(t,e){return m.get(t,e)}};var ft={"\n":"\\n","\r":"\\n"," ":"\\t"},dt=(n,t)=>{typeof n!="string"&&(n=String(n));let e=t?/[\n\r\t]/g:/\t/g;return n.replace(e,s=>ft[s])},nt=(n,t)=>{if(typeof n!="string")return n;n=dt(n,t),n=encodeURIComponent(n);let e=/%22/g;return n.replace(e,'"')},B=(n,t)=>{let e=typeof n;if(e==="undefined")return n;if(e!=="object")return n=nt(n),n;let s=Array.isArray(n)?[...n]:{...n};return Object.keys(s).forEach(r=>{let i=s[r];i!==null&&(s[r]=typeof i=="string"?B(i,t):nt(i,t))}),s};function it(n){if(typeof n>"u"||n.length<1)return!1;try{return JSON.parse(n)}catch(t){return console.warn("[Encode] Failed to parse JSON.",t),!1}}function V(n){return typeof n<"u"?JSON.stringify(n):null}var v=class{static prepareJsonUrl(t,e=!1){let s=typeof t=="object"?D.clone(t):t,r=B(s,e);return V(r)}static json={encode:V,decode:it};static xmlParse(t){return typeof t>"u"?!1:new DOMParser().parseFromString(t,"text/xml")}};var z=n=>n?n.data?n.data:n.context&&n.context.data?n.context.data:n.state?n.state:null:null;var N=class extends K{static create(t,e,s,r){let i=document.createElement(t);return this.addAttributes(i,e,r),s.appendChild(i),i}static addAttributes(t,e,s){if(!(!e||e.length<1))for(let r=0,i=e.length;r<i;r++){let o=e[r];this.addAttr(t,o.key,o.value,s)}}static addAttr(t,e,s,r){if(s===""||!e||e==="children")return;if(e==="innerHTML"){t.innerHTML=s;return}if(typeof s==="function"){if(e=$(e),s.originalCallback)j.add(e,t,s,!1,!0,s.originalCallback);else{let c=s,u=function(l){c.call(this,l,r)};j.add(e,t,u,!1,!0,c)}return}if(e.charCodeAt(4)===45){t.setAttribute(e,s);return}let o=w(e);t[o]=s}static addContent(t,e){e&&(e.textContent!==null?t.textContent=e.textContent:e.innerHTML&&(t.innerHTML=e.innerHTML))}static append(t,e){t.appendChild(e)}};var ot=/(\[\[(.*?(?:\[\d+\])?)\]\])/g,ct=new b(1e3),pt=new Set(["disabled","checked","required","selected","hidden","readonly","readOnly","multiple","open","autofocus","inert"]),gt=n=>typeof n=="string"?n!==""&&n!=="false":!!n,yt=(n,t)=>{if(t.charCodeAt(4)===45){n.removeAttribute(t);return}let e=w(t);if(e in n){n[e]="";return}n.removeAttribute(t)},F={isWatching(n){if(Array.isArray(n)){let t=n[0];return typeof t=="string"&&t.includes("[[")}return this.hasParams(n)},hasParams(n){return typeof n=="string"&&n.includes("[[")},_getWatcherProps(n){let t=ct.get(n);if(t!==void 0)return t;let e=n.match(ot),s=e?e.map(r=>r.slice(2,-2)):null;return ct.set(n,s),s},updateAttr(n,t,e){switch(t){case"text":case"textContent":n.textContent=e;break;case"disabled":case"checked":case"required":case"selected":case"hidden":case"readonly":case"readOnly":case"multiple":case"open":case"autofocus":case"inert":n[t==="readonly"?"readOnly":t]=gt(e);break;case"src":if(n.tagName==="IMG"){n.src=e&&(e.indexOf(".")!==-1||e.indexOf("blob:")!==-1)?e:"";break}n.src=e;break;default:if(e===""&&t){yt(n,t);break}N.addAttr(n,t,e);break}},replaceParams(n,t,e=!1){let s=0;return n.replace(ot,function(r,i,o){let c=e?t[s]:t;s++;let u=c.get(o);return u??""})},_getWatcherCallBack(n,t,e,s,r){let i=this._getWatcherProps(e);if(i&&i.length===1&&e.length===i[0].length+4){let o=i[0],c=r?t[0]:t;return pt.has(s)?()=>{this.updateAttr(n,s,c.get(o))}:()=>{let u=c.get(o);this.updateAttr(n,s,u!=null?String(u):"")}}return()=>{let o=this.replaceParams(e,t,r);this.updateAttr(n,s,o)}},getValue(n,t){let e=n.value;return Array.isArray(e)===!1?[e,z(t)]:e.length<2?[e[0],z(t)]:e},getPropValues(n,t,e){let s=[];for(let r=0,i=t.length;r<i;r++){let c=(e?n[r]:n).get(t[r])??"";s.push(c)}return s},getCallBack(n,t,e,s,r,i){let o=n.attr||"textContent",c=n.callBack;if(typeof c=="function"){let u=i||this._getWatcherProps(s)||[],l=u.length>1;return(h,a)=>{h=l!==!0?h:this.getPropValues(e,u,r);let f=c(h,t,a);typeof f<"u"&&this.updateAttr(t,o,f)}}return this._getWatcherCallBack(t,e,s,o,r)},addDataWatcher(n,t,e){let s=this.getValue(t,e),r=s[1]??e?.data??e?.context?.data??e?.state??null;if(!r)return;let i=s[0],o=Array.isArray(r),c=this._getWatcherProps(i);if(!c)return;let u=this.getCallBack(t,n,r,i,o,c);if(!o)c.length>1?g.watchMany(n,r,c,u):this.addWatcher(n,r,c[0],u);else for(let l=0,h=c.length;l<h;l++)this.addWatcher(n,r[l],c[l],u)},getWatcherSettings(n,t=null){if(typeof n=="string")return{attr:t,value:n};if(Array.isArray(n)){let e=n[n.length-1];e&&typeof e=="object"&&(e=t!==null?t:null);let s=n[1]&&typeof n[1]=="object"?[n[0],n[1]]:[n[0]];return typeof e=="function"?{attr:t,value:s,callBack:e}:{attr:e||"textContent",value:s}}return n},setup(n,t,e){t&&this.addDataWatcher(n,this.getWatcherSettings(t),e)},addWatcher(n,t,e,s){g.watch(n,t,e,s)}};var M=class{constructor(t){this.model=t,this.objectType=this.objectType||"item",this.url="",this.validateCallBack=null,this.requestOptions=null,this.init()}init(){let t=this.model;t&&t.url&&(this.url=t.url)}isValid(){let t=this.validate();if(t!==!1){let e=this.validateCallBack;typeof e=="function"&&e(t)}return t}validate(){return!0}getDefaultParams(){return""}setupParams(t){let e=this.getDefaultParams();return t=this.addParams(t,e),t}objectToString(t){let e=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.push(s+"="+t[s]);return e.join("&")}addParams(t,e){if(t=t||{},typeof t=="string"&&(t=U.parseQueryString(t,!1)),!e)return this._isFormData(t)?t:this.objectToString(t);if(typeof e=="string"&&(e=U.parseQueryString(e,!1)),this._isFormData(t))for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.append(s,e[s]);else t=Object.assign(t,e),t=this.objectToString(t);return t}get(t,e){let s=this.model.get("id"),r="id="+s,i=s?`/${s}`:"",o=this.model;return this._get(i,r,t,e,c=>{if(c){let u=this.getObject(c);u&&o.set(u)}})}getObject(t){return t[this.objectType]||t||!1}setupObjectData(){let t=this.model.get();return this.objectType+"="+v.prepareJsonUrl(t)}setup(t,e){if(!this.isValid())return;let s=this.setupObjectData(),r=this.model.id,i=r!=null?`/${r}`:"";return this._put(i,s,t,e)}add(t,e){if(!this.isValid())return;let s=this.setupObjectData(),r=this.model.id,i=r!=null?`/${r}`:"";return this._post(i,s,t,e)}update(t,e){if(!this.isValid())return;let s=this.setupObjectData(),r=this.model.id,i=r!=null?`/${r}`:"";return this._patch(i,s,t,e)}delete(t,e){let s=this.model.get("id"),r=typeof s<"u"?"id="+s:this.setupObjectData(),i=s!=null?`/${s}`:"";return this._delete(i,r,t,e)}getAllParams(t,e,s,r){let i=this.model.get();t=isNaN(Number(t))?0:t,e=isNaN(Number(e))?50:e;let o=i.search||"",c=f=>{try{return JSON.stringify(f)}catch(p){return console.error("[ModelService] Failed to serialize request param.",p),""}},u=i.filter||"";typeof u=="object"&&(u=c(u));let l=i.dates||"";typeof l=="object"&&(l=c(l));let h=i.orderBy||"";typeof h=="object"&&(h=c(h));let a=i.groupBy||"";return Array.isArray(a)&&(a=c(a)),"&filter="+encodeURIComponent(u)+"&offset="+t+"&limit="+e+"&dates="+encodeURIComponent(l)+"&orderBy="+encodeURIComponent(h)+"&groupBy="+encodeURIComponent(a)+"&search="+encodeURIComponent(o)+"&lastCursor="+(typeof s<"u"&&s!==null?encodeURIComponent(s):"")+"&since="+(typeof r<"u"&&r!==null?encodeURIComponent(r):"")}all(t,e,s,r,i=null,o=null){let c=this.getAllParams(s,r,i,o);return this._get("",c,t,e)}getUrl(t){let e=this.url;if(!t)return this.replaceUrl(e);t[0]==="/"&&(t=t.substring(1));let s=t[0]==="?"?e+t:e+"/"+t;return this.replaceUrl(s)}withOptions(t){return Object.create(this,{requestOptions:{value:t||null,writable:!0}})}withCache(t=!0){return this.withOptions({...this.requestOptions,cache:t})}setupRequest(t,e,s,r,i,o){o=o||this.requestOptions||null;let c=(a,f)=>{typeof i=="function"&&i(a),this.getResponse(a,r,f)},u={url:this.getUrl(t),method:e,params:s,completed:c},l=this._isFormData(s);if(l&&(u.headers={}),!o)return E(u);o.invalidate&&(u.completed=(a,f)=>{a!==!1&&a!=null&&R.invalidate(o.invalidate),c(a,f)});let h=o.cache;return!h||!this.isCacheableMethod(e)||l?E(u):this.cachedRequest(u,h===!0?{}:h)}isCacheableMethod(t){let e=String(t||"").toUpperCase();return e==="GET"||e==="HEAD"}getCacheKey(t){let e=t.params||"";if(typeof e=="object")try{e=JSON.stringify(e)}catch{e=""}return t.method.toUpperCase()+" "+t.url+(e?" "+e:"")}cachedRequest(t,e){let s=e.key||this.getCacheKey(t),r=t.completed,i=o=>E({...t,completed:(c,u)=>o(c!=null,c,u),failed:(c,u)=>o(!1,!1,u),aborted:(c,u)=>o(!1,!1,u)});return R.resolve(s,i,{ttl:e.ttl,swr:e.swr},(o,c)=>r(o,c))}setupEventSource(t,e,s,r,i=!0){let o=null,c,u=!1,l=!1,h=()=>{c&&(clearTimeout(c),c=void 0)},a=()=>{if(u||!i||l)return;h(),c=setTimeout(()=>{c=void 0,f()},3e3)},f=()=>{if(u||l)return;if(o){try{o.close()}catch{}o=null}l=!0;let p=this.getUrl(t),y=e?"?"+e:"";o=new EventSource(p+y,{withCredentials:!0}),o.onopen=()=>{l=!1,h(),r&&r()},o.onerror=()=>{l=!1,o&&o.readyState===EventSource.CLOSED&&(o=null,a())},o.onmessage=x=>{try{let k=JSON.parse(x.data);s&&s(k)}catch{}}};return f(),{get source(){return o},close:()=>{if(u=!0,l=!1,h(),o){try{o.close()}catch{}o=null}}}}replaceUrl(t){return F.isWatching(t)&&(t=F.replaceParams(t,this.model)),t.endsWith("/")&&(t=t.substring(0,t.length-1)),t}_isFormData(t){return t instanceof FormData}request(t,e,s,r,i){return this._request("","POST",t,e,s,r,i)}_get(t,e,s,r,i,o){return e=this.setupParams(e),e=this.addParams(e,s),t=t||"",e&&(t+="?"+e),this.setupRequest(t,"GET","",r,i,o)}_post(t,e,s,r,i,o){return this._request(t,"POST",e,s,r,i,o)}_put(t,e,s,r,i,o){return this._request(t,"PUT",e,s,r,i,o)}_patch(t,e,s,r,i,o){return this._request(t,"PATCH",e,s,r,i,o)}_delete(t,e,s,r,i,o){return this._request(t,"DELETE",e,s,r,i,o)}_request(t,e,s,r,i,o,c){return s=this.setupParams(s),s=this.addParams(s,r),this.setupRequest(t,e,s,i,o,c)}getResponse(t,e,s){typeof e=="function"&&e(t,s)}static extend(t){if(!t)return{};let e=this;class s extends e{constructor(i){super(i)}}return Object.assign(s.prototype,t),s}};var mt=n=>{let t={};if(!O.isObject(n)||!n.defaults)return t;let{defaults:e}=n;return Object.keys(e).forEach(s=>{let r=e[s];typeof r!="function"&&(t[s]=r)}),delete n.defaults,t},bt=n=>{if(!n||typeof n.xhr!="object")return{};let t={...n.xhr};return delete n.xhr,t},At=0,I=class extends C{constructor(t){let e=super(t);return this.initialize(),e}setup(){this.attributes={},this.stage={},this.url=this.url||"",this.xhr=this.xhr||{}}initialize(){}static extend(t={}){let e=this,s=bt(t),r=e.prototype.service.extend(s),i=mt(t);class o extends e{constructor(u){let l={...i,...T(u)};super(l),this.xhr=new r(this)}dataTypeId=`bm${At++}`}return Object.assign(o.prototype,t),o.prototype.service=r,o}};I.prototype.service=M;var G=class extends _{};export{b as a,tt as b,_ as c,C as d,z as e,N as f,F as g,I as h,G as i};
|
|
2
|
+
//# sourceMappingURL=chunk-KB5AL3PM.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as M,b as D,c as g,d as p}from"./chunk-ZUB7I6Z4.js";var C=class{constructor(){this.connections=new Map}add(t,e,s){let i=this.getOrCreate(t),n=i.get(e);return n?Array.isArray(n)?n.push(s):i.set(e,[n,s]):i.set(e,s),s}get(t,e){let s=this.connections.get(t)?.get(e);return s?Array.isArray(s)?s[s.length-1]||!1:s:!1}getOrCreate(t){let e=this.connections.get(t);return e||(e=new Map,this.connections.set(t,e)),e}remove(t,e){let s=this.connections.get(t);if(s)if(e)this.unsubscribe(s.get(e)),s.delete(e),s.size===0&&this.connections.delete(t);else{for(let i of s.values())this.unsubscribe(i);this.connections.delete(t)}}unsubscribe(t){if(t)if(Array.isArray(t))for(let e=0,s=t.length;e<s;e++)t[e]?.unsubscribe();else t.unsubscribe()}};var b=class{constructor(){this.msg=null,this.token=null}setToken(t){this.token=t}};var I=class extends b{constructor(t){super(),this.data=t}subscribe(t,e){if(!this.data||typeof this.data.on!="function"){console.warn('OneWaySource: Cannot subscribe - data source is null or does not have an "on" method. Make sure your component has data, state, or context.data initialized.',t,this.data);return}this.msg=t,this.token=this.data.on(t,e)}subscribeMany(t,e){if(!this.data||typeof this.data.on!="function"){console.warn('OneWaySource: Cannot subscribeMany - data source is null or does not have an "on" method.',t,this.data);return}let s=t.length,i=new Array(s);for(let n=0;n<s;n++){let u=t[n];i[n]={msg:u,token:this.data.on(u,e)}}this.subscriptions=i}unsubscribe(){if(this.data){let t=this.subscriptions;if(t){for(let e=0,s=t.length;e<s;e++)this.data.off(t[e].msg,t[e].token);this.subscriptions=null}else this.msg&&this.token&&this.data.off(this.msg,this.token)}this.data=null,this.msg=null,this.token=null}};var m=class{unsubscribe(){}};var x=class extends m{constructor(){super(),this.source=null}addSource(t){return this.source=new I(t)}unsubscribe(){this.source.unsubscribe(),this.source=null}};var y=class extends b{constructor(t){super(),this.pubSub=t}subscribe(t){this.msg=t;let e=this.callBack.bind(this);this.token=this.pubSub.on(t,e)}unsubscribe(){this.pubSub&&this.msg&&this.token&&this.pubSub.off(this.msg,this.token),this.pubSub=null,this.msg=null,this.token=null}callBack(){}};var w=class extends y{constructor(t,e,s){super(s),this.data=t,this.prop=e}set(t){this.data.set(this.prop,t)}get(){return this.data.get(this.prop)}callBack(t,e){this.data!==e&&this.data.set(this.prop,t,e)}unsubscribe(){super.unsubscribe(),this.data=null,this.prop=null}};var k=class{static getById(t){return typeof t!="string"?!1:document.getElementById(t)||!1}static getByName(t){if(typeof t!="string")return!1;let e=document.getElementsByName(t);return e?Array.from(e):!1}static getBySelector(t,e){if(typeof t!="string")return!1;if(e=e||!1,e===!0)return document.querySelector(t)||!1;let s=document.querySelectorAll(t);return s?s.length===1?s[0]:Array.from(s):!1}static html(t,e){return!t||typeof t!="object"?!1:typeof e<"u"?(t.innerHTML=e,this):t.innerHTML}static setCss(t,e,s){return!t||typeof t!="object"||typeof e>"u"?this:(e=p.uncamelCase(e),t.style[e]=s,this)}static getCss(t,e){if(!t||typeof e>"u")return!1;e=p.uncamelCase(e);let s=t.style[e];if(s!=="")return s;let i=null,n=t.currentStyle;if(n&&(i=n[e]))return i;let u=window.getComputedStyle(t,null);return u?u[e]:s}static css(t,e,s){return typeof s<"u"?(this.setCss(t,e,s),this):this.getCss(t,e)}static removeAttr(t,e){return typeof t=="object"&&t!==null&&t.removeAttribute(e),this}static setAttr(t,e,s){t.setAttribute(e,s)}static getAttr(t,e){return t.getAttribute(e)}static attr(t,e,s){return!t||typeof t!="object"?!1:typeof s<"u"?(this.setAttr(t,e,s),this):this.getAttr(t,e)}static _checkDataPrefix(t){return typeof t!="string"||(t=p.uncamelCase(t),t.substring(0,5)!=="data-"&&(t="data-"+t)),t}static removeDataPrefix(t){return typeof t=="string"&&t.substring(0,5)==="data-"&&(t=t.substring(5)),t}static setData(t,e,s){e=this.removeDataPrefix(e),e=p.camelCase(e),t.dataset[e]=s}static getData(t,e){return e=p.camelCase(this.removeDataPrefix(e)),t.dataset[e]}static data(t,e,s){return!t||typeof t!="object"?!1:typeof s<"u"?(this.setData(t,e,s),this):this.getData(t,e)}static find(t,e){return!t||typeof e!="string"?[]:t.querySelectorAll(e)}static show(t){if(!t||typeof t!="object")return this;let e=this.data(t,"style-display"),s=typeof e=="string"?e:"";return this.css(t,"display",s),this}static hide(t){if(!t||typeof t!="object")return this;let e=this.css(t,"display");return e!=="none"&&e&&this.data(t,"style-display",e),this.css(t,"display","none"),this}static toggle(t){return!t||typeof t!="object"?this:(this.css(t,"display")!=="none"?this.hide(t):this.show(t),this)}static getSize(t){return!t||typeof t!="object"?!1:{width:this.getWidth(t),height:this.getHeight(t)}}static getWidth(t){return typeof t=="object"&&t!==null?t.offsetWidth:!1}static getHeight(t){return typeof t=="object"&&t!==null?t.offsetHeight:!1}static getScrollPosition(t){let e=0,s=0;switch(typeof t){case"undefined":t=document.documentElement,e=t.scrollLeft,s=t.scrollTop;break;case"object":e=t.scrollLeft,s=t.scrollTop;break}return!t||typeof t!="object"?!1:{left:e-(t.clientLeft||0),top:s-(t.clientTop||0)}}static getScrollTop(t){return this.getScrollPosition(t).top}static getScrollLeft(t){return this.getScrollPosition(t).left}static getWindowSize(){let t=window,e=document,s=e.documentElement,i=e.getElementsByTagName("body")[0],n=t.innerWidth||s.clientWidth||i.clientWidth,u=t.innerHeight||s.clientHeight||i.clientHeight;return{width:n,height:u}}static getDocumentSize(){let t=document,e=t.body,s=t.documentElement,i=Math.max(e.scrollHeight,e.offsetHeight,s.clientHeight,s.scrollHeight,s.offsetHeight);return{width:Math.max(e.scrollWidth,e.offsetWidth,s.clientWidth,s.scrollWidth,s.offsetWidth),height:i}}static getDocumentHeight(){return this.getDocumentSize().height}static position(t,e=1){let s={x:0,y:0};if(!t||typeof t!="object")return s;let i=0;for(;t&&(e===0||i<e);)i++,s.x+=t.offsetLeft+t.clientLeft,s.y+=t.offsetTop+t.clientTop,t=t.offsetParent;return s}static addClass(t,e){if(!t||typeof t!="object"||e==="")return this;if(typeof e=="string"){let s=e.split(" ");for(let i=0,n=s.length;i<n;i++)t.classList.add(s[i])}return this}static removeClass(t,e){return!t||typeof t!="object"||e===""?this:(typeof e>"u"?t.className="":t.classList.remove(e),this)}static hasClass(t,e){return!t||typeof t!="object"||e===""?!1:t.classList.contains(e)}static toggleClass(t,e){return!t||typeof t!="object"?this:(t.classList.toggle(e),this)}};var P=r=>{let t="textContent";if(!r||typeof r!="object")return t;let e=r.tagName.toLowerCase();if(e==="input"||e==="textarea"||e==="select"){let s=r.type;if(!s)return t="value",t;switch(s){case"checkbox":t="checked";break;case"file":t="files";break;default:t="value"}}return t};var O=(r,t,e)=>{k.setAttr(r,t,e)},R=(r,t,e)=>{r.checked=r.value==e},W=(r,t,e)=>{e=e==1,H(r,t,e)},H=(r,t,e)=>{r[t]=e},N=(r,t)=>k.getAttr(r,t),q=(r,t)=>r[t],A=class extends y{constructor(t,e,s,i){super(i),this.element=t,this.attr=this.getAttrBind(e),this.addSetMethod(t,this.attr),this.filter=typeof s=="string"?this.setupFilter(s):s}addSetMethod(t,e){if(e.charAt(4)==="-")return this.setValue=O,this.getValue=N,this;this.getValue=q;let s=t.type;if(s)switch(s){case"checkbox":return this.setValue=W,this;case"radio":return this.setValue=R,this}return this.setValue=H,this}getAttrBind(t){return t||P(this.element)}setupFilter(t){let e=/\[\[[^\]]+\]\]/;return s=>t.replace(e,()=>s)}set(t){let e=this.element;return!e||typeof e!="object"?this:(this.filter&&(t=this.filter(t)),this.setValue(e,this.attr,t),this)}get(){let t=this.element;return!t||typeof t!="object"?"":this.getValue(t,this.attr)}callBack(t,e){return e!==this.element&&this.set(t),this}unsubscribe(){super.unsubscribe(),this.element={},this.attr="",this.filter=null,this.setValue=null,this.getValue=null}};var v=class extends m{constructor(t){super(),this.element=null,this.data=null,this.pubSub=t}addElement(t,e,s){return this.element=new A(t,e,s,this.pubSub)}addData(t,e){return this.data=new w(t,e,this.pubSub)}unsubscribeSource(t){return t&&t.unsubscribe(),this}unsubscribe(){return this.unsubscribeSource(this.element),this.unsubscribeSource(this.data),this.element=null,this.data=null,this}};var V=0,T=r=>{for(let t=0,e=r.length;t<e;t++){let s=r.charCodeAt(t);if(s===46||s===58||s===91)return r.substring(0,t)}return r},B=class{constructor(t=!1,e=!1){this.callBacks=new Map,this.prefixIndex=t?new Map:null,this.rootIndex=e?new Map:null,this.updateQueue=new Map,this.flushScheduled=!1,this.isFlushing=!1,this.flushIterations=0,this.maxFlushIterations=2e3,this.batchingEnabled=!0,this.debugMode=!1,this.flushCompleteResolvers=[],this.flushCallbacks=[],this.deliveringMessage=null,this.reentrantMessages=null,this.suppressQueue=!1}get(t){return this.callBacks.has(t)||this.callBacks.set(t,new Map),this.callBacks.get(t)}reset(){this.callBacks.clear(),this.prefixIndex?.clear(),this.rootIndex?.clear(),this.updateQueue.clear(),this.flushScheduled=!1,this.isFlushing=!1,this.flushIterations=0,this.reentrantMessages=null}on(t,e){let s=++V,i=this.callBacks.get(t);return i||(i=new Map,this.callBacks.set(t,i),this.prefixIndex&&this._indexMessage(t),this.rootIndex&&this._indexRoot(t)),i.set(s,e),s}_indexMessage(t){let e=t.indexOf(":");if(e===-1)return;let s=t.substring(0,e+1),i=this.prefixIndex.get(s);i||(i=new Set,this.prefixIndex.set(s,i)),i.add(t)}_unindexMessage(t){let e=t.indexOf(":");if(e===-1)return;let s=t.substring(0,e+1),i=this.prefixIndex.get(s);i&&(i.delete(t),i.size===0&&this.prefixIndex.delete(s))}_indexRoot(t){let e=T(t),s=this.rootIndex.get(e);s||(s=new Set,this.rootIndex.set(e,s)),s.add(t)}_unindexRoot(t){let e=T(t),s=this.rootIndex.get(e);s&&(s.delete(t),s.size===0&&this.rootIndex.delete(e))}getRootMessages(t){return this.rootIndex?this.rootIndex.get(t)||null:this.callBacks.keys()}getPrefixMessages(t){return this.prefixIndex&&this.prefixIndex.get(t)||null}getMessages(){return this.callBacks.keys()}off(t,e){let s=this.callBacks.get(t);s&&(s.delete(e),s.size===0&&(this.callBacks.delete(t),this.prefixIndex&&this._unindexMessage(t),this.rootIndex&&this._unindexRoot(t)))}remove(t){this.callBacks.delete(t),this.prefixIndex&&this._unindexMessage(t),this.rootIndex&&this._unindexRoot(t)}publish(t,e,s){if(!this.batchingEnabled){this.publishImmediate(t,e,s);return}this.suppressQueue||(t===this.deliveringMessage&&(this.reentrantMessages??=new Set).add(t),this.callBacks.has(t)&&(this.updateQueue.set(t,[e,s]),this.debugMode&&console.log("[DataPubSub] Queued update:",t,e),this.scheduleFlush()))}scheduleFlush(){this.isFlushing||this.flushScheduled||(this.flushScheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){if(this.updateQueue.size===0){this.flushScheduled=!1,this.isFlushing=!1,this.flushIterations=0,this._resolveFlushComplete();return}if(this.isFlushing||(this.flushIterations=0,this.reentrantMessages=null),this.isFlushing=!0,this.flushScheduled=!1,this.flushIterations++,this.flushIterations>this.maxFlushIterations){console.error("[DataPubSub] Infinite loop detected! Flush iterations exceeded",this.maxFlushIterations,"- Breaking to prevent memory exhaustion."),console.error("[DataPubSub] Queue size:",this.updateQueue.size),console.error("[DataPubSub] Queued messages:",Array.from(this.updateQueue.keys())),this._breakCascade(),this.flushScheduled=!1,this.isFlushing=!1,this._resolveFlushComplete(),this.flushIterations=0;return}this.debugMode&&console.log("[DataPubSub] Flushing",this.updateQueue.size,"updates (iteration",this.flushIterations+")");let t=this.updateQueue;this.updateQueue=new Map;try{for(let[e,s]of t)this.publishImmediate(e,s[0],s[1])}finally{this.debugMode&&console.log("[DataPubSub] Flush complete (iteration",this.flushIterations+")"),this.updateQueue.size>0?(this.debugMode&&console.log("[DataPubSub] New updates queued during flush, re-flushing..."),this.flush()):(this.isFlushing=!1,this.flushIterations=0,this._resolveFlushComplete())}}_breakCascade(){let t=this.updateQueue;this.updateQueue=new Map;let e=this.reentrantMessages;this.suppressQueue=!0;try{for(let[s,i]of t)e&&e.has(s)||this.publishImmediate(s,i[0],i[1])}finally{this.suppressQueue=!1,this.reentrantMessages=null,this.updateQueue.clear()}}_resolveFlushComplete(){if(this.flushCompleteResolvers.length>0){let t=this.flushCompleteResolvers;this.flushCompleteResolvers=[];let e=t.length;for(let s=0;s<e;s++)t[s]()}if(this.flushCallbacks.length>0){let t=this.flushCallbacks;this.flushCallbacks=[];let e=t.length;for(let s=0;s<e;s++)t[s]()}}nextFlush(){return new Promise(t=>{this.flushCompleteResolvers.push(t),!this.flushScheduled&&!this.isFlushing&&queueMicrotask(()=>t())})}onFlush(t){if(typeof t!="function"){console.warn("[DataPubSub] onFlush requires a function callback");return}this.flushCallbacks.push(t),!this.flushScheduled&&!this.isFlushing&&queueMicrotask(()=>{if(this.flushCallbacks.length>0){let e=this.flushCallbacks;this.flushCallbacks=[];let s=e.length;for(let i=0;i<s;i++)e[i]()}})}flushSync(){this.flush()}publishImmediate(t,e,s){let i=this.callBacks.get(t);if(!i)return;let n=this.deliveringMessage;this.deliveringMessage=t;for(let u of i.values())if(u)try{u(e,s)}catch(a){console.error('[DataPubSub] Subscriber error for "'+t+'":',a)}this.deliveringMessage=n}};var F=class{constructor(){this.version="1.0.1",this.attr="bindId",this.blockedKeys=new Set([20,37,38,39,40]),this.connections=new C,this.pubSub=new B(!0),this.idCount=0,this.setup()}setup(){this.setupEvents()}bind(t,e,s,i){let n=s,u=null,a=s.indexOf(":");a!==-1&&(u=s.substring(0,a),n=s.substring(a+1));let l=u??"",f=this.setupConnection(t,e,n,l,i),c=f.element,h=e.get(n);return typeof h<"u"?c.set(h):(h=c.get(),h!==""&&f.data.set(h)),this}setupConnection(t,e,s,i,n){let u=this.getBindId(t),a=new v(this.pubSub);a.addData(e,s).subscribe(u);let c=`${e.getDataId()}:${s}`;return a.addElement(t,i,n).subscribe(c),this.addConnection(u,"bind",a),a}addConnection(t,e,s){return this.connections.add(t,e,s),this}setBindId(t){let e="db-"+this.idCount++;return t[this.attr]=e,e}getBindId(t){return t[this.attr]||this.setBindId(t)}unbind(t){let e=t[this.attr];return e&&this.connections.remove(e),this}watch(t,e,s,i){if(M.isObject(t)===!1)return this;let n=new x,u=e.get(s),a=!0,l=d=>{a&&(a=!1,d===u&&(d===null||typeof d!="object"))||i(d)};n.addSource(e).subscribe(s,l);let c=this.getBindId(t),h=e.getDataId()+":"+s;return this.addConnection(c,h,n),i(u),this}watchMany(t,e,s,i){if(M.isObject(t)===!1)return this;let n=s?s.length:0;if(n===0)return this;if(n===1)return this.watch(t,e,s[0],i);let u=new x,a=u.addSource(e),l=new Array(n),f=new Array(n);for(let o=0;o<n;o++)l[o]=e.get(s[o]),f[o]=!0;let c=new Array(n);for(let o=0;o<n;o++){let E=o,z=l[o];c[o]=S=>{f[E]&&(f[E]=!1,S===z&&(S===null||typeof S!="object"))||i(S)}}if(typeof e.on!="function")return console.warn('DataBinder.watchMany: data source has no "on" method.',e),this;let h=new Array(n);for(let o=0;o<n;o++)h[o]={msg:s[o],token:e.on(s[o],c[o])};a.subscriptions=h;let d=this.getBindId(t),_=e.getDataId()+":"+s.join(",");return this.addConnection(d,_,u),i(l[0]),this}unwatch(t,e,s){if(M.isObject(t)===!1)return this;let i=t[this.attr];if(i){let n=e.getDataId()+":"+s;this.connections.remove(i,n)}return this}publish(t,e,s){return this.pubSub.publish(t,e,s),this}getPrefixMessages(t){return this.pubSub.getPrefixMessages(t)}isDataBound(t){if(!t)return null;let e=t[this.attr];return e||null}isBlocked(t){return t.type!=="keyup"?!1:this.blockedKeys.has(t.keyCode)}bindHandler(t){if(this.isBlocked(t))return!0;let e=t.target||t.srcElement,s=this.isDataBound(e);if(s!==null){let i=this.connections.get(s,"bind");if(i){let n=i.element.get();this.pubSub.publish(s,n,e)}}}setupEvents(){this.changeHandler=this.bindHandler.bind(this),this.addEvents()}addEvents(){typeof document<"u"&&g.on(["change","input"],document,this.changeHandler,!1)}removeEvents(){typeof document<"u"&&g.off(["change","input"],document,this.changeHandler,!1)}},L=new F;var K=new Map([["class","className"],["text","textContent"],["for","htmlFor"],["readonly","readOnly"],["maxlength","maxLength"],["cellspacing","cellSpacing"],["rowspan","rowSpan"],["colspan","colSpan"],["tabindex","tabIndex"],["celpadding","cellPadding"],["useMap","useMap"],["frameborder","frameBorder"],["contenteditable","contentEditable"]]),U=r=>K.get(r)||r,G=r=>typeof r=="string"&&r.charCodeAt(0)===111&&r.charCodeAt(1)===110?r.substring(2):r,$=/(?:<[a-z][\s\S]*>)/i,Q=class{static create(t,e,s,i){let n=document.createElement(t);return this.addAttributes(n,e),i===!0?this.prepend(s,n):this.append(s,n),n}static addAttributes(t,e){if(!e||typeof e!="object")return;let s=e.type;s!==void 0&&t.setAttribute("type",s);let i=Object.keys(e);for(let n=0,u=i.length;n<u;n++){let a=i[n],l=e[a];a==="innerHTML"?t.innerHTML=l:a.indexOf("-")!==-1?t.setAttribute(a,l):this.addAttr(t,a,l)}}static addHtml(t,e){return typeof e>"u"||e===""?this:($.test(e)?t.innerHTML=e:t.textContent=e,this)}static addAttr(t,e,s){if(s===""||!e)return;if(typeof s==="function")e=G(e),s.originalCallback?g.add(e,t,s,!1,!0,s.originalCallback):g.add(e,t,s);else{let n=U(e);t[n]=s}}static createDocFragment(){return document.createDocumentFragment()}static createText(t,e){let s=document.createTextNode(t);return e&&this.append(e,s),s}static createComment(t,e){let s=document.createComment(t);return e&&this.append(e,s),s}static setupSelectOptions(t,e,s){if(!t||typeof t!="object"||!Array.isArray(e))return!1;e.forEach(i=>{let n=new Option(i.label,i.value);t.options.add(n),s!==null&&n.value==s&&(n.selected=!0)})}static removeElementData(t){let e=[t];for(;e.length>0;){let s=e.pop(),i=s.childNodes;if(i&&i.length>0)for(let n=i.length-1;n>=0;n--){let u=i[n];(u.nodeType!==3||u.bindId)&&e.push(u)}D.remove(s),s.bindId&&L.unbind(s)}}static removeElement(t){if(!t)return this;let e=D.has(t,"manual-destroy");return this.removeElementData(t),e===!1&&t.remove(),this}static removeChild(t){return this.removeElement(t),this}static removeAll(t){if(!t||typeof t!="object")return this;let e;for(;e=t.firstChild;)this.removeElementData(e),t.removeChild(e);return this}static changeParent(t,e){return e.appendChild(t),this}static append(t,e){return t.appendChild(e),this}static prepend(t,e,s){let i=s||t.firstChild;return t.insertBefore(e,i),this}static clone(t,e=!1){return!t||typeof t!="object"?!1:t.cloneNode(e)}};export{P as a,T as b,B as c,L as d,U as e,G as f,Q as g};
|
|
2
|
+
//# sourceMappingURL=chunk-KMMYW6DR.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as A}from"./chunk-6YJAZHX6.js";import{a as E,b as Et,c as Lt,d as Mt,e as R,f as S,g as L}from"./chunk-HBL2JSVL.js";import{a as W,b as At}from"./chunk-VSCHM2ZB.js";import{a as bt,c as I,d as It,f as q}from"./chunk-LY736NR2.js";import{b as f,c as p}from"./chunk-7ZHUXJZT.js";var F={items:new Map,add(n,t){return this.items.set(n,t),this},get(n){return this.items.get(n)??null}};var g=[],z=0,ut=!1,We=typeof queueMicrotask=="function"?queueMicrotask:n=>Promise.resolve().then(n),qe=n=>{let t=n.panel,e=0;for(;t&&t.isUnit===!0&&e++<50;)t=t.panel;return t||n.container||null},Fe=n=>{n._mountPending=!1;try{n.afterMount()}catch(t){console.error("Error in afterMount:",t)}},_t=()=>{ut=!1;let n=g;if(n.length===0)return;g=[];let t=[];for(let e=0,r=n.length;e<r;e++){let s=n[e];if(s.rendered!==!0||s._mountPending!==!0){s._mountPending=!1;continue}let o=qe(s);if(o&&o.isConnected===!0){Fe(s);continue}t.push(s)}t.length&&(g=g.length?t.concat(g):t),g.length&&z===0&&g.length!==t.length&&dt()},dt=()=>{ut||(ut=!0,We(_t))},v={add(n){n._mountPending!==!0&&(n._mountPending=!0,g.push(n))},enter(){z++},leave(){--z>0||(z=0,g.length&&dt())},schedule(){g.length&&dt()},flush(){_t()},get size(){return g.length}};f.addType("components",n=>{if(!n)return;let t=n.component;!t||!t.isUnit||(t.persistToken&&t.parent&&t.parent.removePersistedChild(t.persistToken,t),t.rendered===!0&&(t.prepareDestroy(),t.cleanUpAfterDestroy()))});var Ge=0,Q=class{constructor(t,e,r){this.isUnit=!0,this.data=null,this.persist=null,this.nest=null,this.state=null,this.panel=null,this.parent=null,this.unitType=null,this._classId,this.id="",this.cached=[],this.init();let s,o;if(t==null)s={},o=[];else{let i=typeof t;i==="string"||i==="number"?(s={},o=[{tag:"text",textContent:t}]):Array.isArray(t)?(s={},o=t):(s=t||{},o=typeof e=="string"?[{tag:"text",textContent:e}]:e)}this.setupProps(s),this.children=o||[],this.persistedChildren={},this.persistedCount=0,this.onCreated(),this.rendered=!1,this.container=null}init(){this.id="cp-"+Ge++,this.unitType=this._classId||this.constructor.name.toLowerCase()}declareProps(){}addPersistedChild(t){let e=t.key,r=t.cache,s;r!=null&&e!=null?s="pk:"+r+":"+e:r!=null?s="pk:"+r:e!=null?s="pk:"+e:s="pc"+this.persistedCount++;let o=this.persistedChildren[s];return o&&t.unitType===o.unitType&&t.resumeScope(o),t.persistToken=s,this.persistedChildren[s]=t,s}removePersistedChild(t,e){if(!this.rendered)return;let r=t?this.persistedChildren[t]:null;r&&(e&&r!==e||delete this.persistedChildren[t])}setupProps(t){if(this.declareProps(),!(!t||typeof t!="object"))for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this[e]=t[e],e==="data"&&(this._externalData=!0))}getChildScope(){return this}getParentContext(){return this.parent?this.parent.getContext():null}setupContext(){if(this._contextResumed)return;let t=this.getParentContext(),e=this.setContext(t);if(e){this.context=e;return}this.context=t,this.setupAddingContext()}setupAddingContext(){let t=this.context,e=this.addContext(t);if(!e)return;let r=e[0];r&&(this.addingContext=!0,this.contextBranchName=r,this.addContextBranch(r,e[1]))}addContextBranch(t,e){this.context??={},this.context[t]=e}setContext(t){return null}addContext(t){return null}removeContext(){this.addingContext&&this.removeContextBranch(this.contextBranchName)}removeContextBranch(t){t&&delete this.context[t]}getContext(){return this.context}onCreated(){}render(){return{}}_cacheRoot(t){return t&&(t.id||(t.id=this.getId()),t.cache="panel",t)}_createLayout(){return this.render()}prepareLayout(){let t=this._createLayout();return this._cacheRoot(t)}afterBuild(){f.add(this.panel,"components",{component:this}),this.rendered=!0,this.afterLayout(),typeof this.afterMount=="function"&&v.add(this)}afterLayout(){this.afterSetup()}if(t,e){return t?e||t:null}map(t,e){let r=[];if(!t||t.length<1)return r;for(let s=0,o=t.length;s<o;s++){let i=e(t[s],s);r.push(i)}return r}removeAll(t){return q.removeAll(t)}getId(t){let e=this.id;return typeof t=="string"&&(e+="-"+t),e}cacheEle(t,e){e&&(this[e]=t,this.cached.push(e))}initialize(){this.setupContext(),this.beforeSetup()}beforeSetup(){}afterSetup(){}setup(t){this.setContainer(t),this.initialize()}setContainer(t){this.container=t}_remove(){this.prepareDestroy();let t=this.panel;t&&q.removeElement(t),this.cleanUpAfterDestroy()}cleanUpAfterDestroy(){this.panel=null,this.container=null;let t=this.cached;for(let e=0,r=t.length;e<r;e++)this[t[e]]=null;this.cached=[],this.persist!==!0&&(this.persistedChildren={},this.persistToken=null)}prepareDestroy(){this.persistedCount=0,this.rendered=!1;try{this.beforeDestroy()}catch(t){console.error("Error in beforeDestroy:",t)}this.removeContext(),this.data&&this.persist!==!0&&typeof this.data.unlink=="function"&&this.data.unlink()}beforeDestroy(){}destroy(){this._remove()}};var M=class{static resume(t,e){if(t._externalData){this._resumeExternal(t,e);return}this._resumeOwned(t,e)}static _releaseLinks(t,e){!t||t===e||typeof t.unlink!="function"||t.unlink()}static refresh(t){let e=t.setData();e&&t.data&&t.data.set(e.stage),this.refreshContext(t)}static refreshContext(t){let e=t.context;if(!e||!e.data)return;let r=t.getParentContext();if(!r||!r.data)return;let s=r.data.stage,o=e.data.stage,i=null;for(let a in s){if(!Object.prototype.hasOwnProperty.call(s,a))continue;let l=s[a];l!==o[a]&&(i===null&&(i={}),i[a]=l)}i!==null&&(typeof e.data._silentSet=="function"?e.data._silentSet(i):e.data.set(i))}static _resumeExternal(t,e){let r=t.setData();if(!r){t.data=e;return}if(this._releaseLinks(e,r),e&&e.stage){let s=e._retainState||r._retainState,o=!s&&(e._refreshState||r._refreshState),i=this._buildExternalUpdates(e.stage,r.stage,s,o);W.isEmpty(i)||r._silentSet(i)}typeof r.flushPending=="function"&&r.flushPending(),t.data=r}static _buildExternalUpdates(t,e,r,s){let o={};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;if(s){Object.prototype.hasOwnProperty.call(e,i)||(o[i]=t[i]);continue}let a=t[i];!r&&a==null||a!==e[i]&&(o[i]=a)}return o}static _resumeOwned(t,e){let r=t.data;if(!r){this._releaseLinks(e),t.data=e;return}if(e&&e._retainState){this._releaseLinks(r,e),this._releaseLinks(e),t.data=e;return}if(this._releaseLinks(e,r),e&&e.stage){let s=e._refreshState||t.data._refreshState,o=this._buildOwnedUpdates(e.stage,t.data.stage,s);W.isEmpty(o)||t.data._silentSet(o)}t.data&&typeof t.data.flushPending=="function"&&t.data.flushPending()}static _buildOwnedUpdates(t,e,r){let s={};for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;if(r){Object.prototype.hasOwnProperty.call(e,o)||(s[o]=t[o]);continue}let i=t[o];i!=null&&i!==e[o]&&(s[o]=i)}return s}};var j=class{constructor(){this.events=[]}addEvents(t){let e=t.length;if(!(e<1))for(let r=0;r<e;r++){let s=t[r];this.on(s[0],s[1],s[2],s[3])}}on(t,e,r,s){p.on(t,e,r,s),this.events.push({event:t,obj:e,callBack:r,capture:s})}off(t,e,r,s){p.off(t,e,r,s);let o,i=this.events;for(let a=0,l=i.length;a<l;a++)if(o=i[a],o.event===t&&o.obj===e&&o.callBack===r&&o.capture===s){i.splice(a,1);break}}set(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let s=t[e];p.on(s.event,s.obj,s.callBack,s.capture)}}unset(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let s=t[e];p.off(s.event,s.obj,s.callBack,s.capture)}}reset(){this.unset(),this.events=[]}};var V=class{constructor(t,e){this.remoteStates=[],this.callBackStates=[];let r=this.convertStates(e);this.addStatesToTarget(t,r)}addStates(t,e){let r=this.convertStates(e);this.addStatesToTarget(t,r)}createState(t,e,r,s){return{action:t,state:e,callBack:r,targetId:s,token:null,callBackToken:null}}convertStates(t){let e=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(r==="remotes"){this.setupRemoteStates(t[r],e);continue}let s=null,o=null,i=t[r];i&&typeof i=="object"&&(o=i.callBack,s=i.id||i.targetId,i=i.state),e.push(this.createState(r,i,o,s))}return e}setupRemoteStates(t,e){for(let r=0,s=t.length;r<s;r++){let o=t[r];if(o)for(let i in o){if(!Object.prototype.hasOwnProperty.call(o,i)||i==="id")continue;let a=null,l=o[i],c=l!==null?l:void 0;c&&typeof c=="object"&&(a=c.callBack,c=c.state),e.push(this.createState(i,c,a,o.id))}}}removeRemoteStates(t){let e=this.remoteStates;e&&this.removeActions(t,e)}removeLocalStates(t){let e=this.callBackStates;if(e)for(let r=0,s=e.length;r<s;r++){let o=e[r];o.callBackToken&&(t.off(o.action,o.callBackToken),o.callBackToken=null)}}removeActions(t,e){if(!(e.length<1))for(let r=0,s=e.length;r<s;r++){let o=e[r];o.token&&this.unbindRemoteState(t,o.token),o.targetId&&A.remove(o.targetId,o.action,o.token)}}restore(t){A.restore(t.id,t);let e=this.callBackStates;if(e)for(let s=0,o=e.length;s<o;s++){let i=e[s];i.callBackToken=t.on(i.action,i.callBack)}let r=this.remoteStates;if(r)for(let s=0,o=r.length;s<o;s++){let i=r[s];i.token=this.bindRemoteState(t,i.action,i.targetId)}}bindRemoteState(t,e,r){let s=A.getTarget(r);return t.link(s,e)}unbindRemoteState(t,e){t.unlink(e)}addStatesToTarget(t,e){let r=this.remoteStates;for(let s=0,o=e.length;s<o;s++){let i=e[s],a=this.addAction(t,i);i.targetId&&(i.token=a,r.push(i))}}addAction(t,e){let r,s=e.action,o=e.targetId;o&&(r=this.bindRemoteState(t,s,o)),typeof e.state<"u"&&t.addAction(s,e.state);let i=e.callBack;return typeof i=="function"&&(e.callBackToken=t.on(s,i),this.callBackStates.push(e)),r||null}};var x=class extends Q{constructor(t,e,r){super(t,e,r),this.isComponent=!0,this.stateResumed=!1,this.stateTargetId=null,this._externalData=this._externalData??!1,this._setupData()}setData(){return null}_setupData(){if(this.data)return;let t=this.setData();t&&(this.data=t)}resumeScope(t){if(this._resumeData(t.data),this.state=t.state,this.stateHelper=t.stateHelper,this.persistedChildren=t.persistedChildren,t.context){let e=t.context.data;e&&e._refreshState===!0&&e._retainState!==!0||(this.context=t.context,this._contextResumed=!0)}this.id=t.id,this._refreshContextData()}_resumeData(t){M.resume(this,t)}_refreshData(){M.refresh(this)}_refreshContextData(){M.refreshContext(this)}initialize(){this.setupContext(),this.addStates(),this.beforeSetup()}afterLayout(){this.addEvents(),this.afterSetup()}setupStateTarget(t){let e=t||this.stateTargetId||this.id;this.state=A.attach(String(e))}setupStates(){return{}}addStates(){let t=this.state;if(t){this.stateResumed=!0,this.stateHelper?.restore(t);return}let e=this.setupStates();W.isEmpty(e)||this.setStateHelper(e)}setStateHelper(t={}){this.state||(this.setupStateTarget(),this.stateHelper=new V(this.state??{},t))}addState(t){!this.stateHelper||this.stateResumed===!0||this.stateHelper.addStates(this.state,t)}removeStates(){let t=this.state;if(!t)return;let e=this.stateHelper;e&&(e.removeRemoteStates(t),e.removeLocalStates(t)),A.detach(String(t.id)),this.stateResumed=!1}onFlush(t){let e=this.data??this?.context?.data??null;e&&e.onFlush(t)}setEventHelper(){this.events||(this.events=new j)}setupEvents(){return[]}addEvents(){let t=this.setupEvents();t.length<1||(this.setEventHelper(),this.events&&this.events.addEvents(t))}removeEvents(){let t=this.events;t&&t.reset()}prepareDestroy(){this.persistedCount=0,this.rendered=!1;try{this.beforeDestroy()}catch(t){console.error("Error in beforeDestroy:",t)}this.removeEvents(),this.removeStates(),this.removeContext(),this.data&&this.persist!==!0&&typeof this.data.unlink=="function"&&this.data.unlink()}};var Dt={created:"onCreated",setStates:"setupStates",state:"setupStates",events:"setupEvents",before:"beforeSetup",render:"render",after:"afterSetup",mounted:"afterMount",destroy:"beforeDestroy"},Ot=(n,t)=>typeof n!="function"&&t==="setupStates"?()=>n:n;var ft=(n,t)=>{if(!n)return t;let e=Object.keys(n);for(let r=0,s=e.length;r<s;r++){let o=e[r],i=n[o],a=Dt[o]||o;t[a]=Ot(i,a)}return t},Ke=n=>ft(n,{}),ze=0,Bt=(n,t)=>{class e extends n{}return Object.assign(e.prototype,t),e.prototype._classId="jot"+ze++,e},_=(n,t=x)=>{n||(n={});let e,r=typeof n;return r==="object"&&n.render?(e=Ke(n),Bt(t,e)):(e={render:r==="function"?n:()=>n},Bt(t,e))};var pt=(n,t)=>({attr:n,directive:t});var k=(n,t)=>({key:n,value:t});var Ht=(n,t,e,r)=>({tag:n,attr:t,directives:e,children:r});var Ut=null,Qe=()=>Ut||(Ut=F.get("watch")),w=class{static getTag(t){return t.tag||"div"}static setupChildren(t){t.nest&&(t.children=t.nest,delete t.nest)}static setElementContent(t,e,r,s){return t==="text"?(s.push({tag:"text",textContent:e}),!0):t==="html"||t==="innerHTML"?(r.push(k("innerHTML",e)),!0):!1}static setTextAsWatcher(t,e,r){t.push(pt(k(e,L.getWatcherSettings(r,It(e))),Qe()))}static setButtonType(t,e,r){if(t==="button"){let s=e.type||"button";r.push(k("type",s))}}static parse(t,e){let r=[],s=[],o=t.tag||"div";o==="button"&&r.push(k("type",t.type||"button"));let i=[],a,l;for(let c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||c==="tag"||(a=t[c],a==null))continue;if(c==="children"||c==="nest"){if(Array.isArray(a))for(let u=0;u<a.length;u++)i.push(a[u]);else i.push(a);continue}if((l=F.get(c))!==null){s.push(pt(k(c,a),l));continue}let h=typeof a;if(h==="object"){if(L.isWatching(a)){this.setTextAsWatcher(s,c,a);continue}i.push(a);continue}if(h==="function"){let u=a,m=function(y){u.call(this,y,e)};m.originalCallback=u,r.push(k(c,m));continue}if(h==="string"&&a.includes("[[")){this.setTextAsWatcher(s,c,a);continue}if(c==="text"){i.push({tag:"text",textContent:a});continue}if(c==="html"||c==="innerHTML"){r.push(k("innerHTML",a));continue}r.push(k(c,a))}return Ht(o,r,s,i)}};var D=class{build(t,e,r){}setupComponent(t,e,r){let s=r?.getChildScope();t.parent=s,s&&s.persist===!0&&t.persist!==!1&&(t.persist=!0,t.parent.addPersistedChild(t)),t.cache&&s&&(s[t.cache]=t),t.setup(e)}buildComponent(t){let e=t.prepareLayout(),r=this.build(e,t.container,t);return t.afterBuild(),t.component&&typeof t.onCreated=="function"&&t.onCreated(t),r}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t),t}setDirectives(t,e,r){}removeNode(t){}removeAll(t){}};var je=n=>{for(let e in n)if(e!=="tag"&&e!=="textContent")return!1;let t=n.textContent;return typeof t=="string"?t.indexOf("[[")===-1:typeof t!="object"},Y=class extends D{build(t,e,r){let s=S.createDocFragment();if(Array.isArray(t))for(let o=0,i=t.length;o<i;o++)this.buildElement(t[o],s,r);else this.buildElement(t,s,r);return e&&typeof e=="object"&&e.appendChild(s),s}buildElement(t,e,r){if(t){if(t.isUnit===!0){this.createComponent(t,e,r);return}this.createElement(t,e,r)}}createElement(t,e,r){if(t.tag==="text"&&je(t)){let c=t.textContent;S.createText(c??"",e);return}let s=r?.getChildScope();if(t.data||t.state){this.createTempComponent(t,e,s);return}let o=w.parse(t,s),i=this.createNode(o,e,s);this.cache(i,t.cache,r);let a=o.children;for(let c=0,h=a.length;c<h;c++){let u=a[c];u!==null&&this.buildElement(u,i,r)}let l=o.directives;l.length&&this.setDirectives(i,l,s)}createTempComponent(t,e,r){let s={cache:t.cache,key:t.key,persist:t.persist,_externalData:!0,setData:()=>t.data,...ft(t.methods||{},{}),render(){return{...t,data:null,state:null,methods:null,key:null,persist:null}}};t.state&&(s.setupStateTarget=function(i){this.state=t.state});let o=new x(s);this.createComponent(o,e,r)}setDirectives(t,e,r){for(let s=0,o=e.length;s<o;s++)this.handleDirective(t,e[s],r)}handleDirective(t,e,r){e.directive(t,e.attr.value,r)}cache(t,e,r){r&&e&&r.cacheEle(t,e)}createNode(t,e,r){let s=t.tag;if(s==="text"){let o=t.attr[0],i=o?o.value:"";return S.createText(i,e)}else if(s==="comment"){let o=t.attr[0],i=o?o.value:"";return S.createComment(i,e)}return S.create(s,t.attr,e,r)}removeNode(t){S.removeElement(t)}removeAll(t){S.removeAll(t)}};var Ve=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source"]),Ye=/[&<>"]/,mt=n=>{let t=typeof n=="string"?n:String(n);return Ye.test(t)?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):t},O=class{static create(t,e=[],r=""){let s="",o="";for(let i=0,a=e.length;i<a;i++){let l=e[i],c=l.key,h=l.value;if(c==="text"||c==="textContent"){s+=mt(h);continue}if(c==="html"||c==="innerHTML"){s+=h;continue}if(typeof h=="function")continue;let u=c+'="'+mt(h)+'"';o?o+=" "+u:o=u}return Ve.has(t)?"<"+t+" "+o+" />":"<"+t+" "+o+">"+s+r+"</"+t+">"}static createText(t){return mt(t)}static createComment(t){return"<!-- "+t+" -->"}};var $=class extends D{build(t,e,r){if(Array.isArray(t)){let s="";for(let o=0,i=t.length;o<i;o++)s+=this.buildElement(t[o],r);return s}return this.buildElement(t,r)}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t)}buildElement(t,e){return t?t.isUnit===!0?this.createComponent(t,{},e):this.createElement(t,e):""}createElement(t,e){let r=w.parse(t,e),s=r.children,o="";for(let i=0,a=s.length;i<a;i++){let l=s[i];l!==null&&(o+=this.buildElement(l,e))}return this.createNode(r,o)}createNode(t,e){let r=t.tag;if(r==="text"){let s=t.attr[0],o=s?s.value:"";return O.createText(o)}else if(r==="comment"){let s=t.attr[0],o=s?s.value:"";return O.createComment(o)}return O.create(r,t.attr,e)}removeAll(t){}};var J=class{static browserIsSupported(){return typeof window<"u"&&typeof document=="object"}static setup(){return this.browserIsSupported()?new Y:new $}};var b=J.setup(),$e=n=>typeof n=="object"&&n.isUnit===!0,Nt=new WeakMap,Je=n=>{let t=Nt.get(n);if(!t){if(t=_(n),!t)return null;Nt.set(n,t)}return new t},d=class{static render(t,e,r){if(!t||($e(t)||(t=Je(t)),!t))return null;v.enter();try{return b.createComponent(t,e,r)}finally{v.leave()}}static build(t,e,r){v.enter();try{return b.build(t,e,r)}finally{v.leave()}}static rebuild(t,e,r){return b.removeAll(e),this.build(t,e,r)}static setDirectives(t,e,r){b.setDirectives(t,e,r)}static createNode(t,e,r){return b.createNode(t,e,r)}static removeNode(t){b.removeNode(t)}static removeAll(t){b.removeAll(t)}};At.augment({buildLayout(n,t,e){d.build(n,t,e)}});var gt=[],Xe=n=>gt.indexOf(n)!==-1,Ze=n=>({tag:"script",src:n.src,async:!1,load(t){gt.push(n.src);let e=n.load;e&&e()}}),tr=n=>({tag:"link",rel:"stylesheet",type:"text/css",href:n.src,load(t){gt.push(n.src);let e=n.load;e&&e()}}),X=class{constructor(t){this.percent=0,this.loaded=0,this.total=0,this.callBack=t||null}add(t){this.total++;let e,r=this.update.bind(this);t.indexOf(".css")!==-1?e=tr({load:r,src:t}):e=Ze({load:r,src:t}),d.build(e,document.head)}addFiles(t){t&&t.forEach(e=>{Xe(e)||this.add(e)})}update(){if(this.updateProgress()<100)return;let e=this.callBack;e&&e()}updateProgress(){return++this.loaded,this.percent=Math.floor(this.loaded/this.total*100)}};var er=n=>n?typeof n?.prototype?.constructor=="function":!1,C=class{static process(t,e){let r=t.default;return r?e.callback?e.callback(r):(er(r)?r=new r:r=r(),r.isUnit===!0&&(r.route=e.route,e.persist&&(r.persist=!0)),r):null}static render(t,e,r){return this.renderNodes(t,e,r)[0]||null}static renderNodes(t,e,r){let s=d.build(t,null,r),o=Array.from(s.childNodes);return o.length===0&&t?.panel&&o.push(t.panel),e.after(s),o}};var Z=class{static load(t,e,r){return t.then(s=>(e&&e(s),s)).catch(s=>{console.error("Error loading module:",s),r&&r(s)})}};var rr=n=>({tag:"comment",textContent:"import placeholder",onCreated:n.onCreated}),T=new E(100),Wt=n=>{if(T.has(n)){let r=T.get(n);return r&&typeof r.then!="function"?Promise.resolve(r):r}let t=typeof n,e;if(t==="string")e=import(n);else if(t==="function")e=n();else return n;return e.then(r=>{T.set(n,r)}).catch(()=>{T.delete(n)}),T.set(n,e),e},qt=n=>{if(!T.has(n))return null;let t=T.get(n);return t&&typeof t.then=="function"?null:t||null},Ft=n=>{let t=typeof n;if(t!=="string"&&t!=="function")return null;if(qt(n))return Promise.resolve(T.get(n));let e;try{e=Wt(n)}catch{return null}return e.catch(()=>null)},yt=n=>{for(let t=0,e=n.length;t<e;t++){let r=n[t];r&&d.removeNode(r)}},Gt=_({declareProps(){this.loaded=!1,this.errorRoot=null,this.loadingRoots=null,this.generation=0},render(){return rr({onCreated:n=>{if(this.src){if(this.layout){this.setLayoutRoots(C.renderNodes(this.layout,this.panel,this.parent));return}if(this.depends){this.renderLoading(n),new X(()=>{this.loadAndRender(n)}).addFiles(this.depends);return}this.loadAndRender(n)}}})},loadAndRender(n){let t=this.generation,e=qt(this.src);if(e){this.renderModule(n,e);return}this.renderLoading(n),Z.load(Wt(this.src),r=>{t===this.generation&&this.renderModule(n,r)},r=>{t===this.generation&&(this.loaded=!1,this.removeLoadingLayout(),this.renderError(n,r))})},renderLoading(n){let t=this.loading;if(!t||this.loadingRoots)return;let e=typeof t=="function"?t():t;e&&(this.loadingRoots=C.renderNodes(e,n,this.parent))},removeLoadingLayout(){let n=this.loadingRoots;return n?(this.loadingRoots=null,yt(n),!0):!1},renderError(n,t){let e=()=>this.retry(n),r=this.fallback,s=typeof r=="function"?r(t,e):r||{class:"base-import-error",children:[{tag:"span",text:"Failed to load content."},{tag:"button",type:"button",text:"Retry",click:e}]};if(!s)return;let o=C.renderNodes(s,n,this.parent);this.errorRoots=o,this.errorRoot=o[0]||null},setLayoutRoots(n){this.layoutRoots=n,this.layoutRoot=n[0]||null},retry(n){this.removeErrorLayout(),this.loadAndRender(n)},removeErrorLayout(){this.errorRoot&&(yt(this.errorRoots||[this.errorRoot]),this.errorRoot=null,this.errorRoots=null)},renderModule(n,t){this.loaded=!0;let e=this.layout||C.process(t,{callback:this.callback,route:this.route,persist:this.persist});this.layout=e,this.setLayoutRoots(C.renderNodes(e,n,this.parent)),this.removeLoadingLayout()&&typeof this.onReplaceLoading=="function"&&this.onReplaceLoading(this.layoutRoots,e),typeof this.onModuleRender=="function"&&this.onModuleRender(e)},shouldUpdate(n){return this.updateLayout===!0?!0:this.updateLayout=n&&n.isUnit&&typeof n.update=="function"},updateModuleLayout(n){let t=this.layout;this.shouldUpdate(t)&&t&&t.update(n)},update(n){this.loaded===!0&&this.updateModuleLayout(n)},destroy(){this.generation++,this.removeErrorLayout(),this.removeLoadingLayout(),this.layoutRoot&&(yt(this.layoutRoots||[this.layoutRoot]),this.persist!==!0&&(this.layoutRoot=null,this.layoutRoots=null,this.layout=null,this.loaded=!1,this.updateLayout=!1))}});var Kt=n=>{let t=typeof n;return(t==="string"||t==="function"||n instanceof Promise)&&(n={src:n}),new Gt(n)};var nr=0,B=class{constructor(t){this.router=t,this.locationId="base-app-router-"+nr++,this.callBack=this.check.bind(this)}setup(){return this.addEvent(),this}check(t){}getScrollPosition(){return{x:window.scrollX,y:window.scrollY}}scrollTo(t){window.scrollTo(t.x,t.y)}addEvent(){return this}};var sr=0,or=()=>Date.now().toString(36)+"-"+(sr++).toString(36)+"-"+Math.random().toString(36).substring(2,8),Qt=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent||"")&&!window.MSStream,zt=()=>{Qt&&requestAnimationFrame(()=>requestAnimationFrame(()=>{let n=window.scrollX,t=window.scrollY;window.scrollTo(0,t+1),document.documentElement.offsetHeight,window.scrollTo(n,t)}))},tt=class extends B{constructor(t){super(t),this.currentKey=null,this.positions=new E(200)}saveCurrentPosition(){let t=this.getScrollPosition(),e=this.currentKey;return e&&this.positions.set(e,t),t}addEvent(){p.on("popstate",window,this.callBack);let t=window.history;return t&&"scrollRestoration"in t&&(this.previousScrollRestoration=t.scrollRestoration,t.scrollRestoration="manual"),Qt&&(this.pageShowCallBack=this.onPageShow.bind(this),p.on("pageshow",window,this.pageShowCallBack)),this}removeEvent(){p.off("popstate",window,this.callBack);let t=window.history;return this.previousScrollRestoration&&t&&"scrollRestoration"in t&&(t.scrollRestoration=this.previousScrollRestoration,this.previousScrollRestoration=null),this.pageShowCallBack&&p.off("pageshow",window,this.pageShowCallBack),this}onPageShow(t){t.persisted&&zt()}check(t){let e=t.state;if(!e||e.location!==this.locationId)return!1;t.preventDefault(),t.stopPropagation(),this.saveCurrentPosition();let r=e.key||null;this.currentKey=r;let s=r&&this.positions.get(r)||e.scrollPosition,o=this.router;o.checkActiveRoutes(e.uri,!!s),s&&(typeof o.restoreScrollPosition=="function"?o.restoreScrollPosition(s):this.scrollTo(s)),zt()}createState(t,e={}){let r=this.getScrollPosition();return e=e===null?{}:e,{location:this.locationId,...e,key:or(),scrollPosition:r,uri:t}}addState(t,e,r=!1){let s=window.history,o=s.state;if(o&&o.uri===t)return o.key&&o.location===this.locationId&&(this.currentKey=o.key),this;!r&&o&&o.location===this.locationId&&(o.scrollPosition=this.saveCurrentPosition(),s.replaceState(o,"",window.location.href));let i=this.createState(t,e);return r||(i.scrollPosition={x:0,y:0}),s[r===!1?"pushState":"replaceState"](i,null,t),this.currentKey=i.key,this.positions.set(i.key,i.scrollPosition),this}};var et={removeSlashes(n){return typeof n!="string"?"":(n[0]==="/"&&(n=n.substring(1)),n[n.length-1]==="/"&&(n=n.substring(0,n.length-1)),n)},getHashUri(n){if(typeof n!="string")return"";let t=n.indexOf("#");return t===-1?"":n.substring(t+1)}};var rt=class extends B{addEvent(){return p.on("hashchange",window,this.callBack),this}removeEvent(){return p.off("hashchange",window,this.callBack),this}check(t){this.router.checkActiveRoutes(et.getHashUri(t.newURL))}addState(t,e,r){return window.location.hash=t,this}};var nt=class{static browserIsSupported(){return typeof window=="object"&&"history"in window&&"pushState"in window.history}static setup(t){return this.browserIsSupported()?new tt(t).setup():new rt(t).setup()}};var St=5,ir=200,st=class{constructor(t){this.owner=t||null,this.pages=new Set,this.scrollMemory=new E(ir),this.historyNavigation=!1}isEnabled(){let t=this.owner;return t!==null&&t.keepAlive===!0}getMode(){let t=this.owner;return t!==null&&t.keepAliveMode==="hide"?"hide":"detach"}getMax(){let t=this.owner,e=t?t.keepAliveMax:void 0;return typeof e=="number"&&e>=0?e:St}get size(){return this.pages.size}add(t){let e=this.pages;e.delete(t),e.add(t),this.trim()}delete(t){this.pages.delete(t)}trim(){let t=this.pages,e=this.getMax();for(;t.size>e;){let r=t.values().next().value;t.delete(r),r.evict()}}clear(){let t=Array.from(this.pages);this.pages.clear();for(let e=0,r=t.length;e<r;e++)t[e].evict()}saveScroll(t,e){if(e){this.scrollMemory.set(t,e);return}this.scrollMemory.has(t)&&this.scrollMemory.delete(t)}getScroll(t){return this.scrollMemory.get(t)||null}};var vt=class extends x{getChildScope(){return this.parent}},jt=n=>_(n,vt);var xt="data-scroll-key",ar="["+xt+"]",lr="[data-route-dormant]",Vt=n=>typeof n.closest=="function"&&n.closest(lr)!==null,Yt=(n,t)=>{for(let e=0,r=n.length;e<r;e++){let s=n[e];if(!s||s.nodeType!==1||Vt(s))continue;let o=s.getAttribute(xt);o!==null&&t(s,o);let i=s.querySelectorAll(ar);for(let a=0,l=i.length;a<l;a++){let c=i[a];Vt(c)||t(c,c.getAttribute(xt))}}},kt=n=>{let t=null;return Yt(n,(e,r)=>{let s=e.scrollTop||0,o=e.scrollLeft||0;s===0&&o===0||(t=t||{},t[r]=[s,o])}),t},ot=(n,t)=>{if(!t)return!0;let e={},r=0;for(let s in t)e[s]=!0,r++;return Yt(n,(s,o)=>{let i=t[o];if(!i)return;let a=i[0],l=i[1];s.scrollTop=a,s.scrollLeft=l,Math.abs((s.scrollTop||0)-a)<1&&Math.abs((s.scrollLeft||0)-l)<1&&e[o]&&(e[o]=!1,r--)}),r<=0};var cr=n=>{for(let t=0;t<n.length;t++){let e=n[t],r=e&&e.nodeType===8?e._prevNodes:null;if(!Array.isArray(r)||r.length===0)continue;let s=[];for(let o=0,i=r.length;o<i;o++){let a=r[o];a&&n.indexOf(a)===-1&&s.indexOf(a)===-1&&s.push(a)}n.splice(t+1,0,...s)}},G="data-route-dormant",it=[["content-visibility","hidden"],["position","absolute"],["top","0"],["left","0"],["width","100%"]],hr=n=>{let t=n.style,e=[];for(let r=0,s=it.length;r<s;r++){let[o,i]=it[r];e.push([o,t.getPropertyValue(o),t.getPropertyPriority(o)]),t.setProperty(o,i,"important")}return e.push(["aria-hidden",n.getAttribute("aria-hidden")]),n.setAttribute("aria-hidden","true"),n.setAttribute(G,""),n.inert=!0,e},ur=(n,t)=>{let e=n.style,r=t||[];for(let o=0,i=it.length;o<i;o++){let a=it[o][0],l=r.find(c=>c[0]===a);l&&l[1]?e.setProperty(a,l[1],l[2]||""):e.removeProperty(a)}let s=r.find(o=>o[0]==="aria-hidden");s&&s[1]!==null?n.setAttribute("aria-hidden",s[1]):n.removeAttribute("aria-hidden"),n.removeAttribute(G),n.inert=!1},dr=n=>/^class[\s{]/.test(Function.prototype.toString.call(n)),fr=1500,$t=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),pr=n=>{let t=n.panel,e=0;for(;t&&t.isUnit===!0&&e++<50;)t=t.panel;return t||null},wt=(n,t,e)=>{if(!(!n||typeof n[t]!="function"))try{n[t](...e)}catch(r){console.error("Error in "+t+":",r)}},at=class{constructor(t,e){this.route=t,this.template=e.component,this.component=null,this.hasTemplate=!1,this.setup=!1,this.container=e.container,this.persist=e.persist,this.parent=e.parent,this.keepAlive=typeof e.keepAlive=="boolean"?e.keepAlive:null,this.keepAliveMode=e.keepAliveMode==="hide"||e.keepAliveMode==="detach"?e.keepAliveMode:null,this.hiddenInPlace=!1,this.hiddenStyles=null,this.capturedScroll=null,this.pageCache=e.pageCache||null,this.detachedNodes=null,this.detachedParents=null,this.detachedPath=null,this.savedScroll=null,this.params=null,this.scrollToken=0}isKeepAlive(t){if(this.keepAlive!==null)return this.keepAlive;if(t=t||this.component,t){if(typeof t.keepAlive=="boolean")return t.keepAlive;let r=t.layout;if(r&&r.isUnit===!0&&typeof r.keepAlive=="boolean")return r.keepAlive}let e=this.pageCache;return e!==null&&e.isEnabled()}getKeepAliveMode(t){if(this.keepAliveMode!==null)return this.keepAliveMode;if(t=t||this.component,t){let r=t.keepAliveMode;if(r==="hide"||r==="detach")return r;let s=t.layout;if(s&&s.isUnit===!0&&(s.keepAliveMode==="hide"||s.keepAliveMode==="detach"))return s.keepAliveMode}let e=this.pageCache;return e!==null&&typeof e.getMode=="function"?e.getMode():"detach"}isDetached(){return this.detachedNodes!==null}captureScroll(){let t=this.component;if(this.setup!==!0||!t||t.rendered!==!0){this.capturedScroll=null;return}this.capturedScroll={value:kt(this.getRootNodes(t))}}releaseCapturedScroll(){this.capturedScroll=null}takeScroll(t){let e=this.capturedScroll;return this.capturedScroll=null,e?e.value:kt(this.getRootNodes(t))}focus(t){if(this.params=t,this.setup===!1){if(this.detachedNodes!==null&&this.detachedPath!==this.getPagePath()&&this.evict(),this.detachedNodes!==null&&this.reattach()){this.update(t),this.restoreDetachedScroll(),this.callPageHook("onActivate",[t,{restored:!0}]);return}this.route&&typeof this.route.flushPending=="function"&&this.route.flushPending(),this.create(),this.update(t),this.afterCreate(t);return}this.update(t)}setupTemplate(){let e=typeof this.template;e==="function"?this.initializeComponent():e==="object"&&this.initializeTemplateObject(),this.hasTemplate=!0}initializeComponent(){let t=this.template;this.template=dr(t)?new t:t(),this.initializeTemplateObject()}transferSettings(t){this.persist=this.persist&&t.persist!==!1,Object.assign(t,{route:this.route,persist:this.persist}),this.component=t}initializeTemplateObject(){let t=this.template;if(!t)return;t.isUnit||(this.template=new(jt(t)));let e=this.template;this.transferSettings(e)}create(){if(this.setupTemplate(),!this.hasTemplate)return;this.setup=!0;let t=this.component;d.render(t,this.container,this.parent)}afterCreate(t){let e=this.component;!e||this.pageCache===null||(e.loaded===!1&&e.src&&(e.onModuleRender=()=>this.onModuleRender(e)),this.isKeepAlive(e)&&this.callPageHook("onActivate",[t,{restored:!1}]),this.pageCache.historyNavigation===!0&&this.restoreHistoryScroll())}onModuleRender(t){if(this.setup!==!0||this.component!==t)return;let e=t.layout;e&&e.isUnit===!0&&this.isKeepAlive(t)&&wt(e,"onActivate",[this.params,{restored:!1}])}getScrollKey(){let t=this.route||{};return(t.routeId||"")+"|"+(t.path||"")}getPagePath(){let e=(this.route||{}).path||"",r=e.indexOf("#");return r>-1?e.substring(0,r):e}getRootNodes(t){let e=[],r=pr(t);r&&e.push(r);let s=t.layoutRoots||(t.layoutRoot?[t.layoutRoot]:null),o=t.errorRoots||(t.errorRoot?[t.errorRoot]:null),i=t.loadingRoots||null,a=[s,o,i];for(let l=0;l<3;l++){let c=a[l];if(c)for(let h=0,u=c.length;h<u;h++){let m=c[h];m&&e.indexOf(m)===-1&&e.push(m)}}return cr(e),e}callPageHook(t,e){let r=this.component;if(!r)return;wt(r,t,e);let s=r.layout;s&&s!==r&&s.isUnit===!0&&wt(s,t,e)}restoreHistoryScroll(){let t=this.pageCache.getScroll(this.getScrollKey());if(!t)return;let e=++this.scrollToken,r=this.component,s=()=>ot(this.getRootNodes(r),t);if(s()||typeof requestAnimationFrame>"u")return;let o=$t(),i=()=>{e!==this.scrollToken||this.setup!==!0||this.component!==r||s()||$t()-o>fr||requestAnimationFrame(i)};requestAnimationFrame(i)}restoreDetachedScroll(){let t=this.savedScroll;this.savedScroll=null;let e=this.component;if(!t||!e)return;if(typeof requestAnimationFrame>"u"){ot(this.getRootNodes(e),t);return}let r=++this.scrollToken;requestAnimationFrame(()=>{r!==this.scrollToken||this.setup!==!0||this.component!==e||ot(this.getRootNodes(e),t)})}detach(t){if(t.rendered!==!0)return!1;let e=this.getRootNodes(t);if(e.length===0)return!1;let r=this.takeScroll(t);return this.savedScroll=r,this.pageCache.saveScroll(this.getScrollKey(),r),this.getKeepAliveMode(t)==="hide"&&t.loaded!==!1?this.hideInPlace(e):this.removeNodes(e),this.detachedNodes=e,this.detachedPath=this.getPagePath(),this.callPageHook("onDeactivate",[]),this.pageCache.add(this),!0}removeNodes(t){let e=new WeakMap;for(let r=0,s=t.length;r<s;r++){let o=t[r],i=o.parentNode;i&&(e.set(o,i),i.removeChild(o))}this.detachedParents=e,this.hiddenInPlace=!1,this.hiddenStyles=null}hideInPlace(t){let e=new WeakMap;for(let r=0,s=t.length;r<s;r++){let o=t[r];o&&o.nodeType===1&&e.set(o,hr(o))}this.detachedParents=null,this.hiddenInPlace=!0,this.hiddenStyles=e}showInPlace(t,e){let r=this.hiddenStyles;for(let s=0,o=t.length;s<o;s++){let i=t[s];i.nodeType===1&&i.hasAttribute(G)&&ur(i,r?r.get(i):void 0),i.isConnected||e.appendChild(i)}}reattach(){let t=this.pageCache;t&&t.delete(this),this.detachedNodes=null;let e=this.detachedParents;this.detachedParents=null;let r=this.hiddenInPlace;this.hiddenInPlace=!1;let s=this.component,o=this.container;if(!s||s.rendered!==!0||!o||typeof o.appendChild!="function")return this.savedScroll=null,this.hiddenStyles=null,this.releaseComponent(),!1;if(r)return this.showInPlace(this.getRootNodes(s),o),this.hiddenStyles=null,this.setup=!0,v.schedule(),!0;let i=this.getRootNodes(s);for(let a=0,l=i.length;a<l;a++){let c=i[a],h=e?e.get(c):null;(h&&h.isConnected?h:o).appendChild(c)}return this.setup=!0,v.schedule(),!0}evict(){if(this.detachedNodes===null)return;let t=this.pageCache;t&&t.delete(this),this.detachedNodes=null,this.detachedParents=null,this.savedScroll=null,this.hiddenInPlace=!1,this.hiddenStyles=null,this.releaseComponent()}releaseComponent(){let t=this.component;this.component=null,t&&typeof t.destroy=="function"&&t.destroy()}remove(t){if(this.setup!==!0){t===!0&&this.evict();return}this.setup=!1,this.scrollToken++;let e=this.component;if(!e)return;let r=this.pageCache;if(t!==!0&&r!==null){if(this.isKeepAlive(e)&&this.detach(e))return;r.saveScroll(this.getScrollKey(),this.takeScroll(e))}this.capturedScroll=null,this.releaseComponent()}update(t){let e=this.component;e&&typeof e.update=="function"&&e.update(t)}};var Jt=n=>{if(!n.length)return null;let t={};for(let e=0,r=n.length;e<r;e++)t[n[e]]=null;return t},Xt=n=>{let t=[];if(!n)return t;let e=/[*?]/g;n=n.replace(e,"");let r=/:(.[^./?&($]+)\?*/g,s=n.match(r);if(s===null)return t;for(let o=0,i=s.length;o<i;o++){let a=s[o];a&&t.push(a.replace(":",""))}return t};var mr=/(\/):[^/(]*?\?/g,gr=/\//g,yr=/(\?\/+\*?)/g,Sr=/(:[^/?&($]+)/g,vr=/(\*)/g,xr=n=>n.replace(mr,t=>t.replace(gr,"(?:$|/)")),kr=n=>(n=n.replace(yr,"?/*"),n.replace(Sr,t=>t.indexOf(".")<0?"([^/|?]+)":"([^/|?]+.*)")),wr=n=>n.replace(vr,".*"),Cr=(n,t)=>n+=t[t.length-1]==="*"?"":"$",Zt=n=>{if(!n)return"";let t=n;return t=xr(t),t=kr(t),t=wr(t),t=Cr(t,n),t};var Tr=0,te=(n,t="")=>{let e=n||"",r=typeof t=="string"&&t?t:e,s=null,o=[],i=r.match(/#\{([^}]+)\}/);i&&i[1]&&(s=i[1].trim(),r=r.replace(i[0],""),e=e.replace(i[0],""));let a=r.indexOf("?");if(a>-1){let h=r.substring(a+1);if(h.indexOf("=")>-1){let u=h.split("&");for(let y=0,U=u.length;y<U;y++){let N=u[y];if(!N)continue;let[Ue,Ne=""]=N.split("="),Rt=(Ue||"").trim();Rt&&o.push({key:Rt,value:(Ne||"").trim()})}r=r.substring(0,a);let m=e.indexOf("?");m>-1&&(e=e.substring(0,m))}}let l=s!==null||o.length>0;return l&&!r&&(e="*"),{uriPath:e,requiredHash:s,requiredQuery:o,hasConditions:l}},ee=n=>{if(!n)return"";let t=n.indexOf("?"),e=n.indexOf("#"),r=n.length;return t>-1&&(r=t),e>-1&&e<r&&(r=e),n.substring(0,r).replace(/\/\.(?:\/|$)/g,"/")},Pr=n=>{if(!n)return"";let t=n.indexOf("#");return t===-1?"":n.substring(t+1)},Rr=n=>{if(!n)return"";let t=n.indexOf("?");if(t===-1)return"";let e=n.indexOf("#",t);return e===-1?n.substring(t+1):n.substring(t+1,e)},lt=class extends Lt{constructor(t,e,r=null){let s=t.baseUri,i=te(s,t.rawUri).uriPath,a=Xt(i),l=Jt(a),c=super(l);return this.uri=s,this.matchUri=i,this.paramKeys=a,this.titleCallBack=e,this.pageCache=r,this.setupRoute(t),this.set("active",!1),c}setup(){this.stage={},this.routeId=null,this.uri=null,this.rawUri=null,this.matchUri="",this.uriQuery=/$^/,this.controller=null,this.paramKeys=[],this.requiredHash=null,this.requiredQuery=[],this.hasConditions=!1,this.titleCallBack=()=>{},this.path=null,this.referralPath=null,this.params=null,this.callBack=null,this.title=null,this.preventScroll=!1,this.scrollTo=null,this.pageCache=null,this.importSrc=null}setupRoute(t){this.routeId=t.id||"bs-rte-"+Tr++,this.rawUri=t.rawUri||null,this.path=null,this.referralPath=null;let e=te(this.uri,this.rawUri||"");this.matchUri=e.uriPath,this.requiredHash=e.requiredHash,this.requiredQuery=e.requiredQuery,this.hasConditions=e.hasConditions;let r=Zt(this.matchUri);this.uriQuery=new RegExp("^"+r),this.params=null,this.setupComponentHelper(t),this.callBack=t.callBack,this.title=t.title,this.preventScroll=t.preventScroll||!1,this.scrollTo=t.scrollTo||null}setTitle(t){this.title=t,this.titleCallBack(this,t)}deactivate(t){this.set("active",!1);let e=this.controller;e&&e.remove(t===!0)}captureScroll(){let t=this.controller;t&&this.get("active")&&t.captureScroll()}releaseCapturedScroll(){let t=this.controller;t&&t.releaseCapturedScroll()}isDormant(){let t=this.controller;if(!t)return!1;let e=t.container;return e?e.isConnected===!1?!0:typeof e.closest=="function"&&e.closest("["+G+"]")!==null:!1}getLayout(t){if(t.component)return t.component;let e=t.import;if(!e)return null;let r=e&&typeof e=="object"&&!(e instanceof Promise)?e.src:e;return this.importSrc=typeof r=="string"||typeof r=="function"?r:null,Kt(e)}setupComponentHelper(t){let e=this.getLayout(t);if(!e)return;let{container:r,persist:s,parent:o,keepAlive:i,keepAliveMode:a}=t,l={component:e,container:r,persist:s,parent:o,keepAlive:i,keepAliveMode:a,pageCache:this.pageCache},c=Et(this);this.controller=new at(c,l)}resumeRoute(t){let e=this.controller;e&&(e.container=t)}setPath(t,e){this.path=t,this.referralPath=e}select(){this.set("active",!0);let t=this.stage,e=this.callBack;typeof e=="function"&&e(t);let r=this.controller;r&&r.focus(t);let s=this.path;if(!s)return;let o=s.split("#")[1];o&&this.scrollToId(o)}scrollToId(t){if(!t)return;let e=document.getElementById(t);e&&e.scrollIntoView(!0)}match(t){let e=!1,r=ee(t),s=this.uriQuery||/$^/,o=r.match(s);return o===null?(this.resetParams(),e):Array.isArray(o)?this.matchConditions(t)?(this.setParams(o,1),e=o,e):(this.resetParams(),!1):e}matches(t){return(this.uriQuery||/$^/).test(ee(t))&&this.matchConditions(t)}prefetch(){let t=this.importSrc;return t?Ft(t):null}matchConditions(t){if(!this.hasConditions)return!0;if(this.requiredHash!==null&&Pr(t)!==this.requiredHash)return!1;let e=this.requiredQuery||[];if(e.length>0){let r=Rr(t);if(!r)return!1;let s=new URLSearchParams(r);for(let o=0,i=e.length;o<i;o++){let a=e[o];if(!s.has(a.key)||s.get(a.key)!==a.value)return!1}}return!0}resetParams(){this.stage={}}setParams(t,e=0){if(!Array.isArray(t))return;let r=this.paramKeys;if(!r)return;let s={};for(let o=0,i=r.length;o<i;o++){let a=r[o];typeof a<"u"&&(s[a]=t[o+e])}this.set(s)}getParams(){return this.stage}};var Ar=n=>{let t=/\w\S*/;return n.replace(t,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())},br=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ir=(n,t)=>{if(n.indexOf(":")===-1)return n;let e=t.stage;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let s=new RegExp(":"+br(r),"gi");n=n.replace(s,()=>e[r])}return n},Er=(n,t)=>t&&(typeof t=="function"&&(t=t(n.stage)),t=Ir(t,n),Ar(t)),Lr=(n,t)=>(t!==""&&(n+=" - "+t),n),re=(n,t,e)=>t&&(t=Er(n,t),Lr(t,e));var Mr=()=>typeof window<"u"?window.location:{},_r=n=>{if(!n)return"";let t=n.indexOf("#");return t>-1?n.substring(t+1):""},Dr=1500,ct=["wheel","touchstart","keydown","pointerdown"],ne=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),Ct=class{constructor(){this.version="1.0.2",this.baseURI="/",this.title="",this.lastPath=null,this.path=null,this.lastMatchedRoute=null,this.lastScrollGroup=null,this.activeScrollGroups=new Set,this.scrollGroupsReady=new Set,this.currentGroupId=null,this.scrollWaitToken=0,this.cancelScrollWait=null,this.keepAlive=!1,this.keepAliveMax=St,this.keepAliveMode="detach",this.pageCache=new st(this),this.history=null,this.callBackLink=null,this.location=Mr(),this.routes=[],this.switches=new Map,this.switchCount=0,this.data=new Mt({path:""})}setupHistory(){this.history=nt.setup(this)}createRoute(t){let e=t.uri||"*";return t.rawUri=e,t.baseUri=this.createURI(e),new lt(t,this.updateTitle.bind(this),this.pageCache)}setKeepAlive(t,e){this.keepAlive=t===!0;let r=e?e.max:void 0;typeof r=="number"&&r>=0&&(this.keepAliveMax=r);let s=e?e.mode:void 0;return(s==="hide"||s==="detach")&&(this.keepAliveMode=s),this.pageCache.trim(),this}add(t){if(typeof t!="object"){let r=arguments;t={uri:r[0],component:r[1],callBack:r[2],title:r[3],id:r[4],container:r[5]}}let e=this.createRoute(t);return this.addRoute(e),e}addRoute(t){this.routes.push(t),this.checkRoute(t,this.getPath())}resume(t,e){t.resumeRoute(e),this.addRoute(t)}getBasePath(){if(!this.basePath){let t=this.baseURI||"";t[t.length-1]!=="/"&&(t+="/"),this.basePath=t}return this.basePath}createURI(t){let e=this.getBasePath(),r=et.removeSlashes(t);return r=r.replace(/^(?:\.\/)+/,""),r==="."&&(r=""),e+r}getRoute(t){let e=this.routes,r=e.length;if(r>0)for(let s=0;s<r;s++){let o=e[s];if(o.uri===t)return o}return null}getRouteById(t){let e=this.routes,r=e.length;if(r>0)for(let s=0;s<r;s++){let o=e[s];if(o.routeId===t)return o}return!1}removeRoute(t){let e=this.routes,r=e.indexOf(t);r>-1&&e.splice(r,1),this.lastMatchedRoute===t&&(this.lastMatchedRoute=null),t&&typeof t.deactivate=="function"&&t.deactivate(!0)}addSwitch(t){let e=this.switchCount++,r=this.getSwitchGroup(e);for(let s=0,o=t.length;s<o;s++){let i=t[s];if(!i)continue;let a=this.createRoute(i);r.push(a)}return this.checkGroupForRegistration(e,r),e}resumeSwitch(t,e){let r=this.switchCount++,s=this.getSwitchGroup(r);for(let o=0,i=t.length;o<i;o++){let l=t[o].component.route;l.resumeRoute(e),s.push(l)}return this.checkGroupForRegistration(r,s),r}checkGroupForRegistration(t,e){let r=this.scrollIntent,s=this.currentGroupId;this.scrollIntent=null,this.currentGroupId=t,this.checkGroup(e,this.getPath()),this.currentGroupId=s;let o=this.scrollIntent;o&&o.type==="target"&&o.groupId!==null&&o.groupId!==void 0&&(this.activeScrollGroups.add(o.groupId),this.lastScrollGroup=o.groupId),this.scrollIntent=r}getSwitchGroup(t){let e=this.switches.get(t);if(e)return e;let r=[];return this.switches.set(t,r),r}removeSwitch(t){this.activeScrollGroups.delete(t),this.lastScrollGroup===t&&(this.lastScrollGroup=null);let e=this.switches.get(t);if(this.switches.delete(t),!!e)for(let r=0,s=e.length;r<s;r++){let o=e[r];o&&typeof o.deactivate=="function"&&o.deactivate(!0)}}remove(t){t=this.createURI(t);let e=this.getRoute(t);return e&&this.removeRoute(e),this}setup(t,e){this.baseURI=t||"/",this.updateBaseTag(this.baseURI),this.title=typeof e<"u"?e:"",this.setupHistory(),this.data.path=this.getPath(),this.callBackLink=this.checkLink.bind(this),p.on("click",document,this.callBackLink);let r=this.getEndPoint();return this.navigate(r,null,!0),this}updateBaseTag(t){let e=document.getElementsByTagName("base");e.length&&(e[0].href=t)}getParentLink(t){return t.closest("a")}checkLink(t){if(t.defaultPrevented===!0||t.ctrlKey===!0||t.metaKey===!0||t.shiftKey===!0||t.altKey===!0||typeof t.button=="number"&&t.button!==0)return!0;let e=t.target&&t.target.closest?t.target.closest("a"):null;if(!e||e.dataset.cancelRoute||e.hasAttribute("download"))return!0;let r=e.getAttribute("target");if(r&&r!=="_self")return!0;let s=e.getAttribute("href");if(s===null)return!0;let o=this.getLinkPath(s);if(o===null)return!0;let i=e.dataset.replace==="true";return this.navigate(o,null,i),t.preventDefault(),t.stopPropagation(),!1}getLinkPath(t){let e=t;if(e.substring(0,2)==="//"||/^[a-z][a-z0-9+.-]*:/i.test(e)){let s=this.location;if(!s||!s.origin||typeof URL>"u")return null;let o;try{o=new URL(e,s.href)}catch{return null}if(o.origin!==s.origin)return null;e=o.pathname+o.search+o.hash}let r=this.baseURI;return r!=="/"&&e.indexOf(r)===0&&(e=e.substring(r.length)),e}reset(){let t=this.routes;for(let e=0,r=t.length;e<r;e++){let s=t[e];s&&typeof s.deactivate=="function"&&s.deactivate(!0)}return this.pageCache.clear(),this.routes=[],this.switches=new Map,this.switchCount=0,this.lastMatchedRoute=null,this}activate(){return this.checkActiveRoutes(),this}navigate(t,e,r){return t=this.createURI(t),this.history.addState(t,e,r),this.updatePath(),this.activate(),this}prefetch(t){if(typeof t!="string"||!t)return Promise.resolve([]);let e=this.getLinkPath(t);if(e===null)return Promise.resolve([]);let r=this.createURI(e),s=[],o=a=>{if(!a||!a.controller||typeof a.matches!="function"||!a.matches(r))return!1;let l=a.prefetch();return l&&s.push(l),!0},i=this.routes;for(let a=0,l=i.length;a<l;a++)o(i[a]);for(let a of this.switches.values())for(let l=0,c=a.length;l<c&&!o(a[l]);l++);return Promise.all(s)}updatePath(){let t=this.getPath();this.data.path=t}updateTitle(t){if(!t||!t.title)return this;let e=t.title;return document.title=re(t,e,this.title),this}checkActiveRoutes(t,e){t=t||this.getPath(),t!==this.path&&(this.lastPath=this.path),this.path=t,this.updatePath(),this.scrollIntent=null,this.scrollGroupsReady=new Set(this.activeScrollGroups),this.scrollWaitToken++;let r=this.pageCache;r.historyNavigation=e===!0;let s=this.captureActiveScroll(),o=this.routes;for(let i=0,a=o.length;i<a;i++){let l=o[i];typeof l>"u"||r.size>0&&l.isDormant()||this.checkRoute(l,t)}if(this.checkSwitches(t,!0),r.historyNavigation=!1,this.releaseCapturedScroll(s),e===!0){this.scrollIntent=null;return}this.applyScrollIntent()}captureActiveScroll(){let t=[],e=s=>{!s||!s.controller||!s.get("active")||s.isDormant()||(s.captureScroll(),t.push(s))},r=this.routes;for(let s=0,o=r.length;s<o;s++)e(r[s]);for(let s of this.switches.values())for(let o=0,i=s.length;o<i;o++)e(s[o]);return t}releaseCapturedScroll(t){for(let e=0,r=t.length;e<r;e++)t[e].releaseCapturedScroll()}checkSwitches(t,e){let r=this.switches;for(let[s,o]of r.entries())e===!0&&this.pageCache.size>0&&o.length&&o[0].isDormant()||(this.currentGroupId=s,this.checkGroup(o,t));this.currentGroupId=null}checkGroup(t,e){let r=t.length;if(!r)return;let s=null;for(let a=0;a<r;a++)if(t[a].get("active")){s=t[a];break}let o=!1;s&&(o=s.match(e)!==!1);let i;for(let a=0;a<r;a++){let l=t[a];if(typeof l>"u")continue;(l===s?o:l.match(e))!==!1&&i===void 0&&l.controller&&(i=l)}if(!i){s&&s!==t[0]&&s.deactivate(),this.select(t[0],!0);return}this.select(i),s&&s!==i&&s.deactivate();for(let a=0;a<r;a++){let l=t[a];l&&l!==i&&l!==s&&l.deactivate()}}checkRoute(t,e){let r=this.check(t,e);return r!==!1?(this.select(t),this.lastMatchedRoute=t):t.deactivate(),r}check(t,e){return t?(e=e||this.getPath(),t.match(e)!==!1):!1}select(t,e){if(!t||(t.setPath(this.path,this.lastPath),t.select(),this.updateTitle(t),e===!0))return;let r=this.scrollIntent;if(r&&r.type==="hash")return;let s=_r(this.path);if(s){this.scrollIntent={type:"hash",hash:s};return}t.scrollTo?(this.scrollIntent={type:"target",selector:t.scrollTo,groupId:this.currentGroupId},this.currentGroupId!==null&&this.currentGroupId!==void 0&&this.activeScrollGroups.add(this.currentGroupId)):t.preventScroll!==!0&&!this.scrollIntent&&(this.scrollIntent={type:"top"})}applyScrollIntent(){let t=this.scrollIntent;if(this.scrollIntent=null,!t)return;if(t.type==="hash"){this.lastScrollGroup=null,this.scrollToHash(t.hash);return}if(t.type==="top"){this.lastScrollGroup=null,this.checkToScroll(),this.reassertScrollTop();return}if(t.type!=="target")return;let e=t.groupId!==null&&t.groupId!==void 0,r=e&&this.scrollGroupsReady.has(t.groupId);if(this.lastScrollGroup=e?t.groupId:null,r){this.scrollToTarget(t.selector,t.groupId);return}typeof window<"u"&&window.scrollTo(0,0),this.reassertScrollTop()}reassertScrollTop(){if(typeof window>"u"||typeof requestAnimationFrame>"u")return;let t=++this.scrollWaitToken;requestAnimationFrame(()=>{t===this.scrollWaitToken&&(window.scrollY>0||window.pageYOffset>0)&&window.scrollTo(0,0)})}restoreScrollPosition(t){if(!t||typeof window>"u")return;let e=++this.scrollWaitToken;this.clearScrollWait();let r=t.x||0,s=t.y||0;if(typeof requestAnimationFrame>"u"||this.canReachScroll(r,s)){window.scrollTo(r,s);return}let o=()=>{e===this.scrollWaitToken&&this.scrollWaitToken++,this.clearScrollWait()},i={capture:!0,passive:!0};for(let c=0,h=ct.length;c<h;c++)window.addEventListener(ct[c],o,i);this.cancelScrollWait=()=>{for(let c=0,h=ct.length;c<h;c++)window.removeEventListener(ct[c],o,i)};let a=ne(),l=()=>{if(e!==this.scrollWaitToken){this.clearScrollWait();return}if(this.canReachScroll(r,s)||ne()-a>=Dr){this.clearScrollWait(),window.scrollTo(r,s);return}requestAnimationFrame(l)};requestAnimationFrame(l)}clearScrollWait(){let t=this.cancelScrollWait;t&&(this.cancelScrollWait=null,t())}canReachScroll(t,e){let r=document.documentElement;if(!r)return!0;let s=(r.scrollHeight||0)-(window.innerHeight||0),o=(r.scrollWidth||0)-(window.innerWidth||0);return(e<=0||e<=s+1)&&(t<=0||t<=o+1)}scrollToHash(t){if(!t||typeof document>"u")return;let e=()=>{let l=document.getElementById(t);if(l)return l;try{return document.getElementById(decodeURIComponent(t))}catch{return null}},r=e();if(r){r.scrollIntoView(!0);return}if(typeof requestAnimationFrame>"u")return;let s=++this.scrollWaitToken,o=30,i=0,a=()=>{if(s!==this.scrollWaitToken)return;let l=e();if(l){l.scrollIntoView(!0);return}++i<o&&requestAnimationFrame(a)};requestAnimationFrame(a)}findScrollTarget(t,e){if(typeof document>"u")return null;let r=this.findScopedScrollTarget(t,e);if(r)return r;let s=document.querySelectorAll(t);for(let o=0,i=s.length;o<i;o++){let a=s[o];if(a&&a.isConnected!==!1)return a}return null}findScopedScrollTarget(t,e){if(e==null||!this.switches)return null;let r=this.switches.get(e),s=r&&r[0],o=s&&s.controller&&s.controller.container;if(!o||o.nodeType!==1)return null;let i=o;for(let a=0;a<8;a++){let l=i.parentElement;if(!l||l===document.body||l===document.documentElement)break;let c=l.querySelector(t);if(c)return c;i=l}return null}readScrollTarget(t){let e=window.getComputedStyle(t),r=e.position==="sticky",s=r&&parseFloat(e.top)||0,o=(t.offsetWidth||0)>0||(t.offsetHeight||0)>0,i;if(r){let a=t.style.position;t.style.position="static",i=t.getBoundingClientRect().top+window.scrollY,t.style.position=a}else i=t.getBoundingClientRect().top+window.scrollY;return{sized:o,targetScroll:i-s}}scrollToTarget(t,e){if(typeof t!="string"||typeof document>"u")return;let r=c=>{window.scrollY>c&&window.scrollTo(0,Math.max(0,c))};if(typeof requestAnimationFrame>"u"){let c=this.findScrollTarget(t,e);if(c){let h=this.readScrollTarget(c);h.sized&&r(h.targetScroll)}return}let s=++this.scrollWaitToken,o=30,i=0,a=null,l=()=>{if(s!==this.scrollWaitToken)return;let c=this.findScrollTarget(t,e);if(c){let h=this.readScrollTarget(c);if(h.sized){if(a!==null&&Math.abs(a-h.targetScroll)<1){r(h.targetScroll);return}a=h.targetScroll}}if(++i<o){requestAnimationFrame(l);return}a!==null&&r(a)};requestAnimationFrame(l)}checkToScroll(){this.shouldScrollToTop()&&window.scrollTo(0,0)}cleanPath(t){return t?t.split("?")[0].split("#")[0]:"/"}shouldScrollToTop(){let t=this.cleanPath(this.getPath()),r=this.cleanPath(this.lastPath).split("/"),s=t.split("/");if(r.length!==s.length)return!0;let o=r[r.length-1],i=s[s.length-1];return o!==i}getEndPoint(){return this.getPath().replace(this.baseURI,"")||"/"}destroy(){typeof this.callBackLink=="function"&&p.off("click",document,this.callBackLink);let t=this.history;t&&typeof t.removeEvent=="function"&&t.removeEvent(),this.clearScrollWait(),this.pageCache.clear()}getPath(){let t=this.location,e=this.history;return e&&e.type==="hash"?t.hash.replace("#",""):t.pathname+t.search+t.hash}},P=new Ct;var se=(n,t)=>({attr:n,value:t}),Or=(n,t)=>{if(!t.startsWith(n))return!1;let e=t[n.length];return e===void 0||e==="/"||e==="#"||e==="."||e==="?"},Tt=class extends x{beforeSetup(){this.selectedClass=this.activeClass||"active"}render(){let t=this.href,e=this.text,r=this.setupWatchers(t,e);return{tag:"a",class:this.class||this.className||null,onState:["selected",{[this.selectedClass]:!0}],href:this.getString(t),text:this.getString(e),nest:this.nest||this.children,dataStateSet:this.dataSet,"data-replace":this.replace?"true":null,watch:r}}getLinkPath(){return this?.panel?.pathname||null}getString(t){let e=typeof t;return e!=="object"&&e!=="undefined"?t:null}setupWatchers(t,e){let r=this.exact===!0,s=P.data,o=[];t&&typeof t=="object"&&o.push(se("href",t)),e&&typeof e=="object"&&o.push(se("text",e));let i=null,a="",l="";return o.push({value:["[[path]]",s],callBack:(c,h)=>{if(typeof h.pathname>"u")return;let u=h.getAttribute("href");if(u!==i){i=u;let y=h.pathname+h.search+h.hash;a=y,l=h.hash||h.search?y:h.pathname}let m=r?c===a:Or(l,c);this.update(m)}}),o}setupStates(){return{selected:!1}}update(t){this.state&&(this.state.selected=t)}};var oe=(n,t,e=null)=>{if(!n)return;let r=null,s=!1,o=()=>{s||(s=!0,r&&(clearTimeout(r),r=null),p.off("animationend",n,i),n&&n.classList.remove(t),e&&e())},i=l=>{l.target===n&&o()};p.on("animationend",n,i),n.classList.add(t);let a=()=>{if(!s)try{let l=window.getComputedStyle(n),c=parseFloat(l.animationDuration)*1e3||1e3,h=parseFloat(l.animationDelay)*1e3||0;r=setTimeout(o,c+h+100)}catch{r=setTimeout(o,1e3)}};if(typeof requestAnimationFrame>"u"){r=setTimeout(o,1e3);return}requestAnimationFrame(()=>requestAnimationFrame(a))},ie=(n,t,e)=>{oe(n,t)},ae=(n,t,e)=>{let r=()=>{n&&n.remove&&n.remove()};Br(n,()=>oe(n,t,r),e)};f.addType("manual-destroy",n=>{if(!n)return!1;n.callBack(n.ele,n.parent)});var Br=(n,t,e)=>{f.add(n,"manual-destroy",{ele:n,callBack:t,parent:e})};var K=(n,t,e,r)=>{if(Array.isArray(e[0])){e.forEach(s=>{s&&K(n,t,s,r)});return}Hr(n,t,e,r)},Hr=(n,t,e,r)=>{let s,o;if(e.length<3?[s,o]=e:[t,s,o]=e,!t||!s)return;if(typeof t.on!="function"){console.warn('Watcher directive: Data source does not have an "on" method. Make sure your component has data, state, or context.data initialized before using watchers like onSet, watch, or [[prop]] syntax.',n,t);return}let i=Ur(n,s,o,r);I.watch(n,t,s,i)},Ur=(n,t,e,r)=>typeof e=="object"?s=>{qr(n,e,s)}:s=>{Wr(n,e,t,s,r)},le=new WeakSet,Nr=(n,t,e)=>{!n||!n.isUnit&&!n.isComponent||le.has(e)||le.add(e)},Wr=(n,t,e,r,s)=>{let o=t(r,n,s);switch(typeof o){case"object":if(o===null)break;Nr(o,e,n),d.rebuild(o,n,s);break;case"string":let i=bt(n);if(i!=="textContent"){n.setAttribute(i,o);break}q.addHtml(n,o);break}},qr=(n,t,e)=>{let r=Object.keys(t);for(let s=0,o=r.length;s<o;s++){let i=r[s];i&&(t[i]===e?n.classList.add(i):n.classList.remove(i))}};var H=(n,t,e)=>{let r=R(e);K(n,r,t,e)};var ce=(n,t,e)=>{t&&n.setAttribute("role",t)},Fr=n=>(t,e)=>{let r=t?"true":"false";e.setAttribute(n,r)},he=(n,t,e)=>{if(!t)return;let r=t.role;r&&(n.setAttribute("role",r),t.role=null);let s=Object.keys(t);for(let o=0,i=s.length;o<i;o++){let a=s[o],l=t[a];if(l===null)continue;let c="aria-"+a;if(Array.isArray(l)){let h=l.slice();h.push(Fr(c)),H(n,h,e)}else n.setAttribute(c,l)}};var ue=(n,t,e)=>{if(!t)return;let r=w.parse(t,e);S.addAttributes(n,r.attr,e),d.setDirectives(n,r.directives,e)};f.addType("context",n=>{if(!n)return!1;n.parent.removeContextBranch(n.branch)});var Pt=n=>n?n.getContext():null,de=(n,t,e)=>{if(typeof t!="function")return;let r=Pt(e),s=t(r);ue(n,s,e)},fe=(n,t,e)=>{if(typeof t!="function")return;let r=Pt(e);t(r)},pe=(n,t,e)=>{if(typeof t!="function"||!e)return;let r=Pt(e),s=t(r);if(!s)return;let o=s[0];o&&(e.addContextBranch(o,s[1]),Gr(n,o,e))},Gr=(n,t,e)=>{f.add(n,"context",{branch:t,parent:e})};var me=(n,t,e)=>{};var ge=(n,t,e)=>{if(!e)return;let r=e._layout?e._layout:e.render();console.log("Debug: ","ele: ",n),console.log("Data: ",t),console.log("Layout: ",r),console.log("parent: ",e)};var ye=(n,t,e)=>{},Se=(n,t,e)=>{if(!t||!e)return;let r=t(e,n);r&&d.build(r,n,e)},ve=(n,t,e)=>{if(!t||!e)return;let r=e.getId(t);n.id=r},xe=(n,t,e)=>{if(!t||!e)return;let r=t(e.data,n);r&&d.build(r,n,e)},ke=(n,t,e)=>{if(!t||!e)return;let r=t(e.state,n);r&&d.build(r,n,e)},we=(n,t,e)=>{if(!t||!e)return;let r=e.state,s=t(r);if(!e.state){e.setStateHelper(s);return}e.addState(s)},Ce=(n,t,e)=>{if(!t||!e)return;e.events||e.setEventHelper();let r=t[2];if(r){let s=r;r=o=>{s(o,e)}}e.events.on(t[0],t[1],r,t[3])};var Te=(n,t,e)=>{let r,s,o;if(typeof t=="string"){if(r=R(e),!r)return;s=t}else if(Array.isArray(t))if(typeof t[0]!="object"){let i=R(e);if(!i)return;r=i,s=t[0],o=t[1]}else[r,s,o]=t;I.bind(n,r,s,o)};var ht=(n,t,e)=>{K(n,e.state,t,e)};var Pe=n=>(t,e)=>{let[r,s,o="active"]=n,i=t===s?o:"";e.dataset[r]=i},Re=(n,t,e)=>{if(!t)return;let r=t.length-1,s=t[r],o=t.slice(0,r);o.push(Pe(s)),H(n,o,e)},Ae=(n,t,e)=>{if(!t)return;let r=t.length-1,s=t[r],o=t.slice(0,r);o.push(Pe(s)),ht(n,o,e)};var be=n=>{for(let t=0,e=n.length;t<e;t++){let r=n[t];r&&r.remove()}n.length=0};f.addType("forScopes",n=>{if(!n)return!1;be(n.scopes)});var Ie=(n,t,e)=>{let r,s,o,i;if(typeof t[0]=="string"||t.length<3){let h=R(e);if(!h)return;r=h,[s,o,i]=t}else[r,s,o,i]=t;let a=i!==!1,l=s+"[",c=a?{scopes:[]}:null;c&&f.add(n,"forScopes",c),I.watch(n,r,s,h=>{if(d.removeAll(n),c&&be(c.scopes),!h||h.length<1)return;let u=[];for(let m=0,y=h.length;m<y;m++){let U=a?r.scope(l+m+"]"):null;U&&c&&c.scopes.push(U);let N=o(h[m],m,U,u);N!==null&&u.push(N)}return d.build(u,n,e)})};var Ee=(n,t,e)=>{let r=t[0];if(!r||r.length<1)return;let s=t[1],o=[];for(let i=0,a=r.length;i<a;i++){let l=r[i];if(!l)continue;let c=s(l,i);c!==null&&o.push(c)}d.build(o,n,e)};var Le=(n,t,e)=>{t(n,e)};f.addType("destroyed",n=>{if(!n)return!1;n.callBack(n.ele,n.parent)});var Me=(n,t,e)=>{Kr(n,t,e)},Kr=(n,t,e)=>{f.add(n,"destroyed",{ele:n,callBack:t,parent:e})};var _e=(n,t,e)=>{if(t)if(Array.isArray(t)&&typeof t[0]!="string")for(let r=0,s=t.length;r<s;r++)L.setup(n,t[r],e);else L.setup(n,t,e)};f.addType("routes",n=>{if(!n)return!1;let t=n.route;t&&P.removeRoute(t)});var Oe=(n,t,e)=>{if(t)if(Array.isArray(t))for(let r=0,s=t.length;r<s;r++){let o=t[r];o&&De(n,o,e)}else De(n,t,e)},De=(n,t,e)=>{t.container=n,t.parent=e;let r=P.add(t);zr(n,r)},zr=(n,t)=>{f.add(n,"routes",{route:t})};var Be=(n,t,e)=>{};f.addType("switch",n=>{if(!n)return!1;let t=n.id;P.removeSwitch(t)});var He=(n,t,e)=>{let r=t[0];for(let o=0,i=t.length;o<i;o++){let a=t[o];a&&(a.container=n,a.parent=e)}let s=P.addSwitch(t);Qr(n,s)},Qr=(n,t)=>{f.add(n,"switch",{id:t})};F.add("cache",ye).add("onCreated",Le).add("onDestroyed",Me).add("bind",Te).add("data",me).add("state",Be).add("onSet",H).add("onState",ht).add("animateIn",ie).add("animateOut",ae).add("watch",_e).add("useParent",Se).add("useData",xe).add("useState",ke).add("getId",ve).add("addState",we).add("addEvent",Ce).add("map",Ee).add("for",Ie).add("useContext",fe).add("addContext",pe).add("context",de).add("role",ce).add("aria",he).add("route",Oe).add("debug",ge).add("dataSet",Re).add("dataStateSet",Ae).add("switch",He);export{F as a,Q as b,x as c,Dt as d,Ot as e,_ as f,d as g,Kt as h,Tt as i,Ct as j,P as k};
|
|
2
|
+
//# sourceMappingURL=chunk-YTWFPMDY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var d=class{static getType(e){let t=typeof e;return t!=="object"?t:Array.isArray(e)?"array":"object"}static isUndefined(e){return typeof e>"u"}static isObject(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}static isFunction(e){return typeof e=="function"}static isString(e){return typeof e=="string"}static isArray(e){return Array.isArray(e)}};var f={types:{},add(r,e){this.types[r]=e},get(r){return this.types[r]||!1},remove(r){delete this.types[r]}};var l=class{constructor(){this.types=new Map}add(e,t){let s=this.types.get(e);s||(s=[],this.types.set(e,s)),s.push(t)}get(e){return this.types.get(e)||!1}has(e){return this.types.has(e)}removeType(e){let t=this.types.get(e);if(!t)return;if(!t.length){this.types.delete(e);return}let s,i=f.get(e);if(i){for(let n=0,c=t.length;n<c;n++)s=t[n],s&&(t[n]=null,typeof i=="function"&&i(s));this.types.delete(e)}}remove(e){if(e){this.removeType(e);return}let t=this.types.keys();for(let s of t)s&&this.removeType(s);this.types.clear()}};var o=new WeakMap,g=new WeakMap,u=r=>!!r&&(typeof r=="object"||typeof r=="function"),a=class{static trackingCount=0;static addType(e,t){f.add(e,t)}static removeType(e){f.remove(e)}static getTrackingId(e){if(!e||typeof e!="object")return"";let t=g.get(e);return t||(t="dt"+this.trackingCount++,g.set(e,t)),t}static add(e,t,s){u(e)&&this.find(e).add(t,s)}static get(e,t){let s=u(e)?o.get(e):void 0;return s?t?s.get(t):s:!1}static has(e,t){let s=u(e)?o.get(e):void 0;return s&&t?s.has(t):!1}static find(e){let t=o.get(e);return t||(t=new l,o.set(e,t)),t}static isEmpty(e){return!e||typeof e!="object"?!0:e.size===0}static remove(e,t){let s=u(e)?o.get(e):void 0;if(s){if(!t){s.remove(),o.delete(e);return}s.remove(t),this.isEmpty(s.types)&&o.delete(e)}}};var v={getEvents(r){return typeof r!="object"||r===null?[]:a.get(r,"events")},create(r,e,t,s=!1,i=!1,n=null){return{event:r,obj:e,fn:t,capture:s,swapped:i,originalFn:n}},on(r,e,t,s){if(Array.isArray(r))for(let i=0,n=r.length;i<n;i++)this.add(r[i],e,t,s);else this.add(r,e,t,s);return this},off(r,e,t,s){if(Array.isArray(r))for(let i=0,n=r.length;i<n;i++)this.remove(r[i],e,t,s);else this.remove(r,e,t,s);return this},add(r,e,t,s=!1,i=!1,n=null){if(typeof e!="object"||e===null)return this;let c=this.create(r,e,t,s,i,n);return a.add(e,"events",c),e.addEventListener(r,t,s),this},remove(r,e,t,s=!1){let i=this.getEvent(r,e,t,s);if(i===!1)return this;if(typeof i=="object"){this.removeEvent(i);let n=this.getEvents(e);if(n){let c=n.indexOf(i);c>-1&&n.splice(c,1),n.length===0&&a.remove(e,"events")}}return this},removeEvent(r){return typeof r=="object"&&r.obj.removeEventListener(r.event,r.fn,r.capture),this},getEvent(r,e,t,s){if(typeof e!="object")return!1;let i=this.getEvents(e);if(!i||i.length<1)return!1;let n=this.create(r,e,t,s);return this.search(n,i)},search(r,e){let t,s=this.isSwappable(r.event);for(let i=0,n=e.length;i<n;i++)if(t=e[i],!(t.event!==r.event||t.obj!==r.obj)&&(t.fn===r.fn||s===!0&&t.originalFn===r.fn))return t;return!1},removeEvents(r){return typeof r!="object"||r===null?this:(a.remove(r,"events"),this)},swap:new Set(["DOMMouseScroll","wheel","mousewheel","mousemove","popstate"]),addSwapped(r){this.swap.add(r)},isSwappable(r){return this.swap.has(r)}};a.addType("events",r=>{v.removeEvent(r)});var m=class{static limit(e,t=1e6){return typeof e!="string"?"":e.substring(0,t)}static parseQueryString(e,t,s=!0){typeof e!="string"&&(e=window.location.search),e=this.limit(e);let i={},n=/([^?=&]+)(=([^&]*))?/g;return e.replace(n,function(c,p,w,y){let h=y===void 0?"":y;if(t!==!1)try{i[p]=decodeURIComponent(h)}catch{i[p]=h}else i[p]=h}),i}static camelCase(e){e=this.limit(e);let t=/(-|\s|_)+\w{1}/g;return e.replace(t,s=>s[1].toUpperCase())}static uncamelCase(e,t="-"){e=this.limit(e);let s=/([A-Z]{1,})/g;return e.replace(s,i=>t+i.toLowerCase()).toLowerCase()}static titleCase(e){if(!e)return"";e=this.limit(e);let t=/\w\S*/;return e.replace(t,s=>s.charAt(0).toUpperCase()+s.substring(1).toLowerCase())}};export{d as a,a as b,v as c,m as d};
|
|
2
|
+
//# sourceMappingURL=chunk-ZUB7I6Z4.js.map
|
package/dist/modules/ajax.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as e,d as r,e as o,f as c}from"../chunks/chunk-
|
|
1
|
+
import{c as e,d as r,e as o,f as c}from"../chunks/chunk-6N533MOU.js";import"../chunks/chunk-ZUB7I6Z4.js";export{r as Ajax,c as ResourceCache,o as ResourceCacheStore,e as XhrRequest};
|
|
2
2
|
//# sourceMappingURL=ajax.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b as A,c,d as f,e as m,f as P,g as C,h as S}from"../chunks/chunk-
|
|
1
|
+
import{a,b as A,c,d as f,e as m,f as P,g as C,h as S}from"../chunks/chunk-DNPDLUU4.js";import"../chunks/chunk-HL52UJBX.js";import{g as s}from"../chunks/chunk-KB5AL3PM.js";import"../chunks/chunk-6N533MOU.js";import"../chunks/chunk-KMMYW6DR.js";import"../chunks/chunk-ZUB7I6Z4.js";var b=r=>{let t=typeof r;return t!=="string"&&t!=="number"?r:d(r)},d=r=>[{tag:"text",textContent:r}],l=()=>({props:{},children:[]}),h=r=>({props:{},children:d(r)}),u=r=>({props:{},children:r}),y=r=>({props:r[0]||{},children:b(r[1])});var D=r=>({props:{watch:r},children:[]}),O=r=>{if(r.length===0)return l();let t=r[0],e=typeof t;if(e==="string"||e==="number")return h(t);if(Array.isArray(t))return s.isWatching(t)?D(t):u(t);let o=r[1]??r[0]??[];if(o&&Array.isArray(o)&&s.isWatching(o)){let n=r[0]&&!Array.isArray(r[0])?r[0]:{};r[0]={...n,watch:o},r[1]=[]}return y(r)},H=r=>(...t)=>{let{props:e,children:o}=O(t);return r(e,o)};var T=(r,t)=>{let e=Object.keys(r);for(let o=0,n=e.length;o<n;o++){let p=e[o],x=r[p],i=f[p]||p;t.prototype[i]=m(x,i)}return t},W=0,j=r=>{let t=class extends r{};return t.prototype._classId="pod"+W++,t},I=(r,t=c)=>{if(!r)return null;let e=j(t),o={},n=r(o);return T(o,e),e.prototype.render=n,e};export{H as Atom,C as Builder,c as Component,a as Directives,S as Import,P as Jot,I as Pod,A as Unit};
|
|
2
2
|
//# sourceMappingURL=component.js.map
|
package/dist/modules/data.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as a,h as e,i as o}from"../chunks/chunk-
|
|
1
|
+
import{d as a,h as e,i as o}from"../chunks/chunk-KB5AL3PM.js";import"../chunks/chunk-6N533MOU.js";import"../chunks/chunk-KMMYW6DR.js";import"../chunks/chunk-ZUB7I6Z4.js";export{a as Data,e as Model,o as SimpleData};
|
|
2
2
|
//# sourceMappingURL=data.js.map
|
package/dist/modules/date.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var h={monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],getDayName(
|
|
1
|
+
var D=new Map,h=()=>typeof Intl<"u"&&typeof Intl.DateTimeFormat=="function",c=(t,e,r)=>{let a=D.get(t);return a||(a=new Intl.DateTimeFormat(e,r),D.set(t,a)),a},m=t=>t instanceof Date&&!Number.isNaN(t.getTime()),N=/(?:Z|[+-]\d{2}:?\d{2})$/i,w=/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[ T](\d{1,2}):(\d{1,2})(?::(\d{1,2})(?:\.(\d{1,3})\d*)?)?)?$/,p=t=>{if(typeof t=="string"){let r=w.exec(t.trim());if(r){let a=r[7]?Number((r[7]+"00").substring(0,3)):0;return[Number(r[1]),Number(r[2]),Number(r[3]),Number(r[4]||0),Number(r[5]||0),Number(r[6]||0),a]}}let e=new Date(t);return m(e)?[e.getFullYear(),e.getMonth()+1,e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()]:null},M=(t,e)=>{let r=c("zone|"+e,"en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),a={year:0,month:1,day:1,hour:0,minute:0,second:0},n=r.formatToParts(t);for(let s=0,g=n.length;s<g;s++){let i=n[s];i.type in a&&(a[i.type]=Number(i.value))}let o=a.hour===24?0:a.hour,u=Date.UTC(a.year,a.month-1,a.day,o,a.minute,a.second),f=t-(t%1e3+1e3)%1e3;return u-f},k=[31,28,31,30,31,30,31,31,30,31,30,31],T={monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],getDayName(t=new Date().getDay(),e=!1){if(h()){let n=new Date(2004,0,4+t),o=e?"short":"long";return c("weekday|"+o,void 0,{weekday:o}).format(n)}let r=this.dayNames;if(t<0||t>=r.length)return null;let a=r[t];return e?a.substring(0,3):a},convertJsMonth(t){return this.padNumber(t+1)},convertDate(t,e=!1){if(!t)return"";let r=this.createDate(t);if(!m(r))return"";if(h()){let n={weekday:"long",month:"short",day:"2-digit"};return e&&(n.year="numeric"),c("convert|"+(e?1:0),void 0,n).format(r)}let a=e===!0?" "+r.getFullYear():"";return this.getDayName(r.getDay())+", "+this.getMonthName(r.getMonth(),!0)+" "+this.padNumber(r.getDate())+a},padNumber(t){return t<=9?"0"+t:String(t)},createDate(t){return t?(typeof t=="string"&&t.indexOf("-")>-1&&(t=t.replace(/\s/,"T"),t=t.indexOf(":")>-1?t:t+"T00:00:00"),new Date(t)):new Date},format(t,e){let r=this.createDate(e);return m(r)?t!=="sql"&&h()?c("date",void 0,{year:"numeric",month:"2-digit",day:"2-digit"}).format(r):this.renderDate(r.getFullYear(),r.getMonth()+1,r.getDate(),t):""},formatTime(t,e){let r=this.createDate(t);if(!m(r))return"";if(e!==24&&h())return c("time",void 0,{hour:"numeric",minute:"2-digit",hour12:!0}).format(r);let a=e===24?"sql":"standard";return this.renderTime(r.getHours(),r.getMinutes(),r.getSeconds(),a)},getMeridian(t){return t=Number(t),t>=12?"PM":"AM"},convert24To12(t){return t=Number(t),t%12||12},convert12To24(t,e){return t=Number(t)%12,String(e||"").toLowerCase()==="pm"&&(t=t+12),t},renderDate(t,e,r,a="sql"){return e=Number(e),r=Number(r),a==="sql"?`${t}-${this.padNumber(e)}-${this.padNumber(r)}`:`${this.padNumber(e)}/${this.padNumber(r)}/${t}`},renderTime(t,e,r=0,a="sql"){if(a==="sql")return`${this.padNumber(t)}:${this.padNumber(e)}:${this.padNumber(r)}`;let n=this.getMeridian(t);return t=this.convert24To12(t),`${t}:${this.padNumber(e)} ${n}`},leapYear(t){return t%400===0||t%100!==0&&t%4===0},getMonthName(t=new Date().getMonth(),e=!1){if(h()){let n=new Date(2e3,t,1),o=e?"short":"long";return c("month|"+o,void 0,{month:o}).format(n)}let r=this.monthNames;if(t<0||t>=r.length)return"";let a=r[t];return a?e?a.substring(0,3):a:""},getMonthLength(t,e){let r=new Date;return t=typeof t<"u"?t:r.getMonth(),e=typeof e<"u"?e:r.getFullYear(),this.getMonthsLength(e)[t]},getMonthsLength(t=new Date().getFullYear()){let e=k.slice();return this.leapYear(t)===!0&&(e[1]=29),e},getLocalDate(t,e="America/Denver"){if(typeof t=="string"&&t.indexOf("-")>-1&&N.test(t.trim()))return new Date(t.trim());let r=p(t);if(!r)return new Date(NaN);let[a,n,o,u,f,s,g]=r;if(!h())return new Date(a,n-1,o,u,f,s,g);let i=Date.UTC(a,n-1,o,u,f,s,g);try{let b=M(i,e),y=i-b,d=M(y,e);return d!==b&&(y=i-d),new Date(y)}catch{return new Date(a,n-1,o,u,f,s,g)}},getLocalTime(t,e=!1,r=!1,a="America/Denver"){if(!t)return"";let n=this.getLocalDate(t,a);if(!m(n))return"";if(!e&&h()){let s={hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0};return r===!1&&(s.year="numeric",s.month="2-digit",s.day="2-digit"),c("local|"+(r?1:0),void 0,s).format(n)}let o=n.getMonth()+1,u=e===!0?"sql":"standard",f="";return r===!1&&(f+=this.renderDate(n.getFullYear(),o,n.getDate(),u)+" "),f+this.renderTime(n.getHours(),n.getMinutes(),n.getSeconds(),u)},getDiffFromNow(t,e=!1){let r=this.createDate(t),a=new Date;return e===!0&&a.setHours(0,0,0,0),a.getTime()-r.getTime()},getAge(t){let e=this.getDiffFromNow(t),r=(a,n)=>a+" "+n+(a===1?"":"s");return e<864e5?"1 day":e<6048e5?r(this.toDays(e),"day"):e<12096e5?"1 week":e<2592e6?r(Math.floor(this.toDays(e)/7),"week"):e<5184e6?"1 month":e<31104e6?r(this.toMonths(e),"month"):r(Math.max(1,this.toYears(e)),"year")},getTimeFrame(t){let e=this.getDiffFromNow(t);return this.convertToEstimate(e)},convertToEstimate(t){let e="",r,a,n,o,u,f,s;if(t<=0)switch(!0){case t<-63072e6:n=this.toYears(Math.abs(t)),e="in "+n+"y";break;case t<-31536e6:e="in 1y";break;case t<-5184e6:o=this.toMonths(Math.abs(t)),e="in "+o+"mo";break;case t<-2592e6:e="in 1mo";break;case t<-12096e5:r=this.toDays(Math.abs(t)),a=Math.floor(r/7),e="in "+a+"w";break;case t<-6048e5:e="in 1w";break;case t<-1728e5:r=this.toDays(Math.abs(t)),e="in "+r+"d";break;case t<-864e5:e="tomorrow";break;case t<-72e5:u=this.toHours(Math.abs(t)),e="in "+u+"h";break;case t<=-36e5:e="in 1h";break;case t<-12e4:f=this.toMinutes(Math.abs(t)),e="in "+f+"m";break;case t<-6e4:e="in 1m";break;case t<-2e3:s=this.toSeconds(Math.abs(t)),e="in "+s+"s";break;case t<-1:e="in 1s";break;default:e="now"}else switch(!0){case t<1e3:e="1s ago";break;case t<6e4:s=this.toSeconds(t),e=s+"s ago";break;case t<12e4:e="1m ago";break;case t<36e5:f=this.toMinutes(t),e=f+"m ago";break;case t<72e5:e="1h ago";break;case t<864e5:u=this.toHours(t),e=u+"h ago";break;case t<1728e5:e="yesterday";break;case t<6048e5:r=this.toDays(t),e=r+"d ago";break;case t<12096e5:e="1w ago";break;case t<2592e6:r=this.toDays(t),a=Math.floor(r/7),e=a+"w ago";break;case t<5184e6:e="1mo ago";break;case t<31536e6:o=this.toMonths(t),e=o+"mo ago";break;case t<63072e6:e="1y ago";break;default:n=this.toYears(t),e=n+"y ago"}return e},toYears(t){return typeof t!="number"?0:Math.floor(t/(1e3*60*60*24*365.26))},toMonths(t){return typeof t=="number"?Math.floor(t/(1e3*60*60*24*30)):0},toDays(t){return typeof t!="number"?0:Math.floor(t/(3600*1e3*24))},toHours(t){return typeof t!="number"?0:Math.floor(t%(3600*1e3*24)/(3600*1e3))},toMinutes(t){return typeof t!="number"?0:Math.floor(t%(3600*1e3)/(60*1e3))},toSeconds(t){return typeof t!="number"?0:Math.floor(t%(60*1e3)/1e3)},getDifference(t,e){let r=this.createDate(t),a=this.createDate(e),n=a.getTime()-r.getTime();return{years:this.toYears(n),days:this.toDays(n),hours:this.toHours(n),minutes:this.toMinutes(n),seconds:this.toSeconds(n)}}};export{T as DateTime};
|
|
2
2
|
//# sourceMappingURL=date.js.map
|
package/dist/modules/html.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{g as m}from"../chunks/chunk-KMMYW6DR.js";import"../chunks/chunk-ZUB7I6Z4.js";export{m as Html};
|
|
2
2
|
//# sourceMappingURL=html.js.map
|
package/dist/modules/router.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as r,j as o,k as t}from"../chunks/chunk-
|
|
1
|
+
import{i as r,j as o,k as t}from"../chunks/chunk-DNPDLUU4.js";import"../chunks/chunk-HL52UJBX.js";import"../chunks/chunk-KB5AL3PM.js";import"../chunks/chunk-6N533MOU.js";import"../chunks/chunk-KMMYW6DR.js";import"../chunks/chunk-ZUB7I6Z4.js";export{r as NavLink,o as Router,t as router};
|
|
2
2
|
//# sourceMappingURL=router.js.map
|
package/dist/modules/state.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r,b as t}from"../chunks/chunk-
|
|
1
|
+
import{a as r,b as t}from"../chunks/chunk-HL52UJBX.js";import"../chunks/chunk-KB5AL3PM.js";import"../chunks/chunk-6N533MOU.js";import"../chunks/chunk-KMMYW6DR.js";import"../chunks/chunk-ZUB7I6Z4.js";export{r as State,t as Store};
|
|
2
2
|
//# sourceMappingURL=state.js.map
|