diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/a11y-figure/a11y-figure.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/a11y-figure/a11y-figure.js index 3a36fd9d..70f0ff1c 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/a11y-figure/a11y-figure.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/a11y-figure/a11y-figure.js @@ -59,4 +59,4 @@ import{html as e,css as t}from"../../lit/index.js";import{A11yDetails as i}from" - `}static get haxProperties(){return{canScale:!0,canEditSource:!0,type:"grid",gizmo:{title:"Descriptive Figure",description:"Accessible figure with long description",icon:"hax:figure",color:"grey",tags:["content","figure","a11y","accessibility","image","caption","description"],handles:[{type:"image",source:"imgSrc",alt:"imgAlt",caption:"figcaption"}],meta:{author:"HAXTheWeb core team",owner:"The Pennsylvania State University"}},settings:{configure:[{property:"imgSrc",title:"Image",inputMethod:"haxupload",noVoiceRecord:!0},{property:"imgAlt",title:"Alt Text",inputMethod:"alt",required:!0},{slot:"figcaption",title:"Figure Caption",description:"Figure caption text that is always visible.",inputMethod:"code-editor"},{slot:"details",title:"Decription",description:"Detailed image description that can be hidden or shown",inputMethod:"code-editor"},{slot:"summary",title:"Decription Button",description:'Default for button that shows/hides description text, eg. "info", "medatadata", etc. ',inputMethod:"code-editor"}],advanced:[{property:"openText",title:"Optional summary text when details are open",inputMethod:"textfield",required:!1},{property:"closeText",title:"Optional summary text when details are closed",inputMethod:"textfield",required:!1}]},demoSchema:[{tag:"a11y-figure",properties:{imgSrc:"//placekitten.com/400/300",imgAlt:"random kitten",openText:"Show Description",closeText:"Hide Description",style:"max-width:400px"},content:'

Random Kitten

\n
Image Description
\n
Aenean eget nisl volutpat, molestie purus eget, bibendum metus. Pellentesque magna velit, tincidunt quis pharetra id, gravida placerat erat. Maecenas id dui pretium risus pulvinar feugiat vel nec leo. Praesent non congue tellus. Suspendisse ac tincidunt purus. Donec eu dui a metus vehicula bibendum sed nec tortor. Nunc convallis justo sed nibh consectetur, at pharetra nulla accumsan.
'}]}}static get properties(){return{...super.properties,imgSrc:{type:String,attribute:"img-src"},imgAlt:{type:String,attribute:"img-alt"},__hasDetail:{type:Boolean}}}static get tag(){return"a11y-figure"}constructor(){super(),this.tag=A11yFigure.tag}get observer(){return new MutationObserver((e=>this._watchChildren(e)))}get figureObserver(){return new MutationObserver((()=>this._updateElement()))}_updateElement(){let e=this.querySelector("* > figure"),t=e?e.querySelector("* > img"):void 0,i=e?e.querySelector("* > figcaption"):void 0;t&&((this.querySelectorAll("[slot=image]")||[]).forEach((e=>e.remove())),t.cloneNode(),t.slot="image",this.appendChild(t)),this.__hasDetail=!!this.querySelector("summary")||!!this.querySelector("*[slot=summary]"),i&&this._copyAndFilter(i.cloneNode(!0),["figcaption","details","summary"])}_copyAndFilter(e,t=[],i=0){let r=t[i+1],a=e&&r?e.querySelector(`* > ${r}`):void 0;a&&(this._copyAndFilter(a,t,i+1),Object.keys(a||{}).forEach((e=>a[e].remove()))),this._copyToSlot(t[i],e)}_watchChildren(e){this._hasMutations(e)?(this._updateElement(),this.figureObserver.observe(this.querySelector("* > figure"),{childList:!0,subtree:!0,characterData:!0})):this._hasMutations(e,"removedNodes")&&!this.querySelector("* > figureObserver")&&this.detailsObserver.disconnect&&this.detailsObserver.disconnect()}}customElements.define("a11y-figure",A11yFigure);export{A11yFigure}; \ No newline at end of file + `}static get haxProperties(){return{canScale:!0,canEditSource:!0,type:"grid",gizmo:{title:"Descriptive Figure",description:"Accessible figure with long description",icon:"hax:figure",color:"grey",tags:["content","figure","a11y","accessibility","image","caption","description"],handles:[{type:"image",source:"imgSrc",alt:"imgAlt",caption:"figcaption"}],meta:{author:"HAXTheWeb core team",owner:"The Pennsylvania State University"}},settings:{configure:[{property:"imgSrc",title:"Image",inputMethod:"haxupload",noVoiceRecord:!0},{property:"imgAlt",title:"Alt Text",inputMethod:"alt",required:!0},{slot:"figcaption",title:"Figure Caption",description:"Figure caption text that is always visible.",inputMethod:"code-editor"},{slot:"details",title:"Decription",description:"Detailed image description that can be hidden or shown",inputMethod:"code-editor"},{slot:"summary",title:"Decription Button",description:'Default for button that shows/hides description text, eg. "info", "medatadata", etc. ',inputMethod:"code-editor"}],advanced:[{property:"openText",title:"Optional summary text when details are open",inputMethod:"textfield",required:!1},{property:"closeText",title:"Optional summary text when details are closed",inputMethod:"textfield",required:!1}]},demoSchema:[{tag:"a11y-figure",properties:{imgSrc:"https://placehold.co/500x300",imgAlt:"",openText:"Show Description",closeText:"Hide Description",style:"max-width:400px"},content:'

Random

\n
Image Description
\n
Aenean eget nisl volutpat, molestie purus eget, bibendum metus. Pellentesque magna velit, tincidunt quis pharetra id, gravida placerat erat. Maecenas id dui pretium risus pulvinar feugiat vel nec leo. Praesent non congue tellus. Suspendisse ac tincidunt purus. Donec eu dui a metus vehicula bibendum sed nec tortor. Nunc convallis justo sed nibh consectetur, at pharetra nulla accumsan.
'}]}}static get properties(){return{...super.properties,imgSrc:{type:String,attribute:"img-src"},imgAlt:{type:String,attribute:"img-alt"},__hasDetail:{type:Boolean}}}static get tag(){return"a11y-figure"}constructor(){super(),this.tag=A11yFigure.tag}get observer(){return new MutationObserver((e=>this._watchChildren(e)))}get figureObserver(){return new MutationObserver((()=>this._updateElement()))}_updateElement(){let e=this.querySelector("* > figure"),t=e?e.querySelector("* > img"):void 0,i=e?e.querySelector("* > figcaption"):void 0;t&&((this.querySelectorAll("[slot=image]")||[]).forEach((e=>e.remove())),t.cloneNode(),t.slot="image",this.appendChild(t)),this.__hasDetail=!!this.querySelector("summary")||!!this.querySelector("*[slot=summary]"),i&&this._copyAndFilter(i.cloneNode(!0),["figcaption","details","summary"])}_copyAndFilter(e,t=[],i=0){let r=t[i+1],a=e&&r?e.querySelector(`* > ${r}`):void 0;a&&(this._copyAndFilter(a,t,i+1),Object.keys(a||{}).forEach((e=>a[e].remove()))),this._copyToSlot(t[i],e)}_watchChildren(e){this._hasMutations(e)?(this._updateElement(),this.figureObserver.observe(this.querySelector("* > figure"),{childList:!0,subtree:!0,characterData:!0})):this._hasMutations(e,"removedNodes")&&!this.querySelector("* > figureObserver")&&this.detailsObserver.disconnect&&this.detailsObserver.disconnect()}}customElements.define("a11y-figure",A11yFigure);export{A11yFigure}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/a11y-media-player/a11y-media-player.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/a11y-media-player/a11y-media-player.js index 6bd383ff..a3fa9ebb 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/a11y-media-player/a11y-media-player.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/a11y-media-player/a11y-media-player.js @@ -1236,4 +1236,4 @@ import{LitElement as t,html as e,css as i}from"../../lit/index.js";import{DDD as
`}static get properties(){return{...super.properties,__playerReady:{type:Boolean},allowConcurrent:{attribute:"allow-concurrent",type:Boolean},audioOnly:{attribute:"audio-only",type:Boolean,reflect:!0},autoplay:{attribute:"autoplay",type:Boolean},captionsTrack:{attribute:"captions-track",type:Object},cc:{attribute:"cc",type:Boolean},currentTime:{type:Number},crossorigin:{attribute:"crossorigin",type:String},disablePrintButton:{attribute:"disable-print-button",type:Boolean},disableSearch:{attribute:"disable-search",type:Boolean},disableScroll:{attribute:"disable-scroll",type:Boolean},disableSeek:{attribute:"disable-seek",type:Boolean},darkTranscript:{attribute:"dark-transcript",type:Boolean},disableFullscreen:{attribute:"disable-fullscreen",type:Boolean},disableInteractive:{attribute:"disable-interactive",type:Boolean},height:{attribute:"height",type:String},hideElapsedTime:{attribute:"hide-elapsed-time",type:Boolean},hideTimestamps:{attribute:"hide-timestamps",type:Boolean},hideTranscript:{attribute:"hide-transcript",type:Boolean,reflect:!0},id:{attribute:"id",type:String,reflect:!0},lang:{attribute:"lang",type:String},learningMode:{attribute:"learning-mode",type:Boolean},linkable:{attribute:"linkable",type:Boolean},localization:{attribute:"localization",type:Object},loop:{attribute:"loop",type:Boolean},mediaLang:{attribute:"media-lang",type:String},mediaTitle:{attribute:"media-title",type:String},muted:{attribute:"muted",type:Boolean},hideYoutubeLink:{type:Boolean,attribute:"hide-youtube-link"},playbackRate:{attribute:"playback-rate",type:Number},preload:{attribute:"preload",type:String,reflect:!0},responsiveSize:{attribute:"responsive-size",type:String,reflect:!0},search:{attribute:"search",type:Object},standAlone:{attribute:"stand-alone",type:Boolean,reflect:!0},source:{type:String,reflect:!0},sources:{attribute:"sources",type:Array},stackedLayout:{attribute:"stacked-layout",type:Boolean},sticky:{attribute:"sticky",type:Boolean,reflect:!0},stickyCorner:{attribute:"sticky-corner",type:String,reflect:!0},thumbnailSrc:{attribute:"thumbnail-src",type:String,reflect:!0},tracks:{attribute:"tracks",type:Array},transcriptTrack:{attribute:"transcript-track",type:Object},volume:{attribute:"volume",type:Number},width:{attribute:"width",type:String},youtubeId:{attribute:"youtube-id",reflect:!0,type:String},__currentTime:{type:Number},__captionsOption:{type:Number},__cues:{type:Array},__loadedTracks:{type:Object},__playing:{type:Boolean},__preloadedDuration:{type:Number},__settingsOpen:{type:Boolean},__transcriptOption:{type:Number}}}static get tag(){return"a11y-media-player"}constructor(){super(),globalThis.ResponsiveUtility.requestAvailability(),globalThis.A11yMediaStateManager.requestAvailability(),this.__playerReady=!1,this.audioOnly=!1,this.autoplay=!1,this.allowConcurrent=!1,this.cc=!1,this.darkTranscript=!1,this.disableFullscreen=!1,this.disableInteractive=!1,this.disablePrintButton=!1,this.disableSearch=!1,this.disableScroll=!1,this.disableSeek=!1,this.hideElapsedTime=!1,this.hideTimestamps=!1,this.hideTranscript=!1,this.id=null,this.lang="en",this.learningMode=!1,this.linkable=!1,this.localization={},this.loop=!1,this.mediaTitle="",this.mediaLang="en",this.muted=!1,this.hideYoutubeLink=!1,this.preload="metadata",this.playbackRate=1,this.search=null,this.standAlone=!1,this.responsiveSize="sm",this.captionsTrack=null,this.transcriptTrack=null,this.sources=[],this.stackedLayout=!1,this.sticky=!1,this.stickyCorner="top-right",this.tracks=[],this.volume=70,this.width=null,this.youtubeId=null,this.__cues=[],this.__currentTime=0,this.__captionsOption=-1,this.__loadedTracks=null,this.__playing=!1,this.__settingsOpen=!1,this.__transcriptOption=-1,this.querySelectorAll("video,audio").forEach((t=>{t.addEventListener("loadedmetadata",(e=>{this.__preloadedDuration=t.duration}))}))}get anchor(){let t=globalThis.AnchorBehaviors;return{target:!!t&&t.getTarget(this),params:t?t.params:{}}}get aspect(){let t=this.media&&this.media.aspectRatio?this.media.aspectRatio:16/9;return null===this.width||this.width,this.style.maxWidth=this.width,t}get audioNoThumb(){return this.audioOnly&&(null===this.thumbnailSrc||void 0===this.thumbnailSrc)}get buffered(){return this.media&&this.media.buffered&&this.media.buffered>0?this.media.buffered:0}get captionCues(){return this.captionsTrack&&this.captionsTrack.cues?this.isYoutube?Object.keys(this.captionsTrack.cues).map((t=>{let e=this.captionsTrack.cues[t];return e.startTime<=this.currentTime&&e.endTime>=this.currentTime?e:{}})):this.captionsTrack.activeCues:[]}get captionsPicker(){let t={};return t[-1]=this._getLocal(this.localization,"captions","off"),Object.keys(this.loadedTracks&&this.loadedTracks.textTracks?this.loadedTracks.textTracks:{}).forEach((e=>{t[e]=this.loadedTracks.textTracks[e].label||this.loadedTracks.textTracks[e].language})),t}get captionsTrackKey(){return this.cc?this._getTrackId(this.captionsTrack):-1}get cues(){return this.__cues}get duration(){return this.media&&this.media.duration&&this.media.duration>0?this.media.duration:this.__preloadedDuration?this.__preloadedDuration:0}get flexLayout(){return this.hasCaptions&&!this.standAlone&&!this.hideTranscript&&!this.audioNoThumb&&!this.stackedLayout}get fullFlex(){return this.flexLayout&&"xs"!==this.responsiveSize&&"sm"!==this.responsiveSize}get fullscreenButton(){return this.fullscreenEnabled&&!this.disableFullscreen&&!this.audioNoThumb}get hasCaptions(){return this.cues.length>1}get isYoutube(){return!!this.youtubeId}get loadedTracks(){return this.__loadedTracks}get localizationDefaults(){return{audio:{label:"Audio",notSupported:"HTML5 video is not supported."},autoScroll:{label:"Scroll Transcript",icon:"swap-vert"},captions:{label:"Closed Captions",icon:"av:closed-caption",off:"Off"},download:{label:"Download Transcript",icon:"file-download"},forward:{label:"Forward",icon:"av:fast-forward"},fullscreen:{label:"Fullscreen",icon:"fullscreen"},copyLink:{label:"Copy Media Link",icon:"link"},closeLink:{label:"Close",icon:"close"},loading:{label:"Loading..."},loop:{label:"Loop Playback"},mute:{label:"Mute",icon:"av:volume-up"},nextResult:{label:"Next",icon:"arrow-forward"},pause:{label:"Pause",icon:"av:pause"},play:{label:"Play",icon:"av:play-arrow"},prevResult:{label:"Previous",icon:"arrow-back"},print:{label:"Print Transcript",icon:"print"},restart:{label:"Restart",icon:"av:replay"},rewind:{label:"Backward",icon:"av:fast-rewind"},search:{label:"Search the transcript.",icon:"search"},seekSlider:{label:"Seek Slider"},settings:{label:"Settings",icon:"settings"},speed:{label:"Speed %"},transcript:{label:"Transcript",icon:"description",loading:"Loading the transcript(s)...",off:"Off",skip:"Skip to the transcript."},unmute:{label:"Unmute",icon:"av:volume-off"},video:{label:"Video",notSupported:"HTML5 video is not supported."},volume:{label:"Volume"},youTubeLoading:{label:"Loading...",startLoading:"Press play."},youTubeTranscript:{label:"Transcript will load once media plays."}}}get media(){return this.isYoutube?this.youtube:this.loadedTracks}get mediaCaption(){let t=this._getLocal(this.localization,"audio","label"),e=void 0!==this.mediaTitle&&null!==this.mediaTitle&&""!==this.mediaTitle;return this.audioOnly&&e?this.mediaTitle+" ("+t+")":this.audioOnly?t:e?this.mediaTitle:void 0}get mediaEnd(){return!(!this.mediaSeekable||!this.media.seekable.end(0))&&this.media.seekable.end(0)}get mediaMaxWidth(){return`max-width:${this.fullscreen||this.audioNoThumb?"unset":`calc(${100*this.aspect}vh - ${80*this.aspect}px)`};`}get mediaSeekable(){return!(!this.media||!this.media.seekable)&&this.media.seekable.length>0}get mediaStart(){return this.mediaSeekable&&this.media.seekable.start(0)?this.media.seekable.start(0):0}get playing(){return this.__playing}get playerStyle(){return`height:${this.audioNoThumb?"60px":"unset"};padding-top:${this.fullscreen||this.audioNoThumb||this.audioOnly||this.height?"unset":100/this.aspect+"%"};${this.poster&&(this.isYoutube||this.audioOnly)?`background-image:url('${this.poster}');`:""}`}get poster(){let t=this.thumbnailSrc?this.thumbnailSrc:!(!this.media||this.media.poster)&&this.media.poster;return!this.thumbnailSrc&&this.youtubeId?`https://img.youtube.com/vi/${this.youtubeId.replace(/[\?&].*/,"")}/hqdefault.jpg`:t}get printCaption(){let t=this._getLocal(this.localization,"audio","label"),e=this._getLocal(this.localization,"video","label"),i=void 0!==this.mediaTitle&&null!==this.mediaTitle&&""!==this.mediaTitle;return this.audioOnly&&i?this.mediaTitle+" ("+t+")":this.audioOnly?t:i?this.mediaTitle+" ("+e+")":e}get currentTime(){let t=!!this.shadowRoot&&this.shadowRoot.querySelector("#slider");return t&&!t.disabled&&t.dragging?this.shadowRoot.querySelector("#slider").immediateValue:this.__currentTime}get shareLink(){let t=globalThis.location.href.split(/[#?]/)[0],e=this.id?`?id=${this.id}`:"";return`${t}${e}${""!==e&&this.currentTime&&0!==this.currentTime?`&t=${this.currentTime}`:""}`}get showCustomCaptions(){return(this.isYoutube||this.audioOnly)&&this.hasCaptions&&this.cc}get status(){return this.duration>0?e` ${this._getHHMMSS(this.currentTime,this.duration)}/${this._getHHMMSS(this.duration)} - `:this.isYoutube?this.__playing?this._getLocal(this.localization,"youTubeLoading","label"):this._getLocal(this.localization,"youTubeLoading","startLoading"):this._getLocal(this.localization,"loading","label")}get stickyMode(){return this.sticky&&"none"!==this.stickyCorner}get t(){let t=this._getSeconds(this.anchor.params.t||this.anchor.params.start||"0s");return this.anchor&&this.anchor.target===this?t:this.videoData?this.videoData.t||this.videoData.start:void 0}get transcriptCues(){return(this.cues?this.cues.slice():[]).filter((t=>t.track===this.transcriptTrack))}get transcriptPicker(){let t={};return t[-1]=this._getLocal(this.localization,"transcript","off"),Object.keys(this.loadedTracks&&this.loadedTracks.textTracks?this.loadedTracks.textTracks:{}).forEach((e=>{t[e]=this.loadedTracks.textTracks[e].label||this.loadedTracks.textTracks[e].language})),t}get transcriptTrackKey(){return this.hideTranscript?-1:this._getTrackId(this.transcriptTrack)}get videoData(){if(this.youtubeId){let t=this.youtubeId.split(/[\?\&]/),e={};return e.videoId=t[0],t.forEach(((t,i)=>{if(i>0){let i=t.split(/=/);e[i[0]]=this._getSeconds(i[1])}})),e}}get videoId(){if(this.videoData)return this.videoData.videoId}get youtube(){return null!==this.shadowRoot.querySelector("a11y-media-youtube")&&this.shadowRoot.querySelector("a11y-media-youtube")}_setAttribute(t,e){e?this.setAttribute(t,e):this.removeAttribute(t)}updated(t){super.updated&&super.updated(t),t.forEach(((t,e)=>{"learningMode"===e&&(this.disableSeek=this[e],this.hideTranscript=this[e]);let change=t=>t.includes(e),mediaChange=t=>change(["__loadedTracks","youtubeId","media",t]),i=change(["standAlone","hideTranscript","audioNoThumb","stackedLayout","__cues"]),s=this.media?this.media:this.__loadedTracks;"id"===e&&null===this.id&&(this.id="a11y-media-player"+Date.now()),change(["media","muted"])&&this._handleMuteChanged(),change(["media","volume"])&&this.setVolume(this.volume),change(["media","autoplay"])&&this.autoplay&&this.play(),"__captionsOption"===e&&this._captionsOptionChanged(),change(["cc","captionsTrack"])&&this._captionsChanged(),i&&this._setAttribute("flex-layout",this.flexLayout),(i||"responsiveSize"===e)&&this._setAttribute("full-flex",this.fullFlex),change(["sticky","sticky-corner","__playing"])&&this._setAttribute("sticky-mode",this.stickyMode&&this.__playing),change(["height"])&&(this.style.setProperty("--a11y-media-player-height",this.height?this.height:"unset"),this.style.setProperty("--a11y-media-transcript-max-height",this.height?"146px":"unset")),null!==this.media&&(mediaChange("cc")&&this._setAttribute("cc",this.cc,this.__loadedTracks),mediaChange("isYoutube")&&this.__loadedTracks&&(this.__loadedTracks.hidden,this.isYoutube),mediaChange("mediaLang")&&this._setAttribute("lang",this.mediaLang,s),mediaChange("loop")&&this._setAttribute("loop",this.loop,s),mediaChange("playbackRate")&&this._setAttribute("playbackRate",this.playbackRate,s),mediaChange("isYoutube")&&this._setAttribute("poster",!this.isYoutube&&this.thumbnailSrc,this.__loadedTracks),!change(["isYoutube","poster","media","audioOnly"])||!this.poster||this.isYoutube||this.audioOnly||this.media.poster||(this.media.poster=this.poster)),this.dispatchEvent(new CustomEvent(`${e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}-changed`,{detail:{value:this[e]}}))}))}_captionsChanged(){let t=-1;Object.keys(this.loadedTracks.textTracks).forEach((e=>{let i=this.cc&&this.loadedTracks.textTracks[e]===this.captionsTrack;this.loadedTracks.textTracks[e].mode=i?"showing":"hidden",i&&(t=e)})),this.__captionsOption=t}_captionsOptionChanged(){this.cc=this.__captionsOption>-1,Object.keys(this.loadedTracks.textTracks).forEach((t=>{let e=parseInt(t)==parseInt(this.__captionsOption);this.loadedTracks.textTracks[t].mode=e?"showing":"hidden",e&&(this.captionsTrack=this.loadedTracks.textTracks[t])}))}_handleMuteChanged(){this.media&&(this.media.muted=this.muted),this.dispatchEvent(new CustomEvent("mute-changed",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}download(){let t=globalThis.document.createElement("a"),e=this.mediaTitle&&""!=this.mediaTitle.trim()?`${this.mediaTitle} (${this._getLocal(this.localization,"transcript","label")})`:this._getLocal(this.localization,"transcript","label"),i=e.replace(/[^\w\d]/g,""),s=this.transcriptTrack.cues,o=Object.keys(s).map((t=>`${this._getHHMMSS(s[t].startTime)} - ${this._getHHMMSS(s[t].endTime)}: \t${s[t].text.replace(/[\n\r\s*]/g," ")}\n`)).join("");t.setAttribute("href","data:text/plain;charset=UTF-8,"+encodeURIComponent(e+"\n"+o)),t.setAttribute("download",i+".txt"),t.style.display="none",globalThis.document.body.appendChild(t),t.click(),globalThis.document.body.removeChild(t),this.dispatchEvent(new CustomEvent("transcript-downloaded",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}goToYoutube(){globalThis.open(`https://www.youtube.com/watch?v=${this.youtubeId}`)}print(){let t=this.transcriptTrack.cues,e=this.mediaTitle&&""!=this.mediaTitle.trim()?`${this.mediaTitle} (${this._getLocal(this.localization,"transcript","label")})`:this._getLocal(this.localization,"transcript","label"),i=globalThis.open("","","left=0,top=0,width=552,height=477,toolbar=0,scrollbars=0,status =0");i.document.body.innerHTML=`\n

${e}

\n ${Object.keys(t).map((e=>`
\n ${this.hideTimestamps?"":`\n \n ${this._getHHMMSS(t[e].startTime)} - \n ${this._getHHMMSS(t[e].endTime)}:\n `}\n \n ${t[e].text}\n \n
`)).join("")}\n `,i.document.close(),i.focus(),i.print(),i.addEventListener("afterprint",(t=>{i.close()})),this.dispatchEvent(new CustomEvent("transcript-printed",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}play(){this.__playing=!0,this.media&&this.media.play&&this.media.play(),this.dispatchEvent(new CustomEvent("play",{bubbles:!0,composed:!0,cancelable:!1,detail:this})),this.dispatchEvent(new CustomEvent("a11y-player-playing",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}pause(){this.__playing=!1,this.media&&this.media.pause&&this.media.pause(),this.dispatchEvent(new CustomEvent("pause",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}stop(){this.pause(),this.seek(0),this.dispatchEvent(new CustomEvent("stop",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}restart(){this.seek(0),this.play(),this.dispatchEvent(new CustomEvent("restart",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}rewind(t){t=void 0!==t?t:this.duration/20,this.seek(this.currentTime-t,0),this.dispatchEvent(new CustomEvent("backward",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}forward(t){t=void 0!==t?t:this.duration/20,this.seek(this.currentTime+t),this.dispatchEvent(new CustomEvent("forward",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}seek(t=0){this.mediaSeekable&&(this.media.seek(Math.max(0,Math.min(t,this.duration))),this._handleTimeUpdate(),this.dispatchEvent(new CustomEvent("seek",{bubbles:!0,composed:!0,cancelable:!1,detail:this})))}selectCaptionByKeyEvent(t){this.selectCaptionByKey(t.detail.value)}selectCaptionByKey(t){(t=parseInt(t))>-1&&(this.captionsTrack=this.loadedTracks.textTracks[t]),this.cc=t>-1}selectTranscriptByKeyEvent(t){this.selectTranscriptByKey(t.detail.value)}selectTranscriptByKey(t){(t=parseInt(t))>-1&&(this.transcriptTrack=this.loadedTracks.textTracks[t]),this.hideTranscript=t<0}getloadedTracks(){let t=this.querySelector("audio,video"),e=t?t.getAttribute("crossorigin"):void 0,i=null,s=this.source&&!this.source&&this.source.match(/webm|ogv|mov|mp4$/),o=(this.sources||[]).filter((t=>`${t.type||""}${t.kind||""}`.match(/video|mp4|webm|ogv/))).length>0,l=this.isYoutube||s||o;if(t&&(e||t.setAttribute("crossorigin",this.crossorigin),t.removeAttribute("autoplay"),t.removeAttribute("controls"),t.setAttribute("preload","metadata")),!this.youtubeId){let t=!(!this.querySelector("iframe")||!this.querySelector("iframe"))&&this.querySelector("iframe").src;!!t&&(t.match(/youtube(-\w*)*.com/)||t.src.match(/youtu.be/))&&t&&(this.youtubeId=t.replace(/.*\//g,""),l=!0,this.querySelector("iframe").remove())}return t?i=t:(i=globalThis.document.createElement(this.querySelectorAll('source[type*="audio"]').length>0||!l?"audio":"video"),e||i.setAttribute("crossorigin",this.crossorigin),i.setAttribute("preload","metadata"),this.querySelectorAll("source,track").forEach((t=>{t.parentNode===this&&i.appendChild(t)})),this.appendChild(i)),this.audioOnly="AUDIO"===i.tagName,i.style.width="100%",i.style.maxWidth="100%",(this.tracks||[]).forEach((t=>{let e=globalThis.document.createElement("track");Object.keys(t).forEach((i=>e.setAttribute(i,t[i]))),i.appendChild(e)})),(this.sources||[]).forEach((t=>{let e=globalThis.document.createElement("source");Object.keys(t).forEach((i=>e.setAttribute(i,t[i]))),i.appendChild(e)})),i.seek=t=>i.currentTime=t,this._addSourcesAndTracks(i,i),i}_getTrack(t){if(!t){let t=this.loadedTracks.textTracks.filter((t=>!0===t.default));return t?t[0].track:this.loadedTracks.textTracks[0].track}return t}selectTranscript(t){this.transcriptTrack=this._getTrack(t)}setPlaybackRate(t){t=null!==t?t:1,this.media.playbackRate=null!==t?t:1,globalThis.dispatchEvent(new CustomEvent("playback-rate-changed",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}setVolume(t=70){this.volume=Math.max(0,Math.min(t,100)),this.media&&(this.media.volume=t/100),globalThis.dispatchEvent(new CustomEvent("volume-changed",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}toggleCC(t){this.cc=void 0===t?!this.cc:t,globalThis.dispatchEvent(new CustomEvent("cc-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}get fullscreenTarget(){return this.shadowRoot&&this.shadowRoot.querySelector("#player-section")?this.shadowRoot.querySelector("#player-section"):this}toggleFullscreen(t){super.toggleFullscreen(t),globalThis.dispatchEvent(new CustomEvent("fullscreen-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}toggleLoop(t){this.loop=void 0===t?!this.loop:t,this.media.loop=!0===t,globalThis.dispatchEvent(new CustomEvent("loop-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}togglePlay(){this.__playing?this.pause():this.play(),globalThis.dispatchEvent(new CustomEvent("play-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}toggleMute(t){this.muted=void 0===t?!this.muted:t,globalThis.dispatchEvent(new CustomEvent("muted-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}toggleSettings(t){t=void 0===t?!this.__settingsOpen:t,this.__settingsOpen=t,this.dispatchEvent(new CustomEvent("settings-toggled",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}toggleSticky(t){t=void 0===t?!this.sticky:t,this.sticky!==t&&(this.sticky=t,this.dispatchEvent(new CustomEvent("player-sticky",{bubbles:!0,composed:!0,cancelable:!1,detail:this})))}toggleTranscript(t){(t=void 0===t?this.hideTranscript:t)&&!this.selectTranscriptByKey>-1&&this.selectTranscriptByKey(0),this.hideTranscript=!t,this.dispatchEvent(new CustomEvent("transcript-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}_addSourcesAndTracks(t){t.style.width="100%",t.style.maxWidth="100%",Object.keys(t.textTracks).forEach((e=>this._onAddTrack(t.textTracks[e]))),t.textTracks.onremovetrack=t=>this._onRemoveTrack(t.track),t.textTracks.onaddtrack=t=>this._onAddTrack(t.track);let e=t.querySelector("track[default]")?t.querySelector("track[default]"):t.querySelector("track"),i=Object.keys(t.textTracks).find((i=>e.label===t.textTracks[i].label&&e.kind===t.textTracks[i].kind&&e.srclang===t.textTracks[i].scrlang))||0;this.captionsTrack=t.textTracks[i],this.hideTranscript||(this.transcriptTrack=this.captionsTrack),this._handleTimeUpdate()}_handleCloseLink(){this.shadowRoot.querySelector("#link")&&this.shadowRoot.querySelector("#link").close&&this.shadowRoot.querySelector("#link").close()}_handleCopyLink(){let t=globalThis.document.createElement("textarea");this.pause(),t.value=this.shareLink,globalThis.document.body.appendChild(t),t.select(),globalThis.document.execCommand("copy"),globalThis.document.body.removeChild(t),globalThis.SimpleToast.requestAvailability().showSimpleToast({detail:{duration:3e3,text:`Copied to clipboard: ${this.shareLink}`}})}_handleCueSeek(t){this.standAlone||this.seek(t.startTime)}_handleMediaLoaded(t){this._handleTimeUpdate(),this.youtubeId||this.anchor.target!==this||this.seek(this._getSeconds(this.anchor.params.t||this.anchor.params.start||"0s"))}_handleSearchAdded(t){this.search=t.detail}_handleSpeedChanged(t){var e=l(t)[0];this.setPlaybackRate(e.value)}_handleSliderDragging(t){let e=!!this.shadowRoot&&this.shadowRoot.querySelector("#slider");if(e&&!e.disabled&&e.dragging&&this.__playing&&e.dragging){let t=setInterval((()=>{e.dragging||(this.play(),clearInterval(t))}));this.pause()}}_handleSliderChanged(t){let e=!!this.shadowRoot&&this.shadowRoot.querySelector("#slider");this.playing&&e.immediateValue!=this.__currentTime||this.seek(e.immediateValue)}_handleTimeUpdate(){this.__wait||(this.__currentTime=this.media&&this.media.currentTime&&this.media.currentTime>0?this.media.currentTime:0,this.__wait=!0,setTimeout((()=>{this.__wait=!1}),1e3))}_getTrackId(t){return this.loadedTracks&&Object.keys(this.loadedTracks.textTracks).find((e=>this.loadedTracks.textTracks[e]===t))||-1}_handleVolumeChanged(t){var e=l(t)[0];this.volume=e.value}_onAddTrack(t){null===this.captionsTrack&&(this.captionsTrack=t),t&&(t.mode="hidden");let e=setInterval((()=>{if(t.cues&&t.cues.length>0){clearInterval(e);let i=Object.keys(t.cues).map((e=>t.cues[e]));this._onRemoveTrack(t),this.__cues=this.cues.concat(i).sort(((t,e)=>{let i=t.startTime-e.startTime,s=t.endTime-e.endTime;return 0!==i?i:0!==s?s:t.track-e.track}))}}))}_onRemoveTrack(t){this.loadedTracks&&this.loadedTracks.textTracks&&Object.keys(this.loadedTracks.textTracks).filter((e=>this.loadedTracks.textTracks[e]!==t)),this.__cues=this.cues?this.cues.filter((e=>e.track!==t)):[]}firstUpdated(t){super.firstUpdated&&super.firstUpdated(t),this.style.setProperty("--a11y-media-transcript-max-height",this.height?"146px":"unset"),this.__loadedTracks=this.getloadedTracks(),this._handleMediaLoaded(),this.__loadedTracks.addEventListener("loadedmetadata",(t=>this._handleMediaLoaded(t))),this.__loadedTracks.addEventListener("timeupdate",(t=>{this._handleTimeUpdate(t)})),globalThis.dispatchEvent(new CustomEvent("responsive-element",{detail:{element:this,attribute:"responsive-size",relativeToParent:!0,sm:400,md:700,lg:1e3,xl:1500}})),globalThis.dispatchEvent(new CustomEvent("a11y-player",{bubbles:!0,composed:!0,cancelable:!1,detail:this})),this.__playerReady=!0}_setActiveCue(t){let e=t.detail.element,i=e.parentNode,s=null!=i?i.offsetTop:0;if(!this.disableScroll){let scrollingTo=(t,e,i)=>{if(!(i<=0)){var s=(e-t.scrollTop)/i*10;setTimeout((()=>{t.scrollTop=t.scrollTop+s,t.scrollTop!==e&&scrollingTo(t,e,i-10)}),10)}};scrollingTo(e.parentNode.parentNode,e.offsetTop-s,250)}}_transcriptScroll(t){this.disableScroll=!this.disableScroll}_getHHMMSS(t,e){t=parseFloat(t),e=void 0===e?t:parseFloat(e);let a=t=>t<10?`0${t}`:t,b=(t,i,s)=>e>=i?a(Math.floor(t/i))+":":s;return b(t,3600,"")+b(t%3600,60,"00:")+a(Math.round(t%60))}_getSeconds(t=0){let e=t.replace(/[hm]{1,2}&?/g,":0").replace(/[s]{1,2}$/g,"").split(/:/);return 3600*(e.length>2?parseInt(e[e.length-3]):0)+60*(e.length>1?parseInt(e[e.length-2]):0)+(e.length>0?parseFloat(e[e.length-1]):0)}_getLocal(t,e,i){let s="";return void 0!==t&&void 0!==t[e]&&void 0!==t[e][i]?s=t[e][i]:void 0!==this.localizationDefaults&&void 0!==this.localizationDefaults[e]&&void 0!==this.localizationDefaults[e][i]&&(s=this.localizationDefaults[e][i]),s}}customElements.define(A11yMediaPlayer.tag,A11yMediaPlayer);export{A11yMediaPlayer}; \ No newline at end of file + `:this.isYoutube?this.__playing?this._getLocal(this.localization,"youTubeLoading","label"):this._getLocal(this.localization,"youTubeLoading","startLoading"):this._getLocal(this.localization,"loading","label")}get stickyMode(){return this.sticky&&"none"!==this.stickyCorner}get t(){let t=this._getSeconds(this.anchor.params.t||this.anchor.params.start||"0s");return this.anchor&&this.anchor.target===this?t:this.videoData?this.videoData.t||this.videoData.start:void 0}get transcriptCues(){return(this.cues?this.cues.slice():[]).filter((t=>t.track===this.transcriptTrack))}get transcriptPicker(){let t={};return t[-1]=this._getLocal(this.localization,"transcript","off"),Object.keys(this.loadedTracks&&this.loadedTracks.textTracks?this.loadedTracks.textTracks:{}).forEach((e=>{t[e]=this.loadedTracks.textTracks[e].label||this.loadedTracks.textTracks[e].language})),t}get transcriptTrackKey(){return this.hideTranscript?-1:this._getTrackId(this.transcriptTrack)}get videoData(){if(this.youtubeId){let t=this.youtubeId.split(/[\?\&]/),e={};return e.videoId=t[0],t.forEach(((t,i)=>{if(i>0){let i=t.split(/=/);e[i[0]]=this._getSeconds(i[1])}})),e}}get videoId(){if(this.videoData)return this.videoData.videoId}get youtube(){return null!==this.shadowRoot.querySelector("a11y-media-youtube")&&this.shadowRoot.querySelector("a11y-media-youtube")}_setAttribute(t,e){e?this.setAttribute(t,e):this.removeAttribute(t)}updated(t){super.updated&&super.updated(t),t.forEach(((t,e)=>{"learningMode"===e&&void 0!==t&&(this.disableSeek=this[e],this.hideTranscript=this[e]);let change=t=>t.includes(e),mediaChange=t=>change(["__loadedTracks","youtubeId","media",t]),i=change(["standAlone","hideTranscript","audioNoThumb","stackedLayout","__cues"]),s=this.media?this.media:this.__loadedTracks;"id"===e&&null===this.id&&(this.id="a11y-media-player"+Date.now()),change(["media","muted"])&&this._handleMuteChanged(),change(["media","volume"])&&this.setVolume(this.volume),change(["media","autoplay"])&&this.autoplay&&this.play(),"__captionsOption"===e&&this._captionsOptionChanged(),change(["cc","captionsTrack"])&&this._captionsChanged(),i&&this._setAttribute("flex-layout",this.flexLayout),(i||"responsiveSize"===e)&&this._setAttribute("full-flex",this.fullFlex),change(["sticky","sticky-corner","__playing"])&&this._setAttribute("sticky-mode",this.stickyMode&&this.__playing),change(["height"])&&(this.style.setProperty("--a11y-media-player-height",this.height?this.height:"unset"),this.style.setProperty("--a11y-media-transcript-max-height",this.height?"146px":"unset")),null!==this.media&&(mediaChange("cc")&&this._setAttribute("cc",this.cc,this.__loadedTracks),mediaChange("isYoutube")&&this.__loadedTracks&&(this.__loadedTracks.hidden,this.isYoutube),mediaChange("mediaLang")&&this._setAttribute("lang",this.mediaLang,s),mediaChange("loop")&&this._setAttribute("loop",this.loop,s),mediaChange("playbackRate")&&this._setAttribute("playbackRate",this.playbackRate,s),mediaChange("isYoutube")&&this._setAttribute("poster",!this.isYoutube&&this.thumbnailSrc,this.__loadedTracks),!change(["isYoutube","poster","media","audioOnly"])||!this.poster||this.isYoutube||this.audioOnly||this.media.poster||(this.media.poster=this.poster)),this.dispatchEvent(new CustomEvent(`${e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}-changed`,{detail:{value:this[e]}}))}))}_captionsChanged(){let t=-1;Object.keys(this.loadedTracks.textTracks).forEach((e=>{let i=this.cc&&this.loadedTracks.textTracks[e]===this.captionsTrack;this.loadedTracks.textTracks[e].mode=i?"showing":"hidden",i&&(t=e)})),this.__captionsOption=t}_captionsOptionChanged(){this.cc=this.__captionsOption>-1,Object.keys(this.loadedTracks.textTracks).forEach((t=>{let e=parseInt(t)==parseInt(this.__captionsOption);this.loadedTracks.textTracks[t].mode=e?"showing":"hidden",e&&(this.captionsTrack=this.loadedTracks.textTracks[t])}))}_handleMuteChanged(){this.media&&(this.media.muted=this.muted),this.dispatchEvent(new CustomEvent("mute-changed",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}download(){let t=globalThis.document.createElement("a"),e=this.mediaTitle&&""!=this.mediaTitle.trim()?`${this.mediaTitle} (${this._getLocal(this.localization,"transcript","label")})`:this._getLocal(this.localization,"transcript","label"),i=e.replace(/[^\w\d]/g,""),s=this.transcriptTrack.cues,o=Object.keys(s).map((t=>`${this._getHHMMSS(s[t].startTime)} - ${this._getHHMMSS(s[t].endTime)}: \t${s[t].text.replace(/[\n\r\s*]/g," ")}\n`)).join("");t.setAttribute("href","data:text/plain;charset=UTF-8,"+encodeURIComponent(e+"\n"+o)),t.setAttribute("download",i+".txt"),t.style.display="none",globalThis.document.body.appendChild(t),t.click(),globalThis.document.body.removeChild(t),this.dispatchEvent(new CustomEvent("transcript-downloaded",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}goToYoutube(){globalThis.open(`https://www.youtube.com/watch?v=${this.youtubeId}`)}print(){let t=this.transcriptTrack.cues,e=this.mediaTitle&&""!=this.mediaTitle.trim()?`${this.mediaTitle} (${this._getLocal(this.localization,"transcript","label")})`:this._getLocal(this.localization,"transcript","label"),i=globalThis.open("","","left=0,top=0,width=552,height=477,toolbar=0,scrollbars=0,status =0");i.document.body.innerHTML=`\n

${e}

\n ${Object.keys(t).map((e=>`
\n ${this.hideTimestamps?"":`\n \n ${this._getHHMMSS(t[e].startTime)} - \n ${this._getHHMMSS(t[e].endTime)}:\n `}\n \n ${t[e].text}\n \n
`)).join("")}\n `,i.document.close(),i.focus(),i.print(),i.addEventListener("afterprint",(t=>{i.close()})),this.dispatchEvent(new CustomEvent("transcript-printed",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}play(){this.__playing=!0,this.media&&this.media.play&&this.media.play(),this.dispatchEvent(new CustomEvent("play",{bubbles:!0,composed:!0,cancelable:!1,detail:this})),this.dispatchEvent(new CustomEvent("a11y-player-playing",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}pause(){this.__playing=!1,this.media&&this.media.pause&&this.media.pause(),this.dispatchEvent(new CustomEvent("pause",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}stop(){this.pause(),this.seek(0),this.dispatchEvent(new CustomEvent("stop",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}restart(){this.seek(0),this.play(),this.dispatchEvent(new CustomEvent("restart",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}rewind(t){t=void 0!==t?t:this.duration/20,this.seek(this.currentTime-t,0),this.dispatchEvent(new CustomEvent("backward",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}forward(t){t=void 0!==t?t:this.duration/20,this.seek(this.currentTime+t),this.dispatchEvent(new CustomEvent("forward",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}seek(t=0){this.mediaSeekable&&(this.media.seek(Math.max(0,Math.min(t,this.duration))),this._handleTimeUpdate(),this.dispatchEvent(new CustomEvent("seek",{bubbles:!0,composed:!0,cancelable:!1,detail:this})))}selectCaptionByKeyEvent(t){this.selectCaptionByKey(t.detail.value)}selectCaptionByKey(t){(t=parseInt(t))>-1&&(this.captionsTrack=this.loadedTracks.textTracks[t]),this.cc=t>-1}selectTranscriptByKeyEvent(t){this.__playerReady&&this.__settingsOpen&&this.selectTranscriptByKey(t.detail.value)}selectTranscriptByKey(t){(t=parseInt(t))>-1&&(this.transcriptTrack=this.loadedTracks.textTracks[t]),this.hideTranscript=t<0}getloadedTracks(){let t=this.querySelector("audio,video"),e=t?t.getAttribute("crossorigin"):void 0,i=null,s=this.source&&!this.source&&this.source.match(/webm|ogv|mov|mp4$/),o=(this.sources||[]).filter((t=>`${t.type||""}${t.kind||""}`.match(/video|mp4|webm|ogv/))).length>0,l=this.isYoutube||s||o;if(t&&(e||t.setAttribute("crossorigin",this.crossorigin),t.removeAttribute("autoplay"),t.removeAttribute("controls"),t.setAttribute("preload","metadata")),!this.youtubeId){let t=!(!this.querySelector("iframe")||!this.querySelector("iframe"))&&this.querySelector("iframe").src;!!t&&(t.match(/youtube(-\w*)*.com/)||t.src.match(/youtu.be/))&&t&&(this.youtubeId=t.replace(/.*\//g,""),l=!0,this.querySelector("iframe").remove())}return t?i=t:(i=globalThis.document.createElement(this.querySelectorAll('source[type*="audio"]').length>0||!l?"audio":"video"),e||i.setAttribute("crossorigin",this.crossorigin),i.setAttribute("preload","metadata"),this.querySelectorAll("source,track").forEach((t=>{t.parentNode===this&&i.appendChild(t)})),this.appendChild(i)),this.audioOnly="AUDIO"===i.tagName,i.style.width="100%",i.style.maxWidth="100%",(this.tracks||[]).forEach((t=>{let e=globalThis.document.createElement("track");Object.keys(t).forEach((i=>e.setAttribute(i,t[i]))),i.appendChild(e)})),(this.sources||[]).forEach((t=>{let e=globalThis.document.createElement("source");Object.keys(t).forEach((i=>e.setAttribute(i,t[i]))),i.appendChild(e)})),i.seek=t=>i.currentTime=t,this._addSourcesAndTracks(i,i),i}_getTrack(t){if(!t){let t=this.loadedTracks.textTracks.filter((t=>!0===t.default));return t?t[0].track:this.loadedTracks.textTracks[0].track}return t}selectTranscript(t){this.transcriptTrack=this._getTrack(t)}setPlaybackRate(t){t=null!==t?t:1,this.media.playbackRate=null!==t?t:1,globalThis.dispatchEvent(new CustomEvent("playback-rate-changed",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}setVolume(t=70){this.volume=Math.max(0,Math.min(t,100)),this.media&&(this.media.volume=t/100),globalThis.dispatchEvent(new CustomEvent("volume-changed",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}toggleCC(t){this.cc=void 0===t?!this.cc:t,globalThis.dispatchEvent(new CustomEvent("cc-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}get fullscreenTarget(){return this.shadowRoot&&this.shadowRoot.querySelector("#player-section")?this.shadowRoot.querySelector("#player-section"):this}toggleFullscreen(t){super.toggleFullscreen(t),globalThis.dispatchEvent(new CustomEvent("fullscreen-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}toggleLoop(t){this.loop=void 0===t?!this.loop:t,this.media.loop=!0===t,globalThis.dispatchEvent(new CustomEvent("loop-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}togglePlay(){this.__playing?this.pause():this.play(),globalThis.dispatchEvent(new CustomEvent("play-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}toggleMute(t){this.muted=void 0===t?!this.muted:t,globalThis.dispatchEvent(new CustomEvent("muted-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}toggleSettings(t){t=void 0===t?!this.__settingsOpen:t,this.__settingsOpen=t,this.dispatchEvent(new CustomEvent("settings-toggled",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}toggleSticky(t){t=void 0===t?!this.sticky:t,this.sticky!==t&&(this.sticky=t,this.dispatchEvent(new CustomEvent("player-sticky",{bubbles:!0,composed:!0,cancelable:!1,detail:this})))}toggleTranscript(t){(t=void 0===t?this.hideTranscript:t)&&!this.selectTranscriptByKey>-1&&this.selectTranscriptByKey(0),this.hideTranscript=!t,this.dispatchEvent(new CustomEvent("transcript-toggle",{bubbles:!0,composed:!0,cancelable:!1,detail:this}))}_addSourcesAndTracks(t){t.style.width="100%",t.style.maxWidth="100%",Object.keys(t.textTracks).forEach((e=>this._onAddTrack(t.textTracks[e]))),t.textTracks.onremovetrack=t=>this._onRemoveTrack(t.track),t.textTracks.onaddtrack=t=>this._onAddTrack(t.track);let e=t.querySelector("track[default]")?t.querySelector("track[default]"):t.querySelector("track"),i=Object.keys(t.textTracks).find((i=>e.label===t.textTracks[i].label&&e.kind===t.textTracks[i].kind&&e.srclang===t.textTracks[i].scrlang))||0;this.captionsTrack=t.textTracks[i],this.hideTranscript||(this.transcriptTrack=this.captionsTrack),this._handleTimeUpdate()}_handleCloseLink(){this.shadowRoot.querySelector("#link")&&this.shadowRoot.querySelector("#link").close&&this.shadowRoot.querySelector("#link").close()}_handleCopyLink(){let t=globalThis.document.createElement("textarea");this.pause(),t.value=this.shareLink,globalThis.document.body.appendChild(t),t.select(),globalThis.document.execCommand("copy"),globalThis.document.body.removeChild(t),globalThis.SimpleToast.requestAvailability().showSimpleToast({detail:{duration:3e3,text:`Copied to clipboard: ${this.shareLink}`}})}_handleCueSeek(t){this.standAlone||this.seek(t.startTime)}_handleMediaLoaded(t){this._handleTimeUpdate(),this.youtubeId||this.anchor.target!==this||this.seek(this._getSeconds(this.anchor.params.t||this.anchor.params.start||"0s"))}_handleSearchAdded(t){this.search=t.detail}_handleSpeedChanged(t){var e=l(t)[0];this.setPlaybackRate(e.value)}_handleSliderDragging(t){let e=!!this.shadowRoot&&this.shadowRoot.querySelector("#slider");if(e&&!e.disabled&&e.dragging&&this.__playing&&e.dragging){let t=setInterval((()=>{e.dragging||(this.play(),clearInterval(t))}));this.pause()}}_handleSliderChanged(t){let e=!!this.shadowRoot&&this.shadowRoot.querySelector("#slider");this.playing&&e.immediateValue!=this.__currentTime||this.seek(e.immediateValue)}_handleTimeUpdate(){this.__wait||(this.__currentTime=this.media&&this.media.currentTime&&this.media.currentTime>0?this.media.currentTime:0,this.__wait=!0,setTimeout((()=>{this.__wait=!1}),1e3))}_getTrackId(t){return this.loadedTracks&&Object.keys(this.loadedTracks.textTracks).find((e=>this.loadedTracks.textTracks[e]===t))||-1}_handleVolumeChanged(t){var e=l(t)[0];this.volume=e.value}_onAddTrack(t){null===this.captionsTrack&&(this.captionsTrack=t),t&&(t.mode="hidden");let e=setInterval((()=>{if(t.cues&&t.cues.length>0){clearInterval(e);let i=Object.keys(t.cues).map((e=>t.cues[e]));this._onRemoveTrack(t),this.__cues=this.cues.concat(i).sort(((t,e)=>{let i=t.startTime-e.startTime,s=t.endTime-e.endTime;return 0!==i?i:0!==s?s:t.track-e.track}))}}))}_onRemoveTrack(t){this.loadedTracks&&this.loadedTracks.textTracks&&Object.keys(this.loadedTracks.textTracks).filter((e=>this.loadedTracks.textTracks[e]!==t)),this.__cues=this.cues?this.cues.filter((e=>e.track!==t)):[]}firstUpdated(t){super.firstUpdated&&super.firstUpdated(t),this.style.setProperty("--a11y-media-transcript-max-height",this.height?"146px":"unset"),this.__loadedTracks=this.getloadedTracks(),this._handleMediaLoaded(),this.__loadedTracks.addEventListener("loadedmetadata",(t=>this._handleMediaLoaded(t))),this.__loadedTracks.addEventListener("timeupdate",(t=>{this._handleTimeUpdate(t)})),globalThis.dispatchEvent(new CustomEvent("responsive-element",{detail:{element:this,attribute:"responsive-size",relativeToParent:!0,sm:400,md:700,lg:1e3,xl:1500}})),globalThis.dispatchEvent(new CustomEvent("a11y-player",{bubbles:!0,composed:!0,cancelable:!1,detail:this})),this.__playerReady=!0}_setActiveCue(t){let e=t.detail.element,i=e.parentNode,s=null!=i?i.offsetTop:0;if(!this.disableScroll){let scrollingTo=(t,e,i)=>{if(!(i<=0)){var s=(e-t.scrollTop)/i*10;setTimeout((()=>{t.scrollTop=t.scrollTop+s,t.scrollTop!==e&&scrollingTo(t,e,i-10)}),10)}};scrollingTo(e.parentNode.parentNode,e.offsetTop-s,250)}}_transcriptScroll(t){this.disableScroll=!this.disableScroll}_getHHMMSS(t,e){t=parseFloat(t),e=void 0===e?t:parseFloat(e);let a=t=>t<10?`0${t}`:t,b=(t,i,s)=>e>=i?a(Math.floor(t/i))+":":s;return b(t,3600,"")+b(t%3600,60,"00:")+a(Math.round(t%60))}_getSeconds(t=0){let e=t.replace(/[hm]{1,2}&?/g,":0").replace(/[s]{1,2}$/g,"").split(/:/);return 3600*(e.length>2?parseInt(e[e.length-3]):0)+60*(e.length>1?parseInt(e[e.length-2]):0)+(e.length>0?parseFloat(e[e.length-1]):0)}_getLocal(t,e,i){let s="";return void 0!==t&&void 0!==t[e]&&void 0!==t[e][i]?s=t[e][i]:void 0!==this.localizationDefaults&&void 0!==this.localizationDefaults[e]&&void 0!==this.localizationDefaults[e][i]&&(s=this.localizationDefaults[e][i]),s}}customElements.define(A11yMediaPlayer.tag,A11yMediaPlayer);export{A11yMediaPlayer}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/accent-card/accent-card.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/accent-card/accent-card.js index 4447a307..4eef9621 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/accent-card/accent-card.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/accent-card/accent-card.js @@ -326,4 +326,4 @@ import{html as t,css as e}from"../../lit/index.js";import{IntersectionObserverMi - `}static get haxProperties(){return{type:"grid",canScale:!0,canEditSource:!0,contentEditable:!0,gizmo:{title:"Card",description:"A card with optional accent styling.",icon:"chrome-reader-mode",color:"light-blue",tags:["Layout","content","card","Image","Presentation","style"],handles:[{type:"media",url:"source"},{type:"image"},{type:"text",url:"source"}],meta:{author:"HAXTheWeb core team",owner:"The Pennsylvania State University"}},settings:{configure:[{slot:"heading",title:"Heading",description:"A heading for card.",inputMethod:"textfield",slotWrapper:"h3",allowedSlotWrappers:["h3","h4","h5","h6"]},{slot:"subheading",title:"Subheading",description:"An optional subheading for card.",inputMethod:"textfield",slotWrapper:"p",allowedSlotWrappers:["div","p","h4","h5","h6"]},{slot:"content",title:"Content",description:"Content for card.",inputMethod:"textfield",slotWrapper:"p"},{slot:"footer",title:"Footer",description:"An optional footer for card.",inputMethod:"textfield",slotWrapper:"p",allowedSlotWrappers:["div","p"]},{property:"imageSrc",title:"Image",description:"Optional image",inputMethod:"haxupload",noVoiceRecord:!0,icon:"editor:insert-photo"},{property:"imageAlign",title:"imageAlign",description:"Image Horizontal Alignment",inputMethod:"select",options:{left:"left",center:"center",right:"right"}},{property:"imageValign",title:"imageValign",description:"Image Vertical Alignment",inputMethod:"select",options:{top:"top",center:"center",bottom:"bottom"}},{property:"accentColor",title:"Accent Color",description:"An optional accent color.",inputMethod:"colorpicker",icon:"editor:format-color-fill"},{property:"dark",title:"Dark Theme",description:"Enable Dark Theme",inputMethod:"boolean",icon:"icons:invert-colors"},{property:"horizontal",title:"Horizontal",description:"Horizontal orientation?",inputMethod:"boolean"},{property:"accentHeading",title:"Heading Accent",description:"Apply accent color to heading?",inputMethod:"boolean"},{property:"accentBackground",title:"Background Accent",description:"Apply accent color to card background?",inputMethod:"boolean"},{property:"noBorder",title:"No Border Accent",description:"Remove border accent?",inputMethod:"boolean"},{property:"flat",title:"Flat",description:"Remove box shadow?",inputMethod:"boolean"}],advanced:[{slot:"corner",title:"Corner",description:"Content for card corner.",inputMethod:"textfield",slotWrapper:"div",allowedSlotWrappers:["div","p"]}]},demoSchema:[{tag:"accent-card",properties:{accentColor:"red",accentHeading:!0,horizontal:!0,imageSrc:"http://placekitten.com/200/600"},content:'

Accent Card

A card with optional accent stylings.

This card is highly customizable to contain any content you\'d like

'}],saveOptions:{unsetAttributes:["colors","element-visible"]}}}constructor(){super(),this.accentBackground=!1,this.accentHeading=!1,this.flat=!1,this.horizontal=!1,this.imageAlign=null,this.imageSrc=null,this.imageValign=null,this.noBorder=!1,this.ready=!1,this.link=null,this.icon="icons:add-circle-outline"}firstUpdated(t){super.firstUpdated&&super.firstUpdated(t),setTimeout((()=>{this.ready=!0}),100)}static get properties(){return{...super.properties||{},accentBackground:{type:Boolean,attribute:"accent-background",reflect:!0},accentHeading:{type:Boolean,attribute:"accent-heading",reflect:!0},flat:{type:Boolean,reflect:!0},horizontal:{type:Boolean,reflect:!0},imageAlign:{type:String,attribute:"image-align",reflect:!0},imageSrc:{type:String,attribute:"image-src"},imageValign:{type:String,attribute:"image-valign",reflect:!0},noBorder:{type:Boolean,attribute:"no-border",reflect:!0},ready:{type:Boolean,reflect:!0},link:{type:String,reflect:!0},iconSize:{type:String,reflect:!0,attribute:"icon-size"},imageWidth:{type:String,reflect:!0,attribute:"image-width"}}}}customElements.define(AccentCard.tag,AccentCard);export{AccentCard}; \ No newline at end of file + `}static get haxProperties(){return{type:"grid",canScale:!0,canEditSource:!0,contentEditable:!0,gizmo:{title:"Card",description:"A card with optional accent styling.",icon:"chrome-reader-mode",color:"light-blue",tags:["Layout","content","card","Image","Presentation","style"],handles:[{type:"media",url:"source"},{type:"image"},{type:"text",url:"source"}],meta:{author:"HAXTheWeb core team",owner:"The Pennsylvania State University"}},settings:{configure:[{slot:"heading",title:"Heading",description:"A heading for card.",inputMethod:"textfield",slotWrapper:"h3",allowedSlotWrappers:["h3","h4","h5","h6"]},{slot:"subheading",title:"Subheading",description:"An optional subheading for card.",inputMethod:"textfield",slotWrapper:"p",allowedSlotWrappers:["div","p","h4","h5","h6"]},{slot:"content",title:"Content",description:"Content for card.",inputMethod:"textfield",slotWrapper:"p"},{slot:"footer",title:"Footer",description:"An optional footer for card.",inputMethod:"textfield",slotWrapper:"p",allowedSlotWrappers:["div","p"]},{property:"imageSrc",title:"Image",description:"Optional image",inputMethod:"haxupload",noVoiceRecord:!0,icon:"editor:insert-photo"},{property:"imageAlign",title:"imageAlign",description:"Image Horizontal Alignment",inputMethod:"select",options:{left:"left",center:"center",right:"right"}},{property:"imageValign",title:"imageValign",description:"Image Vertical Alignment",inputMethod:"select",options:{top:"top",center:"center",bottom:"bottom"}},{property:"accentColor",title:"Accent Color",description:"An optional accent color.",inputMethod:"colorpicker",icon:"editor:format-color-fill"},{property:"dark",title:"Dark Theme",description:"Enable Dark Theme",inputMethod:"boolean",icon:"icons:invert-colors"},{property:"horizontal",title:"Horizontal",description:"Horizontal orientation?",inputMethod:"boolean"},{property:"accentHeading",title:"Heading Accent",description:"Apply accent color to heading?",inputMethod:"boolean"},{property:"accentBackground",title:"Background Accent",description:"Apply accent color to card background?",inputMethod:"boolean"},{property:"noBorder",title:"No Border Accent",description:"Remove border accent?",inputMethod:"boolean"},{property:"flat",title:"Flat",description:"Remove box shadow?",inputMethod:"boolean"}],advanced:[{slot:"corner",title:"Corner",description:"Content for card corner.",inputMethod:"textfield",slotWrapper:"div",allowedSlotWrappers:["div","p"]}]},demoSchema:[{tag:"accent-card",properties:{accentColor:"red",accentHeading:!0,horizontal:!0,imageSrc:"https://placehold.co/500x300"},content:'

Accent Card

A card with optional accent stylings.

This card is highly customizable to contain any content you\'d like

'}],saveOptions:{unsetAttributes:["colors","element-visible"]}}}constructor(){super(),this.accentBackground=!1,this.accentHeading=!1,this.flat=!1,this.horizontal=!1,this.imageAlign=null,this.imageSrc=null,this.imageValign=null,this.noBorder=!1,this.ready=!1,this.link=null,this.icon="icons:add-circle-outline"}firstUpdated(t){super.firstUpdated&&super.firstUpdated(t),setTimeout((()=>{this.ready=!0}),100)}static get properties(){return{...super.properties||{},accentBackground:{type:Boolean,attribute:"accent-background",reflect:!0},accentHeading:{type:Boolean,attribute:"accent-heading",reflect:!0},flat:{type:Boolean,reflect:!0},horizontal:{type:Boolean,reflect:!0},imageAlign:{type:String,attribute:"image-align",reflect:!0},imageSrc:{type:String,attribute:"image-src"},imageValign:{type:String,attribute:"image-valign",reflect:!0},noBorder:{type:Boolean,attribute:"no-border",reflect:!0},ready:{type:Boolean,reflect:!0},link:{type:String,reflect:!0},iconSize:{type:String,reflect:!0,attribute:"icon-size"},imageWidth:{type:String,reflect:!0,attribute:"image-width"}}}}customElements.define(AccentCard.tag,AccentCard);export{AccentCard}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/app-hax/app-hax.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/app-hax/app-hax.js index fd80c8b6..4ceb1337 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/app-hax/app-hax.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/app-hax/app-hax.js @@ -1,4 +1,4 @@ -import{css as e,html as t,unsafeCSS as o}from"../../lit/index.js";import{toJS as a,autorun as i}from"../../mobx/dist/mobx.esm.js";import{localStorageSet as s,localStorageGet as n}from"../utils/utils.js";import"../simple-tooltip/simple-tooltip.js";import{SimpleColors as r}from"../simple-colors/simple-colors.js";import{store as l}from"./lib/v1/AppHaxStore.js";import{I18NMixin as p}from"../i18n-manager/lib/I18NMixin.js";import{AppHaxAPI as d}from"./lib/v1/AppHaxBackendAPI.js";import{SimpleTourManager as h}from"../simple-popover/lib/simple-tour.js";import{SuperDaemonInstance as c}from"../super-daemon/super-daemon.js";import"../simple-toolbar/lib/simple-toolbar-button.js";import"../simple-colors-shared-styles/simple-colors-shared-styles.js";import"./lib/v1/AppHaxRouter.js";import"./lib/v1/app-hax-label.js";import"./lib/v1/app-hax-top-bar.js";import{SimpleTourFinder as m}from"../simple-popover/lib/SimpleTourFinder.js";const u=new URL("./lib/assets/images/Logout.svg",import.meta.url).href;function darkToggle(e){e.matches?l.darkMode=!0:l.darkMode=!1}function soundToggle(){l.soundStatus=!a(l.soundStatus),s("app-hax-soundStatus",a(l.soundStatus)),l.appEl.playSound("click")}export class AppHax extends(p(m(r))){static get tag(){return"app-hax"}_openExternalLink(e){globalThis.open(e,"_blank")}async _haxStoreContribute(e,t,o=null){let a="";if("merlin"==e){var i=`[${e}] New command request from HAX daemon`;a=`Location: ${globalThis.location.href}\nMerlin command: ${o}\nWhat did you want merlin to do?\n`}else{i=`[${e}] User report from HAX daemon`;if(a=`Location: ${globalThis.location.href}\nBrowser: ${navigator.userAgent}\nOS: ${navigator.userAgentData.platform} - ${navigator.deviceMemory}GB RAM - ${navigator.hardwareConcurrency} cores\nScreen: ${globalThis.screen.width}x${globalThis.screen.height}\nWindow size: ${globalThis.innerWidth}x${globalThis.innerHeight}\n`,navigator.getBattery){a+=`Battery: ${100*(await globalThis.navigator.getBattery()).level}%\n`}navigator.connection&&globalThis.navigator.connection.effectiveType&&(a+=`Connection: ${navigator.connection.effectiveType}\n`),a+=("feature"==e?"Your idea:":"Bug you experienced:")+"\n"}globalThis.open(`https://github.com/haxtheweb/issues/issues/new?assignees=&labels=${t}&template=issue-report.md&title=${i}&body=${encodeURIComponent(a)}`,"_blank")}playSound(e="coin2"){return new Promise((t=>{if(l.soundStatus&&l.appReady){let o=["click","click2","coin","coin2","hit","success"].includes(e)?e:"hit";this.audio=new Audio(new URL(`./lib/assets/sounds/${o}.mp3`,import.meta.url).href),this.audio.volume=.3,this.audio.onended=e=>{t()},this.audio.play(),setTimeout((()=>{t()}),1e3)}else t()}))}_tokenRefreshFailed(e){globalThis.dispatchEvent(new CustomEvent("jwt-login-logout",{composed:!0,bubbles:!0,cancelable:!1,detail:!0})),setTimeout((()=>{this.reset(!0)}),100)}connectedCallback(){super.connectedCallback(),globalThis.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",darkToggle,{signal:this.windowControllers.signal}),globalThis.addEventListener("jwt-logged-in",this._jwtLoggedIn.bind(this),{signal:this.windowControllers.signal}),globalThis.addEventListener("jwt-login-refresh-error",this._tokenRefreshFailed.bind(this),{signal:this.windowControllers.signal})}goToLocation(e){globalThis.location=e}disconnectedCallback(){this.windowControllers.abort(),super.disconnectedCallback()}constructor(){super(),this.unlockComingSoon=!1,this.unlockTerrible=!1,this.t=this.t||{},this.t={...this.t,selectPage:"Select page",backToSiteList:"Back to site list",listMySites:"List my sites",cancel:"Cancel",editDetails:"Page details",add:"Add",editSettings:"Edit settings",source:"Source",viewSource:"View source",findMedia:"Find media",undo:"Undo",redo:"Redo",media:"Media",outline:"Outline",blocks:"Blocks",addBlock:"Add block",addPage:"Add page",addChildPage:"Add child page",clonePage:"Clone page",delete:"Delete page",siteSettings:"Site settings",close:"Close",settings:"Settings",edit:"Edit",configureBlock:"Configure block",configure:"Configure",save:"Save",home:"Home",startNewJourney:"Start new journey",newJourney:"New Journey",accountInfo:"Account Info",outlineDesigner:"Outline designer",pageOutline:"Page outline",more:"More",siteActions:"Site actions",insights:"Insights dashboard",merlin:"Merlin",summonMerlin:"Summon Merlin",logOut:"Log out",menu:"Menu",showMore:"More"},void 0!==globalThis.speechSynthesis&&(globalThis.SpeechRecognition||globalThis.webkitSpeechRecognition||globalThis.mozSpeechRecognition||globalThis.msSpeechRecognition||globalThis.oSpeechRecognition)&&(c.voiceSearch=!0),c.icon="hax:wizard-hat",c.appendContext("*"),c.allowedCallback=()=>!(!a(l.appReady)||!a(l.isLoggedIn)),c.defineOption({title:"Tour of top menu buttons",icon:"help",tags:["Help","ui","tour"],priority:-1e3,value:{target:this,method:"helpClick",args:[]},eventName:"super-daemon-element-method",path:"HAX/app/tour",context:["*"]}),c.defineOption({title:"Unlock hidden features",icon:"hax:hax2022",tags:["Developer","features","hidden"],value:{target:this,method:"fireUnlocked",args:[]},eventName:"super-daemon-element-method",path:">developer/hax/unlockAll",context:[">"]}),c.defineOption({title:"Unlock terrible 2000s themes",icon:"hax:table-multiple",tags:["Developer","terrible","2000","tables"],value:{target:this,method:"fireTerrible",args:[]},eventName:"super-daemon-element-method",path:">developer/hax/terrible2000s",context:[">"]}),c.defineOption({title:"Go to site",icon:"hax:hax2022",tags:["Sites","Administration","change"],eventName:"super-daemon-run-program",path:"HAX/action/goToSite",value:{name:"Go to site",program:async(e,t)=>{let o=[];return a(l.manifest.items).forEach((async t=>{(""==e||t.metadata.site&&t.metadata.site.name&&t.metadata.site.name.includes(e))&&o.push({title:t.title,icon:t.metadata.theme&&t.metadata.theme.variables&&t.metadata.theme.variables.icon?t.metadata.theme.variables.icon:"hax:hax2022",tags:["site",t.description],value:{target:this,method:"goToLocation",args:[t.slug]},eventName:"super-daemon-element-method",context:["*","HAX/action/goToSite/"+t.metadata.site.name],path:"HAX/action/goToSite/"+t.metadata.site.name})})),o}},context:["*"]}),c.defineOption({title:"Join our Community",icon:"hax:discord",priority:-100,tags:["community","discord","chat","help"],value:{target:this,method:"_openExternalLink",args:["https://bit.ly/hax-discord"]},eventName:"super-daemon-element-method",path:"HAX/community/join",context:["logged-in","CMS","HAX","*"]}),c.defineOption({title:"User Tutorials",icon:"hax:hax2022",priority:-1e3,tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/tutorials"]},eventName:"super-daemon-element-method",path:"HAX/community/tutorials",context:["logged-in","CMS","HAX","*"]}),c.defineOption({title:"User Documentation",icon:"hax:hax2022",tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation"]},eventName:"super-daemon-element-method",path:"HAX/community/documentation",context:["logged-in","CMS","HAX","*"]}),c.defineOption({title:"HAX Teaching Excellence",icon:"hax:hax2022",tags:["Ontology","community","pedagogy","documentation","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/ontology"]},eventName:"super-daemon-element-method",path:"HAX/community/pedagogy",context:["logged-in","CMS","HAX","*"]}),c.defineOption({title:"Bug / issue",icon:"mdi-social:github-circle",tags:["Bug report","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["bug","POP,bug"]},eventName:"super-daemon-element-method",path:"HAX/community/contribute",context:["logged-in","CMS","HAX","*"]}),c.defineOption({title:"Idea / Feature request",icon:"mdi-social:github-circle",tags:["Feature request","idea","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["feature","POP,enhancement"]},context:["logged-in","CMS","HAX","*"],eventName:"super-daemon-element-method",path:"HAX/community/contribute"}),this.windowControllers=new AbortController,this.__tour=h,this.__tour.registerNewTour({key:"hax",name:"HAX top menu",style:"\n simple-popover-manager::part(simple-popover) {\n max-width: 250px;\n font-family: sans-serif;\n }\n simple-popover-manager button {\n font-family: sans-serif;\n font-size: 12px;\n margin: 0px 2px;\n color: var(--simple-colors-default-theme-grey-12);\n }\n simple-popover-manager p {\n font-family: sans-serif;\n padding: 0;\n margin: 0;\n width: 250px;\n font-size: 10px;\n line-height: 20px;\n }\n simple-popover-manager h1 {\n font-family: sans-serif;\n margin: 0;\n font-size: 12px;\n width: 250px;\n padding: 0;\n }\n simple-popover-manager::part(simple-popover-body),\n simple-popover-manager::part(simple-popover-heading) {\n color: black;\n background-color: white;\n font-family: sans-serif;\n }\n body.dark-mode simple-popover-manager::part(simple-popover-body),\n body.dark-mode simple-popover-manager::part(simple-popover-heading) {\n color: white;\n background-color: black;\n font-family: sans-serif;\n }\n body.dark-mode simple-popover-manager simple-icon-button-lite {\n color: white;\n background-color: black;\n font-family: sans-serif;\n }\n "}),this.tourName="hax",i((()=>{const e=a(l.activeItem);e&&e.title&&l.setPageTitle(e.title)})),i((()=>{this.siteReady=a(l.siteReady)})),i((()=>{const e=a(l.badDevice);!1===e?(import("../rpg-character/rpg-character.js"),import("./lib/random-word/random-word.js")):!0===e&&globalThis.document.body.classList.add("bad-device")})),this.userMenuOpen=!1,this.courses=[],this.activeItem={},this.phrases={new:["What's ya name?","HAX to the moon","Welcome to the Jungle","We like to party","Build something awesome","Everything is awesome!","Everything is cool","When you're part of the team","When you're living our dream","Welcome to the up-side-down"],return:["Welcome back, take 2?","That wasn't very long","Stranger thiings have happened","Student driven platform","Faculty centered platform","Instructional designer influenced platform","Free, Open, Community driven","One brick at a time..","Sup?","You again? Awesome!","Let's do this","There can only be one ring...","There is another","Fancy that, I love HAX and you show up"]},this.isNewUser=null,this.basePath="/",this.searchTerm="",this.appMode="",this.soundIcon="",this.store=l,this.sound=new Audio,i((()=>{this.isNewUser=a(l.isNewUser),this.isNewUser&&"create"!==a(l.appMode)&&"404"!==a(l.appMode)&&(l.appMode="create",setTimeout((()=>{l.createSiteSteps=!0}),0))})),i((()=>{this.userName=a(l.user.name)})),i((()=>{this.appMode=a(l.appMode)})),i((()=>{this.searchTerm=a(l.searchTerm)})),i((async()=>{const e=a(l.location);e&&e.route&&(e.route.step?(l.appMode="create",l.createSiteSteps=!0):e.route.slug?(this.reset(),setTimeout((()=>{globalThis.location=e.route.slug}),0)):"404"===e.route.name?(l.createSiteSteps=!1,l.appMode="404",setTimeout((()=>{l.toast("the page miss.. it burns!!!",3e3,{fire:!0,walking:!0})}),500)):"home"!==e.route.name&&"search"!==e.route.name||(l.appMode="home",l.createSiteSteps=!1))})),i((()=>{l.routes.length>0&&null===l.location&&(l.location=a(l.routes[0]))})),null===n("app-hax-darkMode",null)&&(l.darkMode=globalThis.matchMedia("(prefers-color-scheme: dark)").matches),i((()=>{s("app-hax-darkMode",a(l.darkMode)),requestAnimationFrame((()=>{a(l.darkMode)?(globalThis.document.body.classList.add("dark-mode"),l.toast("I'm ascared of the dark",2e3,{fire:!0}),this.dark=!0,c.dark=!0,c.toastInstance.darkMode=!0):(globalThis.document.body.classList.remove("dark-mode"),l.toast("Sunny day it is",2e3,{hat:"random"}),this.dark=!1,c.dark=!1,c.toastInstance.darkMode=!1)}))})),i((()=>{const e=a(l.appMode);e&&(globalThis.document.body.classList.remove("app-hax-search"),globalThis.document.body.classList.remove("app-hax-create"),globalThis.document.body.classList.remove("app-hax-404"),globalThis.document.body.classList.remove("app-hax-home"),globalThis.document.body.classList.add(`app-hax-${e}`))}))}static get properties(){return{...super.properties,unlockComingSoon:{type:Boolean},unlockTerrible:{type:Boolean},courses:{type:Array},userName:{type:String},activeItem:{type:Object},soundIcon:{type:String},searchTerm:{type:String},appMode:{type:String},isNewUser:{type:Boolean},phrases:{type:Object},userMenuOpen:{type:Boolean},siteReady:{type:Boolean},basePath:{type:String,attribute:"base-path"},token:{type:String}}}reset(e=!1){try{globalThis.localStorage.removeItem("app-hax-step"),globalThis.localStorage.removeItem("app-hax-site"),e&&(document.querySelector("base")?globalThis.location=globalThis.document.querySelector("base").href:globalThis.location.reload())}catch(e){}}fireTerrible(){this.unlockTerrible=!0,l.appEl.playSound("coin").then((()=>{l.appEl.playSound("coin2").then((()=>{l.appEl.playSound("success").then((()=>{c.merlinSpeak("Enjoy these early 2000s table based layouts. May they remind you how never to web, again.")}))}))}))}fireUnlocked(){this.unlockComingSoon=!0,l.appEl.playSound("coin").then((()=>{l.appEl.playSound("coin2").then((()=>{l.appEl.playSound("success").then((()=>{c.merlinSpeak("Unbelievable! You, (Subject Name), must be the pride of (Subject Hometown). Enjoy all locked features as a boon!")}))}))}))}logout(){globalThis.dispatchEvent(new CustomEvent("jwt-login-logout",{composed:!0,bubbles:!0,cancelable:!1,detail:!0})),this.closeMenu(),this.__logoutUserAction=!0}_jwtLoggedIn(e){!1===e.detail&&this.__logoutUserAction&&(this.__logoutUserAction=!1,setTimeout((()=>{this.reset(!0)}),100))}login(){import("./lib/v1/app-hax-site-login.js").then((()=>{const e=globalThis.document.createElement("app-hax-site-login");if(this.querySelector('[slot="externalproviders"]')){const t=this.querySelector('[slot="externalproviders"]').cloneNode(!0);e.appendChild(t)}import("../simple-modal/simple-modal.js").then((()=>{setTimeout((()=>{this.dispatchEvent(new CustomEvent("simple-modal-show",{bubbles:!0,cancelable:!0,composed:!0,detail:{title:"< login >",elements:{content:e},modal:!0,styles:{"--simple-modal-titlebar-background":"transparent","--simple-modal-titlebar-color":"black","--simple-modal-width":"40vw","--simple-modal-min-width":"300px","--simple-modal-z-index":"100000000","--simple-modal-height":"62vh","--simple-modal-min-height":"400px","--simple-modal-titlebar-height":"64px"}}}))}),0)}))}))}static get styles(){return[super.styles,e` +import{css as e,html as t,unsafeCSS as o}from"../../lit/index.js";import{toJS as a,autorun as i}from"../../mobx/dist/mobx.esm.js";import{localStorageSet as s,localStorageGet as n}from"../utils/utils.js";import"../simple-tooltip/simple-tooltip.js";import{SimpleColors as r}from"../simple-colors/simple-colors.js";import{store as l}from"./lib/v1/AppHaxStore.js";import{I18NMixin as p}from"../i18n-manager/lib/I18NMixin.js";import{AppHaxAPI as d}from"./lib/v1/AppHaxBackendAPI.js";import{SimpleTourManager as h}from"../simple-popover/lib/simple-tour.js";import{SuperDaemonInstance as c}from"../super-daemon/super-daemon.js";import"../simple-toolbar/lib/simple-toolbar-button.js";import"../simple-colors-shared-styles/simple-colors-shared-styles.js";import"./lib/v1/AppHaxRouter.js";import"./lib/v1/app-hax-label.js";import"./lib/v1/app-hax-top-bar.js";import{SimpleTourFinder as m}from"../simple-popover/lib/SimpleTourFinder.js";const u=new URL("./lib/assets/images/Logout.svg",import.meta.url).href;function darkToggle(e){e.matches?l.darkMode=!0:l.darkMode=!1}function soundToggle(){l.soundStatus=!a(l.soundStatus),s("app-hax-soundStatus",a(l.soundStatus)),l.appEl.playSound("click")}export class AppHax extends(p(m(r))){static get tag(){return"app-hax"}_openExternalLink(e){globalThis.open(e,"_blank")}async _haxStoreContribute(e,t,o=null){let a="";if("merlin"==e){var i=`[${e}] New command request from HAX daemon`;a=`Location: ${globalThis.location.href}\nMerlin command: ${o}\nWhat did you want merlin to do?\n`}else{i=`[${e}] User report from HAX daemon`;if(a=`Location: ${globalThis.location.href}\nBrowser: ${navigator.userAgent}\nOS: ${navigator.userAgentData.platform} - ${navigator.deviceMemory}GB RAM - ${navigator.hardwareConcurrency} cores\nScreen: ${globalThis.screen.width}x${globalThis.screen.height}\nWindow size: ${globalThis.innerWidth}x${globalThis.innerHeight}\n`,navigator.getBattery){a+=`Battery: ${100*(await globalThis.navigator.getBattery()).level}%\n`}navigator.connection&&globalThis.navigator.connection.effectiveType&&(a+=`Connection: ${navigator.connection.effectiveType}\n`),a+=("feature"==e?"Your idea:":"Bug you experienced:")+"\n"}globalThis.open(`https://github.com/haxtheweb/issues/issues/new?assignees=&labels=${t}&template=issue-report.md&title=${i}&body=${encodeURIComponent(a)}`,"_blank")}playSound(e="coin2"){return new Promise((t=>{if(l.soundStatus&&l.appReady){let o=["click","click2","coin","coin2","hit","success"].includes(e)?e:"hit";this.audio=new Audio(new URL(`./lib/assets/sounds/${o}.mp3`,import.meta.url).href),this.audio.volume=.3,this.audio.onended=e=>{t()},this.audio.play(),setTimeout((()=>{t()}),1e3)}else t()}))}_tokenRefreshFailed(e){globalThis.dispatchEvent(new CustomEvent("jwt-login-logout",{composed:!0,bubbles:!0,cancelable:!1,detail:!0})),setTimeout((()=>{this.reset(!0)}),100)}connectedCallback(){super.connectedCallback(),globalThis.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",darkToggle,{signal:this.windowControllers.signal}),globalThis.addEventListener("jwt-logged-in",this._jwtLoggedIn.bind(this),{signal:this.windowControllers.signal}),globalThis.addEventListener("jwt-login-refresh-error",this._tokenRefreshFailed.bind(this),{signal:this.windowControllers.signal})}goToLocation(e){globalThis.location=e}disconnectedCallback(){this.windowControllers.abort(),super.disconnectedCallback()}constructor(){super(),this.unlockComingSoon=!1,this.unlockTerrible=!1,this.t=this.t||{},this.t={...this.t,selectPage:"Select page",backToSiteList:"Back to site list",listMySites:"List my sites",cancel:"Cancel",editDetails:"Page details",add:"Add",editSettings:"Edit settings",source:"Source",viewSource:"View source",findMedia:"Find media",undo:"Undo",redo:"Redo",media:"Media",outline:"Outline",blocks:"Blocks",addBlock:"Add block",addPage:"Add page",addChildPage:"Add child page",clonePage:"Clone page",delete:"Delete page",siteSettings:"Site settings",close:"Close",settings:"Settings",edit:"Edit",configureBlock:"Configure block",configure:"Configure",save:"Save",home:"Home",startNewJourney:"Start new journey",newJourney:"New Journey",accountInfo:"Account Info",outlineDesigner:"Outline designer",pageOutline:"Page outline",more:"More",siteActions:"Site actions",insights:"Insights dashboard",merlin:"Merlin",summonMerlin:"Summon Merlin",logOut:"Log out",menu:"Menu",showMore:"More"},void 0!==globalThis.speechSynthesis&&(globalThis.SpeechRecognition||globalThis.webkitSpeechRecognition||globalThis.mozSpeechRecognition||globalThis.msSpeechRecognition||globalThis.oSpeechRecognition)&&(c.voiceSearch=!0),c.icon="hax:wizard-hat",c.appendContext("*"),c.allowedCallback=()=>!(!a(l.appReady)||!a(l.isLoggedIn)),c.defineOption({title:"Tour of top menu buttons",icon:"help",tags:["Help","ui","tour"],priority:-1e3,value:{target:this,method:"helpClick",args:[]},eventName:"super-daemon-element-method",path:"HAX/app/tour",context:["*"]}),c.defineOption({title:"Unlock hidden features",icon:"hax:hax2022",tags:["Developer","features","hidden"],value:{target:this,method:"fireUnlocked",args:[]},eventName:"super-daemon-element-method",path:">developer/hax/unlockAll",context:[">"]}),c.defineOption({title:"Unlock terrible 2000s themes",icon:"hax:table-multiple",tags:["Developer","terrible","2000","tables"],value:{target:this,method:"fireTerrible",args:[]},eventName:"super-daemon-element-method",path:">developer/hax/terrible2000s",context:[">"]}),c.defineOption({title:"Go to site",icon:"hax:hax2022",tags:["Sites","Administration","change"],eventName:"super-daemon-run-program",path:"HAX/action/goToSite",value:{name:"Go to site",program:async(e,t)=>{let o=[];return a(l.manifest.items).forEach((async t=>{(""==e||t.metadata.site&&t.metadata.site.name&&t.metadata.site.name.includes(e))&&o.push({title:t.title,icon:t.metadata.theme&&t.metadata.theme.variables&&t.metadata.theme.variables.icon?t.metadata.theme.variables.icon:"hax:hax2022",tags:["site",t.description],value:{target:this,method:"goToLocation",args:[t.slug]},eventName:"super-daemon-element-method",context:["*","HAX/action/goToSite/"+t.metadata.site.name],path:"HAX/action/goToSite/"+t.metadata.site.name})})),o}},context:["*"]}),c.defineOption({title:"Join our Community",icon:"hax:discord",priority:-100,tags:["community","discord","chat","help"],value:{target:this,method:"_openExternalLink",args:["https://bit.ly/hax-discord"]},eventName:"super-daemon-element-method",path:"HAX/community/join",context:["logged-in","CMS","HAX","*"]}),c.defineOption({title:"User Tutorials",icon:"hax:hax2022",priority:-1e3,tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://haxtheweb.org/tutorials"]},eventName:"super-daemon-element-method",path:"HAX/community/tutorials",context:["logged-in","CMS","HAX","*"]}),c.defineOption({title:"User Documentation",icon:"hax:hax2022",tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://haxtheweb.org/documentation"]},eventName:"super-daemon-element-method",path:"HAX/community/documentation",context:["logged-in","CMS","HAX","*"]}),c.defineOption({title:"HAX Teaching Excellence",icon:"hax:hax2022",tags:["Ontology","community","pedagogy","documentation","help"],value:{target:this,method:"_openExternalLink",args:["https://haxtheweb.org/ontology"]},eventName:"super-daemon-element-method",path:"HAX/community/pedagogy",context:["logged-in","CMS","HAX","*"]}),c.defineOption({title:"Bug / issue",icon:"mdi-social:github-circle",tags:["Bug report","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["bug","POP,bug"]},eventName:"super-daemon-element-method",path:"HAX/community/contribute",context:["logged-in","CMS","HAX","*"]}),c.defineOption({title:"Idea / Feature request",icon:"mdi-social:github-circle",tags:["Feature request","idea","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["feature","POP,enhancement"]},context:["logged-in","CMS","HAX","*"],eventName:"super-daemon-element-method",path:"HAX/community/contribute"}),this.windowControllers=new AbortController,this.__tour=h,this.__tour.registerNewTour({key:"hax",name:"HAX top menu",style:"\n simple-popover-manager::part(simple-popover) {\n max-width: 250px;\n font-family: sans-serif;\n }\n simple-popover-manager button {\n font-family: sans-serif;\n font-size: 12px;\n margin: 0px 2px;\n color: var(--simple-colors-default-theme-grey-12);\n }\n simple-popover-manager p {\n font-family: sans-serif;\n padding: 0;\n margin: 0;\n width: 250px;\n font-size: 10px;\n line-height: 20px;\n }\n simple-popover-manager h1 {\n font-family: sans-serif;\n margin: 0;\n font-size: 12px;\n width: 250px;\n padding: 0;\n }\n simple-popover-manager::part(simple-popover-body),\n simple-popover-manager::part(simple-popover-heading) {\n color: black;\n background-color: white;\n font-family: sans-serif;\n }\n body.dark-mode simple-popover-manager::part(simple-popover-body),\n body.dark-mode simple-popover-manager::part(simple-popover-heading) {\n color: white;\n background-color: black;\n font-family: sans-serif;\n }\n body.dark-mode simple-popover-manager simple-icon-button-lite {\n color: white;\n background-color: black;\n font-family: sans-serif;\n }\n "}),this.tourName="hax",i((()=>{const e=a(l.activeItem);e&&e.title&&l.setPageTitle(e.title)})),i((()=>{this.siteReady=a(l.siteReady)})),i((()=>{const e=a(l.badDevice);!1===e?(import("../rpg-character/rpg-character.js"),import("./lib/random-word/random-word.js")):!0===e&&globalThis.document.body.classList.add("bad-device")})),this.userMenuOpen=!1,this.courses=[],this.activeItem={},this.phrases={new:["What's ya name?","HAX to the moon","Welcome to the Jungle","We like to party","Build something awesome","Everything is awesome!","Everything is cool","When you're part of the team","When you're living our dream","Welcome to the up-side-down"],return:["Welcome back, take 2?","That wasn't very long","Stranger thiings have happened","Student driven platform","Faculty centered platform","Instructional designer influenced platform","Free, Open, Community driven","One brick at a time..","Sup?","You again? Awesome!","Let's do this","There can only be one ring...","There is another","Fancy that, I love HAX and you show up"]},this.isNewUser=null,this.basePath="/",this.searchTerm="",this.appMode="",this.soundIcon="",this.store=l,this.sound=new Audio,i((()=>{this.isNewUser=a(l.isNewUser),this.isNewUser&&"create"!==a(l.appMode)&&"404"!==a(l.appMode)&&(l.appMode="create",setTimeout((()=>{l.createSiteSteps=!0}),0))})),i((()=>{this.userName=a(l.user.name)})),i((()=>{this.appMode=a(l.appMode)})),i((()=>{this.searchTerm=a(l.searchTerm)})),i((async()=>{const e=a(l.location);e&&e.route&&(e.route.step?(l.appMode="create",l.createSiteSteps=!0):e.route.slug?(this.reset(),setTimeout((()=>{globalThis.location=e.route.slug}),0)):"404"===e.route.name?(l.createSiteSteps=!1,l.appMode="404",setTimeout((()=>{l.toast("the page miss.. it burns!!!",3e3,{fire:!0,walking:!0})}),500)):"home"!==e.route.name&&"search"!==e.route.name||(l.appMode="home",l.createSiteSteps=!1))})),i((()=>{l.routes.length>0&&null===l.location&&(l.location=a(l.routes[0]))})),null===n("app-hax-darkMode",null)&&(l.darkMode=globalThis.matchMedia("(prefers-color-scheme: dark)").matches),i((()=>{s("app-hax-darkMode",a(l.darkMode)),requestAnimationFrame((()=>{a(l.darkMode)?(globalThis.document.body.classList.add("dark-mode"),l.toast("I'm ascared of the dark",2e3,{fire:!0}),this.dark=!0,c.dark=!0,c.toastInstance.darkMode=!0):(globalThis.document.body.classList.remove("dark-mode"),l.toast("Sunny day it is",2e3,{hat:"random"}),this.dark=!1,c.dark=!1,c.toastInstance.darkMode=!1)}))})),i((()=>{const e=a(l.appMode);e&&(globalThis.document.body.classList.remove("app-hax-search"),globalThis.document.body.classList.remove("app-hax-create"),globalThis.document.body.classList.remove("app-hax-404"),globalThis.document.body.classList.remove("app-hax-home"),globalThis.document.body.classList.add(`app-hax-${e}`))}))}static get properties(){return{...super.properties,unlockComingSoon:{type:Boolean},unlockTerrible:{type:Boolean},courses:{type:Array},userName:{type:String},activeItem:{type:Object},soundIcon:{type:String},searchTerm:{type:String},appMode:{type:String},isNewUser:{type:Boolean},phrases:{type:Object},userMenuOpen:{type:Boolean},siteReady:{type:Boolean},basePath:{type:String,attribute:"base-path"},token:{type:String}}}reset(e=!1){try{globalThis.localStorage.removeItem("app-hax-step"),globalThis.localStorage.removeItem("app-hax-site"),e&&(document.querySelector("base")?globalThis.location=globalThis.document.querySelector("base").href:globalThis.location.reload())}catch(e){}}fireTerrible(){this.unlockTerrible=!0,l.appEl.playSound("coin").then((()=>{l.appEl.playSound("coin2").then((()=>{l.appEl.playSound("success").then((()=>{c.merlinSpeak("Enjoy these early 2000s table based layouts. May they remind you how never to web, again.")}))}))}))}fireUnlocked(){this.unlockComingSoon=!0,l.appEl.playSound("coin").then((()=>{l.appEl.playSound("coin2").then((()=>{l.appEl.playSound("success").then((()=>{c.merlinSpeak("Unbelievable! You, (Subject Name), must be the pride of (Subject Hometown). Enjoy all locked features as a boon!")}))}))}))}logout(){globalThis.dispatchEvent(new CustomEvent("jwt-login-logout",{composed:!0,bubbles:!0,cancelable:!1,detail:!0})),this.closeMenu(),this.__logoutUserAction=!0}_jwtLoggedIn(e){!1===e.detail&&this.__logoutUserAction&&(this.__logoutUserAction=!1,setTimeout((()=>{this.reset(!0)}),100))}login(){import("./lib/v1/app-hax-site-login.js").then((()=>{const e=globalThis.document.createElement("app-hax-site-login");if(this.querySelector('[slot="externalproviders"]')){const t=this.querySelector('[slot="externalproviders"]').cloneNode(!0);e.appendChild(t)}import("../simple-modal/simple-modal.js").then((()=>{setTimeout((()=>{this.dispatchEvent(new CustomEvent("simple-modal-show",{bubbles:!0,cancelable:!0,composed:!0,detail:{title:"< login >",elements:{content:e},modal:!0,styles:{"--simple-modal-titlebar-background":"transparent","--simple-modal-titlebar-color":"black","--simple-modal-width":"40vw","--simple-modal-min-width":"300px","--simple-modal-z-index":"100000000","--simple-modal-height":"62vh","--simple-modal-min-height":"400px","--simple-modal-titlebar-height":"64px"}}}))}),0)}))}))}static get styles(){return[super.styles,e` :host { display: block; --app-hax-background-color-active: var(--app-hax-accent-color); diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/audio-player/audio-player.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/audio-player/audio-player.js index 6fa9d8cd..ed7336e2 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/audio-player/audio-player.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/audio-player/audio-player.js @@ -2,4 +2,4 @@ * Copyright 2023 The Pennsylvania State University * @license Apache-2.0, see License.md for full text. */ -import{VideoPlayer as e}from"../video-player/video-player.js";class AudioPlayer extends e{constructor(){super()}get audioOnly(){return!0}static get tag(){return"audio-player"}static get haxProperties(){return{canScale:!0,canEditSource:!0,gizmo:{title:"Audio",description:"This can present video in a highly accessible manner regardless of source.",icon:"av:music-video",color:"green",tags:["Audio / Video","Media","listen","mp3"],handles:[{type:"audio",type_exclusive:!0,source:"source",title:"caption",caption:"caption",description:"caption",color:"primaryColor"}],meta:{author:"HAXTheWeb core team"}},settings:{configure:[{property:"source",title:"Source",description:"The URL for this media.",inputMethod:"haxupload",noCamera:!0,validationType:"url"},{property:"mediaTitle",title:"Title",description:"Simple title for under video",inputMethod:"textfield",validationType:"text"},{property:"accentColor",title:"Accent color",description:"Select the accent color for the player.",inputMethod:"colorpicker"},{property:"track",title:"Closed captions",description:"The URL for the captions file.",inputMethod:"haxupload",noCamera:!0,noVoiceRecord:!0,validationType:"url"}],advanced:[{property:"thumbnailSrc",title:"Thumbnail image",description:"Optional. The URL for a thumbnail/poster image.",inputMethod:"haxupload",noVoiceRecord:!0,validationType:"url"},{property:"learningMode",title:"Enable learning mode",description:"Disables fast forward and rewind.",inputMethod:"boolean"},{property:"hideYoutubeLink",title:"Remove open on YouTube button",description:"Removes the button for opening the video on YouTube.",inputMethod:"boolean"},{property:"linkable",title:"Include a share link?",description:"Provides a link to share the video.",inputMethod:"boolean"}],developer:[{property:"crossorigin",title:"Crossorigin",description:"Indicates whether to use CORS.",inputMethod:"select",options:{"":"",anonymous:"anonymous","use-credentials":"use-credentials"}},{property:"allowBackgroundPlay",title:"Allow background playback",description:"Videos pause / play automatically when tab loses focus; this enables video to play without tab having focus",inputMethod:"boolean"},{property:"darkTranscript",title:"Dark theme for transcript",description:"Enable dark theme for the transcript.",inputMethod:"boolean"},{property:"disableInteractive",title:"Disable Interactive",description:"Disable interactive mode that makes transcript clickable.",inputMethod:"boolean"},{property:"hideTimestamps",title:"Hide timestamps",description:"Hide the time stamps on the transcript.",inputMethod:"boolean"},{property:"hideTranscript",title:"Hide Transcript",description:"Hide transcript by default.",inputMethod:"boolean"},{property:"lang",title:"Language",description:"Language of the media.",inputMethod:"textfield",validationType:"text"}]},saveOptions:{unsetAttributes:["__utils","__stand-alone","colors"]},demoSchema:[{tag:"audio-player",properties:{accentColor:"orange",dark:!0,crossorigin:"anonymous",source:"https://inline-audio-mocha.vercel.app/assets/whopper.mp3"},content:""}]}}}customElements.define(AudioPlayer.tag,AudioPlayer);export{AudioPlayer}; \ No newline at end of file +import{VideoPlayer as e}from"../video-player/video-player.js";class AudioPlayer extends e{constructor(){super()}get audioOnly(){return!0}static get tag(){return"audio-player"}static get haxProperties(){return{canScale:!0,canEditSource:!0,gizmo:{title:"Audio",description:"This can present video in a highly accessible manner regardless of source.",icon:"av:music-video",color:"green",tags:["Audio / Video","Media","listen","mp3"],handles:[{type:"audio",type_exclusive:!0,source:"source",title:"caption",caption:"caption",description:"caption",color:"primaryColor"}],meta:{author:"HAXTheWeb core team"}},settings:{configure:[{property:"source",title:"Source",description:"The URL for this media.",inputMethod:"haxupload",noCamera:!0,validationType:"url"},{property:"mediaTitle",title:"Title",description:"Simple title for under video",inputMethod:"textfield",validationType:"text"},{property:"accentColor",title:"Accent color",description:"Select the accent color for the player.",inputMethod:"colorpicker"},{property:"track",title:"Closed captions",description:"The URL for the captions file.",inputMethod:"haxupload",noCamera:!0,noVoiceRecord:!0,validationType:"url"}],advanced:[{property:"thumbnailSrc",title:"Thumbnail image",description:"Optional. The URL for a thumbnail/poster image.",inputMethod:"haxupload",noVoiceRecord:!0,validationType:"url"},{property:"learningMode",title:"Enable learning mode",description:"Disables fast forward and rewind.",inputMethod:"boolean"},{property:"hideYoutubeLink",title:"Remove open on YouTube button",description:"Removes the button for opening the video on YouTube.",inputMethod:"boolean"},{property:"linkable",title:"Include a share link?",description:"Provides a link to share the video.",inputMethod:"boolean"}],developer:[{property:"crossorigin",title:"Crossorigin",description:"Indicates whether to use CORS.",inputMethod:"select",options:{"":"",anonymous:"anonymous","use-credentials":"use-credentials"}},{property:"allowBackgroundPlay",title:"Allow background playback",description:"Videos pause / play automatically when tab loses focus; this enables video to play without tab having focus",inputMethod:"boolean"},{property:"darkTranscript",title:"Dark theme for transcript",description:"Enable dark theme for the transcript.",inputMethod:"boolean"},{property:"disableInteractive",title:"Disable Interactive",description:"Disable interactive mode that makes transcript clickable.",inputMethod:"boolean"},{property:"hideTimestamps",title:"Hide timestamps",description:"Hide the time stamps on the transcript.",inputMethod:"boolean"},{property:"hideTranscript",title:"Hide Transcript",description:"Hide transcript by default.",inputMethod:"boolean"},{property:"lang",title:"Language",description:"Language of the media.",inputMethod:"textfield",validationType:"text"}]},saveOptions:{unsetAttributes:["__utils","__stand-alone","colors"]},demoSchema:[{tag:"audio-player",properties:{mediaTitle:"Jonny Quest Theme",crossorigin:"anonymous",source:"https://archive.org/download/tvtunes_4710/Jonny%20Quest.mp3"},content:""}]}}}customElements.define(AudioPlayer.tag,AudioPlayer);export{AudioPlayer}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/chat-agent.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/chat-agent.js index 1a69543d..2217bf06 100755 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/chat-agent.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/chat-agent.js @@ -2,8 +2,8 @@ * Copyright 2024 The Pennsylvania State University * @license Apache-2.0, see License.md for full text. */ -import{DDD as t}from"../d-d-d/d-d-d.js";import{enableServices as e}from"../micro-frontend-registry/lib/microServices.js";import{MicroFrontendRegistry as i}from"../micro-frontend-registry/micro-frontend-registry.js";import"../rpg-character/rpg-character.js";import"../simple-icon/simple-icon.js";import"../simple-tooltip/simple-tooltip.js";import{css as a,html as r}from"../../lit/index.js";import{autorun as s,configure as n,toJS as o}from"../../mobx/dist/mobx.esm.js";import{ChatStore as c}from"./lib/chat-agent-store.js";import"./lib/chat-button.js";import"./lib/chat-control-bar.js";import"./lib/chat-developer-panel.js";import"./lib/chat-input.js";import"./lib/chat-interface.js";import"./lib/chat-message.js";import"./lib/chat-suggestion.js";n({enforceActions:!1}),e(["haxcms"]),i.add({endpoint:"/api/apps/haxcms/aiChat",name:"@haxcms/aiChat",title:"AI Chat",description:"AI based chat agent that can answer questions about a site",params:{site:"location of the HAXcms site OR site.json data",type:"site for site.json or link for remote loading",question:"Question to ask of the AI",engine:"which engine to use as we test multiple",context:"context to query based on. Course typical"}});class ChatAgent extends t{static get tag(){return"chat-agent"}constructor(){super(),this.isFullView=null,this.isInterfaceHidden=null,s((()=>{this.isFullView=o(c.isFullView)})),s((()=>{this.isInterfaceHidden=o(c.isInterfaceHidden)}))}static get styles(){return[super.styles,a` - /* https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation/ddd */ +import{DDD as t}from"../d-d-d/d-d-d.js";import{enableServices as e}from"../micro-frontend-registry/lib/microServices.js";import{MicroFrontendRegistry as i}from"../micro-frontend-registry/micro-frontend-registry.js";import"../rpg-character/rpg-character.js";import"../simple-icon/simple-icon.js";import"../simple-tooltip/simple-tooltip.js";import{css as a,html as r}from"../../lit/index.js";import{autorun as n,configure as s,toJS as o}from"../../mobx/dist/mobx.esm.js";import{ChatStore as d}from"./lib/chat-agent-store.js";import"./lib/chat-button.js";import"./lib/chat-control-bar.js";import"./lib/chat-developer-panel.js";import"./lib/chat-input.js";import"./lib/chat-interface.js";import"./lib/chat-message.js";import"./lib/chat-suggestion.js";s({enforceActions:!1}),e(["haxcms"]),i.add({endpoint:"/api/apps/haxcms/aiChat",name:"@haxcms/aiChat",title:"AI Chat",description:"AI based chat agent that can answer questions about a site",params:{site:"location of the HAXcms site OR site.json data",type:"site for site.json or link for remote loading",question:"Question to ask of the AI",engine:"which engine to use as we test multiple",context:"context to query based on. Course typical"}});class ChatAgent extends t{static get tag(){return"chat-agent"}constructor(){super(),this.isFullView=null,this.isInterfaceHidden=null,n((()=>{this.isFullView=o(d.isFullView)})),n((()=>{this.isInterfaceHidden=o(d.isInterfaceHidden)}))}static get styles(){return[super.styles,a` + /* https://haxtheweb.org/documentation/ddd */ :host { container-type: normal; @@ -17,7 +17,7 @@ import{DDD as t}from"../d-d-d/d-d-d.js";import{enableServices as e}from"../micro gap: var(--ddd-spacing-2); position: fixed; right: var(--ddd-spacing-2); - width: 35%; + width: 35%; } :host([is-full-view]) .chat-agent-wrapper { @@ -64,8 +64,8 @@ import{DDD as t}from"../d-d-d/d-d-d.js";import{enableServices as e}from"../micro
- ${c.buttonLabel} + ${d.buttonLabel}
- `}firstUpdated(){c.startAI()}static get properties(){return{...super.properties,isFullView:{type:Boolean,attribute:"is-full-view",reflect:!0},isInterfaceHidden:{type:Boolean,attribute:"is-interface-hidden",reflect:!0}}}}customElements.define(ChatAgent.tag,ChatAgent);export{ChatAgent};globalThis.ChatAgentStore=globalThis.ChatAgentStore||{},globalThis.ChatAgentStore.requestAvailability=()=>(globalThis.ChatAgentStore.instance||(globalThis.ChatAgentStore.instance=document.createElement("chat-agent"),document.body.appendChild(globalThis.ChatAgentStore.instance)),globalThis.ChatAgentStore.instance);export const ChatAgentModalStore=globalThis.ChatAgentStore.requestAvailability(); \ No newline at end of file + `}firstUpdated(){d.startAI()}static get properties(){return{...super.properties,isFullView:{type:Boolean,attribute:"is-full-view",reflect:!0},isInterfaceHidden:{type:Boolean,attribute:"is-interface-hidden",reflect:!0}}}}customElements.define(ChatAgent.tag,ChatAgent);export{ChatAgent};globalThis.ChatAgentStore=globalThis.ChatAgentStore||{},globalThis.ChatAgentStore.requestAvailability=()=>(globalThis.ChatAgentStore.instance||(globalThis.ChatAgentStore.instance=document.createElement("chat-agent"),document.body.appendChild(globalThis.ChatAgentStore.instance)),globalThis.ChatAgentStore.instance);export const ChatAgentModalStore=globalThis.ChatAgentStore.requestAvailability(); \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-button.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-button.js index f0c05a9a..b324e28b 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-button.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-button.js @@ -3,8 +3,8 @@ * @license Apache-2.0, see License.md for full text. */ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as r}from"../../../lit/index.js";import{autorun as a,toJS as i}from"../../../mobx/dist/mobx.esm.js";import{ChatStore as d}from"./chat-agent-store.js";class ChatButton extends e{static get tag(){return"chat-button"}constructor(){super(),this.buttonIcon=null,this.darkMode=null,this.isFullView=null,this.isInterfaceHidden=null,a((()=>{this.buttonIcon=i(d.buttonIcon)})),a((()=>{this.darkMode=i(d.darkMode)})),a((()=>{this.isFullView=i(d.isFullView)})),a((()=>{this.isInterfaceHidden=i(d.isInterfaceHidden)}))}static get styles(){return[super.styles,t` - /* https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation/ddd */ - + /* https://haxtheweb.org/documentation/ddd */ + :host { display: block; z-index: 999998; @@ -13,7 +13,10 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as r}from"../../ .chat-button-wrapper { align-items: center; background-color: var(--data-theme-primary, var(--ddd-primary-1)); - border-color: light-dark(var(--ddd-theme-default-coalyGray), var(--ddd-theme-default-white)); + border-color: light-dark( + var(--ddd-theme-default-coalyGray), + var(--ddd-theme-default-white) + ); border-radius: var(--ddd-radius-lg); border-style: solid; border-width: 0.75px; @@ -26,12 +29,13 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as r}from"../../ width: 96px; } - .chat-button-wrapper:hover, .chat-button-wrapper:focus-visible { + .chat-button-wrapper:hover, + .chat-button-wrapper:focus-visible { box-shadow: 0 6px rgba(0, 3, 33, 0.4); transform: translateY(-2px); } - - .chat-button-wrapper:active, .chat-button-wrapper.active-mimic /* :active does not work with keypress by default */ { + + .chat-button-wrapper:active, .chat-button-wrapper.active-mimic /* :active does not work with keypress by default */ { box-shadow: 0 1px rgba(0, 3, 33, 0.4); transform: translateY(3px); } @@ -40,7 +44,8 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as r}from"../../ display: none; } - .chat-button-wrapper:hover .label-wrapper, .chat-button-wrapper:focus-visible .label-wrapper { + .chat-button-wrapper:hover .label-wrapper, + .chat-button-wrapper:focus-visible .label-wrapper { text-decoration: underline; } @@ -73,7 +78,7 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as r}from"../../ text-align: center; text-overflow: ellipsis; white-space: nowrap; - + /* Prevent text highlighting in button */ -moz-user-select: none; -ms-user-select: none; @@ -86,7 +91,13 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as r}from"../../ color: var(--ddd-theme-default-white); } `]}render(){return r` -
+
diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-control-bar.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-control-bar.js index 0206590f..81cc88e5 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-control-bar.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-control-bar.js @@ -3,8 +3,8 @@ * @license Apache-2.0, see License.md for full text. */ import{DDD as t}from"../../d-d-d/d-d-d.js";import{css as e,html as o}from"../../../lit/index.js";import{autorun as i,toJS as l}from"../../../mobx/dist/mobx.esm.js";import{ChatStore as n}from"./chat-agent-store.js";class ChatControlBar extends t{static get tag(){return"chat-control-bar"}constructor(){super(),this.dataCollectionEnabled=null,this.isFullView=null,this.isInterfaceHidden=null,i((()=>{this.dataCollectionEnabled=l(n.dataCollectionEnabled)})),i((()=>{this.isFullView=l(n.isFullView)})),i((()=>{this.isInterfaceHidden=l(n.isInterfaceHidden)}))}static get styles(){return[super.styles,e` - /* https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation/ddd */ - + /* https://haxtheweb.org/documentation/ddd */ + :host { container-type: inline-size; display: block; @@ -22,8 +22,9 @@ import{DDD as t}from"../../d-d-d/d-d-d.js";import{css as e,html as o}from"../../ border-radius: var(--ddd-radius-sm); color: var(--ddd-theme-default-white); } - - button:hover, button:focus-visible { + + button:hover, + button:focus-visible { background-color: #52525e; } @@ -40,7 +41,7 @@ import{DDD as t}from"../../d-d-d/d-d-d.js";import{css as e,html as o}from"../../ } .data-collection-label { - font: var(--ddd-font-primary); + font: var(--ddd-font-primary); font-size: 12px; } @@ -49,7 +50,8 @@ import{DDD as t}from"../../d-d-d/d-d-d.js";import{css as e,html as o}from"../../ } /* Phones */ - @media only screen and (max-width: 425px), only screen and (max-height: 616px) { + @media only screen and (max-width: 425px), + only screen and (max-height: 616px) { #view-button { display: none; } @@ -62,44 +64,95 @@ import{DDD as t}from"../../d-d-d/d-d-d.js";import{css as e,html as o}from"../../ } `]}render(){return o` - +
- - - Download Chat Log - - - Reset Chat + Reset Chat - - Toggle Data Collection + Toggle Data Collection - - Toggle Developer Mode - + Toggle Developer Mode
- - ${this.isFullView?"Exit Full View":"Enter Full View"} + ${this.isFullView?"Exit Full View":"Enter Full View"} ${this.isFullView?o` - - Hide Interface - `:""} + + Hide Interface + `:""}
`}handleDownloadLogButton(){n.devStatement("Download log button pressed.","log"),this.downloadChatLog()}handleResetButton(){n.devStatement("Reset button pressed.","log"),confirm("Reset the chat?")&&(confirm("Download the chat log before you reset?")?(n.devStatement("Download chat log before reset confirmed.","info"),this.downloadChatLog()):n.devStatement("Download chat log before reset denied.","warning"),this.resetChat())}handleDataCollectionButton(){n.dataCollectionEnabled=!n.dataCollectionEnabled,this.dataCollectionEnabled?alert("Your conversations will be used to train our AI models"):alert("Your conversations will not be used to train our AI models")}handleDevModeButton(){n.developerModeEnabled=!n.developerModeEnabled}handleViewButton(){n.devStatement("View switch button pressed.","log"),n.isFullView=!this.isFullView,this.requestUpdate(),n.devStatement("View switched to: "+(n.isFullView?"full":"standard"),"info")}handleHideButton(){n.devStatement("Hide button pressed.","log"),this.isInterfaceHidden||(n.isInterfaceHidden=!0)}downloadChatLog(){n.devStatement("Calling download function...","info"),n.handleDownload("txt")}resetChat(){n.devStatement("Resetting chat...","info"),n.chatLog=[],n.merlinIndex=0,n.messageIndex=0,n.userIndex=0,n.startAI()}static get properties(){return{...super.properties,dataCollectionEnabled:{type:Boolean,attribute:"data-collection-enabled",reflect:!0},isFullView:{type:Boolean,attribute:"is-full-view",reflect:!0},isInterfaceHidden:{type:Boolean,attribute:"is-interface-hidden",reflect:!0}}}}globalThis.customElements.define(ChatControlBar.tag,ChatControlBar);export{ChatControlBar}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-developer-panel.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-developer-panel.js index b30b5442..64e109a6 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-developer-panel.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-developer-panel.js @@ -3,7 +3,7 @@ * @license Apache-2.0, see License.md for full text. */ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as o}from"../../../lit/index.js";import{autorun as n,toJS as i}from"../../../mobx/dist/mobx.esm.js";import{ChatStore as l}from"./chat-agent-store.js";class ChatDeveloperPanel extends e{static get tag(){return"chat-developer-panel"}constructor(){super(),this.chatLog=[],this.context=null,this.engine=null,this.isFullView=null,n((()=>{this.chatLog=i(l.chatLog)})),n((()=>{this.context=i(l.context)})),n((()=>{this.engine=i(l.engine)})),n((()=>{this.isFullView=i(l.isFullView)}))}static get styles(){return[super.styles,t` - /* https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation/ddd */ + /* https://haxtheweb.org/documentation/ddd */ :host { container-type: inline-size; @@ -33,7 +33,8 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as o}from"../../ gap: var(--ddd-spacing-1); } - button, select { + button, + select { align-items: center; background-color: #2b2a33; border-radius: var(--ddd-radius-sm); @@ -52,8 +53,9 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as o}from"../../ font-size: 14px; padding: var(--ddd-spacing-2); } - - button:hover, button:focus-visible { + + button:hover, + button:focus-visible { background-color: #52525e; } @@ -85,43 +87,70 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as o}from"../../ } `]}render(){return o`
-
-
- Print User Chat Log as Table to Console - - - Print Merlin Chat Log as Table to Console - - - Print Entire Chat Log as Table to Console - - - Download Chat Log as .json + Download Chat Log as .json
-
- - - @@ -151,7 +191,6 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as o}from"../../ -
`}firstUpdated(){const e=this.shadowRoot.querySelectorAll("#engine-selection option"),t=this.shadowRoot.querySelectorAll("#context-selection option");e.forEach((e=>{e.value===this.engine&&(e.selected=!0)})),t.forEach((e=>{e.value===l.context&&(e.selected=!0)}))}handleConsoleTableButton(e){const t=e.currentTarget.id;switch(console.info(`HAX-DEV-MODE: ${t} button pressed.`),t){case"console-table-user":console.table(this.compileChatLog(l.userName));break;case"console-table-merlin":console.table(this.compileChatLog("merlin"));break;case"console-table-all":console.table(this.chatLog)}}compileChatLog(e){l.devStatement(`Compiling "${e}" chat log...`,"info");let t=[];return this.chatLog.forEach((o=>{o.author===e&&t.push(o)})),t}handleDownloadAsJsonButton(){l.devStatement("Calling download funtion...","info"),l.handleDownload("json")}handleSwitchEngine(){l.engine=this.shadowRoot.querySelector("#engine-selection").value,l.devStatement(`Engine switched to ${l.engine}`,"info")}handleContextChange(){l.context=this.shadowRoot.querySelector("#context-selection").value,l.devStatement(`Context switched to ${l.context}`,"info")}static get properties(){return{...super.properties,context:{type:String,attribute:"context"},engine:{type:String,attribute:"engine"},isFullView:{type:Boolean,attribute:"is-full-view",reflect:!0}}}}globalThis.customElements.define(ChatDeveloperPanel.tag,ChatDeveloperPanel);export{ChatDeveloperPanel}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-input.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-input.js index 03afad5d..f0fea195 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-input.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-input.js @@ -3,8 +3,8 @@ * @license Apache-2.0, see License.md for full text. */ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as s}from"../../../lit/index.js";import{autorun as a,toJS as i}from"../../../mobx/dist/mobx.esm.js";import{ChatStore as r}from"./chat-agent-store.js";class ChatInput extends e{static get tag(){return"chat-input"}constructor(){super(),this.chatLog=[],this.darkMode=null,this.messageIndex=null,this.userIndex=null,this.previousMessagesIndex=null,this.userName=null,a((()=>{this.chatLog=i(r.chatLog)})),a((()=>{this.darkMode=i(r.darkMode)})),a((()=>{this.messageIndex=i(r.messageIndex),this.previousMessagesIndex=i(this.messageIndex)})),a((()=>{this.userIndex=i(r.userIndex)})),a((()=>{this.userName=i(r.userName)}))}static get styles(){return[super.styles,t` - /* https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation/ddd */ - + /* https://haxtheweb.org/documentation/ddd */ + :host { display: block; font-family: var(--ddd-font-primary); @@ -49,8 +49,9 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as s}from"../../ gap: var(--ddd-spacing-1); justify-content: center; } - - button:hover, button:focus-visible { + + button:hover, + button:focus-visible { background-color: #52525e; } @@ -66,12 +67,14 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as s}from"../../ width: 52px; } - #send-button:hover, #send-button:focus-visible { + #send-button:hover, + #send-button:focus-visible { box-shadow: 0 6px rgba(0, 3, 33, 0.2); transform: translateY(-2px); } - #send-button:active, #send-button.active-mimic { + #send-button:active, + #send-button.active-mimic { box-shadow: 0 1px rgba(0, 3, 33, 0.2); transform: translateY(3px); } @@ -88,14 +91,44 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as s}from"../../ } `]}render(){return s`
- +
- - + +
-
+
- Send Prompt to Merlin + Send Prompt to Merlin
`}handleKeyPress(e){switch(e.key){case"Enter":e.preventDefault(),this.handleSendButton();break;case"ArrowUp":e.preventDefault(),this.displayPreviousMessages("up");break;case"ArrowDown":e.preventDefault(),this.displayPreviousMessages("down")}}handleSendButtonKeyPress(e){if("Enter"===e.key){e.preventDefault();const t=this.shadowRoot.querySelector("#send-button");t.classList.contains("active-mimic")?t.classList.remove("active-mimic"):t.classList.add("active-mimic"),setTimeout((()=>{t.classList.remove("active-mimic")}),100),this.handleSendButton()}}handleDirectionButtons(e){const t=e.currentTarget.id;switch(r.devStatement(`${t} button pressed.`,"info"),t){case"input-up-btn":this.displayPreviousMessages("up");break;case"input-down-btn":this.displayPreviousMessages("down")}}handleSendButton(){const e=this.shadowRoot.querySelector("#user-input").value;r.promptCharacterLimit>0&&e.length>r.promptCharacterLimit&&alert(`Please shorten your prompt to no more than ${r.promptCharacterLimit} characters.`),""!==e?(r.devStatement(`Send function activated. "${e}" sent to Merlin.`,"info"),r.handleMessage(r.userName,e),this.shadowRoot.querySelector("#user-input").value=""):r.devStatement("Send button activated. No prompt to send.","warn")}displayPreviousMessages(e){let t=this.shadowRoot.querySelector("#user-input");switch(e){case"up":if(this.previousMessagesIndex>1){for(this.previousMessagesIndex--,r.devStatement(`Arrow Up pressed. Previous message index = ${this.previousMessagesIndex} and message index = ${this.messageIndex}`,"info");this.chatLog[this.previousMessagesIndex].author!==this.userName&&this.previousMessagesIndex>=1;)if(this.previousMessagesIndex--,this.previousMessagesIndex<1){this.previousMessagesIndex++;break}t.value=this.chatLog[this.previousMessagesIndex].message}break;case"down":if(this.previousMessagesIndex=this.messageIndex){this.previousMessagesIndex=this.messageIndex;break}this.previousMessagesIndex>=this.messageIndex?t.value="":t.value=this.chatLog[this.previousMessagesIndex].message}else t.value="";r.devStatement(`Arrow Down pressed. Previous message index = ${this.previousMessagesIndex} and message index = ${this.messageIndex}`,"info");break;default:r.devStatement(`Unknown direction: ${e}.`,"error")}}firstUpdated(){r.promptCharacterLimit>0&&this.shadowRoot.querySelector("#user-input").setAttribute("maxlength",`${r.promptCharacterLimit}`)}static get properties(){return{...super.properties,darkMode:{type:Boolean,attribute:"dark-mode",reflect:!0},userName:{type:String,attribute:"username"}}}}globalThis.customElements.define(ChatInput.tag,ChatInput);export{ChatInput}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-interface.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-interface.js index e4777171..26d490e4 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-interface.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-interface.js @@ -3,8 +3,8 @@ * @license Apache-2.0, see License.md for full text. */ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../../lit/index.js";import{autorun as t,toJS as a}from"../../../mobx/dist/mobx.esm.js";import{ChatStore as r}from"./chat-agent-store.js";class ChatInterface extends e{static get tag(){return"chat-interface"}constructor(){super(),this.chatLog=[],this.darkMode=!1,this.developerModeEnabled=null,this.isFullView=null,this.isInterfaceHidden=null,this.hasEditorUI=null,t((()=>{this.chatLog=a(r.chatLog)})),t((()=>{this.darkMode=a(r.darkMode)})),t((()=>{this.developerModeEnabled=a(r.developerModeEnabled)})),t((()=>{this.isFullView=a(r.isFullView)})),t((()=>{this.isInterfaceHidden=a(r.isInterfaceHidden)}))}static get styles(){return[super.styles,i` - /* https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation/ddd */ - + /* https://haxtheweb.org/documentation/ddd */ + :host { display: block; width: 100%; @@ -25,37 +25,44 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../ :host([is-interface-hidden]) .chat-interface-wrapper { display: none; } - + /* Chat Wrapper */ .chat-wrapper { background-color: var(--data-theme-primary, var(--ddd-primary-1)); border-radius: var(--ddd-radius-sm); border-style: solid; box-shadow: var(--ddd-boxShadow-xl); - padding: var(--ddd-spacing-0) var(--ddd-spacing-2) var(--ddd-spacing-2) var(--ddd-spacing-2); + padding: var(--ddd-spacing-0) var(--ddd-spacing-2) + var(--ddd-spacing-2) var(--ddd-spacing-2); border-width: 0.75px; - border-color: light-dark(var(--ddd-theme-default-coalyGray, #000), var(--ddd-theme-default-white, #fff)); + border-color: light-dark( + var(--ddd-theme-default-coalyGray, #000), + var(--ddd-theme-default-white, #fff) + ); } - + :host([is-full-view]) .chat-wrapper { height: 94%; - margin: var(--ddd-spacing-6) var(--ddd-spacing-0) var(--ddd-spacing-6) var(--ddd-spacing-0); + margin: var(--ddd-spacing-6) var(--ddd-spacing-0) var(--ddd-spacing-6) + var(--ddd-spacing-0); border-color: transparent; border-radius: var(--ddd-radius-sm); border-style: none; border-width: 0; - } - + } + :host([is-full-view][has-editor-ui]) .chat-wrapper { height: 87%; - margin: var(--ddd-spacing-18) var(--ddd-spacing-0) var(--ddd-spacing-0) var(--ddd-spacing-0); - } - - :host([developer-mode]), .chat-wrapper { + margin: var(--ddd-spacing-18) var(--ddd-spacing-0) + var(--ddd-spacing-0) var(--ddd-spacing-0); + } + + :host([developer-mode]), + .chat-wrapper { padding-top: var(--ddd-spacing-1); } - + /* Main Wrapper */ .main-wrapper { display: flex; @@ -69,11 +76,11 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../ :host([is-full-view][developer-mode]) .main-wrapper { height: 88%; } - + /* Chat Container */ .chat-container { background-color: var(--ddd-theme-default-white); - border-radius: var(--ddd-radius-sm); + border-radius: var(--ddd-radius-sm); display: flex; flex-direction: column; width: 100%; @@ -86,7 +93,7 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../ :host([is-full-view]) .chat-container { height: 92%; } - + :host([is-full-view][developer-mode]) .chat-container { height: 90%; } @@ -98,7 +105,7 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../ overflow-y: auto; scrollbar-width: thin; } - + :host([is-full-view]) .chat-messages { height: 100%; max-height: 100%; @@ -143,7 +150,8 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../ } } - @media only screen and (max-height: 1001px) and (min-height: 940px) { /* Modify more for even bigger screen sizes -_- */ + @media only screen and (max-height: 1001px) and (min-height: 940px) { + /* Modify more for even bigger screen sizes -_- */ :host([is-full-view]) .chat-wrapper { height: 96%; } @@ -254,7 +262,6 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../ /* This should cover a lot of vertical monitors */ @media only screen and (max-width: 1080px) { - @media only screen and (min-height: 1720px) { :host([is-full-view]) .chat-wrapper { height: 98%; @@ -273,7 +280,7 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../ } } - @media only screen and (max-height: 1719px) and (min-height: 1600px){ + @media only screen and (max-height: 1719px) and (min-height: 1600px) { :host([is-full-view]) .chat-wrapper { height: 97.5%; } @@ -311,7 +318,7 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../ @media only screen and (max-height: 1499px) and (min-height: 1440px) { :host([is-full-view]) .chat-wrapper { - height: 96.5%; + height: 96.5%; } :host([is-full-view][has-editor-ui]) .chat-wrapper { @@ -369,7 +376,7 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../ } :host([is-full-view][has-editor-ui]) .chat-wrapper { - height: 94% + height: 94%; } :host([is-full-view]) .main-wrapper { @@ -471,7 +478,7 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../ } } - @media only screen and (max-height: 999px) and (min-height: 880px){ + @media only screen and (max-height: 999px) and (min-height: 880px) { :host([is-full-view]) .chat-wrapper { height: 96%; } @@ -550,7 +557,9 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as i,html as h}from"../../
-
${this.chatLog.map((e=>h` {this.darkMode=d(r.darkMode)})),a((()=>{this.editMode=d(r.editMode)}))}static get styles(){return[super.styles,t` - /* https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation/ddd */ - + /* https://haxtheweb.org/documentation/ddd */ + :host { container-type: inline-size; display: block; @@ -16,7 +16,8 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import"../../type-writer/type-writer. padding: var(--ddd-spacing-2) var(--ddd-spacing-3); } - .sent-chat-message, .message { + .sent-chat-message, + .message { align-items: center; display: flex; flex-direction: row; @@ -111,19 +112,31 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import"../../type-writer/type-writer.
- +
${this.suggestedPrompts.map((e=>s` - - `))} + + `))}
`}renderSentMessage(){return s`

${this.message}

- +
`}firstUpdated(){this.pickHat()}pickHat(){2===r.month&&12===r.day?this.hat="party":6===r.month&&6===r.day?this.hat="cowboy":7===r.month&&27===r.day?this.hat="bunny":8===r.month&&15===r.day?this.hat="watermelon":9===r.month&&19===r.day?this.hat="pirate":10===r.month&&1===r.day?this.hat="coffee":10===r.month&&5===r.day?this.hat="education":12===r.month&&5===r.day?this.hat="ninja":12===r.month&&18===r.day?this.hat="knight":this.hat="none",this.editMode&&(this.hat="construction"),this.requestUpdate()}disableSuggestions(e){const t=this.shadowRoot.querySelectorAll("chat-suggestion");if(r.devStatement("Disabling previous suggestions.","info"),t.forEach((e=>{e.hasAttribute("disabled")||e.setAttribute("disabled","")})),!e.currentTarget.hasAttribute("chosen-prompt")){let s=!1;t.forEach((e=>{e.hasAttribute("chosen-prompt")&&(s=!0)})),s||e.currentTarget.setAttribute("chosen-prompt","")}}static get properties(){return{...super.properties,darkMode:{type:Boolean,attribute:"dark-mode",reflect:!0},editMode:{type:Boolean,attribute:"edit-mode",reflect:!0},hasSuggestedPrompts:{type:Boolean,attribute:"suggested-prompts"},hat:{type:String,attribute:"hat"},isSentPrompt:{type:Boolean,attribute:"sent-prompt"},message:{type:String,attribute:"message"},messageWasSuggestedPrompt:{type:Boolean,attribute:"suggested-message"},suggestedPrompts:{type:Array}}}}globalThis.customElements.define(ChatMessage.tag,ChatMessage);export{ChatMessage}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-suggestion.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-suggestion.js index 280d0e02..c6c3a29e 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-suggestion.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/chat-agent/lib/chat-suggestion.js @@ -5,14 +5,13 @@ import{DDD as e}from"../../d-d-d/d-d-d.js";import{css as t,html as s}from"../../../lit/index.js";import{autorun as i,toJS as r}from"../../../mobx/dist/mobx.esm.js";import{ChatStore as o}from"./chat-agent-store.js";class ChatSuggestion extends e{static get tag(){return"chat-suggestion"}constructor(){super(),this.chosenPrompt=!1,this.disabled=!1,this.promptType="",this.suggestion="", //! mobx this.messageIndex=null,this.userIndex=null,i((()=>{this.messageIndex=r(o.messageIndex)})),i((()=>{this.userIndex=r(o.userIndex)}))}static get styles(){return[super.styles,t` - /* https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation/ddd */ + /* https://haxtheweb.org/documentation/ddd */ :host { container-type: inline-size; display: block; } - .chat-suggestion-wrapper { align-items: center; border: var(--ddd-border-sm); @@ -24,7 +23,7 @@ this.messageIndex=null,this.userIndex=null,i((()=>{this.messageIndex=r(o.message display: flex; flex-direction: row; justify-content: center; - opacity: 1.0; + opacity: 1; } .suggestion-icon { @@ -71,14 +70,16 @@ this.messageIndex=null,this.userIndex=null,i((()=>{this.messageIndex=r(o.message background-color: var(--ddd-theme-default-futureLime); } - .chat-suggestion-wrapper:hover, .chat-suggestion-wrapper:focus { + .chat-suggestion-wrapper:hover, + .chat-suggestion-wrapper:focus { background-color: var(--ddd-theme-default-futureLime); } - .chat-suggestion-wrapper:hover p, .chat-suggestion-wrapper:focus p { + .chat-suggestion-wrapper:hover p, + .chat-suggestion-wrapper:focus p { text-decoration: underline; } - + :host([disabled]) p { text-decoration: none; } @@ -98,16 +99,20 @@ this.messageIndex=null,this.userIndex=null,i((()=>{this.messageIndex=r(o.message } } `]}render(){return s` -
+
-
+
-

- ${this.suggestion} -

+

${this.suggestion}

`}handleSuggestion(){this.disabled?o.devStatement("Suggestion buttons disabled, ignoring request","warn"):(o.devStatement(`Suggestion button pressed. Suggested prompt to send to Merlin: ${this.suggestion}`,"info"),o.handleMessage(o.userName,this.suggestion))}firstUpdated(){let e=this.shadowRoot.querySelector("simple-icon-lite");switch(this.promptType){case"suggestion":e.setAttribute("icon","question-answer"),e.style.color="var(--data-theme-primary, var(--ddd-primary-13))";break;case"network":e.setAttribute("icon","device:signal-cellular-connected-no-internet-0-bar"),e.style.color="var(--ddd-theme-default-coalyGray)";break;case"help":e.setAttribute("icon","help-outline"),e.style.color="var(--ddd-theme-default-original87Pink)";break;case"hax":e.setAttribute("icon","hax:hax2022"),e.style.color="var(--data-theme-primary, var(--ddd-primary-13))";break;default:e.setAttribute("icon","lrn:info"),e.style.color="var(--ddd-theme-default-skyBlue)"}}updated(){this.disabled&&this.shadowRoot.querySelector(".chat-suggestion-wrapper").removeAttribute("tabindex")}static get properties(){return{...super.properties,chosenPrompt:{type:Boolean,attribute:"chosen-prompt"},disabled:{type:Boolean},promptType:{type:String,attribute:"prompt-type"},suggestion:{type:String}}}}globalThis.customElements.define(ChatSuggestion.tag,ChatSuggestion);export{ChatSuggestion}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/course-design/lib/block-quote.haxProperties.json b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/course-design/lib/block-quote.haxProperties.json index e05b9d7d..2c256837 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/course-design/lib/block-quote.haxProperties.json +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/course-design/lib/block-quote.haxProperties.json @@ -1,8 +1,10 @@ { + "api": "1", + "type": "grid", "canScale": false, - "canEditSource": true, - "type": "grid", + "hideDefaultSettings": false, + "designSystem": false, "gizmo": { "title": "Block quote", "description": "Designed Quote", @@ -26,15 +28,13 @@ "property": "citation", "title": "Citation", "description": "The citation of the element", - "inputMethod": "textfield", - "icon": "icons:book" + "inputMethod": "textfield" }, { "property": "alt", "title": "Alt", "description": "The alt text for the image", - "inputMethod": "textfield", - "icon": "editor:text-fields" + "inputMethod": "textfield" }, { "property": "image", @@ -42,12 +42,15 @@ "description": "The image of the element", "inputMethod": "haxupload", "noVoiceRecord": true, - "validationType": "url", - "icon": "editor:insert-photo" + "validationType": "url" } ], "advanced": [] }, + "saveOptions": { + "wipeSlot": false, + "unsetAttributes": [] + }, "demoSchema": [ { "tag": "block-quote", diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/d-d-d/lib/d-d-docs.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/d-d-d/lib/d-d-docs.js index 5e293fcf..2cb023ae 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/d-d-d/lib/d-d-docs.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/d-d-d/lib/d-d-docs.js @@ -163,7 +163,10 @@ import{html as e,css as t}from"../../../lit/index.js";import{DDD as s}from"../d- `))}
`}renderHeaderSample(){let t=[];for(let s=0;s<22;s++)t.push(e`
- + Header Sample ${s} ${Array(6).fill().map(((t,a)=>e` diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/example-hax-element/example-hax-element.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/example-hax-element/example-hax-element.js index 9884ab0e..a4f71e00 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/example-hax-element/example-hax-element.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/example-hax-element/example-hax-element.js @@ -3,10 +3,10 @@ * @license Apache-2.0, see License.md for full text. */ import{LitElement as t,html as e,css as r}from"../../lit/index.js";export class ExampleHaxElement extends t{static get tag(){return"example-hax-element"}constructor(){super(),this.title=null,this.shiny=!1}static get properties(){return{title:{type:String},shiny:{type:Boolean,reflect:!0}}}static get styles(){return[r` - :host { - display: block; - } - :host([shiny]) h2 { - background-color: var(--ddd-theme-accent); - } - `]}render(){return e`

${this.title}

`}static get haxProperties(){return new URL(`./lib/${this.tag}.haxProperties.json`,import.meta.url).href}}globalThis.customElements.define(ExampleHaxElement.tag,ExampleHaxElement); \ No newline at end of file + :host { + display: block; + } + :host([shiny]) h2 { + background-color: var(--ddd-theme-accent); + } + `]}render(){return e`

${this.title}

`}static get haxProperties(){return new URL(`./lib/${this.tag}.haxProperties.json`,import.meta.url).href}}globalThis.customElements.define(ExampleHaxElement.tag,ExampleHaxElement); \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/example-hax-element/lib/example-hax-element.haxProperties.json b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/example-hax-element/lib/example-hax-element.haxProperties.json index efa3d8b9..a0a014fd 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/example-hax-element/lib/example-hax-element.haxProperties.json +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/example-hax-element/lib/example-hax-element.haxProperties.json @@ -10,10 +10,7 @@ "description": "Example Title text element", "icon": "icons:android", "color": "green", - "tags": [ - "Other", - "example" - ], + "tags": ["Other", "example"], "handles": [], "meta": { "author": "HAXTheWeb core team" @@ -50,4 +47,4 @@ "content": "" } ] -} \ No newline at end of file +} diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/full-width-image/lib/full-width-image.haxProperties.json b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/full-width-image/lib/full-width-image.haxProperties.json index dfec8811..89b04142 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/full-width-image/lib/full-width-image.haxProperties.json +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/full-width-image/lib/full-width-image.haxProperties.json @@ -42,7 +42,7 @@ { "tag": "full-width-image", "properties": { - "source": "//placekitten.com/800/800", + "source": "https://placehold.co/500x300", "caption": "Kitten, being kittens" }, "content": "" diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/hax-body-behaviors/lib/HAXWiring.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/hax-body-behaviors/lib/HAXWiring.js index f06c0a35..5bc1ca84 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/hax-body-behaviors/lib/HAXWiring.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/hax-body-behaviors/lib/HAXWiring.js @@ -2,4 +2,4 @@ * Copyright 2018 The Pennsylvania State University * @license Apache-2.0, see License.md for full text. */ -import{SimpleFields as e}from"../../simple-fields/simple-fields.js";import"./HAXFields.js";export class HAXWiring{constructor(){this.haxProperties={type:"element",editingElement:"core",hideDefaultSettings:!1,canScale:!1,canEditSource:!0,settings:{configure:[],advanced:[],developer:[]},wipeSlot:{}},this.setup=(e,t="",i=this)=>(void 0!==this.tagName&&(t=this.tagName.toLowerCase()),globalThis.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),void 0!==globalThis.HaxStore&&null!=globalThis.HaxStore.instance&&globalThis.HaxStore.instance.ready?this.setHaxProperties(e,t,i,!0):this.setHaxProperties(e,t,i,!1)),this._haxStoreReady=e=>{if(e.detail&&void 0!==this.tagName&&void 0!==this.haxProperties){let e=this.tagName,t=this.haxProperties,i=this;if(""!=e&&void 0===globalThis.HaxStore){const o=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});i.dispatchEvent(o)}else if(""!=e&&void 0===globalThis.HaxStore.instance.elementList[e.toLowerCase()]){const o=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});i.dispatchEvent(o)}else if(void 0!==this.tagName&&void 0===globalThis.HaxStore.instance.elementList[this.tagName.toLowerCase()]){const e=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:this.tagName.toLowerCase(),properties:t}});i.dispatchEvent(e)}}},this.setHaxProperties=async(e={},t="",i=document,o=!1)=>{if("string"==typeof e&&(e=await fetch(e).then((e=>!(!e||!e.json)&&e.json()))),void 0===e.api&&(e.api="1"),"1"==e.api){var s;if(void 0===e.type&&(e.type="element"),void 0===e.editingElement&&(e.editingElement="core"),void 0===e.hideDefaultSettings&&(e.hideDefaultSettings=!1),void 0===e.canScale&&(e.canScale=!0),void 0===e.designSystem&&(e.designSystem={primary:!1,accent:!1,text:!1,card:!1,designTreatment:!1}),void 0===e.canEditSource&&(e.canEditSource=!1),void 0===e.contentEditable&&(e.contentEditable=!1),void 0===e.gizmo)e.gizmo=!1;else if(void 0!==e.gizmo.iconLib)s=globalThis.WCGlobalBasePath?globalThis.WCGlobalBasePath:new URL("./HAXWiring.js",import.meta.url).href+"/../../../../",import(`${s}${e.gizmo.iconLib}`);if(void 0!==e.settings){void 0===e.settings.configure&&(e.settings.configure=[]);for(let t=0;t{if(""!=e&&void 0===globalThis.HaxStore){const o=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});i.dispatchEvent(o)}else if(""!=e){const o=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});i.dispatchEvent(o)}else if(void 0!==this.tagName){const e=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:this.tagName.toLowerCase(),properties:t}});i.dispatchEvent(e)}else if(void 0!==i.tagName){const e=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:i.tagName.toLowerCase(),properties:t}});i.dispatchEvent(e)}else console.warn(i),console.warn(`${e} missed our checks and has an issue in implementation with HAX`)},this.standardAdvancedProps=(e,t)=>(e.hideDefaultSettings||(e.settings.advanced.push({attribute:"data-hax-lock",title:"Lock editing",description:"Prevent changes to this element and all its content",inputMethod:"boolean"}),e.settings.developer.push({attribute:"class",title:"Classes",description:"CSS classes applied manually to the element",inputMethod:"textfield"}),e.settings.developer.push({attribute:"style",title:"Styles",description:"Custom CSS styles as applied to the element",inputMethod:"textfield"}),e.settings.developer.push({attribute:"prefix",title:"Schema: prefix",description:"Schema prefixes",inputMethod:"textfield"}),e.settings.developer.push({attribute:"typeof",title:"Schema: TypeOf",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.developer.push({attribute:"property",title:"Schema: Property",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.developer.push({attribute:"resource",title:"Schema: Resource ID",description:"Schema resource identifier",inputMethod:"textfield"}),e.settings.developer.push({attribute:"id",title:"ID",description:"element ID, only set this if you know why",inputMethod:"textfield"}),e.settings.developer.push({attribute:"slot",title:"slot",description:"DOM slot area",inputMethod:"textfield"})),e),this.validateSetting=e=>(void 0!==e.property||void 0!==e.slot||void 0!==e.attribute)&&(void 0===e.title&&(void 0===e.attribute?e.title=e.property:e.title=e.attribute),void 0===e.description&&(e.description=""),void 0===e.inputMethod&&(e.inputMethod="textfield"),void 0===e.type&&(e.type="settings"),void 0===e.icon&&(e.icon="android"),void 0===e.options&&(e.options={}),void 0===e.required&&(e.required=!1),void 0===e.disabled&&(e.disabled=!1),void 0===e.validation&&(e.validation=".*"),void 0===e.validationType&&(e.validationType=""),void 0!==e.slot&&(void 0===e.slotWrapper&&(e.slotWrapper="span"),void 0===e.slotAttributes&&(e.slotAttributes={})),e),this.getHaxProperties=()=>this.haxProperties,this.getHaxJSONSchema=(t,i,o=this)=>{void 0===t&&(t="configure"),void 0===i&&(i=o.haxProperties);let s=i.settings[t];var a={$schema:"http://json-schema.org/schema#",title:"HAX "+t+" form schema",type:"object",properties:{}};if(a.properties=(new e).fieldsToSchema(s),i.gizmo&&i.gizmo.tag&&globalThis.customElements.get(i.gizmo.tag)){let e=globalThis.document.createElement(i.gizmo.tag);a="function"==typeof e.postProcessgetHaxJSONSchema?e.postProcessgetHaxJSONSchema(a):o.postProcessgetHaxJSONSchema(a)}else a=o.postProcessgetHaxJSONSchema(a);return a},this.postProcessgetHaxJSONSchema=e=>e,this._getHaxJSONSchemaProperty=t=>(new e).fieldsToSchema(t),this.getHaxJSONSchemaType=t=>{var i=(new e).fieldsConversion.inputMethod[t]||(new e).fieldsConversion;return i&&i.defaultSettings&&i.defaultSettings.type?i.defaultSettings.type:"string"},this.validHAXPropertyInputMethod=()=>Object.keys((new e).fieldsConversion.inputMethod),this.prototypeHaxProperties=()=>({api:"1",type:"element",editingElement:"core",hideDefaultSettings:!1,canScale:!0,canEditSource:!0,contentEditable:!1,gizmo:{title:"Tag name",description:"",icon:"icons:android",color:"purple",tags:["Other"],handles:[{type:"data",type_exclusive:!1,url:"src"}],meta:{author:"auto"},requiresChildren:!1,requiresParent:!1},settings:{configure:[{slot:"",title:"Inner content",description:"The slotted content that lives inside the tag",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{slot:"button",title:"Button content",description:"The content that can override the button",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"title",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"primaryColor",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!1,validation:".*",validationType:"text"}],advanced:[{property:"secondaryColor",title:"Secondary color",description:"An optional secondary color used in certain edge cases.",inputMethod:"colorpicker",icon:"color"},{property:"endPoint",title:"API endpoint",description:"An optional endpoint to hit and load in more data dymaically.",inputMethod:"textfield",icon:"android",validation:"[a-z0-9]",validationType:"url"}],developer:[]},saveOptions:{wipeSlot:!1,unsetAttributes:["end-point","secondary-color"]},documentation:{howTo:"https://oer.hax.psu.edu/bto108/sites/haxcellence/welcome",purpose:"https://oer.hax.psu.edu/bto108/sites/haxcellence/welcome"},demoSchema:[{tag:"my-tag",content:"

inner html

",properties:{endPoint:"https://cdn2.thecatapi.com/images/9j5.jpg",primaryColor:"yellow",title:"A cat"}}]})}}export const HAXElement=function(t){return class extends t{constructor(){super(),this.windowControllers=new AbortController,this.HAXWiring=new HAXWiring}designSystemHAXProperties(e,t){return e}static get properties(){return{...super.properties,haxProperties:globalThis.HAXWiring.haxProperties}}setHaxProperties(e,t="",i=this){return""==t&&void 0!==this.tagName&&(t=this.tagName.toLowerCase()),globalThis.HaxStore&&null!=globalThis.HaxStore.instance&&globalThis.HaxStore.instance.ready?this.HAXWiring.setHaxProperties(e,t,i,!0):(globalThis.addEventListener("hax-store-ready",this._haxStoreReady.bind(this),{signal:this.windowControllers.signal}),this.HAXWiring.setHaxProperties(e,t,i,!1))}disconnectedCallback(){this.windowControllers.abort(),super.disconnectedCallback&&super.disconnectedCallback()}setup(e,t="",i=this){return this.HAXWiring.setup(e,"",this)}_haxStoreReady(e){return this.HAXWiring._haxStoreReady(e)}validateSetting(e){return this.HAXWiring.validateSetting(e)}getHaxProperties(){return this.haxProperties}getHaxJSONSchema(e,t,i=this){return this.HAXWiring.getHaxJSONSchema(e,t,i)}postProcessgetHaxJSONSchema(e){return this.HAXWiring.postProcessgetHaxJSONSchema(e)}_getHaxJSONSchemaProperty(t){return(new e).fieldsToSchema(t)}getHaxJSONSchemaType(e){return this.HAXWiring.getHaxJSONSchemaType(e)}validHAXPropertyInputMethod(){return this.HAXWiring.validHAXPropertyInputMethod()}prototypeHaxProperties(){return this.HAXWiring.prototypeHaxProperties()}}};globalThis.HAXWiring=new HAXWiring,globalThis.HAXBehaviors=globalThis.HAXBehaviors||{},globalThis.HAXBehaviors.PropertiesBehaviors={properties:{haxProperties:globalThis.HAXWiring.haxProperties},setHaxProperties:function(e,t="",i=this){return""==t&&void 0!==this.tagName&&(t=this.tagName.toLowerCase()),globalThis.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),void 0!==globalThis.HaxStore&&null!=globalThis.HaxStore.instance&&globalThis.HaxStore.instance.ready?globalThis.HAXWiring.setHaxProperties(e,t,i,!0):globalThis.HAXWiring.setHaxProperties(e,t,i,!1)},_haxStoreReady:function(e){return globalThis.HAXWiring._haxStoreReady(e)},validateSetting:function(e){return globalThis.HAXWiring.validateSetting(e)},getHaxProperties:function(){return this.haxProperties},getHaxJSONSchema:function(e,t,i=this){return globalThis.HAXWiring.getHaxJSONSchema(e,t,i)},postProcessgetHaxJSONSchema:function(e){return globalThis.HAXWiring.postProcessgetHaxJSONSchema(e)},_getHaxJSONSchemaProperty:function(t){return(new e).fieldsToSchema(t)},getHaxJSONSchemaType:function(e){return globalThis.HAXWiring.getHaxJSONSchemaType(e)},validHAXPropertyInputMethod:function(){return globalThis.HAXWiring.validHAXPropertyInputMethod()},prototypeHaxProperties:function(){return globalThis.HAXWiring.prototypeHaxProperties()}}; \ No newline at end of file +import{SimpleFields as e}from"../../simple-fields/simple-fields.js";import"./HAXFields.js";export class HAXWiring{constructor(){this.haxProperties={type:"element",editingElement:"core",hideDefaultSettings:!1,canScale:!1,canEditSource:!0,settings:{configure:[],advanced:[],developer:[]},wipeSlot:{}},this.setup=(e,t="",i=this)=>(void 0!==this.tagName&&(t=this.tagName.toLowerCase()),globalThis.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),void 0!==globalThis.HaxStore&&null!=globalThis.HaxStore.instance&&globalThis.HaxStore.instance.ready?this.setHaxProperties(e,t,i,!0):this.setHaxProperties(e,t,i,!1)),this._haxStoreReady=e=>{if(e.detail&&void 0!==this.tagName&&void 0!==this.haxProperties){let e=this.tagName,t=this.haxProperties,i=this;if(""!=e&&void 0===globalThis.HaxStore){const o=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});i.dispatchEvent(o)}else if(""!=e&&void 0===globalThis.HaxStore.instance.elementList[e.toLowerCase()]){const o=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});i.dispatchEvent(o)}else if(void 0!==this.tagName&&void 0===globalThis.HaxStore.instance.elementList[this.tagName.toLowerCase()]){const e=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:this.tagName.toLowerCase(),properties:t}});i.dispatchEvent(e)}}},this.setHaxProperties=async(e={},t="",i=document,o=!1)=>{if("string"==typeof e&&(e=await fetch(e).then((e=>!(!e||!e.json)&&e.json()))),void 0===e.api&&(e.api="1"),"1"==e.api){var s;if(void 0===e.type&&(e.type="element"),void 0===e.editingElement&&(e.editingElement="core"),void 0===e.hideDefaultSettings&&(e.hideDefaultSettings=!1),void 0===e.canScale&&(e.canScale=!0),void 0===e.designSystem&&(e.designSystem={primary:!1,accent:!1,text:!1,card:!1,designTreatment:!1}),void 0===e.canEditSource&&(e.canEditSource=!1),void 0===e.contentEditable&&(e.contentEditable=!1),void 0===e.gizmo)e.gizmo=!1;else if(void 0!==e.gizmo.iconLib)s=globalThis.WCGlobalBasePath?globalThis.WCGlobalBasePath:new URL("./HAXWiring.js",import.meta.url).href+"/../../../../",import(`${s}${e.gizmo.iconLib}`);if(void 0!==e.settings){void 0===e.settings.configure&&(e.settings.configure=[]);for(let t=0;t{if(""!=e&&void 0===globalThis.HaxStore){const o=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});i.dispatchEvent(o)}else if(""!=e){const o=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:e.toLowerCase(),properties:t}});i.dispatchEvent(o)}else if(void 0!==this.tagName){const e=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:this.tagName.toLowerCase(),properties:t}});i.dispatchEvent(e)}else if(void 0!==i.tagName){const e=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:i.tagName.toLowerCase(),properties:t}});i.dispatchEvent(e)}else console.warn(i),console.warn(`${e} missed our checks and has an issue in implementation with HAX`)},this.standardAdvancedProps=(e,t)=>(e.hideDefaultSettings||(e.settings.advanced.push({attribute:"data-hax-lock",title:"Lock editing",description:"Prevent changes to this element and all its content",inputMethod:"boolean"}),e.settings.developer.push({attribute:"class",title:"Classes",description:"CSS classes applied manually to the element",inputMethod:"textfield"}),e.settings.developer.push({attribute:"style",title:"Styles",description:"Custom CSS styles as applied to the element",inputMethod:"textfield"}),e.settings.developer.push({attribute:"prefix",title:"Schema: prefix",description:"Schema prefixes",inputMethod:"textfield"}),e.settings.developer.push({attribute:"typeof",title:"Schema: TypeOf",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.developer.push({attribute:"property",title:"Schema: Property",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.developer.push({attribute:"resource",title:"Schema: Resource ID",description:"Schema resource identifier",inputMethod:"textfield"}),e.settings.developer.push({attribute:"id",title:"ID",description:"element ID, only set this if you know why",inputMethod:"textfield"}),e.settings.developer.push({attribute:"slot",title:"slot",description:"DOM slot area",inputMethod:"textfield"})),e),this.validateSetting=e=>(void 0!==e.property||void 0!==e.slot||void 0!==e.attribute)&&(void 0===e.title&&(void 0===e.attribute?e.title=e.property:e.title=e.attribute),void 0===e.description&&(e.description=""),void 0===e.inputMethod&&(e.inputMethod="textfield"),void 0===e.type&&(e.type="settings"),void 0===e.icon&&(e.icon="android"),void 0===e.options&&(e.options={}),void 0===e.required&&(e.required=!1),void 0===e.disabled&&(e.disabled=!1),void 0===e.validation&&(e.validation=".*"),void 0===e.validationType&&(e.validationType=""),void 0!==e.slot&&(void 0===e.slotWrapper&&(e.slotWrapper="span"),void 0===e.slotAttributes&&(e.slotAttributes={})),e),this.getHaxProperties=()=>this.haxProperties,this.getHaxJSONSchema=(t,i,o=this)=>{void 0===t&&(t="configure"),void 0===i&&(i=o.haxProperties);let s=i.settings[t];var a={$schema:"http://json-schema.org/schema#",title:"HAX "+t+" form schema",type:"object",properties:{}};if(a.properties=(new e).fieldsToSchema(s),i.gizmo&&i.gizmo.tag&&globalThis.customElements.get(i.gizmo.tag)){let e=globalThis.document.createElement(i.gizmo.tag);a="function"==typeof e.postProcessgetHaxJSONSchema?e.postProcessgetHaxJSONSchema(a):o.postProcessgetHaxJSONSchema(a)}else a=o.postProcessgetHaxJSONSchema(a);return a},this.postProcessgetHaxJSONSchema=e=>e,this._getHaxJSONSchemaProperty=t=>(new e).fieldsToSchema(t),this.getHaxJSONSchemaType=t=>{var i=(new e).fieldsConversion.inputMethod[t]||(new e).fieldsConversion;return i&&i.defaultSettings&&i.defaultSettings.type?i.defaultSettings.type:"string"},this.validHAXPropertyInputMethod=()=>Object.keys((new e).fieldsConversion.inputMethod),this.prototypeHaxProperties=()=>({api:"1",type:"element",editingElement:"core",hideDefaultSettings:!1,canScale:!0,canEditSource:!0,contentEditable:!1,gizmo:{title:"Tag name",description:"",icon:"icons:android",color:"purple",tags:["Other"],handles:[{type:"data",type_exclusive:!1,url:"src"}],meta:{author:"auto"},requiresChildren:!1,requiresParent:!1},settings:{configure:[{slot:"",title:"Inner content",description:"The slotted content that lives inside the tag",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{slot:"button",title:"Button content",description:"The content that can override the button",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"title",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"primaryColor",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!1,validation:".*",validationType:"text"}],advanced:[{property:"secondaryColor",title:"Secondary color",description:"An optional secondary color used in certain edge cases.",inputMethod:"colorpicker",icon:"color"},{property:"endPoint",title:"API endpoint",description:"An optional endpoint to hit and load in more data dymaically.",inputMethod:"textfield",icon:"android",validation:"[a-z0-9]",validationType:"url"}],developer:[]},saveOptions:{wipeSlot:!1,unsetAttributes:["end-point","secondary-color"]},documentation:{howTo:"https://haxtheweb.org/welcome",purpose:"https://haxtheweb.org/welcome"},demoSchema:[{tag:"my-tag",content:"

inner html

",properties:{endPoint:"https://cdn2.thecatapi.com/images/9j5.jpg",primaryColor:"yellow",title:"A cat"}}]})}}export const HAXElement=function(t){return class extends t{constructor(){super(),this.windowControllers=new AbortController,this.HAXWiring=new HAXWiring}designSystemHAXProperties(e,t){return e}static get properties(){return{...super.properties,haxProperties:globalThis.HAXWiring.haxProperties}}setHaxProperties(e,t="",i=this){return""==t&&void 0!==this.tagName&&(t=this.tagName.toLowerCase()),globalThis.HaxStore&&null!=globalThis.HaxStore.instance&&globalThis.HaxStore.instance.ready?this.HAXWiring.setHaxProperties(e,t,i,!0):(globalThis.addEventListener("hax-store-ready",this._haxStoreReady.bind(this),{signal:this.windowControllers.signal}),this.HAXWiring.setHaxProperties(e,t,i,!1))}disconnectedCallback(){this.windowControllers.abort(),super.disconnectedCallback&&super.disconnectedCallback()}setup(e,t="",i=this){return this.HAXWiring.setup(e,"",this)}_haxStoreReady(e){return this.HAXWiring._haxStoreReady(e)}validateSetting(e){return this.HAXWiring.validateSetting(e)}getHaxProperties(){return this.haxProperties}getHaxJSONSchema(e,t,i=this){return this.HAXWiring.getHaxJSONSchema(e,t,i)}postProcessgetHaxJSONSchema(e){return this.HAXWiring.postProcessgetHaxJSONSchema(e)}_getHaxJSONSchemaProperty(t){return(new e).fieldsToSchema(t)}getHaxJSONSchemaType(e){return this.HAXWiring.getHaxJSONSchemaType(e)}validHAXPropertyInputMethod(){return this.HAXWiring.validHAXPropertyInputMethod()}prototypeHaxProperties(){return this.HAXWiring.prototypeHaxProperties()}}};globalThis.HAXWiring=new HAXWiring,globalThis.HAXBehaviors=globalThis.HAXBehaviors||{},globalThis.HAXBehaviors.PropertiesBehaviors={properties:{haxProperties:globalThis.HAXWiring.haxProperties},setHaxProperties:function(e,t="",i=this){return""==t&&void 0!==this.tagName&&(t=this.tagName.toLowerCase()),globalThis.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),void 0!==globalThis.HaxStore&&null!=globalThis.HaxStore.instance&&globalThis.HaxStore.instance.ready?globalThis.HAXWiring.setHaxProperties(e,t,i,!0):globalThis.HAXWiring.setHaxProperties(e,t,i,!1)},_haxStoreReady:function(e){return globalThis.HAXWiring._haxStoreReady(e)},validateSetting:function(e){return globalThis.HAXWiring.validateSetting(e)},getHaxProperties:function(){return this.haxProperties},getHaxJSONSchema:function(e,t,i=this){return globalThis.HAXWiring.getHaxJSONSchema(e,t,i)},postProcessgetHaxJSONSchema:function(e){return globalThis.HAXWiring.postProcessgetHaxJSONSchema(e)},_getHaxJSONSchemaProperty:function(t){return(new e).fieldsToSchema(t)},getHaxJSONSchemaType:function(e){return globalThis.HAXWiring.getHaxJSONSchemaType(e)},validHAXPropertyInputMethod:function(){return globalThis.HAXWiring.validHAXPropertyInputMethod()},prototypeHaxProperties:function(){return globalThis.HAXWiring.prototypeHaxProperties()}}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js index 8c44ed2c..fdf9f6c2 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/hax-body/lib/hax-store.js @@ -1,4 +1,4 @@ -import{LitElement as e,html as t,nothing as i}from"../../../lit/index.js";import{SimpleTourManager as a}from"../../simple-popover/lib/simple-tour.js";import{HaxSchematizer as o,HaxElementizer as r}from"../../hax-body-behaviors/lib/HAXFields.js";import{winEventsElement as n,getRange as s,stripMSWord as l,nodeToHaxElement as d,haxElementToNode as c,validURL as h,camelToDash as p,htmlEntities as m,localStorageGet as g,localStorageSet as u}from"../../utils/utils.js";import{observable as x,makeObservable as f,computed as b,configure as v,autorun as y,toJS as T}from"../../../mobx/dist/mobx.esm.js";v({enforceActions:!1});import{HAXElement as S}from"../../hax-body-behaviors/hax-body-behaviors.js";import{I18NMixin as H,I18NManagerStore as w}from"../../i18n-manager/lib/I18NMixin.js";import{enableServices as E}from"../../micro-frontend-registry/lib/microServices.js";import{SuperDaemonInstance as A}from"../../super-daemon/super-daemon.js";import"../../media-behaviors/media-behaviors.js";import"../../editable-table/editable-table.js";import"../../iframe-loader/iframe-loader.js";import"../../hax-iconset/lib/hax-iconset-manifest.js";import{UserScaffoldInstance as N}from"../../user-scaffold/user-scaffold.js";import"./hax-app.js";function sessionStorageGet(e){try{return sessionStorage.getItem(e)}catch(e){return!1}}function sessionStorageSet(e,t){try{return sessionStorage.setItem(e,t)}catch(e){return!1}}class HaxStore extends(H(n(S(e)))){testHook(e,t){return!!(e&&e.tagName&&this.HTMLPrimativeTest(e)&&this.primativeHooks[e.tagName.toLowerCase()]&&this.primativeHooks[e.tagName.toLowerCase()][t])||e&&"function"==typeof e.haxHooks&&e.haxHooks()[t]}async runHook(e,t,i=[]){return!!this.testHook(e,t)&&(this.HTMLPrimativeTest(e)?await this.primativeHooks[e.tagName.toLowerCase()][t](...i):await e[e.haxHooks()[t]](...i))}getSelection(){if(this.activeHaxBody&&this.activeHaxBody.parentNode){if(this.activeHaxBody.parentNode.getSelection)return this.activeHaxBody.parentNode.getSelection();try{if(s(this.activeHaxBody.parentNode))return s(this.activeHaxBody.parentNode)}catch(e){}}return globalThis.getSelection()}getRange(){let e=this.getSelection();return e&&e.getRangeAt&&e.rangeCount?e.getRangeAt(0):e||!1}guessGizmo(e,t,i=!1,a=!1){var o=[],r=[];if(void 0!==e&&this.validGizmoTypes.includes(e))for(let n in this.gizmoList){let s=T(this.gizmoList[n]),l=t.innerHTML?{innerHTML:t.innerHTML}:{},d=!1;if(s&&s.handles)for(let n=0;n{t&&t.type&&""!=t.type&&(e[t.type.toLowerCase()]=!0)})),s.tags&&s.tags.length>0&&[...s.tags].forEach((t=>{t&&""!=t&&(e[t.toLowerCase()]=!0)})),s.keywords=Object.keys(e),r.includes(s.tag)||(o.push(this.haxElementPrototype(s,l,"")),r.push(s.tag))}}}}return o}insertLogicFromValues(e,t,i=!1,a=!1){let o=this.activePlaceHolderOperationType||this.guessGizmoType(e);if("upload-only"===o)return this.toast("Upload successful!"),!1;"link"===this.activePlaceHolderOperationType&&(a=!0),this.activePlaceHolderOperationType=null;let r=o,n=!0;if("*"==o){if(i)return!1;n=!1,r="link"}let s=this.guessGizmo(o,e,!1,n);return s.length>0?(1===s.length||a?1===s.length&&void 0!==s[0].tag?t.dispatchEvent(new CustomEvent("hax-insert-content",{bubbles:!0,cancelable:!0,composed:!0,detail:s[0]})):a&&t.dispatchEvent(new CustomEvent("hax-insert-content",{bubbles:!0,cancelable:!0,composed:!0,detail:s.find((e=>"a"==e.tag))})):this.haxAppPicker.presentOptions(s,o,"Pick how to present this "+r,"gizmo"),!0):(this.toast("Sorry, HAX doesn't know how to handle that type of link yet."),!1)}write(e,t,i){i&&i.dispatchEvent(new CustomEvent("hax-store-write",{composed:!0,bubbles:!0,cancelable:!1,detail:{property:e,value:t,owner:i}}))}mimeTypeToGizmoType(e){let t=e.split("/");switch(t[0]){case"audio":return"audio";case"image":return"svg+xml"==t[1]?"svg":"image";case"video":return"video";case"text":return["csv","html","markdown"].includes(t[1])?t[1]:"document";case"application":return"pdf"==t[1]?"pdf":["zip","gzip","x-tar"].includes(t[1])?"archive":"document"}}guessGizmoType(e){if(void 0!==e.source){const t=e.source.toLowerCase();if(-1!=t.indexOf(".mp3")||-1!=t.indexOf(".midi")||-1!=t.indexOf(".mid"))return"audio";if(-1!=t.indexOf(".png")||-1!=t.indexOf(".jpg")||-1!=t.indexOf(".jpeg"))return"image";if(-1!=t.indexOf(".gif"))return"gif";if(-1!=t.indexOf(".pdf"))return"pdf";if(-1!=t.indexOf(".svg"))return"svg";if(-1!=t.indexOf(".csv"))return"csv";if(-1!=t.indexOf(".md"))return"markdown";if(-1!=t.indexOf(".html")||-1!=t.indexOf(".htm"))return"html";if(-1!=t.indexOf(".txt")||-1!=t.indexOf(".doc")||-1!=t.indexOf(".docx")||-1!=t.indexOf(".xls")||-1!=t.indexOf(".xlsx")||-1!=t.indexOf(".vtt")||-1!=t.indexOf(".ppt"))return"document";if(-1!=t.indexOf(".zip")||-1!=t.indexOf(".tar.gz")||-1!=t.indexOf(".tar"))return"archive";if("external"!=globalThis.MediaBehaviors.Video.getVideoType(t))return"video"}return"*"}render(){return t` `}static get tag(){return"hax-store"}toast(e,t=2e3,i={},a="capsule",o=this.t.close,r=null,n=null){globalThis.dispatchEvent(new CustomEvent(this.toastShowEventName,{bubbles:!0,composed:!0,cancelable:!0,detail:{text:e,duration:t,classStyle:a,closeText:o,eventCallback:r,slot:n,...i}}))}static get properties(){return{...super.properties,skipHAXConfirmation:{type:Boolean,reflect:!0,attribute:"skip-hax-confirmation"},storageData:{type:Object},haxTray:{type:Object},haxCancel:{type:Object},haxAutoloader:{type:Object},haxBodies:{type:Array},activePlaceHolder:{type:Object},activePlaceHolderOperationType:{type:String},appStore:{type:Object},sessionObject:{type:Object},skipExitTrap:{type:Boolean},elementList:{type:Object},staxList:{type:Array},validTagList:{type:Array},validGridTagList:{type:Array},validGizmoTypes:{type:Array},_isSandboxed:{type:Boolean},__appStoreData:{type:Object},ready:{type:Boolean},connectionRewrites:{type:Object}}}_storageDataChanged(e){e&&this.ready&&this.__storageDataProcessed&&(g("haxConfirm",!1)?u("haxUserData",e):sessionStorageGet("haxConfirm")&&sessionStorageSet("haxUserData",e))}isSingleSlotElement(e){let t=Object.keys(this.slotsSchemaFromNode(e));return 1==t.length&&0===t[0].length}isTextElement(e){let t;return null!=e&&e.tagName?t=e.tagName.toLowerCase():null!=e&&e.tag&&(t=e.tag.toLowerCase()),!!(t&&this.validTagList.includes(t)&&["p","ol","ul","li","a","h1","h2","h3","h4","h5","h6","strike","u","b","sub","sup","span","mark","abbr","i","bold","em","strong","blockquote","code","figure"].includes(t))}isInlineElement(e){let t;return null!=e&&e.tagName?t=e.tagName.toLowerCase():null!=e&&e.tag?t=e.tag.toLowerCase():"string"==typeof e&&(t=e),!!(t&&this.validTagList.includes(t)&&(this.haxSchemaFromTag(t)&&this.haxSchemaFromTag(t).meta&&this.haxSchemaFromTag(t).meta.inlineOnly||["a","strike","u","b","sub","sup","span","code","mark","abbr","i","bold","em","strong"].includes(t)))}isGridPlateElement(e){let t;return e&&e.tagName?t=e.tagName.toLowerCase():e&&e.tag&&(t=e.tag.toLowerCase()),!(!t||!this.validGridTagList.includes(t))}isLayoutElement(e){let t=e&&e.tagName&&this.haxSchemaFromTag(e.tagName)||{};return t.type&&"grid"===t.type}isLayoutSlot(e){return!(!e||!e.parentNode)&&this.isLayoutElement(e.parentNode)}isOriginalGridPlate(e){return!!e&&"GRID-PLATE"===e.tagName}activeSchema(){return this.activeNode?this.haxSchemaFromTag(this.activeNode.tagName):void 0}activeParentSchema(){return this.activeNode&&this.activeNode.parentNode?this.haxSchemaFromTag(this.activeNode.parentNode.tagName):void 0}slottedContentByNode(e){let t={...this.slotsSchemaFromNode(e)||{}};return e?([...e.children||[]].forEach((e=>{e.slot&&""!==e.slot&&t[e.slot]?(t[e.slot].items=t[e.slot].items||[],t[e.slot].items.push(e)):e.slot&&""!==e.slot||!t[""]||(t[""].items=t[""].items||[],t[""].items.push(e))})),t):t}slotsSchemaFromNode(e){if(!e||!e.tagName)return{};let t={},i=this.haxSchemaFromTag(e.tagName||{}),a=this.slotsFromSchema(i);if(this.isOriginalGridPlate(e)){(e.layout||"1-1-1-1").split("-").map(((e,t)=>{a.push({slot:`col-${t+1}`,title:`Column ${t+1}`,excludedSlotWrappers:["grid-plate"]})}))}return a.forEach((a=>{a.items=void 0,a.label=a.title||a.slot,a.editMode={...i.editMode,...a.editMode},a.grid=e,(a.slot||""===a.slot)&&(t[a.slot]=a)})),t}schemaBySlotId(e,t){return(this.slotsSchemaFromNode(e)||{})[t]}_appStoreChanged(e,t){e&&t&&(e.url&&!e.apps&&this.shadowRoot?this.loadAppStoreFromRemote():this.__appStoreData=e)}async _loadAppStoreData(e){if(null!=e){var t={};if(void 0!==e.autoloader){e.autoloader=Object.assign({},e.autoloader);for(let i in e.autoloader){let a=i,o=e.autoloader[i];isNaN(a)||(a=e.autoloader[i],o=`@haxtheweb/${a}/${a}.js`),"string"!=typeof o&&(o.haxProperties&&this.setHaxProperties(e.autoloader[i].haxProperties,a),o=e.autoloader[i].import),this.validTagList.push(a),t[a]=o}}if(void 0!==e.apps){var i=e.apps;for(let e=0;e{globalThis.customElements.get(a)&&globalThis.customElements.get(a).haxProperties?this.setHaxProperties(globalThis.customElements.get(a).haxProperties,a):t.appendChild(globalThis.document.createElement(a))})).catch((e=>{console.warn(e),t.appendChild(globalThis.document.createElement(a))}))}}isExternalURLImport(e){let t;try{t=new URL(e)}catch(e){return!1}return new URL(t).origin!==location.origin}_editModeChanged(e){e&&!this.appStoreLoaded&&this.__appStoreData&&this.haxAutoloader&&(clearTimeout(this.__readyToProcessAppStoreData),this._loadAppStoreData(this.__appStoreData))}async _globalPreferencesChanged(e){if(this.__storageDataProcessed&&e&&this.ready){let t=this.storageData;"string"==typeof t&&(t=JSON.parse(t)),t.globalPreferences=e,this.storageData=t,this._storageDataChanged(this.storageData),e.haxLang&&HAXStore.editMode&&(clearTimeout(this._debounceLang),this._debounceLang=setTimeout((async()=>{for(let e in this.elementList){let t=this.elementList[e];t=await this.attemptGizmoTranslation(e,t),this.elementList[e]=t}this.gizmoList.forEach((e=>{this.elementList[e.tag].gizmo.title&&(e.title=this.elementList[e.tag].gizmo.title),this.elementList[e.tag].gizmo.description&&(e.description=this.elementList[e.tag].gizmo.description)}))}),100))}}_haxConsentTap(e){u("haxConfirm",!0),u("haxUserData",JSON.stringify(this.storageData))}updated(e){super.updated&&super.updated(e),e.forEach(((e,t)=>{"appStore"==t&&this[t]&&this._appStoreChanged(this[t],e),["ready","__appStoreData","haxAutoloader"].includes(t)&&this.ready&&this.__appStoreData&&this.haxAutoloader&&(clearTimeout(this.__readyToProcessAppStoreData),this.__readyToProcessAppStoreData=setTimeout((()=>{this._loadAppStoreData(this.__appStoreData)}),0)),["haxAutoloader","haxTray","haxCancel"].includes(t)&&(clearTimeout(this.__storeReady),this.__storeReady=setTimeout((()=>{this._storePiecesAllHere(this.haxAutoloader,this.activeHaxBody,this.haxTray,this.haxCancel)}),0))}))}_calculateActiveGizmo(e){if(null==e||!e.tagName)return null;for(let i in this.gizmoList){var t=this.gizmoList[i];if(t.tag===e.tagName.toLowerCase())return t}}loadAppStoreFromRemote(){const e=new URLSearchParams(this.appStore.params);let t=this.appStore.url;e&&(t+=`?${e}`),fetch(t,{method:this.method}).then((e=>{if(e.ok)return e.json()})).then((e=>{this.__appStoreData=e}))}firstUpdated(e){if(super.firstUpdated&&super.firstUpdated(e),this.skipHAXConfirmation&&(sessionStorageSet("haxConfirm",!0),u("haxConfirm",!0)),sessionStorageGet("haxConfirm")||g("haxConfirm"))if(sessionStorageGet("haxConfirm")&&!g("haxConfirm"))try{let e=sessionStorageGet("haxUserData")?JSON.parse(sessionStorageGet("haxUserData")):{};this.storageData=e,this._storageDataChanged(this.storageData)}catch(e){}else try{let e=g("haxUserData",{});this.storageData=e,this._storageDataChanged(this.storageData)}catch(e){}else{sessionStorageSet("haxConfirm",!0);let e="\n The HAX content editor keeps preferences in order to improve your experience.\n This data is stored in your browser and is never sent anywhere.\n Click to accept.\n ";this.toast(e,"-1",{},"fit-bottom","I Accept","hax-consent-tap")}setTimeout((()=>{this.__storageDataProcessed=!0,this.storageData.globalPreferences&&this.write("globalPreferences",this.storageData.globalPreferences,this)}),0)}_storePiecesAllHere(e,t,i,a){if(!this.ready&&t&&e&&i&&a){this.dispatchEvent(new CustomEvent("hax-store-ready",{bubbles:!0,cancelable:!1,composed:!0,detail:!0}));let e=globalThis.RichTextEditorPrompt.requestAvailability();e&&(e.shadowRoot.querySelector("#formfields").schematizer=o,e.shadowRoot.querySelector("#formfields").elementizer=r),i.shadowRoot.querySelector("#haxcancelbutton")&&(a.shadowRoot.querySelector("#dialog").associateEvents(i.shadowRoot.querySelector("#haxcancelbutton")),a.shadowRoot.querySelector("#dialog")&&globalThis.addEventListener("simple-modal-confirmed",this._handleConfirmCancel.bind(this))),this.ready=!0,this._buildPrimitiveDefinitions()}}_handleConfirmCancel(e){e.detail.invokedBy===this.haxTray.shadowRoot.querySelector("#haxcancelbutton")&&(this.editMode=!1,this.dispatchEvent(new CustomEvent("hax-cancel",{bubbles:!0,composed:!0,cancelable:!1,detail:e.detail})))}_positionCursorInNode(e,t=0){this.activeHaxBody.positionContextMenus();var i=globalThis.document.createRange(),a=this.getSelection();return i.setStart(e,t),i.collapse(!0),a.removeAllRanges(),a.addRange(i),i}_onBeforeUnload(e){if(!this.skipExitTrap&&this.editMode)return"Are you sure you want to leave? Your work will not be saved!"}isBase64(e){try{return btoa(atob(e))==e}catch(e){return!1}}retrieveImageFromClipboardAsBlob(e,t){if(0==e.clipboardData&&"function"==typeof t)return t(void 0);var i=e.clipboardData.items;if(null==i&&"function"==typeof t)return t(void 0);for(let e=0;e{for(var i in e)i.startsWith("hax")||(this.activeNode.dataset[i]=e[i]);t&&this.activeNode.setAttribute("slot",t)}),0)}}async _onPaste(e){if(this.editMode&&"HAX-TRAY"!==globalThis.document.activeElement.tagName&&"BODY"!==globalThis.document.activeElement.tagName&&"SIMPLE-MODAL"!==globalThis.document.activeElement.tagName){this.isTextElement(this.activeNode)||(this.activeNode=this.activeHaxBody.haxInsert("p","",{}));let o="",r="";if(e.clipboardData||e.originalEvent.clipboardData?(o=(e.originalEvent||e).clipboardData.getData("text/html"),""==o&&(o=(e.originalEvent||e).clipboardData.getData("text"))):globalThis.clipboardData&&(o=globalThis.clipboardData.getData("Text")),o=o.trim(),o=o.replace(/\s*?<\/span>/g," "),o=o.replace(/(?:style="(\S+:\s*[^;"]+;\s*)*)+"/g,""),o=o.replace(/
/g,"

"),r=o,this.isBase64(r))return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.retrieveImageFromClipboardAsBlob(e,(t=>{if(t){var i=globalThis.URL||globalThis.webkitURL;let a=globalThis.document.createElement("img");a.src=i.createObjectURL(t),this.activeNode.parentNode.insertBefore(a,this.activeNode.nextElementSibling);for(let t in e.clipboardData.items)!e.clipboardData.items[t].name&&e.clipboardData.items[t].type&&(e.clipboardData.items[t].name="image-"+Math.floor(Date.now()/1e3)+e.clipboardData.items[t].type.replace("image/","."));return e.dataTransfer=e.clipboardData,e.placeHolderElement=a,this.dispatchEvent(new CustomEvent("place-holder-file-drop",{bubbles:!0,cancelable:!0,composed:!0,detail:e})),a}return!1}));if(e.clipboardData.files.length>0){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();let t=this.activeHaxBody.haxInsert("p","",{});e.dataTransfer=e.clipboardData;for(let t in e.clipboardData.files)!e.clipboardData.files[t].name&&e.clipboardData.files[t].type&&(e.clipboardData.files[t].name="image-"+Math.floor(Date.now()/1e3)+e.clipboardData.files[t].type.replace("image/","."));e.placeHolderElement=t,this.dispatchEvent(new CustomEvent("place-holder-file-drop",{bubbles:!0,cancelable:!0,composed:!0,detail:e}))}let n=!1,s="",d=globalThis.document.createElement("div");d.innerHTML=o;let p=[];if(d.children&&(o=l(o),o=o.replace(/

/g,"

"),o=o.replace(/<\/h1>/g,"

"),o=o.replace(//g,(function(e,t){return``})),p=await this.htmlToHaxElements(o),1!==p.length||this.__validGridTags().includes(p[0].tag)||(p=await this.htmlToHaxElements(p[0].content))),0===p.length&&h(o)){""!=this.activeNode.innerText.trim()&&(n=!0);let e={source:o,title:o};if(!n&&!this.insertLogicFromValues(e,this,!1,!0))return!1}else if(0===p.length){if(n=!0,r==o)return!1;s=o}else if(1===p.length&&"p"===p[0].tag)s=o,n=!0;else if(1===p.length&&"a"===p[0].tag&&p[0].properties.href)if(""!=this.activeNode.innerText.trim())s=p[0].properties.href,n=!0;else{let e={source:p[0].properties.href,title:p[0].content};if(!this.insertLogicFromValues(e,this))return!1}else{if(!this.isGridPlateElement(p[0]))return!1;for(let e in p){"p"==p[e].tag&&["li","ol","ul"].includes(this.activeNode.tagName.toLowerCase())&&(p[e].tag="li"),delete p[e].properties.style,delete p[e].properties.start,delete p[e].properties.align;let t=c({tag:p[e].tag,content:p[e].content.replace(/ <\/span>/g," ").trim(),properties:p[e].properties});s+=await this.nodeToContent(t)}}e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();try{let e=this.getRange(),r=this.getSelection(),l=globalThis.document.createElement("div");if(l.innerHTML=s,e&&r){for(let e in l.children)l.children[e].tagName&&this.isTextElement(l.children[e])&&""===l.children[e].innerHTML&&l.children[e].remove();if(n){let t;if(h(o))t=globalThis.document.createElement("a"),t.setAttribute("href",o),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t.innerText=o;else if(l.children&&l.children.length>0){for(;l.childNodes.length>1;)e.insertNode(Array.from(l.childNodes).pop());t=Array.from(l.childNodes).pop()}else t=globalThis.document.createTextNode(l.innerHTML);e.deleteContents(),e.insertNode(t),setTimeout((()=>{this._positionCursorInNode(t,t.length)}),0)}else{var t,i,a;for(""!=this.activeNode.innerText.trim()&&e.endOffset!=this.activeNode.innerText.length&&(t=!0,globalThis.document.execCommand("insertParagraph")),e.commonAncestorContainer&&e.commonAncestorContainer.parentNode&&(a||this.activeNode==e.commonAncestorContainer||(a=e.commonAncestorContainer.parentNode)||(a=e.commonAncestorContainer));l.firstElementChild;)i=l.firstElementChild,a?(a.getAttribute&&a.getAttribute("slot")&&i.setAttribute("slot",a.getAttribute("slot")),t?(this.activeHaxBody.haxReplaceNode(a.previousElementSibling,i),t=!1):a.parentNode?a.parentNode.insertBefore(i,a.nextElementSibling):a.insertBefore(i,a.nextElementSibling)):this.activeNode?(this.activeNode.getAttribute("slot")&&i.setAttribute("slot",this.activeNode.getAttribute("slot")),""==this.activeNode.innerText.trim()?this.activeHaxBody.haxReplaceNode(this.activeNode,i):this.activeNode.parentNode.insertBefore(i,this.activeNode.nextElementSibling)):this.activeHaxBody.appendChild(i),a=i;setTimeout((()=>{i&&i.childNodes&&i.childNodes[0]&&(this._positionCursorInNode(i.childNodes[0],i.childNodes[0].length),i=null,a=null)}),0)}}}catch(e){console.warn(e)}}}__validGridTags(){return["p","ol","ul","li","div","h1","h2","h3","h4","h5","h6","blockquote","code","section","dl","dd","dt","figure"]}__validTags(){return["p","div","span","mark","abbr","table","caption","sup","sub","u","strike","tr","th","td","ol","ul","li","a","strong","kbd","tt","em","i","b","hr","h1","h2","h3","h4","h5","h6","blockquote","code","figure","figcaption","img","iframe","video","audio","section","dl","dt","dd","template","webview"]}__validGizmoTypes(){return["data","video","audio","text","link","file","pdf","image","csv","doc","document","archive","markdown","html","content","text","gif","inline","*"]}constructor(){super(),E(["core"]),this.toastShowEventName=globalThis.HAXCMS?"haxcms-toast-show":"simple-toast-show",this.t={close:"Close"},void 0!==globalThis.speechSynthesis&&(globalThis.SpeechRecognition||globalThis.webkitSpeechRecognition||globalThis.mozSpeechRecognition||globalThis.msSpeechRecognition||globalThis.oSpeechRecognition)&&(A.voiceSearch=!0),A.icon="hax:wizard-hat",A.allowedCallback=()=>!(!this.ready||!this.editMode),A.defineOption({title:"Insert emoji",icon:"editor:insert-emoticon",tags:["emoji"],value:{name:"Insert emoji",context:"/",program:async(e,t)=>{let i=[],a=globalThis.document.createElement("textarea");return await Object.keys(globalThis.SimplePickerEmojis).forEach((async t=>{await globalThis.SimplePickerEmojis[t].forEach((async o=>{(""==e||o.description.includes(e))&&(a.innerHTML=o.value,i.push({title:o.description,textCharacter:a.value,tags:[t],value:{target:this,method:"_insertTextResult",args:[a.value]},context:["/","/HAX/text/emoji/"+a.value],eventName:"super-daemon-element-method",path:"/HAX/text/emoji/"+a.value}))}))})),i}},context:["HAX","/"],eventName:"super-daemon-run-program",path:"/HAX/text/emoji"}),A.defineOption({title:"Insert symbol",icon:"editor:functions",tags:["symbol"],value:{name:"Insert symbol",context:"/",program:async(e,t)=>{let i=[],a=globalThis.document.createElement("textarea");return await Object.keys(globalThis.SimplePickerSymbols).forEach((async t=>{await globalThis.SimplePickerSymbols[t].forEach((async o=>{(""==e||t.includes(e))&&(a.innerHTML=o.value,i.push({title:`${t}: ${a.value}`,textCharacter:a.value,tags:[t],value:{target:this,method:"_insertTextResult",args:[a.value]},context:["/","/HAX/text/symbol/"+a.value],eventName:"super-daemon-element-method",path:"/HAX/text/symbol/"+a.value}))}))})),i}},context:["HAX","/"],eventName:"super-daemon-run-program",path:"/HAX/text/symbol"}),A.defineOption({title:"Join our Community",icon:"hax:discord",priority:-100,tags:["community","discord","chat","help"],value:{target:this,method:"_openExternalLink",args:["https://bit.ly/hax-discord"]},eventName:"super-daemon-element-method",path:"HAX/community/join",context:["logged-in","CMS","HAX"]}),A.defineOption({title:"User Tutorials",icon:"hax:hax2022",priority:-1e3,tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/tutorials"]},eventName:"super-daemon-element-method",path:"HAX/community/tutorials",context:["logged-in","CMS","HAX"]}),A.defineOption({title:"User Documentation",icon:"hax:hax2022",tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation"]},eventName:"super-daemon-element-method",path:"HAX/community/documentation",context:["logged-in","CMS","HAX"]}),A.defineOption({title:"HAX Teaching Excellence",icon:"hax:hax2022",tags:["Ontology","community","pedagogy","documentation","help"],value:{target:this,method:"_openExternalLink",args:["https://oer.hax.psu.edu/bto108/sites/haxcellence/ontology"]},eventName:"super-daemon-element-method",path:"HAX/community/pedagogy",context:["logged-in","CMS","HAX"]}),A.defineOption({title:"Bug / issue",icon:"mdi-social:github-circle",tags:["Bug report","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["bug","POP,bug"]},eventName:"super-daemon-element-method",path:"HAX/community/contribute",context:["logged-in","CMS","HAX"]}),A.defineOption({title:"Idea / Feature request",icon:"mdi-social:github-circle",tags:["Feature request","idea","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["feature","POP,enhancement"]},context:["logged-in","CMS","HAX"],eventName:"super-daemon-element-method",path:"HAX/community/contribute"}),this.primativeHooks={},this.__dragTarget=null,this.registerLocalization({context:this,namespace:"hax",basePath:import.meta.url+"/../../",locales:["es"]}),this.appSearch=null,this.method="GET",this.haxSelectedText="",this.__winEvents={"hax-super-daemon-insert-tag":"_superDaemonInsert","hax-register-properties":"_haxStoreRegisterProperties","hax-consent-tap":"_haxConsentTap",onbeforeunload:"_onBeforeUnload",paste:"_onPaste",command:"_onCommand","hax-register-app":"_haxStoreRegisterApp","hax-register-stax":"_haxStoreRegisterStax","hax-register-core-piece":"_haxStorePieceRegistrationManager","hax-register-body":"_haxStoreRegisterBody","hax-insert-content":"_haxStoreInsertContent","hax-insert-content-array":"_haxStoreInsertMultiple","hax-refresh-tray-form":"refreshActiveNodeForm","rich-text-editor-prompt-open":"_richTextEditorPromptOpen","rich-text-editor-prompt-confirm":"_richTextEditorPromptConfirm"},globalThis.onbeforeunload=e=>{if(!this.skipExitTrap&&this.editMode){var t="Are you sure you want to leave? Your work will not be saved!";return e.returnValue=t,t}},a.registerNewTour({key:"hax",name:"Let's learn HAX",style:"\n simple-popover-manager::part(simple-popover) {\n max-width: 250px;\n }\n simple-popover-manager button {\n font-size: 12px;\n margin: 0px 2px;\n }\n simple-popover-manager p {\n padding: 0;\n margin: 0;\n font-size: 14px;\n line-height: 20px;\n }\n simple-popover-manager h3 {\n margin: 8px 2px;\n }"}),this.skipHAXConfirmation=!1,this.storageData={},this.appStore={url:"",params:{}},this.daemonKeyCombo=`${A.key1} + ${A.key2} + `,this.activeNode=null,this.activeEditingElement=null,this.haxBodies=[],this.activePlaceHolder=null,this.activePlaceHolderOperationType=null,this.sessionObject={},this.editMode=!1,this.skipExitTrap=!1,this.appStoreLoaded=!1,this.elementList={},this.elementAlign=g("hax-tray-elementAlign"),this.elementAlign&&null!=this.elementAlign||(this.elementAlign="left"),this.trayStatus="collapsed",this.trayDetail="content-edit",this.appList=[],this.gizmoList=[],this.recentGizmoList=N.readMemory("recentGizmoList")||[],this.haxAutoloader=null,this.activeHaxBody=null,this.haxTray=null,this.haxCancel=null,this.staxList=[],this.globalPreferences={},this.activeApp={},this.connectionRewrites={},this.daemonCommands={},this.keyboardShortcuts={"#":{tag:"h2",content:""},"##":{tag:"h3",content:""},"###":{tag:"h4",content:""},"####":{tag:"h5",content:""},"#####":{tag:"h6",content:""},"######":{tag:"h6",content:""},"1.":{tag:"ol",content:"
  • "},"-":{tag:"ul",content:"
  • "},"*":{tag:"ul",content:"
  • "},"+":{tag:"ul",content:"
  • "},"---":{tag:"hr"},"***":{tag:"hr"},___:{tag:"hr"},"```":{tag:"code",content:""},">":{tag:"blockquote",content:""}},this.__primsBuilder={caption:{title:"Caption",icon:"av:call-to-action"},video:{title:"Video",icon:"av:play-circle-filled"},audio:{title:"Audio",icon:"image:music-note"},section:{title:"Section",icon:"image:crop-landscape"},dl:{title:"Data list",icon:"editor:format-list-bulleted"},dt:{title:"Data term",icon:"editor:format-list-bulleted"},dd:{title:"Data definition",icon:"editor:format-list-bulleted"},ol:{title:"Numbered list",icon:"editor:format-list-numbered"},ul:{title:"Bulleted list",icon:"editor:format-list-bulleted"},li:{title:"List item",icon:"editor:format-list-bulleted"},h1:{title:"Heading",icon:"hax:h1"},h2:{title:"Heading",icon:"hax:h2",tags:["Text","h2","html","text","heading","header"]},h3:{title:"Heading",icon:"hax:h3"},h4:{title:"Heading",icon:"hax:h4"},h5:{title:"Heading",icon:"hax:h5"},h6:{title:"Heading",icon:"hax:h6"},strike:{title:"Cross out",icon:"editor:format-strikethrough"},u:{title:"Underline",icon:"editor:format-underlined"},sub:{title:"Subscript",icon:"mdextra:subscript"},sup:{title:"Superscript",icon:"mdextra:superscript"},div:{title:"DIV",icon:"image:crop-landscape"},span:{title:"SPAN",icon:"editor:short-text",handles:[{type:"inline",text:"text"}]},i:{title:"Italic",icon:"editor:format-italic"},em:{title:"Emphasis",icon:"editor:format-italic"},strong:{title:"Bold",icon:"editor:format-bold"},b:{title:"Bold",icon:"editor:format-bold"},blockquote:{title:"Block quote",icon:"editor:format-quote"},code:{title:"Code",icon:"icons:code"},embed:{title:"Embedded object",icon:"icons:fullscreen"}},this.validTagList=this.__validTags(),this.validGridTagList=this.__validGridTags(),this.validGizmoTypes=this.__validGizmoTypes();let e=globalThis.document.createElement("webview");this._isSandboxed="function"==typeof e.reload,globalThis.document.body.style.setProperty("--hax-ui-headings","#d4ff77"),this.revisionHistoryLink=null,f(this,{daemonKeyCombo:x,gizmoList:x,recentGizmoList:x,activeNode:x,globalPreferences:x,activeGizmo:b,activeNodeIndex:b,editMode:x,revisionHistoryLink:x,elementAlign:x,trayStatus:x,trayDetail:x,appList:x,activeApp:x,haxSelectedText:x,activeEditingElement:x,activeHaxBody:x,appStoreLoaded:x}),y((()=>{this._globalPreferencesChanged(T(this.globalPreferences))})),y((()=>{this._editModeChanged(T(this.editMode))})),y((()=>{const e=T(this.recentGizmoList);e.length>0&&N.writeMemory("recentGizmoList",e,"long")}))}async _insertTextResult(e){this.activeNode.focus(),A.activeRange&&(A.activeRange.setStart(this.activeNode,0),A.activeRange.collapse(!0),A.activeSelection.removeAllRanges(),A.activeSelection.addRange(A.activeRange),A.activeSelection.selectAllChildren(this.activeNode),A.activeSelection.collapseToEnd()),setTimeout((()=>{""==this.activeNode.textContent?this.activeNode.textContent=e:globalThis.document.execCommand("insertHTML",!1,e)}),0)}_openExternalLink(e){globalThis.open(e,"_blank")}async _haxStoreContribute(e,t,i=null){let a="";if("merlin"==e){var o=`[${e}] New command request from HAX daemon`;a=`Location: ${globalThis.location.href}\nMerlin command: ${i}\nWhat did you want merlin to do?\n`}else{o=`[${e}] User report from HAX daemon`;if(a=`Location: ${globalThis.location.href}\nBrowser: ${navigator.userAgent}\nOS: ${navigator.userAgentData.platform} - ${navigator.deviceMemory}GB RAM - ${navigator.hardwareConcurrency} cores\nScreen: ${globalThis.screen.width}x${globalThis.screen.height}\nWindow size: ${globalThis.innerWidth}x${globalThis.innerHeight}\n`,navigator.getBattery){a+=`Battery: ${100*(await globalThis.navigator.getBattery()).level}%\n`}navigator.connection&&globalThis.navigator.connection.effectiveType&&(a+=`Connection: ${navigator.connection.effectiveType}\n`),a+=("feature"==e?"Your idea:":"Bug you experienced:")+"\n"}globalThis.open(`https://github.com/haxtheweb/issues/issues/new?assignees=&labels=${t}&template=issue-report.md&title=${o}&body=${encodeURIComponent(a)}`,"_blank")}async _richTextEditorPromptOpen(e){if(e.detail.element&&e.detail.element.gizmo.tag){const t=globalThis.document.createElement(e.detail.element.gizmo.tag);HAXStore.testHook(t,"setupActiveElementForm")&&await HAXStore.runHook(t,"setupActiveElementForm",[e.detail.element])}const t=globalThis.getComputedStyle(globalThis.document.body);"hidden"==t.getPropertyValue("overflow")&&(this.__overflowHiddenOnOpen=t.getPropertyValue("overflow"),globalThis.document.body.style.overflow="auto"),setTimeout((()=>{const e=globalThis.document.querySelector("rich-text-editor-prompt").shadowRoot.querySelector(".actions");"function"==typeof e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded(!0):e.scrollIntoView({behavior:"smooth",inline:"center"})}),100)}_richTextEditorPromptConfirm(e){const t=e.detail.value&&e.detail.value.target?e.detail.value.target:null;setTimeout((()=>{"A"===this.activeNode.tagName&&t&&(this.activeNode.setAttribute("target",t),this.refreshActiveNodeForm())}),0),this.__overflowHiddenOnOpen&&(globalThis.document.body.style.overflow=this.__overflowHiddenOnOpen,this.__overflowHiddenOnOpen=null)}_buildPrimitiveDefinitions(){if(this._isSandboxed){let e={type:"element",editingElement:"core",canScale:!0,designSystem:{card:!0,primary:!0},canEditSource:!0,settings:{configure:[{attribute:"src",title:"Source",description:"The URL for this resource.",inputMethod:"textfield",icon:"link",required:!0,validationType:"url"}],advanced:[]}};this.setHaxProperties(e,"webview")}this.setHaxProperties({canScale:!0,type:"element",designSystem:{card:!0,primary:!0},editingElement:"core",canEditSource:!0,gizmo:{title:"Image",description:"A basic img tag",icon:"image:image",color:"blue-grey",tags:["Images","media","img","html"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"src",title:"Source",description:"The URL for this image.",inputMethod:"haxupload",noVoiceRecord:!0,icon:"link",required:!0,validationType:"url"},{attribute:"alt",title:"Alt text",description:"Useful for screen readers and improved SEO.",inputMethod:"alt",icon:"accessibility"},{attribute:"height",title:"Height",description:"height in pixels of the item. Leave blank to respond to the natural resolution",inputMethod:"textfield",icon:"icons:swap-vert"}],advanced:[{attribute:"loading",title:"Loading method",description:"Whether or not to lazy load this",inputMethod:"select",options:{lazy:"Load when visible",auto:"Automatic"}}]},demoSchema:[{tag:"img",content:"",properties:{src:"https://cdn2.thecatapi.com/images/9j5.jpg",loading:"lazy"}}]},"img");this.setHaxProperties({canScale:!0,type:"grid",canEditSource:!0,gizmo:{title:"Figure",description:"A basic figure tag",icon:"hax:figure",color:"blue-grey",tags:["Images","media","figure","html"],requiresChildren:"figcaption",handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[]},demoSchema:[{tag:"figure",properties:{},content:'image other media here\n

    Image Caption Here

    '}]},"figure");this.setHaxProperties({canScale:!0,type:"grid",editingElement:"core",canEditSource:!0,gizmo:{title:"Figure caption",description:"Used inside of a figure tag",icon:"image:image",color:"blue-grey",tags:["Images","media","caption","figure","html"],handles:[],requiresParent:"figure",meta:{author:"W3C",hidden:!0}},settings:{configure:[{slot:"",title:"Figure Caption",description:"Caption for the figure",inputMethod:"code-editor"}]},demoSchema:[{tag:"figcaption",properties:{},content:"Image Caption Here"}]},"figcaption");this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:{primary:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:"Highlight",description:"Highlight text within a block of content",icon:"editor:highlight",color:"yellow",tags:["Content","text","highlight","mark","html"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"innerText",title:"Text",description:"Text of the highlight",inputMethod:"textfield",required:!0}],advanced:[],developer:[]},demoSchema:[{tag:"mark",content:"Highlight me",properties:{}}]},"mark");this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:{primary:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:"Abbreviation",description:"Simple abbreviation with tooltip of full word",icon:"hax:abbr",color:"yellow",tags:["Content","text","abbr","html"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"innerText",title:"Text",description:"Text that is visible, the abbreviation",inputMethod:"textfield",required:!0},{attribute:"title",title:"Word",description:"Word that the abbreviation is representing",inputMethod:"textfield",required:!0}],advanced:[],developer:[]},demoSchema:[{tag:"abbr",content:"Abbr",properties:{title:"Abbreviation"}}]},"abbr");let e={type:"element",editingElement:"core",canScale:!1,designSystem:{accent:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:"Basic link",description:"A basic a tag",icon:"icons:link",color:"blue-grey",tags:["Resource","link","a","url","html","href","address","http"],handles:[],meta:{author:"W3C"}},settings:{configure:[{attribute:"href",title:"Link",description:"The URL for the link",inputMethod:"haxupload",required:!0,validationType:"url"},{attribute:"innerText",title:"Text",description:"Text of the link",inputMethod:"textfield",required:!0},{attribute:"target",title:"Target",description:"Where to open the link.",inputMethod:"select",options:{"":"Same window",_blank:"New window - _blank",_top:"Top window - _top",_parent:"Parent window - _parent"}}],advanced:[],developer:[{attribute:"title",title:"Title text",description:"Useful for screen readers and improved SEO.",inputMethod:"textfield"},{attribute:"rel",title:"rel",description:"Specifies the relationship between this document and the opened globalThis.document. Change as part of security or SEO policy.",inputMethod:"select",options:{noopener:"noopener","noopener noreferrer":"noopener noreferrer","nofollow ":"nofollow","noopener noreferrer nofollow":"noopener noreferrer nofollow",opener:"opener"}}]},demoSchema:[{tag:"p",content:'Link to content',properties:{}}]};this.validGizmoTypes.forEach((t=>{e.gizmo.handles.push({type:t,source:"href",title:"innerText",alt:"title"})})),this.setHaxProperties(e,"a");this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:!0,canEditSource:!0,contentEditable:!0,gizmo:{title:"Paragraph",description:"A basic text area",icon:"hax:paragraph",color:"blue-grey",tags:["Text","p","paragraph","text","html"],handles:[{type:"content",title:"innerHTML",alt:"title"}],meta:{author:"W3C",outlineDesigner:!0}},settings:{configure:[],advanced:[]},demoSchema:[{tag:"p",content:"Deep thoughts..",properties:{}}]},"p");let t={type:"element",editingElement:{tag:"editable-table",import:"@haxtheweb/editable-table/editable-table.js",callback:this.setupEditableTable.bind(this)},canScale:!0,canEditSource:!0,gizmo:{title:"Table",description:"A table for displaying data",icon:"image:grid-on",color:"blue-grey",tags:["Instructional","table","data","html","grid","matrix","spreadsheet","csv","excel"],meta:{hidden:!0,author:"W3C"}},settings:{configure:[],advanced:[]}};this.setHaxProperties(t,"table");let i=globalThis.document.createElement("editable-table");this.haxAutoloader.appendChild(i);let a={type:"element",editingElement:{tag:"iframe-loader",import:"@haxtheweb/iframe-loader/iframe-loader.js",callback:this.setupIframeLoader.bind(this)},canScale:!1,designSystem:{card:!0,primary:!0},canEditSource:!1,gizmo:{title:"iFrame",description:"A basic way to frame external web content",icon:"hax:iframe",color:"blue-grey",tags:["Resource","iframe","content","url","link","embed","https","html","address"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"src",title:"Source",description:"The URL for this resource.",inputMethod:"textfield",icon:"link",required:!0,validationType:"url"}]}};this.setHaxProperties(a,"iframe");let o=globalThis.document.createElement("iframe-loader");this.haxAutoloader.appendChild(o);for(let e in this.__primsBuilder){let t="";["h1","h2","h3","h4","h5","h6"].includes(e)?t="Heading":"ul"!=e&&"ol"!=e||(t="
  • Item
  • Item
  • "),this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:["h1","h2","h3","h4","h5","h6"].includes(e)?{text:!0,card:!0,primary:!0,designTreatment:!0}:!!["ol","ul"].includes(e)&&{text:!0,card:!0,accent:!0,primary:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:this.__primsBuilder[e].title,icon:this.__primsBuilder[e].icon,tags:this.__primsBuilder[e].tags||["Text",e,"html","text"],handles:this.__primsBuilder[e].handles||[],meta:{author:"W3C",inlineOnly:!!["em","b","strong","i","strike","u","sub","sup","span"].includes(e),hidden:!["h2","ul"].includes(e),outlineDesigner:!!["h2","ul"].includes(e)}},settings:{configure:[],advanced:[]},demoSchema:[{tag:e,content:t,properties:{}}]},e)}this.setHaxProperties({canScale:!0,type:"element",editingElement:"core",designSystem:{primary:!0},canEditSource:!1,contentEditable:!0,gizmo:{title:"Horizontal line",icon:"hax:hr",meta:{author:"W3C"}},settings:{configure:[],advanced:[]},demoSchema:[{tag:"hr",content:"",properties:{"data-width":"50"}}]},"hr")}_haxStorePieceRegistrationManager(e){e.detail&&e.detail.piece&&e.detail.object&&(this[e.detail.piece]=e.detail.object)}setupEditableTable(e){this.activeNode=e,setTimeout((()=>{e.editMode=!0,e.focus()}),0)}setupIframeLoader(e){this.activeNode=e,setTimeout((()=>{e.disabled=!0}),0)}async _haxStoreInsertContent(e){if(e.detail){let i=e.detail;if(globalThis.customElements.get(i.tag)){let e=globalThis.document.createElement(i.tag);this.testHook(e,"preProcessInsertContent")&&(i=await this.runHook(e,"preProcessInsertContent",[i,this.activeNode]))}var t={};if(void 0!==i.properties&&(t=i.properties),t.innerHTML&&(""==i.content&&(i.content=t.innerHTML),delete t.innerHTML),t.innerText&&(""==i.content&&(i.content=t.innerText),delete t.innerText),void 0!==i.__type&&"inline"===i.__type){let e=c({tag:i.tag,content:i.content,properties:t});null!==this.activePlaceHolder&&(this.activePlaceHolder.deleteContents(),this.activePlaceHolder.insertNode(e)),this.activePlaceHolder=null}else if(i.replace||i.replacement||i.nextToActive){let e=c({tag:i.tag,content:i.content,properties:t});this.activePlaceHolder?(this.activeHaxBody.haxReplaceNode(this.activePlaceHolder,e),this.activePlaceHolder=null):i.nextToActive&&this.activeNode?this.activeHaxBody.__slot&&this.activeNode.haxLayoutContainer?this.activeNode.appendChild(e):this.activeNode.parentNode.insertBefore(e,this.activeNode):this.activeHaxBody.haxReplaceNode(this.activeNode,e)}else if(this.activeNode&&this.activeNode.parentNode&&"HAX-BODY"!=this.activeNode.parentNode.tagName){let e=c({tag:i.tag,content:i.content,properties:t});this.activeNode.parentNode.haxLayoutContainer?(null!=this.activeNode.getAttribute("slot")&&e.setAttribute("slot",this.activeNode.getAttribute("slot")),this.activeHaxBody.haxInsert(i.tag,i.content,t)):this.activeHaxBody.haxInsert(i.tag,i.content,t)}else this.activeHaxBody.haxInsert(i.tag,i.content,t)}}slotsFromSchema(e,t=!1){let i=e?e.settings:{},a=[];return Object.keys({...i||{}}).map((e=>(i[e]||[]).filter((e=>{let i=!t||!e.required;return!(!e.slot&&""!==e.slot||a.includes(e.slot)||!i)&&(a.push(e.slot),!0)})))).flat()}haxSchemaFromTag(e){return e&&e.toLowerCase&&(e=e.toLowerCase(),this.elementList&&this.elementList[e])?this.elementList[e]:{}}_haxStoreInsertMultiple(e){var t;if(e.detail)for(let i in e.detail)t={},void 0!==e.detail[i].properties&&(t=e.detail[i].properties),this.activeHaxBody.haxInsert(e.detail[i].tag,e.detail[i].content,t)}_haxStoreRegisterBody(e){e.detail&&(this.haxBodies.push(e.detail),this.activeHaxBody=e.detail,this.write("activeHaxBody",this.activeHaxBody,this),this.write("editMode",this.editMode,this),clearTimeout(this.__storeReady),this.__storeReady=setTimeout((()=>{this._storePiecesAllHere(this.haxAutoloader,this.activeHaxBody,this.haxTray,this.haxCancel)}),0))}_superDaemonInsert(e){A.programTarget&&e.detail.properties&&(e.detail.properties.src||e.detail.properties.source||e.detail.properties.href)?A.programTarget.value=e.detail.properties.src||e.detail.properties.source||e.detail.properties.href:this.haxTray._processTrayEvent(e),A.programTarget=null}computePolyfillSafe(){return!(!globalThis.document.head.createShadowRoot&&!globalThis.document.head.attachShadow)||(console.warn("Shadow DOM missing, certain operations hidden"),!1)}_haxStoreRegisterApp(e){if(e.detail){const i=e.detail;i.index=this.appList.length,this.appList=[...this.appList,i],this.write("appList",T(this.appList),this);let a="media";if(i.connection.operations&&i.connection.operations.browse&&i.connection.operations.browse.resultMap&&i.connection.operations.browse.resultMap.defaultGizmoType&&(a=i.connection.operations.browse.resultMap.defaultGizmoType),A.defineOption({title:"Search "+i.details.title,icon:i.details.icon,tags:["Search",...i.details.tags,a],more:i.details.tos&&i.details.tos.length>0?t`
    Terms of service:
    +import{LitElement as e,html as t,nothing as i}from"../../../lit/index.js";import{SimpleTourManager as a}from"../../simple-popover/lib/simple-tour.js";import{HaxSchematizer as o,HaxElementizer as r}from"../../hax-body-behaviors/lib/HAXFields.js";import{winEventsElement as n,getRange as s,stripMSWord as l,nodeToHaxElement as d,haxElementToNode as c,validURL as h,camelToDash as p,htmlEntities as m,localStorageGet as g,localStorageSet as u}from"../../utils/utils.js";import{observable as x,makeObservable as f,computed as b,configure as v,autorun as y,toJS as T}from"../../../mobx/dist/mobx.esm.js";v({enforceActions:!1});import{HAXElement as S}from"../../hax-body-behaviors/hax-body-behaviors.js";import{I18NMixin as H,I18NManagerStore as w}from"../../i18n-manager/lib/I18NMixin.js";import{enableServices as A}from"../../micro-frontend-registry/lib/microServices.js";import{SuperDaemonInstance as E}from"../../super-daemon/super-daemon.js";import"../../media-behaviors/media-behaviors.js";import"../../editable-table/editable-table.js";import"../../iframe-loader/iframe-loader.js";import"../../hax-iconset/lib/hax-iconset-manifest.js";import{UserScaffoldInstance as N}from"../../user-scaffold/user-scaffold.js";import"./hax-app.js";function sessionStorageGet(e){try{return sessionStorage.getItem(e)}catch(e){return!1}}function sessionStorageSet(e,t){try{return sessionStorage.setItem(e,t)}catch(e){return!1}}class HaxStore extends(H(n(S(e)))){testHook(e,t){return!!(e&&e.tagName&&this.HTMLPrimativeTest(e)&&this.primativeHooks[e.tagName.toLowerCase()]&&this.primativeHooks[e.tagName.toLowerCase()][t])||e&&"function"==typeof e.haxHooks&&e.haxHooks()[t]}async runHook(e,t,i=[]){return!!this.testHook(e,t)&&(this.HTMLPrimativeTest(e)?await this.primativeHooks[e.tagName.toLowerCase()][t](...i):await e[e.haxHooks()[t]](...i))}getSelection(){if(this.activeHaxBody&&this.activeHaxBody.parentNode){if(this.activeHaxBody.parentNode.getSelection)return this.activeHaxBody.parentNode.getSelection();try{if(s(this.activeHaxBody.parentNode))return s(this.activeHaxBody.parentNode)}catch(e){}}return globalThis.getSelection()}getRange(){let e=this.getSelection();return e&&e.getRangeAt&&e.rangeCount?e.getRangeAt(0):e||!1}guessGizmo(e,t,i=!1,a=!1){var o=[],r=[];if(void 0!==e&&this.validGizmoTypes.includes(e))for(let n in this.gizmoList){let s=T(this.gizmoList[n]),l=t.innerHTML?{innerHTML:t.innerHTML}:{},d=!1;if(s&&s.handles)for(let n=0;n{t&&t.type&&""!=t.type&&(e[t.type.toLowerCase()]=!0)})),s.tags&&s.tags.length>0&&[...s.tags].forEach((t=>{t&&""!=t&&(e[t.toLowerCase()]=!0)})),s.keywords=Object.keys(e),r.includes(s.tag)||(o.push(this.haxElementPrototype(s,l,"")),r.push(s.tag))}}}}return o}insertLogicFromValues(e,t,i=!1,a=!1){let o=this.activePlaceHolderOperationType||this.guessGizmoType(e);if("upload-only"===o)return this.toast("Upload successful!"),!1;"link"===this.activePlaceHolderOperationType&&(a=!0),this.activePlaceHolderOperationType=null;let r=o,n=!0;if("*"==o){if(i)return!1;n=!1,r="link"}let s=this.guessGizmo(o,e,!1,n);return s.length>0?(1===s.length||a?1===s.length&&void 0!==s[0].tag?t.dispatchEvent(new CustomEvent("hax-insert-content",{bubbles:!0,cancelable:!0,composed:!0,detail:s[0]})):a&&t.dispatchEvent(new CustomEvent("hax-insert-content",{bubbles:!0,cancelable:!0,composed:!0,detail:s.find((e=>"a"==e.tag))})):this.haxAppPicker.presentOptions(s,o,"Pick how to present this "+r,"gizmo"),!0):(this.toast("Sorry, HAX doesn't know how to handle that type of link yet."),!1)}write(e,t,i){i&&i.dispatchEvent(new CustomEvent("hax-store-write",{composed:!0,bubbles:!0,cancelable:!1,detail:{property:e,value:t,owner:i}}))}mimeTypeToGizmoType(e){let t=e.split("/");switch(t[0]){case"audio":return"audio";case"image":return"svg+xml"==t[1]?"svg":"image";case"video":return"video";case"text":return["csv","html","markdown"].includes(t[1])?t[1]:"document";case"application":return"pdf"==t[1]?"pdf":["zip","gzip","x-tar"].includes(t[1])?"archive":"document"}}guessGizmoType(e){if(void 0!==e.source){const t=e.source.toLowerCase();if(-1!=t.indexOf(".mp3")||-1!=t.indexOf(".midi")||-1!=t.indexOf(".mid"))return"audio";if(-1!=t.indexOf(".png")||-1!=t.indexOf(".jpg")||-1!=t.indexOf(".jpeg"))return"image";if(-1!=t.indexOf(".gif"))return"gif";if(-1!=t.indexOf(".pdf"))return"pdf";if(-1!=t.indexOf(".svg"))return"svg";if(-1!=t.indexOf(".csv"))return"csv";if(-1!=t.indexOf(".md"))return"markdown";if(-1!=t.indexOf(".html")||-1!=t.indexOf(".htm"))return"html";if(-1!=t.indexOf(".txt")||-1!=t.indexOf(".doc")||-1!=t.indexOf(".docx")||-1!=t.indexOf(".xls")||-1!=t.indexOf(".xlsx")||-1!=t.indexOf(".vtt")||-1!=t.indexOf(".ppt"))return"document";if(-1!=t.indexOf(".zip")||-1!=t.indexOf(".tar.gz")||-1!=t.indexOf(".tar"))return"archive";if("external"!=globalThis.MediaBehaviors.Video.getVideoType(t))return"video"}return"*"}render(){return t` `}static get tag(){return"hax-store"}toast(e,t=2e3,i={},a="capsule",o=this.t.close,r=null,n=null){globalThis.dispatchEvent(new CustomEvent(this.toastShowEventName,{bubbles:!0,composed:!0,cancelable:!0,detail:{text:e,duration:t,classStyle:a,closeText:o,eventCallback:r,slot:n,...i}}))}static get properties(){return{...super.properties,skipHAXConfirmation:{type:Boolean,reflect:!0,attribute:"skip-hax-confirmation"},storageData:{type:Object},haxTray:{type:Object},haxCancel:{type:Object},haxAutoloader:{type:Object},haxBodies:{type:Array},activePlaceHolder:{type:Object},activePlaceHolderOperationType:{type:String},appStore:{type:Object},sessionObject:{type:Object},skipExitTrap:{type:Boolean},elementList:{type:Object},staxList:{type:Array},validTagList:{type:Array},validGridTagList:{type:Array},validGizmoTypes:{type:Array},_isSandboxed:{type:Boolean},__appStoreData:{type:Object},ready:{type:Boolean},connectionRewrites:{type:Object}}}_storageDataChanged(e){e&&this.ready&&this.__storageDataProcessed&&(g("haxConfirm",!1)?u("haxUserData",e):sessionStorageGet("haxConfirm")&&sessionStorageSet("haxUserData",e))}isSingleSlotElement(e){let t=Object.keys(this.slotsSchemaFromNode(e));return 1==t.length&&0===t[0].length}isTextElement(e){let t;return null!=e&&e.tagName?t=e.tagName.toLowerCase():null!=e&&e.tag&&(t=e.tag.toLowerCase()),!!(t&&this.validTagList.includes(t)&&["p","ol","ul","li","a","h1","h2","h3","h4","h5","h6","strike","u","b","sub","sup","span","mark","abbr","i","bold","em","strong","blockquote","code","figure"].includes(t))}isInlineElement(e){let t;return null!=e&&e.tagName?t=e.tagName.toLowerCase():null!=e&&e.tag?t=e.tag.toLowerCase():"string"==typeof e&&(t=e),!!(t&&this.validTagList.includes(t)&&(this.haxSchemaFromTag(t)&&this.haxSchemaFromTag(t).meta&&this.haxSchemaFromTag(t).meta.inlineOnly||["a","strike","u","b","sub","sup","span","code","mark","abbr","i","bold","em","strong"].includes(t)))}isGridPlateElement(e){let t;return e&&e.tagName?t=e.tagName.toLowerCase():e&&e.tag&&(t=e.tag.toLowerCase()),!(!t||!this.validGridTagList.includes(t))}isLayoutElement(e){let t=e&&e.tagName&&this.haxSchemaFromTag(e.tagName)||{};return t.type&&"grid"===t.type}isLayoutSlot(e){return!(!e||!e.parentNode)&&this.isLayoutElement(e.parentNode)}isOriginalGridPlate(e){return!!e&&"GRID-PLATE"===e.tagName}activeSchema(){return this.activeNode?this.haxSchemaFromTag(this.activeNode.tagName):void 0}activeParentSchema(){return this.activeNode&&this.activeNode.parentNode?this.haxSchemaFromTag(this.activeNode.parentNode.tagName):void 0}slottedContentByNode(e){let t={...this.slotsSchemaFromNode(e)||{}};return e?([...e.children||[]].forEach((e=>{e.slot&&""!==e.slot&&t[e.slot]?(t[e.slot].items=t[e.slot].items||[],t[e.slot].items.push(e)):e.slot&&""!==e.slot||!t[""]||(t[""].items=t[""].items||[],t[""].items.push(e))})),t):t}slotsSchemaFromNode(e){if(!e||!e.tagName)return{};let t={},i=this.haxSchemaFromTag(e.tagName||{}),a=this.slotsFromSchema(i);if(this.isOriginalGridPlate(e)){(e.layout||"1-1-1-1").split("-").map(((e,t)=>{a.push({slot:`col-${t+1}`,title:`Column ${t+1}`,excludedSlotWrappers:["grid-plate"]})}))}return a.forEach((a=>{a.items=void 0,a.label=a.title||a.slot,a.editMode={...i.editMode,...a.editMode},a.grid=e,(a.slot||""===a.slot)&&(t[a.slot]=a)})),t}schemaBySlotId(e,t){return(this.slotsSchemaFromNode(e)||{})[t]}_appStoreChanged(e,t){e&&t&&(e.url&&!e.apps&&this.shadowRoot?this.loadAppStoreFromRemote():this.__appStoreData=e)}async _loadAppStoreData(e){if(null!=e){var t={};if(void 0!==e.autoloader){e.autoloader=Object.assign({},e.autoloader);for(let i in e.autoloader){let a=i,o=e.autoloader[i];isNaN(a)||(a=e.autoloader[i],o=`@haxtheweb/${a}/${a}.js`),"string"!=typeof o&&(o.haxProperties&&this.setHaxProperties(e.autoloader[i].haxProperties,a),o=e.autoloader[i].import),this.validTagList.push(a),t[a]=o}}if(void 0!==e.apps){var i=e.apps;for(let e=0;e{globalThis.customElements.get(a)&&globalThis.customElements.get(a).haxProperties?this.setHaxProperties(globalThis.customElements.get(a).haxProperties,a):t.appendChild(globalThis.document.createElement(a))})).catch((e=>{console.warn(e),t.appendChild(globalThis.document.createElement(a))}))}}isExternalURLImport(e){let t;try{t=new URL(e)}catch(e){return!1}return new URL(t).origin!==location.origin}_editModeChanged(e){e&&!this.appStoreLoaded&&this.__appStoreData&&this.haxAutoloader&&(clearTimeout(this.__readyToProcessAppStoreData),this._loadAppStoreData(this.__appStoreData))}async _globalPreferencesChanged(e){if(this.__storageDataProcessed&&e&&this.ready){let t=this.storageData;"string"==typeof t&&(t=JSON.parse(t)),t.globalPreferences=e,this.storageData=t,this._storageDataChanged(this.storageData),e.haxLang&&HAXStore.editMode&&(clearTimeout(this._debounceLang),this._debounceLang=setTimeout((async()=>{for(let e in this.elementList){let t=this.elementList[e];t=await this.attemptGizmoTranslation(e,t),this.elementList[e]=t}this.gizmoList.forEach((e=>{this.elementList[e.tag].gizmo.title&&(e.title=this.elementList[e.tag].gizmo.title),this.elementList[e.tag].gizmo.description&&(e.description=this.elementList[e.tag].gizmo.description)}))}),100))}}_haxConsentTap(e){u("haxConfirm",!0),u("haxUserData",JSON.stringify(this.storageData))}updated(e){super.updated&&super.updated(e),e.forEach(((e,t)=>{"appStore"==t&&this[t]&&this._appStoreChanged(this[t],e),["ready","__appStoreData","haxAutoloader"].includes(t)&&this.ready&&this.__appStoreData&&this.haxAutoloader&&(clearTimeout(this.__readyToProcessAppStoreData),this.__readyToProcessAppStoreData=setTimeout((()=>{this._loadAppStoreData(this.__appStoreData)}),0)),["haxAutoloader","haxTray","haxCancel"].includes(t)&&(clearTimeout(this.__storeReady),this.__storeReady=setTimeout((()=>{this._storePiecesAllHere(this.haxAutoloader,this.activeHaxBody,this.haxTray,this.haxCancel)}),0))}))}_calculateActiveGizmo(e){if(null==e||!e.tagName)return null;for(let i in this.gizmoList){var t=this.gizmoList[i];if(t.tag===e.tagName.toLowerCase())return t}}loadAppStoreFromRemote(){const e=new URLSearchParams(this.appStore.params);let t=this.appStore.url;e&&(t+=`?${e}`),fetch(t,{method:this.method}).then((e=>{if(e.ok)return e.json()})).then((e=>{this.__appStoreData=e}))}firstUpdated(e){if(super.firstUpdated&&super.firstUpdated(e),this.skipHAXConfirmation&&(sessionStorageSet("haxConfirm",!0),u("haxConfirm",!0)),sessionStorageGet("haxConfirm")||g("haxConfirm"))if(sessionStorageGet("haxConfirm")&&!g("haxConfirm"))try{let e=sessionStorageGet("haxUserData")?JSON.parse(sessionStorageGet("haxUserData")):{};this.storageData=e,this._storageDataChanged(this.storageData)}catch(e){}else try{let e=g("haxUserData",{});this.storageData=e,this._storageDataChanged(this.storageData)}catch(e){}else{sessionStorageSet("haxConfirm",!0);let e="\n The HAX content editor keeps preferences in order to improve your experience.\n This data is stored in your browser and is never sent anywhere.\n Click to accept.\n ";this.toast(e,"-1",{},"fit-bottom","I Accept","hax-consent-tap")}setTimeout((()=>{this.__storageDataProcessed=!0,this.storageData.globalPreferences&&this.write("globalPreferences",this.storageData.globalPreferences,this)}),0)}_storePiecesAllHere(e,t,i,a){if(!this.ready&&t&&e&&i&&a){this.dispatchEvent(new CustomEvent("hax-store-ready",{bubbles:!0,cancelable:!1,composed:!0,detail:!0}));let e=globalThis.RichTextEditorPrompt.requestAvailability();e&&(e.shadowRoot.querySelector("#formfields").schematizer=o,e.shadowRoot.querySelector("#formfields").elementizer=r),i.shadowRoot.querySelector("#haxcancelbutton")&&(a.shadowRoot.querySelector("#dialog").associateEvents(i.shadowRoot.querySelector("#haxcancelbutton")),a.shadowRoot.querySelector("#dialog")&&globalThis.addEventListener("simple-modal-confirmed",this._handleConfirmCancel.bind(this))),this.ready=!0,this._buildPrimitiveDefinitions()}}_handleConfirmCancel(e){e.detail.invokedBy===this.haxTray.shadowRoot.querySelector("#haxcancelbutton")&&(this.editMode=!1,this.dispatchEvent(new CustomEvent("hax-cancel",{bubbles:!0,composed:!0,cancelable:!1,detail:e.detail})))}_positionCursorInNode(e,t=0){this.activeHaxBody.positionContextMenus();var i=globalThis.document.createRange(),a=this.getSelection();return i.setStart(e,t),i.collapse(!0),a.removeAllRanges(),a.addRange(i),i}_onBeforeUnload(e){if(!this.skipExitTrap&&this.editMode)return"Are you sure you want to leave? Your work will not be saved!"}isBase64(e){try{return btoa(atob(e))==e}catch(e){return!1}}retrieveImageFromClipboardAsBlob(e,t){if(0==e.clipboardData&&"function"==typeof t)return t(void 0);var i=e.clipboardData.items;if(null==i&&"function"==typeof t)return t(void 0);for(let e=0;e{for(var i in e)i.startsWith("hax")||(this.activeNode.dataset[i]=e[i]);t&&this.activeNode.setAttribute("slot",t)}),0)}}async _onPaste(e){if(this.editMode&&"HAX-TRAY"!==globalThis.document.activeElement.tagName&&"BODY"!==globalThis.document.activeElement.tagName&&"SIMPLE-MODAL"!==globalThis.document.activeElement.tagName){this.isTextElement(this.activeNode)||(this.activeNode=this.activeHaxBody.haxInsert("p","",{}));let o="",r="";if(e.clipboardData||e.originalEvent.clipboardData?(o=(e.originalEvent||e).clipboardData.getData("text/html"),""==o&&(o=(e.originalEvent||e).clipboardData.getData("text"))):globalThis.clipboardData&&(o=globalThis.clipboardData.getData("Text")),o=o.trim(),o=o.replace(/\s*?<\/span>/g," "),o=o.replace(/(?:style="(\S+:\s*[^;"]+;\s*)*)+"/g,""),o=o.replace(/
    /g,"

    "),r=o,this.isBase64(r))return e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.retrieveImageFromClipboardAsBlob(e,(t=>{if(t){var i=globalThis.URL||globalThis.webkitURL;let a=globalThis.document.createElement("img");a.src=i.createObjectURL(t),this.activeNode.parentNode.insertBefore(a,this.activeNode.nextElementSibling);for(let t in e.clipboardData.items)!e.clipboardData.items[t].name&&e.clipboardData.items[t].type&&(e.clipboardData.items[t].name="image-"+Math.floor(Date.now()/1e3)+e.clipboardData.items[t].type.replace("image/","."));return e.dataTransfer=e.clipboardData,e.placeHolderElement=a,this.dispatchEvent(new CustomEvent("place-holder-file-drop",{bubbles:!0,cancelable:!0,composed:!0,detail:e})),a}return!1}));if(e.clipboardData.files.length>0){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();let t=this.activeHaxBody.haxInsert("p","",{});e.dataTransfer=e.clipboardData;for(let t in e.clipboardData.files)!e.clipboardData.files[t].name&&e.clipboardData.files[t].type&&(e.clipboardData.files[t].name="image-"+Math.floor(Date.now()/1e3)+e.clipboardData.files[t].type.replace("image/","."));e.placeHolderElement=t,this.dispatchEvent(new CustomEvent("place-holder-file-drop",{bubbles:!0,cancelable:!0,composed:!0,detail:e}))}let n=!1,s="",d=globalThis.document.createElement("div");d.innerHTML=o;let p=[];if(d.children&&(o=l(o),o=o.replace(/

    /g,"

    "),o=o.replace(/<\/h1>/g,"

    "),o=o.replace(//g,(function(e,t){return``})),p=await this.htmlToHaxElements(o),1!==p.length||this.__validGridTags().includes(p[0].tag)||(p=await this.htmlToHaxElements(p[0].content))),0===p.length&&h(o)){""!=this.activeNode.innerText.trim()&&(n=!0);let e={source:o,title:o};if(!n&&!this.insertLogicFromValues(e,this,!1,!0))return!1}else if(0===p.length){if(n=!0,r==o)return!1;s=o}else if(1===p.length&&"p"===p[0].tag)s=o,n=!0;else if(1===p.length&&"a"===p[0].tag&&p[0].properties.href)if(""!=this.activeNode.innerText.trim())s=p[0].properties.href,n=!0;else{let e={source:p[0].properties.href,title:p[0].content};if(!this.insertLogicFromValues(e,this))return!1}else{if(!this.isGridPlateElement(p[0]))return!1;for(let e in p){"p"==p[e].tag&&["li","ol","ul"].includes(this.activeNode.tagName.toLowerCase())&&(p[e].tag="li"),delete p[e].properties.style,delete p[e].properties.start,delete p[e].properties.align;let t=c({tag:p[e].tag,content:p[e].content.replace(/ <\/span>/g," ").trim(),properties:p[e].properties});s+=await this.nodeToContent(t)}}e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();try{let e=this.getRange(),r=this.getSelection(),l=globalThis.document.createElement("div");if(l.innerHTML=s,e&&r){for(let e in l.children)l.children[e].tagName&&this.isTextElement(l.children[e])&&""===l.children[e].innerHTML&&l.children[e].remove();if(n){let t;if(h(o))t=globalThis.document.createElement("a"),t.setAttribute("href",o),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t.innerText=o;else if(l.children&&l.children.length>0){for(;l.childNodes.length>1;)e.insertNode(Array.from(l.childNodes).pop());t=Array.from(l.childNodes).pop()}else t=globalThis.document.createTextNode(l.innerHTML);e.deleteContents(),e.insertNode(t),setTimeout((()=>{this._positionCursorInNode(t,t.length)}),0)}else{var t,i,a;for(""!=this.activeNode.innerText.trim()&&e.endOffset!=this.activeNode.innerText.length&&(t=!0,globalThis.document.execCommand("insertParagraph")),e.commonAncestorContainer&&e.commonAncestorContainer.parentNode&&(a||this.activeNode==e.commonAncestorContainer||(a=e.commonAncestorContainer.parentNode)||(a=e.commonAncestorContainer));l.firstElementChild;)i=l.firstElementChild,a?(a.getAttribute&&a.getAttribute("slot")&&i.setAttribute("slot",a.getAttribute("slot")),t?(this.activeHaxBody.haxReplaceNode(a.previousElementSibling,i),t=!1):a.parentNode?a.parentNode.insertBefore(i,a.nextElementSibling):a.insertBefore(i,a.nextElementSibling)):this.activeNode?(this.activeNode.getAttribute("slot")&&i.setAttribute("slot",this.activeNode.getAttribute("slot")),""==this.activeNode.innerText.trim()?this.activeHaxBody.haxReplaceNode(this.activeNode,i):this.activeNode.parentNode.insertBefore(i,this.activeNode.nextElementSibling)):this.activeHaxBody.appendChild(i),a=i;setTimeout((()=>{i&&i.childNodes&&i.childNodes[0]&&(this._positionCursorInNode(i.childNodes[0],i.childNodes[0].length),i=null,a=null)}),0)}}}catch(e){console.warn(e)}}}__validGridTags(){return["p","ol","ul","li","div","h1","h2","h3","h4","h5","h6","blockquote","code","section","dl","dd","dt","figure"]}__validTags(){return["p","div","span","mark","abbr","table","caption","sup","sub","u","strike","tr","th","td","ol","ul","li","a","strong","kbd","tt","em","i","b","hr","h1","h2","h3","h4","h5","h6","blockquote","code","figure","figcaption","img","iframe","video","audio","section","dl","dt","dd","template","webview"]}__validGizmoTypes(){return["data","video","audio","text","link","file","pdf","image","csv","doc","document","archive","markdown","html","content","text","gif","inline","*"]}constructor(){super(),A(["core"]),this.toastShowEventName=globalThis.HAXCMS?"haxcms-toast-show":"simple-toast-show",this.t={close:"Close"},void 0!==globalThis.speechSynthesis&&(globalThis.SpeechRecognition||globalThis.webkitSpeechRecognition||globalThis.mozSpeechRecognition||globalThis.msSpeechRecognition||globalThis.oSpeechRecognition)&&(E.voiceSearch=!0),E.icon="hax:wizard-hat",E.allowedCallback=()=>!(!this.ready||!this.editMode),E.defineOption({title:"Insert emoji",icon:"editor:insert-emoticon",tags:["emoji"],value:{name:"Insert emoji",context:"/",program:async(e,t)=>{let i=[],a=globalThis.document.createElement("textarea");return await Object.keys(globalThis.SimplePickerEmojis).forEach((async t=>{await globalThis.SimplePickerEmojis[t].forEach((async o=>{(""==e||o.description.includes(e))&&(a.innerHTML=o.value,i.push({title:o.description,textCharacter:a.value,tags:[t],value:{target:this,method:"_insertTextResult",args:[a.value]},context:["/","/HAX/text/emoji/"+a.value],eventName:"super-daemon-element-method",path:"/HAX/text/emoji/"+a.value}))}))})),i}},context:["HAX","/"],eventName:"super-daemon-run-program",path:"/HAX/text/emoji"}),E.defineOption({title:"Insert symbol",icon:"editor:functions",tags:["symbol"],value:{name:"Insert symbol",context:"/",program:async(e,t)=>{let i=[],a=globalThis.document.createElement("textarea");return await Object.keys(globalThis.SimplePickerSymbols).forEach((async t=>{await globalThis.SimplePickerSymbols[t].forEach((async o=>{(""==e||t.includes(e))&&(a.innerHTML=o.value,i.push({title:`${t}: ${a.value}`,textCharacter:a.value,tags:[t],value:{target:this,method:"_insertTextResult",args:[a.value]},context:["/","/HAX/text/symbol/"+a.value],eventName:"super-daemon-element-method",path:"/HAX/text/symbol/"+a.value}))}))})),i}},context:["HAX","/"],eventName:"super-daemon-run-program",path:"/HAX/text/symbol"}),E.defineOption({title:"Join our Community",icon:"hax:discord",priority:-100,tags:["community","discord","chat","help"],value:{target:this,method:"_openExternalLink",args:["https://bit.ly/hax-discord"]},eventName:"super-daemon-element-method",path:"HAX/community/join",context:["logged-in","CMS","HAX"]}),E.defineOption({title:"User Tutorials",icon:"hax:hax2022",priority:-1e3,tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://haxtheweb.org/tutorials"]},eventName:"super-daemon-element-method",path:"HAX/community/tutorials",context:["logged-in","CMS","HAX"]}),E.defineOption({title:"User Documentation",icon:"hax:hax2022",tags:["Documentation","community","help"],value:{target:this,method:"_openExternalLink",args:["https://haxtheweb.org/documentation"]},eventName:"super-daemon-element-method",path:"HAX/community/documentation",context:["logged-in","CMS","HAX"]}),E.defineOption({title:"HAX Teaching Excellence",icon:"hax:hax2022",tags:["Ontology","community","pedagogy","documentation","help"],value:{target:this,method:"_openExternalLink",args:["https://haxtheweb.org/ontology"]},eventName:"super-daemon-element-method",path:"HAX/community/pedagogy",context:["logged-in","CMS","HAX"]}),E.defineOption({title:"Bug / issue",icon:"mdi-social:github-circle",tags:["Bug report","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["bug","POP,bug"]},eventName:"super-daemon-element-method",path:"HAX/community/contribute",context:["logged-in","CMS","HAX"]}),E.defineOption({title:"Idea / Feature request",icon:"mdi-social:github-circle",tags:["Feature request","idea","github","git","community","issue queue"],value:{target:this,method:"_haxStoreContribute",args:["feature","POP,enhancement"]},context:["logged-in","CMS","HAX"],eventName:"super-daemon-element-method",path:"HAX/community/contribute"}),this.primativeHooks={},this.__dragTarget=null,this.registerLocalization({context:this,namespace:"hax",basePath:import.meta.url+"/../../",locales:["es"]}),this.appSearch=null,this.method="GET",this.haxSelectedText="",this.__winEvents={"hax-super-daemon-insert-tag":"_superDaemonInsert","hax-register-properties":"_haxStoreRegisterProperties","hax-consent-tap":"_haxConsentTap",onbeforeunload:"_onBeforeUnload",paste:"_onPaste",command:"_onCommand","hax-register-app":"_haxStoreRegisterApp","hax-register-stax":"_haxStoreRegisterStax","hax-register-core-piece":"_haxStorePieceRegistrationManager","hax-register-body":"_haxStoreRegisterBody","hax-insert-content":"_haxStoreInsertContent","hax-insert-content-array":"_haxStoreInsertMultiple","hax-refresh-tray-form":"refreshActiveNodeForm","rich-text-editor-prompt-open":"_richTextEditorPromptOpen","rich-text-editor-prompt-confirm":"_richTextEditorPromptConfirm"},globalThis.onbeforeunload=e=>{if(!this.skipExitTrap&&this.editMode){var t="Are you sure you want to leave? Your work will not be saved!";return e.returnValue=t,t}},a.registerNewTour({key:"hax",name:"Let's learn HAX",style:"\n simple-popover-manager::part(simple-popover) {\n max-width: 250px;\n }\n simple-popover-manager button {\n font-size: 12px;\n margin: 0px 2px;\n }\n simple-popover-manager p {\n padding: 0;\n margin: 0;\n font-size: 14px;\n line-height: 20px;\n }\n simple-popover-manager h3 {\n margin: 8px 2px;\n }"}),this.skipHAXConfirmation=!1,this.storageData={},this.appStore={url:"",params:{}},this.daemonKeyCombo=`${E.key1} + ${E.key2} + `,this.activeNode=null,this.activeEditingElement=null,this.haxBodies=[],this.activePlaceHolder=null,this.activePlaceHolderOperationType=null,this.sessionObject={},this.editMode=!1,this.skipExitTrap=!1,this.appStoreLoaded=!1,this.elementList={},this.elementAlign=g("hax-tray-elementAlign"),this.elementAlign&&null!=this.elementAlign||(this.elementAlign="left"),this.trayStatus="collapsed",this.trayDetail="content-edit",this.appList=[],this.gizmoList=[],this.recentGizmoList=N.readMemory("recentGizmoList")||[],this.haxAutoloader=null,this.activeHaxBody=null,this.haxTray=null,this.haxCancel=null,this.staxList=[],this.globalPreferences={},this.activeApp={},this.connectionRewrites={},this.daemonCommands={},this.keyboardShortcuts={"#":{tag:"h2",content:""},"##":{tag:"h3",content:""},"###":{tag:"h4",content:""},"####":{tag:"h5",content:""},"#####":{tag:"h6",content:""},"######":{tag:"h6",content:""},"1.":{tag:"ol",content:"
  • "},"-":{tag:"ul",content:"
  • "},"*":{tag:"ul",content:"
  • "},"+":{tag:"ul",content:"
  • "},"---":{tag:"hr"},"***":{tag:"hr"},___:{tag:"hr"},"```":{tag:"code",content:""},">":{tag:"blockquote",content:""}},this.__primsBuilder={caption:{title:"Caption",icon:"av:call-to-action"},video:{title:"Video",icon:"av:play-circle-filled"},audio:{title:"Audio",icon:"image:music-note"},section:{title:"Section",icon:"image:crop-landscape"},dl:{title:"Data list",icon:"editor:format-list-bulleted"},dt:{title:"Data term",icon:"editor:format-list-bulleted"},dd:{title:"Data definition",icon:"editor:format-list-bulleted"},ol:{title:"Numbered list",icon:"editor:format-list-numbered"},ul:{title:"Bulleted list",icon:"editor:format-list-bulleted"},li:{title:"List item",icon:"editor:format-list-bulleted"},h1:{title:"Heading",icon:"hax:h1"},h2:{title:"Heading",icon:"hax:h2",tags:["Text","h2","html","text","heading","header"]},h3:{title:"Heading",icon:"hax:h3"},h4:{title:"Heading",icon:"hax:h4"},h5:{title:"Heading",icon:"hax:h5"},h6:{title:"Heading",icon:"hax:h6"},strike:{title:"Cross out",icon:"editor:format-strikethrough"},u:{title:"Underline",icon:"editor:format-underlined"},sub:{title:"Subscript",icon:"mdextra:subscript"},sup:{title:"Superscript",icon:"mdextra:superscript"},div:{title:"DIV",icon:"image:crop-landscape"},span:{title:"SPAN",icon:"editor:short-text",handles:[{type:"inline",text:"text"}]},i:{title:"Italic",icon:"editor:format-italic"},em:{title:"Emphasis",icon:"editor:format-italic"},strong:{title:"Bold",icon:"editor:format-bold"},b:{title:"Bold",icon:"editor:format-bold"},blockquote:{title:"Block quote",icon:"editor:format-quote"},code:{title:"Code",icon:"icons:code"},embed:{title:"Embedded object",icon:"icons:fullscreen"}},this.validTagList=this.__validTags(),this.validGridTagList=this.__validGridTags(),this.validGizmoTypes=this.__validGizmoTypes();let e=globalThis.document.createElement("webview");this._isSandboxed="function"==typeof e.reload,globalThis.document.body.style.setProperty("--hax-ui-headings","#d4ff77"),this.revisionHistoryLink=null,f(this,{daemonKeyCombo:x,gizmoList:x,recentGizmoList:x,activeNode:x,globalPreferences:x,activeGizmo:b,activeNodeIndex:b,editMode:x,revisionHistoryLink:x,elementAlign:x,trayStatus:x,trayDetail:x,appList:x,activeApp:x,haxSelectedText:x,activeEditingElement:x,activeHaxBody:x,appStoreLoaded:x}),y((()=>{this._globalPreferencesChanged(T(this.globalPreferences))})),y((()=>{this._editModeChanged(T(this.editMode))})),y((()=>{const e=T(this.recentGizmoList);e.length>0&&N.writeMemory("recentGizmoList",e,"long")}))}async _insertTextResult(e){this.activeNode.focus(),E.activeRange&&(E.activeRange.setStart(this.activeNode,0),E.activeRange.collapse(!0),E.activeSelection.removeAllRanges(),E.activeSelection.addRange(E.activeRange),E.activeSelection.selectAllChildren(this.activeNode),E.activeSelection.collapseToEnd()),setTimeout((()=>{""==this.activeNode.textContent?this.activeNode.textContent=e:globalThis.document.execCommand("insertHTML",!1,e)}),0)}_openExternalLink(e){globalThis.open(e,"_blank")}async _haxStoreContribute(e,t,i=null){let a="";if("merlin"==e){var o=`[${e}] New command request from HAX daemon`;a=`Location: ${globalThis.location.href}\nMerlin command: ${i}\nWhat did you want merlin to do?\n`}else{o=`[${e}] User report from HAX daemon`;if(a=`Location: ${globalThis.location.href}\nBrowser: ${navigator.userAgent}\nOS: ${this.getOperatingSystem()} - ${navigator.deviceMemory}GB RAM - ${navigator.hardwareConcurrency} cores\nScreen: ${globalThis.screen.width}x${globalThis.screen.height}\nWindow size: ${globalThis.innerWidth}x${globalThis.innerHeight}\n`,navigator.getBattery){a+=`Battery: ${100*(await globalThis.navigator.getBattery()).level}%\n`}navigator.connection&&globalThis.navigator.connection.effectiveType&&(a+=`Connection: ${navigator.connection.effectiveType}\n`),a+=("feature"==e?"Your idea:":"Bug you experienced:")+"\n"}globalThis.open(`https://github.com/haxtheweb/issues/issues/new?assignees=&labels=${t}&template=issue-report.md&title=${o}&body=${encodeURIComponent(a)}`,"_blank")}getOperatingSystem(){if(navigator.userAgentData&&navigator.userAgentData.platform)return navigator.userAgentData.platform;{const e=navigator.userAgent.toLowerCase();return e.includes("windows")?"Windows":e.includes("iphone")?"iOS":e.includes("mac os")?"macOS":e.includes("linux")?"Linux":e.includes("android")?"Android":"Unknown"}}async _richTextEditorPromptOpen(e){if(e.detail.element&&e.detail.element.gizmo.tag){const t=globalThis.document.createElement(e.detail.element.gizmo.tag);HAXStore.testHook(t,"setupActiveElementForm")&&await HAXStore.runHook(t,"setupActiveElementForm",[e.detail.element])}const t=globalThis.getComputedStyle(globalThis.document.body);"hidden"==t.getPropertyValue("overflow")&&(this.__overflowHiddenOnOpen=t.getPropertyValue("overflow"),globalThis.document.body.style.overflow="auto"),setTimeout((()=>{const e=globalThis.document.querySelector("rich-text-editor-prompt").shadowRoot.querySelector(".actions");"function"==typeof e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded(!0):e.scrollIntoView({behavior:"smooth",inline:"center"})}),100)}_richTextEditorPromptConfirm(e){const t=e.detail.value&&e.detail.value.target?e.detail.value.target:null;setTimeout((()=>{"A"===this.activeNode.tagName&&t&&(this.activeNode.setAttribute("target",t),this.refreshActiveNodeForm())}),0),this.__overflowHiddenOnOpen&&(globalThis.document.body.style.overflow=this.__overflowHiddenOnOpen,this.__overflowHiddenOnOpen=null)}_buildPrimitiveDefinitions(){if(this._isSandboxed){let e={type:"element",editingElement:"core",canScale:!0,designSystem:{card:!0,primary:!0},canEditSource:!0,settings:{configure:[{attribute:"src",title:"Source",description:"The URL for this resource.",inputMethod:"textfield",icon:"link",required:!0,validationType:"url"}],advanced:[]}};this.setHaxProperties(e,"webview")}this.setHaxProperties({canScale:!0,type:"element",designSystem:{card:!0,primary:!0},editingElement:"core",canEditSource:!0,gizmo:{title:"Image",description:"A basic img tag",icon:"image:image",color:"blue-grey",tags:["Images","media","img","html"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"src",title:"Source",description:"The URL for this image.",inputMethod:"haxupload",noVoiceRecord:!0,icon:"link",required:!0,validationType:"url"},{attribute:"alt",title:"Alt text",description:"Useful for screen readers and improved SEO.",inputMethod:"alt",icon:"accessibility"},{attribute:"height",title:"Height",description:"height in pixels of the item. Leave blank to respond to the natural resolution",inputMethod:"textfield",icon:"icons:swap-vert"}],advanced:[{attribute:"loading",title:"Loading method",description:"Whether or not to lazy load this",inputMethod:"select",options:{lazy:"Load when visible",auto:"Automatic"}}]},demoSchema:[{tag:"img",content:"",properties:{src:"https://cdn2.thecatapi.com/images/9j5.jpg",loading:"lazy"}}]},"img");this.setHaxProperties({canScale:!0,type:"grid",canEditSource:!0,gizmo:{title:"Figure",description:"A basic figure tag",icon:"hax:figure",color:"blue-grey",tags:["Images","media","figure","html"],requiresChildren:"figcaption",handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[]},demoSchema:[{tag:"figure",properties:{},content:'image other media here\n

    Image Caption Here

    '}]},"figure");this.setHaxProperties({canScale:!0,type:"grid",editingElement:"core",canEditSource:!0,gizmo:{title:"Figure caption",description:"Used inside of a figure tag",icon:"image:image",color:"blue-grey",tags:["Images","media","caption","figure","html"],handles:[],requiresParent:"figure",meta:{author:"W3C",hidden:!0}},settings:{configure:[{slot:"",title:"Figure Caption",description:"Caption for the figure",inputMethod:"code-editor"}]},demoSchema:[{tag:"figcaption",properties:{},content:"Image Caption Here"}]},"figcaption");this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:{primary:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:"Highlight",description:"Highlight text within a block of content",icon:"editor:highlight",color:"yellow",tags:["Content","text","highlight","mark","html"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"innerText",title:"Text",description:"Text of the highlight",inputMethod:"textfield",required:!0}],advanced:[],developer:[]},demoSchema:[{tag:"mark",content:"Highlight me",properties:{}}]},"mark");this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:{primary:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:"Abbreviation",description:"Simple abbreviation with tooltip of full word",icon:"hax:abbr",color:"yellow",tags:["Content","text","abbr","html"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"innerText",title:"Text",description:"Text that is visible, the abbreviation",inputMethod:"textfield",required:!0},{attribute:"title",title:"Word",description:"Word that the abbreviation is representing",inputMethod:"textfield",required:!0}],advanced:[],developer:[]},demoSchema:[{tag:"abbr",content:"Abbr",properties:{title:"Abbreviation"}}]},"abbr");let e={type:"element",editingElement:"core",canScale:!1,designSystem:{accent:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:"Basic link",description:"A basic a tag",icon:"icons:link",color:"blue-grey",tags:["Resource","link","a","url","html","href","address","http"],handles:[],meta:{author:"W3C"}},settings:{configure:[{attribute:"href",title:"Link",description:"The URL for the link",inputMethod:"haxupload",required:!0,validationType:"url"},{attribute:"innerText",title:"Text",description:"Text of the link",inputMethod:"textfield",required:!0},{attribute:"target",title:"Target",description:"Where to open the link.",inputMethod:"select",options:{"":"Same window",_blank:"New window - _blank",_top:"Top window - _top",_parent:"Parent window - _parent"}}],advanced:[],developer:[{attribute:"title",title:"Title text",description:"Useful for screen readers and improved SEO.",inputMethod:"textfield"},{attribute:"rel",title:"rel",description:"Specifies the relationship between this document and the opened globalThis.document. Change as part of security or SEO policy.",inputMethod:"select",options:{noopener:"noopener","noopener noreferrer":"noopener noreferrer","nofollow ":"nofollow","noopener noreferrer nofollow":"noopener noreferrer nofollow",opener:"opener"}}]},demoSchema:[{tag:"p",content:'Link to content',properties:{}}]};this.validGizmoTypes.forEach((t=>{e.gizmo.handles.push({type:t,source:"href",title:"innerText",alt:"title"})})),this.setHaxProperties(e,"a");this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:!0,canEditSource:!0,contentEditable:!0,gizmo:{title:"Paragraph",description:"A basic text area",icon:"hax:paragraph",color:"blue-grey",tags:["Text","p","paragraph","text","html"],handles:[{type:"content",title:"innerHTML",alt:"title"}],meta:{author:"W3C",outlineDesigner:!0}},settings:{configure:[],advanced:[]},demoSchema:[{tag:"p",content:"Deep thoughts..",properties:{}}]},"p");let t={type:"element",editingElement:{tag:"editable-table",import:"@haxtheweb/editable-table/editable-table.js",callback:this.setupEditableTable.bind(this)},canScale:!0,canEditSource:!0,gizmo:{title:"Table",description:"A table for displaying data",icon:"image:grid-on",color:"blue-grey",tags:["Instructional","table","data","html","grid","matrix","spreadsheet","csv","excel"],meta:{hidden:!0,author:"W3C"}},settings:{configure:[],advanced:[]}};this.setHaxProperties(t,"table");let i=globalThis.document.createElement("editable-table");this.haxAutoloader.appendChild(i);let a={type:"element",editingElement:{tag:"iframe-loader",import:"@haxtheweb/iframe-loader/iframe-loader.js",callback:this.setupIframeLoader.bind(this)},canScale:!1,designSystem:{card:!0,primary:!0},canEditSource:!1,gizmo:{title:"iFrame",description:"A basic way to frame external web content",icon:"hax:iframe",color:"blue-grey",tags:["Resource","iframe","content","url","link","embed","https","html","address"],handles:[],meta:{author:"W3C",hidden:!0}},settings:{configure:[{attribute:"src",title:"Source",description:"The URL for this resource.",inputMethod:"textfield",icon:"link",required:!0,validationType:"url"}]}};this.setHaxProperties(a,"iframe");let o=globalThis.document.createElement("iframe-loader");this.haxAutoloader.appendChild(o);for(let e in this.__primsBuilder){let t="";["h1","h2","h3","h4","h5","h6"].includes(e)?t="Heading":"ul"!=e&&"ol"!=e||(t="
  • Item
  • Item
  • "),this.setHaxProperties({type:"element",editingElement:"core",canScale:!1,designSystem:["h1","h2","h3","h4","h5","h6"].includes(e)?{text:!0,card:!0,primary:!0,designTreatment:!0}:!!["ol","ul"].includes(e)&&{text:!0,card:!0,accent:!0,primary:!0},canEditSource:!0,contentEditable:!0,gizmo:{title:this.__primsBuilder[e].title,icon:this.__primsBuilder[e].icon,tags:this.__primsBuilder[e].tags||["Text",e,"html","text"],handles:this.__primsBuilder[e].handles||[],meta:{author:"W3C",inlineOnly:!!["em","b","strong","i","strike","u","sub","sup","span"].includes(e),hidden:!["h2","ul"].includes(e),outlineDesigner:!!["h2","ul"].includes(e)}},settings:{configure:[],advanced:[]},demoSchema:[{tag:e,content:t,properties:{}}]},e)}this.setHaxProperties({canScale:!0,type:"element",editingElement:"core",designSystem:{primary:!0},canEditSource:!1,contentEditable:!0,gizmo:{title:"Horizontal line",icon:"hax:hr",meta:{author:"W3C"}},settings:{configure:[],advanced:[]},demoSchema:[{tag:"hr",content:"",properties:{"data-width":"50"}}]},"hr")}_haxStorePieceRegistrationManager(e){e.detail&&e.detail.piece&&e.detail.object&&(this[e.detail.piece]=e.detail.object)}setupEditableTable(e){this.activeNode=e,setTimeout((()=>{e.editMode=!0,e.focus()}),0)}setupIframeLoader(e){this.activeNode=e,setTimeout((()=>{e.disabled=!0}),0)}async _haxStoreInsertContent(e){if(e.detail){let i=e.detail;if(globalThis.customElements.get(i.tag)){let e=globalThis.document.createElement(i.tag);this.testHook(e,"preProcessInsertContent")&&(i=await this.runHook(e,"preProcessInsertContent",[i,this.activeNode]))}var t={};if(void 0!==i.properties&&(t=i.properties),t.innerHTML&&(""==i.content&&(i.content=t.innerHTML),delete t.innerHTML),t.innerText&&(""==i.content&&(i.content=t.innerText),delete t.innerText),void 0!==i.__type&&"inline"===i.__type){let e=c({tag:i.tag,content:i.content,properties:t});null!==this.activePlaceHolder&&(this.activePlaceHolder.deleteContents(),this.activePlaceHolder.insertNode(e)),this.activePlaceHolder=null}else if(i.replace||i.replacement||i.nextToActive){let e=c({tag:i.tag,content:i.content,properties:t});this.activePlaceHolder?(this.activeHaxBody.haxReplaceNode(this.activePlaceHolder,e),this.activePlaceHolder=null):i.nextToActive&&this.activeNode?this.activeHaxBody.__slot&&this.activeNode.haxLayoutContainer?this.activeNode.appendChild(e):this.activeNode.parentNode.insertBefore(e,this.activeNode):this.activeHaxBody.haxReplaceNode(this.activeNode,e)}else if(this.activeNode&&this.activeNode.parentNode&&"HAX-BODY"!=this.activeNode.parentNode.tagName){let e=c({tag:i.tag,content:i.content,properties:t});this.activeNode.parentNode.haxLayoutContainer?(null!=this.activeNode.getAttribute("slot")&&e.setAttribute("slot",this.activeNode.getAttribute("slot")),this.activeHaxBody.haxInsert(i.tag,i.content,t)):this.activeHaxBody.haxInsert(i.tag,i.content,t)}else this.activeHaxBody.haxInsert(i.tag,i.content,t)}}slotsFromSchema(e,t=!1){let i=e?e.settings:{},a=[];return Object.keys({...i||{}}).map((e=>(i[e]||[]).filter((e=>{let i=!t||!e.required;return!(!e.slot&&""!==e.slot||a.includes(e.slot)||!i)&&(a.push(e.slot),!0)})))).flat()}haxSchemaFromTag(e){return e&&e.toLowerCase&&(e=e.toLowerCase(),this.elementList&&this.elementList[e])?this.elementList[e]:{}}_haxStoreInsertMultiple(e){var t;if(e.detail)for(let i in e.detail)t={},void 0!==e.detail[i].properties&&(t=e.detail[i].properties),this.activeHaxBody.haxInsert(e.detail[i].tag,e.detail[i].content,t)}_haxStoreRegisterBody(e){e.detail&&(this.haxBodies.push(e.detail),this.activeHaxBody=e.detail,this.write("activeHaxBody",this.activeHaxBody,this),this.write("editMode",this.editMode,this),clearTimeout(this.__storeReady),this.__storeReady=setTimeout((()=>{this._storePiecesAllHere(this.haxAutoloader,this.activeHaxBody,this.haxTray,this.haxCancel)}),0))}_superDaemonInsert(e){E.programTarget&&e.detail.properties&&(e.detail.properties.src||e.detail.properties.source||e.detail.properties.href)?E.programTarget.value=e.detail.properties.src||e.detail.properties.source||e.detail.properties.href:this.haxTray._processTrayEvent(e),E.programTarget=null}computePolyfillSafe(){return!(!globalThis.document.head.createShadowRoot&&!globalThis.document.head.attachShadow)||(console.warn("Shadow DOM missing, certain operations hidden"),!1)}_haxStoreRegisterApp(e){if(e.detail){const i=e.detail;i.index=this.appList.length,this.appList=[...this.appList,i],this.write("appList",T(this.appList),this);let a="media";if(i.connection.operations&&i.connection.operations.browse&&i.connection.operations.browse.resultMap&&i.connection.operations.browse.resultMap.defaultGizmoType&&(a=i.connection.operations.browse.resultMap.defaultGizmoType),E.defineOption({title:"Search "+i.details.title,icon:i.details.icon,tags:["Search",...i.details.tags,a],more:i.details.tos&&i.details.tos.length>0?t`
    Terms of service:
      ${i.details.tos.map((e=>t`
    • @@ -10,4 +10,4 @@ import{LitElement as e,html as t,nothing as i}from"../../../lit/index.js";import >
    • `))} -
    `:null,value:{name:"Search "+i.details.title,context:"/",index:i.index,detail:i,program:async(e,t)=>{const a=T(HAXStore.activeApp),o=T(HAXStore.appList[t.index]);a.index!=o.index&&(HAXStore.activeApp=T(HAXStore.appList[t.index]));let r={};r[Object.keys(t.detail.connection.operations.browse.search)[0]]=e,HAXStore.appSearch.updateSearchValues(r);let n=await HAXStore.appSearch.loadAppData(),s=[];return await n.forEach((async e=>{var t=e.map,a=e.type;a&&null!=a&&""!=a&&"undefined"!=a||!t.source||(a=HAXStore.guessGizmoType(t));let o=HAXStore.guessGizmo(a,t,!1,!0);o.length>0&&void 0!==o[0].tag&&(o[0].nextToActive=!0),s.push({title:e.title,image:e.image,tags:[],value:{value:o[0].tag,eventName:"insert-tag",properties:o[0].properties},context:["/","/sources/"+i.details.title.toLowerCase()],eventName:"hax-super-daemon-insert-tag",path:"/sources/"+i.details.title.toLowerCase()})})),s}},context:["HAX","/"],eventName:"super-daemon-run-program",path:"/sources/"+i.details.title.toLowerCase(),priority:"local files"===i.details.title.toLowerCase()?-100:0}),i.connection&&i.connection.protocol&&i.connection.url){let e=globalThis.document.createElement("link");e.rel="preconnect",e.href=i.connection.protocol+"://"+i.connection.url,globalThis.document.head.appendChild(e)}void 0!==e.target.parentElement&&"HAX-STORE"===e.target.parentElement.tagName&&e.target.parentElement.removeChild(e.target)}}_haxStoreRegisterStax(e){e.detail&&(e.detail.index=this.staxList.length,this.staxList=[...this.staxList,e.detail],this.write("staxList",this.staxList,this),void 0!==e.target.parentElement&&"HAX-STORE"===e.target.parentElement.tagName&&e.target.parentElement.removeChild(e.target))}activeBodyIgnoreActive(e){this.activeHaxBody.__ignoreActive=e}dashToCamel(e){return e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))}async htmlToHaxElements(e){let t=[],i=globalThis.document.createElement("div");if(i.innerHTML=e,i.children){const e=this.validTagList,a=i.children;for(let i=0;i","g"),">"),o[r]=n):""===n?(""==n&&""!=e.attributes.item(t).value&&(n=e.attributes.item(t).value),o[r]=n):o[r]=n)):o[r]=JSON.stringify(n).replace(new RegExp('"',"g"),""")}let s;if(customElements.get(t)&&(s=customElements.get(t).properties),void 0===s&&(s=e.__data),void 0!==s)for(let t in s){r=p(t),n=null;void 0!==e[t]&&(n=e[t]),s[t].readOnly||s[t].computed||n===s[t].value||r.startsWith("__")||(null==n||"object"!=typeof n&&n.constructor!==Array?null!=n&&"null"!=n&&(!0===n||"true"===n?o[r]=!0:!1===n||("string"==typeof n&&""!==n?(n=(n=(n=(n=n.replace(new RegExp("&","g"),"&")).replace(new RegExp('"',"g"),""")).replace(new RegExp("<","g"),"<")).replace(new RegExp(">","g"),">"),o[r]=n):""===n?""==n&&""!=s[t].value?n=s[t].value:""===n&&s[t].value:o[r]=n)):(n.constructor===Array&&n!=[]||"object"==typeof n&&n!={})&&(o[r]=JSON.stringify(n).replace(new RegExp('"',"g"),""")))}if(void 0!==a&&void 0!==a.saveOptions.unsetAttributes)for(let e in a.saveOptions.unsetAttributes)delete o[a.saveOptions.unsetAttributes[e]];let l=["inner-text","inner-html","tabindex","guestinstance"];for(let e in l)void 0!==o[l[e]]&&delete o[l[e]];void 0!==o.id&&""===o.id&&delete o.id,delete o.draggable,delete o.contenteditable,delete o.role,delete o["data-hax-ray"],delete o["data-hax-layout"],delete o["data-hax-grid"],delete o["data-hax-active"],""==o.class&&delete o.class;for(let e in o)!0===o[e]?i+=" "+e:i+=" "+e+'="'+o[e]+'"';if(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"].includes(t)?i+="/>":i+=">",void 0===a||!a.saveOptions.wipeSlot){let t=e.childNodes;if(t.length>0)for(let e=0,a=t.length;e":"hr"===t||"br"===t||"img"===t||(i+="\n"),i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=i.replace(/ /gm," ")).replace(/ data-hax-ray="(\s|.)*?"/gim,"")).replace(/ data-hax-active="(\s|.)*?"/gim,"")).replace(/ class=""/gim,"")).replace(/ contenteditable="(\s|.)*?"/gim,"")).replace(//gim,"")).replace(/\s*?<\/span>/g," ")).replace(/<\/span>/gm,"")).replace(//gim,"")).replace(//gim,"")).replace(//gim,"")).replace(//gim,"")).replace(//gim,"")).replace(/

    (\s*)<\/p>/gm,"

    ")).replace(/

     <\/p>/gm,"

    ")).replace(/

    <\/p>/gm,"

    ")).replace(/


    <\/p>/gm,"

    "),this.testHook(e,"postProcessNodeToContent")&&(i=await this.runHook(e,"postProcessNodeToContent",[i])),i}HTMLPrimativeTest(e){return void 0!==e.tagName&&-1==e.tagName.indexOf("-")}getHaxAppStoreTargets(e){return T(this.appList).filter((t=>{if(void 0!==t.connection.operations.add){let i=t.connection.operations.add;if(void 0!==i.acceptsGizmoTypes&&i.acceptsGizmoTypes.includes(e))return!0}return!1}))}async refreshActiveNodeForm(){this.haxTray.activeHaxElement=await d(this.haxTray.activeNode,null),await this.haxTray._setupForm()}haxElementPrototype(e,t,i=""){return{tag:e.tag,properties:t,content:i,gizmo:e}}async getHAXSlot(e){if(this.isTextElement(e))return e.innerHTML;let t="";var i=e.childNodes;if(i.length>0)for(let e=0,a=i.length;e0?t+=" "+await this.nodeToContent(i[e])+"\n":t+=" "+i[e].outerHTML+"\n":8===i[e].nodeType?t+="\x3c!-- "+i[e].textContent+" --\x3e":1!==i[e].nodeType&&void 0!==i[e].textContent&&"undefined"!==i[e].textContent&&(t+=i[e].textContent)}return t}async _haxStoreRegisterProperties(e){if(e.detail&&e.detail.properties&&e.detail.tag){if(!this.elementList[e.detail.tag]){let t=e.detail;t.properties=await this.attemptGizmoTranslation(t.tag,t.properties);let i=t.properties.gizmo;if(i){i.tag=t.tag;let e=this.gizmoList;e.push(i),this.gizmoList=[...e],this.write("gizmoList",e,this),i.meta&&(i.meta.inlineOnly||i.meta.hidden)||A.defineOption({title:i.title,icon:i.icon,tags:i.tags||[],value:{value:i.tag,eventName:"insert-tag",demoSchema:!0},context:["HAX"],eventName:"hax-super-daemon-insert-tag",path:"HAX/insert/block/"+i.tag})}this.elementList[t.tag]=t.properties,this.validTagList.find((e=>e===t.tag))||this.validTagList.push(t.tag),"grid"!=t.properties.type||this.validGridTagList.find((e=>e===t.tag))||this.validGridTagList.push(t.tag),globalThis.customElements.get(e.detail.tag)&&this.testHook(globalThis.document.createElement(e.detail.tag),"gizmoRegistration")&&await this.runHook(globalThis.document.createElement(e.detail.tag),"gizmoRegistration",[this])}void 0!==e.target.parentElement&&"HAX-AUTOLOADER"===e.target.parentElement.tagName&&this.haxAutoloader.removeChild(e.target)}}get activeGizmo(){let e=T(this._calculateActiveGizmo(this.activeNode));return this.write("activeGizmo",e,this),e}get activeNodeIndex(){let e=null;return this.activeNode&&Array.from(T(this.activeHaxBody).children).map(((t,i)=>{T(this.activeNode)!==t&&T(this.activeNode).parentElement!==t||(e=i)})),e}async attemptGizmoTranslation(e,t){var i=await w.loadNamespaceFile(e+".haxProperties");if(!i&&"en"==this.globalPreferences.haxLang&&globalThis.customElements.get(e)&&globalThis.customElements.get(e).haxProperties&&"string"==typeof(i=globalThis.customElements.get(e).haxProperties)&&(i=await fetch(i).then((e=>!(!e||!e.json)&&e.json()))),i){if(t.gizmo&&i.gizmo)for(let e in i.gizmo)t.gizmo[e]=i.gizmo[e];if(t.settings&&i.settings){let e={advanced:"advanced",configure:"configure"};for(let a in e)if(t.settings[a]&&i.settings[a])for(let e in i.settings[a])for(let o in i.settings[a][e])t.settings[a][e][o]=i.settings[a][e][o]}if(t.demoSchema&&i.demoSchema)for(let e in i.demoSchema)if(i.demoSchema[e].properties)for(let a in i.demoSchema[e].properties)t.demoSchema[e].properties[a]=i.demoSchema[e].properties[a]}return t}}customElements.define(HaxStore.tag,HaxStore);export{HaxStore};globalThis.HaxStore=globalThis.HaxStore||{},globalThis.HaxStore.requestAvailability=function(){return globalThis.HaxStore.instance||(globalThis.HaxStore.instance=globalThis.document.createElement("hax-store"),globalThis.document.body.appendChild(globalThis.HaxStore.instance)),globalThis.HaxStore.instance};export const HAXStore=globalThis.HaxStore.requestAvailability();globalThis.Hax=globalThis.Hax||{},globalThis.Hax.add=function(e){if(HAXStore.elementList[e]){let t,i=HAXStore.haxSchemaFromTag(e);t=i.gizmo.tag&&i.demoSchema&&i.demoSchema[0]?c(i.demoSchema[0]):globalThis.document.createElement(e),HAXStore.activeHaxBody.haxReplaceNode(HAXStore.activeNode,t),HAXStore.activeHaxBody.__focusLogic(t)}else HAXStore.toast(`${e} is not a valid tag`)},globalThis.Hax.delete=function(){null!=HAXStore.activeNode&&HAXStore.activeHaxBody.haxDeleteNode(HAXStore.activeNode)},globalThis.Hax.duplicate=function(){HAXStore.activeHaxBody.haxDuplicateNode(HAXStore.activeNode)},globalThis.Hax.move=function(e=!0){e?HAXStore.activeHaxBody.haxMoveGridPlate(HAXStore.activeNode,-1):HAXStore.activeHaxBody.haxMoveGridPlate(HAXStore.activeNode)},globalThis.Hax.grid=function(e=!0){HAXStore.activeHaxBody.haxGridPlateOps(e)},globalThis.Hax.set=function(e,t){HAXStore.write(e,t,window)},globalThis.Hax.get=function(e){return HAXStore[e]},globalThis.Hax.export=async function(){return await HAXStore.activeHaxBody.haxToContent()},globalThis.Hax.import=function(e="

    "){return HAXStore.activeHaxBody.importContent(e)}; \ No newline at end of file + `:null,value:{name:"Search "+i.details.title,context:"/",index:i.index,detail:i,program:async(e,t)=>{const a=T(HAXStore.activeApp),o=T(HAXStore.appList[t.index]);a.index!=o.index&&(HAXStore.activeApp=T(HAXStore.appList[t.index]));let r={};r[Object.keys(t.detail.connection.operations.browse.search)[0]]=e,HAXStore.appSearch.updateSearchValues(r);let n=await HAXStore.appSearch.loadAppData(),s=[];return await n.forEach((async e=>{var t=e.map,a=e.type;a&&null!=a&&""!=a&&"undefined"!=a||!t.source||(a=HAXStore.guessGizmoType(t));let o=HAXStore.guessGizmo(a,t,!1,!0);o.length>0&&void 0!==o[0].tag&&(o[0].nextToActive=!0),s.push({title:e.title,image:e.image,tags:[],value:{value:o[0].tag,eventName:"insert-tag",properties:o[0].properties},context:["/","/sources/"+i.details.title.toLowerCase()],eventName:"hax-super-daemon-insert-tag",path:"/sources/"+i.details.title.toLowerCase()})})),s}},context:["HAX","/"],eventName:"super-daemon-run-program",path:"/sources/"+i.details.title.toLowerCase(),priority:"local files"===i.details.title.toLowerCase()?-100:0}),i.connection&&i.connection.protocol&&i.connection.url){let e=globalThis.document.createElement("link");e.rel="preconnect",e.href=i.connection.protocol+"://"+i.connection.url,globalThis.document.head.appendChild(e)}void 0!==e.target.parentElement&&"HAX-STORE"===e.target.parentElement.tagName&&e.target.parentElement.removeChild(e.target)}}_haxStoreRegisterStax(e){e.detail&&(e.detail.index=this.staxList.length,this.staxList=[...this.staxList,e.detail],this.write("staxList",this.staxList,this),void 0!==e.target.parentElement&&"HAX-STORE"===e.target.parentElement.tagName&&e.target.parentElement.removeChild(e.target))}activeBodyIgnoreActive(e){this.activeHaxBody.__ignoreActive=e}dashToCamel(e){return e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))}async htmlToHaxElements(e){let t=[],i=globalThis.document.createElement("div");if(i.innerHTML=e,i.children){const e=this.validTagList,a=i.children;for(let i=0;i","g"),">"),o[r]=n):""===n?(""==n&&""!=e.attributes.item(t).value&&(n=e.attributes.item(t).value),o[r]=n):o[r]=n)):o[r]=JSON.stringify(n).replace(new RegExp('"',"g"),""")}let s;if(customElements.get(t)&&(s=customElements.get(t).properties),void 0===s&&(s=e.__data),void 0!==s)for(let t in s){r=p(t),n=null;void 0!==e[t]&&(n=e[t]),s[t].readOnly||s[t].computed||n===s[t].value||r.startsWith("__")||(null==n||"object"!=typeof n&&n.constructor!==Array?null!=n&&"null"!=n&&(!0===n||"true"===n?o[r]=!0:!1===n||("string"==typeof n&&""!==n?(n=(n=(n=(n=n.replace(new RegExp("&","g"),"&")).replace(new RegExp('"',"g"),""")).replace(new RegExp("<","g"),"<")).replace(new RegExp(">","g"),">"),o[r]=n):""===n?""==n&&""!=s[t].value?n=s[t].value:""===n&&s[t].value:o[r]=n)):(n.constructor===Array&&n!=[]||"object"==typeof n&&n!={})&&(o[r]=JSON.stringify(n).replace(new RegExp('"',"g"),""")))}if(void 0!==a&&void 0!==a.saveOptions.unsetAttributes)for(let e in a.saveOptions.unsetAttributes)delete o[a.saveOptions.unsetAttributes[e]];let l=["inner-text","inner-html","tabindex","guestinstance"];for(let e in l)void 0!==o[l[e]]&&delete o[l[e]];void 0!==o.id&&""===o.id&&delete o.id,delete o.draggable,delete o.contenteditable,delete o.role,delete o["data-hax-ray"],delete o["data-hax-layout"],delete o["data-hax-grid"],delete o["data-hax-active"],""==o.class&&delete o.class;for(let e in o)!0===o[e]?i+=" "+e:i+=" "+e+'="'+o[e]+'"';if(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"].includes(t)?i+="/>":i+=">",void 0===a||!a.saveOptions.wipeSlot){let t=e.childNodes;if(t.length>0)for(let e=0,a=t.length;e":"hr"===t||"br"===t||"img"===t||(i+="\n"),i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=i.replace(/ /gm," ")).replace(/ data-hax-ray="(\s|.)*?"/gim,"")).replace(/ data-hax-active="(\s|.)*?"/gim,"")).replace(/ class=""/gim,"")).replace(/ contenteditable="(\s|.)*?"/gim,"")).replace(//gim,"")).replace(/\s*?<\/span>/g," ")).replace(/<\/span>/gm,"")).replace(//gim,"")).replace(//gim,"")).replace(//gim,"")).replace(//gim,"")).replace(//gim,"")).replace(/

    (\s*)<\/p>/gm,"

    ")).replace(/

     <\/p>/gm,"

    ")).replace(/

    <\/p>/gm,"

    ")).replace(/


    <\/p>/gm,"

    "),this.testHook(e,"postProcessNodeToContent")&&(i=await this.runHook(e,"postProcessNodeToContent",[i])),i}HTMLPrimativeTest(e){return void 0!==e.tagName&&-1==e.tagName.indexOf("-")}getHaxAppStoreTargets(e){return T(this.appList).filter((t=>{if(void 0!==t.connection.operations.add){let i=t.connection.operations.add;if(void 0!==i.acceptsGizmoTypes&&i.acceptsGizmoTypes.includes(e))return!0}return!1}))}async refreshActiveNodeForm(){this.haxTray.activeHaxElement=await d(this.haxTray.activeNode,null),await this.haxTray._setupForm()}haxElementPrototype(e,t,i=""){return{tag:e.tag,properties:t,content:i,gizmo:e}}async getHAXSlot(e){if(this.isTextElement(e))return e.innerHTML;let t="";var i=e.childNodes;if(i.length>0)for(let e=0,a=i.length;e0?t+=" "+await this.nodeToContent(i[e])+"\n":t+=" "+i[e].outerHTML+"\n":8===i[e].nodeType?t+="\x3c!-- "+i[e].textContent+" --\x3e":1!==i[e].nodeType&&void 0!==i[e].textContent&&"undefined"!==i[e].textContent&&(t+=i[e].textContent)}return t}async _haxStoreRegisterProperties(e){if(e.detail&&e.detail.properties&&e.detail.tag){if(!this.elementList[e.detail.tag]){let t=e.detail;t.properties=await this.attemptGizmoTranslation(t.tag,t.properties);let i=t.properties.gizmo;if(i){i.tag=t.tag;let e=this.gizmoList;e.push(i),this.gizmoList=[...e],this.write("gizmoList",e,this),i.meta&&(i.meta.inlineOnly||i.meta.hidden)||E.defineOption({title:i.title,icon:i.icon,tags:i.tags||[],value:{value:i.tag,eventName:"insert-tag",demoSchema:!0},context:["HAX"],eventName:"hax-super-daemon-insert-tag",path:"HAX/insert/block/"+i.tag})}this.elementList[t.tag]=t.properties,this.validTagList.find((e=>e===t.tag))||this.validTagList.push(t.tag),"grid"!=t.properties.type||this.validGridTagList.find((e=>e===t.tag))||this.validGridTagList.push(t.tag),globalThis.customElements.get(e.detail.tag)&&this.testHook(globalThis.document.createElement(e.detail.tag),"gizmoRegistration")&&await this.runHook(globalThis.document.createElement(e.detail.tag),"gizmoRegistration",[this])}void 0!==e.target.parentElement&&"HAX-AUTOLOADER"===e.target.parentElement.tagName&&this.haxAutoloader.removeChild(e.target)}}get activeGizmo(){let e=T(this._calculateActiveGizmo(this.activeNode));return this.write("activeGizmo",e,this),e}get activeNodeIndex(){let e=null;return this.activeNode&&Array.from(T(this.activeHaxBody).children).map(((t,i)=>{T(this.activeNode)!==t&&T(this.activeNode).parentElement!==t||(e=i)})),e}async attemptGizmoTranslation(e,t){var i=await w.loadNamespaceFile(e+".haxProperties");if(!i&&"en"==this.globalPreferences.haxLang&&globalThis.customElements.get(e)&&globalThis.customElements.get(e).haxProperties&&"string"==typeof(i=globalThis.customElements.get(e).haxProperties)&&(i=await fetch(i).then((e=>!(!e||!e.json)&&e.json()))),i){if(t.gizmo&&i.gizmo)for(let e in i.gizmo)t.gizmo[e]=i.gizmo[e];if(t.settings&&i.settings){let e={advanced:"advanced",configure:"configure"};for(let a in e)if(t.settings[a]&&i.settings[a])for(let e in i.settings[a])for(let o in i.settings[a][e])t.settings[a][e][o]=i.settings[a][e][o]}if(t.demoSchema&&i.demoSchema)for(let e in i.demoSchema)if(i.demoSchema[e].properties)for(let a in i.demoSchema[e].properties)t.demoSchema[e].properties[a]=i.demoSchema[e].properties[a]}return t}}customElements.define(HaxStore.tag,HaxStore);export{HaxStore};globalThis.HaxStore=globalThis.HaxStore||{},globalThis.HaxStore.requestAvailability=function(){return globalThis.HaxStore.instance||(globalThis.HaxStore.instance=globalThis.document.createElement("hax-store"),globalThis.document.body.appendChild(globalThis.HaxStore.instance)),globalThis.HaxStore.instance};export const HAXStore=globalThis.HaxStore.requestAvailability();globalThis.Hax=globalThis.Hax||{},globalThis.Hax.add=function(e){if(HAXStore.elementList[e]){let t,i=HAXStore.haxSchemaFromTag(e);t=i.gizmo.tag&&i.demoSchema&&i.demoSchema[0]?c(i.demoSchema[0]):globalThis.document.createElement(e),HAXStore.activeHaxBody.haxReplaceNode(HAXStore.activeNode,t),HAXStore.activeHaxBody.__focusLogic(t)}else HAXStore.toast(`${e} is not a valid tag`)},globalThis.Hax.delete=function(){null!=HAXStore.activeNode&&HAXStore.activeHaxBody.haxDeleteNode(HAXStore.activeNode)},globalThis.Hax.duplicate=function(){HAXStore.activeHaxBody.haxDuplicateNode(HAXStore.activeNode)},globalThis.Hax.move=function(e=!0){e?HAXStore.activeHaxBody.haxMoveGridPlate(HAXStore.activeNode,-1):HAXStore.activeHaxBody.haxMoveGridPlate(HAXStore.activeNode)},globalThis.Hax.grid=function(e=!0){HAXStore.activeHaxBody.haxGridPlateOps(e)},globalThis.Hax.set=function(e,t){HAXStore.write(e,t,window)},globalThis.Hax.get=function(e){return HAXStore[e]},globalThis.Hax.export=async function(){return await HAXStore.activeHaxBody.haxToContent()},globalThis.Hax.import=function(e="

    "){return HAXStore.activeHaxBody.importContent(e)}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/haxcms-elements/lib/core/haxcms-site-router.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/haxcms-elements/lib/core/haxcms-site-router.js index 4523095e..e6476d6f 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/haxcms-elements/lib/core/haxcms-site-router.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/haxcms-elements/lib/core/haxcms-site-router.js @@ -1 +1 @@ -import{Router as t}from"../../../../@vaadin/router/dist/vaadin-router.js";import{autorun as e}from"../../../../mobx/dist/mobx.esm.js";import{store as i}from"./haxcms-site-store.js";class HAXCMSSiteRouter extends HTMLElement{get baseURI(){return this.getAttribute("base-uri")}set baseURI(t){this.setAttribute("base-uri",t)}static get tag(){return"haxcms-site-router"}constructor(){super(),this.windowControllers=new AbortController,globalThis.HAXCMS.requestAvailability().storePieces.siteRouter=this;let s={};this.baseURI&&(s.baseUrl=this.baseURI),this.router=new t(this,s),this.__disposer=this.__disposer?this.__disposer:[],e((t=>{this._updateRouter(i.routerManifest),this.__disposer.push(t)})),globalThis.addEventListener("vaadin-router-location-changed",this._routerLocationChanged.bind(this),{signal:this.windowControllers.signal}),globalThis.addEventListener("haxcms-site-router-add",this.addRoutesEvent.bind(this),{signal:this.windowControllers.signal})}disconnectedCallback(){for(var t in this.__disposer)this.__disposer[t].dispose();this.windowControllers.abort()}addRoutesEvent(t){this.addRoutes(t.detail)}addRoutes(t){this.router.addRoutes(t)}_updateRouter(t){if(!t||void 0===t.items)return;const e=t.items.map((t=>({path:t.slug,name:t.id,component:`fake-${t.id}-e`})));this.router.setRoutes([...e,{path:"/",component:"fake-home-e",name:"home"},{path:"/(.*)",component:"fake-404-e",name:"404"}])}lookupRoute(t=null){return!!(t&&i.routerManifest&&i.routerManifest.items&&i.routerManifest.items.filter((e=>e.slug===t)).length>0)&&i.routerManifest.items.filter((e=>e.slug===t))}_routerLocationChanged(t){if(globalThis.dispatchEvent(new CustomEvent("simple-modal-hide",{bubbles:!0,cancelable:!0,detail:{}})),globalThis.dispatchEvent(new CustomEvent("haxcms-toast-hide",{bubbles:!0,cancelable:!0,detail:{}})),globalThis.dispatchEvent(new CustomEvent("super-daemon-close",{bubbles:!0,cancelable:!0,detail:{}})),i.currentRouterLocation=t.detail.location,"404"===t.detail.location.route.name&&(t.detail.location.params[0].startsWith("files/")||t.detail.location.params[0].startsWith("assets/")))globalThis.location=t.detail.location.pathname;else if("home"===t.detail.location.route.name&&t.detail.location.search.startsWith("?p=/")&&this.lookupRoute(t.detail.location.search.replace("?p=/","").split("&")[0])){let e=this.lookupRoute(t.detail.location.search.replace("?p=/","").split("&")[0])[0];i.activeId=e.id,globalThis.history.replaceState({},null,t.detail.location.search.replace("?p=/","").split("&")[0]),t.detail.location.search=t.detail.location.search.replace("?p=/","").split("&")[0],i.location=t.detail.location}else i.location=t.detail.location}}customElements.define(HAXCMSSiteRouter.tag,HAXCMSSiteRouter);export{HAXCMSSiteRouter}; \ No newline at end of file +import{Router as t}from"../../../../@vaadin/router/dist/vaadin-router.js";import{autorun as e}from"../../../../mobx/dist/mobx.esm.js";import{store as i}from"./haxcms-site-store.js";class HAXCMSSiteRouter extends HTMLElement{get baseURI(){return this.getAttribute("base-uri")}set baseURI(t){this.setAttribute("base-uri",t)}static get tag(){return"haxcms-site-router"}constructor(){super(),this.windowControllers=new AbortController,globalThis.HAXCMS.requestAvailability().storePieces.siteRouter=this;let o={};this.baseURI&&(o.baseUrl=this.baseURI),this.router=new t(this,o),this.__disposer=this.__disposer?this.__disposer:[],e((t=>{this._updateRouter(i.routerManifest),this.__disposer.push(t)})),globalThis.addEventListener("vaadin-router-location-changed",this._routerLocationChanged.bind(this),{signal:this.windowControllers.signal}),globalThis.addEventListener("haxcms-site-router-add",this.addRoutesEvent.bind(this),{signal:this.windowControllers.signal})}disconnectedCallback(){for(var t in this.__disposer)this.__disposer[t].dispose();this.windowControllers.abort()}addRoutesEvent(t){this.addRoutes(t.detail)}addRoutes(t){this.router.addRoutes(t)}_updateRouter(t){if(!t||void 0===t.items)return;const e=t.items.map((t=>({path:t.slug,name:t.id,component:`fake-${t.id}-e`})));this.router.setRoutes([...e,{path:"/",component:"fake-home-e",name:"home"},{path:"/(.*)",component:"fake-404-e",name:"404"}])}lookupRoute(t=null){return!!(t&&i.routerManifest&&i.routerManifest.items&&i.routerManifest.items.filter((e=>e.slug===t)).length>0)&&i.routerManifest.items.filter((e=>e.slug===t))}_routerLocationChanged(t){if(globalThis.dispatchEvent(new CustomEvent("simple-modal-hide",{bubbles:!0,cancelable:!0,detail:{}})),globalThis.dispatchEvent(new CustomEvent("haxcms-toast-hide",{bubbles:!0,cancelable:!0,detail:{}})),globalThis.dispatchEvent(new CustomEvent("super-daemon-close",{bubbles:!0,cancelable:!0,detail:{}})),i.currentRouterLocation=t.detail.location,"404"===t.detail.location.route.name&&(t.detail.location.params[0].startsWith("files/")||t.detail.location.params[0].startsWith("assets/")))globalThis.location=t.detail.location.pathname;else if("home"===t.detail.location.route.name&&t.detail.location.search.startsWith("?p=/")&&this.lookupRoute(t.detail.location.search.replace("?p=/","").split("&")[0])){let e=this.lookupRoute(t.detail.location.search.replace("?p=/","").split("&")[0])[0];i.activeId=e.id,globalThis.history.replaceState({},null,t.detail.location.search.replace("?p=/","").split("&")[0]),t.detail.location.search=t.detail.location.search.replace("?p=/","").split("&")[0],t.detail.location.route.name=e.id,t.detail.location.route.path=t.detail.location.search,t.detail.location.route.component=`fake-${e.id}-e`,i.location=t.detail.location}else i.location=t.detail.location}}customElements.define(HAXCMSSiteRouter.tag,HAXCMSSiteRouter);export{HAXCMSSiteRouter}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/haxcms-elements/package.json b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/haxcms-elements/package.json index 8c31d1c9..c9d403cc 100755 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/haxcms-elements/package.json +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/haxcms-elements/package.json @@ -16,7 +16,7 @@ }, "sharedStyles": [] }, - "version": "9.0.10", + "version": "9.0.21", "description": "HAX CMS series of elements to provide a full on CMS", "repository": { "type": "git", @@ -42,63 +42,63 @@ "license": "Apache-2.0", "dependencies": { "@github/time-elements": "3.1.4", - "@haxtheweb/anchor-behaviors": "^9.0.7", - "@haxtheweb/app-hax": "^9.0.10", - "@haxtheweb/beaker-broker": "^9.0.7", - "@haxtheweb/citation-element": "^9.0.10", - "@haxtheweb/clean-one": "^9.0.7", - "@haxtheweb/clean-two": "^9.0.7", - "@haxtheweb/collection-list": "^9.0.10", - "@haxtheweb/course-design": "^9.0.10", - "@haxtheweb/dynamic-import-registry": "^9.0.7", + "@haxtheweb/anchor-behaviors": "^9.0.18", + "@haxtheweb/app-hax": "^9.0.21", + "@haxtheweb/beaker-broker": "^9.0.18", + "@haxtheweb/citation-element": "^9.0.21", + "@haxtheweb/clean-one": "^9.0.18", + "@haxtheweb/clean-two": "^9.0.18", + "@haxtheweb/collection-list": "^9.0.21", + "@haxtheweb/course-design": "^9.0.21", + "@haxtheweb/dynamic-import-registry": "^9.0.18", "@haxtheweb/editable-outline": "^9.0.1", - "@haxtheweb/editable-table": "^9.0.10", - "@haxtheweb/full-width-image": "^9.0.7", - "@haxtheweb/git-corner": "^9.0.7", - "@haxtheweb/h-a-x": "^9.0.10", - "@haxtheweb/hax-body": "^9.0.10", - "@haxtheweb/hax-body-behaviors": "^9.0.7", - "@haxtheweb/hax-logo": "^9.0.7", - "@haxtheweb/haxor-slevin": "^9.0.7", - "@haxtheweb/html-block": "^9.0.7", - "@haxtheweb/json-outline-schema": "^9.0.7", - "@haxtheweb/jwt-login": "^9.0.7", - "@haxtheweb/learn-two-theme": "^9.0.7", - "@haxtheweb/lesson-overview": "^9.0.7", - "@haxtheweb/license-element": "^9.0.7", + "@haxtheweb/editable-table": "^9.0.21", + "@haxtheweb/full-width-image": "^9.0.18", + "@haxtheweb/git-corner": "^9.0.18", + "@haxtheweb/h-a-x": "^9.0.21", + "@haxtheweb/hax-body": "^9.0.21", + "@haxtheweb/hax-body-behaviors": "^9.0.18", + "@haxtheweb/hax-logo": "^9.0.18", + "@haxtheweb/haxor-slevin": "^9.0.18", + "@haxtheweb/html-block": "^9.0.18", + "@haxtheweb/json-outline-schema": "^9.0.18", + "@haxtheweb/jwt-login": "^9.0.18", + "@haxtheweb/learn-two-theme": "^9.0.21", + "@haxtheweb/lesson-overview": "^9.0.18", + "@haxtheweb/license-element": "^9.0.18", "@haxtheweb/lrndesign-sidenote": "^9.0.1", - "@haxtheweb/lunr-search": "^9.0.7", - "@haxtheweb/map-menu": "^9.0.7", - "@haxtheweb/md-block": "^9.0.10", - "@haxtheweb/outline-designer": "^9.0.10", - "@haxtheweb/outline-player": "^9.0.7", - "@haxtheweb/page-contents-menu": "^9.0.7", - "@haxtheweb/page-flag": "^9.0.10", - "@haxtheweb/play-list": "^9.0.10", - "@haxtheweb/portal-launcher": "^9.0.7", - "@haxtheweb/product-card": "^9.0.10", - "@haxtheweb/q-r": "^9.0.7", - "@haxtheweb/replace-tag": "^9.0.7", - "@haxtheweb/retro-card": "^9.0.7", - "@haxtheweb/rpg-character": "^9.0.7", - "@haxtheweb/runkit-embed": "^9.0.7", - "@haxtheweb/schema-behaviors": "^9.0.7", - "@haxtheweb/scroll-button": "^9.0.7", - "@haxtheweb/simple-blog": "^9.0.7", - "@haxtheweb/simple-colors": "^9.0.7", - "@haxtheweb/simple-datetime": "^9.0.7", - "@haxtheweb/simple-fields": "^9.0.10", - "@haxtheweb/simple-icon": "^9.0.7", - "@haxtheweb/simple-icon-picker": "^9.0.7", - "@haxtheweb/simple-img": "^9.0.7", - "@haxtheweb/simple-login": "^9.0.7", - "@haxtheweb/simple-picker": "^9.0.7", - "@haxtheweb/simple-progress": "^9.0.7", - "@haxtheweb/simple-toast": "^9.0.10", - "@haxtheweb/simple-tooltip": "^9.0.7", - "@haxtheweb/super-daemon": "^9.0.10", - "@haxtheweb/video-player": "^9.0.10", - "@haxtheweb/wc-autoload": "^9.0.7", + "@haxtheweb/lunr-search": "^9.0.18", + "@haxtheweb/map-menu": "^9.0.21", + "@haxtheweb/md-block": "^9.0.21", + "@haxtheweb/outline-designer": "^9.0.21", + "@haxtheweb/outline-player": "^9.0.21", + "@haxtheweb/page-contents-menu": "^9.0.18", + "@haxtheweb/page-flag": "^9.0.21", + "@haxtheweb/play-list": "^9.0.21", + "@haxtheweb/portal-launcher": "^9.0.18", + "@haxtheweb/product-card": "^9.0.21", + "@haxtheweb/q-r": "^9.0.18", + "@haxtheweb/replace-tag": "^9.0.19", + "@haxtheweb/retro-card": "^9.0.18", + "@haxtheweb/rpg-character": "^9.0.18", + "@haxtheweb/runkit-embed": "^9.0.18", + "@haxtheweb/schema-behaviors": "^9.0.18", + "@haxtheweb/scroll-button": "^9.0.18", + "@haxtheweb/simple-blog": "^9.0.18", + "@haxtheweb/simple-colors": "^9.0.18", + "@haxtheweb/simple-datetime": "^9.0.18", + "@haxtheweb/simple-fields": "^9.0.21", + "@haxtheweb/simple-icon": "^9.0.18", + "@haxtheweb/simple-icon-picker": "^9.0.18", + "@haxtheweb/simple-img": "^9.0.18", + "@haxtheweb/simple-login": "^9.0.18", + "@haxtheweb/simple-picker": "^9.0.18", + "@haxtheweb/simple-progress": "^9.0.18", + "@haxtheweb/simple-toast": "^9.0.21", + "@haxtheweb/simple-tooltip": "^9.0.18", + "@haxtheweb/super-daemon": "^9.0.21", + "@haxtheweb/video-player": "^9.0.21", + "@haxtheweb/wc-autoload": "^9.0.18", "@polymer/app-layout": "^3.0.2", "@polymer/iron-ajax": "^3.0.1", "@polymer/iron-list": "^3.0.2", @@ -115,8 +115,8 @@ "wired-elements": "3.0.0-rc.6" }, "devDependencies": { - "@haxtheweb/deduping-fix": "^9.0.7", - "@haxtheweb/storybook-utilities": "^9.0.7", + "@haxtheweb/deduping-fix": "^9.0.18", + "@haxtheweb/storybook-utilities": "^9.0.18", "@open-wc/testing": "4.0.0", "@polymer/iron-component-page": "github:PolymerElements/iron-component-page", "@polymer/iron-demo-helpers": "3.1.0", @@ -138,5 +138,5 @@ "haxtheweb", "lit" ], - "gitHead": "7f62cde6a6242afcb57715e1e2067ea767c777fd" + "gitHead": "73a678e1d035b003097fd50b7b23c0d9c30f9b26" } diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/i18n-manager/i18n-manager.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/i18n-manager/i18n-manager.js index ce2485c5..5c33cb9f 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/i18n-manager/i18n-manager.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/i18n-manager/i18n-manager.js @@ -1,5 +1,5 @@ /** * Copyright 2021 The Pennsylvania State University - * @license Apache-2.0, see License.md for full text. + * @license Apache-2.0, see License.md for full text */ import{LitElement as e}from"../../lit/index.js";globalThis.I18NManagerStore=globalThis.I18NManagerStore||{},globalThis.I18NManagerStore.requestAvailability=()=>(!globalThis.I18NManagerStore.instance&&globalThis.document&&globalThis.document.body&&(globalThis.I18NManagerStore.instance=globalThis.document.createElement("i18n-manager"),globalThis.document.body.appendChild(globalThis.I18NManagerStore.instance)),globalThis.I18NManagerStore.instance);export const I18NManagerStore=globalThis.I18NManagerStore.requestAvailability();class I18NManager extends e{constructor(){super(),this.windowControllers=new AbortController,this.fetchTargets={},this.elements=[],this.locales=new Set([]),this.lang=this.documentLang,this.dir=this.documentDir}get documentLang(){return globalThis.document.body.getAttribute("xml:lang")||globalThis.document.body.getAttribute("lang")||globalThis.document.documentElement.getAttribute("xml:lang")||globalThis.document.documentElement.getAttribute("lang")||globalThis.navigator.language||"en"}get documentDir(){return globalThis.document.body.getAttribute("xml:dir")||globalThis.document.body.getAttribute("dir")||globalThis.document.documentElement.getAttribute("xml:dir")||globalThis.document.documentElement.getAttribute("dir")||"ltr"}connectedCallback(){this.__ready=!0,globalThis.addEventListener("i18n-manager-register-element",this.registerLocalizationEvent.bind(this),{signal:this.windowControllers.signal}),globalThis.addEventListener("languagechange",this.changeLanguageEvent.bind(this),{signal:this.windowControllers.signal})}disconnectedCallback(){this.windowControllers.abort()}changeLanguageEvent(e){this.lang=e.detail}registerLocalizationEvent(e){let t=this.detailNormalize(e.detail);t.namespace&&t.localesPath&&t.locales&&this.registerLocalization(t)}detailNormalize(e){if(!e.namespace&&e.context&&(e.namespace=e.context.tagName.toLowerCase()),!e.updateCallback&&e.context&&(e.context.requestUpdate?e.updateCallback="requestUpdate":e.context.render&&(e.updateCallback="render")),!e.localesPath&&e.basePath&&(e.localesPath=`${decodeURIComponent(e.basePath)}/../locales`),e.context&&e.namespace){e.context.t&&(e.context._t={...e.context.t});let t=this.elements.filter((t=>{if(t.namespace==e.namespace&&t.localesPath&&t.locales)return!0}));t&&t.length&&t[0]&&(e.localesPath=t[0].localesPath,e.locales=t[0].locales)}return e}registerLocalization(e){(!e.context&&0===this.elements.filter((t=>t.namespace===e.namespace)).length||0===this.elements.filter((t=>t.context===e.context)).length)&&(e=this.detailNormalize(e),this.elements.push(e),e&&e.locales&&e.locales.forEach(this.locales.add,this.locales),this.lang&&this.__ready&&e.locales&&e.locales.includes(this.lang)&&(clearTimeout(this._debounce),this._debounce=setTimeout((()=>{this.updateLanguage(this.lang)}),0)))}static get tag(){return"i18n-manager"}async loadNamespaceFile(e,t=this.lang){const a=t.split("-");let l=this.elements.filter((l=>l.namespace===e&&(l.locales.includes(t)||l.locales.includes(a[0]))));if(l&&1===l.length){const e=l[0];var n="";return e.locales.includes(t)?n=`${e.localesPath}/${e.namespace}.${t}.json`:e.locales.includes(a[0])&&(n=`${e.localesPath}/${e.namespace}.${a[0]}.json`),""==n?{}:(this.fetchTargets[n]||(this.fetchTargets[n]=await fetch(n).then((e=>!(!e||!e.json)&&e.json()))),this.fetchTargets[n])}}async updateLanguage(e){if(e){const n=e.split("-"),s=this.elements.filter((t=>{try{return t.locales.includes(e)||t.locales.includes(n[0])}catch(e){console.error("i18n registration incorrect in:",t,e)}})),i=this.elements.filter((t=>!t.locales.includes(e)&&!t.locales.includes(n[0])));if(0!==i.length)for(var t in i){let e=i[t];e.context&&(e.context.t={...e.context._t},e.updateCallback&&e.context[e.updateCallback]())}for(var t in s){let i=s[t];var a="";if(i.locales.includes(e)?a=`${i.localesPath}/${i.namespace}.${e}.json`:i.locales.includes(n[0])&&(a=`${i.localesPath}/${i.namespace}.${n[0]}.json`),this.fetchTargets[a]){if(i.context){let e=this.fetchTargets[a];for(var l in e)i.context.t[l]=e[l];i.context.t={...i.context.t},i.updateCallback&&i.context[i.updateCallback]()}}else if(this.fetchTargets[a]=await fetch(a).then((e=>!(!e||!e.json)&&e.json())),i.context){for(var l in this.fetchTargets[a])i.context.t[l]=this.fetchTargets[a][l];i.context.t={...i.context.t},i.updateCallback&&i.context&&i.context[i.updateCallback]()}}}}static get observedAttributes(){return["lang","dir"]}attributeChangedCallback(e,t,a){"lang"!==e&&"dir"!==e||this.dispatchEvent(new CustomEvent(`${e}-changed`,{detail:{value:a}})),"lang"===e&&a&&this.__ready&&this.updateLanguage(a)}get lang(){return this.getAttribute("lang")}set lang(e){e?this.setAttribute("lang",e):this.removeAttribute("lang")}get dir(){return this.getAttribute("dir")}set dir(e){e?this.setAttribute("dir",e):this.removeAttribute("dir")}}globalThis.customElements.define(I18NManager.tag,I18NManager);export{I18NManager}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/image-inspector/image-inspector.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/image-inspector/image-inspector.js index 8e39f8f6..6a5691a7 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/image-inspector/image-inspector.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/image-inspector/image-inspector.js @@ -42,33 +42,33 @@ import{LitElement as t,html as i,css as o}from"../../lit/index.js";import"../sim `]}constructor(){super(),this.noLeft=!1,this.degrees=0,this.src=""}render(){return i`
    - - - - - - - + + + + + + +
    diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/la-tex/lib/la-tex.haxProperties.json b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/la-tex/lib/la-tex.haxProperties.json index 5d0cb792..7589cef0 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/la-tex/lib/la-tex.haxProperties.json +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/la-tex/lib/la-tex.haxProperties.json @@ -1,47 +1,40 @@ { - "api": "1", - "type": "grid", - "canScale": false, - "designSystem": false, - "canEditSource": true, - "contentEditable": false, - "editingElement": "core", - "hideDefaultSettings": false, - "gizmo": { - "title": "LaTeX", - "description": "Write using the math notation LaTeX", - "icon": "hax:pi", - "color": "grey", - "tags": [ - "Instructional", - "math", - "mathjax", - "mathml", - "latex", - "mathml" - ], - "handles": [], - "meta": { - "author": "HAXTheWeb core team" - } - }, - "settings": { - "configure": [], - "advanced": [], - "developer": [] - }, - "saveOptions": { - "unsetAttributes": ["hydrated"] - }, - "documentation": { - "howTo": null, - "purpose": null - }, - "demoSchema": [ - { - "tag": "la-tex", - "content": "
    \\begin{pspicture}(-13,-5)(13,10)\n\\slider{1}{8}{a}{amplitude}{4}\n\\slider{1}{8}{n}{frequency}{4}\n\\psplot[algebraic,linewidth=1.5pt,plotpoints=1000]{-12.56}{12.56}{a*sin(n*x)/(n*x)}\n\\psaxes[showorigin=false,labels=none, Dx=3.14](0,0)(-12.6,0)(12.6,0)\n\rput(0, -0.5){$0$}\n\\end{pspicture}
    ", - "properties": {} - } - ] -} \ No newline at end of file + "api": "1", + "type": "grid", + "canScale": false, + "designSystem": false, + "canEditSource": true, + "contentEditable": false, + "editingElement": "core", + "hideDefaultSettings": false, + "gizmo": { + "title": "LaTeX", + "description": "Write using the math notation LaTeX", + "icon": "hax:pi", + "color": "grey", + "tags": ["Instructional", "math", "mathjax", "mathml", "latex", "mathml"], + "handles": [], + "meta": { + "author": "HAXTheWeb core team" + } + }, + "settings": { + "configure": [], + "advanced": [], + "developer": [] + }, + "saveOptions": { + "unsetAttributes": ["hydrated"] + }, + "documentation": { + "howTo": null, + "purpose": null + }, + "demoSchema": [ + { + "tag": "la-tex", + "content": "
    \\begin{pspicture}(-13,-5)(13,10)\n\\slider{1}{8}{a}{amplitude}{4}\n\\slider{1}{8}{n}{frequency}{4}\n\\psplot[algebraic,linewidth=1.5pt,plotpoints=1000]{-12.56}{12.56}{a*sin(n*x)/(n*x)}\n\\psaxes[showorigin=false,labels=none, Dx=3.14](0,0)(-12.6,0)(12.6,0)\n\rput(0, -0.5){$0$}\n\\end{pspicture}
    ", + "properties": {} + } + ] +} diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/la-tex/lib/latex2html5.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/la-tex/lib/latex2html5.js index 950de862..f09369d7 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/la-tex/lib/latex2html5.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/la-tex/lib/latex2html5.js @@ -1,14 +1,14 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).LaTeX2HTML5=t()}}((function(){var define,module,exports;return function r(t,e,n){function o(a,s){if(!e[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=e[a]={exports:{}};t[a][0].call(f.exports,(function(e){return o(t[a][1][e]||e)}),f,f.exports,r,t,e,n)}return e[a].exports}for(var i="function"==typeof require&&require,a=0;at.length)&&(e=t.length);for(var n=0,i=new Array(e);n0?u-4:u;for(n=0;n>16&255,f[h++]=e>>8&255,f[h++]=255&e;2===c&&(e=a[t.charCodeAt(n)]<<2|a[t.charCodeAt(n+1)]>>4,f[h++]=255&e);1===c&&(e=a[t.charCodeAt(n)]<<10|a[t.charCodeAt(n+1)]<<4|a[t.charCodeAt(n+2)]>>2,f[h++]=e>>8&255,f[h++]=255&e);return f},n.fromByteArray=function fromByteArray(t){for(var e,n=t.length,a=n%3,s=[],u=16383,c=0,f=n-a;cf?f:c+u));1===a?(e=t[n-1],s.push(i[e>>2]+i[e<<4&63]+"==")):2===a&&(e=(t[n-2]<<8)+t[n-1],s.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return s.join("")};for(var i=[],a=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0;c<64;++c)i[c]=u[c],a[u.charCodeAt(c)]=c;function getLens(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function encodeChunk(t,e,n){for(var a,s,u=[],c=e;c>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return u.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],15:[function(t,e,n){},{}],16:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],17:[function(t,e,n){(function(e){var i=t("base64-js"),a=t("ieee754");n.Buffer=e,n.SlowBuffer=function SlowBuffer(t){+t!=t&&(t=0);return e.alloc(+t)},n.INSPECT_MAX_BYTES=50;var s=2147483647;function createBuffer(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=new Uint8Array(t);return n.__proto__=e.prototype,n}function e(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(t)}return from(t,e,n)}function from(t,n,i){if("string"==typeof t)return function fromString(t,n){"string"==typeof n&&""!==n||(n="utf8");if(!e.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i=0|byteLength(t,n),a=createBuffer(i),s=a.write(t,n);s!==i&&(a=a.slice(0,s));return a}(t,n);if(ArrayBuffer.isView(t))return fromArrayLike(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(isInstance(t,ArrayBuffer)||t&&isInstance(t.buffer,ArrayBuffer))return function fromArrayBuffer(t,n,i){if(n<0||t.byteLength=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function byteLength(t,n){if(e.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||isInstance(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var i=t.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===i)return 0;for(var s=!1;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return base64ToBytes(t).length;default:if(s)return a?-1:utf8ToBytes(t).length;n=(""+n).toLowerCase(),s=!0}}function slowToString(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return hexSlice(this,e,n);case"utf8":case"utf-8":return utf8Slice(this,e,n);case"ascii":return asciiSlice(this,e,n);case"latin1":case"binary":return latin1Slice(this,e,n);case"base64":return base64Slice(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function swap(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function bidirectionalIndexOf(t,n,i,a,s){if(0===t.length)return-1;if("string"==typeof i?(a=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),numberIsNaN(i=+i)&&(i=s?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(s)return-1;i=t.length-1}else if(i<0){if(!s)return-1;i=0}if("string"==typeof n&&(n=e.from(n,a)),e.isBuffer(n))return 0===n.length?-1:arrayIndexOf(t,n,i,a,s);if("number"==typeof n)return n&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,n,i):Uint8Array.prototype.lastIndexOf.call(t,n,i):arrayIndexOf(t,[n],i,a,s);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,e,n,i,a){var s,u=1,c=t.length,f=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;u=2,c/=2,f/=2,n/=2}function read(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(a){var h=-1;for(s=n;sc&&(n=c-f),s=n;s>=0;s--){for(var d=!0,p=0;pa&&(i=a):i=a;var s=e.length;i>s/2&&(i=s/2);for(var u=0;u>8,a=n%256,s.push(a),s.push(i);return s}(e,t.length-n),t,n,i)}function base64Slice(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function utf8Slice(t,e,n){n=Math.min(t.length,n);for(var i=[],a=e;a239?4:d>223?3:d>191?2:1;if(a+g<=n)switch(g){case 1:d<128&&(p=d);break;case 2:128==(192&(s=t[a+1]))&&(h=(31&d)<<6|63&s)>127&&(p=h);break;case 3:s=t[a+1],c=t[a+2],128==(192&s)&&128==(192&c)&&(h=(15&d)<<12|(63&s)<<6|63&c)>2047&&(h<55296||h>57343)&&(p=h);break;case 4:s=t[a+1],c=t[a+2],f=t[a+3],128==(192&s)&&128==(192&c)&&128==(192&f)&&(h=(15&d)<<18|(63&s)<<12|(63&c)<<6|63&f)>65535&&h<1114112&&(p=h)}null===p?(p=65533,g=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|1023&p),i.push(p),a+=g}return function decodeCodePointsArray(t){var e=t.length;if(e<=u)return String.fromCharCode.apply(String,t);var n="",i=0;for(;ie&&(t+=" ... "),""},e.prototype.compare=function compare(t,n,i,a,s){if(isInstance(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),!e.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===n&&(n=0),void 0===i&&(i=t?t.length:0),void 0===a&&(a=0),void 0===s&&(s=this.length),n<0||i>t.length||a<0||s>this.length)throw new RangeError("out of range index");if(a>=s&&n>=i)return 0;if(a>=s)return-1;if(n>=i)return 1;if(this===t)return 0;for(var u=(s>>>=0)-(a>>>=0),c=(i>>>=0)-(n>>>=0),f=Math.min(u,c),h=this.slice(a,s),d=t.slice(n,i),p=0;p>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var a=this.length-e;if((void 0===n||n>a)&&(n=a),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return hexWrite(this,t,e,n);case"utf8":case"utf-8":return utf8Write(this,t,e,n);case"ascii":return asciiWrite(this,t,e,n);case"latin1":case"binary":return latin1Write(this,t,e,n);case"base64":return base64Write(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},e.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var u=4096;function asciiSlice(t,e,n){var i="";n=Math.min(t.length,n);for(var a=e;ai)&&(n=i);for(var a="",s=e;sn)throw new RangeError("Trying to access beyond buffer length")}function checkInt(t,n,i,a,s,u){if(!e.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>s||nt.length)throw new RangeError("Index out of range")}function checkIEEE754(t,e,n,i,a,s){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function writeFloat(t,e,n,i,s){return e=+e,n>>>=0,s||checkIEEE754(t,0,n,4),a.write(t,e,n,i,23,4),n+4}function writeDouble(t,e,n,i,s){return e=+e,n>>>=0,s||checkIEEE754(t,0,n,8),a.write(t,e,n,i,52,8),n+8}e.prototype.slice=function slice(t,n){var i=this.length;(t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(n=void 0===n?i:~~n)<0?(n+=i)<0&&(n=0):n>i&&(n=i),n>>=0,e>>>=0,n||checkOffset(t,e,this.length);for(var i=this[t],a=1,s=0;++s>>=0,e>>>=0,n||checkOffset(t,e,this.length);for(var i=this[t+--e],a=1;e>0&&(a*=256);)i+=this[t+--e]*a;return i},e.prototype.readUInt8=function readUInt8(t,e){return t>>>=0,e||checkOffset(t,1,this.length),this[t]},e.prototype.readUInt16LE=function readUInt16LE(t,e){return t>>>=0,e||checkOffset(t,2,this.length),this[t]|this[t+1]<<8},e.prototype.readUInt16BE=function readUInt16BE(t,e){return t>>>=0,e||checkOffset(t,2,this.length),this[t]<<8|this[t+1]},e.prototype.readUInt32LE=function readUInt32LE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},e.prototype.readUInt32BE=function readUInt32BE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},e.prototype.readIntLE=function readIntLE(t,e,n){t>>>=0,e>>>=0,n||checkOffset(t,e,this.length);for(var i=this[t],a=1,s=0;++s=(a*=128)&&(i-=Math.pow(2,8*e)),i},e.prototype.readIntBE=function readIntBE(t,e,n){t>>>=0,e>>>=0,n||checkOffset(t,e,this.length);for(var i=e,a=1,s=this[t+--i];i>0&&(a*=256);)s+=this[t+--i]*a;return s>=(a*=128)&&(s-=Math.pow(2,8*e)),s},e.prototype.readInt8=function readInt8(t,e){return t>>>=0,e||checkOffset(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},e.prototype.readInt16LE=function readInt16LE(t,e){t>>>=0,e||checkOffset(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},e.prototype.readInt16BE=function readInt16BE(t,e){t>>>=0,e||checkOffset(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},e.prototype.readInt32LE=function readInt32LE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},e.prototype.readInt32BE=function readInt32BE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},e.prototype.readFloatLE=function readFloatLE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),a.read(this,t,!0,23,4)},e.prototype.readFloatBE=function readFloatBE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),a.read(this,t,!1,23,4)},e.prototype.readDoubleLE=function readDoubleLE(t,e){return t>>>=0,e||checkOffset(t,8,this.length),a.read(this,t,!0,52,8)},e.prototype.readDoubleBE=function readDoubleBE(t,e){return t>>>=0,e||checkOffset(t,8,this.length),a.read(this,t,!1,52,8)},e.prototype.writeUIntLE=function writeUIntLE(t,e,n,i){(t=+t,e>>>=0,n>>>=0,i)||checkInt(this,t,e,n,Math.pow(2,8*n)-1,0);var a=1,s=0;for(this[e]=255&t;++s>>=0,n>>>=0,i)||checkInt(this,t,e,n,Math.pow(2,8*n)-1,0);var a=n-1,s=1;for(this[e+a]=255&t;--a>=0&&(s*=256);)this[e+a]=t/s&255;return e+n},e.prototype.writeUInt8=function writeUInt8(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,1,255,0),this[e]=255&t,e+1},e.prototype.writeUInt16LE=function writeUInt16LE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeUInt16BE=function writeUInt16BE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeUInt32LE=function writeUInt32LE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},e.prototype.writeUInt32BE=function writeUInt32BE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeIntLE=function writeIntLE(t,e,n,i){if(t=+t,e>>>=0,!i){var a=Math.pow(2,8*n-1);checkInt(this,t,e,n,a-1,-a)}var s=0,u=1,c=0;for(this[e]=255&t;++s>>=0,!i){var a=Math.pow(2,8*n-1);checkInt(this,t,e,n,a-1,-a)}var s=n-1,u=1,c=0;for(this[e+s]=255&t;--s>=0&&(u*=256);)t<0&&0===c&&0!==this[e+s+1]&&(c=1),this[e+s]=(t/u|0)-c&255;return e+n},e.prototype.writeInt8=function writeInt8(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},e.prototype.writeInt16LE=function writeInt16LE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeInt16BE=function writeInt16BE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeInt32LE=function writeInt32LE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},e.prototype.writeInt32BE=function writeInt32BE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeFloatLE=function writeFloatLE(t,e,n){return writeFloat(this,t,e,!0,n)},e.prototype.writeFloatBE=function writeFloatBE(t,e,n){return writeFloat(this,t,e,!1,n)},e.prototype.writeDoubleLE=function writeDoubleLE(t,e,n){return writeDouble(this,t,e,!0,n)},e.prototype.writeDoubleBE=function writeDoubleBE(t,e,n){return writeDouble(this,t,e,!1,n)},e.prototype.copy=function copy(t,n,i,a){if(!e.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),a||0===a||(a=this.length),n>=t.length&&(n=t.length),n||(n=0),a>0&&a=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-n=0;--u)t[u+n]=this[u+i];else Uint8Array.prototype.set.call(t,this.subarray(i,a),n);return s},e.prototype.fill=function fill(t,n,i,a){if("string"==typeof t){if("string"==typeof n?(a=n,n=0,i=this.length):"string"==typeof i&&(a=i,i=this.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!e.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(1===t.length){var s=t.charCodeAt(0);("utf8"===a&&s<128||"latin1"===a)&&(t=s)}}else"number"==typeof t&&(t&=255);if(n<0||this.length>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(u=n;u55295&&n<57344){if(!a){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(u+1===i){(e-=3)>-1&&s.push(239,191,189);continue}a=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(e-=3)>-1&&s.push(239,191,189);if(a=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function base64ToBytes(t){return i.toByteArray(function base64clean(t){if((t=(t=t.split("=")[0]).trim().replace(c,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function blitBuffer(t,e,n,i){for(var a=0;a=e.length||a>=t.length);++a)e[a+n]=t[a];return a}function isInstance(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function numberIsNaN(t){return t!=t}}).call(this,t("buffer").Buffer)},{"base64-js":14,buffer:17,ieee754:97}],18:[function(t,e,n){(function(t){!function(i){var a="object"==typeof n&&n&&!n.nodeType&&n,s="object"==typeof e&&e&&!e.nodeType&&e,u="object"==typeof t&&t;u.global!==u&&u.window!==u&&u.self!==u||(i=u);var c,f,h=2147483647,d=36,p=/^xn--/,g=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=Math.floor,w=String.fromCharCode;function error(t){throw new RangeError(b[t])}function map(t,e){for(var n=t.length,i=[];n--;)i[n]=e(t[n]);return i}function mapDomain(t,e){var n=t.split("@"),i="";return n.length>1&&(i=n[0]+"@",t=n[1]),i+map((t=t.replace(v,".")).split("."),e).join(".")}function ucs2decode(t){for(var e,n,i=[],a=0,s=t.length;a=55296&&e<=56319&&a65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)})).join("")}function digitToBasic(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function adapt(t,e,n){var i=0;for(t=n?_(t/700):t>>1,t+=_(t/e);t>455;i+=d)t=_(t/35);return _(i+36*t/(t+38))}function decode(t){var e,n,i,a,s,u,c,f,p,g,v,b=[],w=t.length,M=0,E=128,T=72;for((n=t.lastIndexOf("-"))<0&&(n=0),i=0;i=128&&error("not-basic"),b.push(t.charCodeAt(i));for(a=n>0?n+1:0;a=w&&error("invalid-input"),((f=(v=t.charCodeAt(a++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:d)>=d||f>_((h-M)/u))&&error("overflow"),M+=f*u,!(f<(p=c<=T?1:c>=T+26?26:c-T));c+=d)u>_(h/(g=d-p))&&error("overflow"),u*=g;T=adapt(M-s,e=b.length+1,0==s),_(M/e)>h-E&&error("overflow"),E+=_(M/e),M%=e,b.splice(M++,0,E)}return ucs2encode(b)}function encode(t){var e,n,i,a,s,u,c,f,p,g,v,b,M,E,T,S=[];for(b=(t=ucs2decode(t)).length,e=128,n=0,s=72,u=0;u=e&&v_((h-n)/(M=i+1))&&error("overflow"),n+=(c-e)*M,e=c,u=0;uh&&error("overflow"),v==e){for(f=n,p=d;!(f<(g=p<=s?1:p>=s+26?26:p-s));p+=d)T=f-g,E=d-g,S.push(w(digitToBasic(g+T%E,0))),f=_(T/E);S.push(w(digitToBasic(f,0))),s=adapt(n,M,i==a),n=0,++i}++n,++e}return S.join("")}if(c={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode,encode,toASCII:function toASCII(t){return mapDomain(t,(function(t){return g.test(t)?"xn--"+encode(t):t}))},toUnicode:function toUnicode(t){return mapDomain(t,(function(t){return p.test(t)?decode(t.slice(4).toLowerCase()):t}))}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",(function(){return c}));else if(a&&s)if(e.exports==a)s.exports=c;else for(f in c)c.hasOwnProperty(f)&&(a[f]=c[f]);else i.punycode=c}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],19:[function(t,e,n){(function(e){var i=t("./lib/request"),a=t("./lib/response"),s=t("xtend"),u=t("builtin-status-codes"),c=t("url"),f=n;f.request=function(t,n){t="string"==typeof t?c.parse(t):s(t);var a=-1===e.location.protocol.search(/^https?:$/)?"http:":"",u=t.protocol||a,f=t.hostname||t.host,h=t.port,d=t.path||"/";f&&-1!==f.indexOf(":")&&(f="["+f+"]"),t.url=(f?u+"//"+f:"")+(h?":"+h:"")+d,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var p=new i(t);return n&&p.on("response",n),p},f.get=function get(t,e){var n=f.request(t,e);return n.end(),n},f.ClientRequest=i,f.IncomingMessage=a.IncomingMessage,f.Agent=function(){},f.Agent.defaultMaxSockets=4,f.globalAgent=new f.Agent,f.STATUS_CODES=u,f.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":21,"./lib/response":22,"builtin-status-codes":38,url:106,xtend:110}],20:[function(t,e,n){(function(t){var e;function getXHR(){if(void 0!==e)return e;if(t.XMLHttpRequest){e=new t.XMLHttpRequest;try{e.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(t){e=null}}else e=null;return e}function checkTypeSupport(t){var e=getXHR();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function isFunction(t){return"function"==typeof t}n.fetch=isFunction(t.fetch)&&isFunction(t.ReadableStream),n.writableStream=isFunction(t.WritableStream),n.abortController=isFunction(t.AbortController),n.arraybuffer=n.fetch||checkTypeSupport("arraybuffer"),n.msstream=!n.fetch&&checkTypeSupport("ms-stream"),n.mozchunkedarraybuffer=!n.fetch&&checkTypeSupport("moz-chunked-arraybuffer"),n.overrideMimeType=n.fetch||!!getXHR()&&isFunction(getXHR().overrideMimeType),e=null}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],21:[function(t,e,n){(function(n,i,a){var s=t("./capability"),u=t("inherits"),c=t("./response"),f=t("readable-stream"),h=c.IncomingMessage,d=c.readyStates;var p=e.exports=function(t){var e,n=this;f.Writable.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader("Authorization","Basic "+a.from(t.auth).toString("base64")),Object.keys(t.headers).forEach((function(e){n.setHeader(e,t.headers[e])}));var i=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!s.abortController)i=!1,e=!0;else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!s.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}n._mode=function decideMode(t,e){return s.fetch&&e?"fetch":s.mozchunkedarraybuffer?"moz-chunked-arraybuffer":s.msstream?"ms-stream":s.arraybuffer&&t?"arraybuffer":"text"}(e,i),n._fetchTimer=null,n.on("finish",(function(){n._onFinish()}))};u(p,f.Writable),p.prototype.setHeader=function(t,e){var n=t.toLowerCase();-1===g.indexOf(n)&&(this._headers[n]={name:t,value:e})},p.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},p.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},p.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts,a=t._headers,u=null;"GET"!==e.method&&"HEAD"!==e.method&&(u=new Blob(t._body,{type:(a["content-type"]||{}).value||""}));var c=[];if(Object.keys(a).forEach((function(t){var e=a[t].name,n=a[t].value;Array.isArray(n)?n.forEach((function(t){c.push([e,t])})):c.push([e,n])})),"fetch"===t._mode){var f=null;if(s.abortController){var h=new AbortController;f=h.signal,t._fetchAbortController=h,"requestTimeout"in e&&0!==e.requestTimeout&&(t._fetchTimer=i.setTimeout((function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()}),e.requestTimeout))}i.fetch(t._opts.url,{method:t._opts.method,headers:c,body:u||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:f}).then((function(e){t._fetchResponse=e,t._connect()}),(function(e){i.clearTimeout(t._fetchTimer),t._destroyed||t.emit("error",e)}))}else{var p=t._xhr=new i.XMLHttpRequest;try{p.open(t._opts.method,t._opts.url,!0)}catch(e){return void n.nextTick((function(){t.emit("error",e)}))}"responseType"in p&&(p.responseType=t._mode),"withCredentials"in p&&(p.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in p&&p.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(p.timeout=e.requestTimeout,p.ontimeout=function(){t.emit("requestTimeout")}),c.forEach((function(t){p.setRequestHeader(t[0],t[1])})),t._response=null,p.onreadystatechange=function(){switch(p.readyState){case d.LOADING:case d.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(p.onprogress=function(){t._onXHRProgress()}),p.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{p.send(u)}catch(e){return void n.nextTick((function(){t.emit("error",e)}))}}}},p.prototype._onXHRProgress=function(){var t=this;(function statusValid(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}})(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress())},p.prototype._connect=function(){var t=this;t._destroyed||(t._response=new h(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on("error",(function(e){t.emit("error",e)})),t.emit("response",t._response))},p.prototype._write=function(t,e,n){this._body.push(t),n()},p.prototype.abort=p.prototype.destroy=function(){var t=this;t._destroyed=!0,i.clearTimeout(t._fetchTimer),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort()},p.prototype.end=function(t,e,n){"function"==typeof t&&(n=t,t=void 0),f.Writable.prototype.end.call(this,t,e,n)},p.prototype.flushHeaders=function(){},p.prototype.setTimeout=function(){},p.prototype.setNoDelay=function(){},p.prototype.setSocketKeepAlive=function(){};var g=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"./capability":20,"./response":22,_process:100,buffer:17,inherits:98,"readable-stream":37}],22:[function(t,e,n){(function(e,i,a){var s=t("./capability"),u=t("inherits"),c=t("readable-stream"),f=n.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=n.IncomingMessage=function(t,n,u,f){var h=this;if(c.Readable.call(h),h._mode=u,h.headers={},h.rawHeaders=[],h.trailers={},h.rawTrailers=[],h.on("end",(function(){e.nextTick((function(){h.emit("close")}))})),"fetch"===u){if(h._fetchResponse=n,h.url=n.url,h.statusCode=n.status,h.statusMessage=n.statusText,n.headers.forEach((function(t,e){h.headers[e.toLowerCase()]=t,h.rawHeaders.push(e,t)})),s.writableStream){var d=new WritableStream({write:function(t){return new Promise((function(e,n){h._destroyed?n():h.push(a.from(t))?e():h._resumeFetch=e}))},close:function(){i.clearTimeout(f),h._destroyed||h.push(null)},abort:function(t){h._destroyed||h.emit("error",t)}});try{return void n.body.pipeTo(d).catch((function(t){i.clearTimeout(f),h._destroyed||h.emit("error",t)}))}catch(b){}}var p=n.body.getReader();function read(){p.read().then((function(t){if(!h._destroyed){if(t.done)return i.clearTimeout(f),void h.push(null);h.push(a.from(t.value)),read()}})).catch((function(t){i.clearTimeout(f),h._destroyed||h.emit("error",t)}))}read()}else{if(h._xhr=t,h._pos=0,h.url=t.responseURL,h.statusCode=t.status,h.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var n=e[1].toLowerCase();"set-cookie"===n?(void 0===h.headers[n]&&(h.headers[n]=[]),h.headers[n].push(e[2])):void 0!==h.headers[n]?h.headers[n]+=", "+e[2]:h.headers[n]=e[2],h.rawHeaders.push(e[1],e[2])}})),h._charset="x-user-defined",!s.overrideMimeType){var g=h.rawHeaders["mime-type"];if(g){var v=g.match(/;\s*charset=([^;])(;|$)/);v&&(h._charset=v[1].toLowerCase())}h._charset||(h._charset="utf-8")}}};u(h,c.Readable),h.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},h.prototype._onXHRProgress=function(){var t=this,e=t._xhr,n=null;switch(t._mode){case"text":if((n=e.responseText).length>t._pos){var s=n.substr(t._pos);if("x-user-defined"===t._charset){for(var u=a.alloc(s.length),c=0;ct._pos&&(t.push(a.from(new Uint8Array(h.result.slice(t._pos)))),t._pos=h.result.byteLength)},h.onload=function(){t.push(null)},h.readAsArrayBuffer(n)}t._xhr.readyState===f.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"./capability":20,_process:100,buffer:17,inherits:98,"readable-stream":37}],23:[function(t,e,n){var i={};function createErrorType(t,e,n){n||(n=Error);var a=function(t){function NodeError(n,i,a){return t.call(this,function getMessage(t,n,i){return"string"==typeof e?e:e(t,n,i)}(n,i,a))||this}return function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(NodeError,t),NodeError}(n);a.prototype.name=n.name,a.prototype.code=t,i[t]=a}function oneOf(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}createErrorType("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,a;if("string"==typeof e&&function startsWith(t,e,n){return t.substr(!n||n<0?0:+n,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function endsWith(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))a="The ".concat(t," ").concat(i," ").concat(oneOf(e,"type"));else{var s=function includes(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(oneOf(e,"type"))}return a+=". Received type ".concat(typeof n)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},{}],24:[function(t,e,n){(function(n){var i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};e.exports=Duplex;var a=t("./_stream_readable"),s=t("./_stream_writable");t("inherits")(Duplex,a);for(var u=i(s.prototype),c=0;c0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function _uint8ArrayToBuffer(t){return c.from(t)}(e)),i)u.endEmitted?C(t,new k):addChunk(t,u,e,!0);else if(u.ended)C(t,new T);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!n?(e=u.decoder.write(e),u.objectMode||0!==e.length?addChunk(t,u,e,!1):maybeReadMore(t,u)):addChunk(t,u,e,!1)}else i||(u.reading=!1,maybeReadMore(t,u));return!u.ended&&(u.lengthe.highWaterMark&&(e.highWaterMark=function computeNewHighWaterMark(t){return t>=N?t=N:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function emitReadable(t){var e=t._readableState;h("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(emitReadable_,t))}function emitReadable_(t){var e=t._readableState;h("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,flow(t)}function maybeReadMore(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(maybeReadMore_,t,e))}function maybeReadMore_(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function nReadingNextTick(t){h("readable nexttick read 0"),t.read(0)}function resume_(t,e){h("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),flow(t),e.flowing&&!e.reading&&t.read(0)}function flow(t){var e=t._readableState;for(h("flow",e.flowing);e.flowing&&null!==t.read(););}function fromList(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function endReadable(t){var e=t._readableState;h("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(endReadableNT,e,t))}function endReadableNT(t,e){if(h("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function indexOf(t,e){for(var n=0,i=t.length;n=e.highWaterMark:e.length>0)||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?endReadable(this):emitReadable(this),null;if(0===(t=howMuchToRead(t,e))&&e.ended)return 0===e.length&&endReadable(this),null;var i,a=e.needReadable;return h("need readable",a),(0===e.length||e.length-t0?fromList(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&endReadable(this)),null!==i&&this.emit("data",i),i},Readable.prototype._read=function(t){C(this,new S("_read()"))},Readable.prototype.pipe=function(t,e){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?onend:unpipe;function onunpipe(e,n){h("onunpipe"),e===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,function cleanup(){h("cleanup"),t.removeListener("close",onclose),t.removeListener("finish",onfinish),t.removeListener("drain",c),t.removeListener("error",onerror),t.removeListener("unpipe",onunpipe),i.removeListener("end",onend),i.removeListener("end",unpipe),i.removeListener("data",ondata),f=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||c()}())}function onend(){h("onend"),t.end()}a.endEmitted?n.nextTick(u):i.once("end",u),t.on("unpipe",onunpipe);var c=function pipeOnDrain(t){return function pipeOnDrainFunctionResult(){var e=t._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,flow(t))}}(i);t.on("drain",c);var f=!1;function ondata(e){h("ondata");var n=t.write(e);h("dest.write",n),!1===n&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==indexOf(a.pipes,t))&&!f&&(h("false write response, pause",a.awaitDrain),a.awaitDrain++),i.pause())}function onerror(e){h("onerror",e),unpipe(),t.removeListener("error",onerror),0===s(t,"error")&&C(t,e)}function onclose(){t.removeListener("finish",onfinish),unpipe()}function onfinish(){h("onfinish"),t.removeListener("close",onclose),unpipe()}function unpipe(){h("unpipe"),i.unpipe(t)}return i.on("data",ondata),function prependListener(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",onerror),t.once("close",onclose),t.once("finish",onfinish),t.emit("pipe",i),a.flowing||(h("pipe resume"),i.resume()),t},Readable.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var i=e.pipes,a=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s0,!1!==a.flowing&&this.resume()):"readable"===t&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,h("on readable",a.length,a.reading),a.length?emitReadable(this):a.reading||n.nextTick(nReadingNextTick,this))),i},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.removeListener=function(t,e){var i=u.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(updateReadableListening,this),i},Readable.prototype.removeAllListeners=function(t){var e=u.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(updateReadableListening,this),e},Readable.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!t.readableListening,function resume(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(resume_,t,e))}(this,t)),t.paused=!1,this},Readable.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},Readable.prototype.wrap=function(t){var e=this,n=this._readableState,i=!1;for(var a in t.on("end",(function(){if(h("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(a){(h("wrapped data"),n.decoder&&(a=n.decoder.write(a)),n.objectMode&&null==a)||(n.objectMode||a&&a.length)&&(e.push(a)||(i=!0,t.pause()))})),t)void 0===this[a]&&"function"==typeof t[a]&&(this[a]=function methodWrap(e){return function methodWrapReturnFunction(){return t[e].apply(t,arguments)}}(a));for(var s=0;s-1))throw new S(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:!1,get:function get(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function get(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(t,e,n){n(new b("_write()"))},Writable.prototype._writev=null,Writable.prototype.end=function(t,e,i){var a=this._writableState;return"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),a.corked&&(a.corked=1,this.uncork()),a.ending||function endWritable(t,e,i){e.ending=!0,finishMaybe(t,e),i&&(e.finished?n.nextTick(i):t.once("finish",i));e.ended=!0,t.writable=!1}(this,a,i),this},Object.defineProperty(Writable.prototype,"writableLength",{enumerable:!1,get:function get(){return this._writableState.length}}),Object.defineProperty(Writable.prototype,"destroyed",{enumerable:!1,get:function get(){return void 0!==this._writableState&&this._writableState.destroyed},set:function set(t){this._writableState&&(this._writableState.destroyed=t)}}),Writable.prototype.destroy=d.destroy,Writable.prototype._undestroy=d.undestroy,Writable.prototype._destroy=function(t,e){e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":23,"./_stream_duplex":24,"./internal/streams/destroy":31,"./internal/streams/state":35,"./internal/streams/stream":36,_process:100,buffer:17,inherits:98,"util-deprecate":108}],29:[function(t,e,n){(function(n){var i;function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=t("./end-of-stream"),s=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),h=Symbol("lastPromise"),d=Symbol("handlePromise"),p=Symbol("stream");function createIterResult(t,e){return{value:t,done:e}}function readAndResolve(t){var e=t[s];if(null!==e){var n=t[p].read();null!==n&&(t[h]=null,t[s]=null,t[u]=null,e(createIterResult(n,!1)))}}function onReadable(t){n.nextTick(readAndResolve,t)}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((_defineProperty(i={get stream(){return this[p]},next:function next(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(createIterResult(void 0,!0));if(this[p].destroyed)return new Promise((function(e,i){n.nextTick((function(){t[c]?i(t[c]):e(createIterResult(void 0,!0))}))}));var i,a=this[h];if(a)i=new Promise(function wrapForNext(t,e){return function(n,i){t.then((function(){e[f]?n(createIterResult(void 0,!0)):e[d](n,i)}),i)}}(a,this));else{var s=this[p].read();if(null!==s)return Promise.resolve(createIterResult(s,!1));i=new Promise(this[d])}return this[h]=i,i}},Symbol.asyncIterator,(function(){return this})),_defineProperty(i,"return",(function _return(){var t=this;return new Promise((function(e,n){t[p].destroy(null,(function(t){t?n(t):e(createIterResult(void 0,!0))}))}))})),i),g);e.exports=function createReadableStreamAsyncIterator(t){var e,n=Object.create(v,(_defineProperty(e={},p,{value:t,writable:!0}),_defineProperty(e,s,{value:null,writable:!0}),_defineProperty(e,u,{value:null,writable:!0}),_defineProperty(e,c,{value:null,writable:!0}),_defineProperty(e,f,{value:t._readableState.endEmitted,writable:!0}),_defineProperty(e,d,{value:function value(t,e){var i=n[p].read();i?(n[h]=null,n[s]=null,n[u]=null,t(createIterResult(i,!1))):(n[s]=t,n[u]=e)},writable:!0}),e));return n[h]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[u];return null!==e&&(n[h]=null,n[s]=null,n[u]=null,e(t)),void(n[c]=t)}var i=n[s];null!==i&&(n[h]=null,n[s]=null,n[u]=null,i(createIterResult(void 0,!0))),n[f]=!0})),t.on("readable",onReadable.bind(null,n)),n}}).call(this,t("_process"))},{"./end-of-stream":32,_process:100}],30:[function(t,e,n){function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _defineProperties(t,e){for(var n=0;n0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function unshift(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function shift(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function clear(){this.head=this.tail=null,this.length=0}},{key:"join",value:function join(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function concat(t){if(0===this.length)return i.alloc(0);for(var e,n,a,s=i.allocUnsafe(t>>>0),u=this.head,c=0;u;)e=u.data,n=s,a=c,i.prototype.copy.call(e,n,a),c+=u.data.length,u=u.next;return s}},{key:"consume",value:function consume(t,e){var n;return ta.length?a.length:t;if(s===a.length?i+=a:i+=a.slice(0,t),0===(t-=s)){s===a.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=a.slice(s));break}++n}return this.length-=n,i}},{key:"_getBuffer",value:function _getBuffer(t){var e=i.allocUnsafe(t),n=this.head,a=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var s=n.data,u=t>s.length?s.length:t;if(s.copy(e,e.length-t,0,u),0===(t-=u)){u===s.length?(++a,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(u));break}++a}return this.length-=a,e}},{key:s,value:function value(t,e){return a(this,function _objectSpread(t){for(var e=1;e0,(function(t){c||(c=t),t&&h.forEach(call),s||(h.forEach(call),f(c))}))}));return n.reduce(pipe)}},{"../../../errors":23,"./end-of-stream":32}],35:[function(t,e,n){var i=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function getHighWaterMark(t,e,n,a){var s=function highWaterMarkFrom(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,a,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(a?n:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},{"../../../errors":23}],36:[function(t,e,n){e.exports=t("events").EventEmitter},{events:95}],37:[function(t,e,n){(n=e.exports=t("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=t("./lib/_stream_writable.js"),n.Duplex=t("./lib/_stream_duplex.js"),n.Transform=t("./lib/_stream_transform.js"),n.PassThrough=t("./lib/_stream_passthrough.js"),n.finished=t("./lib/internal/streams/end-of-stream.js"),n.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":24,"./lib/_stream_passthrough.js":25,"./lib/_stream_readable.js":26,"./lib/_stream_transform.js":27,"./lib/_stream_writable.js":28,"./lib/internal/streams/end-of-stream.js":32,"./lib/internal/streams/pipeline.js":34}],38:[function(t,e,n){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],39:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){function ascending(t,e){return te?1:t>=e?0:NaN}function bisector(t){return 1===t.length&&(t=function ascendingComparator(t){return function(e,n){return ascending(t(e),n)}}(t)),{left:function(e,n,i,a){for(null==i&&(i=0),null==a&&(a=e.length);i>>1;t(e[s],n)<0?i=s+1:a=s}return i},right:function(e,n,i,a){for(null==i&&(i=0),null==a&&(a=e.length);i>>1;t(e[s],n)>0?a=s:i=s+1}return i}}}var e=bisector(ascending),n=e.right,i=e.left;function pair(t,e){return[t,e]}function number(t){return null===t?NaN:+t}function variance(t,e){var n,i,a=t.length,s=0,u=-1,c=0,f=0;if(null==e)for(;++u1)return f/(s-1)}function deviation(t,e){var n=variance(t,e);return n?Math.sqrt(n):n}function extent(t,e){var n,i,a,s=t.length,u=-1;if(null==e){for(;++u=n)for(i=a=n;++un&&(i=n),a=n)for(i=a=n;++un&&(i=n),a=0?(s>=c?10:s>=f?5:s>=h?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(s>=c?10:s>=f?5:s>=h?2:1)}function tickStep(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),a=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/a;return s>=c?a*=10:s>=f?a*=5:s>=h&&(a*=2),e=1)return+n(t[i-1],i-1,t);var i,a=(i-1)*e,s=Math.floor(a),u=+n(t[s],s,t);return u+(+n(t[s+1],s+1,t)-u)*(a-s)}}function min(t,e){var n,i,a=t.length,s=-1;if(null==e){for(;++s=n)for(i=n;++sn&&(i=n)}else for(;++s=n)for(i=n;++sn&&(i=n);return i}function transpose(t){if(!(a=t.length))return[];for(var e=-1,n=min(t,length),i=new Array(n);++et?1:e>=t?0:NaN},t.deviation=deviation,t.extent=extent,t.histogram=function histogram(){var t=identity,e=extent,i=sturges;function histogram(a){var s,u,c=a.length,f=new Array(c);for(s=0;sp;)g.pop(),--v;var b,_=new Array(v+1);for(s=0;s<=v;++s)(b=_[s]=[]).x0=s>0?g[s-1]:d,b.x1=s=n)for(i=n;++si&&(i=n)}else for(;++s=n)for(i=n;++si&&(i=n);return i},t.mean=function mean(t,e){var n,i=t.length,a=i,s=-1,u=0;if(null==e)for(;++s=0;)for(e=(i=t[a]).length;--e>=0;)n[--u]=i[e];return n},t.min=min,t.pairs=function pairs(t,e){null==e&&(e=pair);for(var n=0,i=t.length-1,a=t[0],s=new Array(i<0?0:i);n0)return[t];if((i=e0)for(t=Math.ceil(t/u),e=Math.floor(e/u),s=new Array(a=Math.ceil(e-t+1));++c0&&(e=i-A),B<0?R=N-O:B>0&&(E=S-O),D=c,nt.attr("cursor",v.selection),move());break;default:return}noevent()}),!0).on("keyup.brush",(function keyupped(){switch(a.event.keyCode){case 16:Q&&(L=P=Q=!1,move());break;case 18:D===h&&(q<0?k=C:q>0&&(e=i),B<0?R=N:B>0&&(E=S),D=f,move());break;case 32:D===c&&(a.event.altKey?(q&&(k=C-A*q,e=i+A*q),B&&(R=N-O*B,E=S+O*B),D=h):(q<0?k=C:q>0&&(e=i),B<0?R=N:B>0&&(E=S),D=f),nt.attr("cursor",v[I]),move());break;default:return}noevent()}),!0).on("mousemove.brush",moved,!0).on("mouseup.brush",ended,!0);n.dragDisable(a.event.view)}nopropagation(),s.interrupt(U),redraw.call(U),tt.start()}function moved(){var t=a.mouse(U);!Q||L||P||(Math.abs(t[0]-K[0])>Math.abs(t[1]-K[1])?P=!0:L=!0),K=t,j=!0,noevent(),move()}function move(){var t;switch(A=K[0]-J[0],O=K[1]-J[1],D){case c:case u:q&&(A=Math.max($-e,Math.min(Z-k,A)),i=e+A,C=k+A),B&&(O=Math.max(V-E,Math.min(G-R,O)),S=E+O,N=R+O);break;case f:q<0?(A=Math.max($-e,Math.min(Z-e,A)),i=e+A,C=k):q>0&&(A=Math.max($-k,Math.min(Z-k,A)),i=e,C=k+A),B<0?(O=Math.max(V-E,Math.min(G-E,O)),S=E+O,N=R):B>0&&(O=Math.max(V-R,Math.min(G-R,O)),S=E,N=R+O);break;case h:q&&(i=Math.max($,Math.min(Z,e-A*q)),C=Math.max($,Math.min(Z,k+A*q))),B&&(S=Math.max(V,Math.min(G,E-O*B)),N=Math.max(V,Math.min(G,R+O*B)))}C=i.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var c,f,h,d=-1,p=n.length,g=i[a++],v=map(),b=s();++di.length)return t;var s,u=a[n-1];return null!=e&&n>=i.length?s=t.entries():(s=[],t.each((function(t,e){s.push({key:e,values:entries(t,n)})}))),null!=u?s.sort((function(t,e){return u(t.key,e.key)})):s}return n={object:function(t){return apply(t,0,createObject,setObject)},map:function(t){return apply(t,0,createMap,setMap)},entries:function(t){return entries(apply(t,0,createMap,setMap),0)},key:function(t){return i.push(t),n},sortKeys:function(t){return a[i.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}},t.set=set,t.map=map,t.keys=function keys(t){var e=[];for(var n in t)e.push(n);return e},t.values=function values(t){var e=[];for(var n in t)e.push(t[n]);return e},t.entries=function entries(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],44:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){function define(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function extend(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Color(){}var e=.7,n=1/e,i="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",s="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",u=/^#([0-9a-f]{3,8})$/,c=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),f=new RegExp("^rgb\\("+[s,s,s]+"\\)$"),h=new RegExp("^rgba\\("+[i,i,i,a]+"\\)$"),d=new RegExp("^rgba\\("+[s,s,s,a]+"\\)$"),p=new RegExp("^hsl\\("+[a,s,s]+"\\)$"),g=new RegExp("^hsla\\("+[a,s,s,a]+"\\)$"),v={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color_formatHex(){return this.rgb().formatHex()}function color_formatRgb(){return this.rgb().formatRgb()}function color(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=u.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?rgbn(e):3===n?new Rgb(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?rgba(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?rgba(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=c.exec(t))?new Rgb(e[1],e[2],e[3],1):(e=f.exec(t))?new Rgb(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=h.exec(t))?rgba(e[1],e[2],e[3],e[4]):(e=d.exec(t))?rgba(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=p.exec(t))?hsla(e[1],e[2]/100,e[3]/100,1):(e=g.exec(t))?hsla(e[1],e[2]/100,e[3]/100,e[4]):v.hasOwnProperty(t)?rgbn(v[t]):"transparent"===t?new Rgb(NaN,NaN,NaN,0):null}function rgbn(t){return new Rgb(t>>16&255,t>>8&255,255&t,1)}function rgba(t,e,n,i){return i<=0&&(t=e=n=NaN),new Rgb(t,e,n,i)}function rgbConvert(t){return t instanceof Color||(t=color(t)),t?new Rgb((t=t.rgb()).r,t.g,t.b,t.opacity):new Rgb}function rgb(t,e,n,i){return 1===arguments.length?rgbConvert(t):new Rgb(t,e,n,null==i?1:i)}function Rgb(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function rgb_formatHex(){return"#"+hex(this.r)+hex(this.g)+hex(this.b)}function rgb_formatRgb(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function hex(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function hsla(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Hsl(t,e,n,i)}function hslConvert(t){if(t instanceof Hsl)return new Hsl(t.h,t.s,t.l,t.opacity);if(t instanceof Color||(t=color(t)),!t)return new Hsl;if(t instanceof Hsl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,a=Math.min(e,n,i),s=Math.max(e,n,i),u=NaN,c=s-a,f=(s+a)/2;return c?(u=e===s?(n-i)/c+6*(n0&&f<1?0:u,new Hsl(u,c,f,t.opacity)}function hsl(t,e,n,i){return 1===arguments.length?hslConvert(t):new Hsl(t,e,n,null==i?1:i)}function Hsl(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function hsl2rgb(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}define(Color,color,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:color_formatHex,formatHex:color_formatHex,formatHsl:function color_formatHsl(){return hslConvert(this).formatHsl()},formatRgb:color_formatRgb,toString:color_formatRgb}),define(Rgb,rgb,extend(Color,{brighter:function(t){return t=null==t?n:Math.pow(n,t),new Rgb(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?e:Math.pow(e,t),new Rgb(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatRgb:rgb_formatRgb,toString:rgb_formatRgb})),define(Hsl,hsl,extend(Color,{brighter:function(t){return t=null==t?n:Math.pow(n,t),new Hsl(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?e:Math.pow(e,t),new Hsl(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,a=2*n-i;return new Rgb(hsl2rgb(t>=240?t-240:t+120,a,i),hsl2rgb(t,a,i),hsl2rgb(t<120?t+240:t-120,a,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var b=Math.PI/180,_=180/Math.PI,w=.96422,M=.82521,E=4/29,T=6/29,S=3*T*T,k=T*T*T;function labConvert(t){if(t instanceof Lab)return new Lab(t.l,t.a,t.b,t.opacity);if(t instanceof Hcl)return hcl2lab(t);t instanceof Rgb||(t=rgbConvert(t));var e,n,i=rgb2lrgb(t.r),a=rgb2lrgb(t.g),s=rgb2lrgb(t.b),u=xyz2lab((.2225045*i+.7168786*a+.0606169*s)/1);return i===a&&a===s?e=n=u:(e=xyz2lab((.4360747*i+.3850649*a+.1430804*s)/w),n=xyz2lab((.0139322*i+.0971045*a+.7141733*s)/M)),new Lab(116*u-16,500*(e-u),200*(u-n),t.opacity)}function lab(t,e,n,i){return 1===arguments.length?labConvert(t):new Lab(t,e,n,null==i?1:i)}function Lab(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function xyz2lab(t){return t>k?Math.pow(t,1/3):t/S+E}function lab2xyz(t){return t>T?t*t*t:S*(t-E)}function lrgb2rgb(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function rgb2lrgb(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function hclConvert(t){if(t instanceof Hcl)return new Hcl(t.h,t.c,t.l,t.opacity);if(t instanceof Lab||(t=labConvert(t)),0===t.a&&0===t.b)return new Hcl(NaN,0=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",i),s=-1,u=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s0)for(var n,i,a=new Array(n),s=0;sv}d.mouse("drag")}function mouseupped(){n.select(n.event.view).on("mousemove.drag mouseup.drag",null),yesdrag(n.event.view,a),noevent(),d.mouse("end")}function touchstarted(){if(u.apply(this,arguments)){var t,e,i=n.event.changedTouches,a=c.apply(this,arguments),s=i.length;for(t=0;t=c?d=!0:10===(s=t.charCodeAt(f++))?p=!0:13===s&&(p=!0,10===t.charCodeAt(f)&&++f),t.slice(u+1,i-1).replace(/""/g,'"')}for(;ff+v||ih+v||sc.index){var b=f-u.x-u.vx,_=h-u.y-u.vy,w=b*b+_*_;wt.r&&(t.r=t[e].r)}function initialize(){if(n){var e,a,s=n.length;for(i=new Array(s),e=0;e=c)){(t.data!==n||t.next)&&(0===d&&(v+=(d=jiggle())*d),0===p&&(v+=(p=jiggle())*p),v1?(null==n?p.remove(t):p.set(t,initializeForce(n)),e):p.get(t)},find:function(e,n,i){var a,s,u,c,f,h=0,d=t.length;for(null==i?i=1/0:i*=i,h=0;h1?(v.on(t,n),e):v.on(t)}}},t.forceX=function(t){var e,n,i,a=constant(.1);function force(t){for(var a,s=0,u=e.length;s=(s=(_+M)/2))?_=s:M=s,(d=n>=(u=(w+E)/2))?w=u:E=u,a=v,!(v=v[p=d<<1|h]))return a[p]=b,t;if(c=+t._x.call(null,v.data),f=+t._y.call(null,v.data),e===c&&n===f)return b.next=v,a?a[p]=b:t._root=b,t;do{a=a?a[p]=new Array(4):t._root=new Array(4),(h=e>=(s=(_+M)/2))?_=s:M=s,(d=n>=(u=(w+E)/2))?w=u:E=u}while((p=d<<1|h)==(g=(f>=u)<<1|c>=s));return a[g]=v,a[p]=b,t}function Quad(t,e,n,i,a){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=a}function defaultX(t){return t[0]}function defaultY(t){return t[1]}function quadtree(t,e,n){var i=new Quadtree(null==e?defaultX:e,null==n?defaultY:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Quadtree(t,e,n,i,a,s){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=a,this._y1=s,this._root=void 0}function leaf_copy(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var e=quadtree.prototype=Quadtree.prototype;e.copy=function(){var t,e,n=new Quadtree(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=leaf_copy(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var a=0;a<4;++a)(e=i.source[a])&&(e.length?t.push({source:e,target:i.target[a]=new Array(4)}):i.target[a]=leaf_copy(e));return n},e.add=function tree_add(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return add(this.cover(e,n),e,n,t)},e.addAll=function addAll(t){var e,n,i,a,s=t.length,u=new Array(s),c=new Array(s),f=1/0,h=1/0,d=-1/0,p=-1/0;for(n=0;nd&&(d=i),ap&&(p=a));if(f>d||h>p)return this;for(this.cover(f,h).cover(d,p),n=0;nt||t>=a||i>e||e>=s;)switch(c=(eg||(s=f.y0)>v||(u=f.x1)=M)<<1|t>=w)&&(f=b[b.length-1],b[b.length-1]=b[b.length-1-h],b[b.length-1-h]=f)}else{var E=t-+this._x.call(null,_.data),T=e-+this._y.call(null,_.data),S=E*E+T*T;if(S=(c=(b+w)/2))?b=c:w=c,(d=u>=(f=(_+M)/2))?_=f:M=f,e=v,!(v=v[p=d<<1|h]))return this;if(!v.length)break;(e[p+1&3]||e[p+2&3]||e[p+3&3])&&(n=e,g=p)}for(;v.data!==t;)if(i=v,!(v=v.next))return this;return(a=v.next)&&delete v.next,i?(a?i.next=a:delete i.next,this):e?(a?e[p]=a:delete e[p],(v=e[0]||e[1]||e[2]||e[3])&&v===(e[3]||e[2]||e[1]||e[0])&&!v.length&&(n?n[g]=v:this._root=v),this):(this._root=a,this)},e.removeAll=function removeAll(t){for(var e=0,n=t.length;e1?i[0]+i.slice(2):i,+t.slice(n+1)]},exponent=function(t){return(t=formatDecimal(Math.abs(t)))?t[1]:NaN},formatRounded=function(t,e){var n=formatDecimal(t,e);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")},n={"":function(t,e){t:for(var n,i=(t=t.toPrecision(e)).length,a=1,s=-1;a0&&(s=0)}return s>0?t.slice(0,s)+t.slice(n+1):t},"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return formatRounded(100*t,e)},r:formatRounded,s:function(t,n){var i=formatDecimal(t,n);if(!i)return t+"";var a=i[0],s=i[1],u=s-(e=3*Math.max(-8,Math.min(8,Math.floor(s/3))))+1,c=a.length;return u===c?a:u>c?a+new Array(u-c+1).join("0"):u>0?a.slice(0,u)+"."+a.slice(u):"0."+new Array(1-u).join("0")+formatDecimal(t,Math.max(0,n+u-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},i=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function formatSpecifier(t){return new FormatSpecifier(t)}function FormatSpecifier(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e,a=e[1]||" ",s=e[2]||">",u=e[3]||"-",c=e[4]||"",f=!!e[5],h=e[6]&&+e[6],d=!!e[7],p=e[8]&&+e[8].slice(1),g=e[9]||"";"n"===g?(d=!0,g="g"):n[g]||(g=""),(f||"0"===a&&"="===s)&&(f=!0,a="0",s="="),this.fill=a,this.align=s,this.sign=u,this.symbol=c,this.zero=f,this.width=h,this.comma=d,this.precision=p,this.type=g}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var a,identity=function(t){return t},s=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],formatLocale=function(t){var i,a,u=t.grouping&&t.thousands?(i=t.grouping,a=t.thousands,function(t,e){for(var n=t.length,s=[],u=0,c=i[0],f=0;n>0&&c>0&&(f+c+1>e&&(c=Math.max(1,e-f)),s.push(t.substring(n-=c,n+c)),!((f+=c+1)>e));)c=i[u=(u+1)%i.length];return s.reverse().join(a)}):identity,c=t.currency,f=t.decimal,h=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(t.numerals):identity,d=t.percent||"%";function newFormat(t){var i=(t=formatSpecifier(t)).fill,a=t.align,p=t.sign,g=t.symbol,v=t.zero,b=t.width,_=t.comma,w=t.precision,M=t.type,E="$"===g?c[0]:"#"===g&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",T="$"===g?c[1]:/[%p]/.test(M)?d:"",S=n[M],k=!M||/[defgprs%]/.test(M);function format(t){var n,c,d,g=E,C=T;if("c"===M)C=S(t)+C,t="";else{var R=(t=+t)<0;if(t=S(Math.abs(t),w),R&&0==+t&&(R=!1),g=(R?"("===p?p:"-":"-"===p||"("===p?"":p)+g,C=("s"===M?s[8+e/3]:"")+C+(R&&"("===p?")":""),k)for(n=-1,c=t.length;++n(d=t.charCodeAt(n))||d>57){C=(46===d?f+t.slice(n+1):t.slice(n))+C,t=t.slice(0,n);break}}_&&!v&&(t=u(t,1/0));var N=g.length+t.length+C.length,A=N>1)+g+t+C+A.slice(N);break;default:t=A+g+t+C}return h(t)}return w=null==w?M?6:12:/[gprs]/.test(M)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w)),format.toString=function(){return t+""},format}return{format:newFormat,formatPrefix:function formatPrefix(t,e){var n=newFormat(((t=formatSpecifier(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(exponent(e)/3))),a=Math.pow(10,-i),u=s[8+i/3];return function(t){return n(a*t)+u}}}};function defaultLocale(e){return a=formatLocale(e),t.format=a.format,t.formatPrefix=a.formatPrefix,a}defaultLocale({decimal:".",thousands:",",grouping:[3],currency:["$",""]});t.formatDefaultLocale=defaultLocale,t.formatLocale=formatLocale,t.formatSpecifier=formatSpecifier,t.precisionFixed=function(t){return Math.max(0,-exponent(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(exponent(e)/3)))-exponent(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,exponent(e)-exponent(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],52:[function(t,e,n){!function(i,a){"object"==typeof n&&void 0!==e?a(n,t("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],a):a(i.d3=i.d3||{},i.d3)}(this,(function(t,e){var adder=function(){return new Adder};function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(t){add(n,t,this.t),add(this,n.s,this.s),this.s?this.t+=n.t:this.s=n.t},valueOf:function(){return this.s}};var n=new Adder;function add(t,e,n){var i=t.s=e+n,a=i-e,s=i-a;t.t=e-s+(n-a)}var i=1e-6,a=Math.PI,s=a/2,u=a/4,c=2*a,f=180/a,h=a/180,d=Math.abs,p=Math.atan,g=Math.atan2,v=Math.cos,b=Math.ceil,_=Math.exp,w=Math.log,M=Math.pow,E=Math.sin,T=Math.sign||function(t){return t>0?1:t<0?-1:0},S=Math.sqrt,k=Math.tan;function acos(t){return t>1?0:t<-1?a:Math.acos(t)}function asin(t){return t>1?s:t<-1?-s:Math.asin(t)}function haversin(t){return(t=E(t/2))*t}function noop(){}function streamGeometry(t,e){t&&R.hasOwnProperty(t.type)&&R[t.type](t,e)}var C={Feature:function(t,e){streamGeometry(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,a=n.length;++i=0?1:-1,a=i*n,s=v(e=(e*=h)/2+u),c=E(e),f=L*c,d=j*s+f*v(a),p=f*i*E(a);P.add(g(p,d)),O=t,j=s,L=c}var D,q,B,z,H,W,$,V;function spherical(t){return[g(t[1],t[0]),asin(t[2])]}function cartesian(t){var e=t[0],n=t[1],i=v(n);return[i*v(e),i*E(e),E(n)]}function cartesianDot(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function cartesianCross(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function cartesianAddInPlace(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function cartesianScale(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function cartesianNormalizeInPlace(t){var e=S(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Z,G,Q=adder(),J={point:boundsPoint,lineStart:boundsLineStart,lineEnd:boundsLineEnd,polygonStart:function(){J.point=boundsRingPoint,J.lineStart=boundsRingStart,J.lineEnd=boundsRingEnd,Q.reset(),I.polygonStart()},polygonEnd:function(){I.polygonEnd(),J.point=boundsPoint,J.lineStart=boundsLineStart,J.lineEnd=boundsLineEnd,P<0?(D=-(B=180),q=-(z=90)):Q>i?z=90:Q<-i&&(q=-90),G[0]=D,G[1]=B}};function boundsPoint(t,e){Z.push(G=[D=t,B=t]),ez&&(z=e)}function linePoint(t,e){var n=cartesian([t*h,e*h]);if(V){var i=cartesianCross(V,n),a=cartesianCross([i[1],-i[0],0],i);cartesianNormalizeInPlace(a),a=spherical(a);var s,u=t-H,c=u>0?1:-1,p=a[0]*f*c,g=d(u)>180;g^(c*Hz&&(z=s):g^(c*H<(p=(p+360)%360-180)&&pz&&(z=e)),g?tangle(D,B)&&(B=t):angle(t,B)>angle(D,B)&&(D=t):B>=D?(tB&&(B=t)):t>H?angle(D,t)>angle(D,B)&&(B=t):angle(t,B)>angle(D,B)&&(D=t)}else Z.push(G=[D=t,B=t]);ez&&(z=e),V=n,H=t}function boundsLineStart(){J.point=linePoint}function boundsLineEnd(){G[0]=D,G[1]=B,J.point=boundsPoint,V=null}function boundsRingPoint(t,e){if(V){var n=t-H;Q.add(d(n)>180?n+(n>0?360:-360):n)}else W=t,$=e;I.point(t,e),linePoint(t,e)}function boundsRingStart(){I.lineStart()}function boundsRingEnd(){boundsRingPoint(W,$),I.lineEnd(),d(Q)>i&&(D=-(B=180)),G[0]=D,G[1]=B,V=null}function angle(t,e){return(e-=t)<0?e+360:e}function rangeCompare(t,e){return t[0]-e[0]}function rangeContains(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:ea?t-c:t<-a?t+c:t,e]}function rotateRadians(t,e,n){return(t%=c)?e||n?compose(rotationLambda(t),rotationPhiGamma(e,n)):rotationLambda(t):e||n?rotationPhiGamma(e,n):rotationIdentity}function forwardRotationLambda(t){return function(e,n){return[(e+=t)>a?e-c:e<-a?e+c:e,n]}}function rotationLambda(t){var e=forwardRotationLambda(t);return e.invert=forwardRotationLambda(-t),e}function rotationPhiGamma(t,e){var n=v(t),i=E(t),a=v(e),s=E(e);function rotation(t,e){var u=v(e),c=v(t)*u,f=E(t)*u,h=E(e),d=h*n+c*i;return[g(f*a-d*s,c*n-h*i),asin(d*a+f*s)]}return rotation.invert=function(t,e){var u=v(e),c=v(t)*u,f=E(t)*u,h=E(e),d=h*a-f*s;return[g(f*a+h*s,c*n+d*i),asin(d*n-c*i)]},rotation}rotationIdentity.invert=rotationIdentity;var rotation=function(t){function forward(e){return(e=t(e[0]*h,e[1]*h))[0]*=f,e[1]*=f,e}return t=rotateRadians(t[0]*h,t[1]*h,t.length>2?t[2]*h:0),forward.invert=function(e){return(e=t.invert(e[0]*h,e[1]*h))[0]*=f,e[1]*=f,e},forward};function circleStream(t,e,n,i,a,s){if(n){var u=v(e),f=E(e),h=i*n;null==a?(a=e+i*c,s=e-h/2):(a=circleRadius(u,a),s=circleRadius(u,s),(i>0?as)&&(a+=i*c));for(var d,p=a;i>0?p>s:p1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},pointEqual=function(t,e){return d(t[0]-e[0])=0;--s)a.point((d=h[s])[0],d[1]);else i(g.x,g.p.x,-1,a);g=g.p}h=(g=g.o).z,v=!v}while(!g.v);a.lineEnd()}}};function link(t){if(e=t.length){for(var e,n,i=0,a=t[0];++i=0?1:-1,I=U*P,D=I>a,q=k*j;if(yt.add(g(q*U*E(I),C*L+q*v(I))),h+=D?P+U*c:P,D^T>=n^A>=n){var B=cartesianCross(cartesian(M),cartesian(N));cartesianNormalizeInPlace(B);var z=cartesianCross(f,B);cartesianNormalizeInPlace(z);var H=(D^P>=0?-1:1)*asin(z[2]);(s>H||s===H&&(B[0]||B[1]))&&(d+=D^P>=0?1:-1)}}return(h<-i||h0){for(g||(s.polygonStart(),g=!0),s.lineStart(),t=0;t1&&2&a&&h.push(h.pop().concat(h.shift())),c.push(h.filter(validSegment))}return v}};function validSegment(t){return t.length>1}function compareIntersection(t,e){return((t=t.x)[0]<0?t[1]-s-i:s-t[1])-((e=e.x)[0]<0?e[1]-s-i:s-e[1])}var gt=clip((function(){return!0}),(function clipAntimeridianLine(t){var e,n=NaN,u=NaN,c=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(f,h){var g=f>0?a:-a,b=d(f-n);d(b-a)0?s:-s),t.point(c,u),t.lineEnd(),t.lineStart(),t.point(g,u),t.point(f,u),e=0):c!==g&&b>=a&&(d(n-c)i?p((E(e)*(u=v(a))*E(n)-E(a)*(s=v(e))*E(t))/(s*u*c)):(e+a)/2}(n,u,f,h),t.point(c,u),t.lineEnd(),t.lineStart(),t.point(g,u),e=0),t.point(n=f,u=h),c=g},lineEnd:function(){t.lineEnd(),n=u=NaN},clean:function(){return 2-e}}}),(function clipAntimeridianInterpolate(t,e,n,u){var c;if(null==t)c=n*s,u.point(-a,c),u.point(0,c),u.point(a,c),u.point(a,0),u.point(a,-c),u.point(0,-c),u.point(-a,-c),u.point(-a,0),u.point(-a,c);else if(d(t[0]-e[0])>i){var f=t[0]0,u=d(e)>i;function visible(t,n){return v(t)*v(n)>e}function intersect(t,n,s){var u=[1,0,0],c=cartesianCross(cartesian(t),cartesian(n)),f=cartesianDot(c,c),h=c[0],p=f-h*h;if(!p)return!s&&t;var g=e*f/p,v=-e*h/p,b=cartesianCross(u,c),_=cartesianScale(u,g);cartesianAddInPlace(_,cartesianScale(c,v));var w=b,M=cartesianDot(_,w),E=cartesianDot(w,w),T=M*M-E*(cartesianDot(_,_)-1);if(!(T<0)){var k=S(T),C=cartesianScale(w,(-M-k)/E);if(cartesianAddInPlace(C,_),C=spherical(C),!s)return C;var R,N=t[0],A=n[0],O=t[1],j=n[1];A0^C[1]<(d(C[0]-N)a^(N<=C[0]&&C[0]<=A)){var U=cartesianScale(w,(-M+k)/E);return cartesianAddInPlace(U,_),[C,spherical(U)]}}}function code(e,n){var i=s?t:a-t,u=0;return e<-i?u|=1:e>i&&(u|=2),n<-i?u|=4:n>i&&(u|=8),u}return clip(visible,(function clipLine(t){var e,n,c,f,h;return{lineStart:function(){f=c=!1,h=1},point:function(d,p){var g,v=[d,p],b=visible(d,p),_=s?b?0:code(d,p):b?code(d+(d<0?a:-a),p):0;if(!e&&(f=c=b)&&t.lineStart(),b!==c&&(!(g=intersect(e,v))||pointEqual(e,g)||pointEqual(v,g))&&(v[0]+=i,v[1]+=i,b=visible(v[0],v[1])),b!==c)h=0,b?(t.lineStart(),g=intersect(v,e),t.point(g[0],g[1])):(g=intersect(e,v),t.point(g[0],g[1]),t.lineEnd()),e=g;else if(u&&e&&s^b){var w;_&n||!(w=intersect(v,e,!0))||(h=0,s?(t.lineStart(),t.point(w[0][0],w[0][1]),t.point(w[1][0],w[1][1]),t.lineEnd()):(t.point(w[1][0],w[1][1]),t.lineEnd(),t.lineStart(),t.point(w[0][0],w[0][1])))}!b||e&&pointEqual(e,v)||t.point(v[0],v[1]),e=v,c=b,n=_},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return h|(f&&c)<<1}}}),(function interpolate(e,i,a,s){circleStream(s,t,n,a,e,i)}),s?[0,-t]:[-a,t-a])},vt=1e9,bt=-vt;function clipRectangle(t,n,a,s){function visible(e,i){return t<=e&&e<=a&&n<=i&&i<=s}function interpolate(e,i,u,c){var f=0,h=0;if(null==e||(f=corner(e,u))!==(h=corner(i,u))||comparePoint(e,i)<0^u>0)do{c.point(0===f||3===f?t:a,f>1?s:n)}while((f=(f+u+4)%4)!==h);else c.point(i[0],i[1])}function corner(e,s){return d(e[0]-t)0?0:3:d(e[0]-a)0?2:1:d(e[1]-n)0?1:0:s>0?3:2}function compareIntersection(t,e){return comparePoint(t.x,e.x)}function comparePoint(t,e){var n=corner(t,1),i=corner(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(i){var u,c,f,h,d,p,g,v,b,_,w,M=i,E=clipBuffer(),T={point,lineStart:function lineStart(){T.point=linePoint,c&&c.push(f=[]);_=!0,b=!1,g=v=NaN},lineEnd:function lineEnd(){u&&(linePoint(h,d),p&&b&&E.rejoin(),u.push(E.result()));T.point=point,b&&M.lineEnd()},polygonStart:function polygonStart(){M=E,u=[],c=[],w=!0},polygonEnd:function polygonEnd(){var n=function polygonInside(){for(var e=0,n=0,i=c.length;ns&&(g-a)*(s-u)>(v-u)*(t-a)&&++e:v<=s&&(g-a)*(s-u)<(v-u)*(t-a)&&--e;return e}(),a=w&&n,h=(u=e.merge(u)).length;(a||h)&&(i.polygonStart(),a&&(i.lineStart(),interpolate(null,null,1,i),i.lineEnd()),h&&clipRejoin(u,compareIntersection,n,interpolate,i),i.polygonEnd());M=i,u=c=f=null}};function point(t,e){visible(t,e)&&M.point(t,e)}function linePoint(e,i){var u=visible(e,i);if(c&&f.push([e,i]),_)h=e,d=i,p=u,_=!1,u&&(M.lineStart(),M.point(e,i));else if(u&&b)M.point(e,i);else{var E=[g=Math.max(bt,Math.min(vt,g)),v=Math.max(bt,Math.min(vt,v))],T=[e=Math.max(bt,Math.min(vt,e)),i=Math.max(bt,Math.min(vt,i))];!function(t,e,n,i,a,s){var u,c=t[0],f=t[1],h=0,d=1,p=e[0]-c,g=e[1]-f;if(u=n-c,p||!(u>0)){if(u/=p,p<0){if(u0){if(u>d)return;u>h&&(h=u)}if(u=a-c,p||!(u<0)){if(u/=p,p<0){if(u>d)return;u>h&&(h=u)}else if(p>0){if(u0)){if(u/=g,g<0){if(u0){if(u>d)return;u>h&&(h=u)}if(u=s-f,g||!(u<0)){if(u/=g,g<0){if(u>d)return;u>h&&(h=u)}else if(g>0){if(u0&&(t[0]=c+h*p,t[1]=f+h*g),d<1&&(e[0]=c+d*p,e[1]=f+d*g),!0}}}}}(E,T,t,n,a,s)?u&&(M.lineStart(),M.point(e,i),w=!1):(b||(M.lineStart(),M.point(E[0],E[1])),M.point(T[0],T[1]),u||M.lineEnd(),w=!1)}g=e,v=i,b=u}return T}}var _t,wt,xt,Mt=adder(),Et={sphere:noop,point:noop,lineStart:function lengthLineStart(){Et.point=lengthPointFirst,Et.lineEnd=lengthLineEnd},lineEnd:noop,polygonStart:noop,polygonEnd:noop};function lengthLineEnd(){Et.point=Et.lineEnd=noop}function lengthPointFirst(t,e){_t=t*=h,wt=E(e*=h),xt=v(e),Et.point=lengthPoint}function lengthPoint(t,e){t*=h;var n=E(e*=h),i=v(e),a=d(t-_t),s=v(a),u=i*E(a),c=xt*n-wt*i*s,f=wt*n+xt*i*s;Mt.add(g(S(u*u+c*c),f)),_t=t,wt=n,xt=i}var length=function(t){return Mt.reset(),geoStream(t,Et),+Mt},Tt=[null,null],St={type:"LineString",coordinates:Tt},distance=function(t,e){return Tt[0]=t,Tt[1]=e,length(St)},kt={Feature:function(t,e){return containsGeometry(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,a=n.length;++ii})).map(p)).concat(e.range(b(c/M)*M,u,M).filter((function(t){return d(t%T)>i})).map(g))}return graticule.lines=function(){return lines().map((function(t){return{type:"LineString",coordinates:t}}))},graticule.outline=function(){return{type:"Polygon",coordinates:[v(s).concat(_(f).slice(1),v(a).reverse().slice(1),_(h).reverse().slice(1))]}},graticule.extent=function(t){return arguments.length?graticule.extentMajor(t).extentMinor(t):graticule.extentMinor()},graticule.extentMajor=function(t){return arguments.length?(s=+t[0][0],a=+t[1][0],h=+t[0][1],f=+t[1][1],s>a&&(t=s,s=a,a=t),h>f&&(t=h,h=f,f=t),graticule.precision(S)):[[s,h],[a,f]]},graticule.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],c=+e[0][1],u=+e[1][1],n>t&&(e=n,n=t,t=e),c>u&&(e=c,c=u,u=e),graticule.precision(S)):[[n,c],[t,u]]},graticule.step=function(t){return arguments.length?graticule.stepMajor(t).stepMinor(t):graticule.stepMinor()},graticule.stepMajor=function(t){return arguments.length?(E=+t[0],T=+t[1],graticule):[E,T]},graticule.stepMinor=function(t){return arguments.length?(w=+t[0],M=+t[1],graticule):[w,M]},graticule.precision=function(e){return arguments.length?(S=+e,p=graticuleX(c,u,90),g=graticuleY(n,t,S),v=graticuleX(h,f,90),_=graticuleY(s,a,S),graticule):S},graticule.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}var Rt,Nt,At,Ot,identity=function(t){return t},jt=adder(),Lt=adder(),Pt={point:noop,lineStart:noop,lineEnd:noop,polygonStart:function(){Pt.lineStart=areaRingStart$1,Pt.lineEnd=areaRingEnd$1},polygonEnd:function(){Pt.lineStart=Pt.lineEnd=Pt.point=noop,jt.add(d(Lt)),Lt.reset()},result:function(){var t=jt/2;return jt.reset(),t}};function areaRingStart$1(){Pt.point=areaPointFirst$1}function areaPointFirst$1(t,e){Pt.point=areaPoint$1,Rt=At=t,Nt=Ot=e}function areaPoint$1(t,e){Lt.add(Ot*t-At*e),At=t,Ot=e}function areaRingEnd$1(){areaPoint$1(Rt,Nt)}var Ut=1/0,It=Ut,Dt=-Ut,Ft=Dt,qt={point:function boundsPoint$1(t,e){tDt&&(Dt=t);eFt&&(Ft=e)},lineStart:noop,lineEnd:noop,polygonStart:noop,polygonEnd:noop,result:function(){var t=[[Ut,It],[Dt,Ft]];return Dt=Ft=-(It=Ut=1/0),t}};var Bt,zt,Ht,Wt,Yt=0,Xt=0,$t=0,Vt=0,Zt=0,Gt=0,Qt=0,Jt=0,Kt=0,te={point:centroidPoint$1,lineStart:centroidLineStart$1,lineEnd:centroidLineEnd$1,polygonStart:function(){te.lineStart=centroidRingStart$1,te.lineEnd=centroidRingEnd$1},polygonEnd:function(){te.point=centroidPoint$1,te.lineStart=centroidLineStart$1,te.lineEnd=centroidLineEnd$1},result:function(){var t=Kt?[Qt/Kt,Jt/Kt]:Gt?[Vt/Gt,Zt/Gt]:$t?[Yt/$t,Xt/$t]:[NaN,NaN];return Yt=Xt=$t=Vt=Zt=Gt=Qt=Jt=Kt=0,t}};function centroidPoint$1(t,e){Yt+=t,Xt+=e,++$t}function centroidLineStart$1(){te.point=centroidPointFirstLine}function centroidPointFirstLine(t,e){te.point=centroidPointLine,centroidPoint$1(Ht=t,Wt=e)}function centroidPointLine(t,e){var n=t-Ht,i=e-Wt,a=S(n*n+i*i);Vt+=a*(Ht+t)/2,Zt+=a*(Wt+e)/2,Gt+=a,centroidPoint$1(Ht=t,Wt=e)}function centroidLineEnd$1(){te.point=centroidPoint$1}function centroidRingStart$1(){te.point=centroidPointFirstRing}function centroidRingEnd$1(){centroidPointRing(Bt,zt)}function centroidPointFirstRing(t,e){te.point=centroidPointRing,centroidPoint$1(Bt=Ht=t,zt=Wt=e)}function centroidPointRing(t,e){var n=t-Ht,i=e-Wt,a=S(n*n+i*i);Vt+=a*(Ht+t)/2,Zt+=a*(Wt+e)/2,Gt+=a,Qt+=(a=Wt*t-Ht*e)*(Ht+t),Jt+=a*(Wt+e),Kt+=3*a,centroidPoint$1(Ht=t,Wt=e)}function PathContext(t){this._context=t}PathContext.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,c)}},result:noop};var ee,ne,re,ie,oe,ae=adder(),se={point:noop,lineStart:function(){se.point=lengthPointFirst$1},lineEnd:function(){ee&&lengthPoint$1(ne,re),se.point=noop},polygonStart:function(){ee=!0},polygonEnd:function(){ee=null},result:function(){var t=+ae;return ae.reset(),t}};function lengthPointFirst$1(t,e){se.point=lengthPoint$1,ne=ie=t,re=oe=e}function lengthPoint$1(t,e){ie-=t,oe-=e,ae.add(S(ie*ie+oe*oe)),ie=t,oe=e}function PathString(){this._string=[]}function circle$1(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}PathString.prototype={_radius:4.5,_circle:circle$1(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=circle$1(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};function transformer(t){return function(e){var n=new TransformStream;for(var i in t)n[i]=t[i];return n.stream=e,n}}function TransformStream(){}function fit(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),geoStream(n,t.stream(qt)),e(qt.result()),null!=i&&t.clipExtent(i),t}function fitExtent(t,e,n){return fit(t,(function(n){var i=e[1][0]-e[0][0],a=e[1][1]-e[0][1],s=Math.min(i/(n[1][0]-n[0][0]),a/(n[1][1]-n[0][1])),u=+e[0][0]+(i-s*(n[1][0]+n[0][0]))/2,c=+e[0][1]+(a-s*(n[1][1]+n[0][1]))/2;t.scale(150*s).translate([u,c])}),n)}function fitSize(t,e,n){return fitExtent(t,[[0,0],e],n)}function fitWidth(t,e,n){return fit(t,(function(n){var i=+e,a=i/(n[1][0]-n[0][0]),s=(i-a*(n[1][0]+n[0][0]))/2,u=-a*n[0][1];t.scale(150*a).translate([s,u])}),n)}function fitHeight(t,e,n){return fit(t,(function(n){var i=+e,a=i/(n[1][1]-n[0][1]),s=-a*n[0][0],u=(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([s,u])}),n)}TransformStream.prototype={constructor:TransformStream,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ue=v(30*h),resample=function(t,e){return+e?function resample$1(t,e){function resampleLineTo(n,a,s,u,c,f,h,p,v,b,_,w,M,E){var T=h-n,k=p-a,C=T*T+k*k;if(C>4*e&&M--){var R=u+b,N=c+_,A=f+w,O=S(R*R+N*N+A*A),j=asin(A/=O),L=d(d(A)-1)e||d((T*D+k*q)/C-.5)>.3||u*b+c*_+f*w2?t[2]%360*h:0,recenter()):[E*f,T*f,k*f]},projection.precision=function(t){return arguments.length?(j=resample(projectTransform,O=t*t),reset()):S(O)},projection.fitExtent=function(t,e){return fitExtent(projection,t,e)},projection.fitSize=function(t,e){return fitSize(projection,t,e)},projection.fitWidth=function(t,e){return fitWidth(projection,t,e)},projection.fitHeight=function(t,e){return fitHeight(projection,t,e)},function(){return e=t.apply(this,arguments),projection.invert=e.invert&&invert,recenter()}}function conicProjection(t){var e=0,n=a/3,i=projectionMutator(t),s=i(e,n);return s.parallels=function(t){return arguments.length?i(e=t[0]*h,n=t[1]*h):[e*f,n*f]},s}function conicEqualAreaRaw(t,e){var n=E(t),a=(n+E(e))/2;if(d(a)0?e<-s+i&&(e=-s+i):e>s-i&&(e=s-i);var n=u/M(tany(e),a);return[n*E(a*t),u-n*v(a*t)]}return project.invert=function(t,e){var n=u-e,i=T(a)*S(t*t+n*n);return[g(t,d(n))/a*T(n),2*p(M(u/i,1/a))-s]},project}function equirectangularRaw(t,e){return[t,e]}equirectangularRaw.invert=equirectangularRaw;function conicEquidistantRaw(t,e){var n=v(t),a=t===e?E(t):(n-v(e))/(e-t),s=n/a+t;if(d(a)i&&--s>0);return[t/(.8707+(u=a*a)*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979)),a]};function orthographicRaw(t,e){return[v(e)*E(t),E(e)]}orthographicRaw.invert=azimuthalInvert(asin);function stereographicRaw(t,e){var n=v(e),i=1+v(t)*n;return[n*E(t)/i,E(e)/i]}stereographicRaw.invert=azimuthalInvert((function(t){return 2*p(t)}));function transverseMercatorRaw(t,e){return[w(k((s+e)/2)),-t]}transverseMercatorRaw.invert=function(t,e){return[-e,2*p(_(t))-s]};t.geoArea=function(t){return U.reset(),geoStream(t,I),2*U},t.geoBounds=function(t){var e,n,i,a,s,u,c;if(z=B=-(D=q=1/0),Z=[],geoStream(t,J),n=Z.length){for(Z.sort(rangeCompare),e=1,s=[i=Z[0]];eangle(i[0],i[1])&&(i[1]=a[1]),angle(a[0],i[1])>angle(i[0],i[1])&&(i[0]=a[0])):s.push(i=a);for(u=-1/0,e=0,i=s[n=s.length-1];e<=n;i=a,++e)a=s[e],(c=angle(i[1],a[0]))>u&&(u=c,D=a[0],B=i[1])}return Z=G=null,D===1/0||q===1/0?[[NaN,NaN],[NaN,NaN]]:[[D,q],[B,z]]},t.geoCentroid=function(t){K=tt=et=nt=rt=it=ot=at=st=ut=ct=0,geoStream(t,mt);var e=st,n=ut,a=ct,s=e*e+n*n+a*a;return s<1e-12&&(e=it,n=ot,a=at,tt=.12&&a<.234&&i>=-.425&&i<-.214?f:a>=.166&&a<.234&&i>=-.214&&i<-.115?h:c).invert(t)},albersUsa.stream=function(n){return t&&e===n?t:t=function multiplex(t){var e=t.length;return{point:function(n,i){for(var a=-1;++a2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=transverseMercatorRaw,t.geoRotation=rotation,t.geoStream=geoStream,t.geoTransform=function(t){return{stream:transformer(t)}},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":39}],53:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){function defaultSeparation(t,e){return t.parent===e.parent?1:2}function meanXReduce(t,e){return t+e.x}function maxYReduce(t,e){return Math.max(t,e.y)}function count(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function hierarchy(t,e){var n,i,a,s,u,c=new Node(t),f=+t.value&&(c.value=t.value),h=[c];for(null==e&&(e=defaultChildren);n=h.pop();)if(f&&(n.value=+n.data.value),(a=e(n.data))&&(u=a.length))for(n.children=new Array(u),s=u-1;s>=0;--s)h.push(i=n.children[s]=new Node(a[s])),i.parent=n,i.depth=n.depth+1;return c.eachBefore(computeHeight)}function defaultChildren(t){return t.children}function copyData(t){t.data=t.data.data}function computeHeight(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Node(t){this.data=t,this.depth=this.height=0,this.parent=null}Node.prototype=hierarchy.prototype={constructor:Node,count:function(){return this.eachAfter(count)},each:function(t){var e,n,i,a,s=this,u=[s];do{for(e=u.reverse(),u=[];s=e.pop();)if(t(s),n=s.children)for(i=0,a=n.length;i=0;--n)a.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,a=i&&i.length;--a>=0;)n+=i[a].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function leastCommonAncestor(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),a=null;t=n.pop(),e=i.pop();for(;t===e;)a=t,t=n.pop(),e=i.pop();return a}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;t!==n;)i.splice(a,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function node_copy(){return hierarchy(this).eachBefore(copyData)}};var e=Array.prototype.slice;var enclose=function(t){for(var n,i,a=0,s=(t=function shuffle(t){for(var e,n,i=t.length;i;)n=Math.random()*i--|0,e=t[i],t[i]=t[n],t[n]=e;return t}(e.call(t))).length,u=[];a0&&n*n>i*i+a*a}function enclosesWeakAll(t,e){for(var n=0;nn*n+i*i}function score(t){var e=t._,n=t.next._,i=e.r+n.r,a=(e.x*n.r+n.x*e.r)/i,s=(e.y*n.r+n.y*e.r)/i;return a*a+s*s}function Node$1(t){this._=t,this.next=null,this.previous=null}function packEnclose(t){if(!(a=t.length))return 0;var e,n,i,a,s,u,c,f,h,d,p;if((e=t[0]).x=0,e.y=0,!(a>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(a>2))return e.r+n.r;place(n,e,i=t[2]),e=new Node$1(e),n=new Node$1(n),i=new Node$1(i),e.next=i.previous=n,n.next=e.previous=i,i.next=n.previous=e;t:for(c=3;cg&&(g=c),w=d*d*_,(v=Math.max(g/w,w/p))>b){d-=c;break}b=v}M.push(u={value:d,dice:f1?t:1)},squarify}(a),u=function custom(t){function resquarify(e,n,i,a,s){if((u=e._squarify)&&u.ratio===t)for(var u,c,f,h,d,p=-1,g=u.length,v=e.value;++p1?t:1)},resquarify}(a);t.cluster=function(){var t=defaultSeparation,e=1,n=1,i=!1;function cluster(a){var s,u=0;a.eachAfter((function(e){var n=e.children;n?(e.x=function meanX(t){return t.reduce(meanXReduce,0)/t.length}(n),e.y=function maxY(t){return 1+t.reduce(maxYReduce,0)}(n)):(e.x=s?u+=t(e,s):0,e.y=0,s=e)}));var c=function leafLeft(t){for(var e;e=t.children;)t=e[0];return t}(a),f=function leafRight(t){for(var e;e=t.children;)t=e[e.length-1];return t}(a),h=c.x-t(c,f)/2,d=f.x+t(f,c)/2;return a.eachAfter(i?function(t){t.x=(t.x-a.x)*e,t.y=(a.y-t.y)*n}:function(t){t.x=(t.x-h)/(d-h)*e,t.y=(1-(a.y?t.y/a.y:1))*n})}return cluster.separation=function(e){return arguments.length?(t=e,cluster):t},cluster.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],cluster):i?null:[e,n]},cluster.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],cluster):i?[e,n]:null},cluster},t.hierarchy=hierarchy,t.pack=function(){var t=null,e=1,n=1,i=constantZero;function pack(a){return a.x=e/2,a.y=n/2,t?a.eachBefore(radiusLeaf(t)).eachAfter(packChildren(i,.5)).eachBefore(translateChild(1)):a.eachBefore(radiusLeaf(defaultRadius)).eachAfter(packChildren(constantZero,1)).eachAfter(packChildren(i,a.r/Math.min(e,n))).eachBefore(translateChild(Math.min(e,n)/(2*a.r))),a}return pack.radius=function(e){return arguments.length?(t=function optional(t){return null==t?null:required(t)}(e),pack):t},pack.size=function(t){return arguments.length?(e=+t[0],n=+t[1],pack):[e,n]},pack.padding=function(t){return arguments.length?(i="function"==typeof t?t:constant(+t),pack):i},pack},t.packSiblings=function(t){return packEnclose(t),t},t.packEnclose=enclose,t.partition=function(){var t=1,e=1,n=0,i=!1;function partition(a){var s=a.height+1;return a.x0=a.y0=n,a.x1=t,a.y1=e/s,a.eachBefore(function positionNode(t,e){return function(i){i.children&&treemapDice(i,i.x0,t*(i.depth+1)/e,i.x1,t*(i.depth+2)/e);var a=i.x0,s=i.y0,u=i.x1-n,c=i.y1-n;u0)throw new Error("cycle");return c}return stratify.id=function(e){return arguments.length?(t=required(e),stratify):t},stratify.parentId=function(t){return arguments.length?(e=required(t),stratify):e},stratify},t.tree=function(){var t=defaultSeparation$1,e=1,n=1,i=null;function tree(a){var s=function treeRoot(t){for(var e,n,i,a,s,u=new TreeNode(t,0),c=[u];e=c.pop();)if(i=e._.children)for(e.children=new Array(s=i.length),a=s-1;a>=0;--a)c.push(n=e.children[a]=new TreeNode(i[a],a)),n.parent=e;return(u.parent=new TreeNode(null,0)).children=[u],u}(a);if(s.eachAfter(firstWalk),s.parent.m=-s.z,s.eachBefore(secondWalk),i)a.eachBefore(sizeNode);else{var u=a,c=a,f=a;a.eachBefore((function(t){t.xc.x&&(c=t),t.depth>f.depth&&(f=t)}));var h=u===c?1:t(u,c)/2,d=h-u.x,p=e/(c.x+h+d),g=n/(f.depth||1);a.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return a}function firstWalk(e){var n=e.children,i=e.parent.children,a=e.i?i[e.i-1]:null;if(n){!function executeShifts(t){for(var e,n=0,i=0,a=t.children,s=a.length;--s>=0;)(e=a[s]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var s=(n[0].z+n[n.length-1].z)/2;a?(e.z=a.z+t(e._,a._),e.m=e.z-s):e.z=s}else a&&(e.z=a.z+t(e._,a._));e.parent.A=function apportion(e,n,i){if(n){for(var a,s=e,u=e,c=n,f=s.parent.children[0],h=s.m,d=u.m,p=c.m,g=f.m;c=nextRight(c),s=nextLeft(s),c&&s;)f=nextLeft(f),(u=nextRight(u)).a=e,(a=c.z+p-s.z-h+t(c._,s._))>0&&(moveSubtree(nextAncestor(c,e,i),e,a),h+=a,d+=a),p+=c.m,h+=s.m,g+=f.m,d+=u.m;c&&!nextRight(u)&&(u.t=c,u.m+=p-d),s&&!nextLeft(f)&&(f.t=s,f.m+=h-g,i=e)}return i}(e,a,e.parent.A||i[0])}function secondWalk(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function sizeNode(t){t.x*=e,t.y=t.depth*n}return tree.separation=function(e){return arguments.length?(t=e,tree):t},tree.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],tree):i?null:[e,n]},tree.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],tree):i?[e,n]:null},tree},t.treemap=function(){var t=s,e=!1,n=1,i=1,a=[0],u=constantZero,c=constantZero,f=constantZero,h=constantZero,d=constantZero;function treemap(t){return t.x0=t.y0=0,t.x1=n,t.y1=i,t.eachBefore(positionNode),a=[0],e&&t.eachBefore(roundNode),t}function positionNode(e){var n=a[e.depth],i=e.x0+n,s=e.y0+n,p=e.x1-n,g=e.y1-n;p=e-1){var f=c[t];return f.x0=i,f.y0=a,f.x1=s,void(f.y1=u)}var d=h[t],p=n/2+d,g=t+1,v=e-1;for(;g>>1;h[b]u-a){var M=(i*w+s*_)/n;partition(t,g,_,i,a,M,u),partition(g,e,w,M,a,s,u)}else{var E=(a*w+u*_)/n;partition(t,g,_,i,a,s,E),partition(g,e,w,i,E,s,u)}}(0,f,t.value,e,n,i,a)},t.treemapDice=treemapDice,t.treemapSlice=treemapSlice,t.treemapSliceDice=function(t,e,n,i,a){(1&t.depth?treemapSlice:treemapDice)(t,e,n,i,a)},t.treemapSquarify=s,t.treemapResquarify=u,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],54:[function(t,e,n){!function(i,a){"object"==typeof n&&void 0!==e?a(n,t("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-color"],a):a((i=i||self).d3=i.d3||{},i.d3)}(this,(function(t,e){function basis(t,e,n,i,a){var s=t*t,u=s*t;return((1-3*t+3*s-u)*e+(4-6*s+3*u)*n+(1+3*t+3*s-3*u)*i+u*a)/6}function basis$1(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],s=t[i+1],u=i>0?t[i-1]:2*a-s,c=i180||n<-180?n-360*Math.round(n/360):n):constant(isNaN(t)?e:t)}function gamma(t){return 1==(t=+t)?nogamma:function(e,n){return n-e?function exponential(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):constant(isNaN(e)?n:e)}}function nogamma(t,e){var n=e-t;return n?linear(t,n):constant(isNaN(t)?e:t)}var n=function rgbGamma(t){var n=gamma(t);function rgb(t,i){var a=n((t=e.rgb(t)).r,(i=e.rgb(i)).r),s=n(t.g,i.g),u=n(t.b,i.b),c=nogamma(t.opacity,i.opacity);return function(e){return t.r=a(e),t.g=s(e),t.b=u(e),t.opacity=c(e),t+""}}return rgb.gamma=rgbGamma,rgb}(1);function rgbSpline(t){return function(n){var i,a,s=n.length,u=new Array(s),c=new Array(s),f=new Array(s);for(i=0;ic&&(a=e.slice(c,a),h[f]?h[f]+=a:h[++f]=a),(n=n[0])===(i=i[0])?h[f]?h[f]+=i:h[++f]=i:(h[++f]=null,d.push({i:f,x:number(n,i)})),c=u.lastIndex;return c180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(pop(n)+"rotate(",null,i)-2,x:number(t,e)})):e&&n.push(pop(n)+"rotate("+e+i)}(a.rotate,s.rotate,u,c),function skewX(t,e,n,a){t!==e?a.push({i:n.push(pop(n)+"skewX(",null,i)-2,x:number(t,e)}):e&&n.push(pop(n)+"skewX("+e+i)}(a.skewX,s.skewX,u,c),function scale(t,e,n,i,a,s){if(t!==n||e!==i){var u=a.push(pop(a)+"scale(",null,",",null,")");s.push({i:u-4,x:number(t,n)},{i:u-2,x:number(e,i)})}else 1===n&&1===i||a.push(pop(a)+"scale("+n+","+i+")")}(a.scaleX,a.scaleY,s.scaleX,s.scaleY,u,c),a=s=null,function(t){for(var e,n=-1,i=c.length;++ni)if(Math.abs(g*h-d*p)>i&&u){var b=a-c,_=s-f,w=h*h+d*d,M=b*b+_*_,E=Math.sqrt(w),T=Math.sqrt(v),S=u*Math.tan((e-Math.acos((w+v-M)/(2*E*T)))/2),k=S/T,C=S/E;Math.abs(k-1)>i&&(this._+="L"+(t+k*p)+","+(n+k*g)),this._+="A"+u+","+u+",0,0,"+ +(g*b>p*_)+","+(this._x1=t+C*h)+","+(this._y1=n+C*d)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,s,u,c,f,h){t=+t,s=+s,h=!!h;var d=(u=+u)*Math.cos(c),p=u*Math.sin(c),g=t+d,v=s+p,b=1^h,_=h?c-f:f-c;if(u<0)throw new Error("negative radius: "+u);null===this._x1?this._+="M"+g+","+v:(Math.abs(this._x1-g)>i||Math.abs(this._y1-v)>i)&&(this._+="L"+g+","+v),u&&(_<0&&(_=_%n+n),_>a?this._+="A"+u+","+u+",0,1,"+b+","+(t-d)+","+(s-p)+"A"+u+","+u+",0,1,"+b+","+(this._x1=g)+","+(this._y1=v):_>i&&(this._+="A"+u+","+u+",0,"+ +(_>=e)+","+b+","+(this._x1=t+u*Math.cos(f))+","+(this._y1=s+u*Math.sin(f))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}},t.path=path,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],56:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){function lexicographicOrder(t,e){return t[0]-e[0]||t[1]-e[1]}function computeUpperHullIndexes(t){for(var e,n,i,a=t.length,s=[0,1],u=2,c=2;c1&&(e=t[s[u-2]],n=t[s[u-1]],i=t[c],(n[0]-e[0])*(i[1]-e[1])-(n[1]-e[1])*(i[0]-e[0])<=0);)--u;s[u++]=c}return s.slice(0,u)}t.polygonArea=function(t){for(var e,n=-1,i=t.length,a=t[i-1],s=0;++n=0;--e)h.push(t[i[s[e]][2]]);for(e=+c;ec!=h>c&&u<(f-n)*(c-i)/(h-i)+n&&(d=!d),f=n,h=i;return d},t.polygonLength=function(t){for(var e,n,i=-1,a=t.length,s=t[a-1],u=s[0],c=s[1],f=0;++i=(s=(_+M)/2))?_=s:M=s,(d=n>=(u=(w+E)/2))?w=u:E=u,a=v,!(v=v[p=d<<1|h]))return a[p]=b,t;if(c=+t._x.call(null,v.data),f=+t._y.call(null,v.data),e===c&&n===f)return b.next=v,a?a[p]=b:t._root=b,t;do{a=a?a[p]=new Array(4):t._root=new Array(4),(h=e>=(s=(_+M)/2))?_=s:M=s,(d=n>=(u=(w+E)/2))?w=u:E=u}while((p=d<<1|h)==(g=(f>=u)<<1|c>=s));return a[g]=v,a[p]=b,t}var Quad=function(t,e,n,i,a){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=a};function defaultX(t){return t[0]}function defaultY(t){return t[1]}function quadtree(t,e,n){var i=new Quadtree(null==e?defaultX:e,null==n?defaultY:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Quadtree(t,e,n,i,a,s){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=a,this._y1=s,this._root=void 0}function leaf_copy(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var e=quadtree.prototype=Quadtree.prototype;e.copy=function(){var t,e,n=new Quadtree(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=leaf_copy(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var a=0;a<4;++a)(e=i.source[a])&&(e.length?t.push({source:e,target:i.target[a]=new Array(4)}):i.target[a]=leaf_copy(e));return n},e.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return add(this.cover(e,n),e,n,t)},e.addAll=function addAll(t){var e,n,i,a,s=t.length,u=new Array(s),c=new Array(s),f=1/0,h=1/0,d=-1/0,p=-1/0;for(n=0;nd&&(d=i),ap&&(p=a));for(dt||t>a||i>e||e>s))return this;var u,c,f=a-n,h=this._root;switch(c=(e<(i+s)/2)<<1|t<(n+a)/2){case 0:do{(u=new Array(4))[c]=h,h=u}while(s=i+(f*=2),t>(a=n+f)||e>s);break;case 1:do{(u=new Array(4))[c]=h,h=u}while(s=i+(f*=2),(n=a-f)>t||e>s);break;case 2:do{(u=new Array(4))[c]=h,h=u}while(i=s-(f*=2),t>(a=n+f)||i>e);break;case 3:do{(u=new Array(4))[c]=h,h=u}while(i=s-(f*=2),(n=a-f)>t||i>e)}this._root&&this._root.length&&(this._root=h)}return this._x0=n,this._y0=i,this._x1=a,this._y1=s,this},e.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},e.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},e.find=function(t,e,n){var i,a,s,u,c,f,h,d=this._x0,p=this._y0,g=this._x1,v=this._y1,b=[],_=this._root;for(_&&b.push(new Quad(_,d,p,g,v)),null==n?n=1/0:(d=t-n,p=e-n,g=t+n,v=e+n,n*=n);f=b.pop();)if(!(!(_=f.node)||(a=f.x0)>g||(s=f.y0)>v||(u=f.x1)=M)<<1|t>=w)&&(f=b[b.length-1],b[b.length-1]=b[b.length-1-h],b[b.length-1-h]=f)}else{var E=t-+this._x.call(null,_.data),T=e-+this._y.call(null,_.data),S=E*E+T*T;if(S=(c=(b+w)/2))?b=c:w=c,(d=u>=(f=(_+M)/2))?_=f:M=f,e=v,!(v=v[p=d<<1|h]))return this;if(!v.length)break;(e[p+1&3]||e[p+2&3]||e[p+3&3])&&(n=e,g=p)}for(;v.data!==t;)if(i=v,!(v=v.next))return this;return(a=v.next)&&delete v.next,i?(a?i.next=a:delete i.next,this):e?(a?e[p]=a:delete e[p],(v=e[0]||e[1]||e[2]||e[3])&&v===(e[3]||e[2]||e[1]||e[0])&&!v.length&&(n?n[g]=v:this._root=v),this):(this._root=a,this)},e.removeAll=function removeAll(t){for(var e=0,n=t.length;e=0;)if((n=t._tasks[i])&&(t._tasks[i]=null,n.abort))try{n.abort()}catch(e){}t._active=NaN,maybeNotify(t)}function maybeNotify(t){if(!t._active&&t._call){var e=t._data;t._data=void 0,t._call(t._error,e)}}function queue(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new Queue(t)}Queue.prototype=queue.prototype={constructor:Queue,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=e.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),poke(this),this},abort:function(){return null==this._error&&abort(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(e,n){t.apply(null,[e].concat(n))},maybeNotify(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,maybeNotify(this),this}},t.queue=queue,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],59:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var defaultSource=function(){return Math.random()},e=function sourceRandomUniform(t){function randomUniform(e,n){return e=null==e?0:+e,n=null==n?1:+n,1===arguments.length?(n=e,e=0):n-=e,function(){return t()*n+e}}return randomUniform.source=sourceRandomUniform,randomUniform}(defaultSource),n=function sourceRandomNormal(t){function randomNormal(e,n){var i,a;return e=null==e?0:+e,n=null==n?1:+n,function(){var s;if(null!=i)s=i,i=null;else do{i=2*t()-1,s=2*t()-1,a=i*i+s*s}while(!a||a>1);return e+n*s*Math.sqrt(-2*Math.log(a)/a)}}return randomNormal.source=sourceRandomNormal,randomNormal}(defaultSource),i=function sourceRandomLogNormal(t){function randomLogNormal(){var e=n.source(t).apply(this,arguments);return function(){return Math.exp(e())}}return randomLogNormal.source=sourceRandomLogNormal,randomLogNormal}(defaultSource),a=function sourceRandomIrwinHall(t){function randomIrwinHall(e){return function(){for(var n=0,i=0;i=200&&i<300||304===i){if(c)try{e=c.call(n,p)}catch(t){return void h.call("error",n,t)}else e=p;h.call("load",n,e)}else h.call("error",n,t)}if("undefined"!=typeof XDomainRequest&&!("withCredentials"in p)&&/^(http(s)?:)?\/\//.test(t)&&(p=new XDomainRequest),"onload"in p?p.onload=p.onerror=p.ontimeout=respond:p.onreadystatechange=function(t){p.readyState>3&&respond(t)},p.onprogress=function(t){h.call("progress",n,t)},n={header:function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?d.get(t):(null==e?d.remove(t):d.set(t,e+""),n)},mimeType:function(t){return arguments.length?(u=null==t?null:t+"",n):u},responseType:function(t){return arguments.length?(f=t,n):f},timeout:function(t){return arguments.length?(b=+t,n):b},user:function(t){return arguments.length<1?g:(g=null==t?null:t+"",n)},password:function(t){return arguments.length<1?v:(v=null==t?null:t+"",n)},response:function(t){return c=t,n},get:function(t,e){return n.send("GET",t,e)},post:function(t,e){return n.send("POST",t,e)},send:function(e,i,a){return p.open(e,t,!0,g,v),null==u||d.has("accept")||d.set("accept",u+",*/*"),p.setRequestHeader&&d.each((function(t,e){p.setRequestHeader(e,t)})),null!=u&&p.overrideMimeType&&p.overrideMimeType(u),null!=f&&(p.responseType=f),b>0&&(p.timeout=b),null==a&&"function"==typeof i&&(a=i,i=null),null!=a&&1===a.length&&(a=function fixCallback(t){return function(e,n){t(null==e?n:null)}}(a)),null!=a&&n.on("error",a).on("load",(function(t){a(null,t)})),h.call("beforesend",n,p),p.send(null==i?null:i),n},abort:function(){return p.abort(),n},on:function(){var t=h.on.apply(h,arguments);return t===h?n:t}},null!=e){if("function"!=typeof e)throw new Error("invalid callback: "+e);return n.get(e)}return n};var type=function(t,e){return function(n,i){var a=request(n).mimeType(t).response(e);if(null!=i){if("function"!=typeof i)throw new Error("invalid callback: "+i);return a.get(i)}return a}},c=type("text/html",(function(t){return document.createRange().createContextualFragment(t.responseText)})),f=type("application/json",(function(t){return JSON.parse(t.responseText)})),h=type("text/plain",(function(t){return t.responseText})),d=type("application/xml",(function(t){var e=t.responseXML;if(!e)throw new Error("parse error");return e})),dsv=function(t,e){return function(n,i,a){arguments.length<3&&(a=i,i=null);var s=request(n).mimeType(t);return s.row=function(t){return arguments.length?s.response(function responseOf(t,e){return function(n){return t(n.responseText,e)}}(e,i=t)):i},s.row(i),a?s.get(a):s}};var p=dsv("text/csv",u.csvParse),g=dsv("text/tab-separated-values",u.tsvParse);n.request=request,n.html=c,n.json=f,n.text=h,n.xml=d,n.csv=p,n.tsv=g},{"d3-collection":43,"d3-dispatch":45,"d3-dsv":61,xmlhttprequest:109}],61:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){var e={},n={};function objectConverter(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function inferColumns(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var i in t)i in e||n.push(e[i]=i)})),n}function pad(t,e){var n=t+"",i=n.length;return i9999?"+"+pad(t,6):pad(t,4)}(t.getUTCFullYear())+"-"+pad(t.getUTCMonth()+1,2)+"-"+pad(t.getUTCDate(),2)+(a?"T"+pad(e,2)+":"+pad(n,2)+":"+pad(i,2)+"."+pad(a,3)+"Z":i?"T"+pad(e,2)+":"+pad(n,2)+":"+pad(i,2)+"Z":n||e?"T"+pad(e,2)+":"+pad(n,2)+"Z":"")}function dsv(t){var i=new RegExp('["'+t+"\n\r]"),a=t.charCodeAt(0);function parseRows(t,i){var s,u=[],c=t.length,f=0,h=0,d=c<=0,p=!1;function token(){if(d)return n;if(p)return p=!1,e;var i,s,u=f;if(34===t.charCodeAt(u)){for(;f++=c?d=!0:10===(s=t.charCodeAt(f++))?p=!0:13===s&&(p=!0,10===t.charCodeAt(f)&&++f),t.slice(u+1,i-1).replace(/""/g,'"')}for(;f2?polymap:bimap,a=s=null,scale}function scale(e){return(a||(a=n(u,c,p?function deinterpolateClamp(t){return function(e,n){var i=t(e=+e,n=+n);return function(t){return t<=e?0:t>=n?1:i(t)}}}(t):t,f)))(+e)}return scale.invert=function(t){return(s||(s=n(c,u,deinterpolateLinear,p?function reinterpolateClamp(t){return function(e,n){var i=t(e=+e,n=+n);return function(t){return t<=0?e:t>=1?n:i(t)}}}(e):e)))(+t)},scale.domain=function(t){return arguments.length?(u=h.call(t,number),rescale()):u.slice()},scale.range=function(t){return arguments.length?(c=d.call(t),rescale()):c.slice()},scale.rangeRound=function(t){return c=d.call(t),f=i.interpolateRound,rescale()},scale.clamp=function(t){return arguments.length?(p=!!t,rescale()):p},scale.interpolate=function(t){return arguments.length?(f=t,rescale()):f},rescale()}function linearish(t){var n=t.domain;return t.ticks=function(t){var i=n();return e.ticks(i[0],i[i.length-1],null==t?10:t)},t.tickFormat=function(t,i){return function(t,n,i){var s,u=t[0],c=t[t.length-1],f=e.tickStep(u,c,null==n?10:n);switch((i=a.formatSpecifier(null==i?",f":i)).type){case"s":var h=Math.max(Math.abs(u),Math.abs(c));return null!=i.precision||isNaN(s=a.precisionPrefix(f,h))||(i.precision=s),a.formatPrefix(i,h);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(s=a.precisionRound(f,Math.max(Math.abs(u),Math.abs(c))))||(i.precision=s-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(s=a.precisionFixed(f))||(i.precision=s-2*("%"===i.type))}return a.format(i)}(n(),t,i)},t.nice=function(i){null==i&&(i=10);var a,s=n(),u=0,c=s.length-1,f=s[u],h=s[c];return h0?(f=Math.floor(f/a)*a,h=Math.ceil(h/a)*a,a=e.tickIncrement(f,h,i)):a<0&&(f=Math.ceil(f*a)/a,h=Math.floor(h*a)/a,a=e.tickIncrement(f,h,i)),a>0?(s[u]=Math.floor(f/a)*a,s[c]=Math.ceil(h/a)*a,n(s)):a<0&&(s[u]=Math.ceil(f*a)/a,s[c]=Math.floor(h*a)/a,n(s)),t},t}var nice=function(t,e){var n,i=0,a=(t=t.slice()).length-1,s=t[i],u=t[a];return u0){for(;vh)break;w.push(g)}}else for(;v=1;--p)if(!((g=d*p)h)break;w.push(g)}}else w=e.ticks(v,b,Math.min(b-v,_)).map(u);return a?w.reverse():w},t.tickFormat=function(e,n){if(null==n&&(n=10===i?".0e":","),"function"!=typeof n&&(n=a.format(n)),e===1/0)return n;null==e&&(e=10);var c=Math.max(1,i*e/t.ticks().length);return function(t){var e=t/u(Math.round(s(t)));return e*i0?i[a-1]:t[0],a=i?[a[i-1],n]:[a[u-1],a[u]]},scale.copy=function(){return quantize().domain([t,n]).range(s)},linearish(scale)},t.scaleThreshold=function threshold(){var t=[.5],n=[0,1],i=1;function scale(a){if(a<=a)return n[e.bisect(t,a,0,i)]}return scale.domain=function(e){return arguments.length?(t=d.call(e),i=Math.min(t.length,n.length-1),scale):t.slice()},scale.range=function(e){return arguments.length?(n=d.call(e),i=Math.min(t.length,n.length-1),scale):n.slice()},scale.invertExtent=function(e){var i=n.indexOf(e);return[t[i-1],t[i]]},scale.copy=function(){return threshold().domain(t).range(n)},scale},t.scaleTime=function(){return calendar(s.timeYear,s.timeMonth,s.timeWeek,s.timeDay,s.timeHour,s.timeMinute,s.timeSecond,s.timeMillisecond,u.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)])},t.scaleUtc=function(){return calendar(s.utcYear,s.utcMonth,s.utcWeek,s.utcDay,s.utcHour,s.utcMinute,s.utcSecond,s.utcMillisecond,u.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])},t.schemeCategory10=T,t.schemeCategory20b=S,t.schemeCategory20c=k,t.schemeCategory20=C,t.interpolateCubehelixDefault=R,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return O.h=360*t-100,O.s=1.5-1.5*e,O.l=.8-.9*e,O+""},t.interpolateWarm=N,t.interpolateCool=A,t.interpolateViridis=j,t.interpolateMagma=L,t.interpolateInferno=P,t.interpolatePlasma=U,t.scaleSequential=function sequential(t){var e=0,n=1,i=!1;function scale(a){var s=(a-e)/(n-e);return t(i?Math.max(0,Math.min(1,s)):s)}return scale.domain=function(t){return arguments.length?(e=+t[0],n=+t[1],scale):[e,n]},scale.clamp=function(t){return arguments.length?(i=!!t,scale):i},scale.interpolator=function(e){return arguments.length?(t=e,scale):t},scale.copy=function(){return sequential(t).domain([e,n]).clamp(i)},linearish(scale)},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":39,"d3-collection":43,"d3-color":44,"d3-format":63,"d3-interpolate":54,"d3-time":68,"d3-time-format":64}],63:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){function formatDecimal(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function exponent(t){return(t=formatDecimal(Math.abs(t)))?t[1]:NaN}var e,n=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(t){if(!(e=n.exec(t)))throw new Error("invalid format: "+t);var e;return new FormatSpecifier({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function FormatSpecifier(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function formatRounded(t,e){var n=formatDecimal(t,e);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var i={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return formatRounded(100*t,e)},r:formatRounded,s:function formatPrefixAuto(t,n){var i=formatDecimal(t,n);if(!i)return t+"";var a=i[0],s=i[1],u=s-(e=3*Math.max(-8,Math.min(8,Math.floor(s/3))))+1,c=a.length;return u===c?a:u>c?a+new Array(u-c+1).join("0"):u>0?a.slice(0,u)+"."+a.slice(u):"0."+new Array(1-u).join("0")+formatDecimal(t,Math.max(0,n+u-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function identity(t){return t}var a,s=Array.prototype.map,u=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function formatLocale(t){var n=void 0===t.grouping||void 0===t.thousands?identity:function formatGroup(t,e){return function(n,i){for(var a=n.length,s=[],u=0,c=t[0],f=0;a>0&&c>0&&(f+c+1>i&&(c=Math.max(1,i-f)),s.push(n.substring(a-=c,a+c)),!((f+=c+1)>i));)c=t[u=(u+1)%t.length];return s.reverse().join(e)}}(s.call(t.grouping,Number),t.thousands+""),a=void 0===t.currency?"":t.currency[0]+"",c=void 0===t.currency?"":t.currency[1]+"",f=void 0===t.decimal?".":t.decimal+"",h=void 0===t.numerals?identity:function formatNumerals(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(s.call(t.numerals,String)),d=void 0===t.percent?"%":t.percent+"",p=void 0===t.minus?"-":t.minus+"",g=void 0===t.nan?"NaN":t.nan+"";function newFormat(t){var s=(t=formatSpecifier(t)).fill,v=t.align,b=t.sign,_=t.symbol,w=t.zero,M=t.width,E=t.comma,T=t.precision,S=t.trim,k=t.type;"n"===k?(E=!0,k="g"):i[k]||(void 0===T&&(T=12),S=!0,k="g"),(w||"0"===s&&"="===v)&&(w=!0,s="0",v="=");var C="$"===_?a:"#"===_&&/[boxX]/.test(k)?"0"+k.toLowerCase():"",R="$"===_?c:/[%p]/.test(k)?d:"",N=i[k],A=/[defgprs%]/.test(k);function format(t){var i,a,c,d=C,_=R;if("c"===k)_=N(t)+_,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?g:N(Math.abs(t),T),S&&(t=function formatTrim(t){t:for(var e,n=t.length,i=1,a=-1;i0&&(a=0)}return a>0?t.slice(0,a)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==b&&(O=!1),d=(O?"("===b?b:p:"-"===b||"("===b?"":b)+d,_=("s"===k?u[8+e/3]:"")+_+(O&&"("===b?")":""),A)for(i=-1,a=t.length;++i(c=t.charCodeAt(i))||c>57){_=(46===c?f+t.slice(i+1):t.slice(i))+_,t=t.slice(0,i);break}}E&&!w&&(t=n(t,1/0));var j=d.length+t.length+_.length,L=j>1)+d+t+_+L.slice(j);break;default:t=L+d+t+_}return h(t)}return T=void 0===T?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T)),format.toString=function(){return t+""},format}return{format:newFormat,formatPrefix:function formatPrefix(t,e){var n=newFormat(((t=formatSpecifier(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(exponent(e)/3))),a=Math.pow(10,-i),s=u[8+i/3];return function(t){return n(a*t)+s}}}}function defaultLocale(e){return a=formatLocale(e),t.format=a.format,t.formatPrefix=a.formatPrefix,a}defaultLocale({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=FormatSpecifier,t.formatDefaultLocale=defaultLocale,t.formatLocale=formatLocale,t.formatSpecifier=formatSpecifier,t.precisionFixed=function precisionFixed(t){return Math.max(0,-exponent(Math.abs(t)))},t.precisionPrefix=function precisionPrefix(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(exponent(e)/3)))-exponent(Math.abs(t)))},t.precisionRound=function precisionRound(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,exponent(e)-exponent(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],64:[function(t,e,n){!function(i,a){"object"==typeof n&&void 0!==e?a(n,t("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-time"],a):a((i=i||self).d3=i.d3||{},i.d3)}(this,(function(t,e){function localDate(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function utcDate(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function newDate(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function formatLocale(t){var n=t.dateTime,a=t.date,s=t.time,u=t.periods,c=t.days,f=t.shortDays,h=t.months,d=t.shortMonths,p=formatRe(u),g=formatLookup(u),v=formatRe(c),b=formatLookup(c),_=formatRe(f),w=formatLookup(f),M=formatRe(h),E=formatLookup(h),T=formatRe(d),S=formatLookup(d),k={a:function formatShortWeekday(t){return f[t.getDay()]},A:function formatWeekday(t){return c[t.getDay()]},b:function formatShortMonth(t){return d[t.getMonth()]},B:function formatMonth(t){return h[t.getMonth()]},c:null,d:formatDayOfMonth,e:formatDayOfMonth,f:formatMicroseconds,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:function formatPeriod(t){return u[+(t.getHours()>=12)]},q:function formatQuarter(t){return 1+~~(t.getMonth()/3)},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},C={a:function formatUTCShortWeekday(t){return f[t.getUTCDay()]},A:function formatUTCWeekday(t){return c[t.getUTCDay()]},b:function formatUTCShortMonth(t){return d[t.getUTCMonth()]},B:function formatUTCMonth(t){return h[t.getUTCMonth()]},c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:function formatUTCPeriod(t){return u[+(t.getUTCHours()>=12)]},q:function formatUTCQuarter(t){return 1+~~(t.getUTCMonth()/3)},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},R={a:function parseShortWeekday(t,e,n){var i=_.exec(e.slice(n));return i?(t.w=w[i[0].toLowerCase()],n+i[0].length):-1},A:function parseWeekday(t,e,n){var i=v.exec(e.slice(n));return i?(t.w=b[i[0].toLowerCase()],n+i[0].length):-1},b:function parseShortMonth(t,e,n){var i=T.exec(e.slice(n));return i?(t.m=S[i[0].toLowerCase()],n+i[0].length):-1},B:function parseMonth(t,e,n){var i=M.exec(e.slice(n));return i?(t.m=E[i[0].toLowerCase()],n+i[0].length):-1},c:function parseLocaleDateTime(t,e,i){return parseSpecifier(t,n,e,i)},d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:function parsePeriod(t,e,n){var i=p.exec(e.slice(n));return i?(t.p=g[i[0].toLowerCase()],n+i[0].length):-1},q:parseQuarter,Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:function parseLocaleDate(t,e,n){return parseSpecifier(t,a,e,n)},X:function parseLocaleTime(t,e,n){return parseSpecifier(t,s,e,n)},y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};function newFormat(t,e){return function(n){var a,s,u,c=[],f=-1,h=0,d=t.length;for(n instanceof Date||(n=new Date(+n));++f53)return null;"w"in u||(u.w=1),"Z"in u?(s=(a=utcDate(newDate(u.y,0,1))).getUTCDay(),a=s>4||0===s?e.utcMonday.ceil(a):e.utcMonday(a),a=e.utcDay.offset(a,7*(u.V-1)),u.y=a.getUTCFullYear(),u.m=a.getUTCMonth(),u.d=a.getUTCDate()+(u.w+6)%7):(s=(a=localDate(newDate(u.y,0,1))).getDay(),a=s>4||0===s?e.timeMonday.ceil(a):e.timeMonday(a),a=e.timeDay.offset(a,7*(u.V-1)),u.y=a.getFullYear(),u.m=a.getMonth(),u.d=a.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),s="Z"in u?utcDate(newDate(u.y,0,1)).getUTCDay():localDate(newDate(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(s+5)%7:u.w+7*u.U-(s+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,utcDate(u)):localDate(u)}}function parseSpecifier(t,e,n,a){for(var s,u,c=0,f=e.length,h=n.length;c=h)return-1;if(37===(s=e.charCodeAt(c++))){if(s=e.charAt(c++),!(u=R[s in i?e.charAt(c++):s])||(a=u(t,n,a))<0)return-1}else if(s!=n.charCodeAt(a++))return-1}return a}return k.x=newFormat(a,k),k.X=newFormat(s,k),k.c=newFormat(n,k),C.x=newFormat(a,C),C.X=newFormat(s,C),C.c=newFormat(n,C),{format:function(t){var e=newFormat(t+="",k);return e.toString=function(){return t},e},parse:function(t){var e=newParse(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=newFormat(t+="",C);return e.toString=function(){return t},e},utcParse:function(t){var e=newParse(t+="",!0);return e.toString=function(){return t},e}}}var n,i={"-":"",_:" ",0:"0"},a=/^\s*\d+/,s=/^%/,u=/[\\^$*+?|[\]().{}]/g;function pad(t,e,n){var i=t<0?"-":"",a=(i?-t:t)+"",s=a.length;return i+(s68?1900:2e3),n+i[0].length):-1}function parseZone(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function parseQuarter(t,e,n){var i=a.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function parseMonthNumber(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function parseDayOfMonth(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function parseDayOfYear(t,e,n){var i=a.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function parseHour24(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function parseMinutes(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function parseSeconds(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function parseMilliseconds(t,e,n){var i=a.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function parseMicroseconds(t,e,n){var i=a.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function parseLiteralPercent(t,e,n){var i=s.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function parseUnixTimestamp(t,e,n){var i=a.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function parseUnixTimestampSeconds(t,e,n){var i=a.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function formatDayOfMonth(t,e){return pad(t.getDate(),e,2)}function formatHour24(t,e){return pad(t.getHours(),e,2)}function formatHour12(t,e){return pad(t.getHours()%12||12,e,2)}function formatDayOfYear(t,n){return pad(1+e.timeDay.count(e.timeYear(t),t),n,3)}function formatMilliseconds(t,e){return pad(t.getMilliseconds(),e,3)}function formatMicroseconds(t,e){return formatMilliseconds(t,e)+"000"}function formatMonthNumber(t,e){return pad(t.getMonth()+1,e,2)}function formatMinutes(t,e){return pad(t.getMinutes(),e,2)}function formatSeconds(t,e){return pad(t.getSeconds(),e,2)}function formatWeekdayNumberMonday(t){var e=t.getDay();return 0===e?7:e}function formatWeekNumberSunday(t,n){return pad(e.timeSunday.count(e.timeYear(t)-1,t),n,2)}function formatWeekNumberISO(t,n){var i=t.getDay();return t=i>=4||0===i?e.timeThursday(t):e.timeThursday.ceil(t),pad(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),n,2)}function formatWeekdayNumberSunday(t){return t.getDay()}function formatWeekNumberMonday(t,n){return pad(e.timeMonday.count(e.timeYear(t)-1,t),n,2)}function formatYear(t,e){return pad(t.getFullYear()%100,e,2)}function formatFullYear(t,e){return pad(t.getFullYear()%1e4,e,4)}function formatZone(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+pad(e/60|0,"0",2)+pad(e%60,"0",2)}function formatUTCDayOfMonth(t,e){return pad(t.getUTCDate(),e,2)}function formatUTCHour24(t,e){return pad(t.getUTCHours(),e,2)}function formatUTCHour12(t,e){return pad(t.getUTCHours()%12||12,e,2)}function formatUTCDayOfYear(t,n){return pad(1+e.utcDay.count(e.utcYear(t),t),n,3)}function formatUTCMilliseconds(t,e){return pad(t.getUTCMilliseconds(),e,3)}function formatUTCMicroseconds(t,e){return formatUTCMilliseconds(t,e)+"000"}function formatUTCMonthNumber(t,e){return pad(t.getUTCMonth()+1,e,2)}function formatUTCMinutes(t,e){return pad(t.getUTCMinutes(),e,2)}function formatUTCSeconds(t,e){return pad(t.getUTCSeconds(),e,2)}function formatUTCWeekdayNumberMonday(t){var e=t.getUTCDay();return 0===e?7:e}function formatUTCWeekNumberSunday(t,n){return pad(e.utcSunday.count(e.utcYear(t)-1,t),n,2)}function formatUTCWeekNumberISO(t,n){var i=t.getUTCDay();return t=i>=4||0===i?e.utcThursday(t):e.utcThursday.ceil(t),pad(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),n,2)}function formatUTCWeekdayNumberSunday(t){return t.getUTCDay()}function formatUTCWeekNumberMonday(t,n){return pad(e.utcMonday.count(e.utcYear(t)-1,t),n,2)}function formatUTCYear(t,e){return pad(t.getUTCFullYear()%100,e,2)}function formatUTCFullYear(t,e){return pad(t.getUTCFullYear()%1e4,e,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(t){return+t}function formatUnixTimestampSeconds(t){return Math.floor(+t/1e3)}function defaultLocale(e){return n=formatLocale(e),t.timeFormat=n.format,t.timeParse=n.parse,t.utcFormat=n.utcFormat,t.utcParse=n.utcParse,n}defaultLocale({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var c="%Y-%m-%dT%H:%M:%S.%LZ";var f=Date.prototype.toISOString?function formatIsoNative(t){return t.toISOString()}:t.utcFormat(c);var h=+new Date("2000-01-01T00:00:00.000Z")?function parseIsoNative(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(c);t.isoFormat=f,t.isoParse=h,t.timeFormatDefaultLocale=defaultLocale,t.timeFormatLocale=formatLocale,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":68}],65:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){var e="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function namespace(t){var e=t+="",i=e.indexOf(":");return i>=0&&"xmlns"!==(e=t.slice(0,i))&&(t=t.slice(i+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function creatorInherit(t){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===e&&n.documentElement.namespaceURI===e?n.createElement(t):n.createElementNS(i,t)}}function creatorFixed(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function creator(t){var e=namespace(t);return(e.local?creatorFixed:creatorInherit)(e)}function none(){}function selector(t){return null==t?none:function(){return this.querySelector(t)}}function empty(){return[]}function selectorAll(t){return null==t?empty:function(){return this.querySelectorAll(t)}}function matcher(t){return function(){return this.matches(t)}}function sparse(t){return new Array(t.length)}function EnterNode(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}EnterNode.prototype={constructor:EnterNode,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function bindIndex(t,e,n,i,a,s){for(var u,c=0,f=e.length,h=s.length;ce?1:t>=e?0:NaN}function attrRemove(t){return function(){this.removeAttribute(t)}}function attrRemoveNS(t){return function(){this.removeAttributeNS(t.space,t.local)}}function attrConstant(t,e){return function(){this.setAttribute(t,e)}}function attrConstantNS(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function attrFunction(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function attrFunctionNS(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function defaultView(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function styleRemove(t){return function(){this.style.removeProperty(t)}}function styleConstant(t,e,n){return function(){this.style.setProperty(t,e,n)}}function styleFunction(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function styleValue(t,e){return t.style.getPropertyValue(e)||defaultView(t).getComputedStyle(t,null).getPropertyValue(e)}function propertyRemove(t){return function(){delete this[t]}}function propertyConstant(t,e){return function(){this[t]=e}}function propertyFunction(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function classArray(t){return t.trim().split(/^|\s+/)}function classList(t){return t.classList||new ClassList(t)}function ClassList(t){this._node=t,this._names=classArray(t.getAttribute("class")||"")}function classedAdd(t,e){for(var n=classList(t),i=-1,a=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var i={};(t.event=null,"undefined"!=typeof document)&&("onmouseenter"in document.documentElement||(i={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(t,e,n){return t=contextListener(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function contextListener(e,n,i){return function(a){var s=t.event;t.event=a;try{e.call(this,this.__data__,n,i)}finally{t.event=s}}}function onRemove(t){return function(){var e=this.__on;if(e){for(var n,i=0,a=-1,s=e.length;i=S&&(S=T+1);!(E=w[S])&&++S=0;)(i=a[s])&&(u&&4^i.compareDocumentPosition(u)&&u.parentNode.insertBefore(i,u),u=i);return this},sort:function selection_sort(t){function compareNode(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ascending);for(var e=this._groups,n=e.length,i=new Array(n),a=0;a1?this.each((null==e?styleRemove:"function"==typeof e?styleFunction:styleConstant)(t,e,null==n?"":n)):styleValue(this.node(),t)},property:function selection_property(t,e){return arguments.length>1?this.each((null==e?propertyRemove:"function"==typeof e?propertyFunction:propertyConstant)(t,e)):this.node()[t]},classed:function selection_classed(t,e){var n=classArray(t+"");if(arguments.length<2){for(var i=classList(this.node()),a=-1,s=n.length;++a=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),u=s.length;if(!(arguments.length<2)){for(c=e?onAdd:onRemove,null==n&&(n=!1),i=0;i=1?p:t<=-1?-p:Math.asin(t)}function arcInnerRadius(t){return t.innerRadius}function arcOuterRadius(t){return t.outerRadius}function arcStartAngle(t){return t.startAngle}function arcEndAngle(t){return t.endAngle}function arcPadAngle(t){return t&&t.padAngle}function cornerTangents(t,e,n,i,a,u,c){var h=t-n,d=e-i,p=(c?u:-u)/f(h*h+d*d),g=p*d,v=-p*h,b=t+g,_=e+v,w=n+g,M=i+v,E=(b+w)/2,T=(_+M)/2,S=w-b,k=M-_,C=S*S+k*k,R=a-u,N=b*M-w*_,A=(k<0?-1:1)*f(s(0,R*R*C-N*N)),O=(N*k-S*A)/C,j=(-N*S-k*A)/C,L=(N*k+S*A)/C,P=(-N*S+k*A)/C,U=O-E,I=j-T,D=L-E,q=P-T;return U*U+I*I>D*D+q*q&&(O=L,j=P),{cx:O,cy:j,x01:-g,y01:-v,x11:O*(a/R-1),y11:j*(a/R-1)}}function Linear(t){this._context=t}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var curveLinear=function(t){return new Linear(t)};function x(t){return t[0]}function y(t){return t[1]}var line=function(){var t=x,n=y,i=constant(!0),a=null,s=curveLinear,u=null;function line(c){var f,h,d,p=c.length,g=!1;for(null==a&&(u=s(d=e.path())),f=0;f<=p;++f)!(f=p;--g)f.point(M[g],E[g]);f.lineEnd(),f.areaEnd()}w&&(M[d]=+t(v,d,h),E[d]=+i(v,d,h),f.point(n?+n(v,d,h):M[d],a?+a(v,d,h):E[d]))}if(b)return f=null,b+""||null}function arealine(){return line().defined(s).curve(c).context(u)}return area.x=function(e){return arguments.length?(t="function"==typeof e?e:constant(+e),n=null,area):t},area.x0=function(e){return arguments.length?(t="function"==typeof e?e:constant(+e),area):t},area.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:constant(+t),area):n},area.y=function(t){return arguments.length?(i="function"==typeof t?t:constant(+t),a=null,area):i},area.y0=function(t){return arguments.length?(i="function"==typeof t?t:constant(+t),area):i},area.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:constant(+t),area):a},area.lineX0=area.lineY0=function(){return arealine().x(t).y(i)},area.lineY1=function(){return arealine().x(t).y(a)},area.lineX1=function(){return arealine().x(n).y(i)},area.defined=function(t){return arguments.length?(s="function"==typeof t?t:constant(!!t),area):s},area.curve=function(t){return arguments.length?(c=t,null!=u&&(f=c(u)),area):c},area.context=function(t){return arguments.length?(null==t?u=f=null:f=c(u=t),area):u},area},descending=function(t,e){return et?1:e>=t?0:NaN},identity=function(t){return t},v=curveRadial(curveLinear);function Radial(t){this._curve=t}function curveRadial(t){function radial(e){return new Radial(t(e))}return radial._curve=t,radial}function lineRadial(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(curveRadial(t)):e()._curve},t}Radial.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var lineRadial$1=function(){return lineRadial(line().curve(v))},areaRadial=function(){var t=area().curve(v),e=t.curve,n=t.lineX0,i=t.lineX1,a=t.lineY0,s=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return lineRadial(n())},delete t.lineX0,t.lineEndAngle=function(){return lineRadial(i())},delete t.lineX1,t.lineInnerRadius=function(){return lineRadial(a())},delete t.lineY0,t.lineOuterRadius=function(){return lineRadial(s())},delete t.lineY1,t.curve=function(t){return arguments.length?e(curveRadial(t)):e()._curve},t},pointRadial=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]},b=Array.prototype.slice;function linkSource(t){return t.source}function linkTarget(t){return t.target}function link(t){var n=linkSource,i=linkTarget,a=x,s=y,u=null;function link(){var c,f=b.call(arguments),h=n.apply(this,f),d=i.apply(this,f);if(u||(u=c=e.path()),t(u,+a.apply(this,(f[0]=h,f)),+s.apply(this,f),+a.apply(this,(f[0]=d,f)),+s.apply(this,f)),c)return u=null,c+""||null}return link.source=function(t){return arguments.length?(n=t,link):n},link.target=function(t){return arguments.length?(i=t,link):i},link.x=function(t){return arguments.length?(a="function"==typeof t?t:constant(+t),link):a},link.y=function(t){return arguments.length?(s="function"==typeof t?t:constant(+t),link):s},link.context=function(t){return arguments.length?(u=null==t?null:t,link):u},link}function curveHorizontal(t,e,n,i,a){t.moveTo(e,n),t.bezierCurveTo(e=(e+i)/2,n,e,a,i,a)}function curveVertical(t,e,n,i,a){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+a)/2,i,n,i,a)}function curveRadial$1(t,e,n,i,a){var s=pointRadial(e,n),u=pointRadial(e,n=(n+a)/2),c=pointRadial(i,n),f=pointRadial(i,a);t.moveTo(s[0],s[1]),t.bezierCurveTo(u[0],u[1],c[0],c[1],f[0],f[1])}var _={draw:function(t,e){var n=Math.sqrt(e/d);t.moveTo(n,0),t.arc(0,0,n,0,g)}},w={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},M=Math.sqrt(1/3),E=2*M,T={draw:function(t,e){var n=Math.sqrt(e/E),i=n*M;t.moveTo(0,-n),t.lineTo(i,0),t.lineTo(0,n),t.lineTo(-i,0),t.closePath()}},S=Math.sin(d/10)/Math.sin(7*d/10),k=Math.sin(g/10)*S,C=-Math.cos(g/10)*S,R={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),i=k*n,a=C*n;t.moveTo(0,-n),t.lineTo(i,a);for(var s=1;s<5;++s){var u=g*s/5,c=Math.cos(u),f=Math.sin(u);t.lineTo(f*n,-c*n),t.lineTo(c*i-f*a,f*i+c*a)}t.closePath()}},N={draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},A=Math.sqrt(3),O={draw:function(t,e){var n=-Math.sqrt(e/(3*A));t.moveTo(0,2*n),t.lineTo(-A*n,-n),t.lineTo(A*n,-n),t.closePath()}},j=-.5,L=Math.sqrt(3)/2,P=1/Math.sqrt(12),U=3*(P/2+1),I={draw:function(t,e){var n=Math.sqrt(e/U),i=n/2,a=n*P,s=i,u=n*P+n,c=-s,f=u;t.moveTo(i,a),t.lineTo(s,u),t.lineTo(c,f),t.lineTo(j*i-L*a,L*i+j*a),t.lineTo(j*s-L*u,L*s+j*u),t.lineTo(j*c-L*f,L*c+j*f),t.lineTo(j*i+L*a,j*a-L*i),t.lineTo(j*s+L*u,j*u-L*s),t.lineTo(j*c+L*f,j*f-L*c),t.closePath()}},D=[_,w,T,N,R,O,I],noop=function(){};function point(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Basis(t){this._context=t}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:point(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function BasisClosed(t){this._context=t}BasisClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:point(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function BasisOpen(t){this._context=t}BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:point(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Bundle(t,e){this._basis=new Basis(t),this._beta=e}Bundle.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,a=t[0],s=e[0],u=t[n]-a,c=e[n]-s,f=-1;++f<=n;)i=f/n,this._basis.point(this._beta*t[f]+(1-this._beta)*(a+i*u),this._beta*e[f]+(1-this._beta)*(s+i*c));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var q=function custom(t){function bundle(e){return 1===t?new Basis(e):new Bundle(e,t)}return bundle.beta=function(t){return custom(+t)},bundle}(.85);function point$1(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Cardinal(t,e){this._context=t,this._k=(1-e)/6}Cardinal.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:point$1(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:point$1(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var B=function custom(t){function cardinal(e){return new Cardinal(e,t)}return cardinal.tension=function(t){return custom(+t)},cardinal}(0);function CardinalClosed(t,e){this._context=t,this._k=(1-e)/6}CardinalClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:point$1(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var z=function custom(t){function cardinal(e){return new CardinalClosed(e,t)}return cardinal.tension=function(t){return custom(+t)},cardinal}(0);function CardinalOpen(t,e){this._context=t,this._k=(1-e)/6}CardinalOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:point$1(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var H=function custom(t){function cardinal(e){return new CardinalOpen(e,t)}return cardinal.tension=function(t){return custom(+t)},cardinal}(0);function point$2(t,e,n){var i=t._x1,a=t._y1,s=t._x2,u=t._y2;if(t._l01_a>h){var c=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,f=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*c-t._x0*t._l12_2a+t._x2*t._l01_2a)/f,a=(a*c-t._y0*t._l12_2a+t._y2*t._l01_2a)/f}if(t._l23_a>h){var d=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,p=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*d+t._x1*t._l23_2a-e*t._l12_2a)/p,u=(u*d+t._y1*t._l23_2a-n*t._l12_2a)/p}t._context.bezierCurveTo(i,a,s,u,t._x2,t._y2)}function CatmullRom(t,e){this._context=t,this._alpha=e}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:point$2(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var W=function custom(t){function catmullRom(e){return t?new CatmullRom(e,t):new Cardinal(e,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function CatmullRomClosed(t,e){this._context=t,this._alpha=e}CatmullRomClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:point$2(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var $=function custom(t){function catmullRom(e){return t?new CatmullRomClosed(e,t):new CardinalClosed(e,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function CatmullRomOpen(t,e){this._context=t,this._alpha=e}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:point$2(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var V=function custom(t){function catmullRom(e){return t?new CatmullRomOpen(e,t):new CardinalOpen(e,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function LinearClosed(t){this._context=t}LinearClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function sign(t){return t<0?-1:1}function slope3(t,e,n){var i=t._x1-t._x0,a=e-t._x1,s=(t._y1-t._y0)/(i||a<0&&-0),u=(n-t._y1)/(a||i<0&&-0),c=(s*a+u*i)/(i+a);return(sign(s)+sign(u))*Math.min(Math.abs(s),Math.abs(u),.5*Math.abs(c))||0}function slope2(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function point$3(t,e,n){var i=t._x0,a=t._y0,s=t._x1,u=t._y1,c=(s-i)/3;t._context.bezierCurveTo(i+c,a+c*e,s-c,u-c*n,s,u)}function MonotoneX(t){this._context=t}function MonotoneY(t){this._context=new ReflectContext(t)}function ReflectContext(t){this._context=t}function Natural(t){this._context=t}function controlPoints(t){var e,n,i=t.length-1,a=new Array(i),s=new Array(i),u=new Array(i);for(a[0]=0,s[0]=2,u[0]=t[0]+2*t[1],e=1;e=0;--e)a[e]=(u[e]-a[e+1])/s[e];for(s[i-1]=(t[i]+a[i-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var none=function(t,e){if((a=t.length)>1)for(var n,i,a,s=1,u=t[e[0]],c=u.length;s=0;)n[e]=e;return n};function stackValue(t,e){return t[e]}var ascending=function(t){var e=t.map(sum);return none$1(t).sort((function(t,n){return e[t]-e[n]}))};function sum(t){for(var e,n=0,i=-1,a=t.length;++iR;if(E||(E=T=e.path()),Ch)if(A>g-h)E.moveTo(C*a(R),C*c(R)),E.arc(0,0,C,R,N,!O),k>h&&(E.moveTo(k*a(N),k*c(N)),E.arc(0,0,k,N,R,O));else{var j,L,P=R,U=N,I=R,D=N,q=A,B=A,z=M.apply(this,arguments)/2,H=z>h&&(b?+b.apply(this,arguments):f(k*k+C*C)),W=u(n(C-k)/2,+v.apply(this,arguments)),$=W,V=W;if(H>h){var Z=asin(H/k*c(z)),G=asin(H/C*c(z));(q-=2*Z)>h?(I+=Z*=O?1:-1,D-=Z):(q=0,I=D=(R+N)/2),(B-=2*G)>h?(P+=G*=O?1:-1,U-=G):(B=0,P=U=(R+N)/2)}var Q=C*a(P),J=C*c(P),K=k*a(D),tt=k*c(D);if(W>h){var et=C*a(U),nt=C*c(U),rt=k*a(I),it=k*c(I);if(Ah?function intersect(t,e,n,i,a,s,u,c){var f=n-t,h=i-e,d=u-a,p=c-s,g=(d*(e-s)-p*(t-a))/(p*f-d*h);return[t+g*f,e+g*h]}(Q,J,rt,it,et,nt,K,tt):[K,tt],at=Q-ot[0],st=J-ot[1],ut=et-ot[0],ct=nt-ot[1],lt=1/c(function acos(t){return t>1?0:t<-1?d:Math.acos(t)}((at*ut+st*ct)/(f(at*at+st*st)*f(ut*ut+ct*ct)))/2),ft=f(ot[0]*ot[0]+ot[1]*ot[1]);$=u(W,(k-ft)/(lt-1)),V=u(W,(C-ft)/(lt+1))}}B>h?V>h?(j=cornerTangents(rt,it,Q,J,C,V,O),L=cornerTangents(et,nt,K,tt,C,V,O),E.moveTo(j.cx+j.x01,j.cy+j.y01),Vh&&q>h?$>h?(j=cornerTangents(K,tt,et,nt,k,-$,O),L=cornerTangents(Q,J,rt,it,k,-$,O),E.lineTo(j.cx+j.x01,j.cy+j.y01),$0&&(b+=p);for(null!=e?_.sort((function(t,n){return e(w[t],w[n])})):null!=n&&_.sort((function(t,e){return n(u[t],u[e])})),c=0,h=b?(E-v*S)/b:0;c0?p*h:0)+S,w[f]={data:u[f],index:c,value:p,startAngle:M,endAngle:d,padAngle:T};return w}return pie.value=function(e){return arguments.length?(t="function"==typeof e?e:constant(+e),pie):t},pie.sortValues=function(t){return arguments.length?(e=t,n=null,pie):e},pie.sort=function(t){return arguments.length?(n=t,e=null,pie):n},pie.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:constant(+t),pie):i},pie.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:constant(+t),pie):a},pie.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:constant(+t),pie):s},pie},t.areaRadial=areaRadial,t.radialArea=areaRadial,t.lineRadial=lineRadial$1,t.radialLine=lineRadial$1,t.pointRadial=pointRadial,t.linkHorizontal=function linkHorizontal(){return link(curveHorizontal)},t.linkVertical=function linkVertical(){return link(curveVertical)},t.linkRadial=function linkRadial(){var t=link(curveRadial$1);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=constant(_),n=constant(64),i=null;function symbol(){var a;if(i||(i=a=e.path()),t.apply(this,arguments).draw(i,+n.apply(this,arguments)),a)return i=null,a+""||null}return symbol.type=function(e){return arguments.length?(t="function"==typeof e?e:constant(e),symbol):t},symbol.size=function(t){return arguments.length?(n="function"==typeof t?t:constant(+t),symbol):n},symbol.context=function(t){return arguments.length?(i=null==t?null:t,symbol):i},symbol},t.symbols=D,t.symbolCircle=_,t.symbolCross=w,t.symbolDiamond=T,t.symbolSquare=N,t.symbolStar=R,t.symbolTriangle=O,t.symbolWye=I,t.curveBasisClosed=function(t){return new BasisClosed(t)},t.curveBasisOpen=function(t){return new BasisOpen(t)},t.curveBasis=function(t){return new Basis(t)},t.curveBundle=q,t.curveCardinalClosed=z,t.curveCardinalOpen=H,t.curveCardinal=B,t.curveCatmullRomClosed=$,t.curveCatmullRomOpen=V,t.curveCatmullRom=W,t.curveLinearClosed=function(t){return new LinearClosed(t)},t.curveLinear=curveLinear,t.curveMonotoneX=function monotoneX(t){return new MonotoneX(t)},t.curveMonotoneY=function monotoneY(t){return new MonotoneY(t)},t.curveNatural=function(t){return new Natural(t)},t.curveStep=function(t){return new Step(t,.5)},t.curveStepAfter=function stepAfter(t){return new Step(t,1)},t.curveStepBefore=function stepBefore(t){return new Step(t,0)},t.stack=function(){var t=constant([]),e=none$1,n=none,i=stackValue;function stack(a){var s,u,c=t.apply(this,arguments),f=a.length,h=c.length,d=new Array(h);for(s=0;s0){for(var n,i,a,s=0,u=t[0].length;s1)for(var n,i,a,s,u,c,f=0,h=t[e[0]].length;f=0?(i[0]=s,i[1]=s+=a):a<0?(i[1]=u,i[0]=u+=a):i[0]=s},t.stackOffsetNone=none,t.stackOffsetSilhouette=function(t,e){if((n=t.length)>0){for(var n,i=0,a=t[e[0]],s=a.length;i0&&(i=(n=t[e[0]]).length)>0){for(var n,i,a,s=0,u=1;u=12)]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},C={a:function formatUTCShortWeekday(t){return f[t.getUTCDay()]},A:function formatUTCWeekday(t){return c[t.getUTCDay()]},b:function formatUTCShortMonth(t){return d[t.getUTCMonth()]},B:function formatUTCMonth(t){return h[t.getUTCMonth()]},c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:function formatUTCPeriod(t){return u[+(t.getUTCHours()>=12)]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},R={a:function parseShortWeekday(t,e,n){var i=_.exec(e.slice(n));return i?(t.w=w[i[0].toLowerCase()],n+i[0].length):-1},A:function parseWeekday(t,e,n){var i=v.exec(e.slice(n));return i?(t.w=b[i[0].toLowerCase()],n+i[0].length):-1},b:function parseShortMonth(t,e,n){var i=T.exec(e.slice(n));return i?(t.m=S[i[0].toLowerCase()],n+i[0].length):-1},B:function parseMonth(t,e,n){var i=M.exec(e.slice(n));return i?(t.m=E[i[0].toLowerCase()],n+i[0].length):-1},c:function parseLocaleDateTime(t,e,i){return parseSpecifier(t,n,e,i)},d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:function parsePeriod(t,e,n){var i=p.exec(e.slice(n));return i?(t.p=g[i[0].toLowerCase()],n+i[0].length):-1},Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:function parseLocaleDate(t,e,n){return parseSpecifier(t,a,e,n)},X:function parseLocaleTime(t,e,n){return parseSpecifier(t,s,e,n)},y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};function newFormat(t,e){return function(n){var a,s,u,c=[],f=-1,h=0,d=t.length;for(n instanceof Date||(n=new Date(+n));++f53)return null;"w"in u||(u.w=1),"Z"in u?(s=(a=utcDate(newYear(u.y))).getUTCDay(),a=s>4||0===s?e.utcMonday.ceil(a):e.utcMonday(a),a=e.utcDay.offset(a,7*(u.V-1)),u.y=a.getUTCFullYear(),u.m=a.getUTCMonth(),u.d=a.getUTCDate()+(u.w+6)%7):(s=(a=n(newYear(u.y))).getDay(),a=s>4||0===s?e.timeMonday.ceil(a):e.timeMonday(a),a=e.timeDay.offset(a,7*(u.V-1)),u.y=a.getFullYear(),u.m=a.getMonth(),u.d=a.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),s="Z"in u?utcDate(newYear(u.y)).getUTCDay():n(newYear(u.y)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(s+5)%7:u.w+7*u.U-(s+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,utcDate(u)):n(u)}}function parseSpecifier(t,e,n,a){for(var s,u,c=0,f=e.length,h=n.length;c=h)return-1;if(37===(s=e.charCodeAt(c++))){if(s=e.charAt(c++),!(u=R[s in i?e.charAt(c++):s])||(a=u(t,n,a))<0)return-1}else if(s!=n.charCodeAt(a++))return-1}return a}return k.x=newFormat(a,k),k.X=newFormat(s,k),k.c=newFormat(n,k),C.x=newFormat(a,C),C.X=newFormat(s,C),C.c=newFormat(n,C),{format:function(t){var e=newFormat(t+="",k);return e.toString=function(){return t},e},parse:function(t){var e=newParse(t+="",localDate);return e.toString=function(){return t},e},utcFormat:function(t){var e=newFormat(t+="",C);return e.toString=function(){return t},e},utcParse:function(t){var e=newParse(t,utcDate);return e.toString=function(){return t},e}}}var n,i={"-":"",_:" ",0:"0"},a=/^\s*\d+/,s=/^%/,u=/[\\^$*+?|[\]().{}]/g;function pad(t,e,n){var i=t<0?"-":"",a=(i?-t:t)+"",s=a.length;return i+(s68?1900:2e3),n+i[0].length):-1}function parseZone(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function parseMonthNumber(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function parseDayOfMonth(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function parseDayOfYear(t,e,n){var i=a.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function parseHour24(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function parseMinutes(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function parseSeconds(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function parseMilliseconds(t,e,n){var i=a.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function parseMicroseconds(t,e,n){var i=a.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function parseLiteralPercent(t,e,n){var i=s.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function parseUnixTimestamp(t,e,n){var i=a.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function parseUnixTimestampSeconds(t,e,n){var i=a.exec(e.slice(n));return i?(t.Q=1e3*+i[0],n+i[0].length):-1}function formatDayOfMonth(t,e){return pad(t.getDate(),e,2)}function formatHour24(t,e){return pad(t.getHours(),e,2)}function formatHour12(t,e){return pad(t.getHours()%12||12,e,2)}function formatDayOfYear(t,n){return pad(1+e.timeDay.count(e.timeYear(t),t),n,3)}function formatMilliseconds(t,e){return pad(t.getMilliseconds(),e,3)}function formatMicroseconds(t,e){return formatMilliseconds(t,e)+"000"}function formatMonthNumber(t,e){return pad(t.getMonth()+1,e,2)}function formatMinutes(t,e){return pad(t.getMinutes(),e,2)}function formatSeconds(t,e){return pad(t.getSeconds(),e,2)}function formatWeekdayNumberMonday(t){var e=t.getDay();return 0===e?7:e}function formatWeekNumberSunday(t,n){return pad(e.timeSunday.count(e.timeYear(t),t),n,2)}function formatWeekNumberISO(t,n){var i=t.getDay();return t=i>=4||0===i?e.timeThursday(t):e.timeThursday.ceil(t),pad(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),n,2)}function formatWeekdayNumberSunday(t){return t.getDay()}function formatWeekNumberMonday(t,n){return pad(e.timeMonday.count(e.timeYear(t),t),n,2)}function formatYear(t,e){return pad(t.getFullYear()%100,e,2)}function formatFullYear(t,e){return pad(t.getFullYear()%1e4,e,4)}function formatZone(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+pad(e/60|0,"0",2)+pad(e%60,"0",2)}function formatUTCDayOfMonth(t,e){return pad(t.getUTCDate(),e,2)}function formatUTCHour24(t,e){return pad(t.getUTCHours(),e,2)}function formatUTCHour12(t,e){return pad(t.getUTCHours()%12||12,e,2)}function formatUTCDayOfYear(t,n){return pad(1+e.utcDay.count(e.utcYear(t),t),n,3)}function formatUTCMilliseconds(t,e){return pad(t.getUTCMilliseconds(),e,3)}function formatUTCMicroseconds(t,e){return formatUTCMilliseconds(t,e)+"000"}function formatUTCMonthNumber(t,e){return pad(t.getUTCMonth()+1,e,2)}function formatUTCMinutes(t,e){return pad(t.getUTCMinutes(),e,2)}function formatUTCSeconds(t,e){return pad(t.getUTCSeconds(),e,2)}function formatUTCWeekdayNumberMonday(t){var e=t.getUTCDay();return 0===e?7:e}function formatUTCWeekNumberSunday(t,n){return pad(e.utcSunday.count(e.utcYear(t),t),n,2)}function formatUTCWeekNumberISO(t,n){var i=t.getUTCDay();return t=i>=4||0===i?e.utcThursday(t):e.utcThursday.ceil(t),pad(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),n,2)}function formatUTCWeekdayNumberSunday(t){return t.getUTCDay()}function formatUTCWeekNumberMonday(t,n){return pad(e.utcMonday.count(e.utcYear(t),t),n,2)}function formatUTCYear(t,e){return pad(t.getUTCFullYear()%100,e,2)}function formatUTCFullYear(t,e){return pad(t.getUTCFullYear()%1e4,e,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(t){return+t}function formatUnixTimestampSeconds(t){return Math.floor(+t/1e3)}function defaultLocale(e){return n=formatLocale(e),t.timeFormat=n.format,t.timeParse=n.parse,t.utcFormat=n.utcFormat,t.utcParse=n.utcParse,n}defaultLocale({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var c="%Y-%m-%dT%H:%M:%S.%LZ";var f=Date.prototype.toISOString?function formatIsoNative(t){return t.toISOString()}:t.utcFormat(c);var h=+new Date("2000-01-01T00:00:00.000Z")?function parseIsoNative(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(c);t.timeFormatDefaultLocale=defaultLocale,t.timeFormatLocale=formatLocale,t.isoFormat=f,t.isoParse=h,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":68}],68:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){var e=new Date,n=new Date;function newInterval(t,i,a,s){function interval(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return interval.floor=function(e){return t(e=new Date(+e)),e},interval.ceil=function(e){return t(e=new Date(e-1)),i(e,1),t(e),e},interval.round=function(t){var e=interval(t),n=interval.ceil(t);return t-e0))return u;do{u.push(s=new Date(+e)),i(e,a),t(e)}while(s=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;i(t,-1),!e(t););else for(;--n>=0;)for(;i(t,1),!e(t););}))},a&&(interval.count=function(i,s){return e.setTime(+i),n.setTime(+s),t(e),t(n),Math.floor(a(e,n))},interval.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?interval.filter(s?function(e){return s(e)%t==0}:function(e){return interval.count(0,e)%t==0}):interval:null}),interval}var i=newInterval((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?newInterval((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):i:null};var a=i.range,s=1e3,u=6e4,c=36e5,f=864e5,h=6048e5,d=newInterval((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getUTCSeconds()})),p=d.range,g=newInterval((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*s)}),(function(t,e){t.setTime(+t+e*u)}),(function(t,e){return(e-t)/u}),(function(t){return t.getMinutes()})),v=g.range,b=newInterval((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*s-t.getMinutes()*u)}),(function(t,e){t.setTime(+t+e*c)}),(function(t,e){return(e-t)/c}),(function(t){return t.getHours()})),_=b.range,w=newInterval((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*u)/f}),(function(t){return t.getDate()-1})),M=w.range;function weekday(t){return newInterval((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*u)/h}))}var E=weekday(0),T=weekday(1),S=weekday(2),k=weekday(3),C=weekday(4),R=weekday(5),N=weekday(6),A=E.range,O=T.range,j=S.range,L=k.range,P=C.range,U=R.range,I=N.range,D=newInterval((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),q=D.range,B=newInterval((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));B.every=function(t){return isFinite(t=Math.floor(t))&&t>0?newInterval((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var z=B.range,H=newInterval((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*u)}),(function(t,e){return(e-t)/u}),(function(t){return t.getUTCMinutes()})),W=H.range,$=newInterval((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*c)}),(function(t,e){return(e-t)/c}),(function(t){return t.getUTCHours()})),V=$.range,Z=newInterval((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/f}),(function(t){return t.getUTCDate()-1})),G=Z.range;function utcWeekday(t){return newInterval((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/h}))}var Q=utcWeekday(0),J=utcWeekday(1),K=utcWeekday(2),tt=utcWeekday(3),et=utcWeekday(4),nt=utcWeekday(5),rt=utcWeekday(6),it=Q.range,ot=J.range,at=K.range,st=tt.range,ut=et.range,ct=nt.range,lt=rt.range,ft=newInterval((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),ht=ft.range,dt=newInterval((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));dt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?newInterval((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var pt=dt.range;t.timeDay=w,t.timeDays=M,t.timeFriday=R,t.timeFridays=U,t.timeHour=b,t.timeHours=_,t.timeInterval=newInterval,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=g,t.timeMinutes=v,t.timeMonday=T,t.timeMondays=O,t.timeMonth=D,t.timeMonths=q,t.timeSaturday=N,t.timeSaturdays=I,t.timeSecond=d,t.timeSeconds=p,t.timeSunday=E,t.timeSundays=A,t.timeThursday=C,t.timeThursdays=P,t.timeTuesday=S,t.timeTuesdays=j,t.timeWednesday=k,t.timeWednesdays=L,t.timeWeek=E,t.timeWeeks=A,t.timeYear=B,t.timeYears=z,t.utcDay=Z,t.utcDays=G,t.utcFriday=nt,t.utcFridays=ct,t.utcHour=$,t.utcHours=V,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=H,t.utcMinutes=W,t.utcMonday=J,t.utcMondays=ot,t.utcMonth=ft,t.utcMonths=ht,t.utcSaturday=rt,t.utcSaturdays=lt,t.utcSecond=d,t.utcSeconds=p,t.utcSunday=Q,t.utcSundays=it,t.utcThursday=et,t.utcThursdays=ut,t.utcTuesday=K,t.utcTuesdays=at,t.utcWednesday=tt,t.utcWednesdays=st,t.utcWeek=Q,t.utcWeeks=it,t.utcYear=dt,t.utcYears=pt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],69:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){var e,n,i=0,a=0,s=0,u=0,c=0,f=0,h="object"==typeof performance&&performance.now?performance:Date,d="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function now(){return c||(d(clearNow),c=h.now()+f)}function clearNow(){c=0}function Timer(){this._call=this._time=this._next=null}function timer(t,e,n){var i=new Timer;return i.restart(t,e,n),i}function timerFlush(){now(),++i;for(var t,n=e;n;)(t=c-n._time)>=0&&n._call.call(null,t),n=n._next;--i}function wake(){c=(u=h.now())+f,i=a=0;try{timerFlush()}finally{i=0,function nap(){var t,i,a=e,s=1/0;for(;a;)a._call?(s>a._time&&(s=a._time),t=a,a=a._next):(i=a._next,a._next=null,a=t?t._next=i:e=i);n=t,sleep(s)}(),c=0}}function poke(){var t=h.now(),e=t-u;e>1e3&&(f-=e,u=t)}function sleep(t){i||(a&&(a=clearTimeout(a)),t-c>24?(t<1/0&&(a=setTimeout(wake,t-h.now()-f)),s&&(s=clearInterval(s))):(s||(u=h.now(),s=setInterval(poke,1e3)),i=1,d(wake)))}Timer.prototype=timer.prototype={constructor:Timer,restart:function(t,i,a){if("function"!=typeof t)throw new TypeError("callback is not a function");a=(null==a?now():+a)+(null==i?0:+i),this._next||n===this||(n?n._next=this:e=this,n=this),this._call=t,this._time=a,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}},t.interval=function interval$1(t,e,n){var i=new Timer,a=e;return null==e?(i.restart(t,e,n),i):(e=+e,n=null==n?now():+n,i.restart((function tick(s){s+=a,i.restart(tick,a+=e,n),t(s)}),e,n),i)},t.now=now,t.timeout=function timeout$1(t,e,n){var i=new Timer;return e=null==e?0:+e,i.restart((function(n){i.stop(),t(n+e)}),e,n),i},t.timer=timer,t.timerFlush=timerFlush,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],70:[function(t,e,n){!function(i,a){"object"==typeof n&&void 0!==e?a(n,t("d3-selection"),t("d3-dispatch"),t("d3-timer"),t("d3-interpolate"),t("d3-color"),t("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-dispatch","d3-timer","d3-interpolate","d3-color","d3-ease"],a):a((i=i||self).d3=i.d3||{},i.d3,i.d3,i.d3,i.d3,i.d3,i.d3)}(this,(function(t,e,n,i,a,s,u){var c=n.dispatch("start","end","cancel","interrupt"),f=[];function schedule(t,e,n,a,s,u){var h=t.__transition;if(h){if(n in h)return}else t.__transition={};!function create(t,e,n){var a,s=t.__transition;function schedule(t){n.state=1,n.timer.restart(start,n.delay,n.time),n.delay<=t&&start(t-n.delay)}function start(u){var c,f,h,d;if(1!==n.state)return stop();for(c in s)if((d=s[c]).name===n.name){if(3===d.state)return i.timeout(start);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete s[c]):+c0)throw new Error("too late; already scheduled");return n}function set(t,e){var n=get(t,e);if(n.state>3)throw new Error("too late; already running");return n}function get(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function interrupt(t,e){var n,i,a,s=t.__transition,u=!0;if(s){for(a in e=null==e?null:e+"",s)(n=s[a]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete s[a]):u=!1;u&&delete t.__transition}}function tweenRemove(t,e){var n,i;return function(){var a=set(this,t),s=a.tween;if(s!==n)for(var u=0,c=(i=n=s).length;u=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?init:set;return function(){var u=s(this,t),c=u.on;c!==i&&(a=(i=c).copy()).on(e,n),u.on=a}}(n,t,e))},attr:function transition_attr(t,n){var i=e.namespace(t),s="transform"===i?a.interpolateTransformSvg:interpolate;return this.attrTween(t,"function"==typeof n?(i.local?attrFunctionNS:attrFunction)(i,s,tweenValue(this,"attr."+t,n)):null==n?(i.local?attrRemoveNS:attrRemove)(i):(i.local?attrConstantNS:attrConstant)(i,s,n))},attrTween:function transition_attrTween(t,n){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==n)return this.tween(i,null);if("function"!=typeof n)throw new Error;var a=e.namespace(t);return this.tween(i,(a.local?attrTweenNS:attrTween)(a,n))},style:function transition_style(t,n,i){var s="transform"==(t+="")?a.interpolateTransformCss:interpolate;return null==n?this.styleTween(t,function styleNull(t,n){var i,a,s;return function(){var u=e.style(this,t),c=(this.style.removeProperty(t),e.style(this,t));return u===c?null:u===i&&c===a?s:s=n(i=u,a=c)}}(t,s)).on("end.style."+t,styleRemove(t)):"function"==typeof n?this.styleTween(t,function styleFunction(t,n,i){var a,s,u;return function(){var c=e.style(this,t),f=i(this),h=f+"";return null==f&&(this.style.removeProperty(t),h=f=e.style(this,t)),c===h?null:c===a&&h===s?u:(s=h,u=n(a=c,f))}}(t,s,tweenValue(this,"style."+t,n))).each(function styleMaybeRemove(t,e){var n,i,a,s,u="style."+e,c="end."+u;return function(){var f=set(this,t),h=f.on,d=null==f.value[u]?s||(s=styleRemove(e)):void 0;h===n&&a===d||(i=(n=h).copy()).on(c,a=d),f.on=i}}(this._id,t)):this.styleTween(t,function styleConstant(t,n,i){var a,s,u=i+"";return function(){var c=e.style(this,t);return c===u?null:c===a?s:s=n(a=c,i)}}(t,s,n),i).on("end.style."+t,null)},styleTween:function transition_styleTween(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function styleTween(t,e,n){var i,a;function tween(){var s=e.apply(this,arguments);return s!==a&&(i=(a=s)&&function styleInterpolate(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,s,n)),i}return tween._value=e,tween}(t,e,null==n?"":n))},text:function transition_text(t){return this.tween("text","function"==typeof t?function textFunction(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(tweenValue(this,"text",t)):function textConstant(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function transition_textTween(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function textTween(t){var e,n;function tween(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function textInterpolate(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return tween._value=t,tween}(t))},remove:function transition_remove(){return this.on("end.remove",function removeFunction(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function transition_tween(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,a=get(this.node(),n).tween,s=0,u=a.length;s1&&n.name===e)return new Transition([[t]],v,e,+i);return null},t.interrupt=interrupt,t.transition=transition,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-color":44,"d3-dispatch":45,"d3-ease":48,"d3-interpolate":54,"d3-selection":65,"d3-timer":69}],71:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var constant=function(t){return function(){return t}};function x(t){return t[0]}function y(t){return t[1]}function RedBlackTree(){this._=null}function RedBlackNode(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function RedBlackRotateLeft(t,e){var n=e,i=e.R,a=n.U;a?a.L===n?a.L=i:a.R=i:t._=i,i.U=a,n.U=i,n.R=i.L,n.R&&(n.R.U=n),i.L=n}function RedBlackRotateRight(t,e){var n=e,i=e.L,a=n.U;a?a.L===n?a.L=i:a.R=i:t._=i,i.U=a,n.U=i,n.L=i.R,n.L&&(n.L.U=n),i.R=n}function RedBlackFirst(t){for(;t.L;)t=t.L;return t}function createEdge(t,e,n,i){var a=[null,null],u=c.push(a)-1;return a.left=t,a.right=e,n&&setEdgeEnd(a,t,e,n),i&&setEdgeEnd(a,e,t,i),s[t.index].halfedges.push(u),s[e.index].halfedges.push(u),a}function createBorderEdge(t,e,n){var i=[e,n];return i.left=t,i}function setEdgeEnd(t,e,n,i){t[0]||t[1]?t.left===n?t[1]=i:t[0]=i:(t[0]=i,t.left=e,t.right=n)}function clipEdge(t,e,n,i,a){var s,u=t[0],c=t[1],f=u[0],h=u[1],d=0,p=1,g=c[0]-f,v=c[1]-h;if(s=e-f,g||!(s>0)){if(s/=g,g<0){if(s0){if(s>p)return;s>d&&(d=s)}if(s=i-f,g||!(s<0)){if(s/=g,g<0){if(s>p)return;s>d&&(d=s)}else if(g>0){if(s0)){if(s/=v,v<0){if(s0){if(s>p)return;s>d&&(d=s)}if(s=a-h,v||!(s<0)){if(s/=v,v<0){if(s>p)return;s>d&&(d=s)}else if(v>0){if(s0||p<1)||(d>0&&(t[0]=[f+d*g,h+d*v]),p<1&&(t[1]=[f+p*g,h+p*v]),!0)}}}}}function connectEdge(t,e,n,i,a){var s=t[1];if(s)return!0;var u,c,f=t[0],h=t.left,d=t.right,p=h[0],g=h[1],v=d[0],b=d[1],_=(p+v)/2,w=(g+b)/2;if(b===g){if(_=i)return;if(p>v){if(f){if(f[1]>=a)return}else f=[_,n];s=[_,a]}else{if(f){if(f[1]1)if(p>v){if(f){if(f[1]>=a)return}else f=[(n-c)/u,n];s=[(a-c)/u,a]}else{if(f){if(f[1]=i)return}else f=[e,u*e+c];s=[i,u*i+c]}else{if(f){if(f[0]=-h)){var M=g*g+v*v,E=b*b+_*_,T=(_*M-v*E)/w,S=(g*E-b*M)/w,k=n.pop()||new Circle;k.arc=t,k.site=c,k.x=T+d,k.y=(k.cy=S+p)+Math.sqrt(T*T+S*S),t.circle=k;for(var C=null,R=u._;R;)if(k.yf)d=d.L;else{if(!((u=c-rightBreakPoint(d,h))>f)){i>-f?(e=d.P,n=d):u>-f?(e=d,n=d.N):e=n=d;break}if(!d.R){e=d;break}d=d.R}!function createCell(t){return s[t.index]={site:t,halfedges:[]}}(t);var p=createBeach(t);if(a.insert(e,p),e||n){if(e===n)return detachCircle(e),n=createBeach(e.site),a.insert(p,n),p.edge=n.edge=createEdge(e.site,p.site),attachCircle(e),void attachCircle(n);if(n){detachCircle(e),detachCircle(n);var g=e.site,v=g[0],b=g[1],_=t[0]-v,w=t[1]-b,M=n.site,E=M[0]-v,T=M[1]-b,S=2*(_*T-w*E),k=_*_+w*w,C=E*E+T*T,R=[(T*k-w*C)/S+v,(_*C-E*k)/S+b];setEdgeEnd(n.edge,g,M,R),p.edge=createEdge(g,t,null,R),n.edge=createEdge(t,M,null,R),attachCircle(e),attachCircle(n)}else p.edge=createEdge(e.site,p.site)}}function leftBreakPoint(t,e){var n=t.site,i=n[0],a=n[1],s=a-e;if(!s)return i;var u=t.P;if(!u)return-1/0;var c=(n=u.site)[0],f=n[1],h=f-e;if(!h)return c;var d=c-i,p=1/s-1/h,g=d/h;return p?(-g+Math.sqrt(g*g-2*p*(d*d/(-2*h)-f+h/2+a-s/2)))/p+i:(i+c)/2}function rightBreakPoint(t,e){var n=t.N;if(n)return leftBreakPoint(n,e);var i=t.site;return i[1]===e?i[0]:1/0}var a,s,u,c,f=1e-6,h=1e-12;function lexicographic(t,e){return e[1]-t[1]||e[0]-t[0]}function Diagram(t,n){var i,h,d,p=t.sort(lexicographic).pop();for(c=[],s=new Array(t.length),a=new RedBlackTree,u=new RedBlackTree;;)if(d=e,p&&(!d||p[1]f||Math.abs(a[0][1]-a[1][1])>f)||delete c[s]}(g,v,b,_),function clipCells(t,e,n,i){var a,u,h,d,p,g,v,b,_,w,M,E,T=s.length,S=!0;for(a=0;af||Math.abs(E-_)>f)&&(p.splice(d,0,c.push(createBorderEdge(h,w,Math.abs(M-t)f?[t,Math.abs(b-t)f?[Math.abs(_-i)f?[n,Math.abs(b-n)f?[Math.abs(_-e)=c)return null;var f=t-a.site[0],h=e-a.site[1],d=f*f+h*h;do{a=s.cells[i=u],u=null,a.halfedges.forEach((function(n){var i=s.edges[n],c=i.left;if(c!==a.site&&c||(c=i.right)){var f=t-c[0],h=e-c[1],p=f*f+h*h;pi?(i+a)/2:Math.min(0,i)||Math.max(0,a),u>s?(s+u)/2:Math.min(0,s)||Math.max(0,u))}t.zoom=function(){var t,c,f=defaultFilter,h=defaultExtent,d=defaultConstrain,p=defaultWheelDelta,g=defaultTouchable,v=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],_=250,w=i.interpolateZoom,M=[],E=e.dispatch("start","zoom","end"),T=0;function zoom(t){t.property("__zoom",defaultTransform).on("wheel.zoom",wheeled).on("mousedown.zoom",mousedowned).on("dblclick.zoom",dblclicked).filter(g).on("touchstart.zoom",touchstarted).on("touchmove.zoom",touchmoved).on("touchend.zoom touchcancel.zoom",touchended).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function scale(t,e){return(e=Math.max(v[0],Math.min(v[1],e)))===t.k?t:new Transform(e,t.x,t.y)}function translate(t,e,n){var i=e[0]-n[0]*t.k,a=e[1]-n[1]*t.k;return i===t.x&&a===t.y?t:new Transform(t.k,i,a)}function centroid(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function schedule(t,e,n){t.on("start.zoom",(function(){gesture(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){gesture(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,a=gesture(t,i),s=h.apply(t,i),u=n||centroid(s),c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),f=t.__zoom,d="function"==typeof e?e.apply(t,i):e,p=w(f.invert(u).concat(c/f.k),d.invert(u).concat(c/d.k));return function(t){if(1===t)t=d;else{var e=p(t),n=c/e[2];t=new Transform(n,u[0]-e[0]*n,u[1]-e[1]*n)}a.zoom(null,t)}}))}function gesture(t,e){for(var n,i=0,a=M.length;iT}t.zoom("mouse",d(translate(t.that.__zoom,t.mouse[0]=a.mouse(t.that),t.mouse[1]),t.extent,b))}),!0).on("mouseup.zoom",(function mouseupped(){e.on("mousemove.zoom mouseup.zoom",null),n.dragEnable(a.event.view,t.moved),noevent(),t.end()}),!0),i=a.mouse(this),u=a.event.clientX,h=a.event.clientY;n.dragDisable(a.event.view),nopropagation(),t.mouse=[i,this.__zoom.invert(i)],s.interrupt(this),t.start()}}function dblclicked(){if(f.apply(this,arguments)){var t=this.__zoom,e=a.mouse(this),n=t.invert(e),i=t.k*(a.event.shiftKey?.5:2),s=d(translate(scale(t,i),e,n),h.apply(this,arguments),b);noevent(),_>0?a.select(this).transition().duration(_).call(schedule,s,e):a.select(this).call(zoom.transform,s)}}function touchstarted(){if(f.apply(this,arguments)){var e,n,i,u,c=gesture(this,arguments),h=a.event.changedTouches,d=h.length;for(nopropagation(),n=0;ne?1:t>=e?0:NaN},bisector=function(t){return 1===t.length&&(t=function ascendingComparator(t){return function(e,n){return ascending(t(e),n)}}(t)),{left:function(e,n,i,a){for(null==i&&(i=0),null==a&&(a=e.length);i>>1;t(e[s],n)<0?i=s+1:a=s}return i},right:function(e,n,i,a){for(null==i&&(i=0),null==a&&(a=e.length);i>>1;t(e[s],n)>0?a=s:i=s+1}return i}}};var e=bisector(ascending),n=e.right,i=e.left;function pair(t,e){return[t,e]}var number=function(t){return null===t?NaN:+t},variance=function(t,e){var n,i,a=t.length,s=0,u=-1,c=0,f=0;if(null==e)for(;++u1)return f/(s-1)},deviation=function(t,e){var n=variance(t,e);return n?Math.sqrt(n):n},extent=function(t,e){var n,i,a,s=t.length,u=-1;if(null==e){for(;++u=n)for(i=a=n;++un&&(i=n),a=n)for(i=a=n;++un&&(i=n),a=0?(s>=c?10:s>=f?5:s>=h?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(s>=c?10:s>=f?5:s>=h?2:1)}function tickStep(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),a=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/a;return s>=c?a*=10:s>=f?a*=5:s>=h&&(a*=2),e=1)return+n(t[i-1],i-1,t);var i,a=(i-1)*e,s=Math.floor(a),u=+n(t[s],s,t);return u+(+n(t[s+1],s+1,t)-u)*(a-s)}},min=function(t,e){var n,i,a=t.length,s=-1;if(null==e){for(;++s=n)for(i=n;++sn&&(i=n)}else for(;++s=n)for(i=n;++sn&&(i=n);return i},transpose=function(t){if(!(a=t.length))return[];for(var e=-1,n=min(t,length),i=new Array(n);++et?1:e>=t?0:NaN},t.deviation=deviation,t.extent=extent,t.histogram=function(){var t=identity,e=extent,i=sturges;function histogram(a){var s,u,c=a.length,f=new Array(c);for(s=0;sp;)g.pop(),--v;var b,_=new Array(v+1);for(s=0;s<=v;++s)(b=_[s]=[]).x0=s>0?g[s-1]:d,b.x1=s=n)for(i=n;++si&&(i=n)}else for(;++s=n)for(i=n;++si&&(i=n);return i},t.mean=function(t,e){var n,i=t.length,a=i,s=-1,u=0;if(null==e)for(;++s=0;)for(e=(i=t[a]).length;--e>=0;)n[--u]=i[e];return n},t.min=min,t.pairs=function(t,e){null==e&&(e=pair);for(var n=0,i=t.length-1,a=t[0],s=new Array(i<0?0:i);n0)return[t];if((i=e0)for(t=Math.ceil(t/u),e=Math.floor(e/u),s=new Array(a=Math.ceil(e-t+1));++c=i.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var c,f,h,d=-1,p=n.length,g=i[a++],v=map(),b=s();++di.length)return t;var s,u=a[n-1];return null!=e&&n>=i.length?s=t.entries():(s=[],t.each((function(t,e){s.push({key:e,values:entries(t,n)})}))),null!=u?s.sort((function(t,e){return u(t.key,e.key)})):s}return n={object:function(t){return apply(t,0,createObject,setObject)},map:function(t){return apply(t,0,createMap,setMap)},entries:function(t){return entries(apply(t,0,createMap,setMap),0)},key:function(t){return i.push(t),n},sortKeys:function(t){return a[i.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}},t.set=set,t.map=map,t.keys=function(t){var e=[];for(var n in t)e.push(n);return e},t.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},t.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],76:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var define=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function extend(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Color(){}var e=.7,n=1/e,i="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",s="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",u=/^#([0-9a-f]{3})$/,c=/^#([0-9a-f]{6})$/,f=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),h=new RegExp("^rgb\\("+[s,s,s]+"\\)$"),d=new RegExp("^rgba\\("+[i,i,i,a]+"\\)$"),p=new RegExp("^rgba\\("+[s,s,s,a]+"\\)$"),g=new RegExp("^hsl\\("+[a,s,s]+"\\)$"),v=new RegExp("^hsla\\("+[a,s,s,a]+"\\)$"),b={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color(t){var e;return t=(t+"").trim().toLowerCase(),(e=u.exec(t))?new Rgb((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=c.exec(t))?rgbn(parseInt(e[1],16)):(e=f.exec(t))?new Rgb(e[1],e[2],e[3],1):(e=h.exec(t))?new Rgb(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=d.exec(t))?rgba(e[1],e[2],e[3],e[4]):(e=p.exec(t))?rgba(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=g.exec(t))?hsla(e[1],e[2]/100,e[3]/100,1):(e=v.exec(t))?hsla(e[1],e[2]/100,e[3]/100,e[4]):b.hasOwnProperty(t)?rgbn(b[t]):"transparent"===t?new Rgb(NaN,NaN,NaN,0):null}function rgbn(t){return new Rgb(t>>16&255,t>>8&255,255&t,1)}function rgba(t,e,n,i){return i<=0&&(t=e=n=NaN),new Rgb(t,e,n,i)}function rgbConvert(t){return t instanceof Color||(t=color(t)),t?new Rgb((t=t.rgb()).r,t.g,t.b,t.opacity):new Rgb}function rgb(t,e,n,i){return 1===arguments.length?rgbConvert(t):new Rgb(t,e,n,null==i?1:i)}function Rgb(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function hsla(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Hsl(t,e,n,i)}function hsl(t,e,n,i){return 1===arguments.length?function hslConvert(t){if(t instanceof Hsl)return new Hsl(t.h,t.s,t.l,t.opacity);if(t instanceof Color||(t=color(t)),!t)return new Hsl;if(t instanceof Hsl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,a=Math.min(e,n,i),s=Math.max(e,n,i),u=NaN,c=s-a,f=(s+a)/2;return c?(u=e===s?(n-i)/c+6*(n0&&f<1?0:u,new Hsl(u,c,f,t.opacity)}(t):new Hsl(t,e,n,null==i?1:i)}function Hsl(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function hsl2rgb(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}define(Color,color,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),define(Rgb,rgb,extend(Color,{brighter:function(t){return t=null==t?n:Math.pow(n,t),new Rgb(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?e:Math.pow(e,t),new Rgb(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),define(Hsl,hsl,extend(Color,{brighter:function(t){return t=null==t?n:Math.pow(n,t),new Hsl(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?e:Math.pow(e,t),new Hsl(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,a=2*n-i;return new Rgb(hsl2rgb(t>=240?t-240:t+120,a,i),hsl2rgb(t,a,i),hsl2rgb(t<120?t+240:t-120,a,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var _=Math.PI/180,w=180/Math.PI,M=.95047,E=1.08883,T=4/29,S=6/29,k=3*S*S,C=S*S*S;function labConvert(t){if(t instanceof Lab)return new Lab(t.l,t.a,t.b,t.opacity);if(t instanceof Hcl){var e=t.h*_;return new Lab(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof Rgb||(t=rgbConvert(t));var n=rgb2xyz(t.r),i=rgb2xyz(t.g),a=rgb2xyz(t.b),s=xyz2lab((.4124564*n+.3575761*i+.1804375*a)/M),u=xyz2lab((.2126729*n+.7151522*i+.072175*a)/1);return new Lab(116*u-16,500*(s-u),200*(u-xyz2lab((.0193339*n+.119192*i+.9503041*a)/E)),t.opacity)}function lab(t,e,n,i){return 1===arguments.length?labConvert(t):new Lab(t,e,n,null==i?1:i)}function Lab(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function xyz2lab(t){return t>C?Math.pow(t,1/3):t/k+T}function lab2xyz(t){return t>S?t*t*t:k*(t-T)}function xyz2rgb(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function rgb2xyz(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function hcl(t,e,n,i){return 1===arguments.length?function hclConvert(t){if(t instanceof Hcl)return new Hcl(t.h,t.c,t.l,t.opacity);t instanceof Lab||(t=labConvert(t));var e=Math.atan2(t.b,t.a)*w;return new Hcl(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Hcl(t,e,n,null==i?1:i)}function Hcl(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}define(Lab,lab,extend(Color,{brighter:function(t){return new Lab(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Lab(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return t=1*lab2xyz(t),new Rgb(xyz2rgb(3.2404542*(e=M*lab2xyz(e))-1.5371385*t-.4985314*(n=E*lab2xyz(n))),xyz2rgb(-.969266*e+1.8760108*t+.041556*n),xyz2rgb(.0556434*e-.2040259*t+1.0572252*n),this.opacity)}})),define(Hcl,hcl,extend(Color,{brighter:function(t){return new Hcl(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Hcl(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return labConvert(this).rgb()}}));var R=-.14861,N=1.78277,A=-.29227,O=-.90649,j=1.97294,L=j*O,P=j*N,U=N*A-O*R;function cubehelix(t,e,n,i){return 1===arguments.length?function cubehelixConvert(t){if(t instanceof Cubehelix)return new Cubehelix(t.h,t.s,t.l,t.opacity);t instanceof Rgb||(t=rgbConvert(t));var e=t.r/255,n=t.g/255,i=t.b/255,a=(U*i+L*e-P*n)/(U+L-P),s=i-a,u=(j*(n-a)-A*s)/O,c=Math.sqrt(u*u+s*s)/(j*a*(1-a)),f=c?Math.atan2(u,s)*w-120:NaN;return new Cubehelix(f<0?f+360:f,c,a,t.opacity)}(t):new Cubehelix(t,e,n,null==i?1:i)}function Cubehelix(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}define(Cubehelix,cubehelix,extend(Color,{brighter:function(t){return t=null==t?n:Math.pow(n,t),new Cubehelix(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?e:Math.pow(e,t),new Cubehelix(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*_,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),a=Math.sin(t);return new Rgb(255*(e+n*(R*i+N*a)),255*(e+n*(A*i+O*a)),255*(e+n*(j*i)),this.opacity)}})),t.color=color,t.rgb=rgb,t.hsl=hsl,t.lab=lab,t.hcl=hcl,t.cubehelix=cubehelix,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],77:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var e={value:function(){}};function dispatch(){for(var t,e=0,n=arguments.length,i={};e=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",i),s=-1,u=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s0)for(var n,i,a=new Array(n),s=0;sv}d.mouse("drag")}function mouseupped(){n.select(n.event.view).on("mousemove.drag mouseup.drag",null),yesdrag(n.event.view,a),noevent(),d.mouse("end")}function touchstarted(){if(u.apply(this,arguments)){var t,e,i=n.event.changedTouches,a=c.apply(this,arguments),s=i.length;for(t=0;t=1?(n=1,e-1):Math.floor(n*e),a=t[i],s=t[i+1],u=i>0?t[i-1]:2*a-s,c=i180||n<-180?n-360*Math.round(n/360):n):constant(isNaN(t)?e:t)}function gamma(t){return 1==(t=+t)?nogamma:function(e,n){return n-e?function exponential(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):constant(isNaN(e)?n:e)}}function nogamma(t,e){var n=e-t;return n?linear(t,n):constant(isNaN(t)?e:t)}var n=function rgbGamma(t){var n=gamma(t);function rgb$$1(t,i){var a=n((t=e.rgb(t)).r,(i=e.rgb(i)).r),s=n(t.g,i.g),u=n(t.b,i.b),c=nogamma(t.opacity,i.opacity);return function(e){return t.r=a(e),t.g=s(e),t.b=u(e),t.opacity=c(e),t+""}}return rgb$$1.gamma=rgbGamma,rgb$$1}(1);function rgbSpline(t){return function(n){var i,a,s=n.length,u=new Array(s),c=new Array(s),f=new Array(s);for(i=0;ic&&(a=e.slice(c,a),h[f]?h[f]+=a:h[++f]=a),(n=n[0])===(i=i[0])?h[f]?h[f]+=i:h[++f]=i:(h[++f]=null,d.push({i:f,x:number(n,i)})),c=u.lastIndex;return c180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(pop(n)+"rotate(",null,i)-2,x:number(t,e)})):e&&n.push(pop(n)+"rotate("+e+i)}(a.rotate,s.rotate,u,c),function skewX(t,e,n,a){t!==e?a.push({i:n.push(pop(n)+"skewX(",null,i)-2,x:number(t,e)}):e&&n.push(pop(n)+"skewX("+e+i)}(a.skewX,s.skewX,u,c),function scale(t,e,n,i,a,s){if(t!==n||e!==i){var u=a.push(pop(a)+"scale(",null,",",null,")");s.push({i:u-4,x:number(t,n)},{i:u-2,x:number(e,i)})}else 1===n&&1===i||a.push(pop(a)+"scale("+n+","+i+")")}(a.scaleX,a.scaleY,s.scaleX,s.scaleY,u,c),a=s=null,function(t){for(var e,n=-1,i=c.length;++ni)if(Math.abs(g*h-d*p)>i&&u){var b=a-c,_=s-f,w=h*h+d*d,M=b*b+_*_,E=Math.sqrt(w),T=Math.sqrt(v),S=u*Math.tan((e-Math.acos((w+v-M)/(2*E*T)))/2),k=S/T,C=S/E;Math.abs(k-1)>i&&(this._+="L"+(t+k*p)+","+(n+k*g)),this._+="A"+u+","+u+",0,0,"+ +(g*b>p*_)+","+(this._x1=t+C*h)+","+(this._y1=n+C*d)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,s,u,c,f,h){t=+t,s=+s;var d=(u=+u)*Math.cos(c),p=u*Math.sin(c),g=t+d,v=s+p,b=1^h,_=h?c-f:f-c;if(u<0)throw new Error("negative radius: "+u);null===this._x1?this._+="M"+g+","+v:(Math.abs(this._x1-g)>i||Math.abs(this._y1-v)>i)&&(this._+="L"+g+","+v),u&&(_<0&&(_=_%n+n),_>a?this._+="A"+u+","+u+",0,1,"+b+","+(t-d)+","+(s-p)+"A"+u+","+u+",0,1,"+b+","+(this._x1=g)+","+(this._y1=v):_>i&&(this._+="A"+u+","+u+",0,"+ +(_>=e)+","+b+","+(this._x1=t+u*Math.cos(f))+","+(this._y1=s+u*Math.sin(f))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}},t.path=path,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],85:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var e="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function namespace(t){var e=t+="",i=e.indexOf(":");return i>=0&&"xmlns"!==(e=t.slice(0,i))&&(t=t.slice(i+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function creatorInherit(t){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===e&&n.documentElement.namespaceURI===e?n.createElement(t):n.createElementNS(i,t)}}function creatorFixed(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function creator(t){var e=namespace(t);return(e.local?creatorFixed:creatorInherit)(e)}function none(){}function selector(t){return null==t?none:function(){return this.querySelector(t)}}function empty(){return[]}function selectorAll(t){return null==t?empty:function(){return this.querySelectorAll(t)}}var matcher=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var i=document.documentElement;if(!i.matches){var a=i.webkitMatchesSelector||i.msMatchesSelector||i.mozMatchesSelector||i.oMatchesSelector;matcher=function(t){return function(){return a.call(this,t)}}}}var s=matcher;function sparse(t){return new Array(t.length)}function EnterNode(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}EnterNode.prototype={constructor:EnterNode,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function bindIndex(t,e,n,i,a,s){for(var u,c=0,f=e.length,h=s.length;ce?1:t>=e?0:NaN}function attrRemove(t){return function(){this.removeAttribute(t)}}function attrRemoveNS(t){return function(){this.removeAttributeNS(t.space,t.local)}}function attrConstant(t,e){return function(){this.setAttribute(t,e)}}function attrConstantNS(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function attrFunction(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function attrFunctionNS(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function defaultView(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function styleRemove(t){return function(){this.style.removeProperty(t)}}function styleConstant(t,e,n){return function(){this.style.setProperty(t,e,n)}}function styleFunction(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function styleValue(t,e){return t.style.getPropertyValue(e)||defaultView(t).getComputedStyle(t,null).getPropertyValue(e)}function propertyRemove(t){return function(){delete this[t]}}function propertyConstant(t,e){return function(){this[t]=e}}function propertyFunction(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function classArray(t){return t.trim().split(/^|\s+/)}function classList(t){return t.classList||new ClassList(t)}function ClassList(t){this._node=t,this._names=classArray(t.getAttribute("class")||"")}function classedAdd(t,e){for(var n=classList(t),i=-1,a=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var u={};(t.event=null,"undefined"!=typeof document)&&("onmouseenter"in document.documentElement||(u={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(t,e,n){return t=contextListener(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function contextListener(e,n,i){return function(a){var s=t.event;t.event=a;try{e.call(this,this.__data__,n,i)}finally{t.event=s}}}function onRemove(t){return function(){var e=this.__on;if(e){for(var n,i=0,a=-1,s=e.length;i=S&&(S=T+1);!(E=w[S])&&++S=0;)(i=a[s])&&(u&&u!==i.nextSibling&&u.parentNode.insertBefore(i,u),u=i);return this},sort:function selection_sort(t){function compareNode(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ascending);for(var e=this._groups,n=e.length,i=new Array(n),a=0;a1?this.each((null==e?styleRemove:"function"==typeof e?styleFunction:styleConstant)(t,e,null==n?"":n)):styleValue(this.node(),t)},property:function selection_property(t,e){return arguments.length>1?this.each((null==e?propertyRemove:"function"==typeof e?propertyFunction:propertyConstant)(t,e)):this.node()[t]},classed:function selection_classed(t,e){var n=classArray(t+"");if(arguments.length<2){for(var i=classList(this.node()),a=-1,s=n.length;++a=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),u=s.length;if(!(arguments.length<2)){for(c=e?onAdd:onRemove,null==n&&(n=!1),i=0;i0))return u;do{u.push(s=new Date(+e)),i(e,a),t(e)}while(s=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;i(t,-1),!e(t););else for(;--n>=0;)for(;i(t,1),!e(t););}))},a&&(interval.count=function(i,s){return e.setTime(+i),n.setTime(+s),t(e),t(n),Math.floor(a(e,n))},interval.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?interval.filter(s?function(e){return s(e)%t==0}:function(e){return interval.count(0,e)%t==0}):interval:null}),interval}var i=newInterval((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?newInterval((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):i:null};var a=i.range,s=1e3,u=6e4,c=36e5,f=864e5,h=6048e5,d=newInterval((function(t){t.setTime(Math.floor(t/s)*s)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getUTCSeconds()})),p=d.range,g=newInterval((function(t){t.setTime(Math.floor(t/u)*u)}),(function(t,e){t.setTime(+t+e*u)}),(function(t,e){return(e-t)/u}),(function(t){return t.getMinutes()})),v=g.range,b=newInterval((function(t){var e=t.getTimezoneOffset()*u%c;e<0&&(e+=c),t.setTime(Math.floor((+t-e)/c)*c+e)}),(function(t,e){t.setTime(+t+e*c)}),(function(t,e){return(e-t)/c}),(function(t){return t.getHours()})),_=b.range,w=newInterval((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*u)/f}),(function(t){return t.getDate()-1})),M=w.range;function weekday(t){return newInterval((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*u)/h}))}var E=weekday(0),T=weekday(1),S=weekday(2),k=weekday(3),C=weekday(4),R=weekday(5),N=weekday(6),A=E.range,O=T.range,j=S.range,L=k.range,P=C.range,U=R.range,I=N.range,D=newInterval((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),q=D.range,B=newInterval((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));B.every=function(t){return isFinite(t=Math.floor(t))&&t>0?newInterval((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var z=B.range,H=newInterval((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*u)}),(function(t,e){return(e-t)/u}),(function(t){return t.getUTCMinutes()})),W=H.range,$=newInterval((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*c)}),(function(t,e){return(e-t)/c}),(function(t){return t.getUTCHours()})),V=$.range,Z=newInterval((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/f}),(function(t){return t.getUTCDate()-1})),G=Z.range;function utcWeekday(t){return newInterval((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/h}))}var Q=utcWeekday(0),J=utcWeekday(1),K=utcWeekday(2),tt=utcWeekday(3),et=utcWeekday(4),nt=utcWeekday(5),rt=utcWeekday(6),it=Q.range,ot=J.range,at=K.range,st=tt.range,ut=et.range,ct=nt.range,lt=rt.range,ft=newInterval((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),ht=ft.range,dt=newInterval((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));dt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?newInterval((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var pt=dt.range;t.timeInterval=newInterval,t.timeMillisecond=i,t.timeMilliseconds=a,t.utcMillisecond=i,t.utcMilliseconds=a,t.timeSecond=d,t.timeSeconds=p,t.utcSecond=d,t.utcSeconds=p,t.timeMinute=g,t.timeMinutes=v,t.timeHour=b,t.timeHours=_,t.timeDay=w,t.timeDays=M,t.timeWeek=E,t.timeWeeks=A,t.timeSunday=E,t.timeSundays=A,t.timeMonday=T,t.timeMondays=O,t.timeTuesday=S,t.timeTuesdays=j,t.timeWednesday=k,t.timeWednesdays=L,t.timeThursday=C,t.timeThursdays=P,t.timeFriday=R,t.timeFridays=U,t.timeSaturday=N,t.timeSaturdays=I,t.timeMonth=D,t.timeMonths=q,t.timeYear=B,t.timeYears=z,t.utcMinute=H,t.utcMinutes=W,t.utcHour=$,t.utcHours=V,t.utcDay=Z,t.utcDays=G,t.utcWeek=Q,t.utcWeeks=it,t.utcSunday=Q,t.utcSundays=it,t.utcMonday=J,t.utcMondays=ot,t.utcTuesday=K,t.utcTuesdays=at,t.utcWednesday=tt,t.utcWednesdays=st,t.utcThursday=et,t.utcThursdays=ut,t.utcFriday=nt,t.utcFridays=ct,t.utcSaturday=rt,t.utcSaturdays=lt,t.utcMonth=ft,t.utcMonths=ht,t.utcYear=dt,t.utcYears=pt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],87:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var e,n,i=0,a=0,s=0,u=0,c=0,f=0,h="object"==typeof performance&&performance.now?performance:Date,d="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function now(){return c||(d(clearNow),c=h.now()+f)}function clearNow(){c=0}function Timer(){this._call=this._time=this._next=null}function timer(t,e,n){var i=new Timer;return i.restart(t,e,n),i}function timerFlush(){now(),++i;for(var t,n=e;n;)(t=c-n._time)>=0&&n._call.call(null,t),n=n._next;--i}function wake(){c=(u=h.now())+f,i=a=0;try{timerFlush()}finally{i=0,function nap(){var t,i,a=e,s=1/0;for(;a;)a._call?(s>a._time&&(s=a._time),t=a,a=a._next):(i=a._next,a._next=null,a=t?t._next=i:e=i);n=t,sleep(s)}(),c=0}}function poke(){var t=h.now(),e=t-u;e>1e3&&(f-=e,u=t)}function sleep(t){i||(a&&(a=clearTimeout(a)),t-c>24?(t<1/0&&(a=setTimeout(wake,t-h.now()-f)),s&&(s=clearInterval(s))):(s||(u=h.now(),s=setInterval(poke,1e3)),i=1,d(wake)))}Timer.prototype=timer.prototype={constructor:Timer,restart:function(t,i,a){if("function"!=typeof t)throw new TypeError("callback is not a function");a=(null==a?now():+a)+(null==i?0:+i),this._next||n===this||(n?n._next=this:e=this,n=this),this._call=t,this._time=a,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}};t.now=now,t.timer=timer,t.timerFlush=timerFlush,t.timeout=function(t,e,n){var i=new Timer;return e=null==e?0:+e,i.restart((function(n){i.stop(),t(n+e)}),e,n),i},t.interval=function(t,e,n){var i=new Timer,a=e;return null==e?(i.restart(t,e,n),i):(e=+e,n=null==n?now():+n,i.restart((function tick(s){s+=a,i.restart(tick,a+=e,n),t(s)}),e,n),i)},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],88:[function(t,e,n){!function(i,a){"object"==typeof n&&void 0!==e?a(n,t("d3-selection"),t("d3-dispatch"),t("d3-timer"),t("d3-interpolate"),t("d3-color"),t("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-dispatch","d3-timer","d3-interpolate","d3-color","d3-ease"],a):a(i.d3=i.d3||{},i.d3,i.d3,i.d3,i.d3,i.d3,i.d3)}(this,(function(t,e,n,i,a,s,u){var c=n.dispatch("start","end","interrupt"),f=[],schedule=function(t,e,n,a,s,u){var h=t.__transition;if(h){if(n in h)return}else t.__transition={};!function create(t,e,n){var a,s=t.__transition;function schedule(t){n.state=1,n.timer.restart(start,n.delay,n.time),n.delay<=t&&start(t-n.delay)}function start(u){var c,f,h,d;if(1!==n.state)return stop();for(c in s)if((d=s[c]).name===n.name){if(3===d.state)return i.timeout(start);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete s[c]):+c0)throw new Error("too late; already scheduled");return n}function set(t,e){var n=get(t,e);if(n.state>2)throw new Error("too late; already started");return n}function get(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var interrupt=function(t,e){var n,i,a,s=t.__transition,u=!0;if(s){for(a in e=null==e?null:e+"",s)(n=s[a]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),i&&n.on.call("interrupt",t,t.__data__,n.index,n.group),delete s[a]):u=!1;u&&delete t.__transition}};function tweenRemove(t,e){var n,i;return function(){var a=set(this,t),s=a.tween;if(s!==n)for(var u=0,c=(i=n=s).length;u=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?init:set;return function(){var u=s(this,t),c=u.on;c!==i&&(a=(i=c).copy()).on(e,n),u.on=a}}(n,t,e))},attr:function(t,n){var i=e.namespace(t),s="transform"===i?a.interpolateTransformSvg:interpolate;return this.attrTween(t,"function"==typeof n?(i.local?attrFunctionNS:attrFunction)(i,s,tweenValue(this,"attr."+t,n)):null==n?(i.local?attrRemoveNS:attrRemove)(i):(i.local?attrConstantNS:attrConstant)(i,s,n+""))},attrTween:function(t,n){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==n)return this.tween(i,null);if("function"!=typeof n)throw new Error;var a=e.namespace(t);return this.tween(i,(a.local?attrTweenNS:attrTween)(a,n))},style:function(t,n,i){var s="transform"==(t+="")?a.interpolateTransformCss:interpolate;return null==n?this.styleTween(t,function styleRemove(t,n){var i,a,s;return function(){var u=e.style(this,t),c=(this.style.removeProperty(t),e.style(this,t));return u===c?null:u===i&&c===a?s:s=n(i=u,a=c)}}(t,s)).on("end.style."+t,function styleRemoveEnd(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function styleFunction(t,n,i){var a,s,u;return function(){var c=e.style(this,t),f=i(this);return null==f&&(this.style.removeProperty(t),f=e.style(this,t)),c===f?null:c===a&&f===s?u:u=n(a=c,s=f)}}(t,s,tweenValue(this,"style."+t,n)):function styleConstant(t,n,i){var a,s;return function(){var u=e.style(this,t);return u===i?null:u===a?s:s=n(a=u,i)}}(t,s,n+""),i)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function styleTween(t,e,n){function tween(){var i=this,a=e.apply(i,arguments);return a&&function(e){i.style.setProperty(t,a(e),n)}}return tween._value=e,tween}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function textFunction(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(tweenValue(this,"text",t)):function textConstant(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function removeFunction(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,a=get(this.node(),n).tween,s=0,u=a.length;s1&&n.name===e)return new Transition([[t]],v,e,+i);return null},t.interrupt=interrupt,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-color":89,"d3-dispatch":90,"d3-ease":91,"d3-interpolate":92,"d3-selection":93,"d3-timer":94}],89:[function(t,e,n){arguments[4][44][0].apply(n,arguments)},{dup:44}],90:[function(t,e,n){arguments[4][45][0].apply(n,arguments)},{dup:45}],91:[function(t,e,n){arguments[4][48][0].apply(n,arguments)},{dup:48}],92:[function(t,e,n){arguments[4][54][0].apply(n,arguments)},{"d3-color":89,dup:54}],93:[function(t,e,n){arguments[4][65][0].apply(n,arguments)},{dup:65}],94:[function(t,e,n){arguments[4][69][0].apply(n,arguments)},{dup:69}],95:[function(t,e,n){var i=Object.create||function objectCreatePolyfill(t){var F=function(){};return F.prototype=t,new F},a=Object.keys||function objectKeysPolyfill(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return n},s=Function.prototype.bind||function functionBindPolyfill(t){var e=this;return function(){return e.apply(t,arguments)}};function EventEmitter(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=i(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0;var u,c=10;try{var f={};Object.defineProperty&&Object.defineProperty(f,"x",{value:0}),u=0===f.x}catch(t){u=!1}function $getMaxListeners(t){return void 0===t._maxListeners?EventEmitter.defaultMaxListeners:t._maxListeners}function _addListener(t,e,n,a){var s,u,c;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((u=t._events)?(u.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),u=t._events),c=u[e]):(u=t._events=i(null),t._eventsCount=0),c){if("function"==typeof c?c=u[e]=a?[n,c]:[c,n]:a?c.unshift(n):c.push(n),!c.warned&&(s=$getMaxListeners(t))&&s>0&&c.length>s){c.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+c.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=c.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",f.name,f.message)}}else c=u[e]=n,++t._eventsCount;return t}function onceWrapper(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var f=new Error('Unhandled "error" event. ('+e+")");throw f.context=e,f}if(!(n=u[t]))return!1;var h="function"==typeof n;switch(i=arguments.length){case 1:!function emitNone(t,e,n){if(e)t.call(n);else for(var i=t.length,a=arrayClone(t,i),s=0;s=0;u--)if(n[u]===e||n[u].listener===e){c=n[u].listener,s=u;break}if(s<0)return this;0===s?n.shift():function spliceOne(t,e){for(var n=e,i=n+1,a=t.length;i=0;s--)this.removeListener(t,e[s]);return this},EventEmitter.prototype.listeners=function listeners(t){return _listeners(this,t,!0)},EventEmitter.prototype.rawListeners=function rawListeners(t){return _listeners(this,t,!1)},EventEmitter.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):listenerCount.call(t,e)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],96:[function(t,e,n){var i=t("http"),a=t("url"),s=e.exports;for(var u in i)i.hasOwnProperty(u)&&(s[u]=i[u]);function validateParams(t){if("string"==typeof t&&(t=a.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}s.request=function(t,e){return t=validateParams(t),i.request.call(this,t,e)},s.get=function(t,e){return t=validateParams(t),i.get.call(this,t,e)}},{http:19,url:106}],97:[function(t,e,n){n.read=function(t,e,n,i,a){var s,u,c=8*a-i-1,f=(1<>1,d=-7,p=n?a-1:0,g=n?-1:1,v=t[e+p];for(p+=g,s=v&(1<<-d)-1,v>>=-d,d+=c;d>0;s=256*s+t[e+p],p+=g,d-=8);for(u=s&(1<<-d)-1,s>>=-d,d+=i;d>0;u=256*u+t[e+p],p+=g,d-=8);if(0===s)s=1-h;else{if(s===f)return u?NaN:1/0*(v?-1:1);u+=Math.pow(2,i),s-=h}return(v?-1:1)*u*Math.pow(2,s-i)},n.write=function(t,e,n,i,a,s){var u,c,f,h=8*s-a-1,d=(1<>1,g=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,v=i?0:s-1,b=i?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,u=d):(u=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-u))<1&&(u--,f*=2),(e+=u+p>=1?g/f:g*Math.pow(2,1-p))*f>=2&&(u++,f/=2),u+p>=d?(c=0,u=d):u+p>=1?(c=(e*f-1)*Math.pow(2,a),u+=p):(c=e*Math.pow(2,p-1)*Math.pow(2,a),u=0));a>=8;t[n+v]=255&c,v+=b,c/=256,a-=8);for(u=u<0;t[n+v]=255&u,v+=b,u/=256,h-=8);t[n+v-b]|=128*_}},{}],98:[function(t,e,n){"function"==typeof Object.create?e.exports=function inherits(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(t,e){if(e){t.super_=e;var TempCtor=function(){};TempCtor.prototype=e.prototype,t.prototype=new TempCtor,t.prototype.constructor=t}}},{}],99:[function(t,e,n){function stdOnEnd(t,e){t.onload=function(){this.onerror=this.onload=null,e(null,t)},t.onerror=function(){this.onerror=this.onload=null,e(new Error("Failed to load "+this.src),t)}}function ieOnEnd(t,e){t.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,e(null,t))}}e.exports=function load(t,e,n){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},a.type=e.type||"text/javascript",a.charset=e.charset||"utf8",a.async=!("async"in e)||!!e.async,a.src=t,e.attrs&&function setAttributes(t,e){for(var n in e)t.setAttribute(n,e[n])}(a,e.attrs),e.text&&(a.text=""+e.text),("onload"in a?stdOnEnd:ieOnEnd)(a,n),a.onload||stdOnEnd(a,n),i.appendChild(a)}},{}],100:[function(t,e,n){var i,a,s=e.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(t){if(i===setTimeout)return setTimeout(t,0);if((i===defaultSetTimout||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(t){i=defaultSetTimout}try{a="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(t){a=defaultClearTimeout}}();var u,c=[],f=!1,h=-1;function cleanUpNextTick(){f&&u&&(f=!1,u.length?c=u.concat(c):h=-1,c.length&&drainQueue())}function drainQueue(){if(!f){var t=runTimeout(cleanUpNextTick);f=!0;for(var e=c.length;e;){for(u=c,c=[];++h1)for(var n=1;n0&&f>c&&(f=c);for(var h=0;h=0?(d=b.substr(0,_),p=b.substr(_+1)):(d=b,p=""),g=decodeURIComponent(d),v=decodeURIComponent(p),hasOwnProperty(s,g)?i(s[g])?s[g].push(v):s[g]=[s[g],v]:s[g]=v}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],102:[function(t,e,n){var stringifyPrimitive=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,n,s){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?map(a(t),(function(a){var s=encodeURIComponent(stringifyPrimitive(a))+n;return i(t[a])?map(t[a],(function(t){return s+encodeURIComponent(stringifyPrimitive(t))})).join(e):s+encodeURIComponent(stringifyPrimitive(t[a]))})).join(e):s?encodeURIComponent(stringifyPrimitive(s))+n+encodeURIComponent(stringifyPrimitive(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function map(t,e){if(t.map)return t.map(e);for(var n=[],i=0;i */var i=t("buffer"),a=i.Buffer;function copyProps(t,e){for(var n in t)e[n]=t[n]}function SafeBuffer(t,e,n){return a(t,e,n)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=i:(copyProps(i,n),n.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(a.prototype),copyProps(a,SafeBuffer),SafeBuffer.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return a(t,e,n)},SafeBuffer.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=a(t);return void 0!==e?"string"==typeof n?i.fill(e,n):i.fill(e):i.fill(0),i},SafeBuffer.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return a(t)},SafeBuffer.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},{buffer:17}],105:[function(t,e,n){var i=t("safe-buffer").Buffer,a=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function StringDecoder(t){var e;switch(this.encoding=function normalizeEncoding(t){var e=function _normalizeEncoding(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===a||!a(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,e=4;break;case"utf8":this.fillLast=utf8FillLast,e=4;break;case"base64":this.text=base64Text,this.end=base64End,e=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function utf8CheckByte(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function utf8FillLast(t){var e=this.lastTotal-this.lastNeed,n=function utf8CheckExtraBytes(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function utf16Text(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function utf16End(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function base64Text(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function base64End(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function simpleWrite(t){return t.toString(this.encoding)}function simpleEnd(t){return t&&t.length?this.write(t):""}n.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return a>0&&(t.lastNeed=a-1),a;if(--i=0)return a>0&&(t.lastNeed=a-2),a;if(--i=0)return a>0&&(2===a?a=0:t.lastNeed=a-3),a;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},StringDecoder.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":104}],106:[function(t,e,n){var i=t("punycode"),a=t("./util");function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}n.parse=urlParse,n.resolve=function urlResolve(t,e){return urlParse(t,!1,!0).resolve(e)},n.resolveObject=function urlResolveObject(t,e){return t?urlParse(t,!1,!0).resolveObject(e):e},n.format=function urlFormat(t){a.isString(t)&&(t=urlParse(t));return t instanceof Url?t.format():Url.prototype.format.call(t)},n.Url=Url;var s=/^([a-z0-9.+-]+:)/i,u=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,f=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(f),d=["%","/","?",";","#"].concat(h),p=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},M=t("querystring");function urlParse(t,e,n){if(t&&a.isObject(t)&&t instanceof Url)return t;var i=new Url;return i.parse(t,e,n),i}Url.prototype.parse=function(t,e,n){if(!a.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var u=t.indexOf("?"),f=-1!==u&&u127?q+="x":q+=D[B];if(!q.match(g)){var H=U.slice(0,j),W=U.slice(j+1),$=D.match(v);$&&(H.push($[1]),W.unshift($[2])),W.length&&(T="/"+W.join(".")+T),this.hostname=H.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=i.toASCII(this.hostname));var V=this.port?":"+this.port:"",Z=this.hostname||"";this.host=Z+V,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==T[0]&&(T="/"+T))}if(!b[C])for(j=0,I=h.length;j0)&&n.host.split("@"))&&(n.auth=L.shift(),n.host=n.hostname=L.shift());return n.search=t.search,n.query=t.query,a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!C.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var N=C.slice(-1)[0],A=(n.host||t.host||C.length>1)&&("."===N||".."===N)||""===N,O=0,j=C.length;j>=0;j--)"."===(N=C[j])?C.splice(j,1):".."===N?(C.splice(j,1),O++):O&&(C.splice(j,1),O--);if(!S&&!k)for(;O--;O)C.unshift("..");!S||""===C[0]||C[0]&&"/"===C[0].charAt(0)||C.unshift(""),A&&"/"!==C.join("/").substr(-1)&&C.push("");var L,P=""===C[0]||C[0]&&"/"===C[0].charAt(0);R&&(n.hostname=n.host=P?"":C.length?C.shift():"",(L=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=L.shift(),n.host=n.hostname=L.shift()));return(S=S||n.host&&C.length)&&!P&&C.unshift(""),C.length?n.pathname=C.join("/"):(n.pathname=null,n.path=null),a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},Url.prototype.parseHost=function(){var t=this.host,e=u.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":107,punycode:18,querystring:103}],107:[function(t,e,n){e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],108:[function(t,e,n){(function(t){function config(e){try{if(!t.localStorage)return!1}catch(t){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function deprecate(t,e){if(config("noDeprecation"))return t;var n=!1;return function deprecated(){if(!n){if(config("throwDeprecation"))throw new Error(e);config("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],109:[function(t,e,n){(function(e,i){ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).LaTeX2HTML5=t()}}((function(){var define,module,exports;return function r(t,e,n){function o(a,s){if(!e[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=e[a]={exports:{}};t[a][0].call(f.exports,(function(e){return o(t[a][1][e]||e)}),f,f.exports,r,t,e,n)}return e[a].exports}for(var i="function"==typeof require&&require,a=0;at.length)&&(e=t.length);for(var n=0,i=new Array(e);n0?u-4:u;for(n=0;n>16&255,f[h++]=e>>8&255,f[h++]=255&e;2===c&&(e=a[t.charCodeAt(n)]<<2|a[t.charCodeAt(n+1)]>>4,f[h++]=255&e);1===c&&(e=a[t.charCodeAt(n)]<<10|a[t.charCodeAt(n+1)]<<4|a[t.charCodeAt(n+2)]>>2,f[h++]=e>>8&255,f[h++]=255&e);return f},n.fromByteArray=function fromByteArray(t){for(var e,n=t.length,a=n%3,s=[],u=16383,c=0,f=n-a;cf?f:c+u));1===a?(e=t[n-1],s.push(i[e>>2]+i[e<<4&63]+"==")):2===a&&(e=(t[n-2]<<8)+t[n-1],s.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return s.join("")};for(var i=[],a=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0;c<64;++c)i[c]=u[c],a[u.charCodeAt(c)]=c;function getLens(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function encodeChunk(t,e,n){for(var a,s,u=[],c=e;c>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return u.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],15:[function(t,e,n){},{}],16:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],17:[function(t,e,n){(function(e){var i=t("base64-js"),a=t("ieee754");n.Buffer=e,n.SlowBuffer=function SlowBuffer(t){+t!=t&&(t=0);return e.alloc(+t)},n.INSPECT_MAX_BYTES=50;var s=2147483647;function createBuffer(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=new Uint8Array(t);return n.__proto__=e.prototype,n}function e(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(t)}return from(t,e,n)}function from(t,n,i){if("string"==typeof t)return function fromString(t,n){"string"==typeof n&&""!==n||(n="utf8");if(!e.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i=0|byteLength(t,n),a=createBuffer(i),s=a.write(t,n);s!==i&&(a=a.slice(0,s));return a}(t,n);if(ArrayBuffer.isView(t))return fromArrayLike(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(isInstance(t,ArrayBuffer)||t&&isInstance(t.buffer,ArrayBuffer))return function fromArrayBuffer(t,n,i){if(n<0||t.byteLength=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function byteLength(t,n){if(e.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||isInstance(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var i=t.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===i)return 0;for(var s=!1;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return base64ToBytes(t).length;default:if(s)return a?-1:utf8ToBytes(t).length;n=(""+n).toLowerCase(),s=!0}}function slowToString(t,e,n){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return hexSlice(this,e,n);case"utf8":case"utf-8":return utf8Slice(this,e,n);case"ascii":return asciiSlice(this,e,n);case"latin1":case"binary":return latin1Slice(this,e,n);case"base64":return base64Slice(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function swap(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function bidirectionalIndexOf(t,n,i,a,s){if(0===t.length)return-1;if("string"==typeof i?(a=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),numberIsNaN(i=+i)&&(i=s?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(s)return-1;i=t.length-1}else if(i<0){if(!s)return-1;i=0}if("string"==typeof n&&(n=e.from(n,a)),e.isBuffer(n))return 0===n.length?-1:arrayIndexOf(t,n,i,a,s);if("number"==typeof n)return n&=255,"function"==typeof Uint8Array.prototype.indexOf?s?Uint8Array.prototype.indexOf.call(t,n,i):Uint8Array.prototype.lastIndexOf.call(t,n,i):arrayIndexOf(t,[n],i,a,s);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,e,n,i,a){var s,u=1,c=t.length,f=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;u=2,c/=2,f/=2,n/=2}function read(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(a){var h=-1;for(s=n;sc&&(n=c-f),s=n;s>=0;s--){for(var d=!0,p=0;pa&&(i=a):i=a;var s=e.length;i>s/2&&(i=s/2);for(var u=0;u>8,a=n%256,s.push(a),s.push(i);return s}(e,t.length-n),t,n,i)}function base64Slice(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function utf8Slice(t,e,n){n=Math.min(t.length,n);for(var i=[],a=e;a239?4:d>223?3:d>191?2:1;if(a+g<=n)switch(g){case 1:d<128&&(p=d);break;case 2:128==(192&(s=t[a+1]))&&(h=(31&d)<<6|63&s)>127&&(p=h);break;case 3:s=t[a+1],c=t[a+2],128==(192&s)&&128==(192&c)&&(h=(15&d)<<12|(63&s)<<6|63&c)>2047&&(h<55296||h>57343)&&(p=h);break;case 4:s=t[a+1],c=t[a+2],f=t[a+3],128==(192&s)&&128==(192&c)&&128==(192&f)&&(h=(15&d)<<18|(63&s)<<12|(63&c)<<6|63&f)>65535&&h<1114112&&(p=h)}null===p?(p=65533,g=1):p>65535&&(p-=65536,i.push(p>>>10&1023|55296),p=56320|1023&p),i.push(p),a+=g}return function decodeCodePointsArray(t){var e=t.length;if(e<=u)return String.fromCharCode.apply(String,t);var n="",i=0;for(;ie&&(t+=" ... "),""},e.prototype.compare=function compare(t,n,i,a,s){if(isInstance(t,Uint8Array)&&(t=e.from(t,t.offset,t.byteLength)),!e.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===n&&(n=0),void 0===i&&(i=t?t.length:0),void 0===a&&(a=0),void 0===s&&(s=this.length),n<0||i>t.length||a<0||s>this.length)throw new RangeError("out of range index");if(a>=s&&n>=i)return 0;if(a>=s)return-1;if(n>=i)return 1;if(this===t)return 0;for(var u=(s>>>=0)-(a>>>=0),c=(i>>>=0)-(n>>>=0),f=Math.min(u,c),h=this.slice(a,s),d=t.slice(n,i),p=0;p>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var a=this.length-e;if((void 0===n||n>a)&&(n=a),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return hexWrite(this,t,e,n);case"utf8":case"utf-8":return utf8Write(this,t,e,n);case"ascii":return asciiWrite(this,t,e,n);case"latin1":case"binary":return latin1Write(this,t,e,n);case"base64":return base64Write(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},e.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var u=4096;function asciiSlice(t,e,n){var i="";n=Math.min(t.length,n);for(var a=e;ai)&&(n=i);for(var a="",s=e;sn)throw new RangeError("Trying to access beyond buffer length")}function checkInt(t,n,i,a,s,u){if(!e.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>s||nt.length)throw new RangeError("Index out of range")}function checkIEEE754(t,e,n,i,a,s){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function writeFloat(t,e,n,i,s){return e=+e,n>>>=0,s||checkIEEE754(t,0,n,4),a.write(t,e,n,i,23,4),n+4}function writeDouble(t,e,n,i,s){return e=+e,n>>>=0,s||checkIEEE754(t,0,n,8),a.write(t,e,n,i,52,8),n+8}e.prototype.slice=function slice(t,n){var i=this.length;(t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(n=void 0===n?i:~~n)<0?(n+=i)<0&&(n=0):n>i&&(n=i),n>>=0,e>>>=0,n||checkOffset(t,e,this.length);for(var i=this[t],a=1,s=0;++s>>=0,e>>>=0,n||checkOffset(t,e,this.length);for(var i=this[t+--e],a=1;e>0&&(a*=256);)i+=this[t+--e]*a;return i},e.prototype.readUInt8=function readUInt8(t,e){return t>>>=0,e||checkOffset(t,1,this.length),this[t]},e.prototype.readUInt16LE=function readUInt16LE(t,e){return t>>>=0,e||checkOffset(t,2,this.length),this[t]|this[t+1]<<8},e.prototype.readUInt16BE=function readUInt16BE(t,e){return t>>>=0,e||checkOffset(t,2,this.length),this[t]<<8|this[t+1]},e.prototype.readUInt32LE=function readUInt32LE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},e.prototype.readUInt32BE=function readUInt32BE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},e.prototype.readIntLE=function readIntLE(t,e,n){t>>>=0,e>>>=0,n||checkOffset(t,e,this.length);for(var i=this[t],a=1,s=0;++s=(a*=128)&&(i-=Math.pow(2,8*e)),i},e.prototype.readIntBE=function readIntBE(t,e,n){t>>>=0,e>>>=0,n||checkOffset(t,e,this.length);for(var i=e,a=1,s=this[t+--i];i>0&&(a*=256);)s+=this[t+--i]*a;return s>=(a*=128)&&(s-=Math.pow(2,8*e)),s},e.prototype.readInt8=function readInt8(t,e){return t>>>=0,e||checkOffset(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},e.prototype.readInt16LE=function readInt16LE(t,e){t>>>=0,e||checkOffset(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},e.prototype.readInt16BE=function readInt16BE(t,e){t>>>=0,e||checkOffset(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},e.prototype.readInt32LE=function readInt32LE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},e.prototype.readInt32BE=function readInt32BE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},e.prototype.readFloatLE=function readFloatLE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),a.read(this,t,!0,23,4)},e.prototype.readFloatBE=function readFloatBE(t,e){return t>>>=0,e||checkOffset(t,4,this.length),a.read(this,t,!1,23,4)},e.prototype.readDoubleLE=function readDoubleLE(t,e){return t>>>=0,e||checkOffset(t,8,this.length),a.read(this,t,!0,52,8)},e.prototype.readDoubleBE=function readDoubleBE(t,e){return t>>>=0,e||checkOffset(t,8,this.length),a.read(this,t,!1,52,8)},e.prototype.writeUIntLE=function writeUIntLE(t,e,n,i){(t=+t,e>>>=0,n>>>=0,i)||checkInt(this,t,e,n,Math.pow(2,8*n)-1,0);var a=1,s=0;for(this[e]=255&t;++s>>=0,n>>>=0,i)||checkInt(this,t,e,n,Math.pow(2,8*n)-1,0);var a=n-1,s=1;for(this[e+a]=255&t;--a>=0&&(s*=256);)this[e+a]=t/s&255;return e+n},e.prototype.writeUInt8=function writeUInt8(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,1,255,0),this[e]=255&t,e+1},e.prototype.writeUInt16LE=function writeUInt16LE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeUInt16BE=function writeUInt16BE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeUInt32LE=function writeUInt32LE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},e.prototype.writeUInt32BE=function writeUInt32BE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeIntLE=function writeIntLE(t,e,n,i){if(t=+t,e>>>=0,!i){var a=Math.pow(2,8*n-1);checkInt(this,t,e,n,a-1,-a)}var s=0,u=1,c=0;for(this[e]=255&t;++s>>=0,!i){var a=Math.pow(2,8*n-1);checkInt(this,t,e,n,a-1,-a)}var s=n-1,u=1,c=0;for(this[e+s]=255&t;--s>=0&&(u*=256);)t<0&&0===c&&0!==this[e+s+1]&&(c=1),this[e+s]=(t/u|0)-c&255;return e+n},e.prototype.writeInt8=function writeInt8(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},e.prototype.writeInt16LE=function writeInt16LE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},e.prototype.writeInt16BE=function writeInt16BE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},e.prototype.writeInt32LE=function writeInt32LE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},e.prototype.writeInt32BE=function writeInt32BE(t,e,n){return t=+t,e>>>=0,n||checkInt(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},e.prototype.writeFloatLE=function writeFloatLE(t,e,n){return writeFloat(this,t,e,!0,n)},e.prototype.writeFloatBE=function writeFloatBE(t,e,n){return writeFloat(this,t,e,!1,n)},e.prototype.writeDoubleLE=function writeDoubleLE(t,e,n){return writeDouble(this,t,e,!0,n)},e.prototype.writeDoubleBE=function writeDoubleBE(t,e,n){return writeDouble(this,t,e,!1,n)},e.prototype.copy=function copy(t,n,i,a){if(!e.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),a||0===a||(a=this.length),n>=t.length&&(n=t.length),n||(n=0),a>0&&a=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),t.length-n=0;--u)t[u+n]=this[u+i];else Uint8Array.prototype.set.call(t,this.subarray(i,a),n);return s},e.prototype.fill=function fill(t,n,i,a){if("string"==typeof t){if("string"==typeof n?(a=n,n=0,i=this.length):"string"==typeof i&&(a=i,i=this.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!e.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(1===t.length){var s=t.charCodeAt(0);("utf8"===a&&s<128||"latin1"===a)&&(t=s)}}else"number"==typeof t&&(t&=255);if(n<0||this.length>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(u=n;u55295&&n<57344){if(!a){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(u+1===i){(e-=3)>-1&&s.push(239,191,189);continue}a=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(e-=3)>-1&&s.push(239,191,189);if(a=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function base64ToBytes(t){return i.toByteArray(function base64clean(t){if((t=(t=t.split("=")[0]).trim().replace(c,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function blitBuffer(t,e,n,i){for(var a=0;a=e.length||a>=t.length);++a)e[a+n]=t[a];return a}function isInstance(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function numberIsNaN(t){return t!=t}}).call(this,t("buffer").Buffer)},{"base64-js":14,buffer:17,ieee754:97}],18:[function(t,e,n){(function(t){/*! https://mths.be/punycode v1.4.1 by @mathias */!function(i){var a="object"==typeof n&&n&&!n.nodeType&&n,s="object"==typeof e&&e&&!e.nodeType&&e,u="object"==typeof t&&t;u.global!==u&&u.window!==u&&u.self!==u||(i=u);var c,f,h=2147483647,d=36,p=/^xn--/,g=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=Math.floor,w=String.fromCharCode;function error(t){throw new RangeError(b[t])}function map(t,e){for(var n=t.length,i=[];n--;)i[n]=e(t[n]);return i}function mapDomain(t,e){var n=t.split("@"),i="";return n.length>1&&(i=n[0]+"@",t=n[1]),i+map((t=t.replace(v,".")).split("."),e).join(".")}function ucs2decode(t){for(var e,n,i=[],a=0,s=t.length;a=55296&&e<=56319&&a65535&&(e+=w((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=w(t)})).join("")}function digitToBasic(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function adapt(t,e,n){var i=0;for(t=n?_(t/700):t>>1,t+=_(t/e);t>455;i+=d)t=_(t/35);return _(i+36*t/(t+38))}function decode(t){var e,n,i,a,s,u,c,f,p,g,v,b=[],w=t.length,M=0,E=128,T=72;for((n=t.lastIndexOf("-"))<0&&(n=0),i=0;i=128&&error("not-basic"),b.push(t.charCodeAt(i));for(a=n>0?n+1:0;a=w&&error("invalid-input"),((f=(v=t.charCodeAt(a++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:d)>=d||f>_((h-M)/u))&&error("overflow"),M+=f*u,!(f<(p=c<=T?1:c>=T+26?26:c-T));c+=d)u>_(h/(g=d-p))&&error("overflow"),u*=g;T=adapt(M-s,e=b.length+1,0==s),_(M/e)>h-E&&error("overflow"),E+=_(M/e),M%=e,b.splice(M++,0,E)}return ucs2encode(b)}function encode(t){var e,n,i,a,s,u,c,f,p,g,v,b,M,E,T,S=[];for(b=(t=ucs2decode(t)).length,e=128,n=0,s=72,u=0;u=e&&v_((h-n)/(M=i+1))&&error("overflow"),n+=(c-e)*M,e=c,u=0;uh&&error("overflow"),v==e){for(f=n,p=d;!(f<(g=p<=s?1:p>=s+26?26:p-s));p+=d)T=f-g,E=d-g,S.push(w(digitToBasic(g+T%E,0))),f=_(T/E);S.push(w(digitToBasic(f,0))),s=adapt(n,M,i==a),n=0,++i}++n,++e}return S.join("")}if(c={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode,encode,toASCII:function toASCII(t){return mapDomain(t,(function(t){return g.test(t)?"xn--"+encode(t):t}))},toUnicode:function toUnicode(t){return mapDomain(t,(function(t){return p.test(t)?decode(t.slice(4).toLowerCase()):t}))}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",(function(){return c}));else if(a&&s)if(e.exports==a)s.exports=c;else for(f in c)c.hasOwnProperty(f)&&(a[f]=c[f]);else i.punycode=c}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],19:[function(t,e,n){(function(e){var i=t("./lib/request"),a=t("./lib/response"),s=t("xtend"),u=t("builtin-status-codes"),c=t("url"),f=n;f.request=function(t,n){t="string"==typeof t?c.parse(t):s(t);var a=-1===e.location.protocol.search(/^https?:$/)?"http:":"",u=t.protocol||a,f=t.hostname||t.host,h=t.port,d=t.path||"/";f&&-1!==f.indexOf(":")&&(f="["+f+"]"),t.url=(f?u+"//"+f:"")+(h?":"+h:"")+d,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var p=new i(t);return n&&p.on("response",n),p},f.get=function get(t,e){var n=f.request(t,e);return n.end(),n},f.ClientRequest=i,f.IncomingMessage=a.IncomingMessage,f.Agent=function(){},f.Agent.defaultMaxSockets=4,f.globalAgent=new f.Agent,f.STATUS_CODES=u,f.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":21,"./lib/response":22,"builtin-status-codes":38,url:106,xtend:110}],20:[function(t,e,n){(function(t){var e;function getXHR(){if(void 0!==e)return e;if(t.XMLHttpRequest){e=new t.XMLHttpRequest;try{e.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(t){e=null}}else e=null;return e}function checkTypeSupport(t){var e=getXHR();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}function isFunction(t){return"function"==typeof t}n.fetch=isFunction(t.fetch)&&isFunction(t.ReadableStream),n.writableStream=isFunction(t.WritableStream),n.abortController=isFunction(t.AbortController),n.arraybuffer=n.fetch||checkTypeSupport("arraybuffer"),n.msstream=!n.fetch&&checkTypeSupport("ms-stream"),n.mozchunkedarraybuffer=!n.fetch&&checkTypeSupport("moz-chunked-arraybuffer"),n.overrideMimeType=n.fetch||!!getXHR()&&isFunction(getXHR().overrideMimeType),e=null}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],21:[function(t,e,n){(function(n,i,a){var s=t("./capability"),u=t("inherits"),c=t("./response"),f=t("readable-stream"),h=c.IncomingMessage,d=c.readyStates;var p=e.exports=function(t){var e,n=this;f.Writable.call(n),n._opts=t,n._body=[],n._headers={},t.auth&&n.setHeader("Authorization","Basic "+a.from(t.auth).toString("base64")),Object.keys(t.headers).forEach((function(e){n.setHeader(e,t.headers[e])}));var i=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!s.abortController)i=!1,e=!0;else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!s.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}n._mode=function decideMode(t,e){return s.fetch&&e?"fetch":s.mozchunkedarraybuffer?"moz-chunked-arraybuffer":s.msstream?"ms-stream":s.arraybuffer&&t?"arraybuffer":"text"}(e,i),n._fetchTimer=null,n.on("finish",(function(){n._onFinish()}))};u(p,f.Writable),p.prototype.setHeader=function(t,e){var n=t.toLowerCase();-1===g.indexOf(n)&&(this._headers[n]={name:t,value:e})},p.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},p.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},p.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts,a=t._headers,u=null;"GET"!==e.method&&"HEAD"!==e.method&&(u=new Blob(t._body,{type:(a["content-type"]||{}).value||""}));var c=[];if(Object.keys(a).forEach((function(t){var e=a[t].name,n=a[t].value;Array.isArray(n)?n.forEach((function(t){c.push([e,t])})):c.push([e,n])})),"fetch"===t._mode){var f=null;if(s.abortController){var h=new AbortController;f=h.signal,t._fetchAbortController=h,"requestTimeout"in e&&0!==e.requestTimeout&&(t._fetchTimer=i.setTimeout((function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()}),e.requestTimeout))}i.fetch(t._opts.url,{method:t._opts.method,headers:c,body:u||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:f}).then((function(e){t._fetchResponse=e,t._connect()}),(function(e){i.clearTimeout(t._fetchTimer),t._destroyed||t.emit("error",e)}))}else{var p=t._xhr=new i.XMLHttpRequest;try{p.open(t._opts.method,t._opts.url,!0)}catch(e){return void n.nextTick((function(){t.emit("error",e)}))}"responseType"in p&&(p.responseType=t._mode),"withCredentials"in p&&(p.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in p&&p.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(p.timeout=e.requestTimeout,p.ontimeout=function(){t.emit("requestTimeout")}),c.forEach((function(t){p.setRequestHeader(t[0],t[1])})),t._response=null,p.onreadystatechange=function(){switch(p.readyState){case d.LOADING:case d.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(p.onprogress=function(){t._onXHRProgress()}),p.onerror=function(){t._destroyed||t.emit("error",new Error("XHR error"))};try{p.send(u)}catch(e){return void n.nextTick((function(){t.emit("error",e)}))}}}},p.prototype._onXHRProgress=function(){var t=this;(function statusValid(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}})(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress())},p.prototype._connect=function(){var t=this;t._destroyed||(t._response=new h(t._xhr,t._fetchResponse,t._mode,t._fetchTimer),t._response.on("error",(function(e){t.emit("error",e)})),t.emit("response",t._response))},p.prototype._write=function(t,e,n){this._body.push(t),n()},p.prototype.abort=p.prototype.destroy=function(){var t=this;t._destroyed=!0,i.clearTimeout(t._fetchTimer),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort()},p.prototype.end=function(t,e,n){"function"==typeof t&&(n=t,t=void 0),f.Writable.prototype.end.call(this,t,e,n)},p.prototype.flushHeaders=function(){},p.prototype.setTimeout=function(){},p.prototype.setNoDelay=function(){},p.prototype.setSocketKeepAlive=function(){};var g=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"./capability":20,"./response":22,_process:100,buffer:17,inherits:98,"readable-stream":37}],22:[function(t,e,n){(function(e,i,a){var s=t("./capability"),u=t("inherits"),c=t("readable-stream"),f=n.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},h=n.IncomingMessage=function(t,n,u,f){var h=this;if(c.Readable.call(h),h._mode=u,h.headers={},h.rawHeaders=[],h.trailers={},h.rawTrailers=[],h.on("end",(function(){e.nextTick((function(){h.emit("close")}))})),"fetch"===u){if(h._fetchResponse=n,h.url=n.url,h.statusCode=n.status,h.statusMessage=n.statusText,n.headers.forEach((function(t,e){h.headers[e.toLowerCase()]=t,h.rawHeaders.push(e,t)})),s.writableStream){var d=new WritableStream({write:function(t){return new Promise((function(e,n){h._destroyed?n():h.push(a.from(t))?e():h._resumeFetch=e}))},close:function(){i.clearTimeout(f),h._destroyed||h.push(null)},abort:function(t){h._destroyed||h.emit("error",t)}});try{return void n.body.pipeTo(d).catch((function(t){i.clearTimeout(f),h._destroyed||h.emit("error",t)}))}catch(b){}}var p=n.body.getReader();function read(){p.read().then((function(t){if(!h._destroyed){if(t.done)return i.clearTimeout(f),void h.push(null);h.push(a.from(t.value)),read()}})).catch((function(t){i.clearTimeout(f),h._destroyed||h.emit("error",t)}))}read()}else{if(h._xhr=t,h._pos=0,h.url=t.responseURL,h.statusCode=t.status,h.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var n=e[1].toLowerCase();"set-cookie"===n?(void 0===h.headers[n]&&(h.headers[n]=[]),h.headers[n].push(e[2])):void 0!==h.headers[n]?h.headers[n]+=", "+e[2]:h.headers[n]=e[2],h.rawHeaders.push(e[1],e[2])}})),h._charset="x-user-defined",!s.overrideMimeType){var g=h.rawHeaders["mime-type"];if(g){var v=g.match(/;\s*charset=([^;])(;|$)/);v&&(h._charset=v[1].toLowerCase())}h._charset||(h._charset="utf-8")}}};u(h,c.Readable),h.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},h.prototype._onXHRProgress=function(){var t=this,e=t._xhr,n=null;switch(t._mode){case"text":if((n=e.responseText).length>t._pos){var s=n.substr(t._pos);if("x-user-defined"===t._charset){for(var u=a.alloc(s.length),c=0;ct._pos&&(t.push(a.from(new Uint8Array(h.result.slice(t._pos)))),t._pos=h.result.byteLength)},h.onload=function(){t.push(null)},h.readAsArrayBuffer(n)}t._xhr.readyState===f.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"./capability":20,_process:100,buffer:17,inherits:98,"readable-stream":37}],23:[function(t,e,n){var i={};function createErrorType(t,e,n){n||(n=Error);var a=function(t){function NodeError(n,i,a){return t.call(this,function getMessage(t,n,i){return"string"==typeof e?e:e(t,n,i)}(n,i,a))||this}return function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(NodeError,t),NodeError}(n);a.prototype.name=n.name,a.prototype.code=t,i[t]=a}function oneOf(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}createErrorType("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),createErrorType("ERR_INVALID_ARG_TYPE",(function(t,e,n){var i,a;if("string"==typeof e&&function startsWith(t,e,n){return t.substr(!n||n<0?0:+n,e.length)===e}(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be",function endsWith(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))a="The ".concat(t," ").concat(i," ").concat(oneOf(e,"type"));else{var s=function includes(t,e,n){return"number"!=typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(s," ").concat(i," ").concat(oneOf(e,"type"))}return a+=". Received type ".concat(typeof n)}),TypeError),createErrorType("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),createErrorType("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),createErrorType("ERR_STREAM_PREMATURE_CLOSE","Premature close"),createErrorType("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),createErrorType("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),createErrorType("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end"),createErrorType("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),createErrorType("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=i},{}],24:[function(t,e,n){(function(n){var i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};e.exports=Duplex;var a=t("./_stream_readable"),s=t("./_stream_writable");t("inherits")(Duplex,a);for(var u=i(s.prototype),c=0;c0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function _uint8ArrayToBuffer(t){return c.from(t)}(e)),i)u.endEmitted?C(t,new k):addChunk(t,u,e,!0);else if(u.ended)C(t,new T);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!n?(e=u.decoder.write(e),u.objectMode||0!==e.length?addChunk(t,u,e,!1):maybeReadMore(t,u)):addChunk(t,u,e,!1)}else i||(u.reading=!1,maybeReadMore(t,u));return!u.ended&&(u.lengthe.highWaterMark&&(e.highWaterMark=function computeNewHighWaterMark(t){return t>=N?t=N:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function emitReadable(t){var e=t._readableState;h("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(emitReadable_,t))}function emitReadable_(t){var e=t._readableState;h("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,flow(t)}function maybeReadMore(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(maybeReadMore_,t,e))}function maybeReadMore_(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function nReadingNextTick(t){h("readable nexttick read 0"),t.read(0)}function resume_(t,e){h("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),flow(t),e.flowing&&!e.reading&&t.read(0)}function flow(t){var e=t._readableState;for(h("flow",e.flowing);e.flowing&&null!==t.read(););}function fromList(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function endReadable(t){var e=t._readableState;h("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(endReadableNT,e,t))}function endReadableNT(t,e){if(h("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function indexOf(t,e){for(var n=0,i=t.length;n=e.highWaterMark:e.length>0)||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?endReadable(this):emitReadable(this),null;if(0===(t=howMuchToRead(t,e))&&e.ended)return 0===e.length&&endReadable(this),null;var i,a=e.needReadable;return h("need readable",a),(0===e.length||e.length-t0?fromList(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&endReadable(this)),null!==i&&this.emit("data",i),i},Readable.prototype._read=function(t){C(this,new S("_read()"))},Readable.prototype.pipe=function(t,e){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?onend:unpipe;function onunpipe(e,n){h("onunpipe"),e===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,function cleanup(){h("cleanup"),t.removeListener("close",onclose),t.removeListener("finish",onfinish),t.removeListener("drain",c),t.removeListener("error",onerror),t.removeListener("unpipe",onunpipe),i.removeListener("end",onend),i.removeListener("end",unpipe),i.removeListener("data",ondata),f=!0,!a.awaitDrain||t._writableState&&!t._writableState.needDrain||c()}())}function onend(){h("onend"),t.end()}a.endEmitted?n.nextTick(u):i.once("end",u),t.on("unpipe",onunpipe);var c=function pipeOnDrain(t){return function pipeOnDrainFunctionResult(){var e=t._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,flow(t))}}(i);t.on("drain",c);var f=!1;function ondata(e){h("ondata");var n=t.write(e);h("dest.write",n),!1===n&&((1===a.pipesCount&&a.pipes===t||a.pipesCount>1&&-1!==indexOf(a.pipes,t))&&!f&&(h("false write response, pause",a.awaitDrain),a.awaitDrain++),i.pause())}function onerror(e){h("onerror",e),unpipe(),t.removeListener("error",onerror),0===s(t,"error")&&C(t,e)}function onclose(){t.removeListener("finish",onfinish),unpipe()}function onfinish(){h("onfinish"),t.removeListener("close",onclose),unpipe()}function unpipe(){h("unpipe"),i.unpipe(t)}return i.on("data",ondata),function prependListener(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",onerror),t.once("close",onclose),t.once("finish",onfinish),t.emit("pipe",i),a.flowing||(h("pipe resume"),i.resume()),t},Readable.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n)),this;if(!t){var i=e.pipes,a=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s0,!1!==a.flowing&&this.resume()):"readable"===t&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,h("on readable",a.length,a.reading),a.length?emitReadable(this):a.reading||n.nextTick(nReadingNextTick,this))),i},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.removeListener=function(t,e){var i=u.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(updateReadableListening,this),i},Readable.prototype.removeAllListeners=function(t){var e=u.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(updateReadableListening,this),e},Readable.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!t.readableListening,function resume(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(resume_,t,e))}(this,t)),t.paused=!1,this},Readable.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},Readable.prototype.wrap=function(t){var e=this,n=this._readableState,i=!1;for(var a in t.on("end",(function(){if(h("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(a){(h("wrapped data"),n.decoder&&(a=n.decoder.write(a)),n.objectMode&&null==a)||(n.objectMode||a&&a.length)&&(e.push(a)||(i=!0,t.pause()))})),t)void 0===this[a]&&"function"==typeof t[a]&&(this[a]=function methodWrap(e){return function methodWrapReturnFunction(){return t[e].apply(t,arguments)}}(a));for(var s=0;s-1))throw new S(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(Writable.prototype,"writableBuffer",{enumerable:!1,get:function get(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function get(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(t,e,n){n(new b("_write()"))},Writable.prototype._writev=null,Writable.prototype.end=function(t,e,i){var a=this._writableState;return"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),a.corked&&(a.corked=1,this.uncork()),a.ending||function endWritable(t,e,i){e.ending=!0,finishMaybe(t,e),i&&(e.finished?n.nextTick(i):t.once("finish",i));e.ended=!0,t.writable=!1}(this,a,i),this},Object.defineProperty(Writable.prototype,"writableLength",{enumerable:!1,get:function get(){return this._writableState.length}}),Object.defineProperty(Writable.prototype,"destroyed",{enumerable:!1,get:function get(){return void 0!==this._writableState&&this._writableState.destroyed},set:function set(t){this._writableState&&(this._writableState.destroyed=t)}}),Writable.prototype.destroy=d.destroy,Writable.prototype._undestroy=d.undestroy,Writable.prototype._destroy=function(t,e){e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":23,"./_stream_duplex":24,"./internal/streams/destroy":31,"./internal/streams/state":35,"./internal/streams/stream":36,_process:100,buffer:17,inherits:98,"util-deprecate":108}],29:[function(t,e,n){(function(n){var i;function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=t("./end-of-stream"),s=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),h=Symbol("lastPromise"),d=Symbol("handlePromise"),p=Symbol("stream");function createIterResult(t,e){return{value:t,done:e}}function readAndResolve(t){var e=t[s];if(null!==e){var n=t[p].read();null!==n&&(t[h]=null,t[s]=null,t[u]=null,e(createIterResult(n,!1)))}}function onReadable(t){n.nextTick(readAndResolve,t)}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((_defineProperty(i={get stream(){return this[p]},next:function next(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(createIterResult(void 0,!0));if(this[p].destroyed)return new Promise((function(e,i){n.nextTick((function(){t[c]?i(t[c]):e(createIterResult(void 0,!0))}))}));var i,a=this[h];if(a)i=new Promise(function wrapForNext(t,e){return function(n,i){t.then((function(){e[f]?n(createIterResult(void 0,!0)):e[d](n,i)}),i)}}(a,this));else{var s=this[p].read();if(null!==s)return Promise.resolve(createIterResult(s,!1));i=new Promise(this[d])}return this[h]=i,i}},Symbol.asyncIterator,(function(){return this})),_defineProperty(i,"return",(function _return(){var t=this;return new Promise((function(e,n){t[p].destroy(null,(function(t){t?n(t):e(createIterResult(void 0,!0))}))}))})),i),g);e.exports=function createReadableStreamAsyncIterator(t){var e,n=Object.create(v,(_defineProperty(e={},p,{value:t,writable:!0}),_defineProperty(e,s,{value:null,writable:!0}),_defineProperty(e,u,{value:null,writable:!0}),_defineProperty(e,c,{value:null,writable:!0}),_defineProperty(e,f,{value:t._readableState.endEmitted,writable:!0}),_defineProperty(e,d,{value:function value(t,e){var i=n[p].read();i?(n[h]=null,n[s]=null,n[u]=null,t(createIterResult(i,!1))):(n[s]=t,n[u]=e)},writable:!0}),e));return n[h]=null,a(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[u];return null!==e&&(n[h]=null,n[s]=null,n[u]=null,e(t)),void(n[c]=t)}var i=n[s];null!==i&&(n[h]=null,n[s]=null,n[u]=null,i(createIterResult(void 0,!0))),n[f]=!0})),t.on("readable",onReadable.bind(null,n)),n}}).call(this,t("_process"))},{"./end-of-stream":32,_process:100}],30:[function(t,e,n){function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _defineProperties(t,e){for(var n=0;n0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function unshift(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function shift(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function clear(){this.head=this.tail=null,this.length=0}},{key:"join",value:function join(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function concat(t){if(0===this.length)return i.alloc(0);for(var e,n,a,s=i.allocUnsafe(t>>>0),u=this.head,c=0;u;)e=u.data,n=s,a=c,i.prototype.copy.call(e,n,a),c+=u.data.length,u=u.next;return s}},{key:"consume",value:function consume(t,e){var n;return ta.length?a.length:t;if(s===a.length?i+=a:i+=a.slice(0,t),0===(t-=s)){s===a.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=a.slice(s));break}++n}return this.length-=n,i}},{key:"_getBuffer",value:function _getBuffer(t){var e=i.allocUnsafe(t),n=this.head,a=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var s=n.data,u=t>s.length?s.length:t;if(s.copy(e,e.length-t,0,u),0===(t-=u)){u===s.length?(++a,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(u));break}++a}return this.length-=a,e}},{key:s,value:function value(t,e){return a(this,function _objectSpread(t){for(var e=1;e0,(function(t){c||(c=t),t&&h.forEach(call),s||(h.forEach(call),f(c))}))}));return n.reduce(pipe)}},{"../../../errors":23,"./end-of-stream":32}],35:[function(t,e,n){var i=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function getHighWaterMark(t,e,n,a){var s=function highWaterMarkFrom(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,a,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(a?n:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},{"../../../errors":23}],36:[function(t,e,n){e.exports=t("events").EventEmitter},{events:95}],37:[function(t,e,n){(n=e.exports=t("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=t("./lib/_stream_writable.js"),n.Duplex=t("./lib/_stream_duplex.js"),n.Transform=t("./lib/_stream_transform.js"),n.PassThrough=t("./lib/_stream_passthrough.js"),n.finished=t("./lib/internal/streams/end-of-stream.js"),n.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":24,"./lib/_stream_passthrough.js":25,"./lib/_stream_readable.js":26,"./lib/_stream_transform.js":27,"./lib/_stream_writable.js":28,"./lib/internal/streams/end-of-stream.js":32,"./lib/internal/streams/pipeline.js":34}],38:[function(t,e,n){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],39:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){function ascending(t,e){return te?1:t>=e?0:NaN}function bisector(t){return 1===t.length&&(t=function ascendingComparator(t){return function(e,n){return ascending(t(e),n)}}(t)),{left:function(e,n,i,a){for(null==i&&(i=0),null==a&&(a=e.length);i>>1;t(e[s],n)<0?i=s+1:a=s}return i},right:function(e,n,i,a){for(null==i&&(i=0),null==a&&(a=e.length);i>>1;t(e[s],n)>0?a=s:i=s+1}return i}}}var e=bisector(ascending),n=e.right,i=e.left;function pair(t,e){return[t,e]}function number(t){return null===t?NaN:+t}function variance(t,e){var n,i,a=t.length,s=0,u=-1,c=0,f=0;if(null==e)for(;++u1)return f/(s-1)}function deviation(t,e){var n=variance(t,e);return n?Math.sqrt(n):n}function extent(t,e){var n,i,a,s=t.length,u=-1;if(null==e){for(;++u=n)for(i=a=n;++un&&(i=n),a=n)for(i=a=n;++un&&(i=n),a=0?(s>=c?10:s>=f?5:s>=h?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(s>=c?10:s>=f?5:s>=h?2:1)}function tickStep(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),a=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/a;return s>=c?a*=10:s>=f?a*=5:s>=h&&(a*=2),e=1)return+n(t[i-1],i-1,t);var i,a=(i-1)*e,s=Math.floor(a),u=+n(t[s],s,t);return u+(+n(t[s+1],s+1,t)-u)*(a-s)}}function min(t,e){var n,i,a=t.length,s=-1;if(null==e){for(;++s=n)for(i=n;++sn&&(i=n)}else for(;++s=n)for(i=n;++sn&&(i=n);return i}function transpose(t){if(!(a=t.length))return[];for(var e=-1,n=min(t,length),i=new Array(n);++et?1:e>=t?0:NaN},t.deviation=deviation,t.extent=extent,t.histogram=function histogram(){var t=identity,e=extent,i=sturges;function histogram(a){var s,u,c=a.length,f=new Array(c);for(s=0;sp;)g.pop(),--v;var b,_=new Array(v+1);for(s=0;s<=v;++s)(b=_[s]=[]).x0=s>0?g[s-1]:d,b.x1=s=n)for(i=n;++si&&(i=n)}else for(;++s=n)for(i=n;++si&&(i=n);return i},t.mean=function mean(t,e){var n,i=t.length,a=i,s=-1,u=0;if(null==e)for(;++s=0;)for(e=(i=t[a]).length;--e>=0;)n[--u]=i[e];return n},t.min=min,t.pairs=function pairs(t,e){null==e&&(e=pair);for(var n=0,i=t.length-1,a=t[0],s=new Array(i<0?0:i);n0)return[t];if((i=e0)for(t=Math.ceil(t/u),e=Math.floor(e/u),s=new Array(a=Math.ceil(e-t+1));++c0&&(e=i-A),B<0?R=N-O:B>0&&(E=S-O),D=c,nt.attr("cursor",v.selection),move());break;default:return}noevent()}),!0).on("keyup.brush",(function keyupped(){switch(a.event.keyCode){case 16:Q&&(L=P=Q=!1,move());break;case 18:D===h&&(q<0?k=C:q>0&&(e=i),B<0?R=N:B>0&&(E=S),D=f,move());break;case 32:D===c&&(a.event.altKey?(q&&(k=C-A*q,e=i+A*q),B&&(R=N-O*B,E=S+O*B),D=h):(q<0?k=C:q>0&&(e=i),B<0?R=N:B>0&&(E=S),D=f),nt.attr("cursor",v[I]),move());break;default:return}noevent()}),!0).on("mousemove.brush",moved,!0).on("mouseup.brush",ended,!0);n.dragDisable(a.event.view)}nopropagation(),s.interrupt(U),redraw.call(U),tt.start()}function moved(){var t=a.mouse(U);!Q||L||P||(Math.abs(t[0]-K[0])>Math.abs(t[1]-K[1])?P=!0:L=!0),K=t,j=!0,noevent(),move()}function move(){var t;switch(A=K[0]-J[0],O=K[1]-J[1],D){case c:case u:q&&(A=Math.max($-e,Math.min(Z-k,A)),i=e+A,C=k+A),B&&(O=Math.max(V-E,Math.min(G-R,O)),S=E+O,N=R+O);break;case f:q<0?(A=Math.max($-e,Math.min(Z-e,A)),i=e+A,C=k):q>0&&(A=Math.max($-k,Math.min(Z-k,A)),i=e,C=k+A),B<0?(O=Math.max(V-E,Math.min(G-E,O)),S=E+O,N=R):B>0&&(O=Math.max(V-R,Math.min(G-R,O)),S=E,N=R+O);break;case h:q&&(i=Math.max($,Math.min(Z,e-A*q)),C=Math.max($,Math.min(Z,k+A*q))),B&&(S=Math.max(V,Math.min(G,E-O*B)),N=Math.max(V,Math.min(G,R+O*B)))}C=i.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var c,f,h,d=-1,p=n.length,g=i[a++],v=map(),b=s();++di.length)return t;var s,u=a[n-1];return null!=e&&n>=i.length?s=t.entries():(s=[],t.each((function(t,e){s.push({key:e,values:entries(t,n)})}))),null!=u?s.sort((function(t,e){return u(t.key,e.key)})):s}return n={object:function(t){return apply(t,0,createObject,setObject)},map:function(t){return apply(t,0,createMap,setMap)},entries:function(t){return entries(apply(t,0,createMap,setMap),0)},key:function(t){return i.push(t),n},sortKeys:function(t){return a[i.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}},t.set=set,t.map=map,t.keys=function keys(t){var e=[];for(var n in t)e.push(n);return e},t.values=function values(t){var e=[];for(var n in t)e.push(t[n]);return e},t.entries=function entries(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],44:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){function define(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function extend(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Color(){}var e=.7,n=1/e,i="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",s="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",u=/^#([0-9a-f]{3,8})$/,c=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),f=new RegExp("^rgb\\("+[s,s,s]+"\\)$"),h=new RegExp("^rgba\\("+[i,i,i,a]+"\\)$"),d=new RegExp("^rgba\\("+[s,s,s,a]+"\\)$"),p=new RegExp("^hsl\\("+[a,s,s]+"\\)$"),g=new RegExp("^hsla\\("+[a,s,s,a]+"\\)$"),v={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color_formatHex(){return this.rgb().formatHex()}function color_formatRgb(){return this.rgb().formatRgb()}function color(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=u.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?rgbn(e):3===n?new Rgb(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?rgba(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?rgba(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=c.exec(t))?new Rgb(e[1],e[2],e[3],1):(e=f.exec(t))?new Rgb(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=h.exec(t))?rgba(e[1],e[2],e[3],e[4]):(e=d.exec(t))?rgba(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=p.exec(t))?hsla(e[1],e[2]/100,e[3]/100,1):(e=g.exec(t))?hsla(e[1],e[2]/100,e[3]/100,e[4]):v.hasOwnProperty(t)?rgbn(v[t]):"transparent"===t?new Rgb(NaN,NaN,NaN,0):null}function rgbn(t){return new Rgb(t>>16&255,t>>8&255,255&t,1)}function rgba(t,e,n,i){return i<=0&&(t=e=n=NaN),new Rgb(t,e,n,i)}function rgbConvert(t){return t instanceof Color||(t=color(t)),t?new Rgb((t=t.rgb()).r,t.g,t.b,t.opacity):new Rgb}function rgb(t,e,n,i){return 1===arguments.length?rgbConvert(t):new Rgb(t,e,n,null==i?1:i)}function Rgb(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function rgb_formatHex(){return"#"+hex(this.r)+hex(this.g)+hex(this.b)}function rgb_formatRgb(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function hex(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function hsla(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Hsl(t,e,n,i)}function hslConvert(t){if(t instanceof Hsl)return new Hsl(t.h,t.s,t.l,t.opacity);if(t instanceof Color||(t=color(t)),!t)return new Hsl;if(t instanceof Hsl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,a=Math.min(e,n,i),s=Math.max(e,n,i),u=NaN,c=s-a,f=(s+a)/2;return c?(u=e===s?(n-i)/c+6*(n0&&f<1?0:u,new Hsl(u,c,f,t.opacity)}function hsl(t,e,n,i){return 1===arguments.length?hslConvert(t):new Hsl(t,e,n,null==i?1:i)}function Hsl(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function hsl2rgb(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}define(Color,color,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:color_formatHex,formatHex:color_formatHex,formatHsl:function color_formatHsl(){return hslConvert(this).formatHsl()},formatRgb:color_formatRgb,toString:color_formatRgb}),define(Rgb,rgb,extend(Color,{brighter:function(t){return t=null==t?n:Math.pow(n,t),new Rgb(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?e:Math.pow(e,t),new Rgb(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatRgb:rgb_formatRgb,toString:rgb_formatRgb})),define(Hsl,hsl,extend(Color,{brighter:function(t){return t=null==t?n:Math.pow(n,t),new Hsl(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?e:Math.pow(e,t),new Hsl(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,a=2*n-i;return new Rgb(hsl2rgb(t>=240?t-240:t+120,a,i),hsl2rgb(t,a,i),hsl2rgb(t<120?t+240:t-120,a,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var b=Math.PI/180,_=180/Math.PI,w=.96422,M=.82521,E=4/29,T=6/29,S=3*T*T,k=T*T*T;function labConvert(t){if(t instanceof Lab)return new Lab(t.l,t.a,t.b,t.opacity);if(t instanceof Hcl)return hcl2lab(t);t instanceof Rgb||(t=rgbConvert(t));var e,n,i=rgb2lrgb(t.r),a=rgb2lrgb(t.g),s=rgb2lrgb(t.b),u=xyz2lab((.2225045*i+.7168786*a+.0606169*s)/1);return i===a&&a===s?e=n=u:(e=xyz2lab((.4360747*i+.3850649*a+.1430804*s)/w),n=xyz2lab((.0139322*i+.0971045*a+.7141733*s)/M)),new Lab(116*u-16,500*(e-u),200*(u-n),t.opacity)}function lab(t,e,n,i){return 1===arguments.length?labConvert(t):new Lab(t,e,n,null==i?1:i)}function Lab(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function xyz2lab(t){return t>k?Math.pow(t,1/3):t/S+E}function lab2xyz(t){return t>T?t*t*t:S*(t-E)}function lrgb2rgb(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function rgb2lrgb(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function hclConvert(t){if(t instanceof Hcl)return new Hcl(t.h,t.c,t.l,t.opacity);if(t instanceof Lab||(t=labConvert(t)),0===t.a&&0===t.b)return new Hcl(NaN,0=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",i),s=-1,u=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s0)for(var n,i,a=new Array(n),s=0;sv}d.mouse("drag")}function mouseupped(){n.select(n.event.view).on("mousemove.drag mouseup.drag",null),yesdrag(n.event.view,a),noevent(),d.mouse("end")}function touchstarted(){if(u.apply(this,arguments)){var t,e,i=n.event.changedTouches,a=c.apply(this,arguments),s=i.length;for(t=0;t=c?d=!0:10===(s=t.charCodeAt(f++))?p=!0:13===s&&(p=!0,10===t.charCodeAt(f)&&++f),t.slice(u+1,i-1).replace(/""/g,'"')}for(;ff+v||ih+v||sc.index){var b=f-u.x-u.vx,_=h-u.y-u.vy,w=b*b+_*_;wt.r&&(t.r=t[e].r)}function initialize(){if(n){var e,a,s=n.length;for(i=new Array(s),e=0;e=c)){(t.data!==n||t.next)&&(0===d&&(v+=(d=jiggle())*d),0===p&&(v+=(p=jiggle())*p),v1?(null==n?p.remove(t):p.set(t,initializeForce(n)),e):p.get(t)},find:function(e,n,i){var a,s,u,c,f,h=0,d=t.length;for(null==i?i=1/0:i*=i,h=0;h1?(v.on(t,n),e):v.on(t)}}},t.forceX=function(t){var e,n,i,a=constant(.1);function force(t){for(var a,s=0,u=e.length;s=(s=(_+M)/2))?_=s:M=s,(d=n>=(u=(w+E)/2))?w=u:E=u,a=v,!(v=v[p=d<<1|h]))return a[p]=b,t;if(c=+t._x.call(null,v.data),f=+t._y.call(null,v.data),e===c&&n===f)return b.next=v,a?a[p]=b:t._root=b,t;do{a=a?a[p]=new Array(4):t._root=new Array(4),(h=e>=(s=(_+M)/2))?_=s:M=s,(d=n>=(u=(w+E)/2))?w=u:E=u}while((p=d<<1|h)==(g=(f>=u)<<1|c>=s));return a[g]=v,a[p]=b,t}function Quad(t,e,n,i,a){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=a}function defaultX(t){return t[0]}function defaultY(t){return t[1]}function quadtree(t,e,n){var i=new Quadtree(null==e?defaultX:e,null==n?defaultY:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Quadtree(t,e,n,i,a,s){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=a,this._y1=s,this._root=void 0}function leaf_copy(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var e=quadtree.prototype=Quadtree.prototype;e.copy=function(){var t,e,n=new Quadtree(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=leaf_copy(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var a=0;a<4;++a)(e=i.source[a])&&(e.length?t.push({source:e,target:i.target[a]=new Array(4)}):i.target[a]=leaf_copy(e));return n},e.add=function tree_add(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return add(this.cover(e,n),e,n,t)},e.addAll=function addAll(t){var e,n,i,a,s=t.length,u=new Array(s),c=new Array(s),f=1/0,h=1/0,d=-1/0,p=-1/0;for(n=0;nd&&(d=i),ap&&(p=a));if(f>d||h>p)return this;for(this.cover(f,h).cover(d,p),n=0;nt||t>=a||i>e||e>=s;)switch(c=(eg||(s=f.y0)>v||(u=f.x1)=M)<<1|t>=w)&&(f=b[b.length-1],b[b.length-1]=b[b.length-1-h],b[b.length-1-h]=f)}else{var E=t-+this._x.call(null,_.data),T=e-+this._y.call(null,_.data),S=E*E+T*T;if(S=(c=(b+w)/2))?b=c:w=c,(d=u>=(f=(_+M)/2))?_=f:M=f,e=v,!(v=v[p=d<<1|h]))return this;if(!v.length)break;(e[p+1&3]||e[p+2&3]||e[p+3&3])&&(n=e,g=p)}for(;v.data!==t;)if(i=v,!(v=v.next))return this;return(a=v.next)&&delete v.next,i?(a?i.next=a:delete i.next,this):e?(a?e[p]=a:delete e[p],(v=e[0]||e[1]||e[2]||e[3])&&v===(e[3]||e[2]||e[1]||e[0])&&!v.length&&(n?n[g]=v:this._root=v),this):(this._root=a,this)},e.removeAll=function removeAll(t){for(var e=0,n=t.length;e1?i[0]+i.slice(2):i,+t.slice(n+1)]},exponent=function(t){return(t=formatDecimal(Math.abs(t)))?t[1]:NaN},formatRounded=function(t,e){var n=formatDecimal(t,e);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")},n={"":function(t,e){t:for(var n,i=(t=t.toPrecision(e)).length,a=1,s=-1;a0&&(s=0)}return s>0?t.slice(0,s)+t.slice(n+1):t},"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return formatRounded(100*t,e)},r:formatRounded,s:function(t,n){var i=formatDecimal(t,n);if(!i)return t+"";var a=i[0],s=i[1],u=s-(e=3*Math.max(-8,Math.min(8,Math.floor(s/3))))+1,c=a.length;return u===c?a:u>c?a+new Array(u-c+1).join("0"):u>0?a.slice(0,u)+"."+a.slice(u):"0."+new Array(1-u).join("0")+formatDecimal(t,Math.max(0,n+u-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},i=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;function formatSpecifier(t){return new FormatSpecifier(t)}function FormatSpecifier(t){if(!(e=i.exec(t)))throw new Error("invalid format: "+t);var e,a=e[1]||" ",s=e[2]||">",u=e[3]||"-",c=e[4]||"",f=!!e[5],h=e[6]&&+e[6],d=!!e[7],p=e[8]&&+e[8].slice(1),g=e[9]||"";"n"===g?(d=!0,g="g"):n[g]||(g=""),(f||"0"===a&&"="===s)&&(f=!0,a="0",s="="),this.fill=a,this.align=s,this.sign=u,this.symbol=c,this.zero=f,this.width=h,this.comma=d,this.precision=p,this.type=g}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var a,identity=function(t){return t},s=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],formatLocale=function(t){var i,a,u=t.grouping&&t.thousands?(i=t.grouping,a=t.thousands,function(t,e){for(var n=t.length,s=[],u=0,c=i[0],f=0;n>0&&c>0&&(f+c+1>e&&(c=Math.max(1,e-f)),s.push(t.substring(n-=c,n+c)),!((f+=c+1)>e));)c=i[u=(u+1)%i.length];return s.reverse().join(a)}):identity,c=t.currency,f=t.decimal,h=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(t.numerals):identity,d=t.percent||"%";function newFormat(t){var i=(t=formatSpecifier(t)).fill,a=t.align,p=t.sign,g=t.symbol,v=t.zero,b=t.width,_=t.comma,w=t.precision,M=t.type,E="$"===g?c[0]:"#"===g&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",T="$"===g?c[1]:/[%p]/.test(M)?d:"",S=n[M],k=!M||/[defgprs%]/.test(M);function format(t){var n,c,d,g=E,C=T;if("c"===M)C=S(t)+C,t="";else{var R=(t=+t)<0;if(t=S(Math.abs(t),w),R&&0==+t&&(R=!1),g=(R?"("===p?p:"-":"-"===p||"("===p?"":p)+g,C=("s"===M?s[8+e/3]:"")+C+(R&&"("===p?")":""),k)for(n=-1,c=t.length;++n(d=t.charCodeAt(n))||d>57){C=(46===d?f+t.slice(n+1):t.slice(n))+C,t=t.slice(0,n);break}}_&&!v&&(t=u(t,1/0));var N=g.length+t.length+C.length,A=N>1)+g+t+C+A.slice(N);break;default:t=A+g+t+C}return h(t)}return w=null==w?M?6:12:/[gprs]/.test(M)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w)),format.toString=function(){return t+""},format}return{format:newFormat,formatPrefix:function formatPrefix(t,e){var n=newFormat(((t=formatSpecifier(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(exponent(e)/3))),a=Math.pow(10,-i),u=s[8+i/3];return function(t){return n(a*t)+u}}}};function defaultLocale(e){return a=formatLocale(e),t.format=a.format,t.formatPrefix=a.formatPrefix,a}defaultLocale({decimal:".",thousands:",",grouping:[3],currency:["$",""]});t.formatDefaultLocale=defaultLocale,t.formatLocale=formatLocale,t.formatSpecifier=formatSpecifier,t.precisionFixed=function(t){return Math.max(0,-exponent(Math.abs(t)))},t.precisionPrefix=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(exponent(e)/3)))-exponent(Math.abs(t)))},t.precisionRound=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,exponent(e)-exponent(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],52:[function(t,e,n){!function(i,a){"object"==typeof n&&void 0!==e?a(n,t("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],a):a(i.d3=i.d3||{},i.d3)}(this,(function(t,e){var adder=function(){return new Adder};function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(t){add(n,t,this.t),add(this,n.s,this.s),this.s?this.t+=n.t:this.s=n.t},valueOf:function(){return this.s}};var n=new Adder;function add(t,e,n){var i=t.s=e+n,a=i-e,s=i-a;t.t=e-s+(n-a)}var i=1e-6,a=Math.PI,s=a/2,u=a/4,c=2*a,f=180/a,h=a/180,d=Math.abs,p=Math.atan,g=Math.atan2,v=Math.cos,b=Math.ceil,_=Math.exp,w=Math.log,M=Math.pow,E=Math.sin,T=Math.sign||function(t){return t>0?1:t<0?-1:0},S=Math.sqrt,k=Math.tan;function acos(t){return t>1?0:t<-1?a:Math.acos(t)}function asin(t){return t>1?s:t<-1?-s:Math.asin(t)}function haversin(t){return(t=E(t/2))*t}function noop(){}function streamGeometry(t,e){t&&R.hasOwnProperty(t.type)&&R[t.type](t,e)}var C={Feature:function(t,e){streamGeometry(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,a=n.length;++i=0?1:-1,a=i*n,s=v(e=(e*=h)/2+u),c=E(e),f=L*c,d=j*s+f*v(a),p=f*i*E(a);P.add(g(p,d)),O=t,j=s,L=c}var D,q,B,z,H,W,$,V;function spherical(t){return[g(t[1],t[0]),asin(t[2])]}function cartesian(t){var e=t[0],n=t[1],i=v(n);return[i*v(e),i*E(e),E(n)]}function cartesianDot(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function cartesianCross(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function cartesianAddInPlace(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function cartesianScale(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function cartesianNormalizeInPlace(t){var e=S(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Z,G,Q=adder(),J={point:boundsPoint,lineStart:boundsLineStart,lineEnd:boundsLineEnd,polygonStart:function(){J.point=boundsRingPoint,J.lineStart=boundsRingStart,J.lineEnd=boundsRingEnd,Q.reset(),I.polygonStart()},polygonEnd:function(){I.polygonEnd(),J.point=boundsPoint,J.lineStart=boundsLineStart,J.lineEnd=boundsLineEnd,P<0?(D=-(B=180),q=-(z=90)):Q>i?z=90:Q<-i&&(q=-90),G[0]=D,G[1]=B}};function boundsPoint(t,e){Z.push(G=[D=t,B=t]),ez&&(z=e)}function linePoint(t,e){var n=cartesian([t*h,e*h]);if(V){var i=cartesianCross(V,n),a=cartesianCross([i[1],-i[0],0],i);cartesianNormalizeInPlace(a),a=spherical(a);var s,u=t-H,c=u>0?1:-1,p=a[0]*f*c,g=d(u)>180;g^(c*Hz&&(z=s):g^(c*H<(p=(p+360)%360-180)&&pz&&(z=e)),g?tangle(D,B)&&(B=t):angle(t,B)>angle(D,B)&&(D=t):B>=D?(tB&&(B=t)):t>H?angle(D,t)>angle(D,B)&&(B=t):angle(t,B)>angle(D,B)&&(D=t)}else Z.push(G=[D=t,B=t]);ez&&(z=e),V=n,H=t}function boundsLineStart(){J.point=linePoint}function boundsLineEnd(){G[0]=D,G[1]=B,J.point=boundsPoint,V=null}function boundsRingPoint(t,e){if(V){var n=t-H;Q.add(d(n)>180?n+(n>0?360:-360):n)}else W=t,$=e;I.point(t,e),linePoint(t,e)}function boundsRingStart(){I.lineStart()}function boundsRingEnd(){boundsRingPoint(W,$),I.lineEnd(),d(Q)>i&&(D=-(B=180)),G[0]=D,G[1]=B,V=null}function angle(t,e){return(e-=t)<0?e+360:e}function rangeCompare(t,e){return t[0]-e[0]}function rangeContains(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:ea?t-c:t<-a?t+c:t,e]}function rotateRadians(t,e,n){return(t%=c)?e||n?compose(rotationLambda(t),rotationPhiGamma(e,n)):rotationLambda(t):e||n?rotationPhiGamma(e,n):rotationIdentity}function forwardRotationLambda(t){return function(e,n){return[(e+=t)>a?e-c:e<-a?e+c:e,n]}}function rotationLambda(t){var e=forwardRotationLambda(t);return e.invert=forwardRotationLambda(-t),e}function rotationPhiGamma(t,e){var n=v(t),i=E(t),a=v(e),s=E(e);function rotation(t,e){var u=v(e),c=v(t)*u,f=E(t)*u,h=E(e),d=h*n+c*i;return[g(f*a-d*s,c*n-h*i),asin(d*a+f*s)]}return rotation.invert=function(t,e){var u=v(e),c=v(t)*u,f=E(t)*u,h=E(e),d=h*a-f*s;return[g(f*a+h*s,c*n+d*i),asin(d*n-c*i)]},rotation}rotationIdentity.invert=rotationIdentity;var rotation=function(t){function forward(e){return(e=t(e[0]*h,e[1]*h))[0]*=f,e[1]*=f,e}return t=rotateRadians(t[0]*h,t[1]*h,t.length>2?t[2]*h:0),forward.invert=function(e){return(e=t.invert(e[0]*h,e[1]*h))[0]*=f,e[1]*=f,e},forward};function circleStream(t,e,n,i,a,s){if(n){var u=v(e),f=E(e),h=i*n;null==a?(a=e+i*c,s=e-h/2):(a=circleRadius(u,a),s=circleRadius(u,s),(i>0?as)&&(a+=i*c));for(var d,p=a;i>0?p>s:p1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},pointEqual=function(t,e){return d(t[0]-e[0])=0;--s)a.point((d=h[s])[0],d[1]);else i(g.x,g.p.x,-1,a);g=g.p}h=(g=g.o).z,v=!v}while(!g.v);a.lineEnd()}}};function link(t){if(e=t.length){for(var e,n,i=0,a=t[0];++i=0?1:-1,I=U*P,D=I>a,q=k*j;if(yt.add(g(q*U*E(I),C*L+q*v(I))),h+=D?P+U*c:P,D^T>=n^A>=n){var B=cartesianCross(cartesian(M),cartesian(N));cartesianNormalizeInPlace(B);var z=cartesianCross(f,B);cartesianNormalizeInPlace(z);var H=(D^P>=0?-1:1)*asin(z[2]);(s>H||s===H&&(B[0]||B[1]))&&(d+=D^P>=0?1:-1)}}return(h<-i||h0){for(g||(s.polygonStart(),g=!0),s.lineStart(),t=0;t1&&2&a&&h.push(h.pop().concat(h.shift())),c.push(h.filter(validSegment))}return v}};function validSegment(t){return t.length>1}function compareIntersection(t,e){return((t=t.x)[0]<0?t[1]-s-i:s-t[1])-((e=e.x)[0]<0?e[1]-s-i:s-e[1])}var gt=clip((function(){return!0}),(function clipAntimeridianLine(t){var e,n=NaN,u=NaN,c=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(f,h){var g=f>0?a:-a,b=d(f-n);d(b-a)0?s:-s),t.point(c,u),t.lineEnd(),t.lineStart(),t.point(g,u),t.point(f,u),e=0):c!==g&&b>=a&&(d(n-c)i?p((E(e)*(u=v(a))*E(n)-E(a)*(s=v(e))*E(t))/(s*u*c)):(e+a)/2}(n,u,f,h),t.point(c,u),t.lineEnd(),t.lineStart(),t.point(g,u),e=0),t.point(n=f,u=h),c=g},lineEnd:function(){t.lineEnd(),n=u=NaN},clean:function(){return 2-e}}}),(function clipAntimeridianInterpolate(t,e,n,u){var c;if(null==t)c=n*s,u.point(-a,c),u.point(0,c),u.point(a,c),u.point(a,0),u.point(a,-c),u.point(0,-c),u.point(-a,-c),u.point(-a,0),u.point(-a,c);else if(d(t[0]-e[0])>i){var f=t[0]0,u=d(e)>i;function visible(t,n){return v(t)*v(n)>e}function intersect(t,n,s){var u=[1,0,0],c=cartesianCross(cartesian(t),cartesian(n)),f=cartesianDot(c,c),h=c[0],p=f-h*h;if(!p)return!s&&t;var g=e*f/p,v=-e*h/p,b=cartesianCross(u,c),_=cartesianScale(u,g);cartesianAddInPlace(_,cartesianScale(c,v));var w=b,M=cartesianDot(_,w),E=cartesianDot(w,w),T=M*M-E*(cartesianDot(_,_)-1);if(!(T<0)){var k=S(T),C=cartesianScale(w,(-M-k)/E);if(cartesianAddInPlace(C,_),C=spherical(C),!s)return C;var R,N=t[0],A=n[0],O=t[1],j=n[1];A0^C[1]<(d(C[0]-N)a^(N<=C[0]&&C[0]<=A)){var U=cartesianScale(w,(-M+k)/E);return cartesianAddInPlace(U,_),[C,spherical(U)]}}}function code(e,n){var i=s?t:a-t,u=0;return e<-i?u|=1:e>i&&(u|=2),n<-i?u|=4:n>i&&(u|=8),u}return clip(visible,(function clipLine(t){var e,n,c,f,h;return{lineStart:function(){f=c=!1,h=1},point:function(d,p){var g,v=[d,p],b=visible(d,p),_=s?b?0:code(d,p):b?code(d+(d<0?a:-a),p):0;if(!e&&(f=c=b)&&t.lineStart(),b!==c&&(!(g=intersect(e,v))||pointEqual(e,g)||pointEqual(v,g))&&(v[0]+=i,v[1]+=i,b=visible(v[0],v[1])),b!==c)h=0,b?(t.lineStart(),g=intersect(v,e),t.point(g[0],g[1])):(g=intersect(e,v),t.point(g[0],g[1]),t.lineEnd()),e=g;else if(u&&e&&s^b){var w;_&n||!(w=intersect(v,e,!0))||(h=0,s?(t.lineStart(),t.point(w[0][0],w[0][1]),t.point(w[1][0],w[1][1]),t.lineEnd()):(t.point(w[1][0],w[1][1]),t.lineEnd(),t.lineStart(),t.point(w[0][0],w[0][1])))}!b||e&&pointEqual(e,v)||t.point(v[0],v[1]),e=v,c=b,n=_},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return h|(f&&c)<<1}}}),(function interpolate(e,i,a,s){circleStream(s,t,n,a,e,i)}),s?[0,-t]:[-a,t-a])},vt=1e9,bt=-vt;function clipRectangle(t,n,a,s){function visible(e,i){return t<=e&&e<=a&&n<=i&&i<=s}function interpolate(e,i,u,c){var f=0,h=0;if(null==e||(f=corner(e,u))!==(h=corner(i,u))||comparePoint(e,i)<0^u>0)do{c.point(0===f||3===f?t:a,f>1?s:n)}while((f=(f+u+4)%4)!==h);else c.point(i[0],i[1])}function corner(e,s){return d(e[0]-t)0?0:3:d(e[0]-a)0?2:1:d(e[1]-n)0?1:0:s>0?3:2}function compareIntersection(t,e){return comparePoint(t.x,e.x)}function comparePoint(t,e){var n=corner(t,1),i=corner(e,1);return n!==i?n-i:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(i){var u,c,f,h,d,p,g,v,b,_,w,M=i,E=clipBuffer(),T={point,lineStart:function lineStart(){T.point=linePoint,c&&c.push(f=[]);_=!0,b=!1,g=v=NaN},lineEnd:function lineEnd(){u&&(linePoint(h,d),p&&b&&E.rejoin(),u.push(E.result()));T.point=point,b&&M.lineEnd()},polygonStart:function polygonStart(){M=E,u=[],c=[],w=!0},polygonEnd:function polygonEnd(){var n=function polygonInside(){for(var e=0,n=0,i=c.length;ns&&(g-a)*(s-u)>(v-u)*(t-a)&&++e:v<=s&&(g-a)*(s-u)<(v-u)*(t-a)&&--e;return e}(),a=w&&n,h=(u=e.merge(u)).length;(a||h)&&(i.polygonStart(),a&&(i.lineStart(),interpolate(null,null,1,i),i.lineEnd()),h&&clipRejoin(u,compareIntersection,n,interpolate,i),i.polygonEnd());M=i,u=c=f=null}};function point(t,e){visible(t,e)&&M.point(t,e)}function linePoint(e,i){var u=visible(e,i);if(c&&f.push([e,i]),_)h=e,d=i,p=u,_=!1,u&&(M.lineStart(),M.point(e,i));else if(u&&b)M.point(e,i);else{var E=[g=Math.max(bt,Math.min(vt,g)),v=Math.max(bt,Math.min(vt,v))],T=[e=Math.max(bt,Math.min(vt,e)),i=Math.max(bt,Math.min(vt,i))];!function(t,e,n,i,a,s){var u,c=t[0],f=t[1],h=0,d=1,p=e[0]-c,g=e[1]-f;if(u=n-c,p||!(u>0)){if(u/=p,p<0){if(u0){if(u>d)return;u>h&&(h=u)}if(u=a-c,p||!(u<0)){if(u/=p,p<0){if(u>d)return;u>h&&(h=u)}else if(p>0){if(u0)){if(u/=g,g<0){if(u0){if(u>d)return;u>h&&(h=u)}if(u=s-f,g||!(u<0)){if(u/=g,g<0){if(u>d)return;u>h&&(h=u)}else if(g>0){if(u0&&(t[0]=c+h*p,t[1]=f+h*g),d<1&&(e[0]=c+d*p,e[1]=f+d*g),!0}}}}}(E,T,t,n,a,s)?u&&(M.lineStart(),M.point(e,i),w=!1):(b||(M.lineStart(),M.point(E[0],E[1])),M.point(T[0],T[1]),u||M.lineEnd(),w=!1)}g=e,v=i,b=u}return T}}var _t,wt,xt,Mt=adder(),Et={sphere:noop,point:noop,lineStart:function lengthLineStart(){Et.point=lengthPointFirst,Et.lineEnd=lengthLineEnd},lineEnd:noop,polygonStart:noop,polygonEnd:noop};function lengthLineEnd(){Et.point=Et.lineEnd=noop}function lengthPointFirst(t,e){_t=t*=h,wt=E(e*=h),xt=v(e),Et.point=lengthPoint}function lengthPoint(t,e){t*=h;var n=E(e*=h),i=v(e),a=d(t-_t),s=v(a),u=i*E(a),c=xt*n-wt*i*s,f=wt*n+xt*i*s;Mt.add(g(S(u*u+c*c),f)),_t=t,wt=n,xt=i}var length=function(t){return Mt.reset(),geoStream(t,Et),+Mt},Tt=[null,null],St={type:"LineString",coordinates:Tt},distance=function(t,e){return Tt[0]=t,Tt[1]=e,length(St)},kt={Feature:function(t,e){return containsGeometry(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,i=-1,a=n.length;++ii})).map(p)).concat(e.range(b(c/M)*M,u,M).filter((function(t){return d(t%T)>i})).map(g))}return graticule.lines=function(){return lines().map((function(t){return{type:"LineString",coordinates:t}}))},graticule.outline=function(){return{type:"Polygon",coordinates:[v(s).concat(_(f).slice(1),v(a).reverse().slice(1),_(h).reverse().slice(1))]}},graticule.extent=function(t){return arguments.length?graticule.extentMajor(t).extentMinor(t):graticule.extentMinor()},graticule.extentMajor=function(t){return arguments.length?(s=+t[0][0],a=+t[1][0],h=+t[0][1],f=+t[1][1],s>a&&(t=s,s=a,a=t),h>f&&(t=h,h=f,f=t),graticule.precision(S)):[[s,h],[a,f]]},graticule.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],c=+e[0][1],u=+e[1][1],n>t&&(e=n,n=t,t=e),c>u&&(e=c,c=u,u=e),graticule.precision(S)):[[n,c],[t,u]]},graticule.step=function(t){return arguments.length?graticule.stepMajor(t).stepMinor(t):graticule.stepMinor()},graticule.stepMajor=function(t){return arguments.length?(E=+t[0],T=+t[1],graticule):[E,T]},graticule.stepMinor=function(t){return arguments.length?(w=+t[0],M=+t[1],graticule):[w,M]},graticule.precision=function(e){return arguments.length?(S=+e,p=graticuleX(c,u,90),g=graticuleY(n,t,S),v=graticuleX(h,f,90),_=graticuleY(s,a,S),graticule):S},graticule.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}var Rt,Nt,At,Ot,identity=function(t){return t},jt=adder(),Lt=adder(),Pt={point:noop,lineStart:noop,lineEnd:noop,polygonStart:function(){Pt.lineStart=areaRingStart$1,Pt.lineEnd=areaRingEnd$1},polygonEnd:function(){Pt.lineStart=Pt.lineEnd=Pt.point=noop,jt.add(d(Lt)),Lt.reset()},result:function(){var t=jt/2;return jt.reset(),t}};function areaRingStart$1(){Pt.point=areaPointFirst$1}function areaPointFirst$1(t,e){Pt.point=areaPoint$1,Rt=At=t,Nt=Ot=e}function areaPoint$1(t,e){Lt.add(Ot*t-At*e),At=t,Ot=e}function areaRingEnd$1(){areaPoint$1(Rt,Nt)}var Ut=1/0,It=Ut,Dt=-Ut,Ft=Dt,qt={point:function boundsPoint$1(t,e){tDt&&(Dt=t);eFt&&(Ft=e)},lineStart:noop,lineEnd:noop,polygonStart:noop,polygonEnd:noop,result:function(){var t=[[Ut,It],[Dt,Ft]];return Dt=Ft=-(It=Ut=1/0),t}};var Bt,zt,Ht,Wt,Yt=0,Xt=0,$t=0,Vt=0,Zt=0,Gt=0,Qt=0,Jt=0,Kt=0,te={point:centroidPoint$1,lineStart:centroidLineStart$1,lineEnd:centroidLineEnd$1,polygonStart:function(){te.lineStart=centroidRingStart$1,te.lineEnd=centroidRingEnd$1},polygonEnd:function(){te.point=centroidPoint$1,te.lineStart=centroidLineStart$1,te.lineEnd=centroidLineEnd$1},result:function(){var t=Kt?[Qt/Kt,Jt/Kt]:Gt?[Vt/Gt,Zt/Gt]:$t?[Yt/$t,Xt/$t]:[NaN,NaN];return Yt=Xt=$t=Vt=Zt=Gt=Qt=Jt=Kt=0,t}};function centroidPoint$1(t,e){Yt+=t,Xt+=e,++$t}function centroidLineStart$1(){te.point=centroidPointFirstLine}function centroidPointFirstLine(t,e){te.point=centroidPointLine,centroidPoint$1(Ht=t,Wt=e)}function centroidPointLine(t,e){var n=t-Ht,i=e-Wt,a=S(n*n+i*i);Vt+=a*(Ht+t)/2,Zt+=a*(Wt+e)/2,Gt+=a,centroidPoint$1(Ht=t,Wt=e)}function centroidLineEnd$1(){te.point=centroidPoint$1}function centroidRingStart$1(){te.point=centroidPointFirstRing}function centroidRingEnd$1(){centroidPointRing(Bt,zt)}function centroidPointFirstRing(t,e){te.point=centroidPointRing,centroidPoint$1(Bt=Ht=t,zt=Wt=e)}function centroidPointRing(t,e){var n=t-Ht,i=e-Wt,a=S(n*n+i*i);Vt+=a*(Ht+t)/2,Zt+=a*(Wt+e)/2,Gt+=a,Qt+=(a=Wt*t-Ht*e)*(Ht+t),Jt+=a*(Wt+e),Kt+=3*a,centroidPoint$1(Ht=t,Wt=e)}function PathContext(t){this._context=t}PathContext.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,c)}},result:noop};var ee,ne,re,ie,oe,ae=adder(),se={point:noop,lineStart:function(){se.point=lengthPointFirst$1},lineEnd:function(){ee&&lengthPoint$1(ne,re),se.point=noop},polygonStart:function(){ee=!0},polygonEnd:function(){ee=null},result:function(){var t=+ae;return ae.reset(),t}};function lengthPointFirst$1(t,e){se.point=lengthPoint$1,ne=ie=t,re=oe=e}function lengthPoint$1(t,e){ie-=t,oe-=e,ae.add(S(ie*ie+oe*oe)),ie=t,oe=e}function PathString(){this._string=[]}function circle$1(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}PathString.prototype={_radius:4.5,_circle:circle$1(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=circle$1(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};function transformer(t){return function(e){var n=new TransformStream;for(var i in t)n[i]=t[i];return n.stream=e,n}}function TransformStream(){}function fit(t,e,n){var i=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=i&&t.clipExtent(null),geoStream(n,t.stream(qt)),e(qt.result()),null!=i&&t.clipExtent(i),t}function fitExtent(t,e,n){return fit(t,(function(n){var i=e[1][0]-e[0][0],a=e[1][1]-e[0][1],s=Math.min(i/(n[1][0]-n[0][0]),a/(n[1][1]-n[0][1])),u=+e[0][0]+(i-s*(n[1][0]+n[0][0]))/2,c=+e[0][1]+(a-s*(n[1][1]+n[0][1]))/2;t.scale(150*s).translate([u,c])}),n)}function fitSize(t,e,n){return fitExtent(t,[[0,0],e],n)}function fitWidth(t,e,n){return fit(t,(function(n){var i=+e,a=i/(n[1][0]-n[0][0]),s=(i-a*(n[1][0]+n[0][0]))/2,u=-a*n[0][1];t.scale(150*a).translate([s,u])}),n)}function fitHeight(t,e,n){return fit(t,(function(n){var i=+e,a=i/(n[1][1]-n[0][1]),s=-a*n[0][0],u=(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([s,u])}),n)}TransformStream.prototype={constructor:TransformStream,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ue=v(30*h),resample=function(t,e){return+e?function resample$1(t,e){function resampleLineTo(n,a,s,u,c,f,h,p,v,b,_,w,M,E){var T=h-n,k=p-a,C=T*T+k*k;if(C>4*e&&M--){var R=u+b,N=c+_,A=f+w,O=S(R*R+N*N+A*A),j=asin(A/=O),L=d(d(A)-1)e||d((T*D+k*q)/C-.5)>.3||u*b+c*_+f*w2?t[2]%360*h:0,recenter()):[E*f,T*f,k*f]},projection.precision=function(t){return arguments.length?(j=resample(projectTransform,O=t*t),reset()):S(O)},projection.fitExtent=function(t,e){return fitExtent(projection,t,e)},projection.fitSize=function(t,e){return fitSize(projection,t,e)},projection.fitWidth=function(t,e){return fitWidth(projection,t,e)},projection.fitHeight=function(t,e){return fitHeight(projection,t,e)},function(){return e=t.apply(this,arguments),projection.invert=e.invert&&invert,recenter()}}function conicProjection(t){var e=0,n=a/3,i=projectionMutator(t),s=i(e,n);return s.parallels=function(t){return arguments.length?i(e=t[0]*h,n=t[1]*h):[e*f,n*f]},s}function conicEqualAreaRaw(t,e){var n=E(t),a=(n+E(e))/2;if(d(a)0?e<-s+i&&(e=-s+i):e>s-i&&(e=s-i);var n=u/M(tany(e),a);return[n*E(a*t),u-n*v(a*t)]}return project.invert=function(t,e){var n=u-e,i=T(a)*S(t*t+n*n);return[g(t,d(n))/a*T(n),2*p(M(u/i,1/a))-s]},project}function equirectangularRaw(t,e){return[t,e]}equirectangularRaw.invert=equirectangularRaw;function conicEquidistantRaw(t,e){var n=v(t),a=t===e?E(t):(n-v(e))/(e-t),s=n/a+t;if(d(a)i&&--s>0);return[t/(.8707+(u=a*a)*(u*(u*u*u*(.003971-.001529*u)-.013791)-.131979)),a]};function orthographicRaw(t,e){return[v(e)*E(t),E(e)]}orthographicRaw.invert=azimuthalInvert(asin);function stereographicRaw(t,e){var n=v(e),i=1+v(t)*n;return[n*E(t)/i,E(e)/i]}stereographicRaw.invert=azimuthalInvert((function(t){return 2*p(t)}));function transverseMercatorRaw(t,e){return[w(k((s+e)/2)),-t]}transverseMercatorRaw.invert=function(t,e){return[-e,2*p(_(t))-s]};t.geoArea=function(t){return U.reset(),geoStream(t,I),2*U},t.geoBounds=function(t){var e,n,i,a,s,u,c;if(z=B=-(D=q=1/0),Z=[],geoStream(t,J),n=Z.length){for(Z.sort(rangeCompare),e=1,s=[i=Z[0]];eangle(i[0],i[1])&&(i[1]=a[1]),angle(a[0],i[1])>angle(i[0],i[1])&&(i[0]=a[0])):s.push(i=a);for(u=-1/0,e=0,i=s[n=s.length-1];e<=n;i=a,++e)a=s[e],(c=angle(i[1],a[0]))>u&&(u=c,D=a[0],B=i[1])}return Z=G=null,D===1/0||q===1/0?[[NaN,NaN],[NaN,NaN]]:[[D,q],[B,z]]},t.geoCentroid=function(t){K=tt=et=nt=rt=it=ot=at=st=ut=ct=0,geoStream(t,mt);var e=st,n=ut,a=ct,s=e*e+n*n+a*a;return s<1e-12&&(e=it,n=ot,a=at,tt=.12&&a<.234&&i>=-.425&&i<-.214?f:a>=.166&&a<.234&&i>=-.214&&i<-.115?h:c).invert(t)},albersUsa.stream=function(n){return t&&e===n?t:t=function multiplex(t){var e=t.length;return{point:function(n,i){for(var a=-1;++a2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=transverseMercatorRaw,t.geoRotation=rotation,t.geoStream=geoStream,t.geoTransform=function(t){return{stream:transformer(t)}},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":39}],53:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){function defaultSeparation(t,e){return t.parent===e.parent?1:2}function meanXReduce(t,e){return t+e.x}function maxYReduce(t,e){return Math.max(t,e.y)}function count(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function hierarchy(t,e){var n,i,a,s,u,c=new Node(t),f=+t.value&&(c.value=t.value),h=[c];for(null==e&&(e=defaultChildren);n=h.pop();)if(f&&(n.value=+n.data.value),(a=e(n.data))&&(u=a.length))for(n.children=new Array(u),s=u-1;s>=0;--s)h.push(i=n.children[s]=new Node(a[s])),i.parent=n,i.depth=n.depth+1;return c.eachBefore(computeHeight)}function defaultChildren(t){return t.children}function copyData(t){t.data=t.data.data}function computeHeight(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Node(t){this.data=t,this.depth=this.height=0,this.parent=null}Node.prototype=hierarchy.prototype={constructor:Node,count:function(){return this.eachAfter(count)},each:function(t){var e,n,i,a,s=this,u=[s];do{for(e=u.reverse(),u=[];s=e.pop();)if(t(s),n=s.children)for(i=0,a=n.length;i=0;--n)a.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,a=i&&i.length;--a>=0;)n+=i[a].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function leastCommonAncestor(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),a=null;t=n.pop(),e=i.pop();for(;t===e;)a=t,t=n.pop(),e=i.pop();return a}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var a=i.length;t!==n;)i.splice(a,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function node_copy(){return hierarchy(this).eachBefore(copyData)}};var e=Array.prototype.slice;var enclose=function(t){for(var n,i,a=0,s=(t=function shuffle(t){for(var e,n,i=t.length;i;)n=Math.random()*i--|0,e=t[i],t[i]=t[n],t[n]=e;return t}(e.call(t))).length,u=[];a0&&n*n>i*i+a*a}function enclosesWeakAll(t,e){for(var n=0;nn*n+i*i}function score(t){var e=t._,n=t.next._,i=e.r+n.r,a=(e.x*n.r+n.x*e.r)/i,s=(e.y*n.r+n.y*e.r)/i;return a*a+s*s}function Node$1(t){this._=t,this.next=null,this.previous=null}function packEnclose(t){if(!(a=t.length))return 0;var e,n,i,a,s,u,c,f,h,d,p;if((e=t[0]).x=0,e.y=0,!(a>1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(a>2))return e.r+n.r;place(n,e,i=t[2]),e=new Node$1(e),n=new Node$1(n),i=new Node$1(i),e.next=i.previous=n,n.next=e.previous=i,i.next=n.previous=e;t:for(c=3;cg&&(g=c),w=d*d*_,(v=Math.max(g/w,w/p))>b){d-=c;break}b=v}M.push(u={value:d,dice:f1?t:1)},squarify}(a),u=function custom(t){function resquarify(e,n,i,a,s){if((u=e._squarify)&&u.ratio===t)for(var u,c,f,h,d,p=-1,g=u.length,v=e.value;++p1?t:1)},resquarify}(a);t.cluster=function(){var t=defaultSeparation,e=1,n=1,i=!1;function cluster(a){var s,u=0;a.eachAfter((function(e){var n=e.children;n?(e.x=function meanX(t){return t.reduce(meanXReduce,0)/t.length}(n),e.y=function maxY(t){return 1+t.reduce(maxYReduce,0)}(n)):(e.x=s?u+=t(e,s):0,e.y=0,s=e)}));var c=function leafLeft(t){for(var e;e=t.children;)t=e[0];return t}(a),f=function leafRight(t){for(var e;e=t.children;)t=e[e.length-1];return t}(a),h=c.x-t(c,f)/2,d=f.x+t(f,c)/2;return a.eachAfter(i?function(t){t.x=(t.x-a.x)*e,t.y=(a.y-t.y)*n}:function(t){t.x=(t.x-h)/(d-h)*e,t.y=(1-(a.y?t.y/a.y:1))*n})}return cluster.separation=function(e){return arguments.length?(t=e,cluster):t},cluster.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],cluster):i?null:[e,n]},cluster.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],cluster):i?[e,n]:null},cluster},t.hierarchy=hierarchy,t.pack=function(){var t=null,e=1,n=1,i=constantZero;function pack(a){return a.x=e/2,a.y=n/2,t?a.eachBefore(radiusLeaf(t)).eachAfter(packChildren(i,.5)).eachBefore(translateChild(1)):a.eachBefore(radiusLeaf(defaultRadius)).eachAfter(packChildren(constantZero,1)).eachAfter(packChildren(i,a.r/Math.min(e,n))).eachBefore(translateChild(Math.min(e,n)/(2*a.r))),a}return pack.radius=function(e){return arguments.length?(t=function optional(t){return null==t?null:required(t)}(e),pack):t},pack.size=function(t){return arguments.length?(e=+t[0],n=+t[1],pack):[e,n]},pack.padding=function(t){return arguments.length?(i="function"==typeof t?t:constant(+t),pack):i},pack},t.packSiblings=function(t){return packEnclose(t),t},t.packEnclose=enclose,t.partition=function(){var t=1,e=1,n=0,i=!1;function partition(a){var s=a.height+1;return a.x0=a.y0=n,a.x1=t,a.y1=e/s,a.eachBefore(function positionNode(t,e){return function(i){i.children&&treemapDice(i,i.x0,t*(i.depth+1)/e,i.x1,t*(i.depth+2)/e);var a=i.x0,s=i.y0,u=i.x1-n,c=i.y1-n;u0)throw new Error("cycle");return c}return stratify.id=function(e){return arguments.length?(t=required(e),stratify):t},stratify.parentId=function(t){return arguments.length?(e=required(t),stratify):e},stratify},t.tree=function(){var t=defaultSeparation$1,e=1,n=1,i=null;function tree(a){var s=function treeRoot(t){for(var e,n,i,a,s,u=new TreeNode(t,0),c=[u];e=c.pop();)if(i=e._.children)for(e.children=new Array(s=i.length),a=s-1;a>=0;--a)c.push(n=e.children[a]=new TreeNode(i[a],a)),n.parent=e;return(u.parent=new TreeNode(null,0)).children=[u],u}(a);if(s.eachAfter(firstWalk),s.parent.m=-s.z,s.eachBefore(secondWalk),i)a.eachBefore(sizeNode);else{var u=a,c=a,f=a;a.eachBefore((function(t){t.xc.x&&(c=t),t.depth>f.depth&&(f=t)}));var h=u===c?1:t(u,c)/2,d=h-u.x,p=e/(c.x+h+d),g=n/(f.depth||1);a.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return a}function firstWalk(e){var n=e.children,i=e.parent.children,a=e.i?i[e.i-1]:null;if(n){!function executeShifts(t){for(var e,n=0,i=0,a=t.children,s=a.length;--s>=0;)(e=a[s]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var s=(n[0].z+n[n.length-1].z)/2;a?(e.z=a.z+t(e._,a._),e.m=e.z-s):e.z=s}else a&&(e.z=a.z+t(e._,a._));e.parent.A=function apportion(e,n,i){if(n){for(var a,s=e,u=e,c=n,f=s.parent.children[0],h=s.m,d=u.m,p=c.m,g=f.m;c=nextRight(c),s=nextLeft(s),c&&s;)f=nextLeft(f),(u=nextRight(u)).a=e,(a=c.z+p-s.z-h+t(c._,s._))>0&&(moveSubtree(nextAncestor(c,e,i),e,a),h+=a,d+=a),p+=c.m,h+=s.m,g+=f.m,d+=u.m;c&&!nextRight(u)&&(u.t=c,u.m+=p-d),s&&!nextLeft(f)&&(f.t=s,f.m+=h-g,i=e)}return i}(e,a,e.parent.A||i[0])}function secondWalk(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function sizeNode(t){t.x*=e,t.y=t.depth*n}return tree.separation=function(e){return arguments.length?(t=e,tree):t},tree.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],tree):i?null:[e,n]},tree.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],tree):i?[e,n]:null},tree},t.treemap=function(){var t=s,e=!1,n=1,i=1,a=[0],u=constantZero,c=constantZero,f=constantZero,h=constantZero,d=constantZero;function treemap(t){return t.x0=t.y0=0,t.x1=n,t.y1=i,t.eachBefore(positionNode),a=[0],e&&t.eachBefore(roundNode),t}function positionNode(e){var n=a[e.depth],i=e.x0+n,s=e.y0+n,p=e.x1-n,g=e.y1-n;p=e-1){var f=c[t];return f.x0=i,f.y0=a,f.x1=s,void(f.y1=u)}var d=h[t],p=n/2+d,g=t+1,v=e-1;for(;g>>1;h[b]u-a){var M=(i*w+s*_)/n;partition(t,g,_,i,a,M,u),partition(g,e,w,M,a,s,u)}else{var E=(a*w+u*_)/n;partition(t,g,_,i,a,s,E),partition(g,e,w,i,E,s,u)}}(0,f,t.value,e,n,i,a)},t.treemapDice=treemapDice,t.treemapSlice=treemapSlice,t.treemapSliceDice=function(t,e,n,i,a){(1&t.depth?treemapSlice:treemapDice)(t,e,n,i,a)},t.treemapSquarify=s,t.treemapResquarify=u,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],54:[function(t,e,n){!function(i,a){"object"==typeof n&&void 0!==e?a(n,t("d3-color")):"function"==typeof define&&define.amd?define(["exports","d3-color"],a):a((i=i||self).d3=i.d3||{},i.d3)}(this,(function(t,e){function basis(t,e,n,i,a){var s=t*t,u=s*t;return((1-3*t+3*s-u)*e+(4-6*s+3*u)*n+(1+3*t+3*s-3*u)*i+u*a)/6}function basis$1(t){var e=t.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),a=t[i],s=t[i+1],u=i>0?t[i-1]:2*a-s,c=i180||n<-180?n-360*Math.round(n/360):n):constant(isNaN(t)?e:t)}function gamma(t){return 1==(t=+t)?nogamma:function(e,n){return n-e?function exponential(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):constant(isNaN(e)?n:e)}}function nogamma(t,e){var n=e-t;return n?linear(t,n):constant(isNaN(t)?e:t)}var n=function rgbGamma(t){var n=gamma(t);function rgb(t,i){var a=n((t=e.rgb(t)).r,(i=e.rgb(i)).r),s=n(t.g,i.g),u=n(t.b,i.b),c=nogamma(t.opacity,i.opacity);return function(e){return t.r=a(e),t.g=s(e),t.b=u(e),t.opacity=c(e),t+""}}return rgb.gamma=rgbGamma,rgb}(1);function rgbSpline(t){return function(n){var i,a,s=n.length,u=new Array(s),c=new Array(s),f=new Array(s);for(i=0;ic&&(a=e.slice(c,a),h[f]?h[f]+=a:h[++f]=a),(n=n[0])===(i=i[0])?h[f]?h[f]+=i:h[++f]=i:(h[++f]=null,d.push({i:f,x:number(n,i)})),c=u.lastIndex;return c180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(pop(n)+"rotate(",null,i)-2,x:number(t,e)})):e&&n.push(pop(n)+"rotate("+e+i)}(a.rotate,s.rotate,u,c),function skewX(t,e,n,a){t!==e?a.push({i:n.push(pop(n)+"skewX(",null,i)-2,x:number(t,e)}):e&&n.push(pop(n)+"skewX("+e+i)}(a.skewX,s.skewX,u,c),function scale(t,e,n,i,a,s){if(t!==n||e!==i){var u=a.push(pop(a)+"scale(",null,",",null,")");s.push({i:u-4,x:number(t,n)},{i:u-2,x:number(e,i)})}else 1===n&&1===i||a.push(pop(a)+"scale("+n+","+i+")")}(a.scaleX,a.scaleY,s.scaleX,s.scaleY,u,c),a=s=null,function(t){for(var e,n=-1,i=c.length;++ni)if(Math.abs(g*h-d*p)>i&&u){var b=a-c,_=s-f,w=h*h+d*d,M=b*b+_*_,E=Math.sqrt(w),T=Math.sqrt(v),S=u*Math.tan((e-Math.acos((w+v-M)/(2*E*T)))/2),k=S/T,C=S/E;Math.abs(k-1)>i&&(this._+="L"+(t+k*p)+","+(n+k*g)),this._+="A"+u+","+u+",0,0,"+ +(g*b>p*_)+","+(this._x1=t+C*h)+","+(this._y1=n+C*d)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,s,u,c,f,h){t=+t,s=+s,h=!!h;var d=(u=+u)*Math.cos(c),p=u*Math.sin(c),g=t+d,v=s+p,b=1^h,_=h?c-f:f-c;if(u<0)throw new Error("negative radius: "+u);null===this._x1?this._+="M"+g+","+v:(Math.abs(this._x1-g)>i||Math.abs(this._y1-v)>i)&&(this._+="L"+g+","+v),u&&(_<0&&(_=_%n+n),_>a?this._+="A"+u+","+u+",0,1,"+b+","+(t-d)+","+(s-p)+"A"+u+","+u+",0,1,"+b+","+(this._x1=g)+","+(this._y1=v):_>i&&(this._+="A"+u+","+u+",0,"+ +(_>=e)+","+b+","+(this._x1=t+u*Math.cos(f))+","+(this._y1=s+u*Math.sin(f))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}},t.path=path,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],56:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){function lexicographicOrder(t,e){return t[0]-e[0]||t[1]-e[1]}function computeUpperHullIndexes(t){for(var e,n,i,a=t.length,s=[0,1],u=2,c=2;c1&&(e=t[s[u-2]],n=t[s[u-1]],i=t[c],(n[0]-e[0])*(i[1]-e[1])-(n[1]-e[1])*(i[0]-e[0])<=0);)--u;s[u++]=c}return s.slice(0,u)}t.polygonArea=function(t){for(var e,n=-1,i=t.length,a=t[i-1],s=0;++n=0;--e)h.push(t[i[s[e]][2]]);for(e=+c;ec!=h>c&&u<(f-n)*(c-i)/(h-i)+n&&(d=!d),f=n,h=i;return d},t.polygonLength=function(t){for(var e,n,i=-1,a=t.length,s=t[a-1],u=s[0],c=s[1],f=0;++i=(s=(_+M)/2))?_=s:M=s,(d=n>=(u=(w+E)/2))?w=u:E=u,a=v,!(v=v[p=d<<1|h]))return a[p]=b,t;if(c=+t._x.call(null,v.data),f=+t._y.call(null,v.data),e===c&&n===f)return b.next=v,a?a[p]=b:t._root=b,t;do{a=a?a[p]=new Array(4):t._root=new Array(4),(h=e>=(s=(_+M)/2))?_=s:M=s,(d=n>=(u=(w+E)/2))?w=u:E=u}while((p=d<<1|h)==(g=(f>=u)<<1|c>=s));return a[g]=v,a[p]=b,t}var Quad=function(t,e,n,i,a){this.node=t,this.x0=e,this.y0=n,this.x1=i,this.y1=a};function defaultX(t){return t[0]}function defaultY(t){return t[1]}function quadtree(t,e,n){var i=new Quadtree(null==e?defaultX:e,null==n?defaultY:n,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function Quadtree(t,e,n,i,a,s){this._x=t,this._y=e,this._x0=n,this._y0=i,this._x1=a,this._y1=s,this._root=void 0}function leaf_copy(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var e=quadtree.prototype=Quadtree.prototype;e.copy=function(){var t,e,n=new Quadtree(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=leaf_copy(i),n;for(t=[{source:i,target:n._root=new Array(4)}];i=t.pop();)for(var a=0;a<4;++a)(e=i.source[a])&&(e.length?t.push({source:e,target:i.target[a]=new Array(4)}):i.target[a]=leaf_copy(e));return n},e.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return add(this.cover(e,n),e,n,t)},e.addAll=function addAll(t){var e,n,i,a,s=t.length,u=new Array(s),c=new Array(s),f=1/0,h=1/0,d=-1/0,p=-1/0;for(n=0;nd&&(d=i),ap&&(p=a));for(dt||t>a||i>e||e>s))return this;var u,c,f=a-n,h=this._root;switch(c=(e<(i+s)/2)<<1|t<(n+a)/2){case 0:do{(u=new Array(4))[c]=h,h=u}while(s=i+(f*=2),t>(a=n+f)||e>s);break;case 1:do{(u=new Array(4))[c]=h,h=u}while(s=i+(f*=2),(n=a-f)>t||e>s);break;case 2:do{(u=new Array(4))[c]=h,h=u}while(i=s-(f*=2),t>(a=n+f)||i>e);break;case 3:do{(u=new Array(4))[c]=h,h=u}while(i=s-(f*=2),(n=a-f)>t||i>e)}this._root&&this._root.length&&(this._root=h)}return this._x0=n,this._y0=i,this._x1=a,this._y1=s,this},e.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},e.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},e.find=function(t,e,n){var i,a,s,u,c,f,h,d=this._x0,p=this._y0,g=this._x1,v=this._y1,b=[],_=this._root;for(_&&b.push(new Quad(_,d,p,g,v)),null==n?n=1/0:(d=t-n,p=e-n,g=t+n,v=e+n,n*=n);f=b.pop();)if(!(!(_=f.node)||(a=f.x0)>g||(s=f.y0)>v||(u=f.x1)=M)<<1|t>=w)&&(f=b[b.length-1],b[b.length-1]=b[b.length-1-h],b[b.length-1-h]=f)}else{var E=t-+this._x.call(null,_.data),T=e-+this._y.call(null,_.data),S=E*E+T*T;if(S=(c=(b+w)/2))?b=c:w=c,(d=u>=(f=(_+M)/2))?_=f:M=f,e=v,!(v=v[p=d<<1|h]))return this;if(!v.length)break;(e[p+1&3]||e[p+2&3]||e[p+3&3])&&(n=e,g=p)}for(;v.data!==t;)if(i=v,!(v=v.next))return this;return(a=v.next)&&delete v.next,i?(a?i.next=a:delete i.next,this):e?(a?e[p]=a:delete e[p],(v=e[0]||e[1]||e[2]||e[3])&&v===(e[3]||e[2]||e[1]||e[0])&&!v.length&&(n?n[g]=v:this._root=v),this):(this._root=a,this)},e.removeAll=function removeAll(t){for(var e=0,n=t.length;e=0;)if((n=t._tasks[i])&&(t._tasks[i]=null,n.abort))try{n.abort()}catch(e){}t._active=NaN,maybeNotify(t)}function maybeNotify(t){if(!t._active&&t._call){var e=t._data;t._data=void 0,t._call(t._error,e)}}function queue(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new Queue(t)}Queue.prototype=queue.prototype={constructor:Queue,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=e.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),poke(this),this},abort:function(){return null==this._error&&abort(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(e,n){t.apply(null,[e].concat(n))},maybeNotify(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,maybeNotify(this),this}},t.queue=queue,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],59:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var defaultSource=function(){return Math.random()},e=function sourceRandomUniform(t){function randomUniform(e,n){return e=null==e?0:+e,n=null==n?1:+n,1===arguments.length?(n=e,e=0):n-=e,function(){return t()*n+e}}return randomUniform.source=sourceRandomUniform,randomUniform}(defaultSource),n=function sourceRandomNormal(t){function randomNormal(e,n){var i,a;return e=null==e?0:+e,n=null==n?1:+n,function(){var s;if(null!=i)s=i,i=null;else do{i=2*t()-1,s=2*t()-1,a=i*i+s*s}while(!a||a>1);return e+n*s*Math.sqrt(-2*Math.log(a)/a)}}return randomNormal.source=sourceRandomNormal,randomNormal}(defaultSource),i=function sourceRandomLogNormal(t){function randomLogNormal(){var e=n.source(t).apply(this,arguments);return function(){return Math.exp(e())}}return randomLogNormal.source=sourceRandomLogNormal,randomLogNormal}(defaultSource),a=function sourceRandomIrwinHall(t){function randomIrwinHall(e){return function(){for(var n=0,i=0;i=200&&i<300||304===i){if(c)try{e=c.call(n,p)}catch(t){return void h.call("error",n,t)}else e=p;h.call("load",n,e)}else h.call("error",n,t)}if("undefined"!=typeof XDomainRequest&&!("withCredentials"in p)&&/^(http(s)?:)?\/\//.test(t)&&(p=new XDomainRequest),"onload"in p?p.onload=p.onerror=p.ontimeout=respond:p.onreadystatechange=function(t){p.readyState>3&&respond(t)},p.onprogress=function(t){h.call("progress",n,t)},n={header:function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?d.get(t):(null==e?d.remove(t):d.set(t,e+""),n)},mimeType:function(t){return arguments.length?(u=null==t?null:t+"",n):u},responseType:function(t){return arguments.length?(f=t,n):f},timeout:function(t){return arguments.length?(b=+t,n):b},user:function(t){return arguments.length<1?g:(g=null==t?null:t+"",n)},password:function(t){return arguments.length<1?v:(v=null==t?null:t+"",n)},response:function(t){return c=t,n},get:function(t,e){return n.send("GET",t,e)},post:function(t,e){return n.send("POST",t,e)},send:function(e,i,a){return p.open(e,t,!0,g,v),null==u||d.has("accept")||d.set("accept",u+",*/*"),p.setRequestHeader&&d.each((function(t,e){p.setRequestHeader(e,t)})),null!=u&&p.overrideMimeType&&p.overrideMimeType(u),null!=f&&(p.responseType=f),b>0&&(p.timeout=b),null==a&&"function"==typeof i&&(a=i,i=null),null!=a&&1===a.length&&(a=function fixCallback(t){return function(e,n){t(null==e?n:null)}}(a)),null!=a&&n.on("error",a).on("load",(function(t){a(null,t)})),h.call("beforesend",n,p),p.send(null==i?null:i),n},abort:function(){return p.abort(),n},on:function(){var t=h.on.apply(h,arguments);return t===h?n:t}},null!=e){if("function"!=typeof e)throw new Error("invalid callback: "+e);return n.get(e)}return n};var type=function(t,e){return function(n,i){var a=request(n).mimeType(t).response(e);if(null!=i){if("function"!=typeof i)throw new Error("invalid callback: "+i);return a.get(i)}return a}},c=type("text/html",(function(t){return document.createRange().createContextualFragment(t.responseText)})),f=type("application/json",(function(t){return JSON.parse(t.responseText)})),h=type("text/plain",(function(t){return t.responseText})),d=type("application/xml",(function(t){var e=t.responseXML;if(!e)throw new Error("parse error");return e})),dsv=function(t,e){return function(n,i,a){arguments.length<3&&(a=i,i=null);var s=request(n).mimeType(t);return s.row=function(t){return arguments.length?s.response(function responseOf(t,e){return function(n){return t(n.responseText,e)}}(e,i=t)):i},s.row(i),a?s.get(a):s}};var p=dsv("text/csv",u.csvParse),g=dsv("text/tab-separated-values",u.tsvParse);n.request=request,n.html=c,n.json=f,n.text=h,n.xml=d,n.csv=p,n.tsv=g},{"d3-collection":43,"d3-dispatch":45,"d3-dsv":61,xmlhttprequest:109}],61:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){var e={},n={};function objectConverter(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function inferColumns(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var i in t)i in e||n.push(e[i]=i)})),n}function pad(t,e){var n=t+"",i=n.length;return i9999?"+"+pad(t,6):pad(t,4)}(t.getUTCFullYear())+"-"+pad(t.getUTCMonth()+1,2)+"-"+pad(t.getUTCDate(),2)+(a?"T"+pad(e,2)+":"+pad(n,2)+":"+pad(i,2)+"."+pad(a,3)+"Z":i?"T"+pad(e,2)+":"+pad(n,2)+":"+pad(i,2)+"Z":n||e?"T"+pad(e,2)+":"+pad(n,2)+"Z":"")}function dsv(t){var i=new RegExp('["'+t+"\n\r]"),a=t.charCodeAt(0);function parseRows(t,i){var s,u=[],c=t.length,f=0,h=0,d=c<=0,p=!1;function token(){if(d)return n;if(p)return p=!1,e;var i,s,u=f;if(34===t.charCodeAt(u)){for(;f++=c?d=!0:10===(s=t.charCodeAt(f++))?p=!0:13===s&&(p=!0,10===t.charCodeAt(f)&&++f),t.slice(u+1,i-1).replace(/""/g,'"')}for(;f2?polymap:bimap,a=s=null,scale}function scale(e){return(a||(a=n(u,c,p?function deinterpolateClamp(t){return function(e,n){var i=t(e=+e,n=+n);return function(t){return t<=e?0:t>=n?1:i(t)}}}(t):t,f)))(+e)}return scale.invert=function(t){return(s||(s=n(c,u,deinterpolateLinear,p?function reinterpolateClamp(t){return function(e,n){var i=t(e=+e,n=+n);return function(t){return t<=0?e:t>=1?n:i(t)}}}(e):e)))(+t)},scale.domain=function(t){return arguments.length?(u=h.call(t,number),rescale()):u.slice()},scale.range=function(t){return arguments.length?(c=d.call(t),rescale()):c.slice()},scale.rangeRound=function(t){return c=d.call(t),f=i.interpolateRound,rescale()},scale.clamp=function(t){return arguments.length?(p=!!t,rescale()):p},scale.interpolate=function(t){return arguments.length?(f=t,rescale()):f},rescale()}function linearish(t){var n=t.domain;return t.ticks=function(t){var i=n();return e.ticks(i[0],i[i.length-1],null==t?10:t)},t.tickFormat=function(t,i){return function(t,n,i){var s,u=t[0],c=t[t.length-1],f=e.tickStep(u,c,null==n?10:n);switch((i=a.formatSpecifier(null==i?",f":i)).type){case"s":var h=Math.max(Math.abs(u),Math.abs(c));return null!=i.precision||isNaN(s=a.precisionPrefix(f,h))||(i.precision=s),a.formatPrefix(i,h);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(s=a.precisionRound(f,Math.max(Math.abs(u),Math.abs(c))))||(i.precision=s-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(s=a.precisionFixed(f))||(i.precision=s-2*("%"===i.type))}return a.format(i)}(n(),t,i)},t.nice=function(i){null==i&&(i=10);var a,s=n(),u=0,c=s.length-1,f=s[u],h=s[c];return h0?(f=Math.floor(f/a)*a,h=Math.ceil(h/a)*a,a=e.tickIncrement(f,h,i)):a<0&&(f=Math.ceil(f*a)/a,h=Math.floor(h*a)/a,a=e.tickIncrement(f,h,i)),a>0?(s[u]=Math.floor(f/a)*a,s[c]=Math.ceil(h/a)*a,n(s)):a<0&&(s[u]=Math.ceil(f*a)/a,s[c]=Math.floor(h*a)/a,n(s)),t},t}var nice=function(t,e){var n,i=0,a=(t=t.slice()).length-1,s=t[i],u=t[a];return u0){for(;vh)break;w.push(g)}}else for(;v=1;--p)if(!((g=d*p)h)break;w.push(g)}}else w=e.ticks(v,b,Math.min(b-v,_)).map(u);return a?w.reverse():w},t.tickFormat=function(e,n){if(null==n&&(n=10===i?".0e":","),"function"!=typeof n&&(n=a.format(n)),e===1/0)return n;null==e&&(e=10);var c=Math.max(1,i*e/t.ticks().length);return function(t){var e=t/u(Math.round(s(t)));return e*i0?i[a-1]:t[0],a=i?[a[i-1],n]:[a[u-1],a[u]]},scale.copy=function(){return quantize().domain([t,n]).range(s)},linearish(scale)},t.scaleThreshold=function threshold(){var t=[.5],n=[0,1],i=1;function scale(a){if(a<=a)return n[e.bisect(t,a,0,i)]}return scale.domain=function(e){return arguments.length?(t=d.call(e),i=Math.min(t.length,n.length-1),scale):t.slice()},scale.range=function(e){return arguments.length?(n=d.call(e),i=Math.min(t.length,n.length-1),scale):n.slice()},scale.invertExtent=function(e){var i=n.indexOf(e);return[t[i-1],t[i]]},scale.copy=function(){return threshold().domain(t).range(n)},scale},t.scaleTime=function(){return calendar(s.timeYear,s.timeMonth,s.timeWeek,s.timeDay,s.timeHour,s.timeMinute,s.timeSecond,s.timeMillisecond,u.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)])},t.scaleUtc=function(){return calendar(s.utcYear,s.utcMonth,s.utcWeek,s.utcDay,s.utcHour,s.utcMinute,s.utcSecond,s.utcMillisecond,u.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])},t.schemeCategory10=T,t.schemeCategory20b=S,t.schemeCategory20c=k,t.schemeCategory20=C,t.interpolateCubehelixDefault=R,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return O.h=360*t-100,O.s=1.5-1.5*e,O.l=.8-.9*e,O+""},t.interpolateWarm=N,t.interpolateCool=A,t.interpolateViridis=j,t.interpolateMagma=L,t.interpolateInferno=P,t.interpolatePlasma=U,t.scaleSequential=function sequential(t){var e=0,n=1,i=!1;function scale(a){var s=(a-e)/(n-e);return t(i?Math.max(0,Math.min(1,s)):s)}return scale.domain=function(t){return arguments.length?(e=+t[0],n=+t[1],scale):[e,n]},scale.clamp=function(t){return arguments.length?(i=!!t,scale):i},scale.interpolator=function(e){return arguments.length?(t=e,scale):t},scale.copy=function(){return sequential(t).domain([e,n]).clamp(i)},linearish(scale)},Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-array":39,"d3-collection":43,"d3-color":44,"d3-format":63,"d3-interpolate":54,"d3-time":68,"d3-time-format":64}],63:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){function formatDecimal(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function exponent(t){return(t=formatDecimal(Math.abs(t)))?t[1]:NaN}var e,n=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(t){if(!(e=n.exec(t)))throw new Error("invalid format: "+t);var e;return new FormatSpecifier({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function FormatSpecifier(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function formatRounded(t,e){var n=formatDecimal(t,e);if(!n)return t+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var i={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return formatRounded(100*t,e)},r:formatRounded,s:function formatPrefixAuto(t,n){var i=formatDecimal(t,n);if(!i)return t+"";var a=i[0],s=i[1],u=s-(e=3*Math.max(-8,Math.min(8,Math.floor(s/3))))+1,c=a.length;return u===c?a:u>c?a+new Array(u-c+1).join("0"):u>0?a.slice(0,u)+"."+a.slice(u):"0."+new Array(1-u).join("0")+formatDecimal(t,Math.max(0,n+u-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function identity(t){return t}var a,s=Array.prototype.map,u=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function formatLocale(t){var n=void 0===t.grouping||void 0===t.thousands?identity:function formatGroup(t,e){return function(n,i){for(var a=n.length,s=[],u=0,c=t[0],f=0;a>0&&c>0&&(f+c+1>i&&(c=Math.max(1,i-f)),s.push(n.substring(a-=c,a+c)),!((f+=c+1)>i));)c=t[u=(u+1)%t.length];return s.reverse().join(e)}}(s.call(t.grouping,Number),t.thousands+""),a=void 0===t.currency?"":t.currency[0]+"",c=void 0===t.currency?"":t.currency[1]+"",f=void 0===t.decimal?".":t.decimal+"",h=void 0===t.numerals?identity:function formatNumerals(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(s.call(t.numerals,String)),d=void 0===t.percent?"%":t.percent+"",p=void 0===t.minus?"-":t.minus+"",g=void 0===t.nan?"NaN":t.nan+"";function newFormat(t){var s=(t=formatSpecifier(t)).fill,v=t.align,b=t.sign,_=t.symbol,w=t.zero,M=t.width,E=t.comma,T=t.precision,S=t.trim,k=t.type;"n"===k?(E=!0,k="g"):i[k]||(void 0===T&&(T=12),S=!0,k="g"),(w||"0"===s&&"="===v)&&(w=!0,s="0",v="=");var C="$"===_?a:"#"===_&&/[boxX]/.test(k)?"0"+k.toLowerCase():"",R="$"===_?c:/[%p]/.test(k)?d:"",N=i[k],A=/[defgprs%]/.test(k);function format(t){var i,a,c,d=C,_=R;if("c"===k)_=N(t)+_,t="";else{var O=(t=+t)<0||1/t<0;if(t=isNaN(t)?g:N(Math.abs(t),T),S&&(t=function formatTrim(t){t:for(var e,n=t.length,i=1,a=-1;i0&&(a=0)}return a>0?t.slice(0,a)+t.slice(e+1):t}(t)),O&&0==+t&&"+"!==b&&(O=!1),d=(O?"("===b?b:p:"-"===b||"("===b?"":b)+d,_=("s"===k?u[8+e/3]:"")+_+(O&&"("===b?")":""),A)for(i=-1,a=t.length;++i(c=t.charCodeAt(i))||c>57){_=(46===c?f+t.slice(i+1):t.slice(i))+_,t=t.slice(0,i);break}}E&&!w&&(t=n(t,1/0));var j=d.length+t.length+_.length,L=j>1)+d+t+_+L.slice(j);break;default:t=L+d+t+_}return h(t)}return T=void 0===T?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T)),format.toString=function(){return t+""},format}return{format:newFormat,formatPrefix:function formatPrefix(t,e){var n=newFormat(((t=formatSpecifier(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(exponent(e)/3))),a=Math.pow(10,-i),s=u[8+i/3];return function(t){return n(a*t)+s}}}}function defaultLocale(e){return a=formatLocale(e),t.format=a.format,t.formatPrefix=a.formatPrefix,a}defaultLocale({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),t.FormatSpecifier=FormatSpecifier,t.formatDefaultLocale=defaultLocale,t.formatLocale=formatLocale,t.formatSpecifier=formatSpecifier,t.precisionFixed=function precisionFixed(t){return Math.max(0,-exponent(Math.abs(t)))},t.precisionPrefix=function precisionPrefix(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(exponent(e)/3)))-exponent(Math.abs(t)))},t.precisionRound=function precisionRound(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,exponent(e)-exponent(t))+1},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],64:[function(t,e,n){!function(i,a){"object"==typeof n&&void 0!==e?a(n,t("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-time"],a):a((i=i||self).d3=i.d3||{},i.d3)}(this,(function(t,e){function localDate(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function utcDate(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function newDate(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function formatLocale(t){var n=t.dateTime,a=t.date,s=t.time,u=t.periods,c=t.days,f=t.shortDays,h=t.months,d=t.shortMonths,p=formatRe(u),g=formatLookup(u),v=formatRe(c),b=formatLookup(c),_=formatRe(f),w=formatLookup(f),M=formatRe(h),E=formatLookup(h),T=formatRe(d),S=formatLookup(d),k={a:function formatShortWeekday(t){return f[t.getDay()]},A:function formatWeekday(t){return c[t.getDay()]},b:function formatShortMonth(t){return d[t.getMonth()]},B:function formatMonth(t){return h[t.getMonth()]},c:null,d:formatDayOfMonth,e:formatDayOfMonth,f:formatMicroseconds,H:formatHour24,I:formatHour12,j:formatDayOfYear,L:formatMilliseconds,m:formatMonthNumber,M:formatMinutes,p:function formatPeriod(t){return u[+(t.getHours()>=12)]},q:function formatQuarter(t){return 1+~~(t.getMonth()/3)},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},C={a:function formatUTCShortWeekday(t){return f[t.getUTCDay()]},A:function formatUTCWeekday(t){return c[t.getUTCDay()]},b:function formatUTCShortMonth(t){return d[t.getUTCMonth()]},B:function formatUTCMonth(t){return h[t.getUTCMonth()]},c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:function formatUTCPeriod(t){return u[+(t.getUTCHours()>=12)]},q:function formatUTCQuarter(t){return 1+~~(t.getUTCMonth()/3)},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},R={a:function parseShortWeekday(t,e,n){var i=_.exec(e.slice(n));return i?(t.w=w[i[0].toLowerCase()],n+i[0].length):-1},A:function parseWeekday(t,e,n){var i=v.exec(e.slice(n));return i?(t.w=b[i[0].toLowerCase()],n+i[0].length):-1},b:function parseShortMonth(t,e,n){var i=T.exec(e.slice(n));return i?(t.m=S[i[0].toLowerCase()],n+i[0].length):-1},B:function parseMonth(t,e,n){var i=M.exec(e.slice(n));return i?(t.m=E[i[0].toLowerCase()],n+i[0].length):-1},c:function parseLocaleDateTime(t,e,i){return parseSpecifier(t,n,e,i)},d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:function parsePeriod(t,e,n){var i=p.exec(e.slice(n));return i?(t.p=g[i[0].toLowerCase()],n+i[0].length):-1},q:parseQuarter,Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:function parseLocaleDate(t,e,n){return parseSpecifier(t,a,e,n)},X:function parseLocaleTime(t,e,n){return parseSpecifier(t,s,e,n)},y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};function newFormat(t,e){return function(n){var a,s,u,c=[],f=-1,h=0,d=t.length;for(n instanceof Date||(n=new Date(+n));++f53)return null;"w"in u||(u.w=1),"Z"in u?(s=(a=utcDate(newDate(u.y,0,1))).getUTCDay(),a=s>4||0===s?e.utcMonday.ceil(a):e.utcMonday(a),a=e.utcDay.offset(a,7*(u.V-1)),u.y=a.getUTCFullYear(),u.m=a.getUTCMonth(),u.d=a.getUTCDate()+(u.w+6)%7):(s=(a=localDate(newDate(u.y,0,1))).getDay(),a=s>4||0===s?e.timeMonday.ceil(a):e.timeMonday(a),a=e.timeDay.offset(a,7*(u.V-1)),u.y=a.getFullYear(),u.m=a.getMonth(),u.d=a.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),s="Z"in u?utcDate(newDate(u.y,0,1)).getUTCDay():localDate(newDate(u.y,0,1)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(s+5)%7:u.w+7*u.U-(s+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,utcDate(u)):localDate(u)}}function parseSpecifier(t,e,n,a){for(var s,u,c=0,f=e.length,h=n.length;c=h)return-1;if(37===(s=e.charCodeAt(c++))){if(s=e.charAt(c++),!(u=R[s in i?e.charAt(c++):s])||(a=u(t,n,a))<0)return-1}else if(s!=n.charCodeAt(a++))return-1}return a}return k.x=newFormat(a,k),k.X=newFormat(s,k),k.c=newFormat(n,k),C.x=newFormat(a,C),C.X=newFormat(s,C),C.c=newFormat(n,C),{format:function(t){var e=newFormat(t+="",k);return e.toString=function(){return t},e},parse:function(t){var e=newParse(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=newFormat(t+="",C);return e.toString=function(){return t},e},utcParse:function(t){var e=newParse(t+="",!0);return e.toString=function(){return t},e}}}var n,i={"-":"",_:" ",0:"0"},a=/^\s*\d+/,s=/^%/,u=/[\\^$*+?|[\]().{}]/g;function pad(t,e,n){var i=t<0?"-":"",a=(i?-t:t)+"",s=a.length;return i+(s68?1900:2e3),n+i[0].length):-1}function parseZone(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function parseQuarter(t,e,n){var i=a.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function parseMonthNumber(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function parseDayOfMonth(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function parseDayOfYear(t,e,n){var i=a.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function parseHour24(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function parseMinutes(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function parseSeconds(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function parseMilliseconds(t,e,n){var i=a.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function parseMicroseconds(t,e,n){var i=a.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function parseLiteralPercent(t,e,n){var i=s.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function parseUnixTimestamp(t,e,n){var i=a.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function parseUnixTimestampSeconds(t,e,n){var i=a.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function formatDayOfMonth(t,e){return pad(t.getDate(),e,2)}function formatHour24(t,e){return pad(t.getHours(),e,2)}function formatHour12(t,e){return pad(t.getHours()%12||12,e,2)}function formatDayOfYear(t,n){return pad(1+e.timeDay.count(e.timeYear(t),t),n,3)}function formatMilliseconds(t,e){return pad(t.getMilliseconds(),e,3)}function formatMicroseconds(t,e){return formatMilliseconds(t,e)+"000"}function formatMonthNumber(t,e){return pad(t.getMonth()+1,e,2)}function formatMinutes(t,e){return pad(t.getMinutes(),e,2)}function formatSeconds(t,e){return pad(t.getSeconds(),e,2)}function formatWeekdayNumberMonday(t){var e=t.getDay();return 0===e?7:e}function formatWeekNumberSunday(t,n){return pad(e.timeSunday.count(e.timeYear(t)-1,t),n,2)}function formatWeekNumberISO(t,n){var i=t.getDay();return t=i>=4||0===i?e.timeThursday(t):e.timeThursday.ceil(t),pad(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),n,2)}function formatWeekdayNumberSunday(t){return t.getDay()}function formatWeekNumberMonday(t,n){return pad(e.timeMonday.count(e.timeYear(t)-1,t),n,2)}function formatYear(t,e){return pad(t.getFullYear()%100,e,2)}function formatFullYear(t,e){return pad(t.getFullYear()%1e4,e,4)}function formatZone(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+pad(e/60|0,"0",2)+pad(e%60,"0",2)}function formatUTCDayOfMonth(t,e){return pad(t.getUTCDate(),e,2)}function formatUTCHour24(t,e){return pad(t.getUTCHours(),e,2)}function formatUTCHour12(t,e){return pad(t.getUTCHours()%12||12,e,2)}function formatUTCDayOfYear(t,n){return pad(1+e.utcDay.count(e.utcYear(t),t),n,3)}function formatUTCMilliseconds(t,e){return pad(t.getUTCMilliseconds(),e,3)}function formatUTCMicroseconds(t,e){return formatUTCMilliseconds(t,e)+"000"}function formatUTCMonthNumber(t,e){return pad(t.getUTCMonth()+1,e,2)}function formatUTCMinutes(t,e){return pad(t.getUTCMinutes(),e,2)}function formatUTCSeconds(t,e){return pad(t.getUTCSeconds(),e,2)}function formatUTCWeekdayNumberMonday(t){var e=t.getUTCDay();return 0===e?7:e}function formatUTCWeekNumberSunday(t,n){return pad(e.utcSunday.count(e.utcYear(t)-1,t),n,2)}function formatUTCWeekNumberISO(t,n){var i=t.getUTCDay();return t=i>=4||0===i?e.utcThursday(t):e.utcThursday.ceil(t),pad(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),n,2)}function formatUTCWeekdayNumberSunday(t){return t.getUTCDay()}function formatUTCWeekNumberMonday(t,n){return pad(e.utcMonday.count(e.utcYear(t)-1,t),n,2)}function formatUTCYear(t,e){return pad(t.getUTCFullYear()%100,e,2)}function formatUTCFullYear(t,e){return pad(t.getUTCFullYear()%1e4,e,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(t){return+t}function formatUnixTimestampSeconds(t){return Math.floor(+t/1e3)}function defaultLocale(e){return n=formatLocale(e),t.timeFormat=n.format,t.timeParse=n.parse,t.utcFormat=n.utcFormat,t.utcParse=n.utcParse,n}defaultLocale({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var c="%Y-%m-%dT%H:%M:%S.%LZ";var f=Date.prototype.toISOString?function formatIsoNative(t){return t.toISOString()}:t.utcFormat(c);var h=+new Date("2000-01-01T00:00:00.000Z")?function parseIsoNative(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(c);t.isoFormat=f,t.isoParse=h,t.timeFormatDefaultLocale=defaultLocale,t.timeFormatLocale=formatLocale,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":68}],65:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){var e="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function namespace(t){var e=t+="",i=e.indexOf(":");return i>=0&&"xmlns"!==(e=t.slice(0,i))&&(t=t.slice(i+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function creatorInherit(t){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===e&&n.documentElement.namespaceURI===e?n.createElement(t):n.createElementNS(i,t)}}function creatorFixed(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function creator(t){var e=namespace(t);return(e.local?creatorFixed:creatorInherit)(e)}function none(){}function selector(t){return null==t?none:function(){return this.querySelector(t)}}function empty(){return[]}function selectorAll(t){return null==t?empty:function(){return this.querySelectorAll(t)}}function matcher(t){return function(){return this.matches(t)}}function sparse(t){return new Array(t.length)}function EnterNode(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}EnterNode.prototype={constructor:EnterNode,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function bindIndex(t,e,n,i,a,s){for(var u,c=0,f=e.length,h=s.length;ce?1:t>=e?0:NaN}function attrRemove(t){return function(){this.removeAttribute(t)}}function attrRemoveNS(t){return function(){this.removeAttributeNS(t.space,t.local)}}function attrConstant(t,e){return function(){this.setAttribute(t,e)}}function attrConstantNS(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function attrFunction(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function attrFunctionNS(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function defaultView(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function styleRemove(t){return function(){this.style.removeProperty(t)}}function styleConstant(t,e,n){return function(){this.style.setProperty(t,e,n)}}function styleFunction(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function styleValue(t,e){return t.style.getPropertyValue(e)||defaultView(t).getComputedStyle(t,null).getPropertyValue(e)}function propertyRemove(t){return function(){delete this[t]}}function propertyConstant(t,e){return function(){this[t]=e}}function propertyFunction(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function classArray(t){return t.trim().split(/^|\s+/)}function classList(t){return t.classList||new ClassList(t)}function ClassList(t){this._node=t,this._names=classArray(t.getAttribute("class")||"")}function classedAdd(t,e){for(var n=classList(t),i=-1,a=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var i={};(t.event=null,"undefined"!=typeof document)&&("onmouseenter"in document.documentElement||(i={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(t,e,n){return t=contextListener(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function contextListener(e,n,i){return function(a){var s=t.event;t.event=a;try{e.call(this,this.__data__,n,i)}finally{t.event=s}}}function onRemove(t){return function(){var e=this.__on;if(e){for(var n,i=0,a=-1,s=e.length;i=S&&(S=T+1);!(E=w[S])&&++S=0;)(i=a[s])&&(u&&4^i.compareDocumentPosition(u)&&u.parentNode.insertBefore(i,u),u=i);return this},sort:function selection_sort(t){function compareNode(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ascending);for(var e=this._groups,n=e.length,i=new Array(n),a=0;a1?this.each((null==e?styleRemove:"function"==typeof e?styleFunction:styleConstant)(t,e,null==n?"":n)):styleValue(this.node(),t)},property:function selection_property(t,e){return arguments.length>1?this.each((null==e?propertyRemove:"function"==typeof e?propertyFunction:propertyConstant)(t,e)):this.node()[t]},classed:function selection_classed(t,e){var n=classArray(t+"");if(arguments.length<2){for(var i=classList(this.node()),a=-1,s=n.length;++a=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),u=s.length;if(!(arguments.length<2)){for(c=e?onAdd:onRemove,null==n&&(n=!1),i=0;i=1?p:t<=-1?-p:Math.asin(t)}function arcInnerRadius(t){return t.innerRadius}function arcOuterRadius(t){return t.outerRadius}function arcStartAngle(t){return t.startAngle}function arcEndAngle(t){return t.endAngle}function arcPadAngle(t){return t&&t.padAngle}function cornerTangents(t,e,n,i,a,u,c){var h=t-n,d=e-i,p=(c?u:-u)/f(h*h+d*d),g=p*d,v=-p*h,b=t+g,_=e+v,w=n+g,M=i+v,E=(b+w)/2,T=(_+M)/2,S=w-b,k=M-_,C=S*S+k*k,R=a-u,N=b*M-w*_,A=(k<0?-1:1)*f(s(0,R*R*C-N*N)),O=(N*k-S*A)/C,j=(-N*S-k*A)/C,L=(N*k+S*A)/C,P=(-N*S+k*A)/C,U=O-E,I=j-T,D=L-E,q=P-T;return U*U+I*I>D*D+q*q&&(O=L,j=P),{cx:O,cy:j,x01:-g,y01:-v,x11:O*(a/R-1),y11:j*(a/R-1)}}function Linear(t){this._context=t}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var curveLinear=function(t){return new Linear(t)};function x(t){return t[0]}function y(t){return t[1]}var line=function(){var t=x,n=y,i=constant(!0),a=null,s=curveLinear,u=null;function line(c){var f,h,d,p=c.length,g=!1;for(null==a&&(u=s(d=e.path())),f=0;f<=p;++f)!(f=p;--g)f.point(M[g],E[g]);f.lineEnd(),f.areaEnd()}w&&(M[d]=+t(v,d,h),E[d]=+i(v,d,h),f.point(n?+n(v,d,h):M[d],a?+a(v,d,h):E[d]))}if(b)return f=null,b+""||null}function arealine(){return line().defined(s).curve(c).context(u)}return area.x=function(e){return arguments.length?(t="function"==typeof e?e:constant(+e),n=null,area):t},area.x0=function(e){return arguments.length?(t="function"==typeof e?e:constant(+e),area):t},area.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:constant(+t),area):n},area.y=function(t){return arguments.length?(i="function"==typeof t?t:constant(+t),a=null,area):i},area.y0=function(t){return arguments.length?(i="function"==typeof t?t:constant(+t),area):i},area.y1=function(t){return arguments.length?(a=null==t?null:"function"==typeof t?t:constant(+t),area):a},area.lineX0=area.lineY0=function(){return arealine().x(t).y(i)},area.lineY1=function(){return arealine().x(t).y(a)},area.lineX1=function(){return arealine().x(n).y(i)},area.defined=function(t){return arguments.length?(s="function"==typeof t?t:constant(!!t),area):s},area.curve=function(t){return arguments.length?(c=t,null!=u&&(f=c(u)),area):c},area.context=function(t){return arguments.length?(null==t?u=f=null:f=c(u=t),area):u},area},descending=function(t,e){return et?1:e>=t?0:NaN},identity=function(t){return t},v=curveRadial(curveLinear);function Radial(t){this._curve=t}function curveRadial(t){function radial(e){return new Radial(t(e))}return radial._curve=t,radial}function lineRadial(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(curveRadial(t)):e()._curve},t}Radial.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var lineRadial$1=function(){return lineRadial(line().curve(v))},areaRadial=function(){var t=area().curve(v),e=t.curve,n=t.lineX0,i=t.lineX1,a=t.lineY0,s=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return lineRadial(n())},delete t.lineX0,t.lineEndAngle=function(){return lineRadial(i())},delete t.lineX1,t.lineInnerRadius=function(){return lineRadial(a())},delete t.lineY0,t.lineOuterRadius=function(){return lineRadial(s())},delete t.lineY1,t.curve=function(t){return arguments.length?e(curveRadial(t)):e()._curve},t},pointRadial=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]},b=Array.prototype.slice;function linkSource(t){return t.source}function linkTarget(t){return t.target}function link(t){var n=linkSource,i=linkTarget,a=x,s=y,u=null;function link(){var c,f=b.call(arguments),h=n.apply(this,f),d=i.apply(this,f);if(u||(u=c=e.path()),t(u,+a.apply(this,(f[0]=h,f)),+s.apply(this,f),+a.apply(this,(f[0]=d,f)),+s.apply(this,f)),c)return u=null,c+""||null}return link.source=function(t){return arguments.length?(n=t,link):n},link.target=function(t){return arguments.length?(i=t,link):i},link.x=function(t){return arguments.length?(a="function"==typeof t?t:constant(+t),link):a},link.y=function(t){return arguments.length?(s="function"==typeof t?t:constant(+t),link):s},link.context=function(t){return arguments.length?(u=null==t?null:t,link):u},link}function curveHorizontal(t,e,n,i,a){t.moveTo(e,n),t.bezierCurveTo(e=(e+i)/2,n,e,a,i,a)}function curveVertical(t,e,n,i,a){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+a)/2,i,n,i,a)}function curveRadial$1(t,e,n,i,a){var s=pointRadial(e,n),u=pointRadial(e,n=(n+a)/2),c=pointRadial(i,n),f=pointRadial(i,a);t.moveTo(s[0],s[1]),t.bezierCurveTo(u[0],u[1],c[0],c[1],f[0],f[1])}var _={draw:function(t,e){var n=Math.sqrt(e/d);t.moveTo(n,0),t.arc(0,0,n,0,g)}},w={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},M=Math.sqrt(1/3),E=2*M,T={draw:function(t,e){var n=Math.sqrt(e/E),i=n*M;t.moveTo(0,-n),t.lineTo(i,0),t.lineTo(0,n),t.lineTo(-i,0),t.closePath()}},S=Math.sin(d/10)/Math.sin(7*d/10),k=Math.sin(g/10)*S,C=-Math.cos(g/10)*S,R={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),i=k*n,a=C*n;t.moveTo(0,-n),t.lineTo(i,a);for(var s=1;s<5;++s){var u=g*s/5,c=Math.cos(u),f=Math.sin(u);t.lineTo(f*n,-c*n),t.lineTo(c*i-f*a,f*i+c*a)}t.closePath()}},N={draw:function(t,e){var n=Math.sqrt(e),i=-n/2;t.rect(i,i,n,n)}},A=Math.sqrt(3),O={draw:function(t,e){var n=-Math.sqrt(e/(3*A));t.moveTo(0,2*n),t.lineTo(-A*n,-n),t.lineTo(A*n,-n),t.closePath()}},j=-.5,L=Math.sqrt(3)/2,P=1/Math.sqrt(12),U=3*(P/2+1),I={draw:function(t,e){var n=Math.sqrt(e/U),i=n/2,a=n*P,s=i,u=n*P+n,c=-s,f=u;t.moveTo(i,a),t.lineTo(s,u),t.lineTo(c,f),t.lineTo(j*i-L*a,L*i+j*a),t.lineTo(j*s-L*u,L*s+j*u),t.lineTo(j*c-L*f,L*c+j*f),t.lineTo(j*i+L*a,j*a-L*i),t.lineTo(j*s+L*u,j*u-L*s),t.lineTo(j*c+L*f,j*f-L*c),t.closePath()}},D=[_,w,T,N,R,O,I],noop=function(){};function point(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Basis(t){this._context=t}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:point(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function BasisClosed(t){this._context=t}BasisClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:point(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function BasisOpen(t){this._context=t}BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:point(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Bundle(t,e){this._basis=new Basis(t),this._beta=e}Bundle.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i,a=t[0],s=e[0],u=t[n]-a,c=e[n]-s,f=-1;++f<=n;)i=f/n,this._basis.point(this._beta*t[f]+(1-this._beta)*(a+i*u),this._beta*e[f]+(1-this._beta)*(s+i*c));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var q=function custom(t){function bundle(e){return 1===t?new Basis(e):new Bundle(e,t)}return bundle.beta=function(t){return custom(+t)},bundle}(.85);function point$1(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Cardinal(t,e){this._context=t,this._k=(1-e)/6}Cardinal.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:point$1(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:point$1(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var B=function custom(t){function cardinal(e){return new Cardinal(e,t)}return cardinal.tension=function(t){return custom(+t)},cardinal}(0);function CardinalClosed(t,e){this._context=t,this._k=(1-e)/6}CardinalClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:point$1(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var z=function custom(t){function cardinal(e){return new CardinalClosed(e,t)}return cardinal.tension=function(t){return custom(+t)},cardinal}(0);function CardinalOpen(t,e){this._context=t,this._k=(1-e)/6}CardinalOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:point$1(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var H=function custom(t){function cardinal(e){return new CardinalOpen(e,t)}return cardinal.tension=function(t){return custom(+t)},cardinal}(0);function point$2(t,e,n){var i=t._x1,a=t._y1,s=t._x2,u=t._y2;if(t._l01_a>h){var c=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,f=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*c-t._x0*t._l12_2a+t._x2*t._l01_2a)/f,a=(a*c-t._y0*t._l12_2a+t._y2*t._l01_2a)/f}if(t._l23_a>h){var d=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,p=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*d+t._x1*t._l23_2a-e*t._l12_2a)/p,u=(u*d+t._y1*t._l23_2a-n*t._l12_2a)/p}t._context.bezierCurveTo(i,a,s,u,t._x2,t._y2)}function CatmullRom(t,e){this._context=t,this._alpha=e}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:point$2(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var W=function custom(t){function catmullRom(e){return t?new CatmullRom(e,t):new Cardinal(e,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function CatmullRomClosed(t,e){this._context=t,this._alpha=e}CatmullRomClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:point$2(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var $=function custom(t){function catmullRom(e){return t?new CatmullRomClosed(e,t):new CardinalClosed(e,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function CatmullRomOpen(t,e){this._context=t,this._alpha=e}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:point$2(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var V=function custom(t){function catmullRom(e){return t?new CatmullRomOpen(e,t):new CardinalOpen(e,0)}return catmullRom.alpha=function(t){return custom(+t)},catmullRom}(.5);function LinearClosed(t){this._context=t}LinearClosed.prototype={areaStart:noop,areaEnd:noop,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function sign(t){return t<0?-1:1}function slope3(t,e,n){var i=t._x1-t._x0,a=e-t._x1,s=(t._y1-t._y0)/(i||a<0&&-0),u=(n-t._y1)/(a||i<0&&-0),c=(s*a+u*i)/(i+a);return(sign(s)+sign(u))*Math.min(Math.abs(s),Math.abs(u),.5*Math.abs(c))||0}function slope2(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function point$3(t,e,n){var i=t._x0,a=t._y0,s=t._x1,u=t._y1,c=(s-i)/3;t._context.bezierCurveTo(i+c,a+c*e,s-c,u-c*n,s,u)}function MonotoneX(t){this._context=t}function MonotoneY(t){this._context=new ReflectContext(t)}function ReflectContext(t){this._context=t}function Natural(t){this._context=t}function controlPoints(t){var e,n,i=t.length-1,a=new Array(i),s=new Array(i),u=new Array(i);for(a[0]=0,s[0]=2,u[0]=t[0]+2*t[1],e=1;e=0;--e)a[e]=(u[e]-a[e+1])/s[e];for(s[i-1]=(t[i]+a[i-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var none=function(t,e){if((a=t.length)>1)for(var n,i,a,s=1,u=t[e[0]],c=u.length;s=0;)n[e]=e;return n};function stackValue(t,e){return t[e]}var ascending=function(t){var e=t.map(sum);return none$1(t).sort((function(t,n){return e[t]-e[n]}))};function sum(t){for(var e,n=0,i=-1,a=t.length;++iR;if(E||(E=T=e.path()),Ch)if(A>g-h)E.moveTo(C*a(R),C*c(R)),E.arc(0,0,C,R,N,!O),k>h&&(E.moveTo(k*a(N),k*c(N)),E.arc(0,0,k,N,R,O));else{var j,L,P=R,U=N,I=R,D=N,q=A,B=A,z=M.apply(this,arguments)/2,H=z>h&&(b?+b.apply(this,arguments):f(k*k+C*C)),W=u(n(C-k)/2,+v.apply(this,arguments)),$=W,V=W;if(H>h){var Z=asin(H/k*c(z)),G=asin(H/C*c(z));(q-=2*Z)>h?(I+=Z*=O?1:-1,D-=Z):(q=0,I=D=(R+N)/2),(B-=2*G)>h?(P+=G*=O?1:-1,U-=G):(B=0,P=U=(R+N)/2)}var Q=C*a(P),J=C*c(P),K=k*a(D),tt=k*c(D);if(W>h){var et=C*a(U),nt=C*c(U),rt=k*a(I),it=k*c(I);if(Ah?function intersect(t,e,n,i,a,s,u,c){var f=n-t,h=i-e,d=u-a,p=c-s,g=(d*(e-s)-p*(t-a))/(p*f-d*h);return[t+g*f,e+g*h]}(Q,J,rt,it,et,nt,K,tt):[K,tt],at=Q-ot[0],st=J-ot[1],ut=et-ot[0],ct=nt-ot[1],lt=1/c(function acos(t){return t>1?0:t<-1?d:Math.acos(t)}((at*ut+st*ct)/(f(at*at+st*st)*f(ut*ut+ct*ct)))/2),ft=f(ot[0]*ot[0]+ot[1]*ot[1]);$=u(W,(k-ft)/(lt-1)),V=u(W,(C-ft)/(lt+1))}}B>h?V>h?(j=cornerTangents(rt,it,Q,J,C,V,O),L=cornerTangents(et,nt,K,tt,C,V,O),E.moveTo(j.cx+j.x01,j.cy+j.y01),Vh&&q>h?$>h?(j=cornerTangents(K,tt,et,nt,k,-$,O),L=cornerTangents(Q,J,rt,it,k,-$,O),E.lineTo(j.cx+j.x01,j.cy+j.y01),$0&&(b+=p);for(null!=e?_.sort((function(t,n){return e(w[t],w[n])})):null!=n&&_.sort((function(t,e){return n(u[t],u[e])})),c=0,h=b?(E-v*S)/b:0;c0?p*h:0)+S,w[f]={data:u[f],index:c,value:p,startAngle:M,endAngle:d,padAngle:T};return w}return pie.value=function(e){return arguments.length?(t="function"==typeof e?e:constant(+e),pie):t},pie.sortValues=function(t){return arguments.length?(e=t,n=null,pie):e},pie.sort=function(t){return arguments.length?(n=t,e=null,pie):n},pie.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:constant(+t),pie):i},pie.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:constant(+t),pie):a},pie.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:constant(+t),pie):s},pie},t.areaRadial=areaRadial,t.radialArea=areaRadial,t.lineRadial=lineRadial$1,t.radialLine=lineRadial$1,t.pointRadial=pointRadial,t.linkHorizontal=function linkHorizontal(){return link(curveHorizontal)},t.linkVertical=function linkVertical(){return link(curveVertical)},t.linkRadial=function linkRadial(){var t=link(curveRadial$1);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=constant(_),n=constant(64),i=null;function symbol(){var a;if(i||(i=a=e.path()),t.apply(this,arguments).draw(i,+n.apply(this,arguments)),a)return i=null,a+""||null}return symbol.type=function(e){return arguments.length?(t="function"==typeof e?e:constant(e),symbol):t},symbol.size=function(t){return arguments.length?(n="function"==typeof t?t:constant(+t),symbol):n},symbol.context=function(t){return arguments.length?(i=null==t?null:t,symbol):i},symbol},t.symbols=D,t.symbolCircle=_,t.symbolCross=w,t.symbolDiamond=T,t.symbolSquare=N,t.symbolStar=R,t.symbolTriangle=O,t.symbolWye=I,t.curveBasisClosed=function(t){return new BasisClosed(t)},t.curveBasisOpen=function(t){return new BasisOpen(t)},t.curveBasis=function(t){return new Basis(t)},t.curveBundle=q,t.curveCardinalClosed=z,t.curveCardinalOpen=H,t.curveCardinal=B,t.curveCatmullRomClosed=$,t.curveCatmullRomOpen=V,t.curveCatmullRom=W,t.curveLinearClosed=function(t){return new LinearClosed(t)},t.curveLinear=curveLinear,t.curveMonotoneX=function monotoneX(t){return new MonotoneX(t)},t.curveMonotoneY=function monotoneY(t){return new MonotoneY(t)},t.curveNatural=function(t){return new Natural(t)},t.curveStep=function(t){return new Step(t,.5)},t.curveStepAfter=function stepAfter(t){return new Step(t,1)},t.curveStepBefore=function stepBefore(t){return new Step(t,0)},t.stack=function(){var t=constant([]),e=none$1,n=none,i=stackValue;function stack(a){var s,u,c=t.apply(this,arguments),f=a.length,h=c.length,d=new Array(h);for(s=0;s0){for(var n,i,a,s=0,u=t[0].length;s1)for(var n,i,a,s,u,c,f=0,h=t[e[0]].length;f=0?(i[0]=s,i[1]=s+=a):a<0?(i[1]=u,i[0]=u+=a):i[0]=s},t.stackOffsetNone=none,t.stackOffsetSilhouette=function(t,e){if((n=t.length)>0){for(var n,i=0,a=t[e[0]],s=a.length;i0&&(i=(n=t[e[0]]).length)>0){for(var n,i,a,s=0,u=1;u=12)]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatSeconds,u:formatWeekdayNumberMonday,U:formatWeekNumberSunday,V:formatWeekNumberISO,w:formatWeekdayNumberSunday,W:formatWeekNumberMonday,x:null,X:null,y:formatYear,Y:formatFullYear,Z:formatZone,"%":formatLiteralPercent},C={a:function formatUTCShortWeekday(t){return f[t.getUTCDay()]},A:function formatUTCWeekday(t){return c[t.getUTCDay()]},b:function formatUTCShortMonth(t){return d[t.getUTCMonth()]},B:function formatUTCMonth(t){return h[t.getUTCMonth()]},c:null,d:formatUTCDayOfMonth,e:formatUTCDayOfMonth,f:formatUTCMicroseconds,H:formatUTCHour24,I:formatUTCHour12,j:formatUTCDayOfYear,L:formatUTCMilliseconds,m:formatUTCMonthNumber,M:formatUTCMinutes,p:function formatUTCPeriod(t){return u[+(t.getUTCHours()>=12)]},Q:formatUnixTimestamp,s:formatUnixTimestampSeconds,S:formatUTCSeconds,u:formatUTCWeekdayNumberMonday,U:formatUTCWeekNumberSunday,V:formatUTCWeekNumberISO,w:formatUTCWeekdayNumberSunday,W:formatUTCWeekNumberMonday,x:null,X:null,y:formatUTCYear,Y:formatUTCFullYear,Z:formatUTCZone,"%":formatLiteralPercent},R={a:function parseShortWeekday(t,e,n){var i=_.exec(e.slice(n));return i?(t.w=w[i[0].toLowerCase()],n+i[0].length):-1},A:function parseWeekday(t,e,n){var i=v.exec(e.slice(n));return i?(t.w=b[i[0].toLowerCase()],n+i[0].length):-1},b:function parseShortMonth(t,e,n){var i=T.exec(e.slice(n));return i?(t.m=S[i[0].toLowerCase()],n+i[0].length):-1},B:function parseMonth(t,e,n){var i=M.exec(e.slice(n));return i?(t.m=E[i[0].toLowerCase()],n+i[0].length):-1},c:function parseLocaleDateTime(t,e,i){return parseSpecifier(t,n,e,i)},d:parseDayOfMonth,e:parseDayOfMonth,f:parseMicroseconds,H:parseHour24,I:parseHour24,j:parseDayOfYear,L:parseMilliseconds,m:parseMonthNumber,M:parseMinutes,p:function parsePeriod(t,e,n){var i=p.exec(e.slice(n));return i?(t.p=g[i[0].toLowerCase()],n+i[0].length):-1},Q:parseUnixTimestamp,s:parseUnixTimestampSeconds,S:parseSeconds,u:parseWeekdayNumberMonday,U:parseWeekNumberSunday,V:parseWeekNumberISO,w:parseWeekdayNumberSunday,W:parseWeekNumberMonday,x:function parseLocaleDate(t,e,n){return parseSpecifier(t,a,e,n)},X:function parseLocaleTime(t,e,n){return parseSpecifier(t,s,e,n)},y:parseYear,Y:parseFullYear,Z:parseZone,"%":parseLiteralPercent};function newFormat(t,e){return function(n){var a,s,u,c=[],f=-1,h=0,d=t.length;for(n instanceof Date||(n=new Date(+n));++f53)return null;"w"in u||(u.w=1),"Z"in u?(s=(a=utcDate(newYear(u.y))).getUTCDay(),a=s>4||0===s?e.utcMonday.ceil(a):e.utcMonday(a),a=e.utcDay.offset(a,7*(u.V-1)),u.y=a.getUTCFullYear(),u.m=a.getUTCMonth(),u.d=a.getUTCDate()+(u.w+6)%7):(s=(a=n(newYear(u.y))).getDay(),a=s>4||0===s?e.timeMonday.ceil(a):e.timeMonday(a),a=e.timeDay.offset(a,7*(u.V-1)),u.y=a.getFullYear(),u.m=a.getMonth(),u.d=a.getDate()+(u.w+6)%7)}else("W"in u||"U"in u)&&("w"in u||(u.w="u"in u?u.u%7:"W"in u?1:0),s="Z"in u?utcDate(newYear(u.y)).getUTCDay():n(newYear(u.y)).getDay(),u.m=0,u.d="W"in u?(u.w+6)%7+7*u.W-(s+5)%7:u.w+7*u.U-(s+6)%7);return"Z"in u?(u.H+=u.Z/100|0,u.M+=u.Z%100,utcDate(u)):n(u)}}function parseSpecifier(t,e,n,a){for(var s,u,c=0,f=e.length,h=n.length;c=h)return-1;if(37===(s=e.charCodeAt(c++))){if(s=e.charAt(c++),!(u=R[s in i?e.charAt(c++):s])||(a=u(t,n,a))<0)return-1}else if(s!=n.charCodeAt(a++))return-1}return a}return k.x=newFormat(a,k),k.X=newFormat(s,k),k.c=newFormat(n,k),C.x=newFormat(a,C),C.X=newFormat(s,C),C.c=newFormat(n,C),{format:function(t){var e=newFormat(t+="",k);return e.toString=function(){return t},e},parse:function(t){var e=newParse(t+="",localDate);return e.toString=function(){return t},e},utcFormat:function(t){var e=newFormat(t+="",C);return e.toString=function(){return t},e},utcParse:function(t){var e=newParse(t,utcDate);return e.toString=function(){return t},e}}}var n,i={"-":"",_:" ",0:"0"},a=/^\s*\d+/,s=/^%/,u=/[\\^$*+?|[\]().{}]/g;function pad(t,e,n){var i=t<0?"-":"",a=(i?-t:t)+"",s=a.length;return i+(s68?1900:2e3),n+i[0].length):-1}function parseZone(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function parseMonthNumber(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function parseDayOfMonth(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function parseDayOfYear(t,e,n){var i=a.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function parseHour24(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function parseMinutes(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function parseSeconds(t,e,n){var i=a.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function parseMilliseconds(t,e,n){var i=a.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function parseMicroseconds(t,e,n){var i=a.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function parseLiteralPercent(t,e,n){var i=s.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function parseUnixTimestamp(t,e,n){var i=a.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function parseUnixTimestampSeconds(t,e,n){var i=a.exec(e.slice(n));return i?(t.Q=1e3*+i[0],n+i[0].length):-1}function formatDayOfMonth(t,e){return pad(t.getDate(),e,2)}function formatHour24(t,e){return pad(t.getHours(),e,2)}function formatHour12(t,e){return pad(t.getHours()%12||12,e,2)}function formatDayOfYear(t,n){return pad(1+e.timeDay.count(e.timeYear(t),t),n,3)}function formatMilliseconds(t,e){return pad(t.getMilliseconds(),e,3)}function formatMicroseconds(t,e){return formatMilliseconds(t,e)+"000"}function formatMonthNumber(t,e){return pad(t.getMonth()+1,e,2)}function formatMinutes(t,e){return pad(t.getMinutes(),e,2)}function formatSeconds(t,e){return pad(t.getSeconds(),e,2)}function formatWeekdayNumberMonday(t){var e=t.getDay();return 0===e?7:e}function formatWeekNumberSunday(t,n){return pad(e.timeSunday.count(e.timeYear(t),t),n,2)}function formatWeekNumberISO(t,n){var i=t.getDay();return t=i>=4||0===i?e.timeThursday(t):e.timeThursday.ceil(t),pad(e.timeThursday.count(e.timeYear(t),t)+(4===e.timeYear(t).getDay()),n,2)}function formatWeekdayNumberSunday(t){return t.getDay()}function formatWeekNumberMonday(t,n){return pad(e.timeMonday.count(e.timeYear(t),t),n,2)}function formatYear(t,e){return pad(t.getFullYear()%100,e,2)}function formatFullYear(t,e){return pad(t.getFullYear()%1e4,e,4)}function formatZone(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+pad(e/60|0,"0",2)+pad(e%60,"0",2)}function formatUTCDayOfMonth(t,e){return pad(t.getUTCDate(),e,2)}function formatUTCHour24(t,e){return pad(t.getUTCHours(),e,2)}function formatUTCHour12(t,e){return pad(t.getUTCHours()%12||12,e,2)}function formatUTCDayOfYear(t,n){return pad(1+e.utcDay.count(e.utcYear(t),t),n,3)}function formatUTCMilliseconds(t,e){return pad(t.getUTCMilliseconds(),e,3)}function formatUTCMicroseconds(t,e){return formatUTCMilliseconds(t,e)+"000"}function formatUTCMonthNumber(t,e){return pad(t.getUTCMonth()+1,e,2)}function formatUTCMinutes(t,e){return pad(t.getUTCMinutes(),e,2)}function formatUTCSeconds(t,e){return pad(t.getUTCSeconds(),e,2)}function formatUTCWeekdayNumberMonday(t){var e=t.getUTCDay();return 0===e?7:e}function formatUTCWeekNumberSunday(t,n){return pad(e.utcSunday.count(e.utcYear(t),t),n,2)}function formatUTCWeekNumberISO(t,n){var i=t.getUTCDay();return t=i>=4||0===i?e.utcThursday(t):e.utcThursday.ceil(t),pad(e.utcThursday.count(e.utcYear(t),t)+(4===e.utcYear(t).getUTCDay()),n,2)}function formatUTCWeekdayNumberSunday(t){return t.getUTCDay()}function formatUTCWeekNumberMonday(t,n){return pad(e.utcMonday.count(e.utcYear(t),t),n,2)}function formatUTCYear(t,e){return pad(t.getUTCFullYear()%100,e,2)}function formatUTCFullYear(t,e){return pad(t.getUTCFullYear()%1e4,e,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(t){return+t}function formatUnixTimestampSeconds(t){return Math.floor(+t/1e3)}function defaultLocale(e){return n=formatLocale(e),t.timeFormat=n.format,t.timeParse=n.parse,t.utcFormat=n.utcFormat,t.utcParse=n.utcParse,n}defaultLocale({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var c="%Y-%m-%dT%H:%M:%S.%LZ";var f=Date.prototype.toISOString?function formatIsoNative(t){return t.toISOString()}:t.utcFormat(c);var h=+new Date("2000-01-01T00:00:00.000Z")?function parseIsoNative(t){var e=new Date(t);return isNaN(e)?null:e}:t.utcParse(c);t.timeFormatDefaultLocale=defaultLocale,t.timeFormatLocale=formatLocale,t.isoFormat=f,t.isoParse=h,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-time":68}],68:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){var e=new Date,n=new Date;function newInterval(t,i,a,s){function interval(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return interval.floor=function(e){return t(e=new Date(+e)),e},interval.ceil=function(e){return t(e=new Date(e-1)),i(e,1),t(e),e},interval.round=function(t){var e=interval(t),n=interval.ceil(t);return t-e0))return u;do{u.push(s=new Date(+e)),i(e,a),t(e)}while(s=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;i(t,-1),!e(t););else for(;--n>=0;)for(;i(t,1),!e(t););}))},a&&(interval.count=function(i,s){return e.setTime(+i),n.setTime(+s),t(e),t(n),Math.floor(a(e,n))},interval.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?interval.filter(s?function(e){return s(e)%t==0}:function(e){return interval.count(0,e)%t==0}):interval:null}),interval}var i=newInterval((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?newInterval((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):i:null};var a=i.range,s=1e3,u=6e4,c=36e5,f=864e5,h=6048e5,d=newInterval((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getUTCSeconds()})),p=d.range,g=newInterval((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*s)}),(function(t,e){t.setTime(+t+e*u)}),(function(t,e){return(e-t)/u}),(function(t){return t.getMinutes()})),v=g.range,b=newInterval((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*s-t.getMinutes()*u)}),(function(t,e){t.setTime(+t+e*c)}),(function(t,e){return(e-t)/c}),(function(t){return t.getHours()})),_=b.range,w=newInterval((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*u)/f}),(function(t){return t.getDate()-1})),M=w.range;function weekday(t){return newInterval((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*u)/h}))}var E=weekday(0),T=weekday(1),S=weekday(2),k=weekday(3),C=weekday(4),R=weekday(5),N=weekday(6),A=E.range,O=T.range,j=S.range,L=k.range,P=C.range,U=R.range,I=N.range,D=newInterval((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),q=D.range,B=newInterval((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));B.every=function(t){return isFinite(t=Math.floor(t))&&t>0?newInterval((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var z=B.range,H=newInterval((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*u)}),(function(t,e){return(e-t)/u}),(function(t){return t.getUTCMinutes()})),W=H.range,$=newInterval((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*c)}),(function(t,e){return(e-t)/c}),(function(t){return t.getUTCHours()})),V=$.range,Z=newInterval((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/f}),(function(t){return t.getUTCDate()-1})),G=Z.range;function utcWeekday(t){return newInterval((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/h}))}var Q=utcWeekday(0),J=utcWeekday(1),K=utcWeekday(2),tt=utcWeekday(3),et=utcWeekday(4),nt=utcWeekday(5),rt=utcWeekday(6),it=Q.range,ot=J.range,at=K.range,st=tt.range,ut=et.range,ct=nt.range,lt=rt.range,ft=newInterval((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),ht=ft.range,dt=newInterval((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));dt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?newInterval((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var pt=dt.range;t.timeDay=w,t.timeDays=M,t.timeFriday=R,t.timeFridays=U,t.timeHour=b,t.timeHours=_,t.timeInterval=newInterval,t.timeMillisecond=i,t.timeMilliseconds=a,t.timeMinute=g,t.timeMinutes=v,t.timeMonday=T,t.timeMondays=O,t.timeMonth=D,t.timeMonths=q,t.timeSaturday=N,t.timeSaturdays=I,t.timeSecond=d,t.timeSeconds=p,t.timeSunday=E,t.timeSundays=A,t.timeThursday=C,t.timeThursdays=P,t.timeTuesday=S,t.timeTuesdays=j,t.timeWednesday=k,t.timeWednesdays=L,t.timeWeek=E,t.timeWeeks=A,t.timeYear=B,t.timeYears=z,t.utcDay=Z,t.utcDays=G,t.utcFriday=nt,t.utcFridays=ct,t.utcHour=$,t.utcHours=V,t.utcMillisecond=i,t.utcMilliseconds=a,t.utcMinute=H,t.utcMinutes=W,t.utcMonday=J,t.utcMondays=ot,t.utcMonth=ft,t.utcMonths=ht,t.utcSaturday=rt,t.utcSaturdays=lt,t.utcSecond=d,t.utcSeconds=p,t.utcSunday=Q,t.utcSundays=it,t.utcThursday=et,t.utcThursdays=ut,t.utcTuesday=K,t.utcTuesdays=at,t.utcWednesday=tt,t.utcWednesdays=st,t.utcWeek=Q,t.utcWeeks=it,t.utcYear=dt,t.utcYears=pt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],69:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).d3=t.d3||{})}(this,(function(t){var e,n,i=0,a=0,s=0,u=0,c=0,f=0,h="object"==typeof performance&&performance.now?performance:Date,d="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function now(){return c||(d(clearNow),c=h.now()+f)}function clearNow(){c=0}function Timer(){this._call=this._time=this._next=null}function timer(t,e,n){var i=new Timer;return i.restart(t,e,n),i}function timerFlush(){now(),++i;for(var t,n=e;n;)(t=c-n._time)>=0&&n._call.call(null,t),n=n._next;--i}function wake(){c=(u=h.now())+f,i=a=0;try{timerFlush()}finally{i=0,function nap(){var t,i,a=e,s=1/0;for(;a;)a._call?(s>a._time&&(s=a._time),t=a,a=a._next):(i=a._next,a._next=null,a=t?t._next=i:e=i);n=t,sleep(s)}(),c=0}}function poke(){var t=h.now(),e=t-u;e>1e3&&(f-=e,u=t)}function sleep(t){i||(a&&(a=clearTimeout(a)),t-c>24?(t<1/0&&(a=setTimeout(wake,t-h.now()-f)),s&&(s=clearInterval(s))):(s||(u=h.now(),s=setInterval(poke,1e3)),i=1,d(wake)))}Timer.prototype=timer.prototype={constructor:Timer,restart:function(t,i,a){if("function"!=typeof t)throw new TypeError("callback is not a function");a=(null==a?now():+a)+(null==i?0:+i),this._next||n===this||(n?n._next=this:e=this,n=this),this._call=t,this._time=a,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}},t.interval=function interval$1(t,e,n){var i=new Timer,a=e;return null==e?(i.restart(t,e,n),i):(e=+e,n=null==n?now():+n,i.restart((function tick(s){s+=a,i.restart(tick,a+=e,n),t(s)}),e,n),i)},t.now=now,t.timeout=function timeout$1(t,e,n){var i=new Timer;return e=null==e?0:+e,i.restart((function(n){i.stop(),t(n+e)}),e,n),i},t.timer=timer,t.timerFlush=timerFlush,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],70:[function(t,e,n){!function(i,a){"object"==typeof n&&void 0!==e?a(n,t("d3-selection"),t("d3-dispatch"),t("d3-timer"),t("d3-interpolate"),t("d3-color"),t("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-dispatch","d3-timer","d3-interpolate","d3-color","d3-ease"],a):a((i=i||self).d3=i.d3||{},i.d3,i.d3,i.d3,i.d3,i.d3,i.d3)}(this,(function(t,e,n,i,a,s,u){var c=n.dispatch("start","end","cancel","interrupt"),f=[];function schedule(t,e,n,a,s,u){var h=t.__transition;if(h){if(n in h)return}else t.__transition={};!function create(t,e,n){var a,s=t.__transition;function schedule(t){n.state=1,n.timer.restart(start,n.delay,n.time),n.delay<=t&&start(t-n.delay)}function start(u){var c,f,h,d;if(1!==n.state)return stop();for(c in s)if((d=s[c]).name===n.name){if(3===d.state)return i.timeout(start);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete s[c]):+c0)throw new Error("too late; already scheduled");return n}function set(t,e){var n=get(t,e);if(n.state>3)throw new Error("too late; already running");return n}function get(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function interrupt(t,e){var n,i,a,s=t.__transition,u=!0;if(s){for(a in e=null==e?null:e+"",s)(n=s[a]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete s[a]):u=!1;u&&delete t.__transition}}function tweenRemove(t,e){var n,i;return function(){var a=set(this,t),s=a.tween;if(s!==n)for(var u=0,c=(i=n=s).length;u=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?init:set;return function(){var u=s(this,t),c=u.on;c!==i&&(a=(i=c).copy()).on(e,n),u.on=a}}(n,t,e))},attr:function transition_attr(t,n){var i=e.namespace(t),s="transform"===i?a.interpolateTransformSvg:interpolate;return this.attrTween(t,"function"==typeof n?(i.local?attrFunctionNS:attrFunction)(i,s,tweenValue(this,"attr."+t,n)):null==n?(i.local?attrRemoveNS:attrRemove)(i):(i.local?attrConstantNS:attrConstant)(i,s,n))},attrTween:function transition_attrTween(t,n){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==n)return this.tween(i,null);if("function"!=typeof n)throw new Error;var a=e.namespace(t);return this.tween(i,(a.local?attrTweenNS:attrTween)(a,n))},style:function transition_style(t,n,i){var s="transform"==(t+="")?a.interpolateTransformCss:interpolate;return null==n?this.styleTween(t,function styleNull(t,n){var i,a,s;return function(){var u=e.style(this,t),c=(this.style.removeProperty(t),e.style(this,t));return u===c?null:u===i&&c===a?s:s=n(i=u,a=c)}}(t,s)).on("end.style."+t,styleRemove(t)):"function"==typeof n?this.styleTween(t,function styleFunction(t,n,i){var a,s,u;return function(){var c=e.style(this,t),f=i(this),h=f+"";return null==f&&(this.style.removeProperty(t),h=f=e.style(this,t)),c===h?null:c===a&&h===s?u:(s=h,u=n(a=c,f))}}(t,s,tweenValue(this,"style."+t,n))).each(function styleMaybeRemove(t,e){var n,i,a,s,u="style."+e,c="end."+u;return function(){var f=set(this,t),h=f.on,d=null==f.value[u]?s||(s=styleRemove(e)):void 0;h===n&&a===d||(i=(n=h).copy()).on(c,a=d),f.on=i}}(this._id,t)):this.styleTween(t,function styleConstant(t,n,i){var a,s,u=i+"";return function(){var c=e.style(this,t);return c===u?null:c===a?s:s=n(a=c,i)}}(t,s,n),i).on("end.style."+t,null)},styleTween:function transition_styleTween(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function styleTween(t,e,n){var i,a;function tween(){var s=e.apply(this,arguments);return s!==a&&(i=(a=s)&&function styleInterpolate(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,s,n)),i}return tween._value=e,tween}(t,e,null==n?"":n))},text:function transition_text(t){return this.tween("text","function"==typeof t?function textFunction(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(tweenValue(this,"text",t)):function textConstant(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function transition_textTween(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function textTween(t){var e,n;function tween(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function textInterpolate(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return tween._value=t,tween}(t))},remove:function transition_remove(){return this.on("end.remove",function removeFunction(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function transition_tween(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,a=get(this.node(),n).tween,s=0,u=a.length;s1&&n.name===e)return new Transition([[t]],v,e,+i);return null},t.interrupt=interrupt,t.transition=transition,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-color":44,"d3-dispatch":45,"d3-ease":48,"d3-interpolate":54,"d3-selection":65,"d3-timer":69}],71:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var constant=function(t){return function(){return t}};function x(t){return t[0]}function y(t){return t[1]}function RedBlackTree(){this._=null}function RedBlackNode(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function RedBlackRotateLeft(t,e){var n=e,i=e.R,a=n.U;a?a.L===n?a.L=i:a.R=i:t._=i,i.U=a,n.U=i,n.R=i.L,n.R&&(n.R.U=n),i.L=n}function RedBlackRotateRight(t,e){var n=e,i=e.L,a=n.U;a?a.L===n?a.L=i:a.R=i:t._=i,i.U=a,n.U=i,n.L=i.R,n.L&&(n.L.U=n),i.R=n}function RedBlackFirst(t){for(;t.L;)t=t.L;return t}function createEdge(t,e,n,i){var a=[null,null],u=c.push(a)-1;return a.left=t,a.right=e,n&&setEdgeEnd(a,t,e,n),i&&setEdgeEnd(a,e,t,i),s[t.index].halfedges.push(u),s[e.index].halfedges.push(u),a}function createBorderEdge(t,e,n){var i=[e,n];return i.left=t,i}function setEdgeEnd(t,e,n,i){t[0]||t[1]?t.left===n?t[1]=i:t[0]=i:(t[0]=i,t.left=e,t.right=n)}function clipEdge(t,e,n,i,a){var s,u=t[0],c=t[1],f=u[0],h=u[1],d=0,p=1,g=c[0]-f,v=c[1]-h;if(s=e-f,g||!(s>0)){if(s/=g,g<0){if(s0){if(s>p)return;s>d&&(d=s)}if(s=i-f,g||!(s<0)){if(s/=g,g<0){if(s>p)return;s>d&&(d=s)}else if(g>0){if(s0)){if(s/=v,v<0){if(s0){if(s>p)return;s>d&&(d=s)}if(s=a-h,v||!(s<0)){if(s/=v,v<0){if(s>p)return;s>d&&(d=s)}else if(v>0){if(s0||p<1)||(d>0&&(t[0]=[f+d*g,h+d*v]),p<1&&(t[1]=[f+p*g,h+p*v]),!0)}}}}}function connectEdge(t,e,n,i,a){var s=t[1];if(s)return!0;var u,c,f=t[0],h=t.left,d=t.right,p=h[0],g=h[1],v=d[0],b=d[1],_=(p+v)/2,w=(g+b)/2;if(b===g){if(_=i)return;if(p>v){if(f){if(f[1]>=a)return}else f=[_,n];s=[_,a]}else{if(f){if(f[1]1)if(p>v){if(f){if(f[1]>=a)return}else f=[(n-c)/u,n];s=[(a-c)/u,a]}else{if(f){if(f[1]=i)return}else f=[e,u*e+c];s=[i,u*i+c]}else{if(f){if(f[0]=-h)){var M=g*g+v*v,E=b*b+_*_,T=(_*M-v*E)/w,S=(g*E-b*M)/w,k=n.pop()||new Circle;k.arc=t,k.site=c,k.x=T+d,k.y=(k.cy=S+p)+Math.sqrt(T*T+S*S),t.circle=k;for(var C=null,R=u._;R;)if(k.yf)d=d.L;else{if(!((u=c-rightBreakPoint(d,h))>f)){i>-f?(e=d.P,n=d):u>-f?(e=d,n=d.N):e=n=d;break}if(!d.R){e=d;break}d=d.R}!function createCell(t){return s[t.index]={site:t,halfedges:[]}}(t);var p=createBeach(t);if(a.insert(e,p),e||n){if(e===n)return detachCircle(e),n=createBeach(e.site),a.insert(p,n),p.edge=n.edge=createEdge(e.site,p.site),attachCircle(e),void attachCircle(n);if(n){detachCircle(e),detachCircle(n);var g=e.site,v=g[0],b=g[1],_=t[0]-v,w=t[1]-b,M=n.site,E=M[0]-v,T=M[1]-b,S=2*(_*T-w*E),k=_*_+w*w,C=E*E+T*T,R=[(T*k-w*C)/S+v,(_*C-E*k)/S+b];setEdgeEnd(n.edge,g,M,R),p.edge=createEdge(g,t,null,R),n.edge=createEdge(t,M,null,R),attachCircle(e),attachCircle(n)}else p.edge=createEdge(e.site,p.site)}}function leftBreakPoint(t,e){var n=t.site,i=n[0],a=n[1],s=a-e;if(!s)return i;var u=t.P;if(!u)return-1/0;var c=(n=u.site)[0],f=n[1],h=f-e;if(!h)return c;var d=c-i,p=1/s-1/h,g=d/h;return p?(-g+Math.sqrt(g*g-2*p*(d*d/(-2*h)-f+h/2+a-s/2)))/p+i:(i+c)/2}function rightBreakPoint(t,e){var n=t.N;if(n)return leftBreakPoint(n,e);var i=t.site;return i[1]===e?i[0]:1/0}var a,s,u,c,f=1e-6,h=1e-12;function lexicographic(t,e){return e[1]-t[1]||e[0]-t[0]}function Diagram(t,n){var i,h,d,p=t.sort(lexicographic).pop();for(c=[],s=new Array(t.length),a=new RedBlackTree,u=new RedBlackTree;;)if(d=e,p&&(!d||p[1]f||Math.abs(a[0][1]-a[1][1])>f)||delete c[s]}(g,v,b,_),function clipCells(t,e,n,i){var a,u,h,d,p,g,v,b,_,w,M,E,T=s.length,S=!0;for(a=0;af||Math.abs(E-_)>f)&&(p.splice(d,0,c.push(createBorderEdge(h,w,Math.abs(M-t)f?[t,Math.abs(b-t)f?[Math.abs(_-i)f?[n,Math.abs(b-n)f?[Math.abs(_-e)=c)return null;var f=t-a.site[0],h=e-a.site[1],d=f*f+h*h;do{a=s.cells[i=u],u=null,a.halfedges.forEach((function(n){var i=s.edges[n],c=i.left;if(c!==a.site&&c||(c=i.right)){var f=t-c[0],h=e-c[1],p=f*f+h*h;pi?(i+a)/2:Math.min(0,i)||Math.max(0,a),u>s?(s+u)/2:Math.min(0,s)||Math.max(0,u))}t.zoom=function(){var t,c,f=defaultFilter,h=defaultExtent,d=defaultConstrain,p=defaultWheelDelta,g=defaultTouchable,v=[0,1/0],b=[[-1/0,-1/0],[1/0,1/0]],_=250,w=i.interpolateZoom,M=[],E=e.dispatch("start","zoom","end"),T=0;function zoom(t){t.property("__zoom",defaultTransform).on("wheel.zoom",wheeled).on("mousedown.zoom",mousedowned).on("dblclick.zoom",dblclicked).filter(g).on("touchstart.zoom",touchstarted).on("touchmove.zoom",touchmoved).on("touchend.zoom touchcancel.zoom",touchended).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function scale(t,e){return(e=Math.max(v[0],Math.min(v[1],e)))===t.k?t:new Transform(e,t.x,t.y)}function translate(t,e,n){var i=e[0]-n[0]*t.k,a=e[1]-n[1]*t.k;return i===t.x&&a===t.y?t:new Transform(t.k,i,a)}function centroid(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function schedule(t,e,n){t.on("start.zoom",(function(){gesture(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){gesture(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,a=gesture(t,i),s=h.apply(t,i),u=n||centroid(s),c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),f=t.__zoom,d="function"==typeof e?e.apply(t,i):e,p=w(f.invert(u).concat(c/f.k),d.invert(u).concat(c/d.k));return function(t){if(1===t)t=d;else{var e=p(t),n=c/e[2];t=new Transform(n,u[0]-e[0]*n,u[1]-e[1]*n)}a.zoom(null,t)}}))}function gesture(t,e){for(var n,i=0,a=M.length;iT}t.zoom("mouse",d(translate(t.that.__zoom,t.mouse[0]=a.mouse(t.that),t.mouse[1]),t.extent,b))}),!0).on("mouseup.zoom",(function mouseupped(){e.on("mousemove.zoom mouseup.zoom",null),n.dragEnable(a.event.view,t.moved),noevent(),t.end()}),!0),i=a.mouse(this),u=a.event.clientX,h=a.event.clientY;n.dragDisable(a.event.view),nopropagation(),t.mouse=[i,this.__zoom.invert(i)],s.interrupt(this),t.start()}}function dblclicked(){if(f.apply(this,arguments)){var t=this.__zoom,e=a.mouse(this),n=t.invert(e),i=t.k*(a.event.shiftKey?.5:2),s=d(translate(scale(t,i),e,n),h.apply(this,arguments),b);noevent(),_>0?a.select(this).transition().duration(_).call(schedule,s,e):a.select(this).call(zoom.transform,s)}}function touchstarted(){if(f.apply(this,arguments)){var e,n,i,u,c=gesture(this,arguments),h=a.event.changedTouches,d=h.length;for(nopropagation(),n=0;ne?1:t>=e?0:NaN},bisector=function(t){return 1===t.length&&(t=function ascendingComparator(t){return function(e,n){return ascending(t(e),n)}}(t)),{left:function(e,n,i,a){for(null==i&&(i=0),null==a&&(a=e.length);i>>1;t(e[s],n)<0?i=s+1:a=s}return i},right:function(e,n,i,a){for(null==i&&(i=0),null==a&&(a=e.length);i>>1;t(e[s],n)>0?a=s:i=s+1}return i}}};var e=bisector(ascending),n=e.right,i=e.left;function pair(t,e){return[t,e]}var number=function(t){return null===t?NaN:+t},variance=function(t,e){var n,i,a=t.length,s=0,u=-1,c=0,f=0;if(null==e)for(;++u1)return f/(s-1)},deviation=function(t,e){var n=variance(t,e);return n?Math.sqrt(n):n},extent=function(t,e){var n,i,a,s=t.length,u=-1;if(null==e){for(;++u=n)for(i=a=n;++un&&(i=n),a=n)for(i=a=n;++un&&(i=n),a=0?(s>=c?10:s>=f?5:s>=h?2:1)*Math.pow(10,a):-Math.pow(10,-a)/(s>=c?10:s>=f?5:s>=h?2:1)}function tickStep(t,e,n){var i=Math.abs(e-t)/Math.max(0,n),a=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/a;return s>=c?a*=10:s>=f?a*=5:s>=h&&(a*=2),e=1)return+n(t[i-1],i-1,t);var i,a=(i-1)*e,s=Math.floor(a),u=+n(t[s],s,t);return u+(+n(t[s+1],s+1,t)-u)*(a-s)}},min=function(t,e){var n,i,a=t.length,s=-1;if(null==e){for(;++s=n)for(i=n;++sn&&(i=n)}else for(;++s=n)for(i=n;++sn&&(i=n);return i},transpose=function(t){if(!(a=t.length))return[];for(var e=-1,n=min(t,length),i=new Array(n);++et?1:e>=t?0:NaN},t.deviation=deviation,t.extent=extent,t.histogram=function(){var t=identity,e=extent,i=sturges;function histogram(a){var s,u,c=a.length,f=new Array(c);for(s=0;sp;)g.pop(),--v;var b,_=new Array(v+1);for(s=0;s<=v;++s)(b=_[s]=[]).x0=s>0?g[s-1]:d,b.x1=s=n)for(i=n;++si&&(i=n)}else for(;++s=n)for(i=n;++si&&(i=n);return i},t.mean=function(t,e){var n,i=t.length,a=i,s=-1,u=0;if(null==e)for(;++s=0;)for(e=(i=t[a]).length;--e>=0;)n[--u]=i[e];return n},t.min=min,t.pairs=function(t,e){null==e&&(e=pair);for(var n=0,i=t.length-1,a=t[0],s=new Array(i<0?0:i);n0)return[t];if((i=e0)for(t=Math.ceil(t/u),e=Math.floor(e/u),s=new Array(a=Math.ceil(e-t+1));++c=i.length)return null!=t&&n.sort(t),null!=e?e(n):n;for(var c,f,h,d=-1,p=n.length,g=i[a++],v=map(),b=s();++di.length)return t;var s,u=a[n-1];return null!=e&&n>=i.length?s=t.entries():(s=[],t.each((function(t,e){s.push({key:e,values:entries(t,n)})}))),null!=u?s.sort((function(t,e){return u(t.key,e.key)})):s}return n={object:function(t){return apply(t,0,createObject,setObject)},map:function(t){return apply(t,0,createMap,setMap)},entries:function(t){return entries(apply(t,0,createMap,setMap),0)},key:function(t){return i.push(t),n},sortKeys:function(t){return a[i.length-1]=t,n},sortValues:function(e){return t=e,n},rollup:function(t){return e=t,n}}},t.set=set,t.map=map,t.keys=function(t){var e=[];for(var n in t)e.push(n);return e},t.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},t.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],76:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var define=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function extend(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Color(){}var e=.7,n=1/e,i="\\s*([+-]?\\d+)\\s*",a="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",s="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",u=/^#([0-9a-f]{3})$/,c=/^#([0-9a-f]{6})$/,f=new RegExp("^rgb\\("+[i,i,i]+"\\)$"),h=new RegExp("^rgb\\("+[s,s,s]+"\\)$"),d=new RegExp("^rgba\\("+[i,i,i,a]+"\\)$"),p=new RegExp("^rgba\\("+[s,s,s,a]+"\\)$"),g=new RegExp("^hsl\\("+[a,s,s]+"\\)$"),v=new RegExp("^hsla\\("+[a,s,s,a]+"\\)$"),b={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function color(t){var e;return t=(t+"").trim().toLowerCase(),(e=u.exec(t))?new Rgb((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=c.exec(t))?rgbn(parseInt(e[1],16)):(e=f.exec(t))?new Rgb(e[1],e[2],e[3],1):(e=h.exec(t))?new Rgb(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=d.exec(t))?rgba(e[1],e[2],e[3],e[4]):(e=p.exec(t))?rgba(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=g.exec(t))?hsla(e[1],e[2]/100,e[3]/100,1):(e=v.exec(t))?hsla(e[1],e[2]/100,e[3]/100,e[4]):b.hasOwnProperty(t)?rgbn(b[t]):"transparent"===t?new Rgb(NaN,NaN,NaN,0):null}function rgbn(t){return new Rgb(t>>16&255,t>>8&255,255&t,1)}function rgba(t,e,n,i){return i<=0&&(t=e=n=NaN),new Rgb(t,e,n,i)}function rgbConvert(t){return t instanceof Color||(t=color(t)),t?new Rgb((t=t.rgb()).r,t.g,t.b,t.opacity):new Rgb}function rgb(t,e,n,i){return 1===arguments.length?rgbConvert(t):new Rgb(t,e,n,null==i?1:i)}function Rgb(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function hsla(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Hsl(t,e,n,i)}function hsl(t,e,n,i){return 1===arguments.length?function hslConvert(t){if(t instanceof Hsl)return new Hsl(t.h,t.s,t.l,t.opacity);if(t instanceof Color||(t=color(t)),!t)return new Hsl;if(t instanceof Hsl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,a=Math.min(e,n,i),s=Math.max(e,n,i),u=NaN,c=s-a,f=(s+a)/2;return c?(u=e===s?(n-i)/c+6*(n0&&f<1?0:u,new Hsl(u,c,f,t.opacity)}(t):new Hsl(t,e,n,null==i?1:i)}function Hsl(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function hsl2rgb(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}define(Color,color,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),define(Rgb,rgb,extend(Color,{brighter:function(t){return t=null==t?n:Math.pow(n,t),new Rgb(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?e:Math.pow(e,t),new Rgb(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),define(Hsl,hsl,extend(Color,{brighter:function(t){return t=null==t?n:Math.pow(n,t),new Hsl(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?e:Math.pow(e,t),new Hsl(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,a=2*n-i;return new Rgb(hsl2rgb(t>=240?t-240:t+120,a,i),hsl2rgb(t,a,i),hsl2rgb(t<120?t+240:t-120,a,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var _=Math.PI/180,w=180/Math.PI,M=.95047,E=1.08883,T=4/29,S=6/29,k=3*S*S,C=S*S*S;function labConvert(t){if(t instanceof Lab)return new Lab(t.l,t.a,t.b,t.opacity);if(t instanceof Hcl){var e=t.h*_;return new Lab(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof Rgb||(t=rgbConvert(t));var n=rgb2xyz(t.r),i=rgb2xyz(t.g),a=rgb2xyz(t.b),s=xyz2lab((.4124564*n+.3575761*i+.1804375*a)/M),u=xyz2lab((.2126729*n+.7151522*i+.072175*a)/1);return new Lab(116*u-16,500*(s-u),200*(u-xyz2lab((.0193339*n+.119192*i+.9503041*a)/E)),t.opacity)}function lab(t,e,n,i){return 1===arguments.length?labConvert(t):new Lab(t,e,n,null==i?1:i)}function Lab(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function xyz2lab(t){return t>C?Math.pow(t,1/3):t/k+T}function lab2xyz(t){return t>S?t*t*t:k*(t-T)}function xyz2rgb(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function rgb2xyz(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function hcl(t,e,n,i){return 1===arguments.length?function hclConvert(t){if(t instanceof Hcl)return new Hcl(t.h,t.c,t.l,t.opacity);t instanceof Lab||(t=labConvert(t));var e=Math.atan2(t.b,t.a)*w;return new Hcl(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new Hcl(t,e,n,null==i?1:i)}function Hcl(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}define(Lab,lab,extend(Color,{brighter:function(t){return new Lab(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Lab(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return t=1*lab2xyz(t),new Rgb(xyz2rgb(3.2404542*(e=M*lab2xyz(e))-1.5371385*t-.4985314*(n=E*lab2xyz(n))),xyz2rgb(-.969266*e+1.8760108*t+.041556*n),xyz2rgb(.0556434*e-.2040259*t+1.0572252*n),this.opacity)}})),define(Hcl,hcl,extend(Color,{brighter:function(t){return new Hcl(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Hcl(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return labConvert(this).rgb()}}));var R=-.14861,N=1.78277,A=-.29227,O=-.90649,j=1.97294,L=j*O,P=j*N,U=N*A-O*R;function cubehelix(t,e,n,i){return 1===arguments.length?function cubehelixConvert(t){if(t instanceof Cubehelix)return new Cubehelix(t.h,t.s,t.l,t.opacity);t instanceof Rgb||(t=rgbConvert(t));var e=t.r/255,n=t.g/255,i=t.b/255,a=(U*i+L*e-P*n)/(U+L-P),s=i-a,u=(j*(n-a)-A*s)/O,c=Math.sqrt(u*u+s*s)/(j*a*(1-a)),f=c?Math.atan2(u,s)*w-120:NaN;return new Cubehelix(f<0?f+360:f,c,a,t.opacity)}(t):new Cubehelix(t,e,n,null==i?1:i)}function Cubehelix(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}define(Cubehelix,cubehelix,extend(Color,{brighter:function(t){return t=null==t?n:Math.pow(n,t),new Cubehelix(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?e:Math.pow(e,t),new Cubehelix(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*_,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),i=Math.cos(t),a=Math.sin(t);return new Rgb(255*(e+n*(R*i+N*a)),255*(e+n*(A*i+O*a)),255*(e+n*(j*i)),this.opacity)}})),t.color=color,t.rgb=rgb,t.hsl=hsl,t.lab=lab,t.hcl=hcl,t.cubehelix=cubehelix,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],77:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var e={value:function(){}};function dispatch(){for(var t,e=0,n=arguments.length,i={};e=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",i),s=-1,u=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++s0)for(var n,i,a=new Array(n),s=0;sv}d.mouse("drag")}function mouseupped(){n.select(n.event.view).on("mousemove.drag mouseup.drag",null),yesdrag(n.event.view,a),noevent(),d.mouse("end")}function touchstarted(){if(u.apply(this,arguments)){var t,e,i=n.event.changedTouches,a=c.apply(this,arguments),s=i.length;for(t=0;t=1?(n=1,e-1):Math.floor(n*e),a=t[i],s=t[i+1],u=i>0?t[i-1]:2*a-s,c=i180||n<-180?n-360*Math.round(n/360):n):constant(isNaN(t)?e:t)}function gamma(t){return 1==(t=+t)?nogamma:function(e,n){return n-e?function exponential(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):constant(isNaN(e)?n:e)}}function nogamma(t,e){var n=e-t;return n?linear(t,n):constant(isNaN(t)?e:t)}var n=function rgbGamma(t){var n=gamma(t);function rgb$$1(t,i){var a=n((t=e.rgb(t)).r,(i=e.rgb(i)).r),s=n(t.g,i.g),u=n(t.b,i.b),c=nogamma(t.opacity,i.opacity);return function(e){return t.r=a(e),t.g=s(e),t.b=u(e),t.opacity=c(e),t+""}}return rgb$$1.gamma=rgbGamma,rgb$$1}(1);function rgbSpline(t){return function(n){var i,a,s=n.length,u=new Array(s),c=new Array(s),f=new Array(s);for(i=0;ic&&(a=e.slice(c,a),h[f]?h[f]+=a:h[++f]=a),(n=n[0])===(i=i[0])?h[f]?h[f]+=i:h[++f]=i:(h[++f]=null,d.push({i:f,x:number(n,i)})),c=u.lastIndex;return c180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(pop(n)+"rotate(",null,i)-2,x:number(t,e)})):e&&n.push(pop(n)+"rotate("+e+i)}(a.rotate,s.rotate,u,c),function skewX(t,e,n,a){t!==e?a.push({i:n.push(pop(n)+"skewX(",null,i)-2,x:number(t,e)}):e&&n.push(pop(n)+"skewX("+e+i)}(a.skewX,s.skewX,u,c),function scale(t,e,n,i,a,s){if(t!==n||e!==i){var u=a.push(pop(a)+"scale(",null,",",null,")");s.push({i:u-4,x:number(t,n)},{i:u-2,x:number(e,i)})}else 1===n&&1===i||a.push(pop(a)+"scale("+n+","+i+")")}(a.scaleX,a.scaleY,s.scaleX,s.scaleY,u,c),a=s=null,function(t){for(var e,n=-1,i=c.length;++ni)if(Math.abs(g*h-d*p)>i&&u){var b=a-c,_=s-f,w=h*h+d*d,M=b*b+_*_,E=Math.sqrt(w),T=Math.sqrt(v),S=u*Math.tan((e-Math.acos((w+v-M)/(2*E*T)))/2),k=S/T,C=S/E;Math.abs(k-1)>i&&(this._+="L"+(t+k*p)+","+(n+k*g)),this._+="A"+u+","+u+",0,0,"+ +(g*b>p*_)+","+(this._x1=t+C*h)+","+(this._y1=n+C*d)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,s,u,c,f,h){t=+t,s=+s;var d=(u=+u)*Math.cos(c),p=u*Math.sin(c),g=t+d,v=s+p,b=1^h,_=h?c-f:f-c;if(u<0)throw new Error("negative radius: "+u);null===this._x1?this._+="M"+g+","+v:(Math.abs(this._x1-g)>i||Math.abs(this._y1-v)>i)&&(this._+="L"+g+","+v),u&&(_<0&&(_=_%n+n),_>a?this._+="A"+u+","+u+",0,1,"+b+","+(t-d)+","+(s-p)+"A"+u+","+u+",0,1,"+b+","+(this._x1=g)+","+(this._y1=v):_>i&&(this._+="A"+u+","+u+",0,"+ +(_>=e)+","+b+","+(this._x1=t+u*Math.cos(f))+","+(this._y1=s+u*Math.sin(f))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}},t.path=path,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],85:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var e="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function namespace(t){var e=t+="",i=e.indexOf(":");return i>=0&&"xmlns"!==(e=t.slice(0,i))&&(t=t.slice(i+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function creatorInherit(t){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===e&&n.documentElement.namespaceURI===e?n.createElement(t):n.createElementNS(i,t)}}function creatorFixed(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function creator(t){var e=namespace(t);return(e.local?creatorFixed:creatorInherit)(e)}function none(){}function selector(t){return null==t?none:function(){return this.querySelector(t)}}function empty(){return[]}function selectorAll(t){return null==t?empty:function(){return this.querySelectorAll(t)}}var matcher=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var i=document.documentElement;if(!i.matches){var a=i.webkitMatchesSelector||i.msMatchesSelector||i.mozMatchesSelector||i.oMatchesSelector;matcher=function(t){return function(){return a.call(this,t)}}}}var s=matcher;function sparse(t){return new Array(t.length)}function EnterNode(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}EnterNode.prototype={constructor:EnterNode,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function bindIndex(t,e,n,i,a,s){for(var u,c=0,f=e.length,h=s.length;ce?1:t>=e?0:NaN}function attrRemove(t){return function(){this.removeAttribute(t)}}function attrRemoveNS(t){return function(){this.removeAttributeNS(t.space,t.local)}}function attrConstant(t,e){return function(){this.setAttribute(t,e)}}function attrConstantNS(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function attrFunction(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function attrFunctionNS(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function defaultView(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function styleRemove(t){return function(){this.style.removeProperty(t)}}function styleConstant(t,e,n){return function(){this.style.setProperty(t,e,n)}}function styleFunction(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function styleValue(t,e){return t.style.getPropertyValue(e)||defaultView(t).getComputedStyle(t,null).getPropertyValue(e)}function propertyRemove(t){return function(){delete this[t]}}function propertyConstant(t,e){return function(){this[t]=e}}function propertyFunction(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function classArray(t){return t.trim().split(/^|\s+/)}function classList(t){return t.classList||new ClassList(t)}function ClassList(t){this._node=t,this._names=classArray(t.getAttribute("class")||"")}function classedAdd(t,e){for(var n=classList(t),i=-1,a=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var u={};(t.event=null,"undefined"!=typeof document)&&("onmouseenter"in document.documentElement||(u={mouseenter:"mouseover",mouseleave:"mouseout"}));function filterContextListener(t,e,n){return t=contextListener(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function contextListener(e,n,i){return function(a){var s=t.event;t.event=a;try{e.call(this,this.__data__,n,i)}finally{t.event=s}}}function onRemove(t){return function(){var e=this.__on;if(e){for(var n,i=0,a=-1,s=e.length;i=S&&(S=T+1);!(E=w[S])&&++S=0;)(i=a[s])&&(u&&u!==i.nextSibling&&u.parentNode.insertBefore(i,u),u=i);return this},sort:function selection_sort(t){function compareNode(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ascending);for(var e=this._groups,n=e.length,i=new Array(n),a=0;a1?this.each((null==e?styleRemove:"function"==typeof e?styleFunction:styleConstant)(t,e,null==n?"":n)):styleValue(this.node(),t)},property:function selection_property(t,e){return arguments.length>1?this.each((null==e?propertyRemove:"function"==typeof e?propertyFunction:propertyConstant)(t,e)):this.node()[t]},classed:function selection_classed(t,e){var n=classArray(t+"");if(arguments.length<2){for(var i=classList(this.node()),a=-1,s=n.length;++a=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),u=s.length;if(!(arguments.length<2)){for(c=e?onAdd:onRemove,null==n&&(n=!1),i=0;i0))return u;do{u.push(s=new Date(+e)),i(e,a),t(e)}while(s=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;i(t,-1),!e(t););else for(;--n>=0;)for(;i(t,1),!e(t););}))},a&&(interval.count=function(i,s){return e.setTime(+i),n.setTime(+s),t(e),t(n),Math.floor(a(e,n))},interval.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?interval.filter(s?function(e){return s(e)%t==0}:function(e){return interval.count(0,e)%t==0}):interval:null}),interval}var i=newInterval((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?newInterval((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):i:null};var a=i.range,s=1e3,u=6e4,c=36e5,f=864e5,h=6048e5,d=newInterval((function(t){t.setTime(Math.floor(t/s)*s)}),(function(t,e){t.setTime(+t+e*s)}),(function(t,e){return(e-t)/s}),(function(t){return t.getUTCSeconds()})),p=d.range,g=newInterval((function(t){t.setTime(Math.floor(t/u)*u)}),(function(t,e){t.setTime(+t+e*u)}),(function(t,e){return(e-t)/u}),(function(t){return t.getMinutes()})),v=g.range,b=newInterval((function(t){var e=t.getTimezoneOffset()*u%c;e<0&&(e+=c),t.setTime(Math.floor((+t-e)/c)*c+e)}),(function(t,e){t.setTime(+t+e*c)}),(function(t,e){return(e-t)/c}),(function(t){return t.getHours()})),_=b.range,w=newInterval((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*u)/f}),(function(t){return t.getDate()-1})),M=w.range;function weekday(t){return newInterval((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*u)/h}))}var E=weekday(0),T=weekday(1),S=weekday(2),k=weekday(3),C=weekday(4),R=weekday(5),N=weekday(6),A=E.range,O=T.range,j=S.range,L=k.range,P=C.range,U=R.range,I=N.range,D=newInterval((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),q=D.range,B=newInterval((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));B.every=function(t){return isFinite(t=Math.floor(t))&&t>0?newInterval((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var z=B.range,H=newInterval((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*u)}),(function(t,e){return(e-t)/u}),(function(t){return t.getUTCMinutes()})),W=H.range,$=newInterval((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*c)}),(function(t,e){return(e-t)/c}),(function(t){return t.getUTCHours()})),V=$.range,Z=newInterval((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/f}),(function(t){return t.getUTCDate()-1})),G=Z.range;function utcWeekday(t){return newInterval((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/h}))}var Q=utcWeekday(0),J=utcWeekday(1),K=utcWeekday(2),tt=utcWeekday(3),et=utcWeekday(4),nt=utcWeekday(5),rt=utcWeekday(6),it=Q.range,ot=J.range,at=K.range,st=tt.range,ut=et.range,ct=nt.range,lt=rt.range,ft=newInterval((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),ht=ft.range,dt=newInterval((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));dt.every=function(t){return isFinite(t=Math.floor(t))&&t>0?newInterval((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var pt=dt.range;t.timeInterval=newInterval,t.timeMillisecond=i,t.timeMilliseconds=a,t.utcMillisecond=i,t.utcMilliseconds=a,t.timeSecond=d,t.timeSeconds=p,t.utcSecond=d,t.utcSeconds=p,t.timeMinute=g,t.timeMinutes=v,t.timeHour=b,t.timeHours=_,t.timeDay=w,t.timeDays=M,t.timeWeek=E,t.timeWeeks=A,t.timeSunday=E,t.timeSundays=A,t.timeMonday=T,t.timeMondays=O,t.timeTuesday=S,t.timeTuesdays=j,t.timeWednesday=k,t.timeWednesdays=L,t.timeThursday=C,t.timeThursdays=P,t.timeFriday=R,t.timeFridays=U,t.timeSaturday=N,t.timeSaturdays=I,t.timeMonth=D,t.timeMonths=q,t.timeYear=B,t.timeYears=z,t.utcMinute=H,t.utcMinutes=W,t.utcHour=$,t.utcHours=V,t.utcDay=Z,t.utcDays=G,t.utcWeek=Q,t.utcWeeks=it,t.utcSunday=Q,t.utcSundays=it,t.utcMonday=J,t.utcMondays=ot,t.utcTuesday=K,t.utcTuesdays=at,t.utcWednesday=tt,t.utcWednesdays=st,t.utcThursday=et,t.utcThursdays=ut,t.utcFriday=nt,t.utcFridays=ct,t.utcSaturday=rt,t.utcSaturdays=lt,t.utcMonth=ft,t.utcMonths=ht,t.utcYear=dt,t.utcYears=pt,Object.defineProperty(t,"__esModule",{value:!0})}))},{}],87:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?i(n):"function"==typeof define&&define.amd?define(["exports"],i):i(t.d3=t.d3||{})}(this,(function(t){var e,n,i=0,a=0,s=0,u=0,c=0,f=0,h="object"==typeof performance&&performance.now?performance:Date,d="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function now(){return c||(d(clearNow),c=h.now()+f)}function clearNow(){c=0}function Timer(){this._call=this._time=this._next=null}function timer(t,e,n){var i=new Timer;return i.restart(t,e,n),i}function timerFlush(){now(),++i;for(var t,n=e;n;)(t=c-n._time)>=0&&n._call.call(null,t),n=n._next;--i}function wake(){c=(u=h.now())+f,i=a=0;try{timerFlush()}finally{i=0,function nap(){var t,i,a=e,s=1/0;for(;a;)a._call?(s>a._time&&(s=a._time),t=a,a=a._next):(i=a._next,a._next=null,a=t?t._next=i:e=i);n=t,sleep(s)}(),c=0}}function poke(){var t=h.now(),e=t-u;e>1e3&&(f-=e,u=t)}function sleep(t){i||(a&&(a=clearTimeout(a)),t-c>24?(t<1/0&&(a=setTimeout(wake,t-h.now()-f)),s&&(s=clearInterval(s))):(s||(u=h.now(),s=setInterval(poke,1e3)),i=1,d(wake)))}Timer.prototype=timer.prototype={constructor:Timer,restart:function(t,i,a){if("function"!=typeof t)throw new TypeError("callback is not a function");a=(null==a?now():+a)+(null==i?0:+i),this._next||n===this||(n?n._next=this:e=this,n=this),this._call=t,this._time=a,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}};t.now=now,t.timer=timer,t.timerFlush=timerFlush,t.timeout=function(t,e,n){var i=new Timer;return e=null==e?0:+e,i.restart((function(n){i.stop(),t(n+e)}),e,n),i},t.interval=function(t,e,n){var i=new Timer,a=e;return null==e?(i.restart(t,e,n),i):(e=+e,n=null==n?now():+n,i.restart((function tick(s){s+=a,i.restart(tick,a+=e,n),t(s)}),e,n),i)},Object.defineProperty(t,"__esModule",{value:!0})}))},{}],88:[function(t,e,n){!function(i,a){"object"==typeof n&&void 0!==e?a(n,t("d3-selection"),t("d3-dispatch"),t("d3-timer"),t("d3-interpolate"),t("d3-color"),t("d3-ease")):"function"==typeof define&&define.amd?define(["exports","d3-selection","d3-dispatch","d3-timer","d3-interpolate","d3-color","d3-ease"],a):a(i.d3=i.d3||{},i.d3,i.d3,i.d3,i.d3,i.d3,i.d3)}(this,(function(t,e,n,i,a,s,u){var c=n.dispatch("start","end","interrupt"),f=[],schedule=function(t,e,n,a,s,u){var h=t.__transition;if(h){if(n in h)return}else t.__transition={};!function create(t,e,n){var a,s=t.__transition;function schedule(t){n.state=1,n.timer.restart(start,n.delay,n.time),n.delay<=t&&start(t-n.delay)}function start(u){var c,f,h,d;if(1!==n.state)return stop();for(c in s)if((d=s[c]).name===n.name){if(3===d.state)return i.timeout(start);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete s[c]):+c0)throw new Error("too late; already scheduled");return n}function set(t,e){var n=get(t,e);if(n.state>2)throw new Error("too late; already started");return n}function get(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var interrupt=function(t,e){var n,i,a,s=t.__transition,u=!0;if(s){for(a in e=null==e?null:e+"",s)(n=s[a]).name===e?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),i&&n.on.call("interrupt",t,t.__data__,n.index,n.group),delete s[a]):u=!1;u&&delete t.__transition}};function tweenRemove(t,e){var n,i;return function(){var a=set(this,t),s=a.tween;if(s!==n)for(var u=0,c=(i=n=s).length;u=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?init:set;return function(){var u=s(this,t),c=u.on;c!==i&&(a=(i=c).copy()).on(e,n),u.on=a}}(n,t,e))},attr:function(t,n){var i=e.namespace(t),s="transform"===i?a.interpolateTransformSvg:interpolate;return this.attrTween(t,"function"==typeof n?(i.local?attrFunctionNS:attrFunction)(i,s,tweenValue(this,"attr."+t,n)):null==n?(i.local?attrRemoveNS:attrRemove)(i):(i.local?attrConstantNS:attrConstant)(i,s,n+""))},attrTween:function(t,n){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==n)return this.tween(i,null);if("function"!=typeof n)throw new Error;var a=e.namespace(t);return this.tween(i,(a.local?attrTweenNS:attrTween)(a,n))},style:function(t,n,i){var s="transform"==(t+="")?a.interpolateTransformCss:interpolate;return null==n?this.styleTween(t,function styleRemove(t,n){var i,a,s;return function(){var u=e.style(this,t),c=(this.style.removeProperty(t),e.style(this,t));return u===c?null:u===i&&c===a?s:s=n(i=u,a=c)}}(t,s)).on("end.style."+t,function styleRemoveEnd(t){return function(){this.style.removeProperty(t)}}(t)):this.styleTween(t,"function"==typeof n?function styleFunction(t,n,i){var a,s,u;return function(){var c=e.style(this,t),f=i(this);return null==f&&(this.style.removeProperty(t),f=e.style(this,t)),c===f?null:c===a&&f===s?u:u=n(a=c,s=f)}}(t,s,tweenValue(this,"style."+t,n)):function styleConstant(t,n,i){var a,s;return function(){var u=e.style(this,t);return u===i?null:u===a?s:s=n(a=u,i)}}(t,s,n+""),i)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function styleTween(t,e,n){function tween(){var i=this,a=e.apply(i,arguments);return a&&function(e){i.style.setProperty(t,a(e),n)}}return tween._value=e,tween}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function textFunction(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(tweenValue(this,"text",t)):function textConstant(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",function removeFunction(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,a=get(this.node(),n).tween,s=0,u=a.length;s1&&n.name===e)return new Transition([[t]],v,e,+i);return null},t.interrupt=interrupt,Object.defineProperty(t,"__esModule",{value:!0})}))},{"d3-color":89,"d3-dispatch":90,"d3-ease":91,"d3-interpolate":92,"d3-selection":93,"d3-timer":94}],89:[function(t,e,n){arguments[4][44][0].apply(n,arguments)},{dup:44}],90:[function(t,e,n){arguments[4][45][0].apply(n,arguments)},{dup:45}],91:[function(t,e,n){arguments[4][48][0].apply(n,arguments)},{dup:48}],92:[function(t,e,n){arguments[4][54][0].apply(n,arguments)},{"d3-color":89,dup:54}],93:[function(t,e,n){arguments[4][65][0].apply(n,arguments)},{dup:65}],94:[function(t,e,n){arguments[4][69][0].apply(n,arguments)},{dup:69}],95:[function(t,e,n){var i=Object.create||function objectCreatePolyfill(t){var F=function(){};return F.prototype=t,new F},a=Object.keys||function objectKeysPolyfill(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return n},s=Function.prototype.bind||function functionBindPolyfill(t){var e=this;return function(){return e.apply(t,arguments)}};function EventEmitter(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=i(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0;var u,c=10;try{var f={};Object.defineProperty&&Object.defineProperty(f,"x",{value:0}),u=0===f.x}catch(t){u=!1}function $getMaxListeners(t){return void 0===t._maxListeners?EventEmitter.defaultMaxListeners:t._maxListeners}function _addListener(t,e,n,a){var s,u,c;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((u=t._events)?(u.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),u=t._events),c=u[e]):(u=t._events=i(null),t._eventsCount=0),c){if("function"==typeof c?c=u[e]=a?[n,c]:[c,n]:a?c.unshift(n):c.push(n),!c.warned&&(s=$getMaxListeners(t))&&s>0&&c.length>s){c.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+c.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=c.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",f.name,f.message)}}else c=u[e]=n,++t._eventsCount;return t}function onceWrapper(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var f=new Error('Unhandled "error" event. ('+e+")");throw f.context=e,f}if(!(n=u[t]))return!1;var h="function"==typeof n;switch(i=arguments.length){case 1:!function emitNone(t,e,n){if(e)t.call(n);else for(var i=t.length,a=arrayClone(t,i),s=0;s=0;u--)if(n[u]===e||n[u].listener===e){c=n[u].listener,s=u;break}if(s<0)return this;0===s?n.shift():function spliceOne(t,e){for(var n=e,i=n+1,a=t.length;i=0;s--)this.removeListener(t,e[s]);return this},EventEmitter.prototype.listeners=function listeners(t){return _listeners(this,t,!0)},EventEmitter.prototype.rawListeners=function rawListeners(t){return _listeners(this,t,!1)},EventEmitter.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):listenerCount.call(t,e)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],96:[function(t,e,n){var i=t("http"),a=t("url"),s=e.exports;for(var u in i)i.hasOwnProperty(u)&&(s[u]=i[u]);function validateParams(t){if("string"==typeof t&&(t=a.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}s.request=function(t,e){return t=validateParams(t),i.request.call(this,t,e)},s.get=function(t,e){return t=validateParams(t),i.get.call(this,t,e)}},{http:19,url:106}],97:[function(t,e,n){n.read=function(t,e,n,i,a){var s,u,c=8*a-i-1,f=(1<>1,d=-7,p=n?a-1:0,g=n?-1:1,v=t[e+p];for(p+=g,s=v&(1<<-d)-1,v>>=-d,d+=c;d>0;s=256*s+t[e+p],p+=g,d-=8);for(u=s&(1<<-d)-1,s>>=-d,d+=i;d>0;u=256*u+t[e+p],p+=g,d-=8);if(0===s)s=1-h;else{if(s===f)return u?NaN:1/0*(v?-1:1);u+=Math.pow(2,i),s-=h}return(v?-1:1)*u*Math.pow(2,s-i)},n.write=function(t,e,n,i,a,s){var u,c,f,h=8*s-a-1,d=(1<>1,g=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,v=i?0:s-1,b=i?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,u=d):(u=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-u))<1&&(u--,f*=2),(e+=u+p>=1?g/f:g*Math.pow(2,1-p))*f>=2&&(u++,f/=2),u+p>=d?(c=0,u=d):u+p>=1?(c=(e*f-1)*Math.pow(2,a),u+=p):(c=e*Math.pow(2,p-1)*Math.pow(2,a),u=0));a>=8;t[n+v]=255&c,v+=b,c/=256,a-=8);for(u=u<0;t[n+v]=255&u,v+=b,u/=256,h-=8);t[n+v-b]|=128*_}},{}],98:[function(t,e,n){"function"==typeof Object.create?e.exports=function inherits(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(t,e){if(e){t.super_=e;var TempCtor=function(){};TempCtor.prototype=e.prototype,t.prototype=new TempCtor,t.prototype.constructor=t}}},{}],99:[function(t,e,n){function stdOnEnd(t,e){t.onload=function(){this.onerror=this.onload=null,e(null,t)},t.onerror=function(){this.onerror=this.onload=null,e(new Error("Failed to load "+this.src),t)}}function ieOnEnd(t,e){t.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,e(null,t))}}e.exports=function load(t,e,n){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},a.type=e.type||"text/javascript",a.charset=e.charset||"utf8",a.async=!("async"in e)||!!e.async,a.src=t,e.attrs&&function setAttributes(t,e){for(var n in e)t.setAttribute(n,e[n])}(a,e.attrs),e.text&&(a.text=""+e.text),("onload"in a?stdOnEnd:ieOnEnd)(a,n),a.onload||stdOnEnd(a,n),i.appendChild(a)}},{}],100:[function(t,e,n){var i,a,s=e.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(t){if(i===setTimeout)return setTimeout(t,0);if((i===defaultSetTimout||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(t){i=defaultSetTimout}try{a="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(t){a=defaultClearTimeout}}();var u,c=[],f=!1,h=-1;function cleanUpNextTick(){f&&u&&(f=!1,u.length?c=u.concat(c):h=-1,c.length&&drainQueue())}function drainQueue(){if(!f){var t=runTimeout(cleanUpNextTick);f=!0;for(var e=c.length;e;){for(u=c,c=[];++h1)for(var n=1;n0&&f>c&&(f=c);for(var h=0;h=0?(d=b.substr(0,_),p=b.substr(_+1)):(d=b,p=""),g=decodeURIComponent(d),v=decodeURIComponent(p),hasOwnProperty(s,g)?i(s[g])?s[g].push(v):s[g]=[s[g],v]:s[g]=v}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],102:[function(t,e,n){var stringifyPrimitive=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,n,s){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?map(a(t),(function(a){var s=encodeURIComponent(stringifyPrimitive(a))+n;return i(t[a])?map(t[a],(function(t){return s+encodeURIComponent(stringifyPrimitive(t))})).join(e):s+encodeURIComponent(stringifyPrimitive(t[a]))})).join(e):s?encodeURIComponent(stringifyPrimitive(s))+n+encodeURIComponent(stringifyPrimitive(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function map(t,e){if(t.map)return t.map(e);for(var n=[],i=0;i */var i=t("buffer"),a=i.Buffer;function copyProps(t,e){for(var n in t)e[n]=t[n]}function SafeBuffer(t,e,n){return a(t,e,n)}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=i:(copyProps(i,n),n.Buffer=SafeBuffer),SafeBuffer.prototype=Object.create(a.prototype),copyProps(a,SafeBuffer),SafeBuffer.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return a(t,e,n)},SafeBuffer.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=a(t);return void 0!==e?"string"==typeof n?i.fill(e,n):i.fill(e):i.fill(0),i},SafeBuffer.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return a(t)},SafeBuffer.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},{buffer:17}],105:[function(t,e,n){var i=t("safe-buffer").Buffer,a=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function StringDecoder(t){var e;switch(this.encoding=function normalizeEncoding(t){var e=function _normalizeEncoding(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===a||!a(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,e=4;break;case"utf8":this.fillLast=utf8FillLast,e=4;break;case"base64":this.text=base64Text,this.end=base64End,e=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function utf8CheckByte(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function utf8FillLast(t){var e=this.lastTotal-this.lastNeed,n=function utf8CheckExtraBytes(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function utf16Text(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function utf16End(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function base64Text(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function base64End(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function simpleWrite(t){return t.toString(this.encoding)}function simpleEnd(t){return t&&t.length?this.write(t):""}n.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return a>0&&(t.lastNeed=a-1),a;if(--i=0)return a>0&&(t.lastNeed=a-2),a;if(--i=0)return a>0&&(2===a?a=0:t.lastNeed=a-3),a;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},StringDecoder.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":104}],106:[function(t,e,n){var i=t("punycode"),a=t("./util");function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}n.parse=urlParse,n.resolve=function urlResolve(t,e){return urlParse(t,!1,!0).resolve(e)},n.resolveObject=function urlResolveObject(t,e){return t?urlParse(t,!1,!0).resolveObject(e):e},n.format=function urlFormat(t){a.isString(t)&&(t=urlParse(t));return t instanceof Url?t.format():Url.prototype.format.call(t)},n.Url=Url;var s=/^([a-z0-9.+-]+:)/i,u=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,f=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(f),d=["%","/","?",";","#"].concat(h),p=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},M=t("querystring");function urlParse(t,e,n){if(t&&a.isObject(t)&&t instanceof Url)return t;var i=new Url;return i.parse(t,e,n),i}Url.prototype.parse=function(t,e,n){if(!a.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var u=t.indexOf("?"),f=-1!==u&&u127?q+="x":q+=D[B];if(!q.match(g)){var H=U.slice(0,j),W=U.slice(j+1),$=D.match(v);$&&(H.push($[1]),W.unshift($[2])),W.length&&(T="/"+W.join(".")+T),this.hostname=H.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=i.toASCII(this.hostname));var V=this.port?":"+this.port:"",Z=this.hostname||"";this.host=Z+V,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==T[0]&&(T="/"+T))}if(!b[C])for(j=0,I=h.length;j0)&&n.host.split("@"))&&(n.auth=L.shift(),n.host=n.hostname=L.shift());return n.search=t.search,n.query=t.query,a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!C.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var N=C.slice(-1)[0],A=(n.host||t.host||C.length>1)&&("."===N||".."===N)||""===N,O=0,j=C.length;j>=0;j--)"."===(N=C[j])?C.splice(j,1):".."===N?(C.splice(j,1),O++):O&&(C.splice(j,1),O--);if(!S&&!k)for(;O--;O)C.unshift("..");!S||""===C[0]||C[0]&&"/"===C[0].charAt(0)||C.unshift(""),A&&"/"!==C.join("/").substr(-1)&&C.push("");var L,P=""===C[0]||C[0]&&"/"===C[0].charAt(0);R&&(n.hostname=n.host=P?"":C.length?C.shift():"",(L=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=L.shift(),n.host=n.hostname=L.shift()));return(S=S||n.host&&C.length)&&!P&&C.unshift(""),C.length?n.pathname=C.join("/"):(n.pathname=null,n.path=null),a.isNull(n.pathname)&&a.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},Url.prototype.parseHost=function(){var t=this.host,e=u.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":107,punycode:18,querystring:103}],107:[function(t,e,n){e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],108:[function(t,e,n){(function(t){function config(e){try{if(!t.localStorage)return!1}catch(t){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function deprecate(t,e){if(config("noDeprecation"))return t;var n=!1;return function deprecated(){if(!n){if(config("throwDeprecation"))throw new Error(e);config("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],109:[function(t,e,n){(function(e,i){ /** - * Wrapper for built-in http.js to emulate the browser XMLHttpRequest object. - * - * This can be used with JS designed for browsers to improve reuse of code and - * allow the use of existing libraries. - * - * Usage: include("XMLHttpRequest.js") and use XMLHttpRequest per W3C specs. - * - * @author Dan DeFelippi - * @contributor David Ellis - * @license MIT - */ -var a=t("url"),s=t("child_process").spawn,u=t("fs");n.XMLHttpRequest=function(){var n,c,f=this,h=t("http"),d=t("https"),p={},g=!1,v={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},b={},_={},w=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],M=["TRACE","TRACK","CONNECT"],E=!1,T=!1,S={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null,this.withCredentials=!1;this.open=function(t,e,n,i,a){if(this.abort(),T=!1,!function(t){return t&&-1===M.indexOf(t)}(t))throw new Error("SecurityError: Request method not allowed");p={method:t,url:e.toString(),async:"boolean"!=typeof n||n,user:i||null,password:a||null},setState(this.OPENED)},this.setDisableHeaderCheck=function(t){g=t},this.setRequestHeader=function(t,e){if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(function(t){return g||t&&-1===w.indexOf(t.toLowerCase())}(t)){if(E)throw new Error("INVALID_STATE_ERR: send flag is true");t=_[t.toLowerCase()]||t,_[t.toLowerCase()]=t,b[t]=b[t]?b[t]+", "+e:e}else console.warn('Refused to set unsafe header "'+t+'"')},this.getResponseHeader=function(t){return"string"==typeof t&&this.readyState>this.OPENED&&c&&c.headers&&c.headers[t.toLowerCase()]&&!T?c.headers[t.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState"+e[1]+"":t})).join("\n"),n=document.createElement("ul");return n.className="math",n.innerHTML=e,n}},{}],112:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){var e=document.createElement("div");return e.id="latex-macros",e.style.display="none",e.className="verbatim",e.innerHTML=a.default,e};var a=i(t("latex2js-macros"))},{"@babel/runtime/helpers/interopRequireDefault":6,"latex2js-macros":119}],113:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){var e=document.createElement("span");return e.className="math",e.innerHTML=t.lines.join("\n"),e}},{}],114:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){var e=document.createElement("span");return e.className="math nicebox",e.innerHTML=t.lines.join("\n"),e}},{}],115:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireWildcard"),a=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){var e=u.psgraph.getSize.call(t),n=("width: ".concat(e.width,"px; height: ").concat(e.height,"px;"),"".concat(e.width,"px")),i="".concat(e.height,"px"),a=document.createElement("div");a.className="pspicture",a.style.width=n,a.style.height=i;var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("width",n),f.setAttribute("height",i);var h=c.select(f);t.$el=a,u.psgraph.pspicture.call(t,h),a.appendChild(f);var d=t.env,p=t.plot,g=d.sliders;g&&g.length&&g.forEach((function(t){var e=t.latex,n=t.scalar,i=t.variable,c=t.value,f=t.min,g=t.max,v=document.createElement("label"),b=document.createTextNode(e),_=document.createElement("input");_.setAttribute("min",f*n),_.setAttribute("max",g*n),_.setAttribute("type","range"),_.setAttribute("value",c),v.appendChild(b),v.appendChild(_),a.appendChild(v),_.addEventListener("input",(function(t){!function onChange(t){var e=t.target.value/n;d.variables[i]=e,h.selectAll(".psplot").remove(),Object.entries(p).forEach((function(t){var e=(0,s.default)(t,2),n=e[0],i=e[1];n.match(/psplot/)&&i.forEach((function(t){var e=t.fn.call(t.env,t.match);u.psgraph[n]&&e&&h&&u.psgraph[n].call(e,h)}))}))}(t)}))}));return a};var s=a(t("@babel/runtime/helpers/slicedToArray")),u=t("latex2js-pstricks"),c=i(t("d3"))},{"@babel/runtime/helpers/interopRequireDefault":6,"@babel/runtime/helpers/interopRequireWildcard":7,"@babel/runtime/helpers/slicedToArray":10,d3:73,"latex2js-pstricks":121}],116:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){return document.createElement("input")}},{}],117:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){var e=document.createElement("pre");return e.className="verbatim",e.innerHTML=t.lines.join("\n"),e}},{}],118:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=render,Object.defineProperty(n,"pspicture",{enumerable:!0,get:function get(){return u.default}}),Object.defineProperty(n,"nicebox",{enumerable:!0,get:function get(){return c.default}}),Object.defineProperty(n,"enumerate",{enumerable:!0,get:function get(){return f.default}}),Object.defineProperty(n,"verbatim",{enumerable:!0,get:function get(){return h.default}}),Object.defineProperty(n,"math",{enumerable:!0,get:function get(){return d.default}}),Object.defineProperty(n,"macros",{enumerable:!0,get:function get(){return p.default}}),n.init=void 0;var a=i(t("latex2js")),s=t("latex2js-mathjax"),u=i(t("./components/pspicture")),c=i(t("./components/nicebox")),f=i(t("./components/enumerate")),h=i(t("./components/verbatim")),d=(i(t("./components/slider")),i(t("./components/math"))),p=i(t("./components/macros")),g={pspicture:u.default,nicebox:c.default,enumerate:f.default,verbatim:h.default,math:d.default,macros:p.default};function render(t,e){var n=function done(){var n=(new a.default).parse(t),i=document.createElement("div");i.className="latex-container",n&&n.forEach&&n.forEach((function(t){g.hasOwnProperty(t.type)&&i.appendChild(g[t.type](t))})),e(i)};if((0,s.getMathJax)())return n();(0,s.loadMathJax)(n)}n.init=function init(){(0,s.loadMathJax)(),document.querySelectorAll("la-tex:not([hydrated])").forEach((function(t){render(t.innerHTML,(function(e){t.shadowRoot.querySelector(".wrapper").innerHTML="",t.shadowRoot.querySelector(".wrapper").appendChild(e),t.hydrated=!0}))}))}},{"./components/enumerate":111,"./components/macros":112,"./components/math":113,"./components/nicebox":114,"./components/pspicture":115,"./components/slider":116,"./components/verbatim":117,"@babel/runtime/helpers/interopRequireDefault":6,latex2js:126,"latex2js-mathjax":120}],119:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=i(t("@babel/runtime/helpers/taggedTemplateLiteral"));function _templateObject_eafd9ee08fe411ef80f6e3fe6099465d(){var t=(0,a.default)(["\n $$\n % create the definition symbol\n def\bydef{stackrel{Delta}{=}}\n %defcircconv{otimes}\n defcircconv{circledast}\n\n \newcommand{qed}{mbox{ } Box}\n\n\n \newcommand{infint}{int_{-infty}^{infty}}\n\n % z transform\n \newcommand{ztp}{ ~~ mathop{mathcal{Z}}limits_{longleftrightarrow} ~~ }\n \newcommand{iztp}{ ~~ mathop{mathcal{Z}^{-1}}limits_{longleftrightarrow} ~~ }\n % fourier transform pair\n \newcommand{\ftp}{ ~~ mathop{mathcal{F}}limits_{longleftrightarrow} ~~ }\n \newcommand{iftp}{ ~~ mathop{mathcal{F}^{-1}}limits_{longleftrightarrow} ~~ }\n % laplace transform\n \newcommand{ltp}{ ~~ mathop{mathcal{L}}limits_{longleftrightarrow} ~~ }\n \newcommand{iltp}{ ~~ mathop{mathcal{L}^{-1}}limits_{longleftrightarrow} ~~ }\n\n \newcommand{\ftrans}[1]{ mathcal{F} left{#1\right} }\n \newcommand{iftrans}[1]{ mathcal{F}^{-1} left{#1\right} }\n \newcommand{ztrans}[1]{ mathcal{Z} left{#1\right} }\n \newcommand{iztrans}[1]{ mathcal{Z}^{-1} left{#1\right} }\n \newcommand{ltrans}[1]{ mathcal{L} left{#1\right} }\n \newcommand{iltrans}[1]{ mathcal{L}^{-1} left{#1\right} }\n\n\n % coordinate vector relative to a basis (linear algebra)\n \newcommand{cvrb}[2]{left[ \vec{#1} \right]_{#2} }\n % change of coordinate matrix (linear algebra)\n \newcommand{cocm}[2]{ mathop{P}limits_{#2 leftarrow #1} }\n % Transformed vector set\n \newcommand{\tset}[3]{{#1lr{\vec{#2}_1}, #1lr{\vec{#2}_2}, dots, #1lr{\vec{#2}_{#3}}}}\n % sum transformed vector set\n \newcommand{\tsetcsum}[4]{{#1}_1#2(\vec{#3}_1) + {#1}_2#2(\vec{#3}_2) + cdots + {#1}_{#4}#2(\vec{#3}_{#4})}\n \newcommand{\tsetcsumall}[4]{#2lr{{#1}_1\vec{#3}_1 + {#1}_2\vec{#3}_2 + cdots + {#1}_{#4}\vec{#3}_{#4}}}\n \newcommand{cvecsum}[3]{{#1}_1\vec{#2}_1 + {#1}_2\vec{#2}_2 + cdots + {#1}_{#3}\vec{#2}_{#3}}\n\n\n % function def\n \newcommand{\fndef}[3]{#1:#2 \to #3}\n % vector set\n \newcommand{\vset}[2]{{\vec{#1}_1, \vec{#1}_2, dots, \vec{#1}_{#2}}}\n % absolute value\n \newcommand{abs}[1]{left| #1 \right|}\n % vector norm\n \newcommand{\norm}[1]{left|left| #1 \right|\right|}\n % trans\n \newcommand{\trans}{mapsto}\n % evaluate integral\n \newcommand{evalint}[3]{left. #1 \right|_{#2}^{#3}}\n % slist\n \newcommand{slist}[2]{{#1}_{1},{#1}_{2},dots,{#1}_{#2}}\n\n % vectors\n \newcommand{\vc}[1]{\textbf{#1}}\n\n % real\n \newcommand{Real}[1]{{Re mit{e}left{{#1}\right}}}\n % imaginary\n \newcommand{Imag}[1]{{Im mit{m}left{{#1}\right}}}\n\n \newcommand{mcal}[1]{mathcal{#1}}\n \newcommand{\bb}[1]{mathbb{#1}}\n \newcommand{N}{mathbb{N}}\n \newcommand{Z}{mathbb{Z}}\n \newcommand{Q}{mathbb{Q}}\n \newcommand{R}{mathbb{R}}\n \newcommand{C}{mathbb{C}}\n \newcommand{I}{mathbb{I}}\n \newcommand{Th}[1]{mathopmathrm{Th(#1)}}\n \newcommand{intersect}{cap}\n \newcommand{\\union}{cup}\n \newcommand{intersectop}{\bigcap}\n \newcommand{\\unionop}{\bigcup}\n \newcommand{setdiff}{\backslash}\n \newcommand{iso}{cong}\n \newcommand{aut}[1]{mathop{mathrm{Aut(#1)}}}\n \newcommand{inn}[1]{mathop{mathrm{Inn(#1)}}}\n \newcommand{Ann}[1]{mathop{mathrm{Ann(#1)}}}\n \newcommand{dom}[1]{mathop{mathrm{dom} #1}}\n \newcommand{cod}[1]{mathop{mathrm{cod} #1}}\n \newcommand{id}{mathrm{id}}\n \newcommand{st}{ | }\n \newcommand{mbf}[1]{mathbf{#1}}\n \newcommand{enclose}[1]{leftlangle #1\right\rangle}\n \newcommand{lr}[1]{left( #1\right)}\n \newcommand{lrsq}[1]{left[ #1\right]}\n \newcommand{op}{mathrm{op}}\n \newcommand{dotarr}{dot{\rightarrow}}\n %Category Names:\n \newcommand{Grp}{mathbf{Grp}}\n \newcommand{Ab}{mathbf{Ab}}\n \newcommand{Set}{mathbf{Set}}\n \newcommand{Matr}{mathbf{Matr}}\n \newcommand{IntDom}{mathbf{IntDom}}\n \newcommand{Field}{mathbf{Field}}\n \newcommand{Vect}{mathbf{Vect}}\n\n \newcommand{\thm}[1]{\begin{theorem} #1 end{theorem}}\n \newcommand{clm}[1]{\begin{claim} #1 end{claim}}\n \newcommand{cor}[1]{\begin{corollary} #1 end{corollary}}\n \newcommand{ex}[1]{\begin{example} #1 end{example}}\n \newcommand{prf}[1]{\begin{proof} #1 end{proof}}\n \newcommand{prbm}[1]{\begin{problem} #1 end{problem}}\n \newcommand{soln}[1]{\begin{solution} #1 end{solution}}\n \newcommand{\rmk}[1]{\begin{remark} #1 end{remark}}\n \newcommand{defn}[1]{\begin{definition} #1 end{definition}}\n\n \newcommand{ifff}{LeftRightArrow}\n\n \x3c!-- For the set of reals and integers --\x3e\n \newcommand{\rr}{R}\n \newcommand{\reals}{R}\n \newcommand{ii}{Z}\n \newcommand{cc}{C}\n \newcommand{\nn}{N}\n \newcommand{\nats}{N}\n\n \x3c!-- For terms being indexed.\n Puts them in standard font face and creates an index entry.\n arg: The term being defined.\n \newcommand{pointer}[1]{#1index{#1}} --\x3e\n\n \x3c!-- For bold terms to be index, but defined elsewhere\n Puts them in bold face and creates an index entry.\n arg: The term being defined. --\x3e\n \newcommand{strong}[1]{\textbf{#1}}\n\n \x3c!-- For set names.\n Puts them in italics. In math mode, yields decent spacing.\n arg: The name of the set. --\x3e\n \newcommand{set}[1]{\textit{#1}}\n\n $$\n "],["\n $$\n % create the definition symbol\n \\def\\bydef{\\stackrel{\\Delta}{=}}\n %\\def\\circconv{\\otimes}\n \\def\\circconv{\\circledast}\n\n \\newcommand{\\qed}{\\mbox{ } \\Box}\n\n\n \\newcommand{\\infint}{\\int_{-\\infty}^{\\infty}}\n\n % z transform\n \\newcommand{\\ztp}{ ~~ \\mathop{\\mathcal{Z}}\\limits_{\\longleftrightarrow} ~~ }\n \\newcommand{\\iztp}{ ~~ \\mathop{\\mathcal{Z}^{-1}}\\limits_{\\longleftrightarrow} ~~ }\n % fourier transform pair\n \\newcommand{\\ftp}{ ~~ \\mathop{\\mathcal{F}}\\limits_{\\longleftrightarrow} ~~ }\n \\newcommand{\\iftp}{ ~~ \\mathop{\\mathcal{F}^{-1}}\\limits_{\\longleftrightarrow} ~~ }\n % laplace transform\n \\newcommand{\\ltp}{ ~~ \\mathop{\\mathcal{L}}\\limits_{\\longleftrightarrow} ~~ }\n \\newcommand{\\iltp}{ ~~ \\mathop{\\mathcal{L}^{-1}}\\limits_{\\longleftrightarrow} ~~ }\n\n \\newcommand{\\ftrans}[1]{ \\mathcal{F} \\left\\{#1\\right\\} }\n \\newcommand{\\iftrans}[1]{ \\mathcal{F}^{-1} \\left\\{#1\\right\\} }\n \\newcommand{\\ztrans}[1]{ \\mathcal{Z} \\left\\{#1\\right\\} }\n \\newcommand{\\iztrans}[1]{ \\mathcal{Z}^{-1} \\left\\{#1\\right\\} }\n \\newcommand{\\ltrans}[1]{ \\mathcal{L} \\left\\{#1\\right\\} }\n \\newcommand{\\iltrans}[1]{ \\mathcal{L}^{-1} \\left\\{#1\\right\\} }\n\n\n % coordinate vector relative to a basis (linear algebra)\n \\newcommand{\\cvrb}[2]{\\left[ \\vec{#1} \\right]_{#2} }\n % change of coordinate matrix (linear algebra)\n \\newcommand{\\cocm}[2]{ \\mathop{P}\\limits_{#2 \\leftarrow #1} }\n % Transformed vector set\n \\newcommand{\\tset}[3]{\\{#1\\lr{\\vec{#2}_1}, #1\\lr{\\vec{#2}_2}, \\dots, #1\\lr{\\vec{#2}_{#3}}\\}}\n % sum transformed vector set\n \\newcommand{\\tsetcsum}[4]{{#1}_1#2(\\vec{#3}_1) + {#1}_2#2(\\vec{#3}_2) + \\cdots + {#1}_{#4}#2(\\vec{#3}_{#4})}\n \\newcommand{\\tsetcsumall}[4]{#2\\lr{{#1}_1\\vec{#3}_1 + {#1}_2\\vec{#3}_2 + \\cdots + {#1}_{#4}\\vec{#3}_{#4}}}\n \\newcommand{\\cvecsum}[3]{{#1}_1\\vec{#2}_1 + {#1}_2\\vec{#2}_2 + \\cdots + {#1}_{#3}\\vec{#2}_{#3}}\n\n\n % function def\n \\newcommand{\\fndef}[3]{#1:#2 \\to #3}\n % vector set\n \\newcommand{\\vset}[2]{\\{\\vec{#1}_1, \\vec{#1}_2, \\dots, \\vec{#1}_{#2}\\}}\n % absolute value\n \\newcommand{\\abs}[1]{\\left| #1 \\right|}\n % vector norm\n \\newcommand{\\norm}[1]{\\left|\\left| #1 \\right|\\right|}\n % trans\n \\newcommand{\\trans}{\\mapsto}\n % evaluate integral\n \\newcommand{\\evalint}[3]{\\left. #1 \\right|_{#2}^{#3}}\n % slist\n \\newcommand{\\slist}[2]{{#1}_{1},{#1}_{2},\\dots,{#1}_{#2}}\n\n % vectors\n \\newcommand{\\vc}[1]{\\textbf{#1}}\n\n % real\n \\newcommand{\\Real}[1]{{\\Re \\mit{e}\\left\\{{#1}\\right\\}}}\n % imaginary\n \\newcommand{\\Imag}[1]{{\\Im \\mit{m}\\left\\{{#1}\\right\\}}}\n\n \\newcommand{\\mcal}[1]{\\mathcal{#1}}\n \\newcommand{\\bb}[1]{\\mathbb{#1}}\n \\newcommand{\\N}{\\mathbb{N}}\n \\newcommand{\\Z}{\\mathbb{Z}}\n \\newcommand{\\Q}{\\mathbb{Q}}\n \\newcommand{\\R}{\\mathbb{R}}\n \\newcommand{\\C}{\\mathbb{C}}\n \\newcommand{\\I}{\\mathbb{I}}\n \\newcommand{\\Th}[1]{\\mathop\\mathrm{Th(#1)}}\n \\newcommand{\\intersect}{\\cap}\n \\newcommand{\\\\union}{\\cup}\n \\newcommand{\\intersectop}{\\bigcap}\n \\newcommand{\\\\unionop}{\\bigcup}\n \\newcommand{\\setdiff}{\\backslash}\n \\newcommand{\\iso}{\\cong}\n \\newcommand{\\aut}[1]{\\mathop{\\mathrm{Aut(#1)}}}\n \\newcommand{\\inn}[1]{\\mathop{\\mathrm{Inn(#1)}}}\n \\newcommand{\\Ann}[1]{\\mathop{\\mathrm{Ann(#1)}}}\n \\newcommand{\\dom}[1]{\\mathop{\\mathrm{dom} #1}}\n \\newcommand{\\cod}[1]{\\mathop{\\mathrm{cod} #1}}\n \\newcommand{\\id}{\\mathrm{id}}\n \\newcommand{\\st}{\\ |\\ }\n \\newcommand{\\mbf}[1]{\\mathbf{#1}}\n \\newcommand{\\enclose}[1]{\\left\\langle #1\\right\\rangle}\n \\newcommand{\\lr}[1]{\\left( #1\\right)}\n \\newcommand{\\lrsq}[1]{\\left[ #1\\right]}\n \\newcommand{\\op}{\\mathrm{op}}\n \\newcommand{\\dotarr}{\\dot{\\rightarrow}}\n %Category Names:\n \\newcommand{\\Grp}{\\mathbf{Grp}}\n \\newcommand{\\Ab}{\\mathbf{Ab}}\n \\newcommand{\\Set}{\\mathbf{Set}}\n \\newcommand{\\Matr}{\\mathbf{Matr}}\n \\newcommand{\\IntDom}{\\mathbf{IntDom}}\n \\newcommand{\\Field}{\\mathbf{Field}}\n \\newcommand{\\Vect}{\\mathbf{Vect}}\n\n \\newcommand{\\thm}[1]{\\begin{theorem} #1 \\end{theorem}}\n \\newcommand{\\clm}[1]{\\begin{claim} #1 \\end{claim}}\n \\newcommand{\\cor}[1]{\\begin{corollary} #1 \\end{corollary}}\n \\newcommand{\\ex}[1]{\\begin{example} #1 \\end{example}}\n \\newcommand{\\prf}[1]{\\begin{proof} #1 \\end{proof}}\n \\newcommand{\\prbm}[1]{\\begin{problem} #1 \\end{problem}}\n \\newcommand{\\soln}[1]{\\begin{solution} #1 \\end{solution}}\n \\newcommand{\\rmk}[1]{\\begin{remark} #1 \\end{remark}}\n \\newcommand{\\defn}[1]{\\begin{definition} #1 \\end{definition}}\n\n \\newcommand{\\ifff}{\\LeftRightArrow}\n\n \x3c!-- For the set of reals and integers --\x3e\n \\newcommand{\\rr}{\\R}\n \\newcommand{\\reals}{\\R}\n \\newcommand{\\ii}{\\Z}\n \\newcommand{\\cc}{\\C}\n \\newcommand{\\nn}{\\N}\n \\newcommand{\\nats}{\\N}\n\n \x3c!-- For terms being indexed.\n Puts them in standard font face and creates an index entry.\n arg: The term being defined.\n \\newcommand{\\pointer}[1]{#1\\index{#1}} --\x3e\n\n \x3c!-- For bold terms to be index, but defined elsewhere\n Puts them in bold face and creates an index entry.\n arg: The term being defined. --\x3e\n \\newcommand{\\strong}[1]{\\textbf{#1}}\n\n \x3c!-- For set names.\n Puts them in italics. In math mode, yields decent spacing.\n arg: The name of the set. --\x3e\n \\newcommand{\\set}[1]{\\textit{#1}}\n\n $$\n "]);return _templateObject_eafd9ee08fe411ef80f6e3fe6099465d=function _templateObject_eafd9ee08fe411ef80f6e3fe6099465d(){return t},t}var s=String.raw(_templateObject_eafd9ee08fe411ef80f6e3fe6099465d());n.default=s},{"@babel/runtime/helpers/interopRequireDefault":6,"@babel/runtime/helpers/taggedTemplateLiteral":11}],120:[function(t,e,n){(function(e){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.loadMathJax=n.getMathJax=n.DEFAULT_OPTIONS=n.DEFAULT_SCRIPT=void 0;var a=i(t("load-script")),s=e.env.MATHJAX_CDN||"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/MathJax.js";n.DEFAULT_SCRIPT=s;var u={TeX:{extensions:["AMSmath.js","AMSsymbols.js"]},extensions:["tex2jax.js"],showProcessingMessages:!1,jax:["input/TeX","output/HTML-CSS"],messageStyle:"none",showMathMenu:!1,showMathMenuMSIE:!1,tex2jax:{processEnvironments:!0,inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],preview:"none",processEscapes:!0},"HTML-CSS":{linebreaks:{automatic:!0,width:"container"}}};n.DEFAULT_OPTIONS=u;n.getMathJax=function getMathJax(){return"undefined"==typeof MathJax?void 0:MathJax};n.loadMathJax=function loadMathJax(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u,i=function onLoad(){MathJax.Hub.Config(n),t()};if(!e)return i();(0,a.default)(e,i)}}).call(this,t("_process"))},{"@babel/runtime/helpers/interopRequireDefault":6,_process:100,"load-script":99}],121:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"pstricks",{enumerable:!0,get:function get(){return a.default}}),Object.defineProperty(n,"psgraph",{enumerable:!0,get:function get(){return s.default}}),n.default=void 0;var a=i(t("./lib/pstricks")),s=i(t("./lib/psgraph")),u={pstricks:a.default,psgraph:s.default};n.default=u},{"./lib/psgraph":122,"./lib/pstricks":123,"@babel/runtime/helpers/interopRequireDefault":6}],122:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireWildcard"),a=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var s=a(t("@babel/runtime/helpers/slicedToArray")),u=t("latex2js-utils"),c=i(t("d3"));function arrow(t,e,n,i){var a=Math.PI/6,s=n-t,u=i-e,c=Math.sqrt(s*s+u*u),f=Math.cos(a),h=Math.sin(a),d=8/c,p=n-(s*f-u*h)*d,g=i-(u*f+s*h)*d,v=[];return v.push("M"),v.push(n),v.push(i),v.push("L"),v.push(p),v.push(g),p=n-(s*(f=Math.cos(-a))-u*(h=Math.sin(-a)))*d,g=i-(u*f+s*h)*d,v.push(p),v.push(g),v.push("Z"),v.join(" ")}var f={getSize:function getSize(){this.env.scale=1;var t=Math.max(document.documentElement.clientWidth,window.innerWidth||0)-20;return t<=this.env.w*this.env.xunit&&(this.env.scale=t/this.env.w/this.env.xunit),{width:this.env.w*this.env.xunit,height:this.env.h*this.env.yunit}},psframe:function psframe(t){t.append("svg:line").attr("x1",this.x1).attr("y1",this.y1).attr("x2",this.x2).attr("y2",this.y1).style("stroke-width",2).style("stroke","rgb(0,0,0)").style("stroke-opacity",1),t.append("svg:line").attr("x1",this.x2).attr("y1",this.y1).attr("x2",this.x2).attr("y2",this.y2).style("stroke-width",2).style("stroke","rgb(0,0,0)").style("stroke-opacity",1),t.append("svg:line").attr("x1",this.x2).attr("y1",this.y2).attr("x2",this.x1).attr("y2",this.y2).style("stroke-width",2).style("stroke","rgb(0,0,0)").style("stroke-opacity",1),t.append("svg:line").attr("x1",this.x1).attr("y1",this.y2).attr("x2",this.x1).attr("y2",this.y1).style("stroke-width",2).style("stroke","rgb(0,0,0)").style("stroke-opacity",1)},pscircle:function pscircle(t){t.append("svg:circle").attr("cx",this.cx).attr("cy",this.cy).attr("r",this.r).style("stroke","black").style("fill","none").style("stroke-width",2).style("stroke-opacity",1)},psplot:function psplot(t){var e=[];e.push("M"),"solid"===this.fillstyle?(e.push(this.data[0]),e.push(u.Y.call(this.global,0))):(e.push(this.data[0]),e.push(this.data[1])),e.push("L"),this.data.forEach((function(t){e.push(t)})),"solid"===this.fillstyle&&(e.push(this.data[this.data.length-2]),e.push(u.Y.call(this.global,0)),e.push("Z")),t.append("svg:path").attr("d",e.join(" ")).attr("class","psplot").style("stroke-width",this.linewidth).style("stroke-opacity",1).style("fill","none"===this.fillstyle?"none":this.fillcolor).style("stroke",this.linecolor)},pspolygon:function pspolygon(t){var e=[];e.push("M"),e.push(this.data[0]),e.push(this.data[1]),e.push("L"),this.data.forEach((function(t){e.push(t)})),e.push("Z"),t.append("svg:path").attr("d",e.join(" ")).style("stroke-width",this.linewidth).style("stroke-opacity",1).style("fill","none"===this.fillstyle?"none":this.fillcolor).style("stroke","black")},psarc:function psarc(t){var e=[];e.push("M"),e.push(this.cx),e.push(this.cy),e.push("L"),e.push(this.A.x),e.push(this.A.y),e.push("A"),e.push(this.A.x),e.push(this.A.y),e.push(0),e.push(0),e.push(0),e.push(this.B.x),e.push(this.B.y),t.append("svg:path").attr("d",e.join(" ")).style("stroke-width",2).style("stroke-opacity",1).style("fill","blue").style("stroke","black")},psaxes:function psaxes(t){var e=[this.bottomLeft[0],this.topRight[0]],n=[this.bottomLeft[1],this.topRight[1]],i=this.origin;function line(e,n,i,a){t.append("svg:path").attr("d","M "+e+" "+n+" L "+i+" "+a).style("stroke-width",2).style("stroke","rgb(0,0,0)").style("stroke-opacity",1)}var a=function xticks(){for(var t=e[0];t<=e[1];t+=this.dx)line(t,i[1]-5,t,i[1]+5)},s=function yticks(){for(var t=n[0];t<=n[1];t+=this.dy)line(i[0]-5,t,i[0]+5,t)};line(e[0],i[1],e[1],i[1]),line(i[0],n[0],i[0],n[1]),this.ticks.match(/all/)?(a(),s()):this.ticks.match(/x/)?a():this.ticks.match(/y/)&&s(),this.arrows[0]&&(t.append("path").attr("d",arrow(e[1],i[1],e[0],i[1])).style("fill","black").style("stroke","black"),t.append("path").attr("d",arrow(i[0],n[1],i[0],n[0])).style("fill","black").style("stroke","black")),this.arrows[1]&&(t.append("path").attr("d",arrow(e[0],i[1],e[1],i[1])).style("fill","black").style("stroke","black"),t.append("path").attr("d",arrow(i[0],n[0],i[0],n[1])).style("fill","black").style("stroke","black"))},psline:function psline(t){var e=this.linewidth,n=this.linecolor;this.linestyle.match(/dotted/)?function dotted(i,a,s,u){t.append("svg:path").attr("d","M "+i+" "+a+" L "+s+" "+u).style("stroke-width",e).style("stroke",n).style("stroke-dasharray","9,5").style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2):this.linestyle.match(/dashed/)?function dashed(i,a,s,u){t.append("svg:path").attr("d","M "+i+" "+a+" L "+s+" "+u).style("stroke-width",e).style("stroke",n).style("stroke-dasharray","9,5").style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2):function solid(i,a,s,u){t.append("svg:path").attr("d","M "+i+" "+a+" L "+s+" "+u).style("stroke-width",e).style("stroke",n).style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2),this.dots[0]&&t.append("svg:circle").attr("cx",this.x1).attr("cy",this.y1).attr("r",3).style("stroke",this.linecolor).style("fill",this.linecolor).style("stroke-width",1).style("stroke-opacity",1),this.dots[1]&&t.append("svg:circle").attr("cx",this.x2).attr("cy",this.y2).attr("r",3).style("stroke",this.linecolor).style("fill",this.linecolor).style("stroke-width",1).style("stroke-opacity",1);var i=this.x1,a=this.y1,s=this.x2,u=this.y2;this.arrows[0]&&t.append("path").attr("d",arrow(s,u,i,a)).style("fill",this.linecolor).style("stroke",this.linecolor),this.arrows[1]&&t.append("path").attr("d",arrow(i,a,s,u)).style("fill",this.linecolor).style("stroke",this.linecolor)},userline:function userline(t){var e=this.linewidth,n=this.linecolor;this.linestyle.match(/dotted/)?function dotted(i,a,s,u){t.append("svg:path").attr("d","M "+i+" "+a+" L "+s+" "+u).attr("class","userline").style("stroke-width",e).style("stroke",n).style("stroke-dasharray","9,5").style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2):this.linestyle.match(/dashed/)?function dashed(i,a,s,u){t.append("svg:path").attr("d","M "+i+" "+a+" L "+s+" "+u).attr("class","userline").style("stroke-width",e).style("stroke",n).style("stroke-dasharray","9,5").style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2):function solid(i,a,s,u){t.append("svg:path").attr("class","userline").attr("d","M "+i+" "+a+" L "+s+" "+u).style("stroke-width",e).style("stroke",n).style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2),this.dots[0]&&t.append("svg:circle").attr("cx",this.x1).attr("cy",this.y1).attr("r",3).attr("class","userline").style("stroke",this.linecolor).style("fill",this.linecolor).style("stroke-width",1).style("stroke-opacity",1),this.dots[1]&&t.append("svg:circle").attr("cx",this.x2).attr("cy",this.y2).attr("r",3).attr("class","userline").style("stroke",this.linecolor).style("fill",this.linecolor).style("stroke-width",1).style("stroke-opacity",1);var i=this.x1,a=this.y1,s=this.x2,u=this.y2;this.arrows[0]&&t.append("path").attr("d",arrow(s,u,i,a)).attr("class","userline").style("fill",this.linecolor).style("stroke",this.linecolor),this.arrows[1]&&t.append("path").attr("d",arrow(i,a,s,u)).attr("class","userline").style("fill",this.linecolor).style("stroke",this.linecolor)},rput:function rput(t){var e=document.createElement("div"),n=this.x,i=this.y;e.innerHTML=this.text,e.className="math",e.style.visibility="hidden",e.style.position="absolute",e.style.top="".concat(i,"px"),e.style.left="".concat(n,"px"),t.appendChild(e);MathJax.Hub.Queue(["Typeset",MathJax.Hub,e],[function done(){var t=e.getBoundingClientRect(),a=t.width/2,s=t.height/2;e.style.visibility="visible",e.style.top="".concat(i-s,"px"),e.style.left="".concat(n-a,"px")}])},pspicture:function pspicture(t){var e=this,n=this.env,i=this.$el;Object.keys(this.plot).forEach((function(i){var a=e.plot[i];i.match(/rput/)||f.hasOwnProperty(i)&&a.forEach((function(e){e.data.global=n,f[i].call(e.data,t)}))})),t.on("touchmove",(function(){c.event.preventDefault(),userEvent(c.touches(this)[0])}),!1),t.on("mousemove",(function(){userEvent(c.mouse(this))}),!1);var a=this.plot;function userEvent(e){t.selectAll(".userline").remove(),t.selectAll(".psplot").remove();var i={};Object.entries(a||{}).forEach((function(t){var n=(0,s.default)(t,2),a=n[0],u=n[1];a.match(/uservariable/)&&u.forEach((function(t){t.env.userx=e[0],t.env.usery=e[1];var n=t.fn.call(t.env,t.match);i[t.data.name]=n.value}))})),Object.entries(a||{}).forEach((function(a){var u=(0,s.default)(a,2),c=u[0],h=u[1];c.match(/psplot/)&&h.forEach((function(e){Object.entries(i||{}).forEach((function(t){var n=(0,s.default)(t,2),i=n[0],a=n[1];e.env.variables[i]=a}));var a=e.fn.call(e.env,e.match);a.global={},Object.assign(a.global,n),f[c].call(a,t)})),c.match(/userline/)&&h.forEach((function(i){var a=i.fn.call(i.env,i.match);i.env.x2=e[0],i.env.y2=e[1],i.data.x2=i.env.x2,i.data.y2=i.env.y2,i.data.xExp2?(i.data.x2=a.userx2(e),i.data.x1=a.userx(e)):i.data.xExp&&(i.data.x2=a.userx(e)),i.data.yExp2?(i.data.y2=a.usery2(e),i.data.y1=a.usery(e)):i.data.yExp&&(i.data.y2=a.usery(e)),a.global={},Object.assign(a.global,n),Object.assign(a,i.data),f[c].call(a,t)}))}))}this.plot.rput.forEach((function(t){f.rput.call(t.data,i)}))}},h=f;n.default=h},{"@babel/runtime/helpers/interopRequireDefault":6,"@babel/runtime/helpers/interopRequireWildcard":7,"@babel/runtime/helpers/slicedToArray":10,d3:73,"latex2js-utils":125}],123:[function(require,module,exports){var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Functions=exports.Expressions=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")),_latex2jsUtils=require("latex2js-utils"),_latex2jsSettings=_interopRequireDefault(require("latex2js-settings")),Expressions={pspicture:/\\begin\{pspicture\}\(\s*(.*),(.*)\s*\)\(\s*(.*),(.*)\s*\)/,psframe:/\\psframe\(\s*(.*),(.*)\s*\)\(\s*(.*),(.*)\s*\)/,psplot:/\\psplot(\[[^\]]*\])?\{([^\}]*)\}\{([^\}]*)\}\{([^\}]*)\}/,psarc:new RegExp("\\\\psarc"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.type+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle),pscircle:/\\pscircle.*\(\s*(.*),(.*)\s*\)\{(.*)\}/,pspolygon:new RegExp("\\\\pspolygon"+_latex2jsUtils.RE.options+"(.*)"),psaxes:new RegExp("\\\\psaxes"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.type+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.coordsOpt+_latex2jsUtils.RE.coordsOpt),slider:new RegExp("\\\\slider"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle),psline:new RegExp("\\\\psline"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.type+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.coordsOpt),userline:new RegExp("\\\\userline"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.type+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.squiggleOpt+_latex2jsUtils.RE.squiggleOpt+_latex2jsUtils.RE.squiggleOpt+_latex2jsUtils.RE.squiggleOpt),uservariable:new RegExp("\\\\uservariable"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.squiggle),rput:/\\rput\((.*),(.*)\)\{(.*)\}/,psset:/\\psset\{(.*)\}/};exports.Expressions=Expressions;var Functions={slider:function slider(t){var e={scalar:1,min:Number(t[2]),max:Number(t[3]),variable:t[4],latex:t[5],value:Number(t[6])};return this.variables=this.variables||{},this.variables[e.variable]=e.value,this.sliders=this.sliders||[],this.sliders.push(e),t[1]&&Object.assign(e,(0,_latex2jsUtils.parseOptions)(t[1])),e},pspicture:function pspicture(t){var e={x0:Number(t[1]),y0:Number(t[2]),x1:Number(t[3]),y1:Number(t[4])},n={w:e.x1-e.x0,h:e.y1-e.y0};return Object.assign(this,e,n),Object.assign(e,n)},psframe:function psframe(t){return{x1:_latex2jsUtils.X.call(this,t[1]),y1:_latex2jsUtils.Y.call(this,t[2]),x2:_latex2jsUtils.X.call(this,t[3]),y2:_latex2jsUtils.Y.call(this,t[4])}},pscircle:function pscircle(t){return{cx:_latex2jsUtils.X.call(this,t[1]),cy:_latex2jsUtils.Y.call(this,t[2]),r:this.xunit*t[3]}},psaxes:function psaxes(t){var e={dx:1*this.xunit,dy:1*this.yunit,arrows:[0,0],dots:[0,0],ticks:"all"};if(t[1]){var n=(0,_latex2jsUtils.parseOptions)(t[1]);n.Dx&&(e.dx=Number(n.Dx)*this.xunit),n.Dy&&(e.dy=Number(n.Dy)*this.yunit)}var i=(0,_latex2jsUtils.parseArrows)(t[2]);return e.arrows=i.arrows,e.dots=i.dots,t[5]&&!t[8]?(e.origin=[_latex2jsUtils.X.call(this,t[3]),_latex2jsUtils.Y.call(this,t[4])],e.bottomLeft=[_latex2jsUtils.X.call(this,t[3]),_latex2jsUtils.Y.call(this,t[4])],e.topRight=[_latex2jsUtils.X.call(this,t[6]),_latex2jsUtils.Y.call(this,t[7])]):t[5]||t[8]?(e.origin=[_latex2jsUtils.X.call(this,t[3]),_latex2jsUtils.Y.call(this,t[4])],e.bottomLeft=[_latex2jsUtils.X.call(this,t[6]),_latex2jsUtils.Y.call(this,t[7])],e.topRight=[_latex2jsUtils.X.call(this,t[9]),_latex2jsUtils.Y.call(this,t[10])]):(e.origin=[_latex2jsUtils.X.call(this,0),_latex2jsUtils.Y.call(this,0)],e.bottomLeft=[_latex2jsUtils.X.call(this,0),_latex2jsUtils.Y.call(this,0)],e.topRight=[_latex2jsUtils.X.call(this,t[3]),_latex2jsUtils.Y.call(this,t[6])]),e},psplot:function psplot(m){var startX=_latex2jsUtils.evaluate.call(this,m[2]),endX=_latex2jsUtils.evaluate.call(this,m[3]),data=[],x,expression="";for(Object.entries(this.variables||{}).forEach((function(t){var e=(0,_slicedToArray2.default)(t,2),n=e[0],i=e[1];expression+="var "+n+" = "+i+";"})),expression+="with (Math){"+m[4]+"}",x=startX;x<=endX;x+=.005)data.push(_latex2jsUtils.X.call(this,x)),data.push(_latex2jsUtils.Y.call(this,eval(expression)));var obj={linecolor:"black",linestyle:"solid",fillstyle:"none",fillcolor:"none",linewidth:2};return m[1]&&Object.assign(obj,(0,_latex2jsUtils.parseOptions)(m[1])),obj.data=data,obj},pspolygon:function pspolygon(t){var e=this,n=t[2];if(n){var i=new RegExp(_latex2jsUtils.RE.coords,"g"),a=n.match(i),s=new RegExp(_latex2jsUtils.RE.coords),u=[];a.forEach((function(t){var n=s.exec(t);u.push(_latex2jsUtils.X.call(e,n[1])),u.push(_latex2jsUtils.Y.call(e,n[2]))}));var c={linecolor:"black",linestyle:"solid",fillstyle:"none",fillcolor:"black",linewidth:2,data:u};return t[1]&&Object.assign(c,(0,_latex2jsUtils.parseOptions)(t[1])),c}},psarc:function psarc(t){var e=(0,_latex2jsUtils.parseArrows)(t[2]),n={linecolor:"black",linestyle:"solid",fillstyle:"solid",fillcolor:"black",linewidth:2,arrows:e.arrows,dots:e.dots,cx:_latex2jsUtils.X.call(this,0),cy:_latex2jsUtils.Y.call(this,0)};return t[1]&&Object.assign(n,(0,_latex2jsUtils.parseOptions)(t[1])),t[3]&&(n.cx=_latex2jsUtils.X.call(this,t[3])),t[4]&&(n.cy=_latex2jsUtils.Y.call(this,t[4])),n.r=Number(t[5])*this.xunit,n.angleA=Number(t[6])*Math.PI/180,n.angleB=Number(t[7])*Math.PI/180,n.A={x:_latex2jsUtils.X.call(this,Number(t[5])*Math.cos(n.angleA)),y:_latex2jsUtils.Y.call(this,Number(t[5])*Math.sin(n.angleA))},n.B={x:_latex2jsUtils.X.call(this,Number(t[5])*Math.cos(n.angleB)),y:_latex2jsUtils.Y.call(this,Number(t[5])*Math.sin(n.angleB))},n},psline:function psline(t){var e=t[1],n=t[2],i=(0,_latex2jsUtils.parseArrows)(n),a={linecolor:"black",linestyle:"solid",fillstyle:"solid",fillcolor:"black",linewidth:2,arrows:i.arrows,dots:i.dots};return t[5]?(a.x1=_latex2jsUtils.X.call(this,t[3]),a.y1=_latex2jsUtils.Y.call(this,t[4]),a.x2=_latex2jsUtils.X.call(this,t[6]),a.y2=_latex2jsUtils.Y.call(this,t[7])):(a.x1=_latex2jsUtils.X.call(this,0),a.y1=_latex2jsUtils.Y.call(this,0),a.x2=_latex2jsUtils.X.call(this,t[3]),a.y2=_latex2jsUtils.Y.call(this,t[4])),e&&Object.assign(a,(0,_latex2jsUtils.parseOptions)(e)),"string"==typeof a.linewidth&&(a.linewidth=2),a},uservariable:function uservariable(m){var options=m[1],coords=[];this.userx&&this.usery?(coords.push(Number(this.userx)),coords.push(Number(this.usery))):(coords.push(_latex2jsUtils.X.call(this,m[3])),coords.push(_latex2jsUtils.Y.call(this,m[4])));var nx1=_latex2jsUtils.Xinv.call(this,coords[0]),ny1=_latex2jsUtils.Yinv.call(this,coords[1]),expx1="var x = "+nx1+";",expy1="var y = "+ny1+";",obj={name:m[2],x:_latex2jsUtils.X.call(this,m[3]),y:_latex2jsUtils.Y.call(this,m[4]),func:m[5],value:eval(expx1+expy1+m[5])};return obj},userline:function userline(m){var _this2=this,options=m[1],lineType=m[2],l=(0,_latex2jsUtils.parseArrows)(lineType),arrows=l.arrows,dots=l.dots,xExp=m[7],yExp=m[8];xExp&&(xExp="with (Math){"+xExp.replace(/^\{/,"").replace(/\}$/,"")+"}"),yExp&&(yExp="with (Math){"+yExp.replace(/^\{/,"").replace(/\}$/,"")+"}");var xExp2=m[9],yExp2=m[10];xExp2&&(xExp2="with (Math){"+xExp2.replace(/^\{/,"").replace(/\}$/,"")+"}"),yExp2&&(yExp2="with (Math){"+yExp2.replace(/^\{/,"").replace(/\}$/,"")+"}");var expression="";Object.entries(this.variables||{}).forEach((function(t){var e=(0,_slicedToArray2.default)(t,2),n=e[0],i=e[1];expression+="var "+n+" = "+i+";"}));var obj={x1:_latex2jsUtils.X.call(this,m[3]),y1:_latex2jsUtils.Y.call(this,m[4]),x2:_latex2jsUtils.X.call(this,m[5]),y2:_latex2jsUtils.Y.call(this,m[6]),xExp,yExp,xExp2,yExp2,userx:function userx(coords){var nx1=_latex2jsUtils.Xinv.call(_this2,coords[0]),ny1=_latex2jsUtils.Yinv.call(_this2,coords[1]),expx1="var x = "+nx1+";",expy1="var y = "+ny1+";";return _latex2jsUtils.X.call(_this2,eval(expression+expy1+expx1+xExp))},usery:function usery(coords){var nx2=_latex2jsUtils.Xinv.call(_this2,coords[0]),ny2=_latex2jsUtils.Yinv.call(_this2,coords[1]),expx2="var x = "+nx2+";",expy2="var y = "+ny2+";";return _latex2jsUtils.Y.call(_this2,eval(expression+expy2+expx2+yExp))},userx2:function userx2(coords){var nx3=_latex2jsUtils.Xinv.call(_this2,coords[0]),ny3=_latex2jsUtils.Yinv.call(_this2,coords[1]),expx3="var x = "+nx3+";",expy3="var y = "+ny3+";";return _latex2jsUtils.X.call(_this2,eval(expression+expy3+expx3+xExp2))},usery2:function usery2(coords){var nx4=_latex2jsUtils.Xinv.call(_this2,coords[0]),ny4=_latex2jsUtils.Yinv.call(_this2,coords[1]),expx4="var x = "+nx4+";",expy4="var y = "+ny4+";";return _latex2jsUtils.Y.call(_this2,eval(expression+expy4+expx4+yExp2))},linecolor:"black",linestyle:"solid",fillstyle:"solid",fillcolor:"black",linewidth:2,arrows,dots};return options&&Object.assign(obj,(0,_latex2jsUtils.parseOptions)(options)),"string"==typeof obj.linewidth&&(obj.linewidth=2),obj},rput:function rput(t){return{x:_latex2jsUtils.X.call(this,t[1]),y:_latex2jsUtils.Y.call(this,t[2]),text:t[3]}},psset:function psset(t){var e=t[1].split(",").map((function(t){return t.split("=")})),n={};return e.forEach((function(t){var e=t[0],i=t[1];Object.keys(_latex2jsSettings.default.Expressions).forEach((function(t){var a=_latex2jsSettings.default.Expressions[t];e.match(a)&&_latex2jsSettings.default.Functions[t](n,i)}))})),n}};exports.Functions=Functions;var _default={Expressions,Functions};exports.default=_default},{"@babel/runtime/helpers/interopRequireDefault":6,"@babel/runtime/helpers/slicedToArray":10,"latex2js-settings":124,"latex2js-utils":125}],124:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Functions=n.Expressions=void 0;var i=t("latex2js-utils"),a={fillcolor:/^fillcolor$/,fillstyle:/^fillstyle$/,linecolor:/^linecolor$/,linestyle:/^linestyle$/,unit:/^unit/,runit:/^runit/,xunit:/^xunit/,yunit:/^yunit/};n.Expressions=a;var s={fillcolor:function fillcolor(t,e){t.fillcolor=e},fillstyle:function fillstyle(t,e){t.fillstyle=e},linecolor:function linecolor(t,e){t.linecolor=e},linestyle:function linestyle(t,e){t.linestyle=e},unit:function unit(t,e){e=(0,i.convertUnits)(e),t.unit=e,t.runit=e,t.xunit=e,t.yunit=e},runit:function runit(t,e){e=(0,i.convertUnits)(e),t.runit=e},xunit:function xunit(t,e){e=(0,i.convertUnits)(e),t.xunit=e},yunit:function yunit(t,e){e=(0,i.convertUnits)(e),t.yunit=e}};n.Functions=s;var u={Expressions:a,Functions:s};n.default=u},{"latex2js-utils":125}],125:[function(require,module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.Yinv=exports.Y=exports.Xinv=exports.X=exports.evaluate=exports.parseArrows=exports.parseOptions=exports.RE=exports.convertUnits=exports.matchrepl=exports.simplerepl=void 0;var simplerepl=function simplerepl(t,e){return function(n,i){return i.replace(t,e)}};exports.simplerepl=simplerepl;var matchrepl=function matchrepl(t,e){return function(n,i){return Array.isArray(n)&&n.forEach((function(n){var a=n.match(t);i=i.replace(a.input,e(a))})),i}};exports.matchrepl=matchrepl;var convertUnits=function convertUnits(t){var e=null;return(e=t.match(/([^c]+)\s*cm/))?50*Number(e[1]):(e=t.match(/([^i]+)\s*in/))?20*Number(e[1]):(e=t.match(/(.*)/))?50*Number(e[1]):Number(t)};exports.convertUnits=convertUnits;var RE={options:"(\\[[^\\]]*\\])?",type:"(\\{[^\\}]*\\})?",squiggle:"\\{([^\\}]*)\\}",squiggleOpt:"(\\{[^\\}]*\\})?",coordsOpt:"(\\(\\s*([^\\)]*),([^\\)]*)\\s*\\))?",coords:"\\(\\s*([^\\)]*),([^\\)]*)\\s*\\)"};exports.RE=RE;var parseOptions=function parseOptions(t){var e=t.replace(/[\]\[]/g,"").split(","),n={};return e.forEach((function(t){var e=t.split("=");2==e.length&&(n[e[0].trim()]=e[1].trim())})),n};exports.parseOptions=parseOptions;var parseArrows=function parseArrows(t){var e=[0,0],n=[0,0];if(t){var i=t.match(/\{([^\-]*)?\-([^\-]*)?\}/);i&&(i[1]&&(i[1].match(/\*/)?n[0]=1:i[1].match(//)&&(e[1]=1)))}return{arrows:e,dots:n}};exports.parseArrows=parseArrows;var evaluate=function evaluate(exp){var _this=this,num=Number(exp);if(isNaN(num)){var expression="";return this.variables=this.variables||{},Object.keys(this.variables).map((function(t){var e=_this.variables[t];expression+="var "+t+" = "+e+";"})),expression+="with (Math){"+exp+"}",eval(expression)}return num};exports.evaluate=evaluate;var X=function X(t){return(this.w-(this.x1-Number(t)))*this.xunit};exports.X=X;var Xinv=function Xinv(t){return Number(t)/this.xunit-this.w+this.x1};exports.Xinv=Xinv;var Y=function Y(t){return(this.y1-Number(t))*this.yunit};exports.Y=Y;var Yinv=function Yinv(t){return this.y1-Number(t)/this.yunit};exports.Yinv=Yinv},{}],126:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=i(t("@babel/runtime/helpers/classCallCheck")),s=i(t("@babel/runtime/helpers/createClass")),u=i(t("./lib/text")),c=i(t("./lib/headers")),f=t("latex2js-pstricks"),h=i(t("./lib/environments")),d=i(t("./lib/ignore")),p=i(t("./lib/parser")),g=function(){function LaTeX2HTML5(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.default,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.default,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.default,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.default,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.pstricks,g=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};(0,a.default)(this,LaTeX2HTML5),this.Text=e,this.Headers=n,this.Environments=i,this.Ignore=s,this.PSTricks=p,this.Views=g,this.Delimiters={},i.forEach((function(e){t.addEnvironment(e)}))}return(0,s.default)(LaTeX2HTML5,[{key:"addEnvironment",value:function addEnvironment(t){var e={begin:new RegExp("\\\\begin\\{"+t+"\\}"),end:new RegExp("\\\\end\\{"+t+"\\}")};this.Delimiters[t]=e}},{key:"addView",value:function addView(t,e){this.addEnvironment(t)}},{key:"addText",value:function addText(t,e,n){this.Text.Expressions[t]=e,this.Text.Functions[t]=n}},{key:"addHeaders",value:function addHeaders(t,e,n){var i={},a=t+"begin",s=t+"end";i[a]=new RegExp("\\\\begin\\{"+t+"\\}"),i[s]=new RegExp("\\\\end\\{"+t+"\\}"),Object.assign(this.Headers.Expressions,i);var u={};u[a]=function(){return e||""},u[s]=function(){return n||""},Object.assign(this.Headers.Functions,u)}},{key:"getParser",value:function getParser(){return new p.default(this)}},{key:"parse",value:function parse(t){var e=new p.default(this).parse(t);return e.forEach((function(t){if(!t.hasOwnProperty("type"))throw new Error("no type!")})),e}}]),LaTeX2HTML5}();n.default=g},{"./lib/environments":127,"./lib/headers":128,"./lib/ignore":129,"./lib/parser":130,"./lib/text":131,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":4,"@babel/runtime/helpers/interopRequireDefault":6,"latex2js-pstricks":121}],127:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=["pspicture","verbatim","enumerate","print","nicebox"]},{}],128:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Functions=n.Expressions=void 0;var i={bq:/\\begin\{quotation\}/,claim:/\\begin\{claim\}/,corollary:/\\begin\{corollary\}/,definition:/\\begin\{definition\}/,endclaim:/\\end\{claim\}/,endcorallary:/\\end\{corallary\}/,enddefinition:/\\end\{definition\}/,endexample:/\\end\{example\}/,endproblem:/\\end\{problem\}/,endsolution:/\\end\{solution\}/,endtheorem:/\\end\{theorem\}/,eq:/\\end\{quotation\}/,example:/\\begin\{example\}/,problem:/\\begin\{problem\}/,proof:/\\begin\{proof\}/,qed:/\\end\{proof\}/,solution:/\\begin\{solution\}/,theorem:/\\begin\{theorem\}/};n.Expressions=i;var a={bq:function bq(){return'

    '},claim:function claim(){return"

    Claim

    "},corollary:function corollary(){return"

    Corollary

    "},definition:function definition(){return"

    Definition

    "},endclaim:function endclaim(){return""},endcorollary:function endcorollary(){return""},enddefinition:function enddefinition(){return""},endexample:function endexample(){return""},endproblem:function endproblem(){return""},endsolution:function endsolution(){return""},endtheorem:function endtheorem(){return""},eq:function eq(){return"

    "},example:function example(){return"

    Example

    "},problem:function problem(){return"

    Problem

    "},proof:function proof(){return"

    Proof

    "},qed:function qed(){return"$\\qed$"},solution:function solution(){return"

    Solution

    "},theorem:function theorem(){return"

    Theorem

    "}};n.Functions=a;var s={Expressions:i,Functions:a};n.default=s},{}],129:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=[/^\%/,/\\begin\{document\}/,/\\end\{document\}/,/\\begin\{interactive\}/,/\\end\{interactive\}/,/\\usepackage/,/\\documentclass/,/\\tableofcontents/,/\\author/,/\\date/,/\\maketitle/,/\\title/,/\\pagestyle/,/\\smallskip/,/\\medskip/,/\\bigskip/,/\\nobreak/,/\\begin\{center\}/,/\\end\{center\}/]},{}],130:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=i(t("@babel/runtime/helpers/slicedToArray")),s=i(t("@babel/runtime/helpers/defineProperty"));function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Parser(t){this.Ignore=t.Ignore,this.Delimiters=t.Delimiters,this.Text=t.Text,this.PSTricks=t.PSTricks,this.Headers=t.Headers,this.objects=[],this.environment=null,this.settings=this.PSTricks.Functions.psset.call(this,["","units=1cm,linecolor=black,linestyle=solid,fillstyle=none"])}Parser.prototype={parse:function parse(t){var e=this;if(!t)return{};var n=t.split("\n");return this.parseEnvText(n),this.parseEnv(n),this.objects.forEach((function(t){t.type.match(/pspicture/)&&(t.plot=e.parsePSTricks(t.lines,t.env))})),this.objects},newEnvironment:function newEnvironment(t){this.environment&&this.environment.lines.length&&(this.environment.settings=function _objectSpread(t){for(var e=1;e"))}))},parsePSExpression:function parsePSExpression(t,e,n,i,a){var s=t.match(e);return!!s&&(n[i].push({data:this.PSTricks.Functions[i].call(a,s),env:a,match:s,fn:this.PSTricks.Functions[i]}),!0)},parsePSVariables:function parsePSVariables(t,e,n,i,a){var s=t.match(e);if(s&&i.match(/uservariable/)){var u=this.PSTricks.Functions[i].call(a,s);a.variables=a.variables||{},a.variables[u.name]=u.value}},parsePSTricks:function parsePSTricks(t,e){var n=this,i={},s=Object.entries(this.PSTricks.Expressions);return s.forEach((function(t){var e=(0,a.default)(t,2),n=e[0];e[1];i[n]=[]})),t.forEach((function(t){s.forEach((function(s){var u=(0,a.default)(s,2),c=u[0],f=u[1];n.parsePSVariables(t,f,i,c,e),n.parsePSExpression(t,f,i,c,e)}))})),i},parseTextExpression:function parseTextExpression(t,e,n,i){var a=t.match(e);return a?this.Text.Functions[n].call(this,a,i):i},parseHeadersExpression:function parseHeadersExpression(t,e,n,i){return t.match(e)?this.Headers.Functions[n].call(this):i},parseText:function parseText(t){var e=this,n=t;return Object.entries(this.Text.Expressions).forEach((function(i){var s=(0,a.default)(i,2),u=s[0],c=s[1];n=e.parseTextExpression(t,c,u,n)})),Object.entries(this.Headers.Expressions).forEach((function(i){var s=(0,a.default)(i,2),u=s[0],c=s[1];n=e.parseHeadersExpression(t,c,u,n)})),n}};var u=Parser;n.default=u},{"@babel/runtime/helpers/defineProperty":5,"@babel/runtime/helpers/interopRequireDefault":6,"@babel/runtime/helpers/slicedToArray":10}],131:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Functions=n.Expressions=void 0;var i=t("latex2js-utils"),a={emph:/\\emph\{[^}]*\}/g,bf:/\{*\\bf [^}]*\}/g,rm:/\{*\\rm [^}]*\}/g,sl:/\{*\\sl [^}]*\}/g,it:/\{*\\it [^}]*\}/g,tt:/\{*\\tt [^}]*\}/g,mdash:/---/g,ndash:/--/g,openq:/``/g,closeq:/''/g,TeX:/\\TeX\\|\\TeX/g,LaTeX:/\\LaTeX\\|\\LaTeX/g,vspace:/\\vspace/g,cite:/\\cite\[\d+\]\{[^}]*\}/g,href:/\\href\{[^}]*\}\{[^}]*\}/g,img:/\\img\{[^}]*\}/g,set:/\\set\{[^}]*\}/g,youtube:/\\youtube\{[^}]*\}/g,euler:/Euler\^/g};n.Expressions=a;var s={cite:function cite(t,e){return t.forEach((function(t){var n=t.match(/\\cite\[(\d+)\]\{([^}]*)\}/),i=location.pathname.match(/\/books\/(\d+)\//),a=0;i&&(a=i[1]),e=e.replace(n.input,'[p'+n[1]+"]")})),e},img:(0,i.matchrepl)(/\\img\{([^}]*)\}/,(function(t){return'
    '})),youtube:(0,i.matchrepl)(/\\youtube\{([^}]*)\}/,(function(t){return'
    '})),href:(0,i.matchrepl)(/\\href\{([^}]*)\}\{([^}]*)\}/,(function(t){return''+t[2]+""})),set:(0,i.matchrepl)(/\\set\{([^}]*)\}/,(function(t){return""+t[1]+""})),euler:(0,i.simplerepl)(/Euler\^/,"exp"),emph:(0,i.matchrepl)(/\{([^}]*)\}/,(function(t){return""+t[1]+""})),bf:(0,i.matchrepl)(/\{*\\bf ([^}]*)\}/,(function(t){return""+t[1]+""})),rm:(0,i.matchrepl)(/\{*\\rm ([^}]*)\}/,(function(t){return''+t[1]+""})),sl:(0,i.matchrepl)(/\{*\\sl ([^}]*)\}/,(function(t){return""+t[1]+""})),it:(0,i.matchrepl)(/\{*\\it ([^}]*)\}/,(function(t){return""+t[1]+""})),tt:(0,i.matchrepl)(/\{*\\tt ([^}]*)\}/,(function(t){return''+t[1]+""})),ndash:(0,i.simplerepl)(/--/g,"–"),mdash:(0,i.simplerepl)(/---/g,"—"),openq:(0,i.simplerepl)(/``/g,"“"),closeq:(0,i.simplerepl)(/''/g,"”"),vspace:(0,i.simplerepl)(/\\vspace/g,"
    "),TeX:(0,i.simplerepl)(/\\TeX\\|\\TeX/g,"$\\TeX$"),LaTeX:(0,i.simplerepl)(/\\LaTeX\\|\\LaTeX/g,"$\\LaTeX$")};n.Functions=s;var u={Expressions:a,Functions:s};n.default=u},{"latex2js-utils":125}]},{},[118])(118)})); \ No newline at end of file + * Wrapper for built-in http.js to emulate the browser XMLHttpRequest object. + * + * This can be used with JS designed for browsers to improve reuse of code and + * allow the use of existing libraries. + * + * Usage: include("XMLHttpRequest.js") and use XMLHttpRequest per W3C specs. + * + * @author Dan DeFelippi + * @contributor David Ellis + * @license MIT + */ +var a=t("url"),s=t("child_process").spawn,u=t("fs");n.XMLHttpRequest=function(){var n,c,f=this,h=t("http"),d=t("https"),p={},g=!1,v={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},b={},_={},w=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],M=["TRACE","TRACK","CONNECT"],E=!1,T=!1,S={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null,this.withCredentials=!1;this.open=function(t,e,n,i,a){if(this.abort(),T=!1,!function(t){return t&&-1===M.indexOf(t)}(t))throw new Error("SecurityError: Request method not allowed");p={method:t,url:e.toString(),async:"boolean"!=typeof n||n,user:i||null,password:a||null},setState(this.OPENED)},this.setDisableHeaderCheck=function(t){g=t},this.setRequestHeader=function(t,e){if(this.readyState!==this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(function(t){return g||t&&-1===w.indexOf(t.toLowerCase())}(t)){if(E)throw new Error("INVALID_STATE_ERR: send flag is true");t=_[t.toLowerCase()]||t,_[t.toLowerCase()]=t,b[t]=b[t]?b[t]+", "+e:e}else console.warn('Refused to set unsafe header "'+t+'"')},this.getResponseHeader=function(t){return"string"==typeof t&&this.readyState>this.OPENED&&c&&c.headers&&c.headers[t.toLowerCase()]&&!T?c.headers[t.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState"+e[1]+"":t})).join("\n"),n=document.createElement("ul");return n.className="math",n.innerHTML=e,n}},{}],112:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){var e=document.createElement("div");return e.id="latex-macros",e.style.display="none",e.className="verbatim",e.innerHTML=a.default,e};var a=i(t("latex2js-macros"))},{"@babel/runtime/helpers/interopRequireDefault":6,"latex2js-macros":119}],113:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){var e=document.createElement("span");return e.className="math",e.innerHTML=t.lines.join("\n"),e}},{}],114:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){var e=document.createElement("span");return e.className="math nicebox",e.innerHTML=t.lines.join("\n"),e}},{}],115:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireWildcard"),a=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){var e=u.psgraph.getSize.call(t),n=("width: ".concat(e.width,"px; height: ").concat(e.height,"px;"),"".concat(e.width,"px")),i="".concat(e.height,"px"),a=document.createElement("div");a.className="pspicture",a.style.width=n,a.style.height=i;var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("width",n),f.setAttribute("height",i);var h=c.select(f);t.$el=a,u.psgraph.pspicture.call(t,h),a.appendChild(f);var d=t.env,p=t.plot,g=d.sliders;g&&g.length&&g.forEach((function(t){var e=t.latex,n=t.scalar,i=t.variable,c=t.value,f=t.min,g=t.max,v=document.createElement("label"),b=document.createTextNode(e),_=document.createElement("input");_.setAttribute("min",f*n),_.setAttribute("max",g*n),_.setAttribute("type","range"),_.setAttribute("value",c),v.appendChild(b),v.appendChild(_),a.appendChild(v),_.addEventListener("input",(function(t){!function onChange(t){var e=t.target.value/n;d.variables[i]=e,h.selectAll(".psplot").remove(),Object.entries(p).forEach((function(t){var e=(0,s.default)(t,2),n=e[0],i=e[1];n.match(/psplot/)&&i.forEach((function(t){var e=t.fn.call(t.env,t.match);u.psgraph[n]&&e&&h&&u.psgraph[n].call(e,h)}))}))}(t)}))}));return a};var s=a(t("@babel/runtime/helpers/slicedToArray")),u=t("latex2js-pstricks"),c=i(t("d3"))},{"@babel/runtime/helpers/interopRequireDefault":6,"@babel/runtime/helpers/interopRequireWildcard":7,"@babel/runtime/helpers/slicedToArray":10,d3:73,"latex2js-pstricks":121}],116:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){return document.createElement("input")}},{}],117:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=function render(t){var e=document.createElement("pre");return e.className="verbatim",e.innerHTML=t.lines.join("\n"),e}},{}],118:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=render,Object.defineProperty(n,"pspicture",{enumerable:!0,get:function get(){return u.default}}),Object.defineProperty(n,"nicebox",{enumerable:!0,get:function get(){return c.default}}),Object.defineProperty(n,"enumerate",{enumerable:!0,get:function get(){return f.default}}),Object.defineProperty(n,"verbatim",{enumerable:!0,get:function get(){return h.default}}),Object.defineProperty(n,"math",{enumerable:!0,get:function get(){return d.default}}),Object.defineProperty(n,"macros",{enumerable:!0,get:function get(){return p.default}}),n.init=void 0;var a=i(t("latex2js")),s=t("latex2js-mathjax"),u=i(t("./components/pspicture")),c=i(t("./components/nicebox")),f=i(t("./components/enumerate")),h=i(t("./components/verbatim")),d=(i(t("./components/slider")),i(t("./components/math"))),p=i(t("./components/macros")),g={pspicture:u.default,nicebox:c.default,enumerate:f.default,verbatim:h.default,math:d.default,macros:p.default};function render(t,e){var n=function done(){var n=(new a.default).parse(t),i=document.createElement("div");i.className="latex-container",n&&n.forEach&&n.forEach((function(t){g.hasOwnProperty(t.type)&&i.appendChild(g[t.type](t))})),e(i)};if((0,s.getMathJax)())return n();(0,s.loadMathJax)(n)}n.init=function init(){(0,s.loadMathJax)(),document.querySelectorAll("la-tex:not([hydrated])").forEach((function(t){render(t.innerHTML,(function(e){t.shadowRoot.querySelector(".wrapper").innerHTML="",t.shadowRoot.querySelector(".wrapper").appendChild(e),t.hydrated=!0}))}))}},{"./components/enumerate":111,"./components/macros":112,"./components/math":113,"./components/nicebox":114,"./components/pspicture":115,"./components/slider":116,"./components/verbatim":117,"@babel/runtime/helpers/interopRequireDefault":6,latex2js:126,"latex2js-mathjax":120}],119:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=i(t("@babel/runtime/helpers/taggedTemplateLiteral"));function _templateObject_604a2740ac2311efacc63b09623ae52a(){var t=(0,a.default)(["\n $$\n % create the definition symbol\n def\bydef{stackrel{Delta}{=}}\n %defcircconv{otimes}\n defcircconv{circledast}\n\n \newcommand{qed}{mbox{ } Box}\n\n\n \newcommand{infint}{int_{-infty}^{infty}}\n\n % z transform\n \newcommand{ztp}{ ~~ mathop{mathcal{Z}}limits_{longleftrightarrow} ~~ }\n \newcommand{iztp}{ ~~ mathop{mathcal{Z}^{-1}}limits_{longleftrightarrow} ~~ }\n % fourier transform pair\n \newcommand{\ftp}{ ~~ mathop{mathcal{F}}limits_{longleftrightarrow} ~~ }\n \newcommand{iftp}{ ~~ mathop{mathcal{F}^{-1}}limits_{longleftrightarrow} ~~ }\n % laplace transform\n \newcommand{ltp}{ ~~ mathop{mathcal{L}}limits_{longleftrightarrow} ~~ }\n \newcommand{iltp}{ ~~ mathop{mathcal{L}^{-1}}limits_{longleftrightarrow} ~~ }\n\n \newcommand{\ftrans}[1]{ mathcal{F} left{#1\right} }\n \newcommand{iftrans}[1]{ mathcal{F}^{-1} left{#1\right} }\n \newcommand{ztrans}[1]{ mathcal{Z} left{#1\right} }\n \newcommand{iztrans}[1]{ mathcal{Z}^{-1} left{#1\right} }\n \newcommand{ltrans}[1]{ mathcal{L} left{#1\right} }\n \newcommand{iltrans}[1]{ mathcal{L}^{-1} left{#1\right} }\n\n\n % coordinate vector relative to a basis (linear algebra)\n \newcommand{cvrb}[2]{left[ \vec{#1} \right]_{#2} }\n % change of coordinate matrix (linear algebra)\n \newcommand{cocm}[2]{ mathop{P}limits_{#2 leftarrow #1} }\n % Transformed vector set\n \newcommand{\tset}[3]{{#1lr{\vec{#2}_1}, #1lr{\vec{#2}_2}, dots, #1lr{\vec{#2}_{#3}}}}\n % sum transformed vector set\n \newcommand{\tsetcsum}[4]{{#1}_1#2(\vec{#3}_1) + {#1}_2#2(\vec{#3}_2) + cdots + {#1}_{#4}#2(\vec{#3}_{#4})}\n \newcommand{\tsetcsumall}[4]{#2lr{{#1}_1\vec{#3}_1 + {#1}_2\vec{#3}_2 + cdots + {#1}_{#4}\vec{#3}_{#4}}}\n \newcommand{cvecsum}[3]{{#1}_1\vec{#2}_1 + {#1}_2\vec{#2}_2 + cdots + {#1}_{#3}\vec{#2}_{#3}}\n\n\n % function def\n \newcommand{\fndef}[3]{#1:#2 \to #3}\n % vector set\n \newcommand{\vset}[2]{{\vec{#1}_1, \vec{#1}_2, dots, \vec{#1}_{#2}}}\n % absolute value\n \newcommand{abs}[1]{left| #1 \right|}\n % vector norm\n \newcommand{\norm}[1]{left|left| #1 \right|\right|}\n % trans\n \newcommand{\trans}{mapsto}\n % evaluate integral\n \newcommand{evalint}[3]{left. #1 \right|_{#2}^{#3}}\n % slist\n \newcommand{slist}[2]{{#1}_{1},{#1}_{2},dots,{#1}_{#2}}\n\n % vectors\n \newcommand{\vc}[1]{\textbf{#1}}\n\n % real\n \newcommand{Real}[1]{{Re mit{e}left{{#1}\right}}}\n % imaginary\n \newcommand{Imag}[1]{{Im mit{m}left{{#1}\right}}}\n\n \newcommand{mcal}[1]{mathcal{#1}}\n \newcommand{\bb}[1]{mathbb{#1}}\n \newcommand{N}{mathbb{N}}\n \newcommand{Z}{mathbb{Z}}\n \newcommand{Q}{mathbb{Q}}\n \newcommand{R}{mathbb{R}}\n \newcommand{C}{mathbb{C}}\n \newcommand{I}{mathbb{I}}\n \newcommand{Th}[1]{mathopmathrm{Th(#1)}}\n \newcommand{intersect}{cap}\n \newcommand{\\union}{cup}\n \newcommand{intersectop}{\bigcap}\n \newcommand{\\unionop}{\bigcup}\n \newcommand{setdiff}{\backslash}\n \newcommand{iso}{cong}\n \newcommand{aut}[1]{mathop{mathrm{Aut(#1)}}}\n \newcommand{inn}[1]{mathop{mathrm{Inn(#1)}}}\n \newcommand{Ann}[1]{mathop{mathrm{Ann(#1)}}}\n \newcommand{dom}[1]{mathop{mathrm{dom} #1}}\n \newcommand{cod}[1]{mathop{mathrm{cod} #1}}\n \newcommand{id}{mathrm{id}}\n \newcommand{st}{ | }\n \newcommand{mbf}[1]{mathbf{#1}}\n \newcommand{enclose}[1]{leftlangle #1\right\rangle}\n \newcommand{lr}[1]{left( #1\right)}\n \newcommand{lrsq}[1]{left[ #1\right]}\n \newcommand{op}{mathrm{op}}\n \newcommand{dotarr}{dot{\rightarrow}}\n %Category Names:\n \newcommand{Grp}{mathbf{Grp}}\n \newcommand{Ab}{mathbf{Ab}}\n \newcommand{Set}{mathbf{Set}}\n \newcommand{Matr}{mathbf{Matr}}\n \newcommand{IntDom}{mathbf{IntDom}}\n \newcommand{Field}{mathbf{Field}}\n \newcommand{Vect}{mathbf{Vect}}\n\n \newcommand{\thm}[1]{\begin{theorem} #1 end{theorem}}\n \newcommand{clm}[1]{\begin{claim} #1 end{claim}}\n \newcommand{cor}[1]{\begin{corollary} #1 end{corollary}}\n \newcommand{ex}[1]{\begin{example} #1 end{example}}\n \newcommand{prf}[1]{\begin{proof} #1 end{proof}}\n \newcommand{prbm}[1]{\begin{problem} #1 end{problem}}\n \newcommand{soln}[1]{\begin{solution} #1 end{solution}}\n \newcommand{\rmk}[1]{\begin{remark} #1 end{remark}}\n \newcommand{defn}[1]{\begin{definition} #1 end{definition}}\n\n \newcommand{ifff}{LeftRightArrow}\n\n \x3c!-- For the set of reals and integers --\x3e\n \newcommand{\rr}{R}\n \newcommand{\reals}{R}\n \newcommand{ii}{Z}\n \newcommand{cc}{C}\n \newcommand{\nn}{N}\n \newcommand{\nats}{N}\n\n \x3c!-- For terms being indexed.\n Puts them in standard font face and creates an index entry.\n arg: The term being defined.\n \newcommand{pointer}[1]{#1index{#1}} --\x3e\n\n \x3c!-- For bold terms to be index, but defined elsewhere\n Puts them in bold face and creates an index entry.\n arg: The term being defined. --\x3e\n \newcommand{strong}[1]{\textbf{#1}}\n\n \x3c!-- For set names.\n Puts them in italics. In math mode, yields decent spacing.\n arg: The name of the set. --\x3e\n \newcommand{set}[1]{\textit{#1}}\n\n $$\n "],["\n $$\n % create the definition symbol\n \\def\\bydef{\\stackrel{\\Delta}{=}}\n %\\def\\circconv{\\otimes}\n \\def\\circconv{\\circledast}\n\n \\newcommand{\\qed}{\\mbox{ } \\Box}\n\n\n \\newcommand{\\infint}{\\int_{-\\infty}^{\\infty}}\n\n % z transform\n \\newcommand{\\ztp}{ ~~ \\mathop{\\mathcal{Z}}\\limits_{\\longleftrightarrow} ~~ }\n \\newcommand{\\iztp}{ ~~ \\mathop{\\mathcal{Z}^{-1}}\\limits_{\\longleftrightarrow} ~~ }\n % fourier transform pair\n \\newcommand{\\ftp}{ ~~ \\mathop{\\mathcal{F}}\\limits_{\\longleftrightarrow} ~~ }\n \\newcommand{\\iftp}{ ~~ \\mathop{\\mathcal{F}^{-1}}\\limits_{\\longleftrightarrow} ~~ }\n % laplace transform\n \\newcommand{\\ltp}{ ~~ \\mathop{\\mathcal{L}}\\limits_{\\longleftrightarrow} ~~ }\n \\newcommand{\\iltp}{ ~~ \\mathop{\\mathcal{L}^{-1}}\\limits_{\\longleftrightarrow} ~~ }\n\n \\newcommand{\\ftrans}[1]{ \\mathcal{F} \\left\\{#1\\right\\} }\n \\newcommand{\\iftrans}[1]{ \\mathcal{F}^{-1} \\left\\{#1\\right\\} }\n \\newcommand{\\ztrans}[1]{ \\mathcal{Z} \\left\\{#1\\right\\} }\n \\newcommand{\\iztrans}[1]{ \\mathcal{Z}^{-1} \\left\\{#1\\right\\} }\n \\newcommand{\\ltrans}[1]{ \\mathcal{L} \\left\\{#1\\right\\} }\n \\newcommand{\\iltrans}[1]{ \\mathcal{L}^{-1} \\left\\{#1\\right\\} }\n\n\n % coordinate vector relative to a basis (linear algebra)\n \\newcommand{\\cvrb}[2]{\\left[ \\vec{#1} \\right]_{#2} }\n % change of coordinate matrix (linear algebra)\n \\newcommand{\\cocm}[2]{ \\mathop{P}\\limits_{#2 \\leftarrow #1} }\n % Transformed vector set\n \\newcommand{\\tset}[3]{\\{#1\\lr{\\vec{#2}_1}, #1\\lr{\\vec{#2}_2}, \\dots, #1\\lr{\\vec{#2}_{#3}}\\}}\n % sum transformed vector set\n \\newcommand{\\tsetcsum}[4]{{#1}_1#2(\\vec{#3}_1) + {#1}_2#2(\\vec{#3}_2) + \\cdots + {#1}_{#4}#2(\\vec{#3}_{#4})}\n \\newcommand{\\tsetcsumall}[4]{#2\\lr{{#1}_1\\vec{#3}_1 + {#1}_2\\vec{#3}_2 + \\cdots + {#1}_{#4}\\vec{#3}_{#4}}}\n \\newcommand{\\cvecsum}[3]{{#1}_1\\vec{#2}_1 + {#1}_2\\vec{#2}_2 + \\cdots + {#1}_{#3}\\vec{#2}_{#3}}\n\n\n % function def\n \\newcommand{\\fndef}[3]{#1:#2 \\to #3}\n % vector set\n \\newcommand{\\vset}[2]{\\{\\vec{#1}_1, \\vec{#1}_2, \\dots, \\vec{#1}_{#2}\\}}\n % absolute value\n \\newcommand{\\abs}[1]{\\left| #1 \\right|}\n % vector norm\n \\newcommand{\\norm}[1]{\\left|\\left| #1 \\right|\\right|}\n % trans\n \\newcommand{\\trans}{\\mapsto}\n % evaluate integral\n \\newcommand{\\evalint}[3]{\\left. #1 \\right|_{#2}^{#3}}\n % slist\n \\newcommand{\\slist}[2]{{#1}_{1},{#1}_{2},\\dots,{#1}_{#2}}\n\n % vectors\n \\newcommand{\\vc}[1]{\\textbf{#1}}\n\n % real\n \\newcommand{\\Real}[1]{{\\Re \\mit{e}\\left\\{{#1}\\right\\}}}\n % imaginary\n \\newcommand{\\Imag}[1]{{\\Im \\mit{m}\\left\\{{#1}\\right\\}}}\n\n \\newcommand{\\mcal}[1]{\\mathcal{#1}}\n \\newcommand{\\bb}[1]{\\mathbb{#1}}\n \\newcommand{\\N}{\\mathbb{N}}\n \\newcommand{\\Z}{\\mathbb{Z}}\n \\newcommand{\\Q}{\\mathbb{Q}}\n \\newcommand{\\R}{\\mathbb{R}}\n \\newcommand{\\C}{\\mathbb{C}}\n \\newcommand{\\I}{\\mathbb{I}}\n \\newcommand{\\Th}[1]{\\mathop\\mathrm{Th(#1)}}\n \\newcommand{\\intersect}{\\cap}\n \\newcommand{\\\\union}{\\cup}\n \\newcommand{\\intersectop}{\\bigcap}\n \\newcommand{\\\\unionop}{\\bigcup}\n \\newcommand{\\setdiff}{\\backslash}\n \\newcommand{\\iso}{\\cong}\n \\newcommand{\\aut}[1]{\\mathop{\\mathrm{Aut(#1)}}}\n \\newcommand{\\inn}[1]{\\mathop{\\mathrm{Inn(#1)}}}\n \\newcommand{\\Ann}[1]{\\mathop{\\mathrm{Ann(#1)}}}\n \\newcommand{\\dom}[1]{\\mathop{\\mathrm{dom} #1}}\n \\newcommand{\\cod}[1]{\\mathop{\\mathrm{cod} #1}}\n \\newcommand{\\id}{\\mathrm{id}}\n \\newcommand{\\st}{\\ |\\ }\n \\newcommand{\\mbf}[1]{\\mathbf{#1}}\n \\newcommand{\\enclose}[1]{\\left\\langle #1\\right\\rangle}\n \\newcommand{\\lr}[1]{\\left( #1\\right)}\n \\newcommand{\\lrsq}[1]{\\left[ #1\\right]}\n \\newcommand{\\op}{\\mathrm{op}}\n \\newcommand{\\dotarr}{\\dot{\\rightarrow}}\n %Category Names:\n \\newcommand{\\Grp}{\\mathbf{Grp}}\n \\newcommand{\\Ab}{\\mathbf{Ab}}\n \\newcommand{\\Set}{\\mathbf{Set}}\n \\newcommand{\\Matr}{\\mathbf{Matr}}\n \\newcommand{\\IntDom}{\\mathbf{IntDom}}\n \\newcommand{\\Field}{\\mathbf{Field}}\n \\newcommand{\\Vect}{\\mathbf{Vect}}\n\n \\newcommand{\\thm}[1]{\\begin{theorem} #1 \\end{theorem}}\n \\newcommand{\\clm}[1]{\\begin{claim} #1 \\end{claim}}\n \\newcommand{\\cor}[1]{\\begin{corollary} #1 \\end{corollary}}\n \\newcommand{\\ex}[1]{\\begin{example} #1 \\end{example}}\n \\newcommand{\\prf}[1]{\\begin{proof} #1 \\end{proof}}\n \\newcommand{\\prbm}[1]{\\begin{problem} #1 \\end{problem}}\n \\newcommand{\\soln}[1]{\\begin{solution} #1 \\end{solution}}\n \\newcommand{\\rmk}[1]{\\begin{remark} #1 \\end{remark}}\n \\newcommand{\\defn}[1]{\\begin{definition} #1 \\end{definition}}\n\n \\newcommand{\\ifff}{\\LeftRightArrow}\n\n \x3c!-- For the set of reals and integers --\x3e\n \\newcommand{\\rr}{\\R}\n \\newcommand{\\reals}{\\R}\n \\newcommand{\\ii}{\\Z}\n \\newcommand{\\cc}{\\C}\n \\newcommand{\\nn}{\\N}\n \\newcommand{\\nats}{\\N}\n\n \x3c!-- For terms being indexed.\n Puts them in standard font face and creates an index entry.\n arg: The term being defined.\n \\newcommand{\\pointer}[1]{#1\\index{#1}} --\x3e\n\n \x3c!-- For bold terms to be index, but defined elsewhere\n Puts them in bold face and creates an index entry.\n arg: The term being defined. --\x3e\n \\newcommand{\\strong}[1]{\\textbf{#1}}\n\n \x3c!-- For set names.\n Puts them in italics. In math mode, yields decent spacing.\n arg: The name of the set. --\x3e\n \\newcommand{\\set}[1]{\\textit{#1}}\n\n $$\n "]);return _templateObject_604a2740ac2311efacc63b09623ae52a=function _templateObject_604a2740ac2311efacc63b09623ae52a(){return t},t}var s=String.raw(_templateObject_604a2740ac2311efacc63b09623ae52a());n.default=s},{"@babel/runtime/helpers/interopRequireDefault":6,"@babel/runtime/helpers/taggedTemplateLiteral":11}],120:[function(t,e,n){(function(e){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.loadMathJax=n.getMathJax=n.DEFAULT_OPTIONS=n.DEFAULT_SCRIPT=void 0;var a=i(t("load-script")),s=e.env.MATHJAX_CDN||"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/MathJax.js";n.DEFAULT_SCRIPT=s;var u={TeX:{extensions:["AMSmath.js","AMSsymbols.js"]},extensions:["tex2jax.js"],showProcessingMessages:!1,jax:["input/TeX","output/HTML-CSS"],messageStyle:"none",showMathMenu:!1,showMathMenuMSIE:!1,tex2jax:{processEnvironments:!0,inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],preview:"none",processEscapes:!0},"HTML-CSS":{linebreaks:{automatic:!0,width:"container"}}};n.DEFAULT_OPTIONS=u;n.getMathJax=function getMathJax(){return"undefined"==typeof MathJax?void 0:MathJax};n.loadMathJax=function loadMathJax(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u,i=function onLoad(){MathJax.Hub.Config(n),t()};if(!e)return i();(0,a.default)(e,i)}}).call(this,t("_process"))},{"@babel/runtime/helpers/interopRequireDefault":6,_process:100,"load-script":99}],121:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"pstricks",{enumerable:!0,get:function get(){return a.default}}),Object.defineProperty(n,"psgraph",{enumerable:!0,get:function get(){return s.default}}),n.default=void 0;var a=i(t("./lib/pstricks")),s=i(t("./lib/psgraph")),u={pstricks:a.default,psgraph:s.default};n.default=u},{"./lib/psgraph":122,"./lib/pstricks":123,"@babel/runtime/helpers/interopRequireDefault":6}],122:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireWildcard"),a=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var s=a(t("@babel/runtime/helpers/slicedToArray")),u=t("latex2js-utils"),c=i(t("d3"));function arrow(t,e,n,i){var a=Math.PI/6,s=n-t,u=i-e,c=Math.sqrt(s*s+u*u),f=Math.cos(a),h=Math.sin(a),d=8/c,p=n-(s*f-u*h)*d,g=i-(u*f+s*h)*d,v=[];return v.push("M"),v.push(n),v.push(i),v.push("L"),v.push(p),v.push(g),p=n-(s*(f=Math.cos(-a))-u*(h=Math.sin(-a)))*d,g=i-(u*f+s*h)*d,v.push(p),v.push(g),v.push("Z"),v.join(" ")}var f={getSize:function getSize(){this.env.scale=1;var t=Math.max(document.documentElement.clientWidth,window.innerWidth||0)-20;return t<=this.env.w*this.env.xunit&&(this.env.scale=t/this.env.w/this.env.xunit),{width:this.env.w*this.env.xunit,height:this.env.h*this.env.yunit}},psframe:function psframe(t){t.append("svg:line").attr("x1",this.x1).attr("y1",this.y1).attr("x2",this.x2).attr("y2",this.y1).style("stroke-width",2).style("stroke","rgb(0,0,0)").style("stroke-opacity",1),t.append("svg:line").attr("x1",this.x2).attr("y1",this.y1).attr("x2",this.x2).attr("y2",this.y2).style("stroke-width",2).style("stroke","rgb(0,0,0)").style("stroke-opacity",1),t.append("svg:line").attr("x1",this.x2).attr("y1",this.y2).attr("x2",this.x1).attr("y2",this.y2).style("stroke-width",2).style("stroke","rgb(0,0,0)").style("stroke-opacity",1),t.append("svg:line").attr("x1",this.x1).attr("y1",this.y2).attr("x2",this.x1).attr("y2",this.y1).style("stroke-width",2).style("stroke","rgb(0,0,0)").style("stroke-opacity",1)},pscircle:function pscircle(t){t.append("svg:circle").attr("cx",this.cx).attr("cy",this.cy).attr("r",this.r).style("stroke","black").style("fill","none").style("stroke-width",2).style("stroke-opacity",1)},psplot:function psplot(t){var e=[];e.push("M"),"solid"===this.fillstyle?(e.push(this.data[0]),e.push(u.Y.call(this.global,0))):(e.push(this.data[0]),e.push(this.data[1])),e.push("L"),this.data.forEach((function(t){e.push(t)})),"solid"===this.fillstyle&&(e.push(this.data[this.data.length-2]),e.push(u.Y.call(this.global,0)),e.push("Z")),t.append("svg:path").attr("d",e.join(" ")).attr("class","psplot").style("stroke-width",this.linewidth).style("stroke-opacity",1).style("fill","none"===this.fillstyle?"none":this.fillcolor).style("stroke",this.linecolor)},pspolygon:function pspolygon(t){var e=[];e.push("M"),e.push(this.data[0]),e.push(this.data[1]),e.push("L"),this.data.forEach((function(t){e.push(t)})),e.push("Z"),t.append("svg:path").attr("d",e.join(" ")).style("stroke-width",this.linewidth).style("stroke-opacity",1).style("fill","none"===this.fillstyle?"none":this.fillcolor).style("stroke","black")},psarc:function psarc(t){var e=[];e.push("M"),e.push(this.cx),e.push(this.cy),e.push("L"),e.push(this.A.x),e.push(this.A.y),e.push("A"),e.push(this.A.x),e.push(this.A.y),e.push(0),e.push(0),e.push(0),e.push(this.B.x),e.push(this.B.y),t.append("svg:path").attr("d",e.join(" ")).style("stroke-width",2).style("stroke-opacity",1).style("fill","blue").style("stroke","black")},psaxes:function psaxes(t){var e=[this.bottomLeft[0],this.topRight[0]],n=[this.bottomLeft[1],this.topRight[1]],i=this.origin;function line(e,n,i,a){t.append("svg:path").attr("d","M "+e+" "+n+" L "+i+" "+a).style("stroke-width",2).style("stroke","rgb(0,0,0)").style("stroke-opacity",1)}var a=function xticks(){for(var t=e[0];t<=e[1];t+=this.dx)line(t,i[1]-5,t,i[1]+5)},s=function yticks(){for(var t=n[0];t<=n[1];t+=this.dy)line(i[0]-5,t,i[0]+5,t)};line(e[0],i[1],e[1],i[1]),line(i[0],n[0],i[0],n[1]),this.ticks.match(/all/)?(a(),s()):this.ticks.match(/x/)?a():this.ticks.match(/y/)&&s(),this.arrows[0]&&(t.append("path").attr("d",arrow(e[1],i[1],e[0],i[1])).style("fill","black").style("stroke","black"),t.append("path").attr("d",arrow(i[0],n[1],i[0],n[0])).style("fill","black").style("stroke","black")),this.arrows[1]&&(t.append("path").attr("d",arrow(e[0],i[1],e[1],i[1])).style("fill","black").style("stroke","black"),t.append("path").attr("d",arrow(i[0],n[0],i[0],n[1])).style("fill","black").style("stroke","black"))},psline:function psline(t){var e=this.linewidth,n=this.linecolor;this.linestyle.match(/dotted/)?function dotted(i,a,s,u){t.append("svg:path").attr("d","M "+i+" "+a+" L "+s+" "+u).style("stroke-width",e).style("stroke",n).style("stroke-dasharray","9,5").style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2):this.linestyle.match(/dashed/)?function dashed(i,a,s,u){t.append("svg:path").attr("d","M "+i+" "+a+" L "+s+" "+u).style("stroke-width",e).style("stroke",n).style("stroke-dasharray","9,5").style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2):function solid(i,a,s,u){t.append("svg:path").attr("d","M "+i+" "+a+" L "+s+" "+u).style("stroke-width",e).style("stroke",n).style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2),this.dots[0]&&t.append("svg:circle").attr("cx",this.x1).attr("cy",this.y1).attr("r",3).style("stroke",this.linecolor).style("fill",this.linecolor).style("stroke-width",1).style("stroke-opacity",1),this.dots[1]&&t.append("svg:circle").attr("cx",this.x2).attr("cy",this.y2).attr("r",3).style("stroke",this.linecolor).style("fill",this.linecolor).style("stroke-width",1).style("stroke-opacity",1);var i=this.x1,a=this.y1,s=this.x2,u=this.y2;this.arrows[0]&&t.append("path").attr("d",arrow(s,u,i,a)).style("fill",this.linecolor).style("stroke",this.linecolor),this.arrows[1]&&t.append("path").attr("d",arrow(i,a,s,u)).style("fill",this.linecolor).style("stroke",this.linecolor)},userline:function userline(t){var e=this.linewidth,n=this.linecolor;this.linestyle.match(/dotted/)?function dotted(i,a,s,u){t.append("svg:path").attr("d","M "+i+" "+a+" L "+s+" "+u).attr("class","userline").style("stroke-width",e).style("stroke",n).style("stroke-dasharray","9,5").style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2):this.linestyle.match(/dashed/)?function dashed(i,a,s,u){t.append("svg:path").attr("d","M "+i+" "+a+" L "+s+" "+u).attr("class","userline").style("stroke-width",e).style("stroke",n).style("stroke-dasharray","9,5").style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2):function solid(i,a,s,u){t.append("svg:path").attr("class","userline").attr("d","M "+i+" "+a+" L "+s+" "+u).style("stroke-width",e).style("stroke",n).style("stroke-opacity",1)}(this.x1,this.y1,this.x2,this.y2),this.dots[0]&&t.append("svg:circle").attr("cx",this.x1).attr("cy",this.y1).attr("r",3).attr("class","userline").style("stroke",this.linecolor).style("fill",this.linecolor).style("stroke-width",1).style("stroke-opacity",1),this.dots[1]&&t.append("svg:circle").attr("cx",this.x2).attr("cy",this.y2).attr("r",3).attr("class","userline").style("stroke",this.linecolor).style("fill",this.linecolor).style("stroke-width",1).style("stroke-opacity",1);var i=this.x1,a=this.y1,s=this.x2,u=this.y2;this.arrows[0]&&t.append("path").attr("d",arrow(s,u,i,a)).attr("class","userline").style("fill",this.linecolor).style("stroke",this.linecolor),this.arrows[1]&&t.append("path").attr("d",arrow(i,a,s,u)).attr("class","userline").style("fill",this.linecolor).style("stroke",this.linecolor)},rput:function rput(t){var e=document.createElement("div"),n=this.x,i=this.y;e.innerHTML=this.text,e.className="math",e.style.visibility="hidden",e.style.position="absolute",e.style.top="".concat(i,"px"),e.style.left="".concat(n,"px"),t.appendChild(e);MathJax.Hub.Queue(["Typeset",MathJax.Hub,e],[function done(){var t=e.getBoundingClientRect(),a=t.width/2,s=t.height/2;e.style.visibility="visible",e.style.top="".concat(i-s,"px"),e.style.left="".concat(n-a,"px")}])},pspicture:function pspicture(t){var e=this,n=this.env,i=this.$el;Object.keys(this.plot).forEach((function(i){var a=e.plot[i];i.match(/rput/)||f.hasOwnProperty(i)&&a.forEach((function(e){e.data.global=n,f[i].call(e.data,t)}))})),t.on("touchmove",(function(){c.event.preventDefault(),userEvent(c.touches(this)[0])}),!1),t.on("mousemove",(function(){userEvent(c.mouse(this))}),!1);var a=this.plot;function userEvent(e){t.selectAll(".userline").remove(),t.selectAll(".psplot").remove();var i={};Object.entries(a||{}).forEach((function(t){var n=(0,s.default)(t,2),a=n[0],u=n[1];a.match(/uservariable/)&&u.forEach((function(t){t.env.userx=e[0],t.env.usery=e[1];var n=t.fn.call(t.env,t.match);i[t.data.name]=n.value}))})),Object.entries(a||{}).forEach((function(a){var u=(0,s.default)(a,2),c=u[0],h=u[1];c.match(/psplot/)&&h.forEach((function(e){Object.entries(i||{}).forEach((function(t){var n=(0,s.default)(t,2),i=n[0],a=n[1];e.env.variables[i]=a}));var a=e.fn.call(e.env,e.match);a.global={},Object.assign(a.global,n),f[c].call(a,t)})),c.match(/userline/)&&h.forEach((function(i){var a=i.fn.call(i.env,i.match);i.env.x2=e[0],i.env.y2=e[1],i.data.x2=i.env.x2,i.data.y2=i.env.y2,i.data.xExp2?(i.data.x2=a.userx2(e),i.data.x1=a.userx(e)):i.data.xExp&&(i.data.x2=a.userx(e)),i.data.yExp2?(i.data.y2=a.usery2(e),i.data.y1=a.usery(e)):i.data.yExp&&(i.data.y2=a.usery(e)),a.global={},Object.assign(a.global,n),Object.assign(a,i.data),f[c].call(a,t)}))}))}this.plot.rput.forEach((function(t){f.rput.call(t.data,i)}))}},h=f;n.default=h},{"@babel/runtime/helpers/interopRequireDefault":6,"@babel/runtime/helpers/interopRequireWildcard":7,"@babel/runtime/helpers/slicedToArray":10,d3:73,"latex2js-utils":125}],123:[function(require,module,exports){var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.Functions=exports.Expressions=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")),_latex2jsUtils=require("latex2js-utils"),_latex2jsSettings=_interopRequireDefault(require("latex2js-settings")),Expressions={pspicture:/\\begin\{pspicture\}\(\s*(.*),(.*)\s*\)\(\s*(.*),(.*)\s*\)/,psframe:/\\psframe\(\s*(.*),(.*)\s*\)\(\s*(.*),(.*)\s*\)/,psplot:/\\psplot(\[[^\]]*\])?\{([^\}]*)\}\{([^\}]*)\}\{([^\}]*)\}/,psarc:new RegExp("\\\\psarc"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.type+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle),pscircle:/\\pscircle.*\(\s*(.*),(.*)\s*\)\{(.*)\}/,pspolygon:new RegExp("\\\\pspolygon"+_latex2jsUtils.RE.options+"(.*)"),psaxes:new RegExp("\\\\psaxes"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.type+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.coordsOpt+_latex2jsUtils.RE.coordsOpt),slider:new RegExp("\\\\slider"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.squiggle),psline:new RegExp("\\\\psline"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.type+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.coordsOpt),userline:new RegExp("\\\\userline"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.type+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.squiggleOpt+_latex2jsUtils.RE.squiggleOpt+_latex2jsUtils.RE.squiggleOpt+_latex2jsUtils.RE.squiggleOpt),uservariable:new RegExp("\\\\uservariable"+_latex2jsUtils.RE.options+_latex2jsUtils.RE.squiggle+_latex2jsUtils.RE.coords+_latex2jsUtils.RE.squiggle),rput:/\\rput\((.*),(.*)\)\{(.*)\}/,psset:/\\psset\{(.*)\}/};exports.Expressions=Expressions;var Functions={slider:function slider(t){var e={scalar:1,min:Number(t[2]),max:Number(t[3]),variable:t[4],latex:t[5],value:Number(t[6])};return this.variables=this.variables||{},this.variables[e.variable]=e.value,this.sliders=this.sliders||[],this.sliders.push(e),t[1]&&Object.assign(e,(0,_latex2jsUtils.parseOptions)(t[1])),e},pspicture:function pspicture(t){var e={x0:Number(t[1]),y0:Number(t[2]),x1:Number(t[3]),y1:Number(t[4])},n={w:e.x1-e.x0,h:e.y1-e.y0};return Object.assign(this,e,n),Object.assign(e,n)},psframe:function psframe(t){return{x1:_latex2jsUtils.X.call(this,t[1]),y1:_latex2jsUtils.Y.call(this,t[2]),x2:_latex2jsUtils.X.call(this,t[3]),y2:_latex2jsUtils.Y.call(this,t[4])}},pscircle:function pscircle(t){return{cx:_latex2jsUtils.X.call(this,t[1]),cy:_latex2jsUtils.Y.call(this,t[2]),r:this.xunit*t[3]}},psaxes:function psaxes(t){var e={dx:1*this.xunit,dy:1*this.yunit,arrows:[0,0],dots:[0,0],ticks:"all"};if(t[1]){var n=(0,_latex2jsUtils.parseOptions)(t[1]);n.Dx&&(e.dx=Number(n.Dx)*this.xunit),n.Dy&&(e.dy=Number(n.Dy)*this.yunit)}var i=(0,_latex2jsUtils.parseArrows)(t[2]);return e.arrows=i.arrows,e.dots=i.dots,t[5]&&!t[8]?(e.origin=[_latex2jsUtils.X.call(this,t[3]),_latex2jsUtils.Y.call(this,t[4])],e.bottomLeft=[_latex2jsUtils.X.call(this,t[3]),_latex2jsUtils.Y.call(this,t[4])],e.topRight=[_latex2jsUtils.X.call(this,t[6]),_latex2jsUtils.Y.call(this,t[7])]):t[5]||t[8]?(e.origin=[_latex2jsUtils.X.call(this,t[3]),_latex2jsUtils.Y.call(this,t[4])],e.bottomLeft=[_latex2jsUtils.X.call(this,t[6]),_latex2jsUtils.Y.call(this,t[7])],e.topRight=[_latex2jsUtils.X.call(this,t[9]),_latex2jsUtils.Y.call(this,t[10])]):(e.origin=[_latex2jsUtils.X.call(this,0),_latex2jsUtils.Y.call(this,0)],e.bottomLeft=[_latex2jsUtils.X.call(this,0),_latex2jsUtils.Y.call(this,0)],e.topRight=[_latex2jsUtils.X.call(this,t[3]),_latex2jsUtils.Y.call(this,t[6])]),e},psplot:function psplot(m){var startX=_latex2jsUtils.evaluate.call(this,m[2]),endX=_latex2jsUtils.evaluate.call(this,m[3]),data=[],x,expression="";for(Object.entries(this.variables||{}).forEach((function(t){var e=(0,_slicedToArray2.default)(t,2),n=e[0],i=e[1];expression+="var "+n+" = "+i+";"})),expression+="with (Math){"+m[4]+"}",x=startX;x<=endX;x+=.005)data.push(_latex2jsUtils.X.call(this,x)),data.push(_latex2jsUtils.Y.call(this,eval(expression)));var obj={linecolor:"black",linestyle:"solid",fillstyle:"none",fillcolor:"none",linewidth:2};return m[1]&&Object.assign(obj,(0,_latex2jsUtils.parseOptions)(m[1])),obj.data=data,obj},pspolygon:function pspolygon(t){var e=this,n=t[2];if(n){var i=new RegExp(_latex2jsUtils.RE.coords,"g"),a=n.match(i),s=new RegExp(_latex2jsUtils.RE.coords),u=[];a.forEach((function(t){var n=s.exec(t);u.push(_latex2jsUtils.X.call(e,n[1])),u.push(_latex2jsUtils.Y.call(e,n[2]))}));var c={linecolor:"black",linestyle:"solid",fillstyle:"none",fillcolor:"black",linewidth:2,data:u};return t[1]&&Object.assign(c,(0,_latex2jsUtils.parseOptions)(t[1])),c}},psarc:function psarc(t){var e=(0,_latex2jsUtils.parseArrows)(t[2]),n={linecolor:"black",linestyle:"solid",fillstyle:"solid",fillcolor:"black",linewidth:2,arrows:e.arrows,dots:e.dots,cx:_latex2jsUtils.X.call(this,0),cy:_latex2jsUtils.Y.call(this,0)};return t[1]&&Object.assign(n,(0,_latex2jsUtils.parseOptions)(t[1])),t[3]&&(n.cx=_latex2jsUtils.X.call(this,t[3])),t[4]&&(n.cy=_latex2jsUtils.Y.call(this,t[4])),n.r=Number(t[5])*this.xunit,n.angleA=Number(t[6])*Math.PI/180,n.angleB=Number(t[7])*Math.PI/180,n.A={x:_latex2jsUtils.X.call(this,Number(t[5])*Math.cos(n.angleA)),y:_latex2jsUtils.Y.call(this,Number(t[5])*Math.sin(n.angleA))},n.B={x:_latex2jsUtils.X.call(this,Number(t[5])*Math.cos(n.angleB)),y:_latex2jsUtils.Y.call(this,Number(t[5])*Math.sin(n.angleB))},n},psline:function psline(t){var e=t[1],n=t[2],i=(0,_latex2jsUtils.parseArrows)(n),a={linecolor:"black",linestyle:"solid",fillstyle:"solid",fillcolor:"black",linewidth:2,arrows:i.arrows,dots:i.dots};return t[5]?(a.x1=_latex2jsUtils.X.call(this,t[3]),a.y1=_latex2jsUtils.Y.call(this,t[4]),a.x2=_latex2jsUtils.X.call(this,t[6]),a.y2=_latex2jsUtils.Y.call(this,t[7])):(a.x1=_latex2jsUtils.X.call(this,0),a.y1=_latex2jsUtils.Y.call(this,0),a.x2=_latex2jsUtils.X.call(this,t[3]),a.y2=_latex2jsUtils.Y.call(this,t[4])),e&&Object.assign(a,(0,_latex2jsUtils.parseOptions)(e)),"string"==typeof a.linewidth&&(a.linewidth=2),a},uservariable:function uservariable(m){var options=m[1],coords=[];this.userx&&this.usery?(coords.push(Number(this.userx)),coords.push(Number(this.usery))):(coords.push(_latex2jsUtils.X.call(this,m[3])),coords.push(_latex2jsUtils.Y.call(this,m[4])));var nx1=_latex2jsUtils.Xinv.call(this,coords[0]),ny1=_latex2jsUtils.Yinv.call(this,coords[1]),expx1="var x = "+nx1+";",expy1="var y = "+ny1+";",obj={name:m[2],x:_latex2jsUtils.X.call(this,m[3]),y:_latex2jsUtils.Y.call(this,m[4]),func:m[5],value:eval(expx1+expy1+m[5])};return obj},userline:function userline(m){var _this2=this,options=m[1],lineType=m[2],l=(0,_latex2jsUtils.parseArrows)(lineType),arrows=l.arrows,dots=l.dots,xExp=m[7],yExp=m[8];xExp&&(xExp="with (Math){"+xExp.replace(/^\{/,"").replace(/\}$/,"")+"}"),yExp&&(yExp="with (Math){"+yExp.replace(/^\{/,"").replace(/\}$/,"")+"}");var xExp2=m[9],yExp2=m[10];xExp2&&(xExp2="with (Math){"+xExp2.replace(/^\{/,"").replace(/\}$/,"")+"}"),yExp2&&(yExp2="with (Math){"+yExp2.replace(/^\{/,"").replace(/\}$/,"")+"}");var expression="";Object.entries(this.variables||{}).forEach((function(t){var e=(0,_slicedToArray2.default)(t,2),n=e[0],i=e[1];expression+="var "+n+" = "+i+";"}));var obj={x1:_latex2jsUtils.X.call(this,m[3]),y1:_latex2jsUtils.Y.call(this,m[4]),x2:_latex2jsUtils.X.call(this,m[5]),y2:_latex2jsUtils.Y.call(this,m[6]),xExp,yExp,xExp2,yExp2,userx:function userx(coords){var nx1=_latex2jsUtils.Xinv.call(_this2,coords[0]),ny1=_latex2jsUtils.Yinv.call(_this2,coords[1]),expx1="var x = "+nx1+";",expy1="var y = "+ny1+";";return _latex2jsUtils.X.call(_this2,eval(expression+expy1+expx1+xExp))},usery:function usery(coords){var nx2=_latex2jsUtils.Xinv.call(_this2,coords[0]),ny2=_latex2jsUtils.Yinv.call(_this2,coords[1]),expx2="var x = "+nx2+";",expy2="var y = "+ny2+";";return _latex2jsUtils.Y.call(_this2,eval(expression+expy2+expx2+yExp))},userx2:function userx2(coords){var nx3=_latex2jsUtils.Xinv.call(_this2,coords[0]),ny3=_latex2jsUtils.Yinv.call(_this2,coords[1]),expx3="var x = "+nx3+";",expy3="var y = "+ny3+";";return _latex2jsUtils.X.call(_this2,eval(expression+expy3+expx3+xExp2))},usery2:function usery2(coords){var nx4=_latex2jsUtils.Xinv.call(_this2,coords[0]),ny4=_latex2jsUtils.Yinv.call(_this2,coords[1]),expx4="var x = "+nx4+";",expy4="var y = "+ny4+";";return _latex2jsUtils.Y.call(_this2,eval(expression+expy4+expx4+yExp2))},linecolor:"black",linestyle:"solid",fillstyle:"solid",fillcolor:"black",linewidth:2,arrows,dots};return options&&Object.assign(obj,(0,_latex2jsUtils.parseOptions)(options)),"string"==typeof obj.linewidth&&(obj.linewidth=2),obj},rput:function rput(t){return{x:_latex2jsUtils.X.call(this,t[1]),y:_latex2jsUtils.Y.call(this,t[2]),text:t[3]}},psset:function psset(t){var e=t[1].split(",").map((function(t){return t.split("=")})),n={};return e.forEach((function(t){var e=t[0],i=t[1];Object.keys(_latex2jsSettings.default.Expressions).forEach((function(t){var a=_latex2jsSettings.default.Expressions[t];e.match(a)&&_latex2jsSettings.default.Functions[t](n,i)}))})),n}};exports.Functions=Functions;var _default={Expressions,Functions};exports.default=_default},{"@babel/runtime/helpers/interopRequireDefault":6,"@babel/runtime/helpers/slicedToArray":10,"latex2js-settings":124,"latex2js-utils":125}],124:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Functions=n.Expressions=void 0;var i=t("latex2js-utils"),a={fillcolor:/^fillcolor$/,fillstyle:/^fillstyle$/,linecolor:/^linecolor$/,linestyle:/^linestyle$/,unit:/^unit/,runit:/^runit/,xunit:/^xunit/,yunit:/^yunit/};n.Expressions=a;var s={fillcolor:function fillcolor(t,e){t.fillcolor=e},fillstyle:function fillstyle(t,e){t.fillstyle=e},linecolor:function linecolor(t,e){t.linecolor=e},linestyle:function linestyle(t,e){t.linestyle=e},unit:function unit(t,e){e=(0,i.convertUnits)(e),t.unit=e,t.runit=e,t.xunit=e,t.yunit=e},runit:function runit(t,e){e=(0,i.convertUnits)(e),t.runit=e},xunit:function xunit(t,e){e=(0,i.convertUnits)(e),t.xunit=e},yunit:function yunit(t,e){e=(0,i.convertUnits)(e),t.yunit=e}};n.Functions=s;var u={Expressions:a,Functions:s};n.default=u},{"latex2js-utils":125}],125:[function(require,module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.Yinv=exports.Y=exports.Xinv=exports.X=exports.evaluate=exports.parseArrows=exports.parseOptions=exports.RE=exports.convertUnits=exports.matchrepl=exports.simplerepl=void 0;var simplerepl=function simplerepl(t,e){return function(n,i){return i.replace(t,e)}};exports.simplerepl=simplerepl;var matchrepl=function matchrepl(t,e){return function(n,i){return Array.isArray(n)&&n.forEach((function(n){var a=n.match(t);i=i.replace(a.input,e(a))})),i}};exports.matchrepl=matchrepl;var convertUnits=function convertUnits(t){var e=null;return(e=t.match(/([^c]+)\s*cm/))?50*Number(e[1]):(e=t.match(/([^i]+)\s*in/))?20*Number(e[1]):(e=t.match(/(.*)/))?50*Number(e[1]):Number(t)};exports.convertUnits=convertUnits;var RE={options:"(\\[[^\\]]*\\])?",type:"(\\{[^\\}]*\\})?",squiggle:"\\{([^\\}]*)\\}",squiggleOpt:"(\\{[^\\}]*\\})?",coordsOpt:"(\\(\\s*([^\\)]*),([^\\)]*)\\s*\\))?",coords:"\\(\\s*([^\\)]*),([^\\)]*)\\s*\\)"};exports.RE=RE;var parseOptions=function parseOptions(t){var e=t.replace(/[\]\[]/g,"").split(","),n={};return e.forEach((function(t){var e=t.split("=");2==e.length&&(n[e[0].trim()]=e[1].trim())})),n};exports.parseOptions=parseOptions;var parseArrows=function parseArrows(t){var e=[0,0],n=[0,0];if(t){var i=t.match(/\{([^\-]*)?\-([^\-]*)?\}/);i&&(i[1]&&(i[1].match(/\*/)?n[0]=1:i[1].match(//)&&(e[1]=1)))}return{arrows:e,dots:n}};exports.parseArrows=parseArrows;var evaluate=function evaluate(exp){var _this=this,num=Number(exp);if(isNaN(num)){var expression="";return this.variables=this.variables||{},Object.keys(this.variables).map((function(t){var e=_this.variables[t];expression+="var "+t+" = "+e+";"})),expression+="with (Math){"+exp+"}",eval(expression)}return num};exports.evaluate=evaluate;var X=function X(t){return(this.w-(this.x1-Number(t)))*this.xunit};exports.X=X;var Xinv=function Xinv(t){return Number(t)/this.xunit-this.w+this.x1};exports.Xinv=Xinv;var Y=function Y(t){return(this.y1-Number(t))*this.yunit};exports.Y=Y;var Yinv=function Yinv(t){return this.y1-Number(t)/this.yunit};exports.Yinv=Yinv},{}],126:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=i(t("@babel/runtime/helpers/classCallCheck")),s=i(t("@babel/runtime/helpers/createClass")),u=i(t("./lib/text")),c=i(t("./lib/headers")),f=t("latex2js-pstricks"),h=i(t("./lib/environments")),d=i(t("./lib/ignore")),p=i(t("./lib/parser")),g=function(){function LaTeX2HTML5(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.default,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c.default,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.default,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.default,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:f.pstricks,g=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};(0,a.default)(this,LaTeX2HTML5),this.Text=e,this.Headers=n,this.Environments=i,this.Ignore=s,this.PSTricks=p,this.Views=g,this.Delimiters={},i.forEach((function(e){t.addEnvironment(e)}))}return(0,s.default)(LaTeX2HTML5,[{key:"addEnvironment",value:function addEnvironment(t){var e={begin:new RegExp("\\\\begin\\{"+t+"\\}"),end:new RegExp("\\\\end\\{"+t+"\\}")};this.Delimiters[t]=e}},{key:"addView",value:function addView(t,e){this.addEnvironment(t)}},{key:"addText",value:function addText(t,e,n){this.Text.Expressions[t]=e,this.Text.Functions[t]=n}},{key:"addHeaders",value:function addHeaders(t,e,n){var i={},a=t+"begin",s=t+"end";i[a]=new RegExp("\\\\begin\\{"+t+"\\}"),i[s]=new RegExp("\\\\end\\{"+t+"\\}"),Object.assign(this.Headers.Expressions,i);var u={};u[a]=function(){return e||""},u[s]=function(){return n||""},Object.assign(this.Headers.Functions,u)}},{key:"getParser",value:function getParser(){return new p.default(this)}},{key:"parse",value:function parse(t){var e=new p.default(this).parse(t);return e.forEach((function(t){if(!t.hasOwnProperty("type"))throw new Error("no type!")})),e}}]),LaTeX2HTML5}();n.default=g},{"./lib/environments":127,"./lib/headers":128,"./lib/ignore":129,"./lib/parser":130,"./lib/text":131,"@babel/runtime/helpers/classCallCheck":3,"@babel/runtime/helpers/createClass":4,"@babel/runtime/helpers/interopRequireDefault":6,"latex2js-pstricks":121}],127:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=["pspicture","verbatim","enumerate","print","nicebox"]},{}],128:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Functions=n.Expressions=void 0;var i={bq:/\\begin\{quotation\}/,claim:/\\begin\{claim\}/,corollary:/\\begin\{corollary\}/,definition:/\\begin\{definition\}/,endclaim:/\\end\{claim\}/,endcorallary:/\\end\{corallary\}/,enddefinition:/\\end\{definition\}/,endexample:/\\end\{example\}/,endproblem:/\\end\{problem\}/,endsolution:/\\end\{solution\}/,endtheorem:/\\end\{theorem\}/,eq:/\\end\{quotation\}/,example:/\\begin\{example\}/,problem:/\\begin\{problem\}/,proof:/\\begin\{proof\}/,qed:/\\end\{proof\}/,solution:/\\begin\{solution\}/,theorem:/\\begin\{theorem\}/};n.Expressions=i;var a={bq:function bq(){return'

    '},claim:function claim(){return"

    Claim

    "},corollary:function corollary(){return"

    Corollary

    "},definition:function definition(){return"

    Definition

    "},endclaim:function endclaim(){return""},endcorollary:function endcorollary(){return""},enddefinition:function enddefinition(){return""},endexample:function endexample(){return""},endproblem:function endproblem(){return""},endsolution:function endsolution(){return""},endtheorem:function endtheorem(){return""},eq:function eq(){return"

    "},example:function example(){return"

    Example

    "},problem:function problem(){return"

    Problem

    "},proof:function proof(){return"

    Proof

    "},qed:function qed(){return"$\\qed$"},solution:function solution(){return"

    Solution

    "},theorem:function theorem(){return"

    Theorem

    "}};n.Functions=a;var s={Expressions:i,Functions:a};n.default=s},{}],129:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default=[/^\%/,/\\begin\{document\}/,/\\end\{document\}/,/\\begin\{interactive\}/,/\\end\{interactive\}/,/\\usepackage/,/\\documentclass/,/\\tableofcontents/,/\\author/,/\\date/,/\\maketitle/,/\\title/,/\\pagestyle/,/\\smallskip/,/\\medskip/,/\\bigskip/,/\\nobreak/,/\\begin\{center\}/,/\\end\{center\}/]},{}],130:[function(t,e,n){var i=t("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=i(t("@babel/runtime/helpers/slicedToArray")),s=i(t("@babel/runtime/helpers/defineProperty"));function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Parser(t){this.Ignore=t.Ignore,this.Delimiters=t.Delimiters,this.Text=t.Text,this.PSTricks=t.PSTricks,this.Headers=t.Headers,this.objects=[],this.environment=null,this.settings=this.PSTricks.Functions.psset.call(this,["","units=1cm,linecolor=black,linestyle=solid,fillstyle=none"])}Parser.prototype={parse:function parse(t){var e=this;if(!t)return{};var n=t.split("\n");return this.parseEnvText(n),this.parseEnv(n),this.objects.forEach((function(t){t.type.match(/pspicture/)&&(t.plot=e.parsePSTricks(t.lines,t.env))})),this.objects},newEnvironment:function newEnvironment(t){this.environment&&this.environment.lines.length&&(this.environment.settings=function _objectSpread(t){for(var e=1;e"))}))},parsePSExpression:function parsePSExpression(t,e,n,i,a){var s=t.match(e);return!!s&&(n[i].push({data:this.PSTricks.Functions[i].call(a,s),env:a,match:s,fn:this.PSTricks.Functions[i]}),!0)},parsePSVariables:function parsePSVariables(t,e,n,i,a){var s=t.match(e);if(s&&i.match(/uservariable/)){var u=this.PSTricks.Functions[i].call(a,s);a.variables=a.variables||{},a.variables[u.name]=u.value}},parsePSTricks:function parsePSTricks(t,e){var n=this,i={},s=Object.entries(this.PSTricks.Expressions);return s.forEach((function(t){var e=(0,a.default)(t,2),n=e[0];e[1];i[n]=[]})),t.forEach((function(t){s.forEach((function(s){var u=(0,a.default)(s,2),c=u[0],f=u[1];n.parsePSVariables(t,f,i,c,e),n.parsePSExpression(t,f,i,c,e)}))})),i},parseTextExpression:function parseTextExpression(t,e,n,i){var a=t.match(e);return a?this.Text.Functions[n].call(this,a,i):i},parseHeadersExpression:function parseHeadersExpression(t,e,n,i){return t.match(e)?this.Headers.Functions[n].call(this):i},parseText:function parseText(t){var e=this,n=t;return Object.entries(this.Text.Expressions).forEach((function(i){var s=(0,a.default)(i,2),u=s[0],c=s[1];n=e.parseTextExpression(t,c,u,n)})),Object.entries(this.Headers.Expressions).forEach((function(i){var s=(0,a.default)(i,2),u=s[0],c=s[1];n=e.parseHeadersExpression(t,c,u,n)})),n}};var u=Parser;n.default=u},{"@babel/runtime/helpers/defineProperty":5,"@babel/runtime/helpers/interopRequireDefault":6,"@babel/runtime/helpers/slicedToArray":10}],131:[function(t,e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Functions=n.Expressions=void 0;var i=t("latex2js-utils"),a={emph:/\\emph\{[^}]*\}/g,bf:/\{*\\bf [^}]*\}/g,rm:/\{*\\rm [^}]*\}/g,sl:/\{*\\sl [^}]*\}/g,it:/\{*\\it [^}]*\}/g,tt:/\{*\\tt [^}]*\}/g,mdash:/---/g,ndash:/--/g,openq:/``/g,closeq:/''/g,TeX:/\\TeX\\|\\TeX/g,LaTeX:/\\LaTeX\\|\\LaTeX/g,vspace:/\\vspace/g,cite:/\\cite\[\d+\]\{[^}]*\}/g,href:/\\href\{[^}]*\}\{[^}]*\}/g,img:/\\img\{[^}]*\}/g,set:/\\set\{[^}]*\}/g,youtube:/\\youtube\{[^}]*\}/g,euler:/Euler\^/g};n.Expressions=a;var s={cite:function cite(t,e){return t.forEach((function(t){var n=t.match(/\\cite\[(\d+)\]\{([^}]*)\}/),i=location.pathname.match(/\/books\/(\d+)\//),a=0;i&&(a=i[1]),e=e.replace(n.input,'[p'+n[1]+"]")})),e},img:(0,i.matchrepl)(/\\img\{([^}]*)\}/,(function(t){return'
    '})),youtube:(0,i.matchrepl)(/\\youtube\{([^}]*)\}/,(function(t){return'
    '})),href:(0,i.matchrepl)(/\\href\{([^}]*)\}\{([^}]*)\}/,(function(t){return''+t[2]+""})),set:(0,i.matchrepl)(/\\set\{([^}]*)\}/,(function(t){return""+t[1]+""})),euler:(0,i.simplerepl)(/Euler\^/,"exp"),emph:(0,i.matchrepl)(/\{([^}]*)\}/,(function(t){return""+t[1]+""})),bf:(0,i.matchrepl)(/\{*\\bf ([^}]*)\}/,(function(t){return""+t[1]+""})),rm:(0,i.matchrepl)(/\{*\\rm ([^}]*)\}/,(function(t){return''+t[1]+""})),sl:(0,i.matchrepl)(/\{*\\sl ([^}]*)\}/,(function(t){return""+t[1]+""})),it:(0,i.matchrepl)(/\{*\\it ([^}]*)\}/,(function(t){return""+t[1]+""})),tt:(0,i.matchrepl)(/\{*\\tt ([^}]*)\}/,(function(t){return''+t[1]+""})),ndash:(0,i.simplerepl)(/--/g,"–"),mdash:(0,i.simplerepl)(/---/g,"—"),openq:(0,i.simplerepl)(/``/g,"“"),closeq:(0,i.simplerepl)(/''/g,"”"),vspace:(0,i.simplerepl)(/\\vspace/g,"
    "),TeX:(0,i.simplerepl)(/\\TeX\\|\\TeX/g,"$\\TeX$"),LaTeX:(0,i.simplerepl)(/\\LaTeX\\|\\LaTeX/g,"$\\LaTeX$")};n.Functions=s;var u={Expressions:a,Functions:s};n.default=u},{"latex2js-utils":125}]},{},[118])(118)})); \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/lorem-data/lib/lorem-data-behaviors.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/lorem-data/lib/lorem-data-behaviors.js index b45e3eff..c51fbab2 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/lorem-data/lib/lorem-data-behaviors.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/lorem-data/lib/lorem-data-behaviors.js @@ -1 +1 @@ -import{SimpleColors as e}from"../../simple-colors/simple-colors.js";import{SimpleIconsetDemo as i}from"../../simple-icon/lib/simple-iconset-demo.js";import{SimpleIcon as t}from"../../simple-icon/simple-icon.js";import{SimpleIconLite as a}from"../../simple-icon/lib/simple-icon-lite.js";import{SimpleIconIconsetsManifest as s}from"../../simple-icon/lib/simple-iconset-manifest.js";import{HaxIconsetManifest as u}from"../../hax-iconset/lib/hax-iconset-manifest.js";export const LoremDataBehaviors=function(e){return class extends e{static get properties(){return{__demo:{type:Object}}}constructor(){super()}get colors(){let e=globalThis.SimpleColorsSharedStyles.requestAvailability();return!(!e||!e.colors)&&Object.keys(e.colors)}get icons(){return[...s||[],...u||[]].map((e=>((e||{}).icons||[]).map((i=>"icons"==e.name?i:`${e.name}:${i}`)))).flat()}get text(){return"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed consectetur at erat eu egestas. Cras porta volutpat vestibulum. Vestibulum eu quam fermentum, lobortis purus at, mattis massa. Sed eget velit rhoncus, ultricies metus eu, tincidunt justo. Ut sit amet congue justo, ac auctor mi. Etiam ut urna laoreet eros sodales commodo. Sed laoreet tortor ligula, vitae condimentum mi sagittis vitae. Nullam volutpat sodales ipsum vel dictum. Aenean dapibus arcu sit amet tellus placerat scelerisque sed nec dui. Maecenas laoreet maximus magna, quis consectetur massa tristique ut. Nunc rutrum elit in tincidunt commodo. Donec nec varius velit. Duis ut arcu pulvinar, venenatis felis pellentesque, egestas ante. Etiam urna dui, vestibulum at diam eget, mattis gravida ipsum. Nulla auctor, neque a ultricies laoreet, nulla diam laoreet nisl, nec rutrum ex lorem a purus. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse gravida ante eu nisi viverra, ac porta risus laoreet. Nunc a justo vel nisl accumsan placerat eu eu libero. Donec non augue sit amet nisl pulvinar bibendum vulputate sit amet metus. Maecenas vel condimentum nulla, at elementum neque. Fusce ac dictum augue. Suspendisse potenti. Nullam eros dui, vehicula et imperdiet vel, vestibulum vel tortor. Nullam ac nunc ante. Pellentesque condimentum nec dui sed varius. Donec porttitor leo id lectus faucibus, in fermentum purus lacinia. Pellentesque vel tellus ut lectus tincidunt pharetra. Quisque elementum elit mattis mi dignissim, eleifend eleifend risus faucibus. Nullam interdum pulvinar tempor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam semper, diam sit amet condimentum interdum, dolor risus ultrices dui, et egestas ex magna at odio. Aliquam sed vulputate turpis. Integer suscipit laoreet lectus, in lobortis sapien. Ut aliquam, dui ac efficitur ullamcorper, sapien augue euismod sapien, eget consectetur odio lectus ac elit. Pellentesque varius metus vel placerat rutrum. Duis placerat diam ut tortor vestibulum, eu ultrices risus gravida. Ut vel auctor dolor. Donec sit amet ornare ipsum, nec pulvinar neque. Pellentesque sagittis orci bibendum, laoreet elit eget, vulputate ante. Donec accumsan in elit sed sollicitudin. Fusce pellentesque velit est, id vestibulum orci consectetur ac. In libero odio, vehicula non felis eu, scelerisque rhoncus arcu. Phasellus id tristique justo. Sed scelerisque quam velit, at porta leo accumsan in. Vestibulum non enim lacinia odio venenatis vehicula. Quisque ultrices augue nulla. Sed tempus porta ipsum, eu rhoncus ligula feugiat ac. Aenean et sollicitudin sem, a pharetra mi. Sed convallis velit in est molestie interdum. Fusce bibendum volutpat sapien vitae faucibus. Vivamus nec neque pellentesque, euismod elit quis, commodo est. Maecenas sed tristique augue. Phasellus facilisis fringilla sem in viverra. Sed porta in justo vitae dignissim. In cursus imperdiet elementum. Maecenas congue metus aliquam placerat semper. Mauris eu libero nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nam ultrices venenatis nibh, at lacinia nisi lacinia vitae. Quisque eu est scelerisque, mattis sem eu, rhoncus dui. Nulla facilisi. Etiam in quam a tellus mattis condimentum. Nullam facilisis, dolor ac consequat malesuada, diam felis lacinia ante, volutpat ullamcorper orci lacus non orci. Suspendisse sit amet consequat elit, ut vestibulum urna. Nam id dui sem. Suspendisse elementum ac orci vel auctor. Vivamus ornare accumsan sagittis. Nullam vitae est tempor, pretium eros nec, cursus nibh. Vivamus aliquet sodales elit. Proin non semper metus. Maecenas feugiat tincidunt iaculis. Integer lectus nisi, commodo et diam at, mattis varius nisi. Integer ultrices pharetra eleifend. Sed vulputate, ipsum congue ultricies venenatis, justo leo eleifend sem, quis lacinia urna orci in dolor. Etiam condimentum hendrerit sapien, in placerat velit porttitor lobortis. Integer non pellentesque ex. Mauris vestibulum tortor turpis, sed volutpat turpis gravida dapibus. Quisque finibus, purus sit amet aliquam consequat, sem sem ultricies risus, ut dapibus lacus elit non nulla. Mauris nisl justo, consequat et mauris tempus, placerat gravida risus. Maecenas semper vitae enim eu rutrum. Curabitur eget viverra nisl. Aliquam vitae diam risus. Sed nec nisi nec tortor convallis ultricies. Pellentesque lobortis euismod magna et malesuada. Praesent eget mi eros. Ut quis imperdiet odio. Maecenas a fermentum massa, nec semper justo. Integer a massa aliquam, vulputate est a, condimentum neque. Phasellus ligula elit, feugiat eget ante a, porttitor tempus diam. Vestibulum semper ante pretium, interdum elit ac, egestas dolor. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut consequat, nisi nec scelerisque suscipit, libero lectus dictum lectus, quis molestie sem ipsum in nisi. Curabitur finibus purus nec vehicula euismod. Duis in libero hendrerit, congue lacus vel, porta turpis. Aenean volutpat dolor faucibus varius fermentum. Proin nisi neque, condimentum id venenatis ut, fermentum id velit. Etiam pretium sem eget metus congue ultricies. Phasellus laoreet tortor eu lectus consequat viverra. Nulla eget dictum nunc, eu dictum turpis. Morbi sit amet erat et leo malesuada iaculis eget in ipsum. Vivamus eleifend orci at quam dignissim, eget congue lacus faucibus. Sed porta ultrices nibh, vitae efficitur arcu facilisis blandit. Etiam vitae ligula lobortis, tincidunt est quis, eleifend leo. Vestibulum feugiat odio non nisi vehicula dictum. Nam elementum mauris sed tortor faucibus vestibulum. Maecenas nec facilisis ligula. Quisque tellus enim, venenatis sed magna vitae, vehicula auctor orci. Suspendisse fringilla urna mauris, sit amet dictum lorem iaculis ut. Morbi tempus velit a tellus sagittis viverra. Integer ornare pharetra pharetra. Nunc sit amet ex at mi commodo mollis. Sed sed mi feugiat, semper nibh at, semper nisi. Fusce dapibus, nisi et placerat vehicula, nisi nibh maximus lorem, nec porttitor tellus eros eu metus. Proin tortor magna, cursus ultrices eleifend venenatis, tincidunt ut metus. Donec felis arcu, aliquam et odio sed, accumsan mollis nibh. Nulla nisi nunc, lobortis non convallis ac, porttitor non ligula. Suspendisse hendrerit tempor ante in congue. Nunc auctor libero sit amet lobortis efficitur. Suspendisse pretium efficitur finibus. Praesent rutrum justo in magna scelerisque mollis. In tempor sodales efficitur. Suspendisse tempus sagittis quam, fermentum vehicula odio iaculis at. Duis laoreet, neque eu aliquet venenatis, magna nisl sollicitudin risus, eu pulvinar diam ex vitae mauris. Sed eget diam justo. Quisque tristique venenatis justo nec tincidunt. Proin porta nisi nec facilisis iaculis. Ut euismod vel metus eu sodales. Pellentesque quis massa in nunc interdum ornare accumsan ac sapien. Aenean condimentum, erat nec ornare viverra, massa quam vulputate metus, at ultricies metus nunc ac dolor. In lorem nibh, luctus quis consectetur quis, ultrices quis massa. Sed ut vehicula tortor, vel blandit neque. Duis ac semper neque. Cras at faucibus tortor, sed ultricies tellus. Phasellus in lacus leo. Maecenas vehicula eu massa id ullamcorper. Duis a sem felis. Nunc fringilla felis in leo pulvinar, mattis lobortis nunc sollicitudin. Sed ut tincidunt risus. Nunc a viverra libero. Etiam sed libero cursus, porttitor purus et, aliquet nisi. Praesent ac tortor libero. Mauris vestibulum enim non turpis blandit, quis varius libero ultricies. Proin non sapien pellentesque, vulputate magna eget, dictum lacus. Curabitur tincidunt vestibulum nisl, at sodales tellus volutpat id. In nisl enim, accumsan id quam vitae, congue euismod ligula. Sed dictum luctus aliquet. Fusce consectetur porttitor imperdiet. Duis pretium sem sed nisi venenatis consequat. Aenean eget sapien id massa tincidunt dignissim vitae non tortor. Maecenas ac ligula diam. Morbi vitae bibendum turpis, sed rutrum eros. Vivamus ut mi facilisis, rutrum metus porta, condimentum urna. Vestibulum semper sed tellus vitae pellentesque. Sed porttitor nisl non felis semper, laoreet vulputate ipsum tristique. Nullam luctus sit amet orci id consectetur. Sed vel augue nisl. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque neque justo, interdum varius nulla et, aliquet pharetra nibh. Maecenas quis vehicula justo. Curabitur at elit justo. Quisque pharetra sapien vel bibendum mollis. Ut elementum ut ante a ornare. Cras suscipit, neque a suscipit laoreet, libero tellus lacinia nulla, hendrerit iaculis turpis nisi sed neque. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque quis lacus vitae nibh consectetur lobortis. Proin varius fringilla scelerisque. Aliquam ac felis ut leo interdum fermentum. Nam accumsan risus sapien, ac maximus ex tincidunt ut. Nam ultrices et metus ut cursus. Suspendisse tempor erat pharetra nisl placerat, vitae scelerisque nisi lobortis. Suspendisse quis lorem metus. Ut nec dolor magna. Sed sem metus, hendrerit eget posuere sed, efficitur vitae urna. Sed pellentesque eu augue a tristique. Donec lacinia consequat mi non sollicitudin. In scelerisque nisi at eleifend aliquet. Donec tristique dui turpis, id congue est pharetra id. Praesent pretium libero sit amet semper aliquet. Phasellus fringilla ligula id augue accumsan, ac tempor sem consequat. Proin placerat arcu quam, eget feugiat quam dapibus a. Quisque eleifend purus ac erat fringilla laoreet. Ut sem diam, iaculis a lectus vel, volutpat eleifend lorem. Vivamus mi ligula, consectetur ut maximus in, sodales nec sem. Nam ac nulla ornare, interdum lectus sed, porta elit. Pellentesque consectetur dapibus purus. Phasellus lacinia leo at libero tincidunt maximus. Nulla facilisi. Sed feugiat sem id libero lobortis, ut scelerisque odio posuere. Pellentesque id risus nec metus bibendum consectetur. Integer ac sapien eget neque sagittis viverra. Nulla bibendum erat nisl, vitae fringilla lectus cursus ut. Ut est lorem, laoreet hendrerit nulla at, accumsan convallis quam. Praesent euismod nibh ac semper semper. Donec sit amet interdum tellus. Proin ultrices nisi augue. Sed aliquam scelerisque justo eleifend rhoncus. Mauris et leo tortor. Nunc est magna, laoreet in ex ut, sodales cursus ex. Nulla congue libero et diam euismod, ut vehicula enim egestas. Aenean et magna iaculis, placerat magna quis, hendrerit metus. Ut venenatis imperdiet risus a dignissim. Praesent lobortis consequat urna eget varius. Quisque eros nisi, dictum non luctus at, mattis et lorem. Donec elementum neque id massa ultrices, nec auctor purus sollicitudin. Etiam interdum porta massa, ut consectetur tellus lobortis malesuada. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer non ornare ante, eu fermentum dolor. Mauris quis venenatis arcu, eu consequat elit. Phasellus maximus placerat maximus. Ut velit turpis, consequat eu lacus at, hendrerit ultricies augue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Donec non velit sapien. Vivamus sit amet sem finibus, sagittis nunc non, volutpat magna. Vivamus eget dui ut metus efficitur porttitor. Pellentesque semper vitae sem in fermentum. Maecenas sed ex massa. Fusce ac augue nec est iaculis semper. Donec aliquam, neque maximus ultricies facilisis, neque dui eleifend mi, ut tristique sem mi a risus. Quisque ut lorem quis tortor maximus condimentum suscipit nec nunc. Nulla vel enim tempus, posuere augue id, imperdiet nisl. Maecenas semper libero in felis semper, pellentesque ullamcorper nisi mollis. Vestibulum tincidunt lacinia tellus ac congue. Vivamus ultrices nisi sit amet ultricies suscipit. Nulla facilisi. Proin ultricies fermentum risus, in aliquet ligula lacinia at. Aliquam pretium faucibus erat ut varius. Morbi quam urna, mollis a velit sit amet, bibendum tempus dolor. Etiam ac tempus sapien. Etiam in rutrum purus. Nunc nec fermentum metus, sed placerat justo. Ut leo sapien, pellentesque at pulvinar vitae, volutpat ac elit. Phasellus non dolor consequat, tempor leo non, dictum nibh. Suspendisse scelerisque nisl quis sagittis facilisis. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean libero eros, rutrum eu lorem eu, suscipit elementum justo. Cras viverra blandit dui in consectetur. Praesent erat est, molestie ut leo nec, efficitur placerat mauris. Nunc sollicitudin accumsan justo, sit amet interdum massa faucibus a. Pellentesque ac tempor odio. Fusce rutrum sagittis quam ut tincidunt. Aliquam consectetur luctus justo sit amet porttitor. Vivamus blandit porttitor massa, et ullamcorper lorem porttitor at. In tempus euismod est, ac ullamcorper mauris fermentum iaculis. Integer tincidunt sem id mauris tempus luctus. Phasellus sed egestas lacus. Curabitur luctus dolor arcu, aliquam convallis ligula dignissim sed. Phasellus scelerisque diam nec euismod finibus. Mauris feugiat, ipsum in condimentum blandit, justo orci ultrices neque, sed rutrum ligula magna ut nisl. Pellentesque tempus tincidunt turpis in mattis. Duis ut condimentum massa, ac cursus orci. Ut vel orci eget arcu bibendum mattis id sed felis. Morbi nisi risus, efficitur vel accumsan eget, feugiat sed ipsum. Vestibulum sit amet suscipit erat. Proin dignissim mauris eu varius suscipit. Sed consequat ex eros, eget fermentum enim interdum vel. Ut ullamcorper auctor est sed auctor. Donec lacinia turpis mauris, eget lacinia diam varius non. Vivamus vestibulum ullamcorper vestibulum. Cras quis quam at ex ultricies ornare vel eu."}get words(){return this.text.toLowerCase().split(/\W+/)}addDays(e=new Date,i=0){return new Date(Date.parse(e)+864e5*i)}addHours(e=new Date,i=0){return new Date(Date.parse(e)+36e5*i)}addMinutes(e=new Date,i=0){return new Date(Date.parse(e)+6e4*i)}addSeconds(e=new Date,i=0){return new Date(Date.parse(e)+1e3*i)}addWeeks(e=new Date,i=0){return new Date(Date.parse(e)+6048e5*i)}addYears(e=new Date,i=0){return new Date(Date.parse(e)+31536e6*i)}camelToKebab(e){return e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():void 0}dateFormat(e,i){return"string"==typeof e&&(e=new Date(e)),e?"long"===i?e.toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):"short"===i?e.toLocaleDateString(void 0,{month:"long",day:"numeric"}):e.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):""}draw(e=[],i=0,t=i){let a=t-i,s=Math.random()*a,u=i+Math.floor(s),r=Math.max(0,u);return this.shuffle(e).slice(0,r)}kebabToCamel(e){return e?e.replace(/-./g,(e=>e.toUpperCase()[1])):void 0}randomArray(e={},i=1,t=4){let a=[];for(let s=this.randomNumber(i,t,1);s>0;s--)a.push(this.randomType(e));return a}randomAspect(e=200,i=1e3,t=200,a=1e3){return`${this.randomNumber(e,i,1)}/${this.randomNumber(t,a,1)}`}randomBool(){return Math.random()>=.5}randomColor(){return this.randomOption(this.colors)}randomDate(e=Date.now(),i="years",t=-3,a=3){return e+("milliseconds"===i?this.randomNumber(t,a):"seconds"===i?this.randomNumber(1e3*t,1e3*a):"minutes"===i?this.randomNumber(6e4*t,6e4*a):"hours"===i?this.randomNumber(36e5*t,36e5*a):"days"===i?this.randomNumber(864e5*t,864e5*a):"weeks"===i?this.randomNumber(6048e5*t,6048e5*a):this.randomNumber(31536e6*t,31536e6*a))}randomHex(){return`#${[0,0,0].map((e=>this.randomNumber(e,255).toString(16))).map((e=>e.length<2?`0${e}`:`${e}`)).join("")}`}randomIcon(e=!1){let i=this.randomOption(this.icons);return e?this.randomOption([...i,""]):i}randomLink(e,i=1,t=4){let a=this.draw(this.words,i,t),s=e||this.randomOption(["url","pdf"]),u=this.randomOption(this.words),r="url"!==s?`.${s}`:"";return{url:`http://${u}.com/${a.join("/")}${r}`,text:a.length>0?a.join(" "):u,type:s}}randomFlickr(e=this.randomAspect(),i=[],t=!1,a=-1){return`https://loremflickr.com/${e}${0===i.length?"":`/${i.join(",")}${t?"/all":""}`}${a>-1?`?random=${a}`:""}`}randomImage(e=this.randomAspect(),i,t,a){return t&&["man","woman","person"].includes(t)?this.randomProfileImage(e,t):void 0===a?this.randomPlaceImg(e,i,t):"any"===t?this.randomPicsum(e,i,void 0,a):this.randomFlickr(e,[t],!1,a)}randomImageData(e=this.randomAspect(),i,t,a){return{src:this.randomImage(e,i,t,a),alt:`Random ${t?`${t} `:""}image${a?` #${a}`:""}`,longdesc:`This is a long description for image${a?` #${a}`:""}. ${this.randomParagraph(1,5)}`}}randomKitten(e=this.randomAspect(),i){return void 0===i&&(i=this.randomWeightedOption([{value:!1,weight:3},{value:!0,weight:1}])),`//placekitten.com${i?"/g":""}/${e}`}randomNumber(e=0,i=100+e,t=1){return e+Math.floor(Math.random()*Math.floor((i-e)/t))*t}randomObject(e={}){let i={};return Object.keys(e).forEach((t=>i[t]=this.randomType(e[t]))),i}randomOption(e=[]){return e.length>0?e[Math.floor(Math.random()*Math.floor(e.length))]:void 0}randomPicsum(e=this.randomAspect(),i,t=0,a){let s=i||this.randomWeightedOption([{value:!1,weight:3},{value:!0,weight:1}])?["greyscale"]:[];return t>0&&s.push(`blur=${t}`),`https://picsum.photos/${a>-1?`id/${a}`:""}/${e}/${0==s.length?"":`?${s.join("&")}`}`}randomPlaceImg(e=this.randomAspect(),i,t="any"){return`//placeimg.com/${e}/${t}${"greyscale"===(i=i||this.randomWeightedOption([{value:"",weight:12},{value:"greyscale",weight:4},{value:"sepia",weight:1}]))?"/greyscale":"sepia"===i?"/sepia":""}`}randomProfileImage(e=this.randomAspect(),i,t){let a=e.split("/"),s=parseInt(a[0])*parseInt(a[1]),u=s<250?"thumb/":s<640?"med/":"",r=Math.random()<.5?"men":"women";return`https://randomuser.me/api/portraits/${u}${"man"===i?"men":"woman"===i?"women":r}/${t||this.randomNumber(1,90)}.jpg`}randomParagraph(e=3,i=7,t=3,a=10){let s=[];for(let u=this.randomNumber(e,i);u>0;u--)s.push(this.randomSentence(t,a));return`${s.join(" ")}`}randomPassage(e=2,i=5,t=2,a=5,s=3,u=10){let r=[];for(let n=this.randomNumber(e,i);n>0;n--)r.push(`

    ${this.randomParagraph(t,a,s,u)}

    `);return r.join("")}randomPhrase(e=1,i=5,t=!0,a=!1){let s=[],u=this.randomNumber(e,i),r=a&&u>1?this.randomNumber(1,u-1):-1;for(let e=0;e<=u;e++){let i=this.randomWord();s.push(e==r?`${i}:`:i)}return t?this.titleCase(s.join(" ")):s.join(" ")}randomSentence(e=3,i=15){let t=[],a=this.randomWeightedOption([{value:".",weight:10},{value:"?",weight:3},{value:"!",weight:1}]);for(let a=this.randomNumber(e,i);a>0;a--)t.push(this.randomWord());return t[0]&&(t[0]=this.titleCase(t[0])),`${t.join(" ")}${a}`}randomType(e){let i;if(e.type)switch(e.type){case"array":i=this.randomArray(e.children,e.min,e.max);break;case"boolean":i=this.randomBool();break;case"color":i=this.randomColor();break;case"data":return e.data;case"date":i=this.randomDate(e.start,e.units,e.min,e.max);break;case"hex":i=this.randomHex();break;case"icon":i=this.randomIcon(e.includeNull);break;case"image":i=this.randomImage(e.aspect,e.greyscale,e.topic,e.multiple);break;case"imageData":i=this.randomImageData(e.aspect,e.greyscale,e.topic,e.multiple);break;case"letter":i=this.randomOption("abcdefghijklmnopqrstuvwxyz");break;case"link":i=this.randomLink(e.filetype,e.minPath,e.maxPath);break;case"number":i=this.randomNumber(e.min,e.max,e.step);break;case"object":i=this.randomObject(e.schema);break;case"option":return e.weightedOptions?this.randomWeightedOption(e.weightedOptions):this.randomOption(e.options);case"paragraph":i=this.randomParagraph(e.min,e.max,e.wordMinPerSent,e.wordMaxPerSent);break;case"sentence":i=this.randomSentence(e.min,e.max);break;default:i=this.randomWord()}return i}randomWeightedOption(e=[]){return this.randomOption(e.map((e=>{let i=[];for(let t=0;tMath.random()-Math.random()))}sortDates(e,i=!1){return e.sort(((e,t)=>{let a="string"==typeof e.date?Date.parse(e.date):e.date,s="string"==typeof t.date?Date.parse(t.date):t.date;return i?a-s:s-a}))}titleCase(e){return e.toLowerCase().split(" ").map((e=>e.replace(e[0],e[0].toUpperCase()))).join(" ")}}}; \ No newline at end of file +import{SimpleColors as e}from"../../simple-colors/simple-colors.js";import{SimpleIconsetDemo as i}from"../../simple-icon/lib/simple-iconset-demo.js";import{SimpleIcon as t}from"../../simple-icon/simple-icon.js";import{SimpleIconLite as a}from"../../simple-icon/lib/simple-icon-lite.js";import{SimpleIconIconsetsManifest as s}from"../../simple-icon/lib/simple-iconset-manifest.js";import{HaxIconsetManifest as u}from"../../hax-iconset/lib/hax-iconset-manifest.js";export const LoremDataBehaviors=function(e){return class extends e{static get properties(){return{__demo:{type:Object}}}constructor(){super()}get colors(){let e=globalThis.SimpleColorsSharedStyles.requestAvailability();return!(!e||!e.colors)&&Object.keys(e.colors)}get icons(){return[...s||[],...u||[]].map((e=>((e||{}).icons||[]).map((i=>"icons"==e.name?i:`${e.name}:${i}`)))).flat()}get text(){return"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed consectetur at erat eu egestas. Cras porta volutpat vestibulum. Vestibulum eu quam fermentum, lobortis purus at, mattis massa. Sed eget velit rhoncus, ultricies metus eu, tincidunt justo. Ut sit amet congue justo, ac auctor mi. Etiam ut urna laoreet eros sodales commodo. Sed laoreet tortor ligula, vitae condimentum mi sagittis vitae. Nullam volutpat sodales ipsum vel dictum. Aenean dapibus arcu sit amet tellus placerat scelerisque sed nec dui. Maecenas laoreet maximus magna, quis consectetur massa tristique ut. Nunc rutrum elit in tincidunt commodo. Donec nec varius velit. Duis ut arcu pulvinar, venenatis felis pellentesque, egestas ante. Etiam urna dui, vestibulum at diam eget, mattis gravida ipsum. Nulla auctor, neque a ultricies laoreet, nulla diam laoreet nisl, nec rutrum ex lorem a purus. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse gravida ante eu nisi viverra, ac porta risus laoreet. Nunc a justo vel nisl accumsan placerat eu eu libero. Donec non augue sit amet nisl pulvinar bibendum vulputate sit amet metus. Maecenas vel condimentum nulla, at elementum neque. Fusce ac dictum augue. Suspendisse potenti. Nullam eros dui, vehicula et imperdiet vel, vestibulum vel tortor. Nullam ac nunc ante. Pellentesque condimentum nec dui sed varius. Donec porttitor leo id lectus faucibus, in fermentum purus lacinia. Pellentesque vel tellus ut lectus tincidunt pharetra. Quisque elementum elit mattis mi dignissim, eleifend eleifend risus faucibus. Nullam interdum pulvinar tempor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam semper, diam sit amet condimentum interdum, dolor risus ultrices dui, et egestas ex magna at odio. Aliquam sed vulputate turpis. Integer suscipit laoreet lectus, in lobortis sapien. Ut aliquam, dui ac efficitur ullamcorper, sapien augue euismod sapien, eget consectetur odio lectus ac elit. Pellentesque varius metus vel placerat rutrum. Duis placerat diam ut tortor vestibulum, eu ultrices risus gravida. Ut vel auctor dolor. Donec sit amet ornare ipsum, nec pulvinar neque. Pellentesque sagittis orci bibendum, laoreet elit eget, vulputate ante. Donec accumsan in elit sed sollicitudin. Fusce pellentesque velit est, id vestibulum orci consectetur ac. In libero odio, vehicula non felis eu, scelerisque rhoncus arcu. Phasellus id tristique justo. Sed scelerisque quam velit, at porta leo accumsan in. Vestibulum non enim lacinia odio venenatis vehicula. Quisque ultrices augue nulla. Sed tempus porta ipsum, eu rhoncus ligula feugiat ac. Aenean et sollicitudin sem, a pharetra mi. Sed convallis velit in est molestie interdum. Fusce bibendum volutpat sapien vitae faucibus. Vivamus nec neque pellentesque, euismod elit quis, commodo est. Maecenas sed tristique augue. Phasellus facilisis fringilla sem in viverra. Sed porta in justo vitae dignissim. In cursus imperdiet elementum. Maecenas congue metus aliquam placerat semper. Mauris eu libero nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nam ultrices venenatis nibh, at lacinia nisi lacinia vitae. Quisque eu est scelerisque, mattis sem eu, rhoncus dui. Nulla facilisi. Etiam in quam a tellus mattis condimentum. Nullam facilisis, dolor ac consequat malesuada, diam felis lacinia ante, volutpat ullamcorper orci lacus non orci. Suspendisse sit amet consequat elit, ut vestibulum urna. Nam id dui sem. Suspendisse elementum ac orci vel auctor. Vivamus ornare accumsan sagittis. Nullam vitae est tempor, pretium eros nec, cursus nibh. Vivamus aliquet sodales elit. Proin non semper metus. Maecenas feugiat tincidunt iaculis. Integer lectus nisi, commodo et diam at, mattis varius nisi. Integer ultrices pharetra eleifend. Sed vulputate, ipsum congue ultricies venenatis, justo leo eleifend sem, quis lacinia urna orci in dolor. Etiam condimentum hendrerit sapien, in placerat velit porttitor lobortis. Integer non pellentesque ex. Mauris vestibulum tortor turpis, sed volutpat turpis gravida dapibus. Quisque finibus, purus sit amet aliquam consequat, sem sem ultricies risus, ut dapibus lacus elit non nulla. Mauris nisl justo, consequat et mauris tempus, placerat gravida risus. Maecenas semper vitae enim eu rutrum. Curabitur eget viverra nisl. Aliquam vitae diam risus. Sed nec nisi nec tortor convallis ultricies. Pellentesque lobortis euismod magna et malesuada. Praesent eget mi eros. Ut quis imperdiet odio. Maecenas a fermentum massa, nec semper justo. Integer a massa aliquam, vulputate est a, condimentum neque. Phasellus ligula elit, feugiat eget ante a, porttitor tempus diam. Vestibulum semper ante pretium, interdum elit ac, egestas dolor. Interdum et malesuada fames ac ante ipsum primis in faucibus. Ut consequat, nisi nec scelerisque suscipit, libero lectus dictum lectus, quis molestie sem ipsum in nisi. Curabitur finibus purus nec vehicula euismod. Duis in libero hendrerit, congue lacus vel, porta turpis. Aenean volutpat dolor faucibus varius fermentum. Proin nisi neque, condimentum id venenatis ut, fermentum id velit. Etiam pretium sem eget metus congue ultricies. Phasellus laoreet tortor eu lectus consequat viverra. Nulla eget dictum nunc, eu dictum turpis. Morbi sit amet erat et leo malesuada iaculis eget in ipsum. Vivamus eleifend orci at quam dignissim, eget congue lacus faucibus. Sed porta ultrices nibh, vitae efficitur arcu facilisis blandit. Etiam vitae ligula lobortis, tincidunt est quis, eleifend leo. Vestibulum feugiat odio non nisi vehicula dictum. Nam elementum mauris sed tortor faucibus vestibulum. Maecenas nec facilisis ligula. Quisque tellus enim, venenatis sed magna vitae, vehicula auctor orci. Suspendisse fringilla urna mauris, sit amet dictum lorem iaculis ut. Morbi tempus velit a tellus sagittis viverra. Integer ornare pharetra pharetra. Nunc sit amet ex at mi commodo mollis. Sed sed mi feugiat, semper nibh at, semper nisi. Fusce dapibus, nisi et placerat vehicula, nisi nibh maximus lorem, nec porttitor tellus eros eu metus. Proin tortor magna, cursus ultrices eleifend venenatis, tincidunt ut metus. Donec felis arcu, aliquam et odio sed, accumsan mollis nibh. Nulla nisi nunc, lobortis non convallis ac, porttitor non ligula. Suspendisse hendrerit tempor ante in congue. Nunc auctor libero sit amet lobortis efficitur. Suspendisse pretium efficitur finibus. Praesent rutrum justo in magna scelerisque mollis. In tempor sodales efficitur. Suspendisse tempus sagittis quam, fermentum vehicula odio iaculis at. Duis laoreet, neque eu aliquet venenatis, magna nisl sollicitudin risus, eu pulvinar diam ex vitae mauris. Sed eget diam justo. Quisque tristique venenatis justo nec tincidunt. Proin porta nisi nec facilisis iaculis. Ut euismod vel metus eu sodales. Pellentesque quis massa in nunc interdum ornare accumsan ac sapien. Aenean condimentum, erat nec ornare viverra, massa quam vulputate metus, at ultricies metus nunc ac dolor. In lorem nibh, luctus quis consectetur quis, ultrices quis massa. Sed ut vehicula tortor, vel blandit neque. Duis ac semper neque. Cras at faucibus tortor, sed ultricies tellus. Phasellus in lacus leo. Maecenas vehicula eu massa id ullamcorper. Duis a sem felis. Nunc fringilla felis in leo pulvinar, mattis lobortis nunc sollicitudin. Sed ut tincidunt risus. Nunc a viverra libero. Etiam sed libero cursus, porttitor purus et, aliquet nisi. Praesent ac tortor libero. Mauris vestibulum enim non turpis blandit, quis varius libero ultricies. Proin non sapien pellentesque, vulputate magna eget, dictum lacus. Curabitur tincidunt vestibulum nisl, at sodales tellus volutpat id. In nisl enim, accumsan id quam vitae, congue euismod ligula. Sed dictum luctus aliquet. Fusce consectetur porttitor imperdiet. Duis pretium sem sed nisi venenatis consequat. Aenean eget sapien id massa tincidunt dignissim vitae non tortor. Maecenas ac ligula diam. Morbi vitae bibendum turpis, sed rutrum eros. Vivamus ut mi facilisis, rutrum metus porta, condimentum urna. Vestibulum semper sed tellus vitae pellentesque. Sed porttitor nisl non felis semper, laoreet vulputate ipsum tristique. Nullam luctus sit amet orci id consectetur. Sed vel augue nisl. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque neque justo, interdum varius nulla et, aliquet pharetra nibh. Maecenas quis vehicula justo. Curabitur at elit justo. Quisque pharetra sapien vel bibendum mollis. Ut elementum ut ante a ornare. Cras suscipit, neque a suscipit laoreet, libero tellus lacinia nulla, hendrerit iaculis turpis nisi sed neque. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque quis lacus vitae nibh consectetur lobortis. Proin varius fringilla scelerisque. Aliquam ac felis ut leo interdum fermentum. Nam accumsan risus sapien, ac maximus ex tincidunt ut. Nam ultrices et metus ut cursus. Suspendisse tempor erat pharetra nisl placerat, vitae scelerisque nisi lobortis. Suspendisse quis lorem metus. Ut nec dolor magna. Sed sem metus, hendrerit eget posuere sed, efficitur vitae urna. Sed pellentesque eu augue a tristique. Donec lacinia consequat mi non sollicitudin. In scelerisque nisi at eleifend aliquet. Donec tristique dui turpis, id congue est pharetra id. Praesent pretium libero sit amet semper aliquet. Phasellus fringilla ligula id augue accumsan, ac tempor sem consequat. Proin placerat arcu quam, eget feugiat quam dapibus a. Quisque eleifend purus ac erat fringilla laoreet. Ut sem diam, iaculis a lectus vel, volutpat eleifend lorem. Vivamus mi ligula, consectetur ut maximus in, sodales nec sem. Nam ac nulla ornare, interdum lectus sed, porta elit. Pellentesque consectetur dapibus purus. Phasellus lacinia leo at libero tincidunt maximus. Nulla facilisi. Sed feugiat sem id libero lobortis, ut scelerisque odio posuere. Pellentesque id risus nec metus bibendum consectetur. Integer ac sapien eget neque sagittis viverra. Nulla bibendum erat nisl, vitae fringilla lectus cursus ut. Ut est lorem, laoreet hendrerit nulla at, accumsan convallis quam. Praesent euismod nibh ac semper semper. Donec sit amet interdum tellus. Proin ultrices nisi augue. Sed aliquam scelerisque justo eleifend rhoncus. Mauris et leo tortor. Nunc est magna, laoreet in ex ut, sodales cursus ex. Nulla congue libero et diam euismod, ut vehicula enim egestas. Aenean et magna iaculis, placerat magna quis, hendrerit metus. Ut venenatis imperdiet risus a dignissim. Praesent lobortis consequat urna eget varius. Quisque eros nisi, dictum non luctus at, mattis et lorem. Donec elementum neque id massa ultrices, nec auctor purus sollicitudin. Etiam interdum porta massa, ut consectetur tellus lobortis malesuada. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer non ornare ante, eu fermentum dolor. Mauris quis venenatis arcu, eu consequat elit. Phasellus maximus placerat maximus. Ut velit turpis, consequat eu lacus at, hendrerit ultricies augue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Donec non velit sapien. Vivamus sit amet sem finibus, sagittis nunc non, volutpat magna. Vivamus eget dui ut metus efficitur porttitor. Pellentesque semper vitae sem in fermentum. Maecenas sed ex massa. Fusce ac augue nec est iaculis semper. Donec aliquam, neque maximus ultricies facilisis, neque dui eleifend mi, ut tristique sem mi a risus. Quisque ut lorem quis tortor maximus condimentum suscipit nec nunc. Nulla vel enim tempus, posuere augue id, imperdiet nisl. Maecenas semper libero in felis semper, pellentesque ullamcorper nisi mollis. Vestibulum tincidunt lacinia tellus ac congue. Vivamus ultrices nisi sit amet ultricies suscipit. Nulla facilisi. Proin ultricies fermentum risus, in aliquet ligula lacinia at. Aliquam pretium faucibus erat ut varius. Morbi quam urna, mollis a velit sit amet, bibendum tempus dolor. Etiam ac tempus sapien. Etiam in rutrum purus. Nunc nec fermentum metus, sed placerat justo. Ut leo sapien, pellentesque at pulvinar vitae, volutpat ac elit. Phasellus non dolor consequat, tempor leo non, dictum nibh. Suspendisse scelerisque nisl quis sagittis facilisis. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean libero eros, rutrum eu lorem eu, suscipit elementum justo. Cras viverra blandit dui in consectetur. Praesent erat est, molestie ut leo nec, efficitur placerat mauris. Nunc sollicitudin accumsan justo, sit amet interdum massa faucibus a. Pellentesque ac tempor odio. Fusce rutrum sagittis quam ut tincidunt. Aliquam consectetur luctus justo sit amet porttitor. Vivamus blandit porttitor massa, et ullamcorper lorem porttitor at. In tempus euismod est, ac ullamcorper mauris fermentum iaculis. Integer tincidunt sem id mauris tempus luctus. Phasellus sed egestas lacus. Curabitur luctus dolor arcu, aliquam convallis ligula dignissim sed. Phasellus scelerisque diam nec euismod finibus. Mauris feugiat, ipsum in condimentum blandit, justo orci ultrices neque, sed rutrum ligula magna ut nisl. Pellentesque tempus tincidunt turpis in mattis. Duis ut condimentum massa, ac cursus orci. Ut vel orci eget arcu bibendum mattis id sed felis. Morbi nisi risus, efficitur vel accumsan eget, feugiat sed ipsum. Vestibulum sit amet suscipit erat. Proin dignissim mauris eu varius suscipit. Sed consequat ex eros, eget fermentum enim interdum vel. Ut ullamcorper auctor est sed auctor. Donec lacinia turpis mauris, eget lacinia diam varius non. Vivamus vestibulum ullamcorper vestibulum. Cras quis quam at ex ultricies ornare vel eu."}get words(){return this.text.toLowerCase().split(/\W+/)}addDays(e=new Date,i=0){return new Date(Date.parse(e)+864e5*i)}addHours(e=new Date,i=0){return new Date(Date.parse(e)+36e5*i)}addMinutes(e=new Date,i=0){return new Date(Date.parse(e)+6e4*i)}addSeconds(e=new Date,i=0){return new Date(Date.parse(e)+1e3*i)}addWeeks(e=new Date,i=0){return new Date(Date.parse(e)+6048e5*i)}addYears(e=new Date,i=0){return new Date(Date.parse(e)+31536e6*i)}camelToKebab(e){return e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():void 0}dateFormat(e,i){return"string"==typeof e&&(e=new Date(e)),e?"long"===i?e.toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):"short"===i?e.toLocaleDateString(void 0,{month:"long",day:"numeric"}):e.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):""}draw(e=[],i=0,t=i){let a=t-i,s=Math.random()*a,u=i+Math.floor(s),r=Math.max(0,u);return this.shuffle(e).slice(0,r)}kebabToCamel(e){return e?e.replace(/-./g,(e=>e.toUpperCase()[1])):void 0}randomArray(e={},i=1,t=4){let a=[];for(let s=this.randomNumber(i,t,1);s>0;s--)a.push(this.randomType(e));return a}randomAspect(e=200,i=1e3,t=200,a=1e3){return`${this.randomNumber(e,i,1)}/${this.randomNumber(t,a,1)}`}randomBool(){return Math.random()>=.5}randomColor(){return this.randomOption(this.colors)}randomDate(e=Date.now(),i="years",t=-3,a=3){return e+("milliseconds"===i?this.randomNumber(t,a):"seconds"===i?this.randomNumber(1e3*t,1e3*a):"minutes"===i?this.randomNumber(6e4*t,6e4*a):"hours"===i?this.randomNumber(36e5*t,36e5*a):"days"===i?this.randomNumber(864e5*t,864e5*a):"weeks"===i?this.randomNumber(6048e5*t,6048e5*a):this.randomNumber(31536e6*t,31536e6*a))}randomHex(){return`#${[0,0,0].map((e=>this.randomNumber(e,255).toString(16))).map((e=>e.length<2?`0${e}`:`${e}`)).join("")}`}randomIcon(e=!1){let i=this.randomOption(this.icons);return e?this.randomOption([...i,""]):i}randomLink(e,i=1,t=4){let a=this.draw(this.words,i,t),s=e||this.randomOption(["url","pdf"]),u=this.randomOption(this.words),r="url"!==s?`.${s}`:"";return{url:`http://${u}.com/${a.join("/")}${r}`,text:a.length>0?a.join(" "):u,type:s}}randomFlickr(e=this.randomAspect(),i=[],t=!1,a=-1){return`https://loremflickr.com/${e}${0===i.length?"":`/${i.join(",")}${t?"/all":""}`}${a>-1?`?random=${a}`:""}`}randomImage(e=this.randomAspect(),i,t,a){return t&&["man","woman","person"].includes(t)?this.randomProfileImage(e,t):void 0===a?this.randomPlaceImg(e,i,t):"any"===t?this.randomPicsum(e,i,void 0,a):this.randomFlickr(e,[t],!1,a)}randomImageData(e=this.randomAspect(),i,t,a){return{src:this.randomImage(e,i,t,a),alt:`Random ${t?`${t} `:""}image${a?` #${a}`:""}`,longdesc:`This is a long description for image${a?` #${a}`:""}. ${this.randomParagraph(1,5)}`}}randomKitten(e=this.randomAspect(),i){return`https://placehold.co/${e}`}randomNumber(e=0,i=100+e,t=1){return e+Math.floor(Math.random()*Math.floor((i-e)/t))*t}randomObject(e={}){let i={};return Object.keys(e).forEach((t=>i[t]=this.randomType(e[t]))),i}randomOption(e=[]){return e.length>0?e[Math.floor(Math.random()*Math.floor(e.length))]:void 0}randomPicsum(e=this.randomAspect(),i,t=0,a){let s=i||this.randomWeightedOption([{value:!1,weight:3},{value:!0,weight:1}])?["greyscale"]:[];return t>0&&s.push(`blur=${t}`),`https://picsum.photos/${a>-1?`id/${a}`:""}/${e}/${0==s.length?"":`?${s.join("&")}`}`}randomPlaceImg(e=this.randomAspect(),i,t="any"){return`//placeimg.com/${e}/${t}${"greyscale"===(i=i||this.randomWeightedOption([{value:"",weight:12},{value:"greyscale",weight:4},{value:"sepia",weight:1}]))?"/greyscale":"sepia"===i?"/sepia":""}`}randomProfileImage(e=this.randomAspect(),i,t){let a=e.split("/"),s=parseInt(a[0])*parseInt(a[1]),u=s<250?"thumb/":s<640?"med/":"",r=Math.random()<.5?"men":"women";return`https://randomuser.me/api/portraits/${u}${"man"===i?"men":"woman"===i?"women":r}/${t||this.randomNumber(1,90)}.jpg`}randomParagraph(e=3,i=7,t=3,a=10){let s=[];for(let u=this.randomNumber(e,i);u>0;u--)s.push(this.randomSentence(t,a));return`${s.join(" ")}`}randomPassage(e=2,i=5,t=2,a=5,s=3,u=10){let r=[];for(let n=this.randomNumber(e,i);n>0;n--)r.push(`

    ${this.randomParagraph(t,a,s,u)}

    `);return r.join("")}randomPhrase(e=1,i=5,t=!0,a=!1){let s=[],u=this.randomNumber(e,i),r=a&&u>1?this.randomNumber(1,u-1):-1;for(let e=0;e<=u;e++){let i=this.randomWord();s.push(e==r?`${i}:`:i)}return t?this.titleCase(s.join(" ")):s.join(" ")}randomSentence(e=3,i=15){let t=[],a=this.randomWeightedOption([{value:".",weight:10},{value:"?",weight:3},{value:"!",weight:1}]);for(let a=this.randomNumber(e,i);a>0;a--)t.push(this.randomWord());return t[0]&&(t[0]=this.titleCase(t[0])),`${t.join(" ")}${a}`}randomType(e){let i;if(e.type)switch(e.type){case"array":i=this.randomArray(e.children,e.min,e.max);break;case"boolean":i=this.randomBool();break;case"color":i=this.randomColor();break;case"data":return e.data;case"date":i=this.randomDate(e.start,e.units,e.min,e.max);break;case"hex":i=this.randomHex();break;case"icon":i=this.randomIcon(e.includeNull);break;case"image":i=this.randomImage(e.aspect,e.greyscale,e.topic,e.multiple);break;case"imageData":i=this.randomImageData(e.aspect,e.greyscale,e.topic,e.multiple);break;case"letter":i=this.randomOption("abcdefghijklmnopqrstuvwxyz");break;case"link":i=this.randomLink(e.filetype,e.minPath,e.maxPath);break;case"number":i=this.randomNumber(e.min,e.max,e.step);break;case"object":i=this.randomObject(e.schema);break;case"option":return e.weightedOptions?this.randomWeightedOption(e.weightedOptions):this.randomOption(e.options);case"paragraph":i=this.randomParagraph(e.min,e.max,e.wordMinPerSent,e.wordMaxPerSent);break;case"sentence":i=this.randomSentence(e.min,e.max);break;default:i=this.randomWord()}return i}randomWeightedOption(e=[]){return this.randomOption(e.map((e=>{let i=[];for(let t=0;tMath.random()-Math.random()))}sortDates(e,i=!1){return e.sort(((e,t)=>{let a="string"==typeof e.date?Date.parse(e.date):e.date,s="string"==typeof t.date?Date.parse(t.date):t.date;return i?a-s:s-a}))}titleCase(e){return e.toLowerCase().split(" ").map((e=>e.replace(e[0],e[0].toUpperCase()))).join(" ")}}}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/lorem-data/lorem-data.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/lorem-data/lorem-data.js index 8f6b7f5c..c302d2f4 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/lorem-data/lorem-data.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/lorem-data/lorem-data.js @@ -21,4 +21,4 @@ import{LitElement as e,html as t,css as a}from"../../lit/index.js";import{LoremD

    `))} - `}saveAll(){this.shadowRoot&&this.shadowRoot.querySelectorAll("a")&&confirm(`Save the following: ${Object.keys(this.schemas).join(", ")}?`)&&this.shadowRoot.querySelectorAll("a").forEach((e=>e.click()))}getJson(e){return JSON.stringify(this.randomType(e))}saveDataUrl(e){let t=this.getJson(e),a=new Blob([t],{type:"octet/stream"});return globalThis.URL.createObjectURL(a)}get data(){let e={};return Object.keys(this.schemas||[]).forEach((t=>e[t]=this.randomType(this.schemas[t]))),e}get colors(){let e=globalThis.SimpleColorsSharedStyles.requestAvailability();return!(!e||!e.colors)&&Object.keys(e.colors)}filterQuery(e,t){return e.filter(record,(e=>t(record,e)))}addDays(e=new Date,t=0){return new Date(Date.parse(e)+864e5*t)}addHours(e=new Date,t=0){return new Date(Date.parse(e)+36e5*t)}addMinutes(e=new Date,t=0){return new Date(Date.parse(e)+6e4*t)}addSeconds(e=new Date,t=0){return new Date(Date.parse(e)+1e3*t)}addWeeks(e=new Date,t=0){return new Date(Date.parse(e)+6048e5*t)}addYears(e=new Date,t=0){return new Date(Date.parse(e)+31536e6*t)}dateFormat(e,t){return"string"==typeof e&&(e=new Date(e)),e?"long"===t?e.toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):"short"===t?e.toLocaleDateString(void 0,{month:"long",day:"numeric"}):e.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):""}draw(e=[],t=0,a=t){let r=a-t,o=Math.random()*r,n=t+Math.floor(o),s=Math.max(0,n);return this.shuffle(e).slice(0,s)}randomArray(e={},t=1,a=4){let r=[];for(let o=this.randomNumber(t,a,1);o>0;o--)r.push(this.randomType(e));return r}randomAspect(e=200,t=1e3,a=200,r=1e3){return`${this.randomNumber(e,t,1)}/${this.randomNumber(a,r,1)}`}randomBool(){return Math.random()>=.5}randomColor(){return this.randomOption(this.colors)}randomDate(e=Date.now(),t="years",a=-3,r=3){return e+("milliseconds"===t?this.randomNumber(a,r):"seconds"===t?this.randomNumber(1e3*a,1e3*r):"minutes"===t?this.randomNumber(6e4*a,6e4*r):"hours"===t?this.randomNumber(36e5*a,36e5*r):"days"===t?this.randomNumber(864e5*a,864e5*r):"weeks"===t?this.randomNumber(6048e5*a,6048e5*r):this.randomNumber(31536e6*a,31536e6*r))}randomHex(){return`#${[0,0,0].map((e=>this.randomNumber(e,255).toString(16))).map((e=>e.length<2?`0${e}`:`${e}`)).join("")}`}randomIcon(e=!1){let t=this.randomOption(this.icons);return e?this.randomOption([...t,""]):t}randomPlaceImg(e,t,a="any"){return t=t||this.randomWeightedOption([{value:"",weight:12},{value:"greyscale",weight:4},{value:"sepia",weight:1}]),`//placeimg.com/${e=e||this.randomAspect()}/${a}${"greyscale"===t?"/greyscale":"sepia"===t?"/sepia":""}`}randomPicsum(e,t,a=0,r){let o=t||this.randomWeightedOption([{value:!1,weight:3},{value:!0,weight:1}])?["greyscale"]:[];return a>0&&o.push(`blur=${a}`),`https://picsum.photos/${r>-1?`id/${r}`:""}/${e=e||this.randomAspect()}/${0==o.length?"":`?${o.join("&")}`}`}randomKitten(e,t){return void 0===t&&(t=this.randomWeightedOption([{value:!1,weight:3},{value:!0,weight:1}])),`//placekitten.com${t?"/g":""}/${e=e||this.randomAspect()}`}randomFlickr(e,t=[],a=!1,r=-1){return`https://loremflickr.com/${e=e||this.randomAspect()}${0===t.length?"":`/${t.join(",")}${a?"/all":""}`}${r>-1?`?random=${r}`:""}`}randomImage(e,t,a,r){return a&&["man","woman","person"].includes(a)?this.randomProfileImage(e,a):void 0===r?this.randomPlaceImg(e,t,a):"any"===a?this.randomPicsum(e,t,void 0,r):this.randomFlickr(e,[a],!1,r)}randomImageData(e,t,a,r){return{src:this.randomImage(e,t,a,r),alt:`Random ${a?`${a} `:""}image${r?` #${r}`:""}`,longdesc:`This is a long description for image${r?` #${r}`:""}. ${this.randomParagraph(1,5)}`}}randomProfileImage(e,t,a){let r=e.split("/"),o=parseInt(r[0])*parseInt(r[1]),n=o<250?"thumb/":o<640?"med/":"",s=Math.random()<.5?"men":"women";return`https://randomuser.me/api/portraits/${n}${"man"===t?"men":"woman"===t?"women":s}/${a||this.randomNumber(1,90)}.jpg`}randomLink(e,t=1,a=4){let r=this.draw(this.words,t,a),o=e||this.randomOption(["url","pdf"]),n=this.randomOption(this.words),s="url"!==o?`.${o}`:"";return{url:`http://${n}.com/${r.join("/")}${s}`,text:r.length>0?r.join(" "):n,type:o}}randomNumber(e=0,t=100+e,a=1){return e+Math.floor(Math.random()*Math.floor((t-e)/a))*a}randomObject(e={}){let t={};return Object.keys(e).forEach((a=>t[a]=this.randomType(e[a]))),t}randomOption(e=[]){return e.length>0?e[Math.floor(Math.random()*Math.floor(e.length))]:void 0}randomParagraph(e=3,t=7,a,r){let o=[];for(let n=this.randomNumber(e,t);n>0;n--)o.push(this.randomSentence(a,r));return`${o.join(" ")}`}randomSentence(e=3,t=15){let a=[],r=this.randomWeightedOption([{value:".",weight:10},{value:"?",weight:3},{value:"!",weight:1}]);for(let r=this.randomNumber(e,t);r>0;r--)a.push(this.randomWord());return a[0]&&(a[0]=this.titleCase(a[0])),`${a.join(" ")}${r}`}randomType(e){let t;if(e.type)switch(e.type){case"array":t=this.randomArray(e.children,e.min,e.max);break;case"boolean":t=this.randomBool();break;case"color":t=this.randomColor();break;case"data":return e.data;case"date":t=this.randomDate(e.start,e.units,e.min,e.max);break;case"hex":t=this.randomHex();break;case"icon":t=this.randomIcon(e.includeNull);break;case"image":t=this.randomImage(e.aspect||this.randomAspect(),e.greyscale,e.topic,e.multiple);break;case"imageData":t=this.randomImageData(e.aspect,e.greyscale,e.topic,e.multiple);break;case"letter":t=this.randomOption("abcdefghijklmnopqrstuvwxyz");break;case"link":t=this.randomLink(e.filetype,e.minPath,e.maxPath);break;case"number":t=this.randomNumber(e.min,e.max,e.step);break;case"object":t=this.randomObject(e.schema);break;case"option":return e.weightedOptions?this.randomWeightedOption(e.weightedOptions):this.randomOption(e.options);case"paragraph":t=this.randomParagraph(e.min,e.max,e.wordMinPerSent,e.wordMaxPerSent);break;case"sentence":t=this.randomSentence(e.min,e.max);break;default:t=this.randomWord()}return t}randomWeightedOption(e=[]){return this.randomOption(e.map((e=>{let t=[];for(let a=0;aMath.random()-Math.random()))}sortDates(e,t=!1){return e.sort(((e,a)=>{let r="string"==typeof e.date?Date.parse(e.date):e.date,o="string"==typeof a.date?Date.parse(a.date):a.date;return t?r-o:o-r}))}titleCase(e){return e.toLowerCase().split(" ").map((e=>e.replace(e[0],e[0].toUpperCase()))).join(" ")}updated(e){super.updated&&super.updated(e),e.forEach(((e,t)=>{}))}}customElements.define(LoremData.tag,LoremData);export{LoremData}; \ No newline at end of file + `}saveAll(){this.shadowRoot&&this.shadowRoot.querySelectorAll("a")&&confirm(`Save the following: ${Object.keys(this.schemas).join(", ")}?`)&&this.shadowRoot.querySelectorAll("a").forEach((e=>e.click()))}getJson(e){return JSON.stringify(this.randomType(e))}saveDataUrl(e){let t=this.getJson(e),a=new Blob([t],{type:"octet/stream"});return globalThis.URL.createObjectURL(a)}get data(){let e={};return Object.keys(this.schemas||[]).forEach((t=>e[t]=this.randomType(this.schemas[t]))),e}get colors(){let e=globalThis.SimpleColorsSharedStyles.requestAvailability();return!(!e||!e.colors)&&Object.keys(e.colors)}filterQuery(e,t){return e.filter(record,(e=>t(record,e)))}addDays(e=new Date,t=0){return new Date(Date.parse(e)+864e5*t)}addHours(e=new Date,t=0){return new Date(Date.parse(e)+36e5*t)}addMinutes(e=new Date,t=0){return new Date(Date.parse(e)+6e4*t)}addSeconds(e=new Date,t=0){return new Date(Date.parse(e)+1e3*t)}addWeeks(e=new Date,t=0){return new Date(Date.parse(e)+6048e5*t)}addYears(e=new Date,t=0){return new Date(Date.parse(e)+31536e6*t)}dateFormat(e,t){return"string"==typeof e&&(e=new Date(e)),e?"long"===t?e.toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):"short"===t?e.toLocaleDateString(void 0,{month:"long",day:"numeric"}):e.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):""}draw(e=[],t=0,a=t){let r=a-t,o=Math.random()*r,n=t+Math.floor(o),s=Math.max(0,n);return this.shuffle(e).slice(0,s)}randomArray(e={},t=1,a=4){let r=[];for(let o=this.randomNumber(t,a,1);o>0;o--)r.push(this.randomType(e));return r}randomAspect(e=200,t=1e3,a=200,r=1e3){return`${this.randomNumber(e,t,1)}/${this.randomNumber(a,r,1)}`}randomBool(){return Math.random()>=.5}randomColor(){return this.randomOption(this.colors)}randomDate(e=Date.now(),t="years",a=-3,r=3){return e+("milliseconds"===t?this.randomNumber(a,r):"seconds"===t?this.randomNumber(1e3*a,1e3*r):"minutes"===t?this.randomNumber(6e4*a,6e4*r):"hours"===t?this.randomNumber(36e5*a,36e5*r):"days"===t?this.randomNumber(864e5*a,864e5*r):"weeks"===t?this.randomNumber(6048e5*a,6048e5*r):this.randomNumber(31536e6*a,31536e6*r))}randomHex(){return`#${[0,0,0].map((e=>this.randomNumber(e,255).toString(16))).map((e=>e.length<2?`0${e}`:`${e}`)).join("")}`}randomIcon(e=!1){let t=this.randomOption(this.icons);return e?this.randomOption([...t,""]):t}randomPlaceImg(e,t,a="any"){return t=t||this.randomWeightedOption([{value:"",weight:12},{value:"greyscale",weight:4},{value:"sepia",weight:1}]),`//placeimg.com/${e=e||this.randomAspect()}/${a}${"greyscale"===t?"/greyscale":"sepia"===t?"/sepia":""}`}randomPicsum(e,t,a=0,r){let o=t||this.randomWeightedOption([{value:!1,weight:3},{value:!0,weight:1}])?["greyscale"]:[];return a>0&&o.push(`blur=${a}`),`https://picsum.photos/${r>-1?`id/${r}`:""}/${e=e||this.randomAspect()}/${0==o.length?"":`?${o.join("&")}`}`}randomKitten(e,t){return`https://placehold.co/${e=e||this.randomAspect()}`}randomFlickr(e,t=[],a=!1,r=-1){return`https://loremflickr.com/${e=e||this.randomAspect()}${0===t.length?"":`/${t.join(",")}${a?"/all":""}`}${r>-1?`?random=${r}`:""}`}randomImage(e,t,a,r){return a&&["man","woman","person"].includes(a)?this.randomProfileImage(e,a):void 0===r?this.randomPlaceImg(e,t,a):"any"===a?this.randomPicsum(e,t,void 0,r):this.randomFlickr(e,[a],!1,r)}randomImageData(e,t,a,r){return{src:this.randomImage(e,t,a,r),alt:`Random ${a?`${a} `:""}image${r?` #${r}`:""}`,longdesc:`This is a long description for image${r?` #${r}`:""}. ${this.randomParagraph(1,5)}`}}randomProfileImage(e,t,a){let r=e.split("/"),o=parseInt(r[0])*parseInt(r[1]),n=o<250?"thumb/":o<640?"med/":"",s=Math.random()<.5?"men":"women";return`https://randomuser.me/api/portraits/${n}${"man"===t?"men":"woman"===t?"women":s}/${a||this.randomNumber(1,90)}.jpg`}randomLink(e,t=1,a=4){let r=this.draw(this.words,t,a),o=e||this.randomOption(["url","pdf"]),n=this.randomOption(this.words),s="url"!==o?`.${o}`:"";return{url:`http://${n}.com/${r.join("/")}${s}`,text:r.length>0?r.join(" "):n,type:o}}randomNumber(e=0,t=100+e,a=1){return e+Math.floor(Math.random()*Math.floor((t-e)/a))*a}randomObject(e={}){let t={};return Object.keys(e).forEach((a=>t[a]=this.randomType(e[a]))),t}randomOption(e=[]){return e.length>0?e[Math.floor(Math.random()*Math.floor(e.length))]:void 0}randomParagraph(e=3,t=7,a,r){let o=[];for(let n=this.randomNumber(e,t);n>0;n--)o.push(this.randomSentence(a,r));return`${o.join(" ")}`}randomSentence(e=3,t=15){let a=[],r=this.randomWeightedOption([{value:".",weight:10},{value:"?",weight:3},{value:"!",weight:1}]);for(let r=this.randomNumber(e,t);r>0;r--)a.push(this.randomWord());return a[0]&&(a[0]=this.titleCase(a[0])),`${a.join(" ")}${r}`}randomType(e){let t;if(e.type)switch(e.type){case"array":t=this.randomArray(e.children,e.min,e.max);break;case"boolean":t=this.randomBool();break;case"color":t=this.randomColor();break;case"data":return e.data;case"date":t=this.randomDate(e.start,e.units,e.min,e.max);break;case"hex":t=this.randomHex();break;case"icon":t=this.randomIcon(e.includeNull);break;case"image":t=this.randomImage(e.aspect||this.randomAspect(),e.greyscale,e.topic,e.multiple);break;case"imageData":t=this.randomImageData(e.aspect,e.greyscale,e.topic,e.multiple);break;case"letter":t=this.randomOption("abcdefghijklmnopqrstuvwxyz");break;case"link":t=this.randomLink(e.filetype,e.minPath,e.maxPath);break;case"number":t=this.randomNumber(e.min,e.max,e.step);break;case"object":t=this.randomObject(e.schema);break;case"option":return e.weightedOptions?this.randomWeightedOption(e.weightedOptions):this.randomOption(e.options);case"paragraph":t=this.randomParagraph(e.min,e.max,e.wordMinPerSent,e.wordMaxPerSent);break;case"sentence":t=this.randomSentence(e.min,e.max);break;default:t=this.randomWord()}return t}randomWeightedOption(e=[]){return this.randomOption(e.map((e=>{let t=[];for(let a=0;aMath.random()-Math.random()))}sortDates(e,t=!1){return e.sort(((e,a)=>{let r="string"==typeof e.date?Date.parse(e.date):e.date,o="string"==typeof a.date?Date.parse(a.date):a.date;return t?r-o:o-r}))}titleCase(e){return e.toLowerCase().split(" ").map((e=>e.replace(e[0],e[0].toUpperCase()))).join(" ")}updated(e){super.updated&&super.updated(e),e.forEach(((e,t)=>{}))}}customElements.define(LoremData.tag,LoremData);export{LoremData}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-behaviors/media-behaviors.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-behaviors/media-behaviors.js index 4ee48ce4..14d7144e 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-behaviors/media-behaviors.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-behaviors/media-behaviors.js @@ -1 +1 @@ -globalThis.MediaBehaviors=globalThis.MediaBehaviors||{},globalThis.MediaBehaviors.Video={_sourceIsIframe(e){return"local"!=this.getVideoType(e)},cleanVideoSource(e,t){if("local"!=t&&"string"==typeof e){var i=e.split("?"),o="";if(e=i[0],2==i.length){let e=i[1].split("&"),t=e[0].split("="),r=Array.isArray(e.shift())?e.shift().join(""):e.shift();if("v"==t[0]){let e=void 0!==r&&""!==r?"?"+r:"";o=t[1]+e}}if(-1==e.indexOf("player.vimeo.com")&&-1!=e.indexOf("vimeo.com"))return-1!=e.indexOf("/videos/")&&(e=e.replace("/videos/","/")),e.replace("vimeo.com/","player.vimeo.com/video/");if(-1!=e.indexOf("youtube.com/watch"))return e.replace("youtube.com/watch","youtube.com/embed/")+o;if(-1!=e.indexOf("youtube-no-cookie.com/"))return e.replace("youtube-no-cookie.com/","youtube.com/")+o;if(-1!=e.indexOf("youtu.be"))return e.replace("youtu.be/","www.youtube.com/embed/")+o;if(-1!=e.indexOf("player.twitch.tv/")){if(i[1])return`${e}?${i[1].replace("&parent=www.example.com","")}`;return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/videos/")){return`https://player.twitch.tv/?video=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/")){return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("sketchfab.com")&&-1==e.indexOf("/embed"))return e+"/embed"}return e},getVideoType(e){let t=["aac","flac","mov","mp3","mp4","oga","ogg","ogv","wav","webm"],i=!1;if(-1!=e.indexOf("vimeo"))return"vimeo";if(-1!=e.indexOf("youtube")||-1!=e.indexOf("youtu.be"))return"youtube";if(-1!=e.indexOf("sketchfab.com"))return"sketchfab";if(-1!=e.indexOf("twitch.tv"))return"twitch";for(let o=0;o-1&&(i=!0);return i?"local":"external"}};export const MediaBehaviorsVideo=function(e){return class extends e{_sourceIsIframe(e){return"local"!=this.getVideoType(e)}cleanVideoSource(e,t){if("local"!=t){var i=e.split("?"),o="";if(e=i[0],2==i.length){let e=i[1].split("&"),t=e[0].split("="),r=Array.isArray(e.shift())?e.shift().join(""):e.shift();if("v"==t[0]){let e=void 0!==r&&""!==r?"?"+r:"";o=t[1]+e}}if(-1==e.indexOf("player.vimeo.com")&&-1!=e.indexOf("vimeo.com"))return-1!=e.indexOf("/videos/")&&(e=e.replace("/videos/","/")),e.replace("vimeo.com/","player.vimeo.com/video/");if(-1!=e.indexOf("youtube.com/watch"))return e.replace("youtube.com/watch","youtube.com/embed/")+o;if(-1!=e.indexOf("player.twitch.tv/")){if(i[1])return`${e}?${i[1].replace("&parent=www.example.com","")}`;return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/videos/")){return`https://player.twitch.tv/?video=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/")){return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("youtube-no-cookie.com/"))return e.replace("youtube-no-cookie.com/","youtube.com/")+o;if(-1!=e.indexOf("youtu.be"))return e.replace("youtu.be/","www.youtube.com/embed/")+o;if(-1!=e.indexOf("sketchfab.com")&&-1==e.indexOf("/embed"))return e+"/embed"}return e}getVideoType(e){let t=["aac","flac","mov","mp3","mp4","oga","ogg","ogv","wav","webm"],i=!1;if(-1!=e.indexOf("vimeo"))return"vimeo";if(-1!=e.indexOf("youtube")||-1!=e.indexOf("youtu.be"))return"youtube";if(-1!=e.indexOf("sketchfab.com"))return"sketchfab";if(-1!=e.indexOf("twitch.tv"))return"twitch";for(let o=0;o-1&&(i=!0);return i?"local":"external"}}}; \ No newline at end of file +globalThis.MediaBehaviors=globalThis.MediaBehaviors||{},globalThis.MediaBehaviors.Video={_sourceIsIframe(e){return"local"!=this.getVideoType(e)},cleanVideoSource(e,t){if("local"!=t&&"string"==typeof e){var i=e.split("?"),o="";if(e=i[0],2==i.length){let e=i[1].split("&"),t=e[0].split("="),r=Array.isArray(e.shift())?e.shift().join(""):e.shift();if("v"==t[0]){let e=void 0!==r&&""!==r?"?"+r:"";o=t[1]+e}}if(-1==e.indexOf("player.vimeo.com")&&-1!=e.indexOf("vimeo.com"))return-1!=e.indexOf("/videos/")&&(e=e.replace("/videos/","/")),e.replace("vimeo.com/","player.vimeo.com/video/");if(-1!=e.indexOf("youtube.com/watch"))return e.replace("youtube.com/watch","youtube.com/embed/")+o;if(-1!=e.indexOf("youtube.com/shorts/"))return e.replace("youtube.com/shorts/","youtube.com/embed/")+o;if(-1!=e.indexOf("youtube-no-cookie.com/"))return e.replace("youtube-no-cookie.com/","youtube.com/")+o;if(-1!=e.indexOf("youtu.be"))return e.replace("youtu.be/","www.youtube.com/embed/")+o;if(-1!=e.indexOf("player.twitch.tv/")){if(i[1])return`${e}?${i[1].replace("&parent=www.example.com","")}`;return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/videos/")){return`https://player.twitch.tv/?video=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/")){return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("sketchfab.com")&&-1==e.indexOf("/embed"))return e+"/embed"}return e},getVideoType(e){let t=["aac","flac","mov","mp3","mp4","oga","ogg","ogv","wav","webm"],i=!1;if(-1!=e.indexOf("vimeo"))return"vimeo";if(-1!=e.indexOf("youtube")||-1!=e.indexOf("youtu.be"))return"youtube";if(-1!=e.indexOf("sketchfab.com"))return"sketchfab";if(-1!=e.indexOf("twitch.tv"))return"twitch";for(let o=0;o-1&&(i=!0);return i?"local":"external"}};export const MediaBehaviorsVideo=function(e){return class extends e{_sourceIsIframe(e){return"local"!=this.getVideoType(e)}cleanVideoSource(e,t){if("local"!=t){var i=e.split("?"),o="";if(e=i[0],2==i.length){let e=i[1].split("&"),t=e[0].split("="),r=Array.isArray(e.shift())?e.shift().join(""):e.shift();if("v"==t[0]){let e=void 0!==r&&""!==r?"?"+r:"";o=t[1]+e}}if(-1==e.indexOf("player.vimeo.com")&&-1!=e.indexOf("vimeo.com"))return-1!=e.indexOf("/videos/")&&(e=e.replace("/videos/","/")),e.replace("vimeo.com/","player.vimeo.com/video/");if(-1!=e.indexOf("youtube.com/watch"))return e.replace("youtube.com/watch","youtube.com/embed/")+o;if(-1!=e.indexOf("player.twitch.tv/")){if(i[1])return`${e}?${i[1].replace("&parent=www.example.com","")}`;return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/videos/")){return`https://player.twitch.tv/?video=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("twitch.tv/")){return`https://player.twitch.tv/?channel=${e.replace("&parent=www.example.com","").split("/").pop()}`}if(-1!=e.indexOf("youtube-no-cookie.com/"))return e.replace("youtube-no-cookie.com/","youtube.com/")+o;if(-1!=e.indexOf("youtu.be"))return e.replace("youtu.be/","www.youtube.com/embed/")+o;if(-1!=e.indexOf("sketchfab.com")&&-1==e.indexOf("/embed"))return e+"/embed"}return e}getVideoType(e){let t=["aac","flac","mov","mp3","mp4","oga","ogg","ogv","wav","webm"],i=!1;if(-1!=e.indexOf("vimeo"))return"vimeo";if(-1!=e.indexOf("youtube")||-1!=e.indexOf("youtu.be"))return"youtube";if(-1!=e.indexOf("sketchfab.com"))return"sketchfab";if(-1!=e.indexOf("twitch.tv"))return"twitch";for(let o=0;o-1&&(i=!0);return i?"local":"external"}}}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-image/media-image.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-image/media-image.js index 139a2e08..e3e0efcc 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-image/media-image.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-image/media-image.js @@ -75,7 +75,10 @@ import{LitElement as e,html as t,css as i}from"../../lit/index.js";import{Schema --ddd-component-figure-label-title, var(--ddd-theme-accent, var(--ddd-theme-default-limestoneLight)) ); - background: var(--ddd-component-figure-label-description-background, transparent); + background: var( + --ddd-component-figure-label-description-background, + transparent + ); padding: var(--ddd-spacing-2); margin-bottom: var(--ddd-spacing-5); line-height: var(--ddd-lh-140); diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-quote/media-quote.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-quote/media-quote.js index 468805c1..a9125be7 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-quote/media-quote.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/media-quote/media-quote.js @@ -3,7 +3,7 @@ * @license Apache-2.0, see License.md for full text. */ import{html as t,css as i}from"../../lit/index.js";import{DDD as e}from"../d-d-d/d-d-d.js";class MediaQuote extends e{static get tag(){return"media-quote"}constructor(){super(),this.src="",this.alt="",this.quote="",this.author="",this.authorDetail="",this.caption="",this.hasFilter=!1,this._isCaptionOpen=!1,this.querySelector&&(this.hasAuthor=this.querySelector('[slot="author"]')&&this.querySelector('[slot="author"]').textContent.trim().length>0,this.hasAuthorDetail=this.querySelector('[slot="author-detail"]')&&this.querySelector('[slot="author-detail"]').textContent.trim().length>0,this.hasCaption=this.querySelector('[slot="caption"]')&&this.querySelector('[slot="caption"]').textContent.trim().length>0)}static get styles(){return[super.styles,i` - /* https://oer.hax.psu.edu/bto108/sites/haxcellence/documentation/ddd */ + /* https://haxtheweb.org/documentation/ddd */ :host { display: block; container-type: inline-size; diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/micro-copy-heading/micro-copy-heading.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/micro-copy-heading/micro-copy-heading.js deleted file mode 100644 index 8fe7aab1..00000000 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/micro-copy-heading/micro-copy-heading.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright 2019 The Pennsylvania State University - * @license Apache-2.0, see License.md for full text. - */ -import{LitElement as e,html as t,css as i}from"../../lit/index.js";class MicroCopyHeading extends e{static get styles(){return[i` - :host { - display: block; - margin: 16px 0; - } - - :host([hidden]) { - display: none; - } - - span { - margin-left: 8px; - } - - h2 { - display: inline-flex; - margin: unset; - padding: unset; - font-size: 0.75em; - color: var(--simple-colors-default-theme-red-5, #de2654); - border: 2px solid var(--simple-colors-default-theme-red-5, #de2654); - line-height: 12px; - margin-right: 10px; - text-transform: uppercase; - font-weight: 500; - letter-spacing: 0.09em; - padding: 6px 16px; - } - `]}render(){return t`

    - ${this.heading} -

    `}static get haxProperties(){return{canScale:!0,canEditSource:!0,gizmo:{title:"Micro copy-heading",description:"small call to action / attention that acts as a heading too",icon:"icons:android",color:"green",tags:["Text","heading","call to action","micro copy"],handles:[],meta:{author:"HAXTheWeb",owner:"The Pennsylvania State University"}},settings:{configure:[{property:"heading",description:"",inputMethod:"textfield",required:!1,icon:"icons:android"},{property:"endCap",description:"",inputMethod:"textfield",required:!1,icon:"icons:android"}],advanced:[]}}}static get properties(){return{...super.properties,heading:{name:"heading",type:String,value:"Telling our story"},endcap:{name:"endcap",type:String,value:"//"}}}static get tag(){return"micro-copy-heading"}constructor(){super(),this.tag=MicroCopyHeading.tag;let e=MicroCopyHeading.properties;for(let t in e)e.hasOwnProperty(t)&&(this.hasAttribute(t)?this[t]=this.getAttribute(t):(this.setAttribute(t,e[t].value),this[t]=e[t].value))}}customElements.define(MicroCopyHeading.tag,MicroCopyHeading);export{MicroCopyHeading}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/micro-frontend-registry/micro-frontend-registry.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/micro-frontend-registry/micro-frontend-registry.js index 8b51e8f9..8878fd32 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/micro-frontend-registry/micro-frontend-registry.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/micro-frontend-registry/micro-frontend-registry.js @@ -2,4 +2,4 @@ * Copyright 2022 The Pennsylvania State University * @license Apache-2.0, see License.md for full text. */ -const t=["endpoint","name","title","description","params","callback","method"];export class MicroFrontend{constructor(n={}){t.map((t=>this[t]="params"===t?n[t]||{}:n[t]||null))}}class MicroFrontendRegistryEl extends HTMLElement{static get tag(){return"micro-frontend-registry"}constructor(){super(),this.list=[],this.MicroFrontend=MicroFrontend}add(t){this.define(new MicroFrontend(t))}define(n){if(n instanceof MicroFrontend||(console.warn("MicroFrontendRegistry: use class MicroFrontend instance but if keys match it will register still."),console.warn(n)),!Object.keys(n).every((n=>t.includes(n))))return!1;if(n.endpoint.startsWith("/api/")){var e="";e=globalThis.MicroFrontendRegistryConfig.base?globalThis.MicroFrontendRegistryConfig.base:globalThis.HAXCMSContext&&"nodejs"===globalThis.HAXCMSContext||!globalThis.location.origin.startsWith("http://127.0.0.1")&&!globalThis.location.origin.startsWith("http://localhost")?"https://open-apis.hax.cloud":globalThis.location.origin.replace(/127.0.0.1:8(.*)/,"localhost:3000").replace(/localhost:8(.*)/,"localhost:3000"),n.endpoint=`${e}${n.endpoint}`}return globalThis.MicroFrontendRegistryConfig[n.name]&&Object.keys(globalThis.MicroFrontendRegistryConfig[n.name]).map((t=>{n[t]=globalThis.MicroFrontendRegistryConfig[n.name][t]})),this.has(n.name)?void 0:(this.list.push(n),!0)}get(t,n=!1){if(t&&this.list.length>0){const n=this.list.find((n=>n.name===t));if(n)return n}return n||console.error(`call for ${t} but not found in micro-frontend-registry`),null}has(t){return null!==this.get(t,!0)}set(t,n={}){if(t&&this.list.length>0&&this.has(t)){const e=this.list.findIndex((n=>n.name===t));this.list[e]=n}return null}async call(t,n={},e=null,i=null,o=""){if(this.has(t)){const s=this.get(t);let r="POST";s.method&&(r=s.method),n.__method&&(r=n.__method,delete n.__method);let l=null;switch(r){case"GET":case"HEAD":const t=new URLSearchParams(n).toString();l=await fetch(t?`${s.endpoint}?${t}${o}`:s.endpoint+o,{method:r}).then((t=>t.ok?t.json():{status:t.status,data:null})).catch(((t,n)=>(console.warn("Request failed",t),{status:500,data:null})));break;default:l=await fetch(s.endpoint+o,{method:r,body:n instanceof FormData?n:JSON.stringify(n)}).then((t=>t.ok?t.json():{status:t.status,data:null})).catch(((t,n)=>(console.warn("Request failed",t),{status:500,data:null})))}return s.callback&&await s.callback(l,i),e&&await e(l,i),l}return null}url(t,n={}){if(this.has(t)){const i=this.get(t);for(var e in n)n.hasOwnProperty(e)&&null==n[e]&&delete n[e];return new URL(i.endpoint).toString()+`?${new URLSearchParams(n).toString()}`}return""}}customElements.define(MicroFrontendRegistryEl.tag,MicroFrontendRegistryEl),globalThis.MicroFrontendRegistry=globalThis.MicroFrontendRegistry||{},globalThis.MicroFrontendRegistryConfig=globalThis.MicroFrontendRegistryConfig||{},globalThis.MicroFrontendRegistry.requestAvailability=()=>(globalThis.MicroFrontendRegistry.instance||(globalThis.MicroFrontendRegistry.instance=globalThis.document.createElement(MicroFrontendRegistryEl.tag),globalThis.document.body.appendChild(globalThis.MicroFrontendRegistry.instance)),globalThis.MicroFrontendRegistry.instance);export const MicroFrontendRegistry=globalThis.MicroFrontendRegistry.requestAvailability(); \ No newline at end of file +const t=["endpoint","name","title","description","params","callback","method"];export class MicroFrontend{constructor(e={}){t.map((t=>this[t]="params"===t?e[t]||{}:e[t]||null))}}export const MicroFrontendRegCapabilities=function(e){return class extends e{constructor(){super(),this.list=[],this.MicroFrontend=MicroFrontend}add(t){this.define(new MicroFrontend(t))}define(e){if(e instanceof MicroFrontend||(console.warn("MicroFrontendRegistry: use class MicroFrontend instance but if keys match it will register still."),console.warn(e)),!Object.keys(e).every((e=>t.includes(e))))return!1;if(e.endpoint.startsWith("/api/")){var n="";n=globalThis.MicroFrontendRegistryConfig.base?globalThis.MicroFrontendRegistryConfig.base:globalThis.HAXCMSContext&&"nodejs"===globalThis.HAXCMSContext||!globalThis.location.origin.startsWith("http://127.0.0.1")&&!globalThis.location.origin.startsWith("http://localhost")?"https://open-apis.hax.cloud":globalThis.location.origin.replace(/127.0.0.1:8(.*)/,"localhost:3000").replace(/localhost:8(.*)/,"localhost:3000"),e.endpoint=`${n}${e.endpoint}`}return globalThis.MicroFrontendRegistryConfig[e.name]&&Object.keys(globalThis.MicroFrontendRegistryConfig[e.name]).map((t=>{e[t]=globalThis.MicroFrontendRegistryConfig[e.name][t]})),this.has(e.name)?void 0:(this.list.push(e),!0)}get(t,e=!1){if(t&&this.list.length>0){const e=this.list.find((e=>e.name===t));if(e)return e}return e||console.error(`call for ${t} but not found in micro-frontend-registry`),null}has(t){return null!==this.get(t,!0)}set(t,e={}){if(t&&this.list.length>0&&this.has(t)){const n=this.list.findIndex((e=>e.name===t));this.list[n]=e}return null}async call(t,e={},n=null,o=null,i=""){if(this.has(t)){const s=this.get(t);let r="POST";s.method&&(r=s.method),e.__method&&(r=e.__method,delete e.__method);let l=null;switch(r){case"GET":case"HEAD":const t=new URLSearchParams(e).toString();l=await fetch(t?`${s.endpoint}?${t}${i}`:s.endpoint+i,{method:r}).then((t=>t.ok?t.json():{status:t.status,data:null})).catch(((t,e)=>(console.warn("Request failed",t),{status:500,data:null})));break;default:l=await fetch(s.endpoint+i,{method:r,body:e instanceof FormData?e:JSON.stringify(e)}).then((t=>t.ok?t.json():{status:t.status,data:null})).catch(((t,e)=>(console.warn("Request failed",t),{status:500,data:null})))}return s.callback&&await s.callback(l,o),n&&await n(l,o),l}return null}url(t,e={}){if(this.has(t)){const o=this.get(t);for(var n in e)e.hasOwnProperty(n)&&null==e[n]&&delete e[n];return new URL(o.endpoint).toString()+`?${new URLSearchParams(e).toString()}`}return""}}};export class MicroFrontendRegistryNodeJS extends(MicroFrontendRegCapabilities(Object)){constructor(){super()}}class MicroFrontendRegistryEl extends(MicroFrontendRegCapabilities(HTMLElement)){static get tag(){return"micro-frontend-registry"}constructor(){super()}}globalThis.customElements.define(MicroFrontendRegistryEl.tag,MicroFrontendRegistryEl),globalThis.MicroFrontendRegistry=globalThis.MicroFrontendRegistry||{},globalThis.MicroFrontendRegistryConfig=globalThis.MicroFrontendRegistryConfig||{},globalThis.MicroFrontendRegistry.requestAvailability=()=>(globalThis.MicroFrontendRegistry.instance||(globalThis.document&&globalThis.document.body&&globalThis.document.body.appendChild?(globalThis.MicroFrontendRegistry.instance=globalThis.document.createElement(MicroFrontendRegistryEl.tag),globalThis.document.body.appendChild(globalThis.MicroFrontendRegistry.instance)):(console.log("NODE WHATS UP MAN!"),globalThis.MicroFrontendRegistry.instance=new MicroFrontendRegistryNodeJS)),globalThis.MicroFrontendRegistry.instance);export const MicroFrontendRegistry=globalThis.MicroFrontendRegistry.requestAvailability(); \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/opt-img/locales/opt-img.es.json b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/opt-img/locales/opt-img.es.json deleted file mode 100644 index 0c5fd1db..00000000 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/opt-img/locales/opt-img.es.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "imageLoading": "Cargando imagen" -} diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/opt-img/opt-img.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/opt-img/opt-img.js deleted file mode 100644 index d2792150..00000000 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/opt-img/opt-img.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Copyright 2022 The Pennsylvania State University - * @license Apache-2.0, see License.md for full text. - */ -class OptImg extends HTMLElement{constructor(){if(super(),this.t=this.t||{},this.t.imageLoading="Image loading..",this.alt="",this.src="",this.width="300px",this.height="200px",this.querySelector("img")){const t=this.querySelector("img");this.alt=t.alt||"",this.src=t.src||"",this.width=t.width||"300px",this.height=t.height||"200px"}this.innerHTML=null,this._loading=globalThis.document.createElement("div"),this._loading.style.height=this.height,this._loading.style.width=this.width,this._loading.innerHTML=this.loading,this.appendChild(this._loading),this.loadingvisible=!1,this.template=globalThis.document.createElement("template"),this._preconnect=globalThis.document.createElement("link"),this._preconnect.rel="preconnect"}handleIntersectionCallback(t){super.handleIntersectionCallback(t);for(let e of t){Number(e.intersectionRatio).toFixed(2)>=.1&&"preload"!=this._preconnect.rel&&!this.loadingvisible&&(this._preconnect.remove(),this._preconnect=globalThis.document.createElement("link"),this._preconnect.rel="preload",this._preconnect.href=this.src,this._preconnect.as="image",globalThis.document.head.appendChild(this._preconnect))}}get html(){return`${this.alt}`}get loading(){return`\n \n \n \n \n \n \n \n \n \n \n
    ${this.t.imageLoading}
    \n `}static get observedAttributes(){return["src","alt","loadingvisible"]}attributeChangedCallback(t,e,i){["src","alt"].includes(t)?(this[t]=i,this.render()):["loadingvisible"].includes(t)&&this.render(),"src"===t&&(this._preconnect.href=new URL(this.src).origin,globalThis.document.head.appendChild(this._preconnect))}set loadingvisible(t){!1===t?this.removeAttribute("loadingvisible"):this.setAttribute("loadingvisible","loadingvisible")}get loadingvisible(){return this.getAttribute("loadingvisible")}static get tag(){return"opt-img"}render(){if(this.loadingvisible){let t=new Image;t.fetchpriority="high",t.onload=()=>{this.style.height=t.height+"px",this.style.width=t.width+"px",this.height=t.height+"px",this.width=t.width+"px",this.template.innerHTML=this.html,this.appendChild(this.template.content),setTimeout((()=>{this.style.height="",this.style.width="",this._loading.remove()}),0)},t.src=this.src,this._preconnect.remove()}}connectedCallback(){super.connectedCallback&&super.connectedCallback(),globalThis.dispatchEvent(new CustomEvent("i18n-manager-register-element",{detail:{context:this,namespace:"opt-img",localesPath:new URL("./locales/opt-img.es.json",import.meta.url).href+"/../",updateCallback:"render",locales:["es"]}})),this.loadingvisible||(this.intersectionObserver=new IntersectionObserver(this.handleIntersectionCallback.bind(this),{root:null,rootMargin:"0px",threshold:[0,.25,.5,.75,1],delay:500}),this.intersectionObserver.observe(this))}disconnectedCallback(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.loadingvisible=!1),super.disconnectedCallback&&super.disconnectedCallback()}handleIntersectionCallback(t){for(let e of t){Number(e.intersectionRatio).toFixed(2)>=.25?(this.loadingvisible=!0,this.intersectionObserver.disconnect()):this.loadingvisible=!1}}}customElements.define(OptImg.tag,OptImg);export{OptImg}; \ No newline at end of file diff --git a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/rpg-character/rpg-character.js b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/rpg-character/rpg-character.js index 5aea3ad1..840cd502 100644 --- a/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/rpg-character/rpg-character.js +++ b/app/unbundled-webcomponents/app/dist/build/es6/node_modules/@haxtheweb/rpg-character/rpg-character.js @@ -2,7 +2,7 @@ * Copyright 2022 The Pennsylvania State University * @license Apache-2.0, see License.md for full text. */ -import{html as e,css as t,svg as i,unsafeCSS as r}from"../../lit/index.js";import{SimpleColors as s}from"../simple-colors/simple-colors.js";const h=["bunny","coffee","construction","cowboy","education","knight","ninja","party","pirate","watermelon"];class RpgCharacter extends s{static get tag(){return"rpg-character"}constructor(){super(),this.height=142,this.width=113,this.accessories=0,this.base=0,this.face=0,this.faceItem=0,this.hair=0,this.pants=0,this.shirt=0,this.skin=0,this.accentColor="orange",this.seed=null,this.walking=!1,this.leg="",this.speed=500,this.__walkingTimeout=null,this.circle=!1,this.hat="none",this.hatColor=0,this.demo=!1,this.fire=!1,globalThis.matchMedia&&(this.reduceMotion=globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches)}randomColor(e=null){return null===e&&(e=""+Math.floor(Math.random()*Object.keys(this.colors).length)),Object.keys(this.colors)[e]}static get properties(){return{...super.properties,accessories:{type:Number},height:{type:Number},width:{type:Number},base:{type:Number},face:{type:Number},faceItem:{type:Number},hair:{type:Number},pants:{type:Number},shirt:{type:Number},skin:{type:Number},hatColor:{type:Number},hat:{type:String},walking:{type:Boolean,reflect:!0},leg:{type:String},seed:{type:String,reflect:!0},speed:{type:Number},circle:{type:Boolean,reflect:!0},fire:{type:Boolean,reflect:!0},demo:{type:Boolean},reduceMotion:{type:Boolean}}}static get styles(){let e=[];return super.styles&&(e=super.styles),[e,t` +import{html as e,css as t,svg as i,unsafeCSS as r}from"../../lit/index.js";import{SimpleColors as s}from"../simple-colors/simple-colors.js";export const hatList=["bunny","coffee","construction","cowboy","education","knight","ninja","party","pirate","watermelon"];export const charBuilder={accessories:9,base:1,leg:["","R","L"],face:5,faceItem:9,hair:9,pants:9,shirt:9,skin:9,hatColor:9};class RpgCharacter extends s{static get tag(){return"rpg-character"}constructor(){super(),this.literalseed=!1,this.height=142,this.width=113,this.accessories=0,this.base=0,this.face=0,this.faceItem=0,this.hair=0,this.pants=0,this.shirt=0,this.skin=0,this.accentColor="orange",this.seed=null,this.walking=!1,this.leg="",this.speed=500,this.__walkingTimeout=null,this.circle=!1,this.hat="none",this.hatColor=0,this.demo=!1,this.fire=!1,globalThis.matchMedia&&(this.reduceMotion=globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches)}randomColor(e=null){return null===e&&(e=""+Math.floor(Math.random()*Object.keys(this.colors).length)),Object.keys(this.colors)[e]}static get properties(){return{...super.properties,literalseed:{type:Boolean},accessories:{type:Number},height:{type:Number},width:{type:Number},base:{type:Number},face:{type:Number},faceItem:{type:Number},hair:{type:Number},pants:{type:Number},shirt:{type:Number},skin:{type:Number},hatColor:{type:Number},hat:{type:String},walking:{type:Boolean,reflect:!0},leg:{type:String},seed:{type:String,reflect:!0},speed:{type:Number},circle:{type:Boolean,reflect:!0},fire:{type:Boolean,reflect:!0},demo:{type:Boolean},reduceMotion:{type:Boolean}}}static get styles(){let e=[];return super.styles&&(e=super.styles),[e,t` :host { display: inline-block; margin: 0; @@ -31,17 +31,17 @@ import{html as e,css as t,svg as i,unsafeCSS as r}from"../../lit/index.js";impor color: white; font-weight: bold; } - `]}firstUpdated(e){super.firstUpdated&&super.firstUpdated(e),null===this.seed&&(this.seed=Math.random().toString(36).substring(2,12))}render(){const t=new URL(`./lib/accessories/${this.accessories}.svg`,import.meta.url).href,i=new URL(`./lib/base/${this.base}${this.leg}.svg`,import.meta.url).href,r=new URL(`./lib/base/${this.leg}.svg`,import.meta.url).href,s=new URL(`./lib/face/${this.face}.svg`,import.meta.url).href,a=new URL(`./lib/faceItem/${this.faceItem}.svg`,import.meta.url).href,o=new URL(`./lib/hair/${this.hair}.svg`,import.meta.url).href,n=new URL(`./lib/pants/${this.pants}.svg`,import.meta.url).href,l=new URL(`./lib/shirt/${this.shirt}.svg`,import.meta.url).href,c=new URL(`./lib/skin/${this.skin}.svg`,import.meta.url).href;let p=this.hat;this.fire&&"none"===this.hat?p="coffee":"random"===this.hat&&(p=h[Math.floor(Math.random()*h.length)]);const d=new URL(`./lib/hat/${p}.svg`,import.meta.url).href,g=new URL(`./lib/hatColor/${this.hatColor}.svg`,import.meta.url).href,m=new URL("./lib/base/fire.svg",import.meta.url).href,u=new URL("./lib/circle.svg",import.meta.url).href;return e` + `]}firstUpdated(e){super.firstUpdated&&super.firstUpdated(e),null===this.seed&&(this.seed=Math.random().toString(36).substring(2,12))}render(){const t=new URL(`./lib/accessories/${this.accessories}.svg`,import.meta.url).href,i=new URL(`./lib/base/${this.base}${this.leg}.svg`,import.meta.url).href,r=new URL(`./lib/base/${this.leg}.svg`,import.meta.url).href,s=new URL(`./lib/face/${this.face}.svg`,import.meta.url).href,h=new URL(`./lib/faceItem/${this.faceItem}.svg`,import.meta.url).href,a=new URL(`./lib/hair/${this.hair}.svg`,import.meta.url).href,o=new URL(`./lib/pants/${this.pants}.svg`,import.meta.url).href,l=new URL(`./lib/shirt/${this.shirt}.svg`,import.meta.url).href,n=new URL(`./lib/skin/${this.skin}.svg`,import.meta.url).href;let c=this.hat;this.fire&&"none"===this.hat?c="coffee":"random"===this.hat&&(c=hatList[Math.floor(Math.random()*hatList.length)]);const d=new URL(`./lib/hat/${c}.svg`,import.meta.url).href,p=new URL(`./lib/hatColor/${this.hatColor}.svg`,import.meta.url).href,g=new URL("./lib/base/fire.svg",import.meta.url).href,m=new URL("./lib/circle.svg",import.meta.url).href;return e`
    - ${this.renderPiece(c)} - ${1===this.base?this.renderPiece(o):""} - ${this.renderPiece(s)} ${this.renderPiece(a)} - ${this.renderPiece(l)} ${this.renderPiece(n)} + ${this.renderPiece(n)} + ${1===this.base?this.renderPiece(a):""} + ${this.renderPiece(s)} ${this.renderPiece(h)} + ${this.renderPiece(l)} ${this.renderPiece(o)} ${this.renderPiece(t)} ${this.renderPiece(i)} ${""!==this.leg?this.renderPiece(r):""} - ${this.renderPiece(g)} ${this.fire?this.renderPiece(m):""} - ${"none"!==p?this.renderPiece(d):""} - ${this.circle?this.renderPiece(u):""} + ${this.renderPiece(p)} ${this.fire?this.renderPiece(g):""} + ${"none"!==c?this.renderPiece(d):""} + ${this.circle?this.renderPiece(m):""}
    ${this.demo?e`
    ${this.seed}
    `:""}