define(["gpui-style-inject","react","mobx"],(function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=r(e),a=r(t),l=o(t);
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */
function c(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}i.default("html, body, #root {\n  width: 100%;\n  height: 100%;\n  margin: 0;\n  padding: 0;\n  overflow: hidden; }\n\n.g__index {\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  height: 100%; }\n");var d="index-module_content__c8cou",u="index-module_arrow__5HU7g",s="index-module_line__m2Hti",f="index-module_mark__9JR98",m="index-module_board__LX7hf",p="index-module_ring__WF3RG",h="index-module_ring__border__Pmt0c",_="index-module_ring__content__duvx1",v="index-module_data__REAhY",b="index-module_unit__ua3Am",y="index-module_name__erX8J";if(i.default(".index-module_content__c8cou {\n  display: flex;\n  justify-content: space-around;\n  align-items: center;\n  box-sizing: border-box;\n  padding: 0 2%;\n  width: 100%;\n  height: 100%; }\n  .index-module_content__c8cou .index-module_arrow__5HU7g {\n    margin-bottom: 14vh;\n    display: flex;\n    align-items: center;\n    width: 20vh; }\n    .index-module_content__c8cou .index-module_arrow__5HU7g .index-module_line__m2Hti {\n      flex: 1;\n      height: 1vh; }\n    .index-module_content__c8cou .index-module_arrow__5HU7g .index-module_mark__9JR98 {\n      border: 2vh solid transparent;\n      width: 0;\n      height: 0; }\n  .index-module_content__c8cou .index-module_board__LX7hf {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    width: 40vh; }\n    .index-module_content__c8cou .index-module_board__LX7hf .index-module_ring__WF3RG {\n      position: relative;\n      width: 40vh;\n      height: 40vh;\n      border-radius: 50%;\n      overflow: hidden; }\n      .index-module_content__c8cou .index-module_board__LX7hf .index-module_ring__border__Pmt0c {\n        position: absolute;\n        top: 0;\n        left: 0;\n        width: 100%;\n        height: 100%; }\n      .index-module_content__c8cou .index-module_board__LX7hf .index-module_ring__content__duvx1 {\n        display: flex;\n        flex-direction: column;\n        justify-content: center;\n        align-items: center;\n        width: 100%;\n        height: 100%;\n        border-radius: 50%; }\n        .index-module_content__c8cou .index-module_board__LX7hf .index-module_ring__content__duvx1 .index-module_data__REAhY {\n          line-height: 8vh;\n          font-size: 8vh;\n          color: #cde0ff; }\n          .index-module_content__c8cou .index-module_board__LX7hf .index-module_ring__content__duvx1 .index-module_data__REAhY .index-module_unit__ua3Am {\n            padding-left: 1vh;\n            font-size: 4vh; }\n    .index-module_content__c8cou .index-module_board__LX7hf .index-module_name__erX8J {\n      margin-top: 7vh;\n      line-height: 7vh;\n      font-size: 4vh;\n      color: #cde0ff; }\n"),!t.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!n.spy)throw new Error("mobx-react-lite requires mobx at least version 4 to be available");function g(){return g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g.apply(this,arguments)}function w(){var e=t.useState(0)[1];return t.useCallback((function(){e((function(e){return e+1}))}),[])}function x(e){return n.getDependencyTree(e)}var E,R=1e4,O=new Set;function C(){void 0===E&&(E=setTimeout(j,1e4))}function j(){E=void 0;var e=Date.now();O.forEach((function(t){var n=t.current;n&&e>=n.cleanAt&&(n.reaction.dispose(),t.current=null,O.delete(t))})),O.size>0&&C()}var $={};function k(e){return"observer"+e}function P(e,t,r){void 0===t&&(t="observed"),void 0===r&&(r=$);var o,i=(r.useForceUpdate||w)(),l=a.default.useRef(null);if(!l.current){var c=new n.Reaction(k(t),(function(){d.mounted?i():(c.dispose(),l.current=null)})),d=function(e){return{cleanAt:Date.now()+R,reaction:e}}(c);l.current=d,o=l,O.add(o),C()}var u,s,f=l.current.reaction;if(a.default.useDebugValue(f,x),a.default.useEffect((function(){var e;return e=l,O.delete(e),l.current?l.current.mounted=!0:(l.current={reaction:new n.Reaction(k(t),(function(){i()})),cleanAt:1/0},i()),function(){l.current.reaction.dispose(),l.current=null}}),[]),f.track((function(){try{u=e()}catch(e){s=e}})),s)throw s;return u}function S(e,n){var r,o,i,a=g({forwardRef:!1},n),l=e.displayName||e.name,c=function(t,n){return P((function(){return e(t,n)}),l)};return c.displayName=l,r=a.forwardRef?t.memo(t.forwardRef(c)):t.memo(c),o=e,i=r,Object.keys(o).forEach((function(e){A[e]||Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(o,e))})),r.displayName=l,r}var A={$$typeof:!0,render:!0,compare:!0,type:!0};function N(e){var t=e.children,n=e.render,r=t||n;return"function"!=typeof r?null:P(r)}function D(e,t,n,r,o){var i="children"===t?"render":"children",a="function"==typeof e[t],l="function"==typeof e[i];return a&&l?new Error("MobX Observer: Do not use children and render in the same time in`"+n):a||l?null:new Error("Invalid prop `"+o+"` of type `"+typeof e[t]+"` supplied to `"+n+"`, expected `function`.")}N.propTypes={children:D,render:D},N.displayName="Observer";var F=0;var X={};function L(e){return X[e]||(X[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react "+e+" ("+F+")";return F++,t}(e)),X[e]}function U(e,t){if(M(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.hasOwnProperty.call(t,n[o])||!M(e[n[o]],t[n[o]]))return!1;return!0}function M(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function H(e,t,n){Object.hasOwnProperty.call(e,t)?e[t]=n:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})}var Y=L("patchMixins"),z=L("patchedDefinition");function W(e,t){for(var n=this,r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];t.locks++;try{var a;return null!=e&&(a=e.apply(this,o)),a}finally{t.locks--,0===t.locks&&t.methods.forEach((function(e){e.apply(n,o)}))}}function B(e,t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];W.call.apply(W,[this,e,t].concat(r))}}function G(e,t,n){var r=function(e,t){var n=e[Y]=e[Y]||{},r=n[t]=n[t]||{};return r.locks=r.locks||0,r.methods=r.methods||[],r}(e,t);r.methods.indexOf(n)<0&&r.methods.push(n);var o=Object.getOwnPropertyDescriptor(e,t);if(!o||!o[z]){var i=e[t],a=I(e,t,o?o.enumerable:void 0,r,i);Object.defineProperty(e,t,a)}}function I(e,t,n,r,o){var i,a=B(o,r);return(i={})[z]=!0,i.get=function(){return a},i.set=function(o){if(this===e)a=B(o,r);else{var i=I(this,t,n,r,o);Object.defineProperty(this,t,i)}},i.configurable=!0,i.enumerable=n,i}var T=n.$mobx||"$mobx",q=L("isUnmounted"),J=L("skipRender"),V=L("isForcingUpdate");function Z(e){var n=e.prototype;if(n.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==t.PureComponent)if(n.shouldComponentUpdate){if(n.shouldComponentUpdate!==Q)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else n.shouldComponentUpdate=Q;ee(n,"props"),ee(n,"state");var r=n.render;return n.render=function(){return K.call(this,r)},G(n,"componentWillUnmount",(function(){this.render[T]&&this.render[T].dispose(),this[q]=!0})),e}function K(e){var r=this;H(this,J,!1),H(this,V,!1);var o,i=(o=this).displayName||o.name||o.constructor&&(o.constructor.displayName||o.constructor.name)||"<component>",a=e.bind(this),l=!1,c=new n.Reaction(i+".render()",(function(){if(!l&&(l=!0,!0!==r[q])){var e=!0;try{H(r,V,!0),r[J]||t.Component.prototype.forceUpdate.call(r),e=!1}finally{H(r,V,!1),e&&c.dispose()}}}));function d(){l=!1;var e=void 0,t=void 0;if(c.track((function(){try{t=n._allowStateChanges(!1,a)}catch(t){e=t}})),e)throw e;return t}return c.reactComponent=this,d[T]=c,this.render=d,d.call(this)}function Q(e,t){return this.state!==t||!U(this.props,e)}function ee(e,t){var r=L("reactProp_"+t+"_valueHolder"),o=L("reactProp_"+t+"_atomHolder");function i(){return this[o]||H(this,o,n.createAtom("reactive "+t)),this[o]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=!1;return n._allowStateReadsStart&&n._allowStateReadsEnd&&(e=n._allowStateReadsStart(!0)),i.call(this).reportObserved(),n._allowStateReadsStart&&n._allowStateReadsEnd&&n._allowStateReadsEnd(e),this[r]},set:function(e){this[V]||U(this[r],e)?H(this,r,e):(H(this,r,e),H(this,J,!0),i.call(this).reportChanged(),H(this,J,!1))}})}var te="function"==typeof Symbol&&Symbol.for,ne=te?Symbol.for("react.forward_ref"):"function"==typeof t.forwardRef&&t.forwardRef((function(e){return null})).$$typeof,re=te?Symbol.for("react.memo"):"function"==typeof t.memo&&t.memo((function(e){return null})).$$typeof;if(!t.Component)throw new Error("mobx-react requires React to be available");if(!n.observable)throw new Error("mobx-react requires mobx to be available");var oe=[{name:"申请培训人数",value:961,ratio:1,startColor:"#0096FF",endColor:"#00D8FF"},{name:"培训通过人数",value:412,ratio:.429,startColor:"#0CD2C4",endColor:"#0CDE9A"},{name:"自主操作人数",value:464,ratio:.483,startColor:"#FF5858",endColor:"#D54141"},{name:"助管人数",value:45,ratio:.047,startColor:"#FFA638",endColor:"#FAD75D"}];let ie=class extends l.Component{constructor(e){super(e),this.padding="10vh 4vh 4vh",this.evaluateXY=(e,t,n)=>{const r=2*Math.PI*t,o=n[0]+Math.sin(r)*e,i=n[0]-Math.cos(r)*e;return[o.toFixed(2),i.toFixed(2)]},this.renderRatioSVG=(e,t)=>{let n=e.ratio||1;const r=44,o=50,[i,a]=this.evaluateXY(r,n,[50,50]),[c,d]=this.evaluateXY(o,n,[50,50]);return n>.5&&n<1?l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 100"},l.createElement("path",{d:`M50,6 L50,0 A50,50 1 1 1 ${c} ${d} L${i},${a} A44,44 1 1 0 50 6 Z`,fill:`url(#grad${t})`})):1===n?l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 100"},l.createElement("circle",{cx:"50",cy:"50",r:"50",stroke:`url(#grad${t})`,strokeWidth:10,fill:"transparent"})):l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 100"},l.createElement("path",{d:`M50,6 L50,0 A50,50 0 0 1 ${c} ${d} L${i},${a} A44,44 0 0 0 50 6 Z`,fill:`url(#grad${t})`}))},this.renderBoard=(e,t)=>l.createElement("div",{key:t,className:m},l.createElement("div",{className:p},l.createElement("div",{className:h},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 100 100"},l.createElement("linearGradient",{id:`grad${t}`,x1:"0%",y1:"0%",x2:"100%",y2:"100%"},l.createElement("stop",{offset:"0%",style:{stopColor:e.startColor,stopOpacity:1}}),l.createElement("stop",{offset:"100%",style:{stopColor:e.endColor,stopOpacity:1}})),l.createElement("circle",{cx:"50",cy:"50",r:"50",stroke:`url(#grad${t})`,strokeWidth:"4",fill:"transparent"}))),l.createElement("div",{className:h},this.renderRatioSVG(e,t)),l.createElement("div",{className:_,style:{background:this.props.gpui.params.backgroundColor}},l.createElement("div",{className:v},l.createElement("span",null,e.value),l.createElement("span",{className:b},"人")))),l.createElement("div",{className:y},e.name)),this.renderArrow=(e,t)=>l.createElement("div",{key:t,className:u},l.createElement("div",{className:s,style:{backgroundColor:e.startColor}}),l.createElement("div",{className:f,style:{borderLeftColor:e.startColor}})),n.reaction((()=>e.gpui.params.padding),(e=>{this.padding=e||"10vh 4vh 4vh"}),{fireImmediately:!0})}render(){const e=[];return oe.forEach(((t,n)=>{n>0&&e.push({type:"arrow",item:t}),e.push({type:"board",item:t})})),l.createElement("div",{className:"g__index",style:{padding:this.padding}},l.createElement("div",{className:d},e.map((({type:e,item:t},n)=>"board"===e?this.renderBoard(t,n):this.renderArrow(t,n)))))}};return c([n.observable],ie.prototype,"padding",void 0),ie=c([function(e){if(!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),re&&e.$$typeof===re)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(ne&&e.$$typeof===ne){var n=e.render;if("function"!=typeof n)throw new Error("render property of ForwardRef was not a function");return t.forwardRef((function(){var e=arguments;return t.createElement(N,null,(function(){return n.apply(void 0,e)}))}))}return"function"!=typeof e||e.prototype&&e.prototype.render||e.isReactClass||Object.prototype.isPrototypeOf.call(t.Component,e)?Z(e):S(e)}],ie),ie}));
