native-document 1.0.149 → 1.0.150

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.
Files changed (60) hide show
  1. package/cdn.components.js +28 -0
  2. package/dist/native-document.components.min.js +101 -144
  3. package/dist/native-document.dev.js +3207 -3250
  4. package/dist/native-document.dev.js.map +1 -1
  5. package/dist/native-document.min.js +1 -1
  6. package/elements.js +1 -4
  7. package/index.js +0 -4
  8. package/package.json +1 -1
  9. package/src/core/elements/fragment.js +8 -0
  10. package/src/core/elements/index.js +1 -9
  11. package/src/core/utils/prototypes.js +0 -46
  12. package/src/ui/components/accordion/AccordionRender.js +1 -0
  13. package/src/ui/components/alert/AlertRender.js +2 -1
  14. package/src/ui/components/avatar/avata-group/AvatarGroupRender.js +1 -0
  15. package/src/ui/components/badge/BadgeRender.js +1 -0
  16. package/src/ui/components/breadcrumb/BreadcrumbRender.js +1 -0
  17. package/src/ui/components/contextmenu/ContextmenuRender.js +0 -2
  18. package/src/ui/components/dropdown/DropdownRender.js +1 -1
  19. package/src/ui/components/form/FieldCollectionRender.js +1 -1
  20. package/src/ui/components/form/FormControlRender.js +2 -1
  21. package/src/ui/components/form/fields/AutocompleteFieldRender.js +3 -3
  22. package/src/ui/components/form/fields/CheckboxFieldRender.js +1 -1
  23. package/src/ui/components/form/fields/CheckboxGroupFieldRender.js +1 -1
  24. package/src/ui/components/form/fields/DateFieldRender.js +2 -1
  25. package/src/ui/components/form/fields/FieldRender.js +2 -1
  26. package/src/ui/components/form/fields/HiddenFieldRender.js +0 -1
  27. package/src/ui/components/form/fields/PasswordFieldRender.js +1 -1
  28. package/src/ui/components/form/fields/RadioFieldRender.js +1 -1
  29. package/src/ui/components/form/fields/RangeFieldRender.js +1 -0
  30. package/src/ui/components/form/fields/SelectFieldRender.js +2 -2
  31. package/src/ui/components/form/fields/SliderFieldRender.js +2 -2
  32. package/src/ui/components/form/fields/TimeFieldRender.js +1 -0
  33. package/src/ui/components/form/file-upload-mode/FileAvatarModeRender.js +2 -2
  34. package/src/ui/components/form/file-upload-mode/FileDropzoneModeRender.js +2 -2
  35. package/src/ui/components/form/file-upload-mode/FileWallModeRender.js +1 -2
  36. package/src/ui/components/menu/MenuGroupRender.js +0 -1
  37. package/src/ui/components/menu/MenuItemRender.js +1 -1
  38. package/src/ui/components/menu/MenuLinkRender.js +1 -1
  39. package/src/ui/components/menu/MenuRender.js +1 -0
  40. package/src/ui/components/modal/ModalRender.js +1 -2
  41. package/src/ui/components/pagination/PaginationRender.js +2 -2
  42. package/src/ui/components/popover/PopoverRender.js +1 -2
  43. package/src/ui/components/skeleton/SkeletonRender.js +1 -0
  44. package/src/ui/components/spinner/SpinnerRender.js +2 -1
  45. package/src/ui/components/splitter/SplitterRender.js +1 -0
  46. package/src/ui/components/stacks/PositionStackRender.js +1 -0
  47. package/src/ui/components/stacks/StackRender.js +0 -1
  48. package/src/ui/components/stacks/v-stack/VStackRender.js +1 -0
  49. package/src/ui/components/stepper/StepperRender.js +2 -1
  50. package/src/ui/components/stepper/StepperStepRender.js +1 -1
  51. package/src/ui/components/switch/SwitchRender.js +1 -0
  52. package/src/ui/components/table/data-table/DataTableRender.js +2 -1
  53. package/src/ui/components/table/data-table/bulk-actions.js +1 -2
  54. package/src/ui/components/table/data-table/pagination.js +1 -1
  55. package/src/ui/components/table/data-table/tables.js +1 -1
  56. package/src/ui/components/table/simple-table/SimpleTableRender.js +3 -2
  57. package/src/ui/components/tabs/TabsRender.js +1 -1
  58. package/src/ui/components/toast/ToastRender.js +2 -1
  59. package/src/ui/theme.js +0 -6
  60. package/src/ui/theme.scss +1 -0
