@roxyapi/ui 0.18.2 → 0.18.4

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.
@@ -261,7 +261,7 @@ var RoxyUI_endpoint_form=(()=>{var I=Object.defineProperty;var ue=Object.getOwnP
261
261
  }
262
262
  `;var z="roxy-ui-tokens";function j(){if(typeof document>"u")return null;let i=document.getElementById(z);if(i)return i;let t=document.createElement("style");return t.id=z,t.textContent=me,document.head.prepend(t),t}var F=globalThis,B=F.ShadowRoot&&(F.ShadyCSS===void 0||F.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Z=Symbol(),fe=new WeakMap,M=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==Z)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(B&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=fe.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&fe.set(e,t))}return t}toString(){return this.cssText}},ye=i=>new M(typeof i=="string"?i:i+"",void 0,Z),w=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((r,o,s)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+i[s+1],i[0]);return new M(e,i,Z)},ge=(i,t)=>{if(B)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let r=document.createElement("style"),o=F.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=e.cssText,i.appendChild(r)}},ee=B?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let r of t.cssRules)e+=r.cssText;return ye(e)})(i):i;var{is:Je,defineProperty:Xe,getOwnPropertyDescriptor:Qe,getOwnPropertyNames:Ze,getOwnPropertySymbols:et,getPrototypeOf:tt}=Object,V=globalThis,xe=V.trustedTypes,rt=xe?xe.emptyScript:"",ot=V.reactiveElementPolyfillSupport,L=(i,t)=>i,P={toAttribute(i,t){switch(t){case Boolean:i=i?rt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},G=(i,t)=>!Je(i,t),be={attribute:!0,type:String,converter:P,reflect:!1,useDefault:!1,hasChanged:G};Symbol.metadata??=Symbol("metadata"),V.litPropertyMetadata??=new WeakMap;var b=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=be){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),o=this.getPropertyDescriptor(t,r,e);o!==void 0&&Xe(this.prototype,t,o)}}static getPropertyDescriptor(t,e,r){let{get:o,set:s}=Qe(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:o,set(n){let a=o?.call(this);s?.call(this,n),this.requestUpdate(t,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??be}static _$Ei(){if(this.hasOwnProperty(L("elementProperties")))return;let t=tt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(L("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(L("properties"))){let e=this.properties,r=[...Ze(e),...et(e)];for(let o of r)this.createProperty(o,e[o])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,o]of e)this.elementProperties.set(r,o)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let o=this._$Eu(e,r);o!==void 0&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let o of r)e.unshift(ee(o))}else t!==void 0&&e.push(ee(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.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(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ge(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){let r=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,r);if(o!==void 0&&r.reflect===!0){let s=(r.converter?.toAttribute!==void 0?r.converter:P).toAttribute(e,r.type);this._$Em=t,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(t,e){let r=this.constructor,o=r._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let s=r.getPropertyOptions(o),n=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:P;this._$Em=o;let a=n.fromAttribute(e,s.type);this[o]=a??this._$Ej?.get(o)??a,this._$Em=null}}requestUpdate(t,e,r,o=!1,s){if(t!==void 0){let n=this.constructor;if(o===!1&&(s=this[t]),r??=n.getPropertyOptions(t),!((r.hasChanged??G)(s,e)||r.useDefault&&r.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,r))))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:o,wrapped:s},n){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),s!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[o,s]of r){let{wrapped:n}=s,a=this[o];n!==!0||this._$AL.has(o)||a===void 0||this.C(o,void 0,s,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[L("elementProperties")]=new Map,b[L("finalized")]=new Map,ot?.({ReactiveElement:b}),(V.reactiveElementVersions??=[]).push("2.1.2");var ae=globalThis,ve=i=>i,K=ae.trustedTypes,$e=K?K.createPolicy("lit-html",{createHTML:i=>i}):void 0,Ee="$lit$",$=`lit$${Math.random().toFixed(9).slice(2)}$`,Oe="?"+$,it=`<${Oe}>`,E=document,U=()=>E.createComment(""),D=i=>i===null||typeof i!="object"&&typeof i!="function",le=Array.isArray,st=i=>le(i)||typeof i?.[Symbol.iterator]=="function",te=`[
263
263
  \f\r]`,q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ke=/-->/g,Se=/>/g,A=RegExp(`>|${te}(?:([^\\s"'>=/]+)(${te}*=${te}*(?:[^
264
- \f\r"'\`<>=]|("|')|))|$)`,"g"),we=/'/g,Ae=/"/g,Ce=/^(?:script|style|textarea|title)$/i,ce=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),u=ce(1),Ct=ce(2),Rt=ce(3),O=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),_e=new WeakMap,_=E.createTreeWalker(E,129);function Re(i,t){if(!le(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return $e!==void 0?$e.createHTML(t):t}var nt=(i,t)=>{let e=i.length-1,r=[],o,s=t===2?"<svg>":t===3?"<math>":"",n=q;for(let a=0;a<e;a++){let l=i[a],c,h,p=-1,g=0;for(;g<l.length&&(n.lastIndex=g,h=n.exec(l),h!==null);)g=n.lastIndex,n===q?h[1]==="!--"?n=ke:h[1]!==void 0?n=Se:h[2]!==void 0?(Ce.test(h[2])&&(o=RegExp("</"+h[2],"g")),n=A):h[3]!==void 0&&(n=A):n===A?h[0]===">"?(n=o??q,p=-1):h[1]===void 0?p=-2:(p=n.lastIndex-h[2].length,c=h[1],n=h[3]===void 0?A:h[3]==='"'?Ae:we):n===Ae||n===we?n=A:n===ke||n===Se?n=q:(n=A,o=void 0);let x=n===A&&i[a+1].startsWith("/>")?" ":"";s+=n===q?l+it:p>=0?(r.push(c),l.slice(0,p)+Ee+l.slice(p)+$+x):l+$+(p===-2?a:x)}return[Re(i,s+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},N=class i{constructor({strings:t,_$litType$:e},r){let o;this.parts=[];let s=0,n=0,a=t.length-1,l=this.parts,[c,h]=nt(t,e);if(this.el=i.createElement(c,r),_.currentNode=this.el.content,e===2||e===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=_.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(Ee)){let g=h[n++],x=o.getAttribute(p).split($),C=/([.?@])?(.*)/.exec(g);l.push({type:1,index:s,name:C[2],strings:x,ctor:C[1]==="."?oe:C[1]==="?"?ie:C[1]==="@"?se:T}),o.removeAttribute(p)}else p.startsWith($)&&(l.push({type:6,index:s}),o.removeAttribute(p));if(Ce.test(o.tagName)){let p=o.textContent.split($),g=p.length-1;if(g>0){o.textContent=K?K.emptyScript:"";for(let x=0;x<g;x++)o.append(p[x],U()),_.nextNode(),l.push({type:2,index:++s});o.append(p[g],U())}}}else if(o.nodeType===8)if(o.data===Oe)l.push({type:2,index:s});else{let p=-1;for(;(p=o.data.indexOf($,p+1))!==-1;)l.push({type:7,index:s}),p+=$.length-1}s++}}static createElement(t,e){let r=E.createElement("template");return r.innerHTML=t,r}};function R(i,t,e=i,r){if(t===O)return t;let o=r!==void 0?e._$Co?.[r]:e._$Cl,s=D(t)?void 0:t._$litDirective$;return o?.constructor!==s&&(o?._$AO?.(!1),s===void 0?o=void 0:(o=new s(i),o._$AT(i,e,r)),r!==void 0?(e._$Co??=[])[r]=o:e._$Cl=o),o!==void 0&&(t=R(i,o._$AS(i,t.values),o,r)),t}var re=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:r}=this._$AD,o=(t?.creationScope??E).importNode(e,!0);_.currentNode=o;let s=_.nextNode(),n=0,a=0,l=r[0];for(;l!==void 0;){if(n===l.index){let c;l.type===2?c=new H(s,s.nextSibling,this,t):l.type===1?c=new l.ctor(s,l.name,l.strings,this,t):l.type===6&&(c=new ne(s,this,t)),this._$AV.push(c),l=r[++a]}n!==l?.index&&(s=_.nextNode(),n++)}return _.currentNode=E,o}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},H=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,o){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),D(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==O&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):st(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&D(this._$AH)?this._$AA.nextSibling.data=t:this.T(E.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:r}=t,o=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=N.createElement(Re(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===o)this._$AH.p(e);else{let s=new re(o,this),n=s.u(this.options);s.p(e),this.T(n),this._$AH=s}}_$AC(t){let e=_e.get(t.strings);return e===void 0&&_e.set(t.strings,e=new N(t)),e}k(t){le(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,o=0;for(let s of t)o===e.length?e.push(r=new i(this.O(U()),this.O(U()),this,this.options)):r=e[o],r._$AI(s),o++;o<e.length&&(this._$AR(r&&r._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let r=ve(t).nextSibling;ve(t).remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},T=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,o,s){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=d}_$AI(t,e=this,r,o){let s=this.strings,n=!1;if(s===void 0)t=R(this,t,e,0),n=!D(t)||t!==this._$AH&&t!==O,n&&(this._$AH=t);else{let a=t,l,c;for(t=s[0],l=0;l<s.length-1;l++)c=R(this,a[r+l],e,l),c===O&&(c=this._$AH[l]),n||=!D(c)||c!==this._$AH[l],c===d?t=d:t!==d&&(t+=(c??"")+s[l+1]),this._$AH[l]=c}n&&!o&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},oe=class extends T{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},ie=class extends T{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},se=class extends T{constructor(t,e,r,o,s){super(t,e,r,o,s),this.type=5}_$AI(t,e=this){if((t=R(this,t,e,0)??d)===O)return;let r=this._$AH,o=t===d&&r!==d||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,s=t!==d&&(r===d||o);o&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ne=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}};var at=ae.litHtmlPolyfillSupport;at?.(N,H),(ae.litHtmlVersions??=[]).push("3.3.3");var Te=(i,t,e)=>{let r=e?.renderBefore??t,o=r._$litPart$;if(o===void 0){let s=e?.renderBefore??null;r._$litPart$=o=new H(t.insertBefore(U(),s),s,void 0,e??{})}return o._$AI(i),o};var de=globalThis,k=class extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Te(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return O}};k._$litElement$=!0,k.finalized=!0,de.litElementHydrateSupport?.({LitElement:k});var lt=de.litElementPolyfillSupport;lt?.({LitElement:k});(de.litElementVersions??=[]).push("4.2.2");var Me=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};var ct={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:G},dt=(i=ct,t,e)=>{let{kind:r,metadata:o}=e,s=globalThis.litPropertyMetadata.get(o);if(s===void 0&&globalThis.litPropertyMetadata.set(o,s=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),s.set(e.name,i),r==="accessor"){let{name:n}=e;return{set(a){let l=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,l,i,!0,a)},init(a){return a!==void 0&&this.C(n,void 0,i,a),a}}}if(r==="setter"){let{name:n}=e;return function(a){let l=this[n];t.call(this,a),this.requestUpdate(n,l,i,!0,a)}}throw Error("Unsupported decorator location: "+r)};function v(i){return(t,e)=>typeof e=="object"?dt(i,t,e):((r,o,s)=>{let n=o.hasOwnProperty(s);return o.constructor.createProperty(s,r),n?Object.getOwnPropertyDescriptor(o,s):void 0})(i,t,e)}function S(i){return v({...i,state:!0,attribute:!1})}var W=i=>i??d;var Le={Aries:"\u2648",Taurus:"\u2649",Gemini:"\u264A",Cancer:"\u264B",Leo:"\u264C",Virgo:"\u264D",Libra:"\u264E",Scorpio:"\u264F",Sagittarius:"\u2650",Capricorn:"\u2651",Aquarius:"\u2652",Pisces:"\u2653"};var Pe=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"];var qe=w`:host{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}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}: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}`;function pe(){return u`<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 Ue=w`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}}`;function De(i){return i?i.charAt(0).toUpperCase()+i.slice(1).toLowerCase():""}function y(i){return i.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([a-z])([0-9])/g,"$1 $2").replace(/^\w/,t=>t.toUpperCase())}var pt=12,X=["latitude","longitude","timezone"],ht=Pe.map(i=>i.toLowerCase());function J(i,t){if(i){if("$ref"in i&&i.$ref){let e=i.$ref.split("/").pop();return e?t[e]:void 0}return i}}function Ne(i){let t=i.anyOf??i.oneOf;return!t||t.length===0?i:t.find(e=>Array.isArray(e.enum))??t.find(e=>e.type&&e.type!=="null")??t[0]??i}function ut(i){let t=Ne(i);return Array.isArray(t.enum)?t.enum.length<=pt?"tiles":"select":t.type==="boolean"?"toggle":t.format==="date"?"date":t.format==="time"?"time":t.format==="date-time"?"datetime":t.type==="integer"||t.type==="number"?"number":t.type==="string"?"text":t.type==="array"?"array":null}function He(i){if(i.length!==12)return!1;let t=new Set(i.map(e=>e.toLowerCase()));return ht.every(e=>t.has(e))}function he(i,t,e){let r=Ne(t);return{key:e.key,name:i,group:e.group,inQuery:e.inQuery,kind:ut(t)??"text",required:e.required,description:r.description??t.description,enum:r.enum,min:r.minimum,max:r.maximum,default:t.default??r.default,example:t.example??r.example}}function Ie(i,t,e){let r=[],o=!1,s=i.requestBody?.content?.["application/json"]?.schema,n=J(s,t);if(n?.properties){let a=new Set(n.required??[]);for(let[l,c]of Object.entries(n.properties)){let h=J(c,t)??{};if(h.type==="object"&&h.properties){let p=new Set(h.required??[]);for(let[g,x]of Object.entries(h.properties)){let C=J(x,t)??{};r.push(he(g,C,{key:`${l}.${g}`,group:l,required:a.has(l)&&p.has(g)}))}}else r.push(he(l,h,{key:l,required:a.has(l)}))}}for(let a of i.parameters??[]){if(a.in!=="path"&&a.in!=="query")continue;if(a.name==="lang"&&a.in==="query"){o=!0;continue}let l=J(a.schema,t)??{};r.push(he(a.name,l,{key:a.name,required:!!a.required,inQuery:a.in==="query"}))}return{title:mt(i.summary,e),fields:r,hasLang:o}}function mt(i,t){let e=i?.split(" - ")[0]?.trim();return e||y(t.split("/").pop()??"")}function ze(i){let t=i.toLowerCase();return/compat|synastry|guna|connection|penta|composite/.test(t)?"Compare":/\bcast\b|\/draw|iching|hexagram|tarot/.test(t)?"Cast":/horoscope|dream|angel|nakshatra|crystal|meaning|reference/.test(t)?"Get reading":"Generate"}function je(i,t){let e=t.replace(/^\//,"").replace(/[{}]/g,"").replace(/\//g,"-");return`${i.toLowerCase()}--${e}.json`}var Fe="0.18.2";var Be="https://roxyapi.com/api/v2/openapi.json",ft=`https://cdn.jsdelivr.net/npm/@roxyapi/ui@${Fe}/dist/schemas`,Q=new Map;function yt(){Q.clear()}async function gt(i){let t=Q.get(i);return t||(t=fetch(i).then(async e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{throw Q.delete(i),e}),Q.set(i,t)),t}function xt(){return globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2)}function bt(i){let t=i.trim();if(!t)return[];try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return t.split(",").map(e=>e.trim()).filter(Boolean)}var m=class extends k{constructor(){super(...arguments);this.endpoint="vedic-astrology/birth-chart";this.method="POST";this.specUrl="";this.submitLabel="";this.fields=[];this.formTitle="";this.hasLang=!1;this.values={};this.loaded=!1;this.specError=null;this.validationErrors=[];this.retryLoadSchema=()=>{this.loaded=!1,this.specError=null,this.loadSchema()};this.onSubmit=e=>{e.preventDefault(),this.submit()}}connectedCallback(){super.connectedCallback(),this.loadSchema()}async loadSchema(){this.specError=null;try{this.applyModel(await this.resolveModel())}catch(e){let r=e instanceof Error?e.message:String(e);this.specError=r,this.loaded=!0,this.dispatchEvent(new CustomEvent("roxy-spec-error",{detail:{url:this.specUrl||Be,message:r},bubbles:!0,composed:!0}))}}async resolveModel(){return this.specUrl?this.modelFromSpec(this.specUrl):await this.tryLoadSlice()??this.modelFromSpec(Be)}async modelFromSpec(e){let r=await gt(e),o=`/${this.endpoint.replace(/^\//,"")}`,s=r.paths?.[o]?.[this.method.toLowerCase()];if(!s)throw new Error(`Endpoint ${this.method} ${o} not found in OpenAPI spec`);return Ie(s,r.components?.schemas??{},this.endpoint)}async tryLoadSlice(){try{let e=await fetch(`${ft}/${je(this.method,this.endpoint)}`);return e.ok?await e.json():null}catch{return null}}applyModel(e){this.fields=e.fields,this.formTitle=e.title,this.hasLang=e.hasLang;let r={};for(let o of e.fields){o.default!==void 0&&(r[o.key]=o.default);let s=o.group?this.initialValues?.[o.group]?.[o.name]:this.initialValues?.[o.name];s!==void 0&&(r[o.key]=s)}this.values=r,this.loaded=!0}setValue(e,r){this.values={...this.values,[e]:r}}roleOf(e){return e.name==="seed"?"seed":(e.name==="limit"||e.name==="offset")&&!e.required?"hidden-default":X.includes(e.name)&&this.groupHasLocation(e.group)?"location":"normal"}isRendered(e){return this.roleOf(e)==="normal"}groupKeys(){let e=[];for(let r of this.fields)e.includes(r.group)||e.push(r.group);return e}groupHasLocation(e){let r=this.fields.filter(o=>o.group===e);return X.every(o=>r.some(s=>s.name===o))}locationRequired(e){let r=this.fields.filter(o=>o.group===e);return X.some(o=>r.some(s=>s.name===o&&s.required))}groupIsRequired(e){return this.groupHasLocation(e)||this.fields.some(r=>r.group===e&&r.required)}get singleEnumField(){if(this.groupKeys().some(o=>this.groupHasLocation(o))||this.groupKeys().some(o=>o!==void 0))return null;let e=this.fields.filter(o=>o.required&&this.isRendered(o)),r=e[0];return e.length!==1||!r?null:r.kind==="tiles"||r.kind==="select"?r:null}effectiveSubmitLabel(){return this.submitLabel||ze(this.endpoint)}effectiveLang(){return this.lang||void 0}onLocationFor(e){let r=e?`${e}.`:"";return o=>{let s=o.detail;s&&(this.values={...this.values,[`${r}latitude`]:s.latitude,[`${r}longitude`]:s.longitude,[`${r}timezone`]:s.timezone??s.utcOffset})}}selectTile(e,r){this.setValue(e.key,r),this.singleEnumField?.key===e.key&&this.submit()}onTilesKeyDown(e){return r=>{let o=e.enum??[];if(o.length===0)return;let s=o.indexOf(this.values[e.key]),n;if(r.key==="Home")n=0;else if(r.key==="End")n=o.length-1;else if(r.key==="ArrowRight"||r.key==="ArrowDown")n=s===-1?0:(s+1)%o.length;else if(r.key==="ArrowLeft"||r.key==="ArrowUp")n=s===-1?o.length-1:(s-1+o.length)%o.length;else return;r.preventDefault();let a=o[n];if(a===void 0)return;this.selectTile(e,a);let l=r.currentTarget;requestAnimationFrame(()=>l.querySelector(`[data-tile='${n}']`)?.focus())}}submit(){let e=this.collectMissing();if(e.keys.length>0){this.validationErrors=e.labels,this.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{missing:e.keys},bubbles:!0,composed:!0}));return}this.validationErrors=[];let r={};for(let n of this.fields){let a=this.values[n.key];if(n.name==="seed"&&(a===void 0||a==="")&&(a=xt()),!(a===void 0||a===""))if(n.kind==="array"&&typeof a=="string"&&(a=bt(a)),n.group){let l=r[n.group]??{};l[n.name]=a,r[n.group]=l}else r[n.name]=a}let o=this.fields.filter(n=>n.inQuery).map(n=>n.name),s=this.effectiveLang();this.hasLang&&s&&(r.lang=s,o.push("lang")),this.dispatchEvent(new CustomEvent("roxy-submit",{detail:{endpoint:this.endpoint,values:r,queryKeys:o,sticky:this.singleEnumField!=null},bubbles:!0,composed:!0}))}collectMissing(){let e=[],r=[],o=new Set;for(let s of this.fields){if(!s.required)continue;let n=this.roleOf(s)==="location";if(!this.isRendered(s)&&!n)continue;let a=this.values[s.key];if(!(a!==void 0&&a!=="")){if(e.push(s.key),n){o.add(s.group);continue}r.push(s.group?`${y(s.group)} ${y(s.name)}`:y(s.name))}}for(let s of o)r.push(s?`${y(s)} location`:"Birth location");return{keys:e,labels:r}}reqMark(e){return e.required?u`<span class="req" aria-hidden="true">*</span>`:d}description(e){if(!e.description)return d;if(e.description.length<=120)return u`<small class="help">${e.description}</small>`;let r=e.description.split(". ")[0]??e.description;return u`<details class="help-details"><summary><span class="help-lead">${r}</span>${pe()}</summary><small class="help help-full">${e.description}</small></details>`}renderTiles(e){let r=`roxy-form-${e.key}-label`,o=!!e.enum&&He(e.enum),s=e.enum??[],n=s.indexOf(this.values[e.key]),a=n===-1?0:n;return u`<div class="field tiles-field"><span class="label" id="${r}">${y(e.name)}${this.reqMark(e)}</span><div class="tiles" role="radiogroup" aria-labelledby="${r}" @keydown="${this.onTilesKeyDown(e)}">${s.map((l,c)=>{let h=this.values[e.key]===l,p=o?Le[De(l)]:void 0;return u`<button type="button" class="tile" role="radio" data-tile="${c}" aria-checked="${h?"true":"false"}" tabindex="${c===a?"0":"-1"}" @click="${()=>this.selectTile(e,l)}">${p?u`<span class="tile-glyph" aria-hidden="true">${p}</span>`:d} <span class="tile-label">${y(l)}</span></button>`})}</div>${this.description(e)}</div>`}renderSelect(e){let r=`roxy-form-${e.key}`;return u`<div class="field"><label for="${r}">${y(e.name)}${this.reqMark(e)}</label> <select id="${r}" ?required="${e.required}" @change="${o=>this.setValue(e.key,o.target.value)}"><option value="">Choose</option>${(e.enum??[]).map(o=>u`<option value="${o}" ?selected="${this.values[e.key]===o}">${y(o)}</option>`)}</select> ${this.description(e)}</div>`}renderToggle(e){let r=`roxy-form-${e.key}`,o=this.values[e.key]===!0;return u`<div class="field"><div class="toggle-row"><button type="button" id="${r}" class="toggle" role="switch" aria-checked="${o?"true":"false"}" @click="${()=>this.setValue(e.key,!o)}"><span class="knob"></span></button> <label class="toggle-label" for="${r}">${y(e.name)}${this.reqMark(e)}</label></div>${this.description(e)}</div>`}renderInput(e){let r=`roxy-form-${e.key}`,o=e.kind==="datetime"?"datetime-local":e.kind==="number"?"number":e.kind,s=e.kind==="array"?"Comma separated":e.example!=null?String(e.example):"";return u`<div class="field"><label for="${r}">${y(e.name)}${this.reqMark(e)}</label> <input id="${r}" type="${e.kind==="array"?"text":o}" ?required="${e.required}" min="${W(e.min)}" max="${W(e.max)}" step="${e.kind==="number"?"any":d}" placeholder="${s||d}" .value="${this.values[e.key]??""}" @input="${n=>this.setValue(e.key,this.coerce(e.kind,n.target.value))}"> ${this.description(e)}</div>`}renderField(e){switch(e.kind){case"tiles":return this.renderTiles(e);case"select":return this.renderSelect(e);case"toggle":return this.renderToggle(e);default:return this.renderInput(e)}}locationBlock(e){return u`<div class="location-block"><label>${e?`${y(e)} location`:"Birth location"}${this.locationRequired(e)?u`<span class="req" aria-hidden="true">*</span>`:d}</label><roxy-location-search publishable-key="${W(this.publishableKey)}" @roxy-location-select="${this.onLocationFor(e)}" placeholder="City of birth"></roxy-location-search><small class="help">Required: latitude, longitude, timezone. Pick a city to autofill.</small></div>`}groupCard(e){let r=this.fields.filter(o=>o.group===e&&this.isRendered(o));return u`<fieldset class="person-group"><legend>${y(e)}</legend>${this.groupHasLocation(e)?this.locationBlock(e):d}<div class="fields">${r.map(o=>this.renderField(o))}</div></fieldset>`}render(){if(!this.loaded)return u`<form><div class="roxy-skeleton" style="height:8rem"></div></form>`;if(this.specError)return u`<div class="spec-error" role="alert">Schema load failed: ${this.specError} <button type="button" class="submit" @click="${this.retryLoadSchema}">Retry</button></div>`;let e=this.fields.filter(c=>!c.group&&this.isRendered(c)),r=e.filter(c=>c.required),o=e.filter(c=>!c.required),s=this.groupKeys().filter(c=>c!==void 0),n=s.filter(c=>this.groupIsRequired(c)),a=s.filter(c=>!this.groupIsRequired(c)),l=o.length>0||a.length>0;return u`<form @submit="${this.onSubmit}"><h2 class="title">${this.formTitle}</h2>${this.validationErrors.length>0?u`<div class="validation-error" role="alert"><strong>Please complete:</strong> ${this.validationErrors.join(", ")}</div>`:d}<div class="fields">${r.map(c=>this.renderField(c))}</div>${this.groupHasLocation(void 0)?this.locationBlock(void 0):d} ${n.map(c=>this.groupCard(c))} ${l?u`<details class="advanced"><summary>Advanced${pe()}</summary><div class="fields">${o.map(c=>this.renderField(c))}</div>${a.map(c=>this.groupCard(c))}</details>`:d} ${this.singleEnumField?d:u`<button class="submit" type="submit">${this.effectiveSubmitLabel()}</button>`}</form>`}coerce(e,r){if(r!==""){if(e==="number"){let o=Number(r);return Number.isFinite(o)?o:void 0}return r}}};m.styles=[qe,Ue,w`form{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);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);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.fields{align-items:start;gap:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));display:grid}.fields:empty{display:none}.person-group{background:var(--roxy-surface,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-md,1rem);gap:var(--roxy-space-md,1rem);min-inline-size:0;margin:0;display:grid}.person-group legend{padding:0 var(--roxy-space-xs,.25rem);font-weight:var(--roxy-weight-bold,600)}.field{gap:var(--roxy-space-xs,.25rem);flex-direction:column;min-width:0;display:flex}.tiles-field{grid-column:1/-1}label,.label{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-secondary,#475569)}.req{color:var(--roxy-danger-fg,#991b1b);margin-left:4px}input,select{box-sizing:border-box;width:100%;padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-base,1rem);color:var(--roxy-fg,#0a0a0a);background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);font-family:inherit}input:focus,select:focus{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-color:var(--roxy-accent-ink,#b45309)}.help{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem)}.help-details>summary{cursor:pointer;color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);align-items:center;gap:4px;display:flex}.help-details .help-lead{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.help-details .help-full{margin-top:var(--roxy-space-xs,.25rem);display:block}.location-block{gap:var(--roxy-space-xs,.25rem);grid-column:1/-1;display:grid}.tiles{gap:var(--roxy-space-sm,.5rem);grid-template-columns:repeat(auto-fit,minmax(5.5rem,1fr));display:grid}.tile{min-height:44px;padding:var(--roxy-space-sm,.5rem);background:var(--roxy-bg,#fff);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;transition:border-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease), background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-direction:column;justify-content:center;align-items:center;gap:2px;display:flex}.tile:hover{border-color:var(--roxy-accent,#f59e0b)}.tile[aria-checked=true]{border-color:var(--roxy-accent,#f59e0b);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 12%, transparent);color:var(--roxy-accent-ink,#b45309);font-weight:var(--roxy-weight-bold,600)}.tile:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.tile-glyph{font-size:1.35em;line-height:1}.toggle-row{align-items:center;gap:var(--roxy-space-sm,.5rem);display:flex}.toggle{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);background:var(--roxy-border,#e4e4e7);cursor:pointer;width:44px;height:26px;transition:background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0;padding:0;position:relative}.toggle[aria-checked=true]{background:var(--roxy-accent,#f59e0b);border-color:var(--roxy-accent,#f59e0b)}.toggle .knob{background:var(--roxy-bg,#fff);width:20px;height:20px;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);border-radius:50%;position:absolute;top:2px;left:2px}.toggle[aria-checked=true] .knob{transform:translate(18px)}.toggle:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.toggle-label{cursor:pointer}@media (prefers-reduced-motion:reduce){.tile,.toggle,.toggle .knob{transition:none}}.advanced{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.advanced>summary{cursor:pointer;font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-fg,#0a0a0a);align-items:center;gap:6px;display:flex}.advanced[open]>summary{margin-bottom:var(--roxy-space-md,1rem)}.advanced .fields,.advanced .person-group{margin-top:var(--roxy-space-md,1rem)}.validation-error{gap:var(--roxy-space-xs,.25rem);padding:var(--roxy-space-md,1rem);background:color-mix(in srgb, var(--roxy-danger,#dc2626) 8%, transparent);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);display:grid}button.submit{background:var(--roxy-accent-ink,#b45309);color:var(--roxy-bg,#fff);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-lg,1.5rem);font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);cursor:pointer;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));border:0;justify-self:start}button.submit:hover{transform:scale(1.02)}button.submit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}@media (prefers-reduced-motion:reduce){button.submit{transition:none}}.spec-error{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}`],f([v({type:String,attribute:"data-endpoint"})],m.prototype,"endpoint",2),f([v({type:String})],m.prototype,"method",2),f([v({type:String,attribute:"spec-url"})],m.prototype,"specUrl",2),f([v({type:String,attribute:"submit-label"})],m.prototype,"submitLabel",2),f([v({type:String,attribute:"publishable-key"})],m.prototype,"publishableKey",2),f([v({attribute:!1})],m.prototype,"initialValues",2),f([S()],m.prototype,"fields",2),f([S()],m.prototype,"formTitle",2),f([S()],m.prototype,"hasLang",2),f([S()],m.prototype,"values",2),f([S()],m.prototype,"loaded",2),f([S()],m.prototype,"specError",2),f([S()],m.prototype,"validationErrors",2),m=f([Me("roxy-endpoint-form")],m);j();return We(vt);})();
264
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),we=/'/g,Ae=/"/g,Ce=/^(?:script|style|textarea|title)$/i,ce=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),u=ce(1),Ct=ce(2),Rt=ce(3),O=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),_e=new WeakMap,_=E.createTreeWalker(E,129);function Re(i,t){if(!le(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return $e!==void 0?$e.createHTML(t):t}var nt=(i,t)=>{let e=i.length-1,r=[],o,s=t===2?"<svg>":t===3?"<math>":"",n=q;for(let a=0;a<e;a++){let l=i[a],c,h,p=-1,g=0;for(;g<l.length&&(n.lastIndex=g,h=n.exec(l),h!==null);)g=n.lastIndex,n===q?h[1]==="!--"?n=ke:h[1]!==void 0?n=Se:h[2]!==void 0?(Ce.test(h[2])&&(o=RegExp("</"+h[2],"g")),n=A):h[3]!==void 0&&(n=A):n===A?h[0]===">"?(n=o??q,p=-1):h[1]===void 0?p=-2:(p=n.lastIndex-h[2].length,c=h[1],n=h[3]===void 0?A:h[3]==='"'?Ae:we):n===Ae||n===we?n=A:n===ke||n===Se?n=q:(n=A,o=void 0);let x=n===A&&i[a+1].startsWith("/>")?" ":"";s+=n===q?l+it:p>=0?(r.push(c),l.slice(0,p)+Ee+l.slice(p)+$+x):l+$+(p===-2?a:x)}return[Re(i,s+(i[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]},N=class i{constructor({strings:t,_$litType$:e},r){let o;this.parts=[];let s=0,n=0,a=t.length-1,l=this.parts,[c,h]=nt(t,e);if(this.el=i.createElement(c,r),_.currentNode=this.el.content,e===2||e===3){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(o=_.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let p of o.getAttributeNames())if(p.endsWith(Ee)){let g=h[n++],x=o.getAttribute(p).split($),C=/([.?@])?(.*)/.exec(g);l.push({type:1,index:s,name:C[2],strings:x,ctor:C[1]==="."?oe:C[1]==="?"?ie:C[1]==="@"?se:T}),o.removeAttribute(p)}else p.startsWith($)&&(l.push({type:6,index:s}),o.removeAttribute(p));if(Ce.test(o.tagName)){let p=o.textContent.split($),g=p.length-1;if(g>0){o.textContent=K?K.emptyScript:"";for(let x=0;x<g;x++)o.append(p[x],U()),_.nextNode(),l.push({type:2,index:++s});o.append(p[g],U())}}}else if(o.nodeType===8)if(o.data===Oe)l.push({type:2,index:s});else{let p=-1;for(;(p=o.data.indexOf($,p+1))!==-1;)l.push({type:7,index:s}),p+=$.length-1}s++}}static createElement(t,e){let r=E.createElement("template");return r.innerHTML=t,r}};function R(i,t,e=i,r){if(t===O)return t;let o=r!==void 0?e._$Co?.[r]:e._$Cl,s=D(t)?void 0:t._$litDirective$;return o?.constructor!==s&&(o?._$AO?.(!1),s===void 0?o=void 0:(o=new s(i),o._$AT(i,e,r)),r!==void 0?(e._$Co??=[])[r]=o:e._$Cl=o),o!==void 0&&(t=R(i,o._$AS(i,t.values),o,r)),t}var re=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:r}=this._$AD,o=(t?.creationScope??E).importNode(e,!0);_.currentNode=o;let s=_.nextNode(),n=0,a=0,l=r[0];for(;l!==void 0;){if(n===l.index){let c;l.type===2?c=new H(s,s.nextSibling,this,t):l.type===1?c=new l.ctor(s,l.name,l.strings,this,t):l.type===6&&(c=new ne(s,this,t)),this._$AV.push(c),l=r[++a]}n!==l?.index&&(s=_.nextNode(),n++)}return _.currentNode=E,o}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},H=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,o){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),D(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==O&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):st(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&D(this._$AH)?this._$AA.nextSibling.data=t:this.T(E.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:r}=t,o=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=N.createElement(Re(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===o)this._$AH.p(e);else{let s=new re(o,this),n=s.u(this.options);s.p(e),this.T(n),this._$AH=s}}_$AC(t){let e=_e.get(t.strings);return e===void 0&&_e.set(t.strings,e=new N(t)),e}k(t){le(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,o=0;for(let s of t)o===e.length?e.push(r=new i(this.O(U()),this.O(U()),this,this.options)):r=e[o],r._$AI(s),o++;o<e.length&&(this._$AR(r&&r._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let r=ve(t).nextSibling;ve(t).remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},T=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,o,s){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=d}_$AI(t,e=this,r,o){let s=this.strings,n=!1;if(s===void 0)t=R(this,t,e,0),n=!D(t)||t!==this._$AH&&t!==O,n&&(this._$AH=t);else{let a=t,l,c;for(t=s[0],l=0;l<s.length-1;l++)c=R(this,a[r+l],e,l),c===O&&(c=this._$AH[l]),n||=!D(c)||c!==this._$AH[l],c===d?t=d:t!==d&&(t+=(c??"")+s[l+1]),this._$AH[l]=c}n&&!o&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},oe=class extends T{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},ie=class extends T{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},se=class extends T{constructor(t,e,r,o,s){super(t,e,r,o,s),this.type=5}_$AI(t,e=this){if((t=R(this,t,e,0)??d)===O)return;let r=this._$AH,o=t===d&&r!==d||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,s=t!==d&&(r===d||o);o&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ne=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}};var at=ae.litHtmlPolyfillSupport;at?.(N,H),(ae.litHtmlVersions??=[]).push("3.3.3");var Te=(i,t,e)=>{let r=e?.renderBefore??t,o=r._$litPart$;if(o===void 0){let s=e?.renderBefore??null;r._$litPart$=o=new H(t.insertBefore(U(),s),s,void 0,e??{})}return o._$AI(i),o};var de=globalThis,k=class extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Te(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return O}};k._$litElement$=!0,k.finalized=!0,de.litElementHydrateSupport?.({LitElement:k});var lt=de.litElementPolyfillSupport;lt?.({LitElement:k});(de.litElementVersions??=[]).push("4.2.2");var Me=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};var ct={attribute:!0,type:String,converter:P,reflect:!1,hasChanged:G},dt=(i=ct,t,e)=>{let{kind:r,metadata:o}=e,s=globalThis.litPropertyMetadata.get(o);if(s===void 0&&globalThis.litPropertyMetadata.set(o,s=new Map),r==="setter"&&((i=Object.create(i)).wrapped=!0),s.set(e.name,i),r==="accessor"){let{name:n}=e;return{set(a){let l=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,l,i,!0,a)},init(a){return a!==void 0&&this.C(n,void 0,i,a),a}}}if(r==="setter"){let{name:n}=e;return function(a){let l=this[n];t.call(this,a),this.requestUpdate(n,l,i,!0,a)}}throw Error("Unsupported decorator location: "+r)};function v(i){return(t,e)=>typeof e=="object"?dt(i,t,e):((r,o,s)=>{let n=o.hasOwnProperty(s);return o.constructor.createProperty(s,r),n?Object.getOwnPropertyDescriptor(o,s):void 0})(i,t,e)}function S(i){return v({...i,state:!0,attribute:!1})}var W=i=>i??d;var Le={Aries:"\u2648",Taurus:"\u2649",Gemini:"\u264A",Cancer:"\u264B",Leo:"\u264C",Virgo:"\u264D",Libra:"\u264E",Scorpio:"\u264F",Sagittarius:"\u2650",Capricorn:"\u2651",Aquarius:"\u2652",Pisces:"\u2653"};var Pe=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"];var qe=w`:host{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}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}: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}`;function pe(){return u`<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 Ue=w`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}}`;function De(i){return i?i.charAt(0).toUpperCase()+i.slice(1).toLowerCase():""}function y(i){return i.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([a-z])([0-9])/g,"$1 $2").replace(/^\w/,t=>t.toUpperCase())}var pt=12,X=["latitude","longitude","timezone"],ht=Pe.map(i=>i.toLowerCase());function J(i,t){if(i){if("$ref"in i&&i.$ref){let e=i.$ref.split("/").pop();return e?t[e]:void 0}return i}}function Ne(i){let t=i.anyOf??i.oneOf;return!t||t.length===0?i:t.find(e=>Array.isArray(e.enum))??t.find(e=>e.type&&e.type!=="null")??t[0]??i}function ut(i){let t=Ne(i);return Array.isArray(t.enum)?t.enum.length<=pt?"tiles":"select":t.type==="boolean"?"toggle":t.format==="date"?"date":t.format==="time"?"time":t.format==="date-time"?"datetime":t.type==="integer"||t.type==="number"?"number":t.type==="string"?"text":t.type==="array"?"array":null}function He(i){if(i.length!==12)return!1;let t=new Set(i.map(e=>e.toLowerCase()));return ht.every(e=>t.has(e))}function he(i,t,e){let r=Ne(t);return{key:e.key,name:i,group:e.group,inQuery:e.inQuery,kind:ut(t)??"text",required:e.required,description:r.description??t.description,enum:r.enum,min:r.minimum,max:r.maximum,default:t.default??r.default,example:t.example??r.example}}function Ie(i,t,e){let r=[],o=!1,s=i.requestBody?.content?.["application/json"]?.schema,n=J(s,t);if(n?.properties){let a=new Set(n.required??[]);for(let[l,c]of Object.entries(n.properties)){let h=J(c,t)??{};if(h.type==="object"&&h.properties){let p=new Set(h.required??[]);for(let[g,x]of Object.entries(h.properties)){let C=J(x,t)??{};r.push(he(g,C,{key:`${l}.${g}`,group:l,required:a.has(l)&&p.has(g)}))}}else r.push(he(l,h,{key:l,required:a.has(l)}))}}for(let a of i.parameters??[]){if(a.in!=="path"&&a.in!=="query")continue;if(a.name==="lang"&&a.in==="query"){o=!0;continue}let l=J(a.schema,t)??{};r.push(he(a.name,l,{key:a.name,required:!!a.required,inQuery:a.in==="query"}))}return{title:mt(i.summary,e),fields:r,hasLang:o}}function mt(i,t){let e=i?.split(" - ")[0]?.trim();return e||y(t.split("/").pop()??"")}function ze(i){let t=i.toLowerCase();return/compat|synastry|guna|connection|penta|composite/.test(t)?"Compare":/\bcast\b|\/draw|iching|hexagram|tarot/.test(t)?"Cast":/horoscope|dream|angel|nakshatra|crystal|meaning|reference/.test(t)?"Get reading":"Generate"}function je(i,t){let e=t.replace(/^\//,"").replace(/[{}]/g,"").replace(/\//g,"-");return`${i.toLowerCase()}--${e}.json`}var Fe="0.18.4";var Be="https://roxyapi.com/api/v2/openapi.json",ft=`https://cdn.jsdelivr.net/npm/@roxyapi/ui@${Fe}/dist/schemas`,Q=new Map;function yt(){Q.clear()}async function gt(i){let t=Q.get(i);return t||(t=fetch(i).then(async e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{throw Q.delete(i),e}),Q.set(i,t)),t}function xt(){return globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2)}function bt(i){let t=i.trim();if(!t)return[];try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return t.split(",").map(e=>e.trim()).filter(Boolean)}var m=class extends k{constructor(){super(...arguments);this.endpoint="vedic-astrology/birth-chart";this.method="POST";this.specUrl="";this.submitLabel="";this.fields=[];this.formTitle="";this.hasLang=!1;this.values={};this.loaded=!1;this.specError=null;this.validationErrors=[];this.retryLoadSchema=()=>{this.loaded=!1,this.specError=null,this.loadSchema()};this.onSubmit=e=>{e.preventDefault(),this.submit()}}connectedCallback(){super.connectedCallback(),this.loadSchema()}async loadSchema(){this.specError=null;try{this.applyModel(await this.resolveModel())}catch(e){let r=e instanceof Error?e.message:String(e);this.specError=r,this.loaded=!0,this.dispatchEvent(new CustomEvent("roxy-spec-error",{detail:{url:this.specUrl||Be,message:r},bubbles:!0,composed:!0}))}}async resolveModel(){return this.specUrl?this.modelFromSpec(this.specUrl):await this.tryLoadSlice()??this.modelFromSpec(Be)}async modelFromSpec(e){let r=await gt(e),o=`/${this.endpoint.replace(/^\//,"")}`,s=r.paths?.[o]?.[this.method.toLowerCase()];if(!s)throw new Error(`Endpoint ${this.method} ${o} not found in OpenAPI spec`);return Ie(s,r.components?.schemas??{},this.endpoint)}async tryLoadSlice(){try{let e=await fetch(`${ft}/${je(this.method,this.endpoint)}`);return e.ok?await e.json():null}catch{return null}}applyModel(e){this.fields=e.fields,this.formTitle=e.title,this.hasLang=e.hasLang;let r={};for(let o of e.fields){o.default!==void 0&&(r[o.key]=o.default);let s=o.group?this.initialValues?.[o.group]?.[o.name]:this.initialValues?.[o.name];s!==void 0&&(r[o.key]=s)}this.values=r,this.loaded=!0}setValue(e,r){this.values={...this.values,[e]:r}}roleOf(e){return e.name==="seed"?"seed":(e.name==="limit"||e.name==="offset")&&!e.required?"hidden-default":X.includes(e.name)&&this.groupHasLocation(e.group)?"location":"normal"}isRendered(e){return this.roleOf(e)==="normal"}groupKeys(){let e=[];for(let r of this.fields)e.includes(r.group)||e.push(r.group);return e}groupHasLocation(e){let r=this.fields.filter(o=>o.group===e);return X.every(o=>r.some(s=>s.name===o))}locationRequired(e){let r=this.fields.filter(o=>o.group===e);return X.some(o=>r.some(s=>s.name===o&&s.required))}groupIsRequired(e){return this.groupHasLocation(e)||this.fields.some(r=>r.group===e&&r.required)}get singleEnumField(){if(this.groupKeys().some(o=>this.groupHasLocation(o))||this.groupKeys().some(o=>o!==void 0))return null;let e=this.fields.filter(o=>o.required&&this.isRendered(o)),r=e[0];return e.length!==1||!r?null:r.kind==="tiles"||r.kind==="select"?r:null}effectiveSubmitLabel(){return this.submitLabel||ze(this.endpoint)}effectiveLang(){return this.lang||void 0}onLocationFor(e){let r=e?`${e}.`:"";return o=>{let s=o.detail;s&&(this.values={...this.values,[`${r}latitude`]:s.latitude,[`${r}longitude`]:s.longitude,[`${r}timezone`]:s.timezone??s.utcOffset})}}selectTile(e,r){this.setValue(e.key,r),this.singleEnumField?.key===e.key&&this.submit()}onTilesKeyDown(e){return r=>{let o=e.enum??[];if(o.length===0)return;let s=o.indexOf(this.values[e.key]),n;if(r.key==="Home")n=0;else if(r.key==="End")n=o.length-1;else if(r.key==="ArrowRight"||r.key==="ArrowDown")n=s===-1?0:(s+1)%o.length;else if(r.key==="ArrowLeft"||r.key==="ArrowUp")n=s===-1?o.length-1:(s-1+o.length)%o.length;else return;r.preventDefault();let a=o[n];if(a===void 0)return;this.selectTile(e,a);let l=r.currentTarget;requestAnimationFrame(()=>l.querySelector(`[data-tile='${n}']`)?.focus())}}submit(){let e=this.collectMissing();if(e.keys.length>0){this.validationErrors=e.labels,this.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{missing:e.keys},bubbles:!0,composed:!0}));return}this.validationErrors=[];let r={};for(let n of this.fields){let a=this.values[n.key];if(n.name==="seed"&&(a===void 0||a==="")&&(a=xt()),!(a===void 0||a===""))if(n.kind==="array"&&typeof a=="string"&&(a=bt(a)),n.group){let l=r[n.group]??{};l[n.name]=a,r[n.group]=l}else r[n.name]=a}let o=this.fields.filter(n=>n.inQuery).map(n=>n.name),s=this.effectiveLang();this.hasLang&&s&&(r.lang=s,o.push("lang")),this.dispatchEvent(new CustomEvent("roxy-submit",{detail:{endpoint:this.endpoint,values:r,queryKeys:o,sticky:this.singleEnumField!=null},bubbles:!0,composed:!0}))}collectMissing(){let e=[],r=[],o=new Set;for(let s of this.fields){if(!s.required)continue;let n=this.roleOf(s)==="location";if(!this.isRendered(s)&&!n)continue;let a=this.values[s.key];if(!(a!==void 0&&a!=="")){if(e.push(s.key),n){o.add(s.group);continue}r.push(s.group?`${y(s.group)} ${y(s.name)}`:y(s.name))}}for(let s of o)r.push(s?`${y(s)} location`:"Birth location");return{keys:e,labels:r}}reqMark(e){return e.required?u`<span class="req" aria-hidden="true">*</span>`:d}description(e){if(!e.description)return d;if(e.description.length<=120)return u`<small class="help">${e.description}</small>`;let r=e.description.split(". ")[0]??e.description;return u`<details class="help-details"><summary><span class="help-lead">${r}</span>${pe()}</summary><small class="help help-full">${e.description}</small></details>`}renderTiles(e){let r=`roxy-form-${e.key}-label`,o=!!e.enum&&He(e.enum),s=e.enum??[],n=s.indexOf(this.values[e.key]),a=n===-1?0:n;return u`<div class="field tiles-field"><span class="label" id="${r}">${y(e.name)}${this.reqMark(e)}</span><div class="tiles" role="radiogroup" aria-labelledby="${r}" @keydown="${this.onTilesKeyDown(e)}">${s.map((l,c)=>{let h=this.values[e.key]===l,p=o?Le[De(l)]:void 0;return u`<button type="button" class="tile" role="radio" data-tile="${c}" aria-checked="${h?"true":"false"}" tabindex="${c===a?"0":"-1"}" @click="${()=>this.selectTile(e,l)}">${p?u`<span class="tile-glyph" aria-hidden="true">${p}</span>`:d} <span class="tile-label">${y(l)}</span></button>`})}</div>${this.description(e)}</div>`}renderSelect(e){let r=`roxy-form-${e.key}`;return u`<div class="field"><label for="${r}">${y(e.name)}${this.reqMark(e)}</label> <select id="${r}" ?required="${e.required}" @change="${o=>this.setValue(e.key,o.target.value)}"><option value="">Choose</option>${(e.enum??[]).map(o=>u`<option value="${o}" ?selected="${this.values[e.key]===o}">${y(o)}</option>`)}</select> ${this.description(e)}</div>`}renderToggle(e){let r=`roxy-form-${e.key}`,o=this.values[e.key]===!0;return u`<div class="field"><div class="toggle-row"><button type="button" id="${r}" class="toggle" role="switch" aria-checked="${o?"true":"false"}" @click="${()=>this.setValue(e.key,!o)}"><span class="knob"></span></button> <label class="toggle-label" for="${r}">${y(e.name)}${this.reqMark(e)}</label></div>${this.description(e)}</div>`}renderInput(e){let r=`roxy-form-${e.key}`,o=e.kind==="datetime"?"datetime-local":e.kind==="number"?"number":e.kind,s=e.kind==="array"?"Comma separated":e.example!=null?String(e.example):"";return u`<div class="field"><label for="${r}">${y(e.name)}${this.reqMark(e)}</label> <input id="${r}" type="${e.kind==="array"?"text":o}" ?required="${e.required}" min="${W(e.min)}" max="${W(e.max)}" step="${e.kind==="number"?"any":d}" placeholder="${s||d}" .value="${this.values[e.key]??""}" @input="${n=>this.setValue(e.key,this.coerce(e.kind,n.target.value))}"> ${this.description(e)}</div>`}renderField(e){switch(e.kind){case"tiles":return this.renderTiles(e);case"select":return this.renderSelect(e);case"toggle":return this.renderToggle(e);default:return this.renderInput(e)}}locationBlock(e){return u`<div class="location-block"><label>${e?`${y(e)} location`:"Birth location"}${this.locationRequired(e)?u`<span class="req" aria-hidden="true">*</span>`:d}</label><roxy-location-search publishable-key="${W(this.publishableKey)}" @roxy-location-select="${this.onLocationFor(e)}" placeholder="City of birth"></roxy-location-search><small class="help">Required: latitude, longitude, timezone. Pick a city to autofill.</small></div>`}groupCard(e){let r=this.fields.filter(o=>o.group===e&&this.isRendered(o));return u`<fieldset class="person-group"><legend>${y(e)}</legend>${this.groupHasLocation(e)?this.locationBlock(e):d}<div class="fields">${r.map(o=>this.renderField(o))}</div></fieldset>`}render(){if(!this.loaded)return u`<form><div class="roxy-skeleton" style="height:8rem"></div></form>`;if(this.specError)return u`<div class="spec-error" role="alert">Schema load failed: ${this.specError} <button type="button" class="submit" @click="${this.retryLoadSchema}">Retry</button></div>`;let e=this.fields.filter(c=>!c.group&&this.isRendered(c)),r=e.filter(c=>c.required),o=e.filter(c=>!c.required),s=this.groupKeys().filter(c=>c!==void 0),n=s.filter(c=>this.groupIsRequired(c)),a=s.filter(c=>!this.groupIsRequired(c)),l=o.length>0||a.length>0;return u`<form @submit="${this.onSubmit}"><h2 class="title">${this.formTitle}</h2>${this.validationErrors.length>0?u`<div class="validation-error" role="alert"><strong>Please complete:</strong> ${this.validationErrors.join(", ")}</div>`:d}<div class="fields">${r.map(c=>this.renderField(c))}</div>${this.groupHasLocation(void 0)?this.locationBlock(void 0):d} ${n.map(c=>this.groupCard(c))} ${l?u`<details class="advanced"><summary>Advanced${pe()}</summary><div class="fields">${o.map(c=>this.renderField(c))}</div>${a.map(c=>this.groupCard(c))}</details>`:d} ${this.singleEnumField?d:u`<button class="submit" type="submit">${this.effectiveSubmitLabel()}</button>`}</form>`}coerce(e,r){if(r!==""){if(e==="number"){let o=Number(r);return Number.isFinite(o)?o:void 0}return r}}};m.styles=[qe,Ue,w`form{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);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);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.fields{align-items:start;gap:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));display:grid}.fields:empty{display:none}.person-group{background:var(--roxy-surface,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-md,1rem);gap:var(--roxy-space-md,1rem);min-inline-size:0;margin:0;display:grid}.person-group legend{padding:0 var(--roxy-space-xs,.25rem);font-weight:var(--roxy-weight-bold,600)}.field{gap:var(--roxy-space-xs,.25rem);flex-direction:column;min-width:0;display:flex}.tiles-field{grid-column:1/-1}label,.label{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-secondary,#475569)}.req{color:var(--roxy-danger-fg,#991b1b);margin-left:4px}input,select{box-sizing:border-box;width:100%;padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-base,1rem);color:var(--roxy-fg,#0a0a0a);background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);font-family:inherit}input:focus,select:focus{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-color:var(--roxy-accent-ink,#b45309)}.help{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem)}.help-details>summary{cursor:pointer;color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);align-items:center;gap:4px;display:flex}.help-details .help-lead{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.help-details .help-full{margin-top:var(--roxy-space-xs,.25rem);display:block}.location-block{gap:var(--roxy-space-xs,.25rem);grid-column:1/-1;display:grid}.tiles{gap:var(--roxy-space-sm,.5rem);grid-template-columns:repeat(auto-fit,minmax(5.5rem,1fr));display:grid}.tile{min-height:44px;padding:var(--roxy-space-sm,.5rem);background:var(--roxy-bg,#fff);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;transition:border-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease), background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-direction:column;justify-content:center;align-items:center;gap:2px;display:flex}.tile:hover{border-color:var(--roxy-accent,#f59e0b)}.tile[aria-checked=true]{border-color:var(--roxy-accent,#f59e0b);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 12%, transparent);color:var(--roxy-accent-ink,#b45309);font-weight:var(--roxy-weight-bold,600)}.tile:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.tile-glyph{font-size:1.35em;line-height:1}.toggle-row{align-items:center;gap:var(--roxy-space-sm,.5rem);display:flex}.toggle{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);background:var(--roxy-border,#e4e4e7);cursor:pointer;width:44px;height:26px;transition:background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0;padding:0;position:relative}.toggle[aria-checked=true]{background:var(--roxy-accent,#f59e0b);border-color:var(--roxy-accent,#f59e0b)}.toggle .knob{background:var(--roxy-bg,#fff);width:20px;height:20px;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);border-radius:50%;position:absolute;top:2px;left:2px}.toggle[aria-checked=true] .knob{transform:translate(18px)}.toggle:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.toggle-label{cursor:pointer}@media (prefers-reduced-motion:reduce){.tile,.toggle,.toggle .knob{transition:none}}.advanced{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.advanced>summary{cursor:pointer;font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-fg,#0a0a0a);align-items:center;gap:6px;display:flex}.advanced[open]>summary{margin-bottom:var(--roxy-space-md,1rem)}.advanced .fields,.advanced .person-group{margin-top:var(--roxy-space-md,1rem)}.validation-error{gap:var(--roxy-space-xs,.25rem);padding:var(--roxy-space-md,1rem);background:color-mix(in srgb, var(--roxy-danger,#dc2626) 8%, transparent);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);display:grid}button.submit{background:var(--roxy-accent-ink,#b45309);color:var(--roxy-bg,#fff);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-lg,1.5rem);font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);cursor:pointer;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));border:0;justify-self:start}button.submit:hover{transform:scale(1.02)}button.submit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}@media (prefers-reduced-motion:reduce){button.submit{transition:none}}.spec-error{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}`],f([v({type:String,attribute:"data-endpoint"})],m.prototype,"endpoint",2),f([v({type:String})],m.prototype,"method",2),f([v({type:String,attribute:"spec-url"})],m.prototype,"specUrl",2),f([v({type:String,attribute:"submit-label"})],m.prototype,"submitLabel",2),f([v({type:String,attribute:"publishable-key"})],m.prototype,"publishableKey",2),f([v({attribute:!1})],m.prototype,"initialValues",2),f([S()],m.prototype,"fields",2),f([S()],m.prototype,"formTitle",2),f([S()],m.prototype,"hasLang",2),f([S()],m.prototype,"values",2),f([S()],m.prototype,"loaded",2),f([S()],m.prototype,"specError",2),f([S()],m.prototype,"validationErrors",2),m=f([Me("roxy-endpoint-form")],m);j();return We(vt);})();
265
265
  /*! Bundled license information:
266
266
 
267
267
  @lit/reactive-element/css-tag.js: