apprun 3.38.0 → 6.0.0-rc.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.
Files changed (113) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/README.md +18 -10
  3. package/apprun.d.ts +67 -23
  4. package/dist/apprun-code.js +1 -1
  5. package/dist/apprun-code.js.map +1 -1
  6. package/dist/apprun-dev-tools.js +1 -1
  7. package/dist/apprun-dev-tools.js.map +1 -1
  8. package/dist/apprun-html.esm.js +7 -7
  9. package/dist/apprun-html.esm.js.map +1 -1
  10. package/dist/apprun-html.js +1 -1
  11. package/dist/apprun-html.js.map +1 -1
  12. package/dist/apprun-play.js +1 -1
  13. package/dist/apprun-play.js.map +1 -1
  14. package/dist/apprun.esm.js +1 -1
  15. package/dist/apprun.esm.js.map +1 -1
  16. package/dist/apprun.js +1 -1
  17. package/dist/apprun.js.map +1 -1
  18. package/esm/add-components.js +7 -7
  19. package/esm/add-components.js.map +1 -1
  20. package/esm/app.js +81 -32
  21. package/esm/app.js.map +1 -1
  22. package/esm/apprun-code.js +8 -2
  23. package/esm/apprun-code.js.map +1 -1
  24. package/esm/apprun-html.js +14 -9
  25. package/esm/apprun-html.js.map +1 -1
  26. package/esm/apprun-play.js +7 -1
  27. package/esm/apprun-play.js.map +1 -1
  28. package/esm/apprun.js +38 -19
  29. package/esm/apprun.js.map +1 -1
  30. package/esm/component.js +90 -37
  31. package/esm/component.js.map +1 -1
  32. package/esm/directive.js +1 -1
  33. package/esm/directive.js.map +1 -1
  34. package/esm/router.js +73 -19
  35. package/esm/router.js.map +1 -1
  36. package/esm/types.js +2 -1
  37. package/esm/types.js.map +1 -1
  38. package/esm/vdom-my.js +52 -52
  39. package/esm/vdom-my.js.map +1 -1
  40. package/esm/vdom-to-html.js +8 -1
  41. package/esm/vdom-to-html.js.map +1 -1
  42. package/esm/vdom.js +3 -3
  43. package/esm/vdom.js.map +1 -1
  44. package/esm/version.js +1 -1
  45. package/esm/version.js.map +1 -1
  46. package/esm/web-component.js +23 -6
  47. package/esm/web-component.js.map +1 -1
  48. package/jsx-runtime.js +1 -1
  49. package/jsx-runtime.js.map +1 -1
  50. package/package.json +62 -2
  51. package/.clinerules +0 -1
  52. package/.travis.yml +0 -10
  53. package/BACKERS.md +0 -8
  54. package/CNAME +0 -1
  55. package/WHATSNEW.md +0 -367
  56. package/ai/apprun-html.prompt.md +0 -290
  57. package/ai/apprun.prompt.md +0 -602
  58. package/apprun-book.jpg +0 -0
  59. package/dist/apprun-dev-tools-tests.js +0 -1
  60. package/dist/apprun-dev-tools.js.LICENSE.txt +0 -1
  61. package/dist/apprun-play-html.esm.js +0 -34
  62. package/dist/apprun-play-html.esm.js.map +0 -1
  63. package/error.log +0 -0
  64. package/esm/apprun-play-html.js +0 -210
  65. package/esm/apprun-play-html.js.map +0 -1
  66. package/esm/shadow.js +0 -8
  67. package/esm/shadow.js.map +0 -1
  68. package/esm/vdom-html.js +0 -22
  69. package/esm/vdom-html.js.map +0 -1
  70. package/esm/vdom-my-new.js +0 -327
  71. package/esm/vdom-my-new.js.map +0 -1
  72. package/esm/vdom-patch.js +0 -103
  73. package/esm/vdom-patch.js.map +0 -1
  74. package/index.html +0 -87
  75. package/jest.config.js +0 -57
  76. package/jest.setup.js +0 -73
  77. package/logo.png +0 -0
  78. package/react.js +0 -13
  79. package/rollup.config.js +0 -62
  80. package/src/add-components.ts +0 -103
  81. package/src/app.ts +0 -173
  82. package/src/apprun-code.tsx +0 -177
  83. package/src/apprun-dev-tools-tests.tsx +0 -101
  84. package/src/apprun-dev-tools.tsx +0 -307
  85. package/src/apprun-html.ts +0 -25
  86. package/src/apprun-play.tsx +0 -249
  87. package/src/apprun.ts +0 -238
  88. package/src/component.ts +0 -388
  89. package/src/createState.ts +0 -11
  90. package/src/decorator.ts +0 -98
  91. package/src/directive.ts +0 -303
  92. package/src/global.d.ts +0 -22
  93. package/src/router.ts +0 -311
  94. package/src/shadow.tsx +0 -8
  95. package/src/tsconfig.json +0 -16
  96. package/src/type-utils.ts +0 -130
  97. package/src/types.ts +0 -151
  98. package/src/vdom-html.ts_ +0 -20
  99. package/src/vdom-lit-html.ts +0 -67
  100. package/src/vdom-my-new.ts +0 -311
  101. package/src/vdom-my-prop-attr.ts +0 -241
  102. package/src/vdom-my.ts +0 -286
  103. package/src/vdom-patch.ts +0 -108
  104. package/src/vdom-to-html.tsx +0 -49
  105. package/src/vdom.ts +0 -28
  106. package/src/version.ts +0 -16
  107. package/src/web-component.ts +0 -154
  108. package/tsconfig.jest.json +0 -49
  109. package/tsconfig.json +0 -16
  110. package/tslint.json +0 -114
  111. package/typescriptreact.json +0 -87
  112. package/viewEngine.js +0 -54
  113. package/webpack.config.cjs +0 -41
