@wodira/browser 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +259 -17
  3. package/dist/index.cjs +38 -5
  4. package/dist/index.d.ts +110 -2
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +38 -4
  7. package/dist/types.d.ts +56 -2
  8. package/dist/types.d.ts.map +1 -1
  9. package/dist/ui/boxes/cdn.d.ts +2 -0
  10. package/dist/ui/boxes/cdn.d.ts.map +1 -0
  11. package/dist/ui/boxes/cdn.js +743 -0
  12. package/dist/ui/boxes/client.d.ts +30 -0
  13. package/dist/ui/boxes/client.d.ts.map +1 -0
  14. package/dist/ui/boxes/components.d.ts +246 -0
  15. package/dist/ui/boxes/components.d.ts.map +1 -0
  16. package/dist/ui/boxes/i18n.d.ts +107 -0
  17. package/dist/ui/boxes/i18n.d.ts.map +1 -0
  18. package/dist/ui/boxes/index.d.ts +16 -0
  19. package/dist/ui/boxes/index.d.ts.map +1 -0
  20. package/dist/ui/boxes/index.js +3071 -0
  21. package/dist/ui/boxes/styles.d.ts +2 -0
  22. package/dist/ui/boxes/styles.d.ts.map +1 -0
  23. package/dist/ui/boxes/types.d.ts +105 -0
  24. package/dist/ui/boxes/types.d.ts.map +1 -0
  25. package/dist/ui/components.d.ts +158 -4
  26. package/dist/ui/components.d.ts.map +1 -1
  27. package/dist/ui/events.d.ts +1 -1
  28. package/dist/ui/events.d.ts.map +1 -1
  29. package/dist/ui/i18n.d.ts +4 -1
  30. package/dist/ui/i18n.d.ts.map +1 -1
  31. package/dist/ui/index-tfej862z.js +3264 -0
  32. package/dist/ui/index-xdhg885t.js +997 -0
  33. package/dist/ui/index.d.ts +19 -3
  34. package/dist/ui/index.d.ts.map +1 -1
  35. package/dist/ui/index.js +9038 -2030
  36. package/dist/ui/layout-styles.d.ts +3 -0
  37. package/dist/ui/layout-styles.d.ts.map +1 -0
  38. package/dist/ui/registration-eligibility.d.ts +52 -0
  39. package/dist/ui/registration-eligibility.d.ts.map +1 -0
  40. package/dist/ui/shirt-3d-renderer-jyks1h8f.js +10 -0
  41. package/dist/ui/shirt-sponsors/cdn.d.ts +2 -0
  42. package/dist/ui/shirt-sponsors/cdn.d.ts.map +1 -0
  43. package/dist/ui/shirt-sponsors/cdn.js +5125 -0
  44. package/dist/ui/shirt-sponsors/index.d.ts +9 -0
  45. package/dist/ui/shirt-sponsors/index.d.ts.map +1 -0
  46. package/dist/ui/shirt-sponsors/index.js +10 -0
  47. package/dist/ui/shirt-sponsors/render/auction-model.d.ts +55 -0
  48. package/dist/ui/shirt-sponsors/render/auction-model.d.ts.map +1 -0
  49. package/dist/ui/shirt-sponsors/render/index.d.ts +7 -0
  50. package/dist/ui/shirt-sponsors/render/index.d.ts.map +1 -0
  51. package/dist/ui/shirt-sponsors/render/index.js +34 -0
  52. package/dist/ui/shirt-sponsors/render/shirt-3d-renderer.d.ts +109 -0
  53. package/dist/ui/shirt-sponsors/render/shirt-3d-renderer.d.ts.map +1 -0
  54. package/dist/ui/shirt-sponsors/render/shirt-artwork-projection.d.ts +13 -0
  55. package/dist/ui/shirt-sponsors/render/shirt-artwork-projection.d.ts.map +1 -0
  56. package/dist/ui/shirt-sponsors/render/shirt-artwork.d.ts +17 -0
  57. package/dist/ui/shirt-sponsors/render/shirt-artwork.d.ts.map +1 -0
  58. package/dist/ui/shirt-sponsors/render/shirt-cloth-motion.d.ts +31 -0
  59. package/dist/ui/shirt-sponsors/render/shirt-cloth-motion.d.ts.map +1 -0
  60. package/dist/ui/shirt-sponsors/render/shirt-silhouette.d.ts +9 -0
  61. package/dist/ui/shirt-sponsors/render/shirt-silhouette.d.ts.map +1 -0
  62. package/dist/ui/shirt-sponsors/shirt-auction.d.ts +137 -0
  63. package/dist/ui/shirt-sponsors/shirt-auction.d.ts.map +1 -0
  64. package/dist/ui/signature-pad.d.ts +29 -0
  65. package/dist/ui/signature-pad.d.ts.map +1 -0
  66. package/dist/ui/styles.d.ts.map +1 -1
  67. package/dist/ui/theme.d.ts +63 -0
  68. package/dist/ui/theme.d.ts.map +1 -0
  69. package/dist/ui/validators.d.ts +1 -1
  70. package/dist/ui/validators.d.ts.map +1 -1
  71. package/package.json +42 -13
