@alixex/ranui-cdn 0.0.0-stage → 1.0.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.
- package/README.md +32 -2
- package/dist/IIFE-LICENSES.md +2415 -0
- package/dist/iife/attachments.iife.js +1 -0
- package/dist/iife/button.iife.js +111 -0
- package/dist/iife/card.iife.js +1 -0
- package/dist/iife/checkbox.iife.js +1 -0
- package/dist/iife/colorpicker.iife.js +111 -0
- package/dist/iife/content.iife.js +1 -0
- package/dist/iife/conversation.iife.js +1 -0
- package/dist/iife/disclosure-row.iife.js +1 -0
- package/dist/iife/dropdown.iife.js +1 -0
- package/dist/iife/fan-gallery.iife.js +1 -0
- package/dist/iife/glass.iife.js +290 -0
- package/dist/iife/icon.iife.js +111 -0
- package/dist/iife/image.iife.js +1 -0
- package/dist/iife/input.iife.js +111 -0
- package/dist/iife/link.iife.js +1 -0
- package/dist/iife/loading.iife.js +1 -0
- package/dist/iife/markdown.iife.js +4048 -0
- package/dist/iife/math.iife.js +206 -0
- package/dist/iife/menubar.iife.js +70 -0
- package/dist/iife/mermaid.iife.js +3700 -0
- package/dist/iife/message.iife.js +111 -0
- package/dist/iife/modal.iife.js +111 -0
- package/dist/iife/player.iife.js +175 -0
- package/dist/iife/popover.iife.js +1 -0
- package/dist/iife/progress.iife.js +1 -0
- package/dist/iife/radar.iife.js +1 -0
- package/dist/iife/reasoning.iife.js +3 -0
- package/dist/iife/route.iife.js +1 -0
- package/dist/iife/router.iife.js +1 -0
- package/dist/iife/scratch.iife.js +1 -0
- package/dist/iife/section.iife.js +1 -0
- package/dist/iife/select.iife.js +111 -0
- package/dist/iife/skeleton.iife.js +1 -0
- package/dist/iife/state-dot.iife.js +1 -0
- package/dist/iife/surface-switch.iife.js +111 -0
- package/dist/iife/tab.iife.js +111 -0
- package/dist/iife/tabpane.iife.js +1 -0
- package/dist/iife/theme-switch.iife.js +111 -0
- package/dist/iife/token-meter.iife.js +2 -0
- package/dist/iife/tool-card.iife.js +4 -0
- package/dist/iife/voice-button.iife.js +1 -0
- package/dist/index.iife.js +47 -0
- package/package.json +30 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ranui_popover=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=(e,t=500)=>{let n=null,r,i=null,a=()=>{if(n=null,!i)return;let t=i,a=r;i=null,r=void 0,e.apply(a,t)},o=function(...e){r=this,i=e,n!==null&&clearTimeout(n),n=setTimeout(a,t)};return o.cancel=()=>{n!==null&&clearTimeout(n),n=null,i=null,r=void 0},o.flush=()=>{n!==null&&(clearTimeout(n),a())},o.pending=()=>n!==null,o},n=()=>typeof window<`u`,r=()=>{if(!n())return!1;let e=window.navigator.userAgent;return!!/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(e)},i=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)||n.add(t)},a=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)&&n.remove(t)},o=/["'&<>]/;function s(e){let t=``+e,n=o.exec(t);if(!n)return t;let r,i=``,a=0,s=0;for(a=n.index;a<t.length;a++){switch(t.charCodeAt(a)){case 34:r=`"`;break;case 38:r=`&`;break;case 39:r=`'`;break;case 60:r=`<`;break;case 62:r=`>`;break;default:continue}s!==a&&(i+=t.substring(s,a)),s=a+1,i+=r}return s===a?i:i+t.substring(s,a)}var c=class{ac=null;get signal(){return this.ac??=new AbortController,this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},l=new Map,u=`data-adopted-style`,d=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},f=(e,t,n=u)=>{if(t){if(typeof document>`u`){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t);return}if(!d(e,t,l)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}}},ee=(e,t,n,r)=>e===`end`?t+n-r:e===`center`?t+(n-r)/2:t,te=()=>({top:0,left:0,width:typeof window<`u`?window.innerWidth:1/0,height:typeof window<`u`?window.innerHeight:1/0}),p=e=>{let{anchor:t,floating:n,offset:r=0,padding:i=8}=e,a=e.boundary??te(),[o,s]=e.placement.split(`-`),c=s??`start`,l=o,u=l===`top`||l===`bottom`,d=t.width>0&&t.height>0&&n.width>0&&n.height>0;if(d&&u){let e=a.top+a.height-(t.top+t.height),i=t.top-a.top;l===`bottom`&&e<n.height+r&&i>e?l=`top`:l===`top`&&i<n.height+r&&e>i&&(l=`bottom`)}else if(d){let e=a.left+a.width-(t.left+t.width),i=t.left-a.left;l===`right`&&e<n.width+r&&i>e?l=`left`:l===`left`&&i<n.width+r&&e>i&&(l=`right`)}let f=(e,t,n)=>ee(c,e,t,n),p,m;if(l===`bottom`?(p=t.top+t.height+r,m=f(t.left,t.width,n.width)):l===`top`?(p=t.top-n.height-r,m=f(t.left,t.width,n.width)):l===`right`?(p=f(t.top,t.height,n.height),m=t.left+t.width+r):(p=f(t.top,t.height,n.height),m=t.left-n.width-r),d&&u){let e=a.left+i,t=a.left+a.width-n.width-i;t>=e&&(m=Math.min(Math.max(m,e),t))}else if(d){let e=a.top+i,t=a.top+a.height-n.height-i;t>=e&&(p=Math.min(Math.max(p,e),t))}return{top:p,left:m,placement:s?`${l}-${c}`:l,side:l,align:c}},m=typeof document>`u`,h=0,g=1,_=2,v=null,y=null,b=0,x=new Set,S=!1;function C(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ie(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)O(e,_);b===0&&ae()}}]}function w(e){let t=ne(e,!0);return re(t),se(t),()=>k(t)}function T(e){let t=v;v=null;try{return e()}finally{v=t}}function E(e){let t={owned:[],cleanups:[],owner:y},n=y,r=v;y=t,v=null;try{return e(()=>le(t))}finally{y=n,v=r}}function D(e){y&&y.cleanups.push(e)}function ne(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:_,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:y}}function re(e){y&&y.owned.push(e)}function ie(e){v&&(v.sources.add(e),e.observers.add(v))}function O(e,t){if(e.disposed||e.state>=t)return;let n=e.state===h;if(e.state=t,e.isEffect)x.add(e);else if(n)for(let t of e.observers)O(t,g)}function ae(){if(!(b>0||S)){S=!0;try{for(;x.size>0;){let e=[...x];x.clear();for(let t of e)t.disposed||oe(t)}}finally{S=!1}}}function oe(e){if(!(e.disposed||e.state===h)){if(e.state===g)for(let t of e.sources)`fn`in t&&oe(t);e.state===_&&se(e),e.state=h}}function se(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);ce(e);let t=v,n=y;v=e,y=e,e.running=!0,e.state=h;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)O(t,_)}}finally{e.running=!1,v=t,y=n}}function ce(e){for(let t of e.owned)k(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function k(e){e.disposed||(e.disposed=!0,ce(e),e.observers.clear())}function le(e){for(let t of e.owned)k(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function ue(e){return s(e)}var de=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,fe=`.#[`;function pe(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n<e.length;){let r=e[n];if(r===`[`){let r=e.indexOf(`]`,n+1);if(r===-1)return null;t.push(e.slice(n,r+1)),n=r+1;continue}if(r!==`.`&&r!==`#`)return null;let i=n+1;for(;i<e.length&&!fe.includes(e[i]);)i+=1;if(i===n+1)return null;t.push(e.slice(n,i)),n=i}return t.length>0?t:null}var me=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},he=(e,t)=>{let n=t.trim();if(!n)return!1;let r=pe(n);return r!==null&&r.every(t=>me(e,t))},A=(e,t,n)=>{for(let r of e)de(r)&&(he(r,t)&&n.push(r),A(r.childrenList,t,n))};function ge(e,t,n){if(n==null)return e.push(t),t;let r=e.indexOf(n);return r===-1?e.push(t):e.splice(r,0,t),t}var j=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return ge(this.childrenList,e,t)}serialize(){return this.childrenList.map(e=>typeof e==`string`?s(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return A(this.childrenList,e,t),t}},_e=new Map,ve=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??_e}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:s(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new j)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return ge(this.childrenList,e,t)}attachShadow(e){return this.shadowRoot=new ye(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return A(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName;this.shadowRoot&&!this.hasAttribute(`data-ran-dsd`)&&this.setAttribute(`data-ran-dsd`,``);let n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${ue(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,i=r?` style="${ue(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?s(e):(e instanceof j,e.serialize())).join(``):a+=s(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},ye=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}get children(){return this.childrenList.filter(e=>typeof e!=`string`&&!(e instanceof j))}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return ge(this.childrenList,e,t)}replaceChildren(...e){this.childrenList=e.filter(e=>e!=null)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return A(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${String(e).replace(/<\/style/gi,`<\\/style`)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?s(e):(e instanceof j,e.serialize())).join(``)}</template>`}},M={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let n of t){if(n==null)continue;if(Array.isArray(n)){M.append(e,n);continue}if(typeof n==`function`){M.append(e,[n()]);continue}if(typeof n==`object`&&(`__ranFor`in n||`__ranIndex`in n))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=n instanceof N?n.build():typeof n==`string`&&!m?document.createTextNode(n):n;e.appendChild(t)}}},be=`http://www.w3.org/2000/svg`,xe=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),N=class{runtime;el;constructor(e,t,n=M){this.runtime=n;let r=t??(xe.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=m?new ve(e):r?document.createElementNS(r,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{m?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(m){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new Se(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(m)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},Se=class{runtime;root;hostEl;constructor(e,t,n,r=M){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(m)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return m?this.root.serialize():this.root.innerHTML}},P=()=>({current:null}),Ce=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(Ce(t)):e.concat(t),[]),F=e=>e==null?null:e instanceof N?e.build():typeof e==`string`?m?e:document.createTextNode(e):e,we=(e,t)=>{if(m){I(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};w(()=>{let e=t();a();let n=document.createDocumentFragment();i=E(t=>(I(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),D(()=>i?.())},Te=`__ranFor`,Ee=e=>typeof e==`object`&&!!e&&e[Te]===!0,De=(e,t,n)=>{let[r,i]=C(t),a=null,o=E(t=>{let i=F(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},Oe=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},ke=(e,t)=>{if(m){(t.each()??[]).forEach((n,r)=>{let i=F(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;D(()=>{for(let e of r.values())e.dispose();r.clear()}),w(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o)){Fe()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=r.get(o);s?(r.delete(o),s.index(n)):s=De(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();Oe(n,a),r=i})},Ae=`__ranIndex`,je=e=>typeof e==`object`&&!!e&&e[Ae]===!0,Me=(e,t,n)=>{let[r,i]=C(e),a=null,o=E(e=>{let i=F(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Ne=(e,t)=>{if(m){(t.each()??[]).forEach((n,r)=>{let i=F(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];D(()=>{for(let e of r)e.dispose();r=[]}),w(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<r.length?r[n].setItem(e[n]):r.push(Me(e[n],n,t.render));for(let t=r.length-1;t>=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}Oe(n,r.map(e=>e.node).filter(e=>e!=null))})},I=(e,t)=>{m?T(()=>Pe(e,t)):Pe(e,t)},Pe=(e,t)=>{Ce(t).forEach(t=>{if(Ee(t)){ke(e,t);return}if(je(t)){Ne(e,t);return}if(typeof t==`function`){we(e,t);return}let n=F(t);n!=null&&e.appendChild(n)})},Fe=()=>!1,Ie={bind(e,t){typeof e==`function`?m?T(()=>t(e())):w(()=>t(e())):t(e)},append:I},Le=class extends N{constructor(e,t){super(e,t,Ie)}};function Re(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,be),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:ze,Div:L,Svg:Be,Span:Ve,Slot:R,ButtonBuilder:He,InputBuilder:Ue,Style:We,Label:Ge,Ul:Ke,Li:qe,Section:Je,Article:Ye,Nav:Xe,Header:Ze,Footer:Qe,Main:$e,DeclarativeShadow:et}=Re(Le),tt=new Map;function z(e,t){m?(tt.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var B=typeof document<`u`?HTMLElement:ve,nt=`data-ranui`,rt=`data-ranui-sheet`,it=(e,t)=>{if(typeof document>`u`&&t){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t)}f(e,t,nt)},V=new WeakMap,H=new Map,at=e=>{if(typeof CSSStyleSheet>`u`)return;let t=H.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},H.set(e,t)}catch{return}return t.users++,t.sheet},ot=e=>{let t=H.get(e);t&&--t.users===0&&H.delete(e)},st=(e,t)=>{if(typeof document>`u`)return;let n=V.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),ot(n.text)):n&&e.querySelector(`style[${rt}]`)?.remove(),V.delete(e),!t))return;let r=at(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{ot(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(rt,``),n.textContent=t,e.appendChild(n)}V.set(e,{text:t,sheet:r})},ct=new WeakMap,lt=new WeakMap,ut=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,dt=`:host([hidden]){display:none}`,ft=new Map,pt=e=>{let t=ft.get(e);if(t!==void 0)return t;let n=`${dt}\n${ut}`,r=e?`${e}\n${n}`:n;return ft.set(e,r),r},mt=e=>{let t=lt.get(e);if(t)return t;try{let t=e.attachInternals;if(typeof t!=`function`)return;let n=t.call(e);return lt.set(e,n),n}catch{return}},U=(e,t=``,n={mode:`closed`},r)=>{let i=r??mt(e),a=e.shadowRoot||ct.get(e)||i?.shadowRoot||e.attachShadow(n);return ct.set(e,a),it(a,pt(t)),a},W=(e,t,...n)=>{e.replaceChildren(...n),it(e,pt(t))},G=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},K=(e,t,n=``)=>e.getAttribute(t)??n,q=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},ht=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&st(t,e.getAttribute(`sheet`)||``)},gt=`:host{visibility:hidden;position:absolute}`;z(`r-content`,class extends B{observer;_shadowDom;_slot;constructor(){super(),this._shadowDom=U(this,gt);let e=R().class(`slot`).build();W(this._shadowDom,gt,e),this._slot=e,this.observer=new MutationObserver(this.callback)}callback=e=>{let t=e.filter(e=>e.type===`childList`||e.type===`attributes`);if(!t.length)return;let n=t[t.length-1];this.dispatchEvent(new CustomEvent(`change`,{detail:{type:t.some(e=>e.type===`childList`)?`childList`:`attributes`,value:{content:this.children,mutation:n,mutations:t}}}))};connectedCallback(){this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0})}disconnectedCallback(){this.observer.disconnect()}});var _t=`@keyframes ranui-dropdown-up-in{0%{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}to{transform:scaleY(1);transform-origin:100% 100%;opacity:1}}@keyframes ranui-dropdown-up-out{0%{transform:scaleY(1);transform-origin:100% 100%;opacity:1}to{transform:scaleY(.8);transform-origin:100% 100%;opacity:0}}@keyframes ranui-dropdown-down-in{0%{transform:scaleY(.8);transform-origin:0% 0%;opacity:0}to{transform:scaleY(1);transform-origin:0% 0%;opacity:1}}@keyframes ranui-dropdown-down-out{0%{transform:scaleY(1);transform-origin:0% 0%;opacity:1}to{transform:scaleY(.8);transform-origin:0% 0%;opacity:0}}@keyframes ranui-dropdown-left-in{0%{transform:scaleX(.8);transform-origin:100% 0%;opacity:0}to{transform:scaleX(1);transform-origin:100% 0%;opacity:1}}@keyframes ranui-dropdown-left-out{0%{transform:scaleX(1);transform-origin:100% 0%;opacity:1}to{transform:scaleX(.8);transform-origin:100% 0%;opacity:0}}@keyframes ranui-dropdown-right-in{0%{transform:scaleX(.8);transform-origin:0% 0%;opacity:0}to{transform:scaleX(1);transform-origin:0% 0%;opacity:1}}@keyframes ranui-dropdown-right-out{0%{transform:scaleX(1);transform-origin:0% 0%;opacity:1}to{transform:scaleX(.8);transform-origin:0% 0%;opacity:0}}.ran-dropdown-down-in{animation:ranui-dropdown-down-in var(--ran-dropdown-animation-duration, var(--ran-motion-duration-base, .2s)) var(--ran-dropdown-animation-timing-function, var(--ran-motion-ease-standard, ease));animation-fill-mode:forwards}.ran-dropdown-down-out{animation:ranui-dropdown-down-out var(--ran-dropdown-animation-duration, var(--ran-motion-duration-base, .2s)) var(--ran-dropdown-animation-timing-function, var(--ran-motion-ease-standard, ease));animation-fill-mode:forwards}.ran-dropdown-up-in{animation:ranui-dropdown-up-in var(--ran-dropdown-animation-duration, var(--ran-motion-duration-base, .2s)) var(--ran-dropdown-animation-timing-function, var(--ran-motion-ease-standard, ease));animation-fill-mode:forwards}.ran-dropdown-up-out{animation:ranui-dropdown-up-out var(--ran-dropdown-animation-duration, var(--ran-motion-duration-base, .2s)) var(--ran-dropdown-animation-timing-function, var(--ran-motion-ease-standard, ease));animation-fill-mode:forwards}.ran-dropdown-left-in{animation:ranui-dropdown-left-in var(--ran-dropdown-animation-duration, var(--ran-motion-duration-base, .2s)) var(--ran-dropdown-animation-timing-function, var(--ran-motion-ease-standard, ease));animation-fill-mode:forwards}.ran-dropdown-left-out{animation:ranui-dropdown-left-out var(--ran-dropdown-animation-duration, var(--ran-motion-duration-base, .2s)) var(--ran-dropdown-animation-timing-function, var(--ran-motion-ease-standard, ease));animation-fill-mode:forwards}.ran-dropdown-right-in{animation:ranui-dropdown-right-in var(--ran-dropdown-animation-duration, var(--ran-motion-duration-base, .2s)) var(--ran-dropdown-animation-timing-function, var(--ran-motion-ease-standard, ease));animation-fill-mode:forwards}.ran-dropdown-right-out{animation:ranui-dropdown-right-out var(--ran-dropdown-animation-duration, var(--ran-motion-duration-base, .2s)) var(--ran-dropdown-animation-timing-function, var(--ran-motion-ease-standard, ease));animation-fill-mode:forwards}:host{text-align:var(--ran-dropdown-host-text-align, left);z-index:var(--ran-dropdown-host-z-index, auto)}:host([data-ran-floating]),:host([data-ran-floating]) .ranui-dropdown-container,:host([data-ran-floating]) ::slotted(*){transition-property:none!important;transition-delay:0s}:host([data-ran-floating="placing"]){opacity:0;pointer-events:none}.ranui-dropdown{position:var(--ran-dropdown-position, relative);transform-origin:var(--ran-x, 50%) var(--ran-y, 50%);box-sizing:var(--ran-dropdown-box-sizing, border-box);margin:var(--ran-dropdown-margin, 0);padding:var(--ran-dropdown-padding, 0);color:var(--ran-dropdown-color, var(--ran-color-text, rgba(0, 0, 0, .88)));font-size:var(--ran-dropdown-font-size, var(--ran-text-label-1, 14px));font-weight:var(--ran-dropdown-font-weight, var(--ran-text-label-weight, 500));list-style:var(--ran-dropdown-list-style, none);font-family:var(--ran-dropdown-font-family, var(--ran-skin-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));z-index:var(--ran-dropdown-z-index, var(--ran-z-dropdown, 1100));overflow:var(--ran-dropdown-overflow, hidden);font-variant:var(--ran-dropdown-font-variant, initial);background:var(--ran-dropdown-background, var(--ran-color-bg-elevated, #ffffff));border:var(--ran-dropdown-border, 1px solid var(--ran-color-border, #e4e4e8));border-radius:var(--ran-dropdown-border-radius, var(--ran-radius-md, 12px));outline:var(--ran-dropdown-outline, none);box-shadow:var(--ran-dropdown-box-shadow, var(--ran-shadow-menu, var(--ran-shadow-elevated, 0 6px 16px 0 rgba(0, 0, 0, .08), 0 3px 6px -4px rgba(0, 0, 0, .12), 0 9px 28px 8px rgba(0, 0, 0, .05))));cursor:var(--ran-dropdown-cursor, auto);width:var(--ran-dropdown-width, 100%);height:var(--ran-dropdown-height, 100%);min-height:var(--ran-dropdown-min-height, 100%);min-width:var(--ran-dropdown-min-width, 100%)}:host([role="listbox"]) .ranui-dropdown,:host([role="menu"]) .ranui-dropdown{padding:var(--ran-dropdown-padding, var(--ran-space-1, 4px))}.ranui-dropdown-container{position:var(--ran-dropdown-container-position, relative);display:var(--ran-dropdown-container-display, block);width:var(--ran-dropdown-container-width, 100%);height:var(--ran-dropdown-container-height, 100%);box-sizing:var(--ran-dropdown-container-box-sizing, border-box)}.ranui-dropdown-container .top{left:50%;transform:translate(calc(0px - var(--ran-dropdown-arrow-width, 16px) / 2 + var(--ran-dropdown-arrow-anchor-offset, 0px))) translateY(calc(-1 * var(--ran-dropdown-arrow-height, var(--ran-dropdown-arrow-width, 16px)) + var(--ran-dropdown-arrow-overlap, 2px))) rotate(0);top:0}.ranui-dropdown-container .bottom{left:50%;transform:translate(calc(0px - var(--ran-dropdown-arrow-width, 16px) / 2 + var(--ran-dropdown-arrow-anchor-offset, 0px))) translateY(var(--ran-dropdown-arrow-overlap, 2px)) rotate(180deg);top:max(0px,calc(100% - calc(var(--ran-dropdown-arrow-width, 16px) / 4)))}.ranui-dropdown-container .left,.ranui-dropdown-container .right{top:max(0px,calc(var(--ran-dropdown-arrow-anchor-height, var(--ran-dropdown-min-height, 100%)) / 2 - var(--ran-dropdown-arrow-width, 16px) / 2))}.ranui-dropdown-container .left{transform:translate(calc(0px - var(--ran-dropdown-arrow-width, 16px) + var(--ran-dropdown-arrow-overlap, 2px))) translateY(calc(var(--ran-dropdown-arrow-shape-offset, 0px) + var(--ran-dropdown-arrow-anchor-offset-y, 0px))) rotate(270deg)}.ranui-dropdown-container .right{left:100%;transform:translate(calc(0px - var(--ran-dropdown-arrow-overlap, 2px))) translateY(calc(var(--ran-dropdown-arrow-shape-offset, 0px) + var(--ran-dropdown-arrow-anchor-offset-y, 0px))) rotate(90deg)}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position, absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing, border-box);z-index:var(--ran-dropdown-arrow-z-index, 1);display:var(--ran-dropdown-arrow-display, block);pointer-events:var(--ran-dropdown-arrow-pointer-events, none);width:var(--ran-dropdown-arrow-width, var(--ran-dropdown-arrow-width, 16px));height:var(--ran-dropdown-arrow-height, var(--ran-dropdown-arrow-width, 16px));overflow:var(--ran-dropdown-arrow-overflow, hidden)}.ranui-dropdown-arrow svg{display:block;width:100%;height:100%;overflow:visible}.ranui-dropdown-arrow path{fill:var(--ran-dropdown-arrow-fill-background, var(--ran-dropdown-arrow-tip-background, var(--ran-color-bg-elevated, #ffffff)));filter:var(--ran-dropdown-arrow-shadow, drop-shadow(0 -1px 0 var(--ran-color-border)))}::slotted(.ran-select-option-hover){position:absolute;top:0;left:0;z-index:0;width:0;height:0;border-radius:var(--ran-dropdown-option-item-border-radius, var(--ran-radius-sm, 8px));background:var(--ran-select-option-hover-background, var(--ran-surface-glass-hover));opacity:0;pointer-events:none;transition:var(--ran-select-option-hover-transition, transform var(--ran-motion-duration-slow, .28s) var(--ran-motion-ease-standard, cubic-bezier(.2, 0, 0, 1)), width var(--ran-motion-duration-slow, .28s) var(--ran-motion-ease-standard, cubic-bezier(.2, 0, 0, 1)), height var(--ran-motion-duration-slow, .28s) var(--ran-motion-ease-standard, cubic-bezier(.2, 0, 0, 1)))}::slotted(.ran-select-option-hover[data-instant]){transition:none}@media(prefers-reduced-motion:reduce){::slotted(.ran-select-option-hover){transition:none}}:host([surface="glass"]) .ranui-dropdown{background:var(--ran-surface-glass-overlay-specular, linear-gradient(180deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .12) 24%, transparent 48%), linear-gradient(0deg, rgba(255, 255, 255, .22) 0%, transparent 30%), radial-gradient(120% 55% at 50% -8%, rgba(255, 255, 255, .28), transparent 58%)),var(--ran-surface-glass-overlay-fill, rgba(255, 255, 255, .48));-webkit-backdrop-filter:blur(var(--ran-surface-glass-overlay-blur, 18px)) saturate(var(--ran-surface-glass-saturate, 180%)) brightness(var(--ran-surface-glass-brightness, 1.08));backdrop-filter:blur(var(--ran-surface-glass-overlay-blur, 18px)) saturate(var(--ran-surface-glass-saturate, 180%)) brightness(var(--ran-surface-glass-brightness, 1.08));border-color:var(--ran-surface-glass-overlay-border, rgba(255, 255, 255, .72));box-shadow:var(--ran-surface-glass-overlay-shadow, 0 18px 48px rgba(0, 0, 0, .25), 0 0 0 .5px rgba(255, 255, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .4), inset 0 0 0 .5px rgba(255, 255, 255, .5), inset 0 -24px 48px rgba(255, 255, 255, .1))}@media(prefers-reduced-transparency:reduce){:host([surface="glass"]) .ranui-dropdown{-webkit-backdrop-filter:none;backdrop-filter:none;background:var(--ran-surface-glass-overlay-solid-fallback, var(--ran-color-bg-elevated));box-shadow:var(--ran-surface-glass-overlay-solid-shadow, var(--ran-shadow-modal))}}:host-context([data-ran-surface="glass"]):host(:not([surface="solid"])) .ranui-dropdown{background:var(--ran-surface-glass-overlay-specular, linear-gradient(180deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .12) 24%, transparent 48%), linear-gradient(0deg, rgba(255, 255, 255, .22) 0%, transparent 30%), radial-gradient(120% 55% at 50% -8%, rgba(255, 255, 255, .28), transparent 58%)),var(--ran-surface-glass-overlay-fill, rgba(255, 255, 255, .48));-webkit-backdrop-filter:blur(var(--ran-surface-glass-overlay-blur, 18px)) saturate(var(--ran-surface-glass-saturate, 180%)) brightness(var(--ran-surface-glass-brightness, 1.08));backdrop-filter:blur(var(--ran-surface-glass-overlay-blur, 18px)) saturate(var(--ran-surface-glass-saturate, 180%)) brightness(var(--ran-surface-glass-brightness, 1.08));border-color:var(--ran-surface-glass-overlay-border, rgba(255, 255, 255, .72));box-shadow:var(--ran-surface-glass-overlay-shadow, 0 18px 48px rgba(0, 0, 0, .25), 0 0 0 .5px rgba(255, 255, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .4), inset 0 0 0 .5px rgba(255, 255, 255, .5), inset 0 -24px 48px rgba(255, 255, 255, .1))}@media(prefers-reduced-transparency:reduce){:host-context([data-ran-surface="glass"]):host(:not([surface="solid"])) .ranui-dropdown{-webkit-backdrop-filter:none;backdrop-filter:none;background:var(--ran-surface-glass-overlay-solid-fallback, var(--ran-color-bg-elevated));box-shadow:var(--ran-surface-glass-overlay-solid-shadow, var(--ran-shadow-modal))}}@media(prefers-reduced-motion:reduce){.ran-dropdown-down-in,.ran-dropdown-down-out,.ran-dropdown-up-in,.ran-dropdown-up-out,.ran-dropdown-left-in,.ran-dropdown-left-out,.ran-dropdown-right-in,.ran-dropdown-right-out{animation:none}}`;z(`r-dropdown`,class extends B{dropdown;_slot;_shadowDom;arrowIcon;container;static get observedAttributes(){return[`transit`,`arrow`,`sheet`,`surface`]}constructor(){super(),this._shadowDom=U(this,_t);let e=P(),t=P(),n=L().class(`ranui-dropdown-container`).children(L().style(`-webkit-tap-highlight-color`,`transparent`).style(`outline`,`0`).class(`ranui-dropdown`).ref(e).part(`dropdown`).children(R().class(`slot`).ref(t))).build();W(this._shadowDom,_t,n),this.container=n,this.dropdown=G(e,`ranui dropdown`),this._slot=G(t,`slot`)}get transit(){return K(this,`transit`)}set transit(e){q(this,`transit`,e,{removeEmpty:!0})}get arrow(){return K(this,`arrow`)}set arrow(e){q(this,`arrow`,e,{removeEmpty:!0})}get sheet(){return K(this,`sheet`)}set sheet(e){q(this,`sheet`,e)}get surface(){return K(this,`surface`)}set surface(e){q(this,`surface`,e,{removeEmpty:!0})}handlerExternalCss=()=>{ht(this,this._shadowDom,`sheet`,null,this.sheet)};appliedTransit=``;handlerTransit=()=>{this.container&&(this.appliedTransit&&a(this.container,this.appliedTransit),this.appliedTransit=this.transit,this.appliedTransit&&i(this.container,this.appliedTransit))};getAnimationTarget=()=>this.container;handlerArrow=()=>{let e=(this.arrow||``).trim();e?(!this.arrowIcon&&this.container&&(this.arrowIcon=L().class(`ranui-dropdown-arrow`).build(),this.arrowIcon.innerHTML=`<svg viewBox="0 0 16 16" preserveAspectRatio="none" aria-hidden="true" focusable="false"><path d="M 0 16 A 4 4 0 0 0 2.82842712474619 14.82842712474619 L 6.585786437626905 11.050252531694166 A 2 2 0 0 1 9.414213562373096 11.050252531694166 L 13.17157287525381 14.82842712474619 A 4 4 0 0 0 16 16 Z"/></svg>`,this.container.appendChild(this.arrowIcon)),this.arrowIcon&&(this.arrowIcon.className=`ranui-dropdown-arrow ${e}`)):(this.arrowIcon&&this.container.contains(this.arrowIcon)&&this.container.removeChild(this.arrowIcon),this.arrowIcon=void 0)};stopPropagation=e=>{e.stopPropagation()};connectedCallback(){this.handlerExternalCss(),this.handlerTransit(),this.handlerArrow()}disconnectedCallback(){}attributeChangedCallback(e,t,n){e===`transit`&&this.handlerTransit(),e===`arrow`&&this.handlerArrow(),e===`sheet`&&t!==n&&this.handlerExternalCss()}});var vt=`:host{display:var(--ran-popover-host-display, block)}:host(:focus-visible){outline:none;border-radius:var(--ran-radius-sm, 8px);box-shadow:var(--ran-focus-ring)}.ran-popover{box-sizing:var(--ran-popover-box-sizing, border-box);position:var(--ran-popover-position, relative);display:var(--ran-popover-display, block);margin:var(--ran-popover-margin, 0);padding:var(--ran-popover-padding, 0)}.ran-popover-block{display:var(--ran-popover-block-display, block)}`,yt=e=>e.getAnimationTarget?.()??e,bt=(e,t)=>{let n=yt(e);typeof n.getAnimations!=`function`||typeof requestAnimationFrame!=`function`?t():requestAnimationFrame(()=>{let e=n.getAnimations();e.length?(async()=>{await Promise.allSettled(e.map(e=>e.finished)),t()})():t()})},xt={bottom:{enter:`ran-dropdown-down-in`,exit:`ran-dropdown-down-out`},top:{enter:`ran-dropdown-up-in`,exit:`ran-dropdown-up-out`},left:{enter:`ran-dropdown-left-in`,exit:`ran-dropdown-left-out`},right:{enter:`ran-dropdown-right-in`,exit:`ran-dropdown-right-out`}},J=Symbol.for(`ranui.floating.panel-owner`),Y=Symbol.for(`ranui.floating.panel-escape`),X=Symbol.for(`ranui.floating.active-panels`),St=`ranui-floating-change`,Ct=`data-ran-floating`,wt=(e,t)=>{let n=new Set,r=e;for(;r&&!n.has(r);){if(r===t)return!0;n.add(r),r=r[J]??r.parentNode??(r instanceof ShadowRoot?r.host:null)}return!1},Tt=e=>[...e.ownerDocument[X]??[]].filter(t=>t.isConnected&&wt(t,e)),Et=(e,t)=>{Tt(e).at(-1)?.[Y]?.(t)},Z=(e,t,n)=>{let r=e.ownerDocument;t?(e[J]=t,e[Y]=n,(r[X]??=new Set).add(e)):(delete e[J],delete e[Y],r[X]?.delete(e)),r.dispatchEvent(new Event(St))},Dt=class{options;repositionBound=!1;outsideBinding=0;opened=!1;presence=null;repositionFrame=0;generation=0;resolvedSide;constructor(e){this.options=e}get isPositioned(){return this.presence===`open`}get floatingPresence(){return this.presence}get anchor(){return this.options.anchor?.()??this.options.host}setPresence(e,t){this.presence=t,t?e.setAttribute(Ct,t):e.removeAttribute(Ct),t===`placing`?(e.style.setProperty(`opacity`,`0`),e.style.setProperty(`pointer-events`,`none`)):(t===`open`||t===null)&&(e.style.removeProperty(`opacity`),e.style.removeProperty(`pointer-events`))}containsEvent(e){let t=this.options.panel();return e.composedPath().some(e=>{let n=e instanceof Node?e:null,r=new Set;for(;n&&!r.has(n);){if(n===this.options.host||n===t)return!0;r.add(n),n=n[J]??n.parentNode??(n instanceof ShadowRoot?n.host:null)}return!1})}bindOutside(e,t){let{host:n}=this.options,r=n.getRootNode(),i=n.ownerDocument,a=++this.outsideBinding,o=new WeakSet;r!==i&&e.on(r,`click`,e=>{o.add(e),this.opened&&!this.containsEvent(e)&&t(e)},{capture:!0}),e.on(i,`click`,e=>{if(!this.opened)return;let s=this.containsEvent(e),c=this.generation;r===i?s||t(e):setTimeout(()=>{a===this.outsideBinding&&c===this.generation&&n.isConnected&&this.opened&&!o.has(e)&&!s&&t(e)},0)},{capture:!0})}apply=e=>{let{host:t}=this.options;t.setAttribute(`aria-expanded`,e?`true`:`false`);let n=this.options.panel();if(!n||e===this.opened)return;this.opened=e;let r=++this.generation;e?(n.style.setProperty(`z-index`,`var(--ran-dropdown-host-z-index, var(--ran-z-dropdown, 1100))`),Z(n,t,this.options.onEscape),this.resolvedSide=void 0,t.dispatchEvent(new CustomEvent(`show`)),this.setPresence(n,`placing`),n.style.setProperty(`display`,`block`),this.attachReposition(),this.position(!0),bt(n,()=>{r===this.generation&&(n.removeAttribute(`transit`),t.dispatchEvent(new CustomEvent(`after-show`)))})):(Z(n),this.detachReposition(),t.dispatchEvent(new CustomEvent(`hide`)),this.setPresence(n,`closing`),n.setAttribute(`transit`,xt[this.resolvedSide??this.side()].exit),bt(n,()=>{r===this.generation&&(n.style.setProperty(`display`,`none`),this.setPresence(n,null),n.removeAttribute(`transit`),t.dispatchEvent(new CustomEvent(`after-hide`)))}))};side=()=>this.options.placement().split(`-`)[0];position=(e=!1)=>{let t=this.options.panel();if(!t)return;let n=this.generation;e&&t.offsetWidth;let r=this.options.panel();r===t&&(!e||this.opened&&n===this.generation)&&this.write(r,e)};write(e,t){let{offset:n=0,containerId:r,beforeMeasure:i,measurePanel:a,adjust:o,afterPosition:s}=this.options,c=this.anchor.getBoundingClientRect();i?.(c,e);let l=this.options.host.getRootNode(),u=r?.()??``,d=u?l.getElementById?.(u)??document.getElementById(u):null,f=e.getBoundingClientRect(),te=a?.(e),m=f,h=te?.width??f.width,g=te?.height??f.height,_=this.options.placement(),[v,y]=_.split(`-`),b=y??`start`,x,S,C=v;if(d){let e=d.getBoundingClientRect();C===`top`||C===`bottom`?(x=C===`bottom`?c.bottom-e.top+n:c.top-e.top-g-n,S=ee(b,c.left,c.width,h)-e.left):(x=ee(b,c.top,c.height,g)-e.top,S=C===`right`?c.right-e.left+n:c.left-e.left-h-n)}else{let e=p({anchor:{top:c.top,left:c.left,width:c.width,height:c.height},floating:{width:h,height:g},placement:_,offset:n});C=e.side,x=e.top+window.scrollY,S=e.left+window.scrollX}let w={top:x,left:S,side:C,align:b,anchorRect:c,panelRect:m,container:d},T=o?.(w,e);T&&(w.top=T.top,w.left=T.left),this.resolvedSide=w.side,e.style.setProperty(`position`,`absolute`),e.style.setProperty(`inset`,`${w.top}px auto auto ${w.left}px`),e.style.setProperty(`--ran-x`,`${w.left}px`),e.style.setProperty(`--ran-y`,`${w.top}px`),s?.(w,e),t&&e.setAttribute(`transit`,xt[w.side].enter),(t||this.presence===`placing`)&&this.setPresence(e,`open`)}scrollIsInsidePanel=e=>{let t=this.options.panel();if(!t)return!1;if(typeof e.composedPath==`function`&&e.composedPath().includes(t))return!0;let n=e.target;return n instanceof Node&&(n===t||t.contains(n))};reposition=e=>{this.opened&&!this.repositionFrame&&(e?.type===`scroll`&&this.scrollIsInsidePanel(e)||(typeof requestAnimationFrame==`function`?this.repositionFrame=requestAnimationFrame(()=>{this.repositionFrame=0,this.opened&&this.position()}):this.position()))};attachReposition(){this.repositionBound||typeof window>`u`||(window.addEventListener(`scroll`,this.reposition,!0),window.addEventListener(`resize`,this.reposition),this.repositionBound=!0)}detachReposition(){this.repositionBound&&typeof window<`u`&&(window.removeEventListener(`scroll`,this.reposition,!0),window.removeEventListener(`resize`,this.reposition),this.repositionBound=!1)}destroy=()=>{this.generation++,this.outsideBinding++,this.opened=!1;let e=this.options.panel();e?(Z(e),this.setPresence(e,null)):this.presence=null,this.repositionFrame&&typeof cancelAnimationFrame==`function`&&(cancelAnimationFrame(this.repositionFrame),this.repositionFrame=0),this.detachReposition()}};function Ot(e){return e.key===`Enter`||e.key===` `||e.key===`Spacebar`}var kt=8,At=300,Q=16,jt=`a[href], button, input:not([type="hidden"]), select, textarea, summary, [contenteditable]:not([contenteditable="false"]), [tabindex]`,Mt=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e}({}),Nt={top:`bottom`,bottom:`top`,left:`right`,right:`left`},$=class extends B{_events=new c;_slot;popoverBlock;popoverContent;popoverInner;popoverInnerBlock;_shadowDom;removeTimeId;_repositionBound=!1;_returnFocus;_floating=new Dt({onEscape:e=>this._dismissFromKeyboard(e),host:this,panel:()=>this.popoverContent,anchor:()=>Array.from(this.children).find(e=>e.tagName!==`R-CONTENT`)??this,placement:()=>this.placement,offset:kt,containerId:()=>this.getPopupContainerId,afterPosition:(e,t)=>{let{anchorRect:n,panelRect:r,side:i}=e,a=Nt[i];a&&t.setAttribute(`arrow`,a),t.style.setProperty(`--ran-dropdown-arrow-anchor-width`,`${n.width}px`),t.style.setProperty(`--ran-dropdown-arrow-anchor-height`,`${n.height}px`),t.style.setProperty(`--ran-dropdown-min-width`,`${r.width}px`),t.style.setProperty(`--ran-dropdown-min-height`,`${r.height}px`);let o=t.getBoundingClientRect(),s=n.left+n.width/2,c=o.left+o.width/2;t.style.setProperty(`--ran-dropdown-arrow-anchor-offset`,`${s-c}px`),t.style.setProperty(`--ran-dropdown-arrow-anchor-offset-y`,`${n.top-o.top}px`)}});static get observedAttributes(){return[`open`,`placement`,`trigger`,`sheet`]}closePopover=()=>{this.setDropdownDisplayNone()};constructor(){super(),this._shadowDom=U(this,vt);let e=P(),t=L().class(`ran-popover-block`).role(`tooltip`).children(R().class(`slot`).ref(e)).build();W(this._shadowDom,vt,t),this.popoverBlock=t,this._slot=G(e,`slot`)}get placement(){return K(this,`placement`,`top`)}set placement(e){q(this,`placement`,e)}get placementSide(){return this.placement.split(`-`)[0]}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}_applyOpen=()=>{this._floating.apply(this.open)};show=()=>{this.open=!0};hide=()=>{this.open=!1};toggle=()=>{this.open=!this.open};get trigger(){return K(this,`trigger`,`hover`)}set trigger(e){q(this,`trigger`,e)}get getPopupContainerId(){return K(this,`getPopupContainerId`)}set getPopupContainerId(e){q(this,`getPopupContainerId`,e)}get sheet(){return K(this,`sheet`)}set sheet(e){q(this,`sheet`,e)}handlerExternalCss=()=>{ht(this,this._shadowDom,`sheet`,null,this.sheet)};_ownsTabStop=!1;_hasFocusableTrigger=()=>Array.from(this.children).some(e=>e.tagName!==`R-CONTENT`&&[e,...Array.from(e.querySelectorAll(`*`))].some(e=>e instanceof HTMLElement&&(e.matches(jt)||e.localName.includes(`-`)&&e.focus!==HTMLElement.prototype.focus)));syncTabStop=()=>{if(this._ownsTabStop&&this.getAttribute(`tabindex`)!==`0`&&(this._ownsTabStop=!1),!this.hasAttribute(`tabindex`)||this._ownsTabStop){if(this._hasFocusableTrigger())this._ownsTabStop&&this.removeAttribute(`tabindex`),this._ownsTabStop=!1;else{this.tabIndex=0,this._ownsTabStop=!0;for(let e of Array.from(this.querySelectorAll(`:not(:defined)`)))customElements.whenDefined(e.localName).then(this.syncTabStop,()=>void 0)}}};initAria=()=>{this.syncTabStop(),this.setAttribute(`aria-haspopup`,`dialog`),this.setAttribute(`aria-expanded`,`false`)};updateAriaExpanded=e=>{this.setAttribute(`aria-expanded`,e?`true`:`false`)};stopPropagation=e=>{e.stopPropagation()};createContent=e=>{if(e){if(!this.popoverContent){let e=getComputedStyle(this).getPropertyValue(`--ran-popover-content-padding`).trim()||`12px`;this.popoverContent=ze(`r-dropdown`).class(`ran-popover-dropdown`).style(`display`,`none`).style(`position`,`absolute`).cssVar(`ran-dropdown-padding`,e).build(),this.popoverContent?.addEventListener(`click`,this.stopPropagation),this._events.on(this.popoverContent,`keydown`,this._dismissFromKeyboard);let t=L().children(this.popoverContent).build();this.popoverInner=t,this.trigger.includes(`hover`)&&!r()&&(this.popoverContent?.addEventListener(`mouseleave`,this.blur),this.popoverContent?.addEventListener(`mouseenter`,this.removeDropDownTimeId));let n=this.getRootNode();((n.getElementById?n.getElementById(this.getPopupContainerId):null)||document.getElementById(this.getPopupContainerId)||document.body).appendChild(t)}if(this.popoverContent&&e.length>0){this.popoverContent.innerHTML=``;let t=document.createDocumentFragment();for(let n of Array.from(e))t.appendChild(n);this.popoverContent.appendChild(t)}}};watchContent=e=>{let{value:t}=e.detail;this.createContent(t.content)};blur=t(()=>{this.removeTimeId&&this.removeDropDownTimeId(),this.removeTimeId=setTimeout(()=>{this.removeDropDownTimeId(),this.setDropdownDisplayNone()},At)},Q);removeDropDownTimeId=t(()=>{this.trigger.includes(`hover`)&&!r()&&(clearTimeout(this.removeTimeId),this.removeTimeId=void 0)},Q);setDropdownDisplayBlock=t(()=>{this.open=!0},Q);setDropdownDisplayNone=t(()=>{this.open=!1},Q);placementPosition=()=>{this._floating.position()};hoverPopover=e=>{e.stopPropagation(),e.preventDefault(),this.setDropdownDisplayBlock()};clickContent=e=>{e.stopPropagation()};clickPopover=e=>{e.stopPropagation(),e.preventDefault(),this.setDropdownDisplayBlock.cancel(),this.setDropdownDisplayNone.cancel(),this.blur.cancel(),clearTimeout(this.removeTimeId),this.removeTimeId=void 0;let t=!this.open;this.toggle(),t&&(this._returnFocus=e.composedPath().find(e=>e instanceof HTMLElement&&e!==this&&this.contains(e)&&e.tabIndex>=0)??Array.from(this.children).find(e=>e.tagName!==`R-CONTENT`)??this)};keydownPopover=e=>{e.defaultPrevented||e.isComposing||e.keyCode===229||(e.key===`Escape`?(this.setDropdownDisplayBlock.cancel(),this._dismissFromKeyboard(e)):Ot(e)&&(e.preventDefault(),this.setDropdownDisplayBlock()))};_dismissFromKeyboard=e=>{e.key!==`Escape`||e.defaultPrevented||e.isComposing||e.keyCode===229||!this.open||(Tt(this).some(e=>e!==this.popoverContent)?Et(this,e):(e.preventDefault(),e.stopPropagation(),this.setDropdownDisplayBlock.cancel(),this.setDropdownDisplayNone.cancel(),this.blur.cancel(),clearTimeout(this.removeTimeId),this.removeTimeId=void 0,this.hide(),this._returnFocus?.isConnected&&this._returnFocus.focus({preventScroll:!0,focusVisible:!0})))};clickRemovePopover=e=>{this.hoverRemovePopover(e)};popoverTrigger=()=>{this._events.abort();for(let e of this.children)e.tagName===`R-CONTENT`&&this._events.on(e,`change`,this.watchContent);this.trigger.includes(`hover`)&&!r()&&(this._events.on(this,`mouseenter`,this.hoverPopover),this._events.on(this,`mouseleave`,this.blur)),this._events.on(this,`click`,this.clickPopover).on(this,`keydown`,this.keydownPopover),this._events.on(this._slot,`slotchange`,this.syncTabStop),this._events.on(this,`show`,()=>{let e=this.getRootNode().activeElement;this._returnFocus=e instanceof HTMLElement&&(e===this||this.contains(e))?e:Array.from(this.children).find(e=>e.tagName!==`R-CONTENT`)??this}),this.popoverContent&&this._events.on(this.popoverContent,`keydown`,this._dismissFromKeyboard),this._floating.bindOutside(this._events,this.clickRemovePopover)};hoverRemovePopover=e=>{this._floating.containsEvent(e)||this.setDropdownDisplayNone()};changePlacement=t(()=>{if(!this.getPopupContainerId&&this.open)return;let e=Nt[this.placementSide];e&&this.popoverContent?.setAttribute(`arrow`,e)},Q);connectedCallback(){this.initAria(),this.handlerExternalCss();for(let e of this.children)e.tagName===`R-CONTENT`&&this.createContent(e.children);this.popoverTrigger(),this.changePlacement()}disconnectedCallback(){this._events.abort(),this.setDropdownDisplayBlock.cancel(),this.setDropdownDisplayNone.cancel(),this.blur.cancel(),this.removeDropDownTimeId.cancel(),this._floating.destroy(),clearTimeout(this.removeTimeId),this.removeTimeId=void 0;let e=Array.from(this.children).find(e=>e.tagName===`R-CONTENT`);e&&this.popoverContent&&e.append(...Array.from(this.popoverContent.childNodes)),this.popoverInner?.remove(),this.popoverInner=void 0,this.popoverContent=void 0}attributeChangedCallback(e,t,n){t!==n&&(e===`trigger`&&this.popoverTrigger(),e===`placement`&&this.changePlacement(),e===`sheet`&&this.handlerExternalCss(),e===`open`&&this._applyOpen())}};return z(`r-popover`,$),e.PLACEMENT_TYPE=Mt,e.Popover=$,e.default=$,e})({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ranui_progress=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=(e,t=0,n=1)=>Math.min(n,Math.max(t,e)),n=/["'&<>]/;function r(e){let t=``+e,r=n.exec(t);if(!r)return t;let i,a=``,o=0,s=0;for(o=r.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:i=`"`;break;case 38:i=`&`;break;case 39:i=`'`;break;case 60:i=`<`;break;case 62:i=`>`;break;default:continue}s!==o&&(a+=t.substring(s,o)),s=o+1,a+=i}return s===o?a:a+t.substring(s,o)}var i=class{ac=null;get signal(){return this.ac??=new AbortController,this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},a=new Map,o=`data-adopted-style`,s=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},ee=(e,t,n=o)=>{if(t){if(typeof document>`u`){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t);return}if(!s(e,t,a)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}}},c=`:host{display:block;width:var(--ran-progress-width, 100%);height:var(--ran-progress-height, var(--ran-size-3, 20px))}:host:active,:host:focus{outline:0;-webkit-tap-highlight-color:transparent}:host(:focus-visible){outline:var(--ran-progress-focus-outline, 2px solid var(--ran-color-focus, #0a6cff));outline-offset:var(--ran-progress-focus-outline-offset, 2px);border-radius:var(--ran-radius-full, 9999px)}.ran-progress{position:var(--ran-progress-position, relative);cursor:var(--ran-progress-cursor, pointer);width:var(--ran-progress-width, 100%);height:100%}.ran-progress:active,.ran-progress:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-progress-wrap{width:var(--ran-progress-track-width, 100%);height:var(--ran-progress-track-height, 8px);border-radius:var(--ran-progress-track-border-radius, var(--ran-radius-full, 9999px));background:var(--ran-progress-track-background, var(--ran-gray-200, #ebebee));position:var(--ran-progress-track-position, absolute);top:var(--ran-progress-track-top, 50%);left:var(--ran-progress-track-left, 0);transform:var(--ran-progress-track-transform, translateY(-50%));overflow:var(--ran-progress-track-overflow, hidden)}.ran-progress-wrap-value{position:var(--ran-progress-fill-position, absolute);top:var(--ran-progress-fill-top, 0);left:var(--ran-progress-fill-left, 0);height:var(--ran-progress-fill-height, 100%);width:var(--ran-progress-fill-width, 100%);transform:scaleX(var(--progress-percent, 0));transform-origin:var(--ran-progress-fill-transform-origin, 0 0);will-change:var(--ran-progress-fill-will-change, transform);background:var(--ran-progress-fill-background, var(--ran-color-primary, #111113));border-radius:var(--ran-progress-fill-border-radius, var(--ran-radius-full, 9999px))}.ran-progress-dot{position:var(--ran-progress-dot-position, absolute);top:var(--ran-progress-dot-top, 50%);left:calc(var(--progress-percent, 0) * 100%);transform:var(--ran-progress-dot-transform, translate(-50%, -50%));border-radius:var(--ran-progress-dot-border-radius, 50%);box-sizing:border-box;width:var(--ran-progress-dot-width, 14px);height:var(--ran-progress-dot-height, 14px);background:var(--ran-progress-dot-background, var(--ran-color-primary, #111113));border:var(--ran-progress-dot-border, 2px solid var(--ran-color-bg-elevated, #ffffff));box-shadow:var(--ran-progress-dot-box-shadow, var(--ran-shadow-elevated, 0 1px 2px rgba(0, 0, 0, .15)));cursor:var(--ran-progress-dot-cursor, pointer);touch-action:none}`,l=typeof document>`u`,u=0,d=1,f=2,p=null,m=null,h=0,g=new Set,_=!1;function v(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(re(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)C(e,f);h===0&&ie()}}]}function y(e){let t=te(e,!0);return ne(t),T(t),()=>D(t)}function b(e){let t=p;p=null;try{return e()}finally{p=t}}function x(e){let t={owned:[],cleanups:[],owner:m},n=m,r=p;m=t,p=null;try{return e(()=>ae(t))}finally{m=n,p=r}}function S(e){m&&m.cleanups.push(e)}function te(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:f,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:m}}function ne(e){m&&m.owned.push(e)}function re(e){p&&(p.sources.add(e),e.observers.add(p))}function C(e,t){if(e.disposed||e.state>=t)return;let n=e.state===u;if(e.state=t,e.isEffect)g.add(e);else if(n)for(let t of e.observers)C(t,d)}function ie(){if(!(h>0||_)){_=!0;try{for(;g.size>0;){let e=[...g];g.clear();for(let t of e)t.disposed||w(t)}}finally{_=!1}}}function w(e){if(!(e.disposed||e.state===u)){if(e.state===d)for(let t of e.sources)`fn`in t&&w(t);e.state===f&&T(e),e.state=u}}function T(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);E(e);let t=p,n=m;p=e,m=e,e.running=!0,e.state=u;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)C(t,f)}}finally{e.running=!1,p=t,m=n}}function E(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function D(e){e.disposed||(e.disposed=!0,E(e),e.observers.clear())}function ae(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function O(e){return r(e)}var oe=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,se=`.#[`;function ce(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n<e.length;){let r=e[n];if(r===`[`){let r=e.indexOf(`]`,n+1);if(r===-1)return null;t.push(e.slice(n,r+1)),n=r+1;continue}if(r!==`.`&&r!==`#`)return null;let i=n+1;for(;i<e.length&&!se.includes(e[i]);)i+=1;if(i===n+1)return null;t.push(e.slice(n,i)),n=i}return t.length>0?t:null}var le=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},ue=(e,t)=>{let n=t.trim();if(!n)return!1;let r=ce(n);return r!==null&&r.every(t=>le(e,t))},k=(e,t,n)=>{for(let r of e)oe(r)&&(ue(r,t)&&n.push(r),k(r.childrenList,t,n))};function A(e,t,n){if(n==null)return e.push(t),t;let r=e.indexOf(n);return r===-1?e.push(t):e.splice(r,0,t),t}var j=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return A(this.childrenList,e,t)}serialize(){return this.childrenList.map(e=>typeof e==`string`?r(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return k(this.childrenList,e,t),t}},de=new Map,M=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??de}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:r(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new j)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return A(this.childrenList,e,t)}attachShadow(e){return this.shadowRoot=new fe(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return k(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName;this.shadowRoot&&!this.hasAttribute(`data-ran-dsd`)&&this.setAttribute(`data-ran-dsd`,``);let n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${O(t)}"`).join(``),i=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=i?` style="${O(i)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof j,e.serialize())).join(``):o+=r(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}</${t}>`}},fe=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}get children(){return this.childrenList.filter(e=>typeof e!=`string`&&!(e instanceof j))}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return A(this.childrenList,e,t)}replaceChildren(...e){this.childrenList=e.filter(e=>e!=null)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return k(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${String(e).replace(/<\/style/gi,`<\\/style`)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof j,e.serialize())).join(``)}</template>`}},N={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let n of t){if(n==null)continue;if(Array.isArray(n)){N.append(e,n);continue}if(typeof n==`function`){N.append(e,[n()]);continue}if(typeof n==`object`&&(`__ranFor`in n||`__ranIndex`in n))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=n instanceof P?n.build():typeof n==`string`&&!l?document.createTextNode(n):n;e.appendChild(t)}}},pe=`http://www.w3.org/2000/svg`,me=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),P=class{runtime;el;constructor(e,t,n=N){this.runtime=n;let r=t??(me.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=l?new M(e):r?document.createElementNS(r,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{l?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(l){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new he(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(l)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},he=class{runtime;root;hostEl;constructor(e,t,n,r=N){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(l)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return l?this.root.serialize():this.root.innerHTML}},F=()=>({current:null}),I=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(I(t)):e.concat(t),[]),L=e=>e==null?null:e instanceof P?e.build():typeof e==`string`?l?e:document.createTextNode(e):e,ge=(e,t)=>{if(l){z(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};y(()=>{let e=t();a();let n=document.createDocumentFragment();i=x(t=>(z(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),S(()=>i?.())},_e=`__ranFor`,ve=e=>typeof e==`object`&&!!e&&e[_e]===!0,ye=(e,t,n)=>{let[r,i]=v(t),a=null,o=x(t=>{let i=L(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},R=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},be=(e,t)=>{if(l){(t.each()??[]).forEach((n,r)=>{let i=L(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;S(()=>{for(let e of r.values())e.dispose();r.clear()}),y(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o)){Te()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=r.get(o);s?(r.delete(o),s.index(n)):s=ye(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();R(n,a),r=i})},xe=`__ranIndex`,Se=e=>typeof e==`object`&&!!e&&e[xe]===!0,Ce=(e,t,n)=>{let[r,i]=v(e),a=null,o=x(e=>{let i=L(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},we=(e,t)=>{if(l){(t.each()??[]).forEach((n,r)=>{let i=L(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];S(()=>{for(let e of r)e.dispose();r=[]}),y(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<r.length?r[n].setItem(e[n]):r.push(Ce(e[n],n,t.render));for(let t=r.length-1;t>=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}R(n,r.map(e=>e.node).filter(e=>e!=null))})},z=(e,t)=>{l?b(()=>B(e,t)):B(e,t)},B=(e,t)=>{I(t).forEach(t=>{if(ve(t)){be(e,t);return}if(Se(t)){we(e,t);return}if(typeof t==`function`){ge(e,t);return}let n=L(t);n!=null&&e.appendChild(n)})},Te=()=>!1,Ee={bind(e,t){typeof e==`function`?l?b(()=>t(e())):y(()=>t(e())):t(e)},append:z},De=class extends P{constructor(e,t){super(e,t,Ee)}};function Oe(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,pe),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:ke,Div:V,Svg:Ae,Span:je,Slot:Me,ButtonBuilder:Ne,InputBuilder:Pe,Style:Fe,Label:Ie,Ul:Le,Li:Re,Section:ze,Article:Be,Nav:Ve,Header:He,Footer:Ue,Main:We,DeclarativeShadow:Ge}=Oe(De),Ke=new Map;function qe(e,t){l?(Ke.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Je=typeof document<`u`?HTMLElement:M,Ye=`data-ranui`,H=`data-ranui-sheet`,U=(e,t)=>{if(typeof document>`u`&&t){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t)}ee(e,t,Ye)},W=new WeakMap,G=new Map,Xe=e=>{if(typeof CSSStyleSheet>`u`)return;let t=G.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},G.set(e,t)}catch{return}return t.users++,t.sheet},K=e=>{let t=G.get(e);t&&--t.users===0&&G.delete(e)},Ze=(e,t)=>{if(typeof document>`u`)return;let n=W.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),K(n.text)):n&&e.querySelector(`style[${H}]`)?.remove(),W.delete(e),!t))return;let r=Xe(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{K(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(H,``),n.textContent=t,e.appendChild(n)}W.set(e,{text:t,sheet:r})},q=new WeakMap,J=new WeakMap,Qe=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,$e=`:host([hidden]){display:none}`,Y=new Map,X=e=>{let t=Y.get(e);if(t!==void 0)return t;let n=`${$e}\n${Qe}`,r=e?`${e}\n${n}`:n;return Y.set(e,r),r},et=e=>{let t=J.get(e);if(t)return t;try{let t=e.attachInternals;if(typeof t!=`function`)return;let n=t.call(e);return J.set(e,n),n}catch{return}},tt=(e,t=``,n={mode:`closed`},r)=>{let i=r??et(e),a=e.shadowRoot||q.get(e)||i?.shadowRoot||e.attachShadow(n);return q.set(e,a),U(a,X(t)),a},nt=(e,t,...n)=>{e.replaceChildren(...n),U(e,X(t))},Z=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},rt=(e,t,n=``)=>e.getAttribute(t)??n,it=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},at=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&Ze(t,e.getAttribute(`sheet`)||``)};function ot(e,t){let{current:n,min:r,max:i,step:a=1,coarseStep:o=a*10}=t,s=e.shiftKey?o:a;switch(e.key){case`ArrowRight`:case`ArrowUp`:return Math.min(i,n+s);case`ArrowLeft`:case`ArrowDown`:return Math.max(r,n-s);case`Home`:return r;case`End`:return i;default:return}}var st=[`percent`,`type`,`total`,`dot`,`sheet`],Q=e=>{let t=(e??``).trim();return t?t.endsWith(`%`)?Number(t.slice(0,-1)):Number(t):0},$=class extends Je{_progress;_progressWrap;_progressWrapValue;_progressDot;_shadowDom;_events=new i;_dragEvents=new i;moveProgress={mouseDown:!1};_tabIndexOwnedByComponent=!1;static get observedAttributes(){return st}constructor(){super(),this._shadowDom=tt(this,c);let e=F(),t=F(),n=F(),r=V().class(`ran-progress`).children(V().class(`ran-progress-wrap`).ref(e).part(`track`).children(V().class(`ran-progress-wrap-value`).ref(t).part(`fill`)),V().class(`ran-progress-dot`).ref(n).part(`dot`)).build();nt(this._shadowDom,c,r),this._progress=r,this._progressWrap=Z(e,`wrap`),this._progressWrapValue=Z(t,`wrap value`),this._progressDot=Z(n,`dot`)}get percent(){let e=Q(this.getAttribute(`percent`));return String(t(Number.isFinite(e)?e:0,0,Number(this.total)))}set percent(e){this.setAttribute(`percent`,e||`0`),this.setAttribute(`aria-valuenow`,this.percent)}get total(){let e=this.getAttribute(`total`);if(!e)return`100`;let t=Q(e);return String(Number.isFinite(t)&&t>=0?t:100)}set total(e){this.setAttribute(`total`,e||`100`)}get type(){let e=this.getAttribute(`type`)||`primary`;return[`primary`,`drag`].includes(e)?e:`primary`}set type(e){this.setAttribute(`type`,e||`primary`)}get dot(){let e=this.getAttribute(`dot`)||`true`;return[`true`,`false`].includes(e)?e:`true`}set dot(e){this.setAttribute(`dot`,e||`true`)}get sheet(){return rt(this,`sheet`)}set sheet(e){it(this,`sheet`,e)}handlerExternalCss=()=>{at(this,this._shadowDom,`sheet`,null,this.sheet)};progressClick=e=>{if(this.type!==`drag`)return;let n=this._progress.getBoundingClientRect(),r=t((e.clientX-n.left)/this._progress.offsetWidth,0,1),i=r*Number(this.total);this.percent=String(i),this.updateUI(r),this.change()};progressDotMouseDown=e=>{e.preventDefault(),this.moveProgress.mouseDown=!0,e.stopPropagation(),this._dragEvents.on(document,`pointermove`,this.progressDotMouseMove).on(document,`pointerup`,this.progressDotMouseUp).on(document,`pointercancel`,this.progressDotMouseUp)};progressDotMouseMove=e=>{if(!this.moveProgress.mouseDown||this.type!==`drag`)return;let n=this._progress.getBoundingClientRect(),r=t((e.clientX-n.left)/this._progress.offsetWidth,0,1),i=r*Number(this.total);this.percent=String(i),this.updateUI(r),this.change()};progressDotMouseUp=()=>{this.moveProgress.mouseDown=!1,this._dragEvents.abort()};progressKeydown=e=>{if(this.type!==`drag`)return;let t=Number(this.total),n=ot(e,{current:Number(this.percent),min:0,max:t,step:t/100});n!==void 0&&(e.preventDefault(),this.percent=String(n),this.updateUI(n/t),this.change())};syncA11y=()=>{let e=this.type===`drag`;this.setAttribute(`role`,e?`slider`:`progressbar`),this.setAttribute(`aria-valuemin`,`0`),this.setAttribute(`aria-valuemax`,this.total),this.setAttribute(`aria-valuenow`,this.percent),e?this.hasAttribute(`tabindex`)||(this.tabIndex=0,this._tabIndexOwnedByComponent=!0):this._tabIndexOwnedByComponent&&=(this.removeAttribute(`tabindex`),!1)};updateUI=e=>{this.style.setProperty(`--progress-percent`,String(t(Number.isFinite(e)?e:0,0,1)))};_preSerialize(){this.updateCurrentProgress()}change=()=>{this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.percent,percent:this.percent,total:this.total}}))};appendProgressDot=()=>{if(!this._progress||!this._progressDot)return;let e=this.dot===`true`&&this.type===`drag`;e&&!this._progress.contains(this._progressDot)&&this._progress.appendChild(this._progressDot),!e&&this._progress.contains(this._progressDot)&&this._progress.removeChild(this._progressDot)};updateCurrentProgress=()=>{if(!this._progress)return;let e=Number(this.total),t=e>0?Number(this.percent)/e:0;this.updateUI(t)};dragEvent=()=>{this._events.on(this._progress,`click`,this.progressClick).on(this._progressDot,`pointerdown`,this.progressDotMouseDown).on(this,`keydown`,this.progressKeydown)};resize=()=>{this.updateCurrentProgress()};connectedCallback(){this.handlerExternalCss(),this.hasAttribute(`type`)||this.setAttribute(`type`,`primary`),this.dragEvent(),this.updateCurrentProgress(),this.appendProgressDot(),this.syncA11y(),this._events.on(window,`resize`,this.resize)}disconnectedCallback(){this._events.abort(),this._dragEvents.abort()}attributeChangedCallback(e,t,n){t!==n&&((e===`dot`||e===`type`)&&this.appendProgressDot(),(e===`percent`||e===`total`)&&this.updateCurrentProgress(),(e===`type`||e===`total`||e===`percent`)&&this.syncA11y(),e===`sheet`&&this.handlerExternalCss())}};return qe(`r-progress`,$),e.Progress=$,e.default=$,e})({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ranui_radar=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=e=>{let t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||1;return((typeof window>`u`?1:window.devicePixelRatio)||1)/t},n=(e,t)=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return t(!1),()=>{};let n=window.matchMedia(e),r=()=>t(n.matches);if(r(),typeof n.addEventListener==`function`)return n.addEventListener(`change`,r),()=>n.removeEventListener(`change`,r);let i=n;return i.addListener(r),()=>i.removeListener(r)},r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:i=`"`;break;case 38:i=`&`;break;case 39:i=`'`;break;case 60:i=`<`;break;case 62:i=`>`;break;default:continue}s!==o&&(a+=t.substring(s,o)),s=o+1,a+=i}return s===o?a:a+t.substring(s,o)}var a=(e,...[t,n,r,i,a])=>{let o=Math.min(r,i),s=Math.PI;a>o/2&&(a=o/2),e.beginPath(),e.moveTo(t+a,n),e.lineTo(t+a,n),e.lineTo(t+r-a,n),e.arc(t+r-a,n+a,a,-s/2,0),e.lineTo(t+r,n+i-a),e.arc(t+r-a,n+i-a,a,0,s/2),e.lineTo(t+a,n+i),e.arc(t+a,n+i-a,a,s/2,s),e.lineTo(t,n+a),e.arc(t+a,n+a,a,s,-s/2),e.closePath()},o=new Map,s=`data-adopted-style`,c=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},l=(e,t,n=s)=>{if(t){if(typeof document>`u`){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t);return}if(!c(e,t,o)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}}},u=`:host{--ran-radar-polygon-color: var(--ran-color-border);--ran-radar-line-color: var(--ran-color-border);--ran-radar-fill-color: color-mix(in srgb, var(--ran-color-primary) 16%, transparent);--ran-radar-stroke-color: var(--ran-color-primary)}.ran-radar{position:var(--ran-radar-position, relative);width:var(--ran-radar-width, 100%);height:var(--ran-radar-height, 100%);display:var(--ran-radar-display, block)}.ran-radar canvas{width:100%;height:100%}`,d=typeof document>`u`,f=0,p=1,m=2,h=null,g=null,_=0,v=new Set,y=!1;function b(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ne(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)T(e,m);_===0&&re()}}]}function x(e){let t=ee(e,!0);return te(t),D(t),()=>k(t)}function S(e){let t=h;h=null;try{return e()}finally{h=t}}function C(e){let t={owned:[],cleanups:[],owner:g},n=g,r=h;g=t,h=null;try{return e(()=>ie(t))}finally{g=n,h=r}}function w(e){g&&g.cleanups.push(e)}function ee(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:m,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:g}}function te(e){g&&g.owned.push(e)}function ne(e){h&&(h.sources.add(e),e.observers.add(h))}function T(e,t){if(e.disposed||e.state>=t)return;let n=e.state===f;if(e.state=t,e.isEffect)v.add(e);else if(n)for(let t of e.observers)T(t,p)}function re(){if(!(_>0||y)){y=!0;try{for(;v.size>0;){let e=[...v];v.clear();for(let t of e)t.disposed||E(t)}}finally{y=!1}}}function E(e){if(!(e.disposed||e.state===f)){if(e.state===p)for(let t of e.sources)`fn`in t&&E(t);e.state===m&&D(e),e.state=f}}function D(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);O(e);let t=h,n=g;h=e,g=e,e.running=!0,e.state=f;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)T(t,m)}}finally{e.running=!1,h=t,g=n}}function O(e){for(let t of e.owned)k(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function k(e){e.disposed||(e.disposed=!0,O(e),e.observers.clear())}function ie(e){for(let t of e.owned)k(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function A(e){return i(e)}var ae=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,oe=`.#[`;function se(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n<e.length;){let r=e[n];if(r===`[`){let r=e.indexOf(`]`,n+1);if(r===-1)return null;t.push(e.slice(n,r+1)),n=r+1;continue}if(r!==`.`&&r!==`#`)return null;let i=n+1;for(;i<e.length&&!oe.includes(e[i]);)i+=1;if(i===n+1)return null;t.push(e.slice(n,i)),n=i}return t.length>0?t:null}var ce=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},le=(e,t)=>{let n=t.trim();if(!n)return!1;let r=se(n);return r!==null&&r.every(t=>ce(e,t))},j=(e,t,n)=>{for(let r of e)ae(r)&&(le(r,t)&&n.push(r),j(r.childrenList,t,n))};function M(e,t,n){if(n==null)return e.push(t),t;let r=e.indexOf(n);return r===-1?e.push(t):e.splice(r,0,t),t}var N=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return M(this.childrenList,e,t)}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return j(this.childrenList,e,t),t}},ue=new Map,P=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??ue}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new N)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return M(this.childrenList,e,t)}attachShadow(e){return this.shadowRoot=new de(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return j(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName;this.shadowRoot&&!this.hasAttribute(`data-ran-dsd`)&&this.setAttribute(`data-ran-dsd`,``);let n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${A(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${A(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof N,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}</${t}>`}},de=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}get children(){return this.childrenList.filter(e=>typeof e!=`string`&&!(e instanceof N))}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return M(this.childrenList,e,t)}replaceChildren(...e){this.childrenList=e.filter(e=>e!=null)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return j(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${String(e).replace(/<\/style/gi,`<\\/style`)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof N,e.serialize())).join(``)}</template>`}},F={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let n of t){if(n==null)continue;if(Array.isArray(n)){F.append(e,n);continue}if(typeof n==`function`){F.append(e,[n()]);continue}if(typeof n==`object`&&(`__ranFor`in n||`__ranIndex`in n))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=n instanceof I?n.build():typeof n==`string`&&!d?document.createTextNode(n):n;e.appendChild(t)}}},fe=`http://www.w3.org/2000/svg`,pe=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),I=class{runtime;el;constructor(e,t,n=F){this.runtime=n;let r=t??(pe.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=d?new P(e):r?document.createElementNS(r,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{d?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(d){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new me(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(d)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},me=class{runtime;root;hostEl;constructor(e,t,n,r=F){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(d)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return d?this.root.serialize():this.root.innerHTML}},he=()=>({current:null}),L=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(L(t)):e.concat(t),[]),R=e=>e==null?null:e instanceof I?e.build():typeof e==`string`?d?e:document.createTextNode(e):e,ge=(e,t)=>{if(d){B(e,[t()]);return}let n=document.createComment(``),r=document.createComment(``);e.appendChild(n),e.appendChild(r);let i=null,a=()=>{i?.(),i=null;let e=n.nextSibling;for(;e&&e!==r;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};x(()=>{let e=t();a();let n=document.createDocumentFragment();i=C(t=>(B(n,[e]),t)),r.parentNode?.insertBefore(n,r)}),w(()=>i?.())},_e=`__ranFor`,ve=e=>typeof e==`object`&&!!e&&e[_e]===!0,ye=(e,t,n)=>{let[r,i]=b(t),a=null,o=C(t=>{let i=R(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},z=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},be=(e,t)=>{if(d){(t.each()??[]).forEach((n,r)=>{let i=R(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=new Map;w(()=>{for(let e of r.values())e.dispose();r.clear()}),x(()=>{let e=t.each()??[],i=new Map,a=[];e.forEach((e,n)=>{let o=t.key(e,n);if(i.has(o)){Te()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=r.get(o);s?(r.delete(o),s.index(n)):s=ye(e,n,t.render),i.set(o,s),s.node&&a.push(s.node)});for(let e of r.values())e.node?.parentNode?.removeChild(e.node),e.dispose();z(n,a),r=i})},xe=`__ranIndex`,Se=e=>typeof e==`object`&&!!e&&e[xe]===!0,Ce=(e,t,n)=>{let[r,i]=b(e),a=null,o=C(e=>{let i=R(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},we=(e,t)=>{if(d){(t.each()??[]).forEach((n,r)=>{let i=R(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let n=document.createComment(``);e.appendChild(n);let r=[];w(()=>{for(let e of r)e.dispose();r=[]}),x(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<r.length?r[n].setItem(e[n]):r.push(Ce(e[n],n,t.render));for(let t=r.length-1;t>=e.length;t--){let{node:e}=r[t];e?.parentNode?.removeChild(e),r[t].dispose(),r.pop()}z(n,r.map(e=>e.node).filter(e=>e!=null))})},B=(e,t)=>{d?S(()=>V(e,t)):V(e,t)},V=(e,t)=>{L(t).forEach(t=>{if(ve(t)){be(e,t);return}if(Se(t)){we(e,t);return}if(typeof t==`function`){ge(e,t);return}let n=R(t);n!=null&&e.appendChild(n)})},Te=()=>!1,Ee={bind(e,t){typeof e==`function`?d?S(()=>t(e())):x(()=>t(e())):t(e)},append:B},De=class extends I{constructor(e,t){super(e,t,Ee)}};function Oe(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,fe),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:ke,Div:Ae,Svg:je,Span:Me,Slot:Ne,ButtonBuilder:Pe,InputBuilder:Fe,Style:Ie,Label:Le,Ul:Re,Li:ze,Section:Be,Article:Ve,Nav:He,Header:Ue,Footer:We,Main:Ge,DeclarativeShadow:Ke}=Oe(De),qe=new Map;function Je(e,t){d?(qe.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ye=typeof document<`u`?HTMLElement:P,Xe=`data-ranui`,H=`data-ranui-sheet`,U=(e,t)=>{if(typeof document>`u`&&t){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t)}l(e,t,Xe)},W=new WeakMap,G=new Map,Ze=e=>{if(typeof CSSStyleSheet>`u`)return;let t=G.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},G.set(e,t)}catch{return}return t.users++,t.sheet},K=e=>{let t=G.get(e);t&&--t.users===0&&G.delete(e)},Qe=(e,t)=>{if(typeof document>`u`)return;let n=W.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),K(n.text)):n&&e.querySelector(`style[${H}]`)?.remove(),W.delete(e),!t))return;let r=Ze(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{K(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(H,``),n.textContent=t,e.appendChild(n)}W.set(e,{text:t,sheet:r})},q=new WeakMap,J=new WeakMap,$e=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,et=`:host([hidden]){display:none}`,Y=new Map,X=e=>{let t=Y.get(e);if(t!==void 0)return t;let n=`${et}\n${$e}`,r=e?`${e}\n${n}`:n;return Y.set(e,r),r},tt=e=>{let t=J.get(e);if(t)return t;try{let t=e.attachInternals;if(typeof t!=`function`)return;let n=t.call(e);return J.set(e,n),n}catch{return}},nt=(e,t=``,n={mode:`closed`},r)=>{let i=r??tt(e),a=e.shadowRoot||q.get(e)||i?.shadowRoot||e.attachShadow(n);return q.set(e,a),U(a,X(t)),a},rt=(e,t,...n)=>{e.replaceChildren(...n),U(e,X(t))},it=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},at=(e,t,n=``)=>e.getAttribute(t)??n,ot=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},st=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&Qe(t,e.getAttribute(`sheet`)||``)},ct=[`class`,`data-ran-theme`,`theme`],Z=new Set,Q=null,lt=e=>typeof document>`u`||typeof MutationObserver>`u`?()=>{}:(Z.add(e),Q||(Q=new MutationObserver(e=>{let t=new Set(e.map(e=>e.attributeName??``));for(let e of Array.from(Z))e(t)}),Q.observe(document.documentElement,{attributes:!0,attributeFilter:[...ct,`style`]})),()=>{Z.delete(e),Z.size||(Q?.disconnect(),Q=null)}),ut=`rgba(0,0,0,0)`,dt=`rgba(0,0,0,1)`,ft=`rgba(0,0,0,0.12)`,pt=`rgba(0,0,0,0.12)`,mt=`sans-serif`,ht=`rgba(0,0,0,0.16)`,gt=`rgba(0,0,0,1)`,$=class extends Ye{mData;mCount;mW;mCenter;mRadius;mAngle;static get observedAttributes(){return[`abilitys`,`colorpolygon`,`colorline`,`fillcolor`,`strokecolor`,`sheet`]}abilityRadarChartContainer;abilityRadarChart;_iconElement;_shadowDom;resizeObserver;_detachDocumentTheme;_detachThemeMedia;_frame=0;_cssCache;constructor(){super(),this._shadowDom=nt(this,u);let e=he(),t=Ae().class(`ran-radar`).children(ke(`canvas`).ref(e).build()).build();rt(this._shadowDom,u,t);let n=it(e,`canvas`);this.abilityRadarChartContainer=t,this.abilityRadarChart=n,this.resizeObserver=new ResizeObserver(this.resize)}resize=()=>{this.scheduleRefresh()};scheduleRefresh=()=>{this._frame||(typeof requestAnimationFrame>`u`?this.refreshData():this._frame=requestAnimationFrame(()=>{this._frame=0,this.refreshData()}))};get abilitys(){let e=this.getAttribute(`abilitys`);if(typeof e==`string`)try{return JSON.parse(e)}catch(t){return console.error(`Failed to parse the rule in JSON.parse: ${e}, error: ${t}`),e}return e}set abilitys(e){typeof e==`string`?this.setAttribute(`abilitys`,e||``):this.setAttribute(`abilitys`,JSON.stringify(e)||``)}_cssVar(e){if(typeof getComputedStyle>`u`)return``;let t=this._cssCache?.get(e);if(t!==void 0)return t;let n=getComputedStyle(this).getPropertyValue(e).trim();return this._cssCache?.set(e,n),n}get colorPolygon(){return this.getAttribute(`colorPolygon`)||this._cssVar(`--ran-radar-polygon-color`)||ft}set colorPolygon(e){this.setAttribute(`colorPolygon`,e||ft)}get colorLine(){return this.getAttribute(`colorLine`)||this._cssVar(`--ran-radar-line-color`)||pt}set colorLine(e){this.setAttribute(`colorLine`,e||pt)}get fontColor(){return this._cssVar(`--ran-color-text`)||dt}get fillColor(){return this.getAttribute(`fillColor`)||this._cssVar(`--ran-radar-fill-color`)||ht}set fillColor(e){this.setAttribute(`fillColor`,e||ht)}get strokeColor(){return this.getAttribute(`strokeColor`)||this._cssVar(`--ran-radar-stroke-color`)||gt}set strokeColor(e){this.setAttribute(`strokeColor`,e||gt)}get sheet(){return at(this,`sheet`)}set sheet(e){ot(this,`sheet`,e)}handlerExternalCss=()=>{st(this,this._shadowDom,`sheet`,null,this.sheet)};refreshData(){this._cssCache=new Map;try{this.draw()}finally{this._cssCache=void 0}}draw(){let e=this.abilityRadarChart.getContext(`2d`);if(!this.abilityRadarChartContainer||!e)return;let n=t(e),r=this.abilityRadarChartContainer.clientWidth*n,i=this.abilityRadarChartContainer.clientHeight*n;this.abilityRadarChart.width=r,this.abilityRadarChart.height=i;let a=Math.min(r,i);e.translate((r-a)/2,(i-a)/2),this.mW=a,this.mData=this.abilitys,this.mCount=this.mData?.length||1,this.mCenter=this.mW/2,this.mRadius=Math.max(0,this.mCenter-50*n),this.mAngle=Math.PI*2/this.mCount,this.drawPolygon(e),this.drawSide(e),this.drawLines(e),this.drawText(e),this.drawRegion(e),this.drawCircle(e)}drawSide(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)return;e.save(),e.beginPath(),e.strokeStyle=this.colorLine;let t=this.mRadius;for(let n=0;n<this.mCount;n++){let r=this.mCenter+t*Math.sin(this.mAngle*n),i=this.mCenter+t*Math.cos(this.mAngle*n);e.lineTo(r,i)}e.closePath(),e.stroke(),e.restore()}drawPolygon(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)return;e.save(),e.strokeStyle=this.colorPolygon;let t=this.mRadius/4;e.setLineDash([6,6]);for(let n=0;n<4;n++){e.beginPath();let r=t*(n+1);for(let t=0;t<this.mCount;t++){let n=this.mCenter+r*Math.sin(this.mAngle*t),i=this.mCenter+r*Math.cos(this.mAngle*t);e.lineTo(n,i)}e.closePath(),e.stroke()}e.restore()}drawLines(e){if(this.mRadius&&this.mCount&&this.mCenter&&this.mAngle){e.save(),e.beginPath(),e.strokeStyle=this.colorLine;for(let t=0;t<this.mCount;t++){let n=this.mCenter+this.mRadius*Math.sin(this.mAngle*t),r=this.mCenter+this.mRadius*Math.cos(this.mAngle*t);e.moveTo(this.mCenter,this.mCenter),e.lineTo(n,r)}e.stroke(),e.restore()}}drawText(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;e.save();let n=t(e),r=Number.parseFloat(this._cssVar(`--ran-text-label-3`)),i=(Number.isFinite(r)&&r>0?r:12)*n,a=this._cssVar(`--ran-font-family`)||mt;for(let t=0;t<this.mCount;t++){let r=this.mCenter+this.mRadius*Math.sin(this.mAngle*t),o=this.mCenter+this.mRadius*Math.cos(this.mAngle*t),s=this.mData[t]?.backgroundColor||ut,c=this.mData[t]?.fontColor||this.fontColor,l=this.mData[t]?.fontFamily||a,u=Number.parseFloat(String(this.mData[t]?.fontSize??``)),d=Number.isFinite(u)&&u>0?u*n:i;e.font=`${d}px ${l}`,this.mAngle*t>=0&&this.mAngle*t<Math.PI/2?this.drawButton(e,s,r,o,44*n,24*n,12*n,this.mData[t].abilityName,c,l,d):this.mAngle*t>=Math.PI/2&&this.mAngle*t<Math.PI?this.drawButton(e,s,r,o-24*n,44*n,24*n,12*n,this.mData[t].abilityName,c,l,d):this.mAngle*t>=Math.PI&&this.mAngle*t<Math.PI*3/2?this.drawButton(e,s,r-44*n,o-24*n,44*n,24*n,12*n,this.mData[t].abilityName,c,l,d):this.drawButton(e,s,r-44*n,o,44*n,24*n,12*n,this.mData[t].abilityName,c,l,d)}e.restore()}drawButton(e,n,r,i,o,s,c,l,u,d,f){let p=t(e);e.fillStyle=n,a(e,r,i,o,s,c),e.fill(),e.beginPath(),e.fillStyle=u,e.font=`${f||12*p}px ${d}`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(l,r+o/2,i+s/2)}drawRegion(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;let n=t(e);e.save(),e.beginPath();for(let t=0;t<this.mCount;t++){let n=this.mCenter+this.mRadius*Math.sin(this.mAngle*t)*this.mData[t].scoreRate/100,r=this.mCenter+this.mRadius*Math.cos(this.mAngle*t)*this.mData[t].scoreRate/100;e.lineTo(n,r)}e.closePath(),e.fillStyle=this.fillColor,e.fill(),e.strokeStyle=this.strokeColor,e.lineWidth=+n,e.stroke(),e.restore()}drawCircle(e){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;let n=t(e);e.save();for(let t=0;t<this.mCount;t++){let r=this.mCenter+this.mRadius*Math.sin(this.mAngle*t)*this.mData[t].scoreRate/100,i=this.mCenter+this.mRadius*Math.cos(this.mAngle*t)*this.mData[t].scoreRate/100;e.beginPath(),e.arc(r,i,3,0,Math.PI*2),e.lineWidth=1.5*n,e.strokeStyle=this.strokeColor,e.stroke()}e.restore()}connectedCallback(){this.resizeObserver.observe(this.abilityRadarChartContainer),this.handlerExternalCss(),this._detachDocumentTheme=lt(this.scheduleRefresh),this._detachThemeMedia=n(`(prefers-color-scheme: dark)`,this.scheduleRefresh)}disconnectedCallback(){this._frame&&cancelAnimationFrame(this._frame),this._frame=0,this.resizeObserver.disconnect(),this._detachDocumentTheme?.(),this._detachDocumentTheme=void 0,this._detachThemeMedia?.(),this._detachThemeMedia=void 0}attributeChangedCallback(e,t,n){t!==n&&([`abilitys`,`colorpolygon`,`colorline`,`fillcolor`,`strokecolor`].includes(e)&&this.abilityRadarChartContainer&&this.refreshData(),e===`sheet`&&this.handlerExternalCss())}};return Je(`r-radar`,$),e.RadarChart=$,e.default=$,e})({});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var ranui_reasoning=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`:host{display:block;min-width:0;color:var(--ran-reasoning-color, var(--ran-color-text-secondary));font-size:var(--ran-reasoning-font-size, var(--ran-text-copy-2))}.ran-reasoning-row{--ran-disclosure-color: var(--ran-reasoning-color, var(--ran-color-text-secondary))}.ran-reasoning-body{border-left:2px solid var(--ran-reasoning-border-color, var(--ran-color-border));padding:var(--ran-reasoning-body-padding, var(--ran-space-1) 0 var(--ran-space-2) calc(var(--ran-disclosure-body-indent, var(--ran-space-6)) - var(--ran-reasoning-body-indent, var(--ran-space-2)) - 2px));margin-left:var(--ran-reasoning-body-indent, var(--ran-space-2));overflow-wrap:anywhere;white-space:pre-wrap}`,n=typeof document>`u`,r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:i=`"`;break;case 38:i=`&`;break;case 39:i=`'`;break;case 60:i=`<`;break;case 62:i=`>`;break;default:continue}s!==o&&(a+=t.substring(s,o)),s=o+1,a+=i}return s===o?a:a+t.substring(s,o)}var a=class{ac=null;get signal(){return this.ac??=new AbortController,this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},o=new Map,s=`data-adopted-style`,c=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},l=(e,t,n=s)=>{if(t){if(typeof document>`u`){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t);return}if(!c(e,t,o)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}}};Object.freeze({});var u=null;function d(){return u}var f=0,p=1,m=2,h=null,g=null,ee=0,_=new Set,v=!1;function te(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ie(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)C(e,m);ee===0&&ae()}}]}function y(e){let t=ne(e,!0);return re(t),T(t),()=>D(t)}function b(e){let t=h;h=null;try{return e()}finally{h=t}}function x(e){let t={owned:[],cleanups:[],owner:g},n=g,r=h;g=t,h=null;try{return e(()=>oe(t))}finally{g=n,h=r}}function S(e){g&&g.cleanups.push(e)}function ne(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:m,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:g}}function re(e){g&&g.owned.push(e)}function ie(e){h&&(h.sources.add(e),e.observers.add(h))}function C(e,t){if(e.disposed||e.state>=t)return;let n=e.state===f;if(e.state=t,e.isEffect)_.add(e);else if(n)for(let t of e.observers)C(t,p)}function ae(){if(!(ee>0||v)){v=!0;try{for(;_.size>0;){let e=[..._];_.clear();for(let t of e)t.disposed||w(t)}}finally{v=!1}}}function w(e){if(!(e.disposed||e.state===f)){if(e.state===p)for(let t of e.sources)`fn`in t&&w(t);e.state===m&&T(e),e.state=f}}function T(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);E(e);let t=h,n=g;h=e,g=e,e.running=!0,e.state=f;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)C(t,m)}}finally{e.running=!1,h=t,g=n}}function E(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function D(e){e.disposed||(e.disposed=!0,E(e),e.observers.clear())}function oe(e){for(let t of e.owned)D(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function se(e){return i(e)}var ce=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,le=`.#[`;function ue(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n<e.length;){let r=e[n];if(r===`[`){let r=e.indexOf(`]`,n+1);if(r===-1)return null;t.push(e.slice(n,r+1)),n=r+1;continue}if(r!==`.`&&r!==`#`)return null;let i=n+1;for(;i<e.length&&!le.includes(e[i]);)i+=1;if(i===n+1)return null;t.push(e.slice(n,i)),n=i}return t.length>0?t:null}var de=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},fe=(e,t)=>{let n=t.trim();if(!n)return!1;let r=ue(n);return r!==null&&r.every(t=>de(e,t))},O=(e,t,n)=>{for(let r of e)ce(r)&&(fe(r,t)&&n.push(r),O(r.childrenList,t,n))};function k(e,t,n){if(n==null)return e.push(t),t;let r=e.indexOf(n);return r===-1?e.push(t):e.splice(r,0,t),t}var A=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}},pe=new Map,j=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??pe}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new A)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}attachShadow(e){return this.shadowRoot=new me(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName;this.shadowRoot&&!this.hasAttribute(`data-ran-dsd`)&&this.setAttribute(`data-ran-dsd`,``);let n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${se(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${se(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof A,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}</${t}>`}},me=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}get children(){return this.childrenList.filter(e=>typeof e!=`string`&&!(e instanceof A))}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}replaceChildren(...e){this.childrenList=e.filter(e=>e!=null)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${String(e).replace(/<\/style/gi,`<\\/style`)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof A,e.serialize())).join(``)}</template>`}},M={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let r of t){if(r==null)continue;if(Array.isArray(r)){M.append(e,r);continue}if(typeof r==`function`){M.append(e,[r()]);continue}if(typeof r==`object`&&(`__ranFor`in r||`__ranIndex`in r))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=r instanceof N?r.build():typeof r==`string`&&!n?document.createTextNode(r):r;e.appendChild(t)}}},he=`http://www.w3.org/2000/svg`,ge=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),N=class{runtime;el;constructor(e,t,r=M){this.runtime=r;let i=t??(ge.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=n?new j(e):i?document.createElementNS(i,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new _e(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},_e=class{runtime;root;hostEl;constructor(e,t,n,r=M){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},P=()=>({current:null}),F=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(F(t)):e.concat(t),[]),I=e=>e==null?null:e instanceof N?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,ve=(e,t)=>{if(n){R(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};y(()=>{let e=t();o();let n=document.createDocumentFragment();a=x(t=>(R(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),S(()=>a?.())},ye=`__ranFor`,be=e=>typeof e==`object`&&!!e&&e[ye]===!0,xe=(e,t,n)=>{let[r,i]=te(t),a=null,o=x(t=>{let i=I(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},L=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},Se=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=I(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;S(()=>{for(let e of i.values())e.dispose();i.clear()}),y(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o)){De()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=i.get(o);s?(i.delete(o),s.index(r)):s=xe(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();L(r,a),i=n})},Ce=`__ranIndex`,we=e=>typeof e==`object`&&!!e&&e[Ce]===!0,Te=(e,t,n)=>{let[r,i]=te(e),a=null,o=x(e=>{let i=I(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Ee=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=I(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];S(()=>{for(let e of i)e.dispose();i=[]}),y(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(Te(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}L(r,i.map(e=>e.node).filter(e=>e!=null))})},R=(e,t)=>{n?b(()=>z(e,t)):z(e,t)},z=(e,t)=>{F(t).forEach(t=>{if(be(t)){Se(e,t);return}if(we(t)){Ee(e,t);return}if(typeof t==`function`){ve(e,t);return}let n=I(t);n!=null&&e.appendChild(n)})},De=()=>!1,Oe={bind(e,t){typeof e==`function`?n?b(()=>t(e())):y(()=>t(e())):t(e)},append:R},ke=class extends N{constructor(e,t){super(e,t,Oe)}};function Ae(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,he),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:B,Div:V,Svg:je,Span:H,Slot:U,ButtonBuilder:Me,InputBuilder:Ne,Style:Pe,Label:Fe,Ul:Ie,Li:Le,Section:Re,Article:ze,Nav:Be,Header:Ve,Footer:He,Main:Ue,DeclarativeShadow:We}=Ae(ke),Ge=new Map;function W(e,t){n?(Ge.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ke=typeof document<`u`?HTMLElement:j,qe=`data-ranui`,Je=`data-ranui-sheet`,Ye=(e,t)=>{if(typeof document>`u`&&t){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t)}l(e,t,qe)},G=new WeakMap,K=new Map,Xe=e=>{if(typeof CSSStyleSheet>`u`)return;let t=K.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},K.set(e,t)}catch{return}return t.users++,t.sheet},Ze=e=>{let t=K.get(e);t&&--t.users===0&&K.delete(e)},Qe=(e,t)=>{if(typeof document>`u`)return;let n=G.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),Ze(n.text)):n&&e.querySelector(`style[${Je}]`)?.remove(),G.delete(e),!t))return;let r=Xe(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{Ze(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(Je,``),n.textContent=t,e.appendChild(n)}G.set(e,{text:t,sheet:r})},$e=new WeakMap,et=new WeakMap,tt=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,nt=`:host([hidden]){display:none}`,rt=new Map,it=e=>{let t=rt.get(e);if(t!==void 0)return t;let n=`${nt}\n${tt}`,r=e?`${e}\n${n}`:n;return rt.set(e,r),r},at=e=>{let t=et.get(e);if(t)return t;try{let t=e.attachInternals;if(typeof t!=`function`)return;let n=t.call(e);return et.set(e,n),n}catch{return}},ot=(e,t=``,n={mode:`closed`},r)=>{let i=r??at(e),a=e.shadowRoot||$e.get(e)||i?.shadowRoot||e.attachShadow(n);return $e.set(e,a),Ye(a,it(t)),a},st=(e,t,...n)=>{e.replaceChildren(...n),Ye(e,it(t))},q=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},J=(e,t,n=``)=>e.getAttribute(t)??n,Y=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},X=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&Qe(t,e.getAttribute(`sheet`)||``)},ct=`:host{display:block;min-width:0;color:var(--ran-disclosure-color, var(--ran-color-text));font-size:var(--ran-disclosure-font-size, var(--ran-text-copy-2));--ran-disclosure-body-indent: calc(var(--ran-disclosure-leading-size, 16px) + var(--ran-disclosure-gap, var(--ran-space-2)))}.ran-disclosure{display:flex;flex-direction:column;min-width:0}.ran-disclosure-row{position:relative;overflow:hidden;display:flex;align-items:center;gap:var(--ran-disclosure-gap, var(--ran-space-2));border-radius:var(--ran-disclosure-radius, var(--ran-radius-sm));min-width:0;height:var(--ran-disclosure-row-height, 24px)}@media(pointer:coarse){.ran-disclosure-row{height:var(--ran-disclosure-row-height, var(--ran-size-7, 32px))}}:host([expandable]) .ran-disclosure-row{cursor:pointer}:host([expandable]) .ran-disclosure-row:hover{box-shadow:calc(-1 * var(--ran-space-2)) 0 0 0 var(--ran-disclosure-hover-background, var(--ran-color-bg-hover)),var(--ran-space-2) 0 0 0 var(--ran-disclosure-hover-background, var(--ran-color-bg-hover));background:var(--ran-disclosure-hover-background, var(--ran-color-bg-hover))}.ran-disclosure-row:focus-visible{outline:2px solid var(--ran-color-focus);outline-offset:2px}.ran-disclosure-leading{display:inline-grid;flex:none;place-items:center;width:var(--ran-disclosure-leading-size, 16px);height:var(--ran-disclosure-leading-size, 16px);color:var(--ran-disclosure-leading-color, var(--ran-color-text-secondary))}.ran-disclosure-icon,.ran-disclosure-chevron{grid-area:1 / 1;transition:opacity var(--ran-disclosure-transition, var(--ran-motion-duration-fast)) var(--ran-motion-ease-standard)}.ran-disclosure-icon{display:inline-flex;align-items:center;justify-content:center}.ran-disclosure-chevron{width:var(--ran-disclosure-chevron-size, 12px);height:var(--ran-disclosure-chevron-size, 12px);transform:rotate(-90deg);transition:opacity var(--ran-disclosure-transition, var(--ran-motion-duration-fast)) var(--ran-motion-ease-standard),transform var(--ran-disclosure-toggle-duration, var(--ran-motion-duration-base)) var(--ran-motion-ease-standard)}:host([open]) .ran-disclosure-chevron{transform:rotate(0)}:host(:not([expandable])) .ran-disclosure-chevron{display:none}.ran-disclosure.has-leading .ran-disclosure-chevron{opacity:0}:host([expandable]) .has-leading .ran-disclosure-row:hover .ran-disclosure-icon,:host([expandable]) .has-leading .ran-disclosure-row:focus-visible .ran-disclosure-icon,:host([expandable][open]) .has-leading .ran-disclosure-icon{opacity:0}:host([expandable]) .has-leading .ran-disclosure-row:hover .ran-disclosure-chevron,:host([expandable]) .has-leading .ran-disclosure-row:focus-visible .ran-disclosure-chevron,:host([expandable][open]) .has-leading .ran-disclosure-chevron{opacity:1}.ran-disclosure-title{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;font-weight:var(--ran-disclosure-title-weight, 400);min-width:0;white-space:nowrap}.ran-disclosure-sep{flex:none;border-radius:50%;background:var(--ran-disclosure-sep-color, var(--ran-color-text-disabled));width:2px;height:2px}.ran-disclosure-summary{flex:1 1 0;min-width:0;overflow:hidden;color:var(--ran-disclosure-summary-color, var(--ran-color-text-secondary));text-overflow:ellipsis;white-space:nowrap}.has-summary .ran-disclosure-summary{min-width:min(50%,16ch)}:host([tone="error"]) .ran-disclosure-summary{color:var(--ran-disclosure-error-color, var(--ran-color-danger))}:host([busy]) .ran-disclosure-row:after{content:"";position:absolute;top:0;bottom:0;left:0;background:linear-gradient(90deg,transparent 0%,var(--ran-disclosure-sweep-color, color-mix(in srgb, var(--ran-color-bg) 65%, transparent)) 55%,transparent 100%);width:var(--ran-disclosure-sweep-width, 12rem);animation:ran-disclosure-sweep var(--ran-disclosure-sweep-duration, 2.6s) ease-out infinite;pointer-events:none}@keyframes ran-disclosure-sweep{0%{left:-12rem}90%,to{left:100%}}@media(prefers-reduced-motion:reduce){:host([busy]) .ran-disclosure-row:after{display:none}}.ran-disclosure-body{display:grid;grid-template-rows:0fr;min-width:0;transition:grid-template-rows var(--ran-disclosure-toggle-duration, var(--ran-motion-duration-base)) var(--ran-motion-ease-standard)}:host([open]) .ran-disclosure-body{grid-template-rows:1fr}.ran-disclosure-body-inner{min-width:0;overflow:hidden;content-visibility:hidden;transition:content-visibility var(--ran-disclosure-toggle-duration, var(--ran-motion-duration-base)) allow-discrete}:host([open]) .ran-disclosure-body-inner{content-visibility:visible}@media(prefers-reduced-motion:reduce){.ran-disclosure-icon,.ran-disclosure-chevron,.ran-disclosure-body,.ran-disclosure-body-inner{transition:none}}`;function lt(e){return e.key===`Enter`||e.key===` `||e.key===`Spacebar`}var ut=`disclosuretoggle`,dt=0,Z=new Map;function Q(e){return typeof e?.assignedNodes==`function`&&e.assignedNodes().some(e=>e.nodeType===Node.ELEMENT_NODE||(e.textContent??``).trim()!==``)}W(`r-disclosure-row`,class extends Ke{_events=new a;_shadowDom;_root;_row;_title;_summary;_sep;_leadingSlot;_headingSlot;_summarySlot;_titleText;_summaryText;_body;_bodyInner;_bodyId=`ran-disclosure-body-${dt+=1}`;static get observedAttributes(){return[`open`,`expandable`,`heading`,`summary`,`tone`,`busy`,`name`,`sheet`]}constructor(){super(),this._shadowDom=ot(this,ct);let e=P(),t=P(),n=P(),r=P(),i=P(),a=P(),o=P(),s=P(),c=P(),l=P(),u=P(),d=V().class(`ran-disclosure`).attr(`part`,`disclosure`).children(V().class(`ran-disclosure-row`).ref(e).attr(`part`,`row`).children(H().class(`ran-disclosure-leading`).attr(`part`,`leading`).children(H().class(`ran-disclosure-icon`).children(U().ref(i).attr(`name`,`leading`).build()).build(),B(`svg`).class(`ran-disclosure-chevron`).attr(`viewBox`,`0 0 24 24`).attr(`fill`,`none`).attr(`stroke`,`currentColor`).attr(`stroke-width`,`1.75`).attr(`stroke-linecap`,`round`).attr(`stroke-linejoin`,`round`).attr(`aria-hidden`,`true`).children(B(`path`).attr(`d`,`M6 9l6 6 6-6`).build()).build()).build(),H().class(`ran-disclosure-title`).ref(t).attr(`part`,`title`).children(U().ref(a).attr(`name`,`heading`).children(H().class(`ran-disclosure-title-text`).ref(s).build()).build()).build(),H().class(`ran-disclosure-sep`).ref(r).attr(`part`,`separator`).attr(`aria-hidden`,`true`).build(),H().class(`ran-disclosure-summary`).ref(n).attr(`part`,`summary`).children(U().ref(o).attr(`name`,`summary`).children(H().class(`ran-disclosure-summary-text`).ref(c).build()).build()).build()).build(),V().class(`ran-disclosure-body`).attr(`part`,`body`).id(this._bodyId).ref(l).children(V().class(`ran-disclosure-body-inner`).ref(u).children(U().build()).build()).build()).build();st(this._shadowDom,ct,d),this._root=d,this._leadingSlot=i.current,this._headingSlot=a.current,this._summarySlot=o.current,this._titleText=s.current,this._summaryText=c.current,this._body=l.current,this._bodyInner=u.current,this._row=q(e,`row`),this._title=q(t,`title`),this._summary=q(n,`summary`),this._sep=q(r,`separator`)}get open(){return this.hasAttribute(`open`)}set open(e){e!==this.open&&(e?this.setAttribute(`open`,``):this.removeAttribute(`open`))}get expandable(){return this.hasAttribute(`expandable`)}set expandable(e){e?this.setAttribute(`expandable`,``):this.removeAttribute(`expandable`)}get heading(){return J(this,`heading`)}set heading(e){Y(this,`heading`,e)}get summary(){return J(this,`summary`)}set summary(e){Y(this,`summary`,e)}get busy(){return this.hasAttribute(`busy`)}set busy(e){e?this.setAttribute(`busy`,``):this.removeAttribute(`busy`)}get tone(){return J(this,`tone`)}set tone(e){Y(this,`tone`,e)}get name(){return J(this,`name`)}set name(e){Y(this,`name`,e)}get sheet(){return J(this,`sheet`)}set sheet(e){Y(this,`sheet`,e)}connectedCallback(){this.handlerExternalCss(),this._events.on(this._row,`click`,this._toggle),this._events.on(this._row,`keydown`,this._keydown),this._events.on(this._leadingSlot,`slotchange`,this._syncLeading),this._events.on(this._headingSlot,`slotchange`,this._syncFromSlot),this._events.on(this._summarySlot,`slotchange`,this._syncFromSlot),this._join(),this._syncLeading(),this._sync(),this.open&&this._closeGroupPeers()}disconnectedCallback(){this._events.abort(),this._leave()}attributeChangedCallback(e,t,n){t!==n&&(e===`sheet`?this.handlerExternalCss():(e===`name`&&(this._leave(t??``),this._join()),e===`open`&&n!==null&&this._closeGroupPeers(),this._sync()))}handlerExternalCss=()=>{X(this,this._shadowDom,`sheet`,null,this.sheet)};_toggle=()=>{if(!this.expandable)return;let e=!this.open;this.dispatchEvent(new CustomEvent(`disclosurebeforetoggle`,{detail:{open:e},bubbles:!0,composed:!0,cancelable:!0}))&&(this.open=e,this.dispatchEvent(new CustomEvent(ut,{detail:{open:this.open},bubbles:!0,composed:!0})))};_keydown=e=>{this.expandable&<(e)&&(e.preventDefault(),this._toggle())};_join(){let{name:e}=this;if(!e)return;let t=Z.get(e)??new Set;t.add(this),Z.set(e,t)}_leave(e=this.name){let t=Z.get(e);t&&(t.delete(this),t.size===0&&Z.delete(e))}_closeGroupPeers(){let e=this.name?Z.get(this.name):void 0;e&&e.forEach(e=>{e!==this&&(e.open=!1)})}_syncLeading=()=>{this._root.classList.toggle(`has-leading`,Q(this._leadingSlot))};_syncFromSlot=()=>{this._sync()};_sync(){let{heading:e,summary:t,expandable:n,open:r}=this;this._titleText.textContent=e,this._summaryText.textContent=t;let i=e!==``||Q(this._headingSlot),a=t!==``||Q(this._summarySlot);this._root.classList.toggle(`has-summary`,a),this._sep.hidden=!i||!a,n?(this._row.setAttribute(`role`,`button`),this._row.tabIndex=0,this._row.setAttribute(`aria-expanded`,String(r)),this._row.setAttribute(`aria-controls`,this._bodyId)):(this._row.removeAttribute(`role`),this._row.removeAttribute(`tabindex`),this._row.removeAttribute(`aria-expanded`),this._row.removeAttribute(`aria-controls`)),this.busy?this._row.setAttribute(`aria-busy`,`true`):this._row.removeAttribute(`aria-busy`);let o=!(n&&r);o&&this._bodyInner.matches(`:focus-within`)&&this._row.focus({preventScroll:!0}),this._bodyInner.inert=o}});var ft=e=>e,pt=e=>{let t=e;for(;t;){let e=t.closest?.(`[lang]`)?.getAttribute(`lang`);if(e)return e;t=t.getRootNode?.()?.host}return``},mt=e=>{let t=(d()?.getLocale()||pt(e)||(typeof document<`u`?document.documentElement.lang:``)||`en`).toLowerCase();return/^zh[-_](hant|tw|hk|mo)\b/.test(t)?`en`:t.split(/[-_]/)[0]},ht=(e,t)=>t?e.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??e)):e,gt=(e,t,n,r)=>{let i=d(),a=`ranui.${t}`;if(i){let e=i.getMessages(i.getLocale())[a];if(e!==void 0)return ht(e,r)}return ht(e[mt(n)]?.[t]??e.en[t],r)},_t=ft({en:{"reasoning.label":`Reasoning`},zh:{"reasoning.label":`思考过程`},ja:{"reasoning.label":`思考プロセス`},ko:{"reasoning.label":`추론 과정`},es:{"reasoning.label":`Razonamiento`},pt:{"reasoning.label":`Raciocínio`},de:{"reasoning.label":`Denkprozess`},fa:{"reasoning.label":`استدلال`}});function vt(e,t){let n=e.trimEnd();if(n===``)return``;if(!t)return n.split(`
|
|
2
|
+
`,1)[0]??``;let r=n.lastIndexOf(`
|
|
3
|
+
`);return r===-1?n:n.slice(r+1)}var $=class extends Ke{_events=new a;_shadowDom;_row;_text;_readerOwns=!1;_writingOpen=!1;_content=``;static get observedAttributes(){return[`open`,`streaming`,`label`,`duration`,`sheet`]}constructor(){super(),this._shadowDom=ot(this,t);let e=P(),n=B(`r-disclosure-row`).class(`ran-reasoning-row`).attr(`part`,`row`).attr(`expandable`,``).children(V().class(`ran-reasoning-body`).attr(`part`,`body`).children(H().class(`ran-reasoning-text`).ref(e).attr(`part`,`text`).build(),U().build()).build()).build();st(this._shadowDom,t,n),this._row=n,this._text=q(e,`text`)}get content(){return this._content}set content(e){this._content=e,this._text.textContent=e,this._syncRow()}get streaming(){return this.hasAttribute(`streaming`)}set streaming(e){e?this.setAttribute(`streaming`,``):this.removeAttribute(`streaming`)}get open(){return this.hasAttribute(`open`)}set open(e){e!==this.open&&(e?this.setAttribute(`open`,``):this.removeAttribute(`open`))}get label(){return J(this,`label`,gt(_t,`reasoning.label`,this))}set label(e){Y(this,`label`,e)}get duration(){let e=this.getAttribute(`duration`);if(e===null)return null;let t=Number(e);return Number.isFinite(t)&&t>=0?t:null}set duration(e){Y(this,`duration`,e===null?null:String(e))}get sheet(){return J(this,`sheet`)}set sheet(e){Y(this,`sheet`,e)}connectedCallback(){this.handlerExternalCss(),this._events.on(this._row,ut,e=>{this._readerOwns=!0,this._writingOpen=!0,this.open=e.detail.open,this._writingOpen=!1}),this._syncRow()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`sheet`&&this.handlerExternalCss(),(e===`label`||e===`duration`)&&this._syncRow(),e===`streaming`&&this._followStreaming(n!==null),e===`open`&&(this._writingOpen||(this._readerOwns=!0),this._syncRow()))}handlerExternalCss=()=>{X(this,this._shadowDom,`sheet`,null,this.sheet)};_followStreaming(e){this._syncRow(),this._readerOwns||(this._writingOpen=!0,this.open=e,this._writingOpen=!1)}_syncRow(){let e=this.streaming,t=this.duration;this._row.open=this.open,this._row.busy=e;let n=t===null||t<1e3?``:`${(t/1e3).toFixed(1)}s`;this._row.heading=n===``?this.label:`${this.label} · ${n}`,this._row.summary=this.open?``:vt(this._content,e)}};return W(`r-reasoning`,$),e.Reasoning=$,e.default=$,e})({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ranui_route=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`:host{display:block}:host([hidden]){display:none!important}`,n=typeof document>`u`,r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:i=`"`;break;case 38:i=`&`;break;case 39:i=`'`;break;case 60:i=`<`;break;case 62:i=`>`;break;default:continue}s!==o&&(a+=t.substring(s,o)),s=o+1,a+=i}return s===o?a:a+t.substring(s,o)}var a=class{ac=null;get signal(){return this.ac??=new AbortController,this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},o=new Map,s=`data-adopted-style`,ee=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},te=(e,t,n=s)=>{if(t){if(typeof document>`u`){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t);return}if(!ee(e,t,o)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}}},c=0,l=1,u=2,d=null,f=null,p=0,m=new Set,h=!1;function g(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ie(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)x(e,u);p===0&&ae()}}]}function _(e){let t=ne(e,!0);return re(t),C(t),()=>T(t)}function v(e){let t=d;d=null;try{return e()}finally{d=t}}function y(e){let t={owned:[],cleanups:[],owner:f},n=f,r=d;f=t,d=null;try{return e(()=>oe(t))}finally{f=n,d=r}}function b(e){f&&f.cleanups.push(e)}function ne(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:u,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:f}}function re(e){f&&f.owned.push(e)}function ie(e){d&&(d.sources.add(e),e.observers.add(d))}function x(e,t){if(e.disposed||e.state>=t)return;let n=e.state===c;if(e.state=t,e.isEffect)m.add(e);else if(n)for(let t of e.observers)x(t,l)}function ae(){if(!(p>0||h)){h=!0;try{for(;m.size>0;){let e=[...m];m.clear();for(let t of e)t.disposed||S(t)}}finally{h=!1}}}function S(e){if(!(e.disposed||e.state===c)){if(e.state===l)for(let t of e.sources)`fn`in t&&S(t);e.state===u&&C(e),e.state=c}}function C(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);w(e);let t=d,n=f;d=e,f=e,e.running=!0,e.state=c;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)x(t,u)}}finally{e.running=!1,d=t,f=n}}function w(e){for(let t of e.owned)T(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function T(e){e.disposed||(e.disposed=!0,w(e),e.observers.clear())}function oe(e){for(let t of e.owned)T(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function E(e){return i(e)}var se=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,ce=`.#[`;function D(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n<e.length;){let r=e[n];if(r===`[`){let r=e.indexOf(`]`,n+1);if(r===-1)return null;t.push(e.slice(n,r+1)),n=r+1;continue}if(r!==`.`&&r!==`#`)return null;let i=n+1;for(;i<e.length&&!ce.includes(e[i]);)i+=1;if(i===n+1)return null;t.push(e.slice(n,i)),n=i}return t.length>0?t:null}var le=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},ue=(e,t)=>{let n=t.trim();if(!n)return!1;let r=D(n);return r!==null&&r.every(t=>le(e,t))},O=(e,t,n)=>{for(let r of e)se(r)&&(ue(r,t)&&n.push(r),O(r.childrenList,t,n))};function k(e,t,n){if(n==null)return e.push(t),t;let r=e.indexOf(n);return r===-1?e.push(t):e.splice(r,0,t),t}var A=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}},de=new Map,j=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??de}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new A)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}attachShadow(e){return this.shadowRoot=new fe(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName;this.shadowRoot&&!this.hasAttribute(`data-ran-dsd`)&&this.setAttribute(`data-ran-dsd`,``);let n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${E(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${E(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof A,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}</${t}>`}},fe=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}get children(){return this.childrenList.filter(e=>typeof e!=`string`&&!(e instanceof A))}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}replaceChildren(...e){this.childrenList=e.filter(e=>e!=null)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${String(e).replace(/<\/style/gi,`<\\/style`)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof A,e.serialize())).join(``)}</template>`}},M={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let r of t){if(r==null)continue;if(Array.isArray(r)){M.append(e,r);continue}if(typeof r==`function`){M.append(e,[r()]);continue}if(typeof r==`object`&&(`__ranFor`in r||`__ranIndex`in r))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=r instanceof N?r.build():typeof r==`string`&&!n?document.createTextNode(r):r;e.appendChild(t)}}},pe=`http://www.w3.org/2000/svg`,me=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),N=class{runtime;el;constructor(e,t,r=M){this.runtime=r;let i=t??(me.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=n?new j(e):i?document.createElementNS(i,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new he(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},he=class{runtime;root;hostEl;constructor(e,t,n,r=M){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},P=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(P(t)):e.concat(t),[]),F=e=>e==null?null:e instanceof N?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,I=(e,t)=>{if(n){B(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};_(()=>{let e=t();o();let n=document.createDocumentFragment();a=y(t=>(B(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),b(()=>a?.())},L=`__ranFor`,R=e=>typeof e==`object`&&!!e&&e[L]===!0,ge=(e,t,n)=>{let[r,i]=g(t),a=null,o=y(t=>{let i=F(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},z=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},_e=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=F(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;b(()=>{for(let e of i.values())e.dispose();i.clear()}),_(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o)){Se()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=i.get(o);s?(i.delete(o),s.index(r)):s=ge(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();z(r,a),i=n})},ve=`__ranIndex`,ye=e=>typeof e==`object`&&!!e&&e[ve]===!0,be=(e,t,n)=>{let[r,i]=g(e),a=null,o=y(e=>{let i=F(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},xe=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=F(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];b(()=>{for(let e of i)e.dispose();i=[]}),_(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(be(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}z(r,i.map(e=>e.node).filter(e=>e!=null))})},B=(e,t)=>{n?v(()=>V(e,t)):V(e,t)},V=(e,t)=>{P(t).forEach(t=>{if(R(t)){_e(e,t);return}if(ye(t)){xe(e,t);return}if(typeof t==`function`){I(e,t);return}let n=F(t);n!=null&&e.appendChild(n)})},Se=()=>!1,Ce={bind(e,t){typeof e==`function`?n?v(()=>t(e())):_(()=>t(e())):t(e)},append:B},we=class extends N{constructor(e,t){super(e,t,Ce)}};function Te(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,pe),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:Ee,Div:De,Svg:Oe,Span:ke,Slot:Ae,ButtonBuilder:je,InputBuilder:Me,Style:Ne,Label:Pe,Ul:Fe,Li:Ie,Section:Le,Article:Re,Nav:ze,Header:Be,Footer:Ve,Main:He,DeclarativeShadow:Ue}=Te(we),We=new Map;function Ge(e,t){n?(We.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ke=typeof document<`u`?HTMLElement:j,qe=`data-ranui`,H=`data-ranui-sheet`,U=(e,t)=>{if(typeof document>`u`&&t){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t)}te(e,t,qe)},W=new WeakMap,G=new Map,Je=e=>{if(typeof CSSStyleSheet>`u`)return;let t=G.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},G.set(e,t)}catch{return}return t.users++,t.sheet},K=e=>{let t=G.get(e);t&&--t.users===0&&G.delete(e)},Ye=(e,t)=>{if(typeof document>`u`)return;let n=W.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),K(n.text)):n&&e.querySelector(`style[${H}]`)?.remove(),W.delete(e),!t))return;let r=Je(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{K(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(H,``),n.textContent=t,e.appendChild(n)}W.set(e,{text:t,sheet:r})},q=new WeakMap,J=new WeakMap,Xe=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Ze=`:host([hidden]){display:none}`,Y=new Map,X=e=>{let t=Y.get(e);if(t!==void 0)return t;let n=`${Ze}\n${Xe}`,r=e?`${e}\n${n}`:n;return Y.set(e,r),r},Qe=e=>{let t=J.get(e);if(t)return t;try{let t=e.attachInternals;if(typeof t!=`function`)return;let n=t.call(e);return J.set(e,n),n}catch{return}},$e=(e,t=``,n={mode:`closed`},r)=>{let i=r??Qe(e),a=e.shadowRoot||q.get(e)||i?.shadowRoot||e.attachShadow(n);return q.set(e,a),U(a,X(t)),a},et=(e,t,...n)=>{e.replaceChildren(...n),U(e,X(t))},Z=(e,t,n=``)=>e.getAttribute(t)??n,Q=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},tt=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&Ye(t,e.getAttribute(`sheet`)||``)},nt=null;function rt(){return nt}function it(e,t,n){let r=[],i=e.split(`/`).map(e=>e.startsWith(`:`)?(r.push(e.slice(1)),`([^/]+)`):e===`*`?`(.*)`:e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`/`),a=RegExp(t?`^${i}$`:`^${i}(?:/.*)?$`),o=n.match(a);if(!o)return{matched:!1,params:{}};let s={};return r.forEach((e,t)=>{s[e]=decodeURIComponent(o[t+1]??``)}),{matched:!0,params:s}}var $=class extends Ke{static get observedAttributes(){return[`path`,`exact`,`src`,`sheet`]}_events=new a;_shadowDom;_params={};_mounted=!1;_module=null;_disposePage=null;_pageHost=null;_mountToken=0;constructor(){super(),this._shadowDom=$e(this,t),et(this._shadowDom,t,Ae().build())}get path(){return Z(this,`path`,`/`)}set path(e){Q(this,`path`,e)}get exact(){return this.hasAttribute(`exact`)}get src(){return Z(this,`src`)}set src(e){Q(this,`src`,e)}get params(){return{...this._params}}get sheet(){return Z(this,`sheet`)}set sheet(e){Q(this,`sheet`,e)}handlerExternalCss=()=>{tt(this,this._shadowDom,`sheet`,null,this.sheet)};_update(e){let{matched:t,params:r}=it(this.path,this.exact,e);this._params=r,this.hidden=!t,this.src&&!n&&(t?this._mount():this._unmount()),t&&this.dispatchEvent(new CustomEvent(`routematch`,{detail:{path:e,params:r},bubbles:!0}))}async _mount(){if(this._mounted)return;this._mounted=!0;let e=++this._mountToken;this._pageHost||(this._pageHost=document.createElement(`div`),this._pageHost.setAttribute(`part`,`page`),this.appendChild(this._pageHost));try{let t=this._module??await import(this.src);if(e!==this._mountToken)return;this._module=t;let n=t.default;if(typeof n!=`function`){console.error(`[r-route] "${this.src}" has no default export (host) => void`);return}let r=this._pageHost;this._disposePage=y(e=>{let t=n(r);return typeof t==`function`&&b(t),e})}catch(t){if(e!==this._mountToken)return;this._mounted=!1,console.error(`[r-route] failed to load "${this.src}":`,t)}}_unmount(){this._mounted&&(this._mounted=!1,this._mountToken++,this._disposePage?.(),this._disposePage=null,this._pageHost?.replaceChildren())}_preSerialize(){let e=rt();e!==null&&this._update(e)}connectedCallback(){this.handlerExternalCss();let e=this.closest(`r-router`);e&&e._currentPath&&this._update(e._currentPath)}disconnectedCallback(){this._unmount(),this._events.abort()}attributeChangedCallback(e,t,n){if(t!==n){if(e===`src`&&(this._module=null,this._unmount()),e===`path`||e===`exact`||e===`src`){let e=this.closest(`r-router`);e&&this._update(e._currentPath)}e===`sheet`&&this.handlerExternalCss()}}};return Ge(`r-route`,$),e.Route=$,e.default=$,e})({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ranui_router=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`:host{display:block;width:100%}`,n=typeof document>`u`,r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:i=`"`;break;case 38:i=`&`;break;case 39:i=`'`;break;case 60:i=`<`;break;case 62:i=`>`;break;default:continue}s!==o&&(a+=t.substring(s,o)),s=o+1,a+=i}return s===o?a:a+t.substring(s,o)}var a=class{ac=null;get signal(){return this.ac??=new AbortController,this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},o=new Map,s=`data-adopted-style`,ee=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},te=(e,t,n=s)=>{if(t){if(typeof document>`u`){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t);return}if(!ee(e,t,o)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}}},c=0,l=1,u=2,d=null,f=null,p=0,m=new Set,h=!1;function g(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ie(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)x(e,u);p===0&&ae()}}]}function _(e){let t=ne(e,!0);return re(t),C(t),()=>T(t)}function v(e){let t=d;d=null;try{return e()}finally{d=t}}function y(e){let t={owned:[],cleanups:[],owner:f},n=f,r=d;f=t,d=null;try{return e(()=>oe(t))}finally{f=n,d=r}}function b(e){f&&f.cleanups.push(e)}function ne(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:u,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:f}}function re(e){f&&f.owned.push(e)}function ie(e){d&&(d.sources.add(e),e.observers.add(d))}function x(e,t){if(e.disposed||e.state>=t)return;let n=e.state===c;if(e.state=t,e.isEffect)m.add(e);else if(n)for(let t of e.observers)x(t,l)}function ae(){if(!(p>0||h)){h=!0;try{for(;m.size>0;){let e=[...m];m.clear();for(let t of e)t.disposed||S(t)}}finally{h=!1}}}function S(e){if(!(e.disposed||e.state===c)){if(e.state===l)for(let t of e.sources)`fn`in t&&S(t);e.state===u&&C(e),e.state=c}}function C(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);w(e);let t=d,n=f;d=e,f=e,e.running=!0,e.state=c;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)x(t,u)}}finally{e.running=!1,d=t,f=n}}function w(e){for(let t of e.owned)T(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function T(e){e.disposed||(e.disposed=!0,w(e),e.observers.clear())}function oe(e){for(let t of e.owned)T(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function E(e){return i(e)}var se=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,ce=`.#[`;function le(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n<e.length;){let r=e[n];if(r===`[`){let r=e.indexOf(`]`,n+1);if(r===-1)return null;t.push(e.slice(n,r+1)),n=r+1;continue}if(r!==`.`&&r!==`#`)return null;let i=n+1;for(;i<e.length&&!ce.includes(e[i]);)i+=1;if(i===n+1)return null;t.push(e.slice(n,i)),n=i}return t.length>0?t:null}var D=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},ue=(e,t)=>{let n=t.trim();if(!n)return!1;let r=le(n);return r!==null&&r.every(t=>D(e,t))},O=(e,t,n)=>{for(let r of e)se(r)&&(ue(r,t)&&n.push(r),O(r.childrenList,t,n))};function k(e,t,n){if(n==null)return e.push(t),t;let r=e.indexOf(n);return r===-1?e.push(t):e.splice(r,0,t),t}var A=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}},de=new Map,j=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??de}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new A)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}attachShadow(e){return this.shadowRoot=new fe(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName;this.shadowRoot&&!this.hasAttribute(`data-ran-dsd`)&&this.setAttribute(`data-ran-dsd`,``);let n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${E(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${E(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof A,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}</${t}>`}},fe=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}get children(){return this.childrenList.filter(e=>typeof e!=`string`&&!(e instanceof A))}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}replaceChildren(...e){this.childrenList=e.filter(e=>e!=null)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${String(e).replace(/<\/style/gi,`<\\/style`)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof A,e.serialize())).join(``)}</template>`}},M={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let r of t){if(r==null)continue;if(Array.isArray(r)){M.append(e,r);continue}if(typeof r==`function`){M.append(e,[r()]);continue}if(typeof r==`object`&&(`__ranFor`in r||`__ranIndex`in r))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=r instanceof N?r.build():typeof r==`string`&&!n?document.createTextNode(r):r;e.appendChild(t)}}},pe=`http://www.w3.org/2000/svg`,me=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),N=class{runtime;el;constructor(e,t,r=M){this.runtime=r;let i=t??(me.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=n?new j(e):i?document.createElementNS(i,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new he(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},he=class{runtime;root;hostEl;constructor(e,t,n,r=M){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},P=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(P(t)):e.concat(t),[]),F=e=>e==null?null:e instanceof N?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,I=(e,t)=>{if(n){B(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};_(()=>{let e=t();o();let n=document.createDocumentFragment();a=y(t=>(B(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),b(()=>a?.())},L=`__ranFor`,R=e=>typeof e==`object`&&!!e&&e[L]===!0,ge=(e,t,n)=>{let[r,i]=g(t),a=null,o=y(t=>{let i=F(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},z=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},_e=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=F(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;b(()=>{for(let e of i.values())e.dispose();i.clear()}),_(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o)){Se()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=i.get(o);s?(i.delete(o),s.index(r)):s=ge(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();z(r,a),i=n})},ve=`__ranIndex`,ye=e=>typeof e==`object`&&!!e&&e[ve]===!0,be=(e,t,n)=>{let[r,i]=g(e),a=null,o=y(e=>{let i=F(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},xe=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=F(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];b(()=>{for(let e of i)e.dispose();i=[]}),_(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(be(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}z(r,i.map(e=>e.node).filter(e=>e!=null))})},B=(e,t)=>{n?v(()=>V(e,t)):V(e,t)},V=(e,t)=>{P(t).forEach(t=>{if(R(t)){_e(e,t);return}if(ye(t)){xe(e,t);return}if(typeof t==`function`){I(e,t);return}let n=F(t);n!=null&&e.appendChild(n)})},Se=()=>!1,Ce={bind(e,t){typeof e==`function`?n?v(()=>t(e())):_(()=>t(e())):t(e)},append:B},we=class extends N{constructor(e,t){super(e,t,Ce)}};function Te(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,pe),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:Ee,Div:De,Svg:Oe,Span:ke,Slot:Ae,ButtonBuilder:je,InputBuilder:Me,Style:Ne,Label:Pe,Ul:Fe,Li:Ie,Section:Le,Article:Re,Nav:ze,Header:Be,Footer:Ve,Main:He,DeclarativeShadow:Ue}=Te(we),We=new Map;function Ge(e,t){n?(We.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ke=typeof document<`u`?HTMLElement:j,qe=`data-ranui`,H=`data-ranui-sheet`,U=(e,t)=>{if(typeof document>`u`&&t){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t)}te(e,t,qe)},W=new WeakMap,G=new Map,Je=e=>{if(typeof CSSStyleSheet>`u`)return;let t=G.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},G.set(e,t)}catch{return}return t.users++,t.sheet},K=e=>{let t=G.get(e);t&&--t.users===0&&G.delete(e)},Ye=(e,t)=>{if(typeof document>`u`)return;let n=W.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),K(n.text)):n&&e.querySelector(`style[${H}]`)?.remove(),W.delete(e),!t))return;let r=Je(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{K(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(H,``),n.textContent=t,e.appendChild(n)}W.set(e,{text:t,sheet:r})},q=new WeakMap,J=new WeakMap,Xe=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,Ze=`:host([hidden]){display:none}`,Y=new Map,X=e=>{let t=Y.get(e);if(t!==void 0)return t;let n=`${Ze}\n${Xe}`,r=e?`${e}\n${n}`:n;return Y.set(e,r),r},Qe=e=>{let t=J.get(e);if(t)return t;try{let t=e.attachInternals;if(typeof t!=`function`)return;let n=t.call(e);return J.set(e,n),n}catch{return}},$e=(e,t=``,n={mode:`closed`},r)=>{let i=r??Qe(e),a=e.shadowRoot||q.get(e)||i?.shadowRoot||e.attachShadow(n);return q.set(e,a),U(a,X(t)),a},et=(e,t,...n)=>{e.replaceChildren(...n),U(e,X(t))},Z=(e,t,n=``)=>e.getAttribute(t)??n,tt=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},nt=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&Ye(t,e.getAttribute(`sheet`)||``)},rt=null;function Q(){return rt}var $=class extends Ke{static get observedAttributes(){return[`mode`,`base`,`sheet`]}_events=new a;_shadowDom;_slot;_currentPath=``;_core=null;constructor(){super(),this._shadowDom=$e(this,t);let e=Ae().build();et(this._shadowDom,t,e),this._slot=e}get mode(){return this.getAttribute(`mode`)===`hash`?`hash`:`history`}get base(){return Z(this,`base`)}get sheet(){return Z(this,`sheet`)}set sheet(e){tt(this,`sheet`,e)}handlerExternalCss=()=>{nt(this,this._shadowDom,`sheet`,null,this.sheet)};_getPath(){if(this.mode===`hash`)return window.location.hash.slice(1)||`/`;let e=this.base,t=window.location.pathname;return e&&t.startsWith(e)?t.slice(e.length)||`/`:t}navigate(e,t=!1){if(this._core){t?this._core.replace(e):this._core.push(e);return}let n=this.mode===`hash`?`#${e}`:this.base+e;t?window.history.replaceState(null,``,n):window.history.pushState(null,``,n),this._syncRoutes()}_syncRoutes(){let e=this._getPath();this._currentPath=e,this.querySelectorAll(`r-route`).forEach(t=>{typeof t._update==`function`&&t._update(e)}),this.dispatchEvent(new CustomEvent(`routechange`,{detail:{path:e},bubbles:!0}))}_handlePopState=()=>{this._core?this._core._notify():this._syncRoutes()};_handleNavigate=e=>{let{path:t,replace:n}=e.detail;e.stopPropagation(),this.navigate(t,n)};connectedCallback(){this.handlerExternalCss(),this._events.on(window,`popstate`,this._handlePopState),this._events.on(this,`ran-navigate`,this._handleNavigate),this._events.on(this._slot,`slotchange`,()=>this._syncRoutes());let e=Q();e&&(this._core=e,e._bind(this)),this._syncRoutes(),typeof customElements<`u`&&customElements.whenDefined(`r-route`).then(()=>this._syncRoutes())}disconnectedCallback(){let e=Q();e&&e._unbind(this),this._core=null,this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&e===`sheet`&&this.handlerExternalCss()}};return Ge(`r-router`,$),e.Router=$,e.default=$,e})({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ranui_scratch=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`:host{position:relative;display:block;--ran-scratch-cover-background: var(--ran-color-text-secondary, var(--ran-gray-900))}:host([disabled]:not([disabled="false"])){cursor:var(--ran-scratch-disabled-cursor, not-allowed);opacity:var(--ran-scratch-disabled-opacity, .6)}:host([disabled]:not([disabled="false"])) .ran-scratch-ticket-canvas{pointer-events:none}.ran-scratch{display:flex;flex-direction:column;gap:var(--ran-space-2, 8px);height:100%}.ran-scratch-ticket{position:relative;display:block;width:100%;flex:1;min-height:0}.ran-scratch-ticket-award{position:absolute;top:0;left:0;display:block;width:100%;height:100%;background:var(--ran-scratch-award-background, var(--ran-color-bg-elevated, var(--ran-background-100)));z-index:1}.ran-scratch-ticket-canvas{position:absolute;top:0;left:0;display:block;width:100%;height:100%;z-index:2;cursor:var(--ran-scratch-cursor, pointer);touch-action:none;-webkit-tap-highlight-color:transparent}.ran-scratch-reveal{align-self:flex-end;flex-shrink:0;min-height:var(--ran-scratch-reveal-min-height, var(--ran-size-7, 32px));padding:0 var(--ran-space-3, 12px);border:1px solid var(--ran-color-border, var(--ran-gray-400));border-radius:var(--ran-radius-sm, 6px);background:var(--ran-color-bg-elevated, var(--ran-background-100));box-shadow:var(--ran-skin-raised-shadow, var(--ran-shadow-elevated));color:var(--ran-color-text, var(--ran-gray-1000));font:inherit;font-size:var(--ran-text-button-size, 14px);cursor:pointer}.ran-scratch-reveal:focus-visible{outline:var(--ran-scratch-focus-outline, 2px solid var(--ran-color-focus, #0a6cff));outline-offset:2px}@media(hover:hover){.ran-scratch-reveal:hover:not([aria-disabled=true],:disabled){background:var(--ran-color-bg-hover, var(--ran-gray-200))}}.ran-scratch-reveal:disabled{cursor:not-allowed}.ran-scratch-reveal[aria-disabled=true]:not(:disabled){cursor:default}.ran-scratch-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media(pointer:coarse){.ran-scratch-reveal{min-height:44px}}`,n=typeof document>`u`,r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:i=`"`;break;case 38:i=`&`;break;case 39:i=`'`;break;case 60:i=`<`;break;case 62:i=`>`;break;default:continue}s!==o&&(a+=t.substring(s,o)),s=o+1,a+=i}return s===o?a:a+t.substring(s,o)}var a=class{ac=null;get signal(){return this.ac??=new AbortController,this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},o=new Map,s=`data-adopted-style`,ee=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},te=(e,t,n=s)=>{if(t){if(typeof document>`u`){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t);return}if(!ee(e,t,o)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}}};Object.freeze({});var ne=null;function c(){return ne}var l=0,u=1,d=2,f=null,p=null,m=0,h=new Set,g=!1;function _(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ae(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)S(e,d);m===0&&oe()}}]}function v(e){let t=re(e,!0);return ie(t),w(t),()=>E(t)}function y(e){let t=f;f=null;try{return e()}finally{f=t}}function b(e){let t={owned:[],cleanups:[],owner:p},n=p,r=f;p=t,f=null;try{return e(()=>se(t))}finally{p=n,f=r}}function x(e){p&&p.cleanups.push(e)}function re(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:d,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:p}}function ie(e){p&&p.owned.push(e)}function ae(e){f&&(f.sources.add(e),e.observers.add(f))}function S(e,t){if(e.disposed||e.state>=t)return;let n=e.state===l;if(e.state=t,e.isEffect)h.add(e);else if(n)for(let t of e.observers)S(t,u)}function oe(){if(!(m>0||g)){g=!0;try{for(;h.size>0;){let e=[...h];h.clear();for(let t of e)t.disposed||C(t)}}finally{g=!1}}}function C(e){if(!(e.disposed||e.state===l)){if(e.state===u)for(let t of e.sources)`fn`in t&&C(t);e.state===d&&w(e),e.state=l}}function w(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);T(e);let t=f,n=p;f=e,p=e,e.running=!0,e.state=l;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)S(t,d)}}finally{e.running=!1,f=t,p=n}}function T(e){for(let t of e.owned)E(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function E(e){e.disposed||(e.disposed=!0,T(e),e.observers.clear())}function se(e){for(let t of e.owned)E(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function D(e){return i(e)}var ce=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,le=`.#[`;function ue(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n<e.length;){let r=e[n];if(r===`[`){let r=e.indexOf(`]`,n+1);if(r===-1)return null;t.push(e.slice(n,r+1)),n=r+1;continue}if(r!==`.`&&r!==`#`)return null;let i=n+1;for(;i<e.length&&!le.includes(e[i]);)i+=1;if(i===n+1)return null;t.push(e.slice(n,i)),n=i}return t.length>0?t:null}var de=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},fe=(e,t)=>{let n=t.trim();if(!n)return!1;let r=ue(n);return r!==null&&r.every(t=>de(e,t))},O=(e,t,n)=>{for(let r of e)ce(r)&&(fe(r,t)&&n.push(r),O(r.childrenList,t,n))};function k(e,t,n){if(n==null)return e.push(t),t;let r=e.indexOf(n);return r===-1?e.push(t):e.splice(r,0,t),t}var A=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}},pe=new Map,j=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??pe}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new A)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}attachShadow(e){return this.shadowRoot=new me(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName;this.shadowRoot&&!this.hasAttribute(`data-ran-dsd`)&&this.setAttribute(`data-ran-dsd`,``);let n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${D(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${D(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof A,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}</${t}>`}},me=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}get children(){return this.childrenList.filter(e=>typeof e!=`string`&&!(e instanceof A))}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return k(this.childrenList,e,t)}replaceChildren(...e){this.childrenList=e.filter(e=>e!=null)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return O(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${String(e).replace(/<\/style/gi,`<\\/style`)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof A,e.serialize())).join(``)}</template>`}},M={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let r of t){if(r==null)continue;if(Array.isArray(r)){M.append(e,r);continue}if(typeof r==`function`){M.append(e,[r()]);continue}if(typeof r==`object`&&(`__ranFor`in r||`__ranIndex`in r))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=r instanceof N?r.build():typeof r==`string`&&!n?document.createTextNode(r):r;e.appendChild(t)}}},he=`http://www.w3.org/2000/svg`,ge=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),N=class{runtime;el;constructor(e,t,r=M){this.runtime=r;let i=t??(ge.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=n?new j(e):i?document.createElementNS(i,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new _e(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},_e=class{runtime;root;hostEl;constructor(e,t,n,r=M){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},P=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(P(t)):e.concat(t),[]),F=e=>e==null?null:e instanceof N?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,ve=(e,t)=>{if(n){L(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};v(()=>{let e=t();o();let n=document.createDocumentFragment();a=b(t=>(L(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),x(()=>a?.())},ye=`__ranFor`,be=e=>typeof e==`object`&&!!e&&e[ye]===!0,xe=(e,t,n)=>{let[r,i]=_(t),a=null,o=b(t=>{let i=F(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},I=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},Se=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=F(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;x(()=>{for(let e of i.values())e.dispose();i.clear()}),v(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o)){De()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=i.get(o);s?(i.delete(o),s.index(r)):s=xe(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();I(r,a),i=n})},Ce=`__ranIndex`,we=e=>typeof e==`object`&&!!e&&e[Ce]===!0,Te=(e,t,n)=>{let[r,i]=_(e),a=null,o=b(e=>{let i=F(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Ee=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=F(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];x(()=>{for(let e of i)e.dispose();i=[]}),v(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(Te(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}I(r,i.map(e=>e.node).filter(e=>e!=null))})},L=(e,t)=>{n?y(()=>R(e,t)):R(e,t)},R=(e,t)=>{P(t).forEach(t=>{if(be(t)){Se(e,t);return}if(we(t)){Ee(e,t);return}if(typeof t==`function`){ve(e,t);return}let n=F(t);n!=null&&e.appendChild(n)})},De=()=>!1,Oe={bind(e,t){typeof e==`function`?n?y(()=>t(e())):v(()=>t(e())):t(e)},append:L},ke=class extends N{constructor(e,t){super(e,t,Oe)}};function Ae(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,he),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:z,Div:B,Svg:je,Span:Me,Slot:Ne,ButtonBuilder:Pe,InputBuilder:Fe,Style:Ie,Label:Le,Ul:Re,Li:ze,Section:Be,Article:Ve,Nav:He,Header:Ue,Footer:We,Main:Ge,DeclarativeShadow:Ke}=Ae(ke),qe=[!1,`false`,null,void 0],Je=e=>{let t=e.hasAttribute(`disabled`),n=e.getAttribute(`disabled`);return!(!t||qe.includes(n))},Ye=new Map;function Xe(e,t){n?(Ye.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ze=typeof document<`u`?HTMLElement:j,Qe=`data-ranui`,V=`data-ranui-sheet`,H=(e,t)=>{if(typeof document>`u`&&t){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t)}te(e,t,Qe)},U=new WeakMap,W=new Map,$e=e=>{if(typeof CSSStyleSheet>`u`)return;let t=W.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},W.set(e,t)}catch{return}return t.users++,t.sheet},G=e=>{let t=W.get(e);t&&--t.users===0&&W.delete(e)},et=(e,t)=>{if(typeof document>`u`)return;let n=U.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),G(n.text)):n&&e.querySelector(`style[${V}]`)?.remove(),U.delete(e),!t))return;let r=$e(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{G(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(V,``),n.textContent=t,e.appendChild(n)}U.set(e,{text:t,sheet:r})},K=new WeakMap,q=new WeakMap,tt=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,nt=`:host([hidden]){display:none}`,J=new Map,Y=e=>{let t=J.get(e);if(t!==void 0)return t;let n=`${nt}\n${tt}`,r=e?`${e}\n${n}`:n;return J.set(e,r),r},rt=e=>{let t=q.get(e);if(t)return t;try{let t=e.attachInternals;if(typeof t!=`function`)return;let n=t.call(e);return q.set(e,n),n}catch{return}},it=(e,t=``,n={mode:`closed`},r)=>{let i=r??rt(e),a=e.shadowRoot||K.get(e)||i?.shadowRoot||e.attachShadow(n);return K.set(e,a),H(a,Y(t)),a},at=(e,t,...n)=>{e.replaceChildren(...n),H(e,Y(t))},X=(e,t,n=``)=>e.getAttribute(t)??n,Z=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},ot=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&et(t,e.getAttribute(`sheet`)||``)},st=e=>e,ct=e=>{let t=e;for(;t;){let e=t.closest?.(`[lang]`)?.getAttribute(`lang`);if(e)return e;t=t.getRootNode?.()?.host}return``},lt=e=>{let t=(c()?.getLocale()||ct(e)||(typeof document<`u`?document.documentElement.lang:``)||`en`).toLowerCase();return/^zh[-_](hant|tw|hk|mo)\b/.test(t)?`en`:t.split(/[-_]/)[0]},Q=(e,t)=>t?e.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??e)):e,$=(e,t,n,r)=>{let i=c(),a=`ranui.${t}`;if(i){let e=i.getMessages(i.getLocale())[a];if(e!==void 0)return Q(e,r)}return Q(e[lt(n)]?.[t]??e.en[t],r)},ut=st({en:{"scratch.reveal":`Reveal`,"scratch.revealed":`Revealed`},zh:{"scratch.reveal":`直接揭晓`,"scratch.revealed":`已揭晓`},ja:{"scratch.reveal":`結果を見る`,"scratch.revealed":`表示済み`},ko:{"scratch.reveal":`결과 보기`,"scratch.revealed":`공개됨`},es:{"scratch.reveal":`Descubrir`,"scratch.revealed":`Descubierto`},pt:{"scratch.reveal":`Revelar`,"scratch.revealed":`Revelado`},de:{"scratch.reveal":`Aufdecken`,"scratch.revealed":`Aufgedeckt`},fa:{"scratch.reveal":`نمایش`,"scratch.revealed":`نمایش داده شد`}}),dt=.35,ft=class extends Ze{scratchTicketContainer;scratchTicket;state;scratchAward;revealButton;revealStatus;revealed=!1;coverInitialized=!1;_shadowDom;_events=new a;static get observedAttributes(){return[`disabled`,`sheet`,`reveal-label`,`revealed-label`]}constructor(){super(),this._shadowDom=it(this,t);let e=z(`canvas`).class(`ran-scratch-ticket-canvas`).attr(`aria-hidden`,`true`).style(`width`,`100%`).style(`height`,`100%`).build(),n=B().class(`ran-scratch-ticket-award`).part(`award`).children(Ne()).build(),r=B().class(`ran-scratch-ticket`).children(e,n).build(),i=z(`button`).class(`ran-scratch-reveal`).part(`reveal-button`).attr(`type`,`button`).build(),a=B().class(`ran-scratch-status`).attr(`role`,`status`).build(),o=B().class(`ran-scratch`).children(i,r,a).build();this.revealButton=i,this.revealStatus=a,at(this._shadowDom,t,o),this.scratchTicketContainer=r,this.scratchAward=n,this.scratchTicket=e,this.state={isScratching:!1,scratchedArea:0,lastX:0,lastY:0,activePointerId:void 0}}get disabled(){return Je(this)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get sheet(){return X(this,`sheet`)}set sheet(e){Z(this,`sheet`,e)}get revealLabel(){return X(this,`reveal-label`)||$(ut,`scratch.reveal`,this)}set revealLabel(e){Z(this,`reveal-label`,e)}get revealedLabel(){return X(this,`revealed-label`)||$(ut,`scratch.revealed`,this)}set revealedLabel(e){Z(this,`revealed-label`,e)}syncReveal=()=>{this.revealButton.textContent=this.revealed?this.revealedLabel:this.revealLabel,this.revealButton.disabled=this.disabled,this.revealButton.setAttribute(`aria-disabled`,String(this.disabled||this.revealed)),this.revealButton.tabIndex=this.revealed?-1:0,this.scratchAward.inert=!this.revealed,this.scratchTicket.style.pointerEvents=this.revealed?`none`:``};cancelScratch=()=>{let e=this.state.activePointerId;this.state.isScratching=!1,this.state.activePointerId=void 0,e!==void 0&&this.scratchTicket.hasPointerCapture?.(e)&&this.scratchTicket.releasePointerCapture(e)};reveal=()=>{if(this.disabled||this.revealed)return;let e=this.scratchTicket.getContext(`2d`);e&&(this.cancelScratch(),e.clearRect(0,0,this.scratchTicket.width,this.scratchTicket.height),this.state.scratchedArea=0,this.revealed=!0,this.syncReveal(),this.revealStatus.textContent=this.revealedLabel)};handlerExternalCss=()=>{ot(this,this._shadowDom,`sheet`,null,this.sheet)};syncDisabled=()=>{this.setAttribute(`aria-disabled`,this.disabled?`true`:`false`),this.disabled&&this.cancelScratch(),this.syncReveal()};brushRadius=()=>Math.max(14,Math.min(this.scratchTicket.width,this.scratchTicket.height)*.09);toCanvasPoint=(e,t)=>{let n=this.scratchTicket.getBoundingClientRect(),r=n.width>0?this.scratchTicket.width/n.width:1,i=n.height>0?this.scratchTicket.height/n.height:1;return{x:(e-n.left)*r,y:(t-n.top)*i}};scratchStroke=(e,t,n,r)=>{let i=this.scratchTicket.getContext(`2d`);if(!i)return;let a=this.brushRadius();i.globalCompositeOperation=`destination-out`,i.lineCap=`round`,i.lineJoin=`round`,i.lineWidth=a*2,i.beginPath(),i.moveTo(e,t),i.lineTo(n,r),i.stroke();let o=Math.max(Math.hypot(n-e,r-t),1);this.state.scratchedArea+=o*a*2};onScratchPointerDown=e=>{if(this.disabled||this.revealed||this.state.isScratching||e.pointerType===`mouse`&&e.button!==0)return;e.preventDefault(),this.state.isScratching=!0,this.state.activePointerId=e.pointerId,this.scratchTicket.setPointerCapture?.(e.pointerId);let{x:t,y:n}=this.toCanvasPoint(e.clientX,e.clientY);this.state.lastX=t,this.state.lastY=n,this.scratchStroke(t,n,t,n)};onScratchPointerMove=e=>{if(this.disabled||!this.state.isScratching||e.pointerId!==this.state.activePointerId)return;let{x:t,y:n}=this.toCanvasPoint(e.clientX,e.clientY);this.scratchStroke(this.state.lastX,this.state.lastY,t,n),this.state.lastX=t,this.state.lastY=n};onScratchPointerUp=e=>{if(e.pointerId!==this.state.activePointerId||(this.state.isScratching=!1,this.state.activePointerId=void 0,this.disabled))return;let{width:t,height:n}=this.scratchTicket;this.scratchTicket.getContext(`2d`)&&this.state.scratchedArea>t*n*dt&&this.reveal()};onScratchPointerCancel=e=>{e.pointerId===this.state.activePointerId&&this.cancelScratch()};drawScratchTicket=()=>{let e=this.scratchTicket.getContext(`2d`);if(!this.scratchTicketContainer||!e)return;let{width:t,height:n}=this.scratchTicket,r=getComputedStyle(this).getPropertyValue(`--ran-scratch-cover-background`).trim();e.globalCompositeOperation=`source-over`,e.fillStyle=r||`#6b6b6b`,e.fillRect(0,0,t,n),this.coverInitialized=!0};syncCanvasResolution=()=>{let e=this.scratchTicketContainer.getBoundingClientRect();if(e.width<=0||e.height<=0)return;let t=window.devicePixelRatio||1,n=Math.max(1,Math.round(e.width*t)),r=Math.max(1,Math.round(e.height*t));if(this.scratchTicket.width===n&&this.scratchTicket.height===r){this.coverInitialized||this.drawScratchTicket();return}let i=this.getRootNode().activeElement,a=this.revealed&&!!i&&this.contains(i)&&!this.disabled;this.scratchTicket.width=n,this.scratchTicket.height=r,this.cancelScratch(),this.state.scratchedArea=0,this.revealed=!1,this.revealStatus.textContent=``,this.syncReveal(),a&&this.revealButton.focus({preventScroll:!0}),this.drawScratchTicket()};onWindowResize=()=>{this.syncCanvasResolution()};connectedCallback(){this.handlerExternalCss(),this.syncDisabled(),this._events.on(this.revealButton,`click`,this.reveal).on(this.scratchTicket,`pointerdown`,this.onScratchPointerDown,{passive:!1}).on(this.scratchTicket,`pointermove`,this.onScratchPointerMove).on(this.scratchTicket,`pointerup`,this.onScratchPointerUp).on(this.scratchTicket,`pointercancel`,this.onScratchPointerCancel).on(this.scratchTicket,`lostpointercapture`,this.onScratchPointerCancel).on(window,`resize`,this.onWindowResize),this.syncCanvasResolution()}disconnectedCallback(){this.cancelScratch(),this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`disabled`&&this.syncDisabled(),e===`sheet`&&this.handlerExternalCss(),(e===`reveal-label`||e===`revealed-label`)&&this.syncReveal())}};return Xe(`r-scratch`,ft),e.default=ft,e})({});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ranui_section=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`:host{display:block;scroll-margin-top:var(--ran-section-scroll-margin-top, var(--ran-space-24, 96px));border-width:var(--ran-skin-border-width, 1px);border-style:var(--ran-skin-border-style, solid);border-color:var(--ran-section-border-color, var(--ran-color-border));border-radius:var(--ran-section-radius, var(--ran-radius-md));background:var(--ran-section-background, var(--ran-color-bg-elevated));box-shadow:var(--ran-section-shadow, var(--ran-shadow-elevated));padding:var(--ran-section-padding, var(--ran-space-8, 32px));box-sizing:border-box}.ran-section-header{display:grid;gap:var(--ran-section-header-gap, var(--ran-space-2, 8px));max-width:var(--ran-section-header-max-width, 48rem);margin-bottom:var(--ran-section-header-margin-bottom, var(--ran-space-6, 24px))}.ran-section-heading{margin:0;color:var(--ran-section-heading-color, var(--ran-color-text));font-size:var(--ran-section-heading-font-size, var(--ran-text-heading-2, 24px));font-weight:var(--ran-section-heading-font-weight, var(--ran-text-heading-weight, 600));line-height:1.25;letter-spacing:var(--ran-section-heading-letter-spacing, var(--ran-text-heading-tracking, -.03em))}.ran-section-heading:empty{display:none}.ran-section-subtitle{max-width:var(--ran-section-subtitle-max-width, 40rem);margin:0;color:var(--ran-section-subtitle-color, var(--ran-color-text-secondary))}.ran-section-subtitle:empty{display:none}.ran-section-body{min-width:0}`,n=typeof document>`u`,r=/["'&<>]/;function i(e){let t=``+e,n=r.exec(t);if(!n)return t;let i,a=``,o=0,s=0;for(o=n.index;o<t.length;o++){switch(t.charCodeAt(o)){case 34:i=`"`;break;case 38:i=`&`;break;case 39:i=`'`;break;case 60:i=`<`;break;case 62:i=`>`;break;default:continue}s!==o&&(a+=t.substring(s,o)),s=o+1,a+=i}return s===o?a:a+t.substring(s,o)}var a=class{ac=null;get signal(){return this.ac??=new AbortController,this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.signal}),this}abort(){this.ac?.abort(),this.ac=null}},o=new Map,s=`data-adopted-style`,ee=(e,t,n)=>{if(typeof CSSStyleSheet>`u`)return!1;try{if(!n.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),n.set(t,e)}let r=n.get(t);return e.adoptedStyleSheets.includes(r)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]),!0}catch{return!1}},te=(e,t,n=s)=>{if(t){if(typeof document>`u`){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t);return}if(!ee(e,t,o)&&!e.querySelector(`style[${n}]`)){let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,e.appendChild(r)}}},c=0,l=1,u=2,d=null,f=null,p=0,m=new Set,h=!1;function g(e,t){let n=t?.equals??Object.is,r={value:e,observers:new Set};return[()=>(ie(r),r.value),e=>{let t=typeof e==`function`?e(r.value):e;if(!n(r.value,t)){r.value=t;for(let e of r.observers)x(e,u);p===0&&ae()}}]}function _(e){let t=ne(e,!0);return re(t),C(t),()=>T(t)}function v(e){let t=d;d=null;try{return e()}finally{d=t}}function y(e){let t={owned:[],cleanups:[],owner:f},n=f,r=d;f=t,d=null;try{return e(()=>oe(t))}finally{f=n,d=r}}function b(e){f&&f.cleanups.push(e)}function ne(e,t,n){return{fn:e,sources:new Set,isEffect:t,running:!1,disposed:!1,state:u,observers:new Set,value:void 0,equals:n??Object.is,owned:[],cleanups:[],owner:f}}function re(e){f&&f.owned.push(e)}function ie(e){d&&(d.sources.add(e),e.observers.add(d))}function x(e,t){if(e.disposed||e.state>=t)return;let n=e.state===c;if(e.state=t,e.isEffect)m.add(e);else if(n)for(let t of e.observers)x(t,l)}function ae(){if(!(p>0||h)){h=!0;try{for(;m.size>0;){let e=[...m];m.clear();for(let t of e)t.disposed||S(t)}}finally{h=!1}}}function S(e){if(!(e.disposed||e.state===c)){if(e.state===l)for(let t of e.sources)`fn`in t&&S(t);e.state===u&&C(e),e.state=c}}function C(e){if(e.running)throw Error(`ranview reactivity: cyclic dependency detected (a computation triggered itself).`);w(e);let t=d,n=f;d=e,f=e,e.running=!0,e.state=c;try{let t=e.fn();if(e.isEffect)typeof t==`function`&&e.cleanups.push(t);else{let n=e.value;if(e.value=t,e.observers.size>0&&!e.equals(n,t))for(let t of e.observers)x(t,u)}}finally{e.running=!1,d=t,f=n}}function w(e){for(let t of e.owned)T(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0;for(let t of e.sources)t.observers.delete(e);e.sources.clear()}function T(e){e.disposed||(e.disposed=!0,w(e),e.observers.clear())}function oe(e){for(let t of e.owned)T(t);e.owned.length=0;for(let t of e.cleanups)t();e.cleanups.length=0}function E(e){return i(e)}var se=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,ce=`.#[`;function le(e){let t=[],n=0,r=/^[a-zA-Z][\w-]*/.exec(e);for(r!==null&&(t.push(r[0]),n=r[0].length);n<e.length;){let r=e[n];if(r===`[`){let r=e.indexOf(`]`,n+1);if(r===-1)return null;t.push(e.slice(n,r+1)),n=r+1;continue}if(r!==`.`&&r!==`#`)return null;let i=n+1;for(;i<e.length&&!ce.includes(e[i]);)i+=1;if(i===n+1)return null;t.push(e.slice(n,i)),n=i}return t.length>0?t:null}var ue=(e,t)=>{let n=t;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},de=(e,t)=>{let n=t.trim();if(!n)return!1;let r=le(n);return r!==null&&r.every(t=>ue(e,t))},D=(e,t,n)=>{for(let r of e)se(r)&&(de(r,t)&&n.push(r),D(r.childrenList,t,n))};function O(e,t,n){if(n==null)return e.push(t),t;let r=e.indexOf(n);return r===-1?e.push(t):e.splice(r,0,t),t}var k=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return O(this.childrenList,e,t)}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return D(this.childrenList,e,t),t}},fe=new Map,A=class{tagName;attributes=new Map;_inlineStyles=null;get inlineStyles(){return this._inlineStyles??fe}childrenList=[];shadowRoot=null;_textContent=null;get textContent(){return this._textContent}set textContent(e){this._textContent=e}content;eventListeners=null;_style=null;_classList=null;get style(){return this._style??={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();(this._inlineStyles??=new Map).set(n,t)},removeProperty:e=>this._inlineStyles?.delete(e)??!1}}get classList(){return this._classList??={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)}}_innerHTML=``;get innerHTML(){return this._textContent===null?this._innerHTML:i(this._textContent)}set innerHTML(e){this._innerHTML=e,this._textContent=null,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new k)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return O(this.childrenList,e,t)}attachShadow(e){return this.shadowRoot=new pe(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return D(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners??=new Map,r=n.get(e)||new Set;r.add(t),n.set(e,r)}removeEventListener(e,t){let n=this.eventListeners?.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners?.delete(e))}dispatchEvent(e){let t=this.eventListeners?.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName;this.shadowRoot&&!this.hasAttribute(`data-ran-dsd`)&&this.setAttribute(`data-ran-dsd`,``);let n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${E(t)}"`).join(``),r=this._inlineStyles?Array.from(this._inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`):``,a=r?` style="${E(r)}"`:``,o=``;return this.shadowRoot&&(o+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?o+=this._innerHTML:o+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof k,e.serialize())).join(``):o+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!o?`<${t}${n}${a} />`:`<${t}${n}${a}>${o}</${t}>`}},pe=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}get children(){return this.childrenList.filter(e=>typeof e!=`string`&&!(e instanceof k))}appendChild(e){return this.childrenList.push(e),e}insertBefore(e,t){return O(this.childrenList,e,t)}replaceChildren(...e){this.childrenList=e.filter(e=>e!=null)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return D(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${String(e).replace(/<\/style/gi,`<\\/style`)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof k,e.serialize())).join(``)}</template>`}},j={bind(e,t){t(typeof e==`function`?e():e)},append(e,t){for(let r of t){if(r==null)continue;if(Array.isArray(r)){j.append(e,r);continue}if(typeof r==`function`){j.append(e,[r()]);continue}if(typeof r==`object`&&(`__ranFor`in r||`__ranIndex`in r))throw TypeError(`Import For and Index from the static entry when using static builders`);let t=r instanceof M?r.build():typeof r==`string`&&!n?document.createTextNode(r):r;e.appendChild(t)}}},me=`http://www.w3.org/2000/svg`,he=new Set(`svg.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComposite.feDropShadow.feFlood.feGaussianBlur.feMerge.feMergeNode.feOffset.filter.foreignObject.g.image.line.linearGradient.marker.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.switch.symbol.text.textPath.tspan.use`.split(`.`)),M=class{runtime;el;constructor(e,t,r=j){this.runtime=r;let i=t??(he.has(e)?`http://www.w3.org/2000/svg`:void 0);this.el=n?new A(e):i?document.createElementNS(i,e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}bind(e,t){this.runtime.bind(e,t)}class(e){return this.bind(e,e=>{n?this.el.attributes.set(`class`,e):this.el.setAttribute(`class`,e)}),this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.bind(t,t=>this.el.setAttribute(e,t)),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return this.bind(t,t=>{t?this.el.setAttribute(e,n):this.el.removeAttribute(e)}),this}part(e){return this.attr(`part`,e)}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.bind(t??``,t=>this.el.style.setProperty(e,t)):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...e){return this.runtime.append(this.el,e),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.bind(e,e=>{this.el.textContent=e}),this}unsafeHtml(e){return this.bind(e,e=>{this.el.innerHTML=e}),this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new ge(this.el,t,e,this.runtime)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},ge=class{runtime;root;hostEl;constructor(e,t,n,r=j){this.runtime=r,this.hostEl=e,this.root=t}children(...e){return this.runtime.append(this.root,e),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},N=()=>({current:null}),P=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(P(t)):e.concat(t),[]),F=e=>e==null?null:e instanceof M?e.build():typeof e==`string`?n?e:document.createTextNode(e):e,_e=(e,t)=>{if(n){L(e,[t()]);return}let r=document.createComment(``),i=document.createComment(``);e.appendChild(r),e.appendChild(i);let a=null,o=()=>{a?.(),a=null;let e=r.nextSibling;for(;e&&e!==i;){let t=e.nextSibling;e.parentNode?.removeChild(e),e=t}};_(()=>{let e=t();o();let n=document.createDocumentFragment();a=y(t=>(L(n,[e]),t)),i.parentNode?.insertBefore(n,i)}),b(()=>a?.())},ve=`__ranFor`,ye=e=>typeof e==`object`&&!!e&&e[ve]===!0,be=(e,t,n)=>{let[r,i]=g(t),a=null,o=y(t=>{let i=F(n(e,r));return a=typeof i==`string`?document.createTextNode(i):i,t});return{node:a,index:i,dispose:o}},I=(e,t)=>{let n=e.parentNode;if(!n)return;let r=e;for(let e of t)r.nextSibling!==e&&n.insertBefore(e,r.nextSibling),r=e},xe=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=F(t.render(n,()=>r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=new Map;b(()=>{for(let e of i.values())e.dispose();i.clear()}),_(()=>{let e=t.each()??[],n=new Map,a=[];e.forEach((e,r)=>{let o=t.key(e,r);if(n.has(o)){Ee()&&console.error(`[ranview For] duplicate key "${String(o)}" — keys must be unique; ignoring the duplicate item.`);return}let s=i.get(o);s?(i.delete(o),s.index(r)):s=be(e,r,t.render),n.set(o,s),s.node&&a.push(s.node)});for(let e of i.values())e.node?.parentNode?.removeChild(e.node),e.dispose();I(r,a),i=n})},Se=`__ranIndex`,Ce=e=>typeof e==`object`&&!!e&&e[Se]===!0,we=(e,t,n)=>{let[r,i]=g(e),a=null,o=y(e=>{let i=F(n(r,t));return a=typeof i==`string`?document.createTextNode(i):i,e});return{node:a,setItem:i,dispose:o}},Te=(e,t)=>{if(n){(t.each()??[]).forEach((n,r)=>{let i=F(t.render(()=>n,r));i!=null&&e.appendChild(i)});return}let r=document.createComment(``);e.appendChild(r);let i=[];b(()=>{for(let e of i)e.dispose();i=[]}),_(()=>{let e=t.each()??[];for(let n=0;n<e.length;n++)n<i.length?i[n].setItem(e[n]):i.push(we(e[n],n,t.render));for(let t=i.length-1;t>=e.length;t--){let{node:e}=i[t];e?.parentNode?.removeChild(e),i[t].dispose(),i.pop()}I(r,i.map(e=>e.node).filter(e=>e!=null))})},L=(e,t)=>{n?v(()=>R(e,t)):R(e,t)},R=(e,t)=>{P(t).forEach(t=>{if(ye(t)){xe(e,t);return}if(Ce(t)){Te(e,t);return}if(typeof t==`function`){_e(e,t);return}let n=F(t);n!=null&&e.appendChild(n)})},Ee=()=>!1,De={bind(e,t){typeof e==`function`?n?v(()=>t(e())):_(()=>t(e())):t(e)},append:L},Oe=class extends M{constructor(e,t){super(e,t,De)}};function ke(e){let t=t=>new e(t);return{View:t,Div:()=>t(`div`),Svg:t=>new e(t,me),Span:()=>t(`span`),Slot:()=>t(`slot`),ButtonBuilder:()=>t(`button`),InputBuilder:()=>t(`input`),Style:()=>t(`style`),Label:()=>t(`label`),Ul:()=>t(`ul`),Li:()=>t(`li`),Section:()=>t(`section`),Article:()=>t(`article`),Nav:()=>t(`nav`),Header:()=>t(`header`),Footer:()=>t(`footer`),Main:()=>t(`main`),DeclarativeShadow:(e=`open`,n=!1)=>{let r=t(`template`);return r.attr(`shadowrootmode`,e),n&&r.attr(`shadowrootdelegatesfocus`,``),r}}}var{View:Ae,Div:z,Svg:je,Span:Me,Slot:Ne,ButtonBuilder:Pe,InputBuilder:Fe,Style:Ie,Label:Le,Ul:Re,Li:ze,Section:Be,Article:Ve,Nav:He,Header:Ue,Footer:We,Main:Ge,DeclarativeShadow:Ke}=ke(Oe),qe=new Map;function Je(e,t){n?(qe.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var Ye=typeof document<`u`?HTMLElement:A,Xe=`data-ranui`,B=`data-ranui-sheet`,V=(e,t)=>{if(typeof document>`u`&&t){let n=e.adoptedStyleSheets;Array.isArray(n)&&!n.includes(t)&&n.push(t)}te(e,t,Xe)},H=new WeakMap,U=new Map,Ze=e=>{if(typeof CSSStyleSheet>`u`)return;let t=U.get(e);if(!t)try{let n=new CSSStyleSheet;n.replaceSync(e),t={sheet:n,users:0},U.set(e,t)}catch{return}return t.users++,t.sheet},W=e=>{let t=U.get(e);t&&--t.users===0&&U.delete(e)},Qe=(e,t)=>{if(typeof document>`u`)return;let n=H.get(e);if((n?.text??``)===t||(n?.sheet?(e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==n.sheet),W(n.text)):n&&e.querySelector(`style[${B}]`)?.remove(),H.delete(e),!t))return;let r=Ze(t);if(r)try{e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]}catch{W(t),r=void 0}if(!r){let n=document.createElement(`style`);n.setAttribute(B,``),n.textContent=t,e.appendChild(n)}H.set(e,{text:t,sheet:r})},G=new WeakMap,K=new WeakMap,$e=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,et=`:host([hidden]){display:none}`,q=new Map,J=e=>{let t=q.get(e);if(t!==void 0)return t;let n=`${et}\n${$e}`,r=e?`${e}\n${n}`:n;return q.set(e,r),r},tt=e=>{let t=K.get(e);if(t)return t;try{let t=e.attachInternals;if(typeof t!=`function`)return;let n=t.call(e);return K.set(e,n),n}catch{return}},nt=(e,t=``,n={mode:`closed`},r)=>{let i=r??tt(e),a=e.shadowRoot||G.get(e)||i?.shadowRoot||e.attachShadow(n);return G.set(e,a),V(a,J(t)),a},rt=(e,t,...n)=>{e.replaceChildren(...n),V(e,J(t))},Y=(e,t)=>{if(e.current===null)throw Error(`ranui: ${t} is missing its .ref() on the builder`);return e.current},X=(e,t,n=``)=>e.getAttribute(t)??n,Z=(e,t,n,r={})=>{r.removeEmpty&&!n?e.removeAttribute(t):e.setAttribute(t,n??``)},Q=(e,t,n,r,i)=>{n===`sheet`&&r!==i&&Qe(t,e.getAttribute(`sheet`)||``)},$=class extends Ye{_shadowDom;_headerEl;_headingEl;_subtitleEl;_events=new a;static get observedAttributes(){return[`heading`,`subtitle`,`sheet`]}constructor(){super(),this._shadowDom=nt(this,t);let e=N(),n=N(),r=z().class(`ran-section-header`).attr(`part`,`header`).children(z().class(`ran-section-heading`).ref(e).attr(`part`,`heading`).attr(`role`,`heading`).attr(`aria-level`,`2`),z().class(`ran-section-subtitle`).ref(n).attr(`part`,`subtitle`)).build();rt(this._shadowDom,t,r,z().class(`ran-section-body`).attr(`part`,`body`).children(Ne()).build()),this._headerEl=r,this._headingEl=Y(e,`heading`),this._subtitleEl=Y(n,`subtitle`)}get heading(){return X(this,`heading`)}set heading(e){Z(this,`heading`,e)}get subtitle(){return X(this,`subtitle`)}set subtitle(e){Z(this,`subtitle`,e)}get sheet(){return X(this,`sheet`)}set sheet(e){Z(this,`sheet`,e)}_syncHeading(){this._headingEl.textContent=this.getAttribute(`heading`)??``,this._headerEl.style.display=this._headingEl.textContent||this._subtitleEl.textContent?``:`none`}_syncSubtitle(){this._subtitleEl.textContent=this.getAttribute(`subtitle`)??``,this._headerEl.style.display=this._headingEl.textContent||this._subtitleEl.textContent?``:`none`}connectedCallback(){this._syncHeading(),this._syncSubtitle(),Q(this,this._shadowDom,`sheet`,null,this.sheet)}disconnectedCallback(){this._events.abort()}attributeChangedCallback(e,t,n){t!==n&&(e===`heading`&&this._syncHeading(),e===`subtitle`&&this._syncSubtitle(),e===`sheet`&&Q(this,this._shadowDom,e,t,n))}};return Je(`r-section`,$),e.Section=$,e.default=$,e})({});
|