@@ -1,2 +1,2 @@
1
- !function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apprun=e():n.apprun=e()}(this,(()=>(()=>{"use strict";var n={320:(n,e,t)=>{t.d(e,{Fragment:()=>o.FK,createElement:()=>o.n,render:()=>o.cJ,safeHTML:()=>o.t_});var o=t(593)},593:(n,e,t)=>{t.d(e,{FK:()=>q,n:()=>Y,t_:()=>Q,cJ:()=>J});var o={};t.r(o),t.d(o,{boolean:()=>a,booleanish:()=>s,commaOrSpaceSeparated:()=>h,commaSeparated:()=>d,number:()=>c,overloadedBoolean:()=>u,spaceSeparated:()=>p});var l=t(741);class r{constructor(n,e){this.attribute=e,this.property=n}}r.prototype.attribute="",r.prototype.booleanish=!1,r.prototype.boolean=!1,r.prototype.commaOrSpaceSeparated=!1,r.prototype.commaSeparated=!1,r.prototype.defined=!1,r.prototype.mustUseProperty=!1,r.prototype.number=!1,r.prototype.overloadedBoolean=!1,r.prototype.property="",r.prototype.spaceSeparated=!1,r.prototype.space=void 0;let i=0;const a=f(),s=f(),u=f(),c=f(),p=f(),d=f(),h=f();function f(){return 2**++i}const m=Object.keys(o);class g extends r{constructor(n,e,t,l){let r=-1;if(super(n,e),y(this,"space",l),"number"==typeof t)for(;++r<m.length;){const n=m[r];y(this,m[r],(t&o[n])===o[n])}}}function y(n,e,t){t&&(n[e]=t)}function v(n){return n.toLowerCase()}g.prototype.defined=!0;const b=/[A-Z]/g,w=/-[a-z]/g,k=/^data[-\w.:]+$/i;function _(n){return"-"+n.toLowerCase()}function x(n){return n.charAt(1).toUpperCase()}class S{constructor(n,e,t){this.normal=e,this.property=n,t&&(this.space=t)}}function A(n,e){const t={},o={};for(const e of n)Object.assign(t,e.property),Object.assign(o,e.normal);return new S(t,o,e)}function C(n){const e={},t={};for(const[o,l]of Object.entries(n.properties)){const r=new g(o,n.transform(n.attributes||{},o),l,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(r.mustUseProperty=!0),e[o]=r,t[v(o)]=o,t[v(r.attribute)]=o}return new S(e,t,n.space)}S.prototype.normal={},S.prototype.property={},S.prototype.space=void 0;const E=C({properties:{ariaActiveDescendant:null,ariaAtomic:s,ariaAutoComplete:null,ariaBusy:s,ariaChecked:s,ariaColCount:c,ariaColIndex:c,ariaColSpan:c,ariaControls:p,ariaCurrent:null,ariaDescribedBy:p,ariaDetails:null,ariaDisabled:s,ariaDropEffect:p,ariaErrorMessage:null,ariaExpanded:s,ariaFlowTo:p,ariaGrabbed:s,ariaHasPopup:null,ariaHidden:s,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:p,ariaLevel:c,ariaLive:null,ariaModal:s,ariaMultiLine:s,ariaMultiSelectable:s,ariaOrientation:null,ariaOwns:p,ariaPlaceholder:null,ariaPosInSet:c,ariaPressed:s,ariaReadOnly:s,ariaRelevant:null,ariaRequired:s,ariaRoleDescription:p,ariaRowCount:c,ariaRowIndex:c,ariaRowSpan:c,ariaSelected:s,ariaSetSize:c,ariaSort:null,ariaValueMax:c,ariaValueMin:c,ariaValueNow:c,ariaValueText:null,role:null},transform:(n,e)=>"role"===e?e:"aria-"+e.slice(4).toLowerCase()});function P(n,e){return e in n?n[e]:e}function O(n,e){return P(n,e.toLowerCase())}const M=C({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:d,acceptCharset:p,accessKey:p,action:null,allow:null,allowFullScreen:a,allowPaymentRequest:a,allowUserMedia:a,alt:null,as:null,async:a,autoCapitalize:null,autoComplete:p,autoFocus:a,autoPlay:a,blocking:p,capture:null,charSet:null,checked:a,cite:null,className:p,cols:c,colSpan:null,content:null,contentEditable:s,controls:a,controlsList:p,coords:c|d,crossOrigin:null,data:null,dateTime:null,decoding:null,default:a,defer:a,dir:null,dirName:null,disabled:a,download:u,draggable:s,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:a,formTarget:null,headers:p,height:c,hidden:u,high:c,href:null,hrefLang:null,htmlFor:p,httpEquiv:p,id:null,imageSizes:null,imageSrcSet:null,inert:a,inputMode:null,integrity:null,is:null,isMap:a,itemId:null,itemProp:p,itemRef:p,itemScope:a,itemType:p,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:a,low:c,manifest:null,max:null,maxLength:c,media:null,method:null,min:null,minLength:c,multiple:a,muted:a,name:null,nonce:null,noModule:a,noValidate:a,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:a,optimum:c,pattern:null,ping:p,placeholder:null,playsInline:a,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:a,referrerPolicy:null,rel:p,required:a,reversed:a,rows:c,rowSpan:c,sandbox:p,scope:null,scoped:a,seamless:a,selected:a,shadowRootClonable:a,shadowRootDelegatesFocus:a,shadowRootMode:null,shape:null,size:c,sizes:null,slot:null,span:c,spellCheck:s,src:null,srcDoc:null,srcLang:null,srcSet:null,start:c,step:null,style:null,tabIndex:c,target:null,title:null,translate:null,type:null,typeMustMatch:a,useMap:null,value:s,width:c,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:p,axis:null,background:null,bgColor:null,border:c,borderColor:null,bottomMargin:c,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:a,declare:a,event:null,face:null,frame:null,frameBorder:null,hSpace:c,leftMargin:c,link:null,longDesc:null,lowSrc:null,marginHeight:c,marginWidth:c,noResize:a,noHref:a,noShade:a,noWrap:a,object:null,profile:null,prompt:null,rev:null,rightMargin:c,rules:null,scheme:null,scrolling:s,standby:null,summary:null,text:null,topMargin:c,valueType:null,version:null,vAlign:null,vLink:null,vSpace:c,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:a,disableRemotePlayback:a,prefix:null,property:null,results:c,security:null,unselectable:null},space:"html",transform:O}),L=C({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:h,accentHeight:c,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:c,amplitude:c,arabicForm:null,ascent:c,attributeName:null,attributeType:null,azimuth:c,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:c,by:null,calcMode:null,capHeight:c,className:p,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:c,diffuseConstant:c,direction:null,display:null,dur:null,divisor:c,dominantBaseline:null,download:a,dx:null,dy:null,edgeMode:null,editable:null,elevation:c,enableBackground:null,end:null,event:null,exponent:c,externalResourcesRequired:null,fill:null,fillOpacity:c,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:d,g2:d,glyphName:d,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:c,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:c,horizOriginX:c,horizOriginY:c,id:null,ideographic:c,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:c,k:c,k1:c,k2:c,k3:c,k4:c,kernelMatrix:h,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:c,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:c,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:c,overlineThickness:c,paintOrder:null,panose1:null,path:null,pathLength:c,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:p,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:c,pointsAtY:c,pointsAtZ:c,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:h,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:h,rev:h,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:h,requiredFeatures:h,requiredFonts:h,requiredFormats:h,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:c,specularExponent:c,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:c,strikethroughThickness:c,string:null,stroke:null,strokeDashArray:h,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:c,strokeOpacity:c,strokeWidth:null,style:null,surfaceScale:c,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:h,tabIndex:c,tableValues:null,target:null,targetX:c,targetY:c,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:h,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:c,underlineThickness:c,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:c,values:null,vAlphabetic:c,vMathematical:c,vectorEffect:null,vHanging:c,vIdeographic:c,version:null,vertAdvY:c,vertOriginX:c,vertOriginY:c,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:c,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:P}),T=C({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(n,e)=>"xlink:"+e.slice(5).toLowerCase()}),R=C({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:O}),D=C({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(n,e)=>"xml:"+e.slice(3).toLowerCase()}),j=A([E,M,T,R,D],"html"),U=A([E,L,T,R,D],"svg"),B="_props",N=new Map;function F(n,e,t){!function(n){return null!=n&&!1!==n&&""!==n&&(!0===n||("string"==typeof n?"false"!==n.toLowerCase()&&"0"!==n:Boolean(n)))}(t)?n.removeAttribute(e):n.setAttribute(e,e)}function I(n,e,t){try{n[e]=t}catch(o){z(n,e,t,!1)}}function z(n,e,t,o){if(null==t)return void n.removeAttribute(e);const l=String(t);if(o&&e.includes(":")){const[t]=e.split(":");"xlink"===t?n.setAttributeNS("http://www.w3.org/1999/xlink",e,l):n.setAttribute(e,l)}else n.setAttribute(e,l)}function H(n,e,t,o){if(l=n,i=e,document.activeElement===l?["selectionStart","selectionEnd","selectionDirection"].includes(i):"scrollTop"===i||"scrollLeft"===i||l instanceof HTMLMediaElement&&["currentTime","paused","playbackRate","volume"].includes(i))return;var l,i;if("style"===e){if(n.style.cssText&&(n.style.cssText=""),"string"==typeof t)n.style.cssText=t;else if(t&&"object"==typeof t)for(const e in t)n.style[e]!==t[e]&&(n.style[e]=t[e]);return}if("key"===e)return void(null!=t&&(n.key=t));if(e.startsWith("data-"))return void function(n,e,t){const o=(l=e.slice(5)).length<=1?l.toLowerCase():l.split("-").map(((n,e)=>0===e?n.toLowerCase():n.charAt(0).toUpperCase()+n.slice(1).toLowerCase())).join("");var l;null==t?delete n.dataset[o]:n.dataset[o]=String(t)}(n,e,t);if(e.startsWith("on"))return void function(n,e,t){e.startsWith("on")&&(t&&"function"!=typeof t?"string"==typeof t&&(t?n.setAttribute(e,t):n.removeAttribute(e)):n[e]=t)}(n,e,t);if(!("INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&"SELECT"!==n.tagName||"value"!==e&&"selected"!==e&&"selectedIndex"!==e))return void I(n,e,t);if("INPUT"===n.tagName&&"checked"===e)return I(n,e,t),void F(n,e,t);const a=function(n,e){const t=`${n}:${e}`;let o=N.get(t);return void 0===o&&(o=function(n,e){const t=v(e);let o=e,l=r;if(t in n.normal)return n.property[n.normal[t]];if(t.length>4&&"data"===t.slice(0,4)&&k.test(e)){if("-"===e.charAt(4)){const n=e.slice(5).replace(w,x);o="data"+n.charAt(0).toUpperCase()+n.slice(1)}else{const n=e.slice(4);if(!w.test(n)){let t=n.replace(b,_);"-"!==t.charAt(0)&&(t="-"+t),e="data"+t}}l=g}return new l(o,e)}(e?U:j,n)||null,N.set(t,o)),o}(e,o);a?a.boolean||a.overloadedBoolean?F(n,a.attribute,t):a.mustUseProperty&&!o?I(n,a.property,t):z(n,a.attribute,t,o):e.startsWith("aria-")||"role"===e?z(n,e,t,o):e in n||void 0!==n[e]?I(n,e,t):z(n,e,t,o)}function W(n){return/^[a-zA-Z_:][\w\-:.]*$/.test(n)&&!n.includes("<")&&!n.includes(">")&&!n.includes('"')&&!n.includes("'")}function $(n,e,t){const o=function(n,e){if(e&&(e.class=e.class||e.className,delete e.className),!n||0===Object.keys(n).length)return e||{};if(!e||0===Object.keys(e).length){const e={};return Object.keys(n).forEach((n=>e[n]=null)),e}const t={};return Object.keys(n).forEach((n=>{n in e||(t[n]=null)})),Object.keys(e).forEach((n=>t[n]=e[n])),t}(n[B]||{},e);n[B]=e||{},function(n,e,t,o){for(const t in e)W(t)&&H(n,t,e[t],o);e&&"function"==typeof e.ref&&window.requestAnimationFrame((()=>e.ref(n)))}(n,o,0,t)}function q(n,...e){return V(e)}function V(n){const e=[],t=n=>{null!=n&&""!==n&&!1!==n&&e.push("function"==typeof n||"object"==typeof n?n:`${n}`)};return n&&n.forEach((n=>{Array.isArray(n)?n.forEach((n=>t(n))):t(n)})),e}const K={};let X=0;function Y(n,e,...t){const o=V(t);if("string"==typeof n)return{tag:n,props:e,children:o};if(Array.isArray(n))return n;if(void 0===n&&t)return o;if(Object.getPrototypeOf(n).__isAppRunComponent)return{tag:n,props:e,children:o};if("function"==typeof n)return n(e,o);throw new Error(`Unknown tag in vdom ${n}`)}const J=(n,e,t={})=>{null!=e&&!1!==e&&function(n,e,t={}){if(null==e||!1===e)return;if(e=tn(e,t),!n)return;const o="SVG"===n.nodeName;Array.isArray(e)?G(n,e,o):G(n,[e],o)}("string"==typeof n&&n?document.getElementById(n)||document.querySelector(n):n,e=(0,l.A)(e,t),t)};function Z(n,e,t){t=t||"svg"===e.tag,function(n,e){const t=n.nodeName,o=`${e.tag||""}`;return t.toUpperCase()===o.toUpperCase()}(n,e)?(G(n,e.children,t),$(n,e.props,t)):n.parentNode.replaceChild(en(e,t),n)}function G(n,e,t){const o=n.childNodes?.length||0,l=e?.length||0,r=Math.min(o,l);for(let o=0;o<r;o++){const l=e[o],r=n.childNodes[o];if("string"==typeof l)r.textContent!==l&&(3===r.nodeType?r.nodeValue=l:n.replaceChild(nn(l),r));else if(l instanceof HTMLElement||l instanceof SVGElement)n.insertBefore(l,r);else{const e=l.props&&l.props.key;if(e)if(r.key===e)Z(n.childNodes[o],l,t);else{const i=K[e];i?(n.insertBefore(i,r),Z(n.childNodes[o],l,t)):n.replaceChild(en(l,t),r)}else Z(n.childNodes[o],l,t)}}let i=n.childNodes?.length||0;for(;i>r;)n.removeChild(n.lastChild),i--;if(l>r){const o=document.createDocumentFragment();for(let n=r;n<e.length;n++)o.appendChild(en(e[n],t));n.appendChild(o)}}const Q=n=>{const e=document.createElement("section");return e.insertAdjacentHTML("afterbegin",n),Array.from(e.children)};function nn(n){if(0===n?.indexOf("_html:")){const e=document.createElement("div");return e.insertAdjacentHTML("afterbegin",n.substring(6)),e}return document.createTextNode(n??"")}function en(n,e){if(n instanceof HTMLElement||n instanceof SVGElement)return n;if("string"==typeof n)return nn(n);if(!n.tag||"function"==typeof n.tag)return nn(JSON.stringify(n));const t=(e=e||"svg"===n.tag)?document.createElementNS("http://www.w3.org/2000/svg",n.tag):document.createElement(n.tag);return $(t,n.props,e),n.children&&n.children.forEach((n=>t.appendChild(en(n,e)))),n.props&&void 0!==n.props.key&&(t.key=n.props.key,K[n.props.key]=t,++X>=500&&(function(){if(!(Object.keys(K).length<=1e3))for(const[n,e]of Object.entries(K))e.isConnected||delete K[n]}(),X=0)),t}function tn(n,e,t=0){if("string"==typeof n)return n;if(Array.isArray(n))return n.map((n=>tn(n,e,t++)));let o=n;if(n&&"function"==typeof n.tag&&Object.getPrototypeOf(n.tag).__isAppRunComponent&&(o=function(n,e,t){const{tag:o,props:l,children:r}=n;let i=`_${t}`,a=l&&l.id;a?i=a:a=`_${t}${Date.now()}`;let s="section";l&&l.as&&(s=l.as,delete l.as),e.__componentCache||(e.__componentCache={});let u=e.__componentCache[i];if(u&&u instanceof o&&u.element)u.renderState(u.state);else{const n=document.createElement(s);u=e.__componentCache[i]=new o({...l,children:r}).mount(n,{render:!0})}if(u.mounted){const n=u.mounted(l,r,u.state);void 0!==n&&u.setState(n)}return $(u.element,l,!1),u.element}(n,e,t)),o&&Array.isArray(o.children)){const n=o.props?._component;if(n){let e=0;o.children=o.children.map((t=>tn(t,n,e++)))}else o.children=o.children.map((n=>tn(n,e,t++)))}return o}},634:(n,e,t)=>{function o(n){return n?.target instanceof HTMLElement?n.target:null}function l(n,e=document){try{return e.querySelector(n)}catch(e){return console.warn(`Invalid selector: ${n}`,e),null}}function r(n){try{return document.getElementById(n)}catch(e){return console.warn(`Error getting element by id: ${n}`,e),null}}t.d(e,{PB:()=>o,bV:()=>l,oP:()=>r})},672:(n,e,t)=>{t.d(e,{C:()=>l,a:()=>o});const o="3.38.0",l=`AppRun-${o}`},741:(n,e,t)=>{t.d(e,{A:()=>u});var o=t(859),l=t(634);const r=n=>{if(!n)return[];const e=[];let t="",o=!1,l="";for(let r=0;r<n.length;r++){const i=n[r];"["!==i||o?"]"===i&&o?(l?t=t.slice(1,-1):/^\d+$/.test(t)&&(t=parseInt(t,10)),e.push(t),t="",o=!1,l=""):'"'!==i&&"'"!==i||!o?"."!==i||o?t+=i:t&&(e.push(t),t=""):(l?i===l&&(l=""):l=i,t+=i):(t&&(e.push(t),t=""),o=!0)}return t&&e.push(t),e},i=(n,e)=>{if(!e)return n.state||"";const t=r(e),o=((n,e)=>{let t=n;for(const n of e){if(null==t)return;t=t[n]}return t})(n.state,t);return void 0!==o?o:""},a=(n,e,t)=>{if(!e)return void n.setState(t);const o=r(e),l=((n,e,t)=>{if(0===e.length)return t;const o={...n};let l=o;for(let n=0;n<e.length-1;n++){const t=e[n],o=e[n+1];null==l[t]?l[t]="number"==typeof o?[]:{}:Array.isArray(l[t])?l[t]=[...l[t]]:"object"==typeof l[t]&&(l[t]={...l[t]}),l=l[t]}return l[e[e.length-1]]=t,o})(n.state||{},o,t);n.setState(l)},s=(n,e)=>{if(Array.isArray(n))return n.map((n=>s(n,e)));{let{type:t,tag:r,props:u,children:c}=n;return r=r||t,c=c||u?.children,u&&Object.keys(u).forEach((n=>{n.startsWith("$")&&(((n,e,t,r)=>{if(n.startsWith("$on")){const t=e[n];if(n=n.substring(1),"boolean"==typeof t)e[n]=e=>r.run?r.run(n,e):o.A.run(n,e);else if("string"==typeof t)e[n]=n=>r.run?r.run(t,n):o.A.run(t,n);else if("function"==typeof t)e[n]=n=>r.setState(t(r.state,n));else if(Array.isArray(t)){const[l,...i]=t;"string"==typeof l?e[n]=n=>r.run?r.run(l,...i,n):o.A.run(l,...i,n):"function"==typeof l&&(e[n]=n=>r.setState(l(r.state,...i,n)))}}else if("$bind"===n){const o=e.type||"text",s="string"==typeof e[n]?e[n]:e.name;if("input"===t)switch(o){case"checkbox":e.checked=i(r,s),e.onclick=n=>{const e=(0,l.PB)(n);e&&a(r,s||e.name,e.checked)};break;case"radio":e.checked=i(r,s)===e.value,e.onclick=n=>{const e=(0,l.PB)(n);e&&a(r,s||e.name,e.value)};break;case"number":case"range":e.value=i(r,s),e.oninput=n=>{const e=(0,l.PB)(n);e&&a(r,s||e.name,Number(e.value))};break;default:e.value=i(r,s),e.oninput=n=>{const e=(0,l.PB)(n);e&&a(r,s||e.name,e.value)}}else"select"===t?(e.value=i(r,s),e.onchange=n=>{const e=(0,l.PB)(n);e&&!e.multiple&&a(r,s||e.name,e.value)}):"option"===t?(e.selected=i(r,s),e.onclick=n=>{const e=(0,l.PB)(n);e&&a(r,s||e.name,e.selected)}):"textarea"===t&&(e.innerHTML=i(r,s),e.oninput=n=>{const e=(0,l.PB)(n);e&&a(r,s||e.name,e.value)})}else o.A.run("$",{key:n,tag:t,props:e,component:r})})(n,u,r,e),delete u[n])})),c&&s(c,e),n}},u=s},859:(n,e,t)=>{t.d(e,{A:()=>s,q:()=>l});var o=t(672);class l{constructor(){this._events={}}on(n,e,t={}){this._events[n]=this._events[n]||[],this._events[n].push({fn:e,options:t})}off(n,e){const t=this._events[n]||[];this._events[n]=t.filter((n=>n.fn!==e))}find(n){return this._events[n]}run(n,...e){const t=this.getSubscribers(n,this._events);return console.assert(t&&t.length>0,"No subscriber for event: "+n),t.forEach((t=>{const{fn:o,options:l}=t;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,e,l);else try{Object.keys(l).length>0?o.apply(this,[...e,l]):o.apply(this,e)}catch(e){console.error(`Error in event handler for '${n}':`,e)}return!t.options.once})),t.length}once(n,e,t={}){this.on(n,e,{...t,once:!0})}delay(n,e,t,o){o._t&&clearTimeout(o._t),o._t=setTimeout((()=>{clearTimeout(o._t);try{Object.keys(o).length>0?e.apply(this,[...t,o]):e.apply(this,t)}catch(e){console.error(`Error in delayed event handler for '${n}':`,e)}}),o.delay)}runAsync(n,...e){const t=this.getSubscribers(n,this._events);console.assert(t&&t.length>0,"No subscriber for event: "+n);const o=t.map((t=>{const{fn:o,options:l}=t;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,[...e,l]):o.apply(this,e)}catch(e){return console.error(`Error in async event handler for '${n}':`,e),Promise.reject(e)}}));return Promise.all(o)}query(n,...e){return console.warn("app.query() is deprecated. Use app.runAsync() instead."),this.runAsync(n,...e)}getSubscribers(n,e){const t=e[n]||[];return e[n]=t.filter((n=>!n.options.once)),Object.keys(e).filter((e=>e.endsWith("*")&&n.startsWith(e.replace("*","")))).sort(((n,e)=>e.length-n.length)).forEach((o=>t.push(...e[o].map((e=>({...e,options:{...e.options,event:n}})))))),t}}const r=o.C;let i;const a="undefined"!=typeof window?window:void 0!==t.g?t.g:"undefined"!=typeof self?self:{};a.app&&a._AppRunVersions?i=a.app:(i=new l,a.app=i,a._AppRunVersions=r);const s=i},971:(n,e,t)=>{t.d(e,{Component:()=>d,app:()=>S});var o=t(859),l=t(320);const r=(n,e={})=>class extends HTMLElement{constructor(){super()}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(e.observedAttributes||[]).map((n=>n.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component){const t=e||{};this._shadowRoot=t.shadow?this.attachShadow({mode:"open"}):this;const o=t.observedAttributes||[],l=o.reduce(((n,e)=>{const t=e.toLowerCase();return t!==e&&(n[t]=e),n}),{});this._attrMap=n=>l[n]||n;const r={};Array.from(this.attributes).forEach((n=>r[this._attrMap(n.name)]=n.value)),o.forEach((n=>{void 0!==this[n]&&(r[n]=this[n]),Object.defineProperty(this,n,{get:()=>r[n],set(e){this.attributeChangedCallback(n,r[n],e)},configurable:!0,enumerable:!0})})),requestAnimationFrame((()=>{const e=this.children?Array.from(this.children):[];if(this._component=new n({...r,children:e}).mount(this._shadowRoot,t),this._component._props=r,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const n=this._component.mounted(r,e,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!==t.render&&this._component.run(".")}))}}disconnectedCallback(){this._component?.unload?.(),this._component?.unmount?.(),this._component=null}attributeChangedCallback(n,t,o){if(this._component){const l=this._attrMap(n);this._component._props[l]=o,this._component.run("attributeChanged",l,t,o),o!==t&&!1!==e.render&&window.requestAnimationFrame((()=>{this._component.run(".")}))}}},i=(n,e,t)=>{"undefined"!=typeof customElements&&customElements.define(n,r(e,t))},a={meta:new WeakMap,defineMetadata(n,e,t){this.meta.has(t)||this.meta.set(t,{}),this.meta.get(t)[n]=e},getMetadataKeys(n){return n=Object.getPrototypeOf(n),this.meta.get(n)?Object.keys(this.meta.get(n)):[]},getMetadata(n,e){return e=Object.getPrototypeOf(e),this.meta.get(e)?this.meta.get(e)[n]:null}};var s=t(741),u=t(634);const c=n=>n,p=o.A;class d{renderState(n,e=null){if(!this.view)return;let t=e||this.view(n);if(p.debug&&p.run("debug",{component:this,_:t?".":"-",state:n,vdom:t,el:this.element}),"object"!=typeof document)return;const o="string"==typeof this.element&&this.element?(0,u.oP)(this.element)||(0,u.bV)(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,!e&&t&&(t=(0,s.A)(t,this),this.options.transition&&document&&document.startViewTransition?document.startViewTransition((()=>p.render(o,t,this))):p.render(o,t,this)),this.rendered&&this.rendered(this.state)}setState(n,e={render:!0,history:!1}){const t=n;if(t?.[Symbol.asyncIterator])this.setState((async n=>{try{for(;;){const{value:t,done:o}=await n.next();if(o)break;this.setState(t,e)}}catch(n){console.error("Error in async iterator:",n)}})(t[Symbol.asyncIterator]()),e);else if(t?.[Symbol.iterator]&&"function"==typeof t.next)for(const n of t)this.setState(n,e);else if(n&&n instanceof Promise)Promise.resolve(n).then((t=>{this.setState(t,e),this._state=n}));else{if(this._state=n,null==n)return;this.state=n,!1!==e.render&&(e.transition&&document&&document.startViewTransition?document.startViewTransition((()=>this.renderState(n))):this.renderState(n)),!1!==e.history&&this.enable_history&&(this._history=[...this._history,n],this._history_idx=this._history.length-1),"function"==typeof e.callback&&e.callback(this.state)}}constructor(n,e,t,l){this.state=n,this.view=e,this.update=t,this.options=l,this._app=new o.q,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,e)=>{if(this.mount(n,{render:!0,...e}),this.mounted&&"function"==typeof this.mounted){const n=this.mounted({},[],this.state);void 0!==n&&this.setState(n)}return this}}mount(n=null,e){return console.assert(!this.element,"Component already mounted."),this.options=e={...this.options,...e},this.element=n,this.global_event=e.global_event,this.enable_history=!!e.history,this.enable_history&&(this.on(e.history.prev||"history-prev",this._history_prev),this.on(e.history.next||"history-next",this._history_next)),e.route&&(this.update=this.update||{},this.update[e.route]||(this.update[e.route]=c)),this.add_actions(),this.state=this.state??this.model??{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!e.render,history:!0}),p.debug&&p.find("debug-create-component")?.length&&p.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,e,t={}){e&&"function"==typeof e?(t.global&&this._global_events.push(n),this.on(n,((...o)=>{p.debug&&p.run("debug",{component:this,_:">",event:n,p:o,current_state:this.state,options:t});try{const l=e(this.state,...o);p.debug&&p.run("debug",{component:this,_:"<",event:n,p:o,newState:l,state:this.state,options:t}),this.setState(l,t)}catch(e){console.error(`Error in component action '${n}':`,e),p.debug&&p.run("debug",{component:this,_:"!",event:n,p:o,error:e,state:this.state,options:t})}}),t)):console.warn(`Component action for '${n}' is not a valid function:`,e)}add_actions(){const n=this.update||{};a.getMetadataKeys(this).forEach((e=>{if(e.startsWith("apprun-update:")){const t=a.getMetadata(e,this);n[t.name]=[this[t.key].bind(this),t.options]}}));const e={};Array.isArray(n)?n.forEach((n=>{const[t,o,l]=n;t.toString().split(",").forEach((n=>e[n.trim()]=[o,l]))})):Object.keys(n).forEach((t=>{const o=n[t];("function"==typeof o||Array.isArray(o))&&t.split(",").forEach((n=>e[n.trim()]=o))})),e["."]||(e["."]=c),Object.keys(e).forEach((n=>{const t=e[n];"function"==typeof t?this.add_action(n,t):Array.isArray(t)&&this.add_action(n,t[0],t[1])}))}run(n,...e){if(this.state instanceof Promise)return Promise.resolve(this.state).then((t=>{this.state=t,this.run(n,...e)}));{const t=n.toString();return this.is_global_event(t)?p.run(t,...e):this._app.run(t,...e)}}on(n,e,t){const o=n.toString();return this._actions.push({name:o,fn:e}),this.is_global_event(o)?p.on(o,e,t):this._app.on(o,e,t)}runAsync(n,...e){const t=n.toString();return this.is_global_event(t)?p.runAsync(t,...e):this._app.runAsync(t,...e)}query(n,...e){return console.warn("component.query() is deprecated. Use component.runAsync() instead."),this.runAsync(n,...e)}unmount(){this.observer?.disconnect(),this._actions.forEach((n=>{const{name:e,fn:t}=n;this.is_global_event(e)?p.off(e,t):this._app.off(e,t)}))}}function h(){const n=o.A.find("#");if(n&&n.length>0)return o.A.run("#"),void o.A.run(m,"#");const e=o.A.find("/");if(e&&e.length>0)return o.A.run("/"),void o.A.run(m,"/");const t=o.A.find("#/");if(t&&t.length>0)return o.A.run("#/"),void o.A.run(m,"#/");console.warn("No subscribers for event: "),o.A.run(g,""),o.A.run(m,"")}d.__isAppRunComponent=!0;const f=(n,...e)=>{if(!n||n===m||n===g)return;const t=o.A.find(n);t&&0!==t.length?o.A.run(n,...e):(console.warn(`No subscribers for event: ${n}`),o.A.run(g,n,...e)),o.A.run(m,n,...e)},m="//",g="///",y=n=>{o.A.lastUrl!==n&&(o.A.lastUrl=n,function(n){if(!n)return void h();n=function(n){return n&&"/"!==n&&"#"!==n&&"#/"!==n&&n.endsWith("/")?n.slice(0,-1):n}(n);const e=o.A.basePath;e&&(n=function(n,e){if(!e||"/"===e||""===e)return n;const t=e.startsWith("/")?e:"/"+e;if(n.startsWith(t)){const e=n.substring(t.length);return e.startsWith("/")?e:"/"+e}return n}(n,e));const t=function(n){return n?n.startsWith("#/")?n.substring(2).split("/"):n.startsWith("#")||n.startsWith("/")?n.substring(1).split("/"):n.split("/"):[]}(n);let l;!function(n){const e=n.filter(Boolean);e.length>11&&console.warn(`Deep route hierarchy detected: ${e.join("/")} (${e.length} levels)`)}(t),l=n.startsWith("#/")?"hash-slash":n.startsWith("#")?"hash":n.startsWith("/")?"path":"non-prefixed";const r=function(n,e){const t=[];for(let o=n.length;o>0;o--){const l=n.slice(0,o);let r="";switch(e){case"path":r="/"+l.join("/");break;case"hash":r="#"+l.join("/");break;case"hash-slash":r="#/"+l.join("/");break;case"non-prefixed":r=l.join("/")}t.push(r)}return t}(t,l),i=function(n,e){for(let t=0;t<n.length;t++){const l=n[t],r=o.A.find(l);if(r&&r.length>0){const o=n.length-t;return{eventName:l,parameters:e.slice(o)}}}return null}(r,t);if(i)f(i.eventName,...i.parameters);else if(r.length>0){const e=r[r.length-1];console.warn(`No subscribers for event: ${e}`),o.A.run(g,n),o.A.run(m,n)}else h()}(n))};function v(n){return n&&"object"==typeof n&&"function"==typeof n.mount}function b(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 w(n){return"function"==typeof n&&!b(n)}async function k(n,e=3){let t=n,o=0;for(;w(t)&&o<e;)try{const n=await t();if(n===t)break;t=n,o++}catch(n){console.error(`Error executing component function: ${n}`);break}return t}const _=async(n,e)=>{for(const[t,l]of Object.entries(e))if(l&&t)if(v(l)){const e={route:t};l.mount(n,e)}else if(b(l)){const e={route:t};(new l).mount(n,e)}else if(w(l)){let e=await k(l);if(v(e)){const o={route:t};e.mount(n,o);continue}if(b(e)){const o={route:t};(new e).mount(n,o);continue}o.A.on(t,((...e)=>{const t=l(...e);if("string"!=typeof n||(n=document.querySelector(n)))return o.A.render(n,t);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=${l}, route=${t}`)};var x=t(672);const S=o.A;if(!S.start){S.version=x.a,S.h=S.createElement=l.createElement,S.render=l.render,S.Fragment=l.Fragment,S.webComponent=i,S.safeHTML=l.safeHTML,S.start=(n,e,t,o,l)=>{const r={render:!0,global_event:!0,...l},i=new d(e,t,o);return l&&l.rendered&&(i.rendered=l.rendered),l&&l.mounted&&(i.mounted=l.mounted),i.start(n,r),i},S.query=S.query||S.runAsync;const n=n=>{};if(S.on("/",n),S.on("debug",(e=>n)),S.on(m,n),S.on(g,n),S.route=y,S.on("route",(n=>S.route&&S.route(n))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{const n=document.body.hasAttribute("apprun-no-init")||S["no-init-route"]||!1,e=S.find("#")||S.find("#/")||!1;window.addEventListener("hashchange",(()=>y(location.hash))),window.addEventListener("popstate",(()=>y(location.pathname))),e?!n&&y(location.hash):(!n&&(()=>{const n=S.basePath||"";let e=location.pathname;n&&e.startsWith(n)&&(e=e.substring(n.length),e.startsWith("/")||(e="/"+e)),y(e)})(),document.body.addEventListener("click",(n=>{const e=n.target;if(!e)return;const t="A"===e.tagName?e:e.closest("a");if(t&&t.origin===location.origin&&t.pathname){n.preventDefault();const e=(S.basePath||"")+t.pathname;history.pushState(null,"",e),y(t.pathname)}})))})),"object"==typeof window){const n=window;n.Component=d,n._React=n.React,n.React=S,n.on=function(n,e={}){return function(t,o){const l=n?n.toString():o;a.defineMetadata(`apprun-update:${l}`,{name:l,key:o,options:e},t)}},n.customElement=function(n,e){return function(t){return i(n,t,e),t}},n.safeHTML=l.safeHTML}S.use_render=(n,e=0)=>{S.render=0===e?(e,t)=>n(t,e):(e,t)=>n(e,t)},S.use_react=(n,e)=>{if(n&&e)if("function"==typeof n.createElement)if(n.Fragment)if(S.h=S.createElement=n.createElement,S.Fragment=n.Fragment,n.version&&n.version.startsWith("18")){if(!e.createRoot||"function"!=typeof e.createRoot)return void console.error("AppRun use_react: ReactDOM.createRoot not found in React 18+");S.render=(n,t)=>{n&&void 0!==t&&(n._root||(n._root=e.createRoot(n)),n._root.render(t))}}else{if(!e.render||"function"!=typeof e.render)return void console.error("AppRun use_react: ReactDOM.render not found in legacy React");S.render=(n,t)=>e.render(t,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")},S.addComponents=_}}},e={};function t(o){var l=e[o];if(void 0!==l)return l.exports;var r=e[o]={exports:{}};return n[o](r,r.exports,t),r.exports}t.d=(n,e)=>{for(var o in e)t.o(e,o)&&!t.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:e[o]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),t.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var o={};t.r(o);var l=t(971);const r=(n,e,t,o)=>{if(!e||!t)return;const l=n=>{const t=e.cloneNode();e.parentNode?.replaceChild(t,e),e=t;const o=e.contentWindow?.document;o&&(o.open(),n.indexOf("<html")>=0?o.write(n):o.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 <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://cdn.jsdelivr.net/npm/typescript@latest"><\/script>\n <script src="https://unpkg.com/apprun/dist/apprun-html.js"><\/script>\n</head>\n<body>\n<pre id="code" style="display:none">${(n=>n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"))(n)}</pre>\n<script type="module">\nconst code = document.getElementById('code').innerText;\nconst compiled = ts.transpileModule(code, {\n compilerOptions: {\n "jsx": "react",\n "jsxFactory": "app.h",\n "jsxFragmentFactory": "app.Fragment",\n "target": "es2020",\n "module": "esnext",\n },\n reportDiagnostics: true,\n});\n\nif (compiled.diagnostics && compiled.diagnostics.length) {\n const pre = document.createElement('pre');\n pre.style = 'font-size: 10px;';\n pre.innerText = compiled.diagnostics.map(d => {\n const start = d.start;\n const end = d.start + d.length;\n const line = code.substring(0, end).split('\\n').length;\n const column = code.substring(0, end).split('\\n').pop().length;\n return \`Line: \${line}, Column: \${column}, \${d.messageText}\`;\n }).join('\\n');\n document.body.appendChild(pre);\n} else {\n window.onerror = function () {\n const pre = document.createElement('pre');\n pre.style = 'font-size: 10px;';\n pre.innerText = compiled.outputText;;\n document.body.appendChild(pre);\n };\n const script = document.createElement('script');\n script.type = 'module';\n script.text = compiled.outputText;\n document.body.appendChild(script);\n}\n<\/script>\n</body>\n</html>`)(n)),o.close())};l(t),!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())))))};class i extends l.Component{constructor(){super(...arguments),this.view=n=>{const e=n["code-element-id"],t=this.element;let o,r;return o=e?document.getElementById(e):t.previousElementSibling||t.parentElement.previousElementSibling,r=o?.innerText||o?.value||n.code,this.state.code_area=o,this.state.code=r,r?l.app.h(l.app.Fragment,null,l.app.h("div",{class:"toolbox"},!n.hide_button&&l.app.h("a",{class:"button",$onclick:"show-popup"},"Try the Code"))):l.app.h("div",null,"AppRun Play cannot find code to run, please set code-element-id or code.")},this.rendered=({style:n,hide_src:e,code_area:t,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"),e=document.querySelector(".apprun-play .preview");n.value=o,r(n,e,o,!1)}const l=document.createElement("iframe");l.classList.add("apprun-preview"),l.style.cssText=n,this.element.before(l),e&&(t.style.display="none"),r(t,l,o,e)},this.update={"show-popup":({code:n})=>{const e=document.querySelector(".apprun-play .editor");e.editor?.setValue(n),document.getElementById("play-popup").classList.add("show")},"@close-popup":()=>{document.getElementById("play-popup").classList.remove("show")}}}}return l.app.webComponent("apprun-play",i),o})()));
1
+ !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.apprun=n():e.apprun=n()}(this,(()=>(()=>{"use strict";var e={9:(e,n,t)=>{t.d(n,{EM:()=>a,W9:()=>l,on:()=>r});var o=t(436);const l={meta:new WeakMap,defineMetadata(e,n,t){this.meta.has(t)||this.meta.set(t,{}),this.meta.get(t)[e]=n},getMetadataKeys(e){return e=Object.getPrototypeOf(e),this.meta.get(e)?Object.keys(this.meta.get(e)):[]},getMetadata(e,n){return n=Object.getPrototypeOf(n),this.meta.get(n)?this.meta.get(n)[e]:null}};function r(e,n={}){return function(t,o){const r=e?e.toString():o;l.defineMetadata(`apprun-update:${r}`,{name:r,key:o,options:n},t)}}function a(e,n){return function(t){return(0,o.A)(e,t,n),t}}},18:(e,n,t)=>{t.r(n),t.d(n,{boolean:()=>l,booleanish:()=>r,commaOrSpaceSeparated:()=>c,commaSeparated:()=>u,number:()=>i,overloadedBoolean:()=>a,spaceSeparated:()=>s});let o=0;const l=p(),r=p(),a=p(),i=p(),s=p(),u=p(),c=p();function p(){return 2**++o}},72:(e,n,t)=>{t.d(n,{z:()=>r});var o=t(259),l=t(530);const r=(0,o.v)({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:l._})},91:(e,n,t)=>{t.d(n,{u:()=>g});var o=t(859),l=t(9),r=t(741),a=t(634);const i=e=>e,s=o.A;let u=0;const c="_c",p=new Map;let d=null;function h(){0===p.size&&d&&(d.disconnect(),d=null)}function m(e){const n=p.get(e);n&&(p.delete(e),n.component.unload?.(n.component.state),h())}function f(e){e&&(p.delete(e),h())}class g{renderState(e,n=null){if(!this.view)return;let t=n||this.view(e);if(s.debug&&s.run("debug",{component:this,_:t?".":"-",state:e,vdom:t,el:this.element}),"object"!=typeof document)return;const o="string"==typeof this.element&&this.element?(0,a.oP)(this.element)||(0,a.bV)(this.element):this.element;o?(this.unload?o._component===this&&o.getAttribute(c)===this.tracking_id||(this.tracking_element&&this.tracking_element!==o&&f(this.tracking_element),this.tracking_id=(++u).toString(36),o.setAttribute(c,this.tracking_id),this.tracking_element=o,function(e,n,t){const o=p.get(n);o&&o.component!==e&&m(n),p.set(n,{component:e,tracking_id:t}),!d&&"undefined"!=typeof MutationObserver&&"object"==typeof document&&document.body&&(d=new MutationObserver((e=>{e.forEach((e=>{if("attributes"===e.type){const n=e.target,t=p.get(n);t&&e.oldValue===t.tracking_id&&m(n)}else"childList"===e.type&&Array.from(p.keys()).forEach((e=>{document.body.contains(e)||m(e)}))}))})),d.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[c]}))}(this,o,this.tracking_id)):(f(this.tracking_element),this.tracking_element=null,o.removeAttribute&&o.removeAttribute(c)),o._component=this,!n&&t&&(t=(0,r.A)(t,this),this.options.transition&&document&&document.startViewTransition?document.startViewTransition((()=>s.render(o,t,this))):s.render(o,t,this)),this.rendered&&this.rendered(this.state)):console.warn(`Component element not found: ${this.element}`)}setState(e,n={render:!0,history:!1}){const t=e;if(t?.[Symbol.asyncIterator])this.setState((async e=>{try{for(;;){const{value:t,done:o}=await e.next();if(o)break;this.setState(t,n)}}catch(e){console.error("Error in async iterator:",e)}})(t[Symbol.asyncIterator]()),n);else if(t?.[Symbol.iterator]&&"function"==typeof t.next)for(const e of t)this.setState(e,n);else if(e&&e instanceof Promise){const t=e;this._pending_state=t,Promise.resolve(t).then((e=>{this._pending_state===t&&(this._pending_state=null,this.setState(e,n))}))}else{if(this._state=e,null==e)return;this._pending_state=null,this.state=e,!1!==n.render&&(n.transition&&document&&document.startViewTransition?document.startViewTransition((()=>this.renderState(e))):this.renderState(e)),!1!==n.history&&this.enable_history&&(this._history=[...this._history,e],this._history_idx=this._history.length-1),"function"==typeof n.callback&&n.callback(this.state)}}constructor(e,n,t,l={}){this.state=e,this.view=n,this.update=t,this.options=l,this._app=new o.q,this._actions=[],this._global_events=[],this._history=[],this._history_idx=-1,this.enable_history=!1,this.global_event=!1,this.tracking_element=null,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=(e=null,n)=>{if(this.mount(e,{render:!0,...n}),this.mounted&&"function"==typeof this.mounted){const e=this.mounted({},[],this.state);void 0!==e&&this.setState(e)}return this}}mount(e=null,n){if(console.assert(!this.element,"Component already mounted."),this.options=n={...this.options,...n},this.element=e,this.global_event=n.global_event,this.enable_history=!!n.history,this.enable_history){const e=function(e){return"object"==typeof e&&null!==e?e:{}}(n.history);this.on(e.prev||"history-prev",this._history_prev),this.on(e.next||"history-next",this._history_next)}return n.route&&(this.update=this.update||{},this.update[n.route]||(this.update[n.route]=i)),this.add_actions(),this.state=this.state??this.model??{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!n.render,history:!0}),s.debug&&s.find("debug-create-component")?.length&&s.run("debug-create-component",this),this}is_global_event(e){return e&&(this.global_event||this._global_events.indexOf(e)>=0||e.startsWith("#")||e.startsWith("/")||e.startsWith("@"))}add_action(e,n,t={}){n&&"function"==typeof n?(t.global&&this._global_events.push(e),this.on(e,((...o)=>{s.debug&&s.run("debug",{component:this,_:">",event:e,p:o,current_state:this.state,options:t});try{const l=n(this.state,...o);s.debug&&s.run("debug",{component:this,_:"<",event:e,p:o,newState:l,state:this.state,options:t}),this.setState(l,t)}catch(n){const l={event:e,error:n,component:this,state:this.state,args:o,phase:"component"};s.find("error")?.length?s.run("error",l):console.error(`Error in component action '${e}':`,n),s.debug&&s.run("debug",{component:this,_:"!",event:e,p:o,error:n,state:this.state,options:t})}}),t)):console.warn(`Component action for '${e}' is not a valid function:`,n)}add_actions(){const e=this.update||{};l.W9.getMetadataKeys(this).forEach((n=>{if(n.startsWith("apprun-update:")){const t=l.W9.getMetadata(n,this);e[t.name]=[this[t.key].bind(this),t.options]}}));const n={};Array.isArray(e)?e.forEach((e=>{const[t,o,l]=e;t.toString().split(",").forEach((e=>n[e.trim()]=[o,l]))})):Object.keys(e).forEach((t=>{const o=e[t];("function"==typeof o||Array.isArray(o))&&t.split(",").forEach((e=>n[e.trim()]=o))})),n["."]||(n["."]=i),Object.keys(n).forEach((e=>{const t=n[e];"function"==typeof t?this.add_action(e,t):Array.isArray(t)&&this.add_action(e,t[0],t[1])}))}run(e,...n){if(this.state instanceof Promise)return Promise.resolve(this.state).then((t=>{this.state=t,this.run(e,...n)}));{const t=e.toString();return this.is_global_event(t)?s.run(t,...n):this._app.run(t,...n)}}on(e,n,t){const o=e.toString();return this._actions.push({name:o,fn:n}),this.is_global_event(o)?s.on(o,n,t):this._app.on(o,n,t)}runAsync(e,...n){const t=e.toString();return this.is_global_event(t)?s.runAsync(t,...n):this._app.runAsync(t,...n)}unmount(){f(this.tracking_element),this.tracking_element=null,this._actions.forEach((e=>{const{name:n,fn:t}=e;this.is_global_event(n)?s.off(n,t):this._app.off(n,t)}))}}g.__isAppRunComponent=!0},147:(e,n,t)=>{t.d(n,{E:()=>a});var o=t(627),l=t(18);const r=Object.keys(l);class a extends o.R{constructor(e,n,t,o){let a=-1;if(super(e,n),i(this,"space",o),"number"==typeof t)for(;++a<r.length;){const e=r[a];i(this,r[a],(t&l[e])===l[e])}}}function i(e,n,t){t&&(e[n]=t)}a.prototype.defined=!0},176:(e,n,t)=>{t.d(n,{S:()=>o});class o{constructor(e,n,t){this.normal=n,this.property=e,t&&(this.space=t)}}o.prototype.normal={},o.prototype.property={},o.prototype.space=void 0},259:(e,n,t)=>{t.d(n,{v:()=>a});var o=t(457),l=t(147),r=t(176);function a(e){const n={},t={};for(const[r,a]of Object.entries(e.properties)){const i=new l.E(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),n[r]=i,t[(0,o.S)(r)]=r,t[(0,o.S)(i.attribute)]=r}return new r.S(n,t,e.space)}},277:(e,n,t)=>{t.d(n,{a:()=>r});var o=t(259),l=t(18);const r=(0,o.v)({properties:{ariaActiveDescendant:null,ariaAtomic:l.booleanish,ariaAutoComplete:null,ariaBusy:l.booleanish,ariaChecked:l.booleanish,ariaColCount:l.number,ariaColIndex:l.number,ariaColSpan:l.number,ariaControls:l.spaceSeparated,ariaCurrent:null,ariaDescribedBy:l.spaceSeparated,ariaDetails:null,ariaDisabled:l.booleanish,ariaDropEffect:l.spaceSeparated,ariaErrorMessage:null,ariaExpanded:l.booleanish,ariaFlowTo:l.spaceSeparated,ariaGrabbed:l.booleanish,ariaHasPopup:null,ariaHidden:l.booleanish,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:l.spaceSeparated,ariaLevel:l.number,ariaLive:null,ariaModal:l.booleanish,ariaMultiLine:l.booleanish,ariaMultiSelectable:l.booleanish,ariaOrientation:null,ariaOwns:l.spaceSeparated,ariaPlaceholder:null,ariaPosInSet:l.number,ariaPressed:l.booleanish,ariaReadOnly:l.booleanish,ariaRelevant:null,ariaRequired:l.booleanish,ariaRoleDescription:l.spaceSeparated,ariaRowCount:l.number,ariaRowIndex:l.number,ariaRowSpan:l.number,ariaSelected:l.booleanish,ariaSetSize:l.number,ariaSort:null,ariaValueMax:l.number,ariaValueMin:l.number,ariaValueNow:l.number,ariaValueText:null,role:null},transform:(e,n)=>"role"===n?n:"aria-"+n.slice(4).toLowerCase()})},292:(e,n,t)=>{t.d(n,{app:()=>f});var o=t(859),l=t(791),r=t(91),a=t(9),i=t(475),s=t(436);function u(e){return e&&"object"==typeof e&&"function"==typeof e.mount}function c(e){return"function"==typeof e&&e.prototype&&e.prototype.constructor===e&&(void 0!==e.prototype.mount||void 0!==e.prototype.state||void 0!==e.prototype.view)}function p(e){return"function"==typeof e&&!c(e)}async function d(e,n=3){let t=e,o=0;for(;p(t)&&o<n;)try{const e=await t();if(e===t)break;t=e,o++}catch(e){console.error(`Error executing component function: ${e}`);break}return t}const h=async(e,n)=>{for(const[t,l]of Object.entries(n))if(l&&t)if(u(l)){const n={route:t};l.mount(e,n)}else if(c(l)){const n={route:t};(new l).mount(e,n)}else if(p(l)){let n=await d(l);if(u(n)){const o={route:t};n.mount(e,o);continue}if(c(n)){const o={route:t};(new n).mount(e,o);continue}o.A.on(t,((...n)=>{const t=l(...n),r="string"==typeof e?document.querySelector(e):e;if(r)return o.A.render(r,t);console.error(`Element not found: ${e}`)}))}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=${l}, route=${t}`)};var m=t(672);const f=o.A;if(!f.start){f.version=m.a,f.h=f.createElement=l.n,f.render=l.cJ,f.Fragment=l.FK,f.webComponent=s.A,f.trustedHTML=l.Fs,f.safeHTML=l.t_,f.start=(e,n,t,o,l)=>{const a={render:!0,global_event:!0,...l},i=new r.u(n,t,o);return l&&l.rendered&&(i.rendered=l.rendered),l&&l.mounted&&(i.mounted=l.mounted),i.start(e,a),i};const e=e=>{};if(f.on("/",e),f.on("debug",(n=>e)),f.on(i.z0,e),f.on(i.a6,e),f.route=i.wE,f.on("route",(e=>f.route&&f.route(e))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{const e=document.body.hasAttribute("apprun-no-init")||f["no-init-route"]||!1,n=f.find("#")||f.find("#/")||!1;window.addEventListener("hashchange",(()=>(0,i.wE)(location.hash))),window.addEventListener("popstate",(()=>(0,i.wE)(location.pathname))),n?!e&&(0,i.wE)(location.hash):(!e&&(()=>{const e=f.basePath||"";let n=location.pathname;e&&n.startsWith(e)&&(n=n.substring(e.length),n.startsWith("/")||(n="/"+n)),(0,i.wE)(n)})(),document.body.addEventListener("click",(e=>{const n=e.target,t=n instanceof Element?n:n?.parentElement;if(!t)return;((e,n)=>{if(!((e,n)=>!(!n||e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||n.target&&"_self"!==n.target.toLowerCase()||n.hasAttribute("download")||(n.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("external")||n.origin!==location.origin||!n.pathname))(e,n))return!1;e.preventDefault();const t=(f.basePath||"")+n.pathname;history.pushState(null,"",t),(0,i.wE)(n.pathname)})(e,"A"===t.tagName?t:t.closest("a"))})))})),"object"==typeof window){const e=window;e.Component=r.u,e.on=a.on,e.customElement=a.EM,e.trustedHTML=l.Fs,e.safeHTML=l.t_}f.use_render=(e,n=0)=>{f.render=0===n?(n,t)=>e(t,n):(n,t)=>e(n,t)},f.use_react=(e,n)=>{if(e&&n)if("function"==typeof e.createElement)if(e.Fragment)if(f.h=f.createElement=e.createElement,f.Fragment=e.Fragment,e.version&&e.version.startsWith("18")){if(!n.createRoot||"function"!=typeof n.createRoot)return void console.error("AppRun use_react: ReactDOM.createRoot not found in React 18+");f.render=(e,t)=>{e&&void 0!==t&&(e._root||(e._root=n.createRoot(e)),e._root.render(t))}}else{if(!n.render||"function"!=typeof n.render)return void console.error("AppRun use_react: ReactDOM.render not found in legacy React");f.render=(e,t)=>n.render(t,e)}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")},f.addComponents=h}},436:(e,n,t)=>{t.d(n,{A:()=>l});const o=(e,n={})=>class extends HTMLElement{constructor(){super(),this._pendingAttributes=[]}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(n.observedAttributes||[]).map((e=>e.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component&&null==this._mountFrame){const t=n||{};this._shadowRoot=t.shadow?this.attachShadow({mode:"open"}):this;const o=t.observedAttributes||[],l=o.reduce(((e,n)=>{const t=n.toLowerCase();return t!==n&&(e[t]=n),e}),{});this._attrMap=e=>l[e]||e;const r={};Array.from(this.attributes).forEach((e=>r[this._attrMap(e.name)]=e.value)),o.forEach((e=>{void 0!==this[e]&&(r[e]=this[e]),Object.defineProperty(this,e,{get:()=>r[e],set(n){this.attributeChangedCallback(e,r[e],n)},configurable:!0,enumerable:!0})})),this._mountFrame=requestAnimationFrame((()=>{if(this._mountFrame=null,!this.isConnected)return;const n=this.children?Array.from(this.children):[];if(this._component=new e({...r,children:n}).mount(this._shadowRoot,t),this._component._props=r,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const e=this._component.mounted(r,n,this._component.state);void 0!==e&&(this._component.state=e)}this.on=this._component.on.bind(this._component),this.run=this._component.run.bind(this._component);const o=this._pendingAttributes;this._pendingAttributes=[],o.forEach((({name:e,oldValue:n,value:t})=>{this.attributeChangedCallback(e,n,t)})),!1!==t.render&&this._component.run(".")}))}}disconnectedCallback(){null!=this._mountFrame&&(cancelAnimationFrame(this._mountFrame),this._mountFrame=null),this._pendingAttributes=[],this._component?.unload?.(this._component.state),this._component?.unmount?.(),this._component=null}attributeChangedCallback(e,t,o){if(this._component){const l=this._attrMap?this._attrMap(e):e;this._component._props[l]=o,this._component.run("attributeChanged",l,t,o),o!==t&&!1!==n.render&&window.requestAnimationFrame((()=>{this._component?.run(".")}))}else this._pendingAttributes.push({name:e,oldValue:t,value:o})}},l=(e,n,t)=>{"undefined"!=typeof customElements&&customElements.define(e,o(n,t))}},457:(e,n,t)=>{function o(e){return e.toLowerCase()}t.d(n,{S:()=>o})},475:(e,n,t)=>{t.d(n,{a6:()=>c,wE:()=>p,z0:()=>u});var o=t(859);function l(e){return e?e.startsWith("#/")?e.substring(2).split("/"):e.startsWith("#")||e.startsWith("/")?e.substring(1).split("/"):e.split("/"):[]}function r(e){return e.startsWith("#/")?"hash-slash":e.startsWith("#")?"hash":e.startsWith("/")?"path":"non-prefixed"}function a(){const e=o.A.find("#");if(e&&e.length>0)return o.A.run("#"),void o.A.run(u,"#");const n=o.A.find("/");if(n&&n.length>0)return o.A.run("/"),void o.A.run(u,"/");const t=o.A.find("#/");if(t&&t.length>0)return o.A.run("#/"),void o.A.run(u,"#/");o.A.debug&&console.warn("No subscribers for event: "),o.A.run(c,""),o.A.run(u,"")}function i(e){if(!e)return void a();e=function(e){return e&&"/"!==e&&"#"!==e&&"#/"!==e&&e.endsWith("/")?e.slice(0,-1):e}(e);const n=o.A.basePath;n&&(e=function(e,n){if(!n||"/"===n||""===n)return e;const t=n.startsWith("/")?n:"/"+n;if(e.startsWith(t)){const n=e.substring(t.length);return n.startsWith("/")?n:"/"+n}return e}(e,n));const t=l(e);!function(e){const n=e.filter(Boolean);n.length>11&&console.warn(`Deep route hierarchy detected: ${n.join("/")} (${n.length} levels)`)}(t);const i=r(e),p=function(e,n){const t=[];for(let o=e.length;o>0;o--){const l=e.slice(0,o);let r="";switch(n){case"path":r="/"+l.join("/");break;case"hash":r="#"+l.join("/");break;case"hash-slash":r="#/"+l.join("/");break;case"non-prefixed":r=l.join("/")}t.push(r)}return t}(t,i),d=p[0],h=o.A.find(d),m=h&&h.length>0?{eventName:d,parameters:[]}:function(e,n){const t=Object.keys(o.A._events||{}).map((t=>function(e,n,t){if(r(e)!==n||!l(e).some((e=>"*"===e||e.startsWith(":"))))return null;const o=l(e),a=[];let i=0;for(let n=0;n<o.length;n++){const l=o[n];if("*"===l)return a.push(t.slice(n).join("/")),{eventName:e,parameters:a,score:10*i+o.length};const r=t[n];if(void 0===r)return null;if(l.startsWith(":"))a.push(r);else{if(l!==r)return null;i++}}return o.length!==t.length?null:{eventName:e,parameters:a,score:10*i+o.length}}(t,e,n))).filter(Boolean).sort(((e,n)=>n.score-e.score||n.eventName.length-e.eventName.length));return t.length>0?{eventName:t[0].eventName,parameters:t[0].parameters}:null}(i,t)||function(e,n){for(let t=0;t<e.length;t++){const l=e[t],r=o.A.find(l);if(r&&r.length>0){const o=e.length-t;return{eventName:l,parameters:n.slice(o)}}}return null}(p.slice(1),t);if(m)s(m.eventName,...m.parameters);else if(p.length>0){const n=p[p.length-1];o.A.debug&&console.warn(`No subscribers for event: ${n}`),o.A.run(c,e),o.A.run(u,e)}else a()}const s=(e,...n)=>{if(!e||e===u||e===c)return;const t=o.A.find(e);t&&0!==t.length?o.A.run(e,...n):(o.A.debug&&console.warn(`No subscribers for event: ${e}`),o.A.run(c,e,...n)),o.A.run(u,e,...n)},u="//",c="///",p=e=>{o.A.lastUrl!==e&&(o.A.lastUrl=e,i(e))}},530:(e,n,t)=>{t.d(n,{_:()=>l});var o=t(815);function l(e,n){return(0,o.B)(e,n.toLowerCase())}},559:(e,n,t)=>{t.d(n,{_:()=>o});const o=(0,t(259).v)({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,n)=>"xml:"+n.slice(3).toLowerCase()})},564:(e,n,t)=>{t.d(n,{J:()=>a});var o=t(815),l=t(259),r=t(18);const a=(0,l.v)({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:r.commaOrSpaceSeparated,accentHeight:r.number,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:r.number,amplitude:r.number,arabicForm:null,ascent:r.number,attributeName:null,attributeType:null,azimuth:r.number,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:r.number,by:null,calcMode:null,capHeight:r.number,className:r.spaceSeparated,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:r.number,diffuseConstant:r.number,direction:null,display:null,dur:null,divisor:r.number,dominantBaseline:null,download:r.boolean,dx:null,dy:null,edgeMode:null,editable:null,elevation:r.number,enableBackground:null,end:null,event:null,exponent:r.number,externalResourcesRequired:null,fill:null,fillOpacity:r.number,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:r.commaSeparated,g2:r.commaSeparated,glyphName:r.commaSeparated,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:r.number,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:r.number,horizOriginX:r.number,horizOriginY:r.number,id:null,ideographic:r.number,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:r.number,k:r.number,k1:r.number,k2:r.number,k3:r.number,k4:r.number,kernelMatrix:r.commaOrSpaceSeparated,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:r.number,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:r.number,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:r.number,overlineThickness:r.number,paintOrder:null,panose1:null,path:null,pathLength:r.number,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:r.spaceSeparated,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:r.number,pointsAtY:r.number,pointsAtZ:r.number,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:r.commaOrSpaceSeparated,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:r.commaOrSpaceSeparated,rev:r.commaOrSpaceSeparated,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:r.commaOrSpaceSeparated,requiredFeatures:r.commaOrSpaceSeparated,requiredFonts:r.commaOrSpaceSeparated,requiredFormats:r.commaOrSpaceSeparated,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:r.number,specularExponent:r.number,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:r.number,strikethroughThickness:r.number,string:null,stroke:null,strokeDashArray:r.commaOrSpaceSeparated,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:r.number,strokeOpacity:r.number,strokeWidth:null,style:null,surfaceScale:r.number,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:r.commaOrSpaceSeparated,tabIndex:r.number,tableValues:null,target:null,targetX:r.number,targetY:r.number,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:r.commaOrSpaceSeparated,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:r.number,underlineThickness:r.number,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:r.number,values:null,vAlphabetic:r.number,vMathematical:r.number,vectorEffect:null,vHanging:r.number,vIdeographic:r.number,version:null,vertAdvY:r.number,vertOriginX:r.number,vertOriginY:r.number,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:r.number,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:o.B})},569:(e,n,t)=>{t.d(n,{q:()=>a});var o=t(530),l=t(259),r=t(18);const a=(0,l.v)({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:r.commaSeparated,acceptCharset:r.spaceSeparated,accessKey:r.spaceSeparated,action:null,allow:null,allowFullScreen:r.boolean,allowPaymentRequest:r.boolean,allowUserMedia:r.boolean,alt:null,as:null,async:r.boolean,autoCapitalize:null,autoComplete:r.spaceSeparated,autoFocus:r.boolean,autoPlay:r.boolean,blocking:r.spaceSeparated,capture:null,charSet:null,checked:r.boolean,cite:null,className:r.spaceSeparated,cols:r.number,colSpan:null,content:null,contentEditable:r.booleanish,controls:r.boolean,controlsList:r.spaceSeparated,coords:r.number|r.commaSeparated,crossOrigin:null,data:null,dateTime:null,decoding:null,default:r.boolean,defer:r.boolean,dir:null,dirName:null,disabled:r.boolean,download:r.overloadedBoolean,draggable:r.booleanish,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:r.boolean,formTarget:null,headers:r.spaceSeparated,height:r.number,hidden:r.overloadedBoolean,high:r.number,href:null,hrefLang:null,htmlFor:r.spaceSeparated,httpEquiv:r.spaceSeparated,id:null,imageSizes:null,imageSrcSet:null,inert:r.boolean,inputMode:null,integrity:null,is:null,isMap:r.boolean,itemId:null,itemProp:r.spaceSeparated,itemRef:r.spaceSeparated,itemScope:r.boolean,itemType:r.spaceSeparated,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:r.boolean,low:r.number,manifest:null,max:null,maxLength:r.number,media:null,method:null,min:null,minLength:r.number,multiple:r.boolean,muted:r.boolean,name:null,nonce:null,noModule:r.boolean,noValidate:r.boolean,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:r.boolean,optimum:r.number,pattern:null,ping:r.spaceSeparated,placeholder:null,playsInline:r.boolean,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:r.boolean,referrerPolicy:null,rel:r.spaceSeparated,required:r.boolean,reversed:r.boolean,rows:r.number,rowSpan:r.number,sandbox:r.spaceSeparated,scope:null,scoped:r.boolean,seamless:r.boolean,selected:r.boolean,shadowRootClonable:r.boolean,shadowRootDelegatesFocus:r.boolean,shadowRootMode:null,shape:null,size:r.number,sizes:null,slot:null,span:r.number,spellCheck:r.booleanish,src:null,srcDoc:null,srcLang:null,srcSet:null,start:r.number,step:null,style:null,tabIndex:r.number,target:null,title:null,translate:null,type:null,typeMustMatch:r.boolean,useMap:null,value:r.booleanish,width:r.number,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:r.spaceSeparated,axis:null,background:null,bgColor:null,border:r.number,borderColor:null,bottomMargin:r.number,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:r.boolean,declare:r.boolean,event:null,face:null,frame:null,frameBorder:null,hSpace:r.number,leftMargin:r.number,link:null,longDesc:null,lowSrc:null,marginHeight:r.number,marginWidth:r.number,noResize:r.boolean,noHref:r.boolean,noShade:r.boolean,noWrap:r.boolean,object:null,profile:null,prompt:null,rev:null,rightMargin:r.number,rules:null,scheme:null,scrolling:r.booleanish,standby:null,summary:null,text:null,topMargin:r.number,valueType:null,version:null,vAlign:null,vLink:null,vSpace:r.number,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:r.boolean,disableRemotePlayback:r.boolean,prefix:null,property:null,results:r.number,security:null,unselectable:null},space:"html",transform:o._})},597:(e,n,t)=>{t.d(n,{o:()=>d});var o=t(775),l=t(862);const r="_props",a=new Map;function i(e,n,t){!function(e){return null!=e&&!1!==e&&""!==e&&(!0===e||("string"==typeof e?"false"!==e.toLowerCase()&&"0"!==e:Boolean(e)))}(t)?e.removeAttribute(n):e.setAttribute(n,n)}function s(e,n,t){try{e[n]=t}catch(o){u(e,n,t,!1)}}function u(e,n,t,o){if(null==t)return void e.removeAttribute(n);const l=String(t);if(o&&n.includes(":")){const[t]=n.split(":");"xlink"===t?e.setAttributeNS("http://www.w3.org/1999/xlink",n,l):e.setAttribute(n,l)}else e.setAttribute(n,l)}function c(e,n,t,r){if(c=e,p=n,document.activeElement===c?["selectionStart","selectionEnd","selectionDirection"].includes(p):"scrollTop"===p||"scrollLeft"===p||c instanceof HTMLMediaElement&&["currentTime","paused","playbackRate","volume"].includes(p))return;var c,p;if("style"===n){if(e.style.cssText&&(e.style.cssText=""),"string"==typeof t)e.style.cssText=t;else if(t&&"object"==typeof t)for(const n in t)e.style[n]!==t[n]&&(e.style[n]=t[n]);return}if("key"===n)return void(null!=t&&(e.key=t));if(n.startsWith("data-"))return void function(e,n,t){const o=(l=n.slice(5)).length<=1?l.toLowerCase():l.split("-").map(((e,n)=>0===n?e.toLowerCase():e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join("");var l;null==t?delete e.dataset[o]:e.dataset[o]=String(t)}(e,n,t);if(n.startsWith("on"))return void function(e,n,t){n.startsWith("on")&&(t&&"function"!=typeof t?"string"==typeof t&&(t?e.setAttribute(n,t):e.removeAttribute(n)):e[n]=t)}(e,n,t);if(!("INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName&&"SELECT"!==e.tagName||"value"!==n&&"selected"!==n&&"selectedIndex"!==n))return void s(e,n,t);if("INPUT"===e.tagName&&"checked"===n)return s(e,n,t),void i(e,n,t);const d=function(e,n){const t=`${e}:${n}`;let r=a.get(t);return void 0===r&&(r=(0,o.I)(n?l.JW:l.qy,e)||null,a.set(t,r)),r}(n,r);d?d.boolean||d.overloadedBoolean?i(e,d.attribute,t):d.mustUseProperty&&!r?s(e,d.property,t):u(e,d.attribute,t,r):n.startsWith("aria-")||"role"===n?u(e,n,t,r):n in e||void 0!==e[n]?s(e,n,t):u(e,n,t,r)}function p(e){return/^[a-zA-Z_:][\w\-:.]*$/.test(e)&&!e.includes("<")&&!e.includes(">")&&!e.includes('"')&&!e.includes("'")}function d(e,n,t){const o=function(e,n){if(n&&(n.class=n.class||n.className,delete n.className),!e||0===Object.keys(e).length)return n||{};if(!n||0===Object.keys(n).length){const n={};return Object.keys(e).forEach((e=>n[e]=null)),n}const t={};return Object.keys(e).forEach((e=>{e in n||(t[e]=null)})),Object.keys(n).forEach((e=>t[e]=n[e])),t}(e[r]||{},n);e[r]=n||{},function(e,n,t,o){for(const t in n)p(t)&&c(e,t,n[t],o);n&&"function"==typeof n.ref&&window.requestAnimationFrame((()=>n.ref(e)))}(e,o,0,t)}},627:(e,n,t)=>{t.d(n,{R:()=>o});class o{constructor(e,n){this.attribute=n,this.property=e}}o.prototype.attribute="",o.prototype.booleanish=!1,o.prototype.boolean=!1,o.prototype.commaOrSpaceSeparated=!1,o.prototype.commaSeparated=!1,o.prototype.defined=!1,o.prototype.mustUseProperty=!1,o.prototype.number=!1,o.prototype.overloadedBoolean=!1,o.prototype.property="",o.prototype.spaceSeparated=!1,o.prototype.space=void 0},634:(e,n,t)=>{function o(e){return e?.target instanceof HTMLElement?e.target:null}function l(e,n=document){try{return n.querySelector(e)}catch(n){return console.warn(`Invalid selector: ${e}`,n),null}}function r(e){try{return document.getElementById(e)}catch(n){return console.warn(`Error getting element by id: ${e}`,n),null}}t.d(n,{PB:()=>o,bV:()=>l,oP:()=>r})},670:(e,n,t)=>{t.d(n,{F:()=>o});const o=(0,t(259).v)({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,n)=>"xlink:"+n.slice(5).toLowerCase()})},672:(e,n,t)=>{t.d(n,{C:()=>l,a:()=>o});const o="6.0.0",l=`AppRun-${o}`},741:(e,n,t)=>{t.d(n,{A:()=>u});var o=t(859),l=t(634);const r=e=>{if(!e)return[];const n=[];let t="",o=!1,l="";for(let r=0;r<e.length;r++){const a=e[r];"["!==a||o?"]"===a&&o?(l?t=t.slice(1,-1):/^\d+$/.test(t)&&(t=parseInt(t,10)),n.push(t),t="",o=!1,l=""):'"'!==a&&"'"!==a||!o?"."!==a||o?t+=a:t&&(n.push(t),t=""):(l?a===l&&(l=""):l=a,t+=a):(t&&(n.push(t),t=""),o=!0)}return t&&n.push(t),n},a=(e,n)=>{if(!n)return e.state||"";const t=r(n),o=((e,n)=>{let t=e;for(const e of n){if(null==t)return;t=t[e]}return t})(e.state,t);return void 0!==o?o:""},i=(e,n,t)=>{if(!n)return void e.setState(t);const o=r(n),l=((e,n,t)=>{if(0===n.length)return t;const o={...e};let l=o;for(let e=0;e<n.length-1;e++){const t=n[e],o=n[e+1];null==l[t]?l[t]="number"==typeof o?[]:{}:Array.isArray(l[t])?l[t]=[...l[t]]:"object"==typeof l[t]&&(l[t]={...l[t]}),l=l[t]}return l[n[n.length-1]]=t,o})(e.state||{},o,t);e.setState(l)},s=(e,n)=>{if(Array.isArray(e))return e.map((e=>s(e,n)));{let{type:t,tag:r,props:u,children:c}=e;return r=r||t,c=c||u?.children,u&&Object.keys(u).forEach((e=>{e.startsWith("$")&&(((e,n,t,r)=>{if(e.startsWith("$on")){const t=n[e];if(e=e.substring(1),"boolean"==typeof t)n[e]=n=>r.run?r.run(e,n):o.A.run(e,n);else if("string"==typeof t)n[e]=e=>r.run?r.run(t,e):o.A.run(t,e);else if("function"==typeof t)n[e]=e=>r.setState(t(r.state,e));else if(Array.isArray(t)){const[l,...a]=t;"string"==typeof l?n[e]=e=>r.run?r.run(l,...a,e):o.A.run(l,...a,e):"function"==typeof l&&(n[e]=e=>r.setState(l(r.state,...a,e)))}}else if("$bind"===e){const o=n.type||"text",s="string"==typeof n[e]?n[e]:n.name;if("input"===t)switch(o){case"checkbox":n.checked=a(r,s),n.onclick=e=>{const n=(0,l.PB)(e);n&&i(r,s||n.name,n.checked)};break;case"radio":n.checked=a(r,s)===n.value,n.onclick=e=>{const n=(0,l.PB)(e);n&&i(r,s||n.name,n.value)};break;case"number":case"range":n.value=a(r,s),n.oninput=e=>{const n=(0,l.PB)(e);n&&i(r,s||n.name,Number(n.value))};break;default:n.value=a(r,s),n.oninput=e=>{const n=(0,l.PB)(e);n&&i(r,s||n.name,n.value)}}else"select"===t?(n.value=a(r,s),n.onchange=e=>{const n=(0,l.PB)(e);n&&!n.multiple&&i(r,s||n.name,n.value)}):"option"===t?(n.selected=a(r,s),n.onclick=e=>{const n=(0,l.PB)(e);n&&i(r,s||n.name,n.selected)}):"textarea"===t&&(n.value=a(r,s),n.oninput=e=>{const n=(0,l.PB)(e);n&&i(r,s||n.name,n.value)})}else o.A.run("$",{key:e,tag:t,props:n,component:r})})(e,u,r,n),delete u[e])})),c&&s(c,n),e}},u=s},775:(e,n,t)=>{t.d(n,{I:()=>u});var o=t(147),l=t(627),r=t(457);const a=/[A-Z]/g,i=/-[a-z]/g,s=/^data[-\w.:]+$/i;function u(e,n){const t=(0,r.S)(n);let u=n,d=l.R;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&"data"===t.slice(0,4)&&s.test(n)){if("-"===n.charAt(4)){const e=n.slice(5).replace(i,p);u="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=n.slice(4);if(!i.test(e)){let t=e.replace(a,c);"-"!==t.charAt(0)&&(t="-"+t),n="data"+t}}d=o.E}return new d(u,n)}function c(e){return"-"+e.toLowerCase()}function p(e){return e.charAt(1).toUpperCase()}},791:(e,n,t)=>{t.d(n,{FK:()=>r,Fs:()=>d,cJ:()=>s,n:()=>i,t_:()=>h});var o=t(741),l=t(597);function r(e,...n){return a(n)}function a(e){const n=[],t=e=>{null!=e&&""!==e&&!1!==e&&n.push("function"==typeof e||"object"==typeof e?e:`${e}`)};return e&&e.forEach((e=>{Array.isArray(e)?e.forEach((e=>t(e))):t(e)})),n}function i(e,n,...t){const o=a(t);if("string"==typeof e)return{tag:e,props:n,children:o};if(Array.isArray(e))return e;if(void 0===e&&t)return o;if(Object.getPrototypeOf(e).__isAppRunComponent)return{tag:e,props:n,children:o};if("function"==typeof e)return e(n,o);throw new Error(`Unknown tag in vdom ${e}`)}const s=(e,n,t={})=>{null!=n&&!1!==n&&function(e,n,t={}){if(null==n||!1===n)return;if(function(e){e&&e.__componentCache&&(e.__componentCacheUsed={})}(t),n=g(n,t),function(e){e&&e.__componentCache&&e.__componentCacheUsed&&(Object.keys(e.__componentCache).forEach((n=>{e.__componentCacheUsed[n]||(e.__componentCache[n]?.unmount?.(),delete e.__componentCache[n])})),e.__componentCacheUsed=null)}(t),!e)return;const o="SVG"===e.nodeName;Array.isArray(n)?c(e,n,o):c(e,[n],o)}("string"==typeof e&&e?document.getElementById(e)||document.querySelector(e):e,n=(0,o.A)(n,t),t)};function u(e,n,t){t=t||"svg"===n.tag,function(e,n){const t=e.nodeName,o=`${n.tag||""}`;return t.toUpperCase()===o.toUpperCase()}(e,n)?(c(e,n.children,t),(0,l.o)(e,n.props,t)):e.parentNode.replaceChild(f(n,t),e)}function c(e,n,t){const o={};Array.from(e.childNodes||[]).forEach((e=>{void 0!==e.key&&null!==e.key&&(o[p(e.key)]=e)}));const l=e.childNodes?.length||0,r=n?.length||0,a=Math.min(l,r);for(let l=0;l<a;l++){const r=n[l],a=e.childNodes[l];if("string"==typeof r)a.textContent!==r&&(3===a.nodeType?a.nodeValue=r:e.replaceChild(m(r),a));else if(r instanceof HTMLElement||r instanceof SVGElement)e.insertBefore(r,a);else{const n=r.props?r.props.key:void 0;if(null!=n)if(a.key===n)u(e.childNodes[l],r,t);else{const i=o[p(n)];i?(e.insertBefore(i,a),u(e.childNodes[l],r,t)):e.replaceChild(f(r,t),a)}else u(e.childNodes[l],r,t)}}let i=e.childNodes?.length||0;for(;i>a;)e.removeChild(e.lastChild),i--;if(r>a){const o=document.createDocumentFragment();for(let e=a;e<n.length;e++)o.appendChild(f(n[e],t));e.appendChild(o)}}function p(e){return`${typeof e}:${String(e)}`}const d=e=>{const n=document.createElement("section");return n.insertAdjacentHTML("afterbegin",e),Array.from(n.children)},h=d;function m(e){return document.createTextNode(e??"")}function f(e,n){if(e instanceof HTMLElement||e instanceof SVGElement)return e;if("string"==typeof e)return m(e);if(!e.tag||"function"==typeof e.tag)return m(JSON.stringify(e));const t=(n=n||"svg"===e.tag)?document.createElementNS("http://www.w3.org/2000/svg",e.tag):document.createElement(e.tag);return(0,l.o)(t,e.props,n),e.children&&e.children.forEach((e=>t.appendChild(f(e,n)))),e.props&&void 0!==e.props.key&&null!==e.props.key&&(t.key=e.props.key),t}function g(e,n,t=0){if("string"==typeof e)return e;if(Array.isArray(e))return e.map((e=>g(e,n,t++)));let o=e;if(e&&"function"==typeof e.tag&&Object.getPrototypeOf(e.tag).__isAppRunComponent&&(o=function(e,n,t){const{tag:o,props:r,children:a}=e,i=r&&r.id,s=null!=i?String(i):`_${t}`;let u="section";r&&r.as&&(u=r.as,delete r.as),n.__componentCache||(n.__componentCache={}),function(e,n){e&&(e.__componentCacheUsed=e.__componentCacheUsed||{},e.__componentCacheUsed[n]=!0)}(n,s);let c=n.__componentCache[s];if(c&&c instanceof o&&c.element)c.renderState(c.state);else{const e=document.createElement(u);c=n.__componentCache[s]=new o({...r,children:a}).mount(e,{render:!0})}if(c.mounted){const e=c.mounted(r,a,c.state);void 0!==e&&c.setState(e)}return(0,l.o)(c.element,r,!1),c.element}(e,n,t)),o&&Array.isArray(o.children)){const e=o.props?._component;if(e){let n=0;o.children=o.children.map((t=>g(t,e,n++)))}else o.children=o.children.map((e=>g(e,n,t++)))}return o}},815:(e,n,t)=>{function o(e,n){return n in e?e[n]:n}t.d(n,{B:()=>o})},859:(e,n,t)=>{t.d(n,{A:()=>s,q:()=>l});var o=t(672);class l{constructor(){this._reporting_error=!1,this._events={},this._wildcard_events=[]}on(e,n,t={}){this._events[e]=this._events[e]||[];const o={fn:n,options:t};this._events[e].push(o),e.endsWith("*")&&(this._wildcard_events.push({name:e,prefix:e.replace("*",""),sub:o}),this._wildcard_events.sort(((e,n)=>n.name.length-e.name.length)))}off(e,n){const t=this._events[e]||[];this._events[e]=t.filter((e=>e.fn!==n)),e.endsWith("*")&&(this._wildcard_events=this._wildcard_events.filter((t=>!(t.name===e&&t.sub.fn===n))))}find(e){return this._events[e]}run(e,...n){const t=this.getSubscribers(e,this._events);return this.debug&&console.assert(t&&t.length>0,"No subscriber for event: "+e),t.forEach((t=>{const{fn:o,options:l}=t;if(!o||"function"!=typeof o)return console.error(`AppRun event handler for '${e}' is not a function:`,o),!1;if(l.delay)this.delay(e,t,n);else try{Object.keys(l).length>0?o.apply(this,[...n,l]):o.apply(this,n)}catch(t){this.reportError(e,t,{phase:"run",args:n})}})),t.length}once(e,n,t={}){this.on(e,n,{...t,once:!0})}delay(e,n,t){const o=n._source||n,{fn:l,options:r}=n;o._t&&clearTimeout(o._t),o._t=setTimeout((()=>{clearTimeout(o._t),o._t=null;try{Object.keys(r).length>0?l.apply(this,[...t,r]):l.apply(this,t)}catch(n){this.reportError(e,n,{phase:"delay",args:t})}}),r.delay)}runAsync(e,...n){const t=this.getSubscribers(e,this._events);this.debug&&console.assert(t&&t.length>0,"No subscriber for event: "+e);const o=t.map((t=>{const{fn:o,options:l}=t;if(!o||"function"!=typeof o)return console.error(`AppRun async event handler for '${e}' is not a function:`,o),Promise.resolve(null);try{const t=Object.keys(l).length>0?o.apply(this,[...n,l]):o.apply(this,n);return Promise.resolve(t).catch((t=>(this.reportError(e,t,{phase:"runAsync",args:n}),Promise.reject(t))))}catch(t){return this.reportError(e,t,{phase:"runAsync",args:n}),Promise.reject(t)}}));return Promise.all(o)}reportError(e,n,t={}){const o={event:e,error:n,app:this,...t},l="error"===e||this._reporting_error?[]:this.getSubscribers("error",this._events);if(l.length>0){this._reporting_error=!0;try{l.forEach((e=>{try{e.fn.call(this,o)}catch(e){console.error("Error in error event handler:",e)}}))}finally{this._reporting_error=!1}}else"delay"===t.phase?console.error(`Error in delayed event handler for '${e}':`,n):"runAsync"===t.phase?console.error(`Error in async event handler for '${e}':`,n):console.error(`Error in event handler for '${e}':`,n)}removeOnceWildcardSubscriber(e,n){this._events[e]=(this._events[e]||[]).filter((e=>e!==n)),this._wildcard_events=this._wildcard_events.filter((e=>e.sub!==n))}getSubscribers(e,n){const t=n[e]||[],o=t.slice();return n[e]=t.filter((e=>!e.options.once)),this._wildcard_events.filter((({name:n,prefix:t})=>n!==e&&e.startsWith(t))).forEach((({name:n,sub:t})=>{t.options.once&&this.removeOnceWildcardSubscriber(n,t),o.push({...t,_source:t,options:{...t.options,event:e}})})),o}}const r=o.C;let a;const i="undefined"!=typeof window?window:void 0!==t.g?t.g:"undefined"!=typeof self?self:{};i.app&&i._AppRunVersions?a=i.app:(a=new l,i.app=a,i._AppRunVersions=r);const s=a},862:(e,n,t)=>{t.d(n,{JW:()=>p,qy:()=>c});var o=t(987),l=t(277),r=t(569),a=t(564),i=t(670),s=t(72),u=t(559);const c=(0,o.h)([l.a,r.q,i.F,s.z,u._],"html"),p=(0,o.h)([l.a,a.J,i.F,s.z,u._],"svg")},987:(e,n,t)=>{t.d(n,{h:()=>l});var o=t(176);function l(e,n){const t={},l={};for(const n of e)Object.assign(t,n.property),Object.assign(l,n.normal);return new o.S(t,l,n)}}},n={};function t(o){var l=n[o];if(void 0!==l)return l.exports;var r=n[o]={exports:{}};return e[o](r,r.exports,t),r.exports}t.d=(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};t.r(o);var l=t(91),r=t(292);const a=(e,n,t,o)=>{if(!n||!t)return;const l=e=>{const t=n.cloneNode();n.parentNode?.replaceChild(t,n),n=t;const o=n.contentWindow?.document;o&&(o.open(),e.indexOf("<html")>=0?o.write(e):o.write((e=>`<!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 <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://cdn.jsdelivr.net/npm/typescript@5.8.3"><\/script>\n <script src="https://unpkg.com/apprun/dist/apprun-html.js"><\/script>\n</head>\n<body>\n<pre id="code" style="display:none">${(e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"))(e)}</pre>\n<script type="module">\nconst code = document.getElementById('code').innerText;\nconst compiled = ts.transpileModule(code, {\n compilerOptions: {\n "jsx": "react",\n "jsxFactory": "app.h",\n "jsxFragmentFactory": "app.Fragment",\n "target": "es2020",\n "module": "esnext",\n },\n reportDiagnostics: true,\n});\n\nif (compiled.diagnostics && compiled.diagnostics.length) {\n const pre = document.createElement('pre');\n pre.style = 'font-size: 10px;';\n pre.innerText = compiled.diagnostics.map(d => {\n const start = d.start;\n const end = d.start + d.length;\n const line = code.substring(0, end).split('\\n').length;\n const column = code.substring(0, end).split('\\n').pop().length;\n return \`Line: \${line}, Column: \${column}, \${d.messageText}\`;\n }).join('\\n');\n document.body.appendChild(pre);\n} else {\n window.onerror = function () {\n const pre = document.createElement('pre');\n pre.style = 'font-size: 10px;';\n pre.innerText = compiled.outputText;;\n document.body.appendChild(pre);\n };\n const script = document.createElement('script');\n script.type = 'module';\n script.text = compiled.outputText;\n document.body.appendChild(script);\n}\n<\/script>\n</body>\n</html>`)(e)),o.close())};l(t),!o&&e&&"TEXTAREA"===e.nodeName&&("undefined"==typeof CodeMirror?e.onkeyup=()=>l(e.value):e.editor||(e.editor=CodeMirror.fromTextArea(e,{lineNumbers:!0,mode:"jsx"}),e.editor.on("change",(e=>l(e.getValue())))))};class i extends l.u{constructor(){super(...arguments),this.view=e=>{const n=e["code-element-id"],t=this.element;let o,l;return o=n?document.getElementById(n):t.previousElementSibling||t.parentElement.previousElementSibling,l=o?.innerText||o?.value||e.code,this.state.code_area=o,this.state.code=l,l?r.app.h(r.app.Fragment,null,r.app.h("div",{class:"toolbox"},!e.hide_button&&r.app.h("a",{class:"button",$onclick:"show-popup"},"Try the Code"))):r.app.h("div",null,"AppRun Play cannot find code to run, please set code-element-id or code.")},this.rendered=({style:e,hide_src:n,code_area:t,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 e=document.querySelector(".apprun-play .editor"),n=document.querySelector(".apprun-play .preview");e.value=o,a(e,n,o,!1)}const l=document.createElement("iframe");l.classList.add("apprun-preview"),l.style.cssText=e,this.element.before(l),n&&(t.style.display="none"),a(t,l,o,n)},this.update={"show-popup":({code:e})=>{const n=document.querySelector(".apprun-play .editor");n.editor?.setValue(e),document.getElementById("play-popup").classList.add("show")},"@close-popup":()=>{document.getElementById("play-popup").classList.remove("show")}}}}return r.app.webComponent("apprun-play",i),o})()));
2
2
  //# sourceMappingURL=apprun-play.js.map