@@ -0,0 +1,743 @@
1
+ var H=globalThis,te=H.ShadowRoot&&(H.ShadyCSS===void 0||H.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,re=Symbol(),Se=new WeakMap;class ie{constructor(e,t,r){if(this._$cssResult$=!0,r!==re)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this._strings=t}get styleSheet(){let e=this._styleSheet,t=this._strings;if(te&&e===void 0){let r=t!==void 0&&t.length===1;if(r)e=Se.get(t);if(e===void 0){if((this._styleSheet=e=new CSSStyleSheet).replaceSync(this.cssText),r)Se.set(t,e)}}return e}toString(){return this.cssText}}var et=(e)=>{if(e._$cssResult$===!0)return e.cssText;else if(typeof e==="number")return e;else throw Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)},tt=(e)=>new ie(typeof e==="string"?e:String(e),void 0,re),j=(e,...t)=>{let r=e.length===1?e[0]:t.reduce((i,a,o)=>i+et(a)+e[o+1],e[0]);return new ie(r,e,re)},Ee=(e,t)=>{if(te)e.adoptedStyleSheets=t.map((r)=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let i=document.createElement("style"),a=H.litNonce;if(a!==void 0)i.setAttribute("nonce",a);i.textContent=r.cssText,e.appendChild(i)}},rt=(e)=>{let t="";for(let r of e.cssRules)t+=r.cssText;return tt(t)},ae=te?(e)=>e:(e)=>e instanceof CSSStyleSheet?rt(e):e;var{is:it,defineProperty:at,getOwnPropertyDescriptor:$e,getOwnPropertyNames:ot,getOwnPropertySymbols:st,getPrototypeOf:Te}=Object,nt=!1,f=globalThis;if(nt)f.customElements??=customElements;var b=!0,x,Ce=f.trustedTypes,lt=Ce?Ce.emptyScript:"",Pe=b?f.reactiveElementPolyfillSupportDevMode:f.reactiveElementPolyfillSupport;if(b)f.litIssuedWarnings??=new Set,x=(e,t)=>{if(t+=` See https://lit.dev/msg/${e} for more information.`,!f.litIssuedWarnings.has(t)&&!f.litIssuedWarnings.has(e))console.warn(t),f.litIssuedWarnings.add(t)},queueMicrotask(()=>{if(x("dev-mode","Lit is in dev mode. Not recommended for production!"),f.ShadyDOM?.inUse&&Pe===void 0)x("polyfill-support-missing","Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.")});var dt=b?(e)=>{if(!f.emitLitDebugLogEvents)return;f.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))}:void 0,O=(e,t)=>e,oe={toAttribute(e,t){switch(t){case Boolean:e=e?lt:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e);break}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(i){r=null}break}return r}},Ae=(e,t)=>!it(e,t),We={attribute:!0,type:String,converter:oe,reflect:!1,useDefault:!1,hasChanged:Ae};Symbol.metadata??=Symbol("metadata");f.litPropertyMetadata??=new WeakMap;class y extends HTMLElement{static addInitializer(e){this.__prepare(),(this._initializers??=[]).push(e)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap&&[...this.__attributeToPropertyMap.keys()]}static createProperty(e,t=We){if(t.state)t.attribute=!1;if(this.__prepare(),this.prototype.hasOwnProperty(e))t=Object.create(t),t.wrapped=!0;if(this.elementProperties.set(e,t),!t.noAccessor){let r=b?Symbol.for(`${String(e)} (@property() cache)`):Symbol(),i=this.getPropertyDescriptor(e,r,t);if(i!==void 0)at(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){let{get:i,set:a}=$e(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};if(b&&i==null){if("value"in($e(this.prototype,e)??{}))throw Error(`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);x("reactive-property-without-getter",`Field ${JSON.stringify(String(e))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`)}return{get:i,set(o){let s=i?.call(this);a?.call(this,o),this.requestUpdate(e,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??We}static __prepare(){if(this.hasOwnProperty(O("elementProperties",this)))return;let e=Te(this);if(e.finalize(),e._initializers!==void 0)this._initializers=[...e._initializers];this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(O("finalized",this)))return;if(this.finalized=!0,this.__prepare(),this.hasOwnProperty(O("properties",this))){let t=this.properties,r=[...ot(t),...st(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this.__attributeToPropertyMap=new Map;for(let[t,r]of this.elementProperties){let i=this.__attributeNameForProperty(t,r);if(i!==void 0)this.__attributeToPropertyMap.set(i,t)}if(this.elementStyles=this.finalizeStyles(this.styles),b){if(this.hasOwnProperty("createProperty"))x("no-override-create-property","Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators");if(this.hasOwnProperty("getPropertyDescriptor"))x("no-override-get-property-descriptor","Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators")}}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(ae(i))}else if(e!==void 0)t.push(ae(e));return t}static __attributeNameForProperty(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.__instanceProperties=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this.__initialize()}__initialize(){this.__updatePromise=new Promise((e)=>this.enableUpdating=e),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),this.constructor._initializers?.forEach((e)=>e(this))}addController(e){if((this.__controllers??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected)e.hostConnected?.()}removeController(e){this.__controllers?.delete(e)}__saveInstanceProperties(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())if(this.hasOwnProperty(r))e.set(r,this[r]),delete this[r];if(e.size>0)this.__instanceProperties=e}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ee(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.__controllers?.forEach((e)=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this.__controllers?.forEach((e)=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$attributeToProperty(e,r)}__propertyToAttribute(e,t){let i=this.constructor.elementProperties.get(e),a=this.constructor.__attributeNameForProperty(e,i);if(a!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:oe).toAttribute(t,i.type);if(b&&this.constructor.enabledWarnings.includes("migration")&&s===void 0)x("undefined-attribute-value",`The attribute value for the ${e} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`);if(this.__reflectingProperty=e,s==null)this.removeAttribute(a);else this.setAttribute(a,s);this.__reflectingProperty=null}}_$attributeToProperty(e,t){let r=this.constructor,i=r.__attributeToPropertyMap.get(e);if(i!==void 0&&this.__reflectingProperty!==i){let a=r.getPropertyOptions(i),o=typeof a.converter==="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:oe;this.__reflectingProperty=i;let s=o.fromAttribute(t,a.type);this[i]=s??this.__defaultValues?.get(i)??s,this.__reflectingProperty=null}}requestUpdate(e,t,r,i=!1,a){if(e!==void 0){if(b&&e instanceof Event)x("","The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()");let o=this.constructor;if(i===!1)a=this[e];if(r??=o.getPropertyOptions(e),(r.hasChanged??Ae)(a,t)||r.useDefault&&r.reflect&&a===this.__defaultValues?.get(e)&&!this.hasAttribute(o.__attributeNameForProperty(e,r)))this._$changeProperty(e,t,r);else return}if(this.isUpdatePending===!1)this.__updatePromise=this.__enqueueUpdate()}_$changeProperty(e,t,{useDefault:r,reflect:i,wrapped:a},o){if(r&&!(this.__defaultValues??=new Map).has(e)){if(this.__defaultValues.set(e,o??t??this[e]),a!==!0||o!==void 0)return}if(!this._$changedProperties.has(e)){if(!this.hasUpdated&&!r)t=void 0;this._$changedProperties.set(e,t)}if(i===!0&&this.__reflectingProperty!==e)(this.__reflectingProperties??=new Set).add(e)}async __enqueueUpdate(){this.isUpdatePending=!0;try{await this.__updatePromise}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();if(e!=null)await e;return!this.isUpdatePending}scheduleUpdate(){let e=this.performUpdate();if(b&&this.constructor.enabledWarnings.includes("async-perform-update")&&typeof e?.then==="function")x("async-perform-update",`Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`);return e}performUpdate(){if(!this.isUpdatePending)return;if(dt?.({kind:"update"}),!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),b){let a=[...this.constructor.elementProperties.keys()].filter((o)=>this.hasOwnProperty(o)&&(o in Te(this)));if(a.length)throw Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${a.join(", ")}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`)}if(this.__instanceProperties){for(let[i,a]of this.__instanceProperties)this[i]=a;this.__instanceProperties=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[i,a]of r){let{wrapped:o}=a,s=this[i];if(o===!0&&!this._$changedProperties.has(i)&&s!==void 0)this._$changeProperty(i,void 0,a,s)}}let e=!1,t=this._$changedProperties;try{if(e=this.shouldUpdate(t),e)this.willUpdate(t),this.__controllers?.forEach((r)=>r.hostUpdate?.()),this.update(t);else this.__markUpdated()}catch(r){throw e=!1,this.__markUpdated(),r}if(e)this._$didUpdate(t)}willUpdate(e){}_$didUpdate(e){if(this.__controllers?.forEach((t)=>t.hostUpdated?.()),!this.hasUpdated)this.hasUpdated=!0,this.firstUpdated(e);if(this.updated(e),b&&this.isUpdatePending&&this.constructor.enabledWarnings.includes("change-in-update"))x("change-in-update",`Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`)}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(e){return!0}update(e){this.__reflectingProperties&&=this.__reflectingProperties.forEach((t)=>this.__propertyToAttribute(t,this[t])),this.__markUpdated()}updated(e){}firstUpdated(e){}}y.elementStyles=[];y.shadowRootOptions={mode:"open"};y[O("elementProperties",y)]=new Map;y[O("finalized",y)]=new Map;Pe?.({ReactiveElement:y});if(b){y.enabledWarnings=["change-in-update","async-perform-update"];let e=function(t){if(!t.hasOwnProperty(O("enabledWarnings",t)))t.enabledWarnings=t.enabledWarnings.slice()};y.enableWarning=function(t){if(e(this),!this.enabledWarnings.includes(t))this.enabledWarnings.push(t)},y.disableWarning=function(t){e(this);let r=this.enabledWarnings.indexOf(t);if(r>=0)this.enabledWarnings.splice(r,1)}}(f.reactiveElementVersions??=[]).push("2.1.2");if(b&&f.reactiveElementVersions.length>1)queueMicrotask(()=>{x("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});var w=globalThis,p=(e)=>{if(!w.emitLitDebugLogEvents)return;w.dispatchEvent(new CustomEvent("lit-debug",{detail:e}))},ct=0,B;w.litIssuedWarnings??=new Set,B=(e,t)=>{if(t+=e?` See https://lit.dev/msg/${e} for more information.`:"",!w.litIssuedWarnings.has(t)&&!w.litIssuedWarnings.has(e))console.warn(t),w.litIssuedWarnings.add(t)},queueMicrotask(()=>{B("dev-mode","Lit is in dev mode. Not recommended for production!")});var _=w.ShadyDOM?.inUse&&w.ShadyDOM?.noPatch===!0?w.ShadyDOM.wrap:(e)=>e,Y=w.trustedTypes,Re=Y?Y.createPolicy("lit-html",{createHTML:(e)=>e}):void 0,pt=(e)=>e,Q=(e,t,r)=>pt,ut=(e)=>{if(I!==Q)throw Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");I=e},ht=()=>{I=Q},ce=(e,t,r)=>I(e,t,r),Le="$lit$",S=`lit$${Math.random().toFixed(9).slice(2)}$`,Be="?"+S,mt=`<${Be}>`,R=document,M=()=>R.createComment(""),V=(e)=>e===null||typeof e!="object"&&typeof e!="function",pe=Array.isArray,gt=(e)=>pe(e)||typeof e?.[Symbol.iterator]==="function",se=`[
2
+ \f\r]`,ft=`[^
3
+ \f\r"'\`<>=]`,bt=`[^\\s"'>=/]`,U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ke=1,ne=2,yt=3,Ie=/-->/g,De=/>/g,W=new RegExp(`>|${se}(?:(${bt}+)(${se}*=${se}*(?:${ft}|("|')|))|$)`,"g"),wt=0,Oe=1,xt=2,Ne=3,le=/'/g,de=/"/g,Me=/^(?:script|style|textarea|title)$/i,_t=1,G=2,J=3,ue=1,X=2,vt=3,St=4,Et=5,he=6,$t=7,me=(e)=>(t,...r)=>{if(t.some((i)=>i===void 0))console.warn(`Some template strings are undefined.
4
+ This is probably caused by illegal octal escape sequences.`);if(r.some((i)=>i?._$litStatic$))B("",`Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.
5
+ Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`);return{["_$litType$"]:e,strings:t,values:r}},c=me(_t),Lt=me(G),Bt=me(J),k=Symbol.for("lit-noChange"),l=Symbol.for("lit-nothing"),Ue=new WeakMap,A=R.createTreeWalker(R,129),I=Q;function Ve(e,t){if(!pe(e)||!e.hasOwnProperty("raw")){let r="invalid template strings array";throw r=`
6
+ Internal Error: expected template strings to be an array
7
+ with a 'raw' field. Faking a template strings array by
8
+ calling html or svg like an ordinary function is effectively
9
+ the same as calling unsafeHtml and can lead to major security
10
+ issues, e.g. opening your code up to XSS attacks.
11
+ If you're using the html or svg tagged template functions normally
12
+ and still seeing this error, please file a bug at
13
+ https://github.com/lit/lit/issues/new?template=bug_report.md
14
+ and include information about your build tooling, if any.
15
+ `.trim().replace(/\n */g,`
16
+ `),Error(r)}return Re!==void 0?Re.createHTML(t):t}var Tt=(e,t)=>{let r=e.length-1,i=[],a=t===G?"<svg>":t===J?"<math>":"",o,s=U;for(let h=0;h<r;h++){let v=e[h],u=-1,g,C=0,m;while(C<v.length){if(s.lastIndex=C,m=s.exec(v),m===null)break;if(C=s.lastIndex,s===U){if(m[ke]==="!--")s=Ie;else if(m[ke]!==void 0)s=De;else if(m[ne]!==void 0){if(Me.test(m[ne]))o=new RegExp(`</${m[ne]}`,"g");s=W}else if(m[yt]!==void 0)throw Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else if(s===W)if(m[wt]===">")s=o??U,u=-1;else if(m[Oe]===void 0)u=-2;else u=s.lastIndex-m[xt].length,g=m[Oe],s=m[Ne]===void 0?W:m[Ne]==='"'?de:le;else if(s===de||s===le)s=W;else if(s===Ie||s===De)s=U;else s=W,o=void 0}console.assert(u===-1||s===W||s===le||s===de,"unexpected parse state B");let P=s===W&&e[h+1].startsWith("/>")?" ":"";a+=s===U?v+mt:u>=0?(i.push(g),v.slice(0,u)+Le+v.slice(u))+S+P:v+S+(u===-2?h:P)}let n=a+(e[r]||"<?>")+(t===G?"</svg>":t===J?"</math>":"");return[Ve(e,n),i]};class z{constructor({strings:e,["_$litType$"]:t},r){this.parts=[];let i,a=0,o=0,s=e.length-1,n=this.parts,[h,v]=Tt(e,t);if(this.el=z.createElement(h,r),A.currentNode=this.el.content,t===G||t===J){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}while((i=A.nextNode())!==null&&n.length<s){if(i.nodeType===1){{let u=i.localName;if(/^(?:textarea|template)$/i.test(u)&&i.innerHTML.includes(S)){let g=`Expressions are not supported inside \`${u}\` elements. See https://lit.dev/msg/expression-in-${u} for more information.`;if(u==="template")throw Error(g);else B("",g)}}if(i.hasAttributes()){for(let u of i.getAttributeNames())if(u.endsWith(Le)){let g=v[o++],m=i.getAttribute(u).split(S),P=/([.?@])?(.*)/.exec(g);n.push({type:ue,index:a,name:P[2],strings:m,ctor:P[1]==="."?Fe:P[1]==="?"?Ke:P[1]==="@"?qe:K}),i.removeAttribute(u)}else if(u.startsWith(S))n.push({type:he,index:a}),i.removeAttribute(u)}if(Me.test(i.tagName)){let u=i.textContent.split(S),g=u.length-1;if(g>0){i.textContent=Y?Y.emptyScript:"";for(let C=0;C<g;C++)i.append(u[C],M()),A.nextNode(),n.push({type:X,index:++a});i.append(u[g],M())}}}else if(i.nodeType===8)if(i.data===Be)n.push({type:X,index:a});else{let g=-1;while((g=i.data.indexOf(S,g+1))!==-1)n.push({type:$t,index:a}),g+=S.length-1}a++}if(v.length!==o)throw Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+e.join("${...}")+"`");p&&p({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:e})}static createElement(e,t){let r=R.createElement("template");return r.innerHTML=e,r}}function N(e,t,r=e,i){if(t===k)return t;let a=i!==void 0?r.__directives?.[i]:r.__directive,o=V(t)?void 0:t._$litDirective$;if(a?.constructor!==o){if(a?._$notifyDirectiveConnectionChanged?.(!1),o===void 0)a=void 0;else a=new o(e),a._$initialize(e,r,i);if(i!==void 0)(r.__directives??=[])[i]=a;else r.__directive=a}if(a!==void 0)t=N(e,a._$resolve(e,t.values),a,i);return t}class ze{constructor(e,t){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=e,this._$parent=t}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(e){let{el:{content:t},parts:r}=this._$template,i=(e?.creationScope??R).importNode(t,!0);A.currentNode=i;let a=A.nextNode(),o=0,s=0,n=r[0];while(n!==void 0){if(o===n.index){let h;if(n.type===X)h=new F(a,a.nextSibling,this,e);else if(n.type===ue)h=new n.ctor(a,n.name,n.strings,this,e);else if(n.type===he)h=new He(a,this,e);this._$parts.push(h),n=r[++s]}if(o!==n?.index)a=A.nextNode(),o++}return A.currentNode=R,i}_update(e){let t=0;for(let r of this._$parts){if(r!==void 0)if(p&&p({kind:"set part",part:r,value:e[t],valueIndex:t,values:e,templateInstance:this}),r.strings!==void 0)r._$setValue(e,r,t),t+=r.strings.length-2;else r._$setValue(e[t]);t++}}}class F{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(e,t,r,i){this.type=X,this._$committedValue=l,this._$disconnectableChildren=void 0,this._$startNode=e,this._$endNode=t,this._$parent=r,this.options=i,this.__isConnected=i?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let e=_(this._$startNode).parentNode,t=this._$parent;if(t!==void 0&&e?.nodeType===11)e=t.parentNode;return e}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(e,t=this){if(this.parentNode===null)throw Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(e=N(this,e,t),V(e)){if(e===l||e==null||e===""){if(this._$committedValue!==l)p&&p({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear();this._$committedValue=l}else if(e!==this._$committedValue&&e!==k)this._commitText(e)}else if(e._$litType$!==void 0)this._commitTemplateResult(e);else if(e.nodeType!==void 0){if(this.options?.host===e){this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),console.warn("Attempted to render the template host",e,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");return}this._commitNode(e)}else if(gt(e))this._commitIterable(e);else this._commitText(e)}_insert(e){return _(_(this._$startNode).parentNode).insertBefore(e,this._$endNode)}_commitNode(e){if(this._$committedValue!==e){if(this._$clear(),I!==Q){let t=this._$startNode.parentNode?.nodeName;if(t==="STYLE"||t==="SCRIPT"){let r="Forbidden";if(t==="STYLE")r="Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.";else r="Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.";throw Error(r)}}p&&p({kind:"commit node",start:this._$startNode,parent:this._$parent,value:e,options:this.options}),this._$committedValue=this._insert(e)}}_commitText(e){if(this._$committedValue!==l&&V(this._$committedValue)){let t=_(this._$startNode).nextSibling;if(this._textSanitizer===void 0)this._textSanitizer=ce(t,"data","property");e=this._textSanitizer(e),p&&p({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}else{let t=R.createTextNode("");if(this._commitNode(t),this._textSanitizer===void 0)this._textSanitizer=ce(t,"data","property");e=this._textSanitizer(e),p&&p({kind:"commit text",node:t,value:e,options:this.options}),t.data=e}this._$committedValue=e}_commitTemplateResult(e){let{values:t,["_$litType$"]:r}=e,i=typeof r==="number"?this._$getTemplate(e):(r.el===void 0&&(r.el=z.createElement(Ve(r.h,r.h[0]),this.options)),r);if(this._$committedValue?._$template===i)p&&p({kind:"template updating",template:i,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:t}),this._$committedValue._update(t);else{let a=new ze(i,this),o=a._clone(this.options);p&&p({kind:"template instantiated",template:i,instance:a,parts:a._$parts,options:this.options,fragment:o,values:t}),a._update(t),p&&p({kind:"template instantiated and updated",template:i,instance:a,parts:a._$parts,options:this.options,fragment:o,values:t}),this._commitNode(o),this._$committedValue=a}}_$getTemplate(e){let t=Ue.get(e.strings);if(t===void 0)Ue.set(e.strings,t=new z(e));return t}_commitIterable(e){if(!pe(this._$committedValue))this._$committedValue=[],this._$clear();let t=this._$committedValue,r=0,i;for(let a of e){if(r===t.length)t.push(i=new F(this._insert(M()),this._insert(M()),this,this.options));else i=t[r];i._$setValue(a),r++}if(r<t.length)this._$clear(i&&_(i._$endNode).nextSibling,r),t.length=r}_$clear(e=_(this._$startNode).nextSibling,t){this._$notifyConnectionChanged?.(!1,!0,t);while(e!==this._$endNode){let r=_(e).nextSibling;_(e).remove(),e=r}}setConnected(e){if(this._$parent===void 0)this.__isConnected=e,this._$notifyConnectionChanged?.(e);else throw Error("part.setConnected() may only be called on a RootPart returned from render().")}}class K{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(e,t,r,i,a){if(this.type=ue,this._$committedValue=l,this._$disconnectableChildren=void 0,this.element=e,this.name=t,this._$parent=i,this.options=a,r.length>2||r[0]!==""||r[1]!=="")this._$committedValue=Array(r.length-1).fill(new String),this.strings=r;else this._$committedValue=l;this._sanitizer=void 0}_$setValue(e,t=this,r,i){let a=this.strings,o=!1;if(a===void 0){if(e=N(this,e,t,0),o=!V(e)||e!==this._$committedValue&&e!==k,o)this._$committedValue=e}else{let s=e;e=a[0];let n,h;for(n=0;n<a.length-1;n++){if(h=N(this,s[r+n],t,n),h===k)h=this._$committedValue[n];if(o||=!V(h)||h!==this._$committedValue[n],h===l)e=l;else if(e!==l)e+=(h??"")+a[n+1];this._$committedValue[n]=h}}if(o&&!i)this._commitValue(e)}_commitValue(e){if(e===l)_(this.element).removeAttribute(this.name);else{if(this._sanitizer===void 0)this._sanitizer=I(this.element,this.name,"attribute");e=this._sanitizer(e??""),p&&p({kind:"commit attribute",element:this.element,name:this.name,value:e,options:this.options}),_(this.element).setAttribute(this.name,e??"")}}}class Fe extends K{constructor(){super(...arguments);this.type=vt}_commitValue(e){if(this._sanitizer===void 0)this._sanitizer=I(this.element,this.name,"property");e=this._sanitizer(e),p&&p({kind:"commit property",element:this.element,name:this.name,value:e,options:this.options}),this.element[this.name]=e===l?void 0:e}}class Ke extends K{constructor(){super(...arguments);this.type=St}_commitValue(e){p&&p({kind:"commit boolean attribute",element:this.element,name:this.name,value:!!(e&&e!==l),options:this.options}),_(this.element).toggleAttribute(this.name,!!e&&e!==l)}}class qe extends K{constructor(e,t,r,i,a){super(e,t,r,i,a);if(this.type=Et,this.strings!==void 0)throw Error(`A \`<${e.localName}>\` has a \`@${t}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(e,t=this){if(e=N(this,e,t,0)??l,e===k)return;let r=this._$committedValue,i=e===l&&r!==l||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,a=e!==l&&(r===l||i);if(p&&p({kind:"commit event listener",element:this.element,name:this.name,value:e,options:this.options,removeListener:i,addListener:a,oldListener:r}),i)this.element.removeEventListener(this.name,this,r);if(a)this.element.addEventListener(this.name,this,e);this._$committedValue=e}handleEvent(e){if(typeof this._$committedValue==="function")this._$committedValue.call(this.options?.host??this.element,e);else this._$committedValue.handleEvent(e)}}class He{constructor(e,t,r){this.element=e,this.type=he,this._$disconnectableChildren=void 0,this._$parent=t,this.options=r}get _$isConnected(){return this._$parent._$isConnected}_$setValue(e){p&&p({kind:"commit to element binding",element:this.element,value:e,options:this.options}),N(this,e)}}var Ct=w.litHtmlPolyfillSupportDevMode;Ct?.(z,F);(w.litHtmlVersions??=[]).push("3.3.3");if(w.litHtmlVersions.length>1)queueMicrotask(()=>{B("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});var L=(e,t,r)=>{if(t==null)throw TypeError(`The container to render into may not be ${t}`);let i=ct++,a=r?.renderBefore??t,o=a._$litPart$;if(p&&p({kind:"begin render",id:i,value:e,container:t,options:r,part:o}),o===void 0){let s=r?.renderBefore??null;a._$litPart$=o=new F(t.insertBefore(M(),s),s,void 0,r??{})}return o._$setValue(e),p&&p({kind:"end render",id:i,value:e,container:t,options:r,part:o}),o};L.setSanitizer=ut,L.createSanitizer=ce,L._testOnlyClearSanitizerFactoryDoNotCallOrElse=ht;var Wt=(e,t)=>e,ge=!0,E=globalThis,je;if(ge)E.litIssuedWarnings??=new Set,je=(e,t)=>{if(t+=` See https://lit.dev/msg/${e} for more information.`,!E.litIssuedWarnings.has(t)&&!E.litIssuedWarnings.has(e))console.warn(t),E.litIssuedWarnings.add(t)};class T extends y{constructor(){super(...arguments);this.renderOptions={host:this},this.__childPart=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();if(!this.hasUpdated)this.renderOptions.isConnected=this.isConnected;super.update(e),this.__childPart=L(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.__childPart?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.__childPart?.setConnected(!1)}render(){return k}}T._$litElement$=!0;T[Wt("finalized",T)]=!0;E.litElementHydrateSupport?.({LitElement:T});var Pt=ge?E.litElementPolyfillSupportDevMode:E.litElementPolyfillSupport;Pt?.({LitElement:T});(E.litElementVersions??=[]).push("4.2.2");if(ge&&E.litElementVersions.length>1)queueMicrotask(()=>{je("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});class fe extends Error{status;statusText;payload;constructor(e){super(e.message);this.name="WodiraBrowserApiError",this.status=e.status,this.statusText=e.statusText,this.payload=e.payload}}class Ye{options;baseUrl;prefix;fetcher;constructor(e){this.options=e;if(!e.publishableKey?.startsWith("wpk_live_"))throw Error("WODira Boxes widgets require a wpk_live_ publishable key.");if(!e.installationId?.trim())throw Error("WODira Boxes widgets require an installation-id.");this.baseUrl=(e.baseUrl??"https://api.wodira.app").replace(/\/+$/,""),this.prefix=`/external/v1/browser/box-widgets/${encodeURIComponent(e.installationId)}`,this.fetcher=e.fetch??globalThis.fetch.bind(globalThis)}getContext(e){return this.request("/context",e?{signal:e}:{})}getCalendar(e,t=1,r){let i=new URLSearchParams({from:e.toISOString(),weeks:String(t)});return this.request(`/calendar?${i}`,r?{signal:r}:{})}getPlans(e){return this.request("/plans",e?{signal:e}:{})}getTrialClasses(e){return this.request("/trial-classes",e?{signal:e}:{})}createFlow(e,t){return this.request("/flows",{method:"POST",body:e,...t?{signal:t}:{}})}recordTelemetry(e,t){return this.request("/telemetry",{method:"POST",body:{events:e},...t?{signal:t}:{}})}verifyResult(e,t){return this.request(`/results/${encodeURIComponent(e)}`,t?{signal:t}:{})}async request(e,t){let r=new Headers({accept:"application/json","x-publishable-key":this.options.publishableKey}),i={method:t.method??"GET",headers:r};if(t.signal)i.signal=t.signal;if(t.body!==void 0)r.set("content-type","application/json"),i.body=JSON.stringify(t.body);let a=await this.fetcher(`${this.baseUrl}${this.prefix}${e}`,i);if(!a.ok){let s=await a.text(),n=s||null;try{n=s?JSON.parse(s):null}catch{}throw new fe({status:a.status,statusText:a.statusText,message:typeof n==="object"&&typeof n?.message==="string"?n.message:"WODira Boxes widget request failed.",payload:n})}let o=await a.text();return o?JSON.parse(o):void 0}}function Ge(e){return new Ye(e)}var At={es:{calendar:"Horario de clases",trial:"Prueba una clase",plans:"Planes",previous:"Semana anterior",next:"Semana siguiente",reserve:"Continuar",loading:"Cargando…",empty:"No hay opciones disponibles en estas fechas.",error:"No pudimos cargar este contenido. Inténtalo de nuevo.",available:"Disponible",last:"Últimas plazas",waitlist:"Lista de espera",full:"Completa",coach:"Coach",duration:"min",free:"Gratis",unlimited:"Ilimitado",email:"Tu email",privacy:"Acepto la política de privacidad de WODira y del box.",trialCta:"Continuar",chooseClass:"Elige una clase",result:"¡Todo listo! Tu solicitud se ha completado.",powered:"Tecnología de WODira",retry:"Reintentar",per:"por",credits:"créditos",once:"pago único",daily:"diario",weekly:"semanal",monthly:"mensual",yearly:"anual"},en:{calendar:"Class schedule",trial:"Try a class",plans:"Plans",previous:"Previous week",next:"Next week",reserve:"Continue",loading:"Loading…",empty:"No options are available for these dates.",error:"We could not load this content. Try again.",available:"Available",last:"Last spots",waitlist:"Waitlist",full:"Full",coach:"Coach",duration:"min",free:"Free",unlimited:"Unlimited",email:"Your email",privacy:"I accept WODira and the gym privacy policies.",trialCta:"Continue",chooseClass:"Choose a class",result:"All set! Your request is complete.",powered:"Powered by WODira",retry:"Retry",per:"per",credits:"credits",once:"one-time",daily:"daily",weekly:"weekly",monthly:"monthly",yearly:"yearly"},pt:{calendar:"Horário de aulas",trial:"Experimente uma aula",plans:"Planos",previous:"Semana anterior",next:"Semana seguinte",reserve:"Continuar",loading:"A carregar…",empty:"Não há opções disponíveis nestas datas.",error:"Não foi possível carregar. Tente novamente.",available:"Disponível",last:"Últimas vagas",waitlist:"Lista de espera",full:"Lotada",coach:"Coach",duration:"min",free:"Grátis",unlimited:"Ilimitado",email:"O seu email",privacy:"Aceito as políticas de privacidade da WODira e do box.",trialCta:"Continuar",chooseClass:"Escolha uma aula",result:"Tudo pronto! O seu pedido foi concluído.",powered:"Tecnologia WODira",retry:"Tentar novamente",per:"por",credits:"créditos",once:"pagamento único",daily:"diário",weekly:"semanal",monthly:"mensal",yearly:"anual"}};function q(e){let r=(e==="auto"||!e?document.documentElement.lang||navigator.language:e).toLowerCase().split("-")[0];return r==="en"||r==="pt"?r:"es"}function d(e,t){return At[q(e)][t]}var be=j`
17
+ :host {
18
+ color: var(--wodira-box-text, var(--wodira-color-text, #17132e));
19
+ display: block;
20
+ font-family: var(--wodira-box-font-family, var(--wodira-font-family, inherit));
21
+ font-size: var(--wodira-font-size, 1rem);
22
+ line-height: 1.5;
23
+ min-width: 0;
24
+ overflow-wrap: anywhere;
25
+ container-type: inline-size;
26
+ }
27
+ *,
28
+ *::before,
29
+ *::after {
30
+ box-sizing: border-box;
31
+ }
32
+ button,
33
+ input {
34
+ font: inherit;
35
+ }
36
+ [part~='shell'] {
37
+ background: var(--wodira-box-surface, var(--wodira-color-surface, #fff));
38
+ border: 1px solid var(--wodira-box-border, var(--wodira-color-border, #dcd9e3));
39
+ border-radius: var(--wodira-box-radius, var(--wodira-radius, 1rem));
40
+ box-shadow: var(--wodira-box-shadow, var(--wodira-shadow, 0 4px 18px rgb(23 19 46 / 0.04)));
41
+ overflow: hidden;
42
+ }
43
+ [part~='composite'] {
44
+ display: grid;
45
+ gap: var(--wodira-space, 0.75rem);
46
+ }
47
+ [part~='hero'] {
48
+ align-items: center;
49
+ background: linear-gradient(
50
+ 135deg,
51
+ var(
52
+ --wodira-box-primary,
53
+ var(--wodira-color-primary, var(--_wodira-box-brand-primary, #17132e))
54
+ ),
55
+ color-mix(
56
+ in srgb,
57
+ var(
58
+ --wodira-box-primary,
59
+ var(--wodira-color-primary, var(--_wodira-box-brand-primary, #17132e))
60
+ )
61
+ 76%,
62
+ #475467
63
+ )
64
+ );
65
+ color: var(--wodira-box-primary-contrast, var(--wodira-color-primary-contrast, #fff));
66
+ display: flex;
67
+ gap: 14px;
68
+ min-height: 86px;
69
+ overflow: hidden;
70
+ padding: 18px 20px;
71
+ position: relative;
72
+ }
73
+ [part~='hero'][data-cover] {
74
+ min-height: 132px;
75
+ }
76
+ [part~='hero']::after {
77
+ background: radial-gradient(
78
+ circle at 90% 15%,
79
+ color-mix(
80
+ in srgb,
81
+ var(
82
+ --wodira-box-accent,
83
+ var(--wodira-color-accent, var(--_wodira-box-brand-accent, #c40072))
84
+ )
85
+ 55%,
86
+ transparent
87
+ ),
88
+ transparent 45%
89
+ );
90
+ content: '';
91
+ inset: 0;
92
+ pointer-events: none;
93
+ position: absolute;
94
+ }
95
+ [part~='cover'] {
96
+ height: 100%;
97
+ inset: 0;
98
+ object-fit: cover;
99
+ opacity: 0.38;
100
+ position: absolute;
101
+ width: 100%;
102
+ }
103
+ [part~='logo'] {
104
+ background: var(--wodira-box-surface, var(--wodira-color-surface, #fff));
105
+ border-radius: var(--wodira-radius-sm, 0.625rem);
106
+ height: 54px;
107
+ object-fit: contain;
108
+ padding: 6px;
109
+ width: 54px;
110
+ z-index: 1;
111
+ }
112
+ [part~='brand'] {
113
+ min-width: 0;
114
+ z-index: 1;
115
+ }
116
+ [part~='brand-name'] {
117
+ font-size: 0.8rem;
118
+ font-weight: 750;
119
+ letter-spacing: 0.08em;
120
+ margin: 0 0 4px;
121
+ opacity: 0.78;
122
+ text-transform: uppercase;
123
+ }
124
+ [part~='title'] {
125
+ font-size: clamp(1.25rem, 5cqi, 1.8rem);
126
+ font-weight: 850;
127
+ letter-spacing: -0.035em;
128
+ margin: 0;
129
+ }
130
+ [part~='body'] {
131
+ padding: clamp(16px, 4cqi, 24px);
132
+ }
133
+ [part~='toolbar'] {
134
+ align-items: center;
135
+ display: flex;
136
+ gap: 8px;
137
+ justify-content: space-between;
138
+ margin-bottom: 16px;
139
+ }
140
+ [part~='nav-button'],
141
+ [part~='button'] {
142
+ align-items: center;
143
+ border: 0;
144
+ border-radius: var(--wodira-radius-sm, 0.625rem);
145
+ cursor: pointer;
146
+ display: inline-flex;
147
+ font-weight: 760;
148
+ justify-content: center;
149
+ min-height: var(--wodira-control-height, 2.75rem);
150
+ padding: 10px 14px;
151
+ }
152
+ [part~='nav-button'] {
153
+ background: var(--wodira-box-subtle, var(--wodira-color-muted, #f6f5f8));
154
+ color: var(--wodira-box-text, var(--wodira-color-text, #17132e));
155
+ }
156
+ [part~='button'] {
157
+ background: var(
158
+ --wodira-box-primary,
159
+ var(--wodira-color-primary, var(--_wodira-box-brand-primary, #17132e))
160
+ );
161
+ color: var(--wodira-box-primary-contrast, var(--wodira-color-primary-contrast, #fff));
162
+ width: 100%;
163
+ }
164
+ [part~='button']:hover {
165
+ transform: translateY(-1px);
166
+ }
167
+ button:focus-visible,
168
+ input:focus-visible {
169
+ outline: 3px solid
170
+ color-mix(
171
+ in srgb,
172
+ var(
173
+ --wodira-box-accent,
174
+ var(--wodira-color-accent, var(--_wodira-box-brand-accent, #c40072))
175
+ )
176
+ 60%,
177
+ transparent
178
+ );
179
+ outline-offset: 2px;
180
+ }
181
+ button:disabled {
182
+ cursor: not-allowed;
183
+ opacity: 0.5;
184
+ }
185
+ [part~='grid'] {
186
+ display: grid;
187
+ gap: var(--wodira-space, 0.75rem);
188
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--wodira-grid-min, 15rem)), 1fr));
189
+ }
190
+ [part~='card'] {
191
+ background: var(--wodira-box-subtle, var(--wodira-color-muted, #f6f5f8));
192
+ border: 1px solid transparent;
193
+ border-radius: var(--wodira-box-radius, var(--wodira-radius, 1rem));
194
+ display: grid;
195
+ gap: var(--wodira-space, 0.75rem);
196
+ padding: var(--wodira-card-padding, 1rem);
197
+ }
198
+ [part~='card']:hover {
199
+ border-color: color-mix(
200
+ in srgb,
201
+ var(--wodira-box-accent, var(--wodira-color-accent, var(--_wodira-box-brand-accent, #c40072)))
202
+ 50%,
203
+ var(--wodira-box-border, var(--wodira-color-border, #dcd9e3))
204
+ );
205
+ }
206
+ [part~='card-heading'] {
207
+ align-items: start;
208
+ display: flex;
209
+ gap: var(--wodira-space, 0.75rem);
210
+ justify-content: space-between;
211
+ }
212
+ [part~='card-title'] {
213
+ font-size: 1rem;
214
+ font-weight: 820;
215
+ margin: 0;
216
+ }
217
+ [part~='meta'] {
218
+ color: var(--wodira-box-muted, var(--wodira-color-text-muted, #625e70));
219
+ display: flex;
220
+ flex-wrap: wrap;
221
+ font-size: 0.86rem;
222
+ gap: 5px 12px;
223
+ }
224
+ [part~='badge'] {
225
+ background: #e7f8ee;
226
+ border-radius: 999px;
227
+ color: #067647;
228
+ font-size: 0.72rem;
229
+ font-weight: 800;
230
+ padding: 5px 8px;
231
+ white-space: nowrap;
232
+ }
233
+ [part~='badge'][data-status='LAST_SPOTS'] {
234
+ background: #fff3d6;
235
+ color: #b54708;
236
+ }
237
+ [part~='badge'][data-status='WAITLIST'],
238
+ [part~='badge'][data-status='FULL'] {
239
+ background: #fee4e2;
240
+ color: #b42318;
241
+ }
242
+ [part~='price'] {
243
+ font-size: 1.45rem;
244
+ font-weight: 860;
245
+ letter-spacing: -0.04em;
246
+ }
247
+ [part~='features'] {
248
+ color: var(--wodira-box-muted, var(--wodira-color-text-muted, #625e70));
249
+ display: grid;
250
+ font-size: 0.9rem;
251
+ gap: 6px;
252
+ margin: 0;
253
+ padding-left: 18px;
254
+ }
255
+ [part~='field'] {
256
+ display: grid;
257
+ gap: 6px;
258
+ }
259
+ [part~='input'] {
260
+ background: var(--wodira-box-surface, var(--wodira-color-surface, #fff));
261
+ border: 1px solid var(--wodira-box-border, var(--wodira-color-border, #dcd9e3));
262
+ border-radius: var(--wodira-radius-sm, 0.625rem);
263
+ color: var(--wodira-box-text, var(--wodira-color-text, #17132e));
264
+ min-height: var(--wodira-control-height, 2.75rem);
265
+ padding: 10px 12px;
266
+ width: 100%;
267
+ }
268
+ [part~='choice'] {
269
+ align-items: start;
270
+ border: 1px solid var(--wodira-box-border, var(--wodira-color-border, #dcd9e3));
271
+ border-radius: var(--wodira-radius-sm, 0.625rem);
272
+ cursor: pointer;
273
+ display: flex;
274
+ gap: 10px;
275
+ padding: 12px;
276
+ }
277
+ [part~='legal'] {
278
+ color: var(--wodira-box-muted, var(--wodira-color-text-muted, #625e70));
279
+ font-size: 0.78rem;
280
+ line-height: 1.5;
281
+ }
282
+ [part~='legal'] a {
283
+ color: inherit;
284
+ }
285
+ [part~='state'] {
286
+ color: var(--wodira-box-muted, var(--wodira-color-text-muted, #625e70));
287
+ padding: 34px 12px;
288
+ text-align: center;
289
+ }
290
+ [part~='error'] {
291
+ color: var(--wodira-color-danger, #b42318);
292
+ }
293
+ [part~='success'] {
294
+ background: var(--wodira-box-subtle, var(--wodira-color-muted, #f6f5f8));
295
+ color: var(--wodira-color-success, #16703c);
296
+ font-weight: 700;
297
+ padding: 14px 18px;
298
+ text-align: center;
299
+ }
300
+ [part~='footer'] {
301
+ color: var(--wodira-box-muted, var(--wodira-color-text-muted, #625e70));
302
+ font-size: 0.72rem;
303
+ padding: 13px 18px;
304
+ text-align: center;
305
+ }
306
+ [part~='tabs'] {
307
+ background: var(--wodira-box-surface, var(--wodira-color-surface, #fff));
308
+ border: 1px solid var(--wodira-box-border, var(--wodira-color-border, #dcd9e3));
309
+ border-radius: calc(var(--wodira-box-radius, var(--wodira-radius, 1rem)) - 4px);
310
+ box-shadow: 0 10px 30px rgb(16 24 40 / 0.08);
311
+ display: flex;
312
+ gap: 6px;
313
+ overflow-x: auto;
314
+ padding: 10px;
315
+ }
316
+ [part~='tab'] {
317
+ background: transparent;
318
+ color: var(--wodira-box-muted, var(--wodira-color-text-muted, #625e70));
319
+ white-space: nowrap;
320
+ }
321
+ [part~='tab'][aria-selected='true'] {
322
+ background: var(
323
+ --wodira-box-primary,
324
+ var(--wodira-color-primary, var(--_wodira-box-brand-primary, #17132e))
325
+ );
326
+ color: var(--wodira-box-primary-contrast, var(--wodira-color-primary-contrast, #fff));
327
+ }
328
+ @container (max-width: 520px) {
329
+ [part~='hero'] {
330
+ padding: var(--wodira-card-padding, 1rem);
331
+ }
332
+ [part~='body'] {
333
+ padding: 14px;
334
+ }
335
+ [part~='toolbar'] {
336
+ align-items: stretch;
337
+ flex-direction: column;
338
+ }
339
+ [part~='toolbar'] button {
340
+ width: 100%;
341
+ }
342
+ [part~='grid'] {
343
+ grid-template-columns: 1fr;
344
+ }
345
+ }
346
+ @media (prefers-reduced-motion: no-preference) {
347
+ [part~='button'],
348
+ [part~='card'] {
349
+ transition:
350
+ border-color 0.18s ease,
351
+ transform 0.18s ease;
352
+ }
353
+ }
354
+ `;var ye=j`
355
+ :host {
356
+ min-width: 0;
357
+ color-scheme: var(--wodira-color-scheme, light);
358
+ }
359
+ input[type='checkbox'],
360
+ input[type='radio'] {
361
+ accent-color: var(--wodira-color-accent, #c40072);
362
+ }
363
+ :host,
364
+ button,
365
+ input,
366
+ select,
367
+ textarea {
368
+ font-variant-numeric: tabular-nums;
369
+ }
370
+ button,
371
+ input,
372
+ select,
373
+ textarea,
374
+ a {
375
+ -webkit-tap-highlight-color: transparent;
376
+ }
377
+ input,
378
+ select,
379
+ textarea {
380
+ min-width: 0;
381
+ font-size: max(1rem, 1em);
382
+ }
383
+ button {
384
+ transition:
385
+ background-color 160ms ease,
386
+ transform 160ms ease;
387
+ }
388
+ button:active:not(:disabled) {
389
+ transform: translateY(1px);
390
+ }
391
+ :is(button, input, select, textarea, a, summary):focus-visible {
392
+ outline: 3px solid var(--wodira-color-accent, #c40072);
393
+ outline-offset: 3px;
394
+ }
395
+ [part~='title'] {
396
+ letter-spacing: -0.025em;
397
+ text-wrap: balance;
398
+ }
399
+ [part~='meta'],
400
+ [part~='hint'] {
401
+ margin-block: 0.25rem;
402
+ line-height: 1.5;
403
+ }
404
+ [part~='checkout-flow'] {
405
+ width: 100%;
406
+ max-width: var(--wodira-content-width, 76rem);
407
+ margin-inline: auto;
408
+ }
409
+ [part~='event-list'],
410
+ [part~='pricing-cards'] {
411
+ display: grid;
412
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--wodira-grid-min, 16rem)), 1fr));
413
+ align-items: stretch;
414
+ }
415
+ [part~='event-card'],
416
+ [part~='pricing-card'] {
417
+ height: 100%;
418
+ }
419
+ [part~='pricing-card'] > [part~='stack'],
420
+ [part~='event-card'] > [part~='stack'] {
421
+ display: flex;
422
+ flex-direction: column;
423
+ flex: 1;
424
+ }
425
+ [part~='event-card'] {
426
+ display: flex;
427
+ flex-direction: column;
428
+ }
429
+ [part~='pricing-card'] [part~='button'],
430
+ [part~='event-card'] [part~='button']:last-child {
431
+ margin-top: auto;
432
+ }
433
+ [part~='pricing-card'][part~='selected'] {
434
+ border-color: var(--wodira-color-accent, #c40072);
435
+ box-shadow: inset 0 0 0 1px var(--wodira-color-accent, #c40072);
436
+ }
437
+ [part~='registration-form'] {
438
+ padding: 0;
439
+ border: 0;
440
+ box-shadow: none;
441
+ background: transparent;
442
+ }
443
+ [part~='registration-layout'] {
444
+ display: grid;
445
+ gap: calc(var(--wodira-space, 1rem) * 1.5);
446
+ }
447
+ [part~='registration-fields'] {
448
+ min-width: 0;
449
+ background: var(--wodira-color-surface, #fff);
450
+ border: 1px solid var(--wodira-color-border, #dcd9e3);
451
+ border-radius: var(--wodira-radius, 1rem);
452
+ padding: var(--wodira-card-padding, clamp(1rem, 3cqi, 1.75rem));
453
+ }
454
+ [part~='registration-fields'] [part~='card'] {
455
+ box-shadow: none;
456
+ }
457
+ [part~='checkout-sidebar'] {
458
+ display: grid;
459
+ align-content: start;
460
+ gap: var(--wodira-space, 1rem);
461
+ min-width: 0;
462
+ }
463
+ [part~='summary'] {
464
+ display: grid;
465
+ gap: 0.8rem;
466
+ }
467
+ [part~='summary-row'] {
468
+ align-items: baseline;
469
+ }
470
+ [part~='summary-row'] strong {
471
+ flex-shrink: 0;
472
+ }
473
+ [part~='summary-total'] {
474
+ border-top: 1px solid var(--wodira-color-border, #dcd9e3);
475
+ padding-top: 1rem;
476
+ font-size: 1.2em;
477
+ }
478
+ [part~='submit'] {
479
+ width: 100%;
480
+ }
481
+ [part~='progress'] {
482
+ display: flex;
483
+ flex-wrap: wrap;
484
+ gap: 0.75rem 1.5rem;
485
+ list-style: none;
486
+ padding: 0.25rem 0;
487
+ margin: 0;
488
+ color: var(--wodira-color-text-muted, #625e70);
489
+ }
490
+ [part~='progress-step'] {
491
+ display: flex;
492
+ align-items: center;
493
+ gap: 0.5rem;
494
+ font-size: 0.875rem;
495
+ }
496
+ [part~='progress-step'][aria-current='step'] {
497
+ color: var(--wodira-color-text, #17132e);
498
+ font-weight: 700;
499
+ }
500
+ [part~='step-number'] {
501
+ display: grid;
502
+ place-items: center;
503
+ inline-size: 1.75rem;
504
+ block-size: 1.75rem;
505
+ border: 1px solid var(--wodira-color-border, #dcd9e3);
506
+ border-radius: 50%;
507
+ background: var(--wodira-color-surface, #fff);
508
+ }
509
+ [aria-current='step'] [part~='step-number'] {
510
+ border-color: currentColor;
511
+ }
512
+ [part~='error'],
513
+ [part~='empty'],
514
+ [part~='loader'] {
515
+ line-height: 1.5;
516
+ overflow-wrap: anywhere;
517
+ }
518
+ [part~='loader']::before {
519
+ content: '';
520
+ display: block;
521
+ height: 0.5rem;
522
+ max-width: 16rem;
523
+ margin: 0 auto 0.75rem;
524
+ border-radius: var(--wodira-radius-sm, 0.625rem);
525
+ background: var(--wodira-color-border, #dcd9e3);
526
+ }
527
+ ::slotted(*) {
528
+ max-width: 100%;
529
+ }
530
+ @container (min-width: 56rem) {
531
+ [part~='registration-layout'] {
532
+ grid-template-columns: minmax(0, 1fr) minmax(16rem, var(--wodira-summary-width, 21rem));
533
+ }
534
+ [part~='checkout-sidebar'] {
535
+ position: sticky;
536
+ top: var(--wodira-sticky-offset, 1rem);
537
+ align-self: start;
538
+ }
539
+ }
540
+ @media (prefers-reduced-motion: reduce) {
541
+ *,
542
+ *::before,
543
+ *::after {
544
+ transition: none !important;
545
+ animation: none !important;
546
+ scroll-behavior: auto !important;
547
+ }
548
+ button:hover,
549
+ button:active {
550
+ transform: none !important;
551
+ }
552
+ }
553
+ @media (forced-colors: active) {
554
+ button,
555
+ [part~='card'],
556
+ input,
557
+ select,
558
+ textarea {
559
+ border: 1px solid ButtonText;
560
+ }
561
+ [aria-pressed='true'],
562
+ [aria-selected='true'] {
563
+ outline: 2px solid Highlight;
564
+ }
565
+ }
566
+ `;var sr=["stack","grid","card","event-card","event-list","pricing-cards","pricing-card","registration-form","registration-layout","registration-fields","registration-title","availability","legal-signature","checkout-sidebar","summary","summary-row","summary-total","button","submit","secondary","text-button","input","select","textarea","checkbox","label","title","price","meta","hint","description","description-heading","description-list","image","error","field-error","loader","empty","success","waiver","supplement","eligibility-summary","participant-mode","participant-mode-button","deferred-participant-hint","gender-composition","composition-options","composition-option","tier-list","tier-row","tier-heading","tier-name","tier-price","badge","current-tier","read-more","event-card-description","event-card-description-full","purchaser-grid","participant","guest-registration","terms","selected","active","current","retry","inline-code","tier-meta","field","athlete","deferred","athlete-grid","custom-fields","custom-fields-grid","custom-field","supplements","guest-registrations","add-guest","guest-grid","remove-guest","guest-athlete","guest-supplements","waivers","guest-summary-row"].join(","),Z=["shell","widget-shell","hero","widget-hero","cover","box-cover","logo","box-logo","brand","brand-name","title","body","widget-body","toolbar","nav-button","button","grid","card","card-heading","card-title","meta","badge","price","features","field","input","choice","legal","state","loader","error","success","footer","retry","class-cta","trial-cta","plan-cta","class-card","class-meta","availability","calendar-toolbar","previous","next","empty","class-grid","plans-grid","plan-card","trial-form","choices","trial-class-grid","trial-choice","email","legal-choice"].join(",");var Rt={AVAILABLE:"available",LAST_SPOTS:"last",WAITLIST:"waitlist",FULL:"full"};class D extends T{static properties={publishableKey:{type:String,attribute:"publishable-key"},installationId:{type:String,attribute:"installation-id"},baseUrl:{type:String,attribute:"base-url"},locale:{type:String},context:{state:!0},loading:{state:!0},error:{state:!0},resultMessage:{state:!0}};static styles=[be,ye];client=null;abortController=null;didInitialLoad=!1;pendingResultToken="";constructor(){super();this.publishableKey="",this.installationId="",this.baseUrl="",this.locale="auto",this.context=null,this.loading=!0,this.error="",this.resultMessage=""}firstUpdated(){this.pendingResultToken=this.consumeResult(),this.refresh()}disconnectedCallback(){this.abortController?.abort(),super.disconnectedCallback()}updated(e){if(!this.didInitialLoad){this.didInitialLoad=!0;return}if((e.has("publishableKey")||e.has("installationId")||e.has("baseUrl"))&&this.didInitialLoad)this.refresh();if(this.context)this.style.setProperty("--_wodira-box-brand-primary",this.context.box.theme.primary),this.style.setProperty("--_wodira-box-brand-accent",this.context.box.theme.secondary)}async refresh(){if(!this.publishableKey||!this.installationId){this.loading=!1,this.error="publishable-key and installation-id are required.";return}this.abortController?.abort(),this.abortController=new AbortController,this.loading=!0,this.error="";try{if(this.client=Ge({publishableKey:this.publishableKey,installationId:this.installationId,...this.baseUrl?{baseUrl:this.baseUrl}:{}}),this.context=await this.client.getContext(this.abortController.signal),this.pendingResultToken)await this.verifyResultWithRetry(this.pendingResultToken,this.abortController.signal),this.pendingResultToken="",this.resultMessage=d(this.locale,"result");if(this.locale==="auto")this.locale=this.context.locale;await this.loadData(this.abortController.signal),this.telemetry("IMPRESSION")}catch(e){if(e instanceof Error&&e.name==="AbortError")return;this.error=e instanceof Error?e.message:d(this.locale,"error")}finally{this.loading=!1}}frame(e,t){let r=this.context;return c`
567
+ <section part="shell widget-shell" aria-busy=${this.loading?"true":"false"}>
568
+ <slot name="header"></slot>
569
+ ${r?c`<header part="hero widget-hero" ?data-cover=${Boolean(r.box.coverUrl)}>
570
+ ${r.box.coverUrl?c`<img part="cover box-cover" src=${r.box.coverUrl} alt="" />`:l}
571
+ ${r.box.logoUrl?c`<img part="logo box-logo" src=${r.box.logoUrl} alt="" />`:l}
572
+ <div part="brand">
573
+ <p part="brand-name">${r.box.name}</p>
574
+ <h2 part="title">${e}</h2>
575
+ </div>
576
+ </header>`:l}
577
+ ${this.resultMessage?c`<div part="success" role="status">${this.resultMessage}</div>`:l}
578
+ <div part="body widget-body">
579
+ <slot name="intro"></slot>
580
+ ${this.loading?c`<div part="state loader" role="status">
581
+ ${d(this.locale,"loading")}
582
+ </div>`:this.error?c`<div part="state error" role="alert">
583
+ <p>${d(this.locale,"error")}</p>
584
+ <button part="nav-button retry" type="button" @click=${()=>this.refresh()}>
585
+ ${d(this.locale,"retry")}
586
+ </button>
587
+ </div>`:t}
588
+ </div>
589
+ <slot name="footer"></slot>
590
+ <footer part="footer"><span>${d(this.locale,"powered")}</span></footer>
591
+ </section>
592
+ `}classCard(e,t){let r=q(this.locale),i=new Intl.DateTimeFormat(r,{weekday:"short",day:"numeric",month:"short",hour:"2-digit",minute:"2-digit",timeZone:e.timezone||this.context?.box.timezone}).format(new Date(e.startsAt)),a=e.availability==="FULL";return c`<article part="card class-card">
593
+ <div part="card-heading">
594
+ <div>
595
+ <h3 part="card-title">${e.name}</h3>
596
+ <div part="meta class-meta"><time datetime=${e.startsAt}>${i}</time></div>
597
+ </div>
598
+ <span part="badge availability" data-status=${e.availability}>
599
+ ${d(this.locale,Rt[e.availability])}
600
+ </span>
601
+ </div>
602
+ <div part="meta">
603
+ ${e.coachName?c`<span>${d(this.locale,"coach")}: ${e.coachName}</span>`:l}
604
+ ${e.location?c`<span>${e.location}</span>`:l}
605
+ ${e.durationMinutes?c`<span>${e.durationMinutes} ${d(this.locale,"duration")}</span>`:l}
606
+ ${e.directPurchase?c`<span
607
+ >${Qe(e.directPurchase.amount,e.directPurchase.currency,r)}</span
608
+ >`:l}
609
+ </div>
610
+ <button part="button class-cta" type="button" ?disabled=${a} @click=${t}>
611
+ ${d(this.locale,"reserve")}
612
+ </button>
613
+ </article>`}emit(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}async startFlow(e,t,r={}){if(!this.client)return;let i=await this.client.createFlow({intent:e,targetId:t,idempotencyKey:[this.installationId,e,t,r.privacyVersion??"none",Je()].join(":"),...r,...Xe()});if(i.continuationUrl)globalThis.location.assign(i.continuationUrl)}telemetry(e,t){if(!this.client)return Promise.resolve();return this.client.recordTelemetry([{id:ee(),kind:e,widgetKind:this.widgetKind(),...t?{entityId:t}:{},sessionId:Je(),occurredAt:new Date().toISOString(),...Xe()}]).then(()=>{return}).catch(()=>{return})}syncStructuredData(e){let t=this.querySelector("script[data-wodira-widget-jsonld]");if(!t)t=document.createElement("script"),t.type="application/ld+json",t.dataset.wodiraWidgetJsonld="",this.append(t);t.textContent=JSON.stringify(e).replaceAll("<","\\u003c")}consumeResult(){try{let e=new URL(globalThis.location.href),t=e.searchParams.get("wodira_widget_result")??"";if(!t)return"";return e.searchParams.delete("wodira_widget_result"),globalThis.history?.replaceState({},"",e),t}catch{return""}}async verifyResultWithRetry(e,t){if(!this.client)return;let r;for(let i=0;i<10;i+=1)try{await this.client.verifyResult(e,t);return}catch(a){if(r=a,t.aborted||i===9)break;await new Promise((o,s)=>{let n=globalThis.setTimeout(o,1000);t.addEventListener("abort",()=>{globalThis.clearTimeout(n),s(new DOMException("Aborted","AbortError"))},{once:!0})})}throw r}}class we extends D{static properties={...D.properties,calendar:{state:!0},week:{state:!0}};constructor(){super();this.calendar=null,this.week=0}widgetKind(){return"CALENDAR"}async loadData(e){let t=new Date;t.setDate(t.getDate()+this.week*7),this.calendar=await this.client?.getCalendar(t,1,e)??null,this.syncStructuredData({"@context":"https://schema.org","@type":"SportsActivityLocation",name:this.context?.box.name,event:this.calendar?.classes.map((r)=>({"@type":"SportsEvent",name:r.name,startDate:r.startsAt,location:r.location?{"@type":"Place",name:r.location}:void 0}))})}changeWeek(e){this.week=Math.min(3,Math.max(0,this.week+e)),this.refresh()}choose(e){this.emit("wodira:box-class-selected",{installationId:this.installationId,classId:e.id}),this.telemetry("CLASS_SELECTED",e.id),this.startFlow("RESERVE_CLASS",e.id)}render(){return this.frame(d(this.locale,"calendar"),c`
614
+ <div part="toolbar calendar-toolbar">
615
+ <button
616
+ part="nav-button previous"
617
+ type="button"
618
+ ?disabled=${this.week===0}
619
+ @click=${()=>this.changeWeek(-1)}
620
+ >
621
+ ← ${d(this.locale,"previous")}
622
+ </button>
623
+ <button
624
+ part="nav-button next"
625
+ type="button"
626
+ ?disabled=${this.week===3}
627
+ @click=${()=>this.changeWeek(1)}
628
+ >
629
+ ${d(this.locale,"next")} →
630
+ </button>
631
+ </div>
632
+ ${this.calendar?.classes.length?c`<div part="grid class-grid">
633
+ ${this.calendar.classes.map((e)=>this.classCard(e,()=>this.choose(e)))}
634
+ </div>`:c`<div part="state empty">${d(this.locale,"empty")}</div>`}
635
+ `)}}class xe extends D{static properties={...D.properties,plans:{state:!0}};constructor(){super();this.plans=null}widgetKind(){return"PLANS"}async loadData(e){this.plans=await this.client?.getPlans(e)??null,this.syncStructuredData({"@context":"https://schema.org","@type":"ItemList",itemListElement:this.plans?.plans.map((t,r)=>({"@type":"Offer",position:r+1,name:t.name,price:t.price,priceCurrency:t.currency}))})}choose(e){this.emit("wodira:box-plan-selected",{installationId:this.installationId,planId:e.id}),this.telemetry("PLAN_SELECTED",e.id),this.startFlow("BUY_PLAN",e.id)}render(){let e=q(this.locale);return this.frame(d(this.locale,"plans"),c`
636
+ ${this.plans?.plans.length?c`<div part="grid plans-grid">
637
+ ${this.plans.plans.map((t)=>c` <article part="card plan-card">
638
+ <div>
639
+ <h3 part="card-title">${t.name}</h3>
640
+ ${t.description?c`<p part="meta">${t.description}</p>`:l}
641
+ </div>
642
+ <div part="price">${Qe(t.price,t.currency,e)}</div>
643
+ <div part="meta">
644
+ ${t.credits===null?d(this.locale,"unlimited"):`${t.credits} ${d(this.locale,"credits")}`}
645
+ · ${kt(t.interval,this.locale)}
646
+ </div>
647
+ ${t.features.length?c`<ul part="features">
648
+ ${t.features.map((r)=>c`<li>${r}</li>`)}
649
+ </ul>`:l}
650
+ <button
651
+ part="button plan-cta"
652
+ data-plan-id=${t.id}
653
+ type="button"
654
+ @click=${()=>this.choose(t)}
655
+ >
656
+ ${d(this.locale,"reserve")}
657
+ </button>
658
+ </article>`)}
659
+ </div>`:c`<div part="state empty">${d(this.locale,"empty")}</div>`}
660
+ `)}}class _e extends D{static properties={...D.properties,trials:{state:!0},selectedClassId:{state:!0},email:{state:!0},privacyAccepted:{state:!0},submitting:{state:!0},formError:{state:!0}};constructor(){super();this.trials=null,this.selectedClassId="",this.email="",this.privacyAccepted=!1,this.submitting=!1,this.formError=""}widgetKind(){return"TRIAL"}async loadData(e){this.trials=await this.client?.getTrialClasses(e)??null,this.selectedClassId=this.trials?.classes[0]?.id??""}async submit(e){if(e.preventDefault(),!this.email.includes("@")||!this.selectedClassId||!this.privacyAccepted||!this.context){this.formError=d(this.locale,"error");return}this.submitting=!0,this.formError="",this.emit("wodira:box-trial-selected",{installationId:this.installationId,classId:this.selectedClassId}),this.telemetry("TRIAL_SELECTED",this.selectedClassId);try{let t=e.currentTarget,r=String(new FormData(t).get("website")??"");await this.startFlow("START_TRIAL",this.selectedClassId,{email:this.email,privacyAccepted:!0,privacyVersion:this.context.legal.acceptanceVersion,website:r})}catch(t){this.formError=t instanceof Error?t.message:d(this.locale,"error")}finally{this.submitting=!1}}render(){return this.frame(d(this.locale,"trial"),c`
661
+ ${this.trials?.enabled&&this.trials.classes.length?c`<form part="trial-form" @submit=${this.submit}>
662
+ <fieldset part="field choices">
663
+ <legend>${d(this.locale,"chooseClass")}</legend>
664
+ <div part="grid trial-class-grid">
665
+ ${this.trials.classes.map((e)=>c` <label part="choice trial-choice"
666
+ ><input
667
+ type="radio"
668
+ name="trialClass"
669
+ .value=${e.id}
670
+ .checked=${this.selectedClassId===e.id}
671
+ @change=${()=>{this.selectedClassId=e.id}}
672
+ />
673
+ <span
674
+ ><strong>${e.name}</strong><br /><small
675
+ >${new Intl.DateTimeFormat(q(this.locale),{dateStyle:"medium",timeStyle:"short",timeZone:e.timezone||this.context?.box.timezone}).format(new Date(e.startsAt))}</small
676
+ ></span
677
+ >
678
+ </label>`)}
679
+ </div>
680
+ </fieldset>
681
+ <label part="field"
682
+ ><span>${d(this.locale,"email")}</span
683
+ ><input
684
+ part="input email"
685
+ type="email"
686
+ autocomplete="email"
687
+ required
688
+ .value=${this.email}
689
+ @input=${(e)=>{this.email=e.currentTarget.value}}
690
+ /></label>
691
+ <input
692
+ name="website"
693
+ tabindex="-1"
694
+ autocomplete="off"
695
+ aria-hidden="true"
696
+ style="position:absolute;left:-10000px"
697
+ />
698
+ <label part="choice legal-choice"
699
+ ><input
700
+ type="checkbox"
701
+ required
702
+ .checked=${this.privacyAccepted}
703
+ @change=${(e)=>{this.privacyAccepted=e.currentTarget.checked}}
704
+ />
705
+ <span part="legal"
706
+ >${d(this.locale,"privacy")}
707
+ <a
708
+ href=${this.context?.legal.wodiraPrivacyUrl??"#"}
709
+ target="_blank"
710
+ rel="noopener noreferrer"
711
+ >WODira</a
712
+ >
713
+ ${this.context?.legal.boxPrivacyUrl?c` · <a href=${this.context.legal.boxPrivacyUrl} target="_blank" rel="noopener noreferrer">${this.context.box.name}</a>`:l}
714
+ </span>
715
+ </label>
716
+ ${this.formError?c`<p part="error" role="alert">${this.formError}</p>`:l}
717
+ <button part="button trial-cta" type="submit" ?disabled=${this.submitting}>
718
+ ${this.submitting?d(this.locale,"loading"):d(this.locale,"trialCta")}
719
+ </button>
720
+ </form>`:c`<div part="state empty">${d(this.locale,"empty")}</div>`}
721
+ `)}}class ve extends T{static properties={publishableKey:{type:String,attribute:"publishable-key"},installationId:{type:String,attribute:"installation-id"},baseUrl:{type:String,attribute:"base-url"},locale:{type:String},active:{state:!0}};static styles=[be,ye];panelId=`wodira-box-panel-${ee()}`;constructor(){super();this.publishableKey="",this.installationId="",this.baseUrl="",this.locale="auto",this.active="calendar"}render(){let e={publishableKey:this.publishableKey,installationId:this.installationId,baseUrl:this.baseUrl,locale:this.locale};return c`<section part="composite composite-shell">
722
+ <slot name="header"></slot>
723
+ <nav part="tabs" role="tablist" aria-label="Widgets">
724
+ ${["calendar","trial","plans"].map((t)=>c`<button
725
+ part="nav-button tab"
726
+ type="button"
727
+ role="tab"
728
+ aria-selected=${this.active===t?"true":"false"}
729
+ aria-controls=${this.panelId}
730
+ tabindex=${this.active===t?"0":"-1"}
731
+ @keydown=${(r)=>this.navigateTabs(r,t)}
732
+ @click=${()=>{this.active=t}}
733
+ >
734
+ ${d(this.locale,t)}
735
+ </button>`)}
736
+ </nav>
737
+ <div id=${this.panelId} part="composite-content" role="tabpanel" tabindex="0">
738
+ ${this.active==="calendar"?c`<wodira-box-calendar exportparts=${Z} .publishableKey=${e.publishableKey} .installationId=${e.installationId} .baseUrl=${e.baseUrl} .locale=${e.locale}><slot name="calendar-intro" slot="intro"></slot></wodira-box-calendar>`:l}
739
+ ${this.active==="trial"?c`<wodira-box-trial exportparts=${Z} .publishableKey=${e.publishableKey} .installationId=${e.installationId} .baseUrl=${e.baseUrl} .locale=${e.locale}><slot name="trial-intro" slot="intro"></slot></wodira-box-trial>`:l}
740
+ ${this.active==="plans"?c`<wodira-box-plans exportparts=${Z} .publishableKey=${e.publishableKey} .installationId=${e.installationId} .baseUrl=${e.baseUrl} .locale=${e.locale}><slot name="plans-intro" slot="intro"></slot></wodira-box-plans>`:l}
741
+ </div>
742
+ <slot name="footer"></slot>
743
+ </section>`}navigateTabs(e,t){let r=["calendar","trial","plans"],i=r.indexOf(t),a=e.key==="Home"?0:e.key==="End"?r.length-1:e.key==="ArrowRight"?(i+1)%r.length:e.key==="ArrowLeft"?(i-1+r.length)%r.length:-1;if(a<0)return;let o=r[a];if(!o)return;e.preventDefault(),this.active=o,this.updateComplete.then(()=>{this.renderRoot.querySelectorAll('[role="tab"]')[a]?.focus()})}}function kt(e,t){let r=e.trim().toLowerCase();if(r==="once"||r==="one_time")return d(t,"once");if(r==="daily"||r==="day")return d(t,"daily");if(r==="weekly"||r==="week")return d(t,"weekly");if(r==="monthly"||r==="month")return d(t,"monthly");if(r==="yearly"||r==="annual"||r==="year")return d(t,"yearly");return e}function Qe(e,t,r){return new Intl.NumberFormat(r,{style:"currency",currency:t,maximumFractionDigits:2}).format(e)}function ee(){return globalThis.crypto?.randomUUID?.()??`widget-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Je(){try{let t=globalThis.sessionStorage?.getItem("wodira:box-widget-session");if(t)return t;let r=ee();return globalThis.sessionStorage?.setItem("wodira:box-widget-session",r),r}catch{return ee()}}function Xe(){try{let e=new URL(globalThis.location.href).searchParams,t=e.get("utm_source")??void 0,r=e.get("utm_medium")??void 0,i=e.get("utm_campaign")??void 0;return{...t?{utmSource:t}:{},...r?{utmMedium:r}:{},...i?{utmCampaign:i}:{}}}catch{return{}}}var It=[["wodira-box-calendar",we],["wodira-box-trial",_e],["wodira-box-plans",xe],["wodira-box-widget",ve]];function Ze(){if(!globalThis.customElements)throw Error("@wodira/browser/ui/boxes requires a Custom Elements environment.");for(let[e,t]of It)if(!customElements.get(e))customElements.define(e,t)}Ze();