Plugin Directory

Changeset 3158721


Ignore:
Timestamp:
09/27/2024 11:13:14 AM (18 months ago)
Author:
pcarvalho
Message:

Version 1.3.1

Location:
interactive-globes/trunk
Files:
18 added
3 deleted
29 edited

Legend:

Unmodified
Added
Removed
  • interactive-globes/trunk/README.txt

    r3117254 r3158721  
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    11 Create simplified but realistic 3D interactive planet earth globes, with elements that the user can interact with.
     11Create simplified but realistic 3D interactive planet earth globes, with map elements that the user can interact with. An engaging 3D interactive world map.
     12== Description ==
     13Create stunning, interactive 3D Earth globes for your WordPress site.
    1214
    13 == Description ==
     15This plugin offers a realistic 3D world map with clickable map elements, allowing users to explore geographic locations on a dynamic world map in an engaging and immersive way.
    1416
    15 Create simplified but realistic interactive planet earth globes, with markers and dot labels that the user can interact with.
    16 The perfect alternative to a flat world map, to get a more realistic version. Replace your world map with a 3D globe and impress your visitors.
     17Perfect for displaying global data, travel maps, or educational content, this 3D interactive world map plugin enhances user experience with smooth, responsive design.
     18
     19Easily integrate a customizable 3D world map into your website to captivate your audience.
    1720
    1821= 3D Globe =
    1922The globes are generated using globe.gl, a library that is able to create 3-dimensional globes in a spherical projection, using ThreeJS/WebGL for the 3D rendering.
    2023
    21 If you need to display locations on planet earth, this is the solution for you.
     24If you need to display locations a world map, this is the solution for you.
    2225
    2326Create your first globe in minutes! Use it to highligh locations, offices, projects, representatives, statistics, or other interactive marker visualization you need!
     
    2629
    2730= Features =
    28 - Create as many globes as you want
     31- Create as many globe maps as you want
    2932- Responsive and cross-device
    3033- Add round coloured markers
     
    5356
    5457== Changelog ==
     58
     59= 1.3.1 =
     60- New: Copy shortcode button
     61- Fix: Workaround when API DELETE is blocked
     62- Fix: Allow assets to be loaded in plugin pages
     63- Fix: Expose globe parent field when not in iframe
     64- Fix: Improve freemius integration
     65- Fix: Hide some geocoding fields
     66
     67= 1.3.0 =
     68
     69== Introducing PRO version ==
     70- New Feature: Regions
     71- New Feature: Arc Lines
     72- More Globe appearance options: Hollow Globe, Custom Color, Custom Image
     73- More Click Actions: Display Content Below, Below and Scroll, Above, Right, Left, in a Lightbox and in an Iframe.
     74
     75
     76== Fixes and Features ==
     77- Fix Rest API Error #57
     78- Add more filters to help customize the globe rendering
     79- Better default values
     80- Ripple effect on click
     81- Move external Font Awesome files to plugin
     82- Better action content handling of new lines breaks
     83- Improved admin preview experience
     84
    5585
    5686= 1.2.1 =
  • interactive-globes/trunk/dist/assets/css/admin/admin-style.min.css

    r3098987 r3158721  
    1 .itt_globe_info .csf-field-image_select img{max-width:125px}.geocoding-hide{display:none}.itt_globe_admin_example{display:-webkit-box;display:-ms-flexbox;display:flex}.itt_globe_admin_example img{max-width:220px}.itt_globe_meta .csf-section-title{display:none!important}.itt_globe_preview_container{display:-webkit-box;display:-ms-flexbox;display:flex}.itt_globe_preview{width:50%;position:relative}.itt_globe_preview_info{min-height:200px;width:50%;padding:5px}.itt_globe_preview_info .itt_globe_preview_action{float:right}.itt_globe_preview_action,.itt_globe_preview_data{display:inline-block;vertical-align:sub}.itt_globe_preview_title{--wp-admin--admin-bar--height:32px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;-webkit-font-smoothing:subpixel-antialiased;display:block;color:#1d2327;font-weight:400;font-size:14px;padding:8px 12px;margin:0;line-height:1.4}#poststuff .itt_globe_preview_info .inside{margin:6px}.itt_globe_preview_info .ittglobe_altitude_s,.itt_globe_preview_info .ittglobe_lat_s,.itt_globe_preview_info .ittglobe_lng_s{color:#1f1f1f}.itt_globe_preview_info .ittglobe_lat,.itt_globe_preview_info .ittglobe_lng{min-width:50px;display:inline-block}.itt_globe_preview_info pre{font-size:.8em}.itt_globe_save_warning{display:none;text-align:center;padding:10px;background:#ab4545a8;position:absolute;width:100%;top:0;left:0;z-index:1;color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box}.itt_globe_preview_needs_update .itt_globe_save_warning{display:block}.itt_globes_cpt_manager_table{width:100%;border-collapse:collapse;border:1px solid #ccd0d4;margin-bottom:15px}.itt_globes_cpt_manager_table thead{border-bottom:1px solid #ccc}.itt_globes_cpt_manager_table td,.itt_globes_cpt_manager_table th{padding:10px;text-align:left}.itt_globes_cpt_manager_table tr:nth-child(2n){background-color:#f9f9f9}.itt_globes_cpt_manager_table tr:nth-child(odd){background-color:#fff}.itt_globes_cpt_manager_table :not(thead) tr:hover{background-color:#f1f1f1}.itt_globes_cpt_manager_table .buttons{text-align:right}.itt_globes_cpt_manager_table .buttons a.button{margin-left:5px}.modal{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.modal__overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.6);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:2}.modal__container{background-color:#fff;padding:30px;max-width:500px;max-height:100vh;border-radius:4px;overflow-y:auto;-webkit-box-sizing:border-box;box-sizing:border-box}.modal__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.modal__title{margin-top:0;margin-bottom:0;font-weight:600;font-size:1.25rem;line-height:1.25;color:#00449e;-webkit-box-sizing:border-box;box-sizing:border-box}.modal__close{background:transparent;border:0}.modal__header .modal__close:before{content:"\2715"}.modal__content{margin-top:2rem;margin-bottom:2rem;line-height:1.5;color:rgba(0,0,0,.8)}.modal__btn{font-size:.875rem;padding:.5rem 1rem;background-color:#e6e6e6;color:rgba(0,0,0,.8);border-radius:.25rem;border-style:none;border-width:0;cursor:pointer;-webkit-appearance:button;text-transform:none;overflow:visible;line-height:1.15;margin:0;will-change:transform;-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);transition:-webkit-transform .25s ease-out;-webkit-transition:-webkit-transform .25s ease-out;-o-transition:transform .25s ease-out;transition:transform .25s ease-out;transition:transform .25s ease-out,-webkit-transform .25s ease-out}.modal__btn:focus,.modal__btn:hover{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}.modal__btn-primary{background-color:#00449e;color:#fff}.modal__title__block{display:-webkit-box;display:-ms-flexbox;display:flex}.modal__title__input{display:none}#pencil-icon{cursor:pointer;margin-left:1em}.modal__title__input.visible{display:block}.edit_mode__static.invisible{display:none}
     1.itt_globe_info .csf-field-image_select img{max-width:125px}.geocoding-hide{display:none}.itt_globe_admin_example{display:-webkit-box;display:-ms-flexbox;display:flex}.itt_globe_admin_example img{max-width:220px}.itt_globe_meta .csf-section-title{display:none!important}.itt_globe_preview_container{display:-webkit-box;display:-ms-flexbox;display:flex}.itt_globe_preview{width:80%;position:relative}@media(max-width:960px){.itt_globe_preview{width:60%}}.itt_globe_preview_info{min-height:200px;max-width:400px;padding:5px}#poststuff .itt_globe_preview_info .inside{margin:6px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:left;-ms-flex-pack:left;justify-content:left;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.itt_globe_preview_info .itt_globe_preview_action{margin-left:auto}#itt_globe_preview_data_clicked .postbox-header{padding-right:20px}.itt_globe_preview_action,.itt_globe_preview_data{display:inline-block}.itt_globe_preview_title{--wp-admin--admin-bar--height:32px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;-webkit-font-smoothing:subpixel-antialiased;display:block;color:#1d2327;font-weight:400;font-size:14px;padding:8px 12px;margin:0;line-height:1.4}.itt_globe_preview_info .ittglobe_altitude_s,.itt_globe_preview_info .ittglobe_lat_s,.itt_globe_preview_info .ittglobe_lng_s{color:#1f1f1f}.itt_globe_preview_info .ittglobe_lat,.itt_globe_preview_info .ittglobe_lng{min-width:50px;display:inline-block}.itt_globe_preview_info pre{font-size:.8em}.itt_globe_save_warning{display:none;text-align:center;padding:10px;background:#ab4545a8;position:absolute;width:100%;top:0;left:0;z-index:1;color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box}.itt_globe_preview_needs_update .itt_globe_save_warning{display:block}.itt_globes_cpt_manager_table{width:100%;border-collapse:collapse;border:1px solid #ccd0d4;margin-bottom:15px}.itt_globes_cpt_manager_table thead{border-bottom:1px solid #ccc}.itt_globes_cpt_manager_table td,.itt_globes_cpt_manager_table th{padding:10px;text-align:left}.itt_globes_cpt_manager_table tr:nth-child(2n){background-color:#f9f9f9}.itt_globes_cpt_manager_table tr:nth-child(odd){background-color:#fff}.itt_globes_cpt_manager_table :not(thead) tr:hover{background-color:#f1f1f1}.itt_globes_cpt_manager_table .buttons{text-align:right}.itt_globes_cpt_manager_table .buttons a.button{margin-left:5px}.modal{font-family:-apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif}.modal__overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.6);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:2}.modal__container{background-color:#fff;padding:30px;max-width:500px;max-height:100vh;border-radius:4px;overflow-y:auto;-webkit-box-sizing:border-box;box-sizing:border-box}.modal__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.modal__title{margin-top:0;margin-bottom:0;font-weight:600;font-size:1.25rem;line-height:1.25;color:#00449e;-webkit-box-sizing:border-box;box-sizing:border-box}.modal__close{background:transparent;border:0}.modal__header .modal__close:before{content:"\2715"}.modal__content{margin-top:2rem;margin-bottom:2rem;line-height:1.5;color:rgba(0,0,0,.8)}.modal__btn{font-size:.875rem;padding:.5rem 1rem;background-color:#e6e6e6;color:rgba(0,0,0,.8);border-radius:.25rem;border-style:none;border-width:0;cursor:pointer;-webkit-appearance:button;text-transform:none;overflow:visible;line-height:1.15;margin:0;will-change:transform;-moz-osx-font-smoothing:grayscale;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateZ(0);transform:translateZ(0);transition:-webkit-transform .25s ease-out;-webkit-transition:-webkit-transform .25s ease-out;-o-transition:transform .25s ease-out;transition:transform .25s ease-out;transition:transform .25s ease-out,-webkit-transform .25s ease-out}.modal__btn:focus,.modal__btn:hover{-webkit-transform:scale(1.05);-ms-transform:scale(1.05);transform:scale(1.05)}.modal__btn-primary{background-color:#00449e;color:#fff}.modal__title__block{display:-webkit-box;display:-ms-flexbox;display:flex}.modal__title__input{display:none}#pencil-icon{cursor:pointer;margin-left:1em}.modal__title__input.visible{display:block}.edit_mode__static.invisible{display:none}.postbox .csf-field-image_select figure:before,.postbox .csf-field-spinner .ui-spinner .ui-spinner-button:before{font-family:Font Awesome\ 5 Pro,Font Awesome\ 5 Free,Font Awesome\ 6 Free,FontAwesome}
  • interactive-globes/trunk/dist/assets/css/features/meta/meta-admin.min.css

    r3057322 r3158721  
    1 #meta_box_shortcode-code{padding:10px;background-color:beige}
     1.meta_box_shortcode-code_container{padding:10px;background-color:beige}#ittglobe-copy-button{background:none;border:none;padding:0;outline:none;cursor:pointer}
  • interactive-globes/trunk/dist/assets/js/admin/admin.min.js

    r3115164 r3158721  
    1 function setupTooltip(e){let t="";return e.tooltipContent&&""!==e.tooltipContent&&(t='<div class="itt_globe_tooltip">'+e.tooltipContent+"</div>"),t}const globe_ut_prepareURL=function(e){if("string"!=typeof e)return e;var t;(e=e.replace(/&amp;/gi,"&")).replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)}));try{t=new URL(e)}catch(e){t=!1}return t&&![null,"http:","https:","mailto:","tel:"].includes(t.protocol)?(console.log("URL protocol not allowed"),""):e},globe_ut_prepareData=function(e,t){e.hasOwnProperty("dotLabels")&&e.dotLabels||(e.dotlabels=[]),e.hasOwnProperty("points")&&e.points||(e.points=[]),e.hasOwnProperty("arcLines")&&e.arcLines||(e.arcLines=[]);let o={showGraticules:!1,backgroundColor:"transparent",atmosphere:{enabled:!1,atmosphereColor:null,atmosphereAltitude:null},globeImage:"earth-day.jpg"};(0===Object.keys(e).length||e.emptyPreview)&&Object.assign(e,o);for(const o in t){let n=t[o];Array.isArray(e[o])&&e[o]&&e[o].map((function(t){(void 0===t.useCustom||void 0!==t.useCustom&&!globe_ut_bool(t.useCustom))&&Object.assign(t,e[n]),t.action&&"default"===t.action&&(t.action=e[n].action)}))}return e.pointOfView={lat:0,lng:0,altitude:1.5},e.centerCoordinates&&(e.pointOfView.lat=globe_ut_float(e.centerCoordinates.latitude),e.pointOfView.lng=globe_ut_float(e.centerCoordinates.longitude),e.pointOfView.altitude=globe_ut_float(e.altitude)),e},globe_ut_prepareViewport=function(e,t){var o=e.closest(".itt_globe_aspect_ratio");window.innerWidth<=780&&void 0!==t.paddingTop&&""!==t.paddingTop?o.style.paddingTop=String(t.paddingTopMobile)+"%":o.style.paddingTop=String(t.paddingTop)+"%"},globe_ut_float=function(e){var t=parseFloat(e);return isNaN(t)?0:t},globe_ut_bool=function(e){return 0!==Number(e)&&"false"!==e&&void 0!==e};function setupClickEvent(e,t,o){"none"!==e.action&&(ittGlobeData.isAdmin||("open_url"!==e.action&&"open_url_new"!==e.action||(e.content=globe_ut_prepareURL(e.content)),"open_url"===e.action&&""!==e.content?document.location=e.content:"open_url_new"===e.action&&""!==e.content&&window.open(e.content)))}function setupHoverEvent(e,t,o){return"point"===o&&e.pointColor(e=>e===t?e.hover:e.color),"dotlabel"!==o&&"label"!==o||e.labelColor(e=>e===t?e.hover:e.color),e}function addPointsLayer(e,t){e.pointsData(t.points).pointLat(e=>e.coordinates.latitude).pointLng(e=>e.coordinates.longitude).pointRadius(e=>e.radius/10).pointAltitude(e=>e.altitude/100).pointColor(e=>e.color).pointResolution(20),e.pointLabel((function(e){return setupTooltip(e)})),e.onPointClick((function(e,t,o){setupClickEvent(e)})),e.onPointHover((function(t){setupHoverEvent(e,t,"point")}))}function addLabelsLayer(e,t){if(e.labelsData(t.dotLabels).labelLat(e=>e.coordinates.latitude).labelLng(e=>e.coordinates.longitude).labelText(e=>e.title).labelAltitude(e=>e.altitude/100).labelSize(e=>e.size/10).labelColor(e=>e.color).labelResolution(20).labelIncludeDot(e=>globe_ut_bool(e.includeDot)).labelDotRadius(e=>e.radius/10).labelDotOrientation(e=>e.dotOrientation),t.labelFont&&"default"!==t.labelFont){let o=ittGlobeData.assetsUrl+"fonts/"+t.labelFont+".json";fetch(o).then(e=>e.json()).then(t=>{e.labelTypeFace(t)}).catch(e=>{console.error("Fetch error:",e)})}e.labelLabel((function(e){return setupTooltip(e)})),e.onLabelClick((function(e,t,o){setupClickEvent(e)})),e.onLabelHover((function(t){setupHoverEvent(e,t,"label")}))}function setupResizeEvent(e,t,o){var n=t.closest(".itt_globe_aspect_ratio");window.addEventListener("resize",(function(){window.innerWidth<=780&&void 0!==o.paddingTop&&""!==o.paddingTop?n.style.paddingTop=String(o.paddingTopMobile)+"%":n.style.paddingTop=String(o.paddingTop)+"%",e.width()!==t.offsetWidth&&e.width(t.offsetWidth).height(t.offsetHeight)}))}function setupInteractions(e,t){void 0!==t.interactions&&(e.controls().enableZoom=globe_ut_bool(t.interactions.zoom),e.controls().enablePan=globe_ut_bool(t.interactions.pan),e.controls().enableRotate=globe_ut_bool(t.interactions.pan))}let ittGlobes={globes:[],globesIndex:{},init:function(){if("undefined"==typeof Globe)return void console.error("Globe lib not loaded properly");let e=document.getElementsByClassName("js-itt-globe-render");for(const t of e){if(!t.dataset.hasOwnProperty("globe_id"))continue;let e=0;try{e=parseInt(JSON.parse(t.dataset.globe_id))}catch(e){continue}if(!t.dataset.hasOwnProperty("globe_meta"))continue;let o={};try{o=JSON.parse(t.dataset.globe_meta)}catch(e){o={}}create_globe(e,o)}}};var create_globe=function(e,t){let o=document.getElementById("itt_globe_"+e);globe_ut_prepareData(t,{points:"pointDefaults",dotLabels:"labelDefaults"}),globe_ut_prepareViewport(o,t);let n={rendererConfig:{antialias:!0,alpha:!0},waitForGlobeReady:!0,animateIn:void 0===t.animateIn||globe_ut_bool(t.animateIn)},i=Globe(n)(document.getElementById("itt_globe_"+e));"transparent"===t.backgroundColor&&(t.backgroundColor="rgba(0,0,0,0)"),i.globeImageUrl(ittGlobeData.imagesUrl+t.globeImage),i.backgroundColor(t.backgroundColor).width(o.offsetWidth).height(o.offsetHeight).showGraticules(globe_ut_bool(t.showGraticules)).showAtmosphere(globe_ut_bool(t.atmosphere.enabled)).atmosphereColor(t.atmosphere.atmosphereColor).atmosphereAltitude(t.atmosphere.atmosphereAltitude).pointOfView(t.pointOfView),setupInteractions(i,t),setupResizeEvent(i,o,t),ittGlobeData.isAdmin&&i.onGlobeReady((function(){const e=new Event("adminGlobeReady");document.dispatchEvent(e)})),t.points&&addPointsLayer(i,t),t.dotLabels&&addLabelsLayer(i,t),ittGlobes.globes.push(i),ittGlobes.globesIndex[e]=i};ittGlobes.init(),window.ittGlobes=ittGlobes;let ittGlobesAdmin={preview:{},globeMeta:{},cptTabIndex:{itt_globe_point:2,itt_globe_dotlabel:3,itt_globe_region:4},init:function(){ittGlobesAdmin.buildPreview(),ittGlobesAdmin.setupGlobeReady(),ittGlobesAdmin.setMeta()},setMeta:function(){let e=document.querySelector(".itt_globe_render");e&&(ittGlobesAdmin.meta=e.dataset.globe_meta)},round:function(e){return Math.round(100*e)/100},setupGlobeReady:function(){document.addEventListener("adminGlobeReady",(function(){let e=Object.values(ittGlobes.globes)[0];ittGlobesAdmin.preview.centerCoordinates={lat:0,lng:0,altitude:1.7},e.onGlobeClick((function(e,t){e.lat=ittGlobesAdmin.round(e.lat),e.lng=ittGlobesAdmin.round(e.lng),ittGlobesAdmin.preview.clickedCoordinates=e,delete ittGlobesAdmin.preview.clickedElement,ittGlobesAdmin.updateClickedPreviewInfo()})),e.onZoom((function(e){ittGlobesAdmin.preview.centerCoordinates=e,ittGlobesAdmin.updateCenterPreviewInfo()})),e.onPointClick((function(e,t,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},e),ittGlobesAdmin.preview.clickedElement.type="Point",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_point",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,ittGlobesAdmin.updateClickedPreviewInfo()})),e.onLabelClick((function(e,t,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},e),ittGlobesAdmin.preview.clickedElement.type="Dot Label",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_dotlabel",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,ittGlobesAdmin.updateClickedPreviewInfo()}))}))},setCenter:function(e){if(e.target){document.getElementsByName("globe_info[altitude]")[0].value=e.target.dataset.altitude,document.getElementsByName("globe_info[centerCoordinates][latitude]")[0].value=e.target.dataset.lat,document.getElementsByName("globe_info[centerCoordinates][longitude]")[0].value=e.target.dataset.lng,ittGlobesAdmin.onChange(),e.target.innerHTML=itt_admin_labels.newCenterSaved,e.target.setAttribute("disabled","disabled"),setTimeout((function(){e.target.innerHTML=itt_admin_labels.setInitialCenter,e.target.removeAttribute("disabled")}),2e3)}},updateClickedPreviewInfo:function(){let e=ittGlobesAdmin.preview;if(void 0!==e.clickedCoordinates){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked Location";let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),o='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.clickedCoordinates.lat+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.clickedCoordinates.lng+"</span>";t.innerHTML=o,ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_edit").style.display="none";let n=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new");n.dataset.latitude=e.clickedCoordinates.lat,n.dataset.longitude=e.clickedCoordinates.lng,n.style.display="inline-block"}if(void 0!==e.clickedElement){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked "+e.clickedElement.type+" : "+e.clickedElement.title;let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),o='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+ittGlobesAdmin.round(e.clickedElement.coordinates.latitude)+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+ittGlobesAdmin.round(e.clickedElement.coordinates.longitude)+"</span>";t.innerHTML=o;let n=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_edit");n.dataset.id=e.clickedElement.id,n.dataset.post_type=e.clickedElement.post_type,n.style.display="inline-block",ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new").style.display="none"}},updateCenterPreviewInfo:function(){let e=ittGlobesAdmin.preview;e.centerCoordinates.lat=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lat),e.centerCoordinates.lng=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lng),e.centerCoordinates.altitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.altitude);let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_center .inside .itt_globe_preview_data"),o='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.centerCoordinates.lat+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.centerCoordinates.lng+'</span><span class="ittglobe_altitude_s">Scale: </span><span class="ittglobe_altitude">'+e.centerCoordinates.altitude+"</span>";ittGlobesAdmin.setCenterButton.dataset.lat=e.centerCoordinates.lat,ittGlobesAdmin.setCenterButton.dataset.lng=e.centerCoordinates.lng,ittGlobesAdmin.setCenterButton.dataset.altitude=e.centerCoordinates.altitude,t.innerHTML=o},buildPreview:function(){let e=".itt_globe_info input, .itt_globe_info select, .itt_globe_info textarea",t=document.querySelectorAll(e);t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange})),document.querySelectorAll(".csf-cloneable-add").forEach((function(o){o.addEventListener("click",(function(o){t.forEach((function(e){e.onchange=null})),setTimeout((function(){t=document.querySelectorAll(e),t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange}))}),500)}))})),ittGlobesAdmin.preview.centerCoordinates={lat:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.latitude,lng:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.longitude,altitude:void 0===ittGlobesAdmin.globeMeta.altitude?1.7:ittGlobesAdmin.globeMeta.altitude};let o=document.getElementsByClassName("itt_globe_preview_info");o.length<1?ittGlobesAdmin.infoContainer=null:(ittGlobesAdmin.infoContainer=o[0],ittGlobesAdmin.setCenterButton=document.querySelector(".itt_globe_preview_info #itt_globe_preview_data_center .itt_globe_preview_action button"),ittGlobesAdmin.setCenterButton.addEventListener("click",ittGlobesAdmin.setCenter),ittGlobesAdmin.updateCenterPreviewInfo())},onChange:function(){let e=document.querySelector(".itt_globe_preview");e instanceof HTMLElement&&e.classList.add("itt_globe_preview_needs_update")},addNew:function(e){if(e){let t=document.getElementById("post_ID").value;console.log("Add new "+JSON.stringify(e.dataset)+" marker:"+e.value+" parentGlobe: "+t);let o=ittGlobesAdmin.cptTabIndex[e.value],n=document.querySelectorAll(".csf-nav-metabox ul li a");if(n&&n[o].click(),"undefined"!=typeof addNew){let o=[];for(const t in e.dataset)e.dataset.hasOwnProperty(t)&&o.push([t,e.dataset[t]]);o.push(["post_type",e.value]),o.push(["parent_id",t]),addNew(e.value,t,o),e.value=""}else console.log("something went wrong")}},edit:function(e){if(e&&(console.log("edit "+JSON.stringify(e.dataset)),"undefined"!=typeof editEntry)){let t=[];for(const o in e.dataset)e.dataset.hasOwnProperty(o)&&t.push([o,e.dataset[o]]);let o=ittGlobesAdmin.cptTabIndex[e.dataset.post_type],n=document.querySelectorAll(".csf-nav-metabox ul li a");n&&n[o].click();let i=document.getElementById("post_ID").value;editEntry(e.dataset.post_type,e.dataset.id,i,t)}}};ittGlobesAdmin.init(),window.ittGlobesAdmin=ittGlobesAdmin;export{ittGlobesAdmin};
     1const globe_ut_prepareURL=function(e){if("string"!=typeof e)return e;var t;(e=e.replace(/&amp;/gi,"&")).replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)}));try{t=new URL(e)}catch(e){t=!1}return t&&![null,"http:","https:","mailto:","tel:"].includes(t.protocol)?(console.log("URL protocol not allowed"),""):e};function setupClickEvent(e,t,i){if("none"===i.action)return;const n=i.action;n&&"function"==typeof window.ittGlobes.clickActions[n]&&window.ittGlobes.clickActions[n](e,t,i),ittGlobeData.isAdmin||("open_url"!==i.action&&"open_url_new"!==i.action||(i.content=globe_ut_prepareURL(i.content)),"open_url"===i.action&&""!==i.content?document.location=i.content:"open_url_new"===i.action&&""!==i.content&&window.open(i.content))}function addShortcodeCopyEvent(){document.getElementById("ittglobe-copy-button").addEventListener("click",(function(){const e=document.getElementById("meta_box_shortcode-code").innerText;navigator.clipboard?navigator.clipboard.writeText(e):document.execCommand("copy"),this.classList.remove("dashicons-admin-page"),this.classList.add("dashicons-yes"),setTimeout(()=>{this.classList.remove("dashicons-yes"),this.classList.add("dashicons-admin-page")},2e3)}))}let ittGlobesAdmin={preview:{},globeMeta:{},cptTabIndex:{itt_globe_point:2,itt_globe_dotlabel:3,itt_globe_region:4,itt_globe_line:5},init:function(){ittGlobesAdmin.buildPreview(),ittGlobesAdmin.setupGlobeReady(),ittGlobesAdmin.setMeta()},setMeta:function(){let e=document.querySelector(".itt_globe_render");e&&(ittGlobesAdmin.meta=e.dataset.globe_meta)},round:function(e){return Math.round(100*e)/100},setupGlobeReady:function(){document.addEventListener("adminGlobeReady",(function(){let e=Object.values(ittGlobes.globesIndex)[0];const t=JSON.parse(ittGlobesAdmin.meta);ittGlobesAdmin.preview.centerCoordinates={lat:0,lng:0,altitude:1.7},e.ringColor(()=>e=>`rgba(255,100,50,${1-e})`).ringMaxRadius(3.5).ringAltitude(.006).ringPropagationSpeed(5).ringRepeatPeriod(400/3),e.onGlobeClick((function(t,i){t.latitude=ittGlobesAdmin.round(t.lat),t.longitude=ittGlobesAdmin.round(t.lng);const n={lat:t.lat,lng:t.lng};e.ringsData([...e.ringsData(),n]),setTimeout(()=>e.ringsData(e.ringsData().filter(e=>e!==n)),400),ittGlobesAdmin.preview.clickedCoordinates=t,delete ittGlobesAdmin.preview.clickedElement,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo()})),e.onZoom((function(e){ittGlobesAdmin.preview.centerCoordinates=e,ittGlobesAdmin.updateCenterPreviewInfo()})),e.onPointClick((function(i,n,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},i),ittGlobesAdmin.preview.clickedElement.type="Point",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_point",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo(),setupClickEvent(e,t,i)})),e.onLabelClick((function(i,n,o){ittGlobesAdmin.preview.clickedElement=Object.assign({},i),ittGlobesAdmin.preview.clickedElement.type="Dot Label",ittGlobesAdmin.preview.clickedElement.post_type="itt_globe_dotlabel",delete ittGlobesAdmin.preview.clickedElement.__threeObj,delete ittGlobesAdmin.preview.clickedCoordinates,delete ittGlobesAdmin.preview.clickedDataset,ittGlobesAdmin.updateClickedPreviewInfo(),setupClickEvent(e,t,i)}))}))},setCenter:function(e){if(e.target){document.getElementsByName("globe_info[altitude]")[0].value=e.target.dataset.altitude,document.getElementsByName("globe_info[centerCoordinates][latitude]")[0].value=e.target.dataset.lat,document.getElementsByName("globe_info[centerCoordinates][longitude]")[0].value=e.target.dataset.lng,ittGlobesAdmin.onChange(),e.target.innerHTML=itt_admin_labels.newCenterSaved,e.target.setAttribute("disabled","disabled"),setTimeout((function(){e.target.innerHTML=itt_admin_labels.setInitialCenter,e.target.removeAttribute("disabled")}),2e3)}},updateClickedPreviewInfo:function(){let e=ittGlobesAdmin.preview;if(void 0!==e.clickedCoordinates){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked Location";let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.clickedCoordinates.latitude+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.clickedCoordinates.longitude+"</span>";t.innerHTML=i,ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_action_edit").style.display="none";let n=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new"),o=n.dataset.latitude,l=n.dataset.longitude;Object.keys(n.dataset).forEach(e=>{delete n.dataset[e]}),n.dataset.prevlatitude=o,n.dataset.prevlongitude=l,n.dataset.latitude=e.clickedCoordinates.latitude,n.dataset.longitude=e.clickedCoordinates.longitude,void 0!==ittGlobesAdmin.preview.clickedDataset&&(Object.keys(ittGlobesAdmin.preview.clickedDataset).forEach(e=>{n.dataset[e]=ittGlobesAdmin.preview.clickedDataset[e]}),delete ittGlobesAdmin.preview.clickedDataset),n.style.display="inline-block"}if(void 0!==e.clickedElement){ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_title").innerHTML="Clicked "+e.clickedElement.type+" : "+e.clickedElement.title;let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+ittGlobesAdmin.round(e.clickedElement.coordinates.latitude)+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+ittGlobesAdmin.round(e.clickedElement.coordinates.longitude)+"</span>";if(t.innerHTML=i,"itt_globe_point"===e.clickedElement.post_type||"itt_globe_dotlabel"===e.clickedElement.post_type||void 0!==e.clickedElement.post_id){let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .itt_globe_preview_action_edit");t.dataset.id=e.clickedElement.post_id?e.clickedElement.post_id:e.clickedElement.id,t.dataset.post_type=e.clickedElement.post_type,t.style.display="inline-block";let i=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_clicked .inside .itt_globe_preview_action_add_new");i.style.display="inline-block",i.dataset.prevlatitude=i.dataset.latitude,i.dataset.prevlongitude=i.dataset.longitude,i.dataset.latitude=ittGlobesAdmin.round(e.clickedElement.coordinates.latitude),i.dataset.longitude=ittGlobesAdmin.round(e.clickedElement.coordinates.longitude)}}},updateCenterPreviewInfo:function(){let e=ittGlobesAdmin.preview;e.centerCoordinates.latitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lat),e.centerCoordinates.longitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.lng),e.centerCoordinates.altitude=ittGlobesAdmin.round(ittGlobesAdmin.preview.centerCoordinates.altitude);let t=ittGlobesAdmin.infoContainer.querySelector("#itt_globe_preview_data_center .inside .itt_globe_preview_data"),i='<span class="ittglobe_lat_s">Lat: </span><span class="ittglobe_lat">'+e.centerCoordinates.latitude+'</span><span class="ittglobe_lng_s">Long: </span><span class="ittglobe_lng">'+e.centerCoordinates.longitude+'</span><span class="ittglobe_altitude_s">Scale: </span><span class="ittglobe_altitude">'+e.centerCoordinates.altitude+"</span>";ittGlobesAdmin.setCenterButton.dataset.lat=e.centerCoordinates.lat,ittGlobesAdmin.setCenterButton.dataset.lng=e.centerCoordinates.lng,ittGlobesAdmin.setCenterButton.dataset.altitude=e.centerCoordinates.altitude,t.innerHTML=i},buildPreview:function(){let e=".itt_globe_info input, .itt_globe_info select, .itt_globe_info textarea",t=document.querySelectorAll(e);t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange})),document.querySelectorAll(".csf-cloneable-add").forEach((function(i){i.addEventListener("click",(function(i){t.forEach((function(e){e.onchange=null})),setTimeout((function(){t=document.querySelectorAll(e),t.forEach((function(e){e.onchange=ittGlobesAdmin.onChange}))}),500)}))})),ittGlobesAdmin.preview.centerCoordinates={lat:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.latitude,lng:void 0===ittGlobesAdmin.globeMeta.centerCoordinates?0:ittGlobesAdmin.globeMeta.centerCoordinates.longitude,altitude:void 0===ittGlobesAdmin.globeMeta.altitude?1.7:ittGlobesAdmin.globeMeta.altitude};let i=document.getElementsByClassName("itt_globe_preview_info");i.length<1?ittGlobesAdmin.infoContainer=null:(ittGlobesAdmin.infoContainer=i[0],ittGlobesAdmin.setCenterButton=document.querySelector(".itt_globe_preview_info #itt_globe_preview_data_center .itt_globe_preview_action button"),ittGlobesAdmin.setCenterButton.addEventListener("click",ittGlobesAdmin.setCenter),ittGlobesAdmin.updateCenterPreviewInfo())},onChange:function(){let e=document.querySelector(".itt_globe_preview");e instanceof HTMLElement&&e.classList.add("itt_globe_preview_needs_update")},addNew:function(e){if(e){let t=document.getElementById("post_ID").value;console.log("Add new "+JSON.stringify(e.dataset)+" dataType:"+e.value+" parentGlobe: "+t);let i=ittGlobesAdmin.cptTabIndex[e.value],n=document.querySelectorAll(".csf-nav-metabox ul li a");if(n&&n[i].click(),"undefined"!=typeof addNew){let i=[];for(const t in e.dataset)e.dataset.hasOwnProperty(t)&&i.push([t,e.dataset[t]]);i.push(["post_type",e.value]),i.push(["parent_id",t]),addNew(e.value,t,i),e.value=""}else console.log("something went wrong")}},edit:function(e){if(e&&(console.log("edit "+JSON.stringify(e.dataset)),"undefined"!=typeof editEntry)){let t=[];for(const i in e.dataset)e.dataset.hasOwnProperty(i)&&t.push([i,e.dataset[i]]);let i=ittGlobesAdmin.cptTabIndex[e.dataset.post_type],n=document.querySelectorAll(".csf-nav-metabox ul li a");n&&n[i].click();let o=document.getElementById("post_ID").value;editEntry(e.dataset.post_type,e.dataset.id,o,t)}}};ittGlobesAdmin.init(),window.ittGlobesAdmin=ittGlobesAdmin,addShortcodeCopyEvent();export{ittGlobesAdmin};
  • interactive-globes/trunk/dist/assets/js/admin/cpt-list-events.min.js

    r3115164 r3158721  
    1 function refresh_cpt_list(t,e){get_cpt_list(t,e).then(e=>{var o=document.getElementById("fill_"+t);return!!o&&(o.innerHTML=e,init_cpt_events(t),ittGlobesAdmin.onChange(),!0)})}async function get_cpt_list(t,e){try{const o=itt_globe_rest.namespace+e+"/"+t+itt_globe_rest.list_part,n=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":itt_globe_rest.nonce}});if(!n.ok)throw new Error("Network response was not OK");return await n.json()}catch(t){console.error("There has been a problem with your fetch operation:",t)}}function init_cpt_events(t){let e="#block_"+t,o=document.querySelector(e);o&&(o.querySelectorAll(".js-remove-cpt").forEach((function(t){t.addEventListener("click",do_remove_event)})),o.querySelectorAll(".js-modal-edit-cpt").forEach((function(t){t.addEventListener("click",(function(t){let e=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&e.push([t,this.dataset[t]]);const o=this.getAttribute("data-cpt_post_id"),n=this.getAttribute("data-parent_id");editEntry(this.getAttribute("data-post_type"),o,n,e)}))})),o.querySelectorAll(".js-modal-add-new-cpt").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();const e=this.getAttribute("data-parent_id"),o=this.getAttribute("data-post_type");let n=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&n.push([t,this.dataset[t]]);addNew(o,e,n)}))})),o.querySelectorAll(".js-modal-close").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();closeModal(this.getAttribute("data-post_type"))}))})))}function do_remove_event(t){if(!confirm("Are you sure?"))return;t.preventDefault();const e=this.getAttribute("data-cpt_post_id"),o=this.getAttribute("data-parent_id"),n=this.getAttribute("data-post_type"),r=new XMLHttpRequest;r.open("DELETE",`/wp-json/wp/v2/${n}/${e}`,!0),r.setRequestHeader("Content-Type","application/json"),r.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce),r.onload=function(){r.status>=200&&r.status<300?(JSON.parse(r.responseText),refresh_cpt_list(n,o)):console.error("Error trashing post:",r.statusText)},r.onerror=function(){console.error("Network error occurred")},r.send()}function editEntry(t,e,o,n){query_params=[["action","edit"],["iframe",""],["post",e],["parent_id",o]].concat(n);const r=build_modal_url(itt_globe_data.admin_url,"post.php",query_params),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",r),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block"})),document.getElementById(t+"_modal").style.display="block"}function addNew(t,e,o){let n=[["iframe",""]].concat(o);const r=build_modal_url(itt_globe_data.admin_url,"post-new.php",n),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",r),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block"})),document.getElementById(t+"_modal").style.display="block"}function closeModal(t){document.getElementById(t+"_modal").style.display="none",document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="block",document.querySelector("#"+t+"_modal iframe").setAttribute("src","")}function build_modal_url(t,e,o){const n=new URLSearchParams;return o.forEach(t=>{if(!Array.isArray(t)||2!==t.length)throw new Error("Each param should be an array with two elements: [key, value]");n.append(t[0],t[1])}),t+e+"?"+n.toString()}window.addEventListener("message",(function(t){if(!t.data.hasOwnProperty("message")||!t.data.hasOwnProperty("params"))return;if("refresh-cpt-list"!==t.data.message)return;const e=t.data.params;(e.hasOwnProperty("post_type")||e.hasOwnProperty("parent_id"))&&refresh_cpt_list(e.post_type,e.parent_id)}));
     1function refresh_cpt_list(t,e){get_cpt_list(t,e).then(e=>{var o=document.getElementById("fill_"+t);return!!o&&(o.innerHTML=e,init_cpt_events(t),ittGlobesAdmin.onChange(),!0)})}async function get_cpt_list(t,e){try{const o=itt_globe_rest.namespace+e+"/"+t+itt_globe_rest.list_part,n=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json","X-WP-Nonce":itt_globe_rest.nonce}});if(!n.ok)throw new Error("Network response was not OK");return await n.json()}catch(t){console.error("There has been a problem with your fetch operation:",t)}}function init_cpt_events(t){let e="#block_"+t,o=document.querySelector(e);o&&(o.querySelectorAll(".js-remove-cpt").forEach((function(t){t.addEventListener("click",do_remove_event)})),o.querySelectorAll(".js-modal-edit-cpt").forEach((function(t){t.addEventListener("click",(function(t){let e=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&e.push([t,this.dataset[t]]);const o=this.getAttribute("data-cpt_post_id"),n=this.getAttribute("data-parent_id");editEntry(this.getAttribute("data-post_type"),o,n,e)}))})),o.querySelectorAll(".js-modal-add-new-cpt").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();const e=this.getAttribute("data-parent_id"),o=this.getAttribute("data-post_type");let n=[];for(const t in this.dataset)this.dataset.hasOwnProperty(t)&&n.push([t,this.dataset[t]]);addNew(o,e,n)}))})),o.querySelectorAll(".js-modal-close").forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();closeModal(this.getAttribute("data-post_type"))}))})))}function do_remove_event(t){if(!confirm("Are you sure?"))return;t.preventDefault();const e=this.getAttribute("data-cpt_post_id"),o=this.getAttribute("data-parent_id"),n=this.getAttribute("data-post_type"),r=new XMLHttpRequest;r.open("POST",`/wp-json/wp/v2/${n}/${e}?_method=DELETE`,!0),r.setRequestHeader("Content-Type","application/json"),r.setRequestHeader("X-WP-Nonce",wpApiSettings.nonce),r.onload=function(){r.status>=200&&r.status<300?(JSON.parse(r.responseText),refresh_cpt_list(n,o)):console.error("Error trashing post:",r.statusText)},r.onerror=function(){console.error("Network error occurred")},r.send()}function editEntry(t,e,o,n){query_params=[["action","edit"],["iframe",""],["post",e],["parent_id",o]].concat(n);const r=build_modal_url(itt_globe_data.admin_url,"post.php",query_params),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",r),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block"})),document.getElementById(t+"_modal").style.display="block"}function addNew(t,e,o){let n=[["iframe",""]].concat(o);const r=build_modal_url(itt_globe_data.admin_url,"post-new.php",n),a=document.querySelector("#"+t+"_modal iframe");a.setAttribute("src",r),a.addEventListener("load",(function(){document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="none",a.style.display="block"})),document.getElementById(t+"_modal").style.display="block"}function closeModal(t){document.getElementById(t+"_modal").style.display="none",document.querySelector("#"+t+"_modal .overlay-content-loading").style.display="block",document.querySelector("#"+t+"_modal iframe").setAttribute("src","")}function build_modal_url(t,e,o){const n=new URLSearchParams;return o.forEach(t=>{if(!Array.isArray(t)||2!==t.length)throw new Error("Each param should be an array with two elements: [key, value]");n.append(t[0],t[1])}),t+e+"?"+n.toString()}window.addEventListener("message",(function(t){if(!t.data.hasOwnProperty("message")||!t.data.hasOwnProperty("params"))return;if("refresh-cpt-list"!==t.data.message)return;const e=t.data.params;(e.hasOwnProperty("post_type")||e.hasOwnProperty("parent_id"))&&refresh_cpt_list(e.post_type,e.parent_id)}));
  • interactive-globes/trunk/dist/assets/js/public/globe.min.js

    r3115164 r3158721  
    1 function setupTooltip(t){let e="";return t.tooltipContent&&""!==t.tooltipContent&&(e='<div class="itt_globe_tooltip">'+t.tooltipContent+"</div>"),e}const globe_ut_prepareURL=function(t){if("string"!=typeof t)return t;var e;(t=t.replace(/&amp;/gi,"&")).replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(e)}));try{e=new URL(t)}catch(t){e=!1}return e&&![null,"http:","https:","mailto:","tel:"].includes(e.protocol)?(console.log("URL protocol not allowed"),""):t},globe_ut_prepareData=function(t,e){t.hasOwnProperty("dotLabels")&&t.dotLabels||(t.dotlabels=[]),t.hasOwnProperty("points")&&t.points||(t.points=[]),t.hasOwnProperty("arcLines")&&t.arcLines||(t.arcLines=[]);let o={showGraticules:!1,backgroundColor:"transparent",atmosphere:{enabled:!1,atmosphereColor:null,atmosphereAltitude:null},globeImage:"earth-day.jpg"};(0===Object.keys(t).length||t.emptyPreview)&&Object.assign(t,o);for(const o in e){let n=e[o];Array.isArray(t[o])&&t[o]&&t[o].map((function(e){(void 0===e.useCustom||void 0!==e.useCustom&&!globe_ut_bool(e.useCustom))&&Object.assign(e,t[n]),e.action&&"default"===e.action&&(e.action=t[n].action)}))}return t.pointOfView={lat:0,lng:0,altitude:1.5},t.centerCoordinates&&(t.pointOfView.lat=globe_ut_float(t.centerCoordinates.latitude),t.pointOfView.lng=globe_ut_float(t.centerCoordinates.longitude),t.pointOfView.altitude=globe_ut_float(t.altitude)),t},globe_ut_prepareViewport=function(t,e){var o=t.closest(".itt_globe_aspect_ratio");window.innerWidth<=780&&void 0!==e.paddingTop&&""!==e.paddingTop?o.style.paddingTop=String(e.paddingTopMobile)+"%":o.style.paddingTop=String(e.paddingTop)+"%"},globe_ut_float=function(t){var e=parseFloat(t);return isNaN(e)?0:e},globe_ut_bool=function(t){return 0!==Number(t)&&"false"!==t&&void 0!==t};function setupClickEvent(t,e,o){"none"!==t.action&&(ittGlobeData.isAdmin||("open_url"!==t.action&&"open_url_new"!==t.action||(t.content=globe_ut_prepareURL(t.content)),"open_url"===t.action&&""!==t.content?document.location=t.content:"open_url_new"===t.action&&""!==t.content&&window.open(t.content)))}function setupHoverEvent(t,e,o){return"point"===o&&t.pointColor(t=>t===e?t.hover:t.color),"dotlabel"!==o&&"label"!==o||t.labelColor(t=>t===e?t.hover:t.color),t}function addPointsLayer(t,e){t.pointsData(e.points).pointLat(t=>t.coordinates.latitude).pointLng(t=>t.coordinates.longitude).pointRadius(t=>t.radius/10).pointAltitude(t=>t.altitude/100).pointColor(t=>t.color).pointResolution(20),t.pointLabel((function(t){return setupTooltip(t)})),t.onPointClick((function(t,e,o){setupClickEvent(t)})),t.onPointHover((function(e){setupHoverEvent(t,e,"point")}))}function addLabelsLayer(t,e){if(t.labelsData(e.dotLabels).labelLat(t=>t.coordinates.latitude).labelLng(t=>t.coordinates.longitude).labelText(t=>t.title).labelAltitude(t=>t.altitude/100).labelSize(t=>t.size/10).labelColor(t=>t.color).labelResolution(20).labelIncludeDot(t=>globe_ut_bool(t.includeDot)).labelDotRadius(t=>t.radius/10).labelDotOrientation(t=>t.dotOrientation),e.labelFont&&"default"!==e.labelFont){let o=ittGlobeData.assetsUrl+"fonts/"+e.labelFont+".json";fetch(o).then(t=>t.json()).then(e=>{t.labelTypeFace(e)}).catch(t=>{console.error("Fetch error:",t)})}t.labelLabel((function(t){return setupTooltip(t)})),t.onLabelClick((function(t,e,o){setupClickEvent(t)})),t.onLabelHover((function(e){setupHoverEvent(t,e,"label")}))}function setupResizeEvent(t,e,o){var n=e.closest(".itt_globe_aspect_ratio");window.addEventListener("resize",(function(){window.innerWidth<=780&&void 0!==o.paddingTop&&""!==o.paddingTop?n.style.paddingTop=String(o.paddingTopMobile)+"%":n.style.paddingTop=String(o.paddingTop)+"%",t.width()!==e.offsetWidth&&t.width(e.offsetWidth).height(e.offsetHeight)}))}function setupInteractions(t,e){void 0!==e.interactions&&(t.controls().enableZoom=globe_ut_bool(e.interactions.zoom),t.controls().enablePan=globe_ut_bool(e.interactions.pan),t.controls().enableRotate=globe_ut_bool(e.interactions.pan))}let ittGlobes={globes:[],globesIndex:{},init:function(){if("undefined"==typeof Globe)return void console.error("Globe lib not loaded properly");let t=document.getElementsByClassName("js-itt-globe-render");for(const e of t){if(!e.dataset.hasOwnProperty("globe_id"))continue;let t=0;try{t=parseInt(JSON.parse(e.dataset.globe_id))}catch(t){continue}if(!e.dataset.hasOwnProperty("globe_meta"))continue;let o={};try{o=JSON.parse(e.dataset.globe_meta)}catch(t){o={}}create_globe(t,o)}}};var create_globe=function(t,e){let o=document.getElementById("itt_globe_"+t);globe_ut_prepareData(e,{points:"pointDefaults",dotLabels:"labelDefaults"}),globe_ut_prepareViewport(o,e);let n={rendererConfig:{antialias:!0,alpha:!0},waitForGlobeReady:!0,animateIn:void 0===e.animateIn||globe_ut_bool(e.animateIn)},l=Globe(n)(document.getElementById("itt_globe_"+t));"transparent"===e.backgroundColor&&(e.backgroundColor="rgba(0,0,0,0)"),l.globeImageUrl(ittGlobeData.imagesUrl+e.globeImage),l.backgroundColor(e.backgroundColor).width(o.offsetWidth).height(o.offsetHeight).showGraticules(globe_ut_bool(e.showGraticules)).showAtmosphere(globe_ut_bool(e.atmosphere.enabled)).atmosphereColor(e.atmosphere.atmosphereColor).atmosphereAltitude(e.atmosphere.atmosphereAltitude).pointOfView(e.pointOfView),setupInteractions(l,e),setupResizeEvent(l,o,e),ittGlobeData.isAdmin&&l.onGlobeReady((function(){const t=new Event("adminGlobeReady");document.dispatchEvent(t)})),e.points&&addPointsLayer(l,e),e.dotLabels&&addLabelsLayer(l,e),ittGlobes.globes.push(l),ittGlobes.globesIndex[t]=l};ittGlobes.init(),window.ittGlobes=ittGlobes;export{ittGlobes};
     1function setupTooltip(t){let e="";return t.tooltipContent&&""!==t.tooltipContent&&(e='<div class="itt_globe_tooltip">'+t.tooltipContent+"</div>"),e}const globe_ut_prepareURL=function(t){if("string"!=typeof t)return t;var e;(t=t.replace(/&amp;/gi,"&")).replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(e)}));try{e=new URL(t)}catch(t){e=!1}return e&&![null,"http:","https:","mailto:","tel:"].includes(e.protocol)?(console.log("URL protocol not allowed"),""):t},globe_ut_prepareData=function(t){t.hasOwnProperty("dotLabels")&&t.dotLabels||(t.dotlabels=[]),t.hasOwnProperty("points")&&t.points||(t.points=[]);let e={showGraticules:!1,backgroundColor:"transparent",atmosphere:{enabled:!1,atmosphereColor:null,atmosphereAltitude:null},globeImage:"earth-day.jpg"};return(0===Object.keys(t).length||t.emptyPreview)&&Object.assign(t,e),t.pointOfView={lat:0,lng:0,altitude:1.5},t.centerCoordinates&&(t.pointOfView.lat=globe_ut_float(t.centerCoordinates.latitude),t.pointOfView.lng=globe_ut_float(t.centerCoordinates.longitude),t.pointOfView.altitude=globe_ut_float(t.altitude)),t},globe_ut_setupData=function(t,e){for(const o in e){let n=e[o];Array.isArray(t[o])&&t[o]&&t[o].map((function(e){(void 0===e.useCustom||void 0!==e.useCustom&&!globe_ut_bool(e.useCustom))&&Object.assign(e,t[n]),e.action&&"default"===e.action&&(e.action=t[n].action)}))}},globe_ut_prepareViewport=function(t,e){var o=t.closest(".itt_globe_aspect_ratio");window.innerWidth<=780&&void 0!==e.paddingTop&&""!==e.paddingTop?o.style.paddingTop=String(e.paddingTopMobile)+"%":o.style.paddingTop=String(e.paddingTop)+"%"},globe_ut_float=function(t){var e=parseFloat(t);return isNaN(e)?0:e},globe_ut_bool=function(t){return 0!==Number(t)&&"false"!==t&&void 0!==t};function setupClickEvent(t,e,o){if("none"===o.action)return;const n=o.action;n&&"function"==typeof window.ittGlobes.clickActions[n]&&window.ittGlobes.clickActions[n](t,e,o),ittGlobeData.isAdmin||("open_url"!==o.action&&"open_url_new"!==o.action||(o.content=globe_ut_prepareURL(o.content)),"open_url"===o.action&&""!==o.content?document.location=o.content:"open_url_new"===o.action&&""!==o.content&&window.open(o.content))}function setupHoverEvent(t,e,o){return"point"===o&&t.pointColor(t=>t===e?t.hover:t.color),"dotlabel"!==o&&"label"!==o||t.labelColor(t=>t===e?t.hover:t.color),t}function addPointsLayer(t,e){t.pointsData(e.points).pointLat(t=>t.coordinates.latitude).pointLng(t=>t.coordinates.longitude).pointRadius(t=>t.radius/10).pointAltitude(t=>t.altitude/100).pointColor(t=>t.color).pointResolution(20),t.pointLabel((function(t){return setupTooltip(t)})),t.onPointClick((function(o){setupClickEvent(t,e,o)})),t.onPointHover((function(e){setupHoverEvent(t,e,"point")}))}function addLabelsLayer(t,e){if(t.labelsData(e.dotLabels).labelLat(t=>t.coordinates.latitude).labelLng(t=>t.coordinates.longitude).labelText(t=>t.title).labelAltitude(t=>t.altitude/100).labelSize(t=>t.size/10).labelColor(t=>t.color).labelResolution(20).labelIncludeDot(t=>globe_ut_bool(t.includeDot)).labelDotRadius(t=>t.radius/10).labelDotOrientation(t=>t.dotOrientation),e.labelFont&&"default"!==e.labelFont){let o=ittGlobeData.assetsUrl+"fonts/"+e.labelFont+".json";fetch(o).then(t=>t.json()).then(e=>{t.labelTypeFace(e)}).catch(t=>{console.error("Fetch error:",t)})}t.labelLabel((function(t){return setupTooltip(t)})),t.onLabelClick((function(o,n,l){setupClickEvent(t,e,o)})),t.onLabelHover((function(e){setupHoverEvent(t,e,"label")}))}function setupResizeEvent(t,e,o){var n=e.closest(".itt_globe_aspect_ratio");window.addEventListener("resize",(function(){window.innerWidth<=780&&void 0!==o.paddingTop&&""!==o.paddingTop?n.style.paddingTop=String(o.paddingTopMobile)+"%":n.style.paddingTop=String(o.paddingTop)+"%",t.width()!==e.offsetWidth&&t.width(e.offsetWidth).height(e.offsetHeight)}))}function setupInteractions(t,e){void 0!==e.interactions&&(t.controls().enableZoom=globe_ut_bool(e.interactions.zoom),t.controls().enablePan=globe_ut_bool(e.interactions.pan),t.controls().enableRotate=globe_ut_bool(e.interactions.pan))}let ittGlobes={globes:[],globesIndex:{},clickActions:{},init:function(){if("undefined"==typeof Globe)return void console.error("Globe lib not loaded properly");let t=document.getElementsByClassName("js-itt-globe-render");for(const e of t){if(!e.dataset.hasOwnProperty("globe_id"))continue;let t=0;try{t=parseInt(JSON.parse(e.dataset.globe_id))}catch(t){continue}if(void 0!==ittGlobes.globesIndex[t])continue;if(!e.dataset.hasOwnProperty("globe_meta"))continue;let o={};try{o=JSON.parse(e.dataset.globe_meta)}catch(t){o={}}create_globe(t,o)}}};var create_globe=function(t,e){let o=document.getElementById("itt_globe_"+t);globe_ut_prepareData(e),globe_ut_setupData(e,{points:"pointDefaults",dotLabels:"labelDefaults"}),globe_ut_prepareViewport(o,e);let n={rendererConfig:{antialias:!0,alpha:!0},waitForGlobeReady:!0,animateIn:void 0===e.animateIn||globe_ut_bool(e.animateIn)},l=Globe(n)(document.getElementById("itt_globe_"+t));"transparent"===e.backgroundColor&&(e.backgroundColor="rgba(0,0,0,0)"),null!==e.globeImage&&""!==e.globeImage&&"earth-hollow"!==e.globeImage&&"noImage"!==e.globeImage&&"customImage"!==e.globeImage&&l.globeImageUrl(ittGlobeData.imagesUrl+e.globeImage),l.backgroundColor(e.backgroundColor).width(o.offsetWidth).height(o.offsetHeight).showGraticules(globe_ut_bool(e.showGraticules)).showAtmosphere(globe_ut_bool(e.atmosphere.enabled)).atmosphereColor(e.atmosphere.atmosphereColor).atmosphereAltitude(e.atmosphere.atmosphereAltitude).pointOfView(e.pointOfView),setupInteractions(l,e),setupResizeEvent(l,o,e),ittGlobeData.isAdmin&&l.onGlobeReady((function(){const t=new Event("adminGlobeReady");document.dispatchEvent(t)})),e.points&&addPointsLayer(l,e),e.dotLabels&&addLabelsLayer(l,e),ittGlobes.globes.push(l),ittGlobes.globesIndex[t]=l};ittGlobes.init(),window.ittGlobes=ittGlobes;export{ittGlobes};
  • interactive-globes/trunk/dist/assets/js/vendor/public/globe.gl.min.js

    r3098987 r3158721  
    11// Version 2.32.3 globe.gl - https://github.com/vasturiano/globe.gl
    2 !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Globe=e();}(undefined,(function(){function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r);}return n}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t));}));}return e}function n(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:e+""}function r(t,e,r){return (e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){if(null==t)return {};var n,r,i=function(t,e){if(null==t)return {};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n]);}return i}function a(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t));}}(".scene-container .clickable {\n  cursor: pointer;\n}");const s="162",A={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},l=0,c=1,u=2,h=3,f=1,d=2,p=3,m=0,g=1,v=100,_=0,y=1,x=2,b=0,M=1,w=2,E=3,S=4,T=5,C=6,R=7,P=301,L=302,D=306,O=1e3,I=1001,q=1002,U=1003,N=1005,B=1006,k=1007,F=1008,z=1009,G=1012,H=1013,j=1014,V=1015,W=1016,X=1020,Q=1023,Y=1026,Z=1027,K=33776,J=33777,$=33778,tt=33779,et=36492,nt="",rt="srgb",it="srgb-linear",at="display-p3",ot="display-p3-linear",st="linear",At="srgb",lt="rec709",ct="p3",ut=7680,ht=35044,ft="300 es",dt=1035,pt=2e3,mt=2001;class gt{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e);}hasEventListener(t,e){if(void 0===this._listeners)return !1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1);}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,r=n.length;e<r;e++)n[e].call(this,t);t.target=null;}}}const vt=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let _t=1234567;const yt=Math.PI/180,xt=180/Math.PI;function bt(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return (vt[255&t]+vt[t>>8&255]+vt[t>>16&255]+vt[t>>24&255]+"-"+vt[255&e]+vt[e>>8&255]+"-"+vt[e>>16&15|64]+vt[e>>24&255]+"-"+vt[63&n|128]+vt[n>>8&255]+"-"+vt[n>>16&255]+vt[n>>24&255]+vt[255&r]+vt[r>>8&255]+vt[r>>16&255]+vt[r>>24&255]).toLowerCase()}function Mt(t,e,n){return Math.max(e,Math.min(n,t))}function wt(t,e){return (t%e+e)%e}function Et(t,e,n){return (1-n)*t+n*e}function St(t){return !(t&t-1)&&0!==t}function Tt(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Ct(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Rt(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const Pt={DEG2RAD:yt,RAD2DEG:xt,generateUUID:bt,clamp:Mt,euclideanModulo:wt,mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Et,damp:function(t,e,n,r){return Et(t,e,1-Math.exp(-n*r))},pingpong:function(t,e=1){return e-Math.abs(wt(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(_t=t);let e=_t+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*yt},radToDeg:function(t){return t*xt},isPowerOfTwo:St,ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:Tt,setQuaternionFromProperEuler:function(t,e,n,r,i){const a=Math.cos,o=Math.sin,s=a(n/2),A=o(n/2),l=a((e+r)/2),c=o((e+r)/2),u=a((e-r)/2),h=o((e-r)/2),f=a((r-e)/2),d=o((r-e)/2);switch(i){case"XYX":t.set(s*c,A*u,A*h,s*l);break;case"YZY":t.set(A*h,s*c,A*u,s*l);break;case"ZXZ":t.set(A*u,A*h,s*c,s*l);break;case"XZX":t.set(s*c,A*d,A*f,s*l);break;case"YXY":t.set(A*f,s*c,A*d,s*l);break;case"ZYZ":t.set(A*d,A*f,s*c,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i);}},normalize:Rt,denormalize:Ct};class Lt{constructor(t=0,e=0){Lt.prototype.isVector2=!0,this.x=t,this.y=e;}get width(){return this.x}set width(t){this.x=t;}get height(){return this.y}set height(t){this.y=t;}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Mt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,a=this.y-t.y;return this.x=i*n-a*r+t.x,this.y=i*r+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y;}}class Dt{constructor(t,e,n,r,i,a,o,s,A){Dt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,r,i,a,o,s,A);}set(t,e,n,r,i,a,o,s,A){const l=this.elements;return l[0]=t,l[1]=r,l[2]=o,l[3]=e,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=A,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[3],s=n[6],A=n[1],l=n[4],c=n[7],u=n[2],h=n[5],f=n[8],d=r[0],p=r[3],m=r[6],g=r[1],v=r[4],_=r[7],y=r[2],x=r[5],b=r[8];return i[0]=a*d+o*g+s*y,i[3]=a*p+o*v+s*x,i[6]=a*m+o*_+s*b,i[1]=A*d+l*g+c*y,i[4]=A*p+l*v+c*x,i[7]=A*m+l*_+c*b,i[2]=u*d+h*g+f*y,i[5]=u*p+h*v+f*x,i[8]=u*m+h*_+f*b,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8];return e*a*l-e*o*A-n*i*l+n*o*s+r*i*A-r*a*s}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8],c=l*a-o*A,u=o*s-l*i,h=A*i-a*s,f=e*c+n*u+r*h;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const d=1/f;return t[0]=c*d,t[1]=(r*A-l*n)*d,t[2]=(o*n-r*a)*d,t[3]=u*d,t[4]=(l*e-r*s)*d,t[5]=(r*i-o*e)*d,t[6]=h*d,t[7]=(n*s-A*e)*d,t[8]=(a*e-n*i)*d,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,i,a,o){const s=Math.cos(i),A=Math.sin(i);return this.set(n*s,n*A,-n*(s*a+A*o)+a+t,-r*A,r*s,-r*(-A*a+s*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Ot.makeScale(t,e)),this}rotate(t){return this.premultiply(Ot.makeRotation(-t)),this}translate(t,e){return this.premultiply(Ot.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return !1;return !0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return (new this.constructor).fromArray(this.elements)}}const Ot=new Dt;function It(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return !0;return !1}function qt(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Ut(){const t=qt("canvas");return t.style.display="block",t}const Nt={};function Bt(t){t in Nt||(Nt[t]=!0,console.warn(t));}const kt=(new Dt).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Ft=(new Dt).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),zt={[it]:{transfer:st,primaries:lt,toReference:t=>t,fromReference:t=>t},[rt]:{transfer:At,primaries:lt,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[ot]:{transfer:st,primaries:ct,toReference:t=>t.applyMatrix3(Ft),fromReference:t=>t.applyMatrix3(kt)},[at]:{transfer:At,primaries:ct,toReference:t=>t.convertSRGBToLinear().applyMatrix3(Ft),fromReference:t=>t.applyMatrix3(kt).convertLinearToSRGB()}},Gt=new Set([it,ot]),Ht={enabled:!0,_workingColorSpace:it,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!Gt.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t;},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const r=zt[e].toReference;return (0, zt[n].fromReference)(r(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return zt[t].primaries},getTransfer:function(t){return t===nt?st:zt[t].transfer}};function jt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Vt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let Wt;class Xt{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else {void 0===Wt&&(Wt=qt("canvas")),Wt.width=t.width,Wt.height=t.height;const n=Wt.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Wt;}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=qt("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height),i=r.data;for(let t=0;t<i.length;t++)i[t]=255*jt(i[t]/255);return n.putImageData(r,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*jt(e[t]/255)):e[t]=jt(e[t]);return {data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let Qt=0;class Yt{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Qt++}),this.uuid=bt(),this.data=t,this.dataReady=!0,this.version=0;}set needsUpdate(t){!0===t&&this.version++;}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let t;if(Array.isArray(r)){t=[];for(let e=0,n=r.length;e<n;e++)r[e].isDataTexture?t.push(Zt(r[e].image)):t.push(Zt(r[e]));}else t=Zt(r);n.url=t;}return e||(t.images[this.uuid]=n),n}}function Zt(t){return "undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Xt.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Kt=0;class Jt extends gt{constructor(t=Jt.DEFAULT_IMAGE,e=Jt.DEFAULT_MAPPING,n=1001,r=1001,i=1006,a=1008,o=1023,s=1009,A=Jt.DEFAULT_ANISOTROPY,l=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Kt++}),this.uuid=bt(),this.name="",this.source=new Yt(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=A,this.format=o,this.internalFormat=null,this.type=s,this.offset=new Lt(0,0),this.repeat=new Lt(1,1),this.center=new Lt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1;}get image(){return this.source.data}set image(t=null){this.source.data=t;}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y);}clone(){return (new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"});}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case O:t.x=t.x-Math.floor(t.x);break;case I:t.x=t.x<0?0:1;break;case q:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);}if(t.y<0||t.y>1)switch(this.wrapT){case O:t.y=t.y-Math.floor(t.y);break;case I:t.y=t.y<0?0:1;break;case q:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0);}}Jt.DEFAULT_IMAGE=null,Jt.DEFAULT_MAPPING=300,Jt.DEFAULT_ANISOTROPY=1;class $t{constructor(t=0,e=0,n=0,r=1){$t.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=r;}get width(){return this.z}set width(t){this.z=t;}get height(){return this.w}set height(t){this.w=t;}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*e+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*e+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*e+a[7]*n+a[11]*r+a[15]*i,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,i;const a=.01,o=.1,s=t.elements,A=s[0],l=s[4],c=s[8],u=s[1],h=s[5],f=s[9],d=s[2],p=s[6],m=s[10];if(Math.abs(l-u)<a&&Math.abs(c-d)<a&&Math.abs(f-p)<a){if(Math.abs(l+u)<o&&Math.abs(c+d)<o&&Math.abs(f+p)<o&&Math.abs(A+h+m-3)<o)return this.set(1,0,0,0),this;e=Math.PI;const t=(A+1)/2,s=(h+1)/2,g=(m+1)/2,v=(l+u)/4,_=(c+d)/4,y=(f+p)/4;return t>s&&t>g?t<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(t),r=v/n,i=_/n):s>g?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=y/r):g<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(g),n=_/i,r=y/i),this.set(n,r,i,e),this}let g=Math.sqrt((p-f)*(p-f)+(c-d)*(c-d)+(u-l)*(u-l));return Math.abs(g)<.001&&(g=1),this.x=(p-f)/g,this.y=(c-d)/g,this.z=(u-l)/g,this.w=Math.acos((A+h+m-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w;}}class te extends gt{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new $t(0,0,t,e),this.scissorTest=!1,this.viewport=new $t(0,0,t,e);const r={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:B,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},n);const i=new Jt(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);i.flipY=!1,i.generateMipmaps=n.generateMipmaps,i.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let t=0;t<a;t++)this.textures[t]=i.clone(),this.textures[t].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples;}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t;}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=n;this.dispose();}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e);}clone(){return (new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++)this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new Yt(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"});}}class ee extends te{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0;}}class ne extends Jt{constructor(t=null,e=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=U,this.minFilter=U,this.wrapR=I,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1;}}class re extends Jt{constructor(t=null,e=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=U,this.minFilter=U,this.wrapR=I,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1;}}class ie{constructor(t=0,e=0,n=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=r;}static slerpFlat(t,e,n,r,i,a,o){let s=n[r+0],A=n[r+1],l=n[r+2],c=n[r+3];const u=i[a+0],h=i[a+1],f=i[a+2],d=i[a+3];if(0===o)return t[e+0]=s,t[e+1]=A,t[e+2]=l,void(t[e+3]=c);if(1===o)return t[e+0]=u,t[e+1]=h,t[e+2]=f,void(t[e+3]=d);if(c!==d||s!==u||A!==h||l!==f){let t=1-o;const e=s*u+A*h+l*f+c*d,n=e>=0?1:-1,r=1-e*e;if(r>Number.EPSILON){const i=Math.sqrt(r),a=Math.atan2(i,e*n);t=Math.sin(t*a)/i,o=Math.sin(o*a)/i;}const i=o*n;if(s=s*t+u*i,A=A*t+h*i,l=l*t+f*i,c=c*t+d*i,t===1-o){const t=1/Math.sqrt(s*s+A*A+l*l+c*c);s*=t,A*=t,l*=t,c*=t;}}t[e]=s,t[e+1]=A,t[e+2]=l,t[e+3]=c;}static multiplyQuaternionsFlat(t,e,n,r,i,a){const o=n[r],s=n[r+1],A=n[r+2],l=n[r+3],c=i[a],u=i[a+1],h=i[a+2],f=i[a+3];return t[e]=o*f+l*c+s*h-A*u,t[e+1]=s*f+l*u+A*c-o*h,t[e+2]=A*f+l*h+o*u-s*c,t[e+3]=l*f-o*c-s*u-A*h,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback();}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback();}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback();}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback();}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,r=t._y,i=t._z,a=t._order,o=Math.cos,s=Math.sin,A=o(n/2),l=o(r/2),c=o(i/2),u=s(n/2),h=s(r/2),f=s(i/2);switch(a){case"XYZ":this._x=u*l*c+A*h*f,this._y=A*h*c-u*l*f,this._z=A*l*f+u*h*c,this._w=A*l*c-u*h*f;break;case"YXZ":this._x=u*l*c+A*h*f,this._y=A*h*c-u*l*f,this._z=A*l*f-u*h*c,this._w=A*l*c+u*h*f;break;case"ZXY":this._x=u*l*c-A*h*f,this._y=A*h*c+u*l*f,this._z=A*l*f+u*h*c,this._w=A*l*c-u*h*f;break;case"ZYX":this._x=u*l*c-A*h*f,this._y=A*h*c+u*l*f,this._z=A*l*f-u*h*c,this._w=A*l*c+u*h*f;break;case"YZX":this._x=u*l*c+A*h*f,this._y=A*h*c+u*l*f,this._z=A*l*f-u*h*c,this._w=A*l*c-u*h*f;break;case"XZY":this._x=u*l*c-A*h*f,this._y=A*h*c-u*l*f,this._z=A*l*f+u*h*c,this._w=A*l*c+u*h*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a);}return !0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],i=e[8],a=e[1],o=e[5],s=e[9],A=e[2],l=e[6],c=e[10],u=n+o+c;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(l-s)*t,this._y=(i-A)*t,this._z=(a-r)*t;}else if(n>o&&n>c){const t=2*Math.sqrt(1+n-o-c);this._w=(l-s)/t,this._x=.25*t,this._y=(r+a)/t,this._z=(i+A)/t;}else if(o>c){const t=2*Math.sqrt(1+o-n-c);this._w=(i-A)/t,this._x=(r+a)/t,this._y=.25*t,this._z=(s+l)/t;}else {const t=2*Math.sqrt(1+c-n-o);this._w=(a-r)/t,this._x=(i+A)/t,this._y=(s+l)/t,this._z=.25*t;}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Mt(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,i=t._z,a=t._w,o=e._x,s=e._y,A=e._z,l=e._w;return this._x=n*l+a*o+r*A-i*s,this._y=r*l+a*s+i*o-n*A,this._z=i*l+a*A+n*s-r*o,this._w=a*l-n*o-r*s-i*A,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,r=this._y,i=this._z,a=this._w;let o=a*t._w+n*t._x+r*t._y+i*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;const s=1-o*o;if(s<=Number.EPSILON){const t=1-e;return this._w=t*a+e*this._w,this._x=t*n+e*this._x,this._y=t*r+e*this._y,this._z=t*i+e*this._z,this.normalize(),this}const A=Math.sqrt(s),l=Math.atan2(A,o),c=Math.sin((1-e)*l)/A,u=Math.sin(e*l)/A;return this._w=a*c+this._w*u,this._x=n*c+this._x*u,this._y=r*c+this._y*u,this._z=i*c+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(t),r*Math.cos(t),i*Math.sin(e),i*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w;}}class ae{constructor(t=0,e=0,n=0){ae.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n;}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(se.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(se.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=t.elements,a=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,i=t.x,a=t.y,o=t.z,s=t.w,A=2*(a*r-o*n),l=2*(o*e-i*r),c=2*(i*n-a*e);return this.x=e+s*A+a*c-o*l,this.y=n+s*l+o*A-i*c,this.z=r+s*c+i*l-a*A,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,i=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return oe.copy(this).projectOnVector(t),this.sub(oe)}reflect(t){return this.sub(oe.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Mt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z;}}const oe=new ae,se=new ie;class Ae{constructor(t=new ae(1/0,1/0,1/0),e=new ae(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e;}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(ce.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(ce.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=ce.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return (new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n){const r=n.getAttribute("position");if(!0===e&&void 0!==r&&!0!==t.isInstancedMesh)for(let e=0,n=r.count;e<n;e++)!0===t.isMesh?t.getVertexPosition(e,ce):ce.fromBufferAttribute(r,e),ce.applyMatrix4(t.matrixWorld),this.expandByPoint(ce);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),ue.copy(t.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),ue.copy(n.boundingBox)),ue.applyMatrix4(t.matrixWorld),this.union(ue);}const r=t.children;for(let t=0,n=r.length;t<n;t++)this.expandByObject(r[t],e);return this}containsPoint(t){return !(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return !(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,ce),ce.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return !1;this.getCenter(ve),_e.subVectors(this.max,ve),he.subVectors(t.a,ve),fe.subVectors(t.b,ve),de.subVectors(t.c,ve),pe.subVectors(fe,he),me.subVectors(de,fe),ge.subVectors(he,de);let e=[0,-pe.z,pe.y,0,-me.z,me.y,0,-ge.z,ge.y,pe.z,0,-pe.x,me.z,0,-me.x,ge.z,0,-ge.x,-pe.y,pe.x,0,-me.y,me.x,0,-ge.y,ge.x,0];return !!be(e,he,fe,de,_e)&&(e=[1,0,0,0,1,0,0,0,1],!!be(e,he,fe,de,_e)&&(ye.crossVectors(pe,me),e=[ye.x,ye.y,ye.z],be(e,he,fe,de,_e)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,ce).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(ce).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(le[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),le[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),le[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),le[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),le[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),le[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),le[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),le[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(le)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const le=[new ae,new ae,new ae,new ae,new ae,new ae,new ae,new ae],ce=new ae,ue=new Ae,he=new ae,fe=new ae,de=new ae,pe=new ae,me=new ae,ge=new ae,ve=new ae,_e=new ae,ye=new ae,xe=new ae;function be(t,e,n,r,i){for(let a=0,o=t.length-3;a<=o;a+=3){xe.fromArray(t,a);const o=i.x*Math.abs(xe.x)+i.y*Math.abs(xe.y)+i.z*Math.abs(xe.z),s=e.dot(xe),A=n.dot(xe),l=r.dot(xe);if(Math.max(-Math.max(s,A,l),Math.min(s,A,l))>o)return !1}return !0}const Me=new Ae,we=new ae,Ee=new ae;class Se{constructor(t=new ae,e=-1){this.isSphere=!0,this.center=t,this.radius=e;}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):Me.setFromPoints(t).getCenter(n);let r=0;for(let e=0,i=t.length;e<i;e++)r=Math.max(r,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;we.subVectors(t,this.center);const e=we.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(we,n/t),this.radius+=n;}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(Ee.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(we.copy(t.center).add(Ee)),this.expandByPoint(we.copy(t.center).sub(Ee))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return (new this.constructor).copy(this)}}const Te=new ae,Ce=new ae,Re=new ae,Pe=new ae,Le=new ae,De=new ae,Oe=new ae;class Ie{constructor(t=new ae,e=new ae(0,0,-1)){this.origin=t,this.direction=e;}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Te)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Te.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Te.copy(this.origin).addScaledVector(this.direction,e),Te.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){Ce.copy(t).add(e).multiplyScalar(.5),Re.copy(e).sub(t).normalize(),Pe.copy(this.origin).sub(Ce);const i=.5*t.distanceTo(e),a=-this.direction.dot(Re),o=Pe.dot(this.direction),s=-Pe.dot(Re),A=Pe.lengthSq(),l=Math.abs(1-a*a);let c,u,h,f;if(l>0)if(c=a*s-o,u=a*o-s,f=i*l,c>=0)if(u>=-f)if(u<=f){const t=1/l;c*=t,u*=t,h=c*(c+a*u+2*o)+u*(a*c+u+2*s)+A;}else u=i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;else u=-i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;else u<=-f?(c=Math.max(0,-(-a*i+o)),u=c>0?-i:Math.min(Math.max(-i,-s),i),h=-c*c+u*(u+2*s)+A):u<=f?(c=0,u=Math.min(Math.max(-i,-s),i),h=u*(u+2*s)+A):(c=Math.max(0,-(a*i+o)),u=c>0?i:Math.min(Math.max(-i,-s),i),h=-c*c+u*(u+2*s)+A);else u=a>0?-i:i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;return n&&n.copy(this.origin).addScaledVector(this.direction,c),r&&r.copy(Ce).addScaledVector(Re,u),h}intersectSphere(t,e){Te.subVectors(t.center,this.origin);const n=Te.dot(this.direction),r=Te.dot(Te)-n*n,i=t.radius*t.radius;if(r>i)return null;const a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return !0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,i,a,o,s;const A=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,u=this.origin;return A>=0?(n=(t.min.x-u.x)*A,r=(t.max.x-u.x)*A):(n=(t.max.x-u.x)*A,r=(t.min.x-u.x)*A),l>=0?(i=(t.min.y-u.y)*l,a=(t.max.y-u.y)*l):(i=(t.max.y-u.y)*l,a=(t.min.y-u.y)*l),n>a||i>r?null:((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),c>=0?(o=(t.min.z-u.z)*c,s=(t.max.z-u.z)*c):(o=(t.max.z-u.z)*c,s=(t.min.z-u.z)*c),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,e)))}intersectsBox(t){return null!==this.intersectBox(t,Te)}intersectTriangle(t,e,n,r,i){Le.subVectors(e,t),De.subVectors(n,t),Oe.crossVectors(Le,De);let a,o=this.direction.dot(Oe);if(o>0){if(r)return null;a=1;}else {if(!(o<0))return null;a=-1,o=-o;}Pe.subVectors(this.origin,t);const s=a*this.direction.dot(De.crossVectors(Pe,De));if(s<0)return null;const A=a*this.direction.dot(Le.cross(Pe));if(A<0)return null;if(s+A>o)return null;const l=-a*Pe.dot(Oe);return l<0?null:this.at(l/o,i)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return (new this.constructor).copy(this)}}class qe{constructor(t,e,n,r,i,a,o,s,A,l,c,u,h,f,d,p){qe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,r,i,a,o,s,A,l,c,u,h,f,d,p);}set(t,e,n,r,i,a,o,s,A,l,c,u,h,f,d,p){const m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=r,m[1]=i,m[5]=a,m[9]=o,m[13]=s,m[2]=A,m[6]=l,m[10]=c,m[14]=u,m[3]=h,m[7]=f,m[11]=d,m[15]=p,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return (new qe).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/Ue.setFromMatrixColumn(t,0).length(),i=1/Ue.setFromMatrixColumn(t,1).length(),a=1/Ue.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,r=t.y,i=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),A=Math.sin(r),l=Math.cos(i),c=Math.sin(i);if("XYZ"===t.order){const t=a*l,n=a*c,r=o*l,i=o*c;e[0]=s*l,e[4]=-s*c,e[8]=A,e[1]=n+r*A,e[5]=t-i*A,e[9]=-o*s,e[2]=i-t*A,e[6]=r+n*A,e[10]=a*s;}else if("YXZ"===t.order){const t=s*l,n=s*c,r=A*l,i=A*c;e[0]=t+i*o,e[4]=r*o-n,e[8]=a*A,e[1]=a*c,e[5]=a*l,e[9]=-o,e[2]=n*o-r,e[6]=i+t*o,e[10]=a*s;}else if("ZXY"===t.order){const t=s*l,n=s*c,r=A*l,i=A*c;e[0]=t-i*o,e[4]=-a*c,e[8]=r+n*o,e[1]=n+r*o,e[5]=a*l,e[9]=i-t*o,e[2]=-a*A,e[6]=o,e[10]=a*s;}else if("ZYX"===t.order){const t=a*l,n=a*c,r=o*l,i=o*c;e[0]=s*l,e[4]=r*A-n,e[8]=t*A+i,e[1]=s*c,e[5]=i*A+t,e[9]=n*A-r,e[2]=-A,e[6]=o*s,e[10]=a*s;}else if("YZX"===t.order){const t=a*s,n=a*A,r=o*s,i=o*A;e[0]=s*l,e[4]=i-t*c,e[8]=r*c+n,e[1]=c,e[5]=a*l,e[9]=-o*l,e[2]=-A*l,e[6]=n*c+r,e[10]=t-i*c;}else if("XZY"===t.order){const t=a*s,n=a*A,r=o*s,i=o*A;e[0]=s*l,e[4]=-c,e[8]=A*l,e[1]=t*c+i,e[5]=a*l,e[9]=n*c-r,e[2]=r*c-n,e[6]=o*l,e[10]=i*c+t;}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Be,t,ke)}lookAt(t,e,n){const r=this.elements;return Ge.subVectors(t,e),0===Ge.lengthSq()&&(Ge.z=1),Ge.normalize(),Fe.crossVectors(n,Ge),0===Fe.lengthSq()&&(1===Math.abs(n.z)?Ge.x+=1e-4:Ge.z+=1e-4,Ge.normalize(),Fe.crossVectors(n,Ge)),Fe.normalize(),ze.crossVectors(Ge,Fe),r[0]=Fe.x,r[4]=ze.x,r[8]=Ge.x,r[1]=Fe.y,r[5]=ze.y,r[9]=Ge.y,r[2]=Fe.z,r[6]=ze.z,r[10]=Ge.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[4],s=n[8],A=n[12],l=n[1],c=n[5],u=n[9],h=n[13],f=n[2],d=n[6],p=n[10],m=n[14],g=n[3],v=n[7],_=n[11],y=n[15],x=r[0],b=r[4],M=r[8],w=r[12],E=r[1],S=r[5],T=r[9],C=r[13],R=r[2],P=r[6],L=r[10],D=r[14],O=r[3],I=r[7],q=r[11],U=r[15];return i[0]=a*x+o*E+s*R+A*O,i[4]=a*b+o*S+s*P+A*I,i[8]=a*M+o*T+s*L+A*q,i[12]=a*w+o*C+s*D+A*U,i[1]=l*x+c*E+u*R+h*O,i[5]=l*b+c*S+u*P+h*I,i[9]=l*M+c*T+u*L+h*q,i[13]=l*w+c*C+u*D+h*U,i[2]=f*x+d*E+p*R+m*O,i[6]=f*b+d*S+p*P+m*I,i[10]=f*M+d*T+p*L+m*q,i[14]=f*w+d*C+p*D+m*U,i[3]=g*x+v*E+_*R+y*O,i[7]=g*b+v*S+_*P+y*I,i[11]=g*M+v*T+_*L+y*q,i[15]=g*w+v*C+_*D+y*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],a=t[1],o=t[5],s=t[9],A=t[13],l=t[2],c=t[6],u=t[10],h=t[14];return t[3]*(+i*s*c-r*A*c-i*o*u+n*A*u+r*o*h-n*s*h)+t[7]*(+e*s*h-e*A*u+i*a*u-r*a*h+r*A*l-i*s*l)+t[11]*(+e*A*c-e*o*h-i*a*c+n*a*h+i*o*l-n*A*l)+t[15]*(-r*o*l-e*s*c+e*o*u+r*a*c-n*a*u+n*s*l)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8],c=t[9],u=t[10],h=t[11],f=t[12],d=t[13],p=t[14],m=t[15],g=c*p*A-d*u*A+d*s*h-o*p*h-c*s*m+o*u*m,v=f*u*A-l*p*A-f*s*h+a*p*h+l*s*m-a*u*m,_=l*d*A-f*c*A+f*o*h-a*d*h-l*o*m+a*c*m,y=f*c*s-l*d*s-f*o*u+a*d*u+l*o*p-a*c*p,x=e*g+n*v+r*_+i*y;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/x;return t[0]=g*b,t[1]=(d*u*i-c*p*i-d*r*h+n*p*h+c*r*m-n*u*m)*b,t[2]=(o*p*i-d*s*i+d*r*A-n*p*A-o*r*m+n*s*m)*b,t[3]=(c*s*i-o*u*i-c*r*A+n*u*A+o*r*h-n*s*h)*b,t[4]=v*b,t[5]=(l*p*i-f*u*i+f*r*h-e*p*h-l*r*m+e*u*m)*b,t[6]=(f*s*i-a*p*i-f*r*A+e*p*A+a*r*m-e*s*m)*b,t[7]=(a*u*i-l*s*i+l*r*A-e*u*A-a*r*h+e*s*h)*b,t[8]=_*b,t[9]=(f*c*i-l*d*i-f*n*h+e*d*h+l*n*m-e*c*m)*b,t[10]=(a*d*i-f*o*i+f*n*A-e*d*A-a*n*m+e*o*m)*b,t[11]=(l*o*i-a*c*i-l*n*A+e*c*A+a*n*h-e*o*h)*b,t[12]=y*b,t[13]=(l*d*r-f*c*r+f*n*u-e*d*u-l*n*p+e*c*p)*b,t[14]=(f*o*r-a*d*r-f*n*s+e*d*s+a*n*p-e*o*p)*b,t[15]=(a*c*r-l*o*r+l*n*s-e*c*s-a*n*u+e*o*u)*b,this}scale(t){const e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),i=1-n,a=t.x,o=t.y,s=t.z,A=i*a,l=i*o;return this.set(A*a+n,A*o-r*s,A*s+r*o,0,A*o+r*s,l*o+n,l*s-r*a,0,A*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,i,a){return this.set(1,n,i,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,i=e._x,a=e._y,o=e._z,s=e._w,A=i+i,l=a+a,c=o+o,u=i*A,h=i*l,f=i*c,d=a*l,p=a*c,m=o*c,g=s*A,v=s*l,_=s*c,y=n.x,x=n.y,b=n.z;return r[0]=(1-(d+m))*y,r[1]=(h+_)*y,r[2]=(f-v)*y,r[3]=0,r[4]=(h-_)*x,r[5]=(1-(u+m))*x,r[6]=(p+g)*x,r[7]=0,r[8]=(f+v)*b,r[9]=(p-g)*b,r[10]=(1-(u+d))*b,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let i=Ue.set(r[0],r[1],r[2]).length();const a=Ue.set(r[4],r[5],r[6]).length(),o=Ue.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],Ne.copy(this);const s=1/i,A=1/a,l=1/o;return Ne.elements[0]*=s,Ne.elements[1]*=s,Ne.elements[2]*=s,Ne.elements[4]*=A,Ne.elements[5]*=A,Ne.elements[6]*=A,Ne.elements[8]*=l,Ne.elements[9]*=l,Ne.elements[10]*=l,e.setFromRotationMatrix(Ne),n.x=i,n.y=a,n.z=o,this}makePerspective(t,e,n,r,i,a,o=2e3){const s=this.elements,A=2*i/(e-t),l=2*i/(n-r),c=(e+t)/(e-t),u=(n+r)/(n-r);let h,f;if(o===pt)h=-(a+i)/(a-i),f=-2*a*i/(a-i);else {if(o!==mt)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);h=-a/(a-i),f=-a*i/(a-i);}return s[0]=A,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=u,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=f,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(t,e,n,r,i,a,o=2e3){const s=this.elements,A=1/(e-t),l=1/(n-r),c=1/(a-i),u=(e+t)*A,h=(n+r)*l;let f,d;if(o===pt)f=(a+i)*c,d=-2*c;else {if(o!==mt)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);f=i*c,d=-1*c;}return s[0]=2*A,s[4]=0,s[8]=0,s[12]=-u,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=d,s[14]=-f,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return !1;return !0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const Ue=new ae,Ne=new qe,Be=new ae(0,0,0),ke=new ae(1,1,1),Fe=new ae,ze=new ae,Ge=new ae,He=new qe,je=new ie;class Ve{constructor(t=0,e=0,n=0,r=Ve.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=r;}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback();}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback();}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback();}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback();}set(t,e,n,r=this._order){return this._x=t,this._y=e,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const r=t.elements,i=r[0],a=r[4],o=r[8],s=r[1],A=r[5],l=r[9],c=r[2],u=r[6],h=r[10];switch(e){case"XYZ":this._y=Math.asin(Mt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,h),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(u,A),this._z=0);break;case"YXZ":this._x=Math.asin(-Mt(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,h),this._z=Math.atan2(s,A)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(Mt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-c,h),this._z=Math.atan2(-a,A)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-Mt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(u,h),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,A));break;case"YZX":this._z=Math.asin(Mt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,A),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(o,h));break;case"XZY":this._z=Math.asin(-Mt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(u,A),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e);}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return He.makeRotationFromQuaternion(t),this.setFromRotationMatrix(He,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return je.setFromEuler(this),this.setFromQuaternion(je,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order;}}Ve.DEFAULT_ORDER="XYZ";class We{constructor(){this.mask=1;}set(t){this.mask=1<<t>>>0;}enable(t){this.mask|=1<<t;}enableAll(){this.mask=-1;}toggle(t){this.mask^=1<<t;}disable(t){this.mask&=~(1<<t);}disableAll(){this.mask=0;}test(t){return !!(this.mask&t.mask)}isEnabled(t){return !!(this.mask&1<<t)}}let Xe=0;const Qe=new ae,Ye=new ie,Ze=new qe,Ke=new ae,Je=new ae,$e=new ae,tn=new ie,en=new ae(1,0,0),nn=new ae(0,1,0),rn=new ae(0,0,1),an={type:"added"},on={type:"removed"},sn={type:"childadded",child:null},An={type:"childremoved",child:null};class ln extends gt{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Xe++}),this.uuid=bt(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ln.DEFAULT_UP.clone();const t=new ae,e=new Ve,n=new ie,r=new ae(1,1,1);e._onChange((function(){n.setFromEuler(e,!1);})),n._onChange((function(){e.setFromQuaternion(n,void 0,!1);})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new qe},normalMatrix:{value:new Dt}}),this.matrix=new qe,this.matrixWorld=new qe,this.matrixAutoUpdate=ln.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=ln.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new We,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={};}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale);}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e);}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0);}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t);}setRotationFromQuaternion(t){this.quaternion.copy(t);}rotateOnAxis(t,e){return Ye.setFromAxisAngle(t,e),this.quaternion.multiply(Ye),this}rotateOnWorldAxis(t,e){return Ye.setFromAxisAngle(t,e),this.quaternion.premultiply(Ye),this}rotateX(t){return this.rotateOnAxis(en,t)}rotateY(t){return this.rotateOnAxis(nn,t)}rotateZ(t){return this.rotateOnAxis(rn,t)}translateOnAxis(t,e){return Qe.copy(t).applyQuaternion(this.quaternion),this.position.add(Qe.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(en,t)}translateY(t){return this.translateOnAxis(nn,t)}translateZ(t){return this.translateOnAxis(rn,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ze.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Ke.copy(t):Ke.set(t,e,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Je.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ze.lookAt(Je,Ke,this.up):Ze.lookAt(Ke,Je,this.up),this.quaternion.setFromRotationMatrix(Ze),r&&(Ze.extractRotation(r.matrixWorld),Ye.setFromRotationMatrix(Ze),this.quaternion.premultiply(Ye.invert()));}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(an),sn.child=t,this.dispatchEvent(sn),sn.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return -1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(on),An.child=t,this.dispatchEvent(An),An.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Ze.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Ze.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ze),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Je,t,$e),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Je,tn,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverse(t);}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverseVisible(t);}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t));}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0;}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,r=e.length;n<r;n++){const r=e[n];!0!==r.matrixWorldAutoUpdate&&!0!==t||r.updateMatrixWorld(t);}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0);}}}toJSON(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),null!==this.boundingBox&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,r=n.length;e<r;e++){const r=n[e];i(t.shapes,r);}else i(t.shapes,n);}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,r=this.material.length;n<r;n++)e.push(i(t.materials,this.material[n]));r.material=e;}else r.material=i(t.materials,this.material);if(this.children.length>0){r.children=[];for(let e=0;e<this.children.length;e++)r.children.push(this.children[e].toJSON(t).object);}if(this.animations.length>0){r.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];r.animations.push(i(t.animations,n));}}if(e){const e=a(t.geometries),r=a(t.materials),i=a(t.textures),o=a(t.images),s=a(t.shapes),A=a(t.skeletons),l=a(t.animations),c=a(t.nodes);e.length>0&&(n.geometries=e),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),A.length>0&&(n.skeletons=A),l.length>0&&(n.animations=l),c.length>0&&(n.nodes=c);}return n.object=r,n;function a(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r);}return e}}clone(t){return (new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone());}return this}}ln.DEFAULT_UP=new ae(0,1,0),ln.DEFAULT_MATRIX_AUTO_UPDATE=!0,ln.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const cn=new ae,un=new ae,hn=new ae,fn=new ae,dn=new ae,pn=new ae,mn=new ae,gn=new ae,vn=new ae,_n=new ae;class yn{constructor(t=new ae,e=new ae,n=new ae){this.a=t,this.b=e,this.c=n;}static getNormal(t,e,n,r){r.subVectors(n,e),cn.subVectors(t,e),r.cross(cn);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(t,e,n,r,i){cn.subVectors(r,e),un.subVectors(n,e),hn.subVectors(t,e);const a=cn.dot(cn),o=cn.dot(un),s=cn.dot(hn),A=un.dot(un),l=un.dot(hn),c=a*A-o*o;if(0===c)return i.set(0,0,0),null;const u=1/c,h=(A*s-o*l)*u,f=(a*l-o*s)*u;return i.set(1-h-f,f,h)}static containsPoint(t,e,n,r){return null!==this.getBarycoord(t,e,n,r,fn)&&(fn.x>=0&&fn.y>=0&&fn.x+fn.y<=1)}static getInterpolation(t,e,n,r,i,a,o,s){return null===this.getBarycoord(t,e,n,r,fn)?(s.x=0,s.y=0,"z"in s&&(s.z=0),"w"in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,fn.x),s.addScaledVector(a,fn.y),s.addScaledVector(o,fn.z),s)}static isFrontFacing(t,e,n,r){return cn.subVectors(n,e),un.subVectors(t,e),cn.cross(un).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,n,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,r),this}clone(){return (new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return cn.subVectors(this.c,this.b),un.subVectors(this.a,this.b),.5*cn.cross(un).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return yn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return yn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,r,i){return yn.getInterpolation(t,this.a,this.b,this.c,e,n,r,i)}containsPoint(t){return yn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return yn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,r=this.b,i=this.c;let a,o;dn.subVectors(r,n),pn.subVectors(i,n),gn.subVectors(t,n);const s=dn.dot(gn),A=pn.dot(gn);if(s<=0&&A<=0)return e.copy(n);vn.subVectors(t,r);const l=dn.dot(vn),c=pn.dot(vn);if(l>=0&&c<=l)return e.copy(r);const u=s*c-l*A;if(u<=0&&s>=0&&l<=0)return a=s/(s-l),e.copy(n).addScaledVector(dn,a);_n.subVectors(t,i);const h=dn.dot(_n),f=pn.dot(_n);if(f>=0&&h<=f)return e.copy(i);const d=h*A-s*f;if(d<=0&&A>=0&&f<=0)return o=A/(A-f),e.copy(n).addScaledVector(pn,o);const p=l*f-h*c;if(p<=0&&c-l>=0&&h-f>=0)return mn.subVectors(i,r),o=(c-l)/(c-l+(h-f)),e.copy(r).addScaledVector(mn,o);const m=1/(p+d+u);return a=d*m,o=u*m,e.copy(n).addScaledVector(dn,a).addScaledVector(pn,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const xn={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},bn={h:0,s:0,l:0},Mn={h:0,s:0,l:0};function wn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}let En=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e);}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=rt){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,Ht.toWorkingColorSpace(this,e),this}setRGB(t,e,n,r=Ht.workingColorSpace){return this.r=t,this.g=e,this.b=n,Ht.toWorkingColorSpace(this,r),this}setHSL(t,e,n,r=Ht.workingColorSpace){if(t=wt(t,1),e=Mt(e,0,1),n=Mt(n,0,1),0===e)this.r=this.g=this.b=n;else {const r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=wn(i,r,t+1/3),this.g=wn(i,r,t),this.b=wn(i,r,t-1/3);}return Ht.toWorkingColorSpace(this,r),this}setStyle(t,e=rt){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.");}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let i;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,e);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,e);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t);}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=r[1],i=n.length;if(3===i)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===i)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t);}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=rt){const n=xn[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=jt(t.r),this.g=jt(t.g),this.b=jt(t.b),this}copyLinearToSRGB(t){return this.r=Vt(t.r),this.g=Vt(t.g),this.b=Vt(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=rt){return Ht.fromWorkingColorSpace(Sn.copy(this),t),65536*Math.round(Mt(255*Sn.r,0,255))+256*Math.round(Mt(255*Sn.g,0,255))+Math.round(Mt(255*Sn.b,0,255))}getHexString(t=rt){return ("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Ht.workingColorSpace){Ht.fromWorkingColorSpace(Sn.copy(this),e);const n=Sn.r,r=Sn.g,i=Sn.b,a=Math.max(n,r,i),o=Math.min(n,r,i);let s,A;const l=(o+a)/2;if(o===a)s=0,A=0;else {const t=a-o;switch(A=l<=.5?t/(a+o):t/(2-a-o),a){case n:s=(r-i)/t+(r<i?6:0);break;case r:s=(i-n)/t+2;break;case i:s=(n-r)/t+4;}s/=6;}return t.h=s,t.s=A,t.l=l,t}getRGB(t,e=Ht.workingColorSpace){return Ht.fromWorkingColorSpace(Sn.copy(this),e),t.r=Sn.r,t.g=Sn.g,t.b=Sn.b,t}getStyle(t=rt){Ht.fromWorkingColorSpace(Sn.copy(this),t);const e=Sn.r,n=Sn.g,r=Sn.b;return t!==rt?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(t,e,n){return this.getHSL(bn),this.setHSL(bn.h+t,bn.s+e,bn.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(bn),t.getHSL(Mn);const n=Et(bn.h,Mn.h,e),r=Et(bn.s,Mn.s,e),i=Et(bn.l,Mn.l,e);return this.setHSL(n,r,i),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,r=this.b,i=t.elements;return this.r=i[0]*e+i[3]*n+i[6]*r,this.g=i[1]*e+i[4]*n+i[7]*r,this.b=i[2]*e+i[5]*n+i[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b;}};const Sn=new En;En.NAMES=xn;let Tn=0;class Cn extends gt{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Tn++}),this.uuid=bt(),this.name="",this.type="Material",this.blending=1,this.side=m,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=v,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new En(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ut,this.stencilZFail=ut,this.stencilZPass=ut,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0;}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t;}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r);}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),this.side!==m&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),this.blendEquation!==v&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ut&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ut&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ut&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=r(t.textures),i=r(t.images);e.length>0&&(n.textures=e),i.length>0&&(n.images=i);}return n}clone(){return (new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let r=0;r!==t;++r)n[r]=e[r].clone();}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"});}set needsUpdate(t){!0===t&&this.version++;}}class Rn extends Cn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new En(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ve,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t);}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Pn=new ae,Ln=new Lt;class Dn{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=ht,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=V,this.version=0;}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++;}get updateRange(){return Bt("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e});}clearUpdateRanges(){this.updateRanges.length=0;}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)Ln.fromBufferAttribute(this,e),Ln.applyMatrix3(t),this.setXY(e,Ln.x,Ln.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.applyMatrix3(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.applyMatrix4(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.applyNormalMatrix(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.transformDirection(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Ct(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Rt(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ct(e,this.array)),e}setX(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ct(e,this.array)),e}setY(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ct(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ct(e,this.array)),e}setW(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,i){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array),i=Rt(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return ""!==this.name&&(t.name=this.name),this.usage!==ht&&(t.usage=this.usage),t}}class On extends Dn{constructor(t,e,n){super(new Uint16Array(t),e,n);}}class In extends Dn{constructor(t,e,n){super(new Uint32Array(t),e,n);}}class qn extends Dn{constructor(t,e,n){super(new Float32Array(t),e,n);}}let Un=0;const Nn=new qe,Bn=new ln,kn=new ae,Fn=new Ae,zn=new Ae,Gn=new ae;class Hn extends gt{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Un++}),this.uuid=bt(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={};}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(It(t)?In:On)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n});}clearGroups(){this.groups=[];}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e;}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new Dt).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0;}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return Nn.makeRotationFromQuaternion(t),this.applyMatrix4(Nn),this}rotateX(t){return Nn.makeRotationX(t),this.applyMatrix4(Nn),this}rotateY(t){return Nn.makeRotationY(t),this.applyMatrix4(Nn),this}rotateZ(t){return Nn.makeRotationZ(t),this.applyMatrix4(Nn),this}translate(t,e,n){return Nn.makeTranslation(t,e,n),this.applyMatrix4(Nn),this}scale(t,e,n){return Nn.makeScale(t,e,n),this.applyMatrix4(Nn),this}lookAt(t){return Bn.lookAt(t),Bn.updateMatrix(),this.applyMatrix4(Bn.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(kn).negate(),this.translate(kn.x,kn.y,kn.z),this}setFromPoints(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];e.push(r.x,r.y,r.z||0);}return this.setAttribute("position",new qn(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Ae);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new ae(-1/0,-1/0,-1/0),new ae(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];Fn.setFromBufferAttribute(n),this.morphTargetsRelative?(Gn.addVectors(this.boundingBox.min,Fn.min),this.boundingBox.expandByPoint(Gn),Gn.addVectors(this.boundingBox.max,Fn.max),this.boundingBox.expandByPoint(Gn)):(this.boundingBox.expandByPoint(Fn.min),this.boundingBox.expandByPoint(Fn.max));}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this);}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Se);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new ae,1/0);if(t){const n=this.boundingSphere.center;if(Fn.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];zn.setFromBufferAttribute(n),this.morphTargetsRelative?(Gn.addVectors(Fn.min,zn.min),Fn.expandByPoint(Gn),Gn.addVectors(Fn.max,zn.max),Fn.expandByPoint(Gn)):(Fn.expandByPoint(zn.min),Fn.expandByPoint(zn.max));}Fn.getCenter(n);let r=0;for(let e=0,i=t.count;e<i;e++)Gn.fromBufferAttribute(t,e),r=Math.max(r,n.distanceToSquared(Gn));if(e)for(let i=0,a=e.length;i<a;i++){const a=e[i],o=this.morphTargetsRelative;for(let e=0,i=a.count;e<i;e++)Gn.fromBufferAttribute(a,e),o&&(kn.fromBufferAttribute(t,e),Gn.add(kn)),r=Math.max(r,n.distanceToSquared(Gn));}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this);}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.position,r=e.normal,i=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Dn(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],s=[];for(let t=0;t<n.count;t++)o[t]=new ae,s[t]=new ae;const A=new ae,l=new ae,c=new ae,u=new Lt,h=new Lt,f=new Lt,d=new ae,p=new ae;function m(t,e,r){A.fromBufferAttribute(n,t),l.fromBufferAttribute(n,e),c.fromBufferAttribute(n,r),u.fromBufferAttribute(i,t),h.fromBufferAttribute(i,e),f.fromBufferAttribute(i,r),l.sub(A),c.sub(A),h.sub(u),f.sub(u);const a=1/(h.x*f.y-f.x*h.y);isFinite(a)&&(d.copy(l).multiplyScalar(f.y).addScaledVector(c,-h.y).multiplyScalar(a),p.copy(c).multiplyScalar(h.x).addScaledVector(l,-f.x).multiplyScalar(a),o[t].add(d),o[e].add(d),o[r].add(d),s[t].add(p),s[e].add(p),s[r].add(p));}let g=this.groups;0===g.length&&(g=[{start:0,count:t.count}]);for(let e=0,n=g.length;e<n;++e){const n=g[e],r=n.start;for(let e=r,i=r+n.count;e<i;e+=3)m(t.getX(e+0),t.getX(e+1),t.getX(e+2));}const v=new ae,_=new ae,y=new ae,x=new ae;function b(t){y.fromBufferAttribute(r,t),x.copy(y);const e=o[t];v.copy(e),v.sub(y.multiplyScalar(y.dot(e))).normalize(),_.crossVectors(x,e);const n=_.dot(s[t])<0?-1:1;a.setXYZW(t,v.x,v.y,v.z,n);}for(let e=0,n=g.length;e<n;++e){const n=g[e],r=n.start;for(let e=r,i=r+n.count;e<i;e+=3)b(t.getX(e+0)),b(t.getX(e+1)),b(t.getX(e+2));}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new Dn(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const r=new ae,i=new ae,a=new ae,o=new ae,s=new ae,A=new ae,l=new ae,c=new ae;if(t)for(let u=0,h=t.count;u<h;u+=3){const h=t.getX(u+0),f=t.getX(u+1),d=t.getX(u+2);r.fromBufferAttribute(e,h),i.fromBufferAttribute(e,f),a.fromBufferAttribute(e,d),l.subVectors(a,i),c.subVectors(r,i),l.cross(c),o.fromBufferAttribute(n,h),s.fromBufferAttribute(n,f),A.fromBufferAttribute(n,d),o.add(l),s.add(l),A.add(l),n.setXYZ(h,o.x,o.y,o.z),n.setXYZ(f,s.x,s.y,s.z),n.setXYZ(d,A.x,A.y,A.z);}else for(let t=0,o=e.count;t<o;t+=3)r.fromBufferAttribute(e,t+0),i.fromBufferAttribute(e,t+1),a.fromBufferAttribute(e,t+2),l.subVectors(a,i),c.subVectors(r,i),l.cross(c),n.setXYZ(t+0,l.x,l.y,l.z),n.setXYZ(t+1,l.x,l.y,l.z),n.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0;}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)Gn.fromBufferAttribute(t,e),Gn.normalize(),t.setXYZ(e,Gn.x,Gn.y,Gn.z);}toNonIndexed(){function t(t,e){const n=t.array,r=t.itemSize,i=t.normalized,a=new n.constructor(e.length*r);let o=0,s=0;for(let i=0,A=e.length;i<A;i++){o=t.isInterleavedBufferAttribute?e[i]*t.data.stride+t.offset:e[i]*r;for(let t=0;t<r;t++)a[s++]=n[o++];}return new Dn(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Hn,n=this.index.array,r=this.attributes;for(const i in r){const a=t(r[i],n);e.setAttribute(i,a);}const i=this.morphAttributes;for(const r in i){const a=[],o=i[r];for(let e=0,r=o.length;e<r;e++){const r=t(o[e],n);a.push(r);}e.morphAttributes[r]=a;}e.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let t=0,n=a.length;t<n;t++){const n=a[t];e.addGroup(n.start,n.count,n.materialIndex);}return e}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const r=n[e];t.data.attributes[e]=r.toJSON(t.data);}const r={};let i=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],a=[];for(let e=0,r=n.length;e<r;e++){const r=n[e];a.push(r.toJSON(t.data));}a.length>0&&(r[e]=a,i=!0);}i&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return (new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const r=t.attributes;for(const t in r){const n=r[t];this.setAttribute(t,n.clone(e));}const i=t.morphAttributes;for(const t in i){const n=[],r=i[t];for(let t=0,i=r.length;t<i;t++)n.push(r[t].clone(e));this.morphAttributes[t]=n;}this.morphTargetsRelative=t.morphTargetsRelative;const a=t.groups;for(let t=0,e=a.length;t<e;t++){const e=a[t];this.addGroup(e.start,e.count,e.materialIndex);}const o=t.boundingBox;null!==o&&(this.boundingBox=o.clone());const s=t.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"});}}const jn=new qe,Vn=new Ie,Wn=new Se,Xn=new ae,Qn=new ae,Yn=new ae,Zn=new ae,Kn=new ae,Jn=new ae,$n=new Lt,tr=new Lt,er=new Lt,nr=new ae,rr=new ae,ir=new ae,ar=new ae,or=new ae;class sr extends ln{constructor(t=new Hn,e=new Rn){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets();}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t;}}}}getVertexPosition(t,e){const n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;e.fromBufferAttribute(r,t);const o=this.morphTargetInfluences;if(i&&o){Jn.set(0,0,0);for(let n=0,r=i.length;n<r;n++){const r=o[n],s=i[n];0!==r&&(Kn.fromBufferAttribute(s,t),a?Jn.addScaledVector(Kn,r):Jn.addScaledVector(Kn.sub(e),r));}e.add(Jn);}return e}raycast(t,e){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),Wn.copy(n.boundingSphere),Wn.applyMatrix4(i),Vn.copy(t.ray).recast(t.near),!1===Wn.containsPoint(Vn.origin)){if(null===Vn.intersectSphere(Wn,Xn))return;if(Vn.origin.distanceToSquared(Xn)>(t.far-t.near)**2)return}jn.copy(i).invert(),Vn.copy(t.ray).applyMatrix4(jn),null!==n.boundingBox&&!1===Vn.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,Vn);}}_computeIntersections(t,e,n){let r;const i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,A=i.attributes.uv,l=i.attributes.uv1,c=i.attributes.normal,u=i.groups,h=i.drawRange;if(null!==o)if(Array.isArray(a))for(let i=0,s=u.length;i<s;i++){const s=u[i],f=a[s.materialIndex];for(let i=Math.max(s.start,h.start),a=Math.min(o.count,Math.min(s.start+s.count,h.start+h.count));i<a;i+=3){r=Ar(this,f,t,n,A,l,c,o.getX(i),o.getX(i+1),o.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,e.push(r));}}else {for(let i=Math.max(0,h.start),s=Math.min(o.count,h.start+h.count);i<s;i+=3){r=Ar(this,a,t,n,A,l,c,o.getX(i),o.getX(i+1),o.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),e.push(r));}}else if(void 0!==s)if(Array.isArray(a))for(let i=0,o=u.length;i<o;i++){const o=u[i],f=a[o.materialIndex];for(let i=Math.max(o.start,h.start),a=Math.min(s.count,Math.min(o.start+o.count,h.start+h.count));i<a;i+=3){r=Ar(this,f,t,n,A,l,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,e.push(r));}}else {for(let i=Math.max(0,h.start),o=Math.min(s.count,h.start+h.count);i<o;i+=3){r=Ar(this,a,t,n,A,l,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),e.push(r));}}}}function Ar(t,e,n,r,i,a,o,s,A,l){t.getVertexPosition(s,Qn),t.getVertexPosition(A,Yn),t.getVertexPosition(l,Zn);const c=function(t,e,n,r,i,a,o,s){let A;if(A=e.side===g?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,e.side===m,s),null===A)return null;or.copy(s),or.applyMatrix4(t.matrixWorld);const l=n.ray.origin.distanceTo(or);return l<n.near||l>n.far?null:{distance:l,point:or.clone(),object:t}}(t,e,n,r,Qn,Yn,Zn,ar);if(c){i&&($n.fromBufferAttribute(i,s),tr.fromBufferAttribute(i,A),er.fromBufferAttribute(i,l),c.uv=yn.getInterpolation(ar,Qn,Yn,Zn,$n,tr,er,new Lt)),a&&($n.fromBufferAttribute(a,s),tr.fromBufferAttribute(a,A),er.fromBufferAttribute(a,l),c.uv1=yn.getInterpolation(ar,Qn,Yn,Zn,$n,tr,er,new Lt)),o&&(nr.fromBufferAttribute(o,s),rr.fromBufferAttribute(o,A),ir.fromBufferAttribute(o,l),c.normal=yn.getInterpolation(ar,Qn,Yn,Zn,nr,rr,ir,new ae),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const t={a:s,b:A,c:l,normal:new ae,materialIndex:0};yn.getNormal(Qn,Yn,Zn,t.normal),c.face=t;}return c}class lr extends Hn{constructor(t=1,e=1,n=1,r=1,i=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};const o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);const s=[],A=[],l=[],c=[];let u=0,h=0;function f(t,e,n,r,i,a,f,d,p,m,g){const v=a/p,_=f/m,y=a/2,x=f/2,b=d/2,M=p+1,w=m+1;let E=0,S=0;const T=new ae;for(let a=0;a<w;a++){const o=a*_-x;for(let s=0;s<M;s++){const u=s*v-y;T[t]=u*r,T[e]=o*i,T[n]=b,A.push(T.x,T.y,T.z),T[t]=0,T[e]=0,T[n]=d>0?1:-1,l.push(T.x,T.y,T.z),c.push(s/p),c.push(1-a/m),E+=1;}}for(let t=0;t<m;t++)for(let e=0;e<p;e++){const n=u+e+M*t,r=u+e+M*(t+1),i=u+(e+1)+M*(t+1),a=u+(e+1)+M*t;s.push(n,r,a),s.push(r,i,a),S+=6;}o.addGroup(h,S,g),h+=S,u+=E;}f("z","y","x",-1,-1,n,e,t,a,i,0),f("z","y","x",1,-1,n,e,-t,a,i,1),f("x","z","y",1,1,t,n,e,r,a,2),f("x","z","y",1,-1,t,n,-e,r,a,3),f("x","y","z",1,-1,t,e,n,r,i,4),f("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new qn(A,3)),this.setAttribute("normal",new qn(l,3)),this.setAttribute("uv",new qn(c,2));}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new lr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function cr(t){const e={};for(const n in t){e[n]={};for(const r in t[n]){const i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][r]=null):e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i;}}return e}function ur(t){const e={};for(let n=0;n<t.length;n++){const r=cr(t[n]);for(const t in r)e[t]=r[t];}return e}function hr(t){return null===t.getRenderTarget()?t.outputColorSpace:Ht.workingColorSpace}const fr={clone:cr,merge:ur};class dr extends Cn{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t);}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=cr(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r};}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class pr extends ln{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new qe,this.projectionMatrix=new qe,this.projectionMatrixInverse=new qe,this.coordinateSystem=pt;}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert();}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert();}clone(){return (new this.constructor).copy(this)}}const mr=new ae,gr=new Lt,vr=new Lt;class _r extends pr{constructor(t=50,e=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix();}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*xt*Math.atan(e),this.updateProjectionMatrix();}getFocalLength(){const t=Math.tan(.5*yt*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*xt*Math.atan(Math.tan(.5*yt*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){mr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(mr.x,mr.y).multiplyScalar(-t/mr.z),mr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(mr.x,mr.y).multiplyScalar(-t/mr.z);}getViewSize(t,e){return this.getViewBounds(t,gr,vr),e.subVectors(vr,gr)}setViewOffset(t,e,n,r,i,a){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix();}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix();}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*yt*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r;const a=this.view;if(null!==this.view&&this.view.enabled){const t=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/t,e-=a.offsetY*n/o,r*=a.width/t,n*=a.height/o;}const o=this.filmOffset;0!==o&&(i+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert();}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const yr=-90;class xr extends ln{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new _r(yr,1,t,e);r.layers=this.layers,this.add(r);const i=new _r(yr,1,t,e);i.layers=this.layers,this.add(i);const a=new _r(yr,1,t,e);a.layers=this.layers,this.add(a);const o=new _r(yr,1,t,e);o.layers=this.layers,this.add(o);const s=new _r(yr,1,t,e);s.layers=this.layers,this.add(s);const A=new _r(yr,1,t,e);A.layers=this.layers,this.add(A);}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,r,i,a,o,s]=e;for(const t of e)this.remove(t);if(t===pt)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else {if(t!==mt)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);}for(const t of e)this.add(t),t.updateMatrixWorld();}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[i,a,o,s,A,l]=this.children,c=t.getRenderTarget(),u=t.getActiveCubeFace(),h=t.getActiveMipmapLevel(),f=t.xr.enabled;t.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,r),t.render(e,i),t.setRenderTarget(n,1,r),t.render(e,a),t.setRenderTarget(n,2,r),t.render(e,o),t.setRenderTarget(n,3,r),t.render(e,s),t.setRenderTarget(n,4,r),t.render(e,A),n.texture.generateMipmaps=d,t.setRenderTarget(n,5,r),t.render(e,l),t.setRenderTarget(c,u,h),t.xr.enabled=f,n.texture.needsPMREMUpdate=!0;}}class br extends Jt{constructor(t,e,n,r,i,a,o,s,A,l){super(t=void 0!==t?t:[],e=void 0!==e?e:P,n,r,i,a,o,s,A,l),this.isCubeTexture=!0,this.flipY=!1;}get images(){return this.image}set images(t){this.image=t;}}class Mr extends ee{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},r=[n,n,n,n,n,n];this.texture=new br(r,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:B;}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new lr(5,5,5),i=new dr({name:"CubemapFromEquirect",uniforms:cr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:g,blending:0});i.uniforms.tEquirect.value=e;const a=new sr(r,i),o=e.minFilter;e.minFilter===F&&(e.minFilter=B);return new xr(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,r){const i=t.getRenderTarget();for(let i=0;i<6;i++)t.setRenderTarget(this,i),t.clear(e,n,r);t.setRenderTarget(i);}}const wr=new ae,Er=new ae,Sr=new Dt;class Tr{constructor(t=new ae(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e;}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const r=wr.subVectors(n,e).cross(Er.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(wr),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:e.copy(t.start).addScaledVector(n,i)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Sr.getNormalMatrix(t),r=this.coplanarPoint(wr).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return (new this.constructor).copy(this)}}const Cr=new Se,Rr=new ae;class Pr{constructor(t=new Tr,e=new Tr,n=new Tr,r=new Tr,i=new Tr,a=new Tr){this.planes=[t,e,n,r,i,a];}set(t,e,n,r,i,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,r=t.elements,i=r[0],a=r[1],o=r[2],s=r[3],A=r[4],l=r[5],c=r[6],u=r[7],h=r[8],f=r[9],d=r[10],p=r[11],m=r[12],g=r[13],v=r[14],_=r[15];if(n[0].setComponents(s-i,u-A,p-h,_-m).normalize(),n[1].setComponents(s+i,u+A,p+h,_+m).normalize(),n[2].setComponents(s+a,u+l,p+f,_+g).normalize(),n[3].setComponents(s-a,u-l,p-f,_-g).normalize(),n[4].setComponents(s-o,u-c,p-d,_-v).normalize(),e===pt)n[5].setComponents(s+o,u+c,p+d,_+v).normalize();else {if(e!==mt)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(o,c,d,v).normalize();}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Cr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else {const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Cr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld);}return this.intersectsSphere(Cr)}intersectsSprite(t){return Cr.center.set(0,0,0),Cr.radius=.7071067811865476,Cr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Cr)}intersectsSphere(t){const e=this.planes,n=t.center,r=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)<r)return !1}return !0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const r=e[n];if(Rr.x=r.normal.x>0?t.max.x:t.min.x,Rr.y=r.normal.y>0?t.max.y:t.min.y,Rr.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Rr)<0)return !1}return !0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return !1;return !0}clone(){return (new this.constructor).copy(this)}}function Lr(){let t=null,e=!1,n=null,r=null;function i(e,a){n(e,a),r=t.requestAnimationFrame(i);}return {start:function(){!0!==e&&null!==n&&(r=t.requestAnimationFrame(i),e=!0);},stop:function(){t.cancelAnimationFrame(r),e=!1;},setAnimationLoop:function(t){n=t;},setContext:function(e){t=e;}}}function Dr(t,e){const n=e.isWebGL2,r=new WeakMap;return {get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e));},update:function(e,i){if(e.isGLBufferAttribute){const t=r.get(e);return void((!t||t.version<e.version)&&r.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const a=r.get(e);if(void 0===a)r.set(e,function(e,r){const i=e.array,a=e.usage,o=i.byteLength,s=t.createBuffer();let A;if(t.bindBuffer(r,s),t.bufferData(r,i,a),e.onUploadCallback(),i instanceof Float32Array)A=t.FLOAT;else if(i instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");A=t.HALF_FLOAT;}else A=t.UNSIGNED_SHORT;else if(i instanceof Int16Array)A=t.SHORT;else if(i instanceof Uint32Array)A=t.UNSIGNED_INT;else if(i instanceof Int32Array)A=t.INT;else if(i instanceof Int8Array)A=t.BYTE;else if(i instanceof Uint8Array)A=t.UNSIGNED_BYTE;else {if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);A=t.UNSIGNED_BYTE;}return {buffer:s,type:A,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,size:o}}(e,i));else if(a.version<e.version){if(a.size!==e.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(e,r,i){const a=r.array,o=r._updateRange,s=r.updateRanges;if(t.bindBuffer(i,e),-1===o.count&&0===s.length&&t.bufferSubData(i,0,a),0!==s.length){for(let e=0,r=s.length;e<r;e++){const r=s[e];n?t.bufferSubData(i,r.start*a.BYTES_PER_ELEMENT,a,r.start,r.count):t.bufferSubData(i,r.start*a.BYTES_PER_ELEMENT,a.subarray(r.start,r.start+r.count));}r.clearUpdateRanges();}-1!==o.count&&(n?t.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):t.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1),r.onUploadCallback();}(a.buffer,e,i),a.version=e.version;}}}}class Or extends Hn{constructor(t=1,e=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};const i=t/2,a=e/2,o=Math.floor(n),s=Math.floor(r),A=o+1,l=s+1,c=t/o,u=e/s,h=[],f=[],d=[],p=[];for(let t=0;t<l;t++){const e=t*u-a;for(let n=0;n<A;n++){const r=n*c-i;f.push(r,-e,0),d.push(0,0,1),p.push(n/o),p.push(1-t/s);}}for(let t=0;t<s;t++)for(let e=0;e<o;e++){const n=e+A*t,r=e+A*(t+1),i=e+1+A*(t+1),a=e+1+A*t;h.push(n,r,a),h.push(r,i,a);}this.setIndex(h),this.setAttribute("position",new qn(f,3)),this.setAttribute("normal",new qn(d,3)),this.setAttribute("uv",new qn(p,2));}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Or(t.width,t.height,t.widthSegments,t.heightSegments)}}const Ir={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\tattribute float batchId;\n\tuniform highp sampler2D batchingTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( batchId );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660,  0.0556434,\n\t\t-1.5371385,  1.8760108, -0.2040259,\n\t\t-0.4985314,  0.0415560,  1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n    float x2 = x * x;\n    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(  1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,  1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tfloat startCompression = 0.8 - 0.04;\n\tfloat desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min(color.r, min(color.g, color.b));\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max(color.r, max(color.g, color.b));\n\tif (peak < startCompression) return color;\n\tfloat d = 1. - startCompression;\n\tfloat newPeak = 1. - d * d / (peak + d - startCompression);\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / (desaturation * (peak - newPeak) + 1.);\n\treturn mix(color, vec3(1, 1, 1), g);\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},qr={common:{diffuse:{value:new En(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Dt}},envmap:{envMap:{value:null},envMapRotation:{value:new Dt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Dt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Dt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Dt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Dt},normalScale:{value:new Lt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Dt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Dt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Dt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Dt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new En(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new En(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new En(16777215)},opacity:{value:1},center:{value:new Lt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}}},Ur={basic:{uniforms:ur([qr.common,qr.specularmap,qr.envmap,qr.aomap,qr.lightmap,qr.fog]),vertexShader:Ir.meshbasic_vert,fragmentShader:Ir.meshbasic_frag},lambert:{uniforms:ur([qr.common,qr.specularmap,qr.envmap,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.fog,qr.lights,{emissive:{value:new En(0)}}]),vertexShader:Ir.meshlambert_vert,fragmentShader:Ir.meshlambert_frag},phong:{uniforms:ur([qr.common,qr.specularmap,qr.envmap,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.fog,qr.lights,{emissive:{value:new En(0)},specular:{value:new En(1118481)},shininess:{value:30}}]),vertexShader:Ir.meshphong_vert,fragmentShader:Ir.meshphong_frag},standard:{uniforms:ur([qr.common,qr.envmap,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.roughnessmap,qr.metalnessmap,qr.fog,qr.lights,{emissive:{value:new En(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ir.meshphysical_vert,fragmentShader:Ir.meshphysical_frag},toon:{uniforms:ur([qr.common,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.gradientmap,qr.fog,qr.lights,{emissive:{value:new En(0)}}]),vertexShader:Ir.meshtoon_vert,fragmentShader:Ir.meshtoon_frag},matcap:{uniforms:ur([qr.common,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.fog,{matcap:{value:null}}]),vertexShader:Ir.meshmatcap_vert,fragmentShader:Ir.meshmatcap_frag},points:{uniforms:ur([qr.points,qr.fog]),vertexShader:Ir.points_vert,fragmentShader:Ir.points_frag},dashed:{uniforms:ur([qr.common,qr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ir.linedashed_vert,fragmentShader:Ir.linedashed_frag},depth:{uniforms:ur([qr.common,qr.displacementmap]),vertexShader:Ir.depth_vert,fragmentShader:Ir.depth_frag},normal:{uniforms:ur([qr.common,qr.bumpmap,qr.normalmap,qr.displacementmap,{opacity:{value:1}}]),vertexShader:Ir.meshnormal_vert,fragmentShader:Ir.meshnormal_frag},sprite:{uniforms:ur([qr.sprite,qr.fog]),vertexShader:Ir.sprite_vert,fragmentShader:Ir.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ir.background_vert,fragmentShader:Ir.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Dt}},vertexShader:Ir.backgroundCube_vert,fragmentShader:Ir.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ir.cube_vert,fragmentShader:Ir.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ir.equirect_vert,fragmentShader:Ir.equirect_frag},distanceRGBA:{uniforms:ur([qr.common,qr.displacementmap,{referencePosition:{value:new ae},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ir.distanceRGBA_vert,fragmentShader:Ir.distanceRGBA_frag},shadow:{uniforms:ur([qr.lights,qr.fog,{color:{value:new En(0)},opacity:{value:1}}]),vertexShader:Ir.shadow_vert,fragmentShader:Ir.shadow_frag}};Ur.physical={uniforms:ur([Ur.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Dt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Dt},clearcoatNormalScale:{value:new Lt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Dt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Dt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Dt},sheen:{value:0},sheenColor:{value:new En(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Dt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Dt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Dt},transmissionSamplerSize:{value:new Lt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Dt},attenuationDistance:{value:0},attenuationColor:{value:new En(0)},specularColor:{value:new En(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Dt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Dt},anisotropyVector:{value:new Lt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Dt}}]),vertexShader:Ir.meshphysical_vert,fragmentShader:Ir.meshphysical_frag};const Nr={r:0,b:0,g:0},Br=new Ve,kr=new qe;function Fr(t,e,n,r,i,a,o){const s=new En(0);let A,l,c=!0===a?0:1,u=null,h=0,f=null;function d(e,n){e.getRGB(Nr,hr(t)),r.buffers.color.setClear(Nr.r,Nr.g,Nr.b,n,o);}return {getClearColor:function(){return s},setClearColor:function(t,e=1){s.set(t),c=e,d(s,c);},getClearAlpha:function(){return c},setClearAlpha:function(t){c=t,d(s,c);},render:function(a,p){let v=!1,_=!0===p.isScene?p.background:null;if(_&&_.isTexture){_=(p.backgroundBlurriness>0?n:e).get(_);}null===_?d(s,c):_&&_.isColor&&(d(_,1),v=!0);const y=t.xr.getEnvironmentBlendMode();"additive"===y?r.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===y&&r.buffers.color.setClear(0,0,0,0,o),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),_&&(_.isCubeTexture||_.mapping===D)?(void 0===l&&(l=new sr(new lr(1,1,1),new dr({name:"BackgroundCubeMaterial",uniforms:cr(Ur.backgroundCube.uniforms),vertexShader:Ur.backgroundCube.vertexShader,fragmentShader:Ur.backgroundCube.fragmentShader,side:g,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld);},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),Br.copy(p.backgroundRotation),Br.x*=-1,Br.y*=-1,Br.z*=-1,_.isCubeTexture&&!1===_.isRenderTargetTexture&&(Br.y*=-1,Br.z*=-1),l.material.uniforms.envMap.value=_,l.material.uniforms.flipEnvMap.value=_.isCubeTexture&&!1===_.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=p.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(kr.makeRotationFromEuler(Br)),l.material.toneMapped=Ht.getTransfer(_.colorSpace)!==At,u===_&&h===_.version&&f===t.toneMapping||(l.material.needsUpdate=!0,u=_,h=_.version,f=t.toneMapping),l.layers.enableAll(),a.unshift(l,l.geometry,l.material,0,0,null)):_&&_.isTexture&&(void 0===A&&(A=new sr(new Or(2,2),new dr({name:"BackgroundMaterial",uniforms:cr(Ur.background.uniforms),vertexShader:Ur.background.vertexShader,fragmentShader:Ur.background.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),A.geometry.deleteAttribute("normal"),Object.defineProperty(A.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(A)),A.material.uniforms.t2D.value=_,A.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,A.material.toneMapped=Ht.getTransfer(_.colorSpace)!==At,!0===_.matrixAutoUpdate&&_.updateMatrix(),A.material.uniforms.uvTransform.value.copy(_.matrix),u===_&&h===_.version&&f===t.toneMapping||(A.material.needsUpdate=!0,u=_,h=_.version,f=t.toneMapping),A.layers.enableAll(),a.unshift(A,A.geometry,A.material,0,0,null));}}}function zr(t,e,n,r){const i=t.getParameter(t.MAX_VERTEX_ATTRIBS),a=r.isWebGL2?null:e.get("OES_vertex_array_object"),o=r.isWebGL2||null!==a,s={},A=f(null);let l=A,c=!1;function u(e){return r.isWebGL2?t.bindVertexArray(e):a.bindVertexArrayOES(e)}function h(e){return r.isWebGL2?t.deleteVertexArray(e):a.deleteVertexArrayOES(e)}function f(t){const e=[],n=[],r=[];for(let t=0;t<i;t++)e[t]=0,n[t]=0,r[t]=0;return {geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:n,attributeDivisors:r,object:t,attributes:{},index:null}}function d(){const t=l.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0;}function p(t){m(t,0);}function m(n,i){const a=l.newAttributes,o=l.enabledAttributes,s=l.attributeDivisors;if(a[n]=1,0===o[n]&&(t.enableVertexAttribArray(n),o[n]=1),s[n]!==i){(r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i;}}function g(){const e=l.newAttributes,n=l.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==e[r]&&(t.disableVertexAttribArray(r),n[r]=0);}function v(e,n,r,i,a,o,s){!0===s?t.vertexAttribIPointer(e,n,r,a,o):t.vertexAttribPointer(e,n,r,i,a,o);}function _(){y(),c=!0,l!==A&&(l=A,u(l.object));}function y(){A.geometry=null,A.program=null,A.wireframe=!1;}return {setup:function(i,A,h,_,y){let x=!1;if(o){const e=function(e,n,i){const o=!0===i.wireframe;let A=s[e.id];void 0===A&&(A={},s[e.id]=A);let l=A[n.id];void 0===l&&(l={},A[n.id]=l);let c=l[o];void 0===c&&(c=f(r.isWebGL2?t.createVertexArray():a.createVertexArrayOES()),l[o]=c);return c}(_,h,A);l!==e&&(l=e,u(l.object)),x=function(t,e,n,r){const i=l.attributes,a=e.attributes;let o=0;const s=n.getAttributes();for(const e in s){if(s[e].location>=0){const n=i[e];let r=a[e];if(void 0===r&&("instanceMatrix"===e&&t.instanceMatrix&&(r=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(r=t.instanceColor)),void 0===n)return !0;if(n.attribute!==r)return !0;if(r&&n.data!==r.data)return !0;o++;}}return l.attributesNum!==o||l.index!==r}(i,_,h,y),x&&function(t,e,n,r){const i={},a=e.attributes;let o=0;const s=n.getAttributes();for(const e in s){if(s[e].location>=0){let n=a[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[e]=r,o++;}}l.attributes=i,l.attributesNum=o,l.index=r;}(i,_,h,y);}else {const t=!0===A.wireframe;l.geometry===_.id&&l.program===h.id&&l.wireframe===t||(l.geometry=_.id,l.program=h.id,l.wireframe=t,x=!0);}null!==y&&n.update(y,t.ELEMENT_ARRAY_BUFFER),(x||c)&&(c=!1,function(i,a,o,s){if(!1===r.isWebGL2&&(i.isInstancedMesh||s.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;d();const A=s.attributes,l=o.getAttributes(),c=a.defaultAttributeValues;for(const e in l){const a=l[e];if(a.location>=0){let o=A[e];if(void 0===o&&("instanceMatrix"===e&&i.instanceMatrix&&(o=i.instanceMatrix),"instanceColor"===e&&i.instanceColor&&(o=i.instanceColor)),void 0!==o){const e=o.normalized,A=o.itemSize,l=n.get(o);if(void 0===l)continue;const c=l.buffer,u=l.type,h=l.bytesPerElement,f=!0===r.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||o.gpuType===H);if(o.isInterleavedBufferAttribute){const n=o.data,r=n.stride,l=o.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t<a.locationSize;t++)m(a.location+t,n.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count);}else for(let t=0;t<a.locationSize;t++)p(a.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<a.locationSize;t++)v(a.location+t,A/a.locationSize,u,e,r*h,(l+A/a.locationSize*t)*h,f);}else {if(o.isInstancedBufferAttribute){for(let t=0;t<a.locationSize;t++)m(a.location+t,o.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count);}else for(let t=0;t<a.locationSize;t++)p(a.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<a.locationSize;t++)v(a.location+t,A/a.locationSize,u,e,A*h,A/a.locationSize*t*h,f);}}else if(void 0!==c){const n=c[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(a.location,n);break;case 3:t.vertexAttrib3fv(a.location,n);break;case 4:t.vertexAttrib4fv(a.location,n);break;default:t.vertexAttrib1fv(a.location,n);}}}}g();}(i,A,h,_),null!==y&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(y).buffer));},reset:_,resetDefaultState:y,dispose:function(){_();for(const t in s){const e=s[t];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t];}delete s[t];}},releaseStatesOfGeometry:function(t){if(void 0===s[t.id])return;const e=s[t.id];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t];}delete s[t.id];},releaseStatesOfProgram:function(t){for(const e in s){const n=s[e];if(void 0===n[t.id])continue;const r=n[t.id];for(const t in r)h(r[t].object),delete r[t];delete n[t.id];}},initAttributes:d,enableAttribute:p,disableUnusedAttributes:g}}function Gr(t,e,n,r){const i=r.isWebGL2;let a;this.setMode=function(t){a=t;},this.render=function(e,r){t.drawArrays(a,e,r),n.update(r,a,1);},this.renderInstances=function(r,o,s){if(0===s)return;let A,l;if(i)A=t,l="drawArraysInstanced";else if(A=e.get("ANGLE_instanced_arrays"),l="drawArraysInstancedANGLE",null===A)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");A[l](a,r,o,s),n.update(o,a,s);},this.renderMultiDraw=function(t,r,i){if(0===i)return;const o=e.get("WEBGL_multi_draw");if(null===o)for(let e=0;e<i;e++)this.render(t[e],r[e]);else {o.multiDrawArraysWEBGL(a,t,0,r,0,i);let e=0;for(let t=0;t<i;t++)e+=r[t];n.update(e,a,1);}};}function Hr(t,e,n){let r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return "highp";e="mediump";}return "mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let o=void 0!==n.precision?n.precision:"highp";const s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const A=a||e.has("WEBGL_draw_buffers"),l=!0===n.logarithmicDepthBuffer,c=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=t.getParameter(t.MAX_TEXTURE_SIZE),f=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),d=t.getParameter(t.MAX_VERTEX_ATTRIBS),p=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),g=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=u>0,_=a||e.has("OES_texture_float");return {isWebGL2:a,drawBuffers:A,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT);}else r=0;return r},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:f,maxAttributes:d,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:v&&_,maxSamples:a?t.getParameter(t.MAX_SAMPLES):0}}function jr(t){const e=this;let n=null,r=0,i=!1,a=!1;const o=new Tr,s=new Dt,A={value:null,needsUpdate:!1};function l(t,n,r,i){const a=null!==t?t.length:0;let l=null;if(0!==a){if(l=A.value,!0!==i||null===l){const e=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===l||l.length<e)&&(l=new Float32Array(e));for(let e=0,n=r;e!==a;++e,n+=4)o.copy(t[e]).applyMatrix4(i,s),o.normal.toArray(l,n),l[n+3]=o.constant;}A.value=l,A.needsUpdate=!0;}return e.numPlanes=a,e.numIntersection=0,l}this.uniform=A,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e){const n=0!==t.length||e||0!==r||i;return i=e,r=t.length,n},this.beginShadows=function(){a=!0,l(null);},this.endShadows=function(){a=!1;},this.setGlobalState=function(t,e){n=l(t,e,0);},this.setState=function(o,s,c){const u=o.clippingPlanes,h=o.clipIntersection,f=o.clipShadows,d=t.get(o);if(!i||null===u||0===u.length||a&&!f)a?l(null):function(){A.value!==n&&(A.value=n,A.needsUpdate=r>0);e.numPlanes=r,e.numIntersection=0;}();else {const t=a?0:r,e=4*t;let i=d.clippingState||null;A.value=i,i=l(u,s,e,c);for(let t=0;t!==e;++t)i[t]=n[t];d.clippingState=i,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=t;}};}function Vr(t){let e=new WeakMap;function n(t,e){return 303===e?t.mapping=P:304===e&&(t.mapping=L),t}function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose());}return {get:function(i){if(i&&i.isTexture){const a=i.mapping;if(303===a||304===a){if(e.has(i)){return n(e.get(i).texture,i.mapping)}{const a=i.image;if(a&&a.height>0){const o=new Mr(a.height);return o.fromEquirectangularTexture(t,i),e.set(i,o),i.addEventListener("dispose",r),n(o.texture,i.mapping)}return null}}}return i},dispose:function(){e=new WeakMap;}}}class Wr extends pr{constructor(t=-1,e=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix();}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix();}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix();}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-t,a=n+t,o=r+e,s=r-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=t*this.view.offsetX,a=i+t*this.view.width,o-=e*this.view.offsetY,s=o-e*this.view.height;}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert();}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const Xr=[.125,.215,.35,.446,.526,.582],Qr=20,Yr=new Wr,Zr=new En;let Kr=null,Jr=0,$r=0;const ti=(1+Math.sqrt(5))/2,ei=1/ti,ni=[new ae(1,1,1),new ae(-1,1,1),new ae(1,1,-1),new ae(-1,1,-1),new ae(0,ti,ei),new ae(0,ti,-ei),new ae(ei,0,ti),new ae(-ei,0,ti),new ae(ti,ei,0),new ae(-ti,ei,0)];class ri{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial);}fromScene(t,e=0,n=.1,r=100){Kr=this._renderer.getRenderTarget(),Jr=this._renderer.getActiveCubeFace(),$r=this._renderer.getActiveMipmapLevel(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(t,n,r,i),e>0&&this._blur(i,0,0,e),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=si(),this._compileMaterial(this._cubemapMaterial));}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=oi(),this._compileMaterial(this._equirectMaterial));}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose();}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax);}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose();}_cleanup(t){this._renderer.setRenderTarget(Kr,Jr,$r),t.scissorTest=!1,ai(t,0,0,t.width,t.height);}_fromTexture(t,e){t.mapping===P||t.mapping===L?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Kr=this._renderer.getRenderTarget(),Jr=this._renderer.getActiveCubeFace(),$r=this._renderer.getActiveMipmapLevel();const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:B,minFilter:B,generateMipmaps:!1,type:W,format:Q,colorSpace:it,depthBuffer:!1},r=ii(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=ii(t,e,n);const{_lodMax:r}=this;(({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],n=[],r=[];let i=t;const a=t-4+1+Xr.length;for(let o=0;o<a;o++){const a=Math.pow(2,i);n.push(a);let s=1/a;o>t-4?s=Xr[o-t+4-1]:0===o&&(s=0),r.push(s);const A=1/(a-2),l=-A,c=1+A,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,f=6,d=3,p=2,m=1,g=new Float32Array(d*f*h),v=new Float32Array(p*f*h),_=new Float32Array(m*f*h);for(let t=0;t<h;t++){const e=t%3*2/3-1,n=t>2?0:-1,r=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];g.set(r,d*f*t),v.set(u,p*f*t);const i=[t,t,t,t,t,t];_.set(i,m*f*t);}const y=new Hn;y.setAttribute("position",new Dn(g,d)),y.setAttribute("uv",new Dn(v,p)),y.setAttribute("faceIndex",new Dn(_,m)),e.push(y),i>4&&i--;}return {lodPlanes:e,sizeLods:n,sigmas:r}}(r))),this._blurMaterial=function(t,e,n){const r=new Float32Array(Qr),i=new ae(0,1,0),a=new dr({name:"SphericalGaussianBlur",defines:{n:Qr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Ai(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return a}(r,t,e);}return r}_compileMaterial(t){const e=new sr(this._lodPlanes[0],t);this._renderer.compile(e,Yr);}_sceneToCubeUV(t,e,n,r){const i=new _r(90,1,e,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,A=s.autoClear,l=s.toneMapping;s.getClearColor(Zr),s.toneMapping=b,s.autoClear=!1;const c=new Rn({name:"PMREM.Background",side:g,depthWrite:!1,depthTest:!1}),u=new sr(new lr,c);let h=!1;const f=t.background;f?f.isColor&&(c.color.copy(f),t.background=null,h=!0):(c.color.copy(Zr),h=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(i.up.set(0,a[e],0),i.lookAt(o[e],0,0)):1===n?(i.up.set(0,0,a[e]),i.lookAt(0,o[e],0)):(i.up.set(0,a[e],0),i.lookAt(0,0,o[e]));const A=this._cubeSize;ai(r,n*A,e>2?A:0,A,A),s.setRenderTarget(r),h&&s.render(u,i),s.render(t,i);}u.geometry.dispose(),u.material.dispose(),s.toneMapping=l,s.autoClear=A,t.background=f;}_textureToCubeUV(t,e){const n=this._renderer,r=t.mapping===P||t.mapping===L;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=si()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=oi());const i=r?this._cubemapMaterial:this._equirectMaterial,a=new sr(this._lodPlanes[0],i);i.uniforms.envMap.value=t;const o=this._cubeSize;ai(e,0,0,3*o,2*o),n.setRenderTarget(e),n.render(a,Yr);}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;e<this._lodPlanes.length;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),r=ni[(e-1)%ni.length];this._blur(t,e-1,e,n,r);}e.autoClear=n;}_blur(t,e,n,r,i){const a=this._pingPongRenderTarget;this._halfBlur(t,a,e,n,r,"latitudinal",i),this._halfBlur(a,t,n,n,r,"longitudinal",i);}_halfBlur(t,e,n,r,i,a,o){const s=this._renderer,A=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const l=new sr(this._lodPlanes[r],A),c=A.uniforms,u=this._sizeLods[n]-1,h=isFinite(i)?Math.PI/(2*u):2*Math.PI/39,f=i/h,d=isFinite(i)?1+Math.floor(3*f):Qr;d>Qr&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${d} samples when the maximum is set to 20`);const p=[];let m=0;for(let t=0;t<Qr;++t){const e=t/f,n=Math.exp(-e*e/2);p.push(n),0===t?m+=n:t<d&&(m+=2*n);}for(let t=0;t<p.length;t++)p[t]=p[t]/m;c.envMap.value=t.texture,c.samples.value=d,c.weights.value=p,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o);const{_lodMax:g}=this;c.dTheta.value=h,c.mipInt.value=g-n;const v=this._sizeLods[r];ai(e,3*v*(r>g-4?r-g+4:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(e),s.render(l,Yr);}}function ii(t,e,n){const r=new ee(t,e,n);return r.texture.mapping=D,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function ai(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i);}function oi(){return new dr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ai(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function si(){return new dr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ai(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Ai(){return "\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function li(t){let e=new WeakMap,n=null;function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose());}return {get:function(i){if(i&&i.isTexture){const a=i.mapping,o=303===a||304===a,s=a===P||a===L;if(o||s){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=e.get(i);return null===n&&(n=new ri(t)),r=o?n.fromEquirectangular(i,r):n.fromCubemap(i,r),e.set(i,r),r.texture}if(e.has(i))return e.get(i).texture;{const a=i.image;if(o&&a&&a.height>0||s&&a&&function(t){let e=0;const n=6;for(let r=0;r<n;r++)void 0!==t[r]&&e++;return e===n}(a)){null===n&&(n=new ri(t));const a=o?n.fromEquirectangular(i):n.fromCubemap(i);return e.set(i,a),i.addEventListener("dispose",r),a.texture}return null}}}return i},dispose:function(){e=new WeakMap,null!==n&&(n.dispose(),n=null);}}}function ci(t){const e={};function n(n){if(void 0!==e[n])return e[n];let r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n);}return e[n]=r,r}return {has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?(n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance")):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture");},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function ui(t,e,n,r){const i={},a=new WeakMap;function o(t){const s=t.target;null!==s.index&&e.remove(s.index);for(const t in s.attributes)e.remove(s.attributes[t]);for(const t in s.morphAttributes){const n=s.morphAttributes[t];for(let t=0,r=n.length;t<r;t++)e.remove(n[t]);}s.removeEventListener("dispose",o),delete i[s.id];const A=a.get(s);A&&(e.remove(A),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--;}function s(t){const n=[],r=t.index,i=t.attributes.position;let o=0;if(null!==r){const t=r.array;o=r.version;for(let e=0,r=t.length;e<r;e+=3){const r=t[e+0],i=t[e+1],a=t[e+2];n.push(r,i,i,a,a,r);}}else {if(void 0===i)return;{const t=i.array;o=i.version;for(let e=0,r=t.length/3-1;e<r;e+=3){const t=e+0,r=e+1,i=e+2;n.push(t,r,r,i,i,t);}}}const s=new(It(n)?In:On)(n,1);s.version=o;const A=a.get(t);A&&e.remove(A),a.set(t,s);}return {get:function(t,e){return !0===i[e.id]||(e.addEventListener("dispose",o),i[e.id]=!0,n.memory.geometries++),e},update:function(n){const r=n.attributes;for(const n in r)e.update(r[n],t.ARRAY_BUFFER);const i=n.morphAttributes;for(const n in i){const r=i[n];for(let n=0,i=r.length;n<i;n++)e.update(r[n],t.ARRAY_BUFFER);}},getWireframeAttribute:function(t){const e=a.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&s(t);}else s(t);return a.get(t)}}}function hi(t,e,n,r){const i=r.isWebGL2;let a,o,s;this.setMode=function(t){a=t;},this.setIndex=function(t){o=t.type,s=t.bytesPerElement;},this.render=function(e,r){t.drawElements(a,r,o,e*s),n.update(r,a,1);},this.renderInstances=function(r,A,l){if(0===l)return;let c,u;if(i)c=t,u="drawElementsInstanced";else if(c=e.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===c)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](a,A,o,r*s,l),n.update(A,a,l);},this.renderMultiDraw=function(t,r,i){if(0===i)return;const A=e.get("WEBGL_multi_draw");if(null===A)for(let e=0;e<i;e++)this.render(t[e]/s,r[e]);else {A.multiDrawElementsWEBGL(a,r,0,o,t,0,i);let e=0;for(let t=0;t<i;t++)e+=r[t];n.update(e,a,1);}};}function fi(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return {memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.calls=0,e.triangles=0,e.points=0,e.lines=0;},update:function(n,r,i){switch(e.calls++,r){case t.TRIANGLES:e.triangles+=i*(n/3);break;case t.LINES:e.lines+=i*(n/2);break;case t.LINE_STRIP:e.lines+=i*(n-1);break;case t.LINE_LOOP:e.lines+=i*n;break;case t.POINTS:e.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r);}}}}function di(t,e){return t[0]-e[0]}function pi(t,e){return Math.abs(e[1])-Math.abs(t[1])}function mi(t,e,n){const r={},i=new Float32Array(8),a=new WeakMap,o=new $t,s=[];for(let t=0;t<8;t++)s[t]=[t,0];return {update:function(A,l,c){const u=A.morphTargetInfluences;if(!0===e.isWebGL2){const h=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,f=void 0!==h?h.length:0;let d=a.get(l);if(void 0===d||d.count!==f){void 0!==d&&d.texture.dispose();const p=void 0!==l.morphAttributes.position,m=void 0!==l.morphAttributes.normal,g=void 0!==l.morphAttributes.color,v=l.morphAttributes.position||[],_=l.morphAttributes.normal||[],y=l.morphAttributes.color||[];let x=0;!0===p&&(x=1),!0===m&&(x=2),!0===g&&(x=3);let b=l.attributes.position.count*x,M=1;b>e.maxTextureSize&&(M=Math.ceil(b/e.maxTextureSize),b=e.maxTextureSize);const w=new Float32Array(b*M*4*f),E=new ne(w,b,M,f);E.type=V,E.needsUpdate=!0;const S=4*x;for(let C=0;C<f;C++){const R=v[C],P=_[C],L=y[C],D=b*M*4*C;for(let O=0;O<R.count;O++){const I=O*S;!0===p&&(o.fromBufferAttribute(R,O),w[D+I+0]=o.x,w[D+I+1]=o.y,w[D+I+2]=o.z,w[D+I+3]=0),!0===m&&(o.fromBufferAttribute(P,O),w[D+I+4]=o.x,w[D+I+5]=o.y,w[D+I+6]=o.z,w[D+I+7]=0),!0===g&&(o.fromBufferAttribute(L,O),w[D+I+8]=o.x,w[D+I+9]=o.y,w[D+I+10]=o.z,w[D+I+11]=4===L.itemSize?o.w:1);}}function T(){E.dispose(),a.delete(l),l.removeEventListener("dispose",T);}d={count:f,texture:E,size:new Lt(b,M)},a.set(l,d),l.addEventListener("dispose",T);}if(!0===A.isInstancedMesh&&null!==A.morphTexture)c.getUniforms().setValue(t,"morphTexture",A.morphTexture,n);else {let q=0;for(let N=0;N<u.length;N++)q+=u[N];const U=l.morphTargetsRelative?1:1-q;c.getUniforms().setValue(t,"morphTargetBaseInfluence",U),c.getUniforms().setValue(t,"morphTargetInfluences",u);}c.getUniforms().setValue(t,"morphTargetsTexture",d.texture,n),c.getUniforms().setValue(t,"morphTargetsTextureSize",d.size);}else {const B=void 0===u?0:u.length;let k=r[l.id];if(void 0===k||k.length!==B){k=[];for(let j=0;j<B;j++)k[j]=[j,0];r[l.id]=k;}for(let W=0;W<B;W++){const X=k[W];X[0]=W,X[1]=u[W];}k.sort(pi);for(let Q=0;Q<8;Q++)Q<B&&k[Q][1]?(s[Q][0]=k[Q][0],s[Q][1]=k[Q][1]):(s[Q][0]=Number.MAX_SAFE_INTEGER,s[Q][1]=0);s.sort(di);const F=l.morphAttributes.position,z=l.morphAttributes.normal;let G=0;for(let Y=0;Y<8;Y++){const Z=s[Y],K=Z[0],J=Z[1];K!==Number.MAX_SAFE_INTEGER&&J?(F&&l.getAttribute("morphTarget"+Y)!==F[K]&&l.setAttribute("morphTarget"+Y,F[K]),z&&l.getAttribute("morphNormal"+Y)!==z[K]&&l.setAttribute("morphNormal"+Y,z[K]),i[Y]=J,G+=J):(F&&!0===l.hasAttribute("morphTarget"+Y)&&l.deleteAttribute("morphTarget"+Y),z&&!0===l.hasAttribute("morphNormal"+Y)&&l.deleteAttribute("morphNormal"+Y),i[Y]=0);}const H=l.morphTargetsRelative?1:1-G;c.getUniforms().setValue(t,"morphTargetBaseInfluence",H),c.getUniforms().setValue(t,"morphTargetInfluences",i);}}}}function gi(t,e,n,r){let i=new WeakMap;function a(t){const e=t.target;e.removeEventListener("dispose",a),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor);}return {update:function(o){const s=r.render.frame,A=o.geometry,l=e.get(o,A);if(i.get(l)!==s&&(e.update(l),i.set(l,s)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",a)&&o.addEventListener("dispose",a),i.get(o)!==s&&(n.update(o.instanceMatrix,t.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,t.ARRAY_BUFFER),i.set(o,s))),o.isSkinnedMesh){const t=o.skeleton;i.get(t)!==s&&(t.update(),i.set(t,s));}return l},dispose:function(){i=new WeakMap;}}}class vi extends Jt{constructor(t,e,n,r,i,a,o,s,A,l){if((l=void 0!==l?l:Y)!==Y&&l!==Z)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===Y&&(n=j),void 0===n&&l===Z&&(n=X),super(null,r,i,a,o,s,l,n,A),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==o?o:U,this.minFilter=void 0!==s?s:U,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null;}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}const _i=new Jt,yi=new vi(1,1);yi.compareFunction=515;const xi=new ne,bi=new re,Mi=new br,wi=[],Ei=[],Si=new Float32Array(16),Ti=new Float32Array(9),Ci=new Float32Array(4);function Ri(t,e,n){const r=t[0];if(r<=0||r>0)return t;const i=e*n;let a=wi[i];if(void 0===a&&(a=new Float32Array(i),wi[i]=a),0!==e){r.toArray(a,0);for(let r=1,i=0;r!==e;++r)i+=n,t[r].toArray(a,i);}return a}function Pi(t,e){if(t.length!==e.length)return !1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return !1;return !0}function Li(t,e){for(let n=0,r=e.length;n<r;n++)t[n]=e[n];}function Di(t,e){let n=Ei[e];void 0===n&&(n=new Int32Array(e),Ei[e]=n);for(let r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function Oi(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e);}function Ii(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else {if(Pi(n,e))return;t.uniform2fv(this.addr,e),Li(n,e);}}function qi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else {if(Pi(n,e))return;t.uniform3fv(this.addr,e),Li(n,e);}}function Ui(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else {if(Pi(n,e))return;t.uniform4fv(this.addr,e),Li(n,e);}}function Ni(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Pi(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Li(n,e);}else {if(Pi(n,r))return;Ci.set(r),t.uniformMatrix2fv(this.addr,!1,Ci),Li(n,r);}}function Bi(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Pi(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Li(n,e);}else {if(Pi(n,r))return;Ti.set(r),t.uniformMatrix3fv(this.addr,!1,Ti),Li(n,r);}}function ki(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Pi(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Li(n,e);}else {if(Pi(n,r))return;Si.set(r),t.uniformMatrix4fv(this.addr,!1,Si),Li(n,r);}}function Fi(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e);}function zi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else {if(Pi(n,e))return;t.uniform2iv(this.addr,e),Li(n,e);}}function Gi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else {if(Pi(n,e))return;t.uniform3iv(this.addr,e),Li(n,e);}}function Hi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else {if(Pi(n,e))return;t.uniform4iv(this.addr,e),Li(n,e);}}function ji(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e);}function Vi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else {if(Pi(n,e))return;t.uniform2uiv(this.addr,e),Li(n,e);}}function Wi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else {if(Pi(n,e))return;t.uniform3uiv(this.addr,e),Li(n,e);}}function Xi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else {if(Pi(n,e))return;t.uniform4uiv(this.addr,e),Li(n,e);}}function Qi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i);const a=this.type===t.SAMPLER_2D_SHADOW?yi:_i;n.setTexture2D(e||a,i);}function Yi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||bi,i);}function Zi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(e||Mi,i);}function Ki(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||xi,i);}function Ji(t,e){t.uniform1fv(this.addr,e);}function $i(t,e){const n=Ri(e,this.size,2);t.uniform2fv(this.addr,n);}function ta(t,e){const n=Ri(e,this.size,3);t.uniform3fv(this.addr,n);}function ea(t,e){const n=Ri(e,this.size,4);t.uniform4fv(this.addr,n);}function na(t,e){const n=Ri(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n);}function ra(t,e){const n=Ri(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n);}function ia(t,e){const n=Ri(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n);}function aa(t,e){t.uniform1iv(this.addr,e);}function oa(t,e){t.uniform2iv(this.addr,e);}function sa(t,e){t.uniform3iv(this.addr,e);}function Aa(t,e){t.uniform4iv(this.addr,e);}function la(t,e){t.uniform1uiv(this.addr,e);}function ca(t,e){t.uniform2uiv(this.addr,e);}function ua(t,e){t.uniform3uiv(this.addr,e);}function ha(t,e){t.uniform4uiv(this.addr,e);}function fa(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTexture2D(e[t]||_i,a[t]);}function da(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTexture3D(e[t]||bi,a[t]);}function pa(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTextureCube(e[t]||Mi,a[t]);}function ma(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTexture2DArray(e[t]||xi,a[t]);}class ga{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=function(t){switch(t){case 5126:return Oi;case 35664:return Ii;case 35665:return qi;case 35666:return Ui;case 35674:return Ni;case 35675:return Bi;case 35676:return ki;case 5124:case 35670:return Fi;case 35667:case 35671:return zi;case 35668:case 35672:return Gi;case 35669:case 35673:return Hi;case 5125:return ji;case 36294:return Vi;case 36295:return Wi;case 36296:return Xi;case 35678:case 36198:case 36298:case 36306:case 35682:return Qi;case 35679:case 36299:case 36307:return Yi;case 35680:case 36300:case 36308:case 36293:return Zi;case 36289:case 36303:case 36311:case 36292:return Ki}}(e.type);}}class va{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Ji;case 35664:return $i;case 35665:return ta;case 35666:return ea;case 35674:return na;case 35675:return ra;case 35676:return ia;case 5124:case 35670:return aa;case 35667:case 35671:return oa;case 35668:case 35672:return sa;case 35669:case 35673:return Aa;case 5125:return la;case 36294:return ca;case 36295:return ua;case 36296:return ha;case 35678:case 36198:case 36298:case 36306:case 35682:return fa;case 35679:case 36299:case 36307:return da;case 35680:case 36300:case 36308:case 36293:return pa;case 36289:case 36303:case 36311:case 36292:return ma}}(e.type);}}class _a{constructor(t){this.id=t,this.seq=[],this.map={};}setValue(t,e,n){const r=this.seq;for(let i=0,a=r.length;i!==a;++i){const a=r[i];a.setValue(t,e[a.id],n);}}}const ya=/(\w+)(\])?(\[|\.)?/g;function xa(t,e){t.seq.push(e),t.map[e.id]=e;}function ba(t,e,n){const r=t.name,i=r.length;for(ya.lastIndex=0;;){const a=ya.exec(r),o=ya.lastIndex;let s=a[1];const A="]"===a[2],l=a[3];if(A&&(s|=0),void 0===l||"["===l&&o+2===i){xa(n,void 0===l?new ga(s,t,e):new va(s,t,e));break}{let t=n.map[s];void 0===t&&(t=new _a(s),xa(n,t)),n=t;}}}class Ma{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const n=t.getActiveUniform(e,r);ba(n,t.getUniformLocation(e,n.name),this);}}setValue(t,e,n,r){const i=this.map[e];void 0!==i&&i.setValue(t,n,r);}setOptional(t,e,n){const r=e[n];void 0!==r&&this.setValue(t,n,r);}static upload(t,e,n,r){for(let i=0,a=e.length;i!==a;++i){const a=e[i],o=n[a.id];!1!==o.needsUpdate&&a.setValue(t,o.value,r);}}static seqWithValue(t,e){const n=[];for(let r=0,i=t.length;r!==i;++r){const i=t[r];i.id in e&&n.push(i);}return n}}function wa(t,e,n){const r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}const Ea=37297;let Sa=0;function Ta(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&""===i)return "";const a=/ERROR: 0:(\d+)/.exec(i);if(a){const r=parseInt(a[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(t,e){const n=t.split("\n"),r=[],i=Math.max(e-6,0),a=Math.min(e+6,n.length);for(let t=i;t<a;t++){const i=t+1;r.push(`${i===e?">":" "} ${i}: ${n[t]}`);}return r.join("\n")}(t.getShaderSource(e),r)}return i}function Ca(t,e){const n=function(t){const e=Ht.getPrimaries(Ht.workingColorSpace),n=Ht.getPrimaries(t);let r;switch(e===n?r="":e===ct&&n===lt?r="LinearDisplayP3ToLinearSRGB":e===lt&&n===ct&&(r="LinearSRGBToLinearDisplayP3"),t){case it:case ot:return [r,"LinearTransferOETF"];case rt:case at:return [r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[r,"LinearTransferOETF"]}}(e);return `vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function Ra(t,e){let n;switch(e){case M:n="Linear";break;case w:n="Reinhard";break;case E:n="OptimizedCineon";break;case S:n="ACESFilmic";break;case C:n="AgX";break;case R:n="Neutral";break;case T:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear";}return "vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Pa(t){return ""!==t}function La(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Da(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Oa=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ia(t){return t.replace(Oa,Ua)}const qa=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function Ua(t,e){let n=Ir[e];if(void 0===n){const t=qa.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");n=Ir[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t);}return Ia(n)}const Na=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Ba(t){return t.replace(Na,ka)}function ka(t,e,n,r){let i="";for(let t=parseInt(e);t<parseInt(n);t++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return i}function Fa(t){let e=`precision ${t.precision} float;\n\tprecision ${t.precision} int;\n\tprecision ${t.precision} sampler2D;\n\tprecision ${t.precision} samplerCube;\n\t`;return t.isWebGL2&&(e+=`precision ${t.precision} sampler3D;\n\t\tprecision ${t.precision} sampler2DArray;\n\t\tprecision ${t.precision} sampler2DShadow;\n\t\tprecision ${t.precision} samplerCubeShadow;\n\t\tprecision ${t.precision} sampler2DArrayShadow;\n\t\tprecision ${t.precision} isampler2D;\n\t\tprecision ${t.precision} isampler3D;\n\t\tprecision ${t.precision} isamplerCube;\n\t\tprecision ${t.precision} isampler2DArray;\n\t\tprecision ${t.precision} usampler2D;\n\t\tprecision ${t.precision} usampler3D;\n\t\tprecision ${t.precision} usamplerCube;\n\t\tprecision ${t.precision} usampler2DArray;\n\t\t`),"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function za(t,e,n,r){const i=t.getContext(),a=n.defines;let o=n.vertexShader,s=n.fragmentShader;const A=function(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===f?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===d?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===p&&(e="SHADOWMAP_TYPE_VSM"),e}(n),l=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case P:case L:e="ENVMAP_TYPE_CUBE";break;case D:e="ENVMAP_TYPE_CUBE_UV";}return e}(n),c=function(t){let e="ENVMAP_MODE_REFLECTION";t.envMap&&t.envMapMode===L&&(e="ENVMAP_MODE_REFRACTION");return e}(n),u=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case _:e="ENVMAP_BLENDING_MULTIPLY";break;case y:e="ENVMAP_BLENDING_MIX";break;case x:e="ENVMAP_BLENDING_ADD";}return e}(n),h=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const n=Math.log2(e)-2,r=1/e;return {texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),m=n.isWebGL2?"":function(t){return [t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.alphaToCoverage||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Pa).join("\n")}(n),g=function(t){return [t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Pa).join("\n")}(n),v=function(t){const e=[];for(const n in t){const r=t[n];!1!==r&&e.push("#define "+n+" "+r);}return e.join("\n")}(a),M=i.createProgram();let w,E,S=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(w=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(Pa).join("\n"),w.length>0&&(w+="\n"),E=[m,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(Pa).join("\n"),E.length>0&&(E+="\n")):(w=[Fa(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+A:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Pa).join("\n"),E=[m,Fa(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+A:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==b?"#define TONE_MAPPING":"",n.toneMapping!==b?Ir.tonemapping_pars_fragment:"",n.toneMapping!==b?Ra("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Ir.colorspace_pars_fragment,Ca("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Pa).join("\n")),o=Ia(o),o=La(o,n),o=Da(o,n),s=Ia(s),s=La(s,n),s=Da(s,n),o=Ba(o),s=Ba(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(S="#version 300 es\n",w=[g,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+w,E=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===ft?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===ft?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+E);const T=S+w+o,C=S+E+s,R=wa(i,i.VERTEX_SHADER,T),O=wa(i,i.FRAGMENT_SHADER,C);function I(e){if(t.debug.checkShaderErrors){const n=i.getProgramInfoLog(M).trim(),r=i.getShaderInfoLog(R).trim(),a=i.getShaderInfoLog(O).trim();let o=!0,s=!0;if(!1===i.getProgramParameter(M,i.LINK_STATUS))if(o=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(i,M,R,O);else {const t=Ta(i,R,"vertex"),r=Ta(i,O,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(M,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+e.name+"\nMaterial Type: "+e.type+"\n\nProgram Info Log: "+n+"\n"+t+"\n"+r);}else ""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==r&&""!==a||(s=!1);s&&(e.diagnostics={runnable:o,programLog:n,vertexShader:{log:r,prefix:w},fragmentShader:{log:a,prefix:E}});}i.deleteShader(R),i.deleteShader(O),q=new Ma(i,M),U=function(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const r=t.getActiveAttrib(e,i),a=r.name;let o=1;r.type===t.FLOAT_MAT2&&(o=2),r.type===t.FLOAT_MAT3&&(o=3),r.type===t.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:t.getAttribLocation(e,a),locationSize:o};}return n}(i,M);}let q,U;i.attachShader(M,R),i.attachShader(M,O),void 0!==n.index0AttributeName?i.bindAttribLocation(M,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(M,0,"position"),i.linkProgram(M),this.getUniforms=function(){return void 0===q&&I(this),q},this.getAttributes=function(){return void 0===U&&I(this),U};let N=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return !1===N&&(N=i.getProgramParameter(M,Ea)),N},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(M),this.program=void 0;},this.type=n.shaderType,this.name=n.shaderName,this.id=Sa++,this.cacheKey=e,this.usedTimes=1,this.program=M,this.vertexShader=R,this.fragmentShader=O,this}let Ga=0;class Ha{constructor(){this.shaderCache=new Map,this.materialCache=new Map;}update(t){const e=t.vertexShader,n=t.fragmentShader,r=this._getShaderStage(e),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return !1===a.has(r)&&(a.add(r),r.usedTimes++),!1===a.has(i)&&(a.add(i),i.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear();}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return void 0===n&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return void 0===n&&(n=new ja(t),e.set(t,n)),n}}class ja{constructor(t){this.id=Ga++,this.code=t,this.usedTimes=0;}}function Va(t,e,n,r,i,a,o){const s=new We,A=new Ha,l=new Set,c=[],u=i.isWebGL2,h=i.logarithmicDepthBuffer,f=i.vertexTextures;let d=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(t){return l.add(t),0===t?"uv":`uv${t}`}return {getParameters:function(a,s,c,v,_){const y=v.fog,x=_.geometry,M=a.isMeshStandardMaterial?v.environment:null,w=(a.isMeshStandardMaterial?n:e).get(a.envMap||M),E=w&&w.mapping===D?w.image.height:null,S=p[a.type];null!==a.precision&&(d=i.getMaxPrecision(a.precision),d!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",d,"instead."));const T=x.morphAttributes.position||x.morphAttributes.normal||x.morphAttributes.color,C=void 0!==T?T.length:0;let R,P,L,O,I=0;if(void 0!==x.morphAttributes.position&&(I=1),void 0!==x.morphAttributes.normal&&(I=2),void 0!==x.morphAttributes.color&&(I=3),S){const t=Ur[S];R=t.vertexShader,P=t.fragmentShader;}else R=a.vertexShader,P=a.fragmentShader,A.update(a),L=A.getVertexShaderID(a),O=A.getFragmentShaderID(a);const q=t.getRenderTarget(),U=!0===_.isInstancedMesh,N=!0===_.isBatchedMesh,B=!!a.map,k=!!a.matcap,F=!!w,z=!!a.aoMap,G=!!a.lightMap,H=!!a.bumpMap,j=!!a.normalMap,V=!!a.displacementMap,W=!!a.emissiveMap,X=!!a.metalnessMap,Q=!!a.roughnessMap,Y=a.anisotropy>0,Z=a.clearcoat>0,K=a.iridescence>0,J=a.sheen>0,$=a.transmission>0,tt=Y&&!!a.anisotropyMap,et=Z&&!!a.clearcoatMap,nt=Z&&!!a.clearcoatNormalMap,rt=Z&&!!a.clearcoatRoughnessMap,at=K&&!!a.iridescenceMap,ot=K&&!!a.iridescenceThicknessMap,st=J&&!!a.sheenColorMap,lt=J&&!!a.sheenRoughnessMap,ct=!!a.specularMap,ut=!!a.specularColorMap,ht=!!a.specularIntensityMap,ft=$&&!!a.transmissionMap,dt=$&&!!a.thicknessMap,pt=!!a.gradientMap,mt=!!a.alphaMap,gt=a.alphaTest>0,vt=!!a.alphaHash,_t=!!a.extensions;let yt=b;a.toneMapped&&(null!==q&&!0!==q.isXRRenderTarget||(yt=t.toneMapping));const xt={isWebGL2:u,shaderID:S,shaderType:a.type,shaderName:a.name,vertexShader:R,fragmentShader:P,defines:a.defines,customVertexShaderID:L,customFragmentShaderID:O,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:d,batching:N,instancing:U,instancingColor:U&&null!==_.instanceColor,instancingMorph:U&&null!==_.morphTexture,supportsVertexTextures:f,outputColorSpace:null===q?t.outputColorSpace:!0===q.isXRRenderTarget?q.texture.colorSpace:it,alphaToCoverage:!!a.alphaToCoverage,map:B,matcap:k,envMap:F,envMapMode:F&&w.mapping,envMapCubeUVHeight:E,aoMap:z,lightMap:G,bumpMap:H,normalMap:j,displacementMap:f&&V,emissiveMap:W,normalMapObjectSpace:j&&1===a.normalMapType,normalMapTangentSpace:j&&0===a.normalMapType,metalnessMap:X,roughnessMap:Q,anisotropy:Y,anisotropyMap:tt,clearcoat:Z,clearcoatMap:et,clearcoatNormalMap:nt,clearcoatRoughnessMap:rt,iridescence:K,iridescenceMap:at,iridescenceThicknessMap:ot,sheen:J,sheenColorMap:st,sheenRoughnessMap:lt,specularMap:ct,specularColorMap:ut,specularIntensityMap:ht,transmission:$,transmissionMap:ft,thicknessMap:dt,gradientMap:pt,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:mt,alphaTest:gt,alphaHash:vt,combine:a.combine,mapUv:B&&m(a.map.channel),aoMapUv:z&&m(a.aoMap.channel),lightMapUv:G&&m(a.lightMap.channel),bumpMapUv:H&&m(a.bumpMap.channel),normalMapUv:j&&m(a.normalMap.channel),displacementMapUv:V&&m(a.displacementMap.channel),emissiveMapUv:W&&m(a.emissiveMap.channel),metalnessMapUv:X&&m(a.metalnessMap.channel),roughnessMapUv:Q&&m(a.roughnessMap.channel),anisotropyMapUv:tt&&m(a.anisotropyMap.channel),clearcoatMapUv:et&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:nt&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:rt&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:at&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:ot&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:st&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:lt&&m(a.sheenRoughnessMap.channel),specularMapUv:ct&&m(a.specularMap.channel),specularColorMapUv:ut&&m(a.specularColorMap.channel),specularIntensityMapUv:ht&&m(a.specularIntensityMap.channel),transmissionMapUv:ft&&m(a.transmissionMap.channel),thicknessMapUv:dt&&m(a.thicknessMap.channel),alphaMapUv:mt&&m(a.alphaMap.channel),vertexTangents:!!x.attributes.tangent&&(j||Y),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!x.attributes.color&&4===x.attributes.color.itemSize,pointsUvs:!0===_.isPoints&&!!x.attributes.uv&&(B||mt),fog:!!y,useFog:!0===a.fog,fogExp2:!!y&&y.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===_.isSkinnedMesh,morphTargets:void 0!==x.morphAttributes.position,morphNormals:void 0!==x.morphAttributes.normal,morphColors:void 0!==x.morphAttributes.color,morphTargetsCount:C,morphTextureStride:I,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:yt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:B&&!0===a.map.isVideoTexture&&Ht.getTransfer(a.map.colorSpace)===At,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:a.side===g,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionDerivatives:_t&&!0===a.extensions.derivatives,extensionFragDepth:_t&&!0===a.extensions.fragDepth,extensionDrawBuffers:_t&&!0===a.extensions.drawBuffers,extensionShaderTextureLOD:_t&&!0===a.extensions.shaderTextureLOD,extensionClipCullDistance:_t&&!0===a.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:_t&&!0===a.extensions.multiDraw&&r.has("WEBGL_multi_draw"),rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return xt.vertexUv1s=l.has(1),xt.vertexUv2s=l.has(2),xt.vertexUv3s=l.has(3),l.clear(),xt},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return !1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking);}(n,e),function(t,e){s.disableAll(),e.isWebGL2&&s.enable(0);e.supportsVertexTextures&&s.enable(1);e.instancing&&s.enable(2);e.instancingColor&&s.enable(3);e.instancingMorph&&s.enable(4);e.matcap&&s.enable(5);e.envMap&&s.enable(6);e.normalMapObjectSpace&&s.enable(7);e.normalMapTangentSpace&&s.enable(8);e.clearcoat&&s.enable(9);e.iridescence&&s.enable(10);e.alphaTest&&s.enable(11);e.vertexColors&&s.enable(12);e.vertexAlphas&&s.enable(13);e.vertexUv1s&&s.enable(14);e.vertexUv2s&&s.enable(15);e.vertexUv3s&&s.enable(16);e.vertexTangents&&s.enable(17);e.anisotropy&&s.enable(18);e.alphaHash&&s.enable(19);e.batching&&s.enable(20);t.push(s.mask),s.disableAll(),e.fog&&s.enable(0);e.useFog&&s.enable(1);e.flatShading&&s.enable(2);e.logarithmicDepthBuffer&&s.enable(3);e.skinning&&s.enable(4);e.morphTargets&&s.enable(5);e.morphNormals&&s.enable(6);e.morphColors&&s.enable(7);e.premultipliedAlpha&&s.enable(8);e.shadowMapEnabled&&s.enable(9);e.useLegacyLights&&s.enable(10);e.doubleSided&&s.enable(11);e.flipSided&&s.enable(12);e.useDepthPacking&&s.enable(13);e.dithering&&s.enable(14);e.transmission&&s.enable(15);e.sheen&&s.enable(16);e.opaque&&s.enable(17);e.pointsUvs&&s.enable(18);e.decodeVideoTexture&&s.enable(19);e.alphaToCoverage&&s.enable(20);t.push(s.mask);}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=p[t.type];let n;if(e){const t=Ur[e];n=fr.clone(t.uniforms);}else n=t.uniforms;return n},acquireProgram:function(e,n){let r;for(let t=0,e=c.length;t<e;t++){const e=c[t];if(e.cacheKey===n){r=e,++r.usedTimes;break}}return void 0===r&&(r=new za(t,n,e,a),c.push(r)),r},releaseProgram:function(t){if(0==--t.usedTimes){const e=c.indexOf(t);c[e]=c[c.length-1],c.pop(),t.destroy();}},releaseShaderCache:function(t){A.remove(t);},programs:c,dispose:function(){A.dispose();}}}function Wa(){let t=new WeakMap;return {get:function(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e);},update:function(e,n,r){t.get(e)[n]=r;},dispose:function(){t=new WeakMap;}}}function Xa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Qa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Ya(){const t=[];let e=0;const n=[],r=[],i=[];function a(n,r,i,a,o,s){let A=t[e];return void 0===A?(A={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},t[e]=A):(A.id=n.id,A.object=n,A.geometry=r,A.material=i,A.groupOrder=a,A.renderOrder=n.renderOrder,A.z=o,A.group=s),e++,A}return {opaque:n,transmissive:r,transparent:i,init:function(){e=0,n.length=0,r.length=0,i.length=0;},push:function(t,e,o,s,A,l){const c=a(t,e,o,s,A,l);o.transmission>0?r.push(c):!0===o.transparent?i.push(c):n.push(c);},unshift:function(t,e,o,s,A,l){const c=a(t,e,o,s,A,l);o.transmission>0?r.unshift(c):!0===o.transparent?i.unshift(c):n.unshift(c);},finish:function(){for(let n=e,r=t.length;n<r;n++){const e=t[n];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null;}},sort:function(t,e){n.length>1&&n.sort(t||Xa),r.length>1&&r.sort(e||Qa),i.length>1&&i.sort(e||Qa);}}}function Za(){let t=new WeakMap;return {get:function(e,n){const r=t.get(e);let i;return void 0===r?(i=new Ya,t.set(e,[i])):n>=r.length?(i=new Ya,r.push(i)):i=r[n],i},dispose:function(){t=new WeakMap;}}}function Ka(){const t={};return {get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ae,color:new En};break;case"SpotLight":n={position:new ae,direction:new ae,color:new En,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ae,color:new En,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ae,skyColor:new En,groundColor:new En};break;case"RectAreaLight":n={color:new En,position:new ae,halfWidth:new ae,halfHeight:new ae};}return t[e.id]=n,n}}}let Ja=0;function $a(t,e){return (e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function to(t,e){const n=new Ka,r=function(){const t={};return {get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt,shadowCameraNear:1,shadowCameraFar:1e3};}return t[e.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let t=0;t<9;t++)i.probe.push(new ae);const a=new ae,o=new qe,s=new qe;return {setup:function(a,o){let s=0,A=0,l=0;for(let t=0;t<9;t++)i.probe[t].set(0,0,0);let c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;a.sort($a);const x=!0===o?Math.PI:1;for(let t=0,e=a.length;t<e;t++){const e=a[t],o=e.color,b=e.intensity,M=e.distance,w=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)s+=o.r*b*x,A+=o.g*b*x,l+=o.b*b*x;else if(e.isLightProbe){for(let t=0;t<9;t++)i.probe[t].addScaledVector(e.sh.coefficients[t],b);y++;}else if(e.isDirectionalLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,i.directionalShadow[c]=n,i.directionalShadowMap[c]=w,i.directionalShadowMatrix[c]=e.shadow.matrix,p++;}i.directional[c]=t,c++;}else if(e.isSpotLight){const t=n.get(e);t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(o).multiplyScalar(b*x),t.distance=M,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,i.spot[h]=t;const a=e.shadow;if(e.map&&(i.spotLightMap[v]=e.map,v++,a.updateMatrices(e),e.castShadow&&_++),i.spotLightMatrix[h]=a.matrix,e.castShadow){const t=r.get(e);t.shadowBias=a.bias,t.shadowNormalBias=a.normalBias,t.shadowRadius=a.radius,t.shadowMapSize=a.mapSize,i.spotShadow[h]=t,i.spotShadowMap[h]=w,g++;}h++;}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(o).multiplyScalar(b),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),i.rectArea[f]=t,f++;}else if(e.isPointLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,n.shadowCameraNear=t.camera.near,n.shadowCameraFar=t.camera.far,i.pointShadow[u]=n,i.pointShadowMap[u]=w,i.pointShadowMatrix[u]=e.shadow.matrix,m++;}i.point[u]=t,u++;}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(b*x),t.groundColor.copy(e.groundColor).multiplyScalar(b*x),i.hemi[d]=t,d++;}}f>0&&(e.isWebGL2?!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=qr.LTC_FLOAT_1,i.rectAreaLTC2=qr.LTC_FLOAT_2):(i.rectAreaLTC1=qr.LTC_HALF_1,i.rectAreaLTC2=qr.LTC_HALF_2):!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=qr.LTC_FLOAT_1,i.rectAreaLTC2=qr.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=qr.LTC_HALF_1,i.rectAreaLTC2=qr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=s,i.ambient[1]=A,i.ambient[2]=l;const b=i.hash;b.directionalLength===c&&b.pointLength===u&&b.spotLength===h&&b.rectAreaLength===f&&b.hemiLength===d&&b.numDirectionalShadows===p&&b.numPointShadows===m&&b.numSpotShadows===g&&b.numSpotMaps===v&&b.numLightProbes===y||(i.directional.length=c,i.spot.length=h,i.rectArea.length=f,i.point.length=u,i.hemi.length=d,i.directionalShadow.length=p,i.directionalShadowMap.length=p,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=p,i.pointShadowMatrix.length=m,i.spotLightMatrix.length=g+v-_,i.spotLightMap.length=v,i.numSpotLightShadowsWithMaps=_,i.numLightProbes=y,b.directionalLength=c,b.pointLength=u,b.spotLength=h,b.rectAreaLength=f,b.hemiLength=d,b.numDirectionalShadows=p,b.numPointShadows=m,b.numSpotShadows=g,b.numSpotMaps=v,b.numLightProbes=y,i.version=Ja++);},setupView:function(t,e){let n=0,r=0,A=0,l=0,c=0;const u=e.matrixWorldInverse;for(let e=0,h=t.length;e<h;e++){const h=t[e];if(h.isDirectionalLight){const t=i.directional[n];t.direction.setFromMatrixPosition(h.matrixWorld),a.setFromMatrixPosition(h.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(u),n++;}else if(h.isSpotLight){const t=i.spot[A];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),t.direction.setFromMatrixPosition(h.matrixWorld),a.setFromMatrixPosition(h.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(u),A++;}else if(h.isRectAreaLight){const t=i.rectArea[l];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),s.identity(),o.copy(h.matrixWorld),o.premultiply(u),s.extractRotation(o),t.halfWidth.set(.5*h.width,0,0),t.halfHeight.set(0,.5*h.height,0),t.halfWidth.applyMatrix4(s),t.halfHeight.applyMatrix4(s),l++;}else if(h.isPointLight){const t=i.point[r];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),r++;}else if(h.isHemisphereLight){const t=i.hemi[c];t.direction.setFromMatrixPosition(h.matrixWorld),t.direction.transformDirection(u),c++;}}},state:i}}function eo(t,e){const n=new to(t,e),r=[],i=[];return {init:function(){r.length=0,i.length=0;},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(t){n.setup(r,t);},setupLightsView:function(t){n.setupView(r,t);},pushLight:function(t){r.push(t);},pushShadow:function(t){i.push(t);}}}function no(t,e){let n=new WeakMap;return {get:function(r,i=0){const a=n.get(r);let o;return void 0===a?(o=new eo(t,e),n.set(r,[o])):i>=a.length?(o=new eo(t,e),a.push(o)):o=a[i],o},dispose:function(){n=new WeakMap;}}}class ro extends Cn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t);}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class io extends Cn{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t);}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function ao(t,e,n){let r=new Pr;const i=new Lt,a=new Lt,o=new $t,s=new ro({depthPacking:3201}),A=new io,l={},c=n.maxTextureSize,u={[m]:g,[g]:m,2:2},h=new dr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Lt},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const v=new Hn;v.setAttribute("position",new Dn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new sr(v,h),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=f;let x=this.type;function b(n,r){const a=e.update(_);h.defines.VSM_SAMPLES!==n.blurSamples&&(h.defines.VSM_SAMPLES=n.blurSamples,d.defines.VSM_SAMPLES=n.blurSamples,h.needsUpdate=!0,d.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new ee(i.x,i.y)),h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,a,h,_,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,a,d,_,null);}function M(e,n,r,i){let a=null;const o=!0===r.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===r.isPointLight?A:s,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=a.uuid,e=n.uuid;let r=l[t];void 0===r&&(r={},l[t]=r);let i=r[e];void 0===i&&(i=a.clone(),r[e]=i,n.addEventListener("dispose",E)),a=i;}if(a.visible=n.visible,a.wireframe=n.wireframe,a.side=i===p?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial){t.properties.get(a).light=r;}return a}function w(n,i,a,o,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===p)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=e.update(n),A=n.material;if(Array.isArray(A)){const e=r.groups;for(let l=0,c=e.length;l<c;l++){const c=e[l],u=A[c.materialIndex];if(u&&u.visible){const e=M(n,u,o,s);n.onBeforeShadow(t,n,i,a,r,e,c),t.renderBufferDirect(a,null,r,e,n,c),n.onAfterShadow(t,n,i,a,r,e,c);}}}else if(A.visible){const e=M(n,A,o,s);n.onBeforeShadow(t,n,i,a,r,e,null),t.renderBufferDirect(a,null,r,e,n,null),n.onAfterShadow(t,n,i,a,r,e,null);}}const A=n.children;for(let t=0,e=A.length;t<e;t++)w(A[t],i,a,o,s);}function E(t){t.target.removeEventListener("dispose",E);for(const e in l){const n=l[e],r=t.target.uuid;if(r in n){n[r].dispose(),delete n[r];}}}this.render=function(e,n,s){if(!1===y.enabled)return;if(!1===y.autoUpdate&&!1===y.needsUpdate)return;if(0===e.length)return;const A=t.getRenderTarget(),l=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),h=t.state;h.setBlending(0),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);const f=x!==p&&this.type===p,d=x===p&&this.type!==p;for(let A=0,l=e.length;A<l;A++){const l=e[A],u=l.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;i.copy(u.mapSize);const m=u.getFrameExtents();if(i.multiply(m),a.copy(u.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/m.x),i.x=a.x*m.x,u.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/m.y),i.y=a.y*m.y,u.mapSize.y=a.y)),null===u.map||!0===f||!0===d){const t=this.type!==p?{minFilter:U,magFilter:U}:{};null!==u.map&&u.map.dispose(),u.map=new ee(i.x,i.y,t),u.map.texture.name=l.name+".shadowMap",u.camera.updateProjectionMatrix();}t.setRenderTarget(u.map),t.clear();const g=u.getViewportCount();for(let t=0;t<g;t++){const e=u.getViewport(t);o.set(a.x*e.x,a.y*e.y,a.x*e.z,a.y*e.w),h.viewport(o),u.updateMatrices(l,t),r=u.getFrustum(),w(n,s,u.camera,l,this.type);}!0!==u.isPointLightShadow&&this.type===p&&b(u,s),u.needsUpdate=!1;}x=this.type,y.needsUpdate=!1,t.setRenderTarget(A,l,u);};}function oo(t,e,n){const r=n.isWebGL2;const i=new function(){let e=!1;const n=new $t;let r=null;const i=new $t(0,0,0,0);return {setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n);},setLocked:function(t){e=t;},setClear:function(e,r,a,o,s){!0===s&&(e*=o,r*=o,a*=o),n.set(e,r,a,o),!1===i.equals(n)&&(t.clearColor(e,r,a,o),i.copy(n));},reset:function(){e=!1,r=null,i.set(-1,0,0,0);}}},a=new function(){let e=!1,n=null,r=null,i=null;return {setTest:function(e){e?j(t.DEPTH_TEST):V(t.DEPTH_TEST);},setMask:function(r){n===r||e||(t.depthMask(r),n=r);},setFunc:function(e){if(r!==e){switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL);}r=e;}},setLocked:function(t){e=t;},setClear:function(e){i!==e&&(t.clearDepth(e),i=e);},reset:function(){e=!1,n=null,r=null,i=null;}}},o=new function(){let e=!1,n=null,r=null,i=null,a=null,o=null,s=null,A=null,l=null;return {setTest:function(n){e||(n?j(t.STENCIL_TEST):V(t.STENCIL_TEST));},setMask:function(r){n===r||e||(t.stencilMask(r),n=r);},setFunc:function(e,n,o){r===e&&i===n&&a===o||(t.stencilFunc(e,n,o),r=e,i=n,a=o);},setOp:function(e,n,r){o===e&&s===n&&A===r||(t.stencilOp(e,n,r),o=e,s=n,A=r);},setLocked:function(t){e=t;},setClear:function(e){l!==e&&(t.clearStencil(e),l=e);},reset:function(){e=!1,n=null,r=null,i=null,a=null,o=null,s=null,A=null,l=null;}}},s=new WeakMap,A=new WeakMap;let l={},c={},u=new WeakMap,h=[],f=null,d=!1,p=null,m=null,_=null,y=null,x=null,b=null,M=null,w=new En(0,0,0),E=0,S=!1,T=null,C=null,R=null,P=null,L=null;const D=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let O=!1,I=0;const q=t.getParameter(t.VERSION);-1!==q.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(q)[1]),O=I>=1):-1!==q.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(q)[1]),O=I>=2);let U=null,N={};const B=t.getParameter(t.SCISSOR_BOX),k=t.getParameter(t.VIEWPORT),F=(new $t).fromArray(B),z=(new $t).fromArray(k);function G(e,n,i,a){const o=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let s=0;s<i;s++)!r||e!==t.TEXTURE_3D&&e!==t.TEXTURE_2D_ARRAY?t.texImage2D(n+s,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,o):t.texImage3D(n,0,t.RGBA,1,1,a,0,t.RGBA,t.UNSIGNED_BYTE,o);return s}const H={};function j(e){!0!==l[e]&&(t.enable(e),l[e]=!0);}function V(e){!1!==l[e]&&(t.disable(e),l[e]=!1);}H[t.TEXTURE_2D]=G(t.TEXTURE_2D,t.TEXTURE_2D,1),H[t.TEXTURE_CUBE_MAP]=G(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),r&&(H[t.TEXTURE_2D_ARRAY]=G(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),H[t.TEXTURE_3D]=G(t.TEXTURE_3D,t.TEXTURE_3D,1,1)),i.setClear(0,0,0,1),a.setClear(1),o.setClear(0),j(t.DEPTH_TEST),a.setFunc(3),Y(!1),Z(1),j(t.CULL_FACE),Q(0);const W={[v]:t.FUNC_ADD,101:t.FUNC_SUBTRACT,102:t.FUNC_REVERSE_SUBTRACT};if(r)W[103]=t.MIN,W[104]=t.MAX;else {const t=e.get("EXT_blend_minmax");null!==t&&(W[103]=t.MIN_EXT,W[104]=t.MAX_EXT);}const X={200:t.ZERO,201:t.ONE,202:t.SRC_COLOR,204:t.SRC_ALPHA,210:t.SRC_ALPHA_SATURATE,208:t.DST_COLOR,206:t.DST_ALPHA,203:t.ONE_MINUS_SRC_COLOR,205:t.ONE_MINUS_SRC_ALPHA,209:t.ONE_MINUS_DST_COLOR,207:t.ONE_MINUS_DST_ALPHA,211:t.CONSTANT_COLOR,212:t.ONE_MINUS_CONSTANT_COLOR,213:t.CONSTANT_ALPHA,214:t.ONE_MINUS_CONSTANT_ALPHA};function Q(e,n,r,i,a,o,s,A,l,c){if(0!==e){if(!1===d&&(j(t.BLEND),d=!0),5===e)a=a||n,o=o||r,s=s||i,n===m&&a===x||(t.blendEquationSeparate(W[n],W[a]),m=n,x=a),r===_&&i===y&&o===b&&s===M||(t.blendFuncSeparate(X[r],X[i],X[o],X[s]),_=r,y=i,b=o,M=s),!1!==A.equals(w)&&l===E||(t.blendColor(A.r,A.g,A.b,l),w.copy(A),E=l),p=e,S=!1;else if(e!==p||c!==S){if(m===v&&x===v||(t.blendEquation(t.FUNC_ADD),m=v,x=v),c)switch(e){case 1:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.ONE,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);}else switch(e){case 1:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);}_=null,y=null,b=null,M=null,w.set(0,0,0),E=0,p=e,S=c;}}else !0===d&&(V(t.BLEND),d=!1);}function Y(e){T!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),T=e);}function Z(e){0!==e?(j(t.CULL_FACE),e!==C&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):V(t.CULL_FACE),C=e;}function K(e,n,r){e?(j(t.POLYGON_OFFSET_FILL),P===n&&L===r||(t.polygonOffset(n,r),P=n,L=r)):V(t.POLYGON_OFFSET_FILL);}return {buffers:{color:i,depth:a,stencil:o},enable:j,disable:V,bindFramebuffer:function(e,n){return c[e]!==n&&(t.bindFramebuffer(e,n),c[e]=n,r&&(e===t.DRAW_FRAMEBUFFER&&(c[t.FRAMEBUFFER]=n),e===t.FRAMEBUFFER&&(c[t.DRAW_FRAMEBUFFER]=n)),!0)},drawBuffers:function(r,i){let a=h,o=!1;if(r){a=u.get(i),void 0===a&&(a=[],u.set(i,a));const e=r.textures;if(a.length!==e.length||a[0]!==t.COLOR_ATTACHMENT0){for(let n=0,r=e.length;n<r;n++)a[n]=t.COLOR_ATTACHMENT0+n;a.length=e.length,o=!0;}}else a[0]!==t.BACK&&(a[0]=t.BACK,o=!0);if(o)if(n.isWebGL2)t.drawBuffers(a);else {if(!0!==e.has("WEBGL_draw_buffers"))throw new Error("THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension");e.get("WEBGL_draw_buffers").drawBuffersWEBGL(a);}},useProgram:function(e){return f!==e&&(t.useProgram(e),f=e,!0)},setBlending:Q,setMaterial:function(e,n){2===e.side?V(t.CULL_FACE):j(t.CULL_FACE);let r=e.side===g;n&&(r=!r),Y(r),1===e.blending&&!1===e.transparent?Q(0):Q(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.blendColor,e.blendAlpha,e.premultipliedAlpha),a.setFunc(e.depthFunc),a.setTest(e.depthTest),a.setMask(e.depthWrite),i.setMask(e.colorWrite);const s=e.stencilWrite;o.setTest(s),s&&(o.setMask(e.stencilWriteMask),o.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),o.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),K(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?j(t.SAMPLE_ALPHA_TO_COVERAGE):V(t.SAMPLE_ALPHA_TO_COVERAGE);},setFlipSided:Y,setCullFace:Z,setLineWidth:function(e){e!==R&&(O&&t.lineWidth(e),R=e);},setPolygonOffset:K,setScissorTest:function(e){e?j(t.SCISSOR_TEST):V(t.SCISSOR_TEST);},activeTexture:function(e){void 0===e&&(e=t.TEXTURE0+D-1),U!==e&&(t.activeTexture(e),U=e);},bindTexture:function(e,n,r){void 0===r&&(r=null===U?t.TEXTURE0+D-1:U);let i=N[r];void 0===i&&(i={type:void 0,texture:void 0},N[r]=i),i.type===e&&i.texture===n||(U!==r&&(t.activeTexture(r),U=r),t.bindTexture(e,n||H[e]),i.type=e,i.texture=n);},unbindTexture:function(){const e=N[U];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0);},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments);}catch(t){console.error("THREE.WebGLState:",t);}},compressedTexImage3D:function(){try{t.compressedTexImage3D.apply(t,arguments);}catch(t){console.error("THREE.WebGLState:",t);}},texImage2D:function(){try{t.texImage2D.apply(t,arguments);}catch(t){console.error("THREE.WebGLState:",t);}},texImage3D:function(){try{t.texImage3D.apply(t,arguments);}catch(t){console.error("THREE.WebGLState:",t);}},updateUBOMapping:function(e,n){let r=A.get(n);void 0===r&&(r=new WeakMap,A.set(n,r));let i=r.get(e);void 0===i&&(i=t.getUniformBlockIndex(n,e.name),r.set(e,i));},uniformBlockBinding:function(e,n){const r=A.get(n).get(e);s.get(n)!==r&&(t.uniformBlockBinding(n,r,e.__bindingPointIndex),s.set(n,r));},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments);}catch(t){console.error("THREE.WebGLState:",t);}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments);}catch(t){console.error("THREE.WebGLState:",t);}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments);}catch(t){console.error("THREE.WebGLState:",t);}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments);}catch(t){console.error("THREE.WebGLState:",t);}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments);}catch(t){console.error("THREE.WebGLState:",t);}},compressedTexSubImage3D:function(){try{t.compressedTexSubImage3D.apply(t,arguments);}catch(t){console.error("THREE.WebGLState:",t);}},scissor:function(e){!1===F.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),F.copy(e));},viewport:function(e){!1===z.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),z.copy(e));},reset:function(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),!0===r&&(t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),l={},U=null,N={},c={},u=new WeakMap,h=[],f=null,d=!1,p=null,m=null,_=null,y=null,x=null,b=null,M=null,w=new En(0,0,0),E=0,S=!1,T=null,C=null,R=null,P=null,L=null,F.set(0,0,t.canvas.width,t.canvas.height),z.set(0,0,t.canvas.width,t.canvas.height),i.reset(),a.reset(),o.reset();}}}function so(t,e,n,r,i,a,o){const s=i.isWebGL2,A=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new Lt,u=new WeakMap;let h;const f=new WeakMap;let d=!1;try{d="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d");}catch(t){}function p(t,e){return d?new OffscreenCanvas(t,e):qt("canvas")}function m(t,e,n,r){let i=1;const a=at(t);if((a.width>r||a.height>r)&&(i=r/Math.max(a.width,a.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&t instanceof VideoFrame){const r=e?Tt:Math.floor,o=r(i*a.width),s=r(i*a.height);void 0===h&&(h=p(o,s));const A=n?p(o,s):h;A.width=o,A.height=s;return A.getContext("2d").drawImage(t,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+o+"x"+s+")."),A}return "data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+")."),t}return t}function g(t){const e=at(t);return St(e.width)&&St(e.height)}function v(t,e){return t.generateMipmaps&&e&&t.minFilter!==U&&t.minFilter!==B}function _(e){t.generateMipmap(e);}function y(n,r,i,a,o=!1){if(!1===s)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'");}let A=r;if(r===t.RED&&(i===t.FLOAT&&(A=t.R32F),i===t.HALF_FLOAT&&(A=t.R16F),i===t.UNSIGNED_BYTE&&(A=t.R8)),r===t.RED_INTEGER&&(i===t.UNSIGNED_BYTE&&(A=t.R8UI),i===t.UNSIGNED_SHORT&&(A=t.R16UI),i===t.UNSIGNED_INT&&(A=t.R32UI),i===t.BYTE&&(A=t.R8I),i===t.SHORT&&(A=t.R16I),i===t.INT&&(A=t.R32I)),r===t.RG&&(i===t.FLOAT&&(A=t.RG32F),i===t.HALF_FLOAT&&(A=t.RG16F),i===t.UNSIGNED_BYTE&&(A=t.RG8)),r===t.RG_INTEGER&&(i===t.UNSIGNED_BYTE&&(A=t.RG8UI),i===t.UNSIGNED_SHORT&&(A=t.RG16UI),i===t.UNSIGNED_INT&&(A=t.RG32UI),i===t.BYTE&&(A=t.RG8I),i===t.SHORT&&(A=t.RG16I),i===t.INT&&(A=t.RG32I)),r===t.RGBA){const e=o?st:Ht.getTransfer(a);i===t.FLOAT&&(A=t.RGBA32F),i===t.HALF_FLOAT&&(A=t.RGBA16F),i===t.UNSIGNED_BYTE&&(A=e===At?t.SRGB8_ALPHA8:t.RGBA8),i===t.UNSIGNED_SHORT_4_4_4_4&&(A=t.RGBA4),i===t.UNSIGNED_SHORT_5_5_5_1&&(A=t.RGB5_A1);}return A!==t.R16F&&A!==t.R32F&&A!==t.RG16F&&A!==t.RG32F&&A!==t.RGBA16F&&A!==t.RGBA32F||e.get("EXT_color_buffer_float"),A}function x(t,e,n){return !0===v(t,n)||t.isFramebufferTexture&&t.minFilter!==U&&t.minFilter!==B?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function b(e){return e===U||1004===e||e===N?t.NEAREST:t.LINEAR}function M(t){const e=t.target;e.removeEventListener("dispose",M),function(t){const e=r.get(t);if(void 0===e.__webglInit)return;const n=t.source,i=f.get(n);if(i){const r=i[e.__cacheKey];r.usedTimes--,0===r.usedTimes&&E(t),0===Object.keys(i).length&&f.delete(n);}r.remove(t);}(e),e.isVideoTexture&&u.delete(e);}function w(e){const n=e.target;n.removeEventListener("dispose",w),function(e){const n=r.get(e);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(n.__webglFramebuffer[e]))for(let r=0;r<n.__webglFramebuffer[e].length;r++)t.deleteFramebuffer(n.__webglFramebuffer[e][r]);else t.deleteFramebuffer(n.__webglFramebuffer[e]);n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[e]);}else {if(Array.isArray(n.__webglFramebuffer))for(let e=0;e<n.__webglFramebuffer.length;e++)t.deleteFramebuffer(n.__webglFramebuffer[e]);else t.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let e=0;e<n.__webglColorRenderbuffer.length;e++)n.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(n.__webglColorRenderbuffer[e]);n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer);}const i=e.textures;for(let e=0,n=i.length;e<n;e++){const n=r.get(i[e]);n.__webglTexture&&(t.deleteTexture(n.__webglTexture),o.memory.textures--),r.remove(i[e]);}r.remove(e);}(n);}function E(e){const n=r.get(e);t.deleteTexture(n.__webglTexture);const i=e.source;delete f.get(i)[n.__cacheKey],o.memory.textures--;}let S=0;function T(e,i){const a=r.get(e);if(e.isVideoTexture&&function(t){const e=o.render.frame;u.get(t)!==e&&(u.set(t,e),t.update());}(e),!1===e.isRenderTargetTexture&&e.version>0&&a.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else {if(!1!==t.complete)return void H(a,e,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");}}n.bindTexture(t.TEXTURE_2D,a.__webglTexture,t.TEXTURE0+i);}const C={[O]:t.REPEAT,[I]:t.CLAMP_TO_EDGE,[q]:t.MIRRORED_REPEAT},R={[U]:t.NEAREST,1004:t.NEAREST_MIPMAP_NEAREST,[N]:t.NEAREST_MIPMAP_LINEAR,[B]:t.LINEAR,[k]:t.LINEAR_MIPMAP_NEAREST,[F]:t.LINEAR_MIPMAP_LINEAR},P={512:t.NEVER,519:t.ALWAYS,513:t.LESS,515:t.LEQUAL,514:t.EQUAL,518:t.GEQUAL,516:t.GREATER,517:t.NOTEQUAL};function L(n,a,o){if(a.type!==V||!1!==e.has("OES_texture_float_linear")||a.magFilter!==B&&a.magFilter!==k&&a.magFilter!==N&&a.magFilter!==F&&a.minFilter!==B&&a.minFilter!==k&&a.minFilter!==N&&a.minFilter!==F||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),o?(t.texParameteri(n,t.TEXTURE_WRAP_S,C[a.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,C[a.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,C[a.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,R[a.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,R[a.minFilter])):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),a.wrapS===I&&a.wrapT===I||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,t.TEXTURE_MAG_FILTER,b(a.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,b(a.minFilter)),a.minFilter!==U&&a.minFilter!==B&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),a.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,P[a.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){if(a.magFilter===U)return;if(a.minFilter!==N&&a.minFilter!==F)return;if(a.type===V&&!1===e.has("OES_texture_float_linear"))return;if(!1===s&&a.type===W&&!1===e.has("OES_texture_half_float_linear"))return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){const o=e.get("EXT_texture_filter_anisotropic");t.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy;}}}function D(e,n){let r=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",M));const i=n.source;let a=f.get(i);void 0===a&&(a={},f.set(i,a));const s=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(s!==e.__cacheKey){void 0===a[s]&&(a[s]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;const i=a[e.__cacheKey];void 0!==i&&(a[e.__cacheKey].usedTimes--,0===i.usedTimes&&E(n)),e.__cacheKey=s,e.__webglTexture=a[s].texture;}return r}function H(e,o,A){let l=t.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=t.TEXTURE_3D);const c=D(e,o),u=o.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+A);const h=r.get(u);if(u.version!==h.__version||!0===c){n.activeTexture(t.TEXTURE0+A);const e=Ht.getPrimaries(Ht.workingColorSpace),r=o.colorSpace===nt?null:Ht.getPrimaries(o.colorSpace),f=o.colorSpace===nt||e===r?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,o.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,o.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);const d=function(t){return !s&&(t.wrapS!==I||t.wrapT!==I||t.minFilter!==U&&t.minFilter!==B)}(o)&&!1===g(o.image);let p=m(o.image,d,!1,i.maxTextureSize);p=rt(o,p);const b=g(p)||s,M=a.convert(o.format,o.colorSpace);let w,E=a.convert(o.type),S=y(o.internalFormat,M,E,o.colorSpace,o.isVideoTexture);L(l,o,b);const T=o.mipmaps,C=s&&!0!==o.isVideoTexture&&36196!==S,R=void 0===h.__version||!0===c,P=u.dataReady,D=x(o,p,b);if(o.isDepthTexture)S=t.DEPTH_COMPONENT,s?S=o.type===V?t.DEPTH_COMPONENT32F:o.type===j?t.DEPTH_COMPONENT24:o.type===X?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:o.type===V&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),o.format===Y&&S===t.DEPTH_COMPONENT&&o.type!==G&&o.type!==j&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),o.type=j,E=a.convert(o.type)),o.format===Z&&S===t.DEPTH_COMPONENT&&(S=t.DEPTH_STENCIL,o.type!==X&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),o.type=X,E=a.convert(o.type))),R&&(C?n.texStorage2D(t.TEXTURE_2D,1,S,p.width,p.height):n.texImage2D(t.TEXTURE_2D,0,S,p.width,p.height,0,M,E,null));else if(o.isDataTexture)if(T.length>0&&b){C&&R&&n.texStorage2D(t.TEXTURE_2D,D,S,T[0].width,T[0].height);for(let e=0,r=T.length;e<r;e++)w=T[e],C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,E,w.data):n.texImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,M,E,w.data);o.generateMipmaps=!1;}else C?(R&&n.texStorage2D(t.TEXTURE_2D,D,S,p.width,p.height),P&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,p.width,p.height,M,E,p.data)):n.texImage2D(t.TEXTURE_2D,0,S,p.width,p.height,0,M,E,p.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){C&&R&&n.texStorage3D(t.TEXTURE_2D_ARRAY,D,S,T[0].width,T[0].height,p.depth);for(let e=0,r=T.length;e<r;e++)w=T[e],o.format!==Q?null!==M?C?P&&n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,w.width,w.height,p.depth,M,w.data,0,0):n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,S,w.width,w.height,p.depth,0,w.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?P&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,w.width,w.height,p.depth,M,E,w.data):n.texImage3D(t.TEXTURE_2D_ARRAY,e,S,w.width,w.height,p.depth,0,M,E,w.data);}else {C&&R&&n.texStorage2D(t.TEXTURE_2D,D,S,T[0].width,T[0].height);for(let e=0,r=T.length;e<r;e++)w=T[e],o.format!==Q?null!==M?C?P&&n.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,w.data):n.compressedTexImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,E,w.data):n.texImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,M,E,w.data);}else if(o.isDataArrayTexture)C?(R&&n.texStorage3D(t.TEXTURE_2D_ARRAY,D,S,p.width,p.height,p.depth),P&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,M,E,p.data)):n.texImage3D(t.TEXTURE_2D_ARRAY,0,S,p.width,p.height,p.depth,0,M,E,p.data);else if(o.isData3DTexture)C?(R&&n.texStorage3D(t.TEXTURE_3D,D,S,p.width,p.height,p.depth),P&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,M,E,p.data)):n.texImage3D(t.TEXTURE_3D,0,S,p.width,p.height,p.depth,0,M,E,p.data);else if(o.isFramebufferTexture){if(R)if(C)n.texStorage2D(t.TEXTURE_2D,D,S,p.width,p.height);else {let e=p.width,r=p.height;for(let i=0;i<D;i++)n.texImage2D(t.TEXTURE_2D,i,S,e,r,0,M,E,null),e>>=1,r>>=1;}}else if(T.length>0&&b){if(C&&R){const e=at(T[0]);n.texStorage2D(t.TEXTURE_2D,D,S,e.width,e.height);}for(let e=0,r=T.length;e<r;e++)w=T[e],C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,M,E,w):n.texImage2D(t.TEXTURE_2D,e,S,M,E,w);o.generateMipmaps=!1;}else if(C){if(R){const e=at(p);n.texStorage2D(t.TEXTURE_2D,D,S,e.width,e.height);}P&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,M,E,p);}else n.texImage2D(t.TEXTURE_2D,0,S,M,E,p);v(o,b)&&_(l),h.__version=u.version,o.onUpdate&&o.onUpdate(o);}e.__version=o.version;}function K(e,i,o,s,l,c){const u=a.convert(o.format,o.colorSpace),h=a.convert(o.type),f=y(o.internalFormat,u,h,o.colorSpace);if(!r.get(i).__hasExternalTextures){const e=Math.max(1,i.width>>c),r=Math.max(1,i.height>>c);l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?n.texImage3D(l,c,f,e,r,i.depth,0,u,h,null):n.texImage2D(l,c,f,e,r,0,u,h,null);}n.bindFramebuffer(t.FRAMEBUFFER,e),et(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,s,l,r.get(o).__webglTexture,0,tt(i)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,s,l,r.get(o).__webglTexture,c),n.bindFramebuffer(t.FRAMEBUFFER,null);}function J(e,n,r){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer){let i=!0===s?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(r||et(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===V?i=t.DEPTH_COMPONENT32F:e.type===j&&(i=t.DEPTH_COMPONENT24));const r=tt(n);et(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,i,n.width,n.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,r,i,n.width,n.height);}else t.renderbufferStorage(t.RENDERBUFFER,i,n.width,n.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e);}else if(n.depthBuffer&&n.stencilBuffer){const i=tt(n);r&&!1===et(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,i,t.DEPTH24_STENCIL8,n.width,n.height):et(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,t.DEPTH24_STENCIL8,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e);}else {const e=n.textures;for(let i=0;i<e.length;i++){const o=e[i],s=a.convert(o.format,o.colorSpace),l=a.convert(o.type),c=y(o.internalFormat,s,l,o.colorSpace),u=tt(n);r&&!1===et(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,u,c,n.width,n.height):et(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,u,c,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,c,n.width,n.height);}}t.bindRenderbuffer(t.RENDERBUFFER,null);}function $(e){const i=r.get(e),a=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),T(i.depthTexture,0);const a=r.get(i.depthTexture).__webglTexture,o=tt(i);if(i.depthTexture.format===Y)et(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0);else {if(i.depthTexture.format!==Z)throw new Error("Unknown depthTexture format");et(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0);}}(i.__webglFramebuffer,e);}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=t.createRenderbuffer(),J(i.__webglDepthbuffer[r],e,!1);}else n.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),J(i.__webglDepthbuffer,e,!1);n.bindFramebuffer(t.FRAMEBUFFER,null);}function tt(t){return Math.min(i.maxSamples,t.samples)}function et(t){const n=r.get(t);return s&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function rt(t,n){const r=t.colorSpace,i=t.format,a=t.type;return !0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===dt||r!==it&&r!==nt&&(Ht.getTransfer(r)===At?!1===s?!0===e.has("EXT_sRGB")&&i===Q?(t.format=dt,t.minFilter=B,t.generateMipmaps=!1):n=Xt.sRGBToLinear(n):i===Q&&a===z||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",r)),n}function at(t){return "undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?(c.width=t.naturalWidth||t.width,c.height=t.naturalHeight||t.height):"undefined"!=typeof VideoFrame&&t instanceof VideoFrame?(c.width=t.displayWidth,c.height=t.displayHeight):(c.width=t.width,c.height=t.height),c}this.allocateTextureUnit=function(){const t=S;return t>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+i.maxTextures),S+=1,t},this.resetTextureUnits=function(){S=0;},this.setTexture2D=T,this.setTexture2DArray=function(e,i){const a=r.get(e);e.version>0&&a.__version!==e.version?H(a,e,i):n.bindTexture(t.TEXTURE_2D_ARRAY,a.__webglTexture,t.TEXTURE0+i);},this.setTexture3D=function(e,i){const a=r.get(e);e.version>0&&a.__version!==e.version?H(a,e,i):n.bindTexture(t.TEXTURE_3D,a.__webglTexture,t.TEXTURE0+i);},this.setTextureCube=function(e,o){const A=r.get(e);e.version>0&&A.__version!==e.version?function(e,o,A){if(6!==o.image.length)return;const l=D(e,o),c=o.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+A);const u=r.get(c);if(c.version!==u.__version||!0===l){n.activeTexture(t.TEXTURE0+A);const e=Ht.getPrimaries(Ht.workingColorSpace),r=o.colorSpace===nt?null:Ht.getPrimaries(o.colorSpace),h=o.colorSpace===nt||e===r?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,o.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,o.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);const f=o.isCompressedTexture||o.image[0].isCompressedTexture,d=o.image[0]&&o.image[0].isDataTexture,p=[];for(let t=0;t<6;t++)p[t]=f||d?d?o.image[t].image:o.image[t]:m(o.image[t],!1,!0,i.maxCubemapSize),p[t]=rt(o,p[t]);const b=p[0],M=g(b)||s,w=a.convert(o.format,o.colorSpace),E=a.convert(o.type),S=y(o.internalFormat,w,E,o.colorSpace),T=s&&!0!==o.isVideoTexture,C=void 0===u.__version||!0===l,R=c.dataReady;let P,D=x(o,b,M);if(L(t.TEXTURE_CUBE_MAP,o,M),f){T&&C&&n.texStorage2D(t.TEXTURE_CUBE_MAP,D,S,b.width,b.height);for(let e=0;e<6;e++){P=p[e].mipmaps;for(let r=0;r<P.length;r++){const i=P[r];o.format!==Q?null!==w?T?R&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,0,0,i.width,i.height,w,i.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,S,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,0,0,i.width,i.height,w,E,i.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,S,i.width,i.height,0,w,E,i.data);}}}else {if(P=o.mipmaps,T&&C){P.length>0&&D++;const e=at(p[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,D,S,e.width,e.height);}for(let e=0;e<6;e++)if(d){T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,p[e].width,p[e].height,w,E,p[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,p[e].width,p[e].height,0,w,E,p[e].data);for(let r=0;r<P.length;r++){const i=P[r].image[e].image;T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,0,0,i.width,i.height,w,E,i.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,S,i.width,i.height,0,w,E,i.data);}}else {T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,w,E,p[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,w,E,p[e]);for(let r=0;r<P.length;r++){const i=P[r];T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,0,0,w,E,i.image[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,S,w,E,i.image[e]);}}}v(o,M)&&_(t.TEXTURE_CUBE_MAP),u.__version=c.version,o.onUpdate&&o.onUpdate(o);}e.__version=o.version;}(A,e,o):n.bindTexture(t.TEXTURE_CUBE_MAP,A.__webglTexture,t.TEXTURE0+o);},this.rebindTextures=function(e,n,i){const a=r.get(e);void 0!==n&&K(a.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),void 0!==i&&$(e);},this.setupRenderTarget=function(e){const A=e.texture,l=r.get(e),c=r.get(A);e.addEventListener("dispose",w);const u=e.textures,h=!0===e.isWebGLCubeRenderTarget,f=u.length>1,d=g(e)||s;if(f||(void 0===c.__webglTexture&&(c.__webglTexture=t.createTexture()),c.__version=A.version,o.memory.textures++),h){l.__webglFramebuffer=[];for(let e=0;e<6;e++)if(s&&A.mipmaps&&A.mipmaps.length>0){l.__webglFramebuffer[e]=[];for(let n=0;n<A.mipmaps.length;n++)l.__webglFramebuffer[e][n]=t.createFramebuffer();}else l.__webglFramebuffer[e]=t.createFramebuffer();}else {if(s&&A.mipmaps&&A.mipmaps.length>0){l.__webglFramebuffer=[];for(let e=0;e<A.mipmaps.length;e++)l.__webglFramebuffer[e]=t.createFramebuffer();}else l.__webglFramebuffer=t.createFramebuffer();if(f)if(i.drawBuffers)for(let e=0,n=u.length;e<n;e++){const n=r.get(u[e]);void 0===n.__webglTexture&&(n.__webglTexture=t.createTexture(),o.memory.textures++);}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(s&&e.samples>0&&!1===et(e)){l.__webglMultisampledFramebuffer=t.createFramebuffer(),l.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,l.__webglMultisampledFramebuffer);for(let n=0;n<u.length;n++){const r=u[n];l.__webglColorRenderbuffer[n]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,l.__webglColorRenderbuffer[n]);const i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),s=y(r.internalFormat,i,o,r.colorSpace,!0===e.isXRRenderTarget),A=tt(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,A,s,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,l.__webglColorRenderbuffer[n]);}t.bindRenderbuffer(t.RENDERBUFFER,null),e.depthBuffer&&(l.__webglDepthRenderbuffer=t.createRenderbuffer(),J(l.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null);}}if(h){n.bindTexture(t.TEXTURE_CUBE_MAP,c.__webglTexture),L(t.TEXTURE_CUBE_MAP,A,d);for(let n=0;n<6;n++)if(s&&A.mipmaps&&A.mipmaps.length>0)for(let r=0;r<A.mipmaps.length;r++)K(l.__webglFramebuffer[n][r],e,A,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else K(l.__webglFramebuffer[n],e,A,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);v(A,d)&&_(t.TEXTURE_CUBE_MAP),n.unbindTexture();}else if(f){for(let i=0,a=u.length;i<a;i++){const a=u[i],o=r.get(a);n.bindTexture(t.TEXTURE_2D,o.__webglTexture),L(t.TEXTURE_2D,a,d),K(l.__webglFramebuffer,e,a,t.COLOR_ATTACHMENT0+i,t.TEXTURE_2D,0),v(a,d)&&_(t.TEXTURE_2D);}n.unbindTexture();}else {let r=t.TEXTURE_2D;if((e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(s?r=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(r,c.__webglTexture),L(r,A,d),s&&A.mipmaps&&A.mipmaps.length>0)for(let n=0;n<A.mipmaps.length;n++)K(l.__webglFramebuffer[n],e,A,t.COLOR_ATTACHMENT0,r,n);else K(l.__webglFramebuffer,e,A,t.COLOR_ATTACHMENT0,r,0);v(A,d)&&_(r),n.unbindTexture();}e.depthBuffer&&$(e);},this.updateRenderTargetMipmap=function(e){const i=g(e)||s,a=e.textures;for(let o=0,s=a.length;o<s;o++){const s=a[o];if(v(s,i)){const i=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,a=r.get(s).__webglTexture;n.bindTexture(i,a),_(i),n.unbindTexture();}}},this.updateMultisampleRenderTarget=function(e){if(s&&e.samples>0&&!1===et(e)){const i=e.textures,a=e.width,o=e.height;let s=t.COLOR_BUFFER_BIT;const A=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,u=r.get(e),h=i.length>1;if(h)for(let e=0;e<i.length;e++)n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){A.push(t.COLOR_ATTACHMENT0+n),e.depthBuffer&&A.push(c);const f=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;if(!1===f&&(e.depthBuffer&&(s|=t.DEPTH_BUFFER_BIT),e.stencilBuffer&&(s|=t.STENCIL_BUFFER_BIT)),h&&t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,u.__webglColorRenderbuffer[n]),!0===f&&(t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[c]),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[c])),h){const e=r.get(i[n]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0);}t.blitFramebuffer(0,0,a,o,0,0,a,o,s,t.NEAREST),l&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,A);}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),h)for(let e=0;e<i.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,u.__webglColorRenderbuffer[e]);const a=r.get(i[e]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,a,0);}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer);}},this.setupDepthRenderbuffer=$,this.setupFrameBufferTexture=K,this.useMultisampledRTT=et;}function Ao(t,e,n){const r=n.isWebGL2;return {convert:function(n,i=""){let a;const o=Ht.getTransfer(i);if(n===z)return t.UNSIGNED_BYTE;if(1017===n)return t.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return t.UNSIGNED_SHORT_5_5_5_1;if(1010===n)return t.BYTE;if(1011===n)return t.SHORT;if(n===G)return t.UNSIGNED_SHORT;if(n===H)return t.INT;if(n===j)return t.UNSIGNED_INT;if(n===V)return t.FLOAT;if(n===W)return r?t.HALF_FLOAT:(a=e.get("OES_texture_half_float"),null!==a?a.HALF_FLOAT_OES:null);if(1021===n)return t.ALPHA;if(n===Q)return t.RGBA;if(1024===n)return t.LUMINANCE;if(1025===n)return t.LUMINANCE_ALPHA;if(n===Y)return t.DEPTH_COMPONENT;if(n===Z)return t.DEPTH_STENCIL;if(n===dt)return a=e.get("EXT_sRGB"),null!==a?a.SRGB_ALPHA_EXT:null;if(1028===n)return t.RED;if(1029===n)return t.RED_INTEGER;if(1030===n)return t.RG;if(1031===n)return t.RG_INTEGER;if(1033===n)return t.RGBA_INTEGER;if(n===K||n===J||n===$||n===tt)if(o===At){if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===a)return null;if(n===K)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===J)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===$)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===tt)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else {if(a=e.get("WEBGL_compressed_texture_s3tc"),null===a)return null;if(n===K)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===J)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===$)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===tt)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(a=e.get("WEBGL_compressed_texture_pvrtc"),null===a)return null;if(35840===n)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n)return a=e.get("WEBGL_compressed_texture_etc1"),null!==a?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(37492===n||37496===n){if(a=e.get("WEBGL_compressed_texture_etc"),null===a)return null;if(37492===n)return o===At?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(37496===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(a=e.get("WEBGL_compressed_texture_astc"),null===a)return null;if(37808===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===et||36494===n||36495===n){if(a=e.get("EXT_texture_compression_bptc"),null===a)return null;if(n===et)return o===At?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===n)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===n)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||36284===n||36285===n||36286===n){if(a=e.get("EXT_texture_compression_rgtc"),null===a)return null;if(n===et)return a.COMPRESSED_RED_RGTC1_EXT;if(36284===n)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===n)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===n)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===X?r?t.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),null!==a?a.UNSIGNED_INT_24_8_WEBGL:null):void 0!==t[n]?t[n]:null}}}class lo extends _r{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t;}}let co=class extends ln{constructor(){super(),this.isGroup=!0,this.type="Group";}};const uo={type:"move"};class ho{constructor(){this._targetRay=null,this._grip=null,this._hand=null;}getHandSpace(){return null===this._hand&&(this._hand=new co,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new co,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ae,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ae),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new co,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ae,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ae),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n);}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,n){let r=null,i=null,a=null;const o=this._targetRay,s=this._grip,A=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(A&&t.hand){a=!0;for(const r of t.hand.values()){const t=e.getJointPose(r,n),i=this._getHandJoint(A,r);null!==t&&(i.matrix.fromArray(t.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=t.radius),i.visible=null!==t;}const r=A.joints["index-finger-tip"],i=A.joints["thumb-tip"],o=r.position.distanceTo(i.position),s=.02,l=.005;A.inputState.pinching&&o>s+l?(A.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!A.inputState.pinching&&o<=s-l&&(A.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}));}else null!==s&&t.gripSpace&&(i=e.getPose(t.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));null!==o&&(r=e.getPose(t.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(uo)));}return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==A&&(A.visible=null!==a),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new co;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n);}return t.joints[e.jointName]}}class fo{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0;}init(t,e,n){if(null===this.texture){const r=new Jt;t.properties.get(r).__webglTexture=e.texture,e.depthNear==n.depthNear&&e.depthFar==n.depthFar||(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r;}}render(t,e){if(null!==this.texture){if(null===this.mesh){const t=e.cameras[0].viewport,n=new dr({extensions:{fragDepth:!0},vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new sr(new Or(20,20),n);}t.render(this.mesh,e);}}reset(){this.texture=null,this.mesh=null;}}class po extends gt{constructor(t,e){super();const n=this;let r=null,i=1,a=null,o="local-floor",s=1,A=null,l=null,c=null,u=null,h=null,f=null;const d=new fo,p=e.getContextAttributes();let m=null,g=null;const v=[],_=[],y=new Lt;let x=null;const b=new _r;b.layers.enable(1),b.viewport=new $t;const M=new _r;M.layers.enable(2),M.viewport=new $t;const w=[b,M],E=new lo;E.layers.enable(1),E.layers.enable(2);let S=null,T=null;function C(t){const e=_.indexOf(t.inputSource);if(-1===e)return;const n=v[e];void 0!==n&&(n.update(t.inputSource,t.frame,A||a),n.dispatchEvent({type:t.type,data:t.inputSource}));}function R(){r.removeEventListener("select",C),r.removeEventListener("selectstart",C),r.removeEventListener("selectend",C),r.removeEventListener("squeeze",C),r.removeEventListener("squeezestart",C),r.removeEventListener("squeezeend",C),r.removeEventListener("end",R),r.removeEventListener("inputsourceschange",P);for(let t=0;t<v.length;t++){const e=_[t];null!==e&&(_[t]=null,v[t].disconnect(e));}S=null,T=null,d.reset(),t.setRenderTarget(m),h=null,u=null,c=null,r=null,g=null,q.stop(),n.isPresenting=!1,t.setPixelRatio(x),t.setSize(y.width,y.height,!1),n.dispatchEvent({type:"sessionend"});}function P(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e],r=_.indexOf(n);r>=0&&(_[r]=null,v[r].disconnect(n));}for(let e=0;e<t.added.length;e++){const n=t.added[e];let r=_.indexOf(n);if(-1===r){for(let t=0;t<v.length;t++){if(t>=_.length){_.push(n),r=t;break}if(null===_[t]){_[t]=n,r=t;break}}if(-1===r)break}const i=v[r];i&&i.connect(n);}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=v[t];return void 0===e&&(e=new ho,v[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=v[t];return void 0===e&&(e=new ho,v[t]=e),e.getGripSpace()},this.getHand=function(t){let e=v[t];return void 0===e&&(e=new ho,v[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){i=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.");},this.setReferenceSpaceType=function(t){o=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.");},this.getReferenceSpace=function(){return A||a},this.setReferenceSpace=function(t){A=t;},this.getBaseLayer=function(){return null!==u?u:h},this.getBinding=function(){return c},this.getFrame=function(){return f},this.getSession=function(){return r},this.setSession=async function(l){if(r=l,null!==r){if(m=t.getRenderTarget(),r.addEventListener("select",C),r.addEventListener("selectstart",C),r.addEventListener("selectend",C),r.addEventListener("squeeze",C),r.addEventListener("squeezestart",C),r.addEventListener("squeezeend",C),r.addEventListener("end",R),r.addEventListener("inputsourceschange",P),!0!==p.xrCompatible&&await e.makeXRCompatible(),x=t.getPixelRatio(),t.getSize(y),void 0===r.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==r.renderState.layers||p.antialias,alpha:!0,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:i};h=new XRWebGLLayer(r,e,n),r.updateRenderState({baseLayer:h}),t.setPixelRatio(1),t.setSize(h.framebufferWidth,h.framebufferHeight,!1),g=new ee(h.framebufferWidth,h.framebufferHeight,{format:Q,type:z,colorSpace:t.outputColorSpace,stencilBuffer:p.stencil});}else {let n=null,a=null,o=null;p.depth&&(o=p.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=p.stencil?Z:Y,a=p.stencil?X:j);const s={colorFormat:e.RGBA8,depthFormat:o,scaleFactor:i};c=new XRWebGLBinding(r,e),u=c.createProjectionLayer(s),r.updateRenderState({layers:[u]}),t.setPixelRatio(1),t.setSize(u.textureWidth,u.textureHeight,!1),g=new ee(u.textureWidth,u.textureHeight,{format:Q,type:z,depthTexture:new vi(u.textureWidth,u.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:p.stencil,colorSpace:t.outputColorSpace,samples:p.antialias?4:0});t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues;}g.isXRRenderTarget=!0,this.setFoveation(s),A=null,a=await r.requestReferenceSpace(o),q.setContext(r),q.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"});}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode};const L=new ae,D=new ae;function O(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert();}this.updateCamera=function(t){if(null===r)return;null!==d.texture&&(t.near=d.depthNear,t.far=d.depthFar),E.near=M.near=b.near=t.near,E.far=M.far=b.far=t.far,S===E.near&&T===E.far||(r.updateRenderState({depthNear:E.near,depthFar:E.far}),S=E.near,T=E.far,b.near=S,b.far=T,M.near=S,M.far=T,b.updateProjectionMatrix(),M.updateProjectionMatrix(),t.updateProjectionMatrix());const e=t.parent,n=E.cameras;O(E,e);for(let t=0;t<n.length;t++)O(n[t],e);2===n.length?function(t,e,n){L.setFromMatrixPosition(e.matrixWorld),D.setFromMatrixPosition(n.matrixWorld);const r=L.distanceTo(D),i=e.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),A=(i[9]+1)/i[5],l=(i[9]-1)/i[5],c=(i[8]-1)/i[0],u=(a[8]+1)/a[0],h=o*c,f=o*u,d=r/(-c+u),p=d*-c;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(p),t.translateZ(d),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const m=o+d,g=s+d,v=h-p,_=f+(r-p),y=A*s/g*m,x=l*s/g*m;t.projectionMatrix.makePerspective(v,_,y,x,m,g),t.projectionMatrixInverse.copy(t.projectionMatrix).invert();}(E,b,M):E.projectionMatrix.copy(b.projectionMatrix),function(t,e,n){null===n?t.matrix.copy(e.matrixWorld):(t.matrix.copy(n.matrixWorld),t.matrix.invert(),t.matrix.multiply(e.matrixWorld));t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*xt*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1);}(t,E,e);},this.getCamera=function(){return E},this.getFoveation=function(){if(null!==u||null!==h)return s},this.setFoveation=function(t){s=t,null!==u&&(u.fixedFoveation=t),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=t);},this.hasDepthSensing=function(){return null!==d.texture};let I=null;const q=new Lr;q.setAnimationLoop((function(e,i){if(l=i.getViewerPose(A||a),f=i,null!==l){const e=l.views;null!==h&&(t.setRenderTargetFramebuffer(g,h.framebuffer),t.setRenderTarget(g));let n=!1;e.length!==E.cameras.length&&(E.cameras.length=0,n=!0);for(let r=0;r<e.length;r++){const i=e[r];let a=null;if(null!==h)a=h.getViewport(i);else {const e=c.getViewSubImage(u,i);a=e.viewport,0===r&&(t.setRenderTargetTextures(g,e.colorTexture,u.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(g));}let o=w[r];void 0===o&&(o=new _r,o.layers.enable(r),o.viewport=new $t,w[r]=o),o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(i.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),0===r&&(E.matrix.copy(o.matrix),E.matrix.decompose(E.position,E.quaternion,E.scale)),!0===n&&E.cameras.push(o);}const i=r.enabledFeatures;if(i&&i.includes("depth-sensing")){const n=c.getDepthInformation(e[0]);n&&n.isValid&&n.texture&&d.init(t,n,r.renderState);}}for(let t=0;t<v.length;t++){const e=_[t],n=v[t];null!==e&&void 0!==n&&n.update(e,i,A||a);}d.render(t,E),I&&I(e,i),i.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:i}),f=null;})),this.setAnimationLoop=function(t){I=t;},this.dispose=function(){};}}const mo=new Ve,go=new qe;function vo(t,e){function n(t,e){!0===t.matrixAutoUpdate&&t.updateMatrix(),e.value.copy(t.matrix);}function r(r,i){r.opacity.value=i.opacity,i.color&&r.diffuse.value.copy(i.color),i.emissive&&r.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(r.map.value=i.map,n(i.map,r.mapTransform)),i.alphaMap&&(r.alphaMap.value=i.alphaMap,n(i.alphaMap,r.alphaMapTransform)),i.bumpMap&&(r.bumpMap.value=i.bumpMap,n(i.bumpMap,r.bumpMapTransform),r.bumpScale.value=i.bumpScale,i.side===g&&(r.bumpScale.value*=-1)),i.normalMap&&(r.normalMap.value=i.normalMap,n(i.normalMap,r.normalMapTransform),r.normalScale.value.copy(i.normalScale),i.side===g&&r.normalScale.value.negate()),i.displacementMap&&(r.displacementMap.value=i.displacementMap,n(i.displacementMap,r.displacementMapTransform),r.displacementScale.value=i.displacementScale,r.displacementBias.value=i.displacementBias),i.emissiveMap&&(r.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,r.emissiveMapTransform)),i.specularMap&&(r.specularMap.value=i.specularMap,n(i.specularMap,r.specularMapTransform)),i.alphaTest>0&&(r.alphaTest.value=i.alphaTest);const a=e.get(i),o=a.envMap,s=a.envMapRotation;if(o&&(r.envMap.value=o,mo.copy(s),mo.x*=-1,mo.y*=-1,mo.z*=-1,o.isCubeTexture&&!1===o.isRenderTargetTexture&&(mo.y*=-1,mo.z*=-1),r.envMapRotation.value.setFromMatrix4(go.makeRotationFromEuler(mo)),r.flipEnvMap.value=o.isCubeTexture&&!1===o.isRenderTargetTexture?-1:1,r.reflectivity.value=i.reflectivity,r.ior.value=i.ior,r.refractionRatio.value=i.refractionRatio),i.lightMap){r.lightMap.value=i.lightMap;const e=!0===t._useLegacyLights?Math.PI:1;r.lightMapIntensity.value=i.lightMapIntensity*e,n(i.lightMap,r.lightMapTransform);}i.aoMap&&(r.aoMap.value=i.aoMap,r.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,r.aoMapTransform));}return {refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,hr(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density);},refreshMaterialUniforms:function(t,i,a,o,s){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(t,i):i.isMeshToonMaterial?(r(t,i),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap);}(t,i)):i.isMeshPhongMaterial?(r(t,i),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4);}(t,i)):i.isMeshStandardMaterial?(r(t,i),function(t,r){t.metalness.value=r.metalness,r.metalnessMap&&(t.metalnessMap.value=r.metalnessMap,n(r.metalnessMap,t.metalnessMapTransform));t.roughness.value=r.roughness,r.roughnessMap&&(t.roughnessMap.value=r.roughnessMap,n(r.roughnessMap,t.roughnessMapTransform));const i=e.get(r).envMap;i&&(t.envMapIntensity.value=r.envMapIntensity);}(t,i),i.isMeshPhysicalMaterial&&function(t,e,r){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===g&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=r.texture,t.transmissionSamplerSize.value.set(r.width,r.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform));}(t,i,s)):i.isMeshMatcapMaterial?(r(t,i),function(t,e){e.matcap&&(t.matcap.value=e.matcap);}(t,i)):i.isMeshDepthMaterial?r(t,i):i.isMeshDistanceMaterial?(r(t,i),function(t,n){const r=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(r.matrixWorld),t.nearDistance.value=r.shadow.camera.near,t.farDistance.value=r.shadow.camera.far;}(t,i)):i.isMeshNormalMaterial?r(t,i):i.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));}(t,i),i.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale;}(t,i)):i.isPointsMaterial?function(t,e,r,i){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*r,t.scale.value=.5*i,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);}(t,i,a,o):i.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);}(t,i):i.isShadowMaterial?(t.color.value.copy(i.color),t.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1);}}}function _o(t,e,n,r){let i={},a={},o=[];const s=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function A(t,e,n,r){const i=t.value,a=e+"_"+n;if(void 0===r[a])return r[a]="number"==typeof i||"boolean"==typeof i?i:i.clone(),!0;{const t=r[a];if("number"==typeof i||"boolean"==typeof i){if(t!==i)return r[a]=i,!0}else if(!1===t.equals(i))return t.copy(i),!0}return !1}function l(t){const e={boundary:0,storage:0};return "number"==typeof t||"boolean"==typeof t?(e.boundary=4,e.storage=4):t.isVector2?(e.boundary=8,e.storage=8):t.isVector3||t.isColor?(e.boundary=16,e.storage=12):t.isVector4?(e.boundary=16,e.storage=16):t.isMatrix3?(e.boundary=48,e.storage=48):t.isMatrix4?(e.boundary=64,e.storage=64):t.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t),e}function c(e){const n=e.target;n.removeEventListener("dispose",c);const r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),t.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id];}return {bind:function(t,e){const n=e.program;r.uniformBlockBinding(t,n);},update:function(n,u){let h=i[n.id];void 0===h&&(!function(t){const e=t.uniforms;let n=0;const r=16;for(let t=0,i=e.length;t<i;t++){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0,e=i.length;t<e;t++){const e=i[t],a=Array.isArray(e.value)?e.value:[e.value];for(let t=0,i=a.length;t<i;t++){const i=l(a[t]),o=n%r;0!==o&&r-o<i.boundary&&(n+=r-o),e.__data=new Float32Array(i.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=n,n+=i.storage;}}}const i=n%r;i>0&&(n+=r-i);t.__size=n,t.__cache={};}(n),h=function(e){const n=function(){for(let t=0;t<s;t++)if(-1===o.indexOf(t))return o.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();e.__bindingPointIndex=n;const r=t.createBuffer(),i=e.__size,a=e.usage;return t.bindBuffer(t.UNIFORM_BUFFER,r),t.bufferData(t.UNIFORM_BUFFER,i,a),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=h,n.addEventListener("dispose",c));const f=u.program;r.updateUBOMapping(n,f);const d=e.render.frame;a[n.id]!==d&&(!function(e){const n=i[e.id],r=e.uniforms,a=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,n);for(let e=0,n=r.length;e<n;e++){const n=Array.isArray(r[e])?r[e]:[r[e]];for(let r=0,i=n.length;r<i;r++){const i=n[r];if(!0===A(i,e,r,a)){const e=i.__offset,n=Array.isArray(i.value)?i.value:[i.value];let r=0;for(let a=0;a<n.length;a++){const o=n[a],s=l(o);"number"==typeof o||"boolean"==typeof o?(i.__data[0]=o,t.bufferSubData(t.UNIFORM_BUFFER,e+r,i.__data)):o.isMatrix3?(i.__data[0]=o.elements[0],i.__data[1]=o.elements[1],i.__data[2]=o.elements[2],i.__data[3]=0,i.__data[4]=o.elements[3],i.__data[5]=o.elements[4],i.__data[6]=o.elements[5],i.__data[7]=0,i.__data[8]=o.elements[6],i.__data[9]=o.elements[7],i.__data[10]=o.elements[8],i.__data[11]=0):(o.toArray(i.__data,r),r+=s.storage/Float32Array.BYTES_PER_ELEMENT);}t.bufferSubData(t.UNIFORM_BUFFER,e,i.__data);}}}t.bindBuffer(t.UNIFORM_BUFFER,null);}(n),a[n.id]=d);},dispose:function(){for(const e in i)t.deleteBuffer(i[e]);o=[],i={},a={};}}}class yo{constructor(t={}){const{canvas:e=Ut(),context:n=null,depth:r=!0,stencil:i=!0,alpha:a=!1,antialias:o=!1,premultipliedAlpha:A=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1}=t;let h;this.isWebGLRenderer=!0,h=null!==n?n.getContextAttributes().alpha:a;const f=new Uint32Array(4),d=new Int32Array(4);let p=null,v=null;const _=[],y=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=rt,this._useLegacyLights=!1,this.toneMapping=b,this.toneMappingExposure=1;const x=this;let M=!1,w=0,E=0,S=null,T=-1,C=null;const R=new $t,P=new $t;let L=null;const D=new En(0);let O=0,I=e.width,q=e.height,U=1,N=null,B=null;const k=new $t(0,0,I,q),H=new $t(0,0,I,q);let Y=!1;const Z=new Pr;let K=!1,J=!1,$=null;const tt=new qe,et=new Lt,nt=new ae,at={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ot(){return null===S?U:1}let st,At,lt,ct,ut,ht,ft,dt,pt,mt,gt,vt,_t,yt,xt,bt,Mt,wt,Et,St,Ct,Rt,Pt,Dt,Ot=n;function It(t,n){for(let r=0;r<t.length;r++){const i=t[r],a=e.getContext(i,n);if(null!==a)return a}return null}try{const t={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:A,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${s}`),e.addEventListener("webglcontextlost",Bt,!1),e.addEventListener("webglcontextrestored",kt,!1),e.addEventListener("webglcontextcreationerror",Ft,!1),null===Ot){const e=["webgl2","webgl","experimental-webgl"];if(!0===x.isWebGL1Renderer&&e.shift(),Ot=It(e,t),null===Ot)throw It(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}"undefined"!=typeof WebGLRenderingContext&&Ot instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),void 0===Ot.getShaderPrecisionFormat&&(Ot.getShaderPrecisionFormat=function(){return {rangeMin:1,rangeMax:1,precision:1}});}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function qt(){st=new ci(Ot),At=new Hr(Ot,st,t),st.init(At),Rt=new Ao(Ot,st,At),lt=new oo(Ot,st,At),ct=new fi(Ot),ut=new Wa,ht=new so(Ot,st,lt,ut,At,Rt,ct),ft=new Vr(x),dt=new li(x),pt=new Dr(Ot,At),Pt=new zr(Ot,st,pt,At),mt=new ui(Ot,pt,ct,Pt),gt=new gi(Ot,mt,pt,ct),Et=new mi(Ot,At,ht),bt=new jr(ut),vt=new Va(x,ft,dt,st,At,Pt,bt),_t=new vo(x,ut),yt=new Za,xt=new no(st,At),wt=new Fr(x,ft,dt,lt,gt,h,A),Mt=new ao(x,gt,At),Dt=new _o(Ot,ct,At,lt),St=new Gr(Ot,st,ct,At),Ct=new hi(Ot,st,ct,At),ct.programs=vt.programs,x.capabilities=At,x.extensions=st,x.properties=ut,x.renderLists=yt,x.shadowMap=Mt,x.state=lt,x.info=ct;}qt();const Nt=new po(x,Ot);function Bt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0;}function kt(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const t=ct.autoReset,e=Mt.enabled,n=Mt.autoUpdate,r=Mt.needsUpdate,i=Mt.type;qt(),ct.autoReset=t,Mt.enabled=e,Mt.autoUpdate=n,Mt.needsUpdate=r,Mt.type=i;}function Ft(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage);}function zt(t){const e=t.target;e.removeEventListener("dispose",zt),function(t){((function(t){const e=ut.get(t).programs;void 0!==e&&(e.forEach((function(t){vt.releaseProgram(t);})),t.isShaderMaterial&&vt.releaseShaderCache(t));}))(t),ut.remove(t);}(e);}function Gt(t,e,n){!0===t.transparent&&2===t.side&&!1===t.forceSinglePass?(t.side=g,t.needsUpdate=!0,Kt(t,e,n),t.side=m,t.needsUpdate=!0,Kt(t,e,n),t.side=2):Kt(t,e,n);}this.xr=Nt,this.getContext=function(){return Ot},this.getContextAttributes=function(){return Ot.getContextAttributes()},this.forceContextLoss=function(){const t=st.get("WEBGL_lose_context");t&&t.loseContext();},this.forceContextRestore=function(){const t=st.get("WEBGL_lose_context");t&&t.restoreContext();},this.getPixelRatio=function(){return U},this.setPixelRatio=function(t){void 0!==t&&(U=t,this.setSize(I,q,!1));},this.getSize=function(t){return t.set(I,q)},this.setSize=function(t,n,r=!0){Nt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(I=t,q=n,e.width=Math.floor(t*U),e.height=Math.floor(n*U),!0===r&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n));},this.getDrawingBufferSize=function(t){return t.set(I*U,q*U).floor()},this.setDrawingBufferSize=function(t,n,r){I=t,q=n,U=r,e.width=Math.floor(t*r),e.height=Math.floor(n*r),this.setViewport(0,0,t,n);},this.getCurrentViewport=function(t){return t.copy(R)},this.getViewport=function(t){return t.copy(k)},this.setViewport=function(t,e,n,r){t.isVector4?k.set(t.x,t.y,t.z,t.w):k.set(t,e,n,r),lt.viewport(R.copy(k).multiplyScalar(U).round());},this.getScissor=function(t){return t.copy(H)},this.setScissor=function(t,e,n,r){t.isVector4?H.set(t.x,t.y,t.z,t.w):H.set(t,e,n,r),lt.scissor(P.copy(H).multiplyScalar(U).round());},this.getScissorTest=function(){return Y},this.setScissorTest=function(t){lt.setScissorTest(Y=t);},this.setOpaqueSort=function(t){N=t;},this.setTransparentSort=function(t){B=t;},this.getClearColor=function(t){return t.copy(wt.getClearColor())},this.setClearColor=function(){wt.setClearColor.apply(wt,arguments);},this.getClearAlpha=function(){return wt.getClearAlpha()},this.setClearAlpha=function(){wt.setClearAlpha.apply(wt,arguments);},this.clear=function(t=!0,e=!0,n=!0){let r=0;if(t){let t=!1;if(null!==S){const e=S.texture.format;t=1033===e||1031===e||1029===e;}if(t){const t=S.texture.type,e=t===z||t===j||t===G||t===X||1017===t||1018===t,n=wt.getClearColor(),r=wt.getClearAlpha(),i=n.r,a=n.g,o=n.b;e?(f[0]=i,f[1]=a,f[2]=o,f[3]=r,Ot.clearBufferuiv(Ot.COLOR,0,f)):(d[0]=i,d[1]=a,d[2]=o,d[3]=r,Ot.clearBufferiv(Ot.COLOR,0,d));}else r|=Ot.COLOR_BUFFER_BIT;}e&&(r|=Ot.DEPTH_BUFFER_BIT),n&&(r|=Ot.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Ot.clear(r);},this.clearColor=function(){this.clear(!0,!1,!1);},this.clearDepth=function(){this.clear(!1,!0,!1);},this.clearStencil=function(){this.clear(!1,!1,!0);},this.dispose=function(){e.removeEventListener("webglcontextlost",Bt,!1),e.removeEventListener("webglcontextrestored",kt,!1),e.removeEventListener("webglcontextcreationerror",Ft,!1),yt.dispose(),xt.dispose(),ut.dispose(),ft.dispose(),dt.dispose(),gt.dispose(),Pt.dispose(),Dt.dispose(),vt.dispose(),Nt.dispose(),Nt.removeEventListener("sessionstart",jt),Nt.removeEventListener("sessionend",Vt),$&&($.dispose(),$=null),Wt.stop();},this.renderBufferDirect=function(t,e,n,r,i,a){null===e&&(e=at);const o=i.isMesh&&i.matrixWorld.determinant()<0,s=function(t,e,n,r,i){!0!==e.isScene&&(e=at);ht.resetTextureUnits();const a=e.fog,o=r.isMeshStandardMaterial?e.environment:null,s=null===S?x.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:it,A=(r.isMeshStandardMaterial?dt:ft).get(r.envMap||o),l=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,c=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),u=!!n.morphAttributes.position,h=!!n.morphAttributes.normal,f=!!n.morphAttributes.color;let d=b;r.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(d=x.toneMapping));const p=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,m=void 0!==p?p.length:0,g=ut.get(r),_=v.state.lights;if(!0===K&&(!0===J||t!==C)){const e=t===C&&r.id===T;bt.setState(r,t,e);}let y=!1;r.version===g.__version?g.needsLights&&g.lightsStateVersion!==_.state.version||g.outputColorSpace!==s||i.isBatchedMesh&&!1===g.batching?y=!0:i.isBatchedMesh||!0!==g.batching?i.isInstancedMesh&&!1===g.instancing?y=!0:i.isInstancedMesh||!0!==g.instancing?i.isSkinnedMesh&&!1===g.skinning?y=!0:i.isSkinnedMesh||!0!==g.skinning?i.isInstancedMesh&&!0===g.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===g.instancingColor&&null!==i.instanceColor||i.isInstancedMesh&&!0===g.instancingMorph&&null===i.morphTexture||i.isInstancedMesh&&!1===g.instancingMorph&&null!==i.morphTexture||g.envMap!==A||!0===r.fog&&g.fog!==a?y=!0:void 0===g.numClippingPlanes||g.numClippingPlanes===bt.numPlanes&&g.numIntersection===bt.numIntersection?(g.vertexAlphas!==l||g.vertexTangents!==c||g.morphTargets!==u||g.morphNormals!==h||g.morphColors!==f||g.toneMapping!==d||!0===At.isWebGL2&&g.morphTargetsCount!==m)&&(y=!0):y=!0:y=!0:y=!0:y=!0:(y=!0,g.__version=r.version);let M=g.currentProgram;!0===y&&(M=Kt(r,e,i));let w=!1,E=!1,R=!1;const P=M.getUniforms(),L=g.uniforms;lt.useProgram(M.program)&&(w=!0,E=!0,R=!0);r.id!==T&&(T=r.id,E=!0);if(w||C!==t){P.setValue(Ot,"projectionMatrix",t.projectionMatrix),P.setValue(Ot,"viewMatrix",t.matrixWorldInverse);const e=P.map.cameraPosition;void 0!==e&&e.setValue(Ot,nt.setFromMatrixPosition(t.matrixWorld)),At.logarithmicDepthBuffer&&P.setValue(Ot,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&P.setValue(Ot,"isOrthographic",!0===t.isOrthographicCamera),C!==t&&(C=t,E=!0,R=!0);}if(i.isSkinnedMesh){P.setOptional(Ot,i,"bindMatrix"),P.setOptional(Ot,i,"bindMatrixInverse");const t=i.skeleton;t&&(At.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),P.setValue(Ot,"boneTexture",t.boneTexture,ht)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."));}i.isBatchedMesh&&(P.setOptional(Ot,i,"batchingTexture"),P.setValue(Ot,"batchingTexture",i._matricesTexture,ht));const D=n.morphAttributes;(void 0!==D.position||void 0!==D.normal||void 0!==D.color&&!0===At.isWebGL2)&&Et.update(i,n,M);(E||g.receiveShadow!==i.receiveShadow)&&(g.receiveShadow=i.receiveShadow,P.setValue(Ot,"receiveShadow",i.receiveShadow));r.isMeshGouraudMaterial&&null!==r.envMap&&(L.envMap.value=A,L.flipEnvMap.value=A.isCubeTexture&&!1===A.isRenderTargetTexture?-1:1);E&&(P.setValue(Ot,"toneMappingExposure",x.toneMappingExposure),g.needsLights&&(I=R,(O=L).ambientLightColor.needsUpdate=I,O.lightProbe.needsUpdate=I,O.directionalLights.needsUpdate=I,O.directionalLightShadows.needsUpdate=I,O.pointLights.needsUpdate=I,O.pointLightShadows.needsUpdate=I,O.spotLights.needsUpdate=I,O.spotLightShadows.needsUpdate=I,O.rectAreaLights.needsUpdate=I,O.hemisphereLights.needsUpdate=I),a&&!0===r.fog&&_t.refreshFogUniforms(L,a),_t.refreshMaterialUniforms(L,r,U,q,$),Ma.upload(Ot,Jt(g),L,ht));var O,I;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(Ma.upload(Ot,Jt(g),L,ht),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&P.setValue(Ot,"center",i.center);if(P.setValue(Ot,"modelViewMatrix",i.modelViewMatrix),P.setValue(Ot,"normalMatrix",i.normalMatrix),P.setValue(Ot,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const t=r.uniformsGroups;for(let e=0,n=t.length;e<n;e++)if(At.isWebGL2){const n=t[e];Dt.update(n,M),Dt.bind(n,M);}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.");}return M}(t,e,n,r,i);lt.setMaterial(r,o);let A=n.index,l=1;if(!0===r.wireframe){if(A=mt.getWireframeAttribute(n),void 0===A)return;l=2;}const c=n.drawRange,u=n.attributes.position;let h=c.start*l,f=(c.start+c.count)*l;null!==a&&(h=Math.max(h,a.start*l),f=Math.min(f,(a.start+a.count)*l)),null!==A?(h=Math.max(h,0),f=Math.min(f,A.count)):null!=u&&(h=Math.max(h,0),f=Math.min(f,u.count));const d=f-h;if(d<0||d===1/0)return;let p;Pt.setup(i,r,s,n,A);let m=St;if(null!==A&&(p=pt.get(A),m=Ct,m.setIndex(p)),i.isMesh)!0===r.wireframe?(lt.setLineWidth(r.wireframeLinewidth*ot()),m.setMode(Ot.LINES)):m.setMode(Ot.TRIANGLES);else if(i.isLine){let t=r.linewidth;void 0===t&&(t=1),lt.setLineWidth(t*ot()),i.isLineSegments?m.setMode(Ot.LINES):i.isLineLoop?m.setMode(Ot.LINE_LOOP):m.setMode(Ot.LINE_STRIP);}else i.isPoints?m.setMode(Ot.POINTS):i.isSprite&&m.setMode(Ot.TRIANGLES);if(i.isBatchedMesh)m.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else if(i.isInstancedMesh)m.renderInstances(h,d,i.count);else if(n.isInstancedBufferGeometry){const t=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,e=Math.min(n.instanceCount,t);m.renderInstances(h,d,e);}else m.render(h,d);},this.compile=function(t,e,n=null){null===n&&(n=t),v=xt.get(n),v.init(),y.push(v),n.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(v.pushLight(t),t.castShadow&&v.pushShadow(t));})),t!==n&&t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(v.pushLight(t),t.castShadow&&v.pushShadow(t));})),v.setupLights(x._useLegacyLights);const r=new Set;return t.traverse((function(t){const e=t.material;if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++){const a=e[i];Gt(a,n,t),r.add(a);}else Gt(e,n,t),r.add(e);})),y.pop(),v=null,r},this.compileAsync=function(t,e,n=null){const r=this.compile(t,e,n);return new Promise((e=>{function n(){r.forEach((function(t){ut.get(t).currentProgram.isReady()&&r.delete(t);})),0!==r.size?setTimeout(n,10):e(t);}null!==st.get("KHR_parallel_shader_compile")?n():setTimeout(n,10);}))};let Ht=null;function jt(){Wt.stop();}function Vt(){Wt.start();}const Wt=new Lr;function Xt(t,e,n,r){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)v.pushLight(t),t.castShadow&&v.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Z.intersectsSprite(t)){r&&nt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(tt);const e=gt.update(t),i=t.material;i.visible&&p.push(t,e,i,n,nt.z,null);}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||Z.intersectsObject(t))){const e=gt.update(t),i=t.material;if(r&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),nt.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),nt.copy(e.boundingSphere.center)),nt.applyMatrix4(t.matrixWorld).applyMatrix4(tt)),Array.isArray(i)){const r=e.groups;for(let a=0,o=r.length;a<o;a++){const o=r[a],s=i[o.materialIndex];s&&s.visible&&p.push(t,e,s,n,nt.z,o);}}else i.visible&&p.push(t,e,i,n,nt.z,null);}const i=t.children;for(let t=0,a=i.length;t<a;t++)Xt(i[t],e,n,r);}function Qt(t,e,n,r){const i=t.opaque,a=t.transmissive,o=t.transparent;v.setupLightsView(n),!0===K&&bt.setGlobalState(x.clippingPlanes,n),a.length>0&&function(t,e,n,r){const i=!0===n.isScene?n.overrideMaterial:null;if(null!==i)return;const a=At.isWebGL2;null===$&&($=new ee(1,1,{generateMipmaps:!0,type:st.has("EXT_color_buffer_half_float")?W:z,minFilter:F,samples:a?4:0}));x.getDrawingBufferSize(et),a?$.setSize(et.x,et.y):$.setSize(Tt(et.x),Tt(et.y));const o=x.getRenderTarget();x.setRenderTarget($),x.getClearColor(D),O=x.getClearAlpha(),O<1&&x.setClearColor(16777215,.5);x.clear();const s=x.toneMapping;x.toneMapping=b,Yt(t,n,r),ht.updateMultisampleRenderTarget($),ht.updateRenderTargetMipmap($);let A=!1;for(let t=0,i=e.length;t<i;t++){const i=e[t],a=i.object,o=i.geometry,s=i.material,l=i.group;if(2===s.side&&a.layers.test(r.layers)){const t=s.side;s.side=g,s.needsUpdate=!0,Zt(a,n,r,o,s,l),s.side=t,s.needsUpdate=!0,A=!0;}}!0===A&&(ht.updateMultisampleRenderTarget($),ht.updateRenderTargetMipmap($));x.setRenderTarget(o),x.setClearColor(D,O),x.toneMapping=s;}(i,a,e,n),r&&lt.viewport(R.copy(r)),i.length>0&&Yt(i,e,n),a.length>0&&Yt(a,e,n),o.length>0&&Yt(o,e,n),lt.buffers.depth.setTest(!0),lt.buffers.depth.setMask(!0),lt.buffers.color.setMask(!0),lt.setPolygonOffset(!1);}function Yt(t,e,n){const r=!0===e.isScene?e.overrideMaterial:null;for(let i=0,a=t.length;i<a;i++){const a=t[i],o=a.object,s=a.geometry,A=null===r?a.material:r,l=a.group;o.layers.test(n.layers)&&Zt(o,e,n,s,A,l);}}function Zt(t,e,n,r,i,a){t.onBeforeRender(x,e,n,r,i,a),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),i.onBeforeRender(x,e,n,r,t,a),!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=g,i.needsUpdate=!0,x.renderBufferDirect(n,e,r,i,t,a),i.side=m,i.needsUpdate=!0,x.renderBufferDirect(n,e,r,i,t,a),i.side=2):x.renderBufferDirect(n,e,r,i,t,a),t.onAfterRender(x,e,n,r,i,a);}function Kt(t,e,n){!0!==e.isScene&&(e=at);const r=ut.get(t),i=v.state.lights,a=v.state.shadowsArray,o=i.state.version,s=vt.getParameters(t,i.state,a,e,n),A=vt.getProgramCacheKey(s);let l=r.programs;r.environment=t.isMeshStandardMaterial?e.environment:null,r.fog=e.fog,r.envMap=(t.isMeshStandardMaterial?dt:ft).get(t.envMap||r.environment),r.envMapRotation=null!==r.environment&&null===t.envMap?e.environmentRotation:t.envMapRotation,void 0===l&&(t.addEventListener("dispose",zt),l=new Map,r.programs=l);let c=l.get(A);if(void 0!==c){if(r.currentProgram===c&&r.lightsStateVersion===o)return te(t,s),c}else s.uniforms=vt.getUniforms(t),t.onBuild(n,s,x),t.onBeforeCompile(s,x),c=vt.acquireProgram(s,A),l.set(A,c),r.uniforms=s.uniforms;const u=r.uniforms;return (t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(u.clippingPlanes=bt.uniform),te(t,s),r.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),r.lightsStateVersion=o,r.needsLights&&(u.ambientLightColor.value=i.state.ambient,u.lightProbe.value=i.state.probe,u.directionalLights.value=i.state.directional,u.directionalLightShadows.value=i.state.directionalShadow,u.spotLights.value=i.state.spot,u.spotLightShadows.value=i.state.spotShadow,u.rectAreaLights.value=i.state.rectArea,u.ltc_1.value=i.state.rectAreaLTC1,u.ltc_2.value=i.state.rectAreaLTC2,u.pointLights.value=i.state.point,u.pointLightShadows.value=i.state.pointShadow,u.hemisphereLights.value=i.state.hemi,u.directionalShadowMap.value=i.state.directionalShadowMap,u.directionalShadowMatrix.value=i.state.directionalShadowMatrix,u.spotShadowMap.value=i.state.spotShadowMap,u.spotLightMatrix.value=i.state.spotLightMatrix,u.spotLightMap.value=i.state.spotLightMap,u.pointShadowMap.value=i.state.pointShadowMap,u.pointShadowMatrix.value=i.state.pointShadowMatrix),r.currentProgram=c,r.uniformsList=null,c}function Jt(t){if(null===t.uniformsList){const e=t.currentProgram.getUniforms();t.uniformsList=Ma.seqWithValue(e.seq,t.uniforms);}return t.uniformsList}function te(t,e){const n=ut.get(t);n.outputColorSpace=e.outputColorSpace,n.batching=e.batching,n.instancing=e.instancing,n.instancingColor=e.instancingColor,n.instancingMorph=e.instancingMorph,n.skinning=e.skinning,n.morphTargets=e.morphTargets,n.morphNormals=e.morphNormals,n.morphColors=e.morphColors,n.morphTargetsCount=e.morphTargetsCount,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas,n.vertexTangents=e.vertexTangents,n.toneMapping=e.toneMapping;}Wt.setAnimationLoop((function(t){Ht&&Ht(t);})),"undefined"!=typeof self&&Wt.setContext(self),this.setAnimationLoop=function(t){Ht=t,Nt.setAnimationLoop(t),null===t?Wt.stop():Wt.start();},Nt.addEventListener("sessionstart",jt),Nt.addEventListener("sessionend",Vt),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===M)return;!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===Nt.enabled&&!0===Nt.isPresenting&&(!0===Nt.cameraAutoUpdate&&Nt.updateCamera(e),e=Nt.getCamera()),!0===t.isScene&&t.onBeforeRender(x,t,e,S),v=xt.get(t,y.length),v.init(),y.push(v),tt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Z.setFromProjectionMatrix(tt),J=this.localClippingEnabled,K=bt.init(this.clippingPlanes,J),p=yt.get(t,_.length),p.init(),_.push(p),Xt(t,e,0,x.sortObjects),p.finish(),!0===x.sortObjects&&p.sort(N,B),this.info.render.frame++,!0===K&&bt.beginShadows();const n=v.state.shadowsArray;if(Mt.render(n,t,e),!0===K&&bt.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1!==Nt.enabled&&!1!==Nt.isPresenting&&!1!==Nt.hasDepthSensing()||wt.render(p,t),v.setupLights(x._useLegacyLights),e.isArrayCamera){const n=e.cameras;for(let e=0,r=n.length;e<r;e++){const r=n[e];Qt(p,t,r,r.viewport);}}else Qt(p,t,e);null!==S&&(ht.updateMultisampleRenderTarget(S),ht.updateRenderTargetMipmap(S)),!0===t.isScene&&t.onAfterRender(x,t,e),Pt.resetDefaultState(),T=-1,C=null,y.pop(),v=y.length>0?y[y.length-1]:null,_.pop(),p=_.length>0?_[_.length-1]:null;},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return E},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,n){ut.get(t.texture).__webglTexture=e,ut.get(t.depthTexture).__webglTexture=n;const r=ut.get(t);r.__hasExternalTextures=!0,r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===st.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1);},this.setRenderTargetFramebuffer=function(t,e){const n=ut.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e;},this.setRenderTarget=function(t,e=0,n=0){S=t,w=e,E=n;let r=!0,i=null,a=!1,o=!1;if(t){const s=ut.get(t);void 0!==s.__useDefaultFramebuffer?(lt.bindFramebuffer(Ot.FRAMEBUFFER,null),r=!1):void 0===s.__webglFramebuffer?ht.setupRenderTarget(t):s.__hasExternalTextures&&ht.rebindTextures(t,ut.get(t.texture).__webglTexture,ut.get(t.depthTexture).__webglTexture);const A=t.texture;(A.isData3DTexture||A.isDataArrayTexture||A.isCompressedArrayTexture)&&(o=!0);const l=ut.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=Array.isArray(l[e])?l[e][n]:l[e],a=!0):i=At.isWebGL2&&t.samples>0&&!1===ht.useMultisampledRTT(t)?ut.get(t).__webglMultisampledFramebuffer:Array.isArray(l)?l[n]:l,R.copy(t.viewport),P.copy(t.scissor),L=t.scissorTest;}else R.copy(k).multiplyScalar(U).floor(),P.copy(H).multiplyScalar(U).floor(),L=Y;if(lt.bindFramebuffer(Ot.FRAMEBUFFER,i)&&At.drawBuffers&&r&&lt.drawBuffers(t,i),lt.viewport(R),lt.scissor(P),lt.setScissorTest(L),a){const r=ut.get(t.texture);Ot.framebufferTexture2D(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,Ot.TEXTURE_CUBE_MAP_POSITIVE_X+e,r.__webglTexture,n);}else if(o){const r=ut.get(t.texture),i=e||0;Ot.framebufferTextureLayer(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,r.__webglTexture,n||0,i);}T=-1;},this.readRenderTargetPixels=function(t,e,n,r,i,a,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=ut.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){lt.bindFramebuffer(Ot.FRAMEBUFFER,s);try{const o=t.texture,s=o.format,A=o.type;if(s!==Q&&Rt.convert(s)!==Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const l=A===W&&(st.has("EXT_color_buffer_half_float")||At.isWebGL2&&st.has("EXT_color_buffer_float"));if(!(A===z||Rt.convert(A)===Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_TYPE)||A===V&&(At.isWebGL2||st.has("OES_texture_float")||st.has("WEBGL_color_buffer_float"))||l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&Ot.readPixels(e,n,r,i,Rt.convert(s),Rt.convert(A),a);}finally{const t=null!==S?ut.get(S).__webglFramebuffer:null;lt.bindFramebuffer(Ot.FRAMEBUFFER,t);}}},this.copyFramebufferToTexture=function(t,e,n=0){const r=Math.pow(2,-n),i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r);ht.setTexture2D(e,0),Ot.copyTexSubImage2D(Ot.TEXTURE_2D,n,0,0,t.x,t.y,i,a),lt.unbindTexture();},this.copyTextureToTexture=function(t,e,n,r=0){const i=e.image.width,a=e.image.height,o=Rt.convert(n.format),s=Rt.convert(n.type);ht.setTexture2D(n,0),Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,n.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,n.unpackAlignment),e.isDataTexture?Ot.texSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,i,a,o,s,e.image.data):e.isCompressedTexture?Ot.compressedTexSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):Ot.texSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,o,s,e.image),0===r&&n.generateMipmaps&&Ot.generateMipmap(Ot.TEXTURE_2D),lt.unbindTexture();},this.copyTextureToTexture3D=function(t,e,n,r,i=0){if(x.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const a=Math.round(t.max.x-t.min.x),o=Math.round(t.max.y-t.min.y),s=t.max.z-t.min.z+1,A=Rt.convert(r.format),l=Rt.convert(r.type);let c;if(r.isData3DTexture)ht.setTexture3D(r,0),c=Ot.TEXTURE_3D;else {if(!r.isDataArrayTexture&&!r.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");ht.setTexture2DArray(r,0),c=Ot.TEXTURE_2D_ARRAY;}Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,r.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,r.unpackAlignment);const u=Ot.getParameter(Ot.UNPACK_ROW_LENGTH),h=Ot.getParameter(Ot.UNPACK_IMAGE_HEIGHT),f=Ot.getParameter(Ot.UNPACK_SKIP_PIXELS),d=Ot.getParameter(Ot.UNPACK_SKIP_ROWS),p=Ot.getParameter(Ot.UNPACK_SKIP_IMAGES),m=n.isCompressedTexture?n.mipmaps[i]:n.image;Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,m.width),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,m.height),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,t.min.x),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,t.min.y),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,t.min.z),n.isDataTexture||n.isData3DTexture?Ot.texSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,l,m.data):r.isCompressedArrayTexture?Ot.compressedTexSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,m.data):Ot.texSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,l,m),Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,u),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,h),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,f),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,d),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,p),0===i&&r.generateMipmaps&&Ot.generateMipmap(c),lt.unbindTexture();},this.initTexture=function(t){t.isCubeTexture?ht.setTextureCube(t,0):t.isData3DTexture?ht.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?ht.setTexture2DArray(t,0):ht.setTexture2D(t,0),lt.unbindTexture();},this.resetState=function(){w=0,E=0,S=null,lt.reset(),Pt.reset();},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}));}get coordinateSystem(){return pt}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===at?"display-p3":"srgb",e.unpackColorSpace=Ht.workingColorSpace===ot?"display-p3":"srgb";}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t;}}(class extends yo{}).prototype.isWebGL1Renderer=!0;class xo{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=ht,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=bt();}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++;}get updateRange(){return Bt("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e});}clearUpdateRanges(){this.updateRanges.length=0;}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=bt()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=bt()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const bo=new ae;class Mo{constructor(t,e,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=r;}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t;}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)bo.fromBufferAttribute(this,e),bo.applyMatrix4(t),this.setXYZ(e,bo.x,bo.y,bo.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)bo.fromBufferAttribute(this,e),bo.applyNormalMatrix(t),this.setXYZ(e,bo.x,bo.y,bo.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)bo.fromBufferAttribute(this,e),bo.transformDirection(t),this.setXYZ(e,bo.x,bo.y,bo.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Ct(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Rt(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Ct(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Ct(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Ct(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Ct(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this}setXYZW(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array),i=Rt(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e]);}return new Dn(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new Mo(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e]);}return {itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class wo extends Dn{constructor(t,e,n,r=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r;}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}class Eo extends Cn{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new En(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t);}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const So=new ae,To=new ae,Co=new qe,Ro=new Ie,Po=new Se;class Lo extends ln{constructor(t=new Hn,e=new Eo){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets();}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,r=e.count;t<r;t++)So.fromBufferAttribute(e,t-1),To.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=So.distanceTo(To);t.setAttribute("lineDistance",new qn(n,1));}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,i=t.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Po.copy(n.boundingSphere),Po.applyMatrix4(r),Po.radius+=i,!1===t.ray.intersectsSphere(Po))return;Co.copy(r).invert(),Ro.copy(t.ray).applyMatrix4(Co);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,A=new ae,l=new ae,c=new ae,u=new ae,h=this.isLineSegments?2:1,f=n.index,d=n.attributes.position;if(null!==f){for(let n=Math.max(0,a.start),r=Math.min(f.count,a.start+a.count)-1;n<r;n+=h){const r=f.getX(n),i=f.getX(n+1);A.fromBufferAttribute(d,r),l.fromBufferAttribute(d,i);if(Ro.distanceSqToSegment(A,l,u,c)>s)continue;u.applyMatrix4(this.matrixWorld);const a=t.ray.origin.distanceTo(u);a<t.near||a>t.far||e.push({distance:a,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this});}}else {for(let n=Math.max(0,a.start),r=Math.min(d.count,a.start+a.count)-1;n<r;n+=h){A.fromBufferAttribute(d,n),l.fromBufferAttribute(d,n+1);if(Ro.distanceSqToSegment(A,l,u,c)>s)continue;u.applyMatrix4(this.matrixWorld);const r=t.ray.origin.distanceTo(u);r<t.near||r>t.far||e.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this});}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t;}}}}}const Do=new ae,Oo=new ae;class Io extends Lo{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments";}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,r=e.count;t<r;t+=2)Do.fromBufferAttribute(e,t),Oo.fromBufferAttribute(e,t+1),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+Do.distanceTo(Oo);t.setAttribute("lineDistance",new qn(n,1));}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class qo{constructor(){this.type="Curve",this.arcLengthDivisions=200;}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),i=0;e.push(0);for(let a=1;a<=t;a++)n=this.getPoint(a/t),i+=n.distanceTo(r),e.push(i),r=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths();}getUtoTmapping(t,e){const n=this.getLengths();let r=0;const i=n.length;let a;a=e||t*n[i-1];let o,s=0,A=i-1;for(;s<=A;)if(r=Math.floor(s+(A-s)/2),o=n[r]-a,o<0)s=r+1;else {if(!(o>0)){A=r;break}A=r-1;}if(r=A,n[r]===a)return r/(i-1);const l=n[r];return (r+(a-l)/(n[r+1]-l))/(i-1)}getTangent(t,e){const n=1e-4;let r=t-n,i=t+n;r<0&&(r=0),i>1&&(i=1);const a=this.getPoint(r),o=this.getPoint(i),s=e||(a.isVector2?new Lt:new ae);return s.copy(o).sub(a).normalize(),s}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new ae,r=[],i=[],a=[],o=new ae,s=new qe;for(let e=0;e<=t;e++){const n=e/t;r[e]=this.getTangentAt(n,new ae);}i[0]=new ae,a[0]=new ae;let A=Number.MAX_VALUE;const l=Math.abs(r[0].x),c=Math.abs(r[0].y),u=Math.abs(r[0].z);l<=A&&(A=l,n.set(1,0,0)),c<=A&&(A=c,n.set(0,1,0)),u<=A&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let e=1;e<=t;e++){if(i[e]=i[e-1].clone(),a[e]=a[e-1].clone(),o.crossVectors(r[e-1],r[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(Mt(r[e-1].dot(r[e]),-1,1));i[e].applyMatrix4(s.makeRotationAxis(o,t));}a[e].crossVectors(r[e],i[e]);}if(!0===e){let e=Math.acos(Mt(i[0].dot(i[t]),-1,1));e/=t,r[0].dot(o.crossVectors(i[0],i[t]))>0&&(e=-e);for(let n=1;n<=t;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],e*n)),a[n].crossVectors(r[n],i[n]);}return {tangents:r,normals:i,binormals:a}}clone(){return (new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Uo extends qo{constructor(t=0,e=0,n=1,r=1,i=0,a=2*Math.PI,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s;}getPoint(t,e=new Lt){const n=e,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const a=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);const o=this.aStartAngle+t*i;let s=this.aX+this.xRadius*Math.cos(o),A=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),n=s-this.aX,r=A-this.aY;s=n*t-r*e+this.aX,A=n*e+r*t+this.aY;}return n.set(s,A)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}function No(){let t=0,e=0,n=0,r=0;function i(i,a,o,s){t=i,e=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s;}return {initCatmullRom:function(t,e,n,r,a){i(e,n,a*(n-t),a*(r-e));},initNonuniformCatmullRom:function(t,e,n,r,a,o,s){let A=(e-t)/a-(n-t)/(a+o)+(n-e)/o,l=(n-e)/o-(r-e)/(o+s)+(r-n)/s;A*=o,l*=o,i(e,n,A,l);},calc:function(i){const a=i*i;return t+e*i+n*a+r*(a*i)}}}const Bo=new ae,ko=new No,Fo=new No,zo=new No;function Go(t,e,n,r,i){const a=.5*(r-e),o=.5*(i-n),s=t*t;return (2*n-2*r+a+o)*(t*s)+(-3*n+3*r-2*a-o)*s+a*t+n}function Ho(t,e,n,r){return function(t,e){const n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}function jo(t,e,n,r,i){return function(t,e){const n=1-t;return n*n*n*e}(t,e)+function(t,e){const n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,i)}class Vo extends qo{constructor(t=new Lt,e=new Lt,n=new Lt,r=new Lt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=r;}getPoint(t,e=new Lt){const n=e,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(jo(t,r.x,i.x,a.x,o.x),jo(t,r.y,i.y,a.y,o.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Wo extends qo{constructor(t=new ae,e=new ae,n=new ae,r=new ae){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=r;}getPoint(t,e=new ae){const n=e,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(jo(t,r.x,i.x,a.x,o.x),jo(t,r.y,i.y,a.y,o.y),jo(t,r.z,i.z,a.z,o.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Xo extends qo{constructor(t=new Lt,e=new Lt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e;}getPoint(t,e=new Lt){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Lt){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Qo extends qo{constructor(t=new Lt,e=new Lt,n=new Lt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n;}getPoint(t,e=new Lt){const n=e,r=this.v0,i=this.v1,a=this.v2;return n.set(Ho(t,r.x,i.x,a.x),Ho(t,r.y,i.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Yo extends qo{constructor(t=new ae,e=new ae,n=new ae){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n;}getPoint(t,e=new ae){const n=e,r=this.v0,i=this.v1,a=this.v2;return n.set(Ho(t,r.x,i.x,a.x),Ho(t,r.y,i.y,a.y),Ho(t,r.z,i.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Zo extends qo{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t;}getPoint(t,e=new Lt){const n=e,r=this.points,i=(r.length-1)*t,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],A=r[a],l=r[a>r.length-2?r.length-1:a+1],c=r[a>r.length-3?r.length-1:a+2];return n.set(Go(o,s.x,A.x,l.x,c.x),Go(o,s.y,A.y,l.y,c.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone());}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray());}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Lt).fromArray(n));}return this}}var Ko=Object.freeze({__proto__:null,ArcCurve:class extends Uo{constructor(t,e,n,r,i,a){super(t,e,n,n,r,i,a),this.isArcCurve=!0,this.type="ArcCurve";}},CatmullRomCurve3:class extends qo{constructor(t=[],e=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=r;}getPoint(t,e=new ae){const n=e,r=this.points,i=r.length,a=(i-(this.closed?0:1))*t;let o,s,A=Math.floor(a),l=a-A;this.closed?A+=A>0?0:(Math.floor(Math.abs(A)/i)+1)*i:0===l&&A===i-1&&(A=i-2,l=1),this.closed||A>0?o=r[(A-1)%i]:(Bo.subVectors(r[0],r[1]).add(r[0]),o=Bo);const c=r[A%i],u=r[(A+1)%i];if(this.closed||A+2<i?s=r[(A+2)%i]:(Bo.subVectors(r[i-1],r[i-2]).add(r[i-1]),s=Bo),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(o.distanceToSquared(c),t),n=Math.pow(c.distanceToSquared(u),t),r=Math.pow(u.distanceToSquared(s),t);n<1e-4&&(n=1),e<1e-4&&(e=n),r<1e-4&&(r=n),ko.initNonuniformCatmullRom(o.x,c.x,u.x,s.x,e,n,r),Fo.initNonuniformCatmullRom(o.y,c.y,u.y,s.y,e,n,r),zo.initNonuniformCatmullRom(o.z,c.z,u.z,s.z,e,n,r);}else "catmullrom"===this.curveType&&(ko.initCatmullRom(o.x,c.x,u.x,s.x,this.tension),Fo.initCatmullRom(o.y,c.y,u.y,s.y,this.tension),zo.initCatmullRom(o.z,c.z,u.z,s.z,this.tension));return n.set(ko.calc(l),Fo.calc(l),zo.calc(l)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone());}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray());}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new ae).fromArray(n));}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}},CubicBezierCurve:Vo,CubicBezierCurve3:Wo,EllipseCurve:Uo,LineCurve:Xo,LineCurve3:class extends qo{constructor(t=new ae,e=new ae){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e;}getPoint(t,e=new ae){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new ae){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},QuadraticBezierCurve:Qo,QuadraticBezierCurve3:Yo,SplineCurve:Zo});class Jo extends qo{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1;}add(t){this.curves.push(t);}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){const n=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Ko[n](e,t));}return this}getPoint(t,e){const n=t*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const t=r[i]-n,a=this.curves[i],o=a.getLength(),s=0===o?0:1-t/o;return a.getPointAt(s,e)}i++;}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths();}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const a=i[r],o=a.isEllipseCurve?2*t:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o);for(let t=0;t<s.length;t++){const r=s[t];n&&n.equals(r)||(e.push(r),n=r);}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone());}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON());}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new Ko[n.type]).fromJSON(n));}return this}}let $o=class extends Jo{constructor(t){super(),this.type="Path",this.currentPoint=new Lt,t&&this.setFromPoints(t);}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new Xo(this.currentPoint.clone(),new Lt(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,r){const i=new Qo(this.currentPoint.clone(),new Lt(t,e),new Lt(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(t,e,n,r,i,a){const o=new Vo(this.currentPoint.clone(),new Lt(t,e),new Lt(n,r),new Lt(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new Zo(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,r,i,a){const o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+o,e+s,n,r,i,a),this}absarc(t,e,n,r,i,a){return this.absellipse(t,e,n,n,r,i,a),this}ellipse(t,e,n,r,i,a,o,s){const A=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+A,e+l,n,r,i,a,o,s),this}absellipse(t,e,n,r,i,a,o,s){const A=new Uo(t,e,n,r,i,a,o,s);if(this.curves.length>0){const t=A.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y);}this.curves.push(A);const l=A.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}};class ts extends Hn{constructor(t=1,e=32,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},e=Math.max(3,e);const i=[],a=[],o=[],s=[],A=new ae,l=new Lt;a.push(0,0,0),o.push(0,0,1),s.push(.5,.5);for(let i=0,c=3;i<=e;i++,c+=3){const u=n+i/e*r;A.x=t*Math.cos(u),A.y=t*Math.sin(u),a.push(A.x,A.y,A.z),o.push(0,0,1),l.x=(a[c]/t+1)/2,l.y=(a[c+1]/t+1)/2,s.push(l.x,l.y);}for(let t=1;t<=e;t++)i.push(t,t+1,0);this.setIndex(i),this.setAttribute("position",new qn(a,3)),this.setAttribute("normal",new qn(o,3)),this.setAttribute("uv",new qn(s,2));}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ts(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class es extends Hn{constructor(t=1,e=1,n=1,r=32,i=1,a=!1,o=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};const A=this;r=Math.floor(r),i=Math.floor(i);const l=[],c=[],u=[],h=[];let f=0;const d=[],p=n/2;let m=0;function g(n){const i=f,a=new Lt,d=new ae;let g=0;const v=!0===n?t:e,_=!0===n?1:-1;for(let t=1;t<=r;t++)c.push(0,p*_,0),u.push(0,_,0),h.push(.5,.5),f++;const y=f;for(let t=0;t<=r;t++){const e=t/r*s+o,n=Math.cos(e),i=Math.sin(e);d.x=v*i,d.y=p*_,d.z=v*n,c.push(d.x,d.y,d.z),u.push(0,_,0),a.x=.5*n+.5,a.y=.5*i*_+.5,h.push(a.x,a.y),f++;}for(let t=0;t<r;t++){const e=i+t,r=y+t;!0===n?l.push(r,r+1,e):l.push(r+1,r,e),g+=3;}A.addGroup(m,g,!0===n?1:2),m+=g;}!function(){const a=new ae,g=new ae;let v=0;const _=(e-t)/n;for(let A=0;A<=i;A++){const l=[],m=A/i,v=m*(e-t)+t;for(let t=0;t<=r;t++){const e=t/r,i=e*s+o,A=Math.sin(i),d=Math.cos(i);g.x=v*A,g.y=-m*n+p,g.z=v*d,c.push(g.x,g.y,g.z),a.set(A,_,d).normalize(),u.push(a.x,a.y,a.z),h.push(e,1-m),l.push(f++);}d.push(l);}for(let t=0;t<r;t++)for(let e=0;e<i;e++){const n=d[e][t],r=d[e+1][t],i=d[e+1][t+1],a=d[e][t+1];l.push(n,r,a),l.push(r,i,a),v+=6;}A.addGroup(m,v,0),m+=v;}(),!1===a&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new qn(c,3)),this.setAttribute("normal",new qn(u,3)),this.setAttribute("uv",new qn(h,2));}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new es(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ns extends $o{constructor(t){super(t),this.uuid=bt(),this.type="Shape",this.holes=[];}getPointsHoles(t){const e=[];for(let n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return {shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone());}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON());}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new $o).fromJSON(n));}return this}}const rs=function(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let a=is(t,0,i,n,!0);const o=[];if(!a||a.next===a.prev)return o;let s,A,l,c,u,h,f;if(r&&(a=function(t,e,n,r){const i=[];let a,o,s,A,l;for(a=0,o=e.length;a<o;a++)s=e[a]*r,A=a<o-1?e[a+1]*r:t.length,l=is(t,s,A,r,!1),l===l.next&&(l.steiner=!0),i.push(ps(l));for(i.sort(us),a=0;a<i.length;a++)n=hs(i[a],n);return n}(t,e,a,n)),t.length>80*n){s=l=t[0],A=c=t[1];for(let e=n;e<i;e+=n)u=t[e],h=t[e+1],u<s&&(s=u),h<A&&(A=h),u>l&&(l=u),h>c&&(c=h);f=Math.max(l-s,c-A),f=0!==f?32767/f:0;}return os(a,o,n,s,A,f,0),o};function is(t,e,n,r,i){let a,o;if(i===function(t,e,n,r){let i=0;for(let a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}(t,e,n,r)>0)for(a=e;a<n;a+=r)o=Es(a,t[a],t[a+1],o);else for(a=n-r;a>=e;a-=r)o=Es(a,t[a],t[a+1],o);return o&&_s(o,o.next)&&(Ss(o),o=o.next),o}function as(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!_s(r,r.next)&&0!==vs(r.prev,r,r.next))r=r.next;else {if(Ss(r),r=e=r.prev,r===r.next)break;n=!0;}}while(n||r!==e);return e}function os(t,e,n,r,i,a,o){if(!t)return;!o&&a&&function(t,e,n,r){let i=t;do{0===i.z&&(i.z=ds(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,n,r,i,a,o,s,A,l=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ,r);e++);for(A=l;s>0||A>0&&r;)0!==s&&(0===A||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,A--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r;}a.nextZ=null,l*=2;}while(o>1)}(i);}(t,r,i,a);let s,A,l=t;for(;t.prev!==t.next;)if(s=t.prev,A=t.next,a?As(t,r,i,a):ss(t))e.push(s.i/n|0),e.push(t.i/n|0),e.push(A.i/n|0),Ss(t),t=A.next,l=A.next;else if((t=A)===l){o?1===o?os(t=ls(as(t),e,n),e,n,r,i,a,2):2===o&&cs(t,e,n,r,i,a):os(as(t),e,n,r,i,a,1);break}}function ss(t){const e=t.prev,n=t,r=t.next;if(vs(e,n,r)>=0)return !1;const i=e.x,a=n.x,o=r.x,s=e.y,A=n.y,l=r.y,c=i<a?i<o?i:o:a<o?a:o,u=s<A?s<l?s:l:A<l?A:l,h=i>a?i>o?i:o:a>o?a:o,f=s>A?s>l?s:l:A>l?A:l;let d=r.next;for(;d!==e;){if(d.x>=c&&d.x<=h&&d.y>=u&&d.y<=f&&ms(i,s,a,A,o,l,d.x,d.y)&&vs(d.prev,d,d.next)>=0)return !1;d=d.next;}return !0}function As(t,e,n,r){const i=t.prev,a=t,o=t.next;if(vs(i,a,o)>=0)return !1;const s=i.x,A=a.x,l=o.x,c=i.y,u=a.y,h=o.y,f=s<A?s<l?s:l:A<l?A:l,d=c<u?c<h?c:h:u<h?u:h,p=s>A?s>l?s:l:A>l?A:l,m=c>u?c>h?c:h:u>h?u:h,g=ds(f,d,e,n,r),v=ds(p,m,e,n,r);let _=t.prevZ,y=t.nextZ;for(;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ms(s,c,A,u,l,h,_.x,_.y)&&vs(_.prev,_,_.next)>=0)return !1;if(_=_.prevZ,y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ms(s,c,A,u,l,h,y.x,y.y)&&vs(y.prev,y,y.next)>=0)return !1;y=y.nextZ;}for(;_&&_.z>=g;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ms(s,c,A,u,l,h,_.x,_.y)&&vs(_.prev,_,_.next)>=0)return !1;_=_.prevZ;}for(;y&&y.z<=v;){if(y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ms(s,c,A,u,l,h,y.x,y.y)&&vs(y.prev,y,y.next)>=0)return !1;y=y.nextZ;}return !0}function ls(t,e,n){let r=t;do{const i=r.prev,a=r.next.next;!_s(i,a)&&ys(i,r,r.next,a)&&Ms(i,a)&&Ms(a,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),Ss(r),Ss(r.next),r=t=a),r=r.next;}while(r!==t);return as(r)}function cs(t,e,n,r,i,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&gs(o,t)){let s=ws(o,t);return o=as(o,o.next),s=as(s,s.next),os(o,e,n,r,i,a,0),void os(s,e,n,r,i,a,0)}t=t.next;}o=o.next;}while(o!==t)}function us(t,e){return t.x-e.x}function hs(t,e){const n=function(t,e){let n,r=e,i=-1/0;const a=t.x,o=t.y;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){const t=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=a&&t>i&&(i=t,n=r.x<r.next.x?r:r.next,t===a))return n}r=r.next;}while(r!==e);if(!n)return null;const s=n,A=n.x,l=n.y;let c,u=1/0;r=n;do{a>=r.x&&r.x>=A&&a!==r.x&&ms(o<l?a:i,o,A,l,o<l?i:a,o,r.x,r.y)&&(c=Math.abs(o-r.y)/(a-r.x),Ms(r,t)&&(c<u||c===u&&(r.x>n.x||r.x===n.x&&fs(n,r)))&&(n=r,u=c)),r=r.next;}while(r!==s);return n}(t,e);if(!n)return e;const r=ws(n,t);return as(r,r.next),as(n,n.next)}function fs(t,e){return vs(t.prev,t,e.prev)<0&&vs(e.next,t,t.next)<0}function ds(t,e,n,r,i){return (t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ps(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;}while(e!==t);return n}function ms(t,e,n,r,i,a,o,s){return (i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(r-s)>=(n-o)*(e-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function gs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&ys(n,n.next,t,e))return !0;n=n.next;}while(n!==t);return !1}(t,e)&&(Ms(t,e)&&Ms(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;}while(n!==t);return r}(t,e)&&(vs(t.prev,t,e.prev)||vs(t,e.prev,e))||_s(t,e)&&vs(t.prev,t,t.next)>0&&vs(e.prev,e,e.next)>0)}function vs(t,e,n){return (e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _s(t,e){return t.x===e.x&&t.y===e.y}function ys(t,e,n,r){const i=bs(vs(t,e,n)),a=bs(vs(t,e,r)),o=bs(vs(n,r,t)),s=bs(vs(n,r,e));return i!==a&&o!==s||(!(0!==i||!xs(t,n,e))||(!(0!==a||!xs(t,r,e))||(!(0!==o||!xs(n,t,r))||!(0!==s||!xs(n,e,r)))))}function xs(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function bs(t){return t>0?1:t<0?-1:0}function Ms(t,e){return vs(t.prev,t,t.next)<0?vs(t,e,t.next)>=0&&vs(t,t.prev,e)>=0:vs(t,e,t.prev)<0||vs(t,t.next,e)<0}function ws(t,e){const n=new Ts(t.i,t.x,t.y),r=new Ts(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Es(t,e,n,r){const i=new Ts(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ss(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ);}function Ts(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1;}class Cs{static area(t){const e=t.length;let n=0;for(let r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return .5*n}static isClockWise(t){return Cs.area(t)<0}static triangulateShape(t,e){const n=[],r=[],i=[];Rs(t),Ps(n,t);let a=t.length;e.forEach(Rs);for(let t=0;t<e.length;t++)r.push(a),a+=e[t].length,Ps(n,e[t]);const o=rs(n,r);for(let t=0;t<o.length;t+=3)i.push(o.slice(t,t+3));return i}}function Rs(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop();}function Ps(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y);}class Ls extends Hn{constructor(t=new ns([new Lt(.5,.5),new Lt(-.5,.5),new Lt(-.5,-.5),new Lt(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,r=[],i=[];for(let e=0,n=t.length;e<n;e++){a(t[e]);}function a(t){const a=[],o=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,A=void 0!==e.depth?e.depth:1;let l=void 0===e.bevelEnabled||e.bevelEnabled,c=void 0!==e.bevelThickness?e.bevelThickness:.2,u=void 0!==e.bevelSize?e.bevelSize:c-.1,h=void 0!==e.bevelOffset?e.bevelOffset:0,f=void 0!==e.bevelSegments?e.bevelSegments:3;const d=e.extrudePath,p=void 0!==e.UVGenerator?e.UVGenerator:Ds;let m,g,v,_,y,x=!1;d&&(m=d.getSpacedPoints(s),x=!0,l=!1,g=d.computeFrenetFrames(s,!1),v=new ae,_=new ae,y=new ae),l||(f=0,c=0,u=0,h=0);const b=t.extractPoints(o);let M=b.shape;const w=b.holes;if(!Cs.isClockWise(M)){M=M.reverse();for(let t=0,e=w.length;t<e;t++){const e=w[t];Cs.isClockWise(e)&&(w[t]=e.reverse());}}const E=Cs.triangulateShape(M,w),S=M;for(let t=0,e=w.length;t<e;t++){const e=w[t];M=M.concat(e);}function T(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,n)}const C=M.length,R=E.length;function P(t,e,n){let r,i,a;const o=t.x-e.x,s=t.y-e.y,A=n.x-t.x,l=n.y-t.y,c=o*o+s*s,u=o*l-s*A;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(c),h=Math.sqrt(A*A+l*l),f=e.x-s/u,d=e.y+o/u,p=((n.x-l/h-f)*l-(n.y+A/h-d)*A)/(o*l-s*A);r=f+o*p-t.x,i=d+s*p-t.y;const m=r*r+i*i;if(m<=2)return new Lt(r,i);a=Math.sqrt(m/2);}else {let t=!1;o>Number.EPSILON?A>Number.EPSILON&&(t=!0):o<-Number.EPSILON?A<-Number.EPSILON&&(t=!0):Math.sign(s)===Math.sign(l)&&(t=!0),t?(r=-s,i=o,a=Math.sqrt(c)):(r=o,i=s,a=Math.sqrt(c/2));}return new Lt(r/a,i/a)}const L=[];for(let t=0,e=S.length,n=e-1,r=t+1;t<e;t++,n++,r++)n===e&&(n=0),r===e&&(r=0),L[t]=P(S[t],S[n],S[r]);const D=[];let O,I=L.concat();for(let t=0,e=w.length;t<e;t++){const e=w[t];O=[];for(let t=0,n=e.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),O[t]=P(e[t],e[r],e[i]);D.push(O),I=I.concat(O);}for(let t=0;t<f;t++){const e=t/f,n=c*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+h;for(let t=0,e=S.length;t<e;t++){const e=T(S[t],L[t],r);N(e.x,e.y,-n);}for(let t=0,e=w.length;t<e;t++){const e=w[t];O=D[t];for(let t=0,i=e.length;t<i;t++){const i=T(e[t],O[t],r);N(i.x,i.y,-n);}}}const q=u+h;for(let t=0;t<C;t++){const e=l?T(M[t],I[t],q):M[t];x?(_.copy(g.normals[0]).multiplyScalar(e.x),v.copy(g.binormals[0]).multiplyScalar(e.y),y.copy(m[0]).add(_).add(v),N(y.x,y.y,y.z)):N(e.x,e.y,0);}for(let t=1;t<=s;t++)for(let e=0;e<C;e++){const n=l?T(M[e],I[e],q):M[e];x?(_.copy(g.normals[t]).multiplyScalar(n.x),v.copy(g.binormals[t]).multiplyScalar(n.y),y.copy(m[t]).add(_).add(v),N(y.x,y.y,y.z)):N(n.x,n.y,A/s*t);}for(let t=f-1;t>=0;t--){const e=t/f,n=c*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+h;for(let t=0,e=S.length;t<e;t++){const e=T(S[t],L[t],r);N(e.x,e.y,A+n);}for(let t=0,e=w.length;t<e;t++){const e=w[t];O=D[t];for(let t=0,i=e.length;t<i;t++){const i=T(e[t],O[t],r);x?N(i.x,i.y+m[s-1].y,m[s-1].x+n):N(i.x,i.y,A+n);}}}function U(t,e){let n=t.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=t.length-1);for(let t=0,n=s+2*f;t<n;t++){const n=C*t,a=C*(t+1);k(e+r+n,e+i+n,e+i+a,e+r+a);}}}function N(t,e,n){a.push(t),a.push(e),a.push(n);}function B(t,e,i){F(t),F(e),F(i);const a=r.length/3,o=p.generateTopUV(n,r,a-3,a-2,a-1);z(o[0]),z(o[1]),z(o[2]);}function k(t,e,i,a){F(t),F(e),F(a),F(e),F(i),F(a);const o=r.length/3,s=p.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);z(s[0]),z(s[1]),z(s[3]),z(s[1]),z(s[2]),z(s[3]);}function F(t){r.push(a[3*t+0]),r.push(a[3*t+1]),r.push(a[3*t+2]);}function z(t){i.push(t.x),i.push(t.y);}!function(){const t=r.length/3;if(l){let t=0,e=C*t;for(let t=0;t<R;t++){const n=E[t];B(n[2]+e,n[1]+e,n[0]+e);}t=s+2*f,e=C*t;for(let t=0;t<R;t++){const n=E[t];B(n[0]+e,n[1]+e,n[2]+e);}}else {for(let t=0;t<R;t++){const e=E[t];B(e[2],e[1],e[0]);}for(let t=0;t<R;t++){const e=E[t];B(e[0]+C*s,e[1]+C*s,e[2]+C*s);}}n.addGroup(t,r.length/3-t,0);}(),function(){const t=r.length/3;let e=0;U(S,e),e+=S.length;for(let t=0,n=w.length;t<n;t++){const n=w[t];U(n,e),e+=n.length;}n.addGroup(t,r.length/3-t,1);}();}this.setAttribute("position",new qn(r,3)),this.setAttribute("uv",new qn(i,2)),this.computeVertexNormals();}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return function(t,e,n){if(n.shapes=[],Array.isArray(t))for(let e=0,r=t.length;e<r;e++){const r=t[e];n.shapes.push(r.uuid);}else n.shapes.push(t.uuid);n.options=Object.assign({},e),void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let r=0,i=t.shapes.length;r<i;r++){const i=e[t.shapes[r]];n.push(i);}const r=t.options.extrudePath;return void 0!==r&&(t.options.extrudePath=(new Ko[r.type]).fromJSON(r)),new Ls(n,t.options)}}const Ds={generateTopUV:function(t,e,n,r,i){const a=e[3*n],o=e[3*n+1],s=e[3*r],A=e[3*r+1],l=e[3*i],c=e[3*i+1];return [new Lt(a,o),new Lt(s,A),new Lt(l,c)]},generateSideWallUV:function(t,e,n,r,i,a){const o=e[3*n],s=e[3*n+1],A=e[3*n+2],l=e[3*r],c=e[3*r+1],u=e[3*r+2],h=e[3*i],f=e[3*i+1],d=e[3*i+2],p=e[3*a],m=e[3*a+1],g=e[3*a+2];return Math.abs(s-c)<Math.abs(o-l)?[new Lt(o,1-A),new Lt(l,1-u),new Lt(h,1-d),new Lt(p,1-g)]:[new Lt(s,1-A),new Lt(c,1-u),new Lt(f,1-d),new Lt(m,1-g)]}};class Os extends Hn{constructor(t=1,e=32,n=16,r=0,i=2*Math.PI,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const s=Math.min(a+o,Math.PI);let A=0;const l=[],c=new ae,u=new ae,h=[],f=[],d=[],p=[];for(let h=0;h<=n;h++){const m=[],g=h/n;let v=0;0===h&&0===a?v=.5/e:h===n&&s===Math.PI&&(v=-.5/e);for(let n=0;n<=e;n++){const s=n/e;c.x=-t*Math.cos(r+s*i)*Math.sin(a+g*o),c.y=t*Math.cos(a+g*o),c.z=t*Math.sin(r+s*i)*Math.sin(a+g*o),f.push(c.x,c.y,c.z),u.copy(c).normalize(),d.push(u.x,u.y,u.z),p.push(s+v,1-g),m.push(A++);}l.push(m);}for(let t=0;t<n;t++)for(let r=0;r<e;r++){const e=l[t][r+1],i=l[t][r],o=l[t+1][r],A=l[t+1][r+1];(0!==t||a>0)&&h.push(e,i,A),(t!==n-1||s<Math.PI)&&h.push(i,o,A);}this.setIndex(h),this.setAttribute("position",new qn(f,3)),this.setAttribute("normal",new qn(d,3)),this.setAttribute("uv",new qn(p,2));}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Os(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class Is extends Hn{constructor(t=new Yo(new ae(-1,-1,0),new ae(-1,1,0),new ae(1,1,0)),e=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i};const a=t.computeFrenetFrames(e,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new ae,s=new ae,A=new Lt;let l=new ae;const c=[],u=[],h=[],f=[];function d(i){l=t.getPointAt(i/e,l);const A=a.normals[i],h=a.binormals[i];for(let t=0;t<=r;t++){const e=t/r*Math.PI*2,i=Math.sin(e),a=-Math.cos(e);s.x=a*A.x+i*h.x,s.y=a*A.y+i*h.y,s.z=a*A.z+i*h.z,s.normalize(),u.push(s.x,s.y,s.z),o.x=l.x+n*s.x,o.y=l.y+n*s.y,o.z=l.z+n*s.z,c.push(o.x,o.y,o.z);}}!function(){for(let t=0;t<e;t++)d(t);d(!1===i?e:0),function(){for(let t=0;t<=e;t++)for(let n=0;n<=r;n++)A.x=t/e,A.y=n/r,h.push(A.x,A.y);}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=r;e++){const n=(r+1)*(t-1)+(e-1),i=(r+1)*t+(e-1),a=(r+1)*t+e,o=(r+1)*(t-1)+e;f.push(n,i,o),f.push(i,a,o);}}();}(),this.setIndex(f),this.setAttribute("position",new qn(c,3)),this.setAttribute("normal",new qn(u,3)),this.setAttribute("uv",new qn(h,2));}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Is((new Ko[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}function qs(t,e,n){const r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return !0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}class Us extends Cn{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new En(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new En(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ve,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t);}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}const Ns={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e);},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t];},clear:function(){this.files={};}};class Bs{constructor(t,e,n){const r=this;let i,a=!1,o=0,s=0;const A=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){s++,!1===a&&void 0!==r.onStart&&r.onStart(t,o,s),a=!0;},this.itemEnd=function(t){o++,void 0!==r.onProgress&&r.onProgress(t,o,s),o===s&&(a=!1,void 0!==r.onLoad&&r.onLoad());},this.itemError=function(t){void 0!==r.onError&&r.onError(t);},this.resolveURL=function(t){return i?i(t):t},this.setURLModifier=function(t){return i=t,this},this.addHandler=function(t,e){return A.push(t,e),this},this.removeHandler=function(t){const e=A.indexOf(t);return -1!==e&&A.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=A.length;e<n;e+=2){const n=A[e],r=A[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null};}}const ks=new Bs;class Fs{constructor(t){this.manager=void 0!==t?t:ks,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={};}load(){}loadAsync(t,e){const n=this;return new Promise((function(r,i){n.load(t,r,e,i);}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}Fs.DEFAULT_MATERIAL_NAME="__DEFAULT";class zs extends Fs{constructor(t){super(t);}load(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const i=this,a=Ns.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout((function(){e&&e(a),i.manager.itemEnd(t);}),0),a;const o=qt("img");function s(){l(),Ns.add(t,this),e&&e(this),i.manager.itemEnd(t);}function A(e){l(),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t);}function l(){o.removeEventListener("load",s,!1),o.removeEventListener("error",A,!1);}return o.addEventListener("load",s,!1),o.addEventListener("error",A,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o}}class Gs extends Fs{constructor(t){super(t);}load(t,e,n,r){const i=new Jt,a=new zs(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,(function(t){i.image=t,i.needsUpdate=!0,void 0!==e&&e(i);}),n,r),i}}class Hs extends ln{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new En(t),this.intensity=e;}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}const js=new qe,Vs=new ae,Ws=new ae;class Xs{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Lt(512,512),this.map=null,this.mapPass=null,this.matrix=new qe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Pr,this._frameExtents=new Lt(1,1),this._viewportCount=1,this._viewports=[new $t(0,0,1,1)];}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Vs.setFromMatrixPosition(t.matrixWorld),e.position.copy(Vs),Ws.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Ws),e.updateMatrixWorld(),js.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(js),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(js);}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose();}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return (new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Qs extends Xs{constructor(){super(new Wr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0;}}class Ys{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1;}start(){this.startTime=Zs(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0;}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1;}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Zs();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t;}return t}}function Zs(){return ("undefined"==typeof performance?Date:performance).now()}class Ks extends xo{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n;}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}const Js=new qe;function $s(t,e){return t.distance-e.distance}function tA(t,e,n,r){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===r){const r=t.children;for(let t=0,i=r.length;t<i;t++)tA(r[t],e,n,!0);}}class eA{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Mt(e/this.radius,-1,1))),this}clone(){return (new this.constructor).copy(this)}}const nA=new ae,rA=new ae;class iA{constructor(){this.type="ShapePath",this.color=new En,this.subPaths=[],this.currentPath=null;}moveTo(t,e){return this.currentPath=new $o,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,n,r){return this.currentPath.quadraticCurveTo(t,e,n,r),this}bezierCurveTo(t,e,n,r,i,a){return this.currentPath.bezierCurveTo(t,e,n,r,i,a),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const n=e.length;let r=!1;for(let i=n-1,a=0;a<n;i=a++){let n=e[i],o=e[a],s=o.x-n.x,A=o.y-n.y;if(Math.abs(A)>Number.EPSILON){if(A<0&&(n=e[a],s=-s,o=e[i],A=-A),t.y<n.y||t.y>o.y)continue;if(t.y===n.y){if(t.x===n.x)return !0}else {const e=A*(t.x-n.x)-s*(t.y-n.y);if(0===e)return !0;if(e<0)continue;r=!r;}}else {if(t.y!==n.y)continue;if(o.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=o.x)return !0}}return r}const n=Cs.isClockWise,r=this.subPaths;if(0===r.length)return [];let i,a,o;const s=[];if(1===r.length)return a=r[0],o=new ns,o.curves=a.curves,s.push(o),s;let A=!n(r[0].getPoints());A=t?!A:A;const l=[],c=[];let u,h,f=[],d=0;c[d]=void 0,f[d]=[];for(let e=0,o=r.length;e<o;e++)a=r[e],u=a.getPoints(),i=n(u),i=t?!i:i,i?(!A&&c[d]&&d++,c[d]={s:new ns,p:u},c[d].s.curves=a.curves,A&&d++,f[d]=[]):f[d].push({h:a,p:u[0]});if(!c[0])return function(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n],i=new ns;i.curves=r.curves,e.push(i);}return e}(r);if(c.length>1){let t=!1,n=0;for(let t=0,e=c.length;t<e;t++)l[t]=[];for(let r=0,i=c.length;r<i;r++){const i=f[r];for(let a=0;a<i.length;a++){const o=i[a];let s=!0;for(let i=0;i<c.length;i++)e(o.p,c[i].p)&&(r!==i&&n++,s?(s=!1,l[i].push(o)):t=!0);s&&l[r].push(o);}}n>0&&!1===t&&(f=l);}for(let t=0,e=c.length;t<e;t++){o=c[t].s,s.push(o),h=f[t];for(let t=0,e=h.length;t<e;t++)o.holes.push(h[t].h);}return s}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:s}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=s);const aA=new ae,oA=new qe,sA=new qe,AA=new ae,lA=new ae;function cA(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var uA="object"==typeof global&&global&&global.Object===Object&&global,hA="object"==typeof self&&self&&self.Object===Object&&self,fA=uA||hA||Function("return this")(),dA=function(){return fA.Date.now()},pA=/\s/;var mA=/^\s+/;function gA(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&pA.test(t.charAt(e)););return e}(t)+1).replace(mA,""):t}var vA=fA.Symbol,_A=Object.prototype,yA=_A.hasOwnProperty,xA=_A.toString,bA=vA?vA.toStringTag:void 0;var MA=Object.prototype.toString;var wA="[object Null]",EA="[object Undefined]",SA=vA?vA.toStringTag:void 0;function TA(t){return null==t?void 0===t?EA:wA:SA&&SA in Object(t)?function(t){var e=yA.call(t,bA),n=t[bA];try{t[bA]=void 0;var r=!0;}catch(t){}var i=xA.call(t);return r&&(e?t[bA]=n:delete t[bA]),i}(t):function(t){return MA.call(t)}(t)}var CA="[object Symbol]";var RA=NaN,PA=/^[-+]0x[0-9a-f]+$/i,LA=/^0b[01]+$/i,DA=/^0o[0-7]+$/i,OA=parseInt;function IA(t){if("number"==typeof t)return t;if(function(t){return "symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&TA(t)==CA}(t))return RA;if(cA(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=cA(e)?e+"":e;}if("string"!=typeof t)return 0===t?t:+t;t=gA(t);var n=LA.test(t);return n||DA.test(t)?OA(t.slice(2),n?2:8):PA.test(t)?RA:+t}var qA="Expected a function",UA=Math.max,NA=Math.min;function BA(t,e,n){var r,i,a,o,s,A,l=0,c=!1,u=!1,h=!0;if("function"!=typeof t)throw new TypeError(qA);function f(e){var n=r,a=i;return r=i=void 0,l=e,o=t.apply(a,n)}function d(t){var n=t-A;return void 0===A||n>=e||n<0||u&&t-l>=a}function p(){var t=dA();if(d(t))return m(t);s=setTimeout(p,function(t){var n=e-(t-A);return u?NA(n,a-(t-l)):n}(t));}function m(t){return s=void 0,h&&r?f(t):(r=i=void 0,o)}function g(){var t=dA(),n=d(t);if(r=arguments,i=this,A=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(p,e),c?f(t):o}(A);if(u)return clearTimeout(s),s=setTimeout(p,e),f(A)}return void 0===s&&(s=setTimeout(p,e)),o}return e=IA(e)||0,cA(n)&&(c=!!n.leading,a=(u="maxWait"in n)?UA(IA(n.maxWait)||0,e):a,h="trailing"in n?!!n.trailing:h),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=A=i=s=void 0;},g.flush=function(){return void 0===s?o:m(dA())},g}function kA(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=r.key,a=void 0,"symbol"==typeof(a=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(i,"string"))?a:String(a)),r);}var i,a;}function FA(t,e,n){return e&&kA(t.prototype,e),n&&kA(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function zA(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1;}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t;}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return GA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GA(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function GA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var HA=FA((function t(e,n){var r=n.default,i=void 0===r?null:r,a=n.triggerUpdate,o=void 0===a||a,s=n.onChange,A=void 0===s?function(t,e){}:s;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e,this.defaultVal=i,this.triggerUpdate=o,this.onChange=A;}));function jA(t){var e=t.stateInit,n=void 0===e?function(){return {}}:e,r=t.props,i=void 0===r?{}:r,a=t.methods,o=void 0===a?{}:a,s=t.aliases,A=void 0===s?{}:s,l=t.init,c=void 0===l?function(){}:l,u=t.update,h=void 0===u?function(){}:u,f=Object.keys(i).map((function(t){return new HA(t,i[t])}));return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},n instanceof Function?n(t):n,{initialised:!1}),r={};function i(e){return a(e,t),s(),i}var a=function(t,n){c.call(i,t,e,n),e.initialised=!0;},s=BA((function(){e.initialised&&(h.call(i,e,r),r={});}),1);return f.forEach((function(t){i[t.name]=function(t){var n=t.name,a=t.triggerUpdate,o=void 0!==a&&a,A=t.onChange,l=void 0===A?function(t,e){}:A,c=t.defaultVal,u=void 0===c?null:c;return function(t){var a=e[n];if(!arguments.length)return a;var A=void 0===t?u:t;return e[n]=A,l.call(i,A,e,a),!r.hasOwnProperty(n)&&(r[n]=a),o&&s(),i}}(t);})),Object.keys(o).forEach((function(t){i[t]=function(){for(var n,r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return (n=o[t]).call.apply(n,[i,e].concat(a))};})),Object.entries(A).forEach((function(t){var e=zA(t,2),n=e[0],r=e[1];return i[n]=i[r]})),i.resetProps=function(){return f.forEach((function(t){i[t.name](t.defaultVal);})),i},i.resetProps(),e._rerender=s,i}}var VA,WA=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return this.None(t)},Out:function(t){return this.None(t)},InOut:function(t){return this.None(t)}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return (t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return --t*t*t+1},InOut:function(t){return (t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return (t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return --t*t*t*t*t+1},InOut:function(t){return (t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return .5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return (t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return (t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-WA.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*WA.Bounce.In(2*t):.5*WA.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),XA=function(){return performance.now()},QA=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={};}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={};},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t;},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()];},t.prototype.update=function(t,e){void 0===t&&(t=XA()),void 0===e&&(e=!1);var n=Object.keys(this._tweens);if(0===n.length)return !1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var i=this._tweens[n[r]],a=!e;i&&!1===i.update(t,a)&&!e&&delete this._tweens[n[r]];}n=Object.keys(this._tweensAddedDuringUpdate);}return !0},t}(),YA={Linear:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=YA.Utils.Linear;return e<0?a(t[0],t[1],r):e>1?a(t[n],t[n-1],n-r):a(t[i],t[i+1>n?n:i+1],r-i)},Bezier:function(t,e){for(var n=0,r=t.length-1,i=Math.pow,a=YA.Utils.Bernstein,o=0;o<=r;o++)n+=i(1-e,r-o)*i(e,o)*t[o]*a(r,o);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=YA.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(i=Math.floor(r=n*(1+e))),a(t[(i-1+n)%n],t[i],t[(i+1)%n],t[(i+2)%n],r-i)):e<0?t[0]-(a(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(a(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):a(t[i?i-1:0],t[i],t[n<i+1?n:i+1],t[n<i+2?n:i+2],r-i)},Utils:{Linear:function(t,e,n){return (e-t)*n+t},Bernstein:function(t,e){var n=YA.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(VA=[1],function(t){var e=1;if(VA[t])return VA[t];for(var n=t;n>1;n--)e*=n;return VA[t]=e,e}),CatmullRom:function(t,e,n,r,i){var a=.5*(n-t),o=.5*(r-e),s=i*i;return (2*e-2*n+a+o)*(i*s)+(-3*e+3*n-2*a-o)*s+a*i+e}}},ZA=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),KA=new QA,JA=function(){function t(t,e){void 0===e&&(e=KA),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=WA.Linear.None,this._interpolationFunction=YA.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ZA.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1;}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=XA()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var i in this._valuesEnd)r[i]=this._valuesEnd[i];this._valuesEnd=r;}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e);}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,n,r,i){for(var a in n){var o=t[a],s=Array.isArray(o),A=s?"array":typeof o,l=!s&&Array.isArray(n[a]);if("undefined"!==A&&"function"!==A){if(l){if(0===(m=n[a]).length)continue;for(var c=[o],u=0,h=m.length;u<h;u+=1){var f=this._handleRelativeValue(o,m[u]);if(isNaN(f)){l=!1,console.warn("Found invalid interpolation list. Skipping.");break}c.push(f);}l&&(n[a]=c);}if("object"!==A&&!s||!o||l)(void 0===e[a]||i)&&(e[a]=o),s||(e[a]*=1),r[a]=l?n[a].slice().reverse():e[a]||0;else {e[a]=s?[]:{};var d=o;for(var p in d)e[a][p]=d[p];r[a]=s?[]:{};var m=n[a];if(!this._isDynamic){var g={};for(var p in m)g[p]=m[p];n[a]=m=g;}this._setupProperties(d,e[a],m,r[a],i);}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=XA()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=XA()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return void 0===t&&(t=KA),this._group=t,this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=WA.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=YA.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){var n,r,i=this;if(void 0===t&&(t=XA()),void 0===e&&(e=!0),this._isPaused)return !0;var a=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>a)return !1;e&&this.start(t,!0);}if(this._goToEnd=!1,t<this._startTime)return !0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=t-this._startTime,s=this._duration+(null!==(n=this._repeatDelayTime)&&void 0!==n?n:this._delayTime),A=this._duration+this._repeat*s,l=function(){if(0===i._duration)return 1;if(o>A)return 1;var t=Math.trunc(o/s),e=o-t*s,n=Math.min(e/i._duration,1);return 0===n&&o===i._duration?1:n}(),c=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,c),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),0===this._duration||o>=this._duration){if(this._repeat>0){var u=Math.min(Math.trunc((o-this._duration)/s)+1,this._repeat);for(r in isFinite(this._repeat)&&(this._repeat-=u),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*u,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var h=0,f=this._chainedTweens.length;h<f;h++)this._chainedTweens[h].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return !0},t.prototype._updateProperties=function(t,e,n,r){for(var i in n)if(void 0!==e[i]){var a=e[i]||0,o=n[i],s=Array.isArray(t[i]),A=Array.isArray(o);!s&&A?t[i]=this._interpolationFunction(o,r):"object"==typeof o&&o?this._updateProperties(t[i],a,o,r):"number"==typeof(o=this._handleRelativeValue(a,o))&&(t[i]=a+(o-a)*r);}},t.prototype._handleRelativeValue=function(t,e){return "string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof n?this._valuesStartRepeat[t]+parseFloat(n):this._valuesEnd[t],this._valuesEnd[t]=e;},t}(),$A=KA;$A.getAll.bind($A),$A.removeAll.bind($A),$A.add.bind($A),$A.remove.bind($A);var tl=$A.update.bind($A);function el(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var nl={exports:{}};function rl(t,e,n){n=n||2;var r,i,a,o,s,A,l,c=e&&e.length,u=c?e[0]*n:t.length,h=il(t,0,u,n,!0),f=[];if(!h||h.next===h.prev)return f;if(c&&(h=function(t,e,n,r){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=il(t,e[i]*r,i<a-1?e[i+1]*r:t.length,r,!1))===o.next&&(o.steiner=!0),s.push(pl(o));for(s.sort(ul),i=0;i<s.length;i++)n=hl(s[i],n);return n}(t,e,h,n)),t.length>80*n){r=a=t[0],i=o=t[1];for(var d=n;d<u;d+=n)(s=t[d])<r&&(r=s),(A=t[d+1])<i&&(i=A),s>a&&(a=s),A>o&&(o=A);l=0!==(l=Math.max(a-r,o-i))?32767/l:0;}return ol(h,f,n,r,i,l,0),f}function il(t,e,n,r,i){var a,o;if(i===Cl(t,e,n,r)>0)for(a=e;a<n;a+=r)o=El(a,t[a],t[a+1],o);else for(a=n-r;a>=e;a-=r)o=El(a,t[a],t[a+1],o);return o&&_l(o,o.next)&&(Sl(o),o=o.next),o}function al(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!_l(r,r.next)&&0!==vl(r.prev,r,r.next))r=r.next;else {if(Sl(r),(r=e=r.prev)===r.next)break;n=!0;}}while(n||r!==e);return e}function ol(t,e,n,r,i,a,o){if(t){!o&&a&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=dl(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,a,o,s,A,l=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(A=l;s>0||A>0&&r;)0!==s&&(0===A||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,A--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r;}a.nextZ=null,l*=2;}while(o>1)}(i);}(t,r,i,a);for(var s,A,l=t;t.prev!==t.next;)if(s=t.prev,A=t.next,a?Al(t,r,i,a):sl(t))e.push(s.i/n|0),e.push(t.i/n|0),e.push(A.i/n|0),Sl(t),t=A.next,l=A.next;else if((t=A)===l){o?1===o?ol(t=ll(al(t),e,n),e,n,r,i,a,2):2===o&&cl(t,e,n,r,i,a):ol(al(t),e,n,r,i,a,1);break}}}function sl(t){var e=t.prev,n=t,r=t.next;if(vl(e,n,r)>=0)return !1;for(var i=e.x,a=n.x,o=r.x,s=e.y,A=n.y,l=r.y,c=i<a?i<o?i:o:a<o?a:o,u=s<A?s<l?s:l:A<l?A:l,h=i>a?i>o?i:o:a>o?a:o,f=s>A?s>l?s:l:A>l?A:l,d=r.next;d!==e;){if(d.x>=c&&d.x<=h&&d.y>=u&&d.y<=f&&ml(i,s,a,A,o,l,d.x,d.y)&&vl(d.prev,d,d.next)>=0)return !1;d=d.next;}return !0}function Al(t,e,n,r){var i=t.prev,a=t,o=t.next;if(vl(i,a,o)>=0)return !1;for(var s=i.x,A=a.x,l=o.x,c=i.y,u=a.y,h=o.y,f=s<A?s<l?s:l:A<l?A:l,d=c<u?c<h?c:h:u<h?u:h,p=s>A?s>l?s:l:A>l?A:l,m=c>u?c>h?c:h:u>h?u:h,g=dl(f,d,e,n,r),v=dl(p,m,e,n,r),_=t.prevZ,y=t.nextZ;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ml(s,c,A,u,l,h,_.x,_.y)&&vl(_.prev,_,_.next)>=0)return !1;if(_=_.prevZ,y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ml(s,c,A,u,l,h,y.x,y.y)&&vl(y.prev,y,y.next)>=0)return !1;y=y.nextZ;}for(;_&&_.z>=g;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ml(s,c,A,u,l,h,_.x,_.y)&&vl(_.prev,_,_.next)>=0)return !1;_=_.prevZ;}for(;y&&y.z<=v;){if(y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ml(s,c,A,u,l,h,y.x,y.y)&&vl(y.prev,y,y.next)>=0)return !1;y=y.nextZ;}return !0}function ll(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!_l(i,a)&&yl(i,r,r.next,a)&&Ml(i,a)&&Ml(a,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),Sl(r),Sl(r.next),r=t=a),r=r.next;}while(r!==t);return al(r)}function cl(t,e,n,r,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&gl(o,s)){var A=wl(o,s);return o=al(o,o.next),A=al(A,A.next),ol(o,e,n,r,i,a,0),void ol(A,e,n,r,i,a,0)}s=s.next;}o=o.next;}while(o!==t)}function ul(t,e){return t.x-e.x}function hl(t,e){var n=function(t,e){var n,r=e,i=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o&&(o=s,n=r.x<r.next.x?r:r.next,s===i))return n}r=r.next;}while(r!==e);if(!n)return null;var A,l=n,c=n.x,u=n.y,h=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&ml(a<u?i:o,a,c,u,a<u?o:i,a,r.x,r.y)&&(A=Math.abs(a-r.y)/(i-r.x),Ml(r,t)&&(A<h||A===h&&(r.x>n.x||r.x===n.x&&fl(n,r)))&&(n=r,h=A)),r=r.next;}while(r!==l);return n}(t,e);if(!n)return e;var r=wl(n,t);return al(r,r.next),al(n,n.next)}function fl(t,e){return vl(t.prev,t,e.prev)<0&&vl(e.next,t,t.next)<0}function dl(t,e,n,r,i){return (t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function pl(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;}while(e!==t);return n}function ml(t,e,n,r,i,a,o,s){return (i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(r-s)>=(n-o)*(e-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function gl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&yl(n,n.next,t,e))return !0;n=n.next;}while(n!==t);return !1}(t,e)&&(Ml(t,e)&&Ml(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;}while(n!==t);return r}(t,e)&&(vl(t.prev,t,e.prev)||vl(t,e.prev,e))||_l(t,e)&&vl(t.prev,t,t.next)>0&&vl(e.prev,e,e.next)>0)}function vl(t,e,n){return (e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _l(t,e){return t.x===e.x&&t.y===e.y}function yl(t,e,n,r){var i=bl(vl(t,e,n)),a=bl(vl(t,e,r)),o=bl(vl(n,r,t)),s=bl(vl(n,r,e));return i!==a&&o!==s||(!(0!==i||!xl(t,n,e))||(!(0!==a||!xl(t,r,e))||(!(0!==o||!xl(n,t,r))||!(0!==s||!xl(n,e,r)))))}function xl(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function bl(t){return t>0?1:t<0?-1:0}function Ml(t,e){return vl(t.prev,t,t.next)<0?vl(t,e,t.next)>=0&&vl(t,t.prev,e)>=0:vl(t,e,t.prev)<0||vl(t,t.next,e)<0}function wl(t,e){var n=new Tl(t.i,t.x,t.y),r=new Tl(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function El(t,e,n,r){var i=new Tl(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Sl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ);}function Tl(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1;}function Cl(t,e,n,r){for(var i=0,a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}nl.exports=rl,nl.exports.default=rl,rl.deviation=function(t,e,n,r){var i=e&&e.length,a=i?e[0]*n:t.length,o=Math.abs(Cl(t,0,a,n));if(i)for(var s=0,A=e.length;s<A;s++){var l=e[s]*n,c=s<A-1?e[s+1]*n:t.length;o-=Math.abs(Cl(t,l,c,n));}var u=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,f=r[s+1]*n,d=r[s+2]*n;u+=Math.abs((t[h]-t[d])*(t[f+1]-t[h+1])-(t[h]-t[f])*(t[d+1]-t[h+1]));}return 0===o&&0===u?0:Math.abs((u-o)/o)},rl.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)n.vertices.push(t[i][a][o]);i>0&&(r+=t[i-1].length,n.holes.push(r));}return n};var Rl=el(nl.exports);function Pl(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ll(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Dl(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<0?i=e+1:a=e;}while(i<a)}return i}return 2!==t.length?(e=Pl,n=(e,n)=>Pl(t(e),n),r=(e,n)=>t(e)-n):(e=t===Pl||t===Ll?t:Ol,n=t,r=t),{left:i,center:function(t,e,n=0,a=t.length){const o=i(t,e,n,a-1);return o>n&&r(t[o-1],e)>-r(t[o],e)?o-1:o},right:function(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<=0?i=e+1:a=e;}while(i<a)}return i}}}function Ol(){return 0}const Il=Dl(Pl).right;function ql(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else {let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(void 0===n?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)));}return [n,r]}Dl((function(t){return null===t?NaN:+t})).center;class Ul{constructor(){this._partials=new Float64Array(32),this._n=0;}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],a=t+i,o=Math.abs(t)<Math.abs(i)?t-(a-i):i-(a-t);o&&(e[n++]=o),t=a;}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,a=0;if(i>0){for(a=t[--i];i>0&&(e=a,n=t[--i],a=e+n,r=n-(a-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=a+n,n==e-a&&(a=e));}return a}}const Nl=Math.sqrt(50),Bl=Math.sqrt(10),kl=Math.sqrt(2);function Fl(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Nl?10:a>=Bl?5:a>=kl?2:1;let s,A,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(t*l),A=Math.round(e*l),s/l<t&&++s,A/l>e&&--A,l=-l):(l=Math.pow(10,i)*o,s=Math.round(t/l),A=Math.round(e/l),s*l<t&&++s,A*l>e&&--A),A<s&&.5<=n&&n<2?Fl(t,e,2*n):[s,A,l]}function zl(t,e,n){return Fl(t=+t,e=+e,n=+n)[2]}function Gl(t){return Array.from(function*(t){for(const e of t)yield*e;}(t))}function Hl(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}var jl=1e-6,Vl=1e-12,Wl=Math.PI,Xl=Wl/2,Ql=Wl/4,Yl=2*Wl,Zl=180/Wl,Kl=Wl/180,Jl=Math.abs,$l=Math.atan,tc=Math.atan2,ec=Math.cos,nc=Math.ceil,rc=Math.hypot,ic=Math.sin,ac=Math.sign||function(t){return t>0?1:t<0?-1:0},oc=Math.sqrt;function sc(t){return t>1?Xl:t<-1?-Xl:Math.asin(t)}function Ac(t){return (t=ic(t/2))*t}function lc(){}function cc(t,e){t&&hc.hasOwnProperty(t.type)&&hc[t.type](t,e);}var uc={Feature:function(t,e){cc(t.geometry,e);},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)cc(n[r].geometry,e);}},hc={Sphere:function(t,e){e.sphere();},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2]);},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2]);},LineString:function(t,e){fc(t.coordinates,e,0);},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)fc(n[r],e,0);},Polygon:function(t,e){dc(t.coordinates,e);},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)dc(n[r],e);},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)cc(n[r],e);}};function fc(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd();}function dc(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)fc(t[n],e,1);e.polygonEnd();}function pc(t,e){t&&uc.hasOwnProperty(t.type)?uc[t.type](t,e):cc(t,e);}var mc,gc,vc,_c,yc,xc,bc,Mc,wc,Ec,Sc,Tc,Cc,Rc,Pc,Lc,Dc=new Ul,Oc=new Ul,Ic={point:lc,lineStart:lc,lineEnd:lc,polygonStart:function(){Dc=new Ul,Ic.lineStart=qc,Ic.lineEnd=Uc;},polygonEnd:function(){var t=+Dc;Oc.add(t<0?Yl+t:t),this.lineStart=this.lineEnd=this.point=lc;},sphere:function(){Oc.add(Yl);}};function qc(){Ic.point=Nc;}function Uc(){Bc(mc,gc);}function Nc(t,e){Ic.point=Bc,mc=t,gc=e,vc=t*=Kl,_c=ec(e=(e*=Kl)/2+Ql),yc=ic(e);}function Bc(t,e){var n=(t*=Kl)-vc,r=n>=0?1:-1,i=r*n,a=ec(e=(e*=Kl)/2+Ql),o=ic(e),s=yc*o,A=_c*a+s*ec(i),l=s*r*ic(i);Dc.add(tc(l,A)),vc=t,_c=a,yc=o;}function kc(t){return [tc(t[1],t[0]),sc(t[2])]}function Fc(t){var e=t[0],n=t[1],r=ec(n);return [r*ec(e),r*ic(e),ic(n)]}function zc(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Gc(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 Hc(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2];}function jc(t,e){return [t[0]*e,t[1]*e,t[2]*e]}function Vc(t){var e=oc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e;}var Wc,Xc,Qc,Yc,Zc,Kc,Jc,$c,tu,eu,nu,ru,iu,au,ou,su,Au={point:lu,lineStart:uu,lineEnd:hu,polygonStart:function(){Au.point=fu,Au.lineStart=du,Au.lineEnd=pu,Rc=new Ul,Ic.polygonStart();},polygonEnd:function(){Ic.polygonEnd(),Au.point=lu,Au.lineStart=uu,Au.lineEnd=hu,Dc<0?(xc=-(Mc=180),bc=-(wc=90)):Rc>jl?wc=90:Rc<-jl&&(bc=-90),Lc[0]=xc,Lc[1]=Mc;},sphere:function(){xc=-(Mc=180),bc=-(wc=90);}};function lu(t,e){Pc.push(Lc=[xc=t,Mc=t]),e<bc&&(bc=e),e>wc&&(wc=e);}function cu(t,e){var n=Fc([t*Kl,e*Kl]);if(Cc){var r=Gc(Cc,n),i=Gc([r[1],-r[0],0],r);Vc(i),i=kc(i);var a,o=t-Ec,s=o>0?1:-1,A=i[0]*Zl*s,l=Jl(o)>180;l^(s*Ec<A&&A<s*t)?(a=i[1]*Zl)>wc&&(wc=a):l^(s*Ec<(A=(A+360)%360-180)&&A<s*t)?(a=-i[1]*Zl)<bc&&(bc=a):(e<bc&&(bc=e),e>wc&&(wc=e)),l?t<Ec?mu(xc,t)>mu(xc,Mc)&&(Mc=t):mu(t,Mc)>mu(xc,Mc)&&(xc=t):Mc>=xc?(t<xc&&(xc=t),t>Mc&&(Mc=t)):t>Ec?mu(xc,t)>mu(xc,Mc)&&(Mc=t):mu(t,Mc)>mu(xc,Mc)&&(xc=t);}else Pc.push(Lc=[xc=t,Mc=t]);e<bc&&(bc=e),e>wc&&(wc=e),Cc=n,Ec=t;}function uu(){Au.point=cu;}function hu(){Lc[0]=xc,Lc[1]=Mc,Au.point=lu,Cc=null;}function fu(t,e){if(Cc){var n=t-Ec;Rc.add(Jl(n)>180?n+(n>0?360:-360):n);}else Sc=t,Tc=e;Ic.point(t,e),cu(t,e);}function du(){Ic.lineStart();}function pu(){fu(Sc,Tc),Ic.lineEnd(),Jl(Rc)>jl&&(xc=-(Mc=180)),Lc[0]=xc,Lc[1]=Mc,Cc=null;}function mu(t,e){return (e-=t)<0?e+360:e}function gu(t,e){return t[0]-e[0]}function vu(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function _u(t){var e,n,r,i,a,o,s;if(wc=Mc=-(xc=bc=1/0),Pc=[],pc(t,Au),n=Pc.length){for(Pc.sort(gu),e=1,a=[r=Pc[0]];e<n;++e)vu(r,(i=Pc[e])[0])||vu(r,i[1])?(mu(r[0],i[1])>mu(r[0],r[1])&&(r[1]=i[1]),mu(i[0],r[1])>mu(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,e=0,r=a[n=a.length-1];e<=n;r=i,++e)i=a[e],(s=mu(r[1],i[0]))>o&&(o=s,xc=i[0],Mc=r[1]);}return Pc=Lc=null,xc===1/0||bc===1/0?[[NaN,NaN],[NaN,NaN]]:[[xc,bc],[Mc,wc]]}var yu={sphere:lc,point:xu,lineStart:Mu,lineEnd:Su,polygonStart:function(){yu.lineStart=Tu,yu.lineEnd=Cu;},polygonEnd:function(){yu.lineStart=Mu,yu.lineEnd=Su;}};function xu(t,e){t*=Kl;var n=ec(e*=Kl);bu(n*ec(t),n*ic(t),ic(e));}function bu(t,e,n){++Wc,Qc+=(t-Qc)/Wc,Yc+=(e-Yc)/Wc,Zc+=(n-Zc)/Wc;}function Mu(){yu.point=wu;}function wu(t,e){t*=Kl;var n=ec(e*=Kl);au=n*ec(t),ou=n*ic(t),su=ic(e),yu.point=Eu,bu(au,ou,su);}function Eu(t,e){t*=Kl;var n=ec(e*=Kl),r=n*ec(t),i=n*ic(t),a=ic(e),o=tc(oc((o=ou*a-su*i)*o+(o=su*r-au*a)*o+(o=au*i-ou*r)*o),au*r+ou*i+su*a);Xc+=o,Kc+=o*(au+(au=r)),Jc+=o*(ou+(ou=i)),$c+=o*(su+(su=a)),bu(au,ou,su);}function Su(){yu.point=xu;}function Tu(){yu.point=Ru;}function Cu(){Pu(ru,iu),yu.point=xu;}function Ru(t,e){ru=t,iu=e,t*=Kl,e*=Kl,yu.point=Pu;var n=ec(e);au=n*ec(t),ou=n*ic(t),su=ic(e),bu(au,ou,su);}function Pu(t,e){t*=Kl;var n=ec(e*=Kl),r=n*ec(t),i=n*ic(t),a=ic(e),o=ou*a-su*i,s=su*r-au*a,A=au*i-ou*r,l=rc(o,s,A),c=sc(l),u=l&&-c/l;tu.add(u*o),eu.add(u*s),nu.add(u*A),Xc+=c,Kc+=c*(au+(au=r)),Jc+=c*(ou+(ou=i)),$c+=c*(su+(su=a)),bu(au,ou,su);}function Lu(t){Wc=Xc=Qc=Yc=Zc=Kc=Jc=$c=0,tu=new Ul,eu=new Ul,nu=new Ul,pc(t,yu);var e=+tu,n=+eu,r=+nu,i=rc(e,n,r);return i<Vl&&(e=Kc,n=Jc,r=$c,Xc<jl&&(e=Qc,n=Yc,r=Zc),(i=rc(e,n,r))<Vl)?[NaN,NaN]:[tc(n,e)*Zl,sc(r/i)*Zl]}function Du(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return (n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function Ou(t,e){return Jl(t)>Wl&&(t-=Math.round(t/Yl)*Yl),[t,e]}function Iu(t,e,n){return (t%=Yl)?e||n?Du(Uu(t),Nu(e,n)):Uu(t):e||n?Nu(e,n):Ou}function qu(t){return function(e,n){return Jl(e+=t)>Wl&&(e-=Math.round(e/Yl)*Yl),[e,n]}}function Uu(t){var e=qu(t);return e.invert=qu(-t),e}function Nu(t,e){var n=ec(t),r=ic(t),i=ec(e),a=ic(e);function o(t,e){var o=ec(e),s=ec(t)*o,A=ic(t)*o,l=ic(e),c=l*n+s*r;return [tc(A*i-c*a,s*n-l*r),sc(c*i+A*a)]}return o.invert=function(t,e){var o=ec(e),s=ec(t)*o,A=ic(t)*o,l=ic(e),c=l*i-A*a;return [tc(A*i+l*a,s*n+c*r),sc(c*n-s*r)]},o}function Bu(t,e){(e=Fc(e))[0]-=t,Vc(e);var n,r=(n=-e[1])>1?0:n<-1?Wl:Math.acos(n);return ((-e[2]<0?-r:r)+Yl-jl)%Yl}function ku(){var t,e=[];return {point:function(e,n,r){t.push([e,n,r]);},lineStart:function(){e.push(t=[]);},lineEnd:lc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()));},result:function(){var n=e;return e=[],t=null,n}}}function Fu(t,e){return Jl(t[0]-e[0])<jl&&Jl(t[1]-e[1])<jl}function zu(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null;}function Gu(t,e,n,r,i){var a,o,s=[],A=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(Fu(r,o)){if(!r[2]&&!o[2]){for(i.lineStart(),a=0;a<e;++a)i.point((r=t[a])[0],r[1]);return void i.lineEnd()}o[0]+=2*jl;}s.push(n=new zu(r,t,null,!0)),A.push(n.o=new zu(r,null,n,!1)),s.push(n=new zu(o,t,null,!1)),A.push(n.o=new zu(o,null,n,!0));}})),s.length){for(A.sort(e),Hu(s),Hu(A),a=0,o=A.length;a<o;++a)A[a].e=n=!n;for(var l,c,u=s[0];;){for(var h=u,f=!0;h.v;)if((h=h.n)===u)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(a=0,o=l.length;a<o;++a)i.point((c=l[a])[0],c[1]);else r(h.x,h.n.x,1,i);h=h.n;}else {if(f)for(l=h.p.z,a=l.length-1;a>=0;--a)i.point((c=l[a])[0],c[1]);else r(h.x,h.p.x,-1,i);h=h.p;}l=(h=h.o).z,f=!f;}while(!h.v);i.lineEnd();}}}function Hu(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i;}}function ju(t){return Jl(t[0])<=Wl?t[0]:ac(t[0])*((Jl(t[0])+Wl)%Yl-Wl)}function Vu(t,e){var n=ju(e),r=e[1],i=ic(r),a=[ic(n),-ec(n),0],o=0,s=0,A=new Ul;1===i?r=Xl+jl:-1===i&&(r=-Xl-jl);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,f=u[h-1],d=ju(f),p=f[1]/2+Ql,m=ic(p),g=ec(p),v=0;v<h;++v,d=y,m=b,g=M,f=_){var _=u[v],y=ju(_),x=_[1]/2+Ql,b=ic(x),M=ec(x),w=y-d,E=w>=0?1:-1,S=E*w,T=S>Wl,C=m*b;if(A.add(tc(C*E*ic(S),g*M+C*ec(S))),o+=T?w+E*Yl:w,T^d>=n^y>=n){var R=Gc(Fc(f),Fc(_));Vc(R);var P=Gc(a,R);Vc(P);var L=(T^w>=0?-1:1)*sc(P[2]);(r>L||r===L&&(R[0]||R[1]))&&(s+=T^w>=0?1:-1);}}return (o<-jl||o<jl&&A<-Vl)^1&s}function Wu(t,e,n,r){return function(i){var a,o,s,A=e(i),l=ku(),c=e(l),u=!1,h={point:f,lineStart:p,lineEnd:m,polygonStart:function(){h.point=g,h.lineStart=v,h.lineEnd=_,o=[],a=[];},polygonEnd:function(){h.point=f,h.lineStart=p,h.lineEnd=m,o=Gl(o);var t=Vu(a,r);o.length?(u||(i.polygonStart(),u=!0),Gu(o,Qu,t,n,i)):t&&(u||(i.polygonStart(),u=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),u&&(i.polygonEnd(),u=!1),o=a=null;},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd();}};function f(e,n){t(e,n)&&i.point(e,n);}function d(t,e){A.point(t,e);}function p(){h.point=d,A.lineStart();}function m(){h.point=f,A.lineEnd();}function g(t,e){s.push([t,e]),c.point(t,e);}function v(){c.lineStart(),s=[];}function _(){g(s[0][0],s[0][1]),c.lineEnd();var t,e,n,r,A=c.clean(),h=l.result(),f=h.length;if(s.pop(),a.push(s),s=null,f)if(1&A){if((e=(n=h[0]).length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd();}}else f>1&&2&A&&h.push(h.pop().concat(h.shift())),o.push(h.filter(Xu));}return h}}function Xu(t){return t.length>1}function Qu(t,e){return ((t=t.x)[0]<0?t[1]-Xl-jl:Xl-t[1])-((e=e.x)[0]<0?e[1]-Xl-jl:Xl-e[1])}Ou.invert=Ou;var Yu=Wu((function(){return !0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return {lineStart:function(){t.lineStart(),e=1;},point:function(a,o){var s=a>0?Wl:-Wl,A=Jl(a-n);Jl(A-Wl)<jl?(t.point(n,r=(r+o)/2>0?Xl:-Xl),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(a,r),e=0):i!==s&&A>=Wl&&(Jl(n-i)<jl&&(n-=i*jl),Jl(a-s)<jl&&(a-=s*jl),r=function(t,e,n,r){var i,a,o=ic(t-n);return Jl(o)>jl?$l((ic(e)*(a=ec(r))*ic(n)-ic(r)*(i=ec(e))*ic(t))/(i*a*o)):(e+r)/2}(n,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=a,r=o),i=s;},lineEnd:function(){t.lineEnd(),n=r=NaN;},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Xl,r.point(-Wl,i),r.point(0,i),r.point(Wl,i),r.point(Wl,0),r.point(Wl,-i),r.point(0,-i),r.point(-Wl,-i),r.point(-Wl,0),r.point(-Wl,i);else if(Jl(t[0]-e[0])>jl){var a=t[0]<e[0]?Wl:-Wl;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i);}else r.point(e[0],e[1]);}),[-Wl,-Xl]);function Zu(t){var e=ec(t),n=2*Kl,r=e>0,i=Jl(e)>jl;function a(t,n){return ec(t)*ec(n)>e}function o(t,n,r){var i=[1,0,0],a=Gc(Fc(t),Fc(n)),o=zc(a,a),s=a[0],A=o-s*s;if(!A)return !r&&t;var l=e*o/A,c=-e*s/A,u=Gc(i,a),h=jc(i,l);Hc(h,jc(a,c));var f=u,d=zc(h,f),p=zc(f,f),m=d*d-p*(zc(h,h)-1);if(!(m<0)){var g=oc(m),v=jc(f,(-d-g)/p);if(Hc(v,h),v=kc(v),!r)return v;var _,y=t[0],x=n[0],b=t[1],M=n[1];x<y&&(_=y,y=x,x=_);var w=x-y,E=Jl(w-Wl)<jl;if(!E&&M<b&&(_=b,b=M,M=_),E||w<jl?E?b+M>0^v[1]<(Jl(v[0]-y)<jl?b:M):b<=v[1]&&v[1]<=M:w>Wl^(y<=v[0]&&v[0]<=x)){var S=jc(f,(-d+g)/p);return Hc(S,h),[v,kc(S)]}}}function s(e,n){var i=r?t:Wl-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return Wu(a,(function(t){var e,n,A,l,c;return {lineStart:function(){l=A=!1,c=1;},point:function(u,h){var f,d=[u,h],p=a(u,h),m=r?p?0:s(u,h):p?s(u+(u<0?Wl:-Wl),h):0;if(!e&&(l=A=p)&&t.lineStart(),p!==A&&(!(f=o(e,d))||Fu(e,f)||Fu(d,f))&&(d[2]=1),p!==A)c=0,p?(t.lineStart(),f=o(d,e),t.point(f[0],f[1])):(f=o(e,d),t.point(f[0],f[1],2),t.lineEnd()),e=f;else if(i&&e&&r^p){var g;m&n||!(g=o(d,e,!0))||(c=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1],3)));}!p||e&&Fu(e,d)||t.point(d[0],d[1]),e=d,A=p,n=m;},lineEnd:function(){A&&t.lineEnd(),e=null;},clean:function(){return c|(l&&A)<<1}}}),(function(e,r,i,a){!function(t,e,n,r,i,a){if(n){var o=ec(e),s=ic(e),A=r*n;null==i?(i=e+r*Yl,a=e-A/2):(i=Bu(o,i),a=Bu(o,a),(r>0?i<a:i>a)&&(i+=r*Yl));for(var l,c=i;r>0?c>a:c<a;c-=A)l=kc([o,-s*ec(c),-s*ic(c)]),t.point(l[0],l[1]);}}(a,t,n,i,e,r);}),r?[0,-t]:[-Wl,t-Wl])}var Ku,Ju,$u,th,eh=1e9,nh=-eh;function rh(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,s,l){var c=0,u=0;if(null==i||(c=o(i,s))!==(u=o(a,s))||A(i,a)<0^s>0)do{l.point(0===c||3===c?t:n,c>1?r:e);}while((c=(c+s+4)%4)!==u);else l.point(a[0],a[1]);}function o(r,i){return Jl(r[0]-t)<jl?i>0?0:3:Jl(r[0]-n)<jl?i>0?2:1:Jl(r[1]-e)<jl?i>0?1:0:i>0?3:2}function s(t,e){return A(t.x,e.x)}function A(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var A,l,c,u,h,f,d,p,m,g,v,_=o,y=ku(),x={point:b,lineStart:function(){x.point=M,l&&l.push(c=[]);g=!0,m=!1,d=p=NaN;},lineEnd:function(){A&&(M(u,h),f&&m&&y.rejoin(),A.push(y.result()));x.point=b,m&&_.lineEnd();},polygonStart:function(){_=y,A=[],l=[],v=!0;},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var a,o,s=l[n],A=1,c=s.length,u=s[0],h=u[0],f=u[1];A<c;++A)a=h,o=f,h=(u=s[A])[0],f=u[1],o<=r?f>r&&(h-a)*(r-o)>(f-o)*(t-a)&&++e:f<=r&&(h-a)*(r-o)<(f-o)*(t-a)&&--e;return e}(),n=v&&e,i=(A=Gl(A)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&Gu(A,s,e,a,o),o.polygonEnd());_=o,A=l=c=null;}};function b(t,e){i(t,e)&&_.point(t,e);}function M(a,o){var s=i(a,o);if(l&&c.push([a,o]),g)u=a,h=o,f=s,g=!1,s&&(_.lineStart(),_.point(a,o));else if(s&&m)_.point(a,o);else {var A=[d=Math.max(nh,Math.min(eh,d)),p=Math.max(nh,Math.min(eh,p))],y=[a=Math.max(nh,Math.min(eh,a)),o=Math.max(nh,Math.min(eh,o))];!function(t,e,n,r,i,a){var o,s=t[0],A=t[1],l=0,c=1,u=e[0]-s,h=e[1]-A;if(o=n-s,u||!(o>0)){if(o/=u,u<0){if(o<l)return;o<c&&(c=o);}else if(u>0){if(o>c)return;o>l&&(l=o);}if(o=i-s,u||!(o<0)){if(o/=u,u<0){if(o>c)return;o>l&&(l=o);}else if(u>0){if(o<l)return;o<c&&(c=o);}if(o=r-A,h||!(o>0)){if(o/=h,h<0){if(o<l)return;o<c&&(c=o);}else if(h>0){if(o>c)return;o>l&&(l=o);}if(o=a-A,h||!(o<0)){if(o/=h,h<0){if(o>c)return;o>l&&(l=o);}else if(h>0){if(o<l)return;o<c&&(c=o);}return l>0&&(t[0]=s+l*u,t[1]=A+l*h),c<1&&(e[0]=s+c*u,e[1]=A+c*h),!0}}}}}(A,y,t,e,n,r)?s&&(_.lineStart(),_.point(a,o),v=!1):(m||(_.lineStart(),_.point(A[0],A[1])),_.point(y[0],y[1]),s||_.lineEnd(),v=!1);}d=a,p=o,m=s;}return x}}var ih={sphere:lc,point:lc,lineStart:function(){ih.point=oh,ih.lineEnd=ah;},lineEnd:lc,polygonStart:lc,polygonEnd:lc};function ah(){ih.point=ih.lineEnd=lc;}function oh(t,e){Ju=t*=Kl,$u=ic(e*=Kl),th=ec(e),ih.point=sh;}function sh(t,e){t*=Kl;var n=ic(e*=Kl),r=ec(e),i=Jl(t-Ju),a=ec(i),o=r*ic(i),s=th*n-$u*r*a,A=$u*n+th*r*a;Ku.add(tc(oc(o*o+s*s),A)),Ju=t,$u=n,th=r;}var Ah=[null,null],lh={type:"LineString",coordinates:Ah};function ch(t,e){return Ah[0]=t,Ah[1]=e,function(t){return Ku=new Ul,pc(t,ih),+Ku}(lh)}var uh={Feature:function(t,e){return fh(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)if(fh(n[r].geometry,e))return !0;return !1}},hh={Sphere:function(){return !0},Point:function(t,e){return dh(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(dh(n[r],e))return !0;return !1},LineString:function(t,e){return ph(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(ph(n[r],e))return !0;return !1},Polygon:function(t,e){return mh(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(mh(n[r],e))return !0;return !1},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)if(fh(n[r],e))return !0;return !1}};function fh(t,e){return !(!t||!hh.hasOwnProperty(t.type))&&hh[t.type](t,e)}function dh(t,e){return 0===ch(t,e)}function ph(t,e){for(var n,r,i,a=0,o=t.length;a<o;a++){if(0===(r=ch(t[a],e)))return !0;if(a>0&&(i=ch(t[a],t[a-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<Vl*i)return !0;n=r;}return !1}function mh(t,e){return !!Vu(t.map(gh),vh(e))}function gh(t){return (t=t.map(vh)).pop(),t}function vh(t){return [t[0]*Kl,t[1]*Kl]}function _h(t,e,n){var r=Hl(t,e-jl,n).concat(e);return function(t){return r.map((function(e){return [t,e]}))}}function yh(t,e,n){var r=Hl(t,e-jl,n).concat(e);return function(t){return r.map((function(e){return [e,t]}))}}function xh(){return function(){var t,e,n,r,i,a,o,s,A,l,c,u,h=10,f=h,d=90,p=360,m=2.5;function g(){return {type:"MultiLineString",coordinates:v()}}function v(){return Hl(nc(r/d)*d,n,d).map(c).concat(Hl(nc(s/p)*p,o,p).map(u)).concat(Hl(nc(e/h)*h,t,h).filter((function(t){return Jl(t%d)>jl})).map(A)).concat(Hl(nc(a/f)*f,i,f).filter((function(t){return Jl(t%p)>jl})).map(l))}return g.lines=function(){return v().map((function(t){return {type:"LineString",coordinates:t}}))},g.outline=function(){return {type:"Polygon",coordinates:[c(r).concat(u(o).slice(1),c(n).reverse().slice(1),u(s).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.extentMajor(t).extentMinor(t):g.extentMinor()},g.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),s>o&&(t=s,s=o,o=t),g.precision(m)):[[r,s],[n,o]]},g.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),g.precision(m)):[[e,a],[t,i]]},g.step=function(t){return arguments.length?g.stepMajor(t).stepMinor(t):g.stepMinor()},g.stepMajor=function(t){return arguments.length?(d=+t[0],p=+t[1],g):[d,p]},g.stepMinor=function(t){return arguments.length?(h=+t[0],f=+t[1],g):[h,f]},g.precision=function(h){return arguments.length?(m=+h,A=_h(a,i,90),l=yh(e,t,m),c=_h(s,o,90),u=yh(r,n,m),g):m},g.extentMajor([[-180,-90+jl],[180,90-jl]]).extentMinor([[-180,-80-jl],[180,80+jl]])}()()}function bh(t,e){var n=t[0]*Kl,r=t[1]*Kl,i=e[0]*Kl,a=e[1]*Kl,o=ec(r),s=ic(r),A=ec(a),l=ic(a),c=o*ec(n),u=o*ic(n),h=A*ec(i),f=A*ic(i),d=2*sc(oc(Ac(a-r)+o*A*Ac(i-n))),p=ic(d),m=d?function(t){var e=ic(t*=d)/p,n=ic(d-t)/p,r=n*c+e*h,i=n*u+e*f,a=n*s+e*l;return [tc(i,r)*Zl,tc(a,oc(r*r+i*i))*Zl]}:function(){return [n*Zl,r*Zl]};return m.distance=d,m}var Mh=t=>t,wh=1/0,Eh=wh,Sh=-wh,Th=Sh;var Ch={point:function(t,e){t<wh&&(wh=t);t>Sh&&(Sh=t);e<Eh&&(Eh=e);e>Th&&(Th=e);},lineStart:lc,lineEnd:lc,polygonStart:lc,polygonEnd:lc,result:function(){var t=[[wh,Eh],[Sh,Th]];return Sh=Th=-(Eh=wh=1/0),t}};function Rh(t){return function(e){var n=new Ph;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Ph(){}function Lh(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),pc(n,t.stream(Ch)),e(Ch.result()),null!=r&&t.clipExtent(r),t}function Dh(t,e,n){return Lh(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s]);}),n)}Ph.prototype={constructor:Ph,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 Oh=16,Ih=ec(30*Kl);function qh(t,e){return +e?function(t,e){function n(r,i,a,o,s,A,l,c,u,h,f,d,p,m){var g=l-r,v=c-i,_=g*g+v*v;if(_>4*e&&p--){var y=o+h,x=s+f,b=A+d,M=oc(y*y+x*x+b*b),w=sc(b/=M),E=Jl(Jl(b)-1)<jl||Jl(a-u)<jl?(a+u)/2:tc(x,y),S=t(E,w),T=S[0],C=S[1],R=T-r,P=C-i,L=v*R-g*P;(L*L/_>e||Jl((g*R+v*P)/_-.5)>.3||o*h+s*f+A*d<Ih)&&(n(r,i,a,o,s,A,T,C,E,y/=M,x/=M,b,p,m),m.point(T,C),n(T,C,E,y,x,b,l,c,u,h,f,d,p,m));}}return function(e){var r,i,a,o,s,A,l,c,u,h,f,d,p={point:m,lineStart:g,lineEnd:_,polygonStart:function(){e.polygonStart(),p.lineStart=y;},polygonEnd:function(){e.polygonEnd(),p.lineStart=g;}};function m(n,r){n=t(n,r),e.point(n[0],n[1]);}function g(){c=NaN,p.point=v,e.lineStart();}function v(r,i){var a=Fc([r,i]),o=t(r,i);n(c,u,l,h,f,d,c=o[0],u=o[1],l=r,h=a[0],f=a[1],d=a[2],Oh,e),e.point(c,u);}function _(){p.point=m,e.lineEnd();}function y(){g(),p.point=x,p.lineEnd=b;}function x(t,e){v(r=t,e),i=c,a=u,o=h,s=f,A=d,p.point=v;}function b(){n(c,u,l,h,f,d,i,a,r,o,s,A,Oh,e),p.lineEnd=_,_();}return p}}(t,e):function(t){return Rh({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1]);}})}(t)}var Uh=Rh({point:function(t,e){this.stream.point(t*Kl,e*Kl);}});function Nh(t,e,n,r,i,a){if(!a)return function(t,e,n,r,i){function a(a,o){return [e+t*(a*=r),n-t*(o*=i)]}return a.invert=function(a,o){return [(a-e)/t*r,(n-o)/t*i]},a}(t,e,n,r,i);var o=ec(a),s=ic(a),A=o*t,l=s*t,c=o/t,u=s/t,h=(s*n-o*e)/t,f=(s*e+o*n)/t;function d(t,a){return [A*(t*=r)-l*(a*=i)+e,n-l*t-A*a]}return d.invert=function(t,e){return [r*(c*t-u*e+h),i*(f-u*t-c*e)]},d}function Bh(t){return function(t){var e,n,r,i,a,o,s,A,l,c,u=150,h=480,f=250,d=0,p=0,m=0,g=0,v=0,_=0,y=1,x=1,b=null,M=Yu,w=null,E=Mh,S=.5;function T(t){return A(t[0]*Kl,t[1]*Kl)}function C(t){return (t=A.invert(t[0],t[1]))&&[t[0]*Zl,t[1]*Zl]}function R(){var t=Nh(u,0,0,y,x,_).apply(null,e(d,p)),r=Nh(u,h-t[0],f-t[1],y,x,_);return n=Iu(m,g,v),s=Du(e,r),A=Du(n,s),o=qh(s,S),P()}function P(){return l=c=null,T}return T.stream=function(t){return l&&c===t?l:l=Uh(function(t){return Rh({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(o(E(c=t)))))},T.preclip=function(t){return arguments.length?(M=t,b=void 0,P()):M},T.postclip=function(t){return arguments.length?(E=t,w=r=i=a=null,P()):E},T.clipAngle=function(t){return arguments.length?(M=+t?Zu(b=t*Kl):(b=null,Yu),P()):b*Zl},T.clipExtent=function(t){return arguments.length?(E=null==t?(w=r=i=a=null,Mh):rh(w=+t[0][0],r=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==w?null:[[w,r],[i,a]]},T.scale=function(t){return arguments.length?(u=+t,R()):u},T.translate=function(t){return arguments.length?(h=+t[0],f=+t[1],R()):[h,f]},T.center=function(t){return arguments.length?(d=t[0]%360*Kl,p=t[1]%360*Kl,R()):[d*Zl,p*Zl]},T.rotate=function(t){return arguments.length?(m=t[0]%360*Kl,g=t[1]%360*Kl,v=t.length>2?t[2]%360*Kl:0,R()):[m*Zl,g*Zl,v*Zl]},T.angle=function(t){return arguments.length?(_=t%360*Kl,R()):_*Zl},T.reflectX=function(t){return arguments.length?(y=t?-1:1,R()):y<0},T.reflectY=function(t){return arguments.length?(x=t?-1:1,R()):x<0},T.precision=function(t){return arguments.length?(o=qh(s,S=t*t),P()):oc(S)},T.fitExtent=function(t,e){return Dh(T,t,e)},T.fitSize=function(t,e){return function(t,e,n){return Dh(t,[[0,0],e],n)}(T,t,e)},T.fitWidth=function(t,e){return function(t,e,n){return Lh(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];t.scale(150*i).translate([a,o]);}),n)}(T,t,e)},T.fitHeight=function(t,e){return function(t,e,n){return Lh(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,o]);}),n)}(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&C,R()}}((function(){return t}))()}function kh(t,e){var n=ec(e),r=1+ec(t)*n;return [n*ic(t)/r,ic(e)/r]}function Fh(){return Bh(kh).scale(250).clipAngle(142)}function zh(t,e,n){return e=Vh(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gh()?Reflect.construct(e,n||[],Vh(t).constructor):e.apply(t,n))}function Gh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));}catch(t){}return (Gh=function(){return !!t})()}function Hh(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:String(e)}function jh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hh(r.key),r);}}function Vh(t){return Vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vh(t)}function Wh(t,e){return Wh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wh(t,e)}function Xh(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1;}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t;}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Qh(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qh(t,e){if(t){if("string"==typeof t)return Yh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return "Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yh(t,e):void 0}}function Yh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}kh.invert=function(t){return function(e,n){var r=oc(e*e+n*n),i=t(r),a=ic(i),o=ec(i);return [tc(e*a,r*o),sc(r&&n*a/r)]}}((function(t){return 2*$l(t)}));var Zh=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],n=null;return (arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){var i=180*ch(r,n)/Math.PI;if(i>t)for(var a=bh(n,r),o=1/Math.ceil(i/t),s=o;s<1;)e.push(a(s)),s+=o;}e.push(n=r);})),e},Kh="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:Hn,Float32BufferAttribute:qn},Jh=(new Kh.BufferGeometry).setAttribute?"setAttribute":"addAttribute",$h=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=zh(this,e)).type="GeoJsonGeometry",n.parameters={geoJson:t,radius:r,resolution:i};var a=({Point:l,MultiPoint:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return l(t,e)})).forEach((function(t){var e=Xh(t,1)[0];tf(n,e);})),[n]},LineString:c,MultiLineString:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return c(t,e)})).forEach((function(t){var e=Xh(t,1)[0];tf(n,e);})),[n]},Polygon:u,MultiPolygon:function(t,e){var n={vertices:[],indices:[]},r={vertices:[],indices:[]};t.map((function(t){return u(t,e)})).forEach((function(t){var e=Xh(t,2),i=e[0],a=e[1];tf(n,i),a&&tf(r,a);}));var i=[n];return r.vertices.length&&i.push(r),i}}[t.type]||function(){return []})(t.coordinates,r),o=[],s=[],A=0;function l(t,e){return [{vertices:nf(t[1],t[0],e),indices:[]}]}function c(t,e){for(var n=Zh(t,i).map((function(t){var n=Xh(t,2),r=n[0];return nf(n[1],r,e)})),r=Rl.flatten([n]).vertices,a=Math.round(r.length/3),o=[],s=1;s<a;s++)o.push(s-1,s);return [{vertices:r,indices:o}]}function u(t,e){for(var n=t.map((function(t){return Zh(t,i).map((function(t){var n=Xh(t,2),r=n[0];return nf(n[1],r,e)}))})),r=Rl.flatten(n),a=r.vertices,o=r.holes,s=o[0]||1/0,A=a.slice(0,3*s),l=a.slice(3*s),c=new Set(o),u=Math.round(a.length/3),h=[],f=[],d=1;d<u;d++)c.has(d)||(d<s?h.push(d-1,d):f.push(d-1-s,d-s));var p=[{indices:h,vertices:A}];return o.length&&p.push({indices:f,vertices:l}),p}return a.forEach((function(t){var e=o.length;tf({indices:o,vertices:s},t),n.addGroup(e,o.length-e,A++);})),o.length&&n.setIndex(o),s.length&&n[Jh]("position",new Kh.Float32BufferAttribute(s,3)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wh(t,e);}(e,t),n=e,r&&jh(n.prototype,r),i&&jh(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i;}(Kh.BufferGeometry);function tf(t,e){var n=Math.round(t.vertices.length/3);ef(t.vertices,e.vertices),ef(t.indices,e.indices.map((function(t){return t+n})));}function ef(t,e){var n,r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Qh(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return {s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return {s:function(){n=n.call(t);},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t;},f:function(){try{o||null==n.return||n.return();}finally{if(s)throw a}}}}(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.push(i);}}catch(t){r.e(t);}finally{r.f();}}function nf(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180;return [n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}function rf(t){let e,n,r,i=-1,a=0;for(let o=0;o<t.length;++o){const s=t[o];if(void 0===e&&(e=s.array.constructor),e!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=s.itemSize),n!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=s.normalized),r!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===i&&(i=s.gpuType),i!==s.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;a+=s.count*n;}const o=new e(a),s=new Dn(o,n,r);let A=0;for(let e=0;e<t.length;++e){const r=t[e];if(r.isInterleavedBufferAttribute){const t=A/n;for(let e=0,i=r.count;e<i;e++)for(let i=0;i<n;i++){const n=r.getComponent(e,i);s.setComponent(e+t,i,n);}}else o.set(r.array,A);A+=r.count*n;}return void 0!==i&&(s.gpuType=i),s}function af(t){const e=t.data.array.constructor,n=t.count,r=t.itemSize,i=t.normalized,a=new e(n*r);let o;o=t.isInstancedInterleavedBufferAttribute?new wo(a,r,i,t.meshPerAttribute):new Dn(a,r,i);for(let e=0;e<n;e++)o.setX(e,t.getX(e)),r>=2&&o.setY(e,t.getY(e)),r>=3&&o.setZ(e,t.getZ(e)),r>=4&&o.setW(e,t.getW(e));return o}var of=Object.freeze({__proto__:null,computeMikkTSpaceTangents:function(t,e,n=!0){if(!e||!e.isReady)throw new Error("BufferGeometryUtils: Initialized MikkTSpace library required.");if(!t.hasAttribute("position")||!t.hasAttribute("normal")||!t.hasAttribute("uv"))throw new Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function r(t){if(t.normalized||t.isInterleavedBufferAttribute){const e=new Float32Array(t.count*t.itemSize);for(let n=0,r=0;n<t.count;n++)e[r++]=t.getX(n),e[r++]=t.getY(n),t.itemSize>2&&(e[r++]=t.getZ(n));return e}return t.array instanceof Float32Array?t.array:new Float32Array(t.array)}const i=t.index?t.toNonIndexed():t,a=e.generateTangents(r(i.attributes.position),r(i.attributes.normal),r(i.attributes.uv));if(n)for(let t=3;t<a.length;t+=4)a[t]*=-1;return i.setAttribute("tangent",new Dn(a,4)),t!==i&&t.copy(i),t},computeMorphedAttributes:function(t){const e=new ae,n=new ae,r=new ae,i=new ae,a=new ae,o=new ae,s=new ae,A=new ae,l=new ae;function c(t,c,u,h,f,d,p,m){e.fromBufferAttribute(c,f),n.fromBufferAttribute(c,d),r.fromBufferAttribute(c,p);const g=t.morphTargetInfluences;if(u&&g){s.set(0,0,0),A.set(0,0,0),l.set(0,0,0);for(let t=0,c=u.length;t<c;t++){const c=g[t],m=u[t];0!==c&&(i.fromBufferAttribute(m,f),a.fromBufferAttribute(m,d),o.fromBufferAttribute(m,p),h?(s.addScaledVector(i,c),A.addScaledVector(a,c),l.addScaledVector(o,c)):(s.addScaledVector(i.sub(e),c),A.addScaledVector(a.sub(n),c),l.addScaledVector(o.sub(r),c)));}e.add(s),n.add(A),r.add(l);}t.isSkinnedMesh&&(t.applyBoneTransform(f,e),t.applyBoneTransform(d,n),t.applyBoneTransform(p,r)),m[3*f+0]=e.x,m[3*f+1]=e.y,m[3*f+2]=e.z,m[3*d+0]=n.x,m[3*d+1]=n.y,m[3*d+2]=n.z,m[3*p+0]=r.x,m[3*p+1]=r.y,m[3*p+2]=r.z;}const u=t.geometry,h=t.material;let f,d,p;const m=u.index,g=u.attributes.position,v=u.morphAttributes.position,_=u.morphTargetsRelative,y=u.attributes.normal,x=u.morphAttributes.position,b=u.groups,M=u.drawRange;let w,E,S,T,C,R,P;const L=new Float32Array(g.count*g.itemSize),D=new Float32Array(y.count*y.itemSize);if(null!==m)if(Array.isArray(h))for(w=0,S=b.length;w<S;w++)for(C=b[w],R=Math.max(C.start,M.start),P=Math.min(C.start+C.count,M.start+M.count),E=R,T=P;E<T;E+=3)f=m.getX(E),d=m.getX(E+1),p=m.getX(E+2),c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);else for(R=Math.max(0,M.start),P=Math.min(m.count,M.start+M.count),w=R,S=P;w<S;w+=3)f=m.getX(w),d=m.getX(w+1),p=m.getX(w+2),c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);else if(Array.isArray(h))for(w=0,S=b.length;w<S;w++)for(C=b[w],R=Math.max(C.start,M.start),P=Math.min(C.start+C.count,M.start+M.count),E=R,T=P;E<T;E+=3)f=E,d=E+1,p=E+2,c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);else for(R=Math.max(0,M.start),P=Math.min(g.count,M.start+M.count),w=R,S=P;w<S;w+=3)f=w,d=w+1,p=w+2,c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);return {positionAttribute:g,normalAttribute:y,morphedPositionAttribute:new qn(L,3),morphedNormalAttribute:new qn(D,3)}},deepCloneAttribute:function(t){return t.isInstancedInterleavedBufferAttribute||t.isInterleavedBufferAttribute?af(t):t.isInstancedBufferAttribute?(new wo).copy(t):(new Dn).copy(t)},deinterleaveAttribute:af,deinterleaveGeometry:function(t){const e=t.attributes,n=t.morphTargets,r=new Map;for(const t in e){const n=e[t];n.isInterleavedBufferAttribute&&(r.has(n)||r.set(n,af(n)),e[t]=r.get(n));}for(const t in n){const e=n[t];e.isInterleavedBufferAttribute&&(r.has(e)||r.set(e,af(e)),n[t]=r.get(e));}},estimateBytesUsed:function(t){let e=0;for(const n in t.attributes){const r=t.getAttribute(n);e+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT;}const n=t.getIndex();return e+=n?n.count*n.itemSize*n.array.BYTES_PER_ELEMENT:0,e},interleaveAttributes:function(t){let e,n=0,r=0;for(let i=0,a=t.length;i<a;++i){const a=t[i];if(void 0===e&&(e=a.array.constructor),e!==a.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;n+=a.array.length,r+=a.itemSize;}const i=new xo(new e(n),r);let a=0;const o=[],s=["getX","getY","getZ","getW"],A=["setX","setY","setZ","setW"];for(let e=0,n=t.length;e<n;e++){const n=t[e],r=n.itemSize,l=n.count,c=new Mo(i,r,a,n.normalized);o.push(c),a+=r;for(let t=0;t<l;t++)for(let e=0;e<r;e++)c[A[e]](t,n[s[e]](t));}return o},mergeAttributes:rf,mergeGeometries:function(t,e=!1){const n=null!==t[0].index,r=new Set(Object.keys(t[0].attributes)),i=new Set(Object.keys(t[0].morphAttributes)),a={},o={},s=t[0].morphTargetsRelative,A=new Hn;let l=0;for(let c=0;c<t.length;++c){const u=t[c];let h=0;if(n!==(null!==u.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const t in u.attributes){if(!r.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+'. All geometries must have compatible attributes; make sure "'+t+'" attribute exists among all geometries, or in none of them.'),null;void 0===a[t]&&(a[t]=[]),a[t].push(u.attributes[t]),h++;}if(h!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". Make sure all geometries have the same number of attributes."),null;if(s!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const t in u.morphAttributes){if(!i.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+".  .morphAttributes must be consistent throughout all geometries."),null;void 0===o[t]&&(o[t]=[]),o[t].push(u.morphAttributes[t]);}if(e){let t;if(n)t=u.index.count;else {if(void 0===u.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". The geometry must have either an index or a position attribute"),null;t=u.attributes.position.count;}A.addGroup(l,t,c),l+=t;}}if(n){let e=0;const n=[];for(let r=0;r<t.length;++r){const i=t[r].index;for(let t=0;t<i.count;++t)n.push(i.getX(t)+e);e+=t[r].attributes.position.count;}A.setIndex(n);}for(const t in a){const e=rf(a[t]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;A.setAttribute(t,e);}for(const t in o){const e=o[t][0].length;if(0===e)break;A.morphAttributes=A.morphAttributes||{},A.morphAttributes[t]=[];for(let n=0;n<e;++n){const e=[];for(let r=0;r<o[t].length;++r)e.push(o[t][r][n]);const r=rf(e);if(!r)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;A.morphAttributes[t].push(r);}}return A},mergeGroups:function(t){if(0===t.groups.length)return console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."),t;let e=t.groups;if(e=e.sort(((t,e)=>t.materialIndex!==e.materialIndex?t.materialIndex-e.materialIndex:t.start-e.start)),null===t.getIndex()){const e=t.getAttribute("position"),n=[];for(let t=0;t<e.count;t+=3)n.push(t,t+1,t+2);t.setIndex(n);}const n=t.getIndex(),r=[];for(let t=0;t<e.length;t++){const i=e[t],a=i.start,o=a+i.count;for(let t=a;t<o;t++)r.push(n.getX(t));}t.dispose(),t.setIndex(r);let i=0;for(let t=0;t<e.length;t++){const n=e[t];n.start=i,i+=n.count;}let a=e[0];t.groups=[a];for(let n=1;n<e.length;n++){const r=e[n];a.materialIndex===r.materialIndex?a.count+=r.count:(a=r,t.groups.push(a));}return t},mergeVertices:function(t,e=1e-4){e=Math.max(e,Number.EPSILON);const n={},r=t.getIndex(),i=t.getAttribute("position"),a=r?r.count:i.count;let o=0;const s=Object.keys(t.attributes),A={},l={},c=[],u=["getX","getY","getZ","getW"],h=["setX","setY","setZ","setW"];for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.attributes[n];A[n]=new Dn(new r.array.constructor(r.count*r.itemSize),r.itemSize,r.normalized);const i=t.morphAttributes[n];i&&(l[n]=new Dn(new i.array.constructor(i.count*i.itemSize),i.itemSize,i.normalized));}const f=.5*e,d=Math.log10(1/e),p=Math.pow(10,d),m=f*p;for(let e=0;e<a;e++){const i=r?r.getX(e):e;let a="";for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.getAttribute(n),o=r.itemSize;for(let t=0;t<o;t++)a+=~~(r[u[t]](i)*p+m)+",";}if(a in n)c.push(n[a]);else {for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.getAttribute(n),a=t.morphAttributes[n],c=r.itemSize,f=A[n],d=l[n];for(let t=0;t<c;t++){const e=u[t],n=h[t];if(f[n](o,r[e](i)),a)for(let t=0,r=a.length;t<r;t++)d[t][n](o,a[t][e](i));}}n[a]=o,c.push(o),o++;}}const g=t.clone();for(const e in t.attributes){const t=A[e];if(g.setAttribute(e,new Dn(t.array.slice(0,o*t.itemSize),t.itemSize,t.normalized)),e in l)for(let t=0;t<l[e].length;t++){const n=l[e][t];g.morphAttributes[e][t]=new Dn(n.array.slice(0,o*n.itemSize),n.itemSize,n.normalized);}}return g.setIndex(c),g},toCreasedNormals:function(t,e=Math.PI/3){const n=Math.cos(e),r=100*(1+1e-10),i=[new ae,new ae,new ae],a=new ae,o=new ae,s=new ae,A=new ae;function l(t){return `${~~(t.x*r)},${~~(t.y*r)},${~~(t.z*r)}`}const c=t.index?t.toNonIndexed():t,u=c.attributes.position,h={};for(let t=0,e=u.count/3;t<e;t++){const e=3*t,n=i[0].fromBufferAttribute(u,e+0),r=i[1].fromBufferAttribute(u,e+1),s=i[2].fromBufferAttribute(u,e+2);a.subVectors(s,r),o.subVectors(n,r);const A=(new ae).crossVectors(a,o).normalize();for(let t=0;t<3;t++){const e=l(i[t]);e in h||(h[e]=[]),h[e].push(A);}}const f=new Float32Array(3*u.count),d=new Dn(f,3,!1);for(let t=0,e=u.count/3;t<e;t++){const e=3*t,r=i[0].fromBufferAttribute(u,e+0),c=i[1].fromBufferAttribute(u,e+1),f=i[2].fromBufferAttribute(u,e+2);a.subVectors(f,c),o.subVectors(r,c),s.crossVectors(a,o).normalize();for(let t=0;t<3;t++){const r=h[l(i[t])];A.set(0,0,0);for(let t=0,e=r.length;t<e;t++){const e=r[t];s.dot(e)>n&&A.add(e);}A.normalize(),d.setXYZ(e+t,A.x,A.y,A.z);}}return c.setAttribute("normal",d),c},toTrianglesDrawMode:function(t,e){if(0===e)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(2===e||1===e){let n=t.getIndex();if(null===n){const e=[],r=t.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t<r.count;t++)e.push(t);t.setIndex(e),n=t.getIndex();}const r=n.count-2,i=[];if(2===e)for(let t=1;t<=r;t++)i.push(n.getX(0)),i.push(n.getX(t)),i.push(n.getX(t+1));else for(let t=0;t<r;t++)t%2==0?(i.push(n.getX(t)),i.push(n.getX(t+1)),i.push(n.getX(t+2))):(i.push(n.getX(t+2)),i.push(n.getX(t+1)),i.push(n.getX(t)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=t.clone();return a.setIndex(i),a.clearGroups(),a}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t}}),sf=function(t){return "function"==typeof t?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}};function Af(t,e,n){t.prototype=e.prototype=n,n.constructor=t;}function lf(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function cf(){}var uf=.7,hf=1/uf,ff="\\s*([+-]?\\d+)\\s*",df="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mf=/^#([0-9a-f]{3,8})$/,gf=new RegExp(`^rgb\\(${ff},${ff},${ff}\\)$`),vf=new RegExp(`^rgb\\(${pf},${pf},${pf}\\)$`),_f=new RegExp(`^rgba\\(${ff},${ff},${ff},${df}\\)$`),yf=new RegExp(`^rgba\\(${pf},${pf},${pf},${df}\\)$`),xf=new RegExp(`^hsl\\(${df},${pf},${pf}\\)$`),bf=new RegExp(`^hsla\\(${df},${pf},${pf},${df}\\)$`),Mf={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 wf(){return this.rgb().formatHex()}function Ef(){return this.rgb().formatRgb()}function Sf(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=mf.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Tf(e):3===n?new Pf(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Cf(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Cf(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=gf.exec(t))?new Pf(e[1],e[2],e[3],1):(e=vf.exec(t))?new Pf(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=_f.exec(t))?Cf(e[1],e[2],e[3],e[4]):(e=yf.exec(t))?Cf(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=xf.exec(t))?Uf(e[1],e[2]/100,e[3]/100,1):(e=bf.exec(t))?Uf(e[1],e[2]/100,e[3]/100,e[4]):Mf.hasOwnProperty(t)?Tf(Mf[t]):"transparent"===t?new Pf(NaN,NaN,NaN,0):null}function Tf(t){return new Pf(t>>16&255,t>>8&255,255&t,1)}function Cf(t,e,n,r){return r<=0&&(t=e=n=NaN),new Pf(t,e,n,r)}function Rf(t,e,n,r){return 1===arguments.length?((i=t)instanceof cf||(i=Sf(i)),i?new Pf((i=i.rgb()).r,i.g,i.b,i.opacity):new Pf):new Pf(t,e,n,null==r?1:r);var i;}function Pf(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r;}function Lf(){return `#${qf(this.r)}${qf(this.g)}${qf(this.b)}`}function Df(){const t=Of(this.opacity);return `${1===t?"rgb(":"rgba("}${If(this.r)}, ${If(this.g)}, ${If(this.b)}${1===t?")":`, ${t})`}`}function Of(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function If(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function qf(t){return ((t=If(t))<16?"0":"")+t.toString(16)}function Uf(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Bf(t,e,n,r)}function Nf(t){if(t instanceof Bf)return new Bf(t.h,t.s,t.l,t.opacity);if(t instanceof cf||(t=Sf(t)),!t)return new Bf;if(t instanceof Bf)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,A=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=A<.5?a+i:2-a-i,o*=60):s=A>0&&A<1?0:o,new Bf(o,s,A,t.opacity)}function Bf(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r;}function kf(t){return (t=(t||0)%360)<0?t+360:t}function Ff(t){return Math.max(0,Math.min(1,t||0))}function zf(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Gf(t){return Gf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(t)}Af(cf,Sf,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:wf,formatHex:wf,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Nf(this).formatHsl()},formatRgb:Ef,toString:Ef}),Af(Pf,Rf,lf(cf,{brighter(t){return t=null==t?hf:Math.pow(hf,t),new Pf(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?uf:Math.pow(uf,t),new Pf(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Pf(If(this.r),If(this.g),If(this.b),Of(this.opacity))},displayable(){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:Lf,formatHex:Lf,formatHex8:function(){return `#${qf(this.r)}${qf(this.g)}${qf(this.b)}${qf(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Df,toString:Df})),Af(Bf,(function(t,e,n,r){return 1===arguments.length?Nf(t):new Bf(t,e,n,null==r?1:r)}),lf(cf,{brighter(t){return t=null==t?hf:Math.pow(hf,t),new Bf(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?uf:Math.pow(uf,t),new Bf(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Pf(zf(t>=240?t-240:t+120,i,r),zf(t,i,r),zf(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Bf(kf(this.h),Ff(this.s),Ff(this.l),Of(this.opacity))},displayable(){return (0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Of(this.opacity);return `${1===t?"hsl(":"hsla("}${kf(this.h)}, ${100*Ff(this.s)}%, ${100*Ff(this.l)}%${1===t?")":`, ${t})`}`}}));var Hf=/^\s+/,jf=/\s+$/;function Vf(t,e){if(e=e||{},(t=t||"")instanceof Vf)return t;if(!(this instanceof Vf))return new Vf(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;"string"==typeof t&&(t=function(t){t=t.replace(Hf,"").replace(jf,"").toLowerCase();var e,n=!1;if(Ad[t])t=Ad[t],n=!0;else if("transparent"==t)return {r:0,g:0,b:0,a:0,format:"name"};if(e=xd.rgb.exec(t))return {r:e[1],g:e[2],b:e[3]};if(e=xd.rgba.exec(t))return {r:e[1],g:e[2],b:e[3],a:e[4]};if(e=xd.hsl.exec(t))return {h:e[1],s:e[2],l:e[3]};if(e=xd.hsla.exec(t))return {h:e[1],s:e[2],l:e[3],a:e[4]};if(e=xd.hsv.exec(t))return {h:e[1],s:e[2],v:e[3]};if(e=xd.hsva.exec(t))return {h:e[1],s:e[2],v:e[3],a:e[4]};if(e=xd.hex8.exec(t))return {r:fd(e[1]),g:fd(e[2]),b:fd(e[3]),a:gd(e[4]),format:n?"name":"hex8"};if(e=xd.hex6.exec(t))return {r:fd(e[1]),g:fd(e[2]),b:fd(e[3]),format:n?"name":"hex"};if(e=xd.hex4.exec(t))return {r:fd(e[1]+""+e[1]),g:fd(e[2]+""+e[2]),b:fd(e[3]+""+e[3]),a:gd(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=xd.hex3.exec(t))return {r:fd(e[1]+""+e[1]),g:fd(e[2]+""+e[2]),b:fd(e[3]+""+e[3]),format:n?"name":"hex"};return !1}(t));"object"==Gf(t)&&(bd(t.r)&&bd(t.g)&&bd(t.b)?(A=t.r,l=t.g,c=t.b,e={r:255*ud(A,255),g:255*ud(l,255),b:255*ud(c,255)},o=!0,s="%"===String(t.r).substr(-1)?"prgb":"rgb"):bd(t.h)&&bd(t.s)&&bd(t.v)?(r=pd(t.s),i=pd(t.v),e=function(t,e,n){t=6*ud(t,360),e=ud(e,100),n=ud(n,100);var r=Math.floor(t),i=t-r,a=n*(1-e),o=n*(1-i*e),s=n*(1-(1-i)*e),A=r%6,l=[n,o,a,a,s,n][A],c=[s,n,n,o,a,a][A],u=[a,a,s,n,n,o][A];return {r:255*l,g:255*c,b:255*u}}(t.h,r,i),o=!0,s="hsv"):bd(t.h)&&bd(t.s)&&bd(t.l)&&(r=pd(t.s),a=pd(t.l),e=function(t,e,n){var r,i,a;function o(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=ud(t,360),e=ud(e,100),n=ud(n,100),0===e)r=i=a=n;else {var s=n<.5?n*(1+e):n+e-n*e,A=2*n-s;r=o(A,s,t+1/3),i=o(A,s,t),a=o(A,s,t-1/3);}return {r:255*r,g:255*i,b:255*a}}(t.h,r,a),o=!0,s="hsl"),t.hasOwnProperty("a")&&(n=t.a));var A,l,c;return n=cd(n),{ok:o,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok;}function Wf(t,e,n){t=ud(t,255),e=ud(e,255),n=ud(n,255);var r,i,a=Math.max(t,e,n),o=Math.min(t,e,n),s=(a+o)/2;if(a==o)r=i=0;else {var A=a-o;switch(i=s>.5?A/(2-a-o):A/(a+o),a){case t:r=(e-n)/A+(e<n?6:0);break;case e:r=(n-t)/A+2;break;case n:r=(t-e)/A+4;}r/=6;}return {h:r,s:i,l:s}}function Xf(t,e,n){t=ud(t,255),e=ud(e,255),n=ud(n,255);var r,i,a=Math.max(t,e,n),o=Math.min(t,e,n),s=a,A=a-o;if(i=0===a?0:A/a,a==o)r=0;else {switch(a){case t:r=(e-n)/A+(e<n?6:0);break;case e:r=(n-t)/A+2;break;case n:r=(t-e)/A+4;}r/=6;}return {h:r,s:i,v:s}}function Qf(t,e,n,r){var i=[dd(Math.round(t).toString(16)),dd(Math.round(e).toString(16)),dd(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Yf(t,e,n,r){return [dd(md(r)),dd(Math.round(t).toString(16)),dd(Math.round(e).toString(16)),dd(Math.round(n).toString(16))].join("")}function Zf(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.s-=e/100,n.s=hd(n.s),Vf(n)}function Kf(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.s+=e/100,n.s=hd(n.s),Vf(n)}function Jf(t){return Vf(t).desaturate(100)}function $f(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.l+=e/100,n.l=hd(n.l),Vf(n)}function td(t,e){e=0===e?0:e||10;var n=Vf(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),Vf(n)}function ed(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.l-=e/100,n.l=hd(n.l),Vf(n)}function nd(t,e){var n=Vf(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,Vf(n)}function rd(t){var e=Vf(t).toHsl();return e.h=(e.h+180)%360,Vf(e)}function id(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Vf(t).toHsl(),r=[Vf(t)],i=360/e,a=1;a<e;a++)r.push(Vf({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function ad(t){var e=Vf(t).toHsl(),n=e.h;return [Vf(t),Vf({h:(n+72)%360,s:e.s,l:e.l}),Vf({h:(n+216)%360,s:e.s,l:e.l})]}function od(t,e,n){e=e||6,n=n||30;var r=Vf(t).toHsl(),i=360/n,a=[Vf(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,a.push(Vf(r));return a}function sd(t,e){e=e||6;for(var n=Vf(t).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/e;e--;)o.push(Vf({h:r,s:i,v:a})),a=(a+s)%1;return o}Vf.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return !this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return (299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=cd(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Xf(this._r,this._g,this._b);return {h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Xf(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=Wf(this._r,this._g,this._b);return {h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Wf(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return Qf(this._r,this._g,this._b,t)},toHexString:function(t){return "#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var a=[dd(Math.round(t).toString(16)),dd(Math.round(e).toString(16)),dd(Math.round(n).toString(16)),dd(md(r))];if(i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return "#"+this.toHex8(t)},toRgb:function(){return {r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return {r:Math.round(100*ud(this._r,255))+"%",g:Math.round(100*ud(this._g,255))+"%",b:Math.round(100*ud(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*ud(this._r,255))+"%, "+Math.round(100*ud(this._g,255))+"%, "+Math.round(100*ud(this._b,255))+"%)":"rgba("+Math.round(100*ud(this._r,255))+"%, "+Math.round(100*ud(this._g,255))+"%, "+Math.round(100*ud(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(ld[Qf(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+Yf(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=Vf(t);n="#"+Yf(i._r,i._g,i._b,i._a);}return "progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Vf(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification($f,arguments)},brighten:function(){return this._applyModification(td,arguments)},darken:function(){return this._applyModification(ed,arguments)},desaturate:function(){return this._applyModification(Zf,arguments)},saturate:function(){return this._applyModification(Kf,arguments)},greyscale:function(){return this._applyModification(Jf,arguments)},spin:function(){return this._applyModification(nd,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(od,arguments)},complement:function(){return this._applyCombination(rd,arguments)},monochromatic:function(){return this._applyCombination(sd,arguments)},splitcomplement:function(){return this._applyCombination(ad,arguments)},triad:function(){return this._applyCombination(id,[3])},tetrad:function(){return this._applyCombination(id,[4])}},Vf.fromRatio=function(t,e){if("object"==Gf(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:pd(t[r]));t=n;}return Vf(t,e)},Vf.equals=function(t,e){return !(!t||!e)&&Vf(t).toRgbString()==Vf(e).toRgbString()},Vf.random=function(){return Vf.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Vf.mix=function(t,e,n){n=0===n?0:n||50;var r=Vf(t).toRgb(),i=Vf(e).toRgb(),a=n/100;return Vf({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},
     2!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Globe=e()}(this,(function(){"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function r(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function a(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".scene-container .clickable {\n  cursor: pointer;\n}");const s="162",A={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},l=0,c=1,u=2,h=3,f=1,d=2,p=3,m=0,g=1,v=100,_=0,y=1,x=2,b=0,M=1,w=2,E=3,S=4,T=5,C=6,R=7,P=301,L=302,D=306,O=1e3,I=1001,q=1002,U=1003,N=1005,B=1006,k=1007,F=1008,z=1009,G=1012,H=1013,j=1014,V=1015,W=1016,X=1020,Q=1023,Y=1026,Z=1027,K=33776,J=33777,$=33778,tt=33779,et=36492,nt="",rt="srgb",it="srgb-linear",at="display-p3",ot="display-p3-linear",st="linear",At="srgb",lt="rec709",ct="p3",ut=7680,ht=35044,ft="300 es",dt=1035,pt=2e3,mt=2001;class gt{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,r=n.length;e<r;e++)n[e].call(this,t);t.target=null}}}const vt=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let _t=1234567;const yt=Math.PI/180,xt=180/Math.PI;function bt(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(vt[255&t]+vt[t>>8&255]+vt[t>>16&255]+vt[t>>24&255]+"-"+vt[255&e]+vt[e>>8&255]+"-"+vt[e>>16&15|64]+vt[e>>24&255]+"-"+vt[63&n|128]+vt[n>>8&255]+"-"+vt[n>>16&255]+vt[n>>24&255]+vt[255&r]+vt[r>>8&255]+vt[r>>16&255]+vt[r>>24&255]).toLowerCase()}function Mt(t,e,n){return Math.max(e,Math.min(n,t))}function wt(t,e){return(t%e+e)%e}function Et(t,e,n){return(1-n)*t+n*e}function St(t){return!(t&t-1)&&0!==t}function Tt(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Ct(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Rt(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const Pt={DEG2RAD:yt,RAD2DEG:xt,generateUUID:bt,clamp:Mt,euclideanModulo:wt,mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Et,damp:function(t,e,n,r){return Et(t,e,1-Math.exp(-n*r))},pingpong:function(t,e=1){return e-Math.abs(wt(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(_t=t);let e=_t+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*yt},radToDeg:function(t){return t*xt},isPowerOfTwo:St,ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:Tt,setQuaternionFromProperEuler:function(t,e,n,r,i){const a=Math.cos,o=Math.sin,s=a(n/2),A=o(n/2),l=a((e+r)/2),c=o((e+r)/2),u=a((e-r)/2),h=o((e-r)/2),f=a((r-e)/2),d=o((r-e)/2);switch(i){case"XYX":t.set(s*c,A*u,A*h,s*l);break;case"YZY":t.set(A*h,s*c,A*u,s*l);break;case"ZXZ":t.set(A*u,A*h,s*c,s*l);break;case"XZX":t.set(s*c,A*d,A*f,s*l);break;case"YXY":t.set(A*f,s*c,A*d,s*l);break;case"ZYZ":t.set(A*d,A*f,s*c,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:Rt,denormalize:Ct};class Lt{constructor(t=0,e=0){Lt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Mt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,a=this.y-t.y;return this.x=i*n-a*r+t.x,this.y=i*r+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Dt{constructor(t,e,n,r,i,a,o,s,A){Dt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,r,i,a,o,s,A)}set(t,e,n,r,i,a,o,s,A){const l=this.elements;return l[0]=t,l[1]=r,l[2]=o,l[3]=e,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=A,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[3],s=n[6],A=n[1],l=n[4],c=n[7],u=n[2],h=n[5],f=n[8],d=r[0],p=r[3],m=r[6],g=r[1],v=r[4],_=r[7],y=r[2],x=r[5],b=r[8];return i[0]=a*d+o*g+s*y,i[3]=a*p+o*v+s*x,i[6]=a*m+o*_+s*b,i[1]=A*d+l*g+c*y,i[4]=A*p+l*v+c*x,i[7]=A*m+l*_+c*b,i[2]=u*d+h*g+f*y,i[5]=u*p+h*v+f*x,i[8]=u*m+h*_+f*b,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8];return e*a*l-e*o*A-n*i*l+n*o*s+r*i*A-r*a*s}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8],c=l*a-o*A,u=o*s-l*i,h=A*i-a*s,f=e*c+n*u+r*h;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const d=1/f;return t[0]=c*d,t[1]=(r*A-l*n)*d,t[2]=(o*n-r*a)*d,t[3]=u*d,t[4]=(l*e-r*s)*d,t[5]=(r*i-o*e)*d,t[6]=h*d,t[7]=(n*s-A*e)*d,t[8]=(a*e-n*i)*d,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,i,a,o){const s=Math.cos(i),A=Math.sin(i);return this.set(n*s,n*A,-n*(s*a+A*o)+a+t,-r*A,r*s,-r*(-A*a+s*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Ot.makeScale(t,e)),this}rotate(t){return this.premultiply(Ot.makeRotation(-t)),this}translate(t,e){return this.premultiply(Ot.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const Ot=new Dt;function It(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function qt(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Ut(){const t=qt("canvas");return t.style.display="block",t}const Nt={};function Bt(t){t in Nt||(Nt[t]=!0,console.warn(t))}const kt=(new Dt).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Ft=(new Dt).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),zt={[it]:{transfer:st,primaries:lt,toReference:t=>t,fromReference:t=>t},[rt]:{transfer:At,primaries:lt,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[ot]:{transfer:st,primaries:ct,toReference:t=>t.applyMatrix3(Ft),fromReference:t=>t.applyMatrix3(kt)},[at]:{transfer:At,primaries:ct,toReference:t=>t.convertSRGBToLinear().applyMatrix3(Ft),fromReference:t=>t.applyMatrix3(kt).convertLinearToSRGB()}},Gt=new Set([it,ot]),Ht={enabled:!0,_workingColorSpace:it,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!Gt.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const r=zt[e].toReference;return(0,zt[n].fromReference)(r(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return zt[t].primaries},getTransfer:function(t){return t===nt?st:zt[t].transfer}};function jt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Vt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let Wt;class Xt{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Wt&&(Wt=qt("canvas")),Wt.width=t.width,Wt.height=t.height;const n=Wt.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Wt}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=qt("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height),i=r.data;for(let t=0;t<i.length;t++)i[t]=255*jt(i[t]/255);return n.putImageData(r,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*jt(e[t]/255)):e[t]=jt(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let Qt=0;class Yt{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Qt++}),this.uuid=bt(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let t;if(Array.isArray(r)){t=[];for(let e=0,n=r.length;e<n;e++)r[e].isDataTexture?t.push(Zt(r[e].image)):t.push(Zt(r[e]))}else t=Zt(r);n.url=t}return e||(t.images[this.uuid]=n),n}}function Zt(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Xt.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Kt=0;class Jt extends gt{constructor(t=Jt.DEFAULT_IMAGE,e=Jt.DEFAULT_MAPPING,n=1001,r=1001,i=1006,a=1008,o=1023,s=1009,A=Jt.DEFAULT_ANISOTROPY,l=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Kt++}),this.uuid=bt(),this.name="",this.source=new Yt(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=A,this.format=o,this.internalFormat=null,this.type=s,this.offset=new Lt(0,0),this.repeat=new Lt(1,1),this.center=new Lt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=l,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case O:t.x=t.x-Math.floor(t.x);break;case I:t.x=t.x<0?0:1;break;case q:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case O:t.y=t.y-Math.floor(t.y);break;case I:t.y=t.y<0?0:1;break;case q:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}}Jt.DEFAULT_IMAGE=null,Jt.DEFAULT_MAPPING=300,Jt.DEFAULT_ANISOTROPY=1;class $t{constructor(t=0,e=0,n=0,r=1){$t.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*e+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*e+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*e+a[7]*n+a[11]*r+a[15]*i,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,i;const a=.01,o=.1,s=t.elements,A=s[0],l=s[4],c=s[8],u=s[1],h=s[5],f=s[9],d=s[2],p=s[6],m=s[10];if(Math.abs(l-u)<a&&Math.abs(c-d)<a&&Math.abs(f-p)<a){if(Math.abs(l+u)<o&&Math.abs(c+d)<o&&Math.abs(f+p)<o&&Math.abs(A+h+m-3)<o)return this.set(1,0,0,0),this;e=Math.PI;const t=(A+1)/2,s=(h+1)/2,g=(m+1)/2,v=(l+u)/4,_=(c+d)/4,y=(f+p)/4;return t>s&&t>g?t<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(t),r=v/n,i=_/n):s>g?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=y/r):g<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(g),n=_/i,r=y/i),this.set(n,r,i,e),this}let g=Math.sqrt((p-f)*(p-f)+(c-d)*(c-d)+(u-l)*(u-l));return Math.abs(g)<.001&&(g=1),this.x=(p-f)/g,this.y=(c-d)/g,this.z=(u-l)/g,this.w=Math.acos((A+h+m-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class te extends gt{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new $t(0,0,t,e),this.scissorTest=!1,this.viewport=new $t(0,0,t,e);const r={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:B,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},n);const i=new Jt(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);i.flipY=!1,i.generateMipmaps=n.generateMipmaps,i.internalFormat=n.internalFormat,this.textures=[];const a=n.count;for(let t=0;t<a;t++)this.textures[t]=i.clone(),this.textures[t].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,n=t.textures.length;e<n;e++)this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new Yt(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ee extends te{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}}class ne extends Jt{constructor(t=null,e=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=U,this.minFilter=U,this.wrapR=I,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class re extends Jt{constructor(t=null,e=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=U,this.minFilter=U,this.wrapR=I,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ie{constructor(t=0,e=0,n=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=r}static slerpFlat(t,e,n,r,i,a,o){let s=n[r+0],A=n[r+1],l=n[r+2],c=n[r+3];const u=i[a+0],h=i[a+1],f=i[a+2],d=i[a+3];if(0===o)return t[e+0]=s,t[e+1]=A,t[e+2]=l,void(t[e+3]=c);if(1===o)return t[e+0]=u,t[e+1]=h,t[e+2]=f,void(t[e+3]=d);if(c!==d||s!==u||A!==h||l!==f){let t=1-o;const e=s*u+A*h+l*f+c*d,n=e>=0?1:-1,r=1-e*e;if(r>Number.EPSILON){const i=Math.sqrt(r),a=Math.atan2(i,e*n);t=Math.sin(t*a)/i,o=Math.sin(o*a)/i}const i=o*n;if(s=s*t+u*i,A=A*t+h*i,l=l*t+f*i,c=c*t+d*i,t===1-o){const t=1/Math.sqrt(s*s+A*A+l*l+c*c);s*=t,A*=t,l*=t,c*=t}}t[e]=s,t[e+1]=A,t[e+2]=l,t[e+3]=c}static multiplyQuaternionsFlat(t,e,n,r,i,a){const o=n[r],s=n[r+1],A=n[r+2],l=n[r+3],c=i[a],u=i[a+1],h=i[a+2],f=i[a+3];return t[e]=o*f+l*c+s*h-A*u,t[e+1]=s*f+l*u+A*c-o*h,t[e+2]=A*f+l*h+o*u-s*c,t[e+3]=l*f-o*c-s*u-A*h,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,r=t._y,i=t._z,a=t._order,o=Math.cos,s=Math.sin,A=o(n/2),l=o(r/2),c=o(i/2),u=s(n/2),h=s(r/2),f=s(i/2);switch(a){case"XYZ":this._x=u*l*c+A*h*f,this._y=A*h*c-u*l*f,this._z=A*l*f+u*h*c,this._w=A*l*c-u*h*f;break;case"YXZ":this._x=u*l*c+A*h*f,this._y=A*h*c-u*l*f,this._z=A*l*f-u*h*c,this._w=A*l*c+u*h*f;break;case"ZXY":this._x=u*l*c-A*h*f,this._y=A*h*c+u*l*f,this._z=A*l*f+u*h*c,this._w=A*l*c-u*h*f;break;case"ZYX":this._x=u*l*c-A*h*f,this._y=A*h*c+u*l*f,this._z=A*l*f-u*h*c,this._w=A*l*c+u*h*f;break;case"YZX":this._x=u*l*c+A*h*f,this._y=A*h*c+u*l*f,this._z=A*l*f-u*h*c,this._w=A*l*c-u*h*f;break;case"XZY":this._x=u*l*c-A*h*f,this._y=A*h*c-u*l*f,this._z=A*l*f+u*h*c,this._w=A*l*c+u*h*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],i=e[8],a=e[1],o=e[5],s=e[9],A=e[2],l=e[6],c=e[10],u=n+o+c;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(l-s)*t,this._y=(i-A)*t,this._z=(a-r)*t}else if(n>o&&n>c){const t=2*Math.sqrt(1+n-o-c);this._w=(l-s)/t,this._x=.25*t,this._y=(r+a)/t,this._z=(i+A)/t}else if(o>c){const t=2*Math.sqrt(1+o-n-c);this._w=(i-A)/t,this._x=(r+a)/t,this._y=.25*t,this._z=(s+l)/t}else{const t=2*Math.sqrt(1+c-n-o);this._w=(a-r)/t,this._x=(i+A)/t,this._y=(s+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Mt(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,i=t._z,a=t._w,o=e._x,s=e._y,A=e._z,l=e._w;return this._x=n*l+a*o+r*A-i*s,this._y=r*l+a*s+i*o-n*A,this._z=i*l+a*A+n*s-r*o,this._w=a*l-n*o-r*s-i*A,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,r=this._y,i=this._z,a=this._w;let o=a*t._w+n*t._x+r*t._y+i*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;const s=1-o*o;if(s<=Number.EPSILON){const t=1-e;return this._w=t*a+e*this._w,this._x=t*n+e*this._x,this._y=t*r+e*this._y,this._z=t*i+e*this._z,this.normalize(),this}const A=Math.sqrt(s),l=Math.atan2(A,o),c=Math.sin((1-e)*l)/A,u=Math.sin(e*l)/A;return this._w=a*c+this._w*u,this._x=n*c+this._x*u,this._y=r*c+this._y*u,this._z=i*c+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(t),r*Math.cos(t),i*Math.sin(e),i*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ae{constructor(t=0,e=0,n=0){ae.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(se.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(se.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=t.elements,a=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,i=t.x,a=t.y,o=t.z,s=t.w,A=2*(a*r-o*n),l=2*(o*e-i*r),c=2*(i*n-a*e);return this.x=e+s*A+a*c-o*l,this.y=n+s*l+o*A-i*c,this.z=r+s*c+i*l-a*A,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,i=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return oe.copy(this).projectOnVector(t),this.sub(oe)}reflect(t){return this.sub(oe.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Mt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const oe=new ae,se=new ie;class Ae{constructor(t=new ae(1/0,1/0,1/0),e=new ae(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(ce.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(ce.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=ce.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n){const r=n.getAttribute("position");if(!0===e&&void 0!==r&&!0!==t.isInstancedMesh)for(let e=0,n=r.count;e<n;e++)!0===t.isMesh?t.getVertexPosition(e,ce):ce.fromBufferAttribute(r,e),ce.applyMatrix4(t.matrixWorld),this.expandByPoint(ce);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),ue.copy(t.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),ue.copy(n.boundingBox)),ue.applyMatrix4(t.matrixWorld),this.union(ue)}const r=t.children;for(let t=0,n=r.length;t<n;t++)this.expandByObject(r[t],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,ce),ce.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ve),_e.subVectors(this.max,ve),he.subVectors(t.a,ve),fe.subVectors(t.b,ve),de.subVectors(t.c,ve),pe.subVectors(fe,he),me.subVectors(de,fe),ge.subVectors(he,de);let e=[0,-pe.z,pe.y,0,-me.z,me.y,0,-ge.z,ge.y,pe.z,0,-pe.x,me.z,0,-me.x,ge.z,0,-ge.x,-pe.y,pe.x,0,-me.y,me.x,0,-ge.y,ge.x,0];return!!be(e,he,fe,de,_e)&&(e=[1,0,0,0,1,0,0,0,1],!!be(e,he,fe,de,_e)&&(ye.crossVectors(pe,me),e=[ye.x,ye.y,ye.z],be(e,he,fe,de,_e)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,ce).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(ce).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(le[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),le[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),le[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),le[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),le[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),le[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),le[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),le[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(le)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const le=[new ae,new ae,new ae,new ae,new ae,new ae,new ae,new ae],ce=new ae,ue=new Ae,he=new ae,fe=new ae,de=new ae,pe=new ae,me=new ae,ge=new ae,ve=new ae,_e=new ae,ye=new ae,xe=new ae;function be(t,e,n,r,i){for(let a=0,o=t.length-3;a<=o;a+=3){xe.fromArray(t,a);const o=i.x*Math.abs(xe.x)+i.y*Math.abs(xe.y)+i.z*Math.abs(xe.z),s=e.dot(xe),A=n.dot(xe),l=r.dot(xe);if(Math.max(-Math.max(s,A,l),Math.min(s,A,l))>o)return!1}return!0}const Me=new Ae,we=new ae,Ee=new ae;class Se{constructor(t=new ae,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):Me.setFromPoints(t).getCenter(n);let r=0;for(let e=0,i=t.length;e<i;e++)r=Math.max(r,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;we.subVectors(t,this.center);const e=we.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(we,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(Ee.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(we.copy(t.center).add(Ee)),this.expandByPoint(we.copy(t.center).sub(Ee))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Te=new ae,Ce=new ae,Re=new ae,Pe=new ae,Le=new ae,De=new ae,Oe=new ae;class Ie{constructor(t=new ae,e=new ae(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Te)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Te.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Te.copy(this.origin).addScaledVector(this.direction,e),Te.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){Ce.copy(t).add(e).multiplyScalar(.5),Re.copy(e).sub(t).normalize(),Pe.copy(this.origin).sub(Ce);const i=.5*t.distanceTo(e),a=-this.direction.dot(Re),o=Pe.dot(this.direction),s=-Pe.dot(Re),A=Pe.lengthSq(),l=Math.abs(1-a*a);let c,u,h,f;if(l>0)if(c=a*s-o,u=a*o-s,f=i*l,c>=0)if(u>=-f)if(u<=f){const t=1/l;c*=t,u*=t,h=c*(c+a*u+2*o)+u*(a*c+u+2*s)+A}else u=i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;else u=-i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;else u<=-f?(c=Math.max(0,-(-a*i+o)),u=c>0?-i:Math.min(Math.max(-i,-s),i),h=-c*c+u*(u+2*s)+A):u<=f?(c=0,u=Math.min(Math.max(-i,-s),i),h=u*(u+2*s)+A):(c=Math.max(0,-(a*i+o)),u=c>0?i:Math.min(Math.max(-i,-s),i),h=-c*c+u*(u+2*s)+A);else u=a>0?-i:i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;return n&&n.copy(this.origin).addScaledVector(this.direction,c),r&&r.copy(Ce).addScaledVector(Re,u),h}intersectSphere(t,e){Te.subVectors(t.center,this.origin);const n=Te.dot(this.direction),r=Te.dot(Te)-n*n,i=t.radius*t.radius;if(r>i)return null;const a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,i,a,o,s;const A=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,u=this.origin;return A>=0?(n=(t.min.x-u.x)*A,r=(t.max.x-u.x)*A):(n=(t.max.x-u.x)*A,r=(t.min.x-u.x)*A),l>=0?(i=(t.min.y-u.y)*l,a=(t.max.y-u.y)*l):(i=(t.max.y-u.y)*l,a=(t.min.y-u.y)*l),n>a||i>r?null:((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),c>=0?(o=(t.min.z-u.z)*c,s=(t.max.z-u.z)*c):(o=(t.max.z-u.z)*c,s=(t.min.z-u.z)*c),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,e)))}intersectsBox(t){return null!==this.intersectBox(t,Te)}intersectTriangle(t,e,n,r,i){Le.subVectors(e,t),De.subVectors(n,t),Oe.crossVectors(Le,De);let a,o=this.direction.dot(Oe);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Pe.subVectors(this.origin,t);const s=a*this.direction.dot(De.crossVectors(Pe,De));if(s<0)return null;const A=a*this.direction.dot(Le.cross(Pe));if(A<0)return null;if(s+A>o)return null;const l=-a*Pe.dot(Oe);return l<0?null:this.at(l/o,i)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class qe{constructor(t,e,n,r,i,a,o,s,A,l,c,u,h,f,d,p){qe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,r,i,a,o,s,A,l,c,u,h,f,d,p)}set(t,e,n,r,i,a,o,s,A,l,c,u,h,f,d,p){const m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=r,m[1]=i,m[5]=a,m[9]=o,m[13]=s,m[2]=A,m[6]=l,m[10]=c,m[14]=u,m[3]=h,m[7]=f,m[11]=d,m[15]=p,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new qe).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/Ue.setFromMatrixColumn(t,0).length(),i=1/Ue.setFromMatrixColumn(t,1).length(),a=1/Ue.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,r=t.y,i=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),A=Math.sin(r),l=Math.cos(i),c=Math.sin(i);if("XYZ"===t.order){const t=a*l,n=a*c,r=o*l,i=o*c;e[0]=s*l,e[4]=-s*c,e[8]=A,e[1]=n+r*A,e[5]=t-i*A,e[9]=-o*s,e[2]=i-t*A,e[6]=r+n*A,e[10]=a*s}else if("YXZ"===t.order){const t=s*l,n=s*c,r=A*l,i=A*c;e[0]=t+i*o,e[4]=r*o-n,e[8]=a*A,e[1]=a*c,e[5]=a*l,e[9]=-o,e[2]=n*o-r,e[6]=i+t*o,e[10]=a*s}else if("ZXY"===t.order){const t=s*l,n=s*c,r=A*l,i=A*c;e[0]=t-i*o,e[4]=-a*c,e[8]=r+n*o,e[1]=n+r*o,e[5]=a*l,e[9]=i-t*o,e[2]=-a*A,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){const t=a*l,n=a*c,r=o*l,i=o*c;e[0]=s*l,e[4]=r*A-n,e[8]=t*A+i,e[1]=s*c,e[5]=i*A+t,e[9]=n*A-r,e[2]=-A,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){const t=a*s,n=a*A,r=o*s,i=o*A;e[0]=s*l,e[4]=i-t*c,e[8]=r*c+n,e[1]=c,e[5]=a*l,e[9]=-o*l,e[2]=-A*l,e[6]=n*c+r,e[10]=t-i*c}else if("XZY"===t.order){const t=a*s,n=a*A,r=o*s,i=o*A;e[0]=s*l,e[4]=-c,e[8]=A*l,e[1]=t*c+i,e[5]=a*l,e[9]=n*c-r,e[2]=r*c-n,e[6]=o*l,e[10]=i*c+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Be,t,ke)}lookAt(t,e,n){const r=this.elements;return Ge.subVectors(t,e),0===Ge.lengthSq()&&(Ge.z=1),Ge.normalize(),Fe.crossVectors(n,Ge),0===Fe.lengthSq()&&(1===Math.abs(n.z)?Ge.x+=1e-4:Ge.z+=1e-4,Ge.normalize(),Fe.crossVectors(n,Ge)),Fe.normalize(),ze.crossVectors(Ge,Fe),r[0]=Fe.x,r[4]=ze.x,r[8]=Ge.x,r[1]=Fe.y,r[5]=ze.y,r[9]=Ge.y,r[2]=Fe.z,r[6]=ze.z,r[10]=Ge.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,a=n[0],o=n[4],s=n[8],A=n[12],l=n[1],c=n[5],u=n[9],h=n[13],f=n[2],d=n[6],p=n[10],m=n[14],g=n[3],v=n[7],_=n[11],y=n[15],x=r[0],b=r[4],M=r[8],w=r[12],E=r[1],S=r[5],T=r[9],C=r[13],R=r[2],P=r[6],L=r[10],D=r[14],O=r[3],I=r[7],q=r[11],U=r[15];return i[0]=a*x+o*E+s*R+A*O,i[4]=a*b+o*S+s*P+A*I,i[8]=a*M+o*T+s*L+A*q,i[12]=a*w+o*C+s*D+A*U,i[1]=l*x+c*E+u*R+h*O,i[5]=l*b+c*S+u*P+h*I,i[9]=l*M+c*T+u*L+h*q,i[13]=l*w+c*C+u*D+h*U,i[2]=f*x+d*E+p*R+m*O,i[6]=f*b+d*S+p*P+m*I,i[10]=f*M+d*T+p*L+m*q,i[14]=f*w+d*C+p*D+m*U,i[3]=g*x+v*E+_*R+y*O,i[7]=g*b+v*S+_*P+y*I,i[11]=g*M+v*T+_*L+y*q,i[15]=g*w+v*C+_*D+y*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],a=t[1],o=t[5],s=t[9],A=t[13],l=t[2],c=t[6],u=t[10],h=t[14];return t[3]*(+i*s*c-r*A*c-i*o*u+n*A*u+r*o*h-n*s*h)+t[7]*(+e*s*h-e*A*u+i*a*u-r*a*h+r*A*l-i*s*l)+t[11]*(+e*A*c-e*o*h-i*a*c+n*a*h+i*o*l-n*A*l)+t[15]*(-r*o*l-e*s*c+e*o*u+r*a*c-n*a*u+n*s*l)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8],c=t[9],u=t[10],h=t[11],f=t[12],d=t[13],p=t[14],m=t[15],g=c*p*A-d*u*A+d*s*h-o*p*h-c*s*m+o*u*m,v=f*u*A-l*p*A-f*s*h+a*p*h+l*s*m-a*u*m,_=l*d*A-f*c*A+f*o*h-a*d*h-l*o*m+a*c*m,y=f*c*s-l*d*s-f*o*u+a*d*u+l*o*p-a*c*p,x=e*g+n*v+r*_+i*y;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/x;return t[0]=g*b,t[1]=(d*u*i-c*p*i-d*r*h+n*p*h+c*r*m-n*u*m)*b,t[2]=(o*p*i-d*s*i+d*r*A-n*p*A-o*r*m+n*s*m)*b,t[3]=(c*s*i-o*u*i-c*r*A+n*u*A+o*r*h-n*s*h)*b,t[4]=v*b,t[5]=(l*p*i-f*u*i+f*r*h-e*p*h-l*r*m+e*u*m)*b,t[6]=(f*s*i-a*p*i-f*r*A+e*p*A+a*r*m-e*s*m)*b,t[7]=(a*u*i-l*s*i+l*r*A-e*u*A-a*r*h+e*s*h)*b,t[8]=_*b,t[9]=(f*c*i-l*d*i-f*n*h+e*d*h+l*n*m-e*c*m)*b,t[10]=(a*d*i-f*o*i+f*n*A-e*d*A-a*n*m+e*o*m)*b,t[11]=(l*o*i-a*c*i-l*n*A+e*c*A+a*n*h-e*o*h)*b,t[12]=y*b,t[13]=(l*d*r-f*c*r+f*n*u-e*d*u-l*n*p+e*c*p)*b,t[14]=(f*o*r-a*d*r-f*n*s+e*d*s+a*n*p-e*o*p)*b,t[15]=(a*c*r-l*o*r+l*n*s-e*c*s-a*n*u+e*o*u)*b,this}scale(t){const e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),i=1-n,a=t.x,o=t.y,s=t.z,A=i*a,l=i*o;return this.set(A*a+n,A*o-r*s,A*s+r*o,0,A*o+r*s,l*o+n,l*s-r*a,0,A*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,i,a){return this.set(1,n,i,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,i=e._x,a=e._y,o=e._z,s=e._w,A=i+i,l=a+a,c=o+o,u=i*A,h=i*l,f=i*c,d=a*l,p=a*c,m=o*c,g=s*A,v=s*l,_=s*c,y=n.x,x=n.y,b=n.z;return r[0]=(1-(d+m))*y,r[1]=(h+_)*y,r[2]=(f-v)*y,r[3]=0,r[4]=(h-_)*x,r[5]=(1-(u+m))*x,r[6]=(p+g)*x,r[7]=0,r[8]=(f+v)*b,r[9]=(p-g)*b,r[10]=(1-(u+d))*b,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let i=Ue.set(r[0],r[1],r[2]).length();const a=Ue.set(r[4],r[5],r[6]).length(),o=Ue.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],Ne.copy(this);const s=1/i,A=1/a,l=1/o;return Ne.elements[0]*=s,Ne.elements[1]*=s,Ne.elements[2]*=s,Ne.elements[4]*=A,Ne.elements[5]*=A,Ne.elements[6]*=A,Ne.elements[8]*=l,Ne.elements[9]*=l,Ne.elements[10]*=l,e.setFromRotationMatrix(Ne),n.x=i,n.y=a,n.z=o,this}makePerspective(t,e,n,r,i,a,o=2e3){const s=this.elements,A=2*i/(e-t),l=2*i/(n-r),c=(e+t)/(e-t),u=(n+r)/(n-r);let h,f;if(o===pt)h=-(a+i)/(a-i),f=-2*a*i/(a-i);else{if(o!==mt)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);h=-a/(a-i),f=-a*i/(a-i)}return s[0]=A,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=u,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=f,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(t,e,n,r,i,a,o=2e3){const s=this.elements,A=1/(e-t),l=1/(n-r),c=1/(a-i),u=(e+t)*A,h=(n+r)*l;let f,d;if(o===pt)f=(a+i)*c,d=-2*c;else{if(o!==mt)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);f=i*c,d=-1*c}return s[0]=2*A,s[4]=0,s[8]=0,s[12]=-u,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=d,s[14]=-f,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const Ue=new ae,Ne=new qe,Be=new ae(0,0,0),ke=new ae(1,1,1),Fe=new ae,ze=new ae,Ge=new ae,He=new qe,je=new ie;class Ve{constructor(t=0,e=0,n=0,r=Ve.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,r=this._order){return this._x=t,this._y=e,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const r=t.elements,i=r[0],a=r[4],o=r[8],s=r[1],A=r[5],l=r[9],c=r[2],u=r[6],h=r[10];switch(e){case"XYZ":this._y=Math.asin(Mt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,h),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(u,A),this._z=0);break;case"YXZ":this._x=Math.asin(-Mt(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,h),this._z=Math.atan2(s,A)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(Mt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-c,h),this._z=Math.atan2(-a,A)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-Mt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(u,h),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,A));break;case"YZX":this._z=Math.asin(Mt(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,A),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(o,h));break;case"XZY":this._z=Math.asin(-Mt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(u,A),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return He.makeRotationFromQuaternion(t),this.setFromRotationMatrix(He,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return je.setFromEuler(this),this.setFromQuaternion(je,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ve.DEFAULT_ORDER="XYZ";class We{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return!!(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}}let Xe=0;const Qe=new ae,Ye=new ie,Ze=new qe,Ke=new ae,Je=new ae,$e=new ae,tn=new ie,en=new ae(1,0,0),nn=new ae(0,1,0),rn=new ae(0,0,1),an={type:"added"},on={type:"removed"},sn={type:"childadded",child:null},An={type:"childremoved",child:null};class ln extends gt{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Xe++}),this.uuid=bt(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ln.DEFAULT_UP.clone();const t=new ae,e=new Ve,n=new ie,r=new ae(1,1,1);e._onChange((function(){n.setFromEuler(e,!1)})),n._onChange((function(){e.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new qe},normalMatrix:{value:new Dt}}),this.matrix=new qe,this.matrixWorld=new qe,this.matrixAutoUpdate=ln.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=ln.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new We,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Ye.setFromAxisAngle(t,e),this.quaternion.multiply(Ye),this}rotateOnWorldAxis(t,e){return Ye.setFromAxisAngle(t,e),this.quaternion.premultiply(Ye),this}rotateX(t){return this.rotateOnAxis(en,t)}rotateY(t){return this.rotateOnAxis(nn,t)}rotateZ(t){return this.rotateOnAxis(rn,t)}translateOnAxis(t,e){return Qe.copy(t).applyQuaternion(this.quaternion),this.position.add(Qe.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(en,t)}translateY(t){return this.translateOnAxis(nn,t)}translateZ(t){return this.translateOnAxis(rn,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ze.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Ke.copy(t):Ke.set(t,e,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Je.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ze.lookAt(Je,Ke,this.up):Ze.lookAt(Ke,Je,this.up),this.quaternion.setFromRotationMatrix(Ze),r&&(Ze.extractRotation(r.matrixWorld),Ye.setFromRotationMatrix(Ze),this.quaternion.premultiply(Ye.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(an),sn.child=t,this.dispatchEvent(sn),sn.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(on),An.child=t,this.dispatchEvent(An),An.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Ze.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Ze.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ze),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Je,t,$e),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Je,tn,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,r=e.length;n<r;n++){const r=e[n];!0!==r.matrixWorldAutoUpdate&&!0!==t||r.updateMatrixWorld(t)}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),null!==this.boundingBox&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,r=n.length;e<r;e++){const r=n[e];i(t.shapes,r)}else i(t.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,r=this.material.length;n<r;n++)e.push(i(t.materials,this.material[n]));r.material=e}else r.material=i(t.materials,this.material);if(this.children.length>0){r.children=[];for(let e=0;e<this.children.length;e++)r.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];r.animations.push(i(t.animations,n))}}if(e){const e=a(t.geometries),r=a(t.materials),i=a(t.textures),o=a(t.images),s=a(t.shapes),A=a(t.skeletons),l=a(t.animations),c=a(t.nodes);e.length>0&&(n.geometries=e),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),A.length>0&&(n.skeletons=A),l.length>0&&(n.animations=l),c.length>0&&(n.nodes=c)}return n.object=r,n;function a(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}return this}}ln.DEFAULT_UP=new ae(0,1,0),ln.DEFAULT_MATRIX_AUTO_UPDATE=!0,ln.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const cn=new ae,un=new ae,hn=new ae,fn=new ae,dn=new ae,pn=new ae,mn=new ae,gn=new ae,vn=new ae,_n=new ae;class yn{constructor(t=new ae,e=new ae,n=new ae){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,r){r.subVectors(n,e),cn.subVectors(t,e),r.cross(cn);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(t,e,n,r,i){cn.subVectors(r,e),un.subVectors(n,e),hn.subVectors(t,e);const a=cn.dot(cn),o=cn.dot(un),s=cn.dot(hn),A=un.dot(un),l=un.dot(hn),c=a*A-o*o;if(0===c)return i.set(0,0,0),null;const u=1/c,h=(A*s-o*l)*u,f=(a*l-o*s)*u;return i.set(1-h-f,f,h)}static containsPoint(t,e,n,r){return null!==this.getBarycoord(t,e,n,r,fn)&&(fn.x>=0&&fn.y>=0&&fn.x+fn.y<=1)}static getInterpolation(t,e,n,r,i,a,o,s){return null===this.getBarycoord(t,e,n,r,fn)?(s.x=0,s.y=0,"z"in s&&(s.z=0),"w"in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,fn.x),s.addScaledVector(a,fn.y),s.addScaledVector(o,fn.z),s)}static isFrontFacing(t,e,n,r){return cn.subVectors(n,e),un.subVectors(t,e),cn.cross(un).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,n,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,r),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return cn.subVectors(this.c,this.b),un.subVectors(this.a,this.b),.5*cn.cross(un).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return yn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return yn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,r,i){return yn.getInterpolation(t,this.a,this.b,this.c,e,n,r,i)}containsPoint(t){return yn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return yn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,r=this.b,i=this.c;let a,o;dn.subVectors(r,n),pn.subVectors(i,n),gn.subVectors(t,n);const s=dn.dot(gn),A=pn.dot(gn);if(s<=0&&A<=0)return e.copy(n);vn.subVectors(t,r);const l=dn.dot(vn),c=pn.dot(vn);if(l>=0&&c<=l)return e.copy(r);const u=s*c-l*A;if(u<=0&&s>=0&&l<=0)return a=s/(s-l),e.copy(n).addScaledVector(dn,a);_n.subVectors(t,i);const h=dn.dot(_n),f=pn.dot(_n);if(f>=0&&h<=f)return e.copy(i);const d=h*A-s*f;if(d<=0&&A>=0&&f<=0)return o=A/(A-f),e.copy(n).addScaledVector(pn,o);const p=l*f-h*c;if(p<=0&&c-l>=0&&h-f>=0)return mn.subVectors(i,r),o=(c-l)/(c-l+(h-f)),e.copy(r).addScaledVector(mn,o);const m=1/(p+d+u);return a=d*m,o=u*m,e.copy(n).addScaledVector(dn,a).addScaledVector(pn,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const xn={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},bn={h:0,s:0,l:0},Mn={h:0,s:0,l:0};function wn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}let En=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=rt){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,Ht.toWorkingColorSpace(this,e),this}setRGB(t,e,n,r=Ht.workingColorSpace){return this.r=t,this.g=e,this.b=n,Ht.toWorkingColorSpace(this,r),this}setHSL(t,e,n,r=Ht.workingColorSpace){if(t=wt(t,1),e=Mt(e,0,1),n=Mt(n,0,1),0===e)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=wn(i,r,t+1/3),this.g=wn(i,r,t),this.b=wn(i,r,t-1/3)}return Ht.toWorkingColorSpace(this,r),this}setStyle(t,e=rt){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let i;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,e);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,e);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=r[1],i=n.length;if(3===i)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===i)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=rt){const n=xn[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=jt(t.r),this.g=jt(t.g),this.b=jt(t.b),this}copyLinearToSRGB(t){return this.r=Vt(t.r),this.g=Vt(t.g),this.b=Vt(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=rt){return Ht.fromWorkingColorSpace(Sn.copy(this),t),65536*Math.round(Mt(255*Sn.r,0,255))+256*Math.round(Mt(255*Sn.g,0,255))+Math.round(Mt(255*Sn.b,0,255))}getHexString(t=rt){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Ht.workingColorSpace){Ht.fromWorkingColorSpace(Sn.copy(this),e);const n=Sn.r,r=Sn.g,i=Sn.b,a=Math.max(n,r,i),o=Math.min(n,r,i);let s,A;const l=(o+a)/2;if(o===a)s=0,A=0;else{const t=a-o;switch(A=l<=.5?t/(a+o):t/(2-a-o),a){case n:s=(r-i)/t+(r<i?6:0);break;case r:s=(i-n)/t+2;break;case i:s=(n-r)/t+4}s/=6}return t.h=s,t.s=A,t.l=l,t}getRGB(t,e=Ht.workingColorSpace){return Ht.fromWorkingColorSpace(Sn.copy(this),e),t.r=Sn.r,t.g=Sn.g,t.b=Sn.b,t}getStyle(t=rt){Ht.fromWorkingColorSpace(Sn.copy(this),t);const e=Sn.r,n=Sn.g,r=Sn.b;return t!==rt?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(t,e,n){return this.getHSL(bn),this.setHSL(bn.h+t,bn.s+e,bn.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(bn),t.getHSL(Mn);const n=Et(bn.h,Mn.h,e),r=Et(bn.s,Mn.s,e),i=Et(bn.l,Mn.l,e);return this.setHSL(n,r,i),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,r=this.b,i=t.elements;return this.r=i[0]*e+i[3]*n+i[6]*r,this.g=i[1]*e+i[4]*n+i[7]*r,this.b=i[2]*e+i[5]*n+i[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const Sn=new En;En.NAMES=xn;let Tn=0;class Cn extends gt{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Tn++}),this.uuid=bt(),this.name="",this.type="Material",this.blending=1,this.side=m,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=v,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new En(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ut,this.stencilZFail=ut,this.stencilZPass=ut,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),this.side!==m&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),this.blendEquation!==v&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ut&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ut&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ut&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=r(t.textures),i=r(t.images);e.length>0&&(n.textures=e),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let r=0;r!==t;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class Rn extends Cn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new En(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ve,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Pn=new ae,Ln=new Lt;class Dn{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=ht,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=V,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return Bt("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)Ln.fromBufferAttribute(this,e),Ln.applyMatrix3(t),this.setXY(e,Ln.x,Ln.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.applyMatrix3(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.applyMatrix4(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.applyNormalMatrix(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Pn.fromBufferAttribute(this,e),Pn.transformDirection(t),this.setXYZ(e,Pn.x,Pn.y,Pn.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Ct(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Rt(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ct(e,this.array)),e}setX(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ct(e,this.array)),e}setY(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ct(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ct(e,this.array)),e}setW(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,i){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array),i=Rt(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==ht&&(t.usage=this.usage),t}}class On extends Dn{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class In extends Dn{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class qn extends Dn{constructor(t,e,n){super(new Float32Array(t),e,n)}}let Un=0;const Nn=new qe,Bn=new ln,kn=new ae,Fn=new Ae,zn=new Ae,Gn=new ae;class Hn extends gt{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Un++}),this.uuid=bt(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(It(t)?In:On)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new Dt).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return Nn.makeRotationFromQuaternion(t),this.applyMatrix4(Nn),this}rotateX(t){return Nn.makeRotationX(t),this.applyMatrix4(Nn),this}rotateY(t){return Nn.makeRotationY(t),this.applyMatrix4(Nn),this}rotateZ(t){return Nn.makeRotationZ(t),this.applyMatrix4(Nn),this}translate(t,e,n){return Nn.makeTranslation(t,e,n),this.applyMatrix4(Nn),this}scale(t,e,n){return Nn.makeScale(t,e,n),this.applyMatrix4(Nn),this}lookAt(t){return Bn.lookAt(t),Bn.updateMatrix(),this.applyMatrix4(Bn.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(kn).negate(),this.translate(kn.x,kn.y,kn.z),this}setFromPoints(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];e.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new qn(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Ae);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new ae(-1/0,-1/0,-1/0),new ae(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];Fn.setFromBufferAttribute(n),this.morphTargetsRelative?(Gn.addVectors(this.boundingBox.min,Fn.min),this.boundingBox.expandByPoint(Gn),Gn.addVectors(this.boundingBox.max,Fn.max),this.boundingBox.expandByPoint(Gn)):(this.boundingBox.expandByPoint(Fn.min),this.boundingBox.expandByPoint(Fn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Se);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new ae,1/0);if(t){const n=this.boundingSphere.center;if(Fn.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];zn.setFromBufferAttribute(n),this.morphTargetsRelative?(Gn.addVectors(Fn.min,zn.min),Fn.expandByPoint(Gn),Gn.addVectors(Fn.max,zn.max),Fn.expandByPoint(Gn)):(Fn.expandByPoint(zn.min),Fn.expandByPoint(zn.max))}Fn.getCenter(n);let r=0;for(let e=0,i=t.count;e<i;e++)Gn.fromBufferAttribute(t,e),r=Math.max(r,n.distanceToSquared(Gn));if(e)for(let i=0,a=e.length;i<a;i++){const a=e[i],o=this.morphTargetsRelative;for(let e=0,i=a.count;e<i;e++)Gn.fromBufferAttribute(a,e),o&&(kn.fromBufferAttribute(t,e),Gn.add(kn)),r=Math.max(r,n.distanceToSquared(Gn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.position,r=e.normal,i=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Dn(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],s=[];for(let t=0;t<n.count;t++)o[t]=new ae,s[t]=new ae;const A=new ae,l=new ae,c=new ae,u=new Lt,h=new Lt,f=new Lt,d=new ae,p=new ae;function m(t,e,r){A.fromBufferAttribute(n,t),l.fromBufferAttribute(n,e),c.fromBufferAttribute(n,r),u.fromBufferAttribute(i,t),h.fromBufferAttribute(i,e),f.fromBufferAttribute(i,r),l.sub(A),c.sub(A),h.sub(u),f.sub(u);const a=1/(h.x*f.y-f.x*h.y);isFinite(a)&&(d.copy(l).multiplyScalar(f.y).addScaledVector(c,-h.y).multiplyScalar(a),p.copy(c).multiplyScalar(h.x).addScaledVector(l,-f.x).multiplyScalar(a),o[t].add(d),o[e].add(d),o[r].add(d),s[t].add(p),s[e].add(p),s[r].add(p))}let g=this.groups;0===g.length&&(g=[{start:0,count:t.count}]);for(let e=0,n=g.length;e<n;++e){const n=g[e],r=n.start;for(let e=r,i=r+n.count;e<i;e+=3)m(t.getX(e+0),t.getX(e+1),t.getX(e+2))}const v=new ae,_=new ae,y=new ae,x=new ae;function b(t){y.fromBufferAttribute(r,t),x.copy(y);const e=o[t];v.copy(e),v.sub(y.multiplyScalar(y.dot(e))).normalize(),_.crossVectors(x,e);const n=_.dot(s[t])<0?-1:1;a.setXYZW(t,v.x,v.y,v.z,n)}for(let e=0,n=g.length;e<n;++e){const n=g[e],r=n.start;for(let e=r,i=r+n.count;e<i;e+=3)b(t.getX(e+0)),b(t.getX(e+1)),b(t.getX(e+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new Dn(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const r=new ae,i=new ae,a=new ae,o=new ae,s=new ae,A=new ae,l=new ae,c=new ae;if(t)for(let u=0,h=t.count;u<h;u+=3){const h=t.getX(u+0),f=t.getX(u+1),d=t.getX(u+2);r.fromBufferAttribute(e,h),i.fromBufferAttribute(e,f),a.fromBufferAttribute(e,d),l.subVectors(a,i),c.subVectors(r,i),l.cross(c),o.fromBufferAttribute(n,h),s.fromBufferAttribute(n,f),A.fromBufferAttribute(n,d),o.add(l),s.add(l),A.add(l),n.setXYZ(h,o.x,o.y,o.z),n.setXYZ(f,s.x,s.y,s.z),n.setXYZ(d,A.x,A.y,A.z)}else for(let t=0,o=e.count;t<o;t+=3)r.fromBufferAttribute(e,t+0),i.fromBufferAttribute(e,t+1),a.fromBufferAttribute(e,t+2),l.subVectors(a,i),c.subVectors(r,i),l.cross(c),n.setXYZ(t+0,l.x,l.y,l.z),n.setXYZ(t+1,l.x,l.y,l.z),n.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)Gn.fromBufferAttribute(t,e),Gn.normalize(),t.setXYZ(e,Gn.x,Gn.y,Gn.z)}toNonIndexed(){function t(t,e){const n=t.array,r=t.itemSize,i=t.normalized,a=new n.constructor(e.length*r);let o=0,s=0;for(let i=0,A=e.length;i<A;i++){o=t.isInterleavedBufferAttribute?e[i]*t.data.stride+t.offset:e[i]*r;for(let t=0;t<r;t++)a[s++]=n[o++]}return new Dn(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Hn,n=this.index.array,r=this.attributes;for(const i in r){const a=t(r[i],n);e.setAttribute(i,a)}const i=this.morphAttributes;for(const r in i){const a=[],o=i[r];for(let e=0,r=o.length;e<r;e++){const r=t(o[e],n);a.push(r)}e.morphAttributes[r]=a}e.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let t=0,n=a.length;t<n;t++){const n=a[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const r=n[e];t.data.attributes[e]=r.toJSON(t.data)}const r={};let i=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],a=[];for(let e=0,r=n.length;e<r;e++){const r=n[e];a.push(r.toJSON(t.data))}a.length>0&&(r[e]=a,i=!0)}i&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const r=t.attributes;for(const t in r){const n=r[t];this.setAttribute(t,n.clone(e))}const i=t.morphAttributes;for(const t in i){const n=[],r=i[t];for(let t=0,i=r.length;t<i;t++)n.push(r[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const a=t.groups;for(let t=0,e=a.length;t<e;t++){const e=a[t];this.addGroup(e.start,e.count,e.materialIndex)}const o=t.boundingBox;null!==o&&(this.boundingBox=o.clone());const s=t.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const jn=new qe,Vn=new Ie,Wn=new Se,Xn=new ae,Qn=new ae,Yn=new ae,Zn=new ae,Kn=new ae,Jn=new ae,$n=new Lt,tr=new Lt,er=new Lt,nr=new ae,rr=new ae,ir=new ae,ar=new ae,or=new ae;class sr extends ln{constructor(t=new Hn,e=new Rn){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){const n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;e.fromBufferAttribute(r,t);const o=this.morphTargetInfluences;if(i&&o){Jn.set(0,0,0);for(let n=0,r=i.length;n<r;n++){const r=o[n],s=i[n];0!==r&&(Kn.fromBufferAttribute(s,t),a?Jn.addScaledVector(Kn,r):Jn.addScaledVector(Kn.sub(e),r))}e.add(Jn)}return e}raycast(t,e){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),Wn.copy(n.boundingSphere),Wn.applyMatrix4(i),Vn.copy(t.ray).recast(t.near),!1===Wn.containsPoint(Vn.origin)){if(null===Vn.intersectSphere(Wn,Xn))return;if(Vn.origin.distanceToSquared(Xn)>(t.far-t.near)**2)return}jn.copy(i).invert(),Vn.copy(t.ray).applyMatrix4(jn),null!==n.boundingBox&&!1===Vn.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,Vn)}}_computeIntersections(t,e,n){let r;const i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,A=i.attributes.uv,l=i.attributes.uv1,c=i.attributes.normal,u=i.groups,h=i.drawRange;if(null!==o)if(Array.isArray(a))for(let i=0,s=u.length;i<s;i++){const s=u[i],f=a[s.materialIndex];for(let i=Math.max(s.start,h.start),a=Math.min(o.count,Math.min(s.start+s.count,h.start+h.count));i<a;i+=3){r=Ar(this,f,t,n,A,l,c,o.getX(i),o.getX(i+1),o.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,e.push(r))}}else{for(let i=Math.max(0,h.start),s=Math.min(o.count,h.start+h.count);i<s;i+=3){r=Ar(this,a,t,n,A,l,c,o.getX(i),o.getX(i+1),o.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),e.push(r))}}else if(void 0!==s)if(Array.isArray(a))for(let i=0,o=u.length;i<o;i++){const o=u[i],f=a[o.materialIndex];for(let i=Math.max(o.start,h.start),a=Math.min(s.count,Math.min(o.start+o.count,h.start+h.count));i<a;i+=3){r=Ar(this,f,t,n,A,l,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,e.push(r))}}else{for(let i=Math.max(0,h.start),o=Math.min(s.count,h.start+h.count);i<o;i+=3){r=Ar(this,a,t,n,A,l,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),e.push(r))}}}}function Ar(t,e,n,r,i,a,o,s,A,l){t.getVertexPosition(s,Qn),t.getVertexPosition(A,Yn),t.getVertexPosition(l,Zn);const c=function(t,e,n,r,i,a,o,s){let A;if(A=e.side===g?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,e.side===m,s),null===A)return null;or.copy(s),or.applyMatrix4(t.matrixWorld);const l=n.ray.origin.distanceTo(or);return l<n.near||l>n.far?null:{distance:l,point:or.clone(),object:t}}(t,e,n,r,Qn,Yn,Zn,ar);if(c){i&&($n.fromBufferAttribute(i,s),tr.fromBufferAttribute(i,A),er.fromBufferAttribute(i,l),c.uv=yn.getInterpolation(ar,Qn,Yn,Zn,$n,tr,er,new Lt)),a&&($n.fromBufferAttribute(a,s),tr.fromBufferAttribute(a,A),er.fromBufferAttribute(a,l),c.uv1=yn.getInterpolation(ar,Qn,Yn,Zn,$n,tr,er,new Lt)),o&&(nr.fromBufferAttribute(o,s),rr.fromBufferAttribute(o,A),ir.fromBufferAttribute(o,l),c.normal=yn.getInterpolation(ar,Qn,Yn,Zn,nr,rr,ir,new ae),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const t={a:s,b:A,c:l,normal:new ae,materialIndex:0};yn.getNormal(Qn,Yn,Zn,t.normal),c.face=t}return c}class lr extends Hn{constructor(t=1,e=1,n=1,r=1,i=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};const o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);const s=[],A=[],l=[],c=[];let u=0,h=0;function f(t,e,n,r,i,a,f,d,p,m,g){const v=a/p,_=f/m,y=a/2,x=f/2,b=d/2,M=p+1,w=m+1;let E=0,S=0;const T=new ae;for(let a=0;a<w;a++){const o=a*_-x;for(let s=0;s<M;s++){const u=s*v-y;T[t]=u*r,T[e]=o*i,T[n]=b,A.push(T.x,T.y,T.z),T[t]=0,T[e]=0,T[n]=d>0?1:-1,l.push(T.x,T.y,T.z),c.push(s/p),c.push(1-a/m),E+=1}}for(let t=0;t<m;t++)for(let e=0;e<p;e++){const n=u+e+M*t,r=u+e+M*(t+1),i=u+(e+1)+M*(t+1),a=u+(e+1)+M*t;s.push(n,r,a),s.push(r,i,a),S+=6}o.addGroup(h,S,g),h+=S,u+=E}f("z","y","x",-1,-1,n,e,t,a,i,0),f("z","y","x",1,-1,n,e,-t,a,i,1),f("x","z","y",1,1,t,n,e,r,a,2),f("x","z","y",1,-1,t,n,-e,r,a,3),f("x","y","z",1,-1,t,e,n,r,i,4),f("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new qn(A,3)),this.setAttribute("normal",new qn(l,3)),this.setAttribute("uv",new qn(c,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new lr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function cr(t){const e={};for(const n in t){e[n]={};for(const r in t[n]){const i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][r]=null):e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}function ur(t){const e={};for(let n=0;n<t.length;n++){const r=cr(t[n]);for(const t in r)e[t]=r[t]}return e}function hr(t){return null===t.getRenderTarget()?t.outputColorSpace:Ht.workingColorSpace}const fr={clone:cr,merge:ur};class dr extends Cn{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=cr(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class pr extends ln{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new qe,this.projectionMatrix=new qe,this.projectionMatrixInverse=new qe,this.coordinateSystem=pt}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const mr=new ae,gr=new Lt,vr=new Lt;class _r extends pr{constructor(t=50,e=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*xt*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*yt*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*xt*Math.atan(Math.tan(.5*yt*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){mr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(mr.x,mr.y).multiplyScalar(-t/mr.z),mr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(mr.x,mr.y).multiplyScalar(-t/mr.z)}getViewSize(t,e){return this.getViewBounds(t,gr,vr),e.subVectors(vr,gr)}setViewOffset(t,e,n,r,i,a){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*yt*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r;const a=this.view;if(null!==this.view&&this.view.enabled){const t=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/t,e-=a.offsetY*n/o,r*=a.width/t,n*=a.height/o}const o=this.filmOffset;0!==o&&(i+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const yr=-90;class xr extends ln{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new _r(yr,1,t,e);r.layers=this.layers,this.add(r);const i=new _r(yr,1,t,e);i.layers=this.layers,this.add(i);const a=new _r(yr,1,t,e);a.layers=this.layers,this.add(a);const o=new _r(yr,1,t,e);o.layers=this.layers,this.add(o);const s=new _r(yr,1,t,e);s.layers=this.layers,this.add(s);const A=new _r(yr,1,t,e);A.layers=this.layers,this.add(A)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,r,i,a,o,s]=e;for(const t of e)this.remove(t);if(t===pt)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else{if(t!==mt)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[i,a,o,s,A,l]=this.children,c=t.getRenderTarget(),u=t.getActiveCubeFace(),h=t.getActiveMipmapLevel(),f=t.xr.enabled;t.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,r),t.render(e,i),t.setRenderTarget(n,1,r),t.render(e,a),t.setRenderTarget(n,2,r),t.render(e,o),t.setRenderTarget(n,3,r),t.render(e,s),t.setRenderTarget(n,4,r),t.render(e,A),n.texture.generateMipmaps=d,t.setRenderTarget(n,5,r),t.render(e,l),t.setRenderTarget(c,u,h),t.xr.enabled=f,n.texture.needsPMREMUpdate=!0}}class br extends Jt{constructor(t,e,n,r,i,a,o,s,A,l){super(t=void 0!==t?t:[],e=void 0!==e?e:P,n,r,i,a,o,s,A,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class Mr extends ee{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},r=[n,n,n,n,n,n];this.texture=new br(r,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:B}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new lr(5,5,5),i=new dr({name:"CubemapFromEquirect",uniforms:cr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:g,blending:0});i.uniforms.tEquirect.value=e;const a=new sr(r,i),o=e.minFilter;e.minFilter===F&&(e.minFilter=B);return new xr(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,r){const i=t.getRenderTarget();for(let i=0;i<6;i++)t.setRenderTarget(this,i),t.clear(e,n,r);t.setRenderTarget(i)}}const wr=new ae,Er=new ae,Sr=new Dt;class Tr{constructor(t=new ae(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const r=wr.subVectors(n,e).cross(Er.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(wr),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:e.copy(t.start).addScaledVector(n,i)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Sr.getNormalMatrix(t),r=this.coplanarPoint(wr).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Cr=new Se,Rr=new ae;class Pr{constructor(t=new Tr,e=new Tr,n=new Tr,r=new Tr,i=new Tr,a=new Tr){this.planes=[t,e,n,r,i,a]}set(t,e,n,r,i,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,r=t.elements,i=r[0],a=r[1],o=r[2],s=r[3],A=r[4],l=r[5],c=r[6],u=r[7],h=r[8],f=r[9],d=r[10],p=r[11],m=r[12],g=r[13],v=r[14],_=r[15];if(n[0].setComponents(s-i,u-A,p-h,_-m).normalize(),n[1].setComponents(s+i,u+A,p+h,_+m).normalize(),n[2].setComponents(s+a,u+l,p+f,_+g).normalize(),n[3].setComponents(s-a,u-l,p-f,_-g).normalize(),n[4].setComponents(s-o,u-c,p-d,_-v).normalize(),e===pt)n[5].setComponents(s+o,u+c,p+d,_+v).normalize();else{if(e!==mt)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(o,c,d,v).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Cr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Cr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Cr)}intersectsSprite(t){return Cr.center.set(0,0,0),Cr.radius=.7071067811865476,Cr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Cr)}intersectsSphere(t){const e=this.planes,n=t.center,r=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)<r)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const r=e[n];if(Rr.x=r.normal.x>0?t.max.x:t.min.x,Rr.y=r.normal.y>0?t.max.y:t.min.y,Rr.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Rr)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Lr(){let t=null,e=!1,n=null,r=null;function i(e,a){n(e,a),r=t.requestAnimationFrame(i)}return{start:function(){!0!==e&&null!==n&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Dr(t,e){const n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){if(e.isGLBufferAttribute){const t=r.get(e);return void((!t||t.version<e.version)&&r.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const a=r.get(e);if(void 0===a)r.set(e,function(e,r){const i=e.array,a=e.usage,o=i.byteLength,s=t.createBuffer();let A;if(t.bindBuffer(r,s),t.bufferData(r,i,a),e.onUploadCallback(),i instanceof Float32Array)A=t.FLOAT;else if(i instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");A=t.HALF_FLOAT}else A=t.UNSIGNED_SHORT;else if(i instanceof Int16Array)A=t.SHORT;else if(i instanceof Uint32Array)A=t.UNSIGNED_INT;else if(i instanceof Int32Array)A=t.INT;else if(i instanceof Int8Array)A=t.BYTE;else if(i instanceof Uint8Array)A=t.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);A=t.UNSIGNED_BYTE}return{buffer:s,type:A,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,size:o}}(e,i));else if(a.version<e.version){if(a.size!==e.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(e,r,i){const a=r.array,o=r._updateRange,s=r.updateRanges;if(t.bindBuffer(i,e),-1===o.count&&0===s.length&&t.bufferSubData(i,0,a),0!==s.length){for(let e=0,r=s.length;e<r;e++){const r=s[e];n?t.bufferSubData(i,r.start*a.BYTES_PER_ELEMENT,a,r.start,r.count):t.bufferSubData(i,r.start*a.BYTES_PER_ELEMENT,a.subarray(r.start,r.start+r.count))}r.clearUpdateRanges()}-1!==o.count&&(n?t.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):t.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1),r.onUploadCallback()}(a.buffer,e,i),a.version=e.version}}}}class Or extends Hn{constructor(t=1,e=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};const i=t/2,a=e/2,o=Math.floor(n),s=Math.floor(r),A=o+1,l=s+1,c=t/o,u=e/s,h=[],f=[],d=[],p=[];for(let t=0;t<l;t++){const e=t*u-a;for(let n=0;n<A;n++){const r=n*c-i;f.push(r,-e,0),d.push(0,0,1),p.push(n/o),p.push(1-t/s)}}for(let t=0;t<s;t++)for(let e=0;e<o;e++){const n=e+A*t,r=e+A*(t+1),i=e+1+A*(t+1),a=e+1+A*t;h.push(n,r,a),h.push(r,i,a)}this.setIndex(h),this.setAttribute("position",new qn(f,3)),this.setAttribute("normal",new qn(d,3)),this.setAttribute("uv",new qn(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Or(t.width,t.height,t.widthSegments,t.heightSegments)}}const Ir={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\tattribute float batchId;\n\tuniform highp sampler2D batchingTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( batchId );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660,  0.0556434,\n\t\t-1.5371385,  1.8760108, -0.2040259,\n\t\t-0.4985314,  0.0415560,  1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n    float x2 = x * x;\n    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t  f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3(  1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108,  1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605,  1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tfloat startCompression = 0.8 - 0.04;\n\tfloat desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min(color.r, min(color.g, color.b));\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max(color.r, max(color.g, color.b));\n\tif (peak < startCompression) return color;\n\tfloat d = 1. - startCompression;\n\tfloat newPeak = 1. - d * d / (peak + d - startCompression);\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / (desaturation * (peak - newPeak) + 1.);\n\treturn mix(color, vec3(1, 1, 1), g);\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},qr={common:{diffuse:{value:new En(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Dt}},envmap:{envMap:{value:null},envMapRotation:{value:new Dt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Dt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Dt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Dt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Dt},normalScale:{value:new Lt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Dt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Dt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Dt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Dt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new En(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new En(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new En(16777215)},opacity:{value:1},center:{value:new Lt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}}},Ur={basic:{uniforms:ur([qr.common,qr.specularmap,qr.envmap,qr.aomap,qr.lightmap,qr.fog]),vertexShader:Ir.meshbasic_vert,fragmentShader:Ir.meshbasic_frag},lambert:{uniforms:ur([qr.common,qr.specularmap,qr.envmap,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.fog,qr.lights,{emissive:{value:new En(0)}}]),vertexShader:Ir.meshlambert_vert,fragmentShader:Ir.meshlambert_frag},phong:{uniforms:ur([qr.common,qr.specularmap,qr.envmap,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.fog,qr.lights,{emissive:{value:new En(0)},specular:{value:new En(1118481)},shininess:{value:30}}]),vertexShader:Ir.meshphong_vert,fragmentShader:Ir.meshphong_frag},standard:{uniforms:ur([qr.common,qr.envmap,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.roughnessmap,qr.metalnessmap,qr.fog,qr.lights,{emissive:{value:new En(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ir.meshphysical_vert,fragmentShader:Ir.meshphysical_frag},toon:{uniforms:ur([qr.common,qr.aomap,qr.lightmap,qr.emissivemap,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.gradientmap,qr.fog,qr.lights,{emissive:{value:new En(0)}}]),vertexShader:Ir.meshtoon_vert,fragmentShader:Ir.meshtoon_frag},matcap:{uniforms:ur([qr.common,qr.bumpmap,qr.normalmap,qr.displacementmap,qr.fog,{matcap:{value:null}}]),vertexShader:Ir.meshmatcap_vert,fragmentShader:Ir.meshmatcap_frag},points:{uniforms:ur([qr.points,qr.fog]),vertexShader:Ir.points_vert,fragmentShader:Ir.points_frag},dashed:{uniforms:ur([qr.common,qr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ir.linedashed_vert,fragmentShader:Ir.linedashed_frag},depth:{uniforms:ur([qr.common,qr.displacementmap]),vertexShader:Ir.depth_vert,fragmentShader:Ir.depth_frag},normal:{uniforms:ur([qr.common,qr.bumpmap,qr.normalmap,qr.displacementmap,{opacity:{value:1}}]),vertexShader:Ir.meshnormal_vert,fragmentShader:Ir.meshnormal_frag},sprite:{uniforms:ur([qr.sprite,qr.fog]),vertexShader:Ir.sprite_vert,fragmentShader:Ir.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ir.background_vert,fragmentShader:Ir.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Dt}},vertexShader:Ir.backgroundCube_vert,fragmentShader:Ir.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ir.cube_vert,fragmentShader:Ir.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ir.equirect_vert,fragmentShader:Ir.equirect_frag},distanceRGBA:{uniforms:ur([qr.common,qr.displacementmap,{referencePosition:{value:new ae},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ir.distanceRGBA_vert,fragmentShader:Ir.distanceRGBA_frag},shadow:{uniforms:ur([qr.lights,qr.fog,{color:{value:new En(0)},opacity:{value:1}}]),vertexShader:Ir.shadow_vert,fragmentShader:Ir.shadow_frag}};Ur.physical={uniforms:ur([Ur.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Dt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Dt},clearcoatNormalScale:{value:new Lt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Dt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Dt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Dt},sheen:{value:0},sheenColor:{value:new En(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Dt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Dt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Dt},transmissionSamplerSize:{value:new Lt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Dt},attenuationDistance:{value:0},attenuationColor:{value:new En(0)},specularColor:{value:new En(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Dt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Dt},anisotropyVector:{value:new Lt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Dt}}]),vertexShader:Ir.meshphysical_vert,fragmentShader:Ir.meshphysical_frag};const Nr={r:0,b:0,g:0},Br=new Ve,kr=new qe;function Fr(t,e,n,r,i,a,o){const s=new En(0);let A,l,c=!0===a?0:1,u=null,h=0,f=null;function d(e,n){e.getRGB(Nr,hr(t)),r.buffers.color.setClear(Nr.r,Nr.g,Nr.b,n,o)}return{getClearColor:function(){return s},setClearColor:function(t,e=1){s.set(t),c=e,d(s,c)},getClearAlpha:function(){return c},setClearAlpha:function(t){c=t,d(s,c)},render:function(a,p){let v=!1,_=!0===p.isScene?p.background:null;if(_&&_.isTexture){_=(p.backgroundBlurriness>0?n:e).get(_)}null===_?d(s,c):_&&_.isColor&&(d(_,1),v=!0);const y=t.xr.getEnvironmentBlendMode();"additive"===y?r.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===y&&r.buffers.color.setClear(0,0,0,0,o),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),_&&(_.isCubeTexture||_.mapping===D)?(void 0===l&&(l=new sr(new lr(1,1,1),new dr({name:"BackgroundCubeMaterial",uniforms:cr(Ur.backgroundCube.uniforms),vertexShader:Ur.backgroundCube.vertexShader,fragmentShader:Ur.backgroundCube.fragmentShader,side:g,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),Br.copy(p.backgroundRotation),Br.x*=-1,Br.y*=-1,Br.z*=-1,_.isCubeTexture&&!1===_.isRenderTargetTexture&&(Br.y*=-1,Br.z*=-1),l.material.uniforms.envMap.value=_,l.material.uniforms.flipEnvMap.value=_.isCubeTexture&&!1===_.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=p.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(kr.makeRotationFromEuler(Br)),l.material.toneMapped=Ht.getTransfer(_.colorSpace)!==At,u===_&&h===_.version&&f===t.toneMapping||(l.material.needsUpdate=!0,u=_,h=_.version,f=t.toneMapping),l.layers.enableAll(),a.unshift(l,l.geometry,l.material,0,0,null)):_&&_.isTexture&&(void 0===A&&(A=new sr(new Or(2,2),new dr({name:"BackgroundMaterial",uniforms:cr(Ur.background.uniforms),vertexShader:Ur.background.vertexShader,fragmentShader:Ur.background.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),A.geometry.deleteAttribute("normal"),Object.defineProperty(A.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(A)),A.material.uniforms.t2D.value=_,A.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,A.material.toneMapped=Ht.getTransfer(_.colorSpace)!==At,!0===_.matrixAutoUpdate&&_.updateMatrix(),A.material.uniforms.uvTransform.value.copy(_.matrix),u===_&&h===_.version&&f===t.toneMapping||(A.material.needsUpdate=!0,u=_,h=_.version,f=t.toneMapping),A.layers.enableAll(),a.unshift(A,A.geometry,A.material,0,0,null))}}}function zr(t,e,n,r){const i=t.getParameter(t.MAX_VERTEX_ATTRIBS),a=r.isWebGL2?null:e.get("OES_vertex_array_object"),o=r.isWebGL2||null!==a,s={},A=f(null);let l=A,c=!1;function u(e){return r.isWebGL2?t.bindVertexArray(e):a.bindVertexArrayOES(e)}function h(e){return r.isWebGL2?t.deleteVertexArray(e):a.deleteVertexArrayOES(e)}function f(t){const e=[],n=[],r=[];for(let t=0;t<i;t++)e[t]=0,n[t]=0,r[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:n,attributeDivisors:r,object:t,attributes:{},index:null}}function d(){const t=l.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function p(t){m(t,0)}function m(n,i){const a=l.newAttributes,o=l.enabledAttributes,s=l.attributeDivisors;if(a[n]=1,0===o[n]&&(t.enableVertexAttribArray(n),o[n]=1),s[n]!==i){(r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i}}function g(){const e=l.newAttributes,n=l.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==e[r]&&(t.disableVertexAttribArray(r),n[r]=0)}function v(e,n,r,i,a,o,s){!0===s?t.vertexAttribIPointer(e,n,r,a,o):t.vertexAttribPointer(e,n,r,i,a,o)}function _(){y(),c=!0,l!==A&&(l=A,u(l.object))}function y(){A.geometry=null,A.program=null,A.wireframe=!1}return{setup:function(i,A,h,_,y){let x=!1;if(o){const e=function(e,n,i){const o=!0===i.wireframe;let A=s[e.id];void 0===A&&(A={},s[e.id]=A);let l=A[n.id];void 0===l&&(l={},A[n.id]=l);let c=l[o];void 0===c&&(c=f(r.isWebGL2?t.createVertexArray():a.createVertexArrayOES()),l[o]=c);return c}(_,h,A);l!==e&&(l=e,u(l.object)),x=function(t,e,n,r){const i=l.attributes,a=e.attributes;let o=0;const s=n.getAttributes();for(const e in s){if(s[e].location>=0){const n=i[e];let r=a[e];if(void 0===r&&("instanceMatrix"===e&&t.instanceMatrix&&(r=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(r=t.instanceColor)),void 0===n)return!0;if(n.attribute!==r)return!0;if(r&&n.data!==r.data)return!0;o++}}return l.attributesNum!==o||l.index!==r}(i,_,h,y),x&&function(t,e,n,r){const i={},a=e.attributes;let o=0;const s=n.getAttributes();for(const e in s){if(s[e].location>=0){let n=a[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[e]=r,o++}}l.attributes=i,l.attributesNum=o,l.index=r}(i,_,h,y)}else{const t=!0===A.wireframe;l.geometry===_.id&&l.program===h.id&&l.wireframe===t||(l.geometry=_.id,l.program=h.id,l.wireframe=t,x=!0)}null!==y&&n.update(y,t.ELEMENT_ARRAY_BUFFER),(x||c)&&(c=!1,function(i,a,o,s){if(!1===r.isWebGL2&&(i.isInstancedMesh||s.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;d();const A=s.attributes,l=o.getAttributes(),c=a.defaultAttributeValues;for(const e in l){const a=l[e];if(a.location>=0){let o=A[e];if(void 0===o&&("instanceMatrix"===e&&i.instanceMatrix&&(o=i.instanceMatrix),"instanceColor"===e&&i.instanceColor&&(o=i.instanceColor)),void 0!==o){const e=o.normalized,A=o.itemSize,l=n.get(o);if(void 0===l)continue;const c=l.buffer,u=l.type,h=l.bytesPerElement,f=!0===r.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||o.gpuType===H);if(o.isInterleavedBufferAttribute){const n=o.data,r=n.stride,l=o.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t<a.locationSize;t++)m(a.location+t,n.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let t=0;t<a.locationSize;t++)p(a.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<a.locationSize;t++)v(a.location+t,A/a.locationSize,u,e,r*h,(l+A/a.locationSize*t)*h,f)}else{if(o.isInstancedBufferAttribute){for(let t=0;t<a.locationSize;t++)m(a.location+t,o.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let t=0;t<a.locationSize;t++)p(a.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<a.locationSize;t++)v(a.location+t,A/a.locationSize,u,e,A*h,A/a.locationSize*t*h,f)}}else if(void 0!==c){const n=c[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(a.location,n);break;case 3:t.vertexAttrib3fv(a.location,n);break;case 4:t.vertexAttrib4fv(a.location,n);break;default:t.vertexAttrib1fv(a.location,n)}}}}g()}(i,A,h,_),null!==y&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(y).buffer))},reset:_,resetDefaultState:y,dispose:function(){_();for(const t in s){const e=s[t];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete s[t]}},releaseStatesOfGeometry:function(t){if(void 0===s[t.id])return;const e=s[t.id];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete s[t.id]},releaseStatesOfProgram:function(t){for(const e in s){const n=s[e];if(void 0===n[t.id])continue;const r=n[t.id];for(const t in r)h(r[t].object),delete r[t];delete n[t.id]}},initAttributes:d,enableAttribute:p,disableUnusedAttributes:g}}function Gr(t,e,n,r){const i=r.isWebGL2;let a;this.setMode=function(t){a=t},this.render=function(e,r){t.drawArrays(a,e,r),n.update(r,a,1)},this.renderInstances=function(r,o,s){if(0===s)return;let A,l;if(i)A=t,l="drawArraysInstanced";else if(A=e.get("ANGLE_instanced_arrays"),l="drawArraysInstancedANGLE",null===A)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");A[l](a,r,o,s),n.update(o,a,s)},this.renderMultiDraw=function(t,r,i){if(0===i)return;const o=e.get("WEBGL_multi_draw");if(null===o)for(let e=0;e<i;e++)this.render(t[e],r[e]);else{o.multiDrawArraysWEBGL(a,t,0,r,0,i);let e=0;for(let t=0;t<i;t++)e+=r[t];n.update(e,a,1)}}}function Hr(t,e,n){let r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let o=void 0!==n.precision?n.precision:"highp";const s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const A=a||e.has("WEBGL_draw_buffers"),l=!0===n.logarithmicDepthBuffer,c=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=t.getParameter(t.MAX_TEXTURE_SIZE),f=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),d=t.getParameter(t.MAX_VERTEX_ATTRIBS),p=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),g=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=u>0,_=a||e.has("OES_texture_float");return{isWebGL2:a,drawBuffers:A,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:f,maxAttributes:d,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:v&&_,maxSamples:a?t.getParameter(t.MAX_SAMPLES):0}}function jr(t){const e=this;let n=null,r=0,i=!1,a=!1;const o=new Tr,s=new Dt,A={value:null,needsUpdate:!1};function l(t,n,r,i){const a=null!==t?t.length:0;let l=null;if(0!==a){if(l=A.value,!0!==i||null===l){const e=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===l||l.length<e)&&(l=new Float32Array(e));for(let e=0,n=r;e!==a;++e,n+=4)o.copy(t[e]).applyMatrix4(i,s),o.normal.toArray(l,n),l[n+3]=o.constant}A.value=l,A.needsUpdate=!0}return e.numPlanes=a,e.numIntersection=0,l}this.uniform=A,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e){const n=0!==t.length||e||0!==r||i;return i=e,r=t.length,n},this.beginShadows=function(){a=!0,l(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(t,e){n=l(t,e,0)},this.setState=function(o,s,c){const u=o.clippingPlanes,h=o.clipIntersection,f=o.clipShadows,d=t.get(o);if(!i||null===u||0===u.length||a&&!f)a?l(null):function(){A.value!==n&&(A.value=n,A.needsUpdate=r>0);e.numPlanes=r,e.numIntersection=0}();else{const t=a?0:r,e=4*t;let i=d.clippingState||null;A.value=i,i=l(u,s,e,c);for(let t=0;t!==e;++t)i[t]=n[t];d.clippingState=i,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=t}}}function Vr(t){let e=new WeakMap;function n(t,e){return 303===e?t.mapping=P:304===e&&(t.mapping=L),t}function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping;if(303===a||304===a){if(e.has(i)){return n(e.get(i).texture,i.mapping)}{const a=i.image;if(a&&a.height>0){const o=new Mr(a.height);return o.fromEquirectangularTexture(t,i),e.set(i,o),i.addEventListener("dispose",r),n(o.texture,i.mapping)}return null}}}return i},dispose:function(){e=new WeakMap}}}class Wr extends pr{constructor(t=-1,e=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-t,a=n+t,o=r+e,s=r-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=t*this.view.offsetX,a=i+t*this.view.width,o-=e*this.view.offsetY,s=o-e*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const Xr=[.125,.215,.35,.446,.526,.582],Qr=20,Yr=new Wr,Zr=new En;let Kr=null,Jr=0,$r=0;const ti=(1+Math.sqrt(5))/2,ei=1/ti,ni=[new ae(1,1,1),new ae(-1,1,1),new ae(1,1,-1),new ae(-1,1,-1),new ae(0,ti,ei),new ae(0,ti,-ei),new ae(ei,0,ti),new ae(-ei,0,ti),new ae(ti,ei,0),new ae(-ti,ei,0)];class ri{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,r=100){Kr=this._renderer.getRenderTarget(),Jr=this._renderer.getActiveCubeFace(),$r=this._renderer.getActiveMipmapLevel(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(t,n,r,i),e>0&&this._blur(i,0,0,e),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=si(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=oi(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Kr,Jr,$r),t.scissorTest=!1,ai(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===P||t.mapping===L?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Kr=this._renderer.getRenderTarget(),Jr=this._renderer.getActiveCubeFace(),$r=this._renderer.getActiveMipmapLevel();const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:B,minFilter:B,generateMipmaps:!1,type:W,format:Q,colorSpace:it,depthBuffer:!1},r=ii(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=ii(t,e,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],n=[],r=[];let i=t;const a=t-4+1+Xr.length;for(let o=0;o<a;o++){const a=Math.pow(2,i);n.push(a);let s=1/a;o>t-4?s=Xr[o-t+4-1]:0===o&&(s=0),r.push(s);const A=1/(a-2),l=-A,c=1+A,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,f=6,d=3,p=2,m=1,g=new Float32Array(d*f*h),v=new Float32Array(p*f*h),_=new Float32Array(m*f*h);for(let t=0;t<h;t++){const e=t%3*2/3-1,n=t>2?0:-1,r=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];g.set(r,d*f*t),v.set(u,p*f*t);const i=[t,t,t,t,t,t];_.set(i,m*f*t)}const y=new Hn;y.setAttribute("position",new Dn(g,d)),y.setAttribute("uv",new Dn(v,p)),y.setAttribute("faceIndex",new Dn(_,m)),e.push(y),i>4&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(t,e,n){const r=new Float32Array(Qr),i=new ae(0,1,0),a=new dr({name:"SphericalGaussianBlur",defines:{n:Qr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Ai(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return a}(r,t,e)}return r}_compileMaterial(t){const e=new sr(this._lodPlanes[0],t);this._renderer.compile(e,Yr)}_sceneToCubeUV(t,e,n,r){const i=new _r(90,1,e,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,A=s.autoClear,l=s.toneMapping;s.getClearColor(Zr),s.toneMapping=b,s.autoClear=!1;const c=new Rn({name:"PMREM.Background",side:g,depthWrite:!1,depthTest:!1}),u=new sr(new lr,c);let h=!1;const f=t.background;f?f.isColor&&(c.color.copy(f),t.background=null,h=!0):(c.color.copy(Zr),h=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(i.up.set(0,a[e],0),i.lookAt(o[e],0,0)):1===n?(i.up.set(0,0,a[e]),i.lookAt(0,o[e],0)):(i.up.set(0,a[e],0),i.lookAt(0,0,o[e]));const A=this._cubeSize;ai(r,n*A,e>2?A:0,A,A),s.setRenderTarget(r),h&&s.render(u,i),s.render(t,i)}u.geometry.dispose(),u.material.dispose(),s.toneMapping=l,s.autoClear=A,t.background=f}_textureToCubeUV(t,e){const n=this._renderer,r=t.mapping===P||t.mapping===L;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=si()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=oi());const i=r?this._cubemapMaterial:this._equirectMaterial,a=new sr(this._lodPlanes[0],i);i.uniforms.envMap.value=t;const o=this._cubeSize;ai(e,0,0,3*o,2*o),n.setRenderTarget(e),n.render(a,Yr)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;e<this._lodPlanes.length;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),r=ni[(e-1)%ni.length];this._blur(t,e-1,e,n,r)}e.autoClear=n}_blur(t,e,n,r,i){const a=this._pingPongRenderTarget;this._halfBlur(t,a,e,n,r,"latitudinal",i),this._halfBlur(a,t,n,n,r,"longitudinal",i)}_halfBlur(t,e,n,r,i,a,o){const s=this._renderer,A=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const l=new sr(this._lodPlanes[r],A),c=A.uniforms,u=this._sizeLods[n]-1,h=isFinite(i)?Math.PI/(2*u):2*Math.PI/39,f=i/h,d=isFinite(i)?1+Math.floor(3*f):Qr;d>Qr&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${d} samples when the maximum is set to 20`);const p=[];let m=0;for(let t=0;t<Qr;++t){const e=t/f,n=Math.exp(-e*e/2);p.push(n),0===t?m+=n:t<d&&(m+=2*n)}for(let t=0;t<p.length;t++)p[t]=p[t]/m;c.envMap.value=t.texture,c.samples.value=d,c.weights.value=p,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o);const{_lodMax:g}=this;c.dTheta.value=h,c.mipInt.value=g-n;const v=this._sizeLods[r];ai(e,3*v*(r>g-4?r-g+4:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(e),s.render(l,Yr)}}function ii(t,e,n){const r=new ee(t,e,n);return r.texture.mapping=D,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function ai(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function oi(){return new dr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ai(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function si(){return new dr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ai(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Ai(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function li(t){let e=new WeakMap,n=null;function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping,o=303===a||304===a,s=a===P||a===L;if(o||s){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=e.get(i);return null===n&&(n=new ri(t)),r=o?n.fromEquirectangular(i,r):n.fromCubemap(i,r),e.set(i,r),r.texture}if(e.has(i))return e.get(i).texture;{const a=i.image;if(o&&a&&a.height>0||s&&a&&function(t){let e=0;const n=6;for(let r=0;r<n;r++)void 0!==t[r]&&e++;return e===n}(a)){null===n&&(n=new ri(t));const a=o?n.fromEquirectangular(i):n.fromCubemap(i);return e.set(i,a),i.addEventListener("dispose",r),a.texture}return null}}}return i},dispose:function(){e=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function ci(t){const e={};function n(n){if(void 0!==e[n])return e[n];let r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return e[n]=r,r}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?(n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance")):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function ui(t,e,n,r){const i={},a=new WeakMap;function o(t){const s=t.target;null!==s.index&&e.remove(s.index);for(const t in s.attributes)e.remove(s.attributes[t]);for(const t in s.morphAttributes){const n=s.morphAttributes[t];for(let t=0,r=n.length;t<r;t++)e.remove(n[t])}s.removeEventListener("dispose",o),delete i[s.id];const A=a.get(s);A&&(e.remove(A),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(t){const n=[],r=t.index,i=t.attributes.position;let o=0;if(null!==r){const t=r.array;o=r.version;for(let e=0,r=t.length;e<r;e+=3){const r=t[e+0],i=t[e+1],a=t[e+2];n.push(r,i,i,a,a,r)}}else{if(void 0===i)return;{const t=i.array;o=i.version;for(let e=0,r=t.length/3-1;e<r;e+=3){const t=e+0,r=e+1,i=e+2;n.push(t,r,r,i,i,t)}}}const s=new(It(n)?In:On)(n,1);s.version=o;const A=a.get(t);A&&e.remove(A),a.set(t,s)}return{get:function(t,e){return!0===i[e.id]||(e.addEventListener("dispose",o),i[e.id]=!0,n.memory.geometries++),e},update:function(n){const r=n.attributes;for(const n in r)e.update(r[n],t.ARRAY_BUFFER);const i=n.morphAttributes;for(const n in i){const r=i[n];for(let n=0,i=r.length;n<i;n++)e.update(r[n],t.ARRAY_BUFFER)}},getWireframeAttribute:function(t){const e=a.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&s(t)}else s(t);return a.get(t)}}}function hi(t,e,n,r){const i=r.isWebGL2;let a,o,s;this.setMode=function(t){a=t},this.setIndex=function(t){o=t.type,s=t.bytesPerElement},this.render=function(e,r){t.drawElements(a,r,o,e*s),n.update(r,a,1)},this.renderInstances=function(r,A,l){if(0===l)return;let c,u;if(i)c=t,u="drawElementsInstanced";else if(c=e.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===c)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](a,A,o,r*s,l),n.update(A,a,l)},this.renderMultiDraw=function(t,r,i){if(0===i)return;const A=e.get("WEBGL_multi_draw");if(null===A)for(let e=0;e<i;e++)this.render(t[e]/s,r[e]);else{A.multiDrawElementsWEBGL(a,r,0,o,t,0,i);let e=0;for(let t=0;t<i;t++)e+=r[t];n.update(e,a,1)}}}function fi(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(n,r,i){switch(e.calls++,r){case t.TRIANGLES:e.triangles+=i*(n/3);break;case t.LINES:e.lines+=i*(n/2);break;case t.LINE_STRIP:e.lines+=i*(n-1);break;case t.LINE_LOOP:e.lines+=i*n;break;case t.POINTS:e.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function di(t,e){return t[0]-e[0]}function pi(t,e){return Math.abs(e[1])-Math.abs(t[1])}function mi(t,e,n){const r={},i=new Float32Array(8),a=new WeakMap,o=new $t,s=[];for(let t=0;t<8;t++)s[t]=[t,0];return{update:function(A,l,c){const u=A.morphTargetInfluences;if(!0===e.isWebGL2){const h=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,f=void 0!==h?h.length:0;let d=a.get(l);if(void 0===d||d.count!==f){void 0!==d&&d.texture.dispose();const p=void 0!==l.morphAttributes.position,m=void 0!==l.morphAttributes.normal,g=void 0!==l.morphAttributes.color,v=l.morphAttributes.position||[],_=l.morphAttributes.normal||[],y=l.morphAttributes.color||[];let x=0;!0===p&&(x=1),!0===m&&(x=2),!0===g&&(x=3);let b=l.attributes.position.count*x,M=1;b>e.maxTextureSize&&(M=Math.ceil(b/e.maxTextureSize),b=e.maxTextureSize);const w=new Float32Array(b*M*4*f),E=new ne(w,b,M,f);E.type=V,E.needsUpdate=!0;const S=4*x;for(let C=0;C<f;C++){const R=v[C],P=_[C],L=y[C],D=b*M*4*C;for(let O=0;O<R.count;O++){const I=O*S;!0===p&&(o.fromBufferAttribute(R,O),w[D+I+0]=o.x,w[D+I+1]=o.y,w[D+I+2]=o.z,w[D+I+3]=0),!0===m&&(o.fromBufferAttribute(P,O),w[D+I+4]=o.x,w[D+I+5]=o.y,w[D+I+6]=o.z,w[D+I+7]=0),!0===g&&(o.fromBufferAttribute(L,O),w[D+I+8]=o.x,w[D+I+9]=o.y,w[D+I+10]=o.z,w[D+I+11]=4===L.itemSize?o.w:1)}}function T(){E.dispose(),a.delete(l),l.removeEventListener("dispose",T)}d={count:f,texture:E,size:new Lt(b,M)},a.set(l,d),l.addEventListener("dispose",T)}if(!0===A.isInstancedMesh&&null!==A.morphTexture)c.getUniforms().setValue(t,"morphTexture",A.morphTexture,n);else{let q=0;for(let N=0;N<u.length;N++)q+=u[N];const U=l.morphTargetsRelative?1:1-q;c.getUniforms().setValue(t,"morphTargetBaseInfluence",U),c.getUniforms().setValue(t,"morphTargetInfluences",u)}c.getUniforms().setValue(t,"morphTargetsTexture",d.texture,n),c.getUniforms().setValue(t,"morphTargetsTextureSize",d.size)}else{const B=void 0===u?0:u.length;let k=r[l.id];if(void 0===k||k.length!==B){k=[];for(let j=0;j<B;j++)k[j]=[j,0];r[l.id]=k}for(let W=0;W<B;W++){const X=k[W];X[0]=W,X[1]=u[W]}k.sort(pi);for(let Q=0;Q<8;Q++)Q<B&&k[Q][1]?(s[Q][0]=k[Q][0],s[Q][1]=k[Q][1]):(s[Q][0]=Number.MAX_SAFE_INTEGER,s[Q][1]=0);s.sort(di);const F=l.morphAttributes.position,z=l.morphAttributes.normal;let G=0;for(let Y=0;Y<8;Y++){const Z=s[Y],K=Z[0],J=Z[1];K!==Number.MAX_SAFE_INTEGER&&J?(F&&l.getAttribute("morphTarget"+Y)!==F[K]&&l.setAttribute("morphTarget"+Y,F[K]),z&&l.getAttribute("morphNormal"+Y)!==z[K]&&l.setAttribute("morphNormal"+Y,z[K]),i[Y]=J,G+=J):(F&&!0===l.hasAttribute("morphTarget"+Y)&&l.deleteAttribute("morphTarget"+Y),z&&!0===l.hasAttribute("morphNormal"+Y)&&l.deleteAttribute("morphNormal"+Y),i[Y]=0)}const H=l.morphTargetsRelative?1:1-G;c.getUniforms().setValue(t,"morphTargetBaseInfluence",H),c.getUniforms().setValue(t,"morphTargetInfluences",i)}}}}function gi(t,e,n,r){let i=new WeakMap;function a(t){const e=t.target;e.removeEventListener("dispose",a),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:function(o){const s=r.render.frame,A=o.geometry,l=e.get(o,A);if(i.get(l)!==s&&(e.update(l),i.set(l,s)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",a)&&o.addEventListener("dispose",a),i.get(o)!==s&&(n.update(o.instanceMatrix,t.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,t.ARRAY_BUFFER),i.set(o,s))),o.isSkinnedMesh){const t=o.skeleton;i.get(t)!==s&&(t.update(),i.set(t,s))}return l},dispose:function(){i=new WeakMap}}}class vi extends Jt{constructor(t,e,n,r,i,a,o,s,A,l){if((l=void 0!==l?l:Y)!==Y&&l!==Z)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===Y&&(n=j),void 0===n&&l===Z&&(n=X),super(null,r,i,a,o,s,l,n,A),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==o?o:U,this.minFilter=void 0!==s?s:U,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}const _i=new Jt,yi=new vi(1,1);yi.compareFunction=515;const xi=new ne,bi=new re,Mi=new br,wi=[],Ei=[],Si=new Float32Array(16),Ti=new Float32Array(9),Ci=new Float32Array(4);function Ri(t,e,n){const r=t[0];if(r<=0||r>0)return t;const i=e*n;let a=wi[i];if(void 0===a&&(a=new Float32Array(i),wi[i]=a),0!==e){r.toArray(a,0);for(let r=1,i=0;r!==e;++r)i+=n,t[r].toArray(a,i)}return a}function Pi(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Li(t,e){for(let n=0,r=e.length;n<r;n++)t[n]=e[n]}function Di(t,e){let n=Ei[e];void 0===n&&(n=new Int32Array(e),Ei[e]=n);for(let r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function Oi(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Ii(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Pi(n,e))return;t.uniform2fv(this.addr,e),Li(n,e)}}function qi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Pi(n,e))return;t.uniform3fv(this.addr,e),Li(n,e)}}function Ui(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Pi(n,e))return;t.uniform4fv(this.addr,e),Li(n,e)}}function Ni(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Pi(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Li(n,e)}else{if(Pi(n,r))return;Ci.set(r),t.uniformMatrix2fv(this.addr,!1,Ci),Li(n,r)}}function Bi(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Pi(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Li(n,e)}else{if(Pi(n,r))return;Ti.set(r),t.uniformMatrix3fv(this.addr,!1,Ti),Li(n,r)}}function ki(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Pi(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Li(n,e)}else{if(Pi(n,r))return;Si.set(r),t.uniformMatrix4fv(this.addr,!1,Si),Li(n,r)}}function Fi(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function zi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Pi(n,e))return;t.uniform2iv(this.addr,e),Li(n,e)}}function Gi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Pi(n,e))return;t.uniform3iv(this.addr,e),Li(n,e)}}function Hi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Pi(n,e))return;t.uniform4iv(this.addr,e),Li(n,e)}}function ji(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Vi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Pi(n,e))return;t.uniform2uiv(this.addr,e),Li(n,e)}}function Wi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Pi(n,e))return;t.uniform3uiv(this.addr,e),Li(n,e)}}function Xi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Pi(n,e))return;t.uniform4uiv(this.addr,e),Li(n,e)}}function Qi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i);const a=this.type===t.SAMPLER_2D_SHADOW?yi:_i;n.setTexture2D(e||a,i)}function Yi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||bi,i)}function Zi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(e||Mi,i)}function Ki(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||xi,i)}function Ji(t,e){t.uniform1fv(this.addr,e)}function $i(t,e){const n=Ri(e,this.size,2);t.uniform2fv(this.addr,n)}function ta(t,e){const n=Ri(e,this.size,3);t.uniform3fv(this.addr,n)}function ea(t,e){const n=Ri(e,this.size,4);t.uniform4fv(this.addr,n)}function na(t,e){const n=Ri(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function ra(t,e){const n=Ri(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function ia(t,e){const n=Ri(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function aa(t,e){t.uniform1iv(this.addr,e)}function oa(t,e){t.uniform2iv(this.addr,e)}function sa(t,e){t.uniform3iv(this.addr,e)}function Aa(t,e){t.uniform4iv(this.addr,e)}function la(t,e){t.uniform1uiv(this.addr,e)}function ca(t,e){t.uniform2uiv(this.addr,e)}function ua(t,e){t.uniform3uiv(this.addr,e)}function ha(t,e){t.uniform4uiv(this.addr,e)}function fa(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTexture2D(e[t]||_i,a[t])}function da(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTexture3D(e[t]||bi,a[t])}function pa(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTextureCube(e[t]||Mi,a[t])}function ma(t,e,n){const r=this.cache,i=e.length,a=Di(n,i);Pi(r,a)||(t.uniform1iv(this.addr,a),Li(r,a));for(let t=0;t!==i;++t)n.setTexture2DArray(e[t]||xi,a[t])}class ga{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=function(t){switch(t){case 5126:return Oi;case 35664:return Ii;case 35665:return qi;case 35666:return Ui;case 35674:return Ni;case 35675:return Bi;case 35676:return ki;case 5124:case 35670:return Fi;case 35667:case 35671:return zi;case 35668:case 35672:return Gi;case 35669:case 35673:return Hi;case 5125:return ji;case 36294:return Vi;case 36295:return Wi;case 36296:return Xi;case 35678:case 36198:case 36298:case 36306:case 35682:return Qi;case 35679:case 36299:case 36307:return Yi;case 35680:case 36300:case 36308:case 36293:return Zi;case 36289:case 36303:case 36311:case 36292:return Ki}}(e.type)}}class va{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Ji;case 35664:return $i;case 35665:return ta;case 35666:return ea;case 35674:return na;case 35675:return ra;case 35676:return ia;case 5124:case 35670:return aa;case 35667:case 35671:return oa;case 35668:case 35672:return sa;case 35669:case 35673:return Aa;case 5125:return la;case 36294:return ca;case 36295:return ua;case 36296:return ha;case 35678:case 36198:case 36298:case 36306:case 35682:return fa;case 35679:case 36299:case 36307:return da;case 35680:case 36300:case 36308:case 36293:return pa;case 36289:case 36303:case 36311:case 36292:return ma}}(e.type)}}class _a{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const r=this.seq;for(let i=0,a=r.length;i!==a;++i){const a=r[i];a.setValue(t,e[a.id],n)}}}const ya=/(\w+)(\])?(\[|\.)?/g;function xa(t,e){t.seq.push(e),t.map[e.id]=e}function ba(t,e,n){const r=t.name,i=r.length;for(ya.lastIndex=0;;){const a=ya.exec(r),o=ya.lastIndex;let s=a[1];const A="]"===a[2],l=a[3];if(A&&(s|=0),void 0===l||"["===l&&o+2===i){xa(n,void 0===l?new ga(s,t,e):new va(s,t,e));break}{let t=n.map[s];void 0===t&&(t=new _a(s),xa(n,t)),n=t}}}class Ma{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const n=t.getActiveUniform(e,r);ba(n,t.getUniformLocation(e,n.name),this)}}setValue(t,e,n,r){const i=this.map[e];void 0!==i&&i.setValue(t,n,r)}setOptional(t,e,n){const r=e[n];void 0!==r&&this.setValue(t,n,r)}static upload(t,e,n,r){for(let i=0,a=e.length;i!==a;++i){const a=e[i],o=n[a.id];!1!==o.needsUpdate&&a.setValue(t,o.value,r)}}static seqWithValue(t,e){const n=[];for(let r=0,i=t.length;r!==i;++r){const i=t[r];i.id in e&&n.push(i)}return n}}function wa(t,e,n){const r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}const Ea=37297;let Sa=0;function Ta(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&""===i)return"";const a=/ERROR: 0:(\d+)/.exec(i);if(a){const r=parseInt(a[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(t,e){const n=t.split("\n"),r=[],i=Math.max(e-6,0),a=Math.min(e+6,n.length);for(let t=i;t<a;t++){const i=t+1;r.push(`${i===e?">":" "} ${i}: ${n[t]}`)}return r.join("\n")}(t.getShaderSource(e),r)}return i}function Ca(t,e){const n=function(t){const e=Ht.getPrimaries(Ht.workingColorSpace),n=Ht.getPrimaries(t);let r;switch(e===n?r="":e===ct&&n===lt?r="LinearDisplayP3ToLinearSRGB":e===lt&&n===ct&&(r="LinearSRGBToLinearDisplayP3"),t){case it:case ot:return[r,"LinearTransferOETF"];case rt:case at:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[r,"LinearTransferOETF"]}}(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function Ra(t,e){let n;switch(e){case M:n="Linear";break;case w:n="Reinhard";break;case E:n="OptimizedCineon";break;case S:n="ACESFilmic";break;case C:n="AgX";break;case R:n="Neutral";break;case T:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Pa(t){return""!==t}function La(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Da(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Oa=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ia(t){return t.replace(Oa,Ua)}const qa=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function Ua(t,e){let n=Ir[e];if(void 0===n){const t=qa.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");n=Ir[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return Ia(n)}const Na=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Ba(t){return t.replace(Na,ka)}function ka(t,e,n,r){let i="";for(let t=parseInt(e);t<parseInt(n);t++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return i}function Fa(t){let e=`precision ${t.precision} float;\n\tprecision ${t.precision} int;\n\tprecision ${t.precision} sampler2D;\n\tprecision ${t.precision} samplerCube;\n\t`;return t.isWebGL2&&(e+=`precision ${t.precision} sampler3D;\n\t\tprecision ${t.precision} sampler2DArray;\n\t\tprecision ${t.precision} sampler2DShadow;\n\t\tprecision ${t.precision} samplerCubeShadow;\n\t\tprecision ${t.precision} sampler2DArrayShadow;\n\t\tprecision ${t.precision} isampler2D;\n\t\tprecision ${t.precision} isampler3D;\n\t\tprecision ${t.precision} isamplerCube;\n\t\tprecision ${t.precision} isampler2DArray;\n\t\tprecision ${t.precision} usampler2D;\n\t\tprecision ${t.precision} usampler3D;\n\t\tprecision ${t.precision} usamplerCube;\n\t\tprecision ${t.precision} usampler2DArray;\n\t\t`),"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function za(t,e,n,r){const i=t.getContext(),a=n.defines;let o=n.vertexShader,s=n.fragmentShader;const A=function(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===f?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===d?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===p&&(e="SHADOWMAP_TYPE_VSM"),e}(n),l=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case P:case L:e="ENVMAP_TYPE_CUBE";break;case D:e="ENVMAP_TYPE_CUBE_UV"}return e}(n),c=function(t){let e="ENVMAP_MODE_REFLECTION";t.envMap&&t.envMapMode===L&&(e="ENVMAP_MODE_REFRACTION");return e}(n),u=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case _:e="ENVMAP_BLENDING_MULTIPLY";break;case y:e="ENVMAP_BLENDING_MIX";break;case x:e="ENVMAP_BLENDING_ADD"}return e}(n),h=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const n=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),m=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.alphaToCoverage||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Pa).join("\n")}(n),g=function(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Pa).join("\n")}(n),v=function(t){const e=[];for(const n in t){const r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(a),M=i.createProgram();let w,E,S=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(w=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(Pa).join("\n"),w.length>0&&(w+="\n"),E=[m,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(Pa).join("\n"),E.length>0&&(E+="\n")):(w=[Fa(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+A:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Pa).join("\n"),E=[m,Fa(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+A:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==b?"#define TONE_MAPPING":"",n.toneMapping!==b?Ir.tonemapping_pars_fragment:"",n.toneMapping!==b?Ra("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Ir.colorspace_pars_fragment,Ca("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Pa).join("\n")),o=Ia(o),o=La(o,n),o=Da(o,n),s=Ia(s),s=La(s,n),s=Da(s,n),o=Ba(o),s=Ba(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(S="#version 300 es\n",w=[g,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+w,E=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===ft?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===ft?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+E);const T=S+w+o,C=S+E+s,R=wa(i,i.VERTEX_SHADER,T),O=wa(i,i.FRAGMENT_SHADER,C);function I(e){if(t.debug.checkShaderErrors){const n=i.getProgramInfoLog(M).trim(),r=i.getShaderInfoLog(R).trim(),a=i.getShaderInfoLog(O).trim();let o=!0,s=!0;if(!1===i.getProgramParameter(M,i.LINK_STATUS))if(o=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(i,M,R,O);else{const t=Ta(i,R,"vertex"),r=Ta(i,O,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(M,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+e.name+"\nMaterial Type: "+e.type+"\n\nProgram Info Log: "+n+"\n"+t+"\n"+r)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==r&&""!==a||(s=!1);s&&(e.diagnostics={runnable:o,programLog:n,vertexShader:{log:r,prefix:w},fragmentShader:{log:a,prefix:E}})}i.deleteShader(R),i.deleteShader(O),q=new Ma(i,M),U=function(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const r=t.getActiveAttrib(e,i),a=r.name;let o=1;r.type===t.FLOAT_MAT2&&(o=2),r.type===t.FLOAT_MAT3&&(o=3),r.type===t.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:t.getAttribLocation(e,a),locationSize:o}}return n}(i,M)}let q,U;i.attachShader(M,R),i.attachShader(M,O),void 0!==n.index0AttributeName?i.bindAttribLocation(M,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(M,0,"position"),i.linkProgram(M),this.getUniforms=function(){return void 0===q&&I(this),q},this.getAttributes=function(){return void 0===U&&I(this),U};let N=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===N&&(N=i.getProgramParameter(M,Ea)),N},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(M),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=Sa++,this.cacheKey=e,this.usedTimes=1,this.program=M,this.vertexShader=R,this.fragmentShader=O,this}let Ga=0;class Ha{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,r=this._getShaderStage(e),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return!1===a.has(r)&&(a.add(r),r.usedTimes++),!1===a.has(i)&&(a.add(i),i.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return void 0===n&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return void 0===n&&(n=new ja(t),e.set(t,n)),n}}class ja{constructor(t){this.id=Ga++,this.code=t,this.usedTimes=0}}function Va(t,e,n,r,i,a,o){const s=new We,A=new Ha,l=new Set,c=[],u=i.isWebGL2,h=i.logarithmicDepthBuffer,f=i.vertexTextures;let d=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(t){return l.add(t),0===t?"uv":`uv${t}`}return{getParameters:function(a,s,c,v,_){const y=v.fog,x=_.geometry,M=a.isMeshStandardMaterial?v.environment:null,w=(a.isMeshStandardMaterial?n:e).get(a.envMap||M),E=w&&w.mapping===D?w.image.height:null,S=p[a.type];null!==a.precision&&(d=i.getMaxPrecision(a.precision),d!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",d,"instead."));const T=x.morphAttributes.position||x.morphAttributes.normal||x.morphAttributes.color,C=void 0!==T?T.length:0;let R,P,L,O,I=0;if(void 0!==x.morphAttributes.position&&(I=1),void 0!==x.morphAttributes.normal&&(I=2),void 0!==x.morphAttributes.color&&(I=3),S){const t=Ur[S];R=t.vertexShader,P=t.fragmentShader}else R=a.vertexShader,P=a.fragmentShader,A.update(a),L=A.getVertexShaderID(a),O=A.getFragmentShaderID(a);const q=t.getRenderTarget(),U=!0===_.isInstancedMesh,N=!0===_.isBatchedMesh,B=!!a.map,k=!!a.matcap,F=!!w,z=!!a.aoMap,G=!!a.lightMap,H=!!a.bumpMap,j=!!a.normalMap,V=!!a.displacementMap,W=!!a.emissiveMap,X=!!a.metalnessMap,Q=!!a.roughnessMap,Y=a.anisotropy>0,Z=a.clearcoat>0,K=a.iridescence>0,J=a.sheen>0,$=a.transmission>0,tt=Y&&!!a.anisotropyMap,et=Z&&!!a.clearcoatMap,nt=Z&&!!a.clearcoatNormalMap,rt=Z&&!!a.clearcoatRoughnessMap,at=K&&!!a.iridescenceMap,ot=K&&!!a.iridescenceThicknessMap,st=J&&!!a.sheenColorMap,lt=J&&!!a.sheenRoughnessMap,ct=!!a.specularMap,ut=!!a.specularColorMap,ht=!!a.specularIntensityMap,ft=$&&!!a.transmissionMap,dt=$&&!!a.thicknessMap,pt=!!a.gradientMap,mt=!!a.alphaMap,gt=a.alphaTest>0,vt=!!a.alphaHash,_t=!!a.extensions;let yt=b;a.toneMapped&&(null!==q&&!0!==q.isXRRenderTarget||(yt=t.toneMapping));const xt={isWebGL2:u,shaderID:S,shaderType:a.type,shaderName:a.name,vertexShader:R,fragmentShader:P,defines:a.defines,customVertexShaderID:L,customFragmentShaderID:O,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:d,batching:N,instancing:U,instancingColor:U&&null!==_.instanceColor,instancingMorph:U&&null!==_.morphTexture,supportsVertexTextures:f,outputColorSpace:null===q?t.outputColorSpace:!0===q.isXRRenderTarget?q.texture.colorSpace:it,alphaToCoverage:!!a.alphaToCoverage,map:B,matcap:k,envMap:F,envMapMode:F&&w.mapping,envMapCubeUVHeight:E,aoMap:z,lightMap:G,bumpMap:H,normalMap:j,displacementMap:f&&V,emissiveMap:W,normalMapObjectSpace:j&&1===a.normalMapType,normalMapTangentSpace:j&&0===a.normalMapType,metalnessMap:X,roughnessMap:Q,anisotropy:Y,anisotropyMap:tt,clearcoat:Z,clearcoatMap:et,clearcoatNormalMap:nt,clearcoatRoughnessMap:rt,iridescence:K,iridescenceMap:at,iridescenceThicknessMap:ot,sheen:J,sheenColorMap:st,sheenRoughnessMap:lt,specularMap:ct,specularColorMap:ut,specularIntensityMap:ht,transmission:$,transmissionMap:ft,thicknessMap:dt,gradientMap:pt,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:mt,alphaTest:gt,alphaHash:vt,combine:a.combine,mapUv:B&&m(a.map.channel),aoMapUv:z&&m(a.aoMap.channel),lightMapUv:G&&m(a.lightMap.channel),bumpMapUv:H&&m(a.bumpMap.channel),normalMapUv:j&&m(a.normalMap.channel),displacementMapUv:V&&m(a.displacementMap.channel),emissiveMapUv:W&&m(a.emissiveMap.channel),metalnessMapUv:X&&m(a.metalnessMap.channel),roughnessMapUv:Q&&m(a.roughnessMap.channel),anisotropyMapUv:tt&&m(a.anisotropyMap.channel),clearcoatMapUv:et&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:nt&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:rt&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:at&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:ot&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:st&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:lt&&m(a.sheenRoughnessMap.channel),specularMapUv:ct&&m(a.specularMap.channel),specularColorMapUv:ut&&m(a.specularColorMap.channel),specularIntensityMapUv:ht&&m(a.specularIntensityMap.channel),transmissionMapUv:ft&&m(a.transmissionMap.channel),thicknessMapUv:dt&&m(a.thicknessMap.channel),alphaMapUv:mt&&m(a.alphaMap.channel),vertexTangents:!!x.attributes.tangent&&(j||Y),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!x.attributes.color&&4===x.attributes.color.itemSize,pointsUvs:!0===_.isPoints&&!!x.attributes.uv&&(B||mt),fog:!!y,useFog:!0===a.fog,fogExp2:!!y&&y.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===_.isSkinnedMesh,morphTargets:void 0!==x.morphAttributes.position,morphNormals:void 0!==x.morphAttributes.normal,morphColors:void 0!==x.morphAttributes.color,morphTargetsCount:C,morphTextureStride:I,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:yt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:B&&!0===a.map.isVideoTexture&&Ht.getTransfer(a.map.colorSpace)===At,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:a.side===g,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionDerivatives:_t&&!0===a.extensions.derivatives,extensionFragDepth:_t&&!0===a.extensions.fragDepth,extensionDrawBuffers:_t&&!0===a.extensions.drawBuffers,extensionShaderTextureLOD:_t&&!0===a.extensions.shaderTextureLOD,extensionClipCullDistance:_t&&!0===a.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:_t&&!0===a.extensions.multiDraw&&r.has("WEBGL_multi_draw"),rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return xt.vertexUv1s=l.has(1),xt.vertexUv2s=l.has(2),xt.vertexUv3s=l.has(3),l.clear(),xt},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){s.disableAll(),e.isWebGL2&&s.enable(0);e.supportsVertexTextures&&s.enable(1);e.instancing&&s.enable(2);e.instancingColor&&s.enable(3);e.instancingMorph&&s.enable(4);e.matcap&&s.enable(5);e.envMap&&s.enable(6);e.normalMapObjectSpace&&s.enable(7);e.normalMapTangentSpace&&s.enable(8);e.clearcoat&&s.enable(9);e.iridescence&&s.enable(10);e.alphaTest&&s.enable(11);e.vertexColors&&s.enable(12);e.vertexAlphas&&s.enable(13);e.vertexUv1s&&s.enable(14);e.vertexUv2s&&s.enable(15);e.vertexUv3s&&s.enable(16);e.vertexTangents&&s.enable(17);e.anisotropy&&s.enable(18);e.alphaHash&&s.enable(19);e.batching&&s.enable(20);t.push(s.mask),s.disableAll(),e.fog&&s.enable(0);e.useFog&&s.enable(1);e.flatShading&&s.enable(2);e.logarithmicDepthBuffer&&s.enable(3);e.skinning&&s.enable(4);e.morphTargets&&s.enable(5);e.morphNormals&&s.enable(6);e.morphColors&&s.enable(7);e.premultipliedAlpha&&s.enable(8);e.shadowMapEnabled&&s.enable(9);e.useLegacyLights&&s.enable(10);e.doubleSided&&s.enable(11);e.flipSided&&s.enable(12);e.useDepthPacking&&s.enable(13);e.dithering&&s.enable(14);e.transmission&&s.enable(15);e.sheen&&s.enable(16);e.opaque&&s.enable(17);e.pointsUvs&&s.enable(18);e.decodeVideoTexture&&s.enable(19);e.alphaToCoverage&&s.enable(20);t.push(s.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=p[t.type];let n;if(e){const t=Ur[e];n=fr.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let r;for(let t=0,e=c.length;t<e;t++){const e=c[t];if(e.cacheKey===n){r=e,++r.usedTimes;break}}return void 0===r&&(r=new za(t,n,e,a),c.push(r)),r},releaseProgram:function(t){if(0==--t.usedTimes){const e=c.indexOf(t);c[e]=c[c.length-1],c.pop(),t.destroy()}},releaseShaderCache:function(t){A.remove(t)},programs:c,dispose:function(){A.dispose()}}}function Wa(){let t=new WeakMap;return{get:function(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,r){t.get(e)[n]=r},dispose:function(){t=new WeakMap}}}function Xa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Qa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Ya(){const t=[];let e=0;const n=[],r=[],i=[];function a(n,r,i,a,o,s){let A=t[e];return void 0===A?(A={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},t[e]=A):(A.id=n.id,A.object=n,A.geometry=r,A.material=i,A.groupOrder=a,A.renderOrder=n.renderOrder,A.z=o,A.group=s),e++,A}return{opaque:n,transmissive:r,transparent:i,init:function(){e=0,n.length=0,r.length=0,i.length=0},push:function(t,e,o,s,A,l){const c=a(t,e,o,s,A,l);o.transmission>0?r.push(c):!0===o.transparent?i.push(c):n.push(c)},unshift:function(t,e,o,s,A,l){const c=a(t,e,o,s,A,l);o.transmission>0?r.unshift(c):!0===o.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(let n=e,r=t.length;n<r;n++){const e=t[n];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}},sort:function(t,e){n.length>1&&n.sort(t||Xa),r.length>1&&r.sort(e||Qa),i.length>1&&i.sort(e||Qa)}}}function Za(){let t=new WeakMap;return{get:function(e,n){const r=t.get(e);let i;return void 0===r?(i=new Ya,t.set(e,[i])):n>=r.length?(i=new Ya,r.push(i)):i=r[n],i},dispose:function(){t=new WeakMap}}}function Ka(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ae,color:new En};break;case"SpotLight":n={position:new ae,direction:new ae,color:new En,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ae,color:new En,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ae,skyColor:new En,groundColor:new En};break;case"RectAreaLight":n={color:new En,position:new ae,halfWidth:new ae,halfHeight:new ae}}return t[e.id]=n,n}}}let Ja=0;function $a(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function to(t,e){const n=new Ka,r=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let t=0;t<9;t++)i.probe.push(new ae);const a=new ae,o=new qe,s=new qe;return{setup:function(a,o){let s=0,A=0,l=0;for(let t=0;t<9;t++)i.probe[t].set(0,0,0);let c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;a.sort($a);const x=!0===o?Math.PI:1;for(let t=0,e=a.length;t<e;t++){const e=a[t],o=e.color,b=e.intensity,M=e.distance,w=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)s+=o.r*b*x,A+=o.g*b*x,l+=o.b*b*x;else if(e.isLightProbe){for(let t=0;t<9;t++)i.probe[t].addScaledVector(e.sh.coefficients[t],b);y++}else if(e.isDirectionalLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,i.directionalShadow[c]=n,i.directionalShadowMap[c]=w,i.directionalShadowMatrix[c]=e.shadow.matrix,p++}i.directional[c]=t,c++}else if(e.isSpotLight){const t=n.get(e);t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(o).multiplyScalar(b*x),t.distance=M,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,i.spot[h]=t;const a=e.shadow;if(e.map&&(i.spotLightMap[v]=e.map,v++,a.updateMatrices(e),e.castShadow&&_++),i.spotLightMatrix[h]=a.matrix,e.castShadow){const t=r.get(e);t.shadowBias=a.bias,t.shadowNormalBias=a.normalBias,t.shadowRadius=a.radius,t.shadowMapSize=a.mapSize,i.spotShadow[h]=t,i.spotShadowMap[h]=w,g++}h++}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(o).multiplyScalar(b),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),i.rectArea[f]=t,f++}else if(e.isPointLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,n.shadowCameraNear=t.camera.near,n.shadowCameraFar=t.camera.far,i.pointShadow[u]=n,i.pointShadowMap[u]=w,i.pointShadowMatrix[u]=e.shadow.matrix,m++}i.point[u]=t,u++}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(b*x),t.groundColor.copy(e.groundColor).multiplyScalar(b*x),i.hemi[d]=t,d++}}f>0&&(e.isWebGL2?!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=qr.LTC_FLOAT_1,i.rectAreaLTC2=qr.LTC_FLOAT_2):(i.rectAreaLTC1=qr.LTC_HALF_1,i.rectAreaLTC2=qr.LTC_HALF_2):!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=qr.LTC_FLOAT_1,i.rectAreaLTC2=qr.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=qr.LTC_HALF_1,i.rectAreaLTC2=qr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=s,i.ambient[1]=A,i.ambient[2]=l;const b=i.hash;b.directionalLength===c&&b.pointLength===u&&b.spotLength===h&&b.rectAreaLength===f&&b.hemiLength===d&&b.numDirectionalShadows===p&&b.numPointShadows===m&&b.numSpotShadows===g&&b.numSpotMaps===v&&b.numLightProbes===y||(i.directional.length=c,i.spot.length=h,i.rectArea.length=f,i.point.length=u,i.hemi.length=d,i.directionalShadow.length=p,i.directionalShadowMap.length=p,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=p,i.pointShadowMatrix.length=m,i.spotLightMatrix.length=g+v-_,i.spotLightMap.length=v,i.numSpotLightShadowsWithMaps=_,i.numLightProbes=y,b.directionalLength=c,b.pointLength=u,b.spotLength=h,b.rectAreaLength=f,b.hemiLength=d,b.numDirectionalShadows=p,b.numPointShadows=m,b.numSpotShadows=g,b.numSpotMaps=v,b.numLightProbes=y,i.version=Ja++)},setupView:function(t,e){let n=0,r=0,A=0,l=0,c=0;const u=e.matrixWorldInverse;for(let e=0,h=t.length;e<h;e++){const h=t[e];if(h.isDirectionalLight){const t=i.directional[n];t.direction.setFromMatrixPosition(h.matrixWorld),a.setFromMatrixPosition(h.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(u),n++}else if(h.isSpotLight){const t=i.spot[A];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),t.direction.setFromMatrixPosition(h.matrixWorld),a.setFromMatrixPosition(h.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(u),A++}else if(h.isRectAreaLight){const t=i.rectArea[l];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),s.identity(),o.copy(h.matrixWorld),o.premultiply(u),s.extractRotation(o),t.halfWidth.set(.5*h.width,0,0),t.halfHeight.set(0,.5*h.height,0),t.halfWidth.applyMatrix4(s),t.halfHeight.applyMatrix4(s),l++}else if(h.isPointLight){const t=i.point[r];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),r++}else if(h.isHemisphereLight){const t=i.hemi[c];t.direction.setFromMatrixPosition(h.matrixWorld),t.direction.transformDirection(u),c++}}},state:i}}function eo(t,e){const n=new to(t,e),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(t){n.setup(r,t)},setupLightsView:function(t){n.setupView(r,t)},pushLight:function(t){r.push(t)},pushShadow:function(t){i.push(t)}}}function no(t,e){let n=new WeakMap;return{get:function(r,i=0){const a=n.get(r);let o;return void 0===a?(o=new eo(t,e),n.set(r,[o])):i>=a.length?(o=new eo(t,e),a.push(o)):o=a[i],o},dispose:function(){n=new WeakMap}}}class ro extends Cn{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class io extends Cn{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function ao(t,e,n){let r=new Pr;const i=new Lt,a=new Lt,o=new $t,s=new ro({depthPacking:3201}),A=new io,l={},c=n.maxTextureSize,u={[m]:g,[g]:m,2:2},h=new dr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Lt},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const v=new Hn;v.setAttribute("position",new Dn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new sr(v,h),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=f;let x=this.type;function b(n,r){const a=e.update(_);h.defines.VSM_SAMPLES!==n.blurSamples&&(h.defines.VSM_SAMPLES=n.blurSamples,d.defines.VSM_SAMPLES=n.blurSamples,h.needsUpdate=!0,d.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new ee(i.x,i.y)),h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,a,h,_,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,a,d,_,null)}function M(e,n,r,i){let a=null;const o=!0===r.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===r.isPointLight?A:s,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=a.uuid,e=n.uuid;let r=l[t];void 0===r&&(r={},l[t]=r);let i=r[e];void 0===i&&(i=a.clone(),r[e]=i,n.addEventListener("dispose",E)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,a.side=i===p?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial){t.properties.get(a).light=r}return a}function w(n,i,a,o,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===p)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=e.update(n),A=n.material;if(Array.isArray(A)){const e=r.groups;for(let l=0,c=e.length;l<c;l++){const c=e[l],u=A[c.materialIndex];if(u&&u.visible){const e=M(n,u,o,s);n.onBeforeShadow(t,n,i,a,r,e,c),t.renderBufferDirect(a,null,r,e,n,c),n.onAfterShadow(t,n,i,a,r,e,c)}}}else if(A.visible){const e=M(n,A,o,s);n.onBeforeShadow(t,n,i,a,r,e,null),t.renderBufferDirect(a,null,r,e,n,null),n.onAfterShadow(t,n,i,a,r,e,null)}}const A=n.children;for(let t=0,e=A.length;t<e;t++)w(A[t],i,a,o,s)}function E(t){t.target.removeEventListener("dispose",E);for(const e in l){const n=l[e],r=t.target.uuid;if(r in n){n[r].dispose(),delete n[r]}}}this.render=function(e,n,s){if(!1===y.enabled)return;if(!1===y.autoUpdate&&!1===y.needsUpdate)return;if(0===e.length)return;const A=t.getRenderTarget(),l=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),h=t.state;h.setBlending(0),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);const f=x!==p&&this.type===p,d=x===p&&this.type!==p;for(let A=0,l=e.length;A<l;A++){const l=e[A],u=l.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;i.copy(u.mapSize);const m=u.getFrameExtents();if(i.multiply(m),a.copy(u.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/m.x),i.x=a.x*m.x,u.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/m.y),i.y=a.y*m.y,u.mapSize.y=a.y)),null===u.map||!0===f||!0===d){const t=this.type!==p?{minFilter:U,magFilter:U}:{};null!==u.map&&u.map.dispose(),u.map=new ee(i.x,i.y,t),u.map.texture.name=l.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const g=u.getViewportCount();for(let t=0;t<g;t++){const e=u.getViewport(t);o.set(a.x*e.x,a.y*e.y,a.x*e.z,a.y*e.w),h.viewport(o),u.updateMatrices(l,t),r=u.getFrustum(),w(n,s,u.camera,l,this.type)}!0!==u.isPointLightShadow&&this.type===p&&b(u,s),u.needsUpdate=!1}x=this.type,y.needsUpdate=!1,t.setRenderTarget(A,l,u)}}function oo(t,e,n){const r=n.isWebGL2;const i=new function(){let e=!1;const n=new $t;let r=null;const i=new $t(0,0,0,0);return{setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},setLocked:function(t){e=t},setClear:function(e,r,a,o,s){!0===s&&(e*=o,r*=o,a*=o),n.set(e,r,a,o),!1===i.equals(n)&&(t.clearColor(e,r,a,o),i.copy(n))},reset:function(){e=!1,r=null,i.set(-1,0,0,0)}}},a=new function(){let e=!1,n=null,r=null,i=null;return{setTest:function(e){e?j(t.DEPTH_TEST):V(t.DEPTH_TEST)},setMask:function(r){n===r||e||(t.depthMask(r),n=r)},setFunc:function(e){if(r!==e){switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL)}r=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,n=null,r=null,i=null}}},o=new function(){let e=!1,n=null,r=null,i=null,a=null,o=null,s=null,A=null,l=null;return{setTest:function(n){e||(n?j(t.STENCIL_TEST):V(t.STENCIL_TEST))},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,o){r===e&&i===n&&a===o||(t.stencilFunc(e,n,o),r=e,i=n,a=o)},setOp:function(e,n,r){o===e&&s===n&&A===r||(t.stencilOp(e,n,r),o=e,s=n,A=r)},setLocked:function(t){e=t},setClear:function(e){l!==e&&(t.clearStencil(e),l=e)},reset:function(){e=!1,n=null,r=null,i=null,a=null,o=null,s=null,A=null,l=null}}},s=new WeakMap,A=new WeakMap;let l={},c={},u=new WeakMap,h=[],f=null,d=!1,p=null,m=null,_=null,y=null,x=null,b=null,M=null,w=new En(0,0,0),E=0,S=!1,T=null,C=null,R=null,P=null,L=null;const D=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let O=!1,I=0;const q=t.getParameter(t.VERSION);-1!==q.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(q)[1]),O=I>=1):-1!==q.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(q)[1]),O=I>=2);let U=null,N={};const B=t.getParameter(t.SCISSOR_BOX),k=t.getParameter(t.VIEWPORT),F=(new $t).fromArray(B),z=(new $t).fromArray(k);function G(e,n,i,a){const o=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let s=0;s<i;s++)!r||e!==t.TEXTURE_3D&&e!==t.TEXTURE_2D_ARRAY?t.texImage2D(n+s,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,o):t.texImage3D(n,0,t.RGBA,1,1,a,0,t.RGBA,t.UNSIGNED_BYTE,o);return s}const H={};function j(e){!0!==l[e]&&(t.enable(e),l[e]=!0)}function V(e){!1!==l[e]&&(t.disable(e),l[e]=!1)}H[t.TEXTURE_2D]=G(t.TEXTURE_2D,t.TEXTURE_2D,1),H[t.TEXTURE_CUBE_MAP]=G(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),r&&(H[t.TEXTURE_2D_ARRAY]=G(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),H[t.TEXTURE_3D]=G(t.TEXTURE_3D,t.TEXTURE_3D,1,1)),i.setClear(0,0,0,1),a.setClear(1),o.setClear(0),j(t.DEPTH_TEST),a.setFunc(3),Y(!1),Z(1),j(t.CULL_FACE),Q(0);const W={[v]:t.FUNC_ADD,101:t.FUNC_SUBTRACT,102:t.FUNC_REVERSE_SUBTRACT};if(r)W[103]=t.MIN,W[104]=t.MAX;else{const t=e.get("EXT_blend_minmax");null!==t&&(W[103]=t.MIN_EXT,W[104]=t.MAX_EXT)}const X={200:t.ZERO,201:t.ONE,202:t.SRC_COLOR,204:t.SRC_ALPHA,210:t.SRC_ALPHA_SATURATE,208:t.DST_COLOR,206:t.DST_ALPHA,203:t.ONE_MINUS_SRC_COLOR,205:t.ONE_MINUS_SRC_ALPHA,209:t.ONE_MINUS_DST_COLOR,207:t.ONE_MINUS_DST_ALPHA,211:t.CONSTANT_COLOR,212:t.ONE_MINUS_CONSTANT_COLOR,213:t.CONSTANT_ALPHA,214:t.ONE_MINUS_CONSTANT_ALPHA};function Q(e,n,r,i,a,o,s,A,l,c){if(0!==e){if(!1===d&&(j(t.BLEND),d=!0),5===e)a=a||n,o=o||r,s=s||i,n===m&&a===x||(t.blendEquationSeparate(W[n],W[a]),m=n,x=a),r===_&&i===y&&o===b&&s===M||(t.blendFuncSeparate(X[r],X[i],X[o],X[s]),_=r,y=i,b=o,M=s),!1!==A.equals(w)&&l===E||(t.blendColor(A.r,A.g,A.b,l),w.copy(A),E=l),p=e,S=!1;else if(e!==p||c!==S){if(m===v&&x===v||(t.blendEquation(t.FUNC_ADD),m=v,x=v),c)switch(e){case 1:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.ONE,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}_=null,y=null,b=null,M=null,w.set(0,0,0),E=0,p=e,S=c}}else!0===d&&(V(t.BLEND),d=!1)}function Y(e){T!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),T=e)}function Z(e){0!==e?(j(t.CULL_FACE),e!==C&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):V(t.CULL_FACE),C=e}function K(e,n,r){e?(j(t.POLYGON_OFFSET_FILL),P===n&&L===r||(t.polygonOffset(n,r),P=n,L=r)):V(t.POLYGON_OFFSET_FILL)}return{buffers:{color:i,depth:a,stencil:o},enable:j,disable:V,bindFramebuffer:function(e,n){return c[e]!==n&&(t.bindFramebuffer(e,n),c[e]=n,r&&(e===t.DRAW_FRAMEBUFFER&&(c[t.FRAMEBUFFER]=n),e===t.FRAMEBUFFER&&(c[t.DRAW_FRAMEBUFFER]=n)),!0)},drawBuffers:function(r,i){let a=h,o=!1;if(r){a=u.get(i),void 0===a&&(a=[],u.set(i,a));const e=r.textures;if(a.length!==e.length||a[0]!==t.COLOR_ATTACHMENT0){for(let n=0,r=e.length;n<r;n++)a[n]=t.COLOR_ATTACHMENT0+n;a.length=e.length,o=!0}}else a[0]!==t.BACK&&(a[0]=t.BACK,o=!0);if(o)if(n.isWebGL2)t.drawBuffers(a);else{if(!0!==e.has("WEBGL_draw_buffers"))throw new Error("THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension");e.get("WEBGL_draw_buffers").drawBuffersWEBGL(a)}},useProgram:function(e){return f!==e&&(t.useProgram(e),f=e,!0)},setBlending:Q,setMaterial:function(e,n){2===e.side?V(t.CULL_FACE):j(t.CULL_FACE);let r=e.side===g;n&&(r=!r),Y(r),1===e.blending&&!1===e.transparent?Q(0):Q(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.blendColor,e.blendAlpha,e.premultipliedAlpha),a.setFunc(e.depthFunc),a.setTest(e.depthTest),a.setMask(e.depthWrite),i.setMask(e.colorWrite);const s=e.stencilWrite;o.setTest(s),s&&(o.setMask(e.stencilWriteMask),o.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),o.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),K(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?j(t.SAMPLE_ALPHA_TO_COVERAGE):V(t.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:Y,setCullFace:Z,setLineWidth:function(e){e!==R&&(O&&t.lineWidth(e),R=e)},setPolygonOffset:K,setScissorTest:function(e){e?j(t.SCISSOR_TEST):V(t.SCISSOR_TEST)},activeTexture:function(e){void 0===e&&(e=t.TEXTURE0+D-1),U!==e&&(t.activeTexture(e),U=e)},bindTexture:function(e,n,r){void 0===r&&(r=null===U?t.TEXTURE0+D-1:U);let i=N[r];void 0===i&&(i={type:void 0,texture:void 0},N[r]=i),i.type===e&&i.texture===n||(U!==r&&(t.activeTexture(r),U=r),t.bindTexture(e,n||H[e]),i.type=e,i.texture=n)},unbindTexture:function(){const e=N[U];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{t.compressedTexImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(e,n){let r=A.get(n);void 0===r&&(r=new WeakMap,A.set(n,r));let i=r.get(e);void 0===i&&(i=t.getUniformBlockIndex(n,e.name),r.set(e,i))},uniformBlockBinding:function(e,n){const r=A.get(n).get(e);s.get(n)!==r&&(t.uniformBlockBinding(n,r,e.__bindingPointIndex),s.set(n,r))},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===F.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),F.copy(e))},viewport:function(e){!1===z.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),z.copy(e))},reset:function(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),!0===r&&(t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),l={},U=null,N={},c={},u=new WeakMap,h=[],f=null,d=!1,p=null,m=null,_=null,y=null,x=null,b=null,M=null,w=new En(0,0,0),E=0,S=!1,T=null,C=null,R=null,P=null,L=null,F.set(0,0,t.canvas.width,t.canvas.height),z.set(0,0,t.canvas.width,t.canvas.height),i.reset(),a.reset(),o.reset()}}}function so(t,e,n,r,i,a,o){const s=i.isWebGL2,A=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new Lt,u=new WeakMap;let h;const f=new WeakMap;let d=!1;try{d="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function p(t,e){return d?new OffscreenCanvas(t,e):qt("canvas")}function m(t,e,n,r){let i=1;const a=at(t);if((a.width>r||a.height>r)&&(i=r/Math.max(a.width,a.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&t instanceof VideoFrame){const r=e?Tt:Math.floor,o=r(i*a.width),s=r(i*a.height);void 0===h&&(h=p(o,s));const A=n?p(o,s):h;A.width=o,A.height=s;return A.getContext("2d").drawImage(t,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+o+"x"+s+")."),A}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+")."),t}return t}function g(t){const e=at(t);return St(e.width)&&St(e.height)}function v(t,e){return t.generateMipmaps&&e&&t.minFilter!==U&&t.minFilter!==B}function _(e){t.generateMipmap(e)}function y(n,r,i,a,o=!1){if(!1===s)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let A=r;if(r===t.RED&&(i===t.FLOAT&&(A=t.R32F),i===t.HALF_FLOAT&&(A=t.R16F),i===t.UNSIGNED_BYTE&&(A=t.R8)),r===t.RED_INTEGER&&(i===t.UNSIGNED_BYTE&&(A=t.R8UI),i===t.UNSIGNED_SHORT&&(A=t.R16UI),i===t.UNSIGNED_INT&&(A=t.R32UI),i===t.BYTE&&(A=t.R8I),i===t.SHORT&&(A=t.R16I),i===t.INT&&(A=t.R32I)),r===t.RG&&(i===t.FLOAT&&(A=t.RG32F),i===t.HALF_FLOAT&&(A=t.RG16F),i===t.UNSIGNED_BYTE&&(A=t.RG8)),r===t.RG_INTEGER&&(i===t.UNSIGNED_BYTE&&(A=t.RG8UI),i===t.UNSIGNED_SHORT&&(A=t.RG16UI),i===t.UNSIGNED_INT&&(A=t.RG32UI),i===t.BYTE&&(A=t.RG8I),i===t.SHORT&&(A=t.RG16I),i===t.INT&&(A=t.RG32I)),r===t.RGBA){const e=o?st:Ht.getTransfer(a);i===t.FLOAT&&(A=t.RGBA32F),i===t.HALF_FLOAT&&(A=t.RGBA16F),i===t.UNSIGNED_BYTE&&(A=e===At?t.SRGB8_ALPHA8:t.RGBA8),i===t.UNSIGNED_SHORT_4_4_4_4&&(A=t.RGBA4),i===t.UNSIGNED_SHORT_5_5_5_1&&(A=t.RGB5_A1)}return A!==t.R16F&&A!==t.R32F&&A!==t.RG16F&&A!==t.RG32F&&A!==t.RGBA16F&&A!==t.RGBA32F||e.get("EXT_color_buffer_float"),A}function x(t,e,n){return!0===v(t,n)||t.isFramebufferTexture&&t.minFilter!==U&&t.minFilter!==B?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function b(e){return e===U||1004===e||e===N?t.NEAREST:t.LINEAR}function M(t){const e=t.target;e.removeEventListener("dispose",M),function(t){const e=r.get(t);if(void 0===e.__webglInit)return;const n=t.source,i=f.get(n);if(i){const r=i[e.__cacheKey];r.usedTimes--,0===r.usedTimes&&E(t),0===Object.keys(i).length&&f.delete(n)}r.remove(t)}(e),e.isVideoTexture&&u.delete(e)}function w(e){const n=e.target;n.removeEventListener("dispose",w),function(e){const n=r.get(e);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(n.__webglFramebuffer[e]))for(let r=0;r<n.__webglFramebuffer[e].length;r++)t.deleteFramebuffer(n.__webglFramebuffer[e][r]);else t.deleteFramebuffer(n.__webglFramebuffer[e]);n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[e])}else{if(Array.isArray(n.__webglFramebuffer))for(let e=0;e<n.__webglFramebuffer.length;e++)t.deleteFramebuffer(n.__webglFramebuffer[e]);else t.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let e=0;e<n.__webglColorRenderbuffer.length;e++)n.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(n.__webglColorRenderbuffer[e]);n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const i=e.textures;for(let e=0,n=i.length;e<n;e++){const n=r.get(i[e]);n.__webglTexture&&(t.deleteTexture(n.__webglTexture),o.memory.textures--),r.remove(i[e])}r.remove(e)}(n)}function E(e){const n=r.get(e);t.deleteTexture(n.__webglTexture);const i=e.source;delete f.get(i)[n.__cacheKey],o.memory.textures--}let S=0;function T(e,i){const a=r.get(e);if(e.isVideoTexture&&function(t){const e=o.render.frame;u.get(t)!==e&&(u.set(t,e),t.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&a.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void H(a,e,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,a.__webglTexture,t.TEXTURE0+i)}const C={[O]:t.REPEAT,[I]:t.CLAMP_TO_EDGE,[q]:t.MIRRORED_REPEAT},R={[U]:t.NEAREST,1004:t.NEAREST_MIPMAP_NEAREST,[N]:t.NEAREST_MIPMAP_LINEAR,[B]:t.LINEAR,[k]:t.LINEAR_MIPMAP_NEAREST,[F]:t.LINEAR_MIPMAP_LINEAR},P={512:t.NEVER,519:t.ALWAYS,513:t.LESS,515:t.LEQUAL,514:t.EQUAL,518:t.GEQUAL,516:t.GREATER,517:t.NOTEQUAL};function L(n,a,o){if(a.type!==V||!1!==e.has("OES_texture_float_linear")||a.magFilter!==B&&a.magFilter!==k&&a.magFilter!==N&&a.magFilter!==F&&a.minFilter!==B&&a.minFilter!==k&&a.minFilter!==N&&a.minFilter!==F||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),o?(t.texParameteri(n,t.TEXTURE_WRAP_S,C[a.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,C[a.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,C[a.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,R[a.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,R[a.minFilter])):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),a.wrapS===I&&a.wrapT===I||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,t.TEXTURE_MAG_FILTER,b(a.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,b(a.minFilter)),a.minFilter!==U&&a.minFilter!==B&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),a.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,P[a.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){if(a.magFilter===U)return;if(a.minFilter!==N&&a.minFilter!==F)return;if(a.type===V&&!1===e.has("OES_texture_float_linear"))return;if(!1===s&&a.type===W&&!1===e.has("OES_texture_half_float_linear"))return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){const o=e.get("EXT_texture_filter_anisotropic");t.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function D(e,n){let r=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",M));const i=n.source;let a=f.get(i);void 0===a&&(a={},f.set(i,a));const s=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(s!==e.__cacheKey){void 0===a[s]&&(a[s]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;const i=a[e.__cacheKey];void 0!==i&&(a[e.__cacheKey].usedTimes--,0===i.usedTimes&&E(n)),e.__cacheKey=s,e.__webglTexture=a[s].texture}return r}function H(e,o,A){let l=t.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=t.TEXTURE_3D);const c=D(e,o),u=o.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+A);const h=r.get(u);if(u.version!==h.__version||!0===c){n.activeTexture(t.TEXTURE0+A);const e=Ht.getPrimaries(Ht.workingColorSpace),r=o.colorSpace===nt?null:Ht.getPrimaries(o.colorSpace),f=o.colorSpace===nt||e===r?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,o.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,o.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);const d=function(t){return!s&&(t.wrapS!==I||t.wrapT!==I||t.minFilter!==U&&t.minFilter!==B)}(o)&&!1===g(o.image);let p=m(o.image,d,!1,i.maxTextureSize);p=rt(o,p);const b=g(p)||s,M=a.convert(o.format,o.colorSpace);let w,E=a.convert(o.type),S=y(o.internalFormat,M,E,o.colorSpace,o.isVideoTexture);L(l,o,b);const T=o.mipmaps,C=s&&!0!==o.isVideoTexture&&36196!==S,R=void 0===h.__version||!0===c,P=u.dataReady,D=x(o,p,b);if(o.isDepthTexture)S=t.DEPTH_COMPONENT,s?S=o.type===V?t.DEPTH_COMPONENT32F:o.type===j?t.DEPTH_COMPONENT24:o.type===X?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:o.type===V&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),o.format===Y&&S===t.DEPTH_COMPONENT&&o.type!==G&&o.type!==j&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),o.type=j,E=a.convert(o.type)),o.format===Z&&S===t.DEPTH_COMPONENT&&(S=t.DEPTH_STENCIL,o.type!==X&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),o.type=X,E=a.convert(o.type))),R&&(C?n.texStorage2D(t.TEXTURE_2D,1,S,p.width,p.height):n.texImage2D(t.TEXTURE_2D,0,S,p.width,p.height,0,M,E,null));else if(o.isDataTexture)if(T.length>0&&b){C&&R&&n.texStorage2D(t.TEXTURE_2D,D,S,T[0].width,T[0].height);for(let e=0,r=T.length;e<r;e++)w=T[e],C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,E,w.data):n.texImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,M,E,w.data);o.generateMipmaps=!1}else C?(R&&n.texStorage2D(t.TEXTURE_2D,D,S,p.width,p.height),P&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,p.width,p.height,M,E,p.data)):n.texImage2D(t.TEXTURE_2D,0,S,p.width,p.height,0,M,E,p.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){C&&R&&n.texStorage3D(t.TEXTURE_2D_ARRAY,D,S,T[0].width,T[0].height,p.depth);for(let e=0,r=T.length;e<r;e++)w=T[e],o.format!==Q?null!==M?C?P&&n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,w.width,w.height,p.depth,M,w.data,0,0):n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,S,w.width,w.height,p.depth,0,w.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?P&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,w.width,w.height,p.depth,M,E,w.data):n.texImage3D(t.TEXTURE_2D_ARRAY,e,S,w.width,w.height,p.depth,0,M,E,w.data)}else{C&&R&&n.texStorage2D(t.TEXTURE_2D,D,S,T[0].width,T[0].height);for(let e=0,r=T.length;e<r;e++)w=T[e],o.format!==Q?null!==M?C?P&&n.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,w.data):n.compressedTexImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,E,w.data):n.texImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,M,E,w.data)}else if(o.isDataArrayTexture)C?(R&&n.texStorage3D(t.TEXTURE_2D_ARRAY,D,S,p.width,p.height,p.depth),P&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,M,E,p.data)):n.texImage3D(t.TEXTURE_2D_ARRAY,0,S,p.width,p.height,p.depth,0,M,E,p.data);else if(o.isData3DTexture)C?(R&&n.texStorage3D(t.TEXTURE_3D,D,S,p.width,p.height,p.depth),P&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,M,E,p.data)):n.texImage3D(t.TEXTURE_3D,0,S,p.width,p.height,p.depth,0,M,E,p.data);else if(o.isFramebufferTexture){if(R)if(C)n.texStorage2D(t.TEXTURE_2D,D,S,p.width,p.height);else{let e=p.width,r=p.height;for(let i=0;i<D;i++)n.texImage2D(t.TEXTURE_2D,i,S,e,r,0,M,E,null),e>>=1,r>>=1}}else if(T.length>0&&b){if(C&&R){const e=at(T[0]);n.texStorage2D(t.TEXTURE_2D,D,S,e.width,e.height)}for(let e=0,r=T.length;e<r;e++)w=T[e],C?P&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,M,E,w):n.texImage2D(t.TEXTURE_2D,e,S,M,E,w);o.generateMipmaps=!1}else if(C){if(R){const e=at(p);n.texStorage2D(t.TEXTURE_2D,D,S,e.width,e.height)}P&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,M,E,p)}else n.texImage2D(t.TEXTURE_2D,0,S,M,E,p);v(o,b)&&_(l),h.__version=u.version,o.onUpdate&&o.onUpdate(o)}e.__version=o.version}function K(e,i,o,s,l,c){const u=a.convert(o.format,o.colorSpace),h=a.convert(o.type),f=y(o.internalFormat,u,h,o.colorSpace);if(!r.get(i).__hasExternalTextures){const e=Math.max(1,i.width>>c),r=Math.max(1,i.height>>c);l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?n.texImage3D(l,c,f,e,r,i.depth,0,u,h,null):n.texImage2D(l,c,f,e,r,0,u,h,null)}n.bindFramebuffer(t.FRAMEBUFFER,e),et(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,s,l,r.get(o).__webglTexture,0,tt(i)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,s,l,r.get(o).__webglTexture,c),n.bindFramebuffer(t.FRAMEBUFFER,null)}function J(e,n,r){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer){let i=!0===s?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(r||et(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===V?i=t.DEPTH_COMPONENT32F:e.type===j&&(i=t.DEPTH_COMPONENT24));const r=tt(n);et(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,i,n.width,n.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,r,i,n.width,n.height)}else t.renderbufferStorage(t.RENDERBUFFER,i,n.width,n.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(n.depthBuffer&&n.stencilBuffer){const i=tt(n);r&&!1===et(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,i,t.DEPTH24_STENCIL8,n.width,n.height):et(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,t.DEPTH24_STENCIL8,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=n.textures;for(let i=0;i<e.length;i++){const o=e[i],s=a.convert(o.format,o.colorSpace),l=a.convert(o.type),c=y(o.internalFormat,s,l,o.colorSpace),u=tt(n);r&&!1===et(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,u,c,n.width,n.height):et(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,u,c,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,c,n.width,n.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function $(e){const i=r.get(e),a=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),T(i.depthTexture,0);const a=r.get(i.depthTexture).__webglTexture,o=tt(i);if(i.depthTexture.format===Y)et(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0);else{if(i.depthTexture.format!==Z)throw new Error("Unknown depthTexture format");et(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0)}}(i.__webglFramebuffer,e)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=t.createRenderbuffer(),J(i.__webglDepthbuffer[r],e,!1)}else n.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),J(i.__webglDepthbuffer,e,!1);n.bindFramebuffer(t.FRAMEBUFFER,null)}function tt(t){return Math.min(i.maxSamples,t.samples)}function et(t){const n=r.get(t);return s&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function rt(t,n){const r=t.colorSpace,i=t.format,a=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===dt||r!==it&&r!==nt&&(Ht.getTransfer(r)===At?!1===s?!0===e.has("EXT_sRGB")&&i===Q?(t.format=dt,t.minFilter=B,t.generateMipmaps=!1):n=Xt.sRGBToLinear(n):i===Q&&a===z||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",r)),n}function at(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement?(c.width=t.naturalWidth||t.width,c.height=t.naturalHeight||t.height):"undefined"!=typeof VideoFrame&&t instanceof VideoFrame?(c.width=t.displayWidth,c.height=t.displayHeight):(c.width=t.width,c.height=t.height),c}this.allocateTextureUnit=function(){const t=S;return t>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+i.maxTextures),S+=1,t},this.resetTextureUnits=function(){S=0},this.setTexture2D=T,this.setTexture2DArray=function(e,i){const a=r.get(e);e.version>0&&a.__version!==e.version?H(a,e,i):n.bindTexture(t.TEXTURE_2D_ARRAY,a.__webglTexture,t.TEXTURE0+i)},this.setTexture3D=function(e,i){const a=r.get(e);e.version>0&&a.__version!==e.version?H(a,e,i):n.bindTexture(t.TEXTURE_3D,a.__webglTexture,t.TEXTURE0+i)},this.setTextureCube=function(e,o){const A=r.get(e);e.version>0&&A.__version!==e.version?function(e,o,A){if(6!==o.image.length)return;const l=D(e,o),c=o.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+A);const u=r.get(c);if(c.version!==u.__version||!0===l){n.activeTexture(t.TEXTURE0+A);const e=Ht.getPrimaries(Ht.workingColorSpace),r=o.colorSpace===nt?null:Ht.getPrimaries(o.colorSpace),h=o.colorSpace===nt||e===r?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,o.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,o.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);const f=o.isCompressedTexture||o.image[0].isCompressedTexture,d=o.image[0]&&o.image[0].isDataTexture,p=[];for(let t=0;t<6;t++)p[t]=f||d?d?o.image[t].image:o.image[t]:m(o.image[t],!1,!0,i.maxCubemapSize),p[t]=rt(o,p[t]);const b=p[0],M=g(b)||s,w=a.convert(o.format,o.colorSpace),E=a.convert(o.type),S=y(o.internalFormat,w,E,o.colorSpace),T=s&&!0!==o.isVideoTexture,C=void 0===u.__version||!0===l,R=c.dataReady;let P,D=x(o,b,M);if(L(t.TEXTURE_CUBE_MAP,o,M),f){T&&C&&n.texStorage2D(t.TEXTURE_CUBE_MAP,D,S,b.width,b.height);for(let e=0;e<6;e++){P=p[e].mipmaps;for(let r=0;r<P.length;r++){const i=P[r];o.format!==Q?null!==w?T?R&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,0,0,i.width,i.height,w,i.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,S,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,0,0,i.width,i.height,w,E,i.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,S,i.width,i.height,0,w,E,i.data)}}}else{if(P=o.mipmaps,T&&C){P.length>0&&D++;const e=at(p[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,D,S,e.width,e.height)}for(let e=0;e<6;e++)if(d){T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,p[e].width,p[e].height,w,E,p[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,p[e].width,p[e].height,0,w,E,p[e].data);for(let r=0;r<P.length;r++){const i=P[r].image[e].image;T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,0,0,i.width,i.height,w,E,i.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,S,i.width,i.height,0,w,E,i.data)}}else{T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,w,E,p[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,w,E,p[e]);for(let r=0;r<P.length;r++){const i=P[r];T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,0,0,w,E,i.image[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,S,w,E,i.image[e])}}}v(o,M)&&_(t.TEXTURE_CUBE_MAP),u.__version=c.version,o.onUpdate&&o.onUpdate(o)}e.__version=o.version}(A,e,o):n.bindTexture(t.TEXTURE_CUBE_MAP,A.__webglTexture,t.TEXTURE0+o)},this.rebindTextures=function(e,n,i){const a=r.get(e);void 0!==n&&K(a.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),void 0!==i&&$(e)},this.setupRenderTarget=function(e){const A=e.texture,l=r.get(e),c=r.get(A);e.addEventListener("dispose",w);const u=e.textures,h=!0===e.isWebGLCubeRenderTarget,f=u.length>1,d=g(e)||s;if(f||(void 0===c.__webglTexture&&(c.__webglTexture=t.createTexture()),c.__version=A.version,o.memory.textures++),h){l.__webglFramebuffer=[];for(let e=0;e<6;e++)if(s&&A.mipmaps&&A.mipmaps.length>0){l.__webglFramebuffer[e]=[];for(let n=0;n<A.mipmaps.length;n++)l.__webglFramebuffer[e][n]=t.createFramebuffer()}else l.__webglFramebuffer[e]=t.createFramebuffer()}else{if(s&&A.mipmaps&&A.mipmaps.length>0){l.__webglFramebuffer=[];for(let e=0;e<A.mipmaps.length;e++)l.__webglFramebuffer[e]=t.createFramebuffer()}else l.__webglFramebuffer=t.createFramebuffer();if(f)if(i.drawBuffers)for(let e=0,n=u.length;e<n;e++){const n=r.get(u[e]);void 0===n.__webglTexture&&(n.__webglTexture=t.createTexture(),o.memory.textures++)}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(s&&e.samples>0&&!1===et(e)){l.__webglMultisampledFramebuffer=t.createFramebuffer(),l.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,l.__webglMultisampledFramebuffer);for(let n=0;n<u.length;n++){const r=u[n];l.__webglColorRenderbuffer[n]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,l.__webglColorRenderbuffer[n]);const i=a.convert(r.format,r.colorSpace),o=a.convert(r.type),s=y(r.internalFormat,i,o,r.colorSpace,!0===e.isXRRenderTarget),A=tt(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,A,s,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,l.__webglColorRenderbuffer[n])}t.bindRenderbuffer(t.RENDERBUFFER,null),e.depthBuffer&&(l.__webglDepthRenderbuffer=t.createRenderbuffer(),J(l.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(h){n.bindTexture(t.TEXTURE_CUBE_MAP,c.__webglTexture),L(t.TEXTURE_CUBE_MAP,A,d);for(let n=0;n<6;n++)if(s&&A.mipmaps&&A.mipmaps.length>0)for(let r=0;r<A.mipmaps.length;r++)K(l.__webglFramebuffer[n][r],e,A,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else K(l.__webglFramebuffer[n],e,A,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);v(A,d)&&_(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(f){for(let i=0,a=u.length;i<a;i++){const a=u[i],o=r.get(a);n.bindTexture(t.TEXTURE_2D,o.__webglTexture),L(t.TEXTURE_2D,a,d),K(l.__webglFramebuffer,e,a,t.COLOR_ATTACHMENT0+i,t.TEXTURE_2D,0),v(a,d)&&_(t.TEXTURE_2D)}n.unbindTexture()}else{let r=t.TEXTURE_2D;if((e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(s?r=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(r,c.__webglTexture),L(r,A,d),s&&A.mipmaps&&A.mipmaps.length>0)for(let n=0;n<A.mipmaps.length;n++)K(l.__webglFramebuffer[n],e,A,t.COLOR_ATTACHMENT0,r,n);else K(l.__webglFramebuffer,e,A,t.COLOR_ATTACHMENT0,r,0);v(A,d)&&_(r),n.unbindTexture()}e.depthBuffer&&$(e)},this.updateRenderTargetMipmap=function(e){const i=g(e)||s,a=e.textures;for(let o=0,s=a.length;o<s;o++){const s=a[o];if(v(s,i)){const i=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,a=r.get(s).__webglTexture;n.bindTexture(i,a),_(i),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(s&&e.samples>0&&!1===et(e)){const i=e.textures,a=e.width,o=e.height;let s=t.COLOR_BUFFER_BIT;const A=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,u=r.get(e),h=i.length>1;if(h)for(let e=0;e<i.length;e++)n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){A.push(t.COLOR_ATTACHMENT0+n),e.depthBuffer&&A.push(c);const f=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;if(!1===f&&(e.depthBuffer&&(s|=t.DEPTH_BUFFER_BIT),e.stencilBuffer&&(s|=t.STENCIL_BUFFER_BIT)),h&&t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,u.__webglColorRenderbuffer[n]),!0===f&&(t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[c]),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[c])),h){const e=r.get(i[n]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)}t.blitFramebuffer(0,0,a,o,0,0,a,o,s,t.NEAREST),l&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,A)}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),h)for(let e=0;e<i.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,u.__webglColorRenderbuffer[e]);const a=r.get(i[e]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,a,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=$,this.setupFrameBufferTexture=K,this.useMultisampledRTT=et}function Ao(t,e,n){const r=n.isWebGL2;return{convert:function(n,i=""){let a;const o=Ht.getTransfer(i);if(n===z)return t.UNSIGNED_BYTE;if(1017===n)return t.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return t.UNSIGNED_SHORT_5_5_5_1;if(1010===n)return t.BYTE;if(1011===n)return t.SHORT;if(n===G)return t.UNSIGNED_SHORT;if(n===H)return t.INT;if(n===j)return t.UNSIGNED_INT;if(n===V)return t.FLOAT;if(n===W)return r?t.HALF_FLOAT:(a=e.get("OES_texture_half_float"),null!==a?a.HALF_FLOAT_OES:null);if(1021===n)return t.ALPHA;if(n===Q)return t.RGBA;if(1024===n)return t.LUMINANCE;if(1025===n)return t.LUMINANCE_ALPHA;if(n===Y)return t.DEPTH_COMPONENT;if(n===Z)return t.DEPTH_STENCIL;if(n===dt)return a=e.get("EXT_sRGB"),null!==a?a.SRGB_ALPHA_EXT:null;if(1028===n)return t.RED;if(1029===n)return t.RED_INTEGER;if(1030===n)return t.RG;if(1031===n)return t.RG_INTEGER;if(1033===n)return t.RGBA_INTEGER;if(n===K||n===J||n===$||n===tt)if(o===At){if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===a)return null;if(n===K)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===J)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===$)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===tt)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(a=e.get("WEBGL_compressed_texture_s3tc"),null===a)return null;if(n===K)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===J)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===$)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===tt)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(a=e.get("WEBGL_compressed_texture_pvrtc"),null===a)return null;if(35840===n)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n)return a=e.get("WEBGL_compressed_texture_etc1"),null!==a?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(37492===n||37496===n){if(a=e.get("WEBGL_compressed_texture_etc"),null===a)return null;if(37492===n)return o===At?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(37496===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(a=e.get("WEBGL_compressed_texture_astc"),null===a)return null;if(37808===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===et||36494===n||36495===n){if(a=e.get("EXT_texture_compression_bptc"),null===a)return null;if(n===et)return o===At?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===n)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===n)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||36284===n||36285===n||36286===n){if(a=e.get("EXT_texture_compression_rgtc"),null===a)return null;if(n===et)return a.COMPRESSED_RED_RGTC1_EXT;if(36284===n)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===n)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===n)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===X?r?t.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),null!==a?a.UNSIGNED_INT_24_8_WEBGL:null):void 0!==t[n]?t[n]:null}}}class lo extends _r{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}let co=class extends ln{constructor(){super(),this.isGroup=!0,this.type="Group"}};const uo={type:"move"};class ho{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new co,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new co,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ae,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ae),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new co,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ae,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ae),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,n){let r=null,i=null,a=null;const o=this._targetRay,s=this._grip,A=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(A&&t.hand){a=!0;for(const r of t.hand.values()){const t=e.getJointPose(r,n),i=this._getHandJoint(A,r);null!==t&&(i.matrix.fromArray(t.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=t.radius),i.visible=null!==t}const r=A.joints["index-finger-tip"],i=A.joints["thumb-tip"],o=r.position.distanceTo(i.position),s=.02,l=.005;A.inputState.pinching&&o>s+l?(A.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!A.inputState.pinching&&o<=s-l&&(A.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==s&&t.gripSpace&&(i=e.getPose(t.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));null!==o&&(r=e.getPose(t.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(uo)))}return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==A&&(A.visible=null!==a),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new co;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class fo{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(null===this.texture){const r=new Jt;t.properties.get(r).__webglTexture=e.texture,e.depthNear==n.depthNear&&e.depthFar==n.depthFar||(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r}}render(t,e){if(null!==this.texture){if(null===this.mesh){const t=e.cameras[0].viewport,n=new dr({extensions:{fragDepth:!0},vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new sr(new Or(20,20),n)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}}class po extends gt{constructor(t,e){super();const n=this;let r=null,i=1,a=null,o="local-floor",s=1,A=null,l=null,c=null,u=null,h=null,f=null;const d=new fo,p=e.getContextAttributes();let m=null,g=null;const v=[],_=[],y=new Lt;let x=null;const b=new _r;b.layers.enable(1),b.viewport=new $t;const M=new _r;M.layers.enable(2),M.viewport=new $t;const w=[b,M],E=new lo;E.layers.enable(1),E.layers.enable(2);let S=null,T=null;function C(t){const e=_.indexOf(t.inputSource);if(-1===e)return;const n=v[e];void 0!==n&&(n.update(t.inputSource,t.frame,A||a),n.dispatchEvent({type:t.type,data:t.inputSource}))}function R(){r.removeEventListener("select",C),r.removeEventListener("selectstart",C),r.removeEventListener("selectend",C),r.removeEventListener("squeeze",C),r.removeEventListener("squeezestart",C),r.removeEventListener("squeezeend",C),r.removeEventListener("end",R),r.removeEventListener("inputsourceschange",P);for(let t=0;t<v.length;t++){const e=_[t];null!==e&&(_[t]=null,v[t].disconnect(e))}S=null,T=null,d.reset(),t.setRenderTarget(m),h=null,u=null,c=null,r=null,g=null,q.stop(),n.isPresenting=!1,t.setPixelRatio(x),t.setSize(y.width,y.height,!1),n.dispatchEvent({type:"sessionend"})}function P(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e],r=_.indexOf(n);r>=0&&(_[r]=null,v[r].disconnect(n))}for(let e=0;e<t.added.length;e++){const n=t.added[e];let r=_.indexOf(n);if(-1===r){for(let t=0;t<v.length;t++){if(t>=_.length){_.push(n),r=t;break}if(null===_[t]){_[t]=n,r=t;break}}if(-1===r)break}const i=v[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=v[t];return void 0===e&&(e=new ho,v[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=v[t];return void 0===e&&(e=new ho,v[t]=e),e.getGripSpace()},this.getHand=function(t){let e=v[t];return void 0===e&&(e=new ho,v[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){i=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){o=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return A||a},this.setReferenceSpace=function(t){A=t},this.getBaseLayer=function(){return null!==u?u:h},this.getBinding=function(){return c},this.getFrame=function(){return f},this.getSession=function(){return r},this.setSession=async function(l){if(r=l,null!==r){if(m=t.getRenderTarget(),r.addEventListener("select",C),r.addEventListener("selectstart",C),r.addEventListener("selectend",C),r.addEventListener("squeeze",C),r.addEventListener("squeezestart",C),r.addEventListener("squeezeend",C),r.addEventListener("end",R),r.addEventListener("inputsourceschange",P),!0!==p.xrCompatible&&await e.makeXRCompatible(),x=t.getPixelRatio(),t.getSize(y),void 0===r.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==r.renderState.layers||p.antialias,alpha:!0,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:i};h=new XRWebGLLayer(r,e,n),r.updateRenderState({baseLayer:h}),t.setPixelRatio(1),t.setSize(h.framebufferWidth,h.framebufferHeight,!1),g=new ee(h.framebufferWidth,h.framebufferHeight,{format:Q,type:z,colorSpace:t.outputColorSpace,stencilBuffer:p.stencil})}else{let n=null,a=null,o=null;p.depth&&(o=p.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=p.stencil?Z:Y,a=p.stencil?X:j);const s={colorFormat:e.RGBA8,depthFormat:o,scaleFactor:i};c=new XRWebGLBinding(r,e),u=c.createProjectionLayer(s),r.updateRenderState({layers:[u]}),t.setPixelRatio(1),t.setSize(u.textureWidth,u.textureHeight,!1),g=new ee(u.textureWidth,u.textureHeight,{format:Q,type:z,depthTexture:new vi(u.textureWidth,u.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:p.stencil,colorSpace:t.outputColorSpace,samples:p.antialias?4:0});t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(s),A=null,a=await r.requestReferenceSpace(o),q.setContext(r),q.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode};const L=new ae,D=new ae;function O(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===r)return;null!==d.texture&&(t.near=d.depthNear,t.far=d.depthFar),E.near=M.near=b.near=t.near,E.far=M.far=b.far=t.far,S===E.near&&T===E.far||(r.updateRenderState({depthNear:E.near,depthFar:E.far}),S=E.near,T=E.far,b.near=S,b.far=T,M.near=S,M.far=T,b.updateProjectionMatrix(),M.updateProjectionMatrix(),t.updateProjectionMatrix());const e=t.parent,n=E.cameras;O(E,e);for(let t=0;t<n.length;t++)O(n[t],e);2===n.length?function(t,e,n){L.setFromMatrixPosition(e.matrixWorld),D.setFromMatrixPosition(n.matrixWorld);const r=L.distanceTo(D),i=e.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),A=(i[9]+1)/i[5],l=(i[9]-1)/i[5],c=(i[8]-1)/i[0],u=(a[8]+1)/a[0],h=o*c,f=o*u,d=r/(-c+u),p=d*-c;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(p),t.translateZ(d),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const m=o+d,g=s+d,v=h-p,_=f+(r-p),y=A*s/g*m,x=l*s/g*m;t.projectionMatrix.makePerspective(v,_,y,x,m,g),t.projectionMatrixInverse.copy(t.projectionMatrix).invert()}(E,b,M):E.projectionMatrix.copy(b.projectionMatrix),function(t,e,n){null===n?t.matrix.copy(e.matrixWorld):(t.matrix.copy(n.matrixWorld),t.matrix.invert(),t.matrix.multiply(e.matrixWorld));t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*xt*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)}(t,E,e)},this.getCamera=function(){return E},this.getFoveation=function(){if(null!==u||null!==h)return s},this.setFoveation=function(t){s=t,null!==u&&(u.fixedFoveation=t),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=t)},this.hasDepthSensing=function(){return null!==d.texture};let I=null;const q=new Lr;q.setAnimationLoop((function(e,i){if(l=i.getViewerPose(A||a),f=i,null!==l){const e=l.views;null!==h&&(t.setRenderTargetFramebuffer(g,h.framebuffer),t.setRenderTarget(g));let n=!1;e.length!==E.cameras.length&&(E.cameras.length=0,n=!0);for(let r=0;r<e.length;r++){const i=e[r];let a=null;if(null!==h)a=h.getViewport(i);else{const e=c.getViewSubImage(u,i);a=e.viewport,0===r&&(t.setRenderTargetTextures(g,e.colorTexture,u.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(g))}let o=w[r];void 0===o&&(o=new _r,o.layers.enable(r),o.viewport=new $t,w[r]=o),o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(i.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),0===r&&(E.matrix.copy(o.matrix),E.matrix.decompose(E.position,E.quaternion,E.scale)),!0===n&&E.cameras.push(o)}const i=r.enabledFeatures;if(i&&i.includes("depth-sensing")){const n=c.getDepthInformation(e[0]);n&&n.isValid&&n.texture&&d.init(t,n,r.renderState)}}for(let t=0;t<v.length;t++){const e=_[t],n=v[t];null!==e&&void 0!==n&&n.update(e,i,A||a)}d.render(t,E),I&&I(e,i),i.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:i}),f=null})),this.setAnimationLoop=function(t){I=t},this.dispose=function(){}}}const mo=new Ve,go=new qe;function vo(t,e){function n(t,e){!0===t.matrixAutoUpdate&&t.updateMatrix(),e.value.copy(t.matrix)}function r(r,i){r.opacity.value=i.opacity,i.color&&r.diffuse.value.copy(i.color),i.emissive&&r.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(r.map.value=i.map,n(i.map,r.mapTransform)),i.alphaMap&&(r.alphaMap.value=i.alphaMap,n(i.alphaMap,r.alphaMapTransform)),i.bumpMap&&(r.bumpMap.value=i.bumpMap,n(i.bumpMap,r.bumpMapTransform),r.bumpScale.value=i.bumpScale,i.side===g&&(r.bumpScale.value*=-1)),i.normalMap&&(r.normalMap.value=i.normalMap,n(i.normalMap,r.normalMapTransform),r.normalScale.value.copy(i.normalScale),i.side===g&&r.normalScale.value.negate()),i.displacementMap&&(r.displacementMap.value=i.displacementMap,n(i.displacementMap,r.displacementMapTransform),r.displacementScale.value=i.displacementScale,r.displacementBias.value=i.displacementBias),i.emissiveMap&&(r.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,r.emissiveMapTransform)),i.specularMap&&(r.specularMap.value=i.specularMap,n(i.specularMap,r.specularMapTransform)),i.alphaTest>0&&(r.alphaTest.value=i.alphaTest);const a=e.get(i),o=a.envMap,s=a.envMapRotation;if(o&&(r.envMap.value=o,mo.copy(s),mo.x*=-1,mo.y*=-1,mo.z*=-1,o.isCubeTexture&&!1===o.isRenderTargetTexture&&(mo.y*=-1,mo.z*=-1),r.envMapRotation.value.setFromMatrix4(go.makeRotationFromEuler(mo)),r.flipEnvMap.value=o.isCubeTexture&&!1===o.isRenderTargetTexture?-1:1,r.reflectivity.value=i.reflectivity,r.ior.value=i.ior,r.refractionRatio.value=i.refractionRatio),i.lightMap){r.lightMap.value=i.lightMap;const e=!0===t._useLegacyLights?Math.PI:1;r.lightMapIntensity.value=i.lightMapIntensity*e,n(i.lightMap,r.lightMapTransform)}i.aoMap&&(r.aoMap.value=i.aoMap,r.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,r.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,hr(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,i,a,o,s){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(t,i):i.isMeshToonMaterial?(r(t,i),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,i)):i.isMeshPhongMaterial?(r(t,i),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,i)):i.isMeshStandardMaterial?(r(t,i),function(t,r){t.metalness.value=r.metalness,r.metalnessMap&&(t.metalnessMap.value=r.metalnessMap,n(r.metalnessMap,t.metalnessMapTransform));t.roughness.value=r.roughness,r.roughnessMap&&(t.roughnessMap.value=r.roughnessMap,n(r.roughnessMap,t.roughnessMapTransform));const i=e.get(r).envMap;i&&(t.envMapIntensity.value=r.envMapIntensity)}(t,i),i.isMeshPhysicalMaterial&&function(t,e,r){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===g&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=r.texture,t.transmissionSamplerSize.value.set(r.width,r.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,i,s)):i.isMeshMatcapMaterial?(r(t,i),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,i)):i.isMeshDepthMaterial?r(t,i):i.isMeshDistanceMaterial?(r(t,i),function(t,n){const r=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(r.matrixWorld),t.nearDistance.value=r.shadow.camera.near,t.farDistance.value=r.shadow.camera.far}(t,i)):i.isMeshNormalMaterial?r(t,i):i.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,i),i.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,i)):i.isPointsMaterial?function(t,e,r,i){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*r,t.scale.value=.5*i,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,i,a,o):i.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,i):i.isShadowMaterial?(t.color.value.copy(i.color),t.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function _o(t,e,n,r){let i={},a={},o=[];const s=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function A(t,e,n,r){const i=t.value,a=e+"_"+n;if(void 0===r[a])return r[a]="number"==typeof i||"boolean"==typeof i?i:i.clone(),!0;{const t=r[a];if("number"==typeof i||"boolean"==typeof i){if(t!==i)return r[a]=i,!0}else if(!1===t.equals(i))return t.copy(i),!0}return!1}function l(t){const e={boundary:0,storage:0};return"number"==typeof t||"boolean"==typeof t?(e.boundary=4,e.storage=4):t.isVector2?(e.boundary=8,e.storage=8):t.isVector3||t.isColor?(e.boundary=16,e.storage=12):t.isVector4?(e.boundary=16,e.storage=16):t.isMatrix3?(e.boundary=48,e.storage=48):t.isMatrix4?(e.boundary=64,e.storage=64):t.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t),e}function c(e){const n=e.target;n.removeEventListener("dispose",c);const r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),t.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}return{bind:function(t,e){const n=e.program;r.uniformBlockBinding(t,n)},update:function(n,u){let h=i[n.id];void 0===h&&(!function(t){const e=t.uniforms;let n=0;const r=16;for(let t=0,i=e.length;t<i;t++){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0,e=i.length;t<e;t++){const e=i[t],a=Array.isArray(e.value)?e.value:[e.value];for(let t=0,i=a.length;t<i;t++){const i=l(a[t]),o=n%r;0!==o&&r-o<i.boundary&&(n+=r-o),e.__data=new Float32Array(i.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=n,n+=i.storage}}}const i=n%r;i>0&&(n+=r-i);t.__size=n,t.__cache={}}(n),h=function(e){const n=function(){for(let t=0;t<s;t++)if(-1===o.indexOf(t))return o.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();e.__bindingPointIndex=n;const r=t.createBuffer(),i=e.__size,a=e.usage;return t.bindBuffer(t.UNIFORM_BUFFER,r),t.bufferData(t.UNIFORM_BUFFER,i,a),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=h,n.addEventListener("dispose",c));const f=u.program;r.updateUBOMapping(n,f);const d=e.render.frame;a[n.id]!==d&&(!function(e){const n=i[e.id],r=e.uniforms,a=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,n);for(let e=0,n=r.length;e<n;e++){const n=Array.isArray(r[e])?r[e]:[r[e]];for(let r=0,i=n.length;r<i;r++){const i=n[r];if(!0===A(i,e,r,a)){const e=i.__offset,n=Array.isArray(i.value)?i.value:[i.value];let r=0;for(let a=0;a<n.length;a++){const o=n[a],s=l(o);"number"==typeof o||"boolean"==typeof o?(i.__data[0]=o,t.bufferSubData(t.UNIFORM_BUFFER,e+r,i.__data)):o.isMatrix3?(i.__data[0]=o.elements[0],i.__data[1]=o.elements[1],i.__data[2]=o.elements[2],i.__data[3]=0,i.__data[4]=o.elements[3],i.__data[5]=o.elements[4],i.__data[6]=o.elements[5],i.__data[7]=0,i.__data[8]=o.elements[6],i.__data[9]=o.elements[7],i.__data[10]=o.elements[8],i.__data[11]=0):(o.toArray(i.__data,r),r+=s.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,e,i.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}(n),a[n.id]=d)},dispose:function(){for(const e in i)t.deleteBuffer(i[e]);o=[],i={},a={}}}}class yo{constructor(t={}){const{canvas:e=Ut(),context:n=null,depth:r=!0,stencil:i=!0,alpha:a=!1,antialias:o=!1,premultipliedAlpha:A=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1}=t;let h;this.isWebGLRenderer=!0,h=null!==n?n.getContextAttributes().alpha:a;const f=new Uint32Array(4),d=new Int32Array(4);let p=null,v=null;const _=[],y=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=rt,this._useLegacyLights=!1,this.toneMapping=b,this.toneMappingExposure=1;const x=this;let M=!1,w=0,E=0,S=null,T=-1,C=null;const R=new $t,P=new $t;let L=null;const D=new En(0);let O=0,I=e.width,q=e.height,U=1,N=null,B=null;const k=new $t(0,0,I,q),H=new $t(0,0,I,q);let Y=!1;const Z=new Pr;let K=!1,J=!1,$=null;const tt=new qe,et=new Lt,nt=new ae,at={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ot(){return null===S?U:1}let st,At,lt,ct,ut,ht,ft,dt,pt,mt,gt,vt,_t,yt,xt,bt,Mt,wt,Et,St,Ct,Rt,Pt,Dt,Ot=n;function It(t,n){for(let r=0;r<t.length;r++){const i=t[r],a=e.getContext(i,n);if(null!==a)return a}return null}try{const t={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:A,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${s}`),e.addEventListener("webglcontextlost",Bt,!1),e.addEventListener("webglcontextrestored",kt,!1),e.addEventListener("webglcontextcreationerror",Ft,!1),null===Ot){const e=["webgl2","webgl","experimental-webgl"];if(!0===x.isWebGL1Renderer&&e.shift(),Ot=It(e,t),null===Ot)throw It(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}"undefined"!=typeof WebGLRenderingContext&&Ot instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),void 0===Ot.getShaderPrecisionFormat&&(Ot.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function qt(){st=new ci(Ot),At=new Hr(Ot,st,t),st.init(At),Rt=new Ao(Ot,st,At),lt=new oo(Ot,st,At),ct=new fi(Ot),ut=new Wa,ht=new so(Ot,st,lt,ut,At,Rt,ct),ft=new Vr(x),dt=new li(x),pt=new Dr(Ot,At),Pt=new zr(Ot,st,pt,At),mt=new ui(Ot,pt,ct,Pt),gt=new gi(Ot,mt,pt,ct),Et=new mi(Ot,At,ht),bt=new jr(ut),vt=new Va(x,ft,dt,st,At,Pt,bt),_t=new vo(x,ut),yt=new Za,xt=new no(st,At),wt=new Fr(x,ft,dt,lt,gt,h,A),Mt=new ao(x,gt,At),Dt=new _o(Ot,ct,At,lt),St=new Gr(Ot,st,ct,At),Ct=new hi(Ot,st,ct,At),ct.programs=vt.programs,x.capabilities=At,x.extensions=st,x.properties=ut,x.renderLists=yt,x.shadowMap=Mt,x.state=lt,x.info=ct}qt();const Nt=new po(x,Ot);function Bt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function kt(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const t=ct.autoReset,e=Mt.enabled,n=Mt.autoUpdate,r=Mt.needsUpdate,i=Mt.type;qt(),ct.autoReset=t,Mt.enabled=e,Mt.autoUpdate=n,Mt.needsUpdate=r,Mt.type=i}function Ft(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function zt(t){const e=t.target;e.removeEventListener("dispose",zt),function(t){(function(t){const e=ut.get(t).programs;void 0!==e&&(e.forEach((function(t){vt.releaseProgram(t)})),t.isShaderMaterial&&vt.releaseShaderCache(t))})(t),ut.remove(t)}(e)}function Gt(t,e,n){!0===t.transparent&&2===t.side&&!1===t.forceSinglePass?(t.side=g,t.needsUpdate=!0,Kt(t,e,n),t.side=m,t.needsUpdate=!0,Kt(t,e,n),t.side=2):Kt(t,e,n)}this.xr=Nt,this.getContext=function(){return Ot},this.getContextAttributes=function(){return Ot.getContextAttributes()},this.forceContextLoss=function(){const t=st.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=st.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return U},this.setPixelRatio=function(t){void 0!==t&&(U=t,this.setSize(I,q,!1))},this.getSize=function(t){return t.set(I,q)},this.setSize=function(t,n,r=!0){Nt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(I=t,q=n,e.width=Math.floor(t*U),e.height=Math.floor(n*U),!0===r&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return t.set(I*U,q*U).floor()},this.setDrawingBufferSize=function(t,n,r){I=t,q=n,U=r,e.width=Math.floor(t*r),e.height=Math.floor(n*r),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return t.copy(R)},this.getViewport=function(t){return t.copy(k)},this.setViewport=function(t,e,n,r){t.isVector4?k.set(t.x,t.y,t.z,t.w):k.set(t,e,n,r),lt.viewport(R.copy(k).multiplyScalar(U).round())},this.getScissor=function(t){return t.copy(H)},this.setScissor=function(t,e,n,r){t.isVector4?H.set(t.x,t.y,t.z,t.w):H.set(t,e,n,r),lt.scissor(P.copy(H).multiplyScalar(U).round())},this.getScissorTest=function(){return Y},this.setScissorTest=function(t){lt.setScissorTest(Y=t)},this.setOpaqueSort=function(t){N=t},this.setTransparentSort=function(t){B=t},this.getClearColor=function(t){return t.copy(wt.getClearColor())},this.setClearColor=function(){wt.setClearColor.apply(wt,arguments)},this.getClearAlpha=function(){return wt.getClearAlpha()},this.setClearAlpha=function(){wt.setClearAlpha.apply(wt,arguments)},this.clear=function(t=!0,e=!0,n=!0){let r=0;if(t){let t=!1;if(null!==S){const e=S.texture.format;t=1033===e||1031===e||1029===e}if(t){const t=S.texture.type,e=t===z||t===j||t===G||t===X||1017===t||1018===t,n=wt.getClearColor(),r=wt.getClearAlpha(),i=n.r,a=n.g,o=n.b;e?(f[0]=i,f[1]=a,f[2]=o,f[3]=r,Ot.clearBufferuiv(Ot.COLOR,0,f)):(d[0]=i,d[1]=a,d[2]=o,d[3]=r,Ot.clearBufferiv(Ot.COLOR,0,d))}else r|=Ot.COLOR_BUFFER_BIT}e&&(r|=Ot.DEPTH_BUFFER_BIT),n&&(r|=Ot.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Ot.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Bt,!1),e.removeEventListener("webglcontextrestored",kt,!1),e.removeEventListener("webglcontextcreationerror",Ft,!1),yt.dispose(),xt.dispose(),ut.dispose(),ft.dispose(),dt.dispose(),gt.dispose(),Pt.dispose(),Dt.dispose(),vt.dispose(),Nt.dispose(),Nt.removeEventListener("sessionstart",jt),Nt.removeEventListener("sessionend",Vt),$&&($.dispose(),$=null),Wt.stop()},this.renderBufferDirect=function(t,e,n,r,i,a){null===e&&(e=at);const o=i.isMesh&&i.matrixWorld.determinant()<0,s=function(t,e,n,r,i){!0!==e.isScene&&(e=at);ht.resetTextureUnits();const a=e.fog,o=r.isMeshStandardMaterial?e.environment:null,s=null===S?x.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:it,A=(r.isMeshStandardMaterial?dt:ft).get(r.envMap||o),l=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,c=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),u=!!n.morphAttributes.position,h=!!n.morphAttributes.normal,f=!!n.morphAttributes.color;let d=b;r.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(d=x.toneMapping));const p=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,m=void 0!==p?p.length:0,g=ut.get(r),_=v.state.lights;if(!0===K&&(!0===J||t!==C)){const e=t===C&&r.id===T;bt.setState(r,t,e)}let y=!1;r.version===g.__version?g.needsLights&&g.lightsStateVersion!==_.state.version||g.outputColorSpace!==s||i.isBatchedMesh&&!1===g.batching?y=!0:i.isBatchedMesh||!0!==g.batching?i.isInstancedMesh&&!1===g.instancing?y=!0:i.isInstancedMesh||!0!==g.instancing?i.isSkinnedMesh&&!1===g.skinning?y=!0:i.isSkinnedMesh||!0!==g.skinning?i.isInstancedMesh&&!0===g.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===g.instancingColor&&null!==i.instanceColor||i.isInstancedMesh&&!0===g.instancingMorph&&null===i.morphTexture||i.isInstancedMesh&&!1===g.instancingMorph&&null!==i.morphTexture||g.envMap!==A||!0===r.fog&&g.fog!==a?y=!0:void 0===g.numClippingPlanes||g.numClippingPlanes===bt.numPlanes&&g.numIntersection===bt.numIntersection?(g.vertexAlphas!==l||g.vertexTangents!==c||g.morphTargets!==u||g.morphNormals!==h||g.morphColors!==f||g.toneMapping!==d||!0===At.isWebGL2&&g.morphTargetsCount!==m)&&(y=!0):y=!0:y=!0:y=!0:y=!0:(y=!0,g.__version=r.version);let M=g.currentProgram;!0===y&&(M=Kt(r,e,i));let w=!1,E=!1,R=!1;const P=M.getUniforms(),L=g.uniforms;lt.useProgram(M.program)&&(w=!0,E=!0,R=!0);r.id!==T&&(T=r.id,E=!0);if(w||C!==t){P.setValue(Ot,"projectionMatrix",t.projectionMatrix),P.setValue(Ot,"viewMatrix",t.matrixWorldInverse);const e=P.map.cameraPosition;void 0!==e&&e.setValue(Ot,nt.setFromMatrixPosition(t.matrixWorld)),At.logarithmicDepthBuffer&&P.setValue(Ot,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&P.setValue(Ot,"isOrthographic",!0===t.isOrthographicCamera),C!==t&&(C=t,E=!0,R=!0)}if(i.isSkinnedMesh){P.setOptional(Ot,i,"bindMatrix"),P.setOptional(Ot,i,"bindMatrixInverse");const t=i.skeleton;t&&(At.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),P.setValue(Ot,"boneTexture",t.boneTexture,ht)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}i.isBatchedMesh&&(P.setOptional(Ot,i,"batchingTexture"),P.setValue(Ot,"batchingTexture",i._matricesTexture,ht));const D=n.morphAttributes;(void 0!==D.position||void 0!==D.normal||void 0!==D.color&&!0===At.isWebGL2)&&Et.update(i,n,M);(E||g.receiveShadow!==i.receiveShadow)&&(g.receiveShadow=i.receiveShadow,P.setValue(Ot,"receiveShadow",i.receiveShadow));r.isMeshGouraudMaterial&&null!==r.envMap&&(L.envMap.value=A,L.flipEnvMap.value=A.isCubeTexture&&!1===A.isRenderTargetTexture?-1:1);E&&(P.setValue(Ot,"toneMappingExposure",x.toneMappingExposure),g.needsLights&&(I=R,(O=L).ambientLightColor.needsUpdate=I,O.lightProbe.needsUpdate=I,O.directionalLights.needsUpdate=I,O.directionalLightShadows.needsUpdate=I,O.pointLights.needsUpdate=I,O.pointLightShadows.needsUpdate=I,O.spotLights.needsUpdate=I,O.spotLightShadows.needsUpdate=I,O.rectAreaLights.needsUpdate=I,O.hemisphereLights.needsUpdate=I),a&&!0===r.fog&&_t.refreshFogUniforms(L,a),_t.refreshMaterialUniforms(L,r,U,q,$),Ma.upload(Ot,Jt(g),L,ht));var O,I;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(Ma.upload(Ot,Jt(g),L,ht),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&P.setValue(Ot,"center",i.center);if(P.setValue(Ot,"modelViewMatrix",i.modelViewMatrix),P.setValue(Ot,"normalMatrix",i.normalMatrix),P.setValue(Ot,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const t=r.uniformsGroups;for(let e=0,n=t.length;e<n;e++)if(At.isWebGL2){const n=t[e];Dt.update(n,M),Dt.bind(n,M)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return M}(t,e,n,r,i);lt.setMaterial(r,o);let A=n.index,l=1;if(!0===r.wireframe){if(A=mt.getWireframeAttribute(n),void 0===A)return;l=2}const c=n.drawRange,u=n.attributes.position;let h=c.start*l,f=(c.start+c.count)*l;null!==a&&(h=Math.max(h,a.start*l),f=Math.min(f,(a.start+a.count)*l)),null!==A?(h=Math.max(h,0),f=Math.min(f,A.count)):null!=u&&(h=Math.max(h,0),f=Math.min(f,u.count));const d=f-h;if(d<0||d===1/0)return;let p;Pt.setup(i,r,s,n,A);let m=St;if(null!==A&&(p=pt.get(A),m=Ct,m.setIndex(p)),i.isMesh)!0===r.wireframe?(lt.setLineWidth(r.wireframeLinewidth*ot()),m.setMode(Ot.LINES)):m.setMode(Ot.TRIANGLES);else if(i.isLine){let t=r.linewidth;void 0===t&&(t=1),lt.setLineWidth(t*ot()),i.isLineSegments?m.setMode(Ot.LINES):i.isLineLoop?m.setMode(Ot.LINE_LOOP):m.setMode(Ot.LINE_STRIP)}else i.isPoints?m.setMode(Ot.POINTS):i.isSprite&&m.setMode(Ot.TRIANGLES);if(i.isBatchedMesh)m.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else if(i.isInstancedMesh)m.renderInstances(h,d,i.count);else if(n.isInstancedBufferGeometry){const t=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,e=Math.min(n.instanceCount,t);m.renderInstances(h,d,e)}else m.render(h,d)},this.compile=function(t,e,n=null){null===n&&(n=t),v=xt.get(n),v.init(),y.push(v),n.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(v.pushLight(t),t.castShadow&&v.pushShadow(t))})),t!==n&&t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(v.pushLight(t),t.castShadow&&v.pushShadow(t))})),v.setupLights(x._useLegacyLights);const r=new Set;return t.traverse((function(t){const e=t.material;if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++){const a=e[i];Gt(a,n,t),r.add(a)}else Gt(e,n,t),r.add(e)})),y.pop(),v=null,r},this.compileAsync=function(t,e,n=null){const r=this.compile(t,e,n);return new Promise((e=>{function n(){r.forEach((function(t){ut.get(t).currentProgram.isReady()&&r.delete(t)})),0!==r.size?setTimeout(n,10):e(t)}null!==st.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let Ht=null;function jt(){Wt.stop()}function Vt(){Wt.start()}const Wt=new Lr;function Xt(t,e,n,r){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)v.pushLight(t),t.castShadow&&v.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Z.intersectsSprite(t)){r&&nt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(tt);const e=gt.update(t),i=t.material;i.visible&&p.push(t,e,i,n,nt.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||Z.intersectsObject(t))){const e=gt.update(t),i=t.material;if(r&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),nt.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),nt.copy(e.boundingSphere.center)),nt.applyMatrix4(t.matrixWorld).applyMatrix4(tt)),Array.isArray(i)){const r=e.groups;for(let a=0,o=r.length;a<o;a++){const o=r[a],s=i[o.materialIndex];s&&s.visible&&p.push(t,e,s,n,nt.z,o)}}else i.visible&&p.push(t,e,i,n,nt.z,null)}const i=t.children;for(let t=0,a=i.length;t<a;t++)Xt(i[t],e,n,r)}function Qt(t,e,n,r){const i=t.opaque,a=t.transmissive,o=t.transparent;v.setupLightsView(n),!0===K&&bt.setGlobalState(x.clippingPlanes,n),a.length>0&&function(t,e,n,r){const i=!0===n.isScene?n.overrideMaterial:null;if(null!==i)return;const a=At.isWebGL2;null===$&&($=new ee(1,1,{generateMipmaps:!0,type:st.has("EXT_color_buffer_half_float")?W:z,minFilter:F,samples:a?4:0}));x.getDrawingBufferSize(et),a?$.setSize(et.x,et.y):$.setSize(Tt(et.x),Tt(et.y));const o=x.getRenderTarget();x.setRenderTarget($),x.getClearColor(D),O=x.getClearAlpha(),O<1&&x.setClearColor(16777215,.5);x.clear();const s=x.toneMapping;x.toneMapping=b,Yt(t,n,r),ht.updateMultisampleRenderTarget($),ht.updateRenderTargetMipmap($);let A=!1;for(let t=0,i=e.length;t<i;t++){const i=e[t],a=i.object,o=i.geometry,s=i.material,l=i.group;if(2===s.side&&a.layers.test(r.layers)){const t=s.side;s.side=g,s.needsUpdate=!0,Zt(a,n,r,o,s,l),s.side=t,s.needsUpdate=!0,A=!0}}!0===A&&(ht.updateMultisampleRenderTarget($),ht.updateRenderTargetMipmap($));x.setRenderTarget(o),x.setClearColor(D,O),x.toneMapping=s}(i,a,e,n),r&&lt.viewport(R.copy(r)),i.length>0&&Yt(i,e,n),a.length>0&&Yt(a,e,n),o.length>0&&Yt(o,e,n),lt.buffers.depth.setTest(!0),lt.buffers.depth.setMask(!0),lt.buffers.color.setMask(!0),lt.setPolygonOffset(!1)}function Yt(t,e,n){const r=!0===e.isScene?e.overrideMaterial:null;for(let i=0,a=t.length;i<a;i++){const a=t[i],o=a.object,s=a.geometry,A=null===r?a.material:r,l=a.group;o.layers.test(n.layers)&&Zt(o,e,n,s,A,l)}}function Zt(t,e,n,r,i,a){t.onBeforeRender(x,e,n,r,i,a),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),i.onBeforeRender(x,e,n,r,t,a),!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=g,i.needsUpdate=!0,x.renderBufferDirect(n,e,r,i,t,a),i.side=m,i.needsUpdate=!0,x.renderBufferDirect(n,e,r,i,t,a),i.side=2):x.renderBufferDirect(n,e,r,i,t,a),t.onAfterRender(x,e,n,r,i,a)}function Kt(t,e,n){!0!==e.isScene&&(e=at);const r=ut.get(t),i=v.state.lights,a=v.state.shadowsArray,o=i.state.version,s=vt.getParameters(t,i.state,a,e,n),A=vt.getProgramCacheKey(s);let l=r.programs;r.environment=t.isMeshStandardMaterial?e.environment:null,r.fog=e.fog,r.envMap=(t.isMeshStandardMaterial?dt:ft).get(t.envMap||r.environment),r.envMapRotation=null!==r.environment&&null===t.envMap?e.environmentRotation:t.envMapRotation,void 0===l&&(t.addEventListener("dispose",zt),l=new Map,r.programs=l);let c=l.get(A);if(void 0!==c){if(r.currentProgram===c&&r.lightsStateVersion===o)return te(t,s),c}else s.uniforms=vt.getUniforms(t),t.onBuild(n,s,x),t.onBeforeCompile(s,x),c=vt.acquireProgram(s,A),l.set(A,c),r.uniforms=s.uniforms;const u=r.uniforms;return(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(u.clippingPlanes=bt.uniform),te(t,s),r.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),r.lightsStateVersion=o,r.needsLights&&(u.ambientLightColor.value=i.state.ambient,u.lightProbe.value=i.state.probe,u.directionalLights.value=i.state.directional,u.directionalLightShadows.value=i.state.directionalShadow,u.spotLights.value=i.state.spot,u.spotLightShadows.value=i.state.spotShadow,u.rectAreaLights.value=i.state.rectArea,u.ltc_1.value=i.state.rectAreaLTC1,u.ltc_2.value=i.state.rectAreaLTC2,u.pointLights.value=i.state.point,u.pointLightShadows.value=i.state.pointShadow,u.hemisphereLights.value=i.state.hemi,u.directionalShadowMap.value=i.state.directionalShadowMap,u.directionalShadowMatrix.value=i.state.directionalShadowMatrix,u.spotShadowMap.value=i.state.spotShadowMap,u.spotLightMatrix.value=i.state.spotLightMatrix,u.spotLightMap.value=i.state.spotLightMap,u.pointShadowMap.value=i.state.pointShadowMap,u.pointShadowMatrix.value=i.state.pointShadowMatrix),r.currentProgram=c,r.uniformsList=null,c}function Jt(t){if(null===t.uniformsList){const e=t.currentProgram.getUniforms();t.uniformsList=Ma.seqWithValue(e.seq,t.uniforms)}return t.uniformsList}function te(t,e){const n=ut.get(t);n.outputColorSpace=e.outputColorSpace,n.batching=e.batching,n.instancing=e.instancing,n.instancingColor=e.instancingColor,n.instancingMorph=e.instancingMorph,n.skinning=e.skinning,n.morphTargets=e.morphTargets,n.morphNormals=e.morphNormals,n.morphColors=e.morphColors,n.morphTargetsCount=e.morphTargetsCount,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas,n.vertexTangents=e.vertexTangents,n.toneMapping=e.toneMapping}Wt.setAnimationLoop((function(t){Ht&&Ht(t)})),"undefined"!=typeof self&&Wt.setContext(self),this.setAnimationLoop=function(t){Ht=t,Nt.setAnimationLoop(t),null===t?Wt.stop():Wt.start()},Nt.addEventListener("sessionstart",jt),Nt.addEventListener("sessionend",Vt),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===M)return;!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===Nt.enabled&&!0===Nt.isPresenting&&(!0===Nt.cameraAutoUpdate&&Nt.updateCamera(e),e=Nt.getCamera()),!0===t.isScene&&t.onBeforeRender(x,t,e,S),v=xt.get(t,y.length),v.init(),y.push(v),tt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Z.setFromProjectionMatrix(tt),J=this.localClippingEnabled,K=bt.init(this.clippingPlanes,J),p=yt.get(t,_.length),p.init(),_.push(p),Xt(t,e,0,x.sortObjects),p.finish(),!0===x.sortObjects&&p.sort(N,B),this.info.render.frame++,!0===K&&bt.beginShadows();const n=v.state.shadowsArray;if(Mt.render(n,t,e),!0===K&&bt.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1!==Nt.enabled&&!1!==Nt.isPresenting&&!1!==Nt.hasDepthSensing()||wt.render(p,t),v.setupLights(x._useLegacyLights),e.isArrayCamera){const n=e.cameras;for(let e=0,r=n.length;e<r;e++){const r=n[e];Qt(p,t,r,r.viewport)}}else Qt(p,t,e);null!==S&&(ht.updateMultisampleRenderTarget(S),ht.updateRenderTargetMipmap(S)),!0===t.isScene&&t.onAfterRender(x,t,e),Pt.resetDefaultState(),T=-1,C=null,y.pop(),v=y.length>0?y[y.length-1]:null,_.pop(),p=_.length>0?_[_.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return E},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,n){ut.get(t.texture).__webglTexture=e,ut.get(t.depthTexture).__webglTexture=n;const r=ut.get(t);r.__hasExternalTextures=!0,r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===st.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(t,e){const n=ut.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){S=t,w=e,E=n;let r=!0,i=null,a=!1,o=!1;if(t){const s=ut.get(t);void 0!==s.__useDefaultFramebuffer?(lt.bindFramebuffer(Ot.FRAMEBUFFER,null),r=!1):void 0===s.__webglFramebuffer?ht.setupRenderTarget(t):s.__hasExternalTextures&&ht.rebindTextures(t,ut.get(t.texture).__webglTexture,ut.get(t.depthTexture).__webglTexture);const A=t.texture;(A.isData3DTexture||A.isDataArrayTexture||A.isCompressedArrayTexture)&&(o=!0);const l=ut.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=Array.isArray(l[e])?l[e][n]:l[e],a=!0):i=At.isWebGL2&&t.samples>0&&!1===ht.useMultisampledRTT(t)?ut.get(t).__webglMultisampledFramebuffer:Array.isArray(l)?l[n]:l,R.copy(t.viewport),P.copy(t.scissor),L=t.scissorTest}else R.copy(k).multiplyScalar(U).floor(),P.copy(H).multiplyScalar(U).floor(),L=Y;if(lt.bindFramebuffer(Ot.FRAMEBUFFER,i)&&At.drawBuffers&&r&&lt.drawBuffers(t,i),lt.viewport(R),lt.scissor(P),lt.setScissorTest(L),a){const r=ut.get(t.texture);Ot.framebufferTexture2D(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,Ot.TEXTURE_CUBE_MAP_POSITIVE_X+e,r.__webglTexture,n)}else if(o){const r=ut.get(t.texture),i=e||0;Ot.framebufferTextureLayer(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,r.__webglTexture,n||0,i)}T=-1},this.readRenderTargetPixels=function(t,e,n,r,i,a,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=ut.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){lt.bindFramebuffer(Ot.FRAMEBUFFER,s);try{const o=t.texture,s=o.format,A=o.type;if(s!==Q&&Rt.convert(s)!==Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const l=A===W&&(st.has("EXT_color_buffer_half_float")||At.isWebGL2&&st.has("EXT_color_buffer_float"));if(!(A===z||Rt.convert(A)===Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_TYPE)||A===V&&(At.isWebGL2||st.has("OES_texture_float")||st.has("WEBGL_color_buffer_float"))||l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&Ot.readPixels(e,n,r,i,Rt.convert(s),Rt.convert(A),a)}finally{const t=null!==S?ut.get(S).__webglFramebuffer:null;lt.bindFramebuffer(Ot.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const r=Math.pow(2,-n),i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r);ht.setTexture2D(e,0),Ot.copyTexSubImage2D(Ot.TEXTURE_2D,n,0,0,t.x,t.y,i,a),lt.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r=0){const i=e.image.width,a=e.image.height,o=Rt.convert(n.format),s=Rt.convert(n.type);ht.setTexture2D(n,0),Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,n.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,n.unpackAlignment),e.isDataTexture?Ot.texSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,i,a,o,s,e.image.data):e.isCompressedTexture?Ot.compressedTexSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):Ot.texSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,o,s,e.image),0===r&&n.generateMipmaps&&Ot.generateMipmap(Ot.TEXTURE_2D),lt.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,r,i=0){if(x.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const a=Math.round(t.max.x-t.min.x),o=Math.round(t.max.y-t.min.y),s=t.max.z-t.min.z+1,A=Rt.convert(r.format),l=Rt.convert(r.type);let c;if(r.isData3DTexture)ht.setTexture3D(r,0),c=Ot.TEXTURE_3D;else{if(!r.isDataArrayTexture&&!r.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");ht.setTexture2DArray(r,0),c=Ot.TEXTURE_2D_ARRAY}Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,r.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,r.unpackAlignment);const u=Ot.getParameter(Ot.UNPACK_ROW_LENGTH),h=Ot.getParameter(Ot.UNPACK_IMAGE_HEIGHT),f=Ot.getParameter(Ot.UNPACK_SKIP_PIXELS),d=Ot.getParameter(Ot.UNPACK_SKIP_ROWS),p=Ot.getParameter(Ot.UNPACK_SKIP_IMAGES),m=n.isCompressedTexture?n.mipmaps[i]:n.image;Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,m.width),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,m.height),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,t.min.x),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,t.min.y),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,t.min.z),n.isDataTexture||n.isData3DTexture?Ot.texSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,l,m.data):r.isCompressedArrayTexture?Ot.compressedTexSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,m.data):Ot.texSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,l,m),Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,u),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,h),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,f),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,d),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,p),0===i&&r.generateMipmaps&&Ot.generateMipmap(c),lt.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?ht.setTextureCube(t,0):t.isData3DTexture?ht.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?ht.setTexture2DArray(t,0):ht.setTexture2D(t,0),lt.unbindTexture()},this.resetState=function(){w=0,E=0,S=null,lt.reset(),Pt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return pt}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===at?"display-p3":"srgb",e.unpackColorSpace=Ht.workingColorSpace===ot?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}(class extends yo{}).prototype.isWebGL1Renderer=!0;class xo{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=ht,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=bt()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return Bt("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=bt()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=bt()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const bo=new ae;class Mo{constructor(t,e,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)bo.fromBufferAttribute(this,e),bo.applyMatrix4(t),this.setXYZ(e,bo.x,bo.y,bo.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)bo.fromBufferAttribute(this,e),bo.applyNormalMatrix(t),this.setXYZ(e,bo.x,bo.y,bo.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)bo.fromBufferAttribute(this,e),bo.transformDirection(t),this.setXYZ(e,bo.x,bo.y,bo.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Ct(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Rt(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Ct(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Ct(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Ct(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Ct(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this}setXYZW(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array),i=Rt(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new Dn(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new Mo(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class wo extends Dn{constructor(t,e,n,r=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}class Eo extends Cn{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new En(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const So=new ae,To=new ae,Co=new qe,Ro=new Ie,Po=new Se;class Lo extends ln{constructor(t=new Hn,e=new Eo){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,r=e.count;t<r;t++)So.fromBufferAttribute(e,t-1),To.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=So.distanceTo(To);t.setAttribute("lineDistance",new qn(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,i=t.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Po.copy(n.boundingSphere),Po.applyMatrix4(r),Po.radius+=i,!1===t.ray.intersectsSphere(Po))return;Co.copy(r).invert(),Ro.copy(t.ray).applyMatrix4(Co);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,A=new ae,l=new ae,c=new ae,u=new ae,h=this.isLineSegments?2:1,f=n.index,d=n.attributes.position;if(null!==f){for(let n=Math.max(0,a.start),r=Math.min(f.count,a.start+a.count)-1;n<r;n+=h){const r=f.getX(n),i=f.getX(n+1);A.fromBufferAttribute(d,r),l.fromBufferAttribute(d,i);if(Ro.distanceSqToSegment(A,l,u,c)>s)continue;u.applyMatrix4(this.matrixWorld);const a=t.ray.origin.distanceTo(u);a<t.near||a>t.far||e.push({distance:a,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,a.start),r=Math.min(d.count,a.start+a.count)-1;n<r;n+=h){A.fromBufferAttribute(d,n),l.fromBufferAttribute(d,n+1);if(Ro.distanceSqToSegment(A,l,u,c)>s)continue;u.applyMatrix4(this.matrixWorld);const r=t.ray.origin.distanceTo(u);r<t.near||r>t.far||e.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}const Do=new ae,Oo=new ae;class Io extends Lo{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,r=e.count;t<r;t+=2)Do.fromBufferAttribute(e,t),Oo.fromBufferAttribute(e,t+1),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+Do.distanceTo(Oo);t.setAttribute("lineDistance",new qn(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class qo{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),i=0;e.push(0);for(let a=1;a<=t;a++)n=this.getPoint(a/t),i+=n.distanceTo(r),e.push(i),r=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let r=0;const i=n.length;let a;a=e||t*n[i-1];let o,s=0,A=i-1;for(;s<=A;)if(r=Math.floor(s+(A-s)/2),o=n[r]-a,o<0)s=r+1;else{if(!(o>0)){A=r;break}A=r-1}if(r=A,n[r]===a)return r/(i-1);const l=n[r];return(r+(a-l)/(n[r+1]-l))/(i-1)}getTangent(t,e){const n=1e-4;let r=t-n,i=t+n;r<0&&(r=0),i>1&&(i=1);const a=this.getPoint(r),o=this.getPoint(i),s=e||(a.isVector2?new Lt:new ae);return s.copy(o).sub(a).normalize(),s}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new ae,r=[],i=[],a=[],o=new ae,s=new qe;for(let e=0;e<=t;e++){const n=e/t;r[e]=this.getTangentAt(n,new ae)}i[0]=new ae,a[0]=new ae;let A=Number.MAX_VALUE;const l=Math.abs(r[0].x),c=Math.abs(r[0].y),u=Math.abs(r[0].z);l<=A&&(A=l,n.set(1,0,0)),c<=A&&(A=c,n.set(0,1,0)),u<=A&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let e=1;e<=t;e++){if(i[e]=i[e-1].clone(),a[e]=a[e-1].clone(),o.crossVectors(r[e-1],r[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(Mt(r[e-1].dot(r[e]),-1,1));i[e].applyMatrix4(s.makeRotationAxis(o,t))}a[e].crossVectors(r[e],i[e])}if(!0===e){let e=Math.acos(Mt(i[0].dot(i[t]),-1,1));e/=t,r[0].dot(o.crossVectors(i[0],i[t]))>0&&(e=-e);for(let n=1;n<=t;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],e*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Uo extends qo{constructor(t=0,e=0,n=1,r=1,i=0,a=2*Math.PI,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(t,e=new Lt){const n=e,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const a=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);const o=this.aStartAngle+t*i;let s=this.aX+this.xRadius*Math.cos(o),A=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),n=s-this.aX,r=A-this.aY;s=n*t-r*e+this.aX,A=n*e+r*t+this.aY}return n.set(s,A)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}function No(){let t=0,e=0,n=0,r=0;function i(i,a,o,s){t=i,e=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(t,e,n,r,a){i(e,n,a*(n-t),a*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,a,o,s){let A=(e-t)/a-(n-t)/(a+o)+(n-e)/o,l=(n-e)/o-(r-e)/(o+s)+(r-n)/s;A*=o,l*=o,i(e,n,A,l)},calc:function(i){const a=i*i;return t+e*i+n*a+r*(a*i)}}}const Bo=new ae,ko=new No,Fo=new No,zo=new No;function Go(t,e,n,r,i){const a=.5*(r-e),o=.5*(i-n),s=t*t;return(2*n-2*r+a+o)*(t*s)+(-3*n+3*r-2*a-o)*s+a*t+n}function Ho(t,e,n,r){return function(t,e){const n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}function jo(t,e,n,r,i){return function(t,e){const n=1-t;return n*n*n*e}(t,e)+function(t,e){const n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,i)}class Vo extends qo{constructor(t=new Lt,e=new Lt,n=new Lt,r=new Lt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new Lt){const n=e,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(jo(t,r.x,i.x,a.x,o.x),jo(t,r.y,i.y,a.y,o.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Wo extends qo{constructor(t=new ae,e=new ae,n=new ae,r=new ae){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new ae){const n=e,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(jo(t,r.x,i.x,a.x,o.x),jo(t,r.y,i.y,a.y,o.y),jo(t,r.z,i.z,a.z,o.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Xo extends qo{constructor(t=new Lt,e=new Lt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Lt){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Lt){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Qo extends qo{constructor(t=new Lt,e=new Lt,n=new Lt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new Lt){const n=e,r=this.v0,i=this.v1,a=this.v2;return n.set(Ho(t,r.x,i.x,a.x),Ho(t,r.y,i.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Yo extends qo{constructor(t=new ae,e=new ae,n=new ae){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new ae){const n=e,r=this.v0,i=this.v1,a=this.v2;return n.set(Ho(t,r.x,i.x,a.x),Ho(t,r.y,i.y,a.y),Ho(t,r.z,i.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Zo extends qo{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Lt){const n=e,r=this.points,i=(r.length-1)*t,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],A=r[a],l=r[a>r.length-2?r.length-1:a+1],c=r[a>r.length-3?r.length-1:a+2];return n.set(Go(o,s.x,A.x,l.x,c.x),Go(o,s.y,A.y,l.y,c.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Lt).fromArray(n))}return this}}var Ko=Object.freeze({__proto__:null,ArcCurve:class extends Uo{constructor(t,e,n,r,i,a){super(t,e,n,n,r,i,a),this.isArcCurve=!0,this.type="ArcCurve"}},CatmullRomCurve3:class extends qo{constructor(t=[],e=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=r}getPoint(t,e=new ae){const n=e,r=this.points,i=r.length,a=(i-(this.closed?0:1))*t;let o,s,A=Math.floor(a),l=a-A;this.closed?A+=A>0?0:(Math.floor(Math.abs(A)/i)+1)*i:0===l&&A===i-1&&(A=i-2,l=1),this.closed||A>0?o=r[(A-1)%i]:(Bo.subVectors(r[0],r[1]).add(r[0]),o=Bo);const c=r[A%i],u=r[(A+1)%i];if(this.closed||A+2<i?s=r[(A+2)%i]:(Bo.subVectors(r[i-1],r[i-2]).add(r[i-1]),s=Bo),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(o.distanceToSquared(c),t),n=Math.pow(c.distanceToSquared(u),t),r=Math.pow(u.distanceToSquared(s),t);n<1e-4&&(n=1),e<1e-4&&(e=n),r<1e-4&&(r=n),ko.initNonuniformCatmullRom(o.x,c.x,u.x,s.x,e,n,r),Fo.initNonuniformCatmullRom(o.y,c.y,u.y,s.y,e,n,r),zo.initNonuniformCatmullRom(o.z,c.z,u.z,s.z,e,n,r)}else"catmullrom"===this.curveType&&(ko.initCatmullRom(o.x,c.x,u.x,s.x,this.tension),Fo.initCatmullRom(o.y,c.y,u.y,s.y,this.tension),zo.initCatmullRom(o.z,c.z,u.z,s.z,this.tension));return n.set(ko.calc(l),Fo.calc(l),zo.calc(l)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new ae).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}},CubicBezierCurve:Vo,CubicBezierCurve3:Wo,EllipseCurve:Uo,LineCurve:Xo,LineCurve3:class extends qo{constructor(t=new ae,e=new ae){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new ae){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new ae){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},QuadraticBezierCurve:Qo,QuadraticBezierCurve3:Yo,SplineCurve:Zo});class Jo extends qo{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){const n=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Ko[n](e,t))}return this}getPoint(t,e){const n=t*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const t=r[i]-n,a=this.curves[i],o=a.getLength(),s=0===o?0:1-t/o;return a.getPointAt(s,e)}i++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const a=i[r],o=a.isEllipseCurve?2*t:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o);for(let t=0;t<s.length;t++){const r=s[t];n&&n.equals(r)||(e.push(r),n=r)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new Ko[n.type]).fromJSON(n))}return this}}let $o=class extends Jo{constructor(t){super(),this.type="Path",this.currentPoint=new Lt,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new Xo(this.currentPoint.clone(),new Lt(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,r){const i=new Qo(this.currentPoint.clone(),new Lt(t,e),new Lt(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(t,e,n,r,i,a){const o=new Vo(this.currentPoint.clone(),new Lt(t,e),new Lt(n,r),new Lt(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new Zo(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,r,i,a){const o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+o,e+s,n,r,i,a),this}absarc(t,e,n,r,i,a){return this.absellipse(t,e,n,n,r,i,a),this}ellipse(t,e,n,r,i,a,o,s){const A=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+A,e+l,n,r,i,a,o,s),this}absellipse(t,e,n,r,i,a,o,s){const A=new Uo(t,e,n,r,i,a,o,s);if(this.curves.length>0){const t=A.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(A);const l=A.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}};class ts extends Hn{constructor(t=1,e=32,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},e=Math.max(3,e);const i=[],a=[],o=[],s=[],A=new ae,l=new Lt;a.push(0,0,0),o.push(0,0,1),s.push(.5,.5);for(let i=0,c=3;i<=e;i++,c+=3){const u=n+i/e*r;A.x=t*Math.cos(u),A.y=t*Math.sin(u),a.push(A.x,A.y,A.z),o.push(0,0,1),l.x=(a[c]/t+1)/2,l.y=(a[c+1]/t+1)/2,s.push(l.x,l.y)}for(let t=1;t<=e;t++)i.push(t,t+1,0);this.setIndex(i),this.setAttribute("position",new qn(a,3)),this.setAttribute("normal",new qn(o,3)),this.setAttribute("uv",new qn(s,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new ts(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class es extends Hn{constructor(t=1,e=1,n=1,r=32,i=1,a=!1,o=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s};const A=this;r=Math.floor(r),i=Math.floor(i);const l=[],c=[],u=[],h=[];let f=0;const d=[],p=n/2;let m=0;function g(n){const i=f,a=new Lt,d=new ae;let g=0;const v=!0===n?t:e,_=!0===n?1:-1;for(let t=1;t<=r;t++)c.push(0,p*_,0),u.push(0,_,0),h.push(.5,.5),f++;const y=f;for(let t=0;t<=r;t++){const e=t/r*s+o,n=Math.cos(e),i=Math.sin(e);d.x=v*i,d.y=p*_,d.z=v*n,c.push(d.x,d.y,d.z),u.push(0,_,0),a.x=.5*n+.5,a.y=.5*i*_+.5,h.push(a.x,a.y),f++}for(let t=0;t<r;t++){const e=i+t,r=y+t;!0===n?l.push(r,r+1,e):l.push(r+1,r,e),g+=3}A.addGroup(m,g,!0===n?1:2),m+=g}!function(){const a=new ae,g=new ae;let v=0;const _=(e-t)/n;for(let A=0;A<=i;A++){const l=[],m=A/i,v=m*(e-t)+t;for(let t=0;t<=r;t++){const e=t/r,i=e*s+o,A=Math.sin(i),d=Math.cos(i);g.x=v*A,g.y=-m*n+p,g.z=v*d,c.push(g.x,g.y,g.z),a.set(A,_,d).normalize(),u.push(a.x,a.y,a.z),h.push(e,1-m),l.push(f++)}d.push(l)}for(let t=0;t<r;t++)for(let e=0;e<i;e++){const n=d[e][t],r=d[e+1][t],i=d[e+1][t+1],a=d[e][t+1];l.push(n,r,a),l.push(r,i,a),v+=6}A.addGroup(m,v,0),m+=v}(),!1===a&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new qn(c,3)),this.setAttribute("normal",new qn(u,3)),this.setAttribute("uv",new qn(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new es(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class ns extends $o{constructor(t){super(t),this.uuid=bt(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new $o).fromJSON(n))}return this}}const rs=function(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let a=is(t,0,i,n,!0);const o=[];if(!a||a.next===a.prev)return o;let s,A,l,c,u,h,f;if(r&&(a=function(t,e,n,r){const i=[];let a,o,s,A,l;for(a=0,o=e.length;a<o;a++)s=e[a]*r,A=a<o-1?e[a+1]*r:t.length,l=is(t,s,A,r,!1),l===l.next&&(l.steiner=!0),i.push(ps(l));for(i.sort(us),a=0;a<i.length;a++)n=hs(i[a],n);return n}(t,e,a,n)),t.length>80*n){s=l=t[0],A=c=t[1];for(let e=n;e<i;e+=n)u=t[e],h=t[e+1],u<s&&(s=u),h<A&&(A=h),u>l&&(l=u),h>c&&(c=h);f=Math.max(l-s,c-A),f=0!==f?32767/f:0}return os(a,o,n,s,A,f,0),o};function is(t,e,n,r,i){let a,o;if(i===function(t,e,n,r){let i=0;for(let a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}(t,e,n,r)>0)for(a=e;a<n;a+=r)o=Es(a,t[a],t[a+1],o);else for(a=n-r;a>=e;a-=r)o=Es(a,t[a],t[a+1],o);return o&&_s(o,o.next)&&(Ss(o),o=o.next),o}function as(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!_s(r,r.next)&&0!==vs(r.prev,r,r.next))r=r.next;else{if(Ss(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function os(t,e,n,r,i,a,o){if(!t)return;!o&&a&&function(t,e,n,r){let i=t;do{0===i.z&&(i.z=ds(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,n,r,i,a,o,s,A,l=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ,r);e++);for(A=l;s>0||A>0&&r;)0!==s&&(0===A||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,A--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(t,r,i,a);let s,A,l=t;for(;t.prev!==t.next;)if(s=t.prev,A=t.next,a?As(t,r,i,a):ss(t))e.push(s.i/n|0),e.push(t.i/n|0),e.push(A.i/n|0),Ss(t),t=A.next,l=A.next;else if((t=A)===l){o?1===o?os(t=ls(as(t),e,n),e,n,r,i,a,2):2===o&&cs(t,e,n,r,i,a):os(as(t),e,n,r,i,a,1);break}}function ss(t){const e=t.prev,n=t,r=t.next;if(vs(e,n,r)>=0)return!1;const i=e.x,a=n.x,o=r.x,s=e.y,A=n.y,l=r.y,c=i<a?i<o?i:o:a<o?a:o,u=s<A?s<l?s:l:A<l?A:l,h=i>a?i>o?i:o:a>o?a:o,f=s>A?s>l?s:l:A>l?A:l;let d=r.next;for(;d!==e;){if(d.x>=c&&d.x<=h&&d.y>=u&&d.y<=f&&ms(i,s,a,A,o,l,d.x,d.y)&&vs(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function As(t,e,n,r){const i=t.prev,a=t,o=t.next;if(vs(i,a,o)>=0)return!1;const s=i.x,A=a.x,l=o.x,c=i.y,u=a.y,h=o.y,f=s<A?s<l?s:l:A<l?A:l,d=c<u?c<h?c:h:u<h?u:h,p=s>A?s>l?s:l:A>l?A:l,m=c>u?c>h?c:h:u>h?u:h,g=ds(f,d,e,n,r),v=ds(p,m,e,n,r);let _=t.prevZ,y=t.nextZ;for(;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ms(s,c,A,u,l,h,_.x,_.y)&&vs(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ms(s,c,A,u,l,h,y.x,y.y)&&vs(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;_&&_.z>=g;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ms(s,c,A,u,l,h,_.x,_.y)&&vs(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=v;){if(y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ms(s,c,A,u,l,h,y.x,y.y)&&vs(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function ls(t,e,n){let r=t;do{const i=r.prev,a=r.next.next;!_s(i,a)&&ys(i,r,r.next,a)&&Ms(i,a)&&Ms(a,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),Ss(r),Ss(r.next),r=t=a),r=r.next}while(r!==t);return as(r)}function cs(t,e,n,r,i,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&gs(o,t)){let s=ws(o,t);return o=as(o,o.next),s=as(s,s.next),os(o,e,n,r,i,a,0),void os(s,e,n,r,i,a,0)}t=t.next}o=o.next}while(o!==t)}function us(t,e){return t.x-e.x}function hs(t,e){const n=function(t,e){let n,r=e,i=-1/0;const a=t.x,o=t.y;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){const t=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=a&&t>i&&(i=t,n=r.x<r.next.x?r:r.next,t===a))return n}r=r.next}while(r!==e);if(!n)return null;const s=n,A=n.x,l=n.y;let c,u=1/0;r=n;do{a>=r.x&&r.x>=A&&a!==r.x&&ms(o<l?a:i,o,A,l,o<l?i:a,o,r.x,r.y)&&(c=Math.abs(o-r.y)/(a-r.x),Ms(r,t)&&(c<u||c===u&&(r.x>n.x||r.x===n.x&&fs(n,r)))&&(n=r,u=c)),r=r.next}while(r!==s);return n}(t,e);if(!n)return e;const r=ws(n,t);return as(r,r.next),as(n,n.next)}function fs(t,e){return vs(t.prev,t,e.prev)<0&&vs(e.next,t,t.next)<0}function ds(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ps(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function ms(t,e,n,r,i,a,o,s){return(i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(r-s)>=(n-o)*(e-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function gs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&ys(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ms(t,e)&&Ms(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(vs(t.prev,t,e.prev)||vs(t,e.prev,e))||_s(t,e)&&vs(t.prev,t,t.next)>0&&vs(e.prev,e,e.next)>0)}function vs(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _s(t,e){return t.x===e.x&&t.y===e.y}function ys(t,e,n,r){const i=bs(vs(t,e,n)),a=bs(vs(t,e,r)),o=bs(vs(n,r,t)),s=bs(vs(n,r,e));return i!==a&&o!==s||(!(0!==i||!xs(t,n,e))||(!(0!==a||!xs(t,r,e))||(!(0!==o||!xs(n,t,r))||!(0!==s||!xs(n,e,r)))))}function xs(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function bs(t){return t>0?1:t<0?-1:0}function Ms(t,e){return vs(t.prev,t,t.next)<0?vs(t,e,t.next)>=0&&vs(t,t.prev,e)>=0:vs(t,e,t.prev)<0||vs(t,t.next,e)<0}function ws(t,e){const n=new Ts(t.i,t.x,t.y),r=new Ts(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Es(t,e,n,r){const i=new Ts(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ss(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ts(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class Cs{static area(t){const e=t.length;let n=0;for(let r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n}static isClockWise(t){return Cs.area(t)<0}static triangulateShape(t,e){const n=[],r=[],i=[];Rs(t),Ps(n,t);let a=t.length;e.forEach(Rs);for(let t=0;t<e.length;t++)r.push(a),a+=e[t].length,Ps(n,e[t]);const o=rs(n,r);for(let t=0;t<o.length;t+=3)i.push(o.slice(t,t+3));return i}}function Rs(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Ps(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class Ls extends Hn{constructor(t=new ns([new Lt(.5,.5),new Lt(-.5,.5),new Lt(-.5,-.5),new Lt(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,r=[],i=[];for(let e=0,n=t.length;e<n;e++){a(t[e])}function a(t){const a=[],o=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,A=void 0!==e.depth?e.depth:1;let l=void 0===e.bevelEnabled||e.bevelEnabled,c=void 0!==e.bevelThickness?e.bevelThickness:.2,u=void 0!==e.bevelSize?e.bevelSize:c-.1,h=void 0!==e.bevelOffset?e.bevelOffset:0,f=void 0!==e.bevelSegments?e.bevelSegments:3;const d=e.extrudePath,p=void 0!==e.UVGenerator?e.UVGenerator:Ds;let m,g,v,_,y,x=!1;d&&(m=d.getSpacedPoints(s),x=!0,l=!1,g=d.computeFrenetFrames(s,!1),v=new ae,_=new ae,y=new ae),l||(f=0,c=0,u=0,h=0);const b=t.extractPoints(o);let M=b.shape;const w=b.holes;if(!Cs.isClockWise(M)){M=M.reverse();for(let t=0,e=w.length;t<e;t++){const e=w[t];Cs.isClockWise(e)&&(w[t]=e.reverse())}}const E=Cs.triangulateShape(M,w),S=M;for(let t=0,e=w.length;t<e;t++){const e=w[t];M=M.concat(e)}function T(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,n)}const C=M.length,R=E.length;function P(t,e,n){let r,i,a;const o=t.x-e.x,s=t.y-e.y,A=n.x-t.x,l=n.y-t.y,c=o*o+s*s,u=o*l-s*A;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(c),h=Math.sqrt(A*A+l*l),f=e.x-s/u,d=e.y+o/u,p=((n.x-l/h-f)*l-(n.y+A/h-d)*A)/(o*l-s*A);r=f+o*p-t.x,i=d+s*p-t.y;const m=r*r+i*i;if(m<=2)return new Lt(r,i);a=Math.sqrt(m/2)}else{let t=!1;o>Number.EPSILON?A>Number.EPSILON&&(t=!0):o<-Number.EPSILON?A<-Number.EPSILON&&(t=!0):Math.sign(s)===Math.sign(l)&&(t=!0),t?(r=-s,i=o,a=Math.sqrt(c)):(r=o,i=s,a=Math.sqrt(c/2))}return new Lt(r/a,i/a)}const L=[];for(let t=0,e=S.length,n=e-1,r=t+1;t<e;t++,n++,r++)n===e&&(n=0),r===e&&(r=0),L[t]=P(S[t],S[n],S[r]);const D=[];let O,I=L.concat();for(let t=0,e=w.length;t<e;t++){const e=w[t];O=[];for(let t=0,n=e.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),O[t]=P(e[t],e[r],e[i]);D.push(O),I=I.concat(O)}for(let t=0;t<f;t++){const e=t/f,n=c*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+h;for(let t=0,e=S.length;t<e;t++){const e=T(S[t],L[t],r);N(e.x,e.y,-n)}for(let t=0,e=w.length;t<e;t++){const e=w[t];O=D[t];for(let t=0,i=e.length;t<i;t++){const i=T(e[t],O[t],r);N(i.x,i.y,-n)}}}const q=u+h;for(let t=0;t<C;t++){const e=l?T(M[t],I[t],q):M[t];x?(_.copy(g.normals[0]).multiplyScalar(e.x),v.copy(g.binormals[0]).multiplyScalar(e.y),y.copy(m[0]).add(_).add(v),N(y.x,y.y,y.z)):N(e.x,e.y,0)}for(let t=1;t<=s;t++)for(let e=0;e<C;e++){const n=l?T(M[e],I[e],q):M[e];x?(_.copy(g.normals[t]).multiplyScalar(n.x),v.copy(g.binormals[t]).multiplyScalar(n.y),y.copy(m[t]).add(_).add(v),N(y.x,y.y,y.z)):N(n.x,n.y,A/s*t)}for(let t=f-1;t>=0;t--){const e=t/f,n=c*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+h;for(let t=0,e=S.length;t<e;t++){const e=T(S[t],L[t],r);N(e.x,e.y,A+n)}for(let t=0,e=w.length;t<e;t++){const e=w[t];O=D[t];for(let t=0,i=e.length;t<i;t++){const i=T(e[t],O[t],r);x?N(i.x,i.y+m[s-1].y,m[s-1].x+n):N(i.x,i.y,A+n)}}}function U(t,e){let n=t.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=t.length-1);for(let t=0,n=s+2*f;t<n;t++){const n=C*t,a=C*(t+1);k(e+r+n,e+i+n,e+i+a,e+r+a)}}}function N(t,e,n){a.push(t),a.push(e),a.push(n)}function B(t,e,i){F(t),F(e),F(i);const a=r.length/3,o=p.generateTopUV(n,r,a-3,a-2,a-1);z(o[0]),z(o[1]),z(o[2])}function k(t,e,i,a){F(t),F(e),F(a),F(e),F(i),F(a);const o=r.length/3,s=p.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);z(s[0]),z(s[1]),z(s[3]),z(s[1]),z(s[2]),z(s[3])}function F(t){r.push(a[3*t+0]),r.push(a[3*t+1]),r.push(a[3*t+2])}function z(t){i.push(t.x),i.push(t.y)}!function(){const t=r.length/3;if(l){let t=0,e=C*t;for(let t=0;t<R;t++){const n=E[t];B(n[2]+e,n[1]+e,n[0]+e)}t=s+2*f,e=C*t;for(let t=0;t<R;t++){const n=E[t];B(n[0]+e,n[1]+e,n[2]+e)}}else{for(let t=0;t<R;t++){const e=E[t];B(e[2],e[1],e[0])}for(let t=0;t<R;t++){const e=E[t];B(e[0]+C*s,e[1]+C*s,e[2]+C*s)}}n.addGroup(t,r.length/3-t,0)}(),function(){const t=r.length/3;let e=0;U(S,e),e+=S.length;for(let t=0,n=w.length;t<n;t++){const n=w[t];U(n,e),e+=n.length}n.addGroup(t,r.length/3-t,1)}()}this.setAttribute("position",new qn(r,3)),this.setAttribute("uv",new qn(i,2)),this.computeVertexNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return function(t,e,n){if(n.shapes=[],Array.isArray(t))for(let e=0,r=t.length;e<r;e++){const r=t[e];n.shapes.push(r.uuid)}else n.shapes.push(t.uuid);n.options=Object.assign({},e),void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let r=0,i=t.shapes.length;r<i;r++){const i=e[t.shapes[r]];n.push(i)}const r=t.options.extrudePath;return void 0!==r&&(t.options.extrudePath=(new Ko[r.type]).fromJSON(r)),new Ls(n,t.options)}}const Ds={generateTopUV:function(t,e,n,r,i){const a=e[3*n],o=e[3*n+1],s=e[3*r],A=e[3*r+1],l=e[3*i],c=e[3*i+1];return[new Lt(a,o),new Lt(s,A),new Lt(l,c)]},generateSideWallUV:function(t,e,n,r,i,a){const o=e[3*n],s=e[3*n+1],A=e[3*n+2],l=e[3*r],c=e[3*r+1],u=e[3*r+2],h=e[3*i],f=e[3*i+1],d=e[3*i+2],p=e[3*a],m=e[3*a+1],g=e[3*a+2];return Math.abs(s-c)<Math.abs(o-l)?[new Lt(o,1-A),new Lt(l,1-u),new Lt(h,1-d),new Lt(p,1-g)]:[new Lt(s,1-A),new Lt(c,1-u),new Lt(f,1-d),new Lt(m,1-g)]}};class Os extends Hn{constructor(t=1,e=32,n=16,r=0,i=2*Math.PI,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const s=Math.min(a+o,Math.PI);let A=0;const l=[],c=new ae,u=new ae,h=[],f=[],d=[],p=[];for(let h=0;h<=n;h++){const m=[],g=h/n;let v=0;0===h&&0===a?v=.5/e:h===n&&s===Math.PI&&(v=-.5/e);for(let n=0;n<=e;n++){const s=n/e;c.x=-t*Math.cos(r+s*i)*Math.sin(a+g*o),c.y=t*Math.cos(a+g*o),c.z=t*Math.sin(r+s*i)*Math.sin(a+g*o),f.push(c.x,c.y,c.z),u.copy(c).normalize(),d.push(u.x,u.y,u.z),p.push(s+v,1-g),m.push(A++)}l.push(m)}for(let t=0;t<n;t++)for(let r=0;r<e;r++){const e=l[t][r+1],i=l[t][r],o=l[t+1][r],A=l[t+1][r+1];(0!==t||a>0)&&h.push(e,i,A),(t!==n-1||s<Math.PI)&&h.push(i,o,A)}this.setIndex(h),this.setAttribute("position",new qn(f,3)),this.setAttribute("normal",new qn(d,3)),this.setAttribute("uv",new qn(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Os(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class Is extends Hn{constructor(t=new Yo(new ae(-1,-1,0),new ae(-1,1,0),new ae(1,1,0)),e=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i};const a=t.computeFrenetFrames(e,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new ae,s=new ae,A=new Lt;let l=new ae;const c=[],u=[],h=[],f=[];function d(i){l=t.getPointAt(i/e,l);const A=a.normals[i],h=a.binormals[i];for(let t=0;t<=r;t++){const e=t/r*Math.PI*2,i=Math.sin(e),a=-Math.cos(e);s.x=a*A.x+i*h.x,s.y=a*A.y+i*h.y,s.z=a*A.z+i*h.z,s.normalize(),u.push(s.x,s.y,s.z),o.x=l.x+n*s.x,o.y=l.y+n*s.y,o.z=l.z+n*s.z,c.push(o.x,o.y,o.z)}}!function(){for(let t=0;t<e;t++)d(t);d(!1===i?e:0),function(){for(let t=0;t<=e;t++)for(let n=0;n<=r;n++)A.x=t/e,A.y=n/r,h.push(A.x,A.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=r;e++){const n=(r+1)*(t-1)+(e-1),i=(r+1)*t+(e-1),a=(r+1)*t+e,o=(r+1)*(t-1)+e;f.push(n,i,o),f.push(i,a,o)}}()}(),this.setIndex(f),this.setAttribute("position",new qn(c,3)),this.setAttribute("normal",new qn(u,3)),this.setAttribute("uv",new qn(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Is((new Ko[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}function qs(t,e,n){const r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}class Us extends Cn{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new En(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new En(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ve,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}const Ns={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class Bs{constructor(t,e,n){const r=this;let i,a=!1,o=0,s=0;const A=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){s++,!1===a&&void 0!==r.onStart&&r.onStart(t,o,s),a=!0},this.itemEnd=function(t){o++,void 0!==r.onProgress&&r.onProgress(t,o,s),o===s&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return i?i(t):t},this.setURLModifier=function(t){return i=t,this},this.addHandler=function(t,e){return A.push(t,e),this},this.removeHandler=function(t){const e=A.indexOf(t);return-1!==e&&A.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=A.length;e<n;e+=2){const n=A[e],r=A[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null}}}const ks=new Bs;class Fs{constructor(t){this.manager=void 0!==t?t:ks,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise((function(r,i){n.load(t,r,e,i)}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}Fs.DEFAULT_MATERIAL_NAME="__DEFAULT";class zs extends Fs{constructor(t){super(t)}load(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const i=this,a=Ns.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout((function(){e&&e(a),i.manager.itemEnd(t)}),0),a;const o=qt("img");function s(){l(),Ns.add(t,this),e&&e(this),i.manager.itemEnd(t)}function A(e){l(),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}function l(){o.removeEventListener("load",s,!1),o.removeEventListener("error",A,!1)}return o.addEventListener("load",s,!1),o.addEventListener("error",A,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o}}class Gs extends Fs{constructor(t){super(t)}load(t,e,n,r){const i=new Jt,a=new zs(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,(function(t){i.image=t,i.needsUpdate=!0,void 0!==e&&e(i)}),n,r),i}}class Hs extends ln{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new En(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}const js=new qe,Vs=new ae,Ws=new ae;class Xs{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Lt(512,512),this.map=null,this.mapPass=null,this.matrix=new qe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Pr,this._frameExtents=new Lt(1,1),this._viewportCount=1,this._viewports=[new $t(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;Vs.setFromMatrixPosition(t.matrixWorld),e.position.copy(Vs),Ws.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Ws),e.updateMatrixWorld(),js.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(js),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(js)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Qs extends Xs{constructor(){super(new Wr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Ys{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Zs(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Zs();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function Zs(){return("undefined"==typeof performance?Date:performance).now()}class Ks extends xo{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}const Js=new qe;function $s(t,e){return t.distance-e.distance}function tA(t,e,n,r){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===r){const r=t.children;for(let t=0,i=r.length;t<i;t++)tA(r[t],e,n,!0)}}class eA{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Mt(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}const nA=new ae,rA=new ae;class iA{constructor(){this.type="ShapePath",this.color=new En,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new $o,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,n,r){return this.currentPath.quadraticCurveTo(t,e,n,r),this}bezierCurveTo(t,e,n,r,i,a){return this.currentPath.bezierCurveTo(t,e,n,r,i,a),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const n=e.length;let r=!1;for(let i=n-1,a=0;a<n;i=a++){let n=e[i],o=e[a],s=o.x-n.x,A=o.y-n.y;if(Math.abs(A)>Number.EPSILON){if(A<0&&(n=e[a],s=-s,o=e[i],A=-A),t.y<n.y||t.y>o.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=A*(t.x-n.x)-s*(t.y-n.y);if(0===e)return!0;if(e<0)continue;r=!r}}else{if(t.y!==n.y)continue;if(o.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=o.x)return!0}}return r}const n=Cs.isClockWise,r=this.subPaths;if(0===r.length)return[];let i,a,o;const s=[];if(1===r.length)return a=r[0],o=new ns,o.curves=a.curves,s.push(o),s;let A=!n(r[0].getPoints());A=t?!A:A;const l=[],c=[];let u,h,f=[],d=0;c[d]=void 0,f[d]=[];for(let e=0,o=r.length;e<o;e++)a=r[e],u=a.getPoints(),i=n(u),i=t?!i:i,i?(!A&&c[d]&&d++,c[d]={s:new ns,p:u},c[d].s.curves=a.curves,A&&d++,f[d]=[]):f[d].push({h:a,p:u[0]});if(!c[0])return function(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n],i=new ns;i.curves=r.curves,e.push(i)}return e}(r);if(c.length>1){let t=!1,n=0;for(let t=0,e=c.length;t<e;t++)l[t]=[];for(let r=0,i=c.length;r<i;r++){const i=f[r];for(let a=0;a<i.length;a++){const o=i[a];let s=!0;for(let i=0;i<c.length;i++)e(o.p,c[i].p)&&(r!==i&&n++,s?(s=!1,l[i].push(o)):t=!0);s&&l[r].push(o)}}n>0&&!1===t&&(f=l)}for(let t=0,e=c.length;t<e;t++){o=c[t].s,s.push(o),h=f[t];for(let t=0,e=h.length;t<e;t++)o.holes.push(h[t].h)}return s}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:s}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=s);const aA=new ae,oA=new qe,sA=new qe,AA=new ae,lA=new ae;function cA(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var uA="object"==typeof global&&global&&global.Object===Object&&global,hA="object"==typeof self&&self&&self.Object===Object&&self,fA=uA||hA||Function("return this")(),dA=function(){return fA.Date.now()},pA=/\s/;var mA=/^\s+/;function gA(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&pA.test(t.charAt(e)););return e}(t)+1).replace(mA,""):t}var vA=fA.Symbol,_A=Object.prototype,yA=_A.hasOwnProperty,xA=_A.toString,bA=vA?vA.toStringTag:void 0;var MA=Object.prototype.toString;var wA="[object Null]",EA="[object Undefined]",SA=vA?vA.toStringTag:void 0;function TA(t){return null==t?void 0===t?EA:wA:SA&&SA in Object(t)?function(t){var e=yA.call(t,bA),n=t[bA];try{t[bA]=void 0;var r=!0}catch(t){}var i=xA.call(t);return r&&(e?t[bA]=n:delete t[bA]),i}(t):function(t){return MA.call(t)}(t)}var CA="[object Symbol]";var RA=NaN,PA=/^[-+]0x[0-9a-f]+$/i,LA=/^0b[01]+$/i,DA=/^0o[0-7]+$/i,OA=parseInt;function IA(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&TA(t)==CA}(t))return RA;if(cA(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=cA(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=gA(t);var n=LA.test(t);return n||DA.test(t)?OA(t.slice(2),n?2:8):PA.test(t)?RA:+t}var qA="Expected a function",UA=Math.max,NA=Math.min;function BA(t,e,n){var r,i,a,o,s,A,l=0,c=!1,u=!1,h=!0;if("function"!=typeof t)throw new TypeError(qA);function f(e){var n=r,a=i;return r=i=void 0,l=e,o=t.apply(a,n)}function d(t){var n=t-A;return void 0===A||n>=e||n<0||u&&t-l>=a}function p(){var t=dA();if(d(t))return m(t);s=setTimeout(p,function(t){var n=e-(t-A);return u?NA(n,a-(t-l)):n}(t))}function m(t){return s=void 0,h&&r?f(t):(r=i=void 0,o)}function g(){var t=dA(),n=d(t);if(r=arguments,i=this,A=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(p,e),c?f(t):o}(A);if(u)return clearTimeout(s),s=setTimeout(p,e),f(A)}return void 0===s&&(s=setTimeout(p,e)),o}return e=IA(e)||0,cA(n)&&(c=!!n.leading,a=(u="maxWait"in n)?UA(IA(n.maxWait)||0,e):a,h="trailing"in n?!!n.trailing:h),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=A=i=s=void 0},g.flush=function(){return void 0===s?o:m(dA())},g}function kA(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=r.key,a=void 0,"symbol"==typeof(a=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"))?a:String(a)),r)}var i,a}function FA(t,e,n){return e&&kA(t.prototype,e),n&&kA(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function zA(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return GA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GA(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function GA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var HA=FA((function t(e,n){var r=n.default,i=void 0===r?null:r,a=n.triggerUpdate,o=void 0===a||a,s=n.onChange,A=void 0===s?function(t,e){}:s;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e,this.defaultVal=i,this.triggerUpdate=o,this.onChange=A}));function jA(t){var e=t.stateInit,n=void 0===e?function(){return{}}:e,r=t.props,i=void 0===r?{}:r,a=t.methods,o=void 0===a?{}:a,s=t.aliases,A=void 0===s?{}:s,l=t.init,c=void 0===l?function(){}:l,u=t.update,h=void 0===u?function(){}:u,f=Object.keys(i).map((function(t){return new HA(t,i[t])}));return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},n instanceof Function?n(t):n,{initialised:!1}),r={};function i(e){return a(e,t),s(),i}var a=function(t,n){c.call(i,t,e,n),e.initialised=!0},s=BA((function(){e.initialised&&(h.call(i,e,r),r={})}),1);return f.forEach((function(t){i[t.name]=function(t){var n=t.name,a=t.triggerUpdate,o=void 0!==a&&a,A=t.onChange,l=void 0===A?function(t,e){}:A,c=t.defaultVal,u=void 0===c?null:c;return function(t){var a=e[n];if(!arguments.length)return a;var A=void 0===t?u:t;return e[n]=A,l.call(i,A,e,a),!r.hasOwnProperty(n)&&(r[n]=a),o&&s(),i}}(t)})),Object.keys(o).forEach((function(t){i[t]=function(){for(var n,r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return(n=o[t]).call.apply(n,[i,e].concat(a))}})),Object.entries(A).forEach((function(t){var e=zA(t,2),n=e[0],r=e[1];return i[n]=i[r]})),i.resetProps=function(){return f.forEach((function(t){i[t.name](t.defaultVal)})),i},i.resetProps(),e._rerender=s,i}}var VA,WA=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return this.None(t)},Out:function(t){return this.None(t)},InOut:function(t){return this.None(t)}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-WA.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*WA.Bounce.In(2*t):.5*WA.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),XA=function(){return performance.now()},QA=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=XA()),void 0===e&&(e=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var i=this._tweens[n[r]],a=!e;i&&!1===i.update(t,a)&&!e&&delete this._tweens[n[r]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),YA={Linear:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=YA.Utils.Linear;return e<0?a(t[0],t[1],r):e>1?a(t[n],t[n-1],n-r):a(t[i],t[i+1>n?n:i+1],r-i)},Bezier:function(t,e){for(var n=0,r=t.length-1,i=Math.pow,a=YA.Utils.Bernstein,o=0;o<=r;o++)n+=i(1-e,r-o)*i(e,o)*t[o]*a(r,o);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=YA.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(i=Math.floor(r=n*(1+e))),a(t[(i-1+n)%n],t[i],t[(i+1)%n],t[(i+2)%n],r-i)):e<0?t[0]-(a(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(a(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):a(t[i?i-1:0],t[i],t[n<i+1?n:i+1],t[n<i+2?n:i+2],r-i)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=YA.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(VA=[1],function(t){var e=1;if(VA[t])return VA[t];for(var n=t;n>1;n--)e*=n;return VA[t]=e,e}),CatmullRom:function(t,e,n,r,i){var a=.5*(n-t),o=.5*(r-e),s=i*i;return(2*e-2*n+a+o)*(i*s)+(-3*e+3*n-2*a-o)*s+a*i+e}}},ZA=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),KA=new QA,JA=function(){function t(t,e){void 0===e&&(e=KA),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=WA.Linear.None,this._interpolationFunction=YA.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ZA.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=XA()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var i in this._valuesEnd)r[i]=this._valuesEnd[i];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,n,r,i){for(var a in n){var o=t[a],s=Array.isArray(o),A=s?"array":typeof o,l=!s&&Array.isArray(n[a]);if("undefined"!==A&&"function"!==A){if(l){if(0===(m=n[a]).length)continue;for(var c=[o],u=0,h=m.length;u<h;u+=1){var f=this._handleRelativeValue(o,m[u]);if(isNaN(f)){l=!1,console.warn("Found invalid interpolation list. Skipping.");break}c.push(f)}l&&(n[a]=c)}if("object"!==A&&!s||!o||l)(void 0===e[a]||i)&&(e[a]=o),s||(e[a]*=1),r[a]=l?n[a].slice().reverse():e[a]||0;else{e[a]=s?[]:{};var d=o;for(var p in d)e[a][p]=d[p];r[a]=s?[]:{};var m=n[a];if(!this._isDynamic){var g={};for(var p in m)g[p]=m[p];n[a]=m=g}this._setupProperties(d,e[a],m,r[a],i)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=XA()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=XA()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return void 0===t&&(t=KA),this._group=t,this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=WA.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=YA.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){var n,r,i=this;if(void 0===t&&(t=XA()),void 0===e&&(e=!0),this._isPaused)return!0;var a=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>a)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=t-this._startTime,s=this._duration+(null!==(n=this._repeatDelayTime)&&void 0!==n?n:this._delayTime),A=this._duration+this._repeat*s,l=function(){if(0===i._duration)return 1;if(o>A)return 1;var t=Math.trunc(o/s),e=o-t*s,n=Math.min(e/i._duration,1);return 0===n&&o===i._duration?1:n}(),c=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,c),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),0===this._duration||o>=this._duration){if(this._repeat>0){var u=Math.min(Math.trunc((o-this._duration)/s)+1,this._repeat);for(r in isFinite(this._repeat)&&(this._repeat-=u),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*u,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var h=0,f=this._chainedTweens.length;h<f;h++)this._chainedTweens[h].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,n,r){for(var i in n)if(void 0!==e[i]){var a=e[i]||0,o=n[i],s=Array.isArray(t[i]),A=Array.isArray(o);!s&&A?t[i]=this._interpolationFunction(o,r):"object"==typeof o&&o?this._updateProperties(t[i],a,o,r):"number"==typeof(o=this._handleRelativeValue(a,o))&&(t[i]=a+(o-a)*r)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof n?this._valuesStartRepeat[t]+parseFloat(n):this._valuesEnd[t],this._valuesEnd[t]=e},t}(),$A=KA;$A.getAll.bind($A),$A.removeAll.bind($A),$A.add.bind($A),$A.remove.bind($A);var tl=$A.update.bind($A);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function el(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var nl={exports:{}};function rl(t,e,n){n=n||2;var r,i,a,o,s,A,l,c=e&&e.length,u=c?e[0]*n:t.length,h=il(t,0,u,n,!0),f=[];if(!h||h.next===h.prev)return f;if(c&&(h=function(t,e,n,r){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=il(t,e[i]*r,i<a-1?e[i+1]*r:t.length,r,!1))===o.next&&(o.steiner=!0),s.push(pl(o));for(s.sort(ul),i=0;i<s.length;i++)n=hl(s[i],n);return n}(t,e,h,n)),t.length>80*n){r=a=t[0],i=o=t[1];for(var d=n;d<u;d+=n)(s=t[d])<r&&(r=s),(A=t[d+1])<i&&(i=A),s>a&&(a=s),A>o&&(o=A);l=0!==(l=Math.max(a-r,o-i))?32767/l:0}return ol(h,f,n,r,i,l,0),f}function il(t,e,n,r,i){var a,o;if(i===Cl(t,e,n,r)>0)for(a=e;a<n;a+=r)o=El(a,t[a],t[a+1],o);else for(a=n-r;a>=e;a-=r)o=El(a,t[a],t[a+1],o);return o&&_l(o,o.next)&&(Sl(o),o=o.next),o}function al(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!_l(r,r.next)&&0!==vl(r.prev,r,r.next))r=r.next;else{if(Sl(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function ol(t,e,n,r,i,a,o){if(t){!o&&a&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=dl(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,a,o,s,A,l=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(A=l;s>0||A>0&&r;)0!==s&&(0===A||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,A--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(t,r,i,a);for(var s,A,l=t;t.prev!==t.next;)if(s=t.prev,A=t.next,a?Al(t,r,i,a):sl(t))e.push(s.i/n|0),e.push(t.i/n|0),e.push(A.i/n|0),Sl(t),t=A.next,l=A.next;else if((t=A)===l){o?1===o?ol(t=ll(al(t),e,n),e,n,r,i,a,2):2===o&&cl(t,e,n,r,i,a):ol(al(t),e,n,r,i,a,1);break}}}function sl(t){var e=t.prev,n=t,r=t.next;if(vl(e,n,r)>=0)return!1;for(var i=e.x,a=n.x,o=r.x,s=e.y,A=n.y,l=r.y,c=i<a?i<o?i:o:a<o?a:o,u=s<A?s<l?s:l:A<l?A:l,h=i>a?i>o?i:o:a>o?a:o,f=s>A?s>l?s:l:A>l?A:l,d=r.next;d!==e;){if(d.x>=c&&d.x<=h&&d.y>=u&&d.y<=f&&ml(i,s,a,A,o,l,d.x,d.y)&&vl(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Al(t,e,n,r){var i=t.prev,a=t,o=t.next;if(vl(i,a,o)>=0)return!1;for(var s=i.x,A=a.x,l=o.x,c=i.y,u=a.y,h=o.y,f=s<A?s<l?s:l:A<l?A:l,d=c<u?c<h?c:h:u<h?u:h,p=s>A?s>l?s:l:A>l?A:l,m=c>u?c>h?c:h:u>h?u:h,g=dl(f,d,e,n,r),v=dl(p,m,e,n,r),_=t.prevZ,y=t.nextZ;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ml(s,c,A,u,l,h,_.x,_.y)&&vl(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ml(s,c,A,u,l,h,y.x,y.y)&&vl(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;_&&_.z>=g;){if(_.x>=f&&_.x<=p&&_.y>=d&&_.y<=m&&_!==i&&_!==o&&ml(s,c,A,u,l,h,_.x,_.y)&&vl(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=v;){if(y.x>=f&&y.x<=p&&y.y>=d&&y.y<=m&&y!==i&&y!==o&&ml(s,c,A,u,l,h,y.x,y.y)&&vl(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function ll(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!_l(i,a)&&yl(i,r,r.next,a)&&Ml(i,a)&&Ml(a,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),Sl(r),Sl(r.next),r=t=a),r=r.next}while(r!==t);return al(r)}function cl(t,e,n,r,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&gl(o,s)){var A=wl(o,s);return o=al(o,o.next),A=al(A,A.next),ol(o,e,n,r,i,a,0),void ol(A,e,n,r,i,a,0)}s=s.next}o=o.next}while(o!==t)}function ul(t,e){return t.x-e.x}function hl(t,e){var n=function(t,e){var n,r=e,i=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o&&(o=s,n=r.x<r.next.x?r:r.next,s===i))return n}r=r.next}while(r!==e);if(!n)return null;var A,l=n,c=n.x,u=n.y,h=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&ml(a<u?i:o,a,c,u,a<u?o:i,a,r.x,r.y)&&(A=Math.abs(a-r.y)/(i-r.x),Ml(r,t)&&(A<h||A===h&&(r.x>n.x||r.x===n.x&&fl(n,r)))&&(n=r,h=A)),r=r.next}while(r!==l);return n}(t,e);if(!n)return e;var r=wl(n,t);return al(r,r.next),al(n,n.next)}function fl(t,e){return vl(t.prev,t,e.prev)<0&&vl(e.next,t,t.next)<0}function dl(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function pl(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function ml(t,e,n,r,i,a,o,s){return(i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(r-s)>=(n-o)*(e-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function gl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&yl(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ml(t,e)&&Ml(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(vl(t.prev,t,e.prev)||vl(t,e.prev,e))||_l(t,e)&&vl(t.prev,t,t.next)>0&&vl(e.prev,e,e.next)>0)}function vl(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _l(t,e){return t.x===e.x&&t.y===e.y}function yl(t,e,n,r){var i=bl(vl(t,e,n)),a=bl(vl(t,e,r)),o=bl(vl(n,r,t)),s=bl(vl(n,r,e));return i!==a&&o!==s||(!(0!==i||!xl(t,n,e))||(!(0!==a||!xl(t,r,e))||(!(0!==o||!xl(n,t,r))||!(0!==s||!xl(n,e,r)))))}function xl(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function bl(t){return t>0?1:t<0?-1:0}function Ml(t,e){return vl(t.prev,t,t.next)<0?vl(t,e,t.next)>=0&&vl(t,t.prev,e)>=0:vl(t,e,t.prev)<0||vl(t,t.next,e)<0}function wl(t,e){var n=new Tl(t.i,t.x,t.y),r=new Tl(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function El(t,e,n,r){var i=new Tl(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Sl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Tl(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cl(t,e,n,r){for(var i=0,a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}nl.exports=rl,nl.exports.default=rl,rl.deviation=function(t,e,n,r){var i=e&&e.length,a=i?e[0]*n:t.length,o=Math.abs(Cl(t,0,a,n));if(i)for(var s=0,A=e.length;s<A;s++){var l=e[s]*n,c=s<A-1?e[s+1]*n:t.length;o-=Math.abs(Cl(t,l,c,n))}var u=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,f=r[s+1]*n,d=r[s+2]*n;u+=Math.abs((t[h]-t[d])*(t[f+1]-t[h+1])-(t[h]-t[f])*(t[d+1]-t[h+1]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},rl.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)n.vertices.push(t[i][a][o]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n};var Rl=el(nl.exports);function Pl(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ll(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Dl(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<0?i=e+1:a=e}while(i<a)}return i}return 2!==t.length?(e=Pl,n=(e,n)=>Pl(t(e),n),r=(e,n)=>t(e)-n):(e=t===Pl||t===Ll?t:Ol,n=t,r=t),{left:i,center:function(t,e,n=0,a=t.length){const o=i(t,e,n,a-1);return o>n&&r(t[o-1],e)>-r(t[o],e)?o-1:o},right:function(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<=0?i=e+1:a=e}while(i<a)}return i}}}function Ol(){return 0}const Il=Dl(Pl).right;function ql(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(void 0===n?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}Dl((function(t){return null===t?NaN:+t})).center;class Ul{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],a=t+i,o=Math.abs(t)<Math.abs(i)?t-(a-i):i-(a-t);o&&(e[n++]=o),t=a}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,a=0;if(i>0){for(a=t[--i];i>0&&(e=a,n=t[--i],a=e+n,r=n-(a-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=a+n,n==e-a&&(a=e))}return a}}const Nl=Math.sqrt(50),Bl=Math.sqrt(10),kl=Math.sqrt(2);function Fl(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Nl?10:a>=Bl?5:a>=kl?2:1;let s,A,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(t*l),A=Math.round(e*l),s/l<t&&++s,A/l>e&&--A,l=-l):(l=Math.pow(10,i)*o,s=Math.round(t/l),A=Math.round(e/l),s*l<t&&++s,A*l>e&&--A),A<s&&.5<=n&&n<2?Fl(t,e,2*n):[s,A,l]}function zl(t,e,n){return Fl(t=+t,e=+e,n=+n)[2]}function Gl(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Hl(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}var jl=1e-6,Vl=1e-12,Wl=Math.PI,Xl=Wl/2,Ql=Wl/4,Yl=2*Wl,Zl=180/Wl,Kl=Wl/180,Jl=Math.abs,$l=Math.atan,tc=Math.atan2,ec=Math.cos,nc=Math.ceil,rc=Math.hypot,ic=Math.sin,ac=Math.sign||function(t){return t>0?1:t<0?-1:0},oc=Math.sqrt;function sc(t){return t>1?Xl:t<-1?-Xl:Math.asin(t)}function Ac(t){return(t=ic(t/2))*t}function lc(){}function cc(t,e){t&&hc.hasOwnProperty(t.type)&&hc[t.type](t,e)}var uc={Feature:function(t,e){cc(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)cc(n[r].geometry,e)}},hc={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){fc(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)fc(n[r],e,0)},Polygon:function(t,e){dc(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)dc(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)cc(n[r],e)}};function fc(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function dc(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)fc(t[n],e,1);e.polygonEnd()}function pc(t,e){t&&uc.hasOwnProperty(t.type)?uc[t.type](t,e):cc(t,e)}var mc,gc,vc,_c,yc,xc,bc,Mc,wc,Ec,Sc,Tc,Cc,Rc,Pc,Lc,Dc=new Ul,Oc=new Ul,Ic={point:lc,lineStart:lc,lineEnd:lc,polygonStart:function(){Dc=new Ul,Ic.lineStart=qc,Ic.lineEnd=Uc},polygonEnd:function(){var t=+Dc;Oc.add(t<0?Yl+t:t),this.lineStart=this.lineEnd=this.point=lc},sphere:function(){Oc.add(Yl)}};function qc(){Ic.point=Nc}function Uc(){Bc(mc,gc)}function Nc(t,e){Ic.point=Bc,mc=t,gc=e,vc=t*=Kl,_c=ec(e=(e*=Kl)/2+Ql),yc=ic(e)}function Bc(t,e){var n=(t*=Kl)-vc,r=n>=0?1:-1,i=r*n,a=ec(e=(e*=Kl)/2+Ql),o=ic(e),s=yc*o,A=_c*a+s*ec(i),l=s*r*ic(i);Dc.add(tc(l,A)),vc=t,_c=a,yc=o}function kc(t){return[tc(t[1],t[0]),sc(t[2])]}function Fc(t){var e=t[0],n=t[1],r=ec(n);return[r*ec(e),r*ic(e),ic(n)]}function zc(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Gc(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 Hc(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function jc(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Vc(t){var e=oc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var Wc,Xc,Qc,Yc,Zc,Kc,Jc,$c,tu,eu,nu,ru,iu,au,ou,su,Au={point:lu,lineStart:uu,lineEnd:hu,polygonStart:function(){Au.point=fu,Au.lineStart=du,Au.lineEnd=pu,Rc=new Ul,Ic.polygonStart()},polygonEnd:function(){Ic.polygonEnd(),Au.point=lu,Au.lineStart=uu,Au.lineEnd=hu,Dc<0?(xc=-(Mc=180),bc=-(wc=90)):Rc>jl?wc=90:Rc<-jl&&(bc=-90),Lc[0]=xc,Lc[1]=Mc},sphere:function(){xc=-(Mc=180),bc=-(wc=90)}};function lu(t,e){Pc.push(Lc=[xc=t,Mc=t]),e<bc&&(bc=e),e>wc&&(wc=e)}function cu(t,e){var n=Fc([t*Kl,e*Kl]);if(Cc){var r=Gc(Cc,n),i=Gc([r[1],-r[0],0],r);Vc(i),i=kc(i);var a,o=t-Ec,s=o>0?1:-1,A=i[0]*Zl*s,l=Jl(o)>180;l^(s*Ec<A&&A<s*t)?(a=i[1]*Zl)>wc&&(wc=a):l^(s*Ec<(A=(A+360)%360-180)&&A<s*t)?(a=-i[1]*Zl)<bc&&(bc=a):(e<bc&&(bc=e),e>wc&&(wc=e)),l?t<Ec?mu(xc,t)>mu(xc,Mc)&&(Mc=t):mu(t,Mc)>mu(xc,Mc)&&(xc=t):Mc>=xc?(t<xc&&(xc=t),t>Mc&&(Mc=t)):t>Ec?mu(xc,t)>mu(xc,Mc)&&(Mc=t):mu(t,Mc)>mu(xc,Mc)&&(xc=t)}else Pc.push(Lc=[xc=t,Mc=t]);e<bc&&(bc=e),e>wc&&(wc=e),Cc=n,Ec=t}function uu(){Au.point=cu}function hu(){Lc[0]=xc,Lc[1]=Mc,Au.point=lu,Cc=null}function fu(t,e){if(Cc){var n=t-Ec;Rc.add(Jl(n)>180?n+(n>0?360:-360):n)}else Sc=t,Tc=e;Ic.point(t,e),cu(t,e)}function du(){Ic.lineStart()}function pu(){fu(Sc,Tc),Ic.lineEnd(),Jl(Rc)>jl&&(xc=-(Mc=180)),Lc[0]=xc,Lc[1]=Mc,Cc=null}function mu(t,e){return(e-=t)<0?e+360:e}function gu(t,e){return t[0]-e[0]}function vu(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function _u(t){var e,n,r,i,a,o,s;if(wc=Mc=-(xc=bc=1/0),Pc=[],pc(t,Au),n=Pc.length){for(Pc.sort(gu),e=1,a=[r=Pc[0]];e<n;++e)vu(r,(i=Pc[e])[0])||vu(r,i[1])?(mu(r[0],i[1])>mu(r[0],r[1])&&(r[1]=i[1]),mu(i[0],r[1])>mu(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,e=0,r=a[n=a.length-1];e<=n;r=i,++e)i=a[e],(s=mu(r[1],i[0]))>o&&(o=s,xc=i[0],Mc=r[1])}return Pc=Lc=null,xc===1/0||bc===1/0?[[NaN,NaN],[NaN,NaN]]:[[xc,bc],[Mc,wc]]}var yu={sphere:lc,point:xu,lineStart:Mu,lineEnd:Su,polygonStart:function(){yu.lineStart=Tu,yu.lineEnd=Cu},polygonEnd:function(){yu.lineStart=Mu,yu.lineEnd=Su}};function xu(t,e){t*=Kl;var n=ec(e*=Kl);bu(n*ec(t),n*ic(t),ic(e))}function bu(t,e,n){++Wc,Qc+=(t-Qc)/Wc,Yc+=(e-Yc)/Wc,Zc+=(n-Zc)/Wc}function Mu(){yu.point=wu}function wu(t,e){t*=Kl;var n=ec(e*=Kl);au=n*ec(t),ou=n*ic(t),su=ic(e),yu.point=Eu,bu(au,ou,su)}function Eu(t,e){t*=Kl;var n=ec(e*=Kl),r=n*ec(t),i=n*ic(t),a=ic(e),o=tc(oc((o=ou*a-su*i)*o+(o=su*r-au*a)*o+(o=au*i-ou*r)*o),au*r+ou*i+su*a);Xc+=o,Kc+=o*(au+(au=r)),Jc+=o*(ou+(ou=i)),$c+=o*(su+(su=a)),bu(au,ou,su)}function Su(){yu.point=xu}function Tu(){yu.point=Ru}function Cu(){Pu(ru,iu),yu.point=xu}function Ru(t,e){ru=t,iu=e,t*=Kl,e*=Kl,yu.point=Pu;var n=ec(e);au=n*ec(t),ou=n*ic(t),su=ic(e),bu(au,ou,su)}function Pu(t,e){t*=Kl;var n=ec(e*=Kl),r=n*ec(t),i=n*ic(t),a=ic(e),o=ou*a-su*i,s=su*r-au*a,A=au*i-ou*r,l=rc(o,s,A),c=sc(l),u=l&&-c/l;tu.add(u*o),eu.add(u*s),nu.add(u*A),Xc+=c,Kc+=c*(au+(au=r)),Jc+=c*(ou+(ou=i)),$c+=c*(su+(su=a)),bu(au,ou,su)}function Lu(t){Wc=Xc=Qc=Yc=Zc=Kc=Jc=$c=0,tu=new Ul,eu=new Ul,nu=new Ul,pc(t,yu);var e=+tu,n=+eu,r=+nu,i=rc(e,n,r);return i<Vl&&(e=Kc,n=Jc,r=$c,Xc<jl&&(e=Qc,n=Yc,r=Zc),(i=rc(e,n,r))<Vl)?[NaN,NaN]:[tc(n,e)*Zl,sc(r/i)*Zl]}function Du(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function Ou(t,e){return Jl(t)>Wl&&(t-=Math.round(t/Yl)*Yl),[t,e]}function Iu(t,e,n){return(t%=Yl)?e||n?Du(Uu(t),Nu(e,n)):Uu(t):e||n?Nu(e,n):Ou}function qu(t){return function(e,n){return Jl(e+=t)>Wl&&(e-=Math.round(e/Yl)*Yl),[e,n]}}function Uu(t){var e=qu(t);return e.invert=qu(-t),e}function Nu(t,e){var n=ec(t),r=ic(t),i=ec(e),a=ic(e);function o(t,e){var o=ec(e),s=ec(t)*o,A=ic(t)*o,l=ic(e),c=l*n+s*r;return[tc(A*i-c*a,s*n-l*r),sc(c*i+A*a)]}return o.invert=function(t,e){var o=ec(e),s=ec(t)*o,A=ic(t)*o,l=ic(e),c=l*i-A*a;return[tc(A*i+l*a,s*n+c*r),sc(c*n-s*r)]},o}function Bu(t,e){(e=Fc(e))[0]-=t,Vc(e);var n,r=(n=-e[1])>1?0:n<-1?Wl:Math.acos(n);return((-e[2]<0?-r:r)+Yl-jl)%Yl}function ku(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:lc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Fu(t,e){return Jl(t[0]-e[0])<jl&&Jl(t[1]-e[1])<jl}function zu(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Gu(t,e,n,r,i){var a,o,s=[],A=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(Fu(r,o)){if(!r[2]&&!o[2]){for(i.lineStart(),a=0;a<e;++a)i.point((r=t[a])[0],r[1]);return void i.lineEnd()}o[0]+=2*jl}s.push(n=new zu(r,t,null,!0)),A.push(n.o=new zu(r,null,n,!1)),s.push(n=new zu(o,t,null,!1)),A.push(n.o=new zu(o,null,n,!0))}})),s.length){for(A.sort(e),Hu(s),Hu(A),a=0,o=A.length;a<o;++a)A[a].e=n=!n;for(var l,c,u=s[0];;){for(var h=u,f=!0;h.v;)if((h=h.n)===u)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(a=0,o=l.length;a<o;++a)i.point((c=l[a])[0],c[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(l=h.p.z,a=l.length-1;a>=0;--a)i.point((c=l[a])[0],c[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,f=!f}while(!h.v);i.lineEnd()}}}function Hu(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function ju(t){return Jl(t[0])<=Wl?t[0]:ac(t[0])*((Jl(t[0])+Wl)%Yl-Wl)}function Vu(t,e){var n=ju(e),r=e[1],i=ic(r),a=[ic(n),-ec(n),0],o=0,s=0,A=new Ul;1===i?r=Xl+jl:-1===i&&(r=-Xl-jl);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,f=u[h-1],d=ju(f),p=f[1]/2+Ql,m=ic(p),g=ec(p),v=0;v<h;++v,d=y,m=b,g=M,f=_){var _=u[v],y=ju(_),x=_[1]/2+Ql,b=ic(x),M=ec(x),w=y-d,E=w>=0?1:-1,S=E*w,T=S>Wl,C=m*b;if(A.add(tc(C*E*ic(S),g*M+C*ec(S))),o+=T?w+E*Yl:w,T^d>=n^y>=n){var R=Gc(Fc(f),Fc(_));Vc(R);var P=Gc(a,R);Vc(P);var L=(T^w>=0?-1:1)*sc(P[2]);(r>L||r===L&&(R[0]||R[1]))&&(s+=T^w>=0?1:-1)}}return(o<-jl||o<jl&&A<-Vl)^1&s}function Wu(t,e,n,r){return function(i){var a,o,s,A=e(i),l=ku(),c=e(l),u=!1,h={point:f,lineStart:p,lineEnd:m,polygonStart:function(){h.point=g,h.lineStart=v,h.lineEnd=_,o=[],a=[]},polygonEnd:function(){h.point=f,h.lineStart=p,h.lineEnd=m,o=Gl(o);var t=Vu(a,r);o.length?(u||(i.polygonStart(),u=!0),Gu(o,Qu,t,n,i)):t&&(u||(i.polygonStart(),u=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),u&&(i.polygonEnd(),u=!1),o=a=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function f(e,n){t(e,n)&&i.point(e,n)}function d(t,e){A.point(t,e)}function p(){h.point=d,A.lineStart()}function m(){h.point=f,A.lineEnd()}function g(t,e){s.push([t,e]),c.point(t,e)}function v(){c.lineStart(),s=[]}function _(){g(s[0][0],s[0][1]),c.lineEnd();var t,e,n,r,A=c.clean(),h=l.result(),f=h.length;if(s.pop(),a.push(s),s=null,f)if(1&A){if((e=(n=h[0]).length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else f>1&&2&A&&h.push(h.pop().concat(h.shift())),o.push(h.filter(Xu))}return h}}function Xu(t){return t.length>1}function Qu(t,e){return((t=t.x)[0]<0?t[1]-Xl-jl:Xl-t[1])-((e=e.x)[0]<0?e[1]-Xl-jl:Xl-e[1])}Ou.invert=Ou;var Yu=Wu((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?Wl:-Wl,A=Jl(a-n);Jl(A-Wl)<jl?(t.point(n,r=(r+o)/2>0?Xl:-Xl),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(a,r),e=0):i!==s&&A>=Wl&&(Jl(n-i)<jl&&(n-=i*jl),Jl(a-s)<jl&&(a-=s*jl),r=function(t,e,n,r){var i,a,o=ic(t-n);return Jl(o)>jl?$l((ic(e)*(a=ec(r))*ic(n)-ic(r)*(i=ec(e))*ic(t))/(i*a*o)):(e+r)/2}(n,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=a,r=o),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Xl,r.point(-Wl,i),r.point(0,i),r.point(Wl,i),r.point(Wl,0),r.point(Wl,-i),r.point(0,-i),r.point(-Wl,-i),r.point(-Wl,0),r.point(-Wl,i);else if(Jl(t[0]-e[0])>jl){var a=t[0]<e[0]?Wl:-Wl;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(e[0],e[1])}),[-Wl,-Xl]);function Zu(t){var e=ec(t),n=2*Kl,r=e>0,i=Jl(e)>jl;function a(t,n){return ec(t)*ec(n)>e}function o(t,n,r){var i=[1,0,0],a=Gc(Fc(t),Fc(n)),o=zc(a,a),s=a[0],A=o-s*s;if(!A)return!r&&t;var l=e*o/A,c=-e*s/A,u=Gc(i,a),h=jc(i,l);Hc(h,jc(a,c));var f=u,d=zc(h,f),p=zc(f,f),m=d*d-p*(zc(h,h)-1);if(!(m<0)){var g=oc(m),v=jc(f,(-d-g)/p);if(Hc(v,h),v=kc(v),!r)return v;var _,y=t[0],x=n[0],b=t[1],M=n[1];x<y&&(_=y,y=x,x=_);var w=x-y,E=Jl(w-Wl)<jl;if(!E&&M<b&&(_=b,b=M,M=_),E||w<jl?E?b+M>0^v[1]<(Jl(v[0]-y)<jl?b:M):b<=v[1]&&v[1]<=M:w>Wl^(y<=v[0]&&v[0]<=x)){var S=jc(f,(-d+g)/p);return Hc(S,h),[v,kc(S)]}}}function s(e,n){var i=r?t:Wl-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return Wu(a,(function(t){var e,n,A,l,c;return{lineStart:function(){l=A=!1,c=1},point:function(u,h){var f,d=[u,h],p=a(u,h),m=r?p?0:s(u,h):p?s(u+(u<0?Wl:-Wl),h):0;if(!e&&(l=A=p)&&t.lineStart(),p!==A&&(!(f=o(e,d))||Fu(e,f)||Fu(d,f))&&(d[2]=1),p!==A)c=0,p?(t.lineStart(),f=o(d,e),t.point(f[0],f[1])):(f=o(e,d),t.point(f[0],f[1],2),t.lineEnd()),e=f;else if(i&&e&&r^p){var g;m&n||!(g=o(d,e,!0))||(c=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1],3)))}!p||e&&Fu(e,d)||t.point(d[0],d[1]),e=d,A=p,n=m},lineEnd:function(){A&&t.lineEnd(),e=null},clean:function(){return c|(l&&A)<<1}}}),(function(e,r,i,a){!function(t,e,n,r,i,a){if(n){var o=ec(e),s=ic(e),A=r*n;null==i?(i=e+r*Yl,a=e-A/2):(i=Bu(o,i),a=Bu(o,a),(r>0?i<a:i>a)&&(i+=r*Yl));for(var l,c=i;r>0?c>a:c<a;c-=A)l=kc([o,-s*ec(c),-s*ic(c)]),t.point(l[0],l[1])}}(a,t,n,i,e,r)}),r?[0,-t]:[-Wl,t-Wl])}var Ku,Ju,$u,th,eh=1e9,nh=-eh;function rh(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,s,l){var c=0,u=0;if(null==i||(c=o(i,s))!==(u=o(a,s))||A(i,a)<0^s>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==u);else l.point(a[0],a[1])}function o(r,i){return Jl(r[0]-t)<jl?i>0?0:3:Jl(r[0]-n)<jl?i>0?2:1:Jl(r[1]-e)<jl?i>0?1:0:i>0?3:2}function s(t,e){return A(t.x,e.x)}function A(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var A,l,c,u,h,f,d,p,m,g,v,_=o,y=ku(),x={point:b,lineStart:function(){x.point=M,l&&l.push(c=[]);g=!0,m=!1,d=p=NaN},lineEnd:function(){A&&(M(u,h),f&&m&&y.rejoin(),A.push(y.result()));x.point=b,m&&_.lineEnd()},polygonStart:function(){_=y,A=[],l=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var a,o,s=l[n],A=1,c=s.length,u=s[0],h=u[0],f=u[1];A<c;++A)a=h,o=f,h=(u=s[A])[0],f=u[1],o<=r?f>r&&(h-a)*(r-o)>(f-o)*(t-a)&&++e:f<=r&&(h-a)*(r-o)<(f-o)*(t-a)&&--e;return e}(),n=v&&e,i=(A=Gl(A)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&Gu(A,s,e,a,o),o.polygonEnd());_=o,A=l=c=null}};function b(t,e){i(t,e)&&_.point(t,e)}function M(a,o){var s=i(a,o);if(l&&c.push([a,o]),g)u=a,h=o,f=s,g=!1,s&&(_.lineStart(),_.point(a,o));else if(s&&m)_.point(a,o);else{var A=[d=Math.max(nh,Math.min(eh,d)),p=Math.max(nh,Math.min(eh,p))],y=[a=Math.max(nh,Math.min(eh,a)),o=Math.max(nh,Math.min(eh,o))];!function(t,e,n,r,i,a){var o,s=t[0],A=t[1],l=0,c=1,u=e[0]-s,h=e[1]-A;if(o=n-s,u||!(o>0)){if(o/=u,u<0){if(o<l)return;o<c&&(c=o)}else if(u>0){if(o>c)return;o>l&&(l=o)}if(o=i-s,u||!(o<0)){if(o/=u,u<0){if(o>c)return;o>l&&(l=o)}else if(u>0){if(o<l)return;o<c&&(c=o)}if(o=r-A,h||!(o>0)){if(o/=h,h<0){if(o<l)return;o<c&&(c=o)}else if(h>0){if(o>c)return;o>l&&(l=o)}if(o=a-A,h||!(o<0)){if(o/=h,h<0){if(o>c)return;o>l&&(l=o)}else if(h>0){if(o<l)return;o<c&&(c=o)}return l>0&&(t[0]=s+l*u,t[1]=A+l*h),c<1&&(e[0]=s+c*u,e[1]=A+c*h),!0}}}}}(A,y,t,e,n,r)?s&&(_.lineStart(),_.point(a,o),v=!1):(m||(_.lineStart(),_.point(A[0],A[1])),_.point(y[0],y[1]),s||_.lineEnd(),v=!1)}d=a,p=o,m=s}return x}}var ih={sphere:lc,point:lc,lineStart:function(){ih.point=oh,ih.lineEnd=ah},lineEnd:lc,polygonStart:lc,polygonEnd:lc};function ah(){ih.point=ih.lineEnd=lc}function oh(t,e){Ju=t*=Kl,$u=ic(e*=Kl),th=ec(e),ih.point=sh}function sh(t,e){t*=Kl;var n=ic(e*=Kl),r=ec(e),i=Jl(t-Ju),a=ec(i),o=r*ic(i),s=th*n-$u*r*a,A=$u*n+th*r*a;Ku.add(tc(oc(o*o+s*s),A)),Ju=t,$u=n,th=r}var Ah=[null,null],lh={type:"LineString",coordinates:Ah};function ch(t,e){return Ah[0]=t,Ah[1]=e,function(t){return Ku=new Ul,pc(t,ih),+Ku}(lh)}var uh={Feature:function(t,e){return fh(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)if(fh(n[r].geometry,e))return!0;return!1}},hh={Sphere:function(){return!0},Point:function(t,e){return dh(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(dh(n[r],e))return!0;return!1},LineString:function(t,e){return ph(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(ph(n[r],e))return!0;return!1},Polygon:function(t,e){return mh(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(mh(n[r],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)if(fh(n[r],e))return!0;return!1}};function fh(t,e){return!(!t||!hh.hasOwnProperty(t.type))&&hh[t.type](t,e)}function dh(t,e){return 0===ch(t,e)}function ph(t,e){for(var n,r,i,a=0,o=t.length;a<o;a++){if(0===(r=ch(t[a],e)))return!0;if(a>0&&(i=ch(t[a],t[a-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<Vl*i)return!0;n=r}return!1}function mh(t,e){return!!Vu(t.map(gh),vh(e))}function gh(t){return(t=t.map(vh)).pop(),t}function vh(t){return[t[0]*Kl,t[1]*Kl]}function _h(t,e,n){var r=Hl(t,e-jl,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function yh(t,e,n){var r=Hl(t,e-jl,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function xh(){return function(){var t,e,n,r,i,a,o,s,A,l,c,u,h=10,f=h,d=90,p=360,m=2.5;function g(){return{type:"MultiLineString",coordinates:v()}}function v(){return Hl(nc(r/d)*d,n,d).map(c).concat(Hl(nc(s/p)*p,o,p).map(u)).concat(Hl(nc(e/h)*h,t,h).filter((function(t){return Jl(t%d)>jl})).map(A)).concat(Hl(nc(a/f)*f,i,f).filter((function(t){return Jl(t%p)>jl})).map(l))}return g.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},g.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(u(o).slice(1),c(n).reverse().slice(1),u(s).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.extentMajor(t).extentMinor(t):g.extentMinor()},g.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),s>o&&(t=s,s=o,o=t),g.precision(m)):[[r,s],[n,o]]},g.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),g.precision(m)):[[e,a],[t,i]]},g.step=function(t){return arguments.length?g.stepMajor(t).stepMinor(t):g.stepMinor()},g.stepMajor=function(t){return arguments.length?(d=+t[0],p=+t[1],g):[d,p]},g.stepMinor=function(t){return arguments.length?(h=+t[0],f=+t[1],g):[h,f]},g.precision=function(h){return arguments.length?(m=+h,A=_h(a,i,90),l=yh(e,t,m),c=_h(s,o,90),u=yh(r,n,m),g):m},g.extentMajor([[-180,-90+jl],[180,90-jl]]).extentMinor([[-180,-80-jl],[180,80+jl]])}()()}function bh(t,e){var n=t[0]*Kl,r=t[1]*Kl,i=e[0]*Kl,a=e[1]*Kl,o=ec(r),s=ic(r),A=ec(a),l=ic(a),c=o*ec(n),u=o*ic(n),h=A*ec(i),f=A*ic(i),d=2*sc(oc(Ac(a-r)+o*A*Ac(i-n))),p=ic(d),m=d?function(t){var e=ic(t*=d)/p,n=ic(d-t)/p,r=n*c+e*h,i=n*u+e*f,a=n*s+e*l;return[tc(i,r)*Zl,tc(a,oc(r*r+i*i))*Zl]}:function(){return[n*Zl,r*Zl]};return m.distance=d,m}var Mh=t=>t,wh=1/0,Eh=wh,Sh=-wh,Th=Sh;var Ch={point:function(t,e){t<wh&&(wh=t);t>Sh&&(Sh=t);e<Eh&&(Eh=e);e>Th&&(Th=e)},lineStart:lc,lineEnd:lc,polygonStart:lc,polygonEnd:lc,result:function(){var t=[[wh,Eh],[Sh,Th]];return Sh=Th=-(Eh=wh=1/0),t}};function Rh(t){return function(e){var n=new Ph;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Ph(){}function Lh(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),pc(n,t.stream(Ch)),e(Ch.result()),null!=r&&t.clipExtent(r),t}function Dh(t,e,n){return Lh(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}Ph.prototype={constructor:Ph,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 Oh=16,Ih=ec(30*Kl);function qh(t,e){return+e?function(t,e){function n(r,i,a,o,s,A,l,c,u,h,f,d,p,m){var g=l-r,v=c-i,_=g*g+v*v;if(_>4*e&&p--){var y=o+h,x=s+f,b=A+d,M=oc(y*y+x*x+b*b),w=sc(b/=M),E=Jl(Jl(b)-1)<jl||Jl(a-u)<jl?(a+u)/2:tc(x,y),S=t(E,w),T=S[0],C=S[1],R=T-r,P=C-i,L=v*R-g*P;(L*L/_>e||Jl((g*R+v*P)/_-.5)>.3||o*h+s*f+A*d<Ih)&&(n(r,i,a,o,s,A,T,C,E,y/=M,x/=M,b,p,m),m.point(T,C),n(T,C,E,y,x,b,l,c,u,h,f,d,p,m))}}return function(e){var r,i,a,o,s,A,l,c,u,h,f,d,p={point:m,lineStart:g,lineEnd:_,polygonStart:function(){e.polygonStart(),p.lineStart=y},polygonEnd:function(){e.polygonEnd(),p.lineStart=g}};function m(n,r){n=t(n,r),e.point(n[0],n[1])}function g(){c=NaN,p.point=v,e.lineStart()}function v(r,i){var a=Fc([r,i]),o=t(r,i);n(c,u,l,h,f,d,c=o[0],u=o[1],l=r,h=a[0],f=a[1],d=a[2],Oh,e),e.point(c,u)}function _(){p.point=m,e.lineEnd()}function y(){g(),p.point=x,p.lineEnd=b}function x(t,e){v(r=t,e),i=c,a=u,o=h,s=f,A=d,p.point=v}function b(){n(c,u,l,h,f,d,i,a,r,o,s,A,Oh,e),p.lineEnd=_,_()}return p}}(t,e):function(t){return Rh({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Uh=Rh({point:function(t,e){this.stream.point(t*Kl,e*Kl)}});function Nh(t,e,n,r,i,a){if(!a)return function(t,e,n,r,i){function a(a,o){return[e+t*(a*=r),n-t*(o*=i)]}return a.invert=function(a,o){return[(a-e)/t*r,(n-o)/t*i]},a}(t,e,n,r,i);var o=ec(a),s=ic(a),A=o*t,l=s*t,c=o/t,u=s/t,h=(s*n-o*e)/t,f=(s*e+o*n)/t;function d(t,a){return[A*(t*=r)-l*(a*=i)+e,n-l*t-A*a]}return d.invert=function(t,e){return[r*(c*t-u*e+h),i*(f-u*t-c*e)]},d}function Bh(t){return function(t){var e,n,r,i,a,o,s,A,l,c,u=150,h=480,f=250,d=0,p=0,m=0,g=0,v=0,_=0,y=1,x=1,b=null,M=Yu,w=null,E=Mh,S=.5;function T(t){return A(t[0]*Kl,t[1]*Kl)}function C(t){return(t=A.invert(t[0],t[1]))&&[t[0]*Zl,t[1]*Zl]}function R(){var t=Nh(u,0,0,y,x,_).apply(null,e(d,p)),r=Nh(u,h-t[0],f-t[1],y,x,_);return n=Iu(m,g,v),s=Du(e,r),A=Du(n,s),o=qh(s,S),P()}function P(){return l=c=null,T}return T.stream=function(t){return l&&c===t?l:l=Uh(function(t){return Rh({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(o(E(c=t)))))},T.preclip=function(t){return arguments.length?(M=t,b=void 0,P()):M},T.postclip=function(t){return arguments.length?(E=t,w=r=i=a=null,P()):E},T.clipAngle=function(t){return arguments.length?(M=+t?Zu(b=t*Kl):(b=null,Yu),P()):b*Zl},T.clipExtent=function(t){return arguments.length?(E=null==t?(w=r=i=a=null,Mh):rh(w=+t[0][0],r=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==w?null:[[w,r],[i,a]]},T.scale=function(t){return arguments.length?(u=+t,R()):u},T.translate=function(t){return arguments.length?(h=+t[0],f=+t[1],R()):[h,f]},T.center=function(t){return arguments.length?(d=t[0]%360*Kl,p=t[1]%360*Kl,R()):[d*Zl,p*Zl]},T.rotate=function(t){return arguments.length?(m=t[0]%360*Kl,g=t[1]%360*Kl,v=t.length>2?t[2]%360*Kl:0,R()):[m*Zl,g*Zl,v*Zl]},T.angle=function(t){return arguments.length?(_=t%360*Kl,R()):_*Zl},T.reflectX=function(t){return arguments.length?(y=t?-1:1,R()):y<0},T.reflectY=function(t){return arguments.length?(x=t?-1:1,R()):x<0},T.precision=function(t){return arguments.length?(o=qh(s,S=t*t),P()):oc(S)},T.fitExtent=function(t,e){return Dh(T,t,e)},T.fitSize=function(t,e){return function(t,e,n){return Dh(t,[[0,0],e],n)}(T,t,e)},T.fitWidth=function(t,e){return function(t,e,n){return Lh(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];t.scale(150*i).translate([a,o])}),n)}(T,t,e)},T.fitHeight=function(t,e){return function(t,e,n){return Lh(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,o])}),n)}(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&C,R()}}((function(){return t}))()}function kh(t,e){var n=ec(e),r=1+ec(t)*n;return[n*ic(t)/r,ic(e)/r]}function Fh(){return Bh(kh).scale(250).clipAngle(142)}function zh(t,e,n){return e=Vh(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gh()?Reflect.construct(e,n||[],Vh(t).constructor):e.apply(t,n))}function Gh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gh=function(){return!!t})()}function Hh(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function jh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hh(r.key),r)}}function Vh(t){return Vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vh(t)}function Wh(t,e){return Wh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wh(t,e)}function Xh(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Qh(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qh(t,e){if(t){if("string"==typeof t)return Yh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yh(t,e):void 0}}function Yh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}kh.invert=function(t){return function(e,n){var r=oc(e*e+n*n),i=t(r),a=ic(i),o=ec(i);return[tc(e*a,r*o),sc(r&&n*a/r)]}}((function(t){return 2*$l(t)}));var Zh=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){var i=180*ch(r,n)/Math.PI;if(i>t)for(var a=bh(n,r),o=1/Math.ceil(i/t),s=o;s<1;)e.push(a(s)),s+=o}e.push(n=r)})),e},Kh="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:Hn,Float32BufferAttribute:qn},Jh=(new Kh.BufferGeometry).setAttribute?"setAttribute":"addAttribute",$h=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=zh(this,e)).type="GeoJsonGeometry",n.parameters={geoJson:t,radius:r,resolution:i};var a=({Point:l,MultiPoint:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return l(t,e)})).forEach((function(t){var e=Xh(t,1)[0];tf(n,e)})),[n]},LineString:c,MultiLineString:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return c(t,e)})).forEach((function(t){var e=Xh(t,1)[0];tf(n,e)})),[n]},Polygon:u,MultiPolygon:function(t,e){var n={vertices:[],indices:[]},r={vertices:[],indices:[]};t.map((function(t){return u(t,e)})).forEach((function(t){var e=Xh(t,2),i=e[0],a=e[1];tf(n,i),a&&tf(r,a)}));var i=[n];return r.vertices.length&&i.push(r),i}}[t.type]||function(){return[]})(t.coordinates,r),o=[],s=[],A=0;function l(t,e){return[{vertices:nf(t[1],t[0],e),indices:[]}]}function c(t,e){for(var n=Zh(t,i).map((function(t){var n=Xh(t,2),r=n[0];return nf(n[1],r,e)})),r=Rl.flatten([n]).vertices,a=Math.round(r.length/3),o=[],s=1;s<a;s++)o.push(s-1,s);return[{vertices:r,indices:o}]}function u(t,e){for(var n=t.map((function(t){return Zh(t,i).map((function(t){var n=Xh(t,2),r=n[0];return nf(n[1],r,e)}))})),r=Rl.flatten(n),a=r.vertices,o=r.holes,s=o[0]||1/0,A=a.slice(0,3*s),l=a.slice(3*s),c=new Set(o),u=Math.round(a.length/3),h=[],f=[],d=1;d<u;d++)c.has(d)||(d<s?h.push(d-1,d):f.push(d-1-s,d-s));var p=[{indices:h,vertices:A}];return o.length&&p.push({indices:f,vertices:l}),p}return a.forEach((function(t){var e=o.length;tf({indices:o,vertices:s},t),n.addGroup(e,o.length-e,A++)})),o.length&&n.setIndex(o),s.length&&n[Jh]("position",new Kh.Float32BufferAttribute(s,3)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wh(t,e)}(e,t),n=e,r&&jh(n.prototype,r),i&&jh(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(Kh.BufferGeometry);function tf(t,e){var n=Math.round(t.vertices.length/3);ef(t.vertices,e.vertices),ef(t.indices,e.indices.map((function(t){return t+n})))}function ef(t,e){var n,r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Qh(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.push(i)}}catch(t){r.e(t)}finally{r.f()}}function nf(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}function rf(t){let e,n,r,i=-1,a=0;for(let o=0;o<t.length;++o){const s=t[o];if(void 0===e&&(e=s.array.constructor),e!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=s.itemSize),n!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=s.normalized),r!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===i&&(i=s.gpuType),i!==s.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;a+=s.count*n}const o=new e(a),s=new Dn(o,n,r);let A=0;for(let e=0;e<t.length;++e){const r=t[e];if(r.isInterleavedBufferAttribute){const t=A/n;for(let e=0,i=r.count;e<i;e++)for(let i=0;i<n;i++){const n=r.getComponent(e,i);s.setComponent(e+t,i,n)}}else o.set(r.array,A);A+=r.count*n}return void 0!==i&&(s.gpuType=i),s}function af(t){const e=t.data.array.constructor,n=t.count,r=t.itemSize,i=t.normalized,a=new e(n*r);let o;o=t.isInstancedInterleavedBufferAttribute?new wo(a,r,i,t.meshPerAttribute):new Dn(a,r,i);for(let e=0;e<n;e++)o.setX(e,t.getX(e)),r>=2&&o.setY(e,t.getY(e)),r>=3&&o.setZ(e,t.getZ(e)),r>=4&&o.setW(e,t.getW(e));return o}var of=Object.freeze({__proto__:null,computeMikkTSpaceTangents:function(t,e,n=!0){if(!e||!e.isReady)throw new Error("BufferGeometryUtils: Initialized MikkTSpace library required.");if(!t.hasAttribute("position")||!t.hasAttribute("normal")||!t.hasAttribute("uv"))throw new Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function r(t){if(t.normalized||t.isInterleavedBufferAttribute){const e=new Float32Array(t.count*t.itemSize);for(let n=0,r=0;n<t.count;n++)e[r++]=t.getX(n),e[r++]=t.getY(n),t.itemSize>2&&(e[r++]=t.getZ(n));return e}return t.array instanceof Float32Array?t.array:new Float32Array(t.array)}const i=t.index?t.toNonIndexed():t,a=e.generateTangents(r(i.attributes.position),r(i.attributes.normal),r(i.attributes.uv));if(n)for(let t=3;t<a.length;t+=4)a[t]*=-1;return i.setAttribute("tangent",new Dn(a,4)),t!==i&&t.copy(i),t},computeMorphedAttributes:function(t){const e=new ae,n=new ae,r=new ae,i=new ae,a=new ae,o=new ae,s=new ae,A=new ae,l=new ae;function c(t,c,u,h,f,d,p,m){e.fromBufferAttribute(c,f),n.fromBufferAttribute(c,d),r.fromBufferAttribute(c,p);const g=t.morphTargetInfluences;if(u&&g){s.set(0,0,0),A.set(0,0,0),l.set(0,0,0);for(let t=0,c=u.length;t<c;t++){const c=g[t],m=u[t];0!==c&&(i.fromBufferAttribute(m,f),a.fromBufferAttribute(m,d),o.fromBufferAttribute(m,p),h?(s.addScaledVector(i,c),A.addScaledVector(a,c),l.addScaledVector(o,c)):(s.addScaledVector(i.sub(e),c),A.addScaledVector(a.sub(n),c),l.addScaledVector(o.sub(r),c)))}e.add(s),n.add(A),r.add(l)}t.isSkinnedMesh&&(t.applyBoneTransform(f,e),t.applyBoneTransform(d,n),t.applyBoneTransform(p,r)),m[3*f+0]=e.x,m[3*f+1]=e.y,m[3*f+2]=e.z,m[3*d+0]=n.x,m[3*d+1]=n.y,m[3*d+2]=n.z,m[3*p+0]=r.x,m[3*p+1]=r.y,m[3*p+2]=r.z}const u=t.geometry,h=t.material;let f,d,p;const m=u.index,g=u.attributes.position,v=u.morphAttributes.position,_=u.morphTargetsRelative,y=u.attributes.normal,x=u.morphAttributes.position,b=u.groups,M=u.drawRange;let w,E,S,T,C,R,P;const L=new Float32Array(g.count*g.itemSize),D=new Float32Array(y.count*y.itemSize);if(null!==m)if(Array.isArray(h))for(w=0,S=b.length;w<S;w++)for(C=b[w],R=Math.max(C.start,M.start),P=Math.min(C.start+C.count,M.start+M.count),E=R,T=P;E<T;E+=3)f=m.getX(E),d=m.getX(E+1),p=m.getX(E+2),c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);else for(R=Math.max(0,M.start),P=Math.min(m.count,M.start+M.count),w=R,S=P;w<S;w+=3)f=m.getX(w),d=m.getX(w+1),p=m.getX(w+2),c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);else if(Array.isArray(h))for(w=0,S=b.length;w<S;w++)for(C=b[w],R=Math.max(C.start,M.start),P=Math.min(C.start+C.count,M.start+M.count),E=R,T=P;E<T;E+=3)f=E,d=E+1,p=E+2,c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);else for(R=Math.max(0,M.start),P=Math.min(g.count,M.start+M.count),w=R,S=P;w<S;w+=3)f=w,d=w+1,p=w+2,c(t,g,v,_,f,d,p,L),c(t,y,x,_,f,d,p,D);return{positionAttribute:g,normalAttribute:y,morphedPositionAttribute:new qn(L,3),morphedNormalAttribute:new qn(D,3)}},deepCloneAttribute:function(t){return t.isInstancedInterleavedBufferAttribute||t.isInterleavedBufferAttribute?af(t):t.isInstancedBufferAttribute?(new wo).copy(t):(new Dn).copy(t)},deinterleaveAttribute:af,deinterleaveGeometry:function(t){const e=t.attributes,n=t.morphTargets,r=new Map;for(const t in e){const n=e[t];n.isInterleavedBufferAttribute&&(r.has(n)||r.set(n,af(n)),e[t]=r.get(n))}for(const t in n){const e=n[t];e.isInterleavedBufferAttribute&&(r.has(e)||r.set(e,af(e)),n[t]=r.get(e))}},estimateBytesUsed:function(t){let e=0;for(const n in t.attributes){const r=t.getAttribute(n);e+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}const n=t.getIndex();return e+=n?n.count*n.itemSize*n.array.BYTES_PER_ELEMENT:0,e},interleaveAttributes:function(t){let e,n=0,r=0;for(let i=0,a=t.length;i<a;++i){const a=t[i];if(void 0===e&&(e=a.array.constructor),e!==a.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;n+=a.array.length,r+=a.itemSize}const i=new xo(new e(n),r);let a=0;const o=[],s=["getX","getY","getZ","getW"],A=["setX","setY","setZ","setW"];for(let e=0,n=t.length;e<n;e++){const n=t[e],r=n.itemSize,l=n.count,c=new Mo(i,r,a,n.normalized);o.push(c),a+=r;for(let t=0;t<l;t++)for(let e=0;e<r;e++)c[A[e]](t,n[s[e]](t))}return o},mergeAttributes:rf,mergeGeometries:function(t,e=!1){const n=null!==t[0].index,r=new Set(Object.keys(t[0].attributes)),i=new Set(Object.keys(t[0].morphAttributes)),a={},o={},s=t[0].morphTargetsRelative,A=new Hn;let l=0;for(let c=0;c<t.length;++c){const u=t[c];let h=0;if(n!==(null!==u.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const t in u.attributes){if(!r.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+'. All geometries must have compatible attributes; make sure "'+t+'" attribute exists among all geometries, or in none of them.'),null;void 0===a[t]&&(a[t]=[]),a[t].push(u.attributes[t]),h++}if(h!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". Make sure all geometries have the same number of attributes."),null;if(s!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const t in u.morphAttributes){if(!i.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+".  .morphAttributes must be consistent throughout all geometries."),null;void 0===o[t]&&(o[t]=[]),o[t].push(u.morphAttributes[t])}if(e){let t;if(n)t=u.index.count;else{if(void 0===u.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". The geometry must have either an index or a position attribute"),null;t=u.attributes.position.count}A.addGroup(l,t,c),l+=t}}if(n){let e=0;const n=[];for(let r=0;r<t.length;++r){const i=t[r].index;for(let t=0;t<i.count;++t)n.push(i.getX(t)+e);e+=t[r].attributes.position.count}A.setIndex(n)}for(const t in a){const e=rf(a[t]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;A.setAttribute(t,e)}for(const t in o){const e=o[t][0].length;if(0===e)break;A.morphAttributes=A.morphAttributes||{},A.morphAttributes[t]=[];for(let n=0;n<e;++n){const e=[];for(let r=0;r<o[t].length;++r)e.push(o[t][r][n]);const r=rf(e);if(!r)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;A.morphAttributes[t].push(r)}}return A},mergeGroups:function(t){if(0===t.groups.length)return console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."),t;let e=t.groups;if(e=e.sort(((t,e)=>t.materialIndex!==e.materialIndex?t.materialIndex-e.materialIndex:t.start-e.start)),null===t.getIndex()){const e=t.getAttribute("position"),n=[];for(let t=0;t<e.count;t+=3)n.push(t,t+1,t+2);t.setIndex(n)}const n=t.getIndex(),r=[];for(let t=0;t<e.length;t++){const i=e[t],a=i.start,o=a+i.count;for(let t=a;t<o;t++)r.push(n.getX(t))}t.dispose(),t.setIndex(r);let i=0;for(let t=0;t<e.length;t++){const n=e[t];n.start=i,i+=n.count}let a=e[0];t.groups=[a];for(let n=1;n<e.length;n++){const r=e[n];a.materialIndex===r.materialIndex?a.count+=r.count:(a=r,t.groups.push(a))}return t},mergeVertices:function(t,e=1e-4){e=Math.max(e,Number.EPSILON);const n={},r=t.getIndex(),i=t.getAttribute("position"),a=r?r.count:i.count;let o=0;const s=Object.keys(t.attributes),A={},l={},c=[],u=["getX","getY","getZ","getW"],h=["setX","setY","setZ","setW"];for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.attributes[n];A[n]=new Dn(new r.array.constructor(r.count*r.itemSize),r.itemSize,r.normalized);const i=t.morphAttributes[n];i&&(l[n]=new Dn(new i.array.constructor(i.count*i.itemSize),i.itemSize,i.normalized))}const f=.5*e,d=Math.log10(1/e),p=Math.pow(10,d),m=f*p;for(let e=0;e<a;e++){const i=r?r.getX(e):e;let a="";for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.getAttribute(n),o=r.itemSize;for(let t=0;t<o;t++)a+=~~(r[u[t]](i)*p+m)+","}if(a in n)c.push(n[a]);else{for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.getAttribute(n),a=t.morphAttributes[n],c=r.itemSize,f=A[n],d=l[n];for(let t=0;t<c;t++){const e=u[t],n=h[t];if(f[n](o,r[e](i)),a)for(let t=0,r=a.length;t<r;t++)d[t][n](o,a[t][e](i))}}n[a]=o,c.push(o),o++}}const g=t.clone();for(const e in t.attributes){const t=A[e];if(g.setAttribute(e,new Dn(t.array.slice(0,o*t.itemSize),t.itemSize,t.normalized)),e in l)for(let t=0;t<l[e].length;t++){const n=l[e][t];g.morphAttributes[e][t]=new Dn(n.array.slice(0,o*n.itemSize),n.itemSize,n.normalized)}}return g.setIndex(c),g},toCreasedNormals:function(t,e=Math.PI/3){const n=Math.cos(e),r=100*(1+1e-10),i=[new ae,new ae,new ae],a=new ae,o=new ae,s=new ae,A=new ae;function l(t){return`${~~(t.x*r)},${~~(t.y*r)},${~~(t.z*r)}`}const c=t.index?t.toNonIndexed():t,u=c.attributes.position,h={};for(let t=0,e=u.count/3;t<e;t++){const e=3*t,n=i[0].fromBufferAttribute(u,e+0),r=i[1].fromBufferAttribute(u,e+1),s=i[2].fromBufferAttribute(u,e+2);a.subVectors(s,r),o.subVectors(n,r);const A=(new ae).crossVectors(a,o).normalize();for(let t=0;t<3;t++){const e=l(i[t]);e in h||(h[e]=[]),h[e].push(A)}}const f=new Float32Array(3*u.count),d=new Dn(f,3,!1);for(let t=0,e=u.count/3;t<e;t++){const e=3*t,r=i[0].fromBufferAttribute(u,e+0),c=i[1].fromBufferAttribute(u,e+1),f=i[2].fromBufferAttribute(u,e+2);a.subVectors(f,c),o.subVectors(r,c),s.crossVectors(a,o).normalize();for(let t=0;t<3;t++){const r=h[l(i[t])];A.set(0,0,0);for(let t=0,e=r.length;t<e;t++){const e=r[t];s.dot(e)>n&&A.add(e)}A.normalize(),d.setXYZ(e+t,A.x,A.y,A.z)}}return c.setAttribute("normal",d),c},toTrianglesDrawMode:function(t,e){if(0===e)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(2===e||1===e){let n=t.getIndex();if(null===n){const e=[],r=t.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t<r.count;t++)e.push(t);t.setIndex(e),n=t.getIndex()}const r=n.count-2,i=[];if(2===e)for(let t=1;t<=r;t++)i.push(n.getX(0)),i.push(n.getX(t)),i.push(n.getX(t+1));else for(let t=0;t<r;t++)t%2==0?(i.push(n.getX(t)),i.push(n.getX(t+1)),i.push(n.getX(t+2))):(i.push(n.getX(t+2)),i.push(n.getX(t+1)),i.push(n.getX(t)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=t.clone();return a.setIndex(i),a.clearGroups(),a}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t}}),sf=function(t){return"function"==typeof t?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}};function Af(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function lf(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function cf(){}var uf=.7,hf=1/uf,ff="\\s*([+-]?\\d+)\\s*",df="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mf=/^#([0-9a-f]{3,8})$/,gf=new RegExp(`^rgb\\(${ff},${ff},${ff}\\)$`),vf=new RegExp(`^rgb\\(${pf},${pf},${pf}\\)$`),_f=new RegExp(`^rgba\\(${ff},${ff},${ff},${df}\\)$`),yf=new RegExp(`^rgba\\(${pf},${pf},${pf},${df}\\)$`),xf=new RegExp(`^hsl\\(${df},${pf},${pf}\\)$`),bf=new RegExp(`^hsla\\(${df},${pf},${pf},${df}\\)$`),Mf={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 wf(){return this.rgb().formatHex()}function Ef(){return this.rgb().formatRgb()}function Sf(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=mf.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Tf(e):3===n?new Pf(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Cf(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Cf(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=gf.exec(t))?new Pf(e[1],e[2],e[3],1):(e=vf.exec(t))?new Pf(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=_f.exec(t))?Cf(e[1],e[2],e[3],e[4]):(e=yf.exec(t))?Cf(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=xf.exec(t))?Uf(e[1],e[2]/100,e[3]/100,1):(e=bf.exec(t))?Uf(e[1],e[2]/100,e[3]/100,e[4]):Mf.hasOwnProperty(t)?Tf(Mf[t]):"transparent"===t?new Pf(NaN,NaN,NaN,0):null}function Tf(t){return new Pf(t>>16&255,t>>8&255,255&t,1)}function Cf(t,e,n,r){return r<=0&&(t=e=n=NaN),new Pf(t,e,n,r)}function Rf(t,e,n,r){return 1===arguments.length?((i=t)instanceof cf||(i=Sf(i)),i?new Pf((i=i.rgb()).r,i.g,i.b,i.opacity):new Pf):new Pf(t,e,n,null==r?1:r);var i}function Pf(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Lf(){return`#${qf(this.r)}${qf(this.g)}${qf(this.b)}`}function Df(){const t=Of(this.opacity);return`${1===t?"rgb(":"rgba("}${If(this.r)}, ${If(this.g)}, ${If(this.b)}${1===t?")":`, ${t})`}`}function Of(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function If(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function qf(t){return((t=If(t))<16?"0":"")+t.toString(16)}function Uf(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Bf(t,e,n,r)}function Nf(t){if(t instanceof Bf)return new Bf(t.h,t.s,t.l,t.opacity);if(t instanceof cf||(t=Sf(t)),!t)return new Bf;if(t instanceof Bf)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,A=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=A<.5?a+i:2-a-i,o*=60):s=A>0&&A<1?0:o,new Bf(o,s,A,t.opacity)}function Bf(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function kf(t){return(t=(t||0)%360)<0?t+360:t}function Ff(t){return Math.max(0,Math.min(1,t||0))}function zf(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Gf(t){return Gf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(t)}Af(cf,Sf,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:wf,formatHex:wf,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Nf(this).formatHsl()},formatRgb:Ef,toString:Ef}),Af(Pf,Rf,lf(cf,{brighter(t){return t=null==t?hf:Math.pow(hf,t),new Pf(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?uf:Math.pow(uf,t),new Pf(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Pf(If(this.r),If(this.g),If(this.b),Of(this.opacity))},displayable(){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:Lf,formatHex:Lf,formatHex8:function(){return`#${qf(this.r)}${qf(this.g)}${qf(this.b)}${qf(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Df,toString:Df})),Af(Bf,(function(t,e,n,r){return 1===arguments.length?Nf(t):new Bf(t,e,n,null==r?1:r)}),lf(cf,{brighter(t){return t=null==t?hf:Math.pow(hf,t),new Bf(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?uf:Math.pow(uf,t),new Bf(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Pf(zf(t>=240?t-240:t+120,i,r),zf(t,i,r),zf(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Bf(kf(this.h),Ff(this.s),Ff(this.l),Of(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Of(this.opacity);return`${1===t?"hsl(":"hsla("}${kf(this.h)}, ${100*Ff(this.s)}%, ${100*Ff(this.l)}%${1===t?")":`, ${t})`}`}}));var Hf=/^\s+/,jf=/\s+$/;function Vf(t,e){if(e=e||{},(t=t||"")instanceof Vf)return t;if(!(this instanceof Vf))return new Vf(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;"string"==typeof t&&(t=function(t){t=t.replace(Hf,"").replace(jf,"").toLowerCase();var e,n=!1;if(Ad[t])t=Ad[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=xd.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=xd.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=xd.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=xd.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=xd.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=xd.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=xd.hex8.exec(t))return{r:fd(e[1]),g:fd(e[2]),b:fd(e[3]),a:gd(e[4]),format:n?"name":"hex8"};if(e=xd.hex6.exec(t))return{r:fd(e[1]),g:fd(e[2]),b:fd(e[3]),format:n?"name":"hex"};if(e=xd.hex4.exec(t))return{r:fd(e[1]+""+e[1]),g:fd(e[2]+""+e[2]),b:fd(e[3]+""+e[3]),a:gd(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=xd.hex3.exec(t))return{r:fd(e[1]+""+e[1]),g:fd(e[2]+""+e[2]),b:fd(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==Gf(t)&&(bd(t.r)&&bd(t.g)&&bd(t.b)?(A=t.r,l=t.g,c=t.b,e={r:255*ud(A,255),g:255*ud(l,255),b:255*ud(c,255)},o=!0,s="%"===String(t.r).substr(-1)?"prgb":"rgb"):bd(t.h)&&bd(t.s)&&bd(t.v)?(r=pd(t.s),i=pd(t.v),e=function(t,e,n){t=6*ud(t,360),e=ud(e,100),n=ud(n,100);var r=Math.floor(t),i=t-r,a=n*(1-e),o=n*(1-i*e),s=n*(1-(1-i)*e),A=r%6,l=[n,o,a,a,s,n][A],c=[s,n,n,o,a,a][A],u=[a,a,s,n,n,o][A];return{r:255*l,g:255*c,b:255*u}}(t.h,r,i),o=!0,s="hsv"):bd(t.h)&&bd(t.s)&&bd(t.l)&&(r=pd(t.s),a=pd(t.l),e=function(t,e,n){var r,i,a;function o(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=ud(t,360),e=ud(e,100),n=ud(n,100),0===e)r=i=a=n;else{var s=n<.5?n*(1+e):n+e-n*e,A=2*n-s;r=o(A,s,t+1/3),i=o(A,s,t),a=o(A,s,t-1/3)}return{r:255*r,g:255*i,b:255*a}}(t.h,r,a),o=!0,s="hsl"),t.hasOwnProperty("a")&&(n=t.a));var A,l,c;return n=cd(n),{ok:o,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Wf(t,e,n){t=ud(t,255),e=ud(e,255),n=ud(n,255);var r,i,a=Math.max(t,e,n),o=Math.min(t,e,n),s=(a+o)/2;if(a==o)r=i=0;else{var A=a-o;switch(i=s>.5?A/(2-a-o):A/(a+o),a){case t:r=(e-n)/A+(e<n?6:0);break;case e:r=(n-t)/A+2;break;case n:r=(t-e)/A+4}r/=6}return{h:r,s:i,l:s}}function Xf(t,e,n){t=ud(t,255),e=ud(e,255),n=ud(n,255);var r,i,a=Math.max(t,e,n),o=Math.min(t,e,n),s=a,A=a-o;if(i=0===a?0:A/a,a==o)r=0;else{switch(a){case t:r=(e-n)/A+(e<n?6:0);break;case e:r=(n-t)/A+2;break;case n:r=(t-e)/A+4}r/=6}return{h:r,s:i,v:s}}function Qf(t,e,n,r){var i=[dd(Math.round(t).toString(16)),dd(Math.round(e).toString(16)),dd(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Yf(t,e,n,r){return[dd(md(r)),dd(Math.round(t).toString(16)),dd(Math.round(e).toString(16)),dd(Math.round(n).toString(16))].join("")}function Zf(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.s-=e/100,n.s=hd(n.s),Vf(n)}function Kf(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.s+=e/100,n.s=hd(n.s),Vf(n)}function Jf(t){return Vf(t).desaturate(100)}function $f(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.l+=e/100,n.l=hd(n.l),Vf(n)}function td(t,e){e=0===e?0:e||10;var n=Vf(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),Vf(n)}function ed(t,e){e=0===e?0:e||10;var n=Vf(t).toHsl();return n.l-=e/100,n.l=hd(n.l),Vf(n)}function nd(t,e){var n=Vf(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,Vf(n)}function rd(t){var e=Vf(t).toHsl();return e.h=(e.h+180)%360,Vf(e)}function id(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Vf(t).toHsl(),r=[Vf(t)],i=360/e,a=1;a<e;a++)r.push(Vf({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function ad(t){var e=Vf(t).toHsl(),n=e.h;return[Vf(t),Vf({h:(n+72)%360,s:e.s,l:e.l}),Vf({h:(n+216)%360,s:e.s,l:e.l})]}function od(t,e,n){e=e||6,n=n||30;var r=Vf(t).toHsl(),i=360/n,a=[Vf(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,a.push(Vf(r));return a}function sd(t,e){e=e||6;for(var n=Vf(t).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/e;e--;)o.push(Vf({h:r,s:i,v:a})),a=(a+s)%1;return o}Vf.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=cd(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=Xf(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=Xf(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=Wf(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Wf(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return Qf(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var a=[dd(Math.round(t).toString(16)),dd(Math.round(e).toString(16)),dd(Math.round(n).toString(16)),dd(md(r))];if(i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*ud(this._r,255))+"%",g:Math.round(100*ud(this._g,255))+"%",b:Math.round(100*ud(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*ud(this._r,255))+"%, "+Math.round(100*ud(this._g,255))+"%, "+Math.round(100*ud(this._b,255))+"%)":"rgba("+Math.round(100*ud(this._r,255))+"%, "+Math.round(100*ud(this._g,255))+"%, "+Math.round(100*ud(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(ld[Qf(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+Yf(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=Vf(t);n="#"+Yf(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Vf(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification($f,arguments)},brighten:function(){return this._applyModification(td,arguments)},darken:function(){return this._applyModification(ed,arguments)},desaturate:function(){return this._applyModification(Zf,arguments)},saturate:function(){return this._applyModification(Kf,arguments)},greyscale:function(){return this._applyModification(Jf,arguments)},spin:function(){return this._applyModification(nd,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(od,arguments)},complement:function(){return this._applyCombination(rd,arguments)},monochromatic:function(){return this._applyCombination(sd,arguments)},splitcomplement:function(){return this._applyCombination(ad,arguments)},triad:function(){return this._applyCombination(id,[3])},tetrad:function(){return this._applyCombination(id,[4])}},Vf.fromRatio=function(t,e){if("object"==Gf(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:pd(t[r]));t=n}return Vf(t,e)},Vf.equals=function(t,e){return!(!t||!e)&&Vf(t).toRgbString()==Vf(e).toRgbString()},Vf.random=function(){return Vf.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Vf.mix=function(t,e,n){n=0===n?0:n||50;var r=Vf(t).toRgb(),i=Vf(e).toRgb(),a=n/100;return Vf({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},
    33// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
    44// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
    5 Vf.readability=function(t,e){var n=Vf(t),r=Vf(e);return (Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Vf.isReadable=function(t,e,n){var r,i,a=Vf.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return {level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7;}return i},Vf.mostReadable=function(t,e,n){var r,i,a,o,s=null,A=0;i=(n=n||{}).includeFallbackColors,a=n.level,o=n.size;for(var l=0;l<e.length;l++)(r=Vf.readability(t,e[l]))>A&&(A=r,s=Vf(e[l]));return Vf.isReadable(t,s,{level:a,size:o})||!i?s:(n.includeFallbackColors=!1,Vf.mostReadable(t,["#fff","#000"],n))};var Ad=Vf.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ld=Vf.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(Ad);function cd(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ud(t,e){(function(t){return "string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return "string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function hd(t){return Math.min(1,Math.max(0,t))}function fd(t){return parseInt(t,16)}function dd(t){return 1==t.length?"0"+t:""+t}function pd(t){return t<=1&&(t=100*t+"%"),t}function md(t){return Math.round(255*parseFloat(t)).toString(16)}function gd(t){return fd(t)/255}var vd,_d,yd,xd=(_d="[\\s|\\(]+("+(vd="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+vd+")[,|\\s]+("+vd+")\\s*\\)?",yd="[\\s|\\(]+("+vd+")[,|\\s]+("+vd+")[,|\\s]+("+vd+")[,|\\s]+("+vd+")\\s*\\)?",{CSS_UNIT:new RegExp(vd),rgb:new RegExp("rgb"+_d),rgba:new RegExp("rgba"+yd),hsl:new RegExp("hsl"+_d),hsla:new RegExp("hsla"+yd),hsv:new RegExp("hsv"+_d),hsva:new RegExp("hsva"+yd),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function bd(t){return !!xd.CSS_UNIT.exec(t)}function Md(t,e){if(null==t)return {};var n,r,i=function(t,e){if(null==t)return {};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n]);}return i}function wd(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1;}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t;}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Sd(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ed(t){return function(t){if(Array.isArray(t))return Td(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Sd(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sd(t,e){if(t){if("string"==typeof t)return Td(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return "Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Td(t,e):void 0}}function Td(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Cd(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:String(e)}var Rd=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(e instanceof Array?e.length?e:[void 0]:[e]).map((function(t){return {keyAccessor:t,isProp:!(t instanceof Function)}})),a=t.reduce((function(t,e){var r=t,a=e;return i.forEach((function(t,e){var o,s=t.keyAccessor;if(t.isProp){var A=a,l=A[s],c=Md(A,[s].map(Cd));o=l,a=c;}else o=s(a,e);e+1<i.length?(r.hasOwnProperty(o)||(r[o]={}),r=r[o]):n?(r.hasOwnProperty(o)||(r[o]=[]),r[o].push(a)):r[o]=a;})),t}),{});n instanceof Function&&function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;r===i.length?Object.keys(e).forEach((function(t){return e[t]=n(e[t])})):Object.values(e).forEach((function(e){return t(e,r+1)}));}(a);var o=a;return r&&(o=[],function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.length===i.length?o.push({keys:n,vals:e}):Object.entries(e).forEach((function(e){var r=wd(e,2),i=r[0],a=r[1];return t(a,[].concat(Ed(n),[i]))}));}(a),e instanceof Array&&0===e.length&&1===o.length&&(o[0].keys=[])),o};function Pd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r);}return n}function Ld(t,e,n){return (e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dd(t,e){if(null==t)return {};var n,r,i=function(t,e){if(null==t)return {};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n]);}return i}function Od(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1;}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t;}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||qd(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Id(t){return function(t){if(Array.isArray(t))return Ud(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||qd(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qd(t,e){if(t){if("string"==typeof t)return Ud(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return "Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ud(t,e):void 0}}function Ud(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Nd=["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"];function Bd(t,e,n){var r=n.objBindAttr,i=void 0===r?"__obj":r,a=n.dataBindAttr,o=void 0===a?"__data":a,s=n.idAccessor,A=n.purge,l=void 0!==A&&A,c=function(t){return t.hasOwnProperty(o)},u=e.filter((function(t){return !c(t)})),h=e.filter(c).map((function(t){return t[o]})),f=l?{enter:t,exit:h,update:[]}:function(t,e,n){var r={enter:[],update:[],exit:[]};if(n){var i=Rd(t,n,!1),a=Rd(e,n,!1),o=Object.assign({},i,a);Object.entries(o).forEach((function(t){var e=Od(t,2),n=e[0],o=e[1],s=i.hasOwnProperty(n)?a.hasOwnProperty(n)?"update":"exit":"enter";r[s].push("update"===s?[i[n],a[n]]:o);}));}else {var s=new Set(t),A=new Set(e);new Set([].concat(Id(s),Id(A))).forEach((function(t){var e=s.has(t)?A.has(t)?"update":"exit":"enter";r[e].push("update"===e?[t,t]:t);}));}return r}(h,t,s);return f.update=f.update.map((function(t){var e=Od(t,2),n=e[0],r=e[1];return n!==r&&(r[i]=n[i],r[i][o]=r),r})),f.exit=f.exit.concat(u.map((function(t){return Ld({},i,t)}))),f}function kd(t,e,n,r,i){var a=i.createObj,o=void 0===a?function(t){return {}}:a,s=i.updateObj,A=void 0===s?function(t,e){}:s,l=i.exitObj,c=void 0===l?function(t){}:l,u=i.objBindAttr,h=void 0===u?"__obj":u,f=i.dataBindAttr,d=void 0===f?"__data":f,p=Dd(i,Nd),m=Bd(t,e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pd(Object(n),!0).forEach((function(e){Ld(t,e,n[e]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e));}));}return t}({objBindAttr:h,dataBindAttr:d},p)),g=m.enter,v=m.update;m.exit.forEach((function(t){var e=t[h];delete t[h],c(e),r(e);}));var _=function(t){var e=[];return t.forEach((function(t){var n=o(t);n&&(n[d]=t,t[h]=n,e.push(n));})),e}(g);!function(t){t.forEach((function(t){var e=t[h];e&&(e[d]=t,A(e,t));}));}([].concat(Id(g),Id(v))),_.forEach(n);}var Fd={exports:{}};!function(t,e){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var r=n(1),i=function(){function t(t,e,n){void 0===t&&(t=NaN),void 0===e&&(e=NaN),void 0===n&&(n=!1),this._minFPS=e,this._maxFPS=t,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new r.default,this._onPause=new r.default,this._onTick=new r.default,this._onTickOncePerFrame=new r.default,n||this.resume();}return t.prototype.updateOnce=function(t){t(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick);},t.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateOnce());},t.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle));},t.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll();},Object.defineProperty(t.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timeScale",{get:function(){return this._timeScale},set:function(t){this._timeScale!==t&&(this._timeScale=t);},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),t.prototype.animateOnce=function(){var t=this;this._animationFrameHandle=window.requestAnimationFrame((function(){return t.onFrame()}));},t.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce();},t.prototype.update=function(t,e){void 0===e&&(e=!0),this._currentTick++,this._currentTime+=t,this._tickDeltaTime=t,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),e&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick);},t.prototype.getTimer=function(){return Date.now()},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;},function(t,e,n){!function(e,n){t.exports=n();}(0,(function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){var n=function(){function t(){this.functions=[];}return t.prototype.add=function(t){return -1===this.functions.indexOf(t)&&(this.functions.push(t),!0)},t.prototype.remove=function(t){var e=this.functions.indexOf(t);return e>-1&&(this.functions.splice(e,1),!0)},t.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},t.prototype.dispatch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.functions.concat().forEach((function(e){e.apply(void 0,t);}));},Object.defineProperty(t.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;}])}));}]);}(Fd);var zd=el(Fd.exports);function Gd(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);}return this}var Hd=t=>()=>t;function jd(t){return 1==(t=+t)?Vd:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Hd(isNaN(e)?n:e)}}function Vd(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Hd(isNaN(t)?e:t)}var Wd=function t(e){var n=jd(e);function r(t,e){var r=n((t=Rf(t)).r,(e=Rf(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=Vd(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function Xd(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(n=0;n<r;++n)i[n]=t[n]*(1-a)+e[n]*a;return i}}function Qd(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Yd(t,e){return (Qd(e)?Xd:Zd)(t,e)}function Zd(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),o=new Array(r);for(n=0;n<i;++n)a[n]=rp(t[n],e[n]);for(;n<r;++n)o[n]=e[n];return function(t){for(n=0;n<i;++n)o[n]=a[n](t);return o}}function Kd(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Jd(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function $d(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=rp(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var tp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ep=new RegExp(tp.source,"g");function np(t,e){var n,r,i,a=tp.lastIndex=ep.lastIndex=0,o=-1,s=[],A=[];for(t+="",e+="";(n=tp.exec(t))&&(r=ep.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,A.push({i:o,x:Jd(n,r)})),a=ep.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?A[0]?function(t){return function(e){return t(e)+""}}(A[0].x):function(t){return function(){return t}}(e):(e=A.length,function(t){for(var n,r=0;r<e;++r)s[(n=A[r]).i]=n.x(t);return s.join("")})}function rp(t,e){var n,r=typeof e;return null==e||"boolean"===r?Hd(e):("number"===r?Jd:"string"===r?(n=Sf(e))?(e=n,Wd):np:e instanceof Sf?Wd:e instanceof Date?Kd:Qd(e)?Xd:Array.isArray(e)?Zd:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?$d:Jd)(t,e)}function ip(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function ap(t){return +t}var op=[0,1];function sp(t){return t}function Ap(t,e){return (e-=t=+t)?function(n){return (n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n;}function lp(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=Ap(i,r),a=n(o,a)):(r=Ap(r,i),a=n(a,o)),function(t){return a(r(t))}}function cp(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=Ap(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(e){var n=Il(t,e,1,r)-1;return a[n](i[n](e))}}function up(){var t,e,n,r,i,a,o=op,s=op,A=rp,l=sp;function c(){var t=Math.min(o.length,s.length);return l!==sp&&(l=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(o[0],o[t-1])),r=t>2?cp:lp,i=a=null,u}function u(e){return null==e||isNaN(e=+e)?n:(i||(i=r(o.map(t),s,A)))(t(l(e)))}return u.invert=function(n){return l(e((a||(a=r(s,o.map(t),Jd)))(n)))},u.domain=function(t){return arguments.length?(o=Array.from(t,ap),c()):o.slice()},u.range=function(t){return arguments.length?(s=Array.from(t),c()):s.slice()},u.rangeRound=function(t){return s=Array.from(t),A=ip,c()},u.clamp=function(t){return arguments.length?(l=!!t||sp,c()):l!==sp},u.interpolate=function(t){return arguments.length?(A=t,c()):A},u.unknown=function(t){return arguments.length?(n=t,u):n},function(n,r){return t=n,e=r,c()}}function hp(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return [r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function fp(t){return (t=hp(Math.abs(t)))?t[1]:NaN}var dp,pp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mp(t){if(!(e=pp.exec(t)))throw new Error("invalid format: "+t);var e;return new gp({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 gp(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 vp(t,e){var n=hp(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}mp.prototype=gp.prototype,gp.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 _p={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>vp(100*t,e),r:vp,s:function(t,e){var n=hp(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(dp=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+hp(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function yp(t){return t}var xp,bp,Mp,wp=Array.prototype.map,Ep=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Sp(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?yp:(e=wp.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],A=0;i>0&&s>0&&(A+s+1>r&&(s=Math.max(1,r-A)),a.push(t.substring(i-=s,i+s)),!((A+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?yp:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(wp.call(t.numerals,String)),A=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function u(t){var e=(t=mp(t)).fill,n=t.align,u=t.sign,h=t.symbol,f=t.zero,d=t.width,p=t.comma,m=t.precision,g=t.trim,v=t.type;"n"===v?(p=!0,v="g"):_p[v]||(void 0===m&&(m=12),g=!0,v="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var _="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",y="$"===h?a:/[%p]/.test(v)?A:"",x=_p[v],b=/[defgprs%]/.test(v);function M(t){var i,a,A,h=_,M=y;if("c"===v)M=x(t)+M,t="";else {var w=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:x(Math.abs(t),m),g&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0);}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),w&&0==+t&&"+"!==u&&(w=!1),h=(w?"("===u?u:l:"-"===u||"("===u?"":u)+h,M=("s"===v?Ep[8+dp/3]:"")+M+(w&&"("===u?")":""),b)for(i=-1,a=t.length;++i<a;)if(48>(A=t.charCodeAt(i))||A>57){M=(46===A?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}p&&!f&&(t=r(t,1/0));var E=h.length+t.length+M.length,S=E<d?new Array(d-E+1).join(e):"";switch(p&&f&&(t=r(S+t,S.length?d-M.length:1/0),S=""),n){case"<":t=h+t+M+S;break;case"=":t=h+S+t+M;break;case"^":t=S.slice(0,E=S.length>>1)+h+t+M+S.slice(E);break;default:t=S+h+t+M;}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),M.toString=function(){return t+""},M}return {format:u,formatPrefix:function(t,e){var n=u(((t=mp(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(fp(e)/3))),i=Math.pow(10,-r),a=Ep[8+r/3];return function(t){return n(i*t)+a}}}}function Tp(t,e,n,r){var i,a=function(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?zl(e,t,n):zl(t,e,n);return (r?-1:1)*(i<0?1/-i:i)}(t,e,n);switch((r=mp(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(fp(e)/3)))-fp(Math.abs(t)))}(a,o))||(r.precision=i),Mp(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,fp(e)-fp(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-fp(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type));}return bp(r)}function Cp(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return [];if((t=+t)==(e=+e))return [t];const r=e<t,[i,a,o]=r?Fl(e,t,n):Fl(t,e,n);if(!(a>=i))return [];const s=a-i+1,A=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)A[t]=(a-t)/-o;else for(let t=0;t<s;++t)A[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)A[t]=(i+t)/-o;else for(let t=0;t<s;++t)A[t]=(i+t)*o;return A}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Tp(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,a=e(),o=0,s=a.length-1,A=a[o],l=a[s],c=10;for(l<A&&(i=A,A=l,l=i,i=o,o=s,s=i);c-- >0;){if((i=zl(A,l,n))===r)return a[o]=A,a[s]=l,e(a);if(i>0)A=Math.floor(A/i)*i,l=Math.ceil(l/i)*i;else {if(!(i<0))break;A=Math.ceil(A*i)/i,l=Math.floor(l*i)/i;}r=i;}return t},t}function Rp(){var t=up()(sp,sp);return t.copy=function(){return e=t,Rp().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e;},Gd.apply(t,arguments),Cp(t)}xp=Sp({thousands:",",grouping:[3],currency:["$",""]}),bp=xp.format,Mp=xp.formatPrefix;const Pp=134217729,Lp=33306690738754706e-32;function Dp(t,e,n,r,i){let a,o,s,A,l=e[0],c=r[0],u=0,h=0;c>l==c>-l?(a=l,l=e[++u]):(a=c,c=r[++h]);let f=0;if(u<t&&h<n)for(c>l==c>-l?(o=l+a,s=a-(o-l),l=e[++u]):(o=c+a,s=a-(o-c),c=r[++h]),a=o,0!==s&&(i[f++]=s);u<t&&h<n;)c>l==c>-l?(o=a+l,A=o-a,s=a-(o-A)+(l-A),l=e[++u]):(o=a+c,A=o-a,s=a-(o-A)+(c-A),c=r[++h]),a=o,0!==s&&(i[f++]=s);for(;u<t;)o=a+l,A=o-a,s=a-(o-A)+(l-A),l=e[++u],a=o,0!==s&&(i[f++]=s);for(;h<n;)o=a+c,A=o-a,s=a-(o-A)+(c-A),c=r[++h],a=o,0!==s&&(i[f++]=s);return 0===a&&0!==f||(i[f++]=a),f}function Op(t){return new Float64Array(t)}const Ip=22204460492503146e-32,qp=11093356479670487e-47,Up=Op(4),Np=Op(8),Bp=Op(12),kp=Op(16),Fp=Op(4);function zp(t,e,n,r,i,a){const o=(e-a)*(n-i),s=(t-i)*(r-a),A=o-s,l=Math.abs(o+s);return Math.abs(A)>=33306690738754716e-32*l?A:-function(t,e,n,r,i,a,o){let s,A,l,c,u,h,f,d,p,m,g,v,_,y,x,b,M,w;const E=t-i,S=n-i,T=e-a,C=r-a;y=E*C,h=Pp*E,f=h-(h-E),d=E-f,h=Pp*C,p=h-(h-C),m=C-p,x=d*m-(y-f*p-d*p-f*m),b=T*S,h=Pp*T,f=h-(h-T),d=T-f,h=Pp*S,p=h-(h-S),m=S-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Up[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Up[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Up[2]=v-(w-u)+(g-u),Up[3]=w;let R=function(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}(4,Up),P=Ip*o;if(R>=P||-R>=P)return R;if(u=t-E,s=t-(E+u)+(u-i),u=n-S,l=n-(S+u)+(u-i),u=e-T,A=e-(T+u)+(u-a),u=r-C,c=r-(C+u)+(u-a),0===s&&0===A&&0===l&&0===c)return R;if(P=qp*o+Lp*Math.abs(R),R+=E*c+C*s-(T*l+S*A),R>=P||-R>=P)return R;y=s*C,h=Pp*s,f=h-(h-s),d=s-f,h=Pp*C,p=h-(h-C),m=C-p,x=d*m-(y-f*p-d*p-f*m),b=A*S,h=Pp*A,f=h-(h-A),d=A-f,h=Pp*S,p=h-(h-S),m=S-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Fp[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Fp[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Fp[2]=v-(w-u)+(g-u),Fp[3]=w;const L=Dp(4,Up,4,Fp,Np);y=E*c,h=Pp*E,f=h-(h-E),d=E-f,h=Pp*c,p=h-(h-c),m=c-p,x=d*m-(y-f*p-d*p-f*m),b=T*l,h=Pp*T,f=h-(h-T),d=T-f,h=Pp*l,p=h-(h-l),m=l-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Fp[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Fp[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Fp[2]=v-(w-u)+(g-u),Fp[3]=w;const D=Dp(L,Np,4,Fp,Bp);y=s*c,h=Pp*s,f=h-(h-s),d=s-f,h=Pp*c,p=h-(h-c),m=c-p,x=d*m-(y-f*p-d*p-f*m),b=A*l,h=Pp*A,f=h-(h-A),d=A-f,h=Pp*l,p=h-(h-l),m=l-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Fp[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Fp[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Fp[2]=v-(w-u)+(g-u),Fp[3]=w;const O=Dp(D,Bp,4,Fp,kp);return kp[O-1]}(t,e,n,r,i,a,l)}const Gp=Math.pow(2,-52),Hp=new Uint32Array(512);class jp{static from(t,e=Zp,n=Kp){const r=t.length,i=new Float64Array(2*r);for(let a=0;a<r;a++){const r=t[a];i[2*a]=e(r),i[2*a+1]=n(r);}return new jp(i)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update();}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,a=t.length>>1;let o=1/0,s=1/0,A=-1/0,l=-1/0;for(let e=0;e<a;e++){const n=t[2*e],r=t[2*e+1];n<o&&(o=n),r<s&&(s=r),n>A&&(A=n),r>l&&(l=r),this._ids[e]=e;}const c=(o+A)/2,u=(s+l)/2;let h,f,d;for(let e=0,n=1/0;e<a;e++){const r=Vp(c,u,t[2*e],t[2*e+1]);r<n&&(h=e,n=r);}const p=t[2*h],m=t[2*h+1];for(let e=0,n=1/0;e<a;e++){if(e===h)continue;const r=Vp(p,m,t[2*e],t[2*e+1]);r<n&&r>0&&(f=e,n=r);}let g=t[2*f],v=t[2*f+1],_=1/0;for(let e=0;e<a;e++){if(e===h||e===f)continue;const n=Xp(p,m,g,v,t[2*e],t[2*e+1]);n<_&&(d=e,_=n);}let y=t[2*d],x=t[2*d+1];if(_===1/0){for(let e=0;e<a;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];Qp(this._ids,this._dists,0,a-1);const e=new Uint32Array(a);let n=0;for(let t=0,r=-1/0;t<a;t++){const i=this._ids[t],a=this._dists[i];a>r&&(e[n++]=i,r=a);}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(zp(p,m,g,v,y,x)<0){const t=f,e=g,n=v;f=d,g=y,v=x,d=t,y=e,x=n;}const b=function(t,e,n,r,i,a){const o=n-t,s=r-e,A=i-t,l=a-e,c=o*o+s*s,u=A*A+l*l,h=.5/(o*l-s*A);return {x:t+(l*c-s*u)*h,y:e+(o*u-A*c)*h}}(p,m,g,v,y,x);this._cx=b.x,this._cy=b.y;for(let e=0;e<a;e++)this._dists[e]=Vp(t[2*e],t[2*e+1],b.x,b.y);Qp(this._ids,this._dists,0,a-1),this._hullStart=h;let M=3;n[h]=e[d]=f,n[f]=e[h]=d,n[d]=e[f]=h,r[h]=0,r[f]=1,r[d]=2,i.fill(-1),i[this._hashKey(p,m)]=h,i[this._hashKey(g,v)]=f,i[this._hashKey(y,x)]=d,this.trianglesLen=0,this._addTriangle(h,f,d,-1,-1,-1);for(let a,o,s=0;s<this._ids.length;s++){const A=this._ids[s],l=t[2*A],c=t[2*A+1];if(s>0&&Math.abs(l-a)<=Gp&&Math.abs(c-o)<=Gp)continue;if(a=l,o=c,A===h||A===f||A===d)continue;let u=0;for(let t=0,e=this._hashKey(l,c);t<this._hashSize&&(u=i[(e+t)%this._hashSize],-1===u||u===n[u]);t++);u=e[u];let p,m=u;for(;p=n[m],zp(l,c,t[2*m],t[2*m+1],t[2*p],t[2*p+1])>=0;)if(m=p,m===u){m=-1;break}if(-1===m)continue;let g=this._addTriangle(m,A,n[m],-1,-1,r[m]);r[A]=this._legalize(g+2),r[m]=g,M++;let v=n[m];for(;p=n[v],zp(l,c,t[2*v],t[2*v+1],t[2*p],t[2*p+1])<0;)g=this._addTriangle(v,A,p,r[A],-1,r[v]),r[A]=this._legalize(g+2),n[v]=v,M--,v=p;if(m===u)for(;p=e[m],zp(l,c,t[2*p],t[2*p+1],t[2*m],t[2*m+1])<0;)g=this._addTriangle(p,A,m,-1,r[m],r[p]),this._legalize(g+2),r[p]=g,n[m]=m,M--,m=p;this._hullStart=e[A]=m,n[m]=e[v]=A,n[A]=v,i[this._hashKey(l,c)]=A,i[this._hashKey(t[2*m],t[2*m+1])]=m;}this.hull=new Uint32Array(M);for(let t=0,e=this._hullStart;t<M;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen);}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return (e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,a=0;for(;;){const o=n[t],s=t-t%3;if(a=s+(t+2)%3,-1===o){if(0===i)break;t=Hp[--i];continue}const A=o-o%3,l=s+(t+1)%3,c=A+(o+2)%3,u=e[a],h=e[t],f=e[l],d=e[c];if(Wp(r[2*u],r[2*u+1],r[2*h],r[2*h+1],r[2*f],r[2*f+1],r[2*d],r[2*d+1])){e[t]=d,e[o]=u;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e];}while(e!==this._hullStart)}this._link(t,r),this._link(o,n[a]),this._link(a,c);const s=A+(o+1)%3;i<Hp.length&&(Hp[i++]=s);}else {if(0===i)break;t=Hp[--i];}}return a}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t);}_addTriangle(t,e,n,r,i,a){const o=this.trianglesLen;return this._triangles[o]=t,this._triangles[o+1]=e,this._triangles[o+2]=n,this._link(o,r),this._link(o+1,i),this._link(o+2,a),this.trianglesLen+=3,o}}function Vp(t,e,n,r){const i=t-n,a=e-r;return i*i+a*a}function Wp(t,e,n,r,i,a,o,s){const A=t-o,l=e-s,c=n-o,u=r-s,h=i-o,f=a-s,d=c*c+u*u,p=h*h+f*f;return A*(u*p-d*f)-l*(c*p-d*h)+(A*A+l*l)*(c*f-u*h)<0}function Xp(t,e,n,r,i,a){const o=n-t,s=r-e,A=i-t,l=a-e,c=o*o+s*s,u=A*A+l*l,h=.5/(o*l-s*A),f=(l*c-s*u)*h,d=(o*u-A*c)*h;return f*f+d*d}function Qp(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],a=e[r];let o=i-1;for(;o>=n&&e[t[o]]>a;)t[o+1]=t[o--];t[o+1]=r;}else {let i=n+1,a=r;Yp(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Yp(t,n,r),e[t[i]]>e[t[r]]&&Yp(t,i,r),e[t[n]]>e[t[i]]&&Yp(t,n,i);const o=t[i],s=e[o];for(;;){do{i++;}while(e[t[i]]<s);do{a--;}while(e[t[a]]>s);if(a<i)break;Yp(t,i,a);}t[n+1]=t[a],t[a]=o,r-i+1>=a-n?(Qp(t,e,i,r),Qp(t,e,n,a-1)):(Qp(t,e,n,a-1),Qp(t,e,i,r));}}function Yp(t,e,n){const r=t[e];t[e]=t[n],t[n]=r;}function Zp(t){return t[0]}function Kp(t){return t[1]}function Jp(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r,i=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(t),a="Feature"===(r=e).type?r.geometry:r,o=a.type,s=e.bbox,A=a.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,s))return !1;"Polygon"===o&&(A=[A]);for(var l=!1,c=0;c<A.length&&!l;c++)if($p(i,A[c][0],n.ignoreBoundary)){for(var u=!1,h=1;h<A[c].length&&!u;)$p(i,A[c][h],!n.ignoreBoundary)&&(u=!0),h++;u||(l=!0);}return l}function $p(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,a=e.length-1;i<e.length;a=i++){var o=e[i][0],s=e[i][1],A=e[a][0],l=e[a][1];if(t[1]*(o-A)+s*(A-t[0])+l*(t[0]-o)==0&&(o-t[0])*(A-t[0])<=0&&(s-t[1])*(l-t[1])<=0)return !n;s>t[1]!=l>t[1]&&t[0]<(A-o)*(t[1]-s)/(l-s)+o&&(r=!r);}return r}const tm=1e-6;class em{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._="";}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`;}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z");}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`;}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>tm||Math.abs(this._y1-i)>tm)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`);}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`;}value(){return this._||null}}class nm{constructor(){this._=[];}moveTo(t,e){this._.push([t,e]);}closePath(){this._.push(this._[0].slice());}lineTo(t,e){this._.push([t,e]);}value(){return this._.length?this._:null}}class rm{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init();}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this;let i,a;const o=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,s,A=0,l=0,c=n.length;A<c;A+=3,l+=2){const c=2*n[A],u=2*n[A+1],h=2*n[A+2],f=t[c],d=t[c+1],p=t[u],m=t[u+1],g=t[h],v=t[h+1],_=p-f,y=m-d,x=g-f,b=v-d,M=2*(_*b-y*x);if(Math.abs(M)<1e-9){if(void 0===i){i=a=0;for(const n of e)i+=t[2*n],a+=t[2*n+1];i/=e.length,a/=e.length;}const n=1e9*Math.sign((i-f)*b-(a-d)*x);r=(f+g)/2-n*b,s=(d+v)/2+n*x;}else {const t=1/M,e=_*_+y*y,n=x*x+b*b;r=f+(b*e-y*n)*t,s=d+(_*n-x*e)*t;}o[l]=r,o[l+1]=s;}let s,A,l,c=e[e.length-1],u=4*c,h=t[2*c],f=t[2*c+1];r.fill(0);for(let n=0;n<e.length;++n)c=e[n],s=u,A=h,l=f,u=4*c,h=t[2*c],f=t[2*c+1],r[s+2]=r[u]=l-f,r[s+3]=r[u+1]=h-A;}render(t){const e=null==t?t=new em:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:a,vectors:o}=this;if(i.length<=1)return null;for(let e=0,r=n.length;e<r;++e){const r=n[e];if(r<e)continue;const i=2*Math.floor(e/3),o=2*Math.floor(r/3),s=a[i],A=a[i+1],l=a[o],c=a[o+1];this._renderSegment(s,A,l,c,t);}let s,A=i[i.length-1];for(let e=0;e<i.length;++e){s=A,A=i[e];const n=2*Math.floor(r[A]/3),l=a[n],c=a[n+1],u=4*s,h=this._project(l,c,o[u+2],o[u+3]);h&&this._renderSegment(l,c,h[0],h[1],t);}return e&&e.value()}renderBounds(t){const e=null==t?t=new em:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new em:void 0,r=this._clip(t);if(null===r||!r.length)return;e.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let t=2;t<i;t+=2)r[t]===r[t-2]&&r[t+1]===r[t-1]||e.lineTo(r[t],r[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t);}}cellPolygon(t){const e=new nm;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,r,i){let a;const o=this._regioncode(t,e),s=this._regioncode(n,r);0===o&&0===s?(i.moveTo(t,e),i.lineTo(n,r)):(a=this._clipSegment(t,e,n,r,o,s))&&(i.moveTo(a[0],a[1]),i.lineTo(a[2],a[3]));}contains(t,e,n){return (e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let r=0,i=e.length;r<i;r+=2)for(let a=0,o=t.length;a<o;a+=2)if(e[r]===t[a]&&e[r+1]===t[a+1]&&e[(r+2)%i]===t[(a+o-2)%o]&&e[(r+3)%i]===t[(a+o-1)%o]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,a=n[t];if(-1===a)return null;const o=[];let s=a;do{const n=Math.floor(s/3);if(o.push(e[2*n],e[2*n+1]),s=s%3==2?s-2:s+1,i[s]!==t)break;s=r[s];}while(s!==a&&-1!==s);return o}_clip(t){if(0===t&&1===this.delaunay.hull.length)return [this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,r=4*t;return this._simplify(n[r]||n[r+1]?this._clipInfinite(t,e,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,e))}_clipFinite(t,e){const n=e.length;let r,i,a,o,s=null,A=e[n-2],l=e[n-1],c=this._regioncode(A,l),u=0;for(let h=0;h<n;h+=2)if(r=A,i=l,A=e[h],l=e[h+1],a=c,c=this._regioncode(A,l),0===a&&0===c)o=u,u=0,s?s.push(A,l):s=[A,l];else {let e,n,h,f,d;if(0===a){if(null===(e=this._clipSegment(r,i,A,l,a,c)))continue;[n,h,f,d]=e;}else {if(null===(e=this._clipSegment(A,l,r,i,c,a)))continue;[f,d,n,h]=e,o=u,u=this._edgecode(n,h),o&&u&&this._edge(t,o,u,s,s.length),s?s.push(n,h):s=[n,h];}o=u,u=this._edgecode(f,d),o&&u&&this._edge(t,o,u,s,s.length),s?s.push(f,d):s=[f,d];}if(s)o=u,u=this._edgecode(s[0],s[1]),o&&u&&this._edge(t,o,u,s,s.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return [this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return s}_clipSegment(t,e,n,r,i,a){const o=i<a;for(o&&([t,e,n,r,i,a]=[n,r,t,e,a,i]);;){if(0===i&&0===a)return o?[n,r,t,e]:[t,e,n,r];if(i&a)return null;let s,A,l=i||a;8&l?(s=t+(n-t)*(this.ymax-e)/(r-e),A=this.ymax):4&l?(s=t+(n-t)*(this.ymin-e)/(r-e),A=this.ymin):2&l?(A=e+(r-e)*(this.xmax-t)/(n-t),s=this.xmax):(A=e+(r-e)*(this.xmin-t)/(n-t),s=this.xmin),i?(t=s,e=A,i=this._regioncode(t,e)):(n=s,r=A,a=this._regioncode(n,r));}}_clipInfinite(t,e,n,r,i,a){let o,s=Array.from(e);if((o=this._project(s[0],s[1],n,r))&&s.unshift(o[0],o[1]),(o=this._project(s[s.length-2],s[s.length-1],i,a))&&s.push(o[0],o[1]),s=this._clipFinite(t,s))for(let e,n=0,r=s.length,i=this._edgecode(s[r-2],s[r-1]);n<r;n+=2)e=i,i=this._edgecode(s[n],s[n+1]),e&&i&&(n=this._edge(t,e,i,s,n),r=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,e,n,r,i){for(;e!==n;){let n,a;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,a=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,a=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,a=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,a=this.ymin;}r[i]===n&&r[i+1]===a||!this.contains(t,n,a)||(r.splice(i,0,n,a),i+=2);}return i}_project(t,e,n,r){let i,a,o,s=1/0;if(r<0){if(e<=this.ymin)return null;(i=(this.ymin-e)/r)<s&&(o=this.ymin,a=t+(s=i)*n);}else if(r>0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)<s&&(o=this.ymax,a=t+(s=i)*n);}if(n>0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)<s&&(a=this.xmax,o=e+(s=i)*r);}else if(n<0){if(t<=this.xmin)return null;(i=(this.xmin-t)/n)<s&&(a=this.xmin,o=e+(s=i)*r);}return [a,o]}_edgecode(t,e){return (t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return (t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e<t.length;e+=2){const n=(e+2)%t.length,r=(e+4)%t.length;(t[e]===t[n]&&t[n]===t[r]||t[e+1]===t[n+1]&&t[n+1]===t[r+1])&&(t.splice(n,2),e-=2);}t.length||(t=null);}return t}}const im=2*Math.PI,am=Math.pow;function om(t){return t[0]}function sm(t){return t[1]}function Am(t,e,n){return [t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class lm{static from(t,e=om,n=sm,r){return new lm("length"in t?function(t,e,n,r){const i=t.length,a=new Float64Array(2*i);for(let o=0;o<i;++o){const i=t[o];a[2*o]=e.call(r,i,o,t),a[2*o+1]=n.call(r,i,o,t);}return a}(t,e,n,r):Float64Array.from(function*(t,e,n,r){let i=0;for(const a of t)yield e.call(r,a,i,t),yield n.call(r,a,i,t),++i;}(t,e,n,r)))}constructor(t){this._delaunator=new jp(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init();}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const r=2*e[t],i=2*e[t+1],a=2*e[t+2];if((n[a]-n[r])*(n[i+1]-n[r+1])-(n[i]-n[r])*(n[a+1]-n[r+1])>1e-10)return !1}return !0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t<n;++t){const n=Am(e[2*t],e[2*t+1],i);e[2*t]=n[0],e[2*t+1]=n[1];}this._delaunator=new jp(e);}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),o=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=i[t%3==2?t-2:t+1];-1!==n[t]&&-1!==a[e]||(a[e]=t);}for(let t=0,e=r.length;t<e;++t)o[r[t]]=t;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],a[r[0]]=1,2===r.length&&(a[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]));}voronoi(t){return new rm(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:a,collinear:o}=this;if(o){const e=o.indexOf(t);return e>0&&(yield o[e-1]),void(e<o.length-1&&(yield o[e+1]))}const s=e[t];if(-1===s)return;let A=s,l=-1;do{if(yield l=a[A],A=A%3==2?A-2:A+1,a[A]!==t)return;if(A=i[A],-1===A){const e=n[(r[t]+1)%n.length];return void(e!==l&&(yield e))}}while(A!==s)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return -1;const r=n;let i;for(;(i=this._step(n,t,e))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:a,halfedges:o,triangles:s,points:A}=this;if(-1===r[t]||!A.length)return (t+1)%(A.length>>1);let l=t,c=am(e-A[2*t],2)+am(n-A[2*t+1],2);const u=r[t];let h=u;do{let r=s[h];const u=am(e-A[2*r],2)+am(n-A[2*r+1],2);if(u<c&&(c=u,l=r),h=h%3==2?h-2:h+1,s[h]!==t)break;if(h=o[h],-1===h){if(h=i[(a[t]+1)%i.length],h!==r&&am(e-A[2*h],2)+am(n-A[2*h+1],2)<c)return h;break}}while(h!==u);return l}render(t){const e=null==t?t=new em:void 0,{points:n,halfedges:r,triangles:i}=this;for(let e=0,a=r.length;e<a;++e){const a=r[e];if(a<e)continue;const o=2*i[e],s=2*i[a];t.moveTo(n[o],n[o+1]),t.lineTo(n[s],n[s+1]);}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"==typeof t.moveTo||(e=t,t=null),e=null==e?2:+e;const n=null==t?t=new em:void 0,{points:r}=this;for(let n=0,i=r.length;n<i;n+=2){const i=r[n],a=r[n+1];t.moveTo(i+e,a),t.arc(i,a,e,0,im);}return n&&n.value()}renderHull(t){const e=null==t?t=new em:void 0,{hull:n,points:r}=this,i=2*n[0],a=n.length;t.moveTo(r[i],r[i+1]);for(let e=1;e<a;++e){const i=2*n[e];t.lineTo(r[i],r[i+1]);}return t.closePath(),e&&e.value()}hullPolygon(){const t=new nm;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new em:void 0,{points:r,triangles:i}=this,a=2*i[t*=3],o=2*i[t+1],s=2*i[t+2];return e.moveTo(r[a],r[a+1]),e.lineTo(r[o],r[o+1]),e.lineTo(r[s],r[s+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e);}trianglePolygon(t){const e=new nm;return this.renderTriangle(t,e),e.value()}}const cm=Math.PI,um=cm/2,hm=180/cm,fm=cm/180,dm=Math.atan2,pm=Math.cos,mm=Math.max,gm=Math.min,vm=Math.sin,_m=Math.sign||function(t){return t>0?1:t<0?-1:0},ym=Math.sqrt;function xm(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bm(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 Mm(t,e){return [t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function wm(t){var e=ym(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);return [t[0]/e,t[1]/e,t[2]/e]}function Em(t){return [dm(t[1],t[0])*hm,(e=mm(-1,gm(1,t[2])),(e>1?um:e<-1?-um:Math.asin(e))*hm)];var e;}function Sm(t){const e=t[0]*fm,n=t[1]*fm,r=pm(n);return [r*pm(e),r*vm(e),vm(n)]}function Tm(t){return xm((t=t.map((t=>Sm(t))))[0],bm(t[2],t[1]))}function Cm(t){const e=function(t){if(t.length<2)return {};let e=0;for(;isNaN(t[e][0]+t[e][1])&&e++<t.length;);const n=function(t){function e(e){return (e=t(e[0]*Kl,e[1]*Kl))[0]*=Zl,e[1]*=Zl,e}return t=Iu(t[0]*Kl,t[1]*Kl,t.length>2?t[2]*Kl:0),e.invert=function(e){return (e=t.invert(e[0]*Kl,e[1]*Kl))[0]*=Zl,e[1]*=Zl,e},e}(t[e]),r=Fh().translate([0,0]).scale(1).rotate(n.invert([180,0]));t=t.map(r);const i=[];let a=1;for(let e=0,n=t.length;e<n;e++){let n=t[e][0]**2+t[e][1]**2;!isFinite(n)||n>1e32?i.push(e):n>a&&(a=n);}const o=1e6*ym(a);i.forEach((e=>t[e]=[o,0])),t.push([0,o]),t.push([-o,0]),t.push([0,-o]);const s=lm.from(t);s.projection=r;const{triangles:A,halfedges:l,inedges:c}=s;for(let n=0,r=l.length;n<r;n++)if(l[n]<0){const t=n%3==2?n-2:n+1,r=n%3==0?n+2:n-1,i=l[t],a=l[r];l[i]=a,l[a]=i,l[t]=l[r]=-1,A[n]=A[t]=A[r]=e,c[A[i]]=i%3==0?i+2:i-1,c[A[a]]=a%3==0?a+2:a-1,n+=2-n%3;}else A[n]>t.length-3-1&&(A[n]=e);return s}(t),n=function(t){const{triangles:e}=t;if(!e)return [];const n=[];for(let t=0,r=e.length/3;t<r;t++){const r=e[3*t],i=e[3*t+1],a=e[3*t+2];r!==i&&i!==a&&n.push([r,a,i]);}return n}(e),r=function(t,e){const n=new Set;return 2===e.length?[[0,1]]:(t.forEach((t=>{if(t[0]!==t[1]&&!(Tm(t.map((t=>e[t])))<0))for(let e,r=0;r<3;r++)e=(r+1)%3,n.add(ql([t[r],t[e]]).join("-"));})),Array.from(n,(t=>t.split("-").map(Number))))}(n,t),i=function(t,e){const n=[];t.forEach((t=>{for(let e=0;e<3;e++){const r=t[e],i=t[(e+1)%3];n[r]=n[r]||[],n[r].push(i);}})),0===t.length&&(2===e?(n[0]=[1],n[1]=[0]):1===e&&(n[0]=[]));return n}(n,t.length),a=function(t,e){function n(t,e){let n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i}return function(r,i,a){void 0===a&&(a=0);let o,s,A=a;const l=Sm([r,i]);do{o=a,a=null,s=n(l,Sm(e[o])),t[o].forEach((t=>{let r=n(l,Sm(e[t]));if(r<s)return s=r,a=t,void(A=t)}));}while(null!==a);return A}}(i,t),o=function(t,e){return t.map((t=>{const n=t.map((t=>e[t])).map(Sm);return Em(wm(Mm(Mm(bm(n[1],n[0]),bm(n[2],n[1])),bm(n[0],n[2]))))}))}(n,t),{polygons:s,centers:A}=function(t,e,n){const r=[],i=t.slice();if(0===e.length){if(n.length<2)return {polygons:r,centers:i};if(2===n.length){const t=Sm(n[0]),e=Sm(n[1]),a=wm(Mm(t,e)),s=wm(bm(t,e)),A=bm(a,s),l=[a,bm(a,A),bm(bm(a,A),A),bm(bm(bm(a,A),A),A)].map(Em).map(o);return r.push(l),r.push(l.slice().reverse()),{polygons:r,centers:i}}}e.forEach(((t,e)=>{for(let n=0;n<3;n++){const i=t[n],a=t[(n+1)%3],o=t[(n+2)%3];r[i]=r[i]||[],r[i].push([a,o,e,[i,a,o]]);}}));const a=r.map((t=>{const e=[t[0][2]];let r=t[0][1];for(let n=1;n<t.length;n++)for(let n=0;n<t.length;n++)if(t[n][0]==r){r=t[n][1],e.push(t[n][2]);break}if(e.length>2)return e;if(2==e.length){const r=Rm(n[t[0][3][0]],n[t[0][3][1]],i[e[0]]),a=Rm(n[t[0][3][2]],n[t[0][3][0]],i[e[0]]),s=o(r),A=o(a);return [e[0],A,e[1],s]}}));function o(t){let n=-1;return i.slice(e.length,1/0).forEach(((r,i)=>{r[0]===t[0]&&r[1]===t[1]&&(n=i+e.length);})),n<0&&(n=i.length,i.push(t)),n}return {polygons:a,centers:i}}(o,n,t),l=function(t){const e=[];return t.forEach((t=>{if(!t)return;let n=t[t.length-1];for(let r of t)r>n&&e.push([n,r]),n=r;})),e}(s),c=function(t,e){const n=new Set,r=[];t.map((t=>{if(!(Tm(t.map((t=>e[t>e.length?0:t])))>1e-12))for(let e=0;e<3;e++){let r=[t[e],t[(e+1)%3]],i=`${r[0]}-${r[1]}`;n.has(i)?n.delete(i):n.add(`${r[1]}-${r[0]}`);}}));const i=new Map;let a;if(n.forEach((t=>{t=t.split("-").map(Number),i.set(t[0],t[1]),a=t[0];})),void 0===a)return r;let o=a;do{r.push(o);let t=i.get(o);i.set(o,-1),o=t;}while(o>-1&&o!==a);return r}(n,t),u=function(t,e){return function(n){const r=new Map,i=new Map;return t.forEach(((t,e)=>{const a=t.join("-");r.set(a,n[e]),i.set(a,!0);})),e.forEach((t=>{let e=0,n=-1;for(let i=0;i<3;i++){let a=ql([t[i],t[(i+1)%3]]).join("-");r.get(a)>e&&(e=r.get(a),n=a);}i.set(n,!1);})),t.map((t=>i.get(t.join("-"))))}}(r,n);return {delaunay:e,edges:r,triangles:n,centers:A,neighbors:i,polygons:s,mesh:l,hull:c,urquhart:u,find:a}}function Rm(t,e,n){t=Sm(t),e=Sm(e),n=Sm(n);const r=_m(xm(bm(e,t),n));return Em(wm(Mm(t,e)).map((t=>r*t)))}function Pm(t,e,n){return e=Im(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Lm()?Reflect.construct(e,n||[],Im(t).constructor):e.apply(t,n))}function Lm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));}catch(t){}return (Lm=function(){return !!t})()}function Dm(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:String(e)}function Om(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Dm(r.key),r);}}function Im(t){return Im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Im(t)}function qm(t,e){return qm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qm(t,e)}function Um(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1;}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t;}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Bm(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nm(t){return function(t){if(Array.isArray(t))return km(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Bm(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bm(t,e){if(t){if("string"==typeof t)return km(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return "Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?km(t,e):void 0}}function km(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Fm(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).resolution,n=void 0===e?1/0:e,r=function(t,e){return t.map((function(t){var n,r=[];return t.forEach((function(t){if(n){var i=180*ch(t,n)/Math.PI;if(i>e)for(var a=bh(n,t),o=1/Math.ceil(i/e),s=o;s<1;)r.push(a(s)),s+=o;}r.push(n=t);})),r}))}(t,n),i=Gl(r),a=function(t,e){var n={type:"Polygon",coordinates:t},r=_u(n),i=Um(r,2),a=Um(i[0],2),o=a[0],s=a[1],A=Um(i[1],2),l=A[0],c=A[1];if(Math.min(Math.abs(l-o),Math.abs(c-s))<e)return [];var u=o>l||c>=89||s<=-89;return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.minLng,r=e.maxLng,i=e.minLat,a=e.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,A=function(t){return t/s*360%360-180},l=function(t){return Math.acos(2*t/o-1)/Math.PI*180-90},c=function(t){return o*(Math.cos((t+90)*Math.PI/180)+1)/2},u=[void 0!==a?Math.ceil(c(a)):0,void 0!==i?Math.floor(c(i)):o-1],h=void 0===n&&void 0===r?function(){return !0}:void 0===n?function(t){return t<=r}:void 0===r?function(t){return t>=n}:r>=n?function(t){return t>=n&&t<=r}:function(t){return t>=n||t<=r},f=[],d=u[0];d<=u[1];d++){var p=A(d);h(p)&&f.push([p,l(d)]);}return f}(e,{minLng:o,maxLng:l,minLat:s,maxLat:c}).filter((function(t){return zm(t,n,u)}))}(t,n),o=[].concat(Nm(i),Nm(a)),s={type:"Polygon",coordinates:t},A=Um(_u(s),2),l=Um(A[0],2),c=l[0],u=l[1],h=Um(A[1],2),f=h[0],d=h[1],p=c>f||d>=89||u<=-89,m=[];if(p){var g=function(t){const e=function(t){if(e.delaunay=null,e._data=t,"object"==typeof e._data&&"FeatureCollection"===e._data.type&&(e._data=e._data.features),"object"==typeof e._data){const t=e._data.map((t=>[e._vx(t),e._vy(t),t])).filter((t=>isFinite(t[0]+t[1])));e.points=t.map((t=>[t[0],t[1]])),e.valid=t.map((t=>t[2])),e.delaunay=Cm(e.points);}return e};return e._vx=function(t){return "object"==typeof t&&"type"in t?Lu(t)[0]:0 in t?t[0]:void 0},e._vy=function(t){return "object"==typeof t&&"type"in t?Lu(t)[1]:1 in t?t[1]:void 0},e.x=function(t){return t?(e._vx=t,e):e._vx},e.y=function(t){return t?(e._vy=t,e):e._vy},e.polygons=function(t){if(void 0!==t&&e(t),!e.delaunay)return !1;const n={type:"FeatureCollection",features:[]};return 0===e.valid.length||(e.delaunay.polygons.forEach(((t,r)=>n.features.push({type:"Feature",geometry:t?{type:"Polygon",coordinates:[[...t,t[0]].map((t=>e.delaunay.centers[t]))]}:null,properties:{site:e.valid[r],sitecoordinates:e.points[r],neighbours:e.delaunay.neighbors[r]}}))),1===e.valid.length&&n.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:e.valid[0],sitecoordinates:e.points[0],neighbours:[]}})),n},e.triangles=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"FeatureCollection",features:e.delaunay.triangles.map(((t,n)=>((t=t.map((t=>e.points[t]))).center=e.delaunay.centers[n],t))).filter((t=>Tm(t)>0)).map((t=>({type:"Feature",properties:{circumcenter:t.center},geometry:{type:"Polygon",coordinates:[[...t,t[0]]]}})))}},e.links=function(t){if(void 0!==t&&e(t),!e.delaunay)return !1;const n=e.delaunay.edges.map((t=>ch(e.points[t[0]],e.points[t[1]]))),r=e.delaunay.urquhart(n);return {type:"FeatureCollection",features:e.delaunay.edges.map(((t,i)=>({type:"Feature",properties:{source:e.valid[t[0]],target:e.valid[t[1]],length:n[i],urquhart:!!r[i]},geometry:{type:"LineString",coordinates:[e.points[t[0]],e.points[t[1]]]}})))}},e.mesh=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"MultiLineString",coordinates:e.delaunay.edges.map((t=>[e.points[t[0]],e.points[t[1]]]))}},e.cellMesh=function(t){if(void 0!==t&&e(t),!e.delaunay)return !1;const{centers:n,polygons:r}=e.delaunay,i=[];for(const t of r)if(t)for(let e=t.length,r=t[e-1],a=t[0],o=0;o<e;r=a,a=t[++o])a>r&&i.push([n[r],n[a]]);return {type:"MultiLineString",coordinates:i}},e._found=void 0,e.find=function(t,n,r){if(e._found=e.delaunay.find(t,n,e._found),!r||ch([t,n],e.points[e._found])<r)return e._found},e.hull=function(t){void 0!==t&&e(t);const n=e.delaunay.hull,r=e.points;return 0===n.length?null:{type:"Polygon",coordinates:[[...n.map((t=>r[t])),r[n[0]]]]}},t?e(t):e}(o).triangles(),v=new Map(o.map((function(t,e){var n=Um(t,2),r=n[0],i=n[1];return ["".concat(r,"-").concat(i),e]})));g.features.forEach((function(t){var e,n=t.geometry.coordinates[0].slice(0,3).reverse(),r=[];if(n.forEach((function(t){var e=Um(t,2),n=e[0],i=e[1],a="".concat(n,"-").concat(i);v.has(a)&&r.push(v.get(a));})),3===r.length){if(r.some((function(t){return t<i.length})))if(!zm(t.properties.circumcenter,s,p))return;(e=m).push.apply(e,r);}}));}else if(a.length)for(var _=jp.from(o),y=function(t){var e,n=[2,1,0].map((function(e){return _.triangles[t+e]})),r=n.map((function(t){return o[t]}));if(n.some((function(t){return t<i.length}))){var a=[0,1].map((function(t){return function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else {let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(a=+a)>=a&&(++n,r+=a);}if(n)return r/n}(r,(function(e){return e[t]}))}));if(!zm(a,s,p))return 1}(e=m).push.apply(e,Nm(n));},x=0,b=_.triangles.length;x<b;x+=3)y(x);else {var M=Rl.flatten(r),w=M.vertices,E=M.holes;m=Rl(w,void 0===E?[]:E,2);}var S=Rp(ql(o,(function(t){return t[0]})),[0,1]),T=Rp(ql(o,(function(t){return t[1]})),[0,1]),C=o.map((function(t){var e=Um(t,2),n=e[0],r=e[1];return [S(n),T(r)]}));return {contour:r,triangles:{points:o,indices:m,uvs:C}}}function zm(t,e){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?function(t,e){return (t&&uh.hasOwnProperty(t.type)?uh[t.type]:fh)(t,e)}(e,t):Jp(t,e)}var Gm=window.THREE?window.THREE:{BufferGeometry:Hn,Float32BufferAttribute:qn},Hm=(new Gm.BufferGeometry).setAttribute?"setAttribute":"addAttribute",jm=function(t){function e(t,n,r,i,a,o,s){var A;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=Pm(this,e)).type="ConicPolygonBufferGeometry",A.parameters={polygonGeoJson:t,startHeight:n,endHeight:r,closedBottom:i,closedTop:a,includeSides:o,curvatureResolution:s},n=n||0,r=r||1,i=void 0===i||i,a=void 0===a||a,o=void 0===o||o;var l=Fm(t,{resolution:s=s||5}),c=l.contour,u=l.triangles,h=Gl(u.uvs),f=[],d=[],p=[],m=0,g=function(t){var e=Math.round(f.length/3),n=p.length;f=f.concat(t.vertices),d=d.concat(t.uvs),p=p.concat(e?t.indices.map((function(t){return t+e})):t.indices),A.addGroup(n,p.length-n,m++);};function v(t,e){var n=t.map((function(t){return t.map((function(t){var n=Um(t,2),r=n[0];return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180;return [n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}(n[1],r,e)}))}));return Rl.flatten(n)}function _(t){return {indices:!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?u.indices:u.indices.slice().reverse(),vertices:v([u.points],t).vertices,uvs:h}}return o&&g(function(){for(var t=v(c,n),e=t.vertices,i=t.holes,a=v(c,r).vertices,o=Gl([a,e]),s=Math.round(a.length/3),A=new Set(i),l=0,u=[],h=0;h<s;h++){var f=h+1;if(f===s)f=l;else if(A.has(f)){var d=f;f=l,l=d;}u.push(h,h+s,f+s),u.push(f+s,f,h);}for(var p=[],m=1;m>=0;m--)for(var g=0;g<s;g+=1)p.push(g/(s-1),m);return {indices:u,vertices:o,uvs:p}}()),i&&g(_(n,!1)),a&&g(_(r,!0)),A.setIndex(p),A[Hm]("position",new Gm.Float32BufferAttribute(f,3)),A[Hm]("uv",new Gm.Float32BufferAttribute(d,2)),A.computeVertexNormals(),A}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qm(t,e);}(e,t),n=e,r&&Om(n.prototype,r),i&&Om(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i;}(Gm.BufferGeometry);var Vm=function(t){var e,n=void 0!==(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var i,a,o,s,A=!1;i="object"==typeof window,a="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,A=o&&!i&&!a,s=!i&&!A&&!a;var l,c,u,h,f,d="";A?(d=__dirname+"/",l=function(t,e){var n;return (n=rt(t))||(h||(h=require("fs")),f||(f=require("path")),t=f.normalize(t),n=h.readFileSync(t)),e?n:n.toString()},u=function(t){var e=l(t,!0);return e.buffer||(e=new Uint8Array(e)),_(e.buffer),e},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),n.inspect=function(){return "[Emscripten Module object]"}):s?("undefined"!=typeof read&&(l=function(t){var e=rt(t);return e?et(e):read(t)}),u=function(t){var e;return (e=rt(t))?e:"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(_("object"==typeof(e=read(t,"binary"))),e)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(i||a)&&(a?d=self.location.href:"undefined"!=typeof document&&document.currentScript&&(d=document.currentScript.src),d=0!==d.indexOf("blob:")?d.substr(0,d.lastIndexOf("/")+1):"",l=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText}catch(e){var n=rt(t);if(n)return et(n);throw e}},a&&(u=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){var n=rt(t);if(n)return n;throw e}}),c=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else {var i=rt(t);i?e(i.buffer):n();}},r.onerror=n,r.send(null);});var p=n.print||console.log.bind(console),m=n.printErr||console.warn.bind(console);for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram;var g=0;var v=!1;function _(t,e){t||gt("Assertion failed: "+e);}function y(t){var e=n["_"+t];return _(e,"Cannot call unknown function "+t+", make sure it is exported"),e}function x(t,e,n,r,i){var a={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,r){if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o);if(s<=127){if(n>=a)break;e[n++]=s;}else if(s<=2047){if(n+1>=a)break;e[n++]=192|s>>6,e[n++]=128|63&s;}else if(s<=65535){if(n+2>=a)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s;}else {if(n+3>=a)break;e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s;}}e[n]=0;})(t,w,e,n);})(t,e=At(n),n);}return e},array:function(t){var e=At(t.length);return function(t,e){M.set(t,e);}(t,e),e}};var o=y(t),s=[],A=0;if(r)for(var l=0;l<r.length;l++){var c=a[n[l]];c?(0===A&&(A=ct()),s[l]=c(r[l])):s[l]=r[l];}var u=o.apply(null,s);return u=function(t){return "string"===e?P(t):"boolean"===e?Boolean(t):t}(u),0!==A&&lt(A),u}var b,M,w,E,S,T,C,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(t,e){return t?function(t,e,n){for(var r=e+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.subarray&&R)return R.decode(t.subarray(e,i));for(var a="";e<i;){var o=t[e++];if(128&o){var s=63&t[e++];if(192!=(224&o)){var A=63&t[e++];if((o=224==(240&o)?(15&o)<<12|s<<6|A:(7&o)<<18|s<<12|A<<6|63&t[e++])<65536)a+=String.fromCharCode(o);else {var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|1023&l);}}else a+=String.fromCharCode((31&o)<<6|s);}else a+=String.fromCharCode(o);}return a}(w,t,e):""}function L(t,e){return t%e>0&&(t+=e-t%e),t}function D(t){b=t,n.HEAP8=M=new Int8Array(t),n.HEAP16=E=new Int16Array(t),n.HEAP32=S=new Int32Array(t),n.HEAPU8=w=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=T=new Float32Array(t),n.HEAPF64=C=new Float64Array(t);}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var O=n.TOTAL_MEMORY||33554432;function I(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?n.dynCall_v(r):n.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg);}else e();}}O=(b=n.buffer?n.buffer:new ArrayBuffer(O)).byteLength,D(b),S[6032]=5267040;var q=[],U=[],N=[],B=[];var k=Math.abs,F=Math.ceil,z=Math.floor,G=Math.min,H=0,j=null;n.preloadedImages={},n.preloadedAudios={};var V,W,X=null,Q="data:application/octet-stream;base64,";function Y(t){return String.prototype.startsWith?t.startsWith(Q):0===t.indexOf(Q)}X="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function Z(t){return t}function K(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function J(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e;}if(!t.stack)return "(no stack trace available)"}return t.stack.toString()}function $(){return M.length}function tt(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(M),at(e),D(e),1}catch(t){}}function et(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];r>255&&(r&=255),e.push(String.fromCharCode(r));}return e.join("")}var nt="function"==typeof atob?atob:function(t){var e,n,r,i,a,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",A="",l=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(l++))<<2|(i=s.indexOf(t.charAt(l++)))>>4,n=(15&i)<<4|(a=s.indexOf(t.charAt(l++)))>>2,r=(3&a)<<6|(o=s.indexOf(t.charAt(l++))),A+=String.fromCharCode(e),64!==a&&(A+=String.fromCharCode(n)),64!==o&&(A+=String.fromCharCode(r));}while(l<t.length);return A};function rt(t){if(Y(t))return function(t){if("boolean"==typeof A&&A){var e;try{e=Buffer.from(t,"base64");}catch(n){e=new Buffer(t,"base64");}return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}try{for(var n=nt(t),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(Q.length))}var it=function(t,e,n){var r=new t.Int8Array(n),i=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var a=new t.Float64Array(n),o=0|e.o,s=0|e.p,A=t.Math.floor,l=t.Math.abs,c=t.Math.sqrt,u=t.Math.pow,h=t.Math.cos,f=t.Math.sin,d=t.Math.tan,p=t.Math.acos,m=t.Math.asin,g=t.Math.atan,v=t.Math.atan2,_=t.Math.ceil,y=t.Math.imul,x=t.Math.min,b=t.Math.max,M=t.Math.clz32,w=e.b,E=e.c,S=e.d,T=e.e,C=e.f,R=e.g,P=e.h,L=e.i,D=24160;function O(t,e,n,r){return 0|I(t|=0,e|=0,n|=0,r|=0,0)}function I(t,e,n,r,a){var o,s=0,A=0,l=0,c=0;if(o=D,D=D+16|0,A=o,!(0|q(t|=0,e|=0,n|=0,r|=0,a|=0)))return D=o,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(s=0|ee(15,A)))break;A=0|i[(l=A)>>2],l=0|i[l+4>>2];}else c=0|Ne(0|n,0|(s=((0|n)<0)<<31>>31),3,0),l=0|E(),s=0|De(0|n,0|s,1,0),s=0|De(0|(s=0|Ne(0|c,0|l,0|s,0|E())),0|E(),1,0),l=0|E(),i[A>>2]=s,i[A+4>>2]=l,A=s;if(Xe(0|r,0,A<<3),0|a){Xe(0|a,0,A<<2),s=0|U(t,e,n,r,a,A,l,0);break}(s=0|Le(A,4))?(c=0|U(t,e,n,r,s,A,l,0),Pe(s),s=c):s=13;}else s=2;}while(0);return D=o,0|(c=s)}function q(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0;if(s=D,D=D+16|0,m=s+8|0,i[(p=o=s)>>2]=t,i[p+4>>2]=e,(0|n)<0)return D=s,0|(m=2);if(i[(A=r)>>2]=t,i[A+4>>2]=e,(A=!!(0|a))&&(i[a>>2]=0),0|Nt(t,e))return D=s,0|(m=9);i[m>>2]=0;t:do{if((0|n)>=1)if(A)for(f=1,h=0,d=0,p=1,A=t;;){if(!(h|d)){if(0|(A=0|N(A,e,4,m,o)))break t;if(0|Nt(A=0|i[(e=o)>>2],e=0|i[e+4>>2])){A=9;break t}}if(0|(A=0|N(A,e,0|i[22384+(d<<2)>>2],m,o)))break t;if(A=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(f<<3)|0)>>2]=A,i[t+4>>2]=e,i[a+(f<<2)>>2]=p,l=(0|(t=h+1|0))==(0|p),u=6==(0|(c=d+1|0)),0|Nt(A,e)){A=9;break t}if((0|(p=p+(u&l&1)|0))>(0|n)){A=0;break}f=f+1|0,h=l?0:t,d=l?u?0:c:d;}else for(f=1,h=0,d=0,p=1,A=t;;){if(!(h|d)){if(0|(A=0|N(A,e,4,m,o)))break t;if(0|Nt(A=0|i[(e=o)>>2],e=0|i[e+4>>2])){A=9;break t}}if(0|(A=0|N(A,e,0|i[22384+(d<<2)>>2],m,o)))break t;if(A=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(f<<3)|0)>>2]=A,i[t+4>>2]=e,l=(0|(t=h+1|0))==(0|p),u=6==(0|(c=d+1|0)),0|Nt(A,e)){A=9;break t}if((0|(p=p+(u&l&1)|0))>(0|n)){A=0;break}f=f+1|0,h=l?0:t,d=l?u?0:c:d;}else A=0;}while(0);return D=s,0|(m=A)}function U(t,e,n,r,a,o,s,A){n|=0,r|=0,a|=0,A|=0;var l,c,u,h=0,f=0,d=0,p=0,m=0,g=0,v=0;if(u=D,D=D+16|0,l=u+8|0,c=u,h=0|ke(0|(t|=0),0|(e|=0),0|(o|=0),0|(s|=0)),d=0|E(),!(!(0|(v=0|i[(g=p=r+(h<<3)|0)>>2]))&!(0|(g=0|i[g+4>>2]))|(f=(0|v)==(0|t)&(0|g)==(0|e))))do{h=0|Be(0|(h=0|De(0|h,0|d,1,0)),0|E(),0|o,0|s),d=0|E(),f=(0|(g=0|i[(v=p=r+(h<<3)|0)>>2]))==(0|t)&(0|(v=0|i[v+4>>2]))==(0|e);}while(!(!(0|g)&!(0|v)|f));if(h=a+(h<<2)|0,f&&(0|i[h>>2])<=(0|A))return D=u,0|(v=0);if(i[(v=p)>>2]=t,i[v+4>>2]=e,i[h>>2]=A,(0|A)>=(0|n))return D=u,0|(v=0);switch(f=A+1|0,i[l>>2]=0,0|(h=0|N(t,e,2,l,c))){case 9:m=9;break;case 0:(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f))||(m=9);}t:do{if(9==(0|m)){switch(i[l>>2]=0,0|(h=0|N(t,e,3,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,1,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,5,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,4,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,6,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}return D=u,0|(v=0)}}while(0);return D=u,0|(v=h)}function N(t,e,n,r,a){t|=0,e|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,f=0,d=0;if((n|=0)>>>0>6)return 0|(a=1);if(h=(0|i[(r|=0)>>2])%6|0,i[r>>2]=h,(0|h)>0){A=0;do{n=0|dt(n),A=A+1|0;}while((0|A)<(0|i[r>>2]))}if(h=0|ze(0|t,0|e,45),E(),(s=127&h)>>>0>121)return 0|(a=5);o=0|Bt(t,e),A=0|ze(0|t,0|e,52),E(),A&=15;t:do{if(A){for(;;){if(c=0|ze(0|t,0|e,0|(l=3*(15-A|0)|0)),E(),7==(0|(c&=7))){e=5;break}if(d=!(0|Ht(A)),A=A+-1|0,f=0|Ge(7,0,0|l),e&=~E(),t=0|Ge(0|i[(d?432:16)+(28*c|0)+(n<<2)>>2],0,0|l)|t&~f,e|=l=0|E(),!(n=0|i[(d?640:224)+(28*c|0)+(n<<2)>>2])){n=0;break t}if(!A){u=8;break t}}return 0|e}u=8;}while(0);8==(0|u)&&(t|=0|Ge(0|(d=0|i[848+(28*s|0)+(n<<2)>>2]),0,45),e=E()|-1040385&e,n=0|i[4272+(28*s|0)+(n<<2)>>2],127&~d||(d=0|Ge(0|i[848+(28*s|0)+20>>2],0,45),e=E()|-1040385&e,n=0|i[4272+(28*s|0)+20>>2],t=0|Ft(d|t,e),e=0|E(),i[r>>2]=1+(0|i[r>>2]))),c=0|ze(0|t,0|e,45),E(),c&=127;t:do{if(0|F(c)){e:do{if(1==(0|Bt(t,e))){if((0|s)!=(0|c)){if(0|j(c,0|i[7696+(28*s|0)>>2])){t=0|Gt(t,e),l=1,e=0|E();break}S(23313,22416,436,22424);}switch(0|o){case 3:t=0|Ft(t,e),e=0|E(),i[r>>2]=1+(0|i[r>>2]),l=0;break e;case 5:t=0|Gt(t,e),e=0|E(),i[r>>2]=5+(0|i[r>>2]),l=0;break e;case 0:return 0|(d=9);default:return 0|(d=1)}}else l=0;}while(0);if((0|n)>0){A=0;do{t=0|kt(t,e),e=0|E(),A=A+1|0;}while((0|A)!=(0|n))}if((0|s)!=(0|c)){if(!(0|z(c))){if(!!(0|l)|5!=(0|Bt(t,e)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&h){case 8:case 118:break t}3!=(0|Bt(t,e))&&(i[r>>2]=1+(0|i[r>>2]));}}else if((0|n)>0){A=0;do{t=0|Ft(t,e),e=0|E(),A=A+1|0;}while((0|A)!=(0|n))}}while(0);return i[r>>2]=((0|i[r>>2])+n|0)%6|0,i[(d=a)>>2]=t,i[d+4>>2]=e,0|(d=0)}function B(t,e,n,r){n|=0,r|=0;var a,o,s,A=0,l=0;for(s=D,D=D+16|0,a=s,o=s+8|0,A=(A=!(0|Nt(t|=0,e|=0)))?1:2;;){if(i[o>>2]=0,!(0|N(t,e,A,o,a))&((0|i[(l=a)>>2])==(0|n)?(0|i[l+4>>2])==(0|r):0)){t=4;break}if((A=A+1|0)>>>0>=7){A=7,t=4;break}}return 4==(0|t)?(D=s,0|A):0}function k(t,e,n,r,o,s,A){e|=0,n|=0,r|=0,o|=0,s|=0,A|=0;var l,c,u,h,f,d,p,m,g,v,_=0,y=0,x=0,b=0,M=0,w=0,S=0,T=0,C=0,R=0,P=0,L=0,O=0,I=0,q=0,U=0,N=0,B=0,k=0;if(v=D,D=D+64|0,p=v+48|0,m=v+32|0,g=v+24|0,l=v+8|0,c=v,(0|(y=0|i[(t|=0)>>2]))<=0)return D=v,0|(q=0);for(u=t+4|0,h=p+8|0,f=m+8|0,d=l+8|0,_=0,O=0;;){L=(x=0|i[u>>2])+(O<<4)|0,i[p>>2]=i[L>>2],i[p+4>>2]=i[L+4>>2],i[p+8>>2]=i[L+8>>2],i[p+12>>2]=i[L+12>>2],(0|O)==(y+-1|0)?(i[m>>2]=i[x>>2],i[m+4>>2]=i[x+4>>2],i[m+8>>2]=i[x+8>>2],i[m+12>>2]=i[x+12>>2]):(L=x+(O+1<<4)|0,i[m>>2]=i[L>>2],i[m+4>>2]=i[L+4>>2],i[m+8>>2]=i[L+8>>2],i[m+12>>2]=i[L+12>>2]),y=0|Z(p,m,r,g);t:do{if(y)x=0,_=y;else if(y=0|i[(x=g)>>2],(0|(x=0|i[x+4>>2]))>0|!(0|x)&y>>>0>0){P=0,L=0;e:for(;;){if(k=+a[p>>3],B=+((R=0|Oe(0|y,0|x,0|P,0|L))>>>0)+4294967296*+(0|E()),U=+(y>>>0)+4294967296*+(0|x),N=+(P>>>0)+4294967296*+(0|L),a[l>>3]=k*B/U+ +a[m>>3]*N/U,a[d>>3]=+a[h>>3]*B/U+ +a[f>>3]*N/U,0|(y=0|jt(l,r,c))){_=y;break}w=0|ke(0|(C=0|i[(R=c)>>2]),0|(R=0|i[R+4>>2]),0|e,0|n),b=0|E(),x=0|i[(M=y=A+(w<<3)|0)>>2],M=0|i[M+4>>2];n:do{if(!(0|x)&!(0|M))I=y,q=16;else for(S=0,T=0;;){if((0|S)>(0|n)|(0|S)==(0|n)&T>>>0>e>>>0){_=1;break e}if((0|x)==(0|C)&(0|M)==(0|R))break n;if(w=0|Be(0|(y=0|De(0|w,0|b,1,0)),0|E(),0|e,0|n),b=0|E(),T=0|De(0|T,0|S,1,0),S=0|E(),!(0|(x=0|i[(M=y=A+(w<<3)|0)>>2]))&!(0|(M=0|i[M+4>>2]))){I=y,q=16;break}}}while(0);if(16!=(0|q)||(q=0,!(0|C)&!(0|R))||(i[(T=I)>>2]=C,i[T+4>>2]=R,T=s+(i[o>>2]<<3)|0,i[T>>2]=C,i[T+4>>2]=R,T=0|De(0|i[(T=o)>>2],0|i[T+4>>2],1,0),C=0|E(),i[(R=o)>>2]=T,i[R+4>>2]=C),P=0|De(0|P,0|L,1,0),L=0|E(),y=0|i[(x=g)>>2],!((0|(x=0|i[x+4>>2]))>(0|L)|(0|x)==(0|L)&y>>>0>P>>>0)){x=1;break t}}x=0;}else x=1;}while(0);if(O=O+1|0,!x){q=21;break}if((0|O)>=(0|(y=0|i[t>>2]))){_=0,q=21;break}}return 21==(0|q)?(D=v,0|_):0}function F(t){return (t|=0)>>>0>121?0|(t=0):0|(t=0|i[7696+(28*t|0)+16>>2])}function z(t){return 4==(0|(t|=0))|117==(0|t)}function G(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)>>2]}function H(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)+4>>2]}function j(t,e){return e|=0,(0|i[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|i[7696+(28*t|0)+24>>2])==(0|e))}function V(t,e){return 0|i[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function W(t,e){return e|=0,(0|i[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|i[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|i[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|i[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|i[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|i[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|i[848+(28*t|0)+24>>2])==(0|e)?6:7)}function X(t){return +a[(t|=0)+16>>3]<+a[t+24>>3]|0}function Q(t,e){t|=0;var n,r,i=0;return (i=+a[(e|=0)>>3])>=+a[t+8>>3]&&i<=+a[t>>3]?(n=+a[t+16>>3],i=+a[t+24>>3],e=(r=+a[e+8>>3])>=i,t=r<=n&1,n<i?e&&(t=1):e||(t=0),0|(e=!!(0|t))):0|(e=0)}function Y(t,e,n){t|=0,e|=0,n|=0;var r,s,c,u,h,f,d,p=0,m=0,g=0,v=0,y=0,b=0,M=0;f=D,D=D+288|0,h=f+264|0,v=f+96|0,m=(p=g=f)+96|0;do{i[p>>2]=0,p=p+4|0;}while((0|p)<(0|m));return 0|(e=0|Yt(e,g))?(D=f,0|(b=e)):(Xt(g=0|i[(m=g)>>2],m=0|i[m+4>>2],h),Qt(g,m,v),u=+te(h,v+8|0),a[h>>3]=+a[t>>3],a[(m=h+8|0)>>3]=+a[t+16>>3],a[v>>3]=+a[t+8>>3],a[(g=v+8|0)>>3]=+a[t+24>>3],s=+te(h,v),M=+a[m>>3]-+a[g>>3],c=+l(+M),d=+a[h>>3]-+a[v>>3],r=+l(+d),!(0==M|0==d)&&(M=+He(+c,+r),M=+_(+s*s/+je(+M/+je(+c,+r),3)/(u*(2.59807621135*u)*.8)),a[o>>3]=M,y=~~M>>>0,b=+l(M)>=1?M>0?~~+x(+A(M/4294967296),4294967295)>>>0:~~+_((M-+(~~M>>>0))/4294967296)>>>0:0,2146435072&~i[o+4>>2])?(v=!(0|y)&!(0|b),i[(e=n)>>2]=v?1:y,i[e+4>>2]=v?0:b,e=0):e=1,D=f,0|(b=e))}function Z(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var s,c,u,h,f=0,d=0,p=0;h=D,D=D+288|0,c=h+264|0,u=h+96|0,s=(f=d=h)+96|0;do{i[f>>2]=0,f=f+4|0;}while((0|f)<(0|s));return 0|(n=0|Yt(n,d))?(D=h,0|(r=n)):(Xt(f=0|i[(n=d)>>2],n=0|i[n+4>>2],c),Qt(f,n,u),p=+te(c,u+8|0),p=+_(+ +te(t,e)/(2*p)),a[o>>3]=p,n=~~p>>>0,f=+l(p)>=1?p>0?~~+x(+A(p/4294967296),4294967295)>>>0:~~+_((p-+(~~p>>>0))/4294967296)>>>0:0,2146435072&~i[o+4>>2]?(d=!(0|n)&!(0|f),i[r>>2]=d?1:n,i[r+4>>2]=d?0:f,D=h,0|(r=0)):(D=h,0|(r=1)))}function K(t,e,n,r){e|=0,n|=0,r|=0,i[(t|=0)>>2]=e,i[t+4>>2]=n,i[t+8>>2]=r;}function J(t,e){t|=0;var n,r,o,s,A=0,c=0,u=0,h=0,f=0,d=0,p=0;i[(s=(e|=0)+8|0)>>2]=0,r=+a[t>>3],h=+l(+r),o=+a[t+8>>3],h+=.5*(f=+l(+o)/.8660254037844386),h-=+(0|(A=~~h)),f-=+(0|(t=~~f));do{if(h<.5){if(h<.3333333333333333){if(i[e>>2]=A,f<.5*(h+1)){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(t=(1&!(f<(p=1-h)))+t|0,i[e+4>>2]=t,p<=f&f<2*h){A=A+1|0,i[e>>2]=A;break}i[e>>2]=A;break}if(!(h<.6666666666666666)){if(A=A+1|0,i[e>>2]=A,f<.5*h){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(f<1-h){if(i[e+4>>2]=t,2*h-1<f){i[e>>2]=A;break}}else t=t+1|0,i[e+4>>2]=t;A=A+1|0,i[e>>2]=A;}while(0);do{if(r<0){if(1&t){A=~~(+(0|A)-(2*(+((d=0|Oe(0|A,((0|A)<0)<<31>>31,0|(d=(t+1|0)/2|0),((0|d)<0)<<31>>31))>>>0)+4294967296*+(0|E()))+1)),i[e>>2]=A;break}A=~~(+(0|A)-2*(+((d=0|Oe(0|A,((0|A)<0)<<31>>31,0|(d=(0|t)/2|0),((0|d)<0)<<31>>31))>>>0)+4294967296*+(0|E()))),i[e>>2]=A;break}}while(0);d=e+4|0,o<0&&(A=A-((1|t<<1)/2|0)|0,i[e>>2]=A,t=0-t|0,i[d>>2]=t),c=t-A|0,(0|A)<0?(u=0-A|0,i[d>>2]=c,i[s>>2]=u,i[e>>2]=0,t=c,A=0):u=0,(0|t)<0&&(A=A-t|0,i[e>>2]=A,u=u-t|0,i[s>>2]=u,i[d>>2]=0,t=0),n=A-u|0,c=t-u|0,(0|u)<0&&(i[e>>2]=n,i[d>>2]=c,i[s>>2]=0,t=c,A=n,u=0),(0|(c=(0|u)<(0|(c=(0|t)<(0|A)?t:A))?u:c))<=0||(i[e>>2]=A-c,i[d>>2]=t-c,i[s>>2]=u-c);}function $(t){var e,n=0,r=0,a=0,o=0,s=0;n=0|i[(t|=0)>>2],r=0|i[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,i[e>>2]=r,i[(s=t+8|0)>>2]=(0|i[s>>2])-n,i[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,i[t>>2]=n,o=(0|i[(s=t+8|0)>>2])-r|0,i[s>>2]=o,i[e>>2]=0,r=0):(s=o=t+8|0,o=0|i[o>>2]),(0|o)<0&&(n=n-o|0,i[t>>2]=n,r=r-o|0,i[e>>2]=r,i[s>>2]=0,o=0),(0|(a=(0|o)<(0|(a=(0|r)<(0|n)?r:n))?o:a))<=0||(i[t>>2]=n-a,i[e>>2]=r-a,i[s>>2]=o-a);}function tt(t,e){e|=0;var n,r;r=0|i[(t|=0)+8>>2],n=+((0|i[t+4>>2])-r|0),a[e>>3]=+((0|i[t>>2])-r|0)-.5*n,a[e+8>>3]=.8660254037844386*n;}function et(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[e>>2])+(0|i[t>>2]),i[n+4>>2]=(0|i[e+4>>2])+(0|i[t+4>>2]),i[n+8>>2]=(0|i[e+8>>2])+(0|i[t+8>>2]);}function nt(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[t>>2])-(0|i[e>>2]),i[n+4>>2]=(0|i[t+4>>2])-(0|i[e+4>>2]),i[n+8>>2]=(0|i[t+8>>2])-(0|i[e+8>>2]);}function rt(t,e){e|=0;var n,r=0;r=0|y(0|i[(t|=0)>>2],e),i[t>>2]=r,n=0|y(0|i[(r=t+4|0)>>2],e),i[r>>2]=n,e=0|y(0|i[(t=t+8|0)>>2],e),i[t>>2]=e;}function it(t){var e,n,r=0,a=0,o=0,s=0,A=0;A=(0|(n=0|i[(t|=0)>>2]))<0,t=(t=(a=(0|(s=((e=(0|(o=(0|i[t+4>>2])-(A?n:0)|0))<0)?0-o|0:0)+((0|i[t+8>>2])-(A?n:0))|0))<0)?0:s)-((o=(0|(a=(0|t)<(0|(a=(0|(r=(e?0:o)-(a?s:0)|0))<(0|(s=(A?0:n)-(e?o:0)-(a?s:0)|0))?r:s))?t:a))>0)?a:0)|0,r=r-(o?a:0)|0;t:do{switch(s-(o?a:0)|0){case 0:switch(0|r){case 0:return 0|(A=0|t?1==(0|t)?1:7:0);case 1:return 0|(A=0|t?1==(0|t)?3:7:2);default:break t}case 1:switch(0|r){case 0:return 0|(A=0|t?1==(0|t)?5:7:4);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(A=7)}function at(t){var e,n=0,r=0,a=0,o=0,s=0,A=0;o=0|i[(e=(t|=0)+8|0)>>2],s=(0|i[t>>2])-o|0,o=(0|i[(A=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(A=1);if((2147483647-(s<<1)|0)<(0|s))return 0|(A=1)}else {if((-2147483648-s|0)>(0|s))return 0|(A=1);if((-2147483648-(s<<1)|0)>(0|s))return 0|(A=1)}if(n=3*s|0,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(A=1)}else if((-2147483648-o|0)>(0|o))return 0|(A=1);if(a=o<<1,(0|s)>-1){if((-2147483648|n)>=(0|o))return 0|(A=1)}else if((-2147483648^n)<(0|o))return 0|(A=1);if(r){if(!((2147483647-s|0)<(0|a))){r=a;break}return 0|(n=1)}if(!((-2147483648-s|0)>(0|a))){r=a;break}return 0|(n=1)}r=o<<1,n=3*s|0;}while(0);a=0|Ce(+(n-o|0)/7),i[t>>2]=a,o=0|Ce(+(r+s|0)/7),i[A>>2]=o,i[e>>2]=0,n=(r=(0|o)<(0|a))?a:o,r=r?o:a;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;S(23313,22444,355,22455);}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&S(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n)<(0|r))break;S(23313,22444,355,22455);}else {if((-2147483648^n)>=(0|r))break;S(23313,22444,355,22455);}}}while(0);return n=o-a|0,(0|a)<0?(r=0-a|0,i[A>>2]=n,i[e>>2]=r,i[t>>2]=0,a=0):(n=o,r=0),(0|n)<0&&(a=a-n|0,i[t>>2]=a,r=r-n|0,i[e>>2]=r,i[A>>2]=0,n=0),s=a-r|0,o=n-r|0,(0|r)<0?(i[t>>2]=s,i[A>>2]=o,i[e>>2]=0,n=o,o=s,r=0):o=a,(0|(a=(0|r)<(0|(a=(0|n)<(0|o)?n:o))?r:a))<=0||(i[t>>2]=o-a,i[A>>2]=n-a,i[e>>2]=r-a),0|(A=0)}function ot(t){var e,n=0,r=0,a=0,o=0,s=0,A=0;o=0|i[(e=(t|=0)+8|0)>>2],s=(0|i[t>>2])-o|0,o=(0|i[(A=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(A=1)}else if((-2147483648-s|0)>(0|s))return 0|(A=1);if(n=s<<1,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(A=1);if((2147483647-(o<<1)|0)<(0|o))return 0|(A=1)}else {if((-2147483648-o|0)>(0|o))return 0|(A=1);if((-2147483648-(o<<1)|0)>(0|o))return 0|(A=1)}if(a=3*o|0,r){if((2147483647-n|0)<(0|o))return 0|(A=1)}else if((-2147483648-n|0)>(0|o))return 0|(A=1);if((0|o)>-1){if((-2147483648|a)<(0|s)){r=a;break}return 0|(n=1)}if(!((-2147483648^a)<(0|s))){r=a;break}return 0|(n=1)}r=3*o|0,n=s<<1;}while(0);a=0|Ce(+(n+o|0)/7),i[t>>2]=a,o=0|Ce(+(r-s|0)/7),i[A>>2]=o,i[e>>2]=0,n=(r=(0|o)<(0|a))?a:o,r=r?o:a;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;S(23313,22444,404,22469);}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&S(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n)<(0|r))break;S(23313,22444,404,22469);}else {if((-2147483648^n)>=(0|r))break;S(23313,22444,404,22469);}}}while(0);return n=o-a|0,(0|a)<0?(r=0-a|0,i[A>>2]=n,i[e>>2]=r,i[t>>2]=0,a=0):(n=o,r=0),(0|n)<0&&(a=a-n|0,i[t>>2]=a,r=r-n|0,i[e>>2]=r,i[A>>2]=0,n=0),s=a-r|0,o=n-r|0,(0|r)<0?(i[t>>2]=s,i[A>>2]=o,i[e>>2]=0,n=o,o=s,r=0):o=a,(0|(a=(0|r)<(0|(a=(0|n)<(0|o)?n:o))?r:a))<=0||(i[t>>2]=o-a,i[A>>2]=n-a,i[e>>2]=r-a),0|(A=0)}function st(t){var e,n,r=0,a=0,o=0,s=0,A=0;a=0|i[(e=(t|=0)+8|0)>>2],o=0|Ce(+((3*(r=(0|i[t>>2])-a|0)|0)-(a=(0|i[(n=t+4|0)>>2])-a|0)|0)/7),i[t>>2]=o,r=0|Ce(+((a<<1)+r|0)/7),i[n>>2]=r,i[e>>2]=0,a=r-o|0,(0|o)<0?(A=0-o|0,i[n>>2]=a,i[e>>2]=A,i[t>>2]=0,r=a,o=0,a=A):a=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,a=a-r|0,i[e>>2]=a,i[n>>2]=0,r=0),A=o-a|0,s=r-a|0,(0|a)<0?(i[t>>2]=A,i[n>>2]=s,i[e>>2]=0,r=s,s=A,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|r)<(0|s)?r:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=a-o);}function At(t){var e,n,r=0,a=0,o=0,s=0,A=0;a=0|i[(e=(t|=0)+8|0)>>2],o=0|Ce(+(((r=(0|i[t>>2])-a|0)<<1)+(a=(0|i[(n=t+4|0)>>2])-a|0)|0)/7),i[t>>2]=o,r=0|Ce(+((3*a|0)-r|0)/7),i[n>>2]=r,i[e>>2]=0,a=r-o|0,(0|o)<0?(A=0-o|0,i[n>>2]=a,i[e>>2]=A,i[t>>2]=0,r=a,o=0,a=A):a=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,a=a-r|0,i[e>>2]=a,i[n>>2]=0,r=0),A=o-a|0,s=r-a|0,(0|a)<0?(i[t>>2]=A,i[n>>2]=s,i[e>>2]=0,r=s,s=A,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|r)<(0|s)?r:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=a-o);}function lt(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],A=o+(3*a|0)|0,i[t>>2]=A,o=s+(3*o|0)|0,i[n>>2]=o,a=(3*s|0)+a|0,i[r>>2]=a,s=o-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=s,i[r>>2]=a,i[t>>2]=0,o=s,s=0):s=A,(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o);}function ct(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=(3*(a=0|i[(n=t+4|0)>>2])|0)+A|0,A=(o=0|i[(r=t+8|0)>>2])+(3*A|0)|0,i[t>>2]=A,i[n>>2]=s,a=(3*o|0)+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,A=0):o=s,(0|o)<0&&(A=A-o|0,i[t>>2]=A,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=A-a|0,s=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|s)<(0|A)?s:A))?a:o))<=0||(i[t>>2]=A-o,i[n>>2]=s-o,i[r>>2]=a-o);}function ut(t,e){t|=0;var n,r,a,o=0,s=0,A=0;((e|=0)+-1|0)>>>0>=6||(A=(0|i[15440+(12*e|0)>>2])+(0|i[t>>2])|0,i[t>>2]=A,a=t+4|0,s=(0|i[15440+(12*e|0)+4>>2])+(0|i[a>>2])|0,i[a>>2]=s,r=t+8|0,e=(0|i[15440+(12*e|0)+8>>2])+(0|i[r>>2])|0,i[r>>2]=e,o=s-A|0,(0|A)<0?(e=e-A|0,i[a>>2]=o,i[r>>2]=e,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,e=e-o|0,i[r>>2]=e,i[a>>2]=0,o=0),n=s-e|0,A=o-e|0,(0|e)<0?(i[t>>2]=n,i[a>>2]=A,i[r>>2]=0,s=n,e=0):A=o,(0|(o=(0|e)<(0|(o=(0|A)<(0|s)?A:s))?e:o))<=0||(i[t>>2]=s-o,i[a>>2]=A-o,i[r>>2]=e-o));}function ht(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=(a=0|i[(n=t+4|0)>>2])+A|0,A=(o=0|i[(r=t+8|0)>>2])+A|0,i[t>>2]=A,i[n>>2]=s,a=o+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o);}function ft(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],s=0|i[(n=t+4|0)>>2],o=0|i[(r=t+8|0)>>2],A=s+a|0,i[t>>2]=A,s=o+s|0,i[n>>2]=s,a=o+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o);}function dt(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1;}return 0|t}function pt(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1;}return 0|t}function mt(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],A=o+(a<<1)|0,i[t>>2]=A,o=s+(o<<1)|0,i[n>>2]=o,a=(s<<1)+a|0,i[r>>2]=a,s=o-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=s,i[r>>2]=a,i[t>>2]=0,o=s,s=0):s=A,(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o);}function gt(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=((a=0|i[(n=t+4|0)>>2])<<1)+A|0,A=(o=0|i[(r=t+8|0)>>2])+(A<<1)|0,i[t>>2]=A,i[n>>2]=s,a=(o<<1)+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,A=0):o=s,(0|o)<0&&(A=A-o|0,i[t>>2]=A,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=A-a|0,s=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|s)<(0|A)?s:A))?a:o))<=0||(i[t>>2]=A-o,i[n>>2]=s-o,i[r>>2]=a-o);}function vt(t,e){e|=0;var n,r,a,o=0,s=0,A=0;return a=(0|(r=(0|i[(t|=0)>>2])-(0|i[e>>2])|0))<0,n=(0|(s=(0|i[t+4>>2])-(0|i[e+4>>2])-(a?r:0)|0))<0,e=(e=(t=(0|(A=(a?0-r|0:0)+(0|i[t+8>>2])-(0|i[e+8>>2])+(n?0-s|0:0)|0))<0)?0:A)-((s=(0|(t=(0|e)<(0|(t=(0|(o=(n?0:s)-(t?A:0)|0))<(0|(A=(a?0:r)-(n?s:0)-(t?A:0)|0))?o:A))?e:t))>0)?t:0)|0,o=o-(s?t:0)|0,0|((0|(t=(0|(t=A-(s?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(o=(0|o)>-1?o:0-o|0))>(0|(e=(0|e)>-1?e:0-e|0))?o:e))?t:e)}function _t(t,e){e|=0;var n;n=0|i[(t|=0)+8>>2],i[e>>2]=(0|i[t>>2])-n,i[e+4>>2]=(0|i[t+4>>2])-n;}function yt(t,e){e|=0;var n,r,a,o=0,s=0,A=0;s=0|i[(t|=0)>>2],i[e>>2]=s,A=0|i[t+4>>2],i[(r=e+4|0)>>2]=A,i[(a=e+8|0)>>2]=0,t=(o=(0|A)<(0|s))?s:A,o=o?A:s;do{if((0|o)<0){if((0|t)>0){if((-2147483648|t)<(0|o)&-2147483648!=(0|o)&(2147483647-t|0)>=(0|o))break;return 0|(t=1)}if(-2147483648==(0|o)|(-2147483648-t|0)>(0|o))return 0|(e=1);if((0|t)>-1){if((-2147483648|t)<(0|o))break;return 0|(t=1)}if(!((-2147483648^t)<(0|o)))break;return 0|(t=1)}}while(0);return t=A-s|0,(0|s)<0?(o=0-s|0,i[r>>2]=t,i[a>>2]=o,i[e>>2]=0,s=0):(t=A,o=0),(0|t)<0&&(s=s-t|0,i[e>>2]=s,o=o-t|0,i[a>>2]=o,i[r>>2]=0,t=0),n=s-o|0,A=t-o|0,(0|o)<0?(i[e>>2]=n,i[r>>2]=A,i[a>>2]=0,t=A,A=n,o=0):A=s,(0|(s=(0|o)<(0|(s=(0|t)<(0|A)?t:A))?o:s))<=0||(i[e>>2]=A-s,i[r>>2]=t-s,i[a>>2]=o-s),0|(e=0)}function xt(t){var e,n,r,a;n=(a=0|i[(e=(t|=0)+8|0)>>2])-(0|i[t>>2])|0,i[t>>2]=n,t=(0|i[(r=t+4|0)>>2])-a|0,i[r>>2]=t,i[e>>2]=0-(t+n);}function bt(t){var e,n,r=0,a=0,o=0,s=0,A=0;r=0-(a=0|i[(t|=0)>>2])|0,i[t>>2]=r,i[(e=t+8|0)>>2]=0,s=(o=0|i[(n=t+4|0)>>2])+a|0,(0|a)>0?(i[n>>2]=s,i[e>>2]=a,i[t>>2]=0,r=0,o=s):a=0,(0|o)<0?(A=r-o|0,i[t>>2]=A,a=a-o|0,i[e>>2]=a,i[n>>2]=0,s=A-a|0,r=0-a|0,(0|a)<0?(i[t>>2]=s,i[n>>2]=r,i[e>>2]=0,o=r,a=0):(o=0,s=A)):s=r,(0|(r=(0|a)<(0|(r=(0|o)<(0|s)?o:s))?a:r))<=0||(i[t>>2]=s-r,i[n>>2]=o-r,i[e>>2]=a-r);}function Mt(t,e,n){n|=0;var r,a,o=0,s=0;return a=D,D=D+16|0,r=a,s=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(o=0|ze(0|(t|=0),0|e,56),E(),o=0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,a=0,o=0;if(o=D,D=D+16|0,a=o,r=0|Nt(t,e),(n+-1|0)>>>0>5)return D=o,0|(a=-1);if(r=!!(0|r),1==(0|n)&r)return D=o,0|(a=-1);do{if(!(0|_e(t,e,a))){if(r){r=(5+(0|i[21936+(n<<2)>>2])-(0|i[a>>2])|0)%5|0;break}r=(6+(0|i[21968+(n<<2)>>2])-(0|i[a>>2])|0)%6|0;break}r=-1;}while(0);return a=r,D=o,0|a}(t,s,7&o),-1==(0|o)?(i[n>>2]=0,D=a,0|(s=6)):(0|Wt(t,s,r)&&S(23313,22484,282,22499),e=0|ze(0|t,0|e,52),E(),e&=15,0|Nt(t,s)?Tt(r,e,o,2,n):Lt(r,e,o,2,n),D=a,0|(s=0))):(D=a,0|(s=6))}function wt(t,e,n,r){e|=0,r|=0;var o,s=0,A=0,l=0,c=0;if(o=D,D=D+16|0,function(t,e,n){t|=0,e|=0,n|=0;var r=0,o=0,s=0;s=D,D=D+32|0,o=s,function(t,e){t|=0,e|=0;var n=0,r=0,i=0;n=+a[t>>3],r=+h(+n),n=+f(+n),a[e+16>>3]=n,n=+a[t+8>>3],i=r*+h(+n),a[e>>3]=i,n=r*+f(+n),a[e+8>>3]=n;}(t,o),i[e>>2]=0,a[n>>3]=5,r=+ve(16400,o),r<+a[n>>3]&&(i[e>>2]=0,a[n>>3]=r);r=+ve(16424,o),r<+a[n>>3]&&(i[e>>2]=1,a[n>>3]=r);r=+ve(16448,o),r<+a[n>>3]&&(i[e>>2]=2,a[n>>3]=r);r=+ve(16472,o),r<+a[n>>3]&&(i[e>>2]=3,a[n>>3]=r);r=+ve(16496,o),r<+a[n>>3]&&(i[e>>2]=4,a[n>>3]=r);r=+ve(16520,o),r<+a[n>>3]&&(i[e>>2]=5,a[n>>3]=r);r=+ve(16544,o),r<+a[n>>3]&&(i[e>>2]=6,a[n>>3]=r);r=+ve(16568,o),r<+a[n>>3]&&(i[e>>2]=7,a[n>>3]=r);r=+ve(16592,o),r<+a[n>>3]&&(i[e>>2]=8,a[n>>3]=r);r=+ve(16616,o),r<+a[n>>3]&&(i[e>>2]=9,a[n>>3]=r);r=+ve(16640,o),r<+a[n>>3]&&(i[e>>2]=10,a[n>>3]=r);r=+ve(16664,o),r<+a[n>>3]&&(i[e>>2]=11,a[n>>3]=r);r=+ve(16688,o),r<+a[n>>3]&&(i[e>>2]=12,a[n>>3]=r);r=+ve(16712,o),r<+a[n>>3]&&(i[e>>2]=13,a[n>>3]=r);r=+ve(16736,o),r<+a[n>>3]&&(i[e>>2]=14,a[n>>3]=r);r=+ve(16760,o),r<+a[n>>3]&&(i[e>>2]=15,a[n>>3]=r);r=+ve(16784,o),r<+a[n>>3]&&(i[e>>2]=16,a[n>>3]=r);r=+ve(16808,o),r<+a[n>>3]&&(i[e>>2]=17,a[n>>3]=r);r=+ve(16832,o),r<+a[n>>3]&&(i[e>>2]=18,a[n>>3]=r);if(r=+ve(16856,o),!(r<+a[n>>3]))return void(D=s);i[e>>2]=19,a[n>>3]=r,D=s;}(t|=0,n|=0,c=o),(A=+p(+(1-.5*+a[c>>3])))<1e-16)return i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,void(D=o);if(c=0|i[n>>2],s=+Jt((s=+a[15920+(24*c|0)>>3])-+Jt(+function(t,e){t|=0,e|=0;var n=0,r=0,i=0,o=0,s=0;return o=+a[e>>3],r=+h(+o),i=+a[e+8>>3]-+a[t+8>>3],s=r*+f(+i),n=+a[t>>3],+ +v(+s,+(+f(+o)*+h(+n)-+h(+i)*(r*+f(+n))))}(15600+(c<<4)|0,t))),l=0|Ht(e)?+Jt(s+-.3334731722518321):s,s=+d(+A)/.381966011250105,(0|e)>0){t=0;do{s*=2.6457513110645907,t=t+1|0;}while((0|t)!=(0|e))}A=+h(+l)*s,a[r>>3]=A,l=+f(+l)*s,a[r+8>>3]=l,D=o;}function Et(t,e,n,r,o){e|=0,n|=0,r|=0,o|=0;var s=0,A=0;if(s=+function(t){t|=0;var e=0,n=0;return n=+a[t>>3],e=+a[t+8>>3],+ +c(+(n*n+e*e))}(t|=0),s<1e-16)return e=15600+(e<<4)|0,i[o>>2]=i[e>>2],i[o+4>>2]=i[e+4>>2],i[o+8>>2]=i[e+8>>2],void(i[o+12>>2]=i[e+12>>2]);if(A=+v(+ +a[t+8>>3],+ +a[t>>3]),(0|n)>0){t=0;do{s/=2.6457513110645907,t=t+1|0;}while((0|t)!=(0|n))}r?(s/=3,n=!(0|Ht(n)),s=+g(.381966011250105*(n?s:s/2.6457513110645907))):(s=+g(.381966011250105*s),0|Ht(n)&&(A=+Jt(A+.3334731722518321))),function(t,e,n,r){t|=0,e=+e,n=+n,r|=0;var o=0,s=0,A=0,c=0;if(n<1e-16)return i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],void(i[r+12>>2]=i[t+12>>2]);s=e<0?e+6.283185307179586:e,s=e>=6.283185307179586?s+-6.283185307179586:s;do{if(!(s<1e-16)){if(o=+l(+(s+-3.141592653589793))<1e-16,e=+a[t>>3],o){e-=n,a[r>>3]=e,o=r;break}if(A=+h(+n),n=+f(+n),e=A*+f(+e)+ +h(+s)*(n*+h(+e)),e=+m(+((e=e>1?1:e)<-1?-1:e)),a[r>>3]=e,+l(+(e+-1.5707963267948966))<1e-16)return a[r>>3]=1.5707963267948966,void(a[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return a[r>>3]=-1.5707963267948966,void(a[r+8>>3]=0);if(c=+h(+e),s=n*+f(+s)/c,n=+a[t>>3],e=(A-+f(+e)*+f(+n))/+h(+n)/c,A=s>1?1:s,e=e>1?1:e,(e=+a[t+8>>3]+ +v(+(A<-1?-1:A),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586;}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586;}while(e<-3.141592653589793);return void(a[r+8>>3]=e)}e=+a[t>>3]+n,a[r>>3]=e,o=r;}while(0);if(+l(+(e+-1.5707963267948966))<1e-16)return a[o>>3]=1.5707963267948966,void(a[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return a[o>>3]=-1.5707963267948966,void(a[r+8>>3]=0);if(e=+a[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586;}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586;}while(e<-3.141592653589793);a[r+8>>3]=e;}(15600+(e<<4)|0,+Jt(+a[15920+(24*e|0)>>3]-A),s,o);}function St(t,e,n){e|=0,n|=0;var r,a;r=D,D=D+16|0,tt((t|=0)+4|0,a=r),Et(a,0|i[t>>2],e,0,n),D=r;}function Tt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,A,l,c,u,h,f,d,p,m,g,v,_,y,x,b,M,w,E,T,C,R,P=0,L=0,O=0,I=0,q=0,U=0;if(R=D,D=D+272|0,I=R+240|0,E=R,T=R+224|0,C=R+208|0,g=R+176|0,v=R+160|0,_=R+192|0,y=R+144|0,x=R+128|0,b=R+112|0,M=R+96|0,w=R+80|0,i[(P=R+256|0)>>2]=e,i[I>>2]=i[t>>2],i[I+4>>2]=i[t+4>>2],i[I+8>>2]=i[t+8>>2],i[I+12>>2]=i[t+12>>2],Ct(I,P,E),i[o>>2]=0,(0|(I=r+n+(5==(0|r)&1)|0))<=(0|n))D=R;else {A=T+4|0,l=g+4|0,c=n+5|0,u=16880+((s=0|i[P>>2])<<2)|0,h=16960+(s<<2)|0,f=x+8|0,d=b+8|0,p=M+8|0,m=C+4|0,O=n;t:for(;;){L=E+((0|O)%5<<4)|0,i[C>>2]=i[L>>2],i[C+4>>2]=i[L+4>>2],i[C+8>>2]=i[L+8>>2],i[C+12>>2]=i[L+12>>2];do{}while(2==(0|Rt(C,s,0,1)));if((0|O)>(0|n)&!!(0|Ht(e))){if(i[g>>2]=i[C>>2],i[g+4>>2]=i[C+4>>2],i[g+8>>2]=i[C+8>>2],i[g+12>>2]=i[C+12>>2],tt(A,v),r=0|i[g>>2],P=0|i[17040+(80*r|0)+(i[T>>2]<<2)>>2],i[g>>2]=i[18640+(80*r|0)+(20*P|0)>>2],(0|(L=0|i[18640+(80*r|0)+(20*P|0)+16>>2]))>0){t=0;do{ht(l),t=t+1|0;}while((0|t)<(0|L))}switch(L=18640+(80*r|0)+(20*P|0)+4|0,i[_>>2]=i[L>>2],i[_+4>>2]=i[L+4>>2],i[_+8>>2]=i[L+8>>2],rt(_,3*(0|i[u>>2])|0),et(l,_,l),$(l),tt(l,y),q=+(0|i[h>>2]),a[x>>3]=3*q,a[f>>3]=0,U=-1.5*q,a[b>>3]=U,a[d>>3]=2.598076211353316*q,a[M>>3]=U,a[p>>3]=-2.598076211353316*q,0|i[17040+(80*(0|i[g>>2])|0)+(i[C>>2]<<2)>>2]){case 1:t=b,r=x;break;case 3:t=M,r=b;break;case 2:t=x,r=M;break;default:t=12;break t}me(v,y,r,t,w),Et(w,0|i[g>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2]);}if((0|O)<(0|c)&&(tt(m,g),Et(g,0|i[C>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])),i[T>>2]=i[C>>2],i[T+4>>2]=i[C+4>>2],i[T+8>>2]=i[C+8>>2],i[T+12>>2]=i[C+12>>2],(0|(O=O+1|0))>=(0|I)){t=3;break}}3!=(0|t)?12==(0|t)&&S(22522,22569,571,22579):D=R;}}function Ct(t,e,n){t|=0,e|=0,n|=0;var r,a=0,o=0,s=0,A=0,l=0;r=D,D=D+128|0,o=r,A=20240,l=(s=a=r+64|0)+60|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0;}while((0|s)<(0|l));A=20304,l=(s=o)+60|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0;}while((0|s)<(0|l));a=(l=!(0|Ht(0|i[e>>2])))?a:o,mt(o=t+4|0),gt(o),0|Ht(0|i[e>>2])&&(ct(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],et(o,a,e=n+4|0),$(e),i[n+16>>2]=i[t>>2],et(o,a+12|0,e=n+20|0),$(e),i[n+32>>2]=i[t>>2],et(o,a+24|0,e=n+36|0),$(e),i[n+48>>2]=i[t>>2],et(o,a+36|0,e=n+52|0),$(e),i[n+64>>2]=i[t>>2],et(o,a+48|0,n=n+68|0),$(n),D=r;}function Rt(t,e,n,r){n|=0,r|=0;var a,o,s,A,l,c,u=0,h=0,f=0,d=0,p=0;if(c=D,D=D+32|0,l=c+12|0,o=c,p=(t|=0)+4|0,d=0|i[16960+((e|=0)<<2)>>2],d=(A=!!(0|r))?3*d|0:d,u=0|i[p>>2],a=0|i[(s=t+8|0)>>2],A){if((0|(u=a+u+(r=0|i[(h=t+12|0)>>2])|0))==(0|d))return D=c,0|(p=1);f=h;}else u=a+u+(r=0|i[(f=t+12|0)>>2])|0;if((0|u)<=(0|d))return D=c,0|(p=0);do{if((0|r)>0){if(r=0|i[t>>2],(0|a)>0){h=18640+(80*r|0)+60|0,r=t;break}r=18640+(80*r|0)+40|0,n?(K(l,d,0,0),nt(p,l,o),ft(o),et(o,l,p),h=r,r=t):(h=r,r=t);}else h=18640+(80*(0|i[t>>2])|0)+20|0,r=t;}while(0);if(i[r>>2]=i[h>>2],(0|i[(u=h+16|0)>>2])>0){r=0;do{ht(p),r=r+1|0;}while((0|r)<(0|i[u>>2]))}return t=h+4|0,i[l>>2]=i[t>>2],i[l+4>>2]=i[t+4>>2],i[l+8>>2]=i[t+8>>2],e=0|i[16880+(e<<2)>>2],rt(l,A?3*e|0:e),et(p,l,p),$(p),r=A&&((0|i[s>>2])+(0|i[p>>2])+(0|i[f>>2])|0)==(0|d)?1:2,D=c,0|(p=r)}function Pt(t,e){t|=0,e|=0;var n=0;do{n=0|Rt(t,e,0,1);}while(2==(0|n));return 0|n}function Lt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,A,l,c,u,h,f,d,p,m,g,v,_,y,x,b,M,w,E=0,T=0,C=0,R=0,P=0;if(w=D,D=D+240|0,y=w+208|0,x=w,b=w+192|0,M=w+176|0,p=w+160|0,m=w+144|0,g=w+128|0,v=w+112|0,_=w+96|0,i[(E=w+224|0)>>2]=e,i[y>>2]=i[t>>2],i[y+4>>2]=i[t+4>>2],i[y+8>>2]=i[t+8>>2],i[y+12>>2]=i[t+12>>2],Dt(y,E,x),i[o>>2]=0,(0|(d=r+n+(6==(0|r)&1)|0))<=(0|n))D=w;else {A=n+6|0,l=16960+((s=0|i[E>>2])<<2)|0,c=m+8|0,u=g+8|0,h=v+8|0,f=b+4|0,T=0,C=n,r=-1;t:for(;;){if(t=x+((E=(0|C)%6|0)<<4)|0,i[b>>2]=i[t>>2],i[b+4>>2]=i[t+4>>2],i[b+8>>2]=i[t+8>>2],i[b+12>>2]=i[t+12>>2],t=T,T=0|Rt(b,s,0,1),(0|C)>(0|n)&!!(0|Ht(e))&&(1!=(0|t)&&(0|i[b>>2])!=(0|r))){switch(tt(x+((E+5|0)%6<<4)+4|0,M),tt(x+(E<<4)+4|0,p),R=+(0|i[l>>2]),a[m>>3]=3*R,a[c>>3]=0,P=-1.5*R,a[g>>3]=P,a[u>>3]=2.598076211353316*R,a[v>>3]=P,a[h>>3]=-2.598076211353316*R,E=0|i[y>>2],0|i[17040+(80*E|0)+(((0|r)==(0|E)?i[b>>2]:r)<<2)>>2]){case 1:t=g,r=m;break;case 3:t=v,r=g;break;case 2:t=m,r=v;break;default:t=8;break t}me(M,p,r,t,_),0|ge(M,_)||0|ge(p,_)||(Et(_,0|i[y>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2]));}if((0|C)<(0|A)&&(tt(f,M),Et(M,0|i[b>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])),(0|(C=C+1|0))>=(0|d)){t=3;break}r=0|i[b>>2];}3!=(0|t)?8==(0|t)&&S(22606,22569,736,22651):D=w;}}function Dt(t,e,n){t|=0,e|=0,n|=0;var r,a=0,o=0,s=0,A=0,l=0;r=D,D=D+160|0,o=r,A=20368,l=(s=a=r+80|0)+72|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0;}while((0|s)<(0|l));A=20448,l=(s=o)+72|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0;}while((0|s)<(0|l));a=(l=!(0|Ht(0|i[e>>2])))?a:o,mt(o=t+4|0),gt(o),0|Ht(0|i[e>>2])&&(ct(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],et(o,a,e=n+4|0),$(e),i[n+16>>2]=i[t>>2],et(o,a+12|0,e=n+20|0),$(e),i[n+32>>2]=i[t>>2],et(o,a+24|0,e=n+36|0),$(e),i[n+48>>2]=i[t>>2],et(o,a+36|0,e=n+52|0),$(e),i[n+64>>2]=i[t>>2],et(o,a+48|0,e=n+68|0),$(e),i[n+80>>2]=i[t>>2],et(o,a+60|0,n=n+84|0),$(n),D=r;}function Ot(t,e){return e=0|ze(0|(t|=0),0|(e|=0),45),E(),127&e}function It(t,e){var n=0,r=0,i=0,a=0,o=0,s=0;if(!(!0&134217728==(-16777216&(e|=0))))return 0|(e=0);if(o=0|ze(0|(t|=0),0|e,45),E(),(o&=127)>>>0>121)return 0|(e=0);n=0|ze(0|t,0|e,52),E(),n&=15;do{if(0|n){for(i=1,r=0;;){if(a=0|ze(0|t,0|e,3*(15-i|0)|0),E(),!!(0|(a&=7))&(1^r)){if(1==(0|a)&!!(0|F(o))){s=0,r=13;break}r=1;}if(7==(0|a)){s=0,r=13;break}if(!(i>>>0<n>>>0)){r=9;break}i=i+1|0;}if(9==(0|r)){if(15!=(0|n))break;return 0|(s=1)}if(13==(0|r))return 0|s}}while(0);for(;;){if(s=0|ze(0|t,0|e,3*(14-n|0)|0),E(),!(!0&!(7&~s))){s=0,r=13;break}if(!(n>>>0<14)){s=1,r=13;break}n=n+1|0;}return 13==(0|r)?0|s:0}function qt(t,e,n,r){n|=0,r|=0;var a=0,o=0;if(o=0|ze(0|(t|=0),0|(e|=0),52),E(),n>>>0>15)return 0|(r=4);if((0|(o&=15))<(0|n))return 0|(r=12);if((0|o)==(0|n))return i[r>>2]=t,i[r+4>>2]=e,0|(r=0);if(a=0|Ge(0|n,0,52),a|=t,t=E()|-15728641&e,(0|o)>(0|n))do{e=0|Ge(7,0,3*(14-n|0)|0),n=n+1|0,a|=e,t=E()|t;}while((0|n)<(0|o));return i[r>>2]=a,i[r+4>>2]=t,0|(r=0)}function Ut(t,e,n,r){n|=0,r|=0;var a=0,o=0,s=0;if(o=0|ze(0|(t|=0),0|(e|=0),52),E(),!((0|n)<16&(0|(o&=15))<=(0|n)))return 0|(r=4);a=n-o|0,n=0|ze(0|t,0|e,45),E();t:do{if(0|F(127&n)){e:do{if(0|o){for(n=1;!((s=0|Ge(7,0,3*(15-n|0)|0))&t)&!(E()&e);){if(!(n>>>0<o>>>0))break e;n=n+1|0;}n=0|ue(7,0,a,((0|a)<0)<<31>>31),a=0|E();break t}}while(0);n=0|De(0|(n=0|Ne(0|(n=0|ue(7,0,a,((0|a)<0)<<31>>31)),0|E(),5,0)),0|E(),-5,-1),n=0|De(0|(n=0|Ue(0|n,0|E(),6,0)),0|E(),1,0),a=0|E();}else n=0|ue(7,0,a,((0|a)<0)<<31>>31),a=0|E();}while(0);return i[(s=r)>>2]=n,i[s+4>>2]=a,0|(s=0)}function Nt(t,e){var n=0,r=0,i=0;if(i=0|ze(0|(t|=0),0|(e|=0),45),E(),!(0|F(127&i)))return 0|(i=0);i=0|ze(0|t,0|e,52),E(),i&=15;t:do{if(i)for(r=1;;){if(n=0|ze(0|t,0|e,3*(15-r|0)|0),E(),0|(n&=7))break t;if(!(r>>>0<i>>>0)){n=0;break}r=r+1|0;}else n=0;}while(0);return 0|(i=1&!(0|n))}function Bt(t,e){var n=0,r=0,i=0;if(i=0|ze(0|(t|=0),0|(e|=0),52),E(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|ze(0|t,0|e,3*(15-r|0)|0),E(),0|(n&=7)){r=5;break}if(!(r>>>0<i>>>0)){n=0,r=5;break}r=r+1|0;}return 5==(0|r)?0|n:0}function kt(t,e){var n=0,r=0,i=0,a=0,o=0,s=0,A=0;if(A=0|ze(0|(t|=0),0|(e|=0),52),E(),!(A&=15))return A=t,w(0|(s=e)),0|A;for(s=1,n=0;;){r=0|Ge(7,0,0|(a=3*(15-s|0)|0)),i=0|E(),o=0|ze(0|t,0|e,0|a),E(),t=(a=0|Ge(0|dt(7&o),0,0|a))|t&~r,e=(o=0|E())|e&~i;t:do{if(!n)if(!(a&r)&!(o&i))n=0;else if(r=0|ze(0|t,0|e,52),E(),r&=15){n=1;e:for(;;){switch(o=0|ze(0|t,0|e,3*(15-n|0)|0),E(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0;}for(n=1;;){if(i=0|ze(0|t,0|e,0|(o=3*(15-n|0)|0)),E(),a=0|Ge(7,0,0|o),e&=~E(),t=t&~a|(o=0|Ge(0|dt(7&i),0,0|o)),e|=E(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0;}}else n=1;}while(0);if(!(s>>>0<A>>>0))break;s=s+1|0;}return w(0|e),0|t}function Ft(t,e){var n=0,r=0,i=0,a=0,o=0;if(r=0|ze(0|(t|=0),0|(e|=0),52),E(),!(r&=15))return r=t,w(0|(n=e)),0|r;for(n=1;o=0|ze(0|t,0|e,0|(a=3*(15-n|0)|0)),E(),i=0|Ge(7,0,0|a),e&=~E(),t=(a=0|Ge(0|dt(7&o),0,0|a))|t&~i,e=E()|e,n>>>0<r>>>0;)n=n+1|0;return w(0|e),0|t}function zt(t,e){var n=0,r=0,i=0,a=0,o=0,s=0,A=0;if(A=0|ze(0|(t|=0),0|(e|=0),52),E(),!(A&=15))return A=t,w(0|(s=e)),0|A;for(s=1,n=0;;){r=0|Ge(7,0,0|(a=3*(15-s|0)|0)),i=0|E(),o=0|ze(0|t,0|e,0|a),E(),t=(a=0|Ge(0|pt(7&o),0,0|a))|t&~r,e=(o=0|E())|e&~i;t:do{if(!n)if(!(a&r)&!(o&i))n=0;else if(r=0|ze(0|t,0|e,52),E(),r&=15){n=1;e:for(;;){switch(o=0|ze(0|t,0|e,3*(15-n|0)|0),E(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0;}for(n=1;;){if(a=0|Ge(7,0,0|(i=3*(15-n|0)|0)),o=e&~E(),e=0|ze(0|t,0|e,0|i),E(),t=t&~a|(e=0|Ge(0|pt(7&e),0,0|i)),e=o|E(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0;}}else n=1;}while(0);if(!(s>>>0<A>>>0))break;s=s+1|0;}return w(0|e),0|t}function Gt(t,e){var n=0,r=0,i=0,a=0,o=0;if(r=0|ze(0|(t|=0),0|(e|=0),52),E(),!(r&=15))return r=t,w(0|(n=e)),0|r;for(n=1;a=0|Ge(7,0,0|(o=3*(15-n|0)|0)),i=e&~E(),e=0|ze(0|t,0|e,0|o),E(),t=(e=0|Ge(0|pt(7&e),0,0|o))|t&~a,e=E()|i,n>>>0<r>>>0;)n=n+1|0;return w(0|e),0|t}function Ht(t){return (0|(t|=0))%2|0}function jt(t,e,n){n|=0;var r,a=0;return r=D,D=D+16|0,a=r,(e|=0)>>>0>15?(D=r,0|(a=4)):2146435072&~i[(t|=0)+4>>2]&&2146435072&~i[t+8+4>>2]?(function(t,e,n){var r,i;r=D,D=D+16|0,wt(t|=0,e|=0,n|=0,i=r),J(i,n+4|0),D=r;}(t,e,a),e=0|function(t,e){t|=0;var n,r=0,a=0,o=0,s=0,A=0,l=0,c=0,u=0;if(n=D,D=D+64|0,l=n+40|0,a=n+24|0,o=n+12|0,s=n,Ge(0|(e|=0),0,52),r=134225919|E(),!e)return (0|i[t+4>>2])>2||(0|i[t+8>>2])>2||(0|i[t+12>>2])>2?(l=0,w(0|(A=0)),D=n,0|l):(Ge(0|G(t),0,45),A=E()|r,l=-1,w(0|A),D=n,0|l);if(i[l>>2]=i[t>>2],i[l+4>>2]=i[t+4>>2],i[l+8>>2]=i[t+8>>2],i[l+12>>2]=i[t+12>>2],A=l+4|0,(0|e)>0)for(t=-1;i[a>>2]=i[A>>2],i[a+4>>2]=i[A+4>>2],i[a+8>>2]=i[A+8>>2],1&e?(st(A),i[o>>2]=i[A>>2],i[o+4>>2]=i[A+4>>2],i[o+8>>2]=i[A+8>>2],lt(o)):(At(A),i[o>>2]=i[A>>2],i[o+4>>2]=i[A+4>>2],i[o+8>>2]=i[A+8>>2],ct(o)),nt(a,o,s),$(s),c=0|Ge(7,0,0|(u=3*(15-e|0)|0)),r&=~E(),t=(u=0|Ge(0|it(s),0,0|u))|t&~c,r=E()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|i[A>>2])<=2&&(0|i[l+8>>2])<=2&&(0|i[l+12>>2])<=2){if(e=0|Ge(0|(a=0|G(l)),0,45),e|=t,t=E()|-1040385&r,s=0|H(l),!(0|F(a))){if((0|s)<=0)break;for(o=0;;){if(a=0|ze(0|e,0|t,52),E(),a&=15)for(r=1;l=0|ze(0|e,0|t,0|(u=3*(15-r|0)|0)),E(),c=0|Ge(7,0,0|u),t&=~E(),e=e&~c|(u=0|Ge(0|dt(7&l),0,0|u)),t|=E(),r>>>0<a>>>0;)r=r+1|0;if((0|(o=o+1|0))==(0|s))break t}}o=0|ze(0|e,0|t,52),E(),o&=15;e:do{if(o){r=1;n:for(;;){switch(u=0|ze(0|e,0|t,3*(15-r|0)|0),E(),7&u){case 1:break n;case 0:break;default:break e}if(!(r>>>0<o>>>0))break e;r=r+1|0;}if(0|j(a,0|i[l>>2]))for(r=1;c=0|Ge(7,0,0|(l=3*(15-r|0)|0)),u=t&~E(),t=0|ze(0|e,0|t,0|l),E(),e=e&~c|(t=0|Ge(0|pt(7&t),0,0|l)),t=u|E(),r>>>0<o>>>0;)r=r+1|0;else for(r=1;l=0|ze(0|e,0|t,0|(u=3*(15-r|0)|0)),E(),c=0|Ge(7,0,0|u),t&=~E(),e=e&~c|(u=0|Ge(0|dt(7&l),0,0|u)),t|=E(),r>>>0<o>>>0;)r=r+1|0;}}while(0);if((0|s)>0){r=0;do{e=0|kt(e,t),t=0|E(),r=r+1|0;}while((0|r)!=(0|s))}}else e=0,t=0;}while(0);return u=e,w(0|(c=t)),D=n,0|u}(a,e),a=0|E(),i[n>>2]=e,i[n+4>>2]=a,!(0|e)&!(0|a)&&S(23313,22674,786,22697),D=r,0|(a=0)):(D=r,0|(a=3))}function Vt(t,e,n){var r,a=0,o=0,s=0;if(r=(n|=0)+4|0,o=0|ze(0|(t|=0),0|(e|=0),52),E(),o&=15,s=0|ze(0|t,0|e,45),E(),a=!(0|o),0|F(127&s)){if(a)return 0|(s=1);a=1;}else {if(a)return 0|(s=0);a=0|i[r>>2]||0|i[n+8>>2]?1:1&!!(0|i[n+12>>2]);}for(n=1;1&n?lt(r):ct(r),s=0|ze(0|t,0|e,3*(15-n|0)|0),E(),ut(r,7&s),n>>>0<o>>>0;)n=n+1|0;return 0|a}function Wt(t,e,n){n|=0;var r,a,o=0,s=0,A=0,l=0,c=0,u=0;if(a=D,D=D+16|0,r=a,u=0|ze(0|(t|=0),0|(e|=0),45),E(),(u&=127)>>>0>121)return i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,i[n+12>>2]=0,D=a,0|(u=5);t:do{if(0|F(u)&&(A=0|ze(0|t,0|e,52),E(),0|(A&=15))){o=1;e:for(;;){switch(c=0|ze(0|t,0|e,3*(15-o|0)|0),E(),7&c){case 5:break e;case 0:break;default:o=e;break t}if(!(o>>>0<A>>>0)){o=e;break t}o=o+1|0;}for(s=1,o=e;l=0|Ge(7,0,0|(e=3*(15-s|0)|0)),c=o&~E(),o=0|ze(0|t,0|o,0|e),E(),t=t&~l|(o=0|Ge(0|pt(7&o),0,0|e)),o=c|E(),s>>>0<A>>>0;)s=s+1|0;}else o=e;}while(0);if(c=7696+(28*u|0)|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],i[n+12>>2]=i[c+12>>2],!(0|Vt(t,o,n)))return D=a,0|(u=0);if(l=n+4|0,i[r>>2]=i[l>>2],i[r+4>>2]=i[l+4>>2],i[r+8>>2]=i[l+8>>2],A=0|ze(0|t,0|o,52),E(),c=15&A,1&A?(ct(l),A=c+1|0):A=c,0|F(u)){t:do{if(c)for(e=1;;){if(s=0|ze(0|t,0|o,3*(15-e|0)|0),E(),0|(s&=7)){o=s;break t}if(!(e>>>0<c>>>0)){o=0;break}e=e+1|0;}else o=0;}while(0);o=4==(0|o)&1;}else o=0;if(0|Rt(n,A,o,0)){if(0|F(u))do{}while(0|Rt(n,A,0,0));(0|A)!=(0|c)&&At(l);}else (0|A)!=(0|c)&&(i[l>>2]=i[r>>2],i[l+4>>2]=i[r+4>>2],i[l+8>>2]=i[r+8>>2]);return D=a,0|(u=0)}function Xt(t,e,n){n|=0;var r,i,a=0;return i=D,D=D+16|0,0|(a=0|Wt(t|=0,e|=0,r=i))?(D=i,0|a):(a=0|ze(0|t,0|e,52),E(),St(r,15&a,n),D=i,0|(a=0))}function Qt(t,e,n){n|=0;var r,i=0,a=0,o=0;if(r=D,D=D+16|0,0|(i=0|Wt(t|=0,e|=0,o=r)))return D=r,0|(o=i);i=0|ze(0|t,0|e,45),E(),i=!(0|F(127&i)),a=0|ze(0|t,0|e,52),E(),a&=15;t:do{if(!i){if(0|a)for(i=1;;){if(!(!((0|Ge(7,0,3*(15-i|0)|0))&t)&!(E()&e)))break t;if(!(i>>>0<a>>>0))break;i=i+1|0;}return Tt(o,a,0,5,n),D=r,0|0}}while(0);return Lt(o,a,0,6,n),D=r,0|0}function Yt(t,e){e|=0;var n=0,r=0,a=0,o=0,s=0,A=0,l=0;if((t|=0)>>>0>15)return 0|(A=4);if(Ge(0|t,0,52),A=134225919|E(),!t){n=0,r=0;do{0|F(r)&&(Ge(0|r,0,45),s=A|E(),i[(t=e+(n<<3)|0)>>2]=-1,i[t+4>>2]=s,n=n+1|0),r=r+1|0;}while(122!=(0|r));return 0|(n=0)}n=0,s=0;do{if(0|F(s)){for(Ge(0|s,0,45),r=1,a=-1,o=A|E();a&=~(l=0|Ge(7,0,3*(15-r|0)|0)),o&=~E(),(0|r)!=(0|t);)r=r+1|0;i[(l=e+(n<<3)|0)>>2]=a,i[l+4>>2]=o,n=n+1|0;}s=s+1|0;}while(122!=(0|s));return 0|(n=0)}function Zt(t,e,n,r){t|=0,r|=0;var a=0,o=0;a=0|ze(0|(e|=0),0|(n|=0),52),E(),!(0|e)&!(0|n)|(0|r)>15|(0|(a&=15))>(0|r)?(r=-1,a=-1,e=0,n=0):(o=0|function(t,e,n,r){return t|=0,e|=0,(0|(r|=0))<(0|(n|=0))?(r=t,w(0|(n=e)),0|r):(n=0|Ge(-1,-1,3+(3*(r-n|0)|0)|0),r=0|Ge(0|~n,0|~E(),3*(15-r|0)|0),n=~E()&e,r=~r&t,w(0|n),0|r)}(e,n,a+1|0,r),n=-15728641&E(),e=0|Ge(0|r,0,52),r=(o=!(0|Nt(e|=o,n|=E())))?-1:r),i[(o=t)>>2]=e,i[o+4>>2]=n,i[t+8>>2]=a,i[t+12>>2]=r;}function Kt(t){var e,n=0,r=0,a=0,o=0,s=0,A=0,l=0,c=0;if(!(!(0|(n=0|i[(r=t|=0)>>2]))&!(0|(r=0|i[r+4>>2]))||(a=0|ze(0|n,0|r,52),E(),n=0|De(0|(l=0|Ge(1,0,3*(15^(a&=15))|0)),0|E(),0|n,0|r),r=0|E(),i[(l=t)>>2]=n,i[l+4>>2]=r,(0|a)<(0|(A=0|i[(l=t+8|0)>>2]))))){for(e=t+12|0,s=a;;){if((0|s)==(0|A)){a=5;break}if(c=(0|s)==(0|i[e>>2]),a=0|ze(0|n,0|r,0|(o=3*(15-s|0)|0)),E(),c&1==(0|(a&=7))&!0){a=7;break}if(!(7==(0|a)&!0)){a=10;break}if(n=0|De(0|n,0|r,0|(c=0|Ge(1,0,0|o)),0|E()),r=0|E(),i[(c=t)>>2]=n,i[c+4>>2]=r,!((0|s)>(0|A))){a=10;break}s=s+-1|0;}if(5==(0|a))return i[(c=t)>>2]=0,i[c+4>>2]=0,i[l>>2]=-1,void(i[e>>2]=-1);if(7==(0|a))return A=0|De(0|n,0|r,0|(A=0|Ge(1,0,0|o)),0|E()),l=0|E(),i[(c=t)>>2]=A,i[c+4>>2]=l,void(i[e>>2]=s+-1)}}function Jt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function $t(t,e){return e|=0,+l(+(+a[(t|=0)>>3]-+a[e>>3]))<17453292519943298e-27?0|(e=+l(+(+a[t+8>>3]-+a[e+8>>3]))<17453292519943298e-27):0|(e=0)}function te(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+f(.5*(r-n)))*i+(o=+f(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))*6371.007180918475}function ee(t,e){e|=0;var n=0;return (t|=0)>>>0>15?0|(e=4):(n=0|Ne(0|(n=0|ue(7,0,t,((0|t)<0)<<31>>31)),0|E(),120,0),t=0|E(),i[e>>2]=2|n,i[e+4>>2]=t,0|(e=0))}function ne(t,e,n){t|=0,n|=0;var r,i,o,s,A=0,l=0,u=0,p=0,m=0,_=0;return _=+a[(e|=0)>>3],o=+a[t>>3],m=+f(.5*(_-o)),u=+a[e+8>>3],i=+a[t+8>>3],p=+f(.5*(u-i)),r=+h(+o),s=+h(+_),p=2*+v(+ +c(+(p=m*m+p*(s*r*p))),+ +c(+(1-p))),m=+a[n>>3],_=+f(.5*(m-_)),A=+a[n+8>>3],u=+f(.5*(A-u)),l=+h(+m),u=2*+v(+ +c(+(u=_*_+u*(s*l*u))),+ +c(+(1-u))),m=+f(.5*(o-m)),A=+f(.5*(i-A)),A=2*+v(+ +c(+(A=m*m+A*(r*l*A))),+ +c(+(1-A))),4*+g(+ +c(+ +d(.5*(l=.5*(p+u+A)))*+d(.5*(l-p))*+d(.5*(l-u))*+d(.5*(l-A))))}function re(t,e,n){n|=0;var r,o,s,A=0,l=0;if(s=D,D=D+192|0,o=s,0|(l=0|Xt(t|=0,e|=0,r=s+168|0)))return D=s,0|(n=l);if(0|Qt(t,e,o)&&S(23313,22742,386,22751),(0|(e=0|i[o>>2]))>0){if(A=+ne(o+8|0,o+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){t=1;do{A+=+ne(o+8+((l=t)<<4)|0,o+8+((0|(t=t+1|0))%(0|e)<<4)|0,r);}while((0|t)<(0|e))}}else A=0;return a[n>>3]=A,D=s,0|(n=0)}function ie(t){t|=0;var e,n,r=0;return (e=0|Le(1,12))||S(22832,22787,49,22845),0|(r=0|i[(n=t+4|0)>>2])?(i[(r=r+8|0)>>2]=e,i[n>>2]=e,0|e):(0|i[t>>2]&&S(22862,22787,61,22885),i[(r=t)>>2]=e,i[n>>2]=e,0|e)}function ae(t,e){t|=0,e|=0;var n,r;return (r=0|Re(24))||S(22899,22787,78,22913),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[r+16>>2]=0,0|(n=0|i[(e=t+4|0)>>2])?(i[n+16>>2]=r,i[e>>2]=r,0|r):(0|i[t>>2]&&S(22928,22787,82,22913),i[t>>2]=r,i[e>>2]=r,0|r)}function oe(t){var e=0,n=0,r=0,a=0;if(t|=0)for(r=1;;){if(0|(e=0|i[t>>2]))do{if(0|(n=0|i[e>>2]))do{a=n,n=0|i[n+16>>2],Pe(a);}while(0|n);a=e,e=0|i[e+8>>2],Pe(a);}while(0|e);if(e=t,t=0|i[t+8>>2],r||Pe(e),!t)break;r=0;}}function se(t){var e,n,r=0,o=0,s=0,A=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,E=0,T=0,C=0,R=0,P=0,L=0,D=0,O=0,I=0,q=0,U=0;if(0|i[(A=(t|=0)+8|0)>>2])return 0|(U=1);if(!(s=0|i[t>>2]))return 0|(U=0);r=s,o=0;do{o=o+1|0,r=0|i[r+8>>2];}while(0|r);if(o>>>0<2)return 0|(U=0);(n=0|Re(o<<2))||S(22948,22787,317,22967),(e=0|Re(o<<5))||S(22989,22787,321,22967),i[t>>2]=0,i[(C=t+4|0)>>2]=0,i[A>>2]=0,o=0,I=0,T=0,m=0;t:for(;;){if(p=0|i[s>>2]){c=0,u=p;do{if(f=+a[u+8>>3],r=u,u=0|i[u+16>>2],h=+a[(A=(d=!(0|u))?p:u)+8>>3],+l(+(f-h))>3.141592653589793){U=14;break}c+=(h-f)*(+a[r>>3]+ +a[A>>3]);}while(!d);if(14==(0|U)){U=0,c=0,r=p;do{E=+a[r+8>>3],D=0|i[(O=r+16|0)>>2],w=+a[(D=0|D?D:p)+8>>3],c+=(+a[r>>3]+ +a[D>>3])*((w<0?w+6.283185307179586:w)-(E<0?E+6.283185307179586:E)),r=0|i[(0|r?O:s)>>2];}while(0|r)}c>0?(i[n+(I<<2)>>2]=s,I=I+1|0,A=T,r=m):U=19;}else U=19;if(19==(0|U)){U=0;do{if(!o){if(m){A=C,u=m+8|0,r=s,o=t;break}if(0|i[t>>2]){U=27;break t}A=C,u=t,r=s,o=t;break}if(0|i[(r=o+8|0)>>2]){U=21;break t}if(!(o=0|Le(1,12))){U=23;break t}i[r>>2]=o,A=o+4|0,u=o,r=m;}while(0);if(i[u>>2]=s,i[A>>2]=s,u=e+(T<<5)|0,d=0|i[s>>2]){for(a[(p=e+(T<<5)+8|0)>>3]=17976931348623157e292,a[(m=e+(T<<5)+24|0)>>3]=17976931348623157e292,a[u>>3]=-17976931348623157e292,a[(g=e+(T<<5)+16|0)>>3]=-17976931348623157e292,b=17976931348623157e292,M=-17976931348623157e292,A=0,v=d,f=17976931348623157e292,y=17976931348623157e292,x=-17976931348623157e292,h=-17976931348623157e292;c=+a[v>>3],E=+a[v+8>>3],v=0|i[v+16>>2],w=+a[((_=!(0|v))?d:v)+8>>3],c<f&&(a[p>>3]=c,f=c),E<y&&(a[m>>3]=E,y=E),c>x?a[u>>3]=c:c=x,E>h&&(a[g>>3]=E,h=E),b=E>0&E<b?E:b,M=E<0&E>M?E:M,A|=+l(+(E-w))>3.141592653589793,!_;)x=c;A&&(a[g>>3]=M,a[m>>3]=b);}else i[u>>2]=0,i[u+4>>2]=0,i[u+8>>2]=0,i[u+12>>2]=0,i[u+16>>2]=0,i[u+20>>2]=0,i[u+24>>2]=0,i[u+28>>2]=0;A=T+1|0;}if(s=0|i[(O=s+8|0)>>2],i[O>>2]=0,!s){U=45;break}T=A,m=r;}if(21==(0|U))S(22765,22787,35,22799);else if(23==(0|U))S(22819,22787,37,22799);else if(27==(0|U))S(22862,22787,61,22885);else if(45==(0|U)){t:do{if((0|I)>0){for(O=!(0|A),L=A<<2,D=!(0|t),P=0,r=0;;){if(R=0|i[n+(P<<2)>>2],O)U=73;else {if(!(T=0|Re(L))){U=50;break}if(!(C=0|Re(L))){U=52;break}e:do{if(D)o=0;else {for(A=0,o=0,u=t;s=e+(A<<5)|0,0|Ae(0|i[u>>2],s,0|i[R>>2])?(i[T+(o<<2)>>2]=u,i[C+(o<<2)>>2]=s,_=o+1|0):_=o,u=0|i[u+8>>2];)A=A+1|0,o=_;if((0|_)>0)if(s=0|i[T>>2],1==(0|_))o=s;else for(g=0,v=-1,o=s,m=s;;){for(d=0|i[m>>2],s=0,u=0;p=(0|(A=0|i[i[T+(u<<2)>>2]>>2]))==(0|d)?s:s+(1&Ae(A,0|i[C+(u<<2)>>2],0|i[d>>2]))|0,(0|(u=u+1|0))!=(0|_);)s=p;if(o=(A=(0|p)>(0|v))?m:o,(0|(s=g+1|0))==(0|_))break e;g=s,v=A?p:v,m=0|i[T+(s<<2)>>2];}else o=0;}}while(0);if(Pe(T),Pe(C),o){if(s=0|i[(A=o+4|0)>>2])o=s+8|0;else if(0|i[o>>2]){U=70;break}i[o>>2]=R,i[A>>2]=R;}else U=73;}if(73==(0|U)){if(U=0,0|(r=0|i[R>>2]))do{C=r,r=0|i[r+16>>2],Pe(C);}while(0|r);Pe(R),r=1;}if((0|(P=P+1|0))>=(0|I)){q=r;break t}}50==(0|U)?S(23004,22787,249,23023):52==(0|U)?S(23042,22787,252,23023):70==(0|U)&&S(22862,22787,61,22885);}else q=0;}while(0);return Pe(n),Pe(e),0|(U=q)}return 0}function Ae(t,e,n){t|=0;var r=0,o=0,s=0,A=0,l=0,c=0,u=0,h=0;if(!(0|Q(e|=0,n|=0)))return 0|(t=0);if(e=0|X(e),r=+a[n>>3],o=e&(o=+a[n+8>>3])<0?o+6.283185307179586:o,!(t=0|i[t>>2]))return 0|(t=0);if(e){e=0,u=o,n=t;t:for(;;){for(;A=+a[n>>3],o=+a[n+8>>3],h=0|i[(n=n+16|0)>>2],s=+a[(h=0|h?h:t)>>3],l=+a[h+8>>3],A>s?(c=A,A=l):(c=s,s=A,A=o,o=l),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(((c=(l=A<0?A+6.283185307179586:A)+(r-s)/(c-s)*((A=o<0?o+6.283185307179586:o)-l))<0?c+6.283185307179586:c)>(u=l==u|A==u?u+-2220446049250313e-31:u)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else {e=0,u=o,n=t;t:for(;;){for(;A=+a[n>>3],o=+a[n+8>>3],h=0|i[(n=n+16|0)>>2],s=+a[(h=0|h?h:t)>>3],l=+a[h+8>>3],A>s?(c=A,A=l):(c=s,s=A,A=o,o=l),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(A+(r-s)/(c-s)*(o-A)>(u=A==u|o==u?u+-2220446049250313e-31:u)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function le(t,e,n,a,o){n|=0,a|=0,o|=0;var s,A,l,c,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;if(c=D,D=D+32|0,y=c+16|0,l=c,u=0|ze(0|(t|=0),0|(e|=0),52),E(),u&=15,g=0|ze(0|n,0|a,52),E(),(0|u)!=(15&g))return D=c,0|(y=12);if(p=0|ze(0|t,0|e,45),E(),p&=127,m=0|ze(0|n,0|a,45),E(),p>>>0>121|(m&=127)>>>0>121)return D=c,0|(y=5);if(g=(0|p)!=(0|m)){if(7==(0|(f=0|W(p,m))))return D=c,0|(y=1);7==(0|(d=0|W(m,p)))?S(23066,23090,161,23100):(v=f,h=d);}else v=0,h=0;s=0|F(p),A=0|F(m),i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0;do{if(v){if(f=(0|(m=0|i[4272+(28*p|0)+(v<<2)>>2]))>0,A)if(f){p=0,d=n,f=a;do{d=0|zt(d,f),f=0|E(),1==(0|(h=0|pt(h)))&&(h=0|pt(1)),p=p+1|0;}while((0|p)!=(0|m));m=h,p=d,d=f;}else m=h,p=n,d=a;else if(f){p=0,d=n,f=a;do{d=0|Gt(d,f),f=0|E(),h=0|pt(h),p=p+1|0;}while((0|p)!=(0|m));m=h,p=d,d=f;}else m=h,p=n,d=a;if(Vt(p,d,y),g||S(23115,23090,191,23100),(f=!!(0|s))&(h=!!(0|A))&&S(23142,23090,192,23100),f){if(7==(0|(h=0|Bt(t,e)))){u=5;break}if(0|r[21872+(7*h|0)+v|0]){u=1;break}p=d=0|i[21040+(28*h|0)+(v<<2)>>2];}else if(h){if(7==(0|(h=0|Bt(p,d)))){u=5;break}if(0|r[21872+(7*h|0)+m|0]){u=1;break}p=0,d=0|i[21040+(28*m|0)+(h<<2)>>2];}else p=0,d=0;if((p|d)<0)u=5;else {if((0|d)>0){f=y+4|0,h=0;do{ft(f),h=h+1|0;}while((0|h)!=(0|d))}if(i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,ut(l,v),0|u)for(;0|Ht(u)?lt(l):ct(l),(0|u)>1;)u=u+-1|0;if((0|p)>0){u=0;do{ft(l),u=u+1|0;}while((0|u)!=(0|p))}et(_=y+4|0,l,_),$(_),_=51;}}else if(Vt(n,a,y),!!(0|s)&!!(0|A))if((0|m)!=(0|p)&&S(23173,23090,261,23100),7==(0|(h=0|Bt(t,e)))|7==(0|(u=0|Bt(n,a))))u=5;else if(0|r[21872+(7*h|0)+u|0])u=1;else if((0|(h=0|i[21040+(28*h|0)+(u<<2)>>2]))>0){f=y+4|0,u=0;do{ft(f),u=u+1|0;}while((0|u)!=(0|h));_=51;}else _=51;else _=51;}while(0);return 51==(0|_)&&(u=y+4|0,i[o>>2]=i[u>>2],i[o+4>>2]=i[u+4>>2],i[o+8>>2]=i[u+8>>2],u=0),D=c,0|(y=u)}function ce(t,e,n,r){n|=0,r|=0;var a,o,s,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;if(s=D,D=D+48|0,a=s+36|0,c=s+24|0,u=s+12|0,h=s,A=0|ze(0|(t|=0),0|(e|=0),52),E(),A&=15,d=0|ze(0|t,0|e,45),E(),(d&=127)>>>0>121)return D=s,0|(r=5);if(o=0|F(d),Ge(0|A,0,52),g=134225919|E(),i[(l=r)>>2]=-1,i[l+4>>2]=g,!A)return 7==(0|(A=0|it(n)))||127==(0|(A=0|V(d,A)))?(D=s,0|(g=1)):(p=0|Ge(0|A,0,45),m=0|E(),m=-1040385&i[(d=r)+4>>2]|m,i[(g=r)>>2]=i[d>>2]|p,i[g+4>>2]=m,D=s,0|(g=0));for(i[a>>2]=i[n>>2],i[a+4>>2]=i[n+4>>2],i[a+8>>2]=i[n+8>>2],n=A;;){if(l=n,n=n+-1|0,i[c>>2]=i[a>>2],i[c+4>>2]=i[a+4>>2],i[c+8>>2]=i[a+8>>2],0|Ht(l)){if(0|(A=0|at(a))){n=13;break}i[u>>2]=i[a>>2],i[u+4>>2]=i[a+4>>2],i[u+8>>2]=i[a+8>>2],lt(u);}else {if(0|(A=0|ot(a))){n=13;break}i[u>>2]=i[a>>2],i[u+4>>2]=i[a+4>>2],i[u+8>>2]=i[a+8>>2],ct(u);}if(nt(c,u,h),$(h),_=0|i[(A=r)>>2],A=0|i[A+4>>2],v=0|Ge(7,0,0|(y=3*(15-l|0)|0)),A&=~E(),y=0|Ge(0|it(h),0,0|y),A=E()|A,i[(g=r)>>2]=y|_&~v,i[g+4>>2]=A,(0|l)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|i[a>>2])<=1&&(0|i[a+4>>2])<=1&&(0|i[a+8>>2])<=1){h=127==(0|(A=0|V(d,n=0|it(a))))?0:0|F(A);e:do{if(n){if(o){if(7==(0|(A=0|Bt(t,e)))){A=5;break t}if((0|(l=0|i[21248+(28*A|0)+(n<<2)>>2]))>0){A=n,n=0;do{A=0|dt(A),n=n+1|0;}while((0|n)!=(0|l))}else A=n;if(1==(0|A)){A=9;break t}127==(0|(n=0|V(d,A)))&&S(23200,23090,411,23230),0|F(n)?S(23245,23090,412,23230):(m=n,p=l,f=A);}else m=A,p=0,f=n;if((0|(u=0|i[4272+(28*d|0)+(f<<2)>>2]))<=-1&&S(23276,23090,419,23230),!h){if((0|p)<0){A=5;break t}if(0|p){A=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];do{n=0|Ft(n,l),l=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=l,A=A+1|0;}while((0|A)<(0|p))}if((0|u)<=0){A=m,n=58;break}for(A=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];;)if(n=0|Ft(n,l),l=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=l,(0|(A=A+1|0))==(0|u)){A=m,n=58;break e}}if(7==(0|(c=0|W(m,d)))&&S(23066,23090,428,23230),n=0|i[(A=r)>>2],A=0|i[A+4>>2],(0|u)>0){l=0;do{n=0|Ft(n,A),A=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=A,l=l+1|0;}while((0|l)!=(0|u))}if(7==(0|(A=0|Bt(n,A)))&&S(23313,23090,440,23230),n=0|z(m),(0|(n=0|i[(n?21664:21456)+(28*c|0)+(A<<2)>>2]))<0&&S(23313,23090,454,23230),n){A=0,l=0|i[(c=r)>>2],c=0|i[c+4>>2];do{l=0|kt(l,c),c=0|E(),i[(y=r)>>2]=l,i[y+4>>2]=c,A=A+1|0;}while((0|A)<(0|n));A=m,n=58;}else A=m,n=58;}else if(!!(0|o)&!!(0|h)){if(7==(0|(n=0|Bt(t,e)))|7==(0|(l=0|Bt(0|i[(l=r)>>2],0|i[l+4>>2])))){A=5;break t}if((0|(l=0|i[21248+(28*n|0)+(l<<2)>>2]))<0){A=5;break t}if(l){n=0,c=0|i[(u=r)>>2],u=0|i[u+4>>2];do{c=0|Ft(c,u),u=0|E(),i[(y=r)>>2]=c,i[y+4>>2]=u,n=n+1|0;}while((0|n)<(0|l));n=58;}else n=59;}else n=58;}while(0);if(58==(0|n)&&h&&(n=59),59==(0|n)&&1==(0|Bt(0|i[(y=r)>>2],0|i[y+4>>2]))){A=9;break}v=0|i[(y=r)>>2],y=-1040385&i[y+4>>2],_=0|Ge(0|A,0,45),y|=E(),i[(A=r)>>2]=v|_,i[A+4>>2]=y,A=0;}else A=1;}while(0);return D=s,0|(y=A)}function ue(t,e,n,r){t|=0,e|=0;var i=0,a=0,o=0;if(!(0|(n|=0))&!(0|(r|=0)))return a=1,w(0|(i=0)),0|a;a=t,i=e,t=1,e=0;do{t=0|Ne(0|((o=!0&!(1&n))?1:a),0|(o?0:i),0|t,0|e),e=0|E(),n=0|Fe(0|n,0|r,1),r=0|E(),a=0|Ne(0|a,0|i,0|a,0|i),i=0|E();}while(!(!(0|n)&!(0|r)));return w(0|e),0|t}function he(t,e,n){t|=0;var r,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0;if(!(0|Q(e|=0,n|=0)))return 0|(d=0);if(e=0|X(e),o=+a[n>>3],s=e&(s=+a[n+8>>3])<0?s+6.283185307179586:s,(0|(d=0|i[t>>2]))<=0)return 0|(d=0);if(r=0|i[t+4>>2],e){e=0,f=s,n=-1,t=0;t:for(;;){for(h=t;l=+a[r+(h<<4)>>3],s=+a[r+(h<<4)+8>>3],A=+a[r+((t=(n+2|0)%(0|d)|0)<<4)>>3],c=+a[r+(t<<4)+8>>3],l>A?(u=l,l=c):(u=A,A=l,l=s,s=c),(o=o==A|o==u?o+2220446049250313e-31:o)<A|o>u;){if((0|(n=h+1|0))>=(0|d)){n=22;break t}t=h,h=n,n=t;}if(((u=(c=l<0?l+6.283185307179586:l)+(o-A)/(u-A)*((l=s<0?s+6.283185307179586:s)-c))<0?u+6.283185307179586:u)>(f=c==f|l==f?f+-2220446049250313e-31:f)&&(e^=1),(0|(t=h+1|0))>=(0|d)){n=22;break}n=h;}if(22==(0|n))return 0|e}else {e=0,f=s,n=-1,t=0;t:for(;;){for(h=t;l=+a[r+(h<<4)>>3],s=+a[r+(h<<4)+8>>3],A=+a[r+((t=(n+2|0)%(0|d)|0)<<4)>>3],c=+a[r+(t<<4)+8>>3],l>A?(u=l,l=c):(u=A,A=l,l=s,s=c),(o=o==A|o==u?o+2220446049250313e-31:o)<A|o>u;){if((0|(n=h+1|0))>=(0|d)){n=22;break t}t=h,h=n,n=t;}if(l+(o-A)/(u-A)*(s-l)>(f=l==f|s==f?f+-2220446049250313e-31:f)&&(e^=1),(0|(t=h+1|0))>=(0|d)){n=22;break}n=h;}if(22==(0|n))return 0|e}return 0}function fe(t,e){e|=0;var n,r,o,s,A,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0;if(!(r=0|i[(t|=0)>>2]))return i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,void(i[e+28>>2]=0);if(a[(o=e+8|0)>>3]=17976931348623157e292,a[(s=e+24|0)>>3]=17976931348623157e292,a[e>>3]=-17976931348623157e292,a[(A=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[t+4>>2],g=17976931348623157e292,v=-17976931348623157e292,_=0,t=-1,f=17976931348623157e292,d=17976931348623157e292,m=-17976931348623157e292,u=-17976931348623157e292,y=0;c=+a[n+(y<<4)>>3],p=+a[n+(y<<4)+8>>3],h=+a[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],c<f&&(a[o>>3]=c,f=c),p<d&&(a[s>>3]=p,d=p),c>m?a[e>>3]=c:c=m,p>u&&(a[A>>3]=p,u=p),g=p>0&p<g?p:g,v=p<0&p>v?p:v,_|=+l(+(p-h))>3.141592653589793,(0|(t=y+1|0))!=(0|r);)x=y,m=c,y=t,t=x;_&&(a[A>>3]=v,a[s>>3]=g);}}function de(t,e){e|=0;var n,r=0,o=0,s=0,A=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,E=0,S=0;if(v=0|i[(t|=0)>>2]){if(a[(_=e+8|0)>>3]=17976931348623157e292,a[(y=e+24|0)>>3]=17976931348623157e292,a[e>>3]=-17976931348623157e292,a[(x=e+16|0)>>3]=-17976931348623157e292,(0|v)>0){for(s=0|i[t+4>>2],m=17976931348623157e292,g=-17976931348623157e292,o=0,r=-1,h=17976931348623157e292,f=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292,b=0;A=+a[s+(b<<4)>>3],d=+a[s+(b<<4)+8>>3],u=+a[s+(((0|(E=r+2|0))==(0|v)?0:E)<<4)+8>>3],A<h&&(a[_>>3]=A,h=A),d<f&&(a[y>>3]=d,f=d),A>p?a[e>>3]=A:A=p,d>c&&(a[x>>3]=d,c=d),m=d>0&d<m?d:m,g=d<0&d>g?d:g,o|=+l(+(d-u))>3.141592653589793,(0|(r=b+1|0))!=(0|v);)E=b,p=A,b=r,r=E;o&&(a[x>>3]=g,a[y>>3]=m);}}else i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,i[e+28>>2]=0;if(!((0|(r=0|i[(E=t+8|0)>>2]))<=0)){n=t+12|0,w=0;do{if(s=0|i[n>>2],o=w,y=e+((w=w+1|0)<<5)|0,x=0|i[s+(o<<3)>>2]){if(a[(b=e+(w<<5)+8|0)>>3]=17976931348623157e292,a[(t=e+(w<<5)+24|0)>>3]=17976931348623157e292,a[y>>3]=-17976931348623157e292,a[(M=e+(w<<5)+16|0)>>3]=-17976931348623157e292,(0|x)>0){for(v=0|i[s+(o<<3)+4>>2],m=17976931348623157e292,g=-17976931348623157e292,s=0,o=-1,_=0,h=17976931348623157e292,f=17976931348623157e292,d=-17976931348623157e292,c=-17976931348623157e292;A=+a[v+(_<<4)>>3],p=+a[v+(_<<4)+8>>3],u=+a[v+(((0|(o=o+2|0))==(0|x)?0:o)<<4)+8>>3],A<h&&(a[b>>3]=A,h=A),p<f&&(a[t>>3]=p,f=p),A>d?a[y>>3]=A:A=d,p>c&&(a[M>>3]=p,c=p),m=p>0&p<m?p:m,g=p<0&p>g?p:g,s|=+l(+(p-u))>3.141592653589793,(0|(o=_+1|0))!=(0|x);)S=_,_=o,d=A,o=S;s&&(a[M>>3]=g,a[t>>3]=m);}}else i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0,i[y+16>>2]=0,i[y+20>>2]=0,i[y+24>>2]=0,i[y+28>>2]=0,r=0|i[E>>2];}while((0|w)<(0|r))}}function pe(t,e,n){var r=0,a=0,o=0;if(!(0|he(t|=0,e|=0,n|=0)))return 0|(a=0);if((0|i[(a=t+8|0)>>2])<=0)return 0|(a=1);for(r=t+12|0,t=0;;){if(o=t,t=t+1|0,0|he((0|i[r>>2])+(o<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|i[a>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function me(t,e,n,r,i){e|=0,n|=0,r|=0,i|=0;var o,s,A,l,c,u,h,f=0;l=+a[(t|=0)>>3],A=+a[e>>3]-l,s=+a[t+8>>3],o=+a[e+8>>3]-s,u=+a[n>>3],f=((f=+a[r>>3]-u)*(s-(h=+a[n+8>>3]))-(l-u)*(c=+a[r+8>>3]-h))/(A*c-o*f),a[i>>3]=l+A*f,a[i+8>>3]=s+o*f;}function ge(t,e){return e|=0,+l(+(+a[(t|=0)>>3]-+a[e>>3]))<1.1920928955078125e-7?0|(e=+l(+(+a[t+8>>3]-+a[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function ve(t,e){e|=0;var n,r,i;return +((i=+a[(t|=0)>>3]-+a[e>>3])*i+(r=+a[t+8>>3]-+a[e+8>>3])*r+(n=+a[t+16>>3]-+a[e+16>>3])*n)}function _e(t,e,n){n|=0;var r,a,o,s,A=0,l=0,c=0;if(s=D,D=D+32|0,c=s,0|(A=0|Wt(t|=0,e|=0,a=s+16|0)))return D=s,0|(n=A);r=0|Ot(t,e),o=0|Bt(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,i[(e|=0)>>2]=i[t>>2],i[e+4>>2]=i[t+4>>2],i[e+8>>2]=i[t+8>>2],i[e+12>>2]=i[t+12>>2];}(r,c),A=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return -1;do{if((0|i[11120+(216*e|0)>>2])!=(0|t))if((0|i[11120+(216*e|0)+8>>2])!=(0|t))if((0|i[11120+(216*e|0)+16>>2])!=(0|t))if((0|i[11120+(216*e|0)+24>>2])!=(0|t))if((0|i[11120+(216*e|0)+32>>2])!=(0|t))if((0|i[11120+(216*e|0)+40>>2])!=(0|t))if((0|i[11120+(216*e|0)+48>>2])!=(0|t))if((0|i[11120+(216*e|0)+56>>2])!=(0|t))if((0|i[11120+(216*e|0)+64>>2])!=(0|t))if((0|i[11120+(216*e|0)+72>>2])!=(0|t))if((0|i[11120+(216*e|0)+80>>2])!=(0|t))if((0|i[11120+(216*e|0)+88>>2])!=(0|t))if((0|i[11120+(216*e|0)+96>>2])!=(0|t))if((0|i[11120+(216*e|0)+104>>2])!=(0|t))if((0|i[11120+(216*e|0)+112>>2])!=(0|t))if((0|i[11120+(216*e|0)+120>>2])!=(0|t))if((0|i[11120+(216*e|0)+128>>2])!=(0|t)){if((0|i[11120+(216*e|0)+136>>2])!=(0|t)){if((0|i[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|i[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|i[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|i[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|i[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|i[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|i[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|i[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|i[11120+(216*e|0)+208>>2])==(0|t)){t=2,n=2,r=2;break}return -1}t=2,n=1,r=2;}else t=2,n=1,r=1;else t=2,n=1,r=0;else t=1,n=1,r=2;else t=1,n=1,r=1;else t=1,n=1,r=0;else t=0,n=1,r=2;else t=0,n=1,r=1;else t=0,n=1,r=0;else t=2,n=0,r=2;else t=2,n=0,r=1;else t=2,n=0,r=0;else t=1,n=0,r=2;else t=1,n=0,r=1;else t=1,n=0,r=0;else t=0,n=0,r=2;else t=0,n=0,r=1;else t=0,n=0,r=0;}while(0);return 0|i[11120+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2]}(r,0|i[a>>2]);t:do{if(0|F(r)){switch(0|r){case 4:t=0;break;case 14:t=1;break;case 24:t=2;break;case 38:t=3;break;case 49:t=4;break;case 58:t=5;break;case 63:t=6;break;case 72:t=7;break;case 83:t=8;break;case 97:t=9;break;case 107:t=10;break;case 117:t=11;break;default:A=1;break t}if(l=0|i[22e3+(24*t|0)+8>>2],e=0|i[22e3+(24*t|0)+16>>2],(0|(t=0|i[a>>2]))!=(0|i[c>>2])&&(c=0|z(r))|(0|(t=0|i[a>>2]))==(0|e)&&(A=(A+1|0)%6|0),3==(0|o)&(0|t)==(0|e)){A=(A+5|0)%6|0,l=22;break}5==(0|o)&(0|t)==(0|l)?(A=(A+1|0)%6|0,l=22):l=22;}else l=22;}while(0);return 22==(0|l)&&(i[n>>2]=A,A=0),D=s,0|(n=A)}function ye(t,e,n,r){n|=0,r|=0;var a,o,s,A,l,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;if(l=D,D=D+32|0,y=l+24|0,A=l+20|0,s=l+8|0,o=l+16|0,a=l,d=(d=!(0|Nt(t|=0,e|=0)))?6:5,m=0|ze(0|t,0|e,52),E(),d>>>0<=n>>>0)return D=l,0|(r=2);!(g=!(0|(m&=15)))&&!((v=0|Ge(7,0,3*(15^m)|0))&t)&!(E()&e)?c=n:u=4;t:do{if(4==(0|u)){if((0|((c=!!(0|Nt(t,e)))?4:5))<(0|n))return D=l,0|(r=1);if(0|_e(t,e,y))return D=l,0|(r=1);if(u=(0|i[y>>2])+n|0,7==(0|(v=0|i[(c=c?22288+((0|u)%5<<2)|0:22320+((0|u)%6<<2)|0)>>2])))return D=l,0|(r=1);i[A>>2]=0,c=0|N(t,e,v,A,s);do{if(!c){if(p=0|i[(f=s)>>2],u=(h=(f=0|i[f+4>>2])>>>0<e>>>0|(0|f)==(0|e)&p>>>0<t>>>0)?p:t,h=h?f:e,!g&&!(p&(g=0|Ge(7,0,3*(15^m)|0)))&!(f&E()))c=n;else {if(f=(n+-1+d|0)%(0|d)|0,c=0|Nt(t,e),(0|f)<0&&S(23313,23315,245,23324),(0|((d=!!(0|c))?4:5))<(0|f)&&S(23313,23315,245,23324),0|_e(t,e,y)&&S(23313,23315,245,23324),c=(0|i[y>>2])+f|0,7==(0|(f=0|i[(c=d?22288+((0|c)%5<<2)|0:22320+((0|c)%6<<2)|0)>>2]))&&S(23313,23315,245,23324),i[o>>2]=0,0|(c=0|N(t,e,f,o,a)))break;d=0|i[(p=a)>>2],p=0|i[p+4>>2];do{if(p>>>0<h>>>0|(0|p)==(0|h)&d>>>0<u>>>0){if(u=0|Nt(d,p)?0|B(d,p,t,e):0|i[22384+(((0|i[o>>2])+(0|i[22352+(f<<2)>>2])|0)%6<<2)>>2],c=0|Nt(d,p),(u+-1|0)>>>0>5){c=-1,u=d,h=p;break}if(1==(0|u)&(c=!!(0|c))){c=-1,u=d,h=p;break}do{if(!(0|_e(d,p,y))){if(c){c=(5+(0|i[21936+(u<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[21968+(u<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1;}while(0);u=d,h=p;}else c=n;}while(0);p=0|i[(f=s)>>2],f=0|i[f+4>>2];}if((0|u)==(0|p)&(0|h)==(0|f)){if(t=(d=!!(0|Nt(p,f)))?0|B(p,f,t,e):0|i[22384+(((0|i[A>>2])+(0|i[22352+(v<<2)>>2])|0)%6<<2)>>2],c=0|Nt(p,f),(t+-1|0)>>>0<=5&&!(1==(0|t)&(_=!!(0|c))))do{if(!(0|_e(p,f,y))){if(_){c=(5+(0|i[21936+(t<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[21968+(t<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1;}while(0);else c=-1;c=6==(0|(c=c+1|0))|d&5==(0|c)?0:c;}e=h,t=u;break t}}while(0);return D=l,0|(r=c)}}while(0);return _=0|Ge(0|c,0,56),y=E()|-2130706433&e|536870912,i[r>>2]=_|t,i[r+4>>2]=y,D=l,0|(r=0)}function xe(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|Le(e,4),i[t>>2]=r,r||S(23337,23360,40,23374)):i[t>>2]=0,i[t+4>>2]=e,i[t+8>>2]=0,i[t+12>>2]=n;}function be(t){var e,n,r,o=0,s=0,A=0,c=0;e=(t|=0)+4|0,n=t+12|0,r=t+8|0;t:for(;;){for(s=0|i[e>>2],o=0;;){if((0|o)>=(0|s))break t;if(A=0|i[t>>2],c=0|i[A+(o<<2)>>2])break;o=o+1|0;}o=A+(~~(+l(+ +u(10,+ +(15-(0|i[n>>2])|0))*(+a[c>>3]+ +a[c+8>>3]))%+(0|s))>>>0<<2)|0,s=0|i[o>>2];e:do{if(0|s){if(A=c+32|0,(0|s)==(0|c))i[o>>2]=i[A>>2];else {if(!(o=0|i[(s=s+32|0)>>2]))break;for(;(0|o)!=(0|c);)if(!(o=0|i[(s=o+32|0)>>2]))break e;i[s>>2]=i[A>>2];}Pe(c),i[r>>2]=(0|i[r>>2])-1;}}while(0)}Pe(0|i[t>>2]);}function Me(t){var e,n=0,r=0;for(e=0|i[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|i[(0|i[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0;}return 4==(0|r)?0|n:0}function we(t,e){e|=0;var n=0,r=0,o=0,s=0;if(n=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,n=(0|i[t>>2])+(n<<2)|0,!(r=0|i[n>>2]))return 0|(s=1);s=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|i[r+32>>2]))return 0|(s=1);for(o=n;;){if((0|o)==(0|e)){o=8;break}if(!(n=0|i[o+32>>2])){n=1,o=10;break}r=o,o=n;}if(8==(0|o)){i[r+32>>2]=i[s>>2];break}if(10==(0|o))return 0|n}else i[n>>2]=i[s>>2];}while(0);return Pe(e),i[(s=t+8|0)>>2]=(0|i[s>>2])-1,0|(s=0)}function Ee(t,e,n){t|=0,e|=0,n|=0;var r,o=0,s=0,A=0;(r=0|Re(40))||S(23390,23360,98,23403),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[(s=r+16|0)>>2]=i[n>>2],i[s+4>>2]=i[n+4>>2],i[s+8>>2]=i[n+8>>2],i[s+12>>2]=i[n+12>>2],i[r+32>>2]=0,s=~~(+l(+ +u(10,+ +(15-(0|i[t+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,s=(0|i[t>>2])+(s<<2)|0,o=0|i[s>>2];do{if(o){for(;!(0|$t(o,e)&&0|$t(o+16|0,n));)if(s=0|i[o+32>>2],!(0|i[(o=0|s?s:o)+32>>2])){A=10;break}if(10==(0|A)){i[o+32>>2]=r;break}return Pe(r),0|(A=o)}i[s>>2]=r;}while(0);return i[(A=t+8|0)>>2]=1+(0|i[A>>2]),0|(A=r)}function Se(t,e,n){e|=0,n|=0;var r=0,o=0;if(o=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(o=0|i[(0|i[t>>2])+(o<<2)>>2]))return 0|(n=0);if(!n){for(t=o;;){if(0|$t(t,e)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=o;;){if(0|$t(t,e)&&0|$t(t+16|0,n)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function Te(t,e){e|=0;var n=0;if(n=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(t=0|i[(0|i[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|$t(t,e)){e=5;break}if(!(t=0|i[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Ce(t){return 0|+function(t){return + +Qe(+(t=+t))}(t=+t)}function Re(t){t|=0;var e,n=0,r=0,a=0,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0;e=D,D=D+16|0,d=e;do{if(t>>>0<245){if(t=(u=t>>>0<11?16:t+11&-8)>>>3,3&(r=(f=0|i[5857])>>>t))return a=0|i[(r=(t=23468+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|i[(o=a+8|0)>>2]))==(0|t)?i[5857]=f&~(1<<n):(i[s+12>>2]=t,i[r>>2]=s),b=n<<3,i[a+4>>2]=3|b,i[(b=a+b+4|0)>>2]=1|i[b>>2],D=e,0|(b=o);if(u>>>0>(h=0|i[5859])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,s=0|i[(t=(n=23468+((a=((r=(n>>>=l=n>>>12&16)>>>5&8)|l|(s=(n>>>=r)>>>2&4)|(t=(n>>>=s)>>>1&2)|(a=(n>>>=t)>>>1&1))+(n>>>a)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|i[(l=s+8|0)>>2]))==(0|n)?(t=f&~(1<<a),i[5857]=t):(i[r+12>>2]=n,i[t>>2]=r,t=f),A=(b=a<<3)-u|0,i[s+4>>2]=3|u,i[(o=s+u|0)+4>>2]=1|A,i[s+b>>2]=A,0|h&&(a=0|i[5862],r=23468+((n=h>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=a,i[n+12>>2]=a,i[a+8>>2]=n,i[a+12>>2]=r),i[5859]=A,i[5862]=o,D=e,0|(b=l);if(s=0|i[5858]){for(r=(s&0-s)-1|0,r=c=0|i[23732+(((a=(r>>>=o=r>>>12&16)>>>5&8)|o|(A=(r>>>=a)>>>2&4)|(l=(r>>>=A)>>>1&2)|(c=(r>>>=l)>>>1&1))+(r>>>c)<<2)>>2],l=c,c=(-8&i[c+4>>2])-u|0;(t=0|i[r+16>>2])||(t=0|i[r+20>>2]);)r=t,l=(o=(A=(-8&i[t+4>>2])-u|0)>>>0<c>>>0)?t:l,c=o?A:c;if((A=l+u|0)>>>0>l>>>0){o=0|i[l+24>>2],n=0|i[l+12>>2];do{if((0|n)==(0|l)){if(!(n=0|i[(t=l+20|0)>>2])&&!(n=0|i[(t=l+16|0)>>2])){r=0;break}for(;;)if(r=0|i[(a=n+20|0)>>2])n=r,t=a;else {if(!(r=0|i[(a=n+16|0)>>2]))break;n=r,t=a;}i[t>>2]=0,r=n;}else r=0|i[l+8>>2],i[r+12>>2]=n,i[n+8>>2]=r,r=n;}while(0);do{if(0|o){if(n=0|i[l+28>>2],(0|l)==(0|i[(t=23732+(n<<2)|0)>>2])){if(i[t>>2]=r,!r){i[5858]=s&~(1<<n);break}}else if(i[((0|i[(b=o+16|0)>>2])==(0|l)?b:o+20)>>2]=r,!r)break;i[r+24>>2]=o,0|(n=0|i[l+16>>2])&&(i[r+16>>2]=n,i[n+24>>2]=r),0|(n=0|i[l+20>>2])&&(i[r+20>>2]=n,i[n+24>>2]=r);}}while(0);return c>>>0<16?(b=c+u|0,i[l+4>>2]=3|b,i[(b=l+b+4|0)>>2]=1|i[b>>2]):(i[l+4>>2]=3|u,i[A+4>>2]=1|c,i[A+c>>2]=c,0|h&&(a=0|i[5862],r=23468+((n=h>>>3)<<1<<2)|0,(n=1<<n)&f?n=0|i[(t=r+8|0)>>2]:(i[5857]=n|f,n=r,t=r+8|0),i[t>>2]=a,i[n+12>>2]=a,i[a+8>>2]=n,i[a+12>>2]=r),i[5859]=c,i[5862]=A),D=e,0|(b=l+8|0)}f=u;}else f=u;}else f=u;}else if(t>>>0<=4294967231)if(u=-8&(t=t+11|0),a=0|i[5858]){o=0-u|0,c=(t>>>=8)?u>>>0>16777215?31:u>>>((c=14-((l=((g=t<<(f=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|f|(c=((g<<=l)+245760|0)>>>16&2))+(g<<c>>>15)|0)+7|0)&1|c<<1:0,r=0|i[23732+(c<<2)>>2];t:do{if(r)for(t=0,l=u<<(31==(0|c)?0:25-(c>>>1)),s=0;;){if((A=(-8&i[r+4>>2])-u|0)>>>0<o>>>0){if(!A){t=r,o=0,g=65;break t}t=r,o=A;}if(s=!(0|(g=0|i[r+20>>2]))|(0|g)==(0|(r=0|i[r+16+(l>>>31<<2)>>2]))?s:g,!r){r=s,g=61;break}l<<=1;}else r=0,t=0,g=61;}while(0);if(61==(0|g)){if(!(0|r)&!(0|t)){if(!(t=((t=2<<c)|0-t)&a)){f=u;break}f=(t&0-t)-1|0,t=0,r=0|i[23732+(((s=(f>>>=A=f>>>12&16)>>>5&8)|A|(l=(f>>>=s)>>>2&4)|(c=(f>>>=l)>>>1&2)|(r=(f>>>=c)>>>1&1))+(f>>>r)<<2)>>2];}r?g=65:(l=t,A=o);}if(65==(0|g))for(s=r;;){if(o=(r=(f=(-8&i[s+4>>2])-u|0)>>>0<o>>>0)?f:o,t=r?s:t,(r=0|i[s+16>>2])||(r=0|i[s+20>>2]),!r){l=t,A=o;break}s=r;}if(0|l&&A>>>0<((0|i[5859])-u|0)>>>0&&(h=l+u|0)>>>0>l>>>0){s=0|i[l+24>>2],n=0|i[l+12>>2];do{if((0|n)==(0|l)){if(!(n=0|i[(t=l+20|0)>>2])&&!(n=0|i[(t=l+16|0)>>2])){n=0;break}for(;;)if(r=0|i[(o=n+20|0)>>2])n=r,t=o;else {if(!(r=0|i[(o=n+16|0)>>2]))break;n=r,t=o;}i[t>>2]=0;}else b=0|i[l+8>>2],i[b+12>>2]=n,i[n+8>>2]=b;}while(0);do{if(s){if(t=0|i[l+28>>2],(0|l)==(0|i[(r=23732+(t<<2)|0)>>2])){if(i[r>>2]=n,!n){a&=~(1<<t),i[5858]=a;break}}else if(i[((0|i[(b=s+16|0)>>2])==(0|l)?b:s+20)>>2]=n,!n)break;i[n+24>>2]=s,0|(t=0|i[l+16>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),(t=0|i[l+20>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n);}}while(0);t:do{if(A>>>0<16)b=A+u|0,i[l+4>>2]=3|b,i[(b=l+b+4|0)>>2]=1|i[b>>2];else {if(i[l+4>>2]=3|u,i[h+4>>2]=1|A,i[h+A>>2]=A,n=A>>>3,A>>>0<256){r=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=h,i[n+12>>2]=h,i[h+8>>2]=n,i[h+12>>2]=r;break}if(n=23732+((r=(n=A>>>8)?A>>>0>16777215?31:A>>>((r=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(r=((b<<=y)+245760|0)>>>16&2))+(b<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[h+28>>2]=r,i[(t=h+16|0)+4>>2]=0,i[t>>2]=0,!(a&(t=1<<r))){i[5858]=a|t,i[n>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break}n=0|i[n>>2];e:do{if((-8&i[n+4>>2])!=(0|A)){for(a=A<<(31==(0|r)?0:25-(r>>>1));t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|A)){n=t;break e}a<<=1,n=t;}i[r>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break t}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=h,i[x>>2]=h,i[h+8>>2]=b,i[h+12>>2]=n,i[h+24>>2]=0;}}while(0);return D=e,0|(b=l+8|0)}f=u;}else f=u;else f=-1;}while(0);if((r=0|i[5859])>>>0>=f>>>0)return n=r-f|0,t=0|i[5862],n>>>0>15?(b=t+f|0,i[5862]=b,i[5859]=n,i[b+4>>2]=1|n,i[t+r>>2]=n,i[t+4>>2]=3|f):(i[5859]=0,i[5862]=0,i[t+4>>2]=3|r,i[(b=t+r+4|0)>>2]=1|i[b>>2]),D=e,0|(b=t+8|0);if((A=0|i[5860])>>>0>f>>>0)return y=A-f|0,i[5860]=y,x=(b=0|i[5863])+f|0,i[5863]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|f,D=e,0|(b=b+8|0);if(0|i[5975]?t=0|i[5977]:(i[5977]=4096,i[5976]=4096,i[5978]=-1,i[5979]=-1,i[5980]=0,i[5968]=0,i[5975]=-16&d^1431655768,t=4096),l=f+48|0,(u=(s=t+(c=f+47|0)|0)&(o=0-t|0))>>>0<=f>>>0)return D=e,0|(b=0);if(0|(t=0|i[5967])&&(d=(h=0|i[5965])+u|0)>>>0<=h>>>0|d>>>0>t>>>0)return D=e,0|(b=0);t:do{if(4&i[5968])n=0,g=143;else {r=0|i[5863];e:do{if(r){for(a=23876;!((d=0|i[a>>2])>>>0<=r>>>0&&(d+(0|i[a+4>>2])|0)>>>0>r>>>0);){if(!(t=0|i[a+8>>2])){g=128;break e}a=t;}if((n=s-A&o)>>>0<2147483647)if((0|(t=0|Ye(0|n)))==((0|i[a>>2])+(0|i[a+4>>2])|0)){if(-1!=(0|t)){A=n,s=t,g=145;break t}}else a=t,g=136;else n=0;}else g=128;}while(0);do{if(128==(0|g))if(-1!=(0|(r=0|Ye(0)))&&(n=r,m=(n=((m=(p=0|i[5976])+-1|0)&n?(m+n&0-p)-n|0:0)+u|0)+(p=0|i[5965])|0,n>>>0>f>>>0&n>>>0<2147483647)){if(0|(d=0|i[5967])&&m>>>0<=p>>>0|m>>>0>d>>>0){n=0;break}if((0|(t=0|Ye(0|n)))==(0|r)){A=n,s=r,g=145;break t}a=t,g=136;}else n=0;}while(0);do{if(136==(0|g)){if(r=0-n|0,!(l>>>0>n>>>0&n>>>0<2147483647&-1!=(0|a))){if(-1==(0|a)){n=0;break}A=n,s=a,g=145;break t}if((t=c-n+(t=0|i[5977])&0-t)>>>0>=2147483647){A=n,s=a,g=145;break t}if(-1==(0|Ye(0|t))){Ye(0|r),n=0;break}A=t+n|0,s=a,g=145;break t}}while(0);i[5968]=4|i[5968],g=143;}}while(0);if(143==(0|g)&&u>>>0<2147483647&&!(-1==(0|(y=0|Ye(0|u)))|1^(_=(v=(m=0|Ye(0))-y|0)>>>0>(f+40|0)>>>0)|y>>>0<m>>>0&-1!=(0|y)&-1!=(0|m)^1)&&(A=_?v:n,s=y,g=145),145==(0|g)){n=(0|i[5965])+A|0,i[5965]=n,n>>>0>(0|i[5966])>>>0&&(i[5966]=n),c=0|i[5863];t:do{if(c){for(n=23876;;){if((0|s)==((t=0|i[n>>2])+(r=0|i[n+4>>2])|0)){g=154;break}if(!(a=0|i[n+8>>2]))break;n=a;}if(!(154!=(0|g)||(x=n+4|0,8&i[n+12>>2]))&&s>>>0>c>>>0&t>>>0<=c>>>0){i[x>>2]=r+A,x=c+(y=7&(y=c+8|0)?0-y&7:0)|0,y=(b=(0|i[5860])+A|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[c+b+4>>2]=40,i[5864]=i[5979];break}for(s>>>0<(0|i[5861])>>>0&&(i[5861]=s),r=s+A|0,n=23876;;){if((0|i[n>>2])==(0|r)){g=162;break}if(!(t=0|i[n+8>>2]))break;n=t;}if(162==(0|g)&&!(8&i[n+12>>2])){i[n>>2]=s,i[(h=n+4|0)>>2]=(0|i[h>>2])+A,u=(h=s+(7&(h=s+8|0)?0-h&7:0)|0)+f|0,l=(n=r+(7&(n=r+8|0)?0-n&7:0)|0)-h-f|0,i[h+4>>2]=3|f;e:do{if((0|c)==(0|n))b=(0|i[5860])+l|0,i[5860]=b,i[5863]=u,i[u+4>>2]=1|b;else {if((0|i[5862])==(0|n)){b=(0|i[5859])+l|0,i[5859]=b,i[5862]=u,i[u+4>>2]=1|b,i[u+b>>2]=b;break}if(1==(3&(t=0|i[n+4>>2]))){A=-8&t,a=t>>>3;n:do{if(t>>>0<256){if(t=0|i[n+8>>2],(0|(r=0|i[n+12>>2]))==(0|t)){i[5857]=i[5857]&~(1<<a);break}i[t+12>>2]=r,i[r+8>>2]=t;break}s=0|i[n+24>>2],t=0|i[n+12>>2];do{if((0|t)==(0|n)){if(t=0|i[(a=(r=n+16|0)+4|0)>>2])r=a;else if(!(t=0|i[r>>2])){t=0;break}for(;;)if(a=0|i[(o=t+20|0)>>2])t=a,r=o;else {if(!(a=0|i[(o=t+16|0)>>2]))break;t=a,r=o;}i[r>>2]=0;}else b=0|i[n+8>>2],i[b+12>>2]=t,i[t+8>>2]=b;}while(0);if(!s)break;a=23732+((r=0|i[n+28>>2])<<2)|0;do{if((0|i[a>>2])==(0|n)){if(i[a>>2]=t,0|t)break;i[5858]=i[5858]&~(1<<r);break n}if(i[((0|i[(b=s+16|0)>>2])==(0|n)?b:s+20)>>2]=t,!t)break n}while(0);if(i[t+24>>2]=s,0|(a=0|i[(r=n+16|0)>>2])&&(i[t+16>>2]=a,i[a+24>>2]=t),!(r=0|i[r+4>>2]))break;i[t+20>>2]=r,i[r+24>>2]=t;}while(0);n=n+A|0,o=A+l|0;}else o=l;if(i[(n=n+4|0)>>2]=-2&i[n>>2],i[u+4>>2]=1|o,i[u+o>>2]=o,n=o>>>3,o>>>0<256){r=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=u,i[n+12>>2]=u,i[u+8>>2]=n,i[u+12>>2]=r;break}n=o>>>8;do{if(n){if(o>>>0>16777215){a=31;break}a=o>>>((a=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(a=((b<<=y)+245760|0)>>>16&2))+(b<<a>>>15)|0)+7|0)&1|a<<1;}else a=0;}while(0);if(n=23732+(a<<2)|0,i[u+28>>2]=a,i[(t=u+16|0)+4>>2]=0,i[t>>2]=0,!((t=0|i[5858])&(r=1<<a))){i[5858]=t|r,i[n>>2]=u,i[u+24>>2]=n,i[u+12>>2]=u,i[u+8>>2]=u;break}n=0|i[n>>2];n:do{if((-8&i[n+4>>2])!=(0|o)){for(a=o<<(31==(0|a)?0:25-(a>>>1));t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|o)){n=t;break n}a<<=1,n=t;}i[r>>2]=u,i[u+24>>2]=n,i[u+12>>2]=u,i[u+8>>2]=u;break e}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=u,i[x>>2]=u,i[u+8>>2]=b,i[u+12>>2]=n,i[u+24>>2]=0;}}while(0);return D=e,0|(b=h+8|0)}for(n=23876;!((t=0|i[n>>2])>>>0<=c>>>0&&(b=t+(0|i[n+4>>2])|0)>>>0>c>>>0);)n=0|i[n+8>>2];n=(t=(t=(o=b+-47|0)+(7&(t=o+8|0)?0-t&7:0)|0)>>>0<(o=c+16|0)>>>0?c:t)+8|0,x=s+(y=7&(y=s+8|0)?0-y&7:0)|0,y=(r=A+-40|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[s+r+4>>2]=40,i[5864]=i[5979],i[(r=t+4|0)>>2]=27,i[n>>2]=i[5969],i[n+4>>2]=i[5970],i[n+8>>2]=i[5971],i[n+12>>2]=i[5972],i[5969]=s,i[5970]=A,i[5972]=0,i[5971]=n,n=t+24|0;do{x=n,i[(n=n+4|0)>>2]=7;}while((x+8|0)>>>0<b>>>0);if((0|t)!=(0|c)){if(s=t-c|0,i[r>>2]=-2&i[r>>2],i[c+4>>2]=1|s,i[t>>2]=s,n=s>>>3,s>>>0<256){r=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=c,i[n+12>>2]=c,i[c+8>>2]=n,i[c+12>>2]=r;break}if(r=23732+((a=(n=s>>>8)?s>>>0>16777215?31:s>>>((a=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(a=((b<<=y)+245760|0)>>>16&2))+(b<<a>>>15)|0)+7|0)&1|a<<1:0)<<2)|0,i[c+28>>2]=a,i[c+20>>2]=0,i[o>>2]=0,!((n=0|i[5858])&(t=1<<a))){i[5858]=n|t,i[r>>2]=c,i[c+24>>2]=r,i[c+12>>2]=c,i[c+8>>2]=c;break}n=0|i[r>>2];e:do{if((-8&i[n+4>>2])!=(0|s)){for(a=s<<(31==(0|a)?0:25-(a>>>1));t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|s)){n=t;break e}a<<=1,n=t;}i[r>>2]=c,i[c+24>>2]=n,i[c+12>>2]=c,i[c+8>>2]=c;break t}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=c,i[x>>2]=c,i[c+8>>2]=b,i[c+12>>2]=n,i[c+24>>2]=0;}}else !(0|(b=0|i[5861]))|s>>>0<b>>>0&&(i[5861]=s),i[5969]=s,i[5970]=A,i[5972]=0,i[5866]=i[5975],i[5865]=-1,i[5870]=23468,i[5869]=23468,i[5872]=23476,i[5871]=23476,i[5874]=23484,i[5873]=23484,i[5876]=23492,i[5875]=23492,i[5878]=23500,i[5877]=23500,i[5880]=23508,i[5879]=23508,i[5882]=23516,i[5881]=23516,i[5884]=23524,i[5883]=23524,i[5886]=23532,i[5885]=23532,i[5888]=23540,i[5887]=23540,i[5890]=23548,i[5889]=23548,i[5892]=23556,i[5891]=23556,i[5894]=23564,i[5893]=23564,i[5896]=23572,i[5895]=23572,i[5898]=23580,i[5897]=23580,i[5900]=23588,i[5899]=23588,i[5902]=23596,i[5901]=23596,i[5904]=23604,i[5903]=23604,i[5906]=23612,i[5905]=23612,i[5908]=23620,i[5907]=23620,i[5910]=23628,i[5909]=23628,i[5912]=23636,i[5911]=23636,i[5914]=23644,i[5913]=23644,i[5916]=23652,i[5915]=23652,i[5918]=23660,i[5917]=23660,i[5920]=23668,i[5919]=23668,i[5922]=23676,i[5921]=23676,i[5924]=23684,i[5923]=23684,i[5926]=23692,i[5925]=23692,i[5928]=23700,i[5927]=23700,i[5930]=23708,i[5929]=23708,i[5932]=23716,i[5931]=23716,x=s+(y=7&(y=s+8|0)?0-y&7:0)|0,y=(b=A+-40|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[s+b+4>>2]=40,i[5864]=i[5979];}while(0);if((n=0|i[5860])>>>0>f>>>0)return y=n-f|0,i[5860]=y,x=(b=0|i[5863])+f|0,i[5863]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|f,D=e,0|(b=b+8|0)}return i[(b=23424)>>2]=12,D=e,0|(b=0)}function Pe(t){var e=0,n=0,r=0,a=0,o=0,s=0,A=0,l=0;if(t|=0){n=t+-8|0,a=0|i[5861],l=n+(e=-8&(t=0|i[t+-4>>2]))|0;do{if(1&t)A=n,s=n;else {if(r=0|i[n>>2],!(3&t))return;if(o=r+e|0,(s=n+(0-r)|0)>>>0<a>>>0)return;if((0|i[5862])==(0|s)){if(3&~(e=0|i[(t=l+4|0)>>2])){A=s,e=o;break}return i[5859]=o,i[t>>2]=-2&e,i[s+4>>2]=1|o,void(i[s+o>>2]=o)}if(n=r>>>3,r>>>0<256){if(t=0|i[s+8>>2],(0|(e=0|i[s+12>>2]))==(0|t)){i[5857]=i[5857]&~(1<<n),A=s,e=o;break}i[t+12>>2]=e,i[e+8>>2]=t,A=s,e=o;break}a=0|i[s+24>>2],t=0|i[s+12>>2];do{if((0|t)==(0|s)){if(t=0|i[(n=(e=s+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){t=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else {if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r;}i[e>>2]=0;}else A=0|i[s+8>>2],i[A+12>>2]=t,i[t+8>>2]=A;}while(0);if(a){if(e=0|i[s+28>>2],(0|i[(n=23732+(e<<2)|0)>>2])==(0|s)){if(i[n>>2]=t,!t){i[5858]=i[5858]&~(1<<e),A=s,e=o;break}}else if(i[((0|i[(A=a+16|0)>>2])==(0|s)?A:a+20)>>2]=t,!t){A=s,e=o;break}i[t+24>>2]=a,0|(n=0|i[(e=s+16|0)>>2])&&(i[t+16>>2]=n,i[n+24>>2]=t),(e=0|i[e+4>>2])?(i[t+20>>2]=e,i[e+24>>2]=t,A=s,e=o):(A=s,e=o);}else A=s,e=o;}}while(0);if(!(s>>>0>=l>>>0)&&1&(r=0|i[(t=l+4|0)>>2])){if(2&r)i[t>>2]=-2&r,i[A+4>>2]=1|e,i[s+e>>2]=e,a=e;else {if((0|i[5863])==(0|l)){if(l=(0|i[5860])+e|0,i[5860]=l,i[5863]=A,i[A+4>>2]=1|l,(0|A)!=(0|i[5862]))return;return i[5862]=0,void(i[5859]=0)}if((0|i[5862])==(0|l))return l=(0|i[5859])+e|0,i[5859]=l,i[5862]=s,i[A+4>>2]=1|l,void(i[s+l>>2]=l);a=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|i[l+8>>2],(0|(t=0|i[l+12>>2]))==(0|e)){i[5857]=i[5857]&~(1<<n);break}i[e+12>>2]=t,i[t+8>>2]=e;break}o=0|i[l+24>>2],t=0|i[l+12>>2];do{if((0|t)==(0|l)){if(t=0|i[(n=(e=l+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){n=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else {if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r;}i[e>>2]=0,n=t;}else n=0|i[l+8>>2],i[n+12>>2]=t,i[t+8>>2]=n,n=t;}while(0);if(0|o){if(t=0|i[l+28>>2],(0|i[(e=23732+(t<<2)|0)>>2])==(0|l)){if(i[e>>2]=n,!n){i[5858]=i[5858]&~(1<<t);break}}else if(i[((0|i[(r=o+16|0)>>2])==(0|l)?r:o+20)>>2]=n,!n)break;i[n+24>>2]=o,0|(e=0|i[(t=l+16|0)>>2])&&(i[n+16>>2]=e,i[e+24>>2]=n),0|(t=0|i[t+4>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n);}}while(0);if(i[A+4>>2]=1|a,i[s+a>>2]=a,(0|A)==(0|i[5862]))return void(i[5859]=a)}if(t=a>>>3,a>>>0<256)return n=23468+(t<<1<<2)|0,(e=0|i[5857])&(t=1<<t)?t=0|i[(e=n+8|0)>>2]:(i[5857]=e|t,t=n,e=n+8|0),i[e>>2]=A,i[t+12>>2]=A,i[A+8>>2]=t,void(i[A+12>>2]=n);t=23732+((r=(t=a>>>8)?a>>>0>16777215?31:a>>>((r=14-((o=((l=t<<(s=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(r=((l<<=o)+245760|0)>>>16&2))+(l<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[A+28>>2]=r,i[A+20>>2]=0,i[A+16>>2]=0,e=0|i[5858],n=1<<r;t:do{if(e&n){t=0|i[t>>2];e:do{if((-8&i[t+4>>2])!=(0|a)){for(r=a<<(31==(0|r)?0:25-(r>>>1));e=0|i[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&i[e+4>>2])==(0|a)){t=e;break e}r<<=1,t=e;}i[n>>2]=A,i[A+24>>2]=t,i[A+12>>2]=A,i[A+8>>2]=A;break t}}while(0);l=0|i[(s=t+8|0)>>2],i[l+12>>2]=A,i[s>>2]=A,i[A+8>>2]=l,i[A+12>>2]=t,i[A+24>>2]=0;}else i[5858]=e|n,i[t>>2]=A,i[A+24>>2]=t,i[A+12>>2]=A,i[A+8>>2]=A;}while(0);if(l=(0|i[5865])-1|0,i[5865]=l,!(0|l)){for(t=23884;t=0|i[t>>2];)t=t+8|0;i[5865]=-1;}}}}function Le(t,e){e|=0;var n=0;return (t|=0)?(n=0|y(e,t),(e|t)>>>0>65535&&(n=((n>>>0)/(t>>>0)|0)==(0|e)?n:-1)):n=0,(t=0|Re(n))&&3&i[t+-4>>2]?(Xe(0|t,0,0|n),0|t):0|t}function De(t,e,n,r){return 0|(w((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function Oe(t,e,n,r){return 0|(w(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function Ie(t){return 0|((t|=0)?31-(0|M(t^t-1)):32)}function qe(t,e,n,r,a){a|=0;var o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0;if(u=t|=0,s=n|=0,A=f=r|=0,!(c=l=e|=0))return o=!!(0|a),A?o?(i[a>>2]=0|t,i[a+4>>2]=0,a=0,0|(w(0|(f=0)),a)):(a=0,0|(w(0|(f=0)),a)):(o&&(i[a>>2]=(u>>>0)%(s>>>0),i[a+4>>2]=0),a=(u>>>0)/(s>>>0)>>>0,0|(w(0|(f=0)),a));o=!(0|A);do{if(s){if(!o){if((o=(0|M(0|A))-(0|M(0|c))|0)>>>0<=31){s=h=o+1|0,t=u>>>(h>>>0)&(e=o-31>>31)|c<<(A=31-o|0),e&=c>>>(h>>>0),o=0,A=u<<A;break}return a?(i[a>>2]=0|t,i[a+4>>2]=0|l,a=0,0|(w(0|(f=0)),a)):(a=0,0|(w(0|(f=0)),a))}if((o=s-1|0)&s){s=A=33+(0|M(0|s))-(0|M(0|c))|0,t=(h=32-A|0)-1>>31&c>>>((d=A-32|0)>>>0)|(c<<h|u>>>(A>>>0))&(e=d>>31),e&=c>>>(A>>>0),o=u<<(p=64-A|0)&(l=h>>31),A=(c<<p|u>>>(d>>>0))&l|u<<h&A-33>>31;break}return 0|a&&(i[a>>2]=o&u,i[a+4>>2]=0),1==(0|s)?(p=0|t,0|(w(0|(d=0|l)),p)):(d=c>>>((p=0|Ie(0|s))>>>0)|0,p=c<<32-p|u>>>(p>>>0),0|(w(0|d),p))}if(o)return 0|a&&(i[a>>2]=(c>>>0)%(s>>>0),i[a+4>>2]=0),p=(c>>>0)/(s>>>0)>>>0,0|(w(0|(d=0)),p);if(!u)return 0|a&&(i[a>>2]=0,i[a+4>>2]=(c>>>0)%(A>>>0)),p=(c>>>0)/(A>>>0)>>>0,0|(w(0|(d=0)),p);if(!((o=A-1|0)&A))return 0|a&&(i[a>>2]=0|t,i[a+4>>2]=o&c),d=0,p=c>>>((0|Ie(0|A))>>>0),0|(w(0|d),p);if((o=(0|M(0|A))-(0|M(0|c))|0)>>>0<=30){s=e=o+1|0,t=c<<(A=31-o|0)|u>>>(e>>>0),e=c>>>(e>>>0),o=0,A=u<<A;break}return a?(i[a>>2]=0|t,i[a+4>>2]=0|l,p=0,0|(w(0|(d=0)),p)):(p=0,0|(w(0|(d=0)),p))}while(0);if(s){c=0|De(0|(h=0|n),0|(u=0|f),-1,-1),n=0|E(),l=A,A=0;do{r=l,l=o>>>31|l<<1,o=A|o<<1,Oe(0|c,0|n,0|(r=t<<1|r>>>31),0|(f=t>>>31|e<<1)),A=1&(d=(p=0|E())>>31|((0|p)<0?-1:0)<<1),t=0|Oe(0|r,0|f,d&h,(((0|p)<0?-1:0)>>31|((0|p)<0?-1:0)<<1)&u),e=0|E(),s=s-1|0;}while(0|s);c=l,l=0;}else c=A,l=0,A=0;return s=0,0|a&&(i[a>>2]=t,i[a+4>>2]=e),p=o<<1&-2|A,0|(w(0|(d=(0|o)>>>31|(c|s)<<1|l)),p)}function Ue(t,e,n,r){n|=0;var i,a,o,s,A;return a=(r|=0)>>31|((0|r)<0?-1:0)<<1,i=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,o=0|Oe((A=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(s=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|A,0|s),t=a^A,e=i^s,0|Oe(qe(o,0|E(),0|Oe(a^n,i^r,0|a,0|i),0|E(),0)^t,E()^e,0|t,0|e)}function Ne(t,e,n,r){e|=0,r|=0;var i,a;return n=0|function(t,e){var n,r,i,a=0;return t=((n=0|y(a=65535&(e|=0),i=65535&(t|=0)))>>>16)+(0|y(a,r=t>>>16))|0,e=0|y(a=e>>>16,i),0|(w((t>>>16)+(0|y(a,r))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(i=t|=0,a=n|=0),t=0|E(),0|(w((0|y(e,a))+(0|y(r,i))+t|0),n)}function Be(t,e,n,r){n|=0;var a,o,s,A,l,c;return a=D,D=D+16|0,A=0|a,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,l=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,qe(t=0|Oe((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|s,0|o),e=0|E(),0|Oe(c^n,l^r,0|c,0|l),0|E(),A),r=0|Oe(i[A>>2]^s,i[A+4>>2]^o,0|s,0|o),n=0|E(),D=a,0|(w(0|n),r)}function ke(t,e,n,r){var a,o;return o=D,D=D+16|0,qe(t|=0,e|=0,n|=0,r|=0,a=0|o),D=o,0|(w(0|i[a+4>>2]),i[a>>2])}function Fe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e>>n),t>>>n|(e&(1<<n)-1)<<32-n):(w(0|((0|e)<0?-1:0)),e>>n-32)}function ze(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(w(0),e>>>n-32|0)}function Ge(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(w(t<<n-32),0)}function He(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+b(+t,+e)}function je(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+x(+t,+e)}function Ve(t){return (t=+t)>=0?+A(t+.5):+_(t-.5)}function We(t,e,n){t|=0,e|=0;var a,o,s=0;if((0|(n|=0))>=8192)return R(0|t,0|e,0|n),0|t;if(o=0|t,a=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|o;r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0,n=n-1|0;}for(s=(n=-4&a)-64|0;(0|t)<=(0|s);)i[t>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2],i[t+16>>2]=i[e+16>>2],i[t+20>>2]=i[e+20>>2],i[t+24>>2]=i[e+24>>2],i[t+28>>2]=i[e+28>>2],i[t+32>>2]=i[e+32>>2],i[t+36>>2]=i[e+36>>2],i[t+40>>2]=i[e+40>>2],i[t+44>>2]=i[e+44>>2],i[t+48>>2]=i[e+48>>2],i[t+52>>2]=i[e+52>>2],i[t+56>>2]=i[e+56>>2],i[t+60>>2]=i[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)i[t>>2]=i[e>>2],t=t+4|0,e=e+4|0;}else for(n=a-4|0;(0|t)<(0|n);)r[t|0]=0|r[e|0],r[t+1|0]=0|r[e+1|0],r[t+2|0]=0|r[e+2|0],r[t+3|0]=0|r[e+3|0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|a);)r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0;return 0|o}function Xe(t,e,n){e|=0;var a,o=0,s=0,A=0;if(a=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)r[t|0]=e,t=t+1|0;for(A=e|e<<8|e<<16|e<<24,s=(o=-4&a)-64|0;(0|t)<=(0|s);)i[t>>2]=A,i[t+4>>2]=A,i[t+8>>2]=A,i[t+12>>2]=A,i[t+16>>2]=A,i[t+20>>2]=A,i[t+24>>2]=A,i[t+28>>2]=A,i[t+32>>2]=A,i[t+36>>2]=A,i[t+40>>2]=A,i[t+44>>2]=A,i[t+48>>2]=A,i[t+52>>2]=A,i[t+56>>2]=A,i[t+60>>2]=A,t=t+64|0;for(;(0|t)<(0|o);)i[t>>2]=A,t=t+4|0;}for(;(0|t)<(0|a);)r[t|0]=e,t=t+1|0;return a-n|0}function Qe(t){return (t=+t)>=0?+A(t+.5):+_(t-.5)}function Ye(t){t|=0;var e,n,r;return r=0|C(),(0|t)>0&(0|(e=(n=0|i[s>>2])+t|0))<(0|n)|(0|e)<0?(L(0|e),T(12),-1):(0|e)>(0|r)&&!(0|P(0|e))?(T(12),-1):(i[s>>2]=e,0|n)}return {___divdi3:Ue,___muldi3:Ne,___remdi3:Be,___uremdi3:ke,_areNeighborCells:function(t,e,n,r,a){a|=0;var o,s,A,l=0,c=0,u=0,h=0;if(A=D,D=D+64|0,s=A,o=A+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(r|=0))))return D=A,0|(a=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|r))return i[a>>2]=0,D=A,0|(a=0);if(c=0|ze(0|t,0|e,52),E(),c&=15,h=0|ze(0|n,0|r,52),E(),(0|c)!=(15&h))return D=A,0|(a=12);if(l=c+-1|0,c>>>0>1){qt(t,e,l,s),qt(n,r,l,o),u=0|i[(h=s)>>2],h=0|i[h+4>>2];t:do{if((0|u)==(0|i[o>>2])&&(0|h)==(0|i[o+4>>2])){l=0|ze(0|t,0|e,0|(c=3*(15^c)|0)),E(),l&=7,c=0|ze(0|n,0|r,0|c),E(),c&=7;do{if(!(0|l)|!(0|c))i[a>>2]=1,l=0;else if(7==(0|l))l=5;else {if(1==(0|l)|1==(0|c)&&0|Nt(u,h)){l=5;break}if((0|i[15536+(l<<2)>>2])!=(0|c)&&(0|i[15568+(l<<2)>>2])!=(0|c))break t;i[a>>2]=1,l=0;}}while(0);return D=A,0|(a=l)}}while(0)}c=(l=s)+56|0;do{i[l>>2]=0,l=l+4|0;}while((0|l)<(0|c));return O(t,e,1,s),l=(0|i[(e=s)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+8|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+16|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+24|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+32|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+40|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)?1:1&((0|i[(l=s+48|0)>>2])==(0|n)?(0|i[l+4>>2])==(0|r):0),i[a>>2]=l,D=A,0|(a=0)},_bitshift64Ashr:Fe,_bitshift64Lshr:ze,_bitshift64Shl:Ge,_calloc:Le,_cellAreaKm2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(a[n>>3]=6371.007180918475*+a[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(a[n>>3]=6371.007180918475*+a[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:re,_cellToBoundary:Qt,_cellToCenterChild:function(t,e,n,r){n|=0,r|=0;var a=0;return a=0|ze(0|(t|=0),0|(e|=0),52),E(),(0|n)<16&(0|(a&=15))<=(0|n)?((0|a)<(0|n)&&(a=0|Ge(-1,-1,3+(3*(n+-1-a|0)|0)|0),a=0|Ge(0|~a,0|~E(),3*(15-n|0)|0),e=~E()&e,t&=~a),a=0|Ge(0|n,0,52),n=-15728641&e|E(),i[r>>2]=t|a,i[r+4>>2]=n,0|(r=0)):0|(r=4)},_cellToChildPos:function(t,e,n,r){n|=0,r|=0;var a,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0;if(a=D,D=D+16|0,v=a,_=0|ze(0|(t|=0),0|(e|=0),52),E(),_&=15,n>>>0>15)return D=a,0|(_=4);if((0|_)<(0|n))return D=a,0|(_=12);if((0|_)!=(0|n))if(s=0|Ge(0|n,0,52),s|=t,l=E()|-15728641&e,(0|_)>(0|n)){c=n;do{g=0|Ge(7,0,3*(14-c|0)|0),c=c+1|0,s|=g,l=E()|l;}while((0|c)<(0|_));g=s;}else g=s;else g=t,l=e;m=0|ze(0|g,0|l,45),E();t:do{if(0|F(127&m)){if(c=0|ze(0|g,0|l,52),E(),0|(c&=15))for(s=1;;){if(!(!((m=0|Ge(7,0,3*(15-s|0)|0))&g)&!(E()&l))){u=33;break t}if(!(s>>>0<c>>>0))break;s=s+1|0;}if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|_)>(0|n)){for(m=-15728641&e,p=_;;){if(d=p,(p=p+-1|0)>>>0>15|(0|_)<(0|p)){u=19;break}if((0|_)!=(0|p))if(s=0|Ge(0|p,0,52),s|=t,c=E()|m,(0|_)<(0|d))f=s;else {u=p;do{f=0|Ge(7,0,3*(14-u|0)|0),u=u+1|0,s|=f,c=E()|c;}while((0|u)<(0|_));f=s;}else f=t,c=e;if(h=0|ze(0|f,0|c,45),E(),0|F(127&h)){h=0|ze(0|f,0|c,52),E(),h&=15;e:do{if(h)for(u=1;;){if(s=0|ze(0|f,0|c,3*(15-u|0)|0),E(),0|(s&=7))break e;if(!(u>>>0<h>>>0)){s=0;break}u=u+1|0;}else s=0;}while(0);s=1&!(0|s);}else s=0;if(c=0|ze(0|t,0|e,3*(15-d|0)|0),E(),7==(0|(c&=7))){o=5,u=42;break}if(1==(0|c)&(s=!!(0|s))){o=5,u=42;break}if(0|(f=c+((!!(0|c)&s)<<31>>31)|0)&&(u=0|ue(7,0,u=_-d|0,((0|u)<0)<<31>>31),h=0|E(),s?(s=0|De(0|(s=0|Ne(0|u,0|h,5,0)),0|E(),-5,-1),s=0|De(0|(s=0|Ue(0|s,0|E(),6,0)),0|E(),1,0),c=0|E()):(s=u,c=h),d=0|De(0|s,0|c,0|(d=0|Ne(0|u,0|h,0|(d=f+-1|0),((0|d)<0)<<31>>31)),0|E()),h=0|De(0|d,0|(f=0|E()),0|i[(h=r)>>2],0|i[h+4>>2]),f=0|E(),i[(d=r)>>2]=h,i[d+4>>2]=f),(0|p)<=(0|n)){u=37;break}}if(19==(0|u))S(23313,22674,1099,22710);else {if(37==(0|u)){o=0|i[(A=r)+4>>2],A=0|i[A>>2];break}if(42==(0|u))return D=a,0|o}}else o=0,A=0;}else u=33;}while(0);t:do{if(33==(0|u)){if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|_)>(0|n)){for(s=_;;){if(o=0|ze(0|t,0|e,3*(15-s|0)|0),E(),7==(0|(o&=7))){o=5;break}if(o=0|Ne(0|(A=0|ue(7,0,A=_-s|0,((0|A)<0)<<31>>31)),0|E(),0|o,0),A=0|E(),A=0|De(0|i[(m=r)>>2],0|i[m+4>>2],0|o,0|A),o=0|E(),i[(m=r)>>2]=A,i[m+4>>2]=o,(0|(s=s+-1|0))<=(0|n))break t}return D=a,0|o}o=0,A=0;}}while(0);return 0|Ut(g,l,_,v)&&S(23313,22674,1063,22725),((0|o)>-1|-1==(0|o)&A>>>0>4294967295)&((0|(v=0|i[(_=v)+4>>2]))>(0|o)|((0|v)==(0|o)?(0|i[_>>2])>>>0>A>>>0:0))?(D=a,0|(_=0)):(S(23313,22674,1139,22710),0)},_cellToChildren:function(t,e,n,r){r|=0;var a,o,s=0,A=0;if(o=D,D=D+16|0,Zt(a=o,t|=0,e|=0,n|=0),!(0|(t=0|i[(e=a)>>2]))&!(0|(e=0|i[e+4>>2])))return D=o,0;s=0,n=0;do{i[(A=r+(s<<3)|0)>>2]=t,i[A+4>>2]=e,s=0|De(0|s,0|n,1,0),n=0|E(),Kt(a),t=0|i[(A=a)>>2],e=0|i[A+4>>2];}while(!(!(0|t)&!(0|e)));return D=o,0},_cellToChildrenSize:Ut,_cellToLatLng:Xt,_cellToLocalIj:function(t,e,n,r,i,a){var o,s;return t|=0,e|=0,n|=0,r|=0,a|=0,s=D,D=D+16|0,o=s,(i|=0)?t=15:(t=0|le(t,e,n,r,o))||(_t(o,a),t=0),D=s,0|t},_cellToParent:qt,_cellToVertex:ye,_cellToVertexes:function(t,e,n){n|=0;var r,a=0,o=0;return o=!(0|Nt(t|=0,e|=0)),r=!(0|(a=0|ye(t,e,0,n))),o?r?0|(a=0|ye(t,e,1,n+8|0))||0|(a=0|ye(t,e,2,n+16|0))||0|(a=0|ye(t,e,3,n+24|0))||(a=0|ye(t,e,4,n+32|0))?0|(o=a):0|ye(t,e,5,n+40|0):0|(o=a):r?0|(a=0|ye(t,e,1,n+8|0))||0|(a=0|ye(t,e,2,n+16|0))||0|(a=0|ye(t,e,3,n+24|0))||0|(a=0|ye(t,e,4,n+32|0))?0|(o=a):(i[(o=n+40|0)>>2]=0,i[o+4>>2]=0,0|(o=0)):0|(o=a)},_cellsToDirectedEdge:function(t,e,n,r,a){return a|=0,7==(0|(n=0|B(t|=0,e|=0,n|=0,r|=0)))?0|(a=11):(r=0|Ge(0|n,0,56),e=-2130706433&e|E()|268435456,i[a>>2]=t|r,i[a+4>>2]=e,0|(a=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var r,a,o,s=0;if(o=D,D=D+32|0,r=o,t=0|function(t,e,n){t|=0,n|=0;var r,a,o=0,s=0,A=0,l=0,c=0,u=0;if(a=D,D=D+176|0,r=a,(0|(e|=0))<1)return xe(n,0,0),D=a,0;for(c=0|ze(0|i[(c=t)>>2],0|i[c+4>>2],52),E(),xe(n,(0|e)>6?e:6,15&c),c=0;!(0|(o=0|Qt(0|i[(o=t+(c<<3)|0)>>2],0|i[o+4>>2],r)));){if((0|(o=0|i[r>>2]))>0){l=0;do{A=r+8+(l<<4)|0,(s=0|Se(n,o=r+8+((0|(l=l+1|0))%(0|o)<<4)|0,A))?we(n,s):Ee(n,A,o),o=0|i[r>>2];}while((0|l)<(0|o))}if((0|(c=c+1|0))>=(0|e)){o=0,u=13;break}}return 13==(0|u)?(D=a,0|o):(be(n),D=a,0|(u=o))}(t|=0,e|=0,a=o+16|0),0|t)return D=o,0|(n=t);if(i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,0|(t=0|Me(a)))do{e=0|ie(n);do{ae(e,t),s=t+16|0,i[r>>2]=i[s>>2],i[r+4>>2]=i[s+4>>2],i[r+8>>2]=i[s+8>>2],i[r+12>>2]=i[s+12>>2],we(a,t),t=0|Te(a,r);}while(0|t);t=0|Me(a);}while(0|t);return be(a),(t=0|se(n))?(oe(n),D=o,0|(s=t)):(D=o,0|(s=0))},_childPosToCell:function(t,e,n,r,a,o){t|=0,e|=0,o|=0;var s,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0;if(s=D,D=D+16|0,A=s,(a|=0)>>>0>15)return D=s,0|(o=4);if(l=0|ze(0|(n|=0),0|(r|=0),52),E(),(0|(l&=15))>(0|a))return D=s,0|(o=12);if(0|Ut(n,r,a,A)&&S(23313,22674,1063,22725),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(u=0|i[(h=A)+4>>2]))>(0|e)|((0|u)==(0|e)?(0|i[h>>2])>>>0>t>>>0:0))))return D=s,0|(o=2);h=a-l|0,a=0|Ge(0|a,0,52),c=E()|-15728641&r,i[(u=o)>>2]=a|n,i[u+4>>2]=c,u=0|ze(0|n,0|r,45),E();t:do{if(0|F(127&u)){if(0|l)for(A=1;;){if(!(!((u=0|Ge(7,0,3*(15-A|0)|0))&n)&!(E()&r)))break t;if(!(A>>>0<l>>>0))break;A=A+1|0;}if((0|h)<1)return D=s,0|(o=0);for(u=15^l,r=-1,c=1,A=1;;){l=0|ue(7,0,l=h-c|0,((0|l)<0)<<31>>31),n=0|E();do{if(A){if(A=0|Ue(0|(A=0|De(0|(A=0|Ne(0|l,0|n,5,0)),0|E(),-5,-1)),0|E(),6,0),(0|e)>(0|(a=0|E()))|(0|e)==(0|a)&t>>>0>A>>>0){e=0|Oe(0|(e=0|De(0|t,0|e,-1,-1)),0|E(),0|A,0|a),A=0|E(),p=0|i[(f=o)>>2],f=0|i[f+4>>2],d=0|Ge(7,0,0|(m=3*(u+r|0)|0)),f&=~E(),m=0|Ge(0|(a=0|De(0|(r=0|Ue(0|e,0|A,0|l,0|n)),0|(t=0|E()),2,0)),0|E(),0|m),f=E()|f,i[(a=o)>>2]=m|p&~d,i[a+4>>2]=f,t=0|Oe(0|e,0|A,0|(t=0|Ne(0|r,0|t,0|l,0|n)),0|E()),A=0,e=0|E();break}d=0|i[(m=o)>>2],m=0|i[m+4>>2],p=0|Ge(7,0,3*(u+r|0)|0),m&=~E(),i[(A=o)>>2]=d&~p,i[A+4>>2]=m,A=1;break}a=0|i[(d=o)>>2],d=0|i[d+4>>2],f=0|Ge(7,0,0|(r=3*(u+r|0)|0)),d&=~E(),r=0|Ge(0|(m=0|Ue(0|t,0|e,0|l,0|n)),0|(A=0|E()),0|r),d=E()|d,i[(p=o)>>2]=r|a&~f,i[p+4>>2]=d,t=0|Oe(0|t,0|e,0|(A=0|Ne(0|m,0|A,0|l,0|n)),0|E()),A=0,e=0|E();}while(0);if(!((0|h)>(0|c))){e=0;break}r=~c,c=c+1|0;}return D=s,0|e}}while(0);if((0|h)<1)return D=s,0|(m=0);for(a=15^l,A=1;;){if(p=0|ue(7,0,p=h-A|0,((0|p)<0)<<31>>31),m=0|E(),n=0|i[(c=o)>>2],c=0|i[c+4>>2],r=0|Ge(7,0,0|(l=3*(a-A|0)|0)),c&=~E(),l=0|Ge(0|(f=0|Ue(0|t,0|e,0|p,0|m)),0|(d=0|E()),0|l),c=E()|c,i[(u=o)>>2]=l|n&~r,i[u+4>>2]=c,t=0|Oe(0|t,0|e,0|(m=0|Ne(0|f,0|d,0|p,0|m)),0|E()),e=0|E(),(0|h)<=(0|A)){e=0;break}A=A+1|0;}return D=s,0|e},_compactCells:function(t,e,n,r){e|=0;var a,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,T=0;if(!(0|(n|=0))&!(0|(r|=0)))return 0|(w=0);if(s=0|i[(o=t|=0)>>2],!0&!(15728640&(o=0|i[o+4>>2]))){if(!((0|r)>0|!(0|r)&n>>>0>0))return 0|(w=0);if(i[(w=e)>>2]=s,i[w+4>>2]=o,1==(0|n)&!(0|r))return 0|(w=0);o=1;do{M=0|i[(b=t+(o<<3)|0)+4>>2],i[(w=e+(o<<3)|0)>>2]=i[b>>2],i[w+4>>2]=M,o=o+1|0;}while(0<(0|r)|!(0|r)&o>>>0<n>>>0);return 0|(o=0)}if(!(M=0|Re(a=n<<3)))return 0|(w=13);if(We(0|M,0|t,0|a),!(b=0|Le(n,8)))return Pe(M),0|(w=13);t:do{if(0|n){e:for(;;){y=0|ze(0|(_=0|i[(o=M)>>2]),0|(o=0|i[o+4>>2]),52),E(),x=(y&=15)+-1|0,v=(0|n)>0;n:do{if(!!(0|y)&v){if(p=((0|n)<0)<<31>>31,m=0|Ge(0|x,0,52),g=0|E(),x>>>0>15){if(!(!(0|_)&!(0|o))){w=17;break e}for(s=0;;){if((0|(s=s+1|0))>=(0|n))break n;if(!(!(0|(g=0|i[(r=M+(s<<3)|0)>>2]))&!(0|(r=0|i[r+4>>2])))){o=r,w=17;break e}}}for(s=0,t=_,r=o;;){if(!(!(0|t)&!(0|r))){if(!(!0&!(117440512&r))){w=22;break e}if(l=0|ze(0|t,0|r,52),E(),(0|(l&=15))<(0|x)){o=12,w=28;break e}if((0|l)!=(0|x)&&(t|=m,r=-15728641&r|g,l>>>0>=y>>>0)){A=x;do{d=0|Ge(7,0,3*(14-A|0)|0),A=A+1|0,t|=d,r=E()|r;}while(A>>>0<l>>>0)}if(A=0|ke(0|t,0|r,0|n,0|p),E(),!(0|(c=0|i[(l=u=b+(A<<3)|0)>>2]))&!(0|(l=0|i[l+4>>2])))A=u;else for(d=0;;){if((0|d)>(0|n)){w=32;break e}if((0|c)==(0|t)&(-117440513&l)==(0|r)){h=0|ze(0|c,0|l,56),E(),f=(h&=7)+1|0,T=0|ze(0|c,0|l,45),E();r:do{if(0|F(127&T)){if(c=0|ze(0|c,0|l,52),E(),!(c&=15)){l=6;break}for(l=1;;){if(!(!((T=0|Ge(7,0,3*(15-l|0)|0))&t)&!(E()&r))){l=7;break r}if(!(l>>>0<c>>>0)){l=6;break}l=l+1|0;}}else l=7;}while(0);if((h+2|0)>>>0>l>>>0){w=42;break e}T=0|Ge(0|f,0,56),r=E()|-117440513&r,i[(f=u)>>2]=0,i[f+4>>2]=0,t|=T;}else A=(A+1|0)%(0|n)|0;if(!(0|(c=0|i[(l=u=b+(A<<3)|0)>>2]))&!(0|(l=0|i[l+4>>2]))){A=u;break}d=d+1|0;}i[(T=A)>>2]=t,i[T+4>>2]=r;}if((0|(s=s+1|0))>=(0|n))break n;t=0|i[(r=M+(s<<3)|0)>>2],r=0|i[r+4>>2];}}}while(0);if((n+5|0)>>>0<11){w=85;break}if(!(g=0|Le((0|n)/6|0,8))){w=49;break}n:do{if(v){d=0,f=0;do{if(!(!(0|(s=0|i[(r=l=b+(d<<3)|0)>>2]))&!(0|(r=0|i[r+4>>2])))){c=0|ze(0|s,0|r,56),E(),t=(c&=7)+1|0,u=-117440513&r,T=0|ze(0|s,0|r,45),E();r:do{if(0|F(127&T)){if(h=0|ze(0|s,0|r,52),E(),0|(h&=15))for(A=1;;){if(!(!(s&(T=0|Ge(7,0,3*(15-A|0)|0)))&!(u&E())))break r;if(!(A>>>0<h>>>0))break;A=A+1|0;}s|=r=0|Ge(0|t,0,56),r=E()|u,i[(t=l)>>2]=s,i[t+4>>2]=r,t=c+2|0;}}while(0);7==(0|t)&&(i[(T=g+(f<<3)|0)>>2]=s,i[T+4>>2]=-117440513&r,f=f+1|0);}d=d+1|0;}while((0|d)!=(0|n));if(v){if(d=((0|n)<0)<<31>>31,p=0|Ge(0|x,0,52),m=0|E(),x>>>0>15){if(!(!(0|_)&!(0|o))){o=4,w=84;break e}for(o=0;;){if((0|(o=o+1|0))>=(0|n)){s=0,o=f;break n}if(!(!(0|i[(T=M+(o<<3)|0)>>2])&!(0|i[T+4>>2]))){o=4,w=84;break e}}}for(h=0,s=0,u=_;;){do{if(!(!(0|u)&!(0|o))){if(l=0|ze(0|u,0|o,52),E(),(0|(l&=15))<(0|x)){o=12,w=84;break e}do{if((0|l)==(0|x))r=u,l=o;else {if(r=u|p,t=-15728641&o|m,l>>>0<y>>>0){l=t;break}A=x;do{T=0|Ge(7,0,3*(14-A|0)|0),A=A+1|0,r|=T,t=E()|t;}while(A>>>0<l>>>0);l=t;}}while(0);for(A=0|ke(0|r,0|l,0|n,0|d),E(),t=0;;){if((0|t)>(0|n)){w=77;break e}if((-117440513&(c=0|i[(T=b+(A<<3)|0)+4>>2]))==(0|l)&&(0|i[T>>2])==(0|r)){w=79;break}if((0|i[(T=b+((A=(A+1|0)%(0|n)|0)<<3)|0)>>2])==(0|r)&&(0|i[T+4>>2])==(0|l))break;t=t+1|0;}if(79==(0|w)&&(w=0,!0&100663296==(117440512&c)))break;i[(T=e+(s<<3)|0)>>2]=u,i[T+4>>2]=o,s=s+1|0;}}while(0);if((0|(o=h+1|0))>=(0|n)){o=f;break n}h=o,u=0|i[(T=M+(o<<3)|0)>>2],o=0|i[T+4>>2];}}else s=0,o=f;}else s=0,o=0;}while(0);if(Xe(0|b,0,0|a),We(0|M,0|g,o<<3),Pe(g),!o)break t;e=e+(s<<3)|0,n=o;}if(17==(0|w))!0&!(117440512&o)?(o=4,w=28):w=22;else if(32==(0|w))S(23313,22674,362,22684);else {if(42==(0|w))return Pe(M),Pe(b),0|(T=10);if(49==(0|w))return Pe(M),Pe(b),0|(T=13);if(77==(0|w))S(23313,22674,462,22684);else {if(84==(0|w))return Pe(g),Pe(M),Pe(b),0|(T=o);if(85==(0|w)){We(0|e,0|M,n<<3);break}}}if(22==(0|w))return Pe(M),Pe(b),0|(T=5);if(28==(0|w))return Pe(M),Pe(b),0|(T=o)}}while(0);return Pe(M),Pe(b),0|(T=0)},_destroyLinkedMultiPolygon:oe,_directedEdgeToBoundary:Mt,_directedEdgeToCells:function(t,e,n){t|=0;var r,a,o,s=0;return r=D,D=D+16|0,s=r,!0&268435456==(2013265920&(e|=0))?(a=-2130706433&e|134217728,i[(o=n|=0)>>2]=t,i[o+4>>2]=a,i[s>>2]=0,e=0|ze(0|t,0|e,56),E(),s=0|N(t,a,7&e,s,n+8|0),D=r,0|s):(D=r,0|(s=6))},_edgeLengthKm:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,d=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return l=t,A=+a[n>>3],A*=6371.007180918475,a[n>>3]=A,D=r,0|l;if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return l=0,A=0,A*=6371.007180918475,a[n>>3]=A,D=r,0|l;e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{d=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+f(.5*(o-d)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+f(.5*(s-u)))*(+h(+d)*+h(+o)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)));}while((0|t)!=(0|e));return a[n>>3]=A,l=0,p=A,p*=6371.007180918475,a[n>>3]=p,D=r,0|l},_edgeLengthM:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,d=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return l=t,A=+a[n>>3],A*=6371.007180918475,A*=1e3,a[n>>3]=A,D=r,0|l;if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return l=0,A=0,A*=6371.007180918475,A*=1e3,a[n>>3]=A,D=r,0|l;e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{d=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+f(.5*(o-d)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+f(.5*(s-u)))*(+h(+d)*+h(+o)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)));}while((0|t)!=(0|e));return a[n>>3]=A,l=0,p=A,p*=6371.007180918475,p*=1e3,a[n>>3]=p,D=r,0|l},_edgeLengthRads:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,d=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return D=r,0|(l=t);if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return D=r,0|(l=0);e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{d=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+f(.5*(o-d)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+f(.5*(s-u)))*(+h(+o)*+h(+d)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)));}while((0|t)<(0|e));return a[n>>3]=A,D=r,0|(l=0)},_emscripten_replace_memory:function(t){return r=new Int8Array(t),i=new Int32Array(t),a=new Float64Array(t),n=t,!0},_free:Pe,_getBaseCellNumber:Ot,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var r,a,o=0;return r=D,D=D+16|0,i[(o=r)>>2]=0,!0&268435456==(2013265920&e)?(a=0|ze(0|t,0|e,56),E(),o=0|N(t,-2130706433&e|134217728,7&a,o,n),D=r,0|o):(D=r,0|(o=6))},_getDirectedEdgeOrigin:function(t,e,n){return t|=0,n|=0,!0&268435456==(2013265920&(e|=0))?(i[n>>2]=t,i[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20528+(t<<3)>>3],0|(e=0))},_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20656+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20912+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,r){r|=0;var a,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0;a=D,D=D+128|0,h=a+112|0,A=a+96|0,f=a,s=0|ze(0|(e|=0),0|(n|=0),52),E(),c=15&s,i[h>>2]=c,l=0|ze(0|e,0|n,45),E(),l&=127;t:do{if(0|F(l)){if(0|c)for(o=1;;){if(!(!((u=0|Ge(7,0,3*(15-o|0)|0))&e)&!(E()&n))){s=0;break t}if(!(o>>>0<c>>>0))break;o=o+1|0;}if(!(1&s))return u=0|Ge(c+1|0,0,52),f=E()|-15728641&n,f=0|t((u|e)&~(h=0|Ge(7,0,3*(14-c|0)|0)),f&~E(),r),D=a,0|f;s=1;}else s=0;}while(0);if(!(o=0|Wt(e,n,A))){s?(Ct(A,h,f),u=5):(Dt(A,h,f),u=6);t:do{if(0|F(l))if(c)for(o=1;;){if(!(!((l=0|Ge(7,0,3*(15-o|0)|0))&e)&!(E()&n))){e=2;break t}if(!(o>>>0<c>>>0)){e=5;break}o=o+1|0;}else e=5;else e=2;}while(0);Xe(0|r,-1,e<<2);t:do{if(s)for(A=0;;){if(Pt(l=f+(A<<4)|0,0|i[h>>2]),l=0|i[l>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|l))o=r;else {s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2];}while(!(-1==(0|c)|(0|c)==(0|l)))}if(i[o>>2]=l,(A=A+1|0)>>>0>=u>>>0){o=0;break}}else for(A=0;;){if(Rt(l=f+(A<<4)|0,0|i[h>>2],0,1),l=0|i[l>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|l))o=r;else {s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2];}while(!(-1==(0|c)|(0|c)==(0|l)))}if(i[o>>2]=l,(A=A+1|0)>>>0>=u>>>0){o=0;break}}}while(0)}return D=a,0|(f=o)},_getNumCells:ee,_getPentagons:Yt,_getRes0Cells:function(t){t|=0;var e=0,n=0,r=0;e=0;do{Ge(0|e,0,45),r=134225919|E(),i[(n=t+(e<<3)|0)>>2]=-1,i[n+4>>2]=r,e=e+1|0;}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|ze(0|(t|=0),0|(e|=0),52),E(),15&e},_greatCircleDistanceKm:te,_greatCircleDistanceM:function(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+f(.5*(r-n)))*i+(o=+f(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+f(.5*(r-n)))*i+(o=+f(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))},_gridDisk:O,_gridDiskDistances:I,_gridDistance:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s,A=0,l=0;return s=D,D=D+32|0,l=s,0|(o=0|le(t|=0,e|=0,t,e,A=s+12|0))?(D=s,0|(l=o)):0|(t=0|le(t,e,n,r,l))?(D=s,0|(l=t)):(A=0|vt(A,l),i[(l=a)>>2]=A,i[l+4>>2]=((0|A)<0)<<31>>31,D=s,0|(l=0))},_gridPathCells:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s=0,A=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,T=0,C=0;if(o=D,D=D+48|0,c=o+12|0,T=o,!(s=0|le(t|=0,e|=0,t,e,A=o+24|0))&&!(s=0|le(t,e,n,r,c))){w=((0|(M=0|vt(A,c)))<0)<<31>>31,i[A>>2]=0,i[A+4>>2]=0,i[A+8>>2]=0,i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,0|le(t,e,t,e,A)&&S(23313,23090,691,23299),0|le(t,e,n,r,c)&&S(23313,23090,696,23299),xt(A),xt(c),M?(g=+(0|M),b=A,r=d=0|i[A>>2],s=p=0|i[(y=A+4|0)>>2],n=m=0|i[(x=A+8|0)>>2],v=+((0|i[c>>2])-d|0)/g,_=+((0|i[c+4>>2])-p|0)/g,g=+((0|i[c+8>>2])-m|0)/g):(y=s=A+4|0,x=n=A+8|0,b=A,r=0|i[A>>2],s=0|i[s>>2],n=0|i[n>>2],v=0,_=0,g=0),i[T>>2]=r,i[(m=T+4|0)>>2]=s,i[(p=T+8|0)>>2]=n;t:do{if((0|M)<0)s=0;else for(f=0,d=0,s=r;;){C=v*(h=+(d>>>0)+4294967296*+(0|f))+ +(0|s),u=_*h+ +(0|i[y>>2]),h=g*h+ +(0|i[x>>2]),n=~~+Ve(+C),A=~~+Ve(+u),s=~~+Ve(+h),C=+l(+(+(0|n)-C)),u=+l(+(+(0|A)-u)),h=+l(+(+(0|s)-h));do{if(!(C>u&C>h)){if(c=0-n|0,u>h){r=c-s|0;break}r=A,s=c-A|0;break}n=0-(A+s)|0,r=A;}while(0);if(i[T>>2]=n,i[m>>2]=r,i[p>>2]=s,bt(T),0|(s=0|ce(t,e,T,a+(d<<3)|0)))break t;if(!((0|f)<(0|w)|(0|f)==(0|w)&d>>>0<M>>>0)){s=0;break t}s=0|De(0|d,0|f,1,0),f=c=0|E(),d=s,s=0|i[b>>2];}}while(0);return D=o,0|(T=s)}return D=o,0|(T=s)},_gridPathCellsSize:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s=0,A=0,l=0;return o=D,D=D+32|0,l=o,(s=0|le(t|=0,e|=0,t,e,A=o+12|0))||(s=0|le(t,e,n,r,l))?(D=o,0|(l=s)):(r=0|De(0|(r=0|vt(A,l)),((0|r)<0)<<31>>31,1,0),A=0|E(),i[(l=a)>>2]=r,i[l+4>>2]=A,D=o,0|(l=0))},_gridRingUnsafe:function(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var a,o,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0;if(o=D,D=D+16|0,p=o+8|0,i[(d=a=o)>>2]=t,i[d+4>>2]=e,!n)return i[(p=r)>>2]=t,i[p+4>>2]=e,D=o,0|(p=0);i[p>>2]=0;t:do{if(0|Nt(t,e))t=9;else {if(A=(0|n)>0){s=0,d=t;do{if(0|(t=0|N(d,e,4,p,a)))break t;if(s=s+1|0,0|Nt(d=0|i[(e=a)>>2],e=0|i[e+4>>2])){t=9;break t}}while((0|s)<(0|n));if(i[(f=r)>>2]=d,i[f+4>>2]=e,f=n+-1|0,A){h=0,t=1;do{if(s=22384+(h<<2)|0,5==(0|h))for(l=0|i[s>>2],A=0,s=t;;){if(0|(t=0|N(0|i[(t=a)>>2],0|i[t+4>>2],l,p,a)))break t;if((0|A)!=(0|f)){if(c=0|i[(u=a)>>2],u=0|i[u+4>>2],i[(t=r+(s<<3)|0)>>2]=c,i[t+4>>2]=u,0|Nt(c,u)){t=9;break t}t=s+1|0;}else t=s;if((0|(A=A+1|0))>=(0|n))break;s=t;}else for(l=a,u=0|i[s>>2],c=0,s=t,A=0|i[l>>2],l=0|i[l+4>>2];;){if(0|(t=0|N(A,l,u,p,a)))break t;if(A=0|i[(l=a)>>2],l=0|i[l+4>>2],i[(t=r+(s<<3)|0)>>2]=A,i[t+4>>2]=l,t=s+1|0,0|Nt(A,l)){t=9;break t}if((0|(c=c+1|0))>=(0|n))break;s=t;}h=h+1|0;}while(h>>>0<6);l=d,s=0|i[(t=a)>>2],A=e,t=0|i[t+4>>2];}else l=d,s=d,A=e,t=e;}else i[(l=r)>>2]=t,i[l+4>>2]=e,l=t,s=t,A=e,t=e;t=(0|l)==(0|s)&(0|A)==(0|t)?0:9;}}while(0);return D=o,0|(p=t)},_i64Add:De,_i64Subtract:Oe,_isPentagon:Nt,_isResClassIII:function(t,e){return e=0|ze(0|(t|=0),0|(e|=0),52),E(),1&e},_isValidCell:It,_isValidDirectedEdge:function(t,e){var n=0;switch(n=0|ze(0|(t|=0),0|(e|=0),56),E(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|Nt(t,n))?0|(n=0):0|(n=0|It(t,n)):0|(n=0)},_isValidVertex:function(t,e){t|=0;var n,r,a=0,o=0;return r=D,D=D+16|0,n=r,!0&536870912==(2013265920&(e|=0))&&0|It(t,a=-2130706433&e|134217728)?(o=0|ze(0|t,0|e,56),E(),a=(o=!(0|ye(t,a,7&o,n)))&((0|i[(a=n)>>2])==(0|t)?(0|i[a+4>>2])==(0|e):0)&1,D=r,0|a):(D=r,0|(a=0))},_latLngToCell:jt,_llvm_maxnum_f64:He,_llvm_minnum_f64:je,_llvm_round_f64:Ve,_localIjToCell:function(t,e,n,r,i){var a,o;return t|=0,e|=0,n|=0,i|=0,o=D,D=D+16|0,a=o,(r|=0)?n=15:(n=0|yt(n,a))||(n=0|ce(t,e,a,i)),D=o,0|n},_malloc:Re,_maxFaceCount:function(t,e,n){n|=0;var r=0,a=0;if(a=0|ze(0|(t|=0),0|(e|=0),45),E(),!(0|F(127&a)))return a=2,i[n>>2]=a,0;if(a=0|ze(0|t,0|e,52),E(),!(a&=15))return a=5,i[n>>2]=a,0;for(r=1;;){if(!(!((0|Ge(7,0,3*(15-r|0)|0))&t)&!(E()&e))){r=2,t=6;break}if(!(r>>>0<a>>>0)){r=5,t=6;break}r=r+1|0;}return 6==(0|t)?(i[n>>2]=r,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,r=0,a=0;return (0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|ee(15,e)):(a=0|Ne(0|t,0|(n=((0|t)<0)<<31>>31),3,0),r=0|E(),n=0|De(0|t,0|n,1,0),n=0|De(0|(n=0|Ne(0|a,0|r,0|n,0|E())),0|E(),1,0),t=0|E(),i[e>>2]=n,i[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,r){e|=0,r|=0;var a,o=0,s=0,A=0,l=0,c=0;if(a=D,D=D+48|0,o=a+16|0,s=a+8|0,A=a,0|(n|=0))return D=a,0|(A=15);if(l=0|i[(c=t|=0)+4>>2],i[(n=s)>>2]=i[c>>2],i[n+4>>2]=l,fe(s,o),!(e=0|Y(o,e,A))){if(n=0|i[s>>2],(0|(s=0|i[t+8>>2]))>0){o=0|i[t+12>>2],e=0;do{n=(0|i[o+(e<<3)>>2])+n|0,e=e+1|0;}while((0|e)<(0|s))}o=0|i[(e=A)>>2],(0|(e=0|i[e+4>>2]))<(0|(s=((0|n)<0)<<31>>31))|(0|e)==(0|s)&o>>>0<n>>>0?(i[(e=A)>>2]=n,i[e+4>>2]=s,e=s):n=o,l=0|De(0|n,0|e,12,0),c=0|E(),i[(e=A)>>2]=l,i[e+4>>2]=c,i[(e=r)>>2]=l,i[e+4>>2]=c,e=0;}return D=a,0|(c=e)},_memcpy:We,_memset:Xe,_originToDirectedEdges:function(t,e,n){n|=0;var r,a=0;return r=!(0|Nt(t|=0,e|=0)),e&=-2130706433,i[(a=n)>>2]=r?t:0,i[a+4>>2]=r?285212672|e:0,i[(a=n+8|0)>>2]=t,i[a+4>>2]=301989888|e,i[(a=n+16|0)>>2]=t,i[a+4>>2]=318767104|e,i[(a=n+24|0)>>2]=t,i[a+4>>2]=335544320|e,i[(a=n+32|0)>>2]=t,i[a+4>>2]=352321536|e,i[(n=n+40|0)>>2]=t,i[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,r){e|=0,r|=0;var a,o,s,A,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,S=0,T=0,C=0,R=0,P=0,L=0,O=0,I=0,N=0,B=0,F=0;if(A=D,D=D+112|0,a=A+80|0,f=A+72|0,o=A,s=A+56|0,0|(n|=0))return D=A,0|(F=15);if(!(F=0|Re(32+(i[(d=(t|=0)+8|0)>>2]<<5)|0)))return D=A,0|(F=13);if(de(t,F),B=0|i[(N=t)+4>>2],i[(n=f)>>2]=i[N>>2],i[n+4>>2]=B,fe(f,a),n=0|Y(a,e,o))N=0,B=0;else {if(n=0|i[f>>2],(0|(c=0|i[d>>2]))>0){u=0|i[t+12>>2],l=0;do{n=(0|i[u+(l<<3)>>2])+n|0,l=l+1|0;}while((0|l)!=(0|c));l=n;}else l=n;c=0|i[(n=o)>>2],(0|(n=0|i[n+4>>2]))<(0|(u=((0|l)<0)<<31>>31))|(0|n)==(0|u)&c>>>0<l>>>0?(i[(n=o)>>2]=l,i[n+4>>2]=u,n=u):l=c,N=0|De(0|l,0|n,12,0),B=0|E(),i[(n=o)>>2]=N,i[n+4>>2]=B,n=0;}if(0|n)return Pe(F),D=A,0|(F=n);if(!(l=0|Le(N,8)))return Pe(F),D=A,0|(F=13);if(!(h=0|Le(N,8)))return Pe(F),Pe(l),D=A,0|(F=13);i[(O=a)>>2]=0,i[O+4>>2]=0,I=0|i[(O=t)+4>>2],i[(n=f)>>2]=i[O>>2],i[n+4>>2]=I,n=0|k(f,N,B,e,a,l,h);t:do{if(n)Pe(l),Pe(h),Pe(F);else {e:do{if((0|i[d>>2])>0){for(u=t+12|0,c=0;n=0|k((0|i[u>>2])+(c<<3)|0,N,B,e,a,l,h),c=c+1|0,!(0|n);)if((0|c)>=(0|i[d>>2]))break e;Pe(l),Pe(h),Pe(F);break t}}while(0);(0|B)>0|!(0|B)&N>>>0>0&&Xe(0|h,0,N<<3),O=0|i[(I=a)+4>>2];e:do{if((0|O)>0|!(0|O)&(0|i[I>>2])>>>0>0){R=l,P=h,L=l,O=h,I=l,n=l,S=l,T=h,C=h,l=h;n:for(;;){for(x=0,b=0,M=0,w=0,c=0,u=0;;){f=(h=o)+56|0;do{i[h>>2]=0,h=h+4|0;}while((0|h)<(0|f));if(0|q(d=0|i[(e=R+(x<<3)|0)>>2],e=0|i[e+4>>2],1,o,0)){f=(h=o)+56|0;do{i[h>>2]=0,h=h+4|0;}while((0|h)<(0|f));0|(h=0|Le(7,4))&&(U(d,e,1,o,h,7,0,0),Pe(h));}for(y=0;;){v=0|i[(_=o+(y<<3)|0)>>2],_=0|i[_+4>>2];r:do{if(!(0|v)&!(0|_))h=c,f=u;else {if(p=0|ke(0|v,0|_,0|N,0|B),d=0|E(),!(!(0|(f=0|i[(e=h=r+(p<<3)|0)>>2]))&!(0|(e=0|i[e+4>>2])))){m=0,g=0;do{if((0|m)>(0|B)|(0|m)==(0|B)&g>>>0>N>>>0)break n;if((0|f)==(0|v)&(0|e)==(0|_)){h=c,f=u;break r}p=0|Be(0|(h=0|De(0|p,0|d,1,0)),0|E(),0|N,0|B),d=0|E(),g=0|De(0|g,0|m,1,0),m=0|E(),f=0|i[(e=h=r+(p<<3)|0)>>2],e=0|i[e+4>>2];}while(!(!(0|f)&!(0|e)))}!(0|v)&!(0|_)?(h=c,f=u):(Xt(v,_,s),0|pe(t,F,s)&&(g=0|De(0|c,0|u,1,0),u=0|E(),i[(m=h)>>2]=v,i[m+4>>2]=_,i[(c=P+(c<<3)|0)>>2]=v,i[c+4>>2]=_,c=g),h=c,f=u);}}while(0);if((y=y+1|0)>>>0>=7)break;c=h,u=f;}if(x=0|De(0|x,0|b,1,0),b=0|E(),M=0|De(0|M,0|w,1,0),w=0|E(),c=0|i[(u=a)>>2],!((0|w)<(0|(u=0|i[u+4>>2]))|(0|w)==(0|u)&M>>>0<c>>>0))break;c=h,u=f;}if((0|u)>0|!(0|u)&c>>>0>0){c=0,u=0;do{i[(w=R+(c<<3)|0)>>2]=0,i[w+4>>2]=0,c=0|De(0|c,0|u,1,0),u=0|E(),M=0|i[(w=a)+4>>2];}while((0|u)<(0|M)|((0|u)==(0|M)?c>>>0<(0|i[w>>2])>>>0:0))}if(i[(w=a)>>2]=h,i[w+4>>2]=f,!((0|f)>0|!(0|f)&h>>>0>0))break e;y=l,x=C,b=I,M=T,w=P,l=S,C=n,T=L,S=y,n=x,I=O,O=b,L=M,P=R,R=w;}Pe(L),Pe(O),Pe(F),n=1;break t}n=h;}while(0);Pe(F),Pe(l),Pe(n),n=0;}}while(0);return D=A,0|(F=n)},_readInt64AsDoubleFromPointer:function(t){return +(+((0|i[(t|=0)>>2])>>>0)+4294967296*+(0|i[t+4>>2]))},_res0CellCount:function(){return 122},_round:Qe,_sbrk:Ye,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(t,e,n,r,a,o,s){t|=0,r|=0,a|=0,o|=0;var A,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0;if(A=D,D=D+16|0,m=A,!((0|(n|=0))>0|!(0|n)&(e|=0)>>>0>0))return D=A,0|(m=0);if((0|(s|=0))>=16)return D=A,0|(m=12);d=0,p=0,f=0,l=0;t:for(;;){if(h=0|ze(0|(c=0|i[(u=t+(d<<3)|0)>>2]),0|(u=0|i[u+4>>2]),52),E(),(15&h)>(0|s)){l=12,c=11;break}if(Zt(m,c,u,s),!(0|(u=0|i[(h=m)>>2]))&!(0|(h=0|i[h+4>>2])))c=f;else {c=f;do{if(!((0|l)<(0|o)|(0|l)==(0|o)&c>>>0<a>>>0)){c=10;break t}i[(f=r+(c<<3)|0)>>2]=u,i[f+4>>2]=h,c=0|De(0|c,0|l,1,0),l=0|E(),Kt(m),u=0|i[(f=m)>>2],h=0|i[f+4>>2];}while(!(!(0|u)&!(0|h)))}if(d=0|De(0|d,0|p,1,0),!((0|(p=0|E()))<(0|n)|(0|p)==(0|n)&d>>>0<e>>>0)){l=0,c=11;break}f=c;}return 10==(0|c)?(D=A,0|(m=14)):11==(0|c)?(D=A,0|l):0},_uncompactCellsSize:function(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,f=0;s=D,D=D+16|0,o=s;t:do{if((0|n)>0|!(0|n)&e>>>0>0){for(h=0,l=0,A=0,f=0;;){if(!(!(0|(c=0|i[(u=t+(h<<3)|0)>>2]))&!(0|(u=0|i[u+4>>2]))||(u=!(0|Ut(c,u,r,o)),l=0|De(0|i[(c=o)>>2],0|i[c+4>>2],0|l,0|A),A=0|E(),u))){A=12;break}if(h=0|De(0|h,0|f,1,0),!((0|(f=0|E()))<(0|n)|(0|f)==(0|n)&h>>>0<e>>>0))break t}return D=s,0|A}l=0,A=0;}while(0);return i[a>>2]=l,i[a+4>>2]=A,D=s,0|(a=0)},_vertexToLatLng:function(t,e,n){n|=0;var r,a,o,s,A=0,l=0;return s=D,D=D+192|0,a=s,o=s+168|0,A=0|ze(0|(t|=0),0|(e|=0),56),E(),A&=7,0|(r=0|Wt(t,l=-2130706433&e|134217728,o))?(D=s,0|(l=r)):(e=0|ze(0|t,0|e,52),E(),e&=15,0|Nt(t,l)?Tt(o,e,A,1,a):Lt(o,e,A,1,a),l=a+8|0,i[n>>2]=i[l>>2],i[n+4>>2]=i[l+4>>2],i[n+8>>2]=i[l+8>>2],i[n+12>>2]=i[l+12>>2],D=s,0|(l=0))},establishStackSpace:function(t,e){D=t|=0;},stackAlloc:function(t){var e;return e=D,D=(D=D+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){D=t|=0;},stackSave:function(){return 0|D}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:gt,b:function(t){g=t;},c:function(){return g},d:function(t,e,n,r){gt("Assertion failed: "+P(t)+", at: "+[e?P(e):"unknown filename",n,r?P(r):"unknown function"]);},e:function(t){return n.___errno_location&&(S[n.___errno_location()>>2]=t),t},f:$,g:function(t,e,n){w.set(w.subarray(e,e+n),t);},h:function(t){var e=$(),n=16777216,r=2130706432;if(t>r)return !1;for(var i=Math.max(e,16777216);i<t;)i=i<=536870912?L(2*i,n):Math.min(L((3*i+2147483648)/4,n),r);return !!tt(i)},i:function(t){gt("OOM");},j:Z,k:K,l:tt,m:J,n:function(){var t=J();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),K(t)},o:24144,p:24128},b);n.___divdi3=it.___divdi3,n.___muldi3=it.___muldi3,n.___remdi3=it.___remdi3,n.___uremdi3=it.___uremdi3,n._areNeighborCells=it._areNeighborCells,n._bitshift64Ashr=it._bitshift64Ashr,n._bitshift64Lshr=it._bitshift64Lshr,n._bitshift64Shl=it._bitshift64Shl,n._calloc=it._calloc,n._cellAreaKm2=it._cellAreaKm2,n._cellAreaM2=it._cellAreaM2,n._cellAreaRads2=it._cellAreaRads2,n._cellToBoundary=it._cellToBoundary,n._cellToCenterChild=it._cellToCenterChild,n._cellToChildPos=it._cellToChildPos,n._cellToChildren=it._cellToChildren,n._cellToChildrenSize=it._cellToChildrenSize,n._cellToLatLng=it._cellToLatLng,n._cellToLocalIj=it._cellToLocalIj,n._cellToParent=it._cellToParent,n._cellToVertex=it._cellToVertex,n._cellToVertexes=it._cellToVertexes,n._cellsToDirectedEdge=it._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=it._cellsToLinkedMultiPolygon,n._childPosToCell=it._childPosToCell,n._compactCells=it._compactCells,n._destroyLinkedMultiPolygon=it._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=it._directedEdgeToBoundary,n._directedEdgeToCells=it._directedEdgeToCells,n._edgeLengthKm=it._edgeLengthKm,n._edgeLengthM=it._edgeLengthM,n._edgeLengthRads=it._edgeLengthRads;var at=n._emscripten_replace_memory=it._emscripten_replace_memory;n._free=it._free,n._getBaseCellNumber=it._getBaseCellNumber,n._getDirectedEdgeDestination=it._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=it._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=it._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=it._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=it._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=it._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=it._getIcosahedronFaces,n._getNumCells=it._getNumCells,n._getPentagons=it._getPentagons,n._getRes0Cells=it._getRes0Cells,n._getResolution=it._getResolution,n._greatCircleDistanceKm=it._greatCircleDistanceKm,n._greatCircleDistanceM=it._greatCircleDistanceM,n._greatCircleDistanceRads=it._greatCircleDistanceRads,n._gridDisk=it._gridDisk,n._gridDiskDistances=it._gridDiskDistances,n._gridDistance=it._gridDistance,n._gridPathCells=it._gridPathCells,n._gridPathCellsSize=it._gridPathCellsSize,n._gridRingUnsafe=it._gridRingUnsafe,n._i64Add=it._i64Add,n._i64Subtract=it._i64Subtract,n._isPentagon=it._isPentagon,n._isResClassIII=it._isResClassIII,n._isValidCell=it._isValidCell,n._isValidDirectedEdge=it._isValidDirectedEdge,n._isValidVertex=it._isValidVertex,n._latLngToCell=it._latLngToCell,n._llvm_maxnum_f64=it._llvm_maxnum_f64,n._llvm_minnum_f64=it._llvm_minnum_f64,n._llvm_round_f64=it._llvm_round_f64,n._localIjToCell=it._localIjToCell,n._malloc=it._malloc,n._maxFaceCount=it._maxFaceCount,n._maxGridDiskSize=it._maxGridDiskSize,n._maxPolygonToCellsSize=it._maxPolygonToCellsSize,n._memcpy=it._memcpy,n._memset=it._memset,n._originToDirectedEdges=it._originToDirectedEdges,n._pentagonCount=it._pentagonCount,n._polygonToCells=it._polygonToCells,n._readInt64AsDoubleFromPointer=it._readInt64AsDoubleFromPointer,n._res0CellCount=it._res0CellCount,n._round=it._round,n._sbrk=it._sbrk,n._sizeOfCellBoundary=it._sizeOfCellBoundary,n._sizeOfCoordIJ=it._sizeOfCoordIJ,n._sizeOfGeoLoop=it._sizeOfGeoLoop,n._sizeOfGeoPolygon=it._sizeOfGeoPolygon,n._sizeOfH3Index=it._sizeOfH3Index,n._sizeOfLatLng=it._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=it._sizeOfLinkedGeoPolygon,n._uncompactCells=it._uncompactCells,n._uncompactCellsSize=it._uncompactCellsSize,n._vertexToLatLng=it._vertexToLatLng,n.establishStackSpace=it.establishStackSpace;var ot,st,At=n.stackAlloc=it.stackAlloc,lt=n.stackRestore=it.stackRestore,ct=n.stackSave=it.stackSave;if(n.asm=it,n.cwrap=function(t,e,n,r){var i=(n=n||[]).every((function(t){return "number"===t}));return "string"!==e&&i&&!r?y(t):function(){return x(t,e,n,arguments)}},n.setValue=function(t,e,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":M[t|0]=e;break;case"i16":E[t>>1]=e;break;case"i32":S[t>>2]=e;break;case"i64":W=[e>>>0,(V=e,+k(V)>=1?V>0?(0|G(+z(V/4294967296),4294967295))>>>0:~~+F((V-+(~~V>>>0))/4294967296)>>>0:0)],S[t>>2]=W[0],S[t+4>>2]=W[1];break;case"float":T[t>>2]=e;break;case"double":C[t>>3]=e;break;default:gt("invalid type for setValue: "+n);}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return M[t|0];case"i16":return E[t>>1];case"i32":case"i64":return S[t>>2];case"float":return T[t>>2];case"double":return C[t>>3];default:gt("invalid type for getValue: "+e);}return null},X)if(Y(X)||(ot=X,X=n.locateFile?n.locateFile(ot,d):d+ot),A||s){var ut=u(X);w.set(ut,8);}else {H++,n.monitorRunDependencies&&n.monitorRunDependencies(H);var ht=function(t){t.byteLength&&(t=new Uint8Array(t)),w.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(t){if(H--,n.monitorRunDependencies&&n.monitorRunDependencies(H),0==H&&j){var e=j;j=null,e();}}();},ft=function(){c(X,ht,(function(){throw "could not load memory initializer "+X}));},dt=rt(X);if(dt)ht(dt.buffer);else if(n.memoryInitializerRequest){var pt=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=rt(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+X),void ft();e=r.buffer;}ht(e);};n.memoryInitializerRequest.response?setTimeout(pt,0):n.memoryInitializerRequest.addEventListener("load",pt);}else ft();}function mt(t){function e(){st||(st=!0,v||(I(U),I(N),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),B.unshift(t);var t;I(B);}()));}H>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),q.unshift(t);var t;I(q);}(),H>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("");}),1),e();}),1)):e()));}function gt(t){throw n.onAbort&&n.onAbort(t),p(t+=""),m(t),v=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(j=function t(){st||mt(),st||(j=t);},n.run=mt,n.abort=gt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return mt(),t}("object"==typeof Vm?Vm:{}),Wm="number",Xm=[["sizeOfH3Index",Wm],["sizeOfLatLng",Wm],["sizeOfCellBoundary",Wm],["sizeOfGeoLoop",Wm],["sizeOfGeoPolygon",Wm],["sizeOfLinkedGeoPolygon",Wm],["sizeOfCoordIJ",Wm],["readInt64AsDoubleFromPointer",Wm],["isValidCell",Wm,[Wm,Wm]],["latLngToCell",Wm,[Wm,Wm,Wm,Wm]],["cellToLatLng",Wm,[Wm,Wm,Wm]],["cellToBoundary",Wm,[Wm,Wm,Wm]],["maxGridDiskSize",Wm,[Wm,Wm]],["gridDisk",Wm,[Wm,Wm,Wm,Wm]],["gridDiskDistances",Wm,[Wm,Wm,Wm,Wm,Wm]],["gridRingUnsafe",Wm,[Wm,Wm,Wm,Wm]],["maxPolygonToCellsSize",Wm,[Wm,Wm,Wm,Wm]],["polygonToCells",Wm,[Wm,Wm,Wm,Wm]],["cellsToLinkedMultiPolygon",Wm,[Wm,Wm,Wm]],["destroyLinkedMultiPolygon",null,[Wm]],["compactCells",Wm,[Wm,Wm,Wm,Wm]],["uncompactCells",Wm,[Wm,Wm,Wm,Wm,Wm,Wm]],["uncompactCellsSize",Wm,[Wm,Wm,Wm,Wm,Wm]],["isPentagon",Wm,[Wm,Wm]],["isResClassIII",Wm,[Wm,Wm]],["getBaseCellNumber",Wm,[Wm,Wm]],["getResolution",Wm,[Wm,Wm]],["maxFaceCount",Wm,[Wm,Wm,Wm]],["getIcosahedronFaces",Wm,[Wm,Wm,Wm]],["cellToParent",Wm,[Wm,Wm,Wm,Wm]],["cellToChildren",Wm,[Wm,Wm,Wm,Wm]],["cellToCenterChild",Wm,[Wm,Wm,Wm,Wm]],["cellToChildrenSize",Wm,[Wm,Wm,Wm,Wm]],["cellToChildPos",Wm,[Wm,Wm,Wm,Wm]],["childPosToCell",Wm,[Wm,Wm,Wm,Wm,Wm,Wm]],["areNeighborCells",Wm,[Wm,Wm,Wm,Wm,Wm]],["cellsToDirectedEdge",Wm,[Wm,Wm,Wm,Wm,Wm]],["getDirectedEdgeOrigin",Wm,[Wm,Wm,Wm]],["getDirectedEdgeDestination",Wm,[Wm,Wm,Wm]],["isValidDirectedEdge",Wm,[Wm,Wm]],["directedEdgeToCells",Wm,[Wm,Wm,Wm]],["originToDirectedEdges",Wm,[Wm,Wm,Wm]],["directedEdgeToBoundary",Wm,[Wm,Wm,Wm]],["gridDistance",Wm,[Wm,Wm,Wm,Wm,Wm]],["gridPathCells",Wm,[Wm,Wm,Wm,Wm,Wm]],["gridPathCellsSize",Wm,[Wm,Wm,Wm,Wm,Wm]],["cellToLocalIj",Wm,[Wm,Wm,Wm,Wm,Wm,Wm]],["localIjToCell",Wm,[Wm,Wm,Wm,Wm,Wm]],["getHexagonAreaAvgM2",Wm,[Wm,Wm]],["getHexagonAreaAvgKm2",Wm,[Wm,Wm]],["getHexagonEdgeLengthAvgM",Wm,[Wm,Wm]],["getHexagonEdgeLengthAvgKm",Wm,[Wm,Wm]],["greatCircleDistanceM",Wm,[Wm,Wm]],["greatCircleDistanceKm",Wm,[Wm,Wm]],["greatCircleDistanceRads",Wm,[Wm,Wm]],["cellAreaM2",Wm,[Wm,Wm,Wm]],["cellAreaKm2",Wm,[Wm,Wm,Wm]],["cellAreaRads2",Wm,[Wm,Wm,Wm]],["edgeLengthM",Wm,[Wm,Wm,Wm]],["edgeLengthKm",Wm,[Wm,Wm,Wm]],["edgeLengthRads",Wm,[Wm,Wm,Wm]],["getNumCells",Wm,[Wm,Wm]],["getRes0Cells",Wm,[Wm]],["res0CellCount",Wm],["getPentagons",Wm,[Wm,Wm]],["pentagonCount",Wm],["cellToVertex",Wm,[Wm,Wm,Wm,Wm]],["cellToVertexes",Wm,[Wm,Wm,Wm]],["vertexToLatLng",Wm,[Wm,Wm,Wm]],["isValidVertex",Wm,[Wm,Wm]]],Qm=4,Ym={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range"};
     5Vf.readability=function(t,e){var n=Vf(t),r=Vf(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Vf.isReadable=function(t,e,n){var r,i,a=Vf.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},Vf.mostReadable=function(t,e,n){var r,i,a,o,s=null,A=0;i=(n=n||{}).includeFallbackColors,a=n.level,o=n.size;for(var l=0;l<e.length;l++)(r=Vf.readability(t,e[l]))>A&&(A=r,s=Vf(e[l]));return Vf.isReadable(t,s,{level:a,size:o})||!i?s:(n.includeFallbackColors=!1,Vf.mostReadable(t,["#fff","#000"],n))};var Ad=Vf.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ld=Vf.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(Ad);function cd(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function ud(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function hd(t){return Math.min(1,Math.max(0,t))}function fd(t){return parseInt(t,16)}function dd(t){return 1==t.length?"0"+t:""+t}function pd(t){return t<=1&&(t=100*t+"%"),t}function md(t){return Math.round(255*parseFloat(t)).toString(16)}function gd(t){return fd(t)/255}var vd,_d,yd,xd=(_d="[\\s|\\(]+("+(vd="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+vd+")[,|\\s]+("+vd+")\\s*\\)?",yd="[\\s|\\(]+("+vd+")[,|\\s]+("+vd+")[,|\\s]+("+vd+")[,|\\s]+("+vd+")\\s*\\)?",{CSS_UNIT:new RegExp(vd),rgb:new RegExp("rgb"+_d),rgba:new RegExp("rgba"+yd),hsl:new RegExp("hsl"+_d),hsla:new RegExp("hsla"+yd),hsv:new RegExp("hsv"+_d),hsva:new RegExp("hsva"+yd),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function bd(t){return!!xd.CSS_UNIT.exec(t)}function Md(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function wd(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Sd(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ed(t){return function(t){if(Array.isArray(t))return Td(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Sd(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sd(t,e){if(t){if("string"==typeof t)return Td(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Td(t,e):void 0}}function Td(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Cd(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var Rd=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(e instanceof Array?e.length?e:[void 0]:[e]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),a=t.reduce((function(t,e){var r=t,a=e;return i.forEach((function(t,e){var o,s=t.keyAccessor;if(t.isProp){var A=a,l=A[s],c=Md(A,[s].map(Cd));o=l,a=c}else o=s(a,e);e+1<i.length?(r.hasOwnProperty(o)||(r[o]={}),r=r[o]):n?(r.hasOwnProperty(o)||(r[o]=[]),r[o].push(a)):r[o]=a})),t}),{});n instanceof Function&&function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;r===i.length?Object.keys(e).forEach((function(t){return e[t]=n(e[t])})):Object.values(e).forEach((function(e){return t(e,r+1)}))}(a);var o=a;return r&&(o=[],function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.length===i.length?o.push({keys:n,vals:e}):Object.entries(e).forEach((function(e){var r=wd(e,2),i=r[0],a=r[1];return t(a,[].concat(Ed(n),[i]))}))}(a),e instanceof Array&&0===e.length&&1===o.length&&(o[0].keys=[])),o};function Pd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ld(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dd(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Od(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||qd(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Id(t){return function(t){if(Array.isArray(t))return Ud(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||qd(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qd(t,e){if(t){if("string"==typeof t)return Ud(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ud(t,e):void 0}}function Ud(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Nd=["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"];function Bd(t,e,n){var r=n.objBindAttr,i=void 0===r?"__obj":r,a=n.dataBindAttr,o=void 0===a?"__data":a,s=n.idAccessor,A=n.purge,l=void 0!==A&&A,c=function(t){return t.hasOwnProperty(o)},u=e.filter((function(t){return!c(t)})),h=e.filter(c).map((function(t){return t[o]})),f=l?{enter:t,exit:h,update:[]}:function(t,e,n){var r={enter:[],update:[],exit:[]};if(n){var i=Rd(t,n,!1),a=Rd(e,n,!1),o=Object.assign({},i,a);Object.entries(o).forEach((function(t){var e=Od(t,2),n=e[0],o=e[1],s=i.hasOwnProperty(n)?a.hasOwnProperty(n)?"update":"exit":"enter";r[s].push("update"===s?[i[n],a[n]]:o)}))}else{var s=new Set(t),A=new Set(e);new Set([].concat(Id(s),Id(A))).forEach((function(t){var e=s.has(t)?A.has(t)?"update":"exit":"enter";r[e].push("update"===e?[t,t]:t)}))}return r}(h,t,s);return f.update=f.update.map((function(t){var e=Od(t,2),n=e[0],r=e[1];return n!==r&&(r[i]=n[i],r[i][o]=r),r})),f.exit=f.exit.concat(u.map((function(t){return Ld({},i,t)}))),f}function kd(t,e,n,r,i){var a=i.createObj,o=void 0===a?function(t){return{}}:a,s=i.updateObj,A=void 0===s?function(t,e){}:s,l=i.exitObj,c=void 0===l?function(t){}:l,u=i.objBindAttr,h=void 0===u?"__obj":u,f=i.dataBindAttr,d=void 0===f?"__data":f,p=Dd(i,Nd),m=Bd(t,e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pd(Object(n),!0).forEach((function(e){Ld(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pd(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({objBindAttr:h,dataBindAttr:d},p)),g=m.enter,v=m.update;m.exit.forEach((function(t){var e=t[h];delete t[h],c(e),r(e)}));var _=function(t){var e=[];return t.forEach((function(t){var n=o(t);n&&(n[d]=t,t[h]=n,e.push(n))})),e}(g);!function(t){t.forEach((function(t){var e=t[h];e&&(e[d]=t,A(e,t))}))}([].concat(Id(g),Id(v))),_.forEach(n)}var Fd={exports:{}};!function(t,e){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var r=n(1),i=function(){function t(t,e,n){void 0===t&&(t=NaN),void 0===e&&(e=NaN),void 0===n&&(n=!1),this._minFPS=e,this._maxFPS=t,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new r.default,this._onPause=new r.default,this._onTick=new r.default,this._onTickOncePerFrame=new r.default,n||this.resume()}return t.prototype.updateOnce=function(t){t(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},t.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateOnce())},t.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle))},t.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll()},Object.defineProperty(t.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timeScale",{get:function(){return this._timeScale},set:function(t){this._timeScale!==t&&(this._timeScale=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),t.prototype.animateOnce=function(){var t=this;this._animationFrameHandle=window.requestAnimationFrame((function(){return t.onFrame()}))},t.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce()},t.prototype.update=function(t,e){void 0===e&&(e=!0),this._currentTick++,this._currentTime+=t,this._tickDeltaTime=t,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),e&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},t.prototype.getTimer=function(){return Date.now()},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){!function(e,n){t.exports=n()}(0,(function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){var n=function(){function t(){this.functions=[]}return t.prototype.add=function(t){return-1===this.functions.indexOf(t)&&(this.functions.push(t),!0)},t.prototype.remove=function(t){var e=this.functions.indexOf(t);return e>-1&&(this.functions.splice(e,1),!0)},t.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},t.prototype.dispatch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.functions.concat().forEach((function(e){e.apply(void 0,t)}))},Object.defineProperty(t.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=n}])}))}])}(Fd);var zd=el(Fd.exports);function Gd(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var Hd=t=>()=>t;function jd(t){return 1==(t=+t)?Vd:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Hd(isNaN(e)?n:e)}}function Vd(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Hd(isNaN(t)?e:t)}var Wd=function t(e){var n=jd(e);function r(t,e){var r=n((t=Rf(t)).r,(e=Rf(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=Vd(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function Xd(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(n=0;n<r;++n)i[n]=t[n]*(1-a)+e[n]*a;return i}}function Qd(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Yd(t,e){return(Qd(e)?Xd:Zd)(t,e)}function Zd(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),o=new Array(r);for(n=0;n<i;++n)a[n]=rp(t[n],e[n]);for(;n<r;++n)o[n]=e[n];return function(t){for(n=0;n<i;++n)o[n]=a[n](t);return o}}function Kd(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Jd(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function $d(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=rp(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var tp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ep=new RegExp(tp.source,"g");function np(t,e){var n,r,i,a=tp.lastIndex=ep.lastIndex=0,o=-1,s=[],A=[];for(t+="",e+="";(n=tp.exec(t))&&(r=ep.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,A.push({i:o,x:Jd(n,r)})),a=ep.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?A[0]?function(t){return function(e){return t(e)+""}}(A[0].x):function(t){return function(){return t}}(e):(e=A.length,function(t){for(var n,r=0;r<e;++r)s[(n=A[r]).i]=n.x(t);return s.join("")})}function rp(t,e){var n,r=typeof e;return null==e||"boolean"===r?Hd(e):("number"===r?Jd:"string"===r?(n=Sf(e))?(e=n,Wd):np:e instanceof Sf?Wd:e instanceof Date?Kd:Qd(e)?Xd:Array.isArray(e)?Zd:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?$d:Jd)(t,e)}function ip(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function ap(t){return+t}var op=[0,1];function sp(t){return t}function Ap(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function lp(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=Ap(i,r),a=n(o,a)):(r=Ap(r,i),a=n(a,o)),function(t){return a(r(t))}}function cp(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=Ap(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(e){var n=Il(t,e,1,r)-1;return a[n](i[n](e))}}function up(){var t,e,n,r,i,a,o=op,s=op,A=rp,l=sp;function c(){var t=Math.min(o.length,s.length);return l!==sp&&(l=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(o[0],o[t-1])),r=t>2?cp:lp,i=a=null,u}function u(e){return null==e||isNaN(e=+e)?n:(i||(i=r(o.map(t),s,A)))(t(l(e)))}return u.invert=function(n){return l(e((a||(a=r(s,o.map(t),Jd)))(n)))},u.domain=function(t){return arguments.length?(o=Array.from(t,ap),c()):o.slice()},u.range=function(t){return arguments.length?(s=Array.from(t),c()):s.slice()},u.rangeRound=function(t){return s=Array.from(t),A=ip,c()},u.clamp=function(t){return arguments.length?(l=!!t||sp,c()):l!==sp},u.interpolate=function(t){return arguments.length?(A=t,c()):A},u.unknown=function(t){return arguments.length?(n=t,u):n},function(n,r){return t=n,e=r,c()}}function hp(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function fp(t){return(t=hp(Math.abs(t)))?t[1]:NaN}var dp,pp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mp(t){if(!(e=pp.exec(t)))throw new Error("invalid format: "+t);var e;return new gp({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 gp(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 vp(t,e){var n=hp(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}mp.prototype=gp.prototype,gp.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 _p={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>vp(100*t,e),r:vp,s:function(t,e){var n=hp(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(dp=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+hp(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function yp(t){return t}var xp,bp,Mp,wp=Array.prototype.map,Ep=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Sp(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?yp:(e=wp.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],A=0;i>0&&s>0&&(A+s+1>r&&(s=Math.max(1,r-A)),a.push(t.substring(i-=s,i+s)),!((A+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?yp:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(wp.call(t.numerals,String)),A=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function u(t){var e=(t=mp(t)).fill,n=t.align,u=t.sign,h=t.symbol,f=t.zero,d=t.width,p=t.comma,m=t.precision,g=t.trim,v=t.type;"n"===v?(p=!0,v="g"):_p[v]||(void 0===m&&(m=12),g=!0,v="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var _="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",y="$"===h?a:/[%p]/.test(v)?A:"",x=_p[v],b=/[defgprs%]/.test(v);function M(t){var i,a,A,h=_,M=y;if("c"===v)M=x(t)+M,t="";else{var w=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:x(Math.abs(t),m),g&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),w&&0==+t&&"+"!==u&&(w=!1),h=(w?"("===u?u:l:"-"===u||"("===u?"":u)+h,M=("s"===v?Ep[8+dp/3]:"")+M+(w&&"("===u?")":""),b)for(i=-1,a=t.length;++i<a;)if(48>(A=t.charCodeAt(i))||A>57){M=(46===A?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}p&&!f&&(t=r(t,1/0));var E=h.length+t.length+M.length,S=E<d?new Array(d-E+1).join(e):"";switch(p&&f&&(t=r(S+t,S.length?d-M.length:1/0),S=""),n){case"<":t=h+t+M+S;break;case"=":t=h+S+t+M;break;case"^":t=S.slice(0,E=S.length>>1)+h+t+M+S.slice(E);break;default:t=S+h+t+M}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),M.toString=function(){return t+""},M}return{format:u,formatPrefix:function(t,e){var n=u(((t=mp(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(fp(e)/3))),i=Math.pow(10,-r),a=Ep[8+r/3];return function(t){return n(i*t)+a}}}}function Tp(t,e,n,r){var i,a=function(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?zl(e,t,n):zl(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}(t,e,n);switch((r=mp(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(fp(e)/3)))-fp(Math.abs(t)))}(a,o))||(r.precision=i),Mp(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,fp(e)-fp(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-fp(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type))}return bp(r)}function Cp(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,a,o]=r?Fl(e,t,n):Fl(t,e,n);if(!(a>=i))return[];const s=a-i+1,A=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)A[t]=(a-t)/-o;else for(let t=0;t<s;++t)A[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)A[t]=(i+t)/-o;else for(let t=0;t<s;++t)A[t]=(i+t)*o;return A}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Tp(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,a=e(),o=0,s=a.length-1,A=a[o],l=a[s],c=10;for(l<A&&(i=A,A=l,l=i,i=o,o=s,s=i);c-- >0;){if((i=zl(A,l,n))===r)return a[o]=A,a[s]=l,e(a);if(i>0)A=Math.floor(A/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;A=Math.ceil(A*i)/i,l=Math.floor(l*i)/i}r=i}return t},t}function Rp(){var t=up()(sp,sp);return t.copy=function(){return e=t,Rp().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},Gd.apply(t,arguments),Cp(t)}xp=Sp({thousands:",",grouping:[3],currency:["$",""]}),bp=xp.format,Mp=xp.formatPrefix;const Pp=134217729,Lp=33306690738754706e-32;function Dp(t,e,n,r,i){let a,o,s,A,l=e[0],c=r[0],u=0,h=0;c>l==c>-l?(a=l,l=e[++u]):(a=c,c=r[++h]);let f=0;if(u<t&&h<n)for(c>l==c>-l?(o=l+a,s=a-(o-l),l=e[++u]):(o=c+a,s=a-(o-c),c=r[++h]),a=o,0!==s&&(i[f++]=s);u<t&&h<n;)c>l==c>-l?(o=a+l,A=o-a,s=a-(o-A)+(l-A),l=e[++u]):(o=a+c,A=o-a,s=a-(o-A)+(c-A),c=r[++h]),a=o,0!==s&&(i[f++]=s);for(;u<t;)o=a+l,A=o-a,s=a-(o-A)+(l-A),l=e[++u],a=o,0!==s&&(i[f++]=s);for(;h<n;)o=a+c,A=o-a,s=a-(o-A)+(c-A),c=r[++h],a=o,0!==s&&(i[f++]=s);return 0===a&&0!==f||(i[f++]=a),f}function Op(t){return new Float64Array(t)}const Ip=22204460492503146e-32,qp=11093356479670487e-47,Up=Op(4),Np=Op(8),Bp=Op(12),kp=Op(16),Fp=Op(4);function zp(t,e,n,r,i,a){const o=(e-a)*(n-i),s=(t-i)*(r-a),A=o-s,l=Math.abs(o+s);return Math.abs(A)>=33306690738754716e-32*l?A:-function(t,e,n,r,i,a,o){let s,A,l,c,u,h,f,d,p,m,g,v,_,y,x,b,M,w;const E=t-i,S=n-i,T=e-a,C=r-a;y=E*C,h=Pp*E,f=h-(h-E),d=E-f,h=Pp*C,p=h-(h-C),m=C-p,x=d*m-(y-f*p-d*p-f*m),b=T*S,h=Pp*T,f=h-(h-T),d=T-f,h=Pp*S,p=h-(h-S),m=S-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Up[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Up[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Up[2]=v-(w-u)+(g-u),Up[3]=w;let R=function(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}(4,Up),P=Ip*o;if(R>=P||-R>=P)return R;if(u=t-E,s=t-(E+u)+(u-i),u=n-S,l=n-(S+u)+(u-i),u=e-T,A=e-(T+u)+(u-a),u=r-C,c=r-(C+u)+(u-a),0===s&&0===A&&0===l&&0===c)return R;if(P=qp*o+Lp*Math.abs(R),R+=E*c+C*s-(T*l+S*A),R>=P||-R>=P)return R;y=s*C,h=Pp*s,f=h-(h-s),d=s-f,h=Pp*C,p=h-(h-C),m=C-p,x=d*m-(y-f*p-d*p-f*m),b=A*S,h=Pp*A,f=h-(h-A),d=A-f,h=Pp*S,p=h-(h-S),m=S-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Fp[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Fp[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Fp[2]=v-(w-u)+(g-u),Fp[3]=w;const L=Dp(4,Up,4,Fp,Np);y=E*c,h=Pp*E,f=h-(h-E),d=E-f,h=Pp*c,p=h-(h-c),m=c-p,x=d*m-(y-f*p-d*p-f*m),b=T*l,h=Pp*T,f=h-(h-T),d=T-f,h=Pp*l,p=h-(h-l),m=l-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Fp[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Fp[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Fp[2]=v-(w-u)+(g-u),Fp[3]=w;const D=Dp(L,Np,4,Fp,Bp);y=s*c,h=Pp*s,f=h-(h-s),d=s-f,h=Pp*c,p=h-(h-c),m=c-p,x=d*m-(y-f*p-d*p-f*m),b=A*l,h=Pp*A,f=h-(h-A),d=A-f,h=Pp*l,p=h-(h-l),m=l-p,M=d*m-(b-f*p-d*p-f*m),g=x-M,u=x-g,Fp[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Fp[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Fp[2]=v-(w-u)+(g-u),Fp[3]=w;const O=Dp(D,Bp,4,Fp,kp);return kp[O-1]}(t,e,n,r,i,a,l)}const Gp=Math.pow(2,-52),Hp=new Uint32Array(512);class jp{static from(t,e=Zp,n=Kp){const r=t.length,i=new Float64Array(2*r);for(let a=0;a<r;a++){const r=t[a];i[2*a]=e(r),i[2*a+1]=n(r)}return new jp(i)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,a=t.length>>1;let o=1/0,s=1/0,A=-1/0,l=-1/0;for(let e=0;e<a;e++){const n=t[2*e],r=t[2*e+1];n<o&&(o=n),r<s&&(s=r),n>A&&(A=n),r>l&&(l=r),this._ids[e]=e}const c=(o+A)/2,u=(s+l)/2;let h,f,d;for(let e=0,n=1/0;e<a;e++){const r=Vp(c,u,t[2*e],t[2*e+1]);r<n&&(h=e,n=r)}const p=t[2*h],m=t[2*h+1];for(let e=0,n=1/0;e<a;e++){if(e===h)continue;const r=Vp(p,m,t[2*e],t[2*e+1]);r<n&&r>0&&(f=e,n=r)}let g=t[2*f],v=t[2*f+1],_=1/0;for(let e=0;e<a;e++){if(e===h||e===f)continue;const n=Xp(p,m,g,v,t[2*e],t[2*e+1]);n<_&&(d=e,_=n)}let y=t[2*d],x=t[2*d+1];if(_===1/0){for(let e=0;e<a;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];Qp(this._ids,this._dists,0,a-1);const e=new Uint32Array(a);let n=0;for(let t=0,r=-1/0;t<a;t++){const i=this._ids[t],a=this._dists[i];a>r&&(e[n++]=i,r=a)}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(zp(p,m,g,v,y,x)<0){const t=f,e=g,n=v;f=d,g=y,v=x,d=t,y=e,x=n}const b=function(t,e,n,r,i,a){const o=n-t,s=r-e,A=i-t,l=a-e,c=o*o+s*s,u=A*A+l*l,h=.5/(o*l-s*A);return{x:t+(l*c-s*u)*h,y:e+(o*u-A*c)*h}}(p,m,g,v,y,x);this._cx=b.x,this._cy=b.y;for(let e=0;e<a;e++)this._dists[e]=Vp(t[2*e],t[2*e+1],b.x,b.y);Qp(this._ids,this._dists,0,a-1),this._hullStart=h;let M=3;n[h]=e[d]=f,n[f]=e[h]=d,n[d]=e[f]=h,r[h]=0,r[f]=1,r[d]=2,i.fill(-1),i[this._hashKey(p,m)]=h,i[this._hashKey(g,v)]=f,i[this._hashKey(y,x)]=d,this.trianglesLen=0,this._addTriangle(h,f,d,-1,-1,-1);for(let a,o,s=0;s<this._ids.length;s++){const A=this._ids[s],l=t[2*A],c=t[2*A+1];if(s>0&&Math.abs(l-a)<=Gp&&Math.abs(c-o)<=Gp)continue;if(a=l,o=c,A===h||A===f||A===d)continue;let u=0;for(let t=0,e=this._hashKey(l,c);t<this._hashSize&&(u=i[(e+t)%this._hashSize],-1===u||u===n[u]);t++);u=e[u];let p,m=u;for(;p=n[m],zp(l,c,t[2*m],t[2*m+1],t[2*p],t[2*p+1])>=0;)if(m=p,m===u){m=-1;break}if(-1===m)continue;let g=this._addTriangle(m,A,n[m],-1,-1,r[m]);r[A]=this._legalize(g+2),r[m]=g,M++;let v=n[m];for(;p=n[v],zp(l,c,t[2*v],t[2*v+1],t[2*p],t[2*p+1])<0;)g=this._addTriangle(v,A,p,r[A],-1,r[v]),r[A]=this._legalize(g+2),n[v]=v,M--,v=p;if(m===u)for(;p=e[m],zp(l,c,t[2*p],t[2*p+1],t[2*m],t[2*m+1])<0;)g=this._addTriangle(p,A,m,-1,r[m],r[p]),this._legalize(g+2),r[p]=g,n[m]=m,M--,m=p;this._hullStart=e[A]=m,n[m]=e[v]=A,n[A]=v,i[this._hashKey(l,c)]=A,i[this._hashKey(t[2*m],t[2*m+1])]=m}this.hull=new Uint32Array(M);for(let t=0,e=this._hullStart;t<M;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,a=0;for(;;){const o=n[t],s=t-t%3;if(a=s+(t+2)%3,-1===o){if(0===i)break;t=Hp[--i];continue}const A=o-o%3,l=s+(t+1)%3,c=A+(o+2)%3,u=e[a],h=e[t],f=e[l],d=e[c];if(Wp(r[2*u],r[2*u+1],r[2*h],r[2*h+1],r[2*f],r[2*f+1],r[2*d],r[2*d+1])){e[t]=d,e[o]=u;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(o,n[a]),this._link(a,c);const s=A+(o+1)%3;i<Hp.length&&(Hp[i++]=s)}else{if(0===i)break;t=Hp[--i]}}return a}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,r,i,a){const o=this.trianglesLen;return this._triangles[o]=t,this._triangles[o+1]=e,this._triangles[o+2]=n,this._link(o,r),this._link(o+1,i),this._link(o+2,a),this.trianglesLen+=3,o}}function Vp(t,e,n,r){const i=t-n,a=e-r;return i*i+a*a}function Wp(t,e,n,r,i,a,o,s){const A=t-o,l=e-s,c=n-o,u=r-s,h=i-o,f=a-s,d=c*c+u*u,p=h*h+f*f;return A*(u*p-d*f)-l*(c*p-d*h)+(A*A+l*l)*(c*f-u*h)<0}function Xp(t,e,n,r,i,a){const o=n-t,s=r-e,A=i-t,l=a-e,c=o*o+s*s,u=A*A+l*l,h=.5/(o*l-s*A),f=(l*c-s*u)*h,d=(o*u-A*c)*h;return f*f+d*d}function Qp(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],a=e[r];let o=i-1;for(;o>=n&&e[t[o]]>a;)t[o+1]=t[o--];t[o+1]=r}else{let i=n+1,a=r;Yp(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Yp(t,n,r),e[t[i]]>e[t[r]]&&Yp(t,i,r),e[t[n]]>e[t[i]]&&Yp(t,n,i);const o=t[i],s=e[o];for(;;){do{i++}while(e[t[i]]<s);do{a--}while(e[t[a]]>s);if(a<i)break;Yp(t,i,a)}t[n+1]=t[a],t[a]=o,r-i+1>=a-n?(Qp(t,e,i,r),Qp(t,e,n,a-1)):(Qp(t,e,n,a-1),Qp(t,e,i,r))}}function Yp(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Zp(t){return t[0]}function Kp(t){return t[1]}function Jp(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r,i=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(t),a="Feature"===(r=e).type?r.geometry:r,o=a.type,s=e.bbox,A=a.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,s))return!1;"Polygon"===o&&(A=[A]);for(var l=!1,c=0;c<A.length&&!l;c++)if($p(i,A[c][0],n.ignoreBoundary)){for(var u=!1,h=1;h<A[c].length&&!u;)$p(i,A[c][h],!n.ignoreBoundary)&&(u=!0),h++;u||(l=!0)}return l}function $p(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,a=e.length-1;i<e.length;a=i++){var o=e[i][0],s=e[i][1],A=e[a][0],l=e[a][1];if(t[1]*(o-A)+s*(A-t[0])+l*(t[0]-o)==0&&(o-t[0])*(A-t[0])<=0&&(s-t[1])*(l-t[1])<=0)return!n;s>t[1]!=l>t[1]&&t[0]<(A-o)*(t[1]-s)/(l-s)+o&&(r=!r)}return r}const tm=1e-6;class em{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>tm||Math.abs(this._y1-i)>tm)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class nm{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class rm{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this;let i,a;const o=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,s,A=0,l=0,c=n.length;A<c;A+=3,l+=2){const c=2*n[A],u=2*n[A+1],h=2*n[A+2],f=t[c],d=t[c+1],p=t[u],m=t[u+1],g=t[h],v=t[h+1],_=p-f,y=m-d,x=g-f,b=v-d,M=2*(_*b-y*x);if(Math.abs(M)<1e-9){if(void 0===i){i=a=0;for(const n of e)i+=t[2*n],a+=t[2*n+1];i/=e.length,a/=e.length}const n=1e9*Math.sign((i-f)*b-(a-d)*x);r=(f+g)/2-n*b,s=(d+v)/2+n*x}else{const t=1/M,e=_*_+y*y,n=x*x+b*b;r=f+(b*e-y*n)*t,s=d+(_*n-x*e)*t}o[l]=r,o[l+1]=s}let s,A,l,c=e[e.length-1],u=4*c,h=t[2*c],f=t[2*c+1];r.fill(0);for(let n=0;n<e.length;++n)c=e[n],s=u,A=h,l=f,u=4*c,h=t[2*c],f=t[2*c+1],r[s+2]=r[u]=l-f,r[s+3]=r[u+1]=h-A}render(t){const e=null==t?t=new em:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:a,vectors:o}=this;if(i.length<=1)return null;for(let e=0,r=n.length;e<r;++e){const r=n[e];if(r<e)continue;const i=2*Math.floor(e/3),o=2*Math.floor(r/3),s=a[i],A=a[i+1],l=a[o],c=a[o+1];this._renderSegment(s,A,l,c,t)}let s,A=i[i.length-1];for(let e=0;e<i.length;++e){s=A,A=i[e];const n=2*Math.floor(r[A]/3),l=a[n],c=a[n+1],u=4*s,h=this._project(l,c,o[u+2],o[u+3]);h&&this._renderSegment(l,c,h[0],h[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new em:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new em:void 0,r=this._clip(t);if(null===r||!r.length)return;e.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let t=2;t<i;t+=2)r[t]===r[t-2]&&r[t+1]===r[t-1]||e.lineTo(r[t],r[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new nm;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,r,i){let a;const o=this._regioncode(t,e),s=this._regioncode(n,r);0===o&&0===s?(i.moveTo(t,e),i.lineTo(n,r)):(a=this._clipSegment(t,e,n,r,o,s))&&(i.moveTo(a[0],a[1]),i.lineTo(a[2],a[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let r=0,i=e.length;r<i;r+=2)for(let a=0,o=t.length;a<o;a+=2)if(e[r]===t[a]&&e[r+1]===t[a+1]&&e[(r+2)%i]===t[(a+o-2)%o]&&e[(r+3)%i]===t[(a+o-1)%o]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,a=n[t];if(-1===a)return null;const o=[];let s=a;do{const n=Math.floor(s/3);if(o.push(e[2*n],e[2*n+1]),s=s%3==2?s-2:s+1,i[s]!==t)break;s=r[s]}while(s!==a&&-1!==s);return o}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,r=4*t;return this._simplify(n[r]||n[r+1]?this._clipInfinite(t,e,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,e))}_clipFinite(t,e){const n=e.length;let r,i,a,o,s=null,A=e[n-2],l=e[n-1],c=this._regioncode(A,l),u=0;for(let h=0;h<n;h+=2)if(r=A,i=l,A=e[h],l=e[h+1],a=c,c=this._regioncode(A,l),0===a&&0===c)o=u,u=0,s?s.push(A,l):s=[A,l];else{let e,n,h,f,d;if(0===a){if(null===(e=this._clipSegment(r,i,A,l,a,c)))continue;[n,h,f,d]=e}else{if(null===(e=this._clipSegment(A,l,r,i,c,a)))continue;[f,d,n,h]=e,o=u,u=this._edgecode(n,h),o&&u&&this._edge(t,o,u,s,s.length),s?s.push(n,h):s=[n,h]}o=u,u=this._edgecode(f,d),o&&u&&this._edge(t,o,u,s,s.length),s?s.push(f,d):s=[f,d]}if(s)o=u,u=this._edgecode(s[0],s[1]),o&&u&&this._edge(t,o,u,s,s.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return s}_clipSegment(t,e,n,r,i,a){const o=i<a;for(o&&([t,e,n,r,i,a]=[n,r,t,e,a,i]);;){if(0===i&&0===a)return o?[n,r,t,e]:[t,e,n,r];if(i&a)return null;let s,A,l=i||a;8&l?(s=t+(n-t)*(this.ymax-e)/(r-e),A=this.ymax):4&l?(s=t+(n-t)*(this.ymin-e)/(r-e),A=this.ymin):2&l?(A=e+(r-e)*(this.xmax-t)/(n-t),s=this.xmax):(A=e+(r-e)*(this.xmin-t)/(n-t),s=this.xmin),i?(t=s,e=A,i=this._regioncode(t,e)):(n=s,r=A,a=this._regioncode(n,r))}}_clipInfinite(t,e,n,r,i,a){let o,s=Array.from(e);if((o=this._project(s[0],s[1],n,r))&&s.unshift(o[0],o[1]),(o=this._project(s[s.length-2],s[s.length-1],i,a))&&s.push(o[0],o[1]),s=this._clipFinite(t,s))for(let e,n=0,r=s.length,i=this._edgecode(s[r-2],s[r-1]);n<r;n+=2)e=i,i=this._edgecode(s[n],s[n+1]),e&&i&&(n=this._edge(t,e,i,s,n),r=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,e,n,r,i){for(;e!==n;){let n,a;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,a=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,a=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,a=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,a=this.ymin}r[i]===n&&r[i+1]===a||!this.contains(t,n,a)||(r.splice(i,0,n,a),i+=2)}return i}_project(t,e,n,r){let i,a,o,s=1/0;if(r<0){if(e<=this.ymin)return null;(i=(this.ymin-e)/r)<s&&(o=this.ymin,a=t+(s=i)*n)}else if(r>0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)<s&&(o=this.ymax,a=t+(s=i)*n)}if(n>0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)<s&&(a=this.xmax,o=e+(s=i)*r)}else if(n<0){if(t<=this.xmin)return null;(i=(this.xmin-t)/n)<s&&(a=this.xmin,o=e+(s=i)*r)}return[a,o]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e<t.length;e+=2){const n=(e+2)%t.length,r=(e+4)%t.length;(t[e]===t[n]&&t[n]===t[r]||t[e+1]===t[n+1]&&t[n+1]===t[r+1])&&(t.splice(n,2),e-=2)}t.length||(t=null)}return t}}const im=2*Math.PI,am=Math.pow;function om(t){return t[0]}function sm(t){return t[1]}function Am(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class lm{static from(t,e=om,n=sm,r){return new lm("length"in t?function(t,e,n,r){const i=t.length,a=new Float64Array(2*i);for(let o=0;o<i;++o){const i=t[o];a[2*o]=e.call(r,i,o,t),a[2*o+1]=n.call(r,i,o,t)}return a}(t,e,n,r):Float64Array.from(function*(t,e,n,r){let i=0;for(const a of t)yield e.call(r,a,i,t),yield n.call(r,a,i,t),++i}(t,e,n,r)))}constructor(t){this._delaunator=new jp(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const r=2*e[t],i=2*e[t+1],a=2*e[t+2];if((n[a]-n[r])*(n[i+1]-n[r+1])-(n[i]-n[r])*(n[a+1]-n[r+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t<n;++t){const n=Am(e[2*t],e[2*t+1],i);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new jp(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),o=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=i[t%3==2?t-2:t+1];-1!==n[t]&&-1!==a[e]||(a[e]=t)}for(let t=0,e=r.length;t<e;++t)o[r[t]]=t;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],a[r[0]]=1,2===r.length&&(a[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new rm(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:a,collinear:o}=this;if(o){const e=o.indexOf(t);return e>0&&(yield o[e-1]),void(e<o.length-1&&(yield o[e+1]))}const s=e[t];if(-1===s)return;let A=s,l=-1;do{if(yield l=a[A],A=A%3==2?A-2:A+1,a[A]!==t)return;if(A=i[A],-1===A){const e=n[(r[t]+1)%n.length];return void(e!==l&&(yield e))}}while(A!==s)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const r=n;let i;for(;(i=this._step(n,t,e))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:a,halfedges:o,triangles:s,points:A}=this;if(-1===r[t]||!A.length)return(t+1)%(A.length>>1);let l=t,c=am(e-A[2*t],2)+am(n-A[2*t+1],2);const u=r[t];let h=u;do{let r=s[h];const u=am(e-A[2*r],2)+am(n-A[2*r+1],2);if(u<c&&(c=u,l=r),h=h%3==2?h-2:h+1,s[h]!==t)break;if(h=o[h],-1===h){if(h=i[(a[t]+1)%i.length],h!==r&&am(e-A[2*h],2)+am(n-A[2*h+1],2)<c)return h;break}}while(h!==u);return l}render(t){const e=null==t?t=new em:void 0,{points:n,halfedges:r,triangles:i}=this;for(let e=0,a=r.length;e<a;++e){const a=r[e];if(a<e)continue;const o=2*i[e],s=2*i[a];t.moveTo(n[o],n[o+1]),t.lineTo(n[s],n[s+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"==typeof t.moveTo||(e=t,t=null),e=null==e?2:+e;const n=null==t?t=new em:void 0,{points:r}=this;for(let n=0,i=r.length;n<i;n+=2){const i=r[n],a=r[n+1];t.moveTo(i+e,a),t.arc(i,a,e,0,im)}return n&&n.value()}renderHull(t){const e=null==t?t=new em:void 0,{hull:n,points:r}=this,i=2*n[0],a=n.length;t.moveTo(r[i],r[i+1]);for(let e=1;e<a;++e){const i=2*n[e];t.lineTo(r[i],r[i+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new nm;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new em:void 0,{points:r,triangles:i}=this,a=2*i[t*=3],o=2*i[t+1],s=2*i[t+2];return e.moveTo(r[a],r[a+1]),e.lineTo(r[o],r[o+1]),e.lineTo(r[s],r[s+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new nm;return this.renderTriangle(t,e),e.value()}}const cm=Math.PI,um=cm/2,hm=180/cm,fm=cm/180,dm=Math.atan2,pm=Math.cos,mm=Math.max,gm=Math.min,vm=Math.sin,_m=Math.sign||function(t){return t>0?1:t<0?-1:0},ym=Math.sqrt;function xm(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function bm(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 Mm(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function wm(t){var e=ym(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);return[t[0]/e,t[1]/e,t[2]/e]}function Em(t){return[dm(t[1],t[0])*hm,(e=mm(-1,gm(1,t[2])),(e>1?um:e<-1?-um:Math.asin(e))*hm)];var e}function Sm(t){const e=t[0]*fm,n=t[1]*fm,r=pm(n);return[r*pm(e),r*vm(e),vm(n)]}function Tm(t){return xm((t=t.map((t=>Sm(t))))[0],bm(t[2],t[1]))}function Cm(t){const e=function(t){if(t.length<2)return{};let e=0;for(;isNaN(t[e][0]+t[e][1])&&e++<t.length;);const n=function(t){function e(e){return(e=t(e[0]*Kl,e[1]*Kl))[0]*=Zl,e[1]*=Zl,e}return t=Iu(t[0]*Kl,t[1]*Kl,t.length>2?t[2]*Kl:0),e.invert=function(e){return(e=t.invert(e[0]*Kl,e[1]*Kl))[0]*=Zl,e[1]*=Zl,e},e}(t[e]),r=Fh().translate([0,0]).scale(1).rotate(n.invert([180,0]));t=t.map(r);const i=[];let a=1;for(let e=0,n=t.length;e<n;e++){let n=t[e][0]**2+t[e][1]**2;!isFinite(n)||n>1e32?i.push(e):n>a&&(a=n)}const o=1e6*ym(a);i.forEach((e=>t[e]=[o,0])),t.push([0,o]),t.push([-o,0]),t.push([0,-o]);const s=lm.from(t);s.projection=r;const{triangles:A,halfedges:l,inedges:c}=s;for(let n=0,r=l.length;n<r;n++)if(l[n]<0){const t=n%3==2?n-2:n+1,r=n%3==0?n+2:n-1,i=l[t],a=l[r];l[i]=a,l[a]=i,l[t]=l[r]=-1,A[n]=A[t]=A[r]=e,c[A[i]]=i%3==0?i+2:i-1,c[A[a]]=a%3==0?a+2:a-1,n+=2-n%3}else A[n]>t.length-3-1&&(A[n]=e);return s}(t),n=function(t){const{triangles:e}=t;if(!e)return[];const n=[];for(let t=0,r=e.length/3;t<r;t++){const r=e[3*t],i=e[3*t+1],a=e[3*t+2];r!==i&&i!==a&&n.push([r,a,i])}return n}(e),r=function(t,e){const n=new Set;return 2===e.length?[[0,1]]:(t.forEach((t=>{if(t[0]!==t[1]&&!(Tm(t.map((t=>e[t])))<0))for(let e,r=0;r<3;r++)e=(r+1)%3,n.add(ql([t[r],t[e]]).join("-"))})),Array.from(n,(t=>t.split("-").map(Number))))}(n,t),i=function(t,e){const n=[];t.forEach((t=>{for(let e=0;e<3;e++){const r=t[e],i=t[(e+1)%3];n[r]=n[r]||[],n[r].push(i)}})),0===t.length&&(2===e?(n[0]=[1],n[1]=[0]):1===e&&(n[0]=[]));return n}(n,t.length),a=function(t,e){function n(t,e){let n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i}return function(r,i,a){void 0===a&&(a=0);let o,s,A=a;const l=Sm([r,i]);do{o=a,a=null,s=n(l,Sm(e[o])),t[o].forEach((t=>{let r=n(l,Sm(e[t]));if(r<s)return s=r,a=t,void(A=t)}))}while(null!==a);return A}}(i,t),o=function(t,e){return t.map((t=>{const n=t.map((t=>e[t])).map(Sm);return Em(wm(Mm(Mm(bm(n[1],n[0]),bm(n[2],n[1])),bm(n[0],n[2]))))}))}(n,t),{polygons:s,centers:A}=function(t,e,n){const r=[],i=t.slice();if(0===e.length){if(n.length<2)return{polygons:r,centers:i};if(2===n.length){const t=Sm(n[0]),e=Sm(n[1]),a=wm(Mm(t,e)),s=wm(bm(t,e)),A=bm(a,s),l=[a,bm(a,A),bm(bm(a,A),A),bm(bm(bm(a,A),A),A)].map(Em).map(o);return r.push(l),r.push(l.slice().reverse()),{polygons:r,centers:i}}}e.forEach(((t,e)=>{for(let n=0;n<3;n++){const i=t[n],a=t[(n+1)%3],o=t[(n+2)%3];r[i]=r[i]||[],r[i].push([a,o,e,[i,a,o]])}}));const a=r.map((t=>{const e=[t[0][2]];let r=t[0][1];for(let n=1;n<t.length;n++)for(let n=0;n<t.length;n++)if(t[n][0]==r){r=t[n][1],e.push(t[n][2]);break}if(e.length>2)return e;if(2==e.length){const r=Rm(n[t[0][3][0]],n[t[0][3][1]],i[e[0]]),a=Rm(n[t[0][3][2]],n[t[0][3][0]],i[e[0]]),s=o(r),A=o(a);return[e[0],A,e[1],s]}}));function o(t){let n=-1;return i.slice(e.length,1/0).forEach(((r,i)=>{r[0]===t[0]&&r[1]===t[1]&&(n=i+e.length)})),n<0&&(n=i.length,i.push(t)),n}return{polygons:a,centers:i}}(o,n,t),l=function(t){const e=[];return t.forEach((t=>{if(!t)return;let n=t[t.length-1];for(let r of t)r>n&&e.push([n,r]),n=r})),e}(s),c=function(t,e){const n=new Set,r=[];t.map((t=>{if(!(Tm(t.map((t=>e[t>e.length?0:t])))>1e-12))for(let e=0;e<3;e++){let r=[t[e],t[(e+1)%3]],i=`${r[0]}-${r[1]}`;n.has(i)?n.delete(i):n.add(`${r[1]}-${r[0]}`)}}));const i=new Map;let a;if(n.forEach((t=>{t=t.split("-").map(Number),i.set(t[0],t[1]),a=t[0]})),void 0===a)return r;let o=a;do{r.push(o);let t=i.get(o);i.set(o,-1),o=t}while(o>-1&&o!==a);return r}(n,t),u=function(t,e){return function(n){const r=new Map,i=new Map;return t.forEach(((t,e)=>{const a=t.join("-");r.set(a,n[e]),i.set(a,!0)})),e.forEach((t=>{let e=0,n=-1;for(let i=0;i<3;i++){let a=ql([t[i],t[(i+1)%3]]).join("-");r.get(a)>e&&(e=r.get(a),n=a)}i.set(n,!1)})),t.map((t=>i.get(t.join("-"))))}}(r,n);return{delaunay:e,edges:r,triangles:n,centers:A,neighbors:i,polygons:s,mesh:l,hull:c,urquhart:u,find:a}}function Rm(t,e,n){t=Sm(t),e=Sm(e),n=Sm(n);const r=_m(xm(bm(e,t),n));return Em(wm(Mm(t,e)).map((t=>r*t)))}function Pm(t,e,n){return e=Im(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Lm()?Reflect.construct(e,n||[],Im(t).constructor):e.apply(t,n))}function Lm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Lm=function(){return!!t})()}function Dm(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function Om(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Dm(r.key),r)}}function Im(t){return Im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Im(t)}function qm(t,e){return qm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qm(t,e)}function Um(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Bm(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nm(t){return function(t){if(Array.isArray(t))return km(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Bm(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bm(t,e){if(t){if("string"==typeof t)return km(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?km(t,e):void 0}}function km(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Fm(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).resolution,n=void 0===e?1/0:e,r=function(t,e){return t.map((function(t){var n,r=[];return t.forEach((function(t){if(n){var i=180*ch(t,n)/Math.PI;if(i>e)for(var a=bh(n,t),o=1/Math.ceil(i/e),s=o;s<1;)r.push(a(s)),s+=o}r.push(n=t)})),r}))}(t,n),i=Gl(r),a=function(t,e){var n={type:"Polygon",coordinates:t},r=_u(n),i=Um(r,2),a=Um(i[0],2),o=a[0],s=a[1],A=Um(i[1],2),l=A[0],c=A[1];if(Math.min(Math.abs(l-o),Math.abs(c-s))<e)return[];var u=o>l||c>=89||s<=-89;return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.minLng,r=e.maxLng,i=e.minLat,a=e.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,A=function(t){return t/s*360%360-180},l=function(t){return Math.acos(2*t/o-1)/Math.PI*180-90},c=function(t){return o*(Math.cos((t+90)*Math.PI/180)+1)/2},u=[void 0!==a?Math.ceil(c(a)):0,void 0!==i?Math.floor(c(i)):o-1],h=void 0===n&&void 0===r?function(){return!0}:void 0===n?function(t){return t<=r}:void 0===r?function(t){return t>=n}:r>=n?function(t){return t>=n&&t<=r}:function(t){return t>=n||t<=r},f=[],d=u[0];d<=u[1];d++){var p=A(d);h(p)&&f.push([p,l(d)])}return f}(e,{minLng:o,maxLng:l,minLat:s,maxLat:c}).filter((function(t){return zm(t,n,u)}))}(t,n),o=[].concat(Nm(i),Nm(a)),s={type:"Polygon",coordinates:t},A=Um(_u(s),2),l=Um(A[0],2),c=l[0],u=l[1],h=Um(A[1],2),f=h[0],d=h[1],p=c>f||d>=89||u<=-89,m=[];if(p){var g=function(t){const e=function(t){if(e.delaunay=null,e._data=t,"object"==typeof e._data&&"FeatureCollection"===e._data.type&&(e._data=e._data.features),"object"==typeof e._data){const t=e._data.map((t=>[e._vx(t),e._vy(t),t])).filter((t=>isFinite(t[0]+t[1])));e.points=t.map((t=>[t[0],t[1]])),e.valid=t.map((t=>t[2])),e.delaunay=Cm(e.points)}return e};return e._vx=function(t){return"object"==typeof t&&"type"in t?Lu(t)[0]:0 in t?t[0]:void 0},e._vy=function(t){return"object"==typeof t&&"type"in t?Lu(t)[1]:1 in t?t[1]:void 0},e.x=function(t){return t?(e._vx=t,e):e._vx},e.y=function(t){return t?(e._vy=t,e):e._vy},e.polygons=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const n={type:"FeatureCollection",features:[]};return 0===e.valid.length||(e.delaunay.polygons.forEach(((t,r)=>n.features.push({type:"Feature",geometry:t?{type:"Polygon",coordinates:[[...t,t[0]].map((t=>e.delaunay.centers[t]))]}:null,properties:{site:e.valid[r],sitecoordinates:e.points[r],neighbours:e.delaunay.neighbors[r]}}))),1===e.valid.length&&n.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:e.valid[0],sitecoordinates:e.points[0],neighbours:[]}})),n},e.triangles=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"FeatureCollection",features:e.delaunay.triangles.map(((t,n)=>((t=t.map((t=>e.points[t]))).center=e.delaunay.centers[n],t))).filter((t=>Tm(t)>0)).map((t=>({type:"Feature",properties:{circumcenter:t.center},geometry:{type:"Polygon",coordinates:[[...t,t[0]]]}})))}},e.links=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const n=e.delaunay.edges.map((t=>ch(e.points[t[0]],e.points[t[1]]))),r=e.delaunay.urquhart(n);return{type:"FeatureCollection",features:e.delaunay.edges.map(((t,i)=>({type:"Feature",properties:{source:e.valid[t[0]],target:e.valid[t[1]],length:n[i],urquhart:!!r[i]},geometry:{type:"LineString",coordinates:[e.points[t[0]],e.points[t[1]]]}})))}},e.mesh=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"MultiLineString",coordinates:e.delaunay.edges.map((t=>[e.points[t[0]],e.points[t[1]]]))}},e.cellMesh=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const{centers:n,polygons:r}=e.delaunay,i=[];for(const t of r)if(t)for(let e=t.length,r=t[e-1],a=t[0],o=0;o<e;r=a,a=t[++o])a>r&&i.push([n[r],n[a]]);return{type:"MultiLineString",coordinates:i}},e._found=void 0,e.find=function(t,n,r){if(e._found=e.delaunay.find(t,n,e._found),!r||ch([t,n],e.points[e._found])<r)return e._found},e.hull=function(t){void 0!==t&&e(t);const n=e.delaunay.hull,r=e.points;return 0===n.length?null:{type:"Polygon",coordinates:[[...n.map((t=>r[t])),r[n[0]]]]}},t?e(t):e}(o).triangles(),v=new Map(o.map((function(t,e){var n=Um(t,2),r=n[0],i=n[1];return["".concat(r,"-").concat(i),e]})));g.features.forEach((function(t){var e,n=t.geometry.coordinates[0].slice(0,3).reverse(),r=[];if(n.forEach((function(t){var e=Um(t,2),n=e[0],i=e[1],a="".concat(n,"-").concat(i);v.has(a)&&r.push(v.get(a))})),3===r.length){if(r.some((function(t){return t<i.length})))if(!zm(t.properties.circumcenter,s,p))return;(e=m).push.apply(e,r)}}))}else if(a.length)for(var _=jp.from(o),y=function(t){var e,n=[2,1,0].map((function(e){return _.triangles[t+e]})),r=n.map((function(t){return o[t]}));if(n.some((function(t){return t<i.length}))){var a=[0,1].map((function(t){return function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n}(r,(function(e){return e[t]}))}));if(!zm(a,s,p))return 1}(e=m).push.apply(e,Nm(n))},x=0,b=_.triangles.length;x<b;x+=3)y(x);else{var M=Rl.flatten(r),w=M.vertices,E=M.holes;m=Rl(w,void 0===E?[]:E,2)}var S=Rp(ql(o,(function(t){return t[0]})),[0,1]),T=Rp(ql(o,(function(t){return t[1]})),[0,1]),C=o.map((function(t){var e=Um(t,2),n=e[0],r=e[1];return[S(n),T(r)]}));return{contour:r,triangles:{points:o,indices:m,uvs:C}}}function zm(t,e){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?function(t,e){return(t&&uh.hasOwnProperty(t.type)?uh[t.type]:fh)(t,e)}(e,t):Jp(t,e)}var Gm=window.THREE?window.THREE:{BufferGeometry:Hn,Float32BufferAttribute:qn},Hm=(new Gm.BufferGeometry).setAttribute?"setAttribute":"addAttribute",jm=function(t){function e(t,n,r,i,a,o,s){var A;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=Pm(this,e)).type="ConicPolygonBufferGeometry",A.parameters={polygonGeoJson:t,startHeight:n,endHeight:r,closedBottom:i,closedTop:a,includeSides:o,curvatureResolution:s},n=n||0,r=r||1,i=void 0===i||i,a=void 0===a||a,o=void 0===o||o;var l=Fm(t,{resolution:s=s||5}),c=l.contour,u=l.triangles,h=Gl(u.uvs),f=[],d=[],p=[],m=0,g=function(t){var e=Math.round(f.length/3),n=p.length;f=f.concat(t.vertices),d=d.concat(t.uvs),p=p.concat(e?t.indices.map((function(t){return t+e})):t.indices),A.addGroup(n,p.length-n,m++)};function v(t,e){var n=t.map((function(t){return t.map((function(t){var n=Um(t,2),r=n[0];return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}(n[1],r,e)}))}));return Rl.flatten(n)}function _(t){return{indices:!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?u.indices:u.indices.slice().reverse(),vertices:v([u.points],t).vertices,uvs:h}}return o&&g(function(){for(var t=v(c,n),e=t.vertices,i=t.holes,a=v(c,r).vertices,o=Gl([a,e]),s=Math.round(a.length/3),A=new Set(i),l=0,u=[],h=0;h<s;h++){var f=h+1;if(f===s)f=l;else if(A.has(f)){var d=f;f=l,l=d}u.push(h,h+s,f+s),u.push(f+s,f,h)}for(var p=[],m=1;m>=0;m--)for(var g=0;g<s;g+=1)p.push(g/(s-1),m);return{indices:u,vertices:o,uvs:p}}()),i&&g(_(n,!1)),a&&g(_(r,!0)),A.setIndex(p),A[Hm]("position",new Gm.Float32BufferAttribute(f,3)),A[Hm]("uv",new Gm.Float32BufferAttribute(d,2)),A.computeVertexNormals(),A}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&qm(t,e)}(e,t),n=e,r&&Om(n.prototype,r),i&&Om(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(Gm.BufferGeometry);var Vm=function(t){var e,n=void 0!==(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var i,a,o,s,A=!1;i="object"==typeof window,a="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,A=o&&!i&&!a,s=!i&&!A&&!a;var l,c,u,h,f,d="";A?(d=__dirname+"/",l=function(t,e){var n;return(n=rt(t))||(h||(h=require("fs")),f||(f=require("path")),t=f.normalize(t),n=h.readFileSync(t)),e?n:n.toString()},u=function(t){var e=l(t,!0);return e.buffer||(e=new Uint8Array(e)),_(e.buffer),e},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),n.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(l=function(t){var e=rt(t);return e?et(e):read(t)}),u=function(t){var e;return(e=rt(t))?e:"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(_("object"==typeof(e=read(t,"binary"))),e)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(i||a)&&(a?d=self.location.href:"undefined"!=typeof document&&document.currentScript&&(d=document.currentScript.src),d=0!==d.indexOf("blob:")?d.substr(0,d.lastIndexOf("/")+1):"",l=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText}catch(e){var n=rt(t);if(n)return et(n);throw e}},a&&(u=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){var n=rt(t);if(n)return n;throw e}}),c=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else{var i=rt(t);i?e(i.buffer):n()}},r.onerror=n,r.send(null)});var p=n.print||console.log.bind(console),m=n.printErr||console.warn.bind(console);for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram;var g=0;var v=!1;function _(t,e){t||gt("Assertion failed: "+e)}function y(t){var e=n["_"+t];return _(e,"Cannot call unknown function "+t+", make sure it is exported"),e}function x(t,e,n,r,i){var a={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,r){if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o);if(s<=127){if(n>=a)break;e[n++]=s}else if(s<=2047){if(n+1>=a)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=a)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=a)break;e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}e[n]=0})(t,w,e,n)})(t,e=At(n),n)}return e},array:function(t){var e=At(t.length);return function(t,e){M.set(t,e)}(t,e),e}};var o=y(t),s=[],A=0;if(r)for(var l=0;l<r.length;l++){var c=a[n[l]];c?(0===A&&(A=ct()),s[l]=c(r[l])):s[l]=r[l]}var u=o.apply(null,s);return u=function(t){return"string"===e?P(t):"boolean"===e?Boolean(t):t}(u),0!==A&&lt(A),u}var b,M,w,E,S,T,C,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(t,e){return t?function(t,e,n){for(var r=e+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.subarray&&R)return R.decode(t.subarray(e,i));for(var a="";e<i;){var o=t[e++];if(128&o){var s=63&t[e++];if(192!=(224&o)){var A=63&t[e++];if((o=224==(240&o)?(15&o)<<12|s<<6|A:(7&o)<<18|s<<12|A<<6|63&t[e++])<65536)a+=String.fromCharCode(o);else{var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else a+=String.fromCharCode((31&o)<<6|s)}else a+=String.fromCharCode(o)}return a}(w,t,e):""}function L(t,e){return t%e>0&&(t+=e-t%e),t}function D(t){b=t,n.HEAP8=M=new Int8Array(t),n.HEAP16=E=new Int16Array(t),n.HEAP32=S=new Int32Array(t),n.HEAPU8=w=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=T=new Float32Array(t),n.HEAPF64=C=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var O=n.TOTAL_MEMORY||33554432;function I(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?n.dynCall_v(r):n.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}O=(b=n.buffer?n.buffer:new ArrayBuffer(O)).byteLength,D(b),S[6032]=5267040;var q=[],U=[],N=[],B=[];var k=Math.abs,F=Math.ceil,z=Math.floor,G=Math.min,H=0,j=null;n.preloadedImages={},n.preloadedAudios={};var V,W,X=null,Q="data:application/octet-stream;base64,";function Y(t){return String.prototype.startsWith?t.startsWith(Q):0===t.indexOf(Q)}X="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function Z(t){return t}function K(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function J(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function $(){return M.length}function tt(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(M),at(e),D(e),1}catch(t){}}function et(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];r>255&&(r&=255),e.push(String.fromCharCode(r))}return e.join("")}var nt="function"==typeof atob?atob:function(t){var e,n,r,i,a,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",A="",l=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(l++))<<2|(i=s.indexOf(t.charAt(l++)))>>4,n=(15&i)<<4|(a=s.indexOf(t.charAt(l++)))>>2,r=(3&a)<<6|(o=s.indexOf(t.charAt(l++))),A+=String.fromCharCode(e),64!==a&&(A+=String.fromCharCode(n)),64!==o&&(A+=String.fromCharCode(r))}while(l<t.length);return A};function rt(t){if(Y(t))return function(t){if("boolean"==typeof A&&A){var e;try{e=Buffer.from(t,"base64")}catch(n){e=new Buffer(t,"base64")}return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}try{for(var n=nt(t),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(Q.length))}var it=function(t,e,n){var r=new t.Int8Array(n),i=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var a=new t.Float64Array(n),o=0|e.o,s=0|e.p,A=t.Math.floor,l=t.Math.abs,c=t.Math.sqrt,u=t.Math.pow,h=t.Math.cos,f=t.Math.sin,d=t.Math.tan,p=t.Math.acos,m=t.Math.asin,g=t.Math.atan,v=t.Math.atan2,_=t.Math.ceil,y=t.Math.imul,x=t.Math.min,b=t.Math.max,M=t.Math.clz32,w=e.b,E=e.c,S=e.d,T=e.e,C=e.f,R=e.g,P=e.h,L=e.i,D=24160;function O(t,e,n,r){return 0|I(t|=0,e|=0,n|=0,r|=0,0)}function I(t,e,n,r,a){var o,s=0,A=0,l=0,c=0;if(o=D,D=D+16|0,A=o,!(0|q(t|=0,e|=0,n|=0,r|=0,a|=0)))return D=o,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(s=0|ee(15,A)))break;A=0|i[(l=A)>>2],l=0|i[l+4>>2]}else c=0|Ne(0|n,0|(s=((0|n)<0)<<31>>31),3,0),l=0|E(),s=0|De(0|n,0|s,1,0),s=0|De(0|(s=0|Ne(0|c,0|l,0|s,0|E())),0|E(),1,0),l=0|E(),i[A>>2]=s,i[A+4>>2]=l,A=s;if(Xe(0|r,0,A<<3),0|a){Xe(0|a,0,A<<2),s=0|U(t,e,n,r,a,A,l,0);break}(s=0|Le(A,4))?(c=0|U(t,e,n,r,s,A,l,0),Pe(s),s=c):s=13}else s=2}while(0);return D=o,0|(c=s)}function q(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0;if(s=D,D=D+16|0,m=s+8|0,i[(p=o=s)>>2]=t,i[p+4>>2]=e,(0|n)<0)return D=s,0|(m=2);if(i[(A=r)>>2]=t,i[A+4>>2]=e,(A=!!(0|a))&&(i[a>>2]=0),0|Nt(t,e))return D=s,0|(m=9);i[m>>2]=0;t:do{if((0|n)>=1)if(A)for(f=1,h=0,d=0,p=1,A=t;;){if(!(h|d)){if(0|(A=0|N(A,e,4,m,o)))break t;if(0|Nt(A=0|i[(e=o)>>2],e=0|i[e+4>>2])){A=9;break t}}if(0|(A=0|N(A,e,0|i[22384+(d<<2)>>2],m,o)))break t;if(A=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(f<<3)|0)>>2]=A,i[t+4>>2]=e,i[a+(f<<2)>>2]=p,l=(0|(t=h+1|0))==(0|p),u=6==(0|(c=d+1|0)),0|Nt(A,e)){A=9;break t}if((0|(p=p+(u&l&1)|0))>(0|n)){A=0;break}f=f+1|0,h=l?0:t,d=l?u?0:c:d}else for(f=1,h=0,d=0,p=1,A=t;;){if(!(h|d)){if(0|(A=0|N(A,e,4,m,o)))break t;if(0|Nt(A=0|i[(e=o)>>2],e=0|i[e+4>>2])){A=9;break t}}if(0|(A=0|N(A,e,0|i[22384+(d<<2)>>2],m,o)))break t;if(A=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(f<<3)|0)>>2]=A,i[t+4>>2]=e,l=(0|(t=h+1|0))==(0|p),u=6==(0|(c=d+1|0)),0|Nt(A,e)){A=9;break t}if((0|(p=p+(u&l&1)|0))>(0|n)){A=0;break}f=f+1|0,h=l?0:t,d=l?u?0:c:d}else A=0}while(0);return D=s,0|(m=A)}function U(t,e,n,r,a,o,s,A){n|=0,r|=0,a|=0,A|=0;var l,c,u,h=0,f=0,d=0,p=0,m=0,g=0,v=0;if(u=D,D=D+16|0,l=u+8|0,c=u,h=0|ke(0|(t|=0),0|(e|=0),0|(o|=0),0|(s|=0)),d=0|E(),!(!(0|(v=0|i[(g=p=r+(h<<3)|0)>>2]))&!(0|(g=0|i[g+4>>2]))|(f=(0|v)==(0|t)&(0|g)==(0|e))))do{h=0|Be(0|(h=0|De(0|h,0|d,1,0)),0|E(),0|o,0|s),d=0|E(),f=(0|(g=0|i[(v=p=r+(h<<3)|0)>>2]))==(0|t)&(0|(v=0|i[v+4>>2]))==(0|e)}while(!(!(0|g)&!(0|v)|f));if(h=a+(h<<2)|0,f&&(0|i[h>>2])<=(0|A))return D=u,0|(v=0);if(i[(v=p)>>2]=t,i[v+4>>2]=e,i[h>>2]=A,(0|A)>=(0|n))return D=u,0|(v=0);switch(f=A+1|0,i[l>>2]=0,0|(h=0|N(t,e,2,l,c))){case 9:m=9;break;case 0:(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f))||(m=9)}t:do{if(9==(0|m)){switch(i[l>>2]=0,0|(h=0|N(t,e,3,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,1,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,5,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,4,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,6,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,f)))break t;break;default:break t}return D=u,0|(v=0)}}while(0);return D=u,0|(v=h)}function N(t,e,n,r,a){t|=0,e|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,f=0,d=0;if((n|=0)>>>0>6)return 0|(a=1);if(h=(0|i[(r|=0)>>2])%6|0,i[r>>2]=h,(0|h)>0){A=0;do{n=0|dt(n),A=A+1|0}while((0|A)<(0|i[r>>2]))}if(h=0|ze(0|t,0|e,45),E(),(s=127&h)>>>0>121)return 0|(a=5);o=0|Bt(t,e),A=0|ze(0|t,0|e,52),E(),A&=15;t:do{if(A){for(;;){if(c=0|ze(0|t,0|e,0|(l=3*(15-A|0)|0)),E(),7==(0|(c&=7))){e=5;break}if(d=!(0|Ht(A)),A=A+-1|0,f=0|Ge(7,0,0|l),e&=~E(),t=0|Ge(0|i[(d?432:16)+(28*c|0)+(n<<2)>>2],0,0|l)|t&~f,e|=l=0|E(),!(n=0|i[(d?640:224)+(28*c|0)+(n<<2)>>2])){n=0;break t}if(!A){u=8;break t}}return 0|e}u=8}while(0);8==(0|u)&&(t|=0|Ge(0|(d=0|i[848+(28*s|0)+(n<<2)>>2]),0,45),e=E()|-1040385&e,n=0|i[4272+(28*s|0)+(n<<2)>>2],127&~d||(d=0|Ge(0|i[848+(28*s|0)+20>>2],0,45),e=E()|-1040385&e,n=0|i[4272+(28*s|0)+20>>2],t=0|Ft(d|t,e),e=0|E(),i[r>>2]=1+(0|i[r>>2]))),c=0|ze(0|t,0|e,45),E(),c&=127;t:do{if(0|F(c)){e:do{if(1==(0|Bt(t,e))){if((0|s)!=(0|c)){if(0|j(c,0|i[7696+(28*s|0)>>2])){t=0|Gt(t,e),l=1,e=0|E();break}S(23313,22416,436,22424)}switch(0|o){case 3:t=0|Ft(t,e),e=0|E(),i[r>>2]=1+(0|i[r>>2]),l=0;break e;case 5:t=0|Gt(t,e),e=0|E(),i[r>>2]=5+(0|i[r>>2]),l=0;break e;case 0:return 0|(d=9);default:return 0|(d=1)}}else l=0}while(0);if((0|n)>0){A=0;do{t=0|kt(t,e),e=0|E(),A=A+1|0}while((0|A)!=(0|n))}if((0|s)!=(0|c)){if(!(0|z(c))){if(!!(0|l)|5!=(0|Bt(t,e)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&h){case 8:case 118:break t}3!=(0|Bt(t,e))&&(i[r>>2]=1+(0|i[r>>2]))}}else if((0|n)>0){A=0;do{t=0|Ft(t,e),e=0|E(),A=A+1|0}while((0|A)!=(0|n))}}while(0);return i[r>>2]=((0|i[r>>2])+n|0)%6|0,i[(d=a)>>2]=t,i[d+4>>2]=e,0|(d=0)}function B(t,e,n,r){n|=0,r|=0;var a,o,s,A=0,l=0;for(s=D,D=D+16|0,a=s,o=s+8|0,A=(A=!(0|Nt(t|=0,e|=0)))?1:2;;){if(i[o>>2]=0,!(0|N(t,e,A,o,a))&((0|i[(l=a)>>2])==(0|n)?(0|i[l+4>>2])==(0|r):0)){t=4;break}if((A=A+1|0)>>>0>=7){A=7,t=4;break}}return 4==(0|t)?(D=s,0|A):0}function k(t,e,n,r,o,s,A){e|=0,n|=0,r|=0,o|=0,s|=0,A|=0;var l,c,u,h,f,d,p,m,g,v,_=0,y=0,x=0,b=0,M=0,w=0,S=0,T=0,C=0,R=0,P=0,L=0,O=0,I=0,q=0,U=0,N=0,B=0,k=0;if(v=D,D=D+64|0,p=v+48|0,m=v+32|0,g=v+24|0,l=v+8|0,c=v,(0|(y=0|i[(t|=0)>>2]))<=0)return D=v,0|(q=0);for(u=t+4|0,h=p+8|0,f=m+8|0,d=l+8|0,_=0,O=0;;){L=(x=0|i[u>>2])+(O<<4)|0,i[p>>2]=i[L>>2],i[p+4>>2]=i[L+4>>2],i[p+8>>2]=i[L+8>>2],i[p+12>>2]=i[L+12>>2],(0|O)==(y+-1|0)?(i[m>>2]=i[x>>2],i[m+4>>2]=i[x+4>>2],i[m+8>>2]=i[x+8>>2],i[m+12>>2]=i[x+12>>2]):(L=x+(O+1<<4)|0,i[m>>2]=i[L>>2],i[m+4>>2]=i[L+4>>2],i[m+8>>2]=i[L+8>>2],i[m+12>>2]=i[L+12>>2]),y=0|Z(p,m,r,g);t:do{if(y)x=0,_=y;else if(y=0|i[(x=g)>>2],(0|(x=0|i[x+4>>2]))>0|!(0|x)&y>>>0>0){P=0,L=0;e:for(;;){if(k=+a[p>>3],B=+((R=0|Oe(0|y,0|x,0|P,0|L))>>>0)+4294967296*+(0|E()),U=+(y>>>0)+4294967296*+(0|x),N=+(P>>>0)+4294967296*+(0|L),a[l>>3]=k*B/U+ +a[m>>3]*N/U,a[d>>3]=+a[h>>3]*B/U+ +a[f>>3]*N/U,0|(y=0|jt(l,r,c))){_=y;break}w=0|ke(0|(C=0|i[(R=c)>>2]),0|(R=0|i[R+4>>2]),0|e,0|n),b=0|E(),x=0|i[(M=y=A+(w<<3)|0)>>2],M=0|i[M+4>>2];n:do{if(!(0|x)&!(0|M))I=y,q=16;else for(S=0,T=0;;){if((0|S)>(0|n)|(0|S)==(0|n)&T>>>0>e>>>0){_=1;break e}if((0|x)==(0|C)&(0|M)==(0|R))break n;if(w=0|Be(0|(y=0|De(0|w,0|b,1,0)),0|E(),0|e,0|n),b=0|E(),T=0|De(0|T,0|S,1,0),S=0|E(),!(0|(x=0|i[(M=y=A+(w<<3)|0)>>2]))&!(0|(M=0|i[M+4>>2]))){I=y,q=16;break}}}while(0);if(16!=(0|q)||(q=0,!(0|C)&!(0|R))||(i[(T=I)>>2]=C,i[T+4>>2]=R,T=s+(i[o>>2]<<3)|0,i[T>>2]=C,i[T+4>>2]=R,T=0|De(0|i[(T=o)>>2],0|i[T+4>>2],1,0),C=0|E(),i[(R=o)>>2]=T,i[R+4>>2]=C),P=0|De(0|P,0|L,1,0),L=0|E(),y=0|i[(x=g)>>2],!((0|(x=0|i[x+4>>2]))>(0|L)|(0|x)==(0|L)&y>>>0>P>>>0)){x=1;break t}}x=0}else x=1}while(0);if(O=O+1|0,!x){q=21;break}if((0|O)>=(0|(y=0|i[t>>2]))){_=0,q=21;break}}return 21==(0|q)?(D=v,0|_):0}function F(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|i[7696+(28*t|0)+16>>2])}function z(t){return 4==(0|(t|=0))|117==(0|t)}function G(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)>>2]}function H(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)+4>>2]}function j(t,e){return e|=0,(0|i[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|i[7696+(28*t|0)+24>>2])==(0|e))}function V(t,e){return 0|i[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function W(t,e){return e|=0,(0|i[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|i[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|i[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|i[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|i[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|i[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|i[848+(28*t|0)+24>>2])==(0|e)?6:7)}function X(t){return+a[(t|=0)+16>>3]<+a[t+24>>3]|0}function Q(t,e){t|=0;var n,r,i=0;return(i=+a[(e|=0)>>3])>=+a[t+8>>3]&&i<=+a[t>>3]?(n=+a[t+16>>3],i=+a[t+24>>3],e=(r=+a[e+8>>3])>=i,t=r<=n&1,n<i?e&&(t=1):e||(t=0),0|(e=!!(0|t))):0|(e=0)}function Y(t,e,n){t|=0,e|=0,n|=0;var r,s,c,u,h,f,d,p=0,m=0,g=0,v=0,y=0,b=0,M=0;f=D,D=D+288|0,h=f+264|0,v=f+96|0,m=(p=g=f)+96|0;do{i[p>>2]=0,p=p+4|0}while((0|p)<(0|m));return 0|(e=0|Yt(e,g))?(D=f,0|(b=e)):(Xt(g=0|i[(m=g)>>2],m=0|i[m+4>>2],h),Qt(g,m,v),u=+te(h,v+8|0),a[h>>3]=+a[t>>3],a[(m=h+8|0)>>3]=+a[t+16>>3],a[v>>3]=+a[t+8>>3],a[(g=v+8|0)>>3]=+a[t+24>>3],s=+te(h,v),M=+a[m>>3]-+a[g>>3],c=+l(+M),d=+a[h>>3]-+a[v>>3],r=+l(+d),!(0==M|0==d)&&(M=+He(+c,+r),M=+_(+s*s/+je(+M/+je(+c,+r),3)/(u*(2.59807621135*u)*.8)),a[o>>3]=M,y=~~M>>>0,b=+l(M)>=1?M>0?~~+x(+A(M/4294967296),4294967295)>>>0:~~+_((M-+(~~M>>>0))/4294967296)>>>0:0,2146435072&~i[o+4>>2])?(v=!(0|y)&!(0|b),i[(e=n)>>2]=v?1:y,i[e+4>>2]=v?0:b,e=0):e=1,D=f,0|(b=e))}function Z(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var s,c,u,h,f=0,d=0,p=0;h=D,D=D+288|0,c=h+264|0,u=h+96|0,s=(f=d=h)+96|0;do{i[f>>2]=0,f=f+4|0}while((0|f)<(0|s));return 0|(n=0|Yt(n,d))?(D=h,0|(r=n)):(Xt(f=0|i[(n=d)>>2],n=0|i[n+4>>2],c),Qt(f,n,u),p=+te(c,u+8|0),p=+_(+ +te(t,e)/(2*p)),a[o>>3]=p,n=~~p>>>0,f=+l(p)>=1?p>0?~~+x(+A(p/4294967296),4294967295)>>>0:~~+_((p-+(~~p>>>0))/4294967296)>>>0:0,2146435072&~i[o+4>>2]?(d=!(0|n)&!(0|f),i[r>>2]=d?1:n,i[r+4>>2]=d?0:f,D=h,0|(r=0)):(D=h,0|(r=1)))}function K(t,e,n,r){e|=0,n|=0,r|=0,i[(t|=0)>>2]=e,i[t+4>>2]=n,i[t+8>>2]=r}function J(t,e){t|=0;var n,r,o,s,A=0,c=0,u=0,h=0,f=0,d=0,p=0;i[(s=(e|=0)+8|0)>>2]=0,r=+a[t>>3],h=+l(+r),o=+a[t+8>>3],h+=.5*(f=+l(+o)/.8660254037844386),h-=+(0|(A=~~h)),f-=+(0|(t=~~f));do{if(h<.5){if(h<.3333333333333333){if(i[e>>2]=A,f<.5*(h+1)){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(t=(1&!(f<(p=1-h)))+t|0,i[e+4>>2]=t,p<=f&f<2*h){A=A+1|0,i[e>>2]=A;break}i[e>>2]=A;break}if(!(h<.6666666666666666)){if(A=A+1|0,i[e>>2]=A,f<.5*h){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(f<1-h){if(i[e+4>>2]=t,2*h-1<f){i[e>>2]=A;break}}else t=t+1|0,i[e+4>>2]=t;A=A+1|0,i[e>>2]=A}while(0);do{if(r<0){if(1&t){A=~~(+(0|A)-(2*(+((d=0|Oe(0|A,((0|A)<0)<<31>>31,0|(d=(t+1|0)/2|0),((0|d)<0)<<31>>31))>>>0)+4294967296*+(0|E()))+1)),i[e>>2]=A;break}A=~~(+(0|A)-2*(+((d=0|Oe(0|A,((0|A)<0)<<31>>31,0|(d=(0|t)/2|0),((0|d)<0)<<31>>31))>>>0)+4294967296*+(0|E()))),i[e>>2]=A;break}}while(0);d=e+4|0,o<0&&(A=A-((1|t<<1)/2|0)|0,i[e>>2]=A,t=0-t|0,i[d>>2]=t),c=t-A|0,(0|A)<0?(u=0-A|0,i[d>>2]=c,i[s>>2]=u,i[e>>2]=0,t=c,A=0):u=0,(0|t)<0&&(A=A-t|0,i[e>>2]=A,u=u-t|0,i[s>>2]=u,i[d>>2]=0,t=0),n=A-u|0,c=t-u|0,(0|u)<0&&(i[e>>2]=n,i[d>>2]=c,i[s>>2]=0,t=c,A=n,u=0),(0|(c=(0|u)<(0|(c=(0|t)<(0|A)?t:A))?u:c))<=0||(i[e>>2]=A-c,i[d>>2]=t-c,i[s>>2]=u-c)}function $(t){var e,n=0,r=0,a=0,o=0,s=0;n=0|i[(t|=0)>>2],r=0|i[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,i[e>>2]=r,i[(s=t+8|0)>>2]=(0|i[s>>2])-n,i[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,i[t>>2]=n,o=(0|i[(s=t+8|0)>>2])-r|0,i[s>>2]=o,i[e>>2]=0,r=0):(s=o=t+8|0,o=0|i[o>>2]),(0|o)<0&&(n=n-o|0,i[t>>2]=n,r=r-o|0,i[e>>2]=r,i[s>>2]=0,o=0),(0|(a=(0|o)<(0|(a=(0|r)<(0|n)?r:n))?o:a))<=0||(i[t>>2]=n-a,i[e>>2]=r-a,i[s>>2]=o-a)}function tt(t,e){e|=0;var n,r;r=0|i[(t|=0)+8>>2],n=+((0|i[t+4>>2])-r|0),a[e>>3]=+((0|i[t>>2])-r|0)-.5*n,a[e+8>>3]=.8660254037844386*n}function et(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[e>>2])+(0|i[t>>2]),i[n+4>>2]=(0|i[e+4>>2])+(0|i[t+4>>2]),i[n+8>>2]=(0|i[e+8>>2])+(0|i[t+8>>2])}function nt(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[t>>2])-(0|i[e>>2]),i[n+4>>2]=(0|i[t+4>>2])-(0|i[e+4>>2]),i[n+8>>2]=(0|i[t+8>>2])-(0|i[e+8>>2])}function rt(t,e){e|=0;var n,r=0;r=0|y(0|i[(t|=0)>>2],e),i[t>>2]=r,n=0|y(0|i[(r=t+4|0)>>2],e),i[r>>2]=n,e=0|y(0|i[(t=t+8|0)>>2],e),i[t>>2]=e}function it(t){var e,n,r=0,a=0,o=0,s=0,A=0;A=(0|(n=0|i[(t|=0)>>2]))<0,t=(t=(a=(0|(s=((e=(0|(o=(0|i[t+4>>2])-(A?n:0)|0))<0)?0-o|0:0)+((0|i[t+8>>2])-(A?n:0))|0))<0)?0:s)-((o=(0|(a=(0|t)<(0|(a=(0|(r=(e?0:o)-(a?s:0)|0))<(0|(s=(A?0:n)-(e?o:0)-(a?s:0)|0))?r:s))?t:a))>0)?a:0)|0,r=r-(o?a:0)|0;t:do{switch(s-(o?a:0)|0){case 0:switch(0|r){case 0:return 0|(A=0|t?1==(0|t)?1:7:0);case 1:return 0|(A=0|t?1==(0|t)?3:7:2);default:break t}case 1:switch(0|r){case 0:return 0|(A=0|t?1==(0|t)?5:7:4);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(A=7)}function at(t){var e,n=0,r=0,a=0,o=0,s=0,A=0;o=0|i[(e=(t|=0)+8|0)>>2],s=(0|i[t>>2])-o|0,o=(0|i[(A=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(A=1);if((2147483647-(s<<1)|0)<(0|s))return 0|(A=1)}else{if((-2147483648-s|0)>(0|s))return 0|(A=1);if((-2147483648-(s<<1)|0)>(0|s))return 0|(A=1)}if(n=3*s|0,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(A=1)}else if((-2147483648-o|0)>(0|o))return 0|(A=1);if(a=o<<1,(0|s)>-1){if((-2147483648|n)>=(0|o))return 0|(A=1)}else if((-2147483648^n)<(0|o))return 0|(A=1);if(r){if(!((2147483647-s|0)<(0|a))){r=a;break}return 0|(n=1)}if(!((-2147483648-s|0)>(0|a))){r=a;break}return 0|(n=1)}r=o<<1,n=3*s|0}while(0);a=0|Ce(+(n-o|0)/7),i[t>>2]=a,o=0|Ce(+(r+s|0)/7),i[A>>2]=o,i[e>>2]=0,n=(r=(0|o)<(0|a))?a:o,r=r?o:a;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;S(23313,22444,355,22455)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&S(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n)<(0|r))break;S(23313,22444,355,22455)}else{if((-2147483648^n)>=(0|r))break;S(23313,22444,355,22455)}}}while(0);return n=o-a|0,(0|a)<0?(r=0-a|0,i[A>>2]=n,i[e>>2]=r,i[t>>2]=0,a=0):(n=o,r=0),(0|n)<0&&(a=a-n|0,i[t>>2]=a,r=r-n|0,i[e>>2]=r,i[A>>2]=0,n=0),s=a-r|0,o=n-r|0,(0|r)<0?(i[t>>2]=s,i[A>>2]=o,i[e>>2]=0,n=o,o=s,r=0):o=a,(0|(a=(0|r)<(0|(a=(0|n)<(0|o)?n:o))?r:a))<=0||(i[t>>2]=o-a,i[A>>2]=n-a,i[e>>2]=r-a),0|(A=0)}function ot(t){var e,n=0,r=0,a=0,o=0,s=0,A=0;o=0|i[(e=(t|=0)+8|0)>>2],s=(0|i[t>>2])-o|0,o=(0|i[(A=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(A=1)}else if((-2147483648-s|0)>(0|s))return 0|(A=1);if(n=s<<1,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(A=1);if((2147483647-(o<<1)|0)<(0|o))return 0|(A=1)}else{if((-2147483648-o|0)>(0|o))return 0|(A=1);if((-2147483648-(o<<1)|0)>(0|o))return 0|(A=1)}if(a=3*o|0,r){if((2147483647-n|0)<(0|o))return 0|(A=1)}else if((-2147483648-n|0)>(0|o))return 0|(A=1);if((0|o)>-1){if((-2147483648|a)<(0|s)){r=a;break}return 0|(n=1)}if(!((-2147483648^a)<(0|s))){r=a;break}return 0|(n=1)}r=3*o|0,n=s<<1}while(0);a=0|Ce(+(n+o|0)/7),i[t>>2]=a,o=0|Ce(+(r-s|0)/7),i[A>>2]=o,i[e>>2]=0,n=(r=(0|o)<(0|a))?a:o,r=r?o:a;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;S(23313,22444,404,22469)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&S(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n)<(0|r))break;S(23313,22444,404,22469)}else{if((-2147483648^n)>=(0|r))break;S(23313,22444,404,22469)}}}while(0);return n=o-a|0,(0|a)<0?(r=0-a|0,i[A>>2]=n,i[e>>2]=r,i[t>>2]=0,a=0):(n=o,r=0),(0|n)<0&&(a=a-n|0,i[t>>2]=a,r=r-n|0,i[e>>2]=r,i[A>>2]=0,n=0),s=a-r|0,o=n-r|0,(0|r)<0?(i[t>>2]=s,i[A>>2]=o,i[e>>2]=0,n=o,o=s,r=0):o=a,(0|(a=(0|r)<(0|(a=(0|n)<(0|o)?n:o))?r:a))<=0||(i[t>>2]=o-a,i[A>>2]=n-a,i[e>>2]=r-a),0|(A=0)}function st(t){var e,n,r=0,a=0,o=0,s=0,A=0;a=0|i[(e=(t|=0)+8|0)>>2],o=0|Ce(+((3*(r=(0|i[t>>2])-a|0)|0)-(a=(0|i[(n=t+4|0)>>2])-a|0)|0)/7),i[t>>2]=o,r=0|Ce(+((a<<1)+r|0)/7),i[n>>2]=r,i[e>>2]=0,a=r-o|0,(0|o)<0?(A=0-o|0,i[n>>2]=a,i[e>>2]=A,i[t>>2]=0,r=a,o=0,a=A):a=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,a=a-r|0,i[e>>2]=a,i[n>>2]=0,r=0),A=o-a|0,s=r-a|0,(0|a)<0?(i[t>>2]=A,i[n>>2]=s,i[e>>2]=0,r=s,s=A,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|r)<(0|s)?r:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=a-o)}function At(t){var e,n,r=0,a=0,o=0,s=0,A=0;a=0|i[(e=(t|=0)+8|0)>>2],o=0|Ce(+(((r=(0|i[t>>2])-a|0)<<1)+(a=(0|i[(n=t+4|0)>>2])-a|0)|0)/7),i[t>>2]=o,r=0|Ce(+((3*a|0)-r|0)/7),i[n>>2]=r,i[e>>2]=0,a=r-o|0,(0|o)<0?(A=0-o|0,i[n>>2]=a,i[e>>2]=A,i[t>>2]=0,r=a,o=0,a=A):a=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,a=a-r|0,i[e>>2]=a,i[n>>2]=0,r=0),A=o-a|0,s=r-a|0,(0|a)<0?(i[t>>2]=A,i[n>>2]=s,i[e>>2]=0,r=s,s=A,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|r)<(0|s)?r:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=a-o)}function lt(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],A=o+(3*a|0)|0,i[t>>2]=A,o=s+(3*o|0)|0,i[n>>2]=o,a=(3*s|0)+a|0,i[r>>2]=a,s=o-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=s,i[r>>2]=a,i[t>>2]=0,o=s,s=0):s=A,(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function ct(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=(3*(a=0|i[(n=t+4|0)>>2])|0)+A|0,A=(o=0|i[(r=t+8|0)>>2])+(3*A|0)|0,i[t>>2]=A,i[n>>2]=s,a=(3*o|0)+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,A=0):o=s,(0|o)<0&&(A=A-o|0,i[t>>2]=A,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=A-a|0,s=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|s)<(0|A)?s:A))?a:o))<=0||(i[t>>2]=A-o,i[n>>2]=s-o,i[r>>2]=a-o)}function ut(t,e){t|=0;var n,r,a,o=0,s=0,A=0;((e|=0)+-1|0)>>>0>=6||(A=(0|i[15440+(12*e|0)>>2])+(0|i[t>>2])|0,i[t>>2]=A,a=t+4|0,s=(0|i[15440+(12*e|0)+4>>2])+(0|i[a>>2])|0,i[a>>2]=s,r=t+8|0,e=(0|i[15440+(12*e|0)+8>>2])+(0|i[r>>2])|0,i[r>>2]=e,o=s-A|0,(0|A)<0?(e=e-A|0,i[a>>2]=o,i[r>>2]=e,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,e=e-o|0,i[r>>2]=e,i[a>>2]=0,o=0),n=s-e|0,A=o-e|0,(0|e)<0?(i[t>>2]=n,i[a>>2]=A,i[r>>2]=0,s=n,e=0):A=o,(0|(o=(0|e)<(0|(o=(0|A)<(0|s)?A:s))?e:o))<=0||(i[t>>2]=s-o,i[a>>2]=A-o,i[r>>2]=e-o))}function ht(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=(a=0|i[(n=t+4|0)>>2])+A|0,A=(o=0|i[(r=t+8|0)>>2])+A|0,i[t>>2]=A,i[n>>2]=s,a=o+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function ft(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],s=0|i[(n=t+4|0)>>2],o=0|i[(r=t+8|0)>>2],A=s+a|0,i[t>>2]=A,s=o+s|0,i[n>>2]=s,a=o+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function dt(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function pt(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function mt(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],A=o+(a<<1)|0,i[t>>2]=A,o=s+(o<<1)|0,i[n>>2]=o,a=(s<<1)+a|0,i[r>>2]=a,s=o-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=s,i[r>>2]=a,i[t>>2]=0,o=s,s=0):s=A,(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function gt(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=((a=0|i[(n=t+4|0)>>2])<<1)+A|0,A=(o=0|i[(r=t+8|0)>>2])+(A<<1)|0,i[t>>2]=A,i[n>>2]=s,a=(o<<1)+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,A=0):o=s,(0|o)<0&&(A=A-o|0,i[t>>2]=A,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=A-a|0,s=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|s)<(0|A)?s:A))?a:o))<=0||(i[t>>2]=A-o,i[n>>2]=s-o,i[r>>2]=a-o)}function vt(t,e){e|=0;var n,r,a,o=0,s=0,A=0;return a=(0|(r=(0|i[(t|=0)>>2])-(0|i[e>>2])|0))<0,n=(0|(s=(0|i[t+4>>2])-(0|i[e+4>>2])-(a?r:0)|0))<0,e=(e=(t=(0|(A=(a?0-r|0:0)+(0|i[t+8>>2])-(0|i[e+8>>2])+(n?0-s|0:0)|0))<0)?0:A)-((s=(0|(t=(0|e)<(0|(t=(0|(o=(n?0:s)-(t?A:0)|0))<(0|(A=(a?0:r)-(n?s:0)-(t?A:0)|0))?o:A))?e:t))>0)?t:0)|0,o=o-(s?t:0)|0,0|((0|(t=(0|(t=A-(s?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(o=(0|o)>-1?o:0-o|0))>(0|(e=(0|e)>-1?e:0-e|0))?o:e))?t:e)}function _t(t,e){e|=0;var n;n=0|i[(t|=0)+8>>2],i[e>>2]=(0|i[t>>2])-n,i[e+4>>2]=(0|i[t+4>>2])-n}function yt(t,e){e|=0;var n,r,a,o=0,s=0,A=0;s=0|i[(t|=0)>>2],i[e>>2]=s,A=0|i[t+4>>2],i[(r=e+4|0)>>2]=A,i[(a=e+8|0)>>2]=0,t=(o=(0|A)<(0|s))?s:A,o=o?A:s;do{if((0|o)<0){if((0|t)>0){if((-2147483648|t)<(0|o)&-2147483648!=(0|o)&(2147483647-t|0)>=(0|o))break;return 0|(t=1)}if(-2147483648==(0|o)|(-2147483648-t|0)>(0|o))return 0|(e=1);if((0|t)>-1){if((-2147483648|t)<(0|o))break;return 0|(t=1)}if(!((-2147483648^t)<(0|o)))break;return 0|(t=1)}}while(0);return t=A-s|0,(0|s)<0?(o=0-s|0,i[r>>2]=t,i[a>>2]=o,i[e>>2]=0,s=0):(t=A,o=0),(0|t)<0&&(s=s-t|0,i[e>>2]=s,o=o-t|0,i[a>>2]=o,i[r>>2]=0,t=0),n=s-o|0,A=t-o|0,(0|o)<0?(i[e>>2]=n,i[r>>2]=A,i[a>>2]=0,t=A,A=n,o=0):A=s,(0|(s=(0|o)<(0|(s=(0|t)<(0|A)?t:A))?o:s))<=0||(i[e>>2]=A-s,i[r>>2]=t-s,i[a>>2]=o-s),0|(e=0)}function xt(t){var e,n,r,a;n=(a=0|i[(e=(t|=0)+8|0)>>2])-(0|i[t>>2])|0,i[t>>2]=n,t=(0|i[(r=t+4|0)>>2])-a|0,i[r>>2]=t,i[e>>2]=0-(t+n)}function bt(t){var e,n,r=0,a=0,o=0,s=0,A=0;r=0-(a=0|i[(t|=0)>>2])|0,i[t>>2]=r,i[(e=t+8|0)>>2]=0,s=(o=0|i[(n=t+4|0)>>2])+a|0,(0|a)>0?(i[n>>2]=s,i[e>>2]=a,i[t>>2]=0,r=0,o=s):a=0,(0|o)<0?(A=r-o|0,i[t>>2]=A,a=a-o|0,i[e>>2]=a,i[n>>2]=0,s=A-a|0,r=0-a|0,(0|a)<0?(i[t>>2]=s,i[n>>2]=r,i[e>>2]=0,o=r,a=0):(o=0,s=A)):s=r,(0|(r=(0|a)<(0|(r=(0|o)<(0|s)?o:s))?a:r))<=0||(i[t>>2]=s-r,i[n>>2]=o-r,i[e>>2]=a-r)}function Mt(t,e,n){n|=0;var r,a,o=0,s=0;return a=D,D=D+16|0,r=a,s=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e)?(o=0|ze(0|(t|=0),0|e,56),E(),o=0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,a=0,o=0;if(o=D,D=D+16|0,a=o,r=0|Nt(t,e),(n+-1|0)>>>0>5)return D=o,0|(a=-1);if(r=!!(0|r),1==(0|n)&r)return D=o,0|(a=-1);do{if(!(0|_e(t,e,a))){if(r){r=(5+(0|i[21936+(n<<2)>>2])-(0|i[a>>2])|0)%5|0;break}r=(6+(0|i[21968+(n<<2)>>2])-(0|i[a>>2])|0)%6|0;break}r=-1}while(0);return a=r,D=o,0|a}(t,s,7&o),-1==(0|o)?(i[n>>2]=0,D=a,0|(s=6)):(0|Wt(t,s,r)&&S(23313,22484,282,22499),e=0|ze(0|t,0|e,52),E(),e&=15,0|Nt(t,s)?Tt(r,e,o,2,n):Lt(r,e,o,2,n),D=a,0|(s=0))):(D=a,0|(s=6))}function wt(t,e,n,r){e|=0,r|=0;var o,s=0,A=0,l=0,c=0;if(o=D,D=D+16|0,function(t,e,n){t|=0,e|=0,n|=0;var r=0,o=0,s=0;s=D,D=D+32|0,o=s,function(t,e){t|=0,e|=0;var n=0,r=0,i=0;n=+a[t>>3],r=+h(+n),n=+f(+n),a[e+16>>3]=n,n=+a[t+8>>3],i=r*+h(+n),a[e>>3]=i,n=r*+f(+n),a[e+8>>3]=n}(t,o),i[e>>2]=0,a[n>>3]=5,r=+ve(16400,o),r<+a[n>>3]&&(i[e>>2]=0,a[n>>3]=r);r=+ve(16424,o),r<+a[n>>3]&&(i[e>>2]=1,a[n>>3]=r);r=+ve(16448,o),r<+a[n>>3]&&(i[e>>2]=2,a[n>>3]=r);r=+ve(16472,o),r<+a[n>>3]&&(i[e>>2]=3,a[n>>3]=r);r=+ve(16496,o),r<+a[n>>3]&&(i[e>>2]=4,a[n>>3]=r);r=+ve(16520,o),r<+a[n>>3]&&(i[e>>2]=5,a[n>>3]=r);r=+ve(16544,o),r<+a[n>>3]&&(i[e>>2]=6,a[n>>3]=r);r=+ve(16568,o),r<+a[n>>3]&&(i[e>>2]=7,a[n>>3]=r);r=+ve(16592,o),r<+a[n>>3]&&(i[e>>2]=8,a[n>>3]=r);r=+ve(16616,o),r<+a[n>>3]&&(i[e>>2]=9,a[n>>3]=r);r=+ve(16640,o),r<+a[n>>3]&&(i[e>>2]=10,a[n>>3]=r);r=+ve(16664,o),r<+a[n>>3]&&(i[e>>2]=11,a[n>>3]=r);r=+ve(16688,o),r<+a[n>>3]&&(i[e>>2]=12,a[n>>3]=r);r=+ve(16712,o),r<+a[n>>3]&&(i[e>>2]=13,a[n>>3]=r);r=+ve(16736,o),r<+a[n>>3]&&(i[e>>2]=14,a[n>>3]=r);r=+ve(16760,o),r<+a[n>>3]&&(i[e>>2]=15,a[n>>3]=r);r=+ve(16784,o),r<+a[n>>3]&&(i[e>>2]=16,a[n>>3]=r);r=+ve(16808,o),r<+a[n>>3]&&(i[e>>2]=17,a[n>>3]=r);r=+ve(16832,o),r<+a[n>>3]&&(i[e>>2]=18,a[n>>3]=r);if(r=+ve(16856,o),!(r<+a[n>>3]))return void(D=s);i[e>>2]=19,a[n>>3]=r,D=s}(t|=0,n|=0,c=o),(A=+p(+(1-.5*+a[c>>3])))<1e-16)return i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,void(D=o);if(c=0|i[n>>2],s=+Jt((s=+a[15920+(24*c|0)>>3])-+Jt(+function(t,e){t|=0,e|=0;var n=0,r=0,i=0,o=0,s=0;return o=+a[e>>3],r=+h(+o),i=+a[e+8>>3]-+a[t+8>>3],s=r*+f(+i),n=+a[t>>3],+ +v(+s,+(+f(+o)*+h(+n)-+h(+i)*(r*+f(+n))))}(15600+(c<<4)|0,t))),l=0|Ht(e)?+Jt(s+-.3334731722518321):s,s=+d(+A)/.381966011250105,(0|e)>0){t=0;do{s*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}A=+h(+l)*s,a[r>>3]=A,l=+f(+l)*s,a[r+8>>3]=l,D=o}function Et(t,e,n,r,o){e|=0,n|=0,r|=0,o|=0;var s=0,A=0;if(s=+function(t){t|=0;var e=0,n=0;return n=+a[t>>3],e=+a[t+8>>3],+ +c(+(n*n+e*e))}(t|=0),s<1e-16)return e=15600+(e<<4)|0,i[o>>2]=i[e>>2],i[o+4>>2]=i[e+4>>2],i[o+8>>2]=i[e+8>>2],void(i[o+12>>2]=i[e+12>>2]);if(A=+v(+ +a[t+8>>3],+ +a[t>>3]),(0|n)>0){t=0;do{s/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}r?(s/=3,n=!(0|Ht(n)),s=+g(.381966011250105*(n?s:s/2.6457513110645907))):(s=+g(.381966011250105*s),0|Ht(n)&&(A=+Jt(A+.3334731722518321))),function(t,e,n,r){t|=0,e=+e,n=+n,r|=0;var o=0,s=0,A=0,c=0;if(n<1e-16)return i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],void(i[r+12>>2]=i[t+12>>2]);s=e<0?e+6.283185307179586:e,s=e>=6.283185307179586?s+-6.283185307179586:s;do{if(!(s<1e-16)){if(o=+l(+(s+-3.141592653589793))<1e-16,e=+a[t>>3],o){e-=n,a[r>>3]=e,o=r;break}if(A=+h(+n),n=+f(+n),e=A*+f(+e)+ +h(+s)*(n*+h(+e)),e=+m(+((e=e>1?1:e)<-1?-1:e)),a[r>>3]=e,+l(+(e+-1.5707963267948966))<1e-16)return a[r>>3]=1.5707963267948966,void(a[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return a[r>>3]=-1.5707963267948966,void(a[r+8>>3]=0);if(c=+h(+e),s=n*+f(+s)/c,n=+a[t>>3],e=(A-+f(+e)*+f(+n))/+h(+n)/c,A=s>1?1:s,e=e>1?1:e,(e=+a[t+8>>3]+ +v(+(A<-1?-1:A),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(a[r+8>>3]=e)}e=+a[t>>3]+n,a[r>>3]=e,o=r}while(0);if(+l(+(e+-1.5707963267948966))<1e-16)return a[o>>3]=1.5707963267948966,void(a[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return a[o>>3]=-1.5707963267948966,void(a[r+8>>3]=0);if(e=+a[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);a[r+8>>3]=e}(15600+(e<<4)|0,+Jt(+a[15920+(24*e|0)>>3]-A),s,o)}function St(t,e,n){e|=0,n|=0;var r,a;r=D,D=D+16|0,tt((t|=0)+4|0,a=r),Et(a,0|i[t>>2],e,0,n),D=r}function Tt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,A,l,c,u,h,f,d,p,m,g,v,_,y,x,b,M,w,E,T,C,R,P=0,L=0,O=0,I=0,q=0,U=0;if(R=D,D=D+272|0,I=R+240|0,E=R,T=R+224|0,C=R+208|0,g=R+176|0,v=R+160|0,_=R+192|0,y=R+144|0,x=R+128|0,b=R+112|0,M=R+96|0,w=R+80|0,i[(P=R+256|0)>>2]=e,i[I>>2]=i[t>>2],i[I+4>>2]=i[t+4>>2],i[I+8>>2]=i[t+8>>2],i[I+12>>2]=i[t+12>>2],Ct(I,P,E),i[o>>2]=0,(0|(I=r+n+(5==(0|r)&1)|0))<=(0|n))D=R;else{A=T+4|0,l=g+4|0,c=n+5|0,u=16880+((s=0|i[P>>2])<<2)|0,h=16960+(s<<2)|0,f=x+8|0,d=b+8|0,p=M+8|0,m=C+4|0,O=n;t:for(;;){L=E+((0|O)%5<<4)|0,i[C>>2]=i[L>>2],i[C+4>>2]=i[L+4>>2],i[C+8>>2]=i[L+8>>2],i[C+12>>2]=i[L+12>>2];do{}while(2==(0|Rt(C,s,0,1)));if((0|O)>(0|n)&!!(0|Ht(e))){if(i[g>>2]=i[C>>2],i[g+4>>2]=i[C+4>>2],i[g+8>>2]=i[C+8>>2],i[g+12>>2]=i[C+12>>2],tt(A,v),r=0|i[g>>2],P=0|i[17040+(80*r|0)+(i[T>>2]<<2)>>2],i[g>>2]=i[18640+(80*r|0)+(20*P|0)>>2],(0|(L=0|i[18640+(80*r|0)+(20*P|0)+16>>2]))>0){t=0;do{ht(l),t=t+1|0}while((0|t)<(0|L))}switch(L=18640+(80*r|0)+(20*P|0)+4|0,i[_>>2]=i[L>>2],i[_+4>>2]=i[L+4>>2],i[_+8>>2]=i[L+8>>2],rt(_,3*(0|i[u>>2])|0),et(l,_,l),$(l),tt(l,y),q=+(0|i[h>>2]),a[x>>3]=3*q,a[f>>3]=0,U=-1.5*q,a[b>>3]=U,a[d>>3]=2.598076211353316*q,a[M>>3]=U,a[p>>3]=-2.598076211353316*q,0|i[17040+(80*(0|i[g>>2])|0)+(i[C>>2]<<2)>>2]){case 1:t=b,r=x;break;case 3:t=M,r=b;break;case 2:t=x,r=M;break;default:t=12;break t}me(v,y,r,t,w),Et(w,0|i[g>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])}if((0|O)<(0|c)&&(tt(m,g),Et(g,0|i[C>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])),i[T>>2]=i[C>>2],i[T+4>>2]=i[C+4>>2],i[T+8>>2]=i[C+8>>2],i[T+12>>2]=i[C+12>>2],(0|(O=O+1|0))>=(0|I)){t=3;break}}3!=(0|t)?12==(0|t)&&S(22522,22569,571,22579):D=R}}function Ct(t,e,n){t|=0,e|=0,n|=0;var r,a=0,o=0,s=0,A=0,l=0;r=D,D=D+128|0,o=r,A=20240,l=(s=a=r+64|0)+60|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));A=20304,l=(s=o)+60|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));a=(l=!(0|Ht(0|i[e>>2])))?a:o,mt(o=t+4|0),gt(o),0|Ht(0|i[e>>2])&&(ct(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],et(o,a,e=n+4|0),$(e),i[n+16>>2]=i[t>>2],et(o,a+12|0,e=n+20|0),$(e),i[n+32>>2]=i[t>>2],et(o,a+24|0,e=n+36|0),$(e),i[n+48>>2]=i[t>>2],et(o,a+36|0,e=n+52|0),$(e),i[n+64>>2]=i[t>>2],et(o,a+48|0,n=n+68|0),$(n),D=r}function Rt(t,e,n,r){n|=0,r|=0;var a,o,s,A,l,c,u=0,h=0,f=0,d=0,p=0;if(c=D,D=D+32|0,l=c+12|0,o=c,p=(t|=0)+4|0,d=0|i[16960+((e|=0)<<2)>>2],d=(A=!!(0|r))?3*d|0:d,u=0|i[p>>2],a=0|i[(s=t+8|0)>>2],A){if((0|(u=a+u+(r=0|i[(h=t+12|0)>>2])|0))==(0|d))return D=c,0|(p=1);f=h}else u=a+u+(r=0|i[(f=t+12|0)>>2])|0;if((0|u)<=(0|d))return D=c,0|(p=0);do{if((0|r)>0){if(r=0|i[t>>2],(0|a)>0){h=18640+(80*r|0)+60|0,r=t;break}r=18640+(80*r|0)+40|0,n?(K(l,d,0,0),nt(p,l,o),ft(o),et(o,l,p),h=r,r=t):(h=r,r=t)}else h=18640+(80*(0|i[t>>2])|0)+20|0,r=t}while(0);if(i[r>>2]=i[h>>2],(0|i[(u=h+16|0)>>2])>0){r=0;do{ht(p),r=r+1|0}while((0|r)<(0|i[u>>2]))}return t=h+4|0,i[l>>2]=i[t>>2],i[l+4>>2]=i[t+4>>2],i[l+8>>2]=i[t+8>>2],e=0|i[16880+(e<<2)>>2],rt(l,A?3*e|0:e),et(p,l,p),$(p),r=A&&((0|i[s>>2])+(0|i[p>>2])+(0|i[f>>2])|0)==(0|d)?1:2,D=c,0|(p=r)}function Pt(t,e){t|=0,e|=0;var n=0;do{n=0|Rt(t,e,0,1)}while(2==(0|n));return 0|n}function Lt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,A,l,c,u,h,f,d,p,m,g,v,_,y,x,b,M,w,E=0,T=0,C=0,R=0,P=0;if(w=D,D=D+240|0,y=w+208|0,x=w,b=w+192|0,M=w+176|0,p=w+160|0,m=w+144|0,g=w+128|0,v=w+112|0,_=w+96|0,i[(E=w+224|0)>>2]=e,i[y>>2]=i[t>>2],i[y+4>>2]=i[t+4>>2],i[y+8>>2]=i[t+8>>2],i[y+12>>2]=i[t+12>>2],Dt(y,E,x),i[o>>2]=0,(0|(d=r+n+(6==(0|r)&1)|0))<=(0|n))D=w;else{A=n+6|0,l=16960+((s=0|i[E>>2])<<2)|0,c=m+8|0,u=g+8|0,h=v+8|0,f=b+4|0,T=0,C=n,r=-1;t:for(;;){if(t=x+((E=(0|C)%6|0)<<4)|0,i[b>>2]=i[t>>2],i[b+4>>2]=i[t+4>>2],i[b+8>>2]=i[t+8>>2],i[b+12>>2]=i[t+12>>2],t=T,T=0|Rt(b,s,0,1),(0|C)>(0|n)&!!(0|Ht(e))&&(1!=(0|t)&&(0|i[b>>2])!=(0|r))){switch(tt(x+((E+5|0)%6<<4)+4|0,M),tt(x+(E<<4)+4|0,p),R=+(0|i[l>>2]),a[m>>3]=3*R,a[c>>3]=0,P=-1.5*R,a[g>>3]=P,a[u>>3]=2.598076211353316*R,a[v>>3]=P,a[h>>3]=-2.598076211353316*R,E=0|i[y>>2],0|i[17040+(80*E|0)+(((0|r)==(0|E)?i[b>>2]:r)<<2)>>2]){case 1:t=g,r=m;break;case 3:t=v,r=g;break;case 2:t=m,r=v;break;default:t=8;break t}me(M,p,r,t,_),0|ge(M,_)||0|ge(p,_)||(Et(_,0|i[y>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2]))}if((0|C)<(0|A)&&(tt(f,M),Et(M,0|i[b>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])),(0|(C=C+1|0))>=(0|d)){t=3;break}r=0|i[b>>2]}3!=(0|t)?8==(0|t)&&S(22606,22569,736,22651):D=w}}function Dt(t,e,n){t|=0,e|=0,n|=0;var r,a=0,o=0,s=0,A=0,l=0;r=D,D=D+160|0,o=r,A=20368,l=(s=a=r+80|0)+72|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));A=20448,l=(s=o)+72|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));a=(l=!(0|Ht(0|i[e>>2])))?a:o,mt(o=t+4|0),gt(o),0|Ht(0|i[e>>2])&&(ct(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],et(o,a,e=n+4|0),$(e),i[n+16>>2]=i[t>>2],et(o,a+12|0,e=n+20|0),$(e),i[n+32>>2]=i[t>>2],et(o,a+24|0,e=n+36|0),$(e),i[n+48>>2]=i[t>>2],et(o,a+36|0,e=n+52|0),$(e),i[n+64>>2]=i[t>>2],et(o,a+48|0,e=n+68|0),$(e),i[n+80>>2]=i[t>>2],et(o,a+60|0,n=n+84|0),$(n),D=r}function Ot(t,e){return e=0|ze(0|(t|=0),0|(e|=0),45),E(),127&e}function It(t,e){var n=0,r=0,i=0,a=0,o=0,s=0;if(!(!0&134217728==(-16777216&(e|=0))))return 0|(e=0);if(o=0|ze(0|(t|=0),0|e,45),E(),(o&=127)>>>0>121)return 0|(e=0);n=0|ze(0|t,0|e,52),E(),n&=15;do{if(0|n){for(i=1,r=0;;){if(a=0|ze(0|t,0|e,3*(15-i|0)|0),E(),!!(0|(a&=7))&(1^r)){if(1==(0|a)&!!(0|F(o))){s=0,r=13;break}r=1}if(7==(0|a)){s=0,r=13;break}if(!(i>>>0<n>>>0)){r=9;break}i=i+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(s=1)}if(13==(0|r))return 0|s}}while(0);for(;;){if(s=0|ze(0|t,0|e,3*(14-n|0)|0),E(),!(!0&!(7&~s))){s=0,r=13;break}if(!(n>>>0<14)){s=1,r=13;break}n=n+1|0}return 13==(0|r)?0|s:0}function qt(t,e,n,r){n|=0,r|=0;var a=0,o=0;if(o=0|ze(0|(t|=0),0|(e|=0),52),E(),n>>>0>15)return 0|(r=4);if((0|(o&=15))<(0|n))return 0|(r=12);if((0|o)==(0|n))return i[r>>2]=t,i[r+4>>2]=e,0|(r=0);if(a=0|Ge(0|n,0,52),a|=t,t=E()|-15728641&e,(0|o)>(0|n))do{e=0|Ge(7,0,3*(14-n|0)|0),n=n+1|0,a|=e,t=E()|t}while((0|n)<(0|o));return i[r>>2]=a,i[r+4>>2]=t,0|(r=0)}function Ut(t,e,n,r){n|=0,r|=0;var a=0,o=0,s=0;if(o=0|ze(0|(t|=0),0|(e|=0),52),E(),!((0|n)<16&(0|(o&=15))<=(0|n)))return 0|(r=4);a=n-o|0,n=0|ze(0|t,0|e,45),E();t:do{if(0|F(127&n)){e:do{if(0|o){for(n=1;!((s=0|Ge(7,0,3*(15-n|0)|0))&t)&!(E()&e);){if(!(n>>>0<o>>>0))break e;n=n+1|0}n=0|ue(7,0,a,((0|a)<0)<<31>>31),a=0|E();break t}}while(0);n=0|De(0|(n=0|Ne(0|(n=0|ue(7,0,a,((0|a)<0)<<31>>31)),0|E(),5,0)),0|E(),-5,-1),n=0|De(0|(n=0|Ue(0|n,0|E(),6,0)),0|E(),1,0),a=0|E()}else n=0|ue(7,0,a,((0|a)<0)<<31>>31),a=0|E()}while(0);return i[(s=r)>>2]=n,i[s+4>>2]=a,0|(s=0)}function Nt(t,e){var n=0,r=0,i=0;if(i=0|ze(0|(t|=0),0|(e|=0),45),E(),!(0|F(127&i)))return 0|(i=0);i=0|ze(0|t,0|e,52),E(),i&=15;t:do{if(i)for(r=1;;){if(n=0|ze(0|t,0|e,3*(15-r|0)|0),E(),0|(n&=7))break t;if(!(r>>>0<i>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=1&!(0|n))}function Bt(t,e){var n=0,r=0,i=0;if(i=0|ze(0|(t|=0),0|(e|=0),52),E(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|ze(0|t,0|e,3*(15-r|0)|0),E(),0|(n&=7)){r=5;break}if(!(r>>>0<i>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function kt(t,e){var n=0,r=0,i=0,a=0,o=0,s=0,A=0;if(A=0|ze(0|(t|=0),0|(e|=0),52),E(),!(A&=15))return A=t,w(0|(s=e)),0|A;for(s=1,n=0;;){r=0|Ge(7,0,0|(a=3*(15-s|0)|0)),i=0|E(),o=0|ze(0|t,0|e,0|a),E(),t=(a=0|Ge(0|dt(7&o),0,0|a))|t&~r,e=(o=0|E())|e&~i;t:do{if(!n)if(!(a&r)&!(o&i))n=0;else if(r=0|ze(0|t,0|e,52),E(),r&=15){n=1;e:for(;;){switch(o=0|ze(0|t,0|e,3*(15-n|0)|0),E(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(i=0|ze(0|t,0|e,0|(o=3*(15-n|0)|0)),E(),a=0|Ge(7,0,0|o),e&=~E(),t=t&~a|(o=0|Ge(0|dt(7&i),0,0|o)),e|=E(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<A>>>0))break;s=s+1|0}return w(0|e),0|t}function Ft(t,e){var n=0,r=0,i=0,a=0,o=0;if(r=0|ze(0|(t|=0),0|(e|=0),52),E(),!(r&=15))return r=t,w(0|(n=e)),0|r;for(n=1;o=0|ze(0|t,0|e,0|(a=3*(15-n|0)|0)),E(),i=0|Ge(7,0,0|a),e&=~E(),t=(a=0|Ge(0|dt(7&o),0,0|a))|t&~i,e=E()|e,n>>>0<r>>>0;)n=n+1|0;return w(0|e),0|t}function zt(t,e){var n=0,r=0,i=0,a=0,o=0,s=0,A=0;if(A=0|ze(0|(t|=0),0|(e|=0),52),E(),!(A&=15))return A=t,w(0|(s=e)),0|A;for(s=1,n=0;;){r=0|Ge(7,0,0|(a=3*(15-s|0)|0)),i=0|E(),o=0|ze(0|t,0|e,0|a),E(),t=(a=0|Ge(0|pt(7&o),0,0|a))|t&~r,e=(o=0|E())|e&~i;t:do{if(!n)if(!(a&r)&!(o&i))n=0;else if(r=0|ze(0|t,0|e,52),E(),r&=15){n=1;e:for(;;){switch(o=0|ze(0|t,0|e,3*(15-n|0)|0),E(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(a=0|Ge(7,0,0|(i=3*(15-n|0)|0)),o=e&~E(),e=0|ze(0|t,0|e,0|i),E(),t=t&~a|(e=0|Ge(0|pt(7&e),0,0|i)),e=o|E(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<A>>>0))break;s=s+1|0}return w(0|e),0|t}function Gt(t,e){var n=0,r=0,i=0,a=0,o=0;if(r=0|ze(0|(t|=0),0|(e|=0),52),E(),!(r&=15))return r=t,w(0|(n=e)),0|r;for(n=1;a=0|Ge(7,0,0|(o=3*(15-n|0)|0)),i=e&~E(),e=0|ze(0|t,0|e,0|o),E(),t=(e=0|Ge(0|pt(7&e),0,0|o))|t&~a,e=E()|i,n>>>0<r>>>0;)n=n+1|0;return w(0|e),0|t}function Ht(t){return(0|(t|=0))%2|0}function jt(t,e,n){n|=0;var r,a=0;return r=D,D=D+16|0,a=r,(e|=0)>>>0>15?(D=r,0|(a=4)):2146435072&~i[(t|=0)+4>>2]&&2146435072&~i[t+8+4>>2]?(function(t,e,n){var r,i;r=D,D=D+16|0,wt(t|=0,e|=0,n|=0,i=r),J(i,n+4|0),D=r}(t,e,a),e=0|function(t,e){t|=0;var n,r=0,a=0,o=0,s=0,A=0,l=0,c=0,u=0;if(n=D,D=D+64|0,l=n+40|0,a=n+24|0,o=n+12|0,s=n,Ge(0|(e|=0),0,52),r=134225919|E(),!e)return(0|i[t+4>>2])>2||(0|i[t+8>>2])>2||(0|i[t+12>>2])>2?(l=0,w(0|(A=0)),D=n,0|l):(Ge(0|G(t),0,45),A=E()|r,l=-1,w(0|A),D=n,0|l);if(i[l>>2]=i[t>>2],i[l+4>>2]=i[t+4>>2],i[l+8>>2]=i[t+8>>2],i[l+12>>2]=i[t+12>>2],A=l+4|0,(0|e)>0)for(t=-1;i[a>>2]=i[A>>2],i[a+4>>2]=i[A+4>>2],i[a+8>>2]=i[A+8>>2],1&e?(st(A),i[o>>2]=i[A>>2],i[o+4>>2]=i[A+4>>2],i[o+8>>2]=i[A+8>>2],lt(o)):(At(A),i[o>>2]=i[A>>2],i[o+4>>2]=i[A+4>>2],i[o+8>>2]=i[A+8>>2],ct(o)),nt(a,o,s),$(s),c=0|Ge(7,0,0|(u=3*(15-e|0)|0)),r&=~E(),t=(u=0|Ge(0|it(s),0,0|u))|t&~c,r=E()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|i[A>>2])<=2&&(0|i[l+8>>2])<=2&&(0|i[l+12>>2])<=2){if(e=0|Ge(0|(a=0|G(l)),0,45),e|=t,t=E()|-1040385&r,s=0|H(l),!(0|F(a))){if((0|s)<=0)break;for(o=0;;){if(a=0|ze(0|e,0|t,52),E(),a&=15)for(r=1;l=0|ze(0|e,0|t,0|(u=3*(15-r|0)|0)),E(),c=0|Ge(7,0,0|u),t&=~E(),e=e&~c|(u=0|Ge(0|dt(7&l),0,0|u)),t|=E(),r>>>0<a>>>0;)r=r+1|0;if((0|(o=o+1|0))==(0|s))break t}}o=0|ze(0|e,0|t,52),E(),o&=15;e:do{if(o){r=1;n:for(;;){switch(u=0|ze(0|e,0|t,3*(15-r|0)|0),E(),7&u){case 1:break n;case 0:break;default:break e}if(!(r>>>0<o>>>0))break e;r=r+1|0}if(0|j(a,0|i[l>>2]))for(r=1;c=0|Ge(7,0,0|(l=3*(15-r|0)|0)),u=t&~E(),t=0|ze(0|e,0|t,0|l),E(),e=e&~c|(t=0|Ge(0|pt(7&t),0,0|l)),t=u|E(),r>>>0<o>>>0;)r=r+1|0;else for(r=1;l=0|ze(0|e,0|t,0|(u=3*(15-r|0)|0)),E(),c=0|Ge(7,0,0|u),t&=~E(),e=e&~c|(u=0|Ge(0|dt(7&l),0,0|u)),t|=E(),r>>>0<o>>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{e=0|kt(e,t),t=0|E(),r=r+1|0}while((0|r)!=(0|s))}}else e=0,t=0}while(0);return u=e,w(0|(c=t)),D=n,0|u}(a,e),a=0|E(),i[n>>2]=e,i[n+4>>2]=a,!(0|e)&!(0|a)&&S(23313,22674,786,22697),D=r,0|(a=0)):(D=r,0|(a=3))}function Vt(t,e,n){var r,a=0,o=0,s=0;if(r=(n|=0)+4|0,o=0|ze(0|(t|=0),0|(e|=0),52),E(),o&=15,s=0|ze(0|t,0|e,45),E(),a=!(0|o),0|F(127&s)){if(a)return 0|(s=1);a=1}else{if(a)return 0|(s=0);a=0|i[r>>2]||0|i[n+8>>2]?1:1&!!(0|i[n+12>>2])}for(n=1;1&n?lt(r):ct(r),s=0|ze(0|t,0|e,3*(15-n|0)|0),E(),ut(r,7&s),n>>>0<o>>>0;)n=n+1|0;return 0|a}function Wt(t,e,n){n|=0;var r,a,o=0,s=0,A=0,l=0,c=0,u=0;if(a=D,D=D+16|0,r=a,u=0|ze(0|(t|=0),0|(e|=0),45),E(),(u&=127)>>>0>121)return i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,i[n+12>>2]=0,D=a,0|(u=5);t:do{if(0|F(u)&&(A=0|ze(0|t,0|e,52),E(),0|(A&=15))){o=1;e:for(;;){switch(c=0|ze(0|t,0|e,3*(15-o|0)|0),E(),7&c){case 5:break e;case 0:break;default:o=e;break t}if(!(o>>>0<A>>>0)){o=e;break t}o=o+1|0}for(s=1,o=e;l=0|Ge(7,0,0|(e=3*(15-s|0)|0)),c=o&~E(),o=0|ze(0|t,0|o,0|e),E(),t=t&~l|(o=0|Ge(0|pt(7&o),0,0|e)),o=c|E(),s>>>0<A>>>0;)s=s+1|0}else o=e}while(0);if(c=7696+(28*u|0)|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],i[n+12>>2]=i[c+12>>2],!(0|Vt(t,o,n)))return D=a,0|(u=0);if(l=n+4|0,i[r>>2]=i[l>>2],i[r+4>>2]=i[l+4>>2],i[r+8>>2]=i[l+8>>2],A=0|ze(0|t,0|o,52),E(),c=15&A,1&A?(ct(l),A=c+1|0):A=c,0|F(u)){t:do{if(c)for(e=1;;){if(s=0|ze(0|t,0|o,3*(15-e|0)|0),E(),0|(s&=7)){o=s;break t}if(!(e>>>0<c>>>0)){o=0;break}e=e+1|0}else o=0}while(0);o=4==(0|o)&1}else o=0;if(0|Rt(n,A,o,0)){if(0|F(u))do{}while(0|Rt(n,A,0,0));(0|A)!=(0|c)&&At(l)}else(0|A)!=(0|c)&&(i[l>>2]=i[r>>2],i[l+4>>2]=i[r+4>>2],i[l+8>>2]=i[r+8>>2]);return D=a,0|(u=0)}function Xt(t,e,n){n|=0;var r,i,a=0;return i=D,D=D+16|0,0|(a=0|Wt(t|=0,e|=0,r=i))?(D=i,0|a):(a=0|ze(0|t,0|e,52),E(),St(r,15&a,n),D=i,0|(a=0))}function Qt(t,e,n){n|=0;var r,i=0,a=0,o=0;if(r=D,D=D+16|0,0|(i=0|Wt(t|=0,e|=0,o=r)))return D=r,0|(o=i);i=0|ze(0|t,0|e,45),E(),i=!(0|F(127&i)),a=0|ze(0|t,0|e,52),E(),a&=15;t:do{if(!i){if(0|a)for(i=1;;){if(!(!((0|Ge(7,0,3*(15-i|0)|0))&t)&!(E()&e)))break t;if(!(i>>>0<a>>>0))break;i=i+1|0}return Tt(o,a,0,5,n),D=r,0|0}}while(0);return Lt(o,a,0,6,n),D=r,0|0}function Yt(t,e){e|=0;var n=0,r=0,a=0,o=0,s=0,A=0,l=0;if((t|=0)>>>0>15)return 0|(A=4);if(Ge(0|t,0,52),A=134225919|E(),!t){n=0,r=0;do{0|F(r)&&(Ge(0|r,0,45),s=A|E(),i[(t=e+(n<<3)|0)>>2]=-1,i[t+4>>2]=s,n=n+1|0),r=r+1|0}while(122!=(0|r));return 0|(n=0)}n=0,s=0;do{if(0|F(s)){for(Ge(0|s,0,45),r=1,a=-1,o=A|E();a&=~(l=0|Ge(7,0,3*(15-r|0)|0)),o&=~E(),(0|r)!=(0|t);)r=r+1|0;i[(l=e+(n<<3)|0)>>2]=a,i[l+4>>2]=o,n=n+1|0}s=s+1|0}while(122!=(0|s));return 0|(n=0)}function Zt(t,e,n,r){t|=0,r|=0;var a=0,o=0;a=0|ze(0|(e|=0),0|(n|=0),52),E(),!(0|e)&!(0|n)|(0|r)>15|(0|(a&=15))>(0|r)?(r=-1,a=-1,e=0,n=0):(o=0|function(t,e,n,r){return t|=0,e|=0,(0|(r|=0))<(0|(n|=0))?(r=t,w(0|(n=e)),0|r):(n=0|Ge(-1,-1,3+(3*(r-n|0)|0)|0),r=0|Ge(0|~n,0|~E(),3*(15-r|0)|0),n=~E()&e,r=~r&t,w(0|n),0|r)}(e,n,a+1|0,r),n=-15728641&E(),e=0|Ge(0|r,0,52),r=(o=!(0|Nt(e|=o,n|=E())))?-1:r),i[(o=t)>>2]=e,i[o+4>>2]=n,i[t+8>>2]=a,i[t+12>>2]=r}function Kt(t){var e,n=0,r=0,a=0,o=0,s=0,A=0,l=0,c=0;if(!(!(0|(n=0|i[(r=t|=0)>>2]))&!(0|(r=0|i[r+4>>2]))||(a=0|ze(0|n,0|r,52),E(),n=0|De(0|(l=0|Ge(1,0,3*(15^(a&=15))|0)),0|E(),0|n,0|r),r=0|E(),i[(l=t)>>2]=n,i[l+4>>2]=r,(0|a)<(0|(A=0|i[(l=t+8|0)>>2]))))){for(e=t+12|0,s=a;;){if((0|s)==(0|A)){a=5;break}if(c=(0|s)==(0|i[e>>2]),a=0|ze(0|n,0|r,0|(o=3*(15-s|0)|0)),E(),c&1==(0|(a&=7))&!0){a=7;break}if(!(7==(0|a)&!0)){a=10;break}if(n=0|De(0|n,0|r,0|(c=0|Ge(1,0,0|o)),0|E()),r=0|E(),i[(c=t)>>2]=n,i[c+4>>2]=r,!((0|s)>(0|A))){a=10;break}s=s+-1|0}if(5==(0|a))return i[(c=t)>>2]=0,i[c+4>>2]=0,i[l>>2]=-1,void(i[e>>2]=-1);if(7==(0|a))return A=0|De(0|n,0|r,0|(A=0|Ge(1,0,0|o)),0|E()),l=0|E(),i[(c=t)>>2]=A,i[c+4>>2]=l,void(i[e>>2]=s+-1)}}function Jt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function $t(t,e){return e|=0,+l(+(+a[(t|=0)>>3]-+a[e>>3]))<17453292519943298e-27?0|(e=+l(+(+a[t+8>>3]-+a[e+8>>3]))<17453292519943298e-27):0|(e=0)}function te(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+f(.5*(r-n)))*i+(o=+f(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))*6371.007180918475}function ee(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|Ne(0|(n=0|ue(7,0,t,((0|t)<0)<<31>>31)),0|E(),120,0),t=0|E(),i[e>>2]=2|n,i[e+4>>2]=t,0|(e=0))}function ne(t,e,n){t|=0,n|=0;var r,i,o,s,A=0,l=0,u=0,p=0,m=0,_=0;return _=+a[(e|=0)>>3],o=+a[t>>3],m=+f(.5*(_-o)),u=+a[e+8>>3],i=+a[t+8>>3],p=+f(.5*(u-i)),r=+h(+o),s=+h(+_),p=2*+v(+ +c(+(p=m*m+p*(s*r*p))),+ +c(+(1-p))),m=+a[n>>3],_=+f(.5*(m-_)),A=+a[n+8>>3],u=+f(.5*(A-u)),l=+h(+m),u=2*+v(+ +c(+(u=_*_+u*(s*l*u))),+ +c(+(1-u))),m=+f(.5*(o-m)),A=+f(.5*(i-A)),A=2*+v(+ +c(+(A=m*m+A*(r*l*A))),+ +c(+(1-A))),4*+g(+ +c(+ +d(.5*(l=.5*(p+u+A)))*+d(.5*(l-p))*+d(.5*(l-u))*+d(.5*(l-A))))}function re(t,e,n){n|=0;var r,o,s,A=0,l=0;if(s=D,D=D+192|0,o=s,0|(l=0|Xt(t|=0,e|=0,r=s+168|0)))return D=s,0|(n=l);if(0|Qt(t,e,o)&&S(23313,22742,386,22751),(0|(e=0|i[o>>2]))>0){if(A=+ne(o+8|0,o+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){t=1;do{A+=+ne(o+8+((l=t)<<4)|0,o+8+((0|(t=t+1|0))%(0|e)<<4)|0,r)}while((0|t)<(0|e))}}else A=0;return a[n>>3]=A,D=s,0|(n=0)}function ie(t){t|=0;var e,n,r=0;return(e=0|Le(1,12))||S(22832,22787,49,22845),0|(r=0|i[(n=t+4|0)>>2])?(i[(r=r+8|0)>>2]=e,i[n>>2]=e,0|e):(0|i[t>>2]&&S(22862,22787,61,22885),i[(r=t)>>2]=e,i[n>>2]=e,0|e)}function ae(t,e){t|=0,e|=0;var n,r;return(r=0|Re(24))||S(22899,22787,78,22913),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[r+16>>2]=0,0|(n=0|i[(e=t+4|0)>>2])?(i[n+16>>2]=r,i[e>>2]=r,0|r):(0|i[t>>2]&&S(22928,22787,82,22913),i[t>>2]=r,i[e>>2]=r,0|r)}function oe(t){var e=0,n=0,r=0,a=0;if(t|=0)for(r=1;;){if(0|(e=0|i[t>>2]))do{if(0|(n=0|i[e>>2]))do{a=n,n=0|i[n+16>>2],Pe(a)}while(0|n);a=e,e=0|i[e+8>>2],Pe(a)}while(0|e);if(e=t,t=0|i[t+8>>2],r||Pe(e),!t)break;r=0}}function se(t){var e,n,r=0,o=0,s=0,A=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,E=0,T=0,C=0,R=0,P=0,L=0,D=0,O=0,I=0,q=0,U=0;if(0|i[(A=(t|=0)+8|0)>>2])return 0|(U=1);if(!(s=0|i[t>>2]))return 0|(U=0);r=s,o=0;do{o=o+1|0,r=0|i[r+8>>2]}while(0|r);if(o>>>0<2)return 0|(U=0);(n=0|Re(o<<2))||S(22948,22787,317,22967),(e=0|Re(o<<5))||S(22989,22787,321,22967),i[t>>2]=0,i[(C=t+4|0)>>2]=0,i[A>>2]=0,o=0,I=0,T=0,m=0;t:for(;;){if(p=0|i[s>>2]){c=0,u=p;do{if(f=+a[u+8>>3],r=u,u=0|i[u+16>>2],h=+a[(A=(d=!(0|u))?p:u)+8>>3],+l(+(f-h))>3.141592653589793){U=14;break}c+=(h-f)*(+a[r>>3]+ +a[A>>3])}while(!d);if(14==(0|U)){U=0,c=0,r=p;do{E=+a[r+8>>3],D=0|i[(O=r+16|0)>>2],w=+a[(D=0|D?D:p)+8>>3],c+=(+a[r>>3]+ +a[D>>3])*((w<0?w+6.283185307179586:w)-(E<0?E+6.283185307179586:E)),r=0|i[(0|r?O:s)>>2]}while(0|r)}c>0?(i[n+(I<<2)>>2]=s,I=I+1|0,A=T,r=m):U=19}else U=19;if(19==(0|U)){U=0;do{if(!o){if(m){A=C,u=m+8|0,r=s,o=t;break}if(0|i[t>>2]){U=27;break t}A=C,u=t,r=s,o=t;break}if(0|i[(r=o+8|0)>>2]){U=21;break t}if(!(o=0|Le(1,12))){U=23;break t}i[r>>2]=o,A=o+4|0,u=o,r=m}while(0);if(i[u>>2]=s,i[A>>2]=s,u=e+(T<<5)|0,d=0|i[s>>2]){for(a[(p=e+(T<<5)+8|0)>>3]=17976931348623157e292,a[(m=e+(T<<5)+24|0)>>3]=17976931348623157e292,a[u>>3]=-17976931348623157e292,a[(g=e+(T<<5)+16|0)>>3]=-17976931348623157e292,b=17976931348623157e292,M=-17976931348623157e292,A=0,v=d,f=17976931348623157e292,y=17976931348623157e292,x=-17976931348623157e292,h=-17976931348623157e292;c=+a[v>>3],E=+a[v+8>>3],v=0|i[v+16>>2],w=+a[((_=!(0|v))?d:v)+8>>3],c<f&&(a[p>>3]=c,f=c),E<y&&(a[m>>3]=E,y=E),c>x?a[u>>3]=c:c=x,E>h&&(a[g>>3]=E,h=E),b=E>0&E<b?E:b,M=E<0&E>M?E:M,A|=+l(+(E-w))>3.141592653589793,!_;)x=c;A&&(a[g>>3]=M,a[m>>3]=b)}else i[u>>2]=0,i[u+4>>2]=0,i[u+8>>2]=0,i[u+12>>2]=0,i[u+16>>2]=0,i[u+20>>2]=0,i[u+24>>2]=0,i[u+28>>2]=0;A=T+1|0}if(s=0|i[(O=s+8|0)>>2],i[O>>2]=0,!s){U=45;break}T=A,m=r}if(21==(0|U))S(22765,22787,35,22799);else if(23==(0|U))S(22819,22787,37,22799);else if(27==(0|U))S(22862,22787,61,22885);else if(45==(0|U)){t:do{if((0|I)>0){for(O=!(0|A),L=A<<2,D=!(0|t),P=0,r=0;;){if(R=0|i[n+(P<<2)>>2],O)U=73;else{if(!(T=0|Re(L))){U=50;break}if(!(C=0|Re(L))){U=52;break}e:do{if(D)o=0;else{for(A=0,o=0,u=t;s=e+(A<<5)|0,0|Ae(0|i[u>>2],s,0|i[R>>2])?(i[T+(o<<2)>>2]=u,i[C+(o<<2)>>2]=s,_=o+1|0):_=o,u=0|i[u+8>>2];)A=A+1|0,o=_;if((0|_)>0)if(s=0|i[T>>2],1==(0|_))o=s;else for(g=0,v=-1,o=s,m=s;;){for(d=0|i[m>>2],s=0,u=0;p=(0|(A=0|i[i[T+(u<<2)>>2]>>2]))==(0|d)?s:s+(1&Ae(A,0|i[C+(u<<2)>>2],0|i[d>>2]))|0,(0|(u=u+1|0))!=(0|_);)s=p;if(o=(A=(0|p)>(0|v))?m:o,(0|(s=g+1|0))==(0|_))break e;g=s,v=A?p:v,m=0|i[T+(s<<2)>>2]}else o=0}}while(0);if(Pe(T),Pe(C),o){if(s=0|i[(A=o+4|0)>>2])o=s+8|0;else if(0|i[o>>2]){U=70;break}i[o>>2]=R,i[A>>2]=R}else U=73}if(73==(0|U)){if(U=0,0|(r=0|i[R>>2]))do{C=r,r=0|i[r+16>>2],Pe(C)}while(0|r);Pe(R),r=1}if((0|(P=P+1|0))>=(0|I)){q=r;break t}}50==(0|U)?S(23004,22787,249,23023):52==(0|U)?S(23042,22787,252,23023):70==(0|U)&&S(22862,22787,61,22885)}else q=0}while(0);return Pe(n),Pe(e),0|(U=q)}return 0}function Ae(t,e,n){t|=0;var r=0,o=0,s=0,A=0,l=0,c=0,u=0,h=0;if(!(0|Q(e|=0,n|=0)))return 0|(t=0);if(e=0|X(e),r=+a[n>>3],o=e&(o=+a[n+8>>3])<0?o+6.283185307179586:o,!(t=0|i[t>>2]))return 0|(t=0);if(e){e=0,u=o,n=t;t:for(;;){for(;A=+a[n>>3],o=+a[n+8>>3],h=0|i[(n=n+16|0)>>2],s=+a[(h=0|h?h:t)>>3],l=+a[h+8>>3],A>s?(c=A,A=l):(c=s,s=A,A=o,o=l),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(((c=(l=A<0?A+6.283185307179586:A)+(r-s)/(c-s)*((A=o<0?o+6.283185307179586:o)-l))<0?c+6.283185307179586:c)>(u=l==u|A==u?u+-2220446049250313e-31:u)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,u=o,n=t;t:for(;;){for(;A=+a[n>>3],o=+a[n+8>>3],h=0|i[(n=n+16|0)>>2],s=+a[(h=0|h?h:t)>>3],l=+a[h+8>>3],A>s?(c=A,A=l):(c=s,s=A,A=o,o=l),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(A+(r-s)/(c-s)*(o-A)>(u=A==u|o==u?u+-2220446049250313e-31:u)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function le(t,e,n,a,o){n|=0,a|=0,o|=0;var s,A,l,c,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;if(c=D,D=D+32|0,y=c+16|0,l=c,u=0|ze(0|(t|=0),0|(e|=0),52),E(),u&=15,g=0|ze(0|n,0|a,52),E(),(0|u)!=(15&g))return D=c,0|(y=12);if(p=0|ze(0|t,0|e,45),E(),p&=127,m=0|ze(0|n,0|a,45),E(),p>>>0>121|(m&=127)>>>0>121)return D=c,0|(y=5);if(g=(0|p)!=(0|m)){if(7==(0|(f=0|W(p,m))))return D=c,0|(y=1);7==(0|(d=0|W(m,p)))?S(23066,23090,161,23100):(v=f,h=d)}else v=0,h=0;s=0|F(p),A=0|F(m),i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0;do{if(v){if(f=(0|(m=0|i[4272+(28*p|0)+(v<<2)>>2]))>0,A)if(f){p=0,d=n,f=a;do{d=0|zt(d,f),f=0|E(),1==(0|(h=0|pt(h)))&&(h=0|pt(1)),p=p+1|0}while((0|p)!=(0|m));m=h,p=d,d=f}else m=h,p=n,d=a;else if(f){p=0,d=n,f=a;do{d=0|Gt(d,f),f=0|E(),h=0|pt(h),p=p+1|0}while((0|p)!=(0|m));m=h,p=d,d=f}else m=h,p=n,d=a;if(Vt(p,d,y),g||S(23115,23090,191,23100),(f=!!(0|s))&(h=!!(0|A))&&S(23142,23090,192,23100),f){if(7==(0|(h=0|Bt(t,e)))){u=5;break}if(0|r[21872+(7*h|0)+v|0]){u=1;break}p=d=0|i[21040+(28*h|0)+(v<<2)>>2]}else if(h){if(7==(0|(h=0|Bt(p,d)))){u=5;break}if(0|r[21872+(7*h|0)+m|0]){u=1;break}p=0,d=0|i[21040+(28*m|0)+(h<<2)>>2]}else p=0,d=0;if((p|d)<0)u=5;else{if((0|d)>0){f=y+4|0,h=0;do{ft(f),h=h+1|0}while((0|h)!=(0|d))}if(i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,ut(l,v),0|u)for(;0|Ht(u)?lt(l):ct(l),(0|u)>1;)u=u+-1|0;if((0|p)>0){u=0;do{ft(l),u=u+1|0}while((0|u)!=(0|p))}et(_=y+4|0,l,_),$(_),_=51}}else if(Vt(n,a,y),!!(0|s)&!!(0|A))if((0|m)!=(0|p)&&S(23173,23090,261,23100),7==(0|(h=0|Bt(t,e)))|7==(0|(u=0|Bt(n,a))))u=5;else if(0|r[21872+(7*h|0)+u|0])u=1;else if((0|(h=0|i[21040+(28*h|0)+(u<<2)>>2]))>0){f=y+4|0,u=0;do{ft(f),u=u+1|0}while((0|u)!=(0|h));_=51}else _=51;else _=51}while(0);return 51==(0|_)&&(u=y+4|0,i[o>>2]=i[u>>2],i[o+4>>2]=i[u+4>>2],i[o+8>>2]=i[u+8>>2],u=0),D=c,0|(y=u)}function ce(t,e,n,r){n|=0,r|=0;var a,o,s,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;if(s=D,D=D+48|0,a=s+36|0,c=s+24|0,u=s+12|0,h=s,A=0|ze(0|(t|=0),0|(e|=0),52),E(),A&=15,d=0|ze(0|t,0|e,45),E(),(d&=127)>>>0>121)return D=s,0|(r=5);if(o=0|F(d),Ge(0|A,0,52),g=134225919|E(),i[(l=r)>>2]=-1,i[l+4>>2]=g,!A)return 7==(0|(A=0|it(n)))||127==(0|(A=0|V(d,A)))?(D=s,0|(g=1)):(p=0|Ge(0|A,0,45),m=0|E(),m=-1040385&i[(d=r)+4>>2]|m,i[(g=r)>>2]=i[d>>2]|p,i[g+4>>2]=m,D=s,0|(g=0));for(i[a>>2]=i[n>>2],i[a+4>>2]=i[n+4>>2],i[a+8>>2]=i[n+8>>2],n=A;;){if(l=n,n=n+-1|0,i[c>>2]=i[a>>2],i[c+4>>2]=i[a+4>>2],i[c+8>>2]=i[a+8>>2],0|Ht(l)){if(0|(A=0|at(a))){n=13;break}i[u>>2]=i[a>>2],i[u+4>>2]=i[a+4>>2],i[u+8>>2]=i[a+8>>2],lt(u)}else{if(0|(A=0|ot(a))){n=13;break}i[u>>2]=i[a>>2],i[u+4>>2]=i[a+4>>2],i[u+8>>2]=i[a+8>>2],ct(u)}if(nt(c,u,h),$(h),_=0|i[(A=r)>>2],A=0|i[A+4>>2],v=0|Ge(7,0,0|(y=3*(15-l|0)|0)),A&=~E(),y=0|Ge(0|it(h),0,0|y),A=E()|A,i[(g=r)>>2]=y|_&~v,i[g+4>>2]=A,(0|l)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|i[a>>2])<=1&&(0|i[a+4>>2])<=1&&(0|i[a+8>>2])<=1){h=127==(0|(A=0|V(d,n=0|it(a))))?0:0|F(A);e:do{if(n){if(o){if(7==(0|(A=0|Bt(t,e)))){A=5;break t}if((0|(l=0|i[21248+(28*A|0)+(n<<2)>>2]))>0){A=n,n=0;do{A=0|dt(A),n=n+1|0}while((0|n)!=(0|l))}else A=n;if(1==(0|A)){A=9;break t}127==(0|(n=0|V(d,A)))&&S(23200,23090,411,23230),0|F(n)?S(23245,23090,412,23230):(m=n,p=l,f=A)}else m=A,p=0,f=n;if((0|(u=0|i[4272+(28*d|0)+(f<<2)>>2]))<=-1&&S(23276,23090,419,23230),!h){if((0|p)<0){A=5;break t}if(0|p){A=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];do{n=0|Ft(n,l),l=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=l,A=A+1|0}while((0|A)<(0|p))}if((0|u)<=0){A=m,n=58;break}for(A=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];;)if(n=0|Ft(n,l),l=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=l,(0|(A=A+1|0))==(0|u)){A=m,n=58;break e}}if(7==(0|(c=0|W(m,d)))&&S(23066,23090,428,23230),n=0|i[(A=r)>>2],A=0|i[A+4>>2],(0|u)>0){l=0;do{n=0|Ft(n,A),A=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=A,l=l+1|0}while((0|l)!=(0|u))}if(7==(0|(A=0|Bt(n,A)))&&S(23313,23090,440,23230),n=0|z(m),(0|(n=0|i[(n?21664:21456)+(28*c|0)+(A<<2)>>2]))<0&&S(23313,23090,454,23230),n){A=0,l=0|i[(c=r)>>2],c=0|i[c+4>>2];do{l=0|kt(l,c),c=0|E(),i[(y=r)>>2]=l,i[y+4>>2]=c,A=A+1|0}while((0|A)<(0|n));A=m,n=58}else A=m,n=58}else if(!!(0|o)&!!(0|h)){if(7==(0|(n=0|Bt(t,e)))|7==(0|(l=0|Bt(0|i[(l=r)>>2],0|i[l+4>>2])))){A=5;break t}if((0|(l=0|i[21248+(28*n|0)+(l<<2)>>2]))<0){A=5;break t}if(l){n=0,c=0|i[(u=r)>>2],u=0|i[u+4>>2];do{c=0|Ft(c,u),u=0|E(),i[(y=r)>>2]=c,i[y+4>>2]=u,n=n+1|0}while((0|n)<(0|l));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&h&&(n=59),59==(0|n)&&1==(0|Bt(0|i[(y=r)>>2],0|i[y+4>>2]))){A=9;break}v=0|i[(y=r)>>2],y=-1040385&i[y+4>>2],_=0|Ge(0|A,0,45),y|=E(),i[(A=r)>>2]=v|_,i[A+4>>2]=y,A=0}else A=1}while(0);return D=s,0|(y=A)}function ue(t,e,n,r){t|=0,e|=0;var i=0,a=0,o=0;if(!(0|(n|=0))&!(0|(r|=0)))return a=1,w(0|(i=0)),0|a;a=t,i=e,t=1,e=0;do{t=0|Ne(0|((o=!0&!(1&n))?1:a),0|(o?0:i),0|t,0|e),e=0|E(),n=0|Fe(0|n,0|r,1),r=0|E(),a=0|Ne(0|a,0|i,0|a,0|i),i=0|E()}while(!(!(0|n)&!(0|r)));return w(0|e),0|t}function he(t,e,n){t|=0;var r,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0;if(!(0|Q(e|=0,n|=0)))return 0|(d=0);if(e=0|X(e),o=+a[n>>3],s=e&(s=+a[n+8>>3])<0?s+6.283185307179586:s,(0|(d=0|i[t>>2]))<=0)return 0|(d=0);if(r=0|i[t+4>>2],e){e=0,f=s,n=-1,t=0;t:for(;;){for(h=t;l=+a[r+(h<<4)>>3],s=+a[r+(h<<4)+8>>3],A=+a[r+((t=(n+2|0)%(0|d)|0)<<4)>>3],c=+a[r+(t<<4)+8>>3],l>A?(u=l,l=c):(u=A,A=l,l=s,s=c),(o=o==A|o==u?o+2220446049250313e-31:o)<A|o>u;){if((0|(n=h+1|0))>=(0|d)){n=22;break t}t=h,h=n,n=t}if(((u=(c=l<0?l+6.283185307179586:l)+(o-A)/(u-A)*((l=s<0?s+6.283185307179586:s)-c))<0?u+6.283185307179586:u)>(f=c==f|l==f?f+-2220446049250313e-31:f)&&(e^=1),(0|(t=h+1|0))>=(0|d)){n=22;break}n=h}if(22==(0|n))return 0|e}else{e=0,f=s,n=-1,t=0;t:for(;;){for(h=t;l=+a[r+(h<<4)>>3],s=+a[r+(h<<4)+8>>3],A=+a[r+((t=(n+2|0)%(0|d)|0)<<4)>>3],c=+a[r+(t<<4)+8>>3],l>A?(u=l,l=c):(u=A,A=l,l=s,s=c),(o=o==A|o==u?o+2220446049250313e-31:o)<A|o>u;){if((0|(n=h+1|0))>=(0|d)){n=22;break t}t=h,h=n,n=t}if(l+(o-A)/(u-A)*(s-l)>(f=l==f|s==f?f+-2220446049250313e-31:f)&&(e^=1),(0|(t=h+1|0))>=(0|d)){n=22;break}n=h}if(22==(0|n))return 0|e}return 0}function fe(t,e){e|=0;var n,r,o,s,A,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0;if(!(r=0|i[(t|=0)>>2]))return i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,void(i[e+28>>2]=0);if(a[(o=e+8|0)>>3]=17976931348623157e292,a[(s=e+24|0)>>3]=17976931348623157e292,a[e>>3]=-17976931348623157e292,a[(A=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[t+4>>2],g=17976931348623157e292,v=-17976931348623157e292,_=0,t=-1,f=17976931348623157e292,d=17976931348623157e292,m=-17976931348623157e292,u=-17976931348623157e292,y=0;c=+a[n+(y<<4)>>3],p=+a[n+(y<<4)+8>>3],h=+a[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],c<f&&(a[o>>3]=c,f=c),p<d&&(a[s>>3]=p,d=p),c>m?a[e>>3]=c:c=m,p>u&&(a[A>>3]=p,u=p),g=p>0&p<g?p:g,v=p<0&p>v?p:v,_|=+l(+(p-h))>3.141592653589793,(0|(t=y+1|0))!=(0|r);)x=y,m=c,y=t,t=x;_&&(a[A>>3]=v,a[s>>3]=g)}}function de(t,e){e|=0;var n,r=0,o=0,s=0,A=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,E=0,S=0;if(v=0|i[(t|=0)>>2]){if(a[(_=e+8|0)>>3]=17976931348623157e292,a[(y=e+24|0)>>3]=17976931348623157e292,a[e>>3]=-17976931348623157e292,a[(x=e+16|0)>>3]=-17976931348623157e292,(0|v)>0){for(s=0|i[t+4>>2],m=17976931348623157e292,g=-17976931348623157e292,o=0,r=-1,h=17976931348623157e292,f=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292,b=0;A=+a[s+(b<<4)>>3],d=+a[s+(b<<4)+8>>3],u=+a[s+(((0|(E=r+2|0))==(0|v)?0:E)<<4)+8>>3],A<h&&(a[_>>3]=A,h=A),d<f&&(a[y>>3]=d,f=d),A>p?a[e>>3]=A:A=p,d>c&&(a[x>>3]=d,c=d),m=d>0&d<m?d:m,g=d<0&d>g?d:g,o|=+l(+(d-u))>3.141592653589793,(0|(r=b+1|0))!=(0|v);)E=b,p=A,b=r,r=E;o&&(a[x>>3]=g,a[y>>3]=m)}}else i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,i[e+28>>2]=0;if(!((0|(r=0|i[(E=t+8|0)>>2]))<=0)){n=t+12|0,w=0;do{if(s=0|i[n>>2],o=w,y=e+((w=w+1|0)<<5)|0,x=0|i[s+(o<<3)>>2]){if(a[(b=e+(w<<5)+8|0)>>3]=17976931348623157e292,a[(t=e+(w<<5)+24|0)>>3]=17976931348623157e292,a[y>>3]=-17976931348623157e292,a[(M=e+(w<<5)+16|0)>>3]=-17976931348623157e292,(0|x)>0){for(v=0|i[s+(o<<3)+4>>2],m=17976931348623157e292,g=-17976931348623157e292,s=0,o=-1,_=0,h=17976931348623157e292,f=17976931348623157e292,d=-17976931348623157e292,c=-17976931348623157e292;A=+a[v+(_<<4)>>3],p=+a[v+(_<<4)+8>>3],u=+a[v+(((0|(o=o+2|0))==(0|x)?0:o)<<4)+8>>3],A<h&&(a[b>>3]=A,h=A),p<f&&(a[t>>3]=p,f=p),A>d?a[y>>3]=A:A=d,p>c&&(a[M>>3]=p,c=p),m=p>0&p<m?p:m,g=p<0&p>g?p:g,s|=+l(+(p-u))>3.141592653589793,(0|(o=_+1|0))!=(0|x);)S=_,_=o,d=A,o=S;s&&(a[M>>3]=g,a[t>>3]=m)}}else i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0,i[y+16>>2]=0,i[y+20>>2]=0,i[y+24>>2]=0,i[y+28>>2]=0,r=0|i[E>>2]}while((0|w)<(0|r))}}function pe(t,e,n){var r=0,a=0,o=0;if(!(0|he(t|=0,e|=0,n|=0)))return 0|(a=0);if((0|i[(a=t+8|0)>>2])<=0)return 0|(a=1);for(r=t+12|0,t=0;;){if(o=t,t=t+1|0,0|he((0|i[r>>2])+(o<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|i[a>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function me(t,e,n,r,i){e|=0,n|=0,r|=0,i|=0;var o,s,A,l,c,u,h,f=0;l=+a[(t|=0)>>3],A=+a[e>>3]-l,s=+a[t+8>>3],o=+a[e+8>>3]-s,u=+a[n>>3],f=((f=+a[r>>3]-u)*(s-(h=+a[n+8>>3]))-(l-u)*(c=+a[r+8>>3]-h))/(A*c-o*f),a[i>>3]=l+A*f,a[i+8>>3]=s+o*f}function ge(t,e){return e|=0,+l(+(+a[(t|=0)>>3]-+a[e>>3]))<1.1920928955078125e-7?0|(e=+l(+(+a[t+8>>3]-+a[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function ve(t,e){e|=0;var n,r,i;return+((i=+a[(t|=0)>>3]-+a[e>>3])*i+(r=+a[t+8>>3]-+a[e+8>>3])*r+(n=+a[t+16>>3]-+a[e+16>>3])*n)}function _e(t,e,n){n|=0;var r,a,o,s,A=0,l=0,c=0;if(s=D,D=D+32|0,c=s,0|(A=0|Wt(t|=0,e|=0,a=s+16|0)))return D=s,0|(n=A);r=0|Ot(t,e),o=0|Bt(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,i[(e|=0)>>2]=i[t>>2],i[e+4>>2]=i[t+4>>2],i[e+8>>2]=i[t+8>>2],i[e+12>>2]=i[t+12>>2]}(r,c),A=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|i[11120+(216*e|0)>>2])!=(0|t))if((0|i[11120+(216*e|0)+8>>2])!=(0|t))if((0|i[11120+(216*e|0)+16>>2])!=(0|t))if((0|i[11120+(216*e|0)+24>>2])!=(0|t))if((0|i[11120+(216*e|0)+32>>2])!=(0|t))if((0|i[11120+(216*e|0)+40>>2])!=(0|t))if((0|i[11120+(216*e|0)+48>>2])!=(0|t))if((0|i[11120+(216*e|0)+56>>2])!=(0|t))if((0|i[11120+(216*e|0)+64>>2])!=(0|t))if((0|i[11120+(216*e|0)+72>>2])!=(0|t))if((0|i[11120+(216*e|0)+80>>2])!=(0|t))if((0|i[11120+(216*e|0)+88>>2])!=(0|t))if((0|i[11120+(216*e|0)+96>>2])!=(0|t))if((0|i[11120+(216*e|0)+104>>2])!=(0|t))if((0|i[11120+(216*e|0)+112>>2])!=(0|t))if((0|i[11120+(216*e|0)+120>>2])!=(0|t))if((0|i[11120+(216*e|0)+128>>2])!=(0|t)){if((0|i[11120+(216*e|0)+136>>2])!=(0|t)){if((0|i[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|i[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|i[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|i[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|i[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|i[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|i[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|i[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|i[11120+(216*e|0)+208>>2])==(0|t)){t=2,n=2,r=2;break}return-1}t=2,n=1,r=2}else t=2,n=1,r=1;else t=2,n=1,r=0;else t=1,n=1,r=2;else t=1,n=1,r=1;else t=1,n=1,r=0;else t=0,n=1,r=2;else t=0,n=1,r=1;else t=0,n=1,r=0;else t=2,n=0,r=2;else t=2,n=0,r=1;else t=2,n=0,r=0;else t=1,n=0,r=2;else t=1,n=0,r=1;else t=1,n=0,r=0;else t=0,n=0,r=2;else t=0,n=0,r=1;else t=0,n=0,r=0}while(0);return 0|i[11120+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2]}(r,0|i[a>>2]);t:do{if(0|F(r)){switch(0|r){case 4:t=0;break;case 14:t=1;break;case 24:t=2;break;case 38:t=3;break;case 49:t=4;break;case 58:t=5;break;case 63:t=6;break;case 72:t=7;break;case 83:t=8;break;case 97:t=9;break;case 107:t=10;break;case 117:t=11;break;default:A=1;break t}if(l=0|i[22e3+(24*t|0)+8>>2],e=0|i[22e3+(24*t|0)+16>>2],(0|(t=0|i[a>>2]))!=(0|i[c>>2])&&(c=0|z(r))|(0|(t=0|i[a>>2]))==(0|e)&&(A=(A+1|0)%6|0),3==(0|o)&(0|t)==(0|e)){A=(A+5|0)%6|0,l=22;break}5==(0|o)&(0|t)==(0|l)?(A=(A+1|0)%6|0,l=22):l=22}else l=22}while(0);return 22==(0|l)&&(i[n>>2]=A,A=0),D=s,0|(n=A)}function ye(t,e,n,r){n|=0,r|=0;var a,o,s,A,l,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0;if(l=D,D=D+32|0,y=l+24|0,A=l+20|0,s=l+8|0,o=l+16|0,a=l,d=(d=!(0|Nt(t|=0,e|=0)))?6:5,m=0|ze(0|t,0|e,52),E(),d>>>0<=n>>>0)return D=l,0|(r=2);!(g=!(0|(m&=15)))&&!((v=0|Ge(7,0,3*(15^m)|0))&t)&!(E()&e)?c=n:u=4;t:do{if(4==(0|u)){if((0|((c=!!(0|Nt(t,e)))?4:5))<(0|n))return D=l,0|(r=1);if(0|_e(t,e,y))return D=l,0|(r=1);if(u=(0|i[y>>2])+n|0,7==(0|(v=0|i[(c=c?22288+((0|u)%5<<2)|0:22320+((0|u)%6<<2)|0)>>2])))return D=l,0|(r=1);i[A>>2]=0,c=0|N(t,e,v,A,s);do{if(!c){if(p=0|i[(f=s)>>2],u=(h=(f=0|i[f+4>>2])>>>0<e>>>0|(0|f)==(0|e)&p>>>0<t>>>0)?p:t,h=h?f:e,!g&&!(p&(g=0|Ge(7,0,3*(15^m)|0)))&!(f&E()))c=n;else{if(f=(n+-1+d|0)%(0|d)|0,c=0|Nt(t,e),(0|f)<0&&S(23313,23315,245,23324),(0|((d=!!(0|c))?4:5))<(0|f)&&S(23313,23315,245,23324),0|_e(t,e,y)&&S(23313,23315,245,23324),c=(0|i[y>>2])+f|0,7==(0|(f=0|i[(c=d?22288+((0|c)%5<<2)|0:22320+((0|c)%6<<2)|0)>>2]))&&S(23313,23315,245,23324),i[o>>2]=0,0|(c=0|N(t,e,f,o,a)))break;d=0|i[(p=a)>>2],p=0|i[p+4>>2];do{if(p>>>0<h>>>0|(0|p)==(0|h)&d>>>0<u>>>0){if(u=0|Nt(d,p)?0|B(d,p,t,e):0|i[22384+(((0|i[o>>2])+(0|i[22352+(f<<2)>>2])|0)%6<<2)>>2],c=0|Nt(d,p),(u+-1|0)>>>0>5){c=-1,u=d,h=p;break}if(1==(0|u)&(c=!!(0|c))){c=-1,u=d,h=p;break}do{if(!(0|_e(d,p,y))){if(c){c=(5+(0|i[21936+(u<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[21968+(u<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1}while(0);u=d,h=p}else c=n}while(0);p=0|i[(f=s)>>2],f=0|i[f+4>>2]}if((0|u)==(0|p)&(0|h)==(0|f)){if(t=(d=!!(0|Nt(p,f)))?0|B(p,f,t,e):0|i[22384+(((0|i[A>>2])+(0|i[22352+(v<<2)>>2])|0)%6<<2)>>2],c=0|Nt(p,f),(t+-1|0)>>>0<=5&&!(1==(0|t)&(_=!!(0|c))))do{if(!(0|_e(p,f,y))){if(_){c=(5+(0|i[21936+(t<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[21968+(t<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1}while(0);else c=-1;c=6==(0|(c=c+1|0))|d&5==(0|c)?0:c}e=h,t=u;break t}}while(0);return D=l,0|(r=c)}}while(0);return _=0|Ge(0|c,0,56),y=E()|-2130706433&e|536870912,i[r>>2]=_|t,i[r+4>>2]=y,D=l,0|(r=0)}function xe(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|Le(e,4),i[t>>2]=r,r||S(23337,23360,40,23374)):i[t>>2]=0,i[t+4>>2]=e,i[t+8>>2]=0,i[t+12>>2]=n}function be(t){var e,n,r,o=0,s=0,A=0,c=0;e=(t|=0)+4|0,n=t+12|0,r=t+8|0;t:for(;;){for(s=0|i[e>>2],o=0;;){if((0|o)>=(0|s))break t;if(A=0|i[t>>2],c=0|i[A+(o<<2)>>2])break;o=o+1|0}o=A+(~~(+l(+ +u(10,+ +(15-(0|i[n>>2])|0))*(+a[c>>3]+ +a[c+8>>3]))%+(0|s))>>>0<<2)|0,s=0|i[o>>2];e:do{if(0|s){if(A=c+32|0,(0|s)==(0|c))i[o>>2]=i[A>>2];else{if(!(o=0|i[(s=s+32|0)>>2]))break;for(;(0|o)!=(0|c);)if(!(o=0|i[(s=o+32|0)>>2]))break e;i[s>>2]=i[A>>2]}Pe(c),i[r>>2]=(0|i[r>>2])-1}}while(0)}Pe(0|i[t>>2])}function Me(t){var e,n=0,r=0;for(e=0|i[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|i[(0|i[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function we(t,e){e|=0;var n=0,r=0,o=0,s=0;if(n=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,n=(0|i[t>>2])+(n<<2)|0,!(r=0|i[n>>2]))return 0|(s=1);s=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|i[r+32>>2]))return 0|(s=1);for(o=n;;){if((0|o)==(0|e)){o=8;break}if(!(n=0|i[o+32>>2])){n=1,o=10;break}r=o,o=n}if(8==(0|o)){i[r+32>>2]=i[s>>2];break}if(10==(0|o))return 0|n}else i[n>>2]=i[s>>2]}while(0);return Pe(e),i[(s=t+8|0)>>2]=(0|i[s>>2])-1,0|(s=0)}function Ee(t,e,n){t|=0,e|=0,n|=0;var r,o=0,s=0,A=0;(r=0|Re(40))||S(23390,23360,98,23403),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[(s=r+16|0)>>2]=i[n>>2],i[s+4>>2]=i[n+4>>2],i[s+8>>2]=i[n+8>>2],i[s+12>>2]=i[n+12>>2],i[r+32>>2]=0,s=~~(+l(+ +u(10,+ +(15-(0|i[t+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,s=(0|i[t>>2])+(s<<2)|0,o=0|i[s>>2];do{if(o){for(;!(0|$t(o,e)&&0|$t(o+16|0,n));)if(s=0|i[o+32>>2],!(0|i[(o=0|s?s:o)+32>>2])){A=10;break}if(10==(0|A)){i[o+32>>2]=r;break}return Pe(r),0|(A=o)}i[s>>2]=r}while(0);return i[(A=t+8|0)>>2]=1+(0|i[A>>2]),0|(A=r)}function Se(t,e,n){e|=0,n|=0;var r=0,o=0;if(o=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(o=0|i[(0|i[t>>2])+(o<<2)>>2]))return 0|(n=0);if(!n){for(t=o;;){if(0|$t(t,e)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=o;;){if(0|$t(t,e)&&0|$t(t+16|0,n)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function Te(t,e){e|=0;var n=0;if(n=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(t=0|i[(0|i[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|$t(t,e)){e=5;break}if(!(t=0|i[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Ce(t){return 0|+function(t){return+ +Qe(+(t=+t))}(t=+t)}function Re(t){t|=0;var e,n=0,r=0,a=0,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0;e=D,D=D+16|0,d=e;do{if(t>>>0<245){if(t=(u=t>>>0<11?16:t+11&-8)>>>3,3&(r=(f=0|i[5857])>>>t))return a=0|i[(r=(t=23468+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|i[(o=a+8|0)>>2]))==(0|t)?i[5857]=f&~(1<<n):(i[s+12>>2]=t,i[r>>2]=s),b=n<<3,i[a+4>>2]=3|b,i[(b=a+b+4|0)>>2]=1|i[b>>2],D=e,0|(b=o);if(u>>>0>(h=0|i[5859])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,s=0|i[(t=(n=23468+((a=((r=(n>>>=l=n>>>12&16)>>>5&8)|l|(s=(n>>>=r)>>>2&4)|(t=(n>>>=s)>>>1&2)|(a=(n>>>=t)>>>1&1))+(n>>>a)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|i[(l=s+8|0)>>2]))==(0|n)?(t=f&~(1<<a),i[5857]=t):(i[r+12>>2]=n,i[t>>2]=r,t=f),A=(b=a<<3)-u|0,i[s+4>>2]=3|u,i[(o=s+u|0)+4>>2]=1|A,i[s+b>>2]=A,0|h&&(a=0|i[5862],r=23468+((n=h>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=a,i[n+12>>2]=a,i[a+8>>2]=n,i[a+12>>2]=r),i[5859]=A,i[5862]=o,D=e,0|(b=l);if(s=0|i[5858]){for(r=(s&0-s)-1|0,r=c=0|i[23732+(((a=(r>>>=o=r>>>12&16)>>>5&8)|o|(A=(r>>>=a)>>>2&4)|(l=(r>>>=A)>>>1&2)|(c=(r>>>=l)>>>1&1))+(r>>>c)<<2)>>2],l=c,c=(-8&i[c+4>>2])-u|0;(t=0|i[r+16>>2])||(t=0|i[r+20>>2]);)r=t,l=(o=(A=(-8&i[t+4>>2])-u|0)>>>0<c>>>0)?t:l,c=o?A:c;if((A=l+u|0)>>>0>l>>>0){o=0|i[l+24>>2],n=0|i[l+12>>2];do{if((0|n)==(0|l)){if(!(n=0|i[(t=l+20|0)>>2])&&!(n=0|i[(t=l+16|0)>>2])){r=0;break}for(;;)if(r=0|i[(a=n+20|0)>>2])n=r,t=a;else{if(!(r=0|i[(a=n+16|0)>>2]))break;n=r,t=a}i[t>>2]=0,r=n}else r=0|i[l+8>>2],i[r+12>>2]=n,i[n+8>>2]=r,r=n}while(0);do{if(0|o){if(n=0|i[l+28>>2],(0|l)==(0|i[(t=23732+(n<<2)|0)>>2])){if(i[t>>2]=r,!r){i[5858]=s&~(1<<n);break}}else if(i[((0|i[(b=o+16|0)>>2])==(0|l)?b:o+20)>>2]=r,!r)break;i[r+24>>2]=o,0|(n=0|i[l+16>>2])&&(i[r+16>>2]=n,i[n+24>>2]=r),0|(n=0|i[l+20>>2])&&(i[r+20>>2]=n,i[n+24>>2]=r)}}while(0);return c>>>0<16?(b=c+u|0,i[l+4>>2]=3|b,i[(b=l+b+4|0)>>2]=1|i[b>>2]):(i[l+4>>2]=3|u,i[A+4>>2]=1|c,i[A+c>>2]=c,0|h&&(a=0|i[5862],r=23468+((n=h>>>3)<<1<<2)|0,(n=1<<n)&f?n=0|i[(t=r+8|0)>>2]:(i[5857]=n|f,n=r,t=r+8|0),i[t>>2]=a,i[n+12>>2]=a,i[a+8>>2]=n,i[a+12>>2]=r),i[5859]=c,i[5862]=A),D=e,0|(b=l+8|0)}f=u}else f=u}else f=u}else if(t>>>0<=4294967231)if(u=-8&(t=t+11|0),a=0|i[5858]){o=0-u|0,c=(t>>>=8)?u>>>0>16777215?31:u>>>((c=14-((l=((g=t<<(f=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|f|(c=((g<<=l)+245760|0)>>>16&2))+(g<<c>>>15)|0)+7|0)&1|c<<1:0,r=0|i[23732+(c<<2)>>2];t:do{if(r)for(t=0,l=u<<(31==(0|c)?0:25-(c>>>1)),s=0;;){if((A=(-8&i[r+4>>2])-u|0)>>>0<o>>>0){if(!A){t=r,o=0,g=65;break t}t=r,o=A}if(s=!(0|(g=0|i[r+20>>2]))|(0|g)==(0|(r=0|i[r+16+(l>>>31<<2)>>2]))?s:g,!r){r=s,g=61;break}l<<=1}else r=0,t=0,g=61}while(0);if(61==(0|g)){if(!(0|r)&!(0|t)){if(!(t=((t=2<<c)|0-t)&a)){f=u;break}f=(t&0-t)-1|0,t=0,r=0|i[23732+(((s=(f>>>=A=f>>>12&16)>>>5&8)|A|(l=(f>>>=s)>>>2&4)|(c=(f>>>=l)>>>1&2)|(r=(f>>>=c)>>>1&1))+(f>>>r)<<2)>>2]}r?g=65:(l=t,A=o)}if(65==(0|g))for(s=r;;){if(o=(r=(f=(-8&i[s+4>>2])-u|0)>>>0<o>>>0)?f:o,t=r?s:t,(r=0|i[s+16>>2])||(r=0|i[s+20>>2]),!r){l=t,A=o;break}s=r}if(0|l&&A>>>0<((0|i[5859])-u|0)>>>0&&(h=l+u|0)>>>0>l>>>0){s=0|i[l+24>>2],n=0|i[l+12>>2];do{if((0|n)==(0|l)){if(!(n=0|i[(t=l+20|0)>>2])&&!(n=0|i[(t=l+16|0)>>2])){n=0;break}for(;;)if(r=0|i[(o=n+20|0)>>2])n=r,t=o;else{if(!(r=0|i[(o=n+16|0)>>2]))break;n=r,t=o}i[t>>2]=0}else b=0|i[l+8>>2],i[b+12>>2]=n,i[n+8>>2]=b}while(0);do{if(s){if(t=0|i[l+28>>2],(0|l)==(0|i[(r=23732+(t<<2)|0)>>2])){if(i[r>>2]=n,!n){a&=~(1<<t),i[5858]=a;break}}else if(i[((0|i[(b=s+16|0)>>2])==(0|l)?b:s+20)>>2]=n,!n)break;i[n+24>>2]=s,0|(t=0|i[l+16>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),(t=0|i[l+20>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);t:do{if(A>>>0<16)b=A+u|0,i[l+4>>2]=3|b,i[(b=l+b+4|0)>>2]=1|i[b>>2];else{if(i[l+4>>2]=3|u,i[h+4>>2]=1|A,i[h+A>>2]=A,n=A>>>3,A>>>0<256){r=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=h,i[n+12>>2]=h,i[h+8>>2]=n,i[h+12>>2]=r;break}if(n=23732+((r=(n=A>>>8)?A>>>0>16777215?31:A>>>((r=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(r=((b<<=y)+245760|0)>>>16&2))+(b<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[h+28>>2]=r,i[(t=h+16|0)+4>>2]=0,i[t>>2]=0,!(a&(t=1<<r))){i[5858]=a|t,i[n>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break}n=0|i[n>>2];e:do{if((-8&i[n+4>>2])!=(0|A)){for(a=A<<(31==(0|r)?0:25-(r>>>1));t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|A)){n=t;break e}a<<=1,n=t}i[r>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break t}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=h,i[x>>2]=h,i[h+8>>2]=b,i[h+12>>2]=n,i[h+24>>2]=0}}while(0);return D=e,0|(b=l+8|0)}f=u}else f=u;else f=-1}while(0);if((r=0|i[5859])>>>0>=f>>>0)return n=r-f|0,t=0|i[5862],n>>>0>15?(b=t+f|0,i[5862]=b,i[5859]=n,i[b+4>>2]=1|n,i[t+r>>2]=n,i[t+4>>2]=3|f):(i[5859]=0,i[5862]=0,i[t+4>>2]=3|r,i[(b=t+r+4|0)>>2]=1|i[b>>2]),D=e,0|(b=t+8|0);if((A=0|i[5860])>>>0>f>>>0)return y=A-f|0,i[5860]=y,x=(b=0|i[5863])+f|0,i[5863]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|f,D=e,0|(b=b+8|0);if(0|i[5975]?t=0|i[5977]:(i[5977]=4096,i[5976]=4096,i[5978]=-1,i[5979]=-1,i[5980]=0,i[5968]=0,i[5975]=-16&d^1431655768,t=4096),l=f+48|0,(u=(s=t+(c=f+47|0)|0)&(o=0-t|0))>>>0<=f>>>0)return D=e,0|(b=0);if(0|(t=0|i[5967])&&(d=(h=0|i[5965])+u|0)>>>0<=h>>>0|d>>>0>t>>>0)return D=e,0|(b=0);t:do{if(4&i[5968])n=0,g=143;else{r=0|i[5863];e:do{if(r){for(a=23876;!((d=0|i[a>>2])>>>0<=r>>>0&&(d+(0|i[a+4>>2])|0)>>>0>r>>>0);){if(!(t=0|i[a+8>>2])){g=128;break e}a=t}if((n=s-A&o)>>>0<2147483647)if((0|(t=0|Ye(0|n)))==((0|i[a>>2])+(0|i[a+4>>2])|0)){if(-1!=(0|t)){A=n,s=t,g=145;break t}}else a=t,g=136;else n=0}else g=128}while(0);do{if(128==(0|g))if(-1!=(0|(r=0|Ye(0)))&&(n=r,m=(n=((m=(p=0|i[5976])+-1|0)&n?(m+n&0-p)-n|0:0)+u|0)+(p=0|i[5965])|0,n>>>0>f>>>0&n>>>0<2147483647)){if(0|(d=0|i[5967])&&m>>>0<=p>>>0|m>>>0>d>>>0){n=0;break}if((0|(t=0|Ye(0|n)))==(0|r)){A=n,s=r,g=145;break t}a=t,g=136}else n=0}while(0);do{if(136==(0|g)){if(r=0-n|0,!(l>>>0>n>>>0&n>>>0<2147483647&-1!=(0|a))){if(-1==(0|a)){n=0;break}A=n,s=a,g=145;break t}if((t=c-n+(t=0|i[5977])&0-t)>>>0>=2147483647){A=n,s=a,g=145;break t}if(-1==(0|Ye(0|t))){Ye(0|r),n=0;break}A=t+n|0,s=a,g=145;break t}}while(0);i[5968]=4|i[5968],g=143}}while(0);if(143==(0|g)&&u>>>0<2147483647&&!(-1==(0|(y=0|Ye(0|u)))|1^(_=(v=(m=0|Ye(0))-y|0)>>>0>(f+40|0)>>>0)|y>>>0<m>>>0&-1!=(0|y)&-1!=(0|m)^1)&&(A=_?v:n,s=y,g=145),145==(0|g)){n=(0|i[5965])+A|0,i[5965]=n,n>>>0>(0|i[5966])>>>0&&(i[5966]=n),c=0|i[5863];t:do{if(c){for(n=23876;;){if((0|s)==((t=0|i[n>>2])+(r=0|i[n+4>>2])|0)){g=154;break}if(!(a=0|i[n+8>>2]))break;n=a}if(!(154!=(0|g)||(x=n+4|0,8&i[n+12>>2]))&&s>>>0>c>>>0&t>>>0<=c>>>0){i[x>>2]=r+A,x=c+(y=7&(y=c+8|0)?0-y&7:0)|0,y=(b=(0|i[5860])+A|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[c+b+4>>2]=40,i[5864]=i[5979];break}for(s>>>0<(0|i[5861])>>>0&&(i[5861]=s),r=s+A|0,n=23876;;){if((0|i[n>>2])==(0|r)){g=162;break}if(!(t=0|i[n+8>>2]))break;n=t}if(162==(0|g)&&!(8&i[n+12>>2])){i[n>>2]=s,i[(h=n+4|0)>>2]=(0|i[h>>2])+A,u=(h=s+(7&(h=s+8|0)?0-h&7:0)|0)+f|0,l=(n=r+(7&(n=r+8|0)?0-n&7:0)|0)-h-f|0,i[h+4>>2]=3|f;e:do{if((0|c)==(0|n))b=(0|i[5860])+l|0,i[5860]=b,i[5863]=u,i[u+4>>2]=1|b;else{if((0|i[5862])==(0|n)){b=(0|i[5859])+l|0,i[5859]=b,i[5862]=u,i[u+4>>2]=1|b,i[u+b>>2]=b;break}if(1==(3&(t=0|i[n+4>>2]))){A=-8&t,a=t>>>3;n:do{if(t>>>0<256){if(t=0|i[n+8>>2],(0|(r=0|i[n+12>>2]))==(0|t)){i[5857]=i[5857]&~(1<<a);break}i[t+12>>2]=r,i[r+8>>2]=t;break}s=0|i[n+24>>2],t=0|i[n+12>>2];do{if((0|t)==(0|n)){if(t=0|i[(a=(r=n+16|0)+4|0)>>2])r=a;else if(!(t=0|i[r>>2])){t=0;break}for(;;)if(a=0|i[(o=t+20|0)>>2])t=a,r=o;else{if(!(a=0|i[(o=t+16|0)>>2]))break;t=a,r=o}i[r>>2]=0}else b=0|i[n+8>>2],i[b+12>>2]=t,i[t+8>>2]=b}while(0);if(!s)break;a=23732+((r=0|i[n+28>>2])<<2)|0;do{if((0|i[a>>2])==(0|n)){if(i[a>>2]=t,0|t)break;i[5858]=i[5858]&~(1<<r);break n}if(i[((0|i[(b=s+16|0)>>2])==(0|n)?b:s+20)>>2]=t,!t)break n}while(0);if(i[t+24>>2]=s,0|(a=0|i[(r=n+16|0)>>2])&&(i[t+16>>2]=a,i[a+24>>2]=t),!(r=0|i[r+4>>2]))break;i[t+20>>2]=r,i[r+24>>2]=t}while(0);n=n+A|0,o=A+l|0}else o=l;if(i[(n=n+4|0)>>2]=-2&i[n>>2],i[u+4>>2]=1|o,i[u+o>>2]=o,n=o>>>3,o>>>0<256){r=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=u,i[n+12>>2]=u,i[u+8>>2]=n,i[u+12>>2]=r;break}n=o>>>8;do{if(n){if(o>>>0>16777215){a=31;break}a=o>>>((a=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(a=((b<<=y)+245760|0)>>>16&2))+(b<<a>>>15)|0)+7|0)&1|a<<1}else a=0}while(0);if(n=23732+(a<<2)|0,i[u+28>>2]=a,i[(t=u+16|0)+4>>2]=0,i[t>>2]=0,!((t=0|i[5858])&(r=1<<a))){i[5858]=t|r,i[n>>2]=u,i[u+24>>2]=n,i[u+12>>2]=u,i[u+8>>2]=u;break}n=0|i[n>>2];n:do{if((-8&i[n+4>>2])!=(0|o)){for(a=o<<(31==(0|a)?0:25-(a>>>1));t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|o)){n=t;break n}a<<=1,n=t}i[r>>2]=u,i[u+24>>2]=n,i[u+12>>2]=u,i[u+8>>2]=u;break e}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=u,i[x>>2]=u,i[u+8>>2]=b,i[u+12>>2]=n,i[u+24>>2]=0}}while(0);return D=e,0|(b=h+8|0)}for(n=23876;!((t=0|i[n>>2])>>>0<=c>>>0&&(b=t+(0|i[n+4>>2])|0)>>>0>c>>>0);)n=0|i[n+8>>2];n=(t=(t=(o=b+-47|0)+(7&(t=o+8|0)?0-t&7:0)|0)>>>0<(o=c+16|0)>>>0?c:t)+8|0,x=s+(y=7&(y=s+8|0)?0-y&7:0)|0,y=(r=A+-40|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[s+r+4>>2]=40,i[5864]=i[5979],i[(r=t+4|0)>>2]=27,i[n>>2]=i[5969],i[n+4>>2]=i[5970],i[n+8>>2]=i[5971],i[n+12>>2]=i[5972],i[5969]=s,i[5970]=A,i[5972]=0,i[5971]=n,n=t+24|0;do{x=n,i[(n=n+4|0)>>2]=7}while((x+8|0)>>>0<b>>>0);if((0|t)!=(0|c)){if(s=t-c|0,i[r>>2]=-2&i[r>>2],i[c+4>>2]=1|s,i[t>>2]=s,n=s>>>3,s>>>0<256){r=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=c,i[n+12>>2]=c,i[c+8>>2]=n,i[c+12>>2]=r;break}if(r=23732+((a=(n=s>>>8)?s>>>0>16777215?31:s>>>((a=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(a=((b<<=y)+245760|0)>>>16&2))+(b<<a>>>15)|0)+7|0)&1|a<<1:0)<<2)|0,i[c+28>>2]=a,i[c+20>>2]=0,i[o>>2]=0,!((n=0|i[5858])&(t=1<<a))){i[5858]=n|t,i[r>>2]=c,i[c+24>>2]=r,i[c+12>>2]=c,i[c+8>>2]=c;break}n=0|i[r>>2];e:do{if((-8&i[n+4>>2])!=(0|s)){for(a=s<<(31==(0|a)?0:25-(a>>>1));t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|s)){n=t;break e}a<<=1,n=t}i[r>>2]=c,i[c+24>>2]=n,i[c+12>>2]=c,i[c+8>>2]=c;break t}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=c,i[x>>2]=c,i[c+8>>2]=b,i[c+12>>2]=n,i[c+24>>2]=0}}else!(0|(b=0|i[5861]))|s>>>0<b>>>0&&(i[5861]=s),i[5969]=s,i[5970]=A,i[5972]=0,i[5866]=i[5975],i[5865]=-1,i[5870]=23468,i[5869]=23468,i[5872]=23476,i[5871]=23476,i[5874]=23484,i[5873]=23484,i[5876]=23492,i[5875]=23492,i[5878]=23500,i[5877]=23500,i[5880]=23508,i[5879]=23508,i[5882]=23516,i[5881]=23516,i[5884]=23524,i[5883]=23524,i[5886]=23532,i[5885]=23532,i[5888]=23540,i[5887]=23540,i[5890]=23548,i[5889]=23548,i[5892]=23556,i[5891]=23556,i[5894]=23564,i[5893]=23564,i[5896]=23572,i[5895]=23572,i[5898]=23580,i[5897]=23580,i[5900]=23588,i[5899]=23588,i[5902]=23596,i[5901]=23596,i[5904]=23604,i[5903]=23604,i[5906]=23612,i[5905]=23612,i[5908]=23620,i[5907]=23620,i[5910]=23628,i[5909]=23628,i[5912]=23636,i[5911]=23636,i[5914]=23644,i[5913]=23644,i[5916]=23652,i[5915]=23652,i[5918]=23660,i[5917]=23660,i[5920]=23668,i[5919]=23668,i[5922]=23676,i[5921]=23676,i[5924]=23684,i[5923]=23684,i[5926]=23692,i[5925]=23692,i[5928]=23700,i[5927]=23700,i[5930]=23708,i[5929]=23708,i[5932]=23716,i[5931]=23716,x=s+(y=7&(y=s+8|0)?0-y&7:0)|0,y=(b=A+-40|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[s+b+4>>2]=40,i[5864]=i[5979]}while(0);if((n=0|i[5860])>>>0>f>>>0)return y=n-f|0,i[5860]=y,x=(b=0|i[5863])+f|0,i[5863]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|f,D=e,0|(b=b+8|0)}return i[(b=23424)>>2]=12,D=e,0|(b=0)}function Pe(t){var e=0,n=0,r=0,a=0,o=0,s=0,A=0,l=0;if(t|=0){n=t+-8|0,a=0|i[5861],l=n+(e=-8&(t=0|i[t+-4>>2]))|0;do{if(1&t)A=n,s=n;else{if(r=0|i[n>>2],!(3&t))return;if(o=r+e|0,(s=n+(0-r)|0)>>>0<a>>>0)return;if((0|i[5862])==(0|s)){if(3&~(e=0|i[(t=l+4|0)>>2])){A=s,e=o;break}return i[5859]=o,i[t>>2]=-2&e,i[s+4>>2]=1|o,void(i[s+o>>2]=o)}if(n=r>>>3,r>>>0<256){if(t=0|i[s+8>>2],(0|(e=0|i[s+12>>2]))==(0|t)){i[5857]=i[5857]&~(1<<n),A=s,e=o;break}i[t+12>>2]=e,i[e+8>>2]=t,A=s,e=o;break}a=0|i[s+24>>2],t=0|i[s+12>>2];do{if((0|t)==(0|s)){if(t=0|i[(n=(e=s+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){t=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0}else A=0|i[s+8>>2],i[A+12>>2]=t,i[t+8>>2]=A}while(0);if(a){if(e=0|i[s+28>>2],(0|i[(n=23732+(e<<2)|0)>>2])==(0|s)){if(i[n>>2]=t,!t){i[5858]=i[5858]&~(1<<e),A=s,e=o;break}}else if(i[((0|i[(A=a+16|0)>>2])==(0|s)?A:a+20)>>2]=t,!t){A=s,e=o;break}i[t+24>>2]=a,0|(n=0|i[(e=s+16|0)>>2])&&(i[t+16>>2]=n,i[n+24>>2]=t),(e=0|i[e+4>>2])?(i[t+20>>2]=e,i[e+24>>2]=t,A=s,e=o):(A=s,e=o)}else A=s,e=o}}while(0);if(!(s>>>0>=l>>>0)&&1&(r=0|i[(t=l+4|0)>>2])){if(2&r)i[t>>2]=-2&r,i[A+4>>2]=1|e,i[s+e>>2]=e,a=e;else{if((0|i[5863])==(0|l)){if(l=(0|i[5860])+e|0,i[5860]=l,i[5863]=A,i[A+4>>2]=1|l,(0|A)!=(0|i[5862]))return;return i[5862]=0,void(i[5859]=0)}if((0|i[5862])==(0|l))return l=(0|i[5859])+e|0,i[5859]=l,i[5862]=s,i[A+4>>2]=1|l,void(i[s+l>>2]=l);a=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|i[l+8>>2],(0|(t=0|i[l+12>>2]))==(0|e)){i[5857]=i[5857]&~(1<<n);break}i[e+12>>2]=t,i[t+8>>2]=e;break}o=0|i[l+24>>2],t=0|i[l+12>>2];do{if((0|t)==(0|l)){if(t=0|i[(n=(e=l+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){n=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0,n=t}else n=0|i[l+8>>2],i[n+12>>2]=t,i[t+8>>2]=n,n=t}while(0);if(0|o){if(t=0|i[l+28>>2],(0|i[(e=23732+(t<<2)|0)>>2])==(0|l)){if(i[e>>2]=n,!n){i[5858]=i[5858]&~(1<<t);break}}else if(i[((0|i[(r=o+16|0)>>2])==(0|l)?r:o+20)>>2]=n,!n)break;i[n+24>>2]=o,0|(e=0|i[(t=l+16|0)>>2])&&(i[n+16>>2]=e,i[e+24>>2]=n),0|(t=0|i[t+4>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);if(i[A+4>>2]=1|a,i[s+a>>2]=a,(0|A)==(0|i[5862]))return void(i[5859]=a)}if(t=a>>>3,a>>>0<256)return n=23468+(t<<1<<2)|0,(e=0|i[5857])&(t=1<<t)?t=0|i[(e=n+8|0)>>2]:(i[5857]=e|t,t=n,e=n+8|0),i[e>>2]=A,i[t+12>>2]=A,i[A+8>>2]=t,void(i[A+12>>2]=n);t=23732+((r=(t=a>>>8)?a>>>0>16777215?31:a>>>((r=14-((o=((l=t<<(s=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(r=((l<<=o)+245760|0)>>>16&2))+(l<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[A+28>>2]=r,i[A+20>>2]=0,i[A+16>>2]=0,e=0|i[5858],n=1<<r;t:do{if(e&n){t=0|i[t>>2];e:do{if((-8&i[t+4>>2])!=(0|a)){for(r=a<<(31==(0|r)?0:25-(r>>>1));e=0|i[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&i[e+4>>2])==(0|a)){t=e;break e}r<<=1,t=e}i[n>>2]=A,i[A+24>>2]=t,i[A+12>>2]=A,i[A+8>>2]=A;break t}}while(0);l=0|i[(s=t+8|0)>>2],i[l+12>>2]=A,i[s>>2]=A,i[A+8>>2]=l,i[A+12>>2]=t,i[A+24>>2]=0}else i[5858]=e|n,i[t>>2]=A,i[A+24>>2]=t,i[A+12>>2]=A,i[A+8>>2]=A}while(0);if(l=(0|i[5865])-1|0,i[5865]=l,!(0|l)){for(t=23884;t=0|i[t>>2];)t=t+8|0;i[5865]=-1}}}}function Le(t,e){e|=0;var n=0;return(t|=0)?(n=0|y(e,t),(e|t)>>>0>65535&&(n=((n>>>0)/(t>>>0)|0)==(0|e)?n:-1)):n=0,(t=0|Re(n))&&3&i[t+-4>>2]?(Xe(0|t,0,0|n),0|t):0|t}function De(t,e,n,r){return 0|(w((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),n)}function Oe(t,e,n,r){return 0|(w(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0)}function Ie(t){return 0|((t|=0)?31-(0|M(t^t-1)):32)}function qe(t,e,n,r,a){a|=0;var o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0;if(u=t|=0,s=n|=0,A=f=r|=0,!(c=l=e|=0))return o=!!(0|a),A?o?(i[a>>2]=0|t,i[a+4>>2]=0,a=0,0|(w(0|(f=0)),a)):(a=0,0|(w(0|(f=0)),a)):(o&&(i[a>>2]=(u>>>0)%(s>>>0),i[a+4>>2]=0),a=(u>>>0)/(s>>>0)>>>0,0|(w(0|(f=0)),a));o=!(0|A);do{if(s){if(!o){if((o=(0|M(0|A))-(0|M(0|c))|0)>>>0<=31){s=h=o+1|0,t=u>>>(h>>>0)&(e=o-31>>31)|c<<(A=31-o|0),e&=c>>>(h>>>0),o=0,A=u<<A;break}return a?(i[a>>2]=0|t,i[a+4>>2]=0|l,a=0,0|(w(0|(f=0)),a)):(a=0,0|(w(0|(f=0)),a))}if((o=s-1|0)&s){s=A=33+(0|M(0|s))-(0|M(0|c))|0,t=(h=32-A|0)-1>>31&c>>>((d=A-32|0)>>>0)|(c<<h|u>>>(A>>>0))&(e=d>>31),e&=c>>>(A>>>0),o=u<<(p=64-A|0)&(l=h>>31),A=(c<<p|u>>>(d>>>0))&l|u<<h&A-33>>31;break}return 0|a&&(i[a>>2]=o&u,i[a+4>>2]=0),1==(0|s)?(p=0|t,0|(w(0|(d=0|l)),p)):(d=c>>>((p=0|Ie(0|s))>>>0)|0,p=c<<32-p|u>>>(p>>>0),0|(w(0|d),p))}if(o)return 0|a&&(i[a>>2]=(c>>>0)%(s>>>0),i[a+4>>2]=0),p=(c>>>0)/(s>>>0)>>>0,0|(w(0|(d=0)),p);if(!u)return 0|a&&(i[a>>2]=0,i[a+4>>2]=(c>>>0)%(A>>>0)),p=(c>>>0)/(A>>>0)>>>0,0|(w(0|(d=0)),p);if(!((o=A-1|0)&A))return 0|a&&(i[a>>2]=0|t,i[a+4>>2]=o&c),d=0,p=c>>>((0|Ie(0|A))>>>0),0|(w(0|d),p);if((o=(0|M(0|A))-(0|M(0|c))|0)>>>0<=30){s=e=o+1|0,t=c<<(A=31-o|0)|u>>>(e>>>0),e=c>>>(e>>>0),o=0,A=u<<A;break}return a?(i[a>>2]=0|t,i[a+4>>2]=0|l,p=0,0|(w(0|(d=0)),p)):(p=0,0|(w(0|(d=0)),p))}while(0);if(s){c=0|De(0|(h=0|n),0|(u=0|f),-1,-1),n=0|E(),l=A,A=0;do{r=l,l=o>>>31|l<<1,o=A|o<<1,Oe(0|c,0|n,0|(r=t<<1|r>>>31),0|(f=t>>>31|e<<1)),A=1&(d=(p=0|E())>>31|((0|p)<0?-1:0)<<1),t=0|Oe(0|r,0|f,d&h,(((0|p)<0?-1:0)>>31|((0|p)<0?-1:0)<<1)&u),e=0|E(),s=s-1|0}while(0|s);c=l,l=0}else c=A,l=0,A=0;return s=0,0|a&&(i[a>>2]=t,i[a+4>>2]=e),p=o<<1&-2|A,0|(w(0|(d=(0|o)>>>31|(c|s)<<1|l)),p)}function Ue(t,e,n,r){n|=0;var i,a,o,s,A;return a=(r|=0)>>31|((0|r)<0?-1:0)<<1,i=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,o=0|Oe((A=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(s=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|A,0|s),t=a^A,e=i^s,0|Oe(qe(o,0|E(),0|Oe(a^n,i^r,0|a,0|i),0|E(),0)^t,E()^e,0|t,0|e)}function Ne(t,e,n,r){e|=0,r|=0;var i,a;return n=0|function(t,e){var n,r,i,a=0;return t=((n=0|y(a=65535&(e|=0),i=65535&(t|=0)))>>>16)+(0|y(a,r=t>>>16))|0,e=0|y(a=e>>>16,i),0|(w((t>>>16)+(0|y(a,r))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n)}(i=t|=0,a=n|=0),t=0|E(),0|(w((0|y(e,a))+(0|y(r,i))+t|0),n)}function Be(t,e,n,r){n|=0;var a,o,s,A,l,c;return a=D,D=D+16|0,A=0|a,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,l=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,qe(t=0|Oe((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0),(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e,0|s,0|o),e=0|E(),0|Oe(c^n,l^r,0|c,0|l),0|E(),A),r=0|Oe(i[A>>2]^s,i[A+4>>2]^o,0|s,0|o),n=0|E(),D=a,0|(w(0|n),r)}function ke(t,e,n,r){var a,o;return o=D,D=D+16|0,qe(t|=0,e|=0,n|=0,r|=0,a=0|o),D=o,0|(w(0|i[a+4>>2]),i[a>>2])}function Fe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e>>n),t>>>n|(e&(1<<n)-1)<<32-n):(w(0|((0|e)<0?-1:0)),e>>n-32)}function ze(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(w(0),e>>>n-32|0)}function Ge(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e<<n|(t&(1<<n)-1<<32-n)>>>32-n),t<<n):(w(t<<n-32),0)}function He(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+b(+t,+e)}function je(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+x(+t,+e)}function Ve(t){return(t=+t)>=0?+A(t+.5):+_(t-.5)}function We(t,e,n){t|=0,e|=0;var a,o,s=0;if((0|(n|=0))>=8192)return R(0|t,0|e,0|n),0|t;if(o=0|t,a=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|o;r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0,n=n-1|0}for(s=(n=-4&a)-64|0;(0|t)<=(0|s);)i[t>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2],i[t+16>>2]=i[e+16>>2],i[t+20>>2]=i[e+20>>2],i[t+24>>2]=i[e+24>>2],i[t+28>>2]=i[e+28>>2],i[t+32>>2]=i[e+32>>2],i[t+36>>2]=i[e+36>>2],i[t+40>>2]=i[e+40>>2],i[t+44>>2]=i[e+44>>2],i[t+48>>2]=i[e+48>>2],i[t+52>>2]=i[e+52>>2],i[t+56>>2]=i[e+56>>2],i[t+60>>2]=i[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)i[t>>2]=i[e>>2],t=t+4|0,e=e+4|0}else for(n=a-4|0;(0|t)<(0|n);)r[t|0]=0|r[e|0],r[t+1|0]=0|r[e+1|0],r[t+2|0]=0|r[e+2|0],r[t+3|0]=0|r[e+3|0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|a);)r[t|0]=0|r[e|0],t=t+1|0,e=e+1|0;return 0|o}function Xe(t,e,n){e|=0;var a,o=0,s=0,A=0;if(a=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)r[t|0]=e,t=t+1|0;for(A=e|e<<8|e<<16|e<<24,s=(o=-4&a)-64|0;(0|t)<=(0|s);)i[t>>2]=A,i[t+4>>2]=A,i[t+8>>2]=A,i[t+12>>2]=A,i[t+16>>2]=A,i[t+20>>2]=A,i[t+24>>2]=A,i[t+28>>2]=A,i[t+32>>2]=A,i[t+36>>2]=A,i[t+40>>2]=A,i[t+44>>2]=A,i[t+48>>2]=A,i[t+52>>2]=A,i[t+56>>2]=A,i[t+60>>2]=A,t=t+64|0;for(;(0|t)<(0|o);)i[t>>2]=A,t=t+4|0}for(;(0|t)<(0|a);)r[t|0]=e,t=t+1|0;return a-n|0}function Qe(t){return(t=+t)>=0?+A(t+.5):+_(t-.5)}function Ye(t){t|=0;var e,n,r;return r=0|C(),(0|t)>0&(0|(e=(n=0|i[s>>2])+t|0))<(0|n)|(0|e)<0?(L(0|e),T(12),-1):(0|e)>(0|r)&&!(0|P(0|e))?(T(12),-1):(i[s>>2]=e,0|n)}return{___divdi3:Ue,___muldi3:Ne,___remdi3:Be,___uremdi3:ke,_areNeighborCells:function(t,e,n,r,a){a|=0;var o,s,A,l=0,c=0,u=0,h=0;if(A=D,D=D+64|0,s=A,o=A+56|0,!(!0&134217728==(2013265920&(e|=0))&!0&134217728==(2013265920&(r|=0))))return D=A,0|(a=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|r))return i[a>>2]=0,D=A,0|(a=0);if(c=0|ze(0|t,0|e,52),E(),c&=15,h=0|ze(0|n,0|r,52),E(),(0|c)!=(15&h))return D=A,0|(a=12);if(l=c+-1|0,c>>>0>1){qt(t,e,l,s),qt(n,r,l,o),u=0|i[(h=s)>>2],h=0|i[h+4>>2];t:do{if((0|u)==(0|i[o>>2])&&(0|h)==(0|i[o+4>>2])){l=0|ze(0|t,0|e,0|(c=3*(15^c)|0)),E(),l&=7,c=0|ze(0|n,0|r,0|c),E(),c&=7;do{if(!(0|l)|!(0|c))i[a>>2]=1,l=0;else if(7==(0|l))l=5;else{if(1==(0|l)|1==(0|c)&&0|Nt(u,h)){l=5;break}if((0|i[15536+(l<<2)>>2])!=(0|c)&&(0|i[15568+(l<<2)>>2])!=(0|c))break t;i[a>>2]=1,l=0}}while(0);return D=A,0|(a=l)}}while(0)}c=(l=s)+56|0;do{i[l>>2]=0,l=l+4|0}while((0|l)<(0|c));return O(t,e,1,s),l=(0|i[(e=s)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+8|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+16|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+24|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+32|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+40|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)?1:1&((0|i[(l=s+48|0)>>2])==(0|n)?(0|i[l+4>>2])==(0|r):0),i[a>>2]=l,D=A,0|(a=0)},_bitshift64Ashr:Fe,_bitshift64Lshr:ze,_bitshift64Shl:Ge,_calloc:Le,_cellAreaKm2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(a[n>>3]=6371.007180918475*+a[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(a[n>>3]=6371.007180918475*+a[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:re,_cellToBoundary:Qt,_cellToCenterChild:function(t,e,n,r){n|=0,r|=0;var a=0;return a=0|ze(0|(t|=0),0|(e|=0),52),E(),(0|n)<16&(0|(a&=15))<=(0|n)?((0|a)<(0|n)&&(a=0|Ge(-1,-1,3+(3*(n+-1-a|0)|0)|0),a=0|Ge(0|~a,0|~E(),3*(15-n|0)|0),e=~E()&e,t&=~a),a=0|Ge(0|n,0,52),n=-15728641&e|E(),i[r>>2]=t|a,i[r+4>>2]=n,0|(r=0)):0|(r=4)},_cellToChildPos:function(t,e,n,r){n|=0,r|=0;var a,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0;if(a=D,D=D+16|0,v=a,_=0|ze(0|(t|=0),0|(e|=0),52),E(),_&=15,n>>>0>15)return D=a,0|(_=4);if((0|_)<(0|n))return D=a,0|(_=12);if((0|_)!=(0|n))if(s=0|Ge(0|n,0,52),s|=t,l=E()|-15728641&e,(0|_)>(0|n)){c=n;do{g=0|Ge(7,0,3*(14-c|0)|0),c=c+1|0,s|=g,l=E()|l}while((0|c)<(0|_));g=s}else g=s;else g=t,l=e;m=0|ze(0|g,0|l,45),E();t:do{if(0|F(127&m)){if(c=0|ze(0|g,0|l,52),E(),0|(c&=15))for(s=1;;){if(!(!((m=0|Ge(7,0,3*(15-s|0)|0))&g)&!(E()&l))){u=33;break t}if(!(s>>>0<c>>>0))break;s=s+1|0}if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|_)>(0|n)){for(m=-15728641&e,p=_;;){if(d=p,(p=p+-1|0)>>>0>15|(0|_)<(0|p)){u=19;break}if((0|_)!=(0|p))if(s=0|Ge(0|p,0,52),s|=t,c=E()|m,(0|_)<(0|d))f=s;else{u=p;do{f=0|Ge(7,0,3*(14-u|0)|0),u=u+1|0,s|=f,c=E()|c}while((0|u)<(0|_));f=s}else f=t,c=e;if(h=0|ze(0|f,0|c,45),E(),0|F(127&h)){h=0|ze(0|f,0|c,52),E(),h&=15;e:do{if(h)for(u=1;;){if(s=0|ze(0|f,0|c,3*(15-u|0)|0),E(),0|(s&=7))break e;if(!(u>>>0<h>>>0)){s=0;break}u=u+1|0}else s=0}while(0);s=1&!(0|s)}else s=0;if(c=0|ze(0|t,0|e,3*(15-d|0)|0),E(),7==(0|(c&=7))){o=5,u=42;break}if(1==(0|c)&(s=!!(0|s))){o=5,u=42;break}if(0|(f=c+((!!(0|c)&s)<<31>>31)|0)&&(u=0|ue(7,0,u=_-d|0,((0|u)<0)<<31>>31),h=0|E(),s?(s=0|De(0|(s=0|Ne(0|u,0|h,5,0)),0|E(),-5,-1),s=0|De(0|(s=0|Ue(0|s,0|E(),6,0)),0|E(),1,0),c=0|E()):(s=u,c=h),d=0|De(0|s,0|c,0|(d=0|Ne(0|u,0|h,0|(d=f+-1|0),((0|d)<0)<<31>>31)),0|E()),h=0|De(0|d,0|(f=0|E()),0|i[(h=r)>>2],0|i[h+4>>2]),f=0|E(),i[(d=r)>>2]=h,i[d+4>>2]=f),(0|p)<=(0|n)){u=37;break}}if(19==(0|u))S(23313,22674,1099,22710);else{if(37==(0|u)){o=0|i[(A=r)+4>>2],A=0|i[A>>2];break}if(42==(0|u))return D=a,0|o}}else o=0,A=0}else u=33}while(0);t:do{if(33==(0|u)){if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|_)>(0|n)){for(s=_;;){if(o=0|ze(0|t,0|e,3*(15-s|0)|0),E(),7==(0|(o&=7))){o=5;break}if(o=0|Ne(0|(A=0|ue(7,0,A=_-s|0,((0|A)<0)<<31>>31)),0|E(),0|o,0),A=0|E(),A=0|De(0|i[(m=r)>>2],0|i[m+4>>2],0|o,0|A),o=0|E(),i[(m=r)>>2]=A,i[m+4>>2]=o,(0|(s=s+-1|0))<=(0|n))break t}return D=a,0|o}o=0,A=0}}while(0);return 0|Ut(g,l,_,v)&&S(23313,22674,1063,22725),((0|o)>-1|-1==(0|o)&A>>>0>4294967295)&((0|(v=0|i[(_=v)+4>>2]))>(0|o)|((0|v)==(0|o)?(0|i[_>>2])>>>0>A>>>0:0))?(D=a,0|(_=0)):(S(23313,22674,1139,22710),0)},_cellToChildren:function(t,e,n,r){r|=0;var a,o,s=0,A=0;if(o=D,D=D+16|0,Zt(a=o,t|=0,e|=0,n|=0),!(0|(t=0|i[(e=a)>>2]))&!(0|(e=0|i[e+4>>2])))return D=o,0;s=0,n=0;do{i[(A=r+(s<<3)|0)>>2]=t,i[A+4>>2]=e,s=0|De(0|s,0|n,1,0),n=0|E(),Kt(a),t=0|i[(A=a)>>2],e=0|i[A+4>>2]}while(!(!(0|t)&!(0|e)));return D=o,0},_cellToChildrenSize:Ut,_cellToLatLng:Xt,_cellToLocalIj:function(t,e,n,r,i,a){var o,s;return t|=0,e|=0,n|=0,r|=0,a|=0,s=D,D=D+16|0,o=s,(i|=0)?t=15:(t=0|le(t,e,n,r,o))||(_t(o,a),t=0),D=s,0|t},_cellToParent:qt,_cellToVertex:ye,_cellToVertexes:function(t,e,n){n|=0;var r,a=0,o=0;return o=!(0|Nt(t|=0,e|=0)),r=!(0|(a=0|ye(t,e,0,n))),o?r?0|(a=0|ye(t,e,1,n+8|0))||0|(a=0|ye(t,e,2,n+16|0))||0|(a=0|ye(t,e,3,n+24|0))||(a=0|ye(t,e,4,n+32|0))?0|(o=a):0|ye(t,e,5,n+40|0):0|(o=a):r?0|(a=0|ye(t,e,1,n+8|0))||0|(a=0|ye(t,e,2,n+16|0))||0|(a=0|ye(t,e,3,n+24|0))||0|(a=0|ye(t,e,4,n+32|0))?0|(o=a):(i[(o=n+40|0)>>2]=0,i[o+4>>2]=0,0|(o=0)):0|(o=a)},_cellsToDirectedEdge:function(t,e,n,r,a){return a|=0,7==(0|(n=0|B(t|=0,e|=0,n|=0,r|=0)))?0|(a=11):(r=0|Ge(0|n,0,56),e=-2130706433&e|E()|268435456,i[a>>2]=t|r,i[a+4>>2]=e,0|(a=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var r,a,o,s=0;if(o=D,D=D+32|0,r=o,t=0|function(t,e,n){t|=0,n|=0;var r,a,o=0,s=0,A=0,l=0,c=0,u=0;if(a=D,D=D+176|0,r=a,(0|(e|=0))<1)return xe(n,0,0),D=a,0;for(c=0|ze(0|i[(c=t)>>2],0|i[c+4>>2],52),E(),xe(n,(0|e)>6?e:6,15&c),c=0;!(0|(o=0|Qt(0|i[(o=t+(c<<3)|0)>>2],0|i[o+4>>2],r)));){if((0|(o=0|i[r>>2]))>0){l=0;do{A=r+8+(l<<4)|0,(s=0|Se(n,o=r+8+((0|(l=l+1|0))%(0|o)<<4)|0,A))?we(n,s):Ee(n,A,o),o=0|i[r>>2]}while((0|l)<(0|o))}if((0|(c=c+1|0))>=(0|e)){o=0,u=13;break}}return 13==(0|u)?(D=a,0|o):(be(n),D=a,0|(u=o))}(t|=0,e|=0,a=o+16|0),0|t)return D=o,0|(n=t);if(i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,0|(t=0|Me(a)))do{e=0|ie(n);do{ae(e,t),s=t+16|0,i[r>>2]=i[s>>2],i[r+4>>2]=i[s+4>>2],i[r+8>>2]=i[s+8>>2],i[r+12>>2]=i[s+12>>2],we(a,t),t=0|Te(a,r)}while(0|t);t=0|Me(a)}while(0|t);return be(a),(t=0|se(n))?(oe(n),D=o,0|(s=t)):(D=o,0|(s=0))},_childPosToCell:function(t,e,n,r,a,o){t|=0,e|=0,o|=0;var s,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0;if(s=D,D=D+16|0,A=s,(a|=0)>>>0>15)return D=s,0|(o=4);if(l=0|ze(0|(n|=0),0|(r|=0),52),E(),(0|(l&=15))>(0|a))return D=s,0|(o=12);if(0|Ut(n,r,a,A)&&S(23313,22674,1063,22725),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(u=0|i[(h=A)+4>>2]))>(0|e)|((0|u)==(0|e)?(0|i[h>>2])>>>0>t>>>0:0))))return D=s,0|(o=2);h=a-l|0,a=0|Ge(0|a,0,52),c=E()|-15728641&r,i[(u=o)>>2]=a|n,i[u+4>>2]=c,u=0|ze(0|n,0|r,45),E();t:do{if(0|F(127&u)){if(0|l)for(A=1;;){if(!(!((u=0|Ge(7,0,3*(15-A|0)|0))&n)&!(E()&r)))break t;if(!(A>>>0<l>>>0))break;A=A+1|0}if((0|h)<1)return D=s,0|(o=0);for(u=15^l,r=-1,c=1,A=1;;){l=0|ue(7,0,l=h-c|0,((0|l)<0)<<31>>31),n=0|E();do{if(A){if(A=0|Ue(0|(A=0|De(0|(A=0|Ne(0|l,0|n,5,0)),0|E(),-5,-1)),0|E(),6,0),(0|e)>(0|(a=0|E()))|(0|e)==(0|a)&t>>>0>A>>>0){e=0|Oe(0|(e=0|De(0|t,0|e,-1,-1)),0|E(),0|A,0|a),A=0|E(),p=0|i[(f=o)>>2],f=0|i[f+4>>2],d=0|Ge(7,0,0|(m=3*(u+r|0)|0)),f&=~E(),m=0|Ge(0|(a=0|De(0|(r=0|Ue(0|e,0|A,0|l,0|n)),0|(t=0|E()),2,0)),0|E(),0|m),f=E()|f,i[(a=o)>>2]=m|p&~d,i[a+4>>2]=f,t=0|Oe(0|e,0|A,0|(t=0|Ne(0|r,0|t,0|l,0|n)),0|E()),A=0,e=0|E();break}d=0|i[(m=o)>>2],m=0|i[m+4>>2],p=0|Ge(7,0,3*(u+r|0)|0),m&=~E(),i[(A=o)>>2]=d&~p,i[A+4>>2]=m,A=1;break}a=0|i[(d=o)>>2],d=0|i[d+4>>2],f=0|Ge(7,0,0|(r=3*(u+r|0)|0)),d&=~E(),r=0|Ge(0|(m=0|Ue(0|t,0|e,0|l,0|n)),0|(A=0|E()),0|r),d=E()|d,i[(p=o)>>2]=r|a&~f,i[p+4>>2]=d,t=0|Oe(0|t,0|e,0|(A=0|Ne(0|m,0|A,0|l,0|n)),0|E()),A=0,e=0|E()}while(0);if(!((0|h)>(0|c))){e=0;break}r=~c,c=c+1|0}return D=s,0|e}}while(0);if((0|h)<1)return D=s,0|(m=0);for(a=15^l,A=1;;){if(p=0|ue(7,0,p=h-A|0,((0|p)<0)<<31>>31),m=0|E(),n=0|i[(c=o)>>2],c=0|i[c+4>>2],r=0|Ge(7,0,0|(l=3*(a-A|0)|0)),c&=~E(),l=0|Ge(0|(f=0|Ue(0|t,0|e,0|p,0|m)),0|(d=0|E()),0|l),c=E()|c,i[(u=o)>>2]=l|n&~r,i[u+4>>2]=c,t=0|Oe(0|t,0|e,0|(m=0|Ne(0|f,0|d,0|p,0|m)),0|E()),e=0|E(),(0|h)<=(0|A)){e=0;break}A=A+1|0}return D=s,0|e},_compactCells:function(t,e,n,r){e|=0;var a,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,T=0;if(!(0|(n|=0))&!(0|(r|=0)))return 0|(w=0);if(s=0|i[(o=t|=0)>>2],!0&!(15728640&(o=0|i[o+4>>2]))){if(!((0|r)>0|!(0|r)&n>>>0>0))return 0|(w=0);if(i[(w=e)>>2]=s,i[w+4>>2]=o,1==(0|n)&!(0|r))return 0|(w=0);o=1;do{M=0|i[(b=t+(o<<3)|0)+4>>2],i[(w=e+(o<<3)|0)>>2]=i[b>>2],i[w+4>>2]=M,o=o+1|0}while(0<(0|r)|!(0|r)&o>>>0<n>>>0);return 0|(o=0)}if(!(M=0|Re(a=n<<3)))return 0|(w=13);if(We(0|M,0|t,0|a),!(b=0|Le(n,8)))return Pe(M),0|(w=13);t:do{if(0|n){e:for(;;){y=0|ze(0|(_=0|i[(o=M)>>2]),0|(o=0|i[o+4>>2]),52),E(),x=(y&=15)+-1|0,v=(0|n)>0;n:do{if(!!(0|y)&v){if(p=((0|n)<0)<<31>>31,m=0|Ge(0|x,0,52),g=0|E(),x>>>0>15){if(!(!(0|_)&!(0|o))){w=17;break e}for(s=0;;){if((0|(s=s+1|0))>=(0|n))break n;if(!(!(0|(g=0|i[(r=M+(s<<3)|0)>>2]))&!(0|(r=0|i[r+4>>2])))){o=r,w=17;break e}}}for(s=0,t=_,r=o;;){if(!(!(0|t)&!(0|r))){if(!(!0&!(117440512&r))){w=22;break e}if(l=0|ze(0|t,0|r,52),E(),(0|(l&=15))<(0|x)){o=12,w=28;break e}if((0|l)!=(0|x)&&(t|=m,r=-15728641&r|g,l>>>0>=y>>>0)){A=x;do{d=0|Ge(7,0,3*(14-A|0)|0),A=A+1|0,t|=d,r=E()|r}while(A>>>0<l>>>0)}if(A=0|ke(0|t,0|r,0|n,0|p),E(),!(0|(c=0|i[(l=u=b+(A<<3)|0)>>2]))&!(0|(l=0|i[l+4>>2])))A=u;else for(d=0;;){if((0|d)>(0|n)){w=32;break e}if((0|c)==(0|t)&(-117440513&l)==(0|r)){h=0|ze(0|c,0|l,56),E(),f=(h&=7)+1|0,T=0|ze(0|c,0|l,45),E();r:do{if(0|F(127&T)){if(c=0|ze(0|c,0|l,52),E(),!(c&=15)){l=6;break}for(l=1;;){if(!(!((T=0|Ge(7,0,3*(15-l|0)|0))&t)&!(E()&r))){l=7;break r}if(!(l>>>0<c>>>0)){l=6;break}l=l+1|0}}else l=7}while(0);if((h+2|0)>>>0>l>>>0){w=42;break e}T=0|Ge(0|f,0,56),r=E()|-117440513&r,i[(f=u)>>2]=0,i[f+4>>2]=0,t|=T}else A=(A+1|0)%(0|n)|0;if(!(0|(c=0|i[(l=u=b+(A<<3)|0)>>2]))&!(0|(l=0|i[l+4>>2]))){A=u;break}d=d+1|0}i[(T=A)>>2]=t,i[T+4>>2]=r}if((0|(s=s+1|0))>=(0|n))break n;t=0|i[(r=M+(s<<3)|0)>>2],r=0|i[r+4>>2]}}}while(0);if((n+5|0)>>>0<11){w=85;break}if(!(g=0|Le((0|n)/6|0,8))){w=49;break}n:do{if(v){d=0,f=0;do{if(!(!(0|(s=0|i[(r=l=b+(d<<3)|0)>>2]))&!(0|(r=0|i[r+4>>2])))){c=0|ze(0|s,0|r,56),E(),t=(c&=7)+1|0,u=-117440513&r,T=0|ze(0|s,0|r,45),E();r:do{if(0|F(127&T)){if(h=0|ze(0|s,0|r,52),E(),0|(h&=15))for(A=1;;){if(!(!(s&(T=0|Ge(7,0,3*(15-A|0)|0)))&!(u&E())))break r;if(!(A>>>0<h>>>0))break;A=A+1|0}s|=r=0|Ge(0|t,0,56),r=E()|u,i[(t=l)>>2]=s,i[t+4>>2]=r,t=c+2|0}}while(0);7==(0|t)&&(i[(T=g+(f<<3)|0)>>2]=s,i[T+4>>2]=-117440513&r,f=f+1|0)}d=d+1|0}while((0|d)!=(0|n));if(v){if(d=((0|n)<0)<<31>>31,p=0|Ge(0|x,0,52),m=0|E(),x>>>0>15){if(!(!(0|_)&!(0|o))){o=4,w=84;break e}for(o=0;;){if((0|(o=o+1|0))>=(0|n)){s=0,o=f;break n}if(!(!(0|i[(T=M+(o<<3)|0)>>2])&!(0|i[T+4>>2]))){o=4,w=84;break e}}}for(h=0,s=0,u=_;;){do{if(!(!(0|u)&!(0|o))){if(l=0|ze(0|u,0|o,52),E(),(0|(l&=15))<(0|x)){o=12,w=84;break e}do{if((0|l)==(0|x))r=u,l=o;else{if(r=u|p,t=-15728641&o|m,l>>>0<y>>>0){l=t;break}A=x;do{T=0|Ge(7,0,3*(14-A|0)|0),A=A+1|0,r|=T,t=E()|t}while(A>>>0<l>>>0);l=t}}while(0);for(A=0|ke(0|r,0|l,0|n,0|d),E(),t=0;;){if((0|t)>(0|n)){w=77;break e}if((-117440513&(c=0|i[(T=b+(A<<3)|0)+4>>2]))==(0|l)&&(0|i[T>>2])==(0|r)){w=79;break}if((0|i[(T=b+((A=(A+1|0)%(0|n)|0)<<3)|0)>>2])==(0|r)&&(0|i[T+4>>2])==(0|l))break;t=t+1|0}if(79==(0|w)&&(w=0,!0&100663296==(117440512&c)))break;i[(T=e+(s<<3)|0)>>2]=u,i[T+4>>2]=o,s=s+1|0}}while(0);if((0|(o=h+1|0))>=(0|n)){o=f;break n}h=o,u=0|i[(T=M+(o<<3)|0)>>2],o=0|i[T+4>>2]}}else s=0,o=f}else s=0,o=0}while(0);if(Xe(0|b,0,0|a),We(0|M,0|g,o<<3),Pe(g),!o)break t;e=e+(s<<3)|0,n=o}if(17==(0|w))!0&!(117440512&o)?(o=4,w=28):w=22;else if(32==(0|w))S(23313,22674,362,22684);else{if(42==(0|w))return Pe(M),Pe(b),0|(T=10);if(49==(0|w))return Pe(M),Pe(b),0|(T=13);if(77==(0|w))S(23313,22674,462,22684);else{if(84==(0|w))return Pe(g),Pe(M),Pe(b),0|(T=o);if(85==(0|w)){We(0|e,0|M,n<<3);break}}}if(22==(0|w))return Pe(M),Pe(b),0|(T=5);if(28==(0|w))return Pe(M),Pe(b),0|(T=o)}}while(0);return Pe(M),Pe(b),0|(T=0)},_destroyLinkedMultiPolygon:oe,_directedEdgeToBoundary:Mt,_directedEdgeToCells:function(t,e,n){t|=0;var r,a,o,s=0;return r=D,D=D+16|0,s=r,!0&268435456==(2013265920&(e|=0))?(a=-2130706433&e|134217728,i[(o=n|=0)>>2]=t,i[o+4>>2]=a,i[s>>2]=0,e=0|ze(0|t,0|e,56),E(),s=0|N(t,a,7&e,s,n+8|0),D=r,0|s):(D=r,0|(s=6))},_edgeLengthKm:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,d=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return l=t,A=+a[n>>3],A*=6371.007180918475,a[n>>3]=A,D=r,0|l;if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return l=0,A=0,A*=6371.007180918475,a[n>>3]=A,D=r,0|l;e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{d=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+f(.5*(o-d)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+f(.5*(s-u)))*(+h(+d)*+h(+o)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return a[n>>3]=A,l=0,p=A,p*=6371.007180918475,a[n>>3]=p,D=r,0|l},_edgeLengthM:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,d=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return l=t,A=+a[n>>3],A*=6371.007180918475,A*=1e3,a[n>>3]=A,D=r,0|l;if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return l=0,A=0,A*=6371.007180918475,A*=1e3,a[n>>3]=A,D=r,0|l;e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{d=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+f(.5*(o-d)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+f(.5*(s-u)))*(+h(+d)*+h(+o)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return a[n>>3]=A,l=0,p=A,p*=6371.007180918475,p*=1e3,a[n>>3]=p,D=r,0|l},_edgeLengthRads:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,d=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return D=r,0|(l=t);if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return D=r,0|(l=0);e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{d=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+f(.5*(o-d)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+f(.5*(s-u)))*(+h(+o)*+h(+d)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)))}while((0|t)<(0|e));return a[n>>3]=A,D=r,0|(l=0)},_emscripten_replace_memory:function(t){return r=new Int8Array(t),i=new Int32Array(t),a=new Float64Array(t),n=t,!0},_free:Pe,_getBaseCellNumber:Ot,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var r,a,o=0;return r=D,D=D+16|0,i[(o=r)>>2]=0,!0&268435456==(2013265920&e)?(a=0|ze(0|t,0|e,56),E(),o=0|N(t,-2130706433&e|134217728,7&a,o,n),D=r,0|o):(D=r,0|(o=6))},_getDirectedEdgeOrigin:function(t,e,n){return t|=0,n|=0,!0&268435456==(2013265920&(e|=0))?(i[n>>2]=t,i[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20528+(t<<3)>>3],0|(e=0))},_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20656+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20912+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,r){r|=0;var a,o=0,s=0,A=0,l=0,c=0,u=0,h=0,f=0;a=D,D=D+128|0,h=a+112|0,A=a+96|0,f=a,s=0|ze(0|(e|=0),0|(n|=0),52),E(),c=15&s,i[h>>2]=c,l=0|ze(0|e,0|n,45),E(),l&=127;t:do{if(0|F(l)){if(0|c)for(o=1;;){if(!(!((u=0|Ge(7,0,3*(15-o|0)|0))&e)&!(E()&n))){s=0;break t}if(!(o>>>0<c>>>0))break;o=o+1|0}if(!(1&s))return u=0|Ge(c+1|0,0,52),f=E()|-15728641&n,f=0|t((u|e)&~(h=0|Ge(7,0,3*(14-c|0)|0)),f&~E(),r),D=a,0|f;s=1}else s=0}while(0);if(!(o=0|Wt(e,n,A))){s?(Ct(A,h,f),u=5):(Dt(A,h,f),u=6);t:do{if(0|F(l))if(c)for(o=1;;){if(!(!((l=0|Ge(7,0,3*(15-o|0)|0))&e)&!(E()&n))){e=2;break t}if(!(o>>>0<c>>>0)){e=5;break}o=o+1|0}else e=5;else e=2}while(0);Xe(0|r,-1,e<<2);t:do{if(s)for(A=0;;){if(Pt(l=f+(A<<4)|0,0|i[h>>2]),l=0|i[l>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|l))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|l)))}if(i[o>>2]=l,(A=A+1|0)>>>0>=u>>>0){o=0;break}}else for(A=0;;){if(Rt(l=f+(A<<4)|0,0|i[h>>2],0,1),l=0|i[l>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|l))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|l)))}if(i[o>>2]=l,(A=A+1|0)>>>0>=u>>>0){o=0;break}}}while(0)}return D=a,0|(f=o)},_getNumCells:ee,_getPentagons:Yt,_getRes0Cells:function(t){t|=0;var e=0,n=0,r=0;e=0;do{Ge(0|e,0,45),r=134225919|E(),i[(n=t+(e<<3)|0)>>2]=-1,i[n+4>>2]=r,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|ze(0|(t|=0),0|(e|=0),52),E(),15&e},_greatCircleDistanceKm:te,_greatCircleDistanceM:function(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+f(.5*(r-n)))*i+(o=+f(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+f(.5*(r-n)))*i+(o=+f(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))},_gridDisk:O,_gridDiskDistances:I,_gridDistance:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s,A=0,l=0;return s=D,D=D+32|0,l=s,0|(o=0|le(t|=0,e|=0,t,e,A=s+12|0))?(D=s,0|(l=o)):0|(t=0|le(t,e,n,r,l))?(D=s,0|(l=t)):(A=0|vt(A,l),i[(l=a)>>2]=A,i[l+4>>2]=((0|A)<0)<<31>>31,D=s,0|(l=0))},_gridPathCells:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s=0,A=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,T=0,C=0;if(o=D,D=D+48|0,c=o+12|0,T=o,!(s=0|le(t|=0,e|=0,t,e,A=o+24|0))&&!(s=0|le(t,e,n,r,c))){w=((0|(M=0|vt(A,c)))<0)<<31>>31,i[A>>2]=0,i[A+4>>2]=0,i[A+8>>2]=0,i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,0|le(t,e,t,e,A)&&S(23313,23090,691,23299),0|le(t,e,n,r,c)&&S(23313,23090,696,23299),xt(A),xt(c),M?(g=+(0|M),b=A,r=d=0|i[A>>2],s=p=0|i[(y=A+4|0)>>2],n=m=0|i[(x=A+8|0)>>2],v=+((0|i[c>>2])-d|0)/g,_=+((0|i[c+4>>2])-p|0)/g,g=+((0|i[c+8>>2])-m|0)/g):(y=s=A+4|0,x=n=A+8|0,b=A,r=0|i[A>>2],s=0|i[s>>2],n=0|i[n>>2],v=0,_=0,g=0),i[T>>2]=r,i[(m=T+4|0)>>2]=s,i[(p=T+8|0)>>2]=n;t:do{if((0|M)<0)s=0;else for(f=0,d=0,s=r;;){C=v*(h=+(d>>>0)+4294967296*+(0|f))+ +(0|s),u=_*h+ +(0|i[y>>2]),h=g*h+ +(0|i[x>>2]),n=~~+Ve(+C),A=~~+Ve(+u),s=~~+Ve(+h),C=+l(+(+(0|n)-C)),u=+l(+(+(0|A)-u)),h=+l(+(+(0|s)-h));do{if(!(C>u&C>h)){if(c=0-n|0,u>h){r=c-s|0;break}r=A,s=c-A|0;break}n=0-(A+s)|0,r=A}while(0);if(i[T>>2]=n,i[m>>2]=r,i[p>>2]=s,bt(T),0|(s=0|ce(t,e,T,a+(d<<3)|0)))break t;if(!((0|f)<(0|w)|(0|f)==(0|w)&d>>>0<M>>>0)){s=0;break t}s=0|De(0|d,0|f,1,0),f=c=0|E(),d=s,s=0|i[b>>2]}}while(0);return D=o,0|(T=s)}return D=o,0|(T=s)},_gridPathCellsSize:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s=0,A=0,l=0;return o=D,D=D+32|0,l=o,(s=0|le(t|=0,e|=0,t,e,A=o+12|0))||(s=0|le(t,e,n,r,l))?(D=o,0|(l=s)):(r=0|De(0|(r=0|vt(A,l)),((0|r)<0)<<31>>31,1,0),A=0|E(),i[(l=a)>>2]=r,i[l+4>>2]=A,D=o,0|(l=0))},_gridRingUnsafe:function(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var a,o,s=0,A=0,l=0,c=0,u=0,h=0,f=0,d=0,p=0;if(o=D,D=D+16|0,p=o+8|0,i[(d=a=o)>>2]=t,i[d+4>>2]=e,!n)return i[(p=r)>>2]=t,i[p+4>>2]=e,D=o,0|(p=0);i[p>>2]=0;t:do{if(0|Nt(t,e))t=9;else{if(A=(0|n)>0){s=0,d=t;do{if(0|(t=0|N(d,e,4,p,a)))break t;if(s=s+1|0,0|Nt(d=0|i[(e=a)>>2],e=0|i[e+4>>2])){t=9;break t}}while((0|s)<(0|n));if(i[(f=r)>>2]=d,i[f+4>>2]=e,f=n+-1|0,A){h=0,t=1;do{if(s=22384+(h<<2)|0,5==(0|h))for(l=0|i[s>>2],A=0,s=t;;){if(0|(t=0|N(0|i[(t=a)>>2],0|i[t+4>>2],l,p,a)))break t;if((0|A)!=(0|f)){if(c=0|i[(u=a)>>2],u=0|i[u+4>>2],i[(t=r+(s<<3)|0)>>2]=c,i[t+4>>2]=u,0|Nt(c,u)){t=9;break t}t=s+1|0}else t=s;if((0|(A=A+1|0))>=(0|n))break;s=t}else for(l=a,u=0|i[s>>2],c=0,s=t,A=0|i[l>>2],l=0|i[l+4>>2];;){if(0|(t=0|N(A,l,u,p,a)))break t;if(A=0|i[(l=a)>>2],l=0|i[l+4>>2],i[(t=r+(s<<3)|0)>>2]=A,i[t+4>>2]=l,t=s+1|0,0|Nt(A,l)){t=9;break t}if((0|(c=c+1|0))>=(0|n))break;s=t}h=h+1|0}while(h>>>0<6);l=d,s=0|i[(t=a)>>2],A=e,t=0|i[t+4>>2]}else l=d,s=d,A=e,t=e}else i[(l=r)>>2]=t,i[l+4>>2]=e,l=t,s=t,A=e,t=e;t=(0|l)==(0|s)&(0|A)==(0|t)?0:9}}while(0);return D=o,0|(p=t)},_i64Add:De,_i64Subtract:Oe,_isPentagon:Nt,_isResClassIII:function(t,e){return e=0|ze(0|(t|=0),0|(e|=0),52),E(),1&e},_isValidCell:It,_isValidDirectedEdge:function(t,e){var n=0;switch(n=0|ze(0|(t|=0),0|(e|=0),56),E(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e)?!0&16777216==(117440512&e)&!!(0|Nt(t,n))?0|(n=0):0|(n=0|It(t,n)):0|(n=0)},_isValidVertex:function(t,e){t|=0;var n,r,a=0,o=0;return r=D,D=D+16|0,n=r,!0&536870912==(2013265920&(e|=0))&&0|It(t,a=-2130706433&e|134217728)?(o=0|ze(0|t,0|e,56),E(),a=(o=!(0|ye(t,a,7&o,n)))&((0|i[(a=n)>>2])==(0|t)?(0|i[a+4>>2])==(0|e):0)&1,D=r,0|a):(D=r,0|(a=0))},_latLngToCell:jt,_llvm_maxnum_f64:He,_llvm_minnum_f64:je,_llvm_round_f64:Ve,_localIjToCell:function(t,e,n,r,i){var a,o;return t|=0,e|=0,n|=0,i|=0,o=D,D=D+16|0,a=o,(r|=0)?n=15:(n=0|yt(n,a))||(n=0|ce(t,e,a,i)),D=o,0|n},_malloc:Re,_maxFaceCount:function(t,e,n){n|=0;var r=0,a=0;if(a=0|ze(0|(t|=0),0|(e|=0),45),E(),!(0|F(127&a)))return a=2,i[n>>2]=a,0;if(a=0|ze(0|t,0|e,52),E(),!(a&=15))return a=5,i[n>>2]=a,0;for(r=1;;){if(!(!((0|Ge(7,0,3*(15-r|0)|0))&t)&!(E()&e))){r=2,t=6;break}if(!(r>>>0<a>>>0)){r=5,t=6;break}r=r+1|0}return 6==(0|t)?(i[n>>2]=r,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,r=0,a=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|ee(15,e)):(a=0|Ne(0|t,0|(n=((0|t)<0)<<31>>31),3,0),r=0|E(),n=0|De(0|t,0|n,1,0),n=0|De(0|(n=0|Ne(0|a,0|r,0|n,0|E())),0|E(),1,0),t=0|E(),i[e>>2]=n,i[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,r){e|=0,r|=0;var a,o=0,s=0,A=0,l=0,c=0;if(a=D,D=D+48|0,o=a+16|0,s=a+8|0,A=a,0|(n|=0))return D=a,0|(A=15);if(l=0|i[(c=t|=0)+4>>2],i[(n=s)>>2]=i[c>>2],i[n+4>>2]=l,fe(s,o),!(e=0|Y(o,e,A))){if(n=0|i[s>>2],(0|(s=0|i[t+8>>2]))>0){o=0|i[t+12>>2],e=0;do{n=(0|i[o+(e<<3)>>2])+n|0,e=e+1|0}while((0|e)<(0|s))}o=0|i[(e=A)>>2],(0|(e=0|i[e+4>>2]))<(0|(s=((0|n)<0)<<31>>31))|(0|e)==(0|s)&o>>>0<n>>>0?(i[(e=A)>>2]=n,i[e+4>>2]=s,e=s):n=o,l=0|De(0|n,0|e,12,0),c=0|E(),i[(e=A)>>2]=l,i[e+4>>2]=c,i[(e=r)>>2]=l,i[e+4>>2]=c,e=0}return D=a,0|(c=e)},_memcpy:We,_memset:Xe,_originToDirectedEdges:function(t,e,n){n|=0;var r,a=0;return r=!(0|Nt(t|=0,e|=0)),e&=-2130706433,i[(a=n)>>2]=r?t:0,i[a+4>>2]=r?285212672|e:0,i[(a=n+8|0)>>2]=t,i[a+4>>2]=301989888|e,i[(a=n+16|0)>>2]=t,i[a+4>>2]=318767104|e,i[(a=n+24|0)>>2]=t,i[a+4>>2]=335544320|e,i[(a=n+32|0)>>2]=t,i[a+4>>2]=352321536|e,i[(n=n+40|0)>>2]=t,i[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,r){e|=0,r|=0;var a,o,s,A,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,S=0,T=0,C=0,R=0,P=0,L=0,O=0,I=0,N=0,B=0,F=0;if(A=D,D=D+112|0,a=A+80|0,f=A+72|0,o=A,s=A+56|0,0|(n|=0))return D=A,0|(F=15);if(!(F=0|Re(32+(i[(d=(t|=0)+8|0)>>2]<<5)|0)))return D=A,0|(F=13);if(de(t,F),B=0|i[(N=t)+4>>2],i[(n=f)>>2]=i[N>>2],i[n+4>>2]=B,fe(f,a),n=0|Y(a,e,o))N=0,B=0;else{if(n=0|i[f>>2],(0|(c=0|i[d>>2]))>0){u=0|i[t+12>>2],l=0;do{n=(0|i[u+(l<<3)>>2])+n|0,l=l+1|0}while((0|l)!=(0|c));l=n}else l=n;c=0|i[(n=o)>>2],(0|(n=0|i[n+4>>2]))<(0|(u=((0|l)<0)<<31>>31))|(0|n)==(0|u)&c>>>0<l>>>0?(i[(n=o)>>2]=l,i[n+4>>2]=u,n=u):l=c,N=0|De(0|l,0|n,12,0),B=0|E(),i[(n=o)>>2]=N,i[n+4>>2]=B,n=0}if(0|n)return Pe(F),D=A,0|(F=n);if(!(l=0|Le(N,8)))return Pe(F),D=A,0|(F=13);if(!(h=0|Le(N,8)))return Pe(F),Pe(l),D=A,0|(F=13);i[(O=a)>>2]=0,i[O+4>>2]=0,I=0|i[(O=t)+4>>2],i[(n=f)>>2]=i[O>>2],i[n+4>>2]=I,n=0|k(f,N,B,e,a,l,h);t:do{if(n)Pe(l),Pe(h),Pe(F);else{e:do{if((0|i[d>>2])>0){for(u=t+12|0,c=0;n=0|k((0|i[u>>2])+(c<<3)|0,N,B,e,a,l,h),c=c+1|0,!(0|n);)if((0|c)>=(0|i[d>>2]))break e;Pe(l),Pe(h),Pe(F);break t}}while(0);(0|B)>0|!(0|B)&N>>>0>0&&Xe(0|h,0,N<<3),O=0|i[(I=a)+4>>2];e:do{if((0|O)>0|!(0|O)&(0|i[I>>2])>>>0>0){R=l,P=h,L=l,O=h,I=l,n=l,S=l,T=h,C=h,l=h;n:for(;;){for(x=0,b=0,M=0,w=0,c=0,u=0;;){f=(h=o)+56|0;do{i[h>>2]=0,h=h+4|0}while((0|h)<(0|f));if(0|q(d=0|i[(e=R+(x<<3)|0)>>2],e=0|i[e+4>>2],1,o,0)){f=(h=o)+56|0;do{i[h>>2]=0,h=h+4|0}while((0|h)<(0|f));0|(h=0|Le(7,4))&&(U(d,e,1,o,h,7,0,0),Pe(h))}for(y=0;;){v=0|i[(_=o+(y<<3)|0)>>2],_=0|i[_+4>>2];r:do{if(!(0|v)&!(0|_))h=c,f=u;else{if(p=0|ke(0|v,0|_,0|N,0|B),d=0|E(),!(!(0|(f=0|i[(e=h=r+(p<<3)|0)>>2]))&!(0|(e=0|i[e+4>>2])))){m=0,g=0;do{if((0|m)>(0|B)|(0|m)==(0|B)&g>>>0>N>>>0)break n;if((0|f)==(0|v)&(0|e)==(0|_)){h=c,f=u;break r}p=0|Be(0|(h=0|De(0|p,0|d,1,0)),0|E(),0|N,0|B),d=0|E(),g=0|De(0|g,0|m,1,0),m=0|E(),f=0|i[(e=h=r+(p<<3)|0)>>2],e=0|i[e+4>>2]}while(!(!(0|f)&!(0|e)))}!(0|v)&!(0|_)?(h=c,f=u):(Xt(v,_,s),0|pe(t,F,s)&&(g=0|De(0|c,0|u,1,0),u=0|E(),i[(m=h)>>2]=v,i[m+4>>2]=_,i[(c=P+(c<<3)|0)>>2]=v,i[c+4>>2]=_,c=g),h=c,f=u)}}while(0);if((y=y+1|0)>>>0>=7)break;c=h,u=f}if(x=0|De(0|x,0|b,1,0),b=0|E(),M=0|De(0|M,0|w,1,0),w=0|E(),c=0|i[(u=a)>>2],!((0|w)<(0|(u=0|i[u+4>>2]))|(0|w)==(0|u)&M>>>0<c>>>0))break;c=h,u=f}if((0|u)>0|!(0|u)&c>>>0>0){c=0,u=0;do{i[(w=R+(c<<3)|0)>>2]=0,i[w+4>>2]=0,c=0|De(0|c,0|u,1,0),u=0|E(),M=0|i[(w=a)+4>>2]}while((0|u)<(0|M)|((0|u)==(0|M)?c>>>0<(0|i[w>>2])>>>0:0))}if(i[(w=a)>>2]=h,i[w+4>>2]=f,!((0|f)>0|!(0|f)&h>>>0>0))break e;y=l,x=C,b=I,M=T,w=P,l=S,C=n,T=L,S=y,n=x,I=O,O=b,L=M,P=R,R=w}Pe(L),Pe(O),Pe(F),n=1;break t}n=h}while(0);Pe(F),Pe(l),Pe(n),n=0}}while(0);return D=A,0|(F=n)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|i[(t|=0)>>2])>>>0)+4294967296*+(0|i[t+4>>2]))},_res0CellCount:function(){return 122},_round:Qe,_sbrk:Ye,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(t,e,n,r,a,o,s){t|=0,r|=0,a|=0,o|=0;var A,l=0,c=0,u=0,h=0,f=0,d=0,p=0,m=0;if(A=D,D=D+16|0,m=A,!((0|(n|=0))>0|!(0|n)&(e|=0)>>>0>0))return D=A,0|(m=0);if((0|(s|=0))>=16)return D=A,0|(m=12);d=0,p=0,f=0,l=0;t:for(;;){if(h=0|ze(0|(c=0|i[(u=t+(d<<3)|0)>>2]),0|(u=0|i[u+4>>2]),52),E(),(15&h)>(0|s)){l=12,c=11;break}if(Zt(m,c,u,s),!(0|(u=0|i[(h=m)>>2]))&!(0|(h=0|i[h+4>>2])))c=f;else{c=f;do{if(!((0|l)<(0|o)|(0|l)==(0|o)&c>>>0<a>>>0)){c=10;break t}i[(f=r+(c<<3)|0)>>2]=u,i[f+4>>2]=h,c=0|De(0|c,0|l,1,0),l=0|E(),Kt(m),u=0|i[(f=m)>>2],h=0|i[f+4>>2]}while(!(!(0|u)&!(0|h)))}if(d=0|De(0|d,0|p,1,0),!((0|(p=0|E()))<(0|n)|(0|p)==(0|n)&d>>>0<e>>>0)){l=0,c=11;break}f=c}return 10==(0|c)?(D=A,0|(m=14)):11==(0|c)?(D=A,0|l):0},_uncompactCellsSize:function(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,f=0;s=D,D=D+16|0,o=s;t:do{if((0|n)>0|!(0|n)&e>>>0>0){for(h=0,l=0,A=0,f=0;;){if(!(!(0|(c=0|i[(u=t+(h<<3)|0)>>2]))&!(0|(u=0|i[u+4>>2]))||(u=!(0|Ut(c,u,r,o)),l=0|De(0|i[(c=o)>>2],0|i[c+4>>2],0|l,0|A),A=0|E(),u))){A=12;break}if(h=0|De(0|h,0|f,1,0),!((0|(f=0|E()))<(0|n)|(0|f)==(0|n)&h>>>0<e>>>0))break t}return D=s,0|A}l=0,A=0}while(0);return i[a>>2]=l,i[a+4>>2]=A,D=s,0|(a=0)},_vertexToLatLng:function(t,e,n){n|=0;var r,a,o,s,A=0,l=0;return s=D,D=D+192|0,a=s,o=s+168|0,A=0|ze(0|(t|=0),0|(e|=0),56),E(),A&=7,0|(r=0|Wt(t,l=-2130706433&e|134217728,o))?(D=s,0|(l=r)):(e=0|ze(0|t,0|e,52),E(),e&=15,0|Nt(t,l)?Tt(o,e,A,1,a):Lt(o,e,A,1,a),l=a+8|0,i[n>>2]=i[l>>2],i[n+4>>2]=i[l+4>>2],i[n+8>>2]=i[l+8>>2],i[n+12>>2]=i[l+12>>2],D=s,0|(l=0))},establishStackSpace:function(t,e){D=t|=0},stackAlloc:function(t){var e;return e=D,D=(D=D+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){D=t|=0},stackSave:function(){return 0|D}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:gt,b:function(t){g=t},c:function(){return g},d:function(t,e,n,r){gt("Assertion failed: "+P(t)+", at: "+[e?P(e):"unknown filename",n,r?P(r):"unknown function"])},e:function(t){return n.___errno_location&&(S[n.___errno_location()>>2]=t),t},f:$,g:function(t,e,n){w.set(w.subarray(e,e+n),t)},h:function(t){var e=$(),n=16777216,r=2130706432;if(t>r)return!1;for(var i=Math.max(e,16777216);i<t;)i=i<=536870912?L(2*i,n):Math.min(L((3*i+2147483648)/4,n),r);return!!tt(i)},i:function(t){gt("OOM")},j:Z,k:K,l:tt,m:J,n:function(){var t=J();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),K(t)},o:24144,p:24128},b);n.___divdi3=it.___divdi3,n.___muldi3=it.___muldi3,n.___remdi3=it.___remdi3,n.___uremdi3=it.___uremdi3,n._areNeighborCells=it._areNeighborCells,n._bitshift64Ashr=it._bitshift64Ashr,n._bitshift64Lshr=it._bitshift64Lshr,n._bitshift64Shl=it._bitshift64Shl,n._calloc=it._calloc,n._cellAreaKm2=it._cellAreaKm2,n._cellAreaM2=it._cellAreaM2,n._cellAreaRads2=it._cellAreaRads2,n._cellToBoundary=it._cellToBoundary,n._cellToCenterChild=it._cellToCenterChild,n._cellToChildPos=it._cellToChildPos,n._cellToChildren=it._cellToChildren,n._cellToChildrenSize=it._cellToChildrenSize,n._cellToLatLng=it._cellToLatLng,n._cellToLocalIj=it._cellToLocalIj,n._cellToParent=it._cellToParent,n._cellToVertex=it._cellToVertex,n._cellToVertexes=it._cellToVertexes,n._cellsToDirectedEdge=it._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=it._cellsToLinkedMultiPolygon,n._childPosToCell=it._childPosToCell,n._compactCells=it._compactCells,n._destroyLinkedMultiPolygon=it._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=it._directedEdgeToBoundary,n._directedEdgeToCells=it._directedEdgeToCells,n._edgeLengthKm=it._edgeLengthKm,n._edgeLengthM=it._edgeLengthM,n._edgeLengthRads=it._edgeLengthRads;var at=n._emscripten_replace_memory=it._emscripten_replace_memory;n._free=it._free,n._getBaseCellNumber=it._getBaseCellNumber,n._getDirectedEdgeDestination=it._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=it._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=it._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=it._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=it._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=it._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=it._getIcosahedronFaces,n._getNumCells=it._getNumCells,n._getPentagons=it._getPentagons,n._getRes0Cells=it._getRes0Cells,n._getResolution=it._getResolution,n._greatCircleDistanceKm=it._greatCircleDistanceKm,n._greatCircleDistanceM=it._greatCircleDistanceM,n._greatCircleDistanceRads=it._greatCircleDistanceRads,n._gridDisk=it._gridDisk,n._gridDiskDistances=it._gridDiskDistances,n._gridDistance=it._gridDistance,n._gridPathCells=it._gridPathCells,n._gridPathCellsSize=it._gridPathCellsSize,n._gridRingUnsafe=it._gridRingUnsafe,n._i64Add=it._i64Add,n._i64Subtract=it._i64Subtract,n._isPentagon=it._isPentagon,n._isResClassIII=it._isResClassIII,n._isValidCell=it._isValidCell,n._isValidDirectedEdge=it._isValidDirectedEdge,n._isValidVertex=it._isValidVertex,n._latLngToCell=it._latLngToCell,n._llvm_maxnum_f64=it._llvm_maxnum_f64,n._llvm_minnum_f64=it._llvm_minnum_f64,n._llvm_round_f64=it._llvm_round_f64,n._localIjToCell=it._localIjToCell,n._malloc=it._malloc,n._maxFaceCount=it._maxFaceCount,n._maxGridDiskSize=it._maxGridDiskSize,n._maxPolygonToCellsSize=it._maxPolygonToCellsSize,n._memcpy=it._memcpy,n._memset=it._memset,n._originToDirectedEdges=it._originToDirectedEdges,n._pentagonCount=it._pentagonCount,n._polygonToCells=it._polygonToCells,n._readInt64AsDoubleFromPointer=it._readInt64AsDoubleFromPointer,n._res0CellCount=it._res0CellCount,n._round=it._round,n._sbrk=it._sbrk,n._sizeOfCellBoundary=it._sizeOfCellBoundary,n._sizeOfCoordIJ=it._sizeOfCoordIJ,n._sizeOfGeoLoop=it._sizeOfGeoLoop,n._sizeOfGeoPolygon=it._sizeOfGeoPolygon,n._sizeOfH3Index=it._sizeOfH3Index,n._sizeOfLatLng=it._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=it._sizeOfLinkedGeoPolygon,n._uncompactCells=it._uncompactCells,n._uncompactCellsSize=it._uncompactCellsSize,n._vertexToLatLng=it._vertexToLatLng,n.establishStackSpace=it.establishStackSpace;var ot,st,At=n.stackAlloc=it.stackAlloc,lt=n.stackRestore=it.stackRestore,ct=n.stackSave=it.stackSave;if(n.asm=it,n.cwrap=function(t,e,n,r){var i=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&i&&!r?y(t):function(){return x(t,e,n,arguments)}},n.setValue=function(t,e,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":M[t|0]=e;break;case"i16":E[t>>1]=e;break;case"i32":S[t>>2]=e;break;case"i64":W=[e>>>0,(V=e,+k(V)>=1?V>0?(0|G(+z(V/4294967296),4294967295))>>>0:~~+F((V-+(~~V>>>0))/4294967296)>>>0:0)],S[t>>2]=W[0],S[t+4>>2]=W[1];break;case"float":T[t>>2]=e;break;case"double":C[t>>3]=e;break;default:gt("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return M[t|0];case"i16":return E[t>>1];case"i32":case"i64":return S[t>>2];case"float":return T[t>>2];case"double":return C[t>>3];default:gt("invalid type for getValue: "+e)}return null},X)if(Y(X)||(ot=X,X=n.locateFile?n.locateFile(ot,d):d+ot),A||s){var ut=u(X);w.set(ut,8)}else{H++,n.monitorRunDependencies&&n.monitorRunDependencies(H);var ht=function(t){t.byteLength&&(t=new Uint8Array(t)),w.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(t){if(H--,n.monitorRunDependencies&&n.monitorRunDependencies(H),0==H&&j){var e=j;j=null,e()}}()},ft=function(){c(X,ht,(function(){throw"could not load memory initializer "+X}))},dt=rt(X);if(dt)ht(dt.buffer);else if(n.memoryInitializerRequest){var pt=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=rt(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+X),void ft();e=r.buffer}ht(e)};n.memoryInitializerRequest.response?setTimeout(pt,0):n.memoryInitializerRequest.addEventListener("load",pt)}else ft()}function mt(t){function e(){st||(st=!0,v||(I(U),I(N),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),B.unshift(t);var t;I(B)}()))}H>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),q.unshift(t);var t;I(q)}(),H>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function gt(t){throw n.onAbort&&n.onAbort(t),p(t+=""),m(t),v=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(j=function t(){st||mt(),st||(j=t)},n.run=mt,n.abort=gt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return mt(),t}("object"==typeof Vm?Vm:{}),Wm="number",Xm=[["sizeOfH3Index",Wm],["sizeOfLatLng",Wm],["sizeOfCellBoundary",Wm],["sizeOfGeoLoop",Wm],["sizeOfGeoPolygon",Wm],["sizeOfLinkedGeoPolygon",Wm],["sizeOfCoordIJ",Wm],["readInt64AsDoubleFromPointer",Wm],["isValidCell",Wm,[Wm,Wm]],["latLngToCell",Wm,[Wm,Wm,Wm,Wm]],["cellToLatLng",Wm,[Wm,Wm,Wm]],["cellToBoundary",Wm,[Wm,Wm,Wm]],["maxGridDiskSize",Wm,[Wm,Wm]],["gridDisk",Wm,[Wm,Wm,Wm,Wm]],["gridDiskDistances",Wm,[Wm,Wm,Wm,Wm,Wm]],["gridRingUnsafe",Wm,[Wm,Wm,Wm,Wm]],["maxPolygonToCellsSize",Wm,[Wm,Wm,Wm,Wm]],["polygonToCells",Wm,[Wm,Wm,Wm,Wm]],["cellsToLinkedMultiPolygon",Wm,[Wm,Wm,Wm]],["destroyLinkedMultiPolygon",null,[Wm]],["compactCells",Wm,[Wm,Wm,Wm,Wm]],["uncompactCells",Wm,[Wm,Wm,Wm,Wm,Wm,Wm]],["uncompactCellsSize",Wm,[Wm,Wm,Wm,Wm,Wm]],["isPentagon",Wm,[Wm,Wm]],["isResClassIII",Wm,[Wm,Wm]],["getBaseCellNumber",Wm,[Wm,Wm]],["getResolution",Wm,[Wm,Wm]],["maxFaceCount",Wm,[Wm,Wm,Wm]],["getIcosahedronFaces",Wm,[Wm,Wm,Wm]],["cellToParent",Wm,[Wm,Wm,Wm,Wm]],["cellToChildren",Wm,[Wm,Wm,Wm,Wm]],["cellToCenterChild",Wm,[Wm,Wm,Wm,Wm]],["cellToChildrenSize",Wm,[Wm,Wm,Wm,Wm]],["cellToChildPos",Wm,[Wm,Wm,Wm,Wm]],["childPosToCell",Wm,[Wm,Wm,Wm,Wm,Wm,Wm]],["areNeighborCells",Wm,[Wm,Wm,Wm,Wm,Wm]],["cellsToDirectedEdge",Wm,[Wm,Wm,Wm,Wm,Wm]],["getDirectedEdgeOrigin",Wm,[Wm,Wm,Wm]],["getDirectedEdgeDestination",Wm,[Wm,Wm,Wm]],["isValidDirectedEdge",Wm,[Wm,Wm]],["directedEdgeToCells",Wm,[Wm,Wm,Wm]],["originToDirectedEdges",Wm,[Wm,Wm,Wm]],["directedEdgeToBoundary",Wm,[Wm,Wm,Wm]],["gridDistance",Wm,[Wm,Wm,Wm,Wm,Wm]],["gridPathCells",Wm,[Wm,Wm,Wm,Wm,Wm]],["gridPathCellsSize",Wm,[Wm,Wm,Wm,Wm,Wm]],["cellToLocalIj",Wm,[Wm,Wm,Wm,Wm,Wm,Wm]],["localIjToCell",Wm,[Wm,Wm,Wm,Wm,Wm]],["getHexagonAreaAvgM2",Wm,[Wm,Wm]],["getHexagonAreaAvgKm2",Wm,[Wm,Wm]],["getHexagonEdgeLengthAvgM",Wm,[Wm,Wm]],["getHexagonEdgeLengthAvgKm",Wm,[Wm,Wm]],["greatCircleDistanceM",Wm,[Wm,Wm]],["greatCircleDistanceKm",Wm,[Wm,Wm]],["greatCircleDistanceRads",Wm,[Wm,Wm]],["cellAreaM2",Wm,[Wm,Wm,Wm]],["cellAreaKm2",Wm,[Wm,Wm,Wm]],["cellAreaRads2",Wm,[Wm,Wm,Wm]],["edgeLengthM",Wm,[Wm,Wm,Wm]],["edgeLengthKm",Wm,[Wm,Wm,Wm]],["edgeLengthRads",Wm,[Wm,Wm,Wm]],["getNumCells",Wm,[Wm,Wm]],["getRes0Cells",Wm,[Wm]],["res0CellCount",Wm],["getPentagons",Wm,[Wm,Wm]],["pentagonCount",Wm],["cellToVertex",Wm,[Wm,Wm,Wm,Wm]],["cellToVertexes",Wm,[Wm,Wm,Wm]],["vertexToLatLng",Wm,[Wm,Wm,Wm]],["isValidVertex",Wm,[Wm,Wm]]],Qm=4,Ym={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range"};
    66/*
    77   * Copyright 2018-2019, 2022 Uber Technologies, Inc.
     
    3333   * See the License for the specific language governing permissions and
    3434   * limitations under the License.
    35    */var ig={};Xm.forEach((function(t){ig[t[0]]=Vm.cwrap.apply(Vm,t);}));var ag=16,og=4,sg=8,Ag=ig.sizeOfH3Index(),lg=ig.sizeOfLatLng(),cg=ig.sizeOfCellBoundary(),ug=ig.sizeOfGeoPolygon(),hg=ig.sizeOfGeoLoop();ig.sizeOfLinkedGeoPolygon(),ig.sizeOfCoordIJ();var fg=Math.pow(2,32)-1;var dg=/[^0-9a-fA-F]/;function pg(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||dg.test(t))return [0,0];var e=parseInt(t.substring(0,t.length-8),ag);return [parseInt(t.substring(t.length-8),ag),e]}function mg(t){if(t>=0)return t.toString(ag);var e=gg(8,(t&=2147483647).toString(ag));return e=(parseInt(e[0],ag)+8).toString(ag)+e.substring(1)}function gg(t,e){for(var n=t-e.length,r="",i=0;i<n;i++)r+="0";return r+=e}function vg(t,e,n){for(var r=t.length,i=Vm._calloc(r,lg),a=n?1:0,o=n?0:1,s=0;s<2*r;s+=2)Vm.HEAPF64.set([t[s/2][a],t[s/2][o]].map(Tg),i/sg+s);return Vm.HEAPU32.set([r,i],e/og),e}function _g(t,e){void 0===e&&(e=0);var n=Vm.getValue(t+Ag*e,"i32"),r=Vm.getValue(t+Ag*e+og,"i32");return r?function(t,e){return mg(e)+gg(8,mg(t))}(n,r):null}function yg(t){return 180*Vm.getValue(t,"double")/Math.PI}function xg(t){return [yg(t),yg(t+sg)]}function bg(t){return [yg(t+sg),yg(t)]}function Mg(t,e,n){var r=Vm._malloc(lg);Vm.HEAPF64.set([t,e].map(Tg),r/sg);var i=Vm._malloc(Ag);try{return rg(ig.latLngToCell(r,n,i)),function(t){if(!t)throw ng(Km);return t}(_g(i))}finally{Vm._free(i),Vm._free(r);}}function wg(t){var e=Vm._malloc(lg),n=pg(t),r=n[0],i=n[1];try{return rg(ig.cellToLatLng(r,i,e)),xg(e)}finally{Vm._free(e);}}function Eg(t,e){var n=Vm._malloc(cg),r=pg(t),i=r[0],a=r[1];try{return rg(ig.cellToBoundary(i,a,n)),function(t,e,n){for(var r=Vm.getValue(t,"i32"),i=t+sg,a=[],o=e?bg:xg,s=0;s<2*r;s+=2)a.push(o(i+sg*s));return n&&a.push(a[0]),a}(n,e,e)}finally{Vm._free(n);}}function Sg(t,e,n){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw eg(Qm,t)}(e),n=Boolean(n),0===t.length||0===t[0].length)return [];var r,i=function(t,e){var n,r=t.length-1,i=Vm._calloc(ug),a=0+hg,o=a+og;if(vg(t[0],i+0,e),r>0){n=Vm._calloc(r,hg);for(var s=0;s<r;s++)vg(t[s+1],n+hg*s,e);}return Vm.setValue(i+a,r,"i32"),Vm.setValue(i+o,n,"i32"),i}("number"==typeof t[0][0]?[t]:t,n),a=Vm._malloc(8);try{rg(ig.maxPolygonToCellsSize(i,e,0,a));var o=function(t){if(t>fg)throw ng(Zm,t);return t}((r=a,ig.readInt64AsDoubleFromPointer(r))),s=Vm._calloc(o,Ag);try{return rg(ig.polygonToCells(i,e,0,s)),function(t,e){for(var n=[],r=0;r<e;r++){var i=_g(t,r);null!==i&&n.push(i);}return n}(s,o)}finally{Vm._free(s);}}finally{Vm._free(a),function(t){var e=0+hg,n=e+og,r=og;Vm._free(Vm.getValue(t+0+r,"i8*"));var i=Vm.getValue(t+e,"i32");if(i>0){for(var a=Vm.getValue(t+n,"i32"),o=0;o<i;o++)Vm._free(Vm.getValue(a+hg*o+r,"i8*"));Vm._free(a);}Vm._free(t);}(i);}}function Tg(t){return t*Math.PI/180}var Cg=Rg;function Rg(t,e,n,r){this.x="number"==typeof t?t:0,this.y="number"==typeof e?e:0,this.z="number"==typeof n?n:0,this.half="number"==typeof r?r:0;}Rg.prototype.contains=function(t,e,n){var r=this.half;return this.x-r<=t&&t<this.x+r&&this.y-r<=e&&e<this.y+r&&this.z-r<=n&&n<this.z+r};var Pg=Cg,Lg=Dg;function Dg(t){this.bounds=t,this.q0=null,this.q1=null,this.q2=null,this.q3=null,this.q4=null,this.q5=null,this.q6=null,this.q7=null,this.items=null;}Dg.prototype.subdivide=function(){var t=this.bounds,e=t.half/2;this.q0=new Dg(new Pg(t.x-e,t.y-e,t.z-e,e)),this.q1=new Dg(new Pg(t.x+e,t.y-e,t.z-e,e)),this.q2=new Dg(new Pg(t.x-e,t.y+e,t.z-e,e)),this.q3=new Dg(new Pg(t.x+e,t.y+e,t.z-e,e)),this.q4=new Dg(new Pg(t.x-e,t.y-e,t.z+e,e)),this.q5=new Dg(new Pg(t.x+e,t.y-e,t.z+e,e)),this.q6=new Dg(new Pg(t.x-e,t.y+e,t.z+e,e)),this.q7=new Dg(new Pg(t.x+e,t.y+e,t.z+e,e));},Dg.prototype.insert=function(t,e,n){if(null===this.q0){if(null===this.items?this.items=[t]:this.items.push(t),this.items.length>=4&&n<16){this.subdivide();for(var r=0;r<this.items.length;++r)this.insert(this.items[r],e,n+1);this.items=null;}}else {var i=e[t],a=e[t+1],o=e[t+2],s=this.bounds,A=0;i>s.x&&(A+=1),a>s.y&&(A+=2),o>s.z&&(A+=4);var l=function(t,e){if(0===e)return t.q0;if(1===e)return t.q1;if(2===e)return t.q2;if(3===e)return t.q3;if(4===e)return t.q4;if(5===e)return t.q5;if(6===e)return t.q6;if(7===e)return t.q7}(this,A);l.insert(t,e,n+1);}},Dg.prototype.query=function(t,e,n,r){if(n(this.bounds)){var i=this.items,a="function"==typeof r;if(i)for(var o=0;o<i.length;++o){var s=i[o];a?r(e[s],e[s+1],e[s+2])&&t.push(s):t.push(s);}this.q0&&(this.q0.query(t,e,n,r),this.q1.query(t,e,n,r),this.q2.query(t,e,n,r),this.q3.query(t,e,n,r),this.q4.query(t,e,n,r),this.q5.query(t,e,n,r),this.q6.query(t,e,n,r),this.q7.query(t,e,n,r));}};var Og=function(t,e,n,r){var i=0,a=0,o=(r=r||{}).step||1,s=r.maxTimeMS||8,A=r.probeElements||5e3;setTimeout((function r(){var l=Math.min(t.length,i+A),c=i,u=new Date;for(c=i;c<l;c+=o)e(t[c],c,t);c<t.length?(a+=new Date-u,i=c,A=Math.round(i*s/a),setTimeout(r,0)):n(t);}),0);};var Ig=Cg,qg=Lg,Ug=new Ig,Ng=Og,Bg=function(t){var e,n,r=[],i={initAsync:function(t,r){o(t);var a=s(t);function A(e,n){a.insert(n,t,0);}function l(){n=t,e=a,"function"==typeof r&&r(i);}Ng(t,A,l,{step:3});},init:function(t){o(t),n=t,e=s(t);for(var r=0;r<t.length;r+=3)e.insert(r,n,0);},bounds:function(){return e?e.bounds:Ug},intersectRay:function(t,i,a,o){if(!e)return r;void 0===a&&(a=0);void 0===o&&(o=Number.POSITIVE_INFINITY);a*=a,o*=o;var s=[];return e.query(s,n,A,l),s.sort(c);function A(e){var n,r=e.half,a=(e.x-r-t.x)/i.x,s=(e.x+r-t.x)/i.x,A=(e.y+r-t.y)/i.y,l=(e.y-r-t.y)/i.y,c=(e.z-r-t.z)/i.z,u=(e.z+r-t.z)/i.z,h=Math.min(Math.min(Math.max(a,s),Math.max(A,l)),Math.max(c,u));return !(h<0)&&((n=Math.max(Math.max(Math.min(a,s),Math.min(A,l)),Math.min(c,u)))<=h&&n<=o)}function l(e,n,r){var i=(e-t.x)*(e-t.x)+(n-t.y)*(n-t.y)+(r-t.z)*(r-t.z);return a<=i&&i<=o}function c(e,n){var r=t[e],i=t[e+1],a=t[e+2],o=(r-t.x)*(r-t.x)+(i-t.y)*(i-t.y)+(a-t.z)*(a-t.z),s=t[n],A=t[n+1],l=t[n+2];return o-((s-t.x)*(s-t.x)+(A-t.y)*(A-t.y)+(l-t.z)*(l-t.z))}},intersectSphere:function(t,i,o,s){if(!e)return r;var A=[],l=s*s;return e.query(A,n,c,u),A;function c(e){var n=l,r=e.half;return t<e.x-r?n-=a(t-(e.x-r)):t>e.x+r&&(n-=a(t-(e.x+r))),i<e.y-r?n-=a(i-(e.y-r)):i>e.y+r&&(n-=a(i-(e.y+r))),o<e.z-r?n-=a(o-(e.z-r)):o>e.z+r&&(n-=a(o-(e.z+r))),n>0}function u(e,n,r){return a(e-t)+a(n-i)+a(r-o)<l}},getRoot:function(){return e}};return i;function a(t){return t*t}function o(t){if(!t)throw new Error("Points array is required for quadtree to work");if("number"!=typeof t.length)throw new Error("Points should be array-like object");if(t.length%3!=0)throw new Error("Points array should consist of series of x,y,z coordinates and be multiple of 3")}function s(t){if(0===t.length){var e=new Ig;return new qg(e)}for(var n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,A=0;A<t.length;A+=3){var l=t[A],c=t[A+1],u=t[A+2];l<n&&(n=l),l>a&&(a=l),c<r&&(r=c),c>o&&(o=c),u<i&&(i=u),u>s&&(s=u);}var h=Math.max(Math.max(a-n,o-r),s-i),f=(h+=2)/2,d=new Ig((n-=1)+f,(r-=1)+f,(i-=1)+f,f);return new qg(d)}};var kg=el(Bg);const Fg=window.THREE?window.THREE:{Box3:Ae,BufferGeometry:Hn,Float32BufferAttribute:qn,InstancedBufferGeometry:class extends Hn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0;}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}},InstancedInterleavedBuffer:Ks,InterleavedBufferAttribute:Mo,Sphere:Se,Vector3:ae,WireframeGeometry:class extends Hn{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],n=new Set,r=new ae,i=new ae;if(null!==t.index){const a=t.attributes.position,o=t.index;let s=t.groups;0===s.length&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let t=0,A=s.length;t<A;++t){const A=s[t],l=A.start;for(let t=l,s=l+A.count;t<s;t+=3)for(let s=0;s<3;s++){const A=o.getX(t+s),l=o.getX(t+(s+1)%3);r.fromBufferAttribute(a,A),i.fromBufferAttribute(a,l),!0===qs(r,i,n)&&(e.push(r.x,r.y,r.z),e.push(i.x,i.y,i.z));}}}else {const a=t.attributes.position;for(let t=0,o=a.count/3;t<o;t++)for(let o=0;o<3;o++){const s=3*t+o,A=3*t+(o+1)%3;r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,A),!0===qs(r,i,n)&&(e.push(r.x,r.y,r.z),e.push(i.x,i.y,i.z));}}this.setAttribute("position",new qn(e,3));}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}};var zg=(new Fg.BufferGeometry).setAttribute?"setAttribute":"addAttribute";const Gg=new Fg.Box3,Hg=new Fg.Vector3;class jg extends Fg.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this[zg]("position",new Fg.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this[zg]("uv",new Fg.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2));}applyMatrix4(t){const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new Fg.InstancedInterleavedBuffer(e,6,1);return this[zg]("instanceStart",new Fg.InterleavedBufferAttribute(n,3,0)),this[zg]("instanceEnd",new Fg.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new Fg.InstancedInterleavedBuffer(e,6,1);return this[zg]("instanceColorStart",new Fg.InterleavedBufferAttribute(n,3,0)),this[zg]("instanceColorEnd",new Fg.InterleavedBufferAttribute(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new Fg.WireframeGeometry(t.geometry)),this}fromLineSegments(t){const e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.");}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Fg.Box3);const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==t&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(t),Gg.setFromBufferAttribute(e),this.boundingBox.union(Gg));}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Fg.Sphere),null===this.boundingBox&&this.computeBoundingBox();const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,a=t.count;i<a;i++)Hg.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(Hg)),Hg.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(Hg));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this);}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}jg.prototype.isLineSegmentsGeometry=!0;const Vg=window.THREE?window.THREE:{ShaderLib:Ur,ShaderMaterial:dr,UniformsLib:qr,UniformsUtils:fr,Vector2:Lt};Vg.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Vg.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1}},Vg.ShaderLib.line={uniforms:Vg.UniformsUtils.merge([Vg.UniformsLib.common,Vg.UniformsLib.fog,Vg.UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec4 worldPos;\n\t\tvarying vec3 worldStart;\n\t\tvarying vec3 worldEnd;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\tworldStart = start.xyz;\n\t\t\tworldEnd = end.xyz;\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// get the offset direction as perpendicular to the view vector\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 offset;\n\t\t\t\tif ( position.y < 0.5 ) {\n\n\t\t\t\t\toffset = normalize( cross( start.xyz, worldDir ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\toffset = normalize( cross( end.xyz, worldDir ) );\n\n\t\t\t\t}\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\tfloat forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// extend the line bounds to encompass  endcaps\n\t\t\t\t\tstart.xyz += - worldDir * linewidth * 0.5;\n\t\t\t\t\tend.xyz += worldDir * linewidth * 0.5;\n\n\t\t\t\t\t// shift the position of the quad so it hugs the forward edge of the line\n\t\t\t\t\toffset.xy -= dir * forwardOffset;\n\t\t\t\t\toffset.z += 0.5;\n\n\t\t\t\t#endif\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\toffset.xy += dir * 2.0 * forwardOffset;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth * 0.5;\n\n\t\t\t\t// set the world position\n\t\t\t\tworldPos = ( position.y < 0.5 ) ? start : end;\n\t\t\t\tworldPos.xyz += offset;\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segements overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\t\tvarying vec4 worldPos;\n\t\tvarying vec3 worldStart;\n\t\tvarying vec3 worldEnd;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class Wg extends Vg.ShaderMaterial{constructor(t){super({type:"LineMaterial",uniforms:Vg.UniformsUtils.clone(Vg.ShaderLib.line.uniforms),vertexShader:Vg.ShaderLib.line.vertexShader,fragmentShader:Vg.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t;}},worldUnits:{enumerable:!0,get:function(){return "WORLD_UNITS"in this.defines},set:function(t){!0===t?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS;}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t;}},dashed:{enumerable:!0,get:function(){return Boolean("USE_DASH"in this.defines)},set(t){Boolean(t)!==Boolean("USE_DASH"in this.defines)&&(this.needsUpdate=!0),!0===t?this.defines.USE_DASH="":delete this.defines.USE_DASH;}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t;}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t;}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t;}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t;}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t;}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t);}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("ALPHA_TO_COVERAGE"in this.defines)},set:function(t){Boolean(t)!==Boolean("ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),!0===t?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1);}}}),this.setValues(t);}}Wg.prototype.isLineMaterial=!0;const Xg=window.THREE?window.THREE:{Box3:Ae,BufferGeometry:Hn,InstancedInterleavedBuffer:Ks,InterleavedBufferAttribute:Mo,Line3:class{constructor(t=new ae,e=new ae){this.start=t,this.end=e;}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){nA.subVectors(t,this.start),rA.subVectors(this.end,this.start);const n=rA.dot(rA);let r=rA.dot(nA)/n;return e&&(r=Mt(r,0,1)),r}closestPointToPoint(t,e,n){const r=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return (new this.constructor).copy(this)}},MathUtils:Pt,Matrix4:qe,Mesh:sr,Sphere:Se,Vector3:ae,Vector4:$t};var Qg=(new Xg.BufferGeometry).setAttribute?"setAttribute":"addAttribute";const Yg=new Xg.Vector3,Zg=new Xg.Vector3,Kg=new Xg.Vector4,Jg=new Xg.Vector4,$g=new Xg.Vector4,tv=new Xg.Vector3,ev=new Xg.Matrix4,nv=new Xg.Line3,rv=new Xg.Vector3,iv=new Xg.Box3,av=new Xg.Sphere,ov=new Xg.Vector4;class sv extends Xg.Mesh{constructor(t=new jg,e=new Wg({color:16777215*Math.random()})){super(t,e),this.type="LineSegments2";}computeLineDistances(){const t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,r=new Float32Array(2*e.count);for(let t=0,i=0,a=e.count;t<a;t++,i+=2)Yg.fromBufferAttribute(e,t),Zg.fromBufferAttribute(n,t),r[i]=0===i?0:r[i-1],r[i+1]=r[i]+Yg.distanceTo(Zg);const i=new Xg.InstancedInterleavedBuffer(r,2,1);return t[Qg]("instanceDistanceStart",new Xg.InterleavedBufferAttribute(i,1,0)),t[Qg]("instanceDistanceEnd",new Xg.InterleavedBufferAttribute(i,1,1)),this}raycast(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');const n=void 0!==t.params.Line2&&t.params.Line2.threshold||0,r=t.ray,i=t.camera,a=i.projectionMatrix,o=this.matrixWorld,s=this.geometry,A=this.material,l=A.resolution,c=A.linewidth+n,u=s.attributes.instanceStart,h=s.attributes.instanceEnd,f=-i.near,d=2*Math.max(c/l.width,c/l.height);null===s.boundingSphere&&s.computeBoundingSphere(),av.copy(s.boundingSphere).applyMatrix4(o);const p=Math.max(i.near,av.distanceToPoint(r.origin));ov.set(0,0,-p,1).applyMatrix4(i.projectionMatrix),ov.multiplyScalar(1/ov.w),ov.applyMatrix4(i.projectionMatrixInverse);const m=.5*Math.abs(d/ov.w);if(av.radius+=m,!1===t.ray.intersectsSphere(av))return;null===s.boundingBox&&s.computeBoundingBox(),iv.copy(s.boundingBox).applyMatrix4(o);const g=Math.max(i.near,iv.distanceToPoint(r.origin));ov.set(0,0,-g,1).applyMatrix4(i.projectionMatrix),ov.multiplyScalar(1/ov.w),ov.applyMatrix4(i.projectionMatrixInverse);const v=.5*Math.abs(d/ov.w);if(iv.max.x+=v,iv.max.y+=v,iv.max.z+=v,iv.min.x-=v,iv.min.y-=v,iv.min.z-=v,!1!==t.ray.intersectsBox(iv)){r.at(1,$g),$g.w=1,$g.applyMatrix4(i.matrixWorldInverse),$g.applyMatrix4(a),$g.multiplyScalar(1/$g.w),$g.x*=l.x/2,$g.y*=l.y/2,$g.z=0,tv.copy($g),ev.multiplyMatrices(i.matrixWorldInverse,o);for(let t=0,n=u.count;t<n;t++){if(Kg.fromBufferAttribute(u,t),Jg.fromBufferAttribute(h,t),Kg.w=1,Jg.w=1,Kg.applyMatrix4(ev),Jg.applyMatrix4(ev),Kg.z>f&&Jg.z>f)continue;if(Kg.z>f){const t=Kg.z-Jg.z,e=(Kg.z-f)/t;Kg.lerp(Jg,e);}else if(Jg.z>f){const t=Jg.z-Kg.z,e=(Jg.z-f)/t;Jg.lerp(Kg,e);}Kg.applyMatrix4(a),Jg.applyMatrix4(a),Kg.multiplyScalar(1/Kg.w),Jg.multiplyScalar(1/Jg.w),Kg.x*=l.x/2,Kg.y*=l.y/2,Jg.x*=l.x/2,Jg.y*=l.y/2,nv.start.copy(Kg),nv.start.z=0,nv.end.copy(Jg),nv.end.z=0;const n=nv.closestPointToPointParameter(tv,!0);nv.at(n,rv);const i=Xg.MathUtils.lerp(Kg.z,Jg.z,n),s=i>=-1&&i<=1,A=tv.distanceTo(rv)<.5*c;if(s&&A){nv.start.fromBufferAttribute(u,t),nv.end.fromBufferAttribute(h,t),nv.start.applyMatrix4(o),nv.end.applyMatrix4(o);const n=new Xg.Vector3,i=new Xg.Vector3;r.distanceSqToSegment(nv.start,nv.end,i,n),e.push({point:i,pointOnLine:n,distance:r.origin.distanceTo(i),object:this,face:null,faceIndex:t,uv:null,uv2:null});}}}}}sv.prototype.LineSegments2=!0;class Av extends jg{constructor(){super(),this.type="LineGeometry";}setPositions(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return super.setPositions(n),this}setColors(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return super.setColors(n),this}fromLine(t){var e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.");}}Av.prototype.isLineGeometry=!0;class lv extends sv{constructor(t=new Av,e=new Wg({color:16777215*Math.random()})){super(t,e),this.type="Line2";}}lv.prototype.isLine2=!0;class cv extends Ls{constructor(t,e={}){const n=e.font;if(void 0===n)super();else {const r=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),super(r,e);}this.type="TextGeometry";}}function uv(t,e,n,r,i){const a=i.glyphs[t]||i.glyphs["?"];if(!a)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".");const o=new iA;let s,A,l,c,u,h,f,d;if(a.o){const t=a._cachedOutline||(a._cachedOutline=a.o.split(" "));for(let i=0,a=t.length;i<a;){switch(t[i++]){case"m":s=t[i++]*e+n,A=t[i++]*e+r,o.moveTo(s,A);break;case"l":s=t[i++]*e+n,A=t[i++]*e+r,o.lineTo(s,A);break;case"q":l=t[i++]*e+n,c=t[i++]*e+r,u=t[i++]*e+n,h=t[i++]*e+r,o.quadraticCurveTo(u,h,l,c);break;case"b":l=t[i++]*e+n,c=t[i++]*e+r,u=t[i++]*e+n,h=t[i++]*e+r,f=t[i++]*e+n,d=t[i++]*e+r,o.bezierCurveTo(u,h,f,d,l,c);}}}return {offsetX:a.ha*e,path:o}}function hv(t,e,n){return e=bv(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ev(t)}(t,fv()?Reflect.construct(e,n||[],bv(t).constructor):e.apply(t,n))}function fv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));}catch(t){}return (fv=function(){return !!t})()}function dv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r);}return n}function pv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dv(Object(n),!0).forEach((function(e){yv(t,e,n[e]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e));}));}return t}function mv(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:String(e)}function gv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,mv(r.key),r);}}function _v(t,e,n){return e&&vv(t.prototype,e),n&&vv(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function yv(t,e,n){return (e=mv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xv(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mv(t,e);}function bv(t){return bv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bv(t)}function Mv(t,e){return Mv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mv(t,e)}function wv(t,e){if(null==t)return {};var n,r,i=function(t,e){if(null==t)return {};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n]);}return i}function Ev(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Sv(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1;}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t;}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Cv(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tv(t){return function(t){if(Array.isArray(t))return Rv(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Cv(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cv(t,e){if(t){if("string"==typeof t)return Rv(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return "Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rv(t,e):void 0}}function Rv(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Pv(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Dv(t,e,"get"))}function Lv(t,e,n){return function(t,e,n){if(e.set)e.set.call(t,n);else {if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n;}}(t,Dv(t,e,"set"),n),n}function Dv(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Ov(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Iv(t,e,n){Ov(t,e),e.set(t,n);}var qv=function t(e){e instanceof Array?e.forEach(t):(e.map&&e.map.dispose(),e.dispose());},Uv=function t(e){e.geometry&&e.geometry.dispose(),e.material&&qv(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(t);},Nv=function(t){if(t&&t.children)for(;t.children.length;){var e=t.children[0];t.remove(e),Uv(e);}};function Bv(t,e){var n=new e;return {linkProp:function(e){return {default:n[e](),onChange:function(n,r){r[t][e](n);},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var r=n[t],i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=r[e].apply(r,a);return s===r?this:s}}}}var kv=100;function Fv(){return kv}function zv(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180,a=kv*(1+n);return {x:a*Math.sin(r)*Math.cos(i),y:a*Math.cos(r),z:a*Math.sin(r)*Math.sin(i)}}function Gv(t){var e=t.x,n=t.y,r=t.z,i=Math.sqrt(e*e+n*n+r*r),a=Math.acos(n/i),o=Math.atan2(r,e);return {lat:90-180*a/Math.PI,lng:90-180*o/Math.PI-(o<-Math.PI/2?360:0),altitude:i/kv-1}}function Hv(t){return t*Math.PI/180}var jv=window.THREE?window.THREE:{BackSide:g,BufferAttribute:Dn,Color:En,Mesh:sr,ShaderMaterial:dr},Vv="\nuniform vec3 color;\nuniform float coefficient;\nuniform float power;\nvarying vec3 vVertexNormal;\nvarying vec3 vVertexWorldPosition;\nvoid main() {\n  vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;\n  vec3 viewCameraToVertex\t= (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz;\n  viewCameraToVertex = normalize(viewCameraToVertex);\n  float intensity\t= pow(\n    coefficient + dot(vVertexNormal, viewCameraToVertex),\n    power\n  );\n  gl_FragColor = vec4(color, intensity);\n}",Wv="\nvarying vec3 vVertexWorldPosition;\nvarying vec3 vVertexNormal;\nvoid main() {\n  vVertexNormal\t= normalize(normalMatrix * normal);\n  vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n  gl_Position\t= projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",Xv={backside:!0,coefficient:.5,color:"gold",size:2,power:1};function Qv(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xv,n=e.backside,r=e.coefficient,i=e.color,a=e.size,o=e.power,s=function(t,e){for(var n=t.clone(),r=new Float32Array(3*t.attributes.position.count),i=0,a=r.length;i<a;i++){var o=t.attributes.normal.array[i],s=t.attributes.position.array[i];r[i]=s+o*e;}return n.setAttribute("position",new jv.BufferAttribute(r,3)),n}(t,a),A=function(t,e,n){return new jv.ShaderMaterial({depthWrite:!1,fragmentShader:Vv,transparent:!0,uniforms:{coefficient:{value:t},color:{value:new jv.Color(e)},power:{value:n}},vertexShader:Wv})}(r,i,o);return n&&(A.side=jv.BackSide),new jv.Mesh(s,A)}var Yv=window.THREE?window.THREE:{Color:En,LineBasicMaterial:Eo,LineSegments:Io,Mesh:sr,MeshPhongMaterial:class extends Cn{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new En(16777215),this.specular=new En(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new En(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ve,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t);}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}},SphereGeometry:Os,SRGBColorSpace:rt,TextureLoader:Gs},Zv=jA({props:{globeImageUrl:{},bumpImageUrl:{},showGlobe:{default:!0,onChange:function(t,e){e.globeObj.visible=!!t;},triggerUpdate:!1},showGraticules:{default:!1,onChange:function(t,e){e.graticulesObj.visible=!!t;},triggerUpdate:!1},showAtmosphere:{default:!0,onChange:function(t,e){e.atmosphereObj&&(e.atmosphereObj.visible=!!t);},triggerUpdate:!1},atmosphereColor:{default:"lightskyblue"},atmosphereAltitude:{default:.15},onReady:{default:function(){},triggerUpdate:!1}},methods:{globeMaterial:function(t,e){return void 0!==e?(t.globeObj.material=e||t.defaultGlobeMaterial,this):t.globeObj.material},_destructor:function(t){Nv(t.globeObj),Nv(t.graticulesObj);}},stateInit:function(){var t=new Yv.SphereGeometry(kv,75,75),e=new Yv.MeshPhongMaterial({color:0}),n=new Yv.Mesh(t,e);return n.rotation.y=-Math.PI/2,n.__globeObjType="globe",{globeObj:n,graticulesObj:new Yv.LineSegments(new $h(xh(),kv,2),new Yv.LineBasicMaterial({color:"lightgrey",transparent:!0,opacity:.1})),defaultGlobeMaterial:e}},init:function(t,e){Nv(t),e.scene=t,e.scene.add(e.globeObj),e.scene.add(e.graticulesObj),e.ready=!1;},update:function(t,e){var n=t.globeObj.material;if(e.hasOwnProperty("globeImageUrl")&&(t.globeImageUrl?(new Yv.TextureLoader).load(t.globeImageUrl,(function(e){e.colorSpace=Yv.SRGBColorSpace,n.map=e,n.color=null,n.needsUpdate=!0,!t.ready&&(t.ready=!0)&&setTimeout(t.onReady);})):!n.color&&(n.color=new Yv.Color(0))),e.hasOwnProperty("bumpImageUrl")&&(t.bumpImageUrl?t.bumpImageUrl&&(new Yv.TextureLoader).load(t.bumpImageUrl,(function(t){n.bumpMap=t,n.needsUpdate=!0;})):(n.bumpMap=null,n.needsUpdate=!0)),(e.hasOwnProperty("atmosphereColor")||e.hasOwnProperty("atmosphereAltitude"))&&(t.atmosphereObj&&(t.scene.remove(t.atmosphereObj),Nv(t.atmosphereObj)),t.atmosphereColor&&t.atmosphereAltitude)){var r=t.atmosphereObj=Qv(t.globeObj.geometry,{backside:!0,color:t.atmosphereColor,size:kv*t.atmosphereAltitude,power:3.5,coefficient:.1});r.visible=!!t.showAtmosphere,r.__globeObjType="atmosphere",t.scene.add(r);}t.ready||t.globeImageUrl||(t.ready=!0,t.onReady());}}),Kv=function(t){return isNaN(t)?parseInt(Vf(t).toHex(),16):t},Jv=function(t){return t&&isNaN(t)?Sf(t).opacity:1},$v=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=1,a=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.eE+-]+)\s*\)$/.exec(t.trim().toLowerCase());if(a){var o=Sv(a.slice(1),4),s=o[0],A=o[1],l=o[2],c=o[3];e=new En("rgb(".concat(+s,",").concat(+A,",").concat(+l,")")),i=Math.min(+c,1);}else e=new En(t);r&&e.convertLinearToSRGB();var u=e.toArray();return n?[].concat(Tv(u),[i]):u};var t_=window.THREE?window.THREE:{Float32BufferAttribute:qn};function e_(t,e){var n=new(arguments.length>2&&void 0!==arguments[2]?arguments[2]:t_.Float32BufferAttribute)(t.length*e,e);return 1===e?t.forEach((function(t,e){return n.setX(e,t)})):t.forEach((function(t,r){return n.set(t,r*e)})),n}function n_(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).removeDelay,i=void 0===r?0:r;return kd(t,e.children,(function(t){return e.add(t)}),(function(t){var n=function(){e.remove(t),Nv(t),t&&t.hasOwnProperty("__data")&&delete t.__data.__currentTargetD;};i?setTimeout(n,i):n();}),pv({objBindAttr:"__threeObj"},n))}var r_=window.THREE?window.THREE:{BufferGeometry:Hn,Color:En,CylinderGeometry:es,Matrix4:qe,Mesh:sr,MeshLambertMaterial:Us,Object3D:ln,Vector3:ae},i_=Object.assign({},of),a_=i_.BufferGeometryUtils||i_,o_=jA({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:function(){return "#ffffaa"}},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t;},update:function(t){var e=sf(t.pointLat),n=sf(t.pointLng),r=sf(t.pointAltitude),i=sf(t.pointRadius),a=sf(t.pointColor),o=new r_.CylinderGeometry(1,1,1,t.pointResolution);o.applyMatrix4((new r_.Matrix4).makeRotationX(Math.PI/2)),o.applyMatrix4((new r_.Matrix4).makeTranslation(0,0,-.5));var s=2*Math.PI*kv/360,A={},l=t.pointsMerge?new r_.Object3D:t.scene;if(n_(t.pointsData,l,{createObj:function(){var t=new r_.Mesh(o);return t.__globeObjType="point",t},updateObj:function(o,l){var c=function(e){var n=o.__currentTargetD=e,r=n.r,i=n.alt,a=n.lat,A=n.lng;Object.assign(o.position,zv(a,A));var l=t.pointsMerge?new r_.Vector3(0,0,0):t.scene.localToWorld(new r_.Vector3(0,0,0));o.lookAt(l),o.scale.x=o.scale.y=Math.min(30,r)*s,o.scale.z=Math.max(i*kv,.1);},u={alt:+r(l),r:+i(l),lat:+e(l),lng:+n(l)},h=o.__currentTargetD||Object.assign({},u,{alt:-.001});Object.keys(u).some((function(t){return h[t]!==u[t]}))&&(t.pointsMerge||!t.pointsTransitionDuration||t.pointsTransitionDuration<0?c(u):new JA(h).to(u,t.pointsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(c).start());if(!t.pointsMerge){var f=a(l),d=f?Jv(f):0,p=!!d;o.visible=p,p&&(A.hasOwnProperty(f)||(A[f]=new r_.MeshLambertMaterial({color:Kv(f),transparent:d<1,opacity:d})),o.material=A[f]);}}}),t.pointsMerge){var c=t.pointsData.length?(a_.mergeGeometries||a_.mergeBufferGeometries)(t.pointsData.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.clone();e.updateMatrix(),n.applyMatrix4(e.matrix);var r=$v(a(t));return n.setAttribute("color",e_(Tv(new Array(n.getAttribute("position").count)).map((function(){return r})),4)),n}))):new r_.BufferGeometry,u=new r_.Mesh(c,new r_.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0}));u.__globeObjType="points",u.__data=t.pointsData,Nv(t.scene),t.scene.add(u);}}}),s_=["stroke"],A_=window.THREE?window.THREE:{BufferGeometry:Hn,CubicBezierCurve3:Wo,Curve:qo,Group:co,Line:Lo,Mesh:sr,NormalBlending:1,QuadraticBezierCurve3:Yo,ShaderMaterial:dr,TubeGeometry:Is,Vector3:ae},l_=zd.default||zd,c_={uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n    uniform float dashTranslate; \n\n    attribute vec4 vertexColor;\n    varying vec4 vColor;\n    \n    attribute float vertexRelDistance;\n    varying float vRelDistance;\n\n    void main() {\n      // pass through colors and distances\n      vColor = vertexColor;\n      vRelDistance = vertexRelDistance + dashTranslate;\n      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n    }\n  ",fragmentShader:"\n    uniform float dashOffset; \n    uniform float dashSize;\n    uniform float gapSize; \n    \n    varying vec4 vColor;\n    varying float vRelDistance;\n    \n    void main() {\n      // ignore pixels in the gap\n      if (vRelDistance < dashOffset) discard;\n      if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n    \n      // set px color: [r, g, b, a], interpolated between vertices \n      gl_FragColor = vColor; \n    }\n  "},u_=jA({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcColor:{default:function(){return "#ffffaa"}},arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcDashLength:{default:1},arcDashGap:{default:0},arcDashInitialGap:{default:0},arcDashAnimateTime:{default:0},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause();},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume();},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose();}},init:function(t,e){Nv(t),e.scene=t,e.ticker=new l_,e.ticker.onTick.add((function(t,n){e.arcsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],r=e.__dashAnimateStep*n,i=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=i+r;}));}));},update:function(t){var e=sf(t.arcStartLat),n=sf(t.arcStartLng),r=sf(t.arcEndLat),i=sf(t.arcEndLng),a=sf(t.arcAltitude),o=sf(t.arcAltitudeAutoScale),s=sf(t.arcStroke),A=sf(t.arcColor),l=sf(t.arcDashLength),c=sf(t.arcDashGap),u=sf(t.arcDashInitialGap),h=sf(t.arcDashAnimateTime),f=new A_.ShaderMaterial(pv(pv({},c_),{},{transparent:!0,blending:A_.NormalBlending}));n_(t.arcsData,t.scene,{createObj:function(){var t=new A_.Group;return t.__globeObjType="arc",t},updateObj:function(d,p){var m=s(p),g=null!=m;if(!d.children.length||g!==("Mesh"===d.children[0].type)){Nv(d);var v=g?new A_.Mesh:new A_.Line(new A_.BufferGeometry);v.material=f.clone(),d.add(v);}var _=d.children[0];Object.assign(_.material.uniforms,{dashSize:{value:l(p)},gapSize:{value:c(p)},dashOffset:{value:u(p)}});var y=h(p);_.__dashAnimateStep=y>0?1e3/y:0;var x=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=e+1;if(t instanceof Array||t instanceof Function){var a=t instanceof Array?Rp().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return $v(a(t),!0,!0)};}else {var o=$v(t,!0,!0);n=function(){return o};}for(var s=[],A=0,l=i;A<l;A++)for(var c=n(A/(l-1)),u=0;u<r;u++)s.push(c);return e_(s,4)}(A(p),t.arcCurveResolution,g?t.arcCircularResolution+1:1),b=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,a=t+1;i<a;i++)for(var o=i/(a-1),s=0;s<e;s++)r.push(o);return n&&r.reverse(),e_(r,1)}(t.arcCurveResolution,g?t.arcCircularResolution+1:1,!0);_.geometry.setAttribute("vertexColor",x),_.geometry.setAttribute("vertexRelDistance",b);var M=function(e){var n=p.__currentTargetD=e,r=n.stroke,i=function(t){var e=t.alt,n=t.altAutoScale,r=t.startLat,i=t.startLng,a=t.endLat,o=t.endLng,s=function(t){var e=Sv(t,3),n=e[0],r=zv(e[1],n,e[2]),i=r.x,a=r.y,o=r.z;return new A_.Vector3(i,a,o)},A=[i,r],l=[o,a],c=e;if(null==c&&(c=ch(A,l)/2*n),c){var u=bh(A,l),h=Sv([.25,.75].map((function(t){return [].concat(Tv(u(t)),[1.5*c])})),2),f=h[0],d=h[1],p=function(t,e,n){if(fv())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Mv(i,n.prototype),i}(A_.CubicBezierCurve3,Tv([A,f,d,l].map(s)));return p}var m=.001;return g.apply(void 0,Tv([[].concat(A,[m]),[].concat(l,[m])].map(s)));function g(t,e){var n=t.angleTo(e),r=0===n?function(){return t.clone()}:function(r){return (new A_.Vector3).addVectors(t.clone().multiplyScalar(Math.sin((1-r)*n)),e.clone().multiplyScalar(Math.sin(r*n))).divideScalar(Math.sin(n))},i=new A_.Curve;return i.getPoint=r,i}}(wv(n,s_));g?(_.geometry&&_.geometry.dispose(),_.geometry=new A_.TubeGeometry(i,t.arcCurveResolution,r/2,t.arcCircularResolution),_.geometry.setAttribute("vertexColor",x),_.geometry.setAttribute("vertexRelDistance",b)):_.geometry.setFromPoints(i.getPoints(t.arcCurveResolution));},w={stroke:m,alt:a(p),altAutoScale:+o(p),startLat:+e(p),startLng:+n(p),endLat:+r(p),endLng:+i(p)},E=p.__currentTargetD||Object.assign({},w,{altAutoScale:-.001});Object.keys(w).some((function(t){return E[t]!==w[t]}))&&(!t.arcsTransitionDuration||t.arcsTransitionDuration<0?M(w):new JA(E).to(w,t.arcsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(M).start());}});}}),h_=window.THREE?window.THREE:{BufferGeometry:Hn,Color:En,DoubleSide:2,Mesh:sr,MeshLambertMaterial:Us,Object3D:ln},f_=Object.assign({},of),d_=f_.BufferGeometryUtils||f_,p_=jA({props:{hexBinPointsData:{default:[]},hexBinPointLat:{default:"lat"},hexBinPointLng:{default:"lng"},hexBinPointWeight:{default:1},hexBinResolution:{default:4},hexMargin:{default:.2},hexTopCurvatureResolution:{default:5},hexTopColor:{default:function(){return "#ffffaa"}},hexSideColor:{default:function(){return "#ffffaa"}},hexAltitude:{default:function(t){return .01*t.sumWeight}},hexBinMerge:{default:!1},hexTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t;},update:function(t){var e=sf(t.hexBinPointLat),n=sf(t.hexBinPointLng),r=sf(t.hexBinPointWeight),i=sf(t.hexAltitude),a=sf(t.hexTopColor),o=sf(t.hexSideColor),s=sf(t.hexMargin),A=Rd(t.hexBinPointsData.map((function(r){return pv(pv({},r),{},{h3Idx:Mg(e(r),n(r),t.hexBinResolution)})})),"h3Idx"),l=Object.entries(A).map((function(t){var e=Sv(t,2),n=e[0],i=e[1];return {h3Idx:n,points:i,sumWeight:i.reduce((function(t,e){return t+ +r(e)}),0)}})),c={};if(n_(l,t.hexBinMerge?new h_.Object3D:t.scene,{createObj:function(t){var e=new h_.Mesh;e.__hexCenter=wg(t.h3Idx),e.__hexGeoJson=Eg(t.h3Idx,!0).reverse();var n=e.__hexCenter[1];return e.__hexGeoJson.forEach((function(t){var e=t[0];Math.abs(n-e)>170&&(t[0]+=n>e?360:-360);})),e.__globeObjType="hexbin",e},updateObj:function(e,n){var r=Math.max(0,Math.min(1,+s(n))),A=Sv(e.__hexCenter,2),l=A[0],u=A[1],h=0===r?e.__hexGeoJson:e.__hexGeoJson.map((function(t){var e=Sv(t,2),n=e[0],i=e[1];return [[n,u],[i,l]].map((function(t){var e=Sv(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],r)}))})),f=t.hexTopCurvatureResolution;e.geometry&&e.geometry.dispose(),e.geometry=new jm([h],0,kv,!1,!0,!0,f);var d={alt:+i(n)},p=function(t){var n=(e.__currentTargetD=t).alt;e.scale.x=e.scale.y=e.scale.z=1+n;},m=e.__currentTargetD||Object.assign({},d,{alt:-.001});Object.keys(d).some((function(t){return m[t]!==d[t]}))&&(t.hexBinMerge||!t.hexTransitionDuration||t.hexTransitionDuration<0?p(d):new JA(m).to(d,t.hexTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(p).start());if(!t.hexBinMerge){var g=o(n),v=a(n);[g,v].forEach((function(t){if(!c.hasOwnProperty(t)){var e=Jv(t);c[t]=new h_.MeshLambertMaterial({color:Kv(t),transparent:e<1,opacity:e,side:h_.DoubleSide});}})),e.material=[g,v].map((function(t){return c[t]}));}},idAccessor:function(t){return t.h3Idx}}),t.hexBinMerge){var u=l.length?(d_.mergeGeometries||d_.mergeBufferGeometries)(l.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.toNonIndexed();e.updateMatrix(),n.applyMatrix4(e.matrix);var r=$v(a(t)),i=$v(o(t)),s=n.getAttribute("position").count,A=n.groups[0].count;return n.setAttribute("color",e_(Tv(new Array(s)).map((function(t,e){return e>=A?r:i})),4)),n}))):new h_.BufferGeometry,h=new h_.Mesh(u,new h_.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0,side:h_.DoubleSide}));h.__globeObjType="hexBinPoints",h.__data=l,Nv(t.scene),t.scene.add(h);}}}),m_=function(t){return t*t};var g_=Math.sqrt(2*Math.PI);var v_=function(t){var e=Sv(t,2),n=e[0],r=e[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=a.lngAccessor,s=void 0===o?function(t){return t[0]}:o,A=a.latAccessor,l=void 0===A?function(t){return t[1]}:A,c=a.weightAccessor,u=void 0===c?function(){return 1}:c,h=a.bandwidth,f=[n,r],d=h*Math.PI/180;return function(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else {let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i);}return n}(i.map((function(t){var e=u(t);if(!e)return 0;var n,r,i=function(t,e){var n=Math.sqrt,r=Math.cos,i=function(t){return t*Math.PI/180},a=function(t){return m_(Math.sin(t/2))},o=i(t[1]),s=i(e[1]),A=i(t[0]),l=i(e[0]);return 2*Math.asin(n(a(s-o)+r(o)*r(s)*a(l-A)))}(f,[s(t),l(t)]);return n=i,r=d,Math.exp(-m_(n/r)/2)/(r*g_)*e})))},__=window.THREE?window.THREE:{Mesh:sr,MeshLambertMaterial:Us,SphereGeometry:Os},y_=new WeakSet,x_=new WeakMap,b_=new WeakMap,M_=new WeakMap,w_=function(){function t(e,n){var r,i;gv(this,t),Ov(r=this,i=y_),i.add(r),Iv(this,x_,{writable:!0,value:void 0}),Iv(this,b_,{writable:!0,value:void 0}),Iv(this,M_,{writable:!0,value:void 0}),Lv(this,x_,e),Lv(this,b_,kg()),Pv(this,b_).init(e.map((function(t){return [t.x,t.y,t.z]})).flat()),Lv(this,M_,function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,y_,E_).call(this,zv(0,0),zv(0,Math.min(180,n))));}return _v(t,[{key:"getNearPoints",value:function(t,e,n){var r=this;return Pv(this,b_).intersectSphere(t,e,n,Pv(this,M_)).map((function(t){return Pv(r,x_)[t/3]}))}}]),t}();function E_(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)+Math.pow(t.z-e.z,2))}var S_=function(t){var e=Sf(function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}(t));return e.opacity=Math.cbrt(t),e.formatRgb()},T_=jA({props:{heatmapsData:{default:[]},heatmapPoints:{default:function(t){return t}},heatmapPointLat:{default:function(t){return t[0]}},heatmapPointLng:{default:function(t){return t[1]}},heatmapPointWeight:{default:1},heatmapBandwidth:{default:4},heatmapColorFn:{default:function(){return S_}},heatmapColorSaturation:{default:1.5},heatmapBaseAltitude:{default:.01},heatmapTopAltitude:{},heatmapsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t;},update:function(t){var e=sf(t.heatmapPoints),n=sf(t.heatmapPointLat),r=sf(t.heatmapPointLng),i=sf(t.heatmapPointWeight),a=sf(t.heatmapBandwidth),o=sf(t.heatmapColorFn),s=sf(t.heatmapColorSaturation),A=sf(t.heatmapBaseAltitude),l=sf(t.heatmapTopAltitude);n_(t.heatmapsData,t.scene,{createObj:function(t){var e=new __.Mesh(new __.SphereGeometry(kv),new __.MeshLambertMaterial({vertexColors:!0,transparent:!0}));return e.__globeObjType="heatmap",e},updateObj:function(c,u){var h=a(u),f=o(u),d=s(u),p=A(u),m=l(u),g=e(u).map((function(t){var e=n(t),a=r(t),o=zv(e,a);return {x:o.x,y:o.y,z:o.z,lat:e,lng:a,weight:i(t)}})),v=Math.max(.1,h/3.5),_=Math.ceil(360/(v||-1));c.geometry.parameters.widthSegments!==_&&(c.geometry.dispose(),c.geometry=new __.SphereGeometry(kv,_,_/2));var y=function(t){for(var e=t.itemSize,n=[],r=0;r<t.count;r++)n.push(t.array.slice(r*e,(r+1)*e));return n}(c.geometry.getAttribute("position")),x=y.map((function(t){var e=Sv(t,3),n=Gv({x:e[0],y:e[1],z:e[2]});return [n.lng,n.lat]})),b=new w_(g,3.5*h),M=x.map((function(t,e){var n=Sv(y[e],3),r=n[0],i=n[1],a=n[2];return v_(t,b.getNearPoints(r,i,a),{latAccessor:function(t){return t.lat},lngAccessor:function(t){return t.lng},weightAccessor:function(t){return t.weight},bandwidth:h})})),w=function(t){var e=c.__currentTargetD=t,n=e.kdeVals,r=e.topAlt,i=e.saturation,a=function(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else {let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i);}return n}(n.map(Math.abs))||1e-15;c.geometry.setAttribute("color",e_(n.map((function(t){return $v(f(t/a*i))})),4));var o=Rp([0,a],[p,r||p]);c.geometry.setAttribute("position",e_(n.map((function(t,e){var n=Sv(x[e],2),r=n[0],i=zv(n[1],r,o(Math.abs(t)));return [i.x,i.y,i.z]})),3));},E={kdeVals:M,topAlt:m,saturation:d},S=c.__currentTargetD||Object.assign({},E,{kdeVals:M.map((function(){return 0})),topAlt:m?p:m,saturation:.5});S.kdeVals.length!==M.length&&(S.kdeVals=M.slice()),Object.keys(E).some((function(t){return S[t]!==E[t]}))&&(!t.heatmapsTransitionDuration||t.heatmapsTransitionDuration<0?w(E):new JA(S).to(E,t.heatmapsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(w).start());}});}}),C_=window.THREE?window.THREE:{DoubleSide:2,Group:co,LineBasicMaterial:Eo,LineSegments:Io,Mesh:sr,MeshBasicMaterial:Rn},R_=jA({props:{polygonsData:{default:[]},polygonGeoJsonGeometry:{default:"geometry"},polygonSideColor:{default:function(){return "#ffffaa"}},polygonSideMaterial:{},polygonCapColor:{default:function(){return "#ffffaa"}},polygonCapMaterial:{},polygonStrokeColor:{},polygonAltitude:{default:.01},polygonCapCurvatureResolution:{default:5},polygonsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t;},update:function(t){var e=sf(t.polygonGeoJsonGeometry),n=sf(t.polygonAltitude),r=sf(t.polygonCapCurvatureResolution),i=sf(t.polygonCapColor),a=sf(t.polygonCapMaterial),o=sf(t.polygonSideColor),s=sf(t.polygonSideMaterial),A=sf(t.polygonStrokeColor),l=[];t.polygonsData.forEach((function(t){var c={data:t,capColor:i(t),capMaterial:a(t),sideColor:o(t),sideMaterial:s(t),strokeColor:A(t),altitude:+n(t),capCurvatureResolution:+r(t)},u=e(t),h=t.__id||"".concat(Math.round(1e9*Math.random()));t.__id=h,"Polygon"===u.type?l.push(pv({id:"".concat(h,"_0"),coords:u.coordinates},c)):"MultiPolygon"===u.type?l.push.apply(l,Tv(u.coordinates.map((function(t,e){return pv({id:"".concat(h,"_").concat(e),coords:t},c)})))):console.warn("Unsupported GeoJson geometry type: ".concat(u.type,". Skipping geometry..."));})),n_(l,t.scene,{idAccessor:function(t){return t.id},createObj:function(){var t=new C_.Group;return t.__defaultSideMaterial=new C_.MeshBasicMaterial({side:C_.DoubleSide,depthWrite:!0}),t.__defaultCapMaterial=new C_.MeshBasicMaterial({side:C_.DoubleSide,depthWrite:!0}),t.add(new C_.Mesh(void 0,[t.__defaultSideMaterial,t.__defaultCapMaterial])),t.add(new C_.LineSegments(void 0,new C_.LineBasicMaterial)),t.__globeObjType="polygon",t},updateObj:function(e,n){var r=n.coords,i=n.capColor,a=n.capMaterial,o=n.sideColor,s=n.sideMaterial,A=n.strokeColor,l=n.altitude,c=n.capCurvatureResolution,u=Sv(e.children,2),h=u[0],f=u[1],d=!!A;if(f.visible=d,function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return function(t,e){return t===e}};return Object.entries(e).every((function(e){var r=Sv(e,2),i=r[0],a=r[1];return t.hasOwnProperty(i)&&n(i)(t[i],a)}))}(h.geometry.parameters||{},{polygonGeoJson:r,curvatureResolution:c})||(h.geometry&&h.geometry.dispose(),h.geometry=new jm(r,0,kv,!1,!0,!0,c)),!d||f.geometry.parameters&&f.geometry.parameters.geoJson.coordinates===r&&f.geometry.parameters.resolution===c||(f.geometry&&f.geometry.dispose(),f.geometry=new $h({type:"Polygon",coordinates:r},kv,c)),h.material[0]=s||e.__defaultSideMaterial,h.material[1]=a||e.__defaultCapMaterial,[!s&&o,!a&&i].forEach((function(t,e){if(t){var n=h.material[e],r=Jv(t);n.color.set(Kv(t)),n.transparent=r<1,n.opacity=r;}})),d){var p=f.material,m=Jv(A);p.color.set(Kv(A)),p.transparent=m<1,p.opacity=m;}var g={alt:l},v=function(t){var n=(e.__currentTargetD=t).alt;h.scale.x=h.scale.y=h.scale.z=1+n,d&&(f.scale.x=f.scale.y=f.scale.z=1+n+1e-4);},_=e.__currentTargetD||Object.assign({},g,{alt:-.001});Object.keys(g).some((function(t){return _[t]!==g[t]}))&&(!t.polygonsTransitionDuration||t.polygonsTransitionDuration<0||_.alt===g.alt?v(g):new JA(_).to(g,t.polygonsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(v).start());}});}});var P_=window.THREE?window.THREE:{BufferGeometry:Hn,CircleGeometry:ts,DoubleSide:2,Mesh:sr,MeshLambertMaterial:Us,Vector3:ae},L_=Object.assign({},of),D_=L_.BufferGeometryUtils||L_,O_=jA({props:{hexPolygonsData:{default:[]},hexPolygonGeoJsonGeometry:{default:"geometry"},hexPolygonColor:{default:function(){return "#ffffaa"}},hexPolygonAltitude:{default:.001},hexPolygonResolution:{default:3},hexPolygonMargin:{default:.2},hexPolygonUseDots:{default:!1},hexPolygonCurvatureResolution:{default:5},hexPolygonDotResolution:{default:12},hexPolygonsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t;},update:function(t){var e=sf(t.hexPolygonGeoJsonGeometry),n=sf(t.hexPolygonColor),r=sf(t.hexPolygonAltitude),i=sf(t.hexPolygonResolution),a=sf(t.hexPolygonMargin),o=sf(t.hexPolygonUseDots),s=sf(t.hexPolygonCurvatureResolution),A=sf(t.hexPolygonDotResolution);n_(t.hexPolygonsData,t.scene,{createObj:function(t){var e=new P_.Mesh(void 0,new P_.MeshLambertMaterial({side:P_.DoubleSide}));return e.__globeObjType="hexPolygon",e},updateObj:function(l,c){var u=e(c),h=i(c),f=r(c),d=Math.max(0,Math.min(1,+a(c))),p=o(c),m=s(c),g=A(c),v=n(c),_=Jv(v);l.material.color.set(Kv(v)),l.material.transparent=_<1,l.material.opacity=_;var y={alt:f,margin:d,curvatureResolution:m},x={geoJson:u,h3Res:h},b=l.__currentTargetD||Object.assign({},y,{alt:-.001}),M=l.__currentMemD||x;if(Object.keys(y).some((function(t){return b[t]!==y[t]}))||Object.keys(x).some((function(t){return M[t]!==x[t]}))){l.__currentMemD=x;var w=[];"Polygon"===u.type?Sg(u.coordinates,h,!0).forEach((function(t){return w.push(t)})):"MultiPolygon"===u.type?u.coordinates.forEach((function(t){return Sg(t,h,!0).forEach((function(t){return w.push(t)}))})):console.warn("Unsupported GeoJson geometry type: ".concat(u.type,". Skipping geometry..."));var E=w.map((function(t){var e=wg(t),n=Eg(t,!0).reverse(),r=e[1];return n.forEach((function(t){var e=t[0];Math.abs(r-e)>170&&(t[0]+=r>e?360:-360);})),{h3Idx:t,hexCenter:e,hexGeoJson:n}})),S=function(t){var e=l.__currentTargetD=t,n=e.alt,r=e.margin,i=e.curvatureResolution;l.geometry&&l.geometry.dispose(),l.geometry=E.length?(D_.mergeGeometries||D_.mergeBufferGeometries)(E.map((function(t){var e=Sv(t.hexCenter,2),a=e[0],o=e[1];if(p){var s=zv(a,o,n),A=zv(t.hexGeoJson[0][1],t.hexGeoJson[0][0],n),l=.85*(1-r)*new P_.Vector3(s.x,s.y,s.z).distanceTo(new P_.Vector3(A.x,A.y,A.z)),c=new ts(l,g);return c.rotateX(Hv(-a)),c.rotateY(Hv(o)),c.translate(s.x,s.y,s.z),c}var u=0===r?t.hexGeoJson:t.hexGeoJson.map((function(t){var e=Sv(t,2),n=e[0],i=e[1];return [[n,o],[i,a]].map((function(t){var e=Sv(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],r)}))}));return new jm([u],kv,kv*(1+n),!1,!0,!1,i)}))):new P_.BufferGeometry;};!t.hexPolygonsTransitionDuration||t.hexPolygonsTransitionDuration<0?S(y):new JA(b).to(y,t.hexPolygonsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(S).start();}}});}}),I_=window.THREE?window.THREE:{Vector3:ae};function q_(t,e){var n=Math.max(t.length,e.length),r=Yd.apply(void 0,Tv([t,e].map((function(t){return t.map((function(t){return [t.x,t.y,t.z]}))})).map((function(t){return function(t,e){var n=t[t.length-1];return [].concat(Tv(t),Tv(Tv(new Array(e-t.length)).map((function(){return n}))))}(t,n)}))));return function(n){return 0===n?t:1===n?e:r(n).map((function(t){var e=Sv(t,3),n=e[0],r=e[1],i=e[2];return new I_.Vector3(n,r,i)}))}}var U_=window.THREE?window.THREE:{BufferGeometry:Hn,Color:En,Group:co,Line:Lo,NormalBlending:1,ShaderMaterial:dr,Vector3:ae},N_=zd.default||zd,B_={uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n    uniform float dashTranslate;\n\n    attribute vec4 vertexColor;\n    varying vec4 vColor;\n\n    attribute float vertexRelDistance;\n    varying float vRelDistance;\n\n    void main() {\n      // pass through colors and distances\n      vColor = vertexColor;\n      vRelDistance = vertexRelDistance + dashTranslate;\n      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n    }\n  ",fragmentShader:"\n    uniform float dashOffset;\n    uniform float dashSize;\n    uniform float gapSize;\n\n    varying vec4 vColor;\n    varying float vRelDistance;\n\n    void main() {\n      // ignore pixels in the gap\n      if (vRelDistance < dashOffset) discard;\n      if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n\n      // set px color: [r, g, b, a], interpolated between vertices\n      gl_FragColor = vColor;\n    }\n  "},k_=jA({props:{pathsData:{default:[]},pathPoints:{default:function(t){return t}},pathPointLat:{default:function(t){return t[0]}},pathPointLng:{default:function(t){return t[1]}},pathPointAlt:{default:.001},pathResolution:{default:2},pathColor:{default:function(){return "#ffffaa"}},pathStroke:{},pathDashLength:{default:1},pathDashGap:{default:0},pathDashInitialGap:{default:0},pathDashAnimateTime:{default:0},pathTransitionDuration:{default:1e3,triggerUpdate:!1},rendererSize:{}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause();},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume();},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose();}},init:function(t,e){Nv(t),e.scene=t,e.ticker=new N_,e.ticker.onTick.add((function(t,n){e.pathsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],r=e.__dashAnimateStep*n;if("Line"===e.type){var i=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=i+r;}else if("Line2"===e.type){for(var a=e.material.dashOffset-r,o=e.material.dashSize+e.material.gapSize;a<=-o;)a+=o;e.material.dashOffset=a;}}));}));},update:function(t){var e=sf(t.pathPoints),n=sf(t.pathPointLat),r=sf(t.pathPointLng),i=sf(t.pathPointAlt),a=sf(t.pathStroke),o=sf(t.pathColor),s=sf(t.pathDashLength),A=sf(t.pathDashGap),l=sf(t.pathDashInitialGap),c=sf(t.pathDashAnimateTime),u=new U_.ShaderMaterial(pv(pv({},B_),{},{transparent:!0,blending:U_.NormalBlending}));function h(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=e+1;if(t instanceof Array||t instanceof Function){var o=t instanceof Array?Rp().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return $v(o(t),i,!0)};}else {var s=$v(t,i,!0);n=function(){return s};}for(var A=[],l=0,c=a;l<c;l++)for(var u=n(l/(c-1)),h=0;h<r;h++)A.push(u);return e_(A,i?4:3)}n_(t.pathsData,t.scene,{createObj:function(){var t=new U_.Group;return t.__globeObjType="path",t},updateObj:function(f,d){var p=a(d),m=null!=p;if(!f.children.length||m===("Line"===f.children[0].type)){Nv(f);var g=m?new lv(new Av,new Wg):new U_.Line(new U_.BufferGeometry,u.clone());f.add(g);}var v,_,y=f.children[0],x=function(t,e,n,r,i){var a=function(t,e,n){for(var r=[],i=1;i<=n;i++)r.push(t+(e-t)*i/(n+1));return r},o=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],n=null;return (arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){for(;Math.abs(n[1]-r[1])>180;)n[1]+=360*(n[1]<r[1]?1:-1);var i=Math.sqrt(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2));if(i>t)for(var o=Math.floor(i/t),s=a(n[0],r[0],o),A=a(n[1],r[1],o),l=a(n[2],r[2],o),c=0,u=s.length;c<u;c++)e.push([s[c],A[c],l[c]]);}e.push(n=r);})),e},s=function(t){var e=Sv(t,3),n=zv(e[0],e[1],e[2]),r=n.x,i=n.y,a=n.z;return new U_.Vector3(r,i,a)};return o(t.map((function(t){return [e(t),n(t),r(t)]})),i).map(s)}(e(d),n,r,i,t.pathResolution),b=c(d);if(y.__dashAnimateStep=b>0?1e3/b:0,m){y.material.resolution=t.rendererSize;var M=s(d),w=A(d),E=l(d);y.material.dashed=w>0,y.material.dashed?y.material.defines.USE_DASH="":delete y.material.defines.USE_DASH,y.material.dashed&&(y.material.dashScale=1/(_=0,x.forEach((function(t){v&&(_+=v.distanceTo(t)),v=t;})),_),y.material.dashSize=M,y.material.gapSize=w,y.material.dashOffset=-E);var S=o(d);if(S instanceof Array){var T=h(o(d),x.length-1,1,!1);y.geometry.setColors(T.array),y.material.vertexColors=!0;}else {var C=S,R=Jv(C);y.material.color=new U_.Color(Kv(C)),y.material.transparent=R<1,y.material.opacity=R,y.material.vertexColors=!1;}y.material.needsUpdate=!0;}else {Object.assign(y.material.uniforms,{dashSize:{value:s(d)},gapSize:{value:A(d)},dashOffset:{value:l(d)}});var P=h(o(d),x.length),L=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,a=t+1;i<a;i++)for(var o=i/(a-1),s=0;s<e;s++)r.push(o);return n&&r.reverse(),e_(r,1)}(x.length,1,!0);y.geometry.setAttribute("vertexColor",P),y.geometry.setAttribute("vertexRelDistance",L);}var D=q_(d.__currentTargetD&&d.__currentTargetD.points||[x[0]],x),O=function(t){var e,n=d.__currentTargetD=t,r=n.stroke,i=n.interpolK,a=d.__currentTargetD.points=D(i);m?(y.geometry.setPositions((e=[]).concat.apply(e,Tv(a.map((function(t){return [t.x,t.y,t.z]}))))),y.material.linewidth=r,y.material.dashed&&y.computeLineDistances()):(y.geometry.setFromPoints(a),y.geometry.computeBoundingSphere());},I={stroke:p,interpolK:1},q=Object.assign({},d.__currentTargetD||I,{interpolK:0});Object.keys(I).some((function(t){return q[t]!==I[t]}))&&(!t.pathTransitionDuration||t.pathTransitionDuration<0?O(I):new JA(q).to(I,t.pathTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(O).start());}});}}),F_=window.THREE?window.THREE:{Euler:Ve,Mesh:sr,MeshLambertMaterial:Us,SphereGeometry:Os},z_=jA({props:{tilesData:{default:[]},tileLat:{default:"lat"},tileLng:{default:"lng"},tileAltitude:{default:.01},tileWidth:{default:1},tileHeight:{default:1},tileUseGlobeProjection:{default:!0},tileMaterial:{default:function(){return new F_.MeshLambertMaterial({color:"#ffbb88",opacity:.4,transparent:!0})}},tileCurvatureResolution:{default:5},tilesTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t;},update:function(t){var e=sf(t.tileLat),n=sf(t.tileLng),r=sf(t.tileAltitude),i=sf(t.tileWidth),a=sf(t.tileHeight),o=sf(t.tileUseGlobeProjection),s=sf(t.tileMaterial),A=sf(t.tileCurvatureResolution);n_(t.tilesData,t.scene,{createObj:function(){var t=new F_.Mesh;return t.__globeObjType="tile",t},updateObj:function(l,c){l.material=s(c);var u=o(c),h=A(c),f=function(t){var e=l.__currentTargetD=t,n=e.lat,r=e.lng,i=e.alt,a=e.width,o=e.height,s=G_(r),A=G_(-n);l.geometry&&l.geometry.dispose(),l.geometry=new F_.SphereGeometry(kv*(1+i),Math.ceil(a/(h||-1)),Math.ceil(o/(h||-1)),G_(90-a/2)+(u?s:0),G_(a),G_(90-o/2)+(u?A:0),G_(o)),u||l.setRotationFromEuler(new F_.Euler(A,s,0,"YXZ"));},d={lat:+e(c),lng:+n(c),alt:+r(c),width:+i(c),height:+a(c)},p=l.__currentTargetD||Object.assign({},d,{width:0,height:0});Object.keys(d).some((function(t){return p[t]!==d[t]}))&&(!t.tilesTransitionDuration||t.tilesTransitionDuration<0?f(d):new JA(p).to(d,t.tilesTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(f).start());}});}}),G_=function(t){return t*Math.PI/180},H_={glyphs:{0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},"ο":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},"Τ":{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},"Π":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},"ΐ":{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"–":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},"Κ":{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},"ƒ":{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},"ό":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},"ώ":{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "},"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"∙":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"ÿ":{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},"µ":{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},"Ι":{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},"Ύ":{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"’":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"Ν":{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},"ς":{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},"Ψ":{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "},"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},"ι":{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},"Ά":{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},"ε":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},"Δ":{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"‰":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"—":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},"ρ":{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},"Η":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"Α":{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"…":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"ν":{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},"β":{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644 603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},"Μ":{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},"Ό":{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ή":{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"•":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},"γ":{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},"α":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"­":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"Χ":{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"†":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},"Ξ":{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},"Ϋ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"”":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},"Ί":{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},"Β":{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},"υ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "},"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},"χ":{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},"ί":{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},"Ζ":{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"‹":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"„":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},"δ":{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},"έ":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},"ω":{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"ϋ":{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},"Ω":{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},"ύ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"™":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},"ή":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},"Θ":{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 280 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},"Ε":{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},"σ":{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},"ζ":{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},"θ":{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},"Ο":{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},"Γ":{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},"Έ":{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ώ":{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},"Ϊ":{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},"Ρ":{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"ª":{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"΅":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},"Φ":{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"⁋":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},"Σ":{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"›":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},"λ":{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},"τ":{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 436 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},"ξ":{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},"Λ":{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},"ΰ":{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"Υ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},"μ":{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"φ":{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"“":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"‘":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},"ϊ":{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257 -5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},"π":{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},"ά":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "},"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},"κ":{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"‡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},"ψ":{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},"η":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}},cssFontWeight:"normal",ascender:1189,underlinePosition:-100,cssFontStyle:"normal",boundingBox:{yMin:-334,xMin:-111,yMax:1189,xMax:1672},resolution:1e3,original_font_information:{postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Μagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Μagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:'Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r\n\r\nThe above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.',manufacturer_name:"Μagenta ltd",font_sub_family_name:"Regular"},descender:-334,familyName:"Helvetiker",lineHeight:1522,underlineThickness:50},j_=pv(pv({},window.THREE?window.THREE:{CircleGeometry:ts,DoubleSide:2,Group:co,Mesh:sr,MeshLambertMaterial:Us,TextGeometry:cv,Vector3:ae}),{},{Font:class{constructor(t){this.isFont=!0,this.type="Font",this.data=t;}generateShapes(t,e=100){const n=[],r=function(t,e,n){const r=Array.from(t),i=e/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[];let s=0,A=0;for(let t=0;t<r.length;t++){const e=r[t];if("\n"===e)s=0,A-=a;else {const t=uv(e,i,s,A,n);s+=t.offsetX,o.push(t.path);}}return o}(t,e,this.data);for(let t=0,e=r.length;t<e;t++)n.push(...r[t].toShapes());return n}},TextGeometry:cv}),V_=jA({props:{labelsData:{default:[]},labelLat:{default:"lat"},labelLng:{default:"lng"},labelAltitude:{default:0},labelText:{default:"text"},labelSize:{default:.5},labelTypeFace:{default:H_,onChange:function(t,e){e.font=new j_.Font(t);}},labelColor:{default:function(){return "lightgrey"}},labelRotation:{default:0},labelResolution:{default:3},labelIncludeDot:{default:!0},labelDotRadius:{default:.1},labelDotOrientation:{default:function(){return "bottom"}},labelsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t;},update:function(t){var e=sf(t.labelLat),n=sf(t.labelLng),r=sf(t.labelAltitude),i=sf(t.labelText),a=sf(t.labelSize),o=sf(t.labelRotation),s=sf(t.labelColor),A=sf(t.labelIncludeDot),l=sf(t.labelDotRadius),c=sf(t.labelDotOrientation),u=new Set(["right","top","bottom"]),h=2*Math.PI*kv/360,f=new j_.CircleGeometry(1,16);n_(t.labelsData,t.scene,{createObj:function(){var t=new j_.MeshLambertMaterial;t.side=2;var e=new j_.Group;return e.add(new j_.Mesh(f,t)),e.add(new j_.Mesh(void 0,t)),e.__globeObjType="label",e},updateObj:function(f,d){var p=Sv(f.children,2),m=p[0],g=p[1],v=s(d),_=Jv(v);g.material.color.set(Kv(v)),g.material.transparent=_<1,g.material.opacity=_;var y=A(d),x=c(d);!y||!u.has(x)&&(x="bottom");var b=y?+l(d)*h:1e-12;m.scale.x=m.scale.y=b;var M=+a(d)*h;if(g.geometry&&g.geometry.dispose(),g.geometry=new j_.TextGeometry(i(d),{font:t.font,size:M,height:0,curveSegments:t.labelResolution}),"right"!==x&&g.geometry.center(),y){var w=b+M/2;"right"===x&&(g.position.x=w),g.position.y={right:-M/2,top:w+M/2,bottom:-w-M/2}[x];}var E=function(e){var n=f.__currentTargetD=e,r=n.lat,i=n.lng,a=n.alt,o=n.rot,s=n.scale;Object.assign(f.position,zv(r,i,a)),f.lookAt(t.scene.localToWorld(new j_.Vector3(0,0,0))),f.rotateY(Math.PI),f.rotateZ(-o*Math.PI/180),f.scale.x=f.scale.y=f.scale.z=s;},S={lat:+e(d),lng:+n(d),alt:+r(d),rot:+o(d),scale:1},T=f.__currentTargetD||Object.assign({},S,{scale:1e-12});Object.keys(S).some((function(t){return T[t]!==S[t]}))&&(!t.labelsTransitionDuration||t.labelsTransitionDuration<0?E(S):new JA(T).to(S,t.labelsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(E).start());}});}}),W_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;gv(this,e),(t=hv(this,e)).type="CircleLineGeometry",t.parameters={radius:n,segmentCount:r};for(var i=[],a=0;a<=r;a++){var o=(a/r-.25)*Math.PI*2;i.push({x:Math.cos(o)*n,y:Math.sin(o)*n,z:0});}return t.setFromPoints(i),t}return xv(e,t),_v(e)}((window.THREE?window.THREE:{BufferGeometry:Hn}).BufferGeometry),X_=window.THREE?window.THREE:{Color:En,Group:co,Line:Lo,LineBasicMaterial:Eo,Vector3:ae},Q_=zd.default||zd,Y_=jA({props:{ringsData:{default:[]},ringLat:{default:"lat"},ringLng:{default:"lng"},ringAltitude:{default:.0015},ringColor:{default:function(){return "#ffffaa"},triggerUpdate:!1},ringResolution:{default:64,triggerUpdate:!1},ringMaxRadius:{default:2,triggerUpdate:!1},ringPropagationSpeed:{default:1,triggerUpdate:!1},ringRepeatPeriod:{default:700,triggerUpdate:!1}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause();},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume();},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose();}},init:function(t,e){Nv(t),e.scene=t,e.ticker=new Q_,e.ticker.onTick.add((function(t){if(e.ringsData.length){var n=sf(e.ringColor),r=sf(e.ringAltitude),i=sf(e.ringMaxRadius),a=sf(e.ringPropagationSpeed),o=sf(e.ringRepeatPeriod);e.ringsData.filter((function(t){return t.__threeObj})).forEach((function(s){var A,l,u=s.__threeObj;if((u.__nextRingTime||0)<=t){var h=o(s)/1e3;u.__nextRingTime=t+(h<=0?1/0:h);var f,d=new X_.Line(new W_(1,e.ringResolution),new X_.LineBasicMaterial),p=n(s),m=p instanceof Array||p instanceof Function;m?p instanceof Array?(f=Rp().domain(p.map((function(t,e){return e/(p.length-1)}))).range(p),d.material.transparent=p.some((function(t){return Jv(t)<1}))):(f=p,d.material.transparent=!0):(d.material.color=new X_.Color(Kv(p)),A=d.material,l=Jv(p),A.opacity=l,A.transparent=l<1,A.depthWrite=l>=1);var g=kv*(1+r(s)),v=i(s),_=v*Math.PI/180,y=a(s),x=y<=0,b=function(t){var e=t.t,n=(x?1-e:e)*_;if(d.scale.x=d.scale.y=g*Math.sin(n),d.position.z=g*(1-Math.cos(n)),m){var r=f(e);d.material.color=new X_.Color(Kv(r)),d.material.transparent&&(d.material.opacity=Jv(r));}};if(0===y)b({t:0}),u.add(d);else {var M=1e3*Math.abs(v/y);new JA({t:0}).to({t:1},M).onUpdate(b).onStart((function(){return u.add(d)})).onComplete((function(){u.remove(d),Uv(d);})).start();}}}));}}));},update:function(t){var e=sf(t.ringLat),n=sf(t.ringLng),r=sf(t.ringAltitude),i=t.scene.localToWorld(new X_.Vector3(0,0,0));n_(t.ringsData,t.scene,{createObj:function(){var t=new X_.Group;return t.__globeObjType="ring",t},updateObj:function(t,a){var o=e(a),s=n(a),A=r(a);Object.assign(t.position,zv(o,s,A)),t.lookAt(i);}},{removeDelay:3e4});}}),Z_=pv(pv({},window.THREE?window.THREE:{}),{},{CSS2DObject:class extends ln{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Lt(.5,.5),this.addEventListener("removed",(function(){this.traverse((function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element);}));}));}copy(t,e){return super.copy(t,e),this.element=t.element.cloneNode(!0),this.center=t.center,this}}}),K_=jA({props:{htmlElementsData:{default:[]},htmlLat:{default:"lat"},htmlLng:{default:"lng"},htmlAltitude:{default:0},htmlElement:{},htmlTransitionDuration:{default:1e3,triggerUpdate:!1},isBehindGlobe:{onChange:function(){this.updateObjVisibility();},triggerUpdate:!1}},methods:{updateObjVisibility:function(t,e){(e?[e]:t.htmlElementsData.map((function(t){return t.__threeObj})).filter((function(t){return t}))).forEach((function(e){return e.visible=!t.isBehindGlobe||!t.isBehindGlobe(e.position)}));}},init:function(t,e){Nv(t),e.scene=t;},update:function(t,e){var n=this,r=sf(t.htmlLat),i=sf(t.htmlLng),a=sf(t.htmlAltitude),o=sf(t.htmlElement);n_(t.htmlElementsData,t.scene,{purge:e.hasOwnProperty("htmlElement"),createObj:function(t){var e=o(t),n=new Z_.CSS2DObject(e);return n.__globeObjType="html",n},updateObj:function(e,o){var s=function(t){var r=e.__currentTargetD=t,i=r.alt,a=r.lat,o=r.lng;Object.assign(e.position,zv(a,o,i)),n.updateObjVisibility(e);},A={lat:+r(o),lng:+i(o),alt:+a(o)};!t.htmlTransitionDuration||t.htmlTransitionDuration<0||!e.__currentTargetD?s(A):new JA(e.__currentTargetD).to(A,t.htmlTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(s).start();}});}}),J_=window.THREE?window.THREE:{Euler:Ve,Group:co,Mesh:sr,MeshLambertMaterial:Us,SphereGeometry:Os},$_=jA({props:{objectsData:{default:[]},objectLat:{default:"lat"},objectLng:{default:"lng"},objectAltitude:{default:.01},objectFacesSurface:{default:!0},objectRotation:{},objectThreeObject:{default:new J_.Mesh(new J_.SphereGeometry(1,16,8),new J_.MeshLambertMaterial({color:"#ffffaa",transparent:!0,opacity:.7}))}},init:function(t,e){Nv(t),e.scene=t;},update:function(t,e){var n=sf(t.objectLat),r=sf(t.objectLng),i=sf(t.objectAltitude),a=sf(t.objectFacesSurface),o=sf(t.objectRotation),s=sf(t.objectThreeObject);n_(t.objectsData,t.scene,{purge:e.hasOwnProperty("objectThreeObject"),createObj:function(e){var n=s(e);t.objectThreeObject===n&&(n=n.clone());var r=new J_.Group;return r.add(n),r.__globeObjType="object",r},updateObj:function(t,e){var s=+n(e),A=+r(e),l=+i(e);Object.assign(t.position,zv(s,A,l)),a(e)?t.setRotationFromEuler(new Ve(Hv(-s),Hv(A),0,"YXZ")):t.rotation.set(0,0,0);var c=t.children[0],u=o(e);u&&c.setRotationFromEuler(new Ve(Hv(u.x||0),Hv(u.y||0),Hv(u.z||0)));}});}}),ty=jA({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t;},update:function(t,e){t.customThreeObjectUpdate||Nv(t.scene);var n=sf(t.customThreeObject),r=sf(t.customThreeObjectUpdate);n_(t.customLayerData,t.scene,{purge:e.hasOwnProperty("customThreeObject"),createObj:function(e){var r=n(e,kv);return r&&(t.customThreeObject===r&&(r=r.clone()),r.__globeObjType="custom"),r},updateObj:function(t,e){return r(t,e,kv)}});}}),ey=window.THREE?window.THREE:{Group:co,Vector2:Lt,Vector3:ae},ny=["globeLayer","pointsLayer","arcsLayer","hexBinLayer","heatmapsLayer","polygonsLayer","hexedPolygonsLayer","pathsLayer","tilesLayer","labelsLayer","ringsLayer","htmlElementsLayer","objectsLayer","customLayer"],ry=Bv("globeLayer",Zv),iy=Object.assign.apply(Object,Tv(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude"].map((function(t){return yv({},t,ry.linkProp(t))})))),ay=Object.assign.apply(Object,Tv(["globeMaterial"].map((function(t){return yv({},t,ry.linkMethod(t))})))),oy=Bv("pointsLayer",o_),sy=Object.assign.apply(Object,Tv(["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map((function(t){return yv({},t,oy.linkProp(t))})))),Ay=Bv("arcsLayer",u_),ly=Object.assign.apply(Object,Tv(["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration"].map((function(t){return yv({},t,Ay.linkProp(t))})))),cy=Bv("hexBinLayer",p_),uy=Object.assign.apply(Object,Tv(["hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration"].map((function(t){return yv({},t,cy.linkProp(t))})))),hy=Bv("heatmapsLayer",T_),fy=Object.assign.apply(Object,Tv(["heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration"].map((function(t){return yv({},t,hy.linkProp(t))})))),dy=Bv("hexedPolygonsLayer",O_),py=Object.assign.apply(Object,Tv(["hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration"].map((function(t){return yv({},t,dy.linkProp(t))})))),my=Bv("polygonsLayer",R_),gy=Object.assign.apply(Object,Tv(["polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration"].map((function(t){return yv({},t,my.linkProp(t))})))),vy=Bv("pathsLayer",k_),_y=Object.assign.apply(Object,Tv(["pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration"].map((function(t){return yv({},t,vy.linkProp(t))})))),yy=Bv("tilesLayer",z_),xy=Object.assign.apply(Object,Tv(["tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration"].map((function(t){return yv({},t,yy.linkProp(t))})))),by=Bv("labelsLayer",V_),My=Object.assign.apply(Object,Tv(["labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration"].map((function(t){return yv({},t,by.linkProp(t))})))),wy=Bv("ringsLayer",Y_),Ey=Object.assign.apply(Object,Tv(["ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod"].map((function(t){return yv({},t,wy.linkProp(t))})))),Sy=Bv("htmlElementsLayer",K_),Ty=Object.assign.apply(Object,Tv(["htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration"].map((function(t){return yv({},t,Sy.linkProp(t))})))),Cy=Bv("objectsLayer",$_),Ry=Object.assign.apply(Object,Tv(["objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject"].map((function(t){return yv({},t,Cy.linkProp(t))})))),Py=Bv("customLayer",ty),Ly=Object.assign.apply(Object,Tv(["customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return yv({},t,Py.linkProp(t))})))),Dy=jA({props:pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv({onGlobeReady:{triggerUpdate:!1},rendererSize:{default:new ey.Vector2(window.innerWidth,window.innerHeight),onChange:function(t,e){e.pathsLayer.rendererSize(t);},triggerUpdate:!1}},iy),sy),ly),uy),fy),gy),py),_y),xy),My),Ey),Ty),Ry),Ly),methods:pv({getGlobeRadius:Fv,getCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return zv.apply(void 0,n)},toGeoCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Gv.apply(void 0,n)},setPointOfView:function(t,e,n){var r=void 0;if(e){var i,a,o,s=Fv(),A=n?e.clone().sub(n):e;r=function(t){void 0===i&&(i=A.length()),void 0===a&&(a=Math.sqrt(Math.pow(i,2)-Math.pow(s,2))),void 0===o&&(o=Math.acos(a/i));var e=A.distanceTo(t);if(e<a)return !1;var n=t.length();return Math.acos((Math.pow(i,2)+Math.pow(e,2)-Math.pow(n,2))/(2*i*e))<o};}t.layersThatNeedBehindGlobeChecker.forEach((function(t){return t.isBehindGlobe(r)}));},pauseAnimation:function(t){return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),t.pausableLayers.forEach((function(t){var e;return null===(e=t.pauseAnimation)||void 0===e?void 0:e.call(t)})),this},resumeAnimation:function(t){return null===t.animationFrameRequestId&&this._animationCycle(),t.pausableLayers.forEach((function(t){var e;return null===(e=t.resumeAnimation)||void 0===e?void 0:e.call(t)})),this},_animationCycle:function(t){t.animationFrameRequestId=requestAnimationFrame(this._animationCycle),tl();},_destructor:function(t){this.pauseAnimation(),t.destructableLayers.forEach((function(t){return t._destructor()}));}},ay),stateInit:function(){var t={globeLayer:Zv(),pointsLayer:o_(),arcsLayer:u_(),hexBinLayer:p_(),heatmapsLayer:T_(),polygonsLayer:R_(),hexedPolygonsLayer:O_(),pathsLayer:k_(),tilesLayer:z_(),labelsLayer:V_(),ringsLayer:Y_(),htmlElementsLayer:K_(),objectsLayer:$_(),customLayer:ty()};return pv(pv({},t),{},{layersThatNeedBehindGlobeChecker:Object.values(t).filter((function(t){return t.hasOwnProperty("isBehindGlobe")})),destructableLayers:Object.values(t).filter((function(t){return t.hasOwnProperty("_destructor")})),pausableLayers:Object.values(t).filter((function(t){return t.hasOwnProperty("pauseAnimation")}))})},init:function(t,e,n){var r=n.animateIn,i=void 0===r||r,a=n.waitForGlobeReady,o=void 0===a||a;Nv(t),e.scene=t,e.scene.visible=!1,ny.forEach((function(t){var n=new ey.Group;e.scene.add(n),e[t](n);}));var s=function(){if(i){e.scene.scale.set(1e-6,1e-6,1e-6),new JA({k:1e-6}).to({k:1},600).easing(WA.Quadratic.Out).onUpdate((function(t){var n=t.k;return e.scene.scale.set(n,n,n)})).start();var t=new ey.Vector3(0,1,0);new JA({rot:2*Math.PI}).to({rot:0},1200).easing(WA.Quintic.Out).onUpdate((function(n){var r=n.rot;return e.scene.setRotationFromAxisAngle(t,r)})).start();}e.scene.visible=!0,e.onGlobeReady&&e.onGlobeReady();};o?e.globeLayer.onReady(s):s(),this._animationCycle();},update:function(t){}});var Oy=function(t){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=function(n){function r(){var n;gv(this,r);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return (n=hv(this,r,[].concat(a))).__kapsuleInstance=t.apply(void 0,a).apply(void 0,[].concat(Tv(e?[Ev(n)]:[]),a)),n}return xv(r,n),_v(r)}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object);return Object.keys(t()).forEach((function(t){return n.prototype[t]=function(){var e,n=(e=this.__kapsuleInstance)[t].apply(e,arguments);return n===this.__kapsuleInstance?this:n}})),n}(Dy,(window.THREE?window.THREE:{Group:co}).Group,!0);const Iy={type:"change"},qy={type:"start"},Uy={type:"end"};class Ny extends gt{constructor(t,e){super();const n=this,r=-1,i=0,a=1,o=2,s=3,l=4;this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:A.ROTATE,MIDDLE:A.DOLLY,RIGHT:A.PAN},this.target=new ae;const c=1e-6,u=new ae;let h=1,f=r,d=r,p=0,m=0,g=0;const v=new ae,_=new Lt,y=new Lt,x=new ae,b=new Lt,M=new Lt,w=new Lt,E=new Lt,S=[],T={};this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.zoom0=this.object.zoom,this.handleResize=function(){const t=n.domElement.getBoundingClientRect(),e=n.domElement.ownerDocument.documentElement;n.screen.left=t.left+window.pageXOffset-e.clientLeft,n.screen.top=t.top+window.pageYOffset-e.clientTop,n.screen.width=t.width,n.screen.height=t.height;};const C=function(){const t=new Lt;return function(e,r){return t.set((e-n.screen.left)/n.screen.width,(r-n.screen.top)/n.screen.height),t}}(),R=function(){const t=new Lt;return function(e,r){return t.set((e-.5*n.screen.width-n.screen.left)/(.5*n.screen.width),(n.screen.height+2*(n.screen.top-r))/n.screen.width),t}}();function P(t){!1!==n.enabled&&(0===S.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",L),n.domElement.addEventListener("pointerup",D)),function(t){S.push(t);}(t),"touch"===t.pointerType?function(t){if(1===(k(t),S.length))f=s,y.copy(R(S[0].pageX,S[0].pageY)),_.copy(y);else {f=l;const t=S[0].pageX-S[1].pageX,e=S[0].pageY-S[1].pageY;m=p=Math.sqrt(t*t+e*e);const n=(S[0].pageX+S[1].pageX)/2,r=(S[0].pageY+S[1].pageY)/2;w.copy(C(n,r)),E.copy(w);}n.dispatchEvent(qy);}(t):function(t){if(f===r)switch(t.button){case n.mouseButtons.LEFT:f=i;break;case n.mouseButtons.MIDDLE:f=a;break;case n.mouseButtons.RIGHT:f=o;}const e=d!==r?d:f;e!==i||n.noRotate?e!==a||n.noZoom?e!==o||n.noPan||(w.copy(C(t.pageX,t.pageY)),E.copy(w)):(b.copy(C(t.pageX,t.pageY)),M.copy(b)):(y.copy(R(t.pageX,t.pageY)),_.copy(y));n.dispatchEvent(qy);}(t));}function L(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){if(1===(k(t),S.length))_.copy(y),y.copy(R(t.pageX,t.pageY));else {const e=function(t){const e=t.pointerId===S[0].pointerId?S[1]:S[0];return T[e.pointerId]}(t),n=t.pageX-e.x,r=t.pageY-e.y;m=Math.sqrt(n*n+r*r);const i=(t.pageX+e.x)/2,a=(t.pageY+e.y)/2;E.copy(C(i,a));}}(t):function(t){const e=d!==r?d:f;e!==i||n.noRotate?e!==a||n.noZoom?e!==o||n.noPan||E.copy(C(t.pageX,t.pageY)):M.copy(C(t.pageX,t.pageY)):(_.copy(y),y.copy(R(t.pageX,t.pageY)));}(t));}function D(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){switch(S.length){case 0:f=r;break;case 1:f=s,y.copy(R(t.pageX,t.pageY)),_.copy(y);break;case 2:f=l;for(let e=0;e<S.length;e++)if(S[e].pointerId!==t.pointerId){const t=T[S[e].pointerId];y.copy(R(t.x,t.y)),_.copy(y);break}}n.dispatchEvent(Uy);}(t):(f=r,n.dispatchEvent(Uy)),B(t),0===S.length&&(n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",L),n.domElement.removeEventListener("pointerup",D)));}function O(t){B(t);}function I(t){!1!==n.enabled&&(window.removeEventListener("keydown",I),d===r&&(t.code!==n.keys[i]||n.noRotate?t.code!==n.keys[a]||n.noZoom?t.code!==n.keys[o]||n.noPan||(d=o):d=a:d=i));}function q(){!1!==n.enabled&&(d=r,window.addEventListener("keydown",I));}function U(t){if(!1!==n.enabled&&!0!==n.noZoom){switch(t.preventDefault(),t.deltaMode){case 2:b.y-=.025*t.deltaY;break;case 1:b.y-=.01*t.deltaY;break;default:b.y-=25e-5*t.deltaY;}n.dispatchEvent(qy),n.dispatchEvent(Uy);}}function N(t){!1!==n.enabled&&t.preventDefault();}function B(t){delete T[t.pointerId];for(let e=0;e<S.length;e++)if(S[e].pointerId==t.pointerId)return void S.splice(e,1)}function k(t){let e=T[t.pointerId];void 0===e&&(e=new Lt,T[t.pointerId]=e),e.set(t.pageX,t.pageY);}this.rotateCamera=function(){const t=new ae,e=new ie,r=new ae,i=new ae,a=new ae,o=new ae;return function(){o.set(y.x-_.x,y.y-_.y,0);let s=o.length();s?(v.copy(n.object.position).sub(n.target),r.copy(v).normalize(),i.copy(n.object.up).normalize(),a.crossVectors(i,r).normalize(),i.setLength(y.y-_.y),a.setLength(y.x-_.x),o.copy(i.add(a)),t.crossVectors(o,v).normalize(),s*=n.rotateSpeed,e.setFromAxisAngle(t,s),v.applyQuaternion(e),n.object.up.applyQuaternion(e),x.copy(t),g=s):!n.staticMoving&&g&&(g*=Math.sqrt(1-n.dynamicDampingFactor),v.copy(n.object.position).sub(n.target),e.setFromAxisAngle(x,g),v.applyQuaternion(e),n.object.up.applyQuaternion(e)),_.copy(y);}}(),this.zoomCamera=function(){let t;f===l?(t=p/m,p=m,n.object.isPerspectiveCamera?v.multiplyScalar(t):n.object.isOrthographicCamera?(n.object.zoom=Pt.clamp(n.object.zoom/t,n.minZoom,n.maxZoom),h!==n.object.zoom&&n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(t=1+(M.y-b.y)*n.zoomSpeed,1!==t&&t>0&&(n.object.isPerspectiveCamera?v.multiplyScalar(t):n.object.isOrthographicCamera?(n.object.zoom=Pt.clamp(n.object.zoom/t,n.minZoom,n.maxZoom),h!==n.object.zoom&&n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),n.staticMoving?b.copy(M):b.y+=(M.y-b.y)*this.dynamicDampingFactor);},this.panCamera=function(){const t=new Lt,e=new ae,r=new ae;return function(){if(t.copy(E).sub(w),t.lengthSq()){if(n.object.isOrthographicCamera){const e=(n.object.right-n.object.left)/n.object.zoom/n.domElement.clientWidth,r=(n.object.top-n.object.bottom)/n.object.zoom/n.domElement.clientWidth;t.x*=e,t.y*=r;}t.multiplyScalar(v.length()*n.panSpeed),r.copy(v).cross(n.object.up).setLength(t.x),r.add(e.copy(n.object.up).setLength(t.y)),n.object.position.add(r),n.target.add(r),n.staticMoving?w.copy(E):w.add(t.subVectors(E,w).multiplyScalar(n.dynamicDampingFactor));}}}(),this.checkDistances=function(){n.noZoom&&n.noPan||(v.lengthSq()>n.maxDistance*n.maxDistance&&(n.object.position.addVectors(n.target,v.setLength(n.maxDistance)),b.copy(M)),v.lengthSq()<n.minDistance*n.minDistance&&(n.object.position.addVectors(n.target,v.setLength(n.minDistance)),b.copy(M)));},this.update=function(){v.subVectors(n.object.position,n.target),n.noRotate||n.rotateCamera(),n.noZoom||n.zoomCamera(),n.noPan||n.panCamera(),n.object.position.addVectors(n.target,v),n.object.isPerspectiveCamera?(n.checkDistances(),n.object.lookAt(n.target),u.distanceToSquared(n.object.position)>c&&(n.dispatchEvent(Iy),u.copy(n.object.position))):n.object.isOrthographicCamera?(n.object.lookAt(n.target),(u.distanceToSquared(n.object.position)>c||h!==n.object.zoom)&&(n.dispatchEvent(Iy),u.copy(n.object.position),h=n.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type");},this.reset=function(){f=r,d=r,n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.up.copy(n.up0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),v.subVectors(n.object.position,n.target),n.object.lookAt(n.target),n.dispatchEvent(Iy),u.copy(n.object.position),h=n.object.zoom;},this.dispose=function(){n.domElement.removeEventListener("contextmenu",N),n.domElement.removeEventListener("pointerdown",P),n.domElement.removeEventListener("pointercancel",O),n.domElement.removeEventListener("wheel",U),n.domElement.removeEventListener("pointermove",L),n.domElement.removeEventListener("pointerup",D),window.removeEventListener("keydown",I),window.removeEventListener("keyup",q);},this.domElement.addEventListener("contextmenu",N),this.domElement.addEventListener("pointerdown",P),this.domElement.addEventListener("pointercancel",O),this.domElement.addEventListener("wheel",U,{passive:!1}),window.addEventListener("keydown",I),window.addEventListener("keyup",q),this.handleResize(),this.update();}}const By={type:"change"},ky={type:"start"},Fy={type:"end"},zy=new Ie,Gy=new Tr,Hy=Math.cos(70*Pt.DEG2RAD);class jy extends gt{constructor(t,e){super(),this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new ae,this.cursor=new ae,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:A.ROTATE,MIDDLE:A.DOLLY,RIGHT:A.PAN},this.touches={ONE:l,TWO:u},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return o.phi},this.getAzimuthalAngle=function(){return o.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(t){t.addEventListener("keydown",tt),this._domElementKeyEvents=t;},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",tt),this._domElementKeyEvents=null;},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom;},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(By),n.update(),i=r.NONE;},this.update=function(){const e=new ae,A=(new ie).setFromUnitVectors(t.up,new ae(0,1,0)),l=A.clone().invert(),c=new ae,u=new ie,h=new ae,p=2*Math.PI;return function(m=null){const g=n.object.position;e.copy(g).sub(n.target),e.applyQuaternion(A),o.setFromVector3(e),n.autoRotate&&i===r.NONE&&L(function(t){return null!==t?2*Math.PI/60*n.autoRotateSpeed*t:2*Math.PI/60/60*n.autoRotateSpeed}(m)),n.enableDamping?(o.theta+=s.theta*n.dampingFactor,o.phi+=s.phi*n.dampingFactor):(o.theta+=s.theta,o.phi+=s.phi);let v=n.minAzimuthAngle,_=n.maxAzimuthAngle;isFinite(v)&&isFinite(_)&&(v<-Math.PI?v+=p:v>Math.PI&&(v-=p),_<-Math.PI?_+=p:_>Math.PI&&(_-=p),o.theta=v<=_?Math.max(v,Math.min(_,o.theta)):o.theta>(v+_)/2?Math.max(v,o.theta):Math.min(_,o.theta)),o.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,o.phi)),o.makeSafe(),!0===n.enableDamping?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor);let y=!1;if(n.zoomToCursor&&S||n.object.isOrthographicCamera)o.radius=k(o.radius);else {const t=o.radius;o.radius=k(o.radius*f),y=t!=o.radius;}if(e.setFromSpherical(o),e.applyQuaternion(l),g.copy(n.target).add(e),n.object.lookAt(n.target),!0===n.enableDamping?(s.theta*=1-n.dampingFactor,s.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(s.set(0,0,0),d.set(0,0,0)),n.zoomToCursor&&S){let r=null;if(n.object.isPerspectiveCamera){const t=e.length();r=k(t*f);const i=t-r;n.object.position.addScaledVector(w,i),n.object.updateMatrixWorld(),y=!!i;}else if(n.object.isOrthographicCamera){const t=new ae(E.x,E.y,0);t.unproject(n.object);const i=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/f)),n.object.updateProjectionMatrix(),y=i!==n.object.zoom;const a=new ae(E.x,E.y,0);a.unproject(n.object),n.object.position.sub(a).add(t),n.object.updateMatrixWorld(),r=e.length();}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;null!==r&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position):(zy.origin.copy(n.object.position),zy.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(zy.direction))<Hy?t.lookAt(n.target):(Gy.setFromNormalAndCoplanarPoint(n.object.up,n.target),zy.intersectPlane(Gy,n.target))));}else if(n.object.isOrthographicCamera){const t=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/f)),t!==n.object.zoom&&(n.object.updateProjectionMatrix(),y=!0);}return f=1,S=!1,!!(y||c.distanceToSquared(n.object.position)>a||8*(1-u.dot(n.object.quaternion))>a||h.distanceToSquared(n.target)>a)&&(n.dispatchEvent(By),c.copy(n.object.position),u.copy(n.object.quaternion),h.copy(n.target),!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",nt),n.domElement.removeEventListener("pointerdown",Q),n.domElement.removeEventListener("pointercancel",Z),n.domElement.removeEventListener("wheel",K),n.domElement.removeEventListener("pointermove",Y),n.domElement.removeEventListener("pointerup",Z);n.domElement.getRootNode().removeEventListener("keydown",J,{capture:!0}),null!==n._domElementKeyEvents&&(n._domElementKeyEvents.removeEventListener("keydown",tt),n._domElementKeyEvents=null);};const n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let i=r.NONE;const a=1e-6,o=new eA,s=new eA;let f=1;const d=new ae,p=new Lt,m=new Lt,g=new Lt,v=new Lt,_=new Lt,y=new Lt,x=new Lt,b=new Lt,M=new Lt,w=new ae,E=new Lt;let S=!1;const T=[],C={};let R=!1;function P(t){const e=Math.abs(.01*t);return Math.pow(.95,n.zoomSpeed*e)}function L(t){s.theta-=t;}function D(t){s.phi-=t;}const O=function(){const t=new ae;return function(e,n){t.setFromMatrixColumn(n,0),t.multiplyScalar(-e),d.add(t);}}(),I=function(){const t=new ae;return function(e,r){!0===n.screenSpacePanning?t.setFromMatrixColumn(r,1):(t.setFromMatrixColumn(r,0),t.crossVectors(n.object.up,t)),t.multiplyScalar(e),d.add(t);}}(),q=function(){const t=new ae;return function(e,r){const i=n.domElement;if(n.object.isPerspectiveCamera){const a=n.object.position;t.copy(a).sub(n.target);let o=t.length();o*=Math.tan(n.object.fov/2*Math.PI/180),O(2*e*o/i.clientHeight,n.object.matrix),I(2*r*o/i.clientHeight,n.object.matrix);}else n.object.isOrthographicCamera?(O(e*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),I(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1);}}();function U(t){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?f/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1);}function N(t){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?f*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1);}function B(t,e){if(!n.zoomToCursor)return;S=!0;const r=n.domElement.getBoundingClientRect(),i=t-r.left,a=e-r.top,o=r.width,s=r.height;E.x=i/o*2-1,E.y=-a/s*2+1,w.set(E.x,E.y,1).unproject(n.object).sub(n.object.position).normalize();}function k(t){return Math.max(n.minDistance,Math.min(n.maxDistance,t))}function F(t){p.set(t.clientX,t.clientY);}function z(t){v.set(t.clientX,t.clientY);}function G(t){if(1===T.length)p.set(t.pageX,t.pageY);else {const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);p.set(n,r);}}function H(t){if(1===T.length)v.set(t.pageX,t.pageY);else {const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);v.set(n,r);}}function j(t){const e=it(t),n=t.pageX-e.x,r=t.pageY-e.y,i=Math.sqrt(n*n+r*r);x.set(0,i);}function V(t){if(1==T.length)m.set(t.pageX,t.pageY);else {const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);m.set(n,r);}g.subVectors(m,p).multiplyScalar(n.rotateSpeed);const e=n.domElement;L(2*Math.PI*g.x/e.clientHeight),D(2*Math.PI*g.y/e.clientHeight),p.copy(m);}function W(t){if(1===T.length)_.set(t.pageX,t.pageY);else {const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);_.set(n,r);}y.subVectors(_,v).multiplyScalar(n.panSpeed),q(y.x,y.y),v.copy(_);}function X(t){const e=it(t),r=t.pageX-e.x,i=t.pageY-e.y,a=Math.sqrt(r*r+i*i);b.set(0,a),M.set(0,Math.pow(b.y/x.y,n.zoomSpeed)),U(M.y),x.copy(b);B(.5*(t.pageX+e.x),.5*(t.pageY+e.y));}function Q(t){!1!==n.enabled&&(0===T.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",Y),n.domElement.addEventListener("pointerup",Z)),function(t){for(let e=0;e<T.length;e++)if(T[e]==t.pointerId)return !0;return !1}(t)||(function(t){T.push(t.pointerId);}(t),"touch"===t.pointerType?et(t):function(t){let e;switch(t.button){case 0:e=n.mouseButtons.LEFT;break;case 1:e=n.mouseButtons.MIDDLE;break;case 2:e=n.mouseButtons.RIGHT;break;default:e=-1;}switch(e){case A.DOLLY:if(!1===n.enableZoom)return;!function(t){B(t.clientX,t.clientX),x.set(t.clientX,t.clientY);}(t),i=r.DOLLY;break;case A.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enablePan)return;z(t),i=r.PAN;}else {if(!1===n.enableRotate)return;F(t),i=r.ROTATE;}break;case A.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enableRotate)return;F(t),i=r.ROTATE;}else {if(!1===n.enablePan)return;z(t),i=r.PAN;}break;default:i=r.NONE;}i!==r.NONE&&n.dispatchEvent(ky);}(t)));}function Y(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){switch(rt(t),i){case r.TOUCH_ROTATE:if(!1===n.enableRotate)return;V(t),n.update();break;case r.TOUCH_PAN:if(!1===n.enablePan)return;W(t),n.update();break;case r.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(t){n.enableZoom&&X(t),n.enablePan&&W(t);}(t),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(t){n.enableZoom&&X(t),n.enableRotate&&V(t);}(t),n.update();break;default:i=r.NONE;}}(t):function(t){switch(i){case r.ROTATE:if(!1===n.enableRotate)return;!function(t){m.set(t.clientX,t.clientY),g.subVectors(m,p).multiplyScalar(n.rotateSpeed);const e=n.domElement;L(2*Math.PI*g.x/e.clientHeight),D(2*Math.PI*g.y/e.clientHeight),p.copy(m),n.update();}(t);break;case r.DOLLY:if(!1===n.enableZoom)return;!function(t){b.set(t.clientX,t.clientY),M.subVectors(b,x),M.y>0?U(P(M.y)):M.y<0&&N(P(M.y)),x.copy(b),n.update();}(t);break;case r.PAN:if(!1===n.enablePan)return;!function(t){_.set(t.clientX,t.clientY),y.subVectors(_,v).multiplyScalar(n.panSpeed),q(y.x,y.y),v.copy(_),n.update();}(t);}}(t));}function Z(t){switch(function(t){delete C[t.pointerId];for(let e=0;e<T.length;e++)if(T[e]==t.pointerId)return void T.splice(e,1)}(t),T.length){case 0:n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",Y),n.domElement.removeEventListener("pointerup",Z),n.dispatchEvent(Fy),i=r.NONE;break;case 1:const e=T[0],a=C[e];et({pointerId:e,pageX:a.x,pageY:a.y});}}function K(t){!1!==n.enabled&&!1!==n.enableZoom&&i===r.NONE&&(t.preventDefault(),n.dispatchEvent(ky),function(t){B(t.clientX,t.clientY),t.deltaY<0?N(P(t.deltaY)):t.deltaY>0&&U(P(t.deltaY)),n.update();}(function(t){const e=t.deltaMode,n={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100;}t.ctrlKey&&!R&&(n.deltaY*=10);return n}(t)),n.dispatchEvent(Fy));}function J(t){if("Control"===t.key){R=!0;n.domElement.getRootNode().addEventListener("keyup",$,{passive:!0,capture:!0});}}function $(t){if("Control"===t.key){R=!1;n.domElement.getRootNode().removeEventListener("keyup",$,{passive:!0,capture:!0});}}function tt(t){!1!==n.enabled&&!1!==n.enablePan&&function(t){let e=!1;switch(t.code){case n.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?D(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(0,n.keyPanSpeed),e=!0;break;case n.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?D(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(0,-n.keyPanSpeed),e=!0;break;case n.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?L(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(n.keyPanSpeed,0),e=!0;break;case n.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?L(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(-n.keyPanSpeed,0),e=!0;}e&&(t.preventDefault(),n.update());}(t);}function et(t){switch(rt(t),T.length){case 1:switch(n.touches.ONE){case l:if(!1===n.enableRotate)return;G(t),i=r.TOUCH_ROTATE;break;case c:if(!1===n.enablePan)return;H(t),i=r.TOUCH_PAN;break;default:i=r.NONE;}break;case 2:switch(n.touches.TWO){case u:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(t){n.enableZoom&&j(t),n.enablePan&&H(t);}(t),i=r.TOUCH_DOLLY_PAN;break;case h:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(t){n.enableZoom&&j(t),n.enableRotate&&G(t);}(t),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE;}break;default:i=r.NONE;}i!==r.NONE&&n.dispatchEvent(ky);}function nt(t){!1!==n.enabled&&t.preventDefault();}function rt(t){let e=C[t.pointerId];void 0===e&&(e=new Lt,C[t.pointerId]=e),e.set(t.pageX,t.pageY);}function it(t){const e=t.pointerId===T[0]?T[1]:T[0];return C[e]}n.domElement.addEventListener("contextmenu",nt),n.domElement.addEventListener("pointerdown",Q),n.domElement.addEventListener("pointercancel",Z),n.domElement.addEventListener("wheel",K,{passive:!1});n.domElement.getRootNode().addEventListener("keydown",J,{passive:!0,capture:!0}),this.update();}}const Vy={type:"change"};class Wy extends gt{constructor(t,e){super(),this.object=t,this.domElement=e,this.enabled=!0,this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1;const n=this,r=1e-6,i=new ie,a=new ae;this.tmpQuaternion=new ie,this.status=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new ae(0,0,0),this.rotationVector=new ae(0,0,0),this.keydown=function(t){if(!t.altKey&&!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this.moveState.forward=1;break;case"KeyS":this.moveState.back=1;break;case"KeyA":this.moveState.left=1;break;case"KeyD":this.moveState.right=1;break;case"KeyR":this.moveState.up=1;break;case"KeyF":this.moveState.down=1;break;case"ArrowUp":this.moveState.pitchUp=1;break;case"ArrowDown":this.moveState.pitchDown=1;break;case"ArrowLeft":this.moveState.yawLeft=1;break;case"ArrowRight":this.moveState.yawRight=1;break;case"KeyQ":this.moveState.rollLeft=1;break;case"KeyE":this.moveState.rollRight=1;}this.updateMovementVector(),this.updateRotationVector();}},this.keyup=function(t){if(!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this.moveState.forward=0;break;case"KeyS":this.moveState.back=0;break;case"KeyA":this.moveState.left=0;break;case"KeyD":this.moveState.right=0;break;case"KeyR":this.moveState.up=0;break;case"KeyF":this.moveState.down=0;break;case"ArrowUp":this.moveState.pitchUp=0;break;case"ArrowDown":this.moveState.pitchDown=0;break;case"ArrowLeft":this.moveState.yawLeft=0;break;case"ArrowRight":this.moveState.yawRight=0;break;case"KeyQ":this.moveState.rollLeft=0;break;case"KeyE":this.moveState.rollRight=0;}this.updateMovementVector(),this.updateRotationVector();}},this.pointerdown=function(t){if(!1!==this.enabled)if(this.dragToLook)this.status++;else {switch(t.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1;}this.updateMovementVector();}},this.pointermove=function(t){if(!1!==this.enabled&&(!this.dragToLook||this.status>0)){const e=this.getContainerDimensions(),n=e.size[0]/2,r=e.size[1]/2;this.moveState.yawLeft=-(t.pageX-e.offset[0]-n)/n,this.moveState.pitchDown=(t.pageY-e.offset[1]-r)/r,this.updateRotationVector();}},this.pointerup=function(t){if(!1!==this.enabled){if(this.dragToLook)this.status--,this.moveState.yawLeft=this.moveState.pitchDown=0;else {switch(t.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0;}this.updateMovementVector();}this.updateRotationVector();}},this.pointercancel=function(){!1!==this.enabled&&(this.dragToLook?(this.status=0,this.moveState.yawLeft=this.moveState.pitchDown=0):(this.moveState.forward=0,this.moveState.back=0,this.updateMovementVector()),this.updateRotationVector());},this.contextMenu=function(t){!1!==this.enabled&&t.preventDefault();},this.update=function(t){if(!1===this.enabled)return;const e=t*n.movementSpeed,o=t*n.rollSpeed;n.object.translateX(n.moveVector.x*e),n.object.translateY(n.moveVector.y*e),n.object.translateZ(n.moveVector.z*e),n.tmpQuaternion.set(n.rotationVector.x*o,n.rotationVector.y*o,n.rotationVector.z*o,1).normalize(),n.object.quaternion.multiply(n.tmpQuaternion),(a.distanceToSquared(n.object.position)>r||8*(1-i.dot(n.object.quaternion))>r)&&(n.dispatchEvent(Vy),i.copy(n.object.quaternion),a.copy(n.object.position));},this.updateMovementVector=function(){const t=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-t+this.moveState.back;},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft;},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",o),this.domElement.removeEventListener("pointerdown",A),this.domElement.removeEventListener("pointermove",s),this.domElement.removeEventListener("pointerup",l),this.domElement.removeEventListener("pointercancel",c),window.removeEventListener("keydown",u),window.removeEventListener("keyup",h);};const o=this.contextMenu.bind(this),s=this.pointermove.bind(this),A=this.pointerdown.bind(this),l=this.pointerup.bind(this),c=this.pointercancel.bind(this),u=this.keydown.bind(this),h=this.keyup.bind(this);this.domElement.addEventListener("contextmenu",o),this.domElement.addEventListener("pointerdown",A),this.domElement.addEventListener("pointermove",s),this.domElement.addEventListener("pointerup",l),this.domElement.addEventListener("pointercancel",c),window.addEventListener("keydown",u),window.addEventListener("keyup",h),this.updateMovementVector(),this.updateRotationVector();}}const Xy={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"};class Qy{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1;}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.");}dispose(){}}const Yy=new Wr(-1,1,1,-1,0,1);const Zy=new class extends Hn{constructor(){super(),this.setAttribute("position",new qn([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new qn([0,2,0,0,2,0],2));}};class Ky{constructor(t){this._mesh=new sr(Zy,t);}dispose(){this._mesh.geometry.dispose();}render(t){t.render(this._mesh,Yy);}get material(){return this._mesh.material}set material(t){this._mesh.material=t;}}class Jy extends Qy{constructor(t,e){super(),this.textureID=void 0!==e?e:"tDiffuse",t instanceof dr?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=fr.clone(t.uniforms),this.material=new dr({name:void 0!==t.name?t.name:"unspecified",defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new Ky(this.material);}render(t,e,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t));}dispose(){this.material.dispose(),this.fsQuad.dispose();}}class $y extends Qy{constructor(t,e){super(),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1;}render(t,e,n){const r=t.getContext(),i=t.state;let a,o;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(a=0,o=1):(a=1,o=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,a,4294967295),i.buffers.stencil.setClear(o),i.buffers.stencil.setLocked(!0),t.setRenderTarget(n),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.color.setMask(!0),i.buffers.depth.setMask(!0),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0);}}class tx extends Qy{constructor(){super(),this.needsSwap=!1;}render(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1);}}class ex{constructor(t,e){if(this.renderer=t,this._pixelRatio=t.getPixelRatio(),void 0===e){const n=t.getSize(new Lt);this._width=n.width,this._height=n.height,(e=new ee(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:W})).texture.name="EffectComposer.rt1";}else this._width=e.width,this._height=e.height;this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Jy(Xy),this.copyPass.material.blending=0,this.clock=new Ys;}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t;}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio);}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio);}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1);}isLastEnabledPass(t){for(let e=t+1;e<this.passes.length;e++)if(this.passes[e].enabled)return !1;return !0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();let n=!1;for(let e=0,r=this.passes.length;e<r;e++){const r=this.passes[e];if(!1!==r.enabled){if(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),r.render(this.renderer,this.writeBuffer,this.readBuffer,t,n),r.needsSwap){if(n){const e=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(e.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),n.setFunc(e.EQUAL,1,4294967295);}this.swapBuffers();}void 0!==$y&&(r instanceof $y?n=!0:r instanceof tx&&(n=!1));}}this.renderer.setRenderTarget(e);}reset(t){if(void 0===t){const e=this.renderer.getSize(new Lt);this._pixelRatio=this.renderer.getPixelRatio(),this._width=e.width,this._height=e.height,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio);}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2;}setSize(t,e){this._width=t,this._height=e;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let t=0;t<this.passes.length;t++)this.passes[t].setSize(n,r);}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height);}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose();}}class nx extends Qy{constructor(t,e,n=null,r=null,i=null){super(),this.scene=t,this.camera=e,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=i,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new En;}render(t,e,n){const r=t.autoClear;let i,a;t.autoClear=!1,null!==this.overrideMaterial&&(a=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),null!==this.clearColor&&(t.getClearColor(this._oldClearColor),t.setClearColor(this.clearColor)),null!==this.clearAlpha&&(i=t.getClearAlpha(),t.setClearAlpha(this.clearAlpha)),1==this.clearDepth&&t.clearDepth(),t.setRenderTarget(this.renderToScreen?null:n),!0===this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),t.render(this.scene,this.camera),null!==this.clearColor&&t.setClearColor(this._oldClearColor),null!==this.clearAlpha&&t.setClearAlpha(i),null!==this.overrideMaterial&&(this.scene.overrideMaterial=a),t.autoClear=r;}}function rx(){return rx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);}return t},rx.apply(this,arguments)}function ix(t,e){return ix=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ix(t,e)}function ax(t){return ax=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ax(t)}function ox(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));}catch(t){}return (ox=function(){return !!t})()}function sx(t){var e="function"==typeof Map?new Map:void 0;return sx=function(t){if(null===t||!function(t){try{return -1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return "function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n);}function n(){return function(t,e,n){if(ox())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&ix(i,n.prototype),i}(t,arguments,ax(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ix(n,t)},sx(t)}var Ax={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function lx(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=e[0],a=[];for(r=1;r<e.length;r+=1)a.push(e[r]);return a.forEach((function(t){i=i.replace(/%[a-z]/,t);})),i}var cx=function(t){var e,n;function r(e){var n;if("production"===process.env.NODE_ENV)n=t.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+e+" for more information.")||this;else {for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];n=t.call(this,lx.apply(void 0,[Ax[e]].concat(i)))||this;}return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,ix(e,n),r}(sx(Error));function ux(t){return Math.round(255*t)}function hx(t,e,n){return ux(t)+","+ux(e)+","+ux(n)}function fx(t,e,n,r){if(void 0===r&&(r=hx),0===e)return r(n,n,n);var i=(t%360+360)%360/60,a=(1-Math.abs(2*n-1))*e,o=a*(1-Math.abs(i%2-1)),s=0,A=0,l=0;i>=0&&i<1?(s=a,A=o):i>=1&&i<2?(s=o,A=a):i>=2&&i<3?(A=a,l=o):i>=3&&i<4?(A=o,l=a):i>=4&&i<5?(s=o,l=a):i>=5&&i<6&&(s=a,l=o);var c=n-a/2;return r(s+c,A+c,l+c)}var dx={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var px=/^#[a-fA-F0-9]{6}$/,mx=/^#[a-fA-F0-9]{8}$/,gx=/^#[a-fA-F0-9]{3}$/,vx=/^#[a-fA-F0-9]{4}$/,_x=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,yx=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,xx=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,bx=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function Mx(t){if("string"!=typeof t)throw new cx(3);var e=function(t){if("string"!=typeof t)return t;var e=t.toLowerCase();return dx[e]?"#"+dx[e]:t}(t);if(e.match(px))return {red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(mx)){var n=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return {red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:n}}if(e.match(gx))return {red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(vx)){var r=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return {red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:r}}var i=_x.exec(e);if(i)return {red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var a=yx.exec(e.substring(0,50));if(a)return {red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])>1?parseFloat(""+a[4])/100:parseFloat(""+a[4])};var o=xx.exec(e);if(o){var s="rgb("+fx(parseInt(""+o[1],10),parseInt(""+o[2],10)/100,parseInt(""+o[3],10)/100)+")",A=_x.exec(s);if(!A)throw new cx(4,e,s);return {red:parseInt(""+A[1],10),green:parseInt(""+A[2],10),blue:parseInt(""+A[3],10)}}var l=bx.exec(e.substring(0,50));if(l){var c="rgb("+fx(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",u=_x.exec(c);if(!u)throw new cx(4,e,c);return {red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10),alpha:parseFloat(""+l[4])>1?parseFloat(""+l[4])/100:parseFloat(""+l[4])}}throw new cx(5)}function wx(t){return function(t){var e,n=t.red/255,r=t.green/255,i=t.blue/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if(a===o)return void 0!==t.alpha?{hue:0,saturation:0,lightness:s,alpha:t.alpha}:{hue:0,saturation:0,lightness:s};var A=a-o,l=s>.5?A/(2-a-o):A/(a+o);switch(a){case n:e=(r-i)/A+(r<i?6:0);break;case r:e=(i-n)/A+2;break;default:e=(n-r)/A+4;}return e*=60,void 0!==t.alpha?{hue:e,saturation:l,lightness:s,alpha:t.alpha}:{hue:e,saturation:l,lightness:s}}(Mx(t))}var Ex=function(t){return 7===t.length&&t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?"#"+t[1]+t[3]+t[5]:t};function Sx(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function Tx(t){return Sx(Math.round(255*t))}function Cx(t,e,n){return Ex("#"+Tx(t)+Tx(e)+Tx(n))}function Rx(t,e,n){return fx(t,e,n,Cx)}function Px(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ex("#"+Sx(t)+Sx(e)+Sx(n));if("object"==typeof t&&void 0===e&&void 0===n)return Ex("#"+Sx(t.red)+Sx(t.green)+Sx(t.blue));throw new cx(6)}function Lx(t,e,n,r){if("string"==typeof t&&"number"==typeof e){var i=Mx(t);return "rgba("+i.red+","+i.green+","+i.blue+","+e+")"}if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof r)return r>=1?Px(t,e,n):"rgba("+t+","+e+","+n+","+r+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===r)return t.alpha>=1?Px(t.red,t.green,t.blue):"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")";throw new cx(7)}var Dx=function(t){return "number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&("number"!=typeof t.alpha||void 0===t.alpha)},Ox=function(t){return "number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&"number"==typeof t.alpha},Ix=function(t){return "number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&("number"!=typeof t.alpha||void 0===t.alpha)},qx=function(t){return "number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&"number"==typeof t.alpha};function Ux(t){if("object"!=typeof t)throw new cx(8);if(Ox(t))return Lx(t);if(Dx(t))return Px(t);if(qx(t))return function(t,e,n,r){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof r)return r>=1?Rx(t,e,n):"rgba("+fx(t,e,n)+","+r+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===r)return t.alpha>=1?Rx(t.hue,t.saturation,t.lightness):"rgba("+fx(t.hue,t.saturation,t.lightness)+","+t.alpha+")";throw new cx(2)}(t);if(Ix(t))return function(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Rx(t,e,n);if("object"==typeof t&&void 0===e&&void 0===n)return Rx(t.hue,t.saturation,t.lightness);throw new cx(1)}(t);throw new cx(8)}function Nx(t,e,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=e?t.apply(this,r):Nx(t,e,r)}}function Bx(t){return Nx(t,t.length,[])}function kx(t,e,n){return Math.max(t,Math.min(e,n))}Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{hue:n.hue+parseFloat(t)}))})),Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{lightness:kx(0,1,n.lightness-parseFloat(t))}))})),Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{saturation:kx(0,1,n.saturation-parseFloat(t))}))})),Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{lightness:kx(0,1,n.lightness+parseFloat(t))}))}));var Fx=Bx((function(t,e,n){if("transparent"===e)return n;if("transparent"===n)return e;if(0===t)return n;var r=Mx(e),i=rx({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),a=Mx(n),o=rx({},a,{alpha:"number"==typeof a.alpha?a.alpha:1}),s=i.alpha-o.alpha,A=2*parseFloat(t)-1,l=((A*s==-1?A:A+s)/(1+A*s)+1)/2,c=1-l;return Lx({red:Math.floor(i.red*l+o.red*c),green:Math.floor(i.green*l+o.green*c),blue:Math.floor(i.blue*l+o.blue*c),alpha:i.alpha*parseFloat(t)+o.alpha*(1-parseFloat(t))})})),zx=Fx;var Gx=Bx((function(t,e){if("transparent"===e)return e;var n=Mx(e);return Lx(rx({},n,{alpha:kx(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(t))/100)}))})),Hx=Gx;Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{saturation:kx(0,1,n.saturation+parseFloat(t))}))})),Bx((function(t,e){return "transparent"===e?e:Ux(rx({},wx(e),{hue:parseFloat(t)}))})),Bx((function(t,e){return "transparent"===e?e:Ux(rx({},wx(e),{lightness:parseFloat(t)}))})),Bx((function(t,e){return "transparent"===e?e:Ux(rx({},wx(e),{saturation:parseFloat(t)}))})),Bx((function(t,e){return "transparent"===e?e:zx(parseFloat(t),"rgb(0, 0, 0)",e)})),Bx((function(t,e){return "transparent"===e?e:zx(parseFloat(t),"rgb(255, 255, 255)",e)})),Bx((function(t,e){if("transparent"===e)return e;var n=Mx(e);return Lx(rx({},n,{alpha:kx(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(t)).toFixed(2)/100)}))}));function jx(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===e?String:Number)(t)}(t,"string");return "symbol"==typeof e?e:String(e)}function Vx(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1;}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t;}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Xx(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wx(t){return function(t){if(Array.isArray(t))return Qx(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Xx(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xx(t,e){if(t){if("string"==typeof t)return Qx(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return "Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qx(t,e):void 0}}function Qx(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t));}}(".scene-nav-info {\n  bottom: 5px;\n  width: 100%;\n  text-align: center;\n  color: slategrey;\n  opacity: 0.7;\n  font-size: 10px;\n}\n\n.scene-tooltip {\n  top: 0;\n  color: lavender;\n  font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n  position: absolute;\n  font-family: sans-serif;\n  pointer-events: none;\n  user-select: none;\n}\n\n.scene-container canvas:focus {\n  outline: none;\n}");var Yx=window.THREE?window.THREE:{WebGLRenderer:yo,Scene:class extends ln{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ve,this.environmentRotation=new Ve,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}));}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),e.object.environmentRotation=this.environmentRotation.toArray(),e}},PerspectiveCamera:_r,Raycaster:class{constructor(t,e,n=0,r=1/0){this.ray=new Ie(t,e),this.near=n,this.far=r,this.camera=null,this.layers=new We,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}};}set(t,e){this.ray.set(t,e);}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type);}setFromXRController(t){return Js.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Js),this}intersectObject(t,e=!0,n=[]){return tA(t,this,n,e),n.sort($s),n}intersectObjects(t,e=!0,n=[]){for(let r=0,i=t.length;r<i;r++)tA(t[r],this,n,e);return n.sort($s),n}},SRGBColorSpace:rt,TextureLoader:Gs,Vector2:Lt,Vector3:ae,Box3:Ae,Color:En,Mesh:sr,SphereGeometry:Os,MeshBasicMaterial:Rn,BackSide:g,EventDispatcher:gt,MOUSE:A,Quaternion:ie,Spherical:eA,Clock:Ys},Zx=jA({props:{width:{default:window.innerWidth,onChange:function(t,e,n){isNaN(t)&&(e.width=n);}},height:{default:window.innerHeight,onChange:function(t,e,n){isNaN(t)&&(e.height=n);}},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(t,e){e.hoverObj=null,e.toolTipElem&&(e.toolTipElem.innerHTML="");},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return -1},triggerUpdate:!1},hoverFilter:{default:function(){return !0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(t){if(t.initialised){if(t.controls.update&&t.controls.update(t.clock.getDelta()),t.postProcessingComposer?t.postProcessingComposer.render():t.renderer.render(t.scene,t.camera),t.extraRenderers.forEach((function(e){return e.render(t.scene,t.camera)})),t.enablePointerInteraction){var e=null;if(t.hoverDuringDrag||!t.isPointerDragging){var n=this.intersectingObjects(t.pointerPos.x,t.pointerPos.y).filter((function(e){return t.hoverFilter(e.object)})).sort((function(e,n){return t.hoverOrderComparator(e.object,n.object)})),r=n.length?n[0]:null;e=r?r.object:null,t.intersectionPoint=r?r.point:null;}e!==t.hoverObj&&(t.onHover(e,t.hoverObj),t.toolTipElem.innerHTML=e&&sf(t.tooltipContent)(e)||"",t.hoverObj=e);}tl();}return this},getPointerPos:function(t){var e=t.pointerPos;return {x:e.x,y:e.y}},cameraPosition:function(t,e,n,r){var i=t.camera;if(e&&t.initialised){var a=e,o=n||{x:0,y:0,z:0};if(r){var s=Object.assign({},i.position),A=u();new JA(s).to(a,r).easing(WA.Quadratic.Out).onUpdate(l).start(),new JA(A).to(o,r/3).easing(WA.Quadratic.Out).onUpdate(c).start();}else l(a),c(o);return this}return Object.assign({},i.position,{lookAt:u()});function l(t){var e=t.x,n=t.y,r=t.z;void 0!==e&&(i.position.x=e),void 0!==n&&(i.position.y=n),void 0!==r&&(i.position.z=r);}function c(e){var n=new Yx.Vector3(e.x,e.y,e.z);t.controls.target?t.controls.target=n:i.lookAt(n);}function u(){return Object.assign(new Yx.Vector3(0,0,-1e3).applyQuaternion(i.quaternion).add(i.position))}},zoomToFit:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length,i=new Array(r>3?r-3:0),a=3;a<r;a++)i[a-3]=arguments[a];return this.fitToBbox(this.getBbox.apply(this,i),e,n)},fitToBbox:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=t.camera;if(e){var a=new Yx.Vector3(0,0,0),o=2*Math.max.apply(Math,Wx(Object.entries(e).map((function(t){var e=Vx(t,2),n=e[0],r=e[1];return Math.max.apply(Math,Wx(r.map((function(t){return Math.abs(a[n]-t)}))))})))),s=(1-2*r/t.height)*i.fov,A=o/Math.atan(s*Math.PI/180),l=A/i.aspect,c=Math.max(A,l);if(c>0){var u=a.clone().sub(i.position).normalize().multiplyScalar(-c);this.cameraPosition(u,a,n);}}return this},getBbox:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return !0},n=new Yx.Box3(new Yx.Vector3(0,0,0),new Yx.Vector3(0,0,0)),r=t.objects.filter(e);return r.length?(r.forEach((function(t){return n.expandByObject(t)})),Object.assign.apply(Object,Wx(["x","y","z"].map((function(t){return e={},r=t,i=[n.min[t],n.max[t]],(r=jx(r))in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e;var e,r,i;}))))):null},getScreenCoords:function(t,e,n,r){var i=new Yx.Vector3(e,n,r);return i.project(this.camera()),{x:(i.x+1)*t.width/2,y:-(i.y-1)*t.height/2}},getSceneCoords:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=new Yx.Vector2(e/t.width*2-1,-n/t.height*2+1),a=new Yx.Raycaster;return a.setFromCamera(i,t.camera),Object.assign({},a.ray.at(r,new Yx.Vector3))},intersectingObjects:function(t,e,n){var r=new Yx.Vector2(e/t.width*2-1,-n/t.height*2+1),i=new Yx.Raycaster;return i.params.Line.threshold=t.lineHoverPrecision,i.setFromCamera(r,t.camera),i.intersectObjects(t.objects,!0)},renderer:function(t){return t.renderer},scene:function(t){return t.scene},camera:function(t){return t.camera},postProcessingComposer:function(t){return t.postProcessingComposer},controls:function(t){return t.controls},tbControls:function(t){return t.controls}},stateInit:function(){return {scene:new Yx.Scene,camera:new Yx.PerspectiveCamera,clock:new Yx.Clock}},init:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.controlType,i=void 0===r?"trackball":r,a=n.rendererConfig,o=void 0===a?{}:a,s=n.extraRenderers,A=void 0===s?[]:s,l=n.waitForLoadComplete,c=void 0===l||l;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.className="scene-container",e.container.style.position="relative",e.container.appendChild(e.navInfo=document.createElement("div")),e.navInfo.className="scene-nav-info",e.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[i]||"",e.navInfo.style.display=e.showNavInfo?null:"none",e.toolTipElem=document.createElement("div"),e.toolTipElem.classList.add("scene-tooltip"),e.container.appendChild(e.toolTipElem),e.pointerPos=new Yx.Vector2,e.pointerPos.x=-2,e.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(t){return e.container.addEventListener(t,(function(n){if("pointerdown"===t&&(e.isPointerPressed=!0),!e.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||e.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(t){return Math.abs(t)>1})))&&(e.isPointerDragging=!0),e.enablePointerInteraction){var r=(i=e.container,a=i.getBoundingClientRect(),o=window.pageXOffset||document.documentElement.scrollLeft,s=window.pageYOffset||document.documentElement.scrollTop,{top:a.top+s,left:a.left+o});e.pointerPos.x=n.pageX-r.left,e.pointerPos.y=n.pageY-r.top,e.toolTipElem.style.top="".concat(e.pointerPos.y,"px"),e.toolTipElem.style.left="".concat(e.pointerPos.x,"px"),e.toolTipElem.style.transform="translate(-".concat(e.pointerPos.x/e.width*100,"%, ").concat(e.height-e.pointerPos.y<100?"calc(-100% - 8px)":"21px",")");}var i,a,o,s;}),{passive:!0})})),e.container.addEventListener("pointerup",(function(t){e.isPointerPressed=!1,e.isPointerDragging&&(e.isPointerDragging=!1,!e.clickAfterDrag)||requestAnimationFrame((function(){0===t.button&&e.onClick(e.hoverObj||null,t,e.intersectionPoint),2===t.button&&e.onRightClick&&e.onRightClick(e.hoverObj||null,t,e.intersectionPoint);}));}),{passive:!0,capture:!0}),e.container.addEventListener("contextmenu",(function(t){e.onRightClick&&t.preventDefault();})),e.renderer=new Yx.WebGLRenderer(Object.assign({antialias:!0,alpha:!0},o)),e.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),e.container.appendChild(e.renderer.domElement),e.extraRenderers=A,e.extraRenderers.forEach((function(t){t.domElement.style.position="absolute",t.domElement.style.top="0px",t.domElement.style.pointerEvents="none",e.container.appendChild(t.domElement);})),e.postProcessingComposer=new ex(e.renderer),e.postProcessingComposer.addPass(new nx(e.scene,e.camera)),e.controls=new{trackball:Ny,orbit:jy,fly:Wy}[i](e.camera,e.renderer.domElement),"fly"===i&&(e.controls.movementSpeed=300,e.controls.rollSpeed=Math.PI/6,e.controls.dragToLook=!0),"trackball"!==i&&"orbit"!==i||(e.controls.minDistance=.1,e.controls.maxDistance=e.skyRadius,e.controls.addEventListener("start",(function(){e.controlsEngaged=!0;})),e.controls.addEventListener("change",(function(){e.controlsEngaged&&(e.controlsDragging=!0);})),e.controls.addEventListener("end",(function(){e.controlsEngaged=!1,e.controlsDragging=!1;}))),[e.renderer,e.postProcessingComposer].concat(Wx(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix(),e.camera.position.z=1e3,e.scene.add(e.skysphere=new Yx.Mesh),e.skysphere.visible=!1,e.loadComplete=e.scene.visible=!c,window.scene=e.scene;},update:function(t,e){if(t.width&&t.height&&(e.hasOwnProperty("width")||e.hasOwnProperty("height"))&&(t.container.style.width="".concat(t.width,"px"),t.container.style.height="".concat(t.height,"px"),[t.renderer,t.postProcessingComposer].concat(Wx(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix()),e.hasOwnProperty("skyRadius")&&t.skyRadius&&(t.controls.hasOwnProperty("maxDistance")&&e.skyRadius&&(t.controls.maxDistance=Math.min(t.controls.maxDistance,t.skyRadius)),t.camera.far=2.5*t.skyRadius,t.camera.updateProjectionMatrix(),t.skysphere.geometry=new Yx.SphereGeometry(t.skyRadius)),e.hasOwnProperty("backgroundColor")){var n=Mx(t.backgroundColor).alpha;void 0===n&&(n=1),t.renderer.setClearColor(new Yx.Color(Hx(1,t.backgroundColor)),n);}function r(){t.loadComplete=t.scene.visible=!0;}e.hasOwnProperty("backgroundImageUrl")&&(t.backgroundImageUrl?(new Yx.TextureLoader).load(t.backgroundImageUrl,(function(e){e.colorSpace=Yx.SRGBColorSpace,t.skysphere.material=new Yx.MeshBasicMaterial({map:e,side:Yx.BackSide}),t.skysphere.visible=!0,t.onBackgroundImageLoaded&&setTimeout(t.onBackgroundImageLoaded),!t.loadComplete&&r();})):(t.skysphere.visible=!1,t.skysphere.material.map=null,!t.loadComplete&&r())),e.hasOwnProperty("showNavInfo")&&(t.navInfo.style.display=t.showNavInfo?null:"none"),e.hasOwnProperty("lights")&&((e.lights||[]).forEach((function(e){return t.scene.remove(e)})),t.lights.forEach((function(e){return t.scene.add(e)}))),e.hasOwnProperty("objects")&&((e.objects||[]).forEach((function(e){return t.scene.remove(e)})),t.objects.forEach((function(e){return t.scene.add(e)})));}});function Kx(t,e){var n=new e;return n._destructor&&n._destructor(),{linkProp:function(e){return {default:n[e](),onChange:function(n,r){r[t][e](n);},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var r=n[t],i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=r[e].apply(r,a);return s===r?this:s}}}}var Jx=["rendererConfig","waitForGlobeReady"],$x=e(e({},window.THREE?window.THREE:{AmbientLight:class extends Hs{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight";}},DirectionalLight:class extends Hs{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(ln.DEFAULT_UP),this.updateMatrix(),this.target=new ln,this.shadow=new Qs;}dispose(){this.shadow.dispose();}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}},Vector2:Lt,REVISION:s}),{},{CSS2DRenderer:class{constructor(t={}){const e=this;let n,r,i,a;const o={objects:new WeakMap},s=void 0!==t.element?t.element:document.createElement("div");function A(t,n,r){if(t.isCSS2DObject){aA.setFromMatrixPosition(t.matrixWorld),aA.applyMatrix4(sA);const A=!0===t.visible&&aA.z>=-1&&aA.z<=1&&!0===t.layers.test(r.layers);if(t.element.style.display=!0===A?"":"none",!0===A){t.onBeforeRender(e,n,r);const o=t.element;o.style.transform="translate("+-100*t.center.x+"%,"+-100*t.center.y+"%)translate("+(aA.x*i+i)+"px,"+(-aA.y*a+a)+"px)",o.parentNode!==s&&s.appendChild(o),t.onAfterRender(e,n,r);}const c={distanceToCameraSquared:l(r,t)};o.objects.set(t,c);}for(let e=0,i=t.children.length;e<i;e++)A(t.children[e],n,r);}function l(t,e){return AA.setFromMatrixPosition(t.matrixWorld),lA.setFromMatrixPosition(e.matrixWorld),AA.distanceToSquared(lA)}s.style.overflow="hidden",this.domElement=s,this.getSize=function(){return {width:n,height:r}},this.render=function(t,e){!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),oA.copy(e.matrixWorldInverse),sA.multiplyMatrices(e.projectionMatrix,oA),A(t,t,e),function(t){const e=function(t){const e=[];return t.traverse((function(t){t.isCSS2DObject&&e.push(t);})),e}(t).sort((function(t,e){if(t.renderOrder!==e.renderOrder)return e.renderOrder-t.renderOrder;return o.objects.get(t).distanceToCameraSquared-o.objects.get(e).distanceToCameraSquared})),n=e.length;for(let t=0,r=e.length;t<r;t++)e[t].element.style.zIndex=n-t;}(t);},this.setSize=function(t,e){n=t,r=e,i=n/2,a=r/2,s.style.width=t+"px",s.style.height=e+"px";};}}}),tb=Kx("globe",Oy),eb=Object.assign.apply(Object,a(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude","onGlobeReady","pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration","arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration","polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration","pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration","heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration","hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration","hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration","tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration","ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod","labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration","htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration","objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject","customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return r({},t,tb.linkProp(t))})))),nb=Object.assign.apply(Object,a(["globeMaterial","getGlobeRadius","getCoords","toGeoCoords"].map((function(t){return r({},t,tb.linkMethod(t))})))),rb=Kx("renderObjs",Zx),ib=Object.assign.apply(Object,a(["width","height","backgroundColor","backgroundImageUrl","enablePointerInteraction"].map((function(t){return r({},t,rb.linkProp(t))})))),ab=Object.assign.apply(Object,a(["lights","postProcessingComposer"].map((function(t){return r({},t,rb.linkMethod(t))})))),ob=jA({props:e(e({onZoom:{triggerUpdate:!1},onGlobeClick:{triggerUpdate:!1},onGlobeRightClick:{triggerUpdate:!1},pointLabel:{default:"name",triggerUpdate:!1},onPointClick:{triggerUpdate:!1},onPointRightClick:{triggerUpdate:!1},onPointHover:{triggerUpdate:!1},arcLabel:{default:"name",triggerUpdate:!1},onArcClick:{triggerUpdate:!1},onArcRightClick:{triggerUpdate:!1},onArcHover:{triggerUpdate:!1},polygonLabel:{default:"name",triggerUpdate:!1},onPolygonClick:{triggerUpdate:!1},onPolygonRightClick:{triggerUpdate:!1},onPolygonHover:{triggerUpdate:!1},pathLabel:{default:"name",triggerUpdate:!1},onPathClick:{triggerUpdate:!1},onPathRightClick:{triggerUpdate:!1},onPathHover:{triggerUpdate:!1},onHeatmapClick:{triggerUpdate:!1},onHeatmapRightClick:{triggerUpdate:!1},onHeatmapHover:{triggerUpdate:!1},hexLabel:{triggerUpdate:!1},onHexClick:{triggerUpdate:!1},onHexRightClick:{triggerUpdate:!1},onHexHover:{triggerUpdate:!1},hexPolygonLabel:{triggerUpdate:!1},onHexPolygonClick:{triggerUpdate:!1},onHexPolygonRightClick:{triggerUpdate:!1},onHexPolygonHover:{triggerUpdate:!1},tileLabel:{default:"name",triggerUpdate:!1},onTileClick:{triggerUpdate:!1},onTileRightClick:{triggerUpdate:!1},onTileHover:{triggerUpdate:!1},labelLabel:{triggerUpdate:!1},onLabelClick:{triggerUpdate:!1},onLabelRightClick:{triggerUpdate:!1},onLabelHover:{triggerUpdate:!1},objectLabel:{default:"name",triggerUpdate:!1},onObjectClick:{triggerUpdate:!1},onObjectRightClick:{triggerUpdate:!1},onObjectHover:{triggerUpdate:!1},customLayerLabel:{default:"name",triggerUpdate:!1},onCustomLayerClick:{triggerUpdate:!1},onCustomLayerRightClick:{triggerUpdate:!1},onCustomLayerHover:{triggerUpdate:!1},pointerEventsFilter:{default:function(){return !0},triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.hoverFilter((function(e){return t(e,e.__data)}))}},lineHoverPrecision:{default:.2,triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.lineHoverPrecision(t)}}},eb),ib),methods:e(e({pauseAnimation:function(t){var e;return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),null===(e=t.globe)||void 0===e||e.pauseAnimation(),this},resumeAnimation:function(t){var e;return null===t.animationFrameRequestId&&this._animationCycle(),null===(e=t.globe)||void 0===e||e.resumeAnimation(),this},_animationCycle:function(t){t.renderObjs.tick(),t.animationFrameRequestId=requestAnimationFrame(this._animationCycle);},pointOfView:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.globe.toGeoCoords(t.renderObjs.cameraPosition());if(void 0===e.lat&&void 0===e.lng&&void 0===e.altitude)return r;var i=Object.assign({},r,e);if(["lat","lng","altitude"].forEach((function(t){return i[t]=+i[t]})),n){for(;r.lng-i.lng>180;)r.lng-=360;for(;r.lng-i.lng<-180;)r.lng+=360;new JA(r).to(i,n).easing(WA.Cubic.InOut).onUpdate(a).start();}else a(i);return this;function a(e){var n=e.lat,r=e.lng,i=e.altitude;t.renderObjs.cameraPosition(t.globe.getCoords(n,r,i));}},getScreenCoords:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=(e=t.globe).getCoords.apply(e,r);return t.renderObjs.getScreenCoords(a.x,a.y,a.z)},toGlobeCoords:function(t,e,n){var r=t.renderObjs.intersectingObjects(e,n).find((function(t){return "globe"===t.object.__globeObjType}));if(!r)return null;var i=t.globe.toGeoCoords(r.point);return {lat:i.lat,lng:i.lng}},scene:function(t){return t.renderObjs.scene()},camera:function(t){return t.renderObjs.camera()},renderer:function(t){return t.renderObjs.renderer()},controls:function(t){return t.renderObjs.controls()},_destructor:function(t){t.globe._destructor(),this.pauseAnimation(),this.pointsData([]),this.arcsData([]),this.polygonsData([]),this.pathsData([]),this.heatmapsData([]),this.hexBinPointsData([]),this.hexPolygonsData([]),this.tilesData([]),this.labelsData([]),this.htmlElementsData([]),this.objectsData([]),this.customLayerData([]);}},nb),ab),stateInit:function(t){var n=t.rendererConfig,r=t.waitForGlobeReady,a=void 0===r||r,o=i(t,Jx),s=new Oy(e({waitForGlobeReady:a},o));return {globe:s,renderObjs:Zx({controlType:"orbit",rendererConfig:n,waitForLoadComplete:a,extraRenderers:[new $x.CSS2DRenderer]}).skyRadius(500*s.getGlobeRadius()).showNavInfo(!1).objects([s]).lights([new $x.AmbientLight(13421772,Math.PI),new $x.DirectionalLight(16777215,.6*Math.PI)])}},init:function(t,e){var n=this;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.style.position="relative";var r=document.createElement("div");e.container.appendChild(r),e.renderObjs(r),e.globe.rendererSize(e.renderObjs.renderer().getSize(new $x.Vector2)),this.pointOfView({altitude:2.5});var i=e.globe.getGlobeRadius(),a=e.renderObjs.controls();a.minDistance=1.01*i,a.maxDistance=100*i,a.enablePan=!1,a.enableDamping=!0,a.dampingFactor=.1,a.rotateSpeed=.3,a.zoomSpeed=.3,a.addEventListener("change",(function(){var t=n.pointOfView();a.rotateSpeed=.2*t.altitude,a.zoomSpeed=.1*(t.altitude+1),e.globe.setPointOfView(e.renderObjs.camera().position),e.onZoom&&e.onZoom(t);}));var o=function(t){for(var e=t;e&&!e.hasOwnProperty("__globeObjType");)e=e.parent;return e},s={point:function(t){return t},arc:function(t){return t},polygon:function(t){return t.data},path:function(t){return t},heatmap:function(t){return t},hexbin:function(t){return t},hexPolygon:function(t){return t},tile:function(t){return t},label:function(t){return t},object:function(t){return t},custom:function(t){return t}};$x.REVISION<155&&(e.renderObjs.renderer().useLegacyLights=!1),e.renderObjs.hoverOrderComparator((function(t,e){var n=o(t),r=o(e),i=function(t){return !t};return i(n)-i(r)})).tooltipContent((function(t){var n={point:e.pointLabel,arc:e.arcLabel,polygon:e.polygonLabel,path:e.pathLabel,hexbin:e.hexLabel,hexPolygon:e.hexPolygonLabel,tile:e.tileLabel,label:e.labelLabel,object:e.objectLabel,custom:e.customLayerLabel},r=o(t),i=r&&r.__globeObjType;return r&&i&&n.hasOwnProperty(i)&&s.hasOwnProperty(i)&&sf(n[i])(s[i](r.__data))||""})).onHover((function(t){var n={point:e.onPointHover,arc:e.onArcHover,polygon:e.onPolygonHover,path:e.onPathHover,heatmap:e.onHeatmapHover,hexbin:e.onHexHover,hexPolygon:e.onHexPolygonHover,tile:e.onTileHover,label:e.onLabelHover,object:e.onObjectHover,custom:e.onCustomLayerHover},r={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},i=o(t);if(i&&!n.hasOwnProperty(i.__globeObjType)&&(i=null),i!==e.hoverObj){var a=e.hoverObj?e.hoverObj.__globeObjType:null,A=e.hoverObj?s[a](e.hoverObj.__data):null,l=i?i.__globeObjType:null,c=i?s[l](i.__data):null;a&&a!==l&&n[a]&&n[a](null,A),l&&n[l]&&n[l](c,a===l?A:null),e.renderObjs.renderer().domElement.classList[l&&r[l]?"add":"remove"]("clickable"),e.hoverObj=i;}})).onClick((function(t,r,i){if(t){var a={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},A=o(t),l=A.__globeObjType;if(A&&a.hasOwnProperty(l)&&a[l]){var c=[r];if("globe"===l){var u=n.toGeoCoords(i),h=u.lat,f=u.lng;c.unshift({lat:h,lng:f});}else c.push(n.toGeoCoords(i));s.hasOwnProperty(l)&&c.unshift(s[l](A.__data)),a[l].apply(a,c);}}})).onRightClick((function(t,r,i){if(t){var a={globe:e.onGlobeRightClick,point:e.onPointRightClick,arc:e.onArcRightClick,polygon:e.onPolygonRightClick,path:e.onPathRightClick,heatmap:e.onHeatmapRightClick,hexbin:e.onHexRightClick,hexPolygon:e.onHexPolygonRightClick,tile:e.onTileRightClick,label:e.onLabelRightClick,object:e.onObjectRightClick,custom:e.onCustomLayerRightClick},A=o(t),l=A.__globeObjType;if(A&&a.hasOwnProperty(l)&&a[l]){var c=[r];if("globe"===l){var u=n.toGeoCoords(i),h=u.lat,f=u.lng;c.unshift({lat:h,lng:f});}else c.push(n.toGeoCoords(i));s.hasOwnProperty(l)&&c.unshift(s[l](A.__data)),a[l].apply(a,c);}}})),this._animationCycle();}});return ob}));
     35   */var ig={};Xm.forEach((function(t){ig[t[0]]=Vm.cwrap.apply(Vm,t)}));var ag=16,og=4,sg=8,Ag=ig.sizeOfH3Index(),lg=ig.sizeOfLatLng(),cg=ig.sizeOfCellBoundary(),ug=ig.sizeOfGeoPolygon(),hg=ig.sizeOfGeoLoop();ig.sizeOfLinkedGeoPolygon(),ig.sizeOfCoordIJ();var fg=Math.pow(2,32)-1;var dg=/[^0-9a-fA-F]/;function pg(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||dg.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),ag);return[parseInt(t.substring(t.length-8),ag),e]}function mg(t){if(t>=0)return t.toString(ag);var e=gg(8,(t&=2147483647).toString(ag));return e=(parseInt(e[0],ag)+8).toString(ag)+e.substring(1)}function gg(t,e){for(var n=t-e.length,r="",i=0;i<n;i++)r+="0";return r+=e}function vg(t,e,n){for(var r=t.length,i=Vm._calloc(r,lg),a=n?1:0,o=n?0:1,s=0;s<2*r;s+=2)Vm.HEAPF64.set([t[s/2][a],t[s/2][o]].map(Tg),i/sg+s);return Vm.HEAPU32.set([r,i],e/og),e}function _g(t,e){void 0===e&&(e=0);var n=Vm.getValue(t+Ag*e,"i32"),r=Vm.getValue(t+Ag*e+og,"i32");return r?function(t,e){return mg(e)+gg(8,mg(t))}(n,r):null}function yg(t){return 180*Vm.getValue(t,"double")/Math.PI}function xg(t){return[yg(t),yg(t+sg)]}function bg(t){return[yg(t+sg),yg(t)]}function Mg(t,e,n){var r=Vm._malloc(lg);Vm.HEAPF64.set([t,e].map(Tg),r/sg);var i=Vm._malloc(Ag);try{return rg(ig.latLngToCell(r,n,i)),function(t){if(!t)throw ng(Km);return t}(_g(i))}finally{Vm._free(i),Vm._free(r)}}function wg(t){var e=Vm._malloc(lg),n=pg(t),r=n[0],i=n[1];try{return rg(ig.cellToLatLng(r,i,e)),xg(e)}finally{Vm._free(e)}}function Eg(t,e){var n=Vm._malloc(cg),r=pg(t),i=r[0],a=r[1];try{return rg(ig.cellToBoundary(i,a,n)),function(t,e,n){for(var r=Vm.getValue(t,"i32"),i=t+sg,a=[],o=e?bg:xg,s=0;s<2*r;s+=2)a.push(o(i+sg*s));return n&&a.push(a[0]),a}(n,e,e)}finally{Vm._free(n)}}function Sg(t,e,n){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw eg(Qm,t)}(e),n=Boolean(n),0===t.length||0===t[0].length)return[];var r,i=function(t,e){var n,r=t.length-1,i=Vm._calloc(ug),a=0+hg,o=a+og;if(vg(t[0],i+0,e),r>0){n=Vm._calloc(r,hg);for(var s=0;s<r;s++)vg(t[s+1],n+hg*s,e)}return Vm.setValue(i+a,r,"i32"),Vm.setValue(i+o,n,"i32"),i}("number"==typeof t[0][0]?[t]:t,n),a=Vm._malloc(8);try{rg(ig.maxPolygonToCellsSize(i,e,0,a));var o=function(t){if(t>fg)throw ng(Zm,t);return t}((r=a,ig.readInt64AsDoubleFromPointer(r))),s=Vm._calloc(o,Ag);try{return rg(ig.polygonToCells(i,e,0,s)),function(t,e){for(var n=[],r=0;r<e;r++){var i=_g(t,r);null!==i&&n.push(i)}return n}(s,o)}finally{Vm._free(s)}}finally{Vm._free(a),function(t){var e=0+hg,n=e+og,r=og;Vm._free(Vm.getValue(t+0+r,"i8*"));var i=Vm.getValue(t+e,"i32");if(i>0){for(var a=Vm.getValue(t+n,"i32"),o=0;o<i;o++)Vm._free(Vm.getValue(a+hg*o+r,"i8*"));Vm._free(a)}Vm._free(t)}(i)}}function Tg(t){return t*Math.PI/180}var Cg=Rg;function Rg(t,e,n,r){this.x="number"==typeof t?t:0,this.y="number"==typeof e?e:0,this.z="number"==typeof n?n:0,this.half="number"==typeof r?r:0}Rg.prototype.contains=function(t,e,n){var r=this.half;return this.x-r<=t&&t<this.x+r&&this.y-r<=e&&e<this.y+r&&this.z-r<=n&&n<this.z+r};var Pg=Cg,Lg=Dg;function Dg(t){this.bounds=t,this.q0=null,this.q1=null,this.q2=null,this.q3=null,this.q4=null,this.q5=null,this.q6=null,this.q7=null,this.items=null}Dg.prototype.subdivide=function(){var t=this.bounds,e=t.half/2;this.q0=new Dg(new Pg(t.x-e,t.y-e,t.z-e,e)),this.q1=new Dg(new Pg(t.x+e,t.y-e,t.z-e,e)),this.q2=new Dg(new Pg(t.x-e,t.y+e,t.z-e,e)),this.q3=new Dg(new Pg(t.x+e,t.y+e,t.z-e,e)),this.q4=new Dg(new Pg(t.x-e,t.y-e,t.z+e,e)),this.q5=new Dg(new Pg(t.x+e,t.y-e,t.z+e,e)),this.q6=new Dg(new Pg(t.x-e,t.y+e,t.z+e,e)),this.q7=new Dg(new Pg(t.x+e,t.y+e,t.z+e,e))},Dg.prototype.insert=function(t,e,n){if(null===this.q0){if(null===this.items?this.items=[t]:this.items.push(t),this.items.length>=4&&n<16){this.subdivide();for(var r=0;r<this.items.length;++r)this.insert(this.items[r],e,n+1);this.items=null}}else{var i=e[t],a=e[t+1],o=e[t+2],s=this.bounds,A=0;i>s.x&&(A+=1),a>s.y&&(A+=2),o>s.z&&(A+=4);var l=function(t,e){if(0===e)return t.q0;if(1===e)return t.q1;if(2===e)return t.q2;if(3===e)return t.q3;if(4===e)return t.q4;if(5===e)return t.q5;if(6===e)return t.q6;if(7===e)return t.q7}(this,A);l.insert(t,e,n+1)}},Dg.prototype.query=function(t,e,n,r){if(n(this.bounds)){var i=this.items,a="function"==typeof r;if(i)for(var o=0;o<i.length;++o){var s=i[o];a?r(e[s],e[s+1],e[s+2])&&t.push(s):t.push(s)}this.q0&&(this.q0.query(t,e,n,r),this.q1.query(t,e,n,r),this.q2.query(t,e,n,r),this.q3.query(t,e,n,r),this.q4.query(t,e,n,r),this.q5.query(t,e,n,r),this.q6.query(t,e,n,r),this.q7.query(t,e,n,r))}};var Og=function(t,e,n,r){var i=0,a=0,o=(r=r||{}).step||1,s=r.maxTimeMS||8,A=r.probeElements||5e3;setTimeout((function r(){var l=Math.min(t.length,i+A),c=i,u=new Date;for(c=i;c<l;c+=o)e(t[c],c,t);c<t.length?(a+=new Date-u,i=c,A=Math.round(i*s/a),setTimeout(r,0)):n(t)}),0)};var Ig=Cg,qg=Lg,Ug=new Ig,Ng=Og,Bg=function(t){var e,n,r=[],i={initAsync:function(t,r){o(t);var a=s(t);function A(e,n){a.insert(n,t,0)}function l(){n=t,e=a,"function"==typeof r&&r(i)}Ng(t,A,l,{step:3})},init:function(t){o(t),n=t,e=s(t);for(var r=0;r<t.length;r+=3)e.insert(r,n,0)},bounds:function(){return e?e.bounds:Ug},intersectRay:function(t,i,a,o){if(!e)return r;void 0===a&&(a=0);void 0===o&&(o=Number.POSITIVE_INFINITY);a*=a,o*=o;var s=[];return e.query(s,n,A,l),s.sort(c);function A(e){var n,r=e.half,a=(e.x-r-t.x)/i.x,s=(e.x+r-t.x)/i.x,A=(e.y+r-t.y)/i.y,l=(e.y-r-t.y)/i.y,c=(e.z-r-t.z)/i.z,u=(e.z+r-t.z)/i.z,h=Math.min(Math.min(Math.max(a,s),Math.max(A,l)),Math.max(c,u));return!(h<0)&&((n=Math.max(Math.max(Math.min(a,s),Math.min(A,l)),Math.min(c,u)))<=h&&n<=o)}function l(e,n,r){var i=(e-t.x)*(e-t.x)+(n-t.y)*(n-t.y)+(r-t.z)*(r-t.z);return a<=i&&i<=o}function c(e,n){var r=t[e],i=t[e+1],a=t[e+2],o=(r-t.x)*(r-t.x)+(i-t.y)*(i-t.y)+(a-t.z)*(a-t.z),s=t[n],A=t[n+1],l=t[n+2];return o-((s-t.x)*(s-t.x)+(A-t.y)*(A-t.y)+(l-t.z)*(l-t.z))}},intersectSphere:function(t,i,o,s){if(!e)return r;var A=[],l=s*s;return e.query(A,n,c,u),A;function c(e){var n=l,r=e.half;return t<e.x-r?n-=a(t-(e.x-r)):t>e.x+r&&(n-=a(t-(e.x+r))),i<e.y-r?n-=a(i-(e.y-r)):i>e.y+r&&(n-=a(i-(e.y+r))),o<e.z-r?n-=a(o-(e.z-r)):o>e.z+r&&(n-=a(o-(e.z+r))),n>0}function u(e,n,r){return a(e-t)+a(n-i)+a(r-o)<l}},getRoot:function(){return e}};return i;function a(t){return t*t}function o(t){if(!t)throw new Error("Points array is required for quadtree to work");if("number"!=typeof t.length)throw new Error("Points should be array-like object");if(t.length%3!=0)throw new Error("Points array should consist of series of x,y,z coordinates and be multiple of 3")}function s(t){if(0===t.length){var e=new Ig;return new qg(e)}for(var n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,A=0;A<t.length;A+=3){var l=t[A],c=t[A+1],u=t[A+2];l<n&&(n=l),l>a&&(a=l),c<r&&(r=c),c>o&&(o=c),u<i&&(i=u),u>s&&(s=u)}var h=Math.max(Math.max(a-n,o-r),s-i),f=(h+=2)/2,d=new Ig((n-=1)+f,(r-=1)+f,(i-=1)+f,f);return new qg(d)}};var kg=el(Bg);const Fg=window.THREE?window.THREE:{Box3:Ae,BufferGeometry:Hn,Float32BufferAttribute:qn,InstancedBufferGeometry:class extends Hn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}},InstancedInterleavedBuffer:Ks,InterleavedBufferAttribute:Mo,Sphere:Se,Vector3:ae,WireframeGeometry:class extends Hn{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],n=new Set,r=new ae,i=new ae;if(null!==t.index){const a=t.attributes.position,o=t.index;let s=t.groups;0===s.length&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let t=0,A=s.length;t<A;++t){const A=s[t],l=A.start;for(let t=l,s=l+A.count;t<s;t+=3)for(let s=0;s<3;s++){const A=o.getX(t+s),l=o.getX(t+(s+1)%3);r.fromBufferAttribute(a,A),i.fromBufferAttribute(a,l),!0===qs(r,i,n)&&(e.push(r.x,r.y,r.z),e.push(i.x,i.y,i.z))}}}else{const a=t.attributes.position;for(let t=0,o=a.count/3;t<o;t++)for(let o=0;o<3;o++){const s=3*t+o,A=3*t+(o+1)%3;r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,A),!0===qs(r,i,n)&&(e.push(r.x,r.y,r.z),e.push(i.x,i.y,i.z))}}this.setAttribute("position",new qn(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}};var zg=(new Fg.BufferGeometry).setAttribute?"setAttribute":"addAttribute";const Gg=new Fg.Box3,Hg=new Fg.Vector3;class jg extends Fg.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this[zg]("position",new Fg.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this[zg]("uv",new Fg.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(t){const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new Fg.InstancedInterleavedBuffer(e,6,1);return this[zg]("instanceStart",new Fg.InterleavedBufferAttribute(n,3,0)),this[zg]("instanceEnd",new Fg.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new Fg.InstancedInterleavedBuffer(e,6,1);return this[zg]("instanceColorStart",new Fg.InterleavedBufferAttribute(n,3,0)),this[zg]("instanceColorEnd",new Fg.InterleavedBufferAttribute(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new Fg.WireframeGeometry(t.geometry)),this}fromLineSegments(t){const e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Fg.Box3);const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==t&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(t),Gg.setFromBufferAttribute(e),this.boundingBox.union(Gg))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Fg.Sphere),null===this.boundingBox&&this.computeBoundingBox();const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,a=t.count;i<a;i++)Hg.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(Hg)),Hg.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(Hg));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}jg.prototype.isLineSegmentsGeometry=!0;const Vg=window.THREE?window.THREE:{ShaderLib:Ur,ShaderMaterial:dr,UniformsLib:qr,UniformsUtils:fr,Vector2:Lt};Vg.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Vg.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1}},Vg.ShaderLib.line={uniforms:Vg.UniformsUtils.merge([Vg.UniformsLib.common,Vg.UniformsLib.fog,Vg.UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec4 worldPos;\n\t\tvarying vec3 worldStart;\n\t\tvarying vec3 worldEnd;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\tworldStart = start.xyz;\n\t\t\tworldEnd = end.xyz;\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// get the offset direction as perpendicular to the view vector\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 offset;\n\t\t\t\tif ( position.y < 0.5 ) {\n\n\t\t\t\t\toffset = normalize( cross( start.xyz, worldDir ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\toffset = normalize( cross( end.xyz, worldDir ) );\n\n\t\t\t\t}\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\tfloat forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// extend the line bounds to encompass  endcaps\n\t\t\t\t\tstart.xyz += - worldDir * linewidth * 0.5;\n\t\t\t\t\tend.xyz += worldDir * linewidth * 0.5;\n\n\t\t\t\t\t// shift the position of the quad so it hugs the forward edge of the line\n\t\t\t\t\toffset.xy -= dir * forwardOffset;\n\t\t\t\t\toffset.z += 0.5;\n\n\t\t\t\t#endif\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\toffset.xy += dir * 2.0 * forwardOffset;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth * 0.5;\n\n\t\t\t\t// set the world position\n\t\t\t\tworldPos = ( position.y < 0.5 ) ? start : end;\n\t\t\t\tworldPos.xyz += offset;\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segements overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\t\tvarying vec4 worldPos;\n\t\tvarying vec3 worldStart;\n\t\tvarying vec3 worldEnd;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class Wg extends Vg.ShaderMaterial{constructor(t){super({type:"LineMaterial",uniforms:Vg.UniformsUtils.clone(Vg.ShaderLib.line.uniforms),vertexShader:Vg.ShaderLib.line.vertexShader,fragmentShader:Vg.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){!0===t?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return Boolean("USE_DASH"in this.defines)},set(t){Boolean(t)!==Boolean("USE_DASH"in this.defines)&&(this.needsUpdate=!0),!0===t?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("ALPHA_TO_COVERAGE"in this.defines)},set:function(t){Boolean(t)!==Boolean("ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),!0===t?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(t)}}Wg.prototype.isLineMaterial=!0;const Xg=window.THREE?window.THREE:{Box3:Ae,BufferGeometry:Hn,InstancedInterleavedBuffer:Ks,InterleavedBufferAttribute:Mo,Line3:class{constructor(t=new ae,e=new ae){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){nA.subVectors(t,this.start),rA.subVectors(this.end,this.start);const n=rA.dot(rA);let r=rA.dot(nA)/n;return e&&(r=Mt(r,0,1)),r}closestPointToPoint(t,e,n){const r=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},MathUtils:Pt,Matrix4:qe,Mesh:sr,Sphere:Se,Vector3:ae,Vector4:$t};var Qg=(new Xg.BufferGeometry).setAttribute?"setAttribute":"addAttribute";const Yg=new Xg.Vector3,Zg=new Xg.Vector3,Kg=new Xg.Vector4,Jg=new Xg.Vector4,$g=new Xg.Vector4,tv=new Xg.Vector3,ev=new Xg.Matrix4,nv=new Xg.Line3,rv=new Xg.Vector3,iv=new Xg.Box3,av=new Xg.Sphere,ov=new Xg.Vector4;class sv extends Xg.Mesh{constructor(t=new jg,e=new Wg({color:16777215*Math.random()})){super(t,e),this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,r=new Float32Array(2*e.count);for(let t=0,i=0,a=e.count;t<a;t++,i+=2)Yg.fromBufferAttribute(e,t),Zg.fromBufferAttribute(n,t),r[i]=0===i?0:r[i-1],r[i+1]=r[i]+Yg.distanceTo(Zg);const i=new Xg.InstancedInterleavedBuffer(r,2,1);return t[Qg]("instanceDistanceStart",new Xg.InterleavedBufferAttribute(i,1,0)),t[Qg]("instanceDistanceEnd",new Xg.InterleavedBufferAttribute(i,1,1)),this}raycast(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');const n=void 0!==t.params.Line2&&t.params.Line2.threshold||0,r=t.ray,i=t.camera,a=i.projectionMatrix,o=this.matrixWorld,s=this.geometry,A=this.material,l=A.resolution,c=A.linewidth+n,u=s.attributes.instanceStart,h=s.attributes.instanceEnd,f=-i.near,d=2*Math.max(c/l.width,c/l.height);null===s.boundingSphere&&s.computeBoundingSphere(),av.copy(s.boundingSphere).applyMatrix4(o);const p=Math.max(i.near,av.distanceToPoint(r.origin));ov.set(0,0,-p,1).applyMatrix4(i.projectionMatrix),ov.multiplyScalar(1/ov.w),ov.applyMatrix4(i.projectionMatrixInverse);const m=.5*Math.abs(d/ov.w);if(av.radius+=m,!1===t.ray.intersectsSphere(av))return;null===s.boundingBox&&s.computeBoundingBox(),iv.copy(s.boundingBox).applyMatrix4(o);const g=Math.max(i.near,iv.distanceToPoint(r.origin));ov.set(0,0,-g,1).applyMatrix4(i.projectionMatrix),ov.multiplyScalar(1/ov.w),ov.applyMatrix4(i.projectionMatrixInverse);const v=.5*Math.abs(d/ov.w);if(iv.max.x+=v,iv.max.y+=v,iv.max.z+=v,iv.min.x-=v,iv.min.y-=v,iv.min.z-=v,!1!==t.ray.intersectsBox(iv)){r.at(1,$g),$g.w=1,$g.applyMatrix4(i.matrixWorldInverse),$g.applyMatrix4(a),$g.multiplyScalar(1/$g.w),$g.x*=l.x/2,$g.y*=l.y/2,$g.z=0,tv.copy($g),ev.multiplyMatrices(i.matrixWorldInverse,o);for(let t=0,n=u.count;t<n;t++){if(Kg.fromBufferAttribute(u,t),Jg.fromBufferAttribute(h,t),Kg.w=1,Jg.w=1,Kg.applyMatrix4(ev),Jg.applyMatrix4(ev),Kg.z>f&&Jg.z>f)continue;if(Kg.z>f){const t=Kg.z-Jg.z,e=(Kg.z-f)/t;Kg.lerp(Jg,e)}else if(Jg.z>f){const t=Jg.z-Kg.z,e=(Jg.z-f)/t;Jg.lerp(Kg,e)}Kg.applyMatrix4(a),Jg.applyMatrix4(a),Kg.multiplyScalar(1/Kg.w),Jg.multiplyScalar(1/Jg.w),Kg.x*=l.x/2,Kg.y*=l.y/2,Jg.x*=l.x/2,Jg.y*=l.y/2,nv.start.copy(Kg),nv.start.z=0,nv.end.copy(Jg),nv.end.z=0;const n=nv.closestPointToPointParameter(tv,!0);nv.at(n,rv);const i=Xg.MathUtils.lerp(Kg.z,Jg.z,n),s=i>=-1&&i<=1,A=tv.distanceTo(rv)<.5*c;if(s&&A){nv.start.fromBufferAttribute(u,t),nv.end.fromBufferAttribute(h,t),nv.start.applyMatrix4(o),nv.end.applyMatrix4(o);const n=new Xg.Vector3,i=new Xg.Vector3;r.distanceSqToSegment(nv.start,nv.end,i,n),e.push({point:i,pointOnLine:n,distance:r.origin.distanceTo(i),object:this,face:null,faceIndex:t,uv:null,uv2:null})}}}}}sv.prototype.LineSegments2=!0;class Av extends jg{constructor(){super(),this.type="LineGeometry"}setPositions(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return super.setPositions(n),this}setColors(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return super.setColors(n),this}fromLine(t){var e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")}}Av.prototype.isLineGeometry=!0;class lv extends sv{constructor(t=new Av,e=new Wg({color:16777215*Math.random()})){super(t,e),this.type="Line2"}}lv.prototype.isLine2=!0;class cv extends Ls{constructor(t,e={}){const n=e.font;if(void 0===n)super();else{const r=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),super(r,e)}this.type="TextGeometry"}}function uv(t,e,n,r,i){const a=i.glyphs[t]||i.glyphs["?"];if(!a)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".");const o=new iA;let s,A,l,c,u,h,f,d;if(a.o){const t=a._cachedOutline||(a._cachedOutline=a.o.split(" "));for(let i=0,a=t.length;i<a;){switch(t[i++]){case"m":s=t[i++]*e+n,A=t[i++]*e+r,o.moveTo(s,A);break;case"l":s=t[i++]*e+n,A=t[i++]*e+r,o.lineTo(s,A);break;case"q":l=t[i++]*e+n,c=t[i++]*e+r,u=t[i++]*e+n,h=t[i++]*e+r,o.quadraticCurveTo(u,h,l,c);break;case"b":l=t[i++]*e+n,c=t[i++]*e+r,u=t[i++]*e+n,h=t[i++]*e+r,f=t[i++]*e+n,d=t[i++]*e+r,o.bezierCurveTo(u,h,f,d,l,c)}}}return{offsetX:a.ha*e,path:o}}function hv(t,e,n){return e=bv(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ev(t)}(t,fv()?Reflect.construct(e,n||[],bv(t).constructor):e.apply(t,n))}function fv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(fv=function(){return!!t})()}function dv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pv(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dv(Object(n),!0).forEach((function(e){yv(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function mv(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function gv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,mv(r.key),r)}}function _v(t,e,n){return e&&vv(t.prototype,e),n&&vv(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function yv(t,e,n){return(e=mv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xv(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Mv(t,e)}function bv(t){return bv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bv(t)}function Mv(t,e){return Mv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mv(t,e)}function wv(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Ev(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Sv(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Cv(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tv(t){return function(t){if(Array.isArray(t))return Rv(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Cv(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cv(t,e){if(t){if("string"==typeof t)return Rv(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rv(t,e):void 0}}function Rv(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Pv(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Dv(t,e,"get"))}function Lv(t,e,n){return function(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}(t,Dv(t,e,"set"),n),n}function Dv(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Ov(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Iv(t,e,n){Ov(t,e),e.set(t,n)}var qv=function t(e){e instanceof Array?e.forEach(t):(e.map&&e.map.dispose(),e.dispose())},Uv=function t(e){e.geometry&&e.geometry.dispose(),e.material&&qv(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(t)},Nv=function(t){if(t&&t.children)for(;t.children.length;){var e=t.children[0];t.remove(e),Uv(e)}};function Bv(t,e){var n=new e;return{linkProp:function(e){return{default:n[e](),onChange:function(n,r){r[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var r=n[t],i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=r[e].apply(r,a);return s===r?this:s}}}}var kv=100;function Fv(){return kv}function zv(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180,a=kv*(1+n);return{x:a*Math.sin(r)*Math.cos(i),y:a*Math.cos(r),z:a*Math.sin(r)*Math.sin(i)}}function Gv(t){var e=t.x,n=t.y,r=t.z,i=Math.sqrt(e*e+n*n+r*r),a=Math.acos(n/i),o=Math.atan2(r,e);return{lat:90-180*a/Math.PI,lng:90-180*o/Math.PI-(o<-Math.PI/2?360:0),altitude:i/kv-1}}function Hv(t){return t*Math.PI/180}var jv=window.THREE?window.THREE:{BackSide:g,BufferAttribute:Dn,Color:En,Mesh:sr,ShaderMaterial:dr},Vv="\nuniform vec3 color;\nuniform float coefficient;\nuniform float power;\nvarying vec3 vVertexNormal;\nvarying vec3 vVertexWorldPosition;\nvoid main() {\n  vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;\n  vec3 viewCameraToVertex\t= (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz;\n  viewCameraToVertex = normalize(viewCameraToVertex);\n  float intensity\t= pow(\n    coefficient + dot(vVertexNormal, viewCameraToVertex),\n    power\n  );\n  gl_FragColor = vec4(color, intensity);\n}",Wv="\nvarying vec3 vVertexWorldPosition;\nvarying vec3 vVertexNormal;\nvoid main() {\n  vVertexNormal\t= normalize(normalMatrix * normal);\n  vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n  gl_Position\t= projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n",Xv={backside:!0,coefficient:.5,color:"gold",size:2,power:1};function Qv(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xv,n=e.backside,r=e.coefficient,i=e.color,a=e.size,o=e.power,s=function(t,e){for(var n=t.clone(),r=new Float32Array(3*t.attributes.position.count),i=0,a=r.length;i<a;i++){var o=t.attributes.normal.array[i],s=t.attributes.position.array[i];r[i]=s+o*e}return n.setAttribute("position",new jv.BufferAttribute(r,3)),n}(t,a),A=function(t,e,n){return new jv.ShaderMaterial({depthWrite:!1,fragmentShader:Vv,transparent:!0,uniforms:{coefficient:{value:t},color:{value:new jv.Color(e)},power:{value:n}},vertexShader:Wv})}(r,i,o);return n&&(A.side=jv.BackSide),new jv.Mesh(s,A)}var Yv=window.THREE?window.THREE:{Color:En,LineBasicMaterial:Eo,LineSegments:Io,Mesh:sr,MeshPhongMaterial:class extends Cn{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new En(16777215),this.specular=new En(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new En(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ve,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}},SphereGeometry:Os,SRGBColorSpace:rt,TextureLoader:Gs},Zv=jA({props:{globeImageUrl:{},bumpImageUrl:{},showGlobe:{default:!0,onChange:function(t,e){e.globeObj.visible=!!t},triggerUpdate:!1},showGraticules:{default:!1,onChange:function(t,e){e.graticulesObj.visible=!!t},triggerUpdate:!1},showAtmosphere:{default:!0,onChange:function(t,e){e.atmosphereObj&&(e.atmosphereObj.visible=!!t)},triggerUpdate:!1},atmosphereColor:{default:"lightskyblue"},atmosphereAltitude:{default:.15},onReady:{default:function(){},triggerUpdate:!1}},methods:{globeMaterial:function(t,e){return void 0!==e?(t.globeObj.material=e||t.defaultGlobeMaterial,this):t.globeObj.material},_destructor:function(t){Nv(t.globeObj),Nv(t.graticulesObj)}},stateInit:function(){var t=new Yv.SphereGeometry(kv,75,75),e=new Yv.MeshPhongMaterial({color:0}),n=new Yv.Mesh(t,e);return n.rotation.y=-Math.PI/2,n.__globeObjType="globe",{globeObj:n,graticulesObj:new Yv.LineSegments(new $h(xh(),kv,2),new Yv.LineBasicMaterial({color:"lightgrey",transparent:!0,opacity:.1})),defaultGlobeMaterial:e}},init:function(t,e){Nv(t),e.scene=t,e.scene.add(e.globeObj),e.scene.add(e.graticulesObj),e.ready=!1},update:function(t,e){var n=t.globeObj.material;if(e.hasOwnProperty("globeImageUrl")&&(t.globeImageUrl?(new Yv.TextureLoader).load(t.globeImageUrl,(function(e){e.colorSpace=Yv.SRGBColorSpace,n.map=e,n.color=null,n.needsUpdate=!0,!t.ready&&(t.ready=!0)&&setTimeout(t.onReady)})):!n.color&&(n.color=new Yv.Color(0))),e.hasOwnProperty("bumpImageUrl")&&(t.bumpImageUrl?t.bumpImageUrl&&(new Yv.TextureLoader).load(t.bumpImageUrl,(function(t){n.bumpMap=t,n.needsUpdate=!0})):(n.bumpMap=null,n.needsUpdate=!0)),(e.hasOwnProperty("atmosphereColor")||e.hasOwnProperty("atmosphereAltitude"))&&(t.atmosphereObj&&(t.scene.remove(t.atmosphereObj),Nv(t.atmosphereObj)),t.atmosphereColor&&t.atmosphereAltitude)){var r=t.atmosphereObj=Qv(t.globeObj.geometry,{backside:!0,color:t.atmosphereColor,size:kv*t.atmosphereAltitude,power:3.5,coefficient:.1});r.visible=!!t.showAtmosphere,r.__globeObjType="atmosphere",t.scene.add(r)}t.ready||t.globeImageUrl||(t.ready=!0,t.onReady())}}),Kv=function(t){return isNaN(t)?parseInt(Vf(t).toHex(),16):t},Jv=function(t){return t&&isNaN(t)?Sf(t).opacity:1},$v=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=1,a=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.eE+-]+)\s*\)$/.exec(t.trim().toLowerCase());if(a){var o=Sv(a.slice(1),4),s=o[0],A=o[1],l=o[2],c=o[3];e=new En("rgb(".concat(+s,",").concat(+A,",").concat(+l,")")),i=Math.min(+c,1)}else e=new En(t);r&&e.convertLinearToSRGB();var u=e.toArray();return n?[].concat(Tv(u),[i]):u};var t_=window.THREE?window.THREE:{Float32BufferAttribute:qn};function e_(t,e){var n=new(arguments.length>2&&void 0!==arguments[2]?arguments[2]:t_.Float32BufferAttribute)(t.length*e,e);return 1===e?t.forEach((function(t,e){return n.setX(e,t)})):t.forEach((function(t,r){return n.set(t,r*e)})),n}function n_(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).removeDelay,i=void 0===r?0:r;return kd(t,e.children,(function(t){return e.add(t)}),(function(t){var n=function(){e.remove(t),Nv(t),t&&t.hasOwnProperty("__data")&&delete t.__data.__currentTargetD};i?setTimeout(n,i):n()}),pv({objBindAttr:"__threeObj"},n))}var r_=window.THREE?window.THREE:{BufferGeometry:Hn,Color:En,CylinderGeometry:es,Matrix4:qe,Mesh:sr,MeshLambertMaterial:Us,Object3D:ln,Vector3:ae},i_=Object.assign({},of),a_=i_.BufferGeometryUtils||i_,o_=jA({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:function(){return"#ffffaa"}},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.pointLat),n=sf(t.pointLng),r=sf(t.pointAltitude),i=sf(t.pointRadius),a=sf(t.pointColor),o=new r_.CylinderGeometry(1,1,1,t.pointResolution);o.applyMatrix4((new r_.Matrix4).makeRotationX(Math.PI/2)),o.applyMatrix4((new r_.Matrix4).makeTranslation(0,0,-.5));var s=2*Math.PI*kv/360,A={},l=t.pointsMerge?new r_.Object3D:t.scene;if(n_(t.pointsData,l,{createObj:function(){var t=new r_.Mesh(o);return t.__globeObjType="point",t},updateObj:function(o,l){var c=function(e){var n=o.__currentTargetD=e,r=n.r,i=n.alt,a=n.lat,A=n.lng;Object.assign(o.position,zv(a,A));var l=t.pointsMerge?new r_.Vector3(0,0,0):t.scene.localToWorld(new r_.Vector3(0,0,0));o.lookAt(l),o.scale.x=o.scale.y=Math.min(30,r)*s,o.scale.z=Math.max(i*kv,.1)},u={alt:+r(l),r:+i(l),lat:+e(l),lng:+n(l)},h=o.__currentTargetD||Object.assign({},u,{alt:-.001});Object.keys(u).some((function(t){return h[t]!==u[t]}))&&(t.pointsMerge||!t.pointsTransitionDuration||t.pointsTransitionDuration<0?c(u):new JA(h).to(u,t.pointsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(c).start());if(!t.pointsMerge){var f=a(l),d=f?Jv(f):0,p=!!d;o.visible=p,p&&(A.hasOwnProperty(f)||(A[f]=new r_.MeshLambertMaterial({color:Kv(f),transparent:d<1,opacity:d})),o.material=A[f])}}}),t.pointsMerge){var c=t.pointsData.length?(a_.mergeGeometries||a_.mergeBufferGeometries)(t.pointsData.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.clone();e.updateMatrix(),n.applyMatrix4(e.matrix);var r=$v(a(t));return n.setAttribute("color",e_(Tv(new Array(n.getAttribute("position").count)).map((function(){return r})),4)),n}))):new r_.BufferGeometry,u=new r_.Mesh(c,new r_.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0}));u.__globeObjType="points",u.__data=t.pointsData,Nv(t.scene),t.scene.add(u)}}}),s_=["stroke"],A_=window.THREE?window.THREE:{BufferGeometry:Hn,CubicBezierCurve3:Wo,Curve:qo,Group:co,Line:Lo,Mesh:sr,NormalBlending:1,QuadraticBezierCurve3:Yo,ShaderMaterial:dr,TubeGeometry:Is,Vector3:ae},l_=zd.default||zd,c_={uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n    uniform float dashTranslate; \n\n    attribute vec4 vertexColor;\n    varying vec4 vColor;\n    \n    attribute float vertexRelDistance;\n    varying float vRelDistance;\n\n    void main() {\n      // pass through colors and distances\n      vColor = vertexColor;\n      vRelDistance = vertexRelDistance + dashTranslate;\n      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n    }\n  ",fragmentShader:"\n    uniform float dashOffset; \n    uniform float dashSize;\n    uniform float gapSize; \n    \n    varying vec4 vColor;\n    varying float vRelDistance;\n    \n    void main() {\n      // ignore pixels in the gap\n      if (vRelDistance < dashOffset) discard;\n      if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n    \n      // set px color: [r, g, b, a], interpolated between vertices \n      gl_FragColor = vColor; \n    }\n  "},u_=jA({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcColor:{default:function(){return"#ffffaa"}},arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcDashLength:{default:1},arcDashGap:{default:0},arcDashInitialGap:{default:0},arcDashAnimateTime:{default:0},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e){Nv(t),e.scene=t,e.ticker=new l_,e.ticker.onTick.add((function(t,n){e.arcsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],r=e.__dashAnimateStep*n,i=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=i+r}))}))},update:function(t){var e=sf(t.arcStartLat),n=sf(t.arcStartLng),r=sf(t.arcEndLat),i=sf(t.arcEndLng),a=sf(t.arcAltitude),o=sf(t.arcAltitudeAutoScale),s=sf(t.arcStroke),A=sf(t.arcColor),l=sf(t.arcDashLength),c=sf(t.arcDashGap),u=sf(t.arcDashInitialGap),h=sf(t.arcDashAnimateTime),f=new A_.ShaderMaterial(pv(pv({},c_),{},{transparent:!0,blending:A_.NormalBlending}));n_(t.arcsData,t.scene,{createObj:function(){var t=new A_.Group;return t.__globeObjType="arc",t},updateObj:function(d,p){var m=s(p),g=null!=m;if(!d.children.length||g!==("Mesh"===d.children[0].type)){Nv(d);var v=g?new A_.Mesh:new A_.Line(new A_.BufferGeometry);v.material=f.clone(),d.add(v)}var _=d.children[0];Object.assign(_.material.uniforms,{dashSize:{value:l(p)},gapSize:{value:c(p)},dashOffset:{value:u(p)}});var y=h(p);_.__dashAnimateStep=y>0?1e3/y:0;var x=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=e+1;if(t instanceof Array||t instanceof Function){var a=t instanceof Array?Rp().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return $v(a(t),!0,!0)}}else{var o=$v(t,!0,!0);n=function(){return o}}for(var s=[],A=0,l=i;A<l;A++)for(var c=n(A/(l-1)),u=0;u<r;u++)s.push(c);return e_(s,4)}(A(p),t.arcCurveResolution,g?t.arcCircularResolution+1:1),b=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,a=t+1;i<a;i++)for(var o=i/(a-1),s=0;s<e;s++)r.push(o);return n&&r.reverse(),e_(r,1)}(t.arcCurveResolution,g?t.arcCircularResolution+1:1,!0);_.geometry.setAttribute("vertexColor",x),_.geometry.setAttribute("vertexRelDistance",b);var M=function(e){var n=p.__currentTargetD=e,r=n.stroke,i=function(t){var e=t.alt,n=t.altAutoScale,r=t.startLat,i=t.startLng,a=t.endLat,o=t.endLng,s=function(t){var e=Sv(t,3),n=e[0],r=zv(e[1],n,e[2]),i=r.x,a=r.y,o=r.z;return new A_.Vector3(i,a,o)},A=[i,r],l=[o,a],c=e;if(null==c&&(c=ch(A,l)/2*n),c){var u=bh(A,l),h=Sv([.25,.75].map((function(t){return[].concat(Tv(u(t)),[1.5*c])})),2),f=h[0],d=h[1],p=function(t,e,n){if(fv())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Mv(i,n.prototype),i}(A_.CubicBezierCurve3,Tv([A,f,d,l].map(s)));return p}var m=.001;return g.apply(void 0,Tv([[].concat(A,[m]),[].concat(l,[m])].map(s)));function g(t,e){var n=t.angleTo(e),r=0===n?function(){return t.clone()}:function(r){return(new A_.Vector3).addVectors(t.clone().multiplyScalar(Math.sin((1-r)*n)),e.clone().multiplyScalar(Math.sin(r*n))).divideScalar(Math.sin(n))},i=new A_.Curve;return i.getPoint=r,i}}(wv(n,s_));g?(_.geometry&&_.geometry.dispose(),_.geometry=new A_.TubeGeometry(i,t.arcCurveResolution,r/2,t.arcCircularResolution),_.geometry.setAttribute("vertexColor",x),_.geometry.setAttribute("vertexRelDistance",b)):_.geometry.setFromPoints(i.getPoints(t.arcCurveResolution))},w={stroke:m,alt:a(p),altAutoScale:+o(p),startLat:+e(p),startLng:+n(p),endLat:+r(p),endLng:+i(p)},E=p.__currentTargetD||Object.assign({},w,{altAutoScale:-.001});Object.keys(w).some((function(t){return E[t]!==w[t]}))&&(!t.arcsTransitionDuration||t.arcsTransitionDuration<0?M(w):new JA(E).to(w,t.arcsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(M).start())}})}}),h_=window.THREE?window.THREE:{BufferGeometry:Hn,Color:En,DoubleSide:2,Mesh:sr,MeshLambertMaterial:Us,Object3D:ln},f_=Object.assign({},of),d_=f_.BufferGeometryUtils||f_,p_=jA({props:{hexBinPointsData:{default:[]},hexBinPointLat:{default:"lat"},hexBinPointLng:{default:"lng"},hexBinPointWeight:{default:1},hexBinResolution:{default:4},hexMargin:{default:.2},hexTopCurvatureResolution:{default:5},hexTopColor:{default:function(){return"#ffffaa"}},hexSideColor:{default:function(){return"#ffffaa"}},hexAltitude:{default:function(t){return.01*t.sumWeight}},hexBinMerge:{default:!1},hexTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.hexBinPointLat),n=sf(t.hexBinPointLng),r=sf(t.hexBinPointWeight),i=sf(t.hexAltitude),a=sf(t.hexTopColor),o=sf(t.hexSideColor),s=sf(t.hexMargin),A=Rd(t.hexBinPointsData.map((function(r){return pv(pv({},r),{},{h3Idx:Mg(e(r),n(r),t.hexBinResolution)})})),"h3Idx"),l=Object.entries(A).map((function(t){var e=Sv(t,2),n=e[0],i=e[1];return{h3Idx:n,points:i,sumWeight:i.reduce((function(t,e){return t+ +r(e)}),0)}})),c={};if(n_(l,t.hexBinMerge?new h_.Object3D:t.scene,{createObj:function(t){var e=new h_.Mesh;e.__hexCenter=wg(t.h3Idx),e.__hexGeoJson=Eg(t.h3Idx,!0).reverse();var n=e.__hexCenter[1];return e.__hexGeoJson.forEach((function(t){var e=t[0];Math.abs(n-e)>170&&(t[0]+=n>e?360:-360)})),e.__globeObjType="hexbin",e},updateObj:function(e,n){var r=Math.max(0,Math.min(1,+s(n))),A=Sv(e.__hexCenter,2),l=A[0],u=A[1],h=0===r?e.__hexGeoJson:e.__hexGeoJson.map((function(t){var e=Sv(t,2),n=e[0],i=e[1];return[[n,u],[i,l]].map((function(t){var e=Sv(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],r)}))})),f=t.hexTopCurvatureResolution;e.geometry&&e.geometry.dispose(),e.geometry=new jm([h],0,kv,!1,!0,!0,f);var d={alt:+i(n)},p=function(t){var n=(e.__currentTargetD=t).alt;e.scale.x=e.scale.y=e.scale.z=1+n},m=e.__currentTargetD||Object.assign({},d,{alt:-.001});Object.keys(d).some((function(t){return m[t]!==d[t]}))&&(t.hexBinMerge||!t.hexTransitionDuration||t.hexTransitionDuration<0?p(d):new JA(m).to(d,t.hexTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(p).start());if(!t.hexBinMerge){var g=o(n),v=a(n);[g,v].forEach((function(t){if(!c.hasOwnProperty(t)){var e=Jv(t);c[t]=new h_.MeshLambertMaterial({color:Kv(t),transparent:e<1,opacity:e,side:h_.DoubleSide})}})),e.material=[g,v].map((function(t){return c[t]}))}},idAccessor:function(t){return t.h3Idx}}),t.hexBinMerge){var u=l.length?(d_.mergeGeometries||d_.mergeBufferGeometries)(l.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.toNonIndexed();e.updateMatrix(),n.applyMatrix4(e.matrix);var r=$v(a(t)),i=$v(o(t)),s=n.getAttribute("position").count,A=n.groups[0].count;return n.setAttribute("color",e_(Tv(new Array(s)).map((function(t,e){return e>=A?r:i})),4)),n}))):new h_.BufferGeometry,h=new h_.Mesh(u,new h_.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0,side:h_.DoubleSide}));h.__globeObjType="hexBinPoints",h.__data=l,Nv(t.scene),t.scene.add(h)}}}),m_=function(t){return t*t};var g_=Math.sqrt(2*Math.PI);var v_=function(t){var e=Sv(t,2),n=e[0],r=e[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=a.lngAccessor,s=void 0===o?function(t){return t[0]}:o,A=a.latAccessor,l=void 0===A?function(t){return t[1]}:A,c=a.weightAccessor,u=void 0===c?function(){return 1}:c,h=a.bandwidth,f=[n,r],d=h*Math.PI/180;return function(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}(i.map((function(t){var e=u(t);if(!e)return 0;var n,r,i=function(t,e){var n=Math.sqrt,r=Math.cos,i=function(t){return t*Math.PI/180},a=function(t){return m_(Math.sin(t/2))},o=i(t[1]),s=i(e[1]),A=i(t[0]),l=i(e[0]);return 2*Math.asin(n(a(s-o)+r(o)*r(s)*a(l-A)))}(f,[s(t),l(t)]);return n=i,r=d,Math.exp(-m_(n/r)/2)/(r*g_)*e})))},__=window.THREE?window.THREE:{Mesh:sr,MeshLambertMaterial:Us,SphereGeometry:Os},y_=new WeakSet,x_=new WeakMap,b_=new WeakMap,M_=new WeakMap,w_=function(){function t(e,n){var r,i;gv(this,t),Ov(r=this,i=y_),i.add(r),Iv(this,x_,{writable:!0,value:void 0}),Iv(this,b_,{writable:!0,value:void 0}),Iv(this,M_,{writable:!0,value:void 0}),Lv(this,x_,e),Lv(this,b_,kg()),Pv(this,b_).init(e.map((function(t){return[t.x,t.y,t.z]})).flat()),Lv(this,M_,function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,y_,E_).call(this,zv(0,0),zv(0,Math.min(180,n))))}return _v(t,[{key:"getNearPoints",value:function(t,e,n){var r=this;return Pv(this,b_).intersectSphere(t,e,n,Pv(this,M_)).map((function(t){return Pv(r,x_)[t/3]}))}}]),t}();function E_(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)+Math.pow(t.z-e.z,2))}var S_=function(t){var e=Sf(function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}(t));return e.opacity=Math.cbrt(t),e.formatRgb()},T_=jA({props:{heatmapsData:{default:[]},heatmapPoints:{default:function(t){return t}},heatmapPointLat:{default:function(t){return t[0]}},heatmapPointLng:{default:function(t){return t[1]}},heatmapPointWeight:{default:1},heatmapBandwidth:{default:4},heatmapColorFn:{default:function(){return S_}},heatmapColorSaturation:{default:1.5},heatmapBaseAltitude:{default:.01},heatmapTopAltitude:{},heatmapsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.heatmapPoints),n=sf(t.heatmapPointLat),r=sf(t.heatmapPointLng),i=sf(t.heatmapPointWeight),a=sf(t.heatmapBandwidth),o=sf(t.heatmapColorFn),s=sf(t.heatmapColorSaturation),A=sf(t.heatmapBaseAltitude),l=sf(t.heatmapTopAltitude);n_(t.heatmapsData,t.scene,{createObj:function(t){var e=new __.Mesh(new __.SphereGeometry(kv),new __.MeshLambertMaterial({vertexColors:!0,transparent:!0}));return e.__globeObjType="heatmap",e},updateObj:function(c,u){var h=a(u),f=o(u),d=s(u),p=A(u),m=l(u),g=e(u).map((function(t){var e=n(t),a=r(t),o=zv(e,a);return{x:o.x,y:o.y,z:o.z,lat:e,lng:a,weight:i(t)}})),v=Math.max(.1,h/3.5),_=Math.ceil(360/(v||-1));c.geometry.parameters.widthSegments!==_&&(c.geometry.dispose(),c.geometry=new __.SphereGeometry(kv,_,_/2));var y=function(t){for(var e=t.itemSize,n=[],r=0;r<t.count;r++)n.push(t.array.slice(r*e,(r+1)*e));return n}(c.geometry.getAttribute("position")),x=y.map((function(t){var e=Sv(t,3),n=Gv({x:e[0],y:e[1],z:e[2]});return[n.lng,n.lat]})),b=new w_(g,3.5*h),M=x.map((function(t,e){var n=Sv(y[e],3),r=n[0],i=n[1],a=n[2];return v_(t,b.getNearPoints(r,i,a),{latAccessor:function(t){return t.lat},lngAccessor:function(t){return t.lng},weightAccessor:function(t){return t.weight},bandwidth:h})})),w=function(t){var e=c.__currentTargetD=t,n=e.kdeVals,r=e.topAlt,i=e.saturation,a=function(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}(n.map(Math.abs))||1e-15;c.geometry.setAttribute("color",e_(n.map((function(t){return $v(f(t/a*i))})),4));var o=Rp([0,a],[p,r||p]);c.geometry.setAttribute("position",e_(n.map((function(t,e){var n=Sv(x[e],2),r=n[0],i=zv(n[1],r,o(Math.abs(t)));return[i.x,i.y,i.z]})),3))},E={kdeVals:M,topAlt:m,saturation:d},S=c.__currentTargetD||Object.assign({},E,{kdeVals:M.map((function(){return 0})),topAlt:m?p:m,saturation:.5});S.kdeVals.length!==M.length&&(S.kdeVals=M.slice()),Object.keys(E).some((function(t){return S[t]!==E[t]}))&&(!t.heatmapsTransitionDuration||t.heatmapsTransitionDuration<0?w(E):new JA(S).to(E,t.heatmapsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(w).start())}})}}),C_=window.THREE?window.THREE:{DoubleSide:2,Group:co,LineBasicMaterial:Eo,LineSegments:Io,Mesh:sr,MeshBasicMaterial:Rn},R_=jA({props:{polygonsData:{default:[]},polygonGeoJsonGeometry:{default:"geometry"},polygonSideColor:{default:function(){return"#ffffaa"}},polygonSideMaterial:{},polygonCapColor:{default:function(){return"#ffffaa"}},polygonCapMaterial:{},polygonStrokeColor:{},polygonAltitude:{default:.01},polygonCapCurvatureResolution:{default:5},polygonsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.polygonGeoJsonGeometry),n=sf(t.polygonAltitude),r=sf(t.polygonCapCurvatureResolution),i=sf(t.polygonCapColor),a=sf(t.polygonCapMaterial),o=sf(t.polygonSideColor),s=sf(t.polygonSideMaterial),A=sf(t.polygonStrokeColor),l=[];t.polygonsData.forEach((function(t){var c={data:t,capColor:i(t),capMaterial:a(t),sideColor:o(t),sideMaterial:s(t),strokeColor:A(t),altitude:+n(t),capCurvatureResolution:+r(t)},u=e(t),h=t.__id||"".concat(Math.round(1e9*Math.random()));t.__id=h,"Polygon"===u.type?l.push(pv({id:"".concat(h,"_0"),coords:u.coordinates},c)):"MultiPolygon"===u.type?l.push.apply(l,Tv(u.coordinates.map((function(t,e){return pv({id:"".concat(h,"_").concat(e),coords:t},c)})))):console.warn("Unsupported GeoJson geometry type: ".concat(u.type,". Skipping geometry..."))})),n_(l,t.scene,{idAccessor:function(t){return t.id},createObj:function(){var t=new C_.Group;return t.__defaultSideMaterial=new C_.MeshBasicMaterial({side:C_.DoubleSide,depthWrite:!0}),t.__defaultCapMaterial=new C_.MeshBasicMaterial({side:C_.DoubleSide,depthWrite:!0}),t.add(new C_.Mesh(void 0,[t.__defaultSideMaterial,t.__defaultCapMaterial])),t.add(new C_.LineSegments(void 0,new C_.LineBasicMaterial)),t.__globeObjType="polygon",t},updateObj:function(e,n){var r=n.coords,i=n.capColor,a=n.capMaterial,o=n.sideColor,s=n.sideMaterial,A=n.strokeColor,l=n.altitude,c=n.capCurvatureResolution,u=Sv(e.children,2),h=u[0],f=u[1],d=!!A;if(f.visible=d,function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return function(t,e){return t===e}};return Object.entries(e).every((function(e){var r=Sv(e,2),i=r[0],a=r[1];return t.hasOwnProperty(i)&&n(i)(t[i],a)}))}(h.geometry.parameters||{},{polygonGeoJson:r,curvatureResolution:c})||(h.geometry&&h.geometry.dispose(),h.geometry=new jm(r,0,kv,!1,!0,!0,c)),!d||f.geometry.parameters&&f.geometry.parameters.geoJson.coordinates===r&&f.geometry.parameters.resolution===c||(f.geometry&&f.geometry.dispose(),f.geometry=new $h({type:"Polygon",coordinates:r},kv,c)),h.material[0]=s||e.__defaultSideMaterial,h.material[1]=a||e.__defaultCapMaterial,[!s&&o,!a&&i].forEach((function(t,e){if(t){var n=h.material[e],r=Jv(t);n.color.set(Kv(t)),n.transparent=r<1,n.opacity=r}})),d){var p=f.material,m=Jv(A);p.color.set(Kv(A)),p.transparent=m<1,p.opacity=m}var g={alt:l},v=function(t){var n=(e.__currentTargetD=t).alt;h.scale.x=h.scale.y=h.scale.z=1+n,d&&(f.scale.x=f.scale.y=f.scale.z=1+n+1e-4)},_=e.__currentTargetD||Object.assign({},g,{alt:-.001});Object.keys(g).some((function(t){return _[t]!==g[t]}))&&(!t.polygonsTransitionDuration||t.polygonsTransitionDuration<0||_.alt===g.alt?v(g):new JA(_).to(g,t.polygonsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(v).start())}})}});var P_=window.THREE?window.THREE:{BufferGeometry:Hn,CircleGeometry:ts,DoubleSide:2,Mesh:sr,MeshLambertMaterial:Us,Vector3:ae},L_=Object.assign({},of),D_=L_.BufferGeometryUtils||L_,O_=jA({props:{hexPolygonsData:{default:[]},hexPolygonGeoJsonGeometry:{default:"geometry"},hexPolygonColor:{default:function(){return"#ffffaa"}},hexPolygonAltitude:{default:.001},hexPolygonResolution:{default:3},hexPolygonMargin:{default:.2},hexPolygonUseDots:{default:!1},hexPolygonCurvatureResolution:{default:5},hexPolygonDotResolution:{default:12},hexPolygonsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.hexPolygonGeoJsonGeometry),n=sf(t.hexPolygonColor),r=sf(t.hexPolygonAltitude),i=sf(t.hexPolygonResolution),a=sf(t.hexPolygonMargin),o=sf(t.hexPolygonUseDots),s=sf(t.hexPolygonCurvatureResolution),A=sf(t.hexPolygonDotResolution);n_(t.hexPolygonsData,t.scene,{createObj:function(t){var e=new P_.Mesh(void 0,new P_.MeshLambertMaterial({side:P_.DoubleSide}));return e.__globeObjType="hexPolygon",e},updateObj:function(l,c){var u=e(c),h=i(c),f=r(c),d=Math.max(0,Math.min(1,+a(c))),p=o(c),m=s(c),g=A(c),v=n(c),_=Jv(v);l.material.color.set(Kv(v)),l.material.transparent=_<1,l.material.opacity=_;var y={alt:f,margin:d,curvatureResolution:m},x={geoJson:u,h3Res:h},b=l.__currentTargetD||Object.assign({},y,{alt:-.001}),M=l.__currentMemD||x;if(Object.keys(y).some((function(t){return b[t]!==y[t]}))||Object.keys(x).some((function(t){return M[t]!==x[t]}))){l.__currentMemD=x;var w=[];"Polygon"===u.type?Sg(u.coordinates,h,!0).forEach((function(t){return w.push(t)})):"MultiPolygon"===u.type?u.coordinates.forEach((function(t){return Sg(t,h,!0).forEach((function(t){return w.push(t)}))})):console.warn("Unsupported GeoJson geometry type: ".concat(u.type,". Skipping geometry..."));var E=w.map((function(t){var e=wg(t),n=Eg(t,!0).reverse(),r=e[1];return n.forEach((function(t){var e=t[0];Math.abs(r-e)>170&&(t[0]+=r>e?360:-360)})),{h3Idx:t,hexCenter:e,hexGeoJson:n}})),S=function(t){var e=l.__currentTargetD=t,n=e.alt,r=e.margin,i=e.curvatureResolution;l.geometry&&l.geometry.dispose(),l.geometry=E.length?(D_.mergeGeometries||D_.mergeBufferGeometries)(E.map((function(t){var e=Sv(t.hexCenter,2),a=e[0],o=e[1];if(p){var s=zv(a,o,n),A=zv(t.hexGeoJson[0][1],t.hexGeoJson[0][0],n),l=.85*(1-r)*new P_.Vector3(s.x,s.y,s.z).distanceTo(new P_.Vector3(A.x,A.y,A.z)),c=new ts(l,g);return c.rotateX(Hv(-a)),c.rotateY(Hv(o)),c.translate(s.x,s.y,s.z),c}var u=0===r?t.hexGeoJson:t.hexGeoJson.map((function(t){var e=Sv(t,2),n=e[0],i=e[1];return[[n,o],[i,a]].map((function(t){var e=Sv(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],r)}))}));return new jm([u],kv,kv*(1+n),!1,!0,!1,i)}))):new P_.BufferGeometry};!t.hexPolygonsTransitionDuration||t.hexPolygonsTransitionDuration<0?S(y):new JA(b).to(y,t.hexPolygonsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(S).start()}}})}}),I_=window.THREE?window.THREE:{Vector3:ae};function q_(t,e){var n=Math.max(t.length,e.length),r=Yd.apply(void 0,Tv([t,e].map((function(t){return t.map((function(t){return[t.x,t.y,t.z]}))})).map((function(t){return function(t,e){var n=t[t.length-1];return[].concat(Tv(t),Tv(Tv(new Array(e-t.length)).map((function(){return n}))))}(t,n)}))));return function(n){return 0===n?t:1===n?e:r(n).map((function(t){var e=Sv(t,3),n=e[0],r=e[1],i=e[2];return new I_.Vector3(n,r,i)}))}}var U_=window.THREE?window.THREE:{BufferGeometry:Hn,Color:En,Group:co,Line:Lo,NormalBlending:1,ShaderMaterial:dr,Vector3:ae},N_=zd.default||zd,B_={uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n    uniform float dashTranslate;\n\n    attribute vec4 vertexColor;\n    varying vec4 vColor;\n\n    attribute float vertexRelDistance;\n    varying float vRelDistance;\n\n    void main() {\n      // pass through colors and distances\n      vColor = vertexColor;\n      vRelDistance = vertexRelDistance + dashTranslate;\n      gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n    }\n  ",fragmentShader:"\n    uniform float dashOffset;\n    uniform float dashSize;\n    uniform float gapSize;\n\n    varying vec4 vColor;\n    varying float vRelDistance;\n\n    void main() {\n      // ignore pixels in the gap\n      if (vRelDistance < dashOffset) discard;\n      if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n\n      // set px color: [r, g, b, a], interpolated between vertices\n      gl_FragColor = vColor;\n    }\n  "},k_=jA({props:{pathsData:{default:[]},pathPoints:{default:function(t){return t}},pathPointLat:{default:function(t){return t[0]}},pathPointLng:{default:function(t){return t[1]}},pathPointAlt:{default:.001},pathResolution:{default:2},pathColor:{default:function(){return"#ffffaa"}},pathStroke:{},pathDashLength:{default:1},pathDashGap:{default:0},pathDashInitialGap:{default:0},pathDashAnimateTime:{default:0},pathTransitionDuration:{default:1e3,triggerUpdate:!1},rendererSize:{}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e){Nv(t),e.scene=t,e.ticker=new N_,e.ticker.onTick.add((function(t,n){e.pathsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],r=e.__dashAnimateStep*n;if("Line"===e.type){var i=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=i+r}else if("Line2"===e.type){for(var a=e.material.dashOffset-r,o=e.material.dashSize+e.material.gapSize;a<=-o;)a+=o;e.material.dashOffset=a}}))}))},update:function(t){var e=sf(t.pathPoints),n=sf(t.pathPointLat),r=sf(t.pathPointLng),i=sf(t.pathPointAlt),a=sf(t.pathStroke),o=sf(t.pathColor),s=sf(t.pathDashLength),A=sf(t.pathDashGap),l=sf(t.pathDashInitialGap),c=sf(t.pathDashAnimateTime),u=new U_.ShaderMaterial(pv(pv({},B_),{},{transparent:!0,blending:U_.NormalBlending}));function h(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=e+1;if(t instanceof Array||t instanceof Function){var o=t instanceof Array?Rp().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return $v(o(t),i,!0)}}else{var s=$v(t,i,!0);n=function(){return s}}for(var A=[],l=0,c=a;l<c;l++)for(var u=n(l/(c-1)),h=0;h<r;h++)A.push(u);return e_(A,i?4:3)}n_(t.pathsData,t.scene,{createObj:function(){var t=new U_.Group;return t.__globeObjType="path",t},updateObj:function(f,d){var p=a(d),m=null!=p;if(!f.children.length||m===("Line"===f.children[0].type)){Nv(f);var g=m?new lv(new Av,new Wg):new U_.Line(new U_.BufferGeometry,u.clone());f.add(g)}var v,_,y=f.children[0],x=function(t,e,n,r,i){var a=function(t,e,n){for(var r=[],i=1;i<=n;i++)r.push(t+(e-t)*i/(n+1));return r},o=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){for(;Math.abs(n[1]-r[1])>180;)n[1]+=360*(n[1]<r[1]?1:-1);var i=Math.sqrt(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2));if(i>t)for(var o=Math.floor(i/t),s=a(n[0],r[0],o),A=a(n[1],r[1],o),l=a(n[2],r[2],o),c=0,u=s.length;c<u;c++)e.push([s[c],A[c],l[c]])}e.push(n=r)})),e},s=function(t){var e=Sv(t,3),n=zv(e[0],e[1],e[2]),r=n.x,i=n.y,a=n.z;return new U_.Vector3(r,i,a)};return o(t.map((function(t){return[e(t),n(t),r(t)]})),i).map(s)}(e(d),n,r,i,t.pathResolution),b=c(d);if(y.__dashAnimateStep=b>0?1e3/b:0,m){y.material.resolution=t.rendererSize;var M=s(d),w=A(d),E=l(d);y.material.dashed=w>0,y.material.dashed?y.material.defines.USE_DASH="":delete y.material.defines.USE_DASH,y.material.dashed&&(y.material.dashScale=1/(_=0,x.forEach((function(t){v&&(_+=v.distanceTo(t)),v=t})),_),y.material.dashSize=M,y.material.gapSize=w,y.material.dashOffset=-E);var S=o(d);if(S instanceof Array){var T=h(o(d),x.length-1,1,!1);y.geometry.setColors(T.array),y.material.vertexColors=!0}else{var C=S,R=Jv(C);y.material.color=new U_.Color(Kv(C)),y.material.transparent=R<1,y.material.opacity=R,y.material.vertexColors=!1}y.material.needsUpdate=!0}else{Object.assign(y.material.uniforms,{dashSize:{value:s(d)},gapSize:{value:A(d)},dashOffset:{value:l(d)}});var P=h(o(d),x.length),L=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,a=t+1;i<a;i++)for(var o=i/(a-1),s=0;s<e;s++)r.push(o);return n&&r.reverse(),e_(r,1)}(x.length,1,!0);y.geometry.setAttribute("vertexColor",P),y.geometry.setAttribute("vertexRelDistance",L)}var D=q_(d.__currentTargetD&&d.__currentTargetD.points||[x[0]],x),O=function(t){var e,n=d.__currentTargetD=t,r=n.stroke,i=n.interpolK,a=d.__currentTargetD.points=D(i);m?(y.geometry.setPositions((e=[]).concat.apply(e,Tv(a.map((function(t){return[t.x,t.y,t.z]}))))),y.material.linewidth=r,y.material.dashed&&y.computeLineDistances()):(y.geometry.setFromPoints(a),y.geometry.computeBoundingSphere())},I={stroke:p,interpolK:1},q=Object.assign({},d.__currentTargetD||I,{interpolK:0});Object.keys(I).some((function(t){return q[t]!==I[t]}))&&(!t.pathTransitionDuration||t.pathTransitionDuration<0?O(I):new JA(q).to(I,t.pathTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(O).start())}})}}),F_=window.THREE?window.THREE:{Euler:Ve,Mesh:sr,MeshLambertMaterial:Us,SphereGeometry:Os},z_=jA({props:{tilesData:{default:[]},tileLat:{default:"lat"},tileLng:{default:"lng"},tileAltitude:{default:.01},tileWidth:{default:1},tileHeight:{default:1},tileUseGlobeProjection:{default:!0},tileMaterial:{default:function(){return new F_.MeshLambertMaterial({color:"#ffbb88",opacity:.4,transparent:!0})}},tileCurvatureResolution:{default:5},tilesTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.tileLat),n=sf(t.tileLng),r=sf(t.tileAltitude),i=sf(t.tileWidth),a=sf(t.tileHeight),o=sf(t.tileUseGlobeProjection),s=sf(t.tileMaterial),A=sf(t.tileCurvatureResolution);n_(t.tilesData,t.scene,{createObj:function(){var t=new F_.Mesh;return t.__globeObjType="tile",t},updateObj:function(l,c){l.material=s(c);var u=o(c),h=A(c),f=function(t){var e=l.__currentTargetD=t,n=e.lat,r=e.lng,i=e.alt,a=e.width,o=e.height,s=G_(r),A=G_(-n);l.geometry&&l.geometry.dispose(),l.geometry=new F_.SphereGeometry(kv*(1+i),Math.ceil(a/(h||-1)),Math.ceil(o/(h||-1)),G_(90-a/2)+(u?s:0),G_(a),G_(90-o/2)+(u?A:0),G_(o)),u||l.setRotationFromEuler(new F_.Euler(A,s,0,"YXZ"))},d={lat:+e(c),lng:+n(c),alt:+r(c),width:+i(c),height:+a(c)},p=l.__currentTargetD||Object.assign({},d,{width:0,height:0});Object.keys(d).some((function(t){return p[t]!==d[t]}))&&(!t.tilesTransitionDuration||t.tilesTransitionDuration<0?f(d):new JA(p).to(d,t.tilesTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(f).start())}})}}),G_=function(t){return t*Math.PI/180},H_={glyphs:{0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},"ο":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},"Τ":{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},"Π":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},"ΐ":{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"–":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},"Κ":{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},"ƒ":{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},"ό":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},"ώ":{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "},"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"∙":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"ÿ":{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},"µ":{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},"Ι":{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},"Ύ":{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"’":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"Ν":{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},"ς":{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},"Ψ":{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "},"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},"ι":{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},"Ά":{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},"ε":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},"Δ":{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"‰":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"—":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},"ρ":{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},"Η":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"Α":{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"…":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"ν":{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},"β":{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644 603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},"Μ":{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},"Ό":{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ή":{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"•":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},"γ":{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},"α":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"­":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"Χ":{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"†":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},"Ξ":{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},"Ϋ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"”":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},"Ί":{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},"Β":{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},"υ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "},"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},"χ":{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},"ί":{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},"Ζ":{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"‹":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"„":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},"δ":{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},"έ":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},"ω":{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"ϋ":{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},"Ω":{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},"ύ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"™":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},"ή":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},"Θ":{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 280 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},"Ε":{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},"σ":{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},"ζ":{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},"θ":{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},"Ο":{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},"Γ":{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},"Έ":{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ώ":{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},"Ϊ":{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},"Ρ":{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"ª":{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"΅":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},"Φ":{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"⁋":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},"Σ":{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"›":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},"λ":{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},"τ":{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 436 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},"ξ":{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},"Λ":{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},"ΰ":{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"Υ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},"μ":{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"φ":{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"“":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"‘":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},"ϊ":{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257 -5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},"π":{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},"ά":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "},"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},"κ":{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"‡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},"ψ":{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},"η":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}},cssFontWeight:"normal",ascender:1189,underlinePosition:-100,cssFontStyle:"normal",boundingBox:{yMin:-334,xMin:-111,yMax:1189,xMax:1672},resolution:1e3,original_font_information:{postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Μagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Μagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:'Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r\n\r\nThe above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.',manufacturer_name:"Μagenta ltd",font_sub_family_name:"Regular"},descender:-334,familyName:"Helvetiker",lineHeight:1522,underlineThickness:50},j_=pv(pv({},window.THREE?window.THREE:{CircleGeometry:ts,DoubleSide:2,Group:co,Mesh:sr,MeshLambertMaterial:Us,TextGeometry:cv,Vector3:ae}),{},{Font:class{constructor(t){this.isFont=!0,this.type="Font",this.data=t}generateShapes(t,e=100){const n=[],r=function(t,e,n){const r=Array.from(t),i=e/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[];let s=0,A=0;for(let t=0;t<r.length;t++){const e=r[t];if("\n"===e)s=0,A-=a;else{const t=uv(e,i,s,A,n);s+=t.offsetX,o.push(t.path)}}return o}(t,e,this.data);for(let t=0,e=r.length;t<e;t++)n.push(...r[t].toShapes());return n}},TextGeometry:cv}),V_=jA({props:{labelsData:{default:[]},labelLat:{default:"lat"},labelLng:{default:"lng"},labelAltitude:{default:0},labelText:{default:"text"},labelSize:{default:.5},labelTypeFace:{default:H_,onChange:function(t,e){e.font=new j_.Font(t)}},labelColor:{default:function(){return"lightgrey"}},labelRotation:{default:0},labelResolution:{default:3},labelIncludeDot:{default:!0},labelDotRadius:{default:.1},labelDotOrientation:{default:function(){return"bottom"}},labelsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t){var e=sf(t.labelLat),n=sf(t.labelLng),r=sf(t.labelAltitude),i=sf(t.labelText),a=sf(t.labelSize),o=sf(t.labelRotation),s=sf(t.labelColor),A=sf(t.labelIncludeDot),l=sf(t.labelDotRadius),c=sf(t.labelDotOrientation),u=new Set(["right","top","bottom"]),h=2*Math.PI*kv/360,f=new j_.CircleGeometry(1,16);n_(t.labelsData,t.scene,{createObj:function(){var t=new j_.MeshLambertMaterial;t.side=2;var e=new j_.Group;return e.add(new j_.Mesh(f,t)),e.add(new j_.Mesh(void 0,t)),e.__globeObjType="label",e},updateObj:function(f,d){var p=Sv(f.children,2),m=p[0],g=p[1],v=s(d),_=Jv(v);g.material.color.set(Kv(v)),g.material.transparent=_<1,g.material.opacity=_;var y=A(d),x=c(d);!y||!u.has(x)&&(x="bottom");var b=y?+l(d)*h:1e-12;m.scale.x=m.scale.y=b;var M=+a(d)*h;if(g.geometry&&g.geometry.dispose(),g.geometry=new j_.TextGeometry(i(d),{font:t.font,size:M,height:0,curveSegments:t.labelResolution}),"right"!==x&&g.geometry.center(),y){var w=b+M/2;"right"===x&&(g.position.x=w),g.position.y={right:-M/2,top:w+M/2,bottom:-w-M/2}[x]}var E=function(e){var n=f.__currentTargetD=e,r=n.lat,i=n.lng,a=n.alt,o=n.rot,s=n.scale;Object.assign(f.position,zv(r,i,a)),f.lookAt(t.scene.localToWorld(new j_.Vector3(0,0,0))),f.rotateY(Math.PI),f.rotateZ(-o*Math.PI/180),f.scale.x=f.scale.y=f.scale.z=s},S={lat:+e(d),lng:+n(d),alt:+r(d),rot:+o(d),scale:1},T=f.__currentTargetD||Object.assign({},S,{scale:1e-12});Object.keys(S).some((function(t){return T[t]!==S[t]}))&&(!t.labelsTransitionDuration||t.labelsTransitionDuration<0?E(S):new JA(T).to(S,t.labelsTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(E).start())}})}}),W_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;gv(this,e),(t=hv(this,e)).type="CircleLineGeometry",t.parameters={radius:n,segmentCount:r};for(var i=[],a=0;a<=r;a++){var o=(a/r-.25)*Math.PI*2;i.push({x:Math.cos(o)*n,y:Math.sin(o)*n,z:0})}return t.setFromPoints(i),t}return xv(e,t),_v(e)}((window.THREE?window.THREE:{BufferGeometry:Hn}).BufferGeometry),X_=window.THREE?window.THREE:{Color:En,Group:co,Line:Lo,LineBasicMaterial:Eo,Vector3:ae},Q_=zd.default||zd,Y_=jA({props:{ringsData:{default:[]},ringLat:{default:"lat"},ringLng:{default:"lng"},ringAltitude:{default:.0015},ringColor:{default:function(){return"#ffffaa"},triggerUpdate:!1},ringResolution:{default:64,triggerUpdate:!1},ringMaxRadius:{default:2,triggerUpdate:!1},ringPropagationSpeed:{default:1,triggerUpdate:!1},ringRepeatPeriod:{default:700,triggerUpdate:!1}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e){Nv(t),e.scene=t,e.ticker=new Q_,e.ticker.onTick.add((function(t){if(e.ringsData.length){var n=sf(e.ringColor),r=sf(e.ringAltitude),i=sf(e.ringMaxRadius),a=sf(e.ringPropagationSpeed),o=sf(e.ringRepeatPeriod);e.ringsData.filter((function(t){return t.__threeObj})).forEach((function(s){var A,l,c,u=s.__threeObj;if((u.__nextRingTime||0)<=t){var h=o(s)/1e3;u.__nextRingTime=t+(h<=0?1/0:h);var f,d=new X_.Line(new W_(1,e.ringResolution),new X_.LineBasicMaterial),p=n(s),m=p instanceof Array||p instanceof Function;m?p instanceof Array?(f=Rp().domain(p.map((function(t,e){return e/(p.length-1)}))).range(p),d.material.transparent=p.some((function(t){return Jv(t)<1}))):(f=p,d.material.transparent=!0):(d.material.color=new X_.Color(Kv(p)),A=d.material,l=Jv(p),A.opacity=l,A.transparent=l<1,A.depthWrite=void 0===c?l>=1:c);var g=kv*(1+r(s)),v=i(s),_=v*Math.PI/180,y=a(s),x=y<=0,b=function(t){var e=t.t,n=(x?1-e:e)*_;if(d.scale.x=d.scale.y=g*Math.sin(n),d.position.z=g*(1-Math.cos(n)),m){var r=f(e);d.material.color=new X_.Color(Kv(r)),d.material.transparent&&(d.material.opacity=Jv(r))}};if(0===y)b({t:0}),u.add(d);else{var M=1e3*Math.abs(v/y);new JA({t:0}).to({t:1},M).onUpdate(b).onStart((function(){return u.add(d)})).onComplete((function(){u.remove(d),Uv(d)})).start()}}}))}}))},update:function(t){var e=sf(t.ringLat),n=sf(t.ringLng),r=sf(t.ringAltitude),i=t.scene.localToWorld(new X_.Vector3(0,0,0));n_(t.ringsData,t.scene,{createObj:function(){var t=new X_.Group;return t.__globeObjType="ring",t},updateObj:function(t,a){var o=e(a),s=n(a),A=r(a);Object.assign(t.position,zv(o,s,A)),t.lookAt(i)}},{removeDelay:3e4})}}),Z_=pv(pv({},window.THREE?window.THREE:{}),{},{CSS2DObject:class extends ln{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Lt(.5,.5),this.addEventListener("removed",(function(){this.traverse((function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)}))}))}copy(t,e){return super.copy(t,e),this.element=t.element.cloneNode(!0),this.center=t.center,this}}}),K_=jA({props:{htmlElementsData:{default:[]},htmlLat:{default:"lat"},htmlLng:{default:"lng"},htmlAltitude:{default:0},htmlElement:{},htmlTransitionDuration:{default:1e3,triggerUpdate:!1},isBehindGlobe:{onChange:function(){this.updateObjVisibility()},triggerUpdate:!1}},methods:{updateObjVisibility:function(t,e){(e?[e]:t.htmlElementsData.map((function(t){return t.__threeObj})).filter((function(t){return t}))).forEach((function(e){return e.visible=!t.isBehindGlobe||!t.isBehindGlobe(e.position)}))}},init:function(t,e){Nv(t),e.scene=t},update:function(t,e){var n=this,r=sf(t.htmlLat),i=sf(t.htmlLng),a=sf(t.htmlAltitude),o=sf(t.htmlElement);n_(t.htmlElementsData,t.scene,{purge:e.hasOwnProperty("htmlElement"),createObj:function(t){var e=o(t),n=new Z_.CSS2DObject(e);return n.__globeObjType="html",n},updateObj:function(e,o){var s=function(t){var r=e.__currentTargetD=t,i=r.alt,a=r.lat,o=r.lng;Object.assign(e.position,zv(a,o,i)),n.updateObjVisibility(e)},A={lat:+r(o),lng:+i(o),alt:+a(o)};!t.htmlTransitionDuration||t.htmlTransitionDuration<0||!e.__currentTargetD?s(A):new JA(e.__currentTargetD).to(A,t.htmlTransitionDuration).easing(WA.Quadratic.InOut).onUpdate(s).start()}})}}),J_=window.THREE?window.THREE:{Euler:Ve,Group:co,Mesh:sr,MeshLambertMaterial:Us,SphereGeometry:Os},$_=jA({props:{objectsData:{default:[]},objectLat:{default:"lat"},objectLng:{default:"lng"},objectAltitude:{default:.01},objectFacesSurface:{default:!0},objectRotation:{},objectThreeObject:{default:new J_.Mesh(new J_.SphereGeometry(1,16,8),new J_.MeshLambertMaterial({color:"#ffffaa",transparent:!0,opacity:.7}))}},init:function(t,e){Nv(t),e.scene=t},update:function(t,e){var n=sf(t.objectLat),r=sf(t.objectLng),i=sf(t.objectAltitude),a=sf(t.objectFacesSurface),o=sf(t.objectRotation),s=sf(t.objectThreeObject);n_(t.objectsData,t.scene,{purge:e.hasOwnProperty("objectThreeObject"),createObj:function(e){var n=s(e);t.objectThreeObject===n&&(n=n.clone());var r=new J_.Group;return r.add(n),r.__globeObjType="object",r},updateObj:function(t,e){var s=+n(e),A=+r(e),l=+i(e);Object.assign(t.position,zv(s,A,l)),a(e)?t.setRotationFromEuler(new Ve(Hv(-s),Hv(A),0,"YXZ")):t.rotation.set(0,0,0);var c=t.children[0],u=o(e);u&&c.setRotationFromEuler(new Ve(Hv(u.x||0),Hv(u.y||0),Hv(u.z||0)))}})}}),ty=jA({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init:function(t,e){Nv(t),e.scene=t},update:function(t,e){t.customThreeObjectUpdate||Nv(t.scene);var n=sf(t.customThreeObject),r=sf(t.customThreeObjectUpdate);n_(t.customLayerData,t.scene,{purge:e.hasOwnProperty("customThreeObject"),createObj:function(e){var r=n(e,kv);return r&&(t.customThreeObject===r&&(r=r.clone()),r.__globeObjType="custom"),r},updateObj:function(t,e){return r(t,e,kv)}})}}),ey=window.THREE?window.THREE:{Group:co,Vector2:Lt,Vector3:ae},ny=["globeLayer","pointsLayer","arcsLayer","hexBinLayer","heatmapsLayer","polygonsLayer","hexedPolygonsLayer","pathsLayer","tilesLayer","labelsLayer","ringsLayer","htmlElementsLayer","objectsLayer","customLayer"],ry=Bv("globeLayer",Zv),iy=Object.assign.apply(Object,Tv(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude"].map((function(t){return yv({},t,ry.linkProp(t))})))),ay=Object.assign.apply(Object,Tv(["globeMaterial"].map((function(t){return yv({},t,ry.linkMethod(t))})))),oy=Bv("pointsLayer",o_),sy=Object.assign.apply(Object,Tv(["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map((function(t){return yv({},t,oy.linkProp(t))})))),Ay=Bv("arcsLayer",u_),ly=Object.assign.apply(Object,Tv(["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration"].map((function(t){return yv({},t,Ay.linkProp(t))})))),cy=Bv("hexBinLayer",p_),uy=Object.assign.apply(Object,Tv(["hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration"].map((function(t){return yv({},t,cy.linkProp(t))})))),hy=Bv("heatmapsLayer",T_),fy=Object.assign.apply(Object,Tv(["heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration"].map((function(t){return yv({},t,hy.linkProp(t))})))),dy=Bv("hexedPolygonsLayer",O_),py=Object.assign.apply(Object,Tv(["hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration"].map((function(t){return yv({},t,dy.linkProp(t))})))),my=Bv("polygonsLayer",R_),gy=Object.assign.apply(Object,Tv(["polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration"].map((function(t){return yv({},t,my.linkProp(t))})))),vy=Bv("pathsLayer",k_),_y=Object.assign.apply(Object,Tv(["pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration"].map((function(t){return yv({},t,vy.linkProp(t))})))),yy=Bv("tilesLayer",z_),xy=Object.assign.apply(Object,Tv(["tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration"].map((function(t){return yv({},t,yy.linkProp(t))})))),by=Bv("labelsLayer",V_),My=Object.assign.apply(Object,Tv(["labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration"].map((function(t){return yv({},t,by.linkProp(t))})))),wy=Bv("ringsLayer",Y_),Ey=Object.assign.apply(Object,Tv(["ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod"].map((function(t){return yv({},t,wy.linkProp(t))})))),Sy=Bv("htmlElementsLayer",K_),Ty=Object.assign.apply(Object,Tv(["htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration"].map((function(t){return yv({},t,Sy.linkProp(t))})))),Cy=Bv("objectsLayer",$_),Ry=Object.assign.apply(Object,Tv(["objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject"].map((function(t){return yv({},t,Cy.linkProp(t))})))),Py=Bv("customLayer",ty),Ly=Object.assign.apply(Object,Tv(["customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return yv({},t,Py.linkProp(t))})))),Dy=jA({props:pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv(pv({onGlobeReady:{triggerUpdate:!1},rendererSize:{default:new ey.Vector2(window.innerWidth,window.innerHeight),onChange:function(t,e){e.pathsLayer.rendererSize(t)},triggerUpdate:!1}},iy),sy),ly),uy),fy),gy),py),_y),xy),My),Ey),Ty),Ry),Ly),methods:pv({getGlobeRadius:Fv,getCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return zv.apply(void 0,n)},toGeoCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Gv.apply(void 0,n)},setPointOfView:function(t,e,n){var r=void 0;if(e){var i,a,o,s=Fv(),A=n?e.clone().sub(n):e;r=function(t){void 0===i&&(i=A.length()),void 0===a&&(a=Math.sqrt(Math.pow(i,2)-Math.pow(s,2))),void 0===o&&(o=Math.acos(a/i));var e=A.distanceTo(t);if(e<a)return!1;var n=t.length();return Math.acos((Math.pow(i,2)+Math.pow(e,2)-Math.pow(n,2))/(2*i*e))<o}}t.layersThatNeedBehindGlobeChecker.forEach((function(t){return t.isBehindGlobe(r)}))},pauseAnimation:function(t){return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),t.pausableLayers.forEach((function(t){var e;return null===(e=t.pauseAnimation)||void 0===e?void 0:e.call(t)})),this},resumeAnimation:function(t){return null===t.animationFrameRequestId&&this._animationCycle(),t.pausableLayers.forEach((function(t){var e;return null===(e=t.resumeAnimation)||void 0===e?void 0:e.call(t)})),this},_animationCycle:function(t){t.animationFrameRequestId=requestAnimationFrame(this._animationCycle),tl()},_destructor:function(t){this.pauseAnimation(),t.destructableLayers.forEach((function(t){return t._destructor()}))}},ay),stateInit:function(){var t={globeLayer:Zv(),pointsLayer:o_(),arcsLayer:u_(),hexBinLayer:p_(),heatmapsLayer:T_(),polygonsLayer:R_(),hexedPolygonsLayer:O_(),pathsLayer:k_(),tilesLayer:z_(),labelsLayer:V_(),ringsLayer:Y_(),htmlElementsLayer:K_(),objectsLayer:$_(),customLayer:ty()};return pv(pv({},t),{},{layersThatNeedBehindGlobeChecker:Object.values(t).filter((function(t){return t.hasOwnProperty("isBehindGlobe")})),destructableLayers:Object.values(t).filter((function(t){return t.hasOwnProperty("_destructor")})),pausableLayers:Object.values(t).filter((function(t){return t.hasOwnProperty("pauseAnimation")}))})},init:function(t,e,n){var r=n.animateIn,i=void 0===r||r,a=n.waitForGlobeReady,o=void 0===a||a;Nv(t),e.scene=t,e.scene.visible=!1,ny.forEach((function(t){var n=new ey.Group;e.scene.add(n),e[t](n)}));var s=function(){if(i){e.scene.scale.set(1e-6,1e-6,1e-6),new JA({k:1e-6}).to({k:1},600).easing(WA.Quadratic.Out).onUpdate((function(t){var n=t.k;return e.scene.scale.set(n,n,n)})).start();var t=new ey.Vector3(0,1,0);new JA({rot:2*Math.PI}).to({rot:0},1200).easing(WA.Quintic.Out).onUpdate((function(n){var r=n.rot;return e.scene.setRotationFromAxisAngle(t,r)})).start()}e.scene.visible=!0,e.onGlobeReady&&e.onGlobeReady()};o?e.globeLayer.onReady(s):s(),this._animationCycle()},update:function(t){}});var Oy=function(t){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=function(n){function r(){var n;gv(this,r);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return(n=hv(this,r,[].concat(a))).__kapsuleInstance=t.apply(void 0,a).apply(void 0,[].concat(Tv(e?[Ev(n)]:[]),a)),n}return xv(r,n),_v(r)}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object);return Object.keys(t()).forEach((function(t){return n.prototype[t]=function(){var e,n=(e=this.__kapsuleInstance)[t].apply(e,arguments);return n===this.__kapsuleInstance?this:n}})),n}(Dy,(window.THREE?window.THREE:{Group:co}).Group,!0);const Iy={type:"change"},qy={type:"start"},Uy={type:"end"};class Ny extends gt{constructor(t,e){super();const n=this,r=-1,i=0,a=1,o=2,s=3,l=4;this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:A.ROTATE,MIDDLE:A.DOLLY,RIGHT:A.PAN},this.target=new ae;const c=1e-6,u=new ae;let h=1,f=r,d=r,p=0,m=0,g=0;const v=new ae,_=new Lt,y=new Lt,x=new ae,b=new Lt,M=new Lt,w=new Lt,E=new Lt,S=[],T={};this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.zoom0=this.object.zoom,this.handleResize=function(){const t=n.domElement.getBoundingClientRect(),e=n.domElement.ownerDocument.documentElement;n.screen.left=t.left+window.pageXOffset-e.clientLeft,n.screen.top=t.top+window.pageYOffset-e.clientTop,n.screen.width=t.width,n.screen.height=t.height};const C=function(){const t=new Lt;return function(e,r){return t.set((e-n.screen.left)/n.screen.width,(r-n.screen.top)/n.screen.height),t}}(),R=function(){const t=new Lt;return function(e,r){return t.set((e-.5*n.screen.width-n.screen.left)/(.5*n.screen.width),(n.screen.height+2*(n.screen.top-r))/n.screen.width),t}}();function P(t){!1!==n.enabled&&(0===S.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",L),n.domElement.addEventListener("pointerup",D)),function(t){S.push(t)}(t),"touch"===t.pointerType?function(t){if(1===(k(t),S.length))f=s,y.copy(R(S[0].pageX,S[0].pageY)),_.copy(y);else{f=l;const t=S[0].pageX-S[1].pageX,e=S[0].pageY-S[1].pageY;m=p=Math.sqrt(t*t+e*e);const n=(S[0].pageX+S[1].pageX)/2,r=(S[0].pageY+S[1].pageY)/2;w.copy(C(n,r)),E.copy(w)}n.dispatchEvent(qy)}(t):function(t){if(f===r)switch(t.button){case n.mouseButtons.LEFT:f=i;break;case n.mouseButtons.MIDDLE:f=a;break;case n.mouseButtons.RIGHT:f=o}const e=d!==r?d:f;e!==i||n.noRotate?e!==a||n.noZoom?e!==o||n.noPan||(w.copy(C(t.pageX,t.pageY)),E.copy(w)):(b.copy(C(t.pageX,t.pageY)),M.copy(b)):(y.copy(R(t.pageX,t.pageY)),_.copy(y));n.dispatchEvent(qy)}(t))}function L(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){if(1===(k(t),S.length))_.copy(y),y.copy(R(t.pageX,t.pageY));else{const e=function(t){const e=t.pointerId===S[0].pointerId?S[1]:S[0];return T[e.pointerId]}(t),n=t.pageX-e.x,r=t.pageY-e.y;m=Math.sqrt(n*n+r*r);const i=(t.pageX+e.x)/2,a=(t.pageY+e.y)/2;E.copy(C(i,a))}}(t):function(t){const e=d!==r?d:f;e!==i||n.noRotate?e!==a||n.noZoom?e!==o||n.noPan||E.copy(C(t.pageX,t.pageY)):M.copy(C(t.pageX,t.pageY)):(_.copy(y),y.copy(R(t.pageX,t.pageY)))}(t))}function D(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){switch(S.length){case 0:f=r;break;case 1:f=s,y.copy(R(t.pageX,t.pageY)),_.copy(y);break;case 2:f=l;for(let e=0;e<S.length;e++)if(S[e].pointerId!==t.pointerId){const t=T[S[e].pointerId];y.copy(R(t.x,t.y)),_.copy(y);break}}n.dispatchEvent(Uy)}(t):(f=r,n.dispatchEvent(Uy)),B(t),0===S.length&&(n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",L),n.domElement.removeEventListener("pointerup",D)))}function O(t){B(t)}function I(t){!1!==n.enabled&&(window.removeEventListener("keydown",I),d===r&&(t.code!==n.keys[i]||n.noRotate?t.code!==n.keys[a]||n.noZoom?t.code!==n.keys[o]||n.noPan||(d=o):d=a:d=i))}function q(){!1!==n.enabled&&(d=r,window.addEventListener("keydown",I))}function U(t){if(!1!==n.enabled&&!0!==n.noZoom){switch(t.preventDefault(),t.deltaMode){case 2:b.y-=.025*t.deltaY;break;case 1:b.y-=.01*t.deltaY;break;default:b.y-=25e-5*t.deltaY}n.dispatchEvent(qy),n.dispatchEvent(Uy)}}function N(t){!1!==n.enabled&&t.preventDefault()}function B(t){delete T[t.pointerId];for(let e=0;e<S.length;e++)if(S[e].pointerId==t.pointerId)return void S.splice(e,1)}function k(t){let e=T[t.pointerId];void 0===e&&(e=new Lt,T[t.pointerId]=e),e.set(t.pageX,t.pageY)}this.rotateCamera=function(){const t=new ae,e=new ie,r=new ae,i=new ae,a=new ae,o=new ae;return function(){o.set(y.x-_.x,y.y-_.y,0);let s=o.length();s?(v.copy(n.object.position).sub(n.target),r.copy(v).normalize(),i.copy(n.object.up).normalize(),a.crossVectors(i,r).normalize(),i.setLength(y.y-_.y),a.setLength(y.x-_.x),o.copy(i.add(a)),t.crossVectors(o,v).normalize(),s*=n.rotateSpeed,e.setFromAxisAngle(t,s),v.applyQuaternion(e),n.object.up.applyQuaternion(e),x.copy(t),g=s):!n.staticMoving&&g&&(g*=Math.sqrt(1-n.dynamicDampingFactor),v.copy(n.object.position).sub(n.target),e.setFromAxisAngle(x,g),v.applyQuaternion(e),n.object.up.applyQuaternion(e)),_.copy(y)}}(),this.zoomCamera=function(){let t;f===l?(t=p/m,p=m,n.object.isPerspectiveCamera?v.multiplyScalar(t):n.object.isOrthographicCamera?(n.object.zoom=Pt.clamp(n.object.zoom/t,n.minZoom,n.maxZoom),h!==n.object.zoom&&n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(t=1+(M.y-b.y)*n.zoomSpeed,1!==t&&t>0&&(n.object.isPerspectiveCamera?v.multiplyScalar(t):n.object.isOrthographicCamera?(n.object.zoom=Pt.clamp(n.object.zoom/t,n.minZoom,n.maxZoom),h!==n.object.zoom&&n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),n.staticMoving?b.copy(M):b.y+=(M.y-b.y)*this.dynamicDampingFactor)},this.panCamera=function(){const t=new Lt,e=new ae,r=new ae;return function(){if(t.copy(E).sub(w),t.lengthSq()){if(n.object.isOrthographicCamera){const e=(n.object.right-n.object.left)/n.object.zoom/n.domElement.clientWidth,r=(n.object.top-n.object.bottom)/n.object.zoom/n.domElement.clientWidth;t.x*=e,t.y*=r}t.multiplyScalar(v.length()*n.panSpeed),r.copy(v).cross(n.object.up).setLength(t.x),r.add(e.copy(n.object.up).setLength(t.y)),n.object.position.add(r),n.target.add(r),n.staticMoving?w.copy(E):w.add(t.subVectors(E,w).multiplyScalar(n.dynamicDampingFactor))}}}(),this.checkDistances=function(){n.noZoom&&n.noPan||(v.lengthSq()>n.maxDistance*n.maxDistance&&(n.object.position.addVectors(n.target,v.setLength(n.maxDistance)),b.copy(M)),v.lengthSq()<n.minDistance*n.minDistance&&(n.object.position.addVectors(n.target,v.setLength(n.minDistance)),b.copy(M)))},this.update=function(){v.subVectors(n.object.position,n.target),n.noRotate||n.rotateCamera(),n.noZoom||n.zoomCamera(),n.noPan||n.panCamera(),n.object.position.addVectors(n.target,v),n.object.isPerspectiveCamera?(n.checkDistances(),n.object.lookAt(n.target),u.distanceToSquared(n.object.position)>c&&(n.dispatchEvent(Iy),u.copy(n.object.position))):n.object.isOrthographicCamera?(n.object.lookAt(n.target),(u.distanceToSquared(n.object.position)>c||h!==n.object.zoom)&&(n.dispatchEvent(Iy),u.copy(n.object.position),h=n.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type")},this.reset=function(){f=r,d=r,n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.up.copy(n.up0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),v.subVectors(n.object.position,n.target),n.object.lookAt(n.target),n.dispatchEvent(Iy),u.copy(n.object.position),h=n.object.zoom},this.dispose=function(){n.domElement.removeEventListener("contextmenu",N),n.domElement.removeEventListener("pointerdown",P),n.domElement.removeEventListener("pointercancel",O),n.domElement.removeEventListener("wheel",U),n.domElement.removeEventListener("pointermove",L),n.domElement.removeEventListener("pointerup",D),window.removeEventListener("keydown",I),window.removeEventListener("keyup",q)},this.domElement.addEventListener("contextmenu",N),this.domElement.addEventListener("pointerdown",P),this.domElement.addEventListener("pointercancel",O),this.domElement.addEventListener("wheel",U,{passive:!1}),window.addEventListener("keydown",I),window.addEventListener("keyup",q),this.handleResize(),this.update()}}const By={type:"change"},ky={type:"start"},Fy={type:"end"},zy=new Ie,Gy=new Tr,Hy=Math.cos(70*Pt.DEG2RAD);class jy extends gt{constructor(t,e){super(),this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new ae,this.cursor=new ae,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:A.ROTATE,MIDDLE:A.DOLLY,RIGHT:A.PAN},this.touches={ONE:l,TWO:u},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return o.phi},this.getAzimuthalAngle=function(){return o.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(t){t.addEventListener("keydown",tt),this._domElementKeyEvents=t},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",tt),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(By),n.update(),i=r.NONE},this.update=function(){const e=new ae,A=(new ie).setFromUnitVectors(t.up,new ae(0,1,0)),l=A.clone().invert(),c=new ae,u=new ie,h=new ae,p=2*Math.PI;return function(m=null){const g=n.object.position;e.copy(g).sub(n.target),e.applyQuaternion(A),o.setFromVector3(e),n.autoRotate&&i===r.NONE&&L(function(t){return null!==t?2*Math.PI/60*n.autoRotateSpeed*t:2*Math.PI/60/60*n.autoRotateSpeed}(m)),n.enableDamping?(o.theta+=s.theta*n.dampingFactor,o.phi+=s.phi*n.dampingFactor):(o.theta+=s.theta,o.phi+=s.phi);let v=n.minAzimuthAngle,_=n.maxAzimuthAngle;isFinite(v)&&isFinite(_)&&(v<-Math.PI?v+=p:v>Math.PI&&(v-=p),_<-Math.PI?_+=p:_>Math.PI&&(_-=p),o.theta=v<=_?Math.max(v,Math.min(_,o.theta)):o.theta>(v+_)/2?Math.max(v,o.theta):Math.min(_,o.theta)),o.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,o.phi)),o.makeSafe(),!0===n.enableDamping?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor);let y=!1;if(n.zoomToCursor&&S||n.object.isOrthographicCamera)o.radius=k(o.radius);else{const t=o.radius;o.radius=k(o.radius*f),y=t!=o.radius}if(e.setFromSpherical(o),e.applyQuaternion(l),g.copy(n.target).add(e),n.object.lookAt(n.target),!0===n.enableDamping?(s.theta*=1-n.dampingFactor,s.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(s.set(0,0,0),d.set(0,0,0)),n.zoomToCursor&&S){let r=null;if(n.object.isPerspectiveCamera){const t=e.length();r=k(t*f);const i=t-r;n.object.position.addScaledVector(w,i),n.object.updateMatrixWorld(),y=!!i}else if(n.object.isOrthographicCamera){const t=new ae(E.x,E.y,0);t.unproject(n.object);const i=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/f)),n.object.updateProjectionMatrix(),y=i!==n.object.zoom;const a=new ae(E.x,E.y,0);a.unproject(n.object),n.object.position.sub(a).add(t),n.object.updateMatrixWorld(),r=e.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;null!==r&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position):(zy.origin.copy(n.object.position),zy.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(zy.direction))<Hy?t.lookAt(n.target):(Gy.setFromNormalAndCoplanarPoint(n.object.up,n.target),zy.intersectPlane(Gy,n.target))))}else if(n.object.isOrthographicCamera){const t=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/f)),t!==n.object.zoom&&(n.object.updateProjectionMatrix(),y=!0)}return f=1,S=!1,!!(y||c.distanceToSquared(n.object.position)>a||8*(1-u.dot(n.object.quaternion))>a||h.distanceToSquared(n.target)>a)&&(n.dispatchEvent(By),c.copy(n.object.position),u.copy(n.object.quaternion),h.copy(n.target),!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",nt),n.domElement.removeEventListener("pointerdown",Q),n.domElement.removeEventListener("pointercancel",Z),n.domElement.removeEventListener("wheel",K),n.domElement.removeEventListener("pointermove",Y),n.domElement.removeEventListener("pointerup",Z);n.domElement.getRootNode().removeEventListener("keydown",J,{capture:!0}),null!==n._domElementKeyEvents&&(n._domElementKeyEvents.removeEventListener("keydown",tt),n._domElementKeyEvents=null)};const n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let i=r.NONE;const a=1e-6,o=new eA,s=new eA;let f=1;const d=new ae,p=new Lt,m=new Lt,g=new Lt,v=new Lt,_=new Lt,y=new Lt,x=new Lt,b=new Lt,M=new Lt,w=new ae,E=new Lt;let S=!1;const T=[],C={};let R=!1;function P(t){const e=Math.abs(.01*t);return Math.pow(.95,n.zoomSpeed*e)}function L(t){s.theta-=t}function D(t){s.phi-=t}const O=function(){const t=new ae;return function(e,n){t.setFromMatrixColumn(n,0),t.multiplyScalar(-e),d.add(t)}}(),I=function(){const t=new ae;return function(e,r){!0===n.screenSpacePanning?t.setFromMatrixColumn(r,1):(t.setFromMatrixColumn(r,0),t.crossVectors(n.object.up,t)),t.multiplyScalar(e),d.add(t)}}(),q=function(){const t=new ae;return function(e,r){const i=n.domElement;if(n.object.isPerspectiveCamera){const a=n.object.position;t.copy(a).sub(n.target);let o=t.length();o*=Math.tan(n.object.fov/2*Math.PI/180),O(2*e*o/i.clientHeight,n.object.matrix),I(2*r*o/i.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(O(e*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),I(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function U(t){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?f/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function N(t){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?f*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function B(t,e){if(!n.zoomToCursor)return;S=!0;const r=n.domElement.getBoundingClientRect(),i=t-r.left,a=e-r.top,o=r.width,s=r.height;E.x=i/o*2-1,E.y=-a/s*2+1,w.set(E.x,E.y,1).unproject(n.object).sub(n.object.position).normalize()}function k(t){return Math.max(n.minDistance,Math.min(n.maxDistance,t))}function F(t){p.set(t.clientX,t.clientY)}function z(t){v.set(t.clientX,t.clientY)}function G(t){if(1===T.length)p.set(t.pageX,t.pageY);else{const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);p.set(n,r)}}function H(t){if(1===T.length)v.set(t.pageX,t.pageY);else{const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);v.set(n,r)}}function j(t){const e=it(t),n=t.pageX-e.x,r=t.pageY-e.y,i=Math.sqrt(n*n+r*r);x.set(0,i)}function V(t){if(1==T.length)m.set(t.pageX,t.pageY);else{const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);m.set(n,r)}g.subVectors(m,p).multiplyScalar(n.rotateSpeed);const e=n.domElement;L(2*Math.PI*g.x/e.clientHeight),D(2*Math.PI*g.y/e.clientHeight),p.copy(m)}function W(t){if(1===T.length)_.set(t.pageX,t.pageY);else{const e=it(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);_.set(n,r)}y.subVectors(_,v).multiplyScalar(n.panSpeed),q(y.x,y.y),v.copy(_)}function X(t){const e=it(t),r=t.pageX-e.x,i=t.pageY-e.y,a=Math.sqrt(r*r+i*i);b.set(0,a),M.set(0,Math.pow(b.y/x.y,n.zoomSpeed)),U(M.y),x.copy(b);B(.5*(t.pageX+e.x),.5*(t.pageY+e.y))}function Q(t){!1!==n.enabled&&(0===T.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",Y),n.domElement.addEventListener("pointerup",Z)),function(t){for(let e=0;e<T.length;e++)if(T[e]==t.pointerId)return!0;return!1}(t)||(function(t){T.push(t.pointerId)}(t),"touch"===t.pointerType?et(t):function(t){let e;switch(t.button){case 0:e=n.mouseButtons.LEFT;break;case 1:e=n.mouseButtons.MIDDLE;break;case 2:e=n.mouseButtons.RIGHT;break;default:e=-1}switch(e){case A.DOLLY:if(!1===n.enableZoom)return;!function(t){B(t.clientX,t.clientX),x.set(t.clientX,t.clientY)}(t),i=r.DOLLY;break;case A.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enablePan)return;z(t),i=r.PAN}else{if(!1===n.enableRotate)return;F(t),i=r.ROTATE}break;case A.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enableRotate)return;F(t),i=r.ROTATE}else{if(!1===n.enablePan)return;z(t),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(ky)}(t)))}function Y(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){switch(rt(t),i){case r.TOUCH_ROTATE:if(!1===n.enableRotate)return;V(t),n.update();break;case r.TOUCH_PAN:if(!1===n.enablePan)return;W(t),n.update();break;case r.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(t){n.enableZoom&&X(t),n.enablePan&&W(t)}(t),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(t){n.enableZoom&&X(t),n.enableRotate&&V(t)}(t),n.update();break;default:i=r.NONE}}(t):function(t){switch(i){case r.ROTATE:if(!1===n.enableRotate)return;!function(t){m.set(t.clientX,t.clientY),g.subVectors(m,p).multiplyScalar(n.rotateSpeed);const e=n.domElement;L(2*Math.PI*g.x/e.clientHeight),D(2*Math.PI*g.y/e.clientHeight),p.copy(m),n.update()}(t);break;case r.DOLLY:if(!1===n.enableZoom)return;!function(t){b.set(t.clientX,t.clientY),M.subVectors(b,x),M.y>0?U(P(M.y)):M.y<0&&N(P(M.y)),x.copy(b),n.update()}(t);break;case r.PAN:if(!1===n.enablePan)return;!function(t){_.set(t.clientX,t.clientY),y.subVectors(_,v).multiplyScalar(n.panSpeed),q(y.x,y.y),v.copy(_),n.update()}(t)}}(t))}function Z(t){switch(function(t){delete C[t.pointerId];for(let e=0;e<T.length;e++)if(T[e]==t.pointerId)return void T.splice(e,1)}(t),T.length){case 0:n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",Y),n.domElement.removeEventListener("pointerup",Z),n.dispatchEvent(Fy),i=r.NONE;break;case 1:const e=T[0],a=C[e];et({pointerId:e,pageX:a.x,pageY:a.y})}}function K(t){!1!==n.enabled&&!1!==n.enableZoom&&i===r.NONE&&(t.preventDefault(),n.dispatchEvent(ky),function(t){B(t.clientX,t.clientY),t.deltaY<0?N(P(t.deltaY)):t.deltaY>0&&U(P(t.deltaY)),n.update()}(function(t){const e=t.deltaMode,n={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}t.ctrlKey&&!R&&(n.deltaY*=10);return n}(t)),n.dispatchEvent(Fy))}function J(t){if("Control"===t.key){R=!0;n.domElement.getRootNode().addEventListener("keyup",$,{passive:!0,capture:!0})}}function $(t){if("Control"===t.key){R=!1;n.domElement.getRootNode().removeEventListener("keyup",$,{passive:!0,capture:!0})}}function tt(t){!1!==n.enabled&&!1!==n.enablePan&&function(t){let e=!1;switch(t.code){case n.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?D(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(0,n.keyPanSpeed),e=!0;break;case n.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?D(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(0,-n.keyPanSpeed),e=!0;break;case n.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?L(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(n.keyPanSpeed,0),e=!0;break;case n.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?L(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(-n.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),n.update())}(t)}function et(t){switch(rt(t),T.length){case 1:switch(n.touches.ONE){case l:if(!1===n.enableRotate)return;G(t),i=r.TOUCH_ROTATE;break;case c:if(!1===n.enablePan)return;H(t),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(n.touches.TWO){case u:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(t){n.enableZoom&&j(t),n.enablePan&&H(t)}(t),i=r.TOUCH_DOLLY_PAN;break;case h:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(t){n.enableZoom&&j(t),n.enableRotate&&G(t)}(t),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(ky)}function nt(t){!1!==n.enabled&&t.preventDefault()}function rt(t){let e=C[t.pointerId];void 0===e&&(e=new Lt,C[t.pointerId]=e),e.set(t.pageX,t.pageY)}function it(t){const e=t.pointerId===T[0]?T[1]:T[0];return C[e]}n.domElement.addEventListener("contextmenu",nt),n.domElement.addEventListener("pointerdown",Q),n.domElement.addEventListener("pointercancel",Z),n.domElement.addEventListener("wheel",K,{passive:!1});n.domElement.getRootNode().addEventListener("keydown",J,{passive:!0,capture:!0}),this.update()}}const Vy={type:"change"};class Wy extends gt{constructor(t,e){super(),this.object=t,this.domElement=e,this.enabled=!0,this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1;const n=this,r=1e-6,i=new ie,a=new ae;this.tmpQuaternion=new ie,this.status=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new ae(0,0,0),this.rotationVector=new ae(0,0,0),this.keydown=function(t){if(!t.altKey&&!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this.moveState.forward=1;break;case"KeyS":this.moveState.back=1;break;case"KeyA":this.moveState.left=1;break;case"KeyD":this.moveState.right=1;break;case"KeyR":this.moveState.up=1;break;case"KeyF":this.moveState.down=1;break;case"ArrowUp":this.moveState.pitchUp=1;break;case"ArrowDown":this.moveState.pitchDown=1;break;case"ArrowLeft":this.moveState.yawLeft=1;break;case"ArrowRight":this.moveState.yawRight=1;break;case"KeyQ":this.moveState.rollLeft=1;break;case"KeyE":this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(t){if(!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this.moveState.forward=0;break;case"KeyS":this.moveState.back=0;break;case"KeyA":this.moveState.left=0;break;case"KeyD":this.moveState.right=0;break;case"KeyR":this.moveState.up=0;break;case"KeyF":this.moveState.down=0;break;case"ArrowUp":this.moveState.pitchUp=0;break;case"ArrowDown":this.moveState.pitchDown=0;break;case"ArrowLeft":this.moveState.yawLeft=0;break;case"ArrowRight":this.moveState.yawRight=0;break;case"KeyQ":this.moveState.rollLeft=0;break;case"KeyE":this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()}},this.pointerdown=function(t){if(!1!==this.enabled)if(this.dragToLook)this.status++;else{switch(t.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.pointermove=function(t){if(!1!==this.enabled&&(!this.dragToLook||this.status>0)){const e=this.getContainerDimensions(),n=e.size[0]/2,r=e.size[1]/2;this.moveState.yawLeft=-(t.pageX-e.offset[0]-n)/n,this.moveState.pitchDown=(t.pageY-e.offset[1]-r)/r,this.updateRotationVector()}},this.pointerup=function(t){if(!1!==this.enabled){if(this.dragToLook)this.status--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(t.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()}},this.pointercancel=function(){!1!==this.enabled&&(this.dragToLook?(this.status=0,this.moveState.yawLeft=this.moveState.pitchDown=0):(this.moveState.forward=0,this.moveState.back=0,this.updateMovementVector()),this.updateRotationVector())},this.contextMenu=function(t){!1!==this.enabled&&t.preventDefault()},this.update=function(t){if(!1===this.enabled)return;const e=t*n.movementSpeed,o=t*n.rollSpeed;n.object.translateX(n.moveVector.x*e),n.object.translateY(n.moveVector.y*e),n.object.translateZ(n.moveVector.z*e),n.tmpQuaternion.set(n.rotationVector.x*o,n.rotationVector.y*o,n.rotationVector.z*o,1).normalize(),n.object.quaternion.multiply(n.tmpQuaternion),(a.distanceToSquared(n.object.position)>r||8*(1-i.dot(n.object.quaternion))>r)&&(n.dispatchEvent(Vy),i.copy(n.object.quaternion),a.copy(n.object.position))},this.updateMovementVector=function(){const t=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-t+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",o),this.domElement.removeEventListener("pointerdown",A),this.domElement.removeEventListener("pointermove",s),this.domElement.removeEventListener("pointerup",l),this.domElement.removeEventListener("pointercancel",c),window.removeEventListener("keydown",u),window.removeEventListener("keyup",h)};const o=this.contextMenu.bind(this),s=this.pointermove.bind(this),A=this.pointerdown.bind(this),l=this.pointerup.bind(this),c=this.pointercancel.bind(this),u=this.keydown.bind(this),h=this.keyup.bind(this);this.domElement.addEventListener("contextmenu",o),this.domElement.addEventListener("pointerdown",A),this.domElement.addEventListener("pointermove",s),this.domElement.addEventListener("pointerup",l),this.domElement.addEventListener("pointercancel",c),window.addEventListener("keydown",u),window.addEventListener("keyup",h),this.updateMovementVector(),this.updateRotationVector()}}const Xy={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"};class Qy{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const Yy=new Wr(-1,1,1,-1,0,1);const Zy=new class extends Hn{constructor(){super(),this.setAttribute("position",new qn([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new qn([0,2,0,0,2,0],2))}};class Ky{constructor(t){this._mesh=new sr(Zy,t)}dispose(){this._mesh.geometry.dispose()}render(t){t.render(this._mesh,Yy)}get material(){return this._mesh.material}set material(t){this._mesh.material=t}}class Jy extends Qy{constructor(t,e){super(),this.textureID=void 0!==e?e:"tDiffuse",t instanceof dr?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=fr.clone(t.uniforms),this.material=new dr({name:void 0!==t.name?t.name:"unspecified",defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new Ky(this.material)}render(t,e,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class $y extends Qy{constructor(t,e){super(),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(t,e,n){const r=t.getContext(),i=t.state;let a,o;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(a=0,o=1):(a=1,o=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,a,4294967295),i.buffers.stencil.setClear(o),i.buffers.stencil.setLocked(!0),t.setRenderTarget(n),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.color.setMask(!0),i.buffers.depth.setMask(!0),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0)}}class tx extends Qy{constructor(){super(),this.needsSwap=!1}render(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1)}}class ex{constructor(t,e){if(this.renderer=t,this._pixelRatio=t.getPixelRatio(),void 0===e){const n=t.getSize(new Lt);this._width=n.width,this._height=n.height,(e=new ee(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:W})).texture.name="EffectComposer.rt1"}else this._width=e.width,this._height=e.height;this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Jy(Xy),this.copyPass.material.blending=0,this.clock=new Ys}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}isLastEnabledPass(t){for(let e=t+1;e<this.passes.length;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();let n=!1;for(let e=0,r=this.passes.length;e<r;e++){const r=this.passes[e];if(!1!==r.enabled){if(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),r.render(this.renderer,this.writeBuffer,this.readBuffer,t,n),r.needsSwap){if(n){const e=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(e.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),n.setFunc(e.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==$y&&(r instanceof $y?n=!0:r instanceof tx&&(n=!1))}}this.renderer.setRenderTarget(e)}reset(t){if(void 0===t){const e=this.renderer.getSize(new Lt);this._pixelRatio=this.renderer.getPixelRatio(),this._width=e.width,this._height=e.height,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let t=0;t<this.passes.length;t++)this.passes[t].setSize(n,r)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class nx extends Qy{constructor(t,e,n=null,r=null,i=null){super(),this.scene=t,this.camera=e,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=i,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new En}render(t,e,n){const r=t.autoClear;let i,a;t.autoClear=!1,null!==this.overrideMaterial&&(a=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),null!==this.clearColor&&(t.getClearColor(this._oldClearColor),t.setClearColor(this.clearColor)),null!==this.clearAlpha&&(i=t.getClearAlpha(),t.setClearAlpha(this.clearAlpha)),1==this.clearDepth&&t.clearDepth(),t.setRenderTarget(this.renderToScreen?null:n),!0===this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),t.render(this.scene,this.camera),null!==this.clearColor&&t.setClearColor(this._oldClearColor),null!==this.clearAlpha&&t.setClearAlpha(i),null!==this.overrideMaterial&&(this.scene.overrideMaterial=a),t.autoClear=r}}function rx(){return rx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},rx.apply(this,arguments)}function ix(t,e){return ix=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ix(t,e)}function ax(t){return ax=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ax(t)}function ox(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ox=function(){return!!t})()}function sx(t){var e="function"==typeof Map?new Map:void 0;return sx=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(ox())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&ix(i,n.prototype),i}(t,arguments,ax(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ix(n,t)},sx(t)}var Ax={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function lx(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=e[0],a=[];for(r=1;r<e.length;r+=1)a.push(e[r]);return a.forEach((function(t){i=i.replace(/%[a-z]/,t)})),i}var cx=function(t){var e,n;function r(e){var n;if("production"===process.env.NODE_ENV)n=t.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+e+" for more information.")||this;else{for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];n=t.call(this,lx.apply(void 0,[Ax[e]].concat(i)))||this}return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,ix(e,n),r}(sx(Error));function ux(t){return Math.round(255*t)}function hx(t,e,n){return ux(t)+","+ux(e)+","+ux(n)}function fx(t,e,n,r){if(void 0===r&&(r=hx),0===e)return r(n,n,n);var i=(t%360+360)%360/60,a=(1-Math.abs(2*n-1))*e,o=a*(1-Math.abs(i%2-1)),s=0,A=0,l=0;i>=0&&i<1?(s=a,A=o):i>=1&&i<2?(s=o,A=a):i>=2&&i<3?(A=a,l=o):i>=3&&i<4?(A=o,l=a):i>=4&&i<5?(s=o,l=a):i>=5&&i<6&&(s=a,l=o);var c=n-a/2;return r(s+c,A+c,l+c)}var dx={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var px=/^#[a-fA-F0-9]{6}$/,mx=/^#[a-fA-F0-9]{8}$/,gx=/^#[a-fA-F0-9]{3}$/,vx=/^#[a-fA-F0-9]{4}$/,_x=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,yx=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,xx=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,bx=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function Mx(t){if("string"!=typeof t)throw new cx(3);var e=function(t){if("string"!=typeof t)return t;var e=t.toLowerCase();return dx[e]?"#"+dx[e]:t}(t);if(e.match(px))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(mx)){var n=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:n}}if(e.match(gx))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(vx)){var r=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:r}}var i=_x.exec(e);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var a=yx.exec(e.substring(0,50));if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])>1?parseFloat(""+a[4])/100:parseFloat(""+a[4])};var o=xx.exec(e);if(o){var s="rgb("+fx(parseInt(""+o[1],10),parseInt(""+o[2],10)/100,parseInt(""+o[3],10)/100)+")",A=_x.exec(s);if(!A)throw new cx(4,e,s);return{red:parseInt(""+A[1],10),green:parseInt(""+A[2],10),blue:parseInt(""+A[3],10)}}var l=bx.exec(e.substring(0,50));if(l){var c="rgb("+fx(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",u=_x.exec(c);if(!u)throw new cx(4,e,c);return{red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10),alpha:parseFloat(""+l[4])>1?parseFloat(""+l[4])/100:parseFloat(""+l[4])}}throw new cx(5)}function wx(t){return function(t){var e,n=t.red/255,r=t.green/255,i=t.blue/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if(a===o)return void 0!==t.alpha?{hue:0,saturation:0,lightness:s,alpha:t.alpha}:{hue:0,saturation:0,lightness:s};var A=a-o,l=s>.5?A/(2-a-o):A/(a+o);switch(a){case n:e=(r-i)/A+(r<i?6:0);break;case r:e=(i-n)/A+2;break;default:e=(n-r)/A+4}return e*=60,void 0!==t.alpha?{hue:e,saturation:l,lightness:s,alpha:t.alpha}:{hue:e,saturation:l,lightness:s}}(Mx(t))}var Ex=function(t){return 7===t.length&&t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?"#"+t[1]+t[3]+t[5]:t};function Sx(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function Tx(t){return Sx(Math.round(255*t))}function Cx(t,e,n){return Ex("#"+Tx(t)+Tx(e)+Tx(n))}function Rx(t,e,n){return fx(t,e,n,Cx)}function Px(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ex("#"+Sx(t)+Sx(e)+Sx(n));if("object"==typeof t&&void 0===e&&void 0===n)return Ex("#"+Sx(t.red)+Sx(t.green)+Sx(t.blue));throw new cx(6)}function Lx(t,e,n,r){if("string"==typeof t&&"number"==typeof e){var i=Mx(t);return"rgba("+i.red+","+i.green+","+i.blue+","+e+")"}if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof r)return r>=1?Px(t,e,n):"rgba("+t+","+e+","+n+","+r+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===r)return t.alpha>=1?Px(t.red,t.green,t.blue):"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")";throw new cx(7)}var Dx=function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&("number"!=typeof t.alpha||void 0===t.alpha)},Ox=function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&"number"==typeof t.alpha},Ix=function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&("number"!=typeof t.alpha||void 0===t.alpha)},qx=function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&"number"==typeof t.alpha};function Ux(t){if("object"!=typeof t)throw new cx(8);if(Ox(t))return Lx(t);if(Dx(t))return Px(t);if(qx(t))return function(t,e,n,r){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof r)return r>=1?Rx(t,e,n):"rgba("+fx(t,e,n)+","+r+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===r)return t.alpha>=1?Rx(t.hue,t.saturation,t.lightness):"rgba("+fx(t.hue,t.saturation,t.lightness)+","+t.alpha+")";throw new cx(2)}(t);if(Ix(t))return function(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Rx(t,e,n);if("object"==typeof t&&void 0===e&&void 0===n)return Rx(t.hue,t.saturation,t.lightness);throw new cx(1)}(t);throw new cx(8)}function Nx(t,e,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=e?t.apply(this,r):Nx(t,e,r)}}function Bx(t){return Nx(t,t.length,[])}function kx(t,e,n){return Math.max(t,Math.min(e,n))}Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{hue:n.hue+parseFloat(t)}))})),Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{lightness:kx(0,1,n.lightness-parseFloat(t))}))})),Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{saturation:kx(0,1,n.saturation-parseFloat(t))}))})),Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{lightness:kx(0,1,n.lightness+parseFloat(t))}))}));var Fx=Bx((function(t,e,n){if("transparent"===e)return n;if("transparent"===n)return e;if(0===t)return n;var r=Mx(e),i=rx({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),a=Mx(n),o=rx({},a,{alpha:"number"==typeof a.alpha?a.alpha:1}),s=i.alpha-o.alpha,A=2*parseFloat(t)-1,l=((A*s==-1?A:A+s)/(1+A*s)+1)/2,c=1-l;return Lx({red:Math.floor(i.red*l+o.red*c),green:Math.floor(i.green*l+o.green*c),blue:Math.floor(i.blue*l+o.blue*c),alpha:i.alpha*parseFloat(t)+o.alpha*(1-parseFloat(t))})})),zx=Fx;var Gx=Bx((function(t,e){if("transparent"===e)return e;var n=Mx(e);return Lx(rx({},n,{alpha:kx(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(t))/100)}))})),Hx=Gx;Bx((function(t,e){if("transparent"===e)return e;var n=wx(e);return Ux(rx({},n,{saturation:kx(0,1,n.saturation+parseFloat(t))}))})),Bx((function(t,e){return"transparent"===e?e:Ux(rx({},wx(e),{hue:parseFloat(t)}))})),Bx((function(t,e){return"transparent"===e?e:Ux(rx({},wx(e),{lightness:parseFloat(t)}))})),Bx((function(t,e){return"transparent"===e?e:Ux(rx({},wx(e),{saturation:parseFloat(t)}))})),Bx((function(t,e){return"transparent"===e?e:zx(parseFloat(t),"rgb(0, 0, 0)",e)})),Bx((function(t,e){return"transparent"===e?e:zx(parseFloat(t),"rgb(255, 255, 255)",e)})),Bx((function(t,e){if("transparent"===e)return e;var n=Mx(e);return Lx(rx({},n,{alpha:kx(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(t)).toFixed(2)/100)}))}));function jx(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function Vx(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Xx(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wx(t){return function(t){if(Array.isArray(t))return Qx(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Xx(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xx(t,e){if(t){if("string"==typeof t)return Qx(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qx(t,e):void 0}}function Qx(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".scene-nav-info {\n  bottom: 5px;\n  width: 100%;\n  text-align: center;\n  color: slategrey;\n  opacity: 0.7;\n  font-size: 10px;\n}\n\n.scene-tooltip {\n  top: 0;\n  color: lavender;\n  font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n  position: absolute;\n  font-family: sans-serif;\n  pointer-events: none;\n  user-select: none;\n}\n\n.scene-container canvas:focus {\n  outline: none;\n}");var Yx=window.THREE?window.THREE:{WebGLRenderer:yo,Scene:class extends ln{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ve,this.environmentRotation=new Ve,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentRotation.copy(t.environmentRotation),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),e.object.environmentRotation=this.environmentRotation.toArray(),e}},PerspectiveCamera:_r,Raycaster:class{constructor(t,e,n=0,r=1/0){this.ray=new Ie(t,e),this.near=n,this.far=r,this.camera=null,this.layers=new We,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return Js.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Js),this}intersectObject(t,e=!0,n=[]){return tA(t,this,n,e),n.sort($s),n}intersectObjects(t,e=!0,n=[]){for(let r=0,i=t.length;r<i;r++)tA(t[r],this,n,e);return n.sort($s),n}},SRGBColorSpace:rt,TextureLoader:Gs,Vector2:Lt,Vector3:ae,Box3:Ae,Color:En,Mesh:sr,SphereGeometry:Os,MeshBasicMaterial:Rn,BackSide:g,EventDispatcher:gt,MOUSE:A,Quaternion:ie,Spherical:eA,Clock:Ys},Zx=jA({props:{width:{default:window.innerWidth,onChange:function(t,e,n){isNaN(t)&&(e.width=n)}},height:{default:window.innerHeight,onChange:function(t,e,n){isNaN(t)&&(e.height=n)}},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(t,e){e.hoverObj=null,e.toolTipElem&&(e.toolTipElem.innerHTML="")},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return-1},triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(t){if(t.initialised){if(t.controls.update&&t.controls.update(t.clock.getDelta()),t.postProcessingComposer?t.postProcessingComposer.render():t.renderer.render(t.scene,t.camera),t.extraRenderers.forEach((function(e){return e.render(t.scene,t.camera)})),t.enablePointerInteraction){var e=null;if(t.hoverDuringDrag||!t.isPointerDragging){var n=this.intersectingObjects(t.pointerPos.x,t.pointerPos.y).filter((function(e){return t.hoverFilter(e.object)})).sort((function(e,n){return t.hoverOrderComparator(e.object,n.object)})),r=n.length?n[0]:null;e=r?r.object:null,t.intersectionPoint=r?r.point:null}e!==t.hoverObj&&(t.onHover(e,t.hoverObj),t.toolTipElem.innerHTML=e&&sf(t.tooltipContent)(e)||"",t.hoverObj=e)}tl()}return this},getPointerPos:function(t){var e=t.pointerPos;return{x:e.x,y:e.y}},cameraPosition:function(t,e,n,r){var i=t.camera;if(e&&t.initialised){var a=e,o=n||{x:0,y:0,z:0};if(r){var s=Object.assign({},i.position),A=u();new JA(s).to(a,r).easing(WA.Quadratic.Out).onUpdate(l).start(),new JA(A).to(o,r/3).easing(WA.Quadratic.Out).onUpdate(c).start()}else l(a),c(o);return this}return Object.assign({},i.position,{lookAt:u()});function l(t){var e=t.x,n=t.y,r=t.z;void 0!==e&&(i.position.x=e),void 0!==n&&(i.position.y=n),void 0!==r&&(i.position.z=r)}function c(e){var n=new Yx.Vector3(e.x,e.y,e.z);t.controls.target?t.controls.target=n:i.lookAt(n)}function u(){return Object.assign(new Yx.Vector3(0,0,-1e3).applyQuaternion(i.quaternion).add(i.position))}},zoomToFit:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length,i=new Array(r>3?r-3:0),a=3;a<r;a++)i[a-3]=arguments[a];return this.fitToBbox(this.getBbox.apply(this,i),e,n)},fitToBbox:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=t.camera;if(e){var a=new Yx.Vector3(0,0,0),o=2*Math.max.apply(Math,Wx(Object.entries(e).map((function(t){var e=Vx(t,2),n=e[0],r=e[1];return Math.max.apply(Math,Wx(r.map((function(t){return Math.abs(a[n]-t)}))))})))),s=(1-2*r/t.height)*i.fov,A=o/Math.atan(s*Math.PI/180),l=A/i.aspect,c=Math.max(A,l);if(c>0){var u=a.clone().sub(i.position).normalize().multiplyScalar(-c);this.cameraPosition(u,a,n)}}return this},getBbox:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=new Yx.Box3(new Yx.Vector3(0,0,0),new Yx.Vector3(0,0,0)),r=t.objects.filter(e);return r.length?(r.forEach((function(t){return n.expandByObject(t)})),Object.assign.apply(Object,Wx(["x","y","z"].map((function(t){return e={},r=t,i=[n.min[t],n.max[t]],(r=jx(r))in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e;var e,r,i}))))):null},getScreenCoords:function(t,e,n,r){var i=new Yx.Vector3(e,n,r);return i.project(this.camera()),{x:(i.x+1)*t.width/2,y:-(i.y-1)*t.height/2}},getSceneCoords:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=new Yx.Vector2(e/t.width*2-1,-n/t.height*2+1),a=new Yx.Raycaster;return a.setFromCamera(i,t.camera),Object.assign({},a.ray.at(r,new Yx.Vector3))},intersectingObjects:function(t,e,n){var r=new Yx.Vector2(e/t.width*2-1,-n/t.height*2+1),i=new Yx.Raycaster;return i.params.Line.threshold=t.lineHoverPrecision,i.setFromCamera(r,t.camera),i.intersectObjects(t.objects,!0)},renderer:function(t){return t.renderer},scene:function(t){return t.scene},camera:function(t){return t.camera},postProcessingComposer:function(t){return t.postProcessingComposer},controls:function(t){return t.controls},tbControls:function(t){return t.controls}},stateInit:function(){return{scene:new Yx.Scene,camera:new Yx.PerspectiveCamera,clock:new Yx.Clock}},init:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.controlType,i=void 0===r?"trackball":r,a=n.rendererConfig,o=void 0===a?{}:a,s=n.extraRenderers,A=void 0===s?[]:s,l=n.waitForLoadComplete,c=void 0===l||l;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.className="scene-container",e.container.style.position="relative",e.container.appendChild(e.navInfo=document.createElement("div")),e.navInfo.className="scene-nav-info",e.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[i]||"",e.navInfo.style.display=e.showNavInfo?null:"none",e.toolTipElem=document.createElement("div"),e.toolTipElem.classList.add("scene-tooltip"),e.container.appendChild(e.toolTipElem),e.pointerPos=new Yx.Vector2,e.pointerPos.x=-2,e.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(t){return e.container.addEventListener(t,(function(n){if("pointerdown"===t&&(e.isPointerPressed=!0),!e.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||e.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(t){return Math.abs(t)>1})))&&(e.isPointerDragging=!0),e.enablePointerInteraction){var r=(i=e.container,a=i.getBoundingClientRect(),o=window.pageXOffset||document.documentElement.scrollLeft,s=window.pageYOffset||document.documentElement.scrollTop,{top:a.top+s,left:a.left+o});e.pointerPos.x=n.pageX-r.left,e.pointerPos.y=n.pageY-r.top,e.toolTipElem.style.top="".concat(e.pointerPos.y,"px"),e.toolTipElem.style.left="".concat(e.pointerPos.x,"px"),e.toolTipElem.style.transform="translate(-".concat(e.pointerPos.x/e.width*100,"%, ").concat(e.height-e.pointerPos.y<100?"calc(-100% - 8px)":"21px",")")}var i,a,o,s}),{passive:!0})})),e.container.addEventListener("pointerup",(function(t){e.isPointerPressed=!1,e.isPointerDragging&&(e.isPointerDragging=!1,!e.clickAfterDrag)||requestAnimationFrame((function(){0===t.button&&e.onClick(e.hoverObj||null,t,e.intersectionPoint),2===t.button&&e.onRightClick&&e.onRightClick(e.hoverObj||null,t,e.intersectionPoint)}))}),{passive:!0,capture:!0}),e.container.addEventListener("contextmenu",(function(t){e.onRightClick&&t.preventDefault()})),e.renderer=new Yx.WebGLRenderer(Object.assign({antialias:!0,alpha:!0},o)),e.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),e.container.appendChild(e.renderer.domElement),e.extraRenderers=A,e.extraRenderers.forEach((function(t){t.domElement.style.position="absolute",t.domElement.style.top="0px",t.domElement.style.pointerEvents="none",e.container.appendChild(t.domElement)})),e.postProcessingComposer=new ex(e.renderer),e.postProcessingComposer.addPass(new nx(e.scene,e.camera)),e.controls=new{trackball:Ny,orbit:jy,fly:Wy}[i](e.camera,e.renderer.domElement),"fly"===i&&(e.controls.movementSpeed=300,e.controls.rollSpeed=Math.PI/6,e.controls.dragToLook=!0),"trackball"!==i&&"orbit"!==i||(e.controls.minDistance=.1,e.controls.maxDistance=e.skyRadius,e.controls.addEventListener("start",(function(){e.controlsEngaged=!0})),e.controls.addEventListener("change",(function(){e.controlsEngaged&&(e.controlsDragging=!0)})),e.controls.addEventListener("end",(function(){e.controlsEngaged=!1,e.controlsDragging=!1}))),[e.renderer,e.postProcessingComposer].concat(Wx(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix(),e.camera.position.z=1e3,e.scene.add(e.skysphere=new Yx.Mesh),e.skysphere.visible=!1,e.loadComplete=e.scene.visible=!c,window.scene=e.scene},update:function(t,e){if(t.width&&t.height&&(e.hasOwnProperty("width")||e.hasOwnProperty("height"))&&(t.container.style.width="".concat(t.width,"px"),t.container.style.height="".concat(t.height,"px"),[t.renderer,t.postProcessingComposer].concat(Wx(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix()),e.hasOwnProperty("skyRadius")&&t.skyRadius&&(t.controls.hasOwnProperty("maxDistance")&&e.skyRadius&&(t.controls.maxDistance=Math.min(t.controls.maxDistance,t.skyRadius)),t.camera.far=2.5*t.skyRadius,t.camera.updateProjectionMatrix(),t.skysphere.geometry=new Yx.SphereGeometry(t.skyRadius)),e.hasOwnProperty("backgroundColor")){var n=Mx(t.backgroundColor).alpha;void 0===n&&(n=1),t.renderer.setClearColor(new Yx.Color(Hx(1,t.backgroundColor)),n)}function r(){t.loadComplete=t.scene.visible=!0}e.hasOwnProperty("backgroundImageUrl")&&(t.backgroundImageUrl?(new Yx.TextureLoader).load(t.backgroundImageUrl,(function(e){e.colorSpace=Yx.SRGBColorSpace,t.skysphere.material=new Yx.MeshBasicMaterial({map:e,side:Yx.BackSide}),t.skysphere.visible=!0,t.onBackgroundImageLoaded&&setTimeout(t.onBackgroundImageLoaded),!t.loadComplete&&r()})):(t.skysphere.visible=!1,t.skysphere.material.map=null,!t.loadComplete&&r())),e.hasOwnProperty("showNavInfo")&&(t.navInfo.style.display=t.showNavInfo?null:"none"),e.hasOwnProperty("lights")&&((e.lights||[]).forEach((function(e){return t.scene.remove(e)})),t.lights.forEach((function(e){return t.scene.add(e)}))),e.hasOwnProperty("objects")&&((e.objects||[]).forEach((function(e){return t.scene.remove(e)})),t.objects.forEach((function(e){return t.scene.add(e)})))}});function Kx(t,e){var n=new e;return n._destructor&&n._destructor(),{linkProp:function(e){return{default:n[e](),onChange:function(n,r){r[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var r=n[t],i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=r[e].apply(r,a);return s===r?this:s}}}}var Jx=["rendererConfig","waitForGlobeReady"],$x=e(e({},window.THREE?window.THREE:{AmbientLight:class extends Hs{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}},DirectionalLight:class extends Hs{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(ln.DEFAULT_UP),this.updateMatrix(),this.target=new ln,this.shadow=new Qs}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}},Vector2:Lt,REVISION:s}),{},{CSS2DRenderer:class{constructor(t={}){const e=this;let n,r,i,a;const o={objects:new WeakMap},s=void 0!==t.element?t.element:document.createElement("div");function A(t,n,r){if(t.isCSS2DObject){aA.setFromMatrixPosition(t.matrixWorld),aA.applyMatrix4(sA);const A=!0===t.visible&&aA.z>=-1&&aA.z<=1&&!0===t.layers.test(r.layers);if(t.element.style.display=!0===A?"":"none",!0===A){t.onBeforeRender(e,n,r);const o=t.element;o.style.transform="translate("+-100*t.center.x+"%,"+-100*t.center.y+"%)translate("+(aA.x*i+i)+"px,"+(-aA.y*a+a)+"px)",o.parentNode!==s&&s.appendChild(o),t.onAfterRender(e,n,r)}const c={distanceToCameraSquared:l(r,t)};o.objects.set(t,c)}for(let e=0,i=t.children.length;e<i;e++)A(t.children[e],n,r)}function l(t,e){return AA.setFromMatrixPosition(t.matrixWorld),lA.setFromMatrixPosition(e.matrixWorld),AA.distanceToSquared(lA)}s.style.overflow="hidden",this.domElement=s,this.getSize=function(){return{width:n,height:r}},this.render=function(t,e){!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),oA.copy(e.matrixWorldInverse),sA.multiplyMatrices(e.projectionMatrix,oA),A(t,t,e),function(t){const e=function(t){const e=[];return t.traverse((function(t){t.isCSS2DObject&&e.push(t)})),e}(t).sort((function(t,e){if(t.renderOrder!==e.renderOrder)return e.renderOrder-t.renderOrder;return o.objects.get(t).distanceToCameraSquared-o.objects.get(e).distanceToCameraSquared})),n=e.length;for(let t=0,r=e.length;t<r;t++)e[t].element.style.zIndex=n-t}(t)},this.setSize=function(t,e){n=t,r=e,i=n/2,a=r/2,s.style.width=t+"px",s.style.height=e+"px"}}}}),tb=Kx("globe",Oy),eb=Object.assign.apply(Object,a(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude","onGlobeReady","pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration","arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration","polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration","pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration","heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration","hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration","hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration","tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration","ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod","labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration","htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration","objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject","customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return r({},t,tb.linkProp(t))})))),nb=Object.assign.apply(Object,a(["globeMaterial","getGlobeRadius","getCoords","toGeoCoords"].map((function(t){return r({},t,tb.linkMethod(t))})))),rb=Kx("renderObjs",Zx),ib=Object.assign.apply(Object,a(["width","height","backgroundColor","backgroundImageUrl","enablePointerInteraction"].map((function(t){return r({},t,rb.linkProp(t))})))),ab=Object.assign.apply(Object,a(["lights","postProcessingComposer"].map((function(t){return r({},t,rb.linkMethod(t))})))),ob=jA({props:e(e({onZoom:{triggerUpdate:!1},onGlobeClick:{triggerUpdate:!1},onGlobeRightClick:{triggerUpdate:!1},pointLabel:{default:"name",triggerUpdate:!1},onPointClick:{triggerUpdate:!1},onPointRightClick:{triggerUpdate:!1},onPointHover:{triggerUpdate:!1},arcLabel:{default:"name",triggerUpdate:!1},onArcClick:{triggerUpdate:!1},onArcRightClick:{triggerUpdate:!1},onArcHover:{triggerUpdate:!1},polygonLabel:{default:"name",triggerUpdate:!1},onPolygonClick:{triggerUpdate:!1},onPolygonRightClick:{triggerUpdate:!1},onPolygonHover:{triggerUpdate:!1},pathLabel:{default:"name",triggerUpdate:!1},onPathClick:{triggerUpdate:!1},onPathRightClick:{triggerUpdate:!1},onPathHover:{triggerUpdate:!1},onHeatmapClick:{triggerUpdate:!1},onHeatmapRightClick:{triggerUpdate:!1},onHeatmapHover:{triggerUpdate:!1},hexLabel:{triggerUpdate:!1},onHexClick:{triggerUpdate:!1},onHexRightClick:{triggerUpdate:!1},onHexHover:{triggerUpdate:!1},hexPolygonLabel:{triggerUpdate:!1},onHexPolygonClick:{triggerUpdate:!1},onHexPolygonRightClick:{triggerUpdate:!1},onHexPolygonHover:{triggerUpdate:!1},tileLabel:{default:"name",triggerUpdate:!1},onTileClick:{triggerUpdate:!1},onTileRightClick:{triggerUpdate:!1},onTileHover:{triggerUpdate:!1},labelLabel:{triggerUpdate:!1},onLabelClick:{triggerUpdate:!1},onLabelRightClick:{triggerUpdate:!1},onLabelHover:{triggerUpdate:!1},objectLabel:{default:"name",triggerUpdate:!1},onObjectClick:{triggerUpdate:!1},onObjectRightClick:{triggerUpdate:!1},onObjectHover:{triggerUpdate:!1},customLayerLabel:{default:"name",triggerUpdate:!1},onCustomLayerClick:{triggerUpdate:!1},onCustomLayerRightClick:{triggerUpdate:!1},onCustomLayerHover:{triggerUpdate:!1},pointerEventsFilter:{default:function(){return!0},triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.hoverFilter((function(e){return t(e,e.__data)}))}},lineHoverPrecision:{default:.2,triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.lineHoverPrecision(t)}}},eb),ib),methods:e(e({pauseAnimation:function(t){var e;return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),null===(e=t.globe)||void 0===e||e.pauseAnimation(),this},resumeAnimation:function(t){var e;return null===t.animationFrameRequestId&&this._animationCycle(),null===(e=t.globe)||void 0===e||e.resumeAnimation(),this},_animationCycle:function(t){t.renderObjs.tick(),t.animationFrameRequestId=requestAnimationFrame(this._animationCycle)},pointOfView:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.globe.toGeoCoords(t.renderObjs.cameraPosition());if(void 0===e.lat&&void 0===e.lng&&void 0===e.altitude)return r;var i=Object.assign({},r,e);if(["lat","lng","altitude"].forEach((function(t){return i[t]=+i[t]})),n){for(;r.lng-i.lng>180;)r.lng-=360;for(;r.lng-i.lng<-180;)r.lng+=360;new JA(r).to(i,n).easing(WA.Cubic.InOut).onUpdate(a).start()}else a(i);return this;function a(e){var n=e.lat,r=e.lng,i=e.altitude;t.renderObjs.cameraPosition(t.globe.getCoords(n,r,i))}},getScreenCoords:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=(e=t.globe).getCoords.apply(e,r);return t.renderObjs.getScreenCoords(a.x,a.y,a.z)},toGlobeCoords:function(t,e,n){var r=t.renderObjs.intersectingObjects(e,n).find((function(t){return"globe"===t.object.__globeObjType}));if(!r)return null;var i=t.globe.toGeoCoords(r.point);return{lat:i.lat,lng:i.lng}},scene:function(t){return t.renderObjs.scene()},camera:function(t){return t.renderObjs.camera()},renderer:function(t){return t.renderObjs.renderer()},controls:function(t){return t.renderObjs.controls()},_destructor:function(t){t.globe._destructor(),this.pauseAnimation(),this.pointsData([]),this.arcsData([]),this.polygonsData([]),this.pathsData([]),this.heatmapsData([]),this.hexBinPointsData([]),this.hexPolygonsData([]),this.tilesData([]),this.labelsData([]),this.htmlElementsData([]),this.objectsData([]),this.customLayerData([])}},nb),ab),stateInit:function(t){var n=t.rendererConfig,r=t.waitForGlobeReady,a=void 0===r||r,o=i(t,Jx),s=new Oy(e({waitForGlobeReady:a},o));return{globe:s,renderObjs:Zx({controlType:"orbit",rendererConfig:n,waitForLoadComplete:a,extraRenderers:[new $x.CSS2DRenderer]}).skyRadius(500*s.getGlobeRadius()).showNavInfo(!1).objects([s]).lights([new $x.AmbientLight(13421772,Math.PI),new $x.DirectionalLight(16777215,.6*Math.PI)])}},init:function(t,e){var n=this;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.style.position="relative";var r=document.createElement("div");e.container.appendChild(r),e.renderObjs(r),e.globe.rendererSize(e.renderObjs.renderer().getSize(new $x.Vector2)),this.pointOfView({altitude:2.5});var i=e.globe.getGlobeRadius(),a=e.renderObjs.controls();a.minDistance=1.01*i,a.maxDistance=100*i,a.enablePan=!1,a.enableDamping=!0,a.dampingFactor=.1,a.rotateSpeed=.3,a.zoomSpeed=.3,a.addEventListener("change",(function(){var t=n.pointOfView();a.rotateSpeed=.2*t.altitude,a.zoomSpeed=.1*(t.altitude+1),e.globe.setPointOfView(e.renderObjs.camera().position),e.onZoom&&e.onZoom(t)}));var o=function(t){for(var e=t;e&&!e.hasOwnProperty("__globeObjType");)e=e.parent;return e},s={point:function(t){return t},arc:function(t){return t},polygon:function(t){return t.data},path:function(t){return t},heatmap:function(t){return t},hexbin:function(t){return t},hexPolygon:function(t){return t},tile:function(t){return t},label:function(t){return t},object:function(t){return t},custom:function(t){return t}};$x.REVISION<155&&(e.renderObjs.renderer().useLegacyLights=!1),e.renderObjs.hoverOrderComparator((function(t,e){var n=o(t),r=o(e),i=function(t){return!t};return i(n)-i(r)})).tooltipContent((function(t){var n={point:e.pointLabel,arc:e.arcLabel,polygon:e.polygonLabel,path:e.pathLabel,hexbin:e.hexLabel,hexPolygon:e.hexPolygonLabel,tile:e.tileLabel,label:e.labelLabel,object:e.objectLabel,custom:e.customLayerLabel},r=o(t),i=r&&r.__globeObjType;return r&&i&&n.hasOwnProperty(i)&&s.hasOwnProperty(i)&&sf(n[i])(s[i](r.__data))||""})).onHover((function(t){var n={point:e.onPointHover,arc:e.onArcHover,polygon:e.onPolygonHover,path:e.onPathHover,heatmap:e.onHeatmapHover,hexbin:e.onHexHover,hexPolygon:e.onHexPolygonHover,tile:e.onTileHover,label:e.onLabelHover,object:e.onObjectHover,custom:e.onCustomLayerHover},r={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},i=o(t);if(i&&!n.hasOwnProperty(i.__globeObjType)&&(i=null),i!==e.hoverObj){var a=e.hoverObj?e.hoverObj.__globeObjType:null,A=e.hoverObj?s[a](e.hoverObj.__data):null,l=i?i.__globeObjType:null,c=i?s[l](i.__data):null;a&&a!==l&&n[a]&&n[a](null,A),l&&n[l]&&n[l](c,a===l?A:null),e.renderObjs.renderer().domElement.classList[l&&r[l]?"add":"remove"]("clickable"),e.hoverObj=i}})).onClick((function(t,r,i){if(t){var a={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},A=o(t),l=A.__globeObjType;if(A&&a.hasOwnProperty(l)&&a[l]){var c=[r];if("globe"===l){var u=n.toGeoCoords(i),h=u.lat,f=u.lng;c.unshift({lat:h,lng:f})}else c.push(n.toGeoCoords(i));s.hasOwnProperty(l)&&c.unshift(s[l](A.__data)),a[l].apply(a,c)}}})).onRightClick((function(t,r,i){if(t){var a={globe:e.onGlobeRightClick,point:e.onPointRightClick,arc:e.onArcRightClick,polygon:e.onPolygonRightClick,path:e.onPathRightClick,heatmap:e.onHeatmapRightClick,hexbin:e.onHexRightClick,hexPolygon:e.onHexPolygonRightClick,tile:e.onTileRightClick,label:e.onLabelRightClick,object:e.onObjectRightClick,custom:e.onCustomLayerRightClick},A=o(t),l=A.__globeObjType;if(A&&a.hasOwnProperty(l)&&a[l]){var c=[r];if("globe"===l){var u=n.toGeoCoords(i),h=u.lat,f=u.lng;c.unshift({lat:h,lng:f})}else c.push(n.toGeoCoords(i));s.hasOwnProperty(l)&&c.unshift(s[l](A.__data)),a[l].apply(a,c)}}})),this._animationCycle()}});return ob}));
  • interactive-globes/trunk/interactive-globes.php

    r3115164 r3158721  
    77 * Plugin URI:        https://wpinteractiveglobes.com/
    88 * Description:       Create interactive geographic globes. Color full regions or create markers on specific locations that will have information on hover and can also have actions on click. This plugin uses the online globe.gl library to generate the maps.
    9  * Version:           1.2.1
     9 * Version:           1.3.1
    1010 * Requires PHP:      7.0
    1111 * Author:            Interactive Globes
     
    1818
    1919use Saltus\WP\Framework\Core as FrameworkCore;
     20use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Plugin\Freemius;
     21use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Prepare;
    2022use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Project;
    2123use Saltus\WP\Framework\Infrastructure\Container\ServiceContainer;
     
    2426if ( ! defined( 'ABSPATH' ) ) {
    2527    exit;
     28}
     29
     30// Only run plugin code if PHP version bigger than 7.0 for now
     31if ( version_compare( PHP_VERSION, '7.0', '<' ) ) {
     32    return;
    2633}
    2734/**
     
    3542}
    3643
     44
    3745if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
    3846    require_once __DIR__ . '/vendor/autoload.php';
    3947}
    4048
    41 if ( class_exists( FrameworkCore::class ) &&
    42     class_exists( Project::class ) &&
    43     class_exists( ServiceContainer::class ) ) {
     49if ( ! class_exists( FrameworkCore::class ) ||
     50    ! class_exists( Project::class ) ||
     51    ! class_exists( ServiceContainer::class ) ) {
     52        return;
     53}
    4454
    45     if ( defined( 'SALTUS_PLAN' ) && SALTUS_PLAN === 'pro' ) {
    46         $prepare = new Prepare();
    47         $prepare->register();
     55global $ig_fs;
     56
     57// Freemius logic
     58if ( isset( $ig_fs ) && $ig_fs ) {
     59    $ig_fs()->set_basename( true, __FILE__ );
     60    //return;
     61}
     62
     63// before any model
     64$is_pro = false;
     65
     66if ( ( defined( 'SALTUS_PLAN' ) && SALTUS_PLAN === 'pro' ) ) {
     67    $fs = new Freemius( __DIR__ );
     68    $fs->load();
     69    $fs->init();
     70    $is_pro = $fs->is_pro();
     71}
     72
     73if ( $is_pro ) {
     74    $prepare = new Prepare();
     75    $prepare->register();
     76}
     77
     78// loads the modals
     79$framework = new FrameworkCore( __DIR__ );
     80$framework->register();
     81
     82$feature_container  = new ServiceContainer();
     83$services_container = new ServiceContainer();
     84
     85$project = new Project( 'interactive-globes', '1.3.1', __FILE__ );
     86
     87/**
     88 * Initialize plugin
     89 */
     90add_action(
     91    'plugins_loaded',
     92    function () use ( $project, $framework, $feature_container, $services_container, $is_pro ) {
     93
     94        if ( $is_pro ) {
     95            $plugin = new CorePro( $project, $framework, $feature_container, $services_container );
     96        } else {
     97            $plugin = new Core( $project, $framework, $feature_container, $services_container );
     98        }
     99
     100        $plugin->init();
    48101    }
    49     /*
    50     * The path to the plugin root directory is mandatory,
    51     * so it loads the models from a subdirectory.
    52     */
    53     $framework = new FrameworkCore( __DIR__ );
    54     $framework->register();
     102);
    55103
    56     $feature_container  = new ServiceContainer();
    57     $services_container = new ServiceContainer();
    58 
    59     $project = new Project( 'interactive-globes', '1.2.1', __FILE__ );
    60 
    61     /**
    62      * Initialize plugin
    63      */
    64     add_action(
    65         'plugins_loaded',
    66         function () use ( $project, $framework, $feature_container, $services_container ) {
    67             if ( defined( 'SALTUS_PLAN' ) && SALTUS_PLAN === 'pro' ) {
    68                 $plugin = new CorePro( $project, $framework, $feature_container, $services_container );
    69             } else {
    70                 $plugin = new Core( $project, $framework, $feature_container, $services_container );
    71             }
    72 
    73             $plugin->init();
    74         }
    75     );
    76     // run as early as possible
    77     register_activation_hook( __FILE__, [ __NAMESPACE__ . '\\Plugin\\Lifecycle', 'activation_actions' ] );
    78 }
     104// run as early as possible
     105register_activation_hook( __FILE__, [ __NAMESPACE__ . '\\Plugin\\Lifecycle', 'activation_actions' ] );
  • interactive-globes/trunk/languages/interactive-globes.pot

    r3115164 r3158721  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Interactive Globes 1.2.0\n"
     5"Project-Id-Version: Interactive Globes 1.3.0\n"
    66"Report-Msgid-Bugs-To: https://saltus.dev/\n"
    7 "POT-Creation-Date: 2024-06-20 11:22:23+00:00\n"
     7"POT-Creation-Date: 2024-09-18 22:17:20+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
     
    2525"X-Generator: grunt-wp-i18n 1.0.3\n"
    2626
    27 #: src/Features/CptManager/CptManagerCore.php:62
     27#: src/Features/ClickActions/DisplayContentAbove.php:21
     28#: src/Features/ClickActions/DisplayContentBelow.php:21
     29#: src/Features/ClickActions/DisplayContentLeft.php:21
     30#: src/Features/ClickActions/DisplayContentRight.php:21
     31msgid "Display content below"
     32msgstr ""
     33
     34#: src/Features/ClickActions/DisplayContentAbove.php:26
     35#: src/Features/ClickActions/DisplayContentBelow.php:26
     36#: src/Features/ClickActions/DisplayContentBelowScroll.php:18
     37#: src/Features/ClickActions/DisplayContentLeft.php:26
     38#: src/Features/ClickActions/DisplayContentRight.php:26
     39msgid "Display content below & scroll"
     40msgstr ""
     41
     42#: src/Features/ClickActions/DisplayContentAbove.php:31
     43#: src/Features/ClickActions/DisplayContentBelow.php:31
     44#: src/Features/ClickActions/DisplayContentLeft.php:31
     45#: src/Features/ClickActions/DisplayContentRight.php:31
     46msgid "Display content above"
     47msgstr ""
     48
     49#: src/Features/ClickActions/DisplayContentAbove.php:36
     50#: src/Features/ClickActions/DisplayContentBelow.php:36
     51#: src/Features/ClickActions/DisplayContentLeft.php:36
     52#: src/Features/ClickActions/DisplayContentRight.php:36
     53msgid "Display content right"
     54msgstr ""
     55
     56#: src/Features/ClickActions/DisplayContentAbove.php:41
     57#: src/Features/ClickActions/DisplayContentBelow.php:41
     58#: src/Features/ClickActions/DisplayContentLeft.php:41
     59#: src/Features/ClickActions/DisplayContentRight.php:41
     60msgid "Display content left"
     61msgstr ""
     62
     63#: src/Features/ClickActions/DisplayContentAbove.php:46
     64#: src/Features/ClickActions/DisplayContentBelow.php:46
     65#: src/Features/ClickActions/DisplayContentLeft.php:46
     66#: src/Features/ClickActions/DisplayContentRight.php:46
     67msgid "Display content"
     68msgstr ""
     69
     70#: src/Features/ClickActions/DisplayContentLightbox.php:16
     71msgid "Display content in a Lightbox"
     72msgstr ""
     73
     74#: src/Features/ClickActions/DisplayIframeLightbox.php:16
     75msgid "Display URL in a Lightbox (iframe)"
     76msgstr ""
     77
     78#: src/Features/CptManager/CptManagerCore.php:67
    2879msgid "Add title"
    2980msgstr ""
    3081
    31 #: src/Features/Meta/MetaCore.php:178
     82#: src/Features/DotLabel/DotLabelProMeta.php:22
     83#: src/Features/Point/PointProMeta.php:22 src/models/globe-region.php:17
     84msgid "Default"
     85msgstr ""
     86
     87#: src/Features/DotLabel/DotLabelProMeta.php:29
     88#: src/models/globe-dotlabel.php:122 src/models/globe-line.php:132
     89#: src/models/globe-point.php:108 src/models/globe-region.php:173
     90msgid "Details"
     91msgstr ""
     92
     93#: src/Features/DotLabel/DotLabelProMeta.php:33
     94#: src/Features/Point/PointProMeta.php:28 src/models/globe-line.php:198
     95#: src/models/globe-region.php:203
     96msgid "Customize"
     97msgstr ""
     98
     99#: src/Features/DotLabel/DotLabelProMeta.php:39
     100#: src/Features/Point/PointProMeta.php:33 src/models/globe-line.php:203
     101#: src/models/globe-region.php:208
     102msgid "Use Custom Options"
     103msgstr ""
     104
     105#: src/Features/DotLabel/DotLabelProMeta.php:40
     106#: src/Features/Point/PointProMeta.php:34 src/models/globe-line.php:204
     107#: src/models/globe-region.php:209
     108msgid "Define custom colors and actions."
     109msgstr ""
     110
     111#: src/Features/DotLabel/DotLabelProMeta.php:45
     112#: src/Features/Point/PointProMeta.php:39
     113#: src/Services/Model/Base/MetaDotLabel.php:105
     114#: src/Services/Model/Base/MetaPoint.php:104
     115#: src/Services/Model/Pro/MetaRegions.php:70 src/models/globe-pro.php:143
     116#: src/models/globe-pro.php:189 src/models/globe-region.php:214
     117msgid "Click Action"
     118msgstr ""
     119
     120#: src/Features/DotLabel/DotLabelProMeta.php:55
     121#: src/Features/Point/PointProMeta.php:56 src/Services/Model/Base/Meta.php:130
     122#: src/Services/Model/Base/MetaDotLabel.php:115
     123#: src/Services/Model/Base/MetaPoint.php:119
     124#: src/Services/Model/Pro/MetaLines.php:75 src/models/globe-line.php:255
     125#: src/models/globe-pro.php:160 src/models/globe-pro.php:199
     126msgid "Altitude"
     127msgstr ""
     128
     129#: src/Features/DotLabel/DotLabelProMeta.php:62
     130#: src/Services/Model/Base/MetaDotLabel.php:121 src/models/globe-pro.php:206
     131msgid "Label Size"
     132msgstr ""
     133
     134#: src/Features/DotLabel/DotLabelProMeta.php:67
     135#: src/Features/Point/PointProMeta.php:61
     136#: src/Services/Model/Base/MetaDotLabel.php:125
     137#: src/Services/Model/Base/MetaPoint.php:123
     138#: src/Services/Model/Pro/MetaRegions.php:77 src/models/globe-pro.php:165
     139#: src/models/globe-pro.php:211 src/models/globe-region.php:222
     140msgid "Fill Color"
     141msgstr ""
     142
     143#: src/Features/DotLabel/DotLabelProMeta.php:73
     144#: src/Features/Point/PointProMeta.php:67
     145#: src/Services/Model/Base/MetaDotLabel.php:130
     146#: src/Services/Model/Base/MetaPoint.php:128
     147#: src/Services/Model/Pro/MetaRegions.php:82 src/models/globe-pro.php:171
     148#: src/models/globe-pro.php:217 src/models/globe-region.php:228
     149msgid "Hover Color"
     150msgstr ""
     151
     152#: src/Features/DotLabel/DotLabelProMeta.php:78
     153#: src/Services/Model/Base/MetaDotLabel.php:134 src/models/globe-pro.php:222
     154msgid "Display Dot"
     155msgstr ""
     156
     157#: src/Features/DotLabel/DotLabelProMeta.php:79
     158#: src/Services/Model/Base/MetaDotLabel.php:135 src/models/globe-pro.php:223
     159msgid ""
     160"Display a dot marker next to the text indicating the exact coordinates of "
     161"the label."
     162msgstr ""
     163
     164#: src/Features/DotLabel/DotLabelProMeta.php:88
     165#: src/Services/Model/Base/MetaDotLabel.php:143 src/models/globe-pro.php:232
     166msgid "Dot Radius"
     167msgstr ""
     168
     169#: src/Features/DotLabel/DotLabelProMeta.php:95
     170#: src/Services/Model/Base/MetaDotLabel.php:151 src/models/globe-pro.php:239
     171msgid "Bottom"
     172msgstr ""
     173
     174#: src/Features/DotLabel/DotLabelProMeta.php:96
     175#: src/Services/Model/Base/MetaDotLabel.php:152 src/models/globe-pro.php:240
     176msgid "Top"
     177msgstr ""
     178
     179#: src/Features/DotLabel/DotLabelProMeta.php:97
     180#: src/Services/Model/Base/MetaDotLabel.php:153 src/models/globe-pro.php:241
     181msgid "Right"
     182msgstr ""
     183
     184#: src/Features/DotLabel/DotLabelProMeta.php:99
     185#: src/Services/Model/Base/MetaDotLabel.php:155 src/models/globe-pro.php:243
     186msgid "Dot Orientation"
     187msgstr ""
     188
     189#: src/Features/Meta/MetaCore.php:169
    32190msgid "Add new"
    33191msgstr ""
    34192
    35193#: src/Features/Meta/MetaCore.php:321
    36 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:44
    37 #: src/Services/Model/GlobesDefaultMetaPoint.php:44
    38 #: src/Services/Model/GlobesProPluginSettings.php:129
     194#: src/Services/Model/Base/MetaDotLabel.php:44
     195#: src/Services/Model/Base/MetaPoint.php:44
    39196msgid "Title"
    40197msgstr ""
     
    44201msgstr ""
    45202
    46 #: src/Plugin/Assets.php:191
     203#: src/Features/Point/PointProMeta.php:49
     204#: src/Services/Model/Base/MetaPoint.php:113 src/models/globe-pro.php:153
     205msgid "Radius"
     206msgstr ""
     207
     208#: src/Features/Sales/UpsellPage.php:48 src/Features/Sales/UpsellPage.php:49
     209msgid "Try Pro Version"
     210msgstr ""
     211
     212#: src/Plugin/Assets.php:218
    47213msgid "New center saved"
    48214msgstr ""
    49215
    50 #: src/Plugin/Assets.php:192
     216#: src/Plugin/Assets.php:219
    51217msgid "Set initial center"
    52218msgstr ""
    53219
    54 #: src/Services/Model/GlobesDefaultFeatures.php:12 src/models/globe-pro.php:53
    55 msgid "Clone Globe"
    56 msgstr ""
    57 
    58 #: src/Services/Model/GlobesDefaultFeatures.php:13 src/models/globe-pro.php:54
    59 msgid "Create a copy of this globe"
    60 msgstr ""
    61 
    62 #: src/Services/Model/GlobesDefaultFeatures.php:16 src/models/globe-pro.php:57
     220#: src/Plugin/Freemius.php:89 src/Plugin/Freemius.php:100
     221msgid "You do not have permission to edit this globe."
     222msgstr ""
     223
     224#: src/Services/Model/Base/Features.php:12 src/models/globe-pro.php:22
    63225msgid "Download Globe Export File"
    64226msgstr ""
    65227
    66 #: src/Services/Model/GlobesDefaultFeatures.php:25 src/models/globe-pro.php:66
     228#: src/Services/Model/Base/Features.php:21 src/models/globe-pro.php:31
    67229msgid "Shortcode"
    68230msgstr ""
    69231
    70 #: src/Services/Model/GlobesDefaultLabels.php:17
    71 #: src/Services/Model/GlobesDefaultLabels.php:19
     232#: src/Services/Model/Base/Labels.php:17 src/Services/Model/Base/Labels.php:19
    72233msgid "Globes"
    73234msgstr ""
    74235
    75 #: src/Services/Model/GlobesDefaultLabels.php:18
    76 #: src/Services/Model/GlobesDefaultLabels.php:20
    77 #: src/Services/Model/GlobesDefaultMeta.php:82
     236#: src/Services/Model/Base/Labels.php:18 src/Services/Model/Base/Labels.php:20
     237#: src/Services/Model/Base/Meta.php:83
    78238msgid "Globe"
    79239msgstr ""
    80240
    81 #: src/Services/Model/GlobesDefaultLabels.php:21
    82 #: src/models/globe-dotlabel.php:49 src/models/globe-line.php:53
    83 #: src/models/globe-point.php:34 src/models/globe-region.php:76
     241#: src/Services/Model/Base/Labels.php:21 src/models/globe-dotlabel.php:48
     242#: src/models/globe-line.php:51 src/models/globe-point.php:33
     243#: src/models/globe-region.php:99
    84244msgid "Create New"
    85245msgstr ""
    86246
    87 #: src/Services/Model/GlobesDefaultLabels.php:22
     247#: src/Services/Model/Base/Labels.php:22
    88248msgid "Create New Globe"
    89249msgstr ""
    90250
    91 #: src/Services/Model/GlobesDefaultLabels.php:23
     251#: src/Services/Model/Base/Labels.php:23
    92252msgid "Edit Globe"
    93253msgstr ""
    94254
    95 #: src/Services/Model/GlobesDefaultLabels.php:24
     255#: src/Services/Model/Base/Labels.php:24
    96256msgid "New Globe"
    97257msgstr ""
    98258
    99 #: src/Services/Model/GlobesDefaultLabels.php:25
     259#: src/Services/Model/Base/Labels.php:25
    100260msgid "View Globe"
    101261msgstr ""
    102262
    103 #: src/Services/Model/GlobesDefaultLabels.php:26
     263#: src/Services/Model/Base/Labels.php:26
    104264msgid "View Globes"
    105265msgstr ""
    106266
    107 #: src/Services/Model/GlobesDefaultLabels.php:27
     267#: src/Services/Model/Base/Labels.php:27
    108268msgid "Search Globes"
    109269msgstr ""
    110270
    111 #: src/Services/Model/GlobesDefaultLabels.php:28
     271#: src/Services/Model/Base/Labels.php:28
    112272msgid "No Globes found."
    113273msgstr ""
    114274
    115 #: src/Services/Model/GlobesDefaultLabels.php:29
     275#: src/Services/Model/Base/Labels.php:29
    116276msgid "No Globes found in Trash."
    117277msgstr ""
    118278
    119 #: src/Services/Model/GlobesDefaultLabels.php:30
     279#: src/Services/Model/Base/Labels.php:30
    120280msgid "Parent Globes:"
    121281msgstr ""
    122282
    123 #: src/Services/Model/GlobesDefaultLabels.php:31
     283#: src/Services/Model/Base/Labels.php:31
    124284msgid "All Globes"
    125285msgstr ""
    126286
    127 #: src/Services/Model/GlobesDefaultLabels.php:32
     287#: src/Services/Model/Base/Labels.php:32
    128288msgid "Globe Archives"
    129289msgstr ""
    130290
    131 #: src/Services/Model/GlobesDefaultLabels.php:33
     291#: src/Services/Model/Base/Labels.php:33
    132292msgid "Globe Attributes"
    133293msgstr ""
    134294
    135 #: src/Services/Model/GlobesDefaultLabels.php:34
     295#: src/Services/Model/Base/Labels.php:34
    136296msgid "Insert into Globe"
    137297msgstr ""
    138298
    139 #: src/Services/Model/GlobesDefaultLabels.php:35
     299#: src/Services/Model/Base/Labels.php:35
    140300msgid "Uploaded to this Globe"
    141301msgstr ""
    142302
    143 #: src/Services/Model/GlobesDefaultLabels.php:36
     303#: src/Services/Model/Base/Labels.php:36
    144304msgid "Filter Globes list"
    145305msgstr ""
    146306
    147 #: src/Services/Model/GlobesDefaultLabels.php:37
     307#: src/Services/Model/Base/Labels.php:37
    148308msgid "Globes list navigation"
    149309msgstr ""
    150310
    151 #: src/Services/Model/GlobesDefaultLabels.php:38
     311#: src/Services/Model/Base/Labels.php:38
    152312msgid "Globes list"
    153313msgstr ""
    154314
    155 #: src/Services/Model/GlobesDefaultLabels.php:39
     315#: src/Services/Model/Base/Labels.php:39
    156316msgid "Globe Cover Image"
    157317msgstr ""
    158318
    159 #: src/Services/Model/GlobesDefaultLabels.php:40
     319#: src/Services/Model/Base/Labels.php:40
    160320msgid "Set Globe Cover Image"
    161321msgstr ""
    162322
    163 #: src/Services/Model/GlobesDefaultLabels.php:41
     323#: src/Services/Model/Base/Labels.php:41
    164324msgid "Remove Globe Cover"
    165325msgstr ""
    166326
    167 #: src/Services/Model/GlobesDefaultLabels.php:42
     327#: src/Services/Model/Base/Labels.php:42
    168328msgid "Use as Globe Cover"
    169329msgstr ""
    170330
    171 #: src/Services/Model/GlobesDefaultLabels.php:46
     331#: src/Services/Model/Base/Labels.php:46
    172332msgid "Globe information updated."
    173333msgstr ""
    174334
    175 #: src/Services/Model/GlobesDefaultLabels.php:47
     335#: src/Services/Model/Base/Labels.php:47
    176336msgid "Globe info updated"
    177337msgstr ""
    178338
    179 #: src/Services/Model/GlobesDefaultLabels.php:48
    180 #: src/models/globe-dotlabel.php:76 src/models/globe-line.php:84
    181 #: src/models/globe-point.php:61 src/models/globe-region.php:107
     339#: src/Services/Model/Base/Labels.php:48 src/models/globe-dotlabel.php:75
     340#: src/models/globe-line.php:82 src/models/globe-point.php:60
     341#: src/models/globe-region.php:126
    182342msgid "Custom field updated"
    183343msgstr ""
    184344
    185 #: src/Services/Model/GlobesDefaultLabels.php:49
    186 #: src/models/globe-dotlabel.php:77 src/models/globe-line.php:85
    187 #: src/models/globe-point.php:62 src/models/globe-region.php:108
     345#: src/Services/Model/Base/Labels.php:49 src/models/globe-dotlabel.php:76
     346#: src/models/globe-line.php:83 src/models/globe-point.php:61
     347#: src/models/globe-region.php:127
    188348msgid "Custom field deleted"
    189349msgstr ""
    190350
    191 #: src/Services/Model/GlobesDefaultLabels.php:50
     351#: src/Services/Model/Base/Labels.php:50
    192352msgid "Globe content restored from revision"
    193353msgstr ""
    194354
    195 #: src/Services/Model/GlobesDefaultLabels.php:51
     355#: src/Services/Model/Base/Labels.php:51
    196356msgid "Globe Published"
    197357msgstr ""
    198358
    199 #: src/Services/Model/GlobesDefaultLabels.php:52
     359#: src/Services/Model/Base/Labels.php:52
    200360msgid "Globe information saved."
    201361msgstr ""
    202362
    203 #: src/Services/Model/GlobesDefaultLabels.php:53
     363#: src/Services/Model/Base/Labels.php:53
    204364msgid "Globe submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    205365msgstr ""
    206366
    207 #: src/Services/Model/GlobesDefaultLabels.php:54
     367#: src/Services/Model/Base/Labels.php:54
    208368msgid ""
    209369"Globe scheduled for {date}. <a href=\"{preview_url}\" "
     
    211371msgstr ""
    212372
    213 #: src/Services/Model/GlobesDefaultLabels.php:55
     373#: src/Services/Model/Base/Labels.php:55
    214374msgid "Globe draft updated. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    215375msgstr ""
    216376
    217 #: src/Services/Model/GlobesDefaultLabels.php:58
     377#: src/Services/Model/Base/Labels.php:58
    218378msgid "Globe updated. Yay!"
    219379msgstr ""
    220380
    221 #: src/Services/Model/GlobesDefaultLabels.php:59
     381#: src/Services/Model/Base/Labels.php:59
    222382msgid "%s Globes updated. Yay!"
    223383msgstr ""
    224384
    225 #: src/Services/Model/GlobesDefaultLabels.php:60
     385#: src/Services/Model/Base/Labels.php:60
    226386msgid "Globe not updated, somebody is editing it"
    227387msgstr ""
    228388
    229 #: src/Services/Model/GlobesDefaultLabels.php:61
     389#: src/Services/Model/Base/Labels.php:61
    230390msgid "%s Globes not updated, somebody is editing them"
    231391msgstr ""
    232392
    233 #: src/Services/Model/GlobesDefaultLabels.php:62
     393#: src/Services/Model/Base/Labels.php:62
    234394msgid "Globe permanetly deleted. Fahrenheit 451 team was here?"
    235395msgstr ""
    236396
    237 #: src/Services/Model/GlobesDefaultLabels.php:63
     397#: src/Services/Model/Base/Labels.php:63
    238398msgid "%s Globes permanently deleted. Why? :("
    239399msgstr ""
    240400
    241 #: src/Services/Model/GlobesDefaultLabels.php:64
     401#: src/Services/Model/Base/Labels.php:64
    242402msgid "Globe moved to the trash. I'm sad :("
    243403msgstr ""
    244404
    245 #: src/Services/Model/GlobesDefaultLabels.php:65
     405#: src/Services/Model/Base/Labels.php:65
    246406msgid "%s Globes moved to the trash. Why? :("
    247407msgstr ""
    248408
    249 #: src/Services/Model/GlobesDefaultLabels.php:66
     409#: src/Services/Model/Base/Labels.php:66
    250410msgid "Globe recovered from trash. Well done!"
    251411msgstr ""
    252412
    253 #: src/Services/Model/GlobesDefaultLabels.php:67
     413#: src/Services/Model/Base/Labels.php:67
    254414msgid "%s Globes saved from the enemies!"
    255415msgstr ""
    256416
    257 #: src/Services/Model/GlobesDefaultLabels.php:71
     417#: src/Services/Model/Base/Labels.php:71
    258418msgid "Enter Globe name here"
    259419msgstr ""
    260420
    261 #: src/Services/Model/GlobesDefaultMeta.php:27
     421#: src/Services/Model/Base/Meta.php:26
    262422msgid "Preview"
    263423msgstr ""
    264424
    265 #: src/Services/Model/GlobesDefaultMeta.php:36
     425#: src/Services/Model/Base/Meta.php:36
    266426msgid "Changes detected. Save your globe to update the preview."
    267427msgstr ""
    268428
    269 #: src/Services/Model/GlobesDefaultMeta.php:77
     429#: src/Services/Model/Base/Meta.php:78
    270430msgid "Globe Settings"
    271431msgstr ""
    272432
    273 #: src/Services/Model/GlobesDefaultMeta.php:99
     433#: src/Services/Model/Base/Meta.php:106
    274434msgid "Show Graticules"
    275435msgstr ""
    276436
    277 #: src/Services/Model/GlobesDefaultMeta.php:100
     437#: src/Services/Model/Base/Meta.php:107
    278438msgid "Show a graticule grid demarking latitude and longitude lines."
    279439msgstr ""
    280440
    281 #: src/Services/Model/GlobesDefaultMeta.php:107
     441#: src/Services/Model/Base/Meta.php:114
    282442#. translators: legend refers to a caption or visual element explaining colours
    283443#. on map
     
    285445msgstr ""
    286446
    287 #: src/Services/Model/GlobesDefaultMeta.php:108
     447#: src/Services/Model/Base/Meta.php:115
    288448msgid "Show a bright halo surrounding the globe, representing the atmosphere."
    289449msgstr ""
    290450
    291 #: src/Services/Model/GlobesDefaultMeta.php:112
     451#: src/Services/Model/Base/Meta.php:119
    292452msgid "Enabled"
    293453msgstr ""
    294454
    295 #: src/Services/Model/GlobesDefaultMeta.php:117
     455#: src/Services/Model/Base/Meta.php:124
    296456msgid "Color"
    297457msgstr ""
    298458
    299 #: src/Services/Model/GlobesDefaultMeta.php:123
    300 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:114
    301 #: src/Services/Model/GlobesDefaultMetaPoint.php:118
    302 #: src/Services/Model/GlobesProMetaLines.php:76 src/models/globe-line.php:241
    303 #: src/models/globe-pro.php:195 src/models/globe-pro.php:234
    304 msgid "Altitude"
    305 msgstr ""
    306 
    307 #: src/Services/Model/GlobesDefaultMeta.php:128
     459#: src/Services/Model/Base/Meta.php:135
    308460msgid ""
    309461"Max altitude of the atmosphere, in terms of globe radius units.<br>The size "
     
    312464msgstr ""
    313465
    314 #: src/Services/Model/GlobesDefaultMeta.php:137
     466#: src/Services/Model/Base/Meta.php:144
    315467msgid "Controls the initial globe scale"
    316468msgstr ""
    317469
    318 #: src/Services/Model/GlobesDefaultMeta.php:138
     470#: src/Services/Model/Base/Meta.php:145
    319471msgid "Initial altitude/scale"
    320472msgstr ""
    321473
    322 #: src/Services/Model/GlobesDefaultMeta.php:142
     474#: src/Services/Model/Base/Meta.php:149
    323475msgid "Center coordinates"
    324476msgstr ""
    325477
    326 #: src/Services/Model/GlobesDefaultMeta.php:143
     478#: src/Services/Model/Base/Meta.php:150
    327479msgid "Center of the globe when initially loaded."
    328480msgstr ""
    329481
    330 #: src/Services/Model/GlobesDefaultMeta.php:145
    331 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:30
    332 #: src/Services/Model/GlobesDefaultMetaPoint.php:30
     482#: src/Services/Model/Base/Meta.php:152
     483#: src/Services/Model/Base/MetaDotLabel.php:30
     484#: src/Services/Model/Base/MetaPoint.php:30
    333485#. translators: %s will be a link to an external website
    334486msgid ""
     
    337489msgstr ""
    338490
    339 #: src/Services/Model/GlobesDefaultMeta.php:147
    340 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:32
    341 #: src/Services/Model/GlobesDefaultMetaPoint.php:32
     491#: src/Services/Model/Base/Meta.php:154
     492#: src/Services/Model/Base/MetaDotLabel.php:32
     493#: src/Services/Model/Base/MetaPoint.php:32
    342494msgid ""
    343495"Correct format: Latitude: 41.1579, Longitude: -8.6291<br> Wrong format: "
     
    345497msgstr ""
    346498
    347 #: src/Services/Model/GlobesDefaultMeta.php:151
    348 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:55
    349 #: src/Services/Model/GlobesDefaultMetaPoint.php:55
     499#: src/Services/Model/Base/Meta.php:158
     500#: src/Services/Model/Base/MetaDotLabel.php:55
     501#: src/Services/Model/Base/MetaPoint.php:55
    350502msgid "Location"
    351503msgstr ""
    352504
    353 #: src/Services/Model/GlobesDefaultMeta.php:159
    354 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:63
    355 #: src/Services/Model/GlobesDefaultMetaPoint.php:63
    356 #: src/models/globe-dotlabel.php:148 src/models/globe-line.php:184
    357 #: src/models/globe-point.php:134
     505#: src/Services/Model/Base/Meta.php:166
     506#: src/Services/Model/Base/MetaDotLabel.php:63
     507#: src/Services/Model/Base/MetaPoint.php:63 src/models/globe-dotlabel.php:148
     508#: src/models/globe-line.php:183 src/models/globe-point.php:134
    358509msgid "Latitude"
    359510msgstr ""
    360511
    361 #: src/Services/Model/GlobesDefaultMeta.php:166
    362 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:69
    363 #: src/Services/Model/GlobesDefaultMetaPoint.php:69
    364 #: src/models/globe-dotlabel.php:155 src/models/globe-line.php:189
    365 #: src/models/globe-point.php:141
     512#: src/Services/Model/Base/Meta.php:173
     513#: src/Services/Model/Base/MetaDotLabel.php:69
     514#: src/Services/Model/Base/MetaPoint.php:69 src/models/globe-dotlabel.php:155
     515#: src/models/globe-line.php:188 src/models/globe-point.php:141
    366516msgid "Longitude"
    367517msgstr ""
    368518
    369 #: src/Services/Model/GlobesDefaultMeta.php:175
     519#: src/Services/Model/Base/Meta.php:183
     520#. translators: legend refers to a caption or visual element explaining colours
     521#. on map
     522msgid "Interactions & Controls"
     523msgstr ""
     524
     525#: src/Services/Model/Base/Meta.php:184
     526msgid "Allow interactions with globe, like zoom and pan."
     527msgstr ""
     528
     529#: src/Services/Model/Base/Meta.php:189
     530msgid "Zoom"
     531msgstr ""
     532
     533#: src/Services/Model/Base/Meta.php:194
     534msgid "Pan & Rotate"
     535msgstr ""
     536
     537#: src/Services/Model/Base/Meta.php:201
     538#. translators: legend refers to a caption or visual element explaining colours
     539#. on map
     540msgid "Animate In"
     541msgstr ""
     542
     543#: src/Services/Model/Base/Meta.php:202
     544msgid "Animate globe on load"
     545msgstr ""
     546
     547#: src/Services/Model/Base/Meta.php:208
    370548msgid "Container"
    371549msgstr ""
    372550
    373 #: src/Services/Model/GlobesDefaultMeta.php:181
     551#: src/Services/Model/Base/Meta.php:214
    374552msgid "Background Color"
    375553msgstr ""
    376554
    377 #: src/Services/Model/GlobesDefaultMeta.php:186
     555#: src/Services/Model/Base/Meta.php:219
    378556msgid "Container Height"
    379557msgstr ""
    380558
    381 #: src/Services/Model/GlobesDefaultMeta.php:192
     559#: src/Services/Model/Base/Meta.php:225
    382560msgid ""
    383561"The default 56% corresponds to a 16:9 aspect ratio. 100% would be a square. "
     
    386564msgstr ""
    387565
    388 #: src/Services/Model/GlobesDefaultMeta.php:196
     566#: src/Services/Model/Base/Meta.php:229
    389567msgid "Container Height on Mobile"
    390568msgstr ""
    391569
    392 #: src/Services/Model/GlobesDefaultMeta.php:202
     570#: src/Services/Model/Base/Meta.php:235
    393571msgid ""
    394572"Leave blank to use the same value above. On mobile there might be the need "
     
    397575msgstr ""
    398576
    399 #: src/Services/Model/GlobesDefaultMeta.php:206
     577#: src/Services/Model/Base/Meta.php:239
    400578msgid "Container Max-Width"
    401579msgstr ""
    402580
    403 #: src/Services/Model/GlobesDefaultMeta.php:207
     581#: src/Services/Model/Base/Meta.php:240
    404582msgid ""
    405583"Leave empty if you always want your globe to take 100% of the available "
     
    407585msgstr ""
    408586
    409 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:21
    410 #: src/models/globe-dotlabel.php:45 src/models/globe-dotlabel.php:47
    411 #: src/models/globe-dotlabel.php:48 src/models/globe-dotlabel.php:59
     587#: src/Services/Model/Base/MetaDotLabel.php:21 src/models/globe-dotlabel.php:44
     588#: src/models/globe-dotlabel.php:46 src/models/globe-dotlabel.php:47
     589#: src/models/globe-dotlabel.php:58
    412590msgid "Dot Labels"
    413591msgstr ""
    414592
    415 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:27
     593#: src/Services/Model/Base/MetaDotLabel.php:27
    416594msgid ""
    417595"Add <strong>text labels</strong> with dots to the globe. <br>Click \"Add "
     
    419597msgstr ""
    420598
    421 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:40
    422 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:93
     599#: src/Services/Model/Base/MetaDotLabel.php:40
     600#: src/Services/Model/Base/MetaDotLabel.php:94
    423601msgid "Add New Label"
    424602msgstr ""
    425603
    426 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:51
    427 #: src/Services/Model/GlobesDefaultMetaPoint.php:51
    428 #: src/models/globe-dotlabel.php:126 src/models/globe-point.php:112
     604#: src/Services/Model/Base/MetaDotLabel.php:51
     605#: src/Services/Model/Base/MetaPoint.php:51 src/models/globe-dotlabel.php:126
     606#: src/models/globe-point.php:112
    429607msgid "Coordinates"
    430608msgstr ""
    431609
    432 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:78
    433 #: src/Services/Model/GlobesDefaultMetaPoint.php:78
    434 #: src/models/globe-dotlabel.php:169 src/models/globe-point.php:155
    435 #: src/models/globe-region.php:173
     610#: src/Services/Model/Base/MetaDotLabel.php:78
     611#: src/Services/Model/Base/MetaPoint.php:78 src/models/globe-dotlabel.php:169
     612#: src/models/globe-point.php:155 src/models/globe-region.php:193
    436613msgid "Tooltip Content"
    437614msgstr ""
    438615
    439 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:82
    440 #: src/Services/Model/GlobesDefaultMetaPoint.php:82
    441 #: src/models/globe-dotlabel.php:173 src/models/globe-point.php:159
    442 #: src/models/globe-region.php:177
     616#: src/Services/Model/Base/MetaDotLabel.php:82
     617#: src/Services/Model/Base/MetaPoint.php:82 src/models/globe-dotlabel.php:173
     618#: src/models/globe-point.php:159 src/models/globe-region.php:197
    443619msgid "Action Content"
    444620msgstr ""
    445621
    446 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:83
    447 #: src/Services/Model/GlobesDefaultMetaPoint.php:83
    448 #: src/models/globe-dotlabel.php:174 src/models/globe-point.php:160
    449 #: src/models/globe-region.php:178
     622#: src/Services/Model/Base/MetaDotLabel.php:83
     623#: src/Services/Model/Base/MetaPoint.php:83 src/models/globe-dotlabel.php:174
     624#: src/models/globe-point.php:160 src/models/globe-region.php:198
    450625msgid "URL or content to trigger when marker is clicked."
    451626msgstr ""
    452627
    453 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:83
    454 #: src/Services/Model/GlobesDefaultMetaPoint.php:83
    455 #: src/models/globe-region.php:178
     628#: src/Services/Model/Base/MetaDotLabel.php:83
     629#: src/Services/Model/Base/MetaPoint.php:83 src/models/globe-region.php:198
    456630msgid "Don't forget to select a click action below."
    457631msgstr ""
    458632
    459 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:98
    460 #: src/Services/Model/GlobesDefaultMetaPoint.php:98
    461 #: src/Services/Model/GlobesProMetaRegions.php:64
     633#: src/Services/Model/Base/MetaDotLabel.php:99
     634#: src/Services/Model/Base/MetaPoint.php:99
     635#: src/Services/Model/Pro/MetaRegions.php:64
    462636msgid "Default values"
    463637msgstr ""
    464638
    465 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:104
    466 #: src/Services/Model/GlobesDefaultMetaPoint.php:103
    467 #: src/Services/Model/GlobesProMetaRegions.php:70 src/models/globe-pro.php:178
    468 #: src/models/globe-pro.php:224 src/models/globe-region.php:194
    469 msgid "Click Action"
    470 msgstr ""
    471 
    472 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:120
    473 #: src/models/globe-pro.php:241
    474 msgid "Label Size"
    475 msgstr ""
    476 
    477 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:124
    478 #: src/Services/Model/GlobesDefaultMetaPoint.php:122
    479 #: src/Services/Model/GlobesProMetaRegions.php:77 src/models/globe-pro.php:200
    480 #: src/models/globe-pro.php:246 src/models/globe-region.php:202
    481 msgid "Fill Color"
    482 msgstr ""
    483 
    484 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:129
    485 #: src/Services/Model/GlobesDefaultMetaPoint.php:127
    486 #: src/Services/Model/GlobesProMetaRegions.php:82 src/models/globe-pro.php:206
    487 #: src/models/globe-pro.php:252 src/models/globe-region.php:208
    488 msgid "Hover Color"
    489 msgstr ""
    490 
    491 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:133
    492 #: src/models/globe-pro.php:257
    493 msgid "Display Dot"
    494 msgstr ""
    495 
    496 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:134
    497 #: src/models/globe-pro.php:258
    498 msgid ""
    499 "Display a dot marker next to the text indicating the exact coordinates of "
    500 "the label."
    501 msgstr ""
    502 
    503 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:142
    504 #: src/models/globe-pro.php:267
    505 msgid "Dot Radius"
    506 msgstr ""
    507 
    508 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:150
    509 #: src/models/globe-pro.php:274
    510 msgid "Bottom"
    511 msgstr ""
    512 
    513 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:151
    514 #: src/models/globe-pro.php:275
    515 msgid "Top"
    516 msgstr ""
    517 
    518 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:152
    519 #: src/models/globe-pro.php:276
    520 msgid "Right"
    521 msgstr ""
    522 
    523 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:154
    524 #: src/models/globe-pro.php:278
    525 msgid "Dot Orientation"
    526 msgstr ""
    527 
    528 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:162
     639#: src/Services/Model/Base/MetaDotLabel.php:163
    529640msgid "Font Typeface"
    530641msgstr ""
    531642
    532 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:166
     643#: src/Services/Model/Base/MetaDotLabel.php:167
    533644msgid "Default (Helvetiker Regular)"
    534645msgstr ""
    535646
    536 #: src/Services/Model/GlobesDefaultMetaDotLabel.php:167
     647#: src/Services/Model/Base/MetaDotLabel.php:168
    537648msgid "Open Sans Regular (125kb)"
    538649msgstr ""
    539650
    540 #: src/Services/Model/GlobesDefaultMetaPoint.php:21
    541 #: src/models/globe-point.php:30 src/models/globe-point.php:32
    542 #: src/models/globe-point.php:33 src/models/globe-point.php:44
     651#: src/Services/Model/Base/MetaPoint.php:21 src/models/globe-point.php:29
     652#: src/models/globe-point.php:31 src/models/globe-point.php:32
     653#: src/models/globe-point.php:43
    543654msgid "Points"
    544655msgstr ""
    545656
    546 #: src/Services/Model/GlobesDefaultMetaPoint.php:27
     657#: src/Services/Model/Base/MetaPoint.php:27
    547658msgid ""
    548659"Add <strong>cylinder point markers</strong> to the globe. <br>Click \"Add "
     
    550661msgstr ""
    551662
    552 #: src/Services/Model/GlobesDefaultMetaPoint.php:40
    553 #: src/Services/Model/GlobesDefaultMetaPoint.php:93
     663#: src/Services/Model/Base/MetaPoint.php:40
     664#: src/Services/Model/Base/MetaPoint.php:94
    554665msgid "Add New Point"
    555666msgstr ""
    556667
    557 #: src/Services/Model/GlobesDefaultMetaPoint.php:112
    558 #: src/models/globe-pro.php:188
    559 msgid "Radius"
    560 msgstr ""
    561 
    562 #: src/Services/Model/GlobesDefaultSettings.php:16
     668#: src/Services/Model/Base/Settings.php:16
    563669msgid "None"
    564670msgstr ""
    565671
    566 #: src/Services/Model/GlobesDefaultSettings.php:17
     672#: src/Services/Model/Base/Settings.php:17
    567673msgid "Open URL"
    568674msgstr ""
    569675
    570 #: src/Services/Model/GlobesDefaultSettings.php:18
     676#: src/Services/Model/Base/Settings.php:18
    571677msgid "Open URL (new tab)"
    572678msgstr ""
    573679
    574 #: src/Services/Model/GlobesProMetaAnimate.php:14 src/models/globe-pro.php:287
    575 #. translators: legend refers to a caption or visual element explaining colours
    576 #. on map
    577 msgid "Animate"
    578 msgstr ""
    579 
    580 #: src/Services/Model/GlobesProMetaAnimate.php:15 src/models/globe-pro.php:288
    581 msgid "Animate globe on load"
    582 msgstr ""
    583 
    584 #: src/Services/Model/GlobesProMetaDotLabel.php:14
     680#: src/Services/Model/Pro/MetaColor.php:17
     681msgid "Globe Custom Color"
     682msgstr ""
     683
     684#: src/Services/Model/Pro/MetaColor.php:24
     685msgid "Select a custom image to be used in the globe."
     686msgstr ""
     687
     688#: src/Services/Model/Pro/MetaColor.php:25
     689msgid "Globe Custom Image"
     690msgstr ""
     691
     692#: src/Services/Model/Pro/MetaDotLabel.php:12
    585693msgid "PTSerif Regular (~130kb)"
    586694msgstr ""
    587695
    588 #: src/Services/Model/GlobesProMetaLines.php:15
     696#: src/Services/Model/Pro/MetaLines.php:16
    589697msgid "Arc Lines"
    590698msgstr ""
    591699
    592 #: src/Services/Model/GlobesProMetaLines.php:23
     700#: src/Services/Model/Pro/MetaLines.php:24
    593701msgid "Add New Line"
    594702msgstr ""
    595703
    596 #: src/Services/Model/GlobesProMetaLines.php:28
    597 #: src/Services/Model/GlobesProPluginSettings.php:58
    598 #: src/models/globe-pro.php:125
     704#: src/Services/Model/Pro/MetaLines.php:29
     705#: src/Services/Model/Pro/PluginSettings.php:61 src/models/globe-pro.php:90
    599706msgid "Defaults"
    600707msgstr ""
    601708
    602 #: src/Services/Model/GlobesProMetaLines.php:32
     709#: src/Services/Model/Pro/MetaLines.php:33
    603710msgid "Arc Line Color"
    604711msgstr ""
    605712
    606 #: src/Services/Model/GlobesProMetaLines.php:44 src/models/globe-line.php:223
     713#: src/Services/Model/Pro/MetaLines.php:45 src/models/globe-line.php:222
    607714msgid "Line Dash"
    608715msgstr ""
    609716
    610 #: src/Services/Model/GlobesProMetaLines.php:46
     717#: src/Services/Model/Pro/MetaLines.php:46 src/models/globe-line.php:223
    611718msgid ""
    612719"The length of the dashed segments in the arc, in terms of relative line "
     
    614721msgstr ""
    615722
    616 #: src/Services/Model/GlobesProMetaLines.php:57
     723#: src/Services/Model/Pro/MetaLines.php:57 src/models/globe-line.php:235
    617724msgid "Line Dash Gap"
    618725msgstr ""
    619726
    620 #: src/Services/Model/GlobesProMetaLines.php:59
     727#: src/Services/Model/Pro/MetaLines.php:58 src/models/globe-line.php:236
    621728msgid ""
    622729"The length of the gap between dash segments, in terms of relative line "
     
    624731msgstr ""
    625732
    626 #: src/Services/Model/GlobesProMetaLines.php:64 src/models/globe-line.php:229
     733#: src/Services/Model/Pro/MetaLines.php:63 src/models/globe-line.php:242
    627734msgid "Line Width"
    628735msgstr ""
    629736
    630 #: src/Services/Model/GlobesProMetaLines.php:65
     737#: src/Services/Model/Pro/MetaLines.php:64 src/models/globe-line.php:243
    631738msgid "The line’s diameter, in angular degrees"
    632739msgstr ""
    633740
    634 #: src/Services/Model/GlobesProMetaLines.php:77
     741#: src/Services/Model/Pro/MetaLines.php:76 src/models/globe-line.php:256
    635742msgid ""
    636743"The arc’s maximum altitude, ocurring at the half-way distance between the "
     
    638745msgstr ""
    639746
    640 #: src/Services/Model/GlobesProMetaLines.php:82
     747#: src/Services/Model/Pro/MetaLines.php:81 src/models/globe-line.php:268
    641748msgid ""
    642749"Time duration (in seconds) to animate the motion of dash positions from the "
     
    646753msgstr ""
    647754
    648 #: src/Services/Model/GlobesProMetaLines.php:88 src/models/globe-line.php:252
     755#: src/Services/Model/Pro/MetaLines.php:87 src/models/globe-line.php:267
    649756msgid "Animation speed"
    650757msgstr ""
    651758
    652 #: src/Services/Model/GlobesProMetaRegions.php:18
     759#: src/Services/Model/Pro/MetaRegions.php:19
    653760msgid "Regions Layer"
    654761msgstr ""
    655762
    656 #: src/Services/Model/GlobesProMetaRegions.php:24
     763#: src/Services/Model/Pro/MetaRegions.php:25
    657764msgid "Load a layer with region/country shapes and add interactivity to them."
    658765msgstr ""
    659766
    660 #: src/Services/Model/GlobesProMetaRegions.php:28
     767#: src/Services/Model/Pro/MetaRegions.php:29
    661768msgid "Type"
    662769msgstr ""
    663770
    664 #: src/Services/Model/GlobesProMetaRegions.php:30
     771#: src/Services/Model/Pro/MetaRegions.php:31
    665772msgid "Disabled"
    666773msgstr ""
    667774
    668 #: src/Services/Model/GlobesProMetaRegions.php:31
     775#: src/Services/Model/Pro/MetaRegions.php:32
    669776msgid "Continents"
    670777msgstr ""
    671778
    672 #: src/Services/Model/GlobesProMetaRegions.php:32
     779#: src/Services/Model/Pro/MetaRegions.php:33
    673780msgid "Countries"
    674781msgstr ""
    675782
    676 #: src/Services/Model/GlobesProMetaRegions.php:33
     783#: src/Services/Model/Pro/MetaRegions.php:34
    677784msgid "Countries (Morocco)"
    678785msgstr ""
    679786
    680 #: src/Services/Model/GlobesProMetaRegions.php:34
     787#: src/Services/Model/Pro/MetaRegions.php:35
    681788msgid "Countries (India)"
    682789msgstr ""
    683790
    684 #: src/Services/Model/GlobesProMetaRegions.php:35
     791#: src/Services/Model/Pro/MetaRegions.php:36
    685792msgid "Countries (China)"
    686793msgstr ""
    687794
    688 #: src/Services/Model/GlobesProMetaRegions.php:36
     795#: src/Services/Model/Pro/MetaRegions.php:37
    689796msgid "Countries (Russia)"
    690797msgstr ""
    691798
    692 #: src/Services/Model/GlobesProMetaRegions.php:37
     799#: src/Services/Model/Pro/MetaRegions.php:38
    693800msgid "Outline"
    694801msgstr ""
    695802
    696 #: src/Services/Model/GlobesProMetaRegions.php:38
    697 msgid "Custom Source"
    698 msgstr ""
    699 
    700 #: src/Services/Model/GlobesProMetaRegions.php:43
     803#: src/Services/Model/Pro/MetaRegions.php:44
    701804msgid "Custom GEOJSON Url"
    702805msgstr ""
    703806
    704 #: src/Services/Model/GlobesProMetaRegions.php:49
    705 msgid ""
    706 "Click the \"Add New Region\" button below to start adding interactivity to "
    707 "the regions. Use the correct region code."
    708 msgstr ""
    709 
    710 #: src/Services/Model/GlobesProMetaRegions.php:59
    711 msgid "Add New Region"
    712 msgstr ""
    713 
    714 #: src/Services/Model/GlobesProMetaRotate.php:14
    715 #: src/Services/Model/GlobesProMetaRotate.php:20 src/models/globe-pro.php:295
    716 #: src/models/globe-pro.php:301
     807#: src/Services/Model/Pro/MetaRegions.php:49
     808msgid ""
     809"Click the \"Add New Region Interactivity\" button below to start adding "
     810"interactivity to the regions. Use the correct region code."
     811msgstr ""
     812
     813#: src/Services/Model/Pro/MetaRegions.php:59
     814msgid "Add New Region Interactivity"
     815msgstr ""
     816
     817#: src/Services/Model/Pro/MetaRegions.php:87
     818msgid "Inactive Regions Color"
     819msgstr ""
     820
     821#: src/Services/Model/Pro/MetaRotate.php:14
     822#: src/Services/Model/Pro/MetaRotate.php:20 src/models/globe-pro.php:252
     823#: src/models/globe-pro.php:258
    717824#. translators: legend refers to a caption or visual element explaining colours
    718825#. on map
     
    720827msgstr ""
    721828
    722 #: src/Services/Model/GlobesProMetaRotate.php:15
    723 #: src/Services/Model/GlobesProMetaRotate.php:21 src/models/globe-pro.php:296
    724 #: src/models/globe-pro.php:302
     829#: src/Services/Model/Pro/MetaRotate.php:15
     830#: src/Services/Model/Pro/MetaRotate.php:21 src/models/globe-pro.php:253
     831#: src/models/globe-pro.php:259
    725832msgid "Rotate animation"
    726833msgstr ""
    727834
    728 #: src/Services/Model/GlobesProMetaRotate.php:28 src/models/globe-pro.php:309
     835#: src/Services/Model/Pro/MetaRotate.php:28 src/models/globe-pro.php:266
    729836msgid "Speed"
    730837msgstr ""
    731838
    732 #: src/Services/Model/GlobesProMetaTooltip.php:12
     839#: src/Services/Model/Pro/MetaTooltip.php:12
    733840msgid "Tooltip"
    734841msgstr ""
    735842
    736 #: src/Services/Model/GlobesProMetaTooltip.php:21
     843#: src/Services/Model/Pro/MetaTooltip.php:21
    737844msgid "Tooltip Settings"
    738845msgstr ""
    739846
    740 #: src/Services/Model/GlobesProMetaTooltip.php:25
     847#: src/Services/Model/Pro/MetaTooltip.php:25
    741848msgid "Background color"
    742849msgstr ""
    743850
    744 #: src/Services/Model/GlobesProMetaTooltip.php:30
     851#: src/Services/Model/Pro/MetaTooltip.php:30
    745852msgid "Font Family"
    746853msgstr ""
    747854
    748 #: src/Services/Model/GlobesProMetaTooltip.php:35
     855#: src/Services/Model/Pro/MetaTooltip.php:35
    749856msgid "Font Settings"
    750857msgstr ""
    751858
    752 #: src/Services/Model/GlobesProMetaTooltip.php:49
     859#: src/Services/Model/Pro/MetaTooltip.php:49
    753860msgid "Corner radius"
    754861msgstr ""
    755862
    756 #: src/Services/Model/GlobesProMetaTooltip.php:56
     863#: src/Services/Model/Pro/MetaTooltip.php:56
    757864msgid "Border"
    758865msgstr ""
    759866
    760 #: src/Services/Model/GlobesProMetaTooltip.php:70
     867#: src/Services/Model/Pro/MetaTooltip.php:70
    761868msgid "Padding"
    762869msgstr ""
    763870
    764 #: src/Services/Model/GlobesProMetaTooltip.php:78
     871#: src/Services/Model/Pro/MetaTooltip.php:78
    765872msgid "Tooltip padding"
    766873msgstr ""
    767874
    768 #: src/Services/Model/GlobesProMetaTooltip.php:82
     875#: src/Services/Model/Pro/MetaTooltip.php:82
    769876msgid "Maximum Width"
    770877msgstr ""
    771878
    772 #: src/Services/Model/GlobesProMetaTooltip.php:86
     879#: src/Services/Model/Pro/MetaTooltip.php:86
    773880msgid "Leave it blank if you want the tooltip to calculate the size automatically."
    774881msgstr ""
    775882
    776 #: src/Services/Model/GlobesProPluginSettings.php:13
    777 #: src/models/globe-pro.php:80
     883#: src/Services/Model/Pro/PluginSettings.php:13 src/models/globe-pro.php:45
    778884msgid "Plugin Settings"
    779885msgstr ""
    780886
    781 #: src/Services/Model/GlobesProPluginSettings.php:15
    782 #: src/models/globe-pro.php:82
     887#: src/Services/Model/Pro/PluginSettings.php:15 src/models/globe-pro.php:47
    783888msgid "Settings"
    784889msgstr ""
    785890
    786 #: src/Services/Model/GlobesProPluginSettings.php:18
    787 #: src/models/globe-pro.php:85
     891#: src/Services/Model/Pro/PluginSettings.php:21 src/models/globe-pro.php:50
    788892msgid "Editing"
    789893msgstr ""
    790894
    791 #: src/Services/Model/GlobesProPluginSettings.php:19
    792 #: src/models/globe-pro.php:86
     895#: src/Services/Model/Pro/PluginSettings.php:22 src/models/globe-pro.php:51
    793896msgid "Edit screen settings"
    794897msgstr ""
    795898
    796 #: src/Services/Model/GlobesProPluginSettings.php:24
    797 #: src/models/globe-pro.php:91
     899#: src/Services/Model/Pro/PluginSettings.php:27 src/models/globe-pro.php:56
    798900msgid "Use OpenStreeMap"
    799901msgstr ""
    800902
    801 #: src/Services/Model/GlobesProPluginSettings.php:25
    802 #: src/models/globe-pro.php:92
     903#: src/Services/Model/Pro/PluginSettings.php:28 src/models/globe-pro.php:57
    803904msgid ""
    804905"If you want to select the coordinates using a visual map with search "
     
    811912msgstr ""
    812913
    813 #: src/Services/Model/GlobesProPluginSettings.php:31
    814 #: src/models/globe-pro.php:98
     914#: src/Services/Model/Pro/PluginSettings.php:34 src/models/globe-pro.php:63
    815915#. translators: field type = input type (textarea, rich text editor...)
    816916msgid "Tooltip field type"
    817917msgstr ""
    818918
    819 #: src/Services/Model/GlobesProPluginSettings.php:32
    820 #: src/Services/Model/GlobesProPluginSettings.php:46
    821 #: src/models/globe-pro.php:99 src/models/globe-pro.php:113
     919#: src/Services/Model/Pro/PluginSettings.php:35
     920#: src/Services/Model/Pro/PluginSettings.php:49 src/models/globe-pro.php:64
     921#: src/models/globe-pro.php:78
    822922msgid ""
    823923"Type of field to use to edit the tooltip content. <br> When using the Rich "
     
    827927msgstr ""
    828928
    829 #: src/Services/Model/GlobesProPluginSettings.php:35
    830 #: src/Services/Model/GlobesProPluginSettings.php:49
    831 #: src/models/globe-pro.php:102 src/models/globe-pro.php:116
     929#: src/Services/Model/Pro/PluginSettings.php:38
     930#: src/Services/Model/Pro/PluginSettings.php:52 src/models/globe-pro.php:67
     931#: src/models/globe-pro.php:81
    832932msgid "Textarea"
    833933msgstr ""
    834934
    835 #: src/Services/Model/GlobesProPluginSettings.php:37
    836 #: src/Services/Model/GlobesProPluginSettings.php:51
    837 #: src/models/globe-pro.php:104 src/models/globe-pro.php:118
     935#: src/Services/Model/Pro/PluginSettings.php:40
     936#: src/Services/Model/Pro/PluginSettings.php:54 src/models/globe-pro.php:69
     937#: src/models/globe-pro.php:83
    838938#. translators: equivalent to classic editor in a way
    839939msgid "WP Rich Text Editor"
    840940msgstr ""
    841941
    842 #: src/Services/Model/GlobesProPluginSettings.php:38
    843 #: src/Services/Model/GlobesProPluginSettings.php:52
    844 #: src/models/globe-pro.php:105 src/models/globe-pro.php:119
     942#: src/Services/Model/Pro/PluginSettings.php:41
     943#: src/Services/Model/Pro/PluginSettings.php:55 src/models/globe-pro.php:70
     944#: src/models/globe-pro.php:84
    845945msgid "Text Input"
    846946msgstr ""
    847947
    848 #: src/Services/Model/GlobesProPluginSettings.php:45
    849 #: src/models/globe-pro.php:112
     948#: src/Services/Model/Pro/PluginSettings.php:48 src/models/globe-pro.php:77
    850949#. translators: field type = input type (textarea, rich text editor...)
    851950msgid "Action Content field type"
    852951msgstr ""
    853952
    854 #: src/Services/Model/GlobesProPluginSettings.php:64
    855 #: src/models/globe-pro.php:131
     953#: src/Services/Model/Pro/PluginSettings.php:67 src/models/globe-pro.php:96
    856954msgid "Default Active Colour"
    857955msgstr ""
    858956
    859 #: src/Services/Model/GlobesProPluginSettings.php:65
    860 #: src/models/globe-pro.php:132
     957#: src/Services/Model/Pro/PluginSettings.php:68 src/models/globe-pro.php:97
    861958msgid ""
    862959"Set the default colour for the active colour field, when you create new "
     
    864961msgstr ""
    865962
    866 #: src/Services/Model/GlobesProPluginSettings.php:71
    867 #: src/models/globe-pro.php:138
     963#: src/Services/Model/Pro/PluginSettings.php:74 src/models/globe-pro.php:103
    868964msgid "Default Hover Colour"
    869965msgstr ""
    870966
    871 #: src/Services/Model/GlobesProPluginSettings.php:72
    872 #: src/models/globe-pro.php:139
     967#: src/Services/Model/Pro/PluginSettings.php:75 src/models/globe-pro.php:104
    873968msgid "Set the default colour for the hover colour field, when you create new maps."
    874969msgstr ""
    875970
    876 #: src/Services/Model/GlobesProPluginSettings.php:78
    877 #: src/models/globe-pro.php:145
     971#: src/Services/Model/Pro/PluginSettings.php:81 src/models/globe-pro.php:110
    878972msgid "Capabilities"
    879973msgstr ""
    880974
    881 #: src/Services/Model/GlobesProPluginSettings.php:79
    882 #: src/models/globe-pro.php:146
     975#: src/Services/Model/Pro/PluginSettings.php:82 src/models/globe-pro.php:111
    883976msgid "Add custom styles to the pages loading the layouts."
    884977msgstr ""
    885978
    886 #: src/Services/Model/GlobesProPluginSettings.php:84
    887 #: src/models/globe-pro.php:151
     979#: src/Services/Model/Pro/PluginSettings.php:87 src/models/globe-pro.php:116
    888980msgid "Capability Type"
    889981msgstr ""
    890982
    891 #: src/Services/Model/GlobesProPluginSettings.php:85
    892 #: src/models/globe-pro.php:152
     983#: src/Services/Model/Pro/PluginSettings.php:88 src/models/globe-pro.php:117
    893984msgid ""
    894985"Refer to the <code>capability_type</code> argument from the "
     
    898989msgstr ""
    899990
    900 #: src/Services/Model/GlobesProPluginSettings.php:91
     991#: src/Services/Model/Pro/PluginSettings.php:94
    901992msgid "Expose Data Types"
    902993msgstr ""
    903994
    904 #: src/Services/Model/GlobesProPluginSettings.php:92
     995#: src/Services/Model/Pro/PluginSettings.php:95
    905996msgid ""
    906997"If enabled, data types like points, dot labels, regions and others will "
     
    908999msgstr ""
    9091000
    910 #: src/Services/Model/GlobesProPluginSettings.php:97
     1001#: src/Services/Model/Pro/PluginSettings.php:100
    9111002msgid "Globe single pages"
    9121003msgstr ""
    9131004
    914 #: src/Services/Model/GlobesProPluginSettings.php:98
     1005#: src/Services/Model/Pro/PluginSettings.php:101
    9151006msgid ""
    9161007"When enabled the globes will automatically have a single page where you can "
     
    9181009msgstr ""
    9191010
    920 #: src/Services/Model/GlobesProPluginSettings.php:103
     1011#: src/Services/Model/Pro/PluginSettings.php:106
    9211012#. translators: field type = input type (textarea, rich text editor...)
    9221013msgid "Enable"
    9231014msgstr ""
    9241015
    925 #: src/Services/Model/GlobesProPluginSettings.php:108
     1016#: src/Services/Model/Pro/PluginSettings.php:111
    9261017msgid "slug"
    9271018msgstr ""
    9281019
    929 #: src/Services/Model/GlobesProPluginSettings.php:109
     1020#: src/Services/Model/Pro/PluginSettings.php:112
    9301021msgid ""
    9311022"URL slug to use on single globe pages. You might need to resave your "
     
    9331024msgstr ""
    9341025
    935 #: src/Services/Model/GlobesProPluginSettings.php:119
    936 msgid "Taxonomies"
    937 msgstr ""
    938 
    939 #: src/Services/Model/GlobesProPluginSettings.php:120
    940 msgid "Enable custom taxonomies for the different types of data."
    941 msgstr ""
    942 
    943 #: src/Services/Model/GlobesProPluginSettings.php:125
    944 msgid "Add New Taxonomy"
    945 msgstr ""
    946 
    947 #: src/Services/Model/GlobesProPluginSettings.php:133
    948 msgid "Slug"
    949 msgstr ""
    950 
    951 #: src/Services/Model/GlobesProPluginSettings.php:134
    952 msgid ""
    953 "Note that if you change the slug after there are already terms in the "
    954 "taxonomy, these will be lost."
    955 msgstr ""
    956 
    957 #: src/Services/Model/GlobesProPluginSettings.php:148
    958 msgid "Show in UI"
    959 msgstr ""
    960 
    961 #: src/Services/Model/GlobesProPluginSettings.php:149
    962 msgid "Show taxonomies in plugin menu."
     1026#: src/models/globe-dotlabel.php:18
     1027msgid "Clone Dot Label"
    9631028msgstr ""
    9641029
    9651030#: src/models/globe-dotlabel.php:19
    966 msgid "Clone Dot Label"
    967 msgstr ""
    968 
    969 #: src/models/globe-dotlabel.php:20
    9701031msgid "Create a copy of this dot label"
    9711032msgstr ""
    9721033
    973 #: src/models/globe-dotlabel.php:23
     1034#: src/models/globe-dotlabel.php:22
    9741035msgid "Download Dot Labels Export File"
    9751036msgstr ""
    9761037
    977 #: src/models/globe-dotlabel.php:46
     1038#: src/models/globe-dotlabel.php:45
    9781039msgid "Dot Label"
    9791040msgstr ""
    9801041
    981 #: src/models/globe-dotlabel.php:50
     1042#: src/models/globe-dotlabel.php:49
    9821043msgid "Create New Dot Label"
    9831044msgstr ""
    9841045
    985 #: src/models/globe-dotlabel.php:51 src/models/globe-line.php:55
    986 #: src/models/globe-point.php:36 src/models/globe-region.php:78
     1046#: src/models/globe-dotlabel.php:50 src/models/globe-line.php:53
     1047#: src/models/globe-point.php:35 src/models/globe-region.php:101
    9871048msgid "Edit"
    9881049msgstr ""
    9891050
     1051#: src/models/globe-dotlabel.php:51
     1052msgid "New Dot Label"
     1053msgstr ""
     1054
    9901055#: src/models/globe-dotlabel.php:52
    991 msgid "New Dot Label"
     1056msgid "View Dot Label"
    9921057msgstr ""
    9931058
    9941059#: src/models/globe-dotlabel.php:53
    995 msgid "View Dot Label"
     1060msgid "View Dot Labels"
    9961061msgstr ""
    9971062
    9981063#: src/models/globe-dotlabel.php:54
    999 msgid "View Dot Labels"
     1064msgid "Search Dot Labels"
    10001065msgstr ""
    10011066
    10021067#: src/models/globe-dotlabel.php:55
    1003 msgid "Search Dot Labels"
     1068msgid "No Dot Labels found."
    10041069msgstr ""
    10051070
    10061071#: src/models/globe-dotlabel.php:56
    1007 msgid "No Dot Labels found."
    1008 msgstr ""
    1009 
    1010 #: src/models/globe-dotlabel.php:57
    10111072msgid "No Dot Labels found in Trash."
    10121073msgstr ""
    10131074
    1014 #: src/models/globe-dotlabel.php:58 src/models/globe-line.php:62
    1015 #: src/models/globe-point.php:43 src/models/globe-region.php:85
     1075#: src/models/globe-dotlabel.php:57 src/models/globe-line.php:60
     1076#: src/models/globe-point.php:42 src/models/globe-region.php:108
    10161077msgid "Parent Globe:"
    10171078msgstr ""
    10181079
     1080#: src/models/globe-dotlabel.php:59
     1081msgid "Dot Label Archives"
     1082msgstr ""
     1083
    10191084#: src/models/globe-dotlabel.php:60
    1020 msgid "Dot Label Archives"
     1085msgid "Dot Label Attributes"
    10211086msgstr ""
    10221087
    10231088#: src/models/globe-dotlabel.php:61
    1024 msgid "Dot Label Attributes"
     1089msgid "Insert into Dot Label"
    10251090msgstr ""
    10261091
    10271092#: src/models/globe-dotlabel.php:62
    1028 msgid "Insert into Dot Label"
     1093msgid "Uploaded to this Dot Label"
    10291094msgstr ""
    10301095
    10311096#: src/models/globe-dotlabel.php:63
    1032 msgid "Uploaded to this Dot Label"
     1097msgid "Filter Dot Label list"
    10331098msgstr ""
    10341099
    10351100#: src/models/globe-dotlabel.php:64
    1036 msgid "Filter Dot Label list"
     1101msgid "Dot Label list navigation"
    10371102msgstr ""
    10381103
    10391104#: src/models/globe-dotlabel.php:65
    1040 msgid "Dot Label list navigation"
     1105msgid "Dot Label list"
    10411106msgstr ""
    10421107
    10431108#: src/models/globe-dotlabel.php:66
    1044 msgid "Dot Label list"
     1109msgid "Dot Label Cover Image"
    10451110msgstr ""
    10461111
    10471112#: src/models/globe-dotlabel.php:67
    1048 msgid "Dot Label Cover Image"
     1113msgid "Set Dot Label Cover Image"
    10491114msgstr ""
    10501115
    10511116#: src/models/globe-dotlabel.php:68
    1052 msgid "Set Dot Label Cover Image"
     1117msgid "Remove Dot Label Cover"
    10531118msgstr ""
    10541119
    10551120#: src/models/globe-dotlabel.php:69
    1056 msgid "Remove Dot Label Cover"
    1057 msgstr ""
    1058 
    1059 #: src/models/globe-dotlabel.php:70
    10601121msgid "Use as Dot Label Cover"
    10611122msgstr ""
    10621123
    1063 #: src/models/globe-dotlabel.php:74
     1124#: src/models/globe-dotlabel.php:73
    10641125msgid ""
    10651126"Dot Label information updated. <a href=\"{permalink}\" "
     
    10671128msgstr ""
    10681129
    1069 #: src/models/globe-dotlabel.php:75
     1130#: src/models/globe-dotlabel.php:74
    10701131msgid "Dot Label info updated"
    10711132msgstr ""
    10721133
     1134#: src/models/globe-dotlabel.php:77
     1135msgid "Dot Label content restored from revision"
     1136msgstr ""
     1137
    10731138#: src/models/globe-dotlabel.php:78
    1074 msgid "Dot Label content restored from revision"
     1139msgid "Dot Label Published"
    10751140msgstr ""
    10761141
    10771142#: src/models/globe-dotlabel.php:79
    1078 msgid "Dot Label Published"
     1143msgid "Dot Label information saved."
    10791144msgstr ""
    10801145
    10811146#: src/models/globe-dotlabel.php:80
    1082 msgid "Dot Label information saved."
     1147msgid "Dot Label submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    10831148msgstr ""
    10841149
    10851150#: src/models/globe-dotlabel.php:81
    1086 msgid "Dot Label submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    1087 msgstr ""
    1088 
    1089 #: src/models/globe-dotlabel.php:82
    10901151msgid ""
    10911152"Dot Label scheduled for {date}. <a href=\"{preview_url}\" "
     
    10931154msgstr ""
    10941155
    1095 #: src/models/globe-dotlabel.php:83
     1156#: src/models/globe-dotlabel.php:82
    10961157msgid ""
    10971158"Dot Label draft updated. <a href=\"{preview_url}\" "
     
    10991160msgstr ""
    11001161
     1162#: src/models/globe-dotlabel.php:85
     1163msgid "Dot Label updated. Yay!"
     1164msgstr ""
     1165
    11011166#: src/models/globe-dotlabel.php:86
    1102 msgid "Dot Label updated. Yay!"
     1167msgid "%s Dot Label updated. Yay!"
    11031168msgstr ""
    11041169
    11051170#: src/models/globe-dotlabel.php:87
    1106 msgid "%s Dot Label updated. Yay!"
     1171msgid "Dot Label not updated, somebody is editing it"
    11071172msgstr ""
    11081173
    11091174#: src/models/globe-dotlabel.php:88
    1110 msgid "Dot Label not updated, somebody is editing it"
     1175msgid "%s Dot Label not updated, somebody is editing them"
    11111176msgstr ""
    11121177
    11131178#: src/models/globe-dotlabel.php:89
    1114 msgid "%s Dot Label not updated, somebody is editing them"
     1179msgid "Dot Label permanetly deleted. Fahrenheit 451 team was here?"
    11151180msgstr ""
    11161181
    11171182#: src/models/globe-dotlabel.php:90
    1118 msgid "Dot Label permanetly deleted. Fahrenheit 451 team was here?"
     1183msgid "%s Dot Label permanently deleted. Why? :("
    11191184msgstr ""
    11201185
    11211186#: src/models/globe-dotlabel.php:91
    1122 msgid "%s Dot Label permanently deleted. Why? :("
     1187msgid "Dot Label moved to the trash. I'm sad :("
    11231188msgstr ""
    11241189
    11251190#: src/models/globe-dotlabel.php:92
    1126 msgid "Dot Label moved to the trash. I'm sad :("
     1191msgid "%s Dot Label moved to the trash. Why? :("
    11271192msgstr ""
    11281193
    11291194#: src/models/globe-dotlabel.php:93
    1130 msgid "%s Dot Label moved to the trash. Why? :("
     1195msgid "Dot Label recovered from trash. Well done!"
    11311196msgstr ""
    11321197
    11331198#: src/models/globe-dotlabel.php:94
    1134 msgid "Dot Label recovered from trash. Well done!"
    1135 msgstr ""
    1136 
    1137 #: src/models/globe-dotlabel.php:95
    11381199msgid "%s Dot Label saved from the enemies!"
    11391200msgstr ""
    11401201
    1141 #: src/models/globe-dotlabel.php:99
     1202#: src/models/globe-dotlabel.php:98
    11421203msgid "Enter Dot Label name here"
    11431204msgstr ""
    11441205
    1145 #: src/models/globe-dotlabel.php:119 src/models/globe-line.php:125
    1146 #: src/models/globe-point.php:104 src/models/globe-region.php:148
     1206#: src/models/globe-dotlabel.php:118 src/models/globe-line.php:123
     1207#: src/models/globe-point.php:103 src/models/globe-region.php:167
    11471208msgid "Information"
    11481209msgstr ""
    11491210
    1150 #: src/models/globe-dotlabel.php:122 src/models/globe-line.php:134
    1151 #: src/models/globe-point.php:108 src/models/globe-region.php:154
    1152 msgid "Details"
    1153 msgstr ""
    1154 
    1155 #: src/models/globe-dotlabel.php:131 src/models/globe-line.php:167
     1211#: src/models/globe-dotlabel.php:131 src/models/globe-line.php:166
    11561212#: src/models/globe-point.php:117
    11571213msgid "zoom"
    11581214msgstr ""
    11591215
    1160 #: src/models/globe-dotlabel.php:140 src/models/globe-line.php:176
     1216#: src/models/globe-dotlabel.php:140 src/models/globe-line.php:175
    11611217#: src/models/globe-point.php:126
    11621218msgid "address"
     
    11671223msgstr ""
    11681224
    1169 #: src/models/globe-dotlabel.php:191 src/models/globe-line.php:269
    1170 #: src/models/globe-point.php:179 src/models/globe-region.php:226
     1225#: src/models/globe-dotlabel.php:191 src/models/globe-line.php:286
     1226#: src/models/globe-point.php:178 src/models/globe-region.php:247
    11711227msgid "Associated Globe"
    11721228msgstr ""
    11731229
     1230#: src/models/globe-line.php:21
     1231msgid "Clone Line"
     1232msgstr ""
     1233
    11741234#: src/models/globe-line.php:22
    1175 msgid "Clone Line"
    1176 msgstr ""
    1177 
    1178 #: src/models/globe-line.php:23
    11791235msgid "Create a copy of this Line"
    11801236msgstr ""
    11811237
    1182 #: src/models/globe-line.php:26
     1238#: src/models/globe-line.php:25
    11831239msgid "Download Lines Export File"
    11841240msgstr ""
    11851241
    1186 #: src/models/globe-line.php:49 src/models/globe-line.php:51
    1187 #: src/models/globe-line.php:52 src/models/globe-line.php:63
     1242#: src/models/globe-line.php:47 src/models/globe-line.php:49
     1243#: src/models/globe-line.php:50 src/models/globe-line.php:61
    11881244msgid "Lines"
    11891245msgstr ""
    11901246
    1191 #: src/models/globe-line.php:50
     1247#: src/models/globe-line.php:48
    11921248msgid "Line"
    11931249msgstr ""
    11941250
     1251#: src/models/globe-line.php:52
     1252msgid "Create New Line"
     1253msgstr ""
     1254
    11951255#: src/models/globe-line.php:54
    1196 msgid "Create New Line"
     1256msgid "New Line"
     1257msgstr ""
     1258
     1259#: src/models/globe-line.php:55
     1260msgid "View Line"
    11971261msgstr ""
    11981262
    11991263#: src/models/globe-line.php:56
    1200 msgid "New Line"
     1264msgid "View Lines"
    12011265msgstr ""
    12021266
    12031267#: src/models/globe-line.php:57
    1204 msgid "View Line"
     1268msgid "Search Lines"
    12051269msgstr ""
    12061270
    12071271#: src/models/globe-line.php:58
    1208 msgid "View Lines"
     1272msgid "No Lines found."
    12091273msgstr ""
    12101274
    12111275#: src/models/globe-line.php:59
    1212 msgid "Search Lines"
    1213 msgstr ""
    1214 
    1215 #: src/models/globe-line.php:60
    1216 msgid "No Lines found."
    1217 msgstr ""
    1218 
    1219 #: src/models/globe-line.php:61
    12201276msgid "No Lines found in Trash."
    12211277msgstr ""
    12221278
     1279#: src/models/globe-line.php:62
     1280msgid "Line Archives"
     1281msgstr ""
     1282
     1283#: src/models/globe-line.php:63
     1284msgid "Line Attributes"
     1285msgstr ""
     1286
    12231287#: src/models/globe-line.php:64
    1224 msgid "Line Archives"
     1288msgid "Insert into Line"
    12251289msgstr ""
    12261290
    12271291#: src/models/globe-line.php:65
    1228 msgid "Line Attributes"
     1292msgid "Uploaded to this Line"
    12291293msgstr ""
    12301294
    12311295#: src/models/globe-line.php:66
    1232 msgid "Insert into Line"
     1296msgid "Featured Image"
    12331297msgstr ""
    12341298
    12351299#: src/models/globe-line.php:67
    1236 msgid "Uploaded to this Line"
    1237 msgstr ""
    1238 
    1239 #: src/models/globe-line.php:68 src/models/globe-region.php:91
    1240 msgid "Featured Image"
    1241 msgstr ""
    1242 
    1243 #: src/models/globe-line.php:69 src/models/globe-region.php:92
    12441300msgid "Set featured image"
    12451301msgstr ""
    12461302
    1247 #: src/models/globe-line.php:70 src/models/globe-region.php:93
     1303#: src/models/globe-line.php:68
    12481304msgid "Remove featured image"
    12491305msgstr ""
    12501306
    1251 #: src/models/globe-line.php:71 src/models/globe-region.php:94
     1307#: src/models/globe-line.php:69
    12521308msgid "Use featured image"
    12531309msgstr ""
    12541310
     1311#: src/models/globe-line.php:70
     1312msgid "Filter Line list"
     1313msgstr ""
     1314
     1315#: src/models/globe-line.php:71
     1316msgid "Line list navigation"
     1317msgstr ""
     1318
    12551319#: src/models/globe-line.php:72
    1256 msgid "Filter Line list"
     1320msgid "Line list"
    12571321msgstr ""
    12581322
    12591323#: src/models/globe-line.php:73
    1260 msgid "Line list navigation"
     1324msgid "Line Cover Image"
    12611325msgstr ""
    12621326
    12631327#: src/models/globe-line.php:74
    1264 msgid "Line list"
     1328msgid "Set Line Cover Image"
    12651329msgstr ""
    12661330
    12671331#: src/models/globe-line.php:75
    1268 msgid "Line Cover Image"
     1332msgid "Remove Line Cover"
    12691333msgstr ""
    12701334
    12711335#: src/models/globe-line.php:76
    1272 msgid "Set Line Cover Image"
    1273 msgstr ""
    1274 
    1275 #: src/models/globe-line.php:77
    1276 msgid "Remove Line Cover"
    1277 msgstr ""
    1278 
    1279 #: src/models/globe-line.php:78
    12801336msgid "Use as Line Cover"
    12811337msgstr ""
    12821338
    1283 #: src/models/globe-line.php:82
     1339#: src/models/globe-line.php:80
    12841340msgid ""
    12851341"Line information updated. <a href=\"{permalink}\" target=\"_blank\">View "
     
    12871343msgstr ""
    12881344
    1289 #: src/models/globe-line.php:83
     1345#: src/models/globe-line.php:81
    12901346msgid "Line info updated"
    12911347msgstr ""
    12921348
     1349#: src/models/globe-line.php:84
     1350msgid "Line content restored from revision"
     1351msgstr ""
     1352
     1353#: src/models/globe-line.php:85
     1354msgid "Line Published"
     1355msgstr ""
     1356
    12931357#: src/models/globe-line.php:86
    1294 msgid "Line content restored from revision"
     1358msgid "Line information saved."
    12951359msgstr ""
    12961360
    12971361#: src/models/globe-line.php:87
    1298 msgid "Line Published"
     1362msgid "Line submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    12991363msgstr ""
    13001364
    13011365#: src/models/globe-line.php:88
    1302 msgid "Line information saved."
    1303 msgstr ""
    1304 
    1305 #: src/models/globe-line.php:89
    1306 msgid "Line submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    1307 msgstr ""
    1308 
    1309 #: src/models/globe-line.php:90
    13101366msgid ""
    13111367"Line scheduled for {date}. <a href=\"{preview_url}\" "
     
    13131369msgstr ""
    13141370
    1315 #: src/models/globe-line.php:91
     1371#: src/models/globe-line.php:89
    13161372msgid "Line draft updated. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    13171373msgstr ""
    13181374
     1375#: src/models/globe-line.php:92
     1376msgid "Line updated. Yay!"
     1377msgstr ""
     1378
     1379#: src/models/globe-line.php:93
     1380msgid "%s Line updated. Yay!"
     1381msgstr ""
     1382
    13191383#: src/models/globe-line.php:94
    1320 msgid "Line updated. Yay!"
     1384msgid "Line not updated, somebody is editing it"
    13211385msgstr ""
    13221386
    13231387#: src/models/globe-line.php:95
    1324 msgid "%s Line updated. Yay!"
     1388msgid "%s Line not updated, somebody is editing them"
    13251389msgstr ""
    13261390
    13271391#: src/models/globe-line.php:96
    1328 msgid "Line not updated, somebody is editing it"
     1392msgid "Line permanetly deleted. Fahrenheit 451 team was here?"
    13291393msgstr ""
    13301394
    13311395#: src/models/globe-line.php:97
    1332 msgid "%s Line not updated, somebody is editing them"
     1396msgid "%s Line permanently deleted. Why? :("
    13331397msgstr ""
    13341398
    13351399#: src/models/globe-line.php:98
    1336 msgid "Line permanetly deleted. Fahrenheit 451 team was here?"
     1400msgid "Line moved to the trash. I'm sad :("
    13371401msgstr ""
    13381402
    13391403#: src/models/globe-line.php:99
    1340 msgid "%s Line permanently deleted. Why? :("
     1404msgid "%s Line moved to the trash. Why? :("
    13411405msgstr ""
    13421406
    13431407#: src/models/globe-line.php:100
    1344 msgid "Line moved to the trash. I'm sad :("
     1408msgid "Line recovered from trash. Well done!"
    13451409msgstr ""
    13461410
    13471411#: src/models/globe-line.php:101
    1348 msgid "%s Line moved to the trash. Why? :("
    1349 msgstr ""
    1350 
    1351 #: src/models/globe-line.php:102
    1352 msgid "Line recovered from trash. Well done!"
    1353 msgstr ""
    1354 
    1355 #: src/models/globe-line.php:103
    13561412msgid "%s Line saved from the enemies!"
    13571413msgstr ""
    13581414
    1359 #: src/models/globe-line.php:107
     1415#: src/models/globe-line.php:105
    13601416msgid "Enter Line name here"
    13611417msgstr ""
    13621418
    1363 #: src/models/globe-line.php:135 src/models/globe-region.php:155
     1419#: src/models/globe-line.php:133 src/models/globe-region.php:174
    13641420msgid "Details."
    13651421msgstr ""
    13661422
    1367 #: src/models/globe-line.php:141
    1368 msgid "Add Line"
    1369 msgstr ""
    1370 
    1371 #: src/models/globe-line.php:142
     1423#: src/models/globe-line.php:139
     1424msgid "Add More End Points"
     1425msgstr ""
     1426
     1427#: src/models/globe-line.php:140
    13721428msgid "Lines to Connect"
    13731429msgstr ""
    13741430
    1375 #: src/models/globe-line.php:163
     1431#: src/models/globe-line.php:162
    13761432msgid "Line Info"
    13771433msgstr ""
    13781434
    1379 #: src/models/globe-line.php:199 src/models/globe-region.php:183
    1380 msgid "Customize"
    1381 msgstr ""
    1382 
    1383 #: src/models/globe-line.php:204 src/models/globe-region.php:188
    1384 msgid "Use Custom Options"
    1385 msgstr ""
    1386 
    1387 #: src/models/globe-line.php:205 src/models/globe-region.php:189
    1388 msgid "Define custom colors and actions."
    1389 msgstr ""
    1390 
    1391 #: src/models/globe-line.php:210
     1435#: src/models/globe-line.php:209
    13921436msgid "Line Color"
    13931437msgstr ""
    13941438
    1395 #: src/models/globe-line.php:261 src/models/globe-point.php:170
    1396 #: src/models/globe-region.php:218
     1439#: src/models/globe-line.php:277 src/models/globe-point.php:169
     1440#: src/models/globe-region.php:238
    13971441msgid "Globe rel"
    13981442msgstr ""
    13991443
    1400 #: src/models/globe-point.php:31
     1444#: src/models/globe-point.php:30
    14011445msgid "Point"
    14021446msgstr ""
    14031447
    1404 #: src/models/globe-point.php:35
     1448#: src/models/globe-point.php:34
    14051449msgid "Create New Point"
    14061450msgstr ""
    14071451
     1452#: src/models/globe-point.php:36
     1453msgid "New Point"
     1454msgstr ""
     1455
    14081456#: src/models/globe-point.php:37
    1409 msgid "New Point"
     1457msgid "View Point"
    14101458msgstr ""
    14111459
    14121460#: src/models/globe-point.php:38
    1413 msgid "View Point"
     1461msgid "View Points"
    14141462msgstr ""
    14151463
    14161464#: src/models/globe-point.php:39
    1417 msgid "View Points"
     1465msgid "Search Points"
    14181466msgstr ""
    14191467
    14201468#: src/models/globe-point.php:40
    1421 msgid "Search Points"
     1469msgid "No Points found."
    14221470msgstr ""
    14231471
    14241472#: src/models/globe-point.php:41
    1425 msgid "No Points found."
    1426 msgstr ""
    1427 
    1428 #: src/models/globe-point.php:42
    14291473msgid "No Points found in Trash."
    14301474msgstr ""
    14311475
     1476#: src/models/globe-point.php:44
     1477msgid "Point Archives"
     1478msgstr ""
     1479
    14321480#: src/models/globe-point.php:45
    1433 msgid "Point Archives"
     1481msgid "Point Attributes"
    14341482msgstr ""
    14351483
    14361484#: src/models/globe-point.php:46
    1437 msgid "Point Attributes"
     1485msgid "Insert into Point"
    14381486msgstr ""
    14391487
    14401488#: src/models/globe-point.php:47
    1441 msgid "Insert into Point"
     1489msgid "Uploaded to this Point"
    14421490msgstr ""
    14431491
    14441492#: src/models/globe-point.php:48
    1445 msgid "Uploaded to this Point"
     1493msgid "Filter Point list"
    14461494msgstr ""
    14471495
    14481496#: src/models/globe-point.php:49
    1449 msgid "Filter Point list"
     1497msgid "Point list navigation"
    14501498msgstr ""
    14511499
    14521500#: src/models/globe-point.php:50
    1453 msgid "Point list navigation"
     1501msgid "Point list"
    14541502msgstr ""
    14551503
    14561504#: src/models/globe-point.php:51
    1457 msgid "Point list"
     1505msgid "Point Cover Image"
    14581506msgstr ""
    14591507
    14601508#: src/models/globe-point.php:52
    1461 msgid "Point Cover Image"
     1509msgid "Set Point Cover Image"
    14621510msgstr ""
    14631511
    14641512#: src/models/globe-point.php:53
    1465 msgid "Set Point Cover Image"
     1513msgid "Remove Point Cover"
    14661514msgstr ""
    14671515
    14681516#: src/models/globe-point.php:54
    1469 msgid "Remove Point Cover"
    1470 msgstr ""
    1471 
    1472 #: src/models/globe-point.php:55
    14731517msgid "Use as Point Cover"
    14741518msgstr ""
    14751519
    1476 #: src/models/globe-point.php:59
     1520#: src/models/globe-point.php:58
    14771521msgid ""
    14781522"Point information updated. <a href=\"{permalink}\" target=\"_blank\">View "
     
    14801524msgstr ""
    14811525
    1482 #: src/models/globe-point.php:60
     1526#: src/models/globe-point.php:59
    14831527msgid "Point info updated"
    14841528msgstr ""
    14851529
     1530#: src/models/globe-point.php:62
     1531msgid "Point content restored from revision"
     1532msgstr ""
     1533
    14861534#: src/models/globe-point.php:63
    1487 msgid "Point content restored from revision"
     1535msgid "Point Published"
    14881536msgstr ""
    14891537
    14901538#: src/models/globe-point.php:64
    1491 msgid "Point Published"
     1539msgid "Point information saved."
    14921540msgstr ""
    14931541
    14941542#: src/models/globe-point.php:65
    1495 msgid "Point information saved."
     1543msgid "Point submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    14961544msgstr ""
    14971545
    14981546#: src/models/globe-point.php:66
    1499 msgid "Point submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    1500 msgstr ""
    1501 
    1502 #: src/models/globe-point.php:67
    15031547msgid ""
    15041548"Point scheduled for {date}. <a href=\"{preview_url}\" "
     
    15061550msgstr ""
    15071551
    1508 #: src/models/globe-point.php:68
     1552#: src/models/globe-point.php:67
    15091553msgid "Point draft updated. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    15101554msgstr ""
    15111555
     1556#: src/models/globe-point.php:70
     1557msgid "Point updated. Yay!"
     1558msgstr ""
     1559
    15121560#: src/models/globe-point.php:71
    1513 msgid "Point updated. Yay!"
     1561msgid "%s Point updated. Yay!"
    15141562msgstr ""
    15151563
    15161564#: src/models/globe-point.php:72
    1517 msgid "%s Point updated. Yay!"
     1565msgid "Point not updated, somebody is editing it"
    15181566msgstr ""
    15191567
    15201568#: src/models/globe-point.php:73
    1521 msgid "Point not updated, somebody is editing it"
     1569msgid "%s Point not updated, somebody is editing them"
    15221570msgstr ""
    15231571
    15241572#: src/models/globe-point.php:74
    1525 msgid "%s Point not updated, somebody is editing them"
     1573msgid "Point permanetly deleted. Fahrenheit 451 team was here?"
    15261574msgstr ""
    15271575
    15281576#: src/models/globe-point.php:75
    1529 msgid "Point permanetly deleted. Fahrenheit 451 team was here?"
     1577msgid "%s Point permanently deleted. Why? :("
    15301578msgstr ""
    15311579
    15321580#: src/models/globe-point.php:76
    1533 msgid "%s Point permanently deleted. Why? :("
     1581msgid "Point moved to the trash. I'm sad :("
    15341582msgstr ""
    15351583
    15361584#: src/models/globe-point.php:77
    1537 msgid "Point moved to the trash. I'm sad :("
     1585msgid "%s Point moved to the trash. Why? :("
    15381586msgstr ""
    15391587
    15401588#: src/models/globe-point.php:78
    1541 msgid "%s Point moved to the trash. Why? :("
     1589msgid "Point recovered from trash. Well done!"
    15421590msgstr ""
    15431591
    15441592#: src/models/globe-point.php:79
    1545 msgid "Point recovered from trash. Well done!"
    1546 msgstr ""
    1547 
    1548 #: src/models/globe-point.php:80
    15491593msgid "%s Point saved from the enemies!"
    15501594msgstr ""
    15511595
    1552 #: src/models/globe-point.php:84
     1596#: src/models/globe-point.php:83
    15531597msgid "Enter Point name here"
    15541598msgstr ""
    15551599
    1556 #: src/models/globe-pro.php:30
    1557 msgid "Open content in Lightbox"
    1558 msgstr ""
    1559 
    1560 #: src/models/globe-pro.php:31
    1561 msgid "Open URL in Lightbox (iframe)"
    1562 msgstr ""
    1563 
    1564 #: src/models/globe-pro.php:32
    1565 msgid "Open Image in Lightbox"
    1566 msgstr ""
    1567 
    1568 #: src/models/globe-pro.php:33
    1569 msgid "Display content below"
    1570 msgstr ""
    1571 
    1572 #: src/models/globe-pro.php:34
    1573 msgid "Display content below & scroll"
    1574 msgstr ""
    1575 
    1576 #: src/models/globe-pro.php:35
    1577 msgid "Display content above"
    1578 msgstr ""
    1579 
    1580 #: src/models/globe-pro.php:36
    1581 msgid "Display content to right"
    1582 msgstr ""
    1583 
    1584 #: src/models/globe-pro.php:37
    1585 msgid "Display page below (beta)"
    1586 msgstr ""
    1587 
    1588 #: src/models/globe-pro.php:38
    1589 msgid "Display page below & scroll (beta)"
    1590 msgstr ""
    1591 
    1592 #: src/models/globe-pro.php:164
     1600#: src/models/globe-pro.php:18
     1601msgid "Clone Globe"
     1602msgstr ""
     1603
     1604#: src/models/globe-pro.php:19
     1605msgid "Create a copy of this globe"
     1606msgstr ""
     1607
     1608#: src/models/globe-pro.php:129
    15931609msgid "Use default"
    15941610msgstr ""
    15951611
    1596 #: src/models/globe-pro.php:172 src/models/globe-pro.php:218
     1612#: src/models/globe-pro.php:137 src/models/globe-pro.php:183
    15971613msgid "Use defaults"
    15981614msgstr ""
    15991615
    1600 #: src/models/globe-pro.php:173 src/models/globe-pro.php:219
     1616#: src/models/globe-pro.php:138 src/models/globe-pro.php:184
    16011617msgid "Use default colors and actions."
    16021618msgstr ""
    16031619
    1604 #: src/models/globe-region.php:45
     1620#: src/models/globe-region.php:69
    16051621msgid "Clone Region"
    16061622msgstr ""
    16071623
    1608 #: src/models/globe-region.php:46
     1624#: src/models/globe-region.php:70
    16091625msgid "Create a copy of this Region"
    16101626msgstr ""
    16111627
    1612 #: src/models/globe-region.php:49
     1628#: src/models/globe-region.php:73
    16131629msgid "Download Regions Export File"
    16141630msgstr ""
    16151631
    1616 #: src/models/globe-region.php:72 src/models/globe-region.php:74
    1617 #: src/models/globe-region.php:75 src/models/globe-region.php:86
     1632#: src/models/globe-region.php:95 src/models/globe-region.php:97
     1633#: src/models/globe-region.php:98 src/models/globe-region.php:109
    16181634msgid "Regions"
    16191635msgstr ""
    16201636
    1621 #: src/models/globe-region.php:73
     1637#: src/models/globe-region.php:96
    16221638msgid "Region"
    16231639msgstr ""
    16241640
    1625 #: src/models/globe-region.php:77
     1641#: src/models/globe-region.php:100
    16261642msgid "Create New Region"
    16271643msgstr ""
    16281644
    1629 #: src/models/globe-region.php:79
     1645#: src/models/globe-region.php:102
    16301646msgid "New Region"
    16311647msgstr ""
    16321648
    1633 #: src/models/globe-region.php:80
     1649#: src/models/globe-region.php:103
    16341650msgid "View Region"
    16351651msgstr ""
    16361652
    1637 #: src/models/globe-region.php:81
     1653#: src/models/globe-region.php:104
    16381654msgid "View Regions"
    16391655msgstr ""
    16401656
    1641 #: src/models/globe-region.php:82
     1657#: src/models/globe-region.php:105
    16421658msgid "Search Regions"
    16431659msgstr ""
    16441660
    1645 #: src/models/globe-region.php:83
     1661#: src/models/globe-region.php:106
    16461662msgid "No Regions found."
    16471663msgstr ""
    16481664
    1649 #: src/models/globe-region.php:84
     1665#: src/models/globe-region.php:107
    16501666msgid "No Regions found in Trash."
    16511667msgstr ""
    16521668
    1653 #: src/models/globe-region.php:87
     1669#: src/models/globe-region.php:110
    16541670msgid "Region Archives"
    16551671msgstr ""
    16561672
    1657 #: src/models/globe-region.php:88
     1673#: src/models/globe-region.php:111
    16581674msgid "Region Attributes"
    16591675msgstr ""
    16601676
    1661 #: src/models/globe-region.php:89
     1677#: src/models/globe-region.php:112
    16621678msgid "Insert into Region"
    16631679msgstr ""
    16641680
    1665 #: src/models/globe-region.php:90
     1681#: src/models/globe-region.php:113
    16661682msgid "Uploaded to this Region"
    16671683msgstr ""
    16681684
    1669 #: src/models/globe-region.php:95
     1685#: src/models/globe-region.php:114
    16701686msgid "Filter Region list"
    16711687msgstr ""
    16721688
    1673 #: src/models/globe-region.php:96
     1689#: src/models/globe-region.php:115
    16741690msgid "Region list navigation"
    16751691msgstr ""
    16761692
    1677 #: src/models/globe-region.php:97
     1693#: src/models/globe-region.php:116
    16781694msgid "Region list"
    16791695msgstr ""
    16801696
    1681 #: src/models/globe-region.php:98
     1697#: src/models/globe-region.php:117
    16821698msgid "Region Cover Image"
    16831699msgstr ""
    16841700
    1685 #: src/models/globe-region.php:99
     1701#: src/models/globe-region.php:118
    16861702msgid "Set Region Cover Image"
    16871703msgstr ""
    16881704
    1689 #: src/models/globe-region.php:100
     1705#: src/models/globe-region.php:119
    16901706msgid "Remove Region Cover"
    16911707msgstr ""
    16921708
    1693 #: src/models/globe-region.php:101
     1709#: src/models/globe-region.php:120
    16941710msgid "Use as Region Cover"
    16951711msgstr ""
    16961712
    1697 #: src/models/globe-region.php:105
     1713#: src/models/globe-region.php:124
    16981714msgid ""
    16991715"Region information updated. <a href=\"{permalink}\" target=\"_blank\">View "
     
    17011717msgstr ""
    17021718
    1703 #: src/models/globe-region.php:106
     1719#: src/models/globe-region.php:125
    17041720msgid "Region info updated"
    17051721msgstr ""
    17061722
    1707 #: src/models/globe-region.php:109
     1723#: src/models/globe-region.php:128
    17081724msgid "Region content restored from revision"
    17091725msgstr ""
    17101726
    1711 #: src/models/globe-region.php:110
     1727#: src/models/globe-region.php:129
    17121728msgid "Region Published"
    17131729msgstr ""
    17141730
    1715 #: src/models/globe-region.php:111
     1731#: src/models/globe-region.php:130
    17161732msgid "Region information saved."
    17171733msgstr ""
    17181734
    1719 #: src/models/globe-region.php:112
     1735#: src/models/globe-region.php:131
    17201736msgid "Region submitted. <a href=\"{preview_url}\" target=\"_blank\">Preview</a>"
    17211737msgstr ""
    17221738
    1723 #: src/models/globe-region.php:113
     1739#: src/models/globe-region.php:132
    17241740msgid ""
    17251741"Region scheduled for {date}. <a href=\"{preview_url}\" "
     
    17271743msgstr ""
    17281744
    1729 #: src/models/globe-region.php:114
     1745#: src/models/globe-region.php:133
    17301746msgid ""
    17311747"Region draft updated. <a href=\"{preview_url}\" "
     
    17331749msgstr ""
    17341750
    1735 #: src/models/globe-region.php:117
     1751#: src/models/globe-region.php:136
    17361752msgid "Region updated. Yay!"
    17371753msgstr ""
    17381754
    1739 #: src/models/globe-region.php:118
     1755#: src/models/globe-region.php:137
    17401756msgid "%s Region updated. Yay!"
    17411757msgstr ""
    17421758
    1743 #: src/models/globe-region.php:119
     1759#: src/models/globe-region.php:138
    17441760msgid "Region not updated, somebody is editing it"
    17451761msgstr ""
    17461762
    1747 #: src/models/globe-region.php:120
     1763#: src/models/globe-region.php:139
    17481764msgid "%s Region not updated, somebody is editing them"
    17491765msgstr ""
    17501766
    1751 #: src/models/globe-region.php:121
     1767#: src/models/globe-region.php:140
    17521768msgid "Region permanetly deleted. Fahrenheit 451 team was here?"
    17531769msgstr ""
    17541770
    1755 #: src/models/globe-region.php:122
     1771#: src/models/globe-region.php:141
    17561772msgid "%s Region permanently deleted. Why? :("
    17571773msgstr ""
    17581774
    1759 #: src/models/globe-region.php:123
     1775#: src/models/globe-region.php:142
    17601776msgid "Region moved to the trash. I'm sad :("
    17611777msgstr ""
    17621778
    1763 #: src/models/globe-region.php:124
     1779#: src/models/globe-region.php:143
    17641780msgid "%s Region moved to the trash. Why? :("
    17651781msgstr ""
    17661782
    1767 #: src/models/globe-region.php:125
     1783#: src/models/globe-region.php:144
    17681784msgid "Region recovered from trash. Well done!"
    17691785msgstr ""
    17701786
    1771 #: src/models/globe-region.php:126
     1787#: src/models/globe-region.php:145
    17721788msgid "%s Region saved from the enemies!"
    17731789msgstr ""
    17741790
    1775 #: src/models/globe-region.php:130
     1791#: src/models/globe-region.php:149
    17761792msgid "Enter Region name here"
    17771793msgstr ""
    17781794
    1779 #: src/models/globe-region.php:162
     1795#: src/models/globe-region.php:181
    17801796msgid "Select a region"
    17811797msgstr ""
    17821798
    1783 #: src/models/globe-region.php:163
     1799#: src/models/globe-region.php:182
    17841800msgid "Region Code *"
    17851801msgstr ""
    17861802
    1787 #: src/models/globe-region.php:165
     1803#: src/models/globe-region.php:185
    17881804msgid "Fetching regions from: "
    17891805msgstr ""
  • interactive-globes/trunk/src/Core.php

    r3098987 r3158721  
    88use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\Meta\MetaFeature;
    99use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\CptManager\CptManagerFeature;
     10use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\Sales\UpsellPageFeature;
    1011use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\Updater\UpdateFeature;
    1112// services
     
    5354
    5455        // load services
    55         $this->register_services();
     56        $service_list = $this->get_services_classes();
     57        $this->register_services( $service_list );
    5658
    5759        // 1- Loads features
    58         $this->register_features();
     60        $feature_list = $this->get_features_classes();
     61        $this->register_features( $feature_list );
    5962
    6063        // temp fix for admin
     
    7982     * @return void
    8083     */
    81     public function register_features() {
     84    public function register_features( $features ) {
    8285
    8386        // Bail early so we don't instantiate features twice.
     
    8891        //TODO by pcarvalho: allow each service their own dependencies
    8992        $dependencies = [ $this->project, $this->services_container ];
    90         $features     = $this->get_features_classes();
    9193
    9294        foreach ( $features as $id => $class ) {
     
    101103     * @return void
    102104     */
    103     public function register_services() {
     105    public function register_services( $services ) {
    104106
    105107        if ( count( $this->features_container ) > 0 ) {
     
    108110
    109111        $dependencies = [ $this->project ];
    110         $services     = $this->get_services_classes();
    111112
    112113        foreach ( $services as $id => $class ) {
     
    127128            'shortcode'  => ShortcodeFeature::class,
    128129            'Updater'    => UpdateFeature::class,
     130            'Upsell'     => UpsellPageFeature::class,
    129131        ];
    130132    }
  • interactive-globes/trunk/src/Features/CptManager/CptManagerCore.php

    r3098987 r3158721  
    3737            border-top: 1px solid #ccd0d4;
    3838        }
     39        .geocoding-hide { display:none; }
    3940        </style>';
    4041
     
    5657        $meta_box_content  = '';
    5758        $cpt_meta_boxes    = [];
     59
     60        // autofill from url parameter
     61        if( isset( $_GET['title'] ) ){
     62            $post_title = esc_attr( $_GET['title'] );
     63        }
    5864
    5965        // cpt labels
  • interactive-globes/trunk/src/Features/Meta/MetaCore.php

    r3115164 r3158721  
    22namespace Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\Meta;
    33
    4 use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Project;
    54use Saltus\WP\Framework\Infrastructure\Container\Invalid;
    65use Saltus\WP\Framework\Infrastructure\Container\ServiceContainer;
     
    1211class MetaCore implements Registerable {
    1312
    14     private $project;
    1513    private $services;
    1614
    1715    public function __construct( ...$dependencies ) {
    18 
    19         if ( empty( $dependencies[0] ) ) {
    20             throw Invalid::from( 'Project' );
    21         }
    22         if ( ! $dependencies[0] instanceof Project ) {
    23             throw Invalid::from( $dependencies[0] );
    24         }
    2516
    2617        if ( empty( $dependencies[1] ) ) {
     
    3122        }
    3223
    33         $this->project  = $dependencies[0];
    3424        $this->services = $dependencies[1];
    3525    }
     
    6050    public function remove_custom_meta_form() {
    6151
    62         $post_types = [ 'iglobe', 'itt_globe_point', 'itt_globe_dotlabel' ];
     52        $post_types = [ 'iglobe' ];
    6353        /**
    6454         * Filters the default list of post types to remove the postcustom meta box .
     
    6656         * @param string[]  $post_types An array of CPTs names.
    6757         */
    68         $post_types = apply_filters( 'itt_globes/meta/remove_meta_box_postcustom', $post_types );
     58        $post_types = apply_filters( 'itt_globes/meta/remove_meta_box_post_types', $post_types );
    6959        foreach ( $post_types as $post_type ) {
    7060            remove_meta_box( 'postcustom', $post_type, 'normal' );
     
    7969            '/globe/(?<id>\d+)/(?<post_type>\w+)/list',
    8070            [
    81                 'methods'  => 'GET',
    82                 'callback' => [ $this, 'rest_globe_cpt_list' ],
     71                'methods'             => 'GET',
     72                'callback'            => [ $this, 'rest_globe_cpt_list' ],
     73                'permission_callback' => '__return_true',
    8374            ]
    8475        );
     
    133124    public function render_custom_data_meta_box() {
    134125        global $post;
    135         printf( '<p id="meta_box_shortcode-code">[display-globe id="%1$s"]</p>', (int) esc_attr( $post->ID ) );
     126        printf( '<div class="meta_box_shortcode-code_container"><span id="meta_box_shortcode-code">[display-globe id="%1$s"]</span> <button id="ittglobe-copy-button" type="button" class="dashicons dashicons-admin-page" title="Copy to clipboard"></button></div>', (int) esc_attr( $post->ID ) );
    136127    }
    137128
     
    177168        );
    178169        $button_label = __( 'Add new', 'interactive-globes' );
    179         if ( empty( $args['button_label'] ) ) {
     170        if ( ! empty( $args['button_label'] ) ) {
    180171            $button_label = $args['button_label'];
    181172        }
     
    188179        $data = '';
    189180
    190         if( ! empty( $args['data'] ) && is_array( $args['data']) ){
    191             foreach ($args['data'] as $datakey ) {
     181        if ( ! empty( $args['data'] ) && is_array( $args['data'] ) ) {
     182            foreach ( $args['data'] as $datakey ) {
    192183                $data .= ' data-' . $datakey . '=""';
    193184            }
     
    238229            <script>
    239230                document.addEventListener("DOMContentLoaded", function() {
    240                     init_cpt_events( "' . $cpt . '" );
     231                    if (typeof init_cpt_events === "function" ) {
     232                        // The function exists
     233                        init_cpt_events( "' . $cpt . '" );
     234                    }
    241235                });
    242236            </script>
  • interactive-globes/trunk/src/Features/Shortcode/ShortcodeCore.php

    r3115164 r3158721  
    66use Saltus\WP\Framework\Infrastructure\Container\ServiceContainer;
    77use Saltus\WP\Framework\Infrastructure\Plugin\Registerable;
     8use Saltus\WP\Plugin\Saltus\InteractiveGlobes\Services\Assets\HasAssets;
    89
    910/**
     
    4950    public function register() {
    5051        add_shortcode( 'display-globe', array( $this, 'render_shortcode' ) );
     52
     53        // Hook the function to admin_footer
     54        add_action( 'admin_footer', [ $this, 'render_shortcode_in_cpt_footer' ] );
    5155    }
    5256
     
    133137        }
    134138
    135         $this->setup_meta( $atts );
    136139        $id   = absint( $atts['id'] );
    137140        $data = [
     
    143146        }
    144147
    145         $args = [
    146             'post_type'      => 'itt_globe_point',
    147             'posts_per_page' => -1,
    148             'meta_query'     => [
    149                 [
    150                     'key'     => 'globe_id',
    151                     'value'   => $id,
    152                     'compare' => '=',
    153                     'type'    => 'NUMERIC',
    154                 ],
    155             ],
    156         ];
    157         $points_cpts_list = [];
    158         $points_query     = new \WP_Query( $args );
    159         if ( $points_query->have_posts() ) {
    160             while ( $points_query->have_posts() ) {
    161                 $points_query->the_post();
    162                 $point_id = get_the_ID();
    163                 $metadata = get_post_meta( $point_id );
    164 
    165                 $point_title = get_the_title();
    166 
    167                 if ( empty( $metadata['points_info'][0] ) ) {
    168                     continue;
    169                 }
    170                 $points_info = maybe_unserialize( $metadata['points_info'][0] );
    171 
    172                 $points_info['id'] = $point_id;
    173                 $points_info['title'] = $point_title;
    174 
    175                 $points_cpts_list[] = $points_info;
    176             }
    177         }
    178 
    179         $args = [
    180             'post_type'      => 'itt_globe_dotlabel',
    181             'posts_per_page' => -1,
    182             'meta_query'     => [
    183                 [
    184                     'key'     => 'globe_id',
    185                     'value'   => $id,
    186                     'compare' => '=',
    187                     'type'    => 'NUMERIC',
    188                 ],
    189             ],
    190         ];
    191         $cpt_dotlabel_list = [];
    192         $points_query     = new \WP_Query( $args );
    193         if ( $points_query->have_posts() ) {
    194             while ( $points_query->have_posts() ) {
    195                 $points_query->the_post();
    196                 $point_id = get_the_ID();
    197                 $metadata = get_post_meta( $point_id );
    198 
    199                 $point_title = get_the_title();
    200 
    201                 if ( empty( $metadata['dotLabels_info'][0] ) ) {
    202                     continue;
    203                 }
    204                 $points_info = maybe_unserialize( $metadata['dotLabels_info'][0] );
    205 
    206                 $points_info['id'] = $point_id;
    207                 $points_info['title'] = $point_title;
    208 
    209                 $cpt_dotlabel_list[] = $points_info;
    210             }
    211         }
    212         $args = [
    213             'post_type'      => 'itt_globe_line',
    214             'posts_per_page' => -1,
    215             'meta_query'     => [
    216                 [
    217                     'key'     => 'globe_id',
    218                     'value'   => $id,
    219                     'compare' => '=',
    220                     'type'    => 'NUMERIC',
    221                 ],
    222             ],
    223         ];
    224         $cpt_line_list = [];
    225         $cpt_query        = new \WP_Query( $args );
    226         if ( $cpt_query->have_posts() ) {
    227             while ( $cpt_query->have_posts() ) {
    228                 $cpt_query->the_post();
    229 
    230                 $cpt_id    = get_the_ID();
    231                 $metadata  = get_post_meta( $cpt_id );
    232                 $cpt_title = get_the_title();
    233 
    234                 if ( empty( $metadata['lines_info'][0] ) ) {
    235                     continue;
    236                 }
    237 
    238                 $cpt_info          = maybe_unserialize( $metadata['lines_info'][0] );
    239                 $cpt_info['id']    = $cpt_id;
    240                 $cpt_info['title'] = $cpt_title;
    241 
    242                 $cpt_line_list[] = $cpt_info;
    243             }
    244         }
    245 
    246         wp_reset_query();
    247 
    248         //TODO by pcarvalho: run this extra cpts via filter
    249         $shortcode_meta = apply_filters( 'ittglobe/shortcode/pre/meta', $this->meta );
    250         $this->meta['points'] = $points_cpts_list;
    251         $this->meta['dotLabels'] = $cpt_dotlabel_list;
    252         $this->meta['arcLines']  = $cpt_line_list;
    253 
    254148        $name = $assets->register_script(
    255149            '/assets/js/public/globe.js',
     
    257151            true
    258152        );
    259 
    260153        wp_enqueue_script( $name );
     154        wp_localize_script( $name, 'ittGlobeData', $data );
    261155
    262156        // globe pro
     
    267161                true
    268162            );
    269         }
    270 
    271         wp_enqueue_script( $name );
    272         wp_localize_script( $name, 'ittGlobeData', $data );
    273 
     163            wp_enqueue_script( $name );
     164        }
     165
     166        if ( is_admin() ) {
     167            $name = $assets->register_script(
     168                '/assets/js/admin/hoist-globe.js',
     169                [
     170                    '/assets/js/public/globe.js',
     171                    '/assets/js/vendor/public/globe.gl.js',
     172                ],
     173                true
     174            );
     175            wp_enqueue_script( $name );
     176        }
     177
     178        // prepare meta
     179        $this->setup_meta( $atts );
     180        $this->meta = apply_filters( 'itt_globes/shortcode/post_setup_meta', $this->meta, $id );
     181        $namespace  = 'Saltus\WP\Plugin\Saltus\InteractiveGlobes\Features\ClickActions\\';
     182
     183        $enabled_click_actions = $this->meta['enabled_click_actions'];
     184        foreach ( $enabled_click_actions as $click_action ) {
     185            $click_action_classname = $namespace . $click_action;
     186            if ( ! class_exists( $click_action_classname ) ) {
     187                continue;
     188            }
     189            $click_action_class = new $click_action_classname();
     190            if ( $click_action_class instanceof Registerable ) {
     191                $click_action_class->register();
     192            }
     193            if ( $click_action_class instanceof HasAssets ) {
     194                $click_action_class->register_assets( $assets );
     195            }
     196        }
    274197        $container_class = 'itt_globe_wrapper';
    275198        $container_style = '';
     
    291214         * @param int $id                 The globe id of the current block
    292215         */
    293         $container_class = apply_filters( 'itt_globe_container_class', $container_class, $id );
     216        $container_class = apply_filters( 'itt_globes/render/container_class', $container_class, $id );
    294217
    295218        /**
     
    299222         * @param int $id                 The globe id of the current block
    300223         */
    301         $container_style = apply_filters( 'itt_globe_container_style', $container_style, $id );
     224        $container_style = apply_filters( 'itt_globes/render/container_style', $container_style, $id );
    302225
    303226        $before = '';
     
    309232         * @param int $id        The globe id of the current block
    310233         */
    311         $before = apply_filters( 'itt_globe_content_before', $before, $id );
     234        $before = apply_filters( 'itt_globes/render/content_before', $before, $id );
    312235
    313236        /**
     
    317240         * @param int $id       The globe id of the current block
    318241         */
    319         $after = apply_filters( 'itt_globe_content_after', $after, $id );
     242        $after = apply_filters( 'itt_globes/render/content_after', $after, $id );
    320243
    321244        $html_globe = sprintf(
     
    325248        );
    326249        $html_block = sprintf(
    327             '<div class="itt_globe_aspect_ratio" style="padding-top: %1$s" data-padding-top="%2$s" data-padding-top-mobile="%3$s">
     250            '<div class="itt_globe_container"><div class="itt_globe_aspect_ratio" style="padding-top: %1$s" data-padding-top="%2$s" data-padding-top-mobile="%3$s">
    328251                %4$s
    329             </div>',
     252            </div></div>',
    330253            $padding_top . '%',  // 1
    331254            $padding_top,        // 2
     
    361284    }
    362285
     286
     287    /**
     288     * Render shortcode in footer to be hoisted
     289     *
     290     * @return void
     291     */
     292    public function render_shortcode_in_cpt_footer() {
     293
     294        global $pagenow;
     295        // Check if we're on the edit page for a specific CPT
     296        if ( get_post_type() === 'iglobe' &&
     297            ( $pagenow === 'post.php' && isset( $_GET['post'] ) ) ||
     298            ( $pagenow === 'post-new.php' ) ) {
     299            // Render the shortcode output
     300            echo '<div id="custom-footer-shortcode">';
     301            echo do_shortcode( '[display-globe]' );
     302            echo '</div>';
     303        }
     304    }
     305
    363306    /**
    364307     * Setup proper data needed to render the globe
     
    378321         * @param int $id      The globe id of the current block
    379322         */
    380         $meta       = apply_filters( 'itt_globe_setup_meta', $meta, $id );
     323        $meta       = apply_filters( 'itt_globes/meta/setup', $meta, $id );
    381324        $meta['id'] = $id;
    382325        $this->meta = $meta;
  • interactive-globes/trunk/src/Features/Tooltip/TooltipCore.php

    r3098987 r3158721  
    1212
    1313    /**
    14      * Register Shortcode
     14     * Register Tooltip filters
    1515     */
    1616    public function register() {
    1717        // single globe page filter
    18         add_filter( 'itt_globe_container_class', [ $this, 'container_class' ] );
    19         add_filter( 'itt_globe_content_before', [ $this, 'content_before' ], 10, 2 );
     18        add_filter( 'itt_globes/render/container_class', [ $this, 'container_class' ] );
     19        add_filter( 'itt_globes/render/content_before', [ $this, 'content_before' ], 10, 2 );
    2020    }
    2121
     
    6767            $font_size, // 8
    6868            $border_rule,
    69             $max_width,
     69            $max_width
    7070        );
    7171        $style .= '</style>';
  • interactive-globes/trunk/src/Plugin/Assets.php

    r3115164 r3158721  
    104104    public function load_globe_styles() {
    105105
    106         $path = plugins_url( "{$this->dir}/assets/css/public/style{$this->suffix}.css", $this->project->file_path );
    107         wp_register_style(
    108             $this->project->name . '_globe',
    109             $path,
    110             [],
    111             $this->project->version
    112         );
    113 
    114         wp_enqueue_style( $this->project->name . '_globe' );
    115     }
    116 
    117     /**
    118      * Load globe scripts
    119      *
    120      */
    121     public function load_globe_scripts() {
    122         try {
    123             $assets = $this->services->get( 'assets' )->create();
    124         } catch ( \Exception $exception ) {
    125 
    126             if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) {
    127                 // phpcs:ignore WordPress.PHP.DevelopmentFunctions
    128                 error_log( 'Failed to load styles' );
    129             }
    130         }
    131         $name = $assets->register_script(
    132             '/assets/js/vendor/public/globe.gl.js',
    133             [],
    134             true
    135         );
    136         wp_enqueue_script( $name );
    137     }
    138 
    139     /**
    140      * Load admin styles
    141      *
    142      */
    143     public function load_admin_styles() {
    144 
    145     /*  if ( ! $this->is_view_editor() ) {
    146             return;
    147         } */
    148         // might need styles across all admin, because of menu styles
    149         wp_register_style(
    150             $this->project->name . '_admin',
    151             plugins_url( "{$this->dir}/assets/css/admin/admin-style{$this->suffix}.css", $this->project->file_path ),
    152             false,
    153             $this->project->version
    154         );
    155 
    156         wp_enqueue_style( $this->project->name . '_admin' );
    157     }
    158 
    159     /**
    160      * Load admin scripts
    161      *
    162      */
    163     public function load_admin_scripts() {
    164 
    165         /* if ( ! $this->is_view_editor() ) {
    166             return;
    167         }
    168  */
    169106        try {
    170107            $assets = $this->services->get( 'assets' )->create();
     
    175112            }
    176113        }
     114        if ( is_admin() && ! $this->is_globe_admin() ) {
     115            return;
     116        }
     117
     118        $name = $assets->register_style(
     119            '/assets/css/public/itt-globes-style.css',
     120            []
     121        );
     122        wp_enqueue_style( $name );
     123
     124        wp_dequeue_style( 'csf-fa' );
     125        wp_dequeue_style( 'csf-fa5' );
     126        wp_dequeue_style( 'csf-fa5-v4-shims' );
     127
     128        $name = $assets->register_style(
     129            '/assets/css/vendor/admin/fontawesome.css',
     130            []
     131        );
     132        wp_enqueue_style( $name );
     133        $name = $assets->register_style(
     134            '/assets/css/vendor/admin/solid.css',
     135            []
     136        );
     137        wp_enqueue_style( $name );
     138    }
     139
     140    /**
     141     * Load globe scripts
     142     *
     143     */
     144    public function load_globe_scripts() {
     145        if ( is_admin() && ! $this->is_view_editor() ) {
     146            return;
     147        }
     148
     149        try {
     150            $assets = $this->services->get( 'assets' )->create();
     151        } catch ( \Exception $exception ) {
     152
     153            if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) {
     154                // phpcs:ignore WordPress.PHP.DevelopmentFunctions
     155                error_log( 'Failed to load styles' );
     156            }
     157        }
     158        $name = $assets->register_script(
     159            '/assets/js/vendor/public/globe.gl.js',
     160            [],
     161            true
     162        );
     163        wp_enqueue_script( $name );
     164    }
     165
     166    /**
     167     * Load admin styles
     168     *
     169     */
     170    public function load_admin_styles() {
     171
     172        if ( ! $this->is_globe_admin() ) {
     173            return;
     174        }
     175        // might need styles across all admin, because of menu styles
     176        wp_register_style(
     177            $this->project->name . '_admin',
     178            plugins_url( "{$this->dir}/assets/css/admin/admin-style{$this->suffix}.css", $this->project->file_path ),
     179            false,
     180            $this->project->version
     181        );
     182
     183        wp_enqueue_style( $this->project->name . '_admin' );
     184    }
     185
     186    /**
     187     * Load admin scripts
     188     *
     189     */
     190    public function load_admin_scripts() {
     191
     192        if ( ! $this->is_view_editor() ) {
     193            return;
     194        }
     195
     196        try {
     197            $assets = $this->services->get( 'assets' )->create();
     198        } catch ( \Exception $exception ) {
     199            if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) {
     200                // phpcs:ignore WordPress.PHP.DevelopmentFunctions
     201                error_log( 'Failed to load assets' );
     202            }
     203        }
    177204        $name = $assets->register_script(
    178205            '/assets/js/admin/admin.js',
     
    238265        wp_enqueue_script( $name );
    239266
    240 
    241         // special users specific
     267        // for pro only
    242268        if ( defined( 'SALTUS_PLAN' ) && SALTUS_PLAN === 'pro' ) {
    243269
     
    251277            );
    252278            wp_enqueue_script( $adminp );
    253 
    254         }
    255 
     279        }
    256280    }
    257281
     
    264288        return true;
    265289    }
     290
     291    private function is_globe_admin() {
     292
     293        global $typenow;
     294        if ( $typenow !== 'iglobe' ) {
     295            return false;
     296        }
     297        return true;
     298    }
    266299}
  • interactive-globes/trunk/src/Services/Assets/AssetsCore.php

    r3098987 r3158721  
    2424
    2525    /**
     26     * Plugin Root Directory
     27     */
     28    public $root_file_path;
     29
     30    /**
    2631     * Instantiate this Service object.
    2732     *
     
    4045        $this->dir     = WP_ENV === 'development' ? '' : 'dist';
    4146        $this->suffix  = WP_ENV === 'development' ? '' : '.min';
     47
     48        $this->root_file_path = $this->project->file_path;
    4249    }
    4350
     
    5562                global $pagenow;
    5663                // only load on necessary pages
    57                 if ( $typenow === 'iglobe' && ( $pagenow === 'post.php' || $pagenow === 'post-new.php' ) ) {
     64                if ( ( $typenow === 'iglobe' &&
     65                        ( $pagenow === 'post.php' || $pagenow === 'post-new.php' ) ) ||
     66                        ( $typenow === 'iglobe' && $pagenow === 'edit.php' ) // subpages
     67                        ) {
    5868                    $src  = $this->prepare_src( $src );
    5969                    $name = $this->register_fullpath_style( $src, $dependencies );
     
    7686        $src_ext  = pathinfo( $src, PATHINFO_EXTENSION );
    7787
    78         $plan = '';
    79         if ( defined( 'SALTUS_PLAN' ) &&
    80             SALTUS_PLAN === 'pro' &&
    81             ! str_contains( $src_path, 'vendor' ) ) {
    82             //$plan = '-pro';
    83         }
    84         $src_rel_path = "{$this->dir}{$src_path}/{$src_name}{$plan}{$this->suffix}.{$src_ext}";
     88        $src_rel_path = "{$this->dir}{$src_path}/{$src_name}{$this->suffix}.{$src_ext}";
    8589        return plugins_url( $src_rel_path, $this->project->file_path );
    8690    }
  • interactive-globes/trunk/src/Services/Model/Assembler.php

    r3115164 r3158721  
    1010
    1111        if ( ! empty( $settings['actions_default'] ) ) {
    12             $settings['actions_default'] = apply_filters( 'itt_globe_click_actions', $settings['actions_default'] );
     12            $settings['actions_default'] = apply_filters( 'itt_globes/click_actions', $settings['actions_default'] );
    1313        }
    1414        return $settings;
  • interactive-globes/trunk/src/Services/Model/Base/Meta.php

    r3115164 r3158721  
    3030                        'type'    => 'content',
    3131                        'content' => '<div class="itt_globe_preview_container">
    32                                         <div class="itt_globe_preview">'
    33                                         . do_shortcode( '[display-globe]' )
     32                                        <div class="itt_globe_preview">
     33                                        <div id="itt_globe_preview_admin"></div>'
     34                                        /*. do_shortcode( '[display-globe]' ) */
    3435                                            . '<div class="itt_globe_save_warning">'
    3536                                            . __( 'Changes detected. Save your globe to update the preview.', 'interactive-globes' ) . '
     
    5253                                                <div class="postbox-header">
    5354                                                    <div class="itt_globe_preview_title">Clicked Location</div>
     55                                                    <button style="display:none;" onclick="ittGlobesAdmin.edit(this)" data-id="" data-post-type="" type="button" class="itt_globe_preview_action itt_globe_preview_action_edit button">Edit</button>
    5456                                                </div>
    5557                                                <div class="inside">
     
    6365                                                            <option value="itt_globe_dotlabel">Dot Label</option>
    6466                                                        </select>
    65                                                         <button style="display:none;" onclick="ittGlobesAdmin.edit(this)" data-id="" data-post-type="" type="button" class="itt_globe_preview_action itt_globe_preview_action_edit button">Edit</button>
     67                                                       
    6668                                                    </div>
    6769                                                </div>
     
    9597                                'default' => 'earth-day.jpg',
    9698                            ),
     99                            'globeColor'    => array(
     100                                'dependency' => array( array( 'globeImage', '==', 'noImage' ) ),
     101                            ),
     102                            'customImage'    => array(
     103                                'dependency' => array( array( 'globeImage', '==', 'customImage' ) ),
     104                            ),
    97105                            'showGraticules'    => array(
    98106                                'title'   => __( 'Show Graticules', 'interactive-globes' ),
  • interactive-globes/trunk/src/Services/Model/Base/MetaDotLabel.php

    r3115164 r3158721  
    111111                        'altitude'       => array(
    112112                            'type'    => 'spinner',
    113                             'default' => 0,
     113                            'default' => 1,
    114114                            'step'    => 1,
    115115                            'title'   => __( 'Altitude', 'interactive-globes' ),
  • interactive-globes/trunk/src/Services/Model/Base/MetaPoint.php

    r3115164 r3158721  
    115115                        'altitude' => array(
    116116                            'type'    => 'spinner',
    117                             'default' => 0,
     117                            'default' => 1,
    118118                            'step'    => 1,
    119119                            'title'   => __( 'Altitude', 'interactive-globes' ),
  • interactive-globes/trunk/src/models/globe-dotlabel.php

    r3115164 r3158721  
    77$tooltip_editor        = isset( $options['tooltip_editor'] ) && ! empty( $options['tooltip_editor'] ) ? $options['tooltip_editor'] : 'textarea';
    88$action_content_editor = isset( $options['actionContent_editor'] ) && ! empty( $options['actionContent_editor'] ) ? $options['actionContent_editor'] : 'text';
    9 $actions_default       = apply_filters( 'iglobe_click_actions', [] );
    109$public_cpts           = isset( $options['public_cpts'] ) && $options['public_cpts'] ? true : false;
    1110
     
    182181            'id'                => 'dotlabel_globe',
    183182            'title'             => __( 'Globe - Dot Label relationship', 'interactive-globes' ),
    184             'class'             => 'hidden',
     183            'class'             => isset ( $_GET['iframe'] ) ? 'hidden' : '',
    185184            'register_rest_api' => true,
    186185            'sections'          => [
    187186                'details' => [
    188                     'fields' => [
    189                         'globe_id' => [
    190                             'type'              => 'number',
    191                             'class'             => 'hidden',
    192                             'title'             => __( 'Associated Globe', 'interactive-globes' ),
     187                    'fields'       => array(
     188                        'globe_id'        => array(
     189                            'type'     => 'number',
     190                            'class'    => isset ( $_GET['iframe'] ) ? 'hidden' : '',
     191                            'title'    => __( 'Associated Globe', 'interactive-globes' ),
    193192                            'register_rest_api' => true,
    194                         ],
    195                     ],
     193                        ),
     194                    ),
    196195                ],
    197196            ],
     
    200199];
    201200
    202 $dot_labels = apply_filters( 'itt_globe_dotlabel_model', $dot_labels );
    203 
     201add_filter( 'itt_globes/meta/remove_meta_box_post_types', 'add_itt_globe_dotlabel_post_type', 10, 2 );
     202function add_itt_globe_dotlabel_post_type( $post_types ) {
     203    $post_types[] = 'itt_globe_dotlabel';
     204    return $post_types;
     205}
     206
     207add_filter( 'itt_globes/shortcode/post_setup_meta', 'add_dotlabel_to_shortcode', 10, 2 );
     208function add_dotlabel_to_shortcode( $globe_meta, $globe_id ) {
     209    // dotlabel
     210    $args = [
     211        'post_type'      => 'itt_globe_dotlabel',
     212        'posts_per_page' => -1,
     213        'meta_query'     => [
     214            [
     215                'key'     => 'globe_id',
     216                'value'   => $globe_id,
     217                'compare' => '=',
     218                'type'    => 'NUMERIC',
     219            ],
     220        ],
     221    ];
     222    $cpt_list      = [];
     223    $cpt_query    = new \WP_Query( $args );
     224    $click_actions = [];
     225
     226    if ( isset( $globe_meta['labelDefaults']['action'] ) &&
     227        $globe_meta['labelDefaults']['action'] !== 'none' ) {
     228        $click_actions[] = $globe_meta['labelDefaults']['action'];
     229    }
     230
     231    if ( $cpt_query->have_posts() ) {
     232        while ( $cpt_query->have_posts() ) {
     233            $cpt_query->the_post();
     234            $cpt_id    = get_the_ID();
     235            $metadata  = get_post_meta( $cpt_id );
     236
     237            if ( empty( $metadata['dotLabels_info'][0] ) ) {
     238                continue;
     239            }
     240
     241            $cpt_info          = maybe_unserialize( $metadata['dotLabels_info'][0] );
     242            $cpt_info['id']    = $cpt_id;
     243            $cpt_info['title'] = get_the_title();
     244
     245            // convert natural line breaks to <br>
     246            $cpt_info['content'] = nl2br( $cpt_info['content'] );
     247
     248            $cpt_list[]        = $cpt_info;
     249
     250            if ( ! empty( $cpt_info['action'] ) &&
     251                $cpt_info['action'] !== 'none' ) {
     252                $click_actions[] = $cpt_info['action'];
     253            }
     254        }
     255    }
     256
     257    wp_reset_query();
     258
     259    $globe_meta['dotLabels'] = $cpt_list;
     260
     261    $globe_meta['enabled_click_actions'] = $globe_meta['enabled_click_actions'] ?? [];
     262    $globe_meta['enabled_click_actions'] = array_merge( $globe_meta['enabled_click_actions'], $click_actions );
     263    $globe_meta['enabled_click_actions'] = array_unique( $globe_meta['enabled_click_actions'] );
     264
     265    return $globe_meta;
     266}
     267
     268$dot_labels = apply_filters( 'itt_globes/dotlabel/model', $dot_labels );
    204269return $dot_labels;
  • interactive-globes/trunk/src/models/globe-free.php

    r3115164 r3158721  
    3838    );
    3939
    40     $globe_model = apply_filters( 'itt_globe_model', $globe_model );
     40    $globe_model = apply_filters( 'itt_globes/globe/model', $globe_model );
    4141
    4242    return $globe_model;
  • interactive-globes/trunk/src/models/globe-point.php

    r3115164 r3158721  
    66$tooltip_editor        = isset( $options['tooltip_editor'] ) && ! empty( $options['tooltip_editor'] ) ? $options['tooltip_editor'] : 'textarea';
    77$action_content_editor = isset( $options['actionContent_editor'] ) && ! empty( $options['actionContent_editor'] ) ? $options['actionContent_editor'] : 'text';
    8 $actions_default       = apply_filters( 'iglobe_click_actions', [] );
    98$public_cpts           = isset( $options['public_cpts'] ) && $options['public_cpts'] ? true : false;
    109
     
    169168            'id'                => 'points_globe',
    170169            'title'             => __( 'Globe rel', 'interactive-globes' ),
    171             'class'             => 'hidden',
     170            'class'             => isset ( $_GET['iframe'] ) ? 'hidden' : '',
    172171            'register_rest_api' => true,
    173172            'sections'          => [
    174173                'details' => [
    175                     'fields' => [
    176                         'globe_id' => [
    177                             'type'              => 'number',
    178                             'class'             => 'hidden',
    179                             'title'             => __( 'Associated Globe', 'interactive-globes' ),
     174                    'fields'       => array(
     175                        'globe_id'        => array(
     176                            'type'     => 'number',
     177                            'class'    => isset ( $_GET['iframe'] ) ? 'hidden' : '',
     178                            'title'    => __( 'Associated Globe', 'interactive-globes' ),
    180179                            'register_rest_api' => true,
    181                         ],
    182                     ],
     180                        ),
     181                    ),
    183182                ],
    184183            ],
     
    187186];
    188187
    189 $points = apply_filters( 'itt_globe_point_model', $points );
    190 
     188add_filter( 'itt_globes/meta/remove_meta_box_post_types', 'add_itt_globe_point_post_type', 10, 2 );
     189function add_itt_globe_point_post_type( $post_types ) {
     190    $post_types[] = 'itt_globe_point';
     191    return $post_types;
     192}
     193
     194add_filter( 'itt_globes/shortcode/post_setup_meta', 'add_point_to_shortcode', 10, 2 );
     195function add_point_to_shortcode( $globe_meta, $globe_id ) {
     196    $args = [
     197        'post_type'      => 'itt_globe_point',
     198        'posts_per_page' => -1,
     199        'meta_query'     => [
     200            [
     201                'key'     => 'globe_id',
     202                'value'   => $globe_id,
     203                'compare' => '=',
     204                'type'    => 'NUMERIC',
     205            ],
     206        ],
     207    ];
     208    $cpt_list      = [];
     209    $cpt_query     = new \WP_Query( $args );
     210    $click_actions = [];
     211    if ( isset( $globe_meta['pointDefaults']['action'] ) &&
     212        $globe_meta['pointDefaults']['action'] !== 'none' ) {
     213        $click_actions[] = $globe_meta['pointDefaults']['action'];
     214    }
     215
     216    if ( $cpt_query->have_posts() ) {
     217        while ( $cpt_query->have_posts() ) {
     218            $cpt_query->the_post();
     219            $cpt_id   = get_the_ID();
     220            $metadata = get_post_meta( $cpt_id );
     221
     222            if ( empty( $metadata['points_info'][0] ) ) {
     223                continue;
     224            }
     225            $cpt_info          = maybe_unserialize( $metadata['points_info'][0] );
     226            $cpt_info['id']    = $cpt_id;
     227            $cpt_info['title'] = get_the_title();
     228
     229            // convert natural line breaks to <br>
     230            $cpt_info['content'] = nl2br( $cpt_info['content'] );
     231
     232            $cpt_list[]        = $cpt_info;
     233
     234            if ( ! empty( $cpt_info['action'] ) &&
     235                $cpt_info['action'] !== 'none' ) {
     236                $click_actions[] = $cpt_info['action'];
     237            }
     238        }
     239    }
     240
     241    wp_reset_query();
     242
     243    $globe_meta['points'] = $cpt_list;
     244
     245    $globe_meta['enabled_click_actions'] = $globe_meta['enabled_click_actions'] ?? [];
     246    $globe_meta['enabled_click_actions'] = array_merge( $globe_meta['enabled_click_actions'], $click_actions );
     247    $globe_meta['enabled_click_actions'] = array_unique( $globe_meta['enabled_click_actions'] );
     248
     249    return $globe_meta;
     250}
     251
     252
     253$points = apply_filters( 'itt_globes/point/model', $points );
    191254return $points;
  • interactive-globes/trunk/vendor/composer/autoload_classmap.php

    r3115164 r3158721  
    8686    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\CorePro' => $baseDir . '/../src/CorePro.php',
    8787    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Exception\\SaltusFrameworkThrowable' => $baseDir . '/../src/Exception/SaltusFrameworkThrowable.php',
     88    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\ClickActionOption' => $baseDir . '/../src/Features/ClickActions/ClickActionOption.php',
     89    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentAbove' => $baseDir . '/../src/Features/ClickActions/DisplayContentAbove.php',
     90    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelow' => $baseDir . '/../src/Features/ClickActions/DisplayContentBelow.php',
     91    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelowScroll' => $baseDir . '/../src/Features/ClickActions/DisplayContentBelowScroll.php',
     92    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLeft' => $baseDir . '/../src/Features/ClickActions/DisplayContentLeft.php',
     93    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLightbox' => $baseDir . '/../src/Features/ClickActions/DisplayContentLightbox.php',
     94    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentRight' => $baseDir . '/../src/Features/ClickActions/DisplayContentRight.php',
     95    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayIframeLightbox' => $baseDir . '/../src/Features/ClickActions/DisplayIframeLightbox.php',
    8896    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\CptManager\\CptManagerCore' => $baseDir . '/../src/Features/CptManager/CptManagerCore.php',
    8997    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\CptManager\\CptManagerFeature' => $baseDir . '/../src/Features/CptManager/CptManagerFeature.php',
     
    92100    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Meta\\MetaFeature' => $baseDir . '/../src/Features/Meta/MetaFeature.php',
    93101    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Point\\PointProMeta' => $baseDir . '/../src/Features/Point/PointProMeta.php',
     102    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPage' => $baseDir . '/../src/Features/Sales/UpsellPage.php',
     103    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPageFeature' => $baseDir . '/../src/Features/Sales/UpsellPageFeature.php',
    94104    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeCore' => $baseDir . '/../src/Features/Shortcode/ShortcodeCore.php',
    95105    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeFeature' => $baseDir . '/../src/Features/Shortcode/ShortcodeFeature.php',
     
    102112    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Loader' => $baseDir . '/../src/Loader.php',
    103113    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Assets' => $baseDir . '/../src/Plugin/Assets.php',
     114    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Freemius' => $baseDir . '/../src/Plugin/Freemius.php',
    104115    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\I18n' => $baseDir . '/../src/Plugin/I18n.php',
    105116    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Lifecycle' => $baseDir . '/../src/Plugin/Lifecycle.php',
     
    108119    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\AssetsCore' => $baseDir . '/../src/Services/Assets/AssetsCore.php',
    109120    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\AssetsService' => $baseDir . '/../src/Services/Assets/AssetsService.php',
     121    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\HasAssets' => $baseDir . '/../src/Services/Assets/HasAssets.php',
    110122    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Assembler' => $baseDir . '/../src/Services/Model/Assembler.php',
    111123    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Features' => $baseDir . '/../src/Services/Model/Base/Features.php',
     
    117129    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Options' => $baseDir . '/../src/Services/Model/Base/Options.php',
    118130    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Settings' => $baseDir . '/../src/Services/Model/Base/Settings.php',
     131    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\ClickActions' => $baseDir . '/../src/Services/Model/Pro/ClickActions.php',
     132    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaColor' => $baseDir . '/../src/Services/Model/Pro/MetaColor.php',
    119133    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaDotLabel' => $baseDir . '/../src/Services/Model/Pro/MetaDotLabel.php',
    120134    'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLines' => $baseDir . '/../src/Services/Model/Pro/MetaLines.php',
  • interactive-globes/trunk/vendor/composer/autoload_static.php

    r3115164 r3158721  
    118118        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\CorePro' => __DIR__ . '/../..'.'/build' . '/../src/CorePro.php',
    119119        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Exception\\SaltusFrameworkThrowable' => __DIR__ . '/../..'.'/build' . '/../src/Exception/SaltusFrameworkThrowable.php',
     120        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\ClickActionOption' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/ClickActionOption.php',
     121        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentAbove' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentAbove.php',
     122        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelow' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentBelow.php',
     123        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentBelowScroll' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentBelowScroll.php',
     124        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLeft' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentLeft.php',
     125        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentLightbox' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentLightbox.php',
     126        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayContentRight' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayContentRight.php',
     127        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\ClickActions\\DisplayIframeLightbox' => __DIR__ . '/../..'.'/build' . '/../src/Features/ClickActions/DisplayIframeLightbox.php',
    120128        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\CptManager\\CptManagerCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/CptManager/CptManagerCore.php',
    121129        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\CptManager\\CptManagerFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/CptManager/CptManagerFeature.php',
     
    124132        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Meta\\MetaFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Meta/MetaFeature.php',
    125133        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Point\\PointProMeta' => __DIR__ . '/../..'.'/build' . '/../src/Features/Point/PointProMeta.php',
     134        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPage' => __DIR__ . '/../..'.'/build' . '/../src/Features/Sales/UpsellPage.php',
     135        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Sales\\UpsellPageFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Sales/UpsellPageFeature.php',
    126136        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeCore' => __DIR__ . '/../..'.'/build' . '/../src/Features/Shortcode/ShortcodeCore.php',
    127137        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Features\\Shortcode\\ShortcodeFeature' => __DIR__ . '/../..'.'/build' . '/../src/Features/Shortcode/ShortcodeFeature.php',
     
    134144        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Loader' => __DIR__ . '/../..'.'/build' . '/../src/Loader.php',
    135145        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Assets' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/Assets.php',
     146        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Freemius' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/Freemius.php',
    136147        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\I18n' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/I18n.php',
    137148        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Plugin\\Lifecycle' => __DIR__ . '/../..'.'/build' . '/../src/Plugin/Lifecycle.php',
     
    140151        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\AssetsCore' => __DIR__ . '/../..'.'/build' . '/../src/Services/Assets/AssetsCore.php',
    141152        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\AssetsService' => __DIR__ . '/../..'.'/build' . '/../src/Services/Assets/AssetsService.php',
     153        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Assets\\HasAssets' => __DIR__ . '/../..'.'/build' . '/../src/Services/Assets/HasAssets.php',
    142154        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Assembler' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Assembler.php',
    143155        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Features' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Features.php',
     
    149161        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Options' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Options.php',
    150162        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Base\\Settings' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Base/Settings.php',
     163        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\ClickActions' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/ClickActions.php',
     164        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaColor' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaColor.php',
    151165        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaDotLabel' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaDotLabel.php',
    152166        'Saltus\\WP\\Plugin\\Saltus\\InteractiveGlobes\\Services\\Model\\Pro\\MetaLines' => __DIR__ . '/../..'.'/build' . '/../src/Services/Model/Pro/MetaLines.php',
  • interactive-globes/trunk/vendor/composer/installed.json

    r3115164 r3158721  
    11{
    22    "packages": [
     3        {
     4            "name": "freemius/wordpress-sdk",
     5            "version": "2.7.3",
     6            "version_normalized": "2.7.3.0",
     7            "source": {
     8                "type": "git",
     9                "url": "https://github.com/Freemius/wordpress-sdk.git",
     10                "reference": "dad8c4f268f826d1f5a98737d26216d6dede5b03"
     11            },
     12            "dist": {
     13                "type": "zip",
     14                "url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/dad8c4f268f826d1f5a98737d26216d6dede5b03",
     15                "reference": "dad8c4f268f826d1f5a98737d26216d6dede5b03",
     16                "shasum": ""
     17            },
     18            "require": {
     19                "php": ">=5.6"
     20            },
     21            "require-dev": {
     22                "dealerdirect/phpcodesniffer-composer-installer": "^1.0",
     23                "phpcompatibility/php-compatibility": "^9.3",
     24                "phpcompatibility/phpcompatibility-wp": "^2.1",
     25                "phpstan/extension-installer": "^1.3",
     26                "squizlabs/php_codesniffer": "^3.7",
     27                "szepeviktor/phpstan-wordpress": "^1.3",
     28                "wp-coding-standards/wpcs": "^2.3"
     29            },
     30            "time": "2024-07-01T05:51:06+00:00",
     31            "type": "library",
     32            "installation-source": "dist",
     33            "notification-url": "https://packagist.org/downloads/",
     34            "license": [
     35                "GPL-3.0-only"
     36            ],
     37            "description": "Freemius WordPress SDK",
     38            "homepage": "https://freemius.com",
     39            "keywords": [
     40                "freemius",
     41                "plugin",
     42                "sdk",
     43                "theme",
     44                "wordpress",
     45                "wordpress-plugin",
     46                "wordpress-theme"
     47            ],
     48            "support": {
     49                "issues": "https://github.com/Freemius/wordpress-sdk/issues",
     50                "source": "https://github.com/Freemius/wordpress-sdk/tree/2.7.3"
     51            },
     52            "install-path": "../freemius/wordpress-sdk"
     53        },
    354        {
    455            "name": "hassankhan/config",
  • interactive-globes/trunk/vendor/composer/installed.php

    r3115164 r3158721  
    44        'pretty_version' => 'dev-main',
    55        'version' => 'dev-main',
    6         'reference' => '593164309ab4d5a40ad4fdb5c58f1c80a3936cb7',
     6        'reference' => 'ef1ec57ac76205246119445ce9f392fb446f8c41',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../build',
     
    1111    ),
    1212    'versions' => array(
     13        'freemius/wordpress-sdk' => array(
     14            'pretty_version' => '2.7.3',
     15            'version' => '2.7.3.0',
     16            'reference' => 'dad8c4f268f826d1f5a98737d26216d6dede5b03',
     17            'type' => 'library',
     18            'install_path' => __DIR__ . '/../freemius/wordpress-sdk',
     19            'aliases' => array(),
     20            'dev_requirement' => false,
     21        ),
    1322        'hassankhan/config' => array(
    1423            'pretty_version' => '3.1.0',
     
    3241            'pretty_version' => 'dev-main',
    3342            'version' => 'dev-main',
    34             'reference' => '593164309ab4d5a40ad4fdb5c58f1c80a3936cb7',
     43            'reference' => 'ef1ec57ac76205246119445ce9f392fb446f8c41',
    3544            'type' => 'wordpress-plugin',
    3645            'install_path' => __DIR__ . '/../../build',
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/assets/css/style.css

    r2986425 r3158721  
    200200  content: "\f054";
    201201  display: inline-block;
    202   font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
     202  font-family: "Font Awesome 6 Free", "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
    203203  font-weight: 900;
    204204  font-size: 9px;
     
    11131113  left: auto;
    11141114  right: auto;
    1115   font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
     1115  font-family: "Font Awesome 6 Free", "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
    11161116  font-weight: 900;
    11171117  font-size: 12px;
     
    14101410  text-align: center;
    14111411  font-size: 10px;
    1412   font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
     1412  font-family: "Font Awesome 6 Free", "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
    14131413  font-weight: 900;
    14141414  content: "\f00c";
     
    15481548  text-align: center;
    15491549  font-size: 10px;
    1550   font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
     1550  font-family: "Font Awesome 6 Free", "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
    15511551  font-weight: 900;
    15521552  content: "\f00c";
     
    18951895}
    18961896.csf-field-spinner .ui-spinner .ui-spinner-button:before {
    1897   font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
     1897  font-family: "Font Awesome 6 Free", "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
    18981898  font-weight: 900;
    18991899  font-size: 14px;
     
    24832483  top: 0;
    24842484  right: 20px;
    2485   font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
     2485  font-family: "Font Awesome 6 Free", "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
    24862486  font-weight: 900;
    24872487  font-size: 12px;
     
    24992499}
    25002500.csf-field .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
    2501   font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
     2501  font-family: "Font Awesome 6 Free", "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
    25022502  font-weight: 900;
    25032503  font-size: 12px;
     
    25172517}
    25182518.csf-field .chosen-container-single .chosen-single div b {
    2519   font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
     2519  font-family: "Font Awesome 6 Free", "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
    25202520  font-weight: 900;
    25212521  font-size: 14px;
     
    25462546}
    25472547.csf-field .chosen-container-single .chosen-search:before {
    2548   font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
     2548  font-family: "Font Awesome 6 Free", "Font Awesome 5 Pro", "Font Awesome 5 Free", "FontAwesome";
    25492549  font-weight: 900;
    25502550  font-size: 11px;
  • interactive-globes/trunk/vendor/saltus/framework/lib/codestar-framework/fields/image_select/image_select.php

    r2986425 r3158721  
    4444          echo '<div class="csf--sibling csf--image'. esc_attr( $active ) .'">';
    4545            echo '<figure>';
    46               echo '<img src="'. esc_url( $option ) .'" alt="img-'. esc_attr( $num++ ) .'" />';
     46              echo '<img title="' . esc_attr( $key ) . '" src="'. esc_url( $option ) .'" alt="img-'. esc_attr( $num++ ) .'" />';
    4747              echo '<input type="'. esc_attr( $type ) .'" name="'. esc_attr( $this->field_name( $extra ) ) .'" value="'. esc_attr( $key ) .'"'. $this->field_attributes() . esc_attr( $checked ) .'/>';
    4848            echo '</figure>';
Note: See TracChangeset for help on using the changeset viewer.