@benbraide/inlinejs-stripe 1.0.6 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={992:(e,t,n)=>{n.r(t),n.d(t,{AddChanges:()=>Z,AddDirectiveExpansionRule:()=>j,AddDirectiveHandler:()=>It,AddMagicHandler:()=>Bt,AddOutsideEventExcept:()=>xe,AddOutsideEventListener:()=>Ce,ApplyDirectiveExpansionRules:()=>H,AreObjects:()=>_,AttributeInterpolator:()=>Et,AutoBootstrap:()=>kt,BaseComponent:()=>Ae,BaseGlobal:()=>Re,BeginsWith:()=>c,BindDirectiveExpansionRule:()=>jt,BindEvent:()=>wt,BootstrapAndAttach:()=>Gt,BuildGetterProxyOptions:()=>qe,BuildIntersectionOptions:()=>$t,BuildProxyOptions:()=>ze,CallIfFunction:()=>Xe,Changes:()=>he,ChildProxy:()=>we,ClassDirectiveExpansionRule:()=>Jt,Config:()=>Oe,Context:()=>pe,ContextKeys:()=>d,CreateAnimationLoop:()=>k,CreateChildProxy:()=>ee,CreateDirective:()=>q,CreateDirectiveExpansionRule:()=>L,CreateDirectiveHandlerCallback:()=>At,CreateGlobal:()=>Ne,CreateInplaceProxy:()=>je,CreateLoop:()=>G,CreateMagicHandlerCallback:()=>Lt,CreateReadonlyProxy:()=>Je,DeepCopy:()=>g,DefaultTransitionDelay:()=>ut,DefaultTransitionDuration:()=>ct,DefaultTransitionRepeats:()=>dt,DeleteProxyProp:()=>X,DirectiveManager:()=>ve,DisableProxyAction:()=>He,DispatchDirective:()=>M,ElementScope:()=>ke,ElementScopeKey:()=>K,EndsWith:()=>b,EvaluateLater:()=>tt,EvaluateMagicProperty:()=>Q,ExtractDuration:()=>Tt,FindComponentById:()=>R,FindComponentByName:()=>$,FindComponentByRoot:()=>N,FlattenDirective:()=>D,ForwardEvent:()=>St,Future:()=>r,GenerateFunctionFromString:()=>et,GenerateUniqueId:()=>ae,GenerateValueReturningFunction:()=>Qe,GenerateVoidFunction:()=>Ze,GenericProxy:()=>ie,GetAttribute:()=>E,GetConfig:()=>B,GetDefaultUniqueMarkers:()=>oe,GetDirectiveValue:()=>Ot,GetElementContent:()=>gt,GetElementScopeId:()=>V,GetGlobal:()=>Me,GetLocal:()=>st,GetOrCreateGlobal:()=>Te,GetProxyProp:()=>te,GetTarget:()=>p,GetTargets:()=>m,GlobalCreatedEvent:()=>De,IncrementUniqueMarkers:()=>se,InferComponent:()=>Y,InitComponentCache:()=>F,InitJITProxy:()=>Ue,InlineJSGlobalKey:()=>$e,InsertHtml:()=>mt,Interpolate:()=>Ct,InterpolateText:()=>yt,IntersectionObserver:()=>Nt,IsEqual:()=>x,IsObject:()=>v,JoinPath:()=>P,JoinUniqueMarkers:()=>le,JournalError:()=>o,JournalLog:()=>zt,JournalTry:()=>s,JournalWarn:()=>T,LazyCheck:()=>Mt,Loop:()=>l,MagicManager:()=>Se,MutationObserver:()=>Pe,NativeFetchConcept:()=>Fe,NextTick:()=>ft,Nothing:()=>a,OnDirectiveExpansionRule:()=>Ht,PathToRelative:()=>A,PeekCurrentComponent:()=>de,PeekCurrentScope:()=>be,PopCurrentComponent:()=>ue,PopCurrentScope:()=>ge,ProcessDirectives:()=>W,ProxyKeys:()=>h,PushCurrentComponent:()=>ce,PushCurrentScope:()=>_e,QueryGlobalComponent:()=>at,RemoveDirectiveExpansionRule:()=>J,RemoveOutsideEventListener:()=>Ee,ReplaceText:()=>bt,ResolveKeyValue:()=>Ft,ResolveOptions:()=>Dt,ResolveTransition:()=>ht,RootProxy:()=>re,Scope:()=>Ie,SetAttributeUtil:()=>w,SetProxyProp:()=>ne,SplitPath:()=>S,Stack:()=>i,StreamData:()=>nt,SubscribeToChanges:()=>rt,SupportsAttributes:()=>y,TextContentInterpolator:()=>xt,TidyPath:()=>I,ToCamelCase:()=>u,ToString:()=>Le,TraverseDirectives:()=>U,UnbindOutsideEvent:()=>Ge,UseEffect:()=>ot,WaitForGlobal:()=>Be,WaitPromise:()=>We,WaitTransition:()=>pt,WaitWhile:()=>it});class i{constructor(e){this.list_=new Array,e&&(this.list_=e.list_.map((e=>e)))}Push(e){this.list_.push(e)}Pop(){return 0==this.list_.length?null:this.list_.pop()}Peek(){return 0==this.list_.length?null:this.list_[this.list_.length-1]}IsEmpty(){return 0==this.list_.length}GetHistory(){return this.list_.map((e=>e))}}class r{constructor(e){this.callback_=e}Get(){return this.callback_()}}function o(e,t,n){console.error({message:e,context:t||"N/A",contextElement:n||"N/A"})}function s(e,t,n){try{return e()}catch(e){o(e,t,n)}}class l{constructor(e){this.whileCallbacks_=new Array,this.finalCallbacks_=new Array,e((e=>{this.whileCallbacks_.slice(0).forEach(((t,n)=>{!1===s((()=>t(e)),"InlineJS.Loop.While")&&this.whileCallbacks_.splice(n,1)}))}),(e=>{this.whileCallbacks_.splice(0),this.finalCallbacks_.splice(0).forEach((t=>s((()=>t(e)),"InlineJS.Loop.Final")))}),(()=>{this.whileCallbacks_.splice(0),this.finalCallbacks_.splice(0)}))}While(e){return this.whileCallbacks_.push(e),this}Final(e){return this.finalCallbacks_.push(e),this}}class a{}function c(e,t=!1){return new RegExp(`^${e}`,t?"i":void 0)}function u(e,t,n){let[i="",...r]=e.trim().split(n||"-"),o=e=>e.charAt(0).toUpperCase()+e.substring(1);return i&&(t?o(i):i)+(r||[]).map((e=>o(e))).join("")}const d={self:"self",event:"event",scope:"scope"},h={componentId:"__InlineJS_CompnentId__",name:"__InlineJS_Name__",path:"__InlineJS_Path__",parentPath:"__InlineJS_ParentPath__",target:"__InlineJS_Target__"};function p(e){return(Array.isArray(e)||e&&"object"==typeof e)&&h.target in e?p(e[h.target]):e}function m(e){return e.map((e=>p(e)))}function f(e){return(e=p(e))&&"object"==typeof e&&(h.target in e||"__proto__"in e&&"Object"===e.__proto__.constructor.name)}function v(e){return!!f(e)}function _(e){return-1==e.findIndex((e=>!f(e)))}function g(e){if(e=p(e),!Array.isArray(e)&&!v(e))return e;if(Array.isArray(e))return e.map((e=>g(e)));let t={};return Object.entries(e).forEach((([e,n])=>t[e]=g(n))),t}function b(e,t=!1){return new RegExp(`${e}$`,t?"i":void 0)}function y(e){return(e=p(e))&&"getAttribute"in e&&"setAttribute"in e}function C(e,t){return t&&y(e)?e.getAttribute(t):null}function E(e,t){for(let n of Array.isArray(t)?t:[t]){let t=C(e,n);if(t)return t}return null}function x(e,t,n=!0){let[i,r]=n?m([e,t]):[e,t];if(i===r)return!0;if(Array.isArray(i)&&Array.isArray(r))return i.length==r.length&&-1==i.findIndex(((e,t)=>!x(e,r[t],n)));if(_([i,r])){let e=Object.keys(i),t=Object.keys(r);return e.length==t.length&&-1==e.findIndex((e=>!t.includes(e)||!x(i[e],r[e],n)))}return i==r}function G(e,t=1e3,n=0,i=0,r=!0){t=t||1;let o=e?Math.floor(e/t):-1,s=0,a=!1,c=0,u=(n,i)=>{if(r){let r=++c;requestAnimationFrame((()=>r==c&&i({passes:n,elapsed:n*t,duration:e,abort:()=>a=!0})))}else i({passes:n,elapsed:n*t,duration:e,abort:()=>a=!0})},d=(r,l,c)=>{if(a)return c();if(s+=1,o>=0&&s>=o){if(!n)return l({passes:o,elapsed:o*t,duration:e});setTimeout((()=>setTimeout(d.bind(null,r,l,c),t)),i),u(o,r),n>0&&(n-=1)}else setTimeout(d.bind(null,r,l,c),t),u(s,r)};return new l(((e,n,i)=>{setTimeout(d.bind(null,e,n,i),t)}))}function k(e,t=1e3,n=0,i=0){let r=t,o=-1,s=-1,a=!1,c=0,u=(l,d,h)=>{if(a)return;-1==o&&(o=h);let p=h-o;if(e&&p>=e){if(!n)return d({passes:c,elapsed:p,duration:e});r=i,s=h,n>0&&(n-=1)}-1==s&&(s=h);let m=h-s;m>=r&&(s=h-(m-r),r=t,l({passes:++c,elapsed:p,duration:e,abort:()=>a=!0})),requestAnimationFrame(u.bind(null,l,d))};return new l(((e,t)=>{requestAnimationFrame(u.bind(null,e,t))}))}function I(e){return(e=e?e.trim():"")?e.replace(/[?][?&=\/]+/g,"?").replace(/[&][?&=\/]+/g,"&").replace(/[=][?=\/]+/g,"=").replace(/[\/][\/=]+/g,"/").replace(/[:]{2,}/g,":").replace(/[:][\/]([^\/])/g,"://$1").replace(/[\/?&=]+$/,"").replace(/^[\/?&=]+/,"").split(/[?&]/).reduce(((e,t,n)=>e?`${e}${n<2?"?":"&"}${t}`:t),""):""}function A(e,t,n){return(e=I(e))===t?(e=n&&n||"/").startsWith("/")?e:`/${e}`:(e.startsWith(`${t}/`)&&(e=e.substring(t.length)),/^[a-zA-Z0-9_]+:\/\//.test(e)?e:(n&&(e=e.startsWith("/")?`${n}${e}`:`${n}/${e}`),e.startsWith("/")?e:`/${e}`))}function S(e,t,n){let i=(e=t?A(e,t,n):e).indexOf("?");return{base:-1==i?e:e.substring(0,i),query:-1==i?"":e.substring(i+1)}}function P({base:e,query:t},n,i,r){let o=`${I(e)}?${t}`;return o=n?A(o,n,i):I(o),o=r?I(`${n}/${o}`):o.startsWith("/")||/^[a-zA-Z0-9_]+:\/\//.test(o)?o:`/${o}`,o}function w(e,t,n){t&&y(e)&&e.setAttribute(t,n)}const O="InlineJS_Comp_Cache";function F(){return globalThis[O]={id:"",component:null}}function R(e){let t=globalThis[O]=globalThis[O]||F();return e===t.id||(t.component=Me().FindComponentById(e),t.id=t.component?e:""),t.component}function $(e){return Me().FindComponentByName(e)}function N(e){return Me().FindComponentByRoot(e)}function T(e,t,n){console.warn({message:e,context:t||"N/A",contextElement:n||"N/A"})}function D(e){return{originalView:e.meta.view.original,expandedView:e.meta.view.expanded,nameValue:e.meta.name.value,nameJoined:e.meta.name.joined,nameParts:e.meta.name.parts,argKey:e.meta.arg.key,argOptions:e.meta.arg.options,expression:e.value}}function M(e,t,n,i=0){let r="string"==typeof e?R(e):e;if(!r)return o(`Failed to find component for '${n.meta.view.original}'`,"InlineJS.DispatchDirective",t),!1;let l=null,a=r.FindElementScope(t);if(a&&(l=a.GetDirectiveManager().FindHandler(n.meta.name.joined),++i),l=l||Me().GetDirectiveManager().FindHandler(n.meta.name.joined),!l){let e=`${n.meta.name.parts.reduce(((e,t)=>e?`${e}${t.substring(0,1).toUpperCase()}${t.substring(1)}`:t),"")}DirectiveHandler`;e in globalThis&&"function"==typeof globalThis[e]&&(l=globalThis[e])}return l?(0!=i||a||r.CreateElementScope(t),s((()=>{l(Object.assign(Object.assign({},D(n)),{componentId:r.GetId(),component:r,contextElement:t}))}),"InlineJS.DispatchDirective",t),!0):(T(`No handler found '${n.meta.view.original}'`,"InlineJS.DispatchDirective",t),!1)}function B(){return Me().GetConfig()}function L(e,t){return n=>-1==n.search(e)?null:n.replace(e,t)}function j(e){return Me().GetDirectiveManager().AddExpansionRule(e)}function J(e){Me().GetDirectiveManager().RemoveExpansionRule(e)}function H(e){return Me().GetDirectiveManager().Expand(e)}let z={};function q(e,t){if(!e||!(e=e.trim()))return null;if((t=t.trim())===e&&(t=""),e in z)return{meta:z[e],value:t};let n=H(e),i=n.match(B().GetDirectiveRegex());if(!i||3!=i.length||!i[2])return null;let r=i[2].indexOf(":"),o=-1==r?[i[2]]:[i[2].substring(0,r),i[2].substring(r+1)],s="",l="";o.length>1?[s,l]=o:[l]=o;let a=l.split("."),c="";s?c=a[0]:s=a[0],a.splice(0,1);let u=s.split("-"),d={view:{original:e,expanded:n},name:{value:s,joined:u.join("."),parts:u},arg:{key:c,options:a||[]}};return z[e]=d,{meta:d,value:t}}function U({element:e,callback:t,attributeCallback:n}){Array.from(e.attributes||[]).forEach((i=>{try{n&&n(i.name,i.value||"");let e=q(i.name,i.value||"");e&&t(e)}catch(t){o(t,"InlineJS.TraverseDirectives",e)}}))}function W({component:e,element:t,options:n={}}){var i;if(!function(e,{checkTemplate:t=!0,checkDocument:n=!0}){return 1===(null==e?void 0:e.nodeType)&&(!n||document.contains(e))&&(!t||e instanceof HTMLTemplateElement||!e.closest("template"))}(t,n))return;let r="string"==typeof e?R(e):e;if(!r)return o("Failed to find component.","InlineJS.ProcessDirectives",t),!1;let s=0;U({element:t,callback:n=>{M(e,t,n,s)&&(t.removeAttribute(n.meta.view.original),++s)},attributeCallback:(e,n)=>Me().DispatchAttributeProcessing({name:e,value:n,componentId:r.GetId(),component:r,contextElement:t})}),Me().DispatchTextContentProcessing({componentId:r.GetId(),component:r,contextElement:t}),n.ignoreChildren||t instanceof HTMLTemplateElement||(null==r||r.PushSelectionScope(),Array.from(t.children).filter((e=>!e.contains(t))).forEach((t=>W({component:e,options:n,element:t}))),null==r||r.PopSelectionScope()),null===(i=null==r?void 0:r.FindElementScope(t))||void 0===i||i.ExecutePostProcessCallbacks()}const K="__InlineJS_ELSCOPE_KEY__";function V(e){let t="";for(;e;){if(t=K in(n=e)&&n[K],t||e===document.body)return t||"";e=e.parentElement}var n;return""}function Y(e){let t=V(e).match(/^Cmpnt\<([0-9_]+)\>/);return t?R(t[1]):null}function Q(e,t,n,i="",r=!0){let l="string"==typeof e?R(e):e;if(!l)return o(`Failed to find component for '$${n}'`,"InlineJS.EvaluateMagicProperty",t),Me().CreateNothing();let a=Me().GetMagicManager().FindHandler(i&&n.startsWith(i)?n.substring(i.length):n,{contextElement:t,componentId:l.GetId(),component:l});if(!a){if(r&&i&&n.startsWith(`${i}${i}`)){let e=l.GetId();return t=>{let r=Y(t)||R(e);if(!r)return null;let o=r.FindElementScope(t),s=o&&o.GetLocal(n.substring(i.length));return o&&!Me().IsNothing(s)?s:Q(r.GetId(),t,n,`${i}${i}`,!1)}}return Me().CreateNothing()}return s((()=>a({componentId:l.GetId(),component:l,contextElement:t})),"InlineJS.EvaluateMagicProperty",t)}function Z(e,t,n,i,r=!0){if(!i)return;let o={componentId:i.GetComponentId(),type:e,path:t,prop:n,origin:i.PeekOrigin()};if(i.Add(o),!r)return;let s=t.split(".");for(;s.length>2;)s.pop(),i.Add({original:o,path:s.join(".")})}function X(e,t,n,i){var r;if(!(i in t))return!1;let o=R(e);return null===(r=null==o?void 0:o.FindProxy(n))||void 0===r||r.RemoveChild(i),delete t[i],null==o||o.RemoveProxy(`${n}.${i}`),Z("delete",n,i,null==o?void 0:o.GetBackend().changes),!0}function ee(e,t,n,i){if(!e)return null;let r=e.FindChild(t);if(r)return r;if(!Array.isArray(n)&&!v(n))return null;let o=Me().CreateChildProxy(e,t,n);return i&&i.AddProxy(o),o}function te(e,t,n,i,r){var o;if(i===h.target)return t;if(i===h.componentId)return e;if(i===h.name)return n.split(".").at(-1);if(i===h.path)return n;if(i===h.parentPath)return n.split(".").slice(0,-1).join(".")||"";let s=i in t;if(!s&&r){let t=r(R(e)||void 0,i);if(!Me().IsNothing(t))return Me().IsFuture(t)?t.Get():t}if(s&&!t.hasOwnProperty(i))return t[i];let l=s?t[i]:null;if(Me().IsFuture(l))return l.Get();let a=R(e);return null==a||a.GetBackend().changes.AddGetAccess(`${n}.${i}`),(null===(o=ee((null==a?void 0:a.FindProxy(n))||null,i,l,a||void 0))||void 0===o?void 0:o.GetNative())||l}function ne(e,t,n,i,r){var o;if(i in t&&r===t[i])return!0;let s=R(e);return null===(o=null==s?void 0:s.FindProxy(n))||void 0===o||o.RemoveChild(i),t[i]=r,null==s||s.RemoveProxy(`${n}.${i}`),Z("set",`${n}.${i}`,i,null==s?void 0:s.GetBackend().changes),!0}class ie{constructor(e,t,n,i,r=!1){this.componentId_=e,this.target_=t,this.name_=n,this.native_=null,this.children_={},this.parentPath_=(null==i?void 0:i.GetPath())||"",null==i||i.AddChild(this);let o=this.componentId_,s=this.GetPath(),l=(e,t)=>{let{context:n}=null==e?void 0:e.GetBackend(),i=null==t?void 0:t.startsWith("$");if(i){let e=n.Peek(t.substring(1),Me().CreateNothing());if(!Me().IsNothing(e))return e}let r=n.Peek(d.self),o=null==e?void 0:e.FindElementLocalValue(r||e.GetRoot(),t,!0);if(!Me().IsNothing(o))return o;let s=i?Q(e,r,t,"$"):Me().CreateNothing();return Me().IsNothing(s)&&t&&t in globalThis&&(s=globalThis[t]),s},a=!r&&!this.parentPath_,c={get:(e,t)=>"symbol"==typeof t||"prototype"===t?Reflect.get(e,t):te(o,e,s,t.toString(),a?l:void 0),set:(e,t,n)=>"symbol"==typeof t||"prototype"===t?Reflect.set(e,t,n):ne(o,e,s,t.toString(),n),deleteProperty:(e,t)=>"symbol"==typeof t||"prototype"===t?Reflect.get(e,t):X(o,e,s,t.toString()),has:(e,t)=>"symbol"!=typeof t||Reflect.has(e,t)};this.native_=new window.Proxy(this.target_,c)}IsRoot(){return!this.parentPath_}GetComponentId(){return this.componentId_}GetTarget(){return this.target_}GetNative(){return this.native_}GetName(){return this.name_}GetPath(){return this.parentPath_?`${this.parentPath_}.${this.name_}`:this.name_}GetParentPath(){return this.parentPath_}AddChild(e){this.children_[e.GetName()]=e}RemoveChild(e){delete this.children_["string"==typeof e?e:e.GetName()]}FindChild(e){return this.children_.hasOwnProperty(e)?this.children_[e]:null}}class re extends ie{constructor(e,t,n){super(e,t,`Proxy<${n||e}>`,void 0,!!n)}}function oe(){return{level0:0,level1:0,level2:0}}function se(e,t="level0",n="level1"){e[t]==(Number.MAX_SAFE_INTEGER||9007199254740991)?("level0"===t?se(e,"level1","level2"):++e[n],e[t]=0):++e[t]}function le(e){return`${e.level2}_${e.level1}_${e.level0}`}function ae(e,t,n,i){return se(e),`${t||""}${n||""}${le(e)}${i||""}`}function ce(e){Me().PushCurrentComponent(e)}function ue(){return Me().PopCurrentComponent()}function de(){return Me().PeekCurrentComponent()}class he{constructor(e){this.componentId_=e,this.nextTickHandlers_=new Array,this.isScheduled_=!1,this.list_=new Array,this.subscribers_={},this.lastAccessContext_="",this.getAccessStorages_=new i,this.origins_=new i}GetComponentId(){return this.componentId_}AddNextTickHandler(e){this.nextTickHandlers_.push(e),this.Schedule()}Schedule(){this.isScheduled_||(this.isScheduled_=!0,queueMicrotask((()=>{this.isScheduled_=!1;let e=new Array;this.list_.splice(0).forEach((t=>{Object.values(this.subscribers_).filter((e=>e.path===t.path&&e.callback!==(e=>"original"in e?e.original.origin:e.origin)(t))).forEach((n=>((t,n)=>{let i=e.find((e=>e.callback===n));i?i.changes.push(t):e.push({callback:n,changes:new Array(t)})})(t,n.callback)))})),e.forEach((e=>e.callback(e.changes))),this.nextTickHandlers_.splice(0).forEach((e=>{try{e()}catch(e){o(e,`InlineJs.Region<${this.componentId_}>.NextTick`)}}))})))}Add(e){this.list_.push(e),this.Schedule()}AddComposed(e,t,n){let i={componentId:this.componentId_,type:"set",path:t?`${t}.${e}`:e,prop:e,origin:this.origins_.Peek()};n?this.Add({original:i,path:n}):this.Add(i)}GetLastChange(e=0){return g(this.list_.at(-(e+1))||null)}AddGetAccess(e){var t,n,i,r;let o=(null===(t=R(de()||""))||void 0===t?void 0:t.GetBackend().changes)||this,s=e.lastIndexOf(".");this.lastAccessContext_=-1==s?"":e.substring(0,s);let l=o.getAccessStorages_.Peek();(null==l?void 0:l.details)&&(null===(n=l.details.raw)||void 0===n||n.entries.push({compnentId:this.componentId_,path:e}),l.details.optimized&&l.details.optimized.entries!==(null===(i=l.details.raw)||void 0===i?void 0:i.entries)&&0!=l.details.optimized.entries.length&&l.lastAccessPath&&l.lastAccessPath.length<e.length&&0==e.indexOf(`${l.lastAccessPath}.`)?l.details.optimized.entries.at(-1).path=e:l.details.optimized&&l.details.optimized.entries!==(null===(r=l.details.raw)||void 0===r?void 0:r.entries)&&l.details.optimized.entries.push({compnentId:this.componentId_,path:e}),l.lastAccessPath=e)}GetLastAccessContext(){return this.lastAccessContext_}ResetLastAccessContext(){this.lastAccessContext_=""}PushGetAccessStorage(e){var t;this.getAccessStorages_.Push({details:e||{optimized:"optimized"===(null===(t=R(this.componentId_))||void 0===t?void 0:t.GetReactiveState())?{entries:new Array,snapshots:new i}:void 0,raw:{entries:new Array,snapshots:new i}},lastAccessPath:""})}PopGetAccessStorage(){var e;return(null===(e=this.getAccessStorages_.Pop())||void 0===e?void 0:e.details)||null}SwapOptimizedGetAccessStorage(){let e=this.getAccessStorages_.Peek();(null==e?void 0:e.details.optimized)&&e.details.raw&&(e.details.optimized.entries=e.details.raw.entries)}RestoreOptimizedGetAccessStorage(){var e;let t=this.getAccessStorages_.Peek();(null==t?void 0:t.details.optimized)&&t.details.optimized.entries===(null===(e=t.details.raw)||void 0===e?void 0:e.entries)&&(t.details.optimized.entries=t.details.raw.entries.slice(0))}FlushRawGetAccessStorage(){var e,t;null===(t=null===(e=this.getAccessStorages_.Peek())||void 0===e?void 0:e.details.raw)||void 0===t||t.entries.splice(0)}PushGetAccessStorageSnapshot(){var e,t;let n=this.getAccessStorages_.Peek();null===(e=null==n?void 0:n.details.optimized)||void 0===e||e.snapshots.Push(n.details.optimized.entries.slice(0).map((e=>Object.assign({},e)))),null===(t=null==n?void 0:n.details.raw)||void 0===t||t.snapshots.Push(n.details.raw.entries.slice(0).map((e=>Object.assign({},e))))}PopGetAccessStorageSnapshot(e){var t,n,i,r;let o=this.getAccessStorages_.Peek(),s=null===(t=null==o?void 0:o.details.optimized)||void 0===t?void 0:t.snapshots.Pop();!e&&s&&(null===(n=null==o?void 0:o.details.optimized)||void 0===n?void 0:n.entries)&&(o.details.optimized.entries=s);let l=null===(i=null==o?void 0:o.details.raw)||void 0===i?void 0:i.snapshots.Pop();!e&&l&&(null===(r=null==o?void 0:o.details.raw)||void 0===r?void 0:r.entries)&&(o.details.raw.entries=l)}PopAllGetAccessStorageSnapshots(e){var t,n,i,r,o,s;let l=this.getAccessStorages_.Peek(),a=null===(t=null==l?void 0:l.details.optimized)||void 0===t?void 0:t.snapshots.Pop();for(;(null===(n=null==l?void 0:l.details.optimized)||void 0===n?void 0:n.snapshots)&&!l.details.optimized.snapshots.IsEmpty();)a=l.details.optimized.snapshots.Pop();!e&&a&&(null===(i=null==l?void 0:l.details.optimized)||void 0===i?void 0:i.entries)&&(l.details.optimized.entries=a);let c=null===(r=null==l?void 0:l.details.raw)||void 0===r?void 0:r.snapshots.Pop();for(;(null===(o=null==l?void 0:l.details.raw)||void 0===o?void 0:o.snapshots)&&!l.details.raw.snapshots.IsEmpty();)c=l.details.raw.snapshots.Pop();!e&&c&&(null===(s=null==l?void 0:l.details.raw)||void 0===s?void 0:s.entries)&&(l.details.raw.entries=c)}PushOrigin(e){this.origins_.Push(e)}PeekOrigin(){return this.origins_.Peek()}PopOrigin(){return this.origins_.Pop()}Subscribe(e,t){var n;let i=null===(n=R(this.componentId_))||void 0===n?void 0:n.GenerateUniqueId("sub_");return i&&(this.subscribers_[i]={path:e,callback:t}),i||""}Unsubscribe(e,t){"string"!=typeof e?Object.entries(this.subscribers_).filter((([n,i])=>e===i.callback&&(!t||t===i.path))).map((([e])=>e)).forEach((e=>{this.Unsubscribe_(e)})):e in this.subscribers_&&this.Unsubscribe_(e)}Unsubscribe_(e){delete this.subscribers_[e]}}class pe{constructor(){this.record_={}}Push(e,t){(this.record_[e]=this.record_[e]||new i).Push(t)}Pop(e,t){return this.record_.hasOwnProperty(e)?this.record_[e].Pop():t||null}Peek(e,t){return this.record_.hasOwnProperty(e)?this.record_[e].Peek():t||null}Get(e){return this.record_.hasOwnProperty(e)?this.record_[e]:null}GetHistory(e){return this.record_.hasOwnProperty(e)?this.record_[e].GetHistory():[]}GetRecordKeys(){return Object.keys(this.record_)}}function me(e,t,n){let i="function"==typeof e?function(e){return{handler(t){var{argKey:n}=t,i=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(t,["argKey"]);this.extensions.hasOwnProperty(n)?this.extensions[n](Object.assign({argKey:n},i)):e(Object.assign({argKey:n},i))},extensions:{}}}(e):e;return i.extensions[t]=n,i}function fe(e,t){let n="",i=null;return"function"==typeof e?(n=t||"",i=e):(n=e.GetName(),i=t=>e.Handle(t)),{computedName:n,callback:i}}class ve{constructor(){this.expansionRules_={},this.handlers_={}}AddExpansionRule(e){let t=Me().GenerateUniqueId("exrule_");return this.expansionRules_[t]=e,t}RemoveExpansionRule(e){e in this.expansionRules_&&delete this.expansionRules_[e]}Expand(e){if(!(e=e.trim()))return e;for(let t in this.expansionRules_){let n=this.expansionRules_[t](e);if(n)return n}return e}AddHandler(e,t){let{computedName:n,callback:i}=fe(e,t);n&&i&&(this.handlers_[n]=i)}RemoveHandler(e){e in this.handlers_&&delete this.handlers_[e]}FindHandler(e){if(!this.handlers_.hasOwnProperty(e))return null;let t=this.handlers_[e];return"function"==typeof t?t:t.handler.bind(t)}AddHandlerExtension(e,t,n){let i=this.handlers_.hasOwnProperty(e)?this.handlers_[e]:null;if(!i)return;let{computedName:r,callback:o}=fe(t,n);r&&o&&(this.handlers_[e]=me(i,r,o))}RemoveHandlerExtension(e,t){let n=this.handlers_.hasOwnProperty(e)?this.handlers_[e]:null;n&&function(e,t){"function"!=typeof e&&e.extensions.hasOwnProperty(t)&&delete e.extensions[t]}(n,t)}}function _e(e,t){var n;null===(n="string"==typeof e?R(e):e)||void 0===n||n.PushCurrentScope(t)}function ge(e){var t;return(null===(t="string"==typeof e?R(e):e)||void 0===t?void 0:t.PopCurrentScope())||null}function be(e){var t;return(null===(t="string"==typeof e?R(e):e)||void 0===t?void 0:t.PeekCurrentScope())||null}function ye(){return globalThis.InlineJS_OutsideEvent=globalThis.InlineJS_OutsideEvent||{targetScopes:new Array,eventCallbacks:{}}}function Ce(e,t,n){let i=ye(),r=i.targetScopes.find((t=>t.target===e));r||(r={target:e,listeners:{}},i.targetScopes.push(r)),(Array.isArray(t)?t:[t]).forEach((e=>{e in r.listeners||(r.listeners[e]={handlers:new Array,excepts:null}),r.listeners[e].handlers.push({callback:n,excepts:null}),e in i.eventCallbacks||(i.eventCallbacks[e]=e=>{i.targetScopes.forEach((t=>{e.type in t.listeners&&t.target!==e.target&&!t.target.contains(e.target)&&-1==(t.listeners[e.type].excepts||[]).findIndex((t=>t===e.target||t.contains(e.target)))&&t.listeners[e.type].handlers.filter((t=>-1==(t.excepts||[]).findIndex((t=>t===e.target||t.contains(e.target))))).forEach((t=>s((()=>t.callback(e)),"InlineJS.OutsideEventListener")))}))},window.addEventListener(e,i.eventCallbacks[e]))}))}function Ee(e,t,n){let i=ye().targetScopes.find((t=>t.target===e));i&&(Array.isArray(t)?t:[t]).forEach((e=>{e in i.listeners&&(n?i.listeners[e].handlers=i.listeners[e].handlers.filter((e=>e.callback!==n)):delete i.listeners[e])}))}function xe(e,t,n){let i=ye().targetScopes.find((t=>t.target===e));i&&Object.keys(t).forEach((e=>{if(e in i.listeners)if(n){let r=i.listeners[e].handlers.find((e=>e.callback===n));r&&(r.excepts=r.excepts||new Array,(Array.isArray(t[e])?t[e]:[t[e]]).forEach((e=>{r.excepts.push(e)})))}else i.listeners[e].excepts=i.listeners[e].excepts||new Array,(Array.isArray(t[e])?t[e]:[t[e]]).forEach((t=>{i.listeners[e].excepts.push(t)}))}))}function Ge(e){ye().targetScopes=ye().targetScopes.filter((t=>t.target!==e&&e.contains(t.target)))}class ke{constructor(e,t,n,i){this.componentId_=e,this.id_=t,this.element_=n,this.isRoot_=i,this.scopeId_="",this.key_="",this.locals_={},this.data_={},this.managers_={directive:null},this.callbacks_={post:new Array,uninit:new Array,treeChange:new Array,attributeChange:new Array},this.state_={isMarked:!1,isDestroyed:!1},this.scopeId_=be(this.componentId_)||""}GetComponentId(){return this.componentId_}GetScopeId(){return this.scopeId_}GetId(){return this.id_}SetKey(e){this.key_=e}GetKey(){return this.key_}GetElement(){return this.element_}IsRoot(){return this.isRoot_}SetLocal(e,t){this.state_.isMarked||(this.locals_[e]=t)}DeleteLocal(e){delete this.locals_[e]}HasLocal(e){return e in this.locals_}GetLocal(e){return e in this.locals_?this.locals_[e]:Me().CreateNothing()}GetLocals(){return this.locals_}SetData(e,t){this.state_.isMarked||(this.data_[e]=t)}GetData(e){return e in this.data_?this.data_[e]:Me().CreateNothing()}AddPostProcessCallback(e){this.state_.isMarked||this.callbacks_.post.push(e)}ExecutePostProcessCallbacks(){(this.callbacks_.post||[]).forEach((e=>s(e,"ElementScope.ExecutePostProcessCallbacks")))}AddUninitCallback(e){this.state_.isMarked||this.callbacks_.uninit.push(e)}RemoveUninitCallback(e){this.callbacks_.uninit=this.callbacks_.uninit.filter((t=>t!==e))}AddTreeChangeCallback(e){this.callbacks_.treeChange.push(e)}RemoveTreeChangeCallback(e){this.callbacks_.treeChange=this.callbacks_.treeChange.filter((t=>t!==e))}ExecuteTreeChangeCallbacks(e,t){this.callbacks_.treeChange.forEach((n=>s((()=>n({added:e,removed:t})))))}AddAttributeChangeCallback(e,t){if(this.state_.isMarked)return;let n=this.callbacks_.attributeChange.find((t=>t.callback===e));n?n.whitelist.push(...t||[]):this.callbacks_.attributeChange.push({callback:e,whitelist:"string"==typeof t?[t]:t||[]})}RemoveAttributeChangeCallback(e,t){let n=this.callbacks_.attributeChange.findIndex((t=>t.callback===e));if(-1==n)return;let i="string"==typeof t?[t]:t||[];0!=i.length&&0!=this.callbacks_.attributeChange[n].whitelist.length?i.forEach((e=>{this.callbacks_.attributeChange[n].whitelist=this.callbacks_.attributeChange[n].whitelist.filter((t=>t!==e))})):this.callbacks_.attributeChange[n].whitelist.splice(0),0==this.callbacks_.attributeChange[n].whitelist.length&&this.callbacks_.attributeChange.splice(n,1)}ExecuteAttributeChangeCallbacks(e){(this.callbacks_.attributeChange||[]).filter((t=>0==(t.whitelist||[]).length||t.whitelist.includes(e))).forEach((t=>s((()=>t.callback(e)))))}Destroy(e){if(this.state_.isDestroyed)return;if(this.state_.isMarked=!0,!(this.element_ instanceof HTMLTemplateElement)){let t=R(this.componentId_);t&&this.DestroyChildren_(t,this.element_,e||!1)}if(e)return;this.callbacks_.uninit.splice(0).forEach((e=>{try{e()}catch(e){}})),this.callbacks_.post.splice(0),this.callbacks_.treeChange.splice(0),this.callbacks_.attributeChange.splice(0),this.data_={},this.locals_={},this.state_.isDestroyed=!0,Ge(this.element_),Me().GetMutationObserver().Unobserve(this.element_);let t=R(this.componentId_);if(null==t||t.RemoveElementScope(this.id_),delete this.element_[K],this.isRoot_){let e=this.componentId_;null==t||t.GetBackend().changes.AddNextTickHandler((()=>Me().RemoveComponent(e)))}}IsMarked(){return this.state_.isMarked}IsDestroyed(){return this.state_.isDestroyed}GetDirectiveManager(){return this.managers_.directive=this.managers_.directive||new ve}DestroyChildren_(e,t,n){Array.from(t.children).filter((e=>!e.contains(t))).forEach((t=>{let i=e.FindElementScope(t);i?i.Destroy(n):this.DestroyChildren_(e,t,n)}))}}class Ie{constructor(e,t,n){this.componentId_=e,this.id_=t,this.root_=n,this.name_="",this.proxy_=new re(this.componentId_,{},this.id_)}GetComponentId(){return this.componentId_}GetId(){return this.id_}SetName(e){this.name_=e}GetName(){return this.name_}GetRoot(){return this.root_}GetProxy(){return this.proxy_}FindElement(e,t){if(e===this.root_||!this.root_.contains(e))return null;do{e=e.parentElement;try{if(t(e))return e}catch(e){}}while(e!==this.root_);return null}FindAncestor(e,t){let n=t||0;return this.FindElement(e,(()=>0==n--))}}class Ae{constructor(e,t){this.id_=e,this.root_=t,this.reactiveState_="default",this.name_="",this.context_=new pe,this.scopes_={},this.elementScopes_={},this.proxies_={},this.refs_={},this.currentScope_=new i,this.selectionScopes_=new i,this.uniqueMarkers_={level0:0,level1:0,level2:0},this.observers_={intersections:{}},this.changes_=new he(this.id_),this.rootProxy_=new re(this.id_,{}),this.proxies_[this.rootProxy_.GetPath()]=this.rootProxy_,this.CreateElementScope(this.root_),Me().GetMutationObserver().Observe(this.root_,(({added:t,removed:n,attributes:i})=>{let r=R(e);if(!r)return;let o=new Array,s=Me().GetConfig().GetDirectiveRegex();null==i||i.filter((e=>e.target instanceof HTMLElement)).forEach((e=>{var t;s.test(e.name)?e.target.hasAttribute(e.name)&&!o.includes(e.target)&&o.push(e.target):null===(t=null==r?void 0:r.FindElementScope(e.target))||void 0===t||t.ExecuteAttributeChangeCallbacks(e.name)})),o.forEach((e=>W({element:e,component:r,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}})));let l=[...t||[]];null==t||t.filter((e=>!(null==n?void 0:n.includes(e)))).forEach((e=>{var t;if(e instanceof HTMLElement){W({component:r,element:e,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}});for(let n=e.parentElement;n&&(null===(t=null==r?void 0:r.FindElementScope(n))||void 0===t||t.ExecuteTreeChangeCallbacks([e],[]),n!==this.root_);n=n.parentElement);}})),null==n||n.filter((e=>!l.includes(e))).forEach((e=>{var t;e instanceof HTMLElement&&(null===(t=r.FindElementScope(e))||void 0===t||t.Destroy())}))}),["add","remove","attribute"])}SetReactiveState(e){this.reactiveState_=e}GetReactiveState(){return"default"===this.reactiveState_?B().GetReactiveState():this.reactiveState_}GetId(){return this.id_}GenerateUniqueId(e,t){return ae(this.uniqueMarkers_,`Cmpnt<${this.id_}>.`,e,t)}SetName(e){this.name_=e}GetName(){return this.name_}CreateScope(e){let t=Object.values(this.scopes_).find((t=>t.GetRoot()===e));if(t)return t;if(e===this.root_||!this.root_.contains(e))return null;let n=new Ie(this.id_,this.GenerateUniqueId("scope_"),e);return this.scopes_[n.GetId()]=n,this.AddProxy(n.GetProxy()),n}RemoveScope(e){let t="string"==typeof e?e:e.GetId();this.scopes_.hasOwnProperty(t)&&(this.RemoveProxy(this.scopes_[t].GetProxy()),delete this.scopes_[t])}FindScopeById(e){return this.scopes_.hasOwnProperty(e)?this.scopes_[e]:null}FindScopeByName(e){return Object.values(this.scopes_).find((t=>t.GetName()===e))||null}FindScopeByRoot(e){return Object.values(this.scopes_).find((t=>t.GetRoot()===e))||null}PushCurrentScope(e){this.currentScope_.Push(e)}PopCurrentScope(){return this.currentScope_.Pop()}PeekCurrentScope(){return this.currentScope_.Peek()}InferScopeFrom(e){var t;return this.FindScopeById((null===(t=this.FindElementScope(V(e)))||void 0===t?void 0:t.GetScopeId())||"")||null}PushSelectionScope(){let e={set:!1};return this.selectionScopes_.Push(e),e}PopSelectionScope(){return this.selectionScopes_.Pop()}PeekSelectionScope(){return this.selectionScopes_.Peek()}GetRoot(){return this.root_}FindElement(e,t){if(e===this.root_||!this.root_.contains(e))return null;do{e=e.parentElement;try{if(t(e))return e}catch(e){}}while(e!==this.root_);return null}FindAncestor(e,t){let n=t||0;return this.FindElement(e,(()=>0==n--))}CreateElementScope(e){let t=Object.values(this.elementScopes_).find((t=>t.GetElement()===e));if(t)return t;if(e!==this.root_&&!this.root_.contains(e))return null;let n=new ke(this.id_,this.GenerateUniqueId("elscope_"),e,e===this.root_);return this.elementScopes_[n.GetId()]=n,e[K]=n.GetId(),n}RemoveElementScope(e){delete this.elementScopes_[e]}FindElementScope(e){if("string"==typeof e)return e in this.elementScopes_?this.elementScopes_[e]:null;let t=!0===e?this.context_.Peek(d.self):e instanceof Node?e:this.root_;return t&&K in t&&t[K]in this.elementScopes_?this.elementScopes_[t[K]]:null}FindElementLocalValue(e,t,n){let i=this.FindElementScope(e),r=i?i.GetLocal(t):Me().CreateNothing();if(!Me().IsNothing(r)||!n||!i&&"string"==typeof e)return r;let o=(null==i?void 0:i.GetElement())||(!0===e?this.context_.Peek(d.self):e instanceof Node?e:this.root_);if(!o)return r;let s=this.FindAncestor(o);return s?this.FindElementLocalValue(s,t,!0):r}AddProxy(e){this.proxies_[e.GetPath()]=e}RemoveProxy(e){let t="string"==typeof e?e:e.GetPath();this.proxies_.hasOwnProperty(t)&&delete this.proxies_[t]}GetRootProxy(){return this.rootProxy_}FindProxy(e){return e in this.proxies_?this.proxies_[e]:null}AddRefElement(e,t){this.refs_[e]=t}FindRefElement(e){return e in this.refs_?this.refs_[e]:null}AddIntersectionObserver(e){this.observers_.intersections[e.GetId()]=e}FindIntersectionObserver(e){return e in this.observers_.intersections?this.observers_.intersections[e]:null}RemoveIntersectionObserver(e){e in this.observers_.intersections&&delete this.observers_.intersections[e]}GetBackend(){return{context:this.context_,changes:this.changes_}}GetGlobal(){return Me()}}class Se{constructor(){this.handlers_={}}AddHandler(e,t,n){let i="",r=null;"function"==typeof e?(i=t||"",r=e):(i=e.GetName(),r=t=>e.Handle(t)),i&&r&&(this.handlers_[i]={callback:r,onAccess:n})}RemoveHandler(e){e in this.handlers_&&delete this.handlers_[e]}FindHandler(e,t){return e in this.handlers_?(t&&this.handlers_[e].onAccess&&this.handlers_[e].onAccess(t),this.handlers_[e].callback):null}}class Pe{constructor(){if(this.uniqueMarkers_={level0:0,level1:0,level2:0},this.observer_=null,this.handlers_={},globalThis.MutationObserver)try{this.observer_=new globalThis.MutationObserver((e=>{let t={},n=e=>t[e]=t[e]||{added:new Array,removed:new Array,attributes:new Array};e.forEach((e=>{var t,i;if("childList"===(null==e?void 0:e.type)){let i=e=>{var t;let r=V((null===(t=Y(e))||void 0===t?void 0:t.GetRoot())||null);r?n(r).removed.push(e):Array.from(e.childNodes).filter((t=>!t.contains(e))).forEach(i)};e.removedNodes.forEach(i);let r=e.target instanceof HTMLElement?V((null===(t=Y(e.target))||void 0===t?void 0:t.GetRoot())||null):"";r&&n(r).added.push(...Array.from(e.addedNodes))}else if("attributes"===(null==e?void 0:e.type)&&e.attributeName){let t=e.target instanceof HTMLElement?V((null===(i=Y(e.target))||void 0===i?void 0:i.GetRoot())||null):"";t&&n(t).attributes.push({name:e.attributeName,target:e.target})}})),0!=Object.keys(t).length&&Object.entries(this.handlers_).forEach((([e,n])=>{let i=n.target instanceof HTMLElement?V(n.target):"";if(!i||!(i in t))return;let r=(e,t,n)=>!t.whitelist||t.whitelist.includes(e)?n:void 0,o=r("add",n,t[i].added),l=r("remove",n,t[i].removed),a=r("attribute",n,t[i].attributes);(o||l||a)&&s((()=>n.handler({id:e,added:o,removed:l,attributes:a})),"InlineJS.MutationObserver")}))})),this.observer_.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!1})}catch(e){this.observer_=null}}GetNative(){return this.observer_}Observe(e,t,n){let i=ae(this.uniqueMarkers_);return this.handlers_[i]={target:e,handler:t,whitelist:n},i}Unobserve(e){"string"!=typeof e?Object.entries(this.handlers_).filter((([t,n])=>n.target===e)).forEach((([e])=>delete this.handlers_[e])):delete this.handlers_[e]}}class we extends ie{constructor(e,t,n){super(e.GetComponentId(),n,t,e)}}class Oe{constructor({appName:e="",reactiveState:t="unoptimized",directivePrefix:n="x",directiveRegex:i,directiveNameBuilder:r}={}){this.keyMap_={return:"enter",ctrl:"control",esc:"escape",space:" ",menu:"contextmenu",del:"delete",ins:"insert",plus:"+",minus:"-",star:"*",slash:"/",alpha:Array.from({length:26}).map(((e,t)=>String.fromCharCode(t+97))),digit:Array.from({length:10}).map(((e,t)=>t.toString()))},this.booleanAttributes_=new Array("allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"),this.appName_=e,this.reactiveState_=t,this.directiveRegex_=i||new RegExp(`^(data-)?${n||"x"}-(.+)$`),this.directiveNameBuilder_=r||((e,t=!1)=>t?`data-${n||"x"}-${e}`:`${n||"x"}-${e}`)}GetAppName(){return this.appName_}GetDirectiveRegex(){return this.directiveRegex_}GetDirectiveName(e,t){return this.directiveNameBuilder_(e,t)}AddKeyEventMap(e,t){this.keyMap_[e]=t}RemoveKeyEventMap(e){delete this.keyMap_[e]}MapKeyEvent(e){return e in this.keyMap_?this.keyMap_[e]:e}AddBooleanAttribute(e){this.booleanAttributes_.push(e)}RemoveBooleanAttribute(e){this.booleanAttributes_=this.booleanAttributes_.filter((t=>t!==e))}IsBooleanAttribute(e){return this.booleanAttributes_.includes(e)}SetReactiveState(e){this.reactiveState_=e}GetReactiveState(){return this.reactiveState_}}class Fe{Get(e,t){return fetch(e,t)}}class Re{constructor(e,t=0){this.nothing_=new a,this.componentsMonitorList_=new Array,this.components_={},this.currentComponent_=new i,this.attributeProcessors_=new Array,this.textContentProcessors_=new Array,this.managers_={directive:new ve,magic:new Se},this.uniqueMarkers_={level0:0,level1:0,level2:0},this.mutationObserver_=new Pe,this.nativeFetch_=new Fe,this.fetchConcept_=null,this.concepts_={},this.config_=new Oe(e||{}),this.uniqueMarkers_.level0=t||0}SwapConfig(e){this.config_=e}GetConfig(){return this.config_}GenerateUniqueId(e,t){return ae(this.uniqueMarkers_,"",e,t)}AddComponentMonitor(e){this.componentsMonitorList_.push(e)}RemoveComponentMonitor(e){this.componentsMonitorList_=this.componentsMonitorList_.filter((t=>t!==e))}CreateComponent(e){let t=this.InferComponentFrom(e);if(t)return t;let n=new Ae(this.GenerateUniqueId(),e);return this.components_[n.GetId()]=n,this.componentsMonitorList_.slice(0).forEach((e=>s((()=>e({action:"add",component:n})),"InlineJS.Global.CreateComponent"))),n}RemoveComponent(e){let t="string"==typeof e?e:e.GetId();if(this.components_.hasOwnProperty(t)){let e=this.components_[t];delete this.components_[t],this.componentsMonitorList_.slice(0).forEach((t=>s((()=>t({action:"remove",component:e})),"InlineJS.Global.RemoveComponent")))}}TraverseComponents(e){Object.values(this.components_).some((t=>!1===e(t)))}FindComponentById(e){return e&&e in this.components_?this.components_[e]:null}FindComponentByName(e){return e&&Object.values(this.components_).find((t=>t.GetName()===e))||null}FindComponentByRoot(e){return e&&Object.values(this.components_).find((t=>t.GetRoot()===e))||null}PushCurrentComponent(e){this.currentComponent_.Push(e)}PopCurrentComponent(){return this.currentComponent_.Pop()}PeekCurrentComponent(){return this.currentComponent_.Peek()}GetCurrentComponent(){return this.FindComponentById(this.PeekCurrentComponent()||"")}InferComponentFrom(e){return e&&Object.values(this.components_).find((t=>t.GetRoot()===e||t.GetRoot().contains(e)))||null}GetDirectiveManager(){return this.managers_.directive}GetMagicManager(){return this.managers_.magic}AddAttributeProcessor(e){this.attributeProcessors_.push(e)}DispatchAttributeProcessing(e){this.attributeProcessors_.forEach((t=>s((()=>t(e)),"InlineJS.Global.DispatchAttribute",e.contextElement)))}AddTextContentProcessor(e){this.textContentProcessors_.push(e)}DispatchTextContentProcessing(e){this.textContentProcessors_.forEach((t=>s((()=>t(e)),"InlineJS.Global.DispatchTextContent",e.contextElement)))}GetMutationObserver(){return this.mutationObserver_}SetFetchConcept(e){this.fetchConcept_=e}GetFetchConcept(){return this.fetchConcept_||this.nativeFetch_}SetConcept(e,t){this.concepts_[e]=t}RemoveConcept(e){delete this.concepts_[e]}GetConcept(e){return this.concepts_.hasOwnProperty(e)?this.concepts_[e]:null}CreateChildProxy(e,t,n){return new we(e,t,n)}CreateFuture(e){return new r(e)}IsFuture(e){return e instanceof r}CreateNothing(){return this.nothing_}IsNothing(e){return e instanceof a}}const $e="__InlineJS_GLOBAL_KEY__";function Ne(e,t=0){return F(),globalThis[$e]=new Re(e,t),(globalThis.InlineJS=globalThis.InlineJS||{}).global=globalThis[$e],window.dispatchEvent(new CustomEvent(De)),globalThis[$e]}function Te(e,t=0){return Me()||Ne(e,t)}const De="inlinejs.global.created";function Me(){return globalThis[$e]}function Be(){return Me()?Promise.resolve():new Promise((e=>window.addEventListener(De,e)))}function Le(e){return e=p(e),Me().IsFuture(e)?Le(e.Get()):!e&&!1!==e&&0!==e||Me().IsNothing(e)?"":"boolean"==typeof e||"number"==typeof e||"string"==typeof e?e.toString():JSON.stringify(e)}function je({target:e,getter:t,setter:n,deleter:i,lookup:r,alert:o}){let s={get(e,n){var i;if("symbol"==typeof n||"string"==typeof n&&"prototype"===n)return Reflect.get(e,n);let r=t?t(n.toString(),e):e[n];return Me().IsNothing(r)?Reflect.get(e,n):(!o||o.list&&!(n in o.list)||null===(i=R(o.componentId))||void 0===i||i.GetBackend().changes.AddGetAccess(`${o.id}.${n}`),r)},set:(e,t,i)=>"symbol"==typeof t||"string"==typeof t&&"prototype"===t?Reflect.set(e,t,i):n?!1!==n(t.toString(),i,e):!!e[t]||!0,deleteProperty:(e,t)=>"symbol"==typeof t||"string"==typeof t&&"prototype"===t?Reflect.deleteProperty(e,t):i?!1!==i(t.toString(),e):!!delete e[t]||!0,has:(e,t)=>!!Reflect.has(e,t)||(Array.isArray(r)?r.includes(t.toString()):r?r(t.toString(),e):t in e)};return new window.Proxy(e||{},s)}function Je(e){return je(qe({getter:t=>t&&t in e&&e[t]||null,lookup:[...Object.keys(e)]}))}function He(){return!1}function ze(e){var{setter:t,deleter:n,lookup:i}=e,r=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(e,["setter","deleter","lookup"]);return Object.assign(Object.assign({},r),{setter:t||He,deleter:n||He,lookup:i||He})}function qe(e){return ze(e)}function Ue(e,t,n){let i=null==t?void 0:t.FindElementScope(n),r=null==i?void 0:i.GetId();if(!r)return["",null,null];let o=globalThis.InlineJS_ProxyGlobal=globalThis.InlineJS_ProxyGlobal||{},s=o[e]=o[e]||{};return r in s?[r,s[r],s]:(null==i||i.AddUninitCallback((()=>delete s[r])),[r,null,s])}function We(e,t,n){if(!(e instanceof Promise))return t(e);n?e.then((e=>We(e,t,!0))):e.then(t)}const Ke="__InlineJS_Context__";let Ve={},Ye={};function Qe(e,t){if(Ve.hasOwnProperty(e))return Ve[e];if(Ye.hasOwnProperty(e))return null;try{let t=new Function(Ke,`\n with (__InlineJS_Context__){\n return (${e});\n };\n `);return Ve[e]=t}catch(e){e instanceof SyntaxError||o(e,`InlineJs.Region<${t||"NIL"}>.GenerateValueReturningFunction`)}return null}function Ze(e,t){if(Ye.hasOwnProperty(e))return Ye[e];try{let t=new Function(Ke,`\n with (__InlineJS_Context__){\n ${e};\n };\n `);return Ye[e]=t}catch(e){o(e,`InlineJs.Region<${t||"NIL"}>.GenerateVoidFunction`)}return null}function Xe(e,t,n,i=[]){var r;if("function"==typeof e){let o=R(n||""),s=null==o?void 0:o.FindProxy(null==o?void 0:o.GetBackend().changes.GetLastAccessContext()),l=e.apply((null===(r=s||(null==o?void 0:o.GetRootProxy()))||void 0===r?void 0:r.GetNative())||null,i||[]);return t?t(l):l}return t?t(e):e}function et({componentId:e,contextElement:t,expression:n,disableFunctionCall:i=!1,waitPromise:r="recursive"}){if(!(n=n.trim()))return e=>(e&&e(null),null);let s=(s,l,a,c,u=!0,h)=>{var p;let m=R(e),f=null==m?void 0:m.GetRootProxy().GetNative();if(!f||(null===(p=null==m?void 0:m.FindElementScope(t))||void 0===p?void 0:p.IsDestroyed()))return;let{context:v=null,changes:_=null}=(null==m?void 0:m.GetBackend())||{};null==v||v.Push(d.self,t),null==_||_.ResetLastAccessContext(),ce(e),Object.entries(c||{}).forEach((([e,t])=>null==v?void 0:v.Push(e,t)));try{let t=l(f);if(Me().IsFuture(t)&&(t=t.Get()),!s)return i?t:Xe(t,s,e,a);let n=e=>{if(e&&"none"!==r)return We(e,s,"recursive"===r),h||"Loading data...";s(e)};i?n(t):Xe(t,n,e,a)}catch(t){if(u&&t instanceof SyntaxError)throw t;o(t,`InlineJs.Region<${e}>.RunFunction('${n}')`)}finally{Object.entries(c||{}).forEach((([e,t])=>null==v?void 0:v.Pop(e,t))),ue(),null==v||v.Pop(d.self)}},l=Qe(n,e),a=null;return l||(a=Ze(n,e)),(i,r=[],o,c)=>{if(!a&&l)try{return s(i,l.bind(t),r||[],o||{},void 0,c)}catch(t){if(!(t instanceof SyntaxError))throw t;a=Ze(n,e)}return a?s(i,a.bind(t),r||[],o||{},!1)||null:(i&&i(null),null)}}function tt(e){return et(e)}function nt(e,t){let n=(e,t)=>We(e,t,!0);return e instanceof l?new l(((i,r)=>{e.While((e=>{n(e,(e=>{n(t(e),(e=>i(e)))}))})),e.Final((e=>{n(e,(e=>{n(t(e),(e=>r(e)))}))}))})):e instanceof Promise?new Promise((i=>{n(e,(e=>{n(t(e),(e=>i(e)))}))})):t(e)}function it(e,t,n){e instanceof l?e.While(t).Final(!1===n?()=>{}:n||t):t(e)}function rt({componentId:e,changes:t,callback:n,subscriptionsCallback:i,contextElement:r}){var s,l,a,c;t.PopAllGetAccessStorageSnapshots(!1),t.RestoreOptimizedGetAccessStorage();let{optimized:u,raw:d}=t.PopGetAccessStorage();if(0==((null===(s=u||d)||void 0===s?void 0:s.entries.length)||0))return i&&i({}),null;let h={},p=()=>{Object.keys(h).map((e=>R(e))).filter((e=>!!e)).forEach((e=>{let{changes:t}=e.GetBackend();h[e.GetId()].forEach((e=>t.Unsubscribe(e)))})),h={}},m=!1,f=()=>{m=!0},v=t=>{let i=R(e);if(!i||m)return void p();let{changes:r}=i.GetBackend();r.PushOrigin(v);try{n({changes:t||[],cancel:f})}catch(t){o(t,`InlineJS.Component<${e}>.SubscribeToChanges.OnChange`)}r.PopOrigin(),m&&p()},_={};return null===(l=u||d)||void 0===l||l.entries.forEach((e=>(_[e.path]=_[e.path]||{})[e.compnentId]=!0)),Object.entries(_).forEach((([e,t])=>{Object.keys(t).map((e=>R(e))).filter((e=>!!e)).forEach((t=>{(h[t.GetId()]=h[t.GetId()]||[]).push(t.GetBackend().changes.Subscribe(e,v))}))})),r&&(null===(c=null===(a=R(e))||void 0===a?void 0:a.FindElementScope(r))||void 0===c||c.AddUninitCallback((()=>{f(),p()}))),i&&i(h),p}function ot({componentId:e,callback:t,contextElement:n,options:i,subscriptionsCallback:r}){var s;let l=()=>{let i=R(e);if(!i)return;let{changes:s}=i.GetBackend(),l=!1,a=n?i.FindElementScope(n):null,c=()=>{l=!0},u=null==a?void 0:a.GetElement();try{s.PushGetAccessStorage(),t({changes:[],cancel:c})}catch(t){o(t,`InlineJS.Component<${e}>.UseEffect`,u)}if(l)return s.PopAllGetAccessStorageSnapshots(!1),s.RestoreOptimizedGetAccessStorage(),void s.PopGetAccessStorage();rt({componentId:e,changes:s,callback:t,subscriptionsCallback:r,contextElement:u})};(null==i?void 0:i.nextTick)?null===(s=R(e))||void 0===s||s.GetBackend().changes.AddNextTickHandler(l):l()}function st(e,t,n,i={}){var r;let o=null;if(o=e instanceof HTMLElement?(null===(r="string"==typeof n?R(n):n)||void 0===r?void 0:r.FindElementScope(e))||null:e,!o)return i;let s=o.GetLocal(t);return Me().IsNothing(s)&&o.SetLocal(t,s=i),s}const lt="__InlineJS_GLOBAL_COMPONENT_KEY__";function at(e){let t=globalThis[lt];if(t||!1===e)return t.component;let n=document.createElement("template");return globalThis[lt]={root:n,component:Me().CreateComponent(n)},globalThis[lt]}const ct=300,ut=0,dt=0;function ht(e,t){if(!e||Me().IsNothing(e)||e.allowed&&"both"!==e.allowed&&e.allowed!==(t?"reversed":"normal"))return null;let n=Me().GetConcept("animation");return e.ease=e.ease||(null==n?void 0:n.GetEaseCollection().Find("default"))||null,e.actor=e.actor||(null==n?void 0:n.GetActorCollection().Find("default"))||null,e.duration=e.duration||ct,e.delay=e.delay||ut,e.repeats=e.repeats||dt,e}function pt({componentId:e,contextElement:t,target:n,callback:i,onAbort:r,reverse:o,allowRepeats:l}){var a,c,u,d;let h=ht((null===(c=null===(a=R(e))||void 0===a?void 0:a.FindElementScope(t))||void 0===c?void 0:c.GetData("transition"))||null,o||!1);if(!h||!h.actor||!h.ease||"number"!=typeof h.duration||h.duration<=0)return i(!1),null;let p=e=>{var t;return"function"==typeof(null==h?void 0:h.actor)?null==h?void 0:h.actor(e):h&&(null===(t=h.actor)||void 0===t?void 0:t.Handle(e))},m=e=>{var t;return"function"==typeof h.ease?h.ease(e):h&&(null===(t=h.ease)||void 0===t?void 0:t.Handle(e))||0},f=!1,v=()=>f=!0,_=0,g=e=>o?1-e:e,b=()=>{var i,o;return null===(o=null===(i=R(e))||void 0===i?void 0:i.FindElementScope(t))||void 0===o||o.RemoveUninitCallback(v),(n||t).dispatchEvent(new CustomEvent("transition.canceled")),r&&r(),!1};return null===(d=null===(u=R(e))||void 0===u?void 0:u.FindElementScope(t))||void 0===d||d.AddUninitCallback(v),k(h.duration,0,l?h.repeats:0,h.delay).While((({elapsed:e})=>{if(f)return b();0==_&&((n||t).style.transform="",(n||t).style.transformOrigin="50% 50%",(n||t).dispatchEvent(new CustomEvent("transition.enter"))),p({target:n||t,stage:0==_++?"start":"middle",fraction:m({duration:h.duration,elapsed:e,fraction:g(e/h.duration)})})})).Final((()=>{f?b():(p({target:n||t,stage:"end",fraction:m({duration:h.duration,elapsed:h.duration,fraction:g(1)})}),(n||t).dispatchEvent(new CustomEvent("transition.leave")),s((()=>i(!0))))})),v}function mt({element:e,html:t,type:n="replace",component:i,processDirectives:r=!0,afterInsert:o,afterTransitionCallback:l,transitionScope:a}){let c="string"==typeof i?i:(null==i?void 0:i.GetId())||"",u=()=>{let i=document.createElement("template");i.innerHTML=t,"replace"===n||"append"===n?e.append(...Array.from(i.content.childNodes)):"prepend"===n&&e.prepend(...Array.from(i.content.childNodes)),o&&s(o,"InlineJS.InsertHtml",e);let u=R(c);r&&u&&Array.from(e.children).forEach((e=>W({component:u,element:e,options:{checkTemplate:!0,checkDocument:!0,ignoreChildren:!1}}))),l&&((a||e).dispatchEvent(new CustomEvent("html.transition.begin",{detail:{insert:!0}})),pt({componentId:c,contextElement:a||e,target:e,callback:()=>((a||e).dispatchEvent(new CustomEvent("html.transition.end",{detail:{insert:!0}})),l())}))};if("replace"===n){let t=e=>{let n=R(c),i=Me();Array.from(e.children).forEach((e=>{var r;let o=null==n?void 0:n.FindElementScope(e);o||K in e&&(o=null===(r=i.InferComponentFrom(e))||void 0===r?void 0:r.FindElementScope(e))?o.Destroy():t(e)}))},n=()=>{t(e),Array.from(e.childNodes).forEach((e=>e.remove())),u()};l?((a||e).dispatchEvent(new CustomEvent("html.transition.begin",{detail:{insert:!1}})),pt({componentId:c,contextElement:a||e,target:e,reverse:!0,callback:()=>((a||e).dispatchEvent(new CustomEvent("html.transition.end",{detail:{insert:!1}})),n())})):n()}else u()}class ft{constructor(e,t,n=!1){this.componentId_=e,this.callback_=t,this.initialized_=n,this.queued_=!1,this.setCallback_=null}Queue(e){var t;let n=()=>(this.setCallback_||e||this.callback_)&&(this.setCallback_||e||this.callback_)();!this.queued_&&this.initialized_?(this.queued_=!0,null===(t=R(this.componentId_))||void 0===t||t.GetBackend().changes.AddNextTickHandler((()=>{this.queued_=!1,n()}))):this.initialized_?this.setCallback_=e||null:(this.initialized_=!0,n())}}const vt=/\{\{\s*(.+?)\s*\}\}/g,_t=/\{\{.+?\}\}/;function gt(e){let t=e=>[...e.childNodes].reduce(((e,t)=>`${e}${3!=t.nodeType?n(t):t.textContent||""}`),""),n=e=>`${[...e.attributes].reduce(((e,t)=>`${e} ${t.name}="${t.value}"`),`<${e.tagName.toLowerCase()}`)+">"}${t(e)}</${e.tagName.toLowerCase()}>`;return t(e)}function bt({componentId:e,contextElement:t,text:n,handler:i}){var r;let o=tt({componentId:e,contextElement:t,expression:"let output = "+JSON.stringify(n).replace(vt,'"+($1)+"')+"; return output;"});null===(r=R(e))||void 0===r||r.CreateElementScope(t),ot({componentId:e,contextElement:t,callback:()=>o(i)})}function yt(e){var{text:t}=e,n=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(e,["text"]);_t.test(t)&&bt(Object.assign({text:t},n))}function Ct({componentId:e,contextElement:t,text:n,handler:i}){if("string"==typeof n)return i&&yt({componentId:e,contextElement:t,text:n,handler:i});if(!_t.test(t.textContent||""))return;let r=new Array,o=new Array;[...t.childNodes].forEach((n=>{if(3==n.nodeType&&n.textContent&&_t.test(n.textContent)){let i={text:n.textContent||"",evaluated:n.textContent||""};r.push(i),o.push((()=>bt({componentId:e,contextElement:t,text:i.text,handler:e=>{i.evaluated=e,(()=>{for(;t.firstChild;)t.firstChild.remove();let e=null;r.forEach((n=>{let i=n instanceof Element?n:document.createTextNode("string"==typeof n?n:n.evaluated);e?t.insertBefore(i,e):t.append(i),e=i}))})()}})))}else 3==n.nodeType?r.push(n.textContent||""):r.push(n)})),r.reverse(),o.forEach((e=>s(e,"InlineJS.Interpolate",t)))}function Et({componentId:e,contextElement:t,name:n,value:i}){Ct({componentId:e,contextElement:t,text:i,handler:e=>t.setAttribute(n,e)})}function xt({componentId:e,contextElement:t}){Ct({componentId:e,contextElement:t})}function Gt(e){let t=Me(),n=t.GetConfig();[n.GetDirectiveName("data",!0),n.GetDirectiveName("data",!1)].forEach((n=>{(e||document).querySelectorAll(`[${n}]`).forEach((e=>{e.hasAttribute(n)&&document.contains(e)&&W({component:t.CreateComponent(e),element:e,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}})}))}))}function kt(e){Te(),setTimeout((()=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>{Gt(e)})):Gt(e)}),0)}function It(e,t){let n="",i=null;if("function"==typeof e){let t=e();t?({name:n,callback:i}=t):(n=e("name"),i=e("callback"))}else v(e)?({name:n,callback:i}=e):Me().GetDirectiveManager().AddHandler(e);n&&i&&(t?Me().GetDirectiveManager().AddHandlerExtension(t,i,n):Me().GetDirectiveManager().AddHandler(i,n))}function At(e,t){return{name:e,callback:t}}function St(e,t,n,i,r){let o=Me().GetConfig().GetDirectiveName("on"),s=(r||[]).join("."),l=q(s?`${o}:${n}.${s}`:`${o}:${n}`,i||"");return!!l&&M(e,t,l)}const Pt=["bind","event","on"];function wt({component:e,contextElement:t,key:n,event:i,expression:r,options:o,defaultEvent:s,eventWhitelist:l=[],optionBlacklist:a}){let c=()=>a?null==o?void 0:o.filter((e=>!a.includes(e))):o,u=e=>n?`${n}-${e}.join`:e;return l.includes(i)?St(e,t,u(i),r,c()):!(!s||i!==s&&!Pt.includes(i))&&St(e,t,u(s),r,c())}function Ot(e,t,n){let i=Me().GetConfig().GetDirectiveName(t,!1),r=Me().GetConfig().GetDirectiveName(t,!0);return e.getAttribute(i)||e.getAttribute(r)||n&&e.getAttribute(n)||null}function Ft({componentId:e,contextElement:t,key:n,expression:i,callback:r,arrayCallback:o,useEffect:s=!0}){let l=0,a=tt({componentId:e,contextElement:t,expression:i}),c=(e,t)=>{nt(e,(e=>{t==l&&(n?r([n,e]):v(e)?Object.entries(e).forEach(r):o&&("string"==typeof e||Array.isArray(e))&&o("string"==typeof e?e.trim().split(" ").filter((e=>!!e)):e))}))};s?ot({componentId:e,contextElement:t,callback:()=>a((e=>c(e,++l)))}):a((e=>c(e,l)))}const Rt=Array.from(Array(100).keys()).map((e=>e/100));function $t(e){let t={root:null,rootMargin:"0px",threshold:0};return v(e)&&Object.entries(t).forEach((([n,i])=>t[n]=n in e&&e[n]||i)),e.spread&&(t.threshold=Rt),t}class Nt{constructor(e,t){this.id_=e,this.observer_=null,this.handlers_=new Array;let n=this.id_;this.observer_=new globalThis.IntersectionObserver(((e,t)=>{e.forEach((e=>{this.handlers_.filter((({target:t})=>t===e.target)).forEach((i=>{s((()=>i.handler({entry:e,id:n,observer:t})),"InlineJS.IntersectionObserver")}))}))}),$t(t))}GetId(){return this.id_}GetNative(){return this.observer_}Observe(e,t){var n;this.handlers_.push({target:e,handler:t}),null===(n=this.observer_)||void 0===n||n.observe(e)}Unobserve(e){var t;this.handlers_=this.handlers_.filter((t=>t.target===e)),null===(t=this.observer_)||void 0===t||t.unobserve(e)}}function Tt(e,t=0){return e&&e.match(/^[0-9]+(s|ms)?$/)?-1==e.indexOf("m")&&-1!=e.indexOf("s")?1e3*parseInt(e):parseInt(e):t}function Dt({options:e,list:t,defaultNumber:n,callback:i,unknownCallback:r}){let o=Array.isArray(e)?e:[e],s=e=>("number"==typeof n?n:n&&n(e))||0;return t.forEach(((n,l)=>{let a=o.find((e=>e&&n in e));if(!a)return r&&r({options:e,list:t,option:n,index:l});i&&!0===i({options:e,list:t,option:n,index:l})||("number"==typeof a[n]?l<t.length-1?a[n]=Tt(t[l+1].trim(),s(n)):a[n]=s(n):"boolean"==typeof a[n]&&(a[n]=!0))})),e}function Mt({componentId:e,component:t,contextElement:n,expression:i,argOptions:r,callback:o,options:s,defaultOptionValue:l,useEffect:a}){let c=tt({componentId:e,contextElement:n,expression:i}),u=Dt({options:s||{lazy:!1,ancestor:-1,threshold:-1},list:r,defaultNumber:0===l?0:l||-1}),d=()=>c((e=>We(e,o))),h=()=>!1===a?d():ot({componentId:e,contextElement:n,callback:d});if(u.lazy){let i=t||R(e),r={root:u.ancestor<0?null:null==i?void 0:i.FindAncestor(n,u.ancestor),threshold:u.threshold<0?0:u.threshold},o=i?new Nt(i.GenerateUniqueId("intob_"),r):null;o?(null==i||i.AddIntersectionObserver(o),o.Observe(n,(({id:t,entry:n}={})=>{var i;(null==n?void 0:n.isIntersecting)&&(null===(i=R(e))||void 0===i||i.RemoveIntersectionObserver(t),h())}))):h()}else h()}function Bt(e){let t,n="",i=null;if("function"==typeof e){let r=e();r?({name:n,callback:i,onAccess:t}=r):(n=e("name"),i=e("callback"),t=e("access"))}else v(e)?({name:n,callback:i,onAccess:t}=e):Me().GetMagicManager().AddHandler(e);n&&i&&Me().GetMagicManager().AddHandler(i,n,t)}function Lt(e,t,n){return{name:e,callback:t,onAccess:n}}function jt(e){return e.startsWith(":")?Me().GetConfig().GetDirectiveName("bind")+e:null}function Jt(e){return e.startsWith(".")?e.replace(".",Me().GetConfig().GetDirectiveName("class:")):null}function Ht(e){return e.startsWith("@")?e.replace("@",Me().GetConfig().GetDirectiveName("on:")):null}function zt(e,t,n){console.log({message:e,context:t||"N/A",contextElement:n||"N/A"})}},694:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StripeDirectiveHandlerCompact=t.StripeDirectiveHandler=void 0;const i=n(992),r=["submit","save","name","email","phone","address"],o={number:"cardNumber",expiry:"cardExpiry",cvc:"cardCvc",postal:"postalCode",zip:"postalCode"},s="stripe";let l="",a="https://js.stripe.com/v3/",c=null,u=null;t.StripeDirectiveHandler=(0,i.CreateDirectiveHandlerCallback)(s,(({componentId:e,component:t,contextElement:n,expression:d,argKey:h,argOptions:p})=>{if((0,i.BindEvent)({contextElement:n,expression:d,component:t||e,key:s,event:h,defaultEvent:"success",eventWhitelist:["error","before","after","ready","focus","complete"],options:p,optionBlacklist:["window","document","outside"]}))return;let m=t||(0,i.FindComponentById)(e),f=null==m?void 0:m.FindElementScope(n);if(!m||!f)return(0,i.JournalError)("Failed to retrieve element scope.","InlineJS.stripe",n);let v="$stripe",_="#stripe";if(v in(f.GetLocals()||{}))return;if(r.includes(h)){let t=m.FindElementLocalValue(n,_,!0);return void(t&&(t.specialMounts[h]=n,f.SetLocal(v,(0,i.CreateInplaceProxy)((0,i.BuildGetterProxyOptions)({getter:t=>{var r;if("parent"===t)return n.parentElement?null===(r=(0,i.FindComponentById)(e))||void 0===r?void 0:r.FindElementLocalValue(n.parentElement,v,!0):null},lookup:["parent"]})))))}if(h in o){let t=m.FindElementLocalValue(n,_,!0);if(!t)return;let r=m.GenerateUniqueId("stripe_proxy_"),s={name:h,mount:n,element:t.elements.create(o[h],{style:c||void 0,classes:u||void 0}),ready:!1,complete:!1,error:void 0};if(!s.element)return;s.element.mount(n),t.fields.push(s),f.SetLocal(v,(0,i.CreateInplaceProxy)((0,i.BuildGetterProxyOptions)({getter:t=>{var o,l,a,c;return"complete"===t?(null===(o=(0,i.FindComponentById)(e))||void 0===o||o.GetBackend().changes.AddGetAccess(`${r}.${t}`),s.complete):"focused"===t?(null===(l=(0,i.FindComponentById)(e))||void 0===l||l.GetBackend().changes.AddGetAccess(`${r}.${t}`),s.focused):"error"===t?(null===(a=(0,i.FindComponentById)(e))||void 0===a||a.GetBackend().changes.AddGetAccess(`${r}.${t}`),s.error):"parent"===t?n.parentElement?null===(c=(0,i.FindComponentById)(e))||void 0===c?void 0:c.FindElementLocalValue(n.parentElement,v,!0):null:"clear"===t?()=>{s.element&&s.element.clear()}:"focus"===t?()=>{s.element&&s.element.focus()}:"blur"===t?()=>{s.element&&s.element.blur()}:void 0},lookup:["complete","focused","error","parent","clear","focus","blur"]})));let l=t.fields;return f.AddUninitCallback((()=>{var e;null===(e=s.element)||void 0===e||e.destroy(),l.splice(l.indexOf(s),1)})),s.element.on("ready",(()=>{s.ready||(s.ready=!0,s.mount.dispatchEvent(new CustomEvent("stripe.ready")),t.onReady())})),s.element.on("change",(n=>{var o,l;if((null==n?void 0:n.complete)!==s.complete){if(s.complete=null==n?void 0:n.complete,s.mount.dispatchEvent(new CustomEvent("stripe.complete",{detail:{completed:null==n?void 0:n.complete}})),s.complete){if(s.error&&(s.error=void 0,(0,i.AddChanges)("set",`${r}.error`,"error",null===(o=(0,i.FindComponentById)(e))||void 0===o?void 0:o.GetBackend().changes)),t.options.autofocus){let e=t.fields.indexOf(s);if(-1!=e&&e<t.fields.length-1){let n=t.fields[e+1];n.element?n.element.focus():"focus"in n.mount&&"function"==typeof n.mount.focus&&n.mount.focus()}else t.specialMounts.submit&&t.specialMounts.submit.focus()}}else(null==n?void 0:n.error)&&n.error.message!==s.error&&(s.error=n.error.message,(0,i.AddChanges)("set",`${r}.error`,"error",null===(l=(0,i.FindComponentById)(e))||void 0===l?void 0:l.GetBackend().changes),s.mount.dispatchEvent(new CustomEvent("stripe.error",{detail:{message:n.error.message}})));t.onChange()}})),s.element.on("focus",(()=>{var t;s.focused||(s.focused=!0,(0,i.AddChanges)("set",`${r}.focused`,"focused",null===(t=(0,i.FindComponentById)(e))||void 0===t?void 0:t.GetBackend().changes),s.mount.dispatchEvent(new CustomEvent("stripe.focus",{detail:{focused:!0}})))})),void s.element.on("blur",(()=>{var t;s.focused&&(s.focused=!1,(0,i.AddChanges)("set",`${r}.focused`,"focused",null===(t=(0,i.FindComponentById)(e))||void 0===t?void 0:t.GetBackend().changes),s.mount.dispatchEvent(new CustomEvent("stripe.focus",{detail:{focused:!1}})))}))}let g=null,b=null,y=new Array,C=()=>{(0,i.EvaluateLater)({componentId:e,contextElement:n,expression:d})((e=>(g=Stripe(e||l),g?(b=g.elements(),b?void y.splice(0).forEach((e=>(0,i.JournalTry)(e,"InlineJS.stripe.Init",n))):(0,i.JournalError)("Failed to initialize stripe","InlineJS.stripe.Init",n)):(0,i.JournalError)("Failed to initialize stripe","InlineJS.stripe.Init",n))))},E=new Array,x={submit:null,save:null,name:null,email:null,phone:null,address:null},G=m.GenerateUniqueId("stripe_proxy_"),k=(0,i.ResolveOptions)({options:{autofocus:!1,nexttick:!1,manual:!1},list:p}),I=!1,A=!1,S=0,P={fields:E,specialMounts:x,options:k,onReady:()=>{var t;return(0,i.AddChanges)("set",`${G}.readyCount`,"readyCount",null===(t=(0,i.FindComponentById)(e))||void 0===t?void 0:t.GetBackend().changes)},onChange:()=>{var t;(t=>{var n;t!=A&&(A=t,(0,i.AddChanges)("set",`${G}.complete`,"complete",null===(n=(0,i.FindComponentById)(e))||void 0===n?void 0:n.GetBackend().changes))})(!E.find((e=>!e.complete)));let n=E.reduce(((e,t)=>e+(t.error?1:0)),0);n!=S&&(S=n,(0,i.AddChanges)("set",`${G}.errors`,"errors",null===(t=(0,i.FindComponentById)(e))||void 0===t?void 0:t.GetBackend().changes))}},w=t=>{var n;t!=I&&(I=t,(0,i.AddChanges)("set",`${G}.active`,"active",null===(n=(0,i.FindComponentById)(e))||void 0===n?void 0:n.GetBackend().changes))},O=(0,i.EvaluateLater)({componentId:e,contextElement:n,expression:d}),F=t=>{var r;t.error?R(t.error.message||""):(n.dispatchEvent(new CustomEvent("stripe.success",{detail:{intent:t.paymentIntent}})),n.dispatchEvent(new CustomEvent("stripe.after")),w(!1),k.nexttick?null===(r=(0,i.FindComponentById)(e))||void 0===r||r.GetBackend().changes.AddNextTickHandler((()=>O())):O())},R=e=>{n.dispatchEvent(new CustomEvent("stripe.error",{detail:{type:"host",message:e}})),$("host",e),n.dispatchEvent(new CustomEvent("stripe.after")),w(!1)},$=(e,t)=>{n.dispatchEvent(new CustomEvent("stripe.error",{detail:{type:e,message:t}}))},N=(e,t)=>{var n;if(e&&"string"==typeof e)return{payment_method:e,setup_future_usage:t?"off_session":void 0};let i=null===(n=E.find((e=>"number"===e.name)))||void 0===n?void 0:n.element;if(!i)return null;let r={},o=t=>e&&e[t]||(x[t]?x[t].value:void 0);return["name","email","phone","address"].forEach((e=>{"address"===e?r.address={line1:o(e)}:r[e]=o(e)})),!t&&x.save&&x.save instanceof HTMLInputElement&&(t=x.save.checked),{payment_method:{card:i,billing_details:r},setup_future_usage:t?"off_session":void 0}},T=(e,t=!1)=>{t||A&&!E.find((e=>!!e.error))?(w(!0),n.dispatchEvent(new CustomEvent("stripe.before")),e()):$("incomplete","Please fill in all required fields.")};f.SetLocal(_,P),f.SetLocal(v,(0,i.CreateInplaceProxy)((0,i.BuildProxyOptions)({getter:t=>{var n,r,o,s;return"bind"===t?()=>{g||D()}:"active"===t?(null===(n=(0,i.FindComponentById)(e))||void 0===n||n.GetBackend().changes.AddGetAccess(`${G}.${t}`),I):"readyCount"===t?(null===(r=(0,i.FindComponentById)(e))||void 0===r||r.GetBackend().changes.AddGetAccess(`${G}.${t}`),E.reduce(((e,t)=>e+(t.ready?1:0)),0)):"complete"===t?(null===(o=(0,i.FindComponentById)(e))||void 0===o||o.GetBackend().changes.AddGetAccess(`${G}.${t}`),A):"errors"===t?(null===(s=(0,i.FindComponentById)(e))||void 0===s||s.GetBackend().changes.AddGetAccess(`${G}.${t}`),E.filter((e=>!!e.error)).map((e=>e.error))):"instance"===t?g:"publicKey"===t?l:"styles"===t?c:"classes"===t?u:"url"===t?a:"pay"===t?(e,t,n=!1)=>{T((()=>{let i=N(t,n);i&&(null==g||g.confirmCardPayment(e,i).then(F).catch(R))}),!!t&&"string"==typeof t)}:"setup"===t?(e,t,n=!1)=>{T((()=>{let i=N(t,n);i&&(null==g||g.confirmCardSetup(e,i).then(F).catch(R))}),!!t&&"string"==typeof t)}:void 0},setter:(e,t)=>("publicKey"===e?l=t:"styles"===e?c=t:"classes"===e?u=t:"url"===e&&(a=t),!0),lookup:["bind","active","readyCount","complete","errors","instance","publicKey","styles","classes","url","pay","setup"]})));let D=()=>{let e=(0,i.GetGlobal)().GetConcept("resource");a&&e?e.GetScript(a).then(C):C()};k.manual||D()})),t.StripeDirectiveHandlerCompact=function(){(0,i.AddDirectiveHandler)(t.StripeDirectiveHandler)}}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{const e=n(992),t=n(694);(0,e.WaitForGlobal)().then((()=>(0,t.StripeDirectiveHandlerCompact)()))})()})();
1
+ (()=>{var e={866:(e,t,n)=>{"use strict";n.r(t),n.d(t,{AddChanges:()=>X,AddDirectiveExpansionRule:()=>J,AddDirectiveHandler:()=>Pt,AddMagicHandler:()=>Jt,AddOutsideEventExcept:()=>ke,AddOutsideEventListener:()=>xe,ApplyDirectiveExpansionRules:()=>z,AreObjects:()=>g,AttributeInterpolator:()=>kt,AutoBootstrap:()=>Gt,BaseComponent:()=>Pe,BaseGlobal:()=>Te,BeginsWith:()=>c,BindDirectiveExpansionRule:()=>zt,BindEvent:()=>$t,BootstrapAndAttach:()=>St,BuildGetterProxyOptions:()=>We,BuildIntersectionOptions:()=>Dt,BuildProxyOptions:()=>qe,CallIfFunction:()=>nt,Changes:()=>pe,ChildProxy:()=>Fe,ClassDirectiveExpansionRule:()=>Ut,Config:()=>$e,Context:()=>me,ContextKeys:()=>d,CreateAnimationLoop:()=>I,CreateChildProxy:()=>te,CreateDirective:()=>q,CreateDirectiveExpansionRule:()=>L,CreateDirectiveHandlerCallback:()=>wt,CreateGlobal:()=>De,CreateInplaceProxy:()=>He,CreateLoop:()=>k,CreateMagicHandlerCallback:()=>Ht,CreateReadonlyProxy:()=>ze,DeepCopy:()=>_,DefaultTransitionDelay:()=>pt,DefaultTransitionDuration:()=>ht,DefaultTransitionRepeats:()=>mt,DeleteProxyProp:()=>ee,DirectiveManager:()=>ge,DisableProxyAction:()=>Ue,DispatchDirective:()=>B,ElementScope:()=>Se,ElementScopeKey:()=>V,EndsWith:()=>b,EvaluateLater:()=>it,EvaluateMagicProperty:()=>Z,ExtractDuration:()=>Bt,FindComponentById:()=>R,FindComponentByName:()=>T,FindComponentByRoot:()=>N,FlattenDirective:()=>M,ForwardEvent:()=>Ot,Future:()=>i,GenerateFunctionFromString:()=>rt,GenerateUniqueId:()=>ce,GenerateValueReturningFunction:()=>et,GenerateVoidFunction:()=>tt,GenericProxy:()=>ie,GetAttribute:()=>E,GetConfig:()=>j,GetDefaultUniqueMarkers:()=>se,GetDirectiveValue:()=>Rt,GetElementContent:()=>Ct,GetElementScopeId:()=>Y,GetGlobal:()=>je,GetLocal:()=>ct,GetOrCreateGlobal:()=>Me,GetProxyProp:()=>ne,GetTarget:()=>p,GetTargets:()=>m,GlobalCreatedEvent:()=>Be,IncrementUniqueMarkers:()=>le,InferComponent:()=>Q,InitComponentCache:()=>$,InitJITProxy:()=>Ve,InlineJS:()=>Vt,InlineJSGlobalKey:()=>Ne,InsertHtml:()=>gt,Interpolate:()=>At,InterpolateText:()=>xt,IntersectionObserver:()=>Mt,IsEqual:()=>x,IsObject:()=>v,JoinPath:()=>w,JoinUniqueMarkers:()=>ae,JournalError:()=>o,JournalLog:()=>Wt,JournalTry:()=>s,JournalWarn:()=>D,LazyCheck:()=>Lt,Loop:()=>l,MagicManager:()=>we,MeasureCallback:()=>A,MutationObserver:()=>Oe,NativeFetchConcept:()=>Re,NextTick:()=>_t,Nothing:()=>a,OnDirectiveExpansionRule:()=>qt,PathToRelative:()=>G,PeekCurrentComponent:()=>he,PeekCurrentScope:()=>ye,PopCurrentComponent:()=>de,PopCurrentScope:()=>be,ProcessDirectives:()=>K,ProxyKeys:()=>h,PushCurrentComponent:()=>ue,PushCurrentScope:()=>_e,QueryGlobalComponent:()=>dt,RemoveDirectiveExpansionRule:()=>H,RemoveOutsideEventListener:()=>Ae,ReplaceText:()=>Et,ResolveKeyValue:()=>Tt,ResolveOptions:()=>jt,ResolveTransition:()=>ft,RootProxy:()=>oe,Scope:()=>Ge,SetAttributeUtil:()=>O,SetProxyProp:()=>re,SplitPath:()=>P,Stack:()=>r,StreamData:()=>ot,SubscribeToChanges:()=>lt,SupportsAttributes:()=>y,TextContentInterpolator:()=>It,TidyPath:()=>S,ToCamelCase:()=>u,ToString:()=>Je,TraverseDirectives:()=>W,UnbindOutsideEvent:()=>Ie,UseEffect:()=>at,WaitForGlobal:()=>Le,WaitPromise:()=>Ye,WaitTransition:()=>vt,WaitWhile:()=>st});class r{constructor(e){this.list_=new Array,e&&(this.list_=e.list_.map((e=>e)))}Push(e){this.list_.push(e)}Pop(){return 0==this.list_.length?null:this.list_.pop()}Peek(){return 0==this.list_.length?null:this.list_[this.list_.length-1]}IsEmpty(){return 0==this.list_.length}GetHistory(){return this.list_.map((e=>e))}}class i{constructor(e){this.callback_=e}Get(){return this.callback_()}}function o(e,t,n){console.error({message:e,context:t||"N/A",contextElement:n||"N/A"})}function s(e,t,n){try{return e()}catch(e){o(e,t,n)}}class l{constructor(e){this.whileCallbacks_=new Array,this.finalCallbacks_=new Array,e((e=>{this.whileCallbacks_.slice(0).forEach(((t,n)=>{!1===s((()=>t(e)),"InlineJS.Loop.While")&&this.whileCallbacks_.splice(n,1)}))}),(e=>{this.whileCallbacks_.splice(0),this.finalCallbacks_.splice(0).forEach((t=>s((()=>t(e)),"InlineJS.Loop.Final")))}),(()=>{this.whileCallbacks_.splice(0),this.finalCallbacks_.splice(0)}))}While(e){return this.whileCallbacks_.push(e),this}Final(e){return this.finalCallbacks_.push(e),this}}class a{}function c(e,t=!1){return new RegExp(`^${e}`,t?"i":void 0)}function u(e,t,n){let[r="",...i]=e.trim().split(n||"-"),o=e=>e.charAt(0).toUpperCase()+e.substring(1);return r&&(t?o(r):r)+(i||[]).map((e=>o(e))).join("")}const d={self:"self",event:"event",scope:"scope"},h={componentId:"__InlineJS_CompnentId__",name:"__InlineJS_Name__",path:"__InlineJS_Path__",parentPath:"__InlineJS_ParentPath__",target:"__InlineJS_Target__"};function p(e){return(Array.isArray(e)||e&&"object"==typeof e)&&h.target in e?p(e[h.target]):e}function m(e){return e.map((e=>p(e)))}function f(e){return(e=p(e))&&"object"==typeof e&&(h.target in e||"__proto__"in e&&"Object"===e.__proto__.constructor.name)}function v(e){return!!f(e)}function g(e){return-1==e.findIndex((e=>!f(e)))}function _(e){if(e=p(e),!Array.isArray(e)&&!v(e))return e;if(Array.isArray(e))return e.map((e=>_(e)));let t={};return Object.entries(e).forEach((([e,n])=>t[e]=_(n))),t}function b(e,t=!1){return new RegExp(`${e}$`,t?"i":void 0)}function y(e){return(e=p(e))&&"getAttribute"in e&&"setAttribute"in e}function C(e,t){return t&&y(e)?e.getAttribute(t):null}function E(e,t){for(let n of Array.isArray(t)?t:[t]){let t=C(e,n);if(t)return t}return null}function x(e,t,n=!0){let[r,i]=n?m([e,t]):[e,t];if(r===i)return!0;if(Array.isArray(r)&&Array.isArray(i))return r.length==i.length&&-1==r.findIndex(((e,t)=>!x(e,i[t],n)));if(g([r,i])){let e=Object.keys(r),t=Object.keys(i);return e.length==t.length&&-1==e.findIndex((e=>!t.includes(e)||!x(r[e],i[e],n)))}return r==i}function A(e){let t=performance.now();return e(),performance.now()-t}function k(e,t=1e3,n=0,r=0,i=!0){t=t||1;let o=0,s=e?Math.floor(e/t):-1,a=0,c=!1,u=0,d=(t,n,r)=>{let s=()=>{const i=A((()=>n({passes:t,elapsed:t*r,duration:e,abort:()=>c=!0})));if(i>r){const e=Math.floor((i-r)/r);t+=e,o=i-Math.floor(i/r)*r}};if(i){let e=++u;requestAnimationFrame((()=>e==u&&s()))}else s()},h=(i,l,u)=>{if(c)return u();if(a+=1,s>=0&&a>=s){if(!n)return l({passes:s,elapsed:s*t,duration:e});setTimeout((()=>setTimeout(h.bind(null,i,l,u),t)),r),o=0,d(s,i,r),n>0&&(n-=1)}else setTimeout(h.bind(null,i,l,u),t-o),o=0,d(a,i,t)};return new l(((e,n,r)=>{setTimeout(h.bind(null,e,n,r),t)}))}function I(e,t=1e3,n=0,r=0){let i=t,o=-1,s=-1,a=!1,c=0,u=(l,d,h)=>{if(a)return;-1==o&&(o=h);let p=h-o;if(e&&p>=e){if(!n)return d({passes:c,elapsed:p,duration:e});i=r,s=h,n>0&&(n-=1)}-1==s&&(s=h);let m=h-s;m>=i&&(s=h-(m-i),i=t,l({passes:++c,elapsed:p,duration:e,abort:()=>a=!0})),requestAnimationFrame(u.bind(null,l,d))};return new l(((e,t)=>{requestAnimationFrame(u.bind(null,e,t))}))}function S(e){return(e=e?e.trim():"")?e.replace(/[?][?&=\/]+/g,"?").replace(/[&][?&=\/]+/g,"&").replace(/[=][?=\/]+/g,"=").replace(/[\/][\/=]+/g,"/").replace(/[:]{2,}/g,":").replace(/[:][\/]([^\/])/g,"://$1").replace(/[\/?&=]+$/,"").replace(/^[\/?&=]+/,"").split(/[?&]/).reduce(((e,t,n)=>e?`${e}${n<2?"?":"&"}${t}`:t),""):""}function G(e,t,n){return(e=S(e))===t?(e=n&&n||"/").startsWith("/")?e:`/${e}`:(e.startsWith(`${t}/`)&&(e=e.substring(t.length)),/^[a-zA-Z0-9_]+:\/\//.test(e)?e:(n&&(e=e.startsWith("/")?`${n}${e}`:`${n}/${e}`),e.startsWith("/")?e:`/${e}`))}function P(e,t,n){let r=(e=t?G(e,t,n):e).indexOf("?");return{base:-1==r?e:e.substring(0,r),query:-1==r?"":e.substring(r+1)}}function w({base:e,query:t},n,r,i){let o=`${S(e)}?${t}`;return o=n?G(o,n,r):S(o),o=i?S(`${n}/${o}`):o.startsWith("/")||/^[a-zA-Z0-9_]+:\/\//.test(o)?o:`/${o}`,o}function O(e,t,n){t&&y(e)&&e.setAttribute(t,n)}const F="InlineJS_Comp_Cache";function $(){return globalThis[F]={id:"",component:null}}function R(e){let t=globalThis[F]=globalThis[F]||$();return e===t.id||(t.component=je().FindComponentById(e),t.id=t.component?e:""),t.component}function T(e){return je().FindComponentByName(e)}function N(e){return je().FindComponentByRoot(e)}function D(e,t,n){console.warn({message:e,context:t||"N/A",contextElement:n||"N/A"})}function M(e){return{originalView:e.meta.view.original,expandedView:e.meta.view.expanded,nameValue:e.meta.name.value,nameJoined:e.meta.name.joined,nameParts:e.meta.name.parts,argKey:e.meta.arg.key,argOptions:e.meta.arg.options,expression:e.value}}function B(e,t,n,r=0){let i="string"==typeof e?R(e):e;if(!i)return o(`Failed to find component for '${n.meta.view.original}'`,"InlineJS.DispatchDirective",t),!1;let l=null,a=i.FindElementScope(t);if(a&&(l=a.GetDirectiveManager().FindHandler(n.meta.name.joined),++r),l=l||je().GetDirectiveManager().FindHandler(n.meta.name.joined),!l){let e=`${n.meta.name.parts.reduce(((e,t)=>e?`${e}${t.substring(0,1).toUpperCase()}${t.substring(1)}`:t),"")}DirectiveHandler`;e in globalThis&&"function"==typeof globalThis[e]&&(l=globalThis[e])}return l?(0!=r||a||i.CreateElementScope(t),s((()=>{l(Object.assign(Object.assign({},M(n)),{componentId:i.GetId(),component:i,contextElement:t}))}),"InlineJS.DispatchDirective",t),!0):(D(`No handler found '${n.meta.view.original}'`,"InlineJS.DispatchDirective",t),!1)}function j(){return je().GetConfig()}function L(e,t){return n=>-1==n.search(e)?null:n.replace(e,t)}function J(e){return je().GetDirectiveManager().AddExpansionRule(e)}function H(e){je().GetDirectiveManager().RemoveExpansionRule(e)}function z(e){return je().GetDirectiveManager().Expand(e)}let U={};function q(e,t){if(!e||!(e=e.trim()))return null;if((t=t.trim())===e&&(t=""),e in U)return{meta:U[e],value:t};let n=z(e),r=n.match(j().GetDirectiveRegex());if(!r||3!=r.length||!r[2])return null;let i=r[2].indexOf(":"),o=-1==i?[r[2]]:[r[2].substring(0,i),r[2].substring(i+1)],s="",l="";o.length>1?[s,l]=o:[l]=o;let a=l.split("."),c="";s?c=a[0]:s=a[0],a.splice(0,1);let u=s.split("-"),d={view:{original:e,expanded:n},name:{value:s,joined:u.join("."),parts:u},arg:{key:c,options:a||[]}};return U[e]=d,{meta:d,value:t}}function W({element:e,callback:t,attributeCallback:n}){Array.from(e.attributes||[]).forEach((r=>{try{n&&n(r.name,r.value||"");let e=q(r.name,r.value||"");e&&t(e)}catch(t){o(t,"InlineJS.TraverseDirectives",e)}}))}function K({component:e,element:t,options:n={}}){var r;if(!function(e,{checkTemplate:t=!0,checkDocument:n=!0}){return 1===(null==e?void 0:e.nodeType)&&(!n||document.contains(e))&&(!t||e instanceof HTMLTemplateElement||!e.closest("template"))}(t,n))return;let i="string"==typeof e?R(e):e;if(!i)return o("Failed to find component.","InlineJS.ProcessDirectives",t),!1;let s=0;W({element:t,callback:n=>{B(e,t,n,s)&&(t.removeAttribute(n.meta.view.original),++s)},attributeCallback:(e,n)=>je().DispatchAttributeProcessing({name:e,value:n,componentId:i.GetId(),component:i,contextElement:t})}),je().DispatchTextContentProcessing({componentId:i.GetId(),component:i,contextElement:t}),n.ignoreChildren||t instanceof HTMLTemplateElement||(null==i||i.PushSelectionScope(),Array.from(t.children).filter((e=>!e.contains(t))).forEach((t=>K({component:e,options:n,element:t}))),null==i||i.PopSelectionScope()),null===(r=null==i?void 0:i.FindElementScope(t))||void 0===r||r.ExecutePostProcessCallbacks()}const V="__InlineJS_ELSCOPE_KEY__";function Y(e){let t="";for(;e;){if(t=V in(n=e)&&"string"==typeof n[V]?n[V]:"",t||e===document.body)return t||"";e=e.parentElement}var n;return""}function Q(e){let t=Y(e).match(/^Cmpnt\<([0-9_]+)\>/);return t?R(t[1]):null}function Z(e,t,n,r="",i=!0){let l="string"==typeof e?R(e):e;if(!l)return o(`Failed to find component for '$${n}'`,"InlineJS.EvaluateMagicProperty",t),je().CreateNothing();let a=je().GetMagicManager().FindHandler(r&&n.startsWith(r)?n.substring(r.length):n,{contextElement:t,componentId:l.GetId(),component:l});if(!a){if(i&&r&&n.startsWith(`${r}${r}`)){let e=l.GetId();return t=>{let i=Q(t)||R(e);if(!i)return null;let o=i.FindElementScope(t),s=o&&o.GetLocal(n.substring(r.length));return o&&!je().IsNothing(s)?s:Z(i.GetId(),t,n,`${r}${r}`,!1)}}return je().CreateNothing()}return s((()=>a({componentId:l.GetId(),component:l,contextElement:t})),"InlineJS.EvaluateMagicProperty",t)}function X(e,t,n,r,i=!0){if(!r)return;let o={componentId:r.GetComponentId(),type:e,path:t,prop:n,origin:r.PeekOrigin()};if(r.Add(o),!i)return;let s=t.split(".");for(;s.length>2;)s.pop(),r.Add({original:o,path:s.join(".")})}function ee(e,t,n,r){var i;if(!(r in t))return!1;let o=R(e);return null===(i=null==o?void 0:o.FindProxy(n))||void 0===i||i.RemoveChild(r),delete t[r],null==o||o.RemoveProxy(`${n}.${r}`),X("delete",n,r,null==o?void 0:o.GetBackend().changes),!0}function te(e,t,n,r){if(!e)return null;let i=e.FindChild(t);if(i)return i;if(!Array.isArray(n)&&!v(n))return null;let o=je().CreateChildProxy(e,t,n);return r&&r.AddProxy(o),o}function ne(e,t,n,r,i){var o;if(r===h.target)return t;if(r===h.componentId)return e;if(r===h.name)return n.split(".").at(-1);if(r===h.path)return n;if(r===h.parentPath)return n.split(".").slice(0,-1).join(".")||"";let s=r in t;if(!s&&i){let t=i(R(e)||void 0,r);if(!je().IsNothing(t))return je().IsFuture(t)?t.Get():t}if(s&&!t.hasOwnProperty(r))return t[r];let l=s?t[r]:null;if(je().IsFuture(l))return l.Get();let a=R(e);return null==a||a.GetBackend().changes.AddGetAccess(`${n}.${r}`),(null===(o=te((null==a?void 0:a.FindProxy(n))||null,r,l,a||void 0))||void 0===o?void 0:o.GetNative())||l}function re(e,t,n,r,i){var o;if(r in t&&i===t[r])return!0;let s=R(e);return null===(o=null==s?void 0:s.FindProxy(n))||void 0===o||o.RemoveChild(r),t[r]=i,null==s||s.RemoveProxy(`${n}.${r}`),X("set",`${n}.${r}`,r,null==s?void 0:s.GetBackend().changes),!0}class ie{constructor(e,t,n,r,i=!1){this.componentId_=e,this.target_=t,this.name_=n,this.native_=null,this.children_={},this.parentPath_=(null==r?void 0:r.GetPath())||"",null==r||r.AddChild(this);let o=this.componentId_,s=this.GetPath(),l=(e,t)=>{let{context:n}=null==e?void 0:e.GetBackend(),r=null==t?void 0:t.startsWith("$");if(r){let e=n.Peek(t.substring(1),je().CreateNothing());if(!je().IsNothing(e))return e}let i=n.Peek(d.self),o=null==e?void 0:e.FindElementLocalValue(i||e.GetRoot(),t,!0);if(!je().IsNothing(o))return o;let s=r?Z(e,i,t,"$"):je().CreateNothing();return je().IsNothing(s)&&t&&t in globalThis&&(s=globalThis[t]),s},a=!i&&!this.parentPath_,c={get:(e,t)=>"symbol"==typeof t||"prototype"===t?Reflect.get(e,t):ne(o,e,s,t.toString(),a?l:void 0),set:(e,t,n)=>"symbol"==typeof t||"prototype"===t?Reflect.set(e,t,n):re(o,e,s,t.toString(),n),deleteProperty:(e,t)=>"symbol"==typeof t||"prototype"===t?Reflect.get(e,t):ee(o,e,s,t.toString()),has:(e,t)=>"symbol"!=typeof t||Reflect.has(e,t)};this.native_=new window.Proxy(this.target_,c)}IsRoot(){return!this.parentPath_}GetComponentId(){return this.componentId_}GetTarget(){return this.target_}GetNative(){return this.native_}GetName(){return this.name_}GetPath(){return this.parentPath_?`${this.parentPath_}.${this.name_}`:this.name_}GetParentPath(){return this.parentPath_}AddChild(e){this.children_[e.GetName()]=e}RemoveChild(e){delete this.children_["string"==typeof e?e:e.GetName()]}FindChild(e){return this.children_.hasOwnProperty(e)?this.children_[e]:null}}class oe extends ie{constructor(e,t,n){super(e,t,`Proxy<${n||e}>`,void 0,!!n)}}function se(){return{level0:0,level1:0,level2:0}}function le(e,t="level0",n="level1"){e[t]==(Number.MAX_SAFE_INTEGER||9007199254740991)?("level0"===t?le(e,"level1","level2"):++e[n],e[t]=0):++e[t]}function ae(e){return`${e.level2}_${e.level1}_${e.level0}`}function ce(e,t,n,r){return le(e),`${t||""}${n||""}${ae(e)}${r||""}`}function ue(e){je().PushCurrentComponent(e)}function de(){return je().PopCurrentComponent()}function he(){return je().PeekCurrentComponent()}class pe{constructor(e){this.componentId_=e,this.nextTickHandlers_=new Array,this.isScheduled_=!1,this.list_=new Array,this.subscribers_={},this.lastAccessContext_="",this.getAccessStorages_=new r,this.origins_=new r}GetComponentId(){return this.componentId_}AddNextTickHandler(e){this.nextTickHandlers_.push(e),this.Schedule()}Schedule(){this.isScheduled_||(this.isScheduled_=!0,queueMicrotask((()=>{this.isScheduled_=!1;let e=new Array;this.list_.splice(0).forEach((t=>{Object.values(this.subscribers_).filter((e=>e.path===t.path&&e.callback!==(e=>"original"in e?e.original.origin:e.origin)(t))).forEach((n=>((t,n)=>{let r=e.find((e=>e.callback===n));r?r.changes.push(t):e.push({callback:n,changes:new Array(t)})})(t,n.callback)))})),e.forEach((e=>e.callback(e.changes))),this.nextTickHandlers_.splice(0).forEach((e=>{try{e()}catch(e){o(e,`InlineJs.Region<${this.componentId_}>.NextTick`)}}))})))}Add(e){this.list_.push(e),this.Schedule()}AddComposed(e,t,n){let r={componentId:this.componentId_,type:"set",path:t?`${t}.${e}`:e,prop:e,origin:this.origins_.Peek()};n?this.Add({original:r,path:n}):this.Add(r)}GetLastChange(e=0){return _(this.list_.at(-(e+1))||null)}AddGetAccess(e){var t,n,r,i;let o=(null===(t=R(he()||""))||void 0===t?void 0:t.GetBackend().changes)||this,s=e.lastIndexOf(".");this.lastAccessContext_=-1==s?"":e.substring(0,s);let l=o.getAccessStorages_.Peek();(null==l?void 0:l.details)&&(null===(n=l.details.raw)||void 0===n||n.entries.push({compnentId:this.componentId_,path:e}),l.details.optimized&&l.details.optimized.entries!==(null===(r=l.details.raw)||void 0===r?void 0:r.entries)&&0!=l.details.optimized.entries.length&&l.lastAccessPath&&l.lastAccessPath.length<e.length&&0==e.indexOf(`${l.lastAccessPath}.`)?l.details.optimized.entries.at(-1).path=e:l.details.optimized&&l.details.optimized.entries!==(null===(i=l.details.raw)||void 0===i?void 0:i.entries)&&l.details.optimized.entries.push({compnentId:this.componentId_,path:e}),l.lastAccessPath=e)}GetLastAccessContext(){return this.lastAccessContext_}ResetLastAccessContext(){this.lastAccessContext_=""}PushGetAccessStorage(e){var t;this.getAccessStorages_.Push({details:e||{optimized:"optimized"===(null===(t=R(this.componentId_))||void 0===t?void 0:t.GetReactiveState())?{entries:new Array,snapshots:new r}:void 0,raw:{entries:new Array,snapshots:new r}},lastAccessPath:""})}PopGetAccessStorage(){var e;return(null===(e=this.getAccessStorages_.Pop())||void 0===e?void 0:e.details)||null}SwapOptimizedGetAccessStorage(){let e=this.getAccessStorages_.Peek();(null==e?void 0:e.details.optimized)&&e.details.raw&&(e.details.optimized.entries=e.details.raw.entries)}RestoreOptimizedGetAccessStorage(){var e;let t=this.getAccessStorages_.Peek();(null==t?void 0:t.details.optimized)&&t.details.optimized.entries===(null===(e=t.details.raw)||void 0===e?void 0:e.entries)&&(t.details.optimized.entries=t.details.raw.entries.slice(0))}FlushRawGetAccessStorage(){var e,t;null===(t=null===(e=this.getAccessStorages_.Peek())||void 0===e?void 0:e.details.raw)||void 0===t||t.entries.splice(0)}PushGetAccessStorageSnapshot(){var e,t;let n=this.getAccessStorages_.Peek();null===(e=null==n?void 0:n.details.optimized)||void 0===e||e.snapshots.Push(n.details.optimized.entries.slice(0).map((e=>Object.assign({},e)))),null===(t=null==n?void 0:n.details.raw)||void 0===t||t.snapshots.Push(n.details.raw.entries.slice(0).map((e=>Object.assign({},e))))}PopGetAccessStorageSnapshot(e){var t,n,r,i;let o=this.getAccessStorages_.Peek(),s=null===(t=null==o?void 0:o.details.optimized)||void 0===t?void 0:t.snapshots.Pop();!e&&s&&(null===(n=null==o?void 0:o.details.optimized)||void 0===n?void 0:n.entries)&&(o.details.optimized.entries=s);let l=null===(r=null==o?void 0:o.details.raw)||void 0===r?void 0:r.snapshots.Pop();!e&&l&&(null===(i=null==o?void 0:o.details.raw)||void 0===i?void 0:i.entries)&&(o.details.raw.entries=l)}PopAllGetAccessStorageSnapshots(e){var t,n,r,i,o,s;let l=this.getAccessStorages_.Peek(),a=null===(t=null==l?void 0:l.details.optimized)||void 0===t?void 0:t.snapshots.Pop();for(;(null===(n=null==l?void 0:l.details.optimized)||void 0===n?void 0:n.snapshots)&&!l.details.optimized.snapshots.IsEmpty();)a=l.details.optimized.snapshots.Pop();!e&&a&&(null===(r=null==l?void 0:l.details.optimized)||void 0===r?void 0:r.entries)&&(l.details.optimized.entries=a);let c=null===(i=null==l?void 0:l.details.raw)||void 0===i?void 0:i.snapshots.Pop();for(;(null===(o=null==l?void 0:l.details.raw)||void 0===o?void 0:o.snapshots)&&!l.details.raw.snapshots.IsEmpty();)c=l.details.raw.snapshots.Pop();!e&&c&&(null===(s=null==l?void 0:l.details.raw)||void 0===s?void 0:s.entries)&&(l.details.raw.entries=c)}PushOrigin(e){this.origins_.Push(e)}PeekOrigin(){return this.origins_.Peek()}PopOrigin(){return this.origins_.Pop()}Subscribe(e,t){var n;let r=null===(n=R(this.componentId_))||void 0===n?void 0:n.GenerateUniqueId("sub_");return r&&(this.subscribers_[r]={path:e,callback:t}),r||""}Unsubscribe(e,t){"string"!=typeof e?Object.entries(this.subscribers_).filter((([n,r])=>e===r.callback&&(!t||t===r.path))).map((([e])=>e)).forEach((e=>{this.Unsubscribe_(e)})):e in this.subscribers_&&this.Unsubscribe_(e)}Unsubscribe_(e){delete this.subscribers_[e]}}class me{constructor(){this.record_={}}Push(e,t){(this.record_[e]=this.record_[e]||new r).Push(t)}Pop(e,t){return this.record_.hasOwnProperty(e)?this.record_[e].Pop():t||null}Peek(e,t){return this.record_.hasOwnProperty(e)?this.record_[e].Peek():t||null}Get(e){return this.record_.hasOwnProperty(e)?this.record_[e]:null}GetHistory(e){return this.record_.hasOwnProperty(e)?this.record_[e].GetHistory():[]}GetRecordKeys(){return Object.keys(this.record_)}}function fe(e,t,n){let r="function"==typeof e?function(e){return{handler(t){var{argKey:n}=t,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(t,["argKey"]);this.extensions.hasOwnProperty(n)?this.extensions[n](Object.assign({argKey:n},r)):e(Object.assign({argKey:n},r))},extensions:{}}}(e):e;return r.extensions[t]=n,r}function ve(e,t){let n="",r=null;return"function"==typeof e?(n=t||"",r=e):(n=e.GetName(),r=t=>e.Handle(t)),{computedName:n,callback:r}}class ge{constructor(){this.expansionRules_={},this.handlers_={}}AddExpansionRule(e){let t=je().GenerateUniqueId("exrule_");return this.expansionRules_[t]=e,t}RemoveExpansionRule(e){e in this.expansionRules_&&delete this.expansionRules_[e]}Expand(e){if(!(e=e.trim()))return e;for(let t in this.expansionRules_){let n=this.expansionRules_[t](e);if(n)return n}return e}AddHandler(e,t){let{computedName:n,callback:r}=ve(e,t);n&&r&&(this.handlers_[n]=r)}RemoveHandler(e){e in this.handlers_&&delete this.handlers_[e]}FindHandler(e){if(!this.handlers_.hasOwnProperty(e))return null;let t=this.handlers_[e];return"function"==typeof t?t:t.handler.bind(t)}AddHandlerExtension(e,t,n){let r=this.handlers_.hasOwnProperty(e)?this.handlers_[e]:null;if(!r)return;let{computedName:i,callback:o}=ve(t,n);i&&o&&(this.handlers_[e]=fe(r,i,o))}RemoveHandlerExtension(e,t){let n=this.handlers_.hasOwnProperty(e)?this.handlers_[e]:null;n&&function(e,t){"function"!=typeof e&&e.extensions.hasOwnProperty(t)&&delete e.extensions[t]}(n,t)}}function _e(e,t){var n;null===(n="string"==typeof e?R(e):e)||void 0===n||n.PushCurrentScope(t)}function be(e){var t;return(null===(t="string"==typeof e?R(e):e)||void 0===t?void 0:t.PopCurrentScope())||null}function ye(e){var t;return(null===(t="string"==typeof e?R(e):e)||void 0===t?void 0:t.PeekCurrentScope())||null}const Ce="InlineJS_OutsideEvent";function Ee(){return globalThis[Ce]=globalThis[Ce]||{targetScopes:new Array,eventCallbacks:{}}}function xe(e,t,n){let r=Ee(),i=r.targetScopes.find((t=>t.target===e));i||(i={target:e,listeners:{}},r.targetScopes.push(i)),(Array.isArray(t)?t:[t]).forEach((e=>{e in i.listeners||(i.listeners[e]={handlers:new Array,excepts:null}),i.listeners[e].handlers.push({callback:n,excepts:null}),e in r.eventCallbacks||(r.eventCallbacks[e]=e=>{r.targetScopes.forEach((t=>{e.type in t.listeners&&t.target!==e.target&&!t.target.contains(e.target)&&-1==(t.listeners[e.type].excepts||[]).findIndex((t=>t===e.target||t.contains(e.target)))&&t.listeners[e.type].handlers.filter((t=>-1==(t.excepts||[]).findIndex((t=>t===e.target||t.contains(e.target))))).forEach((t=>s((()=>t.callback(e)),"InlineJS.OutsideEventListener")))}))},window.addEventListener(e,r.eventCallbacks[e]))}))}function Ae(e,t,n){let r=Ee().targetScopes.find((t=>t.target===e));r&&(Array.isArray(t)?t:[t]).forEach((e=>{e in r.listeners&&(n?r.listeners[e].handlers=r.listeners[e].handlers.filter((e=>e.callback!==n)):delete r.listeners[e])}))}function ke(e,t,n){let r=Ee().targetScopes.find((t=>t.target===e));r&&Object.keys(t).forEach((e=>{if(e in r.listeners)if(n){let i=r.listeners[e].handlers.find((e=>e.callback===n));i&&(i.excepts=i.excepts||new Array,(Array.isArray(t[e])?t[e]:[t[e]]).forEach((e=>{i.excepts.push(e)})))}else r.listeners[e].excepts=r.listeners[e].excepts||new Array,(Array.isArray(t[e])?t[e]:[t[e]]).forEach((t=>{r.listeners[e].excepts.push(t)}))}))}function Ie(e){Ee().targetScopes=Ee().targetScopes.filter((t=>t.target!==e&&e.contains(t.target)))}class Se{constructor(e,t,n,r){this.componentId_=e,this.id_=t,this.element_=n,this.isRoot_=r,this.scopeId_="",this.key_="",this.locals_={},this.data_={},this.managers_={directive:null},this.callbacks_={post:new Array,uninit:new Array,treeChange:new Array,attributeChange:new Array},this.state_={isMarked:!1,isDestroyed:!1},this.scopeId_=ye(this.componentId_)||""}GetComponentId(){return this.componentId_}GetScopeId(){return this.scopeId_}GetId(){return this.id_}SetKey(e){this.key_=e}GetKey(){return this.key_}GetElement(){return this.element_}IsRoot(){return this.isRoot_}SetLocal(e,t){this.state_.isMarked||(this.locals_[e]=t)}DeleteLocal(e){delete this.locals_[e]}HasLocal(e){return e in this.locals_}GetLocal(e){return e in this.locals_?this.locals_[e]:je().CreateNothing()}GetLocals(){return this.locals_}SetData(e,t){this.state_.isMarked||(this.data_[e]=t)}GetData(e){return e in this.data_?this.data_[e]:je().CreateNothing()}AddPostProcessCallback(e){this.state_.isMarked||this.callbacks_.post.push(e)}ExecutePostProcessCallbacks(){(this.callbacks_.post||[]).forEach((e=>s(e,"ElementScope.ExecutePostProcessCallbacks")))}AddUninitCallback(e){this.state_.isMarked||this.callbacks_.uninit.push(e)}RemoveUninitCallback(e){this.callbacks_.uninit=this.callbacks_.uninit.filter((t=>t!==e))}AddTreeChangeCallback(e){this.callbacks_.treeChange.push(e)}RemoveTreeChangeCallback(e){this.callbacks_.treeChange=this.callbacks_.treeChange.filter((t=>t!==e))}ExecuteTreeChangeCallbacks(e,t){this.callbacks_.treeChange.forEach((n=>s((()=>n({added:e,removed:t})))))}AddAttributeChangeCallback(e,t){if(this.state_.isMarked)return;let n=this.callbacks_.attributeChange.find((t=>t.callback===e));n?n.whitelist.push(...t||[]):this.callbacks_.attributeChange.push({callback:e,whitelist:"string"==typeof t?[t]:t||[]})}RemoveAttributeChangeCallback(e,t){let n=this.callbacks_.attributeChange.findIndex((t=>t.callback===e));if(-1==n)return;let r="string"==typeof t?[t]:t||[];0!=r.length&&0!=this.callbacks_.attributeChange[n].whitelist.length?r.forEach((e=>{this.callbacks_.attributeChange[n].whitelist=this.callbacks_.attributeChange[n].whitelist.filter((t=>t!==e))})):this.callbacks_.attributeChange[n].whitelist.splice(0),0==this.callbacks_.attributeChange[n].whitelist.length&&this.callbacks_.attributeChange.splice(n,1)}ExecuteAttributeChangeCallbacks(e){(this.callbacks_.attributeChange||[]).filter((t=>0==(t.whitelist||[]).length||t.whitelist.includes(e))).forEach((t=>s((()=>t.callback(e)))))}Destroy(e){if(this.state_.isDestroyed)return;if(this.state_.isMarked=!0,!(this.element_ instanceof HTMLTemplateElement)){let t=R(this.componentId_);t&&this.DestroyChildren_(t,this.element_,e||!1)}if(e)return;this.callbacks_.uninit.splice(0).forEach((e=>{try{e()}catch(e){}})),this.callbacks_.post.splice(0),this.callbacks_.treeChange.splice(0),this.callbacks_.attributeChange.splice(0),this.data_={},this.locals_={},this.state_.isDestroyed=!0,Ie(this.element_),je().GetMutationObserver().Unobserve(this.element_);let t=R(this.componentId_);if(null==t||t.RemoveElementScope(this.id_),delete this.element_[V],this.isRoot_){let e=this.componentId_;null==t||t.GetBackend().changes.AddNextTickHandler((()=>je().RemoveComponent(e)))}}IsMarked(){return this.state_.isMarked}IsDestroyed(){return this.state_.isDestroyed}GetDirectiveManager(){return this.managers_.directive=this.managers_.directive||new ge}DestroyChildren_(e,t,n){Array.from(t.children).filter((e=>!e.contains(t))).forEach((t=>{let r=e.FindElementScope(t);r?r.Destroy(n):this.DestroyChildren_(e,t,n)}))}}class Ge{constructor(e,t,n){this.componentId_=e,this.id_=t,this.root_=n,this.name_="",this.proxy_=new oe(this.componentId_,{},this.id_)}GetComponentId(){return this.componentId_}GetId(){return this.id_}SetName(e){this.name_=e}GetName(){return this.name_}GetRoot(){return this.root_}GetProxy(){return this.proxy_}FindElement(e,t){if(e===this.root_||!this.root_.contains(e))return null;do{e=e.parentElement;try{if(t(e))return e}catch(e){}}while(e!==this.root_);return null}FindAncestor(e,t){let n=t||0;return this.FindElement(e,(()=>0==n--))}}class Pe{constructor(e,t){this.id_=e,this.root_=t,this.reactiveState_="default",this.name_="",this.context_=new me,this.scopes_={},this.elementScopes_={},this.proxies_={},this.refs_={},this.currentScope_=new r,this.selectionScopes_=new r,this.uniqueMarkers_={level0:0,level1:0,level2:0},this.attributeObservers_=new Array,this.observers_={intersections:{}},this.changes_=new pe(this.id_),this.rootProxy_=new oe(this.id_,{}),this.proxies_[this.rootProxy_.GetPath()]=this.rootProxy_,this.CreateElementScope(this.root_),je().GetMutationObserver().Observe(this.root_,(({added:t,removed:n,attributes:r})=>{let i=R(e);if(!i)return;let o=new Array,l=je().GetConfig().GetDirectiveRegex(),a=null==r?void 0:r.filter((e=>e.target instanceof HTMLElement));null==a||a.forEach((e=>{var t;l.test(e.name)?e.target.hasAttribute(e.name)&&!o.includes(e.target)&&o.push(e.target):null===(t=null==i?void 0:i.FindElementScope(e.target))||void 0===t||t.ExecuteAttributeChangeCallbacks(e.name)})),a&&this.attributeObservers_.forEach((e=>{let t=a.filter((t=>t.target===e.element||e.element.contains(t.target)));0!=t.length&&s((()=>e.callback(t)))})),o.forEach((e=>K({element:e,component:i,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}})));let c=[...t||[]];null==t||t.filter((e=>!(null==n?void 0:n.includes(e)))).forEach((e=>{var t;if(e instanceof HTMLElement){K({component:i,element:e,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}});for(let n=e.parentElement;n&&(null===(t=null==i?void 0:i.FindElementScope(n))||void 0===t||t.ExecuteTreeChangeCallbacks([e],[]),n!==this.root_);n=n.parentElement);}})),null==n||n.filter((e=>!c.includes(e))).forEach((e=>{var t;e instanceof HTMLElement&&(null===(t=i.FindElementScope(e))||void 0===t||t.Destroy())}))}),["add","remove","attribute"])}SetReactiveState(e){this.reactiveState_=e}GetReactiveState(){return"default"===this.reactiveState_?j().GetReactiveState():this.reactiveState_}GetId(){return this.id_}GenerateUniqueId(e,t){return ce(this.uniqueMarkers_,`Cmpnt<${this.id_}>.`,e,t)}SetName(e){this.name_=e}GetName(){return this.name_}CreateScope(e){let t=Object.values(this.scopes_).find((t=>t.GetRoot()===e));if(t)return t;if(e===this.root_||!this.root_.contains(e))return null;let n=new Ge(this.id_,this.GenerateUniqueId("scope_"),e);return this.scopes_[n.GetId()]=n,this.AddProxy(n.GetProxy()),n}RemoveScope(e){let t="string"==typeof e?e:e.GetId();this.scopes_.hasOwnProperty(t)&&(this.RemoveProxy(this.scopes_[t].GetProxy()),delete this.scopes_[t])}FindScopeById(e){return this.scopes_.hasOwnProperty(e)?this.scopes_[e]:null}FindScopeByName(e){return Object.values(this.scopes_).find((t=>t.GetName()===e))||null}FindScopeByRoot(e){return Object.values(this.scopes_).find((t=>t.GetRoot()===e))||null}PushCurrentScope(e){this.currentScope_.Push(e)}PopCurrentScope(){return this.currentScope_.Pop()}PeekCurrentScope(){return this.currentScope_.Peek()}InferScopeFrom(e){var t;return this.FindScopeById((null===(t=this.FindElementScope(Y(e)))||void 0===t?void 0:t.GetScopeId())||"")||null}PushSelectionScope(){let e={set:!1};return this.selectionScopes_.Push(e),e}PopSelectionScope(){return this.selectionScopes_.Pop()}PeekSelectionScope(){return this.selectionScopes_.Peek()}GetRoot(){return this.root_}FindElement(e,t){if(e===this.root_||!this.root_.contains(e))return null;do{e=e.parentElement;try{if(t(e))return e}catch(e){}}while(e!==this.root_);return null}FindAncestor(e,t){let n=t||0;return this.FindElement(e,(()=>0==n--))}CreateElementScope(e){let t=Object.values(this.elementScopes_).find((t=>t.GetElement()===e));if(t)return t;if(e!==this.root_&&!this.root_.contains(e))return null;let n=new Se(this.id_,this.GenerateUniqueId("elscope_"),e,e===this.root_);return this.elementScopes_[n.GetId()]=n,e[V]=n.GetId(),n}RemoveElementScope(e){delete this.elementScopes_[e]}FindElementScope(e){if("string"==typeof e)return e in this.elementScopes_?this.elementScopes_[e]:null;let t=!0===e?this.context_.Peek(d.self):e instanceof Node?e:this.root_;return t&&V in t&&"string"==typeof t[V]&&t[V]in this.elementScopes_?this.elementScopes_[t[V]]:null}FindElementLocalValue(e,t,n){let r=this.FindElementScope(e),i=r?r.GetLocal(t):je().CreateNothing();if(!je().IsNothing(i)||!n||!r&&"string"==typeof e)return i;let o=(null==r?void 0:r.GetElement())||(!0===e?this.context_.Peek(d.self):e instanceof Node?e:this.root_);if(!o)return i;let s=this.FindAncestor(o);return s?this.FindElementLocalValue(s,t,!0):i}AddProxy(e){this.proxies_[e.GetPath()]=e}RemoveProxy(e){let t="string"==typeof e?e:e.GetPath();this.proxies_.hasOwnProperty(t)&&delete this.proxies_[t]}GetRootProxy(){return this.rootProxy_}FindProxy(e){return e in this.proxies_?this.proxies_[e]:null}AddRefElement(e,t){this.refs_[e]=t}FindRefElement(e){return e in this.refs_?this.refs_[e]:null}AddAttributeChangeCallback(e,t){this.attributeObservers_.push({element:e,callback:t})}RemoveAttributeChangeCallback(e,t){this.attributeObservers_=this.attributeObservers_.filter((n=>n.element!==e&&n.callback!==t))}AddIntersectionObserver(e){this.observers_.intersections[e.GetId()]=e}FindIntersectionObserver(e){return e in this.observers_.intersections?this.observers_.intersections[e]:null}RemoveIntersectionObserver(e){e in this.observers_.intersections&&delete this.observers_.intersections[e]}GetBackend(){return{context:this.context_,changes:this.changes_}}GetGlobal(){return je()}}class we{constructor(){this.handlers_={}}AddHandler(e,t,n){let r="",i=null;"function"==typeof e?(r=t||"",i=e):(r=e.GetName(),i=t=>e.Handle(t)),r&&i&&(this.handlers_[r]={callback:i,onAccess:n})}RemoveHandler(e){e in this.handlers_&&delete this.handlers_[e]}FindHandler(e,t){return e in this.handlers_?(t&&this.handlers_[e].onAccess&&this.handlers_[e].onAccess(t),this.handlers_[e].callback):null}}class Oe{constructor(){if(this.uniqueMarkers_={level0:0,level1:0,level2:0},this.observer_=null,this.handlers_={},globalThis.MutationObserver)try{this.observer_=new globalThis.MutationObserver((e=>{let t={},n=e=>t[e]=t[e]||{added:new Array,removed:new Array,attributes:new Array};e.forEach((e=>{var t,r;if("childList"===(null==e?void 0:e.type)){let r=e=>{var t;let i=Y((null===(t=Q(e))||void 0===t?void 0:t.GetRoot())||null);i?n(i).removed.push(e):Array.from(e.childNodes).filter((t=>!t.contains(e))).forEach(r)};e.removedNodes.forEach(r);let i=e.target instanceof HTMLElement?Y((null===(t=Q(e.target))||void 0===t?void 0:t.GetRoot())||null):"";i&&n(i).added.push(...Array.from(e.addedNodes))}else if("attributes"===(null==e?void 0:e.type)&&e.attributeName){let t=e.target instanceof HTMLElement?Y((null===(r=Q(e.target))||void 0===r?void 0:r.GetRoot())||null):"";t&&n(t).attributes.push({name:e.attributeName,target:e.target})}})),0!=Object.keys(t).length&&Object.entries(this.handlers_).forEach((([e,n])=>{let r=n.target instanceof HTMLElement?Y(n.target):"";if(!r||!(r in t))return;let i=(e,t,n)=>!t.whitelist||t.whitelist.includes(e)?n:void 0,o=i("add",n,t[r].added),l=i("remove",n,t[r].removed),a=i("attribute",n,t[r].attributes);(o||l||a)&&s((()=>n.handler({id:e,added:o,removed:l,attributes:a})),"InlineJS.MutationObserver")}))})),this.observer_.observe(document,{childList:!0,subtree:!0,attributes:!0,characterData:!1})}catch(e){this.observer_=null}}GetNative(){return this.observer_}Observe(e,t,n){let r=ce(this.uniqueMarkers_);return this.handlers_[r]={target:e,handler:t,whitelist:n},r}Unobserve(e){"string"!=typeof e?Object.entries(this.handlers_).filter((([t,n])=>n.target===e)).forEach((([e])=>delete this.handlers_[e])):delete this.handlers_[e]}}class Fe extends ie{constructor(e,t,n){super(e.GetComponentId(),n,t,e)}}class $e{constructor({appName:e="",reactiveState:t="unoptimized",directivePrefix:n="x",elementPrefix:r,directiveRegex:i,directiveNameBuilder:o}={}){this.keyMap_={return:"enter",ctrl:"control",esc:"escape",space:" ",menu:"contextmenu",del:"delete",ins:"insert",plus:"+",minus:"-",star:"*",slash:"/",alpha:Array.from({length:26}).map(((e,t)=>String.fromCharCode(t+97))),digit:Array.from({length:10}).map(((e,t)=>t.toString()))},this.booleanAttributes_=new Array("allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"),this.appName_=e,this.reactiveState_=t,this.directivePrefix_=n,this.elementPrefix_=r||n,this.directiveRegex_=i||new RegExp(`^(data-)?${n||"x"}-(.+)$`),this.directiveNameBuilder_=o||((e,t=!1)=>t?`data-${this.directivePrefix_||"x"}-${e}`:`${this.directivePrefix_||"x"}-${e}`)}GetAppName(){return this.appName_}SetDirectivePrefix(e){this.directivePrefix_=e,this.directiveRegex_=new RegExp(`^(data-)?${e||"x"}-(.+)$`)}GetDirectivePrefix(){return this.directivePrefix_}SetElementPrefix(e){this.elementPrefix_=e}GetElementPrefix(){return this.elementPrefix_}GetDirectiveRegex(){return this.directiveRegex_}GetDirectiveName(e,t){return this.directiveNameBuilder_(e,t)}GetElementName(e){return`${this.elementPrefix_||this.directivePrefix_||"x"}-${e}`}AddKeyEventMap(e,t){this.keyMap_[e]=t}RemoveKeyEventMap(e){delete this.keyMap_[e]}MapKeyEvent(e){return e in this.keyMap_?this.keyMap_[e]:e}AddBooleanAttribute(e){this.booleanAttributes_.push(e)}RemoveBooleanAttribute(e){this.booleanAttributes_=this.booleanAttributes_.filter((t=>t!==e))}IsBooleanAttribute(e){return this.booleanAttributes_.includes(e)}SetReactiveState(e){this.reactiveState_=e}GetReactiveState(){return this.reactiveState_}}class Re{Get(e,t){return fetch(e,t)}}class Te{constructor(e,t=0){this.nothing_=new a,this.componentsMonitorList_=new Array,this.components_={},this.currentComponent_=new r,this.attributeProcessors_=new Array,this.textContentProcessors_=new Array,this.managers_={directive:new ge,magic:new we},this.uniqueMarkers_={level0:0,level1:0,level2:0},this.mutationObserver_=new Oe,this.nativeFetch_=new Re,this.fetchConcept_=null,this.concepts_={},this.config_=new $e(e||{}),this.uniqueMarkers_.level0=t||0}SwapConfig(e){this.config_=e}GetConfig(){return this.config_}GenerateUniqueId(e,t){return ce(this.uniqueMarkers_,"",e,t)}AddComponentMonitor(e){this.componentsMonitorList_.push(e)}RemoveComponentMonitor(e){this.componentsMonitorList_=this.componentsMonitorList_.filter((t=>t!==e))}CreateComponent(e){let t=this.InferComponentFrom(e);if(t)return t;let n=new Pe(this.GenerateUniqueId(),e);return this.components_[n.GetId()]=n,this.componentsMonitorList_.slice(0).forEach((e=>s((()=>e({action:"add",component:n})),"InlineJS.Global.CreateComponent"))),n}RemoveComponent(e){let t="string"==typeof e?e:e.GetId();if(this.components_.hasOwnProperty(t)){let e=this.components_[t];delete this.components_[t],this.componentsMonitorList_.slice(0).forEach((t=>s((()=>t({action:"remove",component:e})),"InlineJS.Global.RemoveComponent")))}}TraverseComponents(e){Object.values(this.components_).some((t=>!1===e(t)))}FindComponentById(e){return e&&e in this.components_?this.components_[e]:null}FindComponentByName(e){return e&&Object.values(this.components_).find((t=>t.GetName()===e))||null}FindComponentByRoot(e){return e&&Object.values(this.components_).find((t=>t.GetRoot()===e))||null}PushCurrentComponent(e){this.currentComponent_.Push(e)}PopCurrentComponent(){return this.currentComponent_.Pop()}PeekCurrentComponent(){return this.currentComponent_.Peek()}GetCurrentComponent(){return this.FindComponentById(this.PeekCurrentComponent()||"")}InferComponentFrom(e){return e&&Object.values(this.components_).find((t=>t.GetRoot()===e||t.GetRoot().contains(e)))||null}GetDirectiveManager(){return this.managers_.directive}GetMagicManager(){return this.managers_.magic}AddAttributeProcessor(e){this.attributeProcessors_.push(e)}DispatchAttributeProcessing(e){this.attributeProcessors_.forEach((t=>s((()=>t(e)),"InlineJS.Global.DispatchAttribute",e.contextElement)))}AddTextContentProcessor(e){this.textContentProcessors_.push(e)}DispatchTextContentProcessing(e){this.textContentProcessors_.forEach((t=>s((()=>t(e)),"InlineJS.Global.DispatchTextContent",e.contextElement)))}GetMutationObserver(){return this.mutationObserver_}SetFetchConcept(e){this.fetchConcept_=e}GetFetchConcept(){return this.fetchConcept_||this.nativeFetch_}SetConcept(e,t){this.concepts_[e]=t}RemoveConcept(e){delete this.concepts_[e]}GetConcept(e){return this.concepts_.hasOwnProperty(e)?this.concepts_[e]:null}CreateChildProxy(e,t,n){return new Fe(e,t,n)}CreateFuture(e){return new i(e)}IsFuture(e){return e instanceof i}CreateNothing(){return this.nothing_}IsNothing(e){return e instanceof a}}const Ne="__InlineJS_GLOBAL_KEY__";function De(e,t=0){return $(),globalThis[Ne]=new Te(e,t),(globalThis.InlineJS=globalThis.InlineJS||{}).global=globalThis[Ne],window.dispatchEvent(new CustomEvent(Be)),globalThis[Ne]}function Me(e,t=0){return je()||De(e,t)}const Be="inlinejs.global.created";function je(){return globalThis[Ne]}function Le(){return je()?Promise.resolve():new Promise((e=>window.addEventListener(Be,e)))}function Je(e){return e=p(e),je().IsFuture(e)?Je(e.Get()):!e&&!1!==e&&0!==e||je().IsNothing(e)?"":"boolean"==typeof e||"number"==typeof e||"string"==typeof e?e.toString():JSON.stringify(e)}function He({target:e,getter:t,setter:n,deleter:r,lookup:i,alert:o}){let s={get(e,n){var r;if("symbol"==typeof n||"string"==typeof n&&"prototype"===n)return Reflect.get(e,n);let i=t?t(n.toString(),e):e[n];return je().IsNothing(i)?Reflect.get(e,n):(!o||o.list&&!(n in o.list)||null===(r=R(o.componentId))||void 0===r||r.GetBackend().changes.AddGetAccess(`${o.id}.${n}`),i)},set:(e,t,r)=>"symbol"==typeof t||"string"==typeof t&&"prototype"===t?Reflect.set(e,t,r):n?!1!==n(t.toString(),r,e):!!e[t]||!0,deleteProperty:(e,t)=>"symbol"==typeof t||"string"==typeof t&&"prototype"===t?Reflect.deleteProperty(e,t):r?!1!==r(t.toString(),e):!!delete e[t]||!0,has:(e,t)=>!!Reflect.has(e,t)||(Array.isArray(i)?i.includes(t.toString()):i?i(t.toString(),e):t in e)};return new window.Proxy(e||{},s)}function ze(e){return He(We({getter:t=>t&&t in e&&e[t]||null,lookup:[...Object.keys(e)]}))}function Ue(){return!1}function qe(e){var{setter:t,deleter:n,lookup:r}=e,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["setter","deleter","lookup"]);return Object.assign(Object.assign({},i),{setter:t||Ue,deleter:n||Ue,lookup:r||Ue})}function We(e){return qe(e)}const Ke="InlineJS_ProxyGlobal";function Ve(e,t,n){let r=null==t?void 0:t.FindElementScope(n),i=null==r?void 0:r.GetId();if(!i)return["",null,null];let o=globalThis[Ke]=globalThis[Ke]||{},s=o[e]=o[e]||{};return i in s?[i,s[i],s]:(null==r||r.AddUninitCallback((()=>delete s[i])),[i,null,s])}function Ye(e,t,n){if(!(e instanceof Promise))return t(e);n?e.then((e=>Ye(e,t,!0))):e.then(t)}const Qe="__InlineJS_Context__";let Ze={},Xe={};function et(e,t){if(Ze.hasOwnProperty(e))return Ze[e];if(Xe.hasOwnProperty(e))return null;try{let t=new Function(Qe,`\n with (${Qe}){\n return (${e});\n };\n `);return Ze[e]=t}catch(e){e instanceof SyntaxError||o(e,`InlineJs.Region<${t||"NIL"}>.GenerateValueReturningFunction`)}return null}function tt(e,t){if(Xe.hasOwnProperty(e))return Xe[e];try{let t=new Function(Qe,`\n with (${Qe}){\n ${e};\n };\n `);return Xe[e]=t}catch(e){o(e,`InlineJs.Region<${t||"NIL"}>.GenerateVoidFunction`)}return null}function nt(e,t,n,r=[]){var i;if("function"==typeof e){let o=R(n||""),s=null==o?void 0:o.FindProxy(null==o?void 0:o.GetBackend().changes.GetLastAccessContext()),l=e.apply((null===(i=s||(null==o?void 0:o.GetRootProxy()))||void 0===i?void 0:i.GetNative())||null,r||[]);return t?t(l):l}return t?t(e):e}function rt({componentId:e,contextElement:t,expression:n,disableFunctionCall:r=!1,waitPromise:i="recursive"}){if(!(n=n.trim()))return e=>(e&&e(null),null);let s=(s,l,a,c,u=!0,h)=>{var p;let m=R(e),f=null==m?void 0:m.GetRootProxy().GetNative();if(!f||(null===(p=null==m?void 0:m.FindElementScope(t))||void 0===p?void 0:p.IsDestroyed()))return;let{context:v=null,changes:g=null}=(null==m?void 0:m.GetBackend())||{};null==v||v.Push(d.self,t),null==g||g.ResetLastAccessContext(),ue(e),Object.entries(c||{}).forEach((([e,t])=>null==v?void 0:v.Push(e,t)));try{let t=l(f);if(je().IsFuture(t)&&(t=t.Get()),!s)return r?t:nt(t,s,e,a);let n=e=>{if(e&&"none"!==i)return Ye(e,s,"recursive"===i),h||"Loading data...";s(e)};r?n(t):nt(t,n,e,a)}catch(t){if(u&&t instanceof SyntaxError)throw t;o(t,`InlineJs.Region<${e}>.RunFunction('${n}')`)}finally{Object.entries(c||{}).forEach((([e,t])=>null==v?void 0:v.Pop(e,t))),de(),null==v||v.Pop(d.self)}},l=et(n,e),a=null;return l||(a=tt(n,e)),(r,i=[],o,c)=>{if(!a&&l)try{return s(r,l.bind(t),i||[],o||{},void 0,c)}catch(t){if(!(t instanceof SyntaxError))throw t;a=tt(n,e)}return a?s(r,a.bind(t),i||[],o||{},!1)||null:(r&&r(null),null)}}function it(e){return rt(e)}function ot(e,t){let n=(e,t)=>Ye(e,t,!0);return e instanceof l?new l(((r,i)=>{e.While((e=>{n(e,(e=>{n(t(e),(e=>r(e)))}))})),e.Final((e=>{n(e,(e=>{n(t(e),(e=>i(e)))}))}))})):e instanceof Promise?new Promise((r=>{n(e,(e=>{n(t(e),(e=>r(e)))}))})):t(e)}function st(e,t,n){e instanceof l?e.While(t).Final(!1===n?()=>{}:n||t):t(e)}function lt({componentId:e,changes:t,callback:n,subscriptionsCallback:r,contextElement:i}){var s,l,a,c;t.PopAllGetAccessStorageSnapshots(!1),t.RestoreOptimizedGetAccessStorage();let{optimized:u,raw:d}=t.PopGetAccessStorage();if(0==((null===(s=u||d)||void 0===s?void 0:s.entries.length)||0))return r&&r({}),null;let h={},p=()=>{Object.keys(h).map((e=>R(e))).filter((e=>!!e)).forEach((e=>{let{changes:t}=e.GetBackend();h[e.GetId()].forEach((e=>t.Unsubscribe(e)))})),h={}},m=!1,f=()=>{m=!0},v=t=>{let r=R(e);if(!r||m)return void p();let{changes:i}=r.GetBackend();i.PushOrigin(v);try{n({changes:t||[],cancel:f})}catch(t){o(t,`InlineJS.Component<${e}>.SubscribeToChanges.OnChange`)}i.PopOrigin(),m&&p()},g={};return null===(l=u||d)||void 0===l||l.entries.forEach((e=>(g[e.path]=g[e.path]||{})[e.compnentId]=!0)),Object.entries(g).forEach((([e,t])=>{Object.keys(t).map((e=>R(e))).filter((e=>!!e)).forEach((t=>{(h[t.GetId()]=h[t.GetId()]||[]).push(t.GetBackend().changes.Subscribe(e,v))}))})),i&&(null===(c=null===(a=R(e))||void 0===a?void 0:a.FindElementScope(i))||void 0===c||c.AddUninitCallback((()=>{f(),p()}))),r&&r(h),p}function at({componentId:e,callback:t,contextElement:n,options:r,subscriptionsCallback:i}){var s;let l=()=>{let r=R(e);if(!r)return;let{changes:s}=r.GetBackend(),l=!1,a=n?r.FindElementScope(n):null,c=()=>{l=!0},u=null==a?void 0:a.GetElement();try{s.PushGetAccessStorage(),t({changes:[],cancel:c})}catch(t){o(t,`InlineJS.Component<${e}>.UseEffect`,u)}if(l)return s.PopAllGetAccessStorageSnapshots(!1),s.RestoreOptimizedGetAccessStorage(),void s.PopGetAccessStorage();lt({componentId:e,changes:s,callback:t,subscriptionsCallback:i,contextElement:u})};(null==r?void 0:r.nextTick)?null===(s=R(e))||void 0===s||s.GetBackend().changes.AddNextTickHandler(l):l()}function ct(e,t,n,r={}){var i;let o=null;if(o=e instanceof HTMLElement?(null===(i="string"==typeof n?R(n):n)||void 0===i?void 0:i.FindElementScope(e))||null:e,!o)return r;let s=o.GetLocal(t);return je().IsNothing(s)&&o.SetLocal(t,s=r),s}const ut="__InlineJS_GLOBAL_COMPONENT_KEY__";function dt(e){let t=globalThis[ut];if(t||!1===e)return t.component;let n=document.createElement("template");return globalThis[ut]={root:n,component:je().CreateComponent(n)},globalThis[ut]}const ht=300,pt=0,mt=0;function ft(e,t){if(!e||je().IsNothing(e)||e.allowed&&"both"!==e.allowed&&e.allowed!==(t?"reversed":"normal"))return null;let n=je().GetConcept("animation");return e.ease=e.ease||(null==n?void 0:n.GetEaseCollection().Find("default"))||null,e.actor=e.actor||(null==n?void 0:n.GetActorCollection().Find("default"))||null,e.duration=e.duration||ht,e.delay=e.delay||pt,e.repeats=e.repeats||mt,e}function vt({componentId:e,contextElement:t,target:n,callback:r,onAbort:i,reverse:o,allowRepeats:l}){var a,c,u,d;let h=ft((null===(c=null===(a=R(e))||void 0===a?void 0:a.FindElementScope(t))||void 0===c?void 0:c.GetData("transition"))||null,o||!1);if(!h||!h.actor||!h.ease||"number"!=typeof h.duration||h.duration<=0)return r(!1),null;let p=e=>{var t;return"function"==typeof(null==h?void 0:h.actor)?null==h?void 0:h.actor(e):h&&(null===(t=h.actor)||void 0===t?void 0:t.Handle(e))},m=e=>{var t;return"function"==typeof h.ease?h.ease(e):h&&(null===(t=h.ease)||void 0===t?void 0:t.Handle(e))||0},f=!1,v=()=>f=!0,g=0,_=e=>o?1-e:e,b=()=>{var r,o;return null===(o=null===(r=R(e))||void 0===r?void 0:r.FindElementScope(t))||void 0===o||o.RemoveUninitCallback(v),(n||t).dispatchEvent(new CustomEvent("transition.canceled")),i&&i(),!1};return null===(d=null===(u=R(e))||void 0===u?void 0:u.FindElementScope(t))||void 0===d||d.AddUninitCallback(v),I(h.duration,0,l?h.repeats:0,h.delay).While((({elapsed:e})=>{if(f)return b();0==g&&((n||t).style.transform="",(n||t).style.transformOrigin="50% 50%",(n||t).dispatchEvent(new CustomEvent("transition.enter"))),p({target:n||t,stage:0==g++?"start":"middle",fraction:m({duration:h.duration,elapsed:e,fraction:_(e/h.duration)})})})).Final((()=>{f?b():(p({target:n||t,stage:"end",fraction:m({duration:h.duration,elapsed:h.duration,fraction:_(1)})}),(n||t).dispatchEvent(new CustomEvent("transition.leave")),s((()=>r(!0))))})),v}function gt({element:e,html:t,type:n="replace",component:r,processDirectives:i=!0,afterRemove:o,afterInsert:l,afterTransitionCallback:a,transitionScope:c}){let u="string"==typeof r?r:(null==r?void 0:r.GetId())||"",d=()=>{let r=document.createElement("template");r.innerHTML=t,"replace"===n||"append"===n?e.append(...Array.from(r.content.childNodes)):"prepend"===n&&e.prepend(...Array.from(r.content.childNodes)),l&&s(l,"InlineJS.InsertHtml",e);let o=R(u);i&&o&&Array.from(e.children).forEach((e=>K({component:o,element:e,options:{checkTemplate:!0,checkDocument:!0,ignoreChildren:!1}}))),a&&((c||e).dispatchEvent(new CustomEvent("html.transition.begin",{detail:{insert:!0}})),vt({componentId:u,contextElement:c||e,target:e,callback:()=>((c||e).dispatchEvent(new CustomEvent("html.transition.end",{detail:{insert:!0}})),a())}))};if("replace"===n){let t=e=>{let n=R(u),r=je();Array.from(e.children).forEach((e=>{var i;let o=null==n?void 0:n.FindElementScope(e);o||(o=null===(i=r.InferComponentFrom(e))||void 0===i?void 0:i.FindElementScope(e))?o.Destroy():t(e)}))},n=()=>{t(e),Array.from(e.childNodes).forEach((e=>e.remove())),o&&s(o,"InlineJS.InsertHtml",e),d()};a?((c||e).dispatchEvent(new CustomEvent("html.transition.begin",{detail:{insert:!1}})),vt({componentId:u,contextElement:c||e,target:e,reverse:!0,callback:()=>((c||e).dispatchEvent(new CustomEvent("html.transition.end",{detail:{insert:!1}})),n())})):n()}else d()}class _t{constructor(e,t,n=!1){this.componentId_=e,this.callback_=t,this.initialized_=n,this.queued_=!1,this.setCallback_=null}Queue(e){var t;let n=()=>(this.setCallback_||e||this.callback_)&&(this.setCallback_||e||this.callback_)();!this.queued_&&this.initialized_?(this.queued_=!0,null===(t=R(this.componentId_))||void 0===t||t.GetBackend().changes.AddNextTickHandler((()=>{this.queued_=!1,n()}))):this.initialized_?this.setCallback_=e||null:(this.initialized_=!0,n())}}const bt=/\{\{\s*(.+?)\s*\}\}/g,yt=/\{\{.+?\}\}/;function Ct(e){let t=e=>[...e.childNodes].reduce(((e,t)=>`${e}${3!=t.nodeType?n(t):t.textContent||""}`),""),n=e=>`${[...e.attributes].reduce(((e,t)=>`${e} ${t.name}="${t.value}"`),`<${e.tagName.toLowerCase()}`)+">"}${t(e)}</${e.tagName.toLowerCase()}>`;return t(e)}function Et({componentId:e,contextElement:t,text:n,handler:r}){var i;let o=it({componentId:e,contextElement:t,expression:"let output = "+JSON.stringify(n).replace(bt,'"+($1)+"')+"; return output;"});null===(i=R(e))||void 0===i||i.CreateElementScope(t),at({componentId:e,contextElement:t,callback:()=>o(r)})}function xt(e){var{text:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["text"]);yt.test(t)&&Et(Object.assign({text:t},n))}function At({componentId:e,contextElement:t,text:n,handler:r}){if("string"==typeof n)return r&&xt({componentId:e,contextElement:t,text:n,handler:r});if(!yt.test(t.textContent||""))return;let i=new Array,o=new Array;[...t.childNodes].forEach((n=>{if(3==n.nodeType&&n.textContent&&yt.test(n.textContent)){let r={text:n.textContent||"",evaluated:n.textContent||""};i.push(r),o.push((()=>Et({componentId:e,contextElement:t,text:r.text,handler:e=>{r.evaluated=e,(()=>{for(;t.firstChild;)t.firstChild.remove();let e=null;i.forEach((n=>{let r=n instanceof Element?n:document.createTextNode("string"==typeof n?n:n.evaluated);e?t.insertBefore(r,e):t.append(r),e=r}))})()}})))}else 3==n.nodeType?i.push(n.textContent||""):i.push(n)})),i.reverse(),o.forEach((e=>s(e,"InlineJS.Interpolate",t)))}function kt({componentId:e,contextElement:t,name:n,value:r}){At({componentId:e,contextElement:t,text:r,handler:e=>t.setAttribute(n,e)})}function It({componentId:e,contextElement:t}){At({componentId:e,contextElement:t})}function St(e){let t=je(),n=t.GetConfig();[n.GetDirectiveName("data",!0),n.GetDirectiveName("data",!1)].forEach((n=>{(e||document).querySelectorAll(`[${n}]`).forEach((e=>{e.hasAttribute(n)&&document.contains(e)&&K({component:t.CreateComponent(e),element:e,options:{checkTemplate:!0,checkDocument:!1,ignoreChildren:!1}})}))}))}function Gt(e){Me(),setTimeout((()=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>{St(e)})):St(e)}),0)}function Pt(e,t){let n="",r=null;if("function"==typeof e){let t=e();t?({name:n,callback:r}=t):(n=e("name"),r=e("callback"))}else v(e)?({name:n,callback:r}=e):je().GetDirectiveManager().AddHandler(e);n&&r&&(t?je().GetDirectiveManager().AddHandlerExtension(t,r,n):je().GetDirectiveManager().AddHandler(r,n))}function wt(e,t){return{name:e,callback:t}}function Ot(e,t,n,r,i){let o=je().GetConfig().GetDirectiveName("on"),s=(i||[]).join("."),l=q(s?`${o}:${n}.${s}`:`${o}:${n}`,r||"");return!!l&&B(e,t,l)}const Ft=["bind","event","on"];function $t({component:e,contextElement:t,key:n,event:r,expression:i,options:o,defaultEvent:s,eventWhitelist:l=[],optionBlacklist:a}){let c=()=>a?null==o?void 0:o.filter((e=>!a.includes(e))):o,u=e=>n?`${n}-${e}.join`:e;return l.includes(r)?Ot(e,t,u(r),i,c()):!(!s||r!==s&&!Ft.includes(r))&&Ot(e,t,u(s),i,c())}function Rt(e,t,n){let r=je().GetConfig().GetDirectiveName(t,!1),i=je().GetConfig().GetDirectiveName(t,!0);return e.getAttribute(r)||e.getAttribute(i)||n&&e.getAttribute(n)||null}function Tt({componentId:e,contextElement:t,key:n,expression:r,callback:i,arrayCallback:o,useEffect:s=!0}){let l=0,a=it({componentId:e,contextElement:t,expression:r}),c=(e,t)=>{ot(e,(e=>{t==l&&(n?i([n,e]):v(e)?Object.entries(e).forEach(i):o&&("string"==typeof e||Array.isArray(e))&&o("string"==typeof e?e.trim().split(" ").filter((e=>!!e)):e))}))};s?at({componentId:e,contextElement:t,callback:()=>a((e=>c(e,++l)))}):a((e=>c(e,l)))}const Nt=Array.from(Array(100).keys()).map((e=>e/100));function Dt(e){let t={root:null,rootMargin:"0px",threshold:0};return v(e)&&Object.entries(t).forEach((([n,r])=>t[n]=n in e&&e[n]||r)),e.spread&&(t.threshold=Nt),t}class Mt{constructor(e,t){this.id_=e,this.observer_=null,this.handlers_=new Array;let n=this.id_;this.observer_=new globalThis.IntersectionObserver(((e,t)=>{e.forEach((e=>{this.handlers_.filter((({target:t})=>t===e.target)).forEach((r=>{s((()=>r.handler({entry:e,id:n,observer:t})),"InlineJS.IntersectionObserver")}))}))}),Dt(t))}GetId(){return this.id_}GetNative(){return this.observer_}Observe(e,t){var n;this.handlers_.push({target:e,handler:t}),null===(n=this.observer_)||void 0===n||n.observe(e)}Unobserve(e){var t;this.handlers_=this.handlers_.filter((t=>t.target===e)),null===(t=this.observer_)||void 0===t||t.unobserve(e)}}function Bt(e,t=0){return e&&e.match(/^[0-9]+(s|ms)?$/)?-1==e.indexOf("m")&&-1!=e.indexOf("s")?1e3*parseInt(e):parseInt(e):t}function jt({options:e,list:t,defaultNumber:n,callback:r,unknownCallback:i}){let o=Array.isArray(e)?e:[e],s=e=>("number"==typeof n?n:n&&n(e))||0;return t.forEach(((n,l)=>{let a=o.find((e=>e&&n in e));if(!a)return i&&i({options:e,list:t,option:n,index:l});r&&!0===r({options:e,list:t,option:n,index:l})||("number"==typeof a[n]?l<t.length-1?a[n]=Bt(t[l+1].trim(),s(n)):a[n]=s(n):"boolean"==typeof a[n]&&(a[n]=!0))})),e}function Lt({componentId:e,component:t,contextElement:n,expression:r,argOptions:i,callback:o,options:s,defaultOptionValue:l,useEffect:a}){let c=it({componentId:e,contextElement:n,expression:r}),u=jt({options:s||{lazy:!1,ancestor:-1,threshold:-1},list:i,defaultNumber:0===l?0:l||-1}),d=()=>c((e=>Ye(e,o))),h=()=>!1===a?d():at({componentId:e,contextElement:n,callback:d});if(u.lazy){let r=t||R(e),i={root:u.ancestor<0?null:null==r?void 0:r.FindAncestor(n,u.ancestor),threshold:u.threshold<0?0:u.threshold},o=r?new Mt(r.GenerateUniqueId("intob_"),i):null;o?(null==r||r.AddIntersectionObserver(o),o.Observe(n,(({id:t,entry:n}={})=>{var r;(null==n?void 0:n.isIntersecting)&&(null===(r=R(e))||void 0===r||r.RemoveIntersectionObserver(t),h())}))):h()}else h()}function Jt(e){let t,n="",r=null;if("function"==typeof e){let i=e();i?({name:n,callback:r,onAccess:t}=i):(n=e("name"),r=e("callback"),t=e("access"))}else v(e)?({name:n,callback:r,onAccess:t}=e):je().GetMagicManager().AddHandler(e);n&&r&&je().GetMagicManager().AddHandler(r,n,t)}function Ht(e,t,n){return{name:e,callback:t,onAccess:n}}function zt(e){return e.startsWith(":")?je().GetConfig().GetDirectiveName("bind")+e:null}function Ut(e){return e.startsWith(".")?e.replace(".",je().GetConfig().GetDirectiveName("class:")):null}function qt(e){return e.startsWith("@")?e.replace("@",je().GetConfig().GetDirectiveName("on:")):null}function Wt(e,t,n){console.log({message:e,context:t||"N/A",contextElement:n||"N/A"})}var Kt=n(749);function Vt(){Gt(),je().AddAttributeProcessor(kt),je().AddTextContentProcessor(It);let e=globalThis.InlineJS=globalThis.InlineJS||{};e.utilities={beginsWith:c,endsWith:b,toCamelCase:u,getAttribute:E,setAttribute:O,supportsAttributes:y,getTarget:p,getTargets:m,isEqual:x,isObject:v,toString:Je,deepCopy:_,tidyPath:S,pathToRelative:G,splitPath:P,joinPath:w,getRandomString:e=>(0,Kt.generate)(e)},e.values={future:i,loop:l,nothing:a,stack:r}}},666:(e,t,n)=>{"use strict";var r;"Set"in n.g?"function"==typeof Set.prototype.forEach&&(r=!1,new Set([!0]).forEach((function(e){r=e})),!0===r)?e.exports=function(e){var t=[];return new Set(e).forEach((function(e){t.push(e)})),t}:e.exports=function(e){var t=new Set;return e.filter((function(e){if(!t.has(e))return t.add(e),!0}))}:e.exports=function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}},798:(e,t,n)=>{"use strict";var r=n.g.crypto||n.g.msCrypto;r&&r.getRandomValues?e.exports=function(e,t){if(e>65536)throw new Error("requested too many random bytes");var i=new n.g.Uint8Array(e);e>0&&r.getRandomValues(i);var o=new Buffer(i.buffer);return"function"==typeof t?process.nextTick((function(){t(null,o)})):o}:e.exports=function(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}},749:(e,t,n)=>{e.exports=n(968)},838:(e,t,n)=>{var r=n(666);function i(){this.chars=""}i.prototype.setType=function(e){var t,n="0123456789",r="abcdefghijklmnopqrstuvwxyz",i=r.toUpperCase();t="alphanumeric"===e?n+r+i:"numeric"===e?n:"alphabetic"===e?r+i:"hex"===e?n+"abcdef":"binary"===e?"01":"octal"===e?"01234567":e,this.chars=t},i.prototype.removeUnreadable=function(){this.chars=this.chars.replace(/[0OIl]/g,"")},i.prototype.setcapitalization=function(e){"uppercase"===e?this.chars=this.chars.toUpperCase():"lowercase"===e&&(this.chars=this.chars.toLowerCase())},i.prototype.removeDuplicates=function(){var e=this.chars.split("");e=r(e),this.chars=e.join("")},e.exports=i},968:(e,t,n)=>{"use strict";var r=n(798),i=n(838);function o(e){for(;;)try{return r(e)}catch(e){continue}}function s(e,t,n,r,i){for(var o=t,s=0;s<e.length&&o.length<r;s++){var l=e.readUInt8(s);l<i&&(o+=n.charAt(l%n.length))}return o}function l(e,t,n,i,o){r(n,(function(r,a){r&&o(r);var c=s(a,e,t,n,i);c.length<n?l(c,t,n,i,o):o(null,c)}))}t.generate=function(e,t){var n,r=new i,a="";"object"==typeof e?(n=e.length||32,e.charset?r.setType(e.charset):r.setType("alphanumeric"),e.capitalization&&r.setcapitalization(e.capitalization),e.readable&&r.removeUnreadable(),r.removeDuplicates()):"number"==typeof e?(n=e,r.setType("alphanumeric")):(n=32,r.setType("alphanumeric"));var c=256-256%r.chars.length;if(!t){for(;a.length<n;)a=s(o(Math.ceil(256*n/c)),a,r.chars,n,c);return a}l(a,r.chars,n,c,t)}},694:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StripeDirectiveHandlerCompact=t.StripeDirectiveHandler=void 0;const r=n(866),i=["submit","save","name","email","phone","address"],o={number:"cardNumber",expiry:"cardExpiry",cvc:"cardCvc",postal:"postalCode",zip:"postalCode"},s="stripe";let l="",a="https://js.stripe.com/v3/",c=null,u=null;t.StripeDirectiveHandler=(0,r.CreateDirectiveHandlerCallback)(s,(({componentId:e,component:t,contextElement:n,expression:d,argKey:h,argOptions:p})=>{var m;if((0,r.BindEvent)({contextElement:n,expression:d,component:t||e,key:s,event:h,defaultEvent:"success",eventWhitelist:["error","before","after","ready","focus","complete"],options:p,optionBlacklist:["window","document","outside"]}))return;let f=t||(0,r.FindComponentById)(e),v=null==f?void 0:f.FindElementScope(n);if(!f||!v)return(0,r.JournalError)("Failed to retrieve element scope.",`InlineJS.${s}`,n);let g=`$${s}`,_=`#${s}`;if(g in(v.GetLocals()||{}))return;if(i.includes(h)){let t=f.FindElementLocalValue(n,_,!0);return void(t&&(t.specialMounts[h]=n,v.SetLocal(g,(0,r.CreateInplaceProxy)((0,r.BuildGetterProxyOptions)({getter:t=>{var i;let o=n.parentElement?null===(i=(0,r.FindComponentById)(e))||void 0===i?void 0:i.FindElementLocalValue(n.parentElement,g,!0):null;return"parent"===t?o:t&&o?o[t]:null},lookup:["parent"]})))))}if(o.hasOwnProperty(h))return null===(m=f.FindElementLocalValue(n,_,!0))||void 0===m?void 0:m.addField(h,n,((t,i)=>{let o=(0,r.FindComponentById)(e),l=null==o?void 0:o.FindElementScope(n),a=null==o?void 0:o.GenerateUniqueId(`${s}_proxy_`);t.element&&(null==l||l.SetLocal(g,(0,r.CreateInplaceProxy)((0,r.BuildGetterProxyOptions)({getter:i=>{var o,s,l,c,u;if("complete"===i)return null===(o=(0,r.FindComponentById)(e))||void 0===o||o.GetBackend().changes.AddGetAccess(`${a}.${i}`),t.complete;if("focused"===i)return null===(s=(0,r.FindComponentById)(e))||void 0===s||s.GetBackend().changes.AddGetAccess(`${a}.${i}`),t.focused;if("error"===i)return null===(l=(0,r.FindComponentById)(e))||void 0===l||l.GetBackend().changes.AddGetAccess(`${a}.${i}`),t.error;if("parent"===i)return n.parentElement?null===(c=(0,r.FindComponentById)(e))||void 0===c?void 0:c.FindElementLocalValue(n.parentElement,g,!0):null;if("clear"===i)return()=>{t.element&&t.element.clear()};if("focus"===i)return()=>{t.element&&t.element.focus()};if("blur"===i)return()=>{t.element&&t.element.blur()};if("disable"===i)return(e=!0)=>{t.element&&t.element.update({disabled:e})};let d=n.parentElement?null===(u=(0,r.FindComponentById)(e))||void 0===u?void 0:u.FindElementLocalValue(n.parentElement,g,!0):null;return i&&d?d[i]:null},lookup:["complete","focused","error","parent","clear","focus","blur","disable"]}))),t.element.on("ready",(()=>{t.ready||(t.ready=!0,t.mount.dispatchEvent(new CustomEvent(`${s}.ready`)),i.onReady())})),t.element.on("change",(n=>{var o,l;if((null==n?void 0:n.complete)!==t.complete){if(t.complete=null==n?void 0:n.complete,t.mount.dispatchEvent(new CustomEvent(`${s}.complete`,{detail:{completed:null==n?void 0:n.complete}})),t.complete){if(t.error&&(t.error=void 0,(0,r.AddChanges)("set",`${a}.error`,"error",null===(o=(0,r.FindComponentById)(e))||void 0===o?void 0:o.GetBackend().changes)),i.options.autofocus){let e=i.fields.indexOf(t);if(-1!=e&&e<i.fields.length-1){let t=i.fields[e+1];t.element?t.element.focus():"focus"in t.mount&&"function"==typeof t.mount.focus&&t.mount.focus()}else i.specialMounts.submit&&i.specialMounts.submit.focus()}}else(null==n?void 0:n.error)&&n.error.message!==t.error&&(t.error=n.error.message,(0,r.AddChanges)("set",`${a}.error`,"error",null===(l=(0,r.FindComponentById)(e))||void 0===l?void 0:l.GetBackend().changes),t.mount.dispatchEvent(new CustomEvent(`${s}.error`,{detail:{message:n.error.message}})));i.onChange()}})),t.element.on("focus",(()=>{var n;t.focused||(t.focused=!0,(0,r.AddChanges)("set",`${a}.focused`,"focused",null===(n=(0,r.FindComponentById)(e))||void 0===n?void 0:n.GetBackend().changes),t.mount.dispatchEvent(new CustomEvent(`${s}.focus`,{detail:{focused:!0}})))})),t.element.on("blur",(()=>{var n;t.focused&&(t.focused=!1,(0,r.AddChanges)("set",`${a}.focused`,"focused",null===(n=(0,r.FindComponentById)(e))||void 0===n?void 0:n.GetBackend().changes),t.mount.dispatchEvent(new CustomEvent(`${s}.focus`,{detail:{focused:!1}})))})))}));let b=null,y=null,C=new Array,E=()=>{(0,r.EvaluateLater)({componentId:e,contextElement:n,expression:d})((e=>(b=Stripe(e||l),b?(y=b.elements(),y?void C.splice(0).forEach((e=>(0,r.JournalTry)(e,`InlineJS.${s}.Init`,n))):(0,r.JournalError)("Failed to initialize stripe",`InlineJS.${s}.Init`,n)):(0,r.JournalError)("Failed to initialize stripe",`InlineJS.${s}.Init`,n))))},x=new Array,A={submit:null,save:null,name:null,email:null,phone:null,address:null},k=f.GenerateUniqueId(`${s}_proxy_`),I=(0,r.ResolveOptions)({options:{autofocus:!1,nexttick:!1,manual:!1},list:p}),S=!1,G=!1,P=0,w={fields:x,specialMounts:A,options:I,addField(t,n,i){let s=()=>{var s,l;let a={name:t,mount:n,element:y.create(o[t],{style:c||void 0,classes:u||void 0}),ready:!1,complete:!1,error:void 0};a.element.mount(n),this.fields.push(a),null===(l=null===(s=(0,r.FindComponentById)(e))||void 0===s?void 0:s.FindElementScope(n))||void 0===l||l.AddUninitCallback((()=>{var e;null===(e=a.element)||void 0===e||e.destroy(),this.fields=this.fields.filter((e=>e!==a))})),i(a,this)};y?s():C.push(s)},onReady:()=>{var t;return(0,r.AddChanges)("set",`${k}.readyCount`,"readyCount",null===(t=(0,r.FindComponentById)(e))||void 0===t?void 0:t.GetBackend().changes)},onChange:()=>{var t;(t=>{var n;t!=G&&(G=t,(0,r.AddChanges)("set",`${k}.complete`,"complete",null===(n=(0,r.FindComponentById)(e))||void 0===n?void 0:n.GetBackend().changes))})(!x.find((e=>!e.complete)));let n=x.reduce(((e,t)=>e+(t.error?1:0)),0);n!=P&&(P=n,(0,r.AddChanges)("set",`${k}.errors`,"errors",null===(t=(0,r.FindComponentById)(e))||void 0===t?void 0:t.GetBackend().changes))}},O=t=>{var n;t!=S&&(S=t,(0,r.AddChanges)("set",`${k}.active`,"active",null===(n=(0,r.FindComponentById)(e))||void 0===n?void 0:n.GetBackend().changes))},F=(0,r.EvaluateLater)({componentId:e,contextElement:n,expression:d}),$=t=>{var i;t.error?R(t.error.message||""):(n.dispatchEvent(new CustomEvent(`${s}.success`,{detail:{intent:t.paymentIntent}})),n.dispatchEvent(new CustomEvent(`${s}.after`)),O(!1),I.nexttick?null===(i=(0,r.FindComponentById)(e))||void 0===i||i.GetBackend().changes.AddNextTickHandler((()=>F())):F())},R=e=>{n.dispatchEvent(new CustomEvent(`${s}.error`,{detail:{type:"host",message:e}})),T("host",e),n.dispatchEvent(new CustomEvent(`${s}.after`)),O(!1)},T=(e,t)=>{n.dispatchEvent(new CustomEvent(`${s}.error`,{detail:{type:e,message:t}}))},N=(e,t)=>{var n;if(e&&"string"==typeof e)return{payment_method:e,setup_future_usage:t?"off_session":void 0};let r=null===(n=x.find((e=>"number"===e.name)))||void 0===n?void 0:n.element;if(!r)return null;let i={},o=t=>e&&e[t]||(A[t]?A[t].value:void 0);return["name","email","phone","address"].forEach((e=>{"address"===e?i.address={line1:o(e)}:i[e]=o(e)})),!t&&A.save&&A.save instanceof HTMLInputElement&&(t=A.save.checked),{payment_method:{card:r,billing_details:i},setup_future_usage:t?"off_session":void 0}},D=(e,t=!1)=>{t||G&&!x.find((e=>!!e.error))?(O(!0),n.dispatchEvent(new CustomEvent(`${s}.before`)),e()):T("incomplete","Please fill in all required fields.")};v.SetLocal(_,w),v.SetLocal(g,(0,r.CreateInplaceProxy)((0,r.BuildProxyOptions)({getter:t=>{var n,i,o,s;return"bind"===t?()=>{b||M()}:"active"===t?(null===(n=(0,r.FindComponentById)(e))||void 0===n||n.GetBackend().changes.AddGetAccess(`${k}.${t}`),S):"readyCount"===t?(null===(i=(0,r.FindComponentById)(e))||void 0===i||i.GetBackend().changes.AddGetAccess(`${k}.${t}`),x.reduce(((e,t)=>e+(t.ready?1:0)),0)):"complete"===t?(null===(o=(0,r.FindComponentById)(e))||void 0===o||o.GetBackend().changes.AddGetAccess(`${k}.${t}`),G):"errors"===t?(null===(s=(0,r.FindComponentById)(e))||void 0===s||s.GetBackend().changes.AddGetAccess(`${k}.${t}`),x.filter((e=>!!e.error)).map((e=>e.error))):"instance"===t?b:"publicKey"===t?l:"styles"===t?c:"classes"===t?u:"url"===t?a:"pay"===t?(e,t,n=!1)=>{D((()=>{let r=N(t,n);r&&(null==b||b.confirmCardPayment(e,r).then($).catch(R))}),!!t&&"string"==typeof t)}:"setup"===t?(e,t)=>{D((()=>{let n=N(t,!1);n&&(null==b||b.confirmCardSetup(e,n).then($).catch(R))}),!!t&&"string"==typeof t)}:void 0},setter:(e,t)=>("publicKey"===e?l=t:"styles"===e?c=t:"classes"===e?u=t:"url"===e&&(a=t),!0),lookup:["bind","active","readyCount","complete","errors","instance","publicKey","styles","classes","url","pay","setup"]})));let M=()=>{let e=(0,r.GetGlobal)().GetConcept("resource");a&&e?e.GetScript(a).then(E):E()};I.manual||M()})),t.StripeDirectiveHandlerCompact=function(){(0,r.AddDirectiveHandler)(t.StripeDirectiveHandler)}},419:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InlineJSStripe=void 0;const r=n(866),i=n(694);t.InlineJSStripe=function(){(0,r.WaitForGlobal)().then((()=>(0,i.StripeDirectiveHandlerCompact)()))}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";(0,n(419).InlineJSStripe)()})()})();