META-INF.frontend.vaadin-dev-tools.vaadin-dev-tools.js Maven / Gradle / Ivy
import"construct-style-sheets-polyfill";import{svg as B,css as y,LitElement as T,html as h,render as Se,nothing as dt}from"lit";import{property as v,state as w,customElement as k,query as ee}from"lit/decorators.js";import{classMap as et}from"lit/directives/class-map.js";import{literal as te,html as ct}from"lit/static-html.js";const ht="modulepreload",pt=function(s){return"/"+s},$e={},d=function(e,t,o){if(!t||t.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(t.map(n=>{if(n=pt(n),n in $e)return;$e[n]=!0;const r=n.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!o)for(let g=i.length-1;g>=0;g--){const x=i[g];if(x.href===n&&(!r||x.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${l}`))return;const p=document.createElement("link");if(p.rel=r?"stylesheet":ht,r||(p.as="script",p.crossOrigin=""),p.href=n,document.head.appendChild(p),r)return new Promise((g,x)=>{p.addEventListener("load",g),p.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${n}`)))})})).then(()=>e()).catch(n=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=n,window.dispatchEvent(r),!r.defaultPrevented)throw n})};function a(s,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,o);else for(var l=s.length-1;l>=0;l--)(r=s[l])&&(n=(i<3?r(n):i>3?r(e,t,n):r(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n}function ut(s){var t;const e=[];for(;s&&s.parentNode;){const o=we(s);if(o.nodeId!==-1){if((t=o.element)!=null&&t.tagName.startsWith("FLOW-CONTAINER-"))break;e.push(o)}s=s.parentElement?s.parentElement:s.parentNode.host}return e.reverse()}function we(s){const e=window.Vaadin;if(e&&e.Flow){const{clients:t}=e.Flow,o=Object.keys(t);for(const i of o){const n=t[i];if(n.getNodeId){const r=n.getNodeId(s);if(r>=0)return{nodeId:r,uiId:n.getUIId(),element:s}}}}return{nodeId:-1,uiId:-1,element:void 0}}function vt(s,e){if(s.contains(e))return!0;let t=e;const o=e.ownerDocument;for(;t&&t!==o&&t!==s;)t=t.parentNode||(t instanceof ShadowRoot?t.host:null);return t===s}const mt=(s,e)=>{const t=s[e];return t?typeof t=="function"?t():Promise.resolve(t):new Promise((o,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e)))})};var b;(function(s){s.text="text",s.checkbox="checkbox",s.range="range",s.color="color"})(b||(b={}));const N={lumoSize:["--lumo-size-xs","--lumo-size-s","--lumo-size-m","--lumo-size-l","--lumo-size-xl"],lumoSpace:["--lumo-space-xs","--lumo-space-s","--lumo-space-m","--lumo-space-l","--lumo-space-xl"],lumoBorderRadius:["0","--lumo-border-radius-m","--lumo-border-radius-l"],lumoFontSize:["--lumo-font-size-xxs","--lumo-font-size-xs","--lumo-font-size-s","--lumo-font-size-m","--lumo-font-size-l","--lumo-font-size-xl","--lumo-font-size-xxl","--lumo-font-size-xxxl"],lumoTextColor:["--lumo-header-text-color","--lumo-body-text-color","--lumo-secondary-text-color","--lumo-tertiary-text-color","--lumo-disabled-text-color","--lumo-primary-text-color","--lumo-error-text-color","--lumo-success-text-color"],basicBorderSize:["0px","1px","2px","3px"]},gt=Object.freeze(Object.defineProperty({__proto__:null,presets:N},Symbol.toStringTag,{value:"Module"})),O={textColor:{propertyName:"color",displayName:"Text color",editorType:b.color,presets:N.lumoTextColor},fontSize:{propertyName:"font-size",displayName:"Font size",editorType:b.range,presets:N.lumoFontSize,icon:"font"},fontWeight:{propertyName:"font-weight",displayName:"Bold",editorType:b.checkbox,checkedValue:"bold"},fontStyle:{propertyName:"font-style",displayName:"Italic",editorType:b.checkbox,checkedValue:"italic"}},I={backgroundColor:{propertyName:"background-color",displayName:"Background color",editorType:b.color},borderColor:{propertyName:"border-color",displayName:"Border color",editorType:b.color},borderWidth:{propertyName:"border-width",displayName:"Border width",editorType:b.range,presets:N.basicBorderSize,icon:"square"},borderRadius:{propertyName:"border-radius",displayName:"Border radius",editorType:b.range,presets:N.lumoBorderRadius,icon:"square"},padding:{propertyName:"padding",displayName:"Padding",editorType:b.range,presets:N.lumoSpace,icon:"square"},gap:{propertyName:"gap",displayName:"Spacing",editorType:b.range,presets:N.lumoSpace,icon:"square"}},ft={height:{propertyName:"height",displayName:"Size",editorType:b.range,presets:N.lumoSize,icon:"square"},paddingInline:{propertyName:"padding-inline",displayName:"Padding",editorType:b.range,presets:N.lumoSpace,icon:"square"}},_e={iconColor:{propertyName:"color",displayName:"Icon color",editorType:b.color,presets:N.lumoTextColor},iconSize:{propertyName:"font-size",displayName:"Icon size",editorType:b.range,presets:N.lumoFontSize,icon:"font"}},yt=[I.backgroundColor,I.borderColor,I.borderWidth,I.borderRadius,I.padding],bt=[O.textColor,O.fontSize,O.fontWeight,O.fontStyle],wt=[_e.iconColor,_e.iconSize],_t=Object.freeze(Object.defineProperty({__proto__:null,fieldProperties:ft,iconProperties:_e,shapeProperties:I,standardIconProperties:wt,standardShapeProperties:yt,standardTextProperties:bt,textProperties:O},Symbol.toStringTag,{value:"Module"}));function tt(s){const e=s.charAt(0).toUpperCase()+s.slice(1);return{tagName:s,displayName:e,elements:[{selector:s,displayName:"Element",properties:[I.backgroundColor,I.borderColor,I.borderWidth,I.borderRadius,I.padding,O.textColor,O.fontSize,O.fontWeight,O.fontStyle]}]}}const xt=Object.freeze(Object.defineProperty({__proto__:null,createGenericMetadata:tt},Symbol.toStringTag,{value:"Module"})),Et=s=>mt(Object.assign({"./components/defaults.ts":()=>d(()=>Promise.resolve().then(()=>_t),void 0),"./components/generic.ts":()=>d(()=>Promise.resolve().then(()=>xt),void 0),"./components/presets.ts":()=>d(()=>Promise.resolve().then(()=>gt),void 0),"./components/vaadin-accordion-heading.ts":()=>d(()=>import("./assets/vaadin-accordion-heading-c0acdd6d.js"),[]),"./components/vaadin-accordion-panel.ts":()=>d(()=>import("./assets/vaadin-accordion-panel-616e55d6.js"),[]),"./components/vaadin-accordion.ts":()=>d(()=>import("./assets/vaadin-accordion-eed3b794.js"),[]),"./components/vaadin-app-layout.ts":()=>d(()=>import("./assets/vaadin-app-layout-e56de2e9.js"),[]),"./components/vaadin-avatar.ts":()=>d(()=>import("./assets/vaadin-avatar-7599297d.js"),[]),"./components/vaadin-big-decimal-field.ts":()=>d(()=>import("./assets/vaadin-big-decimal-field-e51def24.js"),["assets/vaadin-big-decimal-field-e51def24.js","assets/vaadin-text-field-0b3db014.js","assets/vaadin-button-2511ad84.js"]),"./components/vaadin-board-row.ts":()=>d(()=>import("./assets/vaadin-board-row-c70d0c55.js"),[]),"./components/vaadin-board.ts":()=>d(()=>import("./assets/vaadin-board-828ebdea.js"),[]),"./components/vaadin-button.ts":()=>d(()=>import("./assets/vaadin-button-2511ad84.js"),[]),"./components/vaadin-chart.ts":()=>d(()=>import("./assets/vaadin-chart-5192dc15.js"),[]),"./components/vaadin-checkbox-group.ts":()=>d(()=>import("./assets/vaadin-checkbox-group-a7c65bf2.js"),["assets/vaadin-checkbox-group-a7c65bf2.js","assets/vaadin-text-field-0b3db014.js","assets/vaadin-checkbox-4e68df64.js"]),"./components/vaadin-checkbox.ts":()=>d(()=>import("./assets/vaadin-checkbox-4e68df64.js"),[]),"./components/vaadin-combo-box.ts":()=>d(()=>import("./assets/vaadin-combo-box-96451ddd.js"),["assets/vaadin-combo-box-96451ddd.js","assets/vaadin-text-field-0b3db014.js"]),"./components/vaadin-confirm-dialog.ts":()=>d(()=>import("./assets/vaadin-confirm-dialog-4d718829.js"),["assets/vaadin-confirm-dialog-4d718829.js","assets/vaadin-button-2511ad84.js"]),"./components/vaadin-cookie-consent.ts":()=>d(()=>import("./assets/vaadin-cookie-consent-46c09f8b.js"),[]),"./components/vaadin-crud.ts":()=>d(()=>import("./assets/vaadin-crud-8d161a22.js"),[]),"./components/vaadin-custom-field.ts":()=>d(()=>import("./assets/vaadin-custom-field-42c85b9e.js"),["assets/vaadin-custom-field-42c85b9e.js","assets/vaadin-text-field-0b3db014.js"]),"./components/vaadin-date-picker.ts":()=>d(()=>import("./assets/vaadin-date-picker-f2001167.js"),["assets/vaadin-date-picker-f2001167.js","assets/vaadin-text-field-0b3db014.js"]),"./components/vaadin-date-time-picker.ts":()=>d(()=>import("./assets/vaadin-date-time-picker-c8c047a7.js"),["assets/vaadin-date-time-picker-c8c047a7.js","assets/vaadin-text-field-0b3db014.js"]),"./components/vaadin-details-summary.ts":()=>d(()=>import("./assets/vaadin-details-summary-351a1448.js"),[]),"./components/vaadin-details.ts":()=>d(()=>import("./assets/vaadin-details-bf336660.js"),[]),"./components/vaadin-dialog.ts":()=>d(()=>import("./assets/vaadin-dialog-53253a08.js"),[]),"./components/vaadin-email-field.ts":()=>d(()=>import("./assets/vaadin-email-field-d7a35f04.js"),["assets/vaadin-email-field-d7a35f04.js","assets/vaadin-text-field-0b3db014.js","assets/vaadin-button-2511ad84.js"]),"./components/vaadin-form-layout.ts":()=>d(()=>import("./assets/vaadin-form-layout-47744b1d.js"),[]),"./components/vaadin-grid-pro.ts":()=>d(()=>import("./assets/vaadin-grid-pro-ff415555.js"),["assets/vaadin-grid-pro-ff415555.js","assets/vaadin-checkbox-4e68df64.js","assets/vaadin-grid-0a4791c2.js","assets/vaadin-text-field-0b3db014.js"]),"./components/vaadin-grid.ts":()=>d(()=>import("./assets/vaadin-grid-0a4791c2.js"),["assets/vaadin-grid-0a4791c2.js","assets/vaadin-checkbox-4e68df64.js"]),"./components/vaadin-horizontal-layout.ts":()=>d(()=>import("./assets/vaadin-horizontal-layout-3193943f.js"),[]),"./components/vaadin-icon.ts":()=>d(()=>import("./assets/vaadin-icon-601f36ed.js"),[]),"./components/vaadin-integer-field.ts":()=>d(()=>import("./assets/vaadin-integer-field-85078932.js"),["assets/vaadin-integer-field-85078932.js","assets/vaadin-text-field-0b3db014.js","assets/vaadin-button-2511ad84.js"]),"./components/vaadin-list-box.ts":()=>d(()=>import("./assets/vaadin-list-box-d7a8433b.js"),[]),"./components/vaadin-login-form.ts":()=>d(()=>import("./assets/vaadin-login-form-638996c6.js"),["assets/vaadin-login-form-638996c6.js","assets/vaadin-text-field-0b3db014.js","assets/vaadin-button-2511ad84.js"]),"./components/vaadin-login-overlay.ts":()=>d(()=>import("./assets/vaadin-login-overlay-f8a5db8a.js"),["assets/vaadin-login-overlay-f8a5db8a.js","assets/vaadin-text-field-0b3db014.js","assets/vaadin-button-2511ad84.js"]),"./components/vaadin-map.ts":()=>d(()=>import("./assets/vaadin-map-d40a0116.js"),[]),"./components/vaadin-menu-bar.ts":()=>d(()=>import("./assets/vaadin-menu-bar-3f5ab096.js"),[]),"./components/vaadin-message-input.ts":()=>d(()=>import("./assets/vaadin-message-input-996ac37c.js"),["assets/vaadin-message-input-996ac37c.js","assets/vaadin-text-field-0b3db014.js"]),"./components/vaadin-message-list.ts":()=>d(()=>import("./assets/vaadin-message-list-70a435ba.js"),[]),"./components/vaadin-multi-select-combo-box.ts":()=>d(()=>import("./assets/vaadin-multi-select-combo-box-a3373557.js"),["assets/vaadin-multi-select-combo-box-a3373557.js","assets/vaadin-text-field-0b3db014.js"]),"./components/vaadin-notification.ts":()=>d(()=>import("./assets/vaadin-notification-bd6eb776.js"),[]),"./components/vaadin-number-field.ts":()=>d(()=>import("./assets/vaadin-number-field-cb3ee8b2.js"),["assets/vaadin-number-field-cb3ee8b2.js","assets/vaadin-text-field-0b3db014.js","assets/vaadin-button-2511ad84.js"]),"./components/vaadin-password-field.ts":()=>d(()=>import("./assets/vaadin-password-field-d289cb18.js"),["assets/vaadin-password-field-d289cb18.js","assets/vaadin-text-field-0b3db014.js","assets/vaadin-button-2511ad84.js"]),"./components/vaadin-progress-bar.ts":()=>d(()=>import("./assets/vaadin-progress-bar-309ecf1f.js"),[]),"./components/vaadin-radio-group.ts":()=>d(()=>import("./assets/vaadin-radio-group-88b5afd8.js"),["assets/vaadin-radio-group-88b5afd8.js","assets/vaadin-text-field-0b3db014.js"]),"./components/vaadin-rich-text-editor.ts":()=>d(()=>import("./assets/vaadin-rich-text-editor-8cd892f2.js"),[]),"./components/vaadin-scroller.ts":()=>d(()=>import("./assets/vaadin-scroller-35e68818.js"),[]),"./components/vaadin-select.ts":()=>d(()=>import("./assets/vaadin-select-df6e9947.js"),["assets/vaadin-select-df6e9947.js","assets/vaadin-text-field-0b3db014.js"]),"./components/vaadin-side-nav-item.ts":()=>d(()=>import("./assets/vaadin-side-nav-item-34918f92.js"),[]),"./components/vaadin-side-nav.ts":()=>d(()=>import("./assets/vaadin-side-nav-ba80d91d.js"),[]),"./components/vaadin-split-layout.ts":()=>d(()=>import("./assets/vaadin-split-layout-80c92131.js"),[]),"./components/vaadin-spreadsheet.ts":()=>d(()=>import("./assets/vaadin-spreadsheet-59d8c5ef.js"),[]),"./components/vaadin-tab.ts":()=>d(()=>import("./assets/vaadin-tab-aaf32809.js"),[]),"./components/vaadin-tabs.ts":()=>d(()=>import("./assets/vaadin-tabs-d9a5e24e.js"),[]),"./components/vaadin-tabsheet.ts":()=>d(()=>import("./assets/vaadin-tabsheet-dd99ed9a.js"),[]),"./components/vaadin-text-area.ts":()=>d(()=>import("./assets/vaadin-text-area-83627ebc.js"),["assets/vaadin-text-area-83627ebc.js","assets/vaadin-text-field-0b3db014.js","assets/vaadin-button-2511ad84.js"]),"./components/vaadin-text-field.ts":()=>d(()=>import("./assets/vaadin-text-field-0b3db014.js"),[]),"./components/vaadin-time-picker.ts":()=>d(()=>import("./assets/vaadin-time-picker-715ec415.js"),["assets/vaadin-time-picker-715ec415.js","assets/vaadin-text-field-0b3db014.js"]),"./components/vaadin-upload.ts":()=>d(()=>import("./assets/vaadin-upload-d3c162ed.js"),["assets/vaadin-upload-d3c162ed.js","assets/vaadin-button-2511ad84.js"]),"./components/vaadin-vertical-layout.ts":()=>d(()=>import("./assets/vaadin-vertical-layout-ad4174c4.js"),[]),"./components/vaadin-virtual-list.ts":()=>d(()=>import("./assets/vaadin-virtual-list-96896203.js"),[])}),`./components/${s}.ts`);class kt{constructor(e=Et){this.loader=e,this.metadata={}}async getMetadata(e){var i;const t=(i=e.element)==null?void 0:i.localName;if(!t)return null;if(!t.startsWith("vaadin-"))return tt(t);let o=this.metadata[t];if(o)return o;try{o=(await this.loader(t)).default,this.metadata[t]=o}catch{console.warn(`Failed to load metadata for component: ${t}`)}return o||null}}const Ct=new kt,ie={crosshair:B``,square:B``,font:B``,undo:B``,redo:B``,cross:B``};var G;(function(s){s.disabled="disabled",s.enabled="enabled",s.missing_theme="missing_theme"})(G||(G={}));var _;(function(s){s.local="local",s.global="global"})(_||(_={}));function ve(s,e){return`${s}|${e}`}class V{constructor(e){this._properties={},this._metadata=e}get metadata(){return this._metadata}get properties(){return Object.values(this._properties)}getPropertyValue(e,t){return this._properties[ve(e,t)]||null}updatePropertyValue(e,t,o,i){if(!o){delete this._properties[ve(e,t)];return}let n=this.getPropertyValue(e,t);n?(n.value=o,n.modified=i||!1):(n={elementSelector:e,propertyName:t,value:o,modified:i||!1},this._properties[ve(e,t)]=n)}addPropertyValues(e){e.forEach(t=>{this.updatePropertyValue(t.elementSelector,t.propertyName,t.value,t.modified)})}getPropertyValuesForElement(e){return this.properties.filter(t=>t.elementSelector===e)}static combine(...e){if(e.length<2)throw new Error("Must provide at least two themes");const t=new V(e[0].metadata);return e.forEach(o=>t.addPropertyValues(o.properties)),t}static fromServerRules(e,t,o){const i=new V(e);return e.elements.forEach(n=>{const r=j(n,t),l=o.find(c=>c.selector===r.replace(/ > /g,">"));l&&n.properties.forEach(c=>{const p=l.properties[c.propertyName];p&&i.updatePropertyValue(n.selector,c.propertyName,p,!0)})}),i}}function j(s,e){const t=s.selector;if(e.themeScope===_.global)return t;if(!e.localClassName)throw new Error("Can not build local scoped selector without instance class name");const o=t.match(/^[\w\d-_]+/),i=o&&o[0];if(!i)throw new Error(`Selector does not start with a tag name: ${t}`);return`${i}.${e.localClassName}${t.substring(i.length,t.length)}`}function St(s,e,t,o){const i=j(s,e),n={[t]:o};return t==="border-width"&&(parseInt(o)>0?n["border-style"]="solid":n["border-style"]=""),{selector:i,properties:n}}function Tt(s){const e=Object.entries(s.properties).map(([t,o])=>`${t}: ${o};`).join(" ");return`${s.selector} { ${e} }`}let oe,Oe="";function Te(s){oe||(oe=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,oe]),Oe+=s.cssText,oe.replaceSync(Oe)}const ot=y`
.editor-row {
display: flex;
align-items: baseline;
padding: var(--theme-editor-section-horizontal-padding);
gap: 10px;
}
.editor-row > .label {
flex: 0 0 auto;
width: 120px;
}
.editor-row > .editor {
flex: 1 1 0;
}
`,Le="__vaadin-theme-editor-measure-element",Pe=/((::before)|(::after))$/,Ve=/::part\(([\w\d_-]+)\)$/;Te(y`
.__vaadin-theme-editor-measure-element {
position: absolute;
top: 0;
left: 0;
visibility: hidden;
}
`);async function At(s){const e=new V(s),t=document.createElement(s.tagName);t.classList.add(Le),document.body.append(t),s.setupElement&&await s.setupElement(t);const o={themeScope:_.local,localClassName:Le};try{s.elements.forEach(i=>{Me(t,i,o,!0);let n=j(i,o);const r=n.match(Pe);n=n.replace(Pe,"");const l=n.match(Ve),c=n.replace(Ve,"");let p=document.querySelector(c);if(p&&l){const z=`[part~="${l[1]}"]`;p=p.shadowRoot.querySelector(z)}if(!p)return;p.style.transition="none";const g=r?r[1]:null,x=getComputedStyle(p,g);i.properties.forEach(D=>{const z=x.getPropertyValue(D.propertyName)||D.defaultValue||"";e.updatePropertyValue(i.selector,D.propertyName,z)}),Me(t,i,o,!1)})}finally{try{s.cleanupElement&&await s.cleanupElement(t)}finally{t.remove()}}return e}function Me(s,e,t,o){if(e.stateAttribute){if(e.stateElementSelector){const i=j({...e,selector:e.stateElementSelector},t);s=document.querySelector(i)}s&&(o?s.setAttribute(e.stateAttribute,""):s.removeAttribute(e.stateAttribute))}}function De(s){return s.trim()}function Rt(s){const e=s.element;if(!e)return null;const t=e.querySelector("label");if(t&&t.textContent)return De(t.textContent);const o=e.textContent;return o?De(o):null}class It{constructor(){this._localClassNameMap=new Map}get stylesheet(){return this.ensureStylesheet(),this._stylesheet}add(e){this.ensureStylesheet(),this._stylesheet.replaceSync(e)}clear(){this.ensureStylesheet(),this._stylesheet.replaceSync("")}previewLocalClassName(e,t){if(!e)return;const o=this._localClassNameMap.get(e);o&&(e.classList.remove(o),e.overlayClass=null),t?(e.classList.add(t),e.overlayClass=t,this._localClassNameMap.set(e,t)):this._localClassNameMap.delete(e)}ensureStylesheet(){this._stylesheet||(this._stylesheet=new CSSStyleSheet,this._stylesheet.replaceSync(""),document.adoptedStyleSheets=[...document.adoptedStyleSheets,this._stylesheet])}}const U=new It;var R;(function(s){s.response="themeEditorResponse",s.loadComponentMetadata="themeEditorComponentMetadata",s.setLocalClassName="themeEditorLocalClassName",s.setCssRules="themeEditorRules",s.loadRules="themeEditorLoadRules",s.history="themeEditorHistory",s.openCss="themeEditorOpenCss",s.markAsUsed="themeEditorMarkAsUsed"})(R||(R={}));var xe;(function(s){s.ok="ok",s.error="error"})(xe||(xe={}));class Nt{constructor(e){this.pendingRequests={},this.requestCounter=0,this.wrappedConnection=e;const t=this.wrappedConnection.onMessage;this.wrappedConnection.onMessage=o=>{o.command===R.response?this.handleResponse(o.data):t.call(this.wrappedConnection,o)}}sendRequest(e,t){const o=(this.requestCounter++).toString(),i=t.uiId??this.getGlobalUiId();return new Promise((n,r)=>{this.wrappedConnection.send(e,{...t,requestId:o,uiId:i}),this.pendingRequests[o]={resolve:n,reject:r}})}handleResponse(e){const t=this.pendingRequests[e.requestId];if(!t){console.warn("Received response for unknown request");return}delete this.pendingRequests[e.requestId],e.code===xe.ok?t.resolve(e):t.reject(e)}loadComponentMetadata(e){return this.sendRequest(R.loadComponentMetadata,{nodeId:e.nodeId})}setLocalClassName(e,t){return this.sendRequest(R.setLocalClassName,{nodeId:e.nodeId,className:t})}setCssRules(e){return this.sendRequest(R.setCssRules,{rules:e})}loadRules(e){return this.sendRequest(R.loadRules,{selectors:e})}markAsUsed(){return this.sendRequest(R.markAsUsed,{})}undo(e){return this.sendRequest(R.history,{undo:e})}redo(e){return this.sendRequest(R.history,{redo:e})}openCss(e){return this.sendRequest(R.openCss,{selector:e})}getGlobalUiId(){if(this.globalUiId===void 0){const e=window.Vaadin;if(e&&e.Flow){const{clients:t}=e.Flow,o=Object.keys(t);for(const i of o){const n=t[i];if(n.getNodeId){this.globalUiId=n.getUIId();break}}}}return this.globalUiId??-1}}const E={index:-1,entries:[]};class $t{constructor(e){this.api=e}get allowUndo(){return E.index>=0}get allowRedo(){return E.index
${this.propertyMetadata.displayName}
${(e=this.propertyValue)!=null&&e.modified?h``:null}
${this.renderEditor()}
CSS class name
Please enter a valid CSS class name`:null}
Edit styles for this ${t}
Edit styles for all ${o}
${null}
${null}
`);e.appendChild(n.content.cloneNode(!0));const r=e.querySelector(`[part=${t}]`);r.addEventListener("mousedown",this),r.addEventListener("touchstart",this),r.addEventListener("keydown",this),this.el=r,this.xy=i,this.nodes=[r.firstChild,r]}set dragging(e){const t=e?document.addEventListener:document.removeEventListener;t(q?"touchmove":"mousemove",this),t(q?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!Bt(e)||!q&&e.button!=0)return;this.el.focus(),qe(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),qe(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":qt(this,e);break}}style(e){e.forEach((t,o)=>{for(const i in t)this.nodes[o].style.setProperty(i,t[i])})}}class Ft extends Re{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:`${e/360*100}%`,color:Ee({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${C(e)}`)}getMove(e,t){return{h:t?W(this.h+e.x*360,0,360):360*e.x}}}class Gt extends Re{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:Ee(e)},{"background-color":Ee({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${C(e.s)}%, Brightness ${C(e.v)}%`)}getMove(e,t){return{s:t?W(this.hsva.s+e.x*100,0,100):e.x*100,v:t?W(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}}const jt=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}',Wt="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}",Kt="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}",se=Symbol("same"),ge=Symbol("color"),Fe=Symbol("hsva"),fe=Symbol("update"),Ge=Symbol("parts"),le=Symbol("css"),de=Symbol("sliders");let Yt=class extends HTMLElement{static get observedAttributes(){return["color"]}get[le](){return[jt,Wt,Kt]}get[de](){return[Gt,Ft]}get color(){return this[ge]}set color(e){if(!this[se](e)){const t=this.colorModel.toHsva(e);this[fe](t),this[ge]=e}}constructor(){super();const e=it(``),t=this.attachShadow({mode:"open"});t.appendChild(e.content.cloneNode(!0)),t.addEventListener("move",this),this[Ge]=this[de].map(o=>new o(t))}connectedCallback(){if(this.hasOwnProperty("color")){const e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,t,o){const i=this.colorModel.fromAttr(o);this[se](i)||(this.color=i)}handleEvent(e){const t=this[Fe],o={...t,...e.detail};this[fe](o);let i;!Ut(o,t)&&!this[se](i=this.colorModel.fromHsva(o))&&(this[ge]=i,Ae(this,"color-changed",{value:i}))}[se](e){return this.color&&this.colorModel.equal(e,this.color)}[fe](e){this[Fe]=e,this[Ge].forEach(t=>t.update(e))}};class Jt extends Re{constructor(e){super(e,"alpha",'aria-label="Alpha" aria-valuemin="0" aria-valuemax="1"',!1)}update(e){this.hsva=e;const t=me({...e,a:0}),o=me({...e,a:1}),i=e.a*100;this.style([{left:`${i}%`,color:me(e)},{"--gradient":`linear-gradient(90deg, ${t}, ${o}`}]);const n=C(i);this.el.setAttribute("aria-valuenow",`${n}`),this.el.setAttribute("aria-valuetext",`${n}%`)}getMove(e,t){return{a:t?W(this.hsva.a+e.x):e.x}}}const Xt=`[part=alpha]{flex:0 0 24px}[part=alpha]::after{display:block;content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-radius:inherit;background-image:var(--gradient);box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part^=alpha]{background-color:#fff;background-image:url('data:image/svg+xml,')}[part=alpha-pointer]{top:50%}`;class Zt extends Yt{get[le](){return[...super[le],Xt]}get[de](){return[...super[de],Jt]}}const Qt={defaultColor:"rgba(0, 0, 0, 1)",toHsva:Dt,fromHsva:Mt,equal:Ht,fromAttr:s=>s};class eo extends Zt{get colorModel(){return Qt}}/**
* @license
* Copyright (c) 2017 - 2023 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/function to(s){const e=[];for(;s;){if(s.nodeType===Node.DOCUMENT_NODE){e.push(s);break}if(s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){e.push(s),s=s.host;continue}if(s.assignedSlot){s=s.assignedSlot;continue}s=s.parentNode}return e}const ye={start:"top",end:"bottom"},be={start:"left",end:"right"},je=new ResizeObserver(s=>{setTimeout(()=>{s.forEach(e=>{e.target.__overlay&&e.target.__overlay._updatePosition()})})}),oo=s=>class extends s{static get properties(){return{positionTarget:{type:Object,value:null},horizontalAlign:{type:String,value:"start"},verticalAlign:{type:String,value:"top"},noHorizontalOverlap:{type:Boolean,value:!1},noVerticalOverlap:{type:Boolean,value:!1},requiredVerticalSpace:{type:Number,value:0}}}static get observers(){return["__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)","__overlayOpenedChanged(opened, positionTarget)"]}constructor(){super(),this.__onScroll=this.__onScroll.bind(this),this._updatePosition=this._updatePosition.bind(this)}connectedCallback(){super.connectedCallback(),this.opened&&this.__addUpdatePositionEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.__removeUpdatePositionEventListeners()}__addUpdatePositionEventListeners(){window.addEventListener("resize",this._updatePosition),this.__positionTargetAncestorRootNodes=to(this.positionTarget),this.__positionTargetAncestorRootNodes.forEach(t=>{t.addEventListener("scroll",this.__onScroll,!0)})}__removeUpdatePositionEventListeners(){window.removeEventListener("resize",this._updatePosition),this.__positionTargetAncestorRootNodes&&(this.__positionTargetAncestorRootNodes.forEach(t=>{t.removeEventListener("scroll",this.__onScroll,!0)}),this.__positionTargetAncestorRootNodes=null)}__overlayOpenedChanged(t,o){if(this.__removeUpdatePositionEventListeners(),o&&(o.__overlay=null,je.unobserve(o),t&&(this.__addUpdatePositionEventListeners(),o.__overlay=this,je.observe(o))),t){const i=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach(n=>{this.__margins[n]=parseInt(i[n],10)})),this.setAttribute("dir",i.direction),this._updatePosition(),requestAnimationFrame(()=>this._updatePosition())}}__positionSettingsChanged(){this._updatePosition()}__onScroll(t){this.contains(t.target)||this._updatePosition()}_updatePosition(){if(!this.positionTarget||!this.opened)return;const t=this.positionTarget.getBoundingClientRect(),o=this.__shouldAlignStartVertically(t);this.style.justifyContent=o?"flex-start":"flex-end";const i=this.__isRTL,n=this.__shouldAlignStartHorizontally(t,i),r=!i&&n||i&&!n;this.style.alignItems=r?"flex-start":"flex-end";const l=this.getBoundingClientRect(),c=this.__calculatePositionInOneDimension(t,l,this.noVerticalOverlap,ye,this,o),p=this.__calculatePositionInOneDimension(t,l,this.noHorizontalOverlap,be,this,n);Object.assign(this.style,c,p),this.toggleAttribute("bottom-aligned",!o),this.toggleAttribute("top-aligned",o),this.toggleAttribute("end-aligned",!r),this.toggleAttribute("start-aligned",r)}__shouldAlignStartHorizontally(t,o){const i=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const n=Math.min(window.innerWidth,document.documentElement.clientWidth),r=!o&&this.horizontalAlign==="start"||o&&this.horizontalAlign==="end";return this.__shouldAlignStart(t,i,n,this.__margins,r,this.noHorizontalOverlap,be)}__shouldAlignStartVertically(t){const o=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const i=Math.min(window.innerHeight,document.documentElement.clientHeight),n=this.verticalAlign==="top";return this.__shouldAlignStart(t,o,i,this.__margins,n,this.noVerticalOverlap,ye)}__shouldAlignStart(t,o,i,n,r,l,c){const p=i-t[l?c.end:c.start]-n[c.end],g=t[l?c.start:c.end]-n[c.start],x=r?p:g,z=x>(r?g:p)||x>o;return r===z}__adjustBottomProperty(t,o,i){let n;if(t===o.end){if(o.end===ye.end){const r=Math.min(window.innerHeight,document.documentElement.clientHeight);if(i>r&&this.__oldViewportHeight){const l=this.__oldViewportHeight-r;n=i-l}this.__oldViewportHeight=r}if(o.end===be.end){const r=Math.min(window.innerWidth,document.documentElement.clientWidth);if(i>r&&this.__oldViewportWidth){const l=this.__oldViewportWidth-r;n=i-l}this.__oldViewportWidth=r}}return n}__calculatePositionInOneDimension(t,o,i,n,r,l){const c=l?n.start:n.end,p=l?n.end:n.start,g=parseFloat(r.style[c]||getComputedStyle(r)[c]),x=this.__adjustBottomProperty(c,n,g),D=o[l?n.start:n.end]-t[i===l?n.end:n.start],z=x?`${x}px`:`${g+D*(l?-1:1)}px`;return{[c]:z,[p]:""}}};class so extends CustomEvent{constructor(e){super("color-picker-change",{detail:{value:e}})}}const nt=y`
:host {
--preview-size: 24px;
--preview-color: rgba(0, 0, 0, 0);
}
.preview {
--preview-bg-size: calc(var(--preview-size) / 2);
--preview-bg-pos: calc(var(--preview-size) / 4);
width: var(--preview-size);
height: var(--preview-size);
padding: 0;
position: relative;
overflow: hidden;
background: none;
border: solid 2px #888;
border-radius: 4px;
box-sizing: content-box;
}
.preview::before,
.preview::after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.preview::before {
content: '';
background: white;
background-image: linear-gradient(45deg, #666 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #666 75%), linear-gradient(45deg, transparent 75%, #666 75%),
linear-gradient(45deg, #666 25%, transparent 25%);
background-size: var(--preview-bg-size) var(--preview-bg-size);
background-position: 0 0, 0 0, calc(var(--preview-bg-pos) * -1) calc(var(--preview-bg-pos) * -1),
var(--preview-bg-pos) var(--preview-bg-pos);
}
.preview::after {
content: '';
background-color: var(--preview-color);
}
`;let Z=class extends T{constructor(){super(...arguments),this.commitValue=!1}static get styles(){return[nt,y`
#toggle {
display: block;
}
`]}update(e){super.update(e),e.has("value")&&this.overlay&&this.overlay.requestContentUpdate()}firstUpdated(){this.overlay=document.createElement("vaadin-dev-tools-color-picker-overlay"),this.overlay.renderer=this.renderOverlayContent.bind(this),this.overlay.owner=this,this.overlay.positionTarget=this.toggle,this.overlay.noVerticalOverlap=!0,this.overlay.addEventListener("vaadin-overlay-escape-press",this.handleOverlayEscape.bind(this)),this.overlay.addEventListener("vaadin-overlay-close",this.handleOverlayClose.bind(this)),this.append(this.overlay)}render(){const e=this.value||"rgba(0, 0, 0, 0)";return h` `}open(){this.commitValue=!1,this.overlay.opened=!0,this.overlay.style.zIndex="1000000";const e=this.overlay.shadowRoot.querySelector('[part="overlay"]');e.style.background="#333"}renderOverlayContent(e){const o=getComputedStyle(this.toggle,"::after").getPropertyValue("background-color");Se(h`
${e}
`}handlePickerChange(e){this.dispatchEvent(new CustomEvent("color-changed",{detail:{value:e.detail.value}}))}selectPreset(e){this.dispatchEvent(new CustomEvent("color-changed",{detail:{value:e,close:!0}}))}};a([v({})],ce.prototype,"value",void 0);a([v({})],ce.prototype,"presets",void 0);ce=a([k("vaadin-dev-tools-color-picker-overlay-content")],ce);customElements.whenDefined("vaadin-overlay").then(()=>{const s=customElements.get("vaadin-overlay");class e extends oo(s){}customElements.define("vaadin-dev-tools-color-picker-overlay",e)});customElements.define("vaadin-dev-tools-rgba-string-color-picker",eo);let We=class extends A{constructor(){super(...arguments),this.presets=new ne}static get styles(){return[A.styles,y`
.editor-row {
align-items: center;
}
.editor-row > .editor {
display: flex;
align-items: center;
gap: 0.5rem;
}
`]}update(e){e.has("propertyMetadata")&&(this.presets=new ne(this.propertyMetadata)),super.update(e)}renderEditor(){var e;return h`
${e}
`}renderSection(e){const t=e.properties.map(o=>this.renderPropertyEditor(e,o));return h`
${e.displayName}
${t}
${(e=this.options)==null?void 0:e.infoTemplate}
${this.components.map((t,o)=>h`
${t.element.tagName.toLowerCase()}
`)}
${this.renderPicker()}
${this.renderLocalClassNameEditor()}
${(e=this.context)!=null&&e.metadata?h` `:null}
It looks like you have not set up an application theme yet. Theme editor requires an existing theme to work
with. Please check our
documentation
on how to set up an application theme.
`}renderPropertyList(){if(!this.context)return null;if(!this.context.metadata){const t=this.context.component.element.localName;return h`
Styling
`}if(this.context.scope===_.local&&!this.context.accessible){const t=this.context.metadata.displayName;return h`
${this.context.metadata.notAccessibleDescription&&this.context.scope===_.local?h`<${t}>
components is not supported at the moment.${this.context.metadata.notAccessibleDescription}
The selected ${t} cannot be styled locally. Currently, Theme Editor only supports styling
instances that are assigned to a local variable, like so:
`}return h` ${this.context.metadata.description&&this.context.scope===_.local?h`Button saveButton = new Button("Save");
If you want to modify the code so that it satisfies this requirement,
to open it in your IDE. Alternatively you can choose to style all ${t}s by selecting "Global" from
the scope dropdown above.
${this.context.metadata.description}
Locate the component to style
Use the mouse cursor to highlight components in the UI.
Use arrow down/up to cycle through and highlight specific components under the cursor.
Click the primary mouse button to select the component.
Component: ${e.product.name} ${e.product.version}
`.replace(/https:([^ ]*)/g,"https:$1");s.isConnected&&(s.outerHTML=`${o}
-
${this.serverInfo.versions.map(e=>h`
- ${e.name}
- ${e.version} `)}
- Browser
- ${navigator.userAgent}
- Live reload
- Java ${this._devTools.javaStatus} ${this._devTools.backend?`(${u.BACKEND_DISPLAY_NAME[this._devTools.backend]})`:""}
- Front end ${this._devTools.frontendStatus}
${this.notifications.map(e=>this.renderMessage(e))}
this.toggleExpanded()}
>
${this.unreadErrors?h``:h``}
${this.splashMessage?h`${this.splashMessage}
`:dt}