@@ -1 +1 @@
1
- var NativeDocument=function(e){"use strict";let t={};t={log(){},warn(){},error(){},disable(){}};var n=t;class r extends Error{constructor(e,t={}){super(e),this.name="NativeDocumentError",this.context=t,this.timestamp=(new Date).toISOString()}}const o=function(){let e=0;const t=new Map;return{register(n){const r=++e;return t.set(r,new WeakRef(n)),r},unregister(e){t.delete(e)},getObservableById:e=>t.get(e)?.deref(),cleanup(){for(const[e,n]of t){const e=n.deref();e&&e.cleanup()}t.clear()},cleanObservables(e){if(t.size<e)return;let r=0;for(const[e,n]of t)n.deref()||(t.delete(e),r++);r>0&&n.log("Memory Auto Clean",`🧹 Cleaned ${r} orphaned observables`)}}}();const s=function(e,t){this.$target=t,this.$observer=e};s.prototype.__$Observable=!0,s.prototype.__$isObservableWhen=!0,s.prototype.subscribe=function(e){return this.$observer.on(this.$target,e)},s.prototype.val=function(){return this.$observer.$currentValue===this.$target},s.prototype.isMatch=s.prototype.val,s.prototype.isActive=s.prototype.val;const i=function(e){let t=!1;return function(...n){t||(t=!0,Promise.resolve().then(()=>{e.apply(this,n),t=!1}))}},a=function(e,t){return e.replace(new RegExp(`^[${t}]+|[${t}]+$`,"g"),"")},l=(e,t)=>{try{if(void 0!==window.structuredClone)return window.structuredClone(e)}catch(e){}if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(e=>l(e));if(Hr.isObservable(e))return t&&t(e),e;const n={};for(const t in e)Object.hasOwn(e,t)&&(n[t]=l(e[t]));return n},u=(e,t)=>{const n=new Date(e);return{d:n,parts:new Intl.DateTimeFormat(t,{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(n).reduce((e,{type:t,value:n})=>(e[t]=n,e),{})}},c=(e,t,n)=>{const r=e=>String(e).padStart(2,"0");return e.replace("YYYY",n.year).replace("YY",n.year.slice(-2)).replace("MMMM",n.month).replace("MMM",n.month.slice(0,3)).replace("MM",r(t.getMonth()+1)).replace("DD",r(t.getDate())).replace("D",t.getDate()).replace("HH",n.hour).replace("mm",n.minute).replace("ss",n.second)},p={currency:(e,t,{currency:n="XOF",notation:r,minimumFractionDigits:o,maximumFractionDigits:s}={})=>new Intl.NumberFormat(t,{style:"currency",currency:n,notation:r,minimumFractionDigits:o,maximumFractionDigits:s}).format(e),number:(e,t,{notation:n,minimumFractionDigits:r,maximumFractionDigits:o}={})=>new Intl.NumberFormat(t,{notation:n,minimumFractionDigits:r,maximumFractionDigits:o}).format(e),percent:(e,t,{decimals:n=1}={})=>new Intl.NumberFormat(t,{style:"percent",maximumFractionDigits:n}).format(e),date:(e,t,{format:n,dateStyle:r="long"}={})=>{if(n){const{d:r,parts:o}=u(e,t);return c(n,r,o)}return new Intl.DateTimeFormat(t,{dateStyle:r}).format(new Date(e))},time:(e,t,{format:n,hour:r="2-digit",minute:o="2-digit",second:s}={})=>{if(n){const{d:r,parts:o}=u(e,t);return c(n,r,o)}return new Intl.DateTimeFormat(t,{hour:r,minute:o,second:s}).format(new Date(e))},datetime:(e,t,{format:n,dateStyle:r="long",hour:o="2-digit",minute:s="2-digit",second:i}={})=>{if(n){const{d:r,parts:o}=u(e,t);return c(n,r,o)}return new Intl.DateTimeFormat(t,{dateStyle:r,hour:o,minute:s,second:i}).format(new Date(e))},relative:(e,t,{unit:n="day",numeric:r="auto"}={})=>{const o=Math.round((e-Date.now())/864e5);return new Intl.RelativeTimeFormat(t,{numeric:r}).format(o,n)},plural:(e,t,{singular:n,plural:r}={})=>`${e} ${"one"===new Intl.PluralRules(t).select(e)?n:r}`};function h(e,t=null){return new g(e,t)}const d=h,f=h;h.useValueProperty=function(e="value"){Object.defineProperty(g.prototype,e,{get(){return this.$currentValue},set(e){this.set(e)},configurable:!0})},h.getById=function(e){const t=o.getObservableById(parseInt(e));if(!t)throw new r("Observable.getById : No observable found with id "+e);return t},h.cleanup=function(e){e.cleanup()},h.autoCleanup=function(e=!1,t={}){if(!e)return;const{interval:n=6e4,threshold:r=100}=t;window.addEventListener("beforeunload",()=>{o.cleanup()}),setInterval(()=>o.cleanObservables(r),n)};const m={getJson(e){let t=localStorage.getItem(e);try{return JSON.parse(t)}catch(t){throw new r("invalid_json:"+e)}},getNumber(e){return Number(this.get(e))},getBool(e){const t=this.get(e);return"true"===t||"1"===t},setJson(e,t){localStorage.setItem(e,JSON.stringify(t))},setBool(e,t){localStorage.setItem(e,t?"true":"false")},get:(e,t=null)=>localStorage.getItem(e)||t,set:(e,t)=>localStorage.setItem(e,t),remove(e){localStorage.removeItem(e)},has:e=>null!=localStorage.getItem(e)},b=(e,t)=>{if(!m.has(e))return t;switch(typeof t){case"object":return m.getJson(e)??t;case"boolean":return m.getBool(e)??t;case"number":return m.getNumber(e)??t;default:return m.get(e,t)??t}},y=e=>{switch(typeof e){case"object":return m.setJson;case"boolean":return m.setBool;default:return m.set}};function g(e,t=null){e=Hr.isObservable(e)?e.val():e,this.$previousValue=null,this.$currentValue=e,this.$firstListener=null,this.$listeners=null,this.$watchers=null,this.$memoryId=null,t&&(this.configs=t,t.reset&&(this.$initialValue=Hr.isObject(e)?l(e):e))}Object.defineProperty(g.prototype,"$value",{get(){return this.$currentValue},set(e){this.set(e)},configurable:!0}),g.prototype.__$Observable=!0,g.prototype.__$isObservable=!0;const v=function(){};g.prototype.intercept=function(e){return this.$interceptor=e,this.set=this.$setWithInterceptor,this},g.prototype.interceptMutations=function(e){return this.$mutationInterceptor=e,this},g.prototype.triggerFirstListener=function(e){this.$firstListener(this.$currentValue,this.$previousValue,e)},g.prototype.triggerListeners=function(e){const t=this.$listeners,n=this.$previousValue,r=this.$currentValue;for(let o=0,s=t.length;o<s;o++)t[o](r,n,e)},g.prototype.triggerWatchers=function(e){const t=this.$watchers,n=this.$previousValue,r=this.$currentValue,o=t.get(r),s=t.get(n);o&&o(!0,n,e),s&&s(!1,r,e)},g.prototype.triggerAll=function(e){this.triggerWatchers(e),this.triggerListeners(e)},g.prototype.triggerWatchersAndFirstListener=function(e){this.triggerWatchers(e),this.triggerFirstListener(e)},g.prototype.assocTrigger=function(){if(this.$firstListener=null,this.$watchers?.size&&this.$listeners?.length)return this.$firstListener=this.$listeners[0],this.trigger=0===this.$firstListener.length?this.$firstListener:this.triggerFirstListener,void(this.trigger=1===this.$listeners.length?this.triggerWatchersAndFirstListener:this.triggerAll);this.$listeners?.length?1===this.$listeners.length?(this.$firstListener=this.$listeners[0],this.trigger=0===this.$firstListener.length?this.$firstListener:this.triggerFirstListener):this.trigger=this.triggerListeners:this.$watchers?.size?this.trigger=this.triggerWatchers:this.trigger=v},g.prototype.trigger=v;const w={action:"set"};function $(e,t){this.observable=e,g.call(this),this.$mutation=t,e.subscribe(e=>{this.$updateWithMutation(e)}),this.$updateWithMutation(e.val())}g.prototype.$updateWithNewValue=function(e){e=e?.__$isObservable?e.val():e,this.$currentValue!==e&&(this.$previousValue=this.$currentValue,this.$currentValue=e,this.trigger(w),this.$previousValue=null)},g.prototype.$setWithInterceptor=function(e){let t="function"==typeof e?e(this.$currentValue):e;const n=this.$interceptor(t,this.$currentValue);void 0!==n&&(t=n),this.$updateWithNewValue(t)},g.prototype.$basicSet=function(e){let t="function"==typeof e?e(this.$currentValue):e;this.$updateWithNewValue(t)},g.prototype.set=g.prototype.$basicSet,g.prototype.val=function(){return this.$currentValue},g.prototype.disconnectAll=function(){this.$previousValue=null,this.$currentValue=null,this.$listeners=null,this.$watchers=null,this.trigger=v},g.prototype.onCleanup=function(e){this.$cleanupListeners=this.$cleanupListeners??[],this.$cleanupListeners.push(e)},g.prototype.cleanup=function(){if(this.$cleanupListeners){for(let e=0;e<this.$cleanupListeners.length;e++)this.$cleanupListeners[e]();this.$cleanupListeners=null}o.unregister(this.$memoryId),this.disconnectAll(),delete this.$value},g.prototype.subscribe=function(e){this.$listeners=this.$listeners??[],this.$listeners.push(e),this.assocTrigger()},g.prototype.on=function(e,t){this.$watchers=this.$watchers??new Map;let n=this.$watchers.get(e);t.__$isObservable&&(t=t.set.bind(t)),n?Hr.isArray(n.list)?n.list.push(t):(n=[n,t],t=e=>{for(let t=0,r=n.length;t<r;t++)n[t](e)},t.list=n,this.$watchers.set(e,t)):(n=t,this.$watchers.set(e,t)),this.assocTrigger()},g.prototype.off=function(e,t){if(!this.$watchers)return;const n=this.$watchers.get(e);if(!n)return;if(!t||!Array.isArray(n.list))return this.$watchers?.delete(e),void this.assocTrigger();const r=n.indexOf(t);n?.splice(r,1),1===n.length?this.$watchers.set(e,n[0]):0===n.length&&this.$watchers?.delete(e),this.assocTrigger()},g.prototype.once=function(e,t){const n="function"==typeof e?e:t=>t===e,r=e=>{n(e)&&(this.unsubscribe(r),t(e))};this.subscribe(r)},g.prototype.unsubscribe=function(e){if(!this.$listeners)return;const t=this.$listeners.indexOf(e);t>-1&&this.$listeners.splice(t,1),this.assocTrigger()},g.prototype.check=function(e){return new $(this,e)},g.prototype.transform=g.prototype.check,g.prototype.pluck=function(e){return new $(this,t=>t[e])},g.prototype.is=function(e){return new $(this,"function"==typeof e?e:t=>t===e)},g.prototype.select=g.prototype.check,g.prototype.get=function(e){const t=this.$currentValue[e];return Hr.isObservable(t)?t.val():t},g.prototype.when=function(e){return new s(this,e)},g.prototype.equals=function(e){return Hr.isObservable(e)?this.$currentValue===e.$currentValue:this.$currentValue===e},g.prototype.toBool=function(){return!!this.$currentValue},g.prototype.toggle=function(){this.set(!this.$currentValue)},g.prototype.reset=function(){if(!this.configs?.reset)return;const e=Hr.isObject(this.$initialValue)?l(this.$initialValue,e=>{e.reset()}):this.$initialValue;this.set(e)},g.prototype.toString=function(){return String(this.$currentValue)},g.prototype.valueOf=function(){return this.$currentValue},g.prototype.format=function(e,t={}){const n=this;if("function"==typeof e)return new $(n,e);const r=p[e],o=p.locale;return h.computed(()=>r(n.val(),o.val(),t),[n,o])},g.prototype.persist=function(e,t={}){let n=b(e,this.$currentValue);t.get&&(n=t.get(n)),this.set(n);const r=y(this.$currentValue);return this.subscribe(n=>{r(e,t.set?t.set(n):n)}),this},g.prototype.clone=function(){let e=this.$currentValue;return e&&"object"==typeof e&&(e="function"==typeof e.clone?e.clone():structuredClone(e)),new g(e)},$.prototype=Object.create(g.prototype),$.prototype.constructor=$,$.prototype.__$Observable=!0,$.prototype.__$isObservableChecker=!0;const S=$;S.prototype.constructor=S,$.prototype.$updateWithMutation=function(e){return e=this.$mutation(e),this.set(e)};const C={mounted:new WeakMap,beforeUnmount:new WeakMap,mountedSupposedSize:0,unmounted:new WeakMap,unmountedSupposedSize:0,observer:null,initObserver:()=>{C.observer||(C.observer=new MutationObserver(C.checkMutation),C.observer.observe(document.body,{childList:!0,subtree:!0}))},executeMountedCallback(e){const t=C.mounted.get(e);if(t&&(t.inDom=!0,t.mounted))if(Array.isArray(t.mounted))for(const n of t.mounted)n(e);else t.mounted(e)},executeUnmountedCallback(e){const t=C.unmounted.get(e);if(!t)return;if(t.inDom=!1,!t.unmounted)return;let n=!1;if(Array.isArray(t.unmounted))for(const r of t.unmounted)!0===r(e)&&(n=!0);else n=!0===t.unmounted(e);n&&(t.disconnect(),e.nd?.remove())},checkMutation:function(e){for(const t of e){if(C.mountedSupposedSize>0)for(const e of t.addedNodes){if(C.executeMountedCallback(e),!e.querySelectorAll)continue;const t=e.querySelectorAll("[data--nd-mounted]");for(const e of t)C.executeMountedCallback(e)}if(C.unmountedSupposedSize>0)for(const e of t.removedNodes){if(C.executeUnmountedCallback(e),!e.querySelectorAll)continue;const t=e.querySelectorAll("[data--nd-unmounted]");for(const e of t)C.executeUnmountedCallback(e)}}},watch:function(e,t=!1){let n=!1,r=!1;C.initObserver();let o={inDom:t,mounted:null,unmounted:null,disconnect:()=>{n&&(C.mounted.delete(e),C.mountedSupposedSize--),r&&(C.unmounted.delete(e),C.unmountedSupposedSize--),o=null}};const s=(e,t)=>{o[e]?Array.isArray(o[e])?o[e].push(t):o[e]=[o[e],t]:o[e]=t};return{disconnect:()=>o?.disconnect(),mounted:t=>{s("mounted",t),C.mounted.set(e,o),n||(C.mountedSupposedSize++,n=!0)},unmounted:t=>{s("unmounted",t),C.unmounted.set(e,o),r||(C.unmountedSupposedSize++,r=!0)},off:(e,t)=>{((e,t)=>{if(o?.[e]){if(Array.isArray(o[e])){const n=o[e].indexOf(t);return n>-1&&o[e].splice(n,1),1===o[e].length&&(o[e]=o[e][0]),void(0===o[e].length&&(o[e]=null))}o[e]=null}})(e,t)}}}},O=new Set(["checked","selected","disabled","readonly","required","autofocus","multiple","autocomplete","hidden","contenteditable","spellcheck","translate","draggable","async","defer","autoplay","controls","loop","muted","download","reversed","open","default","formnovalidate","novalidate","scoped","itemscope","allowfullscreen","allowpaymentrequest","playsinline"]),A=(e,t)=>{for(const n in t){const r=t[n];if(r.__$Observable){if(r.__$isObservableChecker){let t=r.val();if("string"==typeof t){e.classes.toggle(t,!0),r.subscribe(n=>{e.classes.remove(t),e.classes.toggle(n,!0),t=n});continue}}e.classes.toggle(n,r.val()),r.subscribe(t=>e.classes.toggle(n,t))}else r.$hydrate?r.$hydrate(e,n):e.classes.toggle(n,r)}},E=(e,t)=>{for(const n in t){const r=t[n],o=n.startsWith("--");r.__$Observable?o?(e.style.setProperty(n,r.val()),r.subscribe(t=>{!1!==t?e.style.setProperty(n,t):e.style.removeProperty(n)})):(e.style[n]=r.val(),r.subscribe(t=>{!1!==t?e.style[n]=t:e.style.removeProperty(n)})):o?e.style.setProperty(n,r):e.style[n]=r}},_=(e,t,n)=>{const r=n.__$isObservable,o=r?n.val():n;if(Hr.isBoolean(o)?e[t]=o:e[t]=o===e.value,r){if("checked"===t)return"boolean"==typeof o?e.addEventListener("input",()=>n.set(e[t])):e.addEventListener("input",()=>n.set(e.value)),void n.subscribe(n=>e[t]=n);n.subscribe(n=>e[t]=n===e.value)}},N=(e,t)=>{for(const n in t){const r=n.toLowerCase();let o=t[n];if(null!=o)if(o.handleNdAttribute)o.handleNdAttribute(e,r,o);else{if("object"==typeof o){if("class"===r){A(e,o);continue}if("style"===r){E(e,o);continue}}O.has(r)?_(e,r,o):e.setAttribute(r,o)}}return e};function x(e){this.$hydrate=e}x.prototype.__$isTemplateBinding=!0,String.prototype.toNdElement=function(){return M.createStaticTextNode(null,this)},Number.prototype.toNdElement=function(){return M.createStaticTextNode(null,this.toString())},Element.prototype.toNdElement=function(){return this},Text.prototype.toNdElement=function(){return this},Comment.prototype.toNdElement=function(){return this},Document.prototype.toNdElement=function(){return this},DocumentFragment.prototype.toNdElement=function(){return this},g.prototype.toNdElement=function(){return M.createObservableNode(null,this)},$.prototype.toNdElement=g.prototype.toNdElement,jr.prototype.toNdElement=function(){const e=this.$element??this.$build?.()??this.build?.()??null;return this.$attachements?(this.$attachements.contains(this.$element)||this.$attachements.append(this.$element),this.$attachements):e},Array.prototype.toNdElement=function(){const e=document.createDocumentFragment();for(let t=0,n=this.length;t<n;t++){const n=M.getChild(this[t]);null!==n&&e.appendChild(n)}return e},Function.prototype.toNdElement=function(){return M.getChild(this())},x.prototype.toNdElement=function(){return M.createHydratableNode(null,this)};const F=(e,t=1e3)=>new Promise(n=>{let r=!1;const o=t=>{t&&t.target!==e||r||(r=!0,e.removeEventListener("transitionend",o),e.removeEventListener("animationend",o),clearTimeout(s),n())};e.addEventListener("transitionend",o),e.addEventListener("animationend",o);const s=setTimeout(o,t),i=window.getComputedStyle(e),a="0s"!==i.transitionDuration,l="0s"!==i.animationDuration;a||l||o()});jr.prototype.transitionOut=function(e){const t=e+"-exit",n=this.$element;return this.beforeUnmount("transition-exit",async function(){n.classes.add(t),await F(n),n.classes.remove(t)}),this},jr.prototype.transitionIn=function(e){const t=e+"-enter-from",n=e+"-enter-to",r=this.$element;return r.classes.add(t),this.mounted(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{r.classes.remove(t),r.classes.add(n),F(r).then(()=>{r.classes.remove(n)})})})}),this},jr.prototype.transition=function(e){return this.transitionIn(e),this.transitionOut(e),this},jr.prototype.animate=function(e){const t=this.$element;return t.classes.add(e),F(t).then(()=>{t.classes.remove(e)}),this},g.prototype.handleNdAttribute=function(e,t){O.has(t)?_(e,t,this):((e,t,n)=>{const r="value"===t?t=>e.value=t:n=>e.setAttribute(t,n);if(n.subscribe(r),"value"===t)return e.value=n.val(),void e.addEventListener("input",()=>n.set(e.value));e.setAttribute(t,n.val())})(e,t,this)},$.prototype.handleNdAttribute=g.prototype.handleNdAttribute,x.prototype.handleNdAttribute=function(e,t){this.$hydrate(e,t)};let D=null;const M={createTextNode:()=>(D||(D=document.createTextNode(""),M.createTextNode=()=>D.cloneNode()),D.cloneNode()),createObservableNode:(e,t)=>{const n=M.createTextNode();return t.subscribe(e=>n.nodeValue=e),n.nodeValue=t.val(),e&&e.appendChild(n),n},createHydratableNode:(e,t)=>{const n=M.createTextNode();return t.$hydrate(n),n},createStaticTextNode:(e,t)=>{let n=M.createTextNode();return n.nodeValue=t,e&&e.appendChild(n),n},createElement:e=>document.createElement(e).cloneNode(),createFragment:e=>Rr("Fragment"),bindTextNode:(e,t)=>{if(t?.__$isObservable)return t.subscribe(t=>e.nodeValue=t),void(e.nodeValue=t.val());e.nodeValue=t},processChildren:(e,t)=>{if(null===e)return;let n=M.getChild(e);n&&t.appendChild(n)},async safeRemove(e){await e.remove()},getChild:e=>{if(null==e)return null;if(e.toNdElement)do{if(e=e.toNdElement(),Hr.isElement(e))return e}while(e.toNdElement);return M.createStaticTextNode(null,e)},processAttributes:(e,t)=>{t&&N(e,t)},processAttributesDirect:N,processClassAttribute:A,processStyleAttribute:E};function T(e){const t=Reflect.construct(DocumentFragment,[],T),n=document.createComment((e||"")+" Anchor Sentinel"),r=document.createComment("Anchor Start : "+e),o=document.createComment("/ Anchor End "+e),s={};t.append(r,n,o);const i=new MutationObserver(()=>{n.parentNode===t||n.parentNode instanceof DocumentFragment||s.connected&&s.connected(n.parentNode)});return i.observe(document,{childList:!0,subtree:!0}),t.$sentinel=n,t.$start=r,t.$end=o,t.$observer=i,t.$events=s,t}function k(e){this.$element=e,this.$classes=null,this.$styles=null,this.$attrs=null,this.$ndMethods=null}T.prototype=Object.create(DocumentFragment.prototype),T.prototype.constructor=T,T.prototype.onConnected=function(e){return this.$events.connected=e,this},T.prototype.onConnectedOnce=function(e){this.$events.connected=t=>{e(t),this.$observer.disconnect(),this.$events.connectedOnce=null}},jr.prototype.attach=function(e,t){if("function"==typeof t){const n=this.$element;return n.nodeCloner=n.nodeCloner||new k(n),n.nodeCloner.attach(e,t),n}return t.$hydrate(this.$element,e),this.$element},k.prototype.__$isNodeCloner=!0;const I=(e,t,n)=>{for(const r in t)e[r]=t[r].apply(null,n);return e};k.prototype.resolve=function(){if(this.$content)return;const e=[];if(this.$ndMethods){const t=Object.keys(this.$ndMethods);if(1===t.length){const n=t[0],r=this.$ndMethods[n];e.push((e,t)=>{e.nd[n](r.bind(e,...t))})}else e.push((e,t)=>{const n=e.nd;for(const r in this.$ndMethods)n[r](this.$ndMethods[r].bind(e,...t))})}if(this.$classes){const t={},n=Object.keys(this.$classes);if(1===n.length){const r=n[0],o=this.$classes[r];e.push((e,n)=>{t[r]=o.apply(null,n),M.processClassAttribute(e,t)})}else e.push((e,n)=>{M.processClassAttribute(e,I(t,this.$classes,n))})}if(this.$styles){const t={},n=Object.keys(this.$styles);if(1===n.length){const r=n[0],o=this.$styles[r];e.push((e,n)=>{t[r]=o.apply(null,n),M.processStyleAttribute(e,t)})}else e.push((e,n)=>{M.processStyleAttribute(e,I(t,this.$styles,n))})}if(this.$attrs){const t={},n=Object.keys(this.$attrs);if(1===n.length){const r=n[0],o=this.$attrs[r];e.push((e,n)=>{t[r]=o.apply(null,n),M.processAttributes(e,t)})}else e.push((e,n)=>{M.processAttributes(e,I(t,this.$attrs,n))})}const t=e.length,n=this.$element;this.cloneNode=r=>{const o=n.cloneNode(!1);for(let n=0;n<t;n++)e[n](o,r);return o}},k.prototype.cloneNode=function(e){return this.$element.cloneNode(!1)},k.prototype.attach=function(e,t){return this.$ndMethods=this.$ndMethods||{},this.$ndMethods[e]=t,this},k.prototype.text=function(e){return this.$content=e,"function"==typeof e?(this.cloneNode=t=>Qr(e.apply(null,t)),this):(this.cloneNode=t=>Qr(t[0][e]),this)},k.prototype.attr=function(e,t){return"class"===e?(this.$classes=this.$classes||{},this.$classes[t.property]=t.value,this):"style"===e?(this.$styles=this.$styles||{},this.$styles[t.property]=t.value,this):(this.$attrs=this.$attrs||{},this.$attrs[e]=t.value,this)};function P(e){let t=null;const n=e=>{const t=e.childNodes;let r=!!e.nodeCloner;const o=t.length;for(let e=0;e<o;e++){const o=t[e];o.nodeCloner&&(r=!0);n(o)&&(r=!0)}return r?e.nodeCloner?(e.nodeCloner.resolve(),e.dynamicCloneNode=n=>{const r=e.nodeCloner.cloneNode(n);for(let e=0;e<o;e++)r.appendChild(t[e].dynamicCloneNode(n));return r}):e.dynamicCloneNode=n=>{const r=e.cloneNode();for(let e=0;e<o;e++)r.appendChild(t[e].dynamicCloneNode(n));return r}:e.dynamicCloneNode=e.cloneNode.bind(e,!0),r};this.clone=r=>{const o=L(this);return t=e(o),t.nodeCloner||(t.nodeCloner=new k(t)),n(t),this.clone=t.dynamicCloneNode,t.dynamicCloneNode(r)};const r=(e,t)=>new x((n,r)=>{!function(e,t,n,r){n.nodeCloner=n.nodeCloner||new k(n),"value"!==t?"attach"!==t?n.nodeCloner.attr(t,{property:r,value:e}):n.nodeCloner.attach(r,e):n.nodeCloner.text(e)}(e,t,n,r)});this.style=e=>r(e,"style"),this.class=e=>r(e,"class"),this.property=e=>this.value(e),this.value=e=>r(e,"value"),this.text=this.value,this.attr=e=>r(e,"attributes"),this.attach=e=>r(e,"attach"),this.callback=this.attach}const L=e=>new Proxy(e,{get:(e,t)=>t in e||"symbol"==typeof t?e[t]:e.value(t)});function R(e){let t=null,n=null;this.render=r=>{if(t||(t=e(this)),!n)return t;for(const e in n){(0,n[e])(...r)}return t},this.createSection=(e,t)=>{n=n||{};const r=Rr("Component "+e);return n[e]=function(...e){r.removeChildren(),t?r.appendChild(t(...e)):r.append(e)},r}}let j=e=>e;e.ArgTypes={},e.ArgTypes={string:()=>!0,number:()=>!0,boolean:()=>!0,observable:()=>!0,element:()=>!0,function:()=>!0,object:()=>!0,objectNotNull:()=>!0,children:()=>!0,attributes:()=>!0,optional:()=>!0,oneOf:()=>!0};const V=function(e,t=null){return e&&t?{props:e,children:t}:"object"!=typeof e||Array.isArray(e)||null===e||"Object"!==e.constructor.name||e.$hydrate?{props:t,children:e}:{props:e,children:t}};DocumentFragment.prototype.__IS_FRAGMENT=!0,Function.prototype.args=function(...e){return this},Function.prototype.cached=function(...e){let t,n=()=>t;return()=>(t||(t=this.apply(this,e),t.cloneNode?n=()=>t.cloneNode(!0):t.$element&&(n=()=>new jr(t.$element.cloneNode(!0)))),n())},Function.prototype.errorBoundary=function(e){const t=(...n)=>{try{return this.apply(this,n)}catch(r){return e(r,{caller:t,args:n})}};return t},String.prototype.use=function(e){const t=this;return h.computed(()=>t.replace(/\$\{(.*?)}/g,(t,n)=>{const r=e[n];return Hr.isObservable(r)?r.val():r}),Object.values(e))},String.prototype.resolveObservableTemplate=function(){return Hr.containsObservableReference(this)?this.split(/(\{\{#ObItem::\([0-9]+\)\}\})/g).filter(Boolean).map(e=>{if(!Hr.containsObservableReference(e))return e;const[t,n]=e.match(/\{\{#ObItem::\(([0-9]+)\)\}\}/);return h.getById(n)}):this.valueOf()};const B=function(e={}){let t=Hr.isString(e)?e.split(";").filter(Boolean):e;return{add(e,n){if(Array.isArray(t))t.push(e+": "+n);else if(Hr.isObject(e)){n=e;for(const e in n)t[e]=n[e]}else t[e]=n},value:()=>Array.isArray(t)?t.join(";").concat(";"):{...t}}},W=function(e=[]){let t=Hr.isString(e)?e.split(" ").filter(Boolean):e;return{add(e,n=!0){if(Hr.isJson(e))for(const n in e)e[n]&&(t[n]=e[n]);else if(null!=n||e.__$Observable)if(Array.isArray(t)&&(t=t.reduce((e,t)=>(e[t]=!0,e),{})),e.__$Observable){const n=`obs-${Math.random().toString(36).substr(2,9)}`;t[n]=e}else t[e]=n;else Array.isArray(t)?t.push(e):t[e]=n},value:()=>Array.isArray(t)?t.join(" "):{...t}}},q=e=>{let t=null;return(...n)=>(null!=t||(t=e(...n)),t)},U=e=>{let t=null;return new Proxy({},{get:(n,r)=>(t||(t=e()),t[r])})},H=e=>{const t=new Map;return new Proxy({},{get:(n,r)=>{const o=t.get(r);if(o)return o;if(e.length>0)return(...n)=>{const o=e(...n,r);return t.set(r,o),o};const s=e(r);return t.set(r,s),s}})};function z(e){return e instanceof Date?e:new Date(e)}function G(e,t){const n=z(e),r=z(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function K(e){const t=z(e);return 3600*t.getHours()+60*t.getMinutes()+t.getSeconds()}function J(e,t){const n=Hr.isObservable(e);return{dependencies:n?e:null,callback:r=>t(r,n?e.val():e)}}function Y(e,t){const n=e.filter(Hr.isObservable);return{dependencies:n.length>0?n:null,callback:n=>t(n,e.map(e=>Hr.isObservable(e)?e.val():e))}}function Q(e){return J(e,(e,t)=>e===t)}function X(e){return J(e,(e,t)=>e!==t)}function Z(e){return J(e,(e,t)=>e>t)}function ee(e){return J(e,(e,t)=>e>=t)}function te(e){return J(e,(e,t)=>e<t)}function ne(e){return J(e,(e,t)=>e<=t)}function re(e,t=!0,r=""){return Y([e,t,r],(e,[t,r,o])=>{if(!t)return!0;if(r)try{return new RegExp(t,o).test(String(e))}catch(e){return n.warn("Invalid regex pattern:",t,e),!1}return o&&""!==o?String(e).includes(String(t)):String(e).toLowerCase().includes(String(t).toLowerCase())})}function oe(...e){const t=e.flatMap(e=>e.dependencies?Array.isArray(e.dependencies)?e.dependencies:[e.dependencies]:[]).filter(Hr.isObservable);return{dependencies:t.length>0?t:null,callback:t=>e.every(e=>e.callback(t))}}function se(...e){const t=e.flatMap(e=>e.dependencies?Array.isArray(e.dependencies)?e.dependencies:[e.dependencies]:[]).filter(Hr.isObservable);return{dependencies:t.length>0?t:null,callback:t=>e.some(e=>e.callback(t))}}const ie=Z,ae=ee,le=te,ue=ne,ce=Q,pe=X,he=oe,de=se;function fe(e,t=!1){return J(e,(e,n)=>!!e&&(!n||(t?String(e).includes(String(n)):String(e).toLowerCase().includes(String(n).toLowerCase()))))}const me=fe;var be=Object.freeze({__proto__:null,all:he,and:oe,any:de,between:function(e,t){return Y([e,t],(e,[t,n])=>e>=t&&e<=n)},contains:me,createFilter:J,createMultiSourceFilter:Y,custom:function(e,...t){const n=t.filter(Hr.isObservable);return{dependencies:n.length>0?n:null,callback:n=>{const r=t.map(e=>Hr.isObservable(e)?e.val():e);return e(n,...r)}}},dateAfter:e=>J(e,(e,t)=>!(!e||!t)&&z(e)>z(t)),dateBefore:e=>J(e,(e,t)=>!(!e||!t)&&z(e)<z(t)),dateBetween:(e,t)=>Y([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=z(e);return r>=z(t)&&r<=z(n)}),dateEquals:e=>J(e,(e,t)=>!(!e||!t)&&G(e,t)),dateTimeAfter:e=>J(e,(e,t)=>!(!e||!t)&&z(e)>z(t)),dateTimeBefore:e=>J(e,(e,t)=>!(!e||!t)&&z(e)<z(t)),dateTimeBetween:(e,t)=>Y([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=z(e);return r>=z(t)&&r<=z(n)}),dateTimeEquals:e=>J(e,(e,t)=>!(!e||!t)&&z(e).getTime()===z(t).getTime()),endsWith:function(e,t=!1){return J(e,(e,n)=>!n||(t?String(e).endsWith(String(n)):String(e).toLowerCase().endsWith(String(n).toLowerCase())))},eq:ce,equals:Q,getSecondsOfDay:K,greaterThan:Z,greaterThanOrEqual:ee,gt:ie,gte:ae,inArray:function(e){return J(e,(e,t)=>t.includes(e))},includes:fe,isEmpty:function(e=!0){return J(e,(e,t)=>{const n=!e||""===e||Array.isArray(e)&&0===e.length;return t?n:!n})},isNotEmpty:function(e=!0){return J(e,(e,t)=>{const n=!!e&&""!==e&&(!Array.isArray(e)||e.length>0);return t?n:!n})},isSameDay:G,lessThan:te,lessThanOrEqual:ne,lt:le,lte:ue,match:re,neq:pe,not:function(e){return{dependencies:e.dependencies,callback:t=>!e.callback(t)}},notEquals:X,notIn:function(e){return J(e,(e,t)=>!t.includes(e))},or:se,startsWith:function(e,t=!1){return J(e,(e,n)=>!n||(t?String(e).startsWith(String(n)):String(e).toLowerCase().startsWith(String(n).toLowerCase())))},timeAfter:e=>J(e,(e,t)=>!(!e||!t)&&K(e)>K(t)),timeBefore:e=>J(e,(e,t)=>!(!e||!t)&&K(e)<K(t)),timeBetween:(e,t)=>Y([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=K(e);return r>=K(t)&&r<=K(n)}),timeEquals:e=>J(e,(e,t)=>{if(!e||!t)return!1;const n=z(e),r=z(t);return n.getHours()===r.getHours()&&n.getMinutes()===r.getMinutes()&&n.getSeconds()===r.getSeconds()}),toDate:z});const ye=function(e,t=null){if(!Array.isArray(e))throw new r("Observable.array : target must be an array");g.call(this,e,t)};(ye.prototype=Object.create(g.prototype)).constructor=ye,ye.prototype.__$isObservableArray=!0,Object.defineProperty(ye.prototype,"length",{get(){return this.$currentValue.length}}),ye.prototype.$mutate=function(e,t,n){if(this.$mutationInterceptor){const n=this.$mutationInterceptor(t,{action:e});void 0!==t&&(t=n)}n(t)},["push","pop","shift","unshift","reverse","sort","splice"].forEach(e=>{ye.prototype[e]=function(...t){return this.$mutate(e,t,t=>{const n=this.$currentValue[e].apply(this.$currentValue,t);return this.trigger({action:e,args:t,result:n}),n})}}),["map","forEach","filter","reduce","some","every","find","findIndex","concat","includes","indexOf"].forEach(e=>{ye.prototype[e]=function(...t){return this.$currentValue[e].apply(this.$currentValue,t)}});const ge={action:"clear"};ye.prototype.clear=function(){if(0!==this.$currentValue.length)return this.$mutate("clear",[],()=>{this.$currentValue.length=0,this.trigger(ge)}),!0},ye.prototype.at=function(e){return this.$currentValue[e]},ye.prototype.merge=function(e){this.$mutate("merge",e,e=>{this.$currentValue.push.apply(this.$currentValue,e),this.trigger({action:"merge",args:e})})},ye.prototype.count=function(e){let t=0;return this.$currentValue.forEach((n,r)=>{e(n,r)&&t++}),t},ye.prototype.swap=function(e,t){return this.$mutate("swap",[e,t],([e,t])=>{const n=this.$currentValue,r=n.length;if(t<e){const n=e;e=t,t=n}if(r<e||r<t)return!1;const o=n[e],s=n[t];n[e]=s,n[t]=o,this.trigger({action:"swap",args:[e,t],result:[o,s]})}),!0},ye.prototype.swapItems=function(e,t){const n=this.$currentValue.indexOf(e),r=this.$currentValue.indexOf(t);return this.swap(n,r)},ye.prototype.insertAfter=function(e,t){const n=this.$currentValue.indexOf(t);return this.splice(n+1,0,e)},ye.prototype.remove=function(e){let t=[];return this.$mutate("remove",[e],([e])=>{t=this.$currentValue.splice(e,1),0!==t.length&&this.trigger({action:"remove",args:[e],result:t[0]})}),t},ye.prototype.removeItem=function(e){const t=this.$currentValue.indexOf(e);return-1===t?[]:this.remove(t)},ye.prototype.empty=function(){return 0===this.$currentValue.length},ye.prototype.populateAndRender=function(e,t){this.trigger({action:"populate",args:[this.$currentValue,e,t]})},ye.prototype.where=function(e){"function"==typeof e&&(e={_:e});const t=this,n=[t],r={};for(const[t,o]of Object.entries(e)){const e=Hr.isObservable(o)?re(o,!1):o;if(e&&"object"==typeof e&&"callback"in e){if(r[t]=e.callback,e.dependencies){const t=Array.isArray(e.dependencies)?e.dependencies:[e.dependencies];n.push.apply(n,t)}}else r[t]="function"==typeof e?e:t=>t===e}const o=h.array(),s=Object.entries(r),i=()=>{const e=t.val().filter(e=>{for(const[t,n]of s)if("_"===t){if(!n(e))return!1}else if(!n(e[t]))return!1;return!0});o.set(e)};return n.forEach(e=>e.subscribe(i)),i(),o},ye.prototype.whereSome=function(e,t){return this.where({_:{dependencies:t.dependencies,callback:n=>e.some(e=>t.callback(n[e]))}})},ye.prototype.whereEvery=function(e,t){return this.where({_:{dependencies:t.dependencies,callback:n=>e.every(e=>t.callback(n[e]))}})},ye.prototype.deepSubscribe=function(e){const t=i(()=>e(this.val())),n=new WeakMap,r=e=>{n.has(e)||(e?.__$isObservableArray?n.set(e,e.deepSubscribe(t)):e?.__$isObservable&&(e.subscribe(t),n.set(e,()=>e.unsubscribe(t))))},o=e=>{const t=n.get(e);t&&(t(),n.delete(e))};return this.$currentValue.forEach(r),this.subscribe(t),this.subscribe((e,t,n)=>{switch(n?.action){case"push":case"unshift":case"merge":n.args.forEach(r);break;case"splice":{const[e,t,...s]=n.args;n.result?.forEach(o),s.forEach(r);break}case"remove":o(n.result);break;case"clear":this.$currentValue.forEach(o)}}),()=>{this.$currentValue.forEach(o)}},ye.prototype.sync=function(e){if(!e||!e.__$isObservableArray)throw new r("ObservableArray.sync : target must be an ObservableArray");e.set([...this.$currentValue]);const t=(t,n,r)=>{if(!r)return void e.set([...t]);const{action:o,args:s}=r;e[o].apply(e,s)};return this.subscribe(t),()=>this.unsubscribe(t)},ye.prototype.clone=function(){return new ye(this.resolve())},h.array=function(e=[],t=null){return new ye(e,t)},h.batch=function(e){const t=h(0),n=function(){if(Hr.isAsyncFunction(e))return e(...arguments).then(()=>{t.trigger()}).catch(e=>{throw e});e(...arguments),t.trigger()};return n.$observer=t,n};const ve=function(e,t){g.call(this,e),this.$observables={},this.configs=t,this.$load(e);for(const t in e)Object.hasOwn(this,t)||Object.defineProperty(this,t,{get:()=>this.$observables[t],set:e=>this.$observables[t].set(e)})};ve.prototype=Object.create(g.prototype),Object.defineProperty(ve,"$value",{get(){return this.val()},set(e){this.set(e)}}),ve.prototype.__$isObservableObject=!0,ve.prototype.__isProxy__=!0,ve.prototype.$load=function(e){const t=this.configs;for(const n in e){const r=e[n];if(Array.isArray(r)){if(!1!==t?.deep){const e=r.map(e=>Hr.isJson(e)?h.json(e,t):Hr.isArray(e)?h.array(e,t):h(e,t));this.$observables[n]=h.array(e,t);continue}this.$observables[n]=h.array(r,t)}else Hr.isObservable(r)||Hr.isProxy(r)?this.$observables[n]=r:this.$observables[n]="object"==typeof r?h.object(r,t):h(r,t)}},ve.prototype.val=function(){const e={};for(const t in this.$observables){const n=this.$observables[t];if(Hr.isObservable(n)){let r=n.val();Array.isArray(r)&&(r=r.map(e=>Hr.isObservable(e)?e.val():Hr.isProxy(e)?e.$value:e)),e[t]=r}else Hr.isProxy(n)?e[t]=n.$value:e[t]=n}return e},ve.prototype.$val=ve.prototype.val,ve.prototype.get=function(e){const t=this.$observables[e];return Hr.isObservable(t)?t.val():Hr.isProxy(t)?t.$value:t},ve.prototype.$get=ve.prototype.get,ve.prototype.set=function(e){const t=Hr.isProxy(e)?e.$value:e,n=this.configs;for(const r in t){const o=this.$observables[r],s=e[r],i=t[r];if(Hr.isObservable(o)){if(!Hr.isArray(i)){o.set(i);continue}const e=s.at(0);if(Hr.isObservable(e)||Hr.isProxy(e)){const t=i.map(t=>Hr.isProxy(e)?h.init(t,n):h(t,n));o.set(t);continue}o.set([...i]);continue}Hr.isProxy(o)?o.update(i):this[r]=i}},ve.prototype.$set=ve.prototype.set,ve.prototype.$updateWith=ve.prototype.set,ve.prototype.observables=function(){return Object.values(this.$observables)},ve.prototype.$observables=ve.prototype.observables,ve.prototype.keys=function(){return Object.keys(this.$observables)},ve.prototype.$keys=ve.prototype.keys,ve.prototype.clone=function(){return h.init(this.val(),this.configs)},ve.prototype.$clone=ve.prototype.clone,ve.prototype.reset=function(){for(const e in this.$observables)this.$observables[e].reset()},ve.prototype.originalSubscribe=ve.prototype.subscribe,ve.prototype.subscribe=function(e){const t=this.observables(),n=i(()=>this.trigger());this.originalSubscribe(e);for(let e=0,r=t.length;e<r;e++){const r=t[e];r.__$isObservableArray?r.deepSubscribe(n):r.subscribe(n)}},ve.prototype.configs=function(){return this.configs},ve.prototype.update=ve.prototype.set,h.init=function(e,t=null){return new ve(e,t)},h.arrayOfObject=function(e){return e.map(e=>h.object(e))},h.value=function(e){if(e?.__$isObservableArray){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.at(n);t.push(h.value(r))}return t}return e?.__$Observable?e.val():Hr.isProxy(e)?e.$value:e},g.prototype.resolve=function(){return h.value(this)},h.object=h.init,h.json=h.init,h.computed=function(e,t=[]){const n=new g(e()),o=i(()=>n.set(e(...t.map(e=>e.val()))));if(Hr.isFunction(t)){if(!Hr.isObservable(t.$observer))throw new r("Observable.computed : dependencies must be valid batch function");return t.$observer.subscribe(o),n}return t.forEach(e=>{Hr.isProxy(e)?e.$observables.forEach(e=>{e.subscribe(o)}):e.subscribe(o)}),n};const we=(e,t)=>h.computed(e,t),$e=(e,t)=>e.transform(t);g.prototype.isEqualTo=function(e){return e?.__$Observable?we((e,t)=>e===t,[this,e]):$e(this,t=>t===e)},g.prototype.isNotEqualTo=function(e){return e?.__$Observable?we((e,t)=>e!==t,[this,e]):$e(this,t=>t!==e)},g.prototype.isGreaterThan=function(e){return e?.__$Observable?we((e,t)=>e>t,[this,e]):$e(this,t=>t>e)},g.prototype.isGreaterThanOrEqualTo=function(e){return e?.__$Observable?we((e,t)=>e>=t,[this,e]):$e(this,t=>t>=e)},g.prototype.isLessThan=function(e){return e?.__$Observable?we((e,t)=>e<t,[this,e]):$e(this,t=>t<e)},g.prototype.isLessThanOrEqualTo=function(e){return e?.__$Observable?we((e,t)=>e<=t,[this,e]):$e(this,t=>t<=e)},g.prototype.isBetween=function(e,t){return e.__$Observable&&t.__$Observable?we((e,t,n)=>e>=t&&e<=n,[this,e,t]):e.__$Observable?we((e,n)=>e>=n&&e<=t,[this,e]):t.__$Observable?we((t,n)=>t>=e&&t<=n,[this,t]):$e(this,n=>n>=e&&n<=t)},g.prototype.isNull=function(){return $e(this,e=>null==e)},g.prototype.isTruthy=function(){return $e(this,e=>!!e)},g.prototype.isFalsy=function(){return $e(this,e=>!e)},g.prototype.isStartingWith=function(e){return e?.__$Observable?we((e,t)=>String(e).startsWith(t),[this,e]):$e(this,t=>String(t).startsWith(e))},g.prototype.isEndingWith=function(e){return e?.__$Observable?we((e,t)=>String(e).endsWith(t),[this,e]):$e(this,t=>String(t).endsWith(e))},g.prototype.isMatchingPattern=function(e){return e?.__$Observable?we((e,t)=>new RegExp(t).test(String(e)),[this,e]):$e(this,t=>e.test(String(t)))},g.prototype.isEmpty=function(){return $e(this,e=>null==e||""===e||Array.isArray(e)&&0===e.length)},g.prototype.isNotEmpty=function(){return $e(this,e=>null==e||""===e||Array.isArray(e)&&0!==e.length)},g.prototype.isIncludes=function(e){return e?.__$Observable?we((e,t)=>Array.isArray(e)?e.includes(t):String(e).includes(String(t)),[this,e]):$e(this,t=>Array.isArray(t)?t.includes(e):String(t).includes(String(e)))},g.prototype.isIncludedIn=function(e){return e?.__$Observable?we((e,t)=>t.includes(e),[this,e]):$e(this,t=>e.includes(t))},g.prototype.isOneOf=g.prototype.isIncludedIn,g.prototype.isHaving=function(e){return e?.__$Observable?we((e,t)=>t in Object(e),[this,e]):$e(this,t=>e in Object(t))},g.prototype.toUpperCase=function(){return $e(this,e=>String(e).toUpperCase())},g.prototype.toLowerCase=function(){return $e(this,e=>String(e).toLowerCase())},g.prototype.toTrimmed=function(){return $e(this,e=>String(e).trim())},g.prototype.toBoolean=function(){return $e(this,e=>!!e)},g.prototype.toLiteral=function(e,t="${v}"){return $e(this,n=>e.replace(t,n))},g.prototype.toFormatted=g.prototype.toLiteral,g.prototype.toProperty=function(e){const t=e.split(".");return $e(this,e=>{let n=e;for(const e of t){if(null==n)return;n=n[e]}return n})},g.prototype.toLength=function(){return $e(this,e=>null==e?0:e.length)},g.prototype.toClamped=function(e,t){return e.__$Observable&&t.__$Observable?we((e,t,n)=>Math.min(Math.max(e,t),n),[this,e,t]):e.__$Observable?we((e,n)=>Math.min(Math.max(e,n),t),[this,e]):t.__$Observable?we((t,n)=>Math.min(Math.max(t,e),n),[this,t]):$e(this,n=>Math.min(Math.max(n,e),t))},g.prototype.toPercent=function(e){return e?.__$Observable?we((e,t)=>0===t?0:e/t*100,[this,e]):$e(this,t=>0===e?0:t/e*100)};const Se=function(){const e=new Map,t=new Map,o=(t,o)=>{const s=e.get(o);if(!s)throw n.error("Store",`Store.${t}('${o}') : store not found. Did you call Store.create('${o}') first?`),new r(`Store.${t}('${o}') : store not found.`);return s},s=(e,t={})=>Array.isArray(e)?h.array(e,t):"object"==typeof e?h.object(e,t):h(e,t);return new Proxy({create(t,o){if(e.has(t))throw n.warn("Store",`Store.create('${t}') : a store with this name already exists. Use Store.get('${t}') to retrieve it.`),new r(`Store.create('${t}') : a store with this name already exists.`);const i=s(o);return e.set(t,{observer:i,subscribers:new Set,resettable:!1,composed:!1}),i},createResettable(t,o){if(e.has(t))throw n.warn("Store",`Store.createResettable('${t}') : a store with this name already exists.`),new r(`Store.createResettable('${t}') : a store with this name already exists.`);const i=s(o,{reset:!0});return e.set(t,{observer:i,subscribers:new Set,resettable:!0,composed:!1}),i},createComposed(t,o,s){if(e.has(t))throw n.warn("Store",`Store.createComposed('${t}') : a store with this name already exists.`),new r(`Store.createComposed('${t}') : a store with this name already exists.`);if("function"!=typeof o)throw new r(`Store.createComposed('${t}') : computation must be a function.`);if(!Array.isArray(s)||0===s.length)throw new r(`Store.createComposed('${t}') : dependencies must be a non-empty array of store names.`);const i=s.map(o=>{if("string"!=typeof o)return o;const s=e.get(o);if(!s)throw n.error("Store",`Store.createComposed('${t}') : dependency '${o}' not found. Create it first.`),new r(`Store.createComposed('${t}') : dependency store '${o}' not found.`);return s.observer}),a=h.computed(o,i);return e.set(t,{observer:a,subscribers:new Set,resettable:!1,composed:!0}),a},has:t=>e.has(t),reset(e){const t=o("reset",e);if(t.composed)throw n.error("Store",`Store.reset('${e}') : composed stores cannot be reset. Their value is derived from dependencies.`),new r(`Store.reset('${e}') : composed stores cannot be reset.`);if(!t.resettable)throw n.error("Store",`Store.reset('${e}') : this store is not resettable. Use Store.createResettable('${e}', value) instead of Store.create().`),new r(`Store.reset('${e}') : this store is not resettable. Use Store.createResettable('${e}', value) instead of Store.create().`);t.observer.reset()},use(e){const t=o("use",e);if(t.composed)throw n.error("Store",`Store.use('${e}') : composed stores are read-only. Use Store.follow('${e}') instead.`),new r(`Store.use('${e}') : composed stores are read-only. Use Store.follow('${e}') instead.`);const{observer:i,subscribers:a}=t,l=s(i.val()),u=e=>l.set(e),c=e=>i.set(e);return i.subscribe(u),l.subscribe(c),l.destroy=()=>{i.unsubscribe(u),l.unsubscribe(c),a.delete(l),l.cleanup()},l.dispose=l.destroy,a.add(l),l},follow(e){const{observer:t,subscribers:i}=o("follow",e),a=s(t.val()),l=e=>a.set(e);return t.subscribe(l),((e,t,o)=>{const s=e=>()=>{throw n.error("Store",`Store.${o}('${t}') is read-only. '${e}()' is not allowed.`),new r(`Store.${o}('${t}') is read-only.`)};e.set=s("set"),e.toggle=s("toggle"),e.reset=s("reset")})(a,e,"follow"),a.destroy=()=>{t.unsubscribe(l),i.delete(a),a.cleanup()},a.dispose=a.destroy,i.add(a),a},get(t){const r=e.get(t);return r?r.observer:(n.warn("Store",`Store.get('${t}') : store not found.`),null)},getWithSubscribers:t=>e.get(t)??null,delete(t){const r=e.get(t);r?(r.subscribers.forEach(e=>e.destroy()),r.subscribers.clear(),r.observer.cleanup(),e.delete(t)):n.warn("Store",`Store.delete('${t}') : store not found, nothing to delete.`)},group(e,t){"function"==typeof e&&(t=e,e="anonymous");const n=Se();return t&&t(n),n},createPersistent(e,t,n){n=n||e;const r=this.create(e,b(n,t)),o=y(t);return r.subscribe(e=>o(n,e)),r},createPersistentResettable(e,t,n){n=n||e;const r=this.createResettable(e,b(n,t)),o=y(t);r.subscribe(e=>o(n,e));const s=r.reset.bind(r);return r.reset=()=>{m.remove(n),s()},r}},{get(e,n){if("symbol"==typeof n||n.startsWith("$")||n in e)return e[n];if(e.has(n)){if(t.has(n))return t.get(n);const r=e.follow(n);return t.set(n,r),r}},set(e,t,o){throw n.error("Store",`Forbidden: You cannot overwrite the store key '${String(t)}'. Use .use('${String(t)}').set(value) instead.`),new r("Store structure is immutable. Use .set() on the observable.")},deleteProperty(e,t){throw new r("Store keys cannot be deleted.")}})},Ce=Se();Ce.create("locale",navigator.language.split("-")[0]||"en");const Oe=e=>e;const Ae=new Set(["clear","push","unshift","replace"]),Ee=e=>e;const _e=function(e,t,{comment:r=null,shouldKeepInCache:o=!0}={}){if(!Hr.isObservable(e))return"boolean"==typeof e?e?M.getChild(t):null:n.warn("ShowIf","ShowIf : condition must be an Observable or boolean / "+r,e);const s=Rr("Show if : "+(r||""));let i=null;const a=()=>(i&&o||(i=M.getChild(t),Hr.isFragment(i)&&(i=Array.from(i.childNodes))),i);return e.val()&&s.appendChild(a()),e.subscribe(e=>{e?s.appendChild(a()):s.remove()}),s},Ne=function(e,t,n=!0){if(!Hr.isObservable(e))throw new r("Toggle : condition must be an Observable");const o=Rr("Match"),s=new Map,i=function(e){if(n&&s.has(e))return s.get(e);let r=t[e];return r?(r=M.getChild(r),Hr.isFragment(r)&&(r=Array.from(r.children)),n&&s.set(e,r),r):null},a=e.val(),l=i(a);return l&&o.appendChild(l),e.subscribe(e=>{const t=i(e);o.remove(),t&&o.appendChild(t)}),o.nd.with({add(n,r,o=!1){t[n]=r,o&&e.set(n)},remove(r){n&&s.delete(r),e.set([...s.keys()].at(-1)??""),delete t[r]}})},xe=function(e,t,n){if(!Hr.isObservable(e))throw new r("Toggle : condition must be an Observable");return Ne(e.toBoolean(),{true:t,false:n})},Fe=Zr("div"),De=Zr("span"),Me=Zr("label"),Te=Zr("p"),ke=Te,Ie=Zr("strong"),Pe=Zr("h1"),Le=Zr("h2"),Re=Zr("h3"),je=Zr("h4"),Ve=Zr("h5"),Be=Zr("h6"),We=Zr("br"),qe=Zr("a"),Ue=Zr("pre"),He=Zr("code"),ze=Zr("blockquote"),Ge=Zr("hr"),Ke=Zr("em"),Je=Zr("small"),Ye=Zr("mark"),Qe=Zr("del"),Xe=Zr("ins"),Ze=Zr("sub"),et=Zr("sup"),tt=Zr("abbr"),nt=Zr("cite"),rt=Zr("q"),ot=Zr("dl"),st=Zr("dt"),it=Zr("dd"),at=Zr("form",function(e){return e.submit=function(t){return"function"==typeof t?(e.onSubmit(e=>{e.preventDefault(),t(e)}),e):(this.setAttribute("action",t),e)},e.multipartFormData=function(){return this.setAttribute("enctype","multipart/form-data"),e},e.post=function(t){return this.setAttribute("method","post"),this.setAttribute("action",t),e},e.get=function(e){this.setAttribute("method","get"),this.setAttribute("action",e)},e}),lt=Zr("input"),ut=Zr("textarea"),ct=ut,pt=Zr("select"),ht=Zr("fieldset"),dt=Zr("option"),ft=Zr("legend"),mt=Zr("datalist"),bt=Zr("output"),yt=Zr("progress"),gt=Zr("meter"),vt=Zr("button"),wt=Zr("main"),$t=Zr("section"),St=Zr("article"),Ct=Zr("aside"),Ot=Zr("nav"),At=Zr("figure"),Et=Zr("figcaption"),_t=Zr("header"),Nt=Zr("footer"),xt=Zr("img"),Ft=function(e,t){return xt({src:e,...t})},Dt=Zr("details"),Mt=Zr("summary"),Tt=Zr("dialog"),kt=Zr("menu"),It=Zr("ol"),Pt=Zr("ul"),Lt=Zr("li"),Rt=Lt,jt=It,Vt=Pt,Bt=Zr("audio"),Wt=Zr("video"),qt=Zr("source"),Ut=Zr("track"),Ht=Zr("canvas"),zt=Zr("svg"),Gt=Zr("time"),Kt=Zr("data"),Jt=Zr("address"),Yt=Zr("kbd"),Qt=Zr("samp"),Xt=Zr("var"),Zt=Zr("wbr"),en=Zr("caption"),tn=Zr("table"),nn=Zr("thead"),rn=Zr("tfoot"),on=Zr("tbody"),sn=Zr("tr"),an=sn,ln=Zr("th"),un=ln,cn=ln,pn=Zr("td"),hn=pn;function dn(e){let t=null,n=(r,o)=>(t=document.createElementNS("http://www.w3.org/2000/svg",e),n=(e,n)=>Xr(t.cloneNode(),e,n),Xr(t.cloneNode(),r,o));return(e,t)=>n(e,t)}const fn=dn("svg"),mn=dn("circle"),bn=dn("rect"),yn=dn("ellipse"),gn=dn("line"),vn=dn("polyline"),wn=dn("polygon"),$n=dn("path"),Sn=dn("text"),Cn=dn("tspan"),On=dn("textPath"),An=dn("g"),En=dn("defs"),_n=dn("use"),Nn=dn("symbol"),xn=dn("clipPath"),Fn=dn("mask"),Dn=dn("marker"),Mn=dn("pattern"),Tn=dn("image"),kn=dn("foreignObject"),In=dn("switch"),Pn=dn("linearGradient"),Ln=dn("radialGradient"),Rn=dn("stop"),jn=dn("filter"),Vn=dn("feBlend"),Bn=dn("feColorMatrix"),Wn=dn("feComposite"),qn=dn("feFlood"),Un=dn("feGaussianBlur"),Hn=dn("feMerge"),zn=dn("feMergeNode"),Gn=dn("feOffset"),Kn=dn("feTurbulence"),Jn=dn("feDisplacementMap"),Yn=dn("feDiffuseLighting"),Qn=dn("feSpecularLighting"),Xn=dn("feDistantLight"),Zn=dn("fePointLight"),er=dn("feSpotLight"),tr=dn("feMorphology"),nr=dn("feConvolveMatrix"),rr=dn("feComponentTransfer"),or=dn("feFuncR"),sr=dn("feFuncG"),ir=dn("feFuncB"),ar=dn("feFuncA"),lr=dn("animate"),ur=dn("animateTransform"),cr=dn("animateMotion"),pr=dn("mpath"),hr=dn("set"),dr=dn("desc"),fr=dn("title"),mr=dn("metadata"),br=dn("view"),yr=dn("style"),gr=dn("script"),vr=Zr("");var wr=Object.freeze({__proto__:null,Abbr:tt,Address:Jt,Anchor:Rr,Article:St,Aside:Ct,AsyncImg:function(e,t,n,o){const s=Hr.isObservable(e)?e.val():e,i=Ft(t||s,n),a=new Image;return a.onload=()=>{Hr.isFunction(o)&&o(null,i),i.src=Hr.isObservable(e)?e.val():e},a.onerror=()=>{Hr.isFunction(o)&&o(new r("Image not found"))},Hr.isObservable(e)&&e.subscribe(e=>{a.src=e}),a.src=s,i},Audio:Bt,BaseImage:xt,Blockquote:ze,Br:We,Button:vt,Canvas:Ht,Caption:en,Checkbox:e=>lt({type:"checkbox",...e}),Cite:nt,Code:He,ColorInput:e=>lt({type:"color",...e}),Data:Kt,Datalist:mt,DateInput:e=>lt({type:"date",...e}),DateTimeInput:e=>lt({type:"datetime-local",...e}),Dd:it,Del:Qe,Details:Dt,Dialog:Tt,Div:Fe,Dl:ot,Dt:st,Em:Ke,EmailInput:e=>lt({type:"email",...e}),FieldSet:ht,FigCaption:Et,Figure:At,FileInput:e=>lt({type:"file",...e}),Footer:Nt,ForEach:function(e,t,o,{shouldKeepItemsInCache:s=!1}={}){t=t||Oe;const i=Rr("ForEach"),a=i.endElement();i.startElement();let l=new Map,u=null;const c=new Set,p=e=>{if(!s)for(const[t,n]of l.entries()){if(c.has(t))continue;const r=n.child?.deref();e&&r&&r.remove(),n.indexObserver?.cleanup(),n.child=null,n.indexObserver=null,l.delete(n.keyId),u&&u.delete(n.keyId)}},d=(e,s)=>{const i=((e,t,n)=>{if(Hr.isString(n)){const r=Hr.isObservable(e)?e.val():e,o=r?.[n];return Hr.isObservable(o)?o.val():o??t}return Hr.isFunction(n)?n(e,t):(Hr.isObservable(e)?e.val():e)??t})(e,s,o);if(l.has(i)){const e=l.get(i);if(e.indexObserver?.set(s),e.isNew=!1,e.child?.deref())return i;l.delete(i)}try{const n=t.length>=2?h(s):null;let o=M.getChild(t(e,n));if(!o)throw new r("ForEach child can't be null or undefined!");l.set(i,{keyId:i,isNew:!0,child:new WeakRef(o),indexObserver:n})}catch(e){throw n.error("ForEach",`Error creating element for key ${i}`,e),e}return i},f=()=>{const t=a.parentNode;if(!t)return;const n=Hr.isObservable(e)?e.val():e;if(c.clear(),Array.isArray(n))for(let e=0,t=n.length;e<t;e++){const t=d(n[e],e);c.add(t)}else for(const e in n){const t=d(n[e],e);c.add(t)}if(0===c.size)return i.removeChildren(),p(),void u?.clear();p(t),u&&0!==u.size?(()=>{let e=document.createDocumentFragment();const t=Array.from(c);Array.from(u);for(const n in t){const r=t[n],o=l.get(r);if(!o)continue;const s=o.child.deref();s&&e.appendChild(s)}i.replaceContent(e)})():(e=>{const t=document.createDocumentFragment();for(const e of c){const n=l.get(e);if(!n)continue;const r=n.child?.deref();r&&t.appendChild(r)}e.insertBefore(t,a)})(t),u?.clear(),u=new Set([...c])};return f(),Hr.isObservable(e)&&e.subscribe(f),i},ForEachArray:function(e,t,n={}){t=t||Ee;const r=Rr("ForEach Array",n.isParentUniqueChild),o=r.endElement();let s=new Map,i=0;const a=t.length>=2,l=e=>{r.removeChildren(),f(e),i=0},u=e=>s.get(e)?.child,c=(e,t=!0)=>{const n=s.get(e);if(n){if(t){const t=n.child;t?.remove(),s.delete(e)}n.indexObserver?.cleanup()}},p=e=>{const n=M.getChild(t(e,null));return s.set(e,{child:n,indexObserver:null}),n};let h=(n,r)=>{const o=e.transform(e=>e.indexOf(n)),i=M.getChild(t(n,o));return s.set(n,{child:i,indexObserver:o}),i};e.__$Observable||(h=(e,n)=>{const r=M.getChild(t(e,n));return s.set(e,{child:r,indexObserver:null}),r});const d=(e,t)=>{const n=s.get(e);return n?(n.indexObserver?.set(t),n.child):p(e)};let f,m=p;f=a?n.shouldKeepItemsInCache?()=>{}:e=>{for(const[t,n]of s.entries())e&&e.includes(t)||c(t,!1)}:s.clear.bind(s);const b=(e,t)=>{const n=s.get(e);if(!n)return null;const r=n.child;if(!r)return null;t?t.appendChild(r):r.remove()};let y=null;y=Array.isArray(e)?()=>{l(e),r.appendChildRaw(g.toFragment(e))}:()=>{const t=e.val();l(t),r.appendChildRaw(g.toFragment(t))};const g={toFragment:e=>{const t=document.createDocumentFragment();for(let n=0,r=e.length;n<r;n++)t.appendChild(m(e[n],i)),i++;return t},add:e=>{r.appendChildRaw(g.toFragment(e))},replace:e=>{l(e),r.appendChildRaw(g.toFragment(e))},set:y,reOrder:e=>{let t=null;const n=document.createDocumentFragment();for(const r of e)t=u(r),t&&n.appendChild(t);t=null,r.appendElementRaw(n)},removeOne:(e,t)=>{c(e,!0)},clear:l,populate:([e,t,n])=>{const o=document.createDocumentFragment();for(let r=0;r<t;r++){const t=n(r);e.push(t),o.append(m(t,r)),i++}r.appendChildRaw(o),o.replaceChildren()},unshift:e=>{r.insertAtStartRaw(g.toFragment(e))},splice:(t,n)=>{const[s,i,...a]=t;let l=null;const c=document.createDocumentFragment();if(n.length>0){let e=n[0];if(1===n.length)b(e,c);else if(n.length>1){const e=u(n[0]);l=e?.previousSibling;for(let e=0;e<n.length;e++)b(n[e],c)}}else{const t=s-1>=0?s-1:s,n=e.at(t);l=u(n)||o.previousSibling}c.replaceChildren(),a&&a.length&&l&&r.insertBeforeRaw(g.toFragment(a),l.nextSibling)},reverse:(e,t)=>{g.reOrder(t)},sort:(e,t)=>{g.reOrder(t)},remove:(e,t)=>{g.removeOne(t)},pop:(e,t)=>{g.removeOne(t)},shift:(e,t)=>{g.removeOne(t)},swap:(e,t)=>{const n=r.getParent();let o=u(t[0]),s=u(t[1]);if(!o||!s)return;const i=s.nextSibling;n.insertBefore(s,o),n.insertBefore(o,i),o=null,s=null}};g.merge=g.add,g.push=g.add;const v=(e,t,n={})=>{((e=null)=>{m=Ae.has(e)?a?h:p:s.size?d:a?h:p})(n.action),g[n.action]&&g[n.action](n.args,n.result)};return Array.isArray(e)?(v(0,0,{action:"set"}),r):(e.val().length&&v(e.val(),0,{action:"set"}),e.subscribe(v),r)},Form:at,Fragment:vr,H1:Pe,H2:Le,H3:Re,H4:je,H5:Ve,H6:Be,Header:_t,HiddenInput:e=>lt({type:"hidden",...e}),HideIf:function(e,t,n){const r=h(!e.val());return e.subscribe(e=>r.set(!e)),_e(r,t,n)},HideIfNot:function(e,t,n){return _e(e,t,n)},Hr:Ge,Img:Ft,Input:lt,Ins:Xe,Kbd:Yt,Label:Me,LazyImg:function(e,t){return Ft(e,{...t,loading:"lazy"})},Legend:ft,Li:Rt,Link:qe,ListItem:Lt,Main:wt,Mark:Ye,Match:Ne,Menu:kt,Meter:gt,MonthInput:e=>lt({type:"month",...e}),NativeDocumentFragment:Rr,Nav:Ot,NumberInput:e=>lt({type:"number",...e}),Ol:jt,Option:dt,OrderedList:It,Output:bt,P:Te,Paragraph:ke,PasswordInput:e=>lt({type:"password",...e}),Pre:Ue,Progress:yt,Quote:rt,Radio:e=>lt({type:"radio",...e}),RangeInput:e=>lt({type:"range",...e}),ReadonlyInput:e=>lt({readonly:!0,...e}),Samp:Qt,SearchInput:e=>lt({type:"search",...e}),Section:$t,Select:pt,ShowIf:_e,ShowWhen:function(){if(2===arguments.length){const[e,t]=arguments;if(!Hr.isObservableWhenResult(e))throw new r("showWhen observer must be an ObservableWhenResult",{data:e,help:"Use observer.when(target) to create an ObservableWhenResult"});return _e(e,t)}if(3===arguments.length){const[e,t,n]=arguments;if(!Hr.isObservable(e))throw new r("showWhen observer must be an Observable",{data:e});return _e(e.when(t),n)}throw new r("showWhen must have 2 or 3 arguments",{data:["showWhen(observer, target, view)","showWhen(observerWhenResult, view)"]})},SimpleButton:(e,t)=>vt(e,{type:"button",...t}),Small:Je,Source:qt,Span:De,Strong:Ie,Sub:Ze,SubmitButton:(e,t)=>vt(e,{type:"submit",...t}),Summary:Mt,Sup:et,Svg:zt,SvgAnimate:lr,SvgAnimateMotion:cr,SvgAnimateTransform:ur,SvgCircle:mn,SvgClipPath:xn,SvgDefs:En,SvgDesc:dr,SvgEllipse:yn,SvgFEBlend:Vn,SvgFEColorMatrix:Bn,SvgFEComponentTransfer:rr,SvgFEComposite:Wn,SvgFEConvolveMatrix:nr,SvgFEDiffuseLighting:Yn,SvgFEDisplacementMap:Jn,SvgFEDistantLight:Xn,SvgFEFlood:qn,SvgFEFuncA:ar,SvgFEFuncB:ir,SvgFEFuncG:sr,SvgFEFuncR:or,SvgFEGaussianBlur:Un,SvgFEMerge:Hn,SvgFEMergeNode:zn,SvgFEMorphology:tr,SvgFEOffset:Gn,SvgFEPointLight:Zn,SvgFESpecularLighting:Qn,SvgFESpotLight:er,SvgFETurbulence:Kn,SvgFilter:jn,SvgForeignObject:kn,SvgG:An,SvgImage:Tn,SvgLine:gn,SvgLinearGradient:Pn,SvgMPath:pr,SvgMarker:Dn,SvgMask:Fn,SvgMetadata:mr,SvgPath:$n,SvgPattern:Mn,SvgPolygon:wn,SvgPolyline:vn,SvgRadialGradient:Ln,SvgRect:bn,SvgScript:gr,SvgSet:hr,SvgStop:Rn,SvgStyle:yr,SvgSvg:fn,SvgSwitch:In,SvgSymbol:Nn,SvgTSpan:Cn,SvgText:Sn,SvgTextPath:On,SvgTitle:fr,SvgUse:_n,SvgView:br,Switch:xe,TBody:on,TBodyCell:hn,TFoot:rn,TFootCell:cn,THead:nn,THeadCell:un,TRow:an,Table:tn,Td:pn,TelInput:e=>lt({type:"tel",...e}),TextArea:ut,TextInput:ct,Th:ln,Time:Gt,TimeInput:e=>lt({type:"time",...e}),Tr:sn,Track:Ut,Ul:Vt,UnorderedList:Pt,UrlInput:e=>lt({type:"url",...e}),Var:Xt,Video:Wt,Wbr:Zt,WeekInput:e=>lt({type:"week",...e}),When:function(e){if(!Hr.isObservable(e))throw new r("When : condition must be an Observable");let t=null,n=null;return{show(e){return t=e,this},otherwise:r=>(n=r,xe(e,t,n)),toNdElement:()=>xe(e,t,n)}},createPortal:function(e,{parent:t,name:n="unnamed"}={}){const r=Rr("Portal "+n);return r.appendChild(M.getChild(e)),(t||document.body).appendChild(r),r}});const $r={};function Sr(e,t,n={}){e="/"+a(e,"/").replace(/\/+/,"/");let r=null,o=n.name||null;const s=n.middlewares||[],i=n.shouldRebuild||!1,l=n.with||{},u=n.layout||null,c={},p=[],h=e=>{if(!e)return null;const[t,n]=e.split(":");let r=l[t];return!r&&n&&(r=$r[n]),r||(r="[^/]+"),r=r.replace("(","(?:"),{name:t,pattern:`(${r})`}},d=()=>{if(r)return r;const t=e.replace(/\{(.*?)}/gi,(e,t)=>{const n=h(t);return n&&n.pattern?(c[n.name]=n.pattern,p.push(n.name),n.pattern):e});return r=new RegExp("^"+t+"$"),r};this.name=()=>o,this.component=()=>t,this.middlewares=()=>s,this.shouldRebuild=()=>i,this.path=()=>e,this.layout=()=>u,this.match=function(e){e="/"+a(e,"/");if(!d().exec(e))return!1;const t={};return d().exec(e).forEach((e,n)=>{if(n<1)return;const r=p[n-1];t[r]=e}),t},this.url=function(t){const n=e.replace(/\{(.*?)}/gi,(e,n)=>{const r=h(n);if(t.params&&t.params[r.name])return t.params[r.name];throw new Error(`Missing parameter '${r.name}'`)}),r="object"==typeof t.query?new URLSearchParams(t.query).toString():null;return(t.basePath?t.basePath:"")+(r?`${n}?${r}`:n)}}class Cr extends Error{constructor(e,t){super(e),this.context=t}}const Or=(e,t)=>{const n=[];return e.forEach(e=>{n.push(a(e.suffix,"/"))}),n.push(a(t,"/")),n.join("/")},Ar=(e,t)=>{const n=[];return e.forEach(e=>{e.options.middlewares&&n.push(...e.options.middlewares)}),t&&n.push(...t),n},Er=(e,t)=>{const n=[];return e.forEach(e=>{e.options?.name&&n.push(e.options.name)}),t&&n.push(t),n.join(".")},_r=e=>{for(let t=e.length-1;t>=0;t--)if(e[t]?.options?.layout)return e[t].options.layout;return null};function Nr(){const e=[];let t=0;const n=n=>{const o=t+n;if(!e[o])return;t=o;const{route:s,params:i,query:a,path:l}=e[o];r(l)},r=e=>{window.location.replace(`${window.location.pathname}${window.location.search}#${e}`)},o=()=>window.location.hash.slice(1);this.push=function(n){const{route:s,params:i,query:a,path:l}=this.resolve(n);l!==o()&&(e.splice(t+1),e.push({route:s,params:i,query:a,path:l}),t++,r(l))},this.replace=function(n){const{route:r,params:s,query:i,path:a}=this.resolve(n);a!==o()&&(e[t]={route:r,params:s,query:i,path:a})},this.forward=function(){return t<e.length-1&&n(1)},this.back=function(){return t>0&&n(-1)},this.init=function(n){window.addEventListener("hashchange",()=>{const{route:e,params:t,query:n,path:r}=this.resolve(o());this.handleRouteChange(e,t,n,r)});const{route:r,params:s,query:i,path:a}=this.resolve(n||o());e.push({route:r,params:s,query:i,path:a}),t=0,this.handleRouteChange(r,s,i,a)}}function xr(){this.push=function(e){try{const{route:t,path:n,params:r,query:o}=this.resolve(e);if(window.history.state&&window.history.state.path===n)return;window.history.pushState({name:t.name(),params:r,path:n},t.name()||n,n),this.handleRouteChange(t,r,o,n)}catch(e){n.error("HistoryRouter","Error in pushState",e)}},this.replace=function(e){const{route:t,path:r,params:o}=this.resolve(e);try{window.history.replaceState({name:t.name(),params:o,path:r},t.name()||r,r),this.handleRouteChange(t,o,{},r)}catch(e){n.error("HistoryRouter","Error in replaceState",e)}},this.forward=function(){window.history.forward()},this.back=function(){window.history.back()},this.init=function(e){window.addEventListener("popstate",e=>{try{if(!e.state||!e.state.path)return;const t=e.state.path,{route:n,params:r,query:o,path:s}=this.resolve(t);if(!n)return;this.handleRouteChange(n,r,o,s)}catch(e){n.error("HistoryRouter","Error in popstate event",e)}});const{route:t,params:r,query:o,path:s}=this.resolve(e||window.location.pathname+window.location.search);this.handleRouteChange(t,r,o,s)}}function Fr(){const e=[];let t=0;const n=n=>{const r=t+n;if(!e[r])return;t=r;const{route:o,params:s,query:i,path:a}=e[r];this.handleRouteChange(o,s,i,a)};this.push=function(n){const{route:r,params:o,query:s,path:i}=this.resolve(n);e[t]&&e[t].path===i||(e.splice(t+1),e.push({route:r,params:o,query:s,path:i}),t++,this.handleRouteChange(r,o,s,i))},this.replace=function(n){const{route:r,params:o,query:s,path:i}=this.resolve(n);e[t]={route:r,params:o,query:s,path:i},this.handleRouteChange(r,o,s,i)},this.forward=function(){return t<e.length-1&&n(1)},this.back=function(){return t>0&&n(-1)},this.init=function(n){const r=n||window.location.pathname+window.location.search,{route:o,params:s,query:i,path:a}=this.resolve(r);e.push({route:o,params:s,query:i,path:a}),t=0,this.handleRouteChange(o,s,i,a)}}function Dr(e,t){const n=new Map,r=new WeakMap,o=new WeakMap;let s=null,i=null;const a=(e,t)=>{const n=o.get(e);if(n)return n;let r=e;return Hr.isAnchor(e)||(r=Rr(t),r.appendChild(e)),o.set(e,r),r},l=()=>{Hr.isAnchor(i)&&i.remove()},u=()=>{t.nodeValue="",l(),s&&s.remove()},c=e=>{let t=e;return Hr.isNDElement(e)&&(t=e.node()),t},p=function(e,n,o){const p=n.layout();if(p)return void((e,n,o,p)=>{let h=c(n);const d=r.get(h);if(d){if(d===s){const e=a(h,p);return l(),i=h,void e.replaceContent(h)}return u(),i=h,s=d,a(h,p).replaceContent(h),void t.appendChild(s)}u(),i=h;const f=a(h,p);s=M.getChild(e(f)),r.set(h,s),t.appendChild(s)})(p,e,0,o);let h=c(e);u(),t.appendChild(h),i=e},h=function(e){if(!e.route)return;const{route:t,params:r,query:o,path:s}=e;if(n.has(s)){const e=n.get(s);return void p(e,t)}const i=t.component()({params:r,query:o});n.set(s,i),p(i,t,s)};return e.subscribe(h),h(e.currentState()),t}const Mr="default";function Tr(e={}){const t=[],r={},o=[],s=[],i={route:null,params:null,query:null,path:null,hash:null};if("hash"===e.mode)Nr.apply(this,[]);else if("history"===e.mode)xr.apply(this,[]);else{if("memory"!==e.mode)throw new Cr("Invalid router mode "+e.mode);Fr.apply(this,[])}const l=function(e,t){for(const r of s)try{r(e),t&&t(e)}catch(e){n.warn("Route Listener","Error in listener:",e)}};this.routes=()=>[...t],this.currentState=()=>({...i}),this.add=function(e,n,s){const i=new Sr(Or(o,e),n,{...s,middlewares:Ar(o,s?.middlewares||[]),name:s?.name?Er(o,s.name):null,layout:s?.layout||_r(o)});return t.push(i),i.name()&&(r[i.name()]=i),this},this.group=function(e,t,n){if(!Hr.isFunction(n))throw new Cr("Callback must be a function");return o.push({suffix:e,options:t}),n(),o.pop(),this},this.generateUrl=function(e,t={},n={}){const o=r[e];if(!o)throw new Cr(`Route not found for name: ${e}`);return o.url({params:t,query:n})},this.resolve=function(e){if("string"==typeof e){const t=r[e];if(t)return{route:t,params:[],query:[],path:t.url({name:e})}}if(Hr.isJson(e)){const t=r[e.name];if(!t)throw new Cr(`Route not found for name: ${e.name}`);return{route:t,params:e.params,query:e.query,path:t.url({...e})}}const[n,o]=e.split("?"),s="/"+a(n,"/");let i,l=null;for(const e of t)if(i=e.match(s),i){l=e;break}if(!l)throw new Cr(`Route not found for url: ${n}`);const u={};if(o){const e=new URLSearchParams(o).entries();for(const[t,n]of e)u[t]=n}return{route:l,params:i,query:u,path:e}},this.subscribe=function(e){if(!Hr.isFunction(e))throw new Cr("Listener must be a function");return s.push(e),()=>{s.splice(s.indexOf(e),1)}},this.handleRouteChange=function(e,t,n,r){i.route=e,i.params=t,i.query=n,i.path=r;const o=[...e.middlewares(),l];let s=0;const a={...i},u=e=>{if(s++,!(s>=o.length))return o[s](e||a,u)};return o[s](a,u)}}function kr(e,t){const{to:n,href:r,...o}=e;if(r){const e=Tr.get();return qe({...o,href:r},t).nd.onPreventClick(()=>{e.push(r)})}const s="string"==typeof n?{name:n}:n,i=s.router||Mr,a=Tr.get(i);if(!a)throw new Cr('Router not found "'+i+'" for link "'+s.name+'"');const l=a.generateUrl(s.name,s.params,s.query);return qe({...o,href:l},t).nd.onPreventClick(()=>{a.push(l)})}Tr.routers={},Tr.create=function(e,t){if(!Hr.isFunction(t))throw n.error("Router","Callback must be a function"),new Cr("Callback must be a function");const r=new Tr(e);return Tr.routers[e.name||Mr]=r,t(r),r.init(e.entry),r.mount=function(e){if(Hr.isString(e)){const t=document.querySelector(e);if(!t)throw new Cr(`Container not found for selector: ${e}`);e=t}else if(!Hr.isElement(e))throw new Cr("Container must be a string or an Element");return Dr(r,e)},r},Tr.get=function(e){const t=Tr.routers[e||Mr];if(!t)throw new Cr(`Router not found for name: ${e}`);return t},Tr.push=function(e,t=null){return Tr.get(t).push(e)},Tr.replace=function(e,t=null){return Tr.get(t).replace(e)},Tr.forward=function(e=null){return Tr.get(e).forward()},Tr.back=function(e=null){return Tr.get(e).back()},Tr.redirectTo=function(e,t=null,n=null){let r=e;const o=Tr.get(n);return o.resolve({name:e,params:t})&&(r={name:e,params:t}),o.push(r)},kr.blank=function(e,t){return qe({...e,target:"_blank"},t)};var Ir=Object.freeze({__proto__:null,Link:kr,RouteParamPatterns:$r,Router:Tr});var Pr=Object.freeze({__proto__:null,memoize:e=>H(e),once:e=>U(e),singleton:e=>q(e)}),Lr=Object.freeze({__proto__:null,Cache:Pr,NativeFetch:function(e){const t={request:[],response:[]};this.interceptors={response:e=>{t.response.push(e)},request:e=>{t.request.push(e)}},this.fetch=async function(n,r,o={},s={}){if(s.formData){const e=new FormData;for(const t in o)e.append(t,o[t]);o=e}r.startsWith("http")||(r=(e.endsWith("/")?e:e+"/")+r);let i={method:n,headers:{...s.headers||{}}};if(o)if(o instanceof FormData)i.body=o;else if("GET"!==n)i.headers["Content-Type"]="application/json",i.body=JSON.stringify(o);else{const e=new URLSearchParams(o).toString();e&&(r=r+(r.includes("?")?"&":"?")+e)}for(const e of t.request)i=await e(i,r)||i;let a=await fetch(r,i);for(const e of t.response)a=await e(a,r)||a;const l=(a.headers.get("content-type")||"").includes("application/json")?await a.json():await a.text();if(!a.ok){const e=new Error(l?.message||a.statusText);throw e.status=a.status,e.data=l,e}return l},this.post=function(e,t={},n={}){return this.fetch("POST",e,t,n)},this.put=function(e,t={},n={}){return this.fetch("PUT",e,t,n)},this.delete=function(e,t={},n={}){return this.fetch("DELETE",e,t,n)},this.get=function(e,t={},n={}){return this.fetch("GET",e,t,n)}},classPropertyAccumulator:W,cssPropertyAccumulator:B,filters:be});function Rr(e,t=!1){const n=new T(e);n.onConnectedOnce(e=>{t&&function(e,t){e.remove=()=>{e.append.apply(e,t.childNodes)},e.getParent=()=>t,e.appendChild=e=>{e=Hr.isElement(e)?e:M.getChild(e),t.appendChild(e)},e.appendChildRaw=t.appendChild.bind(t),e.append=e.appendChild,e.appendRaw=e.appendChildRaw,e.insertAtStart=e=>{e=Hr.isElement(e)?e:M.getChild(e),t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},e.insertAtStartRaw=e=>{t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},e.appendElement=e.appendChild,e.removeChildren=()=>{t.textContent=""},e.replaceContent=function(e){const n=Hr.isElement(e)?e:M.getChild(e);t.replaceChildren(n)},e.replaceContentRaw=function(e){t.replaceChildren(e)},e.setContent=e.replaceContent,e.insertBefore=(e,n)=>{e=Hr.isElement(e)?e:M.getChild(e),t.insertBefore(e,n)},e.insertBeforeRaw=(e,n)=>{t.insertBefore(e,n)},e.appendChildBefore=e.insertBefore,e.appendChildBeforeRaw=e.insertBeforeRaw,e.clear=e.remove,e.detach=e.remove,e.replaceChildren=function(){t.replaceChildren(...arguments)},e.getByIndex=e=>t.childNodes[e]}(n,e)}),n.__Anchor__=!0;const r=n.$start,o=n.$end;n.nativeInsertBefore=n.insertBefore,n.nativeAppendChild=n.appendChild,n.nativeAppend=n.append;const s=t?()=>!0:e=>e.firstChild===r&&e.lastChild===o,i=(e,t,r)=>{e!==n?s(e)&&r===o?e.append(t,r):e.insertBefore(t,r):e.nativeInsertBefore(t,r)};return n.appendElement=function(e){const t=r.parentNode;t!==n?t.insertBefore(e,o):t.nativeInsertBefore(e,o)},n.appendChild=function(e,t=null){const n=o.parentNode;n?((e,t,n)=>{const r=Hr.isElement(t)?t:M.getChild(t);i(e,r,n)})(n,e,t=t??o):DebugManager.error("Anchor","Anchor : parent not found",e)},n.appendChildRaw=function(e,t=null){const n=o.parentNode;n?i(n,e,t=t??o):DebugManager.error("Anchor","Anchor : parent not found",e)},n.getParent=()=>o.parentNode,n.append=n.appendChild,n.appendRaw=n.appendChildRaw,n.insertAtStart=function(e){e=Hr.isElement(e)?e:M.getChild(e),n.insertAtStartRaw(e)},n.insertAtStartRaw=function(e){const t=r.parentNode;t!==n?t.insertBefore(e,r):t.nativeInsertBefore(e,r)},n.removeChildren=function(){const e=o.parentNode;if(e===n)return;if(s(e))return void e.replaceChildren(r,o);let t,i=r.nextSibling;for(;i&&i!==o;)t=i.nextSibling,i.remove(),i=t},n.remove=function(){const e=o.parentNode;if(e===n)return;if(s(e))return n.nativeAppend.apply(n,e.childNodes),void e.replaceChildren(r,o);let t,i=r.nextSibling;for(;i&&i!==o;)t=i.nextSibling,n.nativeAppend(i),i=t},n.removeWithAnchors=function(){n.removeChildren(),r.remove(),o.remove()},n.delete=n.removeWithAnchors,n.replaceContent=function(e){const t=Hr.isElement(e)?e:M.getChild(e);n.replaceContentRaw(t)},n.replaceContentRaw=function(e){const t=o.parentNode;t&&(s(t)?t.replaceChildren(r,e,o):(n.removeChildren(),t.insertBefore(e,o)))},n.setContent=n.replaceContent,n.setContentRaw=n.replaceContentRaw,n.insertBefore=n.appendChild,n.insertBeforeRaw=n.appendChildRaw,n.endElement=function(){return o},n.startElement=function(){return r},n.restore=function(){n.appendChild(n)},n.clear=n.remove,n.detach=n.remove,n.getByIndex=function(e){let t=r;for(let n=0;n<=e;n++){if(!t.nextSibling)return null;t=t.nextSibling}return t!==r?t:null},n}function jr(e){this.$element=e,this.$attachements=null}DocumentFragment.prototype.setAttribute=()=>{},jr.prototype.__$isNDElement=!0,jr.prototype.ghostDom=function(e){return this.$attachements||(this.$attachements=document.createDocumentFragment()),this.$attachements.appendChild(M.getChild(e)),this},jr.prototype.valueOf=function(){return this.$element},jr.prototype.ref=function(e,t){return e[t]=this.$element,this},jr.prototype.refSelf=function(e,t){return e[t]=this,this},jr.prototype.unmountChildren=function(){let e=this.$element;for(let t=0,n=e.children.length;t<n;t++){let n=e.children[t];n.$ndProx||n.nd?.remove(),n=null}return e=null,this},jr.prototype.remove=function(){let e=this.$element;return e.nd.unmountChildren(),e.$ndProx=null,Vr.delete(e),e=null,this};const Vr=new WeakMap;jr.prototype.lifecycle=function(e){const t=this.$element;Vr.has(t)||Vr.set(t,C.watch(t));const n=Vr.get(t);return e.mounted&&(this.$element.setAttribute("data--nd-mounted","1"),n.mounted(e.mounted)),e.unmounted&&(this.$element.setAttribute("data--nd-unmounted","1"),n.unmounted(e.unmounted)),this},jr.prototype.mounted=function(e){return this.lifecycle({mounted:e})},jr.prototype.unmounted=function(e){return this.lifecycle({unmounted:e})},jr.prototype.beforeUnmount=function(e,t){const n=this.$element;if(!C.beforeUnmount.has(n)){C.beforeUnmount.set(n,new Map);const e=n.remove.bind(n);let t=!1;n.remove=async()=>{if(!t){t=!0;try{const e=C.beforeUnmount.get(n);for(const t of e.values())await t.call(this,n)}finally{e(),t=!1}}}}return C.beforeUnmount.get(n).set(e,t),this},jr.prototype.htmlElement=function(){return this.$element},jr.prototype.node=jr.prototype.htmlElement,jr.prototype.shadow=function(e,t=null){const n=this.$element,r=Array.from(n.childNodes),o=n.attachShadow({mode:e});if(t){const e=document.createElement("style");e.textContent=t,o.appendChild(e)}return n.append=o.append.bind(o),n.appendChild=o.appendChild.bind(o),o.append(...r),this},jr.prototype.openShadow=function(e=null){return this.shadow("open",e)},jr.prototype.closedShadow=function(e=null){return this.shadow("closed",e)},jr.prototype.with=function(e){if(!e||"object"!=typeof e)throw new r("extend() requires an object of methods");for(const t in e){const r=e[t];"function"==typeof r?this[t]=r.bind(this):n.warn(`⚠️ extends(): "${t}" is not a function, skipping`)}return this},jr.extend=function(e){if(!e||"object"!=typeof e)throw new r("NDElement.extend() requires an object of methods");if(Array.isArray(e))throw new r("NDElement.extend() requires an object, not an array");const t=new Set(["constructor","valueOf","$element","$observer","ref","remove","cleanup","with","extend","attach","lifecycle","mounted","unmounted","unmountChildren"]);for(const o in e){if(!Object.hasOwn(e,o))continue;const s=e[o];if("function"==typeof s){if(t.has(o))throw n.error("NDElement.extend",`Cannot override protected method "${o}"`),new r(`Cannot override protected method "${o}"`);jr.prototype[o]&&n.warn("NDElement.extend",`Overwriting existing prototype method "${o}"`),jr.prototype[o]=s}else n.warn("NDElement.extend",`"${o}" is not a function, skipping`)}return jr};const Br=3,Wr=8,qr=11,Ur=[];Ur[1]=!0,Ur[Br]=!0,Ur[qr]=!0,Ur[Wr]=!0;const Hr={isObservable:e=>e&&(e.__$isObservable||e.__$Observable),isTemplateBinding:e=>e?.__$isTemplateBinding,isObservableWhenResult:e=>e&&(e.__$isObservableWhen||"object"==typeof e&&"$target"in e&&"$observer"in e),isArrayObservable:e=>e?.__$isObservableArray,isProxy:e=>e?.__isProxy__,isObservableOrProxy:e=>Hr.isObservable(e)||Hr.isProxy(e),isAnchor:e=>e?.__Anchor__,isObservableChecker:e=>e?.__$isObservableChecker||e instanceof $,isArray:e=>Array.isArray(e),isString:e=>"string"==typeof e,isNumber:e=>"number"==typeof e,isBoolean:e=>"boolean"==typeof e,isFunction:e=>"function"==typeof e,isAsyncFunction:e=>"function"==typeof e&&"AsyncFunction"===e.constructor.name,isObject:e=>"object"==typeof e&&null!==e,isJson:e=>!("object"!=typeof e||null===e||Array.isArray(e)||"Object"!==e.constructor.name),isElement:e=>e&&Ur[e.nodeType],isDOMNode:e=>Ur[e.nodeType],isFragment:e=>e?.nodeType===qr,isStringOrObservable(e){return this.isString(e)||this.isObservable(e)},isValidChild(e){return null===e||this.isElement(e)||this.isObservable(e)||this.isNDElement(e)||["string","number","boolean"].includes(typeof e)},isNDElement:e=>e?.__$isNDElement||e instanceof jr,isValidChildren(e){Array.isArray(e)||(e=[e]);return 0===e.filter(e=>!this.isValidChild(e)).length},validateChildren(e){Array.isArray(e)||(e=[e]);const t=e.filter(e=>!this.isValidChild(e));if(t.length>0)throw new r(`Invalid children detected: ${t.map(e=>typeof e).join(", ")}`);return e},containsObservables:e=>!!e&&(Hr.isObject(e)&&Object.values(e).some(e=>Hr.isObservable(e))),containsObservableReference:e=>!(!e||"string"!=typeof e)&&/\{\{#ObItem::\([0-9]+\)\}\}/.test(e),validateAttributes(e){},validateEventCallback(e){if("function"!=typeof e)throw new r("Event callback must be a function")}},zr={configurable:!0,get(){return new jr(this)}};Object.defineProperty(HTMLElement.prototype,"nd",zr),Object.defineProperty(DocumentFragment.prototype,"nd",zr),Object.defineProperty(jr.prototype,"nd",{configurable:!0,get:function(){return this}}),["Click","DblClick","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","Wheel","KeyDown","KeyPress","KeyUp","Blur","Change","Focus","Input","Invalid","Reset","Search","Select","Submit","Drag","DragEnd","DragEnter","DragLeave","DragOver","DragStart","Drop","AfterPrint","BeforePrint","BeforeUnload","Error","HashChange","Load","Offline","Online","PageHide","PageShow","Resize","Scroll","Unload","Abort","CanPlay","CanPlayThrough","DurationChange","Emptied","Ended","LoadedData","LoadedMetadata","LoadStart","Pause","Play","Playing","Progress","RateChange","Seeked","Seeking","Stalled","Suspend","TimeUpdate","VolumeChange","Waiting","TouchCancel","TouchEnd","TouchMove","TouchStart","AnimationEnd","AnimationIteration","AnimationStart","TransitionEnd","Copy","Cut","Paste","FocusIn","FocusOut","ContextMenu"].forEach(e=>{const t=e.toLowerCase();jr.prototype["on"+e]=function(e=null){return this.$element.addEventListener(t,e),this}}),["Click","DblClick","MouseDown","MouseMove","MouseOut","MouseOver","MouseUp","Wheel","KeyDown","KeyPress","KeyUp","Change","Input","Invalid","Reset","Search","Select","Submit","Drag","DragEnd","DragEnter","DragLeave","DragOver","DragStart","Drop","BeforeUnload","HashChange","TouchCancel","TouchEnd","TouchMove","TouchStart","AnimationEnd","AnimationIteration","AnimationStart","TransitionEnd","Copy","Cut","Paste","FocusIn","FocusOut","ContextMenu"].forEach(e=>{const t=e.toLowerCase();jr.prototype["onStop"+e]=function(e=null){return Kr(this.$element,t,e),this},jr.prototype["onPreventStop"+e]=function(e=null){return Jr(this.$element,t,e),this}}),["Click","DblClick","MouseDown","MouseUp","Wheel","KeyDown","KeyPress","Invalid","Reset","Submit","DragOver","Drop","BeforeUnload","TouchCancel","TouchEnd","TouchMove","TouchStart","Copy","Cut","Paste","ContextMenu"].forEach(e=>{const t=e.toLowerCase();jr.prototype["onPrevent"+e]=function(e=null){return Gr(this.$element,t,e),this}}),jr.prototype.on=function(e,t,n){return this.$element.addEventListener(e.toLowerCase(),t,n),this};const Gr=function(e,t,n){return e.addEventListener(t,t=>{t.preventDefault(),n&&n.call(e,t)}),this},Kr=function(e,t,n){return e.addEventListener(t,t=>{t.stopPropagation(),n&&n.call(e,t)}),this},Jr=function(e,t,n){return e.addEventListener(t,t=>{t.stopPropagation(),t.preventDefault(),n&&n.call(e,t)}),this},Yr={getClasses(){return this.$element.className?.split(" ").filter(Boolean)},add(e){const t=this.getClasses();t.indexOf(e)>=0||(t.push(e),this.$element.className=t.join(" "))},remove(e){const t=this.getClasses(),n=t.indexOf(e);n<0||(t.splice(n,1),this.$element.className=t.join(" "))},toggle(e,t=void 0){const n=this.getClasses(),r=n.indexOf(e);if(r>=0){if(!0===t)return;n.splice(r,1)}else{if(!1===t)return;n.push(e)}this.$element.className=n.join(" ")},contains(e){return this.getClasses().indexOf(e)>=0}};Object.defineProperty(HTMLElement.prototype,"classes",{configurable:!0,get(){return{$element:this,...Yr}}});const Qr=e=>e?e.toNdElement():M.createTextNode(),Xr=(e,t,n=null)=>{let{props:r,children:o=null}=V(t,n);return M.processAttributes(e,r),M.processChildren(o,e),e};function Zr(e,t=null){if(e){if(t){let n=null,r=(o,s)=>(n=document.createElement(e),r=(e,r)=>Xr(t(n.cloneNode()),e,r),Xr(t(n.cloneNode()),o,s));return(e,t)=>r(e,t)}let n=null,r=(t,o)=>(n=document.createElement(e),r=(e,t)=>Xr(n.cloneNode(),e,t),Xr(n.cloneNode(),t,o));return(e,t)=>r(e,t)}return(e,t="")=>{const n=Rr(t);return n.append(e),n}}return e.$=d,e.ElementCreator=M,e.HtmlElementWrapper=Zr,e.NDElement=jr,e.Observable=h,e.PluginsManager=null,e.SingletonView=R,e.Store=Ce,e.StoreFactory=Se,e.TemplateCloner=P,e.Validator=Hr,e.autoMemoize=H,e.autoOnce=U,e.classPropertyAccumulator=W,e.createTextNode=Qr,e.cssPropertyAccumulator=B,e.elements=wr,e.memoize=e=>{const t=new Map;return(...n)=>{const[r,...o]=n,s=t.get(r);if(s)return s;const i=e(...o);return t.set(r,i),i}},e.normalizeComponentArgs=V,e.obs=f,e.once=q,e.router=Ir,e.useCache=function(e){let t=null,n=r=>{t=new P(e);const o=t.clone(r);return n=t.clone,o};return e.length<2?(...e)=>n(e):(e,t,...r)=>n([e,t,...r])},e.useSingleton=function(e){let t=null;return function(...n){return t||(t=new R(e)),t.render(n)}},e.utils=Lr,e.withValidation=j,e}({});
1
+ var NativeDocument=function(e){"use strict";let t={};t={log(){},warn(){},error(){},disable(){}};var n=t;class r extends Error{constructor(e,t={}){super(e),this.name="NativeDocumentError",this.context=t,this.timestamp=(new Date).toISOString()}}const o=function(){let e=0;const t=new Map;return{register(n){const r=++e;return t.set(r,new WeakRef(n)),r},unregister(e){t.delete(e)},getObservableById:e=>t.get(e)?.deref(),cleanup(){for(const[e,n]of t){const e=n.deref();e&&e.cleanup()}t.clear()},cleanObservables(e){if(t.size<e)return;let r=0;for(const[e,n]of t)n.deref()||(t.delete(e),r++);r>0&&n.log("Memory Auto Clean",`🧹 Cleaned ${r} orphaned observables`)}}}();const s=function(e,t){this.$target=t,this.$observer=e};s.prototype.__$Observable=!0,s.prototype.__$isObservableWhen=!0,s.prototype.subscribe=function(e){return this.$observer.on(this.$target,e)},s.prototype.val=function(){return this.$observer.$currentValue===this.$target},s.prototype.isMatch=s.prototype.val,s.prototype.isActive=s.prototype.val;const i=function(e){let t=!1;return function(...n){t||(t=!0,Promise.resolve().then(()=>{e.apply(this,n),t=!1}))}},a=function(e,t){return e.replace(new RegExp(`^[${t}]+|[${t}]+$`,"g"),"")},l=(e,t)=>{try{if(void 0!==window.structuredClone)return window.structuredClone(e)}catch(e){}if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(e=>l(e));if(De.isObservable(e))return t&&t(e),e;const n={};for(const t in e)Object.hasOwn(e,t)&&(n[t]=l(e[t]));return n},u=(e,t)=>{const n=new Date(e);return{d:n,parts:new Intl.DateTimeFormat(t,{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(n).reduce((e,{type:t,value:n})=>(e[t]=n,e),{})}},c=(e,t,n)=>{const r=e=>String(e).padStart(2,"0");return e.replace("YYYY",n.year).replace("YY",n.year.slice(-2)).replace("MMMM",n.month).replace("MMM",n.month.slice(0,3)).replace("MM",r(t.getMonth()+1)).replace("DD",r(t.getDate())).replace("D",t.getDate()).replace("HH",n.hour).replace("mm",n.minute).replace("ss",n.second)},h={currency:(e,t,{currency:n="XOF",notation:r,minimumFractionDigits:o,maximumFractionDigits:s}={})=>new Intl.NumberFormat(t,{style:"currency",currency:n,notation:r,minimumFractionDigits:o,maximumFractionDigits:s}).format(e),number:(e,t,{notation:n,minimumFractionDigits:r,maximumFractionDigits:o}={})=>new Intl.NumberFormat(t,{notation:n,minimumFractionDigits:r,maximumFractionDigits:o}).format(e),percent:(e,t,{decimals:n=1}={})=>new Intl.NumberFormat(t,{style:"percent",maximumFractionDigits:n}).format(e),date:(e,t,{format:n,dateStyle:r="long"}={})=>{if(n){const{d:r,parts:o}=u(e,t);return c(n,r,o)}return new Intl.DateTimeFormat(t,{dateStyle:r}).format(new Date(e))},time:(e,t,{format:n,hour:r="2-digit",minute:o="2-digit",second:s}={})=>{if(n){const{d:r,parts:o}=u(e,t);return c(n,r,o)}return new Intl.DateTimeFormat(t,{hour:r,minute:o,second:s}).format(new Date(e))},datetime:(e,t,{format:n,dateStyle:r="long",hour:o="2-digit",minute:s="2-digit",second:i}={})=>{if(n){const{d:r,parts:o}=u(e,t);return c(n,r,o)}return new Intl.DateTimeFormat(t,{dateStyle:r,hour:o,minute:s,second:i}).format(new Date(e))},relative:(e,t,{unit:n="day",numeric:r="auto"}={})=>{const o=Math.round((e-Date.now())/864e5);return new Intl.RelativeTimeFormat(t,{numeric:r}).format(o,n)},plural:(e,t,{singular:n,plural:r}={})=>`${e} ${"one"===new Intl.PluralRules(t).select(e)?n:r}`};function p(e,t=null){return new g(e,t)}const d=p,f=p;p.useValueProperty=function(e="value"){Object.defineProperty(g.prototype,e,{get(){return this.$currentValue},set(e){this.set(e)},configurable:!0})},p.getById=function(e){const t=o.getObservableById(parseInt(e));if(!t)throw new r("Observable.getById : No observable found with id "+e);return t},p.cleanup=function(e){e.cleanup()},p.autoCleanup=function(e=!1,t={}){if(!e)return;const{interval:n=6e4,threshold:r=100}=t;window.addEventListener("beforeunload",()=>{o.cleanup()}),setInterval(()=>o.cleanObservables(r),n)};const m={getJson(e){let t=localStorage.getItem(e);try{return JSON.parse(t)}catch(t){throw new r("invalid_json:"+e)}},getNumber(e){return Number(this.get(e))},getBool(e){const t=this.get(e);return"true"===t||"1"===t},setJson(e,t){localStorage.setItem(e,JSON.stringify(t))},setBool(e,t){localStorage.setItem(e,t?"true":"false")},get:(e,t=null)=>localStorage.getItem(e)||t,set:(e,t)=>localStorage.setItem(e,t),remove(e){localStorage.removeItem(e)},has:e=>null!=localStorage.getItem(e)},b=(e,t)=>{if(!m.has(e))return t;switch(typeof t){case"object":return m.getJson(e)??t;case"boolean":return m.getBool(e)??t;case"number":return m.getNumber(e)??t;default:return m.get(e,t)??t}},y=e=>{switch(typeof e){case"object":return m.setJson;case"boolean":return m.setBool;default:return m.set}};function g(e,t=null){e=De.isObservable(e)?e.val():e,this.$previousValue=null,this.$currentValue=e,this.$firstListener=null,this.$listeners=null,this.$watchers=null,this.$memoryId=null,t&&(this.configs=t,t.reset&&(this.$initialValue=De.isObject(e)?l(e):e))}Object.defineProperty(g.prototype,"$value",{get(){return this.$currentValue},set(e){this.set(e)},configurable:!0}),g.prototype.__$Observable=!0,g.prototype.__$isObservable=!0;const v=function(){};g.prototype.intercept=function(e){return this.$interceptor=e,this.set=this.$setWithInterceptor,this},g.prototype.interceptMutations=function(e){return this.$mutationInterceptor=e,this},g.prototype.triggerFirstListener=function(e){this.$firstListener(this.$currentValue,this.$previousValue,e)},g.prototype.triggerListeners=function(e){const t=this.$listeners,n=this.$previousValue,r=this.$currentValue;for(let o=0,s=t.length;o<s;o++)t[o](r,n,e)},g.prototype.triggerWatchers=function(e){const t=this.$watchers,n=this.$previousValue,r=this.$currentValue,o=t.get(r),s=t.get(n);o&&o(!0,n,e),s&&s(!1,r,e)},g.prototype.triggerAll=function(e){this.triggerWatchers(e),this.triggerListeners(e)},g.prototype.triggerWatchersAndFirstListener=function(e){this.triggerWatchers(e),this.triggerFirstListener(e)},g.prototype.assocTrigger=function(){if(this.$firstListener=null,this.$watchers?.size&&this.$listeners?.length)return this.$firstListener=this.$listeners[0],this.trigger=0===this.$firstListener.length?this.$firstListener:this.triggerFirstListener,void(this.trigger=1===this.$listeners.length?this.triggerWatchersAndFirstListener:this.triggerAll);this.$listeners?.length?1===this.$listeners.length?(this.$firstListener=this.$listeners[0],this.trigger=0===this.$firstListener.length?this.$firstListener:this.triggerFirstListener):this.trigger=this.triggerListeners:this.$watchers?.size?this.trigger=this.triggerWatchers:this.trigger=v},g.prototype.trigger=v;const w={action:"set"};function $(e,t){this.observable=e,g.call(this),this.$mutation=t,e.subscribe(e=>{this.$updateWithMutation(e)}),this.$updateWithMutation(e.val())}g.prototype.$updateWithNewValue=function(e){e=e?.__$isObservable?e.val():e,this.$currentValue!==e&&(this.$previousValue=this.$currentValue,this.$currentValue=e,this.trigger(w),this.$previousValue=null)},g.prototype.$setWithInterceptor=function(e){let t="function"==typeof e?e(this.$currentValue):e;const n=this.$interceptor(t,this.$currentValue);void 0!==n&&(t=n),this.$updateWithNewValue(t)},g.prototype.$basicSet=function(e){let t="function"==typeof e?e(this.$currentValue):e;this.$updateWithNewValue(t)},g.prototype.set=g.prototype.$basicSet,g.prototype.val=function(){return this.$currentValue},g.prototype.disconnectAll=function(){this.$previousValue=null,this.$currentValue=null,this.$listeners=null,this.$watchers=null,this.trigger=v},g.prototype.onCleanup=function(e){this.$cleanupListeners=this.$cleanupListeners??[],this.$cleanupListeners.push(e)},g.prototype.cleanup=function(){if(this.$cleanupListeners){for(let e=0;e<this.$cleanupListeners.length;e++)this.$cleanupListeners[e]();this.$cleanupListeners=null}o.unregister(this.$memoryId),this.disconnectAll(),delete this.$value},g.prototype.subscribe=function(e){this.$listeners=this.$listeners??[],this.$listeners.push(e),this.assocTrigger()},g.prototype.on=function(e,t){this.$watchers=this.$watchers??new Map;let n=this.$watchers.get(e);t.__$isObservable&&(t=t.set.bind(t)),n?De.isArray(n.list)?n.list.push(t):(n=[n,t],t=e=>{for(let t=0,r=n.length;t<r;t++)n[t](e)},t.list=n,this.$watchers.set(e,t)):(n=t,this.$watchers.set(e,t)),this.assocTrigger()},g.prototype.off=function(e,t){if(!this.$watchers)return;const n=this.$watchers.get(e);if(!n)return;if(!t||!Array.isArray(n.list))return this.$watchers?.delete(e),void this.assocTrigger();const r=n.indexOf(t);n?.splice(r,1),1===n.length?this.$watchers.set(e,n[0]):0===n.length&&this.$watchers?.delete(e),this.assocTrigger()},g.prototype.once=function(e,t){const n="function"==typeof e?e:t=>t===e,r=e=>{n(e)&&(this.unsubscribe(r),t(e))};this.subscribe(r)},g.prototype.unsubscribe=function(e){if(!this.$listeners)return;const t=this.$listeners.indexOf(e);t>-1&&this.$listeners.splice(t,1),this.assocTrigger()},g.prototype.check=function(e){return new $(this,e)},g.prototype.transform=g.prototype.check,g.prototype.pluck=function(e){return new $(this,t=>t[e])},g.prototype.is=function(e){return new $(this,"function"==typeof e?e:t=>t===e)},g.prototype.select=g.prototype.check,g.prototype.get=function(e){const t=this.$currentValue[e];return De.isObservable(t)?t.val():t},g.prototype.when=function(e){return new s(this,e)},g.prototype.equals=function(e){return De.isObservable(e)?this.$currentValue===e.$currentValue:this.$currentValue===e},g.prototype.toBool=function(){return!!this.$currentValue},g.prototype.toggle=function(){this.set(!this.$currentValue)},g.prototype.reset=function(){if(!this.configs?.reset)return;const e=De.isObject(this.$initialValue)?l(this.$initialValue,e=>{e.reset()}):this.$initialValue;this.set(e)},g.prototype.toString=function(){return String(this.$currentValue)},g.prototype.valueOf=function(){return this.$currentValue},g.prototype.format=function(e,t={}){const n=this;if("function"==typeof e)return new $(n,e);const r=h[e],o=h.locale;return p.computed(()=>r(n.val(),o.val(),t),[n,o])},g.prototype.persist=function(e,t={}){let n=b(e,this.$currentValue);t.get&&(n=t.get(n)),this.set(n);const r=y(this.$currentValue);return this.subscribe(n=>{r(e,t.set?t.set(n):n)}),this},g.prototype.clone=function(){let e=this.$currentValue;return e&&"object"==typeof e&&(e="function"==typeof e.clone?e.clone():structuredClone(e)),new g(e)},$.prototype=Object.create(g.prototype),$.prototype.constructor=$,$.prototype.__$Observable=!0,$.prototype.__$isObservableChecker=!0;const S=$;S.prototype.constructor=S,$.prototype.$updateWithMutation=function(e){return e=this.$mutation(e),this.set(e)};const C={mounted:new WeakMap,beforeUnmount:new WeakMap,mountedSupposedSize:0,unmounted:new WeakMap,unmountedSupposedSize:0,observer:null,initObserver:()=>{C.observer||(C.observer=new MutationObserver(C.checkMutation),C.observer.observe(document.body,{childList:!0,subtree:!0}))},executeMountedCallback(e){const t=C.mounted.get(e);if(t&&(t.inDom=!0,t.mounted))if(Array.isArray(t.mounted))for(const n of t.mounted)n(e);else t.mounted(e)},executeUnmountedCallback(e){const t=C.unmounted.get(e);if(!t)return;if(t.inDom=!1,!t.unmounted)return;let n=!1;if(Array.isArray(t.unmounted))for(const r of t.unmounted)!0===r(e)&&(n=!0);else n=!0===t.unmounted(e);n&&(t.disconnect(),e.nd?.remove())},checkMutation:function(e){for(const t of e){if(C.mountedSupposedSize>0)for(const e of t.addedNodes){if(C.executeMountedCallback(e),!e.querySelectorAll)continue;const t=e.querySelectorAll("[data--nd-mounted]");for(const e of t)C.executeMountedCallback(e)}if(C.unmountedSupposedSize>0)for(const e of t.removedNodes){if(C.executeUnmountedCallback(e),!e.querySelectorAll)continue;const t=e.querySelectorAll("[data--nd-unmounted]");for(const e of t)C.executeUnmountedCallback(e)}}},watch:function(e,t=!1){let n=!1,r=!1;C.initObserver();let o={inDom:t,mounted:null,unmounted:null,disconnect:()=>{n&&(C.mounted.delete(e),C.mountedSupposedSize--),r&&(C.unmounted.delete(e),C.unmountedSupposedSize--),o=null}};const s=(e,t)=>{o[e]?Array.isArray(o[e])?o[e].push(t):o[e]=[o[e],t]:o[e]=t};return{disconnect:()=>o?.disconnect(),mounted:t=>{s("mounted",t),C.mounted.set(e,o),n||(C.mountedSupposedSize++,n=!0)},unmounted:t=>{s("unmounted",t),C.unmounted.set(e,o),r||(C.unmountedSupposedSize++,r=!0)},off:(e,t)=>{((e,t)=>{if(o?.[e]){if(Array.isArray(o[e])){const n=o[e].indexOf(t);return n>-1&&o[e].splice(n,1),1===o[e].length&&(o[e]=o[e][0]),void(0===o[e].length&&(o[e]=null))}o[e]=null}})(e,t)}}}},O=new Set(["checked","selected","disabled","readonly","required","autofocus","multiple","autocomplete","hidden","contenteditable","spellcheck","translate","draggable","async","defer","autoplay","controls","loop","muted","download","reversed","open","default","formnovalidate","novalidate","scoped","itemscope","allowfullscreen","allowpaymentrequest","playsinline"]),A=(e,t)=>{for(const n in t){const r=t[n];if(r.__$Observable){if(r.__$isObservableChecker){let t=r.val();if("string"==typeof t){e.classes.toggle(t,!0),r.subscribe(n=>{e.classes.remove(t),e.classes.toggle(n,!0),t=n});continue}}e.classes.toggle(n,r.val()),r.subscribe(t=>e.classes.toggle(n,t))}else r.$hydrate?r.$hydrate(e,n):e.classes.toggle(n,r)}},E=(e,t)=>{for(const n in t){const r=t[n],o=n.startsWith("--");r.__$Observable?o?(e.style.setProperty(n,r.val()),r.subscribe(t=>{!1!==t?e.style.setProperty(n,t):e.style.removeProperty(n)})):(e.style[n]=r.val(),r.subscribe(t=>{!1!==t?e.style[n]=t:e.style.removeProperty(n)})):o?e.style.setProperty(n,r):e.style[n]=r}},_=(e,t,n)=>{const r=n.__$isObservable,o=r?n.val():n;if(De.isBoolean(o)?e[t]=o:e[t]=o===e.value,r){if("checked"===t)return"boolean"==typeof o?e.addEventListener("input",()=>n.set(e[t])):e.addEventListener("input",()=>n.set(e.value)),void n.subscribe(n=>e[t]=n);n.subscribe(n=>e[t]=n===e.value)}},x=(e,t)=>{for(const n in t){const r=n.toLowerCase();let o=t[n];if(null!=o)if(o.handleNdAttribute)o.handleNdAttribute(e,r,o);else{if("object"==typeof o){if("class"===r){A(e,o);continue}if("style"===r){E(e,o);continue}}O.has(r)?_(e,r,o):e.setAttribute(r,o)}}return e};function N(e){this.$hydrate=e}N.prototype.__$isTemplateBinding=!0,String.prototype.toNdElement=function(){return M.createStaticTextNode(null,this)},Number.prototype.toNdElement=function(){return M.createStaticTextNode(null,this.toString())},Element.prototype.toNdElement=function(){return this},Text.prototype.toNdElement=function(){return this},Comment.prototype.toNdElement=function(){return this},Document.prototype.toNdElement=function(){return this},DocumentFragment.prototype.toNdElement=function(){return this},g.prototype.toNdElement=function(){return M.createObservableNode(null,this)},$.prototype.toNdElement=g.prototype.toNdElement,Ae.prototype.toNdElement=function(){const e=this.$element??this.$build?.()??this.build?.()??null;return this.$attachements?(this.$attachements.contains(this.$element)||this.$attachements.append(this.$element),this.$attachements):e},Array.prototype.toNdElement=function(){const e=document.createDocumentFragment();for(let t=0,n=this.length;t<n;t++){const n=M.getChild(this[t]);null!==n&&e.appendChild(n)}return e},Function.prototype.toNdElement=function(){return M.getChild(this())},N.prototype.toNdElement=function(){return M.createHydratableNode(null,this)};const F=(e,t=1e3)=>new Promise(n=>{let r=!1;const o=t=>{t&&t.target!==e||r||(r=!0,e.removeEventListener("transitionend",o),e.removeEventListener("animationend",o),clearTimeout(s),n())};e.addEventListener("transitionend",o),e.addEventListener("animationend",o);const s=setTimeout(o,t),i=window.getComputedStyle(e),a="0s"!==i.transitionDuration,l="0s"!==i.animationDuration;a||l||o()});Ae.prototype.transitionOut=function(e){const t=e+"-exit",n=this.$element;return this.beforeUnmount("transition-exit",async function(){n.classes.add(t),await F(n),n.classes.remove(t)}),this},Ae.prototype.transitionIn=function(e){const t=e+"-enter-from",n=e+"-enter-to",r=this.$element;return r.classes.add(t),this.mounted(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{r.classes.remove(t),r.classes.add(n),F(r).then(()=>{r.classes.remove(n)})})})}),this},Ae.prototype.transition=function(e){return this.transitionIn(e),this.transitionOut(e),this},Ae.prototype.animate=function(e){const t=this.$element;return t.classes.add(e),F(t).then(()=>{t.classes.remove(e)}),this},g.prototype.handleNdAttribute=function(e,t){O.has(t)?_(e,t,this):((e,t,n)=>{const r="value"===t?t=>e.value=t:n=>e.setAttribute(t,n);if(n.subscribe(r),"value"===t)return e.value=n.val(),void e.addEventListener("input",()=>n.set(e.value));e.setAttribute(t,n.val())})(e,t,this)},$.prototype.handleNdAttribute=g.prototype.handleNdAttribute,N.prototype.handleNdAttribute=function(e,t){this.$hydrate(e,t)};let D=null;const M={createTextNode:()=>(D||(D=document.createTextNode(""),M.createTextNode=()=>D.cloneNode()),D.cloneNode()),createObservableNode:(e,t)=>{const n=M.createTextNode();return t.subscribe(e=>n.nodeValue=e),n.nodeValue=t.val(),e&&e.appendChild(n),n},createHydratableNode:(e,t)=>{const n=M.createTextNode();return t.$hydrate(n),n},createStaticTextNode:(e,t)=>{let n=M.createTextNode();return n.nodeValue=t,e&&e.appendChild(n),n},createElement:e=>document.createElement(e).cloneNode(),createFragment:e=>Oe("Fragment"),bindTextNode:(e,t)=>{if(t?.__$isObservable)return t.subscribe(t=>e.nodeValue=t),void(e.nodeValue=t.val());e.nodeValue=t},processChildren:(e,t)=>{if(null===e)return;let n=M.getChild(e);n&&t.appendChild(n)},async safeRemove(e){await e.remove()},getChild:e=>{if(null==e)return null;if(e.toNdElement)do{if(e=e.toNdElement(),De.isElement(e))return e}while(e.toNdElement);return M.createStaticTextNode(null,e)},processAttributes:(e,t)=>{t&&x(e,t)},processAttributesDirect:x,processClassAttribute:A,processStyleAttribute:E};function T(e){const t=Reflect.construct(DocumentFragment,[],T),n=document.createComment((e||"")+" Anchor Sentinel"),r=document.createComment("Anchor Start : "+e),o=document.createComment("/ Anchor End "+e),s={};t.append(r,n,o);const i=new MutationObserver(()=>{n.parentNode===t||n.parentNode instanceof DocumentFragment||s.connected&&s.connected(n.parentNode)});return i.observe(document,{childList:!0,subtree:!0}),t.$sentinel=n,t.$start=r,t.$end=o,t.$observer=i,t.$events=s,t}function k(e){this.$element=e,this.$classes=null,this.$styles=null,this.$attrs=null,this.$ndMethods=null}T.prototype=Object.create(DocumentFragment.prototype),T.prototype.constructor=T,T.prototype.onConnected=function(e){return this.$events.connected=e,this},T.prototype.onConnectedOnce=function(e){this.$events.connected=t=>{e(t),this.$observer.disconnect(),this.$events.connectedOnce=null}},Ae.prototype.attach=function(e,t){if("function"==typeof t){const n=this.$element;return n.nodeCloner=n.nodeCloner||new k(n),n.nodeCloner.attach(e,t),n}return t.$hydrate(this.$element,e),this.$element},k.prototype.__$isNodeCloner=!0;const P=(e,t,n)=>{for(const r in t)e[r]=t[r].apply(null,n);return e};k.prototype.resolve=function(){if(this.$content)return;const e=[];if(this.$ndMethods){const t=Object.keys(this.$ndMethods);if(1===t.length){const n=t[0],r=this.$ndMethods[n];e.push((e,t)=>{e.nd[n](r.bind(e,...t))})}else e.push((e,t)=>{const n=e.nd;for(const r in this.$ndMethods)n[r](this.$ndMethods[r].bind(e,...t))})}if(this.$classes){const t={},n=Object.keys(this.$classes);if(1===n.length){const r=n[0],o=this.$classes[r];e.push((e,n)=>{t[r]=o.apply(null,n),M.processClassAttribute(e,t)})}else e.push((e,n)=>{M.processClassAttribute(e,P(t,this.$classes,n))})}if(this.$styles){const t={},n=Object.keys(this.$styles);if(1===n.length){const r=n[0],o=this.$styles[r];e.push((e,n)=>{t[r]=o.apply(null,n),M.processStyleAttribute(e,t)})}else e.push((e,n)=>{M.processStyleAttribute(e,P(t,this.$styles,n))})}if(this.$attrs){const t={},n=Object.keys(this.$attrs);if(1===n.length){const r=n[0],o=this.$attrs[r];e.push((e,n)=>{t[r]=o.apply(null,n),M.processAttributes(e,t)})}else e.push((e,n)=>{M.processAttributes(e,P(t,this.$attrs,n))})}const t=e.length,n=this.$element;this.cloneNode=r=>{const o=n.cloneNode(!1);for(let n=0;n<t;n++)e[n](o,r);return o}},k.prototype.cloneNode=function(e){return this.$element.cloneNode(!1)},k.prototype.attach=function(e,t){return this.$ndMethods=this.$ndMethods||{},this.$ndMethods[e]=t,this},k.prototype.text=function(e){return this.$content=e,"function"==typeof e?(this.cloneNode=t=>Le(e.apply(null,t)),this):(this.cloneNode=t=>Le(t[0][e]),this)},k.prototype.attr=function(e,t){return"class"===e?(this.$classes=this.$classes||{},this.$classes[t.property]=t.value,this):"style"===e?(this.$styles=this.$styles||{},this.$styles[t.property]=t.value,this):(this.$attrs=this.$attrs||{},this.$attrs[e]=t.value,this)};function I(e){let t=null;const n=e=>{const t=e.childNodes;let r=!!e.nodeCloner;const o=t.length;for(let e=0;e<o;e++){const o=t[e];o.nodeCloner&&(r=!0);n(o)&&(r=!0)}return r?e.nodeCloner?(e.nodeCloner.resolve(),e.dynamicCloneNode=n=>{const r=e.nodeCloner.cloneNode(n);for(let e=0;e<o;e++)r.appendChild(t[e].dynamicCloneNode(n));return r}):e.dynamicCloneNode=n=>{const r=e.cloneNode();for(let e=0;e<o;e++)r.appendChild(t[e].dynamicCloneNode(n));return r}:e.dynamicCloneNode=e.cloneNode.bind(e,!0),r};this.clone=r=>{const o=L(this);return t=e(o),t.nodeCloner||(t.nodeCloner=new k(t)),n(t),this.clone=t.dynamicCloneNode,t.dynamicCloneNode(r)};const r=(e,t)=>new N((n,r)=>{!function(e,t,n,r){n.nodeCloner=n.nodeCloner||new k(n),"value"!==t?"attach"!==t?n.nodeCloner.attr(t,{property:r,value:e}):n.nodeCloner.attach(r,e):n.nodeCloner.text(e)}(e,t,n,r)});this.style=e=>r(e,"style"),this.class=e=>r(e,"class"),this.property=e=>this.value(e),this.value=e=>r(e,"value"),this.text=this.value,this.attr=e=>r(e,"attributes"),this.attach=e=>r(e,"attach"),this.callback=this.attach}const L=e=>new Proxy(e,{get:(e,t)=>t in e||"symbol"==typeof t?e[t]:e.value(t)});function R(e){let t=null,n=null;this.render=r=>{if(t||(t=e(this)),!n)return t;for(const e in n){(0,n[e])(...r)}return t},this.createSection=(e,t)=>{n=n||{};const r=Oe("Component "+e);return n[e]=function(...e){r.removeChildren(),t?r.appendChild(t(...e)):r.append(e)},r}}let V=e=>e;e.ArgTypes={},e.ArgTypes={string:()=>!0,number:()=>!0,boolean:()=>!0,observable:()=>!0,element:()=>!0,function:()=>!0,object:()=>!0,objectNotNull:()=>!0,children:()=>!0,attributes:()=>!0,optional:()=>!0,oneOf:()=>!0};const j=function(e,t=null){return e&&t?{props:e,children:t}:"object"!=typeof e||Array.isArray(e)||null===e||"Object"!==e.constructor.name||e.$hydrate?{props:t,children:e}:{props:e,children:t}};DocumentFragment.prototype.__IS_FRAGMENT=!0,Function.prototype.args=function(...e){return this},Function.prototype.errorBoundary=function(e){const t=(...n)=>{try{return this.apply(this,n)}catch(r){return e(r,{caller:t,args:n})}};return t};const B=function(e={}){let t=De.isString(e)?e.split(";").filter(Boolean):e;return{add(e,n){if(Array.isArray(t))t.push(e+": "+n);else if(De.isObject(e)){n=e;for(const e in n)t[e]=n[e]}else t[e]=n},value:()=>Array.isArray(t)?t.join(";").concat(";"):{...t}}},W=function(e=[]){let t=De.isString(e)?e.split(" ").filter(Boolean):e;return{add(e,n=!0){if(De.isJson(e))for(const n in e)e[n]&&(t[n]=e[n]);else if(null!=n||e.__$Observable)if(Array.isArray(t)&&(t=t.reduce((e,t)=>(e[t]=!0,e),{})),e.__$Observable){const n=`obs-${Math.random().toString(36).substr(2,9)}`;t[n]=e}else t[e]=n;else Array.isArray(t)?t.push(e):t[e]=n},value:()=>Array.isArray(t)?t.join(" "):{...t}}},q=e=>{let t=null;return(...n)=>(null!=t||(t=e(...n)),t)},U=e=>{let t=null;return new Proxy({},{get:(n,r)=>(t||(t=e()),t[r])})},H=e=>{const t=new Map;return new Proxy({},{get:(n,r)=>{const o=t.get(r);if(o)return o;if(e.length>0)return(...n)=>{const o=e(...n,r);return t.set(r,o),o};const s=e(r);return t.set(r,s),s}})};function z(e){return e instanceof Date?e:new Date(e)}function G(e,t){const n=z(e),r=z(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function K(e){const t=z(e);return 3600*t.getHours()+60*t.getMinutes()+t.getSeconds()}function J(e,t){const n=De.isObservable(e);return{dependencies:n?e:null,callback:r=>t(r,n?e.val():e)}}function Y(e,t){const n=e.filter(De.isObservable);return{dependencies:n.length>0?n:null,callback:n=>t(n,e.map(e=>De.isObservable(e)?e.val():e))}}function Q(e){return J(e,(e,t)=>e===t)}function X(e){return J(e,(e,t)=>e!==t)}function Z(e){return J(e,(e,t)=>e>t)}function ee(e){return J(e,(e,t)=>e>=t)}function te(e){return J(e,(e,t)=>e<t)}function ne(e){return J(e,(e,t)=>e<=t)}function re(e,t=!0,r=""){return Y([e,t,r],(e,[t,r,o])=>{if(!t)return!0;if(r)try{return new RegExp(t,o).test(String(e))}catch(e){return n.warn("Invalid regex pattern:",t,e),!1}return o&&""!==o?String(e).includes(String(t)):String(e).toLowerCase().includes(String(t).toLowerCase())})}function oe(...e){const t=e.flatMap(e=>e.dependencies?Array.isArray(e.dependencies)?e.dependencies:[e.dependencies]:[]).filter(De.isObservable);return{dependencies:t.length>0?t:null,callback:t=>e.every(e=>e.callback(t))}}function se(...e){const t=e.flatMap(e=>e.dependencies?Array.isArray(e.dependencies)?e.dependencies:[e.dependencies]:[]).filter(De.isObservable);return{dependencies:t.length>0?t:null,callback:t=>e.some(e=>e.callback(t))}}const ie=Z,ae=ee,le=te,ue=ne,ce=Q,he=X,pe=oe,de=se;function fe(e,t=!1){return J(e,(e,n)=>!!e&&(!n||(t?String(e).includes(String(n)):String(e).toLowerCase().includes(String(n).toLowerCase()))))}const me=fe;var be=Object.freeze({__proto__:null,all:pe,and:oe,any:de,between:function(e,t){return Y([e,t],(e,[t,n])=>e>=t&&e<=n)},contains:me,createFilter:J,createMultiSourceFilter:Y,custom:function(e,...t){const n=t.filter(De.isObservable);return{dependencies:n.length>0?n:null,callback:n=>{const r=t.map(e=>De.isObservable(e)?e.val():e);return e(n,...r)}}},dateAfter:e=>J(e,(e,t)=>!(!e||!t)&&z(e)>z(t)),dateBefore:e=>J(e,(e,t)=>!(!e||!t)&&z(e)<z(t)),dateBetween:(e,t)=>Y([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=z(e);return r>=z(t)&&r<=z(n)}),dateEquals:e=>J(e,(e,t)=>!(!e||!t)&&G(e,t)),dateTimeAfter:e=>J(e,(e,t)=>!(!e||!t)&&z(e)>z(t)),dateTimeBefore:e=>J(e,(e,t)=>!(!e||!t)&&z(e)<z(t)),dateTimeBetween:(e,t)=>Y([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=z(e);return r>=z(t)&&r<=z(n)}),dateTimeEquals:e=>J(e,(e,t)=>!(!e||!t)&&z(e).getTime()===z(t).getTime()),endsWith:function(e,t=!1){return J(e,(e,n)=>!n||(t?String(e).endsWith(String(n)):String(e).toLowerCase().endsWith(String(n).toLowerCase())))},eq:ce,equals:Q,getSecondsOfDay:K,greaterThan:Z,greaterThanOrEqual:ee,gt:ie,gte:ae,inArray:function(e){return J(e,(e,t)=>t.includes(e))},includes:fe,isEmpty:function(e=!0){return J(e,(e,t)=>{const n=!e||""===e||Array.isArray(e)&&0===e.length;return t?n:!n})},isNotEmpty:function(e=!0){return J(e,(e,t)=>{const n=!!e&&""!==e&&(!Array.isArray(e)||e.length>0);return t?n:!n})},isSameDay:G,lessThan:te,lessThanOrEqual:ne,lt:le,lte:ue,match:re,neq:he,not:function(e){return{dependencies:e.dependencies,callback:t=>!e.callback(t)}},notEquals:X,notIn:function(e){return J(e,(e,t)=>!t.includes(e))},or:se,startsWith:function(e,t=!1){return J(e,(e,n)=>!n||(t?String(e).startsWith(String(n)):String(e).toLowerCase().startsWith(String(n).toLowerCase())))},timeAfter:e=>J(e,(e,t)=>!(!e||!t)&&K(e)>K(t)),timeBefore:e=>J(e,(e,t)=>!(!e||!t)&&K(e)<K(t)),timeBetween:(e,t)=>Y([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=K(e);return r>=K(t)&&r<=K(n)}),timeEquals:e=>J(e,(e,t)=>{if(!e||!t)return!1;const n=z(e),r=z(t);return n.getHours()===r.getHours()&&n.getMinutes()===r.getMinutes()&&n.getSeconds()===r.getSeconds()}),toDate:z});const ye=function(e,t=null){if(!Array.isArray(e))throw new r("Observable.array : target must be an array");g.call(this,e,t)};(ye.prototype=Object.create(g.prototype)).constructor=ye,ye.prototype.__$isObservableArray=!0,Object.defineProperty(ye.prototype,"length",{get(){return this.$currentValue.length}}),ye.prototype.$mutate=function(e,t,n){if(this.$mutationInterceptor){const n=this.$mutationInterceptor(t,{action:e});void 0!==t&&(t=n)}n(t)},["push","pop","shift","unshift","reverse","sort","splice"].forEach(e=>{ye.prototype[e]=function(...t){return this.$mutate(e,t,t=>{const n=this.$currentValue[e].apply(this.$currentValue,t);return this.trigger({action:e,args:t,result:n}),n})}}),["map","forEach","filter","reduce","some","every","find","findIndex","concat","includes","indexOf"].forEach(e=>{ye.prototype[e]=function(...t){return this.$currentValue[e].apply(this.$currentValue,t)}});const ge={action:"clear"};ye.prototype.clear=function(){if(0!==this.$currentValue.length)return this.$mutate("clear",[],()=>{this.$currentValue.length=0,this.trigger(ge)}),!0},ye.prototype.at=function(e){return this.$currentValue[e]},ye.prototype.merge=function(e){this.$mutate("merge",e,e=>{this.$currentValue.push.apply(this.$currentValue,e),this.trigger({action:"merge",args:e})})},ye.prototype.count=function(e){let t=0;return this.$currentValue.forEach((n,r)=>{e(n,r)&&t++}),t},ye.prototype.swap=function(e,t){return this.$mutate("swap",[e,t],([e,t])=>{const n=this.$currentValue,r=n.length;if(t<e){const n=e;e=t,t=n}if(r<e||r<t)return!1;const o=n[e],s=n[t];n[e]=s,n[t]=o,this.trigger({action:"swap",args:[e,t],result:[o,s]})}),!0},ye.prototype.swapItems=function(e,t){const n=this.$currentValue.indexOf(e),r=this.$currentValue.indexOf(t);return this.swap(n,r)},ye.prototype.insertAfter=function(e,t){const n=this.$currentValue.indexOf(t);return this.splice(n+1,0,e)},ye.prototype.remove=function(e){let t=[];return this.$mutate("remove",[e],([e])=>{t=this.$currentValue.splice(e,1),0!==t.length&&this.trigger({action:"remove",args:[e],result:t[0]})}),t},ye.prototype.removeItem=function(e){const t=this.$currentValue.indexOf(e);return-1===t?[]:this.remove(t)},ye.prototype.empty=function(){return 0===this.$currentValue.length},ye.prototype.populateAndRender=function(e,t){this.trigger({action:"populate",args:[this.$currentValue,e,t]})},ye.prototype.where=function(e){"function"==typeof e&&(e={_:e});const t=this,n=[t],r={};for(const[t,o]of Object.entries(e)){const e=De.isObservable(o)?re(o,!1):o;if(e&&"object"==typeof e&&"callback"in e){if(r[t]=e.callback,e.dependencies){const t=Array.isArray(e.dependencies)?e.dependencies:[e.dependencies];n.push.apply(n,t)}}else r[t]="function"==typeof e?e:t=>t===e}const o=p.array(),s=Object.entries(r),i=()=>{const e=t.val().filter(e=>{for(const[t,n]of s)if("_"===t){if(!n(e))return!1}else if(!n(e[t]))return!1;return!0});o.set(e)};return n.forEach(e=>e.subscribe(i)),i(),o},ye.prototype.whereSome=function(e,t){return this.where({_:{dependencies:t.dependencies,callback:n=>e.some(e=>t.callback(n[e]))}})},ye.prototype.whereEvery=function(e,t){return this.where({_:{dependencies:t.dependencies,callback:n=>e.every(e=>t.callback(n[e]))}})},ye.prototype.deepSubscribe=function(e){const t=i(()=>e(this.val())),n=new WeakMap,r=e=>{n.has(e)||(e?.__$isObservableArray?n.set(e,e.deepSubscribe(t)):e?.__$isObservable&&(e.subscribe(t),n.set(e,()=>e.unsubscribe(t))))},o=e=>{const t=n.get(e);t&&(t(),n.delete(e))};return this.$currentValue.forEach(r),this.subscribe(t),this.subscribe((e,t,n)=>{switch(n?.action){case"push":case"unshift":case"merge":n.args.forEach(r);break;case"splice":{const[e,t,...s]=n.args;n.result?.forEach(o),s.forEach(r);break}case"remove":o(n.result);break;case"clear":this.$currentValue.forEach(o)}}),()=>{this.$currentValue.forEach(o)}},ye.prototype.sync=function(e){if(!e||!e.__$isObservableArray)throw new r("ObservableArray.sync : target must be an ObservableArray");e.set([...this.$currentValue]);const t=(t,n,r)=>{if(!r)return void e.set([...t]);const{action:o,args:s}=r;e[o].apply(e,s)};return this.subscribe(t),()=>this.unsubscribe(t)},ye.prototype.clone=function(){return new ye(this.resolve())},p.array=function(e=[],t=null){return new ye(e,t)},p.batch=function(e){const t=p(0),n=function(){if(De.isAsyncFunction(e))return e(...arguments).then(()=>{t.trigger()}).catch(e=>{throw e});e(...arguments),t.trigger()};return n.$observer=t,n};const ve=function(e,t){g.call(this,e),this.$observables={},this.configs=t,this.$load(e);for(const t in e)Object.hasOwn(this,t)||Object.defineProperty(this,t,{get:()=>this.$observables[t],set:e=>this.$observables[t].set(e)})};ve.prototype=Object.create(g.prototype),Object.defineProperty(ve,"$value",{get(){return this.val()},set(e){this.set(e)}}),ve.prototype.__$isObservableObject=!0,ve.prototype.__isProxy__=!0,ve.prototype.$load=function(e){const t=this.configs;for(const n in e){const r=e[n];if(Array.isArray(r)){if(!1!==t?.deep){const e=r.map(e=>De.isJson(e)?p.json(e,t):De.isArray(e)?p.array(e,t):p(e,t));this.$observables[n]=p.array(e,t);continue}this.$observables[n]=p.array(r,t)}else De.isObservable(r)||De.isProxy(r)?this.$observables[n]=r:this.$observables[n]="object"==typeof r?p.object(r,t):p(r,t)}},ve.prototype.val=function(){const e={};for(const t in this.$observables){const n=this.$observables[t];if(De.isObservable(n)){let r=n.val();Array.isArray(r)&&(r=r.map(e=>De.isObservable(e)?e.val():De.isProxy(e)?e.$value:e)),e[t]=r}else De.isProxy(n)?e[t]=n.$value:e[t]=n}return e},ve.prototype.$val=ve.prototype.val,ve.prototype.get=function(e){const t=this.$observables[e];return De.isObservable(t)?t.val():De.isProxy(t)?t.$value:t},ve.prototype.$get=ve.prototype.get,ve.prototype.set=function(e){const t=De.isProxy(e)?e.$value:e,n=this.configs;for(const r in t){const o=this.$observables[r],s=e[r],i=t[r];if(De.isObservable(o)){if(!De.isArray(i)){o.set(i);continue}const e=s.at(0);if(De.isObservable(e)||De.isProxy(e)){const t=i.map(t=>De.isProxy(e)?p.init(t,n):p(t,n));o.set(t);continue}o.set([...i]);continue}De.isProxy(o)?o.update(i):this[r]=i}},ve.prototype.$set=ve.prototype.set,ve.prototype.$updateWith=ve.prototype.set,ve.prototype.observables=function(){return Object.values(this.$observables)},ve.prototype.$observables=ve.prototype.observables,ve.prototype.keys=function(){return Object.keys(this.$observables)},ve.prototype.$keys=ve.prototype.keys,ve.prototype.clone=function(){return p.init(this.val(),this.configs)},ve.prototype.$clone=ve.prototype.clone,ve.prototype.reset=function(){for(const e in this.$observables)this.$observables[e].reset()},ve.prototype.originalSubscribe=ve.prototype.subscribe,ve.prototype.subscribe=function(e){const t=this.observables(),n=i(()=>this.trigger());this.originalSubscribe(e);for(let e=0,r=t.length;e<r;e++){const r=t[e];r.__$isObservableArray?r.deepSubscribe(n):r.subscribe(n)}},ve.prototype.configs=function(){return this.configs},ve.prototype.update=ve.prototype.set,p.init=function(e,t=null){return new ve(e,t)},p.arrayOfObject=function(e){return e.map(e=>p.object(e))},p.value=function(e){if(e?.__$isObservableArray){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.at(n);t.push(p.value(r))}return t}return e?.__$Observable?e.val():De.isProxy(e)?e.$value:e},g.prototype.resolve=function(){return p.value(this)},p.object=p.init,p.json=p.init,p.computed=function(e,t=[]){const n=new g(e()),o=i(()=>n.set(e(...t.map(e=>e.val()))));if(De.isFunction(t)){if(!De.isObservable(t.$observer))throw new r("Observable.computed : dependencies must be valid batch function");return t.$observer.subscribe(o),n}return t.forEach(e=>{De.isProxy(e)?e.$observables.forEach(e=>{e.subscribe(o)}):e.subscribe(o)}),n};const we=(e,t)=>p.computed(e,t),$e=(e,t)=>e.transform(t);g.prototype.isEqualTo=function(e){return e?.__$Observable?we((e,t)=>e===t,[this,e]):$e(this,t=>t===e)},g.prototype.isNotEqualTo=function(e){return e?.__$Observable?we((e,t)=>e!==t,[this,e]):$e(this,t=>t!==e)},g.prototype.isGreaterThan=function(e){return e?.__$Observable?we((e,t)=>e>t,[this,e]):$e(this,t=>t>e)},g.prototype.isGreaterThanOrEqualTo=function(e){return e?.__$Observable?we((e,t)=>e>=t,[this,e]):$e(this,t=>t>=e)},g.prototype.isLessThan=function(e){return e?.__$Observable?we((e,t)=>e<t,[this,e]):$e(this,t=>t<e)},g.prototype.isLessThanOrEqualTo=function(e){return e?.__$Observable?we((e,t)=>e<=t,[this,e]):$e(this,t=>t<=e)},g.prototype.isBetween=function(e,t){return e.__$Observable&&t.__$Observable?we((e,t,n)=>e>=t&&e<=n,[this,e,t]):e.__$Observable?we((e,n)=>e>=n&&e<=t,[this,e]):t.__$Observable?we((t,n)=>t>=e&&t<=n,[this,t]):$e(this,n=>n>=e&&n<=t)},g.prototype.isNull=function(){return $e(this,e=>null==e)},g.prototype.isTruthy=function(){return $e(this,e=>!!e)},g.prototype.isFalsy=function(){return $e(this,e=>!e)},g.prototype.isStartingWith=function(e){return e?.__$Observable?we((e,t)=>String(e).startsWith(t),[this,e]):$e(this,t=>String(t).startsWith(e))},g.prototype.isEndingWith=function(e){return e?.__$Observable?we((e,t)=>String(e).endsWith(t),[this,e]):$e(this,t=>String(t).endsWith(e))},g.prototype.isMatchingPattern=function(e){return e?.__$Observable?we((e,t)=>new RegExp(t).test(String(e)),[this,e]):$e(this,t=>e.test(String(t)))},g.prototype.isEmpty=function(){return $e(this,e=>null==e||""===e||Array.isArray(e)&&0===e.length)},g.prototype.isNotEmpty=function(){return $e(this,e=>null==e||""===e||Array.isArray(e)&&0!==e.length)},g.prototype.isIncludes=function(e){return e?.__$Observable?we((e,t)=>Array.isArray(e)?e.includes(t):String(e).includes(String(t)),[this,e]):$e(this,t=>Array.isArray(t)?t.includes(e):String(t).includes(String(e)))},g.prototype.isIncludedIn=function(e){return e?.__$Observable?we((e,t)=>t.includes(e),[this,e]):$e(this,t=>e.includes(t))},g.prototype.isOneOf=g.prototype.isIncludedIn,g.prototype.isHaving=function(e){return e?.__$Observable?we((e,t)=>t in Object(e),[this,e]):$e(this,t=>e in Object(t))},g.prototype.toUpperCase=function(){return $e(this,e=>String(e).toUpperCase())},g.prototype.toLowerCase=function(){return $e(this,e=>String(e).toLowerCase())},g.prototype.toTrimmed=function(){return $e(this,e=>String(e).trim())},g.prototype.toBoolean=function(){return $e(this,e=>!!e)},g.prototype.toLiteral=function(e,t="${v}"){return $e(this,n=>e.replace(t,n))},g.prototype.toFormatted=g.prototype.toLiteral,g.prototype.toProperty=function(e){const t=e.split(".");return $e(this,e=>{let n=e;for(const e of t){if(null==n)return;n=n[e]}return n})},g.prototype.toLength=function(){return $e(this,e=>null==e?0:e.length)},g.prototype.toClamped=function(e,t){return e.__$Observable&&t.__$Observable?we((e,t,n)=>Math.min(Math.max(e,t),n),[this,e,t]):e.__$Observable?we((e,n)=>Math.min(Math.max(e,n),t),[this,e]):t.__$Observable?we((t,n)=>Math.min(Math.max(t,e),n),[this,t]):$e(this,n=>Math.min(Math.max(n,e),t))},g.prototype.toPercent=function(e){return e?.__$Observable?we((e,t)=>0===t?0:e/t*100,[this,e]):$e(this,t=>0===e?0:t/e*100)};const Se=function(){const e=new Map,t=new Map,o=(t,o)=>{const s=e.get(o);if(!s)throw n.error("Store",`Store.${t}('${o}') : store not found. Did you call Store.create('${o}') first?`),new r(`Store.${t}('${o}') : store not found.`);return s},s=(e,t={})=>Array.isArray(e)?p.array(e,t):"object"==typeof e?p.object(e,t):p(e,t);return new Proxy({create(t,o){if(e.has(t))throw n.warn("Store",`Store.create('${t}') : a store with this name already exists. Use Store.get('${t}') to retrieve it.`),new r(`Store.create('${t}') : a store with this name already exists.`);const i=s(o);return e.set(t,{observer:i,subscribers:new Set,resettable:!1,composed:!1}),i},createResettable(t,o){if(e.has(t))throw n.warn("Store",`Store.createResettable('${t}') : a store with this name already exists.`),new r(`Store.createResettable('${t}') : a store with this name already exists.`);const i=s(o,{reset:!0});return e.set(t,{observer:i,subscribers:new Set,resettable:!0,composed:!1}),i},createComposed(t,o,s){if(e.has(t))throw n.warn("Store",`Store.createComposed('${t}') : a store with this name already exists.`),new r(`Store.createComposed('${t}') : a store with this name already exists.`);if("function"!=typeof o)throw new r(`Store.createComposed('${t}') : computation must be a function.`);if(!Array.isArray(s)||0===s.length)throw new r(`Store.createComposed('${t}') : dependencies must be a non-empty array of store names.`);const i=s.map(o=>{if("string"!=typeof o)return o;const s=e.get(o);if(!s)throw n.error("Store",`Store.createComposed('${t}') : dependency '${o}' not found. Create it first.`),new r(`Store.createComposed('${t}') : dependency store '${o}' not found.`);return s.observer}),a=p.computed(o,i);return e.set(t,{observer:a,subscribers:new Set,resettable:!1,composed:!0}),a},has:t=>e.has(t),reset(e){const t=o("reset",e);if(t.composed)throw n.error("Store",`Store.reset('${e}') : composed stores cannot be reset. Their value is derived from dependencies.`),new r(`Store.reset('${e}') : composed stores cannot be reset.`);if(!t.resettable)throw n.error("Store",`Store.reset('${e}') : this store is not resettable. Use Store.createResettable('${e}', value) instead of Store.create().`),new r(`Store.reset('${e}') : this store is not resettable. Use Store.createResettable('${e}', value) instead of Store.create().`);t.observer.reset()},use(e){const t=o("use",e);if(t.composed)throw n.error("Store",`Store.use('${e}') : composed stores are read-only. Use Store.follow('${e}') instead.`),new r(`Store.use('${e}') : composed stores are read-only. Use Store.follow('${e}') instead.`);const{observer:i,subscribers:a}=t,l=s(i.val()),u=e=>l.set(e),c=e=>i.set(e);return i.subscribe(u),l.subscribe(c),l.destroy=()=>{i.unsubscribe(u),l.unsubscribe(c),a.delete(l),l.cleanup()},l.dispose=l.destroy,a.add(l),l},follow(e){const{observer:t,subscribers:i}=o("follow",e),a=s(t.val()),l=e=>a.set(e);return t.subscribe(l),((e,t,o)=>{const s=e=>()=>{throw n.error("Store",`Store.${o}('${t}') is read-only. '${e}()' is not allowed.`),new r(`Store.${o}('${t}') is read-only.`)};e.set=s("set"),e.toggle=s("toggle"),e.reset=s("reset")})(a,e,"follow"),a.destroy=()=>{t.unsubscribe(l),i.delete(a),a.cleanup()},a.dispose=a.destroy,i.add(a),a},get(t){const r=e.get(t);return r?r.observer:(n.warn("Store",`Store.get('${t}') : store not found.`),null)},getWithSubscribers:t=>e.get(t)??null,delete(t){const r=e.get(t);r?(r.subscribers.forEach(e=>e.destroy()),r.subscribers.clear(),r.observer.cleanup(),e.delete(t)):n.warn("Store",`Store.delete('${t}') : store not found, nothing to delete.`)},group(e,t){"function"==typeof e&&(t=e,e="anonymous");const n=Se();return t&&t(n),n},createPersistent(e,t,n){n=n||e;const r=this.create(e,b(n,t)),o=y(t);return r.subscribe(e=>o(n,e)),r},createPersistentResettable(e,t,n){n=n||e;const r=this.createResettable(e,b(n,t)),o=y(t);r.subscribe(e=>o(n,e));const s=r.reset.bind(r);return r.reset=()=>{m.remove(n),s()},r}},{get(e,n){if("symbol"==typeof n||n.startsWith("$")||n in e)return e[n];if(e.has(n)){if(t.has(n))return t.get(n);const r=e.follow(n);return t.set(n,r),r}},set(e,t,o){throw n.error("Store",`Forbidden: You cannot overwrite the store key '${String(t)}'. Use .use('${String(t)}').set(value) instead.`),new r("Store structure is immutable. Use .set() on the observable.")},deleteProperty(e,t){throw new r("Store keys cannot be deleted.")}})},Ce=Se();function Oe(e,t=!1){const n=new T(e);n.onConnectedOnce(e=>{t&&function(e,t){e.remove=()=>{e.append.apply(e,t.childNodes)},e.getParent=()=>t,e.appendChild=e=>{e=De.isElement(e)?e:M.getChild(e),t.appendChild(e)},e.appendChildRaw=t.appendChild.bind(t),e.append=e.appendChild,e.appendRaw=e.appendChildRaw,e.insertAtStart=e=>{e=De.isElement(e)?e:M.getChild(e),t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},e.insertAtStartRaw=e=>{t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},e.appendElement=e.appendChild,e.removeChildren=()=>{t.textContent=""},e.replaceContent=function(e){const n=De.isElement(e)?e:M.getChild(e);t.replaceChildren(n)},e.replaceContentRaw=function(e){t.replaceChildren(e)},e.setContent=e.replaceContent,e.insertBefore=(e,n)=>{e=De.isElement(e)?e:M.getChild(e),t.insertBefore(e,n)},e.insertBeforeRaw=(e,n)=>{t.insertBefore(e,n)},e.appendChildBefore=e.insertBefore,e.appendChildBeforeRaw=e.insertBeforeRaw,e.clear=e.remove,e.detach=e.remove,e.replaceChildren=function(){t.replaceChildren(...arguments)},e.getByIndex=e=>t.childNodes[e]}(n,e)}),n.__Anchor__=!0;const r=n.$start,o=n.$end;n.nativeInsertBefore=n.insertBefore,n.nativeAppendChild=n.appendChild,n.nativeAppend=n.append;const s=t?()=>!0:e=>e.firstChild===r&&e.lastChild===o,i=(e,t,r)=>{e!==n?s(e)&&r===o?e.append(t,r):e.insertBefore(t,r):e.nativeInsertBefore(t,r)};return n.appendElement=function(e){const t=r.parentNode;t!==n?t.insertBefore(e,o):t.nativeInsertBefore(e,o)},n.appendChild=function(e,t=null){const n=o.parentNode;n?((e,t,n)=>{const r=De.isElement(t)?t:M.getChild(t);i(e,r,n)})(n,e,t=t??o):DebugManager.error("Anchor","Anchor : parent not found",e)},n.appendChildRaw=function(e,t=null){const n=o.parentNode;n?i(n,e,t=t??o):DebugManager.error("Anchor","Anchor : parent not found",e)},n.getParent=()=>o.parentNode,n.append=n.appendChild,n.appendRaw=n.appendChildRaw,n.insertAtStart=function(e){e=De.isElement(e)?e:M.getChild(e),n.insertAtStartRaw(e)},n.insertAtStartRaw=function(e){const t=r.parentNode;t!==n?t.insertBefore(e,r):t.nativeInsertBefore(e,r)},n.removeChildren=function(){const e=o.parentNode;if(e===n)return;if(s(e))return void e.replaceChildren(r,o);let t,i=r.nextSibling;for(;i&&i!==o;)t=i.nextSibling,i.remove(),i=t},n.remove=function(){const e=o.parentNode;if(e===n)return;if(s(e))return n.nativeAppend.apply(n,e.childNodes),void e.replaceChildren(r,o);let t,i=r.nextSibling;for(;i&&i!==o;)t=i.nextSibling,n.nativeAppend(i),i=t},n.removeWithAnchors=function(){n.removeChildren(),r.remove(),o.remove()},n.delete=n.removeWithAnchors,n.replaceContent=function(e){const t=De.isElement(e)?e:M.getChild(e);n.replaceContentRaw(t)},n.replaceContentRaw=function(e){const t=o.parentNode;t&&(s(t)?t.replaceChildren(r,e,o):(n.removeChildren(),t.insertBefore(e,o)))},n.setContent=n.replaceContent,n.setContentRaw=n.replaceContentRaw,n.insertBefore=n.appendChild,n.insertBeforeRaw=n.appendChildRaw,n.endElement=function(){return o},n.startElement=function(){return r},n.restore=function(){n.appendChild(n)},n.clear=n.remove,n.detach=n.remove,n.getByIndex=function(e){let t=r;for(let n=0;n<=e;n++){if(!t.nextSibling)return null;t=t.nextSibling}return t!==r?t:null},n}function Ae(e){this.$element=e,this.$attachements=null}Ce.create("locale",navigator.language.split("-")[0]||"en"),DocumentFragment.prototype.setAttribute=()=>{},Ae.prototype.__$isNDElement=!0,Ae.prototype.ghostDom=function(e){return this.$attachements||(this.$attachements=document.createDocumentFragment()),this.$attachements.appendChild(M.getChild(e)),this},Ae.prototype.valueOf=function(){return this.$element},Ae.prototype.ref=function(e,t){return e[t]=this.$element,this},Ae.prototype.refSelf=function(e,t){return e[t]=this,this},Ae.prototype.unmountChildren=function(){let e=this.$element;for(let t=0,n=e.children.length;t<n;t++){let n=e.children[t];n.$ndProx||n.nd?.remove(),n=null}return e=null,this},Ae.prototype.remove=function(){let e=this.$element;return e.nd.unmountChildren(),e.$ndProx=null,Ee.delete(e),e=null,this};const Ee=new WeakMap;Ae.prototype.lifecycle=function(e){const t=this.$element;Ee.has(t)||Ee.set(t,C.watch(t));const n=Ee.get(t);return e.mounted&&(this.$element.setAttribute("data--nd-mounted","1"),n.mounted(e.mounted)),e.unmounted&&(this.$element.setAttribute("data--nd-unmounted","1"),n.unmounted(e.unmounted)),this},Ae.prototype.mounted=function(e){return this.lifecycle({mounted:e})},Ae.prototype.unmounted=function(e){return this.lifecycle({unmounted:e})},Ae.prototype.beforeUnmount=function(e,t){const n=this.$element;if(!C.beforeUnmount.has(n)){C.beforeUnmount.set(n,new Map);const e=n.remove.bind(n);let t=!1;n.remove=async()=>{if(!t){t=!0;try{const e=C.beforeUnmount.get(n);for(const t of e.values())await t.call(this,n)}finally{e(),t=!1}}}}return C.beforeUnmount.get(n).set(e,t),this},Ae.prototype.htmlElement=function(){return this.$element},Ae.prototype.node=Ae.prototype.htmlElement,Ae.prototype.shadow=function(e,t=null){const n=this.$element,r=Array.from(n.childNodes),o=n.attachShadow({mode:e});if(t){const e=document.createElement("style");e.textContent=t,o.appendChild(e)}return n.append=o.append.bind(o),n.appendChild=o.appendChild.bind(o),o.append(...r),this},Ae.prototype.openShadow=function(e=null){return this.shadow("open",e)},Ae.prototype.closedShadow=function(e=null){return this.shadow("closed",e)},Ae.prototype.with=function(e){if(!e||"object"!=typeof e)throw new r("extend() requires an object of methods");for(const t in e){const r=e[t];"function"==typeof r?this[t]=r.bind(this):n.warn(`⚠️ extends(): "${t}" is not a function, skipping`)}return this},Ae.extend=function(e){if(!e||"object"!=typeof e)throw new r("NDElement.extend() requires an object of methods");if(Array.isArray(e))throw new r("NDElement.extend() requires an object, not an array");const t=new Set(["constructor","valueOf","$element","$observer","ref","remove","cleanup","with","extend","attach","lifecycle","mounted","unmounted","unmountChildren"]);for(const o in e){if(!Object.hasOwn(e,o))continue;const s=e[o];if("function"==typeof s){if(t.has(o))throw n.error("NDElement.extend",`Cannot override protected method "${o}"`),new r(`Cannot override protected method "${o}"`);Ae.prototype[o]&&n.warn("NDElement.extend",`Overwriting existing prototype method "${o}"`),Ae.prototype[o]=s}else n.warn("NDElement.extend",`"${o}" is not a function, skipping`)}return Ae};const _e=3,xe=8,Ne=11,Fe=[];Fe[1]=!0,Fe[_e]=!0,Fe[Ne]=!0,Fe[xe]=!0;const De={isObservable:e=>e&&(e.__$isObservable||e.__$Observable),isTemplateBinding:e=>e?.__$isTemplateBinding,isObservableWhenResult:e=>e&&(e.__$isObservableWhen||"object"==typeof e&&"$target"in e&&"$observer"in e),isArrayObservable:e=>e?.__$isObservableArray,isProxy:e=>e?.__isProxy__,isObservableOrProxy:e=>De.isObservable(e)||De.isProxy(e),isAnchor:e=>e?.__Anchor__,isObservableChecker:e=>e?.__$isObservableChecker||e instanceof $,isArray:e=>Array.isArray(e),isString:e=>"string"==typeof e,isNumber:e=>"number"==typeof e,isBoolean:e=>"boolean"==typeof e,isFunction:e=>"function"==typeof e,isAsyncFunction:e=>"function"==typeof e&&"AsyncFunction"===e.constructor.name,isObject:e=>"object"==typeof e&&null!==e,isJson:e=>!("object"!=typeof e||null===e||Array.isArray(e)||"Object"!==e.constructor.name),isElement:e=>e&&Fe[e.nodeType],isDOMNode:e=>Fe[e.nodeType],isFragment:e=>e?.nodeType===Ne,isStringOrObservable(e){return this.isString(e)||this.isObservable(e)},isValidChild(e){return null===e||this.isElement(e)||this.isObservable(e)||this.isNDElement(e)||["string","number","boolean"].includes(typeof e)},isNDElement:e=>e?.__$isNDElement||e instanceof Ae,isValidChildren(e){Array.isArray(e)||(e=[e]);return 0===e.filter(e=>!this.isValidChild(e)).length},validateChildren(e){Array.isArray(e)||(e=[e]);const t=e.filter(e=>!this.isValidChild(e));if(t.length>0)throw new r(`Invalid children detected: ${t.map(e=>typeof e).join(", ")}`);return e},containsObservables:e=>!!e&&(De.isObject(e)&&Object.values(e).some(e=>De.isObservable(e))),containsObservableReference:e=>!(!e||"string"!=typeof e)&&/\{\{#ObItem::\([0-9]+\)\}\}/.test(e),validateAttributes(e){},validateEventCallback(e){if("function"!=typeof e)throw new r("Event callback must be a function")}},Me={configurable:!0,get(){return new Ae(this)}};Object.defineProperty(HTMLElement.prototype,"nd",Me),Object.defineProperty(DocumentFragment.prototype,"nd",Me),Object.defineProperty(Ae.prototype,"nd",{configurable:!0,get:function(){return this}}),["Click","DblClick","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","Wheel","KeyDown","KeyPress","KeyUp","Blur","Change","Focus","Input","Invalid","Reset","Search","Select","Submit","Drag","DragEnd","DragEnter","DragLeave","DragOver","DragStart","Drop","AfterPrint","BeforePrint","BeforeUnload","Error","HashChange","Load","Offline","Online","PageHide","PageShow","Resize","Scroll","Unload","Abort","CanPlay","CanPlayThrough","DurationChange","Emptied","Ended","LoadedData","LoadedMetadata","LoadStart","Pause","Play","Playing","Progress","RateChange","Seeked","Seeking","Stalled","Suspend","TimeUpdate","VolumeChange","Waiting","TouchCancel","TouchEnd","TouchMove","TouchStart","AnimationEnd","AnimationIteration","AnimationStart","TransitionEnd","Copy","Cut","Paste","FocusIn","FocusOut","ContextMenu"].forEach(e=>{const t=e.toLowerCase();Ae.prototype["on"+e]=function(e=null){return this.$element.addEventListener(t,e),this}}),["Click","DblClick","MouseDown","MouseMove","MouseOut","MouseOver","MouseUp","Wheel","KeyDown","KeyPress","KeyUp","Change","Input","Invalid","Reset","Search","Select","Submit","Drag","DragEnd","DragEnter","DragLeave","DragOver","DragStart","Drop","BeforeUnload","HashChange","TouchCancel","TouchEnd","TouchMove","TouchStart","AnimationEnd","AnimationIteration","AnimationStart","TransitionEnd","Copy","Cut","Paste","FocusIn","FocusOut","ContextMenu"].forEach(e=>{const t=e.toLowerCase();Ae.prototype["onStop"+e]=function(e=null){return ke(this.$element,t,e),this},Ae.prototype["onPreventStop"+e]=function(e=null){return Pe(this.$element,t,e),this}}),["Click","DblClick","MouseDown","MouseUp","Wheel","KeyDown","KeyPress","Invalid","Reset","Submit","DragOver","Drop","BeforeUnload","TouchCancel","TouchEnd","TouchMove","TouchStart","Copy","Cut","Paste","ContextMenu"].forEach(e=>{const t=e.toLowerCase();Ae.prototype["onPrevent"+e]=function(e=null){return Te(this.$element,t,e),this}}),Ae.prototype.on=function(e,t,n){return this.$element.addEventListener(e.toLowerCase(),t,n),this};const Te=function(e,t,n){return e.addEventListener(t,t=>{t.preventDefault(),n&&n.call(e,t)}),this},ke=function(e,t,n){return e.addEventListener(t,t=>{t.stopPropagation(),n&&n.call(e,t)}),this},Pe=function(e,t,n){return e.addEventListener(t,t=>{t.stopPropagation(),t.preventDefault(),n&&n.call(e,t)}),this},Ie={getClasses(){return this.$element.className?.split(" ").filter(Boolean)},add(e){const t=this.getClasses();t.indexOf(e)>=0||(t.push(e),this.$element.className=t.join(" "))},remove(e){const t=this.getClasses(),n=t.indexOf(e);n<0||(t.splice(n,1),this.$element.className=t.join(" "))},toggle(e,t=void 0){const n=this.getClasses(),r=n.indexOf(e);if(r>=0){if(!0===t)return;n.splice(r,1)}else{if(!1===t)return;n.push(e)}this.$element.className=n.join(" ")},contains(e){return this.getClasses().indexOf(e)>=0}};Object.defineProperty(HTMLElement.prototype,"classes",{configurable:!0,get(){return{$element:this,...Ie}}});const Le=e=>e?e.toNdElement():M.createTextNode(),Re=(e,t,n=null)=>{let{props:r,children:o=null}=j(t,n);return M.processAttributes(e,r),M.processChildren(o,e),e};function Ve(e,t=null){if(e){if(t){let n=null,r=(o,s)=>(n=document.createElement(e),r=(e,r)=>Re(t(n.cloneNode()),e,r),Re(t(n.cloneNode()),o,s));return(e,t)=>r(e,t)}let n=null,r=(t,o)=>(n=document.createElement(e),r=(e,t)=>Re(n.cloneNode(),e,t),Re(n.cloneNode(),t,o));return(e,t)=>r(e,t)}return(e,t="")=>{const n=Oe(t);return n.append(e),n}}const je=e=>e;const Be=new Set(["clear","push","unshift","replace"]),We=e=>e;const qe=function(e,t,{comment:r=null,shouldKeepInCache:o=!0}={}){if(!De.isObservable(e))return"boolean"==typeof e?e?M.getChild(t):null:n.warn("ShowIf","ShowIf : condition must be an Observable or boolean / "+r,e);const s=Oe("Show if : "+(r||""));let i=null;const a=()=>(i&&o||(i=M.getChild(t),De.isFragment(i)&&(i=Array.from(i.childNodes))),i);return e.val()&&s.appendChild(a()),e.subscribe(e=>{e?s.appendChild(a()):s.remove()}),s},Ue=function(e,t,n=!0){if(!De.isObservable(e))throw new r("Toggle : condition must be an Observable");const o=Oe("Match"),s=new Map,i=function(e){if(n&&s.has(e))return s.get(e);let r=t[e];return r?(r=M.getChild(r),De.isFragment(r)&&(r=Array.from(r.children)),n&&s.set(e,r),r):null},a=e.val(),l=i(a);return l&&o.appendChild(l),e.subscribe(e=>{const t=i(e);o.remove(),t&&o.appendChild(t)}),o.nd.with({add(n,r,o=!1){t[n]=r,o&&e.set(n)},remove(r){n&&s.delete(r),e.set([...s.keys()].at(-1)??""),delete t[r]}})},He=function(e,t,n){if(!De.isObservable(e))throw new r("Toggle : condition must be an Observable");return Ue(e.toBoolean(),{true:t,false:n})},ze=Ve("div"),Ge=Ve("span"),Ke=Ve("label"),Je=Ve("p"),Ye=Je,Qe=Ve("strong"),Xe=Ve("h1"),Ze=Ve("h2"),et=Ve("h3"),tt=Ve("h4"),nt=Ve("h5"),rt=Ve("h6"),ot=Ve("br"),st=Ve("a"),it=Ve("pre"),at=Ve("code"),lt=Ve("blockquote"),ut=Ve("hr"),ct=Ve("em"),ht=Ve("small"),pt=Ve("mark"),dt=Ve("del"),ft=Ve("ins"),mt=Ve("sub"),bt=Ve("sup"),yt=Ve("abbr"),gt=Ve("cite"),vt=Ve("q"),wt=Ve("dl"),$t=Ve("dt"),St=Ve("dd"),Ct=Ve("form",function(e){return e.submit=function(t){return"function"==typeof t?(e.onSubmit(e=>{e.preventDefault(),t(e)}),e):(this.setAttribute("action",t),e)},e.multipartFormData=function(){return this.setAttribute("enctype","multipart/form-data"),e},e.post=function(t){return this.setAttribute("method","post"),this.setAttribute("action",t),e},e.get=function(e){this.setAttribute("method","get"),this.setAttribute("action",e)},e}),Ot=Ve("input"),At=Ve("textarea"),Et=At,_t=Ve("select"),xt=Ve("fieldset"),Nt=Ve("option"),Ft=Ve("legend"),Dt=Ve("datalist"),Mt=Ve("output"),Tt=Ve("progress"),kt=Ve("meter"),Pt=Ve("button"),It=Ve("main"),Lt=Ve("section"),Rt=Ve("article"),Vt=Ve("aside"),jt=Ve("nav"),Bt=Ve("figure"),Wt=Ve("figcaption"),qt=Ve("header"),Ut=Ve("footer"),Ht=Ve("img"),zt=function(e,t){return Ht({src:e,...t})},Gt=Ve("details"),Kt=Ve("summary"),Jt=Ve("dialog"),Yt=Ve("menu"),Qt=Ve("ol"),Xt=Ve("ul"),Zt=Ve("li"),en=Zt,tn=Qt,nn=Xt,rn=Ve("audio"),on=Ve("video"),sn=Ve("source"),an=Ve("track"),ln=Ve("canvas"),un=Ve("svg"),cn=Ve("time"),hn=Ve("data"),pn=Ve("address"),dn=Ve("kbd"),fn=Ve("samp"),mn=Ve("var"),bn=Ve("wbr"),yn=Ve("caption"),gn=Ve("table"),vn=Ve("thead"),wn=Ve("tfoot"),$n=Ve("tbody"),Sn=Ve("tr"),Cn=Sn,On=Ve("th"),An=On,En=On,_n=Ve("td"),xn=_n;function Nn(e){let t=null,n=(r,o)=>(t=document.createElementNS("http://www.w3.org/2000/svg",e),n=(e,n)=>Re(t.cloneNode(),e,n),Re(t.cloneNode(),r,o));return(e,t)=>n(e,t)}const Fn=Nn("svg"),Dn=Nn("circle"),Mn=Nn("rect"),Tn=Nn("ellipse"),kn=Nn("line"),Pn=Nn("polyline"),In=Nn("polygon"),Ln=Nn("path"),Rn=Nn("text"),Vn=Nn("tspan"),jn=Nn("textPath"),Bn=Nn("g"),Wn=Nn("defs"),qn=Nn("use"),Un=Nn("symbol"),Hn=Nn("clipPath"),zn=Nn("mask"),Gn=Nn("marker"),Kn=Nn("pattern"),Jn=Nn("image"),Yn=Nn("foreignObject"),Qn=Nn("switch"),Xn=Nn("linearGradient"),Zn=Nn("radialGradient"),er=Nn("stop"),tr=Nn("filter"),nr=Nn("feBlend"),rr=Nn("feColorMatrix"),or=Nn("feComposite"),sr=Nn("feFlood"),ir=Nn("feGaussianBlur"),ar=Nn("feMerge"),lr=Nn("feMergeNode"),ur=Nn("feOffset"),cr=Nn("feTurbulence"),hr=Nn("feDisplacementMap"),pr=Nn("feDiffuseLighting"),dr=Nn("feSpecularLighting"),fr=Nn("feDistantLight"),mr=Nn("fePointLight"),br=Nn("feSpotLight"),yr=Nn("feMorphology"),gr=Nn("feConvolveMatrix"),vr=Nn("feComponentTransfer"),wr=Nn("feFuncR"),$r=Nn("feFuncG"),Sr=Nn("feFuncB"),Cr=Nn("feFuncA"),Or=Nn("animate"),Ar=Nn("animateTransform"),Er=Nn("animateMotion"),_r=Nn("mpath"),xr=Nn("set"),Nr=Nn("desc"),Fr=Nn("title"),Dr=Nn("metadata"),Mr=Nn("view"),Tr=Nn("style"),kr=Nn("script"),Pr=Ve("");var Ir=Object.freeze({__proto__:null,Abbr:yt,Address:pn,Anchor:Oe,Article:Rt,Aside:Vt,AsyncImg:function(e,t,n,o){const s=De.isObservable(e)?e.val():e,i=zt(t||s,n),a=new Image;return a.onload=()=>{De.isFunction(o)&&o(null,i),i.src=De.isObservable(e)?e.val():e},a.onerror=()=>{De.isFunction(o)&&o(new r("Image not found"))},De.isObservable(e)&&e.subscribe(e=>{a.src=e}),a.src=s,i},Audio:rn,BaseImage:Ht,Blockquote:lt,Br:ot,Button:Pt,Canvas:ln,Caption:yn,Checkbox:e=>Ot({type:"checkbox",...e}),Cite:gt,Code:at,ColorInput:e=>Ot({type:"color",...e}),Data:hn,Datalist:Dt,DateInput:e=>Ot({type:"date",...e}),DateTimeInput:e=>Ot({type:"datetime-local",...e}),Dd:St,Del:dt,Details:Gt,Dialog:Jt,Div:ze,Dl:wt,Dt:$t,Em:ct,EmailInput:e=>Ot({type:"email",...e}),FieldSet:xt,FigCaption:Wt,Figure:Bt,FileInput:e=>Ot({type:"file",...e}),Footer:Ut,ForEach:function(e,t,o,{shouldKeepItemsInCache:s=!1}={}){t=t||je;const i=Oe("ForEach"),a=i.endElement();i.startElement();let l=new Map,u=null;const c=new Set,h=e=>{if(!s)for(const[t,n]of l.entries()){if(c.has(t))continue;const r=n.child?.deref();e&&r&&r.remove(),n.indexObserver?.cleanup(),n.child=null,n.indexObserver=null,l.delete(n.keyId),u&&u.delete(n.keyId)}},d=(e,s)=>{const i=((e,t,n)=>{if(De.isString(n)){const r=De.isObservable(e)?e.val():e,o=r?.[n];return De.isObservable(o)?o.val():o??t}return De.isFunction(n)?n(e,t):(De.isObservable(e)?e.val():e)??t})(e,s,o);if(l.has(i)){const e=l.get(i);if(e.indexObserver?.set(s),e.isNew=!1,e.child?.deref())return i;l.delete(i)}try{const n=t.length>=2?p(s):null;let o=M.getChild(t(e,n));if(!o)throw new r("ForEach child can't be null or undefined!");l.set(i,{keyId:i,isNew:!0,child:new WeakRef(o),indexObserver:n})}catch(e){throw n.error("ForEach",`Error creating element for key ${i}`,e),e}return i},f=()=>{const t=a.parentNode;if(!t)return;const n=De.isObservable(e)?e.val():e;if(c.clear(),Array.isArray(n))for(let e=0,t=n.length;e<t;e++){const t=d(n[e],e);c.add(t)}else for(const e in n){const t=d(n[e],e);c.add(t)}if(0===c.size)return i.removeChildren(),h(),void u?.clear();h(t),u&&0!==u.size?(()=>{let e=document.createDocumentFragment();const t=Array.from(c);Array.from(u);for(const n in t){const r=t[n],o=l.get(r);if(!o)continue;const s=o.child.deref();s&&e.appendChild(s)}i.replaceContent(e)})():(e=>{const t=document.createDocumentFragment();for(const e of c){const n=l.get(e);if(!n)continue;const r=n.child?.deref();r&&t.appendChild(r)}e.insertBefore(t,a)})(t),u?.clear(),u=new Set([...c])};return f(),De.isObservable(e)&&e.subscribe(f),i},ForEachArray:function(e,t,n={}){t=t||We;const r=Oe("ForEach Array",n.isParentUniqueChild),o=r.endElement();let s=new Map,i=0;const a=t.length>=2,l=e=>{r.removeChildren(),f(e),i=0},u=e=>s.get(e)?.child,c=(e,t=!0)=>{const n=s.get(e);if(n){if(t){const t=n.child;t?.remove(),s.delete(e)}n.indexObserver?.cleanup()}},h=e=>{const n=M.getChild(t(e,null));return s.set(e,{child:n,indexObserver:null}),n};let p=(n,r)=>{const o=e.transform(e=>e.indexOf(n)),i=M.getChild(t(n,o));return s.set(n,{child:i,indexObserver:o}),i};e.__$Observable||(p=(e,n)=>{const r=M.getChild(t(e,n));return s.set(e,{child:r,indexObserver:null}),r});const d=(e,t)=>{const n=s.get(e);return n?(n.indexObserver?.set(t),n.child):h(e)};let f,m=h;f=a?n.shouldKeepItemsInCache?()=>{}:e=>{for(const[t,n]of s.entries())e&&e.includes(t)||c(t,!1)}:s.clear.bind(s);const b=(e,t)=>{const n=s.get(e);if(!n)return null;const r=n.child;if(!r)return null;t?t.appendChild(r):r.remove()};let y=null;y=Array.isArray(e)?()=>{l(e),r.appendChildRaw(g.toFragment(e))}:()=>{const t=e.val();l(t),r.appendChildRaw(g.toFragment(t))};const g={toFragment:e=>{const t=document.createDocumentFragment();for(let n=0,r=e.length;n<r;n++)t.appendChild(m(e[n],i)),i++;return t},add:e=>{r.appendChildRaw(g.toFragment(e))},replace:e=>{l(e),r.appendChildRaw(g.toFragment(e))},set:y,reOrder:e=>{let t=null;const n=document.createDocumentFragment();for(const r of e)t=u(r),t&&n.appendChild(t);t=null,r.appendElementRaw(n)},removeOne:(e,t)=>{c(e,!0)},clear:l,populate:([e,t,n])=>{const o=document.createDocumentFragment();for(let r=0;r<t;r++){const t=n(r);e.push(t),o.append(m(t,r)),i++}r.appendChildRaw(o),o.replaceChildren()},unshift:e=>{r.insertAtStartRaw(g.toFragment(e))},splice:(t,n)=>{const[s,i,...a]=t;let l=null;const c=document.createDocumentFragment();if(n.length>0){let e=n[0];if(1===n.length)b(e,c);else if(n.length>1){const e=u(n[0]);l=e?.previousSibling;for(let e=0;e<n.length;e++)b(n[e],c)}}else{const t=s-1>=0?s-1:s,n=e.at(t);l=u(n)||o.previousSibling}c.replaceChildren(),a&&a.length&&l&&r.insertBeforeRaw(g.toFragment(a),l.nextSibling)},reverse:(e,t)=>{g.reOrder(t)},sort:(e,t)=>{g.reOrder(t)},remove:(e,t)=>{g.removeOne(t)},pop:(e,t)=>{g.removeOne(t)},shift:(e,t)=>{g.removeOne(t)},swap:(e,t)=>{const n=r.getParent();let o=u(t[0]),s=u(t[1]);if(!o||!s)return;const i=s.nextSibling;n.insertBefore(s,o),n.insertBefore(o,i),o=null,s=null}};g.merge=g.add,g.push=g.add;const v=(e,t,n={})=>{((e=null)=>{m=Be.has(e)?a?p:h:s.size?d:a?p:h})(n.action),g[n.action]&&g[n.action](n.args,n.result)};return Array.isArray(e)?(v(0,0,{action:"set"}),r):(e.val().length&&v(e.val(),0,{action:"set"}),e.subscribe(v),r)},Form:Ct,Fragment:Pr,H1:Xe,H2:Ze,H3:et,H4:tt,H5:nt,H6:rt,Header:qt,HiddenInput:e=>Ot({type:"hidden",...e}),HideIf:function(e,t,n){const r=p(!e.val());return e.subscribe(e=>r.set(!e)),qe(r,t,n)},HideIfNot:function(e,t,n){return qe(e,t,n)},Hr:ut,Img:zt,Input:Ot,Ins:ft,Kbd:dn,Label:Ke,LazyImg:function(e,t){return zt(e,{...t,loading:"lazy"})},Legend:Ft,Li:en,Link:st,ListItem:Zt,Main:It,Mark:pt,Match:Ue,Menu:Yt,Meter:kt,MonthInput:e=>Ot({type:"month",...e}),NativeDocumentFragment:Oe,Nav:jt,NumberInput:e=>Ot({type:"number",...e}),Ol:tn,Option:Nt,OrderedList:Qt,Output:Mt,P:Je,Paragraph:Ye,PasswordInput:e=>Ot({type:"password",...e}),Pre:it,Progress:Tt,Quote:vt,Radio:e=>Ot({type:"radio",...e}),RangeInput:e=>Ot({type:"range",...e}),ReadonlyInput:e=>Ot({readonly:!0,...e}),Samp:fn,SearchInput:e=>Ot({type:"search",...e}),Section:Lt,Select:_t,ShowIf:qe,ShowWhen:function(){if(2===arguments.length){const[e,t]=arguments;if(!De.isObservableWhenResult(e))throw new r("showWhen observer must be an ObservableWhenResult",{data:e,help:"Use observer.when(target) to create an ObservableWhenResult"});return qe(e,t)}if(3===arguments.length){const[e,t,n]=arguments;if(!De.isObservable(e))throw new r("showWhen observer must be an Observable",{data:e});return qe(e.when(t),n)}throw new r("showWhen must have 2 or 3 arguments",{data:["showWhen(observer, target, view)","showWhen(observerWhenResult, view)"]})},SimpleButton:(e,t)=>Pt(e,{type:"button",...t}),Small:ht,Source:sn,Span:Ge,Strong:Qe,Sub:mt,SubmitButton:(e,t)=>Pt(e,{type:"submit",...t}),Summary:Kt,Sup:bt,Svg:un,SvgAnimate:Or,SvgAnimateMotion:Er,SvgAnimateTransform:Ar,SvgCircle:Dn,SvgClipPath:Hn,SvgDefs:Wn,SvgDesc:Nr,SvgEllipse:Tn,SvgFEBlend:nr,SvgFEColorMatrix:rr,SvgFEComponentTransfer:vr,SvgFEComposite:or,SvgFEConvolveMatrix:gr,SvgFEDiffuseLighting:pr,SvgFEDisplacementMap:hr,SvgFEDistantLight:fr,SvgFEFlood:sr,SvgFEFuncA:Cr,SvgFEFuncB:Sr,SvgFEFuncG:$r,SvgFEFuncR:wr,SvgFEGaussianBlur:ir,SvgFEMerge:ar,SvgFEMergeNode:lr,SvgFEMorphology:yr,SvgFEOffset:ur,SvgFEPointLight:mr,SvgFESpecularLighting:dr,SvgFESpotLight:br,SvgFETurbulence:cr,SvgFilter:tr,SvgForeignObject:Yn,SvgG:Bn,SvgImage:Jn,SvgLine:kn,SvgLinearGradient:Xn,SvgMPath:_r,SvgMarker:Gn,SvgMask:zn,SvgMetadata:Dr,SvgPath:Ln,SvgPattern:Kn,SvgPolygon:In,SvgPolyline:Pn,SvgRadialGradient:Zn,SvgRect:Mn,SvgScript:kr,SvgSet:xr,SvgStop:er,SvgStyle:Tr,SvgSvg:Fn,SvgSwitch:Qn,SvgSymbol:Un,SvgTSpan:Vn,SvgText:Rn,SvgTextPath:jn,SvgTitle:Fr,SvgUse:qn,SvgView:Mr,Switch:He,TBody:$n,TBodyCell:xn,TFoot:wn,TFootCell:En,THead:vn,THeadCell:An,TRow:Cn,Table:gn,Td:_n,TelInput:e=>Ot({type:"tel",...e}),TextArea:At,TextInput:Et,Th:On,Time:cn,TimeInput:e=>Ot({type:"time",...e}),Tr:Sn,Track:an,Ul:nn,UnorderedList:Xt,UrlInput:e=>Ot({type:"url",...e}),Var:mn,Video:on,Wbr:bn,WeekInput:e=>Ot({type:"week",...e}),When:function(e){if(!De.isObservable(e))throw new r("When : condition must be an Observable");let t=null,n=null;return{show(e){return t=e,this},otherwise:r=>(n=r,He(e,t,n)),toNdElement:()=>He(e,t,n)}},createPortal:function(e,{parent:t,name:n="unnamed"}={}){const r=Oe("Portal "+n);return r.appendChild(M.getChild(e)),(t||document.body).appendChild(r),r}});const Lr={};function Rr(e,t,n={}){e="/"+a(e,"/").replace(/\/+/,"/");let r=null,o=n.name||null;const s=n.middlewares||[],i=n.shouldRebuild||!1,l=n.with||{},u=n.layout||null,c={},h=[],p=e=>{if(!e)return null;const[t,n]=e.split(":");let r=l[t];return!r&&n&&(r=Lr[n]),r||(r="[^/]+"),r=r.replace("(","(?:"),{name:t,pattern:`(${r})`}},d=()=>{if(r)return r;const t=e.replace(/\{(.*?)}/gi,(e,t)=>{const n=p(t);return n&&n.pattern?(c[n.name]=n.pattern,h.push(n.name),n.pattern):e});return r=new RegExp("^"+t+"$"),r};this.name=()=>o,this.component=()=>t,this.middlewares=()=>s,this.shouldRebuild=()=>i,this.path=()=>e,this.layout=()=>u,this.match=function(e){e="/"+a(e,"/");if(!d().exec(e))return!1;const t={};return d().exec(e).forEach((e,n)=>{if(n<1)return;const r=h[n-1];t[r]=e}),t},this.url=function(t){const n=e.replace(/\{(.*?)}/gi,(e,n)=>{const r=p(n);if(t.params&&t.params[r.name])return t.params[r.name];throw new Error(`Missing parameter '${r.name}'`)}),r="object"==typeof t.query?new URLSearchParams(t.query).toString():null;return(t.basePath?t.basePath:"")+(r?`${n}?${r}`:n)}}class Vr extends Error{constructor(e,t){super(e),this.context=t}}const jr=(e,t)=>{const n=[];return e.forEach(e=>{n.push(a(e.suffix,"/"))}),n.push(a(t,"/")),n.join("/")},Br=(e,t)=>{const n=[];return e.forEach(e=>{e.options.middlewares&&n.push(...e.options.middlewares)}),t&&n.push(...t),n},Wr=(e,t)=>{const n=[];return e.forEach(e=>{e.options?.name&&n.push(e.options.name)}),t&&n.push(t),n.join(".")},qr=e=>{for(let t=e.length-1;t>=0;t--)if(e[t]?.options?.layout)return e[t].options.layout;return null};function Ur(){const e=[];let t=0;const n=n=>{const o=t+n;if(!e[o])return;t=o;const{route:s,params:i,query:a,path:l}=e[o];r(l)},r=e=>{window.location.replace(`${window.location.pathname}${window.location.search}#${e}`)},o=()=>window.location.hash.slice(1);this.push=function(n){const{route:s,params:i,query:a,path:l}=this.resolve(n);l!==o()&&(e.splice(t+1),e.push({route:s,params:i,query:a,path:l}),t++,r(l))},this.replace=function(n){const{route:r,params:s,query:i,path:a}=this.resolve(n);a!==o()&&(e[t]={route:r,params:s,query:i,path:a})},this.forward=function(){return t<e.length-1&&n(1)},this.back=function(){return t>0&&n(-1)},this.init=function(n){window.addEventListener("hashchange",()=>{const{route:e,params:t,query:n,path:r}=this.resolve(o());this.handleRouteChange(e,t,n,r)});const{route:r,params:s,query:i,path:a}=this.resolve(n||o());e.push({route:r,params:s,query:i,path:a}),t=0,this.handleRouteChange(r,s,i,a)}}function Hr(){this.push=function(e){try{const{route:t,path:n,params:r,query:o}=this.resolve(e);if(window.history.state&&window.history.state.path===n)return;window.history.pushState({name:t.name(),params:r,path:n},t.name()||n,n),this.handleRouteChange(t,r,o,n)}catch(e){n.error("HistoryRouter","Error in pushState",e)}},this.replace=function(e){const{route:t,path:r,params:o}=this.resolve(e);try{window.history.replaceState({name:t.name(),params:o,path:r},t.name()||r,r),this.handleRouteChange(t,o,{},r)}catch(e){n.error("HistoryRouter","Error in replaceState",e)}},this.forward=function(){window.history.forward()},this.back=function(){window.history.back()},this.init=function(e){window.addEventListener("popstate",e=>{try{if(!e.state||!e.state.path)return;const t=e.state.path,{route:n,params:r,query:o,path:s}=this.resolve(t);if(!n)return;this.handleRouteChange(n,r,o,s)}catch(e){n.error("HistoryRouter","Error in popstate event",e)}});const{route:t,params:r,query:o,path:s}=this.resolve(e||window.location.pathname+window.location.search);this.handleRouteChange(t,r,o,s)}}function zr(){const e=[];let t=0;const n=n=>{const r=t+n;if(!e[r])return;t=r;const{route:o,params:s,query:i,path:a}=e[r];this.handleRouteChange(o,s,i,a)};this.push=function(n){const{route:r,params:o,query:s,path:i}=this.resolve(n);e[t]&&e[t].path===i||(e.splice(t+1),e.push({route:r,params:o,query:s,path:i}),t++,this.handleRouteChange(r,o,s,i))},this.replace=function(n){const{route:r,params:o,query:s,path:i}=this.resolve(n);e[t]={route:r,params:o,query:s,path:i},this.handleRouteChange(r,o,s,i)},this.forward=function(){return t<e.length-1&&n(1)},this.back=function(){return t>0&&n(-1)},this.init=function(n){const r=n||window.location.pathname+window.location.search,{route:o,params:s,query:i,path:a}=this.resolve(r);e.push({route:o,params:s,query:i,path:a}),t=0,this.handleRouteChange(o,s,i,a)}}function Gr(e,t){const n=new Map,r=new WeakMap,o=new WeakMap;let s=null,i=null;const a=(e,t)=>{const n=o.get(e);if(n)return n;let r=e;return De.isAnchor(e)||(r=Oe(t),r.appendChild(e)),o.set(e,r),r},l=()=>{De.isAnchor(i)&&i.remove()},u=()=>{t.nodeValue="",l(),s&&s.remove()},c=e=>{let t=e;return De.isNDElement(e)&&(t=e.node()),t},h=function(e,n,o){const h=n.layout();if(h)return void((e,n,o,h)=>{let p=c(n);const d=r.get(p);if(d){if(d===s){const e=a(p,h);return l(),i=p,void e.replaceContent(p)}return u(),i=p,s=d,a(p,h).replaceContent(p),void t.appendChild(s)}u(),i=p;const f=a(p,h);s=M.getChild(e(f)),r.set(p,s),t.appendChild(s)})(h,e,0,o);let p=c(e);u(),t.appendChild(p),i=e},p=function(e){if(!e.route)return;const{route:t,params:r,query:o,path:s}=e;if(n.has(s)){const e=n.get(s);return void h(e,t)}const i=t.component()({params:r,query:o});n.set(s,i),h(i,t,s)};return e.subscribe(p),p(e.currentState()),t}const Kr="default";function Jr(e={}){const t=[],r={},o=[],s=[],i={route:null,params:null,query:null,path:null,hash:null};if("hash"===e.mode)Ur.apply(this,[]);else if("history"===e.mode)Hr.apply(this,[]);else{if("memory"!==e.mode)throw new Vr("Invalid router mode "+e.mode);zr.apply(this,[])}const l=function(e,t){for(const r of s)try{r(e),t&&t(e)}catch(e){n.warn("Route Listener","Error in listener:",e)}};this.routes=()=>[...t],this.currentState=()=>({...i}),this.add=function(e,n,s){const i=new Rr(jr(o,e),n,{...s,middlewares:Br(o,s?.middlewares||[]),name:s?.name?Wr(o,s.name):null,layout:s?.layout||qr(o)});return t.push(i),i.name()&&(r[i.name()]=i),this},this.group=function(e,t,n){if(!De.isFunction(n))throw new Vr("Callback must be a function");return o.push({suffix:e,options:t}),n(),o.pop(),this},this.generateUrl=function(e,t={},n={}){const o=r[e];if(!o)throw new Vr(`Route not found for name: ${e}`);return o.url({params:t,query:n})},this.resolve=function(e){if("string"==typeof e){const t=r[e];if(t)return{route:t,params:[],query:[],path:t.url({name:e})}}if(De.isJson(e)){const t=r[e.name];if(!t)throw new Vr(`Route not found for name: ${e.name}`);return{route:t,params:e.params,query:e.query,path:t.url({...e})}}const[n,o]=e.split("?"),s="/"+a(n,"/");let i,l=null;for(const e of t)if(i=e.match(s),i){l=e;break}if(!l)throw new Vr(`Route not found for url: ${n}`);const u={};if(o){const e=new URLSearchParams(o).entries();for(const[t,n]of e)u[t]=n}return{route:l,params:i,query:u,path:e}},this.subscribe=function(e){if(!De.isFunction(e))throw new Vr("Listener must be a function");return s.push(e),()=>{s.splice(s.indexOf(e),1)}},this.handleRouteChange=function(e,t,n,r){i.route=e,i.params=t,i.query=n,i.path=r;const o=[...e.middlewares(),l];let s=0;const a={...i},u=e=>{if(s++,!(s>=o.length))return o[s](e||a,u)};return o[s](a,u)}}function Yr(e,t){const{to:n,href:r,...o}=e;if(r){const e=Jr.get();return st({...o,href:r},t).nd.onPreventClick(()=>{e.push(r)})}const s="string"==typeof n?{name:n}:n,i=s.router||Kr,a=Jr.get(i);if(!a)throw new Vr('Router not found "'+i+'" for link "'+s.name+'"');const l=a.generateUrl(s.name,s.params,s.query);return st({...o,href:l},t).nd.onPreventClick(()=>{a.push(l)})}Jr.routers={},Jr.create=function(e,t){if(!De.isFunction(t))throw n.error("Router","Callback must be a function"),new Vr("Callback must be a function");const r=new Jr(e);return Jr.routers[e.name||Kr]=r,t(r),r.init(e.entry),r.mount=function(e){if(De.isString(e)){const t=document.querySelector(e);if(!t)throw new Vr(`Container not found for selector: ${e}`);e=t}else if(!De.isElement(e))throw new Vr("Container must be a string or an Element");return Gr(r,e)},r},Jr.get=function(e){const t=Jr.routers[e||Kr];if(!t)throw new Vr(`Router not found for name: ${e}`);return t},Jr.push=function(e,t=null){return Jr.get(t).push(e)},Jr.replace=function(e,t=null){return Jr.get(t).replace(e)},Jr.forward=function(e=null){return Jr.get(e).forward()},Jr.back=function(e=null){return Jr.get(e).back()},Jr.redirectTo=function(e,t=null,n=null){let r=e;const o=Jr.get(n);return o.resolve({name:e,params:t})&&(r={name:e,params:t}),o.push(r)},Yr.blank=function(e,t){return st({...e,target:"_blank"},t)};var Qr=Object.freeze({__proto__:null,Link:Yr,RouteParamPatterns:Lr,Router:Jr});var Xr=Object.freeze({__proto__:null,memoize:e=>H(e),once:e=>U(e),singleton:e=>q(e)}),Zr=Object.freeze({__proto__:null,Cache:Xr,NativeFetch:function(e){const t={request:[],response:[]};this.interceptors={response:e=>{t.response.push(e)},request:e=>{t.request.push(e)}},this.fetch=async function(n,r,o={},s={}){if(s.formData){const e=new FormData;for(const t in o)e.append(t,o[t]);o=e}r.startsWith("http")||(r=(e.endsWith("/")?e:e+"/")+r);let i={method:n,headers:{...s.headers||{}}};if(o)if(o instanceof FormData)i.body=o;else if("GET"!==n)i.headers["Content-Type"]="application/json",i.body=JSON.stringify(o);else{const e=new URLSearchParams(o).toString();e&&(r=r+(r.includes("?")?"&":"?")+e)}for(const e of t.request)i=await e(i,r)||i;let a=await fetch(r,i);for(const e of t.response)a=await e(a,r)||a;const l=(a.headers.get("content-type")||"").includes("application/json")?await a.json():await a.text();if(!a.ok){const e=new Error(l?.message||a.statusText);throw e.status=a.status,e.data=l,e}return l},this.post=function(e,t={},n={}){return this.fetch("POST",e,t,n)},this.put=function(e,t={},n={}){return this.fetch("PUT",e,t,n)},this.delete=function(e,t={},n={}){return this.fetch("DELETE",e,t,n)},this.get=function(e,t={},n={}){return this.fetch("GET",e,t,n)}},classPropertyAccumulator:W,cssPropertyAccumulator:B,filters:be});return e.$=d,e.ElementCreator=M,e.HtmlElementWrapper=Ve,e.NDElement=Ae,e.Observable=p,e.PluginsManager=null,e.SingletonView=R,e.Store=Ce,e.StoreFactory=Se,e.TemplateCloner=I,e.Validator=De,e.autoMemoize=H,e.autoOnce=U,e.classPropertyAccumulator=W,e.createTextNode=Le,e.cssPropertyAccumulator=B,e.elements=Ir,e.memoize=e=>{const t=new Map;return(...n)=>{const[r,...o]=n,s=t.get(r);if(s)return s;const i=e(...o);return t.set(r,i),i}},e.normalizeComponentArgs=j,e.obs=f,e.once=q,e.router=Qr,e.useCache=function(e){let t=null,n=r=>{t=new I(e);const o=t.clone(r);return n=t.clone,o};return e.length<2?(...e)=>n(e):(e,t,...r)=>n([e,t,...r])},e.useSingleton=function(e){let t=null;return function(...n){return t||(t=new R(e)),t.render(n)}},e.utils=Zr,e.withValidation=V,e}({});
package/elements.js CHANGED
@@ -1,6 +1,3 @@
1
- import './index.def';
2
- import Anchor from "./src/core/elements/anchor/anchor";
1
+ export {default as Anchor, default as NativeDocumentFragment } from "./src/core/elements/anchor/anchor";
3
2
  export { createPortal } from "./src/core/elements/anchor/anchor";
4
3
  export * from './src/core/elements/index';
5
-
6
- export { Anchor, Anchor as NativeDocumentFragment };
package/index.js CHANGED
@@ -19,7 +19,3 @@ export * from './src/core/data/observable-helpers/computed';
19
19
  export * from './src/core/data/observable-helpers/observable.is-to';
20
20
  export * from './src/core/data/Store';
21
21
 
22
- export * from './elements';
23
- export * from './router';
24
- export * from './utils';
25
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.149",
3
+ "version": "1.0.150",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -0,0 +1,8 @@
1
+ import HtmlElementWrapper from "../wrappers/HtmlElementWrapper";
2
+
3
+ /**
4
+ * Creates an empty `DocumentFragment` wrapper.
5
+ * Useful for grouping elements without adding a DOM node.
6
+ * @type {function(GlobalAttributes=, NdChild|NdChild[]=): DocumentFragment}
7
+ */
8
+ export const Fragment = HtmlElementWrapper('');
@@ -1,5 +1,3 @@
1
- import HtmlElementWrapper from "../wrappers/HtmlElementWrapper";
2
-
3
1
  export * from './control/for-each';
4
2
  export * from './control/for-each-array';
5
3
  export * from './control/show-if';
@@ -16,13 +14,7 @@ export * from './medias';
16
14
  export * from './meta-data';
17
15
  export * from './table';
18
16
  export * from './svg';
19
- /**
20
- * Creates an empty `DocumentFragment` wrapper.
21
- * Useful for grouping elements without adding a DOM node.
22
- * @type {function(GlobalAttributes=, NdChild|NdChild[]=): DocumentFragment}
23
- */
24
- export const Fragment = HtmlElementWrapper('');
25
-
17
+ export * from './fragment';
26
18
 
27
19
 
28
20
 
@@ -1,7 +1,4 @@
1
1
  import {withValidation} from "./args-types.js";
2
- import {Observable} from "../data/Observable";
3
- import Validator from "./validator";
4
- import {NDElement} from "../wrappers/NDElement";
5
2
 
6
3
 
7
4
  DocumentFragment.prototype.__IS_FRAGMENT = true;
@@ -10,22 +7,6 @@ Function.prototype.args = function(...args) {
10
7
  return withValidation(this, args);
11
8
  };
12
9
 
13
- Function.prototype.cached = function(...args) {
14
- let $cache;
15
- let getCache = () => $cache;
16
- return () => {
17
- if(!$cache) {
18
- $cache = this.apply(this, args);
19
- if($cache.cloneNode) {
20
- getCache = () => $cache.cloneNode(true);
21
- } else if($cache.$element) {
22
- getCache = () => new NDElement($cache.$element.cloneNode(true));
23
- }
24
- }
25
- return getCache();
26
- };
27
- };
28
-
29
10
  Function.prototype.errorBoundary = function(callback) {
30
11
  const handler = (...args) => {
31
12
  try {
@@ -36,30 +17,3 @@ Function.prototype.errorBoundary = function(callback) {
36
17
  };
37
18
  return handler;
38
19
  };
39
-
40
- String.prototype.use = function(args) {
41
- const value = this;
42
-
43
- return Observable.computed(() => {
44
- return value.replace(/\$\{(.*?)}/g, (match, key) => {
45
- const data = args[key];
46
- if(Validator.isObservable(data)) {
47
- return data.val();
48
- }
49
- return data;
50
- });
51
- }, Object.values(args));
52
- };
53
-
54
- String.prototype.resolveObservableTemplate = function() {
55
- if(!Validator.containsObservableReference(this)) {
56
- return this.valueOf();
57
- }
58
- return this.split(/(\{\{#ObItem::\([0-9]+\)\}\})/g).filter(Boolean).map((value) => {
59
- if(!Validator.containsObservableReference(value)) {
60
- return value;
61
- }
62
- const [_, id] = value.match(/\{\{#ObItem::\(([0-9]+)\)\}\}/);
63
- return Observable.getById(id);
64
- });
65
- }
@@ -1,4 +1,5 @@
1
1
  import {Div, ForEachArray} from '../../../core/elements';
2
+
2
3
  import './accordion.css';
3
4
 
4
5
  export default function AccordionRender($desc, instance) {
@@ -1,5 +1,6 @@
1
1
  import {Div, Span} from '../../../core/elements';
2
- import Button from '../../../components/button/Button'
2
+ import Button from '../../../components/button/Button';
3
+
3
4
  import './alert.css';
4
5
 
5
6
  export default function AlertRender($desc, instance) {
@@ -1,5 +1,6 @@
1
1
  import {Div, Span} from '../../../../core/elements';
2
2
  import Avatar from '../../../../components/avatar/Avatar';
3
+
3
4
  import './avatar-group.css';
4
5
 
5
6
  const normalize = (item) => {
@@ -1,4 +1,5 @@
1
1
  import {Span} from '../../../core/elements';
2
+
2
3
  import './badge.css';
3
4
 
4
5
  export default function BadgeRender($desc, instance) {
@@ -1,4 +1,5 @@
1
1
  import {Nav, OrderedList, ListItem, Span, Link, ForEachArray} from '../../../core/elements';
2
+
2
3
  import './breadcrumb.css';
3
4
 
4
5
  export default function BreadcrumbRender($desc, instance) {
@@ -1,9 +1,7 @@
1
1
  import {Div, ShowIf} from "../../../core/elements";
2
2
  import {createPortal} from "../../../core/elements/anchor/anchor";
3
- import { $ } from '../../../../index';
4
3
  import {computePosition, flip, shift} from '@floating-ui/dom';
5
4
 
6
-
7
5
  import './contextmenu.css';
8
6
 
9
7
  export default function ContextMenuRender($desc, instance) {
@@ -1,9 +1,9 @@
1
1
  import {Div, Input, ForEachArray} from '../../../core/elements';
2
2
  import PopoverRender from '../popover/PopoverRender';
3
3
  import {createFilter} from "../../../core/utils/filters";
4
+ import {normalizeDropdownItem} from "../../../components/dropdown/helpers";
4
5
 
5
6
  import './dropdown.css';
6
- import {normalizeDropdownItem} from "../../../components/dropdown/helpers";
7
7
 
8
8
  export default function DropdownRender($desc, instance) {
9
9
  $desc.content = buildDropdownContent($desc, instance);
@@ -1,5 +1,5 @@
1
1
  import {Div, Button, ForEachArray} from '../../../../elements';
2
- import { $ } from '../../../../index';
2
+ import { $ } from '../../../core/data/Observable';
3
3
 
4
4
  import './field-collection.css';
5
5
 
@@ -1,7 +1,8 @@
1
1
  import {Div, Span, ShowIf, Form} from '../../../../elements';
2
- import './form-control.css';
3
2
  import {Button} from "../../../components/button";
4
3
 
4
+ import './form-control.css';
5
+
5
6
  export default function FormControlRender($desc, instance) {
6
7
  const props = instance.getEditableProps();
7
8
  props.class.add('form-control');