@lynx-js/web-core
Version:
This is an internal experimental package, do not use
309 lines (308 loc) • 88.7 kB
JavaScript
export const __rspack_esm_id="724";export const __rspack_esm_ids=["724"];export const __webpack_modules__={8453(e,t,s){let i,o,l,r,n,a,h,d,c,u,m,p,g,v,b,E,f,y,_,w,x,S,T,C,L,I,A,O,R,M,k,D;var H,F,N,$,P,V,z,U,W,B,X,Z,Y,q,j,K,G,J,Q,ee,et,es,ei,eo,el,er,en,ea,eh,ed,ec,eu,em,ep,eg,ev,eb,eE,ef,ey,e_,ew,ex,eS,eT,eC,eL,eI,eA,eO,eR,eM,ek,eD,eH,eF,eN,e$,eP,eV,ez,eU,eW,eB,eX,eZ,eY,eq,ej,eK,eG,eJ,eQ,e0,e1,e2,e8,e3,e4,e5,e9,e6,e7,te,tt,ts,ti,to,tl,tr,tn,ta,th,td,tc,tu,tm,tp,tg,tv,tb,tE,tf,ty,t_,tw,tx,tS,tT,tC,tL,tI,tA,tO,tR,tM,tk,tD,tH,tF,tN,t$,tP,tV,tz,tU,tW,tB,tX,tZ,tY,tq,tj,tK,tG,tJ,tQ,t0,t1,t2,t8,t3,t4,t5,t9,t6,t7,se,st,ss,si,so,sl,sr,sn,sa,sh,sd,sc,su,sm,sp,sg,sv,sb,sE,sf,sy,s_,sw,sx,sS,sT,sC,sL,sI,sA,sO,sR,sM,sk,sD,sH,sF,sN,s$,sP,sV,sz,sU,sW,sB,sX,sZ,sY,sq,sj,sK,sG,sJ,sQ,s0,s1,s2,s8,s3,s4,s5,s9,s6,s7,ie,it,is,ii,io,il,ir,ia,ih,id,ic,iu,im,ip,ig,iv,ib,iE,iy,i_,iw,ix,iS,iT,iC,iL,iI,iA,iO,iR,iM,ik,iD,iH,iF,iN,i$,iP,iV,iz,iU,iW,iB,iX,iZ,iY,iq,ij,iK,iG,iJ,iQ,i0,i1,i2,i8,i3,i4,i5,i9,i6,i7,oe,ot,os,oi,oo,ol,or,on,oa,oh,od,oc,ou,om,op,og,ov,ob,oE,of,oy,o_,ow,ox,oS,oT,oC,oL,oI,oA,oO,oR,oM,ok,oD=s(8594),oH=s(167);H=(0,oH.uA)("lynx-wrapper",[]);class oF extends(N=HTMLElement){static #e={c:[i,F]}=(0,oD._)(this,[],[H],N);static #t=F()}function oN(e){return e}var o$=s(1916);$=(0,oH._y)("fading-edge-length",!0),P=(0,oH.h3)("background"),V=(0,oH.h3)("background-color");class oP{static #e={e:[z,U]}=(0,oD._)(this,[[[P,V],2,"_backgroundColorToVariable"],[$,0,"_handleFadingEdgeLength"]],[]);#s;#i=(U(this),(0,oH.Ut)(()=>this.#s.shadowRoot,"#top-fade-mask"));#o=(0,oH.Ut)(()=>this.#s.shadowRoot,"#bot-fade-mask");static observedAttributes=["fading-edge-length"];static observedCSSProperties=["background","background-color"];constructor(e){this.#s=e}_handleFadingEdgeLength=z(this,(0,oH._8)(()=>this.#s,"--scroll-view-fading-edge-length",e=>`${parseFloat(e)}px`));_backgroundColorToVariable(e){this.#i().style.setProperty("--scroll-view-bg-color",e),this.#o().style.setProperty("--scroll-view-bg-color",e)}connectedCallback(){}dispose(){}}W=(0,oH._y)("scroll-top",!1),B=(0,oH._y)("scroll-left",!1),X=(0,oH._y)("initial-scroll-offset",!1),Z=(0,oH._y)("scroll-to-index",!1),Y=(0,oH._y)("initial-scroll-to-index",!1);class oV{static #e={e:[q]}=(0,oD._)(this,[[[W,B,X],2,"_handleInitialScrollOffset"],[[Z,Y],2,"_handleInitialScrollIndex"]],[]);#s;static observedAttributes=["scroll-top","scroll-left","initial-scroll-offset","scroll-to-index","initial-scroll-to-index"];constructor(e){q(this),this.#s=e}_handleInitialScrollOffset(e,t,s){if(e){let t=parseFloat(e),i=this.#s.getAttribute("scroll-orientation"),o=this.#s.getAttribute("scroll-y"),l=this.#s.getAttribute("scroll-x"),r=("scroll-top"===s||"initial-scroll-offset"===s)&&(""===o||"true"===o||"vertical"===i||"both"===i),n=("scroll-left"===s||"initial-scroll-offset"===s)&&(""===l||"true"===l||"vertical"===i||"both"===i);requestAnimationFrame(()=>{r&&this.#s.scrollTo(0,t),n&&(this.#s.scrollLeft=t)})}}_handleInitialScrollIndex(e){if(e){let t=parseFloat(e),s=this.#s.children.item(t);if(s&&s instanceof HTMLElement){let e=null!==this.#s.getAttribute("scroll-x");requestAnimationFrame(()=>{e?this.#s.scrollLeft=s.offsetLeft:this.#s.scrollTop=s.offsetTop})}}}dispose(){}}var oz=s(2032);function oU(e,t,s){let i;return o=>{null!==o?i||(i=new IntersectionObserver(s,{root:e()})).observe(t()):i&&(i.disconnect(),i=void 0)}}var oW=s(6372);j=(0,oH.ZR)("scrolltoupper"),K=(0,oH.ZR)("scrolltolower"),G=(0,oH._y)("upper-threshold",!0),J=(0,oH._y)("lower-threshold",!0),Q=(0,oH.ZR)("lynxscroll"),ee=(0,oH.ZR)("lynxscrollend");class oB{static #e={e:[et,es,ei,eo,el,er,en]}=(0,oD._)(this,[[j,0,"_handleScrollUpperThresholdEventEnabled"],[K,0,"_handleScrollLowerThresholdEventEnabled"],[G,0,"_updateUpperThreshold"],[J,0,"_updateLowerThreshold"],[Q,0,"_handleScrollEventEnabled"],[ee,0,"_handleScrollEndEventEnabled"]],[]);#s;#l;#r=(en(this),0);#n=0;constructor(e){this.#s=e}#a=()=>this.#s;#h=(0,oH.Ut)(()=>this.#s.shadowRoot,"#upper-threshold-observer");#d=(0,oH.Ut)(()=>this.#s.shadowRoot,"#lower-threshold-observer");#c=e=>{let{isIntersecting:t,target:s}=e[0],i=s.id;t&&("upper-threshold-observer"===i?this.#s.dispatchEvent(new CustomEvent("scrolltoupper",{...oz.$,detail:this.#u()})):"lower-threshold-observer"===i&&this.#s.dispatchEvent(new CustomEvent("scrolltolower",{...oz.$,detail:this.#u()})))};static observedAttributes=["upper-threshold","lower-threshold"];_handleScrollUpperThresholdEventEnabled=et(this,e=>{e?this.#s.setAttribute("x-enable-scrolltoupper-event",""):this.#s.removeAttribute("x-enable-scrolltoupper-event"),this.#m(e)});#m=oU(this.#a,this.#h,this.#c);_handleScrollLowerThresholdEventEnabled=es(this,e=>{e?this.#s.setAttribute("x-enable-scrolltolower-event",""):this.#s.removeAttribute("x-enable-scrolltolower-event"),this.#p(e)});#p=oU(this.#a,this.#d,this.#c);_updateUpperThreshold=ei(this,(0,oH._8)(this.#h,"flex-basis",e=>`${parseInt(e)}px`));_updateLowerThreshold=eo(this,(0,oH._8)(this.#d,"flex-basis",e=>`${parseInt(e)}px`));#u(){let{scrollTop:e,scrollLeft:t,scrollHeight:s,scrollWidth:i}=this.#a();0===e&&(e-=this.#s.scrollHeight/2-this.#s.scrollTop),0===t&&(t-=this.#s.scrollWidth/2-this.#s.scrollLeft);let o={scrollTop:e,scrollLeft:t,scrollHeight:s,scrollWidth:i,isDragging:!1,deltaX:t-this.#r,deltaY:e-this.#n};return this.#r=t,this.#n=e,o}#g=()=>{this.#v&&!oW.k&&(clearTimeout(this.#l),this.#l=setTimeout(()=>{this.#b()},100)),this.#s.dispatchEvent(new CustomEvent("lynxscroll",{...oz.$,detail:this.#u()}))};#b=()=>{this.#s.dispatchEvent(new CustomEvent("lynxscrollend",{...oz.$,detail:this.#u()}))};#E=!1;_handleScrollEventEnabled=el(this,e=>{this.#E=e,this.#f()});#v=!1;_handleScrollEndEventEnabled=er(this,e=>{this.#v=e,this.#f()});#f(){this.#E||this.#v?(this.#a().addEventListener("scroll",this.#g),this.#a().addEventListener("scrollend",this.#b),this.#s.addEventListener("scroll",this.#g),this.#s.addEventListener("scrollend",this.#b),this.#r=0,this.#n=0):(this.#s.removeEventListener("scroll",this.#g),this.#s.removeEventListener("scrollend",this.#b))}connectedCallback(){}dispose(){}}class oX{static eventName="__scrollIntoView";static observedAttributes=[];#s;#y=e=>{e.stopPropagation();let t=e.composedPath().filter(e=>e instanceof HTMLElement),s=[],i=this.#s;for(let e of t){if(e===i)break;s.push(e)}let o=this.#s.getAttribute("scroll-orientation"),l=null!==this.#s.getAttribute("scroll-x")||"both"===o||"horizontal"===o,r=null!==this.#s.getAttribute("scroll-y")||"both"===o||"vertical"===o,n=0,a=0;for(let{offsetTop:e,offsetLeft:t}of s)l&&(a+=t),r&&(n+=e);if(l)switch(e.detail.inline){case"center":a+=(e.target.clientWidth-this.#s.clientWidth)/2;break;case"end":a+=e.target.clientWidth-this.#s.clientWidth}if(r)switch(e.detail.block){case"center":n+=(e.target.clientHeight-this.#s.clientHeight)/2;break;case"end":n+=e.target.clientHeight-this.#s.clientHeight}i.scrollTo({behavior:"smooth"===e.detail.behavior?"smooth":"instant",left:a,top:n})};constructor(e){this.#s=e,this.#s.addEventListener(oX.eventName,this.#y,{passive:!1})}dispose(){this.#s.removeEventListener(oX.eventName,this.#y)}}let oZ=`<style>
.placeholder-dom {
display: none;
flex: 0 0 0;
align-self: stretch;
min-height: 0;
min-width: 0;
}
.mask {
z-index: 1;
position: sticky;
}
.observer-container {
flex-direction: inherit;
overflow: visible;
}
.observer {
display: flex;
}
::-webkit-scrollbar {
display: none;
}
@keyframes topFading {
0% {
box-shadow: transparent 0px 0px 0px 0px;
}
5% {
box-shadow: var(--scroll-view-bg-color) 0px 0px
var(--scroll-view-fading-edge-length)
var(--scroll-view-fading-edge-length);
}
100% {
box-shadow: var(--scroll-view-bg-color) 0px 0px
var(--scroll-view-fading-edge-length)
var(--scroll-view-fading-edge-length);
}
}
@keyframes botFading {
0% {
box-shadow: var(--scroll-view-bg-color) 0px 0px
var(--scroll-view-fading-edge-length)
var(--scroll-view-fading-edge-length);
}
95% {
box-shadow: var(--scroll-view-bg-color) 0px 0px
var(--scroll-view-fading-edge-length)
var(--scroll-view-fading-edge-length);
}
100% {
box-shadow: transparent 0px 0px 0px 0px;
}
}
</style>
<div
class="mask placeholder-dom"
id="top-fade-mask"
part="top-fade-mask"
></div>
<div
class="observer-container placeholder-dom"
part="upper-threshold-observer"
>
<div
class="observer placeholder-dom"
id="upper-threshold-observer"
></div>
</div>
<slot></slot>
<div
class="observer-container placeholder-dom"
part="lower-threshold-observer"
>
<div
class="observer placeholder-dom"
id="lower-threshold-observer"
></div>
</div>
<div
class="mask placeholder-dom"
id="bot-fade-mask"
part="bot-fade-mask"
></div>`,oY=/<\s*script/,oq=e=>{let{src:t}=e;if(t&&oY.test(t))throw Error("detected <script, this is a potential XSS attack, please check your src");return`<img part="img" alt="" id="img" ${t?`src="${t}"`:""}/> `},oj=`<style>
#input:focus {
outline: none;
}
#form {
display: none;
}
</style>
<form id="form" part="form" method="dialog">
<input
id="input"
part="input"
step="any"
type="text"
inputmode="text"
spell-check="true"
/>
</form>`,oK=`<style>
.placeholder-dom {
display: none;
flex: 0 0 0;
align-self: stretch;
min-height: 0;
min-width: 0;
}
.observer-container {
flex-direction: inherit;
overflow: visible;
}
.observer {
display: flex;
}
</style>
<div id="content" part="content">
<div
class="observer-container placeholder-dom"
part="upper-threshold-observer"
>
<div
class="observer placeholder-dom"
id="upper-threshold-observer"
></div>
</div>
<slot part="slot"></slot>
<div
class="observer-container placeholder-dom"
part="lower-threshold-observer"
>
<div
class="observer placeholder-dom"
id="lower-threshold-observer"
></div>
</div>
</div>`,oG=`<style>
#dialog[open] {
top: 0;
left: 0;
right: 0;
bottom: 0;
position: fixed;
overscroll-behavior: contain;
scrollbar-width: none;
}
#dialog[open]::-webkit-scrollbar {
display: none;
}
#dialog::backdrop {
background-color: transparent;
}
.overlay-inner {
position: sticky;
top: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.overlay-inner > * {
pointer-events: auto;
}
.overlay-placeholder {
width: 100%;
height: 1px;
}
</style>
<dialog id="dialog" part="dialog">
<div class="overlay-inner">
<slot></slot>
</div>
<div class="overlay-placeholder"></div>
</dialog>`,oJ=`<style>
.bounce-container {
overflow: scroll;
overscroll-behavior: contain;
scroll-snap-type: y mandatory;
scroll-behavior: smooth;
scrollbar-width: none;
}
.overflow-placeholder {
min-height: 30%;
min-width: 100%;
flex-shrink: 0;
scroll-snap-align: none;
}
.not-shrink {
height: 100%;
width: 100%;
min-height: 100%;
min-width: 100%;
flex-shrink: 0;
}
.vertical {
display: flex;
flex-direction: column;
}
#content {
scroll-snap-align: center;
}
</style>
<div id="container" part="container" class="bounce-container not-shrink vertical">
<div
id="placeholder-top"
class="overflow-placeholder bounce-item"
part="placeholder-top"
></div>
<slot name="header"></slot>
<div id="content" part="content" class="not-shrink vertical">
<slot part="slot"></slot>
</div>
<slot name="footer"></slot>
<div
id="placeholder-bot"
class="overflow-placeholder bounce-item"
part="placeholder-bot"
></div>
</div>`,oQ=`<style>
#bounce-padding {
display: none;
flex: 0 0 0;
align-self: stretch;
scroll-snap-align: none;
flex-basis: 100%;
}
#content {
position: relative;
display: flex;
flex: 0 0 100%;
flex-direction: inherit;
flex-wrap: inherit;
align-self: stretch;
justify-content: inherit;
align-items: inherit;
overflow: inherit;
scrollbar-width: none;
scroll-snap-align: start;
scroll-snap-type: inherit;
}
div::-webkit-scrollbar {
display: none;
}
#indicator-container {
display: none;
}
#indicator-container > div {
animation-name: indicator-dot;
animation-duration: 100ms;
}
@keyframes indicator-dot {
30%,
70% {
background-color: var(--indicator-color);
}
31%,
69% {
background-color: var(--indicator-active-color);
}
}
</style>
<style id="indicator-style"></style>
<div id="bounce-padding" part="bounce-padding"></div>
<div id="indicator-container" part="indicator-container"></div>
<div id="content" part="content">
<slot part="slot-start" name="circular-start" id="circular-start"></slot>
<slot part="slot"></slot>
<slot part="slot-end" name="circular-end" id="circular-end"></slot>
</div>`,o0=`<style>
#textarea:focus,
#textarea:focus-visible {
border: inherit;
outline: inherit;
}
</style>
<form id="form" part="form" method="dialog">
<textarea id="textarea" part="textarea"></textarea>
</form>`,o1=`<style>
#bounce-padding {
display: none;
flex: 0 0 0;
align-self: stretch;
scroll-snap-align: none;
flex-basis: 100%;
}
#content {
flex: 0 0 100%;
flex-direction: row;
align-self: stretch;
display: inherit;
justify-content: inherit;
align-items: inherit;
overflow: inherit;
scrollbar-width: none;
scroll-snap-type: inherit;
}
#content::-webkit-scrollbar {
display: none;
}
</style>
<div id="bounce-padding" part="bounce-padding"></div>
<div id="content" part="content">
<slot></slot>
</div>`,o2=`<style>
iframe {
width: 100%;
height: 100%;
border: none;
}
</style>
<iframe id="webview" part="webview"></iframe>`,o8=CSS.supports("-webkit-box-reflect: above")&&CSS.supports("transition-behavior:allow-discrete")&&CSS.supports("content-visibility: auto");class o3{static observedAttributes=[];static observedCSSProperties=["--lynx-display","--lynx-linear-orientation"];#s;constructor(e){this.#s=e,this.cssPropertyChangedHandler={"--lynx-display":this.#_,"--lynx-linear-orientation":this.#w}}#_=(0,oH.H$)(()=>this.#s,"lynx-computed-display");#w=(0,oH.H$)(()=>this.#s,"lynx-linear-orientation")}let o4=o8?void 0:o3;ea=(0,oH.uA)("scroll-view",[o4,o$.O,oV,oP,oB,oX],oZ),new class extends oN{constructor(){super(o),eh()}static #e=(()=>{class e extends(ed=HTMLElement){static #e={c:[o,eh]}=(0,oD._)(this,[],[ea],ed);static notToFilterFalseAttributes=new Set(["enable-scroll"]);static scrollInterval=100;#x;scrollTo(...e){let t;if("string"==typeof e[0].offset){let s=parseFloat(e[0].offset);t={left:s,top:s}}else"number"==typeof e[0].offset&&(t={left:e[0].offset,top:e[0].offset});if("number"==typeof e[0].index){let s=e[0].index;if(0===s)this.scrollTop=0,this.scrollLeft=0;else if(s>0&&s<this.childElementCount){let e=this.children.item(s);e instanceof HTMLElement&&(t=t?{left:e.offsetLeft+t.left,top:e.offsetTop+t.top}:{left:e.offsetLeft,top:e.offsetTop})}}t?this.scrollTo({...t,behavior:e[0].smooth?"smooth":"auto"}):super.scrollTo(...e)}autoScroll(t){if(clearInterval(this.#x),t.start){let s=("number"==typeof t.rate?t.rate:parseFloat(t.rate))*e.scrollInterval/1e3;this.#x=setInterval(e=>{e.scrollBy({left:s,top:s,behavior:"smooth"})},e.scrollInterval,this)}}get[oW.l](){return this}}})()};let o5=Symbol("__src"),o9=Symbol("__src"),o6={loadstart:{code:0,type:"init"},canplay:{code:1,type:"playable"},stalled:{code:2,type:"stalled"},error:{code:3,type:"error"}},o7={stop:{code:0,type:"stopped"},play:{code:1,type:"playing"},pause:{code:2,type:"paused"}};ec=(0,oH._y)("src",!0),eu=(0,oH._y)("loop",!0),em=(0,oH._y)("pause-on-hide",!0);class le{static #e={e:[ep,eg]}=(0,oD._)(this,[[ec,2,"_handleSrc"],[em,2,"_handlePauseOnHide"],[eu,0,"_handleLoop"]],[]);static observedAttributes=["src","loop","pause-on-hide"];#s;#S=(eg(this),(0,oH.Ut)(()=>this.#s.shadowRoot,"#audio"));_handleSrc(e){let t;try{t=JSON.parse(e||"")||{}}catch(e){console.error(`JSON.parse src error: ${e}`),t={}}null===e?this.#s.dispatchEvent(new CustomEvent("error",{...oz.$,detail:{code:-1,msg:"",from:"res loader",currentSrcID:this.#s[o5]?.id}})):(t?.id===void 0||t?.play_url===void 0)&&this.#s.dispatchEvent(new CustomEvent("error",{...oz.$,detail:{code:-2,msg:"",from:"res loader",currentSrcID:this.#s[o5]?.id}})),this.#s[o5]=t,this.#s[o9]=void 0,this.#s.stop()}_handleLoop=ep(this,(0,oH.H$)(this.#S,"loop"));#T=()=>{"hidden"===document.visibilityState&&this.#s.pause()};_handlePauseOnHide(e){null!==e?document.addEventListener("visibilitychange",this.#T,{passive:!0}):document.removeEventListener("visibilitychange",this.#T)}constructor(e){this.#s=e}}class lt{static observedAttributes=[];#s;#C;#S=(0,oH.Ut)(()=>this.#s.shadowRoot,"#audio");#L=e=>{let t=Number(this.#s.getAttribute("interval")),s=Number.isNaN(t)?0:t;this.#C=setInterval(()=>{this.#s.dispatchEvent(new CustomEvent("timeupdate",{...oz.$,detail:{currentTime:this.#S().currentTime,currentSrcID:this.#s[o5]?.id}}))},s);let i=o7[e.type];this.#s.dispatchEvent(new CustomEvent("playbackstatechanged",{...oz.$,detail:{code:i?.code,type:i?.type,currentSrcID:this.#s[o5]?.id}}))};#I=e=>{clearInterval(this.#C);let t=o7[e.type];this.#s.dispatchEvent(new CustomEvent("playbackstatechanged",{...oz.$,detail:{code:t?.code,type:t?.type,currentSrcID:this.#s[o5]?.id}}))};#A=e=>{let t=o6[e.type];this.#s.dispatchEvent(new CustomEvent("loadingstatechanged",{...oz.$,detail:{code:t?.code,type:t?.type,currentSrcID:this.#s[o5]?.id}}))};#O=e=>{this.#A(e);let t=e.target?.error?.code,s=t===MediaError.MEDIA_ERR_DECODE?-5:-6;t===MediaError.MEDIA_ERR_DECODE&&(s=-5),this.#s.dispatchEvent(new CustomEvent("error",{...oz.$,detail:{code:s,msg:"",from:"player",currentSrcID:this.#s[o5]?.id}}))};#R=()=>{let e=null!==this.#s.getAttribute("loop");this.#s.dispatchEvent(new CustomEvent("finished",{...oz.$,detail:{loop:e,currentSrcID:this.#s[o5]?.id}}))};constructor(e){this.#s=e}connectedCallback(){let e=this.#S();e.addEventListener("play",this.#L,{passive:!0}),e.addEventListener("pause",this.#I,{passive:!0}),e.addEventListener("ended",this.#R,{passive:!0}),e.addEventListener("loadstart",this.#A,{passive:!0}),e.addEventListener("canplay",this.#A,{passive:!0}),e.addEventListener("stalled",this.#A,{passive:!0}),e.addEventListener("error",this.#O,{passive:!0})}}ev=(0,oH.uA)("x-audio-tt",[o$.O,le,lt],'<audio id="audio"></audio>');class ls extends(eE=HTMLElement){static #e={c:[l,eb]}=(0,oD._)(this,[],[ev],eE);#M=(0,oH.Ut)(()=>this.shadowRoot,"#audio");#S=(0,oH.Ut)(()=>this.shadowRoot,"#audio");#k=(0,oH.H$)(this.#S,"src");[o5];[o9];#D=()=>{let e,t=this[o5];if(t&&t.id&&t.play_url){try{e=JSON.parse(this.getAttribute("headers")||"{}")||{}}catch(t){console.error(`JSON.parse headers error: ${t}`),e={}}this[o9]=new Promise(async(s,i)=>{this.dispatchEvent(new CustomEvent("srcloadingstatechanged",{...oz.$,detail:{code:0,type:"loading",currentSrcID:t.id}}));let o=await fetch(t.play_url,{headers:e});o.ok||(this.dispatchEvent(new CustomEvent("error",{...oz.$,detail:{code:-3,msg:"",from:"res loader",currentSrcID:t.id}})),i()),this.dispatchEvent(new CustomEvent("srcloadingstatechanged",{...oz.$,detail:{code:1,type:"success",currentSrcID:t.id}}));let l=await o.blob(),r=URL.createObjectURL(l);this.#k(r),s()})}};play(){return this[o9]||this.#D(),this[o9]?.then(()=>{let e=this.#M();e.currentTime=0,e.play()}),{currentSrcID:this[o5]?.id,loadingSrcID:""}}stop(){let e=this.#M(),t=o7.stop;return this.dispatchEvent(new CustomEvent("playbackstatechanged",{...oz.$,detail:{code:t?.code,type:t?.type,currentSrcID:this[o5]?.id}})),e.currentTime=0,e.pause(),{currentSrcID:this[o5]?.id}}pause(){return this.#M().pause(),{currentSrcID:this[o5]?.id}}resume(){return this.#M().play(),{currentSrcID:this[o5]?.id,loadingSrcID:""}}seek(e){return this.#M().currentTime=(e.currentTime||0)/1e3,this.dispatchEvent(new CustomEvent("seek",{...oz.$,detail:{seekresult:1,currentSrcID:this[o5]?.id}})),{currentSrcID:this[o5]?.id}}mute(e){return this.#M().muted=e.mute,{currentSrcID:this[o5]?.id}}playerInfo(){var e;let t=this.#M(),s=t.buffered,i=s.end(s.length-1);return{currentSrcID:this[o5]?.id,duration:1e3*t.duration,playbackState:(e=t)?e.paused?2*!e.ended:e.currentTime>0?1:3:-1,currentTime:t.currentTime,cacheTime:i}}prepare(){this[o9]||this.#D()}setVolume(e){return this.#M().volume=e.volume,{code:1}}static #t=eb()}ef=(0,oH._y)("name",!0),ey=(0,oH._y)("height",!0),e_=(0,oH._y)("width",!0);class li{static #e={e:[ew,ex,eS,eT]}=(0,oD._)(this,[[ef,0,"handleName"],[ey,0,"handleHeight"],[e_,0,"handleWidth"]],[]);static observedAttributes=["name","height","width"];#s;#H;#F=(eT(this),(0,oH.Ut)(()=>this.#s.shadowRoot,"#canvas"));constructor(e){this.#s=e}handleName=ew(this,(0,oH.H$)(this.#F,"name"));handleHeight=ex(this,(0,oH.H$)(this.#F,"height"));handleWidth=eS(this,(0,oH.H$)(this.#F,"width"));#N=e=>{let{contentRect:t}=e[0],s=this.#s.shadowRoot.firstElementChild;if(s){let{height:e,width:i}=t;e*=window.devicePixelRatio,i*=window.devicePixelRatio;let o=new CustomEvent("resize",{...oz.$,detail:{height:e,width:i}});o.height=e,o.width=i,s.dispatchEvent(o)}};#$(){this.#H||(this.#H=new ResizeObserver(this.#N),this.#H.observe(this.#s))}#P(){this.#H?.disconnect(),this.#H=void 0}connectedCallback(){this.#$()}dispose(){this.#P()}}eC=(0,oH.uA)("x-canvas",[o$.O,li],(0,oH.qy)`<canvas id="canvas" part="canvas"></canvas>`);class lo extends(eI=HTMLElement){static #e={c:[r,eL]}=(0,oD._)(this,[],[eC],eI);static #t=eL()}eA=(0,oH._y)("granularity",!0),eO=(0,oH.ZR)("offset");class ll{static #e={e:[eR]}=(0,oD._)(this,[[eA,2,"_handleGranularity"],[eO,2,"_enableOffsetEvent"]],[]);#s;#V=(eR(this),.01);#z=0;constructor(e){this.#s=e}static observedAttributes=["granularity"];_handleGranularity(e){e&&""!==e?this.#V=parseFloat(e):this.#V=.01}_enableOffsetEvent(e){e?this.#s.addEventListener("scroll",this.#g,{passive:!0}):this.#s.removeEventListener("scroll",this.#g)}#g=()=>{let e=this.#s.scrollTop;(Math.abs(this.#z-e)>this.#V||0===this.#s.scrollTop||1>=Math.abs(this.#s.scrollHeight-this.#s.clientHeight-this.#s.scrollTop))&&(this.#z=e,this.#s.dispatchEvent(new CustomEvent("offset",{...oz.$,detail:{offset:e,height:this.#s[lr]}})))}}let lr=Symbol("scrollableLength"),ln=Symbol("isHeaderShowing"),la=Symbol("resizeObserver"),lh=Symbol("slotKid");eM=(0,oH.uA)("x-foldview-ng",[o4,o$.O,ll]),new class extends oN{constructor(){super(n),ek()}static #e=(()=>{class e extends(eD=HTMLElement){static #e={c:[n,ek]}=(0,oD._)(this,[],[eM],eD);static notToFilterFalseAttributes=new Set(["scroll-enable"]);[lh];[la]=new ResizeObserver(e=>{for(let t of e)"X-FOLDVIEW-HEADER-NG"===t.target.tagName?this.#U=t.contentRect.height:"X-FOLDVIEW-TOOLBAR-NG"===t.target.tagName&&(this.#W=t.contentRect.height);this[lh]&&(this[lh].style.top=`${this.#U-this.#W}px`)});#U=0;#W=0;get[lr](){return this.#U-this.#W}get[ln](){return this[lr]-this.scrollTop>=1}get scrollTop(){return super.scrollTop}set scrollTop(e){e>this[lr]?e=this[lr]:e<0&&(e=0),super.scrollTop=e}setFoldExpanded(e){let{offset:t,smooth:s=!0}=e,i=parseFloat(t);this.scrollTo({top:i,behavior:s?"smooth":"instant"})}get[oW.l](){return this}disconnectedCallback(){this[la]?.disconnect(),this[la]=void 0}}})()};let ld=(e,t)=>{let s=e.parentElement;if(s?.tagName==="LYNX-WRAPPER"&&(s=s.parentElement),s?.tagName===t)return s};eH=(0,oH.uA)("x-foldview-header-ng",[o4,o$.O]);class lc extends(eN=HTMLElement){static #e={c:[a,eF]}=(0,oD._)(this,[],[eH],eN);#B=void 0;connectedCallback(){let e=ld(this,"X-FOLDVIEW-NG");this.#B=e?.[la],this.#B?.observe(this)}dispose(){this.#B?.unobserve(this)}static #t=eF()}e$=(0,oH.uA)("x-foldview-slot-drag-ng",[o4,o$.O]);class lu extends(eV=HTMLElement){static #e={c:[h,eP]}=(0,oD._)(this,[],[e$],eV);static #t=eP()}class lm{#X=0;#Z=new WeakMap;#Y;#q=0;#j=0;#K=null;#G;#J=0;#s;static observedAttributes=[];constructor(e){this.#s=e,this.#s.addEventListener("touchmove",this.#Q,{passive:!1}),this.#s.addEventListener("touchstart",this.#ee,{passive:!0}),this.#s.addEventListener("touchend",this.#et,{passive:!0}),this.#s.addEventListener("wheel",this.#es,{passive:!1})}#ei(e){let t;if("function"==typeof e.computedStyleMap)try{t=e.computedStyleMap().get("overflow-y")?.toString()??"visible"}catch{t=getComputedStyle(e).overflowY||"visible"}else t=getComputedStyle(e).overflowY||"visible";return"auto"===t||"scroll"===t||"hidden"===t||"overlay"===t}#eo(e){return this.#Y?.find(t=>{if(this.#ei(t)&&t.scrollHeight>t.clientHeight){let s=e<0&&0!==t.scrollTop,i=e>0&&Math.abs(t.scrollHeight-t.clientHeight-t.scrollTop)>1;return s||i}return!1})}#el(e,t){let s=this.#Z.get(e)??0;s+=t,this.#Z.set(e,s),e.scrollTop=s}#Q=e=>{let t=this.#er();if(!t)return;let{pageY:s,pageX:i}=e.touches.item(0),o=this.#q-s;if(null===this.#K){let e=this.#j-i;this.#K=Math.abs(o)>Math.abs(e)}!1!==this.#K&&(e.cancelable&&e.preventDefault(),this.#en(o,t),this.#q=s)};#es=e=>{let t=this.#er();if(!t||Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;let s=e.composedPath().filter(e=>e instanceof Element&&this.#s.contains(e)&&e!==this.#s),{clientX:i,clientY:o}=e,l=document.elementsFromPoint(i,o).filter(e=>this.#s.contains(e));if(this.#Y=[...new Set([...s,...l])],this.#X=t.scrollTop,this.#Y)for(let e of this.#Y)this.#Z.set(e,e.scrollTop);e.cancelable&&e.preventDefault(),this.#en(e.deltaY,t)};#er(){let e=this.#s.parentElement;if(e&&"X-FOLDVIEW-NG"===e.tagName)return e}#ee=e=>{let{pageX:t,pageY:s}=e.touches.item(0);for(let e of(this.#Y=document.elementsFromPoint(t,s).filter(e=>this.#s.contains(e)&&e!==this.#s),this.#q=s,this.#j=t,this.#X=this.#er()?.scrollTop??0,this.#Y))this.#Z.set(e,e.scrollTop);this.#K=null,this.#G=void 0};#et=()=>{if(this.#K=null,this.#G){let e=this.#er();(this.#G!==e||e[ln])&&this.#G.scrollBy({top:4*this.#J,behavior:"smooth"})}};#en(e,t){let s=this.#eo(e);t[ln]&&e>0||e<0&&!s||!t[ln]&&!s?(t.scrollBy({top:e,behavior:"smooth"}),this.#X+=e,t.scrollTop=this.#X,this.#G=t):s&&(this.#G=s,this.#el(s,e)),this.#J=e}}ez=(0,oH.uA)("x-foldview-slot-ng",[o4,o$.O,lm]);class lp extends(eW=HTMLElement){static #e={c:[d,eU]}=(0,oD._)(this,[],[ez],eW);connectedCallback(){this.matches("x-foldview-ng>x-foldview-slot-ng:first-of-type")&&(this.parentElement[lh]=this)}static #t=eU()}eB=(0,oH.uA)("x-foldview-toolbar-ng",[o4,o$.O]);class lg extends(eZ=HTMLElement){static #e={c:[c,eX]}=(0,oD._)(this,[],[eB],eZ);#B=void 0;connectedCallback(){let e=ld(this,"X-FOLDVIEW-NG");this.#B=e?.[la],this.#B?.observe(this)}dispose(){this.#B?.unobserve(this)}static #t=eX()}eY=(0,oH._y)("drop-shadow",!0);class lv{static #e={e:[eq,ej]}=(0,oD._)(this,[[eY,0,"_handleBlurRadius"]],[]);static observedAttributes=["drop-shadow"];#s;#ea=(ej(this),(0,oH.Ut)(()=>this.#s.shadowRoot,"#img"));_handleBlurRadius=eq(this,(0,oH._8)(this.#ea,"--drop-shadow",void 0,!0));constructor(e){this.#s=e}}eK=(0,oH._y)("src",!0),eG=(0,oH._y)("placeholder",!0),eJ=(0,oH._y)("blur-radius",!0),eQ=(0,oH._y)("crossorigin",!0),e0=(0,oH._y)("referrerpolicy",!0);class lb{static #e={e:[e1,e2,e8,e3,e4]}=(0,oD._)(this,[[eG,2,"_preloadPlaceholder"],[eK,0,"_handleSrc"],[eJ,0,"_handleBlurRadius"],[eQ,0,"_handleCrossorigin"],[e0,0,"_handleReferrerpolicy"]],[]);static observedAttributes=["src","placeholder","blur-radius","crossorigin","referrerpolicy"];#s;#ea=(e4(this),(0,oH.Ut)(()=>this.#s.shadowRoot,"#img"));_handleSrc=e1(this,(0,oH.H$)(this.#ea,"src",e=>e||this.#s.getAttribute("placeholder")));_preloadPlaceholder(e){e&&(new Image().src=e)}_handleBlurRadius=e2(this,(0,oH._8)(this.#ea,"--blur-radius",void 0,!0));_handleCrossorigin=e8(this,(0,oH.H$)(this.#ea,"crossorigin"));_handleReferrerpolicy=e3(this,(0,oH.H$)(this.#ea,"referrerpolicy"));#eh=()=>{let e=this.#ea().src,t=this.#s.getAttribute("placeholder");t&&e!==t&&(this.#ea().src=t)};constructor(e){this.#s=e,this.#ea().addEventListener("error",this.#eh)}connectedCallback(){(null===this.#s.getAttribute("src")||""===this.#s.getAttribute("src"))&&this._handleSrc(null)}}e5=(0,oH.ZR)("load"),e9=(0,oH.ZR)("error");class lE{static #e={e:[e6]}=(0,oD._)(this,[[e5,2,"_enableLoadEvent"],[e9,2,"_enableErrorEvent"]],[]);static observedAttributes=[];#s;#ea=(e6(this),(0,oH.Ut)(()=>this.#s.shadowRoot,"#img"));_enableLoadEvent(e){e?this.#ea().addEventListener("load",this.#ed,{passive:!0}):this.#ea().removeEventListener("load",this.#ed)}_enableErrorEvent(e){e?this.#ea().addEventListener("error",this.#ec,{passive:!0}):this.#ea().removeEventListener("error",this.#ec)}#ed=()=>{this.#s.dispatchEvent(new CustomEvent("load",{...oz.$,detail:{width:this.#ea().naturalWidth,height:this.#ea().naturalHeight}}))};#ec=()=>{this.#s.dispatchEvent(new CustomEvent("error",{...oz.$,detail:{}}))};constructor(e){this.#s=e}}e7=(0,oH.uA)("filter-image",[o$.O,lb,lv,lE],oq({}));class lf extends(tt=HTMLElement){static #e={c:[u,te]}=(0,oD._)(this,[],[e7],tt);static #t=te()}ts=(0,oH.uA)("x-image",[o$.O,lb,lE],oq({}));class ly extends(to=HTMLElement){static #e={c:[m,ti]}=(0,oD._)(this,[],[ts],to);static #t=ti()}tl=(0,oH._y)("confirm-type",!0),tr=(0,oH._y)("maxlength",!0),tn=(0,oH._y)("readonly",!0),ta=(0,oH._y)("type",!0),th=(0,oH._y)("ios-spell-check",!0),td=(0,oH._y)("spell-check",!0);class l_{static #e={e:[tc,tu,tm,tp,tg]}=(0,oD._)(this,[[ta,2,"_handleType"],[tl,0,"_handlerConfirmType"],[tr,0,"_handlerMaxlength"],[tn,0,"_handleReadonly"],[[th,td],0,"_handleSpellCheck"]],[]);static observedAttributes=["confirm-type","maxlength","readonly","type","ios-spell-check","spell-check"];#s;#eu=(tg(this),(0,oH.Ut)(()=>this.#s.shadowRoot,"#input"));_handlerConfirmType=tc(this,(0,oH.H$)(this.#eu,"enterkeyhint",e=>null===e?"send":e));_handlerMaxlength=tu(this,(0,oH.H$)(this.#eu,"maxlength",e=>null===e?"140":e));_handleReadonly=tm(this,(0,oH.H$)(this.#eu,"readonly",e=>null!==e?"":null));#em=(0,oH.H$)(this.#eu,"type");#ep=(0,oH.H$)(this.#eu,"inputmode");_handleType(e){let t="text",s="text";"digit"===e?t="numeric":"number"===e?t="decimal":"email"===e?t="email":"tel"===e?t="tel":s=e,this.#ep(t),this.#em(s)}_handleSpellCheck=tp(this,(0,oH.H$)(this.#eu,"spellcheck",e=>null===e?"false":"true"));constructor(e){this.#s=e}}tv=(0,oH._y)("placeholder",!0),tb=(0,oH._y)("placeholder-color",!0),tE=(0,oH._y)("placeholder-font-family",!0),tf=(0,oH._y)("placeholder-font-size",!0),ty=(0,oH._y)("placeholder-font-weight",!0);class lw{static #e={e:[t_,tw,tx,tS,tT,tC]}=(0,oD._)(this,[[tv,0,"_handlerPlaceholder"],[tb,0,"_handlerPlaceholderColor"],[tE,0,"_handlerPlaceholderFontFamily"],[tf,0,"_handlerPlaceholderFontSize"],[ty,0,"_handlerPlaceholderFontWeight"]],[]);static observedAttributes=["placeholder","placeholder-color","placeholder-font-family","placeholder-font-size","placeholder-font-weight"];#s;#eu=(tC(this),(0,oH.Ut)(()=>this.#s.shadowRoot,"#input"));_handlerPlaceholder=t_(this,(0,oH.H$)(this.#eu,"placeholder"));_handlerPlaceholderColor=tw(this,(0,oH._8)(this.#eu,"--placeholder-color",void 0,!0));_handlerPlaceholderFontFamily=tx(this,(0,oH._8)(this.#eu,"--placeholder-font-family",void 0,!0));_handlerPlaceholderFontSize=tS(this,(0,oH._8)(this.#eu,"--placeholder-font-size",void 0,!0));_handlerPlaceholderFontWeight=tT(this,(0,oH._8)(this.#eu,"--placeholder-font-weight",void 0,!0));constructor(e){this.#s=e}}tL=(0,oH._y)("value",!1),tI=(0,oH._y)("disabled",!0),tA=(0,oH._y)("autocomplete",!0);class lx{static #e={e:[tO,tR,tM]}=(0,oD._)(this,[[tL,2,"_handleValue"],[tI,0,"_handleDisabled"],[tA,0,"_handleAutocomplete"]],[]);static observedAttributes=["value","disabled","autocomplete"];#s;#eu=(tM(this),(0,oH.Ut)(()=>this.#s.shadowRoot,"#input"));_handleValue(e){if(e){let t=parseFloat(this.#s.getAttribute("maxlength")??"");isNaN(t)||(e=e.substring(0,t))}else e="";let t=this.#eu();t.value!==e&&(t.value=e)}_handleDisabled=tO(this,(0,oH.H$)(this.#eu,"disabled",e=>null!==e?"":null));_handleAutocomplete=tR(this,(0,oH.H$)(this.#eu,"autocomplete"));constructor(e){this.#s=e}}let lS={submit:"confirm",blur:"lynxblur",focus:"lynxfocus"};tk=(0,oH._y)("input-filter",!0),tD=(0,oH.ZR)("lynxinput"),tH=(0,oH._y)("send-composing-input",!0),tF=(0,oH.ZR)("selection");class lT{static #e={e:[tN]}=(0,oD._)(this,[[[tk,tD],2,"_handleEnableInputEvent"],[tH,2,"_handleSendComposingInput"],[tF,2,"_handleEnableSelectionEvent"]],[]);static observedAttributes=["send-composing-input","input-filter"];#s;#eg=(tN(this),!1);#ev=/[^0-9.]|\.(?=.*\.)/g;#eu=(0,oH.Ut)(()=>this.#s.shadowRoot,"#input");#eb=(0,oH.Ut)(()=>this.#s.shadowRoot,"#form");_handleEnableInputEvent(e){let t=this.#eu();e?(t.addEventListener("input",this.#eE,{passive:!0}),t.addEventListener("compositionend",this.#ef,{passive:!0})):(t.removeEventListener("input",this.#eE),t.removeEventListener("compositionend",this.#ef))}_handleSendComposingInput(e){this.#eg=null!==e}#ey=e=>{let t=lS[e.type]??e.type;this.#s.dispatchEvent(new CustomEvent(t,{...oz.$,detail:{value:this.#eu().value}}))};#eE=e=>{let t=this.#eu(),s=this.#e_(t.value),i=e.isComposing;t.value=s,(!i||this.#eg)&&this.#s.dispatchEvent(new CustomEvent("lynxinput",{...oz.$,detail:{value:s,textLength:s.length,cursor:t.selectionStart,isComposing:i,selectionStart:t.selectionStart,selectionEnd:t.selectionEnd}}))};#ef=()=>{let e=this.#eu(),t=this.#e_(e.value);e.value=t,this.#eg||this.#s.dispatchEvent(new CustomEvent("lynxinput",{...oz.$,detail:{value:t,textLength:t.length,cursor:e.selectionStart,isComposing:!1,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}}))};#e_(e){let t=e;"number"===this.#s.getAttribute("type")&&(t=t.replace(this.#ev,""));let s=this.#s.getAttribute("input-filter");return s&&(t=t.replace(RegExp(s,"g"),"")),t}_handleEnableSelectionEvent(e){e?this.#eu().addEventListener("select",this.#ew,{passive:!0}):this.#eu().removeEventListener("select",this.#ew)}#ew=()=>{let e=this.#eu();this.#s.dispatchEvent(new CustomEvent("selection",{...oz.$,detail:{selectionStart:e.selectionStart,selectionEnd:e.selectionEnd}}))};#ex=e=>{e.target===this.#eu()&&"number"==typeof e.detail&&e.stopImmediatePropagation()};constructor(e){this.#s=e;let t=this.#eu(),s=this.#eb();t.addEventListener("blur",this.#ey,{passive:!0}),t.addEventListener("focus",this.#ey,{passive:!0}),s.addEventListener("submit",this.#ey,{passive:!0}),s.addEventListener("input",this.#ex,{passive:!0})}}t$=(0,oH.uA)("x-input",[o$.O,lw,lx,l_,lT],oj);class lC extends(tV=HTMLElement){static #e={c:[p,tP]}=(0,oD._)(this,[],[t$],tV);#eS=(0,oH.Ut)(()=>this.shadowRoot,"#input");addText(e){let{text:t}=e,s=this.#eS(),i=s.selectionStart;if(null===i)s.value=t;else{let e=s.value;s.value=e.slice(0,i)+t+e.slice(i)}}controlKeyBoard(e){let{action:t}=e;0===t||1===t?this.focus():(2===t||3===t)&&this.blur()}setValue(e){let t,s=this.#eS();s.value=e.value,(t=e.index)&&s.setSelectionRange(t,t)}getValue(){let e=this.#eS();return{value:e.value,selectionBegin:e.selectionStart,selectionEnd:e.selectionEnd}}sendDelEvent(e){let{action:t,length:s}=e,i=this.#eS();1===t&&(s=1);let o=i.selectionStart;if(null===o){let e=i.value;i.value=i.value.substring(0,e.length-s)}else{let e=i.value;i.value=e.slice(0,o-s)+e.slice(o)}}setInputFilter(e){this.#eS().setAttribute("pattern",e.pattern)}select(){let e=this.#eS();e.setSelectionRange(0,e.value.length)}setSelectionRange(e){this.#eS().setSelectionRange(e.selectionStart,e.selectionEnd)}focus(e){this.#eS().focus(e)}blur(){this.#eS().blur()}connectedCallback(){let e=this.#eS();null===this.getAttribute("confirm-type")&&e.setAttribute("confirm-type","send"),null===this.getAttribute("maxlength")&&e.setAttribute("maxlength","140")}static #t=tP()}tz=(0,oH._y)("events-pass-through",!0),tU=(0,oH._y)("visible",!1);class lL{static #e={e:[tW]}=(0,oD._)(this,[[tz,2,"_handleEventsPassThrough"],[tU,2,"_handleVisible"]],[]);static observedAttributes=["visible","events-pass-through"];#s;#eT=(tW(this),!!window.HTMLDialogElement);#eC=!1;constructor(e){this.#s=e}#eL=(0,oH.Ut)(()=>this.#s.shadowRoot,"#dialog");_handleEventsPassThrough(e){null!==e?(this.#eL().addEventListener("click",this.#eI,{passive:!1}),this.#s.addEventListener("click",this.#eI,{passive:!1})):(this.#eL().removeEventListener("click",this.#eI),this.#s.removeEventListener("click",this.#eI))}_handleVisible(e){this.#eC=null!==e,this.#eT&&(this.#eC?(this.#eL().showModal(),this.#s.dispatchEvent(new CustomEvent("showoverlay",oz.$))):(this.#eL().close(),this.#s.dispatchEvent(new CustomEvent("dismissoverlay",oz.$))))}#eI=e=>{e.stopPropagation();let t=this.#eL();if(e.target===this.#s||e.target===t){t.close();let{clientX:s,clientY:i}=e,o=document.elementFromPoint(s,i);o?.tagName==="LYNX-VIEW"&&o.shadowRoot&&(o=o.shadowRoot.elementFromPoint(s,i)??o),o?.dispatchEvent(new MouseEvent("click",e)),requestAnimationFrame(()=>{this.#eC&&t.isConnected&&t.showModal()})}};connectedCallback(){this.#eT||(this.#eL().style.display="none")}}tB=(0,oH.uA)("x-overlay-ng",[o$.O,lL],oG);class lI extends(tZ=HTMLElement){static #e={c:[g,tX]}=(0,oD._)(this,[],[tB],tZ);get[o$.v](){return this.shadowRoot.firstElementChild}static #t=tX()}class lA extends Event{startShowing;fullyShowing;static EventName="x-refresh-view-intersecting";constructor(e,t){super(lA.EventName,{composed:!1,cancelable:!0,bubbles:!0}),this.startShowing=e,this.fullyShowing=t}}class lO{#s;static observedAttributes=[];#eA;constructor(e){this.#s=e}connectedCallback(){if(IntersectionObserver&&!this.#eA){let e=this.#s.parentElement;e&&(this.#eA=new IntersectionObserver(e=>{let t=!1,s=!1;e.forEach(e=>{t=e.intersectionRatio>0,s=e.intersectionRatio>.9}),this.#s.dispatchEvent(new lA(t,s)),s&&this.#s.setAttribute("x-magnet-enable","")},{root:e,threshold:[.1,.9]}),this.#eA.observe(this.#s))}}dispose(){this.#eA&&(this.#eA.disconnect(),this.#eA=void 0)}}tY=(0,oH.uA)("x-refresh-footer",[o4,o$.O,lO]);class lR extends(tj=HTMLElement){static #e={c:[v,tq]}=(0,oD._)(this,[],[tY],tj);connectedCallback(){this.setAttribute("slot","footer")}static #t=tq()}tK=(0,oH.uA)("x-refresh-header",[o4,o$.O,lO]);class lM extends(tJ=HTMLElement){static #e={c:[b,tG]}=(0,oD._)(this,[],[tK],tJ);connectedCallback(){this.setAttribute("slot","header")}static #t=tG()}tQ=(0,oH.ZR)("headeroffset"),t0=(0,oH.ZR)("headershow"),t1=(0,oH.ZR)("footeroffset"),t2=(0,oH.ZR)("startrefresh"),t8=(0,oH.ZR)("headerreleased"),t3=(0,oH.ZR)("startloadmore"),t4=(0,oH.ZR)("footerreleased");class lk{static #e={e:[t5]}=(0,oD._)(this,[[[tQ,t0,t1],2,"_handleComplexEventEnableAttributes"],[[t2,t8,t3,t4],2,"_handleXEnableHeaderOffsetEvent"]],[]);#s;static observedAttributes=[];#eO=(t5(this),(0,oH.Ut)(()=>this.#s,"x-refresh-view > x-refresh-header:first-of-type"));#eR=(0,oH.Ut)(()=>this.#s,"x-refresh-view > x-refresh-footer:first-of-type");constructor(e){this.#s=e,this.#s.addEventListener(lA.EventName,this.#eM)}#ek={headeroffset:!1,headerreleased:!1,startrefresh:!1,footeroffset:!1,headershow:!1,footerreleased:!1,startloadmore:!1};_handleComplexEventEnableAttributes(e,t){this.#ek[t]=e;let{headeroffset:s,headershow:i,footeroffset:o}=this.#ek;s||i||o?this.#eD():this.#eH()}_handleXEnableHeaderOffsetEvent(e,t){this.#ek[t]=e;let{startrefresh:s,headerreleased:i,startloadmore:o,footerreleased:l}=this.#ek;i||l||o||s?this.#eF():this.#eN()}#e$=!1;#eP=!1;#eV=!1;#ez=!1;#eM=e=>{e.stopPropagation(),"X-REFRESH-HEADER"===e.target.tagName?(this.#e$=e.startShowing,this.#eP=e.fullyShowing):(this.#eV=e.startShowing,this.#ez=e.fullyShowing)};#eU=!1;#eF(){this.#eU||(this.#s.addEventListener("touchend",this.#eW),this.#eU=!0)}#eW=()=>{this.#eP?(this.#s.dispatchEvent(new CustomEvent("headerreleased",oz.$)),this.#s.dispatchEvent(new CustomEvent("startrefresh",{...oz.$,detail:{isManual:this.#s._nextRefreshIsManual}})),this.#s._nextRefreshIsManual=!0):("true"===this.#s.getAttribute("enable-auto-loadmore")&&this.#eV||this.#ez)&&(this.#s.dispatchEvent(new CustomEvent("footerreleased",oz.$)),this.#s.dispatchEvent(new CustomEvent("startloadmore",oz.$)))};#eN(){this.#eU&&this.#s.removeEventListener("touchend",this.#eW)}#eB=!1;#eX=!1;#eD(){this.#eX||(this.#s.addEventListener("touchstart",this.#eZ),this.#s.addEventListener("touchend",this.#eY),this.#s.addEventListener("touchcancel",this.#eY),this.#s.shadowRoot.querySelector("#container").addEventListener("scroll",this.#g))}#eY=()=>{this.#eB=!1};#eZ=()=>{this.#eB=!0};#g=()=>{if(this.#e$&&(this.#ek.headershow||this.#ek.headeroffset)){let e=this.#eO();if(e){let t=parseFloat(getComputedStyle(e).height),s=this.#s.shadowRoot.querySelector("#container").scrollTop;this.#s.dispatchEvent(new CustomEvent("headershow",{...oz.$,detail:{isDragging:this.#eB,offsetPercent:1-s/t}})),this.#s.dispatchEvent(new CustomEvent("headeroffset",{...oz.$,detail:{isDragging:this.#eB,offsetPercent:1-s/t}}))}}else if(this.#eV&&this.#ek.footeroffset){let e=this.#eR();if(e){let t=this.#s.shadowRoot.querySelector("#container").scrollTop,s=parseFloat(getComputedStyle(e).height);this.#s.dispatchEvent(new CustomEvent("footeroffset",{...oz.$,detail:{isDragging:this.#eB,offsetPercent:1-t/s}}))}}};#eH(){this.#eX&&(this.#s.removeEventListener("touchstart",this.#eZ),this.#s.removeEventListener("touchend",this.#eY),this.#s.removeEventListener("touchcancel",this.#eY),this.#s.shadowRoot.querySelector("#container").removeEventListener("scroll",this.#g))}dispose(){this.#eN(),this.#eH()}}t9=(0,oH.uA)("x-refresh-view",[o4,o$.O,lk],oJ),new class extends oN{constructor(){super(E),t6()}static #e=(()=>{class e extends(t7=HTMLElement){static #e={c:[E,t6]}=(0,oD._)(this,[],[t9],t7);static notToFilterFalseAttributes=new Set(["enable-refresh","enable-loadmore","enable-auto-loadmore"]);_nextRefreshIsManual=!0;finishRefresh(){this.querySelector("x-refresh-view > x-refresh-header:first-of-type")?.removeAttribute("x-magnet-enable")}finishLoadMore(){this.querySelector("x-refresh-view > x-refresh-footer:first-of-type")?.removeAttribute("x-magnet-enable")}autoStartRefresh(){let e=this.shadowRoot.querySelector("#container");this.querySelector("x-refresh-view > x-refresh-header:first-of-type")?.setAttribute("x-magnet-enable",""),this._nextRefreshIsManual=!1,e.scroll({top:0,behavior:"smooth"})}#eq=(0,oH.Ut)(()=>this.shadowRoot,"#container");#ej=(0,oH.Ut)(()=>this.shadowRoot,"#content");get scrollTop(){let e=this.#eq(),t=this.#ej();return t.scrollTop+t.offsetTop-e.scrollTop}set scrollTop(e){console.log(e);let t=this.#eq(),s=this.#ej();e>0?s.scrollTop=e:t.scrollTop=s.offsetTop+e}get scrollHeight(){return this.#ej().scrollHeight}get[oW.l](){return this}}})()},se=(0,oH._y)("src",!0),st=(0,oH._y)("content",!0),ss=(0,oH.ZR)("load");class lD{static #e={e:[si]}=(0,oD._)(this,[[se,2,"_handleSrc"],[st,2,"_handleContent"],[ss,2,"_enableLoadEvent"]],[]);static observedAttributes=["src","content"];#s;#eK=(si(this),null);#ea=(0,oH.Ut)(()=>this.#s.shadowRoot,"#img");_handleSrc(e){e?this.#ea().src=e:this.#ea().src=""}_handleContent(e){if(this.#eK&&URL.revokeObjectURL(this.#eK),!e){this.#eK="";return}let t=new Blob([e],{type:"image/svg+xml;charset=UTF-8"}),s=URL.createObjectURL(t);this.#eK=s,this.#ea().src=s}_enableLoadEvent(e){e?this.#ea().addEventListener("load",this.#ed,{passive:!0}):this.#ea().removeEventListener("load",this.#ed)}#ed=()=>{this.#s.dispatchEvent(new CustomEvent("load",{...oz.$,detail:{width:this.#ea().naturalWidth,height:this.#ea().naturalHeight}}))};constructor(e){this.#s=e}}so=(0,oH.uA)("x-svg",[o$.O,lD],'<img part="img" alt="" loading="lazy" id="img" /> ');class lH extends(sr=HTMLElement){static #e={c:[f,sl]}=(0,oD._)(this,[],[so],sr);static #t=sl()}sn=(0,oH.uA)("x-swiper-item",[o4,o$.O]);class lF extends(sh=HTMLElement){static #e={c:[y,sa]}=(0,oD._)(this,[],[sn],sh);static #t=sa()}sd=(0,oH.ZR)("transition"),sc=(0,oH.ZR)("scrollstart"),su=(0,oH.ZR)("lynxscrollend"),sm=(0,oH.ZR)("change"),sp=(0,oH.ZR)("change-event-for-indicator");class lN{static #e={e:[sg,sv]}=(0,oD._)(this,[[[sc,su,sm,sp],2,"_enableScrollEventProcessor"],[sd,0,"_handleEnableTransitionEvent"]],[]);static observedAttributes=[];#s;#eG=(sv(this),0);#eJ=0;#eB=!1;#l;#eQ=!1;constructor(e){this.#s=e}#ej=(0,oH.Ut)(()=>this.#s.shadowRoot,"#content").bind(this);_handleEnableTransitionEvent=sg(this,(0,oH.LB)(this.#ej,"scroll",this.#e0,{passive:!0}));#g(){oW.k||(clearTimeout(this.#l),this.#l=setTimeout(()=>{this.#b()},100)),this.#eQ||(this.#s.dispatchEvent(new CustomEvent("scrollstart",{...oz.$,detail:{current:this.#eG,isDragged:this.#eB}})),this.#eQ=!0);let e=this.#ej(),t=this.#s.isVertical,s=t?e.scrollTop:e.scrollLeft,i=t?e.clientHeight:e.clientWidth,o=t?e.scrollHeight:e.scrollWidth;if(Math.abs(this.#eJ-s)>i/4||s<10||Math.abs(s-o)<=i){let e=this.#s.currentIndex;e!==this.#eG&&(this.#s.dispatchEvent(new CustomEvent("change",{...oz.$,detail:{current:e,isDragged:this.#eB}})),this.#eG=e),this.#eJ=s}}#b(){this.#s.dispatchEvent(new CustomEvent("lynxscrollend",{...oz.$,detail:{current:this.#eG}})),this.#eQ=!1}#e1(){this.#eB=!0}#e2(){this.#eB=!1}#e0(){this.#s.dispatchEvent(new CustomEvent("transition",{...oz.$,detail:{dx:this.#ej().scrollLeft,dy:this.#ej().scrollTop}}))}#e8=[(0,oH.LB)(this.#ej,"scroll",this.#g.bind(this),{passive:!0}),(0,oH.LB)(this.#ej,"touchstart",this.#e1.bind(this),{passive:!0}),(0,oH.LB)(this.#ej,"touchend",this.#e2.bind(this),{passive:!0}),(0,oH.LB)(this.#ej,"touchcancel",this.#e2.bind(this),{passive:!0}),(0,oH.LB)(this.#ej,"scrollend",this.#b.bind(this),{passive:!0})];#ek={scrollstart:!1,lynxscrollend:!1,change:!1,"change-event-for-indicator":!1};_enableScrollEventProcessor(e,t){this.#ek[t]=e;let{lynxscrollend:s,scrollstart:i,change:o}=this.#ek,l=o||s||i||this.#ek["change-event-for-indicator"];this.#e8.forEach(e=>e(l))}connectedCallback(){this.#eG=parseFloat(this.#s.getAttribute("current")??"0");let e=this.#s.isVertical;this.#eJ=e?this.#ej().scrollTop:this.#ej().scrollLeft}}sb=(0,oH._y)("current",!1),sE=(0,oH._y)("interval",!1),sf=(0,oH._y)("autoplay",!1);class l${static #e={e:[sy]}=(0,oD._)(this,[[sb,2,"_handleCurrentChange"],[[sE,sf],2,"_handleAutoplay"]],[]);static observedAttributes=["current","interval","autoplay"];#s;constructor(e){this.#s=e}#e3(){this.#s.currentIndex===this.#s.childElementCount-1?this.#s.circularPlay&&(this.#s.currentIndex=0):this.#s.currentIndex+=1}_handleCurrentChange(e){let t=Number(e);Number.isNaN(t)||(this.#s.currentIndex=t)}#e4;#e5=(sy(this),(()=>{this.#e3()}).bind(this));#e9(e){this.#e6(),this.#e4=setInterval(this.#e5,e)}#e6(){this.#e4&&clearInterval(this.#e4)}_handleAutoplay(){if(null!==this.#s.getAttribute("autoplay")){let e=this.#s.getAttribute("interval"),t=e?parseFloat(e):5e3;Number.isNaN(t)&&(t=5e3),this.#e9(t)}}dispose(){this.#e6()}}s_=(0,oH._y)("circular",!1),sw=(0,oH._y)("vertical",!0);class lP{static #e={e:[sx]}=(0,oD._)(this,[[s_,2,"_handleCircular"],[sw,2,"_handleVerticalChange"]],[]);static observedAttributes=["circular","vertical"];#s;#e7=(sx(this),!1);#te;#tt=0;#ej=(0,oH.Ut)(()=>this.#s.shadowRoot,"#content").bind(this);constructor(e){this.#s=e}#ts=(0,oH.Ut)(()=>this.#s.shadowRoot,"#circular-start").bind(this);#ti=(0,oH.Ut)(()=>this.#s.shadowRoot,"#circular-end").bind(this);#to(e){let t=this.#s.childElementCount;if(t>2){let{current:s,isDragged:i,__isFirstLayout:o}=e.detail;if(0===s||s===t-1||2===s||s===t-2){let e,l=this.#ej(),r=this.#ts().assignedElements(),n=this.#ti().assignedElements(),a=this.#s.firstElementChild,h=this.#s.lastElementChild,d=this.#s.snapDistance;if(0===s?(n.forEach(e=>e.removeAttribute("slot")),h.setAttribute("slot","circular-start"),e=a):s===t-1?(r.forEach(e=>e.removeAttribute("slot")),a.setAttribute("slot","circular-end"),e=h):(r.forEach(e=>e.removeAttribute("slot")),n.forEach(e=>e.removeAttribute("slot")),e=this.#s.children[s]),this.#e7){let t="carousel"===this.#s.getAttribute("mode")?.8*l.clientHeight/2:l.clientHeight/2;this.#tt=e.offsetTop+e.offsetHeight/2-d-t,l.scrollTop=this.#tt}else{let t="carousel"===this.#s.getAttribute("mode")?.8*l.clientWidth/2:l.clientWidth/2;this.#tt=e.offsetLeft+e.offsetWidth/2-d-t,l.scrollLeft=this.#tt}if(!i){let e=this.#s.getAttribute("mode");if(o&&(null===e||"normal"===e||"carousel"===e||"carry"===e))return;this.#tl(o?"instant":"smooth")}}}}#tl(e){let t=this.#ej(),s=this.#s.snapDistance;t.scrollBy({top:this.#e7?s:0,left:this.#e7?0:s,behavior:e??"smooth"})}#e8=[(0,oH.LB)(()=>this.#s,"change",this.#to.bind(this),{passive:!0}),(0,oH.LB)(()=>this.#s,"touchmove",this.#tr.bind(this),{passive:!1}),(0,oH.LB)(()=>this.#s,"touchend",this.#tn.bind(this),{passive:!1}),(0,oH.LB)(()=>this.#s,"touchcancel",this.#tn.bind(this),{passive:!1})];_handleCircular(e){this.#e8.forEach(t=>t(null!=e)),null!==e&&this.#to({detail:{current:this.#s.currentIndex,isDragged:!1,__isFirstLayout:!0}})}#tr(e){let t=e.touches.item(0);if(t){let e=this.#e7?t.pageY:t.pageX;if(void 0!==this.#te){this.#ta();let t=this.#te-e;this.#tt+=t}this.#te=e}}#tn(e){this.#th(),this.#tl(),this.#te=void 0}_handleVerticalChange(e){this.#e7=null!==e}#td;#ta(){if(!this.#td){let e=this.#ej();this.#tt=this.#e7?e.scrollTop:e.scrollLeft,this.#td=setInterval(()=>{this.#e7?e.scrollTop=this.#tt:e.scrollLeft=this.#tt},10)}}#th(){this.#td&&(clearInterval(this.#td),this.#td=void 0)}dispose(){this.#th()}}sS=(0,oH._y)("indicator-color",!0),sT=(0,oH._y)("indicator-active-color",!0),sC=(0,oH._y)("page-margin",!0),sL=(0,oH._y)("previous-margin",!0),sI=(0,oH._y)("next-margin",!0);class lV{static #e={e:[sA,sO,sR,sM,sk,sD]}=(0,oD._)(this,[[sS,0,"_handleIndicatorColor"],[sT,0,"_handleIndicatorActiveColor"],[sC,0,"_handlePageMargin"],[sL,0,"_handlePreviousMargin"],[sI,0,"_handleNextMargin"]],[]);static observedAttributes=["indicator-color","indicator-active-color","page-margin","previous-margin","next-margin"];#s;#tc=(sD(this),0);#tu=(0,oH.Ut)(()=>this.#s.shadowRoot,"#indicator-container");#tm=(0,oH.Ut)(()=>this.#s.shadowRoot,"#indicator-style");#tp;constructor(e){this.#s=e}_handleIndicatorColor=sA(this,(0,oH._8)(this.#tu,"--indicator-color",void 0,!0));_handleIndicatorActiveColor=sO(this,(0,oH._8)(this.#tu,"--indicator-active-color",void 0,!0));_handlePageMargin=sR(this,(0,oH._8)(this.#tu,"--page-margin",void 0,!0));_handlePreviousMargin=sM(this,(0,oH._8)(this.#tu,"--previous-margin",void 0,!0));_handleNextMargin=sk(this,(0,oH._8)(this.#tu,"--next