@roxyapi/ui 0.38.0 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/AGENTS.md +4 -4
  2. package/README.md +4 -4
  3. package/components-catalog.json +207 -153
  4. package/dist/cdn/components/endpoint-form.js +1 -1
  5. package/dist/cdn/components/endpoint-form.js.map +1 -1
  6. package/dist/cdn/components/hexagram.js +2 -2
  7. package/dist/cdn/components/hexagram.js.map +2 -2
  8. package/dist/cdn/components/vastu-mandala.js +5 -5
  9. package/dist/cdn/components/vastu-mandala.js.map +3 -3
  10. package/dist/cdn/roxy-ui.js +19 -19
  11. package/dist/cdn/roxy-ui.js.map +3 -3
  12. package/dist/components/endpoint-form.js +1 -1
  13. package/dist/components/endpoint-form.js.map +1 -1
  14. package/dist/components/hexagram.d.ts +5 -4
  15. package/dist/components/hexagram.d.ts.map +1 -1
  16. package/dist/components/hexagram.js +1 -1
  17. package/dist/components/hexagram.js.map +2 -2
  18. package/dist/components/vastu-mandala.d.ts +13 -0
  19. package/dist/components/vastu-mandala.d.ts.map +1 -1
  20. package/dist/components/vastu-mandala.js +4 -4
  21. package/dist/components/vastu-mandala.js.map +3 -3
  22. package/dist/generated/endpoint-bindings.d.ts.map +1 -1
  23. package/dist/generated/tool-components.d.ts.map +1 -1
  24. package/dist/index.cjs +16 -16
  25. package/dist/index.cjs.map +3 -3
  26. package/dist/index.js +19 -19
  27. package/dist/index.js.map +3 -3
  28. package/dist/schemas/get--feng-shui-bagua.json +1 -1
  29. package/dist/schemas/get--feng-shui-flying-stars-stars.json +1 -1
  30. package/dist/schemas/post--vastu-entrance.json +1 -1
  31. package/dist/styles/themes/practitioner.css +5 -5
  32. package/dist/types/types.gen.d.ts +182 -62
  33. package/dist/types/types.gen.d.ts.map +1 -1
  34. package/dist/version.d.ts +1 -1
  35. package/package.json +1 -1
  36. package/src/components/hexagram.ts +29 -24
  37. package/src/components/vastu-mandala.ts +38 -5
  38. package/src/generated/endpoint-bindings.ts +54 -0
  39. package/src/generated/tool-components.ts +45 -0
  40. package/src/manifest.ts +4 -4
  41. package/src/styles/themes/practitioner.css +5 -5
  42. package/src/types/types.gen.ts +182 -62
  43. package/src/version.ts +1 -1
@@ -278,9 +278,9 @@ var RoxyUI_hexagram=(()=>{var q=Object.defineProperty;var xe=Object.getOwnProper
278
278
  --roxy-motion-duration: 0ms;
279
279
  }
280
280
  }
