@shijiu/jsview 2.3.0 → 3.0.0-next-vue.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 (78) hide show
  1. package/dom/bin/jsview-dom-browser-engine-core.min.js +1 -1
  2. package/dom/bin/jsview-dom-browser-engine-modules.min.js +1 -1
  3. package/dom/bin/{jsview-dom-browser-forge.1436.54c9.wasm → jsview-dom-browser-forge.1760.0e35.wasm} +0 -0
  4. package/dom/bin/jsview-dom-browser-forge.min.js +1 -1
  5. package/dom/bin/jsview-dom-browser-forge.worker.min.js +1 -1
  6. package/dom/bin/jsview-dom-browser.min.js +1 -1
  7. package/dom/bin/jsview-dom-native.min.js +1 -1
  8. package/dom/bin/jsview-engine-js-native.min.js +1 -1
  9. package/dom/target_core_revision.mjs +2 -2
  10. package/loader/jsv-core-api/jsview-core-api-glue.js +10 -1
  11. package/loader/jsv-core-api/wasm/core-api.js +87 -1
  12. package/loader/jsv-core-api/wasm/wasm-extension.js +5 -0
  13. package/loader/jsview-loader.js +7 -0
  14. package/loader/jsview-main.mjs +2 -1
  15. package/loader/jsview.config.default.js +4 -0
  16. package/package.json +7 -5
  17. package/patches/@vitejs+plugin-vue+4.0.0.patch +51 -0
  18. package/patches/@vitejs+plugin-vue+6.0.6.patch +54 -0
  19. package/patches/@vue+compiler-dom+3.2.45.patch +22 -0
  20. package/patches/@vue+compiler-dom+3.6.0-beta.10.patch +22 -0
  21. package/patches/@vue+compiler-sfc+3.2.45.patch +1986 -0
  22. package/patches/@vue+compiler-sfc+3.6.0-beta.10.patch +69 -0
  23. package/patches/@vue+runtime-core+3.2.45.patch +353 -0
  24. package/patches/@vue+runtime-core+3.6.0-beta.10.patch +196 -0
  25. package/patches/@vue+runtime-dom+3.2.45.patch +81 -0
  26. package/patches/@vue+runtime-dom+3.6.0-beta.10.patch +47 -0
  27. package/patches/postcss-js+5.1.0.patch +20 -0
  28. package/patches/vite+4.0.0.patch +117 -0
  29. package/patches/vite+8.0.9.patch +77 -0
  30. package/patches/vue-router+4.1.6.patch +17 -0
  31. package/patches/vue-router+5.0.6.patch +0 -0
  32. package/{patches/node_modules/@vue/compiler-sfc/dist/jsview-css-to-js.js → thirdparty/@vue/compiler-sfc/jsview-css-to-js.cjs} +15 -10
  33. package/{patches/node_modules/@vue/compiler-sfc/dist/jsview-style-checker.js → thirdparty/@vue/compiler-sfc/jsview-style-checker.cjs} +6 -1
  34. package/{patches/node_modules/@vue/compiler-sfc/dist/jsview-style-formator.cjs.js → thirdparty/@vue/compiler-sfc/jsview-style-formator.cjs} +3 -0
  35. package/thirdparty/@vue/runtime-core/jsview-render-break.mjs +189 -0
  36. package/thirdparty/vite/jsview-vite-extension.mjs +336 -0
  37. package/tools/jsview-build-zip.mjs +7 -2
  38. package/tools/jsview-common.mjs +18 -4
  39. package/tools/{jsview-logger.js → jsview-logger.cjs} +1 -1
  40. package/tools/jsview-post-build.mjs +88 -6
  41. package/tools/jsview-post-install.mjs +110 -103
  42. package/tools/jsview-run-tool.mjs +3 -6
  43. package/tools/jsview-vue-devtools.mjs +1 -1
  44. package/loader/jsview-react-main.js +0 -37
  45. package/loader/jsview-react-script-loader.js +0 -134
  46. package/patches/node_modules/@vitejs/plugin-react/dist/index.cjs +0 -520
  47. package/patches/node_modules/@vitejs/plugin-react/package.json +0 -55
  48. package/patches/node_modules/@vitejs/plugin-vue/dist/index.mjs +0 -2756
  49. package/patches/node_modules/@vitejs/plugin-vue/package.json +0 -51
  50. package/patches/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js +0 -3152
  51. package/patches/node_modules/@vue/compiler-dom/package.json +0 -43
  52. package/patches/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +0 -17730
  53. package/patches/node_modules/@vue/compiler-sfc/package.json +0 -59
  54. package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -8154
  55. package/patches/node_modules/@vue/runtime-core/package.json +0 -38
  56. package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +0 -1531
  57. package/patches/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +0 -1740
  58. package/patches/node_modules/@vue/runtime-dom/package.json +0 -42
  59. package/patches/node_modules/postcss-js/objectifier.js +0 -94
  60. package/patches/node_modules/postcss-js/package.json +0 -42
  61. package/patches/node_modules/react-dev-utils/WebpackDevServerUtils.js +0 -450
  62. package/patches/node_modules/react-dev-utils/package.json +0 -88
  63. package/patches/node_modules/react-dom/cjs/react-dom.development.js +0 -29868
  64. package/patches/node_modules/react-dom/cjs/react-dom.production.min.js +0 -323
  65. package/patches/node_modules/react-dom/package.json +0 -62
  66. package/patches/node_modules/react-scripts/config/paths.js +0 -179
  67. package/patches/node_modules/react-scripts/config/webpack.config.js +0 -858
  68. package/patches/node_modules/react-scripts/package.json +0 -108
  69. package/patches/node_modules/vite/dist/node/chunks/dep-ed9cb113.js +0 -63182
  70. package/patches/node_modules/vite/dist/node/constants.js +0 -125
  71. package/patches/node_modules/vite/dist/node/jsview-vite-extension.js +0 -245
  72. package/patches/node_modules/vite/package.json +0 -153
  73. package/patches/node_modules/vue-router/dist/vue-router.mjs +0 -3613
  74. package/patches/node_modules/vue-router/package.json +0 -114
  75. package/patches/node_modules/webpack-dev-server/client/utils/reloadApp.js +0 -76
  76. package/patches/node_modules/webpack-dev-server/client/utils/sendMessage.js +0 -21
  77. package/patches/node_modules/webpack-dev-server/package.json +0 -141
  78. /package/patches/{node_modules/@originjs/vite-plugin-federation/1.3.4/@originjs+vite-plugin-federation+1.3.4.patch → @originjs+vite-plugin-federation+1.3.4.patch} +0 -0
