apprun 3.37.3 → 3.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +1,34 @@
1
- const n="3.37.2",t=`AppRun-${n}`;class e{constructor(){this._events={}}on(n,t,e={}){this._events[n]=this._events[n]||[],this._events[n].push({fn:t,options:e})}off(n,t){const e=this._events[n]||[];this._events[n]=e.filter((n=>n.fn!==t))}find(n){return this._events[n]}run(n,...t){const e=this.getSubscribers(n,this._events);return console.assert(e&&e.length>0,"No subscriber for event: "+n),e.forEach((e=>{const{fn:o,options:l}=e;if(!o||"function"!=typeof o)return console.error(`AppRun event handler for '${n}' is not a function:`,o),!1;if(l.delay)this.delay(n,o,t,l);else try{Object.keys(l).length>0?o.apply(this,[...t,l]):o.apply(this,t)}catch(t){console.error(`Error in event handler for '${n}':`,t)}return!e.options.once})),e.length}once(n,t,e={}){this.on(n,t,{...e,once:!0})}delay(n,t,e,o){o._t&&clearTimeout(o._t),o._t=setTimeout((()=>{clearTimeout(o._t);try{Object.keys(o).length>0?t.apply(this,[...e,o]):t.apply(this,e)}catch(t){console.error(`Error in delayed event handler for '${n}':`,t)}}),o.delay)}runAsync(n,...t){const e=this.getSubscribers(n,this._events);console.assert(e&&e.length>0,"No subscriber for event: "+n);const o=e.map((e=>{const{fn:o,options:l}=e;if(!o||"function"!=typeof o)return console.error(`AppRun async event handler for '${n}' is not a function:`,o),Promise.resolve(null);try{return Object.keys(l).length>0?o.apply(this,[...t,l]):o.apply(this,t)}catch(t){return console.error(`Error in async event handler for '${n}':`,t),Promise.reject(t)}}));return Promise.all(o)}query(n,...t){return console.warn("app.query() is deprecated. Use app.runAsync() instead."),this.runAsync(n,...t)}getSubscribers(n,t){const e=t[n]||[];return t[n]=e.filter((n=>!n.options.once)),Object.keys(t).filter((t=>t.endsWith("*")&&n.startsWith(t.replace("*","")))).sort(((n,t)=>t.length-n.length)).forEach((o=>e.push(...t[o].map((t=>({...t,options:{...t.options,event:n}})))))),e}}const o=t;let l;const i="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};i.app&&i._AppRunVersions?l=i.app:(l=new e,i.app=l,i._AppRunVersions=o);var s=l;function r(n){return n?.target instanceof HTMLElement?n.target:null}const a=(n,t)=>(t?n.state[t]:n.state)||"",u=(n,t,e)=>{if(t){const o=n.state||{};o[t]=e,n.setState(o)}else n.setState(e)},c=(n,t)=>{if(Array.isArray(n))return n.map((n=>c(n,t)));{let{type:e,tag:o,props:l,children:i}=n;return o=o||e,i=i||l?.children,l&&Object.keys(l).forEach((n=>{n.startsWith("$")&&(((n,t,e,o)=>{if(n.startsWith("$on")){const e=t[n];if(n=n.substring(1),"boolean"==typeof e)t[n]=t=>o.run?o.run(n,t):s.run(n,t);else if("string"==typeof e)t[n]=n=>o.run?o.run(e,n):s.run(e,n);else if("function"==typeof e)t[n]=n=>o.setState(e(o.state,n));else if(Array.isArray(e)){const[l,...i]=e;"string"==typeof l?t[n]=n=>o.run?o.run(l,...i,n):s.run(l,...i,n):"function"==typeof l&&(t[n]=n=>o.setState(l(o.state,...i,n)))}}else if("$bind"===n){const l=t.type||"text",i="string"==typeof t[n]?t[n]:t.name;if("input"===e)switch(l){case"checkbox":t.checked=a(o,i),t.onclick=n=>{const t=r(n);t&&u(o,i||t.name,t.checked)};break;case"radio":t.checked=a(o,i)===t.value,t.onclick=n=>{const t=r(n);t&&u(o,i||t.name,t.value)};break;case"number":case"range":t.value=a(o,i),t.oninput=n=>{const t=r(n);t&&u(o,i||t.name,Number(t.value))};break;default:t.value=a(o,i),t.oninput=n=>{const t=r(n);t&&u(o,i||t.name,t.value)}}else"select"===e?(t.value=a(o,i),t.onchange=n=>{const t=r(n);t&&!t.multiple&&u(o,i||t.name,t.value)}):"option"===e?(t.selected=a(o,i),t.onclick=n=>{const t=r(n);t&&u(o,i||t.name,t.selected)}):"textarea"===e&&(t.innerHTML=a(o,i),t.oninput=n=>{const t=r(n);t&&u(o,i||t.name,t.value)})}else s.run("$",{key:n,tag:e,props:t,component:o})})(n,l,o,t),delete l[n])})),i&&c(i,t),n}};class h{constructor(n,t,e){this.normal=t,this.property=n,e&&(this.space=e)}}function d(n,t){const e={},o={};for(const t of n)Object.assign(e,t.property),Object.assign(o,t.normal);return new h(e,o,t)}function p(n){return n.toLowerCase()}h.prototype.normal={},h.prototype.property={},h.prototype.space=void 0;class f{constructor(n,t){this.attribute=t,this.property=n}}f.prototype.attribute="",f.prototype.booleanish=!1,f.prototype.boolean=!1,f.prototype.commaOrSpaceSeparated=!1,f.prototype.commaSeparated=!1,f.prototype.defined=!1,f.prototype.mustUseProperty=!1,f.prototype.number=!1,f.prototype.overloadedBoolean=!1,f.prototype.property="",f.prototype.spaceSeparated=!1,f.prototype.space=void 0;let g=0;const m=x(),y=x(),v=x(),b=x(),w=x(),k=x(),S=x();function x(){return 2**++g}var C=Object.freeze({__proto__:null,boolean:m,booleanish:y,commaOrSpaceSeparated:S,commaSeparated:k,number:b,overloadedBoolean:v,spaceSeparated:w});const O=Object.keys(C);class P extends f{constructor(n,t,e,o){let l=-1;if(super(n,t),M(this,"space",o),"number"==typeof e)for(;++l<O.length;){const n=O[l];M(this,O[l],(e&C[n])===C[n])}}}function M(n,t,e){e&&(n[t]=e)}function A(n){const t={},e={};for(const[o,l]of Object.entries(n.properties)){const i=new P(o,n.transform(n.attributes||{},o),l,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(i.mustUseProperty=!0),t[o]=i,e[p(o)]=o,e[p(i.attribute)]=o}return new h(t,e,n.space)}P.prototype.defined=!0;const E=A({properties:{ariaActiveDescendant:null,ariaAtomic:y,ariaAutoComplete:null,ariaBusy:y,ariaChecked:y,ariaColCount:b,ariaColIndex:b,ariaColSpan:b,ariaControls:w,ariaCurrent:null,ariaDescribedBy:w,ariaDetails:null,ariaDisabled:y,ariaDropEffect:w,ariaErrorMessage:null,ariaExpanded:y,ariaFlowTo:w,ariaGrabbed:y,ariaHasPopup:null,ariaHidden:y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:w,ariaLevel:b,ariaLive:null,ariaModal:y,ariaMultiLine:y,ariaMultiSelectable:y,ariaOrientation:null,ariaOwns:w,ariaPlaceholder:null,ariaPosInSet:b,ariaPressed:y,ariaReadOnly:y,ariaRelevant:null,ariaRequired:y,ariaRoleDescription:w,ariaRowCount:b,ariaRowIndex:b,ariaRowSpan:b,ariaSelected:y,ariaSetSize:b,ariaSort:null,ariaValueMax:b,ariaValueMin:b,ariaValueNow:b,ariaValueText:null,role:null},transform:(n,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function R(n,t){return t in n?n[t]:t}function $(n,t){return R(n,t.toLowerCase())}const D=A({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:k,acceptCharset:w,accessKey:w,action:null,allow:null,allowFullScreen:m,allowPaymentRequest:m,allowUserMedia:m,alt:null,as:null,async:m,autoCapitalize:null,autoComplete:w,autoFocus:m,autoPlay:m,blocking:w,capture:null,charSet:null,checked:m,cite:null,className:w,cols:b,colSpan:null,content:null,contentEditable:y,controls:m,controlsList:w,coords:b|k,crossOrigin:null,data:null,dateTime:null,decoding:null,default:m,defer:m,dir:null,dirName:null,disabled:m,download:v,draggable:y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:m,formTarget:null,headers:w,height:b,hidden:v,high:b,href:null,hrefLang:null,htmlFor:w,httpEquiv:w,id:null,imageSizes:null,imageSrcSet:null,inert:m,inputMode:null,integrity:null,is:null,isMap:m,itemId:null,itemProp:w,itemRef:w,itemScope:m,itemType:w,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:m,low:b,manifest:null,max:null,maxLength:b,media:null,method:null,min:null,minLength:b,multiple:m,muted:m,name:null,nonce:null,noModule:m,noValidate:m,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:m,optimum:b,pattern:null,ping:w,placeholder:null,playsInline:m,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:m,referrerPolicy:null,rel:w,required:m,reversed:m,rows:b,rowSpan:b,sandbox:w,scope:null,scoped:m,seamless:m,selected:m,shadowRootClonable:m,shadowRootDelegatesFocus:m,shadowRootMode:null,shape:null,size:b,sizes:null,slot:null,span:b,spellCheck:y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:b,step:null,style:null,tabIndex:b,target:null,title:null,translate:null,type:null,typeMustMatch:m,useMap:null,value:y,width:b,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:w,axis:null,background:null,bgColor:null,border:b,borderColor:null,bottomMargin:b,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:m,declare:m,event:null,face:null,frame:null,frameBorder:null,hSpace:b,leftMargin:b,link:null,longDesc:null,lowSrc:null,marginHeight:b,marginWidth:b,noResize:m,noHref:m,noShade:m,noWrap:m,object:null,profile:null,prompt:null,rev:null,rightMargin:b,rules:null,scheme:null,scrolling:y,standby:null,summary:null,text:null,topMargin:b,valueType:null,version:null,vAlign:null,vLink:null,vSpace:b,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:m,disableRemotePlayback:m,prefix:null,property:null,results:b,security:null,unselectable:null},space:"html",transform:$}),T=A({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:S,accentHeight:b,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:b,amplitude:b,arabicForm:null,ascent:b,attributeName:null,attributeType:null,azimuth:b,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:b,by:null,calcMode:null,capHeight:b,className:w,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:b,diffuseConstant:b,direction:null,display:null,dur:null,divisor:b,dominantBaseline:null,download:m,dx:null,dy:null,edgeMode:null,editable:null,elevation:b,enableBackground:null,end:null,event:null,exponent:b,externalResourcesRequired:null,fill:null,fillOpacity:b,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:k,g2:k,glyphName:k,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:b,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:b,horizOriginX:b,horizOriginY:b,id:null,ideographic:b,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:b,k:b,k1:b,k2:b,k3:b,k4:b,kernelMatrix:S,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:b,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:b,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:b,overlineThickness:b,paintOrder:null,panose1:null,path:null,pathLength:b,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:w,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:b,pointsAtY:b,pointsAtZ:b,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:S,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:S,rev:S,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:S,requiredFeatures:S,requiredFonts:S,requiredFormats:S,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:b,specularExponent:b,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:b,strikethroughThickness:b,string:null,stroke:null,strokeDashArray:S,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:b,strokeOpacity:b,strokeWidth:null,style:null,surfaceScale:b,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:S,tabIndex:b,tableValues:null,target:null,targetX:b,targetY:b,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:S,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:b,underlineThickness:b,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:b,values:null,vAlphabetic:b,vMathematical:b,vectorEffect:null,vHanging:b,vIdeographic:b,version:null,vertAdvY:b,vertOriginX:b,vertOriginY:b,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:b,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:R}),L=A({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(n,t)=>"xlink:"+t.slice(5).toLowerCase()}),j=A({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$}),_=A({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(n,t)=>"xml:"+t.slice(3).toLowerCase()}),U=/[A-Z]/g,z=/-[a-z]/g,B=/^data[-\w.:]+$/i;function I(n){return"-"+n.toLowerCase()}function H(n){return n.charAt(1).toUpperCase()}const N=d([E,D,L,j,_],"html"),F=d([E,T,L,j,_],"svg"),q="_props",V=new Map;function W(n,t){const e=`${n}:${t}`;let o=V.get(e);return void 0===o&&(o=function(n,t){const e=p(t);let o=t,l=f;if(e in n.normal)return n.property[n.normal[e]];if(e.length>4&&"data"===e.slice(0,4)&&B.test(t)){if("-"===t.charAt(4)){const n=t.slice(5).replace(z,H);o="data"+n.charAt(0).toUpperCase()+n.slice(1)}else{const n=t.slice(4);if(!z.test(n)){let e=n.replace(U,I);"-"!==e.charAt(0)&&(e="-"+e),t="data"+e}}l=P}return new l(o,t)}(t?F:N,n)||null,V.set(e,o)),o}function K(n,t,e){!function(n){if(null==n||!1===n||""===n)return!1;if(!0===n)return!0;if("string"==typeof n){return"false"!==n.toLowerCase()&&"0"!==n}return Boolean(n)}(e)?n.removeAttribute(t):n.setAttribute(t,t)}function X(n,t,e){try{n[t]=e}catch(o){Y(n,t,e,!1)}}function Y(n,t,e,o){if(null==e)return void n.removeAttribute(t);const l=String(e);if(o&&t.includes(":")){const[e]=t.split(":");"xlink"===e?n.setAttributeNS("http://www.w3.org/1999/xlink",t,l):n.setAttribute(t,l)}else n.setAttribute(t,l)}function Z(n,t,e,o){if(function(n,t){if(document.activeElement===n)return["selectionStart","selectionEnd","selectionDirection"].includes(t);if("scrollTop"===t||"scrollLeft"===t)return!0;if(n instanceof HTMLMediaElement&&["currentTime","paused","playbackRate","volume"].includes(t))return!0;return!1}(n,t))return;if("style"===t){if(n.style.cssText&&(n.style.cssText=""),"string"==typeof e)n.style.cssText=e;else if(e&&"object"==typeof e)for(const t in e)n.style[t]!==e[t]&&(n.style[t]=e[t]);return}if("key"===t)return void(null!=e&&(n.key=e));if(t.startsWith("data-"))return void function(n,t,e){const o=(l=t.slice(5)).length<=1?l.toLowerCase():l.split("-").map(((n,t)=>0===t?n.toLowerCase():n.charAt(0).toUpperCase()+n.slice(1).toLowerCase())).join("");var l;null==e?delete n.dataset[o]:n.dataset[o]=String(e)}(n,t,e);if(t.startsWith("on"))return void function(n,t,e){t.startsWith("on")&&(e&&"function"!=typeof e?"string"==typeof e&&(e?n.setAttribute(t,e):n.removeAttribute(t)):n[t]=e)}(n,t,e);if(!("INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&"SELECT"!==n.tagName||"value"!==t&&"selected"!==t&&"selectedIndex"!==t))return void X(n,t,e);if("INPUT"===n.tagName&&"checked"===t)return X(n,t,e),void K(n,t,e);const l=W(t,o);l?l.boolean||l.overloadedBoolean?K(n,l.attribute,e):l.mustUseProperty&&!o?X(n,l.property,e):Y(n,l.attribute,e,o):t.startsWith("aria-")||"role"===t?Y(n,t,e,o):t in n||void 0!==n[t]?X(n,t,e):Y(n,t,e,o)}function J(n){return/^[a-zA-Z_:][\w\-:.]*$/.test(n)&&!n.includes("<")&&!n.includes(">")&&!n.includes('"')&&!n.includes("'")}function G(n,t,e){const o=function(n,t){if(t&&(t.class=t.class||t.className,delete t.className),!n||0===Object.keys(n).length)return t||{};if(!t||0===Object.keys(t).length){const t={};return Object.keys(n).forEach((n=>t[n]=null)),t}const e={};return Object.keys(n).forEach((n=>{n in t||(e[n]=null)})),Object.keys(t).forEach((n=>e[n]=t[n])),e}(n[q]||{},t);n[q]=t||{},function(n,t,e,o){for(const e in t)J(e)&&Z(n,e,t[e],o);t&&"function"==typeof t.ref&&window.requestAnimationFrame((()=>t.ref(n)))}(n,o,0,e)}function Q(n,...t){return nn(t)}function nn(n){const t=[],e=n=>{null!=n&&""!==n&&!1!==n&&t.push("function"==typeof n||"object"==typeof n?n:`${n}`)};return n&&n.forEach((n=>{Array.isArray(n)?n.forEach((n=>e(n))):e(n)})),t}const tn={};let en=0;function on(n,t,...e){const o=nn(e);if("string"==typeof n)return{tag:n,props:t,children:o};if(Array.isArray(n))return n;if(void 0===n&&e)return o;if(Object.getPrototypeOf(n).i)return{tag:n,props:t,children:o};if("function"==typeof n)return n(t,o);throw new Error(`Unknown tag in vdom ${n}`)}const ln=(n,t,e={})=>{if(null==t||!1===t)return;!function(n,t,e={}){if(null==t||!1===t)return;if(t=hn(t,e),!n)return;const o="SVG"===n.nodeName;Array.isArray(t)?rn(n,t,o):rn(n,[t],o)}("string"==typeof n&&n?document.getElementById(n)||document.querySelector(n):n,t=c(t,e),e)};function sn(n,t,e){e=e||"svg"===t.tag,function(n,t){const e=n.nodeName,o=`${t.tag||""}`;return e.toUpperCase()===o.toUpperCase()}(n,t)?(rn(n,t.children,e),G(n,t.props,e)):n.parentNode.replaceChild(cn(t,e),n)}function rn(n,t,e){const o=n.childNodes?.length||0,l=t?.length||0,i=Math.min(o,l);for(let o=0;o<i;o++){const l=t[o],i=n.childNodes[o];if("string"==typeof l)i.textContent!==l&&(3===i.nodeType?i.nodeValue=l:n.replaceChild(un(l),i));else if(l instanceof HTMLElement||l instanceof SVGElement)n.insertBefore(l,i);else{const t=l.props&&l.props.key;if(t)if(i.key===t)sn(n.childNodes[o],l,e);else{const s=tn[t];s?(n.insertBefore(s,i),sn(n.childNodes[o],l,e)):n.replaceChild(cn(l,e),i)}else sn(n.childNodes[o],l,e)}}let s=n.childNodes?.length||0;for(;s>i;)n.removeChild(n.lastChild),s--;if(l>i){const o=document.createDocumentFragment();for(let n=i;n<t.length;n++)o.appendChild(cn(t[n],e));n.appendChild(o)}}const an=n=>{const t=document.createElement("section");return t.insertAdjacentHTML("afterbegin",n),Array.from(t.children)};function un(n){if(0===n?.indexOf("_html:")){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",n.substring(6)),t}return document.createTextNode(n??"")}function cn(n,t){if(n instanceof HTMLElement||n instanceof SVGElement)return n;if("string"==typeof n)return un(n);if(!n.tag||"function"==typeof n.tag)return un(JSON.stringify(n));const e=(t=t||"svg"===n.tag)?document.createElementNS("http://www.w3.org/2000/svg",n.tag):document.createElement(n.tag);return G(e,n.props,t),n.children&&n.children.forEach((n=>e.appendChild(cn(n,t)))),n.props&&void 0!==n.props.key&&(e.key=n.props.key,tn[n.props.key]=e,++en>=500&&(!function(){if(!(Object.keys(tn).length<=1e3))for(const[n,t]of Object.entries(tn))t.isConnected||delete tn[n]}(),en=0)),e}function hn(n,t,e=0){if("string"==typeof n)return n;if(Array.isArray(n))return n.map((n=>hn(n,t,e++)));let o=n;if(n&&"function"==typeof n.tag&&Object.getPrototypeOf(n.tag).i&&(o=function(n,t,e){const{tag:o,props:l,children:i}=n;let s=`_${e}`,r=l&&l.id;r?s=r:r=`_${e}${Date.now()}`;let a="section";l&&l.as&&(a=l.as,delete l.as),t.m||(t.m={});let u=t.m[s];if(u&&u instanceof o&&u.element)u.renderState(u.state);else{const n=document.createElement(a);u=t.m[s]=new o({...l,children:i}).mount(n,{render:!0})}if(u.mounted){const n=u.mounted(l,i,u.state);void 0!==n&&u.setState(n)}return G(u.element,l,!1),u.element}(n,t,e)),o&&Array.isArray(o.children)){const n=o.props?._component;if(n){let t=0;o.children=o.children.map((e=>hn(e,n,t++)))}else o.children=o.children.map((n=>hn(n,t,e++)))}return o}const dn=(n,t={})=>class extends HTMLElement{constructor(){super()}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(t.observedAttributes||[]).map((n=>n.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component){const e=t||{};this._shadowRoot=e.shadow?this.attachShadow({mode:"open"}):this;const o=e.observedAttributes||[],l=o.reduce(((n,t)=>{const e=t.toLowerCase();return e!==t&&(n[e]=t),n}),{});this._attrMap=n=>l[n]||n;const i={};Array.from(this.attributes).forEach((n=>i[this._attrMap(n.name)]=n.value)),o.forEach((n=>{void 0!==this[n]&&(i[n]=this[n]),Object.defineProperty(this,n,{get:()=>i[n],set(t){this.attributeChangedCallback(n,i[n],t)},configurable:!0,enumerable:!0})})),requestAnimationFrame((()=>{const t=this.children?Array.from(this.children):[];if(this._component=new n({...i,children:t}).mount(this._shadowRoot,e),this._component._props=i,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const n=this._component.mounted(i,t,this._component.state);void 0!==n&&(this._component.state=n)}this.on=this._component.on.bind(this._component),this.run=this._component.run.bind(this._component),!1!==e.render&&this._component.run(".")}))}}disconnectedCallback(){this._component?.unload?.(),this._component?.unmount?.(),this._component=null}attributeChangedCallback(n,e,o){if(this._component){const l=this._attrMap(n);this._component._props[l]=o,this._component.run("attributeChanged",l,e,o),o!==e&&!1!==t.render&&window.requestAnimationFrame((()=>{this._component.run(".")}))}}};var pn=(n,t,e)=>{"undefined"!=typeof customElements&&customElements.define(n,dn(t,e))};const fn={meta:new WeakMap,defineMetadata(n,t,e){this.meta.has(e)||this.meta.set(e,{}),this.meta.get(e)[n]=t},getMetadataKeys(n){return n=Object.getPrototypeOf(n),this.meta.get(n)?Object.keys(this.meta.get(n)):[]},getMetadata(n,t){return t=Object.getPrototypeOf(t),this.meta.get(t)?this.meta.get(t)[n]:null}};const gn=n=>n,mn=s;class yn{renderState(n,t=null){if(!this.view)return;let e=t||this.view(n);if(mn.debug&&mn.run("debug",{component:this,_:e?".":"-",state:n,vdom:e,el:this.element}),"object"!=typeof document)return;const o="string"==typeof this.element&&this.element?function(n){try{return document.getElementById(n)}catch(t){return console.warn(`Error getting element by id: ${n}`,t),null}}(this.element)||function(n,t=document){try{return t.querySelector(n)}catch(t){return console.warn(`Invalid selector: ${n}`,t),null}}(this.element):this.element;if(!o)return void console.warn(`Component element not found: ${this.element}`);const l="_c";this.unload?o._component===this&&o.getAttribute(l)===this.tracking_id||(this.tracking_id=(new Date).valueOf().toString(),o.setAttribute(l,this.tracking_id),"undefined"!=typeof MutationObserver&&(this.observer||(this.observer=new MutationObserver((n=>{n[0].oldValue!==this.tracking_id&&document.body.contains(o)||(this.unload(this.state),this.observer.disconnect(),this.observer=null)}))),this.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[l]}))):o.removeAttribute&&o.removeAttribute(l),o._component=this,!t&&e&&(e=c(e,this),this.options.transition&&document&&document.startViewTransition?document.startViewTransition((()=>mn.render(o,e,this))):mn.render(o,e,this)),this.rendered&&this.rendered(this.state)}setState(n,t={render:!0,history:!1}){const e=async n=>{try{for(;;){const{value:e,done:o}=await n.next();if(o)break;this.setState(e,t)}}catch(n){console.error("Error in async iterator:",n)}},o=n;if(o?.[Symbol.asyncIterator])this.setState(e(o[Symbol.asyncIterator]()),t);else if(o?.[Symbol.iterator]&&"function"==typeof o.next)for(const n of o)this.setState(n,t);else if(n&&n instanceof Promise)Promise.resolve(n).then((e=>{this.setState(e,t),this._state=n}));else{if(this._state=n,null==n)return;this.state=n,!1!==t.render&&(t.transition&&document&&document.startViewTransition?document.startViewTransition((()=>this.renderState(n))):this.renderState(n)),!1!==t.history&&this.enable_history&&(this._history=[...this._history,n],this._history_idx=this._history.length-1),"function"==typeof t.callback&&t.callback(this.state)}}constructor(n,t,o,l){this.state=n,this.view=t,this.update=o,this.options=l,this._app=new e,this._actions=[],this._global_events=[],this._history=[],this._history_idx=-1,this._history_prev=()=>{this._history_idx--,this._history_idx>=0?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=0},this._history_next=()=>{this._history_idx++,this._history_idx<this._history.length?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=this._history.length-1},this.start=(n=null,t)=>{if(this.mount(n,{render:!0,...t}),this.mounted&&"function"==typeof this.mounted){const n=this.mounted({},[],this.state);void 0!==n&&this.setState(n)}return this}}mount(n=null,t){return console.assert(!this.element,"Component already mounted."),this.options=t={...this.options,...t},this.element=n,this.global_event=t.global_event,this.enable_history=!!t.history,this.enable_history&&(this.on(t.history.prev||"history-prev",this._history_prev),this.on(t.history.next||"history-next",this._history_next)),t.route&&(this.update=this.update||{},this.update[t.route]||(this.update[t.route]=gn)),this.add_actions(),this.state=this.state??this.model??{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!t.render,history:!0}),mn.debug&&mn.find("debug-create-component")?.length&&mn.run("debug-create-component",this),this}is_global_event(n){return n&&(this.global_event||this._global_events.indexOf(n)>=0||n.startsWith("#")||n.startsWith("/")||n.startsWith("@"))}add_action(n,t,e={}){t&&"function"==typeof t?(e.global&&this._global_events.push(n),this.on(n,((...o)=>{mn.debug&&mn.run("debug",{component:this,_:">",event:n,p:o,current_state:this.state,options:e});try{const l=t(this.state,...o);mn.debug&&mn.run("debug",{component:this,_:"<",event:n,p:o,newState:l,state:this.state,options:e}),this.setState(l,e)}catch(t){console.error(`Error in component action '${n}':`,t),mn.debug&&mn.run("debug",{component:this,_:"!",event:n,p:o,error:t,state:this.state,options:e})}}),e)):console.warn(`Component action for '${n}' is not a valid function:`,t)}add_actions(){const n=this.update||{};fn.getMetadataKeys(this).forEach((t=>{if(t.startsWith("apprun-update:")){const e=fn.getMetadata(t,this);n[e.name]=[this[e.key].bind(this),e.options]}}));const t={};Array.isArray(n)?n.forEach((n=>{const[e,o,l]=n;e.toString().split(",").forEach((n=>t[n.trim()]=[o,l]))})):Object.keys(n).forEach((e=>{const o=n[e];("function"==typeof o||Array.isArray(o))&&e.split(",").forEach((n=>t[n.trim()]=o))})),t["."]||(t["."]=gn),Object.keys(t).forEach((n=>{const e=t[n];"function"==typeof e?this.add_action(n,e):Array.isArray(e)&&this.add_action(n,e[0],e[1])}))}run(n,...t){if(this.state instanceof Promise)return Promise.resolve(this.state).then((e=>{this.state=e,this.run(n,...t)}));{const e=n.toString();return this.is_global_event(e)?mn.run(e,...t):this._app.run(e,...t)}}on(n,t,e){const o=n.toString();return this._actions.push({name:o,fn:t}),this.is_global_event(o)?mn.on(o,t,e):this._app.on(o,t,e)}runAsync(n,...t){const e=n.toString();return this.is_global_event(e)?mn.runAsync(e,...t):this._app.runAsync(e,...t)}query(n,...t){return console.warn("component.query() is deprecated. Use component.runAsync() instead."),this.runAsync(n,...t)}unmount(){this.observer?.disconnect(),this._actions.forEach((n=>{const{name:t,fn:e}=n;this.is_global_event(t)?mn.off(t,e):this._app.off(t,e)}))}}function vn(){const n=s.find("#");if(n&&n.length>0)return s.run("#"),void s.run(kn,"#");const t=s.find("/");if(t&&t.length>0)return s.run("/"),void s.run(kn,"/");const e=s.find("#/");if(e&&e.length>0)return s.run("#/"),void s.run(kn,"#/");console.warn("No subscribers for event: "),s.run(Sn,""),s.run(kn,"")}function bn(n){if(!n)return void vn();n=function(n){return n&&"/"!==n&&"#"!==n&&"#/"!==n&&n.endsWith("/")?n.slice(0,-1):n}(n);const t=s.basePath;t&&(n=function(n,t){if(!t||"/"===t||""===t)return n;const e=t.startsWith("/")?t:"/"+t;if(n.startsWith(e)){const t=n.substring(e.length);return t.startsWith("/")?t:"/"+t}return n}(n,t));const e=function(n){return n?n.startsWith("#/")?n.substring(2).split("/"):n.startsWith("#")||n.startsWith("/")?n.substring(1).split("/"):n.split("/"):[]}(n);let o;!function(n){const t=n.filter(Boolean);t.length>11&&console.warn(`Deep route hierarchy detected: ${t.join("/")} (${t.length} levels)`)}(e),o=n.startsWith("#/")?"hash-slash":n.startsWith("#")?"hash":n.startsWith("/")?"path":"non-prefixed";const l=function(n,t){const e=[];for(let o=n.length;o>0;o--){const l=n.slice(0,o);let i="";switch(t){case"path":i="/"+l.join("/");break;case"hash":i="#"+l.join("/");break;case"hash-slash":i="#/"+l.join("/");break;case"non-prefixed":i=l.join("/")}e.push(i)}return e}(e,o),i=function(n,t){for(let e=0;e<n.length;e++){const o=n[e],l=s.find(o);if(l&&l.length>0){const l=n.length-e;return{eventName:o,parameters:t.slice(l)}}}return null}(l,e);if(i)wn(i.eventName,...i.parameters);else if(l.length>0){const t=l[l.length-1];console.warn(`No subscribers for event: ${t}`),s.run(Sn,n),s.run(kn,n)}else vn()}yn.i=!0;const wn=(n,...t)=>{if(!n||n===kn||n===Sn)return;const e=s.find(n);e&&0!==e.length?s.run(n,...t):(console.warn(`No subscribers for event: ${n}`),s.run(Sn,n,...t)),s.run(kn,n,...t)},kn="//",Sn="///",xn=n=>{s.lastUrl!==n&&(s.lastUrl=n,bn(n))};function Cn(n){return n&&"object"==typeof n&&"function"==typeof n.mount}function On(n){return"function"==typeof n&&n.prototype&&n.prototype.constructor===n&&(void 0!==n.prototype.mount||void 0!==n.prototype.state||void 0!==n.prototype.view)}function Pn(n){return"function"==typeof n&&!On(n)}async function Mn(n,t=3){let e=n,o=0;for(;Pn(e)&&o<t;)try{const n=await e();if(n===e)break;e=n,o++}catch(n){console.error(`Error executing component function: ${n}`);break}return e}const An=s;if(!An.start){An.version=n,An.h=An.createElement=on,An.render=ln,An.Fragment=Q,An.webComponent=pn,An.safeHTML=an,An.start=(n,t,e,o,l)=>{const i={render:!0,global_event:!0,...l},s=new yn(t,e,o);return l&&l.rendered&&(s.rendered=l.rendered),l&&l.mounted&&(s.mounted=l.mounted),s.start(n,i),s},An.query=An.query||An.runAsync;const t=n=>{};if(An.on("/",t),An.on("debug",(n=>t)),An.on(kn,t),An.on(Sn,t),An.route=xn,An.on("route",(n=>An.route&&An.route(n))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{const n=document.body.hasAttribute("apprun-no-init")||An["no-init-route"]||!1,t=An.find("#")||An.find("#/")||!1;window.addEventListener("hashchange",(()=>xn(location.hash))),window.addEventListener("popstate",(()=>xn(location.pathname))),t?!n&&xn(location.hash):(!n&&(()=>{const n=An.basePath||"";let t=location.pathname;n&&t.startsWith(n)&&(t=t.substring(n.length),t.startsWith("/")||(t="/"+t)),xn(t)})(),document.body.addEventListener("click",(n=>{const t=n.target;if(!t)return;const e="A"===t.tagName?t:t.closest("a");if(e&&e.origin===location.origin&&e.pathname){n.preventDefault();const t=(An.basePath||"")+e.pathname;history.pushState(null,"",t),xn(e.pathname)}})))})),"object"==typeof window){const n=window;n.Component=yn,n._React=n.React,n.React=An,n.on=function(n,t={}){return function(e,o){const l=n?n.toString():o;fn.defineMetadata(`apprun-update:${l}`,{name:l,key:o,options:t},e)}},n.customElement=function(n,t){return function(e){return pn(n,e,t),e}},n.safeHTML=an}An.use_render=(n,t=0)=>{An.render=0===t?(t,e)=>n(e,t):(t,e)=>n(t,e)},An.use_react=(n,t)=>{if(n&&t)if("function"==typeof n.createElement)if(n.Fragment)if(An.h=An.createElement=n.createElement,An.Fragment=n.Fragment,n.version&&n.version.startsWith("18")){if(!t.createRoot||"function"!=typeof t.createRoot)return void console.error("AppRun use_react: ReactDOM.createRoot not found in React 18+");An.render=(n,e)=>{n&&void 0!==e&&(n._root||(n._root=t.createRoot(n)),n._root.render(e))}}else{if(!t.render||"function"!=typeof t.render)return void console.error("AppRun use_react: ReactDOM.render not found in legacy React");An.render=(n,e)=>t.render(e,n)}else console.error("AppRun use_react: Invalid React object - Fragment not found");else console.error("AppRun use_react: Invalid React object - createElement method not found");else console.error("AppRun use_react: React and ReactDOM parameters are required")},An.addComponents=async(n,t)=>{for(const[e,o]of Object.entries(t))if(o&&e)if(Cn(o)){const t={route:e};o.mount(n,t)}else if(On(o)){const t={route:e};(new o).mount(n,t)}else if(Pn(o)){let t=await Mn(o);if(Cn(t)){const o={route:e};t.mount(n,o);continue}if(On(t)){const o={route:e};(new t).mount(n,o);continue}s.on(e,((...t)=>{const e=o(...t);if("string"!=typeof n||(n=document.querySelector(n)))return s.render(n,e);console.error(`Element not found: ${n}`)}))}else console.error("Invalid component: component must be a class, instance, or function that returns a class/instance");else console.error(`Invalid component configuration: component=${o}, route=${e}`)}}
1
+ const n="3.38.0",t=`AppRun-${n}`;class e{constructor(){this._events={}}on(n,t,e={}){this._events[n]=this._events[n]||[],this._events[n].push({fn:t,options:e})}off(n,t){const e=this._events[n]||[];this._events[n]=e.filter((n=>n.fn!==t))}find(n){return this._events[n]}run(n,...t){const e=this.getSubscribers(n,this._events);return console.assert(e&&e.length>0,"No subscriber for event: "+n),e.forEach((e=>{const{fn:o,options:l}=e;if(!o||"function"!=typeof o)return console.error(`AppRun event handler for '${n}' is not a function:`,o),!1;if(l.delay)this.delay(n,o,t,l);else try{Object.keys(l).length>0?o.apply(this,[...t,l]):o.apply(this,t)}catch(t){console.error(`Error in event handler for '${n}':`,t)}return!e.options.once})),e.length}once(n,t,e={}){this.on(n,t,{...e,once:!0})}delay(n,t,e,o){o._t&&clearTimeout(o._t),o._t=setTimeout((()=>{clearTimeout(o._t);try{Object.keys(o).length>0?t.apply(this,[...e,o]):t.apply(this,e)}catch(t){console.error(`Error in delayed event handler for '${n}':`,t)}}),o.delay)}runAsync(n,...t){const e=this.getSubscribers(n,this._events);console.assert(e&&e.length>0,"No subscriber for event: "+n);const o=e.map((e=>{const{fn:o,options:l}=e;if(!o||"function"!=typeof o)return console.error(`AppRun async event handler for '${n}' is not a function:`,o),Promise.resolve(null);try{return Object.keys(l).length>0?o.apply(this,[...t,l]):o.apply(this,t)}catch(t){return console.error(`Error in async event handler for '${n}':`,t),Promise.reject(t)}}));return Promise.all(o)}query(n,...t){return console.warn("app.query() is deprecated. Use app.runAsync() instead."),this.runAsync(n,...t)}getSubscribers(n,t){const e=t[n]||[];return t[n]=e.filter((n=>!n.options.once)),Object.keys(t).filter((t=>t.endsWith("*")&&n.startsWith(t.replace("*","")))).sort(((n,t)=>t.length-n.length)).forEach((o=>e.push(...t[o].map((t=>({...t,options:{...t.options,event:n}})))))),e}}const o=t;let l;const i="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};i.app&&i._AppRunVersions?l=i.app:(l=new e,i.app=l,i._AppRunVersions=o);var s=l;function r(n){return n?.target instanceof HTMLElement?n.target:null}const a=n=>{if(!n)return[];const t=[];let e="",o=!1,l="";for(let i=0;i<n.length;i++){const s=n[i];"["!==s||o?"]"===s&&o?(l?e=e.slice(1,-1):/^\d+$/.test(e)&&(e=parseInt(e,10)),t.push(e),e="",o=!1,l=""):'"'!==s&&"'"!==s||!o?"."!==s||o?e+=s:e&&(t.push(e),e=""):(l?s===l&&(l=""):l=s,e+=s):(e&&(t.push(e),e=""),o=!0)}return e&&t.push(e),t},u=(n,t)=>{if(!t)return n.state||"";const e=a(t),o=((n,t)=>{let e=n;for(const n of t){if(null==e)return;e=e[n]}return e})(n.state,e);return void 0!==o?o:""},c=(n,t,e)=>{if(!t)return void n.setState(e);const o=a(t),l=((n,t,e)=>{if(0===t.length)return e;const o={...n};let l=o;for(let n=0;n<t.length-1;n++){const e=t[n],o=t[n+1];null==l[e]?l[e]="number"==typeof o?[]:{}:Array.isArray(l[e])?l[e]=[...l[e]]:"object"==typeof l[e]&&(l[e]={...l[e]}),l=l[e]}return l[t[t.length-1]]=e,o})(n.state||{},o,e);n.setState(l)},h=(n,t)=>{if(Array.isArray(n))return n.map((n=>h(n,t)));{let{type:e,tag:o,props:l,children:i}=n;return o=o||e,i=i||l?.children,l&&Object.keys(l).forEach((n=>{n.startsWith("$")&&(((n,t,e,o)=>{if(n.startsWith("$on")){const e=t[n];if(n=n.substring(1),"boolean"==typeof e)t[n]=t=>o.run?o.run(n,t):s.run(n,t);else if("string"==typeof e)t[n]=n=>o.run?o.run(e,n):s.run(e,n);else if("function"==typeof e)t[n]=n=>o.setState(e(o.state,n));else if(Array.isArray(e)){const[l,...i]=e;"string"==typeof l?t[n]=n=>o.run?o.run(l,...i,n):s.run(l,...i,n):"function"==typeof l&&(t[n]=n=>o.setState(l(o.state,...i,n)))}}else if("$bind"===n){const l=t.type||"text",i="string"==typeof t[n]?t[n]:t.name;if("input"===e)switch(l){case"checkbox":t.checked=u(o,i),t.onclick=n=>{const t=r(n);t&&c(o,i||t.name,t.checked)};break;case"radio":t.checked=u(o,i)===t.value,t.onclick=n=>{const t=r(n);t&&c(o,i||t.name,t.value)};break;case"number":case"range":t.value=u(o,i),t.oninput=n=>{const t=r(n);t&&c(o,i||t.name,Number(t.value))};break;default:t.value=u(o,i),t.oninput=n=>{const t=r(n);t&&c(o,i||t.name,t.value)}}else"select"===e?(t.value=u(o,i),t.onchange=n=>{const t=r(n);t&&!t.multiple&&c(o,i||t.name,t.value)}):"option"===e?(t.selected=u(o,i),t.onclick=n=>{const t=r(n);t&&c(o,i||t.name,t.selected)}):"textarea"===e&&(t.innerHTML=u(o,i),t.oninput=n=>{const t=r(n);t&&c(o,i||t.name,t.value)})}else s.run("$",{key:n,tag:e,props:t,component:o})})(n,l,o,t),delete l[n])})),i&&h(i,t),n}};class d{constructor(n,t,e){this.normal=t,this.property=n,e&&(this.space=e)}}function p(n,t){const e={},o={};for(const t of n)Object.assign(e,t.property),Object.assign(o,t.normal);return new d(e,o,t)}function f(n){return n.toLowerCase()}d.prototype.normal={},d.prototype.property={},d.prototype.space=void 0;class g{constructor(n,t){this.attribute=t,this.property=n}}g.prototype.attribute="",g.prototype.booleanish=!1,g.prototype.boolean=!1,g.prototype.commaOrSpaceSeparated=!1,g.prototype.commaSeparated=!1,g.prototype.defined=!1,g.prototype.mustUseProperty=!1,g.prototype.number=!1,g.prototype.overloadedBoolean=!1,g.prototype.property="",g.prototype.spaceSeparated=!1,g.prototype.space=void 0;let m=0;const y=C(),v=C(),b=C(),w=C(),k=C(),S=C(),x=C();function C(){return 2**++m}var O=Object.freeze({__proto__:null,boolean:y,booleanish:v,commaOrSpaceSeparated:x,commaSeparated:S,number:w,overloadedBoolean:b,spaceSeparated:k});const P=Object.keys(O);class M extends g{constructor(n,t,e,o){let l=-1;if(super(n,t),A(this,"space",o),"number"==typeof e)for(;++l<P.length;){const n=P[l];A(this,P[l],(e&O[n])===O[n])}}}function A(n,t,e){e&&(n[t]=e)}function E(n){const t={},e={};for(const[o,l]of Object.entries(n.properties)){const i=new M(o,n.transform(n.attributes||{},o),l,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(i.mustUseProperty=!0),t[o]=i,e[f(o)]=o,e[f(i.attribute)]=o}return new d(t,e,n.space)}M.prototype.defined=!0;const R=E({properties:{ariaActiveDescendant:null,ariaAtomic:v,ariaAutoComplete:null,ariaBusy:v,ariaChecked:v,ariaColCount:w,ariaColIndex:w,ariaColSpan:w,ariaControls:k,ariaCurrent:null,ariaDescribedBy:k,ariaDetails:null,ariaDisabled:v,ariaDropEffect:k,ariaErrorMessage:null,ariaExpanded:v,ariaFlowTo:k,ariaGrabbed:v,ariaHasPopup:null,ariaHidden:v,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:k,ariaLevel:w,ariaLive:null,ariaModal:v,ariaMultiLine:v,ariaMultiSelectable:v,ariaOrientation:null,ariaOwns:k,ariaPlaceholder:null,ariaPosInSet:w,ariaPressed:v,ariaReadOnly:v,ariaRelevant:null,ariaRequired:v,ariaRoleDescription:k,ariaRowCount:w,ariaRowIndex:w,ariaRowSpan:w,ariaSelected:v,ariaSetSize:w,ariaSort:null,ariaValueMax:w,ariaValueMin:w,ariaValueNow:w,ariaValueText:null,role:null},transform:(n,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function $(n,t){return t in n?n[t]:t}function D(n,t){return $(n,t.toLowerCase())}const T=E({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:S,acceptCharset:k,accessKey:k,action:null,allow:null,allowFullScreen:y,allowPaymentRequest:y,allowUserMedia:y,alt:null,as:null,async:y,autoCapitalize:null,autoComplete:k,autoFocus:y,autoPlay:y,blocking:k,capture:null,charSet:null,checked:y,cite:null,className:k,cols:w,colSpan:null,content:null,contentEditable:v,controls:y,controlsList:k,coords:w|S,crossOrigin:null,data:null,dateTime:null,decoding:null,default:y,defer:y,dir:null,dirName:null,disabled:y,download:b,draggable:v,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:y,formTarget:null,headers:k,height:w,hidden:b,high:w,href:null,hrefLang:null,htmlFor:k,httpEquiv:k,id:null,imageSizes:null,imageSrcSet:null,inert:y,inputMode:null,integrity:null,is:null,isMap:y,itemId:null,itemProp:k,itemRef:k,itemScope:y,itemType:k,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:y,low:w,manifest:null,max:null,maxLength:w,media:null,method:null,min:null,minLength:w,multiple:y,muted:y,name:null,nonce:null,noModule:y,noValidate:y,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:y,optimum:w,pattern:null,ping:k,placeholder:null,playsInline:y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:y,referrerPolicy:null,rel:k,required:y,reversed:y,rows:w,rowSpan:w,sandbox:k,scope:null,scoped:y,seamless:y,selected:y,shadowRootClonable:y,shadowRootDelegatesFocus:y,shadowRootMode:null,shape:null,size:w,sizes:null,slot:null,span:w,spellCheck:v,src:null,srcDoc:null,srcLang:null,srcSet:null,start:w,step:null,style:null,tabIndex:w,target:null,title:null,translate:null,type:null,typeMustMatch:y,useMap:null,value:v,width:w,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:k,axis:null,background:null,bgColor:null,border:w,borderColor:null,bottomMargin:w,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:y,declare:y,event:null,face:null,frame:null,frameBorder:null,hSpace:w,leftMargin:w,link:null,longDesc:null,lowSrc:null,marginHeight:w,marginWidth:w,noResize:y,noHref:y,noShade:y,noWrap:y,object:null,profile:null,prompt:null,rev:null,rightMargin:w,rules:null,scheme:null,scrolling:v,standby:null,summary:null,text:null,topMargin:w,valueType:null,version:null,vAlign:null,vLink:null,vSpace:w,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:y,disableRemotePlayback:y,prefix:null,property:null,results:w,security:null,unselectable:null},space:"html",transform:D}),L=E({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:x,accentHeight:w,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:w,amplitude:w,arabicForm:null,ascent:w,attributeName:null,attributeType:null,azimuth:w,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:w,by:null,calcMode:null,capHeight:w,className:k,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:w,diffuseConstant:w,direction:null,display:null,dur:null,divisor:w,dominantBaseline:null,download:y,dx:null,dy:null,edgeMode:null,editable:null,elevation:w,enableBackground:null,end:null,event:null,exponent:w,externalResourcesRequired:null,fill:null,fillOpacity:w,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:S,g2:S,glyphName:S,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:w,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:w,horizOriginX:w,horizOriginY:w,id:null,ideographic:w,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:w,k:w,k1:w,k2:w,k3:w,k4:w,kernelMatrix:x,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:w,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:w,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:w,overlineThickness:w,paintOrder:null,panose1:null,path:null,pathLength:w,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:k,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:w,pointsAtY:w,pointsAtZ:w,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:x,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:x,rev:x,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:x,requiredFeatures:x,requiredFonts:x,requiredFormats:x,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:w,specularExponent:w,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:w,strikethroughThickness:w,string:null,stroke:null,strokeDashArray:x,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:w,strokeOpacity:w,strokeWidth:null,style:null,surfaceScale:w,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:x,tabIndex:w,tableValues:null,target:null,targetX:w,targetY:w,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:x,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:w,underlineThickness:w,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:w,values:null,vAlphabetic:w,vMathematical:w,vectorEffect:null,vHanging:w,vIdeographic:w,version:null,vertAdvY:w,vertOriginX:w,vertOriginY:w,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:w,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$}),j=E({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(n,t)=>"xlink:"+t.slice(5).toLowerCase()}),_=E({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:D}),U=E({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(n,t)=>"xml:"+t.slice(3).toLowerCase()}),z=/[A-Z]/g,B=/-[a-z]/g,I=/^data[-\w.:]+$/i;function H(n){return"-"+n.toLowerCase()}function N(n){return n.charAt(1).toUpperCase()}const F=p([R,T,j,_,U],"html"),q=p([R,L,j,_,U],"svg"),V="_props",W=new Map;function K(n,t){const e=`${n}:${t}`;let o=W.get(e);return void 0===o&&(o=function(n,t){const e=f(t);let o=t,l=g;if(e in n.normal)return n.property[n.normal[e]];if(e.length>4&&"data"===e.slice(0,4)&&I.test(t)){if("-"===t.charAt(4)){const n=t.slice(5).replace(B,N);o="data"+n.charAt(0).toUpperCase()+n.slice(1)}else{const n=t.slice(4);if(!B.test(n)){let e=n.replace(z,H);"-"!==e.charAt(0)&&(e="-"+e),t="data"+e}}l=M}return new l(o,t)}(t?q:F,n)||null,W.set(e,o)),o}function X(n,t,e){!function(n){if(null==n||!1===n||""===n)return!1;if(!0===n)return!0;if("string"==typeof n){return"false"!==n.toLowerCase()&&"0"!==n}return Boolean(n)}(e)?n.removeAttribute(t):n.setAttribute(t,t)}function Y(n,t,e){try{n[t]=e}catch(o){Z(n,t,e,!1)}}function Z(n,t,e,o){if(null==e)return void n.removeAttribute(t);const l=String(e);if(o&&t.includes(":")){const[e]=t.split(":");"xlink"===e?n.setAttributeNS("http://www.w3.org/1999/xlink",t,l):n.setAttribute(t,l)}else n.setAttribute(t,l)}function J(n,t,e,o){if(function(n,t){if(document.activeElement===n)return["selectionStart","selectionEnd","selectionDirection"].includes(t);if("scrollTop"===t||"scrollLeft"===t)return!0;if(n instanceof HTMLMediaElement&&["currentTime","paused","playbackRate","volume"].includes(t))return!0;return!1}(n,t))return;if("style"===t){if(n.style.cssText&&(n.style.cssText=""),"string"==typeof e)n.style.cssText=e;else if(e&&"object"==typeof e)for(const t in e)n.style[t]!==e[t]&&(n.style[t]=e[t]);return}if("key"===t)return void(null!=e&&(n.key=e));if(t.startsWith("data-"))return void function(n,t,e){const o=(l=t.slice(5)).length<=1?l.toLowerCase():l.split("-").map(((n,t)=>0===t?n.toLowerCase():n.charAt(0).toUpperCase()+n.slice(1).toLowerCase())).join("");var l;null==e?delete n.dataset[o]:n.dataset[o]=String(e)}(n,t,e);if(t.startsWith("on"))return void function(n,t,e){t.startsWith("on")&&(e&&"function"!=typeof e?"string"==typeof e&&(e?n.setAttribute(t,e):n.removeAttribute(t)):n[t]=e)}(n,t,e);if(!("INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&"SELECT"!==n.tagName||"value"!==t&&"selected"!==t&&"selectedIndex"!==t))return void Y(n,t,e);if("INPUT"===n.tagName&&"checked"===t)return Y(n,t,e),void X(n,t,e);const l=K(t,o);l?l.boolean||l.overloadedBoolean?X(n,l.attribute,e):l.mustUseProperty&&!o?Y(n,l.property,e):Z(n,l.attribute,e,o):t.startsWith("aria-")||"role"===t?Z(n,t,e,o):t in n||void 0!==n[t]?Y(n,t,e):Z(n,t,e,o)}function G(n){return/^[a-zA-Z_:][\w\-:.]*$/.test(n)&&!n.includes("<")&&!n.includes(">")&&!n.includes('"')&&!n.includes("'")}function Q(n,t,e){const o=function(n,t){if(t&&(t.class=t.class||t.className,delete t.className),!n||0===Object.keys(n).length)return t||{};if(!t||0===Object.keys(t).length){const t={};return Object.keys(n).forEach((n=>t[n]=null)),t}const e={};return Object.keys(n).forEach((n=>{n in t||(e[n]=null)})),Object.keys(t).forEach((n=>e[n]=t[n])),e}(n[V]||{},t);n[V]=t||{},function(n,t,e,o){for(const e in t)G(e)&&J(n,e,t[e],o);t&&"function"==typeof t.ref&&window.requestAnimationFrame((()=>t.ref(n)))}(n,o,0,e)}function nn(n,...t){return tn(t)}function tn(n){const t=[],e=n=>{null!=n&&""!==n&&!1!==n&&t.push("function"==typeof n||"object"==typeof n?n:`${n}`)};return n&&n.forEach((n=>{Array.isArray(n)?n.forEach((n=>e(n))):e(n)})),t}const en={};let on=0;function ln(n,t,...e){const o=tn(e);if("string"==typeof n)return{tag:n,props:t,children:o};if(Array.isArray(n))return n;if(void 0===n&&e)return o;if(Object.getPrototypeOf(n).i)return{tag:n,props:t,children:o};if("function"==typeof n)return n(t,o);throw new Error(`Unknown tag in vdom ${n}`)}const sn=(n,t,e={})=>{if(null==t||!1===t)return;!function(n,t,e={}){if(null==t||!1===t)return;if(t=dn(t,e),!n)return;const o="SVG"===n.nodeName;Array.isArray(t)?an(n,t,o):an(n,[t],o)}("string"==typeof n&&n?document.getElementById(n)||document.querySelector(n):n,t=h(t,e),e)};function rn(n,t,e){e=e||"svg"===t.tag,function(n,t){const e=n.nodeName,o=`${t.tag||""}`;return e.toUpperCase()===o.toUpperCase()}(n,t)?(an(n,t.children,e),Q(n,t.props,e)):n.parentNode.replaceChild(hn(t,e),n)}function an(n,t,e){const o=n.childNodes?.length||0,l=t?.length||0,i=Math.min(o,l);for(let o=0;o<i;o++){const l=t[o],i=n.childNodes[o];if("string"==typeof l)i.textContent!==l&&(3===i.nodeType?i.nodeValue=l:n.replaceChild(cn(l),i));else if(l instanceof HTMLElement||l instanceof SVGElement)n.insertBefore(l,i);else{const t=l.props&&l.props.key;if(t)if(i.key===t)rn(n.childNodes[o],l,e);else{const s=en[t];s?(n.insertBefore(s,i),rn(n.childNodes[o],l,e)):n.replaceChild(hn(l,e),i)}else rn(n.childNodes[o],l,e)}}let s=n.childNodes?.length||0;for(;s>i;)n.removeChild(n.lastChild),s--;if(l>i){const o=document.createDocumentFragment();for(let n=i;n<t.length;n++)o.appendChild(hn(t[n],e));n.appendChild(o)}}const un=n=>{const t=document.createElement("section");return t.insertAdjacentHTML("afterbegin",n),Array.from(t.children)};function cn(n){if(0===n?.indexOf("_html:")){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",n.substring(6)),t}return document.createTextNode(n??"")}function hn(n,t){if(n instanceof HTMLElement||n instanceof SVGElement)return n;if("string"==typeof n)return cn(n);if(!n.tag||"function"==typeof n.tag)return cn(JSON.stringify(n));const e=(t=t||"svg"===n.tag)?document.createElementNS("http://www.w3.org/2000/svg",n.tag):document.createElement(n.tag);return Q(e,n.props,t),n.children&&n.children.forEach((n=>e.appendChild(hn(n,t)))),n.props&&void 0!==n.props.key&&(e.key=n.props.key,en[n.props.key]=e,++on>=500&&(!function(){if(!(Object.keys(en).length<=1e3))for(const[n,t]of Object.entries(en))t.isConnected||delete en[n]}(),on=0)),e}function dn(n,t,e=0){if("string"==typeof n)return n;if(Array.isArray(n))return n.map((n=>dn(n,t,e++)));let o=n;if(n&&"function"==typeof n.tag&&Object.getPrototypeOf(n.tag).i&&(o=function(n,t,e){const{tag:o,props:l,children:i}=n;let s=`_${e}`,r=l&&l.id;r?s=r:r=`_${e}${Date.now()}`;let a="section";l&&l.as&&(a=l.as,delete l.as),t.m||(t.m={});let u=t.m[s];if(u&&u instanceof o&&u.element)u.renderState(u.state);else{const n=document.createElement(a);u=t.m[s]=new o({...l,children:i}).mount(n,{render:!0})}if(u.mounted){const n=u.mounted(l,i,u.state);void 0!==n&&u.setState(n)}return Q(u.element,l,!1),u.element}(n,t,e)),o&&Array.isArray(o.children)){const n=o.props?._component;if(n){let t=0;o.children=o.children.map((e=>dn(e,n,t++)))}else o.children=o.children.map((n=>dn(n,t,e++)))}return o}const pn=(n,t={})=>class extends HTMLElement{constructor(){super()}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(t.observedAttributes||[]).map((n=>n.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component){const e=t||{};this._shadowRoot=e.shadow?this.attachShadow({mode:"open"}):this;const o=e.observedAttributes||[],l=o.reduce(((n,t)=>{const e=t.toLowerCase();return e!==t&&(n[e]=t),n}),{});this._attrMap=n=>l[n]||n;const i={};Array.from(this.attributes).forEach((n=>i[this._attrMap(n.name)]=n.value)),o.forEach((n=>{void 0!==this[n]&&(i[n]=this[n]),Object.defineProperty(this,n,{get:()=>i[n],set(t){this.attributeChangedCallback(n,i[n],t)},configurable:!0,enumerable:!0})})),requestAnimationFrame((()=>{const t=this.children?Array.from(this.children):[];if(this._component=new n({...i,children:t}).mount(this._shadowRoot,e),this._component._props=i,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const n=this._component.mounted(i,t,this._component.state);void 0!==n&&(this._component.state=n)}this.on=this._component.on.bind(this._component),this.run=this._component.run.bind(this._component),!1!==e.render&&this._component.run(".")}))}}disconnectedCallback(){this._component?.unload?.(),this._component?.unmount?.(),this._component=null}attributeChangedCallback(n,e,o){if(this._component){const l=this._attrMap(n);this._component._props[l]=o,this._component.run("attributeChanged",l,e,o),o!==e&&!1!==t.render&&window.requestAnimationFrame((()=>{this._component.run(".")}))}}};var fn=(n,t,e)=>{"undefined"!=typeof customElements&&customElements.define(n,pn(t,e))};const gn={meta:new WeakMap,defineMetadata(n,t,e){this.meta.has(e)||this.meta.set(e,{}),this.meta.get(e)[n]=t},getMetadataKeys(n){return n=Object.getPrototypeOf(n),this.meta.get(n)?Object.keys(this.meta.get(n)):[]},getMetadata(n,t){return t=Object.getPrototypeOf(t),this.meta.get(t)?this.meta.get(t)[n]:null}};const mn=n=>n,yn=s;class vn{renderState(n,t=null){if(!this.view)return;let e=t||this.view(n);if(yn.debug&&yn.run("debug",{component:this,_:e?".":"-",state:n,vdom:e,el:this.element}),"object"!=typeof document)return;const o="string"==typeof this.element&&this.element?function(n){try{return document.getElementById(n)}catch(t){return console.warn(`Error getting element by id: ${n}`,t),null}}(this.element)||function(n,t=document){try{return t.querySelector(n)}catch(t){return console.warn(`Invalid selector: ${n}`,t),null}}(this.element):this.element;if(!o)return void console.warn(`Component element not found: ${this.element}`);const l="_c";this.unload?o._component===this&&o.getAttribute(l)===this.tracking_id||(this.tracking_id=(new Date).valueOf().toString(),o.setAttribute(l,this.tracking_id),"undefined"!=typeof MutationObserver&&(this.observer||(this.observer=new MutationObserver((n=>{n[0].oldValue!==this.tracking_id&&document.body.contains(o)||(this.unload(this.state),this.observer.disconnect(),this.observer=null)}))),this.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[l]}))):o.removeAttribute&&o.removeAttribute(l),o._component=this,!t&&e&&(e=h(e,this),this.options.transition&&document&&document.startViewTransition?document.startViewTransition((()=>yn.render(o,e,this))):yn.render(o,e,this)),this.rendered&&this.rendered(this.state)}setState(n,t={render:!0,history:!1}){const e=async n=>{try{for(;;){const{value:e,done:o}=await n.next();if(o)break;this.setState(e,t)}}catch(n){console.error("Error in async iterator:",n)}},o=n;if(o?.[Symbol.asyncIterator])this.setState(e(o[Symbol.asyncIterator]()),t);else if(o?.[Symbol.iterator]&&"function"==typeof o.next)for(const n of o)this.setState(n,t);else if(n&&n instanceof Promise)Promise.resolve(n).then((e=>{this.setState(e,t),this._state=n}));else{if(this._state=n,null==n)return;this.state=n,!1!==t.render&&(t.transition&&document&&document.startViewTransition?document.startViewTransition((()=>this.renderState(n))):this.renderState(n)),!1!==t.history&&this.enable_history&&(this._history=[...this._history,n],this._history_idx=this._history.length-1),"function"==typeof t.callback&&t.callback(this.state)}}constructor(n,t,o,l){this.state=n,this.view=t,this.update=o,this.options=l,this._app=new e,this._actions=[],this._global_events=[],this._history=[],this._history_idx=-1,this._history_prev=()=>{this._history_idx--,this._history_idx>=0?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=0},this._history_next=()=>{this._history_idx++,this._history_idx<this._history.length?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=this._history.length-1},this.start=(n=null,t)=>{if(this.mount(n,{render:!0,...t}),this.mounted&&"function"==typeof this.mounted){const n=this.mounted({},[],this.state);void 0!==n&&this.setState(n)}return this}}mount(n=null,t){return console.assert(!this.element,"Component already mounted."),this.options=t={...this.options,...t},this.element=n,this.global_event=t.global_event,this.enable_history=!!t.history,this.enable_history&&(this.on(t.history.prev||"history-prev",this._history_prev),this.on(t.history.next||"history-next",this._history_next)),t.route&&(this.update=this.update||{},this.update[t.route]||(this.update[t.route]=mn)),this.add_actions(),this.state=this.state??this.model??{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!t.render,history:!0}),yn.debug&&yn.find("debug-create-component")?.length&&yn.run("debug-create-component",this),this}is_global_event(n){return n&&(this.global_event||this._global_events.indexOf(n)>=0||n.startsWith("#")||n.startsWith("/")||n.startsWith("@"))}add_action(n,t,e={}){t&&"function"==typeof t?(e.global&&this._global_events.push(n),this.on(n,((...o)=>{yn.debug&&yn.run("debug",{component:this,_:">",event:n,p:o,current_state:this.state,options:e});try{const l=t(this.state,...o);yn.debug&&yn.run("debug",{component:this,_:"<",event:n,p:o,newState:l,state:this.state,options:e}),this.setState(l,e)}catch(t){console.error(`Error in component action '${n}':`,t),yn.debug&&yn.run("debug",{component:this,_:"!",event:n,p:o,error:t,state:this.state,options:e})}}),e)):console.warn(`Component action for '${n}' is not a valid function:`,t)}add_actions(){const n=this.update||{};gn.getMetadataKeys(this).forEach((t=>{if(t.startsWith("apprun-update:")){const e=gn.getMetadata(t,this);n[e.name]=[this[e.key].bind(this),e.options]}}));const t={};Array.isArray(n)?n.forEach((n=>{const[e,o,l]=n;e.toString().split(",").forEach((n=>t[n.trim()]=[o,l]))})):Object.keys(n).forEach((e=>{const o=n[e];("function"==typeof o||Array.isArray(o))&&e.split(",").forEach((n=>t[n.trim()]=o))})),t["."]||(t["."]=mn),Object.keys(t).forEach((n=>{const e=t[n];"function"==typeof e?this.add_action(n,e):Array.isArray(e)&&this.add_action(n,e[0],e[1])}))}run(n,...t){if(this.state instanceof Promise)return Promise.resolve(this.state).then((e=>{this.state=e,this.run(n,...t)}));{const e=n.toString();return this.is_global_event(e)?yn.run(e,...t):this._app.run(e,...t)}}on(n,t,e){const o=n.toString();return this._actions.push({name:o,fn:t}),this.is_global_event(o)?yn.on(o,t,e):this._app.on(o,t,e)}runAsync(n,...t){const e=n.toString();return this.is_global_event(e)?yn.runAsync(e,...t):this._app.runAsync(e,...t)}query(n,...t){return console.warn("component.query() is deprecated. Use component.runAsync() instead."),this.runAsync(n,...t)}unmount(){this.observer?.disconnect(),this._actions.forEach((n=>{const{name:t,fn:e}=n;this.is_global_event(t)?yn.off(t,e):this._app.off(t,e)}))}}function bn(){const n=s.find("#");if(n&&n.length>0)return s.run("#"),void s.run(Sn,"#");const t=s.find("/");if(t&&t.length>0)return s.run("/"),void s.run(Sn,"/");const e=s.find("#/");if(e&&e.length>0)return s.run("#/"),void s.run(Sn,"#/");console.warn("No subscribers for event: "),s.run(xn,""),s.run(Sn,"")}function wn(n){if(!n)return void bn();n=function(n){return n&&"/"!==n&&"#"!==n&&"#/"!==n&&n.endsWith("/")?n.slice(0,-1):n}(n);const t=s.basePath;t&&(n=function(n,t){if(!t||"/"===t||""===t)return n;const e=t.startsWith("/")?t:"/"+t;if(n.startsWith(e)){const t=n.substring(e.length);return t.startsWith("/")?t:"/"+t}return n}(n,t));const e=function(n){return n?n.startsWith("#/")?n.substring(2).split("/"):n.startsWith("#")||n.startsWith("/")?n.substring(1).split("/"):n.split("/"):[]}(n);let o;!function(n){const t=n.filter(Boolean);t.length>11&&console.warn(`Deep route hierarchy detected: ${t.join("/")} (${t.length} levels)`)}(e),o=n.startsWith("#/")?"hash-slash":n.startsWith("#")?"hash":n.startsWith("/")?"path":"non-prefixed";const l=function(n,t){const e=[];for(let o=n.length;o>0;o--){const l=n.slice(0,o);let i="";switch(t){case"path":i="/"+l.join("/");break;case"hash":i="#"+l.join("/");break;case"hash-slash":i="#/"+l.join("/");break;case"non-prefixed":i=l.join("/")}e.push(i)}return e}(e,o),i=function(n,t){for(let e=0;e<n.length;e++){const o=n[e],l=s.find(o);if(l&&l.length>0){const l=n.length-e;return{eventName:o,parameters:t.slice(l)}}}return null}(l,e);if(i)kn(i.eventName,...i.parameters);else if(l.length>0){const t=l[l.length-1];console.warn(`No subscribers for event: ${t}`),s.run(xn,n),s.run(Sn,n)}else bn()}vn.i=!0;const kn=(n,...t)=>{if(!n||n===Sn||n===xn)return;const e=s.find(n);e&&0!==e.length?s.run(n,...t):(console.warn(`No subscribers for event: ${n}`),s.run(xn,n,...t)),s.run(Sn,n,...t)},Sn="//",xn="///",Cn=n=>{s.lastUrl!==n&&(s.lastUrl=n,wn(n))};function On(n){return n&&"object"==typeof n&&"function"==typeof n.mount}function Pn(n){return"function"==typeof n&&n.prototype&&n.prototype.constructor===n&&(void 0!==n.prototype.mount||void 0!==n.prototype.state||void 0!==n.prototype.view)}function Mn(n){return"function"==typeof n&&!Pn(n)}async function An(n,t=3){let e=n,o=0;for(;Mn(e)&&o<t;)try{const n=await e();if(n===e)break;e=n,o++}catch(n){console.error(`Error executing component function: ${n}`);break}return e}const En=s;if(!En.start){En.version=n,En.h=En.createElement=ln,En.render=sn,En.Fragment=nn,En.webComponent=fn,En.safeHTML=un,En.start=(n,t,e,o,l)=>{const i={render:!0,global_event:!0,...l},s=new vn(t,e,o);return l&&l.rendered&&(s.rendered=l.rendered),l&&l.mounted&&(s.mounted=l.mounted),s.start(n,i),s},En.query=En.query||En.runAsync;const t=n=>{};if(En.on("/",t),En.on("debug",(n=>t)),En.on(Sn,t),En.on(xn,t),En.route=Cn,En.on("route",(n=>En.route&&En.route(n))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{const n=document.body.hasAttribute("apprun-no-init")||En["no-init-route"]||!1,t=En.find("#")||En.find("#/")||!1;window.addEventListener("hashchange",(()=>Cn(location.hash))),window.addEventListener("popstate",(()=>Cn(location.pathname))),t?!n&&Cn(location.hash):(!n&&(()=>{const n=En.basePath||"";let t=location.pathname;n&&t.startsWith(n)&&(t=t.substring(n.length),t.startsWith("/")||(t="/"+t)),Cn(t)})(),document.body.addEventListener("click",(n=>{const t=n.target;if(!t)return;const e="A"===t.tagName?t:t.closest("a");if(e&&e.origin===location.origin&&e.pathname){n.preventDefault();const t=(En.basePath||"")+e.pathname;history.pushState(null,"",t),Cn(e.pathname)}})))})),"object"==typeof window){const n=window;n.Component=vn,n._React=n.React,n.React=En,n.on=function(n,t={}){return function(e,o){const l=n?n.toString():o;gn.defineMetadata(`apprun-update:${l}`,{name:l,key:o,options:t},e)}},n.customElement=function(n,t){return function(e){return fn(n,e,t),e}},n.safeHTML=un}En.use_render=(n,t=0)=>{En.render=0===t?(t,e)=>n(e,t):(t,e)=>n(t,e)},En.use_react=(n,t)=>{if(n&&t)if("function"==typeof n.createElement)if(n.Fragment)if(En.h=En.createElement=n.createElement,En.Fragment=n.Fragment,n.version&&n.version.startsWith("18")){if(!t.createRoot||"function"!=typeof t.createRoot)return void console.error("AppRun use_react: ReactDOM.createRoot not found in React 18+");En.render=(n,e)=>{n&&void 0!==e&&(n._root||(n._root=t.createRoot(n)),n._root.render(e))}}else{if(!t.render||"function"!=typeof t.render)return void console.error("AppRun use_react: ReactDOM.render not found in legacy React");En.render=(n,e)=>t.render(e,n)}else console.error("AppRun use_react: Invalid React object - Fragment not found");else console.error("AppRun use_react: Invalid React object - createElement method not found");else console.error("AppRun use_react: React and ReactDOM parameters are required")},En.addComponents=async(n,t)=>{for(const[e,o]of Object.entries(t))if(o&&e)if(On(o)){const t={route:e};o.mount(n,t)}else if(Pn(o)){const t={route:e};(new o).mount(n,t)}else if(Mn(o)){let t=await An(o);if(On(t)){const o={route:e};t.mount(n,o);continue}if(Pn(t)){const o={route:e};(new t).mount(n,o);continue}s.on(e,((...t)=>{const e=o(...t);if("string"!=typeof n||(n=document.querySelector(n)))return s.render(n,e);console.error(`Element not found: ${n}`)}))}else console.error("Invalid component: component must be a class, instance, or function that returns a class/instance");else console.error(`Invalid component configuration: component=${o}, route=${e}`)}}
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2019 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const En=globalThis,Rn=En.ShadowRoot&&(void 0===En.ShadyCSS||En.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$n=Symbol(),Dn=new WeakMap;let Tn=class{constructor(n,t,e){if(this._$cssResult$=!0,e!==$n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=t}get styleSheet(){let n=this.o;const t=this.t;if(Rn&&void 0===n){const e=void 0!==t&&1===t.length;e&&(n=Dn.get(t)),void 0===n&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),e&&Dn.set(t,n))}return n}toString(){return this.cssText}};const Ln=Rn?n=>n:n=>n instanceof CSSStyleSheet?(n=>{let t="";for(const e of n.cssRules)t+=e.cssText;return(n=>new Tn("string"==typeof n?n:n+"",void 0,$n))(t)})(n):n
6
+ */const Rn=globalThis,$n=Rn.ShadowRoot&&(void 0===Rn.ShadyCSS||Rn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Dn=Symbol(),Tn=new WeakMap;let Ln=class{constructor(n,t,e){if(this._$cssResult$=!0,e!==Dn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=t}get styleSheet(){let n=this.o;const t=this.t;if($n&&void 0===n){const e=void 0!==t&&1===t.length;e&&(n=Tn.get(t)),void 0===n&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),e&&Tn.set(t,n))}return n}toString(){return this.cssText}};const jn=$n?n=>n:n=>n instanceof CSSStyleSheet?(n=>{let t="";for(const e of n.cssRules)t+=e.cssText;return(n=>new Ln("string"==typeof n?n:n+"",void 0,Dn))(t)})(n):n
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */,{is:jn,defineProperty:_n,getOwnPropertyDescriptor:Un,getOwnPropertyNames:zn,getOwnPropertySymbols:Bn,getPrototypeOf:In}=Object,Hn=globalThis,Nn=Hn.trustedTypes,Fn=Nn?Nn.emptyScript:"",qn=Hn.reactiveElementPolyfillSupport,Vn=(n,t)=>n,Wn={toAttribute(n,t){switch(t){case Boolean:n=n?Fn:null;break;case Object:case Array:n=null==n?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=null!==n;break;case Number:e=null===n?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch(n){e=null}}return e}},Kn=(n,t)=>!jn(n,t),Xn={attribute:!0,type:String,converter:Wn,reflect:!1,useDefault:!1,hasChanged:Kn};Symbol.metadata??=Symbol("metadata"),Hn.litPropertyMetadata??=new WeakMap;let Yn=class extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,t=Xn){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(n)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(n,t),!t.noAccessor){const e=Symbol(),o=this.getPropertyDescriptor(n,e,t);void 0!==o&&_n(this.prototype,n,o)}}static getPropertyDescriptor(n,t,e){const{get:o,set:l}=Un(this.prototype,n)??{get(){return this[t]},set(n){this[t]=n}};return{get:o,set(t){const i=o?.call(this);l?.call(this,t),this.requestUpdate(n,i,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??Xn}static _$Ei(){if(this.hasOwnProperty(Vn("elementProperties")))return;const n=In(this);n.finalize(),void 0!==n.l&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(Vn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Vn("properties"))){const n=this.properties,t=[...zn(n),...Bn(n)];for(const e of t)this.createProperty(e,n[e])}const n=this[Symbol.metadata];if(null!==n){const t=litPropertyMetadata.get(n);if(void 0!==t)for(const[n,e]of t)this.elementProperties.set(n,e)}this._$Eh=new Map;for(const[n,t]of this.elementProperties){const e=this._$Eu(n,t);void 0!==e&&this._$Eh.set(e,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(n){const t=[];if(Array.isArray(n)){const e=new Set(n.flat(1/0).reverse());for(const n of e)t.unshift(Ln(n))}else void 0!==n&&t.push(Ln(n));return t}static _$Eu(n,t){const e=t.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof n?n.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((n=>this.enableUpdating=n)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((n=>n(this)))}addController(n){(this._$EO??=new Set).add(n),void 0!==this.renderRoot&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){const n=new Map,t=this.constructor.elementProperties;for(const e of t.keys())this.hasOwnProperty(e)&&(n.set(e,this[e]),delete this[e]);n.size>0&&(this._$Ep=n)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,t)=>{if(Rn)n.adoptedStyleSheets=t.map((n=>n instanceof CSSStyleSheet?n:n.styleSheet));else for(const e of t){const t=document.createElement("style"),o=En.litNonce;void 0!==o&&t.setAttribute("nonce",o),t.textContent=e.cssText,n.appendChild(t)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((n=>n.hostConnected?.()))}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach((n=>n.hostDisconnected?.()))}attributeChangedCallback(n,t,e){this._$AK(n,e)}_$ET(n,t){const e=this.constructor.elementProperties.get(n),o=this.constructor._$Eu(n,e);if(void 0!==o&&!0===e.reflect){const l=(void 0!==e.converter?.toAttribute?e.converter:Wn).toAttribute(t,e.type);this._$Em=n,null==l?this.removeAttribute(o):this.setAttribute(o,l),this._$Em=null}}_$AK(n,t){const e=this.constructor,o=e._$Eh.get(n);if(void 0!==o&&this._$Em!==o){const n=e.getPropertyOptions(o),l="function"==typeof n.converter?{fromAttribute:n.converter}:void 0!==n.converter?.fromAttribute?n.converter:Wn;this._$Em=o,this[o]=l.fromAttribute(t,n.type)??this._$Ej?.get(o)??null,this._$Em=null}}requestUpdate(n,t,e){if(void 0!==n){const o=this.constructor,l=this[n];if(e??=o.getPropertyOptions(n),!((e.hasChanged??Kn)(l,t)||e.useDefault&&e.reflect&&l===this._$Ej?.get(n)&&!this.hasAttribute(o._$Eu(n,e))))return;this.C(n,t,e)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(n,t,{useDefault:e,reflect:o,wrapped:l},i){e&&!(this._$Ej??=new Map).has(n)&&(this._$Ej.set(n,i??t??this[n]),!0!==l||void 0!==i)||(this._$AL.has(n)||(this.hasUpdated||e||(t=void 0),this._$AL.set(n,t)),!0===o&&this._$Em!==n&&(this._$Eq??=new Set).add(n))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const n=this.scheduleUpdate();return null!=n&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[n,t]of this._$Ep)this[n]=t;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[t,e]of n){const{wrapped:n}=e,o=this[t];!0!==n||this._$AL.has(t)||void 0===o||this.C(t,void 0,e,o)}}let n=!1;const t=this._$AL;try{n=this.shouldUpdate(t),n?(this.willUpdate(t),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw n=!1,this._$EM(),t}n&&this._$AE(t)}willUpdate(n){}_$AE(n){this._$EO?.forEach((n=>n.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Eq&&=this._$Eq.forEach((n=>this._$ET(n,this[n]))),this._$EM()}updated(n){}firstUpdated(n){}};Yn.elementStyles=[],Yn.shadowRootOptions={mode:"open"},Yn[Vn("elementProperties")]=new Map,Yn[Vn("finalized")]=new Map,qn?.({ReactiveElement:Yn}),(Hn.reactiveElementVersions??=[]).push("2.1.0");
11
+ */,{is:_n,defineProperty:Un,getOwnPropertyDescriptor:zn,getOwnPropertyNames:Bn,getOwnPropertySymbols:In,getPrototypeOf:Hn}=Object,Nn=globalThis,Fn=Nn.trustedTypes,qn=Fn?Fn.emptyScript:"",Vn=Nn.reactiveElementPolyfillSupport,Wn=(n,t)=>n,Kn={toAttribute(n,t){switch(t){case Boolean:n=n?qn:null;break;case Object:case Array:n=null==n?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=null!==n;break;case Number:e=null===n?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch(n){e=null}}return e}},Xn=(n,t)=>!_n(n,t),Yn={attribute:!0,type:String,converter:Kn,reflect:!1,useDefault:!1,hasChanged:Xn};Symbol.metadata??=Symbol("metadata"),Nn.litPropertyMetadata??=new WeakMap;let Zn=class extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,t=Yn){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(n)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(n,t),!t.noAccessor){const e=Symbol(),o=this.getPropertyDescriptor(n,e,t);void 0!==o&&Un(this.prototype,n,o)}}static getPropertyDescriptor(n,t,e){const{get:o,set:l}=zn(this.prototype,n)??{get(){return this[t]},set(n){this[t]=n}};return{get:o,set(t){const i=o?.call(this);l?.call(this,t),this.requestUpdate(n,i,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??Yn}static _$Ei(){if(this.hasOwnProperty(Wn("elementProperties")))return;const n=Hn(this);n.finalize(),void 0!==n.l&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(Wn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Wn("properties"))){const n=this.properties,t=[...Bn(n),...In(n)];for(const e of t)this.createProperty(e,n[e])}const n=this[Symbol.metadata];if(null!==n){const t=litPropertyMetadata.get(n);if(void 0!==t)for(const[n,e]of t)this.elementProperties.set(n,e)}this._$Eh=new Map;for(const[n,t]of this.elementProperties){const e=this._$Eu(n,t);void 0!==e&&this._$Eh.set(e,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(n){const t=[];if(Array.isArray(n)){const e=new Set(n.flat(1/0).reverse());for(const n of e)t.unshift(jn(n))}else void 0!==n&&t.push(jn(n));return t}static _$Eu(n,t){const e=t.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof n?n.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((n=>this.enableUpdating=n)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((n=>n(this)))}addController(n){(this._$EO??=new Set).add(n),void 0!==this.renderRoot&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){const n=new Map,t=this.constructor.elementProperties;for(const e of t.keys())this.hasOwnProperty(e)&&(n.set(e,this[e]),delete this[e]);n.size>0&&(this._$Ep=n)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((n,t)=>{if($n)n.adoptedStyleSheets=t.map((n=>n instanceof CSSStyleSheet?n:n.styleSheet));else for(const e of t){const t=document.createElement("style"),o=Rn.litNonce;void 0!==o&&t.setAttribute("nonce",o),t.textContent=e.cssText,n.appendChild(t)}})(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((n=>n.hostConnected?.()))}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach((n=>n.hostDisconnected?.()))}attributeChangedCallback(n,t,e){this._$AK(n,e)}_$ET(n,t){const e=this.constructor.elementProperties.get(n),o=this.constructor._$Eu(n,e);if(void 0!==o&&!0===e.reflect){const l=(void 0!==e.converter?.toAttribute?e.converter:Kn).toAttribute(t,e.type);this._$Em=n,null==l?this.removeAttribute(o):this.setAttribute(o,l),this._$Em=null}}_$AK(n,t){const e=this.constructor,o=e._$Eh.get(n);if(void 0!==o&&this._$Em!==o){const n=e.getPropertyOptions(o),l="function"==typeof n.converter?{fromAttribute:n.converter}:void 0!==n.converter?.fromAttribute?n.converter:Kn;this._$Em=o,this[o]=l.fromAttribute(t,n.type)??this._$Ej?.get(o)??null,this._$Em=null}}requestUpdate(n,t,e){if(void 0!==n){const o=this.constructor,l=this[n];if(e??=o.getPropertyOptions(n),!((e.hasChanged??Xn)(l,t)||e.useDefault&&e.reflect&&l===this._$Ej?.get(n)&&!this.hasAttribute(o._$Eu(n,e))))return;this.C(n,t,e)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(n,t,{useDefault:e,reflect:o,wrapped:l},i){e&&!(this._$Ej??=new Map).has(n)&&(this._$Ej.set(n,i??t??this[n]),!0!==l||void 0!==i)||(this._$AL.has(n)||(this.hasUpdated||e||(t=void 0),this._$AL.set(n,t)),!0===o&&this._$Em!==n&&(this._$Eq??=new Set).add(n))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const n=this.scheduleUpdate();return null!=n&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[n,t]of this._$Ep)this[n]=t;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[t,e]of n){const{wrapped:n}=e,o=this[t];!0!==n||this._$AL.has(t)||void 0===o||this.C(t,void 0,e,o)}}let n=!1;const t=this._$AL;try{n=this.shouldUpdate(t),n?(this.willUpdate(t),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw n=!1,this._$EM(),t}n&&this._$AE(t)}willUpdate(n){}_$AE(n){this._$EO?.forEach((n=>n.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Eq&&=this._$Eq.forEach((n=>this._$ET(n,this[n]))),this._$EM()}updated(n){}firstUpdated(n){}};Zn.elementStyles=[],Zn.shadowRootOptions={mode:"open"},Zn[Wn("elementProperties")]=new Map,Zn[Wn("finalized")]=new Map,Vn?.({ReactiveElement:Zn}),(Nn.reactiveElementVersions??=[]).push("2.1.0");
12
12
  /**
13
13
  * @license
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- const Zn=globalThis,Jn=Zn.trustedTypes,Gn=Jn?Jn.createPolicy("lit-html",{createHTML:n=>n}):void 0,Qn="$lit$",nt=`lit$${Math.random().toFixed(9).slice(2)}$`,tt="?"+nt,et=`<${tt}>`,ot=document,lt=()=>ot.createComment(""),it=n=>null===n||"object"!=typeof n&&"function"!=typeof n,st=Array.isArray,rt="[ \t\n\f\r]",at=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ut=/-->/g,ct=/>/g,ht=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),dt=/'/g,pt=/"/g,ft=/^(?:script|style|textarea|title)$/i,gt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),mt=gt(1),yt=gt(2),vt=Symbol.for("lit-noChange"),bt=Symbol.for("lit-nothing"),wt=new WeakMap,kt=ot.createTreeWalker(ot,129);function St(n,t){if(!st(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Gn?Gn.createHTML(t):t}const xt=(n,t)=>{const e=n.length-1,o=[];let l,i=2===t?"<svg>":3===t?"<math>":"",s=at;for(let t=0;t<e;t++){const e=n[t];let r,a,u=-1,c=0;for(;c<e.length&&(s.lastIndex=c,a=s.exec(e),null!==a);)c=s.lastIndex,s===at?"!--"===a[1]?s=ut:void 0!==a[1]?s=ct:void 0!==a[2]?(ft.test(a[2])&&(l=RegExp("</"+a[2],"g")),s=ht):void 0!==a[3]&&(s=ht):s===ht?">"===a[0]?(s=l??at,u=-1):void 0===a[1]?u=-2:(u=s.lastIndex-a[2].length,r=a[1],s=void 0===a[3]?ht:'"'===a[3]?pt:dt):s===pt||s===dt?s=ht:s===ut||s===ct?s=at:(s=ht,l=void 0);const h=s===ht&&n[t+1].startsWith("/>")?" ":"";i+=s===at?e+et:u>=0?(o.push(r),e.slice(0,u)+Qn+e.slice(u)+nt+h):e+nt+(-2===u?t:h)}return[St(n,i+(n[e]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]};class Ct{constructor({strings:n,_$litType$:t},e){let o;this.parts=[];let l=0,i=0;const s=n.length-1,r=this.parts,[a,u]=xt(n,t);if(this.el=Ct.createElement(a,e),kt.currentNode=this.el.content,2===t||3===t){const n=this.el.content.firstChild;n.replaceWith(...n.childNodes)}for(;null!==(o=kt.nextNode())&&r.length<s;){if(1===o.nodeType){if(o.hasAttributes())for(const n of o.getAttributeNames())if(n.endsWith(Qn)){const t=u[i++],e=o.getAttribute(n).split(nt),s=/([.?@])?(.*)/.exec(t);r.push({type:1,index:l,name:s[2],strings:e,ctor:"."===s[1]?Et:"?"===s[1]?Rt:"@"===s[1]?$t:At}),o.removeAttribute(n)}else n.startsWith(nt)&&(r.push({type:6,index:l}),o.removeAttribute(n));if(ft.test(o.tagName)){const n=o.textContent.split(nt),t=n.length-1;if(t>0){o.textContent=Jn?Jn.emptyScript:"";for(let e=0;e<t;e++)o.append(n[e],lt()),kt.nextNode(),r.push({type:2,index:++l});o.append(n[t],lt())}}}else if(8===o.nodeType)if(o.data===tt)r.push({type:2,index:l});else{let n=-1;for(;-1!==(n=o.data.indexOf(nt,n+1));)r.push({type:7,index:l}),n+=nt.length-1}l++}}static createElement(n,t){const e=ot.createElement("template");return e.innerHTML=n,e}}function Ot(n,t,e=n,o){if(t===vt)return t;let l=void 0!==o?e._$Co?.[o]:e._$Cl;const i=it(t)?void 0:t._$litDirective$;return l?.constructor!==i&&(l?._$AO?.(!1),void 0===i?l=void 0:(l=new i(n),l._$AT(n,e,o)),void 0!==o?(e._$Co??=[])[o]=l:e._$Cl=l),void 0!==l&&(t=Ot(n,l._$AS(n,t.values),l,o)),t}class Pt{constructor(n,t){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){const{el:{content:t},parts:e}=this._$AD,o=(n?.creationScope??ot).importNode(t,!0);kt.currentNode=o;let l=kt.nextNode(),i=0,s=0,r=e[0];for(;void 0!==r;){if(i===r.index){let t;2===r.type?t=new Mt(l,l.nextSibling,this,n):1===r.type?t=new r.ctor(l,r.name,r.strings,this,n):6===r.type&&(t=new Dt(l,this,n)),this._$AV.push(t),r=e[++s]}i!==r?.index&&(l=kt.nextNode(),i++)}return kt.currentNode=ot,o}p(n){let t=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(n,e,t),t+=e.strings.length-2):e._$AI(n[t])),t++}}class Mt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(n,t,e,o){this.type=2,this._$AH=bt,this._$AN=void 0,this._$AA=n,this._$AB=t,this._$AM=e,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let n=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===n?.nodeType&&(n=t.parentNode),n}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(n,t=this){n=Ot(this,n,t),it(n)?n===bt||null==n||""===n?(this._$AH!==bt&&this._$AR(),this._$AH=bt):n!==this._$AH&&n!==vt&&this._(n):void 0!==n._$litType$?this.$(n):void 0!==n.nodeType?this.T(n):(n=>st(n)||"function"==typeof n?.[Symbol.iterator])(n)?this.k(n):this._(n)}O(n){return this._$AA.parentNode.insertBefore(n,this._$AB)}T(n){this._$AH!==n&&(this._$AR(),this._$AH=this.O(n))}_(n){this._$AH!==bt&&it(this._$AH)?this._$AA.nextSibling.data=n:this.T(ot.createTextNode(n)),this._$AH=n}$(n){const{values:t,_$litType$:e}=n,o="number"==typeof e?this._$AC(n):(void 0===e.el&&(e.el=Ct.createElement(St(e.h,e.h[0]),this.options)),e);if(this._$AH?._$AD===o)this._$AH.p(t);else{const n=new Pt(o,this),e=n.u(this.options);n.p(t),this.T(e),this._$AH=n}}_$AC(n){let t=wt.get(n.strings);return void 0===t&&wt.set(n.strings,t=new Ct(n)),t}k(n){st(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let e,o=0;for(const l of n)o===t.length?t.push(e=new Mt(this.O(lt()),this.O(lt()),this,this.options)):e=t[o],e._$AI(l),o++;o<t.length&&(this._$AR(e&&e._$AB.nextSibling,o),t.length=o)}_$AR(n=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);n&&n!==this._$AB;){const t=n.nextSibling;n.remove(),n=t}}setConnected(n){void 0===this._$AM&&(this._$Cv=n,this._$AP?.(n))}}class At{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,t,e,o,l){this.type=1,this._$AH=bt,this._$AN=void 0,this.element=n,this.name=t,this._$AM=o,this.options=l,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=bt}_$AI(n,t=this,e,o){const l=this.strings;let i=!1;if(void 0===l)n=Ot(this,n,t,0),i=!it(n)||n!==this._$AH&&n!==vt,i&&(this._$AH=n);else{const o=n;let s,r;for(n=l[0],s=0;s<l.length-1;s++)r=Ot(this,o[e+s],t,s),r===vt&&(r=this._$AH[s]),i||=!it(r)||r!==this._$AH[s],r===bt?n=bt:n!==bt&&(n+=(r??"")+l[s+1]),this._$AH[s]=r}i&&!o&&this.j(n)}j(n){n===bt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}}class Et extends At{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===bt?void 0:n}}class Rt extends At{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==bt)}}class $t extends At{constructor(n,t,e,o,l){super(n,t,e,o,l),this.type=5}_$AI(n,t=this){if((n=Ot(this,n,t,0)??bt)===vt)return;const e=this._$AH,o=n===bt&&e!==bt||n.capture!==e.capture||n.once!==e.once||n.passive!==e.passive,l=n!==bt&&(e===bt||o);o&&this.element.removeEventListener(this.name,this,e),l&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,n):this._$AH.handleEvent(n)}}class Dt{constructor(n,t,e){this.element=n,this.type=6,this._$AN=void 0,this._$AM=t,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(n){Ot(this,n)}}const Tt=Zn.litHtmlPolyfillSupport;Tt?.(Ct,Mt),(Zn.litHtmlVersions??=[]).push("3.3.0");const Lt=(n,t,e)=>{const o=e?.renderBefore??t;let l=o._$litPart$;if(void 0===l){const n=e?.renderBefore??null;o._$litPart$=l=new Mt(t.insertBefore(lt(),n),n,void 0,e??{})}return l._$AI(n),l
17
+ const Jn=globalThis,Gn=Jn.trustedTypes,Qn=Gn?Gn.createPolicy("lit-html",{createHTML:n=>n}):void 0,nt="$lit$",tt=`lit$${Math.random().toFixed(9).slice(2)}$`,et="?"+tt,ot=`<${et}>`,lt=document,it=()=>lt.createComment(""),st=n=>null===n||"object"!=typeof n&&"function"!=typeof n,rt=Array.isArray,at="[ \t\n\f\r]",ut=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ct=/-->/g,ht=/>/g,dt=RegExp(`>|${at}(?:([^\\s"'>=/]+)(${at}*=${at}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),pt=/'/g,ft=/"/g,gt=/^(?:script|style|textarea|title)$/i,mt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),yt=mt(1),vt=mt(2),bt=Symbol.for("lit-noChange"),wt=Symbol.for("lit-nothing"),kt=new WeakMap,St=lt.createTreeWalker(lt,129);function xt(n,t){if(!rt(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Qn?Qn.createHTML(t):t}const Ct=(n,t)=>{const e=n.length-1,o=[];let l,i=2===t?"<svg>":3===t?"<math>":"",s=ut;for(let t=0;t<e;t++){const e=n[t];let r,a,u=-1,c=0;for(;c<e.length&&(s.lastIndex=c,a=s.exec(e),null!==a);)c=s.lastIndex,s===ut?"!--"===a[1]?s=ct:void 0!==a[1]?s=ht:void 0!==a[2]?(gt.test(a[2])&&(l=RegExp("</"+a[2],"g")),s=dt):void 0!==a[3]&&(s=dt):s===dt?">"===a[0]?(s=l??ut,u=-1):void 0===a[1]?u=-2:(u=s.lastIndex-a[2].length,r=a[1],s=void 0===a[3]?dt:'"'===a[3]?ft:pt):s===ft||s===pt?s=dt:s===ct||s===ht?s=ut:(s=dt,l=void 0);const h=s===dt&&n[t+1].startsWith("/>")?" ":"";i+=s===ut?e+ot:u>=0?(o.push(r),e.slice(0,u)+nt+e.slice(u)+tt+h):e+tt+(-2===u?t:h)}return[xt(n,i+(n[e]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),o]};class Ot{constructor({strings:n,_$litType$:t},e){let o;this.parts=[];let l=0,i=0;const s=n.length-1,r=this.parts,[a,u]=Ct(n,t);if(this.el=Ot.createElement(a,e),St.currentNode=this.el.content,2===t||3===t){const n=this.el.content.firstChild;n.replaceWith(...n.childNodes)}for(;null!==(o=St.nextNode())&&r.length<s;){if(1===o.nodeType){if(o.hasAttributes())for(const n of o.getAttributeNames())if(n.endsWith(nt)){const t=u[i++],e=o.getAttribute(n).split(tt),s=/([.?@])?(.*)/.exec(t);r.push({type:1,index:l,name:s[2],strings:e,ctor:"."===s[1]?Rt:"?"===s[1]?$t:"@"===s[1]?Dt:Et}),o.removeAttribute(n)}else n.startsWith(tt)&&(r.push({type:6,index:l}),o.removeAttribute(n));if(gt.test(o.tagName)){const n=o.textContent.split(tt),t=n.length-1;if(t>0){o.textContent=Gn?Gn.emptyScript:"";for(let e=0;e<t;e++)o.append(n[e],it()),St.nextNode(),r.push({type:2,index:++l});o.append(n[t],it())}}}else if(8===o.nodeType)if(o.data===et)r.push({type:2,index:l});else{let n=-1;for(;-1!==(n=o.data.indexOf(tt,n+1));)r.push({type:7,index:l}),n+=tt.length-1}l++}}static createElement(n,t){const e=lt.createElement("template");return e.innerHTML=n,e}}function Pt(n,t,e=n,o){if(t===bt)return t;let l=void 0!==o?e._$Co?.[o]:e._$Cl;const i=st(t)?void 0:t._$litDirective$;return l?.constructor!==i&&(l?._$AO?.(!1),void 0===i?l=void 0:(l=new i(n),l._$AT(n,e,o)),void 0!==o?(e._$Co??=[])[o]=l:e._$Cl=l),void 0!==l&&(t=Pt(n,l._$AS(n,t.values),l,o)),t}class Mt{constructor(n,t){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){const{el:{content:t},parts:e}=this._$AD,o=(n?.creationScope??lt).importNode(t,!0);St.currentNode=o;let l=St.nextNode(),i=0,s=0,r=e[0];for(;void 0!==r;){if(i===r.index){let t;2===r.type?t=new At(l,l.nextSibling,this,n):1===r.type?t=new r.ctor(l,r.name,r.strings,this,n):6===r.type&&(t=new Tt(l,this,n)),this._$AV.push(t),r=e[++s]}i!==r?.index&&(l=St.nextNode(),i++)}return St.currentNode=lt,o}p(n){let t=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(n,e,t),t+=e.strings.length-2):e._$AI(n[t])),t++}}class At{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(n,t,e,o){this.type=2,this._$AH=wt,this._$AN=void 0,this._$AA=n,this._$AB=t,this._$AM=e,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let n=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===n?.nodeType&&(n=t.parentNode),n}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(n,t=this){n=Pt(this,n,t),st(n)?n===wt||null==n||""===n?(this._$AH!==wt&&this._$AR(),this._$AH=wt):n!==this._$AH&&n!==bt&&this._(n):void 0!==n._$litType$?this.$(n):void 0!==n.nodeType?this.T(n):(n=>rt(n)||"function"==typeof n?.[Symbol.iterator])(n)?this.k(n):this._(n)}O(n){return this._$AA.parentNode.insertBefore(n,this._$AB)}T(n){this._$AH!==n&&(this._$AR(),this._$AH=this.O(n))}_(n){this._$AH!==wt&&st(this._$AH)?this._$AA.nextSibling.data=n:this.T(lt.createTextNode(n)),this._$AH=n}$(n){const{values:t,_$litType$:e}=n,o="number"==typeof e?this._$AC(n):(void 0===e.el&&(e.el=Ot.createElement(xt(e.h,e.h[0]),this.options)),e);if(this._$AH?._$AD===o)this._$AH.p(t);else{const n=new Mt(o,this),e=n.u(this.options);n.p(t),this.T(e),this._$AH=n}}_$AC(n){let t=kt.get(n.strings);return void 0===t&&kt.set(n.strings,t=new Ot(n)),t}k(n){rt(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let e,o=0;for(const l of n)o===t.length?t.push(e=new At(this.O(it()),this.O(it()),this,this.options)):e=t[o],e._$AI(l),o++;o<t.length&&(this._$AR(e&&e._$AB.nextSibling,o),t.length=o)}_$AR(n=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);n&&n!==this._$AB;){const t=n.nextSibling;n.remove(),n=t}}setConnected(n){void 0===this._$AM&&(this._$Cv=n,this._$AP?.(n))}}class Et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,t,e,o,l){this.type=1,this._$AH=wt,this._$AN=void 0,this.element=n,this.name=t,this._$AM=o,this.options=l,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=wt}_$AI(n,t=this,e,o){const l=this.strings;let i=!1;if(void 0===l)n=Pt(this,n,t,0),i=!st(n)||n!==this._$AH&&n!==bt,i&&(this._$AH=n);else{const o=n;let s,r;for(n=l[0],s=0;s<l.length-1;s++)r=Pt(this,o[e+s],t,s),r===bt&&(r=this._$AH[s]),i||=!st(r)||r!==this._$AH[s],r===wt?n=wt:n!==wt&&(n+=(r??"")+l[s+1]),this._$AH[s]=r}i&&!o&&this.j(n)}j(n){n===wt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}}class Rt extends Et{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===wt?void 0:n}}class $t extends Et{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==wt)}}class Dt extends Et{constructor(n,t,e,o,l){super(n,t,e,o,l),this.type=5}_$AI(n,t=this){if((n=Pt(this,n,t,0)??wt)===bt)return;const e=this._$AH,o=n===wt&&e!==wt||n.capture!==e.capture||n.once!==e.once||n.passive!==e.passive,l=n!==wt&&(e===wt||o);o&&this.element.removeEventListener(this.name,this,e),l&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,n):this._$AH.handleEvent(n)}}class Tt{constructor(n,t,e){this.element=n,this.type=6,this._$AN=void 0,this._$AM=t,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(n){Pt(this,n)}}const Lt=Jn.litHtmlPolyfillSupport;Lt?.(Ot,At),(Jn.litHtmlVersions??=[]).push("3.3.0");const jt=(n,t,e)=>{const o=e?.renderBefore??t;let l=o._$litPart$;if(void 0===l){const n=e?.renderBefore??null;o._$litPart$=l=new At(t.insertBefore(it(),n),n,void 0,e??{})}return l._$AI(n),l
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
- */},jt=globalThis;let _t=class extends Yn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const n=super.createRenderRoot();return this.renderOptions.renderBefore??=n.firstChild,n}update(n){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(n),this._$Do=Lt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return vt}};_t._$litElement$=!0,_t.finalized=!0,jt.litElementHydrateSupport?.({LitElement:_t});const Ut=jt.litElementPolyfillSupport;Ut?.({LitElement:_t}),(jt.litElementVersions??=[]).push("4.2.0");
22
+ */},_t=globalThis;let Ut=class extends Zn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const n=super.createRenderRoot();return this.renderOptions.renderBefore??=n.firstChild,n}update(n){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(n),this._$Do=jt(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return bt}};Ut._$litElement$=!0,Ut.finalized=!0,_t.litElementHydrateSupport?.({LitElement:Ut});const zt=_t.litElementPolyfillSupport;zt?.({LitElement:Ut}),(_t.litElementVersions??=[]).push("4.2.0");
23
23
  /**
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
27
  */
28
- const zt=2,Bt=5,It=n=>(...t)=>({_$litDirective$:n,values:t});class Ht{constructor(n){}get _$AU(){return this._$AM._$AU}_$AT(n,t,e){this._$Ct=n,this._$AM=t,this._$Ci=e}_$AS(n,t){return this.update(n,t)}update(n,t){return this.render(...t)}}
28
+ const Bt=2,It=5,Ht=n=>(...t)=>({_$litDirective$:n,values:t});class Nt{constructor(n){}get _$AU(){return this._$AM._$AU}_$AT(n,t,e){this._$Ct=n,this._$AM=t,this._$Ci=e}_$AS(n,t){return this.update(n,t)}update(n,t){return this.render(...t)}}
29
29
  /**
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
32
32
  * SPDX-License-Identifier: BSD-3-Clause
33
- */class Nt extends Ht{constructor(n){if(super(n),this.it=bt,n.type!==zt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(n){if(n===bt||null==n)return this._t=void 0,this.it=n;if(n===vt)return n;if("string"!=typeof n)throw Error(this.constructor.directiveName+"() called with a non-string value");if(n===this.it)return this._t;this.it=n;const t=[n];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Nt.directiveName="unsafeHTML",Nt.resultType=1;const Ft=It(Nt);const qt=It(class extends Ht{constructor(n){if(super(n),n.type!==Bt)throw new Error("run() can only be used in event handlers")}update(n,t){const e=n.element,o=n.name,[l,...i]=t,s=()=>{let n=e,t=n._component;for(;!t&&n;)n=n.parentElement,t=n&&n._component;return console.assert(!!t,"Component not found."),t};return"string"==typeof l?e[`on${o}`]=n=>{const t=s();t?t.run(l,...i,n):An.run(l,...i,n)}:"function"==typeof l&&(e[`on${o}`]=n=>s().setState(l(s().state,...i,n))),this.render()}render(){return vt}});if(An.createElement=on,An.render=function(n,t,e){t&&("string"==typeof t?(n._$litPart$||n.replaceChildren(),Lt(mt`${Ft(t)}`,n)):t._$litType$?(n._$litPart$||n.replaceChildren(),Lt(t,n)):(ln(n,t,e),n._$litPart$=void 0))},An.Fragment=Q,"object"==typeof window){const n=window;Vt=n,Wt={React:n._React||An,html:mt,svg:yt,run:qt},"object"==typeof Vt&&null!==Vt&&Object.keys(Wt).forEach((n=>{Vt[n]=Wt[n]}))}var Vt,Wt;const Kt=(n,t,e,o)=>{if(!t||!e)return;const l=n=>{var e,o;const l=t.cloneNode();null===(e=t.parentNode)||void 0===e||e.replaceChild(l,t);const i=null===(o=(t=l).contentWindow)||void 0===o?void 0:o.document;i&&(i.open(),n.indexOf("<html")>=0?i.write(n):i.write((n=>`<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <meta http-equiv="X-UA-Compatible" content="ie=edge">\n <script src="https://cdnjs.cloudflare.com/ajax/libs/custom-elements/1.1.2/custom-elements.min.js"><\/script>\n <title>AppRun Playground</title>\n <style>\n body {\n font-family: "Benton Sans", "Helvetica Neue", helvetica, arial, sans-serif;\n margin: 2em;\n }\n </style>\n <script src="https://unpkg.com/@babel/standalone/babel.min.js"><\/script>\n <script src="https://unpkg.com/apprun/dist/apprun-html.js"><\/script>\n</head>\n<body>\n<script>\n Babel.registerPlugin("d", [Babel.availablePlugins["proposal-decorators"], {legacy: true}]);\n Babel.registerPlugin("c", [Babel.availablePlugins["proposal-class-properties"], {loose: true}]);\n Babel.registerPlugin("b", [Babel.availablePlugins["proposal-private-methods"], {loose: true}]);\n<\/script>\n<script type="text/babel" data-plugins="d, c, b">\n ${n}\n<\/script>\n</body>\n</html>`)(n)),i.close())};l(e),!o&&n&&"TEXTAREA"===n.nodeName&&("undefined"==typeof CodeMirror?n.onkeyup=()=>l(n.value):n.editor||(n.editor=CodeMirror.fromTextArea(n,{lineNumbers:!0,mode:"jsx"}),n.editor.on("change",(n=>l(n.getValue())))))};An.webComponent("apprun-play",class extends yn{constructor(){super(...arguments),this.view=n=>{const t=n["code-element"],e=this.element;let o,l;return o=t?document.querySelector(t):e.previousElementSibling||e.parentElement.previousElementSibling,l=(null==o?void 0:o.innerText)||(null==o?void 0:o.value)||n.code,this.state.code_area=o,this.state.code=l,l?`<div class="toolbox">\n ${!n.hide_button&&'<a class="button" onclick="app.run("@show-popup")" >Try the Code</a>'}\n </div>`:"<div>AppRun Play cannot find code to run, please set code-element selector.</div>"},this.rendered=({style:n,hide_src:t,code_area:e,code:o})=>{if(!o)return;if(!document.getElementById("play-popup")){document.body.insertAdjacentHTML("beforeend",'<div id="play-popup" class="overlay">\n<style id="apprun-play-style">\n.apprun-play .col {\n height: 100%;\n flex: 1;\n}\n.apprun-preview {\n width: 100%\n}\n.apprun-play .editor, .apprun-play .preview {\n display: inline-block;\n width: calc(100% - 20px);\n height: calc(100% - 10px);\n}\n\na.button {\n font-size: .8em;\n padding: 10px;\n cursor: pointer;\n color: var(--md-primary-bg-color);\n background: var(--md-primary-fg-color)\n}\na.button:hover {\n color: var(--md-primary-fg-color);\n background: var(--md-primary-bg-color)\n}\n\n.overlay {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: rgba(0, 0, 0, 0.7);\n visibility: hidden;\n opacity: 0;\n z-index: 999;\n}\n.overlay.show {\n visibility: visible;\n opacity: 1;\n}\n\n.popup {\n margin: 80px auto;\n padding: 20px;\n background: #fff;\n border-radius: 3px;\n position: relative;\n width: 90%;\n height: calc(100% - 150px);\n}\n\n.popup .close {\n position: absolute;\n top: 10px;\n right: 20px;\n font-size: 20px;\n font-weight: bold;\n text-decoration: none;\n color: #333;\n}\n.popup .close:hover {\n color: #06D85F;\n}\n.popup .content {\n height: 100%;\n overflow: hidden;\n display: flex;\n}\n\n.cm-s-default {\n height: 100%;\n font-size: small;\n line-height: 1.5em;\n z-index: 0;\n}\n</style>\n\n\t<div class="popup apprun-play">\n\t\t<a class="close" href="javascript:app.run(\'@close-popup\')">&times;</a>\n\t\t<div class="content">\n\t\t\t<div class="col">\n <textarea class="editor"></textarea>\n </div>\n <div class="col">\n <iframe class="preview"/>\n </div>\n </div>\n\t</div>\n</div>');const n=document.querySelector(".apprun-play .editor"),t=document.querySelector(".apprun-play .preview");n.value=o,Kt(n,t,o,!1)}const l=document.createElement("iframe");l.classList.add("apprun-preview"),l.style.cssText=n,this.element.before(l),t&&(e.style.display="none"),Kt(e,l,o,t)},this.update={"@show-popup":({code:n})=>{var t;null===(t=document.querySelector(".apprun-play .editor").editor)||void 0===t||t.setValue(n),document.getElementById("play-popup").classList.add("show")},"@close-popup":()=>{document.getElementById("play-popup").classList.remove("show")}}}});
33
+ */class Ft extends Nt{constructor(n){if(super(n),this.it=wt,n.type!==Bt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(n){if(n===wt||null==n)return this._t=void 0,this.it=n;if(n===bt)return n;if("string"!=typeof n)throw Error(this.constructor.directiveName+"() called with a non-string value");if(n===this.it)return this._t;this.it=n;const t=[n];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Ft.directiveName="unsafeHTML",Ft.resultType=1;const qt=Ht(Ft);const Vt=Ht(class extends Nt{constructor(n){if(super(n),n.type!==It)throw new Error("run() can only be used in event handlers")}update(n,t){const e=n.element,o=n.name,[l,...i]=t,s=()=>{let n=e,t=n._component;for(;!t&&n;)n=n.parentElement,t=n&&n._component;return console.assert(!!t,"Component not found."),t};return"string"==typeof l?e[`on${o}`]=n=>{const t=s();t?t.run(l,...i,n):En.run(l,...i,n)}:"function"==typeof l&&(e[`on${o}`]=n=>s().setState(l(s().state,...i,n))),this.render()}render(){return bt}});if(En.createElement=ln,En.render=function(n,t,e){t&&("string"==typeof t?(n._$litPart$||n.replaceChildren(),jt(yt`${qt(t)}`,n)):t._$litType$?(n._$litPart$||n.replaceChildren(),jt(t,n)):(sn(n,t,e),n._$litPart$=void 0))},En.Fragment=nn,"object"==typeof window){const n=window;Wt=n,Kt={React:n._React||En,html:yt,svg:vt,run:Vt},"object"==typeof Wt&&null!==Wt&&Object.keys(Kt).forEach((n=>{Wt[n]=Kt[n]}))}var Wt,Kt;const Xt=(n,t,e,o)=>{if(!t||!e)return;const l=n=>{var e,o;const l=t.cloneNode();null===(e=t.parentNode)||void 0===e||e.replaceChild(l,t);const i=null===(o=(t=l).contentWindow)||void 0===o?void 0:o.document;i&&(i.open(),n.indexOf("<html")>=0?i.write(n):i.write((n=>`<!DOCTYPE html>\n<html lang="en">\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <meta http-equiv="X-UA-Compatible" content="ie=edge">\n <script src="https://cdnjs.cloudflare.com/ajax/libs/custom-elements/1.1.2/custom-elements.min.js"><\/script>\n <title>AppRun Playground</title>\n <style>\n body {\n font-family: "Benton Sans", "Helvetica Neue", helvetica, arial, sans-serif;\n margin: 2em;\n }\n </style>\n <script src="https://unpkg.com/@babel/standalone/babel.min.js"><\/script>\n <script src="https://unpkg.com/apprun/dist/apprun-html.js"><\/script>\n</head>\n<body>\n<script>\n Babel.registerPlugin("d", [Babel.availablePlugins["proposal-decorators"], {legacy: true}]);\n Babel.registerPlugin("c", [Babel.availablePlugins["proposal-class-properties"], {loose: true}]);\n Babel.registerPlugin("b", [Babel.availablePlugins["proposal-private-methods"], {loose: true}]);\n<\/script>\n<script type="text/babel" data-plugins="d, c, b">\n ${n}\n<\/script>\n</body>\n</html>`)(n)),i.close())};l(e),!o&&n&&"TEXTAREA"===n.nodeName&&("undefined"==typeof CodeMirror?n.onkeyup=()=>l(n.value):n.editor||(n.editor=CodeMirror.fromTextArea(n,{lineNumbers:!0,mode:"jsx"}),n.editor.on("change",(n=>l(n.getValue())))))};En.webComponent("apprun-play",class extends vn{constructor(){super(...arguments),this.view=n=>{const t=n["code-element"],e=this.element;let o,l;return o=t?document.querySelector(t):e.previousElementSibling||e.parentElement.previousElementSibling,l=(null==o?void 0:o.innerText)||(null==o?void 0:o.value)||n.code,this.state.code_area=o,this.state.code=l,l?`<div class="toolbox">\n ${!n.hide_button&&'<a class="button" onclick="app.run("@show-popup")" >Try the Code</a>'}\n </div>`:"<div>AppRun Play cannot find code to run, please set code-element selector.</div>"},this.rendered=({style:n,hide_src:t,code_area:e,code:o})=>{if(!o)return;if(!document.getElementById("play-popup")){document.body.insertAdjacentHTML("beforeend",'<div id="play-popup" class="overlay">\n<style id="apprun-play-style">\n.apprun-play .col {\n height: 100%;\n flex: 1;\n}\n.apprun-preview {\n width: 100%\n}\n.apprun-play .editor, .apprun-play .preview {\n display: inline-block;\n width: calc(100% - 20px);\n height: calc(100% - 10px);\n}\n\na.button {\n font-size: .8em;\n padding: 10px;\n cursor: pointer;\n color: var(--md-primary-bg-color);\n background: var(--md-primary-fg-color)\n}\na.button:hover {\n color: var(--md-primary-fg-color);\n background: var(--md-primary-bg-color)\n}\n\n.overlay {\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: rgba(0, 0, 0, 0.7);\n visibility: hidden;\n opacity: 0;\n z-index: 999;\n}\n.overlay.show {\n visibility: visible;\n opacity: 1;\n}\n\n.popup {\n margin: 80px auto;\n padding: 20px;\n background: #fff;\n border-radius: 3px;\n position: relative;\n width: 90%;\n height: calc(100% - 150px);\n}\n\n.popup .close {\n position: absolute;\n top: 10px;\n right: 20px;\n font-size: 20px;\n font-weight: bold;\n text-decoration: none;\n color: #333;\n}\n.popup .close:hover {\n color: #06D85F;\n}\n.popup .content {\n height: 100%;\n overflow: hidden;\n display: flex;\n}\n\n.cm-s-default {\n height: 100%;\n font-size: small;\n line-height: 1.5em;\n z-index: 0;\n}\n</style>\n\n\t<div class="popup apprun-play">\n\t\t<a class="close" href="javascript:app.run(\'@close-popup\')">&times;</a>\n\t\t<div class="content">\n\t\t\t<div class="col">\n <textarea class="editor"></textarea>\n </div>\n <div class="col">\n <iframe class="preview"/>\n </div>\n </div>\n\t</div>\n</div>');const n=document.querySelector(".apprun-play .editor"),t=document.querySelector(".apprun-play .preview");n.value=o,Xt(n,t,o,!1)}const l=document.createElement("iframe");l.classList.add("apprun-preview"),l.style.cssText=n,this.element.before(l),t&&(e.style.display="none"),Xt(e,l,o,t)},this.update={"@show-popup":({code:n})=>{var t;null===(t=document.querySelector(".apprun-play .editor").editor)||void 0===t||t.setValue(n),document.getElementById("play-popup").classList.add("show")},"@close-popup":()=>{document.getElementById("play-popup").classList.remove("show")}}}});
34
34
  //# sourceMappingURL=apprun-play-html.esm.js.map