281
- `;var z="roxy-ui-tokens";function G(){if(typeof document>"u")return null;let s=document.getElementById(z);if(s)return s;let e=document.createElement("style");return e.id=z,e.textContent=be,document.head.prepend(e),e}var B=globalThis,K=B.ShadowRoot&&(B.ShadyCSS===void 0||B.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ne=Symbol(),ve=new WeakMap,U=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==ne)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(K&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=ve.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&ve.set(t,e))}return e}toString(){return this.cssText}},$e=s=>new U(typeof s=="string"?s:s+"",void 0,ne),b=(s,...e)=>{let t=s.length===1?s[0]:e.reduce((r,n,o)=>r+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+s[o+1],s[0]);return new U(t,s,ne)},we=(s,e)=>{if(K)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=B.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,s.appendChild(r)}},oe=K?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return $e(t)})(s):s;var{is:st,defineProperty:nt,getOwnPropertyDescriptor:ot,getOwnPropertyNames:it,getOwnPropertySymbols:at,getPrototypeOf:lt}=Object,F=globalThis,Se=F.trustedTypes,ct=Se?Se.emptyScript:"",dt=F.reactiveElementPolyfillSupport,P=(s,e)=>s,H={toAttribute(s,e){switch(e){case Boolean:s=s?ct:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},Y=(s,e)=>!st(s,e),_e={attribute:!0,type:String,converter:H,reflect:!1,useDefault:!1,hasChanged:Y};Symbol.metadata??=Symbol("metadata"),F.litPropertyMetadata??=new WeakMap;var v=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_e){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&nt(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:o}=ot(this.prototype,e)??{get(){return this[t]},set(i){this[t]=i}};return{get:n,set(i){let l=n?.call(this);o?.call(this,i),this.requestUpdate(e,l,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_e}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;let e=lt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){let t=this.properties,r=[...it(t),...at(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(oe(n))}else e!==void 0&&t.push(oe(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return we(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:H).toAttribute(t,r.type);this._$Em=e,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,t){let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let o=r.getPropertyOptions(n),i=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:H;this._$Em=n;let l=i.fromAttribute(t,o.type);this[n]=l??this._$Ej?.get(n)??l,this._$Em=null}}requestUpdate(e,t,r,n=!1,o){if(e!==void 0){let i=this.constructor;if(n===!1&&(o=this[e]),r??=i.getPropertyOptions(e),!((r.hasChanged??Y)(o,t)||r.useDefault&&r.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:o},i){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),o!==!0||i!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[n,o]of r){let{wrapped:i}=o,l=this[n];i!==!0||this._$AL.has(n)||l===void 0||this.C(n,void 0,o,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};v.elementStyles=[],v.shadowRootOptions={mode:"open"},v[P("elementProperties")]=new Map,v[P("finalized")]=new Map,dt?.({ReactiveElement:v}),(F.reactiveElementVersions??=[]).push("2.1.2");var pe=globalThis,Ae=s=>s,V=pe.trustedTypes,ke=V?V.createPolicy("lit-html",{createHTML:s=>s}):void 0,Oe="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,Ue="?"+$,ht=`<${Ue}>`,k=document,N=()=>k.createComment(""),j=s=>s===null||typeof s!="object"&&typeof s!="function",ue=Array.isArray,pt=s=>ue(s)||typeof s?.[Symbol.iterator]=="function",ie=`[
281
+ `;var z="roxy-ui-tokens";function G(){if(typeof document>"u")return null;let s=document.getElementById(z);if(s)return s;let e=document.createElement("style");return e.id=z,e.textContent=be,document.head.prepend(e),e}var B=globalThis,K=B.ShadowRoot&&(B.ShadyCSS===void 0||B.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ne=Symbol(),ve=new WeakMap,U=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==ne)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(K&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=ve.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&ve.set(t,e))}return e}toString(){return this.cssText}},$e=s=>new U(typeof s=="string"?s:s+"",void 0,ne),b=(s,...e)=>{let t=s.length===1?s[0]:e.reduce((r,n,o)=>r+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+s[o+1],s[0]);return new U(t,s,ne)},we=(s,e)=>{if(K)s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),n=B.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,s.appendChild(r)}},oe=K?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return $e(t)})(s):s;var{is:st,defineProperty:nt,getOwnPropertyDescriptor:ot,getOwnPropertyNames:it,getOwnPropertySymbols:at,getPrototypeOf:lt}=Object,F=globalThis,Se=F.trustedTypes,ct=Se?Se.emptyScript:"",dt=F.reactiveElementPolyfillSupport,P=(s,e)=>s,H={toAttribute(s,e){switch(e){case Boolean:s=s?ct:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},Y=(s,e)=>!st(s,e),_e={attribute:!0,type:String,converter:H,reflect:!1,useDefault:!1,hasChanged:Y};Symbol.metadata??=Symbol("metadata"),F.litPropertyMetadata??=new WeakMap;var v=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=_e){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),n=this.getPropertyDescriptor(e,r,t);n!==void 0&&nt(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){let{get:n,set:o}=ot(this.prototype,e)??{get(){return this[t]},set(i){this[t]=i}};return{get:n,set(i){let a=n?.call(this);o?.call(this,i),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??_e}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;let e=lt(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){let t=this.properties,r=[...it(t),...at(t)];for(let n of r)this.createProperty(n,t[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,n]of t)this.elementProperties.set(r,n)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let n=this._$Eu(t,r);n!==void 0&&this._$Eh.set(n,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(oe(n))}else e!==void 0&&t.push(oe(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return we(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),n=this.constructor._$Eu(e,r);if(n!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:H).toAttribute(t,r.type);this._$Em=e,o==null?this.removeAttribute(n):this.setAttribute(n,o),this._$Em=null}}_$AK(e,t){let r=this.constructor,n=r._$Eh.get(e);if(n!==void 0&&this._$Em!==n){let o=r.getPropertyOptions(n),i=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:H;this._$Em=n;let a=i.fromAttribute(t,o.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(e,t,r,n=!1,o){if(e!==void 0){let i=this.constructor;if(n===!1&&(o=this[e]),r??=i.getPropertyOptions(e),!((r.hasChanged??Y)(o,t)||r.useDefault&&r.reflect&&o===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:n,wrapped:o},i){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),o!==!0||i!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),n===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[n,o]of r){let{wrapped:i}=o,a=this[n];i!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,o,a)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(t)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};v.elementStyles=[],v.shadowRootOptions={mode:"open"},v[P("elementProperties")]=new Map,v[P("finalized")]=new Map,dt?.({ReactiveElement:v}),(F.reactiveElementVersions??=[]).push("2.1.2");var pe=globalThis,Ae=s=>s,V=pe.trustedTypes,ke=V?V.createPolicy("lit-html",{createHTML:s=>s}):void 0,Oe="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,Ue="?"+$,ht=`<${Ue}>`,k=document,N=()=>k.createComment(""),j=s=>s===null||typeof s!="object"&&typeof s!="function",ue=Array.isArray,pt=s=>ue(s)||typeof s?.[Symbol.iterator]=="function",ie=`[
282
282
  \f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Re=/-->/g,Ce=/>/g,_=RegExp(`>|${ie}(?:([^\\s"'>=/]+)(${ie}*=${ie}*(?:[^
283
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Ee=/'/g,Te=/"/g,Pe=/^(?:script|style|textarea|title)$/i,me=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),d=me(1),ge=me(2),It=me(3),R=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),Le=new WeakMap,A=k.createTreeWalker(k,129);function He(s,e){if(!ue(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return ke!==void 0?ke.createHTML(e):e}var ut=(s,e)=>{let t=s.length-1,r=[],n,o=e===2?"<svg>":e===3?"<math>":"",i=M;for(let l=0;l<t;l++){let a=s[l],u,p,h=-1,y=0;for(;y<a.length&&(i.lastIndex=y,p=i.exec(a),p!==null);)y=i.lastIndex,i===M?p[1]==="!--"?i=Re:p[1]!==void 0?i=Ce:p[2]!==void 0?(Pe.test(p[2])&&(n=RegExp("</"+p[2],"g")),i=_):p[3]!==void 0&&(i=_):i===_?p[0]===">"?(i=n??M,h=-1):p[1]===void 0?h=-2:(h=i.lastIndex-p[2].length,u=p[1],i=p[3]===void 0?_:p[3]==='"'?Te:Ee):i===Te||i===Ee?i=_:i===Re||i===Ce?i=M:(i=_,n=void 0);let x=i===_&&s[l+1].startsWith("/>")?" ":"";o+=i===M?a+ht:h>=0?(r.push(u),a.slice(0,h)+Oe+a.slice(h)+$+x):a+$+(h===-2?l:x)}return[He(s,o+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},I=class s{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,i=0,l=e.length-1,a=this.parts,[u,p]=ut(e,t);if(this.el=s.createElement(u,r),A.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=A.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let h of n.getAttributeNames())if(h.endsWith(Oe)){let y=p[i++],x=n.getAttribute(h).split($),S=/([.?@])?(.*)/.exec(y);a.push({type:1,index:o,name:S[2],strings:x,ctor:S[1]==="."?le:S[1]==="?"?ce:S[1]==="@"?de:E}),n.removeAttribute(h)}else h.startsWith($)&&(a.push({type:6,index:o}),n.removeAttribute(h));if(Pe.test(n.tagName)){let h=n.textContent.split($),y=h.length-1;if(y>0){n.textContent=V?V.emptyScript:"";for(let x=0;x<y;x++)n.append(h[x],N()),A.nextNode(),a.push({type:2,index:++o});n.append(h[y],N())}}}else if(n.nodeType===8)if(n.data===Ue)a.push({type:2,index:o});else{let h=-1;for(;(h=n.data.indexOf($,h+1))!==-1;)a.push({type:7,index:o}),h+=$.length-1}o++}}static createElement(e,t){let r=k.createElement("template");return r.innerHTML=e,r}};function C(s,e,t=s,r){if(e===R)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl,o=j(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),o===void 0?n=void 0:(n=new o(s),n._$AT(s,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=C(s,n._$AS(s,e.values),n,r)),e}var ae=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,n=(e?.creationScope??k).importNode(t,!0);A.currentNode=n;let o=A.nextNode(),i=0,l=0,a=r[0];for(;a!==void 0;){if(i===a.index){let u;a.type===2?u=new D(o,o.nextSibling,this,e):a.type===1?u=new a.ctor(o,a.name,a.strings,this,e):a.type===6&&(u=new he(o,this,e)),this._$AV.push(u),a=r[++l]}i!==a?.index&&(o=A.nextNode(),i++)}return A.currentNode=k,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},D=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=C(this,e,t),j(e)?e===c||e==null||e===""?(this._$AH!==c&&this._$AR(),this._$AH=c):e!==this._$AH&&e!==R&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):pt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==c&&j(this._$AH)?this._$AA.nextSibling.data=e:this.T(k.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=I.createElement(He(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{let o=new ae(n,this),i=o.u(this.options);o.p(t),this.T(i),this._$AH=o}}_$AC(e){let t=Le.get(e.strings);return t===void 0&&Le.set(e.strings,t=new I(e)),t}k(e){ue(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let o of e)n===t.length?t.push(r=new s(this.O(N()),this.O(N()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=Ae(e).nextSibling;Ae(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},E=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=c,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=c}_$AI(e,t=this,r,n){let o=this.strings,i=!1;if(o===void 0)e=C(this,e,t,0),i=!j(e)||e!==this._$AH&&e!==R,i&&(this._$AH=e);else{let l=e,a,u;for(e=o[0],a=0;a<o.length-1;a++)u=C(this,l[r+a],t,a),u===R&&(u=this._$AH[a]),i||=!j(u)||u!==this._$AH[a],u===c?e=c:e!==c&&(e+=(u??"")+o[a+1]),this._$AH[a]=u}i&&!n&&this.j(e)}j(e){e===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},le=class extends E{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===c?void 0:e}},ce=class extends E{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==c)}},de=class extends E{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=C(this,e,t,0)??c)===R)return;let r=this._$AH,n=e===c&&r!==c||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==c&&(r===c||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},he=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){C(this,e)}};var mt=pe.litHtmlPolyfillSupport;mt?.(I,D),(pe.litHtmlVersions??=[]).push("3.3.3");var Me=(s,e,t)=>{let r=t?.renderBefore??e,n=r._$litPart$;if(n===void 0){let o=t?.renderBefore??null;r._$litPart$=n=new D(e.insertBefore(N(),o),o,void 0,t??{})}return n._$AI(s),n};var fe=globalThis,w=class extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Me(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return R}};w._$litElement$=!0,w.finalized=!0,fe.litElementHydrateSupport?.({LitElement:w});var gt=fe.litElementPolyfillSupport;gt?.({LitElement:w});(fe.litElementVersions??=[]).push("4.2.2");var Ne=s=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(s,e)}):customElements.define(s,e)};var ft={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:Y},yt=(s=ft,e,t)=>{let{kind:r,metadata:n}=t,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),r==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(t.name,s),r==="accessor"){let{name:i}=t;return{set(l){let a=e.get.call(this);e.set.call(this,l),this.requestUpdate(i,a,s,!0,l)},init(l){return l!==void 0&&this.C(i,void 0,s,l),l}}}if(r==="setter"){let{name:i}=t;return function(l){let a=this[i];e.call(this,l),this.requestUpdate(i,a,s,!0,l)}}throw Error("Unsupported decorator location: "+r)};function f(s){return(e,t)=>typeof t=="object"?yt(s,e,t):((r,n,o)=>{let i=n.hasOwnProperty(o);return n.constructor.createProperty(o,r),i?Object.getOwnPropertyDescriptor(n,o):void 0})(s,e,t)}function T(s){return f({...s,state:!0,attribute:!1})}function J(s){return s.toLowerCase().replace(/[\s_-]+/g," ").trim()}var xt=(s,e)=>e?s[J(e)]:void 0;var bt={heaven:"☰",lake:"☱",fire:"☲",thunder:"☳",wind:"☴",water:"☵",mountain:"☶",earth:"☷"},ye=s=>xt(bt,s);var L=s=>s??c;function je(s){if(s.lang)return s.lang;if(typeof document>"u")return;let e=s.closest?.("[lang]")?.getAttribute("lang");return e||document.documentElement.lang||void 0}var Ie="__ROXY_UI_I18N__";function qe(){let s=globalThis,e=s[Ie];if(e)return e;let t={catalogs:{},fieldLabels:{},requested:new Set,listeners:new Set};return s[Ie]=t,t}function De(s,e){return e?s.replace(/\{\{(\w+)\}\}/g,(t,r)=>r in e?String(e[r]??""):t):s}function ze(s,e,t){if(!s)return De(e,t);let{catalogs:r}=qe(),n=s.toLowerCase(),o=r[n]??r[n.split("-")[0]];return De(o?.[J(e)]??e,t)}function Ge(s){let{listeners:e}=qe();return e.add(s),()=>{e.delete(s)}}var X=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){this.unsubscribe=Ge(()=>this.host.requestUpdate())}hostDisconnected(){this.unsubscribe?.(),this.unsubscribe=void 0}};var Z=class extends w{constructor(){super();this.translator=(t,r)=>this.t(t,r);new X(this)}t(t,r){return ze(this.effectiveLang(),t,r)}effectiveLang(){return je(this)}};var Q=b`:host{--roxy-label-col:minmax(0, 25%);font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var vt="__cols",$t="__rows";function wt(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function ee(s){if(Array.isArray(s)){let o=!1,i=s.map(l=>{let a=ee(l);return a!==l&&(o=!0),a});return o?i:s}if(!wt(s))return s;let e=s[vt],t=s[$t];if(Array.isArray(e)&&Array.isArray(t)&&Object.keys(s).length===2)return t.map(o=>{let i={};return e.forEach((l,a)=>{i[l]=ee(o[a])}),i});let r=!1,n={};for(let[o,i]of Object.entries(s)){let l=ee(i);l!==i&&(r=!0),n[o]=l}return r?n:s}function Be(s){return ee(s)}var te="Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.";function Ke(s){return!!s&&!s.startsWith("pk_")}function Fe(s,e={}){e.warn&&console.warn(te),s.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:"possible-secret-key",message:te},bubbles:!0,composed:!0}))}var St="https://roxyapi.com/api/v2";async function _t(s){try{let e=await s.json();if(e?.error)return e.error}catch{}return`Request failed (${s.status})`}var re=class{constructor(e){this.baseUrl=St;this.host=e,e.addController(this)}hostDisconnected(){this.abort?.abort(),this.abort=void 0}async run(e){if(!this.submitUrl&&this.secretKeyRefused())return;this.abort?.abort();let t=new AbortController;this.abort=t,this.host.loading=!0,this.host.error=null;try{let r=this.submitUrl?await fetch(this.submitUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:this.proxyBody(e),signal:t.signal}):await this.callApi(e,t.signal);if(!r.ok)throw new Error(await _t(r));let n=await r.json();if(t.signal.aborted)return;this.host.data=n}catch(r){if(r?.name==="AbortError")return;this.host.error=r instanceof Error?r.message:String(r)}finally{this.abort===t&&(this.abort=void 0),t.signal.aborted||(this.host.loading=!1)}}proxyBody(e){return JSON.stringify(this.submitContext?{...e,context:this.submitContext}:e)}callApi(e,t){let r=new URL(`${this.baseUrl}${e.path}`,document.baseURI);for(let[o,i]of Object.entries(e.query??{}))i!=null&&r.searchParams.set(o,String(i));let n={Accept:"application/json"};return this.publishableKey&&(n["X-API-Key"]=this.publishableKey),e.body!=null&&(n["Content-Type"]="application/json"),fetch(r,{method:e.method??"GET",headers:n,body:e.body!=null?JSON.stringify(e.body):void 0,signal:t})}secretKeyRefused(){return Ke(this.publishableKey)?(this.host.error=te,Fe(this.host),!0):!1}};function Ye(s,e,t,r=[]){let n={...t},o=`/${s.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(u,p)=>{let h=n[p];return delete n[p],encodeURIComponent(String(h??""))}),i=new Set(r),l={},a={};for(let[u,p]of Object.entries(n))p===void 0||p===""||(e==="GET"||i.has(u)?l[u]=p:a[u]=p);return{path:o,method:e,query:l,body:e==="POST"?a:void 0}}function Ve(){return d`<svg class="roxy-chevron" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`}var We=b`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;var At=b`.interp-keywords{flex-wrap:wrap;gap:.25rem;display:flex}.interp-keywords .kw{border-radius:var(--roxy-radius-full,9999px);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-xs,.75rem);padding:1px 8px}`,Je=b`.block{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.block h3{margin:0 0 var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.interp-card{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);margin-bottom:var(--roxy-space-xs,.25rem)}.interp-card summary{cursor:pointer;color:var(--roxy-fg,#0a0a0a);align-items:center;gap:var(--roxy-space-sm,.5rem);font-weight:500;font-size:var(--roxy-text-sm,.875rem);display:flex}.interp-card summary:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:var(--roxy-radius-sm,4px)}.interp-lead{flex-wrap:wrap;flex:auto;order:1;align-items:baseline;gap:.4rem;min-width:0;display:inline-flex}.interp-aside{flex-shrink:0;order:2;align-items:center;gap:.5rem;display:inline-flex}.roxy-chevron{order:3}.interp-aside small{color:var(--roxy-muted,#71717a);white-space:nowrap;font-weight:400}@container (width<=26rem){.interp-card summary{flex-wrap:wrap}.roxy-chevron{order:2}.interp-aside{flex-basis:100%;order:3;justify-content:flex-end}}.interp-body{margin-top:var(--roxy-space-sm,.5rem);gap:var(--roxy-space-sm,.5rem);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);overflow-wrap:anywhere;line-height:1.6;display:grid}.interp-body p{margin:0}${At}`;function Xe(s,e,t){let r=s.filter(n=>!!n.body);return r.length===0?c:d`<section class="block" part="section readings"><h3>${t}</h3>${r.map((n,o)=>d`<details class="interp-card" part="reading" name="${e}" ?open="${o===0}"><summary><span class="interp-lead">${n.label}</span> ${Ve()} ${n.aside?d`<span class="interp-aside"><small>${n.aside}</small></span>`:c}</summary><div class="interp-body"><p>${n.body}</p>${n.extra??c}</div></details>`)}</section>`}var kt="roxy-data";function Rt(s){return s.nodeName==="SCRIPT"&&s.getAttribute("type")==="application/json"}var se=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(Rt(e)&&e.classList.contains(kt))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};var Ct={fromAttribute:s=>{if(s!=null){try{let e=JSON.parse(s);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}console.warn("[roxy-ui] submit-context must be a JSON object; sending the request without it.")}}},m=class extends Z{constructor(){super();this.data=null;this.endpoint="";this.method="POST";this.remember=!1;this.hideReadings=!1;this.hideSections="";this.loading=!1;this.error=null;this.selfFetched=!1;this.editing=!1;this.sticky=!1;this.onEdit=()=>{this.editing=!0};this.onFormSubmit=t=>{let r=t.detail;this.lastValues=r.values,this.sticky=!!r.sticky,this.selfFetched=!0,this.editing=!1,this.remember&&this.writeRemembered(r.values),this.fetcher.run(Ye(this.endpoint,this.method,r.values,r.queryKeys??[]))};new se(this),this.fetcher=new re(this)}static{this.styles=[Q]}willUpdate(t){if(t.has("data")&&this.data!=null){let r=Be(this.data);r!==this.data&&(this.data=r)}t.has("publishableKey")&&(this.fetcher.publishableKey=this.publishableKey),t.has("baseUrl")&&this.baseUrl&&(this.fetcher.baseUrl=this.baseUrl),t.has("submitUrl")&&(this.fetcher.submitUrl=this.submitUrl),t.has("submitContext")&&(this.fetcher.submitContext=this.submitContext)}render(){return d`${this.hiddenSectionsStyle()}${this.renderState()}`}hiddenSectionsStyle(){let t=this.hideSections.split(",").map(n=>n.trim().toLowerCase()).filter(n=>/^[a-z][a-z0-9-]*$/.test(n));if(t.length===0)return c;let r=t.map(n=>`[part~="${n}"]{display:none!important}`).join("");return d`<style>${r}</style>`}renderState(){return this.loading?this.renderLoading():this.error!=null?this.renderError(this.error):this.data!=null?this.selfFetched?this.editing?this.renderForm():this.renderResult(this.data):this.showAttribution()?d`${this.renderData(this.data)}${this.renderAttribution()}`:this.renderData(this.data):this.renderNoData()}renderInterpretation(t,r,n){return this.hideReadings?c:Xe(t,r,this.t(n??"Reading"))}renderResult(t){let r=this.sticky?d`${this.renderForm()}${this.renderData(t)}`:d`<div class="roxy-edit-bar" part="edit-bar"><button type="button" class="roxy-edit" @click="${this.onEdit}">${this.t("Edit query")}</button></div>${this.renderData(t)}`;return this.showAttribution()?d`${r}${this.renderAttribution()}`:r}showAttribution(){return this.attribution!=null&&this.attribution!=="off"&&this.attribution!=="false"}renderAttribution(){return d`<div class="roxy-attribution" part="attribution"><a href="https://roxyapi.com/?utm_source=widget&utm_medium=embed" target="_blank" rel="noopener">${this.t("Spiritual data by RoxyAPI")}</a></div>`}renderNoData(){return this.endpoint?this.renderForm():this.renderEmpty()}renderForm(){return d`<roxy-endpoint-form part="form" data-endpoint="${this.endpoint}" method="${this.method}" spec-url="${L(this.specUrl)}" publishable-key="${L(this.publishableKey)}" location-url="${L(this.locationUrl)}" submit-label="${L(this.submitLabel)}" lang="${L(this.effectiveLang())}" .initialValues="${this.formInitialValues()}" @roxy-submit="${this.onFormSubmit}"></roxy-endpoint-form>`}formInitialValues(){return this.lastValues??(this.remember?this.readRemembered():void 0)}rememberKey(){return`roxy-ui:form:${this.endpoint}`}readRemembered(){try{let t=sessionStorage.getItem(this.rememberKey());return t?JSON.parse(t):void 0}catch{return}}writeRemembered(t){try{sessionStorage.setItem(this.rememberKey(),JSON.stringify(t))}catch{}}renderEmpty(){return d`<div class="roxy-empty" role="status" part="empty">${this.t("No data")}</div>`}renderLoading(){return d`<div class="roxy-skeleton" style="height:8rem" role="status" aria-label="${this.t("Loading")}" part="loading"></div>`}renderError(t){let r=d`<div class="roxy-error" role="alert" part="error">${this.t(t)}</div>`;return this.endpoint?d`${r}${this.renderForm()}`:r}};g([f({attribute:!1})],m.prototype,"data",2),g([f({type:String,attribute:"data-endpoint"})],m.prototype,"endpoint",2),g([f({type:String})],m.prototype,"method",2),g([f({type:String,attribute:"publishable-key"})],m.prototype,"publishableKey",2),g([f({type:String,attribute:"base-url"})],m.prototype,"baseUrl",2),g([f({type:String,attribute:"spec-url"})],m.prototype,"specUrl",2),g([f({type:String,attribute:"submit-url"})],m.prototype,"submitUrl",2),g([f({attribute:"submit-context",converter:Ct})],m.prototype,"submitContext",2),g([f({type:String,attribute:"location-url"})],m.prototype,"locationUrl",2),g([f({type:Boolean})],m.prototype,"remember",2),g([f({type:Boolean,attribute:"hide-readings",reflect:!0})],m.prototype,"hideReadings",2),g([f({type:String,attribute:"hide-sections",reflect:!0})],m.prototype,"hideSections",2),g([f({type:String,attribute:"submit-label"})],m.prototype,"submitLabel",2),g([f({type:String})],m.prototype,"attribution",2),g([T()],m.prototype,"loading",2),g([T()],m.prototype,"error",2),g([T()],m.prototype,"selfFetched",2),g([T()],m.prototype,"editing",2),g([T()],m.prototype,"sticky",2);var O=class extends m{resolveHexagram(){let e=this.data;if(!e)return null;if("hexagram"in e&&e.hexagram){if("lines"in e){let r=e;return{hex:r.hexagram,lines:r.lines,changingLinePositions:r.changingLinePositions,resultingHexagram:r.resultingHexagram}}let t=e;return{hex:t.hexagram,dailyMessage:t.dailyMessage}}return{hex:e}}renderData(){let e=this.resolveHexagram();if(!e)return this.renderEmpty();let{hex:t,lines:r,changingLinePositions:n,dailyMessage:o,resultingHexagram:i}=e,l=r??this.derivedLines(t),a=new Set(n??[]),u=!this.hideReadings;return d`<article class="card" part="card" aria-label="${this.t("I Ching hexagram")}"><div class="glyphs" part="chart">${t.symbol?d`<div class="symbol">${t.symbol}</div>`:c}<div class="lines" aria-hidden="true">${l.slice().reverse().map((p,h)=>{let y=l.length-1-h+1,x=a.has(y),S=p===6||p===8;return d`<div class="line ${`${S?"broken":"solid"}${x?" changing":""}`}">${S?ge`<span class="seg"></span><span class="seg"></span>`:ge`<span class="seg"></span>`}</div>`})}</div></div><div part="header"><h2 class="title">${[t.number!=null?`${t.number}.`:"",t.english??t.chinese??"Hexagram"].filter(Boolean).join(" ")}</h2><p class="subtitle">${t.chinese?d`${t.chinese}`:c} ${t.pinyin?d`· ${t.pinyin}`:c}</p><div class="trigrams" part="details">${t.upperTrigram?d`<div>${this.t("Upper")} <span class="tri-glyph">${ye(t.upperTrigram)??""}</span>${t.upperTrigram}</div>`:c} ${t.lowerTrigram?d`<div>${this.t("Lower")} <span class="tri-glyph">${ye(t.lowerTrigram)??""}</span>${t.lowerTrigram}</div>`:c}</div>${t.judgment&&u?d`<p class="judgment">${t.judgment}</p>`:c} ${t.image&&u?d`<p class="image">${t.image}</p>`:c} ${o&&u?d`<p class="message">${o}</p>`:c} ${t.interpretation?.general&&u?d`<p>${t.interpretation.general}</p>`:c} ${a.size>0?d`<div class="changing" part="section changing-lines">${this.t("Changing lines: {{lines}}.",{lines:Array.from(a).sort((p,h)=>p-h).join(", ")})} ${i?.english?d`${this.t("Becomes hexagram {{number}} {{name}}.",{number:i.number,name:i.english})}`:c}</div>`:c} ${this.renderLines(t,a)}</div></article>`}renderLines(e,t){let r=e.changingLines??[];if(r.length===0)return c;let n=t.size>0,o=n?r.filter(l=>t.has(l.position)):r;if(o.length===0)return c;let i=o.map(l=>({label:`Line ${l.position}`,body:l.text??"",extra:l.meaning?d`<p class="line-meaning">${l.meaning}</p>`:c}));return this.renderInterpretation(i,"hexagram-lines",n?"Changing lines":"Lines")}derivedLines(e){let t=e.binary??"";return/^[01]{6}$/.test(t)?Array.from(t,r=>r==="1"?7:8):Array.from({length:6},()=>7)}};O.styles=[Q,We,Je,b`.card{background:var(--roxy-surface,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-lg,1.5rem);grid-template-columns:6rem 1fr;display:grid}@container (width<=480px){.card{grid-template-columns:1fr}}.glyphs{gap:var(--roxy-space-md,1rem);align-content:start;align-self:start;justify-items:center;display:grid}.symbol{color:var(--roxy-accent-ink,#b45309);font-size:3rem;line-height:1}.lines{gap:4px;width:4rem;display:grid}.line{justify-content:center;align-items:center;gap:4px;height:8px;display:flex}.seg{background:var(--roxy-fg,#0a0a0a);border-radius:1px;height:6px;display:block}.line.broken .seg{width:1.4rem}.line.solid .seg{width:3rem}.line.changing .seg{background:var(--roxy-accent,#f59e0b)}.title{font-size:var(--roxy-text-xl,1.5rem);font-weight:var(--roxy-weight-bold,600);letter-spacing:var(--roxy-tracking-tight);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0 0 var(--roxy-space-sm,.5rem)}.trigrams{gap:var(--roxy-space-md,1rem);margin-bottom:var(--roxy-space-sm,.5rem);color:var(--roxy-secondary,#475569);font-size:var(--roxy-text-xs,.75rem);text-transform:uppercase;letter-spacing:.06em;display:flex}.tri-glyph{font-size:var(--roxy-text-xl,1.5rem);color:var(--roxy-accent-ink,#b45309);vertical-align:middle;margin-right:4px}.judgment,.image,.message{margin:0 0 var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-fg,#0a0a0a)}.judgment:before{content:"Judgment. ";font-weight:var(--roxy-weight-bold,600);color:var(--roxy-secondary,#475569)}.image:before{content:"Image. ";font-weight:var(--roxy-weight-bold,600);color:var(--roxy-secondary,#475569)}.line-meaning{padding-left:var(--roxy-space-sm,.5rem);border-left:2px solid var(--roxy-border,#e4e4e7);color:var(--roxy-muted,#71717a);margin:0}.changing{margin-top:var(--roxy-space-md,1rem);padding-top:var(--roxy-space-md,1rem);border-top:1px solid var(--roxy-border,#e4e4e7);color:var(--roxy-accent-ink,#b45309);font-size:var(--roxy-text-sm,.875rem)}`],O=g([Ne("roxy-hexagram")],O);G();return rt(Et);})();
283
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ee=/'/g,Te=/"/g,Pe=/^(?:script|style|textarea|title)$/i,me=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),d=me(1),ge=me(2),It=me(3),R=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),Le=new WeakMap,A=k.createTreeWalker(k,129);function He(s,e){if(!ue(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return ke!==void 0?ke.createHTML(e):e}var ut=(s,e)=>{let t=s.length-1,r=[],n,o=e===2?"<svg>":e===3?"<math>":"",i=M;for(let a=0;a<t;a++){let l=s[a],u,p,h=-1,y=0;for(;y<l.length&&(i.lastIndex=y,p=i.exec(l),p!==null);)y=i.lastIndex,i===M?p[1]==="!--"?i=Re:p[1]!==void 0?i=Ce:p[2]!==void 0?(Pe.test(p[2])&&(n=RegExp("</"+p[2],"g")),i=_):p[3]!==void 0&&(i=_):i===_?p[0]===">"?(i=n??M,h=-1):p[1]===void 0?h=-2:(h=i.lastIndex-p[2].length,u=p[1],i=p[3]===void 0?_:p[3]==='"'?Te:Ee):i===Te||i===Ee?i=_:i===Re||i===Ce?i=M:(i=_,n=void 0);let x=i===_&&s[a+1].startsWith("/>")?" ":"";o+=i===M?l+ht:h>=0?(r.push(u),l.slice(0,h)+Oe+l.slice(h)+$+x):l+$+(h===-2?a:x)}return[He(s,o+(s[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},I=class s{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,i=0,a=e.length-1,l=this.parts,[u,p]=ut(e,t);if(this.el=s.createElement(u,r),A.currentNode=this.el.content,t===2||t===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(n=A.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes())for(let h of n.getAttributeNames())if(h.endsWith(Oe)){let y=p[i++],x=n.getAttribute(h).split($),S=/([.?@])?(.*)/.exec(y);l.push({type:1,index:o,name:S[2],strings:x,ctor:S[1]==="."?le:S[1]==="?"?ce:S[1]==="@"?de:E}),n.removeAttribute(h)}else h.startsWith($)&&(l.push({type:6,index:o}),n.removeAttribute(h));if(Pe.test(n.tagName)){let h=n.textContent.split($),y=h.length-1;if(y>0){n.textContent=V?V.emptyScript:"";for(let x=0;x<y;x++)n.append(h[x],N()),A.nextNode(),l.push({type:2,index:++o});n.append(h[y],N())}}}else if(n.nodeType===8)if(n.data===Ue)l.push({type:2,index:o});else{let h=-1;for(;(h=n.data.indexOf($,h+1))!==-1;)l.push({type:7,index:o}),h+=$.length-1}o++}}static createElement(e,t){let r=k.createElement("template");return r.innerHTML=e,r}};function C(s,e,t=s,r){if(e===R)return e;let n=r!==void 0?t._$Co?.[r]:t._$Cl,o=j(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),o===void 0?n=void 0:(n=new o(s),n._$AT(s,t,r)),r!==void 0?(t._$Co??=[])[r]=n:t._$Cl=n),n!==void 0&&(e=C(s,n._$AS(s,e.values),n,r)),e}var ae=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,n=(e?.creationScope??k).importNode(t,!0);A.currentNode=n;let o=A.nextNode(),i=0,a=0,l=r[0];for(;l!==void 0;){if(i===l.index){let u;l.type===2?u=new D(o,o.nextSibling,this,e):l.type===1?u=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(u=new he(o,this,e)),this._$AV.push(u),l=r[++a]}i!==l?.index&&(o=A.nextNode(),i++)}return A.currentNode=k,n}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},D=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,n){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=C(this,e,t),j(e)?e===c||e==null||e===""?(this._$AH!==c&&this._$AR(),this._$AH=c):e!==this._$AH&&e!==R&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):pt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==c&&j(this._$AH)?this._$AA.nextSibling.data=e:this.T(k.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,n=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=I.createElement(He(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===n)this._$AH.p(t);else{let o=new ae(n,this),i=o.u(this.options);o.p(t),this.T(i),this._$AH=o}}_$AC(e){let t=Le.get(e.strings);return t===void 0&&Le.set(e.strings,t=new I(e)),t}k(e){ue(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let o of e)n===t.length?t.push(r=new s(this.O(N()),this.O(N()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let r=Ae(e).nextSibling;Ae(e).remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},E=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,n,o){this.type=1,this._$AH=c,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=c}_$AI(e,t=this,r,n){let o=this.strings,i=!1;if(o===void 0)e=C(this,e,t,0),i=!j(e)||e!==this._$AH&&e!==R,i&&(this._$AH=e);else{let a=e,l,u;for(e=o[0],l=0;l<o.length-1;l++)u=C(this,a[r+l],t,l),u===R&&(u=this._$AH[l]),i||=!j(u)||u!==this._$AH[l],u===c?e=c:e!==c&&(e+=(u??"")+o[l+1]),this._$AH[l]=u}i&&!n&&this.j(e)}j(e){e===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},le=class extends E{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===c?void 0:e}},ce=class extends E{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==c)}},de=class extends E{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){if((e=C(this,e,t,0)??c)===R)return;let r=this._$AH,n=e===c&&r!==c||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==c&&(r===c||n);n&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},he=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){C(this,e)}};var mt=pe.litHtmlPolyfillSupport;mt?.(I,D),(pe.litHtmlVersions??=[]).push("3.3.3");var Me=(s,e,t)=>{let r=t?.renderBefore??e,n=r._$litPart$;if(n===void 0){let o=t?.renderBefore??null;r._$litPart$=n=new D(e.insertBefore(N(),o),o,void 0,t??{})}return n._$AI(s),n};var fe=globalThis,w=class extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Me(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return R}};w._$litElement$=!0,w.finalized=!0,fe.litElementHydrateSupport?.({LitElement:w});var gt=fe.litElementPolyfillSupport;gt?.({LitElement:w});(fe.litElementVersions??=[]).push("4.2.2");var Ne=s=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(s,e)}):customElements.define(s,e)};var ft={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:Y},yt=(s=ft,e,t)=>{let{kind:r,metadata:n}=t,o=globalThis.litPropertyMetadata.get(n);if(o===void 0&&globalThis.litPropertyMetadata.set(n,o=new Map),r==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(t.name,s),r==="accessor"){let{name:i}=t;return{set(a){let l=e.get.call(this);e.set.call(this,a),this.requestUpdate(i,l,s,!0,a)},init(a){return a!==void 0&&this.C(i,void 0,s,a),a}}}if(r==="setter"){let{name:i}=t;return function(a){let l=this[i];e.call(this,a),this.requestUpdate(i,l,s,!0,a)}}throw Error("Unsupported decorator location: "+r)};function f(s){return(e,t)=>typeof t=="object"?yt(s,e,t):((r,n,o)=>{let i=n.hasOwnProperty(o);return n.constructor.createProperty(o,r),i?Object.getOwnPropertyDescriptor(n,o):void 0})(s,e,t)}function T(s){return f({...s,state:!0,attribute:!1})}function J(s){return s.toLowerCase().replace(/[\s_-]+/g," ").trim()}var xt=(s,e)=>e?s[J(e)]:void 0;var bt={heaven:"☰",lake:"☱",fire:"☲",thunder:"☳",wind:"☴",water:"☵",mountain:"☶",earth:"☷"},ye=s=>xt(bt,s);var L=s=>s??c;function je(s){if(s.lang)return s.lang;if(typeof document>"u")return;let e=s.closest?.("[lang]")?.getAttribute("lang");return e||document.documentElement.lang||void 0}var Ie="__ROXY_UI_I18N__";function qe(){let s=globalThis,e=s[Ie];if(e)return e;let t={catalogs:{},fieldLabels:{},requested:new Set,listeners:new Set};return s[Ie]=t,t}function De(s,e){return e?s.replace(/\{\{(\w+)\}\}/g,(t,r)=>r in e?String(e[r]??""):t):s}function ze(s,e,t){if(!s)return De(e,t);let{catalogs:r}=qe(),n=s.toLowerCase(),o=r[n]??r[n.split("-")[0]];return De(o?.[J(e)]??e,t)}function Ge(s){let{listeners:e}=qe();return e.add(s),()=>{e.delete(s)}}var X=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){this.unsubscribe=Ge(()=>this.host.requestUpdate())}hostDisconnected(){this.unsubscribe?.(),this.unsubscribe=void 0}};var Z=class extends w{constructor(){super();this.translator=(t,r)=>this.t(t,r);new X(this)}t(t,r){return ze(this.effectiveLang(),t,r)}effectiveLang(){return je(this)}};var Q=b`:host{--roxy-label-col:minmax(0, 25%);font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;var vt="__cols",$t="__rows";function wt(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function ee(s){if(Array.isArray(s)){let o=!1,i=s.map(a=>{let l=ee(a);return l!==a&&(o=!0),l});return o?i:s}if(!wt(s))return s;let e=s[vt],t=s[$t];if(Array.isArray(e)&&Array.isArray(t)&&Object.keys(s).length===2)return t.map(o=>{let i={};return e.forEach((a,l)=>{i[a]=ee(o[l])}),i});let r=!1,n={};for(let[o,i]of Object.entries(s)){let a=ee(i);a!==i&&(r=!0),n[o]=a}return r?n:s}function Be(s){return ee(s)}var te="Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.";function Ke(s){return!!s&&!s.startsWith("pk_")}function Fe(s,e={}){e.warn&&console.warn(te),s.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{reason:"possible-secret-key",message:te},bubbles:!0,composed:!0}))}var St="https://roxyapi.com/api/v2";async function _t(s){try{let e=await s.json();if(e?.error)return e.error}catch{}return`Request failed (${s.status})`}var re=class{constructor(e){this.baseUrl=St;this.host=e,e.addController(this)}hostDisconnected(){this.abort?.abort(),this.abort=void 0}async run(e){if(!this.submitUrl&&this.secretKeyRefused())return;this.abort?.abort();let t=new AbortController;this.abort=t,this.host.loading=!0,this.host.error=null;try{let r=this.submitUrl?await fetch(this.submitUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:this.proxyBody(e),signal:t.signal}):await this.callApi(e,t.signal);if(!r.ok)throw new Error(await _t(r));let n=await r.json();if(t.signal.aborted)return;this.host.data=n}catch(r){if(r?.name==="AbortError")return;this.host.error=r instanceof Error?r.message:String(r)}finally{this.abort===t&&(this.abort=void 0),t.signal.aborted||(this.host.loading=!1)}}proxyBody(e){return JSON.stringify(this.submitContext?{...e,context:this.submitContext}:e)}callApi(e,t){let r=new URL(`${this.baseUrl}${e.path}`,document.baseURI);for(let[o,i]of Object.entries(e.query??{}))i!=null&&r.searchParams.set(o,String(i));let n={Accept:"application/json"};return this.publishableKey&&(n["X-API-Key"]=this.publishableKey),e.body!=null&&(n["Content-Type"]="application/json"),fetch(r,{method:e.method??"GET",headers:n,body:e.body!=null?JSON.stringify(e.body):void 0,signal:t})}secretKeyRefused(){return Ke(this.publishableKey)?(this.host.error=te,Fe(this.host),!0):!1}};function Ye(s,e,t,r=[]){let n={...t},o=`/${s.replace(/^\//,"")}`.replace(/\{([^}]+)\}/g,(u,p)=>{let h=n[p];return delete n[p],encodeURIComponent(String(h??""))}),i=new Set(r),a={},l={};for(let[u,p]of Object.entries(n))p===void 0||p===""||(e==="GET"||i.has(u)?a[u]=p:l[u]=p);return{path:o,method:e,query:a,body:e==="POST"?l:void 0}}function Ve(){return d`<svg class="roxy-chevron" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`}var We=b`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;var At=b`.interp-keywords{flex-wrap:wrap;gap:.25rem;display:flex}.interp-keywords .kw{border-radius:var(--roxy-radius-full,9999px);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-xs,.75rem);padding:1px 8px}`,Je=b`.block{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.block h3{margin:0 0 var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.interp-card{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);margin-bottom:var(--roxy-space-xs,.25rem)}.interp-card summary{cursor:pointer;color:var(--roxy-fg,#0a0a0a);align-items:center;gap:var(--roxy-space-sm,.5rem);font-weight:500;font-size:var(--roxy-text-sm,.875rem);display:flex}.interp-card summary:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:var(--roxy-radius-sm,4px)}.interp-lead{flex-wrap:wrap;flex:auto;order:1;align-items:baseline;gap:.4rem;min-width:0;display:inline-flex}.interp-aside{flex-shrink:0;order:2;align-items:center;gap:.5rem;display:inline-flex}.roxy-chevron{order:3}.interp-aside small{color:var(--roxy-muted,#71717a);white-space:nowrap;font-weight:400}@container (width<=26rem){.interp-card summary{flex-wrap:wrap}.roxy-chevron{order:2}.interp-aside{flex-basis:100%;order:3;justify-content:flex-end}}.interp-body{margin-top:var(--roxy-space-sm,.5rem);gap:var(--roxy-space-sm,.5rem);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);overflow-wrap:anywhere;line-height:1.6;display:grid}.interp-body p{margin:0}${At}`;function Xe(s,e,t){let r=s.filter(n=>!!n.body);return r.length===0?c:d`<section class="block" part="section readings"><h3>${t}</h3>${r.map((n,o)=>d`<details class="interp-card" part="reading" name="${e}" ?open="${o===0}"><summary><span class="interp-lead">${n.label}</span> ${Ve()} ${n.aside?d`<span class="interp-aside"><small>${n.aside}</small></span>`:c}</summary><div class="interp-body"><p>${n.body}</p>${n.extra??c}</div></details>`)}</section>`}var kt="roxy-data";function Rt(s){return s.nodeName==="SCRIPT"&&s.getAttribute("type")==="application/json"}var se=class{constructor(e){this.host=e,e.addController(this)}hostConnected(){if(this.host.data!=null)return;let e=this.read();e!==void 0&&(this.host.data=e,this.host.requestUpdate())}read(){let e=this.findInlineScript();return e?this.parse(e.textContent):void 0}findInlineScript(){for(let e of Array.from(this.host.children))if(Rt(e)&&e.classList.contains(kt))return e;return null}parse(e){if(e?.trim())try{return JSON.parse(e)}catch{return}}};var Ct={fromAttribute:s=>{if(s!=null){try{let e=JSON.parse(s);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}console.warn("[roxy-ui] submit-context must be a JSON object; sending the request without it.")}}},m=class extends Z{constructor(){super();this.data=null;this.endpoint="";this.method="POST";this.remember=!1;this.hideReadings=!1;this.hideSections="";this.loading=!1;this.error=null;this.selfFetched=!1;this.editing=!1;this.sticky=!1;this.onEdit=()=>{this.editing=!0};this.onFormSubmit=t=>{let r=t.detail;this.lastValues=r.values,this.sticky=!!r.sticky,this.selfFetched=!0,this.editing=!1,this.remember&&this.writeRemembered(r.values),this.fetcher.run(Ye(this.endpoint,this.method,r.values,r.queryKeys??[]))};new se(this),this.fetcher=new re(this)}static{this.styles=[Q]}willUpdate(t){if(t.has("data")&&this.data!=null){let r=Be(this.data);r!==this.data&&(this.data=r)}t.has("publishableKey")&&(this.fetcher.publishableKey=this.publishableKey),t.has("baseUrl")&&this.baseUrl&&(this.fetcher.baseUrl=this.baseUrl),t.has("submitUrl")&&(this.fetcher.submitUrl=this.submitUrl),t.has("submitContext")&&(this.fetcher.submitContext=this.submitContext)}render(){return d`${this.hiddenSectionsStyle()}${this.renderState()}`}hiddenSectionsStyle(){let t=this.hideSections.split(",").map(n=>n.trim().toLowerCase()).filter(n=>/^[a-z][a-z0-9-]*$/.test(n));if(t.length===0)return c;let r=t.map(n=>`[part~="${n}"]{display:none!important}`).join("");return d`<style>${r}</style>`}renderState(){return this.loading?this.renderLoading():this.error!=null?this.renderError(this.error):this.data!=null?this.selfFetched?this.editing?this.renderForm():this.renderResult(this.data):this.showAttribution()?d`${this.renderData(this.data)}${this.renderAttribution()}`:this.renderData(this.data):this.renderNoData()}renderInterpretation(t,r,n){return this.hideReadings?c:Xe(t,r,this.t(n??"Reading"))}renderResult(t){let r=this.sticky?d`${this.renderForm()}${this.renderData(t)}`:d`<div class="roxy-edit-bar" part="edit-bar"><button type="button" class="roxy-edit" @click="${this.onEdit}">${this.t("Edit query")}</button></div>${this.renderData(t)}`;return this.showAttribution()?d`${r}${this.renderAttribution()}`:r}showAttribution(){return this.attribution!=null&&this.attribution!=="off"&&this.attribution!=="false"}renderAttribution(){return d`<div class="roxy-attribution" part="attribution"><a href="https://roxyapi.com/?utm_source=widget&utm_medium=embed" target="_blank" rel="noopener">${this.t("Spiritual data by RoxyAPI")}</a></div>`}renderNoData(){return this.endpoint?this.renderForm():this.renderEmpty()}renderForm(){return d`<roxy-endpoint-form part="form" data-endpoint="${this.endpoint}" method="${this.method}" spec-url="${L(this.specUrl)}" publishable-key="${L(this.publishableKey)}" location-url="${L(this.locationUrl)}" submit-label="${L(this.submitLabel)}" lang="${L(this.effectiveLang())}" .initialValues="${this.formInitialValues()}" @roxy-submit="${this.onFormSubmit}"></roxy-endpoint-form>`}formInitialValues(){return this.lastValues??(this.remember?this.readRemembered():void 0)}rememberKey(){return`roxy-ui:form:${this.endpoint}`}readRemembered(){try{let t=sessionStorage.getItem(this.rememberKey());return t?JSON.parse(t):void 0}catch{return}}writeRemembered(t){try{sessionStorage.setItem(this.rememberKey(),JSON.stringify(t))}catch{}}renderEmpty(){return d`<div class="roxy-empty" role="status" part="empty">${this.t("No data")}</div>`}renderLoading(){return d`<div class="roxy-skeleton" style="height:8rem" role="status" aria-label="${this.t("Loading")}" part="loading"></div>`}renderError(t){let r=d`<div class="roxy-error" role="alert" part="error">${this.t(t)}</div>`;return this.endpoint?d`${r}${this.renderForm()}`:r}};g([f({attribute:!1})],m.prototype,"data",2),g([f({type:String,attribute:"data-endpoint"})],m.prototype,"endpoint",2),g([f({type:String})],m.prototype,"method",2),g([f({type:String,attribute:"publishable-key"})],m.prototype,"publishableKey",2),g([f({type:String,attribute:"base-url"})],m.prototype,"baseUrl",2),g([f({type:String,attribute:"spec-url"})],m.prototype,"specUrl",2),g([f({type:String,attribute:"submit-url"})],m.prototype,"submitUrl",2),g([f({attribute:"submit-context",converter:Ct})],m.prototype,"submitContext",2),g([f({type:String,attribute:"location-url"})],m.prototype,"locationUrl",2),g([f({type:Boolean})],m.prototype,"remember",2),g([f({type:Boolean,attribute:"hide-readings",reflect:!0})],m.prototype,"hideReadings",2),g([f({type:String,attribute:"hide-sections",reflect:!0})],m.prototype,"hideSections",2),g([f({type:String,attribute:"submit-label"})],m.prototype,"submitLabel",2),g([f({type:String})],m.prototype,"attribution",2),g([T()],m.prototype,"loading",2),g([T()],m.prototype,"error",2),g([T()],m.prototype,"selfFetched",2),g([T()],m.prototype,"editing",2),g([T()],m.prototype,"sticky",2);var O=class extends m{resolveHexagram(){let e=this.data;if(!e)return null;if("hexagram"in e&&e.hexagram){if("lines"in e){let r=e;return{hex:r.hexagram,lines:r.lines,changingLinePositions:r.changingLinePositions,resultingHexagram:r.resultingHexagram}}let t=e;return{hex:t.hexagram,dailyMessage:t.dailyMessage}}return{hex:e}}renderData(){let e=this.resolveHexagram();if(!e)return this.renderEmpty();let{hex:t,lines:r,changingLinePositions:n,dailyMessage:o,resultingHexagram:i}=e,a=r??this.derivedLines(t),l=new Set(n??[]),u=!this.hideReadings;return d`<article class="card" part="card" aria-label="${this.t("I Ching hexagram")}"><div class="glyphs" part="chart">${t.symbol?d`<div class="symbol">${t.symbol}</div>`:c} ${a.length>0?d`<div class="lines" aria-hidden="true">${a.slice().reverse().map((p,h)=>{let y=a.length-1-h+1,x=l.has(y),S=p===6||p===8;return d`<div class="line ${`${S?"broken":"solid"}${x?" changing":""}`}">${S?ge`<span class="seg"></span><span class="seg"></span>`:ge`<span class="seg"></span>`}</div>`})}</div>`:c}</div><div part="header"><h2 class="title">${[t.number!=null?`${t.number}.`:"",t.english??t.chinese??"Hexagram"].filter(Boolean).join(" ")}</h2><p class="subtitle">${t.chinese?d`${t.chinese}`:c} ${t.pinyin?d`· ${t.pinyin}`:c}</p><div class="trigrams" part="details">${t.upperTrigram?d`<div>${this.t("Upper")} <span class="tri-glyph">${ye(t.upperTrigram)??""}</span>${t.upperTrigram}</div>`:c} ${t.lowerTrigram?d`<div>${this.t("Lower")} <span class="tri-glyph">${ye(t.lowerTrigram)??""}</span>${t.lowerTrigram}</div>`:c}</div>${t.judgment&&u?d`<p class="judgment">${t.judgment}</p>`:c} ${t.image&&u?d`<p class="image">${t.image}</p>`:c} ${o&&u?d`<p class="message">${o}</p>`:c} ${t.interpretation?.general&&u?d`<p>${t.interpretation.general}</p>`:c} ${l.size>0?d`<div class="changing" part="section changing-lines">${this.t("Changing lines: {{lines}}.",{lines:Array.from(l).sort((p,h)=>p-h).join(", ")})} ${i?.english?d`${this.t("Becomes hexagram {{number}} {{name}}.",{number:i.number,name:i.english})}`:c}</div>`:c} ${this.renderLines(t,l)}</div></article>`}renderLines(e,t){let r=e.changingLines??[];if(r.length===0)return c;let n=t.size>0,o=n?r.filter(a=>t.has(a.position)):r;if(o.length===0)return c;let i=o.map(a=>({label:`Line ${a.position}`,body:a.text??"",extra:a.meaning?d`<p class="line-meaning">${a.meaning}</p>`:c}));return this.renderInterpretation(i,"hexagram-lines",n?"Changing lines":"Lines")}derivedLines(e){let t=e.binary??"";return/^[01]{6}$/.test(t)?Array.from(t,r=>r==="1"?7:8):[]}};O.styles=[Q,We,Je,b`.card{background:var(--roxy-surface,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-lg,1.5rem);grid-template-columns:6rem 1fr;display:grid}@container (width<=480px){.card{grid-template-columns:1fr}}.glyphs{gap:var(--roxy-space-md,1rem);align-content:start;align-self:start;justify-items:center;display:grid}.symbol{color:var(--roxy-accent-ink,#b45309);font-size:3rem;line-height:1}.lines{gap:4px;width:4rem;display:grid}.line{justify-content:center;align-items:center;gap:4px;height:8px;display:flex}.seg{background:var(--roxy-fg,#0a0a0a);border-radius:1px;height:6px;display:block}.line.broken .seg{width:1.4rem}.line.solid .seg{width:3rem}.line.changing .seg{background:var(--roxy-accent,#f59e0b)}.title{font-size:var(--roxy-text-xl,1.5rem);font-weight:var(--roxy-weight-bold,600);letter-spacing:var(--roxy-tracking-tight);margin:0}.subtitle{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);margin:0 0 var(--roxy-space-sm,.5rem)}.trigrams{gap:var(--roxy-space-md,1rem);margin-bottom:var(--roxy-space-sm,.5rem);color:var(--roxy-secondary,#475569);font-size:var(--roxy-text-xs,.75rem);text-transform:uppercase;letter-spacing:.06em;display:flex}.tri-glyph{font-size:var(--roxy-text-xl,1.5rem);color:var(--roxy-accent-ink,#b45309);vertical-align:middle;margin-right:4px}.judgment,.image,.message{margin:0 0 var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-fg,#0a0a0a)}.judgment:before{content:"Judgment. ";font-weight:var(--roxy-weight-bold,600);color:var(--roxy-secondary,#475569)}.image:before{content:"Image. ";font-weight:var(--roxy-weight-bold,600);color:var(--roxy-secondary,#475569)}.line-meaning{padding-left:var(--roxy-space-sm,.5rem);border-left:2px solid var(--roxy-border,#e4e4e7);color:var(--roxy-muted,#71717a);margin:0}.changing{margin-top:var(--roxy-space-md,1rem);padding-top:var(--roxy-space-md,1rem);border-top:1px solid var(--roxy-border,#e4e4e7);color:var(--roxy-accent-ink,#b45309);font-size:var(--roxy-text-sm,.875rem)}`],O=g([Ne("roxy-hexagram")],O);G();return rt(Et);})();
284
284
  /*! Bundled license information:
285
285
 
286
286
  @lit/reactive-element/css-tag.js: