@node-projects/web-component-designer 0.2.16 → 0.2.17
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,7 +2,7 @@ import { BaseServiceContainer } from './BaseServiceContainer.js';
|
|
|
2
2
|
import { DemoView } from '../widgets/demoView/demoView.js';
|
|
3
3
|
import { GlobalContext } from './GlobalContext.js';
|
|
4
4
|
import { CodeViewSimple } from '../widgets/codeView/code-view-simple.js';
|
|
5
|
-
const
|
|
5
|
+
const isTouchUi = navigator.maxTouchPoints > 0;
|
|
6
6
|
export class ServiceContainer extends BaseServiceContainer {
|
|
7
7
|
config = {
|
|
8
8
|
codeViewWidget: CodeViewSimple,
|
|
@@ -27,7 +27,7 @@ export class ServiceContainer extends BaseServiceContainer {
|
|
|
27
27
|
options = {
|
|
28
28
|
zoomDesignerBackground: true,
|
|
29
29
|
roundPixelsToDecimalPlaces: 0,
|
|
30
|
-
resizerPixelSize:
|
|
30
|
+
resizerPixelSize: isTouchUi ? 8 : 3
|
|
31
31
|
};
|
|
32
32
|
designerTools = new Map();
|
|
33
33
|
get bindingService() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceContainer.js","sourceRoot":"","sources":["../../../src/elements/services/ServiceContainer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAMjE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAM3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAmBnD,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AA+DzE,MAAM,
|
|
1
|
+
{"version":3,"file":"ServiceContainer.js","sourceRoot":"","sources":["../../../src/elements/services/ServiceContainer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAMjE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAM3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAmBnD,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AA+DzE,MAAM,SAAS,GAAG,SAAS,CAAC,cAAc,GAAG,CAAC,CAAC;AAC/C,MAAM,OAAO,gBAAiB,SAAQ,oBAAoC;IAE/D,MAAM,GAIX;QACA,cAAc,EAAE,cAAc;QAC9B,cAAc,EAAE,QAAQ;KACzB,CAAC;IAEY,kBAAkB,GAAgE,IAAI,GAAG,EAAE,CAAC;IAE5G,6BAA6B,CAAC,SAAmC,EAAE,MAA0D;QAC3H,MAAM,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC5D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC,WAAW,KAAK,MAAM,EAAE,CAAC;gBAC3C,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;IAEe,wCAAwC,GAAqE,EAAE,CAAC;IAEhH,uBAAuB,GAAuC,EAAE,CAAC;IAEjE,wBAAwB,GAAuC,EAAE,CAAC;IAElE,yBAAyB,GAAwC,EAAE,CAAC;IAE7E,6BAA6B,CAA0B;IAE9C,gCAAgC,GAAoB,EAAE,CAAC;IAEvD,aAAa,GAAkB,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IAEvD,OAAO,GAAG;QACxB,sBAAsB,EAAE,IAAI;QAC5B,0BAA0B,EAAE,CAAC;QAC7B,gBAAgB,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACpC,CAAC;IAEc,aAAa,GAA0E,IAAI,GAAG,EAAE,CAAC;IAEjH,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,uBAAuB;QACzB,OAAO,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,6BAA6B;QAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,+BAA+B,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,2BAA2B;QAC7B,OAAO,IAAI,CAAC,cAAc,CAAC,6BAA6B,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,0BAA0B;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC;IACvD,CAAC;IAED,IAAI,kBAAkB;QACpB,OAAO,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,oBAAoB;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAC,cAAc,CAAC,0BAA0B,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,2BAA2B;QAC7B,OAAO,IAAI,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;IAClD,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;IAClD,CAAC;IAED,IAAI,oBAAoB;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,qBAAqB;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,uBAAuB;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,yBAAyB,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;IAClD,CAAC;IAED,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAC,cAAc,CAAC,0BAA0B,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,oBAAoB;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;IAClD,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAC9C,CAAC;IAED,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
package/dist/index-min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ra=Object.defineProperty;var cu=Object.getOwnPropertyDescriptor;var hu=Object.getOwnPropertyNames;var du=Object.prototype.hasOwnProperty;var g=(s,e)=>()=>(s&&(e=s(s=0)),e);var Ud=(s,e)=>{for(var t in e)Ra(s,t,{get:e[t],enumerable:!0})},pu=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of hu(e))!du.call(s,r)&&r!==t&&Ra(s,r,{get:()=>e[r],enumerable:!(i=cu(e,r))||i.enumerable});return s};var Yd=s=>pu(Ra({},"__esModule",{value:!0}),s);function hi(s){let e=s?.trim()??"";if(!e)return{kind:"empty"};let t=e.match(/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))(?:([a-z%]+))?$/i);if(!t)return{kind:"text",text:e};let i=Number(t[1]);return Number.isNaN(i)?{kind:"text",text:e}:{kind:"numeric",numberText:t[1],value:i,unit:t[2]?.toLowerCase()??""}}function Lr(s,e=4){if(!Number.isFinite(s))return"0";let t=10**Math.max(0,e),i=Math.round(s*t)/t;return Object.is(i,-0)?"0":`${i}`}function di(s,e){let t=s?.trim()??"";return t?t+(e??""):""}function Kd(s){return s===""?" ":s}function $d(s){let e=(s??[]).map(t=>t==null?null:t.trim()).filter(t=>t!=null);return[...new Set(e)]}function Zd(s,e,t){return s!=null&&t.includes(s)?s:e??t[0]??null}function Qd(s,e,t){if(t!=null){let i=s?.[t];if(Number.isFinite(i)&&i>0)return i}return e}var Fa=g(()=>{"use strict"});import{BaseCustomWebComponentConstructorAppend as gu,css as yu,html as vu,TypedEvent as za}from"@node-projects/base-custom-webcomponent";var Ba,xu,Qi,Ha=g(()=>{"use strict";Fa();Fa();Ba="__node-projects-custom-value__",xu="\u22EE",Qi=class extends gu{static style=yu`:host{display:block;width:100%;min-width:0}#container{display:grid;gap:0;grid-template-columns:minmax(0,1fr) auto 16px;width:100%;height:24px;align-items:stretch}#value-wrapper{display:grid;grid-template-columns:14px minmax(0,1fr);min-width:0}#input,#scrubber,#select,#stepper button{border:none;box-sizing:border-box;height:24px;min-height:24px;background:0 0;color:inherit;font:inherit;outline:0;box-shadow:none}#scrubber,#stepper button{padding:0;line-height:1}#scrubber{border-right:0;cursor:ns-resize;font-size:11px;letter-spacing:-1px}#input{border-left:0;border-right:0;min-width:0;text-align:right}#input:focus,#scrubber:focus,#select:focus,#stepper button:focus{outline:0;box-shadow:none;border-color:var(--input-border-color,#596c7a)}#input[disabled],#scrubber[disabled]{cursor:default}#input[disabled]{color:inherit;opacity:1;-webkit-text-fill-color:currentColor}#select{border-left:0;padding:0 15px 0 2px;line-height:1;-webkit-appearance:none;appearance:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4'%3E%3Cpath d='M0 0l4 4 4-4z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 2px center}#measure{position:absolute;visibility:hidden;white-space:nowrap;font:inherit;pointer-events:none}#stepper{display:grid;height:24px;min-height:24px;overflow:hidden;grid-template-rows:repeat(2,minmax(0,1fr))}#stepper button{height:auto;min-height:0;width:16px;min-width:16px;font-size:10px}`;static template=vu`<div id="container"><div id="value-wrapper"><button id="scrubber" type="button" aria-label="Drag to change value">${xu}</button> <input id="input" type="text" spellcheck="false"></div><select id="select"></select><div id="stepper"><button id="increase" type="button" aria-label="Increase value">+</button> <button id="decrease" type="button" aria-label="Decrease value">-</button></div><span id="measure"></span></div>`;_value="";get value(){return this._value}set value(e){this._setValue(e,!1,!1)}valueChanged=new za;valuePreviewChanged=new za;valuePreviewFinished=new za;_units=["px","%","pt"];get units(){return[...this._units]}set units(e){this._units=this._normalizeOptionValues(e),this._lastNumericUnit=this._units[0]??this._lastNumericUnit,this._updateValue()}_fixedValues=[];get fixedValues(){return[...this._fixedValues]}set fixedValues(e){this._fixedValues=this._normalizeOptionValues(e),this._updateValue()}_step=1;get step(){return this._step}set step(e){this._step=Number.isFinite(e)&&e>0?e:1}_unitSteps={};get unitSteps(){return{...this._unitSteps}}set unitSteps(e){this._unitSteps=e??{}}_min=null;get min(){return this._min}set min(e){this._min=Number.isFinite(e)?e:null}_max=null;get max(){return this._max}set max(e){this._max=Number.isFinite(e)?e:null}_readOnly=!1;get readOnly(){return this._readOnly}set readOnly(e){this._readOnly=e,this._applyReadonlyState()}get isInPreview(){return this._previewStartValue!=null}_allowCustomValue=!0;get allowCustomValue(){return this._allowCustomValue}set allowCustomValue(e){this._allowCustomValue=e,this._updateValue()}_unitValueConverter;get unitValueConverter(){return this._unitValueConverter}set unitValueConverter(e){this._unitValueConverter=e}_input;_select;_measure;_scrubberButton;_increaseButton;_decreaseButton;_lastNumericValue=0;_lastNumericUnit="px";_dragPointerId=null;_dragStartY=0;_dragStartNumericValue=0;_appliedDragSteps=0;_previewStartValue=null;_previewChanged=!1;_displayValueLock=null;_stepperPointerId=null;_stepperDirection=0;_stepperRepeatTimeout=null;_stepperRepeatInterval=null;_windowDragPointerMoveHandler=e=>this._handleWindowDragPointerMove(e);_windowDragPointerUpHandler=e=>this._finishDragInteractionForPointerEvent(e,!1);_windowDragPointerCancelHandler=e=>this._finishDragInteractionForPointerEvent(e,!0);_windowDragBlurHandler=()=>this._finishDragInteraction(!1);_windowPointerUpHandler=e=>this._handleWindowStepperPointerEnd(e);_windowPointerCancelHandler=e=>this._handleWindowStepperPointerEnd(e);_windowBlurHandler=()=>this._finishStepperInteraction(!1);_preferCustomMode=!1;constructor(){super(),this._restoreCachedInititalValues(),this._input=this._getDomElement("input"),this._select=this._getDomElement("select"),this._measure=this._getDomElement("measure"),this._scrubberButton=this._getDomElement("scrubber"),this._increaseButton=this._getDomElement("increase"),this._decreaseButton=this._getDomElement("decrease")}ready(){this._parseAttributesToProperties(),this._wireEvents(),this._updateValue()}_wireEvents(){this._input.addEventListener("change",()=>this._applyTypedValue()),this._input.addEventListener("keydown",e=>{e.key==="Enter"&&(this._applyTypedValue(),this._input.blur())}),this._scrubberButton.addEventListener("pointerdown",e=>this._handlePointerDown(e)),this._select.addEventListener("change",()=>this._applySelectedMode()),this._increaseButton.addEventListener("pointerdown",e=>this._handleStepperPointerDown(e,1)),this._decreaseButton.addEventListener("pointerdown",e=>this._handleStepperPointerDown(e,-1))}_handlePointerDown(e){if(!this._readOnly&&!(!this._isSelectedUnitMode()&&!this._switchToUnitModeForInteraction())){this._dragPointerId=e.pointerId,this._dragStartY=e.clientY,this._dragStartNumericValue=this._readEditableNumericValue(this._select.value),this._appliedDragSteps=0,this._startPreviewSession(),this._attachDragWindowListeners();try{this._scrubberButton.setPointerCapture(e.pointerId)}catch{}e.preventDefault()}}_handleWindowDragPointerMove(e){if(this._dragPointerId!==e.pointerId||!this._isSelectedUnitMode())return;let t=this._calculateDraggedStepCount(this._dragStartY-e.clientY);if(t===this._appliedDragSteps)return;this._appliedDragSteps=t;let i=this._select.value,r=this._getEffectiveStep(i);this._previewNumericValue(this._getInteractiveStepValue(this._dragStartNumericValue,t,r),i,r),e.preventDefault()}_finishDragInteractionForPointerEvent(e,t){this._dragPointerId===e.pointerId&&this._finishDragInteraction(t,e.pointerId)}_finishDragInteraction(e,t){if(this._dragPointerId!=null){if(this._dragPointerId=null,this._appliedDragSteps=0,this._detachDragWindowListeners(),t!=null)try{this._scrubberButton.hasPointerCapture(t)&&this._scrubberButton.releasePointerCapture(t)}catch{}this._finishPreviewSession(e)}}_handleStepperPointerDown(e,t){this._readOnly||!this._isSelectedUnitMode()&&!this._switchToUnitModeForInteraction()||(this._finishStepperInteraction(!0),this._stepperPointerId=e.pointerId,this._stepperDirection=t,this._attachStepperWindowListeners(),this._startPreviewSession(),this._applyStepPreview(t),this._stepperRepeatTimeout=window.setTimeout(()=>{this._stepperRepeatInterval=window.setInterval(()=>this._applyStepPreview(this._stepperDirection),50)},350),e.preventDefault())}_handleWindowStepperPointerEnd(e){this._stepperPointerId===e.pointerId&&this._finishStepperInteraction(!1)}_finishStepperInteraction(e){this._stepperPointerId!=null&&(this._stepperPointerId=null,this._stepperDirection=0,this._detachStepperWindowListeners(),this._stopStepperRepeat(),this._finishPreviewSession(e))}_applySelectedMode(){let e=this._select.selectedOptions.item(0);if(!e)return;let t=e.dataset.kind;if(t==="fixed"){this._commitValue(e.value);return}if(t==="custom"){this._preferCustomMode=!0,this._updateValue(),requestAnimationFrame(()=>{this._input.focus(),this._input.select()});return}let i=e.value;this._lastNumericUnit=i,this._preferCustomMode=!1;let r=hi(this._value);if(r.kind==="numeric"){let a=this._convertNumericValue(r,i);this._commitValue(a);return}let n=this._resolveCurrentValueForUnit(i);if(n!=null){this._commitValue(n);return}if(r.kind==="empty"){this._updateValue(),this._input.focus();return}let o=Number(this._input.value);if(!Number.isNaN(o)){this._applyNumericValue(o,i);return}this._commitValue(""),this._input.focus()}_applyTypedValue(){let e=this._select.selectedOptions.item(0),t=e?.dataset.kind;if(t==="fixed")return;if(t==="custom"){this._commitValue(this._input.value);return}let i=this._input.value?.trim()??"";if(!i){this._commitValue("");return}let r=Number(i);Number.isNaN(r)||(this._lastNumericValue=this._clampNumericValue(r)),this._commitValue(di(i,e?.value??""))}_updateValue(){if(!this._input||!this._select)return;this._previewStartValue==null&&this._renderSelectOptions();let e=this._getDisplayState(this._displayValueLock??this._value);if(this._input.value=e.inputValue,this._input.style.display=e.inputVisible?"":"none",this._input.disabled=this._readOnly||!e.inputEnabled,this._select.value=e.selectValue,this._autoSizeSelect(),e.mode==="unit"&&e.selectedUnit!=null&&(this._lastNumericUnit=e.selectedUnit),e.mode==="unit"&&e.inputValue!==""){let r=Number(e.inputValue);Number.isNaN(r)||(this._lastNumericValue=this._clampNumericValue(r))}let t=this._units.length>0,i=this._readOnly||!t||e.mode==="custom";this._scrubberButton.disabled=i,this._increaseButton.disabled=i,this._decreaseButton.disabled=i,this._applyReadonlyState()}_getDisplayState(e){let t=hi(e);if(t.kind==="numeric"){if(this._preferCustomMode)return this._createCustomDisplayState(t.numberText);if(t.unit&&this._units.length&&!this._units.includes(t.unit))return this._createCustomDisplayState(e);let r=Zd(t.unit,this._lastNumericUnit,this._units)??"";return{mode:"unit",inputValue:t.numberText,inputVisible:!0,inputEnabled:!0,selectValue:this._units.includes(r)?r:this._select.value||Ba,selectedUnit:r}}if(t.kind==="text")return!this._preferCustomMode&&this._fixedValues.includes(t.text)?{mode:"fixed",inputValue:"",inputVisible:!0,inputEnabled:!1,selectValue:t.text}:this._createCustomDisplayState(t.text);if(this._preferCustomMode)return this._createCustomDisplayState("");let i=this._lastNumericUnit??this._units[0]??"";return this._units.includes(i)?{mode:"unit",inputValue:"",inputVisible:!0,inputEnabled:!0,selectValue:i,selectedUnit:i}:this._createCustomDisplayState("")}_createCustomDisplayState(e){return!this._allowCustomValue&&this._units.length?{mode:"unit",inputValue:e,inputVisible:!0,inputEnabled:!0,selectValue:this._units[0],selectedUnit:this._units[0]}:{mode:"custom",inputValue:e,inputVisible:!0,inputEnabled:!0,selectValue:Ba}}_renderSelectOptions(){let e=this._select.value;if(this._select.replaceChildren(),this._units.length){let t=document.createElement("optgroup");t.label="Units";for(let i of this._units)t.appendChild(this._createOption(Kd(i),i,"unit"));this._select.appendChild(t)}if(this._fixedValues.length){let t=document.createElement("optgroup");t.label="Values";for(let i of this._fixedValues)t.appendChild(this._createOption(i,i,"fixed"));this._select.appendChild(t)}(this._allowCustomValue||this._select.options.length===0)&&this._select.appendChild(this._createOption("custom",Ba,"custom")),e!==""?this._select.value=e:this._select.querySelector('option[value=""]')&&(this._select.value="")}_createOption(e,t,i){let r=document.createElement("option");return r.text=e,r.value=t,r.dataset.kind=i,r}_autoSizeSelect(){if(!this._measure||!this._select)return;let e=this._select.selectedOptions.item(0);this._measure.textContent=e?.text??"";let t=this._measure.offsetWidth;t>0?this._select.style.width=t+17+"px":requestAnimationFrame(()=>this._autoSizeSelect())}_applyReadonlyState(){!this._input||!this._select||(this._input.readOnly=this._readOnly,this._select.disabled=this._readOnly)}_convertNumericValue(e,t){if(t==null)return this._value;let i=e.unit;return this._unitValueConverter?.({value:e.value,numberText:e.numberText,rawValue:this._value,fromUnit:i,toUnit:t})??di(e.numberText,t)}_resolveCurrentValueForUnit(e){if(e==null)return null;let t=this._unitValueConverter?.({value:Number.NaN,numberText:"",rawValue:this._value,fromUnit:"",toUnit:e})?.trim();return t||null}_readEditableNumericValue(e){let t=hi(this._value);if(t.kind==="numeric"){let i=this._convertNumericValue(t,e),r=hi(i);return r.kind==="numeric"?r.value:t.value}if(this._input.value?.trim()){let i=Number(this._input.value);if(!Number.isNaN(i))return i}return this._lastNumericValue}_applyNumericValue(e,t){this._lastNumericValue=this._clampNumericValue(e),this._lastNumericUnit=t,this._commitValue(di(Lr(this._lastNumericValue),t))}_previewNumericValue(e,t,i){this._lastNumericValue=this._clampNumericValue(e),this._lastNumericUnit=t;let r=i??this._getEffectiveStep(t);this._setValue(di(this._formatInteractiveNumericValue(this._lastNumericValue,r),t),!1,!0)}_commitValue(e){this._setValue(e,!0,!1)}_setValue(e,t,i){let r=e??"";if(!t&&!i&&this._previewStartValue!=null)return;let n=this._value;this._value=r,i?this._displayValueLock=r:this._displayValueLock!=null&&(r===this._displayValueLock||r!==n)&&(this._displayValueLock=null),this._preferCustomMode=!1,this._updateValue(),n!==r&&(i&&(this._previewChanged=!0,this.valuePreviewChanged.emit({newValue:r,oldValue:n})),t&&this.valueChanged.emit({newValue:r,oldValue:n}))}_startPreviewSession(){this._previewStartValue==null&&(this._previewStartValue=this._value,this._previewChanged=!1)}_finishPreviewSession(e){if(this._previewStartValue==null)return;let t=this._previewStartValue,i=this._displayValueLock??this._value,r=this._previewChanged&&t!==i,n=e||!r;this._previewStartValue=null,this._previewChanged=!1,n?(this._displayValueLock=null,this._value=t,this._updateValue()):(this._displayValueLock=i,this._updateValue()),this.valuePreviewFinished.emit({newValue:i,oldValue:t,wasCancelled:n})}_applyStepPreview(e){let t=this._select.value,i=this._getEffectiveStep(t);this._previewNumericValue(this._getInteractiveStepValue(this._readEditableNumericValue(t),e,i),t,i)}_stopStepperRepeat(){this._stepperRepeatTimeout!=null&&(window.clearTimeout(this._stepperRepeatTimeout),this._stepperRepeatTimeout=null),this._stepperRepeatInterval!=null&&(window.clearInterval(this._stepperRepeatInterval),this._stepperRepeatInterval=null)}_attachStepperWindowListeners(){window.addEventListener("pointerup",this._windowPointerUpHandler,!0),window.addEventListener("pointercancel",this._windowPointerCancelHandler,!0),window.addEventListener("blur",this._windowBlurHandler)}_attachDragWindowListeners(){window.addEventListener("pointermove",this._windowDragPointerMoveHandler,!0),window.addEventListener("pointerup",this._windowDragPointerUpHandler,!0),window.addEventListener("pointercancel",this._windowDragPointerCancelHandler,!0),window.addEventListener("blur",this._windowDragBlurHandler)}_detachStepperWindowListeners(){window.removeEventListener("pointerup",this._windowPointerUpHandler,!0),window.removeEventListener("pointercancel",this._windowPointerCancelHandler,!0),window.removeEventListener("blur",this._windowBlurHandler)}_detachDragWindowListeners(){window.removeEventListener("pointermove",this._windowDragPointerMoveHandler,!0),window.removeEventListener("pointerup",this._windowDragPointerUpHandler,!0),window.removeEventListener("pointercancel",this._windowDragPointerCancelHandler,!0),window.removeEventListener("blur",this._windowDragBlurHandler)}_calculateDraggedStepCount(e){let t=Math.abs(e),i=Math.min(t,20)/5,r=Math.max(Math.min(t-20,40),0)/3,n=Math.max(t-60,0)/2,o=Math.trunc(i+r+n);return Math.sign(e)*o}_getEffectiveStep(e){return Qd(this._unitSteps,this._step,e)}_getInteractiveStepValue(e,t,i){let r=i??this._step,n=this._clampNumericValue(e);if(!Number.isFinite(n)||!Number.isFinite(t)||t===0)return n;let o=this._min??0,a=(n-o)/r,l=Math.round(a),c=Math.abs(a-l)<1e-9,h;t>0?h=(c?l+1:Math.ceil(a))+t-1:h=(c?l-1:Math.floor(a))+t+1;let d=o+h*r;return this._clampNumericValue(this._roundToStepPrecision(d,r))}_formatInteractiveNumericValue(e,t){let i=t??this._step;return Lr(this._roundToStepPrecision(e,i),this._getStepPrecision(i))}_roundToStepPrecision(e,t){let r=10**this._getStepPrecision(t);return Math.round(e*r)/r}_getStepPrecision(e){let t=`${e??this._step}`.toLowerCase();if(t.includes("e-")){let[r,n]=t.split("e-"),o=Number(n),a=r.includes(".")?r.length-r.indexOf(".")-1:0;return o+a}let i=t.indexOf(".");return i>=0?t.length-i-1:0}_switchToUnitModeForInteraction(){let e=this._lastNumericUnit??this._units[0];if(e==null)return!1;this._preferCustomMode=!1;let t=this._resolveCurrentValueForUnit(e);return t!=null?(this._commitValue(t),this._isSelectedUnitMode()):(this._applyNumericValue(this._lastNumericValue,e),this._isSelectedUnitMode())}_isSelectedUnitMode(){return this._select.selectedOptions.item(0)?.dataset.kind==="unit"}_normalizeOptionValues(e){return $d(e)}_clampNumericValue(e){let t=e;return this._min!=null&&(t=Math.max(this._min,t)),this._max!=null&&(t=Math.min(this._max,t)),t}};customElements.define("node-projects-numeric-style-input",Qi)});import{TypedEvent as Au}from"@node-projects/base-custom-webcomponent";var pi,Fr=g(()=>{"use strict";pi=class{_services=new Map;servicesChanged=new Au;getLastService(e){let t=this._services.get(e);return t&&t.length?t[t.length-1]:null}getServices(e){return this._services.get(e)}register(e,t){this._services.has(e)||this._services.set(e,[]),this._services.get(e).push(t),this.servicesChanged.emit({serviceName:e})}registerLast(e,t){this._services.has(e)||this._services.set(e,[]),this._services.get(e).unshift(t),this.servicesChanged.emit({serviceName:e})}registerMultiple(e,t){for(let i of e)this._services.has(i)||this._services.set(i,[]),this._services.get(i).push(t),this.servicesChanged.emit({serviceName:i})}forSomeServicesTillResult(e,t){let i=this.getServices(e);if(i==null)return null;for(let r=i.length-1;r>=0;r--){let n=i[r],o=t(n);if(o!=null)return o}return null}getLastServiceWhere(e,t){let i=this.getServices(e);if(i==null)return null;for(let r=i.length-1;r>=0;r--){let n=i[r];if(t(n))return n}return null}getLastServiceResult(e,t){let i=this.getServices(e);if(i==null)return null;for(let r=i.length-1;r>=0;r--){let n=i[r],o=t(n);if(o)return o}return null}async getLastServiceWhereAsync(e,t){let i=this.getServices(e);if(i==null)return null;for(let r=i.length-1;r>=0;r--){let n=i[r];if(await t(n))return n}return null}}});import{BaseCustomWebComponentLazyAppend as ku,css as Du}from"@node-projects/base-custom-webcomponent";var qi,ja=g(()=>{"use strict";qi=class extends ku{_placeholder;_loading;static style=Du`:host{display:block;overflow:hidden;background:#fff;height:100%;width:100%;position:relative}#placeholder{position:absolute;left:24px;height:100%;width:calc(100% - 24px)}#loading{position:absolute;top:60px;left:20px}#left{position:absolute;left:0;top:0;height:100%;width:24px;border-right:solid #fff 1px;box-sizing:border-box;background:#000}span{color:#fff;rotate:270deg;display:block;position:absolute;top:35px;left:-38px;font-weight:600;font-family:monospace;font-size:24px}`;constructor(){super(),this._placeholder=document.createElement("div"),this._placeholder.id="placeholder",this._placeholder.style.transform="scale(1)",this.shadowRoot.appendChild(this._placeholder),this._loading=document.createElement("div"),this._loading.id="loading",this._loading.textContent="\u{1F6C0} Hold on, loading...",this.shadowRoot.appendChild(this._loading);let e=document.createElement("div");e.id="left";let t=document.createElement("span");t.innerText="PREVIEW",e.appendChild(t),this.shadowRoot.appendChild(e)}dispose(){}executeCommand;canExecuteCommand;async display(e,t,i,r){this._loading.hidden=!1,await e.demoProviderService.provideDemo(this._placeholder,e,t,i,r),this._loading.hidden=!0}};customElements.define("node-projects-demo-view",qi)});import{PropertyChangedArgs as zr,TypedEvent as Ji}from"@node-projects/base-custom-webcomponent";var Br,Jd=g(()=>{"use strict";Br=class{_serviceContainer;_tool;_strokeColor="black";_strokeThickness="3";_fillBrush="none";constructor(e){this._serviceContainer=e}set tool(e){if(this._tool!==e){let t=this._tool;t&&t.dispose(),this._tool=e;let i=null;for(let r of this._serviceContainer.designerTools)r[1]==e&&(i=r[0]);this.onToolChanged.emit(new zr({name:i,tool:e},{name:null,tool:t})),this._tool&&this._tool.activated(this._serviceContainer)}}get tool(){return this._tool}onToolChanged=new Ji;finishedWithTool=()=>this.tool=null;set strokeColor(e){if(this._strokeColor!==e){let t=this._strokeColor;this._strokeColor=e,this.onStrokeColorChanged.emit(new zr(e,t))}}get strokeColor(){return this._strokeColor}onStrokeColorChanged=new Ji;set strokeThickness(e){if(this._strokeThickness!==e){let t=this._strokeThickness;this._strokeThickness=e,this.onStrokeThicknessChanged.emit(new zr(e,t))}}get strokeThickness(){return this._strokeThickness}onStrokeThicknessChanged=new Ji;set fillBrush(e){if(this._fillBrush=e,this._fillBrush!==e){let t=this._fillBrush;this._fillBrush=e,this.onFillBrushChanged.emit(new zr(e,t))}}get fillBrush(){return this._fillBrush}onFillBrushChanged=new Ji;showConfigClicked=new Ji}});import{BaseCustomWebComponentConstructorAppend as Iu,css as Tu,html as Mu,TypedEvent as Nu}from"@node-projects/base-custom-webcomponent";var er,Ua=g(()=>{"use strict";er=class extends Iu{dispose(){}canvasElement;elementsToPackages;onTextChanged=new Nu;_text;static style=Tu`:host{display:block;height:100%;width:100%}textarea{height:100%;width:100%;resize:none;white-space:nowrap;box-sizing:border-box}`;static template=Mu`<div id="container" style="width:100%;height:100%;position:absolute"><textarea id="text"></textarea></div>`;executeCommand(e){}canExecuteCommand(e){return!1}async ready(){this._text=this._getDomElement("text")}focusEditor(){requestAnimationFrame(()=>{this.focus(),this._text.focus()})}activated(){}update(e){this._text.value=e}getText(){return this._text.value}setSelection(e){this._text.setSelectionRange(e.start,e.start+e.length)}};customElements.define("node-projects-code-view-simple",er)});var Ou,Hr,Ya=g(()=>{"use strict";Fr();ja();Jd();Ua();Ou=!!(navigator.maxTouchPoints&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")),Hr=class extends pi{config={codeViewWidget:er,demoViewWidget:qi};designerExtensions=new Map;removeDesignerExtensionOfType(e,t){let i=this.designerExtensions.get(e);for(let r=0;r<i.length;r++)i[r].constructor===t&&i.splice(r,1)}instanceServiceContainerCreatedCallbacks=[];designViewConfigButtons=[];designViewToolbarButtons=[];designerPointerExtensions=[];designerContextMenuExtensions;overlayLayerViewAdditionalStyles=[];globalContext=new Br(this);options={zoomDesignerBackground:!0,roundPixelsToDecimalPlaces:0,resizerPixelSize:Ou?8:3};designerTools=new Map;get bindingService(){return this.getLastService("bindingService")}get bindableObjectsServices(){return this.getServices("bindableObjectsService")}get bindableObjectDragDropService(){return this.getLastService("bindableObjectDragDropService")}get propertyGridDragDropService(){return this.getLastService("propertyGridDragDropService")}get dragDropService(){return this.getLastService("dragDropService")}get elementInteractionServices(){return this.getServices("elementInteractionService")}get propertiesServices(){return this.getServices("propertyService")}get attachedPropertyServices(){return this.getServices("attachedPropertyService")}get propertyGroupService(){return this.getLastService("propertyGroupsService")}get containerServices(){return this.getServices("containerService")}get snaplinesProviderService(){return this.getLastService("snaplinesProviderService")}get elementsServices(){return this.getServices("elementsService")}get eventsService(){return this.getServices("eventsService")}get instanceServices(){return this.getServices("instanceService")}get propertyEditorTypesServices(){return this.getServices("propertyEditorTypesService")}get htmlWriterService(){return this.getLastService("htmlWriterService")}get htmlParserService(){return this.getLastService("htmlParserService")}get intializationService(){return this.getLastService("intializationService")}get elementAtPointService(){return this.getLastService("elementAtPointService")}get externalDragDropService(){return this.getLastService("externalDragDropService")}get copyPasteService(){return this.getLastService("copyPasteService")}get modelCommandService(){return this.getLastService("modelCommandService")}get demoProviderService(){return this.getLastService("demoProviderService")}get designItemService(){return this.getLastService("designItemService")}get configUiServices(){return this.getServices("configUiService")}get refactorServices(){return this.getServices("refactorService")}get deletionService(){return this.getLastService("deletionService")}get referencesChangedService(){return this.getLastService("referencesChangedService")}get miniatureViewService(){return this.getLastService("miniatureViewService")}get pngCreatorService(){return this.getLastService("pngCreatorService")}get searchService(){return this.getLastService("searchService")}get editorTypesServices(){return this.getServices("editorTypeService")}}});var V,Se=g(()=>{"use strict";V=class{static isTypescriptEnum(e){if(e&&typeof e=="object"&&e.constructor==Object){for(let t in e){let i=typeof e[t];if(i!=="string"&&i!=="number")return!1}return!0}return!1}static getTypescriptEnumEntries(e){let t=[];for(let i in e)isNaN(i)&&t.push([i,e[i]]);return t}static camelToDashCase(e){return e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`)}static dashToCamelCase(e){return e.replace(/-([a-z])/g,t=>t[1].toUpperCase())}}});var W,mt=g(()=>{"use strict";(function(s){s.none="none",s.all="all",s.some="some",s.bound="bound",s.fromStylesheet="fromStylesheet"})(W||(W={}))});var L,$e=g(()=>{"use strict";(function(s){s.explicitProperty="explicitProperty",s.property="property",s.attribute="attribute",s.class="class",s.css="css",s.cssvar="cssvar",s.event="event",s.content="content",s.visible="visible"})(L||(L={}))});var x,ye=g(()=>{"use strict";(function(s){s.property="property",s.attribute="attribute",s.propertyAndAttribute="propertyAndAttribute",s.cssValue="cssvalue",s.complex="complex",s.add="add"})(x||(x={}))});var A,$=g(()=>{"use strict";(function(s){s[s.Element=1]="Element",s[s.Attribute=2]="Attribute",s[s.TextNode=3]="TextNode",s[s.Comment=8]="Comment",s[s.Document=9]="Document",s[s.DocumentFragment=11]="DocumentFragment"})(A||(A={}))});function ox(s){return s.getRootNode()?.host?.localName=="node-projects-designer-canvas"}function Gr(s,e){return e.createRange().createContextualFragment(s,{includeShadowRoots:!0}).firstChild}function ep(s,e){return s instanceof e||s instanceof(s.ownerDocument.defaultView??window)[e.name]}function Xa(s,...e){for(let t of e)if(s instanceof t||s instanceof(s.ownerDocument.defaultView??window)[t.name])return!0;return!1}function It(s){return s==null||Xa(s,SVGElement,HTMLHtmlElement,HTMLHeadElement,HTMLBodyElement,HTMLSelectElement,HTMLOptionElement)?!1:(s.ownerDocument.defaultView??window).getComputedStyle(s).display.startsWith("inline")}function jt(s){return s==null||Xa(s,SVGElement,HTMLHtmlElement,HTMLHeadElement,HTMLBodyElement,HTMLSelectElement,HTMLOptionElement)?!1:(s.ownerDocument.defaultView??window).getComputedStyle(s).display.startsWith("inline")}function tp(s){if(Xa(s,SVGElement,HTMLHtmlElement,HTMLHeadElement,HTMLBodyElement)||ep(s,MathMLElement))return Fe.block;let e=(s.ownerDocument.defaultView??window).getComputedStyle(s).display;return e=="none"?Fe.none:e.startsWith("inline")?Fe.inline:Fe.block}function Wr(s){return s.textContent.trim()==""&&s.textContent.indexOf("\xA0")<0}function ax(){let s=document.activeElement,e=null;for(;s!=e;)e=s,s.shadowRoot!=null&&s.shadowRoot.activeElement&&(s=s.shadowRoot.activeElement);return s}function lx(s){if(ep(s,HTMLElement))return{x:s.offsetLeft,y:s.offsetTop};{let e=U(s),t=U(s.parentElement);return{x:e.x-t.x,y:e.y-t.y}}}function U(s){let e=s.getBoundingClientRect();if(e.width==0&&e.height==0&&(s.ownerDocument.defaultView??window).getComputedStyle(s).display=="contents")if(s.shadowRoot)for(let i of s.shadowRoot.children){let r=U(i);e=new DOMRect(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.width,r.width),Math.max(e.height,r.height))}else for(let i of s.children){let r=U(i);e=new DOMRect(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.width,r.width),Math.max(e.height,r.height))}return e}function jr(s){let e=(s.ownerDocument.defaultView??window).getComputedStyle(s).zoom;if(!e||e==="normal")return 1;if(e.endsWith("%")){let i=parseFloat(e);return Number.isFinite(i)&&i>0?i/100:1}let t=parseFloat(e);return Number.isFinite(t)&&t>0?t:1}function ip(s){let e=parseInt(getComputedStyle(s).paddingLeft.replace("px",""))+parseInt(getComputedStyle(s).marginLeft.replace("px",""))+parseInt(getComputedStyle(s).borderLeft.replace("px",""))+parseInt(getComputedStyle(s).paddingRight.replace("px",""))+parseInt(getComputedStyle(s).marginRight.replace("px",""))+parseInt(getComputedStyle(s).borderRight.replace("px","")),t=parseInt(getComputedStyle(s).paddingTop.replace("px",""))+parseInt(getComputedStyle(s).marginTop.replace("px",""))+parseInt(getComputedStyle(s).borderTop.replace("px",""))+parseInt(getComputedStyle(s).paddingBottom.replace("px",""))+parseInt(getComputedStyle(s).marginBottom.replace("px",""))+parseInt(getComputedStyle(s).borderBottom.replace("px",""));return{x:e,y:t}}function Ut(s,e){let t={x:Number.MAX_VALUE,y:Number.MAX_VALUE},i={x:Number.MIN_VALUE,y:Number.MIN_VALUE},r;for(let n of s)n.nodeType==A.TextNode||n.nodeType==A.Comment||(r={x:e.getNormalizedElementCoordinates(n.element).x,y:e.getNormalizedElementCoordinates(n.element).y,width:e.getNormalizedElementCoordinates(n.element).width,height:e.getNormalizedElementCoordinates(n.element).height},r.x<t.x&&(t.x=r.x),r.y<t.y&&(t.y=r.y),r.x+r.width>i.x&&(i.x=r.x+r.width),r.y+r.height>i.y&&(i.y=r.y+r.height));return{x:t.x,y:t.y,width:i.x-t.x,height:i.y-t.y}}var Fe,he=g(()=>{"use strict";$();(function(s){s[s.none=0]="none",s[s.inline=1]="inline",s[s.block=2]="block"})(Fe||(Fe={}))});var ee,Ne=g(()=>{"use strict";mt();Se();$e();ye();$();he();ee=class s{constructor(e){this._recreateElementsOnPropertyChange=e}_recreateElementsOnPropertyChange=!1;static _stylesCache=new Map;_cssCacheClearTimer;static _bindingsCache=new Map;static _bindingsCacheClearTimer;_notifyChangedProperty(e,t,i){}async getProperty(e,t){let i=await this.getProperties(e);return"properties"in i[0]?i.flatMap(r=>r.properties).find(r=>r.name==t):i.find(r=>r.name==t)}async setValue(e,t,i){let r=e[0].openGroup("property changed: "+t.name+" to "+i);for(let n of e)if(this.isHandledElement(n)&&this.getProperty(n,t.name)){if(t.propertyType==x.cssValue)await n.updateStyleInSheetOrLocalAsync(t.propertyName??t.name,i),n.element.setAttribute("style",n.element.getAttribute("style"));else{let o=t.attributeName;if(o||(o=V.camelToDashCase(t.name)),t.type==="object"){let a=JSON.stringify(i);t.propertyType==x.propertyAndAttribute?n.setPropertyAndAttribute(t.name,a):t.propertyType==x.attribute?n.setAttribute(o,a):t.propertyType==x.property&&n.setProperty(t.name,i)}else t.type=="boolean"&&(i===!1||i==null)?((t.propertyType==x.attribute||t.propertyType==x.propertyAndAttribute)&&n.removeAttribute(o),(t.propertyType==x.property||t.propertyType==x.propertyAndAttribute)&&n.setProperty(t.name,!1)):t.type=="boolean"&&i===!0?((t.propertyType==x.attribute||t.propertyType==x.propertyAndAttribute)&&n.setAttribute(o,""),(t.propertyType==x.property||t.propertyType==x.propertyAndAttribute)&&n.setProperty(t.name,!0)):t.propertyType==x.propertyAndAttribute?n.setPropertyAndAttribute(t.name,i):t.propertyType==x.attribute?n.setAttribute(o,i.toString()):t.propertyType==x.property&&n.setProperty(t.name,i)}this._notifyChangedProperty(n,t,i)}r.commit(),this._recreateElementsOnPropertyChange&&s.recreateElements(this,e)}getPropertyTarget(e,t){return t.propertyType==x.attribute?L.attribute:t.propertyType==x.cssValue?L.css:L.property}clearValue(e,t,i){let r=e[0].openGroup("property cleared: "+t.name);for(let n of e){if(i!="binding"){if(t.propertyType==x.cssValue)n.removeStyle(t.propertyName??t.name);else if((t.propertyType==x.property||t.propertyType==x.propertyAndAttribute)&&(n.element[t.propertyName??t.name]=null),t.propertyType==x.attribute||t.propertyType==x.propertyAndAttribute){let o=t.attributeName;o||(o=V.camelToDashCase(t.name)),n.removeAttribute(o)}}i!="value"&&n.serviceContainer.forSomeServicesTillResult("bindingService",o=>o.clearBinding(n,t.name,this.getPropertyTarget(n,t))),this._notifyChangedProperty(n,t,void 0)}r.commit(),this._recreateElementsOnPropertyChange&&s.recreateElements(this,e)}isSet(e,t){let i=!0,r=!1;if(e!=null&&e.length!==0){let n=t.attributeName;n||(n=V.camelToDashCase(t.name));for(let a of e){let l=!1;if(t.propertyType==x.cssValue?l=a.hasStyle(t.name):l=a.hasAttribute(n),i=i&&l,r=r||l,!i&&r)break}let o=s.getOrBuildCachedBindings(e[0]);if(t.propertyType==x.cssValue){if(o&&o.find(a=>(a.target==L.css||a.target==L.cssvar)&&a.targetName==t.name))return W.bound}else if(t.propertyType==x.attribute){if(o&&o.find(a=>a.target==L.attribute&&a.targetName==t.name))return W.bound}else if(t.propertyType==x.property){if(o&&o.find(a=>(a.target==L.property||a.target==L.explicitProperty)&&a.targetName==t.name))return W.bound}else if(o&&o.find(a=>(a.target==L.property||a.target==L.explicitProperty||a.target==L.attribute)&&a.targetName==t.name))return W.bound;if(!i&&t.propertyType==x.cssValue){let a=s._stylesCache.get(e[0]);if(a||(a=new Set(e[0].getAllStyles().filter(c=>c.selector!=null).flatMap(c=>c.declarations).map(c=>c.name)),s._stylesCache.set(e[0],a),clearTimeout(this._cssCacheClearTimer),this._cssCacheClearTimer=setTimeout(()=>s._stylesCache.clear(),30)),a.has(t.propertyName??t.name))return W.fromStylesheet}}else return W.none;return i?W.all:r?W.some:W.none}static getOrBuildCachedBindings(e){let t=s._bindingsCache.get(e);if(!t){let i=e.serviceContainer.getServices("bindingService");if(t=[],i)for(let r of i){let n=r.getBindings(e);n&&n.length>0&&t.push(...n)}s._bindingsCache.set(e,t),clearTimeout(this._bindingsCacheClearTimer),this._bindingsCacheClearTimer=setTimeout(()=>s._bindingsCache.clear(),30)}return t}getValue(e,t){if(e!=null&&e.length!==0)if(t.propertyType==x.cssValue){let i=e[0].getStyle(t.propertyName??t.name);for(let r of e)if(r.getStyle(t.name)!=i){i=null;break}return i}else if(t.propertyType==x.property){let i=t.propertyName;return i||(i=V.dashToCamelCase(t.name)),e[0].element[i]}else{let i=t.attributeName;if(i||(i=V.camelToDashCase(t.name)),t.type=="boolean"){if(e[0].hasAttribute(i)){let n=e[0].getAttribute(i);return n==""?!0:n}return!1}return e[0].getAttribute(i)}return null}getBinding(e,t){let i=s.getOrBuildCachedBindings(e[0]);return i!=null?t.propertyType==x.cssValue?i.find(r=>(r.target==L.css||r.target==L.cssvar)&&r.targetName==t.name):t.propertyType==x.attribute?i.find(r=>r.target==L.attribute&&r.targetName==t.name):t.propertyType==x.property?i.find(r=>(r.target==L.property||r.target==L.explicitProperty)&&r.targetName==t.name):i.find(r=>(r.target==L.property||r.target==L.explicitProperty||r.target==L.attribute)&&r.targetName==t.name):null}getUnsetValue(e,t){return t.propertyType==x.cssValue?e!=null&&e.length!==0&&e[0].nodeType==A.Element?window.getComputedStyle(e[0].element)[t.propertyName??t.name]:null:t.defaultValue}static recreateElements(e,t){for(let i of t){if(!e.isHandledElement(i))continue;let r="<"+i.name+" ";for(let o of i.element.attributes)r+=o.name+'="'+o.value.replaceAll('"',""")+'" ';r+="></"+i.name+">";let n=Gr(r,t[0].document);for(let o of[...i.element.childNodes])n.appendChild(o);n.style.pointerEvents="auto",i.node.insertAdjacentElement("beforebegin",n),i.node.parentNode&&i.node.parentNode.removeChild(i.node),i.replaceNode(n)}}getContextMenu(e,t){let i=[{title:"clear",action:r=>{t.service.clearValue(e,t,"value"),e[0].instanceServiceContainer.designerCanvas.extensionManager.refreshAllExtensions(e)}},{title:"edit as text",action:(r,n,o,a)=>{a.close(),setTimeout(async()=>{let l=t.service.getValue(e,t),c=prompt(`edit value of '${t.name}' as string:`,l);c&&c!=l&&await t.service.setValue(e,t,c),e[0].instanceServiceContainer.designerCanvas.extensionManager.refreshAllExtensions(e)},10)}}];return e[0].serviceContainer.config.openBindingsEditor&&(i.push({title:"-"},{title:"edit binding",action:()=>{let r=t.service.getPropertyTarget(e[0],t),n=t.service.getBinding(e,t);e[0].serviceContainer.config.openBindingsEditor(t,e,n,r)}}),t.service.isSet(e,t)==W.bound&&i.push({title:"clear binding",action:()=>{t.service.clearValue(e,t,"binding"),e[0].instanceServiceContainer.designerCanvas.extensionManager.refreshAllExtensions(e)}})),i}}});var H,me=g(()=>{"use strict";(function(s){s[s.none=0]="none",s[s.full=1]="full",s[s.fullOnValueChange=2]="fullOnValueChange",s[s.fullOnClassChange=3]="fullOnClassChange"})(H||(H={}))});var st,mi=g(()=>{"use strict";Se();Ne();ye();me();st=class extends ee{getRefreshMode(e){return H.fullOnClassChange}async getProperties(e){return this.isHandledElement(e)&&e.element?.constructor?.properties?this.parseProperties(e.element.constructor.properties):null}parseProperties(e){let t=[],i=Object.keys(e),r=Object.groupBy(i,n=>e[n].group??"");for(let n in r){let o={name:n,properties:[]};for(let a of r[n]){let l=e[a],c=l,h=null,d=null,p=!1,m=x.propertyAndAttribute;if(l.type&&(c=l.type,h=l.description,d=l.example,p=l.readonly,m=l.readonly?x.property:x.propertyAndAttribute),c===String){let u={name:a,type:"string",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(c===Object){let u={name:a,type:"object",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(c===Number){let u={name:a,type:"number",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(c===Date){let u={name:a,type:"date",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(c===Boolean){let u={name:a,type:"boolean",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(V.isTypescriptEnum(c)){let u={name:a,type:"enum",enumValues:V.getTypescriptEnumEntries(c),service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(typeof c=="string"){let u={name:a,type:c,service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else{let u={name:a,type:"string",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}}o.name==""?t.push(...o.properties):t.push(o)}return t}getUnsetValue(e,t){return e[0].element[t.propertyName??t.name]}}});var Ur,Ka=g(()=>{"use strict";mi();Ur=class extends st{name="polymer";isHandledElement(e){return e.element.constructor.polymerElementVersion!=null}_notifyChangedProperty(e,t,i){e.element.set(t.name,i)}}});var Yr,$a=g(()=>{"use strict";mi();Yr=class extends st{name="lit";isHandledElement(e){let t=e.element.constructor.__proto__;for(;t!=null;){if(t.name=="LitElement")return!0;if(t.name==null||t.name=="HTMLElement"||t.name=="Element"||t.name=="Node"||t.name=="HTMLElement")return!1;t=t.__proto__}return!1}_notifyChangedProperty(e,t,i){}}});var Xr,Za=g(()=>{"use strict";ye();me();Ne();Xr=class extends ee{inputProperties=[{name:"type",type:"list",values:["text","number","button","checkbox","color","date","datetime-local","email","file","hidden","image","month","password","radio","range","reset","search","submit","tel","time","url","week"],service:this,defaultValue:"text",propertyType:x.propertyAndAttribute},{name:"value",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"placeholder",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"checked",type:"boolean",service:this,propertyType:x.propertyAndAttribute},{name:"min",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"max",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"readonly",type:"boolean",service:this,propertyType:x.propertyAndAttribute},{name:"valueAsDate",type:"string",service:this,propertyType:x.property},{name:"valueAsNumber",type:"string",service:this,propertyType:x.property}];textareaProperties=[{name:"value",type:"string",service:this,propertyType:x.property},{name:"placeholder",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"maxlength",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"cols",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"rows",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"readonly",type:"boolean",service:this,propertyType:x.propertyAndAttribute},{name:"resize",type:"list",values:["both","none","horizontal","vertical"],service:this,propertyType:x.cssValue}];selectProperties=[{name:"value",type:"string",service:this,propertyType:x.property},{name:"size",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"multiple",type:"boolean",service:this,propertyType:x.propertyAndAttribute}];buttonProperties=[{name:"type",type:"list",values:["button","submit","reset"],service:this,defaultValue:"button",propertyType:x.propertyAndAttribute},{name:"value",type:"string",service:this,propertyType:x.propertyAndAttribute}];anchorProperties=[{name:"href",type:"string",service:this,propertyType:x.propertyAndAttribute}];divProperties=[{name:"title",type:"string",service:this,propertyType:x.propertyAndAttribute}];imgProperties=[{name:"src",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"alt",type:"string",service:this,propertyType:x.propertyAndAttribute}];iframeProperties=[{name:"src",type:"string",service:this,propertyType:x.propertyAndAttribute}];formElementProperties=[{name:"autofocus",type:"boolean",service:this,propertyType:x.propertyAndAttribute},{name:"disabled",type:"boolean",service:this,propertyType:x.propertyAndAttribute},{name:"required",type:"boolean",service:this,propertyType:x.propertyAndAttribute}];meterProperties=[{name:"value",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"min",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"max",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"low",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"high",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"optimum",type:"number",service:this,propertyType:x.propertyAndAttribute}];name="native";getRefreshMode(e){return H.full}isHandledElement(e){switch(e.element.localName){case"input":case"textarea":case"select":case"button":case"a":case"div":case"span":case"br":case"img":case"iframe":case"meter":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"p":return!0}return!1}async getProperty(e,t){return(await this.getProperties(e)).find(i=>i.name==t)}async getProperties(e){if(!this.isHandledElement(e))return null;switch(e.element.localName){case"input":return[...this.inputProperties,...this.formElementProperties];case"textarea":return[...this.textareaProperties,...this.formElementProperties];case"select":return[...this.selectProperties,...this.formElementProperties];case"button":return[...this.buttonProperties,...this.formElementProperties];case"a":return this.anchorProperties;case"div":return this.divProperties;case"img":return this.imgProperties;case"iframe":return this.iframeProperties;case"meter":return this.meterProperties;case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"p":return[]}return null}}});var Ue,ui=g(()=>{"use strict";ye();Ne();me();Ue=class extends ee{getRefreshMode(e){return H.none}commonProperties=[{name:"class",type:"string",service:this,attributeName:"class",propertyName:"className",propertyType:x.attribute},{name:"title",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"part",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"tabindex",type:"number",service:this,propertyType:x.propertyAndAttribute}];name="common";isHandledElement(e){return!e.isRootItem}async getProperty(e,t){return this.commonProperties.find(i=>i.name==t)}async getProperties(e){return this.commonProperties}}});var Kr,Qa=g(()=>{"use strict";ui();ye();me();Kr=class extends Ue{rectProperties=[{name:"x",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"y",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"width",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"height",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"rx",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"ry",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"pathLength",type:"svg-length",service:this,propertyType:x.attribute},{name:"fill",type:"color",defaultValue:"transparent",service:this,propertyType:x.attribute},{name:"fill-opacity",type:"number",defaultValue:"1",service:this,propertyType:x.attribute}];lineProperties=[{name:"x1",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"y1",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"x2",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"y2",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"pathLength",type:"svg-length",service:this,propertyType:x.attribute}];ellipseProperties=[{name:"cx",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"cy",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"rx",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"ry",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"pathLength",type:"svg-length",service:this,propertyType:x.attribute},{name:"fill",type:"color",defaultValue:"transparent",service:this,propertyType:x.attribute},{name:"fill-opacity",type:"number",defaultValue:"1",service:this,propertyType:x.attribute}];pathProperties=[{name:"d",type:"string",defaultValue:"",service:this,propertyType:x.attribute},{name:"pathLength",type:"svg-length",service:this,propertyType:x.attribute}];svgProperties=[{name:"width",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"height",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"viewBox",type:"string",service:this,propertyType:x.attribute}];defaultProperties=[{name:"stroke",type:"color",defaultValue:"currentcolor",service:this,propertyType:x.attribute},{name:"stroke-width",type:"svg-length",service:this,propertyType:x.attribute},{name:"stroke-opacity",type:"number",defaultValue:"1",service:this,propertyType:x.attribute},{name:"visibility",type:"list",values:["visible","hidden"],defaultValue:"visible",service:this,propertyType:x.attribute}];name="svg";getRefreshMode(e){return H.fullOnClassChange}isHandledElement(e){switch(e.element.localName){case"rect":case"line":case"ellipse":case"path":case"svg":return!0}return!1}async getProperty(e,t){return(await this.getProperties(e)).find(i=>i.name==t)}async getProperties(e){let t=null;if(!this.isHandledElement(e))return null;switch(e.element.localName){case"rect":t=[...this.rectProperties,...this.defaultProperties];break;case"line":t=[...this.lineProperties,...this.defaultProperties];break;case"ellipse":t=[...this.ellipseProperties,...this.defaultProperties];break;case"path":t=[...this.pathProperties,...this.defaultProperties];break;case"svg":t=this.svgProperties;break}if(e.element.localName=="line"||e.element.localName=="path"){let i=this.getAllMarkerIds(e);(i.length>0||e.hasAttribute("marker-start"))&&t.push({name:"marker-start",type:"string",values:i,service:this,propertyType:x.attribute}),(i.length>0||e.hasAttribute("marker-mid"))&&t.push({name:"marker-mid",type:"string",values:i,service:this,propertyType:x.attribute}),(i.length>0||e.hasAttribute("marker-end"))&&t.push({name:"marker-end",type:"string",values:i,service:this,propertyType:x.attribute})}return t}getAllMarkerIds(e){return[...e.element.ownerSVGElement.querySelectorAll("defs > marker")].map(n=>`url(#${n.id})`).filter(n=>!!n)}}});var fi,qa=g(()=>{"use strict";fi=class{constructor(e,t,i,r){this.title="Change Css Style "+t+" of <"+e.name+">",this.designItem=e,this.name=t,this.newValue=i,this.oldValue=r}title;get affectedItems(){return[this.designItem]}undo(){return this.oldValue===""||this.oldValue==null?(this.designItem._withoutUndoRemoveStyle(this.name),this.name.startsWith("--")?this.designItem.element.style.removeProperty(this.name):this.designItem.element.style[this.name]="",[{changeType:"changed",designItems:this.affectedItems,type:"css",name:this.name,oldValue:this.newValue,newValue:null}]):(this.designItem._withoutUndoSetStyle(this.name,this.oldValue),this.name.startsWith("--")?this.designItem.element.style.setProperty(this.name,this.oldValue):this.designItem.element.style[this.name]=this.oldValue,[{changeType:"changed",designItems:this.affectedItems,type:"css",name:this.name,oldValue:this.newValue,newValue:this.oldValue}])}do(){return this.newValue===""||this.newValue==null?(this.designItem._withoutUndoRemoveStyle(this.name),this.name.startsWith("--")?this.designItem.element.style.removeProperty(this.name):this.designItem.element.style[this.name]="",[{changeType:"changed",designItems:this.affectedItems,type:"css",name:this.name,oldValue:this.oldValue,newValue:null}]):(this.designItem._withoutUndoSetStyle(this.name,this.newValue),this.name.startsWith("--")?this.designItem.element.style.setProperty(this.name,this.newValue):this.designItem.element.style[this.name]=this.newValue,[{changeType:"changed",designItems:this.affectedItems,type:"css",name:this.name,oldValue:this.oldValue,newValue:this.newValue}])}designItem;name;newValue;oldValue;mergeWith(e){return!1}}});var tr,Ja=g(()=>{"use strict";tr=class s{constructor(e,t,i,r){this.title="Change Attribute "+t+" of <"+e.name+">",this.designItem=e,this.name=t,this.newValue=i,this.oldValue=r}title;get affectedItems(){return[this.designItem]}undo(){if(this.oldValue==null)return this.designItem._withoutUndoRemoveAttribute(this.name),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.name,oldValue:this.newValue,newValue:null}];{let e=this.oldValue;return typeof this.oldValue!="string"&&(e=this.oldValue.toString()),this.designItem._withoutUndoSetAttribute(this.name,e),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.name,oldValue:this.newValue,newValue:e}]}}do(){if(this.newValue==null)return this.designItem._withoutUndoRemoveAttribute(this.name),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.name,oldValue:this.newValue,newValue:null}];{let e=this.newValue;return typeof this.newValue!="string"&&(e=this.newValue.toString()),this.designItem._withoutUndoSetAttribute(this.name,e),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.name,oldValue:this.oldValue,newValue:e}]}}designItem;name;newValue;oldValue;mergeWith(e){return e instanceof s&&this.designItem===e.designItem&&this.name===e.name?(this.newValue=e.newValue,!0):!1}}});var P,Ze=g(()=>{"use strict";(function(s){s[s.Directly=0]="Directly",s[s.Permanent=1]="Permanent",s[s.Selection=2]="Selection",s[s.PrimarySelection=3]="PrimarySelection",s[s.PrimarySelectionContainer=4]="PrimarySelectionContainer",s[s.MouseOver=5]="MouseOver",s[s.OnlyOneItemSelected=6]="OnlyOneItemSelected",s[s.MultipleItemsSelected=7]="MultipleItemsSelected",s[s.ContainerDragOverAndCanBeEntered=8]="ContainerDragOverAndCanBeEntered",s[s.ContainerExternalDragOverAndCanBeEntered=9]="ContainerExternalDragOverAndCanBeEntered",s[s.ContainerDrag=10]="ContainerDrag",s[s.Doubleclick=11]="Doubleclick",s[s.Placement=12]="Placement",s[s.PrimarySelectionAndCanBeEntered=13]="PrimarySelectionAndCanBeEntered",s[s.PrimarySelectionContainerAndCanBeEntered=14]="PrimarySelectionContainerAndCanBeEntered",s[s.PrimarySelectionRefreshed=15]="PrimarySelectionRefreshed",s[s.ManualApplied=16]="ManualApplied"})(P||(P={}))});var ot,$r,Zr,el=g(()=>{"use strict";(function(s){s[s.Name=0]="Name",s[s.Value=1]="Value",s[s.InQuote=2]="InQuote"})(ot||(ot={}));$r=class{constructor(e,t){this.name=e.trim(),this.value=t.trim()}name;value},Zr=class{entries=[];parse(e,t="'"){this.entries=[];let i="",r="",n=ot.Name;for(let o=0;o<e.length;o++){let a=e[o];n===ot.Name?a===":"?n=ot.Value:a===";"?i="":i+=a:n===ot.Value?a===";"?(this.entries.push(new $r(i,r)),i="",r="",n=ot.Name):(a===t&&(n=ot.InQuote),r+=a):n===ot.InQuote&&(a==="\\"?(r+=a,o++,a=e[o],r+=a):a===t?(r+=a,n=ot.Value):r+=a)}i.trim()!==""&&this.entries.push(new $r(i,r))}}});var Tt,tl=g(()=>{"use strict";Tt=class{constructor(e,t,i){this.title="Move or Insert Item",this.designItem=e,this.newParent=t,this.newIndex=i}title;get affectedItems(){return this.oldParent?[this.designItem,this.newParent,this.oldParent]:[this.designItem,this.newParent]}undo(){return this.oldParent?(this.oldParent._insertChildInternal(this.designItem,this.oldIndex),[{changeType:"moved",designItems:[this.designItem]}]):(this.designItem.parent._removeChildInternal(this.designItem),[{changeType:"removed",designItems:[this.designItem]}])}do(){return this.oldParent=this.designItem.parent,this.oldParent&&(this.oldIndex=this.designItem.parent.indexOf(this.designItem)),this.newParent._insertChildInternal(this.designItem,this.newIndex),[{changeType:this.oldParent?"moved":"added",designItems:[this.designItem]}]}designItem;newParent;newIndex;oldParent;oldIndex;newItem;mergeWith(e){return!1}}});var Qr,il=g(()=>{"use strict";Qr=class{_textHolder="";indent=4;level=0;get position(){return this._textHolder.length}isLastCharNewline(){return this._textHolder[this._textHolder.length-1]===`
|
|
1
|
+
var Ra=Object.defineProperty;var cu=Object.getOwnPropertyDescriptor;var hu=Object.getOwnPropertyNames;var du=Object.prototype.hasOwnProperty;var g=(s,e)=>()=>(s&&(e=s(s=0)),e);var Ud=(s,e)=>{for(var t in e)Ra(s,t,{get:e[t],enumerable:!0})},pu=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of hu(e))!du.call(s,r)&&r!==t&&Ra(s,r,{get:()=>e[r],enumerable:!(i=cu(e,r))||i.enumerable});return s};var Yd=s=>pu(Ra({},"__esModule",{value:!0}),s);function hi(s){let e=s?.trim()??"";if(!e)return{kind:"empty"};let t=e.match(/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))(?:([a-z%]+))?$/i);if(!t)return{kind:"text",text:e};let i=Number(t[1]);return Number.isNaN(i)?{kind:"text",text:e}:{kind:"numeric",numberText:t[1],value:i,unit:t[2]?.toLowerCase()??""}}function Lr(s,e=4){if(!Number.isFinite(s))return"0";let t=10**Math.max(0,e),i=Math.round(s*t)/t;return Object.is(i,-0)?"0":`${i}`}function di(s,e){let t=s?.trim()??"";return t?t+(e??""):""}function Kd(s){return s===""?" ":s}function $d(s){let e=(s??[]).map(t=>t==null?null:t.trim()).filter(t=>t!=null);return[...new Set(e)]}function Zd(s,e,t){return s!=null&&t.includes(s)?s:e??t[0]??null}function Qd(s,e,t){if(t!=null){let i=s?.[t];if(Number.isFinite(i)&&i>0)return i}return e}var Fa=g(()=>{"use strict"});import{BaseCustomWebComponentConstructorAppend as gu,css as yu,html as vu,TypedEvent as za}from"@node-projects/base-custom-webcomponent";var Ba,xu,Qi,Ha=g(()=>{"use strict";Fa();Fa();Ba="__node-projects-custom-value__",xu="\u22EE",Qi=class extends gu{static style=yu`:host{display:block;width:100%;min-width:0}#container{display:grid;gap:0;grid-template-columns:minmax(0,1fr) auto 16px;width:100%;height:24px;align-items:stretch}#value-wrapper{display:grid;grid-template-columns:14px minmax(0,1fr);min-width:0}#input,#scrubber,#select,#stepper button{border:none;box-sizing:border-box;height:24px;min-height:24px;background:0 0;color:inherit;font:inherit;outline:0;box-shadow:none}#scrubber,#stepper button{padding:0;line-height:1}#scrubber{border-right:0;cursor:ns-resize;font-size:11px;letter-spacing:-1px}#input{border-left:0;border-right:0;min-width:0;text-align:right}#input:focus,#scrubber:focus,#select:focus,#stepper button:focus{outline:0;box-shadow:none;border-color:var(--input-border-color,#596c7a)}#input[disabled],#scrubber[disabled]{cursor:default}#input[disabled]{color:inherit;opacity:1;-webkit-text-fill-color:currentColor}#select{border-left:0;padding:0 15px 0 2px;line-height:1;-webkit-appearance:none;appearance:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4'%3E%3Cpath d='M0 0l4 4 4-4z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 2px center}#measure{position:absolute;visibility:hidden;white-space:nowrap;font:inherit;pointer-events:none}#stepper{display:grid;height:24px;min-height:24px;overflow:hidden;grid-template-rows:repeat(2,minmax(0,1fr))}#stepper button{height:auto;min-height:0;width:16px;min-width:16px;font-size:10px}`;static template=vu`<div id="container"><div id="value-wrapper"><button id="scrubber" type="button" aria-label="Drag to change value">${xu}</button> <input id="input" type="text" spellcheck="false"></div><select id="select"></select><div id="stepper"><button id="increase" type="button" aria-label="Increase value">+</button> <button id="decrease" type="button" aria-label="Decrease value">-</button></div><span id="measure"></span></div>`;_value="";get value(){return this._value}set value(e){this._setValue(e,!1,!1)}valueChanged=new za;valuePreviewChanged=new za;valuePreviewFinished=new za;_units=["px","%","pt"];get units(){return[...this._units]}set units(e){this._units=this._normalizeOptionValues(e),this._lastNumericUnit=this._units[0]??this._lastNumericUnit,this._updateValue()}_fixedValues=[];get fixedValues(){return[...this._fixedValues]}set fixedValues(e){this._fixedValues=this._normalizeOptionValues(e),this._updateValue()}_step=1;get step(){return this._step}set step(e){this._step=Number.isFinite(e)&&e>0?e:1}_unitSteps={};get unitSteps(){return{...this._unitSteps}}set unitSteps(e){this._unitSteps=e??{}}_min=null;get min(){return this._min}set min(e){this._min=Number.isFinite(e)?e:null}_max=null;get max(){return this._max}set max(e){this._max=Number.isFinite(e)?e:null}_readOnly=!1;get readOnly(){return this._readOnly}set readOnly(e){this._readOnly=e,this._applyReadonlyState()}get isInPreview(){return this._previewStartValue!=null}_allowCustomValue=!0;get allowCustomValue(){return this._allowCustomValue}set allowCustomValue(e){this._allowCustomValue=e,this._updateValue()}_unitValueConverter;get unitValueConverter(){return this._unitValueConverter}set unitValueConverter(e){this._unitValueConverter=e}_input;_select;_measure;_scrubberButton;_increaseButton;_decreaseButton;_lastNumericValue=0;_lastNumericUnit="px";_dragPointerId=null;_dragStartY=0;_dragStartNumericValue=0;_appliedDragSteps=0;_previewStartValue=null;_previewChanged=!1;_displayValueLock=null;_stepperPointerId=null;_stepperDirection=0;_stepperRepeatTimeout=null;_stepperRepeatInterval=null;_windowDragPointerMoveHandler=e=>this._handleWindowDragPointerMove(e);_windowDragPointerUpHandler=e=>this._finishDragInteractionForPointerEvent(e,!1);_windowDragPointerCancelHandler=e=>this._finishDragInteractionForPointerEvent(e,!0);_windowDragBlurHandler=()=>this._finishDragInteraction(!1);_windowPointerUpHandler=e=>this._handleWindowStepperPointerEnd(e);_windowPointerCancelHandler=e=>this._handleWindowStepperPointerEnd(e);_windowBlurHandler=()=>this._finishStepperInteraction(!1);_preferCustomMode=!1;constructor(){super(),this._restoreCachedInititalValues(),this._input=this._getDomElement("input"),this._select=this._getDomElement("select"),this._measure=this._getDomElement("measure"),this._scrubberButton=this._getDomElement("scrubber"),this._increaseButton=this._getDomElement("increase"),this._decreaseButton=this._getDomElement("decrease")}ready(){this._parseAttributesToProperties(),this._wireEvents(),this._updateValue()}_wireEvents(){this._input.addEventListener("change",()=>this._applyTypedValue()),this._input.addEventListener("keydown",e=>{e.key==="Enter"&&(this._applyTypedValue(),this._input.blur())}),this._scrubberButton.addEventListener("pointerdown",e=>this._handlePointerDown(e)),this._select.addEventListener("change",()=>this._applySelectedMode()),this._increaseButton.addEventListener("pointerdown",e=>this._handleStepperPointerDown(e,1)),this._decreaseButton.addEventListener("pointerdown",e=>this._handleStepperPointerDown(e,-1))}_handlePointerDown(e){if(!this._readOnly&&!(!this._isSelectedUnitMode()&&!this._switchToUnitModeForInteraction())){this._dragPointerId=e.pointerId,this._dragStartY=e.clientY,this._dragStartNumericValue=this._readEditableNumericValue(this._select.value),this._appliedDragSteps=0,this._startPreviewSession(),this._attachDragWindowListeners();try{this._scrubberButton.setPointerCapture(e.pointerId)}catch{}e.preventDefault()}}_handleWindowDragPointerMove(e){if(this._dragPointerId!==e.pointerId||!this._isSelectedUnitMode())return;let t=this._calculateDraggedStepCount(this._dragStartY-e.clientY);if(t===this._appliedDragSteps)return;this._appliedDragSteps=t;let i=this._select.value,r=this._getEffectiveStep(i);this._previewNumericValue(this._getInteractiveStepValue(this._dragStartNumericValue,t,r),i,r),e.preventDefault()}_finishDragInteractionForPointerEvent(e,t){this._dragPointerId===e.pointerId&&this._finishDragInteraction(t,e.pointerId)}_finishDragInteraction(e,t){if(this._dragPointerId!=null){if(this._dragPointerId=null,this._appliedDragSteps=0,this._detachDragWindowListeners(),t!=null)try{this._scrubberButton.hasPointerCapture(t)&&this._scrubberButton.releasePointerCapture(t)}catch{}this._finishPreviewSession(e)}}_handleStepperPointerDown(e,t){this._readOnly||!this._isSelectedUnitMode()&&!this._switchToUnitModeForInteraction()||(this._finishStepperInteraction(!0),this._stepperPointerId=e.pointerId,this._stepperDirection=t,this._attachStepperWindowListeners(),this._startPreviewSession(),this._applyStepPreview(t),this._stepperRepeatTimeout=window.setTimeout(()=>{this._stepperRepeatInterval=window.setInterval(()=>this._applyStepPreview(this._stepperDirection),50)},350),e.preventDefault())}_handleWindowStepperPointerEnd(e){this._stepperPointerId===e.pointerId&&this._finishStepperInteraction(!1)}_finishStepperInteraction(e){this._stepperPointerId!=null&&(this._stepperPointerId=null,this._stepperDirection=0,this._detachStepperWindowListeners(),this._stopStepperRepeat(),this._finishPreviewSession(e))}_applySelectedMode(){let e=this._select.selectedOptions.item(0);if(!e)return;let t=e.dataset.kind;if(t==="fixed"){this._commitValue(e.value);return}if(t==="custom"){this._preferCustomMode=!0,this._updateValue(),requestAnimationFrame(()=>{this._input.focus(),this._input.select()});return}let i=e.value;this._lastNumericUnit=i,this._preferCustomMode=!1;let r=hi(this._value);if(r.kind==="numeric"){let a=this._convertNumericValue(r,i);this._commitValue(a);return}let n=this._resolveCurrentValueForUnit(i);if(n!=null){this._commitValue(n);return}if(r.kind==="empty"){this._updateValue(),this._input.focus();return}let o=Number(this._input.value);if(!Number.isNaN(o)){this._applyNumericValue(o,i);return}this._commitValue(""),this._input.focus()}_applyTypedValue(){let e=this._select.selectedOptions.item(0),t=e?.dataset.kind;if(t==="fixed")return;if(t==="custom"){this._commitValue(this._input.value);return}let i=this._input.value?.trim()??"";if(!i){this._commitValue("");return}let r=Number(i);Number.isNaN(r)||(this._lastNumericValue=this._clampNumericValue(r)),this._commitValue(di(i,e?.value??""))}_updateValue(){if(!this._input||!this._select)return;this._previewStartValue==null&&this._renderSelectOptions();let e=this._getDisplayState(this._displayValueLock??this._value);if(this._input.value=e.inputValue,this._input.style.display=e.inputVisible?"":"none",this._input.disabled=this._readOnly||!e.inputEnabled,this._select.value=e.selectValue,this._autoSizeSelect(),e.mode==="unit"&&e.selectedUnit!=null&&(this._lastNumericUnit=e.selectedUnit),e.mode==="unit"&&e.inputValue!==""){let r=Number(e.inputValue);Number.isNaN(r)||(this._lastNumericValue=this._clampNumericValue(r))}let t=this._units.length>0,i=this._readOnly||!t||e.mode==="custom";this._scrubberButton.disabled=i,this._increaseButton.disabled=i,this._decreaseButton.disabled=i,this._applyReadonlyState()}_getDisplayState(e){let t=hi(e);if(t.kind==="numeric"){if(this._preferCustomMode)return this._createCustomDisplayState(t.numberText);if(t.unit&&this._units.length&&!this._units.includes(t.unit))return this._createCustomDisplayState(e);let r=Zd(t.unit,this._lastNumericUnit,this._units)??"";return{mode:"unit",inputValue:t.numberText,inputVisible:!0,inputEnabled:!0,selectValue:this._units.includes(r)?r:this._select.value||Ba,selectedUnit:r}}if(t.kind==="text")return!this._preferCustomMode&&this._fixedValues.includes(t.text)?{mode:"fixed",inputValue:"",inputVisible:!0,inputEnabled:!1,selectValue:t.text}:this._createCustomDisplayState(t.text);if(this._preferCustomMode)return this._createCustomDisplayState("");let i=this._lastNumericUnit??this._units[0]??"";return this._units.includes(i)?{mode:"unit",inputValue:"",inputVisible:!0,inputEnabled:!0,selectValue:i,selectedUnit:i}:this._createCustomDisplayState("")}_createCustomDisplayState(e){return!this._allowCustomValue&&this._units.length?{mode:"unit",inputValue:e,inputVisible:!0,inputEnabled:!0,selectValue:this._units[0],selectedUnit:this._units[0]}:{mode:"custom",inputValue:e,inputVisible:!0,inputEnabled:!0,selectValue:Ba}}_renderSelectOptions(){let e=this._select.value;if(this._select.replaceChildren(),this._units.length){let t=document.createElement("optgroup");t.label="Units";for(let i of this._units)t.appendChild(this._createOption(Kd(i),i,"unit"));this._select.appendChild(t)}if(this._fixedValues.length){let t=document.createElement("optgroup");t.label="Values";for(let i of this._fixedValues)t.appendChild(this._createOption(i,i,"fixed"));this._select.appendChild(t)}(this._allowCustomValue||this._select.options.length===0)&&this._select.appendChild(this._createOption("custom",Ba,"custom")),e!==""?this._select.value=e:this._select.querySelector('option[value=""]')&&(this._select.value="")}_createOption(e,t,i){let r=document.createElement("option");return r.text=e,r.value=t,r.dataset.kind=i,r}_autoSizeSelect(){if(!this._measure||!this._select)return;let e=this._select.selectedOptions.item(0);this._measure.textContent=e?.text??"";let t=this._measure.offsetWidth;t>0?this._select.style.width=t+17+"px":requestAnimationFrame(()=>this._autoSizeSelect())}_applyReadonlyState(){!this._input||!this._select||(this._input.readOnly=this._readOnly,this._select.disabled=this._readOnly)}_convertNumericValue(e,t){if(t==null)return this._value;let i=e.unit;return this._unitValueConverter?.({value:e.value,numberText:e.numberText,rawValue:this._value,fromUnit:i,toUnit:t})??di(e.numberText,t)}_resolveCurrentValueForUnit(e){if(e==null)return null;let t=this._unitValueConverter?.({value:Number.NaN,numberText:"",rawValue:this._value,fromUnit:"",toUnit:e})?.trim();return t||null}_readEditableNumericValue(e){let t=hi(this._value);if(t.kind==="numeric"){let i=this._convertNumericValue(t,e),r=hi(i);return r.kind==="numeric"?r.value:t.value}if(this._input.value?.trim()){let i=Number(this._input.value);if(!Number.isNaN(i))return i}return this._lastNumericValue}_applyNumericValue(e,t){this._lastNumericValue=this._clampNumericValue(e),this._lastNumericUnit=t,this._commitValue(di(Lr(this._lastNumericValue),t))}_previewNumericValue(e,t,i){this._lastNumericValue=this._clampNumericValue(e),this._lastNumericUnit=t;let r=i??this._getEffectiveStep(t);this._setValue(di(this._formatInteractiveNumericValue(this._lastNumericValue,r),t),!1,!0)}_commitValue(e){this._setValue(e,!0,!1)}_setValue(e,t,i){let r=e??"";if(!t&&!i&&this._previewStartValue!=null)return;let n=this._value;this._value=r,i?this._displayValueLock=r:this._displayValueLock!=null&&(r===this._displayValueLock||r!==n)&&(this._displayValueLock=null),this._preferCustomMode=!1,this._updateValue(),n!==r&&(i&&(this._previewChanged=!0,this.valuePreviewChanged.emit({newValue:r,oldValue:n})),t&&this.valueChanged.emit({newValue:r,oldValue:n}))}_startPreviewSession(){this._previewStartValue==null&&(this._previewStartValue=this._value,this._previewChanged=!1)}_finishPreviewSession(e){if(this._previewStartValue==null)return;let t=this._previewStartValue,i=this._displayValueLock??this._value,r=this._previewChanged&&t!==i,n=e||!r;this._previewStartValue=null,this._previewChanged=!1,n?(this._displayValueLock=null,this._value=t,this._updateValue()):(this._displayValueLock=i,this._updateValue()),this.valuePreviewFinished.emit({newValue:i,oldValue:t,wasCancelled:n})}_applyStepPreview(e){let t=this._select.value,i=this._getEffectiveStep(t);this._previewNumericValue(this._getInteractiveStepValue(this._readEditableNumericValue(t),e,i),t,i)}_stopStepperRepeat(){this._stepperRepeatTimeout!=null&&(window.clearTimeout(this._stepperRepeatTimeout),this._stepperRepeatTimeout=null),this._stepperRepeatInterval!=null&&(window.clearInterval(this._stepperRepeatInterval),this._stepperRepeatInterval=null)}_attachStepperWindowListeners(){window.addEventListener("pointerup",this._windowPointerUpHandler,!0),window.addEventListener("pointercancel",this._windowPointerCancelHandler,!0),window.addEventListener("blur",this._windowBlurHandler)}_attachDragWindowListeners(){window.addEventListener("pointermove",this._windowDragPointerMoveHandler,!0),window.addEventListener("pointerup",this._windowDragPointerUpHandler,!0),window.addEventListener("pointercancel",this._windowDragPointerCancelHandler,!0),window.addEventListener("blur",this._windowDragBlurHandler)}_detachStepperWindowListeners(){window.removeEventListener("pointerup",this._windowPointerUpHandler,!0),window.removeEventListener("pointercancel",this._windowPointerCancelHandler,!0),window.removeEventListener("blur",this._windowBlurHandler)}_detachDragWindowListeners(){window.removeEventListener("pointermove",this._windowDragPointerMoveHandler,!0),window.removeEventListener("pointerup",this._windowDragPointerUpHandler,!0),window.removeEventListener("pointercancel",this._windowDragPointerCancelHandler,!0),window.removeEventListener("blur",this._windowDragBlurHandler)}_calculateDraggedStepCount(e){let t=Math.abs(e),i=Math.min(t,20)/5,r=Math.max(Math.min(t-20,40),0)/3,n=Math.max(t-60,0)/2,o=Math.trunc(i+r+n);return Math.sign(e)*o}_getEffectiveStep(e){return Qd(this._unitSteps,this._step,e)}_getInteractiveStepValue(e,t,i){let r=i??this._step,n=this._clampNumericValue(e);if(!Number.isFinite(n)||!Number.isFinite(t)||t===0)return n;let o=this._min??0,a=(n-o)/r,l=Math.round(a),c=Math.abs(a-l)<1e-9,h;t>0?h=(c?l+1:Math.ceil(a))+t-1:h=(c?l-1:Math.floor(a))+t+1;let d=o+h*r;return this._clampNumericValue(this._roundToStepPrecision(d,r))}_formatInteractiveNumericValue(e,t){let i=t??this._step;return Lr(this._roundToStepPrecision(e,i),this._getStepPrecision(i))}_roundToStepPrecision(e,t){let r=10**this._getStepPrecision(t);return Math.round(e*r)/r}_getStepPrecision(e){let t=`${e??this._step}`.toLowerCase();if(t.includes("e-")){let[r,n]=t.split("e-"),o=Number(n),a=r.includes(".")?r.length-r.indexOf(".")-1:0;return o+a}let i=t.indexOf(".");return i>=0?t.length-i-1:0}_switchToUnitModeForInteraction(){let e=this._lastNumericUnit??this._units[0];if(e==null)return!1;this._preferCustomMode=!1;let t=this._resolveCurrentValueForUnit(e);return t!=null?(this._commitValue(t),this._isSelectedUnitMode()):(this._applyNumericValue(this._lastNumericValue,e),this._isSelectedUnitMode())}_isSelectedUnitMode(){return this._select.selectedOptions.item(0)?.dataset.kind==="unit"}_normalizeOptionValues(e){return $d(e)}_clampNumericValue(e){let t=e;return this._min!=null&&(t=Math.max(this._min,t)),this._max!=null&&(t=Math.min(this._max,t)),t}};customElements.define("node-projects-numeric-style-input",Qi)});import{TypedEvent as Au}from"@node-projects/base-custom-webcomponent";var pi,Fr=g(()=>{"use strict";pi=class{_services=new Map;servicesChanged=new Au;getLastService(e){let t=this._services.get(e);return t&&t.length?t[t.length-1]:null}getServices(e){return this._services.get(e)}register(e,t){this._services.has(e)||this._services.set(e,[]),this._services.get(e).push(t),this.servicesChanged.emit({serviceName:e})}registerLast(e,t){this._services.has(e)||this._services.set(e,[]),this._services.get(e).unshift(t),this.servicesChanged.emit({serviceName:e})}registerMultiple(e,t){for(let i of e)this._services.has(i)||this._services.set(i,[]),this._services.get(i).push(t),this.servicesChanged.emit({serviceName:i})}forSomeServicesTillResult(e,t){let i=this.getServices(e);if(i==null)return null;for(let r=i.length-1;r>=0;r--){let n=i[r],o=t(n);if(o!=null)return o}return null}getLastServiceWhere(e,t){let i=this.getServices(e);if(i==null)return null;for(let r=i.length-1;r>=0;r--){let n=i[r];if(t(n))return n}return null}getLastServiceResult(e,t){let i=this.getServices(e);if(i==null)return null;for(let r=i.length-1;r>=0;r--){let n=i[r],o=t(n);if(o)return o}return null}async getLastServiceWhereAsync(e,t){let i=this.getServices(e);if(i==null)return null;for(let r=i.length-1;r>=0;r--){let n=i[r];if(await t(n))return n}return null}}});import{BaseCustomWebComponentLazyAppend as ku,css as Du}from"@node-projects/base-custom-webcomponent";var qi,ja=g(()=>{"use strict";qi=class extends ku{_placeholder;_loading;static style=Du`:host{display:block;overflow:hidden;background:#fff;height:100%;width:100%;position:relative}#placeholder{position:absolute;left:24px;height:100%;width:calc(100% - 24px)}#loading{position:absolute;top:60px;left:20px}#left{position:absolute;left:0;top:0;height:100%;width:24px;border-right:solid #fff 1px;box-sizing:border-box;background:#000}span{color:#fff;rotate:270deg;display:block;position:absolute;top:35px;left:-38px;font-weight:600;font-family:monospace;font-size:24px}`;constructor(){super(),this._placeholder=document.createElement("div"),this._placeholder.id="placeholder",this._placeholder.style.transform="scale(1)",this.shadowRoot.appendChild(this._placeholder),this._loading=document.createElement("div"),this._loading.id="loading",this._loading.textContent="\u{1F6C0} Hold on, loading...",this.shadowRoot.appendChild(this._loading);let e=document.createElement("div");e.id="left";let t=document.createElement("span");t.innerText="PREVIEW",e.appendChild(t),this.shadowRoot.appendChild(e)}dispose(){}executeCommand;canExecuteCommand;async display(e,t,i,r){this._loading.hidden=!1,await e.demoProviderService.provideDemo(this._placeholder,e,t,i,r),this._loading.hidden=!0}};customElements.define("node-projects-demo-view",qi)});import{PropertyChangedArgs as zr,TypedEvent as Ji}from"@node-projects/base-custom-webcomponent";var Br,Jd=g(()=>{"use strict";Br=class{_serviceContainer;_tool;_strokeColor="black";_strokeThickness="3";_fillBrush="none";constructor(e){this._serviceContainer=e}set tool(e){if(this._tool!==e){let t=this._tool;t&&t.dispose(),this._tool=e;let i=null;for(let r of this._serviceContainer.designerTools)r[1]==e&&(i=r[0]);this.onToolChanged.emit(new zr({name:i,tool:e},{name:null,tool:t})),this._tool&&this._tool.activated(this._serviceContainer)}}get tool(){return this._tool}onToolChanged=new Ji;finishedWithTool=()=>this.tool=null;set strokeColor(e){if(this._strokeColor!==e){let t=this._strokeColor;this._strokeColor=e,this.onStrokeColorChanged.emit(new zr(e,t))}}get strokeColor(){return this._strokeColor}onStrokeColorChanged=new Ji;set strokeThickness(e){if(this._strokeThickness!==e){let t=this._strokeThickness;this._strokeThickness=e,this.onStrokeThicknessChanged.emit(new zr(e,t))}}get strokeThickness(){return this._strokeThickness}onStrokeThicknessChanged=new Ji;set fillBrush(e){if(this._fillBrush=e,this._fillBrush!==e){let t=this._fillBrush;this._fillBrush=e,this.onFillBrushChanged.emit(new zr(e,t))}}get fillBrush(){return this._fillBrush}onFillBrushChanged=new Ji;showConfigClicked=new Ji}});import{BaseCustomWebComponentConstructorAppend as Iu,css as Tu,html as Mu,TypedEvent as Nu}from"@node-projects/base-custom-webcomponent";var er,Ua=g(()=>{"use strict";er=class extends Iu{dispose(){}canvasElement;elementsToPackages;onTextChanged=new Nu;_text;static style=Tu`:host{display:block;height:100%;width:100%}textarea{height:100%;width:100%;resize:none;white-space:nowrap;box-sizing:border-box}`;static template=Mu`<div id="container" style="width:100%;height:100%;position:absolute"><textarea id="text"></textarea></div>`;executeCommand(e){}canExecuteCommand(e){return!1}async ready(){this._text=this._getDomElement("text")}focusEditor(){requestAnimationFrame(()=>{this.focus(),this._text.focus()})}activated(){}update(e){this._text.value=e}getText(){return this._text.value}setSelection(e){this._text.setSelectionRange(e.start,e.start+e.length)}};customElements.define("node-projects-code-view-simple",er)});var Ou,Hr,Ya=g(()=>{"use strict";Fr();ja();Jd();Ua();Ou=navigator.maxTouchPoints>0,Hr=class extends pi{config={codeViewWidget:er,demoViewWidget:qi};designerExtensions=new Map;removeDesignerExtensionOfType(e,t){let i=this.designerExtensions.get(e);for(let r=0;r<i.length;r++)i[r].constructor===t&&i.splice(r,1)}instanceServiceContainerCreatedCallbacks=[];designViewConfigButtons=[];designViewToolbarButtons=[];designerPointerExtensions=[];designerContextMenuExtensions;overlayLayerViewAdditionalStyles=[];globalContext=new Br(this);options={zoomDesignerBackground:!0,roundPixelsToDecimalPlaces:0,resizerPixelSize:Ou?8:3};designerTools=new Map;get bindingService(){return this.getLastService("bindingService")}get bindableObjectsServices(){return this.getServices("bindableObjectsService")}get bindableObjectDragDropService(){return this.getLastService("bindableObjectDragDropService")}get propertyGridDragDropService(){return this.getLastService("propertyGridDragDropService")}get dragDropService(){return this.getLastService("dragDropService")}get elementInteractionServices(){return this.getServices("elementInteractionService")}get propertiesServices(){return this.getServices("propertyService")}get attachedPropertyServices(){return this.getServices("attachedPropertyService")}get propertyGroupService(){return this.getLastService("propertyGroupsService")}get containerServices(){return this.getServices("containerService")}get snaplinesProviderService(){return this.getLastService("snaplinesProviderService")}get elementsServices(){return this.getServices("elementsService")}get eventsService(){return this.getServices("eventsService")}get instanceServices(){return this.getServices("instanceService")}get propertyEditorTypesServices(){return this.getServices("propertyEditorTypesService")}get htmlWriterService(){return this.getLastService("htmlWriterService")}get htmlParserService(){return this.getLastService("htmlParserService")}get intializationService(){return this.getLastService("intializationService")}get elementAtPointService(){return this.getLastService("elementAtPointService")}get externalDragDropService(){return this.getLastService("externalDragDropService")}get copyPasteService(){return this.getLastService("copyPasteService")}get modelCommandService(){return this.getLastService("modelCommandService")}get demoProviderService(){return this.getLastService("demoProviderService")}get designItemService(){return this.getLastService("designItemService")}get configUiServices(){return this.getServices("configUiService")}get refactorServices(){return this.getServices("refactorService")}get deletionService(){return this.getLastService("deletionService")}get referencesChangedService(){return this.getLastService("referencesChangedService")}get miniatureViewService(){return this.getLastService("miniatureViewService")}get pngCreatorService(){return this.getLastService("pngCreatorService")}get searchService(){return this.getLastService("searchService")}get editorTypesServices(){return this.getServices("editorTypeService")}}});var V,Se=g(()=>{"use strict";V=class{static isTypescriptEnum(e){if(e&&typeof e=="object"&&e.constructor==Object){for(let t in e){let i=typeof e[t];if(i!=="string"&&i!=="number")return!1}return!0}return!1}static getTypescriptEnumEntries(e){let t=[];for(let i in e)isNaN(i)&&t.push([i,e[i]]);return t}static camelToDashCase(e){return e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`)}static dashToCamelCase(e){return e.replace(/-([a-z])/g,t=>t[1].toUpperCase())}}});var W,mt=g(()=>{"use strict";(function(s){s.none="none",s.all="all",s.some="some",s.bound="bound",s.fromStylesheet="fromStylesheet"})(W||(W={}))});var L,$e=g(()=>{"use strict";(function(s){s.explicitProperty="explicitProperty",s.property="property",s.attribute="attribute",s.class="class",s.css="css",s.cssvar="cssvar",s.event="event",s.content="content",s.visible="visible"})(L||(L={}))});var x,ye=g(()=>{"use strict";(function(s){s.property="property",s.attribute="attribute",s.propertyAndAttribute="propertyAndAttribute",s.cssValue="cssvalue",s.complex="complex",s.add="add"})(x||(x={}))});var A,$=g(()=>{"use strict";(function(s){s[s.Element=1]="Element",s[s.Attribute=2]="Attribute",s[s.TextNode=3]="TextNode",s[s.Comment=8]="Comment",s[s.Document=9]="Document",s[s.DocumentFragment=11]="DocumentFragment"})(A||(A={}))});function ox(s){return s.getRootNode()?.host?.localName=="node-projects-designer-canvas"}function Gr(s,e){return e.createRange().createContextualFragment(s,{includeShadowRoots:!0}).firstChild}function ep(s,e){return s instanceof e||s instanceof(s.ownerDocument.defaultView??window)[e.name]}function Xa(s,...e){for(let t of e)if(s instanceof t||s instanceof(s.ownerDocument.defaultView??window)[t.name])return!0;return!1}function It(s){return s==null||Xa(s,SVGElement,HTMLHtmlElement,HTMLHeadElement,HTMLBodyElement,HTMLSelectElement,HTMLOptionElement)?!1:(s.ownerDocument.defaultView??window).getComputedStyle(s).display.startsWith("inline")}function jt(s){return s==null||Xa(s,SVGElement,HTMLHtmlElement,HTMLHeadElement,HTMLBodyElement,HTMLSelectElement,HTMLOptionElement)?!1:(s.ownerDocument.defaultView??window).getComputedStyle(s).display.startsWith("inline")}function tp(s){if(Xa(s,SVGElement,HTMLHtmlElement,HTMLHeadElement,HTMLBodyElement)||ep(s,MathMLElement))return Fe.block;let e=(s.ownerDocument.defaultView??window).getComputedStyle(s).display;return e=="none"?Fe.none:e.startsWith("inline")?Fe.inline:Fe.block}function Wr(s){return s.textContent.trim()==""&&s.textContent.indexOf("\xA0")<0}function ax(){let s=document.activeElement,e=null;for(;s!=e;)e=s,s.shadowRoot!=null&&s.shadowRoot.activeElement&&(s=s.shadowRoot.activeElement);return s}function lx(s){if(ep(s,HTMLElement))return{x:s.offsetLeft,y:s.offsetTop};{let e=U(s),t=U(s.parentElement);return{x:e.x-t.x,y:e.y-t.y}}}function U(s){let e=s.getBoundingClientRect();if(e.width==0&&e.height==0&&(s.ownerDocument.defaultView??window).getComputedStyle(s).display=="contents")if(s.shadowRoot)for(let i of s.shadowRoot.children){let r=U(i);e=new DOMRect(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.width,r.width),Math.max(e.height,r.height))}else for(let i of s.children){let r=U(i);e=new DOMRect(Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.width,r.width),Math.max(e.height,r.height))}return e}function jr(s){let e=(s.ownerDocument.defaultView??window).getComputedStyle(s).zoom;if(!e||e==="normal")return 1;if(e.endsWith("%")){let i=parseFloat(e);return Number.isFinite(i)&&i>0?i/100:1}let t=parseFloat(e);return Number.isFinite(t)&&t>0?t:1}function ip(s){let e=parseInt(getComputedStyle(s).paddingLeft.replace("px",""))+parseInt(getComputedStyle(s).marginLeft.replace("px",""))+parseInt(getComputedStyle(s).borderLeft.replace("px",""))+parseInt(getComputedStyle(s).paddingRight.replace("px",""))+parseInt(getComputedStyle(s).marginRight.replace("px",""))+parseInt(getComputedStyle(s).borderRight.replace("px","")),t=parseInt(getComputedStyle(s).paddingTop.replace("px",""))+parseInt(getComputedStyle(s).marginTop.replace("px",""))+parseInt(getComputedStyle(s).borderTop.replace("px",""))+parseInt(getComputedStyle(s).paddingBottom.replace("px",""))+parseInt(getComputedStyle(s).marginBottom.replace("px",""))+parseInt(getComputedStyle(s).borderBottom.replace("px",""));return{x:e,y:t}}function Ut(s,e){let t={x:Number.MAX_VALUE,y:Number.MAX_VALUE},i={x:Number.MIN_VALUE,y:Number.MIN_VALUE},r;for(let n of s)n.nodeType==A.TextNode||n.nodeType==A.Comment||(r={x:e.getNormalizedElementCoordinates(n.element).x,y:e.getNormalizedElementCoordinates(n.element).y,width:e.getNormalizedElementCoordinates(n.element).width,height:e.getNormalizedElementCoordinates(n.element).height},r.x<t.x&&(t.x=r.x),r.y<t.y&&(t.y=r.y),r.x+r.width>i.x&&(i.x=r.x+r.width),r.y+r.height>i.y&&(i.y=r.y+r.height));return{x:t.x,y:t.y,width:i.x-t.x,height:i.y-t.y}}var Fe,he=g(()=>{"use strict";$();(function(s){s[s.none=0]="none",s[s.inline=1]="inline",s[s.block=2]="block"})(Fe||(Fe={}))});var ee,Ne=g(()=>{"use strict";mt();Se();$e();ye();$();he();ee=class s{constructor(e){this._recreateElementsOnPropertyChange=e}_recreateElementsOnPropertyChange=!1;static _stylesCache=new Map;_cssCacheClearTimer;static _bindingsCache=new Map;static _bindingsCacheClearTimer;_notifyChangedProperty(e,t,i){}async getProperty(e,t){let i=await this.getProperties(e);return"properties"in i[0]?i.flatMap(r=>r.properties).find(r=>r.name==t):i.find(r=>r.name==t)}async setValue(e,t,i){let r=e[0].openGroup("property changed: "+t.name+" to "+i);for(let n of e)if(this.isHandledElement(n)&&this.getProperty(n,t.name)){if(t.propertyType==x.cssValue)await n.updateStyleInSheetOrLocalAsync(t.propertyName??t.name,i),n.element.setAttribute("style",n.element.getAttribute("style"));else{let o=t.attributeName;if(o||(o=V.camelToDashCase(t.name)),t.type==="object"){let a=JSON.stringify(i);t.propertyType==x.propertyAndAttribute?n.setPropertyAndAttribute(t.name,a):t.propertyType==x.attribute?n.setAttribute(o,a):t.propertyType==x.property&&n.setProperty(t.name,i)}else t.type=="boolean"&&(i===!1||i==null)?((t.propertyType==x.attribute||t.propertyType==x.propertyAndAttribute)&&n.removeAttribute(o),(t.propertyType==x.property||t.propertyType==x.propertyAndAttribute)&&n.setProperty(t.name,!1)):t.type=="boolean"&&i===!0?((t.propertyType==x.attribute||t.propertyType==x.propertyAndAttribute)&&n.setAttribute(o,""),(t.propertyType==x.property||t.propertyType==x.propertyAndAttribute)&&n.setProperty(t.name,!0)):t.propertyType==x.propertyAndAttribute?n.setPropertyAndAttribute(t.name,i):t.propertyType==x.attribute?n.setAttribute(o,i.toString()):t.propertyType==x.property&&n.setProperty(t.name,i)}this._notifyChangedProperty(n,t,i)}r.commit(),this._recreateElementsOnPropertyChange&&s.recreateElements(this,e)}getPropertyTarget(e,t){return t.propertyType==x.attribute?L.attribute:t.propertyType==x.cssValue?L.css:L.property}clearValue(e,t,i){let r=e[0].openGroup("property cleared: "+t.name);for(let n of e){if(i!="binding"){if(t.propertyType==x.cssValue)n.removeStyle(t.propertyName??t.name);else if((t.propertyType==x.property||t.propertyType==x.propertyAndAttribute)&&(n.element[t.propertyName??t.name]=null),t.propertyType==x.attribute||t.propertyType==x.propertyAndAttribute){let o=t.attributeName;o||(o=V.camelToDashCase(t.name)),n.removeAttribute(o)}}i!="value"&&n.serviceContainer.forSomeServicesTillResult("bindingService",o=>o.clearBinding(n,t.name,this.getPropertyTarget(n,t))),this._notifyChangedProperty(n,t,void 0)}r.commit(),this._recreateElementsOnPropertyChange&&s.recreateElements(this,e)}isSet(e,t){let i=!0,r=!1;if(e!=null&&e.length!==0){let n=t.attributeName;n||(n=V.camelToDashCase(t.name));for(let a of e){let l=!1;if(t.propertyType==x.cssValue?l=a.hasStyle(t.name):l=a.hasAttribute(n),i=i&&l,r=r||l,!i&&r)break}let o=s.getOrBuildCachedBindings(e[0]);if(t.propertyType==x.cssValue){if(o&&o.find(a=>(a.target==L.css||a.target==L.cssvar)&&a.targetName==t.name))return W.bound}else if(t.propertyType==x.attribute){if(o&&o.find(a=>a.target==L.attribute&&a.targetName==t.name))return W.bound}else if(t.propertyType==x.property){if(o&&o.find(a=>(a.target==L.property||a.target==L.explicitProperty)&&a.targetName==t.name))return W.bound}else if(o&&o.find(a=>(a.target==L.property||a.target==L.explicitProperty||a.target==L.attribute)&&a.targetName==t.name))return W.bound;if(!i&&t.propertyType==x.cssValue){let a=s._stylesCache.get(e[0]);if(a||(a=new Set(e[0].getAllStyles().filter(c=>c.selector!=null).flatMap(c=>c.declarations).map(c=>c.name)),s._stylesCache.set(e[0],a),clearTimeout(this._cssCacheClearTimer),this._cssCacheClearTimer=setTimeout(()=>s._stylesCache.clear(),30)),a.has(t.propertyName??t.name))return W.fromStylesheet}}else return W.none;return i?W.all:r?W.some:W.none}static getOrBuildCachedBindings(e){let t=s._bindingsCache.get(e);if(!t){let i=e.serviceContainer.getServices("bindingService");if(t=[],i)for(let r of i){let n=r.getBindings(e);n&&n.length>0&&t.push(...n)}s._bindingsCache.set(e,t),clearTimeout(this._bindingsCacheClearTimer),this._bindingsCacheClearTimer=setTimeout(()=>s._bindingsCache.clear(),30)}return t}getValue(e,t){if(e!=null&&e.length!==0)if(t.propertyType==x.cssValue){let i=e[0].getStyle(t.propertyName??t.name);for(let r of e)if(r.getStyle(t.name)!=i){i=null;break}return i}else if(t.propertyType==x.property){let i=t.propertyName;return i||(i=V.dashToCamelCase(t.name)),e[0].element[i]}else{let i=t.attributeName;if(i||(i=V.camelToDashCase(t.name)),t.type=="boolean"){if(e[0].hasAttribute(i)){let n=e[0].getAttribute(i);return n==""?!0:n}return!1}return e[0].getAttribute(i)}return null}getBinding(e,t){let i=s.getOrBuildCachedBindings(e[0]);return i!=null?t.propertyType==x.cssValue?i.find(r=>(r.target==L.css||r.target==L.cssvar)&&r.targetName==t.name):t.propertyType==x.attribute?i.find(r=>r.target==L.attribute&&r.targetName==t.name):t.propertyType==x.property?i.find(r=>(r.target==L.property||r.target==L.explicitProperty)&&r.targetName==t.name):i.find(r=>(r.target==L.property||r.target==L.explicitProperty||r.target==L.attribute)&&r.targetName==t.name):null}getUnsetValue(e,t){return t.propertyType==x.cssValue?e!=null&&e.length!==0&&e[0].nodeType==A.Element?window.getComputedStyle(e[0].element)[t.propertyName??t.name]:null:t.defaultValue}static recreateElements(e,t){for(let i of t){if(!e.isHandledElement(i))continue;let r="<"+i.name+" ";for(let o of i.element.attributes)r+=o.name+'="'+o.value.replaceAll('"',""")+'" ';r+="></"+i.name+">";let n=Gr(r,t[0].document);for(let o of[...i.element.childNodes])n.appendChild(o);n.style.pointerEvents="auto",i.node.insertAdjacentElement("beforebegin",n),i.node.parentNode&&i.node.parentNode.removeChild(i.node),i.replaceNode(n)}}getContextMenu(e,t){let i=[{title:"clear",action:r=>{t.service.clearValue(e,t,"value"),e[0].instanceServiceContainer.designerCanvas.extensionManager.refreshAllExtensions(e)}},{title:"edit as text",action:(r,n,o,a)=>{a.close(),setTimeout(async()=>{let l=t.service.getValue(e,t),c=prompt(`edit value of '${t.name}' as string:`,l);c&&c!=l&&await t.service.setValue(e,t,c),e[0].instanceServiceContainer.designerCanvas.extensionManager.refreshAllExtensions(e)},10)}}];return e[0].serviceContainer.config.openBindingsEditor&&(i.push({title:"-"},{title:"edit binding",action:()=>{let r=t.service.getPropertyTarget(e[0],t),n=t.service.getBinding(e,t);e[0].serviceContainer.config.openBindingsEditor(t,e,n,r)}}),t.service.isSet(e,t)==W.bound&&i.push({title:"clear binding",action:()=>{t.service.clearValue(e,t,"binding"),e[0].instanceServiceContainer.designerCanvas.extensionManager.refreshAllExtensions(e)}})),i}}});var H,me=g(()=>{"use strict";(function(s){s[s.none=0]="none",s[s.full=1]="full",s[s.fullOnValueChange=2]="fullOnValueChange",s[s.fullOnClassChange=3]="fullOnClassChange"})(H||(H={}))});var st,mi=g(()=>{"use strict";Se();Ne();ye();me();st=class extends ee{getRefreshMode(e){return H.fullOnClassChange}async getProperties(e){return this.isHandledElement(e)&&e.element?.constructor?.properties?this.parseProperties(e.element.constructor.properties):null}parseProperties(e){let t=[],i=Object.keys(e),r=Object.groupBy(i,n=>e[n].group??"");for(let n in r){let o={name:n,properties:[]};for(let a of r[n]){let l=e[a],c=l,h=null,d=null,p=!1,m=x.propertyAndAttribute;if(l.type&&(c=l.type,h=l.description,d=l.example,p=l.readonly,m=l.readonly?x.property:x.propertyAndAttribute),c===String){let u={name:a,type:"string",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(c===Object){let u={name:a,type:"object",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(c===Number){let u={name:a,type:"number",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(c===Date){let u={name:a,type:"date",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(c===Boolean){let u={name:a,type:"boolean",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(V.isTypescriptEnum(c)){let u={name:a,type:"enum",enumValues:V.getTypescriptEnumEntries(c),service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else if(typeof c=="string"){let u={name:a,type:c,service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}else{let u={name:a,type:"string",service:this,propertyType:m,description:h,example:d,readonly:p};o.properties.push(u)}}o.name==""?t.push(...o.properties):t.push(o)}return t}getUnsetValue(e,t){return e[0].element[t.propertyName??t.name]}}});var Ur,Ka=g(()=>{"use strict";mi();Ur=class extends st{name="polymer";isHandledElement(e){return e.element.constructor.polymerElementVersion!=null}_notifyChangedProperty(e,t,i){e.element.set(t.name,i)}}});var Yr,$a=g(()=>{"use strict";mi();Yr=class extends st{name="lit";isHandledElement(e){let t=e.element.constructor.__proto__;for(;t!=null;){if(t.name=="LitElement")return!0;if(t.name==null||t.name=="HTMLElement"||t.name=="Element"||t.name=="Node"||t.name=="HTMLElement")return!1;t=t.__proto__}return!1}_notifyChangedProperty(e,t,i){}}});var Xr,Za=g(()=>{"use strict";ye();me();Ne();Xr=class extends ee{inputProperties=[{name:"type",type:"list",values:["text","number","button","checkbox","color","date","datetime-local","email","file","hidden","image","month","password","radio","range","reset","search","submit","tel","time","url","week"],service:this,defaultValue:"text",propertyType:x.propertyAndAttribute},{name:"value",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"placeholder",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"checked",type:"boolean",service:this,propertyType:x.propertyAndAttribute},{name:"min",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"max",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"readonly",type:"boolean",service:this,propertyType:x.propertyAndAttribute},{name:"valueAsDate",type:"string",service:this,propertyType:x.property},{name:"valueAsNumber",type:"string",service:this,propertyType:x.property}];textareaProperties=[{name:"value",type:"string",service:this,propertyType:x.property},{name:"placeholder",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"maxlength",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"cols",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"rows",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"readonly",type:"boolean",service:this,propertyType:x.propertyAndAttribute},{name:"resize",type:"list",values:["both","none","horizontal","vertical"],service:this,propertyType:x.cssValue}];selectProperties=[{name:"value",type:"string",service:this,propertyType:x.property},{name:"size",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"multiple",type:"boolean",service:this,propertyType:x.propertyAndAttribute}];buttonProperties=[{name:"type",type:"list",values:["button","submit","reset"],service:this,defaultValue:"button",propertyType:x.propertyAndAttribute},{name:"value",type:"string",service:this,propertyType:x.propertyAndAttribute}];anchorProperties=[{name:"href",type:"string",service:this,propertyType:x.propertyAndAttribute}];divProperties=[{name:"title",type:"string",service:this,propertyType:x.propertyAndAttribute}];imgProperties=[{name:"src",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"alt",type:"string",service:this,propertyType:x.propertyAndAttribute}];iframeProperties=[{name:"src",type:"string",service:this,propertyType:x.propertyAndAttribute}];formElementProperties=[{name:"autofocus",type:"boolean",service:this,propertyType:x.propertyAndAttribute},{name:"disabled",type:"boolean",service:this,propertyType:x.propertyAndAttribute},{name:"required",type:"boolean",service:this,propertyType:x.propertyAndAttribute}];meterProperties=[{name:"value",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"min",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"max",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"low",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"high",type:"number",service:this,propertyType:x.propertyAndAttribute},{name:"optimum",type:"number",service:this,propertyType:x.propertyAndAttribute}];name="native";getRefreshMode(e){return H.full}isHandledElement(e){switch(e.element.localName){case"input":case"textarea":case"select":case"button":case"a":case"div":case"span":case"br":case"img":case"iframe":case"meter":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"p":return!0}return!1}async getProperty(e,t){return(await this.getProperties(e)).find(i=>i.name==t)}async getProperties(e){if(!this.isHandledElement(e))return null;switch(e.element.localName){case"input":return[...this.inputProperties,...this.formElementProperties];case"textarea":return[...this.textareaProperties,...this.formElementProperties];case"select":return[...this.selectProperties,...this.formElementProperties];case"button":return[...this.buttonProperties,...this.formElementProperties];case"a":return this.anchorProperties;case"div":return this.divProperties;case"img":return this.imgProperties;case"iframe":return this.iframeProperties;case"meter":return this.meterProperties;case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"p":return[]}return null}}});var Ue,ui=g(()=>{"use strict";ye();Ne();me();Ue=class extends ee{getRefreshMode(e){return H.none}commonProperties=[{name:"class",type:"string",service:this,attributeName:"class",propertyName:"className",propertyType:x.attribute},{name:"title",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"part",type:"string",service:this,propertyType:x.propertyAndAttribute},{name:"tabindex",type:"number",service:this,propertyType:x.propertyAndAttribute}];name="common";isHandledElement(e){return!e.isRootItem}async getProperty(e,t){return this.commonProperties.find(i=>i.name==t)}async getProperties(e){return this.commonProperties}}});var Kr,Qa=g(()=>{"use strict";ui();ye();me();Kr=class extends Ue{rectProperties=[{name:"x",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"y",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"width",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"height",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"rx",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"ry",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"pathLength",type:"svg-length",service:this,propertyType:x.attribute},{name:"fill",type:"color",defaultValue:"transparent",service:this,propertyType:x.attribute},{name:"fill-opacity",type:"number",defaultValue:"1",service:this,propertyType:x.attribute}];lineProperties=[{name:"x1",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"y1",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"x2",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"y2",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"pathLength",type:"svg-length",service:this,propertyType:x.attribute}];ellipseProperties=[{name:"cx",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"cy",type:"svg-length",defaultValue:"0",service:this,propertyType:x.attribute},{name:"rx",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"ry",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"pathLength",type:"svg-length",service:this,propertyType:x.attribute},{name:"fill",type:"color",defaultValue:"transparent",service:this,propertyType:x.attribute},{name:"fill-opacity",type:"number",defaultValue:"1",service:this,propertyType:x.attribute}];pathProperties=[{name:"d",type:"string",defaultValue:"",service:this,propertyType:x.attribute},{name:"pathLength",type:"svg-length",service:this,propertyType:x.attribute}];svgProperties=[{name:"width",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"height",type:"svg-length",defaultValue:"auto",service:this,propertyType:x.attribute},{name:"viewBox",type:"string",service:this,propertyType:x.attribute}];defaultProperties=[{name:"stroke",type:"color",defaultValue:"currentcolor",service:this,propertyType:x.attribute},{name:"stroke-width",type:"svg-length",service:this,propertyType:x.attribute},{name:"stroke-opacity",type:"number",defaultValue:"1",service:this,propertyType:x.attribute},{name:"visibility",type:"list",values:["visible","hidden"],defaultValue:"visible",service:this,propertyType:x.attribute}];name="svg";getRefreshMode(e){return H.fullOnClassChange}isHandledElement(e){switch(e.element.localName){case"rect":case"line":case"ellipse":case"path":case"svg":return!0}return!1}async getProperty(e,t){return(await this.getProperties(e)).find(i=>i.name==t)}async getProperties(e){let t=null;if(!this.isHandledElement(e))return null;switch(e.element.localName){case"rect":t=[...this.rectProperties,...this.defaultProperties];break;case"line":t=[...this.lineProperties,...this.defaultProperties];break;case"ellipse":t=[...this.ellipseProperties,...this.defaultProperties];break;case"path":t=[...this.pathProperties,...this.defaultProperties];break;case"svg":t=this.svgProperties;break}if(e.element.localName=="line"||e.element.localName=="path"){let i=this.getAllMarkerIds(e);(i.length>0||e.hasAttribute("marker-start"))&&t.push({name:"marker-start",type:"string",values:i,service:this,propertyType:x.attribute}),(i.length>0||e.hasAttribute("marker-mid"))&&t.push({name:"marker-mid",type:"string",values:i,service:this,propertyType:x.attribute}),(i.length>0||e.hasAttribute("marker-end"))&&t.push({name:"marker-end",type:"string",values:i,service:this,propertyType:x.attribute})}return t}getAllMarkerIds(e){return[...e.element.ownerSVGElement.querySelectorAll("defs > marker")].map(n=>`url(#${n.id})`).filter(n=>!!n)}}});var fi,qa=g(()=>{"use strict";fi=class{constructor(e,t,i,r){this.title="Change Css Style "+t+" of <"+e.name+">",this.designItem=e,this.name=t,this.newValue=i,this.oldValue=r}title;get affectedItems(){return[this.designItem]}undo(){return this.oldValue===""||this.oldValue==null?(this.designItem._withoutUndoRemoveStyle(this.name),this.name.startsWith("--")?this.designItem.element.style.removeProperty(this.name):this.designItem.element.style[this.name]="",[{changeType:"changed",designItems:this.affectedItems,type:"css",name:this.name,oldValue:this.newValue,newValue:null}]):(this.designItem._withoutUndoSetStyle(this.name,this.oldValue),this.name.startsWith("--")?this.designItem.element.style.setProperty(this.name,this.oldValue):this.designItem.element.style[this.name]=this.oldValue,[{changeType:"changed",designItems:this.affectedItems,type:"css",name:this.name,oldValue:this.newValue,newValue:this.oldValue}])}do(){return this.newValue===""||this.newValue==null?(this.designItem._withoutUndoRemoveStyle(this.name),this.name.startsWith("--")?this.designItem.element.style.removeProperty(this.name):this.designItem.element.style[this.name]="",[{changeType:"changed",designItems:this.affectedItems,type:"css",name:this.name,oldValue:this.oldValue,newValue:null}]):(this.designItem._withoutUndoSetStyle(this.name,this.newValue),this.name.startsWith("--")?this.designItem.element.style.setProperty(this.name,this.newValue):this.designItem.element.style[this.name]=this.newValue,[{changeType:"changed",designItems:this.affectedItems,type:"css",name:this.name,oldValue:this.oldValue,newValue:this.newValue}])}designItem;name;newValue;oldValue;mergeWith(e){return!1}}});var tr,Ja=g(()=>{"use strict";tr=class s{constructor(e,t,i,r){this.title="Change Attribute "+t+" of <"+e.name+">",this.designItem=e,this.name=t,this.newValue=i,this.oldValue=r}title;get affectedItems(){return[this.designItem]}undo(){if(this.oldValue==null)return this.designItem._withoutUndoRemoveAttribute(this.name),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.name,oldValue:this.newValue,newValue:null}];{let e=this.oldValue;return typeof this.oldValue!="string"&&(e=this.oldValue.toString()),this.designItem._withoutUndoSetAttribute(this.name,e),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.name,oldValue:this.newValue,newValue:e}]}}do(){if(this.newValue==null)return this.designItem._withoutUndoRemoveAttribute(this.name),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.name,oldValue:this.newValue,newValue:null}];{let e=this.newValue;return typeof this.newValue!="string"&&(e=this.newValue.toString()),this.designItem._withoutUndoSetAttribute(this.name,e),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.name,oldValue:this.oldValue,newValue:e}]}}designItem;name;newValue;oldValue;mergeWith(e){return e instanceof s&&this.designItem===e.designItem&&this.name===e.name?(this.newValue=e.newValue,!0):!1}}});var P,Ze=g(()=>{"use strict";(function(s){s[s.Directly=0]="Directly",s[s.Permanent=1]="Permanent",s[s.Selection=2]="Selection",s[s.PrimarySelection=3]="PrimarySelection",s[s.PrimarySelectionContainer=4]="PrimarySelectionContainer",s[s.MouseOver=5]="MouseOver",s[s.OnlyOneItemSelected=6]="OnlyOneItemSelected",s[s.MultipleItemsSelected=7]="MultipleItemsSelected",s[s.ContainerDragOverAndCanBeEntered=8]="ContainerDragOverAndCanBeEntered",s[s.ContainerExternalDragOverAndCanBeEntered=9]="ContainerExternalDragOverAndCanBeEntered",s[s.ContainerDrag=10]="ContainerDrag",s[s.Doubleclick=11]="Doubleclick",s[s.Placement=12]="Placement",s[s.PrimarySelectionAndCanBeEntered=13]="PrimarySelectionAndCanBeEntered",s[s.PrimarySelectionContainerAndCanBeEntered=14]="PrimarySelectionContainerAndCanBeEntered",s[s.PrimarySelectionRefreshed=15]="PrimarySelectionRefreshed",s[s.ManualApplied=16]="ManualApplied"})(P||(P={}))});var ot,$r,Zr,el=g(()=>{"use strict";(function(s){s[s.Name=0]="Name",s[s.Value=1]="Value",s[s.InQuote=2]="InQuote"})(ot||(ot={}));$r=class{constructor(e,t){this.name=e.trim(),this.value=t.trim()}name;value},Zr=class{entries=[];parse(e,t="'"){this.entries=[];let i="",r="",n=ot.Name;for(let o=0;o<e.length;o++){let a=e[o];n===ot.Name?a===":"?n=ot.Value:a===";"?i="":i+=a:n===ot.Value?a===";"?(this.entries.push(new $r(i,r)),i="",r="",n=ot.Name):(a===t&&(n=ot.InQuote),r+=a):n===ot.InQuote&&(a==="\\"?(r+=a,o++,a=e[o],r+=a):a===t?(r+=a,n=ot.Value):r+=a)}i.trim()!==""&&this.entries.push(new $r(i,r))}}});var Tt,tl=g(()=>{"use strict";Tt=class{constructor(e,t,i){this.title="Move or Insert Item",this.designItem=e,this.newParent=t,this.newIndex=i}title;get affectedItems(){return this.oldParent?[this.designItem,this.newParent,this.oldParent]:[this.designItem,this.newParent]}undo(){return this.oldParent?(this.oldParent._insertChildInternal(this.designItem,this.oldIndex),[{changeType:"moved",designItems:[this.designItem]}]):(this.designItem.parent._removeChildInternal(this.designItem),[{changeType:"removed",designItems:[this.designItem]}])}do(){return this.oldParent=this.designItem.parent,this.oldParent&&(this.oldIndex=this.designItem.parent.indexOf(this.designItem)),this.newParent._insertChildInternal(this.designItem,this.newIndex),[{changeType:this.oldParent?"moved":"added",designItems:[this.designItem]}]}designItem;newParent;newIndex;oldParent;oldIndex;newItem;mergeWith(e){return!1}}});var Qr,il=g(()=>{"use strict";Qr=class{_textHolder="";indent=4;level=0;get position(){return this._textHolder.length}isLastCharNewline(){return this._textHolder[this._textHolder.length-1]===`
|
|
2
2
|
`}levelRaise(){this.level++}levelShrink(){this.level--}write(e){this._textHolder+=e}writeLine(e){this.writeIndent(),this._textHolder+=e,this.writeNewline()}writeIndent(){this._textHolder+="".padEnd(this.level*this.indent," ")}writeNewline(){this._textHolder+=`
|
|
3
3
|
`}getString(){return this._textHolder}}});var qr,rp=g(()=>{"use strict";qr=class{_textHolder="";get position(){return this._textHolder.length}isLastCharNewline(){return this._textHolder[this._textHolder.length-1]===`
|
|
4
4
|
`}levelRaise(){}levelShrink(){}write(e){this._textHolder+=e}writeLine(e){this._textHolder+=e}writeIndent(){}writeNewline(){}getString(){return this._textHolder}}});var Q,Qe=g(()=>{"use strict";il();rp();Q=class{static normalizeAttributeValue(e,t=!1){return typeof e=="number"&&(e=e.toString()),e?t?e.replaceAll("&","&").replaceAll("'","'").replaceAll("<","<").replaceAll(">",">"):e.replaceAll("&","&").replaceAll('"',""").replaceAll("<","<").replaceAll(">",">"):e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}static normalizeContentValue(e){return e&&e.replaceAll("&","&").replaceAll("<","<").replaceAll("\xA0"," ")}static IsSelfClosingElement(e){return e==="area"||e==="base"||e==="br"||e==="col"||e==="embed"||e==="hr"||e==="img"||e==="input"||e==="keygen"||e==="link"||e==="meta"||e==="param"||e==="source"||e==="track"||e==="wbr"}static ConvertToString(e,t,i=!1){let r=t!==!1?new Qr:new qr;return e[0].serviceContainer.htmlWriterService.write(r,e,!0,i),r.getString()}}});import{css as Lu}from"@node-projects/base-custom-webcomponent";var we,Mt=g(()=>{"use strict";we=class s{static _contextMenuCss=Lu`.context_menu{position:fixed;inset:auto;margin:0;border:none;background:0 0;overflow:visible;opacity:0;transform:scale(0);transition:transform .1s;transform-origin:top left;padding:0;z-index:2147483647;color:#000}.context_menu.context_menu_display{opacity:1;transform:scale(1)}.context_menu,.context_menu *{box-sizing:border-box}.context_menu *{position:relative}.context_menu ul{list-style-type:none;padding:3px;margin:0;border:none;background-color:#f5f7f7;box-shadow:0 0 5px #333;max-inline-size:calc(100vw - 8px);max-block-size:calc(100vh - 8px);overflow:auto;overscroll-behavior:contain;isolation:isolate}.context_menu ul[popover]{inset:auto;margin:0;border:none}.context_menu li{padding:0;padding-right:1.7em;cursor:pointer;white-space:nowrap;display:flex;align-items:center}.context_menu li:hover{background-color:#bbb}.context_menu li .context_menu_icon_span{width:28px;display:inline-flex;align-items:center;justify-content:center}.context_menu li .context_menu_icon_span img{height:18px}.context_menu li .context_menu_text{padding-left:2px;vertical-align:middle}.context_menu li .context_menu_sub_span{width:1em;display:inline-block;text-align:center;position:absolute;top:50%;right:.5em;transform:translateY(-50%)}.context_menu li>ul{position:absolute;inset:auto;top:0;left:100%;opacity:0;transition:opacity .2s;visibility:hidden}.context_menu li>ul.context_menu_submenu_popover{position:fixed}.context_menu li>ul:popover-open{opacity:1;visibility:visible}.context_menu li.context_menu_divider{border-bottom:1px solid #aaa;margin:5px;padding:0;cursor:default}.context_menu li.context_menu_divider:hover{background-color:inherit}.context_menu li[disabled=""]{color:#777;cursor:default}.context_menu li[disabled=""]:hover{background-color:inherit}.context_menu li.context_menu_marked{background-color:#5ebdec}`;static count=0;static _openedContextMenus=new Set;menu;options;context;num;_menuElement;constructor(e,t,i){this.num=s.count++,this.menu=e,this.options=t,this.context=i,this.reload(),this._windowDown=this._windowDown.bind(this),this._windowKeyUp=this._windowKeyUp.bind(this),this._windowResize=this._windowResize.bind(this)}reload(){let e=this.options?.shadowRoot??document;this._menuElement==null&&(this._menuElement=document.createElement("div"),this._menuElement.className="context_menu",this._menuElement.id="context_menu_"+this.num,this._menuElement.setAttribute("popover","manual"),e===document?document.body.appendChild(this._menuElement):e.appendChild(this._menuElement)),this._menuElement.innerHTML="",e.adoptedStyleSheets.indexOf(s._contextMenuCss)<0&&(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s._contextMenuCss]),this._menuElement.appendChild(this.renderLevel(this.menu))}renderLevel(e){let t=document.createElement("ul"),i=!1;return e.forEach(r=>{if(r.title!=="-"){if(i){let c=document.createElement("li");c.className="context_menu_divider",i=!1,t.appendChild(c)}let n=document.createElement("li"),o=document.createElement("span");o.className="context_menu_icon_span",r.checked===!0?o.innerHTML="\u2714":(r.icon??"")!=""?o.innerHTML=r.icon??"":o.innerHTML=this.options?.defaultIcon??"";let a=document.createElement("span");a.className="context_menu_text",a.innerHTML=r.title??"";let l=document.createElement("span");if(l.className="context_menu_sub_span",r.children!=null&&(l.innerHTML=this.options?.subIcon??"›"),n.appendChild(o),n.appendChild(a),n.appendChild(l),r.disabled)n.setAttribute("disabled","");else if(r.checkable?n.addEventListener("click",c=>{c.stopPropagation(),c.preventDefault(),r.checked=!r.checked,o.innerHTML=r.checked?"\u2714":r.icon??this.options?.defaultIcon??"",r.action&&r.action(c,r,this.context,this)}):r.action&&n.addEventListener("click",c=>{c.stopPropagation(),c.preventDefault(),r.action?.(c,r,this.context,this),this.close()}),this.options?.mode=="undo"&&n.addEventListener("mouseup",c=>{c.stopPropagation(),r.action?.(c,r,this.context,this),this.close()}),n.addEventListener("mouseenter",()=>{this.closeSiblingSubmenus(n),this.options?.mode=="undo"&&this.markUndoItems(n)}),r.children!=null){let c=this.renderLevel(r.children);this.configurePopoverSubmenu(c),n.appendChild(c),n.addEventListener("mouseenter",()=>{this.openPopoverSubmenu(n,c)})}t.appendChild(n)}else i=!0}),t}display(e){let t=this._menuElement,i=this.options?.mouseOffset!=null?this.options.mouseOffset:2;this.showPopover(t),this.positionMenu(t,e.clientX,e.clientY,i),t.classList.add("context_menu_display"),e.preventDefault(),s._openedContextMenus.add(this),window.addEventListener("keyup",this._windowKeyUp),window.addEventListener("resize",this._windowResize),window.addEventListener("mousedown",this._windowDown),setTimeout(()=>{s._openedContextMenus.has(this)&&window.addEventListener("contextmenu",this._windowDown)},150)}_windowResize(){this.close()}_windowDown(e){return e.preventDefault(),(!(e.target instanceof Node)||!this._menuElement.contains(e.target))&&this.close(),!1}_windowKeyUp(e){e.key==="Escape"&&this.close()}static show(e,t,i,r){let n=new s(e,i,r);return n.display(t),n}close(){this.hideDescendantSubmenus(this._menuElement),this.hidePopover(this._menuElement),this._menuElement.remove(),window.removeEventListener("mousedown",this._windowDown),window.removeEventListener("resize",this._windowResize),window.removeEventListener("keyup",this._windowKeyUp),setTimeout(()=>window.removeEventListener("contextmenu",this._windowDown),10),s._openedContextMenus.delete(this)}static closeAll(){for(let e of s._openedContextMenus.values())e.close()}configurePopoverSubmenu(e){e.classList.add("context_menu_submenu_popover"),e.setAttribute("popover","manual")}markUndoItems(e){if(e.parentElement==null)return;let t=!0;for(let i of e.parentElement.children)t?i.classList.add("context_menu_marked"):i.classList.remove("context_menu_marked"),i==e&&(t=!1)}closeSiblingSubmenus(e){if(e.parentElement!=null)for(let t of e.parentElement.children)t!==e&&this.hideDescendantSubmenus(t)}hideDescendantSubmenus(e){let t=e.querySelectorAll("ul[popover]");for(let i of t)this.hidePopover(i)}openPopoverSubmenu(e,t){this.showPopover(t),this.positionSubmenuPopover(e,t)}showPopover(e){this.isPopoverOpen(e)||e.showPopover()}hidePopover(e){e==null||!this.isPopoverOpen(e)||e.hidePopover()}isPopoverOpen(e){return e.matches(":popover-open")}positionMenu(e,t,i,r){let n=e.offsetWidth+4,o=e.offsetHeight+4,a=window.innerWidth-t,l=t,c=window.innerHeight-i,h=i,d=t+r;a<n&&l>a&&(d=t-n-r);let p=i+r;c<o&&h>c&&(p=i-o-r),e.style.left=`${Math.max(0,Math.min(d,window.innerWidth-n))}px`,e.style.top=`${Math.max(0,Math.min(p,window.innerHeight-o))}px`}positionSubmenuPopover(e,t){let i=e.getBoundingClientRect(),r=t.getBoundingClientRect(),n=t.offsetWidth||r.width,o=t.offsetHeight||r.height,a=window.innerWidth-i.right,l=i.left,c=i.right;a<n&&l>a&&(c=i.left-n);let h=window.innerHeight-i.top,d=i.bottom,p=i.top;h<o&&d>h&&(p=i.bottom-o),t.style.left=`${Math.max(0,Math.min(c,window.innerWidth-n))}px`,t.style.top=`${Math.max(0,Math.min(p,window.innerHeight-o))}px`,t.style.right="auto",t.style.bottom="auto"}}});var Ye,Yt=g(()=>{"use strict";Mt();Ye=class{settingName;content;tooltp;contextmenu;constructor(e,t,i,r){this.settingName=e,this.content=t,this.tooltp=i,this.contextmenu=r}provideButtons(e,t){let i=document.createElement("div");typeof this.content=="string"?i.innerHTML=this.content:i.appendChild(this.content),i.title=this.tooltp,i.className="toolbar-control",t.instanceServiceContainer.designContext.extensionOptionsChanged.on(()=>{r[this.settingName]!==!1?i.classList.add("selected"):i.classList.remove("selected")});let r=t.instanceServiceContainer.designContext.extensionOptions;return r[this.settingName]!==!1&&i.classList.add("selected"),i.onclick=()=>{let n=r[this.settingName];r[this.settingName]=n===!1,r[this.settingName]!==!1?i.classList.add("selected"):i.classList.remove("selected")},i.oncontextmenu=n=>{n.preventDefault(),this.contextmenu&&we.show(this.contextmenu,n)},[i]}}});var en,Jr,tn=g(()=>{"use strict";Yt();en="enableStylesheetService",Jr=class extends Ye{constructor(){super(en,"ss","modify Stylesheet")}}});var rn,rl=g(()=>{"use strict";rn=class{constructor(e,t,i){this.title="Change TextContent from '"+i+"' to '"+t+"'",this.designItem=e,this.newValue=t,this.oldValue=i}title;get affectedItems(){return[this.designItem]}undo(){return this.designItem.element.textContent=this.oldValue,[{changeType:"changed",designItems:this.affectedItems,type:"property",name:"textContent",oldValue:this.newValue,newValue:this.oldValue}]}do(){return this.designItem.element.textContent=this.newValue,[{changeType:"changed",designItems:this.affectedItems,type:"property",name:"textContent",oldValue:this.oldValue,newValue:this.newValue}]}designItem;newValue;oldValue;mergeWith(e){return!1}}});function np(s,...e){return s.reduce((t,i,r)=>t+i+(e[r]??""),"")}function sp(){return window.navigator.platform?.startsWith("Mac")||window.navigator.platform==="iPhone"||window.navigator.platform==="iPad"||window.navigator.platform==="iPod"}function ut(s){return new Promise(e=>setTimeout(e,s))}async function op(s,e){let t=URL.createObjectURL(s),i=document.createElement("a");i.href=t,i.style.display="none",i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),await ut(300)}function i_(s){for(var e=s.split(",")[0].split(":")[1].split(";")[0],t=atob(s.split(",")[1]),i=[],r=0;r<t.length;r++)i.push(t.charCodeAt(r));return new Blob([new Uint8Array(i)],{type:e})}function r_(s,e){return s.x>=e.x&&s.x<=e.x+e.width&&s.y>=e.y&&s.y<=e.y+e.height}function Xt(s,e){return s.endsWith(e??"/")?s.substring(0,s.length-1):s}function Ce(s,e){return s.startsWith(e??"/")?s.substring(1):s}function ir(){return new Promise(s=>requestAnimationFrame(s))}function n_(s,e){if(s===e)return!0;if(s==null||e==null||s.length!==e.length)return!1;for(var t=0;t<s.length;++t)if(s[t]!==e[t])return!1;return!0}function ap(s,e,t=!1,i="."){if(e==null)return s;let r=e.split(i);for(let n=0;n<r.length;n++)if(s!=null)s=s[r[n]];else return t?Vu:null;return s}function nl(s,e,t,i="."){if(e==null)return;let r=e.split(i);for(let n=0;n<r.length-1;n++)if(s!=null){let o=s[r[n]];o==null&&(o={},s[r[n]]=o),s=o}s!=null&&(s[r[r.length-1]]=t)}var Vu,Oe=g(()=>{"use strict"});var nn,sl=g(()=>{"use strict";Oe();nn=class s{constructor(e,t,i,r){this.title="Change Property "+t+" of <"+e.name+">",this.designItem=e,this.name=t,this.newValue=i,this.oldValue=r}title;get affectedItems(){return[this.designItem]}undo(){return nl(this.designItem.node,this.name,this.oldValue),[{changeType:"changed",type:"property",name:this.name,designItems:[this.designItem]}]}do(){return nl(this.designItem.node,this.name,this.newValue),[{changeType:"changed",type:"property",name:this.name,designItems:[this.designItem]}]}designItem;name;newValue;oldValue;mergeWith(e){return e instanceof s&&this.designItem===e.designItem&&this.name===e.name?(this.newValue=e.newValue,!0):!1}}});var rr,ol=g(()=>{"use strict";rr=class s{constructor(e,t,i,r,n){this.title="Change Attribute & Property"+t+" of <"+e.name+">",this.designItem=e,this.attributeName=t,this.propertyName=i,this.newValue=r,this.oldValue=n}title;get affectedItems(){return[this.designItem]}undo(){if(this.designItem.element[this.propertyName]=this.oldValue,this.oldValue==null)return this.designItem._withoutUndoRemoveAttribute(this.attributeName),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.attributeName,oldValue:this.newValue,newValue:null}];{let e=this.oldValue;return typeof this.oldValue!="string"&&(e=this.oldValue.toString()),this.designItem._withoutUndoSetAttribute(this.attributeName,e),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.attributeName,oldValue:this.newValue,newValue:e}]}}do(){if(this.designItem.element[this.propertyName]=this.newValue,this.newValue==null)return this.designItem._withoutUndoRemoveAttribute(this.attributeName),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.attributeName,oldValue:this.newValue,newValue:null}];{let e=this.newValue;return typeof this.newValue!="string"&&(e=this.newValue.toString()),this.designItem._withoutUndoSetAttribute(this.attributeName,e),[{changeType:"changed",designItems:this.affectedItems,type:"attribute",name:this.attributeName,oldValue:this.oldValue,newValue:e}]}}designItem;attributeName;propertyName;newValue;oldValue;mergeWith(e){return e instanceof s&&this.designItem===e.designItem&&this.attributeName===e.attributeName&&this.propertyName===e.propertyName?(this.newValue=e.newValue,!0):!1}}});import{TypedEvent as Ru}from"@node-projects/base-custom-webcomponent";var bi,Si,Kt,ft,gi,yi,vi,xi,_i,N,oe=g(()=>{"use strict";qa();$();Ja();Ze();el();Se();tl();Qe();tn();rl();sl();Oe();ol();bi="node-projects-hide-at-design-time",Si="node-projects-hide-at-run-time",Kt="node-projects-lock-at-design-time",ft="node-projects-force-hover",gi="node-projects-force-active",yi="node-projects-force-visited",vi="node-projects-force-focus",xi="node-projects-force-focus-within",_i="node-projects-force-focus-visible",N=class s{lastContainerSize;parsedNode;node;view;serviceContainer;instanceServiceContainer;nodeReplaced=new Ru;get window(){return this.isRootItem&&this.node instanceof HTMLIFrameElement?this.node.contentDocument.defaultView:this.node.ownerDocument.defaultView??window}get document(){return this.isRootItem&&this.node instanceof HTMLIFrameElement?this.node.contentDocument:this.node.ownerDocument}get usableContainer(){return this.isRootItem&&this.element instanceof(this.element.ownerDocument.defaultView??window).HTMLIFrameElement?this.element.contentWindow.document:this.isRootItem?this.node.shadowRoot:this.element}async clone(){try{let e=Q.ConvertToString([this],!1);return(await this.serviceContainer.htmlParserService.parse(e,this.serviceContainer,this.instanceServiceContainer,!0))[0]}catch{console.warn("could not clone design item.",this)}return null}*allMatching(e){if(this.hasChildren)for(let t of this.children())t.nodeType==A.Element&&t.element.matches(e)&&(yield t),yield*t.allMatching(e)}replaceNode(e){s._designItemMap.delete(this.node),s._designItemMap.set(e,this),this.view==this.node&&(this.view=e),this.node=e,this.nodeReplaced.emit()}get nodeType(){return this.node instanceof(this.node.ownerDocument.defaultView??window).Comment?A.Comment:this.node instanceof(this.node.ownerDocument.defaultView??window).Text?A.TextNode:A.Element}_attributes;get hasAttributes(){return this._attributes.size>0}hasAttribute(e){return this._attributes.has(e)}getAttribute(e){return this._attributes.get(e)}*attributes(){for(let e of this._attributes)yield e}_withoutUndoSetAttribute(e,t){try{this.element.setAttribute(e,t)}catch(i){i?.code!==5&&console.warn(i)}this._attributes.set(e,t),this.serviceContainer.designItemService.handleSpecialAttributes(e,this)}_withoutUndoRemoveAttribute(e){try{this.element.removeAttribute(e)}catch(t){t?.code!==5&&console.warn(t)}this._attributes.delete(e),this.serviceContainer.designItemService.handleSpecialAttributes(e,this)}_styles;get hasStyles(){return this._styles.size>0}hasStyle(e){let t=e;return t.startsWith("--")||(t=V.camelToDashCase(e)),this._styles.has(t)}getStyle(e){let t=e;return t.startsWith("--")||(t=V.camelToDashCase(e)),this._styles.get(t)}*styles(){for(let e of this._styles)yield e}_withoutUndoSetStyle(e,t){let i=e;i.startsWith("--")||(i=V.camelToDashCase(e)),this._styles.set(i,t)}_withoutUndoRemoveStyle(e){let t=e;t.startsWith("--")||(t=V.camelToDashCase(e)),this._styles.delete(t)}static _designItemMap=new WeakMap;get element(){return this.view}get name(){return this.node.localName}get id(){return this.element.id}set id(e){let t=this.element.id;this.element.id=e,this.id?this.setAttribute("id",e):this.removeAttribute("id"),this.serviceContainer.referencesChangedService&&this.serviceContainer.referencesChangedService.notifyReferencesChanged([{designItem:this,oldValue:t,type:"idChanged"}])}get isRootItem(){return this.instanceServiceContainer.designerCanvas.rootDesignItem===this}*childrenRect(e){if(this.hasChildren)for(let t of this.children())t.nodeType==A.Element&&t.element.matches(e)&&(yield t),yield*t.allMatching(e)}_childArray=[];get hasChildren(){return this._childArray.length>0}*children(e=!1){for(let t of this._childArray)if(yield t,e)for(let i of t.children(e))yield i}get childCount(){return this._childArray.length}get firstChild(){return this._childArray[0]}_parent;get parent(){return this._parent}indexOf(e){return this._childArray.indexOf(e)}insertAdjacentElement(e,t){let i;t=="afterbegin"?i=new Tt(e,this,0):t=="beforeend"?i=new Tt(e,this,this._childArray.length):t=="beforebegin"?i=new Tt(e,this.parent,this.parent.indexOf(this)):t=="afterend"&&(i=new Tt(e,this.parent,this.parent.indexOf(this)+1)),this.instanceServiceContainer.undoService.execute(i)}insertChild(e,t){let i=new Tt(e,this,t);this.instanceServiceContainer.undoService.execute(i)}removeChild(e){this.serviceContainer.deletionService.removeItems([e])}remove(){this.serviceContainer.deletionService.removeItems([this])}clearChildren(){for(let e=this._childArray.length-1;e>=0;e--)this._childArray[e].remove()}get hasContent(){return(this.nodeType==A.TextNode||this.nodeType==A.Comment)&&this.element.textContent!=""||this._childArray.length===0}get content(){return this.nodeType==A.TextNode||this.nodeType==A.Comment?this.node.textContent:this._childArray.map(e=>e.content).join()}set content(e){let t=this.openGroup("set content");this.clearChildren();let i=document.createTextNode(e),r=s.GetOrCreateDesignItem(i,i,this.serviceContainer,this.instanceServiceContainer);if(this.nodeType==A.TextNode){let n=this.parent.indexOf(this),o=this.parent;this.remove(),o.insertChild(r,n)}else if(this.nodeType==A.Comment){let n=new rn(this,e,this.content);this.instanceServiceContainer.undoService.execute(n)}else this.insertChild(r);t.commit()}get innerHTML(){return Q.ConvertToString([...this.children()],!1)}set innerHTML(e){if(this.nodeType!=A.TextNode){let t=this.openGroup("set innerHTML");this.clearChildren();let i=document.createRange();i.selectNode(document.body);let r=i.createContextualFragment(e);for(let n of[...r.childNodes]){let o=s.createDesignItemFromInstance(n,this.serviceContainer,this.instanceServiceContainer);this.insertChild(o)}t.commit()}}get isEmptyTextNode(){return this.nodeType===A.TextNode&&this.content?.trim()==""}get hideAtDesignTime(){return this.hasAttribute(bi)}set hideAtDesignTime(e){e?this.setAttribute(bi,""):this.removeAttribute(bi)}get hideAtRunTime(){return this.hasAttribute(Si)}set hideAtRunTime(e){e?this.setAttribute(Si,""):this.removeAttribute(Si)}get lockAtDesignTime(){return this.hasAttribute(Kt)}set lockAtDesignTime(e){e?this.setAttribute(Kt,""):this.removeAttribute(Kt)}static createDesignItemFromInstance(e,t,i){let r=t.designItemService.createDesignItem(e,e,t,i);if(e instanceof(e.ownerDocument.defaultView??window).HTMLTemplateElement&&e.getAttribute("shadowrootmode")=="open")try{e.parentNode.attachShadow({mode:"open"}).appendChild(e.content.cloneNode(!0))}catch(n){console.error("error attaching shadowdom",n)}if(r.nodeType==A.Element){for(let n of r.element.attributes)n.name!=="style"&&r._attributes.set(n.name,n.value);if(e instanceof(e.ownerDocument.defaultView??window).HTMLElement||e instanceof(e.ownerDocument.defaultView??window).SVGElement){let n=new Zr,o=e.getAttribute("style");if(o){n.parse(o);for(let a of n.entries)r._styles.set(a.name,a.value)}t.designItemService.handleSpecialAttributes(Kt,r)}e.draggable=!1}r._childArray=r._internalUpdateChildrenFromNodesChildren();for(let n of r._childArray)n._parent=r;return r}querySelectorAll(e){return this.usableContainer.querySelectorAll(e)}removeDesignerAttributesAndStylesFromChildren(){let e=this.querySelectorAll("*");for(let t of e){let i=s.GetDesignItem(t);i.hasAttribute("draggable")||t.removeAttribute("draggable"),i.hasStyle("pointer-events")||(t.style.pointerEvents="")}}updateChildrenFromNodesChildren(){this._childArray=this._internalUpdateChildrenFromNodesChildren();for(let e of this._childArray)e._parent=this}_internalUpdateChildrenFromNodesChildren(){let e=[];if(this.nodeType==A.Element)if(this.element instanceof(this.node.ownerDocument.defaultView??window).HTMLTemplateElement)for(let t of this.element.content.childNodes){let i=s.createDesignItemFromInstance(t,this.serviceContainer,this.instanceServiceContainer);e.push(i)}else if(this.isRootItem&&this.element instanceof(this.node.ownerDocument.defaultView??window).HTMLIFrameElement)for(let t of this.element.contentWindow.document.childNodes){let i=s.createDesignItemFromInstance(t,this.serviceContainer,this.instanceServiceContainer);e.push(i)}else for(let t of this.element.childNodes){let i=s.createDesignItemFromInstance(t,this.serviceContainer,this.instanceServiceContainer);e.push(i)}return e}_backupWhenEditContent;_inEditContent=!1;editContent(){this._inEditContent=!0,this._backupWhenEditContent=[...this.element.childNodes];let e=this.element.innerHTML;this.element.innerHTML="",this.element.innerHTML=e,this.element.setAttribute("contenteditable","")}editContentFinish(){if(this._inEditContent){this._inEditContent=!1,this.element.removeAttribute("contenteditable"),this.element.innerHTML="";for(let e of this._backupWhenEditContent)this.element.appendChild(e);this._backupWhenEditContent=null}}constructor(e,t,i,r){this.node=e,this.view=e,this.parsedNode=t,this.serviceContainer=i,this.instanceServiceContainer=r,this._attributes=new Map,this._styles=new Map,s._designItemMap.set(e,this)}setView(e){this.view=e,s._designItemMap.set(e,this)}openGroup(e){return this.instanceServiceContainer.undoService.openGroup(e)}getOrCreateDesignItem(e){return s.GetOrCreateDesignItem(e,e,this.serviceContainer,this.instanceServiceContainer)}static GetOrCreateDesignItem(e,t,i,r){if(!e)return null;let n=s._designItemMap.get(e);return n||(n=i.designItemService.createDesignItem(e,t,i,r)),n}static GetDesignItem(e){return e?s._designItemMap.get(e):null}setStyle(e,t,i){let r=e;if(r.startsWith("--")||(r=V.camelToDashCase(e)),this.isRootItem)throw"not allowed to set style on root item or use async setStyle";{let n=new fi(this,r,t,this._styles.get(r));this.instanceServiceContainer.undoService.execute(n)}}async setStyleAsync(e,t,i){let r=e;if(r.startsWith("--")||(r=V.camelToDashCase(e)),this.isRootItem)if(this.instanceServiceContainer.stylesheetService){let n=this.instanceServiceContainer.stylesheetService.getDeclarationsSortedBySpecificity(this,e);if(n!==null&&n.length>0)this.instanceServiceContainer.stylesheetService.updateDeclarationValue(n[0],t,i);else{let o=this.instanceServiceContainer.stylesheetService.getRules(":host").filter(a=>!a.stylesheet?.readOnly);if(n===null||o.length===0){let a=this.openGroup("add rule and set style: "+e),l=this.instanceServiceContainer.stylesheetService.getStylesheets(),c=await this.instanceServiceContainer.stylesheetService.addRule(l[0],":host");this.instanceServiceContainer.stylesheetService.insertDeclarationIntoRule(c,e,t,i),a.commit()}else this.instanceServiceContainer.stylesheetService.insertDeclarationIntoRule(o[0],e,t,i)}}else throw"not allowed to set style on root item";else{let n=new fi(this,r,t,this._styles.get(r));this.instanceServiceContainer.undoService.execute(n)}}removeStyle(e){let t=e;t.startsWith("--")||(t=V.camelToDashCase(e));let i=new fi(this,t,"",this._styles.get(t));this.instanceServiceContainer.undoService.execute(i)}updateStyleInSheetOrLocal(e,t,i,r){let n=e;n.startsWith("--")||(n=V.camelToDashCase(e));let o=this.instanceServiceContainer.stylesheetService?.getDeclarationsSortedBySpecificity(this,n).filter(a=>!a.stylesheet?.readOnly);this.hasStyle(e)||this.instanceServiceContainer.designContext.extensionOptions[en]===!1||!o?.length?this.getStyle(n)!=t||r?this.setStyle(n,t):t==null&&this.removeStyle(n):this.instanceServiceContainer.stylesheetService.updateDeclarationValue(o[0],t,!1)}async updateStyleInSheetOrLocalAsync(e,t,i,r){let n=e;n.startsWith("--")||(n=V.camelToDashCase(e));let o=this.instanceServiceContainer.stylesheetService?.getDeclarationsSortedBySpecificity(this,n).filter(a=>!a.stylesheet?.readOnly);this.hasStyle(e)||this.instanceServiceContainer.designContext.extensionOptions[en]===!1||!o?.length?this.getStyle(n)!=t||r?await this.setStyleAsync(n,t):t==null&&this.removeStyle(n):this.instanceServiceContainer.stylesheetService.updateDeclarationValue(o[0],t,!1)}getStyleFromSheetOrLocal(e,t=null){let i=e;if(i.startsWith("--")||(i=V.camelToDashCase(e)),this.hasStyle(e))return this.getStyle(i);let r=this.instanceServiceContainer.stylesheetService?.getDeclarationsSortedBySpecificity(this,i);return r&&r.length>0?r[0].value:null}getStyleFromSheetOrLocalOrComputed(e,t=null){let i=e;i.startsWith("--")||(i=V.camelToDashCase(e));let r=this.getStyleFromSheetOrLocal(i);return r||(r=getComputedStyle(this.element).getPropertyValue(i)),r??t}getComputedStyleProperty(e,t=null){let i=e;i.startsWith("--")||(i=V.camelToDashCase(e));let r=this.getStyleFromSheetOrLocal(i);return r||(r=getComputedStyle(this.element).getPropertyValue(i)),r??t}getComputedStyle(){return this.nodeType==A.Element?this.window.getComputedStyle(this.element):null}_stylesCache=null;_cacheClearTimer;getAllStyles(){let e=this._stylesCache;if(e)return e;if(this.nodeType!=A.Element)return[];let t=[...this._styles.entries()].map(i=>({name:i[0],value:i[1],important:!1,parent:null}));if(this.instanceServiceContainer.stylesheetService)try{let i=this.instanceServiceContainer.stylesheetService?.getAppliedRules(this);if(i)return[{selector:null,declarations:t,specificity:null,stylesheet:null},...i]}catch(i){console.warn("getAppliedRules",i)}return e=[{selector:null,declarations:t,specificity:null,stylesheet:null}],this._stylesCache=e,clearTimeout(this._cacheClearTimer),this._cacheClearTimer=setTimeout(()=>this._stylesCache=null,30),e}setAttribute(e,t){if(this.isRootItem)throw"not allowed to set attribute on root item";let i=new tr(this,e,t,this._attributes.get(e));this.instanceServiceContainer.undoService.execute(i)}removeAttribute(e){let t=new tr(this,e,null,this._attributes.get(e));this.instanceServiceContainer.undoService.execute(t)}setPropertyAndAttribute(e,t){let i=V.camelToDashCase(e),r=V.dashToCamelCase(e);if(this.isRootItem)throw"not allowed to set attribute on root item";let n=new rr(this,i,r,t,this.element[r]);this.instanceServiceContainer.undoService.execute(n)}removePropertyAndAttribute(e){let t=V.camelToDashCase(e),i=V.dashToCamelCase(e),r=new rr(this,t,i,null,this.element[i]);this.instanceServiceContainer.undoService.execute(r)}setProperty(e,t){if(this.isRootItem)throw"not allowed to set attribute on root item";let i=ap(this.node,e),r=new nn(this,e,t,i);this.instanceServiceContainer.undoService.execute(r)}_insertChildInternal(e,t){this._insertChildsInternal([e],t)}_insertChildsInternal(e,t){let i=this.document.createDocumentFragment(),r=null;for(let n of e)n.parent&&this.instanceServiceContainer.selectionService.primarySelection==n&&(n.instanceServiceContainer.designerCanvas.extensionManager.removeExtension(n.parent,P.PrimarySelectionContainer),n.instanceServiceContainer.designerCanvas.extensionManager.removeExtension(n.parent,P.PrimarySelectionContainerAndCanBeEntered)),n.parent&&n.parent._removeChildInternal(n),i.appendChild(n.view),n._parent=this,t==null||this._childArray.length==0||t>=this._childArray.length?this._childArray.push(n):(r=this._childArray[t],this._childArray.splice(t,0,n),t++);r==null?this.isRootItem?(this.usableContainer?.children[0]instanceof this.window.HTMLHtmlElement&&this.usableContainer.children[0].remove(),this.usableContainer.appendChild(i)):this.view instanceof(this.node.ownerDocument.defaultView??window).HTMLTemplateElement?this.view.content.appendChild(i):this.view.appendChild(i):this.isRootItem?(this.usableContainer?.children[0]instanceof this.window.HTMLHtmlElement&&this.usableContainer.children[0].remove(),this.usableContainer.insertBefore(i,r.element)):this.view instanceof(this.node.ownerDocument.defaultView??window).HTMLTemplateElement?this.view.content.insertBefore(i,r.element):this.view.insertBefore(i,r.element),this._refreshIfStyleSheet()}_removeChildInternal(e){e.parent&&this.instanceServiceContainer.selectionService.primarySelection==e&&(e.instanceServiceContainer.designerCanvas.extensionManager.removeExtension(e.parent,P.PrimarySelectionContainer),e.instanceServiceContainer.designerCanvas.extensionManager.removeExtension(e.parent,P.PrimarySelectionAndCanBeEntered)),e.instanceServiceContainer.designerCanvas.extensionManager.removeExtensions([e],!0);let t=this._childArray.indexOf(e);t>-1&&(this._childArray.splice(t,1),e.element.remove(),e._parent=null),this._refreshIfStyleSheet()}_refreshIfStyleSheet(){this.name=="style"||this.parent?.name=="style"||this.name=="link"}getPlacementService(e){return this.nodeType!=A.Element?null:(e??=getComputedStyle(this.element),this.serviceContainer.getLastServiceWhere("containerService",t=>t.serviceForContainer(this,e)))}static createDesignItemFromImageBlob(e,t,i){return new Promise(r=>{let n=new FileReader;n.onloadend=()=>{let o=document.createElement("img");o.src=n.result;let a=s.createDesignItemFromInstance(o,e,t);return r(a)},n.readAsDataURL(i)})}get hasForcedCss(){return this.cssForceHover||this.cssForceActive||this.cssForceVisited||this.cssForceFocus||this.cssForceFocusWithin||this.cssForceFocusVisible}get cssForceHover(){return this.element.hasAttribute(ft)}set cssForceHover(e){e?this.element.setAttribute(ft,""):this.element.removeAttribute(ft),this.instanceServiceContainer.onContentChanged.emit([{changeType:"changed",type:"attribute",name:ft,designItems:[this]}])}get cssForceActive(){return this.element.hasAttribute(gi)}set cssForceActive(e){e?this.element.setAttribute(gi,""):this.element.removeAttribute(gi),this.instanceServiceContainer.onContentChanged.emit([{changeType:"changed",type:"attribute",name:gi,designItems:[this]}])}get cssForceVisited(){return this.element.hasAttribute(yi)}set cssForceVisited(e){e?this.element.setAttribute(yi,""):this.element.removeAttribute(yi),this.instanceServiceContainer.onContentChanged.emit([{changeType:"changed",type:"attribute",name:yi,designItems:[this]}])}get cssForceFocus(){return this.element.hasAttribute(vi)}set cssForceFocus(e){e?this.element.setAttribute(vi,""):this.element.removeAttribute(vi),this.instanceServiceContainer.onContentChanged.emit([{changeType:"changed",type:"attribute",name:vi,designItems:[this]}])}get cssForceFocusWithin(){return this.element.hasAttribute(xi)}set cssForceFocusWithin(e){e?this.element.setAttribute(xi,""):this.element.removeAttribute(xi),this.instanceServiceContainer.onContentChanged.emit([{changeType:"changed",type:"attribute",name:xi,designItems:[this]}])}get cssForceFocusVisible(){return this.element.hasAttribute(_i)}set cssForceFocusVisible(e){e?this.element.setAttribute(_i,""):this.element.removeAttribute(_i),this.instanceServiceContainer.onContentChanged.emit([{changeType:"changed",type:"attribute",name:_i,designItems:[this]}])}}});function al(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var lp=g(()=>{"use strict"});var sn,on=g(()=>{"use strict";sn=navigator.userAgent.toLowerCase().includes("firefox")});var an,ll=g(()=>{"use strict";oe();lp();he();on();an=class{async getElement(e,t,i){if(e.import){let l=e.import;l[0]==="."&&(l=(window.location.origin+window.location.pathname).split("/").slice(0,-1).join("/")+"/"+l),window.importShim?importShim(l).then(c=>{!customElements.get(e.tag)&&e.className&&c[e.className]&&customElements.define(e.tag,c[e.className])}):import(l).then(c=>{!customElements.get(e.tag)&&e.className&&c[e.className]&&customElements.define(e.tag,c[e.className])}),i.designContext.imports.indexOf(l)<=0&&i.designContext.imports.push(l)}let r="";if(e.defaultAttributes)for(let l in e.defaultAttributes){let c=e.defaultAttributes[l];try{typeof c=="object"?r+=" "+l+'="'+al(JSON.stringify(e.defaultAttributes[l]))+'"':r+=" "+l+'="'+al(e.defaultAttributes[l])+'"'}catch(h){console.warn(h)}}let n="<"+e.tag+r+"></"+e.tag+">",o=Gr(n,i.designerCanvas.rootDesignItem.document);if(o._inNodeProjectsDesignerView=!0,e.defaultWidth&&(o.style.width=e.defaultWidth),e.defaultHeight&&(o.style.height=e.defaultHeight),o.style.position="absolute",e.defaultStyles)for(let l in e.defaultStyles)o.style[l]=e.defaultStyles[l];if(e.defaultContent)if(typeof e.defaultContent=="string"){let l;i.designerCanvas.rootDesignItem.window.Document.parseHTMLUnsafe&&!sn?l=i.designerCanvas.rootDesignItem.window.Document.parseHTMLUnsafe(e.defaultContent):l=new i.designerCanvas.rootDesignItem.window.DOMParser().parseFromString(e.defaultContent,"text/html",{includeShadowRoots:!0}),o.append(...l.head.childNodes),o.append(...l.body.childNodes)}else o.appendChild(e.defaultContent);return N.createDesignItemFromInstance(o,t,i)}}});var re,ke=g(()=>{"use strict";mt();re=class{element;property;designItems;disableChangeNotification=!1;constructor(e){this.property=e}async _previewValueChanged(e){this.disableChangeNotification||this.designItems&&this.designItems.length&&await this.property.service.previewValue?.(this.designItems,this.property,e)}async _removePreviewValue(){this.disableChangeNotification||this.designItems&&this.designItems.length&&await this.property.service.removePreviewValue?.(this.designItems,this.property)}async _valueChanged(e){if(!this.disableChangeNotification&&this.designItems&&this.designItems.length){let t=this.designItems[0].openGroup("set property: "+this.property.name);e==null?this.property.service.clearValue(this.designItems,this.property,"value"):await this.property.service.setValue(this.designItems,this.property,e),t.commit()}}designItemsChanged(e){this.designItems=e}refreshValueWithoutNotification(e,t){e==W.none?this.element.classList.add("unset-value"):this.element.classList.remove("unset-value"),this.disableChangeNotification=!0;try{this.refreshValue(e,t)}catch(i){console.error(i)}this.disableChangeNotification=!1}}});var wi,cl=g(()=>{"use strict";wi=class s{red=0;green=0;blue=0;hue=0;sat=0;lightness=0;whiteness=0;blackness=0;cyan=0;magenta=0;yellow=0;black=0;ncol="R";opacity=1;valid=!1;toRgbString(){return"rgb("+this.red+", "+this.green+", "+this.blue+")"}toRgbaString(){return"rgba("+this.red+", "+this.green+", "+this.blue+", "+this.opacity+")"}toHwbString(){return"hwb("+this.hue+", "+Math.round(this.whiteness*100)+"%, "+Math.round(this.blackness*100)+"%)"}toHwbStringDecimal(){return"hwb("+this.hue+", "+this.whiteness+", "+this.blackness+")"}toHwbaString(){return"hwba("+this.hue+", "+Math.round(this.whiteness*100)+"%, "+Math.round(this.blackness*100)+"%, "+this.opacity+")"}toHslString(){return"hsl("+this.hue+", "+Math.round(this.sat*100)+"%, "+Math.round(this.lightness*100)+"%)"}toHslStringDecimal(){return"hsl("+this.hue+", "+this.sat+", "+this.lightness+")"}toHslaString(){return"hsla("+this.hue+", "+Math.round(this.sat*100)+"%, "+Math.round(this.lightness*100)+"%, "+this.opacity+")"}toCmykString(){return"cmyk("+Math.round(this.cyan*100)+"%, "+Math.round(this.magenta*100)+"%, "+Math.round(this.yellow*100)+"%, "+Math.round(this.black*100)+"%)"}toCmykStringDecimal(){return"cmyk("+this.cyan+", "+this.magenta+", "+this.yellow+", "+this.black+")"}toNcolString(){return this.ncol+", "+Math.round(this.whiteness*100)+"%, "+Math.round(this.blackness*100)+"%"}toNcolStringDecimal(){return this.ncol+", "+this.whiteness+", "+this.blackness}toNcolaString(){return this.ncol+", "+Math.round(this.whiteness*100)+"%, "+Math.round(this.blackness*100)+"%, "+this.opacity}toName(){let e,t,i,r=s.getColorArr("hexs");for(let n=0;n<r.length;n++)if(e=parseInt(r[n].substr(0,2),16),t=parseInt(r[n].substr(2,2),16),i=parseInt(r[n].substr(4,2),16),this.red==e&&this.green==t&&this.blue==i)return s.getColorArr("names")[n];return null}toHexString(){let e=s.toHex(this.red),t=s.toHex(this.green),i=s.toHex(this.blue);return"#"+e+t+i}toNameOrHexString(){let e=this.toName();return e||(e=this.toHexString()),e}toRgb(){return{r:this.red,g:this.green,b:this.blue,a:this.opacity}}toHsl(){return{h:this.hue,s:this.sat,l:this.lightness,a:this.opacity}}toHwb(){return{h:this.hue,w:this.whiteness,b:this.blackness,a:this.opacity}}toCmyk(){return{c:this.cyan,m:this.magenta,y:this.yellow,k:this.black,a:this.opacity}}toNcol(){return{ncol:this.ncol,w:this.whiteness,b:this.blackness,a:this.opacity}}isDark(e){let t=e||128;return(this.red*299+this.green*587+this.blue*114)/1e3<t}saturate(e){let t,i,r;t=e/100||.1,this.sat+=t,this.sat>1&&(this.sat=1),i=s.hslToRgb(this.hue,this.sat,this.lightness),r=s.colorObject(i,this.opacity,this.hue,this.sat),this.attachValues(r)}desaturate(e){let t,i,r;t=e/100||.1,this.sat-=t,this.sat<0&&(this.sat=0),i=s.hslToRgb(this.hue,this.sat,this.lightness),r=s.colorObject(i,this.opacity,this.hue,this.sat),this.attachValues(r)}lighter(e){let t,i,r;t=e/100||.1,this.lightness+=t,this.lightness>1&&(this.lightness=1),i=s.hslToRgb(this.hue,this.sat,this.lightness),r=s.colorObject(i,this.opacity,this.hue,this.sat),this.attachValues(r)}darker(e){let t,i,r;t=e/100||.1,this.lightness-=t,this.lightness<0&&(this.lightness=0),i=s.hslToRgb(this.hue,this.sat,this.lightness),r=s.colorObject(i,this.opacity,this.hue,this.sat),this.attachValues(r)}attachValues(e){this.red=e.red,this.green=e.green,this.blue=e.blue,this.hue=e.hue,this.sat=e.sat,this.lightness=e.lightness,this.whiteness=e.whiteness,this.blackness=e.blackness,this.cyan=e.cyan,this.magenta=e.magenta,this.yellow=e.yellow,this.black=e.black,this.ncol=e.ncol,this.opacity=e.opacity,this.valid=e.valid}static toColorObject(e){let t,i,r,n=[],o,a,l,c,h,d,p,m,u=[],f=[];if(e=s.w3trim(e.toLowerCase()),t=e.substr(0,1).toUpperCase(),i=e.substr(1),h=1,(t=="R"||t=="Y"||t=="G"||t=="C"||t=="B"||t=="M"||t=="W")&&!isNaN(i)&&(e.length==6&&e.indexOf(",")==-1||(e="ncol("+e+")")),e.length!=3&&e.length!=6&&!isNaN(e)&&(e="ncol("+e+")"),e.indexOf(",")>0&&e.indexOf("(")==-1&&(e="ncol("+e+")"),e.substr(0,3)=="rgb"||e.substr(0,3)=="hsl"||e.substr(0,3)=="hwb"||e.substr(0,4)=="ncol"||e.substr(0,4)=="cmyk"){if(e.substr(0,4)=="ncol"?(e.split(",").length==4&&e.indexOf("ncola")==-1&&(e=e.replace("ncol","ncola")),r="ncol",e=e.substr(4)):e.substr(0,4)=="cmyk"?(r="cmyk",e=e.substr(4)):(r=e.substr(0,3),e=e.substr(3)),o=3,l=!1,e.substr(0,1).toLowerCase()=="a"?(o=4,l=!0,e=e.substr(1)):r=="cmyk"&&(o=4,e.split(",").length==5&&(o=5,l=!0)),e=e.replace("(",""),e=e.replace(")",""),n=e.split(","),r=="rgb"){if(n.length!=o)return new s;for(a=0;a<o;a++){if((n[a]==""||n[a]==" ")&&(n[a]="0"),n[a].indexOf("%")>-1&&(n[a]=n[a].replace("%",""),n[a]=Number(n[a]/100),a<3&&(n[a]=Math.round(n[a]*255))),isNaN(n[a]))return new s;parseInt(n[a])>255&&(n[a]=255),a<3&&(n[a]=parseInt(n[a])),a==3&&Number(n[a])>1&&(n[a]=1)}m={r:n[0],g:n[1],b:n[2]},l==!0&&(h=Number(n[3]))}if(r=="hsl"||r=="hwb"||r=="ncol"){for(;n.length<o;)n.push("0");for((r=="hsl"||r=="hwb")&&parseInt(n[0])>=360&&(n[0]=0),a=1;a<o;a++){if(n[a].indexOf("%")>-1){if(n[a]=n[a].replace("%",""),n[a]=Number(n[a]),isNaN(n[a]))return new s;n[a]=n[a]/100}else n[a]=Number(n[a]);Number(n[a])>1&&(n[a]=1),Number(n[a])<0&&(n[a]=0)}r=="hsl"&&(m=s.hslToRgb(n[0],n[1],n[2]),d=Number(n[0]),p=Number(n[1])),r=="hwb"&&(m=s.hwbToRgb(n[0],n[1],n[2])),r=="ncol"&&(m=s.ncolToRgb(n[0],n[1],n[2])),l==!0&&(h=Number(n[3]))}if(r=="cmyk"){for(;n.length<o;)n.push("0");for(a=0;a<o;a++){if(n[a].indexOf("%")>-1){if(n[a]=n[a].replace("%",""),n[a]=Number(n[a]),isNaN(n[a]))return new s;n[a]=n[a]/100}else n[a]=Number(n[a]);Number(n[a])>1&&(n[a]=1),Number(n[a])<0&&(n[a]=0)}m=s.cmykToRgb(n[0],n[1],n[2],n[3]),l==!0&&(h=Number(n[4]))}}else if(e.substr(0,3)=="ncs")m=s.ncsToRgb(e);else{for(c=!1,u=s.getColorArr("names"),a=0;a<u.length;a++)if(e.toLowerCase()==u[a].toLowerCase()){f=s.getColorArr("hexs"),c=!0,m={r:parseInt(f[a].substr(0,2),16),g:parseInt(f[a].substr(2,2),16),b:parseInt(f[a].substr(4,2),16)};break}if(c==!1){for(e=e.replace("#",""),e.length==3&&(e=e.substr(0,1)+e.substr(0,1)+e.substr(1,1)+e.substr(1,1)+e.substr(2,1)+e.substr(2,1)),a=0;a<e.length;a++)if(!s.isHex(e.substr(a,1)))return new s;for(n[0]=parseInt(e.substr(0,2),16),n[1]=parseInt(e.substr(2,2),16),n[2]=parseInt(e.substr(4,2),16),a=0;a<3;a++)if(isNaN(n[a]))return new s;m={r:n[0],g:n[1],b:n[2]}}}return s.colorObject(m,h,d,p)}static colorObject(e,t,i,r){let n,o,a,l,c,h,d;return e?(t===null&&(t=1),n=s.rgbToHsl(e.r,e.g,e.b),o=s.rgbToHwb(e.r,e.g,e.b),a=s.rgbToCmyk(e.r,e.g,e.b),h=i||n.h,d=r||n.s,l=s.hueToNcol(h),c={red:e.r,green:e.g,blue:e.b,hue:h,sat:d,lightness:n.l,whiteness:o.w,blackness:o.b,cyan:a.c,magenta:a.m,yellow:a.y,black:a.k,ncol:l,opacity:t,valid:!0},c=s.roundDecimals(c),Object.assign(new s,c)):new s}static getColorArr(e){return e=="names"?["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"]:e=="hexs"?["f0f8ff","faebd7","00ffff","7fffd4","f0ffff","f5f5dc","ffe4c4","000000","ffebcd","0000ff","8a2be2","a52a2a","deb887","5f9ea0","7fff00","d2691e","ff7f50","6495ed","fff8dc","dc143c","00ffff","00008b","008b8b","b8860b","a9a9a9","a9a9a9","006400","bdb76b","8b008b","556b2f","ff8c00","9932cc","8b0000","e9967a","8fbc8f","483d8b","2f4f4f","2f4f4f","00ced1","9400d3","ff1493","00bfff","696969","696969","1e90ff","b22222","fffaf0","228b22","ff00ff","dcdcdc","f8f8ff","ffd700","daa520","808080","808080","008000","adff2f","f0fff0","ff69b4","cd5c5c","4b0082","fffff0","f0e68c","e6e6fa","fff0f5","7cfc00","fffacd","add8e6","f08080","e0ffff","fafad2","d3d3d3","d3d3d3","90ee90","ffb6c1","ffa07a","20b2aa","87cefa","778899","778899","b0c4de","ffffe0","00ff00","32cd32","faf0e6","ff00ff","800000","66cdaa","0000cd","ba55d3","9370db","3cb371","7b68ee","00fa9a","48d1cc","c71585","191970","f5fffa","ffe4e1","ffe4b5","ffdead","000080","fdf5e6","808000","6b8e23","ffa500","ff4500","da70d6","eee8aa","98fb98","afeeee","db7093","ffefd5","ffdab9","cd853f","ffc0cb","dda0dd","b0e0e6","800080","663399","ff0000","bc8f8f","4169e1","8b4513","fa8072","f4a460","2e8b57","fff5ee","a0522d","c0c0c0","87ceeb","6a5acd","708090","708090","fffafa","00ff7f","4682b4","d2b48c","008080","d8bfd8","ff6347","40e0d0","ee82ee","f5deb3","ffffff","f5f5f5","ffff00","9acd32"]:null}static roundDecimals(e){return e.red=Number(e.red.toFixed(0)),e.green=Number(e.green.toFixed(0)),e.blue=Number(e.blue.toFixed(0)),e.hue=Number(e.hue.toFixed(0)),e.sat=Number(e.sat.toFixed(2)),e.lightness=Number(e.lightness.toFixed(2)),e.whiteness=Number(e.whiteness.toFixed(2)),e.blackness=Number(e.blackness.toFixed(2)),e.cyan=Number(e.cyan.toFixed(2)),e.magenta=Number(e.magenta.toFixed(2)),e.yellow=Number(e.yellow.toFixed(2)),e.black=Number(e.black.toFixed(2)),e.ncol=e.ncol.substr(0,1)+Math.round(Number(e.ncol.substr(1))),e.opacity=Number(e.opacity.toFixed(2)),e}static hslToRgb(e,t,i){let r,n,o,a,l;return e=e/60,i<=.5?n=i*(t+1):n=i+t-i*t,r=i*2-n,o=s.hueToRgb(r,n,e+2)*255,a=s.hueToRgb(r,n,e)*255,l=s.hueToRgb(r,n,e-2)*255,{r:o,g:a,b:l}}static hueToRgb(e,t,i){return i<0&&(i+=6),i>=6&&(i-=6),i<1?(t-e)*i+e:i<3?t:i<4?(t-e)*(4-i)+e:e}static hwbToRgb(e,t,i){let r,n,o=[],a;for(n=s.hslToRgb(e,1,.5),o[0]=n.r/255,o[1]=n.g/255,o[2]=n.b/255,a=t+i,a>1&&(t=Number((t/a).toFixed(2)),i=Number((i/a).toFixed(2))),r=0;r<3;r++)o[r]*=1-t-i,o[r]+=t,o[r]=Number(o[r]*255);return{r:o[0],g:o[1],b:o[2]}}static cmykToRgb(e,t,i,r){let n,o,a;return n=255-Math.min(1,e*(1-r)+r)*255,o=255-Math.min(1,t*(1-r)+r)*255,a=255-Math.min(1,i*(1-r)+r)*255,{r:n,g:o,b:a}}static ncolToRgb(e,t,i){let r,n,o;if(o=e,isNaN(e.substr(0,1))){if(r=e.substr(0,1).toUpperCase(),n=e.substr(1),n==""&&(n=0),n=Number(n),isNaN(n))return!1;r=="R"&&(o=0+n*.6),r=="Y"&&(o=60+n*.6),r=="G"&&(o=120+n*.6),r=="C"&&(o=180+n*.6),r=="B"&&(o=240+n*.6),r=="M"&&(o=300+n*.6),r=="W"&&(o=0,t=1-n/100,i=n/100)}return s.hwbToRgb(o,t,i)}static hueToNcol(e){for(;e>=360;)e=e-360;return e<60?"R"+e/.6:e<120?"Y"+(e-60)/.6:e<180?"G"+(e-120)/.6:e<240?"C"+(e-180)/.6:e<300?"B"+(e-240)/.6:e<360?"M"+(e-300)/.6:null}static ncsToRgb(e){let t,i,r,n,o,a,l,c,h,d,p,m,u,f,y,v,b,C,E;return e=s.w3trim(e).toUpperCase(),e=e.replace("(",""),e=e.replace(")",""),e=e.replace("NCS","NCS "),e=e.replace(/ /g," "),e.indexOf("NCS")==-1&&(e="NCS "+e),e=e.match(/^(?:NCS|NCS\sS)\s(\d{2})(\d{2})-(N|[A-Z])(\d{2})?([A-Z])?$/),e===null||(t=parseInt(e[1],10),i=parseInt(e[2],10),r=e[3],r!="N"&&r!="Y"&&r!="R"&&r!="B"&&r!="G")?null:(n=parseInt(e[4],10)||0,r!=="N"?(o=1.05*t-5.25,a=i,r==="Y"&&n<=60?h=1:r==="Y"&&n>60||r==="R"&&n<=80?(r==="Y"?l=n-60:l=n+40,h=(Math.sqrt(14884-Math.pow(l,2))-22)/100):r==="R"&&n>80||r==="B"?h=0:r==="G"&&(l=n-170,h=(Math.sqrt(33800-Math.pow(l,2))-70)/100),r==="Y"&&n<=80?c=0:r==="Y"&&n>80||r==="R"&&n<=60?(r==="Y"?l=n-80+20.5:l=n+20+20.5,c=(104-Math.sqrt(11236-Math.pow(l,2)))/100):r==="R"&&n>60||r==="B"&&n<=80?(r==="R"?l=n-60-60:l=n+40-60,c=(Math.sqrt(1e4-Math.pow(l,2))-10)/100):r==="B"&&n>80||r==="G"&&n<=40?(r==="B"?l=n-80-131:l=n+20-131,c=(122-Math.sqrt(19881-Math.pow(l,2)))/100):r==="G"&&n>40&&(c=0),r==="Y"?p=(85-17/20*n)/100:r==="R"&&n<=60?p=0:r==="R"&&n>60?(l=n-60+35,p=(67.5-Math.sqrt(5776-Math.pow(l,2)))/100):r==="B"&&n<=60?(l=1*n-68.5,p=(6.5+Math.sqrt(7044.5-Math.pow(l,2)))/100):r==="B"&&n>60||r==="G"&&n<=60?p=.9:r==="G"&&n>60&&(l=n-60,p=(90-1/8*l)/100),l=(h+p+c)/3,d=(l-h)*(100-a)/100+h,m=(l-p)*(100-a)/100+p,u=(l-c)*(100-a)/100+c,d>m&&d>u?f=d:m>d&&m>u?f=m:u>d&&u>m?f=u:f=(d+m+u)/3,y=1/f,b=parseInt(d*y*(100-o)/100*255,10),C=parseInt(m*y*(100-o)/100*255,10),E=parseInt(u*y*(100-o)/100*255,10),b>255&&(b=255),C>255&&(C=255),E>255&&(E=255),b<0&&(b=0),C<0&&(C=0),E<0&&(E=0)):(v=parseInt((1-t/100)*255,10),v>255&&(v=255),v<0&&(v=0),b=v,C=v,E=v),{r:b,g:C,b:E})}static rgbToHsl(e,t,i){let r,n,o,a,l,c,h,d=[];for(d[0]=e/255,d[1]=t/255,d[2]=i/255,r=d[0],n=d[0],c=0,o=0;o<d.length-1;o++)d[o+1]<=r&&(r=d[o+1]),d[o+1]>=n&&(n=d[o+1],c=o+1);return c==0&&(h=(d[1]-d[2])/(n-r)),c==1&&(h=2+(d[2]-d[0])/(n-r)),c==2&&(h=4+(d[0]-d[1])/(n-r)),isNaN(h)&&(h=0),h=h*60,h<0&&(h=h+360),a=(r+n)/2,r==n?l=0:a<.5?l=(n-r)/(n+r):l=(n-r)/(2-n-r),l=l,{h,s:l,l:a}}static rgbToHwb(e,t,i){let r,n,o;e=e/255,t=t/255,i=i/255;let a=Math.max(e,t,i),l=Math.min(e,t,i),c=a-l;return c==0?r=0:e==a?r=(t-i)/c%6*360:t==a?r=((i-e)/c+2)%6*360:r=((e-t)/c+4)%6*360,n=l,o=1-a,{h:r,w:n,b:o}}static rgbToCmyk(e,t,i){let r,n,o,a;return e=e/255,t=t/255,i=i/255,a=1-Math.max(e,t,i),a==1?(r=0,n=0,o=0):(r=(1-e-a)/(1-a),n=(1-t-a)/(1-a),o=(1-i-a)/(1-a)),{c:r,m:n,y:o,k:a}}static toHex(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return t}static w3trim(e){return e.replace(/^\s+|\s+$/g,"")}static isHex(e){return"0123456789ABCDEFabcdef".indexOf(e)>-1}}});var ln,hl=g(()=>{"use strict";ke();cl();ln=class extends re{constructor(e){super(e);let t=document.createElement("input");t.type="color",e.readonly&&(t.readOnly=!0),t.onchange=async i=>{let r=wi.toColorObject(t.value);await this.property.service.removePreviewValue?.(this.designItems,this.property),this._valueChanged(r.toNameOrHexString())},t.oninput=async i=>{let r=wi.toColorObject(t.value);await this.property.service.previewValue?.(this.designItems,this.property,r.toNameOrHexString())},this.element=t}refreshValue(e,t){if(!t)this.element.value="#000000";else{let i=wi.toColorObject(t);this.element.value=i.toHexString()}}}});var cn,dl=g(()=>{"use strict";ke();cn=class extends re{constructor(e){super(e);let t=document.createElement("input");t.type="datetime-local",e.readonly&&(t.readOnly=!0),t.onchange=i=>this._valueChanged(t.value),this.element=t}refreshValue(e,t){t?this.element.value=t:this.element.value=null}}});import{html as Fu}from"@node-projects/base-custom-webcomponent";var hn,pl=g(()=>{"use strict";ke();hn=class s extends re{static template=Fu`<div style="display:flex"><input id="input" type="text"> <button style="width:30px">...</button></div>`;_input;constructor(e){super(e);let t=s.template.content.cloneNode(!0);this._input=t.getElementById("input"),e.readonly&&(this._input.readOnly=!0),this._input.onchange=i=>this._valueChanged(this._input.value),this.element=t}refreshValue(e,t){this._input.value=t}}});var dn,ml=g(()=>{"use strict";ke();dn=class extends re{constructor(e){super(e);let t=document.createElement("input");t.type="number",e.readonly&&(t.readOnly=!0),t.min=e.min,t.max=e.max,t.step=e.step,t.onchange=i=>this._valueChanged(t.value==""?null:t.valueAsNumber),this.element=t}refreshValue(e,t){this.element.value=t===void 0?null:t}}});var nr,ul=g(()=>{"use strict";ke();nr=class extends re{elementSelect;elementInput;constructor(e){super(e);let t=document.createElement("div"),i=document.createElement("select");if(e.type=="enum")for(let n of e.enumValues){let o=document.createElement("option");o.value=n[1],o.text=n[0],i.appendChild(o)}else for(let n of e.values){let o=document.createElement("option");o.value=n,o.text=n,i.appendChild(o)}e.readonly&&(i.disabled=!0),i.onchange=n=>this._valueChanged(i.value);let r=document.createElement("input");r.style.display="none",r.onchange=n=>this._valueChanged(r.value),this.elementSelect=i,this.elementInput=r,t.appendChild(this.elementSelect),t.appendChild(this.elementInput),this.element=t}refreshValue(e,t){this.elementSelect.style.display="block",this.elementInput.style.display="none",this.elementSelect.value=t,this.elementSelect.value!=t&&t&&(this.elementInput.value=t,this.elementSelect.style.display="none",this.elementInput.style.display="block")}}});var pn,fl=g(()=>{"use strict";ke();pn=class s extends re{static _nextListId=0;constructor(e){super(e);let t=document.createElement("input");if(t.type="text",e.readonly&&(t.readOnly=!0),e.values?.length){let i=`wcd-text-property-editor-values-${s._nextListId++}`,r=document.createElement("datalist");r.id=i;for(let n of e.values){let o=document.createElement("option");o.value=n,r.appendChild(o)}t.setAttribute("list",i),t.appendChild(r)}t.onchange=i=>this._valueChanged(t.value),t.onfocus=i=>{t.selectionStart=0,t.selectionEnd=t.value?.length},this.element=t}refreshValue(e,t){t==null?this.element.value="":this.element.value=t}}});var mn,gl=g(()=>{"use strict";ke();mn=class extends re{constructor(e){super(e);let t=document.createElement("input");t.type="checkbox",e.readonly&&(t.readOnly=!0),t.onchange=i=>this._valueChanged(t.checked),this.element=t}refreshValue(e,t){this.element.checked=t}}});import{BaseCustomWebComponentConstructorAppend as zu,css as Bu,html as Hu}from"@node-projects/base-custom-webcomponent";var sr,cp=g(()=>{"use strict";sr=class extends zu{static style=Bu`div{font-size:10px;color:#fff}#property{color:#00aff0}#value{color:#d3d3d3}#value.value-set{color:wheat}.container{display:flex;flex-direction:row}::slotted(button){min-width:24px;height:24px;padding:1px;background:#fff;border:1px solid #d3d3d3}`;static template=Hu`<div><div id="header" style="display:none"><span id="property"></span><span id="vhd">: <span id="value"></span></span></div><div part="container" class="container"><slot id="slot"></slot></div></div>`;static properties={value:String,property:String,unsetValue:String,noValueInHeader:Boolean};constructor(){super(),this._restoreCachedInititalValues()}_value;get value(){return this._value}set value(e){this._value=e,this._updateValue()}property;unsetValue;noValueInHeader;_updateValue(){this.value?(this._getDomElement("value").innerText=this.value,this._getDomElement("value").classList.add("value-set")):this._getDomElement("value").classList.remove("value-set");let e=this._getDomElement("slot");for(let t of e.assignedElements())t.dataset.value==this.value?t.style.background="cornflowerblue":t.style.background=""}ready(){this._parseAttributesToProperties(),this.property&&(this._getDomElement("header").style.display="block"),this.noValueInHeader&&(this._getDomElement("vhd").style.display="none");let e=this._getDomElement("slot");e.onclick=t=>{let i=t.composedPath();for(let r of e.assignedElements())if(i.indexOf(r)>=0){let n=this._value;this.value=r.dataset.value;let o=new CustomEvent("value-changed",{detail:{newValue:this._value,oldValue:n}});this.dispatchEvent(o)}},this._getDomElement("property").innerText=this.property??"",this._getDomElement("value").innerText=this.unsetValue??"",this._updateValue()}};customElements.define("node-projects-image-button-list-selector",sr)});var Ci,$t,yl,hp,S,ae=g(()=>{"use strict";Ci="text/json/elementdefintion",$t="text/json/bindingobject",yl="text/json/propertydrop",hp=new URL(import.meta.url),S=hp.origin+hp.pathname.split("/").slice(0,-1).join("/")+"/../assets/"});var un,vl=g(()=>{"use strict";ke();cp();Se();ae();un=class extends re{constructor(e){super(e);let t=new sr;t.property=e.name,t.unsetValue=e.defaultValue;let i=V.camelToDashCase(e.name);if(e.type=="enum")for(let r of e.enumValues){let n=document.createElement("button");n.dataset.value=r[1];let o=document.createElement("img");o.title=r[1],o.src=S+"images/chromeDevtools/"+i+"-"+r[1]+"-icon.svg",n.appendChild(o),t.appendChild(n)}else for(let r of e.values){let n=document.createElement("button");n.dataset.value=r;let o=document.createElement("img");o.title=r,o.src=S+"images/chromeDevtools/"+i+"-"+r+"-icon.svg",n.appendChild(o),t.appendChild(n)}t.addEventListener("value-changed",r=>this._valueChanged(t.value)),this.element=t}refreshValue(e,t){this.element.value=t}}});import{BaseCustomWebComponentConstructorAppend as Gu,css as Wu,html as ju,TypedEvent as fn}from"@node-projects/base-custom-webcomponent";var or,dp=g(()=>{"use strict";or=class extends Gu{static style=Wu`:host{margin:4px;margin-left:auto;margin-right:auto}#container{display:grid;grid-template-columns:minmax(30px,40px) minmax(30px,60px) minmax(30px,40px);grid-template-rows:auto;grid-template-areas:" . top ." "left middle right" " . bottom .";column-gap:2px;row-gap:2px}input{width:20px;text-align:center;font-size:10px;height:20px;padding:0}#left{grid-area:left;justify-self:end}#top{grid-area:top;align-self:end;justify-self:center}#right{grid-area:right;justify-self:start}#bottom{grid-area:bottom;align-self:start;justify-self:center}#rect{grid-area:middle;border:1px solid #000;background:#d3d3d3}`;static template=ju`<div id="container"><input id="left"> <input id="top"> <input id="right"> <input id="bottom"><div id="rect"></div></div>`;_leftInput;_topInput;_rightInput;_bottomInput;_valueLeft;get valueLeft(){return this._valueLeft}set valueLeft(e){let t=this._valueLeft;this._valueLeft=e,t!==e&&(this._updateValue(),this.valueLeftChanged.emit({newValue:e,oldValue:t}))}valueLeftChanged=new fn;_valueTop;get valueTop(){return this._valueTop}set valueTop(e){let t=this._valueTop;this._valueTop=e,t!==e&&(this._updateValue(),this.valueTopChanged.emit({newValue:e,oldValue:t}))}valueTopChanged=new fn;_valueRight;get valueRight(){return this._valueRight}set valueRight(e){let t=this._valueRight;this._valueRight=e,t!==e&&(this._updateValue(),this.valueRightChanged.emit({newValue:e,oldValue:t}))}valueRightChanged=new fn;_valueBottom;get valueBottom(){return this._valueBottom}set valueBottom(e){let t=this._valueBottom;this._valueBottom=e,t!==e&&(this._updateValue(),this.valueBottomChanged.emit({newValue:e,oldValue:t}))}valueBottomChanged=new fn;property;unsetValue;_updateValue(){this._leftInput.value=this.valueLeft,this._topInput.value=this.valueTop,this._rightInput.value=this.valueRight,this._bottomInput.value=this._valueBottom}ready(){this._parseAttributesToProperties(),this._leftInput=this._getDomElement("left"),this._topInput=this._getDomElement("top"),this._rightInput=this._getDomElement("right"),this._bottomInput=this._getDomElement("bottom"),this._leftInput.onkeyup=e=>{e.key==="Enter"&&(this._valueLeft=this._leftInput.value)},this._topInput.onkeyup=e=>{e.key==="Enter"&&(this._valueTop=this._topInput.value)},this._rightInput.onkeyup=e=>{e.key==="Enter"&&(this._valueRight=this._rightInput.value)},this._bottomInput.onkeyup=e=>{e.key==="Enter"&&(this._valueBottom=this._bottomInput.value)},this._leftInput.onblur=e=>this._valueLeft=this._leftInput.value,this._topInput.onblur=e=>this._valueTop=this._topInput.value,this._rightInput.onblur=e=>this._valueRight=this._rightInput.value,this._bottomInput.onblur=e=>this._valueBottom=this._bottomInput.value,this._updateValue()}};customElements.define("node-projects-thickness-editor",or)});var gn,xl=g(()=>{"use strict";ke();dp();gn=class extends re{constructor(e){super(e);let t=new or;t.property=e.name,t.valueLeftChanged.on(i=>this._valueChanged(i.newValue)),this.element=t}refreshValue(e,t){this.element.valueLeft=t}}});var Ei,_l=g(()=>{"use strict";ke();Ei=class s extends re{static fontList;constructor(e){super(e);let t=document.createElement("select");e.readonly&&(t.disabled=!0),this.element=t,s.addFontsToSelect(t),this.element.onchange=i=>this._valueChanged(this.element.value)}static addFontsToSelect(e){s.fontList?s.parseFontList(e):window.queryLocalFonts?window.queryLocalFonts().then(t=>{s.fontList=[...new Set(t.map(i=>i.family))],s.parseFontList(e)}):(s.fontList=["Verdana","Arial","Tahoma","Trebuchet MS","Times New Roman","Georgia","Garamond","Courier New","Brush Script MT"],s.parseFontList(e))}static parseFontList(e){for(let t of s.fontList){let i=document.createElement("option");i.value=t,i.text=t,e.appendChild(i)}}refreshValue(e,t){this.element.value=t}}});function wl(s,e=4){if(!Number.isFinite(s))return"0";let t=10**Math.max(0,e),i=Math.round(s*t)/t;return Object.is(i,-0)?"0":`${i}`}function Zt(s,e){let t=s?.trim()??"";return t?t+(e??""):""}function pp(s){let e=s?.trim()??"";if(!e)return{kind:"empty"};let t=e.match(/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))(?:([a-z%]+))?$/i);if(!t)return{kind:"text",text:e};let i=Number(t[1]);return Number.isNaN(i)?{kind:"text",text:e}:{kind:"numeric",numberText:t[1],value:i,unit:t[2]?.toLowerCase()??""}}function vn(s){return s?.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())??""}function rf(s){return s?.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)??""}function up(s){return s.property.numericValueDecimalPlaces??(s.fromUnit==="%"||s.toUnit==="%"?2:4)}function nf(s,e,t){return s==null?null:typeof s=="number"?Zt(wl(s,t),e):s}function xn(s){return s.designItems?.[0]?.element??null}function sf(s){return s?typeof HTMLElement<"u"&&s instanceof HTMLElement?!0:typeof s.getBoundingClientRect=="function":!1}function fp(s){if(!s)return null;if(s.parentElement)return s.parentElement;if(s.assignedSlot)return s.assignedSlot;let t=s.getRootNode?.()?.host;if(sf(t))return t;let i=s.ownerDocument;return i?.body??i?.documentElement??null}function gp(s){let e=parseFloat(s??"");return Number.isNaN(e)?null:e}function of(s){if(typeof getComputedStyle!="function")return null;let e=xn(s);if(!e)return null;let t=getComputedStyle(e),i=s.property.propertyName??s.property.name;if(!i)return null;let r=typeof t.getPropertyValue=="function"?l=>t.getPropertyValue(l):l=>"";if(i.startsWith("--"))return r(i)?.trim()??null;let n=i.includes("-")?i:rf(i),o=r(n)?.trim();if(o)return o;let a=vn(i);return t[a]?.trim()??null}function af(s){let e=pp(s.rawValue);if(e.kind==="numeric")return{...s,value:e.value,numberText:e.numberText,fromUnit:e.unit||s.fromUnit,rawValue:Zt(e.numberText,e.unit)};let t=of(s),i=pp(t);if(i.kind!=="numeric"){if(s.numericType!=="css-length")return null;let r=yp(s);if(r==null)return null;let n=wl(r);return{...s,value:r,numberText:n,fromUnit:"px",rawValue:Zt(n,"px")}}return{...s,value:i.value,numberText:i.numberText,fromUnit:i.unit,rawValue:Zt(i.numberText,i.unit)}}function lf(s){if(typeof window>"u")return null;switch(s){case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;default:return null}}function ar(s,e){if(typeof getComputedStyle!="function")return null;let t=xn(s);if(!t)return null;let i=e?fp(t)??t:t;return gp(getComputedStyle(i).fontSize)}function cf(){return typeof getComputedStyle!="function"||typeof document>"u"?null:gp(getComputedStyle(document.documentElement).fontSize)}function hf(s){if(typeof getComputedStyle!="function")return null;let e=xn(s);if(!e)return null;let t=vn(s.property.propertyName??s.property.name);if(t==="fontSize")return ar(s,!0);if(t==="lineHeight")return ar(s,!1);let r=(fp(e)??e).getBoundingClientRect?.();return r?Ju.has(t)?r.height:(qu.has(t),r.width):null}function yp(s){let e=xn(s);if(!e)return null;let t=e.getBoundingClientRect?.();if(!t)return null;let i=vn(s.property.propertyName??s.property.name);return ef.has(i)?t.width:tf.has(i)?t.height:null}function bl(s,e){let t=e?.toLowerCase()??"";if(!t)return null;let i=Xu.get(t);if(i!=null)return i;if(t==="%"){let r=hf(s);return r==null?null:r/100}if(t==="em")return ar(s,vn(s.property.propertyName??s.property.name)==="fontSize");if(t==="rem")return cf();if(t==="ex"){let r=ar(s,!1);return r==null?null:r/2}if(t==="ch"){let r=ar(s,!1);return r==null?null:r/2}return lf(t)}function vp(s){let e=af(s);if(!e)return Zt(s.numberText,s.toUnit);let t=up(s),i;switch(e.numericType){case"css-length":i=df(e.value,e.fromUnit,e.toUnit,e);break;case"css-angle":i=yn(e.value,e.fromUnit,e.toUnit,Ku);break;case"css-time":i=yn(e.value,e.fromUnit,e.toUnit,$u);break;case"css-frequency":i=yn(e.value,e.fromUnit,e.toUnit,Zu);break;case"css-resolution":i=yn(e.value,e.fromUnit,e.toUnit,Qu);break;case"css-flex":i=e.value;break;case"css-scale":i=pf(e.value,e.fromUnit,e.toUnit);break}return i==null?Zt(e.numberText,e.toUnit):Zt(wl(i,t),e.toUnit)}function df(s,e,t,i){let r=e?.toLowerCase()??"",n=t?.toLowerCase()??"";if(r!=="%"&&n==="%"){let l=yp(i),c=bl(i,n);if(l!=null&&c!=null)return l/c}let o=bl(i,e),a=bl(i,t);return o==null||a==null?null:s*o/a}function pf(s,e,t){let i=e?.toLowerCase()??"",r=t?.toLowerCase()??"";if(i===r)return s;let n=i==="%"?.01:i===""?1:null,o=r==="%"?.01:r===""?1:null;return n==null||o==null?null:s*n/o}function yn(s,e,t,i){let r=e?.toLowerCase()??"",n=t?.toLowerCase()??"";if(!r||!n||r===n)return s;if(!i)return null;let o=i.get(r),a=i.get(n);return o==null||a==null?null:s*o/a}function Cl(s,e){return Yu.includes(s??"")?s:null}function xp(s,e){return Cl(s,e)!=null}function mf(s){let e=up(s),t=nf(s.property.numericValueConverter?.(s.value,s.fromUnit,s.toUnit,s.property,s.numericType,s.numberText,s.rawValue,s.designItems),s.toUnit,e);return t??vp(s)}function _p(s){return[...new Set([...s??[],...Uu].filter(Boolean))]}function bp(s){let e=Cl(s.type,s.propertyName??s.name);return s.values=_p(s.values),e&&(s.units??=[...Sl[e]],s.unitSteps??={...mp[e]},s.numericValueConverter??=(t,i,r,n,o,a,l,c)=>vp({property:n,numericType:o,designItems:c,value:t,numberText:a??`${t}`,rawValue:l??`${t}${i}`,fromUnit:i,toUnit:r})),s}function Sp(s){let e=Cl(s.type,s.name);if(!e)return null;let t=mp[e]??{};return{numericType:e,units:s.units?.length?s.units:Sl[e],fixedValues:_p(s.values),unitSteps:{...t,...s.unitSteps??{}},convertValue:i=>mf({...i,property:s,numericType:e})}}var Uu,Sl,Yu,mp,Xu,Ku,$u,Zu,Qu,qu,Ju,ef,tf,_n=g(()=>{"use strict";Uu=["initial","inherit","unset"],Sl={"css-length":["px","%","em","rem","vw","vh","vmin","vmax","pt","pc","in","cm","mm","q","ch","ex"],"css-angle":["deg","grad","rad","turn"],"css-time":["ms","s"],"css-frequency":["hz","khz"],"css-flex":["fr"],"css-resolution":["dpi","dpcm","dppx","x"],"css-scale":["","%"],"svg-length":["","%"]},Yu=Object.keys(Sl),mp={"css-length":{em:.1,rem:.1,in:.01,cm:.1,ch:.1,ex:.1},"css-angle":{rad:.01,turn:.1},"css-time":{ms:10,s:.1},"css-frequency":{khz:.1},"css-flex":{fr:.1},"css-resolution":{dppx:.1,x:.1},"css-scale":{"":.1,"%":10},"svg-length":{"":1,"%":10}},Xu=new Map([["px",1],["in",96],["cm",96/2.54],["mm",96/25.4],["q",96/101.6],["pt",96/72],["pc",16]]),Ku=new Map([["deg",1],["grad",.9],["rad",180/Math.PI],["turn",360]]),$u=new Map([["ms",1],["s",1e3]]),Zu=new Map([["hz",1],["khz",1e3]]),Qu=new Map([["dpi",1],["dpcm",2.54],["dppx",96],["x",96]]),qu=new Set(["width","minWidth","maxWidth","inlineSize","minInlineSize","maxInlineSize","left","right","columnGap","gap","flexBasis","perspective"]),Ju=new Set(["height","minHeight","maxHeight","top","bottom","blockSize","minBlockSize","maxBlockSize","rowGap"]),ef=new Set(["width","minWidth","maxWidth","inlineSize","minInlineSize","maxInlineSize"]),tf=new Set(["height","minHeight","maxHeight","blockSize","minBlockSize","maxBlockSize"])});var bn,El=g(()=>{"use strict";Ha();ke();_n();bn=class extends re{constructor(e){super(e);let t=Sp(e),i=new Qi;i.units=t?.units??e.units??[],i.fixedValues=t?.fixedValues??e.values,i.unitValueConverter=r=>t?.convertValue({...r,designItems:this.designItems}),i.unitSteps=t?.unitSteps??e.unitSteps??{},i.step=e.step,i.min=e.min,i.max=e.max,i.readOnly=e.readonly,i.valueChanged.on(async r=>this._valueChanged(r.newValue===""?null:r.newValue)),i.valuePreviewChanged.on(async r=>this._previewValueChanged(r.newValue===""?null:r.newValue)),i.valuePreviewFinished.on(async r=>{await this._removePreviewValue(),!r.wasCancelled&&await this._valueChanged(r.newValue===""?null:r.newValue)}),this.element=i}designItemsChanged(e){super.designItemsChanged(e)}refreshValue(e,t){this.element.value=t==null?"":String(t)}}});var Sn,Pl=g(()=>{"use strict";hl();dl();pl();ml();ul();fl();gl();vl();xl();_l();El();_n();Sn=class{getEditorForProperty(e){if(e.createEditor)return e.createEditor(e);if(xp(e.type,e.name))return new bn(e);switch(e.type){case"json":return new hn(e);case"css-color":case"color":return new ln(e);case"font":return new Ei(e);case"date":return new cn(e);case"number":return new dn(e);case"list":return new nr(e);case"enum":return new nr(e);case"boolean":return new mn(e);case"img-list":return new un(e);case"thickness":return new gn(e);case"string":default:return new pn(e)}}}});import{BaseCustomWebComponentLazyAppend as uf,BaseCustomWebComponentConstructorAppend as ff,BaseCustomWebComponentNoAttachedTemplate as gf,BaseCustomWebComponentConstructorAppendLazyReady as yf}from"@node-projects/base-custom-webcomponent";var wn,Al=g(()=>{"use strict";mi();wn=class extends st{name="baseCustomWebComponent";isHandledElement(e){return e.element instanceof uf||e.element instanceof yf||e.element instanceof ff||e.element instanceof gf}_notifyChangedProperty(e,t,i){e.element._parseAttributesToProperties()}}});function Cn(s,e,t){if(e==null||e==""){s.style.transform=t;return}let i=new DOMMatrix(e),n=new DOMMatrix(t).multiply(i);s.style.transform=n.toString()}function Pi(s){return new DOMPoint(s.m41,s.m42,0,0)}var kl=g(()=>{"use strict"});var _,ze=g(()=>{"use strict";(function(s){s.Move="M",s.Line="L",s.CubicBezier="C",s.QuadraticBezier="Q",s.Arc="A",s.Close="Z",s.HorizontalLine="H",s.VerticalLine="V",s.SmoothCubic="S",s.SmoothQuadratic="T"})(_||(_={}))});function gt(s,e,t=45){let i=wp(s,e),o=(Math.round(i/t)*t+360)%360*Math.PI/180,a=e.x-s.x,l=e.y-s.y,c=Math.sqrt(a*a+l*l),h=s.x+Math.cos(o)*c,d=s.y-Math.sin(o)*c;return{x:h,y:d}}function Ai(s,e){let t,i=Math.sqrt(Math.pow(e.x-s.x,2)+Math.pow(e.y-s.y,2)),r=wp(s,e),n=r-(Math.floor(r/90)*90+45);return t=i*Math.cos(n*(Math.PI/180))/Math.sqrt(2),t}function wp(s,e){let t=-1*Math.atan2(e.y-s.y,e.x-s.x)*180/Math.PI;return t<0&&(t+=360),t}function Cp(s,e,t){let i="",r=s.getPathData({normalize:!0});for(let n of r)switch(n.type){case"M":case"m":case"L":case"l":case"T":case"t":i+=n.type+" "+(n.values[0]-e)+" "+(n.values[1]-t)+" ";break;case"Z":case"z":i+=n.type+" ";break;case"C":case"c":i+=n.type+" "+(n.values[0]-e)+" "+(n.values[1]-t)+" "+(n.values[2]-e)+" "+(n.values[3]-t)+" "+(n.values[4]-e)+" "+(n.values[5]-t)+" ";break;case"S":case"s":case"Q":case"q":i+=n.type+" "+(n.values[0]-e)+" "+(n.values[1]-t)+" "+(n.values[2]-e)+" "+(n.values[3]-t)+" ";break;case"A":case"a":i+=n.type+" "+(n.values[0]-e)+" "+(n.values[1]-t)+" "+n.values[2]+" "+n.values[3]+" "+n.values[4]+" "+(n.values[5]-e)+" "+(n.values[6]-t)+" ";break}return i}function Qt(s){let e="";for(let i of s){e+=i.type+" ";for(var t=0;t<i.values.length;t++)i.values[t]!=null&&!isNaN(i.values[t])&&(e+=i.values[t]+" ")}return e}var Be=g(()=>{"use strict";(!SVGPathElement.prototype.getPathData||!SVGPathElement.prototype.setPathData)&&(function(){var s={Z:"Z",M:"M",L:"L",C:"C",Q:"Q",A:"A",H:"H",V:"V",S:"S",T:"T",z:"Z",m:"m",l:"l",c:"c",q:"q",a:"a",h:"h",v:"v",s:"s",t:"t"},e=function(o){this._string=o,this._currentIndex=0,this._endIndex=this._string.length,this._prevCommand=null,this._skipOptionalSpaces()};e.prototype={parseSegment:function(){var o=this._string[this._currentIndex],a=s[o]?s[o]:null;if(a===null){if(this._prevCommand===null||((o==="+"||o==="-"||o==="."||o>="0"&&o<="9")&&this._prevCommand!=="Z"?this._prevCommand==="M"?a="L":this._prevCommand==="m"?a="l":a=this._prevCommand:a=null,a===null))return null}else this._currentIndex+=1;this._prevCommand=a;var l=null,c=a.toUpperCase();return c==="H"||c==="V"?l=[this._parseNumber()]:c==="M"||c==="L"||c==="T"?l=[this._parseNumber(),this._parseNumber()]:c==="S"||c==="Q"?l=[this._parseNumber(),this._parseNumber(),this._parseNumber(),this._parseNumber()]:c==="C"?l=[this._parseNumber(),this._parseNumber(),this._parseNumber(),this._parseNumber(),this._parseNumber(),this._parseNumber()]:c==="A"?l=[this._parseNumber(),this._parseNumber(),this._parseNumber(),this._parseArcFlag(),this._parseArcFlag(),this._parseNumber(),this._parseNumber()]:c==="Z"&&(this._skipOptionalSpaces(),l=[]),l===null||l.indexOf(null)>=0?null:{type:a,values:l}},hasMoreData:function(){return this._currentIndex<this._endIndex},peekSegmentType:function(){var o=this._string[this._currentIndex];return s[o]?s[o]:null},initialCommandIsMoveTo:function(){if(!this.hasMoreData())return!0;var o=this.peekSegmentType();return o==="M"||o==="m"},_isCurrentSpace:function(){var o=this._string[this._currentIndex];return o<=" "&&(o===" "||o===`
|