@@ -1,2 +1,2 @@
1
- /* eslint-disable */ class e{static CreateAudioPlayer(){return console.warn("BrowserPlatformMediaBridge.CreateAudioPlayer() is not supported"),{}}static CreateVideoPlayer(){return console.warn("BrowserPlatformMediaBridge.CreateVideoPlayer() is not supported"),{}}static OnCssStyleChanged(e,t){const s=this;s.parentNode,s.style.position="fixed",s.style.left=(t.left?t.left:0)+"px",s.style.top=(t.top?t.top:0)+"px",s.style.width=(t.width?t.width:0)+"px",s.style.height=(t.height?t.height:0)+"px",s.style.objectFit=t.objectFit,s.style.visibility=t.visibility}static JsvFinalize(){console.log("BrowserPlatformMediaBridge.JsvFinalize()");this.pause()}}window.JsvCode.BrowserPlatformMediaBridge||(window.JsvCode.BrowserPlatformMediaBridge=e);class t{constructor(e,t){this.prevented=!1,this.target=t,this.timeStamp=Date.now(),this.type=e}preventDefault(){this.prevented=!0}jsvIsPrevented(){return this.prevented}}class s extends t{constructor(e){super(e)}}class i extends t{constructor(e,t){super(e),this.options=t}initCustomEvent(e,t,s,i){this.type=e}get detail(){return this.options?.detail}}if(void 0===window.Forge)throw new Error("Error: EngineJs missing");var n,o,r,a,l,c,d,h,u,p,m,f,v,g,w,y,k=window.Forge;window.JsvCoreApi.setForgeJsHandle(k);class C{static EnableEventListener(e){const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.SetOnEventListener(t,e)}static CreateElement(e,t){C.PushLazyTask(C.TaskType.CreateElement,e,t)}static BindElementToRootView(e){C.PushLazyTask(C.TaskType.BindElementToRootView,e)}static InsertElementChild(e,t,s){C.PushLazyTask(C.TaskType.InsertElementChild,e,t,s)}static RemoveElementChild(e,t){C.PushLazyTask(C.TaskType.RemoveElementChild,e,t)}static MoveElementChild(e,t,s,i){C.PushLazyTask(C.TaskType.MoveElementChild,e,t,s,i)}static ReOrderElementChild(e,t,s){C.PushLazyTask(C.TaskType.ReOrderElementChild,e,t,s)}static AddElementEventListener(e,t,s){C.PushLazyTask(C.TaskType.AddElementEventListener,e,t,s)}static RemoveElementEventListener(e,t,s){C.PushLazyTask(C.TaskType.RemoveElementEventListener,e,t,s)}static SetElementText(e,t){C.PushLazyTask(C.TaskType.SetElementText,e,t)}static SetElementAttribute(e,t,s){C.PushLazyTask(C.TaskType.SetElementAttribute,e,t,s),C.LazyTaskSyncedListenerMap.has(e)&&C.CachedSyncListenIdSet.add(e)}static GetElementBoundingClientStyles(e,t){return C.RunSyncTask(C.TaskType.GetElementBoundingClientStyles,e,t)}static SetForgeViewInnerProps(e,t,s){let i=0;(t=t.substr(12)).startsWith("mask-")?(i=1,t=t.substr(5)):t.startsWith("mmask")&&(i=2,t=t.substr(6)),C.PushLazyTask(C.TaskType.SetForgeViewInnerProps,e,t,i,""+s)}static DeclareStyleSheets(e){C.PushLazyTask(C.TaskType.DeclareStyleSheets,-1,e)}static UndeclareStyleSheets(e){C.PushLazyTask(C.TaskType.UndeclareStyleSheets,-1,e)}static SetStyleProperty(e,t,s){C.PushLazyTask(C.TaskType.SetStyleProperty,e,t,s),C.LazyTaskSyncedListenerMap.has(e)&&C.CachedSyncListenIdSet.add(e)}static GetStyleProperties(e,t){return C.RunSyncTask(C.TaskType.GetStyleProperties,e,t)}static AppendLazyTaskSyncedListener(e,t){C.LazyTaskSyncedListenerMap.set(e,t)}static RemoveLazyTaskSyncedListener(e){C.LazyTaskSyncedListenerMap.delete(e)}static RequestSwapAllCachedTasks(){if(0==C.CachedLazyTaskList.length)return;const e=JSON.stringify(C.CachedLazyTaskList);C.CachedLazyTaskList=[];const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.RunLazyTaskList(t,e),C.CachedLazyTaskAmount=0;for(const e of C.CachedSyncListenIdSet){const t=C.LazyTaskSyncedListenerMap.get(e);t?.()}C.CachedSyncListenIdSet.clear()}static GetElementAttribute(e,t){return C.RunSyncTask(C.TaskType.GetElementAttribute,e,t)}static InsertKeyFrame(e,t){C.PushLazyTask(C.TaskType.InsertKeyFrameDefine,-1,e,t)}static RemoveKeyFrame(e){C.PushLazyTask(C.TaskType.RemoveKeyFrameDefine,-1,e)}static GetRelativePosition(e,t){const s=C.RunSyncTask(C.TaskType.GetRelativePosition,e,t);return JSON.parse(s)}static SearchNextFocus(e,t){return C.RunSyncTask(C.TaskType.SearchNextFocus,e,t)}static GetLazyTaskAmount(){return 0}static RunSyncTask(e,t,...s){C.RequestSwapAllCachedTasks(),console.log("RunSyncTask()"+window.NativeMicroTime());const i=window.JsvCode.Dom.PlatformBridge.JsViewId;return window.JsvCode.Dom.PlatformBridge.RunSyncTask(i,e,t,...s)}static PushLazyTask(e,t,...s){let i=1;e==C.TaskType.SetStyleProperty?i=2:e==C.TaskType.DeclareStyleSheets&&(i=3),C.CachedLazyTaskAmount+=i,C.CachedLazyTaskList.push([e,t,...s]),k.sRenderBridge?.RequestSwap()}}C.CachedLazyTaskAmount=0,C.CachedLazyTaskList=new Array,C.CachedSyncListenIdSet=new Set,C.LazyTaskSyncedListenerMap=new Map,C.TaskType={CreateElement:10,BindElementToRootView:11,InsertElementChild:12,RemoveElementChild:13,AddElementEventListener:14,RemoveElementEventListener:15,SetElementText:16,SetElementAttribute:17,GetElementBoundingClientStyles:18,GetElementAttribute:19,MoveElementChild:20,GetRelativePosition:21,ReOrderElementChild:22,SearchNextFocus:23,DeclareStyleSheets:30,SetStyleProperty:31,GetStyleProperties:32,UndeclareStyleSheets:39,SetForgeViewInnerProps:40,InsertKeyFrameDefine:41,RemoveKeyFrameDefine:42};class T{}T.Dom=C,T.Media=class{static CreateAudioPlayer(){return window.JsvCode.Media.PlatformBridge.CreateAudioPlayer()}static CreateVideoPlayer(){return window.JsvCode.Media.PlatformBridge.CreateVideoPlayer()}};class x{static GenerateId(){const e=this.UniqueId++;if(e>=this.MaxUniqueId)throw new Error("JsvUniqueId.GenerateId() Failed to create unique id. id is overflow.");return e}}x.UniqueId=0,x.MaxUniqueId=Math.pow(2,31)-1;class N{constructor(e){this.childNodes=[],this.nodeType=e,this.ownerDocument=window.document,this.parentNode=null,this.jsvEventListenerMap=null,this.jsvChildChangedCallback=null}jsvFinalize(){}appendChild(e){this.childNodes.push(e),e.parentNode=this,this.jsvChildChangedCallback?.()}removeChild(e){let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to remove node, child node is not found. node=",e);this.childNodes.splice(t,1),e.parentNode=null,this.jsvChildChangedCallback?.()}insertBefore(e,t){this.insertBeforeInner(e,t)}get previousSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.previousSibling(), this node not found. this=",this);return e[t-1]}get nextSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.nextSibling(), this node not found. this=",this);return e[t+1]}addEventListener(e,t,s){this.jsvEventListenerMap||(this.jsvEventListenerMap=new Map);let i=this.jsvEventListenerMap?.get(e);i||(i=new Set,this.jsvEventListenerMap?.set(e,i)),i.add(t)}removeEventListener(e,t,s){let i=this.jsvEventListenerMap?.get(e);i&&(i.delete(t),i.size<=0&&this.jsvEventListenerMap?.delete(e),0==this.jsvEventListenerMap?.size&&(this.jsvEventListenerMap=null))}dispatchEvent(e){if(!this.jsvEventListenerMap)return void console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No event added.");let t=this.jsvEventListenerMap?.get(e.type);if(t){for(let s of t)if(s?.(e),e.jsvIsPrevented())break}else console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No listener added.")}jsvObserveChildChanged(e){this.jsvChildChangedCallback=e}jsvMoveChildReOrder(e,t){{let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to call jsvMoveChildReOrder, node not found. node=",e);this.childNodes.splice(t,1)}{let s=this.childNodes.length;if(t&&(s=this.childNodes.indexOf(t),s<0))throw new DOMException("Failed to call move node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e)}this.jsvChildChangedCallback?.()}jsvMoveChildToNewParent(e,t,s){let i=this.childNodes.indexOf(e);if(i<0)throw new DOMException("Failed to call jsvMoveChildToNewParent, node not found. node=",e);this.childNodes.splice(i,1),e.parentNode=null,this.jsvChildChangedCallback?.(),t.insertBeforeInner(e,s)}jsvGetEventListenerSet(e){const t=this.jsvEventListenerMap?.get(e);return t}insertBeforeInner(e,t){let s=this.childNodes.length;if(void 0===t)throw new DOMException("TypeError: Failed to execute 'insertBefore' on 'Node': 2 arguments required, but only 1 present.");if(null!==t&&(s=this.childNodes.indexOf(t)),s<0)throw new DOMException("Failed to call insert node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e),e.parentNode=this,this.jsvChildChangedCallback?.()}}function b(e,t,s){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:s?"".concat(s," ",t):t})}N.ELEMENT_NODE=1,N.TEXT_NODE=3,N.COMMENT_NODE=8,N.DOCUMENT_NODE=9,N.NOLAYOUT_NODE=10;class I{static HasGetterMethod(e){switch(e){case I.Layout.Height:case I.Layout.Left:case I.Layout.Top:case I.Layout.Width:case I.Effect.ObjectFit:return!0;default:return!1}}static ToConst(e){return e==I.Layout.Height?I.Layout.Height:e==I.Layout.Left?I.Layout.Left:e==I.Layout.Top?I.Layout.Top:e==I.Layout.Width?I.Layout.Width:e==I.Flex.FlexDirection?I.Flex.FlexDirection:e==I.Flex.FlexWrap?I.Flex.FlexWrap:e==I.Flex.JustifyContent?I.Flex.JustifyContent:e==I.Flex.AlignItems?I.Flex.AlignItems:e==I.Flex.AlignContent?I.Flex.AlignContent:e==I.Flex.AlignSelf?I.Flex.AlignSelf:e==I.Flex.FlexGrow?I.Flex.FlexGrow:e==I.Background.BackgroundColor?I.Background.BackgroundColor:e==I.Background.BackgroundImage?I.Background.BackgroundImage:e==I.Background.BorderRadius?I.Background.BorderRadius:e==I.Background.JsvImageBlendType?I.Background.JsvImageBlendType:e==I.Effect.BackfaceVisibility?I.Effect.BackfaceVisibility:e==I.Effect.BorderImage?I.Effect.BorderImage:e==I.Effect.BorderImageWidth?I.Effect.BorderImageWidth:e==I.Effect.BorderImageOutset?I.Effect.BorderImageOutset:e==I.Effect.Display?I.Effect.Display:e==I.Effect.ObjectFit?I.Effect.ObjectFit:e==I.Effect.Opacity?I.Effect.Opacity:e==I.Effect.Overflow?I.Effect.Overflow:e==I.Effect.Perspective?I.Effect.Perspective:e==I.Effect.PerspectiveOrigin?I.Effect.PerspectiveOrigin:e==I.Effect.Transform?I.Effect.Transform:e==I.Effect.TransformOrigin?I.Effect.TransformOrigin:e==I.Effect.TransformStyle?I.Effect.TransformStyle:e==I.Effect.Visibility?I.Effect.Visibility:e==I.Effect.ZIndex?I.Effect.ZIndex:e==I.Text.Color?I.Text.Color:e==I.Text.FontFamily?I.Text.FontFamily:e==I.Text.FontSize?I.Text.FontSize:e==I.Text.FontStyle?I.Text.FontStyle:e==I.Text.FontWeight?I.Text.FontWeight:e==I.Text.LineHeight?I.Text.LineHeight:e==I.Text.TextAlign?I.Text.TextAlign:e==I.Text.TextOverflow?I.Text.TextOverflow:e==I.Text.TextShadow?I.Text.TextShadow:e==I.Text.WebkitTextStroke?I.Text.WebkitTextStroke:e==I.Text.WhiteSpace?I.Text.WhiteSpace:e==I.Text.WordWrap?I.Text.WordWrap:e==I.Text.Direction?I.Text.Direction:e==I.Text.JsvTextEmoji?I.Text.JsvTextEmoji:e==I.Text.JsvTextLatex?I.Text.JsvTextLatex:e==I.Text.JsvTextAlignMinWidth?I.Text.JsvTextAlignMinWidth:e==I.Text.JsvTextVerticalAlign?I.Text.JsvTextVerticalAlign:e==I.Text.JsvTextLineAlign?I.Text.JsvTextLineAlign:e==I.Text.JsvTextInnerDirection?I.Text.JsvTextInnerDirection:e==I.Motion.Animation?I.Motion.Animation:e==I.Motion.Transition?I.Motion.Transition:e==I.Motion.AnimationFillMode?I.Motion.AnimationFillMode:null}constructor(){throw new Error("new StyleName() is forbidden.")}}I.Layout=(b(n=class{constructor(){throw new Error("new StyleName.Layout() is forbidden.")}},"Layout"),n.Height="height",n.Left="left",n.Top="top",n.Width="width",n),I.Flex=(b(o=class{constructor(){throw new Error("new StyleName.Flex() is forbidden.")}},"Flex"),o.FlexDirection="flexDirection",o.FlexWrap="flexWrap",o.JustifyContent="justifyContent",o.AlignItems="alignItems",o.AlignContent="alignContent",o.AlignSelf="alignSelf",o.FlexGrow="flexGrow",o),I.Background=(b(r=class{constructor(){throw new Error("new StyleName.Background() is forbidden.")}},"Background"),r.BackgroundColor="backgroundColor",r.BackgroundImage="backgroundImage",r.BorderRadius="borderRadius",r.JsvImageBlendType="JsvImageBlendType",r),I.Effect=(b(a=class{constructor(){throw new Error("new StyleName.Effect() is forbidden.")}},"Effect"),a.BackfaceVisibility="backfaceVisibility",a.BorderImage="borderImage",a.BorderImageWidth="borderImageWidth",a.BorderImageOutset="borderImageOutset",a.Display="display",a.ObjectFit="objectFit",a.Opacity="opacity",a.Overflow="overflow",a.Perspective="perspective",a.PerspectiveOrigin="perspectiveOrigin",a.Transform="transform",a.TransformOrigin="transformOrigin",a.TransformStyle="transformStyle",a.Visibility="visibility",a.ZIndex="zIndex",a),I.Text=(b(l=class{constructor(){throw new Error("new StyleName.Text() is forbidden.")}},"Text"),l.Color="color",l.FontFamily="fontFamily",l.FontSize="fontSize",l.FontStyle="fontStyle",l.FontWeight="fontWeight",l.LineHeight="lineHeight",l.TextAlign="textAlign",l.TextOverflow="textOverflow",l.TextShadow="textShadow",l.WebkitTextStroke="WebkitTextStroke",l.WhiteSpace="whiteSpace",l.WordWrap="wordWrap",l.Direction="direction",l.JsvTextEmoji="JsvTextEmoji",l.JsvTextLatex="JsvTextLatex",l.JsvTextAlignMinWidth="JsvTextAlignMinWidth",l.JsvTextVerticalAlign="JsvTextVerticalAlign",l.JsvTextLineAlign="JsvTextLineAlign",l.JsvTextInnerDirection="JsvTextInnerDirection",l),I.Motion=(b(c=class{constructor(){throw new Error("new StyleName.Motion() is forbidden.")}},"Motion"),c.Animation="animation",c.Transition="transition",c.AnimationFillMode="animationFillMode",c);class D{constructor(e){let t=-1,s=null;null==e?t=D.DataType.Null:Number(e)===e&&e%1==0?t=D.DataType.Int32:Number(e)===e&&e%1!=0?t=D.DataType.Float:"string"==typeof e||e instanceof String?t=D.DataType.String:e instanceof D.AnimationImpl?t=D.DataType.Animation:e instanceof D.CornerImpl?t=D.DataType.Corner:e instanceof D.RectImpl?t=D.DataType.Rect:e instanceof D.TextShadowImpl?t=D.DataType.TextShadow:e instanceof D.WebkitTextStrokeImpl?t=D.DataType.WebkitTextStroke:e instanceof D.TransitionImpl?t=D.DataType.Transition:e instanceof D.BorderImageImpl&&(t=D.DataType.BorderImage),e!=D.InvalidInt32&&e!=D.InvalidFloat&&e!=D.InvalidPointer?s=e:(t=D.DataType.Null,s=null),this.data=new D.DataInfo,this.data.index=t,this.data.value=s}toString(){let e=null;switch(this.data.index){case D.DataType.Null:return"";case D.DataType.Int32:case D.DataType.Float:return String(this.get());case D.DataType.String:e=this.get();break;case D.DataType.Animation:case D.DataType.Corner:case D.DataType.Rect:case D.DataType.TextShadow:case D.DataType.WebkitTextStroke:case D.DataType.Transition:case D.DataType.BorderImage:case D.DataType.BackgroundImage:e=this.get().rawValue;break;default:console.error("Failed to do StyleValue.toString()")}return e??""}is(e){return this.data.index==e}get(){return this.data.value}reset(e){this.data.value=e.data.value,this.data.index=e.data.index}equals(e){return this.data.value===e.data.value&&this.data.index===e.data.index}}D.Base=class{constructor(e){this.rawValue=e}},D.AnimationImpl=class extends D.Base{constructor(e){super(e),this.name="",this.duration=0,this.timingFunction=null,this.delay=0,this.iterationCount=0,this.direction=!1}},D.CornerImpl=class extends D.Base{constructor(e){super(e),this.topLeft=0,this.topRight=0,this.bottomRight=0,this.bottomLeft=0}},D.RectImpl=class extends D.Base{constructor(e){super(e),this.top=0,this.right=0,this.left=0,this.bottom=0}},D.TextShadowImpl=class extends D.Base{constructor(e){super(e),this.hShadow=0,this.vShadow=0,this.blur=0,this.color=void 0}},D.WebkitTextStrokeImpl=class extends D.Base{constructor(e){super(e),this.length=0,this.color=void 0}},D.TransitionImpl=class extends D.Base{constructor(e){super(e),this.animationMap=new Map}},D.BorderImageImpl=class extends D.Base{constructor(e){super(e),this.source="",this.slice=null}},D.BackgroundImageImpl=(b(d=class extends D.Base{constructor(e){super(e),this.type=0,this.urlPath=""}},"BackgroundImageImpl"),d.eType={UNKNOWN:0,LINEAR_GRADIENT:1,URL_PATH:2},d.LinearGradient=class{constructor(){this.fromX=0,this.fromY=0,this.toX=0,this.toY=0,this.stops=[]}},d),D.DataType=(b(h=class{},"DataType"),h.Null=0,h.Int32=1,h.Float=2,h.String=3,h.Animation=4,h.Corner=5,h.Rect=6,h.TextShadow=7,h.WebkitTextStroke=8,h.Transition=9,h.BorderImage=10,h.BackgroundImage=11,h),D.InvalidInt32=Number.MIN_VALUE,D.InvalidFloat=Number.NaN,D.InvalidPointer=null,D.DataInfo=class{constructor(){this.value=null,this.index=-1}},b(u=class{},"Text"),u.Color="#000000",u.FontFamily="黑体",u.FontSize=10,u.FontStyle="normal",u.FontWeight="normal",u.LineHeight=0,u.TextAlign="start",u.TextOverflow="clip",u.TextShadow=null,u.WebkitTextStroke=null,u.WhiteSpace="normal",u.WordWrap="normal",u.Direction="ltr",u.JsvTextEmoji=0,u.JsvTextLatex=0,u.JsvTextAlignMinWidth=0,u.JsvTextVerticalAlign="top",u.JsvTextLineAlign="middle",u.JsvTextInnerDirection="unset",b(p=class{constructor(){this.height=D.InvalidInt32,this.left=D.InvalidInt32,this.top=D.InvalidInt32,this.width=D.InvalidInt32}},"Layout"),p.Name="layout",b(m=class{constructor(){this.flexDirection=D.InvalidInt32,this.flexWrap=D.InvalidInt32,this.justifyContent=D.InvalidInt32,this.alignItems=D.InvalidInt32,this.alignContent=D.InvalidInt32,this.alignSelf=D.InvalidInt32,this.flexGrow=D.InvalidFloat}},"Flex"),m.Name="flex",b(f=class{constructor(){this.backgroundColor=D.InvalidPointer,this.backgroundImage=D.InvalidPointer,this.borderRadius=D.InvalidPointer,this.JsvImageBlendType=D.InvalidInt32}},"Background"),f.Name="background",b(v=class{constructor(){this.backfaceVisibility=D.InvalidPointer,this.borderImage=D.InvalidPointer,this.borderImageWidth=D.InvalidPointer,this.borderImageOutset=D.InvalidPointer,this.display=D.InvalidPointer,this.objectFit=D.InvalidPointer,this.opacity=D.InvalidFloat,this.overflow=D.InvalidPointer,this.perspective=D.InvalidInt32,this.perspectiveOrigin=D.InvalidPointer,this.transform=D.InvalidPointer,this.transformOrigin=D.InvalidPointer,this.transformStyle=D.InvalidPointer,this.visibility=D.InvalidPointer,this.zIndex=D.InvalidInt32}},"Effect"),v.Name="effect",b(g=class{constructor(){this.color=D.InvalidPointer,this.fontFamily=D.InvalidPointer,this.fontSize=D.InvalidInt32,this.fontStyle=D.InvalidPointer,this.fontWeight=D.InvalidPointer,this.lineHeight=D.InvalidInt32,this.textAlign=D.InvalidPointer,this.textOverflow=D.InvalidPointer,this.textShadow=D.InvalidPointer,this.webkitTextStroke=D.InvalidPointer,this.whiteSpace=D.InvalidPointer,this.wordWrap=D.InvalidPointer,this.direction=D.InvalidPointer,this.jsvTextEmoji=D.InvalidInt32,this.jsvTextLatex=D.InvalidInt32,this.jsvTextAlignMinWidth=D.InvalidInt32,this.jsvTextVerticalAlign=D.InvalidPointer,this.jsvTextLineAlign=D.InvalidPointer,this.jsvTextInnerDirection=D.InvalidPointer}},"Text"),g.Name="text",b(w=class{constructor(){this.animation=D.InvalidPointer,this.transition=D.InvalidPointer,this.animationFillMode="none"}},"Motion"),w.Name="motion";class S{constructor(e,t){if(this.href="",this.origin="",this.protocol="",this.host="",this.hostname="",this.port="",this.pathname="",this.search="",this.hash="",!e)return;if(!0===e.startsWith("url")){let t=e.indexOf("(")+1,s=e.lastIndexOf(")");if("undefined"===(e=e.substring(t,s).trim())||"null"===e||0===e.length)return}if(!0===e.startsWith("data:")||!0===e.startsWith("jsvtexturestore:"))return void(this.href=e);let s=e.indexOf("://");if(!(s<0||s>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),!0===e.startsWith("/"))e=window.location.origin+e;else if(!0===e.startsWith("./")&&void 0!==window.JsView&&void 0!==window.JsView.Dom.JsSubPath){if(void 0===window.JsView.Dom.MainPath||"undefined"===window.JsView.Dom.MainPathRef||window.JsView.Dom.MainPathRef!==window.location.href){window.JsView.Dom.JsSubPath.startsWith("/")||(window.JsView.Dom.JsSubPath="/"+window.JsView.Dom.JsSubPath),window.JsView.Dom.JsSubPath.endsWith("/")||(window.JsView.Dom.JsSubPath=window.JsView.Dom.JsSubPath+"/"),window.JsView.Dom.MainPathRef=window.location.href;let e=window.location.pathname.lastIndexOf(window.JsView.Dom.JsSubPath);window.JsView.Dom.MainPath=window.location.origin+window.location.pathname.substring(0,e)}e=window.JsView.Dom.MainPath+e.substring(1)}if(this.href=e,!t)return;let i=this.href,n=i.indexOf("#");n>0&&(this.hash=i.substring(n),i=i.substring(0,n));let o=i.indexOf("?");o>1&&(this.search=i.substring(o),i=i.substring(0,o));let r=i,a=r.indexOf("://");this.protocol=a>0?r.substring(0,a+1):"";let l=a>1?r.substring(a+3):"";a=l.indexOf("/"),this.host=a>0?l.substring(0,a):"",this.pathname=a>=1?l.substring(a):"","file:"==this.protocol&&(this.host="",this.pathname=l),this.origin=this.protocol+"//"+this.host,a=this.host.indexOf(":"),this.hostname=a>0?this.host.substring(0,a):this.host,this.port=a>1?this.host.substring(a+1):""}replace(e){this.href=e}}class E{static JsvDeclarePrototype(){for(let e in I){let t=I[e];for(let e in t){let s=t[e];if("string"!=typeof s)continue;const i={set:function(e){this.setProperty(s,e)},get:function(){return this.getPropertyValue(s)}};Object.defineProperty(E.prototype,s,i)}}}constructor(e){this.cachedProps={},this.nativeId=e}setProperty(e,t){if(window.JsvCode.Dom.CheckStyleFormat?.(e,t),e==I.Background.BackgroundImage&&"string"==typeof t)if(0==t.indexOf("linear-gradient")){const e=t.match(/\(/g)?.length,s=t.match(/\)/g)?.length;e!=s&&(console.error(`StyleError: illegal linear-gradient value '${t}'`),t="")}else{t=new S(t).href}else if(e==I.Effect.BorderImage&&"string"==typeof t){const e=t.split(" ");e.length>0&&(e[0]=new S(e[0]).href),t=e.join(" ")}else e==I.Effect.Display&&(this.cachedProps[e]=t);T.Dom.SetStyleProperty(this.nativeId,e,t)}getPropertyValue(e){if(e==I.Effect.Display)return this.cachedProps[e];throw console.error("StyleDeclaration.getPropertyValue() propName="+e),new Error("Get style value is unimplemented because it's low performance.")}jsvGetProperties(...e){const t=JSON.stringify(e),s=T.Dom.GetStyleProperties(this.nativeId,t);return JSON.parse(s)}}class F extends t{constructor(e){super(e)}}!function(e){e[e.Cancel=0]="Cancel",e[e.Click=1]="Click",e[e.LongPress=2]="LongPress",e[e.LongPressRelease=3]="LongPressRelease",e[e.touchFirstStart=4]="touchFirstStart",e[e.touchLastEnd=5]="touchLastEnd"}(y||(y={}));class O extends N{static JsvEnableEventListener(){T.Dom.EnableEventListener((function(e,t,...s){let i=O.JsvEventListenerMap.get(e);const n=i?.get(t);n?.(t,...s)}))}constructor(e){super(N.ELEMENT_NODE),this.jsvNativeId=-1,this.jsvAttrStore={},this.jsvClientSizeStore={},this.tagName=e,this.tagName!=O.JsvTagName.Audio&&this.tagName!=O.JsvTagName.Div&&this.tagName!=O.JsvTagName.Image&&this.tagName!=O.JsvTagName.Video&&this.tagName!=O.JsvTagName.JsvFDiv||(this.jsvNativeId=x.GenerateId(),this.style=new E(this.jsvNativeId),T.Dom.CreateElement(this.jsvNativeId,e))}appendChild(e){e.parentNode?this.moveChildNode(e,null):(super.appendChild(e),this.jsvInsertChild(e,null))}removeChild(e){super.removeChild(e),this.jsvRemoveChild(e),e instanceof O&&e.jsvNativeId>0&&T.Dom.RemoveElementChild(this.jsvNativeId,e.jsvNativeId)}insertBefore(e,t){e.parentNode?e.parentNode==this?(this.jsvMoveChildReOrder(e,t),this.jsvReOrderChildNode(e,t)):this.moveChildNode(e,t):(super.insertBefore(e,t),this.jsvInsertChild(e,t))}addEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);i?.has(t)?console.warn("Element.addEventListener() Faild to add listener, func is exists"):(s=this.jsvCheckEventOptions(s),this.jsvNativeId&&(this.jsvAddListener(this.jsvNativeId,e),T.Dom.AddElementEventListener(this.jsvNativeId,e,s)),super.addEventListener(e,t,s))}removeEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);0!=!!i?.has(t)&&(s=this.jsvCheckEventOptions(s),super.removeEventListener(e,t,s),this.jsvNativeId&&(this.jsvRemoveListener(this.jsvNativeId,e),T.Dom.RemoveElementEventListener(this.jsvNativeId,e,s)))}get childElementCount(){return this.childNodes.length}get firstElementChild(){return this.childNodes.length>0?this.childNodes?.[0]:null}get lastElementChild(){const e=this.childNodes.length;return e>0?this.childNodes[e-1]:null}set className(e){this.setAttribute("class",e)}get clientWidth(){return this.jsvClientSizeStore.clientWidth||(this.jsvClientSizeStore.clientWidth=T.Dom.GetElementAttribute(this.jsvNativeId,"clientWidth")),this.jsvClientSizeStore.clientWidth}get clientHeight(){return this.jsvClientSizeStore.clientHeight||(this.jsvClientSizeStore.clientHeight=T.Dom.GetElementAttribute(this.jsvNativeId,"clientHeight")),this.jsvClientSizeStore.clientHeight}setAttribute(e,t){e&&(this.jsvAttrStore[e]=t,this.jsvNativeId&&(e.startsWith("data-jsv-vw-")?T.Dom.SetForgeViewInnerProps(this.jsvNativeId,e,t):"class"===e||e.startsWith("data-v-")||e.startsWith("data-jsv")||e.startsWith("dataJsv")?T.Dom.SetElementAttribute(this.jsvNativeId,e,t):"id"===e&&T.Dom.SetForgeViewInnerProps(this.jsvNativeId,"data-jsv-vw-id",t)))}removeAttribute(e){delete this.jsvAttrStore[e],("class"==e||e.startsWith("data-v-")||"src"==e)&&this.jsvNativeId&&T.Dom.SetElementAttribute(this.jsvNativeId,e,null)}getAttribute(e){return this.jsvAttrStore[e]}hasAttribute(e){return!!this.jsvAttrStore[e]}focus(){console.warn("warn: focus is invalid, use JsvFocusBlock to manager")}jsvGetBoundingClientRect(){const e="jsv-getbound",t=x.GenerateId();return new Promise(((s,i)=>{const n=o=>{const r=o.jsvParams?.[1];if(r!=t)return;o.preventDefault(),this.removeEventListener(e,n);const a=JSON.parse(o.jsvParams?.[0]??"{}");0===a.status?s(a.data):i(a.error)};this.addEventListener(e,n,{jsvtoken:t})}))}jsvSetTapListener(e,t=0){let s=this.jsvGetProxyView(!0);if(!e)return s.DragEnables(0),void s.SetTapListener(null);e.onClick&&(t|=1),(e.onLongPress||e.onLongPressRelease)&&(t|=2),e.onTouchStart&&(t|=8),e.onTouchEnd&&(t|=16),s.DragEnables(t),s.SetTapListener(((t,s)=>{switch(t){case y.Cancel:e.onCancel?.(s);break;case y.LongPress:e.onLongPress?.(s);break;case y.LongPressRelease:e.onLongPressRelease?.(s);break;case y.Click:e.onClick?.(s);break;case y.touchFirstStart:e.onTouchStart?.(s);break;case y.touchLastEnd:e.onTouchEnd?.(s);break;default:console.error("Error:onTap unknown type:"+t)}}))}jsvSetOnLazyTaskSyncedListener(e){T.Dom.AppendLazyTaskSyncedListener(this.jsvNativeId,e)}jsvOnEvent(e,...n){let o;e.startsWith("animation")?(o=new s(e),o.animationName=n[0]):e.startsWith("transition")?(o=new F(e),o.propertyName=n[0]):e.startsWith("jsv")?(o=new i(e),o.options={detail:n[0]},o.jsvParams=n):"click"==e&&(o=new t(e),o.target=this),o&&(o.target=this,this.dispatchEvent(o))}jsvGetProxyView(e){return e?(this.maskViewProxy||(this.maskViewProxy=k.NewDomProxyView(this.jsvNativeId,!0)),this.maskViewProxy):(this.mainViewProxy||(this.mainViewProxy=k.NewDomProxyView(this.jsvNativeId,!1)),this.mainViewProxy)}jsvGetProxyTexture(e){return this.mainViewTextureProxy||(this.mainViewTextureProxy=e.GetDomProxyTexture(this.jsvNativeId)),this.mainViewTextureProxy}jsvGetRelativePosition(e){return T.Dom.GetRelativePosition(this.jsvNativeId,e.jsvNativeId)}jsvAddListener(e,t){let s=O.JsvEventListenerMap.get(e);s||(s=new Map,O.JsvEventListenerMap.set(e,s));this.jsvGetEventListenerSet(t)||s.set(t,this.jsvOnEvent.bind(this))}jsvRemoveListener(e,t){let s=O.JsvEventListenerMap.get(e);if(!s)return;this.jsvGetEventListenerSet(t)||s.delete(t)}moveChildNode(e,t){console.log("Do move child node");let s=e.parentNode;s.jsvMoveChildToNewParent(e,this,t),this.jsvMoveChildNode(s,e,t)}jsvMoveChildNode(e,t,s){t.jsvNativeId&&(s=O.JsvFindBackwardForgeView(s),T.Dom.MoveElementChild(this.jsvNativeId,e.jsvNativeId,t.jsvNativeId,s?.jsvNativeId))}jsvReOrderChildNode(e,t){e.jsvNativeId&&(t=O.JsvFindBackwardForgeView(t),T.Dom.ReOrderElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvInsertChild(e,t){e.parentNode=this,e.nodeType===N.TEXT_NODE?this.textContent=e.nodeValue:e instanceof O&&e.jsvNativeId>0&&(t=O.JsvFindBackwardForgeView(t),T.Dom.InsertElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvRemoveChild(e){if(e instanceof O!=0){for(const t of e.childNodes)e.jsvRemoveChild(t);e.jsvFinalize(),T.Dom.RemoveLazyTaskSyncedListener(e.jsvNativeId),O.JsvEventListenerMap.delete(e.jsvNativeId)}}jsvCheckEventOptions(e){if(null==e)return null;if("object"!=typeof e||e instanceof Array)return console.warn("Event options is invalid for ",e),null;const t=["capture","once","passive","signal"];for(const[s,i]of Object.entries(e))0==t.includes(s)&&0==s.startsWith("jsv")&&(console.warn("Event options name is invalid: ",s),delete e[s]),"boolean"==typeof i?e[s]=+e[s]:"number"!=typeof i&&(console.warn("Event options value is invalid: ",i),delete e[s]);return e}static JsvFindBackwardForgeView(e){let t=e;for(;t&&!(t instanceof O);)t=t.nextSibling;return t}}O.JsvTagName={Anchor:"A",Audio:"AUDIO",Div:"DIV",Head:"HEAD",Image:"IMG",IFrame:"IFRAME",Link:"LINK",Script:"SCRIPT",Style:"STYLE",Svg:"SVG",Video:"VIDEO",JsvAudioTrack:"JSV-AUDIOTRACK",JsvFDiv:"FDIV"},O.JsvEventListenerMap=new Map;class L extends O{constructor(){super(O.JsvTagName.Anchor),this.href="",this.protocol="",this.host="",this.search="",this.hash="",this.hostname="",this.port="",this.pathname="",console.warn("Warnig: <a> is fake in JsView system")}jsvGetTagName(){return O.JsvTagName.Anchor}}class P extends N{constructor(e){super(N.COMMENT_NODE),this.textContent=e}}class M extends O{constructor(){super(O.JsvTagName.Div),this.textContentStore=null}get textContent(){return this.textContentStore}set textContent(e){this.textContentStore=e,this.jsvClientSizeStore={},T.Dom.SetElementText(this.jsvNativeId,e)}}const B="FocusDebug",J="__AppRoot__";let R=1,A=!1,j=!1,_=!1,W=[];function U(e){let t="";if(e){let s=e,i=s.RouterDelegate?.ref?.NameSpace;for(i=i==J?"":i,t=`[${i?i+", ":""}${s.BranchName}]`,s=s.GetParentPage();s;)i=s.RouterDelegate?.ref?.NameSpace,i=i==J?"":i,t=`[${i?i+", ":""}${s.BranchName}]->`+t,s=s.GetParentPage()}return t}function V(e,t){let s=U(e);if(null!=t){if(t.stack){let e=t.stack.split("\n");e.length>=3&&(t.stack=e.slice(2,6).join("\n"))}let e=t?.stack;t.stack=null,console.log(B,`focusChange(${t.from}):${t.askName}\n:originFocusStack:${t.originFStack}\n:focusStack:${s}\n:trace:${e}:`,t)}else console.log(B,`focusChange:${s} but empty debugSaveInfo`)}class G{constructor(e,t){this._DefaultFocusNameSpace=null,this._DefaultFocusNameSpace=null,this.RouterDelegate={ref:null},e||(this.RouterDelegate.ref=new K(!1,t))}enableFocusTrace(e){A=!0,j=e}getNameSpace(){let e=this.RouterDelegate.ref.NameSpace;return e==J?"":e}wrapWithNameSpace(e){let t=new G(!0);return t._DefaultFocusNameSpace=e,t.RouterDelegate=this.RouterDelegate,t}getNodeByName(e,t){return this.RouterDelegate.ref.getNodeByName(e,t)}focusByNameBeforeMount(e,t,s){if("string"==typeof e)return e.includes(".")&&(e=e.split(".")),this.RouterDelegate.ref.focusBeforeMount(e,t,s);console.error(`setFocus name=${e} is invalid`)}setFocus(e,t){this._DefaultFocusNameSpace&&this._DefaultFocusNameSpace.length>0&&(e=`${this._DefaultFocusNameSpace}.${e}`);let s=null;A&&(s={askName:e,deepToChild:t,from:"setFocus",stack:j?new Error("simulate-stack").stack:null});return this.focusByNameBeforeMount(e,t,s)}printAllFocusable(){this.RouterDelegate.ref.printAllFocusRecursive(this._DefaultFocusNameSpace,"")}getCurrentFocusStack(){const e=[];if(this.RouterDelegate.ref){let t=this.RouterDelegate.ref.getCurrentFocusNode();for(;t&&t instanceof z;){let s=t.RouterDelegate?.ref?.NameSpace;e.push({nameSpace:s==J||s==t.BranchName?"":s,name:t.BranchName}),t=t.GetParentPage()}}else console.error("getCurrentFocusStack failed: router delegate is null.");return e}getLastFocus(){if(z.sLastFocus){let e=z.sLastFocus;for(;e._LatestFocusChild;)e=e._LatestFocusChild;return e.BranchName}return null}getCurrentFocus(){if(this.RouterDelegate.ref){const e=this.RouterDelegate.ref.getCurrentFocusNode();if(e)return e.BranchName}return null}getCurrentFocusNode(){return this.RouterDelegate.ref?.getCurrentFocusNode()}getDeactivedPageFocus(){return this.RouterDelegate.ref?this.RouterDelegate.ref.getDeactivePageFocusName():null}returnFocusToParent(){const e=this.RouterDelegate.ref.getCurrentFocusNode();e?e.ReturnFocusToParent():console.warn("returnFocusToParent: current focus node is null.")}}class K{constructor(e,t){this._ChildMap={},this._FocusNameBeforeMount=null,this._BeforeMountStack=null,this._FocusNodeName=null,this._IsTemp=!!e,this.NameSpace=t}getDeactivePageFocusName(){return this._FocusNodeName}getCurrentFocusNode(e=!1){if(null==this._FocusNodeName)return null;let t=this._ChildMap[this._FocusNodeName];if(!t)return e||console.error("Erorr: node not mounted name="+this._FocusNodeName),null;if(t.RouterDelegate.ref!=this){let e=t.RouterDelegate.ref.getCurrentFocusNode();return null==e?t:e}return t}getNodeByName(e,t){let s=e.split(".");return this._FindRouterSearchBase(s,t)._GetNodeFromPathArray(s,e)}printAllFocusRecursive(e,t){let s=this.NameSpace==J?"":this.NameSpace,i=t+(t&&t.length>0?".":"")+s;for(let t in this._ChildMap){let s=this._ChildMap[t];if(!e||0==e.length||i.indexOf(e)>=0){let e=i===J?t:i+"."+t;console.log(e,s)}s.RouterDelegate.ref!=this&&s.RouterDelegate.ref.printAllFocusRecursive(e,i)}}_FindRouterSearchBase(e,t){if(0==e[0].length){let t=null;for(let e in this._ChildMap){t=this._ChildMap[e];break}if(null!=t){let s;do{s=t,t=t.GetParentPage()}while(null!=t);return e.splice(0,1),s.RouterDelegate.ref}return null}return t&&t.AsHub&&t.GetParentPage()?t.GetParentPage().RouterDelegate.ref:this}_GetNodeFromPathArray(e,t){let s=0,i=this;for(;s<e.length-1;){let n=!1;for(let t in i._ChildMap){let o=i._ChildMap[t].RouterDelegate.ref;if(null!=o&&o!=i&&o.NameSpace==e[s]){i=o,s++,n=!0;break}}if(!n)return void console.error(`Error: no found subpath fname=${t}`)}let n=e[s];return i._ChildMap.hasOwnProperty(n)?i._ChildMap[n]:void console.error(`Error: no found fname=${t}`)}add(e,t){if(e.indexOf(".")>=0)console.error("ERROR: FDiv name can not contains '.'");else if(this._ChildMap.hasOwnProperty(e)&&this._ChildMap[e]!==t)console.error(`ERROR: FDiv router branch name duplicated:[${e}]`);else if(this._ChildMap[e]=t,this._FocusNameBeforeMount)if("string"==typeof this._FocusNameBeforeMount)this._FocusNameBeforeMount==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount,!1,this._BeforeMountStack);else{this._FocusNameBeforeMount[0]==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount.slice(1),!1,this._BeforeMountStack)}}remove(e,t,s,i){let n=this._ChildMap[e];n&&n==t&&(delete this._ChildMap[e],n.OnRemoveFromTree()),this._FocusNodeName==e&&s&&(i||(this._FocusNodeName=s))}rename(e,t){if(!this._ChildMap.hasOwnProperty(e))return void console.error(`ERROR: alter name failed ${e}->${t}`);let s=this._ChildMap[e];delete this._ChildMap[e],this.add(t,s),this._FocusNodeName==e&&(this._FocusNodeName=t)}clearChildFocus(){this._FocusNodeName=null,this._FocusNameBeforeMount=null}hasPendingFocusRequest(){return!this._FocusNameBeforeMount}focusBeforeMount(e,t,s){if(A)if(null==s)console.error(B,`Error: found debug info missing from ${new Error("simulate-stack").stack}`);else if(!s.originFStack){let e=this.getCurrentFocusNode(!0);s.originFStack="Mark1:",s.originFStack+=e?U(e):`NoFocus[focusSet:${this._FocusNodeName} notMountFocus:${this._FocusNameBeforeMount}]`}if(_){let i=this;return W.push((()=>{i.focusBeforeMount(e,t,s)})),!0}_=!0;try{let i=!1;if("string"==typeof e){if(!e.includes(".")){i=!0;let n=this._ChildMap[e];if(this._FocusNodeName=e,n){this._FocusNameBeforeMount=null,this._BeforeMountStack=s,n.Focus(!t);let e=n.GetFocusChild();for(;e;){let t=e.GetFocusChild();if(!t){this._FocusNodeName=e.BranchName;break}e=t}return A&&V(e??n,s),n.RouterDelegate.ref!=this&&n.RouterDelegate.ref.clearChildFocus(),!0}return this._FocusNameBeforeMount=e,this._BeforeMountStack=s,A&&function(e,t){if(null!=t){if(t.stack){let e=t.stack.split("\n");e.length>=3&&(t.stack=e.slice(2,6).join("\n"))}let s=t?.stack;t.stack=null,console.log(B,`focusChange(wait-mount)(${t.from}):${t.askName}\n:originFocusStack:${t.originFStack}\n:focusName:${e}\n:trace:${s}:`,t)}else console.log(B,`focusChange(wait-mount):${e} but empty debugSaveInfo`)}(e,s),!1}console.error("error: name contain .")}else if("object"==typeof e&&Array.isArray(e)&&e.length>0){if(i=!0,1==e.length)return this.focusBeforeMount(e[0],t,s);{let i=e[0],n=this._ChildMap[i];return this._FocusNodeName=i,n?n.RouterDelegate.ref.focusBeforeMount(e.slice(1),t,s):(this._FocusNameBeforeMount=e,this._BeforeMountStack=s,!1)}}i||console.error("illegal name param",e)}finally{_=!1;let e=W.length;if(e>0){let t=R++;A&&console.log(B,`stash onFocus pop start(token=${t}) len=${e}`);let s=W;W=[];for(let t=0;t<e;t++)s[t]();A&&console.log(B,`stash onFocus pop done(token=${t})`)}}return!1}focus(e,t,s){let i=this.focusBeforeMount(e,t,s);return i||console.log("No found branch:"+e),i}forEach(e){for(let t in this._ChildMap)e(this._ChildMap[t],t,this._ChildMap)}printNodes(){console.log(this._ChildMap)}}class z extends k.PageBase{constructor(e,t){super(e),this._OnKeyDown=null,this._OnKeyUp=null,this._OnFocus=null,this._OnBlur=null,this._DispatchKeyDown=null,this._DispatchKeyUp=null,this._OnCustomEvent=null,this._DKeyDownProxy=void 0,this._DKeyUpProxy=void 0,this._Mounted=!1,this._MountWaitingList=null,this.AsHub=!1,this.InterfaceHub=null,this._TmpRouter=null,this._AutoShow=null,this.NativeId=-1,this.BranchName=e,this.NativeId=t,this.RouterDelegate={ref:null},this._TmpRouter=null,this._OriginDispatchKeyDown=this._OriginDispatchKeyDown.bind(this),this._OriginDispatchKeyUp=this._OriginDispatchKeyUp.bind(this),this._AutoShow=!1,z.sFocusNodeMap.set(this.NativeId,this)}async waitMounted(){if(this._Mounted)return;let e=this;return new Promise(((t,s)=>{e._MountWaitingList||(e._MountWaitingList=[]),e._MountWaitingList.push(t)}))}updateMountState(){this._Mounted=!0;let e=this.SubPages;for(let t in e)e[t].updateMountState();if(this._MountWaitingList&&this._MountWaitingList.length>0){for(const e of this._MountWaitingList)e();this._MountWaitingList=null}}getHub(){return this.InterfaceHub||(this.InterfaceHub=new G(!0),this.InterfaceHub.RouterDelegate=this.RouterDelegate),this.InterfaceHub}setHub(e){this.RouterDelegate.ref?console.error("Error: hub is already setted."):(this.RouterDelegate.ref=e.RouterDelegate.ref,this.AsHub=!0)}_UseParentRouter(e){this.RouterDelegate=e,this.InterfaceHub&&(this.InterfaceHub.RouterDelegate=e)}routerAdd(e,t){t.RouterDelegate.ref||t._UseParentRouter(this.RouterDelegate),this.RouterDelegate.ref||(this.RouterDelegate.ref=new K(!0)),this.RouterDelegate.ref.add(e,t)}routerRenameChild(e,t){this.RouterDelegate.ref.rename(e,t)}routerUnbind(e,t){let s;this.AsHub?this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref):s=this.RouterDelegate.ref,s&&s.remove(this.BranchName,this,e,t),this.RouterDelegate={ref:null}}setBranchName(e){if(e===this.BranchName)return;let t=this.BranchName;this.BranchName=e,this.PageName=e;let s=this.GetParentPage();s&&s.routerRenameChild(t,e)}static safeCallback(e){return e&&e instanceof Function?function(...t){try{return e(...t)}catch(t){console.error("FocusNode: callback error",e.name,t)}}:null}setOnKeyDown(e){this._OnKeyDown=z.safeCallback(e)}setOnKeyUp(e){this._OnKeyUp=z.safeCallback(e)}setOnFocus(e){this._OnFocus=z.safeCallback(e)}setOnBlur(e){this._OnBlur=z.safeCallback(e)}setDispatchKeyUp(e){this._DispatchKeyUp=z.safeCallback(e)}setDispatchKeyDown(e){this._DispatchKeyDown=z.safeCallback(e)}setOnCustomEvent(e){this._OnCustomEvent=z.safeCallback(e)}setDispatchKeyProxy(e,t){this._DKeyDownProxy=z.safeCallback(e),this._DKeyUpProxy=z.safeCallback(t)}requestFocus(e){let t=null;A&&(t={askName:this.BranchName,deepToChild:e,from:"requestFocus",stack:j?new Error("simulate-stack").stack:null,originFStack:null}),this.requestFocusInner(e,t)}ReturnFocusToParent(){if(this.IsFocus()){let e=this.GetParentPage();if(e){const t=e.BranchName;let s=null;A&&(s={askName:t,deepToChild:!1,from:"returnFocusToParent",stack:j?new Error("simulate-stack").stack:null}),e.RouterDelegate.ref.focus(t,!1,s)}}else super.ReturnFocusToParent()}requestFocusInner(e,t){let s=this.RouterDelegate.ref;return this.AsHub&&this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref),s?s.focus(this.BranchName,e,t):(console.error("error: lost router"),!1)}OnKeyDown(e){return!!this._OnKeyDown&&this._OnKeyDown(e)}OnKeyUp(e){return!!this._OnKeyUp&&this._OnKeyUp(e)}OnCustomEvent(e){return!!this._OnCustomEvent&&this._OnCustomEvent(e)}bubbleCustomEvent(e){this.BubbleCustomEvent(e)}dispatchKeyDown(e){return this.DispatchKeyDown(e)}DispatchKeyDown(e){return this._DKeyDownProxy?this._DKeyDownProxy(e,this._OriginDispatchKeyDown):this._OriginDispatchKeyDown(e)}_OriginDispatchKeyDown(e){let t=!1;return this._DispatchKeyDown&&(t=this._DispatchKeyDown(e)),!!t||super.DispatchKeyDown(e)}dispatchKeyUp(e){return this.DispatchKeyUp(e)}DispatchKeyUp(e){return this.__DKeyUpProxy?this.__DKeyUpProxy(e,this._OriginDispatchKeyUp):this._OriginDispatchKeyUp(e)}_OriginDispatchKeyUp(e){let t=!1;return this._DispatchKeyUp&&(t=this._DispatchKeyUp(e)),!!t||super.DispatchKeyUp(e)}attachToActivity(e,t){this.AttachToActivity(e,t)}AttachToActivity(e,t){super.SetParent(e,t)}setParent(e){this.SetParent(e)}SetParent(e){if(null!=e&&(super.SetParent(e,null),this.GetParentPage()._Mounted&&(this.updateMountState(),H()),e instanceof z)){if(this.RouterDelegate.ref&&this.RouterDelegate.ref._IsTemp){let t=this.RouterDelegate.ref;this.RouterDelegate.ref=null,t.forEach(((t,s)=>{e.routerAdd(s,t)}))}e.routerAdd(this.BranchName,this)}}focus(e){this.Focus(e)}Focus(e){if(!this._Mounted)return z.sFocusMemos.push({obj:this,bcf:e}),void console.log("page base tree not build, cache focus");super.Focus(e)}OnFocus(){this._OnFocus&&this._OnFocus()}OnBlur(){z.sLastFocus=this,this._OnBlur&&this._OnBlur()}onUnMount(e){z.sFocusNodeMap.delete(this.NativeId),z.sLastFocus==this&&(z.sLastFocus=null);let t=this.IsFocus();if(A&&t){let t=this.GetParentPage();if(t){let s=null;s={askName:t.BranchName,deepToChild:!1,from:e?"deactive":"unmount",stack:j?new Error("simulate-stack").stack:null,originFStack:"Mark2:"+U(this)},V(t,s)}}let s=this.GetParentPage();s&&s.RemoveSubPage(this),this.ClearSubPages(),this.routerUnbind(s?.BranchName,e),this._Mounted=!1}getFullName(){let e=this,t=[this.RouterDelegate.ref.NameSpace];this.AsHub||t.push(this.BranchName);let s=this.RouterDelegate.ref;do{if(e=e.GetParentPage(),t[0]==J)break;e&&e.RouterDelegate.ref!=s&&(s=e.RouterDelegate.ref,t.unshift(s.NameSpace))}while(e);return t[0]==J?t.shift():console.error("ERROR: missing app root"),t.join(".")}getNodeByName(e){return this.RouterDelegate.ref.getNodeByName(e,this)}}z.sFocusMemos=[],z.sLastFocus=null,z.sRootPageNode=null,z.sFocusNodeMap=new Map;let H=()=>{let e=z.sFocusMemos.length;if(e>0){let t=z.sFocusMemos;z.sFocusMemos=[];for(let s=0;s<e;s++)t[s].obj.Focus(t[s].bcf)}};class $ extends t{constructor(e){super(e),this.keyCode=-1,this.key=-1,this.repeat=0,this.keyCode=-1,this.key=-1,this.repeat=0}}$.KeyCode={Enter:13,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40};let q={};class X{constructor(e,t,s){this._AutoSearchFocus=!1,this._Element=s,q.hasOwnProperty(e)&&console.error(`Warn: FDivRoot duplicate name=${e}`),q[e]=this,this._DoInit(t)}_DoInit(e){let t=this._Element.FocusNodeRef;this._Element.setAttribute("new-namespace","__AppRoot__"),e&&t.setDispatchKeyProxy(e.keyDown,e.keyUp),t.setOnKeyDown((e=>{if(!this._AutoSearchFocus)return!1;switch(e.keyCode){case $.KeyCode.ArrowLeft:case $.KeyCode.ArrowUp:case $.KeyCode.ArrowRight:case $.KeyCode.ArrowDown:const t=this.getHub().getCurrentFocusNode();if(t){const s=T.Dom.SearchNextFocus(t.NativeId,e.keyCode),i=z.sFocusNodeMap.get(s);if(i)return this.getHub().setFocus(i.getFullName()),!0}}return!1})),t.attachToActivity(window.JsvCode.ForgeHandles.RootActivity,window.JsvCode.ForgeHandles.RootView)}enableAutoSearchFocus(e){this._AutoSearchFocus=e}getElement(){return this._Element}getHub(){return this._Element.jsvGetHub()}onMounted(){this._Element.FocusNodeRef.updateMountState(),H()}}class Y extends O{constructor(){super(O.JsvTagName.Image)}setAttribute(e,t){if("src"===e){t=new S(t).href,this.jsvClientSizeStore={}}super.setAttribute(e,t),this.jsvNativeId&&"src"===e&&T.Dom.SetElementAttribute(this.jsvNativeId,e,t)}jsvOnEvent(e,...s){let i;super.jsvOnEvent(e,...s),"load"==e&&(i=new t(e),i.target=this),i&&this.dispatchEvent(i)}}class Z extends O{constructor(){super(O.JsvTagName.Link)}setAttribute(e,t){this[e]=t}jsvLoadResource(){let e=!1,t=null;if(null!=this.href){var s=new S(this.href);console.log("Ignore to load link from url="+s.href),e=!0}else console.warn("Failed to load link, href is not exists."),t="NoSrc";this.jsvOnLoadResult(e,t)}jsvOnLoadResult(e,s){if(console.log("Load link result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class Q extends O{constructor(){super(O.JsvTagName.Script)}setAttribute(e,t){this[e]=t}jsvLoadResource(){if(null!=this.src){var e=new S(this.src);console.log("Load script with url="+e.href);var t=this;window.JsView.runJsWithUrl(e.href,!1,((e,s)=>{t.jsvOnLoadResult(e,s)}))}}jsvOnLoadResult(e,s){if(console.log("Load script result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class ee extends O{constructor(){super(O.JsvTagName.Style),this.jsvAttrStore={left:0,top:0,width:0,height:0}}}class te extends O{constructor(){super(O.JsvTagName.Svg)}}class se extends N{constructor(e){super(N.TEXT_NODE),this.textContent=e}get nodeValue(){return this.textContent}set nodeValue(e){this.textContent=e,this.parentNode&&(this.parentNode.textContent=this.textContent)}}let ie=1;class ne extends O{constructor(){super(O.JsvTagName.JsvFDiv),this.FocusNodeRef=new z("unnamed-"+ie++,this.jsvNativeId),this.hubRef=void 0}setAttribute(e,t){if(e)if("fname"===e)t&&this.FocusNodeRef.setBranchName(t);else if("new-namespace"===e){if(""!==t&&!this.hubRef){let e=new G(!1,t);this.hubRef=e,this.FocusNodeRef.setHub(e),this.FocusNodeRef.setBranchName(t)}}else super.setAttribute(e,t)}removeAttribute(e){}jsvGetHub(){return this.hubRef}}class oe extends N{constructor(){super(N.DOCUMENT_NODE),this.location=window.location,this.rootElement=new M,this.rootElement.ownerDocument=this,this.rootElement.id="root",T.Dom.BindElementToRootView(this.rootElement.jsvNativeId),this.activeElement=this.rootElement,this.head=null}createComment(e){return new P(e)}createElement(e){switch(e=e.toUpperCase()){case O.JsvTagName.Anchor:return new L;case O.JsvTagName.Div:return new M;case O.JsvTagName.Image:return new Y;case O.JsvTagName.Link:return new Z;case O.JsvTagName.Script:return new Q;case O.JsvTagName.Style:return new ee;case O.JsvTagName.Svg:return new te;case O.JsvTagName.JsvFDiv:return new ne;case O.JsvTagName.IFrame:console.error("Unsupported element: "+e+". Your vue compilation may may have failed, please check it first.")}if("TEMPLATE"==e)return{};throw new TypeError("Unimplemented element: "+e)}createEvent(e){return"CUSTOMEVENT"===(e=e.toUpperCase())?new i(e):new t(e)}createTextNode(e){return new se(e)}getElementById(e){if("root"===e||"app"===e)return this.rootElement;throw new DOMException("Failed to get element by id, id="+e+" is UNIMPLEMENTED.")}getElementsByTagName(e){if((e=e.toUpperCase())===O.JsvTagName.Head)return[this.head];if(e===O.JsvTagName.Link||e===O.JsvTagName.Script||e===O.JsvTagName.Style)return[];throw new DOMException("Failed to get element by name, name="+e+" is UNIMPLEMENTED.")}querySelector(e){if("root"===e||"#app"===e)return this.rootElement;if("head"===e)return this.head;if("base"===e)return null;if("title"===e)return null;if(e.startsWith("style[")&&e.endsWith("]"))return null;throw new DOMException("Failed to query selector, selectors="+e+" is UNIMPLEMENTED.")}querySelectorAll(e){return[]}jsvInitFDivRoot(e,t,s){if(!s){let e=this.createElement("fdiv");this.rootElement.appendChild(e),this.rootElement=e,s=this.rootElement}return new X(e,t,s)}}class re extends O{constructor(){super(O.JsvTagName.Head)}appendChild(e){super.appendChild(e),(e instanceof Z||e instanceof Q)&&e.jsvLoadResource()}removeChild(e){super.removeChild(e)}}class ae{constructor(){this.ready=!1,this.callbacks=[]}listenToReady(e){this.ready?e?.():this.callbacks.push(e)}dataReady(){this.ready=!0;for(let e of this.callbacks)e?.()}}class le extends ae{constructor(){super(),this.TextureManager=null,this.RootActivity=null,this.RootView=null}setHandles(e,t,s){this.TextureManager=e,this.RootActivity=s,this.RootView=t,this.dataReady()}}let ce="@keyframes";class de{constructor(e){this._AnchorTag=e,this._NamesCache=new Set}insertRule(e){let t=this.getName(e);this._NamesCache.has(t)&&console.warn(`Warn: keyframe replace of name ${t}`),this._NamesCache.add(t),T.Dom.InsertKeyFrame(t,e)}hasRule(e){return this._NamesCache.has(e)}removeRule(e){this._NamesCache.has(e)?(this._NamesCache.delete(e),T.Dom.RemoveKeyFrame(e)):console.error(`Error: keyFrame(${e}) is not exist.`)}removeMultiRules(e){for(let t of e)this.removeRule(t)}getName(e){let t=e.indexOf(ce)+10,s=e.indexOf("{");return e.substring(t,s).trim()}}let he=null;function ue(e){return he||(he={global:new de("global")}),he.global}class pe{static EnsureGlobalEnv(e,t){const s=window.navigator?.userAgent?.toLowerCase();window.jsvInAndroidWebView=s?.indexOf("android")>=0,pe.EnsureGlobalJsvCode(e,t),O.JsvEnableEventListener(),E.JsvDeclarePrototype()}static EnsureGlobalJsvCode(e,t){window.JsvCode.Dom||(window.JsvCode.Dom={}),window.JsvCode.Media||(window.JsvCode.Media={}),window.JsvCode.Dom.PlatformBridge||(window.JsvCode.Dom.PlatformBridge=e),window.JsvCode.Media.PlatformBridge||(window.JsvCode.Media.PlatformBridge=t),window.JsvCode.Dom.DeclareStyleSheets||(window.JsvCode.Dom.DeclareStyleSheets=T.Dom.DeclareStyleSheets),window.JsvCode.Dom.UndeclareStyleSheets||(window.JsvCode.Dom.UndeclareStyleSheets=T.Dom.UndeclareStyleSheets),window.JsvCode.Dom.getKeyFrameGroup||(window.JsvCode.Dom.getKeyFrameGroup=ue),window.JsvCode.Dom.GetLazyTaskAmount||(window.JsvCode.Dom.GetLazyTaskAmount=T.Dom.GetLazyTaskAmount),window.JsvCode.ForgeHandles||(window.JsvCode.ForgeHandles=new le)}}class me{static SetLevel(e){switch(me.E=me.W=me.I=me.D=function(){},e){case me.Level.Verbose:me.V=console.debug.bind(console);case me.Level.Debug:me.D=console.debug.bind(console);case me.Level.Info:me.I=console.info.bind(console)}}}me.E=console.error.bind(console),me.W=console.warn.bind(console),me.I=console.info.bind(console),me.D=function(){},me.V=function(){},me.Level={Error:0,Warning:1,Info:2,Debug:3,Verbose:4};class fe{constructor(e){this.callback=e}observe(e,t){if(!(e instanceof N))throw Error("TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type JsView's 'Node'");for(const e of Object.keys(t))"childList"==e||console.warn("JsView: only childList config is supported! ignore "+e);t.childList&&e.jsvObserveChildChanged((()=>{this.callback?.()}))}disconnect(){this.callback=void 0}}class ve{constructor(e){this.activity=new k.ReactActivity("BrowserForgeActivity",e,null,null),this.init()}init(){console.log("create BrowserForgeActivity.");let e=new k.LayoutView;window.JsvCode.ForgeHandles.setHandles(this.activity.GetTextureManager(),e,this.activity);let t=null;k.DesignMap&&(t=k.DesignMap());let s=t?t.width:1280,i=Math.floor(9*s/16);this.activity.SetContentView(e,{x:0,y:0,width:s,height:i}),k.sRenderBridge.AddWillSwapListener("forgeSwap",(()=>{T.Dom.RequestSwapAllCachedTasks()}))}}class ge{constructor(e){this.activityManager=e;let t=new ve(e);e.StartActivity(t.activity)}}class we extends ee{constructor(){super(),this.jsvBrowserElement=window.JsvCode.Dom.BrowserDocument.createElement(ee.JsvTagName.Style)}}class ye extends re{constructor(){super()}appendChild(e){"HTMLLinkElement"==e.constructor.name||"HTMLScriptElement"==e.constructor.name?window.JsvCode.Dom.BrowserDocument.head.appendChild(e):e instanceof we?window.JsvCode.Dom.BrowserDocument.head.appendChild(e.jsvBrowserElement):super.appendChild(e)}removeChild(e){"HTMLLinkElement"==e.constructor.name||"HTMLScriptElement"==e.constructor.name?window.JsvCode.Dom.BrowserDocument.head.removeChild(e):e instanceof we?window.JsvCode.Dom.BrowserDocument.head.removeChild(e.jsvBrowserElement):super.removeChild(e)}}class ke extends oe{constructor(){super(),this.head=new ye}createElement(e){switch(e=e.toUpperCase()){case O.JsvTagName.IFrame:case O.JsvTagName.Link:case O.JsvTagName.Script:return window.JsvCode.Dom.BrowserDocument.createElement(e);case O.JsvTagName.Style:return new we;default:return super.createElement(e)}}getElementsByTagName(e){return e.toUpperCase()===O.JsvTagName.Head?window.JsvCode.Dom.BrowserDocument.getElementsByTagName(e):super.getElementsByTagName(e)}querySelector(e){return"#canvas"==e?window.JsvCode.Dom.BrowserDocument.getElementById("canvas"):super.querySelector(e)}}class Ce{static Get(e){return Ce.ValidStyleMap[e]}static IsUndefinedOrNumber(e,t){return!!Ce.IsUndefined(e,t)||(""===t||"number"==typeof t)}static IsUndefined(e,t){let s=void 0===t;return s&&console.error(e+" property is undefined!"),s}static KeyframesCheck(e,t){Ce.IsUndefined(e,t)||t.indexOf("transform")<0&&t.indexOf("opacity")<0&&console.error("keyframes property is only support transform and opacity, value:",t)}static ObjectFit(e,t){if(Ce.IsUndefined(e,t))return;const s="fill contain cover none scale-down";s.indexOf(t)<0&&console.error(" objectFit is only support one of string["+s+"]")}static TransitionOtherCheck(e,t){Ce.IsUndefined(e,t)||console.error(e+" property is not support, you can use transition property, e.g. transition='width 2s'")}static TransitionCheck(e,t){Ce.IsUndefined(e,t)||t.length>0&&(t.indexOf("left")<0&&t.indexOf("top")<0&&t.indexOf("width")<0&&t.indexOf("height")<0&&t.indexOf("transform")<0||t.indexOf("all")>=0)&&console.error("transition property's value only support [top, left, width, height, transform] value:",t)}static TransformCheck(e,t){Ce.IsUndefined(e,t)||t.length>0&&t.indexOf("translate3d")<0&&t.indexOf("scale3d")<0&&t.indexOf("rotate3d")<0&&t.indexOf("skew")<0&&console.error("transform property's value only support translate3d、scale3d、rotate3d、skew, value:",t)}static TransformOriginCheck(e,t){Ce.IsUndefined(e,t)||t.length>0&&t.indexOf("%")<0&&t.indexOf("left")<0&&t.indexOf("center")<0&&t.indexOf("top")<0&&t.indexOf("right")<0&&t.indexOf("bottom")<0&&console.error("transformOrigin property's value only support XX%、left、top、right, bottom:",t)}static TextOverflowCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"clip":case"ellipsis":break;default:console.error("textOverflow property's value is not support, value:",t)}}static WhiteSpaceCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"normal":case"nowrap":case"pre-wrap":break;default:console.error("whiteSpace property's value is not support, value:",t)}}static WordWrapCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"normal":case"word-break":break;default:console.error("WordWrap property's value is not support, value:",t)}}static TextAlignCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"left":case"right":case"center":case"start":case"end":break;default:console.error("textAlign property's value is not support, value:",t)}}static LineHeightCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"normal":case"inherit":console.error("lineHeight property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("lineHeight property's value is support number only, value:",t)}}static ColorCheck(e,t){Ce.IsUndefined(e,t)||Ce.CheckColorFormat("Color()",t)}static VisibilityCheck(e,t){Ce.IsUndefined(e,t)||"visible"!==t&&"hidden"!==t&&"inherit"!==t&&console.error("visibility property's value is not support, value:",t)}static DisplayCheck(e,t){Ce.IsUndefined(e,t)||"block"!==t&&"inline"!==t&&"none"!==t&&"inline-block"!==t&&"inherit"!==t&&""!==t&&console.error("display property's value is not support, value:",t)}static OverflowCheck(e,t){Ce.IsUndefined(e,t)||"visible"!==t&&"hidden"!==t&&console.error("overflow property's value is support visible or hidden only, value:",t)}static TopCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("top property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("top property's value is support number only, value:",t)}}static LeftCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("left property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("left property's value is support number only, value:",t)}}static HeightCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("height property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("height property's value is support number only, value:",t)}}static WidthCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("width property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("width property's value is support number only, value:",t)}}static BackfaceVisibility(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"visible":case"hidden":break;default:console.error("backfaceVisibility property's value is support visible/hidden only, value: ",t)}}static PerspectiveCheck(e,t){Ce.IsUndefined(e,t)}static WebkitTextStroke(e,t){if(Ce.IsUndefined(e,t))return;t.split(" ").length<2&&console.error("Error: WebkitTextStroke should format of(width color) such as: '1px rgba(255,255,255,1.0)'")}static ZIndexCheck(e,t){Ce.IsUndefined(e,t)||isNaN(t)&&console.error("zIndex property's value is support number only, value: ",t)}static OpacityCheck(e,t){Ce.IsUndefined(e,t)||(isNaN(t)||t>1)&&console.error("opacity property's value is support number only(0.0 ~ 1.0), value: ",t)}static FontSizeCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"smaller":case"larger":case"inherit":case"x-small":case"xx-small":case"small":case"large":case"medium":case"x-large":case"xx-large":console.error("fontSize property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("fontSize property's value is support number only, value:",t)}}static FontWeightCheck(e,t){Ce.IsUndefined(e,t)||"bold"!==t&&console.error("fontWeight property's value is support bold only, value:",t)}static FontStyleCheck(e,t){Ce.IsUndefined(e,t)||"italic"!==t&&console.error("fontWeight property's value is support italic only, value:",t)}static BorderRadiusCheck(e,t){if(Ce.IsUndefined(e,t))return;let s=[t];"string"==typeof t&&(s=t.split(" ")),s.length>4&&console.error("borderRadius property's value is not support, value:",t)}static JsvImageBlendTypeCheck(e,t){if(!Ce.IsUndefined(e,t)&&t&&"string"==typeof t&&t.length>0){if("alphaOverride"==t)return;console.error("JsvImageBlendType property's value is not support, should be one of 'null | alphaOverride', value:",t)}}static BorderImageWidthCheck(e,t){Ce.IsUndefinedOrNumber(e,t)}static BorderImageOutsetCheck(e,t){if(Ce.IsUndefined(e,t))return;t.split(" ").length>4&&console.error("borderImageOutsetCheck property's value is not support, value:",t)}static BorderImageCheck(e,t){Ce.IsUndefined(e,t)||t.indexOf("fill")<0&&console.error("borderImage property's value is not contain fill, e.g. source slice, but value:",t)}static BackgroundOtherCheck(e,t){console.error(e+" property not support, you can use backgroundImage property, e.g. backgroundImage=`url(${iconImgPath})`")}static BackgroundImageCheck(e,t){Ce.IsUndefined(e,t)||"inherit"==t&&console.error("backgroundImage property's value is not support, value:",t)}static BackgroundColorCheck(e,t){if(!Ce.IsUndefined(e,t))return Ce.CheckColorFormat("backgroundColor",t)}static AnimationCheck(e,t){}static AnimationFillModeCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"none":case"forwards":break;case"backwards":console.error("animationFillMode 'backwards' is not supported yet.");break;case"both":console.error("animationFillMode 'both' is not supported yet.");break;default:console.error("animationFillMode property value is not valid",t)}}static AnimationOtherNotSupport(e,t){console.error(e+" property is not support, you can use animation property, e.g. animation='mymove 5s infinite'")}static TransformStyleCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"flat":case"preserve-3d":break;default:console.error("transformStyle property value is not valid",t)}}static PerspectiveOriginCheck(e,t){Ce.IsUndefined(e,t)||t.length>0&&t.indexOf("%")<0&&t.indexOf("left")<0&&t.indexOf("center")<0&&t.indexOf("top")<0&&t.indexOf("right")<0&&t.indexOf("bottom")<0&&console.error("perspectiveOrigin property's value only support XX%、left、top、right, bottom:",t)}static TextShadowCheck(e,t){if(!Ce.IsUndefined(e,t)&&t.length>0){if(t.replace(/\(.*\)/g,"").split(",").length>1)return void console.error("textShadow: NOT support more than one part settings");const e=t.split(" ");if(4!==e.length&&(5!==e.length||0!==e[4].length)||isNaN(parseInt(e[0]))||isNaN(parseInt(e[1])))console.error('textShadow: format should be "offsetX offsetY blurSize color"(0 0 1 rgba(100,100,100,1)), !NOT space in rgba()');else{if(!(parseFloat(e[2])>0))return void console.error(`textShadow: blur shadow above 0(now=${t})`);if(!Ce.CheckColorFormat("textShadow",e[3]))return}}}static CheckColorFormat(e,t){if(0===t.indexOf("rgba(")||0===t.indexOf("rgb("));else{if(0!==t.indexOf("#"))return console.error(`${e} color value is not valid, need startwith rgba or #, value:[${t}]`),!1;if(4!==t.length&&7!==t.length&&9!==t.length)return console.error(`${e} color value's length is not valid, value:${t}`),!1}return!0}static JsvTextLatexCheck(e,t){Ce.IsUndefined(e,t)||"number"!=typeof t&&console.error("JsvTextLatex property's value is support number only, value: ",t)}static JsvTextEmojiCheck(e,t){Ce.IsUndefined(e,t)||"number"!=typeof t&&console.error("JsvTextEmoji property's value is support number only, value: ",t)}static DirectionCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"ltr":case"rtl":break;default:console.error("direction property's value is not support, value:",t)}}static JsvTextAlignMinWidthCheck(e,t){Ce.IsUndefined(e,t)||"number"!=typeof t&&console.error("JsvTextAlignMinWidth property's value is support number only, value: ",t)}static JsvTextVerticalAlignCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"top":case"middle":case"bottom":break;default:console.error("JsvTextVerticalAlign property's value is not support, value: ",t)}}static JsvTextLineAlignCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"top":case"middle":case"bottom":break;default:console.error("JsvTextLineAlign property's value is not support, value: ",t)}}static JsvTextInnerDirectionCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"unset":case"ltr":case"rtl":break;default:console.error("JsvTextInnerDirection property's value is not support, value: ",t)}}static FlexDirectionCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"row":case"row-reverse":case"column":case"column-reverse":break;default:console.error("flexDirection out of range: row|row-reverse|column|column-reverse, value: ",t)}}static FlexWrapCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"nowrap":case"wrap":break;default:console.error("flexWrap out of range: nowrap|wrap, value: ",t)}}static JustifyContentCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"flex-start":case"flex-end":case"center":break;default:console.error("flexWrap out of range: flex-start|flex-end|center, value: ",t)}}static AlignItemsCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"flex-start":case"flex-end":case"center":case"stretch":break;default:console.error("alignItems out of range: flex-start|flex-end|center|stretch, value: ",t)}}static AlignContentCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"flex-start":case"flex-end":case"center":break;default:console.error("alignContent out of range: flex-start|flex-end|center, value: ",t)}}static AlignSelfCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"auto":case"flex-start":case"flex-end":case"center":case"stretch":break;default:console.error("alignSelf out of range: auto|flex-start|flex-end|center|stretch, value: ",t)}}static FlexGrowCheck(e,t){Ce.IsUndefined(e,t)||isNaN(t)&&console.error("flexGrow must be number, value: ",t)}}Ce.ValidStyleMap={animation:{check:Ce.AnimationCheck},animationName:{check:Ce.AnimationOtherNotSupport},animationDuration:{check:Ce.AnimationOtherNotSupport},animationTimingFunction:{check:Ce.AnimationOtherNotSupport},animationDelay:{check:Ce.AnimationOtherNotSupport},animationIterationCount:{check:Ce.AnimationOtherNotSupport},animationDirection:{check:Ce.AnimationOtherNotSupport},animationPlayState:{check:Ce.AnimationOtherNotSupport},animationFillMode:{check:Ce.AnimationFillModeCheck},background:{check:Ce.BackgroundOtherCheck},backgroundColor:{check:Ce.BackgroundColorCheck},backgroundImage:{check:Ce.BackgroundImageCheck},borderImage:{check:Ce.BorderImageCheck},borderImageOutset:{check:Ce.BorderImageOutsetCheck},borderImageWidth:{check:Ce.BorderImageWidthCheck},borderRadius:{check:Ce.BorderRadiusCheck},JsvImageBlendType:{check:Ce.JsvImageBlendTypeCheck},height:{check:Ce.HeightCheck},width:{check:Ce.WidthCheck},zIndex:{check:Ce.ZIndexCheck},opacity:{check:Ce.OpacityCheck},fontFamily:{check:null},fontSize:{check:Ce.FontSizeCheck},fontStyle:{check:Ce.FontStyleCheck},fontWeight:{check:Ce.FontWeightCheck},left:{check:Ce.LeftCheck},overflow:{check:Ce.OverflowCheck},top:{check:Ce.TopCheck},visibility:{check:Ce.VisibilityCheck},display:{check:Ce.DisplayCheck},color:{check:Ce.ColorCheck},lineHeight:{check:Ce.LineHeightCheck},textAlign:{check:Ce.TextAlignCheck},direction:{check:Ce.DirectionCheck},whiteSpace:{check:Ce.WhiteSpaceCheck},wordWrap:{check:Ce.WordWrapCheck},textOverflow:{check:Ce.TextOverflowCheck},transform:{check:Ce.TransformCheck},transformOrigin:{check:Ce.TransformOriginCheck},transition:{check:Ce.TransitionCheck},transitionProperty:{check:Ce.TransitionOtherCheck},transitionDuration:{check:Ce.TransitionOtherCheck},transitionTimingFunction:{check:Ce.TransitionOtherCheck},transitionDelay:{check:Ce.TransitionOtherCheck},keyframes:{check:Ce.KeyframesCheck},objectFit:{check:Ce.ObjectFit},perspective:{check:Ce.PerspectiveCheck},backfaceVisibility:{check:Ce.BackfaceVisibility},transformStyle:{check:Ce.TransformStyleCheck},perspectiveOrigin:{check:Ce.PerspectiveCheck},WebkitTextStroke:{check:Ce.WebkitTextStroke},textShadow:{check:Ce.TextShadowCheck},JsvTextLatex:{check:Ce.JsvTextLatexCheck},JsvTextEmoji:{check:Ce.JsvTextEmojiCheck},JsvTextAlignMinWidth:{check:Ce.JsvTextAlignMinWidthCheck},JsvTextVerticalAlign:{check:Ce.JsvTextVerticalAlignCheck},JsvTextLineAlign:{check:Ce.JsvTextLineAlignCheck},JsvTextInnerDirection:{check:Ce.JsvTextInnerDirectionCheck},flexDirection:{check:Ce.FlexDirectionCheck},flexWrap:{check:Ce.FlexWrapCheck},justifyContent:{check:Ce.JustifyContentCheck},alignItems:{check:Ce.AlignItemsCheck},alignContent:{check:Ce.AlignContentCheck},alignSelf:{check:Ce.AlignSelfCheck},flexGrow:{check:Ce.FlexGrowCheck}};class Te{static BackupBrowser(){return{createComment:window.document.createComment.bind(window.document),createElement:window.document.createElement.bind(window.document),createElementNS:window.document.createElementNS.bind(window.document),createTextNode:window.document.createTextNode.bind(window.document),dispatchEvent:window.document.dispatchEvent.bind(window.document),getElementById:window.document.getElementById.bind(window.document),getElementsByTagName:window.document.getElementsByTagName.bind(window.document),querySelector:window.document.querySelector.bind(window.document),head:{appendChild:window.document.head.appendChild.bind(window.document.head),removeChild:window.document.head.removeChild.bind(window.document.head)}}}static HookBrowser(e,t){Te.HookDocument(e,t),Te.HookOthers(),Te.DeclareAddition()}static HookDocument(e,t){window.JsvCode.Dom.BrowserDocument=e,window.JsvCode.Dom.RenderDocument=t;const s=new ke;window.document.createComment=s.createComment.bind(s),window.document.createElement=s.createElement.bind(s),window.document.createTextNode=s.createTextNode.bind(s),window.document.dispatchEvent=s.dispatchEvent.bind(s),window.document.getElementById=s.getElementById.bind(s),window.document.getElementsByTagName=s.getElementsByTagName.bind(s),window.document.querySelector=s.querySelector.bind(s),window.document.head.appendChild=s.head?.appendChild.bind(s.head),window.document.head.removeChild=s.head?.removeChild.bind(s.head),window.JsvCode.Dom.JsViewDocument=s}static HookOthers(){window.MutationObserver=fe,window.Element=O,window.SVGElement=te}static DeclareAddition(){const e=window.JsvCode.Dom.JsViewDocument;window.document.jsvInitFDivRoot=e.jsvInitFDivRoot.bind(e),window.JsvCode.Dom.CheckStyleFormat=window.jsvInAndroidWebView?null:Te.CheckStyleFormat}static CheckStyleFormat(e,t){if(e.startsWith("--"))return;let s=Ce.Get(e);s?s.check&&t&&s.check(e,t):console.error(e+" property is not support.")}}window.jsvIsBrowserDebug=!0;const xe=window.JsvCode.BrowserPlatformDomBridge,Ne=window.JsvCode.BrowserPlatformMediaBridge,be=window.JsvCode.MessageDispatcher;function Ie(e){let t={keyCode:e.keyCode,key:e.key,code:e.code,repeat:e.repeat,timeStamp:e.timeStamp};return JSON.stringify(t)}function De(){const e=Te.BackupBrowser();xe.RegisterOriginDocument(e);const t=function(e){let t=e.getElementById("app");var s=e.createElement("iframe");s.scrolling="no",s.style.border="none",s.style.width="5px",s.style.height="5px",s.width=1280,s.height=720,t?.appendChild(s);let i=s.contentDocument,n=e=>{var t=e?.target?.tagName;t&&"input"===t.toLowerCase()||(be.notify("onForgeKeyDown",Ie(e)),e.preventDefault&&e.preventDefault())},o=e=>{var t=e?.target?.tagName;t&&"input"===t.toLowerCase()||(be.notify("onForgeKeyUp",Ie(e)),e.preventDefault&&e.preventDefault())};return s.contentWindow.addEventListener("keydown",n),s.contentWindow.addEventListener("keyup",o),window.addEventListener("keydown",n),window.addEventListener("keyup",o),window.jsvRenderDocument=i,i}(e);pe.EnsureGlobalEnv(xe,Ne),Te.HookBrowser(e,t),me.I("Using JsView HTML Environment.")}export{ge as ForgeAppClass,De as InitEnv};
1
+ /* eslint-disable */ class e{static CreateAudioPlayer(){return console.warn("BrowserPlatformMediaBridge.CreateAudioPlayer() is not supported"),{}}static CreateVideoPlayer(){return console.warn("BrowserPlatformMediaBridge.CreateVideoPlayer() is not supported"),{}}static OnCssStyleChanged(e,t){const s=this;s.parentNode,s.style.position="fixed",s.style.left=(t.left?t.left:0)+"px",s.style.top=(t.top?t.top:0)+"px",s.style.width=(t.width?t.width:0)+"px",s.style.height=(t.height?t.height:0)+"px",s.style.objectFit=t.objectFit,s.style.visibility=t.visibility}static JsvFinalize(){console.log("BrowserPlatformMediaBridge.JsvFinalize()");this.pause()}}window.JsvCode.BrowserPlatformMediaBridge||(window.JsvCode.BrowserPlatformMediaBridge=e);class t{constructor(e,t){this.prevented=!1,this.target=t,this.timeStamp=Date.now(),this.type=e}preventDefault(){this.prevented=!0}jsvIsPrevented(){return this.prevented}}class s extends t{constructor(e){super(e)}}class i extends t{constructor(e,t){super(e),this.options=t}initCustomEvent(e,t,s,i){this.type=e}get detail(){return this.options?.detail}}if(void 0===window.Forge)throw new Error("Error: EngineJs missing");var n=window.Forge;window.JsvCoreApi.setForgeJsHandle(n);class o{static EnableEventListener(e){const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.SetOnEventListener(t,e)}static CreateElement(e,t){o.PushLazyTask(o.TaskType.CreateElement,e,t)}static BindElementToRootView(e){o.PushLazyTask(o.TaskType.BindElementToRootView,e)}static InsertElementChild(e,t,s){o.PushLazyTask(o.TaskType.InsertElementChild,e,t,s)}static RemoveElementChild(e,t){o.PushLazyTask(o.TaskType.RemoveElementChild,e,t)}static MoveElementChild(e,t,s,i){o.PushLazyTask(o.TaskType.MoveElementChild,e,t,s,i)}static ReOrderElementChild(e,t,s){o.PushLazyTask(o.TaskType.ReOrderElementChild,e,t,s)}static AddElementEventListener(e,t,s){o.PushLazyTask(o.TaskType.AddElementEventListener,e,t,s)}static RemoveElementEventListener(e,t,s){o.PushLazyTask(o.TaskType.RemoveElementEventListener,e,t,s)}static SetElementText(e,t){o.PushLazyTask(o.TaskType.SetElementText,e,t)}static SetElementAttribute(e,t,s){o.PushLazyTask(o.TaskType.SetElementAttribute,e,t,s),o.LazyTaskSyncedListenerMap.has(e)&&o.CachedSyncListenIdSet.add(e)}static GetElementBoundingClientStyles(e,t){return o.RunSyncTask(o.TaskType.GetElementBoundingClientStyles,e,t)}static SetForgeViewInnerProps(e,t,s){let i=0;(t=t.substr(12)).startsWith("mask-")?(i=1,t=t.substr(5)):t.startsWith("mmask")&&(i=2,t=t.substr(6)),o.PushLazyTask(o.TaskType.SetForgeViewInnerProps,e,t,i,""+s)}static DeclareStyleSheets(e){o.PushLazyTask(o.TaskType.DeclareStyleSheets,-1,e)}static UndeclareStyleSheets(e){o.PushLazyTask(o.TaskType.UndeclareStyleSheets,-1,e)}static SetStyleProperty(e,t,s){o.PushLazyTask(o.TaskType.SetStyleProperty,e,t,s),o.LazyTaskSyncedListenerMap.has(e)&&o.CachedSyncListenIdSet.add(e)}static GetStyleProperties(e,t){return o.RunSyncTask(o.TaskType.GetStyleProperties,e,t)}static AppendLazyTaskSyncedListener(e,t){o.LazyTaskSyncedListenerMap.set(e,t)}static RemoveLazyTaskSyncedListener(e){o.LazyTaskSyncedListenerMap.delete(e)}static RequestSwapAllCachedTasks(){if(0==o.CachedLazyTaskList.length)return;const e=JSON.stringify(o.CachedLazyTaskList);o.CachedLazyTaskList=[];const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.RunLazyTaskList(t,e),o.CachedLazyTaskAmount=0,o.CachedLazyNewElementTaskAmount=0;for(const e of o.CachedSyncListenIdSet){const t=o.LazyTaskSyncedListenerMap.get(e);t?.()}o.CachedSyncListenIdSet.clear()}static GetElementAttribute(e,t){return o.RunSyncTask(o.TaskType.GetElementAttribute,e,t)}static InsertKeyFrame(e,t){o.PushLazyTask(o.TaskType.InsertKeyFrameDefine,-1,e,t)}static RemoveKeyFrame(e){o.PushLazyTask(o.TaskType.RemoveKeyFrameDefine,-1,e)}static GetRelativePosition(e,t){const s=o.RunSyncTask(o.TaskType.GetRelativePosition,e,t);return JSON.parse(s)}static SearchNextFocus(e,t){return o.RunSyncTask(o.TaskType.SearchNextFocus,e,t)}static IsLazyTaskQueueOverLoad(){return"wasm"!=window.JsvCoreApi.Platform&&o.CachedLazyNewElementTaskAmount>o.LazyNewElementTaskOverLoadMaxLevel}static SetLazyTaskOverLoadLevel(e){console.log("SetLazyTaskOverLoadLevel() max_level="+e),e<=0&&(console.error("SetLazyTaskOverLoadLevel() max_level <= 0, reset to 100"),e=100),o.LazyNewElementTaskOverLoadMaxLevel=e}static RunSyncTask(e,t,...s){o.RequestSwapAllCachedTasks();const i=window.JsvCode.Dom.PlatformBridge.JsViewId;return window.JsvCode.Dom.PlatformBridge.RunSyncTask(i,e,t,...s)}static PushLazyTask(e,t,...s){let i=!1,r=1;e==o.TaskType.SetStyleProperty?r=2:e==o.TaskType.DeclareStyleSheets&&(i=!0,r=3),o.CachedLazyTaskAmount+=r,e==o.TaskType.CreateElement&&o.CachedLazyNewElementTaskAmount++,o.CachedLazyTaskList.push([e,t,...s]),i||n.sRenderBridge?.RequestSwap()}}o.CachedLazyTaskAmount=0,o.CachedLazyNewElementTaskAmount=0,o.CachedLazyTaskList=new Array,o.CachedSyncListenIdSet=new Set,o.LazyTaskSyncedListenerMap=new Map,o.LazyNewElementTaskOverLoadMaxLevel=100,o.TaskType={CreateElement:10,BindElementToRootView:11,InsertElementChild:12,RemoveElementChild:13,AddElementEventListener:14,RemoveElementEventListener:15,SetElementText:16,SetElementAttribute:17,GetElementBoundingClientStyles:18,GetElementAttribute:19,MoveElementChild:20,GetRelativePosition:21,ReOrderElementChild:22,SearchNextFocus:23,DeclareStyleSheets:30,SetStyleProperty:31,GetStyleProperties:32,UndeclareStyleSheets:39,SetForgeViewInnerProps:40,InsertKeyFrameDefine:41,RemoveKeyFrameDefine:42};class r{}r.Dom=o,r.Media=class{static CreateAudioPlayer(){return window.JsvCode.Media.PlatformBridge.CreateAudioPlayer()}static CreateVideoPlayer(){return window.JsvCode.Media.PlatformBridge.CreateVideoPlayer()}};class a{static GenerateId(){const e=this.UniqueId++;if(e>=this.MaxUniqueId)throw new Error("JsvUniqueId.GenerateId() Failed to create unique id. id is overflow.");return e}}a.UniqueId=0,a.MaxUniqueId=Math.pow(2,31)-1;class l{constructor(e){this.childNodes=[],this.nodeType=e,this.ownerDocument=window.document,this.parentNode=null,this.jsvEventListenerMap=null,this.jsvChildChangedCallback=null}jsvFinalize(){}appendChild(e){this.childNodes.push(e),e.parentNode=this,this.jsvChildChangedCallback?.()}removeChild(e){let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to remove node, child node is not found. node=",e);this.childNodes.splice(t,1),e.parentNode=null,this.jsvChildChangedCallback?.()}insertBefore(e,t){this.insertBeforeInner(e,t)}get previousSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.previousSibling(), this node not found. this=",this);return e[t-1]}get nextSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.nextSibling(), this node not found. this=",this);return e[t+1]}addEventListener(e,t,s){this.jsvEventListenerMap||(this.jsvEventListenerMap=new Map);let i=this.jsvEventListenerMap?.get(e);i||(i=new Set,this.jsvEventListenerMap?.set(e,i)),i.add(t)}removeEventListener(e,t,s){let i=this.jsvEventListenerMap?.get(e);i&&(i.delete(t),i.size<=0&&this.jsvEventListenerMap?.delete(e),0==this.jsvEventListenerMap?.size&&(this.jsvEventListenerMap=null))}dispatchEvent(e){if(!this.jsvEventListenerMap)return void console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No event added.");let t=this.jsvEventListenerMap?.get(e.type);if(t){for(let s of t)if(s?.(e),e.jsvIsPrevented())break}else console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No listener added.")}jsvObserveChildChanged(e){this.jsvChildChangedCallback=e}jsvMoveChildReOrder(e,t){{let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to call jsvMoveChildReOrder, node not found. node=",e);this.childNodes.splice(t,1)}{let s=this.childNodes.length;if(t&&(s=this.childNodes.indexOf(t),s<0))throw new DOMException("Failed to call move node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e)}this.jsvChildChangedCallback?.()}jsvMoveChildToNewParent(e,t,s){let i=this.childNodes.indexOf(e);if(i<0)throw new DOMException("Failed to call jsvMoveChildToNewParent, node not found. node=",e);this.childNodes.splice(i,1),e.parentNode=null,this.jsvChildChangedCallback?.(),t.insertBeforeInner(e,s)}jsvGetEventListenerSet(e){const t=this.jsvEventListenerMap?.get(e);return t}insertBeforeInner(e,t){let s=this.childNodes.length;if(void 0===t)throw new DOMException("TypeError: Failed to execute 'insertBefore' on 'Node': 2 arguments required, but only 1 present.");if(null!==t&&(s=this.childNodes.indexOf(t)),s<0)throw new DOMException("Failed to call insert node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e),e.parentNode=this,this.jsvChildChangedCallback?.()}}function c(e,t,s){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:s?"".concat(s," ",t):t})}var d,h,u,p,v,m,f,g,y,w,k,C,T,x,b;l.ELEMENT_NODE=1,l.TEXT_NODE=3,l.COMMENT_NODE=8,l.DOCUMENT_NODE=9,l.NOLAYOUT_NODE=10;class N{static HasGetterMethod(e){switch(e){case N.Layout.Height:case N.Layout.Left:case N.Layout.Top:case N.Layout.Width:case N.Effect.ObjectFit:return!0;default:return!1}}static ToConst(e){return e==N.Layout.Height?N.Layout.Height:e==N.Layout.Left?N.Layout.Left:e==N.Layout.Top?N.Layout.Top:e==N.Layout.Width?N.Layout.Width:e==N.Layout.JsvMinWidth?N.Layout.JsvMinWidth:e==N.Layout.JsvMaxWidth?N.Layout.JsvMaxWidth:e==N.Layout.JsvMinHeight?N.Layout.JsvMinHeight:e==N.Layout.JsvMaxHeight?N.Layout.JsvMaxHeight:e==N.Flex.FlexDirection?N.Flex.FlexDirection:e==N.Flex.FlexWrap?N.Flex.FlexWrap:e==N.Flex.JustifyContent?N.Flex.JustifyContent:e==N.Flex.AlignItems?N.Flex.AlignItems:e==N.Flex.AlignContent?N.Flex.AlignContent:e==N.Flex.AlignSelf?N.Flex.AlignSelf:e==N.Flex.FlexGrow?N.Flex.FlexGrow:e==N.Background.BackgroundColor?N.Background.BackgroundColor:e==N.Background.BackgroundImage?N.Background.BackgroundImage:e==N.Background.BorderRadius?N.Background.BorderRadius:e==N.Background.JsvImageBlendType?N.Background.JsvImageBlendType:e==N.Effect.BackfaceVisibility?N.Effect.BackfaceVisibility:e==N.Effect.BorderImage?N.Effect.BorderImage:e==N.Effect.BorderImageWidth?N.Effect.BorderImageWidth:e==N.Effect.BorderImageOutset?N.Effect.BorderImageOutset:e==N.Effect.Display?N.Effect.Display:e==N.Effect.ObjectFit?N.Effect.ObjectFit:e==N.Effect.Opacity?N.Effect.Opacity:e==N.Effect.Overflow?N.Effect.Overflow:e==N.Effect.Perspective?N.Effect.Perspective:e==N.Effect.PerspectiveOrigin?N.Effect.PerspectiveOrigin:e==N.Effect.Transform?N.Effect.Transform:e==N.Effect.TransformOrigin?N.Effect.TransformOrigin:e==N.Effect.TransformStyle?N.Effect.TransformStyle:e==N.Effect.Visibility?N.Effect.Visibility:e==N.Effect.ZIndex?N.Effect.ZIndex:e==N.Text.Color?N.Text.Color:e==N.Text.FontFamily?N.Text.FontFamily:e==N.Text.FontSize?N.Text.FontSize:e==N.Text.FontStyle?N.Text.FontStyle:e==N.Text.FontWeight?N.Text.FontWeight:e==N.Text.LineHeight?N.Text.LineHeight:e==N.Text.TextAlign?N.Text.TextAlign:e==N.Text.TextOverflow?N.Text.TextOverflow:e==N.Text.TextShadow?N.Text.TextShadow:e==N.Text.WebkitTextStroke?N.Text.WebkitTextStroke:e==N.Text.WhiteSpace?N.Text.WhiteSpace:e==N.Text.WordWrap?N.Text.WordWrap:e==N.Text.Direction?N.Text.Direction:e==N.Text.JsvTextEmoji?N.Text.JsvTextEmoji:e==N.Text.JsvTextLatex?N.Text.JsvTextLatex:e==N.Text.JsvTextAlignMinWidth?N.Text.JsvTextAlignMinWidth:e==N.Text.JsvTextVerticalAlign?N.Text.JsvTextVerticalAlign:e==N.Text.JsvTextLineAlign?N.Text.JsvTextLineAlign:e==N.Text.JsvTextInnerDirection?N.Text.JsvTextInnerDirection:e==N.Motion.Animation?N.Motion.Animation:e==N.Motion.Transition?N.Motion.Transition:e==N.Motion.AnimationFillMode?N.Motion.AnimationFillMode:null}constructor(){throw new Error("new StyleName() is forbidden.")}}N.Layout=(c(d=class{constructor(){throw new Error("new StyleName.Layout() is forbidden.")}},"Layout"),d.Height="height",d.Left="left",d.Top="top",d.Width="width",d.JsvMinWidth="JsvMinWidth",d.JsvMaxWidth="JsvMaxWidth",d.JsvMinHeight="JsvMinHeight",d.JsvMaxHeight="JsvMaxHeight",d),N.Flex=(c(h=class{constructor(){throw new Error("new StyleName.Flex() is forbidden.")}},"Flex"),h.FlexDirection="flexDirection",h.FlexWrap="flexWrap",h.JustifyContent="justifyContent",h.AlignItems="alignItems",h.AlignContent="alignContent",h.AlignSelf="alignSelf",h.FlexGrow="flexGrow",h),N.Background=(c(u=class{constructor(){throw new Error("new StyleName.Background() is forbidden.")}},"Background"),u.BackgroundColor="backgroundColor",u.BackgroundImage="backgroundImage",u.BorderRadius="borderRadius",u.JsvImageBlendType="JsvImageBlendType",u),N.Effect=(c(p=class{constructor(){throw new Error("new StyleName.Effect() is forbidden.")}},"Effect"),p.BackfaceVisibility="backfaceVisibility",p.BorderImage="borderImage",p.BorderImageWidth="borderImageWidth",p.BorderImageOutset="borderImageOutset",p.Display="display",p.ObjectFit="objectFit",p.Opacity="opacity",p.Overflow="overflow",p.Perspective="perspective",p.PerspectiveOrigin="perspectiveOrigin",p.Transform="transform",p.TransformOrigin="transformOrigin",p.TransformStyle="transformStyle",p.Visibility="visibility",p.ZIndex="zIndex",p),N.Text=(c(v=class{constructor(){throw new Error("new StyleName.Text() is forbidden.")}},"Text"),v.Color="color",v.FontFamily="fontFamily",v.FontSize="fontSize",v.FontStyle="fontStyle",v.FontWeight="fontWeight",v.LineHeight="lineHeight",v.TextAlign="textAlign",v.TextOverflow="textOverflow",v.TextShadow="textShadow",v.WebkitTextStroke="WebkitTextStroke",v.WhiteSpace="whiteSpace",v.WordWrap="wordWrap",v.Direction="direction",v.JsvTextEmoji="JsvTextEmoji",v.JsvTextLatex="JsvTextLatex",v.JsvTextAlignMinWidth="JsvTextAlignMinWidth",v.JsvTextVerticalAlign="JsvTextVerticalAlign",v.JsvTextLineAlign="JsvTextLineAlign",v.JsvTextInnerDirection="JsvTextInnerDirection",v),N.Motion=(c(m=class{constructor(){throw new Error("new StyleName.Motion() is forbidden.")}},"Motion"),m.Animation="animation",m.Transition="transition",m.AnimationFillMode="animationFillMode",m);class I{constructor(e){let t=-1,s=null;null==e?t=I.DataType.Null:Number(e)===e&&e%1==0?t=I.DataType.Int32:Number(e)===e&&e%1!=0?t=I.DataType.Float:"string"==typeof e||e instanceof String?t=I.DataType.String:e instanceof I.AnimationImpl?t=I.DataType.Animation:e instanceof I.CornerImpl?t=I.DataType.Corner:e instanceof I.RectImpl?t=I.DataType.Rect:e instanceof I.TextShadowImpl?t=I.DataType.TextShadow:e instanceof I.WebkitTextStrokeImpl?t=I.DataType.WebkitTextStroke:e instanceof I.TransitionImpl?t=I.DataType.Transition:e instanceof I.BorderImageImpl&&(t=I.DataType.BorderImage),e!=I.InvalidInt32&&e!=I.InvalidFloat&&e!=I.InvalidPointer?s=e:(t=I.DataType.Null,s=null),this.data=new I.DataInfo,this.data.index=t,this.data.value=s}toString(){let e=null;switch(this.data.index){case I.DataType.Null:return"";case I.DataType.Int32:case I.DataType.Float:return String(this.get());case I.DataType.String:e=this.get();break;case I.DataType.Animation:case I.DataType.Corner:case I.DataType.Rect:case I.DataType.TextShadow:case I.DataType.WebkitTextStroke:case I.DataType.Transition:case I.DataType.BorderImage:case I.DataType.BackgroundImage:e=this.get().rawValue;break;default:console.error("Failed to do StyleValue.toString()")}return e??""}is(e){return this.data.index==e}get(){return this.data.value}reset(e){this.data.value=e.data.value,this.data.index=e.data.index}equals(e){return this.data.value===e.data.value&&this.data.index===e.data.index}}let S,D;I.Base=class{constructor(e){this.rawValue=e}},I.AnimationImpl=class extends I.Base{constructor(e){super(e),this.name="",this.duration=0,this.timingFunction=null,this.delay=0,this.iterationCount=0,this.direction=!1}},I.CornerImpl=class extends I.Base{constructor(e){super(e),this.topLeft=0,this.topRight=0,this.bottomRight=0,this.bottomLeft=0}},I.RectImpl=class extends I.Base{constructor(e){super(e),this.top=0,this.right=0,this.left=0,this.bottom=0}},I.TextShadowImpl=class extends I.Base{constructor(e){super(e),this.hShadow=0,this.vShadow=0,this.blur=0,this.color=void 0}},I.WebkitTextStrokeImpl=class extends I.Base{constructor(e){super(e),this.length=0,this.color=void 0}},I.TransitionImpl=class extends I.Base{constructor(e){super(e),this.animationMap=new Map}},I.BorderImageImpl=class extends I.Base{constructor(e){super(e),this.source="",this.slice=null}},I.BackgroundImageImpl=(c(f=class extends I.Base{constructor(e){super(e),this.type=0,this.urlPath=""}},"BackgroundImageImpl"),f.eType={UNKNOWN:0,LINEAR_GRADIENT:1,URL_PATH:2},f.LinearGradient=class{constructor(){this.fromX=0,this.fromY=0,this.toX=0,this.toY=0,this.stops=[]}},f),I.DataType=(c(g=class{},"DataType"),g.Null=0,g.Int32=1,g.Float=2,g.String=3,g.Animation=4,g.Corner=5,g.Rect=6,g.TextShadow=7,g.WebkitTextStroke=8,g.Transition=9,g.BorderImage=10,g.BackgroundImage=11,g),I.InvalidInt32=Number.MIN_VALUE,I.InvalidFloat=Number.NaN,I.InvalidPointer=null,I.DataInfo=class{constructor(){this.value=null,this.index=-1}},c(y=class{},"Text"),y.Color="#000000",y.FontFamily="黑体",y.FontSize=10,y.FontStyle="normal",y.FontWeight="normal",y.LineHeight=0,y.TextAlign="start",y.TextOverflow="clip",y.TextShadow=null,y.WebkitTextStroke=null,y.WhiteSpace="normal",y.WordWrap="normal",y.Direction="ltr",y.JsvTextEmoji=0,y.JsvTextLatex=0,y.JsvTextAlignMinWidth=0,y.JsvTextVerticalAlign="top",y.JsvTextLineAlign="middle",y.JsvTextInnerDirection="unset",c(w=class{constructor(){this.height=I.InvalidInt32,this.left=I.InvalidInt32,this.top=I.InvalidInt32,this.width=I.InvalidInt32,this.minWidth=I.InvalidInt32,this.maxWidth=I.InvalidInt32,this.minHeight=I.InvalidInt32,this.maxHeight=I.InvalidInt32}},"Layout"),w.Name="layout",c(k=class{constructor(){this.flexDirection=I.InvalidInt32,this.flexWrap=I.InvalidInt32,this.justifyContent=I.InvalidInt32,this.alignItems=I.InvalidInt32,this.alignContent=I.InvalidInt32,this.alignSelf=I.InvalidInt32,this.flexGrow=I.InvalidFloat}},"Flex"),k.Name="flex",c(C=class{constructor(){this.backgroundColor=I.InvalidPointer,this.backgroundImage=I.InvalidPointer,this.borderRadius=I.InvalidPointer,this.JsvImageBlendType=I.InvalidInt32}},"Background"),C.Name="background",c(T=class{constructor(){this.backfaceVisibility=I.InvalidPointer,this.borderImage=I.InvalidPointer,this.borderImageWidth=I.InvalidPointer,this.borderImageOutset=I.InvalidPointer,this.display=I.InvalidPointer,this.objectFit=I.InvalidPointer,this.opacity=I.InvalidFloat,this.overflow=I.InvalidPointer,this.perspective=I.InvalidInt32,this.perspectiveOrigin=I.InvalidPointer,this.transform=I.InvalidPointer,this.transformOrigin=I.InvalidPointer,this.transformStyle=I.InvalidPointer,this.visibility=I.InvalidPointer,this.zIndex=I.InvalidInt32}},"Effect"),T.Name="effect",c(x=class{constructor(){this.color=I.InvalidPointer,this.fontFamily=I.InvalidPointer,this.fontSize=I.InvalidInt32,this.fontStyle=I.InvalidPointer,this.fontWeight=I.InvalidPointer,this.lineHeight=I.InvalidInt32,this.textAlign=I.InvalidPointer,this.textOverflow=I.InvalidPointer,this.textShadow=I.InvalidPointer,this.webkitTextStroke=I.InvalidPointer,this.whiteSpace=I.InvalidPointer,this.wordWrap=I.InvalidPointer,this.direction=I.InvalidPointer,this.jsvTextEmoji=I.InvalidInt32,this.jsvTextLatex=I.InvalidInt32,this.jsvTextAlignMinWidth=I.InvalidInt32,this.jsvTextVerticalAlign=I.InvalidPointer,this.jsvTextLineAlign=I.InvalidPointer,this.jsvTextInnerDirection=I.InvalidPointer}},"Text"),x.Name="text",c(b=class{constructor(){this.animation=I.InvalidPointer,this.transition=I.InvalidPointer,this.animationFillMode="none"}},"Motion"),b.Name="motion",globalThis.JsvURLClass?(S=globalThis.JsvURLClass,D=()=>window.location.jsvGetLocation()):(S=window.URL,D=()=>window.location.href);class F{constructor(e,t){if(this.href="",this.origin="",this.protocol="",this.host="",this.hostname="",this.port="",this.pathname="",this.search="",this.hash="",!e)return;if(!0===e.startsWith("url")){let t=e.indexOf("(")+1,s=e.lastIndexOf(")");if("undefined"===(e=e.substring(t,s).trim())||"null"===e||0===e.length)return}if(!0===e.startsWith("data:")||!0===e.startsWith("jsvtexturestore:")||!0===e.startsWith("blob:"))return void(this.href=e);let s=e.indexOf("://");if(!(s<0||s>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),(e.startsWith("/")||e.startsWith("./"))&&(e=new S(e,D()).href),this.href=e,!t)return;let i=this.href,n=i.indexOf("#");n>0&&(this.hash=i.substring(n),i=i.substring(0,n));let o=i.indexOf("?");o>1&&(this.search=i.substring(o),i=i.substring(0,o));let r=i,a=r.indexOf("://");this.protocol=a>0?r.substring(0,a+1):"";let l=a>1?r.substring(a+3):"";a=l.indexOf("/"),this.host=a>0?l.substring(0,a):"",this.pathname=a>=1?l.substring(a):"","file:"==this.protocol&&(this.host="",this.pathname=l),this.origin=this.protocol+"//"+this.host,a=this.host.indexOf(":"),this.hostname=a>0?this.host.substring(0,a):this.host,this.port=a>1?this.host.substring(a+1):""}replace(e){this.href=e}}class E{static JsvDeclarePrototype(){for(let e in N){let t=N[e];for(let e in t){let s=t[e];if("string"!=typeof s)continue;const i={set:function(e){this.setProperty(s,e)},get:function(){return this.getPropertyValue(s)}};Object.defineProperty(E.prototype,s,i)}}}constructor(e){this.cachedProps={},this.nativeId=e}setProperty(e,t){if(window.JsvCode.Dom.CheckStyleFormat?.(e,t),e==N.Background.BackgroundImage&&"string"==typeof t)if(0==t.indexOf("linear-gradient")){const e=t.match(/\(/g)?.length,s=t.match(/\)/g)?.length;e!=s&&(console.error(`StyleError: illegal linear-gradient value '${t}'`),t="")}else{t=new F(t).href}else if(e==N.Effect.BorderImage&&"string"==typeof t){const e=t.split(" ");e.length>0&&(e[0]=new F(e[0]).href),t=e.join(" ")}else e==N.Effect.Display&&(this.cachedProps[e]=t);r.Dom.SetStyleProperty(this.nativeId,e,t)}getPropertyValue(e){if(e==N.Effect.Display)return this.cachedProps[e];throw console.error("StyleDeclaration.getPropertyValue() propName="+e),new Error("Get style value is unimplemented because it's low performance.")}jsvGetProperties(...e){const t=JSON.stringify(e),s=r.Dom.GetStyleProperties(this.nativeId,t);return JSON.parse(s)}}class L extends t{constructor(e){super(e)}}var O;!function(e){e[e.Cancel=0]="Cancel",e[e.Click=1]="Click",e[e.LongPress=2]="LongPress",e[e.LongPressRelease=3]="LongPressRelease",e[e.touchFirstStart=4]="touchFirstStart",e[e.touchLastEnd=5]="touchLastEnd"}(O||(O={}));class M extends l{static JsvEnableEventListener(){r.Dom.EnableEventListener((function(e,t,...s){let i=M.JsvEventListenerMap.get(e);const n=i?.get(t);n?.(t,...s)}))}constructor(e){super(l.ELEMENT_NODE),this.jsvNativeId=-1,this.jsvAttrStore={},this.jsvClientSizeStore={},this.tagName=e,this.tagName!=M.JsvTagName.Audio&&this.tagName!=M.JsvTagName.Div&&this.tagName!=M.JsvTagName.Image&&this.tagName!=M.JsvTagName.Video&&this.tagName!=M.JsvTagName.JsvFDiv||(this.jsvNativeId=a.GenerateId(),this.style=new E(this.jsvNativeId),r.Dom.CreateElement(this.jsvNativeId,e))}appendChild(e){e.parentNode?this.moveChildNode(e,null):(super.appendChild(e),this.jsvInsertChild(e,null))}removeChild(e){super.removeChild(e),this.jsvRemoveChild(e),e instanceof M&&e.jsvNativeId>0&&r.Dom.RemoveElementChild(this.jsvNativeId,e.jsvNativeId)}insertBefore(e,t){e.parentNode?e.parentNode==this?(this.jsvMoveChildReOrder(e,t),this.jsvReOrderChildNode(e,t)):this.moveChildNode(e,t):(super.insertBefore(e,t),this.jsvInsertChild(e,t))}addEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);i?.has(t)?console.warn("Element.addEventListener() Faild to add listener, func is exists"):(s=this.jsvCheckEventOptions(s),this.jsvNativeId&&(this.jsvAddListener(this.jsvNativeId,e),r.Dom.AddElementEventListener(this.jsvNativeId,e,s)),super.addEventListener(e,t,s))}removeEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);0!=!!i?.has(t)&&(s=this.jsvCheckEventOptions(s),super.removeEventListener(e,t,s),this.jsvNativeId&&(this.jsvRemoveListener(this.jsvNativeId,e),r.Dom.RemoveElementEventListener(this.jsvNativeId,e,s)))}insertAdjacentElement(e,t){switch(e){case"afterbegin":this.insertBefore(t,this.firstElementChild??null);break;case"beforeend":this.appendChild(t);break;case"beforebegin":this.parentNode?.insertBefore(t,this);break;case"afterend":this.parentNode?.insertBefore(t,this.nextSibling??null)}}get childElementCount(){return this.childNodes.length}get firstElementChild(){return this.childNodes.length>0?this.childNodes?.[0]:null}get lastElementChild(){const e=this.childNodes.length;return e>0?this.childNodes[e-1]:null}set className(e){this.setAttribute("class",e)}get clientWidth(){return this.jsvClientSizeStore.clientWidth||(this.jsvClientSizeStore.clientWidth=r.Dom.GetElementAttribute(this.jsvNativeId,"clientWidth")),this.jsvClientSizeStore.clientWidth}get clientHeight(){return this.jsvClientSizeStore.clientHeight||(this.jsvClientSizeStore.clientHeight=r.Dom.GetElementAttribute(this.jsvNativeId,"clientHeight")),this.jsvClientSizeStore.clientHeight}setAttribute(e,t){e&&(this.jsvAttrStore[e]=t,this.jsvNativeId&&(e.startsWith("data-jsv-vw-")?r.Dom.SetForgeViewInnerProps(this.jsvNativeId,e,t):"class"===e||e.startsWith("data-v-")||e.startsWith("data-jsv")||e.startsWith("dataJsv")?r.Dom.SetElementAttribute(this.jsvNativeId,e,t):"id"===e&&r.Dom.SetForgeViewInnerProps(this.jsvNativeId,"data-jsv-vw-id",t)))}removeAttribute(e){delete this.jsvAttrStore[e],("class"==e||e.startsWith("data-v-")||"src"==e)&&this.jsvNativeId&&r.Dom.SetElementAttribute(this.jsvNativeId,e,null)}getAttribute(e){return this.jsvAttrStore[e]}hasAttribute(e){return!!this.jsvAttrStore[e]}focus(){console.warn("warn: focus is invalid, use JsvFocusBlock to manager")}jsvGetBoundingClientRect(){const e="jsv-getbound",t=a.GenerateId();return new Promise(((s,i)=>{const n=o=>{const r=o.jsvParams?.[1];if(r!=t)return;o.preventDefault(),this.removeEventListener(e,n);const a=JSON.parse(o.jsvParams?.[0]??"{}");0===a.status?s(a.data):i(a.error)};this.addEventListener(e,n,{jsvtoken:t})}))}jsvSetTapListener(e,t=0){let s=this.jsvGetProxyView(!0);if(!e)return s.DragEnables(0),void s.SetTapListener(null);e.onClick&&(t|=1),(e.onLongPress||e.onLongPressRelease)&&(t|=2),e.onTouchStart&&(t|=8),e.onTouchEnd&&(t|=16),s.DragEnables(t),s.SetTapListener(((t,s)=>{switch(t){case O.Cancel:e.onCancel?.(s);break;case O.LongPress:e.onLongPress?.(s);break;case O.LongPressRelease:e.onLongPressRelease?.(s);break;case O.Click:e.onClick?.(s);break;case O.touchFirstStart:e.onTouchStart?.(s);break;case O.touchLastEnd:e.onTouchEnd?.(s);break;default:console.error("Error:onTap unknown type:"+t)}}))}jsvSetOnLazyTaskSyncedListener(e){r.Dom.AppendLazyTaskSyncedListener(this.jsvNativeId,e)}jsvOnEvent(e,...n){let o;e.startsWith("animation")?(o=new s(e),o.animationName=n[0]):e.startsWith("transition")?(o=new L(e),o.propertyName=n[0]):e.startsWith("jsv")?(o=new i(e),o.options={detail:n[0]},o.jsvParams=n):"click"!=e&&"mouseenter"!=e&&"mouseleave"!=e||(o=new t(e),o.target=this),o&&(o.target=this,this.dispatchEvent(o))}jsvGetProxyView(e){return e?(this.maskViewProxy||(this.maskViewProxy=n.NewDomProxyView(this.jsvNativeId,!0)),this.maskViewProxy):(this.mainViewProxy||(this.mainViewProxy=n.NewDomProxyView(this.jsvNativeId,!1)),this.mainViewProxy)}jsvGetProxyTexture(e){return this.mainViewTextureProxy||(this.mainViewTextureProxy=e.GetDomProxyTexture(this.jsvNativeId)),this.mainViewTextureProxy}jsvGetRelativePosition(e){return r.Dom.GetRelativePosition(this.jsvNativeId,e.jsvNativeId)}jsvAddListener(e,t){let s=M.JsvEventListenerMap.get(e);s||(s=new Map,M.JsvEventListenerMap.set(e,s));this.jsvGetEventListenerSet(t)||s.set(t,this.jsvOnEvent.bind(this))}jsvRemoveListener(e,t){let s=M.JsvEventListenerMap.get(e);if(!s)return;this.jsvGetEventListenerSet(t)||s.delete(t)}moveChildNode(e,t){console.log("Do move child node");let s=e.parentNode;s.jsvMoveChildToNewParent(e,this,t),this.jsvMoveChildNode(s,e,t)}jsvMoveChildNode(e,t,s){t.jsvNativeId&&(s=M.JsvFindBackwardForgeView(s),r.Dom.MoveElementChild(this.jsvNativeId,e.jsvNativeId,t.jsvNativeId,s?.jsvNativeId))}jsvReOrderChildNode(e,t){e.jsvNativeId&&(t=M.JsvFindBackwardForgeView(t),r.Dom.ReOrderElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvInsertChild(e,t){e.parentNode=this,e.nodeType===l.TEXT_NODE?this.textContent=e.nodeValue:e instanceof M&&e.jsvNativeId>0&&(t=M.JsvFindBackwardForgeView(t),r.Dom.InsertElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvRemoveChild(e){if(e instanceof M!=0){for(const t of e.childNodes)e.jsvRemoveChild(t);e.jsvFinalize(),r.Dom.RemoveLazyTaskSyncedListener(e.jsvNativeId),M.JsvEventListenerMap.delete(e.jsvNativeId)}}jsvCheckEventOptions(e){if(null==e)return null;if("object"!=typeof e||e instanceof Array)return console.warn("Event options is invalid for ",e),null;const t=["capture","once","passive","signal"];for(const[s,i]of Object.entries(e))0==t.includes(s)&&0==s.startsWith("jsv")&&(console.warn("Event options name is invalid: ",s),delete e[s]),"boolean"==typeof i?e[s]=+e[s]:"number"!=typeof i&&(console.warn("Event options value is invalid: ",i),delete e[s]);return e}static JsvFindBackwardForgeView(e){let t=e;for(;t&&!(t instanceof M);)t=t.nextSibling;return t}}M.JsvTagName={Anchor:"A",Audio:"AUDIO",Div:"DIV",Head:"HEAD",Image:"IMG",IFrame:"IFRAME",Link:"LINK",Script:"SCRIPT",Style:"STYLE",Svg:"SVG",Video:"VIDEO",JsvAudioTrack:"JSV-AUDIOTRACK",JsvFDiv:"FDIV"},M.JsvEventListenerMap=new Map;class B extends M{constructor(){super(M.JsvTagName.Anchor),this.href="",this.protocol="",this.host="",this.search="",this.hash="",this.hostname="",this.port="",this.pathname="",console.warn("Warnig: <a> is fake in JsView system")}jsvGetTagName(){return M.JsvTagName.Anchor}}class R extends l{constructor(e){super(l.COMMENT_NODE),this.textContent=e}}class P extends M{constructor(){super(M.JsvTagName.Div),this.textContentStore=null}get textContent(){return this.textContentStore}set textContent(e){this.textContentStore=e,this.jsvClientSizeStore={},r.Dom.SetElementText(this.jsvNativeId,e)}}const J="FocusDebug",j="__AppRoot__",A={PrintToken:1,DebugSwitch:!1,DebugNeedCallStack:!1,ChangingFocusLock:!1,DelayedFocusChanges:[]};function _(e){let t="";if(e){let s=e,i=s.RouterDelegate?.ref?.NameSpace;for(i=i==j?"":i,t=`[${i?i+", ":""}${s.BranchName}]`,s=s.GetParentPage();s;)i=s.RouterDelegate?.ref?.NameSpace,i=i==j?"":i,t=`[${i?i+", ":""}${s.BranchName}]->`+t,s=s.GetParentPage()}return t}function W(e,t){let s=_(e);if(null!=t){if(t.stack){let e=t.stack.split("\n");e.length>=3&&(t.stack=e.slice(2,6).join("\n"))}let e=t?.stack;t.stack=null,console.log(J,`focusChange(${t.from}):${t.askName}\n:originFocusStack:${t.originFStack}\n:focusStack:${s}\n:trace:${e}:`,t)}else console.log(J,`focusChange:${s} but empty debugSaveInfo`)}class U{constructor(){this.listeners=[]}addListener(e){-1===this.listeners.indexOf(e)&&this.listeners.push(e)}removeListener(e){const t=this.listeners.indexOf(e);t>-1&&this.listeners.splice(t,1)}notifyListeners(e){this.listeners.forEach((t=>t(e)))}}class V{constructor(e,t){this._ChildMap={},this._FocusNameBeforeMount=null,this._BeforeMountStack=null,this._FocusNodeName=null,this._FocusListenerManagerOnRequest=null,this._FocusListenerManagerOnFocus=null,this.LastFocusNodeName=null,this.LastFocusNode=null,this.IsTemp=!!e,this.NameSpace=t}getDeactivePageFocusName(){return this._FocusNodeName}getCurrentFocusNode(e=!1){if(null==this._FocusNodeName)return null;let t=this._ChildMap[this._FocusNodeName];if(!t)return e||console.error("Erorr: JsvFocus node not mounted name="+this._FocusNodeName),null;if(t.RouterDelegate.ref!=this){let e=t.RouterDelegate.ref.getCurrentFocusNode();return null==e?t:e}return t}getNodeByName(e,t){let s=e.split(".");return this._FindRouterSearchBase(s,t)._GetNodeFromPathArray(s,e)}printAllFocusRecursive(e,t){let s=this.NameSpace==j?"":this.NameSpace,i=t+(t&&t.length>0?".":"")+s;for(let t in this._ChildMap){let s=this._ChildMap[t];if(!e||0==e.length||i.indexOf(e)>=0){let e=i===j?t:i+"."+t;console.log(e,s)}s.RouterDelegate.ref!=this&&s.RouterDelegate.ref.printAllFocusRecursive(e,i)}}addFocusChangeListener(e,t=!1){t?(this._FocusListenerManagerOnRequest||(this._FocusListenerManagerOnRequest=new U),this._FocusListenerManagerOnRequest.addListener(e)):(this._FocusListenerManagerOnFocus||(this._FocusListenerManagerOnFocus=new U),this._FocusListenerManagerOnFocus.addListener(e))}delFocusChangeListener(e,t=!1){t?this._FocusListenerManagerOnRequest&&this._FocusListenerManagerOnRequest.removeListener(e):this._FocusListenerManagerOnFocus&&this._FocusListenerManagerOnFocus.removeListener(e)}_FindRouterSearchBase(e,t){if(0==e[0].length){let t=null;for(let e in this._ChildMap){t=this._ChildMap[e];break}if(null!=t){let s;do{s=t,t=t.GetParentPage()}while(null!=t);return e.splice(0,1),s.RouterDelegate.ref}return null}return t&&t.AsHub&&t.GetParentPage()?t.GetParentPage().RouterDelegate.ref:this}_GetNodeFromPathArray(e,t){let s=0,i=this;for(;s<e.length-1;){let n=!1;for(let t in i._ChildMap){let o=i._ChildMap[t].RouterDelegate.ref;if(null!=o&&o!=i&&o.NameSpace==e[s]){i=o,s++,n=!0;break}}if(!n)return void console.error(`Error: no found subpath fname=${t}`)}let n=e[s];return i._ChildMap.hasOwnProperty(n)?i._ChildMap[n]:void console.error(`Error: no found JsvFocus name=${t}`)}add(e,t){if(e.indexOf(".")>=0)console.error("ERROR: JsvFocus name can not contains '.'");else if(this._ChildMap.hasOwnProperty(e)&&this._ChildMap[e]!==t)console.error(`ERROR: JsvFocus router branch name duplicated:[${e}]`);else if(this._ChildMap[e]=t,this._FocusNameBeforeMount)if("string"==typeof this._FocusNameBeforeMount)this._FocusNameBeforeMount==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount,!1,this._BeforeMountStack);else{this._FocusNameBeforeMount[0]==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount.slice(1),!1,this._BeforeMountStack)}}remove(e,t,s,i){let n=this._ChildMap[e];n&&n==t&&(delete this._ChildMap[e],n.OnRemoveFromTree()),this._FocusNodeName==e&&s&&(i||(this._FocusNodeName=s))}rename(e,t){if(!this._ChildMap.hasOwnProperty(e))return void console.error(`ERROR: alter JsvFocus name failed ${e}->${t}`);let s=this._ChildMap[e];delete this._ChildMap[e],this.add(t,s),this._FocusNodeName==e&&(this._FocusNodeName=t)}clearChildFocus(){this._FocusNodeName=null,this._FocusNameBeforeMount=null}hasPendingFocusRequest(){return!this._FocusNameBeforeMount}focusBeforeMount(e,t,s){if(A.DebugSwitch)if(null==s)console.error(J,`Error: found debug info missing from ${new Error("simulate-stack").stack}`);else if(!s.originFStack){let e=this.getCurrentFocusNode(!0);s.originFStack="Mark1:",s.originFStack+=e?_(e):`NoFocus[focusSet:${this._FocusNodeName} notMountFocus:${this._FocusNameBeforeMount}]`}if(this._FocusListenerManagerOnRequest&&"string"==typeof e&&!e.includes(".")&&this._FocusListenerManagerOnRequest.notifyListeners(e),A.ChangingFocusLock){let i=this;return A.DelayedFocusChanges.push((()=>{i.focusBeforeMount(e,t,s)})),!0}A.ChangingFocusLock=!0;try{let i=!1;if("string"==typeof e){if(!e.includes(".")){i=!0;let n=this._ChildMap[e];if(this._FocusNodeName=e,n){this._FocusNameBeforeMount=null,this._BeforeMountStack=s,this._FocusListenerManagerOnFocus&&this._FocusListenerManagerOnFocus.notifyListeners(e),n.Focus(!t);let i=n.GetFocusChild();for(;i;){let e=i.GetFocusChild();if(!e){this._FocusNodeName=i.BranchName;break}i=e}return A.DebugSwitch&&W(i??n,s),n.RouterDelegate.ref!=this&&n.RouterDelegate.ref.clearChildFocus(),!0}return this._FocusNameBeforeMount=e,this._BeforeMountStack=s,A.DebugSwitch&&function(e,t){if(null!=t){if(t.stack){let e=t.stack.split("\n");e.length>=3&&(t.stack=e.slice(2,6).join("\n"))}let s=t?.stack;t.stack=null,console.log(J,`focusChange(wait-mount)(${t.from}):${t.askName}\n:originFocusStack:${t.originFStack}\n:focusName:${e}\n:trace:${s}:`,t)}else console.log(J,`focusChange(wait-mount):${e} but empty debugSaveInfo`)}(e,s),!1}console.error("error: JsvFocus name contain .")}else if("object"==typeof e&&Array.isArray(e)&&e.length>0){if(i=!0,1==e.length)return this.focusBeforeMount(e[0],t,s);{let i=e[0],n=this._ChildMap[i];return this._FocusNodeName=i,n?n.RouterDelegate.ref.focusBeforeMount(e.slice(1),t,s):(this._FocusNameBeforeMount=e,this._BeforeMountStack=s,!1)}}i||console.error("illegal JsvFocus name param",e)}finally{A.ChangingFocusLock=!1;let e=A.DelayedFocusChanges.length;if(e>0){let t=A.PrintToken++;A.DebugSwitch&&console.log(J,`stash onFocus pop start(token=${t}) len=${e}`);let s=A.DelayedFocusChanges;A.DelayedFocusChanges=[];for(let t=0;t<e;t++)s[t]();A.DebugSwitch&&console.log(J,`stash onFocus pop done(token=${t})`)}}return!1}focus(e,t,s){let i=this.focusBeforeMount(e,t,s);return i||console.log("No found JsvFocusbranch:"+e),i}forEach(e){for(let t in this._ChildMap)e(this._ChildMap[t],t,this._ChildMap)}printNodes(){console.log(this._ChildMap)}}class H{constructor(e,t){this._DefaultFocusNameSpace=null,this._DefaultFocusNameSpace=null,this.RouterDelegate={ref:null},e||(this.RouterDelegate.ref=new V(!1,t))}enableFocusTrace(e){A.DebugSwitch=!0,A.DebugNeedCallStack=e}getNameSpace(){let e=this.RouterDelegate.ref.NameSpace;return e==j?"":e}wrapWithNameSpace(e){let t=new H(!0);return t._DefaultFocusNameSpace=e,t.RouterDelegate=this.RouterDelegate,t}getNodeByName(e,t){return this.RouterDelegate.ref.getNodeByName(e,t)}focusByNameBeforeMount(e,t,s){if("string"==typeof e)return e.includes(".")&&(e=e.split(".")),this.RouterDelegate.ref.focusBeforeMount(e,t,s);console.error(`setFocus name=${e} is invalid`)}setFocus(e,t){this._DefaultFocusNameSpace&&this._DefaultFocusNameSpace.length>0&&(e=`${this._DefaultFocusNameSpace}.${e}`),z.SetFocusCallSeqToken++;let s=null;A.DebugSwitch&&(s={askName:e,deepToChild:t,from:"setFocus",stack:A.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:null});return this.focusByNameBeforeMount(e,t,s)}getFocusCallToken(){return z.SetFocusCallSeqToken}printAllFocusable(){this.RouterDelegate.ref.printAllFocusRecursive(this._DefaultFocusNameSpace,"")}getCurrentFocusStack(){const e=[];if(this.RouterDelegate.ref){let t=this.RouterDelegate.ref.getCurrentFocusNode();for(;t;){let s=t.RouterDelegate?.ref?.NameSpace;e.push({nameSpace:s==j||s==t.BranchName?"":s,name:t.BranchName}),t=t.GetParentPage()}}else console.error("getCurrentFocusStack failed: router delegate is null.");return e}getLastFocus(){return z.FirstName}getLastFocusNear(){return z.LatestName}getCurrentFocus(){if(this.RouterDelegate.ref){const e=this.RouterDelegate.ref.getCurrentFocusNode();if(e)return e.BranchName}return null}getCurrentFocusNode(){return this.RouterDelegate.ref?.getCurrentFocusNode()}getDeactivedPageFocus(){return this.RouterDelegate.ref?this.RouterDelegate.ref.getDeactivePageFocusName():null}returnFocusToParent(){z.SetFocusCallSeqToken++;const e=this.RouterDelegate.ref.getCurrentFocusNode();e?e.ReturnFocusToParent():console.warn("returnFocusToParent: current focus node is null.")}addFocusChangeListener(e,t=!1){this.RouterDelegate.ref.addFocusChangeListener(e,t)}delFocusChangeListener(e,t=!1){this.RouterDelegate.ref.delFocusChangeListener(e,t)}}const z={LatestName:null,FirstName:null,FocusChangeSeqToken:0,SetFocusCallSeqToken:0};class G extends n.PageBase{constructor(e,t){super(e),this._OnKeyDown=null,this._OnKeyUp=null,this._OnFocus=null,this._OnBlur=null,this._DispatchKeyDown=null,this._DispatchKeyUp=null,this._OnCustomEvent=null,this._DKeyDownProxy=void 0,this._DKeyUpProxy=void 0,this._Mounted=!1,this._MountWaitingList=null,this._FlagNamed=!1,this.AsHub=!1,this.InterfaceHub=null,this._TmpRouter=null,this._AutoShow=null,this.NativeId=-1,this.BranchName=e,this.NativeId=t,this.RouterDelegate={ref:null},this._TmpRouter=null,this._OriginDispatchKeyDown=this._OriginDispatchKeyDown.bind(this),this._OriginDispatchKeyUp=this._OriginDispatchKeyUp.bind(this),this._AutoShow=!1,G.sFocusNodeMap.set(this.NativeId,this)}async waitMounted(){if(this._Mounted)return;let e=this;return new Promise(((t,s)=>{e._MountWaitingList||(e._MountWaitingList=[]),e._MountWaitingList.push(t)}))}updateMountState(){this._Mounted=!0;let e=this.SubPages;for(let t in e)e[t].updateMountState();if(this._MountWaitingList&&this._MountWaitingList.length>0){for(const e of this._MountWaitingList)e();this._MountWaitingList=null}}getHub(){return this.InterfaceHub||(this.InterfaceHub=new H(!0),this.InterfaceHub.RouterDelegate=this.RouterDelegate),this.InterfaceHub}setHub(e){this.RouterDelegate.ref?console.error("Error: hub is already setted."):(this.RouterDelegate.ref=e.RouterDelegate.ref,this.AsHub=!0)}_UseParentRouter(e){this.RouterDelegate=e,this.InterfaceHub&&(this.InterfaceHub.RouterDelegate=e)}routerAdd(e,t){t.RouterDelegate.ref||t._UseParentRouter(this.RouterDelegate),this.RouterDelegate.ref||(this.RouterDelegate.ref=new V(!0)),this.RouterDelegate.ref.add(e,t)}routerRenameChild(e,t){this.RouterDelegate.ref.rename(e,t)}routerUnbind(e,t){let s;this.AsHub?this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref):s=this.RouterDelegate.ref,s&&s.remove(this.BranchName,this,e,t),this.RouterDelegate={ref:null}}setBranchName(e){if(e===this.BranchName)return;let t=this.BranchName;this.BranchName=e,this.PageName=e,this._FlagNamed=!0;let s=this.GetParentPage();s&&s.routerRenameChild(t,e)}static safeCallback(e){return e&&e instanceof Function?function(...t){try{return e(...t)}catch(t){console.error("FocusNode: callback error",e.name,t)}}:null}setOnKeyDown(e){this._OnKeyDown=G.safeCallback(e)}setOnKeyUp(e){this._OnKeyUp=G.safeCallback(e)}setOnFocus(e){this._OnFocus=G.safeCallback(e)}setOnBlur(e){this._OnBlur=G.safeCallback(e)}setDispatchKeyUp(e){this._DispatchKeyUp=G.safeCallback(e)}setDispatchKeyDown(e){this._DispatchKeyDown=G.safeCallback(e)}setOnCustomEvent(e){this._OnCustomEvent=G.safeCallback(e)}setDispatchKeyProxy(e,t){this._DKeyDownProxy=G.safeCallback(e),this._DKeyUpProxy=G.safeCallback(t)}requestFocus(e){let t=null;A.DebugSwitch&&(t={askName:this.BranchName,deepToChild:e,from:"requestFocus",stack:A.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:null}),this.requestFocusInner(e,t)}ReturnFocusToParent(){if(this.IsFocus()){let e=this.GetParentPage();if(e){const t=e.BranchName;let s=null;A.DebugSwitch&&(s={askName:t,deepToChild:!1,from:"returnFocusToParent",stack:A.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:null}),e.RouterDelegate.ref.focus(t,!1,s)}}else super.ReturnFocusToParent()}requestFocusInner(e,t){let s=this.RouterDelegate.ref;return this.AsHub&&this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref),s?s.focus(this.BranchName,e,t):(console.error("error: lost router"),!1)}OnKeyDown(e){return!!this._OnKeyDown&&this._OnKeyDown(e)}OnKeyUp(e){return!!this._OnKeyUp&&this._OnKeyUp(e)}OnCustomEvent(e){return!!this._OnCustomEvent&&this._OnCustomEvent(e)}bubbleCustomEvent(e){this.BubbleCustomEvent(e)}dispatchKeyDown(e){return this.DispatchKeyDown(e)}DispatchKeyDown(e){return this._DKeyDownProxy?this._DKeyDownProxy(e,this._OriginDispatchKeyDown):this._OriginDispatchKeyDown(e)}_OriginDispatchKeyDown(e){let t=!1;return this._DispatchKeyDown&&(t=this._DispatchKeyDown(e)),!!t||super.DispatchKeyDown(e)}dispatchKeyUp(e){return this.DispatchKeyUp(e)}DispatchKeyUp(e){return this.__DKeyUpProxy?this.__DKeyUpProxy(e,this._OriginDispatchKeyUp):this._OriginDispatchKeyUp(e)}_OriginDispatchKeyUp(e){let t=!1;return this._DispatchKeyUp&&(t=this._DispatchKeyUp(e)),!!t||super.DispatchKeyUp(e)}attachToActivity(e,t){this.AttachToActivity(e,t)}AttachToActivity(e,t){super.SetParent(e,t)}setParent(e){this.SetParent(e)}SetParent(e){if(null!=e&&(super.SetParent(e,null),this.GetParentPage()._Mounted&&(this.updateMountState(),K()),e instanceof G)){if(this.RouterDelegate.ref&&this.RouterDelegate.ref.IsTemp){let t=this.RouterDelegate.ref;this.RouterDelegate.ref=null,t.forEach(((t,s)=>{e.routerAdd(s,t)}))}e.routerAdd(this.BranchName,this)}}focus(e){this.Focus(e)}Focus(e){if(!this._Mounted)return G.sFocusMemos.push({obj:this,bcf:e}),void console.log("page base tree not build, cache focus");super.Focus(e)}OnFocus(e){this._OnFocus&&this._OnFocus()}OnBlur(e){this._FlagNamed&&(z.LatestName=this.BranchName,z.FocusChangeSeqToken!=e&&(z.FocusChangeSeqToken=e,z.FirstName=this.BranchName)),this._OnBlur&&this._OnBlur()}onUnMount(e){G.sFocusNodeMap.delete(this.NativeId);let t=this.IsFocus();if(t&&this._FlagNamed&&(z.LatestName=this.BranchName,z.FirstName=this.BranchName,z.FocusChangeSeqToken=0),A.DebugSwitch&&t){let t=this.GetParentPage();if(t){let s=null;s={askName:t.BranchName,deepToChild:!1,from:e?"deactive":"unmount",stack:A.DebugNeedCallStack?new Error("simulate-stack").stack:null,originFStack:"Mark2:"+_(this)},W(t,s)}}let s=this.GetParentPage();s&&s.RemoveSubPage(this),this.ClearSubPages(),this.routerUnbind(s?.BranchName,e),this._Mounted=!1}getFullName(){let e=this,t=[this.RouterDelegate.ref.NameSpace];this.AsHub||t.push(this.BranchName);let s=this.RouterDelegate.ref;do{if(e=e.GetParentPage(),t[0]==j)break;e&&e.RouterDelegate.ref!=s&&(s=e.RouterDelegate.ref,t.unshift(s.NameSpace))}while(e);return t[0]==j?t.shift():console.error("ERROR: missing app root"),t.join(".")}getNodeByName(e){return this.RouterDelegate.ref.getNodeByName(e,this)}}G.sFocusMemos=[],G.sRootPageNode=null,G.sFocusNodeMap=new Map;let K=()=>{let e=G.sFocusMemos.length;if(e>0){let t=G.sFocusMemos;G.sFocusMemos=[];for(let s=0;s<e;s++)t[s].obj.Focus(t[s].bcf)}};class q extends t{constructor(e){super(e),this.keyCode=-1,this.key=-1,this.repeat=0,this.keyCode=-1,this.key=-1,this.repeat=0}}q.KeyCode={Enter:13,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40};let $={};class X{constructor(e,t,s){this._AutoSearchFocus=!1,this._Element=s,$.hasOwnProperty(e)&&console.error(`Warn: FDivRoot duplicate name=${e}`),$[e]=this,this._DoInit(t)}_DoInit(e){let t=this._Element.FocusNodeRef;this._Element.setAttribute("new-namespace","__AppRoot__"),e&&t.setDispatchKeyProxy(e.keyDown,e.keyUp),t.setOnKeyDown((e=>{if(!this._AutoSearchFocus)return!1;switch(e.keyCode){case q.KeyCode.ArrowLeft:case q.KeyCode.ArrowUp:case q.KeyCode.ArrowRight:case q.KeyCode.ArrowDown:const t=this.getHub().getCurrentFocusNode();if(t){const s=r.Dom.SearchNextFocus(t.NativeId,e.keyCode),i=G.sFocusNodeMap.get(s);if(i)return this.getHub().setFocus(i.getFullName()),!0}}return!1})),t.attachToActivity(window.JsvCode.ForgeHandles.RootActivity,window.JsvCode.ForgeHandles.RootView)}enableAutoSearchFocus(e){this._AutoSearchFocus=e}getElement(){return this._Element}getHub(){return this._Element.jsvGetHub()}onMounted(){this._Element.FocusNodeRef.updateMountState(),K()}}class Y extends M{constructor(){super(M.JsvTagName.Image)}setAttribute(e,t){if("src"===e){if("string"!=typeof t)return void console.error("Error:img.src is not string!",t);t=new F(t).href,this.jsvClientSizeStore={}}super.setAttribute(e,t),this.jsvNativeId&&"src"===e&&r.Dom.SetElementAttribute(this.jsvNativeId,e,t)}jsvOnEvent(e,...s){let i;super.jsvOnEvent(e,...s),"load"==e&&(i=new t(e),i.target=this),i&&this.dispatchEvent(i)}}class Z extends M{constructor(){super(M.JsvTagName.Link)}setAttribute(e,t){this[e]=t}jsvLoadResource(){let e=!1,t=null;if(null!=this.href){var s=new F(this.href);console.log("Ignore to load link from url="+s.href),e=!0}else console.warn("Failed to load link, href is not exists."),t="NoSrc";this.jsvOnLoadResult(e,t)}jsvOnLoadResult(e,s){if(console.log("Load link result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class Q extends M{constructor(){super(M.JsvTagName.Script)}setAttribute(e,t){this[e]=t}jsvLoadResource(){if(null!=this.src){var e=new F(this.src);console.log("Load script with url="+e.href);var t=this;window.JsView.runJsWithUrl(e.href,!1,((e,s)=>{t.jsvOnLoadResult(e,s)}))}}jsvOnLoadResult(e,s){if(console.log("Load script result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class ee extends M{constructor(){super(M.JsvTagName.Style),this.jsvAttrStore={left:0,top:0,width:0,height:0}}}class te extends M{constructor(){super(M.JsvTagName.Svg)}}class se extends l{constructor(e){super(l.TEXT_NODE),this.textContent=e}get nodeValue(){return this.textContent}set nodeValue(e){this.textContent=e,this.parentNode&&(this.parentNode.textContent=this.textContent)}}let ie=1;class ne extends M{constructor(){super(M.JsvTagName.JsvFDiv),this.FocusNodeRef=new G("unnamed-"+ie++,this.jsvNativeId),this.hubRef=void 0}setAttribute(e,t){if(e)if("fname"===e)t&&this.FocusNodeRef.setBranchName(t);else if("new-namespace"===e){if(""!==t&&!this.hubRef){let e=new H(!1,t);this.hubRef=e,this.FocusNodeRef.setHub(e),this.FocusNodeRef.setBranchName(t)}}else super.setAttribute(e,t)}removeAttribute(e){}jsvGetHub(){return this.hubRef}}class oe extends l{constructor(){super(l.DOCUMENT_NODE),this.location=window.location,this.rootElement=new P,this.rootElement.ownerDocument=this,this.rootElement.id="root",r.Dom.BindElementToRootView(this.rootElement.jsvNativeId),this.activeElement=this.rootElement,this.head=null}createComment(e){return new R(e)}createElement(e){switch(e=e.toUpperCase()){case M.JsvTagName.Anchor:return new B;case M.JsvTagName.Div:return new P;case M.JsvTagName.Image:return new Y;case M.JsvTagName.Link:return new Z;case M.JsvTagName.Script:return new Q;case M.JsvTagName.Style:return new ee;case M.JsvTagName.Svg:return new te;case M.JsvTagName.JsvFDiv:return new ne;case M.JsvTagName.IFrame:console.error("Unsupported element: "+e+". Your vue compilation may may have failed, please check it first.")}if("TEMPLATE"==e)return{};throw new TypeError("Unimplemented element: "+e)}createEvent(e){return"CUSTOMEVENT"===(e=e.toUpperCase())?new i(e):new t(e)}createTextNode(e){return new se(e)}getElementById(e){if("root"===e||"app"===e)return this.rootElement;throw new DOMException("Failed to get element by id, id="+e+" is UNIMPLEMENTED.")}getElementsByTagName(e){if((e=e.toUpperCase())===M.JsvTagName.Head)return[this.head];if(e===M.JsvTagName.Link||e===M.JsvTagName.Script||e===M.JsvTagName.Style)return[];throw new DOMException("Failed to get element by name, name="+e+" is UNIMPLEMENTED.")}querySelector(e){if("root"===e||"#app"===e)return this.rootElement;if("head"===e)return this.head;if("base"===e)return null;if("title"===e)return null;if(e.startsWith("style[")&&e.endsWith("]"))return null;throw new DOMException("Failed to query selector, selectors="+e+" is UNIMPLEMENTED.")}querySelectorAll(e){return[]}jsvInitFDivRoot(e,t,s){if(!s){let e=this.createElement("fdiv");this.rootElement.appendChild(e),this.rootElement=e,s=this.rootElement}return new X(e,t,s)}}class re extends M{constructor(){super(M.JsvTagName.Head)}appendChild(e){super.appendChild(e),(e instanceof Z||e instanceof Q)&&e.jsvLoadResource()}removeChild(e){super.removeChild(e)}}class ae{constructor(){this.ready=!1,this.callbacks=[]}listenToReady(e){this.ready?e?.():this.callbacks.push(e)}dataReady(){this.ready=!0;for(let e of this.callbacks)e?.()}}class le extends ae{constructor(){super(),this.TextureManager=null,this.RootActivity=null,this.RootView=null,this.sRenderBridge=null}setHandles(e,t,s,i){this.TextureManager=e,this.RootActivity=s,this.RootView=t,this.sRenderBridge=i,this.dataReady()}}let ce="@keyframes";class de{constructor(e){this._AnchorTag=e,this._NamesCache=new Set}insertRule(e){let t=this.getName(e);this._NamesCache.has(t)&&console.warn(`Warn: keyframe replace of name ${t}`),this._NamesCache.add(t),r.Dom.InsertKeyFrame(t,e)}hasRule(e){return this._NamesCache.has(e)}removeRule(e){this._NamesCache.has(e)?(this._NamesCache.delete(e),r.Dom.RemoveKeyFrame(e)):console.error(`Error: keyFrame(${e}) is not exist.`)}removeMultiRules(e){for(let t of e)this.removeRule(t)}getName(e){let t=e.indexOf(ce)+10,s=e.indexOf("{");return e.substring(t,s).trim()}}let he=null;function ue(e){return he||(he={global:new de("global")}),he.global}class pe{static EnsureGlobalEnv(e,t){const s=window.navigator?.userAgent?.toLowerCase();window.jsvInAndroidWebView=s?.indexOf("android")>=0,pe.EnsureGlobalJsvCode(e,t),M.JsvEnableEventListener(),E.JsvDeclarePrototype()}static EnsureGlobalJsvCode(e,t){window.JsvCode.Dom||(window.JsvCode.Dom={}),window.JsvCode.Media||(window.JsvCode.Media={}),window.JsvCode.Dom.PlatformBridge||(window.JsvCode.Dom.PlatformBridge=e),window.JsvCode.Media.PlatformBridge||(window.JsvCode.Media.PlatformBridge=t),window.JsvCode.Dom.DeclareStyleSheets||(window.JsvCode.Dom.DeclareStyleSheets=r.Dom.DeclareStyleSheets),window.JsvCode.Dom.UndeclareStyleSheets||(window.JsvCode.Dom.UndeclareStyleSheets=r.Dom.UndeclareStyleSheets),window.JsvCode.Dom.getKeyFrameGroup||(window.JsvCode.Dom.getKeyFrameGroup=ue),window.JsvCode.Dom.IsLazyTaskQueueOverLoad||(window.JsvCode.Dom.IsLazyTaskQueueOverLoad=r.Dom.IsLazyTaskQueueOverLoad),window.JsvCode.Dom.SetLazyTaskOverLoadLevel||(window.JsvCode.Dom.SetLazyTaskOverLoadLevel=r.Dom.SetLazyTaskOverLoadLevel),window.JsvCode.ForgeHandles||(window.JsvCode.ForgeHandles=new le)}}class ve{static SetLevel(e){switch(ve.E=ve.W=ve.I=ve.D=function(){},e){case ve.Level.Verbose:ve.V=console.debug.bind(console);case ve.Level.Debug:ve.D=console.debug.bind(console);case ve.Level.Info:ve.I=console.info.bind(console)}}}ve.E=console.error.bind(console),ve.W=console.warn.bind(console),ve.I=console.info.bind(console),ve.D=function(){},ve.V=function(){},ve.Level={Error:0,Warning:1,Info:2,Debug:3,Verbose:4};class me{constructor(e){this.callback=e}observe(e,t){if(!(e instanceof l))throw Error("TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type JsView's 'Node'");for(const e of Object.keys(t))"childList"==e||console.warn("JsView: only childList config is supported! ignore "+e);t.childList&&e.jsvObserveChildChanged((()=>{this.callback?.()}))}disconnect(){this.callback=void 0}}class fe{constructor(e){this.activity=new n.ReactActivity("BrowserForgeActivity",e,null,null),this.init()}init(){console.log("create BrowserForgeActivity.");let e=new n.LayoutView;window.JsvCode.ForgeHandles.setHandles(this.activity.GetTextureManager(),e,this.activity,n.sRenderBridge);let t=null;n.DesignMap&&(t=n.DesignMap());let s=t?t.width:1280,i=Math.floor(9*s/16);this.activity.SetContentView(e,{x:0,y:0,width:s,height:i}),n.sRenderBridge.AddWillSwapListener("forgeSwap",(()=>{r.Dom.RequestSwapAllCachedTasks()}))}}class ge{constructor(e){this.activityManager=e;let t=new fe(e);e.StartActivity(t.activity)}}class ye extends ee{constructor(){super(),this.jsvBrowserElement=window.JsvCode.Dom.BrowserDocument.createElement(ee.JsvTagName.Style)}}class we extends re{constructor(){super()}appendChild(e){"HTMLLinkElement"==e.constructor.name||"HTMLScriptElement"==e.constructor.name?window.JsvCode.Dom.BrowserDocument.head.appendChild(e):e instanceof ye?window.JsvCode.Dom.BrowserDocument.head.appendChild(e.jsvBrowserElement):super.appendChild(e)}removeChild(e){"HTMLLinkElement"==e.constructor.name||"HTMLScriptElement"==e.constructor.name?window.JsvCode.Dom.BrowserDocument.head.removeChild(e):e instanceof ye?window.JsvCode.Dom.BrowserDocument.head.removeChild(e.jsvBrowserElement):super.removeChild(e)}}class ke extends oe{constructor(){super(),this.head=new we}createElement(e){switch(e=e.toUpperCase()){case M.JsvTagName.IFrame:case M.JsvTagName.Link:case M.JsvTagName.Script:return window.JsvCode.Dom.BrowserDocument.createElement(e);case M.JsvTagName.Style:return new ye;default:return super.createElement(e)}}getElementsByTagName(e){return e.toUpperCase()===M.JsvTagName.Head?window.JsvCode.Dom.BrowserDocument.getElementsByTagName(e):super.getElementsByTagName(e)}querySelector(e){return"#canvas"==e?window.JsvCode.Dom.BrowserDocument.getElementById("canvas"):super.querySelector(e)}}class Ce{static Get(e){return Ce.ValidStyleMap[e]}static IsUndefinedOrNumber(e,t){return!!Ce.IsUndefined(e,t)||(""===t||"number"==typeof t)}static IsUndefined(e,t){let s=void 0===t;return s&&console.error(e+" property is undefined!"),s}static KeyframesCheck(e,t){Ce.IsUndefined(e,t)||t.indexOf("transform")<0&&t.indexOf("opacity")<0&&console.error("keyframes property is only support transform and opacity, value:",t)}static ObjectFit(e,t){if(Ce.IsUndefined(e,t))return;const s="fill contain cover none scale-down";s.indexOf(t)<0&&console.error(" objectFit is only support one of string["+s+"]")}static TransitionOtherCheck(e,t){Ce.IsUndefined(e,t)||console.error(e+" property is not support, you can use transition property, e.g. transition='width 2s'")}static TransitionCheck(e,t){Ce.IsUndefined(e,t)||t.length>0&&(t.indexOf("left")<0&&t.indexOf("top")<0&&t.indexOf("width")<0&&t.indexOf("height")<0&&t.indexOf("transform")<0||t.indexOf("all")>=0)&&console.error("transition property's value only support [top, left, width, height, transform] value:",t)}static TransformCheck(e,t){Ce.IsUndefined(e,t)||t.length>0&&t.indexOf("translate3d")<0&&t.indexOf("scale3d")<0&&t.indexOf("rotate3d")<0&&t.indexOf("skew")<0&&console.error("transform property's value only support translate3d、scale3d、rotate3d、skew, value:",t)}static TransformOriginCheck(e,t){Ce.IsUndefined(e,t)||t.length>0&&t.indexOf("%")<0&&t.indexOf("left")<0&&t.indexOf("center")<0&&t.indexOf("top")<0&&t.indexOf("right")<0&&t.indexOf("bottom")<0&&console.error("transformOrigin property's value only support XX%、left、top、right, bottom:",t)}static TextOverflowCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"clip":case"ellipsis":break;default:console.error("textOverflow property's value is not support, value:",t)}}static WhiteSpaceCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"normal":case"nowrap":case"pre-wrap":break;default:console.error("whiteSpace property's value is not support, value:",t)}}static WordWrapCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"normal":case"word-break":break;default:console.error("WordWrap property's value is not support, value:",t)}}static TextAlignCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"left":case"right":case"center":case"start":case"end":break;default:console.error("textAlign property's value is not support, value:",t)}}static LineHeightCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"normal":case"inherit":console.error("lineHeight property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("lineHeight property's value is support number only, value:",t)}}static ColorCheck(e,t){Ce.IsUndefined(e,t)||Ce.CheckColorFormat("Color()",t)}static VisibilityCheck(e,t){Ce.IsUndefined(e,t)||"visible"!==t&&"hidden"!==t&&"inherit"!==t&&console.error("visibility property's value is not support, value:",t)}static DisplayCheck(e,t){Ce.IsUndefined(e,t)||"block"!==t&&"inline"!==t&&"none"!==t&&"inline-block"!==t&&"inherit"!==t&&""!==t&&console.error("display property's value is not support, value:",t)}static OverflowCheck(e,t){Ce.IsUndefined(e,t)||"visible"!==t&&"hidden"!==t&&console.error("overflow property's value is support visible or hidden only, value:",t)}static TopCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("top property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("top property's value is support number only, value:",t)}}static LeftCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("left property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("left property's value is support number only, value:",t)}}static HeightCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("height property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("height property's value is support number only, value:",t)}}static WidthCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("width property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("width property's value is support number only, value:",t)}}static MinWidthCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("minWidth property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("minWidth property's value is support number only, value:",t)}}static MaxWidthCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("maxWidth property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("maxWidth property's value is support number only, value:",t)}}static MinHeightCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("minHeight property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("minHeight property's value is support number only, value:",t)}}static MaxHeightCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"auto":case"inherit":console.error("maxHeight property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("maxHeight property's value is support number only, value:",t)}}static BackfaceVisibility(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"visible":case"hidden":break;default:console.error("backfaceVisibility property's value is support visible/hidden only, value: ",t)}}static PerspectiveCheck(e,t){Ce.IsUndefined(e,t)}static WebkitTextStroke(e,t){if(Ce.IsUndefined(e,t))return;t.split(" ").length<2&&console.error("Error: WebkitTextStroke should format of(width color) such as: '1px rgba(255,255,255,1.0)'")}static ZIndexCheck(e,t){Ce.IsUndefined(e,t)||isNaN(t)&&console.error("zIndex property's value is support number only, value: ",t)}static OpacityCheck(e,t){Ce.IsUndefined(e,t)||(isNaN(t)||t>1)&&console.error("opacity property's value is support number only(0.0 ~ 1.0), value: ",t)}static FontSizeCheck(e,t){if(!Ce.IsUndefinedOrNumber(e,t))switch(t){case"smaller":case"larger":case"inherit":case"x-small":case"xx-small":case"small":case"large":case"medium":case"x-large":case"xx-large":console.error("fontSize property's value is support number only, value:",t);break;default:t.indexOf("%")>=0&&console.error("fontSize property's value is support number only, value:",t)}}static FontWeightCheck(e,t){Ce.IsUndefined(e,t)||"bold"!==t&&console.error("fontWeight property's value is support bold only, value:",t)}static FontStyleCheck(e,t){Ce.IsUndefined(e,t)||"italic"!==t&&console.error("fontWeight property's value is support italic only, value:",t)}static BorderRadiusCheck(e,t){if(Ce.IsUndefined(e,t))return;let s=[t];"string"==typeof t&&(s=t.split(" ")),s.length>4&&console.error("borderRadius property's value is not support, value:",t)}static JsvImageBlendTypeCheck(e,t){if(!Ce.IsUndefined(e,t)&&t&&"string"==typeof t&&t.length>0){if("alphaOverride"==t)return;console.error("JsvImageBlendType property's value is not support, should be one of 'null | alphaOverride', value:",t)}}static BorderImageWidthCheck(e,t){Ce.IsUndefinedOrNumber(e,t)}static BorderImageOutsetCheck(e,t){if(Ce.IsUndefined(e,t))return;t.split(" ").length>4&&console.error("borderImageOutsetCheck property's value is not support, value:",t)}static BorderImageCheck(e,t){Ce.IsUndefined(e,t)||t.indexOf("fill")<0&&console.error("borderImage property's value is not contain fill, e.g. source slice, but value:",t)}static BackgroundOtherCheck(e,t){console.error(e+" property not support, you can use backgroundImage property, e.g. backgroundImage=`url(${iconImgPath})`")}static BackgroundImageCheck(e,t){Ce.IsUndefined(e,t)||"inherit"==t&&console.error("backgroundImage property's value is not support, value:",t)}static BackgroundColorCheck(e,t){if(!Ce.IsUndefined(e,t))return Ce.CheckColorFormat("backgroundColor",t)}static AnimationCheck(e,t){}static AnimationFillModeCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"none":case"forwards":break;case"backwards":console.error("animationFillMode 'backwards' is not supported yet.");break;case"both":console.error("animationFillMode 'both' is not supported yet.");break;default:console.error("animationFillMode property value is not valid",t)}}static AnimationOtherNotSupport(e,t){console.error(e+" property is not support, you can use animation property, e.g. animation='mymove 5s infinite'")}static TransformStyleCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"flat":case"preserve-3d":break;default:console.error("transformStyle property value is not valid",t)}}static PerspectiveOriginCheck(e,t){Ce.IsUndefined(e,t)||t.length>0&&t.indexOf("%")<0&&t.indexOf("left")<0&&t.indexOf("center")<0&&t.indexOf("top")<0&&t.indexOf("right")<0&&t.indexOf("bottom")<0&&console.error("perspectiveOrigin property's value only support XX%、left、top、right, bottom:",t)}static TextShadowCheck(e,t){if(!Ce.IsUndefined(e,t)&&t.length>0){if(t.replace(/\(.*\)/g,"").split(",").length>1)return void console.error("textShadow: NOT support more than one part settings");const e=t.split(" ");if(4!==e.length&&(5!==e.length||0!==e[4].length)||isNaN(parseInt(e[0]))||isNaN(parseInt(e[1])))console.error('textShadow: format should be "offsetX offsetY blurSize color"(0 0 1 rgba(100,100,100,1)), !NOT space in rgba()');else{if(!(parseFloat(e[2])>0))return void console.error(`textShadow: blur shadow above 0(now=${t})`);if(!Ce.CheckColorFormat("textShadow",e[3]))return}}}static CheckColorFormat(e,t){if(0===t.indexOf("rgba(")||0===t.indexOf("rgb("));else{if(0!==t.indexOf("#"))return console.error(`${e} color value is not valid, need startwith rgba or #, value:[${t}]`),!1;if(4!==t.length&&7!==t.length&&9!==t.length)return console.error(`${e} color value's length is not valid, value:${t}`),!1}return!0}static JsvTextLatexCheck(e,t){Ce.IsUndefined(e,t)||"number"!=typeof t&&console.error("JsvTextLatex property's value is support number only, value: ",t)}static JsvTextEmojiCheck(e,t){Ce.IsUndefined(e,t)||"number"!=typeof t&&console.error("JsvTextEmoji property's value is support number only, value: ",t)}static DirectionCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"ltr":case"rtl":break;default:console.error("direction property's value is not support, value:",t)}}static JsvTextAlignMinWidthCheck(e,t){Ce.IsUndefined(e,t)||"number"!=typeof t&&console.error("JsvTextAlignMinWidth property's value is support number only, value: ",t)}static JsvTextVerticalAlignCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"top":case"middle":case"bottom":break;default:console.error("JsvTextVerticalAlign property's value is not support, value: ",t)}}static JsvTextLineAlignCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"top":case"middle":case"bottom":break;default:console.error("JsvTextLineAlign property's value is not support, value: ",t)}}static JsvTextInnerDirectionCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"unset":case"ltr":case"rtl":break;default:console.error("JsvTextInnerDirection property's value is not support, value: ",t)}}static FlexDirectionCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"row":case"row-reverse":case"column":case"column-reverse":break;default:console.error("flexDirection out of range: row|row-reverse|column|column-reverse, value: ",t)}}static FlexWrapCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"nowrap":case"wrap":break;default:console.error("flexWrap out of range: nowrap|wrap, value: ",t)}}static JustifyContentCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"flex-start":case"flex-end":case"center":break;default:console.error("flexWrap out of range: flex-start|flex-end|center, value: ",t)}}static AlignItemsCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"flex-start":case"flex-end":case"center":case"stretch":break;default:console.error("alignItems out of range: flex-start|flex-end|center|stretch, value: ",t)}}static AlignContentCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"flex-start":case"flex-end":case"center":break;default:console.error("alignContent out of range: flex-start|flex-end|center, value: ",t)}}static AlignSelfCheck(e,t){if(!Ce.IsUndefined(e,t))switch(t){case"auto":case"flex-start":case"flex-end":case"center":case"stretch":break;default:console.error("alignSelf out of range: auto|flex-start|flex-end|center|stretch, value: ",t)}}static FlexGrowCheck(e,t){Ce.IsUndefined(e,t)||isNaN(t)&&console.error("flexGrow must be number, value: ",t)}}Ce.ValidStyleMap={animation:{check:Ce.AnimationCheck},animationName:{check:Ce.AnimationOtherNotSupport},animationDuration:{check:Ce.AnimationOtherNotSupport},animationTimingFunction:{check:Ce.AnimationOtherNotSupport},animationDelay:{check:Ce.AnimationOtherNotSupport},animationIterationCount:{check:Ce.AnimationOtherNotSupport},animationDirection:{check:Ce.AnimationOtherNotSupport},animationPlayState:{check:Ce.AnimationOtherNotSupport},animationFillMode:{check:Ce.AnimationFillModeCheck},background:{check:Ce.BackgroundOtherCheck},backgroundColor:{check:Ce.BackgroundColorCheck},backgroundImage:{check:Ce.BackgroundImageCheck},borderImage:{check:Ce.BorderImageCheck},borderImageOutset:{check:Ce.BorderImageOutsetCheck},borderImageWidth:{check:Ce.BorderImageWidthCheck},borderRadius:{check:Ce.BorderRadiusCheck},JsvImageBlendType:{check:Ce.JsvImageBlendTypeCheck},height:{check:Ce.HeightCheck},width:{check:Ce.WidthCheck},JsvMinWidth:{check:Ce.MinWidthCheck},JsvMaxWidth:{check:Ce.MaxWidthCheck},JsvMinHeight:{check:Ce.MinHeightCheck},JsvMaxHeight:{check:Ce.MaxHeightCheck},zIndex:{check:Ce.ZIndexCheck},opacity:{check:Ce.OpacityCheck},fontFamily:{check:null},fontSize:{check:Ce.FontSizeCheck},fontStyle:{check:Ce.FontStyleCheck},fontWeight:{check:Ce.FontWeightCheck},left:{check:Ce.LeftCheck},overflow:{check:Ce.OverflowCheck},top:{check:Ce.TopCheck},visibility:{check:Ce.VisibilityCheck},display:{check:Ce.DisplayCheck},color:{check:Ce.ColorCheck},lineHeight:{check:Ce.LineHeightCheck},textAlign:{check:Ce.TextAlignCheck},direction:{check:Ce.DirectionCheck},whiteSpace:{check:Ce.WhiteSpaceCheck},wordWrap:{check:Ce.WordWrapCheck},textOverflow:{check:Ce.TextOverflowCheck},transform:{check:Ce.TransformCheck},transformOrigin:{check:Ce.TransformOriginCheck},transition:{check:Ce.TransitionCheck},transitionProperty:{check:Ce.TransitionOtherCheck},transitionDuration:{check:Ce.TransitionOtherCheck},transitionTimingFunction:{check:Ce.TransitionOtherCheck},transitionDelay:{check:Ce.TransitionOtherCheck},keyframes:{check:Ce.KeyframesCheck},objectFit:{check:Ce.ObjectFit},perspective:{check:Ce.PerspectiveCheck},backfaceVisibility:{check:Ce.BackfaceVisibility},transformStyle:{check:Ce.TransformStyleCheck},perspectiveOrigin:{check:Ce.PerspectiveCheck},WebkitTextStroke:{check:Ce.WebkitTextStroke},textShadow:{check:Ce.TextShadowCheck},JsvTextLatex:{check:Ce.JsvTextLatexCheck},JsvTextEmoji:{check:Ce.JsvTextEmojiCheck},JsvTextAlignMinWidth:{check:Ce.JsvTextAlignMinWidthCheck},JsvTextVerticalAlign:{check:Ce.JsvTextVerticalAlignCheck},JsvTextLineAlign:{check:Ce.JsvTextLineAlignCheck},JsvTextInnerDirection:{check:Ce.JsvTextInnerDirectionCheck},flexDirection:{check:Ce.FlexDirectionCheck},flexWrap:{check:Ce.FlexWrapCheck},justifyContent:{check:Ce.JustifyContentCheck},alignItems:{check:Ce.AlignItemsCheck},alignContent:{check:Ce.AlignContentCheck},alignSelf:{check:Ce.AlignSelfCheck},flexGrow:{check:Ce.FlexGrowCheck}};class Te{static BackupBrowser(){return{createComment:window.document.createComment.bind(window.document),createElement:window.document.createElement.bind(window.document),createElementNS:window.document.createElementNS.bind(window.document),createTextNode:window.document.createTextNode.bind(window.document),dispatchEvent:window.document.dispatchEvent.bind(window.document),getElementById:window.document.getElementById.bind(window.document),getElementsByTagName:window.document.getElementsByTagName.bind(window.document),querySelector:window.document.querySelector.bind(window.document),head:{appendChild:window.document.head.appendChild.bind(window.document.head),removeChild:window.document.head.removeChild.bind(window.document.head)}}}static HookBrowser(e,t){Te.HookDocument(e,t),Te.HookOthers(),Te.DeclareAddition()}static HookDocument(e,t){window.JsvCode.Dom.BrowserDocument=e,window.JsvCode.Dom.RenderDocument=t;const s=new ke;window.document.createComment=s.createComment.bind(s),window.document.createElement=s.createElement.bind(s),window.document.createTextNode=s.createTextNode.bind(s),window.document.dispatchEvent=s.dispatchEvent.bind(s),window.document.getElementById=s.getElementById.bind(s),window.document.getElementsByTagName=s.getElementsByTagName.bind(s),window.document.querySelector=s.querySelector.bind(s),window.document.head.appendChild=s.head?.appendChild.bind(s.head),window.document.head.removeChild=s.head?.removeChild.bind(s.head),window.JsvCode.Dom.JsViewDocument=s}static HookOthers(){window.MutationObserver=me,window.Element=M,window.SVGElement=te,window.URL.jsvCreateObjectURL=async e=>{if(!(e instanceof Blob))return;console.log("found blob createObjectURL, start await task");let t=await e.arrayBuffer(),s=n.sRenderBridge.GenStoreBufferId();return n.sRenderBridge.GetBufferStoreApi().AddBuf(t,s,0,e.type),"blob:js-buff-"+s},window.URL.jsvRevokeObjectURL=e=>{if(!e.startsWith("blob:js-buff-"))return;let t=e.split("-")[2];n.sRenderBridge.GetBufferStoreApi().RemoveBuf(parseInt(t))},window.Blob.jsvCreateFromForge=async e=>{let t="image/bmp",s=n.sRenderBridge.GetBufferStoreApi().TakeBufStr(e,t);const i=new Uint8Array(s);return new Blob([i],{type:t})}}static DeclareAddition(){const e=window.JsvCode.Dom.JsViewDocument;window.document.jsvInitFDivRoot=e.jsvInitFDivRoot.bind(e),window.JsvCode.Dom.CheckStyleFormat=window.jsvInAndroidWebView?null:Te.CheckStyleFormat}static CheckStyleFormat(e,t){if(e.startsWith("--"))return;let s=Ce.Get(e);s?s.check&&t&&s.check(e,t):console.error(e+" property is not support.")}}window.jsvIsBrowserDebug=!0;const xe=window.JsvCode.BrowserPlatformDomBridge,be=window.JsvCode.BrowserPlatformMediaBridge,Ne=window.JsvCode.MessageDispatcher;function Ie(e){let t={keyCode:e.keyCode,key:e.key,code:e.code,repeat:e.repeat,timeStamp:e.timeStamp};return JSON.stringify(t)}function Se(){const e=Te.BackupBrowser();xe.RegisterOriginDocument(e);const t=function(e){let t=e.getElementById("app");var s=e.createElement("iframe");s.scrolling="no",s.style.border="none",s.style.width="5px",s.style.height="5px",s.width=1280,s.height=720,t?.appendChild(s);let i=s.contentDocument,n=e=>{var t=e?.target?.tagName;t&&"input"===t.toLowerCase()||(Ne.notify("onForgeKeyDown",Ie(e)),e.preventDefault&&e.preventDefault())},o=e=>{var t=e?.target?.tagName;t&&"input"===t.toLowerCase()||(Ne.notify("onForgeKeyUp",Ie(e)),e.preventDefault&&e.preventDefault())};return s.contentWindow.addEventListener("keydown",n),s.contentWindow.addEventListener("keyup",o),window.addEventListener("keydown",n),window.addEventListener("keyup",o),window.jsvRenderDocument=i,i}(e);pe.EnsureGlobalEnv(xe,be),Te.HookBrowser(e,t),ve.I("Using JsView HTML Environment.")}export{ge as ForgeAppClass,Se as InitEnv};
2
2