jodit-pro
Version:
PRO Version of Jodit Editor
8 lines • 84.1 kB
JavaScript
/*!
* jodit-pro - PRO Version of Jodit Editor
* Author: Chupurnov Valerii <chupurnov@gmail.com>
* Version: v4.9.27
* Url: https://xdsoft.net/jodit/pro/
* License(s): SEE LICENSE IN LICENSE.md
*/
!function(t,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var n=o();for(var i in n)("object"==typeof exports?exports:t)[i]=n[i]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[946],{482:function(t,o,n){"use strict";n.r(o),n.d(o,{googleMaps:function(){return B}});var i=n(77688),a=n(80294),r=n(20616),s=n(67709),l=n(82749),c=n(18766),u=n(56075),p=n(94899),h=n(23078),d=n(31635),g=n(62361);n(55029),n(99413);var f=n(17298),m=n(61818),v=n(67912),y=n(92931),b=n(65805),C=n(4774),k=n(82758),w=n(65478),E=n(21537),_=n(50911),A=n(62843),S=n(78584),x=n(92762),F=n(2692);window.JoditGoogleReadyHandler=v.GoogleReadyHandler;var B=function(t){function o(){var t;return(0,r._)(this,o),t=(0,a._)(this,o,arguments),(0,l._)(t,"buttons",[{group:"media",name:"googleMaps"}]),(0,l._)(t,"dialog",null),t}return(0,c._)(o,t),(0,s._)(o,[{key:"className",value:function(){return"google-maps"}},{key:"afterInit",value:function(t){var o=this;t.registerCommand(f.COMMAND_OPEN_DIALOG,function(){o.openMapEditor(null,{})})}},{key:"beforeDestruct",value:function(t){}},{key:"onOpenOnDblClick",value:function(t){if(t.dataset.googleMaps){var o;try{o=JSON.parse(this.j.ow.atob(t.dataset.googleMaps))}catch(t){}return this.openMapEditor(t,o),!1}}},{key:"openMapEditor",value:function(t,o){return(0,i._)(function(){var n,i,a,r,s,l,c,h,d,m;return(0,g._)(this,function(g){return n=this,a=this.j,r=this.getDialog(),s=this.j.o.googleMaps.saveStateInStorage?r.storage.get(f.STORAGE_KEY):void 0,l=this.jodit.o.googleMaps.apiUrl,(0,v.isApiAvailable)()||(0,E.appendScriptAsync)(this.jodit,l.replace(/\${([^}]+)}/g,function(t,o){var i;return null!=(i=n.get(o))?i:""})),c=(0,u._)({type:this.j.o.googleMaps.map.type,layer:this.j.o.googleMaps.map.layer,size:this.j.o.googleMaps.map.size},s,o),(h=new C.UIMap(r,c,this.j.options)).container.classList.add(r.getFullElName("map")),(d=new b.UIComboBox(a,{icon:"search",placeholder:"Search",clearButton:!0}).setMod("in-header",!0)).container.classList.add(r.getFullElName("search")),this.j.async.promise(function(t){if((0,v.isApiAvailable)())return void t(0);var o=function(){(0,v.isApiAvailable)()?t(0):n.j.async.setTimeout(o,100)};o(),(0,v.googleReady)(t)}).then(function(){h.setStatus("ready"),d.setStatus("ready")}),this.j.e.on(d,"select",function(t,o){o?h.map.fitBounds(o):t&&(h.state.center=[t.lat(),t.lng()])}),s||("auto"===this.j.o.googleMaps.map.center?navigator.geolocation.getCurrentPosition(function(t){h.state.center=[t.coords.latitude,t.coords.longitude]},function(){h.state.center=n.j.o.googleMaps.map.defaultCenter}):h.state.center=this.j.o.googleMaps.map.center),(i=r).setSize.apply(i,(0,p._)(a.o.googleMaps.dialog.size)).setHeader([d," ",(0,A.Button)(a,"eye").onAction(function(){var t=n.jodit.createInside.element("img");t.src=(0,y.staticUrl)(h),t.dataset.googleMaps=btoa(h.json());var o={value:t.outerHTML};n.onAfterGetValueFromEditor(o),a.execCommand("preview",null,o.value)})]).setContent((0,x.TabsWidget)(a,[{name:"Map",icon:"map",content:h},{name:"Settings",content:new C.UIMapsPropsForm(a,h.state)},{name:"Controls",icon:"menu",content:new C.UIMapsControlsForm(a,h.state)}])).setFooter([(0,A.Button)(a,"cancel","Cancel","default").onAction(function(){return r.close()}),(0,A.Button)(a,"ok",t?"Save":"Insert","primary").onAction(function(){h.destruct(),d.destruct(),r.e.off("beforeClose",m),r.close(),n.insertMap(t,h)})]).open(),m=function(){if(h.state.elements.length&&JSON.stringify(h.state.elements)!==JSON.stringify(c.elements)&&!k.IS_TEST&&!confirm(n.i18n("Are you sure?")))return!1;h.destruct(),d.destruct(),r.e.off("beforeClose",m)},r.e.on("beforeClose",m),[2]})}).call(this)}},{key:"getDialog",value:function(){if(!this.dialog){var t=new S.Dialog({language:this.j.o.language});t.container.classList.add(this.getFullElName("")),this.dialog=t}return this.dialog}},{key:"insertMap",value:function(t,o){var n=null!=t?t:this.jodit.createInside.element("img");n.src=(0,y.staticUrl)(o),n.dataset.googleMaps=btoa(o.json()),t||this.jodit.s.insertImage(n)}},{key:"onBeforeSetNativeEditorValue",value:function(t){t.value=t.value.replace(RegExp("<script[^>]+jodit-google-maps-init[^>]+>.*?<\\/script>","gs"),"")}},{key:"onAfterGetValueFromEditor",value:function(t,o){var n=this;this.j.o.googleMaps.useStaticImage||o===k.SOURCE_CONSUMER||(t.value=t.value.replace(RegExp("(<img[^>]+)([\"']?)data-google-maps\\2\\s*=([\"'])([^\"']+)\\3([^>]*>)","gs"),function(t,o,i,a,r,s){var l={};try{l=JSON.parse(n.j.ow.atob(r))}catch(t){}return"".concat(o,' id="').concat(l.uid,'" ').concat(i,"data-google-maps").concat(i,"=").concat(a).concat(r).concat(a).concat(s).concat((0,m.generateJSScript)(n.j,l))}))}}]),o}((0,h._)(_.Plugin));(0,l._)(B,"requires",["license","color-picker"]),(0,d.__decorate)([(0,w.watch)("?:openOnDblClick")],B.prototype,"onOpenOnDblClick",null),(0,d.__decorate)([(0,w.watch)(":beforeSetNativeEditorValue")],B.prototype,"onBeforeSetNativeEditorValue",null),(0,d.__decorate)([(0,w.watch)(":afterGetValueFromEditor")],B.prototype,"onAfterGetValueFromEditor",null),F.JoditPro.plugins.add("google-maps",B)},1475:function(t,o,n){"use strict";n.d(o,{initOrUpdateElementFromState:function(){return u}});var i=n(53454),a=n(11079),r=n(72690),s=n(580),l=n(12153),c=n(67912);function u(t,o){var n,u,p=this,h=this.mapElements[o];if(h){if(h.state.type===t.type)return r.updateStateAndGme.call(this,t,o);h.gme.setMap(null)}switch(t.type){case"text":n=new google.maps.Marker({position:new google.maps.LatLng(t.coordinates[0],t.coordinates[1]),draggable:!0,title:t.text,map:this.map});break;case"marker":n=new google.maps.Marker({position:new google.maps.LatLng(t.coordinates[0],t.coordinates[1]),draggable:!0,label:t.showCaption?t.title:"",title:t.title,icon:t.icon?l.Icon.get(t.icon):void 0,map:this.map});break;case"polyline":case"polygon":var d=(0,c.arrayToPath)(t.coordinates);n=new google.maps["polygon"===t.type?"Polygon":"Polyline"]({path:d,strokeColor:t.strokeColor,fillColor:t.fillColor,strokeWeight:t.strokeWeight,editable:!0,draggable:!0,map:this.map,fillOpacity:"polygon"===t.type?t.fillOpacity:1});break;case"circle":n=new google.maps.Circle({center:new google.maps.LatLng(t.coordinates[0],t.coordinates[1]),radius:t.radius,strokeColor:t.strokeColor,fillColor:t.fillColor,strokeWeight:t.strokeWeight,editable:!0,draggable:!0,map:this.map,fillOpacity:null!=(u=t.fillOpacity)?u:1})}var g={type:t.type,uid:(0,s.uniqueUid)(),state:t,gme:n};"dragend radius_changed center_changed".split(" ").forEach(function(t){return n.addListener(t,function(){return i.onChangeGeometries.call(p,g,o)})}),("polygon"===g.type||"polyline"===g.type)&&"insert_at set_at remove_at".split(" ").forEach(function(t){return g.gme.getPath().addListener(t,function(){return i.onChangeGeometries.call(p,g,o)})}),n.addListener("click",function(){return a.openPropsDialog.call(p,g,o)}),this.mapElements[o]=g}},2868:function(t,o,n){"use strict";function i(t,o){return null!=o&&"u">typeof Symbol&&o[Symbol.hasInstance]||null!=o&&"u">typeof Symbol&&o[Symbol.hasInstance]?!!o[Symbol.hasInstance](t):t instanceof o}n.d(o,{_:function(){return i}})},4169:function(t,o,n){"use strict";n.d(o,{UIMap:function(){return S}});var i=n(77688),a=n(80294),r=n(20616),s=n(67709),l=n(82749),c=n(18766),u=n(56075),p=n(11886),h=n(31635),d=n(62361);n(55029);var g=n(22125),f=n(1475),m=n(81577),v=n(97357),y=n(13525),b=n(37133),C=n(580),k=n(38837),w=n(41180),E=n(67510),_=n(11676),A=n(17298),S=function(t){function o(t,n,i){(0,r._)(this,o),s=(0,a._)(this,o,[t]),(0,l._)(s,"options",void 0),(0,l._)(s,"drawingManager",void 0),(0,l._)(s,"toolbar",void 0),(0,l._)(s,"state",void 0),(0,l._)(s,"mapElements",void 0),(0,l._)(s,"apiLoaded",void 0),(0,l._)(s,"mapInitialized",void 0),(0,l._)(s,"map",void 0),(0,l._)(s,"layers",void 0),s.options=i,s.toolbar=new _.ToolbarCollection(s.jodit),s.state={uid:"jd"+(0,C.uniqueUid)()+new Date().toString().replace(/[^0-9]/g,""),layer:s.options.googleMaps.map.layer,center:s.options.googleMaps.map.defaultCenter,zoom:s.options.googleMaps.map.defaultZoom,size:s.options.googleMaps.map.size,type:s.options.googleMaps.map.type,controls:{zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,rotateControl:!0,fullscreenControl:!0},mode:"hand",elements:[]},s.mapElements=[],s.apiLoaded=null,s.mapInitialized=!1,s.layers=[],Object.assign(s.state,n),s.toolbar.build(["gm.hand","gm.marker","gm.polyline","gm.polygon","gm.circle"]);var s,c=s.getElm("map-palette");return(0,k.assert)(null!=c,"palette element does not exists"),c.appendChild(s.toolbar.container),s}return(0,c._)(o,t),(0,s._)(o,[{key:"className",value:function(){return"UIMap"}},{key:"json",value:function(){return JSON.stringify((0,p._)((0,u._)({},this.state),{mode:"hand"}))}},{key:"onReady",value:function(){return(0,i._)(function(){var t,o;return(0,d._)(this,function(n){switch(n.label){case 0:return t=this,[4,this.apiLoaded];case 1:return n.sent(),o=this.getElm("map-root"),(0,k.assert)(null!=o,"map-root element does not exists"),this.map=new google.maps.Map(o,{center:{lat:this.state.center[0],lng:this.state.center[1]},zoom:this.state.zoom,mapTypeId:this.state.type}),this.map.addListener("zoom_changed",function(){var o;t.state.zoom=null!=(o=t.map.getZoom())?o:10}),this.map.addListener("center_changed",function(){var o,n,i,a,r,s;t.state.center=[null!=(o=null==(a=t.map)||null==(i=a.getCenter())?void 0:i.lat())?o:55,null!=(n=null==(s=t.map)||null==(r=s.getCenter())?void 0:r.lng())?n:34]}),this.map.addListener("maptypeid_changed",function(){var o=t.map.getMapTypeId();o&&(t.state.type=o)}),this.initDrawManager(),this.onChangeElementsList(),this.onChangeSize(),this.onChangeControls(),this.onChangeLayer(),this.onChangeMapType(),this.onChangeMode(),this.mapInitialized=!0,this.j.async.requestIdleCallback(function(){t.j.e.fire(t,"GoogleMapsIsReady")}),[2]}})}).call(this)}},{key:"initDrawManager",value:function(){var t=this;try{var o=new google.maps.drawing.DrawingManager;o.setMap(this.map),o.setOptions({drawingControl:!1,polygonOptions:(0,p._)((0,u._)({},this.options.googleMaps.map.defaultStates.polygon),{clickable:!0,editable:!0}),polylineOptions:(0,p._)((0,u._)({},this.options.googleMaps.map.defaultStates.polyline),{clickable:!0,editable:!0}),markerOptions:(0,p._)((0,u._)({},this.options.googleMaps.map.defaultStates.marker),{clickable:!0}),circleOptions:(0,p._)((0,u._)({},this.options.googleMaps.map.defaultStates.circle),{clickable:!0,editable:!0})}),this.drawingManager=o,google.maps.event.addListener(o,"overlaycomplete",function(o){o.overlay&&(g.addNewInState.call(t,o.overlay),o.overlay.setMap(null))})}catch(t){}}},{key:"changeCreateMode",value:function(t){this.state.mode=this.state.mode===t?"hand":t}},{key:"onChangeMode",value:function(){var t;this.j.buffer.set("createMode.gm",this.state.mode),null==(t=this.drawingManager)||t.setDrawingMode("hand"===this.state.mode?null:this.state.mode),this.j.e.fire("updateToolbar")}},{key:"onChangeElementsList",value:function(){var t=this,o=this.state.elements,n=this.mapElements;o.length<n.length&&n.slice(o.length).forEach(function(t){t.gme.setMap(null)}),n.length=o.length,o.forEach(function(o,n){return f.initOrUpdateElementFromState.call(t,o,n)})}},{key:"onChangeCenter",value:function(){var t=this.map.getCenter();((null==t?void 0:t.lat())!==this.state.center[0]||(null==t?void 0:t.lng())!==this.state.center[1])&&this.map.setCenter({lat:this.state.center[0],lng:this.state.center[1]})}},{key:"onChangeZoom",value:function(){var t;null==(t=this.map)||t.setZoom(this.state.zoom)}},{key:"onChangeControls",value:function(){var t,o;for(t in this.state.controls)null==(o=this.map)||o.set(t,this.state.controls[t])}},{key:"onChangeBound",value:function(){this.options.googleMaps.saveStateInStorage&&this.j.storage.set(A.STORAGE_KEY,{center:this.state.center,size:this.state.size,zoom:this.state.zoom,type:this.state.type,layer:this.state.layer,controls:this.state.controls})}},{key:"onChangeSize",value:function(){var t=this.getElm("map-size");(0,k.assert)(null!=t,"map-size element does not exists"),(0,w.css)(t,{width:this.state.size[0],height:this.state.size[1]})}},{key:"onChangeMapType",value:function(){this.map.setMapTypeId(this.state.type)}},{key:"onChangeLayer",value:function(){var t=this;switch(this.layers.forEach(function(t){return t.setMap(null)}),this.layers.length=0,this.state.layer){case"traffic":this.layers.push(new google.maps.TrafficLayer);break;case"transit":this.layers.push(new google.maps.TransitLayer);break;case"bicycling":this.layers.push(new google.maps.BicyclingLayer)}this.layers.forEach(function(o){return o.setMap(t.map)})}},{key:"render",value:function(){return"<div>\n <div class='&__map-root'></div>\n <div class='&__map-size'></div>\n <div class='&__map-palette'></div>\n </div>"}},{key:"appendChildToContainer",value:function(){}}]),o}(E.UIGroup);(0,h.__decorate)([(0,v.hook)("ready")],S.prototype,"onReady",null),(0,h.__decorate)([(0,b.watch)("?:changeCreateMode.gm")],S.prototype,"changeCreateMode",null),(0,h.__decorate)([(0,b.watch)("state.mode")],S.prototype,"onChangeMode",null),(0,h.__decorate)([(0,b.watch)("state.elements")],S.prototype,"onChangeElementsList",null),(0,h.__decorate)([(0,b.watch)("state.center"),(0,y.wait)(function(t){return t.mapInitialized}),(0,m.debounce)()],S.prototype,"onChangeCenter",null),(0,h.__decorate)([(0,b.watch)("state.zoom"),(0,m.debounce)()],S.prototype,"onChangeZoom",null),(0,h.__decorate)([(0,b.watch)("state.controls")],S.prototype,"onChangeControls",null),(0,h.__decorate)([(0,b.watch)(["state.center","state.zoom","state.controls","state.size","state.type","state.layer"]),(0,y.wait)(function(t){return t.mapInitialized}),(0,m.debounce)()],S.prototype,"onChangeBound",null),(0,h.__decorate)([(0,b.watch)("state.size"),(0,m.debounce)()],S.prototype,"onChangeSize",null),(0,h.__decorate)([(0,b.watch)("state.type")],S.prototype,"onChangeMapType",null),(0,h.__decorate)([(0,b.watch)("state.layer")],S.prototype,"onChangeLayer",null)},4774:function(t,o,n){"use strict";n.d(o,{UIMap:function(){return i.UIMap},UIMapsControlsForm:function(){return a.UIMapsControlsForm},UIMapsPropsForm:function(){return r.UIMapsPropsForm}}),n(90835);var i=n(4169),a=n(8073),r=n(83039);n(11093)},8073:function(t,o,n){"use strict";n.d(o,{UIMapsControlsForm:function(){return g}});var i=n(80294),a=n(20616),r=n(67709),s=n(82749),l=n(18766),c=n(56075),u=n(11886),p=n(31635),h=n(87325),d=n(67510),g=function(t){function o(t,n){(0,a._)(this,o),r=(0,i._)(this,o,[t]),(0,s._)(r,"state",void 0),r.state=n;var r,l={zoomControl:"Zoom control",mapTypeControl:"Map Type control",scaleControl:"Scale control",streetViewControl:"Street View control ",rotateControl:"Rotate control",fullscreenControl:"Fullscreen control"},c=Object.keys(l);return r.append(c.map(function(o){return new d.UICheckbox(t,{label:l[o],name:o,checked:r.state.controls[o],switch:!0,type:"checkbox",onChange:r.onChangeSize.bind(r,o)})})),r}return(0,l._)(o,t),(0,r._)(o,[{key:"className",value:function(){return"UIMapsControlsForm"}},{key:"onChangeSize",value:function(t,o){this.state.controls=(0,u._)((0,c._)({},this.state.controls),(0,s._)({},t,"true"===o))}}]),o}(d.UIForm);g=(0,p.__decorate)([h.component],g)},11079:function(t,o,n){"use strict";n.d(o,{openPropsDialog:function(){return p}});var i=n(82749),a=n(56075),r=n(11886),s=n(47660),l=n(72690),c=n(90835);function u(){var t=this,o=new google.maps.InfoWindow({content:"<div>test</div>"});return o.addListener("domready",function(){t.setMod("info-opened",!0)}),o.addListener("closeclick",function(){t.setMod("info-opened",!1)}),o}function p(t,o){var n,p=this;switch(this.state.mode="hand",t.type){case"polyline":n=new c.UIPolylineEditor(this.jodit,t.state,this.options);break;case"marker":n=new c.UIMarkerEditor(this.jodit,t.state,this.options);break;case"circle":case"polygon":n=new c.UIPolygonEditor(this.jodit,t.state,this.options)}if(n){this.append(n),this.j.e.on(n,"bin",function(){s.removeElement.call(p,t)}).on(n,"change",function(n,s){l.updateStateAndGme.call(p,(0,r._)((0,a._)({},t.state),(0,i._)({},n,s)),o)});var h=u.call(this);if("polygon"===t.type||"polyline"===t.type){var d=t.gme.getPath().getAt(0);h.setPosition(d)}"circle"===t.type&&h.setPosition(t.gme.getCenter()),h.setContent(n.container),h.open(this.map,t.gme),h.addListener("closeclick",function(){n&&(p.remove(n),n.destruct())})}}},11093:function(t,o,n){"use strict";n.d(o,{UIWysiwyg:function(){return g}});var i=n(80294),a=n(20616),r=n(67709),s=n(18766),l=n(56075),c=n(31635),u=n(87325),p=n(38837),h=n(48538),d=n(2692),g=function(t){function o(t,n,r,s){(0,a._)(this,o);var c=(0,i._)(this,o,[t]),u=c.getElm("editor");(0,p.assert)(null!=u,"editor element does not exist");var h=d.JoditPro.make(u,(0,l._)({buttons:["bold","italic","image"],height:100,minHeight:100,allowResizeY:!1,allowResizeX:!1,disablePlugins:["mobile","backup","highlight-signature","tune-block","show-blocks"],toolbarButtonSize:"small",language:t.o.language,direction:t.o.direction,theme:t.o.theme,statusbar:!1},n));return h.value=r,h.e.on("change",function(){return s(h.value)}),c}return(0,s._)(o,t),(0,r._)(o,[{key:"className",value:function(){return"UIWysiwyg"}},{key:"render",value:function(){return"<div>\n <div class='&__label'>~Info~</div>\n <div class='&__editor'></div>\n </div>"}}]),o}(h.UIElement);g=(0,c.__decorate)([u.component],g)},11696:function(t,o,n){"use strict";n.d(o,{UIPolygonEditor:function(){return h}});var i=n(80294),a=n(20616),r=n(67709),s=n(18766),l=n(31635),c=n(65478),u=n(62357),p=n(45128),h=function(t){function o(){return(0,a._)(this,o),(0,i._)(this,o,arguments)}return(0,s._)(o,t),(0,r._)(o,[{key:"className",value:function(){return"UIPolygonEditor"}},{key:"onReady",value:function(){var t,o,n=this;this.append([new p.ColorInput(this.j,{label:"Fill color",value:null!=(t=this.state.fillColor)?t:"#000",onChange:function(t){return n.j.e.fire(n,"change","fillColor",t)}}).setMod("trigger",!1),new u.UIRange(this.j,{label:"Opacity",min:0,max:1,value:null!=(o=this.state.fillOpacity)?o:1,onChange:function(t){n.j.e.fire(n,"change","fillOpacity",parseFloat(t)||0)}}).setMod("log",!1)],"form")}}]),o}(n(69398).UIPolylineEditor);(0,l.__decorate)([(0,c.hook)("ready")],h.prototype,"onReady",null),h=(0,l.__decorate)([c.component],h)},11886:function(t,o,n){"use strict";function i(t,o){return o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(t){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);o.push.apply(o,n)}return o})(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))}),t}n.d(o,{_:function(){return i}})},14002:function(t,o,n){"use strict";n.d(o,{UIBaseEditor:function(){return u}});var i=n(80294),a=n(20616),r=n(67709),s=n(82749),l=n(18766),c=n(67510),u=function(t){function o(t,n,r){var l;return(0,a._)(this,o),l=(0,i._)(this,o,[t]),(0,s._)(l,"state",void 0),(0,s._)(l,"options",void 0),l.state=n,l.options=r,l}return(0,l._)(o,t),(0,r._)(o,[{key:"className",value:function(){return"UIBaseEditor"}},{key:"render",value:function(){return"<div>\n <div class='&__header'></div>\n <div class='&__form'></div>\n <div class='&__buttons'></div>\n </div>"}},{key:"onReady",value:function(){var t=this,o=(0,c.Button)(this.j,"bin").onAction(function(){return t.j.e.fire(t,"bin")});this.append(o,"buttons")}}]),o}(c.UIGroup)},17298:function(t,o,n){"use strict";n.d(o,{COMMAND_OPEN_DIALOG:function(){return a},STORAGE_KEY:function(){return i}});var i="googleMapsState",a="googleMapsDialog"},22125:function(t,o,n){"use strict";n.d(o,{addNewInState:function(){return s}});var i=n(56075),a=n(94899),r=n(67912);function s(t){switch(this.state.mode){case"polyline":case"polygon":var o,n,s,l,c,u,p,h,d=this.state.mode;this.state.elements=(0,a._)(this.state.elements).concat([(0,i._)({type:d,coordinates:(0,r.pathToArray)(t.getPath())},this.options.googleMaps.map.defaultStates[d])]);break;case"circle":this.state.elements=(0,a._)(this.state.elements).concat([(0,i._)({type:this.state.mode,coordinates:[null!=(o=null==(s=t.getCenter())?void 0:s.lat())?o:0,null!=(n=null==(l=t.getCenter())?void 0:l.lng())?n:0],radius:t.getRadius()},this.options.googleMaps.map.defaultStates.circle)]);break;case"marker":this.state.elements=(0,a._)(this.state.elements).concat([(0,i._)({type:this.state.mode,coordinates:[null!=(c=null==(p=t.getPosition())?void 0:p.lat())?c:0,null!=(u=null==(h=t.getPosition())?void 0:h.lng())?u:0]},this.options.googleMaps.map.defaultStates.marker)])}}},27622:function(t){t.exports='<svg width="72" height="86" viewBox="0 0 72 86" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M17.1832 79.1351L13.6833 45.0811L49.6832 58.4595L47.6832 5.35135" stroke="black" stroke-width="6"/> <circle cx="13" cy="44" r="6" fill="#C8C8C8"/> <circle cx="17" cy="77" r="6" fill="#C8C8C8"/> <circle cx="51" cy="59" r="6" fill="#C8C8C8"/> <circle cx="48" cy="6" r="6" fill="#C8C8C8"/> </svg>'},36576:function(t){t.exports='<svg viewBox="0 0 77 86" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M7 38.6056L33.1367 7.96263L69.5477 45.7058L36.2444 72.166L7 76.9673V38.6056Z" stroke="black" stroke-width="6"/> <circle cx="71" cy="45" r="6" fill="#C8C8C8"/> <circle cx="35" cy="73" r="6" fill="#C8C8C8"/> <circle cx="6" cy="79" r="6" fill="#C8C8C8"/> <circle cx="6" cy="39" r="6" fill="#C8C8C8"/> <circle cx="33" cy="6" r="6" fill="#C8C8C8"/> </svg>'},42370:function(t,o,n){"use strict";n.d(o,{UIMarkerEditor:function(){return g}});var i=n(80294),a=n(20616),r=n(67709),s=n(54816),l=n(84669),c=n(18766),u=n(31635),p=n(65478),h=n(14002),d=n(11093),g=function(t){function o(){return(0,a._)(this,o),(0,i._)(this,o,arguments)}return(0,c._)(o,t),(0,r._)(o,[{key:"className",value:function(){return"UIMarkerEditor"}},{key:"onReady",value:function(){var t,n=this;(0,s._)((0,l._)(o.prototype),"onReady",this).call(this);var i=new d.UIWysiwyg(this.j,this.options.googleMaps.inlineEditorOptions,null!=(t=this.state.text)?t:"",function(t){return n.j.e.fire(n,"change","text",t)});this.append(i,"form")}}]),o}(h.UIBaseEditor);(0,u.__decorate)([(0,p.hook)("ready")],g.prototype,"onReady",null),g=(0,u.__decorate)([p.component],g)},45128:function(t,o,n){"use strict";n.d(o,{ColorInput:function(){return y}});var i=n(80294),a=n(20616),r=n(67709),s=n(82749),l=n(18766),c=n(2868),u=n(31635),p=n(46146),h=n(82758),d=n(65478),g=n(21537),f=n(38837),m=n(67510),v=n(41409),y=function(t){function o(t,n){(0,a._)(this,o),r=(0,i._)(this,o,[t,n]),(0,s._)(r,"trigger",void 0),(0,s._)(r,"popup",void 0);var r,l=new m.Popup(t);r.popup=l,r.trigger=(0,m.Button)(r.j,"ok");var u=r.getElm("wrapper");(0,f.assert)(null!=u,"wrapper element does not exist"),u.appendChild(r.trigger.container),r.trigger.container.classList.add(r.getFullElName("trigger")),r.trigger.onAction(function(){var t,o;null==(t=(o=r.state).onChange)||t.call(o,r.value),l.close()}),l.setMod("padding",!1).setMod("max-height",!1);var h=r.j.create.div(r.getFullElName("picker")),d=p.createPicker(h,{paletteEditable:!0,showAlpha:!0,palette:"PALETTE_MATERIAL_CHROME"}).on("change",function(t,o){r.isFocused||(r.value=p.parseColor(o||"","hex"))});return r.j.e.on(r,"change",function(){var t;t=r.value,p.parseColor(t,"hex")!==d.color&&(d.color=r.value)}),l.setContent(h),r.j.e.on(r.nativeInput,"click",function(){l.parentElement=r,(0,c._)(r.jodit,v.Dialog)&&l.setZIndex(r.jodit.getZIndex()+1),l.open(function(){return(0,g.position)(r.container)})}),r.onChangeValue(),r.onChangeSelfValue(),r}return(0,l._)(o,t),(0,r._)(o,[{key:"className",value:function(){return"ColorInput"}},{key:"afterSetMode",value:function(t,o){"slim"===t&&o&&this.nativeInput.setAttribute("readonly","true")}},{key:"onChangeSelfValue",value:function(){this.nativeInput.style.backgroundColor=this.value}},{key:"onEscKeyDown",value:function(t){if(t.key===h.KEY_ESC){var o;null==(o=this.popup)||o.close()}}}]),o}(m.UIInput);(0,u.__decorate)([(0,d.watch)(":change")],y.prototype,"onChangeSelfValue",null),(0,u.__decorate)([(0,d.watch)("nativeInput:keydown")],y.prototype,"onEscKeyDown",null),y=(0,u.__decorate)([d.component],y)},46146:function(t,o,n){var i,a;function r(t,o){return null!=o&&"u">typeof Symbol&&o[Symbol.hasInstance]?!!o[Symbol.hasInstance](t):t instanceof o}function s(t){return t&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}t=n.nmd(t),"u">typeof self&&self,a=function(){var t=[function(t,o,n){"use strict";var i=n(3);function a(t){return!0===i(t)&&"[object Object]"===Object.prototype.toString.call(t)}t.exports=function(t){var o,n;return!1!==a(t)&&"function"==typeof(o=t.constructor)&&!1!==a(n=o.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")}},function(t,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.VERSION=o.PALETTE_MATERIAL_CHROME=o.PALETTE_MATERIAL_500=o.COLOR_NAMES=o.getLuminance=o.intToRgb=o.rgbToInt=o.rgbToHsv=o.rgbToHsl=o.hslToRgb=o.rgbToHex=o.parseColor=o.parseColorToHsla=o.parseColorToHsl=o.parseColorToRgba=o.parseColorToRgb=o.from=o.createPicker=void 0;var i=function(){function t(t,o){for(var n=0;n<o.length;n++){var i=o[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(o,n,i){return n&&t(o.prototype,n),i&&t(o,i),o}}(),a=function(t,o){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,o){var n=[],i=!0,a=!1,r=void 0;try{for(var s,l=t[Symbol.iterator]();!(i=(s=l.next()).done)&&(n.push(s.value),!o||n.length!==o);i=!0);}catch(t){a=!0,r=t}finally{try{!i&&l.return&&l.return()}finally{if(a)throw r}}return n}(t,o);throw TypeError("Invalid attempt to destructure non-iterable instance")},s=n(2),l=u(n(0)),c=u(n(4));function u(t){return t&&t.__esModule?t:{default:t}}function p(t,o){if(!r(t,o))throw TypeError("Cannot call a class as a function")}function h(t){if(Array.isArray(t)){for(var o=0,n=Array(t.length);o<t.length;o++)n[o]=t[o];return n}return Array.from(t)}var d="u">typeof window&&window.navigator.userAgent.indexOf("Edge")>-1,g="u">typeof window&&window.navigator.userAgent.indexOf("rv:")>-1,f={id:null,attachTo:"body",showHSL:!0,showRGB:!0,showHEX:!0,showAlpha:!1,color:"#ff0000",palette:null,paletteEditable:!1,useAlphaInPalette:"auto",slBarSize:[232,150],hueBarSize:[150,11],alphaBarSize:[150,11]},m="COLOR",v="RGBA_USER",y="HSLA_USER";function b(t,o,n){return t?r(t,HTMLElement)?t:r(t,NodeList)?t[0]:"string"==typeof t?document.querySelector(t):t.jquery?t.get(0):n?o:null:o}function C(t){var o=t.getContext("2d"),n=+t.width,i=+t.height,r=o.createLinearGradient(1,1,1,i-1);return r.addColorStop(0,"white"),r.addColorStop(1,"black"),{setHue:function(t){var a=o.createLinearGradient(1,0,n-1,0);a.addColorStop(0,"hsla("+t+", 100%, 50%, 0)"),a.addColorStop(1,"hsla("+t+", 100%, 50%, 1)"),o.fillStyle=r,o.fillRect(0,0,n,i),o.fillStyle=a,o.globalCompositeOperation="multiply",o.fillRect(0,0,n,i),o.globalCompositeOperation="source-over"},grabColor:function(t,n){return o.getImageData(t,n,1,1).data},findColor:function(t,o,r){var l=a((0,s.rgbToHsv)(t,o,r),3);return[l[1]*n,i-l[2]*i]}}}function k(t,o,n){return null===t?o:/^\s*$/.test(t)?n:!!/true|yes|1/i.test(t)||!/false|no|0/i.test(t)&&o}function w(t,o,n){if(null===t)return o;if(/^\s*$/.test(t))return n;var i=t.split(",").map(Number);return 2===i.length&&i[0]&&i[1]?i:o}var E=function(){function t(o,n){if(p(this,t),n?(o=b(o),this.options=Object.assign({},f,n)):o&&(0,l.default)(o)?(this.options=Object.assign({},f,o),o=b(this.options.attachTo)):(this.options=Object.assign({},f),o=b((0,s.nvl)(o,this.options.attachTo))),!o)throw Error("Container not found: "+this.options.attachTo);!function(t,o){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"acp-";if(o.hasAttribute(n+"show-hsl")&&(t.showHSL=k(o.getAttribute(n+"show-hsl"),f.showHSL,!0)),o.hasAttribute(n+"show-rgb")&&(t.showRGB=k(o.getAttribute(n+"show-rgb"),f.showRGB,!0)),o.hasAttribute(n+"show-hex")&&(t.showHEX=k(o.getAttribute(n+"show-hex"),f.showHEX,!0)),o.hasAttribute(n+"show-alpha")&&(t.showAlpha=k(o.getAttribute(n+"show-alpha"),f.showAlpha,!0)),o.hasAttribute(n+"palette-editable")&&(t.paletteEditable=k(o.getAttribute(n+"palette-editable"),f.paletteEditable,!0)),o.hasAttribute(n+"sl-bar-size")&&(t.slBarSize=w(o.getAttribute(n+"sl-bar-size"),f.slBarSize,[232,150])),o.hasAttribute(n+"hue-bar-size")&&(t.hueBarSize=w(o.getAttribute(n+"hue-bar-size"),f.hueBarSize,[150,11]),t.alphaBarSize=t.hueBarSize),o.hasAttribute(n+"palette")){var i=o.getAttribute(n+"palette");switch(i){case"PALETTE_MATERIAL_500":t.palette=s.PALETTE_MATERIAL_500;break;case"PALETTE_MATERIAL_CHROME":case"":t.palette=s.PALETTE_MATERIAL_CHROME;break;default:t.palette=i.split(/[;|]/)}}o.hasAttribute(n+"color")&&(t.color=o.getAttribute(n+"color"))}(this.options,o),this.H=0,this.S=0,this.L=0,this.R=0,this.G=0,this.B=0,this.A=1,this.palette={},this.element=document.createElement("div"),this.options.id&&(this.element.id=this.options.id),this.element.className="a-color-picker",this.element.innerHTML=c.default,o.appendChild(this.element);var i=this.element.querySelector(".a-color-picker-h");this.setupHueCanvas(i),this.hueBarHelper=C(i),this.huePointer=this.element.querySelector(".a-color-picker-h+.a-color-picker-dot");var a=this.element.querySelector(".a-color-picker-sl");this.setupSlCanvas(a),this.slBarHelper=C(a),this.slPointer=this.element.querySelector(".a-color-picker-sl+.a-color-picker-dot"),this.preview=this.element.querySelector(".a-color-picker-preview"),this.setupClipboard(this.preview.querySelector(".a-color-picker-clipbaord")),this.options.showHSL?(this.setupInput(this.inputH=this.element.querySelector(".a-color-picker-hsl>input[nameref=H]")),this.setupInput(this.inputS=this.element.querySelector(".a-color-picker-hsl>input[nameref=S]")),this.setupInput(this.inputL=this.element.querySelector(".a-color-picker-hsl>input[nameref=L]"))):this.element.querySelector(".a-color-picker-hsl").remove(),this.options.showRGB?(this.setupInput(this.inputR=this.element.querySelector(".a-color-picker-rgb>input[nameref=R]")),this.setupInput(this.inputG=this.element.querySelector(".a-color-picker-rgb>input[nameref=G]")),this.setupInput(this.inputB=this.element.querySelector(".a-color-picker-rgb>input[nameref=B]"))):this.element.querySelector(".a-color-picker-rgb").remove(),this.options.showHEX?this.setupInput(this.inputRGBHEX=this.element.querySelector("input[nameref=RGBHEX]")):this.element.querySelector(".a-color-picker-rgbhex").remove(),this.options.paletteEditable||this.options.palette&&this.options.palette.length>0?this.setPalette(this.paletteRow=this.element.querySelector(".a-color-picker-palette")):(this.paletteRow=this.element.querySelector(".a-color-picker-palette"),this.paletteRow.remove()),this.options.showAlpha?(this.setupAlphaCanvas(this.element.querySelector(".a-color-picker-a")),this.alphaPointer=this.element.querySelector(".a-color-picker-a+.a-color-picker-dot")):this.element.querySelector(".a-color-picker-alpha").remove(),this.element.style.width=this.options.slBarSize[0]+"px",this.onValueChanged(m,this.options.color)}return i(t,[{key:"setupHueCanvas",value:function(t){var o=this;t.width=this.options.hueBarSize[0],t.height=this.options.hueBarSize[1];for(var n=t.getContext("2d"),i=n.createLinearGradient(0,0,this.options.hueBarSize[0],0),a=0;a<=1;a+=1/360)i.addColorStop(a,"hsl("+360*a+", 100%, 50%)");n.fillStyle=i,n.fillRect(0,0,this.options.hueBarSize[0],this.options.hueBarSize[1]);var r=function(n){var i=(0,s.limit)(n.clientX-t.getBoundingClientRect().left,0,o.options.hueBarSize[0]),a=Math.round(360*i/o.options.hueBarSize[0]);o.huePointer.style.left=i-7+"px",o.onValueChanged("H",a)},l=function t(){document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",t)};t.addEventListener("mousedown",function(t){r(t),document.addEventListener("mousemove",r),document.addEventListener("mouseup",l)})}},{key:"setupSlCanvas",value:function(t){var o=this;t.width=this.options.slBarSize[0],t.height=this.options.slBarSize[1];var n=function(n){var i=(0,s.limit)(n.clientX-t.getBoundingClientRect().left,0,o.options.slBarSize[0]-1),a=(0,s.limit)(n.clientY-t.getBoundingClientRect().top,0,o.options.slBarSize[1]-1),r=o.slBarHelper.grabColor(i,a);o.slPointer.style.left=i-7+"px",o.slPointer.style.top=a-7+"px",o.onValueChanged("RGB",r)},i=function t(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)};t.addEventListener("mousedown",function(t){n(t),document.addEventListener("mousemove",n),document.addEventListener("mouseup",i)})}},{key:"setupAlphaCanvas",value:function(t){var o=this;t.width=this.options.alphaBarSize[0],t.height=this.options.alphaBarSize[1];var n=t.getContext("2d"),i=n.createLinearGradient(0,0,t.width-1,0);i.addColorStop(0,"hsla(0, 0%, 50%, 0)"),i.addColorStop(1,"hsla(0, 0%, 50%, 1)"),n.fillStyle=i,n.fillRect(0,0,this.options.alphaBarSize[0],this.options.alphaBarSize[1]);var a=function(n){var i=(0,s.limit)(n.clientX-t.getBoundingClientRect().left,0,o.options.alphaBarSize[0]),a=+(i/o.options.alphaBarSize[0]).toFixed(2);o.alphaPointer.style.left=i-7+"px",o.onValueChanged("ALPHA",a)},r=function t(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",t)};t.addEventListener("mousedown",function(t){a(t),document.addEventListener("mousemove",a),document.addEventListener("mouseup",r)})}},{key:"setupInput",value:function(t){var o=this,n=+t.min,i=+t.max,a=t.getAttribute("nameref");t.hasAttribute("select-on-focus")&&t.addEventListener("focus",function(){t.select()}),"text"===t.type?t.addEventListener("change",function(){o.onValueChanged(a,t.value)}):((d||g)&&t.addEventListener("keydown",function(r){"Up"===r.key?(t.value=(0,s.limit)(+t.value+1,n,i),o.onValueChanged(a,t.value),r.returnValue=!1):"Down"===r.key&&(t.value=(0,s.limit)(t.value-1,n,i),o.onValueChanged(a,t.value),r.returnValue=!1)}),t.addEventListener("change",function(){var r=+t.value;o.onValueChanged(a,(0,s.limit)(r,n,i))}))}},{key:"setupClipboard",value:function(t){var o=this;t.title="click to copy",t.addEventListener("click",function(){t.value=(0,s.parseColor)([o.R,o.G,o.B,o.A],"hexcss4"),t.select(),document.execCommand("copy")})}},{key:"setPalette",value:function(t){var o=this,n="auto"===this.options.useAlphaInPalette?this.options.showAlpha:this.options.useAlphaInPalette,i=null;switch(this.options.palette){case"PALETTE_MATERIAL_500":i=s.PALETTE_MATERIAL_500;break;case"PALETTE_MATERIAL_CHROME":i=s.PALETTE_MATERIAL_CHROME;break;default:i=(0,s.ensureArray)(this.options.palette)}if(this.options.paletteEditable||i.length>0){var a=function(n,i,a){var r=t.querySelector('.a-color-picker-palette-color[data-color="'+n+'"]')||document.createElement("div");r.className="a-color-picker-palette-color",r.style.backgroundColor=n,r.setAttribute("data-color",n),r.title=n,t.insertBefore(r,i),o.palette[n]=!0,a&&o.onPaletteColorAdd(n)},r=function(n,i){n?(t.removeChild(n),o.palette[n.getAttribute("data-color")]=!1,i&&o.onPaletteColorRemove(n.getAttribute("data-color"))):(t.querySelectorAll(".a-color-picker-palette-color[data-color]").forEach(function(o){t.removeChild(o)}),Object.keys(o.palette).forEach(function(t){o.palette[t]=!1}),i&&o.onPaletteColorRemove())};if(i.map(function(t){return(0,s.parseColor)(t,n?"rgbcss4":"hex")}).filter(function(t){return!!t}).forEach(function(t){return a(t)}),this.options.paletteEditable){var l=document.createElement("div");l.className="a-color-picker-palette-color a-color-picker-palette-add",l.innerHTML="+",t.appendChild(l),t.addEventListener("click",function(t){/a-color-picker-palette-add/.test(t.target.className)?t.shiftKey?r(null,!0):a(n?(0,s.parseColor)([o.R,o.G,o.B,o.A],"rgbcss4"):(0,s.rgbToHex)(o.R,o.G,o.B),t.target,!0):/a-color-picker-palette-color/.test(t.target.className)&&(t.shiftKey?r(t.target,!0):o.onValueChanged(m,t.target.getAttribute("data-color")))})}else t.addEventListener("click",function(t){/a-color-picker-palette-color/.test(t.target.className)&&o.onValueChanged(m,t.target.getAttribute("data-color"))})}else t.style.display="none"}},{key:"updatePalette",value:function(t){this.paletteRow.innerHTML="",this.palette={},this.paletteRow.parentElement||this.element.appendChild(this.paletteRow),this.options.palette=t,this.setPalette(this.paletteRow)}},{key:"onValueChanged",value:function(t,o){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{silent:!1};switch(t){case"H":this.H=o;var i=a((0,s.hslToRgb)(this.H,this.S,this.L),3);this.R=i[0],this.G=i[1],this.B=i[2],this.slBarHelper.setHue(o),this.updatePointerH(this.H),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"S":this.S=o;var r=a((0,s.hslToRgb)(this.H,this.S,this.L),3);this.R=r[0],this.G=r[1],this.B=r[2],this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"L":this.L=o;var l=a((0,s.hslToRgb)(this.H,this.S,this.L),3);this.R=l[0],this.G=l[1],this.B=l[2],this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"R":this.R=o;var c=a((0,s.rgbToHsl)(this.R,this.G,this.B),3);this.H=c[0],this.S=c[1],this.L=c[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"G":this.G=o;var u=a((0,s.rgbToHsl)(this.R,this.G,this.B),3);this.H=u[0],this.S=u[1],this.L=u[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"B":this.B=o;var p=a((0,s.rgbToHsl)(this.R,this.G,this.B),3);this.H=p[0],this.S=p[1],this.L=p[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"RGB":var h=a(o,3);this.R=h[0],this.G=h[1],this.B=h[2];var d=a((0,s.rgbToHsl)(this.R,this.G,this.B),3);this.H=d[0],this.S=d[1],this.L=d[2],this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case v:var g=a(o,4);this.R=g[0],this.G=g[1],this.B=g[2],this.A=g[3];var f=a((0,s.rgbToHsl)(this.R,this.G,this.B),3);this.H=f[0],this.S=f[1],this.L=f[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case y:var b=a(o,4);this.H=b[0],this.S=b[1],this.L=b[2],this.A=b[3];var C=a((0,s.hslToRgb)(this.H,this.S,this.L),3);this.R=C[0],this.G=C[1],this.B=C[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case"RGBHEX":var k=a((0,s.cssColorToRgb)(o)||[this.R,this.G,this.B],3);this.R=k[0],this.G=k[1],this.B=k[2];var w=a((0,s.rgbToHsl)(this.R,this.G,this.B),3);this.H=w[0],this.S=w[1],this.L=w[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B);break;case m:var E=a((0,s.parseColor)(o,"rgba")||[0,0,0,1],4);this.R=E[0],this.G=E[1],this.B=E[2],this.A=E[3];var _=a((0,s.rgbToHsl)(this.R,this.G,this.B),3);this.H=_[0],this.S=_[1],this.L=_[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case"ALPHA":this.A=o}1===this.A?this.preview.style.backgroundColor="rgb("+this.R+","+this.G+","+this.B+")":this.preview.style.backgroundColor="rgba("+this.R+","+this.G+","+this.B+","+this.A+")",n&&n.silent||this.onchange&&this.onchange(this.preview.style.backgroundColor)}},{key:"onPaletteColorAdd",value:function(t){this.oncoloradd&&this.oncoloradd(t)}},{key:"onPaletteColorRemove",value:function(t){this.oncolorremove&&this.oncolorremove(t)}},{key:"updateInputHSL",value:function(t,o,n){this.options.showHSL&&(this.inputH.value=t,this.inputS.value=o,this.inputL.value=n)}},{key:"updateInputRGB",value:function(t,o,n){this.options.showRGB&&(this.inputR.value=t,this.inputG.value=o,this.inputB.value=n)}},{key:"updateInputRGBHEX",value:function(t,o,n){this.options.showHEX&&(this.inputRGBHEX.value=(0,s.rgbToHex)(t,o,n))}},{key:"updatePointerH",value:function(t){var o=this.options.hueBarSize[0]*t/360;this.huePointer.style.left=o-7+"px"}},{key:"updatePointerSL",value:function(t,o,n){var i=a((0,s.hslToRgb)(t,o,n),3),r=i[0],l=i[1],c=i[2],u=a(this.slBarHelper.findColor(r,l,c),2),p=u[0],h=u[1];p>=0&&(this.slPointer.style.left=p-7+"px",this.slPointer.style.top=h-7+"px")}},{key:"updatePointerA",value:function(t){if(this.options.showAlpha){var o=this.options.alphaBarSize[0]*t;this.alphaPointer.style.left=o-7+"px"}}}]),t}(),_=function(){function t(o){p(this,t),this.name=o,this.listeners=[]}return i(t,[{key:"on",value:function(t){t&&this.listeners.push(t)}},{key:"off",value:function(t){this.listeners=t?this.listeners.filter(function(o){return o!==t}):[]}},{key:"emit",value:function(t,o){for(var n=this.listeners.slice(0),i=0;i<n.length;i++)n[i].apply(o,t)}}]),t}();function A(t,o){var n=new E(t,o),i={change:new _("change"),coloradd:new _("coloradd"),colorremove:new _("colorremove")},r=!0,l={},c={get element(){return n.element},get rgb(){return[n.R,n.G,n.B]},set rgb(e){var u=a(e,3),p=u[0],h=u[1],d=u[2],g=[(0,s.limit)(p,0,255),(0,s.limit)(h,0,255),(0,s.limit)(d,0,255)];p=g[0],h=g[1],d=g[2],n.onValueChanged(v,[p,h,d,1])},get hsl(){return[n.H,n.S,n.L]},set hsl(e){var f=a(e,3),b=f[0],C=f[1],k=f[2],w=[(0,s.limit)(b,0,360),(0,s.limit)(C,0,100),(0,s.limit)(k,0,100)];b=w[0],C=w[1],k=w[2],n.onValueChanged(y,[b,C,k,1])},get rgbhex(){return this.all.hex},get rgba(){return[n.R,n.G,n.B,n.A]},set rgba(e){var A=a(e,4),S=A[0],x=A[1],F=A[2],B=A[3],L=[(0,s.limit)(S,0,255),(0,s.limit)(x,0,255),(0,s.limit)(F,0,255),(0,s.limit)(B,0,1)];S=L[0],x=L[1],F=L[2],B=L[3],n.onValueChanged(v,[S,x,F,B])},get hsla(){return[n.H,n.S,n.L,n.A]},set hsla(e){var R=a(e,4),I=R[0],H=R[1],M=R[2],T=R[3],P=[(0,s.limit)(I,0,360),(0,s.limit)(H,0,100),(0,s.limit)(M,0,100),(0,s.limit)(T,0,1)];I=P[0],H=P[1],M=P[2],T=P[3],n.onValueChanged(y,[I,H,M,T])},get color(){return this.all.toString()},set color(e){n.onValueChanged(m,e)},setColor:function(t){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n.onValueChanged(m,t,{silent:o})},get all(){if(r){var j=[n.R,n.G,n.B,n.A],O=n.A<1?"rgba("+n.R+","+n.G+","+n.B+","+n.A+")":s.rgbToHex.apply(void 0,j);(l=(0,s.parseColor)(j,l)).toString=function(){return O},r=!1}return Object.assign({},l)},get onchange(){return i.change&&i.change.listeners[0]},set onchange(e){this.off("change").on("change",e)},get oncoloradd(){return i.coloradd&&i.coloradd.listeners[0]},set oncoloradd(e){this.off("coloradd").on("coloradd",e)},get oncolorremove(){return i.colorremove&&i.colorremove.listeners[0]},set oncolorremove(e){this.off("colorremove").on("colorremove",e)},get palette(){return Object.keys(n.palette).filter(function(t){return n.palette[t]})},set palette(e){n.updatePalette(e)},show:function(){n.element.classList.remove("hidden")},hide:function(){n.element.classList.add("hidden")},toggle:function(){n.element.classList.toggle("hidden")},on:function(t,o){return t&&i[t]&&i[t].on(o),this},off:function(t,o){return t&&i[t]&&i[t].off(o),this},destroy:function(){i.change.off(),i.coloradd.off(),i.colorremove.off(),n.element.remove(),i=null,n=null}};return n.onchange=function(){for(var t=arguments.length,o=Array(t),n=0;n<t;n++)o[n]=arguments[n];r=!0,i.change.emit([c].concat(o),c)},n.oncoloradd=function(){for(var t=arguments.length,o=Array(t),n=0;n<t;n++)o[n]=arguments[n];i.coloradd.emit([c].concat(o),c)},n.oncolorremove=function(){for(var t=arguments.length,o=Array(t),n=0;n<t;n++)o[n]=arguments[n];i.colorremove.emit([c].concat(o),c)},n.element.ctrl=c,c}if("u">typeof window&&!document.querySelector('head>style[data-source="a-color-picker"]')){var S=n(5).toString(),x=document.createElement("style");x.setAttribute("type","text/css"),x.setAttribute("data-source","a-color-picker"),x.innerHTML=S,document.querySelector("head").appendChild(x)}o.createPicker=A,o.from=function(t,o){var n=(t?Array.isArray(t)?t:r(t,HTMLElement)?[t]:r(t,NodeList)?[].concat(h(t)):"string"==typeof t?[].concat(h(document.querySelectorAll(t))):t.jquery?t.get():[]:[]).map(function(t,n){var i=A(t,o);return i.index=n,i});return n.on=function(t,o){return n.forEach(function(n){return n.on(t,o)}),this},n.off=function(t){return n.forEach(function(o){return o.off(t)}),this},n},o.parseColorToRgb=s.parseColorToRgb,o.parseColorToRgba=s.parseColorToRgba,o.parseColorToHsl=s.parseColorToHsl,o.parseColorToHsla=s.parseColorToHsla,o.parseColor=s.parseColor,o.rgbToHex=s.rgbToHex,o.hslToRgb=s.hslToRgb,o.rgbToHsl=s.rgbToHsl,o.rgbToHsv=s.rgbToHsv,o.rgbToInt=s.rgbToInt,o.intToRgb=s.intToRgb,o.getLuminance=s.getLuminance,o.COLOR_NAMES=s.COLOR_NAMES,o.PALETTE_MATERIAL_500=s.PALETTE_MATERIAL_500,o.PALETTE_MATERIAL_CHROME=s.PALETTE_MATERIAL_CHROME,o.VERSION="1.2.1"},function(t,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.nvl=o.ensureArray=o.limit=o.getLuminance=o.parseColor=o.parseColorToHsla=o.parseColorToHsl=o.cssHslaToHsla=o.cssHslToHsl=o.parseColorToRgba=o.parseColorToRgb=o.cssRgbaToRgba=o.cssRgbToRgb=o.cssColorToRgba=o.cssColorToRgb=o.intToRgb=o.rgbToInt=o.rgbToHsv=o.rgbToHsl=o.hslToRgb=o.rgbToHex=o.PALETTE_MATERIAL_CHROME=o.PALETTE_MATERIAL_500=o.COLOR_NAMES=void 0;var i,a=function(t,o){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,o){var n=[],i=!0,a=!1,r=void 0;try{for(var s,l=t[Symbol.iterator]();!(i=(s=l.next()).done)&&(n.push(s.value),!o||n.length!==o);i=!0);}catch(t){a=!0,r=t}finally{try{!i&&l.return&&l.return()}finally{if(a)throw r}}return n}(t,o);throw TypeError("Invalid attempt to destructure non-iterable instance")},r=(i=n(0))&&i.__esModule?i:{default:i};function s(t){if(Array.isArray(t)){for(var o=0,n=Array(t.length);o<t.length;o++)n[o]=t[o];return n}return Array.from(t)}var l={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4","indianred ":"#CD5C5C","indigo ":"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"};function c(t,o,n){return isNaN(t*=1)||o>t?o:t>n?n:t}function u(t,o){return null==t?o:t}function p(t,o,n){var i=[c(t,0,255),c(o,0,255),c(n,0,255)];return"#"+("000000"+((t=i[0])<<16|(o=i[1])<<8|(n=i[2]