@londondynamics/pericles-webcomponent 2.1.1 → 2.1.3

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.
@@ -2,21 +2,21 @@
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const T=globalThis,q=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,J=Symbol(),F=new WeakMap;let it=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==J)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(q&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}};const pt=i=>new it(typeof i=="string"?i:i+"",void 0,J),ct=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,r,n)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[n+1],i[0]);return new it(e,i,J)},ut=(i,t)=>{if(q)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),r=T.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,i.appendChild(s)}},V=q?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return pt(e)})(i):i;/**
5
+ */const T=globalThis,J=T.ShadowRoot&&(T.ShadyCSS===void 0||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,q=Symbol(),F=new WeakMap;let it=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==q)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(J&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=F.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&F.set(e,t))}return t}toString(){return this.cssText}};const pt=i=>new it(typeof i=="string"?i:i+"",void 0,q),ct=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,r,n)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[n+1],i[0]);return new it(e,i,q)},ut=(i,t)=>{if(J)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),r=T.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,i.appendChild(s)}},V=J?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return pt(e)})(i):i;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:dt,defineProperty:gt,getOwnPropertyDescriptor:yt,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,m=globalThis,G=m.trustedTypes,$t=G?G.emptyScript:"",j=m.reactiveElementPolyfillSupport,E=(i,t)=>i,H={toAttribute(i,t){switch(t){case Boolean:i=i?$t: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}},W=(i,t)=>!dt(i,t),K={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:W};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);class S extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=K){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&gt(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:n}=yt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const p=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??K}static _$Ei(){if(this.hasOwnProperty(E("elementProperties")))return;const t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(E("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(E("properties"))){const e=this.properties,s=[...ft(e),..._t(e)];for(const r of s)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const r of s)e.unshift(V(r))}else t!==void 0&&e.push(V(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s: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(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ut(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var n;const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){const o=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:H).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n;const s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=s.getPropertyOptions(r),p=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:H;this._$Em=r,this[r]=p.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??W)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(e)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var r;return(r=s.hostUpdated)==null?void 0:r.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[E("elementProperties")]=new Map,S[E("finalized")]=new Map,j==null||j({ReactiveElement:S}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:dt,defineProperty:gt,getOwnPropertyDescriptor:yt,getOwnPropertyNames:ft,getOwnPropertySymbols:_t,getPrototypeOf:mt}=Object,m=globalThis,G=m.trustedTypes,$t=G?G.emptyScript:"",j=m.reactiveElementPolyfillSupport,P=(i,t)=>i,H={toAttribute(i,t){switch(t){case Boolean:i=i?$t: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}},W=(i,t)=>!dt(i,t),K={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:W};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);class S extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=K){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&gt(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:n}=yt(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return r==null?void 0:r.call(this)},set(o){const p=r==null?void 0:r.call(this);n.call(this,o),this.requestUpdate(t,p,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??K}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;const t=mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){const e=this.properties,s=[...ft(e),..._t(e)];for(const r of s)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const r of s)e.unshift(V(r))}else t!==void 0&&e.push(V(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s: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(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ut(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var n;const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){const o=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:H).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var n;const s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=s.getPropertyOptions(r),p=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)==null?void 0:n.fromAttribute)!==void 0?o.converter:H;this._$Em=r,this[r]=p.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??W)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[n,o]of r)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(r=>{var n;return(n=r.hostUpdate)==null?void 0:n.call(r)}),this.update(e)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var r;return(r=s.hostUpdated)==null?void 0:r.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[P("elementProperties")]=new Map,S[P("finalized")]=new Map,j==null||j({ReactiveElement:S}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const P=globalThis,I=P.trustedTypes,Q=I?I.createPolicy("lit-html",{createHTML:i=>i}):void 0,ot="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,nt="?"+_,wt=`<${nt}>`,b=document,U=()=>b.createComment(""),x=i=>i===null||typeof i!="object"&&typeof i!="function",at=Array.isArray,bt=i=>at(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",D=`[
13
+ */const M=globalThis,I=M.trustedTypes,Q=I?I.createPolicy("lit-html",{createHTML:i=>i}):void 0,ot="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,nt="?"+_,wt=`<${nt}>`,b=document,x=()=>b.createComment(""),O=i=>i===null||typeof i!="object"&&typeof i!="function",at=Array.isArray,bt=i=>at(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",D=`[
14
14
  \f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Z=/-->/g,X=/>/g,$=RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Y=/'/g,tt=/"/g,ht=/^(?:script|style|textarea|title)$/i,St=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),et=St(1),A=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),st=new WeakMap,w=b.createTreeWalker(b,129);function lt(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Q!==void 0?Q.createHTML(t):t}const At=(i,t)=>{const e=i.length-1,s=[];let r,n=t===2?"<svg>":"",o=C;for(let p=0;p<e;p++){const a=i[p];let d,u,c=-1,y=0;for(;y<a.length&&(o.lastIndex=y,u=o.exec(a),u!==null);)y=o.lastIndex,o===C?u[1]==="!--"?o=Z:u[1]!==void 0?o=X:u[2]!==void 0?(ht.test(u[2])&&(r=RegExp("</"+u[2],"g")),o=$):u[3]!==void 0&&(o=$):o===$?u[0]===">"?(o=r??C,c=-1):u[1]===void 0?c=-2:(c=o.lastIndex-u[2].length,d=u[1],o=u[3]===void 0?$:u[3]==='"'?tt:Y):o===tt||o===Y?o=$:o===Z||o===X?o=C:(o=$,r=void 0);const f=o===$&&i[p+1].startsWith("/>")?" ":"";n+=o===C?a+wt:c>=0?(s.push(d),a.slice(0,c)+ot+a.slice(c)+_+f):a+_+(c===-2?p:f)}return[lt(i,n+(i[e]||"<?>")+(t===2?"</svg>":"")),s]};class O{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let n=0,o=0;const p=t.length-1,a=this.parts,[d,u]=At(t,e);if(this.el=O.createElement(d,s),w.currentNode=this.el.content,e===2){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(r=w.nextNode())!==null&&a.length<p;){if(r.nodeType===1){if(r.hasAttributes())for(const c of r.getAttributeNames())if(c.endsWith(ot)){const y=u[o++],f=r.getAttribute(c).split(_),N=/([.?@])?(.*)/.exec(y);a.push({type:1,index:n,name:N[2],strings:f,ctor:N[1]==="."?Ct:N[1]==="?"?Et:N[1]==="@"?Pt:L}),r.removeAttribute(c)}else c.startsWith(_)&&(a.push({type:6,index:n}),r.removeAttribute(c));if(ht.test(r.tagName)){const c=r.textContent.split(_),y=c.length-1;if(y>0){r.textContent=I?I.emptyScript:"";for(let f=0;f<y;f++)r.append(c[f],U()),w.nextNode(),a.push({type:2,index:++n});r.append(c[y],U())}}}else if(r.nodeType===8)if(r.data===nt)a.push({type:2,index:n});else{let c=-1;for(;(c=r.data.indexOf(_,c+1))!==-1;)a.push({type:7,index:n}),c+=_.length-1}n++}}static createElement(t,e){const s=b.createElement("template");return s.innerHTML=t,s}}function v(i,t,e=i,s){var o,p;if(t===A)return t;let r=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const n=x(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((p=r==null?void 0:r._$AO)==null||p.call(r,!1),n===void 0?r=void 0:(r=new n(i),r._$AT(i,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=r:e._$Cl=r),r!==void 0&&(t=v(i,r._$AS(i,t.values),r,s)),t}class vt{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){const{el:{content:e},parts:s}=this._$AD,r=((t==null?void 0:t.creationScope)??b).importNode(e,!0);w.currentNode=r;let n=w.nextNode(),o=0,p=0,a=s[0];for(;a!==void 0;){if(o===a.index){let d;a.type===2?d=new R(n,n.nextSibling,this,t):a.type===1?d=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(d=new Mt(n,this,t)),this._$AV.push(d),a=s[++p]}o!==(a==null?void 0:a.index)&&(n=w.nextNode(),o++)}return w.currentNode=b,r}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class R{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=v(this,t,e),x(t)?t===g||t==null||t===""?(this._$AH!==g&&this._$AR(),this._$AH=g):t!==this._$AH&&t!==A&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):bt(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==g&&x(this._$AH)?this._$AA.nextSibling.data=t:this.T(b.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=O.createElement(lt(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new vt(r,this),p=o.u(this.options);o.p(e),this.T(p),this._$AH=o}}_$AC(t){let e=st.get(t.strings);return e===void 0&&st.set(t.strings,e=new O(t)),e}k(t){at(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,r=0;for(const n of t)r===e.length?e.push(s=new R(this.S(U()),this.S(U()),this,this.options)):s=e[r],s._$AI(n),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class L{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,n){this.type=1,this._$AH=g,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=g}_$AI(t,e=this,s,r){const n=this.strings;let o=!1;if(n===void 0)t=v(this,t,e,0),o=!x(t)||t!==this._$AH&&t!==A,o&&(this._$AH=t);else{const p=t;let a,d;for(t=n[0],a=0;a<n.length-1;a++)d=v(this,p[s+a],e,a),d===A&&(d=this._$AH[a]),o||(o=!x(d)||d!==this._$AH[a]),d===g?t=g:t!==g&&(t+=(d??"")+n[a+1]),this._$AH[a]=d}o&&!r&&this.j(t)}j(t){t===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ct extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===g?void 0:t}}class Et extends L{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==g)}}class Pt extends L{constructor(t,e,s,r,n){super(t,e,s,r,n),this.type=5}_$AI(t,e=this){if((t=v(this,t,e,0)??g)===A)return;const s=this._$AH,r=t===g&&s!==g||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==g&&(s===g||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Mt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){v(this,t)}}const z=P.litHtmlPolyfillSupport;z==null||z(O,R),(P.litHtmlVersions??(P.litHtmlVersions=[])).push("3.1.3");const Ut=(i,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let r=s._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=r=new R(t.insertBefore(U(),n),n,void 0,e??{})}return r._$AI(i),r};/**
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Y=/'/g,tt=/"/g,ht=/^(?:script|style|textarea|title)$/i,St=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),et=St(1),A=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),st=new WeakMap,w=b.createTreeWalker(b,129);function lt(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Q!==void 0?Q.createHTML(t):t}const At=(i,t)=>{const e=i.length-1,s=[];let r,n=t===2?"<svg>":"",o=C;for(let p=0;p<e;p++){const a=i[p];let d,u,c=-1,y=0;for(;y<a.length&&(o.lastIndex=y,u=o.exec(a),u!==null);)y=o.lastIndex,o===C?u[1]==="!--"?o=Z:u[1]!==void 0?o=X:u[2]!==void 0?(ht.test(u[2])&&(r=RegExp("</"+u[2],"g")),o=$):u[3]!==void 0&&(o=$):o===$?u[0]===">"?(o=r??C,c=-1):u[1]===void 0?c=-2:(c=o.lastIndex-u[2].length,d=u[1],o=u[3]===void 0?$:u[3]==='"'?tt:Y):o===tt||o===Y?o=$:o===Z||o===X?o=C:(o=$,r=void 0);const f=o===$&&i[p+1].startsWith("/>")?" ":"";n+=o===C?a+wt:c>=0?(s.push(d),a.slice(0,c)+ot+a.slice(c)+_+f):a+_+(c===-2?p:f)}return[lt(i,n+(i[e]||"<?>")+(t===2?"</svg>":"")),s]};class R{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let n=0,o=0;const p=t.length-1,a=this.parts,[d,u]=At(t,e);if(this.el=R.createElement(d,s),w.currentNode=this.el.content,e===2){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(r=w.nextNode())!==null&&a.length<p;){if(r.nodeType===1){if(r.hasAttributes())for(const c of r.getAttributeNames())if(c.endsWith(ot)){const y=u[o++],f=r.getAttribute(c).split(_),k=/([.?@])?(.*)/.exec(y);a.push({type:1,index:n,name:k[2],strings:f,ctor:k[1]==="."?Ct:k[1]==="?"?Et:k[1]==="@"?Pt:L}),r.removeAttribute(c)}else c.startsWith(_)&&(a.push({type:6,index:n}),r.removeAttribute(c));if(ht.test(r.tagName)){const c=r.textContent.split(_),y=c.length-1;if(y>0){r.textContent=I?I.emptyScript:"";for(let f=0;f<y;f++)r.append(c[f],x()),w.nextNode(),a.push({type:2,index:++n});r.append(c[y],x())}}}else if(r.nodeType===8)if(r.data===nt)a.push({type:2,index:n});else{let c=-1;for(;(c=r.data.indexOf(_,c+1))!==-1;)a.push({type:7,index:n}),c+=_.length-1}n++}}static createElement(t,e){const s=b.createElement("template");return s.innerHTML=t,s}}function v(i,t,e=i,s){var o,p;if(t===A)return t;let r=s!==void 0?(o=e._$Co)==null?void 0:o[s]:e._$Cl;const n=O(t)?void 0:t._$litDirective$;return(r==null?void 0:r.constructor)!==n&&((p=r==null?void 0:r._$AO)==null||p.call(r,!1),n===void 0?r=void 0:(r=new n(i),r._$AT(i,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=r:e._$Cl=r),r!==void 0&&(t=v(i,r._$AS(i,t.values),r,s)),t}class vt{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){const{el:{content:e},parts:s}=this._$AD,r=((t==null?void 0:t.creationScope)??b).importNode(e,!0);w.currentNode=r;let n=w.nextNode(),o=0,p=0,a=s[0];for(;a!==void 0;){if(o===a.index){let d;a.type===2?d=new N(n,n.nextSibling,this,t):a.type===1?d=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(d=new Mt(n,this,t)),this._$AV.push(d),a=s[++p]}o!==(a==null?void 0:a.index)&&(n=w.nextNode(),o++)}return w.currentNode=b,r}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class N{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=(r==null?void 0:r.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=v(this,t,e),O(t)?t===g||t==null||t===""?(this._$AH!==g&&this._$AR(),this._$AH=g):t!==this._$AH&&t!==A&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):bt(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==g&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(b.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=R.createElement(lt(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===r)this._$AH.p(e);else{const o=new vt(r,this),p=o.u(this.options);o.p(e),this.T(p),this._$AH=o}}_$AC(t){let e=st.get(t.strings);return e===void 0&&st.set(t.strings,e=new R(t)),e}k(t){at(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,r=0;for(const n of t)r===e.length?e.push(s=new N(this.S(x()),this.S(x()),this,this.options)):s=e[r],s._$AI(n),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const r=t.nextSibling;t.remove(),t=r}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class L{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,n){this.type=1,this._$AH=g,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=g}_$AI(t,e=this,s,r){const n=this.strings;let o=!1;if(n===void 0)t=v(this,t,e,0),o=!O(t)||t!==this._$AH&&t!==A,o&&(this._$AH=t);else{const p=t;let a,d;for(t=n[0],a=0;a<n.length-1;a++)d=v(this,p[s+a],e,a),d===A&&(d=this._$AH[a]),o||(o=!O(d)||d!==this._$AH[a]),d===g?t=g:t!==g&&(t+=(d??"")+n[a+1]),this._$AH[a]=d}o&&!r&&this.j(t)}j(t){t===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ct extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===g?void 0:t}}class Et extends L{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==g)}}class Pt extends L{constructor(t,e,s,r,n){super(t,e,s,r,n),this.type=5}_$AI(t,e=this){if((t=v(this,t,e,0)??g)===A)return;const s=this._$AH,r=t===g&&s!==g||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==g&&(s===g||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Mt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){v(this,t)}}const z=M.litHtmlPolyfillSupport;z==null||z(R,N),(M.litHtmlVersions??(M.litHtmlVersions=[])).push("3.1.3");const Ut=(i,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let r=s._$litPart$;if(r===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=r=new N(t.insertBefore(x(),n),n,void 0,e??{})}return r._$AI(i),r};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */class M extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ut(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return A}}var rt;M._$litElement$=!0,M.finalized=!0,(rt=globalThis.litElementHydrateSupport)==null||rt.call(globalThis,{LitElement:M});const B=globalThis.litElementPolyfillSupport;B==null||B({LitElement:M});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");/**
19
+ */class U extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Ut(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return A}}var rt;U._$litElement$=!0,U.finalized=!0,(rt=globalThis.litElementHydrateSupport)==null||rt.call(globalThis,{LitElement:U});const B=globalThis.litElementPolyfillSupport;B==null||B({LitElement:U});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");/**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
@@ -24,7 +24,7 @@
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */const Ot={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:W},Rt=(i=Ot,t,e)=>{const{kind:s,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),n.set(e.name,i),s==="accessor"){const{name:o}=e;return{set(p){const a=t.get.call(this);t.set.call(this,p),this.requestUpdate(o,a,i)},init(p){return p!==void 0&&this.P(o,void 0,i),p}}}if(s==="setter"){const{name:o}=e;return function(p){const a=this[o];t.call(this,p),this.requestUpdate(o,a,i)}}throw Error("Unsupported decorator location: "+s)};function l(i){return(t,e)=>typeof e=="object"?Rt(i,t,e):((s,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(r,n):void 0})(i,t,e)}const Nt=["allow-partial-match","ar-placement","background-color","camera-orbit-sensitivity","camera-transition-duration","disable-retries","disable-scroll-wheel","enable-dark-mode","highlight-color","interaction-prompt-style","lights","list-bullet-alignment","list-bullet-leading-zeros","list-bullet-style","qr-url-pattern","rotation","ruler-unit","shadow-intensity","shadow-softness","show-ar-button","show-ar-button-label","show-configurator","show-contexts","show-configurator-mobile","show-hotspots","show-interaction-prompt","show-light-switch","show-ruler-button","show-pivot-button","show-presets","start-frame","tone-mapping","zoom-type"],kt=i=>i.replace(/([-_]\w)/g,t=>t[1].toUpperCase()),Tt=i=>{const t=kt(i);return t.includes("showAr")?t.replace("showAr","showAR"):t},Ht=i=>{let t=new URLSearchParams;return Nt.forEach(e=>{if(i.hasAttribute(e)){let s=i.getAttribute(e);if(!s)return;s==="yes"&&(s="true"),s==="no"&&(s="false"),t.append(Tt(e),s)}}),t};var It=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,h=(i,t,e,s)=>{for(var r=s>1?void 0:s?Lt(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&It(t,e,r),r};const jt="{host}{viewer}/by_scene_id/{scene_id}",Dt="{host}{viewer}/by_product_id/{customer_id}/{product_id}",zt="{host}{viewer}/by_product_id/{customer_id}/{sku}",Bt="{host}{viewer}/by_hash/{customer_id}/{hash}";function k(i,t){var e=new RegExp(Object.keys(t).join("|"),"gi");return i.replace(e,function(s){return t[s.toLowerCase()]})}exports.Configurator=class extends M{constructor(){super(...arguments),this.customerId=void 0,this.viewer="realtime",this.host="https://configurator.v2.londondynamics.com",this.defaultSelection={},this.getCurrentSelection=t=>this._pingpongPostMessage({type:"currentValues"},t),this._emit=(t,e)=>{this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))},this._pingpongPostMessage=(t,e)=>new Promise((s,r)=>{var a,d;const n={...t,messageId:Date.now()},o=u=>{if(u.origin===this.host&&u.data.messageId===n.messageId&&u.data.type===n.type){try{e?e(JSON.parse(u.data.result)):s(JSON.parse(u.data.result))}catch(c){c instanceof Error?e?e({},c.message):r(c.message):e?e({},"Unknown error"):r("Unknown error")}window.removeEventListener("message",o)}},p=(a=this.shadowRoot)==null?void 0:a.querySelector("iframe");p&&(window.addEventListener("message",o),(d=p.contentWindow)==null||d.postMessage(n,"*"))}),this._handleMessage=t=>{var e;if(t.origin===this.host&&(e=t==null?void 0:t.data)!=null&&e.type)switch(t.data.type){case"ready":this._emit("ready",{options:JSON.parse(t.data.options),presets:JSON.parse(t.data.presets),scene:JSON.parse(t.data.scene)});break;case"load":this._emit("load",JSON.parse(t.data.values));break;case"error":this._emit("error",JSON.parse(t.data.values));break;case"change":this._emit("change",JSON.parse(t.data.values));break;case"cameraChange":this._emit("camerachange",JSON.parse(t.data.values));break;case"log":const{logType:s,logData:r}=t.data;this._emit(s,JSON.parse(r));break}}}getCurrentConfiguration(t){return this._pingpongPostMessage({type:"currentConfig"},t)}getCurrentScene(t){return this._pingpongPostMessage({type:"currentScene"},t)}getCurrentHash(t){return this._pingpongPostMessage({type:"currentHash"},t)}getCurrentSource(t){return this._pingpongPostMessage({type:"currentSource"},t)}getCurrentARSource(t){return this._pingpongPostMessage({type:"currentARSource"},t)}getDataURL(t){return this._pingpongPostMessage({type:"dataURL"},t)}getFrame(t,e,s){return this._pingpongPostMessage({type:"getFrame",index:t,options:e},s)}setFeature(t,e){this._postMessage({type:"setFeature",featureId:t,variantId:e,allowPartialMatch:this.allowPartialMatch})}setSelection(t,e){this._postMessage({type:"setSelection",selection:t,resetBeforeUpdate:e,allowPartialMatch:this.allowPartialMatch})}setContext(t){this._postMessage({type:"setPreset",presetId:t})}resetCamera(){this._postMessage({type:"resetCamera"})}toggleLights(t){this._postMessage({type:"toggleLights",value:t})}toggleGroup(t){this._postMessage({type:"toggleGroup",value:t})}toggleHotspot(t){this._postMessage({type:"toggleGroup",groupId:t})}setRotation(t=[0,0,0],e="deg"){this._postMessage({type:"setRotation",rotation:t,angularUnit:e})}setCamera(t={},e={}){this._postMessage({type:"setCamera",...t,...e})}_postMessage(t){var s,r;const e=(s=this.shadowRoot)==null?void 0:s.querySelector("iframe");e&&((r=e.contentWindow)==null||r.postMessage(t,"*"))}connectedCallback(){super.connectedCallback();const t=this.querySelector('script[type="application/json"]');if(t&&t.textContent)try{this.defaultSelection=JSON.parse(t.textContent)}catch(e){typeof e=="object"&&e instanceof Error?console.warn(`Error parsing selection: ${e.message}. Using default selection instead.`):console.warn("Error parsing selection. Using default selection instead.")}window.addEventListener("message",this._handleMessage)}disconnectedCallback(){window.removeEventListener("message",this._handleMessage),super.disconnectedCallback()}render(){let t=null,e=null;if(console.log("this.defaultSelection?",this.defaultSelection),this.host?this.customerId?this.hash?e=k(Bt,{"{viewer}":"","{host}":this.host,"{customer_id}":this.customerId,"{hash}":this.hash}):this.sceneId?e=k(jt,{"{viewer}":this.viewer==="360"?"/360":"","{host}":this.host,"{customer_id}":this.customerId,"{scene_id}":this.sceneId}):this.sku?e=k(zt,{"{viewer}":this.viewer==="360"?"/360":"","{host}":this.host,"{customer_id}":this.customerId,"{sku}":this.sku}):this.productId?e=k(Dt,{"{viewer}":this.viewer==="360"?"/360":"","{host}":this.host,"{customer_id}":this.customerId,"{product_id}":this.productId}):t="Missing property: sku, scene-id, or hash":t="Missing property: customer-id":t="Missing property: host",t)return et`<div>${t}</div>`;let s="";return Object.keys(this.defaultSelection).length>0&&(s+=new URLSearchParams(this.defaultSelection).toString()),this.hasAttributes()&&(Object.keys(this.defaultSelection).length>0&&(s+="&"),s+=Ht(this)),s.length&&(e+="?"+s),et`<iframe
27
+ */const Ot={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:W},Rt=(i=Ot,t,e)=>{const{kind:s,metadata:r}=e;let n=globalThis.litPropertyMetadata.get(r);if(n===void 0&&globalThis.litPropertyMetadata.set(r,n=new Map),n.set(e.name,i),s==="accessor"){const{name:o}=e;return{set(p){const a=t.get.call(this);t.set.call(this,p),this.requestUpdate(o,a,i)},init(p){return p!==void 0&&this.P(o,void 0,i),p}}}if(s==="setter"){const{name:o}=e;return function(p){const a=this[o];t.call(this,p),this.requestUpdate(o,a,i)}}throw Error("Unsupported decorator location: "+s)};function l(i){return(t,e)=>typeof e=="object"?Rt(i,t,e):((s,r,n)=>{const o=r.hasOwnProperty(n);return r.constructor.createProperty(n,o?{...s,wrapped:!0}:s),o?Object.getOwnPropertyDescriptor(r,n):void 0})(i,t,e)}const Nt=["allow-partial-match","ar-placement","background-color","camera-orbit-sensitivity","camera-transition-duration","disable-retries","disable-scroll-wheel","enable-dark-mode","highlight-color","interaction-prompt-style","lights","list-bullet-alignment","list-bullet-leading-zeros","list-bullet-style","qr-url-pattern","rotation","ruler-unit","shadow-intensity","shadow-softness","show-ar-button","show-ar-button-label","show-configurator","show-contexts","show-configurator-mobile","show-hotspots","show-interaction-prompt","show-light-switch","show-ruler-button","show-pivot-button","show-presets","start-frame","token","tone-mapping","zoom-type"],kt=i=>i.replace(/([-_]\w)/g,t=>t[1].toUpperCase()),Tt=i=>{const t=kt(i);return t.includes("showAr")?t.replace("showAr","showAR"):t},Ht=i=>{let t=new URLSearchParams;return Nt.forEach(e=>{if(i.hasAttribute(e)){let s=i.getAttribute(e);if(!s)return;s==="yes"&&(s="true"),s==="no"&&(s="false"),t.append(Tt(e),s)}}),t};var It=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,h=(i,t,e,s)=>{for(var r=s>1?void 0:s?Lt(t,e):t,n=i.length-1,o;n>=0;n--)(o=i[n])&&(r=(s?o(t,e,r):o(r))||r);return s&&r&&It(t,e,r),r};const jt="{host}/by_asset_id/{asset_id}",Dt="{host}{viewer}/by_scene_id/{scene_id}",zt="{host}{viewer}/by_product_id/{customer_id}/{product_id}",Bt="{host}{viewer}/by_product_id/{customer_id}/{sku}",Jt="{host}{viewer}/by_hash/{customer_id}/{hash}";function E(i,t){var e=new RegExp(Object.keys(t).join("|"),"gi");return i.replace(e,function(s){return t[s.toLowerCase()]})}exports.Configurator=class extends U{constructor(){super(...arguments),this.customerId=void 0,this.viewer="realtime",this.host="https://configurator.v2.londondynamics.com",this.defaultSelection={},this.getCurrentSelection=t=>this._pingpongPostMessage({type:"currentValues"},t),this._emit=(t,e)=>{this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))},this._pingpongPostMessage=(t,e)=>new Promise((s,r)=>{var a,d;const n={...t,messageId:Date.now()},o=u=>{if(u.origin===this.host&&u.data.messageId===n.messageId&&u.data.type===n.type){try{e?e(JSON.parse(u.data.result)):s(JSON.parse(u.data.result))}catch(c){c instanceof Error?e?e({},c.message):r(c.message):e?e({},"Unknown error"):r("Unknown error")}window.removeEventListener("message",o)}},p=(a=this.shadowRoot)==null?void 0:a.querySelector("iframe");p&&(window.addEventListener("message",o),(d=p.contentWindow)==null||d.postMessage(n,"*"))}),this._handleMessage=t=>{var e;if(t.origin===this.host&&(e=t==null?void 0:t.data)!=null&&e.type)switch(t.data.type){case"ready":this._emit("ready",{options:JSON.parse(t.data.options),presets:JSON.parse(t.data.presets),scene:JSON.parse(t.data.scene)});break;case"load":this._emit("load",JSON.parse(t.data.values));break;case"error":this._emit("error",JSON.parse(t.data.values));break;case"change":this._emit("change",JSON.parse(t.data.values));break;case"cameraChange":this._emit("camerachange",JSON.parse(t.data.values));break;case"log":const{logType:s,logData:r}=t.data;this._emit(s,JSON.parse(r));break}}}getCurrentConfiguration(t){return this._pingpongPostMessage({type:"currentConfig"},t)}getCurrentScene(t){return this._pingpongPostMessage({type:"currentScene"},t)}getCurrentHash(t){return this._pingpongPostMessage({type:"currentHash"},t)}getCurrentSource(t){return this._pingpongPostMessage({type:"currentSource"},t)}getCurrentARSource(t){return this._pingpongPostMessage({type:"currentARSource"},t)}getDataURL(t){return this._pingpongPostMessage({type:"dataURL"},t)}getFrame(t,e,s){return this._pingpongPostMessage({type:"getFrame",index:t,options:e},s)}setFeature(t,e){this._postMessage({type:"setFeature",featureId:t,variantId:e,allowPartialMatch:this.allowPartialMatch})}setSelection(t,e){this._postMessage({type:"setSelection",selection:t,resetBeforeUpdate:e,allowPartialMatch:this.allowPartialMatch})}setContext(t){this._postMessage({type:"setPreset",presetId:t})}resetCamera(){this._postMessage({type:"resetCamera"})}toggleLights(t){this._postMessage({type:"toggleLights",value:t})}toggleGroup(t){this._postMessage({type:"toggleGroup",value:t})}toggleHotspot(t){this._postMessage({type:"toggleGroup",groupId:t})}setRotation(t=[0,0,0],e="deg"){this._postMessage({type:"setRotation",rotation:t,angularUnit:e})}setCamera(t={},e={}){this._postMessage({type:"setCamera",...t,...e})}_postMessage(t){var s,r;const e=(s=this.shadowRoot)==null?void 0:s.querySelector("iframe");e&&((r=e.contentWindow)==null||r.postMessage(t,"*"))}connectedCallback(){super.connectedCallback();const t=this.querySelector('script[type="application/json"]');if(t&&t.textContent)try{this.defaultSelection=JSON.parse(t.textContent)}catch(e){typeof e=="object"&&e instanceof Error?console.warn(`Error parsing selection: ${e.message}. Using default selection instead.`):console.warn("Error parsing selection. Using default selection instead.")}window.addEventListener("message",this._handleMessage)}disconnectedCallback(){window.removeEventListener("message",this._handleMessage),super.disconnectedCallback()}render(){let t=null,e=null;if(this.host?this.sceneId?e=E(Dt,{"{viewer}":this.viewer==="360"?"/360":"","{host}":this.host,"{scene_id}":this.sceneId}):this.assetId?e=E(jt,{"{host}":this.host,"{asset_id}":this.assetId}):this.customerId?this.hash?e=E(Jt,{"{viewer}":"","{host}":this.host,"{customer_id}":this.customerId,"{hash}":this.hash}):this.sku?e=E(Bt,{"{viewer}":this.viewer==="360"?"/360":"","{host}":this.host,"{customer_id}":this.customerId,"{sku}":this.sku}):this.productId?e=E(zt,{"{viewer}":this.viewer==="360"?"/360":"","{host}":this.host,"{customer_id}":this.customerId,"{product_id}":this.productId}):t="Missing property: sku or hash":t="Missing property: customer-id, asset-id, or scene-id":t="Missing property: host",t)return et`<div>${t}</div>`;const s=Ht(this);for(const[r,n]of Object.entries(this.defaultSelection))n&&s.append(r,n);return s.size&&(e+="?"+s),et`<iframe
28
28
  src="${e}"
29
29
  width="100%"
30
30
  height="100%"
@@ -44,4 +44,4 @@
44
44
  width: 100%;
45
45
  height: 100%;
46
46
  }
47
- `;h([l({type:String,attribute:"customer-id"})],exports.Configurator.prototype,"customerId",2);h([l({type:String,attribute:"product-id"})],exports.Configurator.prototype,"productId",2);h([l({type:String})],exports.Configurator.prototype,"sku",2);h([l({type:String,attribute:"scene-id"})],exports.Configurator.prototype,"sceneId",2);h([l({type:String})],exports.Configurator.prototype,"hash",2);h([l({type:String})],exports.Configurator.prototype,"viewer",2);h([l({type:String})],exports.Configurator.prototype,"host",2);h([l({type:String,attribute:"allow-partial-match"})],exports.Configurator.prototype,"allowPartialMatch",2);h([l({type:String,attribute:"ar-placement"})],exports.Configurator.prototype,"arPlacement",2);h([l({type:String,attribute:"background-color"})],exports.Configurator.prototype,"backgroundColor",2);h([l({type:String,attribute:"disable-retries"})],exports.Configurator.prototype,"disableRetries",2);h([l({type:String,attribute:"disable-scroll-wheel"})],exports.Configurator.prototype,"disableScrollWheel",2);h([l({type:String,attribute:"enable-darkmode"})],exports.Configurator.prototype,"enableDarkMode",2);h([l({type:String,attribute:"interaction-prompt-style"})],exports.Configurator.prototype,"interactionPromptStyle",2);h([l({type:String,attribute:"lights"})],exports.Configurator.prototype,"lights",2);h([l({type:String,attribute:"qr-url-pattern"})],exports.Configurator.prototype,"qrUrlPattern",2);h([l({type:String,attribute:"rotation"})],exports.Configurator.prototype,"rotation",2);h([l({type:String,attribute:"ruler-unit"})],exports.Configurator.prototype,"rulerUnit",2);h([l({type:String,attribute:"shadow-intensity"})],exports.Configurator.prototype,"shadowIntensity",2);h([l({type:String,attribute:"shadow-softness"})],exports.Configurator.prototype,"shadowSoftness",2);h([l({type:String,attribute:"show-ar-button"})],exports.Configurator.prototype,"showARButton",2);h([l({type:String,attribute:"show-ar-button-label"})],exports.Configurator.prototype,"showARButtonLabel",2);h([l({type:String,attribute:"show-configurator"})],exports.Configurator.prototype,"showConfigurator",2);h([l({type:String,attribute:"show-contexts"})],exports.Configurator.prototype,"showContexts",2);h([l({type:String,attribute:"show-hotspots"})],exports.Configurator.prototype,"showHotspots",2);h([l({type:String,attribute:"show-interaction-prompt"})],exports.Configurator.prototype,"showInteractionPrompt",2);h([l({type:String,attribute:"show-light-switch"})],exports.Configurator.prototype,"showLightSwitch",2);h([l({type:String,attribute:"show-ruler-button"})],exports.Configurator.prototype,"showRulerButton",2);h([l({type:String,attribute:"show-pivot-button"})],exports.Configurator.prototype,"showPivotButton",2);h([l({type:String,attribute:"show-presets"})],exports.Configurator.prototype,"showPresets",2);h([l({type:String,attribute:"start-frame"})],exports.Configurator.prototype,"startFrame",2);h([l({type:String,attribute:"tone-mapping"})],exports.Configurator.prototype,"toneMapping",2);h([l({type:String,attribute:"zoom-type"})],exports.Configurator.prototype,"zoomType",2);exports.Configurator=h([xt("ld-configurator")],exports.Configurator);
47
+ `;h([l({type:String,attribute:"customer-id"})],exports.Configurator.prototype,"customerId",2);h([l({type:String,attribute:"product-id"})],exports.Configurator.prototype,"productId",2);h([l({type:String})],exports.Configurator.prototype,"sku",2);h([l({type:String,attribute:"asset-id"})],exports.Configurator.prototype,"assetId",2);h([l({type:String,attribute:"scene-id"})],exports.Configurator.prototype,"sceneId",2);h([l({type:String})],exports.Configurator.prototype,"hash",2);h([l({type:String})],exports.Configurator.prototype,"viewer",2);h([l({type:String})],exports.Configurator.prototype,"host",2);h([l({type:String})],exports.Configurator.prototype,"token",2);h([l({type:String,attribute:"allow-partial-match"})],exports.Configurator.prototype,"allowPartialMatch",2);h([l({type:String,attribute:"ar-placement"})],exports.Configurator.prototype,"arPlacement",2);h([l({type:String,attribute:"background-color"})],exports.Configurator.prototype,"backgroundColor",2);h([l({type:String,attribute:"disable-retries"})],exports.Configurator.prototype,"disableRetries",2);h([l({type:String,attribute:"disable-scroll-wheel"})],exports.Configurator.prototype,"disableScrollWheel",2);h([l({type:String,attribute:"enable-darkmode"})],exports.Configurator.prototype,"enableDarkMode",2);h([l({type:String,attribute:"interaction-prompt-style"})],exports.Configurator.prototype,"interactionPromptStyle",2);h([l({type:String,attribute:"lights"})],exports.Configurator.prototype,"lights",2);h([l({type:String,attribute:"qr-url-pattern"})],exports.Configurator.prototype,"qrUrlPattern",2);h([l({type:String,attribute:"rotation"})],exports.Configurator.prototype,"rotation",2);h([l({type:String,attribute:"ruler-unit"})],exports.Configurator.prototype,"rulerUnit",2);h([l({type:String,attribute:"shadow-intensity"})],exports.Configurator.prototype,"shadowIntensity",2);h([l({type:String,attribute:"shadow-softness"})],exports.Configurator.prototype,"shadowSoftness",2);h([l({type:String,attribute:"show-ar-button"})],exports.Configurator.prototype,"showARButton",2);h([l({type:String,attribute:"show-ar-button-label"})],exports.Configurator.prototype,"showARButtonLabel",2);h([l({type:String,attribute:"show-configurator"})],exports.Configurator.prototype,"showConfigurator",2);h([l({type:String,attribute:"show-contexts"})],exports.Configurator.prototype,"showContexts",2);h([l({type:String,attribute:"show-hotspots"})],exports.Configurator.prototype,"showHotspots",2);h([l({type:String,attribute:"show-interaction-prompt"})],exports.Configurator.prototype,"showInteractionPrompt",2);h([l({type:String,attribute:"show-light-switch"})],exports.Configurator.prototype,"showLightSwitch",2);h([l({type:String,attribute:"show-ruler-button"})],exports.Configurator.prototype,"showRulerButton",2);h([l({type:String,attribute:"show-pivot-button"})],exports.Configurator.prototype,"showPivotButton",2);h([l({type:String,attribute:"show-presets"})],exports.Configurator.prototype,"showPresets",2);h([l({type:String,attribute:"start-frame"})],exports.Configurator.prototype,"startFrame",2);h([l({type:String,attribute:"tone-mapping"})],exports.Configurator.prototype,"toneMapping",2);h([l({type:String,attribute:"zoom-type"})],exports.Configurator.prototype,"zoomType",2);exports.Configurator=h([xt("ld-configurator")],exports.Configurator);
@@ -18,10 +18,12 @@ export declare class Configurator extends LitElement {
18
18
  customerId: string | undefined;
19
19
  productId?: string;
20
20
  sku?: string;
21
+ assetId?: string;
21
22
  sceneId?: string;
22
23
  hash?: string;
23
24
  viewer?: 'realtime' | '360';
24
25
  host?: string | undefined;
26
+ token?: string;
25
27
  allowPartialMatch?: 'yes' | 'no';
26
28
  arPlacement?: 'floor' | 'wall';
27
29
  backgroundColor?: string;
@@ -18,10 +18,12 @@ export declare class Configurator extends LitElement {
18
18
  customerId: string | undefined;
19
19
  productId?: string;
20
20
  sku?: string;
21
+ assetId?: string;
21
22
  sceneId?: string;
22
23
  hash?: string;
23
24
  viewer?: 'realtime' | '360';
24
25
  host?: string | undefined;
26
+ token?: string;
25
27
  allowPartialMatch?: 'yes' | 'no';
26
28
  arPlacement?: 'floor' | 'wall';
27
29
  backgroundColor?: string;
@@ -3,7 +3,7 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- const H = globalThis, J = H.ShadowRoot && (H.ShadyCSS === void 0 || H.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, W = Symbol(), V = /* @__PURE__ */ new WeakMap();
6
+ const H = globalThis, q = H.ShadowRoot && (H.ShadyCSS === void 0 || H.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, W = Symbol(), V = /* @__PURE__ */ new WeakMap();
7
7
  let ot = class {
8
8
  constructor(t, e, i) {
9
9
  if (this._$cssResult$ = !0, i !== W)
@@ -13,7 +13,7 @@ let ot = class {
13
13
  get styleSheet() {
14
14
  let t = this.o;
15
15
  const e = this.t;
16
- if (J && t === void 0) {
16
+ if (q && t === void 0) {
17
17
  const i = e !== void 0 && e.length === 1;
18
18
  i && (t = V.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && V.set(e, t));
19
19
  }
@@ -33,14 +33,14 @@ const ct = (s) => new ot(typeof s == "string" ? s : s + "", void 0, W), dt = (s,
33
33
  })(r) + s[n + 1], s[0]);
34
34
  return new ot(e, s, W);
35
35
  }, ut = (s, t) => {
36
- if (J)
36
+ if (q)
37
37
  s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
38
38
  else
39
39
  for (const e of t) {
40
40
  const i = document.createElement("style"), r = H.litNonce;
41
41
  r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
42
42
  }
43
- }, G = J ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
43
+ }, G = q ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
44
44
  let e = "";
45
45
  for (const i of t.cssRules)
46
46
  e += i.cssText;
@@ -51,7 +51,7 @@ const ct = (s) => new ot(typeof s == "string" ? s : s + "", void 0, W), dt = (s,
51
51
  * Copyright 2017 Google LLC
52
52
  * SPDX-License-Identifier: BSD-3-Clause
53
53
  */
54
- const { is: gt, defineProperty: yt, getOwnPropertyDescriptor: _t, getOwnPropertyNames: ft, getOwnPropertySymbols: mt, getPrototypeOf: $t } = Object, $ = globalThis, K = $.trustedTypes, wt = K ? K.emptyScript : "", D = $.reactiveElementPolyfillSupport, C = (s, t) => s, I = { toAttribute(s, t) {
54
+ const { is: gt, defineProperty: yt, getOwnPropertyDescriptor: _t, getOwnPropertyNames: ft, getOwnPropertySymbols: mt, getPrototypeOf: $t } = Object, $ = globalThis, K = $.trustedTypes, wt = K ? K.emptyScript : "", j = $.reactiveElementPolyfillSupport, M = (s, t) => s, I = { toAttribute(s, t) {
55
55
  switch (t) {
56
56
  case Boolean:
57
57
  s = s ? wt : null;
@@ -111,15 +111,15 @@ class A extends HTMLElement {
111
111
  return this.elementProperties.get(t) ?? Q;
112
112
  }
113
113
  static _$Ei() {
114
- if (this.hasOwnProperty(C("elementProperties")))
114
+ if (this.hasOwnProperty(M("elementProperties")))
115
115
  return;
116
116
  const t = $t(this);
117
117
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
118
118
  }
119
119
  static finalize() {
120
- if (this.hasOwnProperty(C("finalized")))
120
+ if (this.hasOwnProperty(M("finalized")))
121
121
  return;
122
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(C("properties"))) {
122
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(M("properties"))) {
123
123
  const e = this.properties, i = [...ft(e), ...mt(e)];
124
124
  for (const r of i)
125
125
  this.createProperty(r, e[r]);
@@ -292,13 +292,13 @@ class A extends HTMLElement {
292
292
  firstUpdated(t) {
293
293
  }
294
294
  }
295
- A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[C("elementProperties")] = /* @__PURE__ */ new Map(), A[C("finalized")] = /* @__PURE__ */ new Map(), D == null || D({ ReactiveElement: A }), ($.reactiveElementVersions ?? ($.reactiveElementVersions = [])).push("2.0.4");
295
+ A.elementStyles = [], A.shadowRootOptions = { mode: "open" }, A[M("elementProperties")] = /* @__PURE__ */ new Map(), A[M("finalized")] = /* @__PURE__ */ new Map(), j == null || j({ ReactiveElement: A }), ($.reactiveElementVersions ?? ($.reactiveElementVersions = [])).push("2.0.4");
296
296
  /**
297
297
  * @license
298
298
  * Copyright 2017 Google LLC
299
299
  * SPDX-License-Identifier: BSD-3-Clause
300
300
  */
301
- const M = globalThis, L = M.trustedTypes, Z = L ? L.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, nt = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, at = "?" + m, bt = `<${at}>`, S = document, x = () => S.createComment(""), O = (s) => s === null || typeof s != "object" && typeof s != "function", ht = Array.isArray, St = (s) => ht(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", z = `[
301
+ const U = globalThis, L = U.trustedTypes, Z = L ? L.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, nt = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, at = "?" + m, bt = `<${at}>`, S = document, O = () => S.createComment(""), R = (s) => s === null || typeof s != "object" && typeof s != "function", ht = Array.isArray, St = (s) => ht(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", z = `[
302
302
  \f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, X = /-->/g, Y = />/g, w = RegExp(`>|${z}(?:([^\\s"'>=/]+)(${z}*=${z}*(?:[^
303
303
  \f\r"'\`<>=]|("|')|))|$)`, "g"), tt = /'/g, et = /"/g, lt = /^(?:script|style|textarea|title)$/i, At = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), st = At(1), v = Symbol.for("lit-noChange"), y = Symbol.for("lit-nothing"), it = /* @__PURE__ */ new WeakMap(), b = S.createTreeWalker(S, 129);
304
304
  function pt(s, t) {
@@ -319,13 +319,13 @@ const vt = (s, t) => {
319
319
  }
320
320
  return [pt(s, n + (s[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
321
321
  };
322
- class R {
322
+ class N {
323
323
  constructor({ strings: t, _$litType$: e }, i) {
324
324
  let r;
325
325
  this.parts = [];
326
326
  let n = 0, o = 0;
327
327
  const c = t.length - 1, a = this.parts, [d, g] = vt(t, e);
328
- if (this.el = R.createElement(d, i), b.currentNode = this.el.content, e === 2) {
328
+ if (this.el = N.createElement(d, i), b.currentNode = this.el.content, e === 2) {
329
329
  const u = this.el.content.firstChild;
330
330
  u.replaceWith(...u.childNodes);
331
331
  }
@@ -334,8 +334,8 @@ class R {
334
334
  if (r.hasAttributes())
335
335
  for (const u of r.getAttributeNames())
336
336
  if (u.endsWith(nt)) {
337
- const _ = g[o++], f = r.getAttribute(u).split(m), k = /([.?@])?(.*)/.exec(_);
338
- a.push({ type: 1, index: n, name: k[2], strings: f, ctor: k[1] === "." ? Pt : k[1] === "?" ? Ct : k[1] === "@" ? Mt : j }), r.removeAttribute(u);
337
+ const _ = g[o++], f = r.getAttribute(u).split(m), T = /([.?@])?(.*)/.exec(_);
338
+ a.push({ type: 1, index: n, name: T[2], strings: f, ctor: T[1] === "." ? Pt : T[1] === "?" ? Ct : T[1] === "@" ? Mt : D }), r.removeAttribute(u);
339
339
  } else
340
340
  u.startsWith(m) && (a.push({ type: 6, index: n }), r.removeAttribute(u));
341
341
  if (lt.test(r.tagName)) {
@@ -343,8 +343,8 @@ class R {
343
343
  if (_ > 0) {
344
344
  r.textContent = L ? L.emptyScript : "";
345
345
  for (let f = 0; f < _; f++)
346
- r.append(u[f], x()), b.nextNode(), a.push({ type: 2, index: ++n });
347
- r.append(u[_], x());
346
+ r.append(u[f], O()), b.nextNode(), a.push({ type: 2, index: ++n });
347
+ r.append(u[_], O());
348
348
  }
349
349
  }
350
350
  } else if (r.nodeType === 8)
@@ -368,7 +368,7 @@ function E(s, t, e = s, i) {
368
368
  if (t === v)
369
369
  return t;
370
370
  let r = i !== void 0 ? (o = e._$Co) == null ? void 0 : o[i] : e._$Cl;
371
- const n = O(t) ? void 0 : t._$litDirective$;
371
+ const n = R(t) ? void 0 : t._$litDirective$;
372
372
  return (r == null ? void 0 : r.constructor) !== n && ((c = r == null ? void 0 : r._$AO) == null || c.call(r, !1), n === void 0 ? r = void 0 : (r = new n(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = r : e._$Cl = r), r !== void 0 && (t = E(s, r._$AS(s, t.values), r, i)), t;
373
373
  }
374
374
  class Et {
@@ -388,7 +388,7 @@ class Et {
388
388
  for (; a !== void 0; ) {
389
389
  if (o === a.index) {
390
390
  let d;
391
- a.type === 2 ? d = new N(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ut(n, this, t)), this._$AV.push(d), a = i[++c];
391
+ a.type === 2 ? d = new k(n, n.nextSibling, this, t) : a.type === 1 ? d = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (d = new Ut(n, this, t)), this._$AV.push(d), a = i[++c];
392
392
  }
393
393
  o !== (a == null ? void 0 : a.index) && (n = b.nextNode(), o++);
394
394
  }
@@ -400,7 +400,7 @@ class Et {
400
400
  i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
401
401
  }
402
402
  }
403
- class N {
403
+ class k {
404
404
  get _$AU() {
405
405
  var t;
406
406
  return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
@@ -420,7 +420,7 @@ class N {
420
420
  return this._$AB;
421
421
  }
422
422
  _$AI(t, e = this) {
423
- t = E(this, t, e), O(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== v && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : St(t) ? this.k(t) : this._(t);
423
+ t = E(this, t, e), R(t) ? t === y || t == null || t === "" ? (this._$AH !== y && this._$AR(), this._$AH = y) : t !== this._$AH && t !== v && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : St(t) ? this.k(t) : this._(t);
424
424
  }
425
425
  S(t) {
426
426
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -429,11 +429,11 @@ class N {
429
429
  this._$AH !== t && (this._$AR(), this._$AH = this.S(t));
430
430
  }
431
431
  _(t) {
432
- this._$AH !== y && O(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t;
432
+ this._$AH !== y && R(this._$AH) ? this._$AA.nextSibling.data = t : this.T(S.createTextNode(t)), this._$AH = t;
433
433
  }
434
434
  $(t) {
435
435
  var n;
436
- const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = R.createElement(pt(i.h, i.h[0]), this.options)), i);
436
+ const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = N.createElement(pt(i.h, i.h[0]), this.options)), i);
437
437
  if (((n = this._$AH) == null ? void 0 : n._$AD) === r)
438
438
  this._$AH.p(e);
439
439
  else {
@@ -443,14 +443,14 @@ class N {
443
443
  }
444
444
  _$AC(t) {
445
445
  let e = it.get(t.strings);
446
- return e === void 0 && it.set(t.strings, e = new R(t)), e;
446
+ return e === void 0 && it.set(t.strings, e = new N(t)), e;
447
447
  }
448
448
  k(t) {
449
449
  ht(this._$AH) || (this._$AH = [], this._$AR());
450
450
  const e = this._$AH;
451
451
  let i, r = 0;
452
452
  for (const n of t)
453
- r === e.length ? e.push(i = new N(this.S(x()), this.S(x()), this, this.options)) : i = e[r], i._$AI(n), r++;
453
+ r === e.length ? e.push(i = new k(this.S(O()), this.S(O()), this, this.options)) : i = e[r], i._$AI(n), r++;
454
454
  r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
455
455
  }
456
456
  _$AR(t = this._$AA.nextSibling, e) {
@@ -465,7 +465,7 @@ class N {
465
465
  this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
466
466
  }
467
467
  }
468
- class j {
468
+ class D {
469
469
  get tagName() {
470
470
  return this.element.tagName;
471
471
  }
@@ -479,12 +479,12 @@ class j {
479
479
  const n = this.strings;
480
480
  let o = !1;
481
481
  if (n === void 0)
482
- t = E(this, t, e, 0), o = !O(t) || t !== this._$AH && t !== v, o && (this._$AH = t);
482
+ t = E(this, t, e, 0), o = !R(t) || t !== this._$AH && t !== v, o && (this._$AH = t);
483
483
  else {
484
484
  const c = t;
485
485
  let a, d;
486
486
  for (t = n[0], a = 0; a < n.length - 1; a++)
487
- d = E(this, c[i + a], e, a), d === v && (d = this._$AH[a]), o || (o = !O(d) || d !== this._$AH[a]), d === y ? t = y : t !== y && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
487
+ d = E(this, c[i + a], e, a), d === v && (d = this._$AH[a]), o || (o = !R(d) || d !== this._$AH[a]), d === y ? t = y : t !== y && (t += (d ?? "") + n[a + 1]), this._$AH[a] = d;
488
488
  }
489
489
  o && !r && this.j(t);
490
490
  }
@@ -492,7 +492,7 @@ class j {
492
492
  t === y ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
493
493
  }
494
494
  }
495
- class Pt extends j {
495
+ class Pt extends D {
496
496
  constructor() {
497
497
  super(...arguments), this.type = 3;
498
498
  }
@@ -500,7 +500,7 @@ class Pt extends j {
500
500
  this.element[this.name] = t === y ? void 0 : t;
501
501
  }
502
502
  }
503
- class Ct extends j {
503
+ class Ct extends D {
504
504
  constructor() {
505
505
  super(...arguments), this.type = 4;
506
506
  }
@@ -508,7 +508,7 @@ class Ct extends j {
508
508
  this.element.toggleAttribute(this.name, !!t && t !== y);
509
509
  }
510
510
  }
511
- class Mt extends j {
511
+ class Mt extends D {
512
512
  constructor(t, e, i, r, n) {
513
513
  super(t, e, i, r, n), this.type = 5;
514
514
  }
@@ -534,14 +534,14 @@ class Ut {
534
534
  E(this, t);
535
535
  }
536
536
  }
537
- const B = M.litHtmlPolyfillSupport;
538
- B == null || B(R, N), (M.litHtmlVersions ?? (M.litHtmlVersions = [])).push("3.1.3");
537
+ const B = U.litHtmlPolyfillSupport;
538
+ B == null || B(N, k), (U.litHtmlVersions ?? (U.litHtmlVersions = [])).push("3.1.3");
539
539
  const xt = (s, t, e) => {
540
540
  const i = (e == null ? void 0 : e.renderBefore) ?? t;
541
541
  let r = i._$litPart$;
542
542
  if (r === void 0) {
543
543
  const n = (e == null ? void 0 : e.renderBefore) ?? null;
544
- i._$litPart$ = r = new N(t.insertBefore(x(), n), n, void 0, e ?? {});
544
+ i._$litPart$ = r = new k(t.insertBefore(O(), n), n, void 0, e ?? {});
545
545
  }
546
546
  return r._$AI(s), r;
547
547
  };
@@ -550,7 +550,7 @@ const xt = (s, t, e) => {
550
550
  * Copyright 2017 Google LLC
551
551
  * SPDX-License-Identifier: BSD-3-Clause
552
552
  */
553
- class U extends A {
553
+ class x extends A {
554
554
  constructor() {
555
555
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
556
556
  }
@@ -576,9 +576,9 @@ class U extends A {
576
576
  }
577
577
  }
578
578
  var rt;
579
- U._$litElement$ = !0, U.finalized = !0, (rt = globalThis.litElementHydrateSupport) == null || rt.call(globalThis, { LitElement: U });
580
- const q = globalThis.litElementPolyfillSupport;
581
- q == null || q({ LitElement: U });
579
+ x._$litElement$ = !0, x.finalized = !0, (rt = globalThis.litElementHydrateSupport) == null || rt.call(globalThis, { LitElement: x });
580
+ const J = globalThis.litElementPolyfillSupport;
581
+ J == null || J({ LitElement: x });
582
582
  (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.5");
583
583
  /**
584
584
  * @license
@@ -654,6 +654,7 @@ const kt = [
654
654
  "show-pivot-button",
655
655
  "show-presets",
656
656
  "start-frame",
657
+ "token",
657
658
  "tone-mapping",
658
659
  "zoom-type"
659
660
  ], Tt = (s) => s.replace(/([-_]\w)/g, (t) => t[1].toUpperCase()), Ht = (s) => {
@@ -670,19 +671,19 @@ const kt = [
670
671
  }
671
672
  }), t;
672
673
  };
673
- var Lt = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, l = (s, t, e, i) => {
674
- for (var r = i > 1 ? void 0 : i ? jt(t, e) : t, n = s.length - 1, o; n >= 0; n--)
674
+ var Lt = Object.defineProperty, Dt = Object.getOwnPropertyDescriptor, l = (s, t, e, i) => {
675
+ for (var r = i > 1 ? void 0 : i ? Dt(t, e) : t, n = s.length - 1, o; n >= 0; n--)
675
676
  (o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
676
677
  return i && r && Lt(t, e, r), r;
677
678
  };
678
- const Dt = "{host}{viewer}/by_scene_id/{scene_id}", zt = "{host}{viewer}/by_product_id/{customer_id}/{product_id}", Bt = "{host}{viewer}/by_product_id/{customer_id}/{sku}", qt = "{host}{viewer}/by_hash/{customer_id}/{hash}";
679
- function T(s, t) {
679
+ const jt = "{host}/by_asset_id/{asset_id}", zt = "{host}{viewer}/by_scene_id/{scene_id}", Bt = "{host}{viewer}/by_product_id/{customer_id}/{product_id}", Jt = "{host}{viewer}/by_product_id/{customer_id}/{sku}", qt = "{host}{viewer}/by_hash/{customer_id}/{hash}";
680
+ function C(s, t) {
680
681
  var e = new RegExp(Object.keys(t).join("|"), "gi");
681
682
  return s.replace(e, function(i) {
682
683
  return t[i.toLowerCase()];
683
684
  });
684
685
  }
685
- let h = class extends U {
686
+ let h = class extends x {
686
687
  constructor() {
687
688
  super(...arguments), this.customerId = void 0, this.viewer = "realtime", this.host = "https://configurator.v2.londondynamics.com", this.defaultSelection = {}, this.getCurrentSelection = (s) => this._pingpongPostMessage(
688
689
  {
@@ -995,30 +996,34 @@ let h = class extends U {
995
996
  }
996
997
  render() {
997
998
  let s = null, t = null;
998
- if (console.log("this.defaultSelection?", this.defaultSelection), this.host ? this.customerId ? this.hash ? t = T(qt, {
999
+ if (this.host ? this.sceneId ? t = C(zt, {
1000
+ "{viewer}": this.viewer === "360" ? "/360" : "",
1001
+ "{host}": this.host,
1002
+ "{scene_id}": this.sceneId
1003
+ }) : this.assetId ? t = C(jt, {
1004
+ "{host}": this.host,
1005
+ "{asset_id}": this.assetId
1006
+ }) : this.customerId ? this.hash ? t = C(qt, {
999
1007
  "{viewer}": "",
1000
1008
  "{host}": this.host,
1001
1009
  "{customer_id}": this.customerId,
1002
1010
  "{hash}": this.hash
1003
- }) : this.sceneId ? t = T(Dt, {
1004
- "{viewer}": this.viewer === "360" ? "/360" : "",
1005
- "{host}": this.host,
1006
- "{customer_id}": this.customerId,
1007
- "{scene_id}": this.sceneId
1008
- }) : this.sku ? t = T(Bt, {
1011
+ }) : this.sku ? t = C(Jt, {
1009
1012
  "{viewer}": this.viewer === "360" ? "/360" : "",
1010
1013
  "{host}": this.host,
1011
1014
  "{customer_id}": this.customerId,
1012
1015
  "{sku}": this.sku
1013
- }) : this.productId ? t = T(zt, {
1016
+ }) : this.productId ? t = C(Bt, {
1014
1017
  "{viewer}": this.viewer === "360" ? "/360" : "",
1015
1018
  "{host}": this.host,
1016
1019
  "{customer_id}": this.customerId,
1017
1020
  "{product_id}": this.productId
1018
- }) : s = "Missing property: sku, scene-id, or hash" : s = "Missing property: customer-id" : s = "Missing property: host", s)
1021
+ }) : s = "Missing property: sku or hash" : s = "Missing property: customer-id, asset-id, or scene-id" : s = "Missing property: host", s)
1019
1022
  return st`<div>${s}</div>`;
1020
- let e = "";
1021
- return Object.keys(this.defaultSelection).length > 0 && (e += new URLSearchParams(this.defaultSelection).toString()), this.hasAttributes() && (Object.keys(this.defaultSelection).length > 0 && (e += "&"), e += It(this)), e.length && (t += "?" + e), st`<iframe
1023
+ const e = It(this);
1024
+ for (const [i, r] of Object.entries(this.defaultSelection))
1025
+ r && e.append(i, r);
1026
+ return e.size && (t += "?" + e), st`<iframe
1022
1027
  src="${t}"
1023
1028
  width="100%"
1024
1029
  height="100%"
@@ -1051,6 +1056,9 @@ l([
1051
1056
  l([
1052
1057
  p({ type: String })
1053
1058
  ], h.prototype, "sku", 2);
1059
+ l([
1060
+ p({ type: String, attribute: "asset-id" })
1061
+ ], h.prototype, "assetId", 2);
1054
1062
  l([
1055
1063
  p({ type: String, attribute: "scene-id" })
1056
1064
  ], h.prototype, "sceneId", 2);
@@ -1063,6 +1071,9 @@ l([
1063
1071
  l([
1064
1072
  p({ type: String })
1065
1073
  ], h.prototype, "host", 2);
1074
+ l([
1075
+ p({ type: String })
1076
+ ], h.prototype, "token", 2);
1066
1077
  l([
1067
1078
  p({ type: String, attribute: "allow-partial-match" })
1068
1079
  ], h.prototype, "allowPartialMatch", 2);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@londondynamics/pericles-webcomponent",
3
3
  "license": "MIT",
4
- "version": "2.1.1",
4
+ "version": "2.1.3",
5
5
  "type": "module",
6
6
  "keywords": [
7
7
  "configurator",