web-component-wrapper 0.0.323 → 0.0.327
Sign up to get free protection for your applications and to get access to all the features.
- package/ReactNext.js +1 -1
- package/WebNext.js +1 -1
- package/package.json +2 -1
- package/readme.md +3 -1
package/ReactNext.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("clientnode"),require("clientnode/property-types"),require("react"),require("react-dom"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/helpers/wrapNativeSuper"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"));else if("function"==typeof define&&define.amd)define(["clientnode","clientnode/property-types","react","react-dom","@babel/runtime/helpers/extends","@babel/runtime/helpers/initializerDefineProperty","@babel/runtime/helpers/assertThisInitialized","@babel/runtime/helpers/inheritsLoose","@babel/runtime/helpers/wrapNativeSuper","@babel/runtime/helpers/applyDecoratedDescriptor","@babel/runtime/helpers/initializerWarningHelper"],t);else{var r="object"==typeof exports?t(require("clientnode"),require("clientnode/property-types"),require("react"),require("react-dom"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/helpers/wrapNativeSuper"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper")):t(e.clientnode,e["clientnode/property-types"],e.react,e["react-dom"],e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/initializerDefineProperty"],e["@babel/runtime/helpers/assertThisInitialized"],e["@babel/runtime/helpers/inheritsLoose"],e["@babel/runtime/helpers/wrapNativeSuper"],e["@babel/runtime/helpers/applyDecoratedDescriptor"],e["@babel/runtime/helpers/initializerWarningHelper"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(__WEBPACK_EXTERNAL_MODULE__0__,__WEBPACK_EXTERNAL_MODULE__1__,__WEBPACK_EXTERNAL_MODULE__9__,__WEBPACK_EXTERNAL_MODULE__10__,__WEBPACK_EXTERNAL_MODULE__2__,__WEBPACK_EXTERNAL_MODULE__3__,__WEBPACK_EXTERNAL_MODULE__11__,__WEBPACK_EXTERNAL_MODULE__12__,__WEBPACK_EXTERNAL_MODULE__13__,__WEBPACK_EXTERNAL_MODULE__4__,__WEBPACK_EXTERNAL_MODULE__5__){return(()=>{"use strict";var __webpack_modules__=[e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__0__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__1__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__2__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__3__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__4__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__5__},function(module,__unused_webpack_exports,__webpack_require__){var __dirname="/",e,t,r,n,i,s,o,a,l;if(module=__webpack_require__.nmd(module),null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&null!=__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window=void 0===__webpack_require__.g||null===__webpack_require__.g?{}:__webpack_require__.g;module.exports=(e=__webpack_require__(2),t=__webpack_require__(3),r=__webpack_require__(11),n=__webpack_require__(12),i=__webpack_require__(13),s=__webpack_require__(4),o=__webpack_require__(5),a=__webpack_require__(0),l=__webpack_require__(1),function(){var p=[function(t){t.exports=e},function(e){e.exports=a},function(e){e.exports=l},function(e){e.exports=n},function(e,t,r){var n=r(0),i=r.n(n),s=r(1),o=r.n(s),a=r(2);t.default=function(e){return void 0===e&&(e={}),e=i()({readAttribute:!0,type:a.string},e),function(t,r){if("string"==typeof r){var n,s,a=t.self||t.constructor;if(e.readAttribute){a.hasOwnProperty("observedAttributes")||(a.observedAttributes=a.observedAttributes?[].concat(a.observedAttributes):[]);var l=o().stringCamelCaseToDelimited(r);a.observedAttributes.includes(l)||a.observedAttributes.push(l)}e.type&&(a.hasOwnProperty("propertyTypes")||(a.propertyTypes=a.propertyTypes?i()({},a.propertyTypes):{}),!e.update&&a.propertyTypes.hasOwnProperty(r)||(a.propertyTypes[r]=e.type)),e.writeAttribute&&(a.hasOwnProperty("propertiesToReflectAsAttributes")||(a.propertiesToReflectAsAttributes=a.propertiesToReflectAsAttributes?o().copy(a.propertiesToReflectAsAttributes):new Map),e.update||a.propertiesToReflectAsAttributes instanceof Map&&!a.propertiesToReflectAsAttributes.has(r)||Array.isArray(a.propertiesToReflectAsAttributes)&&!a.propertiesToReflectAsAttributes.includes(r)||null!==a.propertiesToReflectAsAttributes&&"object"==typeof a.propertiesToReflectAsAttributes&&!a.propertiesToReflectAsAttributes.hasOwnProperty(r))&&("boolean"==typeof e.writeAttribute?!0===e.writeAttribute&&null!=(s=a.propertyTypes)&&s.hasOwnProperty(r)&&(n=a.propertyTypes[r]):n=e.writeAttribute,void 0!==n&&(Array.isArray(a.propertiesToReflectAsAttributes)&&(!0===e.writeAttribute?a.propertiesToReflectAsAttributes.push(r):a.propertiesToReflectAsAttributes=a.normalizePropertyTypeList(a.propertiesToReflectAsAttributes)),a.propertiesToReflectAsAttributes instanceof Map&&a.propertiesToReflectAsAttributes.set(r,n),null!==a.propertiesToReflectAsAttributes&&"object"==typeof a.propertiesToReflectAsAttributes&&(a.propertiesToReflectAsAttributes[r]=n))),e.alias&&(a.hasOwnProperty("propertyAliases")||(a.propertyAliases=a.propertyAliases?i()({},a.propertyAliases):{}),!e.update&&a.propertyAliases.hasOwnProperty(r)||(a.propertyAliases[r]=e.alias))}}}},,function(e){e.exports=t},function(e){e.exports=r},function(e){e.exports=i},function(e){e.exports=s},function(e){e.exports=o}],c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return p[e](r,r.exports,u),r.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return function(){u.r(d),u.d(d,{Web:function(){return E},api:function(){return O}});var e,t,r,n,i,s=u(0),o=u.n(s),a=u(6),l=u.n(a),p=u(7),c=u.n(p),h=u(3),f=u.n(h),b=u(8),_=u.n(b),m=u(9),y=u.n(m),v=(u(10),u(1)),g=u.n(v),A=u(2);function P(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var E=(e=(0,u(4).default)({type:A.boolean,writeAttribute:!0}),i=n=function(e){function t(){var n;return(n=e.call(this)||this).batchAttributeUpdates=!0,n.batchPropertyUpdates=!0,n.batchUpdates=!0,n.batchedAttributeUpdateRunning=!0,n.batchedPropertyUpdateRunning=!0,n.batchedUpdateRunning=!0,n.parent=null,n.rootInstance=null,n.scope={Tools:g()},n.domNodeEventBindings=new Map,n.domNodeTemplateCache=new Map,n.externalProperties={},n.ignoreAttributeUpdateObservations=!1,n.internalProperties={},n.outputEventNames=new Set,n.instance=null,l()(n,"isRoot",r,c()(n)),n.root=void 0,n.runDomConnectionAndRenderingInSameEventQueue=!1,n.self=t,n.slots={},n.self=n.constructor,n.self._propertiesToReflectAsAttributes||(n.self._propertiesToReflectAsAttributes=n.self.normalizePropertyTypeList(n.self.propertiesToReflectAsAttributes)),n.generateAliasIndex(),n.root=c()(n),n.defineGetterAndSetterInterface(),n}f()(t,e);var n=t.prototype;return n.attributeChangedCallback=function(e,t,r){this.ignoreAttributeUpdateObservations||t===r||this.updateAttribute(e,r)},n.updateAttribute=function(e,t){var r=this;this.evaluateStringOrNullAndSetAsProperty(e,t),this.batchAttributeUpdates?this.batchedAttributeUpdateRunning||this.batchedUpdateRunning||(this.batchedAttributeUpdateRunning=!0,this.batchedUpdateRunning=!0,g().timeout((function(){r.batchedAttributeUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("attributeChanged")}))):this.render("attributeChanged")},n.connectedCallback=function(){var e=this;try{this.isConnected=!0}catch(e){}this.parent=this,this.rootInstance=this,this.attachEventHandler(),this.self.determineRootBinding&&this.determineRootBinding(),this.self.applyRootBinding&&this.isRoot&&(this.determineRenderScope(),this.applyBinding(this,this.scope)),this.batchedAttributeUpdateRunning=!1,this.batchedPropertyUpdateRunning=!1,this.batchedUpdateRunning=!1,this.grabGivenSlots(),this.reflectExternalProperties(this.externalProperties),this.runDomConnectionAndRenderingInSameEventQueue?this.render("connected"):g().timeout((function(){return e.render("connected")}))},n.disconnectedCallback=function(){try{this.isConnected=!1}catch(e){}for(var e,t=P(this.domNodeEventBindings);!(e=t()).done;)for(var r,n=e.value,i=(n[0],P(n[1].values()));!(r=i()).done;)(0,r.value)();this.slots={}},n.defineGetterAndSetterInterface=function(){for(var e,t=this,r=function(){var r=e.value;Object.prototype.hasOwnProperty.call(t,r)&&t.setPropertyValue(r,t[r]),Object.defineProperty(t,r,{configurable:!0,get:function(){return this.getPropertyValue(r)},set:function(e){this.setPropertyValue(r,e),this.triggerPropertySpecificRendering(r,e)}})},n=P(g().arrayUnique(Object.keys(this.self.propertyTypes).concat(Object.keys(this.self._propertyAliasIndex))));!(e=n()).done;)r()},n.getPropertyAlias=function(e){return Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,e)?this.self._propertyAliasIndex[e]:null},n.getPropertyValue=function(e){var r,n,i,s,o=null==(r=this.instance)||null==(n=r.current)||!n.properties||t.propertyTypes.hasOwnProperty(e)&&!this.instance.current.properties.hasOwnProperty(e)?this.externalProperties[e]:this.instance.current.properties[e];return null!=(i=this.instance)&&null!=(s=i.current)&&s.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,e)?this.instance.current.state[e]:o},n.setExternalPropertyValue=function(e,t){this.externalProperties[e]=t;var r=this.getPropertyAlias(e);r&&(this.externalProperties[r]=t)},n.setInternalPropertyValue=function(e,t){this.internalProperties[e]=t;var r=this.getPropertyAlias(e);r&&(this.internalProperties[r]=t)},n.setPropertyValue=function(e,t){var r;this.reflectProperties(((r={})[e]=t,r)),this.setInternalPropertyValue(e,t)},n.triggerPropertySpecificRendering=function(e,t){var r=this;if(this.batchPropertyUpdates)this.batchedPropertyUpdateRunning||this.batchedUpdateRunning||(this.batchedPropertyUpdateRunning=!0,this.batchedUpdateRunning=!0,g().timeout((function(){void 0!==t&&r.isStateProperty(e)?(r.render("preStatePropertyChanged"),g().timeout((function(){r.setInternalPropertyValue(e,void 0),r.batchedPropertyUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("postStatePropertyChanged"),r.triggerOuputEvents()}))):(r.batchedPropertyUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("propertyChanged"),r.triggerOuputEvents())})));else{var n=this.isStateProperty(e);this.render(n?"preStatePropertyChanged":"propertyChanged"),void 0!==t&&n&&(this.setInternalPropertyValue(e,void 0),this.render("postStatePropertyChanged")),this.triggerOuputEvents()}},n.applyBinding=function(e,t){var r=this;if(e.getAttributeNames)for(var n,i=function(){var i=n.value,s="";if(i.startsWith("data-bind-")?s=i.substring("data-bind-".length):i.startsWith("bind-")&&(s=i.substring("bind-".length)),s){var a=e.getAttribute(i);if(null===a)return"continue";if(s.startsWith("attribute-")||s.startsWith("property-")){var l=g().stringEvaluate(a,t,!1,e);if(l.error)return console.warn('Error occurred during processing given attribute binding "'+i+'" on node:',e,l.error),"continue";s.startsWith("attribute-")?e.setAttribute(s.substring("attribute-".length),l.result):e[g().stringDelimitedToCamelCase(s.substring("property-".length))]=l.result}else if(s.startsWith("on-")){r.domNodeEventBindings.has(e)||r.domNodeEventBindings.set(e,new Map);var p=r.domNodeEventBindings.get(e);s=g().stringDelimitedToCamelCase(s.substring("on-".length)),p.has(s)&&p.get(s)(),t=o()({event:void 0,parameters:void 0},t);var c=g().stringCompile(a,t,!0);if(c.error)console.warn('Error occurred during compiling given event binding "'+i+'" on node:',e,c.error);else{var u=c.templateFunction.bind(e),d=function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];t.event=n[0],t.parameters=n;try{u.apply(void 0,c.originalScopeNames.map((function(e){return t[e]})))}catch(t){console.warn('Error occurred during processing given event binding "'+i+'" on node:',e,'Given expression "'+a+'" could not be evaluated with given scope names "'+c.scopeNames.join('", "')+'": '+g().represent(t))}};e.addEventListener(s,d),p.set(s,(function(){e.removeEventListener(s,d),p.delete(s),0===p.size&&r.domNodeEventBindings.delete(e)}))}}}},s=P(e.getAttributeNames());!(n=s()).done;)i()},n.applyBindings=function(e,t,r){for(void 0===r&&(r=!0);e;){var n;null==(n=e.attributes)||!n.length||!r&&e.getAttribute("slot")||this.applyBinding(e,t),e.nodeName.toLowerCase().includes("-")||this.applyBindings(e.firstChild,t),e=e.nextSibling}},n.compileDomNodeTemplate=function(e,t,r){var n;if(void 0===t&&(t=[]),void 0===r&&(r={}),(r=o()({ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe},r)).ignoreComponents&&null!=(n=e.nodeName)&&n.toLowerCase().includes("-"))return r.map;if(r.unsafe){var i=e.innerHTML;if(!i&&e.template&&(i=e.template),this.self.hasCode(i)){var s=g().stringCompile("`"+i+"`",t);r.map.set(e,{children:[],error:s.error,scopeNames:s.scopeNames,template:i,templateFunction:s.templateFunction})}}else{var a,l=e.nodeName.toLowerCase();if(["a","#text"].includes(l)){var p="a"===l?e.getAttribute("href"):e.textContent;this.self.hasCode(p)&&(a=p.replace(/ /g," ").trim())}var c=[];if(a){var u=g().stringCompile("`"+a+"`",t);r.map.set(e,{children:c,error:u.error,scopeNames:u.scopeNames,template:a,templateFunction:u.templateFunction})}for(var d=e.firstChild;d;)r.filter&&!r.filter(d)||c.push(this.compileDomNodeTemplate(d,t,o()({},r,{ignoreComponents:r.ignoreNestedComponents}))),d=d.nextSibling}return r.map},n.evaluateDomNodeTemplate=function(e,t,r){var n;if(void 0===t&&(t={}),void 0===r&&(r={}),(r=o()({applyBindings:!0,ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe},r)).map.has(e)||this.compileDomNodeTemplate(e,t,r),r.map.has(e)){var i=r.map.get(e),s=i.error,a=i.scopeNames,l=i.templateFunction;if(s)console.warn("Error occurred during compiling node content: "+s);else{var p=null;try{p=l.apply(void 0,a.map((function(e){return t[e]})))}catch(s){console.warn('Error occurred when "'+this.self._name+'" is running "'+l+'": with bound names "'+a.join('", "')+'": "'+s+'". Rendering node:',e)}null!==p&&(r.unsafe?e.innerHTML=p:"a"===e.nodeName.toLowerCase()?e.setAttribute("href",p):e.textContent=p)}}if(!(r.unsafe||r.ignoreComponents&&null!=(n=e.nodeName)&&n.toLowerCase().includes("-")))for(var c=e.firstChild;c;)r.filter&&!r.filter(c)||this.evaluateDomNodeTemplate(c,t,o()({},r,{applyBindings:!1,ignoreComponents:r.ignoreNestedComponents})),c=c.nextSibling;return r.applyBindings&&this.applyBindings(e,t),r.map},t.replaceDomNodes=function(e,r){for(var n,i=P([].concat(r).reverse());!(n=i()).done;){var s,o=n.value;t.trimSlots&&o.nodeType===Node.TEXT_NODE&&""===(null==(s=o.nodeValue)?void 0:s.trim())||e.after(o)}e.remove()},t.unwrapDomNode=function(e){for(var t=e.parentNode,r=[];e.firstChild;)r.push(e.firstChild),t.insertBefore(e.firstChild,e);return t.removeChild(e),r},n.determineRootBinding=function(){for(var e=this.parentNode;e;){var r;(e instanceof t||null!=(r=e.nodeName)&&r.includes("-")||null===e.parentNode&&"[object ShadowRoot]"===e.toString())&&(this.rootInstance===this?(this.parent=e,this.rootInstance=e,this.setPropertyValue("isRoot",!1)):this.rootInstance=e),e=e.parentNode}},t.hasCode=function(e){return"string"==typeof e&&e.includes("${")&&e.includes("}")&&/\${[\s\S]+}/.test(e)},t.normalizePropertyTypeList=function(e){if("string"==typeof e&&(e=[e]),Array.isArray(e)){var r=e;e=new Map;for(var n,i=P(r);!(n=i()).done;){var s=n.value;t.propertyTypes.hasOwnProperty(s)&&e.set(s,t.propertyTypes[s])}}else e=g().convertPlainObjectToMap(e);return e},n.attachEventHandler=function(){if(null!==this.self.eventToPropertyMapping){var e=this.attachExplicitDefinedOutputEventHandler();this.attachImplicitDefinedOutputEventHandler(!e)}},n.attachExplicitDefinedOutputEventHandler=function(){for(var e=this,t=!1,r=function(){var r=i[n];Object.prototype.hasOwnProperty.call(e.internalProperties,r)||(t=!0,e.outputEventNames.add(r),e.setInternalPropertyValue(r,(function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var s=e.reflectEventToProperties(r,n);s&&(n[0]=s),e.forwardEvent(r,n)})))},n=0,i=Object.keys(this.self.eventToPropertyMapping);n<i.length;n++)r();return t},n.attachImplicitDefinedOutputEventHandler=function(e){var t=this;void 0===e&&(e=!0);for(var r=function(){var r=i[n],s=r[0];r[1],Object.prototype.hasOwnProperty.call(t.internalProperties,s)||![A.func,"function"].includes(t.self.propertyTypes[s])||t.self.renderProperties.includes(s)||(t.outputEventNames.add(s),t.setInternalPropertyValue(s,(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e&&t.reflectEventToProperties(s,n),t.forwardEvent(s,n)})))},n=0,i=Object.entries(this.self.propertyTypes);n<i.length;n++)r()},n.triggerOuputEvents=function(){for(var e,t=P(this.outputEventNames);!(e=t()).done;){var r=e.value;this.forwardEvent(r,[this.externalProperties])}},n.forwardEvent=function(e,t){return e.length>"onX".length&&e.startsWith("on")&&(e=g().stringLowerCase(e.substring(2))),this.dispatchEvent(new CustomEvent(e,{detail:{parameters:t}}))},n.applySlots=function(e,t){for(var r=this,n=0,i=Array.from(e.querySelectorAll("slot"));n<i.length;n++){var s=i[n],o=s.getAttribute("name");if(null===o||"default"===o)if(this.slots.default){if(this.self.renderSlots){if(this.self.evaluateSlots)for(var a,l=P(this.slots.default);!(a=l()).done;){var p=a.value;this.evaluateDomNodeTemplate(p,t)}this.self.replaceDomNodes(s,this.slots.default)}}else this.slots.default=this.self.unwrapDomNode(s).map((function(e){return r.grabSlotContent(e)}));else Object.prototype.hasOwnProperty.call(this.slots,o)?this.self.renderSlots&&(this.self.evaluateSlots&&this.evaluateDomNodeTemplate(this.slots[o],t),this.self.replaceDomNodes(s,this.slots[o])):this.slots[o]=this.grabSlotContent(this.self.unwrapDomNode(s).filter((function(e){return"#text"!==e.nodeName.toLowerCase()}))[0])}},n.grabSlotContent=function(e){var t;if("textarea"===(null==(t=e.firstElementChild)?void 0:t.nodeName.toLowerCase())&&(!e.firstElementChild.hasAttribute("data-no-template")||"false"===e.firstElementChild.getAttribute("data-no-template"))){var r,n,i=e.firstElementChild.value;null==(r=e.classList)||r.remove("web-component-template");var s=e.cloneNode();return null==(n=e.classList)||n.add("web-component-template"),s.innerHTML="",s.template=i,s}return this.self.cloneSlots?e.cloneNode(!0):e},n.grabGivenSlots=function(){var e=this;this.slots={};for(var t=0,r=Array.from(this.querySelectorAll("[slot]"));t<r.length;t++){for(var n=r[t],i=n.parentNode,s=!0;i;){if(i.nodeName.includes("-")){i===this&&(s=!1);break}i=i.parentNode}s||(this.slots[n.getAttribute&&n.getAttribute("slot")&&n.getAttribute("slot").trim()?n.getAttribute("slot").trim():n.nodeName.toLowerCase()]=this.grabSlotContent(n))}this.slots.default?this.slots.default=[this.slots.default]:this.childNodes.length>0?this.slots.default=Array.from(this.childNodes).map((function(t){return e.grabSlotContent(t)})):this.slots.default=[]},n.isStateProperty=function(e){var t,r,n,i;return Boolean((null==(t=this.instance)||null==(r=t.current)?void 0:r.state)&&(Object.prototype.hasOwnProperty.call(null==(n=this.instance)||null==(i=n.current)?void 0:i.state,e)||this.instance.current.state.modelState&&Object.prototype.hasOwnProperty.call(this.instance.current.state.modelState,e)))},n.generateAliasIndex=function(){if(!this.self._propertyAliasIndex){this.self._propertyAliasIndex=o()({},this.self.propertyAliases);for(var e=0,t=Object.entries(this.self._propertyAliasIndex);e<t.length;e++){var r=t[e],n=r[0],i=r[1];Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,i)||(this.self._propertyAliasIndex[i]=n)}}},n.reflectExternalProperties=function(e){this.ignoreAttributeUpdateObservations=!0;for(var t=0,r=Object.entries(e);t<r.length;t++){var n=r[t],i=n[0],s=n[1];if(this.setExternalPropertyValue(i,s),this.isConnected){var o=g().stringCamelCaseToDelimited(i);if(this.self._propertiesToReflectAsAttributes.has(i))switch(this.self._propertiesToReflectAsAttributes.get(i)){case A.boolean:case"boolean":s?""!==this.getAttribute(o)&&this.setAttribute(o,""):this.hasAttribute(o)&&this.removeAttribute(o);break;case A.func:case"function":break;case"json":if(s){var a=JSON.stringify(s);if(a&&this.getAttribute(o)!==a){this.setAttribute(o,a);break}}this.hasAttribute(o)&&this.removeAttribute(o);break;case A.number:case"number":if("number"!=typeof s||isNaN(s))this.hasAttribute(o)&&this.removeAttribute(o);else{var l=""+s;this.getAttribute(o)!==l&&this.setAttribute(o,l)}break;case A.string:case"string":s?this.getAttribute(o)!==s&&this.setAttribute(o,s):this.hasAttribute(o)&&this.removeAttribute(o);break;case A.any:case A.array:case A.arrayOf:case A.element:case A.elementType:case A.instanceOf:case A.node:case A.object:case"object":case A.objectOf:case A.shape:case A.exact:case A.symbol:default:if(s){var p=g().represent(s);if(p&&this.getAttribute(o)!==p){this.setAttribute(o,p);break}}this.hasAttribute(o)&&this.removeAttribute(o)}}}this.ignoreAttributeUpdateObservations=!1},n.reflectProperties=function(e){var t,r,n,i;if(this.reflectExternalProperties(e),null!=(t=this.instance)&&null!=(r=t.current)&&r.state&&"object"==typeof this.instance.current.state)for(var s,o=P(Object.keys(this.instance.current.state).concat(this.instance.current.state.modelState?Object.keys(this.instance.current.state.modelState):[]));!(s=o()).done;){var a=s.value;Object.prototype.hasOwnProperty.call(this.internalProperties,a)&&this.setInternalPropertyValue(a,void 0)}null!=(n=this.internalProperties.model)&&n.state&&(null==(i=this.internalProperties.model)||delete i.state,this.setInternalPropertyValue("model",this.internalProperties.model));for(var l,p=P(this.self.controllableProperties);!(l=p()).done;){var c=l.value;Object.prototype.hasOwnProperty.call(e,c)&&this.setInternalPropertyValue(c,e[c])}},n.triggerRender=function(e){var t=this;this.batchUpdates?this.batchedUpdateRunning||(this.batchedUpdateRunning=!0,g().timeout((function(){t.batchedUpdateRunning=!1,t.render(e)}))):this.render(e)},n.reflectEventToProperties=function(e,t){var r=this.batchUpdates;this.batchUpdates=!1;var n=null;if(this.self.eventToPropertyMapping&&Object.prototype.hasOwnProperty.call(this.self.eventToPropertyMapping,e)&&g().isFunction(this.self.eventToPropertyMapping[e])){var i,s=(i=this.self.eventToPropertyMapping)[e].apply(i,t.concat([this]));Array.isArray(s)?(n=s[0],this.reflectProperties(n),g().extend(!0,this.internalProperties,s[1])):null!==s&&"object"==typeof s&&(n=s,this.reflectProperties(s))}else if(t.length>0&&null!==t[0]&&"object"==typeof t[0]){var a,l=t[0];if("persist"in t[0]&&g().isFunction(t[0].persist)){l={};for(var p=0,c=Object.keys(this.self.propertyTypes);p<c.length;p++)for(var u,d=c[p],h=P([d].concat(null!==(f=this.getPropertyAlias(d))&&void 0!==f?f:[]));!(u=h()).done;){var f,b=u.value,_=t[0].currentTarget&&Object.prototype.hasOwnProperty.call(t[0].currentTarget,b)?t[0].currentTarget[b]:this.getPropertyValue(b);_!==this.externalProperties[b]&&(l[b]=_)}}else[null,void 0].includes(null==(a=l.detail)?void 0:a.value)||(l=o()({},l.detail));n=l,this.reflectProperties(l)}return this.triggerRender("propertyReflected"),this.batchUpdates=r,n},n.evaluateStringOrNullAndSetAsProperty=function(e,t){var r=this,n=e.startsWith("-"),i=n?e.substring(1):e,s=g().stringDelimitedToCamelCase(i),o=this.getPropertyAlias(s);if(o&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,o)&&(s=o),Object.prototype.hasOwnProperty.call(this.self.propertyTypes,s)){var a=this.self.propertyTypes[s];if(n){if(t){var l=g().stringEvaluate(t,{Tools:g()},!1,this);l.error?(console.warn('Faild to process pre-evaluation attribute "'+e+'": '+l.error+'. Will be set to "undefined".'),this.setInternalPropertyValue(s,void 0)):(this.setInternalPropertyValue(s,l.result),this.setExternalPropertyValue(s,l.result))}}else switch(a){case A.boolean:case"boolean":var p=![null,"false"].includes(t);this.setInternalPropertyValue(s,p),this.setExternalPropertyValue(s,p);break;case A.func:case"function":var c,u=null,d=["data","event","firstArgument","firstParameter","options","scope","parameters","Tools"];if(t){var h=g().stringCompile(t,d);u=h.error,c=h.templateFunction,u&&console.warn('Failed to compile given handler "'+e+'": '+u+".")}this.setInternalPropertyValue(s,(function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];r.outputEventNames.has(s)&&r.reflectEventToProperties(s,i);var a=void 0;if(!u)try{a=c.call(r,i[0],i[0],i[0],i[0],i[0],i[0],i,g())}catch(r){console.warn('Failed to evaluate function "'+e+'" with expression "'+t+'" and scope variables "'+d.join('", "')+'" set to "'+g().represent(i)+'": '+r+'. Set property to "undedefined".')}return r.self.renderProperties.includes(s)||r.forwardEvent(s,i),a})),u||this.setExternalPropertyValue(s,c);break;case"json":if(t){var f;try{f=JSON.parse(t)}catch(u){console.warn('Error occurred during parsing given json attribute "'+e+'": '+g().represent(u));break}this.setInternalPropertyValue(s,f),this.setExternalPropertyValue(s,g().copy(f,1))}else this.setInternalPropertyValue(s,null),this.setExternalPropertyValue(s,null);break;case A.number:case"number":if(null===t){this.setInternalPropertyValue(s,t),this.setExternalPropertyValue(s,t);break}var b=parseFloat(t);isNaN(b)&&(b=void 0),this.setInternalPropertyValue(s,b),this.setExternalPropertyValue(s,b);break;case A.string:case"string":this.setInternalPropertyValue(s,t),this.setExternalPropertyValue(s,t);break;case A.any:case A.array:case A.arrayOf:case A.element:case A.elementType:case A.instanceOf:case A.node:case A.object:case"object":case A.objectOf:case A.oneOf:case A.oneOfType:case A.shape:case A.exact:case A.symbol:default:if(t){var _=g().stringEvaluate(t,{},!1,this);if(_.error){console.warn('Error occurred during processing given attribute configuration "'+e+'": '+_.error);break}this.setInternalPropertyValue(s,_.result),this.setExternalPropertyValue(s,g().copy(_.result,1))}else this.hasAttribute(e)?(this.setInternalPropertyValue(s,!0),this.setExternalPropertyValue(s,!0)):(this.setInternalPropertyValue(s,null),this.setExternalPropertyValue(s,null))}}},n.determineRenderScope=function(e){var t,r;void 0===e&&(e={}),this.scope=o()({},(null==(t=this.parent)?void 0:t.scope)||{},this.scope,this.internalProperties,((r={parent:this.parent,root:this.rootInstance,self:this})[g().stringLowerCase(this.self._name)||"instance"]=this,r),e),this.scope.scope=this.scope},n.applyShadowRootIfNotExisting=function(){this.self.shadowDOM&&this.root===this&&(this.root=(!("attachShadow"in this)&&"ShadyDOM"in window?window.ShadyDOM.wrap(this):this).attachShadow(null!==this.self.shadowDOM&&"object"==typeof this.self.shadowDOM?this.self.shadowDOM:{mode:"open"}))},n.render=function(e){if(void 0===e&&(e="unknown"),this.determineRenderScope(),this.dispatchEvent(new CustomEvent("render",{detail:{reason:e,scope:this.scope}}))){var t=g().stringEvaluate("`"+this.self.content+"`",this.scope);if(t.error)console.warn("Faild to process template: "+t.error);else{this.applyShadowRootIfNotExisting();var r=document.createElement("div");r.innerHTML=t.result,this.applySlots(r,o()({},this.scope,{parent:this})),this.root.innerHTML=r.innerHTML,this.applyBindings(this.root.firstChild,this.scope,this.self.renderSlots)}}},t}(_()(HTMLElement)),n.applyRootBinding=!0,n.content="<slot>Please provide a template to transclude.</slot>",n.determineRootBinding=!0,n.shadowDOM=null,n.observedAttributes=[],n.controllableProperties=[],n.eventToPropertyMapping={},n.propertyAliases={},n.propertyTypes={},n.propertiesToReflectAsAttributes=[],n.renderProperties=["children"],n.cloneSlots=!1,n.evaluateSlots=!1,n.renderSlots=!0,n.trimSlots=!0,n.renderUnsafe=!1,n._name="BaseWeb",n._propertyAliasIndex=void 0,n._propertiesToReflectAsAttributes=void 0,t=i,r=y()(t.prototype,"isRoot",[e],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),t),O={component:E,register:function(e){return void 0===e&&(e=g().stringCamelCaseToDelimited(E._name)),customElements.define(e,E)}};d.default=E}(),d}())},,,e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__9__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__10__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__11__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__12__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__13__}],__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ReactWeb:()=>l,api:()=>p});var e=__webpack_require__(0),t=__webpack_require__.n(e),r=__webpack_require__(1),n=__webpack_require__(9),i=__webpack_require__.n(n),s=__webpack_require__(10),o=__webpack_require__(6),a=__webpack_require__.n(o);class l extends(a()){constructor(...e){super(...e),this.compiledSlots={},this.preparedSlots={},this.rootReactInstance=null,this.self=l,this.wrapMemorizingWrapper=null,this.isWrapped=!1,this.reflectInstanceProperties=()=>{var e;null!=(e=this.instance)&&e.current&&this.instance.current.properties&&this.reflectProperties(this.instance.current.properties)}}connectedCallback(){this.applyComponentWrapper(),this.rootReactInstance=this,super.connectedCallback()}disconnectedCallback(){(0,s.unmountComponentAtNode)(this.root),super.disconnectedCallback()}reflectExternalProperties(e){this.isRoot&&super.reflectExternalProperties(e)}render(e="unknown"){var r;if(this.rootReactInstance===this&&this.dispatchEvent(new CustomEvent("render",{detail:{reason:e,scope:this.scope}}))){if(this.determineRenderScope(),0===Object.keys(this.compiledSlots).length&&this.preCompileSlots(),this.evaluateSlots({...this.scope,parent:this}),this.prepareProperties(this.internalProperties),this.applyShadowRootIfNotExisting(),this.root!==this){let e=this.firstChild;for(;e;){const t=e.nextSibling;this.removeChild(e),e=t}}(0,s.render)((0,n.createElement)(this.self.content,this.internalProperties),this.root),null!=(r=this.instance)&&r.current?this.reflectInstanceProperties():t().timeout(this.reflectInstanceProperties)}}setPropertyValue(e,r){this.reflectProperties({[e]:t().copy(r,1)}),this.setInternalPropertyValue(e,t().copy(r,1))}setInternalPropertyValue(e,t){null===t?t=r.NullSymbol:void 0===t&&(t=r.UndefinedSymbol),super.setInternalPropertyValue(e,t)}preCompileDomNodes(e,t={},r=!1){if(1===(e=e.filter((e=>e.nodeType!==Node.TEXT_NODE||"string"==typeof e.nodeValue&&""!==e.nodeValue.trim()))).length)return this.preCompileDomNode(e[0],t,r);let i=1;const s=[];for(const n of e){const e=this.preCompileDomNode(n,t,r,i.toString());e&&(s.push(e),i+=1)}return r?e=>(...t)=>{const r=[];for(const n of s){const i=n(e);"function"==typeof i&&r.push(i(...t))}return(0,n.createElement)(n.Fragment,{children:r})}:s}preCompileDomNode(e,r={},i=!1,s){if(i){const t=this.preCompileDomNode(e,{...r,data:void 0,firstArgument:void 0,firstParameter:void 0,options:void 0,scope:void 0,parameters:void 0},!1,s);return e=>(...r)=>{const n=r.length>0?r[0]:null;return t({...e,data:n,firstArgument:n,firstParameter:n,options:n,scope:n,parameters:r})}}if(e.nodeType===Node.TEXT_NODE){const t="string"==typeof e.nodeValue?e.nodeValue.trim():"",r=s&&t?(0,n.createElement)(n.Fragment,{children:t,key:s}):t||null;return()=>r}if(!e.getAttributeNames)return()=>null;let o,a;const l=this.self.isReactComponent(e);l?(e.determineRenderScope(),0===Object.keys(this.compiledSlots).length&&e.preCompileSlots(),o=e.internalProperties,s&&!Object.prototype.hasOwnProperty.call(o,"key")&&(o.key=s),a=e.constructor.content):(o={key:s},a=e.tagName.toLowerCase());let p=Object.keys(r);const c={};for(const n of e.getAttributeNames()){var u;let i=e.getAttribute(n);if(null===i)continue;let s=!1,a="";if(n.startsWith("data-bind-")?a=n.substring("data-bind-".length):n.startsWith("bind-")&&(a=n.substring("bind-".length)),a.startsWith("attribute-")||"attributes"===a||a.startsWith("property-")||"properties"===a){const{error:r,originalScopeNames:o,templateFunction:l}=t().stringCompile(i,p);if(r){console.warn(`Error occurred during compiling given attribute binding "${n}" on node:`,e,r);continue}"attributes"===a||"properties"===a?s=!0:a=a.startsWith("attribute-")?a.substring("attribute-".length):a.substring("property-".length),i={originalScopeNames:o,templateFunction:l.bind(this)}}else if(a.startsWith("on-")){a=t().stringDelimitedToCamelCase(a),Object.prototype.hasOwnProperty.call(r,"event")||(p=[...p,"event"]),Object.prototype.hasOwnProperty.call(r,"parameters")||(p=[...p,"parameters"]);const{error:s,originalScopeNames:o,scopeNames:l,templateFunction:c}=t().stringCompile(i,p,!0);if(s){console.warn(`Error occurred during compiling given event binding "${n}" on node:`,e,s);continue}const u=c.bind(this);i=(...s)=>{r.event=s[0],r.parameters=s;try{u(...o.map((e=>r[e])))}catch(r){console.warn(`Error occurred during processing given event binding "${n}" on node: `,e,`Given expression "${i}" could not be evaluated with given scope names "${l.join('", "')}": `+t().represent(r))}}}else a=n;const l={class:"className",for:"htmlFor"};Object.prototype.hasOwnProperty.call(l,a)&&(a=l[a]),a=t().stringDelimitedToCamelCase(a),null!=(u=i)&&u.originalScopeNames?c[s?"":a]=i:o[a]=i}if(!l){const t=Array.from(e.childNodes);t.length&&(o.children=this.preCompileDomNodes(t,r))}return t=>{(t={...r,...t}).scope=t;let i={...o};for(const[e,{originalScopeNames:r,templateFunction:n}]of Object.entries(c)){const s=n(...r.map((e=>t[e])));""===e?i={...i,...s}:i[e]=s}return Object.prototype.hasOwnProperty.call(i,"innerHTML")&&(i.dangerouslySetInnerHTML={__html:i.innerHTML},delete i.children,delete i.innerHTML),Object.prototype.hasOwnProperty.call(i,"textContent")?(i.children=i.textContent,delete i.textContent):l?(e.evaluateSlots({...i,...t,parent:e}),e.prepareProperties(i),t={...i,...t,parent:e}):i.children&&(i.children=this.evaluatePreCompiledDomNodes(i.children,t)),(0,n.createElement)(a,i)}}evaluatePreCompiledDomNodes(e,t={}){if(!Array.isArray(e))return e(t);if(1===e.length)return e[0](t);const r=[];for(const n of e){const e=n(t);e&&r.push(e)}return r}preCompileSlots(){var e;for(const e in this.slots)Object.prototype.hasOwnProperty.call(this.slots,e)&&"default"!==e&&(this.compiledSlots[e]=this.preCompileDomNode(this.slots[e],{...this.scope,parent:this},[r.func,"function"].includes(this.self.propertyTypes&&this.self.propertyTypes[e])));this.slots.default&&this.slots.default.length>0&&(this.compiledSlots.children=this.preCompileDomNodes(this.slots.default,{...this.scope,parent:this},[r.func,"function"].includes(null==(e=this.self.propertyTypes)?void 0:e.children)))}evaluateSlots(e){this.preparedSlots={};for(const t in this.compiledSlots)Object.prototype.hasOwnProperty.call(this.compiledSlots,t)&&("children"===t?this.preparedSlots.children=this.evaluatePreCompiledDomNodes(this.compiledSlots[t],e):this.preparedSlots[t]=this.compiledSlots[t](e))}static isReactComponent(e){const t=e.constructor;return"object"==typeof t.content&&(!1===t.attachWebComponentAdapterIfNotExists||"react"===t.content.webComponentAdapterWrapped)}determineRootBinding(){super.determineRootBinding();let e=this.parentNode;for(;e;){if(this.self.isReactComponent(e)){this.rootReactInstance=e;break}e=e.parentNode}}applyComponentWrapper(){if("string"==typeof this.self.content||this.isWrapped)return;this.isWrapped=!0;const e=this.self.content.wrapped||this.self.content;this.self.content.webComponentAdapterWrapped?this.wrapMemorizingWrapper&&(this.self.content=(0,n.memo)(this.self.content),this.self.content.wrapped=e):this.self.attachWebComponentAdapterIfNotExists?(this.self.content.displayName||(this.self.content.displayName=this.self._name),this.self.content=(0,n.forwardRef)(((t,r)=>((0,n.useImperativeHandle)(r,(()=>({properties:t}))),(0,n.createElement)(e,t)))),(this.wrapMemorizingWrapper||null===this.wrapMemorizingWrapper)&&(this.self.content=(0,n.memo)(this.self.content)),this.self.content.wrapped=e,this.self.content.webComponentAdapterWrapped="react"):this.wrapMemorizingWrapper&&(this.self.content=(0,n.memo)(this.self.content),this.self.content.wrapped=e)}prepareProperties(e){t().extend(e,this.preparedSlots),this.self.removeKnownUnwantedPropertyKeys(this.self,e),e.ref||(this.instance=(0,n.createRef)(),e.ref=this.instance)}static removeKnownUnwantedPropertyKeys(e,t){if("string"!=typeof e.content)for(const r of["isRoot","isTrusted","__composed"])Object.prototype.hasOwnProperty.call(t,r)&&(Object.prototype.hasOwnProperty.call(e.content,"propTypes")&&!Object.prototype.hasOwnProperty.call(e.content.propTypes,r)||Object.prototype.hasOwnProperty.call(e.content,"wrapped")&&Object.prototype.hasOwnProperty.call(e.content.wrapped,"propTypes")&&!Object.prototype.hasOwnProperty.call(e.content.wrapped.propTypes,r))&&delete t[r]}}l.attachWebComponentAdapterIfNotExists=!0,l.content="div",l.react=i(),l._name="ReactWebComponent";const p={component:l,register:(e=t().stringCamelCaseToDelimited(l._name))=>customElements.define(e,l)};__webpack_exports__.default=l})(),__webpack_exports__})()}));
|
1
|
+
'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("clientnode"),require("clientnode/property-types"),require("react"),require("react-dom"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/helpers/wrapNativeSuper"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"));else if("function"==typeof define&&define.amd)define(["clientnode","clientnode/property-types","react","react-dom","@babel/runtime/helpers/extends","@babel/runtime/helpers/initializerDefineProperty","@babel/runtime/helpers/assertThisInitialized","@babel/runtime/helpers/inheritsLoose","@babel/runtime/helpers/wrapNativeSuper","@babel/runtime/helpers/applyDecoratedDescriptor","@babel/runtime/helpers/initializerWarningHelper"],t);else{var r="object"==typeof exports?t(require("clientnode"),require("clientnode/property-types"),require("react"),require("react-dom"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/assertThisInitialized"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/helpers/wrapNativeSuper"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper")):t(e.clientnode,e["clientnode/property-types"],e.react,e["react-dom"],e["@babel/runtime/helpers/extends"],e["@babel/runtime/helpers/initializerDefineProperty"],e["@babel/runtime/helpers/assertThisInitialized"],e["@babel/runtime/helpers/inheritsLoose"],e["@babel/runtime/helpers/wrapNativeSuper"],e["@babel/runtime/helpers/applyDecoratedDescriptor"],e["@babel/runtime/helpers/initializerWarningHelper"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(__WEBPACK_EXTERNAL_MODULE__0__,__WEBPACK_EXTERNAL_MODULE__1__,__WEBPACK_EXTERNAL_MODULE__9__,__WEBPACK_EXTERNAL_MODULE__10__,__WEBPACK_EXTERNAL_MODULE__2__,__WEBPACK_EXTERNAL_MODULE__3__,__WEBPACK_EXTERNAL_MODULE__11__,__WEBPACK_EXTERNAL_MODULE__12__,__WEBPACK_EXTERNAL_MODULE__13__,__WEBPACK_EXTERNAL_MODULE__4__,__WEBPACK_EXTERNAL_MODULE__5__){return(()=>{"use strict";var __webpack_modules__=[e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__0__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__1__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__2__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__3__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__4__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__5__},function(module,__unused_webpack_exports,__webpack_require__){var __dirname="/",e,t,r,n,i,s,o,a,l;if(module=__webpack_require__.nmd(module),null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&null!=__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window=void 0===__webpack_require__.g||null===__webpack_require__.g?{}:__webpack_require__.g;module.exports=(e=__webpack_require__(2),t=__webpack_require__(3),r=__webpack_require__(11),n=__webpack_require__(12),i=__webpack_require__(13),s=__webpack_require__(4),o=__webpack_require__(5),a=__webpack_require__(0),l=__webpack_require__(1),function(){var p=[function(t){t.exports=e},function(e){e.exports=a},function(e){e.exports=l},function(e){e.exports=n},function(e,t,r){var n=r(0),i=r.n(n),s=r(1),o=r.n(s),a=r(2);t.default=function(e){return void 0===e&&(e={}),e=i()({readAttribute:!0,type:a.string},e),function(t,r){if("string"==typeof r){var n,s,a=t.self||t.constructor;if(e.readAttribute){a.hasOwnProperty("observedAttributes")||(a.observedAttributes=a.observedAttributes?[].concat(a.observedAttributes):[]);var l=o().stringCamelCaseToDelimited(r);a.observedAttributes.includes(l)||a.observedAttributes.push(l)}e.type&&(a.hasOwnProperty("propertyTypes")||(a.propertyTypes=a.propertyTypes?i()({},a.propertyTypes):{}),!e.update&&a.propertyTypes.hasOwnProperty(r)||(a.propertyTypes[r]=e.type)),e.writeAttribute&&(a.hasOwnProperty("propertiesToReflectAsAttributes")||(a.propertiesToReflectAsAttributes=a.propertiesToReflectAsAttributes?o().copy(a.propertiesToReflectAsAttributes):new Map),e.update||a.propertiesToReflectAsAttributes instanceof Map&&!a.propertiesToReflectAsAttributes.has(r)||Array.isArray(a.propertiesToReflectAsAttributes)&&!a.propertiesToReflectAsAttributes.includes(r)||null!==a.propertiesToReflectAsAttributes&&"object"==typeof a.propertiesToReflectAsAttributes&&!a.propertiesToReflectAsAttributes.hasOwnProperty(r))&&("boolean"==typeof e.writeAttribute?!0===e.writeAttribute&&null!=(s=a.propertyTypes)&&s.hasOwnProperty(r)&&(n=a.propertyTypes[r]):n=e.writeAttribute,void 0!==n&&(Array.isArray(a.propertiesToReflectAsAttributes)&&(!0===e.writeAttribute?a.propertiesToReflectAsAttributes.push(r):a.propertiesToReflectAsAttributes=a.normalizePropertyTypeList(a.propertiesToReflectAsAttributes)),a.propertiesToReflectAsAttributes instanceof Map&&a.propertiesToReflectAsAttributes.set(r,n),null!==a.propertiesToReflectAsAttributes&&"object"==typeof a.propertiesToReflectAsAttributes&&(a.propertiesToReflectAsAttributes[r]=n))),e.alias&&(a.hasOwnProperty("propertyAliases")||(a.propertyAliases=a.propertyAliases?i()({},a.propertyAliases):{}),!e.update&&a.propertyAliases.hasOwnProperty(r)||(a.propertyAliases[r]=e.alias))}}}},,function(e){e.exports=t},function(e){e.exports=r},function(e){e.exports=i},function(e){e.exports=s},function(e){e.exports=o}],c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return p[e](r,r.exports,u),r.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return function(){u.r(d),u.d(d,{Web:function(){return E},api:function(){return O}});var e,t,r,n,i,s=u(0),o=u.n(s),a=u(6),l=u.n(a),p=u(7),c=u.n(p),h=u(3),f=u.n(h),b=u(8),_=u.n(b),m=u(9),y=u.n(m),v=(u(10),u(1)),g=u.n(v),A=u(2);function P(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var E=(e=(0,u(4).default)({type:A.boolean,writeAttribute:!0}),i=n=function(e){function t(){var n;return(n=e.call(this)||this).batchAttributeUpdates=!0,n.batchPropertyUpdates=!0,n.batchUpdates=!0,n.batchedAttributeUpdateRunning=!0,n.batchedPropertyUpdateRunning=!0,n.batchedUpdateRunning=!0,n.parent=null,n.rootInstance=null,n.scope={Tools:g()},n.domNodeEventBindings=new Map,n.domNodeTemplateCache=new Map,n.externalProperties={},n.ignoreAttributeUpdateObservations=!1,n.internalProperties={},n.outputEventNames=new Set,n.instance=null,l()(n,"isRoot",r,c()(n)),n.root=void 0,n.runDomConnectionAndRenderingInSameEventQueue=!1,n.self=t,n.slots={},n.self=n.constructor,n.self._propertiesToReflectAsAttributes||(n.self._propertiesToReflectAsAttributes=n.self.normalizePropertyTypeList(n.self.propertiesToReflectAsAttributes)),n.generateAliasIndex(),n.root=c()(n),n.defineGetterAndSetterInterface(),n}f()(t,e);var n=t.prototype;return n.attributeChangedCallback=function(e,t,r){this.ignoreAttributeUpdateObservations||t===r||this.updateAttribute(e,r)},n.updateAttribute=function(e,t){var r=this;this.evaluateStringOrNullAndSetAsProperty(e,t),this.batchAttributeUpdates?this.batchedAttributeUpdateRunning||this.batchedUpdateRunning||(this.batchedAttributeUpdateRunning=!0,this.batchedUpdateRunning=!0,g().timeout((function(){r.batchedAttributeUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("attributeChanged")}))):this.render("attributeChanged")},n.connectedCallback=function(){var e=this;try{this.isConnected=!0}catch(e){}this.parent=this,this.rootInstance=this,this.attachEventHandler(),this.self.determineRootBinding&&this.determineRootBinding(),this.self.applyRootBinding&&this.isRoot&&(this.determineRenderScope(),this.applyBinding(this,this.scope)),this.batchedAttributeUpdateRunning=!1,this.batchedPropertyUpdateRunning=!1,this.batchedUpdateRunning=!1,this.grabGivenSlots(),this.reflectExternalProperties(this.externalProperties),this.runDomConnectionAndRenderingInSameEventQueue?this.render("connected"):g().timeout((function(){return e.render("connected")}))},n.disconnectedCallback=function(){try{this.isConnected=!1}catch(e){}for(var e,t=P(this.domNodeEventBindings);!(e=t()).done;)for(var r,n=e.value,i=(n[0],P(n[1].values()));!(r=i()).done;)(0,r.value)();this.slots={}},n.defineGetterAndSetterInterface=function(){for(var e,t=this,r=function(){var r=e.value;Object.prototype.hasOwnProperty.call(t,r)&&t.setPropertyValue(r,t[r]),Object.defineProperty(t,r,{configurable:!0,get:function(){return this.getPropertyValue(r)},set:function(e){this.setPropertyValue(r,e),this.triggerPropertySpecificRendering(r,e)}})},n=P(g().arrayUnique(Object.keys(this.self.propertyTypes).concat(Object.keys(this.self._propertyAliasIndex))));!(e=n()).done;)r()},n.getPropertyAlias=function(e){return Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,e)?this.self._propertyAliasIndex[e]:null},n.getPropertyValue=function(e){var r,n,i,s,o=null==(r=this.instance)||null==(n=r.current)||!n.properties||t.propertyTypes.hasOwnProperty(e)&&!this.instance.current.properties.hasOwnProperty(e)?this.externalProperties[e]:this.instance.current.properties[e];return null!=(i=this.instance)&&null!=(s=i.current)&&s.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,e)?this.instance.current.state[e]:o},n.setExternalPropertyValue=function(e,t){this.externalProperties[e]=t;var r=this.getPropertyAlias(e);r&&(this.externalProperties[r]=t)},n.setInternalPropertyValue=function(e,t){this.internalProperties[e]=t;var r=this.getPropertyAlias(e);r&&(this.internalProperties[r]=t)},n.setPropertyValue=function(e,t){var r;this.reflectProperties(((r={})[e]=t,r)),this.setInternalPropertyValue(e,t)},n.triggerPropertySpecificRendering=function(e,t){var r=this;if(this.batchPropertyUpdates)this.batchedPropertyUpdateRunning||this.batchedUpdateRunning||(this.batchedPropertyUpdateRunning=!0,this.batchedUpdateRunning=!0,g().timeout((function(){void 0!==t&&r.isStateProperty(e)?(r.render("preStatePropertyChanged"),g().timeout((function(){r.setInternalPropertyValue(e,void 0),r.batchedPropertyUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("postStatePropertyChanged"),r.triggerOuputEvents()}))):(r.batchedPropertyUpdateRunning=!1,r.batchedUpdateRunning=!1,r.render("propertyChanged"),r.triggerOuputEvents())})));else{var n=this.isStateProperty(e);this.render(n?"preStatePropertyChanged":"propertyChanged"),void 0!==t&&n&&(this.setInternalPropertyValue(e,void 0),this.render("postStatePropertyChanged")),this.triggerOuputEvents()}},n.applyBinding=function(e,t){var r=this;if(e.getAttributeNames)for(var n,i=function(){var i=n.value,s="";if(i.startsWith("data-bind-")?s=i.substring("data-bind-".length):i.startsWith("bind-")&&(s=i.substring("bind-".length)),s){var a=e.getAttribute(i);if(null===a)return"continue";if(s.startsWith("attribute-")||s.startsWith("property-")){var l=g().stringEvaluate(a,t,!1,e);if(l.error)return console.warn('Error occurred during processing given attribute binding "'+i+'" on node:',e,l.error),"continue";s.startsWith("attribute-")?e.setAttribute(s.substring("attribute-".length),l.result):e[g().stringDelimitedToCamelCase(s.substring("property-".length))]=l.result}else if(s.startsWith("on-")){r.domNodeEventBindings.has(e)||r.domNodeEventBindings.set(e,new Map);var p=r.domNodeEventBindings.get(e);s=g().stringDelimitedToCamelCase(s.substring("on-".length)),p.has(s)&&p.get(s)(),t=o()({event:void 0,parameters:void 0},t);var c=g().stringCompile(a,t,!0);if(c.error)console.warn('Error occurred during compiling given event binding "'+i+'" on node:',e,c.error);else{var u=c.templateFunction.bind(e),d=function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];t.event=n[0],t.parameters=n;try{u.apply(void 0,c.originalScopeNames.map((function(e){return t[e]})))}catch(t){console.warn('Error occurred during processing given event binding "'+i+'" on node:',e,'Given expression "'+a+'" could not be evaluated with given scope names "'+c.scopeNames.join('", "')+'": '+g().represent(t))}};e.addEventListener(s,d),p.set(s,(function(){e.removeEventListener(s,d),p.delete(s),0===p.size&&r.domNodeEventBindings.delete(e)}))}}}},s=P(e.getAttributeNames());!(n=s()).done;)i()},n.applyBindings=function(e,t,r){for(void 0===r&&(r=!0);e;){var n;null==(n=e.attributes)||!n.length||!r&&e.getAttribute("slot")||this.applyBinding(e,t),e.nodeName.toLowerCase().includes("-")||this.applyBindings(e.firstChild,t),e=e.nextSibling}},n.compileDomNodeTemplate=function(e,t,r){var n;if(void 0===t&&(t=[]),void 0===r&&(r={}),(r=o()({ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe},r)).ignoreComponents&&null!=(n=e.nodeName)&&n.toLowerCase().includes("-"))return r.map;if(r.unsafe){var i=e.innerHTML;if(!i&&e.template&&(i=e.template),this.self.hasCode(i)){var s=g().stringCompile("`"+i+"`",t);r.map.set(e,{children:[],error:s.error,scopeNames:s.scopeNames,template:i,templateFunction:s.templateFunction})}}else{var a,l=e.nodeName.toLowerCase();if(["a","#text"].includes(l)){var p="a"===l?e.getAttribute("href"):e.textContent;this.self.hasCode(p)&&(a=p.replace(/ /g," ").trim())}var c=[];if(a){var u=g().stringCompile("`"+a+"`",t);r.map.set(e,{children:c,error:u.error,scopeNames:u.scopeNames,template:a,templateFunction:u.templateFunction})}for(var d=e.firstChild;d;)r.filter&&!r.filter(d)||c.push(this.compileDomNodeTemplate(d,t,o()({},r,{ignoreComponents:r.ignoreNestedComponents}))),d=d.nextSibling}return r.map},n.evaluateDomNodeTemplate=function(e,t,r){var n;if(void 0===t&&(t={}),void 0===r&&(r={}),(r=o()({applyBindings:!0,ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe},r)).map.has(e)||this.compileDomNodeTemplate(e,t,r),r.map.has(e)){var i=r.map.get(e),s=i.error,a=i.scopeNames,l=i.templateFunction;if(s)console.warn("Error occurred during compiling node content: "+s);else{var p=null;try{p=l.apply(void 0,a.map((function(e){return t[e]})))}catch(s){console.warn('Error occurred when "'+this.self._name+'" is running "'+l+'": with bound names "'+a.join('", "')+'": "'+s+'". Rendering node:',e)}null!==p&&(r.unsafe?e.innerHTML=p:"a"===e.nodeName.toLowerCase()?e.setAttribute("href",p):e.textContent=p)}}if(!(r.unsafe||r.ignoreComponents&&null!=(n=e.nodeName)&&n.toLowerCase().includes("-")))for(var c=e.firstChild;c;)r.filter&&!r.filter(c)||this.evaluateDomNodeTemplate(c,t,o()({},r,{applyBindings:!1,ignoreComponents:r.ignoreNestedComponents})),c=c.nextSibling;return r.applyBindings&&this.applyBindings(e,t),r.map},t.replaceDomNodes=function(e,r){for(var n,i=P([].concat(r).reverse());!(n=i()).done;){var s,o=n.value;t.trimSlots&&o.nodeType===Node.TEXT_NODE&&""===(null==(s=o.nodeValue)?void 0:s.trim())||e.after(o)}e.remove()},t.unwrapDomNode=function(e){for(var t=e.parentNode,r=[];e.firstChild;)r.push(e.firstChild),t.insertBefore(e.firstChild,e);return t.removeChild(e),r},n.determineRootBinding=function(){for(var e=this.parentNode;e;){var r;(e instanceof t||null!=(r=e.nodeName)&&r.includes("-")||null===e.parentNode&&"[object ShadowRoot]"===e.toString())&&(this.rootInstance===this?(this.parent=e,this.rootInstance=e,this.setPropertyValue("isRoot",!1)):this.rootInstance=e),e=e.parentNode}},t.hasCode=function(e){return"string"==typeof e&&e.includes("${")&&e.includes("}")&&/\${[\s\S]+}/.test(e)},t.normalizePropertyTypeList=function(e){if("string"==typeof e&&(e=[e]),Array.isArray(e)){var r=e;e=new Map;for(var n,i=P(r);!(n=i()).done;){var s=n.value;t.propertyTypes.hasOwnProperty(s)&&e.set(s,t.propertyTypes[s])}}else e=g().convertPlainObjectToMap(e);return e},n.attachEventHandler=function(){if(null!==this.self.eventToPropertyMapping){var e=this.attachExplicitDefinedOutputEventHandler();this.attachImplicitDefinedOutputEventHandler(!e)}},n.attachExplicitDefinedOutputEventHandler=function(){for(var e=this,t=!1,r=function(){var r=i[n];Object.prototype.hasOwnProperty.call(e.internalProperties,r)||(t=!0,e.outputEventNames.add(r),e.setInternalPropertyValue(r,(function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var s=e.reflectEventToProperties(r,n);s&&(n[0]=s),e.forwardEvent(r,n)})))},n=0,i=Object.keys(this.self.eventToPropertyMapping);n<i.length;n++)r();return t},n.attachImplicitDefinedOutputEventHandler=function(e){var t=this;void 0===e&&(e=!0);for(var r=function(){var r=i[n],s=r[0];r[1],Object.prototype.hasOwnProperty.call(t.internalProperties,s)||![A.func,"function"].includes(t.self.propertyTypes[s])||t.self.renderProperties.includes(s)||(t.outputEventNames.add(s),t.setInternalPropertyValue(s,(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e&&t.reflectEventToProperties(s,n),t.forwardEvent(s,n)})))},n=0,i=Object.entries(this.self.propertyTypes);n<i.length;n++)r()},n.triggerOuputEvents=function(){for(var e,t=P(this.outputEventNames);!(e=t()).done;){var r=e.value;this.forwardEvent(r,[this.externalProperties])}},n.forwardEvent=function(e,t){return e.length>"onX".length&&e.startsWith("on")&&(e=g().stringLowerCase(e.substring(2))),this.dispatchEvent(new CustomEvent(e,{detail:{parameters:t}}))},n.applySlots=function(e,t){for(var r=this,n=0,i=Array.from(e.querySelectorAll("slot"));n<i.length;n++){var s=i[n],o=s.getAttribute("name");if(null===o||"default"===o)if(this.slots.default){if(this.self.renderSlots){if(this.self.evaluateSlots)for(var a,l=P(this.slots.default);!(a=l()).done;){var p=a.value;this.evaluateDomNodeTemplate(p,t)}this.self.replaceDomNodes(s,this.slots.default)}}else this.slots.default=this.self.unwrapDomNode(s).map((function(e){return r.grabSlotContent(e)}));else Object.prototype.hasOwnProperty.call(this.slots,o)?this.self.renderSlots&&(this.self.evaluateSlots&&this.evaluateDomNodeTemplate(this.slots[o],t),this.self.replaceDomNodes(s,this.slots[o])):this.slots[o]=this.grabSlotContent(this.self.unwrapDomNode(s).filter((function(e){return"#text"!==e.nodeName.toLowerCase()}))[0])}},n.grabSlotContent=function(e){var t;if("textarea"===(null==(t=e.firstElementChild)?void 0:t.nodeName.toLowerCase())&&(!e.firstElementChild.hasAttribute("data-no-template")||"false"===e.firstElementChild.getAttribute("data-no-template"))){var r,n,i=e.firstElementChild.value;null==(r=e.classList)||r.remove("web-component-template");var s=e.cloneNode();return null==(n=e.classList)||n.add("web-component-template"),s.innerHTML="",s.template=i,s}return this.self.cloneSlots?e.cloneNode(!0):e},n.grabGivenSlots=function(){var e=this;this.slots={};for(var t=0,r=Array.from(this.querySelectorAll("[slot]"));t<r.length;t++){for(var n=r[t],i=n.parentNode,s=!0;i;){if(i.nodeName.includes("-")){i===this&&(s=!1);break}i=i.parentNode}s||(this.slots[n.getAttribute&&n.getAttribute("slot")&&n.getAttribute("slot").trim()?n.getAttribute("slot").trim():n.nodeName.toLowerCase()]=this.grabSlotContent(n))}this.slots.default?this.slots.default=[this.slots.default]:this.childNodes.length>0?this.slots.default=Array.from(this.childNodes).map((function(t){return e.grabSlotContent(t)})):this.slots.default=[]},n.isStateProperty=function(e){var t,r,n,i;return Boolean((null==(t=this.instance)||null==(r=t.current)?void 0:r.state)&&(Object.prototype.hasOwnProperty.call(null==(n=this.instance)||null==(i=n.current)?void 0:i.state,e)||this.instance.current.state.modelState&&Object.prototype.hasOwnProperty.call(this.instance.current.state.modelState,e)))},n.generateAliasIndex=function(){if(!this.self._propertyAliasIndex){this.self._propertyAliasIndex=o()({},this.self.propertyAliases);for(var e=0,t=Object.entries(this.self._propertyAliasIndex);e<t.length;e++){var r=t[e],n=r[0],i=r[1];Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,i)||(this.self._propertyAliasIndex[i]=n)}}},n.reflectExternalProperties=function(e){this.ignoreAttributeUpdateObservations=!0;for(var t=0,r=Object.entries(e);t<r.length;t++){var n=r[t],i=n[0],s=n[1];if(this.setExternalPropertyValue(i,s),this.isConnected){var o=g().stringCamelCaseToDelimited(i);if(this.self._propertiesToReflectAsAttributes.has(i))switch(this.self._propertiesToReflectAsAttributes.get(i)){case A.boolean:case"boolean":s?""!==this.getAttribute(o)&&this.setAttribute(o,""):this.hasAttribute(o)&&this.removeAttribute(o);break;case A.func:case"function":break;case"json":if(s){var a=JSON.stringify(s);if(a&&this.getAttribute(o)!==a){this.setAttribute(o,a);break}}this.hasAttribute(o)&&this.removeAttribute(o);break;case A.number:case"number":if("number"!=typeof s||isNaN(s))this.hasAttribute(o)&&this.removeAttribute(o);else{var l=""+s;this.getAttribute(o)!==l&&this.setAttribute(o,l)}break;case A.string:case"string":s?this.getAttribute(o)!==s&&this.setAttribute(o,s):this.hasAttribute(o)&&this.removeAttribute(o);break;case A.any:case A.array:case A.arrayOf:case A.element:case A.elementType:case A.instanceOf:case A.node:case A.object:case"object":case A.objectOf:case A.shape:case A.exact:case A.symbol:default:if(s){var p=g().represent(s);if(p&&this.getAttribute(o)!==p){this.setAttribute(o,p);break}}this.hasAttribute(o)&&this.removeAttribute(o)}}}this.ignoreAttributeUpdateObservations=!1},n.reflectProperties=function(e){var t,r,n,i;if(this.reflectExternalProperties(e),null!=(t=this.instance)&&null!=(r=t.current)&&r.state&&"object"==typeof this.instance.current.state)for(var s,o=P(Object.keys(this.instance.current.state).concat(this.instance.current.state.modelState?Object.keys(this.instance.current.state.modelState):[]));!(s=o()).done;){var a=s.value;Object.prototype.hasOwnProperty.call(this.internalProperties,a)&&this.setInternalPropertyValue(a,void 0)}null!=(n=this.internalProperties.model)&&n.state&&(null==(i=this.internalProperties.model)||delete i.state,this.setInternalPropertyValue("model",this.internalProperties.model));for(var l,p=P(this.self.controllableProperties);!(l=p()).done;){var c=l.value;Object.prototype.hasOwnProperty.call(e,c)&&this.setInternalPropertyValue(c,e[c])}},n.triggerRender=function(e){var t=this;this.batchUpdates?this.batchedUpdateRunning||(this.batchedUpdateRunning=!0,g().timeout((function(){t.batchedUpdateRunning=!1,t.render(e)}))):this.render(e)},n.reflectEventToProperties=function(e,t){var r=this.batchUpdates;this.batchUpdates=!1;var n=null;if(this.self.eventToPropertyMapping&&Object.prototype.hasOwnProperty.call(this.self.eventToPropertyMapping,e)&&g().isFunction(this.self.eventToPropertyMapping[e])){var i,s=(i=this.self.eventToPropertyMapping)[e].apply(i,t.concat([this]));Array.isArray(s)?(n=s[0],this.reflectProperties(n),g().extend(!0,this.internalProperties,s[1])):null!==s&&"object"==typeof s&&(n=s,this.reflectProperties(s))}else if(t.length>0&&null!==t[0]&&"object"==typeof t[0]){var a,l=t[0];if("persist"in t[0]&&g().isFunction(t[0].persist)){l={};for(var p=0,c=Object.keys(this.self.propertyTypes);p<c.length;p++)for(var u,d=c[p],h=P([d].concat(null!==(f=this.getPropertyAlias(d))&&void 0!==f?f:[]));!(u=h()).done;){var f,b=u.value,_=t[0].currentTarget&&Object.prototype.hasOwnProperty.call(t[0].currentTarget,b)?t[0].currentTarget[b]:this.getPropertyValue(b);_!==this.externalProperties[b]&&(l[b]=_)}}else[null,void 0].includes(null==(a=l.detail)?void 0:a.value)||(l=o()({},l.detail));n=l,this.reflectProperties(l)}return this.triggerRender("propertyReflected"),this.batchUpdates=r,n},n.evaluateStringOrNullAndSetAsProperty=function(e,t){var r=this,n=e.startsWith("-"),i=n?e.substring(1):e,s=g().stringDelimitedToCamelCase(i),o=this.getPropertyAlias(s);if(o&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,o)&&(s=o),Object.prototype.hasOwnProperty.call(this.self.propertyTypes,s)){var a=this.self.propertyTypes[s];if(n){if(t){var l=g().stringEvaluate(t,{Tools:g()},!1,this);l.error?(console.warn('Faild to process pre-evaluation attribute "'+e+'": '+l.error+'. Will be set to "undefined".'),this.setInternalPropertyValue(s,void 0)):(this.setInternalPropertyValue(s,l.result),this.setExternalPropertyValue(s,l.result))}}else switch(a){case A.boolean:case"boolean":var p=![null,"false"].includes(t);this.setInternalPropertyValue(s,p),this.setExternalPropertyValue(s,p);break;case A.func:case"function":var c,u=null,d=["data","event","firstArgument","firstParameter","options","scope","parameters","Tools"];if(t){var h=g().stringCompile(t,d);u=h.error,c=h.templateFunction,u&&console.warn('Failed to compile given handler "'+e+'": '+u+".")}this.setInternalPropertyValue(s,(function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];r.outputEventNames.has(s)&&r.reflectEventToProperties(s,i);var a=void 0;if(!u)try{a=c.call(r,i[0],i[0],i[0],i[0],i[0],i[0],i,g())}catch(r){console.warn('Failed to evaluate function "'+e+'" with expression "'+t+'" and scope variables "'+d.join('", "')+'" set to "'+g().represent(i)+'": '+r+'. Set property to "undedefined".')}return r.self.renderProperties.includes(s)||r.forwardEvent(s,i),a})),u||this.setExternalPropertyValue(s,c);break;case"json":if(t){var f;try{f=JSON.parse(t)}catch(u){console.warn('Error occurred during parsing given json attribute "'+e+'": '+g().represent(u));break}this.setInternalPropertyValue(s,f),this.setExternalPropertyValue(s,g().copy(f,1))}else this.setInternalPropertyValue(s,null),this.setExternalPropertyValue(s,null);break;case A.number:case"number":if(null===t){this.setInternalPropertyValue(s,t),this.setExternalPropertyValue(s,t);break}var b=parseFloat(t);isNaN(b)&&(b=void 0),this.setInternalPropertyValue(s,b),this.setExternalPropertyValue(s,b);break;case A.string:case"string":this.setInternalPropertyValue(s,t),this.setExternalPropertyValue(s,t);break;case A.any:case A.array:case A.arrayOf:case A.element:case A.elementType:case A.instanceOf:case A.node:case A.object:case"object":case A.objectOf:case A.oneOf:case A.oneOfType:case A.shape:case A.exact:case A.symbol:default:if(t){var _=g().stringEvaluate(t,{},!1,this);if(_.error){console.warn('Error occurred during processing given attribute configuration "'+e+'": '+_.error);break}this.setInternalPropertyValue(s,_.result),this.setExternalPropertyValue(s,g().copy(_.result,1))}else this.hasAttribute(e)?(this.setInternalPropertyValue(s,!0),this.setExternalPropertyValue(s,!0)):(this.setInternalPropertyValue(s,null),this.setExternalPropertyValue(s,null))}}},n.determineRenderScope=function(e){var t,r;void 0===e&&(e={}),this.scope=o()({},(null==(t=this.parent)?void 0:t.scope)||{},this.scope,this.internalProperties,((r={parent:this.parent,root:this.rootInstance,self:this})[g().stringLowerCase(this.self._name)||"instance"]=this,r),e),this.scope.scope=this.scope},n.applyShadowRootIfNotExisting=function(){this.self.shadowDOM&&this.root===this&&(this.root=(!("attachShadow"in this)&&"ShadyDOM"in window?window.ShadyDOM.wrap(this):this).attachShadow(null!==this.self.shadowDOM&&"object"==typeof this.self.shadowDOM?this.self.shadowDOM:{mode:"open"}))},n.render=function(e){if(void 0===e&&(e="unknown"),this.determineRenderScope(),this.dispatchEvent(new CustomEvent("render",{detail:{reason:e,scope:this.scope}}))){var t=g().stringEvaluate("`"+this.self.content+"`",this.scope);if(t.error)console.warn("Faild to process template: "+t.error);else{this.applyShadowRootIfNotExisting();var r=document.createElement("div");r.innerHTML=t.result,this.applySlots(r,o()({},this.scope,{parent:this})),this.root.innerHTML=r.innerHTML,this.applyBindings(this.root.firstChild,this.scope,this.self.renderSlots)}}},t}(_()(HTMLElement)),n.applyRootBinding=!0,n.content="<slot>Please provide a template to transclude.</slot>",n.determineRootBinding=!0,n.shadowDOM=null,n.observedAttributes=[],n.controllableProperties=[],n.eventToPropertyMapping={},n.propertyAliases={},n.propertyTypes={},n.propertiesToReflectAsAttributes=[],n.renderProperties=["children"],n.cloneSlots=!1,n.evaluateSlots=!1,n.renderSlots=!0,n.trimSlots=!0,n.renderUnsafe=!1,n._name="BaseWeb",n._propertyAliasIndex=void 0,n._propertiesToReflectAsAttributes=void 0,t=i,r=y()(t.prototype,"isRoot",[e],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),t),O={component:E,register:function(e){return void 0===e&&(e=g().stringCamelCaseToDelimited(E._name)),customElements.define(e,E)}};d.default=E}(),d}())},,,e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__9__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__10__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__11__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__12__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__13__}],__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ReactWeb:()=>l,api:()=>p});var e=__webpack_require__(0),t=__webpack_require__.n(e),r=__webpack_require__(1),n=__webpack_require__(9),i=__webpack_require__.n(n),s=__webpack_require__(10),o=__webpack_require__(6),a=__webpack_require__.n(o);class l extends(a()){constructor(){super(...arguments),this.compiledSlots={},this.preparedSlots={},this.rootReactInstance=null,this.self=l,this.wrapMemorizingWrapper=null,this.isWrapped=!1,this.reflectInstanceProperties=()=>{var e;null!=(e=this.instance)&&e.current&&this.instance.current.properties&&this.reflectProperties(this.instance.current.properties)}}connectedCallback(){this.applyComponentWrapper(),this.rootReactInstance=this,super.connectedCallback()}disconnectedCallback(){(0,s.unmountComponentAtNode)(this.root),super.disconnectedCallback()}reflectExternalProperties(e){this.isRoot&&super.reflectExternalProperties(e)}render(e){var r;if(void 0===e&&(e="unknown"),this.rootReactInstance===this&&this.dispatchEvent(new CustomEvent("render",{detail:{reason:e,scope:this.scope}}))){if(this.determineRenderScope(),0===Object.keys(this.compiledSlots).length&&this.preCompileSlots(),this.evaluateSlots({...this.scope,parent:this}),this.prepareProperties(this.internalProperties),this.applyShadowRootIfNotExisting(),this.root!==this){let e=this.firstChild;for(;e;){const t=e.nextSibling;this.removeChild(e),e=t}}(0,s.render)((0,n.createElement)(this.self.content,this.internalProperties),this.root),null!=(r=this.instance)&&r.current?this.reflectInstanceProperties():t().timeout(this.reflectInstanceProperties)}}setPropertyValue(e,r){this.reflectProperties({[e]:t().copy(r,1)}),this.setInternalPropertyValue(e,t().copy(r,1))}setInternalPropertyValue(e,t){null===t?t=r.NullSymbol:void 0===t&&(t=r.UndefinedSymbol),super.setInternalPropertyValue(e,t)}preCompileDomNodes(e,t,r){if(void 0===t&&(t={}),void 0===r&&(r=!1),1===(e=e.filter((e=>e.nodeType!==Node.TEXT_NODE||"string"==typeof e.nodeValue&&""!==e.nodeValue.trim()))).length)return this.preCompileDomNode(e[0],t,r);let i=1;const s=[];for(const n of e){const e=this.preCompileDomNode(n,t,r,i.toString());e&&(s.push(e),i+=1)}return r?e=>function(){const t=[];for(const r of s){const n=r(e);"function"==typeof n&&t.push(n(...arguments))}return(0,n.createElement)(n.Fragment,{children:t})}:s}preCompileDomNode(e,r,i,s){if(void 0===r&&(r={}),void 0===i&&(i=!1),i){const t=this.preCompileDomNode(e,{...r,data:void 0,firstArgument:void 0,firstParameter:void 0,options:void 0,scope:void 0,parameters:void 0},!1,s);return e=>function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];const s=n.length>0?n[0]:null;return t({...e,data:s,firstArgument:s,firstParameter:s,options:s,scope:s,parameters:n})}}if(e.nodeType===Node.TEXT_NODE){const t="string"==typeof e.nodeValue?e.nodeValue.trim():"",r=s&&t?(0,n.createElement)(n.Fragment,{children:t,key:s}):t||null;return()=>r}if(!e.getAttributeNames)return()=>null;let o,a;const l=this.self.isReactComponent(e);l?(e.determineRenderScope(),0===Object.keys(this.compiledSlots).length&&e.preCompileSlots(),o=e.internalProperties,s&&!Object.prototype.hasOwnProperty.call(o,"key")&&(o.key=s),a=e.constructor.content):(o={key:s},a=e.tagName.toLowerCase());let p=Object.keys(r);const c={};for(const n of e.getAttributeNames()){var u;let i=e.getAttribute(n);if(null===i)continue;let s=!1,a="";if(n.startsWith("data-bind-")?a=n.substring("data-bind-".length):n.startsWith("bind-")&&(a=n.substring("bind-".length)),a.startsWith("attribute-")||"attributes"===a||a.startsWith("property-")||"properties"===a){const{error:r,originalScopeNames:o,templateFunction:l}=t().stringCompile(i,p);if(r){console.warn('Error occurred during compiling given attribute binding "'+n+'" on node:',e,r);continue}"attributes"===a||"properties"===a?s=!0:a=a.startsWith("attribute-")?a.substring("attribute-".length):a.substring("property-".length),i={originalScopeNames:o,templateFunction:l.bind(this)}}else if(a.startsWith("on-")){a=t().stringDelimitedToCamelCase(a),Object.prototype.hasOwnProperty.call(r,"event")||(p=[...p,"event"]),Object.prototype.hasOwnProperty.call(r,"parameters")||(p=[...p,"parameters"]);const{error:s,originalScopeNames:o,scopeNames:l,templateFunction:c}=t().stringCompile(i,p,!0);if(s){console.warn('Error occurred during compiling given event binding "'+n+'" on node:',e,s);continue}const u=c.bind(this);i=function(){for(var s=arguments.length,a=new Array(s),p=0;p<s;p++)a[p]=arguments[p];r.event=a[0],r.parameters=a;try{u(...o.map((e=>r[e])))}catch(r){console.warn('Error occurred during processing given event binding "'+n+'" on node: ',e,'Given expression "'+i+'" could not be evaluated with given scope names "'+l.join('", "')+'": '+t().represent(r))}}}else a=n;const l={class:"className",for:"htmlFor"};Object.prototype.hasOwnProperty.call(l,a)&&(a=l[a]),a=t().stringDelimitedToCamelCase(a),null!=(u=i)&&u.originalScopeNames?c[s?"":a]=i:o[a]=i}if(!l){const t=Array.from(e.childNodes);t.length&&(o.children=this.preCompileDomNodes(t,r))}return t=>{(t={...r,...t}).scope=t;let i={...o};for(const[e,{originalScopeNames:r,templateFunction:n}]of Object.entries(c)){const s=n(...r.map((e=>t[e])));""===e?i={...i,...s}:i[e]=s}return Object.prototype.hasOwnProperty.call(i,"innerHTML")&&(i.dangerouslySetInnerHTML={__html:i.innerHTML},delete i.children,delete i.innerHTML),Object.prototype.hasOwnProperty.call(i,"textContent")?(i.children=i.textContent,delete i.textContent):l?(e.evaluateSlots({...i,...t,parent:e}),e.prepareProperties(i),t={...i,...t,parent:e}):i.children&&(i.children=this.evaluatePreCompiledDomNodes(i.children,t)),(0,n.createElement)(a,i)}}evaluatePreCompiledDomNodes(e,t){if(void 0===t&&(t={}),!Array.isArray(e))return e(t);if(1===e.length)return e[0](t);const r=[];for(const n of e){const e=n(t);e&&r.push(e)}return r}preCompileSlots(){var e;for(const e in this.slots)Object.prototype.hasOwnProperty.call(this.slots,e)&&"default"!==e&&(this.compiledSlots[e]=this.preCompileDomNode(this.slots[e],{...this.scope,parent:this},[r.func,"function"].includes(this.self.propertyTypes&&this.self.propertyTypes[e])));this.slots.default&&this.slots.default.length>0&&(this.compiledSlots.children=this.preCompileDomNodes(this.slots.default,{...this.scope,parent:this},[r.func,"function"].includes(null==(e=this.self.propertyTypes)?void 0:e.children)))}evaluateSlots(e){this.preparedSlots={};for(const t in this.compiledSlots)Object.prototype.hasOwnProperty.call(this.compiledSlots,t)&&("children"===t?this.preparedSlots.children=this.evaluatePreCompiledDomNodes(this.compiledSlots[t],e):this.preparedSlots[t]=this.compiledSlots[t](e))}static isReactComponent(e){const t=e.constructor;return"object"==typeof t.content&&(!1===t.attachWebComponentAdapterIfNotExists||"react"===t.content.webComponentAdapterWrapped)}determineRootBinding(){super.determineRootBinding();let e=this.parentNode;for(;e;){if(this.self.isReactComponent(e)){this.rootReactInstance=e;break}e=e.parentNode}}applyComponentWrapper(){if("string"==typeof this.self.content||this.isWrapped)return;this.isWrapped=!0;const e=this.self.content.wrapped||this.self.content;this.self.content.webComponentAdapterWrapped?this.wrapMemorizingWrapper&&(this.self.content=(0,n.memo)(this.self.content),this.self.content.wrapped=e):this.self.attachWebComponentAdapterIfNotExists?(this.self.content.displayName||(this.self.content.displayName=this.self._name),this.self.content=(0,n.forwardRef)(((t,r)=>((0,n.useImperativeHandle)(r,(()=>({properties:t}))),(0,n.createElement)(e,t)))),(this.wrapMemorizingWrapper||null===this.wrapMemorizingWrapper)&&(this.self.content=(0,n.memo)(this.self.content)),this.self.content.wrapped=e,this.self.content.webComponentAdapterWrapped="react"):this.wrapMemorizingWrapper&&(this.self.content=(0,n.memo)(this.self.content),this.self.content.wrapped=e)}prepareProperties(e){t().extend(e,this.preparedSlots),this.self.removeKnownUnwantedPropertyKeys(this.self,e),e.ref||(this.instance=(0,n.createRef)(),e.ref=this.instance)}static removeKnownUnwantedPropertyKeys(e,t){if("string"!=typeof e.content)for(const r of["isRoot","isTrusted","__composed"])Object.prototype.hasOwnProperty.call(t,r)&&(Object.prototype.hasOwnProperty.call(e.content,"propTypes")&&!Object.prototype.hasOwnProperty.call(e.content.propTypes,r)||Object.prototype.hasOwnProperty.call(e.content,"wrapped")&&Object.prototype.hasOwnProperty.call(e.content.wrapped,"propTypes")&&!Object.prototype.hasOwnProperty.call(e.content.wrapped.propTypes,r))&&delete t[r]}}l.attachWebComponentAdapterIfNotExists=!0,l.content="div",l.react=i(),l._name="ReactWebComponent";const p={component:l,register:function(e){return void 0===e&&(e=t().stringCamelCaseToDelimited(l._name)),customElements.define(e,l)}};__webpack_exports__.default=l})(),__webpack_exports__})()}));
|
package/WebNext.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"),require("clientnode"),require("clientnode/property-types"),require("@babel/runtime/helpers/extends"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/initializerDefineProperty","@babel/runtime/helpers/applyDecoratedDescriptor","@babel/runtime/helpers/initializerWarningHelper","clientnode","clientnode/property-types","@babel/runtime/helpers/extends"],t);else{var r="object"==typeof exports?t(require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"),require("clientnode"),require("clientnode/property-types"),require("@babel/runtime/helpers/extends")):t(e["@babel/runtime/helpers/initializerDefineProperty"],e["@babel/runtime/helpers/applyDecoratedDescriptor"],e["@babel/runtime/helpers/initializerWarningHelper"],e.clientnode,e["clientnode/property-types"],e["@babel/runtime/helpers/extends"]);for(var s in r)("object"==typeof exports?exports:e)[s]=r[s]}}(this,(function(__WEBPACK_EXTERNAL_MODULE__3__,__WEBPACK_EXTERNAL_MODULE__4__,__WEBPACK_EXTERNAL_MODULE__5__,__WEBPACK_EXTERNAL_MODULE__0__,__WEBPACK_EXTERNAL_MODULE__1__,__WEBPACK_EXTERNAL_MODULE__2__){return(()=>{"use strict";var __webpack_modules__=[e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__0__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__1__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__2__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__3__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__4__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__5__},,function(module,__unused_webpack_exports,__webpack_require__){var __dirname="/",e,t,r;if(module=__webpack_require__.nmd(module),null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&null!=__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window=void 0===__webpack_require__.g||null===__webpack_require__.g?{}:__webpack_require__.g;module.exports=(e=__webpack_require__(2),t=__webpack_require__(0),r=__webpack_require__(1),function(){var s=[function(t){t.exports=e},function(e){e.exports=t},function(e){e.exports=r}],i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return s[e](r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){n.r(o),n.d(o,{property:function(){return a}});var e=n(0),t=n.n(e),r=n(1),s=n.n(r),i=n(2);function a(e){return void 0===e&&(e={}),e=t()({readAttribute:!0,type:i.string},e),function(r,i){if("string"==typeof i){var n,o,a=r.self||r.constructor;if(e.readAttribute){a.hasOwnProperty("observedAttributes")||(a.observedAttributes=a.observedAttributes?[].concat(a.observedAttributes):[]);var l=s().stringCamelCaseToDelimited(i);a.observedAttributes.includes(l)||a.observedAttributes.push(l)}e.type&&(a.hasOwnProperty("propertyTypes")||(a.propertyTypes=a.propertyTypes?t()({},a.propertyTypes):{}),!e.update&&a.propertyTypes.hasOwnProperty(i)||(a.propertyTypes[i]=e.type)),e.writeAttribute&&(a.hasOwnProperty("propertiesToReflectAsAttributes")||(a.propertiesToReflectAsAttributes=a.propertiesToReflectAsAttributes?s().copy(a.propertiesToReflectAsAttributes):new Map),e.update||a.propertiesToReflectAsAttributes instanceof Map&&!a.propertiesToReflectAsAttributes.has(i)||Array.isArray(a.propertiesToReflectAsAttributes)&&!a.propertiesToReflectAsAttributes.includes(i)||null!==a.propertiesToReflectAsAttributes&&"object"==typeof a.propertiesToReflectAsAttributes&&!a.propertiesToReflectAsAttributes.hasOwnProperty(i))&&("boolean"==typeof e.writeAttribute?!0===e.writeAttribute&&null!=(o=a.propertyTypes)&&o.hasOwnProperty(i)&&(n=a.propertyTypes[i]):n=e.writeAttribute,void 0!==n&&(Array.isArray(a.propertiesToReflectAsAttributes)&&(!0===e.writeAttribute?a.propertiesToReflectAsAttributes.push(i):a.propertiesToReflectAsAttributes=a.normalizePropertyTypeList(a.propertiesToReflectAsAttributes)),a.propertiesToReflectAsAttributes instanceof Map&&a.propertiesToReflectAsAttributes.set(i,n),null!==a.propertiesToReflectAsAttributes&&"object"==typeof a.propertiesToReflectAsAttributes&&(a.propertiesToReflectAsAttributes[i]=n))),e.alias&&(a.hasOwnProperty("propertyAliases")||(a.propertyAliases=a.propertyAliases?t()({},a.propertyAliases):{}),!e.update&&a.propertyAliases.hasOwnProperty(i)||(a.propertyAliases[i]=e.alias))}}}o.default=a}(),o}())}],__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Web:()=>d,api:()=>f});var e,t,r,s,i,n=__webpack_require__(3),o=__webpack_require__.n(n),a=__webpack_require__(4),l=__webpack_require__.n(a),p=(__webpack_require__(5),__webpack_require__(0)),c=__webpack_require__.n(p),u=__webpack_require__(1),h=__webpack_require__(7);let d=(e=__webpack_require__.n(h)()({type:u.boolean,writeAttribute:!0}),i=s=class e extends HTMLElement{constructor(){super(),this.batchAttributeUpdates=!0,this.batchPropertyUpdates=!0,this.batchUpdates=!0,this.batchedAttributeUpdateRunning=!0,this.batchedPropertyUpdateRunning=!0,this.batchedUpdateRunning=!0,this.parent=null,this.rootInstance=null,this.scope={Tools:c()},this.domNodeEventBindings=new Map,this.domNodeTemplateCache=new Map,this.externalProperties={},this.ignoreAttributeUpdateObservations=!1,this.internalProperties={},this.outputEventNames=new Set,this.instance=null,o()(this,"isRoot",r,this),this.root=void 0,this.runDomConnectionAndRenderingInSameEventQueue=!1,this.self=e,this.slots={},this.self=this.constructor,this.self._propertiesToReflectAsAttributes||(this.self._propertiesToReflectAsAttributes=this.self.normalizePropertyTypeList(this.self.propertiesToReflectAsAttributes)),this.generateAliasIndex(),this.root=this,this.defineGetterAndSetterInterface()}attributeChangedCallback(e,t,r){this.ignoreAttributeUpdateObservations||t===r||this.updateAttribute(e,r)}updateAttribute(e,t){this.evaluateStringOrNullAndSetAsProperty(e,t),this.batchAttributeUpdates?this.batchedAttributeUpdateRunning||this.batchedUpdateRunning||(this.batchedAttributeUpdateRunning=!0,this.batchedUpdateRunning=!0,c().timeout((()=>{this.batchedAttributeUpdateRunning=!1,this.batchedUpdateRunning=!1,this.render("attributeChanged")}))):this.render("attributeChanged")}connectedCallback(){try{this.isConnected=!0}catch(e){}this.parent=this,this.rootInstance=this,this.attachEventHandler(),this.self.determineRootBinding&&this.determineRootBinding(),this.self.applyRootBinding&&this.isRoot&&(this.determineRenderScope(),this.applyBinding(this,this.scope)),this.batchedAttributeUpdateRunning=!1,this.batchedPropertyUpdateRunning=!1,this.batchedUpdateRunning=!1,this.grabGivenSlots(),this.reflectExternalProperties(this.externalProperties),this.runDomConnectionAndRenderingInSameEventQueue?this.render("connected"):c().timeout((()=>this.render("connected")))}disconnectedCallback(){try{this.isConnected=!1}catch(e){}for(const[e,t]of this.domNodeEventBindings)for(const e of t.values())e();this.slots={}}defineGetterAndSetterInterface(){const e=c().arrayUnique(Object.keys(this.self.propertyTypes).concat(Object.keys(this.self._propertyAliasIndex)));for(const t of e)Object.prototype.hasOwnProperty.call(this,t)&&this.setPropertyValue(t,this[t]),Object.defineProperty(this,t,{configurable:!0,get:function(){return this.getPropertyValue(t)},set:function(e){this.setPropertyValue(t,e),this.triggerPropertySpecificRendering(t,e)}})}getPropertyAlias(e){return Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,e)?this.self._propertyAliasIndex[e]:null}getPropertyValue(t){var r,s,i,n;const o=null==(r=this.instance)||null==(s=r.current)||!s.properties||e.propertyTypes.hasOwnProperty(t)&&!this.instance.current.properties.hasOwnProperty(t)?this.externalProperties[t]:this.instance.current.properties[t];return null!=(i=this.instance)&&null!=(n=i.current)&&n.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,t)?this.instance.current.state[t]:o}setExternalPropertyValue(e,t){this.externalProperties[e]=t;const r=this.getPropertyAlias(e);r&&(this.externalProperties[r]=t)}setInternalPropertyValue(e,t){this.internalProperties[e]=t;const r=this.getPropertyAlias(e);r&&(this.internalProperties[r]=t)}setPropertyValue(e,t){this.reflectProperties({[e]:t}),this.setInternalPropertyValue(e,t)}triggerPropertySpecificRendering(e,t){if(this.batchPropertyUpdates)this.batchedPropertyUpdateRunning||this.batchedUpdateRunning||(this.batchedPropertyUpdateRunning=!0,this.batchedUpdateRunning=!0,c().timeout((()=>{void 0!==t&&this.isStateProperty(e)?(this.render("preStatePropertyChanged"),c().timeout((()=>{this.setInternalPropertyValue(e,void 0),this.batchedPropertyUpdateRunning=!1,this.batchedUpdateRunning=!1,this.render("postStatePropertyChanged"),this.triggerOuputEvents()}))):(this.batchedPropertyUpdateRunning=!1,this.batchedUpdateRunning=!1,this.render("propertyChanged"),this.triggerOuputEvents())})));else{const r=this.isStateProperty(e);this.render(r?"preStatePropertyChanged":"propertyChanged"),void 0!==t&&r&&(this.setInternalPropertyValue(e,void 0),this.render("postStatePropertyChanged")),this.triggerOuputEvents()}}applyBinding(e,t){if(e.getAttributeNames)for(const r of e.getAttributeNames()){let s="";if(r.startsWith("data-bind-")?s=r.substring("data-bind-".length):r.startsWith("bind-")&&(s=r.substring("bind-".length)),s){const i=e.getAttribute(r);if(null===i)continue;if(s.startsWith("attribute-")||s.startsWith("property-")){const n=c().stringEvaluate(i,t,!1,e);if(n.error){console.warn(`Error occurred during processing given attribute binding "${r}" on node:`,e,n.error);continue}s.startsWith("attribute-")?e.setAttribute(s.substring("attribute-".length),n.result):e[c().stringDelimitedToCamelCase(s.substring("property-".length))]=n.result}else if(s.startsWith("on-")){this.domNodeEventBindings.has(e)||this.domNodeEventBindings.set(e,new Map);const n=this.domNodeEventBindings.get(e);s=c().stringDelimitedToCamelCase(s.substring("on-".length)),n.has(s)&&n.get(s)(),t={event:void 0,parameters:void 0,...t};const o=c().stringCompile(i,t,!0);if(o.error)console.warn(`Error occurred during compiling given event binding "${r}" on node:`,e,o.error);else{const a=o.templateFunction.bind(e),l=(...s)=>{t.event=s[0],t.parameters=s;try{a(...o.originalScopeNames.map((e=>t[e])))}catch(t){console.warn(`Error occurred during processing given event binding "${r}" on node:`,e,`Given expression "${i}" could not be evaluated with given scope names "${o.scopeNames.join('", "')}": ${c().represent(t)}`)}};e.addEventListener(s,l),n.set(s,(()=>{e.removeEventListener(s,l),n.delete(s),0===n.size&&this.domNodeEventBindings.delete(e)}))}}}}}applyBindings(e,t,r=!0){for(;e;){var s;null==(s=e.attributes)||!s.length||!r&&e.getAttribute("slot")||this.applyBinding(e,t),e.nodeName.toLowerCase().includes("-")||this.applyBindings(e.firstChild,t),e=e.nextSibling}}compileDomNodeTemplate(e,t=[],r={}){var s;if((r={ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe,...r}).ignoreComponents&&null!=(s=e.nodeName)&&s.toLowerCase().includes("-"))return r.map;if(r.unsafe){let s=e.innerHTML;if(!s&&e.template&&(s=e.template),this.self.hasCode(s)){const i=c().stringCompile(`\`${s}\``,t);r.map.set(e,{children:[],error:i.error,scopeNames:i.scopeNames,template:s,templateFunction:i.templateFunction})}}else{const s=e.nodeName.toLowerCase();let i;if(["a","#text"].includes(s)){const t="a"===s?e.getAttribute("href"):e.textContent;this.self.hasCode(t)&&(i=t.replace(/ /g," ").trim())}const n=[];if(i){const s=c().stringCompile(`\`${i}\``,t);r.map.set(e,{children:n,error:s.error,scopeNames:s.scopeNames,template:i,templateFunction:s.templateFunction})}let o=e.firstChild;for(;o;)r.filter&&!r.filter(o)||n.push(this.compileDomNodeTemplate(o,t,{...r,ignoreComponents:r.ignoreNestedComponents})),o=o.nextSibling}return r.map}evaluateDomNodeTemplate(e,t={},r={}){var s;if((r={applyBindings:!0,ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe,...r}).map.has(e)||this.compileDomNodeTemplate(e,t,r),r.map.has(e)){const{error:s,scopeNames:i,templateFunction:n}=r.map.get(e);if(s)console.warn(`Error occurred during compiling node content: ${s}`);else{let s=null;try{s=n(...i.map((e=>t[e])))}catch(t){console.warn(`Error occurred when "${this.self._name}" is running "${n}": with bound names "${i.join('", "')}": "${t}". Rendering node:`,e)}null!==s&&(r.unsafe?e.innerHTML=s:"a"===e.nodeName.toLowerCase()?e.setAttribute("href",s):e.textContent=s)}}if(!(r.unsafe||r.ignoreComponents&&null!=(s=e.nodeName)&&s.toLowerCase().includes("-"))){let s=e.firstChild;for(;s;)r.filter&&!r.filter(s)||this.evaluateDomNodeTemplate(s,t,{...r,applyBindings:!1,ignoreComponents:r.ignoreNestedComponents}),s=s.nextSibling}return r.applyBindings&&this.applyBindings(e,t),r.map}static replaceDomNodes(t,r){for(const i of[].concat(r).reverse()){var s;e.trimSlots&&i.nodeType===Node.TEXT_NODE&&""===(null==(s=i.nodeValue)?void 0:s.trim())||t.after(i)}t.remove()}static unwrapDomNode(e){const t=e.parentNode,r=[];for(;e.firstChild;)r.push(e.firstChild),t.insertBefore(e.firstChild,e);return t.removeChild(e),r}determineRootBinding(){let t=this.parentNode;for(;t;){var r;(t instanceof e||null!=(r=t.nodeName)&&r.includes("-")||null===t.parentNode&&"[object ShadowRoot]"===t.toString())&&(this.rootInstance===this?(this.parent=t,this.rootInstance=t,this.setPropertyValue("isRoot",!1)):this.rootInstance=t),t=t.parentNode}}static hasCode(e){return"string"==typeof e&&e.includes("${")&&e.includes("}")&&/\${[\s\S]+}/.test(e)}static normalizePropertyTypeList(t){if("string"==typeof t&&(t=[t]),Array.isArray(t)){const r=t;t=new Map;for(const s of r)e.propertyTypes.hasOwnProperty(s)&&t.set(s,e.propertyTypes[s])}else t=c().convertPlainObjectToMap(t);return t}attachEventHandler(){if(null===this.self.eventToPropertyMapping)return;const e=this.attachExplicitDefinedOutputEventHandler();this.attachImplicitDefinedOutputEventHandler(!e)}attachExplicitDefinedOutputEventHandler(){let e=!1;for(const t of Object.keys(this.self.eventToPropertyMapping))Object.prototype.hasOwnProperty.call(this.internalProperties,t)||(e=!0,this.outputEventNames.add(t),this.setInternalPropertyValue(t,((...e)=>{const r=this.reflectEventToProperties(t,e);r&&(e[0]=r),this.forwardEvent(t,e)})));return e}attachImplicitDefinedOutputEventHandler(e=!0){for(const[t,r]of Object.entries(this.self.propertyTypes))Object.prototype.hasOwnProperty.call(this.internalProperties,t)||![u.func,"function"].includes(this.self.propertyTypes[t])||this.self.renderProperties.includes(t)||(this.outputEventNames.add(t),this.setInternalPropertyValue(t,((...r)=>{e&&this.reflectEventToProperties(t,r),this.forwardEvent(t,r)})))}triggerOuputEvents(){for(const e of this.outputEventNames)this.forwardEvent(e,[this.externalProperties])}forwardEvent(e,t){return e.length>"onX".length&&e.startsWith("on")&&(e=c().stringLowerCase(e.substring(2))),this.dispatchEvent(new CustomEvent(e,{detail:{parameters:t}}))}applySlots(e,t){for(const r of Array.from(e.querySelectorAll("slot"))){const e=r.getAttribute("name");if(null===e||"default"===e)if(this.slots.default){if(this.self.renderSlots){if(this.self.evaluateSlots)for(const e of this.slots.default)this.evaluateDomNodeTemplate(e,t);this.self.replaceDomNodes(r,this.slots.default)}}else this.slots.default=this.self.unwrapDomNode(r).map((e=>this.grabSlotContent(e)));else Object.prototype.hasOwnProperty.call(this.slots,e)?this.self.renderSlots&&(this.self.evaluateSlots&&this.evaluateDomNodeTemplate(this.slots[e],t),this.self.replaceDomNodes(r,this.slots[e])):this.slots[e]=this.grabSlotContent(this.self.unwrapDomNode(r).filter((e=>"#text"!==e.nodeName.toLowerCase()))[0])}}grabSlotContent(e){var t;if("textarea"===(null==(t=e.firstElementChild)?void 0:t.nodeName.toLowerCase())&&(!e.firstElementChild.hasAttribute("data-no-template")||"false"===e.firstElementChild.getAttribute("data-no-template"))){var r,s;const t=e.firstElementChild.value;null==(r=e.classList)||r.remove("web-component-template");const i=e.cloneNode();return null==(s=e.classList)||s.add("web-component-template"),i.innerHTML="",i.template=t,i}return this.self.cloneSlots?e.cloneNode(!0):e}grabGivenSlots(){this.slots={};for(let e of Array.from(this.querySelectorAll("[slot]"))){let t=e.parentNode,r=!0;for(;t;){if(t.nodeName.includes("-")){t===this&&(r=!1);break}t=t.parentNode}r||(this.slots[e.getAttribute&&e.getAttribute("slot")&&e.getAttribute("slot").trim()?e.getAttribute("slot").trim():e.nodeName.toLowerCase()]=this.grabSlotContent(e))}this.slots.default?this.slots.default=[this.slots.default]:this.childNodes.length>0?this.slots.default=Array.from(this.childNodes).map((e=>this.grabSlotContent(e))):this.slots.default=[]}isStateProperty(e){var t,r,s,i;return Boolean((null==(t=this.instance)||null==(r=t.current)?void 0:r.state)&&(Object.prototype.hasOwnProperty.call(null==(s=this.instance)||null==(i=s.current)?void 0:i.state,e)||this.instance.current.state.modelState&&Object.prototype.hasOwnProperty.call(this.instance.current.state.modelState,e)))}generateAliasIndex(){if(!this.self._propertyAliasIndex){this.self._propertyAliasIndex={...this.self.propertyAliases};for(const[e,t]of Object.entries(this.self._propertyAliasIndex))Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,t)||(this.self._propertyAliasIndex[t]=e)}}reflectExternalProperties(e){this.ignoreAttributeUpdateObservations=!0;for(const[t,r]of Object.entries(e)){if(this.setExternalPropertyValue(t,r),!this.isConnected)continue;const e=c().stringCamelCaseToDelimited(t);if(this.self._propertiesToReflectAsAttributes.has(t))switch(this.self._propertiesToReflectAsAttributes.get(t)){case u.boolean:case"boolean":r?""!==this.getAttribute(e)&&this.setAttribute(e,""):this.hasAttribute(e)&&this.removeAttribute(e);break;case u.func:case"function":break;case"json":if(r){const t=JSON.stringify(r);if(t&&this.getAttribute(e)!==t){this.setAttribute(e,t);break}}this.hasAttribute(e)&&this.removeAttribute(e);break;case u.number:case"number":if("number"!=typeof r||isNaN(r))this.hasAttribute(e)&&this.removeAttribute(e);else{const t=`${r}`;this.getAttribute(e)!==t&&this.setAttribute(e,t)}break;case u.string:case"string":r?this.getAttribute(e)!==r&&this.setAttribute(e,r):this.hasAttribute(e)&&this.removeAttribute(e);break;case u.any:case u.array:case u.arrayOf:case u.element:case u.elementType:case u.instanceOf:case u.node:case u.object:case"object":case u.objectOf:case u.shape:case u.exact:case u.symbol:default:if(r){const t=c().represent(r);if(t&&this.getAttribute(e)!==t){this.setAttribute(e,t);break}}this.hasAttribute(e)&&this.removeAttribute(e)}}this.ignoreAttributeUpdateObservations=!1}reflectProperties(e){var t,r,s,i;if(this.reflectExternalProperties(e),null!=(t=this.instance)&&null!=(r=t.current)&&r.state&&"object"==typeof this.instance.current.state)for(const e of Object.keys(this.instance.current.state).concat(this.instance.current.state.modelState?Object.keys(this.instance.current.state.modelState):[]))Object.prototype.hasOwnProperty.call(this.internalProperties,e)&&this.setInternalPropertyValue(e,void 0);null!=(s=this.internalProperties.model)&&s.state&&(null==(i=this.internalProperties.model)||delete i.state,this.setInternalPropertyValue("model",this.internalProperties.model));for(const t of this.self.controllableProperties)Object.prototype.hasOwnProperty.call(e,t)&&this.setInternalPropertyValue(t,e[t])}triggerRender(e){this.batchUpdates?this.batchedUpdateRunning||(this.batchedUpdateRunning=!0,c().timeout((()=>{this.batchedUpdateRunning=!1,this.render(e)}))):this.render(e)}reflectEventToProperties(e,t){const r=this.batchUpdates;this.batchUpdates=!1;let s=null;if(this.self.eventToPropertyMapping&&Object.prototype.hasOwnProperty.call(this.self.eventToPropertyMapping,e)&&c().isFunction(this.self.eventToPropertyMapping[e])){const r=this.self.eventToPropertyMapping[e](...t,this);Array.isArray(r)?(s=r[0],this.reflectProperties(s),c().extend(!0,this.internalProperties,r[1])):null!==r&&"object"==typeof r&&(s=r,this.reflectProperties(r))}else if(t.length>0&&null!==t[0]&&"object"==typeof t[0]){var i;let e=t[0];if("persist"in t[0]&&c().isFunction(t[0].persist)){e={};for(const r of Object.keys(this.self.propertyTypes))for(const s of[r].concat(null!==(n=this.getPropertyAlias(r))&&void 0!==n?n:[])){var n;const r=t[0].currentTarget&&Object.prototype.hasOwnProperty.call(t[0].currentTarget,s)?t[0].currentTarget[s]:this.getPropertyValue(s);r!==this.externalProperties[s]&&(e[s]=r)}}else[null,void 0].includes(null==(i=e.detail)?void 0:i.value)||(e={...e.detail});s=e,this.reflectProperties(e)}return this.triggerRender("propertyReflected"),this.batchUpdates=r,s}evaluateStringOrNullAndSetAsProperty(e,t){const r=e.startsWith("-"),s=r?e.substring(1):e;let i=c().stringDelimitedToCamelCase(s);const n=this.getPropertyAlias(i);if(n&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,n)&&(i=n),Object.prototype.hasOwnProperty.call(this.self.propertyTypes,i)){const s=this.self.propertyTypes[i];if(r){if(t){const r=c().stringEvaluate(t,{Tools:c()},!1,this);r.error?(console.warn(`Faild to process pre-evaluation attribute "${e}": ${r.error}. Will be set to "undefined".`),this.setInternalPropertyValue(i,void 0)):(this.setInternalPropertyValue(i,r.result),this.setExternalPropertyValue(i,r.result))}}else switch(s){case u.boolean:case"boolean":const r=![null,"false"].includes(t);this.setInternalPropertyValue(i,r),this.setExternalPropertyValue(i,r);break;case u.func:case"function":let s,n=null;const o=["data","event","firstArgument","firstParameter","options","scope","parameters","Tools"];if(t){const r=c().stringCompile(t,o);n=r.error,s=r.templateFunction,n&&console.warn(`Failed to compile given handler "${e}": ${n}.`)}this.setInternalPropertyValue(i,((...r)=>{let a;if(this.outputEventNames.has(i)&&this.reflectEventToProperties(i,r),!n)try{a=s.call(this,r[0],r[0],r[0],r[0],r[0],r[0],r,c())}catch(s){console.warn(`Failed to evaluate function "${e}" with expression "${t}" and scope variables "${o.join('", "')}" set to "${c().represent(r)}": ${s}. Set property to "undedefined".`)}return this.self.renderProperties.includes(i)||this.forwardEvent(i,r),a})),n||this.setExternalPropertyValue(i,s);break;case"json":if(t){let r;try{r=JSON.parse(t)}catch(t){console.warn(`Error occurred during parsing given json attribute "${e}": `+c().represent(t));break}this.setInternalPropertyValue(i,r),this.setExternalPropertyValue(i,c().copy(r,1))}else this.setInternalPropertyValue(i,null),this.setExternalPropertyValue(i,null);break;case u.number:case"number":if(null===t){this.setInternalPropertyValue(i,t),this.setExternalPropertyValue(i,t);break}let a=parseFloat(t);isNaN(a)&&(a=void 0),this.setInternalPropertyValue(i,a),this.setExternalPropertyValue(i,a);break;case u.string:case"string":this.setInternalPropertyValue(i,t),this.setExternalPropertyValue(i,t);break;case u.any:case u.array:case u.arrayOf:case u.element:case u.elementType:case u.instanceOf:case u.node:case u.object:case"object":case u.objectOf:case u.oneOf:case u.oneOfType:case u.shape:case u.exact:case u.symbol:default:if(t){const r=c().stringEvaluate(t,{},!1,this);if(r.error){console.warn(`Error occurred during processing given attribute configuration "${e}": ${r.error}`);break}this.setInternalPropertyValue(i,r.result),this.setExternalPropertyValue(i,c().copy(r.result,1))}else this.hasAttribute(e)?(this.setInternalPropertyValue(i,!0),this.setExternalPropertyValue(i,!0)):(this.setInternalPropertyValue(i,null),this.setExternalPropertyValue(i,null))}}}determineRenderScope(e={}){var t;this.scope={...(null==(t=this.parent)?void 0:t.scope)||{},...this.scope,...this.internalProperties,parent:this.parent,root:this.rootInstance,self:this,[c().stringLowerCase(this.self._name)||"instance"]:this,...e},this.scope.scope=this.scope}applyShadowRootIfNotExisting(){this.self.shadowDOM&&this.root===this&&(this.root=(!("attachShadow"in this)&&"ShadyDOM"in window?window.ShadyDOM.wrap(this):this).attachShadow(null!==this.self.shadowDOM&&"object"==typeof this.self.shadowDOM?this.self.shadowDOM:{mode:"open"}))}render(e="unknown"){if(this.determineRenderScope(),!this.dispatchEvent(new CustomEvent("render",{detail:{reason:e,scope:this.scope}})))return;const t=c().stringEvaluate(`\`${this.self.content}\``,this.scope);if(t.error)return void console.warn(`Faild to process template: ${t.error}`);this.applyShadowRootIfNotExisting();const r=document.createElement("div");r.innerHTML=t.result,this.applySlots(r,{...this.scope,parent:this}),this.root.innerHTML=r.innerHTML,this.applyBindings(this.root.firstChild,this.scope,this.self.renderSlots)}},s.applyRootBinding=!0,s.content="<slot>Please provide a template to transclude.</slot>",s.determineRootBinding=!0,s.shadowDOM=null,s.observedAttributes=[],s.controllableProperties=[],s.eventToPropertyMapping={},s.propertyAliases={},s.propertyTypes={},s.propertiesToReflectAsAttributes=[],s.renderProperties=["children"],s.cloneSlots=!1,s.evaluateSlots=!1,s.renderSlots=!0,s.trimSlots=!0,s.renderUnsafe=!1,s._name="BaseWeb",s._propertyAliasIndex=void 0,s._propertiesToReflectAsAttributes=void 0,t=i,r=l()(t.prototype,"isRoot",[e],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),t);const f={component:d,register:(e=c().stringCamelCaseToDelimited(d._name))=>customElements.define(e,d)};__webpack_exports__.default=d})(),__webpack_exports__})()}));
|
1
|
+
'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"),require("clientnode"),require("clientnode/property-types"),require("@babel/runtime/helpers/extends"));else if("function"==typeof define&&define.amd)define(["@babel/runtime/helpers/initializerDefineProperty","@babel/runtime/helpers/applyDecoratedDescriptor","@babel/runtime/helpers/initializerWarningHelper","clientnode","clientnode/property-types","@babel/runtime/helpers/extends"],t);else{var r="object"==typeof exports?t(require("@babel/runtime/helpers/initializerDefineProperty"),require("@babel/runtime/helpers/applyDecoratedDescriptor"),require("@babel/runtime/helpers/initializerWarningHelper"),require("clientnode"),require("clientnode/property-types"),require("@babel/runtime/helpers/extends")):t(e["@babel/runtime/helpers/initializerDefineProperty"],e["@babel/runtime/helpers/applyDecoratedDescriptor"],e["@babel/runtime/helpers/initializerWarningHelper"],e.clientnode,e["clientnode/property-types"],e["@babel/runtime/helpers/extends"]);for(var s in r)("object"==typeof exports?exports:e)[s]=r[s]}}(this,(function(__WEBPACK_EXTERNAL_MODULE__3__,__WEBPACK_EXTERNAL_MODULE__4__,__WEBPACK_EXTERNAL_MODULE__5__,__WEBPACK_EXTERNAL_MODULE__0__,__WEBPACK_EXTERNAL_MODULE__1__,__WEBPACK_EXTERNAL_MODULE__2__){return(()=>{"use strict";var __webpack_modules__=[e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__0__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__1__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__2__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__3__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__4__},e=>{e.exports=__WEBPACK_EXTERNAL_MODULE__5__},,function(module,__unused_webpack_exports,__webpack_require__){var __dirname="/",e,t,r;if(module=__webpack_require__.nmd(module),null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&null!=__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window=void 0===__webpack_require__.g||null===__webpack_require__.g?{}:__webpack_require__.g;module.exports=(e=__webpack_require__(2),t=__webpack_require__(0),r=__webpack_require__(1),function(){var s=[function(t){t.exports=e},function(e){e.exports=t},function(e){e.exports=r}],i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return s[e](r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){n.r(o),n.d(o,{property:function(){return a}});var e=n(0),t=n.n(e),r=n(1),s=n.n(r),i=n(2);function a(e){return void 0===e&&(e={}),e=t()({readAttribute:!0,type:i.string},e),function(r,i){if("string"==typeof i){var n,o,a=r.self||r.constructor;if(e.readAttribute){a.hasOwnProperty("observedAttributes")||(a.observedAttributes=a.observedAttributes?[].concat(a.observedAttributes):[]);var l=s().stringCamelCaseToDelimited(i);a.observedAttributes.includes(l)||a.observedAttributes.push(l)}e.type&&(a.hasOwnProperty("propertyTypes")||(a.propertyTypes=a.propertyTypes?t()({},a.propertyTypes):{}),!e.update&&a.propertyTypes.hasOwnProperty(i)||(a.propertyTypes[i]=e.type)),e.writeAttribute&&(a.hasOwnProperty("propertiesToReflectAsAttributes")||(a.propertiesToReflectAsAttributes=a.propertiesToReflectAsAttributes?s().copy(a.propertiesToReflectAsAttributes):new Map),e.update||a.propertiesToReflectAsAttributes instanceof Map&&!a.propertiesToReflectAsAttributes.has(i)||Array.isArray(a.propertiesToReflectAsAttributes)&&!a.propertiesToReflectAsAttributes.includes(i)||null!==a.propertiesToReflectAsAttributes&&"object"==typeof a.propertiesToReflectAsAttributes&&!a.propertiesToReflectAsAttributes.hasOwnProperty(i))&&("boolean"==typeof e.writeAttribute?!0===e.writeAttribute&&null!=(o=a.propertyTypes)&&o.hasOwnProperty(i)&&(n=a.propertyTypes[i]):n=e.writeAttribute,void 0!==n&&(Array.isArray(a.propertiesToReflectAsAttributes)&&(!0===e.writeAttribute?a.propertiesToReflectAsAttributes.push(i):a.propertiesToReflectAsAttributes=a.normalizePropertyTypeList(a.propertiesToReflectAsAttributes)),a.propertiesToReflectAsAttributes instanceof Map&&a.propertiesToReflectAsAttributes.set(i,n),null!==a.propertiesToReflectAsAttributes&&"object"==typeof a.propertiesToReflectAsAttributes&&(a.propertiesToReflectAsAttributes[i]=n))),e.alias&&(a.hasOwnProperty("propertyAliases")||(a.propertyAliases=a.propertyAliases?t()({},a.propertyAliases):{}),!e.update&&a.propertyAliases.hasOwnProperty(i)||(a.propertyAliases[i]=e.alias))}}}o.default=a}(),o}())}],__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Web:()=>d,api:()=>f});var e,t,r,s,i,n=__webpack_require__(3),o=__webpack_require__.n(n),a=__webpack_require__(4),l=__webpack_require__.n(a),p=(__webpack_require__(5),__webpack_require__(0)),c=__webpack_require__.n(p),u=__webpack_require__(1),h=__webpack_require__(7);let d=(e=__webpack_require__.n(h)()({type:u.boolean,writeAttribute:!0}),i=s=class e extends HTMLElement{constructor(){super(),this.batchAttributeUpdates=!0,this.batchPropertyUpdates=!0,this.batchUpdates=!0,this.batchedAttributeUpdateRunning=!0,this.batchedPropertyUpdateRunning=!0,this.batchedUpdateRunning=!0,this.parent=null,this.rootInstance=null,this.scope={Tools:c()},this.domNodeEventBindings=new Map,this.domNodeTemplateCache=new Map,this.externalProperties={},this.ignoreAttributeUpdateObservations=!1,this.internalProperties={},this.outputEventNames=new Set,this.instance=null,o()(this,"isRoot",r,this),this.root=void 0,this.runDomConnectionAndRenderingInSameEventQueue=!1,this.self=e,this.slots={},this.self=this.constructor,this.self._propertiesToReflectAsAttributes||(this.self._propertiesToReflectAsAttributes=this.self.normalizePropertyTypeList(this.self.propertiesToReflectAsAttributes)),this.generateAliasIndex(),this.root=this,this.defineGetterAndSetterInterface()}attributeChangedCallback(e,t,r){this.ignoreAttributeUpdateObservations||t===r||this.updateAttribute(e,r)}updateAttribute(e,t){this.evaluateStringOrNullAndSetAsProperty(e,t),this.batchAttributeUpdates?this.batchedAttributeUpdateRunning||this.batchedUpdateRunning||(this.batchedAttributeUpdateRunning=!0,this.batchedUpdateRunning=!0,c().timeout((()=>{this.batchedAttributeUpdateRunning=!1,this.batchedUpdateRunning=!1,this.render("attributeChanged")}))):this.render("attributeChanged")}connectedCallback(){try{this.isConnected=!0}catch(e){}this.parent=this,this.rootInstance=this,this.attachEventHandler(),this.self.determineRootBinding&&this.determineRootBinding(),this.self.applyRootBinding&&this.isRoot&&(this.determineRenderScope(),this.applyBinding(this,this.scope)),this.batchedAttributeUpdateRunning=!1,this.batchedPropertyUpdateRunning=!1,this.batchedUpdateRunning=!1,this.grabGivenSlots(),this.reflectExternalProperties(this.externalProperties),this.runDomConnectionAndRenderingInSameEventQueue?this.render("connected"):c().timeout((()=>this.render("connected")))}disconnectedCallback(){try{this.isConnected=!1}catch(e){}for(const[e,t]of this.domNodeEventBindings)for(const e of t.values())e();this.slots={}}defineGetterAndSetterInterface(){const e=c().arrayUnique(Object.keys(this.self.propertyTypes).concat(Object.keys(this.self._propertyAliasIndex)));for(const t of e)Object.prototype.hasOwnProperty.call(this,t)&&this.setPropertyValue(t,this[t]),Object.defineProperty(this,t,{configurable:!0,get:function(){return this.getPropertyValue(t)},set:function(e){this.setPropertyValue(t,e),this.triggerPropertySpecificRendering(t,e)}})}getPropertyAlias(e){return Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,e)?this.self._propertyAliasIndex[e]:null}getPropertyValue(t){var r,s,i,n;const o=null==(r=this.instance)||null==(s=r.current)||!s.properties||e.propertyTypes.hasOwnProperty(t)&&!this.instance.current.properties.hasOwnProperty(t)?this.externalProperties[t]:this.instance.current.properties[t];return null!=(i=this.instance)&&null!=(n=i.current)&&n.state&&Object.prototype.hasOwnProperty.call(this.instance.current.state,t)?this.instance.current.state[t]:o}setExternalPropertyValue(e,t){this.externalProperties[e]=t;const r=this.getPropertyAlias(e);r&&(this.externalProperties[r]=t)}setInternalPropertyValue(e,t){this.internalProperties[e]=t;const r=this.getPropertyAlias(e);r&&(this.internalProperties[r]=t)}setPropertyValue(e,t){this.reflectProperties({[e]:t}),this.setInternalPropertyValue(e,t)}triggerPropertySpecificRendering(e,t){if(this.batchPropertyUpdates)this.batchedPropertyUpdateRunning||this.batchedUpdateRunning||(this.batchedPropertyUpdateRunning=!0,this.batchedUpdateRunning=!0,c().timeout((()=>{void 0!==t&&this.isStateProperty(e)?(this.render("preStatePropertyChanged"),c().timeout((()=>{this.setInternalPropertyValue(e,void 0),this.batchedPropertyUpdateRunning=!1,this.batchedUpdateRunning=!1,this.render("postStatePropertyChanged"),this.triggerOuputEvents()}))):(this.batchedPropertyUpdateRunning=!1,this.batchedUpdateRunning=!1,this.render("propertyChanged"),this.triggerOuputEvents())})));else{const r=this.isStateProperty(e);this.render(r?"preStatePropertyChanged":"propertyChanged"),void 0!==t&&r&&(this.setInternalPropertyValue(e,void 0),this.render("postStatePropertyChanged")),this.triggerOuputEvents()}}applyBinding(e,t){if(e.getAttributeNames)for(const r of e.getAttributeNames()){let s="";if(r.startsWith("data-bind-")?s=r.substring("data-bind-".length):r.startsWith("bind-")&&(s=r.substring("bind-".length)),s){const i=e.getAttribute(r);if(null===i)continue;if(s.startsWith("attribute-")||s.startsWith("property-")){const n=c().stringEvaluate(i,t,!1,e);if(n.error){console.warn('Error occurred during processing given attribute binding "'+r+'" on node:',e,n.error);continue}s.startsWith("attribute-")?e.setAttribute(s.substring("attribute-".length),n.result):e[c().stringDelimitedToCamelCase(s.substring("property-".length))]=n.result}else if(s.startsWith("on-")){this.domNodeEventBindings.has(e)||this.domNodeEventBindings.set(e,new Map);const n=this.domNodeEventBindings.get(e);s=c().stringDelimitedToCamelCase(s.substring("on-".length)),n.has(s)&&n.get(s)(),t={event:void 0,parameters:void 0,...t};const o=c().stringCompile(i,t,!0);if(o.error)console.warn('Error occurred during compiling given event binding "'+r+'" on node:',e,o.error);else{const a=o.templateFunction.bind(e),l=function(){for(var s=arguments.length,n=new Array(s),l=0;l<s;l++)n[l]=arguments[l];t.event=n[0],t.parameters=n;try{a(...o.originalScopeNames.map((e=>t[e])))}catch(t){console.warn('Error occurred during processing given event binding "'+r+'" on node:',e,'Given expression "'+i+'" could not be evaluated with given scope names "'+o.scopeNames.join('", "')+'": '+c().represent(t))}};e.addEventListener(s,l),n.set(s,(()=>{e.removeEventListener(s,l),n.delete(s),0===n.size&&this.domNodeEventBindings.delete(e)}))}}}}}applyBindings(e,t,r){for(void 0===r&&(r=!0);e;){var s;null==(s=e.attributes)||!s.length||!r&&e.getAttribute("slot")||this.applyBinding(e,t),e.nodeName.toLowerCase().includes("-")||this.applyBindings(e.firstChild,t),e=e.nextSibling}}compileDomNodeTemplate(e,t,r){var s;if(void 0===t&&(t=[]),void 0===r&&(r={}),(r={ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe,...r}).ignoreComponents&&null!=(s=e.nodeName)&&s.toLowerCase().includes("-"))return r.map;if(r.unsafe){let s=e.innerHTML;if(!s&&e.template&&(s=e.template),this.self.hasCode(s)){const i=c().stringCompile("`"+s+"`",t);r.map.set(e,{children:[],error:i.error,scopeNames:i.scopeNames,template:s,templateFunction:i.templateFunction})}}else{const s=e.nodeName.toLowerCase();let i;if(["a","#text"].includes(s)){const t="a"===s?e.getAttribute("href"):e.textContent;this.self.hasCode(t)&&(i=t.replace(/ /g," ").trim())}const n=[];if(i){const s=c().stringCompile("`"+i+"`",t);r.map.set(e,{children:n,error:s.error,scopeNames:s.scopeNames,template:i,templateFunction:s.templateFunction})}let o=e.firstChild;for(;o;)r.filter&&!r.filter(o)||n.push(this.compileDomNodeTemplate(o,t,{...r,ignoreComponents:r.ignoreNestedComponents})),o=o.nextSibling}return r.map}evaluateDomNodeTemplate(e,t,r){var s;if(void 0===t&&(t={}),void 0===r&&(r={}),(r={applyBindings:!0,ignoreComponents:!0,ignoreNestedComponents:!0,map:this.domNodeTemplateCache,unsafe:this.self.renderUnsafe,...r}).map.has(e)||this.compileDomNodeTemplate(e,t,r),r.map.has(e)){const{error:s,scopeNames:i,templateFunction:n}=r.map.get(e);if(s)console.warn("Error occurred during compiling node content: "+s);else{let s=null;try{s=n(...i.map((e=>t[e])))}catch(t){console.warn('Error occurred when "'+this.self._name+'" is running "'+n+'": with bound names "'+i.join('", "')+'": "'+t+'". Rendering node:',e)}null!==s&&(r.unsafe?e.innerHTML=s:"a"===e.nodeName.toLowerCase()?e.setAttribute("href",s):e.textContent=s)}}if(!(r.unsafe||r.ignoreComponents&&null!=(s=e.nodeName)&&s.toLowerCase().includes("-"))){let s=e.firstChild;for(;s;)r.filter&&!r.filter(s)||this.evaluateDomNodeTemplate(s,t,{...r,applyBindings:!1,ignoreComponents:r.ignoreNestedComponents}),s=s.nextSibling}return r.applyBindings&&this.applyBindings(e,t),r.map}static replaceDomNodes(t,r){for(const i of[].concat(r).reverse()){var s;e.trimSlots&&i.nodeType===Node.TEXT_NODE&&""===(null==(s=i.nodeValue)?void 0:s.trim())||t.after(i)}t.remove()}static unwrapDomNode(e){const t=e.parentNode,r=[];for(;e.firstChild;)r.push(e.firstChild),t.insertBefore(e.firstChild,e);return t.removeChild(e),r}determineRootBinding(){let t=this.parentNode;for(;t;){var r;(t instanceof e||null!=(r=t.nodeName)&&r.includes("-")||null===t.parentNode&&"[object ShadowRoot]"===t.toString())&&(this.rootInstance===this?(this.parent=t,this.rootInstance=t,this.setPropertyValue("isRoot",!1)):this.rootInstance=t),t=t.parentNode}}static hasCode(e){return"string"==typeof e&&e.includes("${")&&e.includes("}")&&/\${[\s\S]+}/.test(e)}static normalizePropertyTypeList(t){if("string"==typeof t&&(t=[t]),Array.isArray(t)){const r=t;t=new Map;for(const s of r)e.propertyTypes.hasOwnProperty(s)&&t.set(s,e.propertyTypes[s])}else t=c().convertPlainObjectToMap(t);return t}attachEventHandler(){if(null===this.self.eventToPropertyMapping)return;const e=this.attachExplicitDefinedOutputEventHandler();this.attachImplicitDefinedOutputEventHandler(!e)}attachExplicitDefinedOutputEventHandler(){var e=this;let t=!1;for(const r of Object.keys(this.self.eventToPropertyMapping))Object.prototype.hasOwnProperty.call(this.internalProperties,r)||(t=!0,this.outputEventNames.add(r),this.setInternalPropertyValue(r,(function(){for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];const n=e.reflectEventToProperties(r,s);n&&(s[0]=n),e.forwardEvent(r,s)})));return t}attachImplicitDefinedOutputEventHandler(e){var t=this;void 0===e&&(e=!0);for(const[r,s]of Object.entries(this.self.propertyTypes))Object.prototype.hasOwnProperty.call(this.internalProperties,r)||![u.func,"function"].includes(this.self.propertyTypes[r])||this.self.renderProperties.includes(r)||(this.outputEventNames.add(r),this.setInternalPropertyValue(r,(function(){for(var s=arguments.length,i=new Array(s),n=0;n<s;n++)i[n]=arguments[n];e&&t.reflectEventToProperties(r,i),t.forwardEvent(r,i)})))}triggerOuputEvents(){for(const e of this.outputEventNames)this.forwardEvent(e,[this.externalProperties])}forwardEvent(e,t){return e.length>"onX".length&&e.startsWith("on")&&(e=c().stringLowerCase(e.substring(2))),this.dispatchEvent(new CustomEvent(e,{detail:{parameters:t}}))}applySlots(e,t){for(const r of Array.from(e.querySelectorAll("slot"))){const e=r.getAttribute("name");if(null===e||"default"===e)if(this.slots.default){if(this.self.renderSlots){if(this.self.evaluateSlots)for(const e of this.slots.default)this.evaluateDomNodeTemplate(e,t);this.self.replaceDomNodes(r,this.slots.default)}}else this.slots.default=this.self.unwrapDomNode(r).map((e=>this.grabSlotContent(e)));else Object.prototype.hasOwnProperty.call(this.slots,e)?this.self.renderSlots&&(this.self.evaluateSlots&&this.evaluateDomNodeTemplate(this.slots[e],t),this.self.replaceDomNodes(r,this.slots[e])):this.slots[e]=this.grabSlotContent(this.self.unwrapDomNode(r).filter((e=>"#text"!==e.nodeName.toLowerCase()))[0])}}grabSlotContent(e){var t;if("textarea"===(null==(t=e.firstElementChild)?void 0:t.nodeName.toLowerCase())&&(!e.firstElementChild.hasAttribute("data-no-template")||"false"===e.firstElementChild.getAttribute("data-no-template"))){var r,s;const t=e.firstElementChild.value;null==(r=e.classList)||r.remove("web-component-template");const i=e.cloneNode();return null==(s=e.classList)||s.add("web-component-template"),i.innerHTML="",i.template=t,i}return this.self.cloneSlots?e.cloneNode(!0):e}grabGivenSlots(){this.slots={};for(let e of Array.from(this.querySelectorAll("[slot]"))){let t=e.parentNode,r=!0;for(;t;){if(t.nodeName.includes("-")){t===this&&(r=!1);break}t=t.parentNode}r||(this.slots[e.getAttribute&&e.getAttribute("slot")&&e.getAttribute("slot").trim()?e.getAttribute("slot").trim():e.nodeName.toLowerCase()]=this.grabSlotContent(e))}this.slots.default?this.slots.default=[this.slots.default]:this.childNodes.length>0?this.slots.default=Array.from(this.childNodes).map((e=>this.grabSlotContent(e))):this.slots.default=[]}isStateProperty(e){var t,r,s,i;return Boolean((null==(t=this.instance)||null==(r=t.current)?void 0:r.state)&&(Object.prototype.hasOwnProperty.call(null==(s=this.instance)||null==(i=s.current)?void 0:i.state,e)||this.instance.current.state.modelState&&Object.prototype.hasOwnProperty.call(this.instance.current.state.modelState,e)))}generateAliasIndex(){if(!this.self._propertyAliasIndex){this.self._propertyAliasIndex={...this.self.propertyAliases};for(const[e,t]of Object.entries(this.self._propertyAliasIndex))Object.prototype.hasOwnProperty.call(this.self._propertyAliasIndex,t)||(this.self._propertyAliasIndex[t]=e)}}reflectExternalProperties(e){this.ignoreAttributeUpdateObservations=!0;for(const[t,r]of Object.entries(e)){if(this.setExternalPropertyValue(t,r),!this.isConnected)continue;const e=c().stringCamelCaseToDelimited(t);if(this.self._propertiesToReflectAsAttributes.has(t))switch(this.self._propertiesToReflectAsAttributes.get(t)){case u.boolean:case"boolean":r?""!==this.getAttribute(e)&&this.setAttribute(e,""):this.hasAttribute(e)&&this.removeAttribute(e);break;case u.func:case"function":break;case"json":if(r){const t=JSON.stringify(r);if(t&&this.getAttribute(e)!==t){this.setAttribute(e,t);break}}this.hasAttribute(e)&&this.removeAttribute(e);break;case u.number:case"number":if("number"!=typeof r||isNaN(r))this.hasAttribute(e)&&this.removeAttribute(e);else{const t=""+r;this.getAttribute(e)!==t&&this.setAttribute(e,t)}break;case u.string:case"string":r?this.getAttribute(e)!==r&&this.setAttribute(e,r):this.hasAttribute(e)&&this.removeAttribute(e);break;case u.any:case u.array:case u.arrayOf:case u.element:case u.elementType:case u.instanceOf:case u.node:case u.object:case"object":case u.objectOf:case u.shape:case u.exact:case u.symbol:default:if(r){const t=c().represent(r);if(t&&this.getAttribute(e)!==t){this.setAttribute(e,t);break}}this.hasAttribute(e)&&this.removeAttribute(e)}}this.ignoreAttributeUpdateObservations=!1}reflectProperties(e){var t,r,s,i;if(this.reflectExternalProperties(e),null!=(t=this.instance)&&null!=(r=t.current)&&r.state&&"object"==typeof this.instance.current.state)for(const e of Object.keys(this.instance.current.state).concat(this.instance.current.state.modelState?Object.keys(this.instance.current.state.modelState):[]))Object.prototype.hasOwnProperty.call(this.internalProperties,e)&&this.setInternalPropertyValue(e,void 0);null!=(s=this.internalProperties.model)&&s.state&&(null==(i=this.internalProperties.model)||delete i.state,this.setInternalPropertyValue("model",this.internalProperties.model));for(const t of this.self.controllableProperties)Object.prototype.hasOwnProperty.call(e,t)&&this.setInternalPropertyValue(t,e[t])}triggerRender(e){this.batchUpdates?this.batchedUpdateRunning||(this.batchedUpdateRunning=!0,c().timeout((()=>{this.batchedUpdateRunning=!1,this.render(e)}))):this.render(e)}reflectEventToProperties(e,t){const r=this.batchUpdates;this.batchUpdates=!1;let s=null;if(this.self.eventToPropertyMapping&&Object.prototype.hasOwnProperty.call(this.self.eventToPropertyMapping,e)&&c().isFunction(this.self.eventToPropertyMapping[e])){const r=this.self.eventToPropertyMapping[e](...t,this);Array.isArray(r)?(s=r[0],this.reflectProperties(s),c().extend(!0,this.internalProperties,r[1])):null!==r&&"object"==typeof r&&(s=r,this.reflectProperties(r))}else if(t.length>0&&null!==t[0]&&"object"==typeof t[0]){var i;let e=t[0];if("persist"in t[0]&&c().isFunction(t[0].persist)){e={};for(const r of Object.keys(this.self.propertyTypes))for(const s of[r].concat(null!==(n=this.getPropertyAlias(r))&&void 0!==n?n:[])){var n;const r=t[0].currentTarget&&Object.prototype.hasOwnProperty.call(t[0].currentTarget,s)?t[0].currentTarget[s]:this.getPropertyValue(s);r!==this.externalProperties[s]&&(e[s]=r)}}else[null,void 0].includes(null==(i=e.detail)?void 0:i.value)||(e={...e.detail});s=e,this.reflectProperties(e)}return this.triggerRender("propertyReflected"),this.batchUpdates=r,s}evaluateStringOrNullAndSetAsProperty(e,t){var r=this;const s=e.startsWith("-"),i=s?e.substring(1):e;let n=c().stringDelimitedToCamelCase(i);const o=this.getPropertyAlias(n);if(o&&Object.prototype.hasOwnProperty.call(this.self.propertyTypes,o)&&(n=o),Object.prototype.hasOwnProperty.call(this.self.propertyTypes,n)){const i=this.self.propertyTypes[n];if(s){if(t){const r=c().stringEvaluate(t,{Tools:c()},!1,this);r.error?(console.warn('Faild to process pre-evaluation attribute "'+e+'": '+r.error+'. Will be set to "undefined".'),this.setInternalPropertyValue(n,void 0)):(this.setInternalPropertyValue(n,r.result),this.setExternalPropertyValue(n,r.result))}}else switch(i){case u.boolean:case"boolean":const s=![null,"false"].includes(t);this.setInternalPropertyValue(n,s),this.setExternalPropertyValue(n,s);break;case u.func:case"function":let i,o=null;const a=["data","event","firstArgument","firstParameter","options","scope","parameters","Tools"];if(t){const r=c().stringCompile(t,a);o=r.error,i=r.templateFunction,o&&console.warn('Failed to compile given handler "'+e+'": '+o+".")}this.setInternalPropertyValue(n,(function(){for(var s=arguments.length,l=new Array(s),p=0;p<s;p++)l[p]=arguments[p];let u;if(r.outputEventNames.has(n)&&r.reflectEventToProperties(n,l),!o)try{u=i.call(r,l[0],l[0],l[0],l[0],l[0],l[0],l,c())}catch(r){console.warn('Failed to evaluate function "'+e+'" with expression "'+t+'" and scope variables "'+a.join('", "')+'" set to "'+c().represent(l)+'": '+r+'. Set property to "undedefined".')}return r.self.renderProperties.includes(n)||r.forwardEvent(n,l),u})),o||this.setExternalPropertyValue(n,i);break;case"json":if(t){let r;try{r=JSON.parse(t)}catch(t){console.warn('Error occurred during parsing given json attribute "'+e+'": '+c().represent(t));break}this.setInternalPropertyValue(n,r),this.setExternalPropertyValue(n,c().copy(r,1))}else this.setInternalPropertyValue(n,null),this.setExternalPropertyValue(n,null);break;case u.number:case"number":if(null===t){this.setInternalPropertyValue(n,t),this.setExternalPropertyValue(n,t);break}let l=parseFloat(t);isNaN(l)&&(l=void 0),this.setInternalPropertyValue(n,l),this.setExternalPropertyValue(n,l);break;case u.string:case"string":this.setInternalPropertyValue(n,t),this.setExternalPropertyValue(n,t);break;case u.any:case u.array:case u.arrayOf:case u.element:case u.elementType:case u.instanceOf:case u.node:case u.object:case"object":case u.objectOf:case u.oneOf:case u.oneOfType:case u.shape:case u.exact:case u.symbol:default:if(t){const r=c().stringEvaluate(t,{},!1,this);if(r.error){console.warn('Error occurred during processing given attribute configuration "'+e+'": '+r.error);break}this.setInternalPropertyValue(n,r.result),this.setExternalPropertyValue(n,c().copy(r.result,1))}else this.hasAttribute(e)?(this.setInternalPropertyValue(n,!0),this.setExternalPropertyValue(n,!0)):(this.setInternalPropertyValue(n,null),this.setExternalPropertyValue(n,null))}}}determineRenderScope(e){var t;void 0===e&&(e={}),this.scope={...(null==(t=this.parent)?void 0:t.scope)||{},...this.scope,...this.internalProperties,parent:this.parent,root:this.rootInstance,self:this,[c().stringLowerCase(this.self._name)||"instance"]:this,...e},this.scope.scope=this.scope}applyShadowRootIfNotExisting(){this.self.shadowDOM&&this.root===this&&(this.root=(!("attachShadow"in this)&&"ShadyDOM"in window?window.ShadyDOM.wrap(this):this).attachShadow(null!==this.self.shadowDOM&&"object"==typeof this.self.shadowDOM?this.self.shadowDOM:{mode:"open"}))}render(e){if(void 0===e&&(e="unknown"),this.determineRenderScope(),!this.dispatchEvent(new CustomEvent("render",{detail:{reason:e,scope:this.scope}})))return;const t=c().stringEvaluate("`"+this.self.content+"`",this.scope);if(t.error)return void console.warn("Faild to process template: "+t.error);this.applyShadowRootIfNotExisting();const r=document.createElement("div");r.innerHTML=t.result,this.applySlots(r,{...this.scope,parent:this}),this.root.innerHTML=r.innerHTML,this.applyBindings(this.root.firstChild,this.scope,this.self.renderSlots)}},s.applyRootBinding=!0,s.content="<slot>Please provide a template to transclude.</slot>",s.determineRootBinding=!0,s.shadowDOM=null,s.observedAttributes=[],s.controllableProperties=[],s.eventToPropertyMapping={},s.propertyAliases={},s.propertyTypes={},s.propertiesToReflectAsAttributes=[],s.renderProperties=["children"],s.cloneSlots=!1,s.evaluateSlots=!1,s.renderSlots=!0,s.trimSlots=!0,s.renderUnsafe=!1,s._name="BaseWeb",s._propertyAliasIndex=void 0,s._propertiesToReflectAsAttributes=void 0,t=i,r=l()(t.prototype,"isRoot",[e],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!0}}),t);const f={component:d,register:function(e){return void 0===e&&(e=c().stringCamelCaseToDelimited(d._name)),customElements.define(e,d)}};__webpack_exports__.default=d})(),__webpack_exports__})()}));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "web-component-wrapper",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.327",
|
4
4
|
"description": "Generic web-component base class and framework specific wrapper.",
|
5
5
|
"keywords": [
|
6
6
|
"component",
|
@@ -73,6 +73,7 @@
|
|
73
73
|
"@types/node": "*",
|
74
74
|
"@types/react": "*",
|
75
75
|
"@types/react-dom": "*",
|
76
|
+
"@types/webpack-env": "*",
|
76
77
|
"@types/workbox-webpack-plugin": "*",
|
77
78
|
"@typescript-eslint/eslint-plugin": "*",
|
78
79
|
"@typescript-eslint/parser": "*",
|
package/readme.md
CHANGED
@@ -7,7 +7,7 @@ License
|
|
7
7
|
-------
|
8
8
|
|
9
9
|
This library written by Torben Sickert stand under a creative commons naming
|
10
|
-
3.0 unported license.
|
10
|
+
3.0 unported license. See https://creativecommons.org/licenses/by/3.0/deed.de
|
11
11
|
endregion -->
|
12
12
|
|
13
13
|
Project status
|
@@ -24,9 +24,11 @@ Project status
|
|
24
24
|
|
25
25
|
[![code coverage](https://coveralls.io/repos/github/thaibault/web-component-wrapper/badge.svg)](https://coveralls.io/github/thaibault/web-component-wrapper)
|
26
26
|
|
27
|
+
<!-- Too unstable yet
|
27
28
|
[![dependencies](https://img.shields.io/david/thaibault/web-component-wrapper.svg)](https://david-dm.org/thaibault/web-component-wrapper)
|
28
29
|
[![development dependencies](https://img.shields.io/david/dev/thaibault/web-component-wrapper.svg)](https://david-dm.org/thaibault/web-component-wrapper?type=dev)
|
29
30
|
[![peer dependencies](https://img.shields.io/david/peer/thaibault/web-component-wrapper.svg)](https://david-dm.org/thaibault/web-component-wrapper?type=peer)
|
31
|
+
-->
|
30
32
|
[![documentation website](https://img.shields.io/website-up-down-green-red/https/torben.website/web-component-wrapper.svg?label=documentation-website)](https://torben.website/web-component-wrapper)
|
31
33
|
|
32
34
|
Use case
|