hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
15f2c996ba366d58ee2a6d656f1d00a8981bde97 | 66,312 | js | JavaScript | factory-ai-vision/EdgeSolution/modules/WebModule/backend/ui_production/static/js/main.4646d30d.chunk.js | hjerezmsft/azure-intelligent-edge-patterns | 9e3e3963c563cd52a076789a97a561293ccc295a | [
"MIT"
] | null | null | null | factory-ai-vision/EdgeSolution/modules/WebModule/backend/ui_production/static/js/main.4646d30d.chunk.js | hjerezmsft/azure-intelligent-edge-patterns | 9e3e3963c563cd52a076789a97a561293ccc295a | [
"MIT"
] | null | null | null | factory-ai-vision/EdgeSolution/modules/WebModule/backend/ui_production/static/js/main.4646d30d.chunk.js | hjerezmsft/azure-intelligent-edge-patterns | 9e3e3963c563cd52a076789a97a561293ccc295a | [
"MIT"
] | null | null | null | (this.webpackJsonpui=this.webpackJsonpui||[]).push([[0],{688:function(e,t,n){e.exports=n(939)},697:function(e,t,n){},937:function(e,t,n){},939:function(e,t,n){"use strict";n.r(t);var a,r=n(0),c=n.n(r),i=n(43),o=n.n(i),l=n(20),u=n(467),s=(n(697),n(85)),d=n(468),m=n(469),g=n(259),f=n(470),p=n.n(f);!function(e){e.None="none",e.WaitTraining="waitTraining",e.FinishTraining="finishTraining",e.TrainingFailed="trainingFailed",e.StartInference="startInference"}(a||(a={}));var E,h,b,v,y,O={dialogIsOpen:!1,cameras:[],locations:[],images:[],labelingPageState:{annotations:[]},part:{capturedImages:[],isValid:!0},project:{isLoading:!1,data:{id:null,camera:null,location:null,parts:[],needRetraining:!0,accuracyRangeMin:60,accuracyRangeMax:80,maxImages:50,modelUrl:""},trainingMetrics:{prevConsequence:null,curConsequence:null},inferenceMetrics:{successRate:null,successfulInferences:null,unIdetifiedItems:null},status:a.None,error:null,trainingLog:""}},C=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O.cameras,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"GET_CAMERA_SUCCESS":return t.payload;case"REQUEST_CAMERA_FAILURE":return e;case"POST_CAMERA_SUCCESS":return e.concat(t.payload);case"DELETE_CAMERA_SUCCESS":var n=e.findIndex((function(e){return e.id===t.payload.id}));return-1!==n?e.slice(0,n).concat(e.slice(n+1)):e;default:return e}},S=n(129),I=n(18),j=(E=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O.part,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_CAPTURED_IMAGE":return Object(I.a)({},e,{capturedImages:[].concat(Object(S.a)(e.capturedImages),[t.payload.newCapturedImage])});case"UPDATE_CAPTURED_IMAGES":return Object(I.a)({},e,{capturedImages:t.payload.capturedImages});default:return e}},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O.part,t=arguments.length>1?arguments[1]:void 0,n=E(e,t),a=n.capturedImages.filter((function(e){return e.labels})).length>=15;return Object(I.a)({},n,{isValid:a})});!function(e){e.Empty="Empty",e.P1Added="P1Added",e.Finish="Finish"}(h||(h={})),function(e){e.default="default",e.pointer="pointer",e.crosshair="crosshair",e.neswResize="nesw-resize",e.nwseResize="nwse-resize"}(b||(b={})),function(e){e.Creating="Creating",e.Selecting="Selecting",e.None="None"}(v||(v={})),function(e){e[e.SingleAnnotation=0]="SingleAnnotation",e[e.MultiAnnotation=1]="MultiAnnotation"}(y||(y={}));var T=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O.labelingPageState,t=arguments.length>1?arguments[1]:void 0,n=e;switch(t.type){case"REQUEST_ANNOTATION_SUCCESS":n.annotations=t.payload.annotations;break;case"REQUEST_ANNOTATION_FAILURE":break;case"CREATE_ANNOTATION":n.annotations.push(t.payload.annotation);break;case"UPDATE_CREATING_ANNOTATION":var a=t.payload.updater(n.annotations[n.annotations.length-1]);a.annotationState===h.Finish&&((0|a.label.x1)===(0|a.label.x2)&&(0|a.label.y1)===(0|a.label.y2)?n.annotations.pop():(n.annotations[n.annotations.length-1]=a,n.annotations=Object(S.a)(n.annotations)));break;case"UPDATE_ANNOTATION":n.annotations[t.payload.index]=t.payload.annotation;break;case"REMOVE_ANNOTATION":n.annotations=n.annotations.slice(0,t.payload.index).concat(n.annotations.slice(t.payload.index+1));break;case"RESET_ANNOTATION":n.annotations=O.labelingPageState.annotations;break;default:return e}return n},x=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O.locations,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"GET_LOCATION_SUCCESS":return t.payload;case"REQUEST_LOCATION_FAILURE":return e;case"POST_LOCATION_SUCCESS":return e.concat(t.payload);default:return e}},A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O.dialogIsOpen,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_DIALOG":return!0;case"CLOSE_DIALOG":return!1;default:return e}},_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O.project,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"GET_PROJECT_REQUEST":return Object(I.a)({},e,{isLoading:!0,error:null});case"GET_PROJECT_SUCCESS":return Object(I.a)({},e,{isLoading:!1,data:Object(I.a)({},t.payload.project),error:null});case"GET_PROJECT_FAILED":return Object(I.a)({},e,{isLoading:!1,error:t.error});case"POST_PROJECT_REQUEST":return Object(I.a)({},e,{isLoading:!0});case"POST_PROJECT_SUCCESS":return Object(I.a)({},e,{isLoading:!1});case"POST_PROJECT_FALIED":return Object(I.a)({},e,{isLoading:!1,error:t.error});case"DELETE_PROJECT_SUCCESS":return Object(I.a)({},e,{isLoading:!1,data:{id:null,camera:null,location:null,parts:[],needRetraining:!0,accuracyRangeMin:60,accuracyRangeMax:80,maxImages:50,modelUrl:""},inferenceMetrics:{successRate:0,successfulInferences:0,unIdetifiedItems:0},trainingMetrics:{curConsequence:null,prevConsequence:null},trainingLog:"",status:a.None,error:null});case"DELETE_PROJECT_FALIED":return Object(I.a)({},e);case"UPDATE_PROJECT_DATA":return Object(I.a)({},e,{data:t.payload});case"GET_TRAINING_LOG_REQUEST":return Object(I.a)({},e);case"GET_TRAINING_LOG_SUCCESS":return Object(I.a)({},e,{trainingLog:t.payload.trainingLog,status:t.payload.newStatus});case"GET_TRAINING_LOG_FAILED":return Object(I.a)({},e,{trainingLog:"",data:Object(I.a)({},e.data),status:a.TrainingFailed,error:t.error});case"GET_TRAINING_METRICS_REQUEST":return e;case"GET_TRAINING_METRICS_SUCCESS":return Object(I.a)({},e,{trainingMetrics:t.payload,status:a.StartInference});case"GET_TRAINING_METRICS_FAILED":return Object(I.a)({},e,{error:t.error});case"GET_TRAINING_INFERENCE_REQUEST":return e;case"GET_INFERENCE_METRICS_SUCCESS":return Object(I.a)({},e,{inferenceMetrics:t.payload});case"GET_INFERENCE_METRICS_FAILED":return Object(I.a)({},e,{error:t.error});default:return Object(I.a)({},e)}},w=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O.images,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"GET_LABEL_IMAGE_SUCCESS":return t.payload;case"REQUEST_LABEL_IMAGE_FAILURE":return e;case"POST_LABEL_IMAGE_SUCCESS":return e.concat(t.payload);case"DELETE_LABEL_IMAGE_SUCCESS":var n=e.findIndex((function(e){return e.id===t.payload.id}));return-1!==n?e.slice(0,n).concat(e.slice(n+1)):e;case"UPDATE_LABEL_IMAGE_ANNOTATION":var a=Object(S.a)(e),r=a.findIndex((function(e){return e.id===t.payload.id}));return a[r]=Object(I.a)({},a[r],{labels:t.payload.labels}),a;default:return e}},R=Object(s.combineReducers)({cameras:C,locations:x,part:j,labelingPageState:T,dialogIsOpen:A,project:_,images:w}),k={key:"root",storage:p.a},L=Object(g.a)(k,R),N=function(e){var t=[d.a],n=s.applyMiddleware.apply(void 0,t),a=Object(m.composeWithDevTools)(n),r=Object(s.createStore)(L,e,a);return{store:r,persistor:Object(g.b)(r)}},P=n(31),M=n(236),D=n(131),U=n(162),F=n(79),G=n(84),z=function(e){var t=e.to,n=void 0===t?"":t,a=e.imgSrc,r=e.defaultSrc,i=e.bgImgSrc,o=e.label,l=void 0===o?"":o,u=e.imgPadding,s=void 0===u?"10px":u,d=e.width,m=void 0===d?"100px":d,g=e.height,f=void 0===g?"100px":g,p=e.bgImgStyle,E=e.pointerCursor,h=void 0!==E&&E,b=e.onClick;return c.a.createElement(U.a,{column:!0,styles:{width:m}},""===n?c.a.createElement("div",{style:{height:f},onClick:b},c.a.createElement(G.a,{src:null!==a&&void 0!==a?a:r,styles:Object(I.a)({padding:s,height:"100%",objectFit:"contain",backgroundImage:"url(".concat(i,")"),cursor:h?"pointer":"default"},p)})):c.a.createElement(P.b,{to:n},c.a.createElement("div",{style:{height:f},onClick:b},c.a.createElement(G.a,{src:null!==a&&void 0!==a?a:r,styles:Object(I.a)({padding:s,height:"100%",objectFit:"contain",backgroundImage:"url(".concat(i,")")},p)}))),c.a.createElement(F.a,{align:"center"},l))},J=function(){var e=Object(l.b)();return c.a.createElement(U.a,{column:!0,gap:"gap.medium"},c.a.createElement(F.a,{size:"larger",weight:"semibold"},"Hello User!"),c.a.createElement(F.a,null),c.a.createElement(F.a,{color:"white",styles:{backgroundColor:"#373644",padding:"2px 2px 2px 10px"}},"GET STARTED:"),c.a.createElement(U.a,{gap:"gap.large"},c.a.createElement(z,{imgSrc:"/icons/location-filled.png",to:"/locations/register",label:"Register a new Location",width:"100px"}),c.a.createElement(z,{imgSrc:"/icons/camera-filled.png",to:"/cameras",label:"Register a new Camera",width:"100px",imgPadding:"10px 3px 10px 3px",onClick:function(){e({type:"OPEN_DIALOG"})}}),c.a.createElement(z,{imgSrc:"/icons/part-filled.png",to:"/parts/detail",label:"Register a new Part",width:"100px"})),c.a.createElement(F.a,{color:"white",styles:{backgroundColor:"#373644",padding:"2px 2px 2px 10px"}},"SELECT FROM THE FOLLOWING TASKS:"),c.a.createElement(U.a,{gap:"gap.large"},c.a.createElement(z,{imgSrc:"/icons/doubleCube.png",to:"/partIdentification",label:"Identify Parts",width:"100px"}),c.a.createElement(z,{imgSrc:"/icons/defects.png",to:"/",label:"Identify Defects",width:"100px"}),c.a.createElement(z,{imgSrc:"/icons/manual-filled.png",to:"/manual",label:"Identify items manually",width:"100px"})))},B=n(17),V=n(228),H=n(238),Q=n(68),W=n(23),q=n(177),Y=n(37),X=n.n(Y),K=function(e){return console.error(e),{type:"REQUEST_CAMERA_FAILURE"}},$=function(){return function(e){return X()("/api/cameras/").then((function(t){var n=t.data;e(function(e){return{type:"GET_CAMERA_SUCCESS",payload:e}}(n))})).catch((function(t){e(K(t))}))}},Z=function(){var e=Object(l.b)(),t=Object(l.c)((function(e){return{dialogIsOpen:e.dialogIsOpen,cameras:e.cameras}})),n=t.dialogIsOpen,a=t.cameras,i=Object(r.useState)(""),o=Object(B.a)(i,2),u=o[0],s=o[1],d=Object(r.useState)(""),m=Object(B.a)(d,2),g=m[0],f=m[1],p=Object(r.useState)(""),E=Object(B.a)(p,2),h=E[0],b=E[1];return Object(r.useEffect)((function(){e($())}),[e]),c.a.createElement(U.a,{column:!0,gap:"gap.large",padding:"padding.medium",styles:{height:"100%"}},c.a.createElement(V.a,{columns:"8",styles:{height:"75%"}},a.map((function(e,t){return c.a.createElement(z,{key:t,to:"/cameras/detail?name=".concat(e.name),defaultSrc:"/icons/Play.png",bgImgSrc:"/icons/defaultCamera.png",width:"100px",height:"100px",bgImgStyle:{backgroundSize:"60%",backgroundPosition:"center",backgroundRepeat:"no-repeat"},label:e.name})}))),c.a.createElement(H.a,{trigger:c.a.createElement(U.a,{hAlign:"end"},c.a.createElement(Q.a,{primary:!0,fluid:!0,circular:!0,content:c.a.createElement(W.AddIcon,{size:"largest",circular:!0}),style:{width:"6em",height:"6em"}})),confirmButton:"Submit",onConfirm:function(){var t;e((t={name:u,rtsp:g,model_name:h},function(e){return X()("/api/cameras/",{method:"POST",data:t}).then((function(t){var n=t.data;e(function(e){return{type:"POST_CAMERA_SUCCESS",payload:e}}(n))})).catch((function(t){e(K(t))}))})),s(""),f(""),b(""),e({type:"CLOSE_DIALOG"})},cancelButton:"Cancel",header:"Add Camera",open:n,onOpen:function(){e({type:"OPEN_DIALOG"})},onCancel:function(){e({type:"CLOSE_DIALOG"})},content:c.a.createElement(U.a,{column:!0,gap:"gap.small"},c.a.createElement(q.a,{placeholder:"Name",value:u,onChange:function(e,t){return s(t.value)}}),c.a.createElement(q.a,{placeholder:"RTSP URL",value:g,onChange:function(e,t){return f(t.value)}}),c.a.createElement(q.a,{placeholder:"Model Name",value:h,onChange:function(e,t){return b(t.value)}}))}))},ee=function(e){var t=e.trigger,n=e.onConfirm,a=e.primaryStyles,i=e.content,o=Object(r.useState)(!1),l=Object(B.a)(o,2),u=l[0],s=l[1];return c.a.createElement(H.a,{trigger:t,styles:{width:"20em",padding:"0.5em"},open:u,onOpen:function(){return s(!0)},footer:c.a.createElement(U.a,{column:!0,gap:"gap.large"},c.a.createElement(F.a,{size:"large",align:"center"},i),c.a.createElement(U.a,{space:"around"},c.a.createElement(Q.a,{primary:!0,content:"Confirm",styles:a,onClick:n}),c.a.createElement(Q.a,{content:"Cancel",onClick:function(){return s(!1)}})))})},te=Object(r.memo)((function(e){var t=e.id,n=e.name,a=e.rtsp,r=e.modelName,i=Object(l.b)();return c.a.createElement(U.a,{styles:{padding:"1em 2em"},column:!0,space:"between"},c.a.createElement(V.a,{columns:"2",styles:{gap:"3em"}},c.a.createElement(F.a,{size:"larger",weight:"semibold"},"Details"),c.a.createElement(z,{defaultSrc:"/icons/defaultCamera.png",width:"100px",height:"100px"}),c.a.createElement(U.a,{column:!0,gap:"gap.small"},c.a.createElement(F.a,{size:"large",content:"Name:"}),c.a.createElement(F.a,{size:"large",content:"RTSP Url:"}),c.a.createElement(F.a,{size:"large",content:"Model:"})),c.a.createElement(U.a,{column:!0,gap:"gap.medium"},c.a.createElement(F.a,{size:"large",content:n}),c.a.createElement(F.a,{size:"large",content:a}),c.a.createElement(F.a,{size:"large",content:r}))),c.a.createElement(ee,{trigger:c.a.createElement(Q.a,{primary:!0,content:"Delete Camera",styles:{backgroundColor:"#C4314B",":hover":{backgroundColor:"#A72037"},":active":{backgroundColor:"#8E192E"}}}),content:"Delete Camera",primaryStyles:{backgroundColor:"#C4314B",":hover":{backgroundColor:"#A72037"},":active":{backgroundColor:"#8E192E"}},onConfirm:function(){i(function(e){return function(t){return X()("/api/cameras/".concat(e,"/"),{method:"DELETE"}).then((function(){t(function(e){return{type:"DELETE_CAMERA_SUCCESS",payload:{id:e}}}(e))})).catch((function(e){t(K(e))}))}}(t))}}))})),ne=n(237),ae=n(106),re=n(239),ce=function(e,t){var n=Object(r.useRef)(null);Object(r.useEffect)((function(){n.current=e}),[e]),Object(r.useEffect)((function(){if(null!==t){var e=setInterval((function(){n.current()}),t);return function(){return clearInterval(e)}}}),[t])},ie=function(e,t){return{type:"GET_TRAINING_LOG_SUCCESS",payload:{trainingLog:e,newStatus:t}}},oe=function(){return function(e){return e({type:"GET_PROJECT_REQUEST"}),X.a.get("/api/projects/").then((function(t){var n,a,r,c,i,o,l,u,s,d,m,g,f,p,E,h,b,v,y=t.data,O={id:null!==(n=null===(a=y[0])||void 0===a?void 0:a.id)&&void 0!==n?n:null,camera:null!==(r=parseInt(null===(c=y[0])||void 0===c?void 0:c.camera.split("/")[5],10))&&void 0!==r?r:null,location:null!==(i=parseInt(null===(o=y[0])||void 0===o?void 0:o.location.split("/")[5],10))&&void 0!==i?i:null,parts:null!==(l=null===(u=y[0])||void 0===u?void 0:u.parts.map((function(e){return parseInt(e.split("/")[5],10)})))&&void 0!==l?l:[],modelUrl:null!==(s=null===(d=y[0])||void 0===d?void 0:d.download_uri)&&void 0!==s?s:"",needRetraining:null===(m=null===(g=y[0])||void 0===g?void 0:g.needRetraining)||void 0===m||m,accuracyRangeMin:null!==(f=null===(p=y[0])||void 0===p?void 0:p.accuracyRangeMin)&&void 0!==f?f:60,accuracyRangeMax:null!==(E=null===(h=y[0])||void 0===h?void 0:h.accuracyRangeMax)&&void 0!==E?E:80,maxImages:null!==(b=null===(v=y[0])||void 0===v?void 0:v.maxImages)&&void 0!==b?b:50};e(function(e){return{type:"GET_PROJECT_SUCCESS",payload:{project:e}}}(O))})).catch((function(t){e({type:"GET_PROJECT_FAILED",error:t})}))}},le=function(e){X.a.get("/api/projects/".concat(e,"/train")).catch((function(e){return console.error(e)}))},ue=function(e){return function(t){return t({type:"GET_TRAINING_LOG_REQUEST"}),X.a.get("/api/projects/".concat(e,"/export")).then((function(e){var n=e.data;if("failed"===n.status)throw new Error(n.log);"ok"===n.status?t(ie("",a.FinishTraining)):t(ie(n.log,a.WaitTraining))})).catch((function(e){return t({type:"GET_TRAINING_LOG_FAILED",error:e})}))}},se=function(){var e=Object(r.useState)([]),t=Object(B.a)(e,2),n=t[0],a=t[1];return Object(r.useEffect)((function(){fetch("/api/parts/").then((function(e){return e.json()})).then((function(e){a(e)})).catch((function(e){console.error(e)}))}),[]),n},de=function(){return new URLSearchParams(Object(D.i)().search)},me=function(e){var t,n,i,o,u,s,d=e.projectId,m=Object(l.c)((function(e){return e.project})),g=m.error,f=m.data,p=m.trainingLog,E=m.status,h=m.trainingMetrics,b=m.inferenceMetrics,v=ge(p),y=se(),O=Object(l.b)(),C=de().get("name"),S=Object(D.h)(),I=Object(r.useCallback)((function(){confirm("Delete this configuration?")&&O(function(e){return function(t){return X.a.delete("/api/projects/".concat(e,"/")).then((function(){return t({type:"DELETE_PROJECT_SUCCESS"})})).catch((function(e){alert(e),t({type:"DELETE_PROJECT_FALIED"})}))}}(d)).then((function(e){if(e)return S.push("/cameras/detail?name=".concat(C))})).catch((function(e){return console.error(e)}))}),[O,S,C,d]);Object(r.useEffect)((function(){O(ue(d))}),[O,d]),ce((function(){O(ue(d))}),E===a.WaitTraining?5e3:null),Object(r.useEffect)((function(){E===a.FinishTraining&&O(function(e){return function(t){return t({type:"GET_TRAINING_METRICS_REQUEST"}),X.a.get("/api/projects/".concat(e,"/train_performance")).then((function(e){var n=e.data,a=n.new?{precision:n.new.precision,recall:n.new.recall,mAP:n.new.map}:null,r=n.previous?{precision:n.previous.precision,recall:n.previous.recall,mAP:n.previous.map}:null;return t(function(e,t){return{type:"GET_TRAINING_METRICS_SUCCESS",payload:{prevConsequence:t,curConsequence:e}}}(a,r))})).catch((function(e){return t({type:"GET_TRAINING_METRICS_FAILED",error:e})}))}}(d))}),[O,E,d]),ce((function(){O(function(e){return function(t){return t({type:"GET_TRAINING_INFERENCE_REQUEST"}),X.a.get("/api/projects/".concat(e,"/export")).then((function(e){var n,a,r,c=e.data;return t((n=c.success_rate,a=c.inference_num,r=c.unidentified_num,{type:"GET_INFERENCE_METRICS_SUCCESS",payload:{successRate:n,successfulInferences:a,unIdetifiedItems:r}}))})).catch((function(e){return t({type:"GET_INFERENCE_METRICS_FAILED",error:e})}))}}(d))}),E===a.StartInference?5e3:null);var j=[a.FinishTraining,a.StartInference].includes(E);return c.a.createElement(U.a,{column:!0,gap:"gap.large"},c.a.createElement("h1",null,"Configuration"),g&&c.a.createElement(ne.a,{danger:!0,header:g.name,content:"".concat(g.message)}),E===a.WaitTraining?c.a.createElement(c.a.Fragment,null,c.a.createElement(ae.a,{size:"smallest"}),c.a.createElement("pre",null,v)):c.a.createElement(c.a.Fragment,null,c.a.createElement(pe,{title:"Status"},c.a.createElement(Ee,{online:j})),c.a.createElement(pe,{title:"Configured for"},y.filter((function(e){return f.parts.includes(e.id)})).map((function(e){return e.name})).join(", ")),c.a.createElement(U.a,{column:!0,gap:"gap.small"},c.a.createElement(F.a,{styles:{width:"150px"},size:"large"},"Live View:"),c.a.createElement("div",{style:{width:"100%",height:"600px",backgroundColor:"black"}},j?c.a.createElement(G.a,{src:"http://".concat(window.location.hostname,":5000/video_feed?inference=1"),styles:{width:"100%",height:"100%",objectFit:"contain"}}):null)),c.a.createElement(pe,{title:"Success Rate"},c.a.createElement(F.a,{styles:{color:"rgb(244, 152, 40)",fontWeight:"bold"},size:"large"},"".concat(b.successRate,"%"))),c.a.createElement(pe,{title:"Successful Inferences"},b.successfulInferences),c.a.createElement(pe,{title:"Unidentified Items"},c.a.createElement(F.a,{styles:{margin:"5px"},size:"large"},b.unIdetifiedItems),c.a.createElement(Q.a,{content:"Identify Manually",primary:!0,styles:{backgroundColor:"red",marginLeft:"100px",":hover":{backgroundColor:"#A72037"},":active":{backgroundColor:"#8E192E"}},as:P.b,to:"/manual"})),h.prevConsequence&&c.a.createElement(c.a.Fragment,null,c.a.createElement(F.a,null,"Previous Model Metrics"),c.a.createElement(fe,{precision:null===(t=h.prevConsequence)||void 0===t?void 0:t.precision,recall:null===(n=h.prevConsequence)||void 0===n?void 0:n.recall,mAP:null===(i=h.prevConsequence)||void 0===i?void 0:i.mAP})),c.a.createElement(F.a,null,"Updated Model Metrics"),c.a.createElement(fe,{precision:null===(o=h.curConsequence)||void 0===o?void 0:o.precision,recall:null===(u=h.curConsequence)||void 0===u?void 0:u.recall,mAP:null===(s=h.curConsequence)||void 0===s?void 0:s.mAP}),c.a.createElement(Q.a,{primary:!0,onClick:I},"Delete Configuration"),c.a.createElement(Q.a,{primary:!0,as:P.b,to:"/partIdentification"},"Edit Configuration")))},ge=function(e){var t=Object(r.useState)(e),n=Object(B.a)(t,2),a=n[0],c=n[1];return Object(r.useEffect)((function(){c((function(t){return"".concat(t,"\n").concat(e)}))}),[e]),a},fe=function(e){var t=e.precision,n=e.recall,a=e.mAP;return c.a.createElement(V.a,{columns:3},c.a.createElement("div",{style:{height:"5em",display:"flex",flexFlow:"column",justifyContent:"space-between"}},c.a.createElement(F.a,{align:"center",size:"large",weight:"semibold"},"Precison"),c.a.createElement(F.a,{align:"center",size:"large",weight:"semibold",styles:{color:"#9a0089"}},null===t?"":"".concat((1e3*t|0)/10,"%"))),c.a.createElement("div",{style:{height:"5em",display:"flex",flexFlow:"column",justifyContent:"space-between"}},c.a.createElement(F.a,{align:"center",size:"large",weight:"semibold"},"Recall"),c.a.createElement(F.a,{align:"center",size:"large",weight:"semibold",styles:{color:"#0063b1"}},null===n?"":"".concat((1e3*n|0)/10,"%"))),c.a.createElement("div",{style:{height:"5em",display:"flex",flexFlow:"column",justifyContent:"space-between"}},c.a.createElement(F.a,{align:"center",size:"large",weight:"semibold"},"mAP"),c.a.createElement(F.a,{align:"center",size:"large",weight:"semibold",styles:{color:"#69c138"}},null===a?"":"".concat((1e3*a|0)/10,"%"))))},pe=function(e){var t=e.title,n=e.children;return c.a.createElement(U.a,{vAlign:"center"},c.a.createElement(F.a,{style:{width:"200px"},size:"large"},"".concat(t,": ")),"string"===typeof n||"number"===typeof n?c.a.createElement(F.a,{size:"large"},n):n)},Ee=function(e){var t=e.online,n=t?"Online":"Offline",a=t?"success":"unknown";return c.a.createElement(U.a,{gap:"gap.smaller",vAlign:"center"},c.a.createElement(re.a,{state:a}),c.a.createElement(F.a,{styles:{margin:"5px"},size:"large"},n))},he=function(){return c.a.createElement("div",{style:{height:"100%"}},c.a.createElement("h1",null,"Configuration"),c.a.createElement(U.a,{hAlign:"center",vAlign:"center",design:{height:"100%"},column:!0,gap:"gap.large"},c.a.createElement(Q.a,{fluid:!0,circular:!0,content:c.a.createElement(W.AddIcon,{size:"largest",circular:!0,color:"brand"}),style:{width:100,height:100,border:"5px solid #0094d8"},color:"brand",as:P.b,to:"/partIdentification"}),c.a.createElement("h2",null,"Configure Task for the Device")))},be=function(){var e=Object(l.c)((function(e){return e.project.data.camera})),t=Object(l.c)((function(e){return e.project.data.id})),n=Object(l.b)(),a=de().get("name"),i=Object(l.c)((function(e){return e.cameras.find((function(e){return e.name===a}))}));if(Object(r.useEffect)((function(){n(oe()),n($())}),[n]),!i)return c.a.createElement(D.b,{to:"/cameras"});var o=e===i.id;return c.a.createElement(V.a,{columns:"2",design:{height:"100%"}},c.a.createElement(te,{id:i.id,name:a,rtsp:i.rtsp,modelName:i.model_name}),o?c.a.createElement(me,{projectId:t}):c.a.createElement(he,null))},ve=n(240),ye=n(121),Oe=n(173),Ce=n(42),Se={image:void 0,status:"loading",size:{width:0,height:0}},Ie=function(e,t){var n=Object(r.useState)(Se),a=Object(B.a)(n,2),c=a[0],i=a[1],o=c.image,l=c.status,u=c.size,s=function(e){var t=Object(r.useRef)();return Object(r.useEffect)((function(){t.current=e}),[e]),t.current}(e);return Object(r.useEffect)((function(){if(e){var n=document.createElement("img");e!==s&&i((function(e){return Object(I.a)({},e,{image:e.image,status:"loading"})}));var a=function(){i({image:n,status:"loaded",size:{width:n.width,height:n.height}})},r=function(){i((function(e){return Object(I.a)({},e,{image:void 0,status:"failed"})}))};return n.addEventListener("load",a),n.addEventListener("error",r),t&&(n.crossOrigin=t),n.src=e,function(){n.removeEventListener("load",a),n.removeEventListener("error",r)}}}),[e,t,s]),[o,l,u]},je=function(e){return function(t){if(0!==t.width){if(t.width>t.height){var n=e.width/t.width;return[{width:e.width,height:t.height*n},n]}var a=e.height/t.height;return[{height:e.height,width:t.width*a},a]}return[e,1]}},Te=n(146),xe=function(e){return{type:"REQUEST_ANNOTATION_SUCCESS",payload:{annotations:e}}},Ae={init:function(){return{label:{x1:0,y1:0,x2:0,y2:0},attribute:"",annotationState:h.Empty}},createWithPoint:function(e,t){var n=Object(I.a)({},this.init(),{attribute:t});return this.add(e,n)},add:function(e,t){var n=e.x,a=e.y,r=Object(I.a)({},t);return t.annotationState===h.Empty?(r.label.x1=n,r.label.y1=a,r.label.x2=n,r.label.y2=a,r.annotationState=h.P1Added):t.annotationState===h.P1Added&&(r.label.x2=n,r.label.y2=a,r.annotationState=h.Finish),this.setVerticesToValidValue(r)},setVerticesToInt:function(e){var t=Object(I.a)({},e),n=t.label,a=n.x1,r=n.y1,c=n.x2,i=n.y2;return t.label={x1:Math.round(a),y1:Math.round(r),x2:Math.round(c),y2:Math.round(i)},t},setVerticesPointsOrder:function(e){var t=Object(I.a)({},e),n=t.label,a=n.x1,r=n.y1,c=n.x2,i=n.y2;return a>c&&(t.label.x1=c,t.label.x2=a),r>i&&(t.label.y1=i,t.label.y2=r),t},setVerticesToValidValue:function(e){return this.setVerticesPointsOrder(this.setVerticesToInt(e))}},_e=function(e){var t=e.scale,n=e.workState,a=e.onSelect,i=e.selected,o=e.annotationIndex,l=e.visible,u=void 0===l||l,s=e.annotation,d=e.dispatch,m=e.changeCursorState,g=void 0===m?null:m,f=Object(r.useState)(s.label),p=Object(B.a)(f,2),E=p[0],h=p[1],y=5/t,O=2/t,C=Object(r.useRef)(null),S=function(){if(g(),d){var e=Object(I.a)({},s);e.label=E,d(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return{type:"UPDATE_ANNOTATION",payload:{index:e,annotation:Ae.setVerticesToValidValue(t)}}}(o,e))}},j=Object(r.useCallback)((function(e){n===v.Creating&&i&&h((function(n){return Object(I.a)({},n,{x2:e.evt.offsetX/t,y2:e.evt.offsetY/t})}))}),[n,h,i,t]),T=Object(r.useCallback)((function(e){var n=e.xi,a=void 0===n?"x1":n,r=e.yi,c=void 0===r?"y1":r;return function(e){var n=e.target.getStage().getSize(),r=n.width,i=n.height,o=Math.round(e.target.position().x),l=Math.round(e.target.position().y);o<0&&(o=0),l<0&&(l=0),o>r/t&&(o=r/t),l>i/t&&(l=i/t),e.target.setAttr("x",o),e.target.setAttr("y",l);var u=["x1","x2"],s=["y1","y2"];u.splice(u.findIndex((function(e){return e===a})),1),s.splice(s.findIndex((function(e){return e===c})),1),E[u[0]]>E[a]?E[s[0]]>E[c]?g(b.nwseResize):g(b.neswResize):E[s[0]]>E[c]?g(b.neswResize):g(b.nwseResize),h((function(e){var t;return Object(I.a)({},e,(t={},Object(Te.a)(t,a,o),Object(Te.a)(t,c,l),t))}))}}),[g,t,E]);return Object(r.useEffect)((function(){var e=C.current.getLayer();return e.on("mousemove",j),function(){e.off("mousemove",j)}}),[j]),Object(r.useEffect)((function(){h(s.label)}),[s.label]),c.a.createElement(Ce.Group,{ref:function(e){e&&(C.current=e)},visible:u,onMouseDown:function(e){n===v.None&&(a(o),e.cancelBubble=!0)}},c.a.createElement(Ce.Line,{points:[E.x1,E.y1,E.x2,E.y1,E.x2,E.y2,E.x1,E.y2,E.x1,E.y1],stroke:"red",strokeWidth:O,closed:!0}),c.a.createElement(Ce.Group,{visible:i},c.a.createElement(Ce.Circle,{key:"anchor-0",name:"anchor-0",x:E.x1,y:E.y1,radius:y,fill:"red",draggable:!0,onDragMove:T({xi:"x1",yi:"y1"}),onDragEnd:S,onMouseEnter:function(){n!==v.Creating&&g(b.nwseResize)},onMouseLeave:function(){g()}}),c.a.createElement(Ce.Circle,{key:"anchor-1",name:"anchor-1",x:E.x2,y:E.y1,radius:y,fill:"red",draggable:!0,onDragMove:T({xi:"x2",yi:"y1"}),onDragEnd:S,onMouseEnter:function(){n!==v.Creating&&g(b.neswResize)},onMouseLeave:function(){g()}}),c.a.createElement(Ce.Circle,{key:"anchor-2",name:"anchor-2",x:E.x2,y:E.y2,radius:y,fill:"red",draggable:!0,onDragMove:T({xi:"x2",yi:"y2"}),onDragEnd:S,onMouseEnter:function(){n!==v.Creating&&g(b.nwseResize)},onMouseLeave:function(){g()}}),c.a.createElement(Ce.Circle,{key:"anchor-3",name:"anchor-3",x:E.x1,y:E.y2,radius:y,fill:"red",draggable:!0,onDragMove:T({xi:"x1",yi:"y2"}),onDragEnd:S,onMouseEnter:function(){n!==v.Creating&&g(b.neswResize)},onMouseLeave:function(){g()}})))},we=function(e){var t=e.scale,n=e.vertices,a=e.color;return c.a.createElement(c.a.Fragment,null,c.a.createElement(Ce.Line,{ref:function(e){e&&e.cache()},points:[n.x1,n.y1,n.x2,n.y1,n.x2,n.y2,n.x1,n.y2,n.x1,n.y1],stroke:a,strokeWidth:1/t,closed:!0}),c.a.createElement(Ce.Circle,{x:n.x1,y:n.y1,radius:3/t,fill:a}),c.a.createElement(Ce.Circle,{x:n.x2,y:n.y1,radius:3/t,fill:a}),c.a.createElement(Ce.Circle,{x:n.x2,y:n.y2,radius:3/t,fill:a}),c.a.createElement(Ce.Circle,{x:n.x1,y:n.y2,radius:3/t,fill:a}))},Re=Object(r.memo)((function(e){var t,n,a=e.visible,i=e.imageSize,o=e.label,l=e.changeCursorState,u=e.scale,s=e.setShowOuterRemoveButton,d=e.removeBox,m=Object(r.useState)("#F9526B"),g=Object(B.a)(m,2),f=g[0],p=g[1],E=Object(r.useState)(1.5/u),h=Object(B.a)(E,2),v=h[0],y=h[1];return o.x1<0||o.x2>i.width/u||o.y1<0||o.y2>i.height/u?(t=0,n=-60):o.x1>30/u||o.x2<(i.width-25)/u?(t=o.x1>30/u?o.x1-20/u:o.x2+25/u,n=o.y1>12/u?o.y1-10/u:o.y1+12/u):(t=12/u,n=o.y1>20/u?o.y1-20/u:-60),s(-60===n),Object(r.useEffect)((function(){y(1.5/u)}),[u]),c.a.createElement(Ce.Group,{visible:a,x:t,y:n,onMouseEnter:function(){l(b.pointer),p("#E73550"),y(3/u)},onMouseLeave:function(){l(),p("#F9526B"),y(1.5/u)},onClick:function(e){d(),e.cancelBubble=!0}},c.a.createElement(Ce.Rect,{x:-5/u,y:-5/u,width:10/u,height:10/u}),c.a.createElement(Ce.Line,{points:[-5/u,-5/u,5/u,5/u],stroke:f,strokeWidth:v}),c.a.createElement(Ce.Line,{points:[5/u,-5/u,-5/u,5/u],stroke:f,strokeWidth:v}))})),ke={width:800,height:600},Le=function(e){var t=e.url,n=void 0===t?"":t,a=e.labelingType,i=e.annotations,o=Object(l.b)(),u=Object(r.useCallback)(je(ke),[ke]),s=Object(r.useState)(ke),d=Object(B.a)(s,2),m=d[0],g=d[1],f=Object(r.useMemo)((function(){return a===y.SingleAnnotation&&1===i.length}),[a,i]),p=Object(r.useState)(b.default),E=Object(B.a)(p,2),h=E[0],O=E[1],C=Ie(n,"anonymous"),S=Object(B.a)(C,3),I=S[0],j=S[1],T=S[2],x=Object(r.useState)(null),A=Object(B.a)(x,2),_=A[0],w=A[1],R=Object(r.useState)(v.None),k=Object(B.a)(R,2),L=k[0],N=k[1],P=Object(r.useState)(!1),M=Object(B.a)(P,2),D=M[0],U=M[1],G=Object(r.useState)(!1),z=Object(B.a)(G,2),J=z[0],V=z[1],H=Object(r.useRef)(1),q=Object(r.useCallback)((function(e){O(e||(f?b.default:b.crosshair))}),[f]),Y=Object(r.useCallback)((function(){o(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return{type:"REMOVE_ANNOTATION",payload:{index:e}}}(_)),N(v.None),U(!1)}),[o,_,N,U]),X=function(e){w(e),N(v.Selecting)};return Object(r.useEffect)((function(){f?(q(),w(0)):q()}),[f,q]),Object(r.useEffect)((function(){L!==v.None||f||w(null)}),[L,f]),Object(r.useEffect)((function(){var e=u(T),t=Object(B.a)(e,2),n=t[0],a=t[1];g(n),H.current=a}),[T,u]),"loading"===j||0===m.height&&0===m.width?c.a.createElement(F.a,{align:"center",color:"red"},"Loading..."):c.a.createElement("div",{style:{margin:"0.2em"}},0!==i.length&&D&&!J&&L!==v.Creating?c.a.createElement(Q.a,{iconOnly:!0,text:!0,styles:{color:"#F9526B",":hover":{color:"#E73550"}},content:c.a.createElement(W.CloseIcon,{size:"large"}),onClick:Y}):c.a.createElement("div",{style:{height:"2em"}}),c.a.createElement(Ce.Stage,{width:m.width,height:m.height,scale:{x:H.current,y:H.current},style:{cursor:h}},c.a.createElement(Ce.Layer,{onMouseDown:function(e){var t;f||L===v.Creating||(o((t={x:e.evt.offsetX/H.current,y:e.evt.offsetY/H.current},{type:"CREATE_ANNOTATION",payload:{annotation:Ae.createWithPoint(t,"")}})),w(i.length-1),N(v.Creating))},onMouseUp:function(e){var t;L===v.Creating&&(o((t={x:e.evt.offsetX/H.current,y:e.evt.offsetY/H.current},{type:"UPDATE_CREATING_ANNOTATION",payload:{updater:function(e){return Ae.add(t,e)}}})),i.length-1===_?N(v.Selecting):N(v.None))},onDragStart:function(){V(!0)},onDragEnd:function(){V(!1)}},c.a.createElement(Ce.Image,{image:I}),i.map((function(e,t){return c.a.createElement(Ce.Group,{key:t},c.a.createElement(Re,{imageSize:m,visible:!J&&L!==v.Creating&&t===_,label:e.label,scale:H.current,changeCursorState:q,setShowOuterRemoveButton:U,removeBox:Y}),c.a.createElement(_e,{workState:L,onSelect:X,annotation:e,scale:H.current,annotationIndex:t,selected:t===_,dispatch:o,changeCursorState:q}))})))))},Ne=function(e){return console.error(e),{type:"REQUEST_LABEL_IMAGE_FAILURE"}},Pe=function(){return function(e){return X()("/api/images/").then((function(t){var n=t.data;e(function(e){return{type:"GET_LABEL_IMAGE_SUCCESS",payload:e}}(n))})).catch((function(t){e(Ne(t))}))}},Me=function(e){return function(t){return X()("/api/images/",{method:"POST",data:e}).then((function(e){var n=e.data;t({type:"POST_LABEL_IMAGE_SUCCESS",payload:n})})).catch((function(e){t(Ne(e))}))}},De=function(e,t){return function(n){var a="/api/images/".concat(e,"/");return X()({url:a,method:"PATCH",data:{labels:JSON.stringify(t.map((function(e){return e.label})))}}).then((function(e){var t=e.data;console.info("Save successfully"),n(Ue(t.id,t.labels))})).catch((function(e){n(Ne(e))}))}},Ue=function(e,t){return{type:"UPDATE_LABEL_IMAGE_ANNOTATION",payload:{id:e,labels:t}}},Fe=function(e){return parseInt(e.split("/")[5],10)},Ge=function(e,t){var n=t.partId,a=t.isRelabel,r=void 0!==a&&a;return void 0===n?e:e.filter((function(e){return Fe(e.part)===n&&e.is_relabel===r}))},ze=function(e){if(0===e.length)return!1;var t=e[e.length-1].label;return t.x1===t.x2&&t.y1===t.y2},Je=function(e){var t,n,a=e.labelingType,i=e.imageIndex,o=e.closeDialog,u=e.partId,s=e.isRelabel,d=Object(l.b)(),m=Object(r.useState)(i),g=Object(B.a)(m,2),f=g[0],p=g[1],E=Object(l.c)((function(e){return{images:e.images,annotations:e.labelingPageState.annotations}})),b=E.images,v=E.annotations,y=Ge(b,{partId:u,isRelabel:s}),O=null===(t=y[f])||void 0===t?void 0:t.image,C=null===(n=y[f])||void 0===n?void 0:n.id;return Object(r.useEffect)((function(){return"number"===typeof C&&d(function(e){return function(t,n){var a=n().images.find((function(t){return t.id===e})).labels;if(null===a)t(xe([]));else{var r=JSON.parse(a).map((function(e){return{label:e,attribute:"",annotationState:h.Finish}}));t(xe(r))}}}(C)),function(){d({type:"RESET_ANNOTATION"})}}),[d,C]),c.a.createElement(U.a,{column:!0,hAlign:"center"},c.a.createElement(F.a,{size:"larger",weight:"semibold"},"DRAW A RECTANGLE AROUND THE PART"),c.a.createElement(U.a,{vAlign:"center"},!s&&c.a.createElement(Q.a,{text:!0,disabled:0===f||ze(v),icon:c.a.createElement(W.ChevronStartIcon,{size:"larger"}),onClick:function(){d(De(y[f].id,v)),p((function(e){return(e-1+y.length)%y.length}))}}),c.a.createElement(Le,{url:null!==O&&void 0!==O?O:"/icons/Play.png",annotations:v,labelingType:a}),!s&&c.a.createElement(Q.a,{text:!0,disabled:f===y.length-1||ze(v),icon:c.a.createElement(W.ChevronEndIcon,{size:"larger"}),onClick:function(){d(De(y[f].id,v)),p((function(e){return(e+1)%y.length}))}})),c.a.createElement(U.a,{gap:"gap.medium"},c.a.createElement(Q.a,{primary:!0,content:"Save",disabled:ze(v),onClick:function(){d(De(y[f].id,v)),o()}}),c.a.createElement(Q.a,{content:"Cancel",onClick:function(){o()}})))},Be=Object(r.memo)((function(e){var t=e.trigger,n=e.imageIndex,a=e.partId,i=e.isRelabel,o=Object(r.useState)(!1),l=Object(B.a)(o,2),u=l[0],s=l[1];return c.a.createElement(H.a,{trigger:t,styles:{width:"80%"},open:u,onOpen:function(){return s(!0)},content:c.a.createElement(Je,{closeDialog:function(){return s(!1)},labelingType:y.SingleAnnotation,imageIndex:n,partId:a,isRelabel:i})})})),Ve=function(e){var t=e.labelImage,n=e.labelText,a=void 0===n?"":n,i=e.width,o=void 0===i?300:i,l=e.height,u=void 0===l?150:l,s=e.pointerCursor,d=void 0!==s&&s,m=e.onClick,g=Ie(t.image,"anonymous"),f=Object(B.a)(g,3),p=f[0],E=(f[1],f[2]),b=Object(r.useState)({width:o,height:u}),v=Object(B.a)(b,2),y=v[0],O=v[1],C=Object(r.useCallback)(je({width:o,height:u}),[o,u]),S=Object(r.useRef)(1),I=Object(r.useMemo)((function(){return(null===t||void 0===t?void 0:t.labels)?JSON.parse(t.labels).map((function(e){return{label:e,attribute:"",annotationState:h.Finish}})):[]}),[t]);return Object(r.useEffect)((function(){var e=C(E),t=Object(B.a)(e,2),n=t[0],a=t[1];O(n),S.current=a}),[E,C]),c.a.createElement("div",{onClick:m,style:{cursor:d?"pointer":"default"}},c.a.createElement(U.a,{column:!0},c.a.createElement(Ce.Stage,{width:y.width,height:y.height,scale:{x:S.current,y:S.current}},c.a.createElement(Ce.FastLayer,null,c.a.createElement(Ce.Image,{image:p}),I.map((function(e,t){return c.a.createElement(we,{key:t,scale:S.current,vertices:e.label,color:"red"})})))),c.a.createElement(F.a,{align:"center"},a)))},He=n(211),Qe=n.n(He),We=n(359),qe=c.a.memo((function(e){var t=e.rtsp,n=void 0===t?null:t,a=e.partId,i=e.canCapture,o=e.onVideoStart,u=e.onVideoPause,s=Object(r.useState)(""),d=Object(B.a)(s,2),m=d[0],g=d[1],f=Object(l.b)(),p=function(){g(""),fetch("/api/streams/".concat(m,"/disconnect")).then((function(e){return e.json()})).then((function(e){return console.log(e),null})).catch((function(e){console.error(e)})),u&&u()};Object(r.useEffect)((function(){return window.addEventListener("beforeunload",p),function(){window.removeEventListener("beforeunload",p)}}));var E=m?"/api/streams/".concat(m,"/video_feed"):"";return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{style:{width:"100%",height:"600px",backgroundColor:"black"}},E?c.a.createElement(G.a,{src:E,styles:{width:"100%",height:"100%",objectFit:"contain"}}):null),c.a.createElement(Q.a.Group,{styles:{alignSelf:"center"},buttons:[{key:"start",icon:c.a.createElement(W.PlayIcon,null),iconOnly:!0,onClick:function(){var e="/api/streams/connect/?part_id=".concat(a,"&rtsp=").concat(n);i||(e+="&inference=1"),fetch(e).then((function(e){return e.json()})).then((function(e){return"ok"===(null===e||void 0===e?void 0:e.status)&&g(e.stream_id),null})).catch((function(e){console.error(e)})),o&&o()},disabled:null===n},i&&{key:"capture",icon:c.a.createElement(W.CallControlPresentNewIcon,null),iconOnly:!0,onClick:function(){f(function(e){return function(){var t=Object(We.a)(Qe.a.mark((function t(n){return Qe.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:fetch("/api/streams/".concat(e,"/capture")).then((function(e){return e.json()})).then((function(e){return"ok"===e.status&&(n({type:"ADD_CAPTURED_IMAGE",payload:{newCapturedImage:e.image}}),n(Pe())),null})).catch((function(e){console.error(e)}));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}(m))},disabled:!m},{key:"stop",icon:c.a.createElement(W.PauseThickIcon,null),iconOnly:!0,onClick:p,disabled:!m}]}))})),Ye=function(e){return Array.isArray(e)?e.map((function(e){return{header:e.name,content:{key:e.id}}})):e?{header:e.name,content:{key:e.id}}:null},Xe=function(e){var t=e.partId,n=Object(r.useState)(null),a=Object(B.a)(n,2),i=a[0],o=a[1];return c.a.createElement(c.a.Fragment,null,c.a.createElement(Ke,{selectedCamera:i,setSelectedCamera:o}),c.a.createElement(qe,{rtsp:null===i||void 0===i?void 0:i.rtsp,partId:t,canCapture:!0}),c.a.createElement($e,{partId:t}))},Ke=function(e){var t=e.selectedCamera,n=e.setSelectedCamera,a=function(){var e=Object(l.b)(),t=Object(l.c)((function(e){return e.cameras}));return Object(r.useEffect)((function(){e($())}),[e]),t}(),i=a.map((function(e){return{header:e.name,content:{key:e.id}}}));return c.a.createElement(U.a,{gap:"gap.small",vAlign:"center"},c.a.createElement(F.a,null,"Select Camera"),c.a.createElement(Oe.a,{items:i,onChange:function(e,t){if(null===t.value)n((function(e){return e}));else{var r=t.value.content.key,c=a.find((function(e){return e.id===r}));c&&n(c)}},value:Ye(t)}),c.a.createElement(P.b,{to:"/addCamera"},"Add Camera"))},$e=function(e){var t=e.partId,n=Object(l.b)(),a=Object(l.c)((function(e){return e.images})).filter((function(e){return!e.is_relabel})),i=Ge(a,{partId:t,isRelabel:!1}),o=i.filter((function(e){return e.labels})).length>=15;Object(r.useEffect)((function(){n(Pe())}),[n]);var u=i.length;return c.a.createElement(c.a.Fragment,null,c.a.createElement(F.a,null,"Total: ",u),!o&&c.a.createElement(F.a,{error:!0},"*Please capture and label more then 15 images"),c.a.createElement(U.a,{styles:{overflow:"scroll",border:"1px solid grey",height:"150px",borderColor:o?"":"red"},gap:"gap.small",vAlign:"center"},i.map((function(e,n){return c.a.createElement("div",{key:e.id},c.a.createElement("span",null,n+1),c.a.createElement(Be,{key:n,imageIndex:n,partId:t,trigger:c.a.createElement(Ve,{labelImage:e,pointerCursor:!0,width:200,height:150}),isRelabel:!1}))}))),c.a.createElement(D.a,{when:u<15,message:"The count of images is less than 15, which may cause error when configure part identification. Sure you want to leave?"}))},Ze=function(e){var t=e.partId,n=Object(l.b)(),a=Object(l.c)((function(e){return e.images})),i=Ge(a,{partId:t,isRelabel:!1}),o=i.filter((function(e){return e.labels})).length>=15;return Object(r.useEffect)((function(){n(Pe())}),[n]),c.a.createElement(c.a.Fragment,null,c.a.createElement("input",{type:"file",onChange:function(e){for(var a=0;a<e.target.files.length;a++){var r=new FormData;r.append("image",e.target.files[a]),r.append("part","/api/parts/".concat(t,"/")),n(Me(r))}},accept:"image/*",multiple:!0}),c.a.createElement(et,{capturedImages:i,isValid:o,partId:t}))},et=function(e){var t=e.capturedImages,n=e.isValid,a=e.partId;return c.a.createElement(c.a.Fragment,null,!n&&c.a.createElement(F.a,{error:!0},"*Please capture and label more then 15 images"),c.a.createElement(V.a,{columns:"2",styles:{border:"1px solid grey",height:"100%",gridGap:"10px",padding:"10px",borderColor:n?"":"red",justifyItems:"center",alignItems:"center"}},t.map((function(e,t){return c.a.createElement(Be,{key:t,imageIndex:t,trigger:c.a.createElement(Ve,{labelImage:e,pointerCursor:!0,width:300,height:225}),partId:a,isRelabel:!1})}))))},tt=function(){var e=de().get("partId");return c.a.createElement(V.a,{columns:"repeat(12, 1fr)",styles:{gridColumnGap:"20px",height:"100%"}},c.a.createElement(nt,{partId:e}),c.a.createElement(at,{partId:e}))},nt=function(e){var t=e.partId,n=Object(r.useState)(""),a=Object(B.a)(n,2),i=a[0],o=a[1],l=Object(r.useState)(""),u=Object(B.a)(l,2),s=u[0],d=u[1],m=Object(r.useState)(""),g=Object(B.a)(m,2),f=g[0],p=g[1],E=Object(D.h)();Object(r.useEffect)((function(){t&&X.a.get("/api/parts/".concat(t,"/")).then((function(e){var t=e.data;o(t.name),d(t.description)})).catch((function(e){console.error(e)}))}),[t]);return c.a.createElement(U.a,{column:!0,space:"around",styles:{gridColumn:"1 / span 4"}},c.a.createElement(q.a,{placeholder:"Enter Part Name...",fluid:!0,styles:{fontSize:"2em"},value:i,onChange:function(e,t){o(t.value)}}),c.a.createElement(ve.a,{placeholder:"Enter Description...",design:{height:"80%"},value:s,onChange:function(e,t){d(t.value)}}),c.a.createElement(U.a,{space:"around"},c.a.createElement(Q.a,{content:"Save",primary:!0,onClick:function(){var e=![void 0,null].includes(t),n=e?"/api/parts/".concat(t,"/"):"/api/parts/";X()({method:e?"PUT":"POST",url:n,data:{name:i,description:s}}).then((function(e){var t=e.data;E.push("/parts/detail/capturePhotos?partId=".concat(t.id))})).catch((function(e){p(JSON.stringify(e.response.data))}))},disabled:!i||!s}),c.a.createElement(Q.a,{content:"Cancel"})),!!f&&c.a.createElement(ne.a,{danger:!0,content:f,dismissible:!0}))},at=function(e){var t=e.partId;return c.a.createElement(U.a,{column:!0,gap:"gap.small",styles:{gridColumn:"5 / span 8"}},t?c.a.createElement(rt,{partId:t}):null,c.a.createElement(D.e,null,c.a.createElement(D.c,{path:"/parts/detail/capturePhotos"},c.a.createElement(Xe,{partId:parseInt(t,10)})),c.a.createElement(D.c,{path:"/parts/detail/uploadPhotos"},c.a.createElement(Ze,{partId:parseInt(t,10)}))))},rt=function(e){var t=e.partId,n=[{key:"uploadPhotos",as:P.b,to:"/parts/detail/uploadPhotos?partId=".concat(t),content:"Upload Photos"},{key:"capturePhotos",as:P.b,to:"/parts/detail/capturePhotos?partId=".concat(t),content:"Capture Photo"}],a=Object(D.i)().pathname,r=n.findIndex((function(e){return e.to.split("?")[0]===a}));return c.a.createElement(ye.a,{items:n,activeIndex:r,pointing:!0,primary:!0})},ct=function(e){return console.error(e),{type:"REQUEST_LOCATION_FAILURE"}},it=function(){var e=Object(l.b)(),t=Object(l.c)((function(e){return e.locations}));return Object(r.useEffect)((function(){e((function(e){return fetch("/api/locations/").then((function(e){return e.json()})).then((function(t){e(function(e){return{type:"GET_LOCATION_SUCCESS",payload:e}}(t))})).catch((function(t){e(ct(t))}))}))}),[e]),c.a.createElement(U.a,{column:!0,gap:"gap.large",padding:"padding.medium",styles:{height:"100%"}},c.a.createElement(V.a,{columns:"8",styles:{height:"75%"}},t.map((function(e,t){return c.a.createElement(z,{key:t,to:"/locations/detail?name=".concat(e.name),defaultSrc:"/icons/defaultLocation.png",width:"100px",height:"100px",label:e.name})}))),c.a.createElement(U.a,{hAlign:"end"},c.a.createElement(P.b,{to:"/locations/register"},c.a.createElement(Q.a,{primary:!0,fluid:!0,circular:!0,content:c.a.createElement(W.AddIcon,{size:"largest",circular:!0}),style:{width:"6em",height:"6em"}}))))},ot=n(230),lt=function(){var e=Object(l.b)(),t=Object(D.h)(),n=Object(r.useState)(""),a=Object(B.a)(n,2),i=a[0],o=a[1],u=Object(r.useState)(""),s=Object(B.a)(u,2),d=s[0],m=s[1],g=Object(r.useState)(""),f=Object(B.a)(g,2),p=f[0],E=f[1];return c.a.createElement(c.a.Fragment,null,c.a.createElement(F.a,{size:"larger",weight:"semibold"},"Register Location"),c.a.createElement(ot.a,{color:"black"}),c.a.createElement(V.a,{columns:"15% 3fr 2fr",styles:{height:"60%"}},c.a.createElement(U.a,{column:!0,gap:"gap.large"},c.a.createElement(z,{defaultSrc:"/icons/defaultLocation.png",width:"100px",height:"100px"}),c.a.createElement(F.a,null,"Coordinates:"),c.a.createElement(F.a,null,"Description:")),c.a.createElement(U.a,{column:!0,gap:"gap.large"},c.a.createElement(q.a,{styles:{paddingTop:"10px",minHeight:"100px"},placeholder:"Location Name",value:i,onChange:function(e,t){return o(t.value)}}),c.a.createElement(q.a,{value:d,onChange:function(e,t){return m(t.value)}}),c.a.createElement(ve.a,{styles:{height:"60%"},value:p,onChange:function(e,t){return E(t.value)}}))),c.a.createElement(U.a,{gap:"gap.medium",padding:"padding.medium"},c.a.createElement(Q.a,{primary:!0,disabled:[i,d,p].includes(""),onClick:function(){var n;e((n={name:i,coordinates:d,description:p},function(e){return fetch("/api/locations/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then((function(e){return e.json()})).then((function(t){e(function(e){return{type:"POST_LOCATION_SUCCESS",payload:e}}(t))})).catch((function(t){e(ct(t))}))})),t.push("/locations")},content:"Save"}),c.a.createElement(Q.a,{content:"Cancel",onClick:function(){t.push("/locations")}})))},ut=function(){var e=de().get("name"),t=Object(l.c)((function(t){return t.locations.find((function(t){return t.name===e}))}));return c.a.createElement(c.a.Fragment,null,c.a.createElement(F.a,{size:"larger",weight:"semibold"},"Details"),c.a.createElement(ot.a,{color:"black"}),c.a.createElement(V.a,{columns:"15% 3fr 2fr",styles:{height:"60%"}},c.a.createElement(U.a,{column:!0,gap:"gap.large"},c.a.createElement(z,{defaultSrc:"/icons/defaultLocation.png",width:"100px",height:"100px"}),c.a.createElement(F.a,null,"Coordinates:"),c.a.createElement(F.a,null,"Description:")),c.a.createElement(U.a,{column:!0,gap:"gap.large"},c.a.createElement(F.a,{styles:{paddingTop:"10px",minHeight:"100px"}},t.name),c.a.createElement(F.a,null,t.coordinates),c.a.createElement(F.a,{styles:{height:"60%"}},t.description))))},st=n(493),dt=n(241),mt=n(258),gt=n(360),ft=(n(936),n(937),!1),pt=function(e){var t,n=e.confidenceLevel,a=e.labelImage,r=e.imageIndex,i=e.judgedImages,o=e.setJudgedImages,l=e.partId;return t=i.correct.indexOf(a.id)>=0?1:i.incorrect.indexOf(a.id)>=0?0:null,c.a.createElement(U.a,{hAlign:"center",padding:"padding.medium"},c.a.createElement("div",{style:{margin:"0.2em"}},c.a.createElement(Ve,{labelImage:a,width:100,height:100})),c.a.createElement(U.a,{column:!0,gap:"gap.smaller",styles:{width:"30%"}},c.a.createElement(F.a,{truncated:!0},"Confidence Level: ",n,"%"),c.a.createElement(U.a,{column:!0},c.a.createElement(dt.a,{checkedValue:t,onCheckedValueChange:function(e,t){o((function(e){if(1===t.value){var n=e.incorrect.indexOf(a.id),r=e.correct.indexOf(a.id);n>=0&&e.incorrect.splice(n,1),-1===r&&e.correct.push(a.id)}if(0===t.value){var c=e.correct.indexOf(a.id),i=e.incorrect.indexOf(a.id);c>=0&&e.correct.splice(c,1),-1===i&&e.incorrect.push(a.id)}return Object(I.a)({},e)}))},items:[{key:"1",label:"Yes",value:1},{key:"0",label:"No",value:0}]})),c.a.createElement(Be,{imageIndex:r,isRelabel:!0,partId:l,trigger:c.a.createElement(Q.a,{primary:!0,content:"Identify",disabled:!t})})))},Et=function(){var e=Object(l.b)(),t=Object(l.c)((function(e){return{projectData:e.project.data,images:e.images}})),n=t.projectData,a=t.images,i=se(),o=Object(r.useMemo)((function(){return 0===i.length||0===n.parts.length?[]:n.parts.map((function(e){var t=i.find((function(t){return t.id===e}));return{header:t.name,content:{key:t.id}}}))}),[i,n]),u=Object(r.useState)(null),s=Object(B.a)(u,2),d=s[0],m=s[1],g=Object(r.useState)([n.accuracyRangeMin,n.accuracyRangeMax]),f=Object(B.a)(g,2),p=f[0],E=f[1],h=Object(r.useState)(!1),b=Object(B.a)(h,2),v=b[0],y=b[1],O=Object(r.useState)({correct:[],incorrect:[]}),C=Object(B.a)(O,2),S=C[0],j=C[1],T=Object(r.useMemo)((function(){var e=Ge(a,{partId:d,isRelabel:!0}).map((function(e){return Object(I.a)({},e,{confidenceLevel:(1e3*e.confidence|0)/10})})).filter((function(e){return e.confidenceLevel>=p[0]&&e.confidenceLevel<=p[1]}));return ft&&(v?e.sort((function(e,t){return e.confidenceLevel-t.confidenceLevel})):e.sort((function(e,t){return t.confidenceLevel-e.confidenceLevel}))),e}),[p,v,a,d]);Object(r.useEffect)((function(){e(oe()),e(Pe())}),[e]);var x=o.find((function(e){return e.content.key===d}));return c.a.createElement("div",null,c.a.createElement(F.a,{size:"larger",weight:"semibold"},"Manual Identification"),c.a.createElement(ot.a,{color:"black"}),c.a.createElement(U.a,{column:!0,gap:"gap.medium",space:"between",styles:{height:"75vh",padding:"1em"}},c.a.createElement(V.a,{columns:"3",styles:{columnGap:"1em",justifyItems:"center"}},c.a.createElement(U.a,{vAlign:"center",gap:"gap.smaller"},c.a.createElement(F.a,{truncated:!0},"Select Part:"),c.a.createElement(Oe.a,{items:o,onChange:function(e,t){var n=t.value;if(null===n)m((function(e){return e}));else{var a=n.content.key;m(a)}},value:x})),c.a.createElement(U.a,{vAlign:"center",gap:"gap.smaller",styles:{width:"80%"}},c.a.createElement(F.a,null,"Confidence Level:"),c.a.createElement("div",{style:{width:"70%"}},c.a.createElement(gt.b,{value:p,allowCross:!1,onChange:function(e){return E(e)},handle:function(e){var t=e.value,n=e.dragging,a=e.index,r=Object(st.a)(e,["value","dragging","index"]);return c.a.createElement(mt.a,{prefixCls:"rc-slider-tooltip",overlay:"".concat(t,"%"),visible:n,placement:"top",key:a},c.a.createElement(gt.a,Object.assign({value:t},r)))}}))),c.a.createElement(U.a,{vAlign:"center"},c.a.createElement(F.a,{truncated:!0},"Sort:"),c.a.createElement(Q.a,{icon:v?c.a.createElement(W.ArrowDownIcon,null):c.a.createElement(W.ArrowUpIcon,null),styles:{color:ft?"#0094d8":"grey"},text:!0,iconOnly:!0,onClick:function(){ft=!0,y((function(e){return!e}))}}))),c.a.createElement(V.a,{columns:"2",styles:{width:"100%",height:"80%",borderStyle:"solid",overflow:"scroll",borderWidth:"1px"}},T.map((function(e,t){return c.a.createElement(pt,{key:t,confidenceLevel:e.confidenceLevel,imageIndex:t,labelImage:e,judgedImages:S,setJudgedImages:j,partId:d})}))),c.a.createElement(Q.a,{content:"Update",styles:{width:"15%"},primary:!0,disabled:0===S.correct.length&&0===S.incorrect.length,onClick:function(){X()({method:"POST",url:"/api/relabel/update",data:S}).then((function(){e(Pe()),j({correct:[],incorrect:[]})})).catch((function(e){console.error(e)}))}})))},ht=function(){var e=Object(r.useState)([]),t=Object(B.a)(e,2),n=t[0],a=t[1],i=X.a.get("/api/parts/"),o=X.a.get("/api/images/");return Object(r.useEffect)((function(){X.a.all([i,o]).then(X.a.spread((function(){var e=arguments.length<=0?void 0:arguments[0],t=e.data,n=arguments.length<=1?void 0:arguments[1],r=n.data;a(t.map((function(e){var t;return Object(I.a)({},e,{images:null===(t=r.find((function(t){return Fe(t.part)===e.id})))||void 0===t?void 0:t.image})})))}))).catch((function(e){return console.error(e)}))}),[]),c.a.createElement("div",{style:{position:"relative",height:"100%"}},c.a.createElement(U.a,{gap:"gap.large",wrap:!0},n.map((function(e){return c.a.createElement(bt,{key:e.id,src:e.images,id:e.id,name:e.name})}))),c.a.createElement(Q.a,{primary:!0,fluid:!0,circular:!0,content:c.a.createElement(W.AddIcon,{size:"largest",circular:!0}),style:{width:100,height:100,position:"fixed",right:"100px",bottom:"100px"},as:P.b,to:"/parts/detail"}))},bt=function(e){var t=e.src,n=e.id,a=e.name;return c.a.createElement(U.a,{column:!0,hAlign:"center",gap:"gap.large",as:P.b,to:"/parts/detail/capturePhotos?partId=".concat(n)},c.a.createElement("div",{style:{width:"250px",height:"250px"}},c.a.createElement(G.a,{src:t,styles:{width:"100%",height:"100%",objectFit:"cover"}})),c.a.createElement(F.a,{size:"larger"},a))},vt=n(172),yt=function(){var e=Object(l.b)(),t=Object(l.c)((function(e){return e.project})),n=t.isLoading,a=t.error,i=t.data,o=i.id,u=i.camera,s=i.location,d=i.parts,m=i.needRetraining,g=i.accuracyRangeMin,f=i.accuracyRangeMax,p=i.maxImages,E=Ot("cameras"),h=Object(B.a)(E,4),b=h[0],v=h[1],y=h[2],O=h[3],C=Ot("parts",!0),S=Object(B.a)(C,4),j=S[0],T=S[1],x=S[2],A=S[3],_=Ot("locations"),w=Object(B.a)(_,4),R=w[0],k=w[1],L=w[2],N=w[3],M=Object(D.h)(),G=Object(r.useState)(!1),z=Object(B.a)(G,2),J=z[0],V=z[1];Object(r.useEffect)((function(){b||j||R||e(oe())}),[e,b,R,j]),Object(r.useEffect)((function(){s&&N(s),d.length&&A(d),u&&O(u)}),[u,s,d,O,N,A]);var H=function(t,n){e({type:"UPDATE_PROJECT_DATA",payload:Object(I.a)({},i,Object(Te.a)({},t,n))})};return c.a.createElement(c.a.Fragment,null,c.a.createElement(F.a,{size:"larger",weight:"semibold"},"Part Identification"),c.a.createElement(ot.a,{color:"black"}),a&&c.a.createElement(ne.a,{danger:!0,header:"Load Part Identification Error",content:"".concat(a.name,": ").concat(a.message)}),c.a.createElement(U.a,{column:!0,gap:"gap.large",design:{paddingTop:"30px"}},c.a.createElement(Ct,{moduleName:"cameras",to:"/cameras",value:y,setSelectedModuleItem:O,items:v,isMultiple:!1}),c.a.createElement(Ct,{moduleName:"parts",to:"/parts",value:x,setSelectedModuleItem:A,items:T,isMultiple:!0}),c.a.createElement(Ct,{moduleName:"locations",to:"/locations",value:L,setSelectedModuleItem:N,items:k,isMultiple:!1}),c.a.createElement(vt.a,{label:"Set up retraining",checked:m,onChange:function(e,t){var n=t.checked;return H("needRetraining",n)}}),c.a.createElement(F.a,{disabled:!m},"Accuracy Range"),c.a.createElement(F.a,{disabled:!m},"Minimum:"," ",c.a.createElement(q.a,{type:"number",disabled:!m,inline:!0,value:g,onChange:function(e,t){var n=t.value;return H("accuracyRangeMin",n)}}),"%"),c.a.createElement(F.a,{disabled:!m},"Maximum:"," ",c.a.createElement(q.a,{type:"number",disabled:!m,inline:!0,value:f,onChange:function(e,t){var n=t.value;return H("accuracyRangeMax",n)}}),"%"),c.a.createElement(F.a,{disabled:!m},"Maximum Images:"," ",c.a.createElement(q.a,{type:"number",disabled:!m,inline:!0,value:p,onChange:function(e,t){var n=t.value;V(n<15),H("maxImages",n)}}),J&&c.a.createElement(F.a,{error:!0},"Cannot be less than 15")),c.a.createElement(P.b,{to:""},"Advanced Configuration"),c.a.createElement(Q.a,{content:"Configure",primary:!0,onClick:function(){e(function(e,t,n,a){return function(r,c){var i=null===e,o=i?"/api/projects/":"/api/projects/".concat(e,"/");r({type:"POST_PROJECT_REQUEST"});var l=c().project.data;return X()(o,{data:{location:"http://localhost:8000/api/locations/".concat(t.id,"/"),parts:n.map((function(e){return"http://localhost:8000/api/parts/".concat(e.id,"/")})),camera:"http://localhost:8000/api/cameras/".concat(a.id,"/"),download_uri:l.modelUrl,needRetraining:l.needRetraining,accuracyRangeMin:l.accuracyRangeMin,accuracyRangeMax:l.accuracyRangeMax,maxImages:l.maxImages},method:i?"POST":"PUT",headers:{"Content-Type":"application/json"}}).then((function(e){var t=e.data;return r({type:"POST_PROJECT_SUCCESS"}),le(t.id),t.id})).catch((function(e){r({type:"POST_PROJECT_FALIED",error:e})}))}}(o,L,x,y)).then((function(e){"undefined"!==typeof e&&M.push("/cameras/detail?name=".concat(y.name))})).catch((function(e){return e}))},disabled:!y||!L||!x||n,loading:n})))};function Ot(e,t){var n=Object(r.useRef)([]),a=Object(r.useState)([]),c=Object(B.a)(a,2),i=c[0],o=c[1],l=Object(r.useState)(t?[]:null),u=Object(B.a)(l,2),s=u[0],d=u[1],m=Object(r.useState)(!0),g=Object(B.a)(m,2),f=g[0],p=g[1];return Object(r.useEffect)((function(){p(!0),fetch("/api/".concat(e,"/")).then((function(e){return e.json()})).then((function(e){o(e.map((function(e){return{header:e.name,content:{key:e.id}}}))),n.current=e,p(!1)})).catch((function(e){p(!1),console.error(e)}))}),[e]),[f,i,s,Object(r.useCallback)((function(e){if(Array.isArray(e)){var t=e.reduce((function(e,t){var a=n.current.find((function(e){return e.id.toString(10)===t.toString()}));return a&&e.push(a),e}),[]);d(t)}else{var a=n.current.find((function(t){return t.id.toString(10)===e.toString()}));a&&d(a)}}),[])]}var Ct=function(e){var t=e.moduleName,n=e.to,a=e.value,r=e.setSelectedModuleItem,i=e.items,o=e.isMultiple;return c.a.createElement(U.a,{vAlign:"center",gap:"gap.medium"},c.a.createElement(F.a,{styles:{width:"150px"}},"Select ".concat(t)),c.a.createElement(Oe.a,{items:i,onChange:function(e,t){if(null===t.value)r((function(e){return e}));else if(Array.isArray(t.value)){var n=t.value.map((function(e){return e.content.key}));r(n)}else{var a=t.value.content.key;r(a)}},value:Ye(a),multiple:o}),c.a.createElement(P.b,{to:n},"Add ".concat(t)))},St=function(){var e=Object(r.useState)({id:null,key:"",namespace:"",iotHubConnectionString:"",deviceId:"",moduleId:""}),t=Object(B.a)(e,2),n=t[0],a=t[1],i=Object(r.useState)({success:!1,content:""}),o=Object(B.a)(i,2),l=o[0],u=o[1];Object(r.useEffect)((function(){X.a.get("/api/settings/").then((function(e){var t=e.data;t.length>0&&a({id:t[0].id,key:t[0].training_key,namespace:t[0].endpoint,iotHubConnectionString:t[0].iot_hub_connection_string,deviceId:t[0].device_id,moduleId:t[0].module_id})})).catch((function(e){console.error(e)}))}),[]);return c.a.createElement(U.a,{column:!0,gap:"gap.large"},c.a.createElement("h1",null,"Setting"),c.a.createElement(ot.a,{color:"grey"}),c.a.createElement(F.a,{size:"large",weight:"bold"},"Azure Cognitive Services Settings:"," "),c.a.createElement(U.a,{vAlign:"center"},c.a.createElement(F.a,{size:"large",design:{width:"300px"}},"Namespace:"),c.a.createElement(q.a,{value:n.namespace,onChange:function(e,t){var n=t.value;return a((function(e){return Object(I.a)({},e,{namespace:n})}))}})),c.a.createElement(U.a,{vAlign:"center"},c.a.createElement(F.a,{size:"large",design:{width:"300px"}},"Key:"),c.a.createElement(q.a,{value:n.key,onChange:function(e,t){var n=t.value;return a((function(e){return Object(I.a)({},e,{key:n})}))}})),c.a.createElement(U.a,{vAlign:"center"},c.a.createElement(F.a,{size:"large",design:{width:"300px"}},"Iot Hub Connection String:"),c.a.createElement(q.a,{value:n.iotHubConnectionString,onChange:function(e,t){var n=t.value;return a((function(e){return Object(I.a)({},e,{iotHubConnectionString:n})}))}})),c.a.createElement(U.a,{vAlign:"center"},c.a.createElement(F.a,{size:"large",design:{width:"300px"}},"Device ID:"),c.a.createElement(q.a,{value:n.deviceId,onChange:function(e,t){var n=t.value;return a((function(e){return Object(I.a)({},e,{deviceId:n})}))}})),c.a.createElement(U.a,{vAlign:"center"},c.a.createElement(F.a,{size:"large",design:{width:"300px"}},"Module ID:"),c.a.createElement(q.a,{value:n.moduleId,onChange:function(e,t){var n=t.value;return a((function(e){return Object(I.a)({},e,{moduleId:n})}))}})),c.a.createElement(U.a,{gap:"gap.large"},c.a.createElement(Q.a,{primary:!0,onClick:function(){var e=null===n.id,t=e?"/api/settings/":"/api/settings/".concat(n.id,"/");X()(t,{data:{training_key:n.key,endpoint:n.namespace,iot_hub_connection_string:n.iotHubConnectionString,device_id:n.deviceId,module_id:n.moduleId},method:e?"POST":"PUT"}).then((function(){u({success:!0,content:"Save Setting Successfully"})})).catch((function(e){u({success:!1,content:"Fail to save settings: /n ".concat(e.toString())})}))},disabled:Object.values(n).some((function(e){return!e}))},"Save"),c.a.createElement(Q.a,{primary:!0,as:P.b,to:"/"},"Cancel")),l.content?c.a.createElement(ne.a,{success:l.success,danger:!l.success,content:l.content,dismissible:!0}):null)},It=function(){return c.a.createElement(D.e,null,c.a.createElement(D.c,{path:"/manual",component:Et}),c.a.createElement(D.c,{path:"/locations/register",component:lt}),c.a.createElement(D.c,{path:"/locations/detail",component:ut}),c.a.createElement(D.c,{path:"/locations",component:it}),c.a.createElement(D.c,{path:"/cameras/detail",component:be}),c.a.createElement(D.c,{path:"/cameras",component:Z}),c.a.createElement(D.c,{path:"/parts/detail",component:tt}),c.a.createElement(D.c,{path:"/parts",component:ht}),c.a.createElement(D.c,{path:"/partIdentification",component:yt}),c.a.createElement(D.c,{path:"/setting",component:St}),c.a.createElement(D.c,{path:"/",component:J}))},jt=n(235),Tt=function(){var e=Object(D.i)().pathname;if("/"===e)return c.a.createElement(F.a,{color:"black"},"Home");var t=e.split("/").slice(1).reduce((function(e,t){var n=function(e){switch(e){case"cameras":return"Camera";case"parts":return"Part";case"locations":return"Location";case"register":return"Register";case"label":return"Label";case"manual":return"Identify Manually";case"detail":return"Details";case"partIdentification":return"Job Configuration";case"capturePhotos":case"uploadPhotos":return null;default:return"string"===typeof e?"Details":null}}(t);if(!n)return e;var a="".concat(e.path,"/").concat(t);return{pathTitles:[].concat(Object(S.a)(e.pathTitles),[{title:n,to:a}]),path:a}}),{pathTitles:[],path:""}).pathTitles;return c.a.createElement(U.a,{gap:"gap.smaller"},c.a.createElement(P.b,{to:"/",style:{color:"#0094d8",textDecoration:"none"}},c.a.createElement(F.a,null,"Home")),t.map((function(e,t,n){return c.a.createElement(r.Fragment,{key:t},c.a.createElement(F.a,{color:"black"},">"),t===n.length-1?c.a.createElement(F.a,{color:"black"},e.title):c.a.createElement(P.b,{to:"".concat(e.to),style:{color:"#0094d8",textDecoration:"none"}},c.a.createElement(F.a,null,e.title)))})))},xt=function(e){var t=e.children;return c.a.createElement(V.a,{columns:"60px auto",rows:"50px auto",design:{height:"100vh"},styles:{justifyContent:"stretch"}},c.a.createElement(At,null),c.a.createElement(_t,{styles:{gridColumn:"1 / span 1",gridRow:"2 / span 1",boxShadow:"1px 0px 10px 0px rgba(0,0,0,0.75)",zIndex:1}}),c.a.createElement(jt.a,{styles:{gridColumn:"span 1",padding:"30px"}},c.a.createElement(Tt,null),t))},At=function(){return c.a.createElement(U.a,{space:"between",vAlign:"center",padding:"padding.medium",styles:{backgroundColor:"#0094d8",gridColumn:"1 / span 2",boxShadow:"0px 1px 10px 0px rgba(0,0,0,0.75)",zIndex:2,fontSize:"20px",padding:"0.5em 1em"}},c.a.createElement(U.a,{gap:"gap.large",vAlign:"center"},c.a.createElement(W.MenuIcon,{size:"large",styles:{color:"white"}}),c.a.createElement(P.c,{to:"/",style:{textDecoration:"none"}},c.a.createElement(F.a,{color:"white"},"Vision on Edge"))),c.a.createElement(U.a,{vAlign:"center",hAlign:"end",gap:"gap.medium",styles:{height:"100%"}},c.a.createElement(P.b,{to:"/setting",style:{height:"100%"}},c.a.createElement(G.a,{styles:{height:"100%"},src:"/icons/setting.png"})),c.a.createElement(F.a,{color:"white"},"User")))},_t=function(e){var t=e.styles;return c.a.createElement(jt.a,{color:"grey",inverted:!0,styles:Object(I.a)({},t,{padding:0,paddingTop:"1em"})},c.a.createElement(U.a,{column:!0,gap:"gap.large",hAlign:"center"},c.a.createElement(wt,{src:"/icons/location.png",to:"/locations"}),c.a.createElement(wt,{src:"/icons/camera.png",to:"/cameras"}),c.a.createElement(wt,{src:"/icons/part.png",to:"/parts"}),c.a.createElement(wt,{src:"/icons/manual.png",to:"/manual"}),c.a.createElement(wt,{src:"/icons/partIdentification.png",to:"/partIdentification"})))},wt=function(e){var t=e.src,n=e.to;return c.a.createElement(P.c,{to:n,style:{display:"flex",justifyContent:"center",padding:"0.8em"},activeStyle:{backgroundColor:"rgba(250, 83, 5, 0.5)"}},c.a.createElement(G.a,{src:t,design:{width:"100%"}}))},Rt={siteVariables:{colors:{brand:{50:"#f3fafd",100:"#d1ecf9",200:"#aadcf4",300:"#5dbce8",400:"#1ba0dd",500:"#0094d8",600:"#0085c3",700:"#0071a5",800:"#005379",900:"black"}},colorScheme:{brand:{foreground:"#0094d8",background:"#0094d8",border:"#E1DFDD",shadow:"#000",foregroundHover:"#0094d8",backgroundHover:"#0085c3",borderHover:"#5dbce8",shadowHover:"#000",foregroundActive:"#0094d8",backgroundActive:"#0094d8",borderActive:"#E1DFDD",shadowActive:void 0,foregroundFocus:"#0094d8",backgroundFocus:"#0094d8",borderFocus:"#000",shadowFocus:void 0,foregroundPressed:"#0071a5",backgroundPressed:"#0071a5",borderPressed:"#5dbce8",shadowPressed:void 0,foregroundDisabled:"#C8C6C4",backgroundDisabled:"#EDEBE9",borderDisabled:"#EDEBE9",shadowDisabled:void 0,foreground1:"#0094d8",foreground2:"#0085c3",foreground3:"#aadcf4",foreground4:"#fff",background1:"#d1ecf9",background2:"#005379",background3:"#373644",background4:"#0071a5",border1:"#aadcf4",border2:"#5dbce8",foregroundHover1:"#fff",foregroundHover2:"#aadcf4",backgroundHover1:"#f3fafd",foregroundPressed1:"#fff",foregroundActive1:"#0094d8",foregroundActive2:"#aadcf4",backgroundActive1:"#0094d8",borderActive1:"#aadcf4",borderActive2:"#5dbce8",foregroundFocus1:"#0094d8",foregroundFocus2:"#0085c3",foregroundFocus3:"#aadcf4",foregroundFocus4:"#fff",backgroundFocus1:"#d1ecf9",backgroundFocus2:"#005379",backgroundFocus3:"#373644",borderFocusWithin:"#fff",borderFocus1:"#0094d8",foregroundDisabled1:"#C8C6C4",backgroundDisabled1:"#EDEBE9"}}}},kt=Object(W.mergeThemes)(W.themes.teams,Rt),Lt=function(){return c.a.createElement(M.a,{theme:kt},c.a.createElement(P.a,null,c.a.createElement("div",{className:"App"},c.a.createElement(xt,null,c.a.createElement(It,null)))))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var Nt=N(O),Pt=Nt.store,Mt=Nt.persistor;o.a.render(c.a.createElement(c.a.StrictMode,null,c.a.createElement(l.a,{store:Pt},c.a.createElement(u.a,{loading:c.a.createElement("div",null,"Loading.."),persistor:Mt},c.a.createElement(Lt,null)))),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[688,1,2]]]);
//# sourceMappingURL=main.4646d30d.chunk.js.map | 33,156 | 66,264 | 0.703146 |
15f3b84bf0990e6fd28c8f09a558bdf4e325cdc1 | 224 | js | JavaScript | lib/webix/sources/views/daterangepicker.js | FarfallaHu/brainchop | 9963e258cb5ad973a6e0991a88b1fe0081cb0855 | [
"MIT"
] | 16 | 2021-12-16T19:25:17.000Z | 2022-03-30T14:48:04.000Z | lib/webix/sources/views/daterangepicker.js | FarfallaHu/brainchop | 9963e258cb5ad973a6e0991a88b1fe0081cb0855 | [
"MIT"
] | 1 | 2022-03-30T00:03:38.000Z | 2022-03-30T00:03:38.000Z | lib/webix/sources/views/daterangepicker.js | FarfallaHu/brainchop | 9963e258cb5ad973a6e0991a88b1fe0081cb0855 | [
"MIT"
] | 2 | 2022-03-29T23:16:54.000Z | 2022-03-29T23:39:00.000Z |
import {protoUI} from "../ui/core";
import template from "../views/template";
protoUI({ name:"daterangepicker", defaults:{
template:"GPL version doesn't support daterangepicker <br> You need Webix PRO"
}}, template.view); | 32 | 79 | 0.727679 |
15f3dc7c0f19a1ab10b376a5f99c341a83d23280 | 1,684 | js | JavaScript | src/components/login/login.js | aryan-basu/Resturant-manager | 1be5d1a2a3db3215a23d35508330d667eee6db43 | [
"MIT"
] | null | null | null | src/components/login/login.js | aryan-basu/Resturant-manager | 1be5d1a2a3db3215a23d35508330d667eee6db43 | [
"MIT"
] | null | null | null | src/components/login/login.js | aryan-basu/Resturant-manager | 1be5d1a2a3db3215a23d35508330d667eee6db43 | [
"MIT"
] | null | null | null | import React from 'react'
import {useHistory} from 'react-router-dom';
import StyledFirebaseAuth from "react-firebaseui/StyledFirebaseAuth";
import firebase from 'firebase';
function login(props) {
var uiConfig = {
signInFlow: "popup",
signInSuccessUrl: '/dashboard',
signInOptions: [
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.GithubAuthProvider.PROVIDER_ID
],
tosUrl: '<your-tos-url>',
// Privacy policy url.
privacyPolicyUrl: '<your-privacy-policy-url>'
};
return (
<div className="container">
<div className="right-side">
<div className="login-head">LOG IN</div>
{/* <div className="form">
<form>
<div className="input">
<input placeholder="Username" />
</div>
<div className="input">
<input placeholder="Password" />
</div>
<div className="login-button">
<button type="submit">LOG IN</button>
</div>
</form>
</div> */ }
<div>
<i class="fas fa-phone-alt"></i>
</div>
<StyledFirebaseAuth uiConfig={uiConfig} firebaseAuth={firebase.auth()} />
{/* <div className="signup">
Don't Have an account, <Link to='/Signup'>Sign Up</Link>
</div> */}
</div>
</div>
)
}
export default login | 31.185185 | 89 | 0.466746 |
15f3f386b4e4d9d55ff47d84d876819c44b0a754 | 1,357 | js | JavaScript | frontend-web/src/itemHealth.js | bmusuko/bulzen | 9ca66321931b6c17f608d90b7900bf803320335b | [
"MIT"
] | null | null | null | frontend-web/src/itemHealth.js | bmusuko/bulzen | 9ca66321931b6c17f608d90b7900bf803320335b | [
"MIT"
] | null | null | null | frontend-web/src/itemHealth.js | bmusuko/bulzen | 9ca66321931b6c17f608d90b7900bf803320335b | [
"MIT"
] | null | null | null | import React from 'react'
import { Chart, Doughnut } from 'react-chartjs-2';
const option = {
legend: {
display: false
},
tooltips: {enabled: false},
hover: {mode: null},
}
class Health extends React.Component{
constructor(props){
super(props);
console.log(this.props)
this.state = {
labels : ['a', 'b'],
datasets : [{
data: [this.props.health,100-this.props.health],
backgroundColor:[
(this.props.health >= 70) ? '#4CAF50' :
this.props.health >=40 ? 'rgba(253, 186, 53,1)' : 'rgba(255, 0, 90,1)',
'white'
]
}]
}
}
render(){
return(
<div>
<h2 style={{textAlign:'center'}}>Health Status</h2>
<Doughnut data={{
labels: this.state.labels,
datasets: this.state.datasets
}} options={option}
/>
<h3 style={{textAlign:'center',fontWeight:'bold', color:
(this.props.health >= 70) ? '#4CAF50' :
this.props.health >=40 ? 'rgba(253, 186, 53,1)' : 'rgba(255, 0, 90,1)'
}}>{this.props.health}%</h3>
</div>
)
}
}
export default Health | 29.5 | 91 | 0.44731 |
15f412733be0fbab9758ea2a3096d1529290d9d6 | 990 | js | JavaScript | modules/blog/client/config/blog.client.menu.js | eugene-goldberg/Portal | 621df9c14d621b07ef40be2b5b12fe32ede8a874 | [
"MIT"
] | null | null | null | modules/blog/client/config/blog.client.menu.js | eugene-goldberg/Portal | 621df9c14d621b07ef40be2b5b12fe32ede8a874 | [
"MIT"
] | null | null | null | modules/blog/client/config/blog.client.menu.js | eugene-goldberg/Portal | 621df9c14d621b07ef40be2b5b12fe32ede8a874 | [
"MIT"
] | null | null | null | (function() {
'use strict';
angular
.module('app.blog')
.run(coreMenu);
coreMenu.$inject = ['Menus'];
//function coreMenu(Menus){
//
// Menus.addMenuItem('sidebar', {
// title: 'Blog',
// state: 'app.blog',
// type: 'dropdown',
// iconClass: 'icon-pencil',
// position: 10,
// roles: ['*']
// });
//
// Menus.addSubMenuItem('sidebar', 'app.blog', {
// title: 'Blog',
// state: 'app.blog'
// });
// Menus.addSubMenuItem('sidebar', 'app.blog', {
// title: 'Post',
// state: 'app.blog-post'
// });
// Menus.addSubMenuItem('sidebar', 'app.blog', {
// title: 'Articles',
// state: 'app.articles'
// });
// Menus.addSubMenuItem('sidebar', 'app.blog', {
// title: 'Article View',
// state: 'app.article-view'
// });
//}
})();
| 25.384615 | 55 | 0.424242 |
15f4e1f2d4e9180b49a1449cd7d44a7663736624 | 2,179 | js | JavaScript | packages/build/plugins.js | svewag/podlove-ui | 67032b638a6c0d5a41d8db557ee6283db412afe1 | [
"MIT"
] | null | null | null | packages/build/plugins.js | svewag/podlove-ui | 67032b638a6c0d5a41d8db557ee6283db412afe1 | [
"MIT"
] | null | null | null | packages/build/plugins.js | svewag/podlove-ui | 67032b638a6c0d5a41d8db557ee6283db412afe1 | [
"MIT"
] | null | null | null | const webpack = require('webpack')
const { VueLoaderPlugin } = require('vue-loader')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const WebpackAutoInject = require('webpack-auto-inject-version')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const Jarvis = require('webpack-jarvis')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const CopyPlugin = require('copy-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const SWPrecachePlugin = require('sw-precache-webpack-plugin')
const { prepend } = require('./utils')
const vue = () => new VueLoaderPlugin()
const css = ({ filename = '[name].css', prefix = '' } = {}) =>
new MiniCssExtractPlugin({
filename: prepend(filename, prefix)
})
const minifyCss = () => new OptimizeCSSAssetsPlugin({})
const version = () => new WebpackAutoInject({ SILENT: true })
const base = input =>
new webpack.DefinePlugin({
BASE: JSON.stringify(input)
})
const html = ({ filename, template, chunks, exclude, base, files, sort, inject }) =>
new HtmlWebpackPlugin({
filename,
template,
chunksSortMode: sort || 'none',
chunks,
base,
files,
inject: inject || true,
excludeChunks: exclude
})
const jarvis = (port = 1337) => new Jarvis({ port })
const bundleAnalyzer = () =>
new BundleAnalyzerPlugin({
analyzerMode: 'static',
openAnalyzer: false
})
const hmr = () => new webpack.HotModuleReplacementPlugin()
const env = (data = {}) =>
new webpack.DefinePlugin(
Object.keys(data).reduce(
(result, key) =>
Object.assign({}, result, {
[key]: JSON.stringify(data[key])
}),
{}
)
)
const copy = (patterns = [], options = {}) => new CopyPlugin({ patterns, options })
const friendlyErrors = () => new FriendlyErrorsPlugin()
const serviceWorkerCache = config => new SWPrecachePlugin(config)
module.exports = {
vue,
css,
minifyCss,
version,
base,
html,
jarvis,
bundleAnalyzer,
hmr,
env,
copy,
friendlyErrors,
serviceWorkerCache
}
| 25.635294 | 84 | 0.678293 |
15f55b1ddffad643ed6f8b314364ababbac66352 | 57,521 | js | JavaScript | public/js/raphael-min.js | mortezarajabi/sib | 14ab233308652bc8bee35c8a92b7f4e18069fd50 | [
"MIT"
] | null | null | null | public/js/raphael-min.js | mortezarajabi/sib | 14ab233308652bc8bee35c8a92b7f4e18069fd50 | [
"MIT"
] | null | null | null | public/js/raphael-min.js | mortezarajabi/sib | 14ab233308652bc8bee35c8a92b7f4e18069fd50 | [
"MIT"
] | null | null | null | /*
* Raphael 1.3.1 - JavaScript Vector Library
*
* Copyright (c) 2008 - 2009 Dmitry Baranovskiy (http://raphaeljs.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
Raphael=(function(){var a=/[, ]+/,aO=/^(circle|rect|path|ellipse|text|image)$/,L=document,au=window,l={was:"Raphael" in au,is:au.Raphael},an=function(){if(an.is(arguments[0],"array")){var d=arguments[0],e=w[aW](an,d.splice(0,3+an.is(d[0],al))),S=e.set();for(var R=0,a0=d[m];R<a0;R++){var E=d[R]||{};aO.test(E.type)&&S[f](e[E.type]().attr(E));}return S;}return w[aW](an,arguments);},aT=function(){},aL="appendChild",aW="apply",aS="concat",at="",am=" ",z="split",F="click dblclick mousedown mousemove mouseout mouseover mouseup"[z](am),Q="hasOwnProperty",az="join",m="length",aY="prototype",aZ=String[aY].toLowerCase,ab=Math,g=ab.max,aI=ab.min,al="number",aA="toString",aw=Object[aY][aA],aQ={},aM=ab.pow,f="push",aU=/^(?=[\da-f]$)/,c=/^url\(['"]?([^\)]+)['"]?\)$/i,x=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgb\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|rgb\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\)|hs[bl]\(\s*([\d\.]+\s*,\s*[\d\.]+\s*,\s*[\d\.]+)\s*\)|hs[bl]\(\s*([\d\.]+%\s*,\s*[\d\.]+%\s*,\s*[\d\.]+%)\s*\))\s*$/i,O=ab.round,v="setAttribute",W=parseFloat,G=parseInt,aN=String[aY].toUpperCase,j={"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'14px "Arial"',"font-family":'"Arial"',"font-size":"14","font-style":"normal","font-weight":800,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},Z={along:"along","clip-rect":"csv",cx:al,cy:al,fill:"colour","fill-opacity":al,"font-size":al,height:al,opacity:al,path:"path",r:al,rotation:"csv",rx:al,ry:al,scale:"csv",stroke:"colour","stroke-opacity":al,"stroke-width":al,translation:"csv",width:al,x:al,y:al},aP="replace";an.version="1.3.1";an.type=(au.SVGAngle||L.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML");if(an.type=="VML"){var ag=document.createElement("div");ag.innerHTML="<!--[if vml]><br><br><![endif]-->";if(ag.childNodes[m]!=2){return null;}}an.svg=!(an.vml=an.type=="VML");aT[aY]=an[aY];an._id=0;an._oid=0;an.fn={};an.is=function(e,d){d=aZ.call(d);return((d=="object"||d=="undefined")&&typeof e==d)||(e==null&&d=="null")||aZ.call(aw.call(e).slice(8,-1))==d;};an.setWindow=function(d){au=d;L=au.document;};var aD=function(e){if(an.vml){var d=/^\s+|\s+$/g;aD=aj(function(R){var S;R=(R+at)[aP](d,at);try{var a0=new ActiveXObject("htmlfile");a0.write("<body>");a0.close();S=a0.body;}catch(a2){S=createPopup().document.body;}var i=S.createTextRange();try{S.style.color=R;var a1=i.queryCommandValue("ForeColor");a1=((a1&255)<<16)|(a1&65280)|((a1&16711680)>>>16);return"#"+("000000"+a1[aA](16)).slice(-6);}catch(a2){return"none";}});}else{var E=L.createElement("i");E.title="Rapha\xebl Colour Picker";E.style.display="none";L.body[aL](E);aD=aj(function(i){E.style.color=i;return L.defaultView.getComputedStyle(E,at).getPropertyValue("color");});}return aD(e);};an.hsb2rgb=aj(function(a3,a1,a7){if(an.is(a3,"object")&&"h" in a3&&"s" in a3&&"b" in a3){a7=a3.b;a1=a3.s;a3=a3.h;}var R,S,a8;if(a7==0){return{r:0,g:0,b:0,hex:"#000"};}if(a3>1||a1>1||a7>1){a3/=255;a1/=255;a7/=255;}var a0=~~(a3*6),a4=(a3*6)-a0,E=a7*(1-a1),e=a7*(1-(a1*a4)),a9=a7*(1-(a1*(1-a4)));R=[a7,e,E,E,a9,a7,a7][a0];S=[a9,a7,a7,e,E,E,a9][a0];a8=[E,E,a9,a7,a7,e,E][a0];R*=255;S*=255;a8*=255;var a5={r:R,g:S,b:a8},d=(~~R)[aA](16),a2=(~~S)[aA](16),a6=(~~a8)[aA](16);d=d[aP](aU,"0");a2=a2[aP](aU,"0");a6=a6[aP](aU,"0");a5.hex="#"+d+a2+a6;return a5;},an);an.rgb2hsb=aj(function(d,e,a1){if(an.is(d,"object")&&"r" in d&&"g" in d&&"b" in d){a1=d.b;e=d.g;d=d.r;}if(an.is(d,"string")){var a3=an.getRGB(d);d=a3.r;e=a3.g;a1=a3.b;}if(d>1||e>1||a1>1){d/=255;e/=255;a1/=255;}var a0=g(d,e,a1),i=aI(d,e,a1),R,E,S=a0;if(i==a0){return{h:0,s:0,b:a0};}else{var a2=(a0-i);E=a2/a0;if(d==a0){R=(e-a1)/a2;}else{if(e==a0){R=2+((a1-d)/a2);}else{R=4+((d-e)/a2);}}R/=6;R<0&&R++;R>1&&R--;}return{h:R,s:E,b:S};},an);var aE=/,?([achlmqrstvxz]),?/gi;an._path2string=function(){return this.join(",")[aP](aE,"$1");};function aj(E,e,d){function i(){var R=Array[aY].slice.call(arguments,0),a0=R[az]("\u25ba"),S=i.cache=i.cache||{},a1=i.count=i.count||[];if(S[Q](a0)){return d?d(S[a0]):S[a0];}a1[m]>=1000&&delete S[a1.shift()];a1[f](a0);S[a0]=E[aW](e,R);return d?d(S[a0]):S[a0];}return i;}an.getRGB=aj(function(d){if(!d||!!((d=d+at).indexOf("-")+1)){return{r:-1,g:-1,b:-1,hex:"none",error:1};}if(d=="none"){return{r:-1,g:-1,b:-1,hex:"none"};}!(({hs:1,rg:1})[Q](d.substring(0,2))||d.charAt()=="#")&&(d=aD(d));var S,i,E,a2,a3,a0=d.match(x);if(a0){if(a0[2]){a2=G(a0[2].substring(5),16);E=G(a0[2].substring(3,5),16);i=G(a0[2].substring(1,3),16);}if(a0[3]){a2=G((a3=a0[3].charAt(3))+a3,16);E=G((a3=a0[3].charAt(2))+a3,16);i=G((a3=a0[3].charAt(1))+a3,16);}if(a0[4]){a0=a0[4][z](/\s*,\s*/);i=W(a0[0]);E=W(a0[1]);a2=W(a0[2]);}if(a0[5]){a0=a0[5][z](/\s*,\s*/);i=W(a0[0])*2.55;E=W(a0[1])*2.55;a2=W(a0[2])*2.55;}if(a0[6]){a0=a0[6][z](/\s*,\s*/);i=W(a0[0]);E=W(a0[1]);a2=W(a0[2]);return an.hsb2rgb(i,E,a2);}if(a0[7]){a0=a0[7][z](/\s*,\s*/);i=W(a0[0])*2.55;E=W(a0[1])*2.55;a2=W(a0[2])*2.55;return an.hsb2rgb(i,E,a2);}a0={r:i,g:E,b:a2};var e=(~~i)[aA](16),R=(~~E)[aA](16),a1=(~~a2)[aA](16);e=e[aP](aU,"0");R=R[aP](aU,"0");a1=a1[aP](aU,"0");a0.hex="#"+e+R+a1;return a0;}return{r:-1,g:-1,b:-1,hex:"none",error:1};},an);an.getColor=function(e){var i=this.getColor.start=this.getColor.start||{h:0,s:1,b:e||0.75},d=this.hsb2rgb(i.h,i.s,i.b);i.h+=0.075;if(i.h>1){i.h=0;i.s-=0.2;i.s<=0&&(this.getColor.start={h:0,s:1,b:i.b});}return d.hex;};an.getColor.reset=function(){delete this.start;};an.parsePathString=aj(function(d){if(!d){return null;}var i={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=[];if(an.is(d,"array")&&an.is(d[0],"array")){e=av(d);}if(!e[m]){(d+at)[aP](/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,function(R,E,a1){var a0=[],S=aZ.call(E);a1[aP](/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,function(a3,a2){a2&&a0[f](+a2);});while(a0[m]>=i[S]){e[f]([E][aS](a0.splice(0,i[S])));if(!i[S]){break;}}});}e[aA]=an._path2string;return e;});an.findDotsAtSegment=function(e,d,be,bc,a0,R,a2,a1,a8){var a6=1-a8,a5=aM(a6,3)*e+aM(a6,2)*3*a8*be+a6*3*a8*a8*a0+aM(a8,3)*a2,a3=aM(a6,3)*d+aM(a6,2)*3*a8*bc+a6*3*a8*a8*R+aM(a8,3)*a1,ba=e+2*a8*(be-e)+a8*a8*(a0-2*be+e),a9=d+2*a8*(bc-d)+a8*a8*(R-2*bc+d),bd=be+2*a8*(a0-be)+a8*a8*(a2-2*a0+be),bb=bc+2*a8*(R-bc)+a8*a8*(a1-2*R+bc),a7=(1-a8)*e+a8*be,a4=(1-a8)*d+a8*bc,E=(1-a8)*a0+a8*a2,i=(1-a8)*R+a8*a1,S=(90-ab.atan((ba-bd)/(a9-bb))*180/ab.PI);(ba>bd||a9<bb)&&(S+=180);return{x:a5,y:a3,m:{x:ba,y:a9},n:{x:bd,y:bb},start:{x:a7,y:a4},end:{x:E,y:i},alpha:S};};var U=aj(function(a5){if(!a5){return{x:0,y:0,width:0,height:0};}a5=H(a5);var a2=0,a1=0,R=[],e=[],E;for(var S=0,a4=a5[m];S<a4;S++){E=a5[S];if(E[0]=="M"){a2=E[1];a1=E[2];R[f](a2);e[f](a1);}else{var a0=aC(a2,a1,E[1],E[2],E[3],E[4],E[5],E[6]);R=R[aS](a0.min.x,a0.max.x);e=e[aS](a0.min.y,a0.max.y);a2=E[5];a1=E[6];}}var d=aI[aW](0,R),a3=aI[aW](0,e);return{x:d,y:a3,width:g[aW](0,R)-d,height:g[aW](0,e)-a3};}),av=function(a0){var E=[];if(!an.is(a0,"array")||!an.is(a0&&a0[0],"array")){a0=an.parsePathString(a0);}for(var e=0,R=a0[m];e<R;e++){E[e]=[];for(var d=0,S=a0[e][m];d<S;d++){E[e][d]=a0[e][d];}}E[aA]=an._path2string;return E;},ad=aj(function(R){if(!an.is(R,"array")||!an.is(R&&R[0],"array")){R=an.parsePathString(R);}var a4=[],a6=0,a5=0,a9=0,a8=0,E=0;if(R[0][0]=="M"){a6=R[0][1];a5=R[0][2];a9=a6;a8=a5;E++;a4[f](["M",a6,a5]);}for(var a1=E,ba=R[m];a1<ba;a1++){var d=a4[a1]=[],a7=R[a1];if(a7[0]!=aZ.call(a7[0])){d[0]=aZ.call(a7[0]);switch(d[0]){case"a":d[1]=a7[1];d[2]=a7[2];d[3]=a7[3];d[4]=a7[4];d[5]=a7[5];d[6]=+(a7[6]-a6).toFixed(3);d[7]=+(a7[7]-a5).toFixed(3);break;case"v":d[1]=+(a7[1]-a5).toFixed(3);break;case"m":a9=a7[1];a8=a7[2];default:for(var a0=1,a2=a7[m];a0<a2;a0++){d[a0]=+(a7[a0]-((a0%2)?a6:a5)).toFixed(3);}}}else{d=a4[a1]=[];if(a7[0]=="m"){a9=a7[1]+a6;a8=a7[2]+a5;}for(var S=0,e=a7[m];S<e;S++){a4[a1][S]=a7[S];}}var a3=a4[a1][m];switch(a4[a1][0]){case"z":a6=a9;a5=a8;break;case"h":a6+=+a4[a1][a3-1];break;case"v":a5+=+a4[a1][a3-1];break;default:a6+=+a4[a1][a3-2];a5+=+a4[a1][a3-1];}}a4[aA]=an._path2string;return a4;},0,av),r=aj(function(R){if(!an.is(R,"array")||!an.is(R&&R[0],"array")){R=an.parsePathString(R);}var a3=[],a5=0,a4=0,a8=0,a7=0,E=0;if(R[0][0]=="M"){a5=+R[0][1];a4=+R[0][2];a8=a5;a7=a4;E++;a3[0]=["M",a5,a4];}for(var a1=E,a9=R[m];a1<a9;a1++){var d=a3[a1]=[],a6=R[a1];if(a6[0]!=aN.call(a6[0])){d[0]=aN.call(a6[0]);switch(d[0]){case"A":d[1]=a6[1];d[2]=a6[2];d[3]=a6[3];d[4]=a6[4];d[5]=a6[5];d[6]=+(a6[6]+a5);d[7]=+(a6[7]+a4);break;case"V":d[1]=+a6[1]+a4;break;case"H":d[1]=+a6[1]+a5;break;case"M":a8=+a6[1]+a5;a7=+a6[2]+a4;default:for(var a0=1,a2=a6[m];a0<a2;a0++){d[a0]=+a6[a0]+((a0%2)?a5:a4);}}}else{for(var S=0,e=a6[m];S<e;S++){a3[a1][S]=a6[S];}}switch(d[0]){case"Z":a5=a8;a4=a7;break;case"H":a5=d[1];break;case"V":a4=d[1];break;default:a5=a3[a1][a3[a1][m]-2];a4=a3[a1][a3[a1][m]-1];}}a3[aA]=an._path2string;return a3;},null,av),aX=function(e,E,d,i){return[e,E,d,i,d,i];},aK=function(e,E,a0,R,d,i){var S=1/3,a1=2/3;return[S*e+a1*a0,S*E+a1*R,S*d+a1*a0,S*i+a1*R,d,i];},K=function(a9,bE,bi,bg,ba,a4,S,a8,bD,bb){var R=ab.PI,bf=R*120/180,d=R/180*(+ba||0),bm=[],bj,bA=aj(function(bF,bI,i){var bH=bF*ab.cos(i)-bI*ab.sin(i),bG=bF*ab.sin(i)+bI*ab.cos(i);return{x:bH,y:bG};});if(!bb){bj=bA(a9,bE,-d);a9=bj.x;bE=bj.y;bj=bA(a8,bD,-d);a8=bj.x;bD=bj.y;var e=ab.cos(R/180*ba),a6=ab.sin(R/180*ba),bo=(a9-a8)/2,bn=(bE-bD)/2;bi=g(bi,ab.abs(bo));bg=g(bg,ab.abs(bn));var by=(bo*bo)/(bi*bi)+(bn*bn)/(bg*bg);if(by>1){bi=ab.sqrt(by)*bi;bg=ab.sqrt(by)*bg;}var E=bi*bi,br=bg*bg,bt=(a4==S?-1:1)*ab.sqrt(ab.abs((E*br-E*bn*bn-br*bo*bo)/(E*bn*bn+br*bo*bo))),bd=bt*bi*bn/bg+(a9+a8)/2,bc=bt*-bg*bo/bi+(bE+bD)/2,a3=ab.asin(((bE-bc)/bg).toFixed(7)),a2=ab.asin(((bD-bc)/bg).toFixed(7));a3=a9<bd?R-a3:a3;a2=a8<bd?R-a2:a2;a3<0&&(a3=R*2+a3);a2<0&&(a2=R*2+a2);if(S&&a3>a2){a3=a3-R*2;}if(!S&&a2>a3){a2=a2-R*2;}}else{a3=bb[0];a2=bb[1];bd=bb[2];bc=bb[3];}var a7=a2-a3;if(ab.abs(a7)>bf){var be=a2,bh=a8,a5=bD;a2=a3+bf*(S&&a2>a3?1:-1);a8=bd+bi*ab.cos(a2);bD=bc+bg*ab.sin(a2);bm=K(a8,bD,bi,bg,ba,0,S,bh,a5,[a2,be,bd,bc]);}a7=a2-a3;var a1=ab.cos(a3),bC=ab.sin(a3),a0=ab.cos(a2),bB=ab.sin(a2),bp=ab.tan(a7/4),bs=4/3*bi*bp,bq=4/3*bg*bp,bz=[a9,bE],bx=[a9+bs*bC,bE-bq*a1],bw=[a8+bs*bB,bD-bq*a0],bu=[a8,bD];bx[0]=2*bz[0]-bx[0];bx[1]=2*bz[1]-bx[1];if(bb){return[bx,bw,bu][aS](bm);}else{bm=[bx,bw,bu][aS](bm)[az]()[z](",");var bk=[];for(var bv=0,bl=bm[m];bv<bl;bv++){bk[bv]=bv%2?bA(bm[bv-1],bm[bv],d).y:bA(bm[bv],bm[bv+1],d).x;}return bk;}},M=function(e,d,E,i,a2,a1,a0,S,a3){var R=1-a3;return{x:aM(R,3)*e+aM(R,2)*3*a3*E+R*3*a3*a3*a2+aM(a3,3)*a0,y:aM(R,3)*d+aM(R,2)*3*a3*i+R*3*a3*a3*a1+aM(a3,3)*S};},aC=aj(function(i,d,R,E,a9,a8,a5,a2){var a7=(a9-2*R+i)-(a5-2*a9+R),a4=2*(R-i)-2*(a9-R),a1=i-R,a0=(-a4+ab.sqrt(a4*a4-4*a7*a1))/2/a7,S=(-a4-ab.sqrt(a4*a4-4*a7*a1))/2/a7,a3=[d,a2],a6=[i,a5],e;ab.abs(a0)>1000000000000&&(a0=0.5);ab.abs(S)>1000000000000&&(S=0.5);if(a0>0&&a0<1){e=M(i,d,R,E,a9,a8,a5,a2,a0);a6[f](e.x);a3[f](e.y);}if(S>0&&S<1){e=M(i,d,R,E,a9,a8,a5,a2,S);a6[f](e.x);a3[f](e.y);}a7=(a8-2*E+d)-(a2-2*a8+E);a4=2*(E-d)-2*(a8-E);a1=d-E;a0=(-a4+ab.sqrt(a4*a4-4*a7*a1))/2/a7;S=(-a4-ab.sqrt(a4*a4-4*a7*a1))/2/a7;ab.abs(a0)>1000000000000&&(a0=0.5);ab.abs(S)>1000000000000&&(S=0.5);if(a0>0&&a0<1){e=M(i,d,R,E,a9,a8,a5,a2,a0);a6[f](e.x);a3[f](e.y);}if(S>0&&S<1){e=M(i,d,R,E,a9,a8,a5,a2,S);a6[f](e.x);a3[f](e.y);}return{min:{x:aI[aW](0,a6),y:aI[aW](0,a3)},max:{x:g[aW](0,a6),y:g[aW](0,a3)}};}),H=aj(function(a9,a4){var R=r(a9),a5=a4&&r(a4),a6={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},d={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a0=function(ba,bb){var i,bc;if(!ba){return["C",bb.x,bb.y,bb.x,bb.y,bb.x,bb.y];}!(ba[0] in {T:1,Q:1})&&(bb.qx=bb.qy=null);switch(ba[0]){case"M":bb.X=ba[1];bb.Y=ba[2];break;case"A":ba=["C"][aS](K[aW](0,[bb.x,bb.y][aS](ba.slice(1))));break;case"S":i=bb.x+(bb.x-(bb.bx||bb.x));bc=bb.y+(bb.y-(bb.by||bb.y));ba=["C",i,bc][aS](ba.slice(1));break;case"T":bb.qx=bb.x+(bb.x-(bb.qx||bb.x));bb.qy=bb.y+(bb.y-(bb.qy||bb.y));ba=["C"][aS](aK(bb.x,bb.y,bb.qx,bb.qy,ba[1],ba[2]));break;case"Q":bb.qx=ba[1];bb.qy=ba[2];ba=["C"][aS](aK(bb.x,bb.y,ba[1],ba[2],ba[3],ba[4]));break;case"L":ba=["C"][aS](aX(bb.x,bb.y,ba[1],ba[2]));break;case"H":ba=["C"][aS](aX(bb.x,bb.y,ba[1],bb.y));break;case"V":ba=["C"][aS](aX(bb.x,bb.y,bb.x,ba[1]));break;case"Z":ba=["C"][aS](aX(bb.x,bb.y,bb.X,bb.Y));break;}return ba;},e=function(ba,bb){if(ba[bb][m]>7){ba[bb].shift();var bc=ba[bb];while(bc[m]){ba.splice(bb++,0,["C"][aS](bc.splice(0,6)));}ba.splice(bb,1);a7=g(R[m],a5&&a5[m]||0);}},E=function(be,bd,bb,ba,bc){if(be&&bd&&be[bc][0]=="M"&&bd[bc][0]!="M"){bd.splice(bc,0,["M",ba.x,ba.y]);bb.bx=0;bb.by=0;bb.x=be[bc][1];bb.y=be[bc][2];a7=g(R[m],a5&&a5[m]||0);}};for(var a2=0,a7=g(R[m],a5&&a5[m]||0);a2<a7;a2++){R[a2]=a0(R[a2],a6);e(R,a2);a5&&(a5[a2]=a0(a5[a2],d));a5&&e(a5,a2);E(R,a5,a6,d,a2);E(a5,R,d,a6,a2);var a1=R[a2],a8=a5&&a5[a2],S=a1[m],a3=a5&&a8[m];a6.x=a1[S-2];a6.y=a1[S-1];a6.bx=W(a1[S-4])||a6.x;a6.by=W(a1[S-3])||a6.y;d.bx=a5&&(W(a8[a3-4])||d.x);d.by=a5&&(W(a8[a3-3])||d.y);d.x=a5&&a8[a3-2];d.y=a5&&a8[a3-1];}return a5?[R,a5]:R;},null,av),p=aj(function(a4){var a3=[];for(var a0=0,a5=a4[m];a0<a5;a0++){var e={},a2=a4[a0].match(/^([^:]*):?([\d\.]*)/);e.color=an.getRGB(a2[1]);if(e.color.error){return null;}e.color=e.color.hex;a2[2]&&(e.offset=a2[2]+"%");a3[f](e);}for(var a0=1,a5=a3[m]-1;a0<a5;a0++){if(!a3[a0].offset){var E=W(a3[a0-1].offset||0),R=0;for(var S=a0+1;S<a5;S++){if(a3[S].offset){R=a3[S].offset;break;}}if(!R){R=100;S=a5;}R=W(R);var a1=(R-E)/(S-a0+1);for(;a0<S;a0++){E+=a1;a3[a0].offset=E+"%";}}}return a3;}),ao=function(){var i,e,R,E,d;if(an.is(arguments[0],"string")||an.is(arguments[0],"object")){if(an.is(arguments[0],"string")){i=L.getElementById(arguments[0]);}else{i=arguments[0];}if(i.tagName){if(arguments[1]==null){return{container:i,width:i.style.pixelWidth||i.offsetWidth,height:i.style.pixelHeight||i.offsetHeight};}else{return{container:i,width:arguments[1],height:arguments[2]};}}}else{if(an.is(arguments[0],al)&&arguments[m]>3){return{container:1,x:arguments[0],y:arguments[1],width:arguments[2],height:arguments[3]};}}},aG=function(d,i){var e=this;for(var E in i){if(i[Q](E)&&!(E in d)){switch(typeof i[E]){case"function":(function(R){d[E]=d===e?R:function(){return R[aW](e,arguments);};})(i[E]);break;case"object":d[E]=d[E]||{};aG.call(this,d[E],i[E]);break;default:d[E]=i[E];break;}}}},ak=function(d,e){d==e.top&&(e.top=d.prev);d==e.bottom&&(e.bottom=d.next);d.next&&(d.next.prev=d.prev);d.prev&&(d.prev.next=d.next);},Y=function(d,e){if(e.top===d){return;}ak(d,e);d.next=null;d.prev=e.top;e.top.next=d;e.top=d;},k=function(d,e){if(e.bottom===d){return;}ak(d,e);d.next=e.bottom;d.prev=null;e.bottom.prev=d;e.bottom=d;},A=function(e,d,i){ak(e,i);d==i.top&&(i.top=e);d.next&&(d.next.prev=e);e.next=d.next;e.prev=d;d.next=e;},aq=function(e,d,i){ak(e,i);d==i.bottom&&(i.bottom=e);d.prev&&(d.prev.next=e);e.prev=d.prev;d.prev=e;e.next=d;},s=function(d){return function(){throw new Error("Rapha\xebl: you are calling to method \u201c"+d+"\u201d of removed object");};},ar=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/;if(an.svg){aT[aY].svgns="http://www.w3.org/2000/svg";aT[aY].xlink="http://www.w3.org/1999/xlink";var O=function(d){return +d+(~~d===d)*0.5;},V=function(S){for(var e=0,E=S[m];e<E;e++){if(aZ.call(S[e][0])!="a"){for(var d=1,R=S[e][m];d<R;d++){S[e][d]=O(S[e][d]);}}else{S[e][6]=O(S[e][6]);S[e][7]=O(S[e][7]);}}return S;},aJ=function(i,d){if(d){for(var e in d){if(d[Q](e)){i[v](e,d[e]);}}}else{return L.createElementNS(aT[aY].svgns,i);}};an[aA]=function(){return"Your browser supports SVG.\nYou are running Rapha\xebl "+this.version;};var q=function(d,E){var e=aJ("path");E.canvas&&E.canvas[aL](e);var i=new ax(e,E);i.type="path";aa(i,{fill:"none",stroke:"#000",path:d});return i;};var b=function(E,a7,d){var a4="linear",a1=0.5,S=0.5,a9=E.style;a7=(a7+at)[aP](ar,function(bb,i,bc){a4="radial";if(i&&bc){a1=W(i);S=W(bc);var ba=((S>0.5)*2-1);aM(a1-0.5,2)+aM(S-0.5,2)>0.25&&(S=ab.sqrt(0.25-aM(a1-0.5,2))*ba+0.5)&&S!=0.5&&(S=S.toFixed(5)-0.00001*ba);}return at;});a7=a7[z](/\s*\-\s*/);if(a4=="linear"){var a0=a7.shift();a0=-W(a0);if(isNaN(a0)){return null;}var R=[0,0,ab.cos(a0*ab.PI/180),ab.sin(a0*ab.PI/180)],a6=1/(g(ab.abs(R[2]),ab.abs(R[3]))||1);R[2]*=a6;R[3]*=a6;if(R[2]<0){R[0]=-R[2];R[2]=0;}if(R[3]<0){R[1]=-R[3];R[3]=0;}}var a3=p(a7);if(!a3){return null;}var e=aJ(a4+"Gradient");e.id="r"+(an._id++)[aA](36);aJ(e,a4=="radial"?{fx:a1,fy:S}:{x1:R[0],y1:R[1],x2:R[2],y2:R[3]});d.defs[aL](e);for(var a2=0,a8=a3[m];a2<a8;a2++){var a5=aJ("stop");aJ(a5,{offset:a3[a2].offset?a3[a2].offset:!a2?"0%":"100%","stop-color":a3[a2].color||"#fff"});e[aL](a5);}aJ(E,{fill:"url(#"+e.id+")",opacity:1,"fill-opacity":1});a9.fill=at;a9.opacity=1;a9.fillOpacity=1;return 1;};var N=function(e){var d=e.getBBox();aJ(e.pattern,{patternTransform:an.format("translate({0},{1})",d.x,d.y)});};var aa=function(a6,bf){var a9={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},bb=a6.node,a7=a6.attrs,a3=a6.rotate(),S=function(bm,bl){bl=a9[aZ.call(bl)];if(bl){var bj=bm.attrs["stroke-width"]||"1",bh={round:bj,square:bj,butt:0}[bm.attrs["stroke-linecap"]||bf["stroke-linecap"]]||0,bk=[];var bi=bl[m];while(bi--){bk[bi]=bl[bi]*bj+((bi%2)?1:-1)*bh;}aJ(bb,{"stroke-dasharray":bk[az](",")});}};bf[Q]("rotation")&&(a3=bf.rotation);var a2=(a3+at)[z](a);if(!(a2.length-1)){a2=null;}else{a2[1]=+a2[1];a2[2]=+a2[2];}W(a3)&&a6.rotate(0,true);for(var ba in bf){if(bf[Q](ba)){if(!j[Q](ba)){continue;}var a8=bf[ba];a7[ba]=a8;switch(ba){case"rotation":a6.rotate(a8,true);break;case"href":case"title":case"target":var bd=bb.parentNode;if(aZ.call(bd.tagName)!="a"){var E=aJ("a");bd.insertBefore(E,bb);E[aL](bb);bd=E;}bd.setAttributeNS(a6.paper.xlink,ba,a8);break;case"cursor":bb.style.cursor=a8;break;case"clip-rect":var e=(a8+at)[z](a);if(e[m]==4){a6.clip&&a6.clip.parentNode.parentNode.removeChild(a6.clip.parentNode);var i=aJ("clipPath"),bc=aJ("rect");i.id="r"+(an._id++)[aA](36);aJ(bc,{x:e[0],y:e[1],width:e[2],height:e[3]});i[aL](bc);a6.paper.defs[aL](i);aJ(bb,{"clip-path":"url(#"+i.id+")"});a6.clip=bc;}if(!a8){var be=L.getElementById(bb.getAttribute("clip-path")[aP](/(^url\(#|\)$)/g,at));be&&be.parentNode.removeChild(be);aJ(bb,{"clip-path":at});delete a6.clip;}break;case"path":if(a8&&a6.type=="path"){a7.path=V(r(a8));aJ(bb,{d:a7.path});}break;case"width":bb[v](ba,a8);if(a7.fx){ba="x";a8=a7.x;}else{break;}case"x":if(a7.fx){a8=-a7.x-(a7.width||0);}case"rx":if(ba=="rx"&&a6.type=="rect"){break;}case"cx":a2&&(ba=="x"||ba=="cx")&&(a2[1]+=a8-a7[ba]);bb[v](ba,O(a8));a6.pattern&&N(a6);break;case"height":bb[v](ba,a8);if(a7.fy){ba="y";a8=a7.y;}else{break;}case"y":if(a7.fy){a8=-a7.y-(a7.height||0);}case"ry":if(ba=="ry"&&a6.type=="rect"){break;}case"cy":a2&&(ba=="y"||ba=="cy")&&(a2[2]+=a8-a7[ba]);bb[v](ba,O(a8));a6.pattern&&N(a6);break;case"r":if(a6.type=="rect"){aJ(bb,{rx:a8,ry:a8});}else{bb[v](ba,a8);}break;case"src":if(a6.type=="image"){bb.setAttributeNS(a6.paper.xlink,"href",a8);}break;case"stroke-width":bb.style.strokeWidth=a8;bb[v](ba,a8);if(a7["stroke-dasharray"]){S(a6,a7["stroke-dasharray"]);}break;case"stroke-dasharray":S(a6,a8);break;case"translation":var a0=(a8+at)[z](a);a0[0]=+a0[0]||0;a0[1]=+a0[1]||0;if(a2){a2[1]+=a0[0];a2[2]+=a0[1];}t.call(a6,a0[0],a0[1]);break;case"scale":var a0=(a8+at)[z](a);a6.scale(+a0[0]||1,+a0[1]||+a0[0]||1,+a0[2]||null,+a0[3]||null);break;case"fill":var R=(a8+at).match(c);if(R){var i=aJ("pattern"),a5=aJ("image");i.id="r"+(an._id++)[aA](36);aJ(i,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1});aJ(a5,{x:0,y:0});a5.setAttributeNS(a6.paper.xlink,"href",R[1]);i[aL](a5);var bg=L.createElement("img");bg.style.cssText="position:absolute;left:-9999em;top-9999em";bg.onload=function(){aJ(i,{width:this.offsetWidth,height:this.offsetHeight});aJ(a5,{width:this.offsetWidth,height:this.offsetHeight});L.body.removeChild(this);a6.paper.safari();};L.body[aL](bg);bg.src=R[1];a6.paper.defs[aL](i);bb.style.fill="url(#"+i.id+")";aJ(bb,{fill:"url(#"+i.id+")"});a6.pattern=i;a6.pattern&&N(a6);break;}if(!an.getRGB(a8).error){delete bf.gradient;delete a7.gradient;!an.is(a7.opacity,"undefined")&&an.is(bf.opacity,"undefined")&&aJ(bb,{opacity:a7.opacity});!an.is(a7["fill-opacity"],"undefined")&&an.is(bf["fill-opacity"],"undefined")&&aJ(bb,{"fill-opacity":a7["fill-opacity"]});}else{if((({circle:1,ellipse:1})[Q](a6.type)||(a8+at).charAt()!="r")&&b(bb,a8,a6.paper)){a7.gradient=a8;a7.fill="none";break;}}case"stroke":bb[v](ba,an.getRGB(a8).hex);break;case"gradient":(({circle:1,ellipse:1})[Q](a6.type)||(a8+at).charAt()!="r")&&b(bb,a8,a6.paper);break;case"opacity":case"fill-opacity":if(a7.gradient){var d=L.getElementById(bb.getAttribute("fill")[aP](/^url\(#|\)$/g,at));if(d){var a1=d.getElementsByTagName("stop");a1[a1[m]-1][v]("stop-opacity",a8);}break;}default:ba=="font-size"&&(a8=G(a8,10)+"px");var a4=ba[aP](/(\-.)/g,function(bh){return aN.call(bh.substring(1));});bb.style[a4]=a8;bb[v](ba,a8);break;}}}D(a6,bf);if(a2){a6.rotate(a2.join(am));}else{W(a3)&&a6.rotate(a3,true);}};var h=1.2;var D=function(d,R){if(d.type!="text"||!(R[Q]("text")||R[Q]("font")||R[Q]("font-size")||R[Q]("x")||R[Q]("y"))){return;}var a3=d.attrs,e=d.node,a5=e.firstChild?G(L.defaultView.getComputedStyle(e.firstChild,at).getPropertyValue("font-size"),10):10;if(R[Q]("text")){a3.text=R.text;while(e.firstChild){e.removeChild(e.firstChild);}var E=(R.text+at)[z]("\n");for(var S=0,a4=E[m];S<a4;S++){if(E[S]){var a1=aJ("tspan");S&&aJ(a1,{dy:a5*h,x:a3.x});a1[aL](L.createTextNode(E[S]));e[aL](a1);}}}else{var E=e.getElementsByTagName("tspan");for(var S=0,a4=E[m];S<a4;S++){S&&aJ(E[S],{dy:a5*h,x:a3.x});}}aJ(e,{y:a3.y});var a0=d.getBBox(),a2=a3.y-(a0.y+a0.height/2);a2&&isFinite(a2)&&aJ(e,{y:a3.y+a2});};var ax=function(e,d){var E=0,i=0;this[0]=e;this.id=an._oid++;this.node=e;e.raphael=this;this.paper=d;this.attrs=this.attrs||{};this.transformations=[];this._={tx:0,ty:0,rt:{deg:0,cx:0,cy:0},sx:1,sy:1};!d.bottom&&(d.bottom=this);this.prev=d.top;d.top&&(d.top.next=this);d.top=this;this.next=null;};ax[aY].rotate=function(e,d,E){if(this.removed){return this;}if(e==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy][az](am);}return this._.rt.deg;}var i=this.getBBox();e=(e+at)[z](a);if(e[m]-1){d=W(e[1]);E=W(e[2]);}e=W(e[0]);if(d!=null){this._.rt.deg=e;}else{this._.rt.deg+=e;}(E==null)&&(d=null);this._.rt.cx=d;this._.rt.cy=E;d=d==null?i.x+i.width/2:d;E=E==null?i.y+i.height/2:E;if(this._.rt.deg){this.transformations[0]=an.format("rotate({0} {1} {2})",this._.rt.deg,d,E);this.clip&&aJ(this.clip,{transform:an.format("rotate({0} {1} {2})",-this._.rt.deg,d,E)});}else{this.transformations[0]=at;this.clip&&aJ(this.clip,{transform:at});}aJ(this.node,{transform:this.transformations[az](am)});return this;};ax[aY].hide=function(){!this.removed&&(this.node.style.display="none");return this;};ax[aY].show=function(){!this.removed&&(this.node.style.display="");return this;};ax[aY].remove=function(){if(this.removed){return;}ak(this,this.paper);this.node.parentNode.removeChild(this.node);for(var d in this){delete this[d];}this.removed=true;};ax[aY].getBBox=function(){if(this.removed){return this;}if(this.type=="path"){return U(this.attrs.path);}if(this.node.style.display=="none"){this.show();var E=true;}var a1={};try{a1=this.node.getBBox();}catch(S){}finally{a1=a1||{};}if(this.type=="text"){a1={x:a1.x,y:Infinity,width:0,height:0};for(var d=0,R=this.node.getNumberOfChars();d<R;d++){var a0=this.node.getExtentOfChar(d);(a0.y<a1.y)&&(a1.y=a0.y);(a0.y+a0.height-a1.y>a1.height)&&(a1.height=a0.y+a0.height-a1.y);(a0.x+a0.width-a1.x>a1.width)&&(a1.width=a0.x+a0.width-a1.x);}}E&&this.hide();return a1;};ax[aY].attr=function(){if(this.removed){return this;}if(arguments[m]==0){var R={};for(var E in this.attrs){if(this.attrs[Q](E)){R[E]=this.attrs[E];}}this._.rt.deg&&(R.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(R.scale=this.scale());R.gradient&&R.fill=="none"&&(R.fill=R.gradient)&&delete R.gradient;return R;}if(arguments[m]==1&&an.is(arguments[0],"string")){if(arguments[0]=="translation"){return t.call(this);}if(arguments[0]=="rotation"){return this.rotate();}if(arguments[0]=="scale"){return this.scale();}if(arguments[0]=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient){return this.attrs.gradient;}return this.attrs[arguments[0]];}if(arguments[m]==1&&an.is(arguments[0],"array")){var d={};for(var e in arguments[0]){if(arguments[0][Q](e)){d[arguments[0][e]]=this.attrs[arguments[0][e]];}}return d;}if(arguments[m]==2){var S={};S[arguments[0]]=arguments[1];aa(this,S);}else{if(arguments[m]==1&&an.is(arguments[0],"object")){aa(this,arguments[0]);}}return this;};ax[aY].toFront=function(){if(this.removed){return this;}this.node.parentNode[aL](this.node);var d=this.paper;d.top!=this&&Y(this,d);return this;};ax[aY].toBack=function(){if(this.removed){return this;}if(this.node.parentNode.firstChild!=this.node){this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild);k(this,this.paper);var d=this.paper;}return this;};ax[aY].insertAfter=function(d){if(this.removed){return this;}var e=d.node;if(e.nextSibling){e.parentNode.insertBefore(this.node,e.nextSibling);}else{e.parentNode[aL](this.node);}A(this,d,this.paper);return this;};ax[aY].insertBefore=function(d){if(this.removed){return this;}var e=d.node;e.parentNode.insertBefore(this.node,e);aq(this,d,this.paper);return this;};var P=function(e,d,S,R){d=O(d);S=O(S);var E=aJ("circle");e.canvas&&e.canvas[aL](E);var i=new ax(E,e);i.attrs={cx:d,cy:S,r:R,fill:"none",stroke:"#000"};i.type="circle";aJ(E,i.attrs);return i;};var aF=function(i,d,a1,e,S,a0){d=O(d);a1=O(a1);var R=aJ("rect");i.canvas&&i.canvas[aL](R);var E=new ax(R,i);E.attrs={x:d,y:a1,width:e,height:S,r:a0||0,rx:a0||0,ry:a0||0,fill:"none",stroke:"#000"};E.type="rect";aJ(R,E.attrs);return E;};var ai=function(e,d,a0,S,R){d=O(d);a0=O(a0);var E=aJ("ellipse");e.canvas&&e.canvas[aL](E);var i=new ax(E,e);i.attrs={cx:d,cy:a0,rx:S,ry:R,fill:"none",stroke:"#000"};i.type="ellipse";aJ(E,i.attrs);return i;};var o=function(i,a0,d,a1,e,S){var R=aJ("image");aJ(R,{x:d,y:a1,width:e,height:S,preserveAspectRatio:"none"});R.setAttributeNS(i.xlink,"href",a0);i.canvas&&i.canvas[aL](R);var E=new ax(R,i);E.attrs={x:d,y:a1,width:e,height:S,src:a0};E.type="image";return E;};var X=function(e,d,S,R){var E=aJ("text");aJ(E,{x:d,y:S,"text-anchor":"middle"});e.canvas&&e.canvas[aL](E);var i=new ax(E,e);i.attrs={x:d,y:S,"text-anchor":"middle",text:R,font:j.font,stroke:"none",fill:"#000"};i.type="text";aa(i,i.attrs);return i;};var aV=function(e,d){this.width=e||this.width;this.height=d||this.height;this.canvas[v]("width",this.width);this.canvas[v]("height",this.height);return this;};var w=function(){var E=ao[aW](null,arguments),i=E&&E.container,e=E.x,a0=E.y,R=E.width,d=E.height;if(!i){throw new Error("SVG container not found.");}var S=aJ("svg");R=R||512;d=d||342;aJ(S,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:R,height:d});if(i==1){S.style.cssText="position:absolute;left:"+e+"px;top:"+a0+"px";L.body[aL](S);}else{if(i.firstChild){i.insertBefore(S,i.firstChild);}else{i[aL](S);}}i=new aT;i.width=R;i.height=d;i.canvas=S;aG.call(i,i,an.fn);i.clear();return i;};aT[aY].clear=function(){var d=this.canvas;while(d.firstChild){d.removeChild(d.firstChild);}this.bottom=this.top=null;(this.desc=aJ("desc"))[aL](L.createTextNode("Created with Rapha\xebl"));d[aL](this.desc);d[aL](this.defs=aJ("defs"));};aT[aY].remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var d in this){this[d]=s(d);}};}if(an.vml){var aH=function(a8){var a5=/[ahqstv]/ig,a0=r;(a8+at).match(a5)&&(a0=H);a5=/[clmz]/g;if(a0==r&&!(a8+at).match(a5)){var e={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},R=/([clmz]),?([^clmz]*)/gi,S=/-?[^,\s-]+/g;var a4=(a8+at)[aP](R,function(a9,bb,i){var ba=[];i[aP](S,function(bc){ba[f](O(bc));});return e[bb]+ba;});return a4;}var a6=a0(a8),E,a4=[],d;for(var a2=0,a7=a6[m];a2<a7;a2++){E=a6[a2];d=aZ.call(a6[a2][0]);d=="z"&&(d="x");for(var a1=1,a3=E[m];a1<a3;a1++){d+=O(E[a1])+(a1!=a3-1?",":at);}a4[f](d);}return a4[az](am);};an[aA]=function(){return"Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\xebl "+this.version;};var q=function(d,S){var E=ah("group");E.style.cssText="position:absolute;left:0;top:0;width:"+S.width+"px;height:"+S.height+"px";E.coordsize=S.coordsize;E.coordorigin=S.coordorigin;var i=ah("shape"),e=i.style;e.width=S.width+"px";e.height=S.height+"px";i.coordsize=this.coordsize;i.coordorigin=this.coordorigin;E[aL](i);var R=new ax(i,E,S);R.isAbsolute=true;R.type="path";R.path=[];R.Path=at;d&&aa(R,{fill:"none",stroke:"#000",path:d});S.canvas[aL](E);return R;};var aa=function(a3,a8){a3.attrs=a3.attrs||{};var a6=a3.node,a9=a3.attrs,a0=a6.style,E,bd=a3;for(var a1 in a8){if(a8[Q](a1)){a9[a1]=a8[a1];}}a8.href&&(a6.href=a8.href);a8.title&&(a6.title=a8.title);a8.target&&(a6.target=a8.target);a8.cursor&&(a0.cursor=a8.cursor);if(a8.path&&a3.type=="path"){a9.path=a8.path;a6.path=aH(a9.path);}if(a8.rotation!=null){a3.rotate(a8.rotation,true);}if(a8.translation){E=(a8.translation+at)[z](a);t.call(a3,E[0],E[1]);if(a3._.rt.cx!=null){a3._.rt.cx+=+E[0];a3._.rt.cy+=+E[1];a3.setBox(a3.attrs,E[0],E[1]);}}if(a8.scale){E=(a8.scale+at)[z](a);a3.scale(+E[0]||1,+E[1]||+E[0]||1,+E[2]||null,+E[3]||null);}if("clip-rect" in a8){var d=(a8["clip-rect"]+at)[z](a);if(d[m]==4){d[2]=+d[2]+(+d[0]);d[3]=+d[3]+(+d[1]);var a2=a6.clipRect||L.createElement("div"),bc=a2.style,S=a6.parentNode;bc.clip=an.format("rect({1}px {2}px {3}px {0}px)",d);if(!a6.clipRect){bc.position="absolute";bc.top=0;bc.left=0;bc.width=a3.paper.width+"px";bc.height=a3.paper.height+"px";S.parentNode.insertBefore(a2,S);a2[aL](S);a6.clipRect=a2;}}if(!a8["clip-rect"]){a6.clipRect&&(a6.clipRect.style.clip=at);}}if(a3.type=="image"&&a8.src){a6.src=a8.src;}if(a3.type=="image"&&a8.opacity){a6.filterOpacity=" progid:DXImageTransform.Microsoft.Alpha(opacity="+(a8.opacity*100)+")";a0.filter=(a6.filterMatrix||at)+(a6.filterOpacity||at);}a8.font&&(a0.font=a8.font);a8["font-family"]&&(a0.fontFamily='"'+a8["font-family"][z](",")[0][aP](/^['"]+|['"]+$/g,at)+'"');a8["font-size"]&&(a0.fontSize=a8["font-size"]);a8["font-weight"]&&(a0.fontWeight=a8["font-weight"]);a8["font-style"]&&(a0.fontStyle=a8["font-style"]);if(a8.opacity!=null||a8["stroke-width"]!=null||a8.fill!=null||a8.stroke!=null||a8["stroke-width"]!=null||a8["stroke-opacity"]!=null||a8["fill-opacity"]!=null||a8["stroke-dasharray"]!=null||a8["stroke-miterlimit"]!=null||a8["stroke-linejoin"]!=null||a8["stroke-linecap"]!=null){a6=a3.shape||a6;var a7=(a6.getElementsByTagName("fill")&&a6.getElementsByTagName("fill")[0]),ba=false;!a7&&(ba=a7=ah("fill"));if("fill-opacity" in a8||"opacity" in a8){var e=((+a9["fill-opacity"]+1||2)-1)*((+a9.opacity+1||2)-1);e<0&&(e=0);e>1&&(e=1);a7.opacity=e;}a8.fill&&(a7.on=true);if(a7.on==null||a8.fill=="none"){a7.on=false;}if(a7.on&&a8.fill){var i=a8.fill.match(c);if(i){a7.src=i[1];a7.type="tile";}else{a7.color=an.getRGB(a8.fill).hex;a7.src=at;a7.type="solid";if(an.getRGB(a8.fill).error&&(bd.type in {circle:1,ellipse:1}||(a8.fill+at).charAt()!="r")&&b(bd,a8.fill)){a9.fill="none";a9.gradient=a8.fill;}}}ba&&a6[aL](a7);var R=(a6.getElementsByTagName("stroke")&&a6.getElementsByTagName("stroke")[0]),bb=false;!R&&(bb=R=ah("stroke"));if((a8.stroke&&a8.stroke!="none")||a8["stroke-width"]||a8["stroke-opacity"]!=null||a8["stroke-dasharray"]||a8["stroke-miterlimit"]||a8["stroke-linejoin"]||a8["stroke-linecap"]){R.on=true;}(a8.stroke=="none"||R.on==null||a8.stroke==0||a8["stroke-width"]==0)&&(R.on=false);R.on&&a8.stroke&&(R.color=an.getRGB(a8.stroke).hex);var e=((+a9["stroke-opacity"]+1||2)-1)*((+a9.opacity+1||2)-1),a4=(W(a8["stroke-width"])||1)*0.75;e<0&&(e=0);e>1&&(e=1);a8["stroke-width"]==null&&(a4=a9["stroke-width"]);a8["stroke-width"]&&(R.weight=a4);a4&&a4<1&&(e*=a4)&&(R.weight=1);R.opacity=e;a8["stroke-linejoin"]&&(R.joinstyle=a8["stroke-linejoin"]||"miter");R.miterlimit=a8["stroke-miterlimit"]||8;a8["stroke-linecap"]&&(R.endcap=a8["stroke-linecap"]=="butt"?"flat":a8["stroke-linecap"]=="square"?"square":"round");if(a8["stroke-dasharray"]){var a5={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};R.dashstyle=a5[Q](a8["stroke-dasharray"])?a5[a8["stroke-dasharray"]]:at;}bb&&a6[aL](R);}if(bd.type=="text"){var a0=bd.paper.span.style;a9.font&&(a0.font=a9.font);a9["font-family"]&&(a0.fontFamily=a9["font-family"]);a9["font-size"]&&(a0.fontSize=a9["font-size"]);a9["font-weight"]&&(a0.fontWeight=a9["font-weight"]);a9["font-style"]&&(a0.fontStyle=a9["font-style"]);bd.node.string&&(bd.paper.span.innerHTML=(bd.node.string+at)[aP](/</g,"<")[aP](/&/g,"&")[aP](/\n/g,"<br>"));bd.W=a9.w=bd.paper.span.offsetWidth;bd.H=a9.h=bd.paper.span.offsetHeight;bd.X=a9.x;bd.Y=a9.y+O(bd.H/2);switch(a9["text-anchor"]){case"start":bd.node.style["v-text-align"]="left";bd.bbx=O(bd.W/2);break;case"end":bd.node.style["v-text-align"]="right";bd.bbx=-O(bd.W/2);break;default:bd.node.style["v-text-align"]="center";break;}}};var b=function(d,a1){d.attrs=d.attrs||{};var a2=d.attrs,a4=d.node.getElementsByTagName("fill"),S="linear",a0=".5 .5";d.attrs.gradient=a1;a1=(a1+at)[aP](ar,function(a6,a7,i){S="radial";if(a7&&i){a7=W(a7);i=W(i);aM(a7-0.5,2)+aM(i-0.5,2)>0.25&&(i=ab.sqrt(0.25-aM(a7-0.5,2))*((i>0.5)*2-1)+0.5);a0=a7+am+i;}return at;});a1=a1[z](/\s*\-\s*/);if(S=="linear"){var e=a1.shift();e=-W(e);if(isNaN(e)){return null;}}var R=p(a1);if(!R){return null;}d=d.shape||d.node;a4=a4[0]||ah("fill");if(R[m]){a4.on=true;a4.method="none";a4.type=(S=="radial")?"gradientradial":"gradient";a4.color=R[0].color;a4.color2=R[R[m]-1].color;var a5=[];for(var E=0,a3=R[m];E<a3;E++){R[E].offset&&a5[f](R[E].offset+am+R[E].color);}a4.colors&&(a4.colors.value=a5[m]?a5[az](","):"0% "+a4.color);if(S=="radial"){a4.focus="100%";a4.focussize=a0;a4.focusposition=a0;}else{a4.angle=(270-e)%360;}}return 1;};var ax=function(R,a0,d){var S=0,i=0,e=0,E=1;this[0]=R;this.id=an._oid++;this.node=R;R.raphael=this;this.X=0;this.Y=0;this.attrs={};this.Group=a0;this.paper=d;this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1};!d.bottom&&(d.bottom=this);this.prev=d.top;d.top&&(d.top.next=this);d.top=this;this.next=null;};ax[aY].rotate=function(e,d,i){if(this.removed){return this;}if(e==null){if(this._.rt.cx){return[this._.rt.deg,this._.rt.cx,this._.rt.cy][az](am);}return this._.rt.deg;}e=(e+at)[z](a);if(e[m]-1){d=W(e[1]);i=W(e[2]);}e=W(e[0]);if(d!=null){this._.rt.deg=e;}else{this._.rt.deg+=e;}i==null&&(d=null);this._.rt.cx=d;this._.rt.cy=i;this.setBox(this.attrs,d,i);this.Group.style.rotation=this._.rt.deg;return this;};ax[aY].setBox=function(bb,e,d){if(this.removed){return this;}var a5=this.Group.style,R=(this.shape&&this.shape.style)||this.node.style;bb=bb||{};for(var a9 in bb){if(bb[Q](a9)){this.attrs[a9]=bb[a9];}}e=e||this._.rt.cx;d=d||this._.rt.cy;var a7=this.attrs,a1,a0,a2,ba;switch(this.type){case"circle":a1=a7.cx-a7.r;a0=a7.cy-a7.r;a2=ba=a7.r*2;break;case"ellipse":a1=a7.cx-a7.rx;a0=a7.cy-a7.ry;a2=a7.rx*2;ba=a7.ry*2;break;case"rect":case"image":a1=+a7.x;a0=+a7.y;a2=a7.width||0;ba=a7.height||0;break;case"text":this.textpath.v=["m",O(a7.x),", ",O(a7.y-2),"l",O(a7.x)+1,", ",O(a7.y-2)][az](at);a1=a7.x-O(this.W/2);a0=a7.y-this.H/2;a2=this.W;ba=this.H;break;case"path":if(!this.attrs.path){a1=0;a0=0;a2=this.paper.width;ba=this.paper.height;}else{var a8=U(this.attrs.path);a1=a8.x;a0=a8.y;a2=a8.width;ba=a8.height;}break;default:a1=0;a0=0;a2=this.paper.width;ba=this.paper.height;break;}e=(e==null)?a1+a2/2:e;d=(d==null)?a0+ba/2:d;var E=e-this.paper.width/2,a4=d-this.paper.height/2;if(this.type=="path"||this.type=="text"){(a5.left!=E+"px")&&(a5.left=E+"px");(a5.top!=a4+"px")&&(a5.top=a4+"px");this.X=this.type=="text"?a1:-E;this.Y=this.type=="text"?a0:-a4;this.W=a2;this.H=ba;(R.left!=-E+"px")&&(R.left=-E+"px");(R.top!=-a4+"px")&&(R.top=-a4+"px");}else{(a5.left!=E+"px")&&(a5.left=E+"px");(a5.top!=a4+"px")&&(a5.top=a4+"px");this.X=a1;this.Y=a0;this.W=a2;this.H=ba;(a5.width!=this.paper.width+"px")&&(a5.width=this.paper.width+"px");(a5.height!=this.paper.height+"px")&&(a5.height=this.paper.height+"px");(R.left!=a1-E+"px")&&(R.left=a1-E+"px");(R.top!=a0-a4+"px")&&(R.top=a0-a4+"px");(R.width!=a2+"px")&&(R.width=a2+"px");(R.height!=ba+"px")&&(R.height=ba+"px");var S=(+bb.r||0)/aI(a2,ba);if(this.type=="rect"&&this.arcsize.toFixed(4)!=S.toFixed(4)&&(S||this.arcsize)){var a6=ah("roundrect"),bc={},a9=0,a3=this.events&&this.events[m];a6.arcsize=S;a6.raphael=this;this.Group[aL](a6);this.Group.removeChild(this.node);this[0]=this.node=a6;this.arcsize=S;for(var a9 in a7){bc[a9]=a7[a9];}delete bc.scale;this.attr(bc);if(this.events){for(;a9<a3;a9++){this.events[a9].unbind=ae(this.node,this.events[a9].name,this.events[a9].f,this);}}}}};ax[aY].hide=function(){!this.removed&&(this.Group.style.display="none");return this;};ax[aY].show=function(){!this.removed&&(this.Group.style.display="block");return this;};ax[aY].getBBox=function(){if(this.removed){return this;}if(this.type=="path"){return U(this.attrs.path);}return{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H};};ax[aY].remove=function(){if(this.removed){return;}ak(this,this.paper);this.node.parentNode.removeChild(this.node);this.Group.parentNode.removeChild(this.Group);this.shape&&this.shape.parentNode.removeChild(this.shape);for(var d in this){delete this[d];}this.removed=true;};ax[aY].attr=function(){if(this.removed){return this;}if(arguments[m]==0){var E={};for(var e in this.attrs){if(this.attrs[Q](e)){E[e]=this.attrs[e];}}this._.rt.deg&&(E.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(E.scale=this.scale());E.gradient&&E.fill=="none"&&(E.fill=E.gradient)&&delete E.gradient;return E;}if(arguments[m]==1&&an.is(arguments[0],"string")){if(arguments[0]=="translation"){return t.call(this);}if(arguments[0]=="rotation"){return this.rotate();}if(arguments[0]=="scale"){return this.scale();}if(arguments[0]=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient){return this.attrs.gradient;}return this.attrs[arguments[0]];}if(this.attrs&&arguments[m]==1&&an.is(arguments[0],"array")){var d={};for(var e=0,R=arguments[0][m];e<R;e++){d[arguments[0][e]]=this.attrs[arguments[0][e]];}return d;}var S;if(arguments[m]==2){S={};S[arguments[0]]=arguments[1];}arguments[m]==1&&an.is(arguments[0],"object")&&(S=arguments[0]);if(S){if(S.text&&this.type=="text"){this.node.string=S.text;}aa(this,S);if(S.gradient&&(({circle:1,ellipse:1})[Q](this.type)||(S.gradient+at).charAt()!="r")){b(this,S.gradient);}(this.type!="path"||this._.rt.deg)&&this.setBox(this.attrs);}return this;};ax[aY].toFront=function(){!this.removed&&this.Group.parentNode[aL](this.Group);this.paper.top!=this&&Y(this,this.paper);return this;};ax[aY].toBack=function(){if(this.removed){return this;}if(this.Group.parentNode.firstChild!=this.Group){this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild);k(this,this.paper);}return this;};ax[aY].insertAfter=function(d){if(this.removed){return this;}if(d.Group.nextSibling){d.Group.parentNode.insertBefore(this.Group,d.Group.nextSibling);}else{d.Group.parentNode[aL](this.Group);}A(this,d,this.paper);return this;};ax[aY].insertBefore=function(d){if(this.removed){return this;}d.Group.parentNode.insertBefore(this.Group,d.Group);aq(this,d,this.paper);return this;};var P=function(e,d,a1,S){var R=ah("group"),a0=ah("oval"),i=a0.style;R.style.cssText="position:absolute;left:0;top:0;width:"+e.width+"px;height:"+e.height+"px";R.coordsize=e.coordsize;R.coordorigin=e.coordorigin;R[aL](a0);var E=new ax(a0,R,e);E.type="circle";aa(E,{stroke:"#000",fill:"none"});E.attrs.cx=d;E.attrs.cy=a1;E.attrs.r=S;E.setBox({x:d-S,y:a1-S,width:S*2,height:S*2});e.canvas[aL](R);return E;},aF=function(e,a1,a0,a2,E,d){var R=ah("group"),i=ah("roundrect"),a3=(+d||0)/(aI(a2,E));R.style.cssText="position:absolute;left:0;top:0;width:"+e.width+"px;height:"+e.height+"px";R.coordsize=e.coordsize;R.coordorigin=e.coordorigin;R[aL](i);i.arcsize=a3;var S=new ax(i,R,e);S.type="rect";aa(S,{stroke:"#000"});S.arcsize=a3;S.setBox({x:a1,y:a0,width:a2,height:E,r:d});e.canvas[aL](R);return S;},ai=function(d,a2,a1,i,e){var R=ah("group"),E=ah("oval"),a0=E.style;R.style.cssText="position:absolute;left:0;top:0;width:"+d.width+"px;height:"+d.height+"px";R.coordsize=d.coordsize;R.coordorigin=d.coordorigin;R[aL](E);var S=new ax(E,R,d);S.type="ellipse";aa(S,{stroke:"#000"});S.attrs.cx=a2;S.attrs.cy=a1;S.attrs.rx=i;S.attrs.ry=e;S.setBox({x:a2-i,y:a1-e,width:i*2,height:e*2});d.canvas[aL](R);return S;},o=function(e,d,a2,a1,a3,E){var R=ah("group"),i=ah("image"),a0=i.style;R.style.cssText="position:absolute;left:0;top:0;width:"+e.width+"px;height:"+e.height+"px";R.coordsize=e.coordsize;R.coordorigin=e.coordorigin;i.src=d;R[aL](i);var S=new ax(i,R,e);S.type="image";S.attrs.src=d;S.attrs.x=a2;S.attrs.y=a1;S.attrs.w=a3;S.attrs.h=E;S.setBox({x:a2,y:a1,width:a3,height:E});e.canvas[aL](R);return S;},X=function(e,a2,a1,a3){var R=ah("group"),E=ah("shape"),a0=E.style,a4=ah("path"),d=a4.style,i=ah("textpath");R.style.cssText="position:absolute;left:0;top:0;width:"+e.width+"px;height:"+e.height+"px";R.coordsize=e.coordsize;R.coordorigin=e.coordorigin;a4.v=an.format("m{0},{1}l{2},{1}",O(a2),O(a1),O(a2)+1);a4.textpathok=true;a0.width=e.width;a0.height=e.height;i.string=a3+at;i.on=true;E[aL](i);E[aL](a4);R[aL](E);var S=new ax(i,R,e);S.shape=E;S.textpath=a4;S.type="text";S.attrs.text=a3;S.attrs.x=a2;S.attrs.y=a1;S.attrs.w=1;S.attrs.h=1;aa(S,{font:j.font,stroke:"none",fill:"#000"});S.setBox();e.canvas[aL](R);return S;},aV=function(i,d){var e=this.canvas.style;i==+i&&(i+="px");d==+d&&(d+="px");e.width=i;e.height=d;e.clip="rect(0 "+i+" "+d+" 0)";return this;},ah;L.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!L.namespaces.rvml&&L.namespaces.add("rvml","urn:schemas-microsoft-com:vml");ah=function(d){return L.createElement("<rvml:"+d+' class="rvml">');};}catch(af){ah=function(d){return L.createElement("<"+d+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');};}var w=function(){var i=ao[aW](null,arguments),d=i.container,a2=i.height,a3,e=i.width,a1=i.x,a0=i.y;if(!d){throw new Error("VML container not found.");}var R=new aT,S=R.canvas=L.createElement("div"),E=S.style;e=e||512;a2=a2||342;e==+e&&(e+="px");a2==+a2&&(a2+="px");R.width=1000;R.height=1000;R.coordsize="1000 1000";R.coordorigin="0 0";R.span=L.createElement("span");R.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";S[aL](R.span);E.cssText=an.format("width:{0};height:{1};position:absolute;clip:rect(0 {0} {1} 0);overflow:hidden",e,a2);if(d==1){L.body[aL](S);E.left=a1+"px";E.top=a0+"px";}else{d.style.width=e;d.style.height=a2;if(d.firstChild){d.insertBefore(S,d.firstChild);}else{d[aL](S);}}aG.call(R,R,an.fn);return R;};aT[aY].clear=function(){this.canvas.innerHTML=at;this.span=L.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas[aL](this.span);this.bottom=this.top=null;};aT[aY].remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var d in this){this[d]=s(d);}};}if((/^Apple|^Google/).test(navigator.vendor)&&!(navigator.userAgent.indexOf("Version/4.0")+1)){aT[aY].safari=function(){var d=this.rect(-99,-99,this.width+99,this.height+99);setTimeout(function(){d.remove();});};}else{aT[aY].safari=function(){};}var ae=(function(){if(L.addEventListener){return function(R,i,e,d){var E=function(S){return e.call(d,S);};R.addEventListener(i,E,false);return function(){R.removeEventListener(i,E,false);return true;};};}else{if(L.attachEvent){return function(S,E,i,e){var R=function(a0){return i.call(e,a0||au.event);};S.attachEvent("on"+E,R);var d=function(){S.detachEvent("on"+E,R);return true;};return d;};}}})();for(var ac=F[m];ac--;){(function(d){ax[aY][d]=function(e){if(an.is(e,"function")){this.events=this.events||[];this.events.push({name:d,f:e,unbind:ae(this.shape||this.node,d,e,this)});}return this;};ax[aY]["un"+d]=function(E){var i=this.events,e=i[m];while(e--){if(i[e].name==d&&i[e].f==E){i[e].unbind();i.splice(e,1);!i.length&&delete this.events;return this;}}return this;};})(F[ac]);}ax[aY].hover=function(e,d){return this.mouseover(e).mouseout(d);};ax[aY].unhover=function(e,d){return this.unmouseover(e).unmouseout(d);};aT[aY].circle=function(d,i,e){return P(this,d||0,i||0,e||0);};aT[aY].rect=function(d,R,e,i,E){return aF(this,d||0,R||0,e||0,i||0,E||0);};aT[aY].ellipse=function(d,E,i,e){return ai(this,d||0,E||0,i||0,e||0);};aT[aY].path=function(d){d&&!an.is(d,"string")&&!an.is(d[0],"array")&&(d+=at);return q(an.format[aW](an,arguments),this);};aT[aY].image=function(E,d,R,e,i){return o(this,E||"about:blank",d||0,R||0,e||0,i||0);};aT[aY].text=function(d,i,e){return X(this,d||0,i||0,e||at);};aT[aY].set=function(d){arguments[m]>1&&(d=Array[aY].splice.call(arguments,0,arguments[m]));return new T(d);};aT[aY].setSize=aV;aT[aY].top=aT[aY].bottom=null;aT[aY].raphael=an;function u(){return this.x+am+this.y;}ax[aY].scale=function(a6,a5,E,e){if(a6==null&&a5==null){return{x:this._.sx,y:this._.sy,toString:u};}a5=a5||a6;!+a5&&(a5=a6);var ba,a8,a9,a7,bm=this.attrs;if(a6!=0){var a4=this.getBBox(),a1=a4.x+a4.width/2,R=a4.y+a4.height/2,bl=a6/this._.sx,bk=a5/this._.sy;E=(+E||E==0)?E:a1;e=(+e||e==0)?e:R;var a3=~~(a6/ab.abs(a6)),a0=~~(a5/ab.abs(a5)),be=this.node.style,bo=E+(a1-E)*bl,bn=e+(R-e)*bk;switch(this.type){case"rect":case"image":var a2=bm.width*a3*bl,bd=bm.height*a0*bk;this.attr({height:bd,r:bm.r*aI(a3*bl,a0*bk),width:a2,x:bo-a2/2,y:bn-bd/2});break;case"circle":case"ellipse":this.attr({rx:bm.rx*a3*bl,ry:bm.ry*a0*bk,r:bm.r*aI(a3*bl,a0*bk),cx:bo,cy:bn});break;case"path":var bg=ad(bm.path),bh=true;for(var bj=0,bc=bg[m];bj<bc;bj++){var bf=bg[bj],bi,S=aN.call(bf[0]);if(S=="M"&&bh){continue;}else{bh=false;}if(S=="A"){bf[bg[bj][m]-2]*=bl;bf[bg[bj][m]-1]*=bk;bf[1]*=a3*bl;bf[2]*=a0*bk;bf[5]=+(a3+a0?!!+bf[5]:!+bf[5]);}else{if(S=="H"){for(bi=1,jj=bf[m];bi<jj;bi++){bf[bi]*=bl;}}else{if(S=="V"){for(bi=1,jj=bf[m];bi<jj;bi++){bf[bi]*=bk;}}else{for(bi=1,jj=bf[m];bi<jj;bi++){bf[bi]*=(bi%2)?bl:bk;}}}}}var d=U(bg),ba=bo-d.x-d.width/2,a8=bn-d.y-d.height/2;bg[0][1]+=ba;bg[0][2]+=a8;this.attr({path:bg});break;}if(this.type in {text:1,image:1}&&(a3!=1||a0!=1)){if(this.transformations){this.transformations[2]="scale("[aS](a3,",",a0,")");this.node[v]("transform",this.transformations[az](am));ba=(a3==-1)?-bm.x-(a2||0):bm.x;a8=(a0==-1)?-bm.y-(bd||0):bm.y;this.attr({x:ba,y:a8});bm.fx=a3-1;bm.fy=a0-1;}else{this.node.filterMatrix=" progid:DXImageTransform.Microsoft.Matrix(M11="[aS](a3,", M12=0, M21=0, M22=",a0,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')");be.filter=(this.node.filterMatrix||at)+(this.node.filterOpacity||at);}}else{if(this.transformations){this.transformations[2]=at;this.node[v]("transform",this.transformations[az](am));bm.fx=0;bm.fy=0;}else{this.node.filterMatrix=at;be.filter=(this.node.filterMatrix||at)+(this.node.filterOpacity||at);}}bm.scale=[a6,a5,E,e][az](am);this._.sx=a6;this._.sy=a5;}return this;};ax[aY].clone=function(){var d=this.attr();delete d.scale;delete d.translation;return this.paper[this.type]().attr(d);};var aB=function(d,e){return function(a9,S,a0){a9=H(a9);var a5,a4,E,a1,R="",a8={},a6,a3=0;for(var a2=0,a7=a9.length;a2<a7;a2++){E=a9[a2];if(E[0]=="M"){a5=+E[1];a4=+E[2];}else{a1=n(a5,a4,E[1],E[2],E[3],E[4],E[5],E[6]);if(a3+a1>S){if(e&&!a8.start){a6=an.findDotsAtSegment(a5,a4,E[1],E[2],E[3],E[4],E[5],E[6],(S-a3)/a1);R+=["C",a6.start.x,a6.start.y,a6.m.x,a6.m.y,a6.x,a6.y];if(a0){return R;}a8.start=R;R=["M",a6.x,a6.y+"C",a6.n.x,a6.n.y,a6.end.x,a6.end.y,E[5],E[6]][az]();a3+=a1;a5=+E[5];a4=+E[6];continue;}if(!d&&!e){a6=an.findDotsAtSegment(a5,a4,E[1],E[2],E[3],E[4],E[5],E[6],(S-a3)/a1);return{x:a6.x,y:a6.y,alpha:a6.alpha};}}a3+=a1;a5=+E[5];a4=+E[6];}R+=E;}a8.end=R;a6=d?a3:e?a8:an.findDotsAtSegment(a5,a4,E[1],E[2],E[3],E[4],E[5],E[6],1);a6.alpha&&(a6={x:a6.x,y:a6.y,alpha:a6.alpha});return a6;};},n=aj(function(E,d,a0,S,a6,a5,a4,a3){var R={x:0,y:0},a2=0;for(var a1=0;a1<1.01;a1+=0.01){var e=M(E,d,a0,S,a6,a5,a4,a3,a1);a1&&(a2+=ab.sqrt(aM(R.x-e.x,2)+aM(R.y-e.y,2)));R=e;}return a2;});var ap=aB(1),C=aB(),J=aB(0,1);ax[aY].getTotalLength=function(){if(this.type!="path"){return;}return ap(this.attrs.path);};ax[aY].getPointAtLength=function(d){if(this.type!="path"){return;}return C(this.attrs.path,d);};ax[aY].getSubpath=function(i,e){if(this.type!="path"){return;}if(ab.abs(this.getTotalLength()-e)<0.000001){return J(this.attrs.path,i).end;}var d=J(this.attrs.path,e,1);return i?J(d,i).end:d;};an.easing_formulas={linear:function(d){return d;},"<":function(d){return aM(d,3);},">":function(d){return aM(d-1,3)+1;},"<>":function(d){d=d*2;if(d<1){return aM(d,3)/2;}d-=2;return(aM(d,3)+2)/2;},backIn:function(e){var d=1.70158;return e*e*((d+1)*e-d);},backOut:function(e){e=e-1;var d=1.70158;return e*e*((d+1)*e+d)+1;},elastic:function(i){if(i==0||i==1){return i;}var e=0.3,d=e/4;return aM(2,-10*i)*ab.sin((i-d)*(2*ab.PI)/e)+1;},bounce:function(E){var e=7.5625,i=2.75,d;if(E<(1/i)){d=e*E*E;}else{if(E<(2/i)){E-=(1.5/i);d=e*E*E+0.75;}else{if(E<(2.5/i)){E-=(2.25/i);d=e*E*E+0.9375;}else{E-=(2.625/i);d=e*E*E+0.984375;}}}return d;}};var I={length:0},aR=function(){var a2=+new Date;for(var be in I){if(be!="length"&&I[Q](be)){var bj=I[be];if(bj.stop){delete I[be];I[m]--;continue;}var a0=a2-bj.start,bb=bj.ms,ba=bj.easing,bf=bj.from,a7=bj.diff,E=bj.to,a6=bj.t,a9=bj.prev||0,a1=bj.el,R=bj.callback,a8={},d;if(a0<bb){var S=an.easing_formulas[ba]?an.easing_formulas[ba](a0/bb):a0/bb;for(var bc in bf){if(bf[Q](bc)){switch(Z[bc]){case"along":d=S*bb*a7[bc];E.back&&(d=E.len-d);var bd=C(E[bc],d);a1.translate(a7.sx-a7.x||0,a7.sy-a7.y||0);a7.x=bd.x;a7.y=bd.y;a1.translate(bd.x-a7.sx,bd.y-a7.sy);E.rot&&a1.rotate(a7.r+bd.alpha,bd.x,bd.y);break;case"number":d=+bf[bc]+S*bb*a7[bc];break;case"colour":d="rgb("+[B(O(bf[bc].r+S*bb*a7[bc].r)),B(O(bf[bc].g+S*bb*a7[bc].g)),B(O(bf[bc].b+S*bb*a7[bc].b))][az](",")+")";break;case"path":d=[];for(var bh=0,a5=bf[bc][m];bh<a5;bh++){d[bh]=[bf[bc][bh][0]];for(var bg=1,bi=bf[bc][bh][m];bg<bi;bg++){d[bh][bg]=+bf[bc][bh][bg]+S*bb*a7[bc][bh][bg];}d[bh]=d[bh][az](am);}d=d[az](am);break;case"csv":switch(bc){case"translation":var a4=a7[bc][0]*(a0-a9),a3=a7[bc][1]*(a0-a9);a6.x+=a4;a6.y+=a3;d=a4+am+a3;break;case"rotation":d=+bf[bc][0]+S*bb*a7[bc][0];bf[bc][1]&&(d+=","+bf[bc][1]+","+bf[bc][2]);break;case"scale":d=[+bf[bc][0]+S*bb*a7[bc][0],+bf[bc][1]+S*bb*a7[bc][1],(2 in E[bc]?E[bc][2]:at),(3 in E[bc]?E[bc][3]:at)][az](am);break;case"clip-rect":d=[];var bh=4;while(bh--){d[bh]=+bf[bc][bh]+S*bb*a7[bc][bh];}break;}break;}a8[bc]=d;}}a1.attr(a8);a1._run&&a1._run.call(a1);}else{if(E.along){var bd=C(E.along,E.len*!E.back);a1.translate(a7.sx-(a7.x||0)+bd.x-a7.sx,a7.sy-(a7.y||0)+bd.y-a7.sy);E.rot&&a1.rotate(a7.r+bd.alpha,bd.x,bd.y);}(a6.x||a6.y)&&a1.translate(-a6.x,-a6.y);E.scale&&(E.scale=E.scale+at);a1.attr(E);delete I[be];I[m]--;a1.in_animation=null;an.is(R,"function")&&R.call(a1);}bj.prev=a0;}}an.svg&&a1&&a1.paper.safari();I[m]&&setTimeout(aR);},B=function(d){return d>255?255:(d<0?0:d);},t=function(d,i){if(d==null){return{x:this._.tx,y:this._.ty,toString:u};}this._.tx+=+d;this._.ty+=+i;switch(this.type){case"circle":case"ellipse":this.attr({cx:+d+this.attrs.cx,cy:+i+this.attrs.cy});break;case"rect":case"image":case"text":this.attr({x:+d+this.attrs.x,y:+i+this.attrs.y});break;case"path":var e=ad(this.attrs.path);e[0][1]+=+d;e[0][2]+=+i;this.attr({path:e});break;}return this;};ax[aY].animateWith=function(e,i,d,R,E){I[e.id]&&(i.start=I[e.id].start);return this.animate(i,d,R,E);};ax[aY].animateAlong=ay();ax[aY].animateAlongBack=ay(1);function ay(d){return function(E,i,e,S){var R={back:d};an.is(e,"function")?(S=e):(R.rot=e);E&&E.constructor==ax&&(E=E.attrs.path);E&&(R.along=E);return this.animate(R,i,S);};}ax[aY].onAnimation=function(d){this._run=d||0;return this;};ax[aY].animate=function(be,a5,a4,E){if(an.is(a4,"function")||!a4){E=a4||null;}var a9={},e={},a2={};for(var a6 in be){if(be[Q](a6)){if(Z[Q](a6)){a9[a6]=this.attr(a6);(a9[a6]==null)&&(a9[a6]=j[a6]);e[a6]=be[a6];switch(Z[a6]){case"along":var bc=ap(be[a6]),a7=C(be[a6],bc*!!be.back),R=this.getBBox();a2[a6]=bc/a5;a2.tx=R.x;a2.ty=R.y;a2.sx=a7.x;a2.sy=a7.y;e.rot=be.rot;e.back=be.back;e.len=bc;be.rot&&(a2.r=W(this.rotate())||0);break;case"number":a2[a6]=(e[a6]-a9[a6])/a5;break;case"colour":a9[a6]=an.getRGB(a9[a6]);var a8=an.getRGB(e[a6]);a2[a6]={r:(a8.r-a9[a6].r)/a5,g:(a8.g-a9[a6].g)/a5,b:(a8.b-a9[a6].b)/a5};break;case"path":var S=H(a9[a6],e[a6]);a9[a6]=S[0];var a3=S[1];a2[a6]=[];for(var bb=0,a1=a9[a6][m];bb<a1;bb++){a2[a6][bb]=[0];for(var ba=1,bd=a9[a6][bb][m];ba<bd;ba++){a2[a6][bb][ba]=(a3[bb][ba]-a9[a6][bb][ba])/a5;}}break;case"csv":var d=(be[a6]+at)[z](a),a0=(a9[a6]+at)[z](a);switch(a6){case"translation":a9[a6]=[0,0];a2[a6]=[d[0]/a5,d[1]/a5];break;case"rotation":a9[a6]=(a0[1]==d[1]&&a0[2]==d[2])?a0:[0,d[1],d[2]];a2[a6]=[(d[0]-a9[a6][0])/a5,0,0];break;case"scale":be[a6]=d;a9[a6]=(a9[a6]+at)[z](a);a2[a6]=[(d[0]-a9[a6][0])/a5,(d[1]-a9[a6][1])/a5,0,0];break;case"clip-rect":a9[a6]=(a9[a6]+at)[z](a);a2[a6]=[];var bb=4;while(bb--){a2[a6][bb]=(d[bb]-a9[a6][bb])/a5;}break;}e[a6]=d;}}}}this.stop();this.in_animation=1;I[this.id]={start:be.start||+new Date,ms:a5,easing:a4,from:a9,diff:a2,to:e,el:this,callback:E,t:{x:0,y:0}};++I[m]==1&&aR();return this;};ax[aY].stop=function(){I[this.id]&&I[m]--;delete I[this.id];return this;};ax[aY].translate=function(d,e){return this.attr({translation:d+" "+e});};ax[aY][aA]=function(){return"Rapha\xebl\u2019s object";};an.ae=I;var T=function(d){this.items=[];this[m]=0;if(d){for(var e=0,E=d[m];e<E;e++){if(d[e]&&(d[e].constructor==ax||d[e].constructor==T)){this[this.items[m]]=this.items[this.items[m]]=d[e];this[m]++;}}}};T[aY][f]=function(){var R,d;for(var e=0,E=arguments[m];e<E;e++){R=arguments[e];if(R&&(R.constructor==ax||R.constructor==T)){d=this.items[m];this[d]=this.items[d]=R;this[m]++;}}return this;};T[aY].pop=function(){delete this[this[m]--];return this.items.pop();};for(var y in ax[aY]){if(ax[aY][Q](y)){T[aY][y]=(function(d){return function(){for(var e=0,E=this.items[m];e<E;e++){this.items[e][d][aW](this.items[e],arguments);}return this;};})(y);}}T[aY].attr=function(e,a0){if(e&&an.is(e,"array")&&an.is(e[0],"object")){for(var d=0,S=e[m];d<S;d++){this.items[d].attr(e[d]);}}else{for(var E=0,R=this.items[m];E<R;E++){this.items[E].attr[aW](this.items[E],arguments);}}return this;};T[aY].animate=function(S,e,a2,a1){(an.is(a2,"function")||!a2)&&(a1=a2||null);var d=this.items[m],E=d,a0=this,R;a1&&(R=function(){!--d&&a1.call(a0);});this.items[--E].animate(S,e,a2||R,R);while(E--){this.items[E].animateWith(this.items[d-1],S,e,a2||R,R);}return this;};T[aY].insertAfter=function(e){var d=this.items[m];while(d--){this.items[d].insertAfter(e);}return this;};T[aY].getBBox=function(){var d=[],a0=[],e=[],R=[];for(var E=this.items[m];E--;){var S=this.items[E].getBBox();d[f](S.x);a0[f](S.y);e[f](S.x+S.width);R[f](S.y+S.height);}d=aI[aW](0,d);a0=aI[aW](0,a0);return{x:d,y:a0,width:g[aW](0,e)-d,height:g[aW](0,R)-a0};};an.registerFont=function(e){if(!e.face){return e;}this.fonts=this.fonts||{};var E={w:e.w,face:{},glyphs:{}},i=e.face["font-family"];for(var a0 in e.face){if(e.face[Q](a0)){E.face[a0]=e.face[a0];}}if(this.fonts[i]){this.fonts[i][f](E);}else{this.fonts[i]=[E];}if(!e.svg){E.face["units-per-em"]=G(e.face["units-per-em"],10);for(var R in e.glyphs){if(e.glyphs[Q](R)){var S=e.glyphs[R];E.glyphs[R]={w:S.w,k:{},d:S.d&&"M"+S.d[aP](/[mlcxtrv]/g,function(a1){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[a1]||"M";})+"z"};if(S.k){for(var d in S.k){if(S[Q](d)){E.glyphs[R].k[d]=S.k[d];}}}}}}return e;};aT[aY].getFont=function(a2,a3,e,R){R=R||"normal";e=e||"normal";a3=+a3||{normal:400,bold:700,lighter:300,bolder:800}[a3]||400;var S=an.fonts[a2];if(!S){var E=new RegExp("(^|\\s)"+a2[aP](/[^\w\d\s+!~.:_-]/g,at)+"(\\s|$)","i");for(var d in an.fonts){if(an.fonts[Q](d)){if(E.test(d)){S=an.fonts[d];break;}}}}var a0;if(S){for(var a1=0,a4=S[m];a1<a4;a1++){a0=S[a1];if(a0.face["font-weight"]==a3&&(a0.face["font-style"]==e||!a0.face["font-style"])&&a0.face["font-stretch"]==R){break;}}}return a0;};aT[aY].print=function(R,E,d,a1,a2,bb){bb=bb||"middle";var a7=this.set(),ba=(d+at)[z](at),a8=0,a4=at,bc;an.is(a1,"string")&&(a1=this.getFont(a1));if(a1){bc=(a2||16)/a1.face["units-per-em"];var e=a1.face.bbox.split(a),a0=+e[0],a3=+e[1]+(bb=="baseline"?e[3]-e[1]+(+a1.face.descent):(e[3]-e[1])/2);for(var a6=0,S=ba[m];a6<S;a6++){var a5=a6&&a1.glyphs[ba[a6-1]]||{},a9=a1.glyphs[ba[a6]];a8+=a6?(a5.w||a1.w)+(a5.k&&a5.k[ba[a6]]||0):0;a9&&a9.d&&a7[f](this.path(a9.d).attr({fill:"#000",stroke:"none",translation:[a8,0]}));}a7.scale(bc,bc,a0,a3).translate(R-a0,E-a3);}return a7;};an.format=function(i){var e=an.is(arguments[1],"array")?[0][aS](arguments[1]):arguments,d=/\{(\d+)\}/g;i&&an.is(i,"string")&&e[m]-1&&(i=i[aP](d,function(R,E){return e[++E]==null?at:e[E];}));return i||at;};an.ninja=function(){var d=Raphael;if(l.was){Raphael=l.is;}else{delete Raphael;}return d;};an.el=ax[aY];return an;})(); | 8,217.285714 | 57,307 | 0.631178 |
15f65a2a3d9fcc727bd9f034f6416ffe56f26dfe | 130 | js | JavaScript | src/components/shoutout.js | joshcoast/gatsby-site | df844a7a56b3ce0c9c1bdd5aba79970e67b50486 | [
"MIT"
] | 2 | 2019-08-29T15:03:17.000Z | 2019-08-29T15:15:43.000Z | src/components/shoutout.js | joshcoast/gatsby-site | df844a7a56b3ce0c9c1bdd5aba79970e67b50486 | [
"MIT"
] | 10 | 2019-08-29T10:14:25.000Z | 2022-02-26T17:03:50.000Z | src/components/shoutout.js | joshcoast/gatsby-site | df844a7a56b3ce0c9c1bdd5aba79970e67b50486 | [
"MIT"
] | null | null | null | import React from "react"
const Shoutout = ({ children }) => <div className="shoutout">{children}</div>
export default Shoutout
| 21.666667 | 77 | 0.715385 |
15f6ae698cf265daf0b904a911bf324042932839 | 5,521 | js | JavaScript | utils/markdown/index.test.js | WGH-/mattermost-webapp | 68f1ff282612b4e672a51e1ffe686faf36f3088c | [
"Apache-2.0"
] | null | null | null | utils/markdown/index.test.js | WGH-/mattermost-webapp | 68f1ff282612b4e672a51e1ffe686faf36f3088c | [
"Apache-2.0"
] | null | null | null | utils/markdown/index.test.js | WGH-/mattermost-webapp | 68f1ff282612b4e672a51e1ffe686faf36f3088c | [
"Apache-2.0"
] | null | null | null | // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {format} from './index';
describe('format', () => {
test('should highlight code without space before language', () => {
const output = format(`~~~diff
- something
+ something else
~~~`);
expect(output).toContain('<span class="post-code__language">Diff</span>');
expect(output).toContain('<code class="hljs hljs-ln">');
});
test('should highlight code with space before language', () => {
const output = format(`~~~ diff
- something
+ something else
~~~`);
expect(output).toContain('<span class="post-code__language">Diff</span>');
expect(output).toContain('<code class="hljs hljs-ln">');
});
test('should not highlight code with an invalid language', () => {
const output = format(`~~~garbage
~~~`);
expect(output).not.toContain('<span class="post-code__language">');
});
describe('lists', () => {
test('unordered lists should not include a start index', () => {
const input = `- a
- b
- c`;
const expected = `<ul className="markdown__list">
<li><span>a</span></li><li><span>b</span></li><li><span>c</span></li></ul>`;
const output = format(input);
expect(output).toBe(expected);
});
test('ordered lists starting at 1 should include a start index', () => {
const input = `1. a
2. b
3. c`;
const expected = `<ol className="markdown__list" style="counter-reset: list 0">
<li><span>a</span></li><li><span>b</span></li><li><span>c</span></li></ol>`;
const output = format(input);
expect(output).toBe(expected);
});
test('ordered lists starting at 0 should include a start index', () => {
const input = `0. a
1. b
2. c`;
const expected = `<ol className="markdown__list" style="counter-reset: list -1">
<li><span>a</span></li><li><span>b</span></li><li><span>c</span></li></ol>`;
const output = format(input);
expect(output).toBe(expected);
});
test('ordered lists starting at any other number should include a start index', () => {
const input = `999. a
1. b
1. c`;
const expected = `<ol className="markdown__list" style="counter-reset: list 998">
<li><span>a</span></li><li><span>b</span></li><li><span>c</span></li></ol>`;
const output = format(input);
expect(output).toBe(expected);
});
});
test('should wrap code without a language tag', () => {
const output = format(`~~~
this is long text this is long text this is long text this is long text this is long text this is long text
~~~`);
expect(output).toContain('post-code--wrap');
});
test('should not wrap code with a valid language tag', () => {
const output = format(`~~~java
this is long text this is long text this is long text this is long text this is long text this is long text
~~~`);
expect(output).not.toContain('post-code--wrap');
});
test('should not wrap code with an invalid language', () => {
const output = format(`~~~nowrap
this is long text this is long text this is long text this is long text this is long text this is long text
~~~`);
expect(output).not.toContain('post-code--wrap');
});
test('should highlight code with Tex highlighting without rendering', () => {
const output = format(`~~~texcode
\\sqrt{x * y + 2}
~~~`);
expect(output).toContain('<span class="post-code__language">TeX</span>');
expect(output).toContain('<code class="hljs hljs-ln">');
});
test('<a> should contain target=_blank for external links', () => {
const output = format('[external_link](http://example.com)', {siteURL: 'http://localhost'});
expect(output).toContain('<a class="theme markdown__link" href="http://example.com" rel="noreferrer" target="_blank">external_link</a>');
});
test('<a> should not contain target=_blank for internal links', () => {
const output = format('[internal_link](http://localhost/example)', {siteURL: 'http://localhost'});
expect(output).toContain('<a class="theme markdown__link" href="http://localhost/example" rel="noreferrer" data-link="/example">internal_link</a>');
});
test('<a> should not contain target=_blank for pl|channels|messages links', () => {
const pl = format('[thread](/reiciendis-0/pl/b3hrs3brjjn7fk4kge3xmeuffc))', {siteURL: 'http://localhost'});
expect(pl).toContain('<a class="theme markdown__link" href="/reiciendis-0/pl/b3hrs3brjjn7fk4kge3xmeuffc" rel="noreferrer" data-link="/reiciendis-0/pl/b3hrs3brjjn7fk4kge3xmeuffc">thread</a>');
const channels = format('[thread](/reiciendis-0/channels/b3hrs3brjjn7fk4kge3xmeuffc))', {siteURL: 'http://localhost'});
expect(channels).toContain('<a class="theme markdown__link" href="/reiciendis-0/channels/b3hrs3brjjn7fk4kge3xmeuffc" rel="noreferrer" data-link="/reiciendis-0/channels/b3hrs3brjjn7fk4kge3xmeuffc">thread</a>');
const messages = format('[thread](/reiciendis-0/messages/b3hrs3brjjn7fk4kge3xmeuffc))', {siteURL: 'http://localhost'});
expect(messages).toContain('<a class="theme markdown__link" href="/reiciendis-0/messages/b3hrs3brjjn7fk4kge3xmeuffc" rel="noreferrer" data-link="/reiciendis-0/messages/b3hrs3brjjn7fk4kge3xmeuffc">thread</a>');
});
});
| 40.595588 | 217 | 0.624162 |
15f739ec9c25fb3db9a56908e73230ba90d79b44 | 404 | js | JavaScript | javascript/graphql-auth/src/utils.js | CarlosZiegler/prisma-examples | cf9a30195df0996b244438e8bb3ab80158bd867a | [
"Apache-2.0"
] | 58 | 2019-11-22T11:36:27.000Z | 2020-08-02T15:13:15.000Z | javascript/graphql-auth/src/utils.js | CarlosZiegler/prisma-examples | cf9a30195df0996b244438e8bb3ab80158bd867a | [
"Apache-2.0"
] | 2 | 2020-11-02T11:21:51.000Z | 2021-11-25T10:48:02.000Z | javascript/graphql-auth/src/utils.js | CarlosZiegler/prisma-examples | cf9a30195df0996b244438e8bb3ab80158bd867a | [
"Apache-2.0"
] | 18 | 2019-12-08T00:44:23.000Z | 2020-07-16T09:56:27.000Z | const { verify } = require('jsonwebtoken')
const APP_SECRET = 'appsecret321'
function getUserId(context) {
const Authorization = context.request.get('Authorization')
if (Authorization) {
const token = Authorization.replace('Bearer ', '')
const verifiedToken = verify(token, APP_SECRET)
return verifiedToken && verifiedToken.userId
}
}
module.exports = {
getUserId,
APP_SECRET,
}
| 22.444444 | 60 | 0.715347 |
15f748f8a5ad677c10bb52910680fe9139dc6889 | 3,049 | js | JavaScript | app/config/authrouter.js | WwinW/ShortVideoCli | 9d4f8d724525c4c87e7ddc92e998ccadb3eeeb4e | [
"MIT"
] | null | null | null | app/config/authrouter.js | WwinW/ShortVideoCli | 9d4f8d724525c4c87e7ddc92e998ccadb3eeeb4e | [
"MIT"
] | null | null | null | app/config/authrouter.js | WwinW/ShortVideoCli | 9d4f8d724525c4c87e7ddc92e998ccadb3eeeb4e | [
"MIT"
] | null | null | null | import React from "react";
import { StatusBar, View, Text, Image } from "react-native";
import { StackNavigator, TabNavigator, DrawerNavigator } from "react-navigation";
import Icon from "react-native-vector-icons/Ionicons";
import DrawerContent from "../views/Sidebar"
import SignUp from "../views/SignUp";
import SignIn from "../views/SignIn";
import HowTo from "../views/HowTo";
import Profile from "../views/Profile";
import Logout from "../views/Logout";
import Feed from '../views/Feed';
import RumorMill from '../views/RumorMill';
import TargetSearch from '../views/TargetSearch';
import ShadeCamera from '../views/ShadeCamera';
import Terms from '../views/TermsOfService';
import EasterEgg from '../views/EasterEgg';
import Forgot from '../views/Forgot';
export const Drawer = DrawerNavigator({
Feed: {
screen: Feed,
},
Logout: {
screen: Logout,
},
Profile: {
screen: Profile,
},
RumorMill: {
screen: RumorMill,
},
HowTo: {
screen: HowTo,
}
}, {
contentComponent: DrawerContent,
drawerWidth: 250
});
export const SignedOut = StackNavigator({
SignUp: {
screen: SignUp,
navigationOptions: {
title: "Sign Up"
}
},
SignIn: {
screen: SignIn,
navigationOptions: {
title: "Sign In"
}
},
Terms: {
screen: Terms,
navigationOptions: {
title: "Terms"
}
},
Forgot: {
screen: Forgot,
navigationOptions: {
title: "Forgot"
}
},
EasterEgg: {
screen: EasterEgg,
navigationOptions: {
title: "EasterEgg"
}
},
});
export const SignedIn = TabNavigator({
Feed: {
screen: Drawer,
navigationOptions: {
tabBarLabel: "Feed",
tabBarIcon: ({ tintColor }) =>
<Icon name="ios-umbrella" size={30} color={tintColor} />
}
},
TargetSearch: {
screen: TargetSearch,
navigationOptions: {
tabBarLabel: "Select Player",
tabBarIcon: ({ tintColor }) =>
<Icon name="ios-body" size={30} color={tintColor} />
}
},
Camera: {
screen: ShadeCamera,
navigationOptions: {
tabBarLabel: "Record Shade",
tabBarIcon: ({ tintColor }) =>
<Icon name="ios-camera" size={30} color={tintColor} />
}
}
}, {
tabBarPosition: 'bottom',
swipeEnabled: true,
tabBarOptions: {
activeTintColor: '#f2f2f2',
activeBackgroundColor: "#2EC4B6",
inactiveTintColor: '#666',
labelStyle: {
fontSize: 12,
padding: 0
}
}
});
export const createRootNavigator = (signedIn = false) => {
return StackNavigator(
{
SignedIn: {
screen: SignedIn,
navigationOptions: {
gesturesEnabled: false
}
},
SignedOut: {
screen: SignedOut,
navigationOptions: {
gesturesEnabled: false
}
}
}, {
headerMode: "none",
mode: "modal", // not sure what this does
initialRouteName: signedIn ? "SignedIn" : "SignedOut"
// sets routeName to signed in if "signed in" is true, else sets it to "signed out"
}
);
}; | 22.419118 | 89 | 0.608724 |
15f815bf4e5f80a242e46a78952f99d577a19133 | 86 | js | JavaScript | commands/ping.js | AxorianDev/Boilerplate | e0c3e8da0edefeaed0bd47351ce920f8ce8c9c3d | [
"MIT"
] | null | null | null | commands/ping.js | AxorianDev/Boilerplate | e0c3e8da0edefeaed0bd47351ce920f8ce8c9c3d | [
"MIT"
] | null | null | null | commands/ping.js | AxorianDev/Boilerplate | e0c3e8da0edefeaed0bd47351ce920f8ce8c9c3d | [
"MIT"
] | null | null | null | exports.run = async (client, message, args) => {
message.channel.send("Pong!");
}; | 28.666667 | 48 | 0.627907 |
15f8212c6bb93cb1b4a9cb23e0f43a1748ffe782 | 149 | js | JavaScript | src/pages/jest.js | zhyrik/cheat-sheet-gatsby- | d77b025daf82659e849981ddbb173c81dd398124 | [
"MIT"
] | null | null | null | src/pages/jest.js | zhyrik/cheat-sheet-gatsby- | d77b025daf82659e849981ddbb173c81dd398124 | [
"MIT"
] | null | null | null | src/pages/jest.js | zhyrik/cheat-sheet-gatsby- | d77b025daf82659e849981ddbb173c81dd398124 | [
"MIT"
] | null | null | null | import React from 'react'
import Layout from '../components/layout'
import { arr } from '../store/jest'
export default () => <Layout arr={ arr }/>
| 21.285714 | 42 | 0.66443 |
15f87d24fbbba8af3321afa5e86a71ba2024fabf | 6,575 | js | JavaScript | app/assets/javascripts/uzcommon/imageUploadWrapper.js | leouz/uzcommon | 9405795125f28a1fafcf7143fc4c54fa18ad5169 | [
"MIT"
] | null | null | null | app/assets/javascripts/uzcommon/imageUploadWrapper.js | leouz/uzcommon | 9405795125f28a1fafcf7143fc4c54fa18ad5169 | [
"MIT"
] | null | null | null | app/assets/javascripts/uzcommon/imageUploadWrapper.js | leouz/uzcommon | 9405795125f28a1fafcf7143fc4c54fa18ad5169 | [
"MIT"
] | null | null | null | $(document).ready(function() {
$.fn.extend({
imageUploadWrapper: function (options) {
// input example:
//<input id="fileupload" type="file" name="asset[file][]"
// multiple="" get-images-url="/admin/assets/get" destroy-images-url="/admin/assets/destroy"
// data-url="#{admin_assets_path}" data-group="all" />
this.options = {
isMultiple: null,// true/false,
destroyImagesUrl: null,// "/admin/assets/destroy",
getImagesUrl: null,// "/admin/assets/get",
events: {
onUploadStart: function (data, file) {},
onUploadProgress: function (data, progress) {},
onUploadFinish: function (data, result) {},
onDelete: function () {}
},
templates: {
buttons: function () {
return $('<div id="image-upload-buttons">').append(
$('<button id="image-upload-remove-selected" class="btn btn-xs btn-danger" type="submit">').append(
$('<span class="glyphicon glyphicon-trash">').append('Remove selected')),
$('<span class="check-all btn btn-xs btn-info">').append(
$('<span class="glyphicon glyphicon-check">').append('Check All')),
$('<span class="uncheck-all btn btn-xs btn-info">').append(
$('<span class="glyphicon glyphicon-check">').append('Uncheck All'))
);
},
displayImageContainer: function () {
return $('<div id="image-upload-images">');
},
imageThumb: function (id, url, thumbUrl) {
var div = $('<div>').addClass('thumb img img-thumbnail').css({"background-image": "url('" + thumbUrl + "')"});
div.append($('<input>').addClass('img check').attr({value: id, type: "checkbox"}));
return $('<a>').attr({href: url}).append(div);
},
imageThumbLoading: function () {
return $('<div>').addClass('thumb img img-thumbnail').append(
$('<span>').addClass('label label-info').html('0%')
);
},
mountSingle: function (element, displayImageContainer) {
$(element).after(displayImageContainer);
},
mountMultiple: function (element, buttons, displayImageContainer) {
$(element).after(buttons, displayImageContainer);
}
}
};
this.options = $.extend(true, {}, this.options, options || {});
this.reset = function () {
$('div#image-upload-images').empty();
};
var $element = $(this);
var _options = this.options;
if (_options.isMultiple == null)
_options.isMultiple = $element.is('[multiple]');
if (_options.destroyImagesUrl == null)
_options.destroyImagesUrl = $element.attr('destroy-images-url');
if (_options.getImagesUrl == null)
_options.getImagesUrl = $element.attr('get-images-url');
var deleteCheckedImages = function () {
var $checked = $('input.img.check:checked');
var data = $checked.map(function() { return $(this).val(); }).get();
if (data.length > 0)
$.post(_options.destroyImagesUrl, { assets: data }, function () {
$.each($checked, function (i, e) {
$(e).parent().fadeOut(1500, function () { $(this).remove(); });
});
});
}
if (_options.isMultiple) {
//mount the DOM structure
_options.templates.mountMultiple(
$element,
_options.templates.buttons(),
_options.templates.displayImageContainer()
);
//initialize check actions
$('.uncheck-all').hide();
$(document).on('click', '.check-all', function() {
$('.check-all').hide();
$('.uncheck-all').show();
$('.check').prop('checked', true);
});
$(document).on('click', '.uncheck-all', function() {
$('.check-all').show();
$('.uncheck-all').hide();
$('.check').prop('checked', false);
});
//initialize remove checked
$(document).on('click', '#image-upload-remove-selected', function() {
deleteCheckedImages();
});
$.get(_options.getImagesUrl, function(data) {
$.each(data, function(i, e) {
$('div#image-upload-images').append(_options.templates.imageThumb(e.id, e.file.url, e.file.thumb.url));
});
});
} else {
//mount the DOM structure
_options.templates.mountSingle(
$element,
_options.templates.displayImageContainer()
);
}
$element.fileupload({
dataType: 'json',
replaceFileInput: false,
add: function(e, data) {
var types = /(\.|\/)(gif|jpe?g|png)$/i;
var file = data.files[0];
if (types.test(file.type) || types.test(file.name)) {
data.context = _options.templates.imageThumbLoading(file.name);
if (!_options.isMultiple) {
$('.check').prop('checked', true);
deleteCheckedImages();
$('div#image-upload-images').empty();
}
$('div#image-upload-images').prepend(data.context);
_options.events.onUploadStart(data, file);
return data.submit();
} else {
alert(file.name + " is not a gif, jpeg, or png image file");
}
},
progress: function(e, data) {
var progress;
if (data.context) {
progress = parseInt(data.loaded / data.total * 100, 10);
data.context.find('span').html(progress + '%');
}
_options.events.onUploadProgress(data, progress);
},
done: function (e, data) {
$(data.context).replaceWith(_options.templates.imageThumb(data.result.id, data.result.url, data.result.thumb));
$(this).val("");
if (!_options.isMultiple)
$('.check').hide();
_options.events.onUploadFinish(data, data.result);
},
fail: function (e, data) { alert(data.result.error); },
always: function (e, data) { $(data.context).remove(); }
});
return this;
}
});
}); | 38.676471 | 132 | 0.505703 |
15f8ad01d8027f3315b790a026394ec7671e556c | 2,874 | js | JavaScript | node_modules/conventional-changelog-writer/cli.js | itspriyansh/filemanager-packages | fc7e36165c4673bd860e3896d17b33ae769bffd1 | [
"Apache-2.0"
] | 4 | 2019-06-15T09:52:42.000Z | 2020-02-15T06:38:57.000Z | node_modules/conventional-changelog-writer/cli.js | itspriyansh/filemanager-packages | fc7e36165c4673bd860e3896d17b33ae769bffd1 | [
"Apache-2.0"
] | 18 | 2019-12-30T03:38:08.000Z | 2022-02-26T01:45:34.000Z | node_modules/conventional-changelog-writer/cli.js | itspriyansh/filemanager-packages | fc7e36165c4673bd860e3896d17b33ae769bffd1 | [
"Apache-2.0"
] | 11 | 2019-06-14T15:36:34.000Z | 2021-04-24T20:40:09.000Z | #!/usr/bin/env node
'use strict'
var conventionalChangelogWriter = require('./')
var forEach = require('lodash').forEach
var fs = require('fs')
var meow = require('meow')
var path = require('path')
var split = require('split')
var cli = meow(`
Usage
conventional-changelog-writer <path> [<path> ...]
cat <path> | conventional-changelog-writer
,
Example
conventional-changelog-writer commits.ldjson
cat commits.ldjson | conventional-changelog-writer
,
Options
-c, --context A filepath of a json that is used to define template variables
-o, --options A filepath of a javascript object that is used to define options
`, {
flags: {
context: {
alias: `c`
},
options: {
alias: `o`
}
}
})
var filePaths = []
var flags = cli.flags
forEach(cli.input, function (input) {
filePaths.push(input)
})
var length = filePaths.length
var templateContext
var contextPath = flags.context
if (contextPath) {
try {
templateContext = require(path.resolve(process.cwd(), contextPath))
} catch (err) {
console.error('Failed to get context from file ' + contextPath + '\n' + err)
process.exit(1)
}
}
var options
var optionsPath = flags.options
if (optionsPath) {
try {
options = require(path.resolve(process.cwd(), optionsPath))
} catch (err) {
console.error('Failed to get options from file ' + optionsPath + '\n' + err)
process.exit(1)
}
}
try {
var stream = conventionalChangelogWriter(templateContext, options)
} catch (err) {
console.error(err.toString())
process.exit(1)
}
function processFile (fileIndex) {
var filePath = filePaths[fileIndex]
fs.createReadStream(filePath)
.on('error', function (err) {
console.warn('Failed to read file ' + filePath + '\n' + err)
if (++fileIndex < length) {
processFile(fileIndex)
}
})
.pipe(split(JSON.parse))
.on('error', function (err) {
console.warn('Failed to split commits in file ' + filePath + '\n' + err)
})
.pipe(stream)
.on('error', function (err) {
console.warn('Failed to process file ' + filePath + '\n' + err)
if (++fileIndex < length) {
processFile(fileIndex)
}
})
.on('end', function () {
if (++fileIndex < length) {
processFile(fileIndex)
}
})
.pipe(process.stdout)
}
if (!process.stdin.isTTY) {
process.stdin
.pipe(split(JSON.parse))
.on('error', function (err) {
console.error('Failed to split commits\n' + err)
process.exit(1)
})
.pipe(stream)
.on('error', function (err) {
console.error('Failed to process file\n' + err)
process.exit(1)
})
.pipe(process.stdout)
} else if (length === 0) {
console.error('You must specify at least one line delimited json file')
process.exit(1)
} else {
processFile(0)
}
| 24.355932 | 87 | 0.623521 |
15f8dd90ce83c9e3d35affacec0f9d381fb6a998 | 531 | js | JavaScript | src/core/type-validators/int32.js | minhyung-joo/one-schema | 5749bf12b0e7080c85810d4e8372bcdc62771aae | [
"MIT"
] | null | null | null | src/core/type-validators/int32.js | minhyung-joo/one-schema | 5749bf12b0e7080c85810d4e8372bcdc62771aae | [
"MIT"
] | null | null | null | src/core/type-validators/int32.js | minhyung-joo/one-schema | 5749bf12b0e7080c85810d4e8372bcdc62771aae | [
"MIT"
] | null | null | null | import { vrError, vrSuccess } from '../validatorResult';
export default function (x, fieldValidator) {
if (typeof x !== 'number' || x !== ~~x || Number.isNaN(x)) {
return vrError('is not type number or is not a 32 bit integer');
}
const { min, max } = fieldValidator.settings;
if (typeof min === 'number' && x < min) {
return vrError(`is less than minimum value: ${min}`);
}
if (typeof max === 'number' && x > max) {
return vrError(`is greater than maximum value: ${max}`);
}
return vrSuccess();
}
| 26.55 | 68 | 0.608286 |
15f92959ecf74c77536d89fbadc77f18ea5983b7 | 8,677 | js | JavaScript | v3/src/animation/frame/Animation.js | mjcandle/Phaser | c0254bbbf0566761ca4f1e16c295c0a0625b483a | [
"MIT"
] | null | null | null | v3/src/animation/frame/Animation.js | mjcandle/Phaser | c0254bbbf0566761ca4f1e16c295c0a0625b483a | [
"MIT"
] | null | null | null | v3/src/animation/frame/Animation.js | mjcandle/Phaser | c0254bbbf0566761ca4f1e16c295c0a0625b483a | [
"MIT"
] | null | null | null | var GetObjectValue = require('../../utils/object/GetObjectValue');
var GetFrames = require('./GetFrames');
var Animation = function (manager, key, config)
{
this.manager = manager;
this.key = key;
// A frame based animation (as opposed to a bone based animation)
this.type = 'frame';
// Extract all the frame data into the frames array
this.frames = GetFrames(manager.textureManager, GetObjectValue(config, 'frames', []));
// The frame rate of playback in frames per second (default 24 if duration is null)
this.frameRate = GetObjectValue(config, 'framerate', null);
// How long the animation should play for. If frameRate is set it overrides this value
// otherwise frameRate is derived from duration
this.duration = GetObjectValue(config, 'duration', null);
if (this.duration === null && this.frameRate === null)
{
// No duration or frameRate given, use default frameRate of 24fps
this.frameRate = 24;
this.duration = this.frameRate / this.frames.length;
}
else if (this.duration && this.frameRate === null)
{
// Duration given but no frameRate, so set the frameRate based on duration
// I.e. 12 frames in the animation, duration = 4 (4000 ms)
// So frameRate is 12 / 4 = 3 fps
this.frameRate = this.frames.length / this.duration;
}
else
{
// frameRate given, derive duration from it (even if duration also specified)
// I.e. 15 frames in the animation, frameRate = 30 fps
// So duration is 15 / 30 = 0.5 (half a second)
this.duration = this.frames.length / this.frameRate;
}
// ms per frame (without including frame specific modifiers)
this.msPerFrame = 1000 / this.frameRate;
// Skip frames if the time lags, or always advanced anyway?
this.skipMissedFrames = GetObjectValue(config, 'skipMissedFrames', true);
// Delay before starting playback (in seconds)
this.delay = GetObjectValue(config, 'delay', 0);
// Number of times to repeat the animation (-1 for infinity)
this.repeat = GetObjectValue(config, 'repeat', 0);
// Delay before the repeat starts (in seconds)
this.repeatDelay = GetObjectValue(config, 'repeatDelay', 0);
// Should the animation yoyo? (reverse back down to the start) before repeating?
this.yoyo = GetObjectValue(config, 'yoyo', false);
// Should sprite.visible = true when the animation starts to play?
this.showOnStart = GetObjectValue(config, 'showOnStart', false);
// Should sprite.visible = false when the animation finishes?
this.hideOnComplete = GetObjectValue(config, 'hideOnComplete', false);
// Callbacks
this.callbackScope = GetObjectValue(config, 'callbackScope', this);
this.onStart = GetObjectValue(config, 'onStart', false);
this.onStartParams = GetObjectValue(config, 'onStartParams', []);
this.onRepeat = GetObjectValue(config, 'onRepeat', false);
this.onRepeatParams = GetObjectValue(config, 'onRepeatParams', []);
// Called for EVERY frame of the animation.
// See AnimationFrame.onUpdate for a frame specific callback.
this.onUpdate = GetObjectValue(config, 'onUpdate', false);
this.onUpdateParams = GetObjectValue(config, 'onUpdateParams', []);
this.onComplete = GetObjectValue(config, 'onComplete', false);
this.onCompleteParams = GetObjectValue(config, 'onCompleteParams', []);
};
Animation.prototype.constructor = Animation;
Animation.prototype = {
load: function (component, startFrame)
{
if (startFrame >= this.frames.length)
{
startFrame = 0;
}
if (component.currentAnim !== this)
{
component.currentAnim = this;
component._timeScale = 1;
component.frameRate = this.frameRate;
component.duration = this.duration;
component.msPerFrame = this.msPerFrame;
component.skipMissedFrames = this.skipMissedFrames;
component._delay = this.delay;
component._repeat = this.repeat;
component._repeatDelay = this.repeatDelay;
component._yoyo = this.yoyo;
component._callbackArgs[1] = this;
component._updateParams = component._callbackArgs.concat(this.onUpdateParams);
}
component.updateFrame(this.frames[startFrame]);
},
checkFrame: function (index)
{
return (index < this.frames.length);
},
getFirstTick: function (component, includeDelay)
{
if (includeDelay === undefined) { includeDelay = true; }
// When is the first update due?
component.accumulator = 0;
component.nextTick = component.msPerFrame + component.currentFrame.duration;
if (includeDelay)
{
component.nextTick += (component._delay * 1000);
}
},
getNextTick: function (component)
{
// When is the next update due?
component.accumulator -= component.nextTick;
component.nextTick = component.msPerFrame + component.currentFrame.duration;
},
nextFrame: function (component)
{
var frame = component.currentFrame;
// TODO: Add frame skip support
if (frame.isLast)
{
// We're at the end of the animation
// Yoyo? (happens before repeat)
if (this.yoyo)
{
component.forward = false;
component.updateFrame(frame.prevFrame);
// Delay for the current frame
this.getNextTick(component);
}
else if (component.repeatCounter > 0)
{
// Repeat (happens before complete)
this.repeatAnimation(component);
}
else
{
this.completeAnimation(component);
}
}
else
{
component.updateFrame(frame.nextFrame);
this.getNextTick(component);
}
},
previousFrame: function (component)
{
var frame = component.currentFrame;
// TODO: Add frame skip support
if (frame.isFirst)
{
// We're at the start of the animation
if (component.repeatCounter > 0)
{
// Repeat (happens before complete)
this.repeatAnimation(component);
}
else
{
this.completeAnimation(component);
}
}
else
{
component.updateFrame(frame.prevFrame);
this.getNextTick(component);
}
},
repeatAnimation: function (component)
{
if (component._repeatDelay > 0 && component.pendingRepeat === false)
{
component.pendingRepeat = true;
component.accumulator -= component.nextTick;
component.nextTick += (component._repeatDelay * 1000);
}
else
{
component.repeatCounter--;
component.forward = true;
component.updateFrame(component.currentFrame.nextFrame);
this.getNextTick(component);
component.pendingRepeat = false;
if (this.onRepeat)
{
this.onRepeat.apply(this.callbackScope, component._callbackArgs.concat(this.onRepeatParams));
}
}
},
completeAnimation: function (component)
{
if (this.hideOnComplete)
{
component.parent.visible = false;
}
component.stop(true);
},
setFrame: function (component)
{
// Work out which frame should be set next on the child, and set it
if (component.forward)
{
this.nextFrame(component);
}
else
{
this.previousFrame(component);
}
},
toJSON: function ()
{
var output = {
key: this.key,
type: this.type,
frames: [],
framerate: this.frameRate,
duration: this.duration,
skipMissedFrames: this.skipMissedFrames,
delay: this.delay,
repeat: this.repeat,
repeatDelay: this.repeatDelay,
yoyo: this.yoyo,
showOnStart: this.showOnStart,
hideOnComplete: this.hideOnComplete
};
this.frames.forEach(function (frame)
{
output.frames.push(frame.toJSON());
});
return output;
},
destroy: function ()
{
}
};
module.exports = Animation;
| 29.817869 | 109 | 0.590872 |
15f957972ffdf0372db2376dd9b5c052c9d6e94d | 1,402 | js | JavaScript | src/VSCode/Command.js | sjpgarcia/vscode-ide-purescript | 685bee61cd045239b355b677d771714da7eb59f9 | [
"MIT"
] | 184 | 2016-01-02T13:49:01.000Z | 2022-03-04T21:58:39.000Z | src/VSCode/Command.js | sjpgarcia/vscode-ide-purescript | 685bee61cd045239b355b677d771714da7eb59f9 | [
"MIT"
] | 180 | 2016-02-25T16:32:49.000Z | 2022-03-21T14:46:10.000Z | src/VSCode/Command.js | sjpgarcia/vscode-ide-purescript | 685bee61cd045239b355b677d771714da7eb59f9 | [
"MIT"
] | 36 | 2016-03-01T09:30:48.000Z | 2022-01-04T02:58:57.000Z | "use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.executeCb = exports.execute = exports.register = void 0;
var vscode = require("vscode");
exports.register = function (command) { return function (callback) { return function () {
return vscode.commands.registerCommand(command, function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return callback(args)();
});
}; }; };
exports.execute = function (command) { return function (args) { return function () {
var _a;
return (_a = vscode.commands).executeCommand.apply(_a, __spreadArrays([command], args));
}; }; };
exports.executeCb = function (command) { return function (args) { return function (cb) { return function () {
var _a;
return (_a = vscode.commands).executeCommand.apply(_a, __spreadArrays([command], args)).then(function (res) {
console.log(res);
cb(res);
}, function (err) {
console.error("Command error", err);
});
}; }; }; };
| 41.235294 | 113 | 0.592011 |
15f9a27c97a2076c3265cbc99dc53e78628f6a21 | 1,443 | js | JavaScript | application/assets/ckeditor/plugins/flash/lang/hu.js | NikkiRufiansya/NLP_ProsaAI | d1961afb9aaaf7ea0957bc7f8126f19adf8c3021 | [
"MIT"
] | null | null | null | application/assets/ckeditor/plugins/flash/lang/hu.js | NikkiRufiansya/NLP_ProsaAI | d1961afb9aaaf7ea0957bc7f8126f19adf8c3021 | [
"MIT"
] | 2 | 2018-12-05T08:38:24.000Z | 2018-12-05T08:39:10.000Z | application/assets/ckeditor/plugins/flash/lang/hu.js | NikkiRufiansya/Tugas-IR-2018 | 15f2db6cc7e8c15a27799abf7ff7da500f72f962 | [
"MIT"
] | null | null | null | /*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'flash', 'hu', {
access: 'Szkript hozzáférés',
accessAlways: 'Mindig',
accessNever: 'Soha',
accessSameDomain: 'Azonos domainről',
alignAbsBottom: 'Legaljára',
alignAbsMiddle: 'Közepére',
alignBaseline: 'Alapvonalhoz',
alignTextTop: 'Szöveg tetejére',
bgcolor: 'Háttérszín',
chkFull: 'Teljes képernyő engedélyezése',
chkLoop: 'Folyamatosan',
chkMenu: 'Flash menü engedélyezése',
chkPlay: 'Automata lejátszás',
flashvars: 'Flash változók',
hSpace: 'Vízsz. táv',
properties: 'Flash tulajdonságai',
propertiesTab: 'Tulajdonságok',
quality: 'Minőség',
qualityAutoHigh: 'Automata jó',
qualityAutoLow: 'Automata gyenge',
qualityBest: 'Legjobb',
qualityHigh: 'Jó',
qualityLow: 'Gyenge',
qualityMedium: 'Közepes',
scale: 'Méretezés',
scaleAll: 'Mindent mutat',
scaleFit: 'Teljes kitöltés',
scaleNoBorder: 'Keret nélkül',
title: 'Flash tulajdonságai',
vSpace: 'Függ. táv',
validateHSpace: 'A vízszintes távolsűág mezőbe csak számokat írhat.',
validateSrc: 'Adja meg a hivatkozás webcímét',
validateVSpace: 'A függőleges távolsűág mezőbe csak számokat írhat.',
windowMode: 'Ablak mód',
windowModeOpaque: 'Opaque',
windowModeTransparent: 'Transparent',
windowModeWindow: 'Window'
} );
| 32.795455 | 81 | 0.723493 |
15fa66bea28f6c465087ea5cd829f0ac2077bf19 | 4,841 | js | JavaScript | src/components/LandingPages/UTA/RegistryModal.js | Picolab/ManifoldRewrite | f04aa21eae7fcb7dc2447050bc8ace332c29b91b | [
"MIT"
] | 4 | 2019-10-09T19:28:18.000Z | 2021-02-16T13:26:22.000Z | src/components/LandingPages/UTA/RegistryModal.js | Picolab/Manifold | 5811f4d56212a7c6ea2313ce9cfb3cde19ac0fc5 | [
"MIT"
] | 179 | 2017-08-15T17:56:53.000Z | 2021-12-02T20:07:47.000Z | src/components/LandingPages/UTA/RegistryModal.js | Picolab/ManifoldRewrite | f04aa21eae7fcb7dc2447050bc8ace332c29b91b | [
"MIT"
] | null | null | null | import React, { Component } from 'react';
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Form, FormGroup, Label, Input } from 'reactstrap';
//import { SCORE_WRAPPER_DID } from '../../../utils/config.js';
function getTracker() {
let stored = localStorage.getItem("scoreTracker");
console.log(stored);
return stored;
}
class RegistryModal extends Component {
constructor(props) {
super(props);
this.toggle = this.toggle.bind(this);
this.submitRegister = this.submitRegister.bind(this);
this.submitRecover = this.submitRecover.bind(this);
this.switchViews = this.switchViews.bind(this);
this.state = {
registerView: true,
open: (getTracker()) ? false : true,
first: '',
last: '',
phoneNum: '',
recoveryCode: ''
}
}
toggle() {
this.setState({
open: !this.state.open
})
}
onChange(name) {
return (e) => {
this.setState({
[name]: e.target.value
})
}
}
submitRegister() {
if(!this.state.first || !this.state.last || !this.state.phoneNum) {
return; //missing attributes...
}
//var promise = customEvent(SCORE_WRAPPER_DID, "score_wrapper", "new_participant", {first: this.state.first, last: this.state.last, phoneNum: this.state.phoneNum}, "register")
/*promise.then((resp) => {
let cookie = resp.data.directives[0].options.cookie;
window.localStorage.setItem("scoreTracker", cookie.split(";")[0].split("=")[1]);
this.setState({open : (getTracker()) ? false : true});
this.props.getStanding();
});*/
}
submitRecover() {
if(!this.state.recoveryCode) {
return; //missing attributes...
}
//var promise = customEvent(SCORE_WRAPPER_DID, "score_wrapper", "recovery_needed", {first: this.state.first, last: this.state.last, recoveryCode: this.state.recoveryCode}, "recover")
/*promise.then((resp) => {
let cookie = resp.data.directives[0].options.cookie;
window.localStorage.setItem("scoreTracker", cookie.split(";")[0].split("=")[1]);
this.setState({open : (getTracker()) ? false : true});
});*/
}
switchViews() {
this.setState({
registerView: !this.state.registerView
});
}
isValid(name) {
if(this.state[name]) {
return true;
}
return false;
}
modal() {
if(this.state.registerView) return this.register();
else return this.recover();
}
register() {
return (
<div>
<ModalHeader>Sign Up to Participate</ModalHeader>
<ModalBody>
<Form>
<FormGroup>
<Label for="first">First Name</Label>
<Input type="text" name="firstName" id="first" placeholder="ex. John" onChange={this.onChange('first')} value={this.state.first}/>
</FormGroup>
<FormGroup>
<Label for="last">Last Name</Label>
<Input type="text" name="lastName" id="last" placeholder="ex. Smith" onChange={this.onChange('last')} value={this.state.last}/>
</FormGroup>
<FormGroup>
<Label for="phone">Phone Number</Label>
<Input type="text" name="phone" id="phone" placeholder="ex. 555-555-5555" onChange={this.onChange('phoneNum')} value={this.state.phoneNum}/>
</FormGroup>
</Form>
</ModalBody>
<ModalFooter>
<Button color="secondary" onClick={this.switchViews}>Recover Points</Button>
<Button color="primary" onClick={this.submitRegister}>Register</Button>
</ModalFooter>
</div>
);
}
recover() {
return (
<div>
<ModalHeader>Recover Your Points</ModalHeader>
<ModalBody>
<Form>
<FormGroup>
<Label for="first">First Name</Label>
<Input type="text" name="firstName" id="first" placeholder="ex. John" onChange={this.onChange('first')} value={this.state.first}/>
</FormGroup>
<FormGroup>
<Label for="last">Last Name</Label>
<Input type="text" name="lastName" id="last" placeholder="ex. Smith" onChange={this.onChange('last')} value={this.state.last}/>
</FormGroup>
<FormGroup>
<Label for="recoveryCode">Recovery Code</Label>
<Input type="text" name="recoveryCode" id="recoveryCode" placeholder="xxxx-xxxxx-xxxxx" value={this.state.recoveryCode} onChange={this.onChange('recoveryCode')}/>
</FormGroup>
</Form>
</ModalBody>
<ModalFooter>
<Button color="secondary" onClick={this.switchViews}>Back</Button>
<Button color="primary" onClick={this.submitRecover}>Recover</Button>
</ModalFooter>
</div>
);
}
render() {
return(
<div>
<Modal isOpen={this.state.open} >
{this.modal()}
</Modal>
</div>
);
}
}
export default RegistryModal;
| 30.639241 | 186 | 0.601115 |
15fa80e4de7ca6d952ecc795ba460d6fce6c97c6 | 351 | js | JavaScript | tools/vf-component-generator/gulp-tasks/vf-generator.js | visual-framework/vf-core | d0cad76f635b5ac48667f90cb85ee8ff609dca08 | [
"Apache-2.0"
] | 17 | 2020-03-04T06:49:11.000Z | 2021-11-02T09:34:20.000Z | tools/vf-component-generator/gulp-tasks/vf-generator.js | visual-framework/vf-core | d0cad76f635b5ac48667f90cb85ee8ff609dca08 | [
"Apache-2.0"
] | 1,335 | 2018-11-07T10:09:53.000Z | 2022-03-30T16:35:01.000Z | tools/vf-component-generator/gulp-tasks/vf-generator.js | visual-framework/vf-core | d0cad76f635b5ac48667f90cb85ee8ff609dca08 | [
"Apache-2.0"
] | 9 | 2019-02-28T10:08:44.000Z | 2021-09-27T08:43:19.000Z | "use strict";
/**
* Expose vf-component gulp task as a JS module
* This makes dependency management a bit cleaner
*/
module.exports = function(gulp, path) {
const shell = require("gulp-shell");
const generatorPath = path.resolve(__dirname, "..");
gulp.task("vf-component", shell.task(
["yo " + generatorPath]
));
return gulp;
};
| 18.473684 | 54 | 0.65812 |
15fb333bc57fa4ed16e2d2cce6835f6a79b5db7e | 233 | js | JavaScript | module/Post/PostValidation.js | darcusfenix/app-portfolio-core | 6f6ebeda1ad99d915e68268cce5d41d2b2adb956 | [
"MIT"
] | null | null | null | module/Post/PostValidation.js | darcusfenix/app-portfolio-core | 6f6ebeda1ad99d915e68268cce5d41d2b2adb956 | [
"MIT"
] | null | null | null | module/Post/PostValidation.js | darcusfenix/app-portfolio-core | 6f6ebeda1ad99d915e68268cce5d41d2b2adb956 | [
"MIT"
] | null | null | null | "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
// @flow
var PostValidation = {
name: {
notEmpty: true
},
type: {
notEmpty: true
}
};
exports.default = PostValidation; | 15.533333 | 46 | 0.583691 |
15fbe190c9996b822a8f1f3dc1a70275ced1164d | 118 | js | JavaScript | lib/index.js | arkerone/tiny-container | 91066893af9a3a7b1d80501a093d2ad7169d3095 | [
"MIT"
] | null | null | null | lib/index.js | arkerone/tiny-container | 91066893af9a3a7b1d80501a093d2ad7169d3095 | [
"MIT"
] | null | null | null | lib/index.js | arkerone/tiny-container | 91066893af9a3a7b1d80501a093d2ad7169d3095 | [
"MIT"
] | null | null | null | const Container = require('./Container')
module.exports = {
createContainer () {
return new Container()
},
}
| 14.75 | 40 | 0.644068 |
15fcabee7d725c11591f41331145d5bab0cc10ea | 365 | js | JavaScript | src/lib/componentDeclarative/utils/loadState.js | agutoli/components | d933384f4a17a702aac709e45b9ae2afd209a9c3 | [
"Apache-2.0"
] | null | null | null | src/lib/componentDeclarative/utils/loadState.js | agutoli/components | d933384f4a17a702aac709e45b9ae2afd209a9c3 | [
"Apache-2.0"
] | null | null | null | src/lib/componentDeclarative/utils/loadState.js | agutoli/components | d933384f4a17a702aac709e45b9ae2afd209a9c3 | [
"Apache-2.0"
] | null | null | null | const { readState } = require('../../../utils')
async function loadState(state) {
return state.components.reduce(async (accum, config) => {
accum = await accum
const id = config.stateFileName
.split('.')
.slice(0, -1)
.join('.')
accum[config.instanceId] = await readState(id)
return accum
}, {})
}
module.exports = loadState
| 22.8125 | 59 | 0.610959 |
15fcc0861edcc9f9ceac992ba4c483b5ddb77846 | 4,703 | js | JavaScript | docs/icon.logo_kubernetes-js.min.js | aleksandarj93/eui | 900b76d970e346651b2279a4be67155349b66181 | [
"Apache-2.0"
] | 1 | 2021-11-30T09:23:06.000Z | 2021-11-30T09:23:06.000Z | docs/icon.logo_kubernetes-js.min.js | aleksandarj93/eui | 900b76d970e346651b2279a4be67155349b66181 | [
"Apache-2.0"
] | 20 | 2021-09-10T13:01:39.000Z | 2022-02-08T19:48:10.000Z | docs/icon.logo_kubernetes-js.min.js | ashikmeerankutty/eui | f4813c529873ef25efaee359ba981e1f7951dee2 | [
"Apache-2.0"
] | 1 | 2022-02-16T16:52:48.000Z | 2022-02-16T16:52:48.000Z | (window.webpackJsonp=window.webpackJsonp||[]).push([[210],{3633:function(l,t,a){"use strict";a.r(t),a.d(t,"icon",(function(){return i}));a(13),a(3),a(4),a(9),a(2),a(10);var e=a(0),r=a.n(e);function n(){return(n=Object.assign||function(l){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(l[e]=a[e])}return l}).apply(this,arguments)}function c(l,t){if(null==l)return{};var a,e,r=function(l,t){if(null==l)return{};var a,e,r={},n=Object.keys(l);for(e=0;e<n.length;e++)a=n[e],t.indexOf(a)>=0||(r[a]=l[a]);return r}(l,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(l);for(e=0;e<n.length;e++)a=n[e],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(l,a)&&(r[a]=l[a])}return r}var i=function(l){var t=l.title,a=l.titleId,e=c(l,["title","titleId"]);return r.a.createElement("svg",n({width:32,height:32,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":a},e),t?r.a.createElement("title",{id:a},t):null,r.a.createElement("path",{d:"M15.89.003a2.14 2.14 0 011.03.206l11.127 5.304a2.11 2.11 0 011.15 1.429l2.75 11.921a2.09 2.09 0 01-.412 1.783l-7.697 9.56c-.404.5-1.016.792-1.663.791L9.827 31c-.648 0-1.26-.292-1.664-.793l-7.7-9.558a2.107 2.107 0 01-.41-1.783L2.798 6.945a2.11 2.11 0 011.151-1.43L15.074.21c.255-.122.532-.192.815-.206zM16 4.06c-.368 0-.667.33-.667.738l.002.019c0 .055-.003.122-.002.17.01.236.06.416.091.632.057.464.103.849.074 1.206-.028.135-.127.258-.216.344l-.015.281a8.569 8.569 0 00-5.555 2.666 9.98 9.98 0 01-.24-.17c-.12.016-.24.053-.396-.038-.298-.2-.57-.477-.898-.81-.15-.16-.26-.31-.438-.464-.04-.035-.103-.082-.148-.118a.793.793 0 00-.464-.175.642.642 0 00-.53.234c-.23.288-.156.726.163.98l.01.008c.044.035.098.08.138.11.19.14.363.212.552.323.398.246.729.45.99.695.103.108.12.3.134.383l.214.19a8.592 8.592 0 00-1.36 5.998l-.278.08c-.074.096-.177.245-.286.29-.343.107-.728.147-1.194.195-.218.018-.407.008-.639.051-.05.01-.122.029-.177.042l-.006.001-.01.003c-.393.095-.645.455-.564.81.082.355.465.57.86.485l.01-.001.013-.004c.055-.012.124-.026.172-.039.228-.06.393-.15.597-.228.44-.158.806-.29 1.161-.341.149-.012.305.091.383.135l.29-.05a8.654 8.654 0 003.84 4.787l-.12.29c.043.113.091.265.059.376-.13.334-.35.688-.603 1.081-.122.182-.247.324-.357.532-.026.05-.06.126-.086.179-.17.365-.045.786.284.944.33.16.741-.008.919-.375l.001-.001v-.002c.025-.051.061-.12.083-.169.094-.215.125-.4.192-.609.176-.442.273-.905.515-1.194.067-.08.175-.11.287-.14l.151-.273a8.616 8.616 0 006.145.016l.142.256c.114.037.239.056.34.206.182.31.306.675.457 1.118.066.208.1.393.194.61.021.048.057.117.082.17.177.367.59.535.92.376.33-.158.455-.58.284-.945-.026-.052-.06-.129-.087-.179-.11-.208-.235-.348-.357-.53-.252-.393-.461-.72-.59-1.055-.055-.173.009-.28.05-.392-.025-.029-.079-.192-.11-.268a8.654 8.654 0 003.838-4.822c.086.014.236.04.285.05.1-.066.192-.152.373-.138.355.052.72.183 1.16.341.205.078.37.17.598.23.048.013.117.025.172.037l.013.004.01.002c.395.085.778-.131.86-.486.08-.355-.171-.715-.564-.81-.057-.013-.138-.035-.193-.045-.232-.044-.42-.033-.64-.051-.465-.049-.85-.089-1.193-.196-.14-.054-.239-.22-.287-.289l-.27-.078a8.572 8.572 0 00-.139-3.104 8.599 8.599 0 00-1.247-2.88c.068-.062.199-.177.236-.21.01-.12.001-.245.125-.377.262-.246.592-.45.99-.695.19-.11.364-.182.554-.322.043-.032.101-.082.146-.118.32-.255.393-.693.164-.98-.23-.287-.674-.314-.993-.06-.046.036-.107.083-.148.118-.179.153-.29.305-.44.464-.328.333-.6.611-.898.812-.129.075-.318.049-.404.044l-.253.18a8.732 8.732 0 00-5.528-2.666 16.036 16.036 0 01-.015-.297c-.087-.083-.192-.154-.218-.333-.029-.357.02-.742.076-1.206.03-.216.082-.396.09-.632.003-.053 0-.13 0-.189 0-.408-.299-.738-.667-.738zm-.834 5.156l-.198 3.488-.014.007a.587.587 0 01-.932.449l-.006.002-2.864-2.027a6.862 6.862 0 014.014-1.919zm1.668 0a6.922 6.922 0 013.99 1.92l-2.846 2.015-.01-.004a.588.588 0 01-.933-.448l-.003-.001-.198-3.482zm-6.72 3.222l2.614 2.335-.003.014a.585.585 0 01-.23 1.008l-.003.01-3.352.967a6.838 6.838 0 01.973-4.334zm11.753.001c.388.63.683 1.331.858 2.093a6.91 6.91 0 01.145 2.229l-3.37-.97-.002-.013a.586.586 0 01-.23-1.008l-.002-.007 2.6-2.324zm-6.404 2.515h1.071l.666.83-.239 1.038-.962.461-.964-.463-.24-1.037.668-.83zm3.435 2.844a.585.585 0 01.135.01l.005-.008 3.468.586a6.858 6.858 0 01-2.776 3.481l-1.346-3.246.004-.005a.586.586 0 01.51-.818zm-5.824.014a.587.587 0 01.53.817l.01.012-1.331 3.214a6.886 6.886 0 01-2.767-3.458l3.437-.582.006.007a.595.595 0 01.115-.01zm2.904 1.407a.582.582 0 01.275.059.583.583 0 01.263.25h.013l1.694 3.057c-.22.073-.446.136-.677.189a6.896 6.896 0 01-3.758-.194l1.69-3.05h.003a.588.588 0 01.497-.31z",fill:"#326CE5"}))}}}]);
//# sourceMappingURL=icon.logo_kubernetes-js.min.js.map | 2,351.5 | 4,647 | 0.672124 |
15fd63faeaa3aab4517327cb3cacfc8e737c3b76 | 889 | js | JavaScript | modules/api/users/technecianInsertUser.js | amirhosseinmohammadzadeh/resume-backend-nodejs-lab | 869c0f8764c3a72d6204b6b861a6da7d9f47933c | [
"MIT"
] | null | null | null | modules/api/users/technecianInsertUser.js | amirhosseinmohammadzadeh/resume-backend-nodejs-lab | 869c0f8764c3a72d6204b6b861a6da7d9f47933c | [
"MIT"
] | null | null | null | modules/api/users/technecianInsertUser.js | amirhosseinmohammadzadeh/resume-backend-nodejs-lab | 869c0f8764c3a72d6204b6b861a6da7d9f47933c | [
"MIT"
] | null | null | null | var dbLayer = require('../../dbLayer.js');
/* INTERFACE /users/insert/technecianUser
POST
exp:{username:'reza222',
password:'123455'}
RETERNS
{error:'empty',field:error}
{error:'database',message:err}
{error:"noEffected"}
{success:"don"}
*/
var main = function(req,res,next){
let error = [];
if(req.body.username == undefined)error.push('username');
if(req.body.password == undefined)error.push('password');
if(error[0] != undefined){
res.json({error:'empty',field:error})
return;
}
let data = {
username:req.body.username,
password:req.body.password,
};
dbLayer.lab.user.insert.technecianUser(data,function(err,resp,field){
if(err){
res.json({error:'database',message:err});
return;
}
if(resp.affectedRows > 0)res.json({success:"don"});
else res.json({error:"noEffected"});
});
};
module.exports = main; | 24.694444 | 71 | 0.642295 |
15fd692f85cdb7d73b2292f865e943518a55826d | 1,772 | js | JavaScript | MovieArtArena.Web/app/public/dist/0.aea22df4c1b0a546848b.hot-update.js | cnunezz0911/StarterProject | 53eb01caa446f4910d0ee94cea15fd9cc714bf5a | [
"MIT"
] | null | null | null | MovieArtArena.Web/app/public/dist/0.aea22df4c1b0a546848b.hot-update.js | cnunezz0911/StarterProject | 53eb01caa446f4910d0ee94cea15fd9cc714bf5a | [
"MIT"
] | null | null | null | MovieArtArena.Web/app/public/dist/0.aea22df4c1b0a546848b.hot-update.js | cnunezz0911/StarterProject | 53eb01caa446f4910d0ee94cea15fd9cc714bf5a | [
"MIT"
] | null | null | null | webpackHotUpdate(0,{
/***/ "./node_modules/css-loader/index.js?{\"importLoaders\":1}!./node_modules/postcss-loader/lib/index.js?{\"ident\":\"postcss\",\"plugins\":[null,null]}!./src/App.css":
/*!***********************************************************************************************************************************************!*\
!*** ./node_modules/css-loader?{"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","plugins":[null,null]}!./src/App.css ***!
\***********************************************************************************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(/*! ../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(undefined);
// imports
// module
exports.push([module.i, ".App {\n text-align: center;\n}\n\n.App-logo {\n -webkit-animation: App-logo-spin infinite 20s linear;\n animation: App-logo-spin infinite 20s linear;\n height: 80px;\n}\n\n.App-header {\n background-color: #222;\n height: 150px;\n padding: 20px;\n color: white;\n}\n\n.App-title {\n font-size: 1.5em;\n}\n\n.App-intro {\n font-size: large;\n}\n\n@-webkit-keyframes App-logo-spin {\n from { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n@keyframes App-logo-spin {\n from { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n", ""]);
// exports
/***/ })
})
//# sourceMappingURL=0.aea22df4c1b0a546848b.hot-update.js.map | 73.833333 | 754 | 0.56377 |
15fdce25405328bf3628787d8b5a82a6461f3f8a | 3,450 | js | JavaScript | Modulo3/Todas as aulas Modulo 3/aulas/aula-11/react-desafio-03-hooks/backend/index.js | albertolopes/Bootcamp---Desenvolvedor-Full-Stack | 22ed767acafbd46a35957b687f67f814ec119065 | [
"MIT"
] | 2 | 2020-09-21T11:20:18.000Z | 2020-09-23T02:06:13.000Z | Modulo3/Todas as aulas Modulo 3/aulas/aula-11/react-desafio-03-hooks/backend/index.js | albertolopes/Bootcamp---Desenvolvedor-Full-Stack | 22ed767acafbd46a35957b687f67f814ec119065 | [
"MIT"
] | null | null | null | Modulo3/Todas as aulas Modulo 3/aulas/aula-11/react-desafio-03-hooks/backend/index.js | albertolopes/Bootcamp---Desenvolvedor-Full-Stack | 22ed767acafbd46a35957b687f67f814ec119065 | [
"MIT"
] | null | null | null | /**
* Precisamos do express para montar a API
*/
const express = require('express');
/**
* Precisamos de cors para não termos problemas
* de acesso à API
*/
const cors = require('cors');
/**
* Instanciando o app com express()
*/
const app = express();
/**
* Indicando que app utilizará o módulo de cors
*/
app.use(cors());
/**
* Estado da aplicação
*/
let candidates = [];
/**
* Intervals que serão executados
* a cada x intervalo de tempo
*/
let intervalVotes = null;
let intervalPopularity = null;
/**
* Valores constantes importantes
*/
const CONSTS = {
MAX_POPULARITY: 10,
MIN_POPULARITY: 1,
MIN_VOTES: 1,
MAX_VOTES: 1000,
INTERVAL_VOTES: 100,
INTERVAL_POPULARITY: 10000,
};
/**
* Função para gerar números aleatórios
*/
function generateRandomNumber(from = CONSTS.MIN_VOTES, to = CONSTS.MAX_VOTES) {
return Math.max(from, Math.ceil(Math.random() * to));
}
/**
* Função para montar estado
* inicial dos candidatos
*/
function fillCandidates() {
candidates = [
{
id: 1,
name: 'Marco Minnemann',
votes: 0,
previousVotes: 0,
percentage: 0,
popularity: CONSTS.MIN_POPULARITY,
},
{
id: 2,
name: 'Mike Portnoy',
votes: 0,
previousVotes: 0,
percentage: 0,
popularity: CONSTS.MIN_POPULARITY,
},
{
id: 3,
name: 'Neil Peart',
votes: 0,
previousVotes: 0,
percentage: 0,
popularity: CONSTS.MIN_POPULARITY,
},
];
}
/**
* Função para simular a votação
*/
function simulateVoting() {
intervalVotes = setInterval(() => {
candidates.forEach((candidate) => {
const minVotes = CONSTS.MIN_VOTES;
const maxVotes = CONSTS.MAX_VOTES * candidate.popularity;
const votes = generateRandomNumber(minVotes, maxVotes);
candidate.previousVotes = candidate.votes;
candidate.votes += votes;
});
}, CONSTS.INTERVAL_VOTES);
}
/**
* Função para simular a popularidade
*/
function simulatePopularity() {
intervalPopularity = setInterval(() => {
candidates.forEach((candidate) => {
candidate.popularity = generateRandomNumber(
CONSTS.MIN_POPULARITY,
CONSTS.MAX_POPULARITY
);
});
console.log(candidates);
}, CONSTS.INTERVAL_POPULARITY);
}
/**
* Rota padrão (/)
*/
app.get('/', (_, res) => {
res.json({
message:
'Bem-vindo ao módulo de votação!' +
'Acesse /votes para visualizar a votação em tempo real.',
});
});
/**
* Rota /votes
*/
app.get('/votes', (_, res) => {
/**
* Clonando objeto de votação e
* realizando a ordenação a partir
* dos votos
*/
const sortedCandidates = Object.assign([], candidates);
sortedCandidates.sort((a, b) => b.votes - a.votes);
/**
* Obtendo o total de votos do momento
*/
const totalVotes = sortedCandidates.reduce((accumulator, current) => {
return accumulator + current.votes;
}, 0);
/**
* Cálculo de percentual de votos
*/
sortedCandidates.forEach((candidate) => {
candidate.percentage = (candidate.votes / totalVotes) * 100;
});
/**
* Mostrando dados no console
*
*/
console.log({ candidates: sortedCandidates, totalVotes });
/**
* Retornando os dados
*/
res.json({ candidates: sortedCandidates, totalVotes });
});
/**
* Iniciando o servidor
* na porta 8080
*/
app.listen(8080);
/**
* Execução inicial
*/
fillCandidates();
simulateVoting();
simulatePopularity();
| 18.956044 | 79 | 0.626377 |
15fdd20eabd4382af4274130a3a6ce13a152f0f9 | 3,487 | js | JavaScript | node_modules/vainglory/dist/models/match.js | Kashalls/StratonBot | e93746642631c3033426768ecea774ffb7ecd905 | [
"WTFPL"
] | null | null | null | node_modules/vainglory/dist/models/match.js | Kashalls/StratonBot | e93746642631c3033426768ecea774ffb7ecd905 | [
"WTFPL"
] | null | null | null | node_modules/vainglory/dist/models/match.js | Kashalls/StratonBot | e93746642631c3033426768ecea774ffb7ecd905 | [
"WTFPL"
] | null | null | null | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _ = require('./');
var _2 = _interopRequireDefault(_);
var _gameModes = require('./resources/gameModes');
var _gameModes2 = _interopRequireDefault(_gameModes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Match = function (_BaseModel) {
_inherits(Match, _BaseModel);
function Match(data) {
_classCallCheck(this, Match);
var _this = _possibleConstructorReturn(this, (Match.__proto__ || Object.getPrototypeOf(Match)).call(this, data));
_this.relationships = [{
type: 'rosters'
}, {
type: 'assets'
}];
return _this;
}
_createClass(Match, [{
key: 'createdAt',
get: function get() {
return this.data.attributes.createdAt;
}
}, {
key: 'duration',
get: function get() {
return this.data.attributes.duration;
}
}, {
key: '_gameMode',
get: function get() {
return this.data.attributes.gameMode;
}
}, {
key: 'gameMode',
get: function get() {
var _this2 = this;
var normalizedGameMode = _gameModes2.default.find(function (mode) {
return mode.serverName === _this2._gameMode;
});
return normalizedGameMode ? normalizedGameMode.name : this._gameMode;
}
}, {
key: 'patchVersion',
get: function get() {
return this.data.attributes.patchVersion;
}
}, {
key: 'shardId',
get: function get() {
return this.data.attributes.shardId;
}
}, {
key: 'stats',
get: function get() {
return this.data.attributes.stats;
}
}, {
key: 'titleId',
get: function get() {
return this.data.attributes.titleId;
}
}, {
key: 'rosters',
set: function set(rosters) {
this.matchRoster = rosters;
return this;
},
get: function get() {
return this.matchRoster;
}
}]);
return Match;
}(_2.default);
exports.default = Match; | 34.524752 | 564 | 0.667909 |
15fedcaa866ac60c7193798dd172103ec7710ca2 | 5,990 | js | JavaScript | server/schemas/resolvers.js | ManuhuiaBarcham/family-knowledge-exchange | 3f18b198bf75384965d06efb23630ddb8c080c91 | [
"MIT"
] | null | null | null | server/schemas/resolvers.js | ManuhuiaBarcham/family-knowledge-exchange | 3f18b198bf75384965d06efb23630ddb8c080c91 | [
"MIT"
] | 18 | 2021-10-04T19:15:14.000Z | 2021-10-23T00:41:59.000Z | server/schemas/resolvers.js | ManuhuiaBarcham/family-knowledge-exchange | 3f18b198bf75384965d06efb23630ddb8c080c91 | [
"MIT"
] | null | null | null | const { AuthenticationError } = require('apollo-server-express');
const { User, Interest, Profession } = require('../models');
const ObjectId = require('mongoose').Types.ObjectId;
const { signToken } = require('../utils/auth');
const resolvers = {
Query: {
user: async (parent, { username }) => {
if (username == null || username == ''){
return null;
}
// const params = username? { username } : {};
let tmp = await User.find({username})
.populate('interest')
.populate('profession');
return tmp[0];
},
me: async (parent, args, context) => {
if (context.user) {
let usr = await User.findOne({ _id: context.user._id })
.populate('interest')
.populate('profession');
console.log(usr);
return usr;
}
throw new AuthenticationError('You need to be logged in!');
},
users: async (parent, { filter }) => {
console.log('parent:', filter.parent);
console.log('interest:', filter.interest);
console.log('username:', filter.username);
console.log('profession:', filter.profession);
console.log('filter:', filter);
const params =
filter.username || filter.interest || filter.profession ? filter : {};
// const params = username? { username } : {};
let tmp = await User.find(params)
.populate('interest')
.populate('profession');
return tmp;
},
interests: async () => {
return await Interest.find({});
},
professions: async () => {
return await Profession.find({});
},
},
Mutation: {
addUser: async (
parent,
{
username,
email,
password,
organization,
location,
profession,
interest,
}
) => {
let userProf = await Profession.findOne({ _id: profession });
let userInter = await Interest.findOne({ _id: interest });
let user = await User.create({
username,
email,
password,
organization,
location,
profession: userProf?._id,
interest: userInter?._id
});
user = user.toObject();
user.profession = userProf;
user.interest = userInter;
const token = signToken(user);
return { token, user };
},
login: async (parent, { email, password }) => {
const user = await User.findOne({ email });
if (!user) {
throw new AuthenticationError('No user found with this email address');
}
const correctPw = await user.isCorrectPassword(password);
if (!correctPw) {
throw new AuthenticationError('Incorrect credentials');
}
const token = signToken(user);
return { token, user };
},
// Works above here
// addThought: async (parent, { thoughtText }, context) => {
// if (context.user) {
// const thought = await Thought.create({
// thoughtText,
// thoughtAuthor: context.user.username,
// });
// await User.findOneAndUpdate(
// { _id: context.user._id },
// { $addToSet: { thoughts: thought._id } }
// );
// return thought;
// }
// throw new AuthenticationError('You need to be logged in!');
// },
changeInterest: async (parent, { userId, interestOption }, context) => {
if (context.interest) {
return Interest.findOneAndUpdate(
{ _id: userId },
{
$addToSet: {
interests: {
interestOption,
// commentAuthor: context.user.username,
},
},
},
{
new: true,
runValidators: true,
}
);
}
throw new AuthenticationError('You need to be logged in!');
},
// addComment: async (parent, { thoughtId, commentText }, context) => {
// if (context.user) {
// return Thought.findOneAndUpdate(
// { _id: thoughtId },
// {
// $addToSet: {
// comments: { commentText, commentAuthor: context.user.username },
// },
// },
// {
// new: true,
// runValidators: true,
// }
// );
// }
// throw new AuthenticationError('You need to be logged in!');
// },
removeUser: async (parent, { userId }, context) => {
if (context.user) {
const user = await User.findOneAndDelete({
_id: userId,
// thoughtAuthor: context.user.username,
});
// await User.findOneAndUpdate(
// { _id: context.user._id },
// { $pull: { thoughts: thought._id } }
// );
return 'You successfully deleted your account.';
}
throw new AuthenticationError('You need to be logged in!');
},
// removeThought: async (parent, { thoughtId }, context) => {
// if (context.user) {
// const thought = await Thought.findOneAndDelete({
// _id: thoughtId,
// thoughtAuthor: context.user.username,
// });
// await User.findOneAndUpdate(
// { _id: context.user._id },
// { $pull: { thoughts: thought._id } }
// );
// return thought;
// }
// throw new AuthenticationError('You need to be logged in!');
// },
// removeComment: async (parent, { thoughtId, commentId }, context) => {
// if (context.user) {
// return Thought.findOneAndUpdate(
// { _id: thoughtId },
// {
// $pull: {
// comments: {
// _id: commentId,
// commentAuthor: context.user.username,
// },
// },
// },
// { new: true }
// );
// }
// throw new AuthenticationError('You need to be logged in!');
// },
},
};
module.exports = resolvers;
| 27.731481 | 81 | 0.511185 |
15feea1717f4b7eb1d21d8cfc7162cbec6c29321 | 1,843 | js | JavaScript | Leaflet-Step-1/static/js/logic.js | hladero/leaflet-challenge | 1a92dbd806ab48f236e17f8dedff865d0f471cb4 | [
"RSA-MD"
] | null | null | null | Leaflet-Step-1/static/js/logic.js | hladero/leaflet-challenge | 1a92dbd806ab48f236e17f8dedff865d0f471cb4 | [
"RSA-MD"
] | null | null | null | Leaflet-Step-1/static/js/logic.js | hladero/leaflet-challenge | 1a92dbd806ab48f236e17f8dedff865d0f471cb4 | [
"RSA-MD"
] | null | null | null | var map = L.map("map", {
center: [40, -10],
zoom: 3,
});
L.tileLayer("https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}", {
attribution: "© <a href='https://www.mapbox.com/about/maps/'>Mapbox</a> © <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> <strong><a href='https://www.mapbox.com/map-feedback/' target='_blank'>Improve this map</a></strong>",
tileSize: 512,
maxZoom: 18,
zoomOffset: -1,
id: "mapbox/streets-v11",
accessToken: API_KEY
}).addTo(map);
function getColor(mag) {
switch (true) {
case mag > 90:
return 'red';
case mag > 60:
return 'orange';
case mag < 61:
return 'green';
}
}
d3.json("https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/1.0_week.geojson").then(data => {
L.geoJson(data, {
pointToLayer: function (quake, latlng) {
return L.circleMarker(latlng,
{
radius: quake.properties.mag * 4,
fillColor: getColor(latlng.alt),
color: 'black',
fillOpacity: 1,
weight: 1.5
}).bindPopup(`<h3>${quake.properties.place}</h3><h3>Magnitude: ${quake.properties.mag}</h3>`);
}
}).addTo(map);
});
var legend = L.control({ position: 'bottomright' });
legend.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info legend');
div.innerHTML = "<div style='border: 2px solid black;padding: 2px;background-color:red;color:white'> > 90</div>\
<div style='border: 2px solid black;padding: 2px;background-color:orange;color:white'> > 60</div>\
<div style='border: 2px solid black;padding: 2px;background-color:green;color:white'> < 61</div>"
return div;
};
legend.addTo(map); | 31.237288 | 247 | 0.57949 |
15ff478557225254c5c0a2097427adcbff1c48ad | 697 | js | JavaScript | src/cbor/common.js | HasnAr/javascript | 654e936a805c98903d893bb876722bfe571ddc4f | [
"MIT"
] | 467 | 2015-01-01T06:08:15.000Z | 2022-03-21T09:04:28.000Z | src/cbor/common.js | HasnAr/javascript | 654e936a805c98903d893bb876722bfe571ddc4f | [
"MIT"
] | 132 | 2015-02-05T15:29:01.000Z | 2022-03-31T16:59:06.000Z | src/cbor/common.js | HasnAr/javascript | 654e936a805c98903d893bb876722bfe571ddc4f | [
"MIT"
] | 332 | 2015-01-03T15:56:33.000Z | 2022-02-17T05:04:34.000Z | export default class {
_base64ToBinary: (base64: string) => any;
_cborReader: { decode: (any) => Object };
constructor(decode: (any) => any, base64ToBinary: (base64: string) => any) {
this._base64ToBinary = base64ToBinary;
this._decode = decode;
}
decodeToken(tokenString) {
let padding = '';
if (tokenString.length % 4 === 3) {
padding = '=';
} else if (tokenString.length % 4 === 2) {
padding = '==';
}
const cleaned = tokenString.replace(/-/gi, '+').replace(/_/gi, '/') + padding;
const result = this._decode(this._base64ToBinary(cleaned));
if (typeof result === 'object') {
return result;
}
return undefined;
}
}
| 24.034483 | 82 | 0.591105 |
c600516d85ffcc220233722e70667ed308149ca1 | 352 | js | JavaScript | resources/js/fontawesome.js | harishkrishnan24/laravel-qa | 5aeb535ebb59628f2f0b51ae8dfd399af12e34bd | [
"MIT"
] | null | null | null | resources/js/fontawesome.js | harishkrishnan24/laravel-qa | 5aeb535ebb59628f2f0b51ae8dfd399af12e34bd | [
"MIT"
] | 4 | 2021-03-09T17:48:34.000Z | 2022-02-26T17:50:21.000Z | resources/js/fontawesome.js | harishkrishnan24/laravel-qa | 5aeb535ebb59628f2f0b51ae8dfd399af12e34bd | [
"MIT"
] | null | null | null | import { config, library, dom } from '@fortawesome/fontawesome-svg-core';
config.autoReplaceSvg = 'nest';
import {
faCaretUp,
faCaretDown,
faStar,
faCheck
} from '@fortawesome/free-solid-svg-icons';
library.add(faCaretUp, faCaretDown, faStar, faCheck);
// Kicks off the process of finding <i> tags and replacing with <svg>
dom.watch();
| 29.333333 | 73 | 0.715909 |
c6008531112cddea7f2b1c185c7a244080825156 | 19,641 | js | JavaScript | backend/models/DocumentModel.js | niteshpsit1/clms | e74dd6a583fe23b6ff7fa07fb1b29c695fdd4322 | [
"MIT"
] | null | null | null | backend/models/DocumentModel.js | niteshpsit1/clms | e74dd6a583fe23b6ff7fa07fb1b29c695fdd4322 | [
"MIT"
] | null | null | null | backend/models/DocumentModel.js | niteshpsit1/clms | e74dd6a583fe23b6ff7fa07fb1b29c695fdd4322 | [
"MIT"
] | null | null | null | 'use strict';
/**
* document data model, defined as following:
*
* document: {
* id: <integer>,
* filename: <string>,
* documentcode: <string>,
* documenttype_id: <integer>,
* data: <json>,
* tsc: <date>,
* tsm: <date>,
* uc: <string>,
* um: <string>
* }
*
*
* @author: Daniele Gazzelloni <daniele@danielegazzelloni.com>
* @created: 27/10/2015
********************************************************************/
var debug = require('debug')('LMS:DocumentModel');
var _ = require('lodash');
var Boom = require('boom');
var shortid = require('shortid');
var mime = require('mime');
var db = require('./../lib/db');
var config = require('./../../config/backend.config');
var awsHelper = require('./../lib/helpers/aws');
var s3 = awsHelper.s3;
var S3Async = awsHelper.S3Async;
var EntityDocumentModel = require('./EntityDocumentModel');
var CollateralDocumentModel = require('./CollateralDocumentModel');
var LoanDocumentModel = require('./LoanDocumentModel');
var DocumentModel = db.sequelize.define('document', {
id: {
type: db.Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true
},
filename: {
type: db.Sequelize.STRING,
allowNull: true
},
mime: {
type: db.Sequelize.STRING
},
data: {
type: db.Sequelize.JSONB
},
documentcode: {
type: db.Sequelize.STRING,
allowNull: true
},
documenttype_id: {
type: db.Sequelize.INTEGER,
allowNull: false
},
uc: {
type: db.Sequelize.STRING
},
um: {
type: db.Sequelize.STRING
}
},
{
updatedAt: 'tsc',
createdAt: 'tsm'
});
exports.Schema = DocumentModel;
/**
* Get all documents fields from our document model except document content (file data).
* That's because this method is used for getting file names and info, not for retrieving files data.
*
* An array of documents is returned.
*
*
* @param: none.
*
* @callback: error: <boolean>,
* message: <string>,
* result: [{
* id: integer,
* filename: string,
* documentcode: string,
* documenttype_id: integer,
* data: json,
* url: string,
* tsc: date,
* tsm: date,
* uc: string,
* um: string
* }]
*/
exports.getAllDocument = function (data, callback) {
//Select all documents, excluding the `file` field (BLOB)
var filter = {
order: 'tsc DESC'
};
DocumentModel.findAll(filter).then(function (data) {
if (_.isEmpty(data)) {
return callback(null, null);
}
var documents = [];
_.map(data, function (result) {
var newDocument = {};
var params = {Bucket: config.aws.s3Bucket, Key: result['filename'], Expires: config.session.expiry * 60};
var url = s3.getSignedUrl('getObject', params);
newDocument.id = result.id;
newDocument.filename = result.filename;
newDocument.documentcode = result.documentcode;
newDocument.documenttype_id = result.documenttype_id;
newDocument.data = result.data;
newDocument.url = url;
newDocument.tsc = result.tsc;
newDocument.tsm = result.tsm;
newDocument.uc = result.uc;
newDocument.um = result.um;
documents.push(newDocument);
return result;
});
return callback(null, documents);
}).error(function (error) {
debug('PostgreSQL: ' + error.message + ' - Are we still connected to database?');
return callback(new Boom.notFound(error.message));
});
};
/**
* Get one document from our document model.
* We expect id as parameter, eg. 'http://<hostname>/documents/123452313'.
* If the id is provided a single document is returned (JSON).
*
*
* @params: id: <integer>
*
* @callback: error: <boolean>,
* message: <string>,
* result: {
* id: integer,
* filename: string,
* documentcode: string,
* documenttype_id: integer,
* data: json,
* url: string,
* tsc: date,
* tsm: date,
* uc: string,
* um: string
* }
*/
exports.findById = function (data, callback) {
if (_.isEmpty(data)) {
return callback(new Boom.notFound('Invalid document'));
} else if (_.isEmpty(data.id)) {
return callback(new Boom.notFound('Invalid id'));
}
var filter = {where: {id: data.id}};
DocumentModel.findOne(filter).then(function (result) {
if (_.isEmpty(result)) {
return callback(new Boom.notFound('Document not found'), null);
}
var newDocument = {};
var params = {Bucket: config.aws.s3Bucket, Key: result['filename'], Expires: config.session.expiry * 60};
var url = s3.getSignedUrl('getObject', params);
newDocument.id = result.id;
newDocument.filename = result.filename;
newDocument.documentcode = result.documentcode;
newDocument.documenttype_id = result.documenttype_id;
newDocument.data = result.data;
newDocument.url = url;
newDocument.tsc = result.tsc;
newDocument.tsm = result.tsm;
newDocument.uc = result.uc;
newDocument.um = result.um;
return callback(null, newDocument);
}).error(function (error) {
debug('PostgreSQL: ' + error.message + ' - Are we still connected to database?');
return callback(new Boom.notFound(error.message));
});
};
/**
* We expect id as parameter, all the other parameters are instead optional.
* This method will update a document model record.
*
*
* @param: id: <integer>,
* file: <file>,
* documentcode: <string>,
* documenttype_id: <integer>
*
* @callback: error: <boolean>
* message: <string>,
* results: []
*/
exports.updateById = function (data, callback) {
if (_.isEmpty(data)) {
return callback(new Boom.notFound('Invalid document'));
} else if (isNaN(data.filter.id) || _.isEmpty(data.filter.id)) {
return callback(new Boom.notFound('Invalid id'));
} else if (_.isEmpty(data.updateData)) {
return callback(new Boom.notFound('Invalid document'));
}
var filter = {where: {id: data.filter.id}};
db.sequelize.transaction(function (t) {
return DocumentModel.find(filter).then(function (document) {
if (_.isEmpty(document)) {
return (new Boom.notFound('Document not found'));
} else {
if (data.documentFile) {
var file = data.documentFile;
data.updateData.filename = shortid.generate() + '-' + file.originalname;
data.updateData.mime = mime.lookup(file.mimetype);
return S3Async.putObjectAsync({
ACL: 'private', //'public-read',
Bucket: config.aws.s3Bucket,
Key: data.updateData.filename,
ContentDisposition: 'attachment',
Body: file.buffer,
ContentType: mime.lookup(file.originalname)
}).then(function () {
return document.update(data.updateData, filter, {transaction: t});
});
} else {
return document.update(data.updateData, filter, {transaction: t});
}
}
});
}).then(function (result) {
if (_.isEmpty(result)) {
return callback(null, null);
}
return callback(null, result.dataValues);
}).error(function (error) {
debug('PostgreSQL: ' + error.message + ' - Are we still connected to database?');
return callback(new Boom.notFound(error.message));
});
};
/**
* datauired id.
*
* This method will delete a document record from the database.
*
*
* @param: id: <integer>
*
* @callback: error: <boolean>,
* message: <string>,
* results: []
*/
exports.deleteById = function (data, callback) {
if (_.isEmpty(data)) {
return callback(new Boom.notFound('Invalid document'));
} else if (_.isEmpty(data.id)) {
return callback(new Boom.notFound('Invalid id'));
}
var filter = {where: {id: data.id}};
DocumentModel.find(filter).then(function (document) {
if (_.isEmpty(document)) {
return callback(new Boom.notFound('Document not found'), null);
}
var params = {
Bucket: config.aws.s3Bucket,
Key: document.filename
};
S3Async.deleteObjectAsync(params).then(function () {
document.destroy().then(function () {
return callback(null, true);
}).catch(function (error) {
console.log('error: ', error);
return callback(new Boom.notFound(error.message));
});
}).catch(function (error) {
return callback(new Boom.notFound(error.message));
});
}).error(function (error) {
debug('PostgreSQL: ' + error.message + ' - Are we still connected to database?');
return callback(new Boom.notFound(error.message));
});
};
/**
* All parameters datauired except for documentcode (which is optional)
*
* This method will insert a new document record into the database.
*
* @param: documentcode: <string>,
* documenttype_id: <integer>,
* file: <file>,
* uc: <string>,
* um: <string>
*
*
* @callback: error: <boolean>
* message: <string>,
* results: []
*/
exports.insert = function (data, callback) {
if (_.isEmpty(data)) {
return callback(new Boom.notFound('Invalid document'), null);
} else if (_.isEmpty(data.newDocument)) {
return callback(new Boom.notFound('Invalid document'), null);
}else if (_.isEmpty(data.documentFile)) {
return callback(new Boom.notFound('Invalid document file'), null);
}
var newDocument = data.newDocument;
db.sequelize.transaction(function (t) {
return S3Async.putObjectAsync({
ACL: 'private', //'public-read',
Bucket: config.aws.s3Bucket,
Key: newDocument.filename,
ContentDisposition: 'attachment',
Body: data.documentFile.buffer,
ContentType: mime.lookup(data.documentFile.originalname)
}).then(function () {
return DocumentModel.create(newDocument, {transaction: t}).then(function (result) {
return result;
});
});
}).then(function (result) {
if (_.isEmpty(result)) {
return callback(null, null);
}
return callback(null, result.dataValues);
}).error(function (error) {
debug('PostgreSQL: ' + error.message + ' - Are we still connected to database?');
return callback(new Boom.notFound(error.message));
});
};
/**
* Get documents for defined entity from our document model.
* We expect entity_id as parameter, eg. 'http://<hostname>/api/documents/for_entity/:entity_id'.
* If the id is provided a single document is returned (JSON).
*
*
* @params: entity_id: <integer>
*
* @callback: error: <boolean>,
* message: <string>,
* result: [{
* id: integer,
* filename: string,
* documentcode: string,
* documenttype_id: integer,
* data: json,
* url: string
* tsc: date,
* tsm: date,
* uc: string,
* um: string
* }]
*/
exports.getForEntity = function (data, callback) {
if (_.isEmpty(data.EntityDocumentStore)) {
return callback(new Boom.notFound('No document found related to entity exist'));
}
var documentIds = _.map(data.EntityDocumentStore, function (data) {
return data['document_id'];
});
DocumentModel.findAll({where: {id: {$in: documentIds}}}).then(function (data) {
var documents = [];
_.map(data, function (result) {
var newDocument = {};
var params = {
Bucket: config.aws.s3Bucket,
Key: result['filename'],
Expires: config.session.expiry * 60
};
var url = s3.getSignedUrl('getObject', params);
newDocument.id = result.id;
newDocument.filename = result.filename;
newDocument.documentcode = result.documentcode;
newDocument.documenttype_id = result.documenttype_id;
newDocument.data = result.data;
newDocument.url = url;
newDocument.tsc = result.tsc;
newDocument.tsm = result.tsm;
newDocument.uc = result.uc;
newDocument.um = result.um;
documents.push(newDocument);
return result;
});
return callback(null, documents);
}).error(function (error) {
debug('PostgreSQL: ' + error.message + ' - Are we still connected to database?');
return callback(new Boom.notFound(error.message));
});
};
/**
* Get documents for defined loan from our document model.
* We expect loan_id as parameter, eg. 'http://<hostname>/api/documents/for_loan/:loan_id'.
* If the id is provided a single document is returned (JSON).
*
*
* @params: loan_id: <integer>
*
* @callback: error: <boolean>,
* message: <string>,
* result: [{
* id: integer,
* filename: string,
* documentcode: string,
* documenttype_id: integer,
* data: json,
* url: string,
* tsc: date,
* tsm: date,
* uc: string,
* um: string
* }]
*/
exports.getForLoan = function (data, callback) {
if (_.isEmpty(data.LoanDocumentStore)) {
return callback(new Boom.notFound('No document found related to entity exist'));
}
var documentIds = _.map(data.LoanDocumentStore, function (data) {
return data['document_id'];
});
DocumentModel.findAll({where: {id: {$in: documentIds}}}).then(function (data) {
var documents = [];
_.map(data, function (result) {
var newDocument = {};
var params = {
Bucket: config.aws.s3Bucket,
Key: result['filename'],
Expires: config.session.expiry * 60
};
var url = s3.getSignedUrl('getObject', params);
newDocument.id = result.id;
newDocument.filename = result.filename;
newDocument.documentcode = result.documentcode;
newDocument.documenttype_id = result.documenttype_id;
newDocument.data = result.data;
newDocument.url = url;
newDocument.tsc = result.tsc;
newDocument.tsm = result.tsm;
newDocument.uc = result.uc;
newDocument.um = result.um;
documents.push(newDocument);
return result;
});
return callback(null, documents);
}).error(function (error) {
debug('PostgreSQL: ' + error.message + ' - Are we still connected to database?');
return callback(new Boom.notFound(error.message));
});
};
/**
* Get documents for defined collateral from our document model.
* We expect loan_id as parameter, eg. 'http://<hostname>/api/documents/for_collateral/:collateral_id'.
* If the id is provided a single document is returned (JSON).
*
*
* @params: loan_id: <integer>
*
* @callback: error: <boolean>,
* message: <string>,
* result: {
* id: integer,
* filename: string,
* documentcode: string,
* documenttype_id: integer,
* data: json,
* url: string,
* tsc: date,
* tsm: date,
* uc: string,
* um: string
* }
*/
exports.getForCollateral = function (data, callback) {
if (_.isEmpty(data.CollateralDocumentStore)) {
return callback(new Boom.notFound('No document found related to collateral exist'));
}
var documentIds = _.map(data.CollateralDocumentStore, function (data) {
return data['document_id'];
});
DocumentModel.findAll({where: {id: {$in: documentIds}}}).then(function (data) {
var documents = [];
_.map(data, function (result) {
var newDocument = {};
var params = {
Bucket: config.aws.s3Bucket,
Key: result['filename'],
Expires: config.session.expiry * 60
};
var url = s3.getSignedUrl('getObject', params);
newDocument.id = result.id;
newDocument.filename = result.filename;
newDocument.documentcode = result.documentcode;
newDocument.documenttype_id = result.documenttype_id;
newDocument.data = result.data;
newDocument.url = url;
newDocument.tsc = result.tsc;
newDocument.tsm = result.tsm;
newDocument.uc = result.uc;
newDocument.um = result.um;
documents.push(newDocument);
return result;
});
return callback(null, documents);
}).error(function (error) {
debug('PostgreSQL: ' + error.message + ' - Are we still connected to database?');
return callback(new Boom.notFound(error.message));
});
};
/**
* All parameters datauired except for documentcode (which is optional)
*
* This method will insert a new document record into the database.
*
* @param: documentcode: <string>,
* documenttype_id: <integer>,
* entity_id: <integer>,
* loan_id: <integer>,
* collateral_id: <integer>,
* file: <file>,
* uc: <string>,
* um: <string>
*
*
* @callback: error: <boolean>
* message: <string>,
* results: []
*/
exports.insertAndRelate = function (data, callback) {
if (_.isEmpty(data)) {
return callback(new Boom.notFound('Invalid document'), null);
} else if (_.isEmpty(data.newDocument)) {
return callback(new Boom.notFound('Invalid document'), null);
}
db.sequelize.transaction(function (t) {
return S3Async.putObjectAsync({
ACL: 'private', //'public-read',
Bucket: config.aws.s3Bucket,
Key: data.newDocument.filename,
Body: data.documentFile.buffer,
ContentDisposition: 'attachment',
ContentType: mime.lookup(data.documentFile.originalname)
}).then(function () {
return DocumentModel.create(data.newDocument, {
include: [
{model: EntityDocumentModel.Schema, as: 'EntityDocument'},
{model: CollateralDocumentModel.Schema, as: 'CollateralDocument'},
{model: LoanDocumentModel.Schema, as: 'LoanDocument'}
], transaction: t
}).then(function (result) {
return result;
});
});
}).then(function (result) {
if (_.isEmpty(result)) {
return callback(null, null);
}
return callback(null, result.dataValues);
}).error(function (error) {
debug('PostgreSQL: ' + error.message + ' - Are we still connected to database?');
return callback(new Boom.notFound(error.message));
});
};
exports.downloadDocument = function (data, callback) {
var recStream = s3.getObject({
Bucket: config.aws.s3Bucket,
Key: data.params.name
}).createReadStream();
recStream.pipe(callback);
};
| 31.275478 | 111 | 0.571509 |
c600d2a3ac7b865e2ec326be922c3aa9686869d4 | 360 | js | JavaScript | DAY02/TEACH-KOA-SETUP/packageTemplate.js | HappyYYT/bytedance-practice | 1aa26ad4d52830e174008f3b838a54ea429e1c23 | [
"MIT"
] | null | null | null | DAY02/TEACH-KOA-SETUP/packageTemplate.js | HappyYYT/bytedance-practice | 1aa26ad4d52830e174008f3b838a54ea429e1c23 | [
"MIT"
] | null | null | null | DAY02/TEACH-KOA-SETUP/packageTemplate.js | HappyYYT/bytedance-practice | 1aa26ad4d52830e174008f3b838a54ea429e1c23 | [
"MIT"
] | null | null | null | import ejs from "ejs";
import fs from "fs";
export function createPackageTemple(config) {
const template = fs.readFileSync("./template/package.ejs", "utf-8");
const code = ejs.render(template, {
packageName: config.packageName,
router: config.middleware.router,
static: config.middleware.static,
});
console.log(code);
return code;
}
| 21.176471 | 70 | 0.7 |
c6010eb0879396f89ce9152bfa665975be4ece09 | 1,196 | js | JavaScript | assets/js/updateProfile.js | YasasDEK/RAD | 072e4e9fa30c803dc00faffd7849ee9bd27e723c | [
"MIT"
] | 1 | 2020-06-26T17:52:42.000Z | 2020-06-26T17:52:42.000Z | assets/js/updateProfile.js | YasasDEK/RAD | 072e4e9fa30c803dc00faffd7849ee9bd27e723c | [
"MIT"
] | null | null | null | assets/js/updateProfile.js | YasasDEK/RAD | 072e4e9fa30c803dc00faffd7849ee9bd27e723c | [
"MIT"
] | null | null | null | function ConfirmPassword(){
var pwd=document.getElementById("pwd").value;
var confirm_pwd=document.getElementById("pwdConfirm").value;
if(pwd!=confirm_pwd){
alert("Password mismatch");
document.getElementById("pwdConfirm").focus();
event.preventDefault();
}else{
return true;
//confirm_pwd.setCustomValidity('');
}
}
function updateValidate(){
var custName=document.getElementById("custName").value;
var phone=document.getElementById("telephone").value;
var custAddress=document.getElementById("custAddress").value;
var strRegEx=/^[a-zA-Z\sa-zA-Z]*$/i;
var phoneRegEx=/^[0-9]{3,3}[\s]{0,1}[0-9]{3,3}[\s]{0,1}[0-9]{4,4}$/;
var noRegEx_1=/^[0-9]{1,4}[/\s]{0,1}[0-9]{0,1}$/;
var noRegEx_2=/^[0-9]{1,4}[/\s]{0,1}[A-D]{0,1}$/i;
if(!(strRegEx.test(custName))){
window.scrollTo(0,300);
alert("Enter a valid name as name !!\n For example 'Sanjali Supunnadi' ");
document.getElementById("custName").focus();
event.preventDefault();
}else if(!(phoneRegEx.test(phone))){
window.scrollTo(0,300);
alert("Enter a phone number as 071 054 0555 or 0710540555");
document.getElementById("telephone").focus();
event.preventDefault();
}else{
return true;
}
} | 26 | 77 | 0.679766 |
c601e37bb02ff88c27bfc16b935a0145c45ab34d | 7,222 | js | JavaScript | packages/ethereum-contracts/migrations/5_deploy_converter.js | rate-engineering/rate3-monorepo | 5d83193d8603f93c5897d65c0f39b51a2dd1e50a | [
"Apache-2.0"
] | 18 | 2018-08-06T17:08:44.000Z | 2019-10-02T20:30:57.000Z | packages/ethereum-contracts/migrations/5_deploy_converter.js | rate-engineering/rate3-monorepo | 5d83193d8603f93c5897d65c0f39b51a2dd1e50a | [
"Apache-2.0"
] | 52 | 2018-08-30T02:36:32.000Z | 2022-02-26T06:39:26.000Z | packages/ethereum-contracts/migrations/5_deploy_converter.js | rate-engineering/rate3-monorepo | 5d83193d8603f93c5897d65c0f39b51a2dd1e50a | [
"Apache-2.0"
] | 8 | 2018-08-24T11:14:53.000Z | 2022-02-15T02:54:26.000Z | const BaseToken = artifacts.require('./tokenization/ModularToken.sol');
const BalanceModule = artifacts.require('./tokenization/modules/BalanceModule.sol');
const AllowanceModule = artifacts.require('./tokenization/modules/AllowanceModule.sol');
const RegistryModule = artifacts.require('./tokenization/modules/RegistryModule.sol');
const ConversionReceiver = artifacts.require('./bridge/IOSTConversionReceiver.sol');
module.exports = function deployment(deployer, network, accounts) {
// eslint-disable-next-line no-unused-vars
const [owner, admin1, admin2, ...rest] = accounts;
const deployFn = async () => {
// Circle USD Dummy
console.log('\nDeploying BalanceModule');
const balance = await BalanceModule.new({ from: owner });
console.log('\nDeploying AllowanceModule');
const allowance = await AllowanceModule.new({ from: owner });
console.log('\nDeploying RegistryModule');
const registry = await RegistryModule.new({ from: owner });
console.log('\nDeploying BaseToken');
const token = await BaseToken.new('Circle USD', 'USDC', 18, { from: owner });
console.log('\nTransfer ownership of BalanceModule to Token');
await balance.transferOwnership(token.address, { from: owner });
console.log('\nTransfer ownership of AllowanceModule to Token');
await allowance.transferOwnership(token.address, { from: owner });
console.log('\nTransfer ownership of RegistryModule to Token');
await registry.transferOwnership(token.address, { from: owner });
console.log('\nSetting token\'s BalanceModule');
await token.setBalanceModule(balance.address, { from: owner });
console.log('\nSetting token\'s AllowanceModule');
await token.setAllowanceModule(allowance.address, { from: owner });
console.log('\nSetting token\'s RegistryModule');
await token.setRegistryModule(registry.address, { from: owner });
// Paxos Sandard Dummy
console.log('\nDeploying BalanceModule');
const balance3 = await BalanceModule.new({ from: owner });
console.log('\nDeploying AllowanceModule');
const allowance3 = await AllowanceModule.new({ from: owner });
console.log('\nDeploying RegistryModule');
const registry3 = await RegistryModule.new({ from: owner });
console.log('\nDeploying BaseToken');
const token3 = await BaseToken.new('Paxos Standard', 'PAX', 18, { from: owner });
console.log('\nTransfer ownership of BalanceModule to Token');
await balance3.transferOwnership(token3.address, { from: owner });
console.log('\nTransfer ownership of AllowanceModule to Token');
await allowance3.transferOwnership(token3.address, { from: owner });
console.log('\nTransfer ownership of RegistryModule to Token');
await registry3.transferOwnership(token3.address, { from: owner });
console.log('\nSetting token\'s BalanceModule');
await token3.setBalanceModule(balance3.address, { from: owner });
console.log('\nSetting token\'s AllowanceModule');
await token3.setAllowanceModule(allowance3.address, { from: owner });
console.log('\nSetting token\'s RegistryModule');
await token3.setRegistryModule(registry3.address, { from: owner });
// RTE tokens
console.log('\nDeploying BalanceModule');
const balance2 = await BalanceModule.new({ from: owner });
console.log('\nDeploying AllowanceModule');
const allowance2 = await AllowanceModule.new({ from: owner });
console.log('\nDeploying RegistryModule');
const registry2 = await RegistryModule.new({ from: owner });
console.log('\nDeploying BaseToken');
const token2 = await BaseToken.new('Rate3', 'RTE', 18, { from: owner });
console.log('\nTransfer ownership of BalanceModule to Token');
await balance2.transferOwnership(token2.address, { from: owner });
console.log('\nTransfer ownership of AllowanceModule to Token');
await allowance2.transferOwnership(token2.address, { from: owner });
console.log('\nTransfer ownership of RegistryModule to Token');
await registry2.transferOwnership(token2.address, { from: owner });
console.log('\nSetting token\'s BalanceModule');
await token2.setBalanceModule(balance2.address, { from: owner });
console.log('\nSetting token\'s AllowanceModule');
await token2.setAllowanceModule(allowance2.address, { from: owner });
console.log('\nSetting token\'s RegistryModule');
await token2.setRegistryModule(registry2.address, { from: owner });
console.log('\nSetting converter of BaseToken');
const converter = await ConversionReceiver.new(
token.address,
token2.address,
new web3.utils.BN('1000000000000000000000'), // 1000 RTE tokens
0,
10,
0,
5,
new web3.utils.BN('1000000000000000000'), // 1 token
admin1,
admin2,
{ from: owner }
);
console.log('\nSetting converter of BaseToken');
const converter2 = await ConversionReceiver.new(
token3.address,
token2.address,
new web3.utils.BN('1000000000000000000000'), // 1000 RTE tokens
0,
10,
0,
5,
new web3.utils.BN('1000000000000000000'), // 1 token
admin1,
admin2,
{ from: owner }
);
// mint 1 million tokens for testing
token.mint(owner, new web3.utils.BN('1000000000000000000000000'), { from: owner });
token3.mint(owner, new web3.utils.BN('1000000000000000000000000'), { from: owner });
console.log('\n===== Addresses ======');
console.log('USDC AllowanceModule: ', allowance.address);
console.log('USDC BalanceModule: ', balance.address);
console.log('USDC RegistryModule: ', registry.address);
console.log('USDC Token: ', token.address);
console.log('PAX AllowanceModule: ', allowance3.address);
console.log('PAX BalanceModule: ', balance3.address);
console.log('PAX RegistryModule: ', registry3.address);
console.log('PAX Token: ', token3.address);
console.log('RTE AllowanceModule:', allowance2.address);
console.log('RTE BalanceModule: ', balance2.address);
console.log('RTE RegistryModule: ', registry2.address);
console.log('RTE Token: ', token2.address);
console.log('IUSDC Converter: ', converter.address);
console.log('IPAX Converter: ', converter2.address);
console.log('======================\n');
console.log('\n===== Admins ======');
console.log('Owner: ', owner);
console.log('Admin1: ', admin1);
console.log('Admin2: ', admin2);
console.log('======================\n');
};
return deployer.then(() => deployFn()).catch(console.error);
};
| 43.769697 | 92 | 0.626558 |
c6028f1af4ee887320266cabd3081e2f29632fdc | 7,133 | js | JavaScript | wwwroot/js/Tale/dialogForm/actions/changeInventoryAction.js | NoisySpaceBalls/GoNorth | 62df5810681af63c4a7e0568f1977b302cc73252 | [
"MIT"
] | null | null | null | wwwroot/js/Tale/dialogForm/actions/changeInventoryAction.js | NoisySpaceBalls/GoNorth | 62df5810681af63c4a7e0568f1977b302cc73252 | [
"MIT"
] | null | null | null | wwwroot/js/Tale/dialogForm/actions/changeInventoryAction.js | NoisySpaceBalls/GoNorth | 62df5810681af63c4a7e0568f1977b302cc73252 | [
"MIT"
] | null | null | null | (function(GoNorth) {
"use strict";
(function(Tale) {
(function(Actions) {
/**
* Change Inventory Action
* @class
*/
Actions.ChangeInventoryAction = function()
{
GoNorth.DefaultNodeShapes.Actions.BaseAction.apply(this);
};
Actions.ChangeInventoryAction.prototype = jQuery.extend({ }, GoNorth.DefaultNodeShapes.Actions.BaseAction.prototype);
/**
* Returns the HTML Content of the action
*
* @returns {string} HTML Content of the action
*/
Actions.ChangeInventoryAction.prototype.getContent = function() {
return "<div class='gn-actionNodeObjectSelectContainer'>" +
"<a class='gn-clickable gn-taleSelectItemAction gn-nodeNonClickableOnReadonly'></a> " +
"<a class='gn-clickable gn-nodeActionOpenItem' title='" + Tale.Localization.Actions.OpenItemTooltip + "' style='display: none'><i class='glyphicon glyphicon-eye-open'></i></a>" +
"</div>" +
"<div class='gn-nodeActionText'>" + Tale.Localization.Actions.ItemQuantity + "</div>" +
"<input type='text' class='gn-taleItemQuantity'/>";
};
/**
* Gets called once the action was intialized
*
* @param {object} contentElement Content element
* @param {ActionNode} actionNode Parent Action node
*/
Actions.ChangeInventoryAction.prototype.onInitialized = function(contentElement, actionNode) {
this.contentElement = contentElement;
this.contentElement.find(".gn-taleSelectItemAction").text(Tale.Localization.Actions.ChooseItem);
var itemOpenLink = contentElement.find(".gn-nodeActionOpenItem");
// Deserialize
var existingItemId = this.deserializeData();
if(existingItemId)
{
itemOpenLink.show();
actionNode.showLoading();
actionNode.hideError();
jQuery.ajax({
url: "/api/StyrApi/ResolveFlexFieldObjectNames",
headers: GoNorth.Util.generateAntiForgeryHeader(),
data: JSON.stringify([ existingItemId ]),
type: "POST",
contentType: "application/json"
}).done(function(itemNames) {
if(itemNames.length == 0)
{
actionNode.hideLoading();
actionNode.showError();
return;
}
contentElement.find(".gn-taleSelectItemAction").text(itemNames[0].name);
actionNode.hideLoading();
}).fail(function(xhr) {
actionNode.hideLoading();
actionNode.showError();
});
}
// Handlers
var self = this;
var selectItemAction = contentElement.find(".gn-taleSelectItemAction");
contentElement.find(".gn-taleSelectItemAction").on("click", function() {
Tale.openItemSearchDialog().then(function(item) {
selectItemAction.data("itemid", item.id);
selectItemAction.text(item.name);
self.saveData();
itemOpenLink.show();
});
});
var itemQuantity = contentElement.find(".gn-taleItemQuantity");
itemQuantity.keydown(function(e) {
GoNorth.Util.validateNumberKeyPress(itemQuantity, e);
});
itemQuantity.change(function(e) {
self.ensureNumberValue();
self.saveData();
});
itemOpenLink.on("click", function() {
if(selectItemAction.data("itemid"))
{
window.open("/Styr/Item#id=" + selectItemAction.data("itemid"));
}
});
};
/**
* Syncs the operators
*/
Actions.ChangeInventoryAction.prototype.ensureNumberValue = function() {
var parsedValue = parseFloat(this.contentElement.find(".gn-taleItemQuantity").val());
if(isNaN(parsedValue))
{
this.contentElement.find(".gn-taleItemQuantity").val("");
}
}
/**
* Deserializes the data
*/
Actions.ChangeInventoryAction.prototype.deserializeData = function() {
var actionData = this.nodeModel.get("actionData");
if(!actionData)
{
return "";
}
var data = JSON.parse(actionData);
var itemId = "";
if(data.itemId)
{
this.contentElement.find(".gn-taleSelectItemAction").data("itemid", data.itemId);
itemId = data.itemId;
}
else
{
this.contentElement.find(".gn-taleSelectItemAction").data("itemid", "");
}
var quantity = data.quantity;
if(isNaN(parseInt(data.quantity)))
{
quantity = "";
}
this.contentElement.find(".gn-taleItemQuantity").val(quantity);
return itemId;
}
/**
* Saves the data
*/
Actions.ChangeInventoryAction.prototype.saveData = function() {
var itemId = this.contentElement.find(".gn-taleSelectItemAction").data("itemid");
var quantity = parseInt(this.contentElement.find(".gn-taleItemQuantity").val());
if(isNaN(quantity))
{
quantity = null;
}
var serializeData = {
itemId: itemId,
quantity: quantity
};
this.nodeModel.set("actionData", JSON.stringify(serializeData));
// Set related object data
this.nodeModel.set("actionRelatedToObjectType", GoNorth.DefaultNodeShapes.Actions.RelatedToObjectItem);
this.nodeModel.set("actionRelatedToObjectId", itemId);
}
}(Tale.Actions = Tale.Actions || {}));
}(GoNorth.Tale = GoNorth.Tale || {}));
}(window.GoNorth = window.GoNorth || {})); | 41.231214 | 207 | 0.466564 |
c602bd40f2e941d6fcb2151cff0bb104ffccf9f7 | 4,709 | js | JavaScript | docs/assets/js/16.4d3efe92.js | ealucas/lemonade | bde3187c6dc00e1e4f594b764daf10b1fdeff89d | [
"Apache-2.0"
] | 14 | 2017-11-26T14:26:31.000Z | 2022-01-09T11:23:01.000Z | docs/assets/js/16.4d3efe92.js | ealucas/lemonade | bde3187c6dc00e1e4f594b764daf10b1fdeff89d | [
"Apache-2.0"
] | null | null | null | docs/assets/js/16.4d3efe92.js | ealucas/lemonade | bde3187c6dc00e1e4f594b764daf10b1fdeff89d | [
"Apache-2.0"
] | 7 | 2018-03-01T18:10:01.000Z | 2022-01-18T10:38:55.000Z | (window.webpackJsonp=window.webpackJsonp||[]).push([[16],{264:function(a,e,t){"use strict";t.r(e);var r=t(0),o=Object(r.a)({},function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"mistura-de-gaussianas"}},[a._v("Mistura de Gaussianas")]),a._v(" "),t("p",[a._v("Método de clusterização probabilístico de mistura de gaussianas.")]),a._v(" "),t("h3",{attrs:{id:"conectores"}},[a._v("Conectores")]),a._v(" "),t("table",[t("thead",[t("tr",[t("th",[a._v("Entrada")]),a._v(" "),t("th",[a._v("Saída")])])]),a._v(" "),t("tbody",[t("tr",[t("td",[a._v("Dados utilizados para treinar o modelo")]),a._v(" "),t("td",[a._v("Dados de saída e Modelo do algoritmo de agrupamento")])])])]),a._v(" "),t("h3",{attrs:{id:"tarefa"}},[a._v("Tarefa")]),a._v(" "),t("p",[a._v("Nome da Tarefa")]),a._v(" "),t("h3",{attrs:{id:"aba-execucao"}},[a._v("Aba Execução")]),a._v(" "),t("table",[t("thead",[t("tr",[t("th",[a._v("Parâmetro")]),a._v(" "),t("th",[a._v("Detalhe")])])]),a._v(" "),t("tbody",[t("tr",[t("td",[t("strong",[a._v("Atributo(s) previsor(es)")])]),a._v(" "),t("td",[a._v("Atributo que será usado para treinamento")])]),a._v(" "),t("tr",[t("td",[t("strong",[a._v("Atributo com a Predição (novo)")])]),a._v(" "),t("td")]),a._v(" "),t("tr",[t("td",[t("strong",[a._v("Número de agrupamentos (k)")])]),a._v(" "),t("td",[a._v("Quantidade de componentes da mistura")])]),a._v(" "),t("tr",[t("td",[t("strong",[a._v("Tolerância")])]),a._v(" "),t("td",[a._v("Tolerância relativa para declarar convergência do algoritmo")])]),a._v(" "),t("tr",[t("td",[t("strong",[a._v("Número máximo de iterações")])]),a._v(" "),t("td",[a._v("Quantidade máxima de iterações do algoritmo")])]),a._v(" "),t("tr",[t("td",[t("strong",[a._v("Métrica para validação cruzada")])]),a._v(" "),t("td")]),a._v(" "),t("tr",[t("td",[t("strong",[a._v("Atributo com o número da partição (fold)")])]),a._v(" "),t("td")])])]),a._v(" "),t("p",[t("router-link",{attrs:{to:"/spark/documentacao-geral/documentacao-geral.html#aba-aparencia"}},[a._v("Aba Aparência")])],1),a._v(" "),t("p",[t("router-link",{attrs:{to:"/spark/documentacao-geral/documentacao-geral.html#aba-resultados"}},[a._v("Aba Resultados")])],1),a._v(" "),t("h2",{attrs:{id:"exemplo-de-utilizacao"}},[a._v("Exemplo de Utilização")]),a._v(" "),t("p",[t("strong",[a._v("Objetivo:")]),a._v(" utilizar o modelo mistura de gaussianas para agrupar as espécies da Íris."),t("br"),a._v(" "),t("strong",[a._v("Base de Dados:")]),a._v(" "),t("a",{attrs:{href:"/spark/base-de-dados#iris"}},[a._v("Íris")])]),a._v(" "),t("p",[t("img",{attrs:{src:"/img/spark/aprendizado_de_maquina/agrupamento_mistura_de_gaussianas/image1.png",alt:"Fluxo de trabalho - Ler Dados"}})]),a._v(" "),t("ol",[t("li",[t("p",[a._v("Adicione uma base de dados por meio da operação "),t("router-link",{attrs:{to:"/spark/entrada-e-saida/ler-dados.html"}},[a._v("Ler dados")]),a._v("."),t("br"),a._v(" "),t("img",{attrs:{src:"/img/spark/aprendizado_de_maquina/agrupamento_mistura_de_gaussianas/image4.png",alt:"Formulário - Ler Dados"}})],1)]),a._v(" "),t("li",[t("p",[a._v("Na operação "),t("strong",[a._v("Mistura de Gaussianas")]),a._v(", selecione "),t("em",[a._v("“petallength”")]),a._v(", "),t("em",[a._v("“petalwidth”")]),a._v(", "),t("em",[a._v("“sepallength”")]),a._v(" e "),t("em",[a._v("“sepalwidth”")]),a._v(" no campo "),t("strong",[a._v("Atributo(s) previsor(es)")]),a._v(". Selecione "),t("em",[a._v("“cluster”")]),a._v(" no campo "),t("strong",[a._v("Atributo com a predição (novo)")]),a._v(". Preencha 3 no campo "),t("strong",[a._v("Número de agrupamentos (k)")]),a._v(", 0.01 no campo "),t("strong",[a._v("Tolerância")]),a._v(", 20 no campo "),t("strong",[a._v("Número max. de interações")]),a._v(" e "),t("em",[a._v('“Não executar a validação cruzada"')]),a._v(" no campo "),t("strong",[a._v("Métrica para validação cruzada")]),a._v("."),t("br"),a._v(" "),t("img",{attrs:{src:"/img/spark/aprendizado_de_maquina/agrupamento_mistura_de_gaussianas/image2.png",alt:"Formulário - Mistura de Gaussianas"}})])]),a._v(" "),t("li",[t("p",[a._v("Na operação Visualizar em tabela, não preencha nada.")])]),a._v(" "),t("li",[t("p",[a._v("Execute o fluxo e visualize o resultado."),t("br"),a._v(" "),t("img",{attrs:{src:"/img/spark/aprendizado_de_maquina/agrupamento_mistura_de_gaussianas/image3.png",alt:"Resultado"}}),t("br"),a._v("\nCom a execução do modelo a probabilidade de cada amostra pertencer a cada componente pode ser visualizada pela tabela de visualização.")])])]),a._v(" "),t("hr"),a._v(" "),t("p",[a._v("Dúvidas e/ou sugestões envie um e-mail para suporte@lemonade.org.br")])])},[],!1,null,null,null);e.default=o.exports}}]); | 4,709 | 4,709 | 0.607772 |
c602f61ea15b14b046f56c6166bf726b2efc4a8b | 2,096 | js | JavaScript | fileformats.js | byter11/mpv-remote-node | 31a86be1717daa3399bb39fac2cf619615c005dd | [
"MIT"
] | 5 | 2021-08-07T21:04:18.000Z | 2022-03-23T10:14:42.000Z | fileformats.js | byter11/mpv-remote-node | 31a86be1717daa3399bb39fac2cf619615c005dd | [
"MIT"
] | 4 | 2022-01-14T07:20:16.000Z | 2022-02-17T09:30:05.000Z | fileformats.js | byter11/mpv-remote-node | 31a86be1717daa3399bb39fac2cf619615c005dd | [
"MIT"
] | 2 | 2021-08-15T08:15:46.000Z | 2022-01-13T20:08:35.000Z | const FILE_FORMATS = {
audio: [
".ac3",
".a52",
".eac3",
".mlp",
".dts",
".dts-hd",
".dtshd",
".true-hd",
".thd",
".truehd",
".thd+ac3",
".tta",
".pcm",
".wav",
".aiff",
".aif",
".aifc",
".amr",
".awb",
".au",
".snd",
".lpcm",
".ape",
".wv",
".shn",
".adts",
".adt",
".mpa",
".m1a",
".m2a",
".mp1",
".mp2",
".mp3",
".m4a",
".aac",
".flac",
".oga",
".ogg",
".opus",
".spx",
".mka",
".weba",
".wma",
".f4a",
".ra",
".ram",
".3ga",
".3ga2",
".ay",
".gbs",
".gym",
".hes",
".kss",
".nsf",
".nsfe",
".sap",
".spc",
".vgm",
".vgz",
".cue",
],
video: [
".yuv",
".y4m",
".m2ts",
".m2t",
".mts",
".mtv",
".ts",
".tsv",
".tsa",
".tts",
".trp",
".mpeg",
".mpg",
".mpe",
".mpeg2",
".m1v",
".m2v",
".mp2v",
".mpv",
".mpv2",
".mod",
".tod",
".vob",
".vro",
".evob",
".evo",
".mpeg4",
".m4v",
".mp4",
".mp4v",
".mpg4",
".h264",
".avc",
".x264",
".264",
".hevc",
".h265",
".x265",
".265",
".ogv",
".ogm",
".ogx",
".mkv",
".mk3d",
".webm",
".avi",
".vfw",
".divx",
".3iv",
".xvid",
".nut",
".flic",
".fli",
".flc",
".nsv",
".gxf",
".mxf",
".wm",
".wmv",
".asf",
".dvr-ms",
".dvr",
".wt",
".dv",
".hdv",
".flv",
".f4v",
".qt",
".mov",
".hdmov",
".rm",
".rmvb",
".3gpp",
".3gp",
".3gp2",
".3g2",
],
playlist: [".m3u", ".m3u8", ".pls"],
subtitle: [
".aqt",
".cvd",
".dks",
".jss",
".sub",
".ttxt",
".mpl",
".sub",
".pjs",
".psb",
".rt",
".smi",
".ssf",
".srt",
".ssa",
".ass",
".sub",
".svcd",
".usf",
".sub",
".idx",
".txt",
],
};
exports.FILE_FORMATS = FILE_FORMATS;
| 12.329412 | 38 | 0.28626 |
c6039020969b803ea68ca46339dcfaedaf4afa63 | 2,033 | js | JavaScript | hooks/useStorage.js | swarup4741/Stacksense | 700511111ed36e78d93356d0050c7e4f11e0a543 | [
"MIT"
] | null | null | null | hooks/useStorage.js | swarup4741/Stacksense | 700511111ed36e78d93356d0050c7e4f11e0a543 | [
"MIT"
] | 3 | 2021-07-28T04:37:40.000Z | 2021-08-30T09:51:08.000Z | hooks/useStorage.js | swarup4741/Stacksense | 700511111ed36e78d93356d0050c7e4f11e0a543 | [
"MIT"
] | null | null | null | import "firebase/storage";
import "firebase/firestore";
import { useEffect, useState } from "react";
import firebase from "firebase/app";
import { useToast } from "@chakra-ui/toast";
import { file_ext, file_types } from "../utils/filetypes";
const useStorage = (file, path, userId) => {
const [progress, setProgress] = useState(0);
const [uploadTask, setUploadTask] = useState({});
const toast = useToast();
const [url, setUrl] = useState(null);
useEffect(() => {
// references
const storageRef = firebase.storage().ref(`${userId}/${path}/${file.name}`);
const collectionRef = firebase.firestore().collection(userId);
const putFile = storageRef.put(file);
putFile.on(
"state_changed",
snap => {
setUploadTask(snap.task);
let percentage = (snap.bytesTransferred / snap.totalBytes) * 100;
setProgress(percentage);
},
err => {
switch (err.code) {
case "storage/canceled":
toast({
title: "The upload was canceled",
duration: 9000,
isClosable: true,
status: "error"
});
break;
}
},
async () => {
const url = await storageRef.getDownloadURL().catch(err => {
toast({
title: "An Error Occured !",
description: err,
duration: 9000,
isClosable: true,
status: "error"
});
});
const createdAt = firebase.firestore.FieldValue.serverTimestamp();
await collectionRef.add({
url,
createdAt,
filetype: file_ext[file_types.indexOf(file.type)],
filename: file.name,
size: file.size
});
setUrl(url);
toast({
title: "File uploaded successfully !",
duration: 4000,
isClosable: true,
status: "success"
});
}
);
}, [file]);
return { progress, url, uploadTask };
};
export default useStorage;
| 26.402597 | 80 | 0.547959 |
c603a313beedfb18689d9d0d7260e881d3b8e067 | 2,211 | js | JavaScript | media/com_fabrik/js/dist/lib/datejs/globalization/sv-FI.js | Nirchains/gdru | 4c15179f71c2eb2da33461d10e6ea70146a85d31 | [
"PostgreSQL"
] | null | null | null | media/com_fabrik/js/dist/lib/datejs/globalization/sv-FI.js | Nirchains/gdru | 4c15179f71c2eb2da33461d10e6ea70146a85d31 | [
"PostgreSQL"
] | null | null | null | media/com_fabrik/js/dist/lib/datejs/globalization/sv-FI.js | Nirchains/gdru | 4c15179f71c2eb2da33461d10e6ea70146a85d31 | [
"PostgreSQL"
] | null | null | null | /*! Fabrik */
Date.CultureInfo={name:"sv-FI",englishName:"Swedish (Finland)",nativeName:"svenska (Finland)",dayNames:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],abbreviatedDayNames:["sö","må","ti","on","to","fr","lö"],shortestDayNames:["sö","må","ti","on","to","fr","lö"],firstLetterDayNames:["s","m","t","o","t","f","l"],monthNames:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],abbreviatedMonthNames:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],amDesignator:"",pmDesignator:"",firstDayOfWeek:1,twoDigitYearMax:2029,dateElementOrder:"dmy",formatPatterns:{shortDate:"d.M.yyyy",longDate:"'den 'd MMMM yyyy",shortTime:"HH:mm",longTime:"HH:mm:ss",fullDateTime:"'den 'd MMMM yyyy HH:mm:ss",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"'den 'd MMMM",yearMonth:"MMMM yyyy"},regexPatterns:{jan:/^jan(uari)?/i,feb:/^feb(ruari)?/i,mar:/^mar(s)?/i,apr:/^apr(il)?/i,may:/^maj/i,jun:/^jun(i)?/i,jul:/^jul(i)?/i,aug:/^aug(usti)?/i,sep:/^sep(t(ember)?)?/i,oct:/^okt(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^söndag/i,mon:/^måndag/i,tue:/^tisdag/i,wed:/^onsdag/i,thu:/^torsdag/i,fri:/^fredag/i,sat:/^lördag/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|aft(er)?|from|hence)/i,subtract:/^(\-|bef(ore)?|ago)/i,yesterday:/^yes(terday)?/i,today:/^t(od(ay)?)?/i,tomorrow:/^tom(orrow)?/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^mn|min(ute)?s?/i,hour:/^h(our)?s?/i,week:/^w(eek)?s?/i,month:/^m(onth)?s?/i,day:/^d(ay)?s?/i,year:/^y(ear)?s?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a(?!u|p)|p)/i},timezones:[{name:"UTC",offset:"-000"},{name:"GMT",offset:"-000"},{name:"EST",offset:"-0500"},{name:"EDT",offset:"-0400"},{name:"CST",offset:"-0600"},{name:"CDT",offset:"-0500"},{name:"MST",offset:"-0700"},{name:"MDT",offset:"-0600"},{name:"PST",offset:"-0800"},{name:"PDT",offset:"-0700"}]}; | 737 | 2,196 | 0.632293 |
c60422bf00333f1480a6120948799ca4a28c9e8e | 192 | js | JavaScript | test/_files/simple_async.js | ryacobi/mustache-async.js | 7a0db457c958998801a142af93c946f731c235ad | [
"MIT"
] | 4 | 2018-12-17T19:06:29.000Z | 2019-08-13T21:01:39.000Z | test/_files/simple_async.js | ryacobi/mustache-async.js | 7a0db457c958998801a142af93c946f731c235ad | [
"MIT"
] | null | null | null | test/_files/simple_async.js | ryacobi/mustache-async.js | 7a0db457c958998801a142af93c946f731c235ad | [
"MIT"
] | 1 | 2019-10-25T18:23:28.000Z | 2019-10-25T18:23:28.000Z | ({
name: "Chris",
value: 10000,
taxed_value: async function () {
return new Promise(resolve => setTimeout(() => resolve(this.value - (this.value * 0.4)), 10));
},
in_ca: true
})
| 21.333333 | 98 | 0.59375 |
c6048762913444a9a8f198275320b5868c185504 | 783 | js | JavaScript | make.js | mattma/ng-component-starter | 02c6bfde7ab7155a479f48a7ba9c816011a5771d | [
"MIT"
] | 195 | 2015-11-23T09:45:36.000Z | 2021-12-15T08:46:04.000Z | make.js | mattma/ng-component-starter | 02c6bfde7ab7155a479f48a7ba9c816011a5771d | [
"MIT"
] | 33 | 2016-02-17T19:12:13.000Z | 2017-10-10T16:03:38.000Z | make.js | mattma/ng-component-starter | 02c6bfde7ab7155a479f48a7ba9c816011a5771d | [
"MIT"
] | 53 | 2015-12-12T03:42:35.000Z | 2020-03-17T18:15:26.000Z | var pkg = require('./package.json');
var path = require('path');
var Builder = require('systemjs-builder');
var name = pkg.name;
var builder = new Builder();
var config = {
baseURL: '.',
transpiler: 'typescript',
typescriptOptions: {
module: 'cjs'
},
map: {
typescript: './node_modules/typescript/lib/typescript.js',
'@angular': './node_modules/@angular',
rxjs: './node_modules/rxjs'
},
paths: {
'*': '*.js'
},
meta: {
'./node_modules/@angular/*': { build: false },
'./node_modules/rxjs/*': { build: false }
}
};
builder.config(config);
builder
.bundle(name, path.resolve(__dirname, 'bundles/', name + '.js'))
.then(function() {
console.log('Build complete.');
})
.catch(function(err) {
console.log('Error', err);
});
| 21.162162 | 64 | 0.600255 |
c604c7329c6da6d7f760e34beef5fba2f6c471ef | 172 | js | JavaScript | example/server.js | snupa/node-sessionify | a31546e0565c68acaf58e9bdba4c600d2081df9e | [
"Apache-2.0"
] | 1 | 2016-10-10T18:34:04.000Z | 2016-10-10T18:34:04.000Z | example/server.js | snupa/node-sessionify | a31546e0565c68acaf58e9bdba4c600d2081df9e | [
"Apache-2.0"
] | null | null | null | example/server.js | snupa/node-sessionify | a31546e0565c68acaf58e9bdba4c600d2081df9e | [
"Apache-2.0"
] | null | null | null | var Sessionify = require('./../index.js');
var serverObj = new Sessionify.Server({});
serverObj.listen(function() {
console.log('On port: ' + serverObj.config.port);
}); | 24.571429 | 50 | 0.674419 |
c6050f3051a148bc6aa6cc6a43182c365412b83e | 3,666 | js | JavaScript | app.js | mparram/rciots-client-nodejs | e2faac54eba75fa7616eaa7d7de0aa918f0de015 | [
"MIT"
] | 1 | 2021-05-31T01:23:38.000Z | 2021-05-31T01:23:38.000Z | app.js | mparram/rciots-client-nodejs | e2faac54eba75fa7616eaa7d7de0aa918f0de015 | [
"MIT"
] | null | null | null | app.js | mparram/rciots-client-nodejs | e2faac54eba75fa7616eaa7d7de0aa918f0de015 | [
"MIT"
] | null | null | null | // client config var
var config;
const fs = require('fs');
// if the config is hardcoded in client, it will not connect to device-controller
var cfgFile = './cfg/clientcfg.json';
// We can define the host and token in connection.json file, or with env RCIOTS_ENDPOINT & RCIOTS_TOKEN
var connectionFile = './connection.json';
// token = base64 host@token
if ((process.env.RCIOTS_ENDPOINT == undefined) || (process.env.RCIOTS_TOKEN == undefined)){
if (fs.existsSync(connectionFile)){
var connection = JSON.parse(fs.readFileSync(connectionFile));
var token = new Buffer.from(connection.endpoint + "@" + connection.token).toString('base64');
} else{
// console.log("Without env.RCIOTS_ENDPOINT & env.RCIOTS_TOKEN or configfile hardcoded can't do nothing.");
// process.exit(2);
//DEBUG TOKEN:
var token = "aHR0cHM6Ly9kZXZpY2UtY29udHJvbGxlci11c2VyMi1xaW90aGFja2Zlc3QuYXBwcy5jbHVzdGVyLWNmMDQuY2YwNC5zYW5kYm94Mzcub3BlbnRsYy5jb21AMDFmYTk0NThiNjBjNDZkNgo=";
}
} else {
var token = new Buffer.from(process.env.RCIOTS_ENDPOINT + "@" + process.env.RCIOTS_TOKEN).toString('base64');
}
// check if the config is hardcoded or ask for it to the device-manager
try {
if (fs.existsSync(cfgFile)) {
// if cfgFile exist, only the docker-compose source will run.
config = require(cfgFile);
config.composes.forEach(function getcomposes(compose, x) {
console.log("dockercompose: \n" + compose.composefile);
});
} else {
// obtain device-manager host and token to validate
let buff = new Buffer.from(token, 'base64');
console.log("token: " + buff);
let tokenArr = buff.toString('utf8').split("@");
// socket.io-client for device-manager connection
const io = require("socket.io-client");
// plugins status array
var plugins = [];
// IF enableWSEmit is true, the client will push any update throught WebSocket, false to disable.
// require device-manager connection.
const enableWSEmit = true;
// obtain unique ID from Hardware and O.S.
var nodeid = require('node-machine-id');
let id = nodeid.machineIdSync({original: true});
console.log(id);
// postData for device-manager
var postData = {"hwid": id,"token": tokenArr[1]};
// device-manager connection options
const socket = io.connect(tokenArr[0], {
auth: {
token: tokenArr[1],
hwid: id
},
ca: fs.readFileSync('ca.cer'),
secure: true,
reconnection: true,
rejectUnauthorized: false,
transports: ['websocket']
});
socket.on("connect", () => {
console.log("socket.connected"); // true
socket.emit("device_enroll", postData);
});
socket.on("connect_error", (err) => {
console.log(`connect_error due to ${err}`);
});
socket.on("devicecfg", data => {
console.log(data);
data.plugins.forEach(function getplugins(plugin, x) {
console.log("plugin: \n");
console.log(plugin);
var pluginfile = require("./sources/" + plugin.source + ".js");
pluginfile.run(plugin, function(){
if (plugins[x]){
plugins[x] = plugin;
}else{
plugins.push(plugin);
}
if(enableWSEmit){
socket.emit("update_plugins", plugins);
console.log("emit update_plugins.");
}
console.log(plugins);
})
});
});
}
} catch(err) {
console.error(err);
} | 40.285714 | 163 | 0.603382 |
c6053d6187f588104ce546fb45aaedbb0d6bc7b3 | 367 | js | JavaScript | packages/material-ui-icons/src/AddLinkTwoTone.js | silver-snoopy/material-ui | 917a3ddb8c72651fdbd4d35b1cd48ce9a06f8139 | [
"MIT"
] | 8 | 2021-03-18T08:41:32.000Z | 2021-04-19T10:24:50.000Z | packages/material-ui-icons/src/AddLinkTwoTone.js | silver-snoopy/material-ui | 917a3ddb8c72651fdbd4d35b1cd48ce9a06f8139 | [
"MIT"
] | 129 | 2021-05-05T15:07:04.000Z | 2022-03-27T02:51:27.000Z | packages/material-ui-icons/src/AddLinkTwoTone.js | danncortes/material-ui | 1eea9427971f716bd7fd17401d918841a9bd749e | [
"MIT"
] | 1 | 2021-03-25T23:57:05.000Z | 2021-03-25T23:57:05.000Z | import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M8 11h8v2H8v-2zm12.1 1H22c0-2.76-2.24-5-5-5h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1zM3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM19 12h-2v3h-3v2h3v3h2v-3h3v-2h-3v-3z" />
, 'AddLinkTwoTone');
| 52.428571 | 231 | 0.700272 |
c605bc4583625cb4cf1c830395f89a3557d8970a | 1,366 | js | JavaScript | ajax/javascript/statusmessage.toastr.js | dunatron/ldds-silvershop | 66f64f36a4dfd37cca3b49ee2aee7990a1ebdb5b | [
"Unlicense"
] | 3 | 2015-01-27T23:35:35.000Z | 2016-09-27T14:43:32.000Z | ajax/javascript/statusmessage.toastr.js | dunatron/ldds-silvershop | 66f64f36a4dfd37cca3b49ee2aee7990a1ebdb5b | [
"Unlicense"
] | 3 | 2016-03-03T15:34:15.000Z | 2017-05-11T10:01:09.000Z | ajax/javascript/statusmessage.toastr.js | dunatron/ldds-silvershop | 66f64f36a4dfd37cca3b49ee2aee7990a1ebdb5b | [
"Unlicense"
] | 5 | 2015-12-03T23:54:51.000Z | 2021-12-24T04:49:24.000Z | /**
* Responds to statusmessage events by triggering toastr. See https://github.com/CodeSeven/toastr
* You should also include the following JS/CSS if using this adapter:
*
* //cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js
* //cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css
*
* @author Mark Guinn <mark@adaircreative.com>
* @date 07.15.2014
* @package silverstripe-ajax
* @subpackage javascript
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery', 'toastr'], factory);
} else {
// Browser globals
factory(root.jQuery);
}
}(this, function ($) {
function showMessage(msg) {
if (typeof(msg) === 'string') msg = {content:msg};
if (typeof(msg.content) != 'string') return;
if (typeof(msg.type) != 'string') msg.type = 'info';
switch(msg.type) {
case 'good':
case 'success':
toastr.success(msg.content);
break;
case 'bad':
case 'error':
toastr.error(msg.content);
break;
case 'warning':
case 'warn':
toastr.warning(msg.content);
break;
default:
toastr.info(msg.content);
}
}
$(document).on('statusmessage', function(e, msg){
if ($.isArray(msg)) {
for (var i = 0; i < msg.length; i++) showMessage(msg[i]);
} else {
showMessage(msg);
}
});
})); | 23.964912 | 97 | 0.639092 |
c605f22cd1c665934e24b5e312828703007f4bc4 | 243 | js | JavaScript | .specless/src/template/useExit.js | specless/framework | b74aefbb37fa3a966e7680d475cc6353ab553c84 | [
"MIT"
] | null | null | null | .specless/src/template/useExit.js | specless/framework | b74aefbb37fa3a966e7680d475cc6353ab553c84 | [
"MIT"
] | 4 | 2021-05-11T20:24:37.000Z | 2022-03-27T04:40:17.000Z | .specless/src/template/useExit.js | specless/framework | b74aefbb37fa3a966e7680d475cc6353ab553c84 | [
"MIT"
] | null | null | null | import React from 'react';
import { Context } from '@specless/components';
export const useExit = (id) => {
const { api = {} } = React.useContext(Context);
return (overrideUrl, fireSilently) => api.exit(id, overrideUrl, fireSilently)
} | 40.5 | 81 | 0.683128 |
c60625d0e63802866be92a3c3eaf0250b3378482 | 12,661 | js | JavaScript | managed/ui/src/components/profile/CustomerProfile.js | eliahburns/yugabyte-db | 570d28dde28d6a0e6a689274b5e319de9a81b707 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | managed/ui/src/components/profile/CustomerProfile.js | eliahburns/yugabyte-db | 570d28dde28d6a0e6a689274b5e319de9a81b707 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | managed/ui/src/components/profile/CustomerProfile.js | eliahburns/yugabyte-db | 570d28dde28d6a0e6a689274b5e319de9a81b707 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | // Copyright (c) YugaByte, Inc.
import React, { Component } from 'react';
import Cookies from 'js-cookie';
import { Row, Col, Tab } from 'react-bootstrap';
import { YBFormInput, YBButton, YBToggle, YBControlledSelectWithLabel } from '../common/forms/fields';
import { Formik, Form, Field } from 'formik';
import { browserHistory} from 'react-router';
import { isNonAvailable, isDisabled, showOrRedirect, isNotHidden } from 'utils/LayoutUtils';
import { FlexContainer, FlexGrow, FlexShrink } from '../common/flexbox/YBFlexBox';
import { YBTabsWithLinksPanel } from '../panels';
import { YBCopyButton } from '../common/descriptors';
import _ from 'lodash';
import * as Yup from 'yup';
import { isDefinedNotNull, isNonEmptyObject } from 'utils/ObjectUtils';
import { getPromiseState } from '../../utils/PromiseUtils';
// TODO set predefined defaults another way not to share defaults this way
const CHECK_INTERVAL_MS = 300000;
const STATUS_UPDATE_INTERVAL_MS = 43200000;
export default class CustomerProfile extends Component {
constructor(props) {
super(props);
this.state = {
statusUpdated: false
};
}
componentDidMount() {
const { customer } = this.props;
if (isNonAvailable(customer.features, "main.profile")) browserHistory.push('/');
}
handleRefreshApiToken = (e) => {
const { refreshApiToken } = this.props;
const authToken = Cookies.get("authToken") || localStorage.getItem('authToken');
e.stopPropagation();
e.preventDefault();
refreshApiToken({"X-AUTH-TOKEN": authToken});
}
render() {
const {
customer = {},
apiToken,
customerProfile,
updateCustomerDetails,
params
} = this.props;
showOrRedirect(customer.features, "main.profile");
let profileUpdateStatus = <span/>;
if (customerProfile.data === "updated-success" && this.state.statusUpdated) {
profileUpdateStatus = <span className="pull-right request-status yb-success-color yb-dissapear">Profile Updated Successfully</span>;
setTimeout(() => {
this.setState({statusUpdated: false});
}, 2000);
} else if (customerProfile.error && this.state.statusUpdated) {
profileUpdateStatus = <span className="pull-right request-status yb-fail-color yb-dissapear">Profile Update Failed</span>;
setTimeout(() => {
this.setState({statusUpdated: false});
}, 2000);
}
const validationSchema = Yup.object().shape({
name: Yup.string()
.required('Enter name'),
// Regex below matches either the default value 'admin' or a generic email address
email: Yup.string()
.matches(
/(^admin$)|(^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$)/i,
'This is not a valid email or value'
)
.required('Enter email'),
code: Yup.string()
.required('Enter Environment name')
.max(5, 'Environment name can be only 5 characters long'),
password: Yup.string()
.notRequired()
.oneOf([Yup.ref('confirmPassword')], "Passwords don't match"),
confirmPassword: Yup.string()
.notRequired()
.oneOf([Yup.ref('password')], "Passwords don't match"),
alertingData: Yup.object({
sendAlertsToYb: Yup.boolean(),
alertingEmail: Yup.string().nullable(),
checkIntervalMs: Yup.number()
.typeError('Must specify a number')
.integer(),
statusUpdateIntervalMs: Yup.number()
.typeError('Must specify a number')
.integer(),
}),
callhomeLevel: Yup.string()
});
const alertingDataProps = ['alertingEmail', 'checkIntervalMs', 'statusUpdateIntervalMs', 'sendAlertsToYb'];
const initialValues = {
name: customer.name || '',
email: customer.email || '',
code: customer.code || '',
alertingData: {
// alertingData properties
alertingEmail: customer.alertingData ?
customer.alertingData.alertingEmail || '':
'',
checkIntervalMs: isNonEmptyObject(customer.alertingData) ?
customer.alertingData.checkIntervalMs :
CHECK_INTERVAL_MS,
statusUpdateIntervalMs: isNonEmptyObject(customer.alertingData) ?
customer.alertingData.statusUpdateIntervalMs :
STATUS_UPDATE_INTERVAL_MS,
sendAlertsToYb: customer.alertingData && customer.alertingData.sendAlertsToYb,
},
password: '',
callhomeLevel: customer.callhomeLevel || 'NONE',
confirmPassword: '',
};
const callhomeOptions = [
<option value="NONE" key={0}>None</option>,
<option value="LOW" key={1}>Low</option>,
<option value="MEDIUM" key={2}>Medium</option>,
<option value="HIGH" key={3}>High</option>
];
const defaultTab = isNotHidden(customer.features, "main.profile") ? "general" : "general";
const activeTab = isDefinedNotNull(params) ? params.tab : defaultTab;
return (
<div className="bottom-bar-padding">
<h2 className="content-title">Update Customer Profile {profileUpdateStatus}</h2>
<Formik
validationSchema={validationSchema}
initialValues={initialValues}
enableReinitialize
onSubmit={(values, { setSubmitting }) => {
/**
* Generate object to be sent with only changes from the `initialValues` object.
* Properties in `alertingDataProps` will be moved under `alertingData` key.
*/
this.setState({statusUpdated: true});
const removedDefaults = _.omitBy(values, (v, k) => v === initialValues[k]);
// Required fields for API
const alertingObj = {
name: values.name,
email: values.email,
code: values.code,
};
const omitProps = _.pick(removedDefaults, alertingDataProps);
if (!_.isEmpty(omitProps)) {
alertingObj.alertingData = omitProps;
}
const diffResult = _.assign(_.omit(removedDefaults, alertingDataProps), alertingObj);
updateCustomerDetails(diffResult);
setSubmitting(false);
}}
render={({
values,
handleChange,
handleSubmit,
isSubmitting,
}) => (
<Form name="EditCustomerProfile" onSubmit={handleSubmit}>
<YBTabsWithLinksPanel defaultTab={defaultTab} activeTab={activeTab} routePrefix={`/profile/`} id={"profile-tab-panel"} className="profile-detail">
{[
<Tab.Pane
eventKey={"general"}
title="General"
key="general-tab"
mountOnEnter={true}
unmountOnExit={true}
disabled={isDisabled(customer.features, "main.profile")}>
<Row>
<Col md={6} sm={12}>
<Row>
<Col sm={12}>
<h3>Profile Info</h3>
<Field name="name" type="text" component={YBFormInput} placeholder="Full Name" label="Full Name"/>
<Field name="email" readOnly={false} type="text" label="Email" component={YBFormInput} placeholder="Email Address" />
<Field name="code" readOnly={true} type="text" label="Environment" component={YBFormInput} placeholder="Customer Code" />
</Col>
</Row>
<Row>
<Col sm={12}>
<br/>
<h3>Change Password</h3>
<Field name="password" type="password" component={YBFormInput} label="Password" autoComplete="new-password" placeholder="Enter New Password"/>
<Field name="confirmPassword" type="password" component={YBFormInput} label="Confirm Password" autoComplete="new-password" placeholder="Confirm New Password"/>
</Col>
</Row>
</Col>
<Col md={6} sm={12}>
<h3>API Key management</h3>
<FlexContainer>
<FlexGrow className="api-token-component">
<Field
field={{value: apiToken.data || customer.apiToken || ""}}
type="text"
readOnly={true}
component={YBFormInput}
label="API Token"
placeholder="Press Generate Key"
/>
<YBCopyButton text={apiToken.data || customer.apiToken || ""}/>
</FlexGrow>
<FlexShrink>
<YBButton
btnText="Generate Key"
btnType="button"
loading={getPromiseState(apiToken).isLoading()}
onClick={this.handleRefreshApiToken}
btnClass="btn btn-orange pull-right btn-api-token"
/>
</FlexShrink>
</FlexContainer>
</Col>
</Row>
<Row>
<Col sm={12}>
<YBButton btnText="Save All Changes"
btnType="submit"
disabled={isSubmitting}
btnClass="btn btn-orange pull-right"
/>
</Col>
</Row>
</Tab.Pane>,
<Tab.Pane
eventKey={"health-alerting"}
title="Health & Alerting"
key="health-alerting-tab"
mountOnEnter={true}
unmountOnExit={true}
disabled={isDisabled(customer.features, "main.profile")}>
<Row>
<Col md={6} sm={12}>
<h3>Alerting controls</h3>
<Field
name="alertingData.alertingEmail"
type="text"
component={YBFormInput}
label="Alert email"
placeholder="Email to forward alerts to"
/>
<Field name="alertingData.sendAlertsToYb">
{({field, form}) => (<YBToggle onToggle={handleChange}
name="alertingData.sendAlertsToYb"
input={{
value: field.value,
onChange: field.onChange,
}}
label="Send alert emails to YugaByte team"
subLabel="Whether or not to send alerting emails to the YugaByte team."
/>
)}
</Field>
<Field name="callhomeLevel"
component={YBControlledSelectWithLabel}
label="Callhome Level"
input={{name: 'callhomeLevel'}}
onInputChanged={handleChange}
selectVal={values.callhomeLevel}
options={callhomeOptions}
/>
<Field name="alertingData.checkIntervalMs" type="text" component={YBFormInput} label="Health check interval" placeholder="Miliseconds to check universe status"/>
<Field name="alertingData.statusUpdateIntervalMs" type="text" component={YBFormInput} label="Report email interval" placeholder="Miliseconds to send a status report email"/>
</Col>
</Row>
<Row>
<Col sm={12}>
<YBButton btnText="Save All Changes"
btnType="submit"
disabled={isSubmitting}
btnClass="btn btn-orange pull-right"
/>
</Col>
</Row>
</Tab.Pane>
]}
</YBTabsWithLinksPanel>
</Form>
)}
/>
</div>
);
}
}
| 41.511475 | 197 | 0.512203 |
c6065e07e96a2d3553dc1ed2f9b858d9c7bd6d74 | 464 | js | JavaScript | src/views/NotFoundView/NotFoundView.js | snerks/ts-react-redux-starter-kit | b4fbaafa3871608d9cfc002c34e9bab29c88ac07 | [
"MIT"
] | null | null | null | src/views/NotFoundView/NotFoundView.js | snerks/ts-react-redux-starter-kit | b4fbaafa3871608d9cfc002c34e9bab29c88ac07 | [
"MIT"
] | null | null | null | src/views/NotFoundView/NotFoundView.js | snerks/ts-react-redux-starter-kit | b4fbaafa3871608d9cfc002c34e9bab29c88ac07 | [
"MIT"
] | null | null | null | /// <reference path="../../../typings/tsd.d.ts" />
import * as React from 'react';
import { Link } from 'react-router';
export class NotFoundView extends React.Component {
render() {
return (React.createElement("div", {"className": 'container text-center'}, React.createElement("h1", null, "This is a demo 404 page!"), React.createElement("hr", null), React.createElement(Link, {"to": '/'}, "Back To Home View")));
}
}
export default NotFoundView;
| 46.4 | 239 | 0.661638 |
c606beee10596aa5802b5dcf59bb1437e703c6dc | 3,131 | js | JavaScript | frontend/node_modules/@material-ui/icons/esm/PoolTwoTone.js | jrocktorrens/JoinIn | 61ec694b60ca5b9bc5f46507d6acd45c6fdba43e | [
"Apache-2.0"
] | 9 | 2020-12-07T10:31:58.000Z | 2021-01-30T09:55:20.000Z | node_modules/@material-ui/icons/esm/PoolTwoTone.js | Jdilla1212/Portfolio | 8c3e443edd65db05407a3c647423098adb9aea86 | [
"Unlicense"
] | 71 | 2022-02-09T04:40:51.000Z | 2022-03-25T07:28:16.000Z | node_modules/@material-ui/icons/esm/PoolTwoTone.js | Jdilla1212/Portfolio | 8c3e443edd65db05407a3c647423098adb9aea86 | [
"Unlicense"
] | 5 | 2022-02-28T03:25:14.000Z | 2022-03-17T11:32:55.000Z | import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
d: "M22 21c-1.11 0-1.73-.37-2.18-.64-.37-.22-.6-.36-1.15-.36-.56 0-.78.13-1.15.36-.46.27-1.07.64-2.18.64s-1.73-.37-2.18-.64c-.37-.22-.6-.36-1.15-.36-.56 0-.78.13-1.15.36-.46.27-1.08.64-2.19.64s-1.73-.37-2.18-.64c-.37-.23-.6-.36-1.15-.36s-.78.13-1.15.36c-.46.27-1.08.64-2.19.64v-2c.56 0 .78-.13 1.15-.36.46-.27 1.08-.64 2.19-.64s1.73.37 2.18.64c.37.23.59.36 1.15.36.56 0 .78-.13 1.15-.36.46-.27 1.08-.64 2.19-.64s1.73.37 2.18.64c.37.22.6.36 1.15.36s.78-.13 1.15-.36c.45-.27 1.07-.64 2.18-.64s1.73.37 2.18.64c.37.23.59.36 1.15.36v2zm0-4.5c-1.11 0-1.73-.37-2.18-.64-.37-.22-.6-.36-1.15-.36-.56 0-.78.13-1.15.36-.45.27-1.07.64-2.18.64s-1.73-.37-2.18-.64c-.37-.22-.6-.36-1.15-.36-.56 0-.78.13-1.15.36-.45.27-1.07.64-2.18.64s-1.73-.37-2.18-.64c-.37-.22-.6-.36-1.15-.36s-.78.13-1.15.36c-.47.27-1.09.64-2.2.64v-2c.56 0 .78-.13 1.15-.36.45-.27 1.07-.64 2.18-.64s1.73.37 2.18.64c.37.22.6.36 1.15.36.56 0 .78-.13 1.15-.36.45-.27 1.07-.64 2.18-.64s1.73.37 2.18.64c.37.22.6.36 1.15.36s.78-.13 1.15-.36c.45-.27 1.07-.64 2.18-.64s1.73.37 2.18.64c.37.22.6.36 1.15.36v2H22zM8.67 12c.56 0 .78-.13 1.15-.36.46-.27 1.08-.64 2.19-.64s1.73.37 2.18.64c.37.22.6.36 1.15.36s.78-.13 1.15-.36c.12-.07.26-.15.41-.23L10.48 5C8.93 3.45 7.5 2.99 5 3v2.5c1.82-.01 2.89.39 4 1.5l1 1-3.25 3.25c.31.12.56.27.77.39.37.23.59.36 1.15.36z",
opacity: ".3"
}), /*#__PURE__*/React.createElement("circle", {
cx: "16.5",
cy: "5.5",
r: "2.5",
opacity: ".3"
}), /*#__PURE__*/React.createElement("path", {
d: "M22 16.5h-.02.02zM10 8l-3.25 3.25c.31.12.56.27.77.39.37.23.59.36 1.15.36s.78-.13 1.15-.36c.46-.27 1.08-.64 2.19-.64s1.73.37 2.18.64c.37.22.6.36 1.15.36.55 0 .78-.13 1.15-.36.12-.07.26-.15.41-.23L10.48 5C8.93 3.45 7.5 2.99 5 3v2.5c1.82-.01 2.89.39 4 1.5l1 1zm-4.65 7.5c.55 0 .78.14 1.15.36.45.27 1.07.64 2.18.64s1.73-.37 2.18-.64c.37-.23.59-.36 1.15-.36.55 0 .78.14 1.15.36.45.27 1.07.64 2.18.64s1.73-.37 2.18-.64c.37-.23.59-.36 1.15-.36.55 0 .78.14 1.15.36.45.27 1.06.63 2.16.64v-2c-.55 0-.78-.14-1.15-.36-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.18.64c-.37.23-.6.36-1.15.36s-.78-.14-1.15-.36c-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.18.64c-.37.23-.59.36-1.15.36-.55 0-.78-.14-1.15-.36-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.18.64c-.37.23-.59.36-1.15.36v2c1.11 0 1.73-.37 2.2-.64.37-.23.6-.36 1.15-.36zM18.67 18c-1.11 0-1.73.37-2.18.64-.37.23-.6.36-1.15.36-.55 0-.78-.14-1.15-.36-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.19.64c-.37.23-.59.36-1.15.36s-.78-.13-1.15-.36c-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.19.64c-.37.23-.59.36-1.15.36v2c1.11 0 1.73-.37 2.19-.64.37-.23.6-.36 1.15-.36.55 0 .78.13 1.15.36.45.27 1.07.64 2.18.64s1.73-.37 2.19-.64c.37-.23.59-.36 1.15-.36.55 0 .78.14 1.15.36.45.27 1.07.64 2.18.64s1.72-.37 2.18-.64c.37-.23.59-.36 1.15-.36.55 0 .78.14 1.15.36.45.27 1.07.64 2.18.64v-2c-.56 0-.78-.13-1.15-.36-.45-.27-1.07-.64-2.18-.64z"
}), /*#__PURE__*/React.createElement("circle", {
cx: "16.5",
cy: "5.5",
r: "2.5"
})), 'PoolTwoTone'); | 184.176471 | 1,341 | 0.60428 |
c606d3b6d797d6b1eea0b61350f5acd46238f022 | 311 | js | JavaScript | src/test/one.spec.js | sc0tt5/gulp-starter | ced4205c16a139a2d5250e2da0cac9848bbcdf90 | [
"MIT"
] | 2 | 2018-07-02T13:56:47.000Z | 2018-07-07T05:46:38.000Z | src/test/one.spec.js | sc0tt5/gulp-starter | ced4205c16a139a2d5250e2da0cac9848bbcdf90 | [
"MIT"
] | null | null | null | src/test/one.spec.js | sc0tt5/gulp-starter | ced4205c16a139a2d5250e2da0cac9848bbcdf90 | [
"MIT"
] | 1 | 2018-07-02T13:56:49.000Z | 2018-07-02T13:56:49.000Z | describe('Hello world 1', () => {
beforeEach(() => {
spyOn(window, 'helloWorldOne').and.callThrough();
window.helloWorldOne('Hello world 1!');
});
it('says hello', () => {
expect(window.helloWorldOne).toHaveBeenCalled();
expect(window.helloWorldOne).toHaveBeenCalledWith('Hello world 1!');
});
});
| 25.916667 | 70 | 0.659164 |
c606ed4f10607e3e5ae0f54b1dfcf058820e78d7 | 497 | js | JavaScript | lib/api/users/helpers/index.js | bewest/restify-git-json | e327ee2ae96d9e740af2edd06497762bd94bfb6f | [
"BSD-2-Clause"
] | 1 | 2021-02-20T10:21:21.000Z | 2021-02-20T10:21:21.000Z | lib/api/users/helpers/index.js | bewest/restify-git-json | e327ee2ae96d9e740af2edd06497762bd94bfb6f | [
"BSD-2-Clause"
] | null | null | null | lib/api/users/helpers/index.js | bewest/restify-git-json | e327ee2ae96d9e740af2edd06497762bd94bfb6f | [
"BSD-2-Clause"
] | 1 | 2015-05-22T23:00:14.000Z | 2015-05-22T23:00:14.000Z |
var callbacks = require('./callbacks');
var save = require('./save');
var saveDelta = save.saveDelta;
var create = require('./create');
var init = require('./init');
var applyDelta = require('./delta');
var findRepo = require('./findRepo');
var findMaster = require('./findMaster');
var api = {
applyDelta: applyDelta
, saveDelta: saveDelta
, callbacks: callbacks
, init: init
, save: save
, create: create
, findRepo: findRepo
, findMaster: findMaster
};
module.exports = api;
| 23.666667 | 41 | 0.672032 |
c606ee3bcad9a0c0aaa547d630a27f8a1cbbb7a5 | 692 | js | JavaScript | test/fixtures/compile/class/class.extends.field.let.wt_i.wct_nas.wct_was.js | kaoscript/kaoscript | 585214c130df90a125e835f6f02fa368106ce2bd | [
"MIT"
] | 11 | 2016-10-03T20:23:49.000Z | 2022-02-22T04:33:27.000Z | test/fixtures/compile/class/class.extends.field.let.wt_i.wct_nas.wct_was.js | kaoscript/kaoscript | 585214c130df90a125e835f6f02fa368106ce2bd | [
"MIT"
] | 127 | 2016-09-17T17:48:37.000Z | 2021-05-07T02:11:53.000Z | test/fixtures/compile/class/class.extends.field.let.wt_i.wct_nas.wct_was.js | kaoscript/kaoscript | 585214c130df90a125e835f6f02fa368106ce2bd | [
"MIT"
] | null | null | null | module.exports = function() {
class ClassA {
constructor() {
this.__ks_init();
this.__ks_cons(arguments);
}
__ks_init() {
}
__ks_cons_0() {
}
__ks_cons(args) {
if(args.length === 0) {
ClassA.prototype.__ks_cons_0.apply(this);
}
else {
throw new SyntaxError("Wrong number of arguments");
}
}
}
class ClassB extends ClassA {
__ks_init() {
ClassA.prototype.__ks_init.call(this);
}
__ks_cons_0() {
ClassA.prototype.__ks_cons.call(this, []);
this._x = 0;
}
__ks_cons(args) {
if(args.length === 0) {
ClassB.prototype.__ks_cons_0.apply(this);
}
else {
throw new SyntaxError("Wrong number of arguments");
}
}
}
}; | 18.702703 | 55 | 0.614162 |
c608363ba3d72f8fee8d263a1f1dc0ba19dcfda8 | 3,514 | js | JavaScript | js/printexport.js | owenschoppe/Printable | ca8f1d3a02ba55061a6c8b9b34757bb5543e1f33 | [
"CC-BY-3.0"
] | 1 | 2019-03-25T02:59:44.000Z | 2019-03-25T02:59:44.000Z | js/printexport.js | owenschoppe/Printable | ca8f1d3a02ba55061a6c8b9b34757bb5543e1f33 | [
"CC-BY-3.0"
] | null | null | null | js/printexport.js | owenschoppe/Printable | ca8f1d3a02ba55061a6c8b9b34757bb5543e1f33 | [
"CC-BY-3.0"
] | null | null | null | var row = []; //In memory cache for each row of the sheet returned.
var gdocs = {};
/////////////////////////////////////////////////////////
gdocs.printDocumentPage = function(callback)
{
console.log('printDocumentPage');
//chrome.tabs.create({ 'url' : 'view.html?key='+docKey});
chrome.tabs.create({ 'url' : 'view.html'});
if(callback) callback();
};
/////////////////////////////////////////////////////////
gdocs.exportDocumentPage = function(callback)
{
console.log('exportDocument');
//chrome.tabs.create({ 'url' : 'export.html?key='+docKey});
chrome.tabs.create({ 'url' : 'export.html'});
if(callback) callback();
};
/////////////////////////////////////////////////////////
//Dynamic row prototype that parses all user defined columns.
gdocs.Row = function(entry) {
for (var key in entry) {
parts = key.toString().split('$');
if(parts[0] == 'gsx'){
if (entry.hasOwnProperty(key)) {
this[parts[1]] = entry[key].$t;
}
}
}
};
/////////////////////////////////////////////////////////
gdocs.processDocContent = function(response, xhr, callback) {
console.log('rows returned: ', xhr);
row = [];
if (xhr.status != 200) {
//TODO: Add an error message display.
//gdocs.handleError(xhr, response);
return;
} else {
requestFailureCount = 0;
}
var data = JSON.parse(response);
console.log('row data: ',data,Boolean(data.feed.entry));
if(data.feed.entry) {
for (var i = 0, entry; entry = data.feed.entry[i]; ++i) {
//console.log(i);
row.push(new gdocs.Row(entry));
//console.log(entry);
}
//console.log('rows: ', row);
if(callback) callback();
} else {
console.log('No entries');
util.displayError('Invalid file.');
util.hideMsg();
}
};
////////////////////////////////////////////////////
gdocs.printDocument = function(destination, callback) {
if(destination == 'new'){ return; }
//var worksheetId = 'od6';
//var url = SPREAD_SCOPE +'/list/'+docKey+'/'+worksheetId+'/private/full'; //good
var handleSuccess = function(response, xhr){
gdocs.processDocContent(response,xhr,callback );
}
var config = {
params: {
'alt': 'json'
},
headers: {
'Authorization': 'Bearer ' + gDocsUtil.accessToken,
'GData-Version': '3.0',
}
};
var worksheetId = 'default';
var url = SPREAD_SCOPE +'/list/'+docKey+'/'+worksheetId+'/private/full?'+util.stringify(config.params);
gDocsUtil.makeRequest('GET', url, handleSuccess, null, config.headers);
//bgPage.oauth.sendSignedRequest(url, function(response, xhr){gdocs.processDocContent(response,xhr,callback )}, params);
};
/////////////////////////////////////////////////////////
gdocs.exportDocument = function(destination, callback){
if(destination == 'new'){ return; }
//Duplicate the print request to get the updated rows.
//For now just run print first.
console.log('exportDocument ', destination);
//TODO: Pass in docName.
//docName = $("select option:selected").text();
//docName = docs[$("select option").index($("select option:selected"))-1].title;
//console.log('docName: ',docName);
var worksheetId = 'od6';
var url = SPREAD_SCOPE +'/list/'+docKey+'/'+worksheetId+'/private/full'; //good
var params = {
'headers': {
'GData-Version': '3.0'
},
'parameters': {
'alt': 'json',
}
};
bgPage.oauth.sendSignedRequest(url, function(response, xhr){gdocs.processDocContent(response,xhr,callback )}, params);
} | 29.529412 | 124 | 0.569152 |
c608759ecc373c81c4ad7bc3bfbc91667f59ad1c | 224 | js | JavaScript | front/sistema-facil/src/services/MenuService.js | rodrigocaldeira/sistema_facil | c57ed61978477c0b6dd0d5d492ba286cfc7d032a | [
"MIT"
] | 2 | 2020-07-25T23:46:57.000Z | 2020-08-25T00:16:55.000Z | front/sistema-facil/src/services/MenuService.js | rodrigocaldeira/sistema_facil | c57ed61978477c0b6dd0d5d492ba286cfc7d032a | [
"MIT"
] | null | null | null | front/sistema-facil/src/services/MenuService.js | rodrigocaldeira/sistema_facil | c57ed61978477c0b6dd0d5d492ba286cfc7d032a | [
"MIT"
] | null | null | null | import axios from 'axios';
const buscarCadastros = async () => {
let response = await axios.get('http://localhost:8080/api/cadastros');
let cadastros = response.data;
return cadastros;
}
export default buscarCadastros;
| 22.4 | 71 | 0.736607 |
c608cd1f9be13b2c9322767929dd12078e263bf1 | 2,097 | js | JavaScript | public/assets/plugins/angular-typehead/angular-typeahead.min.js | denyjackrose/ap | 259466035276440b354335b1887912303fda1363 | [
"Apache-2.0"
] | 12 | 2016-07-29T16:40:54.000Z | 2020-01-03T11:19:43.000Z | public/assets/plugins/angular-typehead/angular-typeahead.min.js | denyjackrose/ap | 259466035276440b354335b1887912303fda1363 | [
"Apache-2.0"
] | 23 | 2020-02-12T02:35:49.000Z | 2022-02-11T03:45:40.000Z | public/assets/plugins/angular-typehead/angular-typeahead.min.js | denyjackrose/ap | 259466035276440b354335b1887912303fda1363 | [
"Apache-2.0"
] | 5 | 2016-07-21T11:54:36.000Z | 2018-03-11T19:13:09.000Z | angular.module("siyfion.sfTypeahead",[]).directive("sfTypeahead",function(){return{restrict:"AC",require:"?ngModel",scope:{options:"=",datasets:"=",suggestionKey:"@"},link:function(a,b,c,d){function e(){if(j)b.typeahead(a.options,a.datasets),j=!1;else{var c=b.val();b.typeahead("destroy"),b.typeahead(a.options,a.datasets),d.$setViewValue(c),b.triggerHandler("typeahead:opened")}}function f(a,b){var c=-1;return angular.forEach(a,function(a,d){angular.equals(b,a)&&(c=d)}),c>=0}function g(b,c,e){a.$apply(function(){var b=angular.isDefined(a.suggestionKey)?c[a.suggestionKey]:c;d.$setViewValue(b)})}var h=a.options||{},i=(angular.isArray(a.datasets)?a.datasets:[a.datasets])||[],j=!0;e(),a.$watch("options",e),angular.isArray(a.datasets)?a.$watchCollection("datasets",e):a.$watch("datasets",e),d.$parsers.push(function(a){if(angular.isObject(d.$modelValue)&&a===b.typeahead("val"))return d.$modelValue;var c=angular.isObject(a);return h.editable===!1?(d.$setValidity("typeahead",c),c?a:void 0):a}),d.$formatters.push(function(c){if(angular.isObject(c)){var e=!1;return $.each(i,function(g,j){function k(j){var k=f(j,c);k?(d.$setViewValue(c),e=!0):d.$setViewValue(h.editable===!1?void 0:c),(e||g===i.length-1)&&setTimeout(function(){a.$apply(function(){b.typeahead("val",n)})},0)}var l=j.source,m=j.displayKey||"value",n=(angular.isFunction(m)?m(c):c[m])||"";return e?!1:n?void l(n,k):void k([])}),""}return null==c&&b.typeahead("val",null),c}),b.bind("typeahead:selected",function(b,c,d){g(b,c,d),a.$emit("typeahead:selected",c,d)}),b.bind("typeahead:autocompleted",function(b,c,d){g(b,c,d),a.$emit("typeahead:autocompleted",c,d)}),b.bind("typeahead:opened",function(){a.$emit("typeahead:opened")}),b.bind("typeahead:closed",function(){a.$emit("typeahead:closed")}),b.bind("typeahead:asyncrequest",function(){a.$emit("typeahead:asyncrequest")}),b.bind("typeahead:asynccancel",function(){a.$emit("typeahead:asynccancel")}),b.bind("typeahead:asyncreceive",function(){a.$emit("typeahead:asyncreceive")}),b.bind("typeahead:cursorchanged",function(b,c,d){a.$emit("typeahead:cursorchanged",b,c,d)})}}}); | 2,097 | 2,097 | 0.704816 |
c608d1b07aa1b7e5277ec0fb95000d4e68586b7a | 9,815 | js | JavaScript | public/dashboardassets/js/main-bak-2.js | zahidul1994/bikebikroy | ce9315ebe2fd8d0b2edf41881a3643dcb9c822f9 | [
"MIT"
] | null | null | null | public/dashboardassets/js/main-bak-2.js | zahidul1994/bikebikroy | ce9315ebe2fd8d0b2edf41881a3643dcb9c822f9 | [
"MIT"
] | null | null | null | public/dashboardassets/js/main-bak-2.js | zahidul1994/bikebikroy | ce9315ebe2fd8d0b2edf41881a3643dcb9c822f9 | [
"MIT"
] | null | null | null | $(document).ready(function () {
// toggle menu
$(".layout-menu").click(function () {
$(".layout-toggle").slideToggle();
$(".menu-angle-one").toggleClass("arrow-rotate");
});
$(".forms-menu").click(function () {
$(".forms-toggle").slideToggle();
$(".menu-angle-two").toggleClass("arrow-rotate");
});
$(".table-menu").click(function () {
$(".table-toggle").slideToggle();
$(".menu-angle-three").toggleClass("arrow-rotate");
});
$(".page-menu").click(function () {
$(".page-toggle").slideToggle();
$(".menu-angle-four").toggleClass("arrow-rotate");
});
$(".multi-menu").click(function () {
$(".multi-toggle").slideToggle();
$(".menu-angle-five").toggleClass("arrow-rotate");
});
$(".component-menu").click(function () {
$(".component-toggle").slideToggle();
$(".menu-angle-six").toggleClass("arrow-rotate");
});
$(".component-menu").click(function () {
$(".collp-page").toggleClass("arrow-rotate-collp");
});
$(".forms-menu").click(function () {
$(".collp-page").toggleClass("arrow-rotate-collp");
});
$(".table-menu").click(function () {
$(".collp-page").toggleClass("arrow-rotate-collp");
});
// toggle menu
// slide menu
$(".main-toggle-btn").click(function () {
$(".sidebar").animate({
width: "toggle"
});
});
$(".main-toggle-btn").click(function () {
$(".main-content").toggleClass("main-cont-width");
});
$(".sidebar-collapse-menu").click(function () {
$(".sidebar").animate({
width: "toggle"
});
});
$(".sidebar-collapse-menu").click(function () {
$(".main-content").toggleClass("main-cont-width");
});
// mobile sidemenu
$(".main-toggle-btn-mobile").click(function () {
$(".sidebar").addClass("m-sidebar-active");
});
$(".menu-cross").click(function () {
$(".sidebar").removeClass("m-sidebar-active");
});
$(".main-toggle-btn-mobile").click(function () {
$(".body-dark-mobile").addClass("body-dark-mobile-active");
});
$(".menu-cross").click(function () {
$(".body-dark-mobile").removeClass("body-dark-mobile-active");
});
$(".main-toggle-btn-mobile").click(function () {
$("body").addClass("non-scroll-body");
});
$(".menu-cross").click(function () {
$("body").removeClass("non-scroll-body");
});
});
//calendar js
var Cal = function (divId) {
//Store div id
this.divId = divId;
// Days of week, starting on Sunday
this.DaysOfWeek = [
'Sun',
'Mon',
'Tue',
'Wed',
'Thu',
'Fri',
'Sat'
];
// Months, stating on January
this.Months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
// Set the current month, year
var d = new Date();
this.currMonth = d.getMonth();
this.currYear = d.getFullYear();
this.currDay = d.getDate();
};
// Goes to next month
Cal.prototype.nextMonth = function () {
if (this.currMonth == 11) {
this.currMonth = 0;
this.currYear = this.currYear + 1;
} else {
this.currMonth = this.currMonth + 1;
}
this.showcurr();
};
// Goes to previous month
Cal.prototype.previousMonth = function () {
if (this.currMonth == 0) {
this.currMonth = 11;
this.currYear = this.currYear - 1;
} else {
this.currMonth = this.currMonth - 1;
}
this.showcurr();
};
// Show current month
Cal.prototype.showcurr = function () {
this.showMonth(this.currYear, this.currMonth);
};
// Show month (year, month)
Cal.prototype.showMonth = function (y, m) {
var d = new Date()
// First day of the week in the selected month
,
firstDayOfMonth = new Date(y, m, 1).getDay()
// Last day of the selected month
,
lastDateOfMonth = new Date(y, m + 1, 0).getDate()
// Last day of the previous month
,
lastDayOfLastMonth = m == 0 ? new Date(y - 1, 11, 0).getDate() : new Date(y, m, 0).getDate();
var html = '<table>';
// Write selected month and year
html += '<thead><tr>';
html += '<td colspan="7">' + this.Months[m] + ' ' + y + '</td>';
html += '</tr></thead>';
// Write the header of the days of the week
html += '<tr class="days">';
for (var i = 0; i < this.DaysOfWeek.length; i++) {
html += '<td>' + this.DaysOfWeek[i] + '</td>';
}
html += '</tr>';
// Write the days
var i = 1;
do {
var dow = new Date(y, m, i).getDay();
// If Sunday, start new row
if (dow == 0) {
html += '<tr>';
}
// If not Sunday but first day of the month
// it will write the last days from the previous month
else if (i == 1) {
html += '<tr>';
var k = lastDayOfLastMonth - firstDayOfMonth + 1;
for (var j = 0; j < firstDayOfMonth; j++) {
html += '<td class="not-current">' + k + '</td>';
k++;
}
}
// Write the current day in the loop
var chk = new Date();
var chkY = chk.getFullYear();
var chkM = chk.getMonth();
if (chkY == this.currYear && chkM == this.currMonth && i == this.currDay) {
html += '<td class="today">' + i + '</td>';
} else {
html += '<td class="normal">' + i + '</td>';
}
// If Saturday, closes the row
if (dow == 6) {
html += '</tr>';
}
// If not Saturday, but last day of the selected month
// it will write the next few days from the next month
else if (i == lastDateOfMonth) {
var k = 1;
for (dow; dow < 6; dow++) {
html += '<td class="not-current">' + k + '</td>';
k++;
}
}
i++;
} while (i <= lastDateOfMonth);
// Closes table
html += '</table>';
// Write HTML to the div
document.getElementById(this.divId).innerHTML = html;
};
// On Load of the window
window.onload = function () {
// Start calendar
var c = new Cal("divCal");
c.showcurr();
// Bind next and previous button clicks
getId('btnNext').onclick = function () {
c.nextMonth();
};
getId('btnPrev').onclick = function () {
c.previousMonth();
};
}
// Get element by id
function getId(id) {
return document.getElementById(id);
}
//calendar js
//htable right progress js
var skills = {
ht: 90,
cs: 80,
js: 60,
rc: 50,
jq: 60,
lkd: 30,
};
$.each(skills, function (key, value) {
var skillbar = $("." + key);
skillbar.animate({
width: value + "%"
},
3000,
function () {
$(".speech-bubble").fadeIn();
}
);
});
//htable right progress js
//chart js
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["S", "S", "M", "T", "W", "T", "F", "S", "S", "M", "T", "W", "T", "F", ],
datasets: [{
label: 'Visits',
backgroundColor: 'transparent',
borderColor: '#FF6384',
data: [100, 120, 200, 100, 230, 100, 80, 150, 180, 200, 130, 190, 150, 100, ]
},
{
backgroundColor: 'transparent',
borderColor: '#36A2EB',
label: 'New Users',
data: [200, 120, 180, 200, 150, 80, 90, 130, 150, 100, 150, 180, 190, 200, ]
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
var ctx = document.getElementById("myChartTwo");
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["S", "S", "M", "T", "W", "T", "F", "S", "S", "M", "T", "W", "T", "F", ],
datasets: [{
label: 'Visits',
backgroundColor: '#FF6384',
borderColor: '#FF6384',
data: [100, 120, 200, 100, 230, 100, 80, 150, 180, 200, 130, 190, 150, 100, ]
},
{
backgroundColor: '#36A2EB',
borderColor: '#36A2EB',
label: 'New Users',
data: [200, 120, 180, 200, 150, 80, 90, 130, 150, 100, 150, 180, 190, 200, ]
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
var ctx = document.getElementById("myChartThree");
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: ["S", "S", "M", "T", "W", "T", "F", "S", "S", "M", "T", "W", "T", "F", ],
datasets: [{
label: 'Visits',
backgroundColor: '#FF6384',
borderColor: '#FF6384',
data: [100, 120, 200, 100, 230, 100, 80, 150, 180, 200, 130, 190, 150, 100, ]
},
{
backgroundColor: '#36A2EB',
borderColor: '#36A2EB',
label: 'New Users',
data: [200, 120, 180, 200, 150, 80, 90, 130, 150, 100, 150, 180, 190, 200, ]
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
//chart js
| 22.772622 | 141 | 0.468467 |
c6097f2e0454902925541ad3fa2934862f265402 | 1,296 | js | JavaScript | test/unit/pg.ddl/createHistorySchema.js | metarhia/GlobalStorage | c9c40b79d5d47999f85b396d962d8630d75170cd | [
"MIT"
] | 38 | 2016-04-12T06:30:58.000Z | 2017-05-04T18:36:00.000Z | test/unit/pg.ddl/createHistorySchema.js | metarhia/globalstorage | c9c40b79d5d47999f85b396d962d8630d75170cd | [
"MIT"
] | 335 | 2017-05-28T11:46:22.000Z | 2020-08-03T20:26:26.000Z | test/unit/pg.ddl/createHistorySchema.js | metarhia/globalstorage | c9c40b79d5d47999f85b396d962d8630d75170cd | [
"MIT"
] | 7 | 2017-05-31T08:14:58.000Z | 2020-03-11T08:40:28.000Z | 'use strict';
const metatests = require('metatests');
const metaschema = require('metaschema');
const { options, config } = require('../../../lib/metaschema-config/config');
const ddl = require('../../../lib/pg.ddl');
metatests.test('pg.ddl.createHistorySchema unit test', async test => {
let schema;
try {
schema = await metaschema.fs.load('schemas/system', options, config);
} catch (err) {
test.fail(err);
test.end();
return;
}
const dateTime = schema.domains.get('DateTime');
test.strictSame(
ddl.createHistorySchema({}, schema.domains, schema.categories),
{
_Creation: {
domain: 'DateTime',
required: true,
index: true,
definition: dateTime,
},
_Effective: {
domain: 'DateTime',
required: true,
index: true,
definition: dateTime,
},
_Cancel: {
domain: 'DateTime',
index: true,
definition: dateTime,
},
_HistoryStatus: {
domain: 'HistoryStatus',
required: true,
definition: dateTime,
},
_Identifier: {
category: 'Identifier',
required: true,
index: true,
definition: schema.categories.get('Identifier').definition,
},
}
);
test.end();
});
| 23.142857 | 77 | 0.570216 |
c609a8f1b91e5d1815ea8a37a0e739af2b5de88d | 6,651 | js | JavaScript | src/Oro/Bundle/FilterBundle/Resources/public/js/filter/datetime-filter.js | Ludo444/platform | 4bc392b233daa30927e15f12c838ddae13e02c46 | [
"MIT"
] | null | null | null | src/Oro/Bundle/FilterBundle/Resources/public/js/filter/datetime-filter.js | Ludo444/platform | 4bc392b233daa30927e15f12c838ddae13e02c46 | [
"MIT"
] | 1 | 2019-09-13T15:25:15.000Z | 2019-09-13T15:25:15.000Z | src/Oro/Bundle/FilterBundle/Resources/public/js/filter/datetime-filter.js | Ludo444/platform | 4bc392b233daa30927e15f12c838ddae13e02c46 | [
"MIT"
] | 1 | 2019-08-07T09:33:05.000Z | 2019-08-07T09:33:05.000Z | define(function(require) {
'use strict';
var DatetimeFilter;
var _ = require('underscore');
var moment = require('moment');
var __ = require('orotranslation/js/translator');
var datetimeFormatter = require('orolocale/js/formatter/datetime');
var DateTimePickerView = require('oroui/js/app/views/datepicker/datetimepicker-view');
var VariableDateTimePickerView = require('orofilter/js/app/views/datepicker/variable-datetimepicker-view');
var DateFilter = require('./date-filter');
var tools = require('oroui/js/tools');
var config = require('module').config();
config = _.extend({
inputClass: 'datetime-visual-element',
timeInputAttrs: {
'class': 'timepicker-input',
'placeholder': 'oro.form.choose_time'
}
}, config);
config.timeInputAttrs.placeholder = __(config.timeInputAttrs.placeholder);
/**
* Datetime filter: filter type as option + interval begin and end dates
*/
DatetimeFilter = DateFilter.extend({
/**
* CSS class for visual datetime input elements
*
* @property
*/
inputClass: config.inputClass,
/**
* Selectors for filter data
*
* @property
*/
criteriaValueSelectors: {
type: 'select', // to handle both type and part changes
date_type: 'select[name][name!=datetime_part]',
date_part: 'select[name=datetime_part]',
value: {
start: 'input[name="start"]',
end: 'input[name="end"]'
}
},
/**
* Datetime filter uses custom format to backend datetime
*/
backendFormat: 'YYYY-MM-DD HH:mm',
events: {
// timepicker triggers this event on mousedown and hides picker's dropdown
'hideTimepicker input': '_preventClickOutsideCriteria'
},
/**
* @inheritDoc
*/
constructor: function DatetimeFilter() {
DatetimeFilter.__super__.constructor.apply(this, arguments);
},
_getPickerConstructor: function() {
return tools.isMobile() || !this.dateWidgetOptions.showDatevariables
? DateTimePickerView : VariableDateTimePickerView;
},
_renderCriteria: function() {
DatetimeFilter.__super__._renderCriteria.apply(this, arguments);
var value = this.getValue();
if (value) {
this._updateTimeVisibility(value.part);
}
},
/**
* Handle click outside of criteria popup to hide it
*
* @param {Event} e
* @protected
*/
_onClickOutsideCriteria: function(e) {
if (this._justPickedTime) {
this._justPickedTime = false;
} else {
DatetimeFilter.__super__._onClickOutsideCriteria.apply(this, arguments);
}
},
/**
* Turns on flag that time has been just picked,
* to prevent closing the criteria dropdown
*
* @protected
*/
_preventClickOutsideCriteria: function() {
this._justPickedTime = true;
},
/**
* @inheritDoc
*/
_getPickerConfigurationOptions: function(options) {
DatetimeFilter.__super__._getPickerConfigurationOptions.call(this, options);
_.extend(options, {
backendFormat: [datetimeFormatter.getDateTimeFormat(), this.backendFormat],
timezone: 'UTC',
timeInputAttrs: config.timeInputAttrs
});
return options;
},
/**
* Converts the date value from Raw to Display
*
* @param {string} value
* @param {string} part
* @returns {string}
* @protected
*/
_toDisplayValue: function(value, part) {
var momentInstance;
if (this.dateVariableHelper.isDateVariable(value)) {
value = this.dateVariableHelper.formatDisplayValue(value);
} else if (part === 'value' && this.dateValueHelper.isValid(value)) {
value = this.dateValueHelper.formatDisplayValue(value);
} else if (datetimeFormatter.isValueValid(value, this.backendFormat)) {
momentInstance = moment(value, this.backendFormat, true);
value = momentInstance.format(datetimeFormatter.getDateTimeFormat());
}
return value;
},
/**
* Converts the date value from Display to Raw
*
* @param {string} value
* @param {string} part
* @returns {string}
* @protected
*/
_toRawValue: function(value, part) {
var momentInstance;
if (this.dateVariableHelper.isDateVariable(value)) {
value = this.dateVariableHelper.formatRawValue(value);
} else if (part === 'value' && this.dateValueHelper.isValid(value)) {
value = this.dateValueHelper.formatRawValue(value);
} else if (datetimeFormatter.isDateTimeValid(value)) {
momentInstance = moment(value, datetimeFormatter.getDateTimeFormat(), true);
value = momentInstance.format(this.backendFormat);
}
return value;
},
/**
* @inheritDoc
*/
_triggerUpdate: function(newValue, oldValue) {
if (!tools.isEqualsLoosely(newValue, oldValue)) {
this._updateTimeVisibility(newValue.part);
}
DatetimeFilter.__super__._triggerUpdate.apply(this, arguments);
},
_renderSubViews: function() {
DatetimeFilter.__super__._renderSubViews.apply(this, arguments);
var value = this._readDOMValue();
this._updateDateTimePickerSubView('start', value);
this._updateDateTimePickerSubView('end', value);
},
_updateDateTimePickerSubView: function(subViewName, viewValue) {
var subView = this.subview(subViewName);
if (!subView || !subView.updateFront) {
return;
}
subView.updateFront();
},
_updateTimeVisibility: function(part) {
if (part === 'value') {
this.$('.timepicker-input').removeClass('hide');
} else {
this.$('.timepicker-input').addClass('hide');
}
}
});
return DatetimeFilter;
});
| 33.590909 | 111 | 0.559765 |
c609c5afca20978c45642481fd011693d4f255a8 | 1,394 | js | JavaScript | src/commands/parsers/configGetCommand.js | onlfait/smoothie-commands | d15687cd7dd154b55851229b7ab62248dab0580d | [
"MIT"
] | 1 | 2021-02-18T11:52:15.000Z | 2021-02-18T11:52:15.000Z | src/commands/parsers/configGetCommand.js | onlfait/smoothie-commands | d15687cd7dd154b55851229b7ab62248dab0580d | [
"MIT"
] | null | null | null | src/commands/parsers/configGetCommand.js | onlfait/smoothie-commands | d15687cd7dd154b55851229b7ab62248dab0580d | [
"MIT"
] | null | null | null | // https://github.com/Smoothieware/Smoothieware/blob/9e5477518b1c85498a68e81be894faea45d6edca/src/modules/utils/simpleshell/SimpleShell.cpp#L275
// https://github.com/Smoothieware/Smoothieware/blob/0faa088fe1a2207f6c0b99ec7abccfbd1162f730/src/modules/utils/configurator/Configurator.cpp#L30
import InvalidArgumentsError from '../../errors/InvalidArgumentsError.js'
import UndefinedSettingError from '../../errors/UndefinedSettingError.js'
import UnknownResponseError from '../../errors/UnknownResponseError.js'
const command = 'config-get'
const usage = 'config-get [local|sd|cache] <setting>'
const description = 'Get config setting value from the specified source'
function parse ({ args, response }) {
let source = 'cache'
let setting = args[0] || null
if (args.length > 1) {
source = setting
setting = args[1] || null
}
// throw an error if something goes wrong
if (!response.length) {
throw new InvalidArgumentsError(args, usage)
}
if (response.endsWith('is not in config')) {
throw new UndefinedSettingError(`${source}:${setting}`, usage)
}
// parse response
let matches = response.match(/([^:]+): ([^ ]+) is set to (.+)/)
if (!matches) {
throw new UnknownResponseError(usage)
}
// always return data object
return { source, setting, value: matches[3] }
}
export const configGetCommand = {
command,
usage,
description,
parse
}
| 34.85 | 145 | 0.722382 |
c609f8f13dd61f32c77f5cad8bb415cf5753c71d | 235,140 | js | JavaScript | jspm_packages/npm/babylon@6.5.2/index.js | jsdelivrbot/project-cms | 4a203b9b0317443a92fcdc52afe00afacc2a80ad | [
"MIT"
] | null | null | null | jspm_packages/npm/babylon@6.5.2/index.js | jsdelivrbot/project-cms | 4a203b9b0317443a92fcdc52afe00afacc2a80ad | [
"MIT"
] | null | null | null | jspm_packages/npm/babylon@6.5.2/index.js | jsdelivrbot/project-cms | 4a203b9b0317443a92fcdc52afe00afacc2a80ad | [
"MIT"
] | 1 | 2018-12-09T15:14:03.000Z | 2018-12-09T15:14:03.000Z | /* */
"format cjs";
(function(process) {
(function(f) {
if (typeof exports === "object" && typeof module !== "undefined") {
module.exports = f();
} else if (typeof define === "function" && define.amd) {
define([], f);
} else {
var g;
if (typeof window !== "undefined") {
g = window;
} else if (typeof global !== "undefined") {
g = global;
} else if (typeof self !== "undefined") {
g = self;
} else {
g = this;
}
g.babylon = f();
}
})(function() {
var define,
module,
exports;
return (function e(t, n, r) {
function s(o, u) {
if (!n[o]) {
if (!t[o]) {
var a = typeof require == "function" && require;
if (!u && a)
return a(o, !0);
if (i)
return i(o, !0);
var f = new Error("Cannot find module '" + o + "'");
throw f.code = "MODULE_NOT_FOUND", f;
}
var l = n[o] = {exports: {}};
t[o][0].call(l.exports, function(e) {
var n = t[o][1][e];
return s(n ? n : e);
}, l, l.exports, e, t, n, r);
}
return n[o].exports;
}
var i = typeof require == "function" && require;
for (var o = 0; o < r.length; o++)
s(r[o]);
return s;
})({
1: [function(require, module, exports) {
"use strict";
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
exports.__esModule = true;
exports.parse = parse;
var _parser = require('./parser');
var _parser2 = _interopRequireDefault(_parser);
require('./parser/util');
require('./parser/statement');
require('./parser/lval');
require('./parser/expression');
require('./parser/node');
require('./parser/location');
require('./parser/comments');
var _tokenizerTypes = require('./tokenizer/types');
require('./tokenizer');
require('./tokenizer/context');
var _pluginsFlow = require('./plugins/flow');
var _pluginsFlow2 = _interopRequireDefault(_pluginsFlow);
var _pluginsJsx = require('./plugins/jsx');
var _pluginsJsx2 = _interopRequireDefault(_pluginsJsx);
_parser.plugins.flow = _pluginsFlow2["default"];
_parser.plugins.jsx = _pluginsJsx2["default"];
function parse(input, options) {
return new _parser2["default"](options, input).parse();
}
exports.tokTypes = _tokenizerTypes.types;
}, {
"./parser": 5,
"./parser/comments": 3,
"./parser/expression": 4,
"./parser/location": 6,
"./parser/lval": 7,
"./parser/node": 8,
"./parser/statement": 9,
"./parser/util": 10,
"./plugins/flow": 11,
"./plugins/jsx": 12,
"./tokenizer": 15,
"./tokenizer/context": 14,
"./tokenizer/types": 17,
"babel-runtime/helpers/interop-require-default": 26
}],
2: [function(require, module, exports) {
"use strict";
exports.__esModule = true;
exports.getOptions = getOptions;
var defaultOptions = {
sourceType: "script",
allowReturnOutsideFunction: false,
allowImportExportEverywhere: false,
allowSuperOutsideMethod: false,
plugins: [],
strictMode: null
};
exports.defaultOptions = defaultOptions;
function getOptions(opts) {
var options = {};
for (var key in defaultOptions) {
options[key] = opts && key in opts ? opts[key] : defaultOptions[key];
}
return options;
}
}, {}],
3: [function(require, module, exports) {
"use strict";
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
var _index = require('./index');
var _index2 = _interopRequireDefault(_index);
function last(stack) {
return stack[stack.length - 1];
}
var pp = _index2["default"].prototype;
pp.addComment = function(comment) {
this.state.trailingComments.push(comment);
this.state.leadingComments.push(comment);
};
pp.processComment = function(node) {
if (node.type === "Program" && node.body.length > 0)
return;
var stack = this.state.commentStack;
var lastChild = undefined,
trailingComments = undefined,
i = undefined;
if (this.state.trailingComments.length > 0) {
if (this.state.trailingComments[0].start >= node.end) {
trailingComments = this.state.trailingComments;
this.state.trailingComments = [];
} else {
this.state.trailingComments.length = 0;
}
} else {
var lastInStack = last(stack);
if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) {
trailingComments = lastInStack.trailingComments;
lastInStack.trailingComments = null;
}
}
while (stack.length > 0 && last(stack).start >= node.start) {
lastChild = stack.pop();
}
if (lastChild) {
if (lastChild.leadingComments) {
if (lastChild !== node && last(lastChild.leadingComments).end <= node.start) {
node.leadingComments = lastChild.leadingComments;
lastChild.leadingComments = null;
} else {
for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {
if (lastChild.leadingComments[i].end <= node.start) {
node.leadingComments = lastChild.leadingComments.splice(0, i + 1);
break;
}
}
}
}
} else if (this.state.leadingComments.length > 0) {
if (last(this.state.leadingComments).end <= node.start) {
node.leadingComments = this.state.leadingComments;
this.state.leadingComments = [];
} else {
for (i = 0; i < this.state.leadingComments.length; i++) {
if (this.state.leadingComments[i].end > node.start) {
break;
}
}
node.leadingComments = this.state.leadingComments.slice(0, i);
if ((node.leadingComments).length === 0) {
node.leadingComments = null;
}
trailingComments = this.state.leadingComments.slice(i);
if (trailingComments.length === 0) {
trailingComments = null;
}
}
}
if (trailingComments) {
if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) {
node.innerComments = trailingComments;
} else {
node.trailingComments = trailingComments;
}
}
stack.push(node);
};
}, {
"./index": 5,
"babel-runtime/helpers/interop-require-default": 26
}],
4: [function(require, module, exports) {
"use strict";
var _Object$create = require('babel-runtime/core-js/object/create')["default"];
var _getIterator = require('babel-runtime/core-js/get-iterator')["default"];
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
var _tokenizerTypes = require('../tokenizer/types');
var _index = require('./index');
var _index2 = _interopRequireDefault(_index);
var _utilIdentifier = require('../util/identifier');
var pp = _index2["default"].prototype;
pp.checkPropClash = function(prop, propHash) {
if (prop.computed)
return;
var key = prop.key;
var name = undefined;
switch (key.type) {
case "Identifier":
name = key.name;
break;
case "StringLiteral":
case "NumericLiteral":
name = String(key.value);
break;
default:
return;
}
if (name === "__proto__" && prop.kind === "init") {
if (propHash.proto)
this.raise(key.start, "Redefinition of __proto__ property");
propHash.proto = true;
}
};
pp.parseExpression = function(noIn, refShorthandDefaultPos) {
var startPos = this.state.start,
startLoc = this.state.startLoc;
var expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos);
if (this.match(_tokenizerTypes.types.comma)) {
var node = this.startNodeAt(startPos, startLoc);
node.expressions = [expr];
while (this.eat(_tokenizerTypes.types.comma)) {
node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos));
}
this.toReferencedList(node.expressions);
return this.finishNode(node, "SequenceExpression");
}
return expr;
};
pp.parseMaybeAssign = function(noIn, refShorthandDefaultPos, afterLeftParse) {
if (this.match(_tokenizerTypes.types._yield) && this.state.inGenerator) {
return this.parseYield();
}
var failOnShorthandAssign = undefined;
if (refShorthandDefaultPos) {
failOnShorthandAssign = false;
} else {
refShorthandDefaultPos = {start: 0};
failOnShorthandAssign = true;
}
var startPos = this.state.start;
var startLoc = this.state.startLoc;
if (this.match(_tokenizerTypes.types.parenL) || this.match(_tokenizerTypes.types.name)) {
this.state.potentialArrowAt = this.state.start;
}
var left = this.parseMaybeConditional(noIn, refShorthandDefaultPos);
if (afterLeftParse)
left = afterLeftParse.call(this, left, startPos, startLoc);
if (this.state.type.isAssign) {
var node = this.startNodeAt(startPos, startLoc);
node.operator = this.state.value;
node.left = this.match(_tokenizerTypes.types.eq) ? this.toAssignable(left) : left;
refShorthandDefaultPos.start = 0;
this.checkLVal(left);
if (left.extra && left.extra.parenthesized) {
var errorMsg = undefined;
if (left.type === "ObjectPattern") {
errorMsg = "`({a}) = 0` use `({a} = 0)`";
} else if (left.type === "ArrayPattern") {
errorMsg = "`([a]) = 0` use `([a] = 0)`";
}
if (errorMsg) {
this.raise(left.start, "You're trying to assign to a parenthesized expression, eg. instead of " + errorMsg);
}
}
this.next();
node.right = this.parseMaybeAssign(noIn);
return this.finishNode(node, "AssignmentExpression");
} else if (failOnShorthandAssign && refShorthandDefaultPos.start) {
this.unexpected(refShorthandDefaultPos.start);
}
return left;
};
pp.parseMaybeConditional = function(noIn, refShorthandDefaultPos) {
var startPos = this.state.start,
startLoc = this.state.startLoc;
var expr = this.parseExprOps(noIn, refShorthandDefaultPos);
if (refShorthandDefaultPos && refShorthandDefaultPos.start)
return expr;
if (this.eat(_tokenizerTypes.types.question)) {
var node = this.startNodeAt(startPos, startLoc);
node.test = expr;
node.consequent = this.parseMaybeAssign();
this.expect(_tokenizerTypes.types.colon);
node.alternate = this.parseMaybeAssign(noIn);
return this.finishNode(node, "ConditionalExpression");
}
return expr;
};
pp.parseExprOps = function(noIn, refShorthandDefaultPos) {
var startPos = this.state.start,
startLoc = this.state.startLoc;
var expr = this.parseMaybeUnary(refShorthandDefaultPos);
if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
return expr;
} else {
return this.parseExprOp(expr, startPos, startLoc, -1, noIn);
}
};
pp.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {
var prec = this.state.type.binop;
if (prec != null && (!noIn || !this.match(_tokenizerTypes.types._in))) {
if (prec > minPrec) {
var node = this.startNodeAt(leftStartPos, leftStartLoc);
node.left = left;
node.operator = this.state.value;
if (node.operator === "**" && left.type === "UnaryExpression" && left.extra && !left.extra.parenthesizedArgument) {
this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");
}
var op = this.state.type;
this.next();
var startPos = this.state.start;
var startLoc = this.state.startLoc;
node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn);
this.finishNode(node, op === _tokenizerTypes.types.logicalOR || op === _tokenizerTypes.types.logicalAND ? "LogicalExpression" : "BinaryExpression");
return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn);
}
}
return left;
};
pp.parseMaybeUnary = function(refShorthandDefaultPos) {
if (this.state.type.prefix) {
var node = this.startNode();
var update = this.match(_tokenizerTypes.types.incDec);
node.operator = this.state.value;
node.prefix = true;
this.next();
var argType = this.state.type;
this.addExtra(node, "parenthesizedArgument", argType === _tokenizerTypes.types.parenL);
node.argument = this.parseMaybeUnary();
if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
this.unexpected(refShorthandDefaultPos.start);
}
if (update) {
this.checkLVal(node.argument);
} else if (this.state.strict && node.operator === "delete" && node.argument.type === "Identifier") {
this.raise(node.start, "Deleting local variable in strict mode");
}
return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
}
var startPos = this.state.start,
startLoc = this.state.startLoc;
var expr = this.parseExprSubscripts(refShorthandDefaultPos);
if (refShorthandDefaultPos && refShorthandDefaultPos.start)
return expr;
while (this.state.type.postfix && !this.canInsertSemicolon()) {
var node = this.startNodeAt(startPos, startLoc);
node.operator = this.state.value;
node.prefix = false;
node.argument = expr;
this.checkLVal(expr);
this.next();
expr = this.finishNode(node, "UpdateExpression");
}
return expr;
};
pp.parseExprSubscripts = function(refShorthandDefaultPos) {
var startPos = this.state.start,
startLoc = this.state.startLoc;
var potentialArrowAt = this.state.potentialArrowAt;
var expr = this.parseExprAtom(refShorthandDefaultPos);
if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
return expr;
}
if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
return expr;
}
return this.parseSubscripts(expr, startPos, startLoc);
};
pp.parseSubscripts = function(base, startPos, startLoc, noCalls) {
for (; ; ) {
if (!noCalls && this.eat(_tokenizerTypes.types.doubleColon)) {
var node = this.startNodeAt(startPos, startLoc);
node.object = base;
node.callee = this.parseNoCallExpr();
return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls);
} else if (this.eat(_tokenizerTypes.types.dot)) {
var node = this.startNodeAt(startPos, startLoc);
node.object = base;
node.property = this.parseIdentifier(true);
node.computed = false;
base = this.finishNode(node, "MemberExpression");
} else if (this.eat(_tokenizerTypes.types.bracketL)) {
var node = this.startNodeAt(startPos, startLoc);
node.object = base;
node.property = this.parseExpression();
node.computed = true;
this.expect(_tokenizerTypes.types.bracketR);
base = this.finishNode(node, "MemberExpression");
} else if (!noCalls && this.match(_tokenizerTypes.types.parenL)) {
var possibleAsync = this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon();
this.next();
var node = this.startNodeAt(startPos, startLoc);
node.callee = base;
node.arguments = this.parseCallExpressionArguments(_tokenizerTypes.types.parenR, this.hasPlugin("trailingFunctionCommas"), possibleAsync);
base = this.finishNode(node, "CallExpression");
if (possibleAsync && this.shouldParseAsyncArrow()) {
return this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node);
} else {
this.toReferencedList(node.arguments);
}
} else if (this.match(_tokenizerTypes.types.backQuote)) {
var node = this.startNodeAt(startPos, startLoc);
node.tag = base;
node.quasi = this.parseTemplate();
base = this.finishNode(node, "TaggedTemplateExpression");
} else {
return base;
}
}
};
pp.parseCallExpressionArguments = function(close, allowTrailingComma, possibleAsyncArrow) {
var innerParenStart = undefined;
var elts = [],
first = true;
while (!this.eat(close)) {
if (first) {
first = false;
} else {
this.expect(_tokenizerTypes.types.comma);
if (allowTrailingComma && this.eat(close))
break;
}
if (this.match(_tokenizerTypes.types.parenL) && !innerParenStart) {
innerParenStart = this.state.start;
}
elts.push(this.parseExprListItem());
}
if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) {
this.unexpected();
}
return elts;
};
pp.shouldParseAsyncArrow = function() {
return this.match(_tokenizerTypes.types.arrow);
};
pp.parseAsyncArrowFromCallExpression = function(node, call) {
if (!this.hasPlugin("asyncFunctions"))
this.unexpected();
this.expect(_tokenizerTypes.types.arrow);
return this.parseArrowExpression(node, call.arguments, true);
};
pp.parseNoCallExpr = function() {
var startPos = this.state.start,
startLoc = this.state.startLoc;
return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
};
pp.parseExprAtom = function(refShorthandDefaultPos) {
var node = undefined,
canBeArrow = this.state.potentialArrowAt === this.state.start;
switch (this.state.type) {
case _tokenizerTypes.types._super:
if (!this.state.inMethod && !this.options.allowSuperOutsideMethod) {
this.raise(this.state.start, "'super' outside of function or class");
}
node = this.startNode();
this.next();
if (!this.match(_tokenizerTypes.types.parenL) && !this.match(_tokenizerTypes.types.bracketL) && !this.match(_tokenizerTypes.types.dot)) {
this.unexpected();
}
if (this.match(_tokenizerTypes.types.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) {
this.raise(node.start, "super() outside of class constructor");
}
return this.finishNode(node, "Super");
case _tokenizerTypes.types._this:
node = this.startNode();
this.next();
return this.finishNode(node, "ThisExpression");
case _tokenizerTypes.types._yield:
if (this.state.inGenerator)
this.unexpected();
case _tokenizerTypes.types.name:
node = this.startNode();
var allowAwait = this.hasPlugin("asyncFunctions") && this.state.value === "await" && this.state.inAsync;
var allowYield = this.shouldAllowYieldIdentifier();
var id = this.parseIdentifier(allowAwait || allowYield);
if (this.hasPlugin("asyncFunctions")) {
if (id.name === "await") {
if (this.state.inAsync || this.inModule) {
return this.parseAwait(node);
}
} else if (id.name === "async" && this.match(_tokenizerTypes.types._function) && !this.canInsertSemicolon()) {
this.next();
return this.parseFunction(node, false, false, true);
} else if (canBeArrow && id.name === "async" && this.match(_tokenizerTypes.types.name)) {
var params = [this.parseIdentifier()];
this.expect(_tokenizerTypes.types.arrow);
return this.parseArrowExpression(node, params, true);
}
}
if (canBeArrow && !this.canInsertSemicolon() && this.eat(_tokenizerTypes.types.arrow)) {
return this.parseArrowExpression(node, [id]);
}
return id;
case _tokenizerTypes.types._do:
if (this.hasPlugin("doExpressions")) {
var _node = this.startNode();
this.next();
var oldInFunction = this.state.inFunction;
var oldLabels = this.state.labels;
this.state.labels = [];
this.state.inFunction = false;
_node.body = this.parseBlock(false, true);
this.state.inFunction = oldInFunction;
this.state.labels = oldLabels;
return this.finishNode(_node, "DoExpression");
}
case _tokenizerTypes.types.regexp:
var value = this.state.value;
node = this.parseLiteral(value.value, "RegExpLiteral");
node.pattern = value.pattern;
node.flags = value.flags;
return node;
case _tokenizerTypes.types.num:
return this.parseLiteral(this.state.value, "NumericLiteral");
case _tokenizerTypes.types.string:
return this.parseLiteral(this.state.value, "StringLiteral");
case _tokenizerTypes.types._null:
node = this.startNode();
this.next();
return this.finishNode(node, "NullLiteral");
case _tokenizerTypes.types._true:
case _tokenizerTypes.types._false:
node = this.startNode();
node.value = this.match(_tokenizerTypes.types._true);
this.next();
return this.finishNode(node, "BooleanLiteral");
case _tokenizerTypes.types.parenL:
return this.parseParenAndDistinguishExpression(null, null, canBeArrow);
case _tokenizerTypes.types.bracketL:
node = this.startNode();
this.next();
node.elements = this.parseExprList(_tokenizerTypes.types.bracketR, true, true, refShorthandDefaultPos);
this.toReferencedList(node.elements);
return this.finishNode(node, "ArrayExpression");
case _tokenizerTypes.types.braceL:
return this.parseObj(false, refShorthandDefaultPos);
case _tokenizerTypes.types._function:
return this.parseFunctionExpression();
case _tokenizerTypes.types.at:
this.parseDecorators();
case _tokenizerTypes.types._class:
node = this.startNode();
this.takeDecorators(node);
return this.parseClass(node, false);
case _tokenizerTypes.types._new:
return this.parseNew();
case _tokenizerTypes.types.backQuote:
return this.parseTemplate();
case _tokenizerTypes.types.doubleColon:
node = this.startNode();
this.next();
node.object = null;
var callee = node.callee = this.parseNoCallExpr();
if (callee.type === "MemberExpression") {
return this.finishNode(node, "BindExpression");
} else {
this.raise(callee.start, "Binding should be performed on object property.");
}
default:
this.unexpected();
}
};
pp.parseFunctionExpression = function() {
var node = this.startNode();
var meta = this.parseIdentifier(true);
if (this.state.inGenerator && this.eat(_tokenizerTypes.types.dot) && this.hasPlugin("functionSent")) {
return this.parseMetaProperty(node, meta, "sent");
} else {
return this.parseFunction(node, false);
}
};
pp.parseMetaProperty = function(node, meta, propertyName) {
node.meta = meta;
node.property = this.parseIdentifier(true);
if (node.property.name !== propertyName) {
this.raise(node.property.start, "The only valid meta property for new is " + meta.name + "." + propertyName);
}
return this.finishNode(node, "MetaProperty");
};
pp.parseLiteral = function(value, type) {
var node = this.startNode();
this.addExtra(node, "rawValue", value);
this.addExtra(node, "raw", this.input.slice(this.state.start, this.state.end));
node.value = value;
this.next();
return this.finishNode(node, type);
};
pp.parseParenExpression = function() {
this.expect(_tokenizerTypes.types.parenL);
var val = this.parseExpression();
this.expect(_tokenizerTypes.types.parenR);
return val;
};
pp.parseParenAndDistinguishExpression = function(startPos, startLoc, canBeArrow, isAsync, allowOptionalCommaStart) {
startPos = startPos || this.state.start;
startLoc = startLoc || this.state.startLoc;
var val = undefined;
this.next();
var innerStartPos = this.state.start,
innerStartLoc = this.state.startLoc;
var exprList = [],
first = true;
var refShorthandDefaultPos = {start: 0},
spreadStart = undefined,
optionalCommaStart = undefined;
while (!this.match(_tokenizerTypes.types.parenR)) {
if (first) {
first = false;
} else {
this.expect(_tokenizerTypes.types.comma);
if (this.match(_tokenizerTypes.types.parenR) && this.hasPlugin("trailingFunctionCommas")) {
optionalCommaStart = this.state.start;
break;
}
}
if (this.match(_tokenizerTypes.types.ellipsis)) {
var spreadNodeStartPos = this.state.start,
spreadNodeStartLoc = this.state.startLoc;
spreadStart = this.state.start;
exprList.push(this.parseParenItem(this.parseRest(), spreadNodeStartLoc, spreadNodeStartPos));
break;
} else {
exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem));
}
}
var innerEndPos = this.state.start;
var innerEndLoc = this.state.startLoc;
this.expect(_tokenizerTypes.types.parenR);
if (canBeArrow && !this.canInsertSemicolon() && this.eat(_tokenizerTypes.types.arrow)) {
for (var _i = 0; _i < exprList.length; _i++) {
var param = exprList[_i];
if (param.extra && param.extra.parenthesized)
this.unexpected(param.extra.parenStart);
}
return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, isAsync);
}
if (!exprList.length) {
if (isAsync) {
return;
} else {
this.unexpected(this.state.lastTokStart);
}
}
if (optionalCommaStart && !allowOptionalCommaStart)
this.unexpected(optionalCommaStart);
if (spreadStart)
this.unexpected(spreadStart);
if (refShorthandDefaultPos.start)
this.unexpected(refShorthandDefaultPos.start);
if (exprList.length > 1) {
val = this.startNodeAt(innerStartPos, innerStartLoc);
val.expressions = exprList;
this.toReferencedList(val.expressions);
this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
} else {
val = exprList[0];
}
this.addExtra(val, "parenthesized", true);
this.addExtra(val, "parenStart", startPos);
return val;
};
pp.parseParenItem = function(node) {
return node;
};
pp.parseNew = function() {
var node = this.startNode();
var meta = this.parseIdentifier(true);
if (this.eat(_tokenizerTypes.types.dot)) {
return this.parseMetaProperty(node, meta, "target");
}
node.callee = this.parseNoCallExpr();
if (this.eat(_tokenizerTypes.types.parenL)) {
node.arguments = this.parseExprList(_tokenizerTypes.types.parenR, this.hasPlugin("trailingFunctionCommas"));
this.toReferencedList(node.arguments);
} else {
node.arguments = [];
}
return this.finishNode(node, "NewExpression");
};
pp.parseTemplateElement = function() {
var elem = this.startNode();
elem.value = {
raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"),
cooked: this.state.value
};
this.next();
elem.tail = this.match(_tokenizerTypes.types.backQuote);
return this.finishNode(elem, "TemplateElement");
};
pp.parseTemplate = function() {
var node = this.startNode();
this.next();
node.expressions = [];
var curElt = this.parseTemplateElement();
node.quasis = [curElt];
while (!curElt.tail) {
this.expect(_tokenizerTypes.types.dollarBraceL);
node.expressions.push(this.parseExpression());
this.expect(_tokenizerTypes.types.braceR);
node.quasis.push(curElt = this.parseTemplateElement());
}
this.next();
return this.finishNode(node, "TemplateLiteral");
};
pp.parseObj = function(isPattern, refShorthandDefaultPos) {
var decorators = [];
var propHash = _Object$create(null);
var first = true;
var node = this.startNode();
node.properties = [];
this.next();
while (!this.eat(_tokenizerTypes.types.braceR)) {
if (first) {
first = false;
} else {
this.expect(_tokenizerTypes.types.comma);
if (this.eat(_tokenizerTypes.types.braceR))
break;
}
while (this.match(_tokenizerTypes.types.at)) {
decorators.push(this.parseDecorator());
}
var prop = this.startNode(),
isGenerator = false,
isAsync = false,
startPos = undefined,
startLoc = undefined;
if (decorators.length) {
prop.decorators = decorators;
decorators = [];
}
if (this.hasPlugin("objectRestSpread") && this.match(_tokenizerTypes.types.ellipsis)) {
prop = this.parseSpread();
prop.type = isPattern ? "RestProperty" : "SpreadProperty";
node.properties.push(prop);
continue;
}
prop.method = false;
prop.shorthand = false;
if (isPattern || refShorthandDefaultPos) {
startPos = this.state.start;
startLoc = this.state.startLoc;
}
if (!isPattern) {
isGenerator = this.eat(_tokenizerTypes.types.star);
}
if (!isPattern && this.hasPlugin("asyncFunctions") && this.isContextual("async")) {
if (isGenerator)
this.unexpected();
var asyncId = this.parseIdentifier();
if (this.match(_tokenizerTypes.types.colon) || this.match(_tokenizerTypes.types.parenL) || this.match(_tokenizerTypes.types.braceR)) {
prop.key = asyncId;
} else {
isAsync = true;
if (this.hasPlugin("asyncGenerators"))
isGenerator = this.eat(_tokenizerTypes.types.star);
this.parsePropertyName(prop);
}
} else {
this.parsePropertyName(prop);
}
this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos);
this.checkPropClash(prop, propHash);
if (prop.shorthand) {
this.addExtra(prop, "shorthand", true);
}
node.properties.push(prop);
}
if (decorators.length) {
this.raise(this.state.start, "You have trailing decorators with no property");
}
return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression");
};
pp.parseObjPropValue = function(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) {
if (isAsync || isGenerator || this.match(_tokenizerTypes.types.parenL)) {
if (isPattern)
this.unexpected();
prop.kind = "method";
prop.method = true;
this.parseMethod(prop, isGenerator, isAsync);
return this.finishNode(prop, "ObjectMethod");
}
if (this.eat(_tokenizerTypes.types.colon)) {
prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos);
return this.finishNode(prop, "ObjectProperty");
}
if (!prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && !this.match(_tokenizerTypes.types.comma) && !this.match(_tokenizerTypes.types.braceR)) {
if (isGenerator || isAsync || isPattern)
this.unexpected();
prop.kind = prop.key.name;
this.parsePropertyName(prop);
this.parseMethod(prop, false);
var paramCount = prop.kind === "get" ? 0 : 1;
if (prop.params.length !== paramCount) {
var start = prop.start;
if (prop.kind === "get") {
this.raise(start, "getter should have no params");
} else {
this.raise(start, "setter should have exactly one param");
}
}
return this.finishNode(prop, "ObjectMethod");
}
if (!prop.computed && prop.key.type === "Identifier") {
if (isPattern) {
var illegalBinding = this.isKeyword(prop.key.name);
if (!illegalBinding && this.state.strict) {
illegalBinding = _utilIdentifier.reservedWords.strictBind(prop.key.name) || _utilIdentifier.reservedWords.strict(prop.key.name);
}
if (illegalBinding) {
this.raise(prop.key.start, "Binding " + prop.key.name);
}
prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
} else if (this.match(_tokenizerTypes.types.eq) && refShorthandDefaultPos) {
if (!refShorthandDefaultPos.start) {
refShorthandDefaultPos.start = this.state.start;
}
prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
} else {
prop.value = prop.key.__clone();
}
prop.shorthand = true;
return this.finishNode(prop, "ObjectProperty");
}
this.unexpected();
};
pp.parsePropertyName = function(prop) {
if (this.eat(_tokenizerTypes.types.bracketL)) {
prop.computed = true;
prop.key = this.parseMaybeAssign();
this.expect(_tokenizerTypes.types.bracketR);
return prop.key;
} else {
prop.computed = false;
return prop.key = this.match(_tokenizerTypes.types.num) || this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
}
};
pp.initFunction = function(node, isAsync) {
node.id = null;
node.generator = false;
node.expression = false;
if (this.hasPlugin("asyncFunctions")) {
node.async = !!isAsync;
}
};
pp.parseMethod = function(node, isGenerator, isAsync) {
var oldInMethod = this.state.inMethod;
this.state.inMethod = node.kind || true;
this.initFunction(node, isAsync);
this.expect(_tokenizerTypes.types.parenL);
node.params = this.parseBindingList(_tokenizerTypes.types.parenR, false, this.hasPlugin("trailingFunctionCommas"));
node.generator = isGenerator;
this.parseFunctionBody(node);
this.state.inMethod = oldInMethod;
return node;
};
pp.parseArrowExpression = function(node, params, isAsync) {
this.initFunction(node, isAsync);
node.params = this.toAssignableList(params, true);
this.parseFunctionBody(node, true);
return this.finishNode(node, "ArrowFunctionExpression");
};
pp.parseFunctionBody = function(node, allowExpression) {
var isExpression = allowExpression && !this.match(_tokenizerTypes.types.braceL);
var oldInAsync = this.state.inAsync;
this.state.inAsync = node.async;
if (isExpression) {
node.body = this.parseMaybeAssign();
node.expression = true;
} else {
var oldInFunc = this.state.inFunction,
oldInGen = this.state.inGenerator,
oldLabels = this.state.labels;
this.state.inFunction = true;
this.state.inGenerator = node.generator;
this.state.labels = [];
node.body = this.parseBlock(true);
node.expression = false;
this.state.inFunction = oldInFunc;
this.state.inGenerator = oldInGen;
this.state.labels = oldLabels;
}
this.state.inAsync = oldInAsync;
var checkLVal = this.state.strict;
var checkLValStrict = false;
var isStrict = false;
if (allowExpression)
checkLVal = true;
if (!isExpression && node.body.directives.length) {
for (var _iterator = (node.body.directives),
_isArray = Array.isArray(_iterator),
_i2 = 0,
_iterator = _isArray ? _iterator : _getIterator(_iterator); ; ) {
var _ref;
if (_isArray) {
if (_i2 >= _iterator.length)
break;
_ref = _iterator[_i2++];
} else {
_i2 = _iterator.next();
if (_i2.done)
break;
_ref = _i2.value;
}
var directive = _ref;
if (directive.value.value === "use strict") {
isStrict = true;
checkLVal = true;
checkLValStrict = true;
break;
}
}
}
if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") {
this.raise(node.id.start, "Binding yield in strict mode");
}
if (checkLVal) {
var nameHash = _Object$create(null);
var oldStrict = this.state.strict;
if (checkLValStrict)
this.state.strict = true;
if (node.id) {
this.checkLVal(node.id, true);
}
for (var _iterator2 = (node.params),
_isArray2 = Array.isArray(_iterator2),
_i3 = 0,
_iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2); ; ) {
var _ref2;
if (_isArray2) {
if (_i3 >= _iterator2.length)
break;
_ref2 = _iterator2[_i3++];
} else {
_i3 = _iterator2.next();
if (_i3.done)
break;
_ref2 = _i3.value;
}
var param = _ref2;
this.checkLVal(param, true, nameHash);
}
this.state.strict = oldStrict;
}
};
pp.parseExprList = function(close, allowTrailingComma, allowEmpty, refShorthandDefaultPos) {
var elts = [],
first = true;
while (!this.eat(close)) {
if (first) {
first = false;
} else {
this.expect(_tokenizerTypes.types.comma);
if (allowTrailingComma && this.eat(close))
break;
}
elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos));
}
return elts;
};
pp.parseExprListItem = function(allowEmpty, refShorthandDefaultPos) {
var elt = undefined;
if (allowEmpty && this.match(_tokenizerTypes.types.comma)) {
elt = null;
} else if (this.match(_tokenizerTypes.types.ellipsis)) {
elt = this.parseSpread(refShorthandDefaultPos);
} else {
elt = this.parseMaybeAssign(false, refShorthandDefaultPos);
}
return elt;
};
pp.parseIdentifier = function(liberal) {
var node = this.startNode();
if (this.match(_tokenizerTypes.types.name)) {
if (!liberal && this.state.strict && _utilIdentifier.reservedWords.strict(this.state.value)) {
this.raise(this.state.start, "The keyword '" + this.state.value + "' is reserved");
}
node.name = this.state.value;
} else if (liberal && this.state.type.keyword) {
node.name = this.state.type.keyword;
} else {
this.unexpected();
}
if (!liberal && node.name === "await" && this.state.inAsync) {
this.raise(node.start, "invalid use of await inside of an async function");
}
this.next();
return this.finishNode(node, "Identifier");
};
pp.parseAwait = function(node) {
if (!this.state.inAsync) {
this.unexpected();
}
if (this.isLineTerminator()) {
this.unexpected();
}
if (this.match(_tokenizerTypes.types.star)) {
this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead.");
}
node.argument = this.parseMaybeUnary();
return this.finishNode(node, "AwaitExpression");
};
pp.parseYield = function() {
var node = this.startNode();
this.next();
if (this.match(_tokenizerTypes.types.semi) || this.canInsertSemicolon() || !this.match(_tokenizerTypes.types.star) && !this.state.type.startsExpr) {
node.delegate = false;
node.argument = null;
} else {
node.delegate = this.eat(_tokenizerTypes.types.star);
node.argument = this.parseMaybeAssign();
}
return this.finishNode(node, "YieldExpression");
};
}, {
"../tokenizer/types": 17,
"../util/identifier": 18,
"./index": 5,
"babel-runtime/core-js/get-iterator": 21,
"babel-runtime/core-js/object/create": 22,
"babel-runtime/helpers/interop-require-default": 26
}],
5: [function(require, module, exports) {
"use strict";
var _inherits = require('babel-runtime/helpers/inherits')["default"];
var _classCallCheck = require('babel-runtime/helpers/class-call-check')["default"];
var _getIterator = require('babel-runtime/core-js/get-iterator')["default"];
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
exports.__esModule = true;
var _utilIdentifier = require('../util/identifier');
var _options = require('../options');
var _tokenizer = require('../tokenizer');
var _tokenizer2 = _interopRequireDefault(_tokenizer);
var plugins = {};
exports.plugins = plugins;
var Parser = (function(_Tokenizer) {
_inherits(Parser, _Tokenizer);
function Parser(options, input) {
_classCallCheck(this, Parser);
options = _options.getOptions(options);
_Tokenizer.call(this, options, input);
this.options = options;
this.inModule = this.options.sourceType === "module";
this.isReservedWord = _utilIdentifier.reservedWords[6];
this.input = input;
this.plugins = this.loadPlugins(this.options.plugins);
if (this.state.pos === 0 && this.input[0] === "#" && this.input[1] === "!") {
this.skipLineComment(2);
}
}
Parser.prototype.hasPlugin = function hasPlugin(name) {
return !!(this.plugins["*"] || this.plugins[name]);
};
Parser.prototype.extend = function extend(name, f) {
this[name] = f(this[name]);
};
Parser.prototype.loadPlugins = function loadPlugins(plugins) {
var pluginMap = {};
if (plugins.indexOf("flow") >= 0) {
plugins = plugins.filter(function(plugin) {
return plugin !== "flow";
});
plugins.push("flow");
}
for (var _iterator = plugins,
_isArray = Array.isArray(_iterator),
_i = 0,
_iterator = _isArray ? _iterator : _getIterator(_iterator); ; ) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length)
break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done)
break;
_ref = _i.value;
}
var _name = _ref;
if (!pluginMap[_name]) {
pluginMap[_name] = true;
var plugin = exports.plugins[_name];
if (plugin)
plugin(this);
}
}
return pluginMap;
};
Parser.prototype.parse = function parse() {
var file = this.startNode();
var program = this.startNode();
this.nextToken();
return this.parseTopLevel(file, program);
};
return Parser;
})(_tokenizer2["default"]);
exports["default"] = Parser;
}, {
"../options": 2,
"../tokenizer": 15,
"../util/identifier": 18,
"babel-runtime/core-js/get-iterator": 21,
"babel-runtime/helpers/class-call-check": 24,
"babel-runtime/helpers/inherits": 25,
"babel-runtime/helpers/interop-require-default": 26
}],
6: [function(require, module, exports) {
"use strict";
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
var _utilLocation = require('../util/location');
var _index = require('./index');
var _index2 = _interopRequireDefault(_index);
var pp = _index2["default"].prototype;
pp.raise = function(pos, message) {
var loc = _utilLocation.getLineInfo(this.input, pos);
message += " (" + loc.line + ":" + loc.column + ")";
var err = new SyntaxError(message);
err.pos = pos;
err.loc = loc;
throw err;
};
}, {
"../util/location": 19,
"./index": 5,
"babel-runtime/helpers/interop-require-default": 26
}],
7: [function(require, module, exports) {
"use strict";
var _getIterator = require('babel-runtime/core-js/get-iterator')["default"];
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
var _tokenizerTypes = require('../tokenizer/types');
var _index = require('./index');
var _index2 = _interopRequireDefault(_index);
var _utilIdentifier = require('../util/identifier');
var pp = _index2["default"].prototype;
pp.toAssignable = function(node, isBinding) {
if (node) {
switch (node.type) {
case "Identifier":
case "ObjectPattern":
case "ArrayPattern":
case "AssignmentPattern":
break;
case "ObjectExpression":
node.type = "ObjectPattern";
for (var _iterator = (node.properties),
_isArray = Array.isArray(_iterator),
_i = 0,
_iterator = _isArray ? _iterator : _getIterator(_iterator); ; ) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length)
break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done)
break;
_ref = _i.value;
}
var prop = _ref;
if (prop.type === "ObjectMethod") {
if (prop.kind === "get" || prop.kind === "set") {
this.raise(prop.key.start, "Object pattern can't contain getter or setter");
} else {
this.raise(prop.key.start, "Object pattern can't contain methods");
}
} else {
this.toAssignable(prop, isBinding);
}
}
break;
case "ObjectProperty":
this.toAssignable(node.value, isBinding);
break;
case "SpreadProperty":
node.type = "RestProperty";
break;
case "ArrayExpression":
node.type = "ArrayPattern";
this.toAssignableList(node.elements, isBinding);
break;
case "AssignmentExpression":
if (node.operator === "=") {
node.type = "AssignmentPattern";
delete node.operator;
} else {
this.raise(node.left.end, "Only '=' operator can be used for specifying default value.");
}
break;
case "MemberExpression":
if (!isBinding)
break;
default:
this.raise(node.start, "Assigning to rvalue");
}
}
return node;
};
pp.toAssignableList = function(exprList, isBinding) {
var end = exprList.length;
if (end) {
var last = exprList[end - 1];
if (last && last.type === "RestElement") {
--end;
} else if (last && last.type === "SpreadElement") {
last.type = "RestElement";
var arg = last.argument;
this.toAssignable(arg, isBinding);
if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") {
this.unexpected(arg.start);
}
--end;
}
}
for (var i = 0; i < end; i++) {
var elt = exprList[i];
if (elt)
this.toAssignable(elt, isBinding);
}
return exprList;
};
pp.toReferencedList = function(exprList) {
return exprList;
};
pp.parseSpread = function(refShorthandDefaultPos) {
var node = this.startNode();
this.next();
node.argument = this.parseMaybeAssign(refShorthandDefaultPos);
return this.finishNode(node, "SpreadElement");
};
pp.parseRest = function() {
var node = this.startNode();
this.next();
node.argument = this.parseBindingIdentifier();
return this.finishNode(node, "RestElement");
};
pp.shouldAllowYieldIdentifier = function() {
return this.match(_tokenizerTypes.types._yield) && !this.state.strict && !this.state.inGenerator;
};
pp.parseBindingIdentifier = function() {
return this.parseIdentifier(this.shouldAllowYieldIdentifier());
};
pp.parseBindingAtom = function() {
switch (this.state.type) {
case _tokenizerTypes.types._yield:
if (this.state.strict || this.state.inGenerator)
this.unexpected();
case _tokenizerTypes.types.name:
return this.parseIdentifier(true);
case _tokenizerTypes.types.bracketL:
var node = this.startNode();
this.next();
node.elements = this.parseBindingList(_tokenizerTypes.types.bracketR, true, true);
return this.finishNode(node, "ArrayPattern");
case _tokenizerTypes.types.braceL:
return this.parseObj(true);
default:
this.unexpected();
}
};
pp.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
var elts = [];
var first = true;
while (!this.eat(close)) {
if (first) {
first = false;
} else {
this.expect(_tokenizerTypes.types.comma);
}
if (allowEmpty && this.match(_tokenizerTypes.types.comma)) {
elts.push(null);
} else if (allowTrailingComma && this.eat(close)) {
break;
} else if (this.match(_tokenizerTypes.types.ellipsis)) {
elts.push(this.parseAssignableListItemTypes(this.parseRest()));
this.expect(close);
break;
} else {
var left = this.parseMaybeDefault();
this.parseAssignableListItemTypes(left);
elts.push(this.parseMaybeDefault(null, null, left));
}
}
return elts;
};
pp.parseAssignableListItemTypes = function(param) {
return param;
};
pp.parseMaybeDefault = function(startPos, startLoc, left) {
startLoc = startLoc || this.state.startLoc;
startPos = startPos || this.state.start;
left = left || this.parseBindingAtom();
if (!this.eat(_tokenizerTypes.types.eq))
return left;
var node = this.startNodeAt(startPos, startLoc);
node.left = left;
node.right = this.parseMaybeAssign();
return this.finishNode(node, "AssignmentPattern");
};
pp.checkLVal = function(expr, isBinding, checkClashes) {
switch (expr.type) {
case "Identifier":
if (this.state.strict && (_utilIdentifier.reservedWords.strictBind(expr.name) || _utilIdentifier.reservedWords.strict(expr.name))) {
this.raise(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode");
}
if (checkClashes) {
var key = "_" + expr.name;
if (checkClashes[key]) {
this.raise(expr.start, "Argument name clash in strict mode");
} else {
checkClashes[key] = true;
}
}
break;
case "MemberExpression":
if (isBinding)
this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression");
break;
case "ObjectPattern":
for (var _iterator2 = (expr.properties),
_isArray2 = Array.isArray(_iterator2),
_i2 = 0,
_iterator2 = _isArray2 ? _iterator2 : _getIterator(_iterator2); ; ) {
var _ref2;
if (_isArray2) {
if (_i2 >= _iterator2.length)
break;
_ref2 = _iterator2[_i2++];
} else {
_i2 = _iterator2.next();
if (_i2.done)
break;
_ref2 = _i2.value;
}
var prop = _ref2;
if (prop.type === "ObjectProperty")
prop = prop.value;
this.checkLVal(prop, isBinding, checkClashes);
}
break;
case "ArrayPattern":
for (var _iterator3 = (expr.elements),
_isArray3 = Array.isArray(_iterator3),
_i3 = 0,
_iterator3 = _isArray3 ? _iterator3 : _getIterator(_iterator3); ; ) {
var _ref3;
if (_isArray3) {
if (_i3 >= _iterator3.length)
break;
_ref3 = _iterator3[_i3++];
} else {
_i3 = _iterator3.next();
if (_i3.done)
break;
_ref3 = _i3.value;
}
var elem = _ref3;
if (elem)
this.checkLVal(elem, isBinding, checkClashes);
}
break;
case "AssignmentPattern":
this.checkLVal(expr.left, isBinding, checkClashes);
break;
case "RestProperty":
case "RestElement":
this.checkLVal(expr.argument, isBinding, checkClashes);
break;
default:
this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " rvalue");
}
};
}, {
"../tokenizer/types": 17,
"../util/identifier": 18,
"./index": 5,
"babel-runtime/core-js/get-iterator": 21,
"babel-runtime/helpers/interop-require-default": 26
}],
8: [function(require, module, exports) {
"use strict";
var _classCallCheck = require('babel-runtime/helpers/class-call-check')["default"];
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
var _index = require('./index');
var _index2 = _interopRequireDefault(_index);
var _utilLocation = require('../util/location');
var pp = _index2["default"].prototype;
var Node = (function() {
function Node(pos, loc) {
_classCallCheck(this, Node);
this.type = "";
this.start = pos;
this.end = 0;
this.loc = new _utilLocation.SourceLocation(loc);
}
Node.prototype.__clone = function __clone() {
var node2 = new Node();
for (var key in this) {
node2[key] = this[key];
}
return node2;
};
return Node;
})();
pp.startNode = function() {
return new Node(this.state.start, this.state.startLoc);
};
pp.startNodeAt = function(pos, loc) {
return new Node(pos, loc);
};
function finishNodeAt(node, type, pos, loc) {
node.type = type;
node.end = pos;
node.loc.end = loc;
this.processComment(node);
return node;
}
pp.finishNode = function(node, type) {
return finishNodeAt.call(this, node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);
};
pp.finishNodeAt = function(node, type, pos, loc) {
return finishNodeAt.call(this, node, type, pos, loc);
};
}, {
"../util/location": 19,
"./index": 5,
"babel-runtime/helpers/class-call-check": 24,
"babel-runtime/helpers/interop-require-default": 26
}],
9: [function(require, module, exports) {
"use strict";
var _Object$create = require('babel-runtime/core-js/object/create')["default"];
var _getIterator = require('babel-runtime/core-js/get-iterator')["default"];
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
var _tokenizerTypes = require('../tokenizer/types');
var _index = require('./index');
var _index2 = _interopRequireDefault(_index);
var _utilWhitespace = require('../util/whitespace');
var pp = _index2["default"].prototype;
pp.parseTopLevel = function(file, program) {
program.sourceType = this.options.sourceType;
this.parseBlockBody(program, true, true, _tokenizerTypes.types.eof);
file.program = this.finishNode(program, "Program");
file.comments = this.state.comments;
file.tokens = this.state.tokens;
return this.finishNode(file, "File");
};
var loopLabel = {kind: "loop"},
switchLabel = {kind: "switch"};
pp.stmtToDirective = function(stmt) {
var expr = stmt.expression;
var directiveLiteral = this.startNodeAt(expr.start, expr.loc.start);
var directive = this.startNodeAt(stmt.start, stmt.loc.start);
var raw = this.input.slice(expr.start, expr.end);
var val = directiveLiteral.value = raw.slice(1, -1);
this.addExtra(directiveLiteral, "raw", raw);
this.addExtra(directiveLiteral, "rawValue", val);
directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end);
return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end);
};
pp.parseStatement = function(declaration, topLevel) {
if (this.match(_tokenizerTypes.types.at)) {
this.parseDecorators(true);
}
var starttype = this.state.type,
node = this.startNode();
switch (starttype) {
case _tokenizerTypes.types._break:
case _tokenizerTypes.types._continue:
return this.parseBreakContinueStatement(node, starttype.keyword);
case _tokenizerTypes.types._debugger:
return this.parseDebuggerStatement(node);
case _tokenizerTypes.types._do:
return this.parseDoStatement(node);
case _tokenizerTypes.types._for:
return this.parseForStatement(node);
case _tokenizerTypes.types._function:
if (!declaration)
this.unexpected();
return this.parseFunctionStatement(node);
case _tokenizerTypes.types._class:
if (!declaration)
this.unexpected();
this.takeDecorators(node);
return this.parseClass(node, true);
case _tokenizerTypes.types._if:
return this.parseIfStatement(node);
case _tokenizerTypes.types._return:
return this.parseReturnStatement(node);
case _tokenizerTypes.types._switch:
return this.parseSwitchStatement(node);
case _tokenizerTypes.types._throw:
return this.parseThrowStatement(node);
case _tokenizerTypes.types._try:
return this.parseTryStatement(node);
case _tokenizerTypes.types._let:
case _tokenizerTypes.types._const:
if (!declaration)
this.unexpected();
case _tokenizerTypes.types._var:
return this.parseVarStatement(node, starttype);
case _tokenizerTypes.types._while:
return this.parseWhileStatement(node);
case _tokenizerTypes.types._with:
return this.parseWithStatement(node);
case _tokenizerTypes.types.braceL:
return this.parseBlock();
case _tokenizerTypes.types.semi:
return this.parseEmptyStatement(node);
case _tokenizerTypes.types._export:
case _tokenizerTypes.types._import:
if (!this.options.allowImportExportEverywhere) {
if (!topLevel) {
this.raise(this.state.start, "'import' and 'export' may only appear at the top level");
}
if (!this.inModule) {
this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'");
}
}
return starttype === _tokenizerTypes.types._import ? this.parseImport(node) : this.parseExport(node);
case _tokenizerTypes.types.name:
if (this.hasPlugin("asyncFunctions") && this.state.value === "async") {
var state = this.state.clone();
this.next();
if (this.match(_tokenizerTypes.types._function) && !this.canInsertSemicolon()) {
this.expect(_tokenizerTypes.types._function);
return this.parseFunction(node, true, false, true);
} else {
this.state = state;
}
}
}
var maybeName = this.state.value;
var expr = this.parseExpression();
if (starttype === _tokenizerTypes.types.name && expr.type === "Identifier" && this.eat(_tokenizerTypes.types.colon)) {
return this.parseLabeledStatement(node, maybeName, expr);
} else {
return this.parseExpressionStatement(node, expr);
}
};
pp.takeDecorators = function(node) {
if (this.state.decorators.length) {
node.decorators = this.state.decorators;
this.state.decorators = [];
}
};
pp.parseDecorators = function(allowExport) {
while (this.match(_tokenizerTypes.types.at)) {
this.state.decorators.push(this.parseDecorator());
}
if (allowExport && this.match(_tokenizerTypes.types._export)) {
return;
}
if (!this.match(_tokenizerTypes.types._class)) {
this.raise(this.state.start, "Leading decorators must be attached to a class declaration");
}
};
pp.parseDecorator = function() {
if (!this.hasPlugin("decorators")) {
this.unexpected();
}
var node = this.startNode();
this.next();
node.expression = this.parseMaybeAssign();
return this.finishNode(node, "Decorator");
};
pp.parseBreakContinueStatement = function(node, keyword) {
var isBreak = keyword === "break";
this.next();
if (this.isLineTerminator()) {
node.label = null;
} else if (!this.match(_tokenizerTypes.types.name)) {
this.unexpected();
} else {
node.label = this.parseIdentifier();
this.semicolon();
}
var i = undefined;
for (i = 0; i < this.state.labels.length; ++i) {
var lab = this.state.labels[i];
if (node.label == null || lab.name === node.label.name) {
if (lab.kind != null && (isBreak || lab.kind === "loop"))
break;
if (node.label && isBreak)
break;
}
}
if (i === this.state.labels.length)
this.raise(node.start, "Unsyntactic " + keyword);
return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
};
pp.parseDebuggerStatement = function(node) {
this.next();
this.semicolon();
return this.finishNode(node, "DebuggerStatement");
};
pp.parseDoStatement = function(node) {
this.next();
this.state.labels.push(loopLabel);
node.body = this.parseStatement(false);
this.state.labels.pop();
this.expect(_tokenizerTypes.types._while);
node.test = this.parseParenExpression();
this.eat(_tokenizerTypes.types.semi);
return this.finishNode(node, "DoWhileStatement");
};
pp.parseForStatement = function(node) {
this.next();
this.state.labels.push(loopLabel);
this.expect(_tokenizerTypes.types.parenL);
if (this.match(_tokenizerTypes.types.semi)) {
return this.parseFor(node, null);
}
if (this.match(_tokenizerTypes.types._var) || this.match(_tokenizerTypes.types._let) || this.match(_tokenizerTypes.types._const)) {
var _init = this.startNode(),
varKind = this.state.type;
this.next();
this.parseVar(_init, true, varKind);
this.finishNode(_init, "VariableDeclaration");
if (this.match(_tokenizerTypes.types._in) || this.isContextual("of")) {
if (_init.declarations.length === 1 && !_init.declarations[0].init) {
return this.parseForIn(node, _init);
}
}
return this.parseFor(node, _init);
}
var refShorthandDefaultPos = {start: 0};
var init = this.parseExpression(true, refShorthandDefaultPos);
if (this.match(_tokenizerTypes.types._in) || this.isContextual("of")) {
this.toAssignable(init);
this.checkLVal(init);
return this.parseForIn(node, init);
} else if (refShorthandDefaultPos.start) {
this.unexpected(refShorthandDefaultPos.start);
}
return this.parseFor(node, init);
};
pp.parseFunctionStatement = function(node) {
this.next();
return this.parseFunction(node, true);
};
pp.parseIfStatement = function(node) {
this.next();
node.test = this.parseParenExpression();
node.consequent = this.parseStatement(false);
node.alternate = this.eat(_tokenizerTypes.types._else) ? this.parseStatement(false) : null;
return this.finishNode(node, "IfStatement");
};
pp.parseReturnStatement = function(node) {
if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) {
this.raise(this.state.start, "'return' outside of function");
}
this.next();
if (this.isLineTerminator()) {
node.argument = null;
} else {
node.argument = this.parseExpression();
this.semicolon();
}
return this.finishNode(node, "ReturnStatement");
};
pp.parseSwitchStatement = function(node) {
this.next();
node.discriminant = this.parseParenExpression();
node.cases = [];
this.expect(_tokenizerTypes.types.braceL);
this.state.labels.push(switchLabel);
var cur = undefined;
for (var sawDefault = undefined; !this.match(_tokenizerTypes.types.braceR); ) {
if (this.match(_tokenizerTypes.types._case) || this.match(_tokenizerTypes.types._default)) {
var isCase = this.match(_tokenizerTypes.types._case);
if (cur)
this.finishNode(cur, "SwitchCase");
node.cases.push(cur = this.startNode());
cur.consequent = [];
this.next();
if (isCase) {
cur.test = this.parseExpression();
} else {
if (sawDefault)
this.raise(this.state.lastTokStart, "Multiple default clauses");
sawDefault = true;
cur.test = null;
}
this.expect(_tokenizerTypes.types.colon);
} else {
if (cur) {
cur.consequent.push(this.parseStatement(true));
} else {
this.unexpected();
}
}
}
if (cur)
this.finishNode(cur, "SwitchCase");
this.next();
this.state.labels.pop();
return this.finishNode(node, "SwitchStatement");
};
pp.parseThrowStatement = function(node) {
this.next();
if (_utilWhitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)))
this.raise(this.state.lastTokEnd, "Illegal newline after throw");
node.argument = this.parseExpression();
this.semicolon();
return this.finishNode(node, "ThrowStatement");
};
var empty = [];
pp.parseTryStatement = function(node) {
this.next();
node.block = this.parseBlock();
node.handler = null;
if (this.match(_tokenizerTypes.types._catch)) {
var clause = this.startNode();
this.next();
this.expect(_tokenizerTypes.types.parenL);
clause.param = this.parseBindingAtom();
this.checkLVal(clause.param, true, _Object$create(null));
this.expect(_tokenizerTypes.types.parenR);
clause.body = this.parseBlock();
node.handler = this.finishNode(clause, "CatchClause");
}
node.guardedHandlers = empty;
node.finalizer = this.eat(_tokenizerTypes.types._finally) ? this.parseBlock() : null;
if (!node.handler && !node.finalizer) {
this.raise(node.start, "Missing catch or finally clause");
}
return this.finishNode(node, "TryStatement");
};
pp.parseVarStatement = function(node, kind) {
this.next();
this.parseVar(node, false, kind);
this.semicolon();
return this.finishNode(node, "VariableDeclaration");
};
pp.parseWhileStatement = function(node) {
this.next();
node.test = this.parseParenExpression();
this.state.labels.push(loopLabel);
node.body = this.parseStatement(false);
this.state.labels.pop();
return this.finishNode(node, "WhileStatement");
};
pp.parseWithStatement = function(node) {
if (this.state.strict)
this.raise(this.state.start, "'with' in strict mode");
this.next();
node.object = this.parseParenExpression();
node.body = this.parseStatement(false);
return this.finishNode(node, "WithStatement");
};
pp.parseEmptyStatement = function(node) {
this.next();
return this.finishNode(node, "EmptyStatement");
};
pp.parseLabeledStatement = function(node, maybeName, expr) {
for (var _iterator = (this.state.labels),
_isArray = Array.isArray(_iterator),
_i = 0,
_iterator = _isArray ? _iterator : _getIterator(_iterator); ; ) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length)
break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done)
break;
_ref = _i.value;
}
var label = _ref;
if (label.name === maybeName) {
this.raise(expr.start, "Label '" + maybeName + "' is already declared");
}
}
var kind = this.state.type.isLoop ? "loop" : this.match(_tokenizerTypes.types._switch) ? "switch" : null;
for (var i = this.state.labels.length - 1; i >= 0; i--) {
var label = this.state.labels[i];
if (label.statementStart === node.start) {
label.statementStart = this.state.start;
label.kind = kind;
} else {
break;
}
}
this.state.labels.push({
name: maybeName,
kind: kind,
statementStart: this.state.start
});
node.body = this.parseStatement(true);
this.state.labels.pop();
node.label = expr;
return this.finishNode(node, "LabeledStatement");
};
pp.parseExpressionStatement = function(node, expr) {
node.expression = expr;
this.semicolon();
return this.finishNode(node, "ExpressionStatement");
};
pp.parseBlock = function(allowDirectives) {
var node = this.startNode();
this.expect(_tokenizerTypes.types.braceL);
this.parseBlockBody(node, allowDirectives, false, _tokenizerTypes.types.braceR);
return this.finishNode(node, "BlockStatement");
};
pp.parseBlockBody = function(node, allowDirectives, topLevel, end) {
node.body = [];
node.directives = [];
var parsedNonDirective = false;
var oldStrict = undefined;
var octalPosition = undefined;
while (!this.eat(end)) {
if (!parsedNonDirective && this.state.containsOctal && !octalPosition) {
octalPosition = this.state.octalPosition;
}
var stmt = this.parseStatement(true, topLevel);
if (allowDirectives && !parsedNonDirective && stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized) {
var directive = this.stmtToDirective(stmt);
node.directives.push(directive);
if (oldStrict === undefined && directive.value.value === "use strict") {
oldStrict = this.state.strict;
this.setStrict(true);
if (octalPosition) {
this.raise(octalPosition, "Octal literal in strict mode");
}
}
continue;
}
parsedNonDirective = true;
node.body.push(stmt);
}
if (oldStrict === false) {
this.setStrict(false);
}
};
pp.parseFor = function(node, init) {
node.init = init;
this.expect(_tokenizerTypes.types.semi);
node.test = this.match(_tokenizerTypes.types.semi) ? null : this.parseExpression();
this.expect(_tokenizerTypes.types.semi);
node.update = this.match(_tokenizerTypes.types.parenR) ? null : this.parseExpression();
this.expect(_tokenizerTypes.types.parenR);
node.body = this.parseStatement(false);
this.state.labels.pop();
return this.finishNode(node, "ForStatement");
};
pp.parseForIn = function(node, init) {
var type = this.match(_tokenizerTypes.types._in) ? "ForInStatement" : "ForOfStatement";
this.next();
node.left = init;
node.right = this.parseExpression();
this.expect(_tokenizerTypes.types.parenR);
node.body = this.parseStatement(false);
this.state.labels.pop();
return this.finishNode(node, type);
};
pp.parseVar = function(node, isFor, kind) {
node.declarations = [];
node.kind = kind.keyword;
for (; ; ) {
var decl = this.startNode();
this.parseVarHead(decl);
if (this.eat(_tokenizerTypes.types.eq)) {
decl.init = this.parseMaybeAssign(isFor);
} else if (kind === _tokenizerTypes.types._const && !(this.match(_tokenizerTypes.types._in) || this.isContextual("of"))) {
this.unexpected();
} else if (decl.id.type !== "Identifier" && !(isFor && (this.match(_tokenizerTypes.types._in) || this.isContextual("of")))) {
this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value");
} else {
decl.init = null;
}
node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
if (!this.eat(_tokenizerTypes.types.comma))
break;
}
return node;
};
pp.parseVarHead = function(decl) {
decl.id = this.parseBindingAtom();
this.checkLVal(decl.id, true);
};
pp.parseFunction = function(node, isStatement, allowExpressionBody, isAsync, optionalId) {
var oldInMethod = this.state.inMethod;
this.state.inMethod = false;
this.initFunction(node, isAsync);
if (this.match(_tokenizerTypes.types.star)) {
if (node.async && !this.hasPlugin("asyncGenerators")) {
this.unexpected();
} else {
node.generator = true;
this.next();
}
}
if (isStatement && !optionalId && !this.match(_tokenizerTypes.types.name) && !this.match(_tokenizerTypes.types._yield)) {
this.unexpected();
}
if (this.match(_tokenizerTypes.types.name) || this.match(_tokenizerTypes.types._yield)) {
node.id = this.parseBindingIdentifier();
}
this.parseFunctionParams(node);
this.parseFunctionBody(node, allowExpressionBody);
this.state.inMethod = oldInMethod;
return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
};
pp.parseFunctionParams = function(node) {
this.expect(_tokenizerTypes.types.parenL);
node.params = this.parseBindingList(_tokenizerTypes.types.parenR, false, this.hasPlugin("trailingFunctionCommas"));
};
pp.parseClass = function(node, isStatement, optionalId) {
this.next();
this.parseClassId(node, isStatement, optionalId);
this.parseClassSuper(node);
this.parseClassBody(node);
return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
};
pp.isClassProperty = function() {
return this.match(_tokenizerTypes.types.eq) || this.isLineTerminator();
};
pp.parseClassBody = function(node) {
var oldStrict = this.state.strict;
this.state.strict = true;
var hadConstructorCall = false;
var hadConstructor = false;
var decorators = [];
var classBody = this.startNode();
classBody.body = [];
this.expect(_tokenizerTypes.types.braceL);
while (!this.eat(_tokenizerTypes.types.braceR)) {
if (this.eat(_tokenizerTypes.types.semi)) {
continue;
}
if (this.match(_tokenizerTypes.types.at)) {
decorators.push(this.parseDecorator());
continue;
}
var method = this.startNode();
if (decorators.length) {
method.decorators = decorators;
decorators = [];
}
var isConstructorCall = false;
var isMaybeStatic = this.match(_tokenizerTypes.types.name) && this.state.value === "static";
var isGenerator = this.eat(_tokenizerTypes.types.star);
var isGetSet = false;
var isAsync = false;
this.parsePropertyName(method);
method["static"] = isMaybeStatic && !this.match(_tokenizerTypes.types.parenL);
if (method["static"]) {
if (isGenerator)
this.unexpected();
isGenerator = this.eat(_tokenizerTypes.types.star);
this.parsePropertyName(method);
}
if (!isGenerator && method.key.type === "Identifier" && !method.computed) {
if (this.isClassProperty()) {
classBody.body.push(this.parseClassProperty(method));
continue;
}
if (this.hasPlugin("classConstructorCall") && method.key.name === "call" && this.match(_tokenizerTypes.types.name) && this.state.value === "constructor") {
isConstructorCall = true;
this.parsePropertyName(method);
}
}
var isAsyncMethod = this.hasPlugin("asyncFunctions") && !this.match(_tokenizerTypes.types.parenL) && !method.computed && method.key.type === "Identifier" && method.key.name === "async";
if (isAsyncMethod) {
if (this.hasPlugin("asyncGenerators") && this.eat(_tokenizerTypes.types.star))
isGenerator = true;
isAsync = true;
this.parsePropertyName(method);
}
method.kind = "method";
if (!method.computed) {
var key = method.key;
if (!isAsync && !isGenerator && key.type === "Identifier" && !this.match(_tokenizerTypes.types.parenL) && (key.name === "get" || key.name === "set")) {
isGetSet = true;
method.kind = key.name;
key = this.parsePropertyName(method);
}
var isConstructor = !isConstructorCall && !method["static"] && (key.type === "Identifier" && key.name === "constructor" || key.type === "StringLiteral" && key.value === "constructor");
if (isConstructor) {
if (hadConstructor)
this.raise(key.start, "Duplicate constructor in the same class");
if (isGetSet)
this.raise(key.start, "Constructor can't have get/set modifier");
if (isGenerator)
this.raise(key.start, "Constructor can't be a generator");
if (isAsync)
this.raise(key.start, "Constructor can't be an async function");
method.kind = "constructor";
hadConstructor = true;
}
var isStaticPrototype = method["static"] && (key.type === "Identifier" && key.name === "prototype" || key.type === "StringLiteral" && key.value === "prototype");
if (isStaticPrototype) {
this.raise(key.start, "Classes may not have static property named prototype");
}
}
if (isConstructorCall) {
if (hadConstructorCall)
this.raise(method.start, "Duplicate constructor call in the same class");
method.kind = "constructorCall";
hadConstructorCall = true;
}
if ((method.kind === "constructor" || method.kind === "constructorCall") && method.decorators) {
this.raise(method.start, "You can't attach decorators to a class constructor");
}
this.parseClassMethod(classBody, method, isGenerator, isAsync);
if (isGetSet) {
var paramCount = method.kind === "get" ? 0 : 1;
if (method.params.length !== paramCount) {
var start = method.start;
if (method.kind === "get") {
this.raise(start, "getter should have no params");
} else {
this.raise(start, "setter should have exactly one param");
}
}
}
}
if (decorators.length) {
this.raise(this.state.start, "You have trailing decorators with no method");
}
node.body = this.finishNode(classBody, "ClassBody");
this.state.strict = oldStrict;
};
pp.parseClassProperty = function(node) {
if (this.match(_tokenizerTypes.types.eq)) {
if (!this.hasPlugin("classProperties"))
this.unexpected();
this.next();
node.value = this.parseMaybeAssign();
} else {
node.value = null;
}
this.semicolon();
return this.finishNode(node, "ClassProperty");
};
pp.parseClassMethod = function(classBody, method, isGenerator, isAsync) {
this.parseMethod(method, isGenerator, isAsync);
classBody.body.push(this.finishNode(method, "ClassMethod"));
};
pp.parseClassId = function(node, isStatement, optionalId) {
if (this.match(_tokenizerTypes.types.name)) {
node.id = this.parseIdentifier();
} else {
if (optionalId || !isStatement) {
node.id = null;
} else {
this.unexpected();
}
}
};
pp.parseClassSuper = function(node) {
node.superClass = this.eat(_tokenizerTypes.types._extends) ? this.parseExprSubscripts() : null;
};
pp.parseExport = function(node) {
this.next();
if (this.match(_tokenizerTypes.types.star)) {
var specifier = this.startNode();
this.next();
if (this.hasPlugin("exportExtensions") && this.eatContextual("as")) {
specifier.exported = this.parseIdentifier();
node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")];
this.parseExportSpecifiersMaybe(node);
this.parseExportFrom(node, true);
} else {
this.parseExportFrom(node, true);
return this.finishNode(node, "ExportAllDeclaration");
}
} else if (this.hasPlugin("exportExtensions") && this.isExportDefaultSpecifier()) {
var specifier = this.startNode();
specifier.exported = this.parseIdentifier(true);
node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
if (this.match(_tokenizerTypes.types.comma) && this.lookahead().type === _tokenizerTypes.types.star) {
this.expect(_tokenizerTypes.types.comma);
var _specifier = this.startNode();
this.expect(_tokenizerTypes.types.star);
this.expectContextual("as");
_specifier.exported = this.parseIdentifier();
node.specifiers.push(this.finishNode(_specifier, "ExportNamespaceSpecifier"));
} else {
this.parseExportSpecifiersMaybe(node);
}
this.parseExportFrom(node, true);
} else if (this.eat(_tokenizerTypes.types._default)) {
var expr = this.startNode();
var needsSemi = false;
if (this.eat(_tokenizerTypes.types._function)) {
expr = this.parseFunction(expr, true, false, false, true);
} else if (this.match(_tokenizerTypes.types._class)) {
expr = this.parseClass(expr, true, true);
} else {
needsSemi = true;
expr = this.parseMaybeAssign();
}
node.declaration = expr;
if (needsSemi)
this.semicolon();
this.checkExport(node);
return this.finishNode(node, "ExportDefaultDeclaration");
} else if (this.state.type.keyword || this.shouldParseExportDeclaration()) {
node.specifiers = [];
node.source = null;
node.declaration = this.parseExportDeclaration(node);
} else {
node.declaration = null;
node.specifiers = this.parseExportSpecifiers();
this.parseExportFrom(node);
}
this.checkExport(node);
return this.finishNode(node, "ExportNamedDeclaration");
};
pp.parseExportDeclaration = function() {
return this.parseStatement(true);
};
pp.isExportDefaultSpecifier = function() {
if (this.match(_tokenizerTypes.types.name)) {
return this.state.value !== "type" && this.state.value !== "async" && this.state.value !== "interface";
}
if (!this.match(_tokenizerTypes.types._default)) {
return false;
}
var lookahead = this.lookahead();
return lookahead.type === _tokenizerTypes.types.comma || lookahead.type === _tokenizerTypes.types.name && lookahead.value === "from";
};
pp.parseExportSpecifiersMaybe = function(node) {
if (this.eat(_tokenizerTypes.types.comma)) {
node.specifiers = node.specifiers.concat(this.parseExportSpecifiers());
}
};
pp.parseExportFrom = function(node, expect) {
if (this.eatContextual("from")) {
node.source = this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.unexpected();
this.checkExport(node);
} else {
if (expect) {
this.unexpected();
} else {
node.source = null;
}
}
this.semicolon();
};
pp.shouldParseExportDeclaration = function() {
return this.hasPlugin("asyncFunctions") && this.isContextual("async");
};
pp.checkExport = function(node) {
if (this.state.decorators.length) {
var isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression");
if (!node.declaration || !isClass) {
this.raise(node.start, "You can only use decorators on an export when exporting a class");
}
this.takeDecorators(node.declaration);
}
};
pp.parseExportSpecifiers = function() {
var nodes = [];
var first = true;
var needsFrom = undefined;
this.expect(_tokenizerTypes.types.braceL);
while (!this.eat(_tokenizerTypes.types.braceR)) {
if (first) {
first = false;
} else {
this.expect(_tokenizerTypes.types.comma);
if (this.eat(_tokenizerTypes.types.braceR))
break;
}
var isDefault = this.match(_tokenizerTypes.types._default);
if (isDefault && !needsFrom)
needsFrom = true;
var node = this.startNode();
node.local = this.parseIdentifier(isDefault);
node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone();
nodes.push(this.finishNode(node, "ExportSpecifier"));
}
if (needsFrom && !this.isContextual("from")) {
this.unexpected();
}
return nodes;
};
pp.parseImport = function(node) {
this.next();
if (this.match(_tokenizerTypes.types.string)) {
node.specifiers = [];
node.source = this.parseExprAtom();
} else {
node.specifiers = [];
this.parseImportSpecifiers(node);
this.expectContextual("from");
node.source = this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.unexpected();
}
this.semicolon();
return this.finishNode(node, "ImportDeclaration");
};
pp.parseImportSpecifiers = function(node) {
var first = true;
if (this.match(_tokenizerTypes.types.name)) {
var startPos = this.state.start,
startLoc = this.state.startLoc;
node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(), startPos, startLoc));
if (!this.eat(_tokenizerTypes.types.comma))
return;
}
if (this.match(_tokenizerTypes.types.star)) {
var specifier = this.startNode();
this.next();
this.expectContextual("as");
specifier.local = this.parseIdentifier();
this.checkLVal(specifier.local, true);
node.specifiers.push(this.finishNode(specifier, "ImportNamespaceSpecifier"));
return;
}
this.expect(_tokenizerTypes.types.braceL);
while (!this.eat(_tokenizerTypes.types.braceR)) {
if (first) {
first = false;
} else {
this.expect(_tokenizerTypes.types.comma);
if (this.eat(_tokenizerTypes.types.braceR))
break;
}
var specifier = this.startNode();
specifier.imported = this.parseIdentifier(true);
specifier.local = this.eatContextual("as") ? this.parseIdentifier() : specifier.imported.__clone();
this.checkLVal(specifier.local, true);
node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
}
};
pp.parseImportSpecifierDefault = function(id, startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
node.local = id;
this.checkLVal(node.local, true);
return this.finishNode(node, "ImportDefaultSpecifier");
};
}, {
"../tokenizer/types": 17,
"../util/whitespace": 20,
"./index": 5,
"babel-runtime/core-js/get-iterator": 21,
"babel-runtime/core-js/object/create": 22,
"babel-runtime/helpers/interop-require-default": 26
}],
10: [function(require, module, exports) {
"use strict";
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
var _tokenizerTypes = require('../tokenizer/types');
var _index = require('./index');
var _index2 = _interopRequireDefault(_index);
var _utilWhitespace = require('../util/whitespace');
var pp = _index2["default"].prototype;
pp.addExtra = function(node, key, val) {
if (!node)
return;
var extra = node.extra = node.extra || {};
extra[key] = val;
};
pp.isRelational = function(op) {
return this.match(_tokenizerTypes.types.relational) && this.state.value === op;
};
pp.expectRelational = function(op) {
if (this.isRelational(op)) {
this.next();
} else {
this.unexpected();
}
};
pp.isContextual = function(name) {
return this.match(_tokenizerTypes.types.name) && this.state.value === name;
};
pp.eatContextual = function(name) {
return this.state.value === name && this.eat(_tokenizerTypes.types.name);
};
pp.expectContextual = function(name) {
if (!this.eatContextual(name))
this.unexpected();
};
pp.canInsertSemicolon = function() {
return this.match(_tokenizerTypes.types.eof) || this.match(_tokenizerTypes.types.braceR) || _utilWhitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
};
pp.isLineTerminator = function() {
return this.eat(_tokenizerTypes.types.semi) || this.canInsertSemicolon();
};
pp.semicolon = function() {
if (!this.isLineTerminator())
this.unexpected();
};
pp.expect = function(type) {
return this.eat(type) || this.unexpected();
};
pp.unexpected = function(pos) {
this.raise(pos != null ? pos : this.state.start, "Unexpected token");
};
}, {
"../tokenizer/types": 17,
"../util/whitespace": 20,
"./index": 5,
"babel-runtime/helpers/interop-require-default": 26
}],
11: [function(require, module, exports) {
"use strict";
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
exports.__esModule = true;
var _tokenizerTypes = require('../tokenizer/types');
var _parser = require('../parser');
var _parser2 = _interopRequireDefault(_parser);
var pp = _parser2["default"].prototype;
pp.flowParseTypeInitialiser = function(tok, allowLeadingPipeOrAnd) {
var oldInType = this.state.inType;
this.state.inType = true;
this.expect(tok || _tokenizerTypes.types.colon);
if (allowLeadingPipeOrAnd) {
if (this.match(_tokenizerTypes.types.bitwiseAND) || this.match(_tokenizerTypes.types.bitwiseOR)) {
this.next();
}
}
var type = this.flowParseType();
this.state.inType = oldInType;
return type;
};
pp.flowParseDeclareClass = function(node) {
this.next();
this.flowParseInterfaceish(node, true);
return this.finishNode(node, "DeclareClass");
};
pp.flowParseDeclareFunction = function(node) {
this.next();
var id = node.id = this.parseIdentifier();
var typeNode = this.startNode();
var typeContainer = this.startNode();
if (this.isRelational("<")) {
typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
} else {
typeNode.typeParameters = null;
}
this.expect(_tokenizerTypes.types.parenL);
var tmp = this.flowParseFunctionTypeParams();
typeNode.params = tmp.params;
typeNode.rest = tmp.rest;
this.expect(_tokenizerTypes.types.parenR);
typeNode.returnType = this.flowParseTypeInitialiser();
typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
this.finishNode(id, id.type);
this.semicolon();
return this.finishNode(node, "DeclareFunction");
};
pp.flowParseDeclare = function(node) {
if (this.match(_tokenizerTypes.types._class)) {
return this.flowParseDeclareClass(node);
} else if (this.match(_tokenizerTypes.types._function)) {
return this.flowParseDeclareFunction(node);
} else if (this.match(_tokenizerTypes.types._var)) {
return this.flowParseDeclareVariable(node);
} else if (this.isContextual("module")) {
return this.flowParseDeclareModule(node);
} else if (this.isContextual("type")) {
return this.flowParseDeclareTypeAlias(node);
} else if (this.isContextual("interface")) {
return this.flowParseDeclareInterface(node);
} else {
this.unexpected();
}
};
pp.flowParseDeclareVariable = function(node) {
this.next();
node.id = this.flowParseTypeAnnotatableIdentifier();
this.semicolon();
return this.finishNode(node, "DeclareVariable");
};
pp.flowParseDeclareModule = function(node) {
this.next();
if (this.match(_tokenizerTypes.types.string)) {
node.id = this.parseExprAtom();
} else {
node.id = this.parseIdentifier();
}
var bodyNode = node.body = this.startNode();
var body = bodyNode.body = [];
this.expect(_tokenizerTypes.types.braceL);
while (!this.match(_tokenizerTypes.types.braceR)) {
var node2 = this.startNode();
this.next();
body.push(this.flowParseDeclare(node2));
}
this.expect(_tokenizerTypes.types.braceR);
this.finishNode(bodyNode, "BlockStatement");
return this.finishNode(node, "DeclareModule");
};
pp.flowParseDeclareTypeAlias = function(node) {
this.next();
this.flowParseTypeAlias(node);
return this.finishNode(node, "DeclareTypeAlias");
};
pp.flowParseDeclareInterface = function(node) {
this.next();
this.flowParseInterfaceish(node);
return this.finishNode(node, "DeclareInterface");
};
pp.flowParseInterfaceish = function(node, allowStatic) {
node.id = this.parseIdentifier();
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
} else {
node.typeParameters = null;
}
node["extends"] = [];
node.mixins = [];
if (this.eat(_tokenizerTypes.types._extends)) {
do {
node["extends"].push(this.flowParseInterfaceExtends());
} while (this.eat(_tokenizerTypes.types.comma));
}
if (this.isContextual("mixins")) {
this.next();
do {
node.mixins.push(this.flowParseInterfaceExtends());
} while (this.eat(_tokenizerTypes.types.comma));
}
node.body = this.flowParseObjectType(allowStatic);
};
pp.flowParseInterfaceExtends = function() {
var node = this.startNode();
node.id = this.parseIdentifier();
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterInstantiation();
} else {
node.typeParameters = null;
}
return this.finishNode(node, "InterfaceExtends");
};
pp.flowParseInterface = function(node) {
this.flowParseInterfaceish(node, false);
return this.finishNode(node, "InterfaceDeclaration");
};
pp.flowParseTypeAlias = function(node) {
node.id = this.parseIdentifier();
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
} else {
node.typeParameters = null;
}
node.right = this.flowParseTypeInitialiser(_tokenizerTypes.types.eq, true);
this.semicolon();
return this.finishNode(node, "TypeAlias");
};
pp.flowParseTypeParameterDeclaration = function() {
var node = this.startNode();
node.params = [];
this.expectRelational("<");
while (!this.isRelational(">")) {
node.params.push(this.flowParseExistentialTypeParam() || this.flowParseTypeAnnotatableIdentifier());
if (!this.isRelational(">")) {
this.expect(_tokenizerTypes.types.comma);
}
}
this.expectRelational(">");
return this.finishNode(node, "TypeParameterDeclaration");
};
pp.flowParseExistentialTypeParam = function() {
if (this.match(_tokenizerTypes.types.star)) {
var node = this.startNode();
this.next();
return this.finishNode(node, "ExistentialTypeParam");
}
};
pp.flowParseTypeParameterInstantiation = function() {
var node = this.startNode(),
oldInType = this.state.inType;
node.params = [];
this.state.inType = true;
this.expectRelational("<");
while (!this.isRelational(">")) {
node.params.push(this.flowParseExistentialTypeParam() || this.flowParseType());
if (!this.isRelational(">")) {
this.expect(_tokenizerTypes.types.comma);
}
}
this.expectRelational(">");
this.state.inType = oldInType;
return this.finishNode(node, "TypeParameterInstantiation");
};
pp.flowParseObjectPropertyKey = function() {
return this.match(_tokenizerTypes.types.num) || this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
};
pp.flowParseObjectTypeIndexer = function(node, isStatic) {
node["static"] = isStatic;
this.expect(_tokenizerTypes.types.bracketL);
node.id = this.flowParseObjectPropertyKey();
node.key = this.flowParseTypeInitialiser();
this.expect(_tokenizerTypes.types.bracketR);
node.value = this.flowParseTypeInitialiser();
this.flowObjectTypeSemicolon();
return this.finishNode(node, "ObjectTypeIndexer");
};
pp.flowParseObjectTypeMethodish = function(node) {
node.params = [];
node.rest = null;
node.typeParameters = null;
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
}
this.expect(_tokenizerTypes.types.parenL);
while (this.match(_tokenizerTypes.types.name)) {
node.params.push(this.flowParseFunctionTypeParam());
if (!this.match(_tokenizerTypes.types.parenR)) {
this.expect(_tokenizerTypes.types.comma);
}
}
if (this.eat(_tokenizerTypes.types.ellipsis)) {
node.rest = this.flowParseFunctionTypeParam();
}
this.expect(_tokenizerTypes.types.parenR);
node.returnType = this.flowParseTypeInitialiser();
return this.finishNode(node, "FunctionTypeAnnotation");
};
pp.flowParseObjectTypeMethod = function(startPos, startLoc, isStatic, key) {
var node = this.startNodeAt(startPos, startLoc);
node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(startPos, startLoc));
node["static"] = isStatic;
node.key = key;
node.optional = false;
this.flowObjectTypeSemicolon();
return this.finishNode(node, "ObjectTypeProperty");
};
pp.flowParseObjectTypeCallProperty = function(node, isStatic) {
var valueNode = this.startNode();
node["static"] = isStatic;
node.value = this.flowParseObjectTypeMethodish(valueNode);
this.flowObjectTypeSemicolon();
return this.finishNode(node, "ObjectTypeCallProperty");
};
pp.flowParseObjectType = function(allowStatic) {
var nodeStart = this.startNode();
var node = undefined;
var propertyKey = undefined;
var isStatic = undefined;
nodeStart.callProperties = [];
nodeStart.properties = [];
nodeStart.indexers = [];
this.expect(_tokenizerTypes.types.braceL);
while (!this.match(_tokenizerTypes.types.braceR)) {
var optional = false;
var startPos = this.state.start,
startLoc = this.state.startLoc;
node = this.startNode();
if (allowStatic && this.isContextual("static")) {
this.next();
isStatic = true;
}
if (this.match(_tokenizerTypes.types.bracketL)) {
nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic));
} else if (this.match(_tokenizerTypes.types.parenL) || this.isRelational("<")) {
nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, allowStatic));
} else {
if (isStatic && this.match(_tokenizerTypes.types.colon)) {
propertyKey = this.parseIdentifier();
} else {
propertyKey = this.flowParseObjectPropertyKey();
}
if (this.isRelational("<") || this.match(_tokenizerTypes.types.parenL)) {
nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey));
} else {
if (this.eat(_tokenizerTypes.types.question)) {
optional = true;
}
node.key = propertyKey;
node.value = this.flowParseTypeInitialiser();
node.optional = optional;
node["static"] = isStatic;
this.flowObjectTypeSemicolon();
nodeStart.properties.push(this.finishNode(node, "ObjectTypeProperty"));
}
}
}
this.expect(_tokenizerTypes.types.braceR);
return this.finishNode(nodeStart, "ObjectTypeAnnotation");
};
pp.flowObjectTypeSemicolon = function() {
if (!this.eat(_tokenizerTypes.types.semi) && !this.eat(_tokenizerTypes.types.comma) && !this.match(_tokenizerTypes.types.braceR)) {
this.unexpected();
}
};
pp.flowParseGenericType = function(startPos, startLoc, id) {
var node = this.startNodeAt(startPos, startLoc);
node.typeParameters = null;
node.id = id;
while (this.eat(_tokenizerTypes.types.dot)) {
var node2 = this.startNodeAt(startPos, startLoc);
node2.qualification = node.id;
node2.id = this.parseIdentifier();
node.id = this.finishNode(node2, "QualifiedTypeIdentifier");
}
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterInstantiation();
}
return this.finishNode(node, "GenericTypeAnnotation");
};
pp.flowParseTypeofType = function() {
var node = this.startNode();
this.expect(_tokenizerTypes.types._typeof);
node.argument = this.flowParsePrimaryType();
return this.finishNode(node, "TypeofTypeAnnotation");
};
pp.flowParseTupleType = function() {
var node = this.startNode();
node.types = [];
this.expect(_tokenizerTypes.types.bracketL);
while (this.state.pos < this.input.length && !this.match(_tokenizerTypes.types.bracketR)) {
node.types.push(this.flowParseType());
if (this.match(_tokenizerTypes.types.bracketR))
break;
this.expect(_tokenizerTypes.types.comma);
}
this.expect(_tokenizerTypes.types.bracketR);
return this.finishNode(node, "TupleTypeAnnotation");
};
pp.flowParseFunctionTypeParam = function() {
var optional = false;
var node = this.startNode();
node.name = this.parseIdentifier();
if (this.eat(_tokenizerTypes.types.question)) {
optional = true;
}
node.optional = optional;
node.typeAnnotation = this.flowParseTypeInitialiser();
return this.finishNode(node, "FunctionTypeParam");
};
pp.flowParseFunctionTypeParams = function() {
var ret = {
params: [],
rest: null
};
while (this.match(_tokenizerTypes.types.name)) {
ret.params.push(this.flowParseFunctionTypeParam());
if (!this.match(_tokenizerTypes.types.parenR)) {
this.expect(_tokenizerTypes.types.comma);
}
}
if (this.eat(_tokenizerTypes.types.ellipsis)) {
ret.rest = this.flowParseFunctionTypeParam();
}
return ret;
};
pp.flowIdentToTypeAnnotation = function(startPos, startLoc, node, id) {
switch (id.name) {
case "any":
return this.finishNode(node, "AnyTypeAnnotation");
case "void":
return this.finishNode(node, "VoidTypeAnnotation");
case "bool":
case "boolean":
return this.finishNode(node, "BooleanTypeAnnotation");
case "mixed":
return this.finishNode(node, "MixedTypeAnnotation");
case "number":
return this.finishNode(node, "NumberTypeAnnotation");
case "string":
return this.finishNode(node, "StringTypeAnnotation");
default:
return this.flowParseGenericType(startPos, startLoc, id);
}
};
pp.flowParsePrimaryType = function() {
var startPos = this.state.start,
startLoc = this.state.startLoc;
var node = this.startNode();
var tmp = undefined;
var type = undefined;
var isGroupedType = false;
switch (this.state.type) {
case _tokenizerTypes.types.name:
return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());
case _tokenizerTypes.types.braceL:
return this.flowParseObjectType();
case _tokenizerTypes.types.bracketL:
return this.flowParseTupleType();
case _tokenizerTypes.types.relational:
if (this.state.value === "<") {
node.typeParameters = this.flowParseTypeParameterDeclaration();
this.expect(_tokenizerTypes.types.parenL);
tmp = this.flowParseFunctionTypeParams();
node.params = tmp.params;
node.rest = tmp.rest;
this.expect(_tokenizerTypes.types.parenR);
this.expect(_tokenizerTypes.types.arrow);
node.returnType = this.flowParseType();
return this.finishNode(node, "FunctionTypeAnnotation");
}
case _tokenizerTypes.types.parenL:
this.next();
if (!this.match(_tokenizerTypes.types.parenR) && !this.match(_tokenizerTypes.types.ellipsis)) {
if (this.match(_tokenizerTypes.types.name)) {
var token = this.lookahead().type;
isGroupedType = token !== _tokenizerTypes.types.question && token !== _tokenizerTypes.types.colon;
} else {
isGroupedType = true;
}
}
if (isGroupedType) {
type = this.flowParseType();
this.expect(_tokenizerTypes.types.parenR);
if (this.eat(_tokenizerTypes.types.arrow)) {
this.raise(node, "Unexpected token =>. It looks like " + "you are trying to write a function type, but you ended up " + "writing a grouped type followed by an =>, which is a syntax " + "error. Remember, function type parameters are named so function " + "types look like (name1: type1, name2: type2) => returnType. You " + "probably wrote (type1) => returnType");
}
return type;
}
tmp = this.flowParseFunctionTypeParams();
node.params = tmp.params;
node.rest = tmp.rest;
this.expect(_tokenizerTypes.types.parenR);
this.expect(_tokenizerTypes.types.arrow);
node.returnType = this.flowParseType();
node.typeParameters = null;
return this.finishNode(node, "FunctionTypeAnnotation");
case _tokenizerTypes.types.string:
node.value = this.state.value;
this.addExtra(node, "rawValue", node.value);
this.addExtra(node, "raw", this.input.slice(this.state.start, this.state.end));
this.next();
return this.finishNode(node, "StringLiteralTypeAnnotation");
case _tokenizerTypes.types._true:
case _tokenizerTypes.types._false:
node.value = this.match(_tokenizerTypes.types._true);
this.next();
return this.finishNode(node, "BooleanLiteralTypeAnnotation");
case _tokenizerTypes.types.num:
node.value = this.state.value;
this.addExtra(node, "rawValue", node.value);
this.addExtra(node, "raw", this.input.slice(this.state.start, this.state.end));
this.next();
return this.finishNode(node, "NumericLiteralTypeAnnotation");
case _tokenizerTypes.types._null:
node.value = this.match(_tokenizerTypes.types._null);
this.next();
return this.finishNode(node, "NullLiteralTypeAnnotation");
case _tokenizerTypes.types._this:
node.value = this.match(_tokenizerTypes.types._this);
this.next();
return this.finishNode(node, "ThisTypeAnnotation");
default:
if (this.state.type.keyword === "typeof") {
return this.flowParseTypeofType();
}
}
this.unexpected();
};
pp.flowParsePostfixType = function() {
var node = this.startNode();
var type = node.elementType = this.flowParsePrimaryType();
if (this.match(_tokenizerTypes.types.bracketL)) {
this.expect(_tokenizerTypes.types.bracketL);
this.expect(_tokenizerTypes.types.bracketR);
return this.finishNode(node, "ArrayTypeAnnotation");
} else {
return type;
}
};
pp.flowParsePrefixType = function() {
var node = this.startNode();
if (this.eat(_tokenizerTypes.types.question)) {
node.typeAnnotation = this.flowParsePrefixType();
return this.finishNode(node, "NullableTypeAnnotation");
} else {
return this.flowParsePostfixType();
}
};
pp.flowParseIntersectionType = function() {
var node = this.startNode();
var type = this.flowParsePrefixType();
node.types = [type];
while (this.eat(_tokenizerTypes.types.bitwiseAND)) {
node.types.push(this.flowParsePrefixType());
}
return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
};
pp.flowParseUnionType = function() {
var node = this.startNode();
var type = this.flowParseIntersectionType();
node.types = [type];
while (this.eat(_tokenizerTypes.types.bitwiseOR)) {
node.types.push(this.flowParseIntersectionType());
}
return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
};
pp.flowParseType = function() {
var oldInType = this.state.inType;
this.state.inType = true;
var type = this.flowParseUnionType();
this.state.inType = oldInType;
return type;
};
pp.flowParseTypeAnnotation = function() {
var node = this.startNode();
node.typeAnnotation = this.flowParseTypeInitialiser();
return this.finishNode(node, "TypeAnnotation");
};
pp.flowParseTypeAnnotatableIdentifier = function(requireTypeAnnotation, canBeOptionalParam) {
var ident = this.parseIdentifier();
var isOptionalParam = false;
if (canBeOptionalParam && this.eat(_tokenizerTypes.types.question)) {
this.expect(_tokenizerTypes.types.question);
isOptionalParam = true;
}
if (requireTypeAnnotation || this.match(_tokenizerTypes.types.colon)) {
ident.typeAnnotation = this.flowParseTypeAnnotation();
this.finishNode(ident, ident.type);
}
if (isOptionalParam) {
ident.optional = true;
this.finishNode(ident, ident.type);
}
return ident;
};
exports["default"] = function(instance) {
instance.extend("parseFunctionBody", function(inner) {
return function(node, allowExpression) {
if (this.match(_tokenizerTypes.types.colon) && !allowExpression) {
node.returnType = this.flowParseTypeAnnotation();
}
return inner.call(this, node, allowExpression);
};
});
instance.extend("parseStatement", function(inner) {
return function(declaration, topLevel) {
if (this.state.strict && this.match(_tokenizerTypes.types.name) && this.state.value === "interface") {
var node = this.startNode();
this.next();
return this.flowParseInterface(node);
} else {
return inner.call(this, declaration, topLevel);
}
};
});
instance.extend("parseExpressionStatement", function(inner) {
return function(node, expr) {
if (expr.type === "Identifier") {
if (expr.name === "declare") {
if (this.match(_tokenizerTypes.types._class) || this.match(_tokenizerTypes.types.name) || this.match(_tokenizerTypes.types._function) || this.match(_tokenizerTypes.types._var)) {
return this.flowParseDeclare(node);
}
} else if (this.match(_tokenizerTypes.types.name)) {
if (expr.name === "interface") {
return this.flowParseInterface(node);
} else if (expr.name === "type") {
return this.flowParseTypeAlias(node);
}
}
}
return inner.call(this, node, expr);
};
});
instance.extend("shouldParseExportDeclaration", function(inner) {
return function() {
return this.isContextual("type") || this.isContextual("interface") || inner.call(this);
};
});
instance.extend("parseParenItem", function() {
return function(node, startLoc, startPos, forceArrow) {
var canBeArrow = this.state.potentialArrowAt = startPos;
if (this.match(_tokenizerTypes.types.colon)) {
var typeCastNode = this.startNodeAt(startLoc, startPos);
typeCastNode.expression = node;
typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
if (forceArrow && !this.match(_tokenizerTypes.types.arrow)) {
this.unexpected();
}
if (canBeArrow && this.eat(_tokenizerTypes.types.arrow)) {
var params = node.type === "SequenceExpression" ? node.expressions : [node];
var func = this.parseArrowExpression(this.startNodeAt(startLoc, startPos), params);
func.returnType = typeCastNode.typeAnnotation;
return func;
} else {
return this.finishNode(typeCastNode, "TypeCastExpression");
}
} else {
return node;
}
};
});
instance.extend("parseExport", function(inner) {
return function(node) {
node = inner.call(this, node);
if (node.type === "ExportNamedDeclaration") {
node.exportKind = node.exportKind || "value";
}
return node;
};
});
instance.extend("parseExportDeclaration", function(inner) {
return function(node) {
if (this.isContextual("type")) {
node.exportKind = "type";
var declarationNode = this.startNode();
this.next();
if (this.match(_tokenizerTypes.types.braceL)) {
node.specifiers = this.parseExportSpecifiers();
this.parseExportFrom(node);
return null;
} else {
return this.flowParseTypeAlias(declarationNode);
}
} else if (this.isContextual("interface")) {
node.exportKind = "type";
var declarationNode = this.startNode();
this.next();
return this.flowParseInterface(declarationNode);
} else {
return inner.call(this, node);
}
};
});
instance.extend("parseClassId", function(inner) {
return function(node) {
inner.apply(this, arguments);
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
}
};
});
instance.extend("isKeyword", function(inner) {
return function(name) {
if (this.state.inType && name === "void") {
return false;
} else {
return inner.call(this, name);
}
};
});
instance.extend("readToken", function(inner) {
return function(code) {
if (this.state.inType && (code === 62 || code === 60)) {
return this.finishOp(_tokenizerTypes.types.relational, 1);
} else {
return inner.call(this, code);
}
};
});
instance.extend("jsx_readToken", function(inner) {
return function() {
if (!this.state.inType)
return inner.call(this);
};
});
function typeCastToParameter(node) {
node.expression.typeAnnotation = node.typeAnnotation;
return node.expression;
}
instance.extend("toAssignable", function(inner) {
return function(node) {
if (node.type === "TypeCastExpression") {
return typeCastToParameter(node);
} else {
return inner.apply(this, arguments);
}
};
});
instance.extend("toAssignableList", function(inner) {
return function(exprList, isBinding) {
for (var i = 0; i < exprList.length; i++) {
var expr = exprList[i];
if (expr && expr.type === "TypeCastExpression") {
exprList[i] = typeCastToParameter(expr);
}
}
return inner.call(this, exprList, isBinding);
};
});
instance.extend("toReferencedList", function() {
return function(exprList) {
for (var i = 0; i < exprList.length; i++) {
var expr = exprList[i];
if (expr && expr._exprListItem && expr.type === "TypeCastExpression") {
this.raise(expr.start, "Unexpected type cast");
}
}
return exprList;
};
});
instance.extend("parseExprListItem", function(inner) {
return function(allowEmpty, refShorthandDefaultPos) {
var container = this.startNode();
var node = inner.call(this, allowEmpty, refShorthandDefaultPos);
if (this.match(_tokenizerTypes.types.colon)) {
container._exprListItem = true;
container.expression = node;
container.typeAnnotation = this.flowParseTypeAnnotation();
return this.finishNode(container, "TypeCastExpression");
} else {
return node;
}
};
});
instance.extend("checkLVal", function(inner) {
return function(node) {
if (node.type !== "TypeCastExpression") {
return inner.apply(this, arguments);
}
};
});
instance.extend("parseClassProperty", function(inner) {
return function(node) {
if (this.match(_tokenizerTypes.types.colon)) {
node.typeAnnotation = this.flowParseTypeAnnotation();
}
return inner.call(this, node);
};
});
instance.extend("isClassProperty", function(inner) {
return function() {
return this.match(_tokenizerTypes.types.colon) || inner.call(this);
};
});
instance.extend("parseClassMethod", function() {
return function(classBody, method, isGenerator, isAsync) {
if (this.isRelational("<")) {
method.typeParameters = this.flowParseTypeParameterDeclaration();
}
this.parseMethod(method, isGenerator, isAsync);
classBody.body.push(this.finishNode(method, "ClassMethod"));
};
});
instance.extend("parseClassSuper", function(inner) {
return function(node, isStatement) {
inner.call(this, node, isStatement);
if (node.superClass && this.isRelational("<")) {
node.superTypeParameters = this.flowParseTypeParameterInstantiation();
}
if (this.isContextual("implements")) {
this.next();
var implemented = node["implements"] = [];
do {
var _node = this.startNode();
_node.id = this.parseIdentifier();
if (this.isRelational("<")) {
_node.typeParameters = this.flowParseTypeParameterInstantiation();
} else {
_node.typeParameters = null;
}
implemented.push(this.finishNode(_node, "ClassImplements"));
} while (this.eat(_tokenizerTypes.types.comma));
}
};
});
instance.extend("parseObjPropValue", function(inner) {
return function(prop) {
var typeParameters = undefined;
if (this.isRelational("<")) {
typeParameters = this.flowParseTypeParameterDeclaration();
if (!this.match(_tokenizerTypes.types.parenL))
this.unexpected();
}
inner.apply(this, arguments);
if (typeParameters) {
(prop.value || prop).typeParameters = typeParameters;
}
};
});
instance.extend("parseAssignableListItemTypes", function() {
return function(param) {
if (this.eat(_tokenizerTypes.types.question)) {
param.optional = true;
}
if (this.match(_tokenizerTypes.types.colon)) {
param.typeAnnotation = this.flowParseTypeAnnotation();
}
this.finishNode(param, param.type);
return param;
};
});
instance.extend("parseImportSpecifiers", function(inner) {
return function(node) {
node.importKind = "value";
var kind = null;
if (this.match(_tokenizerTypes.types._typeof)) {
kind = "typeof";
} else if (this.isContextual("type")) {
kind = "type";
}
if (kind) {
var lh = this.lookahead();
if (lh.type === _tokenizerTypes.types.name && lh.value !== "from" || lh.type === _tokenizerTypes.types.braceL || lh.type === _tokenizerTypes.types.star) {
this.next();
node.importKind = kind;
}
}
inner.call(this, node);
};
});
instance.extend("parseFunctionParams", function(inner) {
return function(node) {
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
}
inner.call(this, node);
};
});
instance.extend("parseVarHead", function(inner) {
return function(decl) {
inner.call(this, decl);
if (this.match(_tokenizerTypes.types.colon)) {
decl.id.typeAnnotation = this.flowParseTypeAnnotation();
this.finishNode(decl.id, decl.id.type);
}
};
});
instance.extend("parseAsyncArrowFromCallExpression", function(inner) {
return function(node, call) {
if (this.match(_tokenizerTypes.types.colon)) {
node.returnType = this.flowParseTypeAnnotation();
}
return inner.call(this, node, call);
};
});
instance.extend("shouldParseAsyncArrow", function(inner) {
return function() {
return this.match(_tokenizerTypes.types.colon) || inner.call(this);
};
});
instance.extend("parseParenAndDistinguishExpression", function(inner) {
return function(startPos, startLoc, canBeArrow, isAsync) {
startPos = startPos || this.state.start;
startLoc = startLoc || this.state.startLoc;
if (canBeArrow && this.lookahead().type === _tokenizerTypes.types.parenR) {
this.expect(_tokenizerTypes.types.parenL);
this.expect(_tokenizerTypes.types.parenR);
var node = this.startNodeAt(startPos, startLoc);
if (this.match(_tokenizerTypes.types.colon))
node.returnType = this.flowParseTypeAnnotation();
this.expect(_tokenizerTypes.types.arrow);
return this.parseArrowExpression(node, [], isAsync);
} else {
var node = inner.call(this, startPos, startLoc, canBeArrow, isAsync, this.hasPlugin("trailingFunctionCommas"));
if (this.match(_tokenizerTypes.types.colon)) {
var state = this.state.clone();
try {
return this.parseParenItem(node, startPos, startLoc, true);
} catch (err) {
if (err instanceof SyntaxError) {
this.state = state;
return node;
} else {
throw err;
}
}
} else {
return node;
}
}
};
});
};
module.exports = exports["default"];
}, {
"../parser": 5,
"../tokenizer/types": 17,
"babel-runtime/helpers/interop-require-default": 26
}],
12: [function(require, module, exports) {
"use strict";
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
exports.__esModule = true;
var _xhtml = require('./xhtml');
var _xhtml2 = _interopRequireDefault(_xhtml);
var _tokenizerTypes = require('../../tokenizer/types');
var _tokenizerContext = require('../../tokenizer/context');
var _parser = require('../../parser');
var _parser2 = _interopRequireDefault(_parser);
var _utilIdentifier = require('../../util/identifier');
var _utilWhitespace = require('../../util/whitespace');
var HEX_NUMBER = /^[\da-fA-F]+$/;
var DECIMAL_NUMBER = /^\d+$/;
_tokenizerContext.types.j_oTag = new _tokenizerContext.TokContext("<tag", false);
_tokenizerContext.types.j_cTag = new _tokenizerContext.TokContext("</tag", false);
_tokenizerContext.types.j_expr = new _tokenizerContext.TokContext("<tag>...</tag>", true, true);
_tokenizerTypes.types.jsxName = new _tokenizerTypes.TokenType("jsxName");
_tokenizerTypes.types.jsxText = new _tokenizerTypes.TokenType("jsxText", {beforeExpr: true});
_tokenizerTypes.types.jsxTagStart = new _tokenizerTypes.TokenType("jsxTagStart");
_tokenizerTypes.types.jsxTagEnd = new _tokenizerTypes.TokenType("jsxTagEnd");
_tokenizerTypes.types.jsxTagStart.updateContext = function() {
this.state.context.push(_tokenizerContext.types.j_expr);
this.state.context.push(_tokenizerContext.types.j_oTag);
this.state.exprAllowed = false;
};
_tokenizerTypes.types.jsxTagEnd.updateContext = function(prevType) {
var out = this.state.context.pop();
if (out === _tokenizerContext.types.j_oTag && prevType === _tokenizerTypes.types.slash || out === _tokenizerContext.types.j_cTag) {
this.state.context.pop();
this.state.exprAllowed = this.curContext() === _tokenizerContext.types.j_expr;
} else {
this.state.exprAllowed = true;
}
};
var pp = _parser2["default"].prototype;
pp.jsxReadToken = function() {
var out = "";
var chunkStart = this.state.pos;
for (; ; ) {
if (this.state.pos >= this.input.length) {
this.raise(this.state.start, "Unterminated JSX contents");
}
var ch = this.input.charCodeAt(this.state.pos);
switch (ch) {
case 60:
case 123:
if (this.state.pos === this.state.start) {
if (ch === 60 && this.state.exprAllowed) {
++this.state.pos;
return this.finishToken(_tokenizerTypes.types.jsxTagStart);
}
return this.getTokenFromCode(ch);
}
out += this.input.slice(chunkStart, this.state.pos);
return this.finishToken(_tokenizerTypes.types.jsxText, out);
case 38:
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadEntity();
chunkStart = this.state.pos;
break;
default:
if (_utilWhitespace.isNewLine(ch)) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadNewLine(true);
chunkStart = this.state.pos;
} else {
++this.state.pos;
}
}
}
};
pp.jsxReadNewLine = function(normalizeCRLF) {
var ch = this.input.charCodeAt(this.state.pos);
var out = undefined;
++this.state.pos;
if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
++this.state.pos;
out = normalizeCRLF ? "\n" : "\r\n";
} else {
out = String.fromCharCode(ch);
}
++this.state.curLine;
this.state.lineStart = this.state.pos;
return out;
};
pp.jsxReadString = function(quote) {
var out = "";
var chunkStart = ++this.state.pos;
for (; ; ) {
if (this.state.pos >= this.input.length) {
this.raise(this.state.start, "Unterminated string constant");
}
var ch = this.input.charCodeAt(this.state.pos);
if (ch === quote)
break;
if (ch === 38) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadEntity();
chunkStart = this.state.pos;
} else if (_utilWhitespace.isNewLine(ch)) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadNewLine(false);
chunkStart = this.state.pos;
} else {
++this.state.pos;
}
}
out += this.input.slice(chunkStart, this.state.pos++);
return this.finishToken(_tokenizerTypes.types.string, out);
};
pp.jsxReadEntity = function() {
var str = "";
var count = 0;
var entity = undefined;
var ch = this.input[this.state.pos];
var startPos = ++this.state.pos;
while (this.state.pos < this.input.length && count++ < 10) {
ch = this.input[this.state.pos++];
if (ch === ";") {
if (str[0] === "#") {
if (str[1] === "x") {
str = str.substr(2);
if (HEX_NUMBER.test(str))
entity = String.fromCharCode(parseInt(str, 16));
} else {
str = str.substr(1);
if (DECIMAL_NUMBER.test(str))
entity = String.fromCharCode(parseInt(str, 10));
}
} else {
entity = _xhtml2["default"][str];
}
break;
}
str += ch;
}
if (!entity) {
this.state.pos = startPos;
return "&";
}
return entity;
};
pp.jsxReadWord = function() {
var ch = undefined;
var start = this.state.pos;
do {
ch = this.input.charCodeAt(++this.state.pos);
} while (_utilIdentifier.isIdentifierChar(ch) || ch === 45);
return this.finishToken(_tokenizerTypes.types.jsxName, this.input.slice(start, this.state.pos));
};
function getQualifiedJSXName(object) {
if (object.type === "JSXIdentifier") {
return object.name;
}
if (object.type === "JSXNamespacedName") {
return object.namespace.name + ":" + object.name.name;
}
if (object.type === "JSXMemberExpression") {
return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
}
}
pp.jsxParseIdentifier = function() {
var node = this.startNode();
if (this.match(_tokenizerTypes.types.jsxName)) {
node.name = this.state.value;
} else if (this.state.type.keyword) {
node.name = this.state.type.keyword;
} else {
this.unexpected();
}
this.next();
return this.finishNode(node, "JSXIdentifier");
};
pp.jsxParseNamespacedName = function() {
var startPos = this.state.start,
startLoc = this.state.startLoc;
var name = this.jsxParseIdentifier();
if (!this.eat(_tokenizerTypes.types.colon))
return name;
var node = this.startNodeAt(startPos, startLoc);
node.namespace = name;
node.name = this.jsxParseIdentifier();
return this.finishNode(node, "JSXNamespacedName");
};
pp.jsxParseElementName = function() {
var startPos = this.state.start,
startLoc = this.state.startLoc;
var node = this.jsxParseNamespacedName();
while (this.eat(_tokenizerTypes.types.dot)) {
var newNode = this.startNodeAt(startPos, startLoc);
newNode.object = node;
newNode.property = this.jsxParseIdentifier();
node = this.finishNode(newNode, "JSXMemberExpression");
}
return node;
};
pp.jsxParseAttributeValue = function() {
var node = undefined;
switch (this.state.type) {
case _tokenizerTypes.types.braceL:
node = this.jsxParseExpressionContainer();
if (node.expression.type === "JSXEmptyExpression") {
this.raise(node.start, "JSX attributes must only be assigned a non-empty expression");
} else {
return node;
}
case _tokenizerTypes.types.jsxTagStart:
case _tokenizerTypes.types.string:
node = this.parseExprAtom();
node.extra = null;
return node;
default:
this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text");
}
};
pp.jsxParseEmptyExpression = function() {
var node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
return this.finishNodeAt(node, "JSXEmptyExpression", this.start, this.startLoc);
};
pp.jsxParseExpressionContainer = function() {
var node = this.startNode();
this.next();
if (this.match(_tokenizerTypes.types.braceR)) {
node.expression = this.jsxParseEmptyExpression();
} else {
node.expression = this.parseExpression();
}
this.expect(_tokenizerTypes.types.braceR);
return this.finishNode(node, "JSXExpressionContainer");
};
pp.jsxParseAttribute = function() {
var node = this.startNode();
if (this.eat(_tokenizerTypes.types.braceL)) {
this.expect(_tokenizerTypes.types.ellipsis);
node.argument = this.parseMaybeAssign();
this.expect(_tokenizerTypes.types.braceR);
return this.finishNode(node, "JSXSpreadAttribute");
}
node.name = this.jsxParseNamespacedName();
node.value = this.eat(_tokenizerTypes.types.eq) ? this.jsxParseAttributeValue() : null;
return this.finishNode(node, "JSXAttribute");
};
pp.jsxParseOpeningElementAt = function(startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
node.attributes = [];
node.name = this.jsxParseElementName();
while (!this.match(_tokenizerTypes.types.slash) && !this.match(_tokenizerTypes.types.jsxTagEnd)) {
node.attributes.push(this.jsxParseAttribute());
}
node.selfClosing = this.eat(_tokenizerTypes.types.slash);
this.expect(_tokenizerTypes.types.jsxTagEnd);
return this.finishNode(node, "JSXOpeningElement");
};
pp.jsxParseClosingElementAt = function(startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
node.name = this.jsxParseElementName();
this.expect(_tokenizerTypes.types.jsxTagEnd);
return this.finishNode(node, "JSXClosingElement");
};
pp.jsxParseElementAt = function(startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
var children = [];
var openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
var closingElement = null;
if (!openingElement.selfClosing) {
contents: for (; ; ) {
switch (this.state.type) {
case _tokenizerTypes.types.jsxTagStart:
startPos = this.state.start;
startLoc = this.state.startLoc;
this.next();
if (this.eat(_tokenizerTypes.types.slash)) {
closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
break contents;
}
children.push(this.jsxParseElementAt(startPos, startLoc));
break;
case _tokenizerTypes.types.jsxText:
children.push(this.parseExprAtom());
break;
case _tokenizerTypes.types.braceL:
children.push(this.jsxParseExpressionContainer());
break;
default:
this.unexpected();
}
}
if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">");
}
}
node.openingElement = openingElement;
node.closingElement = closingElement;
node.children = children;
if (this.match(_tokenizerTypes.types.relational) && this.state.value === "<") {
this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
}
return this.finishNode(node, "JSXElement");
};
pp.jsxParseElement = function() {
var startPos = this.state.start,
startLoc = this.state.startLoc;
this.next();
return this.jsxParseElementAt(startPos, startLoc);
};
exports["default"] = function(instance) {
instance.extend("parseExprAtom", function(inner) {
return function(refShortHandDefaultPos) {
if (this.match(_tokenizerTypes.types.jsxText)) {
var node = this.parseLiteral(this.state.value, "JSXText");
node.extra = null;
return node;
} else if (this.match(_tokenizerTypes.types.jsxTagStart)) {
return this.jsxParseElement();
} else {
return inner.call(this, refShortHandDefaultPos);
}
};
});
instance.extend("readToken", function(inner) {
return function(code) {
var context = this.curContext();
if (context === _tokenizerContext.types.j_expr) {
return this.jsxReadToken();
}
if (context === _tokenizerContext.types.j_oTag || context === _tokenizerContext.types.j_cTag) {
if (_utilIdentifier.isIdentifierStart(code)) {
return this.jsxReadWord();
}
if (code === 62) {
++this.state.pos;
return this.finishToken(_tokenizerTypes.types.jsxTagEnd);
}
if ((code === 34 || code === 39) && context === _tokenizerContext.types.j_oTag) {
return this.jsxReadString(code);
}
}
if (code === 60 && this.state.exprAllowed) {
++this.state.pos;
return this.finishToken(_tokenizerTypes.types.jsxTagStart);
}
return inner.call(this, code);
};
});
instance.extend("updateContext", function(inner) {
return function(prevType) {
if (this.match(_tokenizerTypes.types.braceL)) {
var curContext = this.curContext();
if (curContext === _tokenizerContext.types.j_oTag) {
this.state.context.push(_tokenizerContext.types.b_expr);
} else if (curContext === _tokenizerContext.types.j_expr) {
this.state.context.push(_tokenizerContext.types.b_tmpl);
} else {
inner.call(this, prevType);
}
this.state.exprAllowed = true;
} else if (this.match(_tokenizerTypes.types.slash) && prevType === _tokenizerTypes.types.jsxTagStart) {
this.state.context.length -= 2;
this.state.context.push(_tokenizerContext.types.j_cTag);
this.state.exprAllowed = false;
} else {
return inner.call(this, prevType);
}
};
});
};
module.exports = exports["default"];
}, {
"../../parser": 5,
"../../tokenizer/context": 14,
"../../tokenizer/types": 17,
"../../util/identifier": 18,
"../../util/whitespace": 20,
"./xhtml": 13,
"babel-runtime/helpers/interop-require-default": 26
}],
13: [function(require, module, exports) {
"use strict";
exports.__esModule = true;
exports["default"] = {
quot: "\"",
amp: "&",
apos: "'",
lt: "<",
gt: ">",
nbsp: " ",
iexcl: "¡",
cent: "¢",
pound: "£",
curren: "¤",
yen: "¥",
brvbar: "¦",
sect: "§",
uml: "¨",
copy: "©",
ordf: "ª",
laquo: "«",
not: "¬",
shy: "",
reg: "®",
macr: "¯",
deg: "°",
plusmn: "±",
sup2: "²",
sup3: "³",
acute: "´",
micro: "µ",
para: "¶",
middot: "·",
cedil: "¸",
sup1: "¹",
ordm: "º",
raquo: "»",
frac14: "¼",
frac12: "½",
frac34: "¾",
iquest: "¿",
Agrave: "À",
Aacute: "Á",
Acirc: "Â",
Atilde: "Ã",
Auml: "Ä",
Aring: "Å",
AElig: "Æ",
Ccedil: "Ç",
Egrave: "È",
Eacute: "É",
Ecirc: "Ê",
Euml: "Ë",
Igrave: "Ì",
Iacute: "Í",
Icirc: "Î",
Iuml: "Ï",
ETH: "Ð",
Ntilde: "Ñ",
Ograve: "Ò",
Oacute: "Ó",
Ocirc: "Ô",
Otilde: "Õ",
Ouml: "Ö",
times: "×",
Oslash: "Ø",
Ugrave: "Ù",
Uacute: "Ú",
Ucirc: "Û",
Uuml: "Ü",
Yacute: "Ý",
THORN: "Þ",
szlig: "ß",
agrave: "à",
aacute: "á",
acirc: "â",
atilde: "ã",
auml: "ä",
aring: "å",
aelig: "æ",
ccedil: "ç",
egrave: "è",
eacute: "é",
ecirc: "ê",
euml: "ë",
igrave: "ì",
iacute: "í",
icirc: "î",
iuml: "ï",
eth: "ð",
ntilde: "ñ",
ograve: "ò",
oacute: "ó",
ocirc: "ô",
otilde: "õ",
ouml: "ö",
divide: "÷",
oslash: "ø",
ugrave: "ù",
uacute: "ú",
ucirc: "û",
uuml: "ü",
yacute: "ý",
thorn: "þ",
yuml: "ÿ",
OElig: "Œ",
oelig: "œ",
Scaron: "Š",
scaron: "š",
Yuml: "Ÿ",
fnof: "ƒ",
circ: "ˆ",
tilde: "˜",
Alpha: "Α",
Beta: "Β",
Gamma: "Γ",
Delta: "Δ",
Epsilon: "Ε",
Zeta: "Ζ",
Eta: "Η",
Theta: "Θ",
Iota: "Ι",
Kappa: "Κ",
Lambda: "Λ",
Mu: "Μ",
Nu: "Ν",
Xi: "Ξ",
Omicron: "Ο",
Pi: "Π",
Rho: "Ρ",
Sigma: "Σ",
Tau: "Τ",
Upsilon: "Υ",
Phi: "Φ",
Chi: "Χ",
Psi: "Ψ",
Omega: "Ω",
alpha: "α",
beta: "β",
gamma: "γ",
delta: "δ",
epsilon: "ε",
zeta: "ζ",
eta: "η",
theta: "θ",
iota: "ι",
kappa: "κ",
lambda: "λ",
mu: "μ",
nu: "ν",
xi: "ξ",
omicron: "ο",
pi: "π",
rho: "ρ",
sigmaf: "ς",
sigma: "σ",
tau: "τ",
upsilon: "υ",
phi: "φ",
chi: "χ",
psi: "ψ",
omega: "ω",
thetasym: "ϑ",
upsih: "ϒ",
piv: "ϖ",
ensp: " ",
emsp: " ",
thinsp: " ",
zwnj: "",
zwj: "",
lrm: "",
rlm: "",
ndash: "–",
mdash: "—",
lsquo: "‘",
rsquo: "’",
sbquo: "‚",
ldquo: "“",
rdquo: "”",
bdquo: "„",
dagger: "†",
Dagger: "‡",
bull: "•",
hellip: "…",
permil: "‰",
prime: "′",
Prime: "″",
lsaquo: "‹",
rsaquo: "›",
oline: "‾",
frasl: "⁄",
euro: "€",
image: "ℑ",
weierp: "℘",
real: "ℜ",
trade: "™",
alefsym: "ℵ",
larr: "←",
uarr: "↑",
rarr: "→",
darr: "↓",
harr: "↔",
crarr: "↵",
lArr: "⇐",
uArr: "⇑",
rArr: "⇒",
dArr: "⇓",
hArr: "⇔",
forall: "∀",
part: "∂",
exist: "∃",
empty: "∅",
nabla: "∇",
isin: "∈",
notin: "∉",
ni: "∋",
prod: "∏",
sum: "∑",
minus: "−",
lowast: "∗",
radic: "√",
prop: "∝",
infin: "∞",
ang: "∠",
and: "∧",
or: "∨",
cap: "∩",
cup: "∪",
"int": "∫",
there4: "∴",
sim: "∼",
cong: "≅",
asymp: "≈",
ne: "≠",
equiv: "≡",
le: "≤",
ge: "≥",
sub: "⊂",
sup: "⊃",
nsub: "⊄",
sube: "⊆",
supe: "⊇",
oplus: "⊕",
otimes: "⊗",
perp: "⊥",
sdot: "⋅",
lceil: "⌈",
rceil: "⌉",
lfloor: "⌊",
rfloor: "⌋",
lang: "〈",
rang: "〉",
loz: "◊",
spades: "♠",
clubs: "♣",
hearts: "♥",
diams: "♦"
};
module.exports = exports["default"];
}, {}],
14: [function(require, module, exports) {
"use strict";
var _classCallCheck = require('babel-runtime/helpers/class-call-check')["default"];
exports.__esModule = true;
var _types = require('./types');
var _utilWhitespace = require('../util/whitespace');
var TokContext = function TokContext(token, isExpr, preserveSpace, override) {
_classCallCheck(this, TokContext);
this.token = token;
this.isExpr = !!isExpr;
this.preserveSpace = !!preserveSpace;
this.override = override;
};
exports.TokContext = TokContext;
var types = {
b_stat: new TokContext("{", false),
b_expr: new TokContext("{", true),
b_tmpl: new TokContext("${", true),
p_stat: new TokContext("(", false),
p_expr: new TokContext("(", true),
q_tmpl: new TokContext("`", true, true, function(p) {
return p.readTmplToken();
}),
f_expr: new TokContext("function", true)
};
exports.types = types;
_types.types.parenR.updateContext = _types.types.braceR.updateContext = function() {
if (this.state.context.length === 1) {
this.state.exprAllowed = true;
return;
}
var out = this.state.context.pop();
if (out === types.b_stat && this.curContext() === types.f_expr) {
this.state.context.pop();
this.state.exprAllowed = false;
} else if (out === types.b_tmpl) {
this.state.exprAllowed = true;
} else {
this.state.exprAllowed = !out.isExpr;
}
};
_types.types.name.updateContext = function(prevType) {
this.state.exprAllowed = false;
if (prevType === _types.types._let || prevType === _types.types._const || prevType === _types.types._var) {
if (_utilWhitespace.lineBreak.test(this.input.slice(this.state.end))) {
this.state.exprAllowed = true;
}
}
};
_types.types.braceL.updateContext = function(prevType) {
this.state.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);
this.state.exprAllowed = true;
};
_types.types.dollarBraceL.updateContext = function() {
this.state.context.push(types.b_tmpl);
this.state.exprAllowed = true;
};
_types.types.parenL.updateContext = function(prevType) {
var statementParens = prevType === _types.types._if || prevType === _types.types._for || prevType === _types.types._with || prevType === _types.types._while;
this.state.context.push(statementParens ? types.p_stat : types.p_expr);
this.state.exprAllowed = true;
};
_types.types.incDec.updateContext = function() {};
_types.types._function.updateContext = function() {
if (this.curContext() !== types.b_stat) {
this.state.context.push(types.f_expr);
}
this.state.exprAllowed = false;
};
_types.types.backQuote.updateContext = function() {
if (this.curContext() === types.q_tmpl) {
this.state.context.pop();
} else {
this.state.context.push(types.q_tmpl);
}
this.state.exprAllowed = false;
};
}, {
"../util/whitespace": 20,
"./types": 17,
"babel-runtime/helpers/class-call-check": 24
}],
15: [function(require, module, exports) {
"use strict";
var _classCallCheck = require('babel-runtime/helpers/class-call-check')["default"];
var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')["default"];
exports.__esModule = true;
var _utilIdentifier = require('../util/identifier');
var _types = require('./types');
var _context = require('./context');
var _utilLocation = require('../util/location');
var _utilWhitespace = require('../util/whitespace');
var _state = require('./state');
var _state2 = _interopRequireDefault(_state);
var Token = function Token(state) {
_classCallCheck(this, Token);
this.type = state.type;
this.value = state.value;
this.start = state.start;
this.end = state.end;
this.loc = new _utilLocation.SourceLocation(state.startLoc, state.endLoc);
};
;
exports.Token = Token;
function codePointToString(code) {
if (code <= 0xFFFF) {
return String.fromCharCode(code);
} else {
return String.fromCharCode((code - 0x10000 >> 10) + 0xD800, (code - 0x10000 & 1023) + 0xDC00);
}
}
var Tokenizer = (function() {
function Tokenizer(options, input) {
_classCallCheck(this, Tokenizer);
this.state = new _state2["default"]();
this.state.init(options, input);
}
Tokenizer.prototype.next = function next() {
if (!this.isLookahead) {
this.state.tokens.push(new Token(this.state));
}
this.state.lastTokEnd = this.state.end;
this.state.lastTokStart = this.state.start;
this.state.lastTokEndLoc = this.state.endLoc;
this.state.lastTokStartLoc = this.state.startLoc;
this.nextToken();
};
Tokenizer.prototype.eat = function eat(type) {
if (this.match(type)) {
this.next();
return true;
} else {
return false;
}
};
Tokenizer.prototype.match = function match(type) {
return this.state.type === type;
};
Tokenizer.prototype.isKeyword = function isKeyword(word) {
return _utilIdentifier.isKeyword(word);
};
Tokenizer.prototype.lookahead = function lookahead() {
var old = this.state;
this.state = old.clone(true);
this.isLookahead = true;
this.next();
this.isLookahead = false;
var curr = this.state.clone(true);
this.state = old;
return curr;
};
Tokenizer.prototype.setStrict = function setStrict(strict) {
this.state.strict = strict;
if (!this.match(_types.types.num) && !this.match(_types.types.string))
return;
this.state.pos = this.state.start;
while (this.state.pos < this.state.lineStart) {
this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1;
--this.state.curLine;
}
this.nextToken();
};
Tokenizer.prototype.curContext = function curContext() {
return this.state.context[this.state.context.length - 1];
};
Tokenizer.prototype.nextToken = function nextToken() {
var curContext = this.curContext();
if (!curContext || !curContext.preserveSpace)
this.skipSpace();
this.state.containsOctal = false;
this.state.octalPosition = null;
this.state.start = this.state.pos;
this.state.startLoc = this.state.curPosition();
if (this.state.pos >= this.input.length)
return this.finishToken(_types.types.eof);
if (curContext.override) {
return curContext.override(this);
} else {
return this.readToken(this.fullCharCodeAtPos());
}
};
Tokenizer.prototype.readToken = function readToken(code) {
if (_utilIdentifier.isIdentifierStart(code) || code === 92) {
return this.readWord();
} else {
return this.getTokenFromCode(code);
}
};
Tokenizer.prototype.fullCharCodeAtPos = function fullCharCodeAtPos() {
var code = this.input.charCodeAt(this.state.pos);
if (code <= 0xd7ff || code >= 0xe000)
return code;
var next = this.input.charCodeAt(this.state.pos + 1);
return (code << 10) + next - 0x35fdc00;
};
Tokenizer.prototype.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) {
var comment = {
type: block ? "CommentBlock" : "CommentLine",
value: text,
start: start,
end: end,
loc: new _utilLocation.SourceLocation(startLoc, endLoc)
};
if (!this.isLookahead) {
this.state.tokens.push(comment);
this.state.comments.push(comment);
}
this.addComment(comment);
};
Tokenizer.prototype.skipBlockComment = function skipBlockComment() {
var startLoc = this.state.curPosition();
var start = this.state.pos,
end = this.input.indexOf("*/", this.state.pos += 2);
if (end === -1)
this.raise(this.state.pos - 2, "Unterminated comment");
this.state.pos = end + 2;
_utilWhitespace.lineBreakG.lastIndex = start;
var match = undefined;
while ((match = _utilWhitespace.lineBreakG.exec(this.input)) && match.index < this.state.pos) {
++this.state.curLine;
this.state.lineStart = match.index + match[0].length;
}
this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition());
};
Tokenizer.prototype.skipLineComment = function skipLineComment(startSkip) {
var start = this.state.pos;
var startLoc = this.state.curPosition();
var ch = this.input.charCodeAt(this.state.pos += startSkip);
while (this.state.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) {
++this.state.pos;
ch = this.input.charCodeAt(this.state.pos);
}
this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition());
};
Tokenizer.prototype.skipSpace = function skipSpace() {
loop: while (this.state.pos < this.input.length) {
var ch = this.input.charCodeAt(this.state.pos);
switch (ch) {
case 32:
case 160:
++this.state.pos;
break;
case 13:
if (this.input.charCodeAt(this.state.pos + 1) === 10) {
++this.state.pos;
}
case 10:
case 8232:
case 8233:
++this.state.pos;
++this.state.curLine;
this.state.lineStart = this.state.pos;
break;
case 47:
switch (this.input.charCodeAt(this.state.pos + 1)) {
case 42:
this.skipBlockComment();
break;
case 47:
this.skipLineComment(2);
break;
default:
break loop;
}
break;
default:
if (ch > 8 && ch < 14 || ch >= 5760 && _utilWhitespace.nonASCIIwhitespace.test(String.fromCharCode(ch))) {
++this.state.pos;
} else {
break loop;
}
}
}
};
Tokenizer.prototype.finishToken = function finishToken(type, val) {
this.state.end = this.state.pos;
this.state.endLoc = this.state.curPosition();
var prevType = this.state.type;
this.state.type = type;
this.state.value = val;
this.updateContext(prevType);
};
Tokenizer.prototype.readToken_dot = function readToken_dot() {
var next = this.input.charCodeAt(this.state.pos + 1);
if (next >= 48 && next <= 57) {
return this.readNumber(true);
}
var next2 = this.input.charCodeAt(this.state.pos + 2);
if (next === 46 && next2 === 46) {
this.state.pos += 3;
return this.finishToken(_types.types.ellipsis);
} else {
++this.state.pos;
return this.finishToken(_types.types.dot);
}
};
Tokenizer.prototype.readToken_slash = function readToken_slash() {
if (this.state.exprAllowed) {
++this.state.pos;
return this.readRegexp();
}
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === 61) {
return this.finishOp(_types.types.assign, 2);
} else {
return this.finishOp(_types.types.slash, 1);
}
};
Tokenizer.prototype.readToken_mult_modulo = function readToken_mult_modulo(code) {
var type = code === 42 ? _types.types.star : _types.types.modulo;
var width = 1;
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === 42 && this.hasPlugin("exponentiationOperator")) {
width++;
next = this.input.charCodeAt(this.state.pos + 2);
type = _types.types.exponent;
}
if (next === 61) {
width++;
type = _types.types.assign;
}
return this.finishOp(type, width);
};
Tokenizer.prototype.readToken_pipe_amp = function readToken_pipe_amp(code) {
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === code)
return this.finishOp(code === 124 ? _types.types.logicalOR : _types.types.logicalAND, 2);
if (next === 61)
return this.finishOp(_types.types.assign, 2);
return this.finishOp(code === 124 ? _types.types.bitwiseOR : _types.types.bitwiseAND, 1);
};
Tokenizer.prototype.readToken_caret = function readToken_caret() {
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === 61) {
return this.finishOp(_types.types.assign, 2);
} else {
return this.finishOp(_types.types.bitwiseXOR, 1);
}
};
Tokenizer.prototype.readToken_plus_min = function readToken_plus_min(code) {
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === code) {
if (next === 45 && this.input.charCodeAt(this.state.pos + 2) === 62 && _utilWhitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) {
this.skipLineComment(3);
this.skipSpace();
return this.nextToken();
}
return this.finishOp(_types.types.incDec, 2);
}
if (next === 61) {
return this.finishOp(_types.types.assign, 2);
} else {
return this.finishOp(_types.types.plusMin, 1);
}
};
Tokenizer.prototype.readToken_lt_gt = function readToken_lt_gt(code) {
var next = this.input.charCodeAt(this.state.pos + 1);
var size = 1;
if (next === code) {
size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;
if (this.input.charCodeAt(this.state.pos + size) === 61)
return this.finishOp(_types.types.assign, size + 1);
return this.finishOp(_types.types.bitShift, size);
}
if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) {
if (this.inModule)
this.unexpected();
this.skipLineComment(4);
this.skipSpace();
return this.nextToken();
}
if (next === 61) {
size = this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2;
}
return this.finishOp(_types.types.relational, size);
};
Tokenizer.prototype.readToken_eq_excl = function readToken_eq_excl(code) {
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === 61)
return this.finishOp(_types.types.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
if (code === 61 && next === 62) {
this.state.pos += 2;
return this.finishToken(_types.types.arrow);
}
return this.finishOp(code === 61 ? _types.types.eq : _types.types.prefix, 1);
};
Tokenizer.prototype.getTokenFromCode = function getTokenFromCode(code) {
switch (code) {
case 46:
return this.readToken_dot();
case 40:
++this.state.pos;
return this.finishToken(_types.types.parenL);
case 41:
++this.state.pos;
return this.finishToken(_types.types.parenR);
case 59:
++this.state.pos;
return this.finishToken(_types.types.semi);
case 44:
++this.state.pos;
return this.finishToken(_types.types.comma);
case 91:
++this.state.pos;
return this.finishToken(_types.types.bracketL);
case 93:
++this.state.pos;
return this.finishToken(_types.types.bracketR);
case 123:
++this.state.pos;
return this.finishToken(_types.types.braceL);
case 125:
++this.state.pos;
return this.finishToken(_types.types.braceR);
case 58:
if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
return this.finishOp(_types.types.doubleColon, 2);
} else {
++this.state.pos;
return this.finishToken(_types.types.colon);
}
case 63:
++this.state.pos;
return this.finishToken(_types.types.question);
case 64:
++this.state.pos;
return this.finishToken(_types.types.at);
case 96:
++this.state.pos;
return this.finishToken(_types.types.backQuote);
case 48:
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === 120 || next === 88)
return this.readRadixNumber(16);
if (next === 111 || next === 79)
return this.readRadixNumber(8);
if (next === 98 || next === 66)
return this.readRadixNumber(2);
case 49:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
return this.readNumber(false);
case 34:
case 39:
return this.readString(code);
case 47:
return this.readToken_slash();
case 37:
case 42:
return this.readToken_mult_modulo(code);
case 124:
case 38:
return this.readToken_pipe_amp(code);
case 94:
return this.readToken_caret();
case 43:
case 45:
return this.readToken_plus_min(code);
case 60:
case 62:
return this.readToken_lt_gt(code);
case 61:
case 33:
return this.readToken_eq_excl(code);
case 126:
return this.finishOp(_types.types.prefix, 1);
}
this.raise(this.state.pos, "Unexpected character '" + codePointToString(code) + "'");
};
Tokenizer.prototype.finishOp = function finishOp(type, size) {
var str = this.input.slice(this.state.pos, this.state.pos + size);
this.state.pos += size;
return this.finishToken(type, str);
};
Tokenizer.prototype.readRegexp = function readRegexp() {
var escaped = undefined,
inClass = undefined,
start = this.state.pos;
for (; ; ) {
if (this.state.pos >= this.input.length)
this.raise(start, "Unterminated regular expression");
var ch = this.input.charAt(this.state.pos);
if (_utilWhitespace.lineBreak.test(ch)) {
this.raise(start, "Unterminated regular expression");
}
if (escaped) {
escaped = false;
} else {
if (ch === "[") {
inClass = true;
} else if (ch === "]" && inClass) {
inClass = false;
} else if (ch === "/" && !inClass) {
break;
}
escaped = ch === "\\";
}
++this.state.pos;
}
var content = this.input.slice(start, this.state.pos);
++this.state.pos;
var mods = this.readWord1();
if (mods) {
var validFlags = /^[gmsiyu]*$/;
if (!validFlags.test(mods))
this.raise(start, "Invalid regular expression flag");
}
return this.finishToken(_types.types.regexp, {
pattern: content,
flags: mods
});
};
Tokenizer.prototype.readInt = function readInt(radix, len) {
var start = this.state.pos,
total = 0;
for (var i = 0,
e = len == null ? Infinity : len; i < e; ++i) {
var code = this.input.charCodeAt(this.state.pos),
val = undefined;
if (code >= 97) {
val = code - 97 + 10;
} else if (code >= 65) {
val = code - 65 + 10;
} else if (code >= 48 && code <= 57) {
val = code - 48;
} else {
val = Infinity;
}
if (val >= radix)
break;
++this.state.pos;
total = total * radix + val;
}
if (this.state.pos === start || len != null && this.state.pos - start !== len)
return null;
return total;
};
Tokenizer.prototype.readRadixNumber = function readRadixNumber(radix) {
this.state.pos += 2;
var val = this.readInt(radix);
if (val == null)
this.raise(this.state.start + 2, "Expected number in radix " + radix);
if (_utilIdentifier.isIdentifierStart(this.fullCharCodeAtPos()))
this.raise(this.state.pos, "Identifier directly after number");
return this.finishToken(_types.types.num, val);
};
Tokenizer.prototype.readNumber = function readNumber(startsWithDot) {
var start = this.state.pos,
isFloat = false,
octal = this.input.charCodeAt(this.state.pos) === 48;
if (!startsWithDot && this.readInt(10) === null)
this.raise(start, "Invalid number");
var next = this.input.charCodeAt(this.state.pos);
if (next === 46) {
++this.state.pos;
this.readInt(10);
isFloat = true;
next = this.input.charCodeAt(this.state.pos);
}
if (next === 69 || next === 101) {
next = this.input.charCodeAt(++this.state.pos);
if (next === 43 || next === 45)
++this.state.pos;
if (this.readInt(10) === null)
this.raise(start, "Invalid number");
isFloat = true;
}
if (_utilIdentifier.isIdentifierStart(this.fullCharCodeAtPos()))
this.raise(this.state.pos, "Identifier directly after number");
var str = this.input.slice(start, this.state.pos),
val = undefined;
if (isFloat) {
val = parseFloat(str);
} else if (!octal || str.length === 1) {
val = parseInt(str, 10);
} else if (/[89]/.test(str) || this.state.strict) {
this.raise(start, "Invalid number");
} else {
val = parseInt(str, 8);
}
return this.finishToken(_types.types.num, val);
};
Tokenizer.prototype.readCodePoint = function readCodePoint() {
var ch = this.input.charCodeAt(this.state.pos),
code = undefined;
if (ch === 123) {
var codePos = ++this.state.pos;
code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos);
++this.state.pos;
if (code > 0x10FFFF)
this.raise(codePos, "Code point out of bounds");
} else {
code = this.readHexChar(4);
}
return code;
};
Tokenizer.prototype.readString = function readString(quote) {
var out = "",
chunkStart = ++this.state.pos;
for (; ; ) {
if (this.state.pos >= this.input.length)
this.raise(this.state.start, "Unterminated string constant");
var ch = this.input.charCodeAt(this.state.pos);
if (ch === quote)
break;
if (ch === 92) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.readEscapedChar(false);
chunkStart = this.state.pos;
} else {
if (_utilWhitespace.isNewLine(ch))
this.raise(this.state.start, "Unterminated string constant");
++this.state.pos;
}
}
out += this.input.slice(chunkStart, this.state.pos++);
return this.finishToken(_types.types.string, out);
};
Tokenizer.prototype.readTmplToken = function readTmplToken() {
var out = "",
chunkStart = this.state.pos;
for (; ; ) {
if (this.state.pos >= this.input.length)
this.raise(this.state.start, "Unterminated template");
var ch = this.input.charCodeAt(this.state.pos);
if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {
if (this.state.pos === this.state.start && this.match(_types.types.template)) {
if (ch === 36) {
this.state.pos += 2;
return this.finishToken(_types.types.dollarBraceL);
} else {
++this.state.pos;
return this.finishToken(_types.types.backQuote);
}
}
out += this.input.slice(chunkStart, this.state.pos);
return this.finishToken(_types.types.template, out);
}
if (ch === 92) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.readEscapedChar(true);
chunkStart = this.state.pos;
} else if (_utilWhitespace.isNewLine(ch)) {
out += this.input.slice(chunkStart, this.state.pos);
++this.state.pos;
switch (ch) {
case 13:
if (this.input.charCodeAt(this.state.pos) === 10)
++this.state.pos;
case 10:
out += "\n";
break;
default:
out += String.fromCharCode(ch);
break;
}
++this.state.curLine;
this.state.lineStart = this.state.pos;
chunkStart = this.state.pos;
} else {
++this.state.pos;
}
}
};
Tokenizer.prototype.readEscapedChar = function readEscapedChar(inTemplate) {
var ch = this.input.charCodeAt(++this.state.pos);
++this.state.pos;
switch (ch) {
case 110:
return "\n";
case 114:
return "\r";
case 120:
return String.fromCharCode(this.readHexChar(2));
case 117:
return codePointToString(this.readCodePoint());
case 116:
return "\t";
case 98:
return "\b";
case 118:
return "\u000b";
case 102:
return "\f";
case 13:
if (this.input.charCodeAt(this.state.pos) === 10)
++this.state.pos;
case 10:
this.state.lineStart = this.state.pos;
++this.state.curLine;
return "";
default:
if (ch >= 48 && ch <= 55) {
var octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0];
var octal = parseInt(octalStr, 8);
if (octal > 255) {
octalStr = octalStr.slice(0, -1);
octal = parseInt(octalStr, 8);
}
if (octal > 0) {
if (!this.state.containsOctal) {
this.state.containsOctal = true;
this.state.octalPosition = this.state.pos - 2;
}
if (this.state.strict || inTemplate) {
this.raise(this.state.pos - 2, "Octal literal in strict mode");
}
}
this.state.pos += octalStr.length - 1;
return String.fromCharCode(octal);
}
return String.fromCharCode(ch);
}
};
Tokenizer.prototype.readHexChar = function readHexChar(len) {
var codePos = this.state.pos;
var n = this.readInt(16, len);
if (n === null)
this.raise(codePos, "Bad character escape sequence");
return n;
};
Tokenizer.prototype.readWord1 = function readWord1() {
this.state.containsEsc = false;
var word = "",
first = true,
chunkStart = this.state.pos;
while (this.state.pos < this.input.length) {
var ch = this.fullCharCodeAtPos();
if (_utilIdentifier.isIdentifierChar(ch)) {
this.state.pos += ch <= 0xffff ? 1 : 2;
} else if (ch === 92) {
this.state.containsEsc = true;
word += this.input.slice(chunkStart, this.state.pos);
var escStart = this.state.pos;
if (this.input.charCodeAt(++this.state.pos) !== 117) {
this.raise(this.state.pos, "Expecting Unicode escape sequence \\uXXXX");
}
++this.state.pos;
var esc = this.readCodePoint();
if (!(first ? _utilIdentifier.isIdentifierStart : _utilIdentifier.isIdentifierChar)(esc, true)) {
this.raise(escStart, "Invalid Unicode escape");
}
word += codePointToString(esc);
chunkStart = this.state.pos;
} else {
break;
}
first = false;
}
return word + this.input.slice(chunkStart, this.state.pos);
};
Tokenizer.prototype.readWord = function readWord() {
var word = this.readWord1();
var type = _types.types.name;
if (!this.state.containsEsc && this.isKeyword(word)) {
type = _types.keywords[word];
}
return this.finishToken(type, word);
};
Tokenizer.prototype.braceIsBlock = function braceIsBlock(prevType) {
if (prevType === _types.types.colon) {
var _parent = this.curContext();
if (_parent === _context.types.b_stat || _parent === _context.types.b_expr) {
return !_parent.isExpr;
}
}
if (prevType === _types.types._return) {
return _utilWhitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
}
if (prevType === _types.types._else || prevType === _types.types.semi || prevType === _types.types.eof || prevType === _types.types.parenR) {
return true;
}
if (prevType === _types.types.braceL) {
return this.curContext() === _context.types.b_stat;
}
return !this.state.exprAllowed;
};
Tokenizer.prototype.updateContext = function updateContext(prevType) {
var update = undefined,
type = this.state.type;
if (type.keyword && prevType === _types.types.dot) {
this.state.exprAllowed = false;
} else if (update = type.updateContext) {
update.call(this, prevType);
} else {
this.state.exprAllowed = type.beforeExpr;
}
};
return Tokenizer;
})();
exports["default"] = Tokenizer;
}, {
"../util/identifier": 18,
"../util/location": 19,
"../util/whitespace": 20,
"./context": 14,
"./state": 16,
"./types": 17,
"babel-runtime/helpers/class-call-check": 24,
"babel-runtime/helpers/interop-require-default": 26
}],
16: [function(require, module, exports) {
"use strict";
var _classCallCheck = require('babel-runtime/helpers/class-call-check')["default"];
exports.__esModule = true;
var _utilLocation = require('../util/location');
var _context = require('./context');
var _types = require('./types');
var State = (function() {
function State() {
_classCallCheck(this, State);
}
State.prototype.init = function init(options, input) {
this.strict = options.strictMode === false ? false : options.sourceType === "module";
this.input = input;
this.potentialArrowAt = -1;
this.inMethod = this.inFunction = this.inGenerator = this.inAsync = false;
this.labels = [];
this.decorators = [];
this.tokens = [];
this.comments = [];
this.trailingComments = [];
this.leadingComments = [];
this.commentStack = [];
this.pos = this.lineStart = 0;
this.curLine = 1;
this.type = _types.types.eof;
this.value = null;
this.start = this.end = this.pos;
this.startLoc = this.endLoc = this.curPosition();
this.lastTokEndLoc = this.lastTokStartLoc = null;
this.lastTokStart = this.lastTokEnd = this.pos;
this.context = [_context.types.b_stat];
this.exprAllowed = true;
this.containsEsc = this.containsOctal = false;
this.octalPosition = null;
return this;
};
State.prototype.curPosition = function curPosition() {
return new _utilLocation.Position(this.curLine, this.pos - this.lineStart);
};
State.prototype.clone = function clone(skipArrays) {
var state = new State();
for (var key in this) {
var val = this[key];
if ((!skipArrays || key === "context") && Array.isArray(val)) {
val = val.slice();
}
state[key] = val;
}
return state;
};
return State;
})();
exports["default"] = State;
module.exports = exports["default"];
}, {
"../util/location": 19,
"./context": 14,
"./types": 17,
"babel-runtime/helpers/class-call-check": 24
}],
17: [function(require, module, exports) {
"use strict";
var _classCallCheck = require('babel-runtime/helpers/class-call-check')["default"];
exports.__esModule = true;
var TokenType = function TokenType(label) {
var conf = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
_classCallCheck(this, TokenType);
this.label = label;
this.keyword = conf.keyword;
this.beforeExpr = !!conf.beforeExpr;
this.startsExpr = !!conf.startsExpr;
this.rightAssociative = !!conf.rightAssociative;
this.isLoop = !!conf.isLoop;
this.isAssign = !!conf.isAssign;
this.prefix = !!conf.prefix;
this.postfix = !!conf.postfix;
this.binop = conf.binop || null;
this.updateContext = null;
};
exports.TokenType = TokenType;
function binop(name, prec) {
return new TokenType(name, {
beforeExpr: true,
binop: prec
});
}
var beforeExpr = {beforeExpr: true},
startsExpr = {startsExpr: true};
var types = {
num: new TokenType("num", startsExpr),
regexp: new TokenType("regexp", startsExpr),
string: new TokenType("string", startsExpr),
name: new TokenType("name", startsExpr),
eof: new TokenType("eof"),
bracketL: new TokenType("[", {
beforeExpr: true,
startsExpr: true
}),
bracketR: new TokenType("]"),
braceL: new TokenType("{", {
beforeExpr: true,
startsExpr: true
}),
braceR: new TokenType("}"),
parenL: new TokenType("(", {
beforeExpr: true,
startsExpr: true
}),
parenR: new TokenType(")"),
comma: new TokenType(",", beforeExpr),
semi: new TokenType(";", beforeExpr),
colon: new TokenType(":", beforeExpr),
doubleColon: new TokenType("::", beforeExpr),
dot: new TokenType("."),
question: new TokenType("?", beforeExpr),
arrow: new TokenType("=>", beforeExpr),
template: new TokenType("template"),
ellipsis: new TokenType("...", beforeExpr),
backQuote: new TokenType("`", startsExpr),
dollarBraceL: new TokenType("${", {
beforeExpr: true,
startsExpr: true
}),
at: new TokenType("@"),
eq: new TokenType("=", {
beforeExpr: true,
isAssign: true
}),
assign: new TokenType("_=", {
beforeExpr: true,
isAssign: true
}),
incDec: new TokenType("++/--", {
prefix: true,
postfix: true,
startsExpr: true
}),
prefix: new TokenType("prefix", {
beforeExpr: true,
prefix: true,
startsExpr: true
}),
logicalOR: binop("||", 1),
logicalAND: binop("&&", 2),
bitwiseOR: binop("|", 3),
bitwiseXOR: binop("^", 4),
bitwiseAND: binop("&", 5),
equality: binop("==/!=", 6),
relational: binop("</>", 7),
bitShift: binop("<</>>", 8),
plusMin: new TokenType("+/-", {
beforeExpr: true,
binop: 9,
prefix: true,
startsExpr: true
}),
modulo: binop("%", 10),
star: binop("*", 10),
slash: binop("/", 10),
exponent: new TokenType("**", {
beforeExpr: true,
binop: 11,
rightAssociative: true
})
};
exports.types = types;
var keywords = {};
exports.keywords = keywords;
function kw(name) {
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
options.keyword = name;
keywords[name] = types["_" + name] = new TokenType(name, options);
}
kw("break");
kw("case", beforeExpr);
kw("catch");
kw("continue");
kw("debugger");
kw("default", beforeExpr);
kw("do", {
isLoop: true,
beforeExpr: true
});
kw("else", beforeExpr);
kw("finally");
kw("for", {isLoop: true});
kw("function", startsExpr);
kw("if");
kw("return", beforeExpr);
kw("switch");
kw("throw", beforeExpr);
kw("try");
kw("var");
kw("let");
kw("const");
kw("while", {isLoop: true});
kw("with");
kw("new", {
beforeExpr: true,
startsExpr: true
});
kw("this", startsExpr);
kw("super", startsExpr);
kw("class");
kw("extends", beforeExpr);
kw("export");
kw("import");
kw("yield", {
beforeExpr: true,
startsExpr: true
});
kw("null", startsExpr);
kw("true", startsExpr);
kw("false", startsExpr);
kw("in", {
beforeExpr: true,
binop: 7
});
kw("instanceof", {
beforeExpr: true,
binop: 7
});
kw("typeof", {
beforeExpr: true,
prefix: true,
startsExpr: true
});
kw("void", {
beforeExpr: true,
prefix: true,
startsExpr: true
});
kw("delete", {
beforeExpr: true,
prefix: true,
startsExpr: true
});
}, {"babel-runtime/helpers/class-call-check": 24}],
18: [function(require, module, exports) {
"use strict";
exports.__esModule = true;
exports.isIdentifierStart = isIdentifierStart;
exports.isIdentifierChar = isIdentifierChar;
function makePredicate(words) {
words = words.split(" ");
return function(str) {
return words.indexOf(str) >= 0;
};
}
var reservedWords = {
6: makePredicate("enum await"),
strict: makePredicate("implements interface let package private protected public static yield"),
strictBind: makePredicate("eval arguments")
};
exports.reservedWords = reservedWords;
var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super");
exports.isKeyword = isKeyword;
var nonASCIIidentifierStartChars = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
var nonASCIIidentifierChars = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_";
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 99, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 98, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 955, 52, 76, 44, 33, 24, 27, 35, 42, 34, 4, 0, 13, 47, 15, 3, 22, 0, 38, 17, 2, 24, 133, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 32, 4, 287, 47, 21, 1, 2, 0, 185, 46, 82, 47, 21, 0, 60, 42, 502, 63, 32, 0, 449, 56, 1288, 920, 104, 110, 2962, 1070, 13266, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 16481, 1, 3071, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 4149, 196, 1340, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 16355, 541];
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 16, 9, 83, 11, 168, 11, 6, 9, 8, 2, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 316, 19, 13, 9, 214, 6, 3, 8, 112, 16, 16, 9, 82, 12, 9, 9, 535, 9, 20855, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 4305, 6, 792618, 239];
function isInAstralSet(code, set) {
var pos = 0x10000;
for (var i = 0; i < set.length; i += 2) {
pos += set[i];
if (pos > code)
return false;
pos += set[i + 1];
if (pos >= code)
return true;
}
}
function isIdentifierStart(code) {
if (code < 65)
return code === 36;
if (code < 91)
return true;
if (code < 97)
return code === 95;
if (code < 123)
return true;
if (code <= 0xffff)
return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
return isInAstralSet(code, astralIdentifierStartCodes);
}
function isIdentifierChar(code) {
if (code < 48)
return code === 36;
if (code < 58)
return true;
if (code < 65)
return false;
if (code < 91)
return true;
if (code < 97)
return code === 95;
if (code < 123)
return true;
if (code <= 0xffff)
return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
}
}, {}],
19: [function(require, module, exports) {
"use strict";
var _classCallCheck = require('babel-runtime/helpers/class-call-check')["default"];
exports.__esModule = true;
exports.getLineInfo = getLineInfo;
var _whitespace = require('./whitespace');
var Position = function Position(line, col) {
_classCallCheck(this, Position);
this.line = line;
this.column = col;
};
exports.Position = Position;
var SourceLocation = function SourceLocation(start, end) {
_classCallCheck(this, SourceLocation);
this.start = start;
this.end = end;
};
;
exports.SourceLocation = SourceLocation;
function getLineInfo(input, offset) {
for (var line = 1,
cur = 0; ; ) {
_whitespace.lineBreakG.lastIndex = cur;
var match = _whitespace.lineBreakG.exec(input);
if (match && match.index < offset) {
++line;
cur = match.index + match[0].length;
} else {
return new Position(line, offset - cur);
}
}
}
}, {
"./whitespace": 20,
"babel-runtime/helpers/class-call-check": 24
}],
20: [function(require, module, exports) {
"use strict";
exports.__esModule = true;
exports.isNewLine = isNewLine;
var lineBreak = /\r\n?|\n|\u2028|\u2029/;
exports.lineBreak = lineBreak;
var lineBreakG = new RegExp(lineBreak.source, "g");
exports.lineBreakG = lineBreakG;
function isNewLine(code) {
return code === 10 || code === 13 || code === 0x2028 || code === 0x2029;
}
var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
exports.nonASCIIwhitespace = nonASCIIwhitespace;
}, {}],
21: [function(require, module, exports) {
module.exports = {
"default": require('core-js/library/fn/get-iterator'),
__esModule: true
};
}, {"core-js/library/fn/get-iterator": 27}],
22: [function(require, module, exports) {
module.exports = {
"default": require('core-js/library/fn/object/create'),
__esModule: true
};
}, {"core-js/library/fn/object/create": 28}],
23: [function(require, module, exports) {
module.exports = {
"default": require('core-js/library/fn/object/set-prototype-of'),
__esModule: true
};
}, {"core-js/library/fn/object/set-prototype-of": 29}],
24: [function(require, module, exports) {
"use strict";
exports["default"] = function(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
exports.__esModule = true;
}, {}],
25: [function(require, module, exports) {
"use strict";
var _Object$create = require('babel-runtime/core-js/object/create')["default"];
var _Object$setPrototypeOf = require('babel-runtime/core-js/object/set-prototype-of')["default"];
exports["default"] = function(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
subClass.prototype = _Object$create(superClass && superClass.prototype, {constructor: {
value: subClass,
enumerable: false,
writable: true,
configurable: true
}});
if (superClass)
_Object$setPrototypeOf ? _Object$setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};
exports.__esModule = true;
}, {
"babel-runtime/core-js/object/create": 22,
"babel-runtime/core-js/object/set-prototype-of": 23
}],
26: [function(require, module, exports) {
"use strict";
exports["default"] = function(obj) {
return obj && obj.__esModule ? obj : {"default": obj};
};
exports.__esModule = true;
}, {}],
27: [function(require, module, exports) {
require('../modules/web.dom.iterable');
require('../modules/es6.string.iterator');
module.exports = require('../modules/core.get-iterator');
}, {
"../modules/core.get-iterator": 63,
"../modules/es6.string.iterator": 66,
"../modules/web.dom.iterable": 67
}],
28: [function(require, module, exports) {
var $ = require('../../modules/$');
module.exports = function create(P, D) {
return $.create(P, D);
};
}, {"../../modules/$": 50}],
29: [function(require, module, exports) {
require('../../modules/es6.object.set-prototype-of');
module.exports = require('../../modules/$.core').Object.setPrototypeOf;
}, {
"../../modules/$.core": 35,
"../../modules/es6.object.set-prototype-of": 65
}],
30: [function(require, module, exports) {
module.exports = function(it) {
if (typeof it != 'function')
throw TypeError(it + ' is not a function!');
return it;
};
}, {}],
31: [function(require, module, exports) {
module.exports = function() {};
}, {}],
32: [function(require, module, exports) {
var isObject = require('./$.is-object');
module.exports = function(it) {
if (!isObject(it))
throw TypeError(it + ' is not an object!');
return it;
};
}, {"./$.is-object": 45}],
33: [function(require, module, exports) {
var cof = require('./$.cof'),
TAG = require('./$.wks')('toStringTag'),
ARG = cof(function() {
return arguments;
}()) == 'Arguments';
module.exports = function(it) {
var O,
T,
B;
return it === undefined ? 'Undefined' : it === null ? 'Null' : typeof(T = (O = Object(it))[TAG]) == 'string' ? T : ARG ? cof(O) : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
}, {
"./$.cof": 34,
"./$.wks": 61
}],
34: [function(require, module, exports) {
var toString = {}.toString;
module.exports = function(it) {
return toString.call(it).slice(8, -1);
};
}, {}],
35: [function(require, module, exports) {
var core = module.exports = {version: '1.2.6'};
if (typeof __e == 'number')
__e = core;
}, {}],
36: [function(require, module, exports) {
var aFunction = require('./$.a-function');
module.exports = function(fn, that, length) {
aFunction(fn);
if (that === undefined)
return fn;
switch (length) {
case 1:
return function(a) {
return fn.call(that, a);
};
case 2:
return function(a, b) {
return fn.call(that, a, b);
};
case 3:
return function(a, b, c) {
return fn.call(that, a, b, c);
};
}
return function() {
return fn.apply(that, arguments);
};
};
}, {"./$.a-function": 30}],
37: [function(require, module, exports) {
module.exports = function(it) {
if (it == undefined)
throw TypeError("Can't call method on " + it);
return it;
};
}, {}],
38: [function(require, module, exports) {
module.exports = !require('./$.fails')(function() {
return Object.defineProperty({}, 'a', {get: function() {
return 7;
}}).a != 7;
});
}, {"./$.fails": 40}],
39: [function(require, module, exports) {
var global = require('./$.global'),
core = require('./$.core'),
ctx = require('./$.ctx'),
PROTOTYPE = 'prototype';
var $export = function(type, name, source) {
var IS_FORCED = type & $export.F,
IS_GLOBAL = type & $export.G,
IS_STATIC = type & $export.S,
IS_PROTO = type & $export.P,
IS_BIND = type & $export.B,
IS_WRAP = type & $export.W,
exports = IS_GLOBAL ? core : core[name] || (core[name] = {}),
target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE],
key,
own,
out;
if (IS_GLOBAL)
source = name;
for (key in source) {
own = !IS_FORCED && target && key in target;
if (own && key in exports)
continue;
out = own ? target[key] : source[key];
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] : IS_BIND && own ? ctx(out, global) : IS_WRAP && target[key] == out ? (function(C) {
var F = function(param) {
return this instanceof C ? new C(param) : C(param);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
if (IS_PROTO)
(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;
}
};
$export.F = 1;
$export.G = 2;
$export.S = 4;
$export.P = 8;
$export.B = 16;
$export.W = 32;
module.exports = $export;
}, {
"./$.core": 35,
"./$.ctx": 36,
"./$.global": 41
}],
40: [function(require, module, exports) {
module.exports = function(exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
}, {}],
41: [function(require, module, exports) {
var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
if (typeof __g == 'number')
__g = global;
}, {}],
42: [function(require, module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function(it, key) {
return hasOwnProperty.call(it, key);
};
}, {}],
43: [function(require, module, exports) {
var $ = require('./$'),
createDesc = require('./$.property-desc');
module.exports = require('./$.descriptors') ? function(object, key, value) {
return $.setDesc(object, key, createDesc(1, value));
} : function(object, key, value) {
object[key] = value;
return object;
};
}, {
"./$": 50,
"./$.descriptors": 38,
"./$.property-desc": 52
}],
44: [function(require, module, exports) {
var cof = require('./$.cof');
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it) {
return cof(it) == 'String' ? it.split('') : Object(it);
};
}, {"./$.cof": 34}],
45: [function(require, module, exports) {
module.exports = function(it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
}, {}],
46: [function(require, module, exports) {
'use strict';
var $ = require('./$'),
descriptor = require('./$.property-desc'),
setToStringTag = require('./$.set-to-string-tag'),
IteratorPrototype = {};
require('./$.hide')(IteratorPrototype, require('./$.wks')('iterator'), function() {
return this;
});
module.exports = function(Constructor, NAME, next) {
Constructor.prototype = $.create(IteratorPrototype, {next: descriptor(1, next)});
setToStringTag(Constructor, NAME + ' Iterator');
};
}, {
"./$": 50,
"./$.hide": 43,
"./$.property-desc": 52,
"./$.set-to-string-tag": 55,
"./$.wks": 61
}],
47: [function(require, module, exports) {
'use strict';
var LIBRARY = require('./$.library'),
$export = require('./$.export'),
redefine = require('./$.redefine'),
hide = require('./$.hide'),
has = require('./$.has'),
Iterators = require('./$.iterators'),
$iterCreate = require('./$.iter-create'),
setToStringTag = require('./$.set-to-string-tag'),
getProto = require('./$').getProto,
ITERATOR = require('./$.wks')('iterator'),
BUGGY = !([].keys && 'next' in [].keys()),
FF_ITERATOR = '@@iterator',
KEYS = 'keys',
VALUES = 'values';
var returnThis = function() {
return this;
};
module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
$iterCreate(Constructor, NAME, next);
var getMethod = function(kind) {
if (!BUGGY && kind in proto)
return proto[kind];
switch (kind) {
case KEYS:
return function keys() {
return new Constructor(this, kind);
};
case VALUES:
return function values() {
return new Constructor(this, kind);
};
}
return function entries() {
return new Constructor(this, kind);
};
};
var TAG = NAME + ' Iterator',
DEF_VALUES = DEFAULT == VALUES,
VALUES_BUG = false,
proto = Base.prototype,
$native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT],
$default = $native || getMethod(DEFAULT),
methods,
key;
if ($native) {
var IteratorPrototype = getProto($default.call(new Base));
setToStringTag(IteratorPrototype, TAG, true);
if (!LIBRARY && has(proto, FF_ITERATOR))
hide(IteratorPrototype, ITERATOR, returnThis);
if (DEF_VALUES && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() {
return $native.call(this);
};
}
}
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
hide(proto, ITERATOR, $default);
}
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: !DEF_VALUES ? $default : getMethod('entries')
};
if (FORCED)
for (key in methods) {
if (!(key in proto))
redefine(proto, key, methods[key]);
}
else
$export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
}, {
"./$": 50,
"./$.export": 39,
"./$.has": 42,
"./$.hide": 43,
"./$.iter-create": 46,
"./$.iterators": 49,
"./$.library": 51,
"./$.redefine": 53,
"./$.set-to-string-tag": 55,
"./$.wks": 61
}],
48: [function(require, module, exports) {
module.exports = function(done, value) {
return {
value: value,
done: !!done
};
};
}, {}],
49: [function(require, module, exports) {
module.exports = {};
}, {}],
50: [function(require, module, exports) {
var $Object = Object;
module.exports = {
create: $Object.create,
getProto: $Object.getPrototypeOf,
isEnum: {}.propertyIsEnumerable,
getDesc: $Object.getOwnPropertyDescriptor,
setDesc: $Object.defineProperty,
setDescs: $Object.defineProperties,
getKeys: $Object.keys,
getNames: $Object.getOwnPropertyNames,
getSymbols: $Object.getOwnPropertySymbols,
each: [].forEach
};
}, {}],
51: [function(require, module, exports) {
module.exports = true;
}, {}],
52: [function(require, module, exports) {
module.exports = function(bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
}, {}],
53: [function(require, module, exports) {
module.exports = require('./$.hide');
}, {"./$.hide": 43}],
54: [function(require, module, exports) {
var getDesc = require('./$').getDesc,
isObject = require('./$.is-object'),
anObject = require('./$.an-object');
var check = function(O, proto) {
anObject(O);
if (!isObject(proto) && proto !== null)
throw TypeError(proto + ": can't set as prototype!");
};
module.exports = {
set: Object.setPrototypeOf || ('__proto__' in {} ? function(test, buggy, set) {
try {
set = require('./$.ctx')(Function.call, getDesc(Object.prototype, '__proto__').set, 2);
set(test, []);
buggy = !(test instanceof Array);
} catch (e) {
buggy = true;
}
return function setPrototypeOf(O, proto) {
check(O, proto);
if (buggy)
O.__proto__ = proto;
else
set(O, proto);
return O;
};
}({}, false) : undefined),
check: check
};
}, {
"./$": 50,
"./$.an-object": 32,
"./$.ctx": 36,
"./$.is-object": 45
}],
55: [function(require, module, exports) {
var def = require('./$').setDesc,
has = require('./$.has'),
TAG = require('./$.wks')('toStringTag');
module.exports = function(it, tag, stat) {
if (it && !has(it = stat ? it : it.prototype, TAG))
def(it, TAG, {
configurable: true,
value: tag
});
};
}, {
"./$": 50,
"./$.has": 42,
"./$.wks": 61
}],
56: [function(require, module, exports) {
var global = require('./$.global'),
SHARED = '__core-js_shared__',
store = global[SHARED] || (global[SHARED] = {});
module.exports = function(key) {
return store[key] || (store[key] = {});
};
}, {"./$.global": 41}],
57: [function(require, module, exports) {
var toInteger = require('./$.to-integer'),
defined = require('./$.defined');
module.exports = function(TO_STRING) {
return function(that, pos) {
var s = String(defined(that)),
i = toInteger(pos),
l = s.length,
a,
b;
if (i < 0 || i >= l)
return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
}, {
"./$.defined": 37,
"./$.to-integer": 58
}],
58: [function(require, module, exports) {
var ceil = Math.ceil,
floor = Math.floor;
module.exports = function(it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
}, {}],
59: [function(require, module, exports) {
var IObject = require('./$.iobject'),
defined = require('./$.defined');
module.exports = function(it) {
return IObject(defined(it));
};
}, {
"./$.defined": 37,
"./$.iobject": 44
}],
60: [function(require, module, exports) {
var id = 0,
px = Math.random();
module.exports = function(key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
}, {}],
61: [function(require, module, exports) {
var store = require('./$.shared')('wks'),
uid = require('./$.uid'),
Symbol = require('./$.global').Symbol;
module.exports = function(name) {
return store[name] || (store[name] = Symbol && Symbol[name] || (Symbol || uid)('Symbol.' + name));
};
}, {
"./$.global": 41,
"./$.shared": 56,
"./$.uid": 60
}],
62: [function(require, module, exports) {
var classof = require('./$.classof'),
ITERATOR = require('./$.wks')('iterator'),
Iterators = require('./$.iterators');
module.exports = require('./$.core').getIteratorMethod = function(it) {
if (it != undefined)
return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)];
};
}, {
"./$.classof": 33,
"./$.core": 35,
"./$.iterators": 49,
"./$.wks": 61
}],
63: [function(require, module, exports) {
var anObject = require('./$.an-object'),
get = require('./core.get-iterator-method');
module.exports = require('./$.core').getIterator = function(it) {
var iterFn = get(it);
if (typeof iterFn != 'function')
throw TypeError(it + ' is not iterable!');
return anObject(iterFn.call(it));
};
}, {
"./$.an-object": 32,
"./$.core": 35,
"./core.get-iterator-method": 62
}],
64: [function(require, module, exports) {
'use strict';
var addToUnscopables = require('./$.add-to-unscopables'),
step = require('./$.iter-step'),
Iterators = require('./$.iterators'),
toIObject = require('./$.to-iobject');
module.exports = require('./$.iter-define')(Array, 'Array', function(iterated, kind) {
this._t = toIObject(iterated);
this._i = 0;
this._k = kind;
}, function() {
var O = this._t,
kind = this._k,
index = this._i++;
if (!O || index >= O.length) {
this._t = undefined;
return step(1);
}
if (kind == 'keys')
return step(0, index);
if (kind == 'values')
return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
}, {
"./$.add-to-unscopables": 31,
"./$.iter-define": 47,
"./$.iter-step": 48,
"./$.iterators": 49,
"./$.to-iobject": 59
}],
65: [function(require, module, exports) {
var $export = require('./$.export');
$export($export.S, 'Object', {setPrototypeOf: require('./$.set-proto').set});
}, {
"./$.export": 39,
"./$.set-proto": 54
}],
66: [function(require, module, exports) {
'use strict';
var $at = require('./$.string-at')(true);
require('./$.iter-define')(String, 'String', function(iterated) {
this._t = String(iterated);
this._i = 0;
}, function() {
var O = this._t,
index = this._i,
point;
if (index >= O.length)
return {
value: undefined,
done: true
};
point = $at(O, index);
this._i += point.length;
return {
value: point,
done: false
};
});
}, {
"./$.iter-define": 47,
"./$.string-at": 57
}],
67: [function(require, module, exports) {
require('./es6.array.iterator');
var Iterators = require('./$.iterators');
Iterators.NodeList = Iterators.HTMLCollection = Iterators.Array;
}, {
"./$.iterators": 49,
"./es6.array.iterator": 64
}]
}, {}, [1])(1);
});
})(require('process'));
| 41.921911 | 1,235 | 0.520396 |
c60a26660717354be2e90e8ccafa5a82368faf27 | 155 | js | JavaScript | restrict/modules/ZendModels/data/structure/project_name/public/scripts/default.js | thewebmind/mind2.0 | 9c34bc5fbf687ff974cbf4c5e18757e3819ca7e6 | [
"MIT"
] | 1 | 2019-02-10T16:10:22.000Z | 2019-02-10T16:10:22.000Z | restrict/users/admin/temp/tchelinux/root/tchelinux/public/scripts/default.js | thewebmind/mind2.0 | 9c34bc5fbf687ff974cbf4c5e18757e3819ca7e6 | [
"MIT"
] | null | null | null | restrict/users/admin/temp/tchelinux/root/tchelinux/public/scripts/default.js | thewebmind/mind2.0 | 9c34bc5fbf687ff974cbf4c5e18757e3819ca7e6 | [
"MIT"
] | null | null | null | $(document).ready(function(){
$("#navigation").treeview({
persist: "location",
collapsed: true,
unique: true
});
$("#browser").treeview();
}); | 15.5 | 29 | 0.593548 |
c60a66ef8d70caad8cbe1db0ecfb9b136bdbfd1c | 4,324 | js | JavaScript | frontend/src/components/TicketActionButtons/index.js | ertprs/chatbox_clone | 3a9ea10402d6760f90f45b81302fb7fdd80eec93 | [
"MIT"
] | 2 | 2022-02-27T17:07:44.000Z | 2022-03-11T15:10:37.000Z | frontend/src/components/TicketActionButtons/index.js | ertprs/chatbox_clone | 3a9ea10402d6760f90f45b81302fb7fdd80eec93 | [
"MIT"
] | null | null | null | frontend/src/components/TicketActionButtons/index.js | ertprs/chatbox_clone | 3a9ea10402d6760f90f45b81302fb7fdd80eec93 | [
"MIT"
] | 1 | 2022-03-24T04:51:53.000Z | 2022-03-24T04:51:53.000Z | import React, { useContext, useState } from "react";
import { useHistory } from "react-router-dom";
import { makeStyles } from "@material-ui/core/styles";
import { IconButton } from "@material-ui/core";
import { MoreVert, Replay } from "@material-ui/icons";
import { i18n } from "../../translate/i18n";
import api from "../../services/api";
import TicketOptionsMenu from "../TicketOptionsMenu";
import ButtonWithSpinner from "../ButtonWithSpinner";
import toastError from "../../errors/toastError";
import { AuthContext } from "../../context/Auth/AuthContext";
import AcceptTicketWithouSelectQueue from "../AcceptTicketWithoutQueueModal";
const useStyles = makeStyles(theme => ({
actionButtons: {
marginRight: 6,
flex: "none",
alignSelf: "center",
marginLeft: "auto",
"& > *": {
margin: theme.spacing(1),
},
},
}));
const TicketActionButtons = ({ ticket }) => {
const classes = useStyles();
const history = useHistory();
const [anchorEl, setAnchorEl] = useState(null);
const [loading, setLoading] = useState(false);
const ticketOptionsMenuOpen = Boolean(anchorEl);
const { user } = useContext(AuthContext);
const [acceptTicketWithouSelectQueueOpen, setAcceptTicketWithouSelectQueueOpen] = useState(false);
const handleOpenTicketOptionsMenu = e => {
setAnchorEl(e.currentTarget);
};
const handleCloseTicketOptionsMenu = e => {
setAnchorEl(null);
};
const handleOpenAcceptTicketWithouSelectQueue = () => {
setAcceptTicketWithouSelectQueueOpen(true);
};
const handleUpdateTicketStatus = async (e, status, userId) => {
setLoading(true);
try {
await api.put(`/tickets/${ticket.id}`, {
status: status,
userId: userId || null,
});
setLoading(false);
if (status === "open") {
history.push(`/tickets/${ticket.id}`);
} else {
history.push("/tickets");
}
} catch (err) {
setLoading(false);
toastError(err);
}
};
return (
<div className={classes.actionButtons}>
{
<AcceptTicketWithouSelectQueue
modalOpen={acceptTicketWithouSelectQueueOpen}
onClose={(e) => setAcceptTicketWithouSelectQueueOpen(false)}
ticketId={ticket.id}
/>
}
{ticket.status === "closed" && (
<ButtonWithSpinner
loading={loading}
startIcon={<Replay />}
size="small"
onClick={e => handleUpdateTicketStatus(e, "open", user?.id)}
>
{i18n.t("messagesList.header.buttons.reopen")}
</ButtonWithSpinner>
)}
{ticket.status === "open" && (
<>
<ButtonWithSpinner
loading={loading}
startIcon={<Replay />}
size="small"
onClick={e => handleUpdateTicketStatus(e, "pending", null)}
>
{i18n.t("messagesList.header.buttons.return")}
</ButtonWithSpinner>
<ButtonWithSpinner
loading={loading}
size="small"
variant="contained"
color="primary"
onClick={e => handleUpdateTicketStatus(e, "closed", user?.id)}
>
{i18n.t("messagesList.header.buttons.resolve")}
</ButtonWithSpinner>
<IconButton onClick={handleOpenTicketOptionsMenu}>
<MoreVert />
</IconButton>
<TicketOptionsMenu
ticket={ticket}
anchorEl={anchorEl}
menuOpen={ticketOptionsMenuOpen}
handleClose={handleCloseTicketOptionsMenu}
/>
</>
)}
{(ticket.status === "pending" && ticket.queue !== null) && (
<ButtonWithSpinner
loading={loading}
size="small"
variant="contained"
color="primary"
onClick={e => handleUpdateTicketStatus(e, "open", user?.id)}
>
{i18n.t("messagesList.header.buttons.accept")}
</ButtonWithSpinner>
)}
{(ticket.status === "pending" && (ticket.queue === null || ticket.queue === undefined)) && (
<ButtonWithSpinner
loading={loading}
size="small"
variant="contained"
color="secondary"
onClick={e => handleOpenAcceptTicketWithouSelectQueue()}
>
{i18n.t("messagesList.header.buttons.acceptBeforeBot")}
</ButtonWithSpinner>
)}
{/* {ticket.status === "pending" && (
<ButtonWithSpinner
loading={loading}
size="small"
variant="contained"
color="primary"
onClick={e => handleUpdateTicketStatus(e, "open", user?.id)}
>
{i18n.t("messagesList.header.buttons.accept")}
</ButtonWithSpinner>
)} */}
</div>
);
};
export default TicketActionButtons;
| 27.541401 | 99 | 0.648705 |
c60aa4e4422f74f362981d9aedcc7f6cc93156dd | 30,304 | js | JavaScript | public/assets/js/user.js | jesseokeya/rachelle-website | 9553768ecee6fe5cad251cf6ba375aee9bec2adb | [
"0BSD"
] | null | null | null | public/assets/js/user.js | jesseokeya/rachelle-website | 9553768ecee6fe5cad251cf6ba375aee9bec2adb | [
"0BSD"
] | null | null | null | public/assets/js/user.js | jesseokeya/rachelle-website | 9553768ecee6fe5cad251cf6ba375aee9bec2adb | [
"0BSD"
] | null | null | null | var animationSpeed = 750;
var library = [];
$(document).ready(function(){
fillLibrary();
attachAnimations();
});
/* -----------------------------------------------------------------------------
FILL PAGE HTML
---------------------------------------------------------------------------*/
function fillLibrary() {
assembleData();
var classlist = ['left-side first','left-side','left-side','right-side','right-side','right-side last'];
for (i=0; i < library.length; i++) {
var book = library[i];
// add html for current book
var html = '<li class="book ' + classlist[0] + '">';
html += '<div class="cover"><img src="' + book.cover + '" /></div>';
html += '<div class="summary">';
html += '<h1>' + book.title + '</h1>';
html += '<h2>by ' + book.author + '</h2>';
html += '<p>' + book.abstract + '</p>';
html += '</div></li>';
$('.library').append(html);
// shift the classlist array for the next iteration
var cn = classlist.shift();
classlist.push(cn);
}
}
/* -----------------------------------------------------------------------------
ANIMATION
---------------------------------------------------------------------------*/
function attachAnimations() {
$('.book').click(function(){
if (!$(this).hasClass('selected')) {
selectAnimation($(this));
}
});
$('.book .cover').click(function(){
if ($(this).parent().hasClass('selected')) {
deselectAnimation($(this).parent());
}
});
}
function selectAnimation(obj) {
obj.addClass('selected');
// elements animating
var cover = obj.find('.cover');
var image = obj.find('.cover img');
var library = $('.library');
var summaryBG = $('.overlay-summary');
var summary = obj.find('.summary');
// animate book cover
cover.animate({
width: '300px',
height: '468px'
}, {
duration: animationSpeed
});
image.animate({
width: '280px',
height: '448px',
borderWidth: '10px'
},{
duration: animationSpeed
});
// add fix if the selected item is in the bottom row
if (isBtmRow()){
library.css('paddingBottom','234px');
}
// slide page so book always appears
positionTop();
// add background overlay
$('.overlay-page').show();
// locate summary overlay
var px = overlayVertPos();
summaryBG.css('left',px);
// animate summary elements
var ht = $('.content').height();
var pos = $('.book.selected').position();
var start = pos.top + 30; // 10px padding-top on .book + 20px padding of .summary
var speed = Math.round((animationSpeed/ht) * 450); // 450 is goal height
summaryBG.show().animate({
height: ht + 'px'
},{
duration: animationSpeed,
easing: 'linear',
step: function(now,fx){
if (now > start && fx.prop === "height"){
if(!summary.is(':animated') && summary.height() < 450){
summary.show().animate({
height: '450px'
},{
duration: speed,
easing: 'linear'
});
}
}
}
});
}
function deselectAnimation(obj) {
// elements animating
var cover = obj.find('.cover');
var image = obj.find('.cover img');
var library = $('.library');
var summaryBG = $('.overlay-summary');
var summary = obj.find('.summary');
// stop summary animation
summary.stop();
// animate book cover
cover.stop().animate({
width: '140px',
height: '224px'
},{
duration:animationSpeed
});
image.stop().animate({
width: '140px',
height: '224px',
borderWidth: '0px'
},{
duration: animationSpeed,
complete: function() {
obj.removeClass('selected');
}
});
// remove fix for bottom row, if present
library.stop().animate({
paddingBottom:'10px'
},{
duration: animationSpeed
});
// remove background overlay and summary
var ht = summaryBG.height();
var pos = $('.book.selected').position();
var start = pos.top + 480; //10px of top padding + 470px for .summary height + padding
var speed = Math.round((animationSpeed/ht) * summary.height());
summaryBG.stop().animate({
height: '0px'
},{
duration: animationSpeed,
easing: 'linear',
step: function(now,fx){
if (now < start && fx.prop === "height"){
if(!summary.is(':animated') && summary.height() > 0){
summary.animate({
height: '0px'
},{
duration: speed,
easing: 'linear',
complete: function(){
summary.hide();
}
});
}
}
},
complete: function(){
$('.overlay-page').hide();
summary.hide(); // catching this twice to insure for aborted animation
summaryBG.hide();
}
});
}
function isBtmRow() {
var pos = $('.book.selected').position();
var libHgt = $('.content').height();
if (libHgt-pos.top===254) { // this is current height of the book, plus 30 for padding on the book and library
return true;
} else {
return false;
}
}
function positionTop() {
var offset = $('.book.selected').offset();
var bTop = offset.top;
$('html, body').animate({ scrollTop: bTop }, animationSpeed);
}
function overlayVertPos() { // determines the vertical position for the summary overlay based on selection position
var pos = $('.book.selected').position();
switch(pos.left) {
case 0:
return '320px';
case 160:
return '320px';
case 320:
return '480px';
case 480:
return '0px';
case 640:
return '160px';
case 800:
return '160px';
default:
return false;
}
}
/* -----------------------------------------------------------------------------
BUILD LIBRARY ARRAY
---------------------------------------------------------------------------*/
function Book(cover,title,author,abstract) {
this.cover = cover;
this.title = title;
this.author = author;
this.abstract = abstract;
library.push(this);
}
function assembleData() {
var book;
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/aclockworkorange_zpsab4c6d1f.jpg','A Clockwork Orange','Anthony Burgess','A vicious fifteen-year-old “droog” is the central character of this 1963 classic, whose stark terror was captured in Stanley Kubrick’s magnificent film of the same title. In Anthony Burgess’s nightmare vision of the future, where criminals take over after dark, the story is told by the central character, Alex, who talks in a brutal invented slang that brilliantly renders his and his friends’ social pathology. A Clockwork Orange is a frightening fable about good and evil, and the meaning of human freedom. When the state undertakes to reform Alex—to “redeem” him—the novel asks, “At what cost?”');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/ageneraltheoryoflove_zps474669dd.jpg','A General Theory of Love','Thomas Lewis, M.D., Fari Amini, M.D., Richard Lannon, M.D.','A General Theory of Love draws on the latest scientific research to demonstrate that our nervous systems are not self-contained: from earliest childhood, our brains actually link with those of the people close to us, in a silent rhythm that alters the very structure of our brains, establishes life-long emotional patterns, and makes us, in large part, who we are. Explaining how relationships function, how parents shape their child’s developing self, how psychotherapy really works, and how our society dangerously flouts essential emotional laws, this is a work of rare passion and eloquence that will forever change the way you think about human intimacy.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/antoinesalphabet_zps82a0ad82.jpg','Antoine’s Alphabet','Jed Perl','Antoine Watteau, one of the most mysterious painters who ever lived, is the inspiration for this delightful investigation of the tangled relationship between art and life. Weaving together historical fact and personal reflections, the influential art critic Jed Perl reconstructs the amazing story of this pioneering bohemian artist who, although he died in 1721, when he was only thirty-six, has influenced innumerable painters and writers in the centuries since—and whose work continues to deepen our understanding of the place that love, friendship, and pleasure have in our daily lives.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/ataleofatub_zpsb1973de7.jpg','A Tale of a Tub','Jonathan Swift','Though the author has written a large Dedication, yet that being addressed to a Prince whom I am never likely to have the honour of being known to; a person, besides, as far as I can observe, not at all regarded or thought on by any of our present writers; and I being wholly free from that slavery which booksellers usually lie under to the caprices of authors, I think it a wise piece of presumption to inscribe these papers to your Lordship, and to implore your Lordship’s protection of them.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/bravenewworld_zps1c1e8179.jpg','Brave New World','Aldous Huxley','When the novel Brave New World first appeared in 1932, its shocking analysis of a scientific dictatorship seemed a projection into the remote future. Here, in one of the most important and fascinating books of his career, Aldous Huxley uses his tremendous knowledge of human relations to compare the modern-day world with his prophetic fantasy. He scrutinizes threats to humanity, such as overpopulation, propaganda, and chemical persuasion, and explains why we have found it virtually impossible to avoid them. Brave New World Revisited is a trenchant plea that humankind should educate itself for freedom before it is too late.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/centauridevice_zps1b5a0bf6.jpg','Centauri Device','M. John Harrison','John Truck was to outward appearances just another lowlife spaceship captain. But he was also the last of the Centaurans—or at least, half of him was—which meant that he was the only person who could operate the Centauri Device, a sentient bomb which might hold the key to settling a vicious space war. M. John Harrison’s classic novel turns the conventions of space opera on their head, and is written with the precision and brilliance for which is famed.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/charitygirl_zps18c5249f.jpg','Charity Girl','Michael Lowenthal','During World War I, seventeen-year-old Frieda Mintz secures a job at a Boston department store and strikes out on her own, escaping her repressive Jewish mother and marriage to a wealthy widower twice her age. Determined to find love on her own terms, she is intoxicated by her newfound freedom and the patriotic fervor of the day. That is, until a soldier reports her as his last sexual contact, sweeping her up in the government’s wartime crusade against venereal disease. Quarantined in a detention center, Frieda finds in the Home’s confines a group of brash, unforgettable women who help her see the way to a new kind of independence.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/dastgah_zpsbf49e229.jpg','Dastgah','Mark Mordue','Australian award-winning journalist Mark Mordue invites you on his world trip that ranges from a Rolling Stones concert in Istanbul to talking with mullahs and junkies in Tehran, and from a cricket match in Calcutta to an S&M bar in New York, in addition to many points in between. Mordue chronicles his year-long global journey with his girlfriend, Lisa Nicol, exploring countries most Americans never see as well as issues of world citizenship in the 21st century. Written in the tradition of literary journalism, Dastgah will take you to all kinds of places, across the world ... and inside yourself.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/kockroach_zps0ab7b696.jpg','Kockroach','Tyler Knox','It is the mid-1950s, and Kockroach, perfectly content with his life infesting a fleabag hotel off Times Square, awakens to discover that somehow he’s been transformed into, of all things, a human. A tragic turn of events, yes, but cockroaches are awesome coping machines, so Kockroach copes. Step by step, he learns the ways of man: how to walk, how to talk, and how to wear a jaunty brown fedora. Led by his primitive desires and insectile amorality, he navigates through the bizarre human realms of crime, business, politics, and sex. Will he find success or be squashed flat from above? Will he change humanity, or will humanity change him?');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/ladychatterleystrial_zps84a0877e.jpg','Lady Chatterley’s Trial','C.H. Rolph','In 1960, thirty years after D. H. Lawrence’s death, Penguin moved to publish his most provocative novel Lady Chatterley’s Lover for the first time. What followed was the most significant literary obscenity trial of the twentieth century, as Penguin called upon a string of expert witnesses including E. M. Forster and Sir Allen Lane to triumphantly defend the book’s literary merit, in a case that compellingly reflected the changing face of contemporary society.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/lastnightintwistedriver_zps047d8684.jpg','Last Night in Twisted River','John Irving','In 1954, in the cookhouse of a logging and sawmill settlement in northern New Hampshire, an anxious twelve-year-old boy mistakes the local constable’s girlfriend for a bear. Both the twelve-year-old and his father become fugitives, forced to run from Coos County—to Boston, to southern Vermont, to Toronto—pursued by the implacable constable. Their lone protector is a fiercely libertarian logger, once a river driver, who befriends them. In a story spanning five decades, Last Night in Twisted River depicts the recent half-century in the United States as “a living replica of Coos County, where lethal hatreds were generally permitted to run their course.”');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/leviathan_zps222025f9.jpg','Leviathan','Philip Hoare','From his childhood fascination with the gigantic models in London’s Natural History Museum to adult encounters with the wild animals themselves, Philip Hoare has been obsessed with these whales. Switching between human history and natural history, Leviathan is a gripping voyage of discovery into the heart of this obsession and the book that inspired it: Herman Melville’s Moby-Dick. Taking us deep into the whale’s domain, Philip Hoare shows us these mysterious animals as they have never been before.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/mylifeasatraitor_zpse8de4793.jpg','My Life as a Traitor','Zarah Ghahramani','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/security_zpsc5ff195f.jpg','Security','Stephen Amidon','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/silkparachute_zps61c86834.jpg','Silk Parachute','John McPhee','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/slowdownarthur_zps4eaf97f9.jpg','Slow Down Arthur, Stick to Thirty','Harland Miller','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/thealmondpicker_zps4cc6cd0f.jpg','The Almond Picker','Simonetta Agnello Hornby','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/thearchivist_zpscbaeee22.jpg','The Archivist','Martha Cooley','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/theassassinssong_zpsaff5afbe.jpg','The Assassin’s Song','M.G. Vassanji','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/thebirdcatcher_zps0267b773.jpg','The Bird Catcher','Laura Jacobs','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/thefortressofsolitude_zpsa4035a73.jpg','The Fortress of Solitude','Jonathan Lethem','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/thefountainhead_zps5ca1c605.jpg','The Fountainhead','Ayn Rand','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/thegirlwiththedragontattoo_zps8730fda0.jpg','The Girl with the Dragon Tattoo','Stieg Larsson','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/thekingdomofinfinitespace_zpsb60ebb59.jpg','The Kingdom of Infinite Space','Raymond Tallis','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/themasqueofreddeath_zps019a994d.jpg','The Masque of Red Death','Edgar Allan Poe','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/themelancholyofanatomy_zpseadc8295.jpg','The Melancholy of Anatomy','Shelley Jackson','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/thenoodlemaker_zps09a99dae.jpg','The Noodle Maker','Ma Jian','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/thenwecametotheend_zpsf1c2d00f.jpg','Then We Came to the End','Joshua Ferris','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/thesegraniteislands_zps157f8499.jpg','These Granite Islands','Sarah Stonich','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
book = new Book('http://i1274.photobucket.com/albums/y436/jabas1/toairishuman_zpsd5d366a7.jpg','To Air Is Human','Björn Türoque','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ultrices nisl lorem, at lacinia diam lobortis non. Integer et massa sed dui tincidunt sodales. Aenean id dictum augue, in iaculis enim. Etiam ornare ut nunc vitae iaculis. Morbi tristique porta imperdiet. Quisque vel magna id dui euismod ornare. Nunc sed magna massa. Donec consequat est ut nulla molestie mattis. Curabitur at accumsan neque, non sagittis lorem. Suspendisse molestie sapien in est consectetur porta. Phasellus eleifend pulvinar orci, vel suscipit eros sodales sed. Nam at lacinia libero. Phasellus faucibus dolor luctus, consectetur ante ut, tristique eros. Integer eleifend est urna.');
}
| 119.778656 | 864 | 0.730465 |
c60ab4ce7c797f4e6270cf63aef4274116c813ff | 1,264 | js | JavaScript | public/restrita/assets/js/page/multiple-upload.js | jacsonandreola/curso_site_anuncios | dcd4a055335b7b3088be30cc7bc44a847e21bfd1 | [
"MIT"
] | null | null | null | public/restrita/assets/js/page/multiple-upload.js | jacsonandreola/curso_site_anuncios | dcd4a055335b7b3088be30cc7bc44a847e21bfd1 | [
"MIT"
] | null | null | null | public/restrita/assets/js/page/multiple-upload.js | jacsonandreola/curso_site_anuncios | dcd4a055335b7b3088be30cc7bc44a847e21bfd1 | [
"MIT"
] | 1 | 2021-11-22T06:28:37.000Z | 2021-11-22T06:28:37.000Z | "use strict";
// DropzoneJS
if (window.Dropzone) {
Dropzone.autoDiscover = false;
}
var dropzone = new Dropzone("#mydropzone", {
url: "#"
});
var minSteps = 6,
maxSteps = 60,
timeBetweenSteps = 100,
bytesPerStep = 100000;
dropzone.uploadFiles = function (files) {
var self = this;
for (var i = 0; i < files.length; i++) {
var file = files[i];
totalSteps = Math.round(Math.min(maxSteps, Math.max(minSteps, file.size / bytesPerStep)));
for (var step = 0; step < totalSteps; step++) {
var duration = timeBetweenSteps * (step + 1);
setTimeout(function (file, totalSteps, step) {
return function () {
file.upload = {
progress: 100 * (step + 1) / totalSteps,
total: file.size,
bytesSent: (step + 1) * file.size / totalSteps
};
self.emit('uploadprogress', file, file.upload.progress, file.upload.bytesSent);
if (file.upload.progress == 100) {
file.status = Dropzone.SUCCESS;
self.emit("success", file, 'success', null);
self.emit("complete", file);
self.processQueue();
}
};
}(file, totalSteps, step), duration);
}
}
} | 27.478261 | 95 | 0.549842 |
c60adb4ea9ab1755c81d2ec8dae31e9719c86b19 | 639 | js | JavaScript | classwork/class8/desafio2/app.js | silvinabt87/coder-house | 693464197e9b0f1f8ca23f9f24f0fe6c465bb99e | [
"MIT"
] | null | null | null | classwork/class8/desafio2/app.js | silvinabt87/coder-house | 693464197e9b0f1f8ca23f9f24f0fe6c465bb99e | [
"MIT"
] | null | null | null | classwork/class8/desafio2/app.js | silvinabt87/coder-house | 693464197e9b0f1f8ca23f9f24f0fe6c465bb99e | [
"MIT"
] | null | null | null | const express=require('express')
const fs=require('fs')
const app= express()
const server= app.listen(8080, ()=>console.log('hola'))
app.engine('cte', (filePath, objectToReplace,callback)=>{
fs.readFile(filePath,(err,content)=>{
if(err) return callback(new Error(err))
const template=content.toString().replace("^^title$$", ''+objectToReplace.title).replace("^^message$$", ''+objectToReplace.message)
return callback(null,template)
})
})
app.set('views', './views')
app.set('view engine', 'cte')
app.get('/', (req,res)=>{
res.render('bienvenida', {
title: "Plantilla propia",
message: "hla plantilla"
})
}) | 30.428571 | 135 | 0.661972 |
c60b7e2d5eaa4d77354c257fb9a7d78df1616bfe | 1,590 | js | JavaScript | test/successfully_check_for_winner.js | slim12kg/Tutorial-Building-A-Betting-Smart-Contract-Interacting-With-A-Football-Oracle | 2b9af673f77cc6772f26c0d16b02e30ec4fe1d12 | [
"MIT"
] | 6 | 2018-04-12T22:50:04.000Z | 2021-04-29T16:31:09.000Z | test/successfully_check_for_winner.js | slim12kg/Tutorial-Building-A-Betting-Smart-Contract-Interacting-With-A-Football-Oracle | 2b9af673f77cc6772f26c0d16b02e30ec4fe1d12 | [
"MIT"
] | null | null | null | test/successfully_check_for_winner.js | slim12kg/Tutorial-Building-A-Betting-Smart-Contract-Interacting-With-A-Football-Oracle | 2b9af673f77cc6772f26c0d16b02e30ec4fe1d12 | [
"MIT"
] | 5 | 2018-09-28T03:17:44.000Z | 2021-11-15T05:11:38.000Z | const Contract = artifacts.require('./Game.sol');
let moment = require("moment");
contract('Check For Winner : ', async (accounts) => {
//Current timestamp
let now = moment().utc();
//Set start 10min from now & end time 1hr 40min from now
//considering a game is 90min
let start = now.add({minutes : 10}).unix();
let end = now.add({minutes: 100}).unix();
it('game has no winner', async () => {
let game = await Contract.new(start,end);
let winner = await game.winner();
assert.equal(winner,"");
});
it('game has as a winner', async () => {
let game = await Contract.new(start,end);
await game.endGame();
await game.getWinner({value: web3.toWei(0.1, "ether")});
// Wait for the callback to be invoked by oraclize and the event to be emitted
const logWhenBetClosed = promisifyLogWatch(game.BetClosed({ fromBlock: 'latest' }));
let log = await logWhenBetClosed;
assert.equal(log.event, 'BetClosed', 'BetClosed not emitted');
assert.equal(log.args.result, 'swansea');
}).timeout(0);
/**
* @credit https://github.com/AdamJLemmon
* Helper to wait for log emission.
* @param {Object} _event The event to wait for.
*/
function promisifyLogWatch(_event) {
return new Promise((resolve, reject) => {
_event.watch((error, log) => {
_event.stopWatching();
if (error !== null)
reject(error);
resolve(log);
});
});
}
});
| 28.392857 | 92 | 0.569182 |
c60bf14c7cdf4ddbc3a99ad8fba31727d3e9f2cf | 410 | js | JavaScript | app.js | kduxwr/electron-calculater | c3d36aee8fac5361de4eddb49f17e6755d344988 | [
"MIT"
] | null | null | null | app.js | kduxwr/electron-calculater | c3d36aee8fac5361de4eddb49f17e6755d344988 | [
"MIT"
] | 3 | 2020-06-09T09:01:06.000Z | 2021-05-11T00:37:27.000Z | app.js | kduxwr/electron-calculater | c3d36aee8fac5361de4eddb49f17e6755d344988 | [
"MIT"
] | null | null | null | const $ = require('jquery');
const {ipcRenderer} = require('electron');
$('.num').on('click', function () {
ipcRenderer.send('num', this.innerText);
});
$('.ope').on('click', function () {
ipcRenderer.send('ope', this.innerText);
});
$('.con').on('click', function () {
ipcRenderer.send('con', this.innerText);
});
ipcRenderer.on('render', (event, arg) => {
$('#output-text').text(arg);
}); | 22.777778 | 44 | 0.585366 |
c60bf439e07eb603d9ba633e9993121f3ea2fdb7 | 366 | js | JavaScript | src/utils/fontawesome.js | uchemukolo/personal-profile | 9c3fc4d163630abda2c01e250d416d470a9d289e | [
"MIT"
] | null | null | null | src/utils/fontawesome.js | uchemukolo/personal-profile | 9c3fc4d163630abda2c01e250d416d470a9d289e | [
"MIT"
] | null | null | null | src/utils/fontawesome.js | uchemukolo/personal-profile | 9c3fc4d163630abda2c01e250d416d470a9d289e | [
"MIT"
] | null | null | null | import { library } from "@fortawesome/fontawesome-svg-core";
import { fab } from "@fortawesome/free-brands-svg-icons";
import {
faEnvelope,
faLink,
faMapMarkerAlt,
} from "@fortawesome/free-solid-svg-icons";
library.add(fab, faEnvelope, faLink, faMapMarkerAlt);
// Now add the faCoffee icon to our library and we can use
// the string name 'coffee' in our app
| 33.272727 | 60 | 0.737705 |
c60c70115b5f3ec10848dcb1a3d7a0ecb57eeb61 | 3,743 | js | JavaScript | graphql-prisma-boilerplate/tests/utils/getClient.js | mallikarjuna-sharma/graphql_boilerplate | 7beaf492028ac872c67756c8b8c600fe318608d3 | [
"MIT"
] | 1 | 2019-01-27T23:04:36.000Z | 2019-01-27T23:04:36.000Z | tests/utils/getClient.js | crystal-rhodes/the-society | 905b37ef658af80c49446155b4d6d9b5a7fec46e | [
"MIT"
] | 2 | 2020-12-13T09:18:02.000Z | 2020-12-13T09:19:44.000Z | tests/utils/getClient.js | crystal-rhodes/the-society | 905b37ef658af80c49446155b4d6d9b5a7fec46e | [
"MIT"
] | null | null | null | import '@babel/polyfill/noConflict'
import { ApolloClient } from 'apollo-client'
import { InMemoryCache } from 'apollo-cache-inmemory'
import { HttpLink } from 'apollo-link-http'
import { onError } from 'apollo-link-error'
import { ApolloLink, Observable } from 'apollo-link'
import { WebSocketLink } from "apollo-link-ws"
import { getMainDefinition } from 'apollo-utilities'
const getClient = (jwt, httpURL = 'http://localhost:4000', websocketURL = 'ws://localhost:4000') => {
// Setup the authorization header for the http client
const request = async (operation) => {
if (jwt) {
operation.setContext({
headers: {
Authorization: `Bearer ${jwt}`
}
})
}
}
// Setup the request handlers for the http clients
const requestLink = new ApolloLink((operation, forward) => {
return new Observable((observer) => {
let handle
Promise.resolve(operation)
.then((oper) => {
request(oper)
})
.then(() => {
handle = forward(operation).subscribe({
next: observer.next.bind(observer),
error: observer.error.bind(observer),
complete: observer.complete.bind(observer),
})
})
.catch(observer.error.bind(observer))
return () => {
if (handle) {
handle.unsubscribe()
}
}
})
})
// Web socket link for subscriptions
const wsLink = ApolloLink.from([
onError(({ graphQLErrors, networkError }) => {
if (graphQLErrors) {
graphQLErrors.map(({ message, locations, path }) =>
console.log(
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`,
),
)
}
if (networkError) {
console.log(`[Network error]: ${networkError}`)
}
}),
requestLink,
new WebSocketLink({
uri: websocketURL,
options: {
reconnect: true,
connectionParams: () => {
if (jwt) {
return {
Authorization: `Bearer ${jwt}`,
}
}
}
}
})
])
// HTTP link for queries and mutations
const httpLink = ApolloLink.from([
onError(({ graphQLErrors, networkError }) => {
if (graphQLErrors) {
graphQLErrors.map(({ message, locations, path }) =>
console.log(
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`,
),
)
}
if (networkError) {
console.log(`[Network error]: ${networkError}`)
}
}),
requestLink,
new HttpLink({
uri: httpURL,
credentials: 'same-origin'
})
])
// Link to direct ws and http traffic to the correct place
const link = ApolloLink.split(
// Pick which links get the data based on the operation kind
({ query }) => {
const { kind, operation } = getMainDefinition(query)
return kind === 'OperationDefinition' && operation === 'subscription'
},
wsLink,
httpLink,
)
return new ApolloClient({
link,
cache: new InMemoryCache()
})
}
export { getClient as default } | 31.991453 | 102 | 0.476356 |
c60c930f71eafe230b56e0c6eac105fb6fd72c5f | 1,476 | sjs | JavaScript | repl/index.sjs | maniacs-pl/siren | 4507796902176971a6caa4887b9f5f62b500eb37 | [
"MIT"
] | 109 | 2015-12-15T23:06:06.000Z | 2020-02-08T23:00:36.000Z | repl/index.sjs | maniacs-pl/siren | 4507796902176971a6caa4887b9f5f62b500eb37 | [
"MIT"
] | 57 | 2015-12-15T23:11:20.000Z | 2016-07-19T03:05:57.000Z | repl/index.sjs | robotlolita/mermaid-language | 4507796902176971a6caa4887b9f5f62b500eb37 | [
"MIT"
] | 9 | 2015-12-26T03:51:01.000Z | 2018-10-15T03:32:15.000Z | /**********************************************************************
*
* This source file is part of the Siren project.
*
* Copyright (C) 2013-2015 Quildreen Motta.
* Licensed under the MIT licence.
*
* See LICENCE for licence information.
* See CONTRIBUTORS for the list of contributors to the project.
*
**********************************************************************/
// # module: Siren.repl
//
// Command line interface for the Siren REPL.
var doc = [
'isiren — command-line REPL for the Siren language.',
'',
'Usage:',
' isiren [options]',
' isiren --version',
' isiren --help',
'',
'Options:',
' -v, --verbose Outputs lots of information',
' --show-js Shows compiled JS for each expression',
' -h, --help Displays this screen',
' --version Displays the version number'
].join('\n');
// -- Dependencies -----------------------------------------------------
var docopt = require('docopt').docopt;
var pkg = require('../package.json');
var repl = require('./core');
var show = console.log.bind(console);
module.exports = function Main() {
var args = docopt(doc, { help: false });
; args['--help']? show(doc)
: args['--version']? show('iSiren version ' + pkg.version)
: /* otherwise */ repl({
verbose: args['--verbose'],
showJs: args['--show-js']
})
}
| 29.52 | 72 | 0.48103 |
c60c9baf4408ffe9b5afbe0022ad66c849b62a90 | 9,150 | js | JavaScript | javascript/all.js | yutin1987/yodex2016 | e44049a2e2952386f4abf0ba4136020deabf5bf6 | [
"BSD-3-Clause"
] | null | null | null | javascript/all.js | yutin1987/yodex2016 | e44049a2e2952386f4abf0ba4136020deabf5bf6 | [
"BSD-3-Clause"
] | null | null | null | javascript/all.js | yutin1987/yodex2016 | e44049a2e2952386f4abf0ba4136020deabf5bf6 | [
"BSD-3-Clause"
] | null | null | null | var
$userimage = $('#userimage'),
$coverimage = $('#coverimage'),
$udragger = $('#userdragger'),
$cdragger = $('#coverdragger'),
$sizer = $('#size-slider'),
$loading = $('#loading');
$pretext = $('#coverimage .texter'),
$text = $('#templates textarea'),
$uploading = $('#uploading');
$preview = $('#preview');
$(window).load(function()
{
var
container_size = $userimage.width(),
userimage_size = getImgSize(getBackgroundImage($userimage));
resizeDragger(userimage_size,container_size);
});
$(document).ready(function()
{
$text.val('我是\n我在乎');
$pretext.html('我是<br/>我在乎');
$coverimage.css({
left: 0,
top: $preview.height() * 0.66
});
$cdragger.css({
left: 0,
top: $preview.height() * 0.66
});
// ie alert
$("body").iealert({
support: 'ie9',
title: '您的瀏覽器太舊啦!',
text: '請更新您的瀏覽器,我們推薦您使用 Google Chrome',
closeBtn: false,
upgradeTitle: '下載 Google Chrome',
upgradeLink: 'http://www.google.com/chrome/'
});
$text.on('keyup', function(e) {
$pretext.html(e.target.value.replace(/(\n|\r\n)/gi, '<br />'));
});
// dragger
$udragger.draggable({
drag: function(e) {
$userimage.css('background-position',$udragger.css('left')+' '+$udragger.css('top'));
if($userimage.hasClass('dragged') == false) $userimage.addClass('dragged');
}
});
$cdragger.draggable({
drag: function(e) {
$coverimage.css({
left: $cdragger.css('left'),
top: $cdragger.css('top')
});
if($coverimage.hasClass('dragged') == false) $coverimage.addClass('dragged');
}
});
// size slider
$sizer.slider({
value: 100,
max: 170,
min: 30,
slide: function(event, ui) {
var
truesize = getBackgroundSize($userimage.css('background-size')),
position = getBackgroundPosition($userimage.css('background-position')),
center = getBackgroundCenterPoint(truesize,position);
$('<img/>').attr('src',getBackgroundImage($userimage))
.load(function() {
var
size = [this.width,this.height],
width = size[0]*(ui.value)/100,
height = size[1]*(ui.value)/100,
left = center[0] - width*0.5,
top = center[1] - height*0.5;
$userimage
.css('background-size',width+'px '+height+'px')
.css('background-position',left+'px '+top+'px');
});
}
});
$("#normalSubmit").click(function() {
var
basesize = $userimage.width(),
size = getBackgroundSize($userimage.css('background-size')),
position = getBackgroundPosition($userimage.css('background-position')),
scale = basesize/500;
var
source = $('#source').val(),
w = size[0]/scale,
h = size[1]/scale,
x = position[0]/scale,
y = position[1]/scale;
cleft = px2int($coverimage.css('left'));
ctop = px2int($coverimage.css('top'));
createImage(source, x, y, w, h, cleft, ctop);
});
});
$(window).konami({
code : [55,55,55],
cheat: function() {
$('.banana').slideDown();
}
});
$(window).konami({
code : [54,54,54],
cheat: function() {
$('h1,#size-slider').delay(100).animate({'opacity':'0'},2900)
$('#formbuttons,.template-label').delay(400).animate({'opacity':'0'},2600)
$('#settings').delay(1000).animate({'opacity':'0'},2000)
$('.left-bottom-corner').delay(800).animate({'opacity':'0'},2200)
$('.preview').animate({'top':'-500px','opacity':'0.5'},3000).animate({'width':'0','opacity':'0'},3000,function(){
$('#content').slideUp();
})
}
});
function createImage(source, x, y, w, h, cleft, ctop){
var userimage = new Image();
userimage.src = source;
var resize_canvas = document.getElementById("result");
resize_canvas.width = 500;
resize_canvas.height = 500;
var ctx = resize_canvas.getContext("2d");
ctx.rect(0, 0, 500, 500);
ctx.fillStyle = '#3CA1E7';
ctx.fill();
ctx.drawImage(userimage, x, y, w, h);
var ctxRect = resize_canvas.getContext("2d");
ctxRect.fillStyle = 'rgba(72, 170, 245, 0.7)';
ctxRect.fillRect(0 + cleft, 0 + ctop, 500 * 0.5, 500 * 0.25);
var ctxText = resize_canvas.getContext("2d");
ctxText.fillStyle = '#FFFFFF';
ctxText.font = '30px Noto Sans TC';
$text.val().split("\n").map(function(text, idx) {
ctxText.fillText(text, 10 + cleft, 9 + 30 + (33 * idx) + ctop);
});
var base64 = resize_canvas.toDataURL("image/png");
// check ie or not
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)){
var html="<p>請按右鍵另存圖片</p>";
html+="<img src='"+base64+"' alt='nppsticker'/>";
var tab=window.open();
tab.document.write(html);
}
else{
$('#download').attr('href',base64);
$('#download')[0].click();
}
}
//uploader
$(function(){
var dropZone = document.getElementById('drop');
dropZone.addEventListener('dragover', handleDragOver, false);
dropZone.addEventListener('drop', handleFileSelect, false);
$('.uploadBtn').click(function(){
$('#uploadInput').click();
});
$('#uploadInput').on('change',function(){
input = document.getElementById('uploadInput');
loadImage(input.files);
});
});
// drag image
function handleFileSelect(evt) {
evt.stopPropagation();
evt.preventDefault();
var files = evt.dataTransfer.files;
loadImage(files);
}
function handleDragOver(evt) {
evt.stopPropagation();
evt.preventDefault();
evt.dataTransfer.dropEffect = 'copy';
}
// function
function loadImage(files) {
var file, fr, img;
if (!files) {
alert('悲劇!您的瀏覽器不支援檔案上傳!')
} else {
$uploading.fadeIn();
$loading.show();
file = files[0];
fr = new FileReader();
fr.onload = createImage;
fr.readAsDataURL(file);
}
function createImage() {
img = new Image();
img.onload = imageLoaded;
img.src = fr.result;
}
function imageLoaded() {
var canvas = document.getElementById("canvas")
canvas.width = img.width;
canvas.height = img.height;
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0);
var base64 = canvas.toDataURL("image/png");
$('#source').attr('value',base64);
$userimage.css('background-image','url('+base64+')');
var thumb = document.getElementById("thumb");
var thumb_w,thumb_h;
if(img.width > img.height) {
thumb_h = 100;
thumb_w = 100*(img.width/img.height);
}
else {
thumb_w = 100;
thumb_h = 100*(img.height/img.width);
}
thumb.width = thumb_w;
thumb.height = thumb_h;
var ctx = thumb.getContext("2d");
ctx.drawImage(img,0,0,thumb_w,thumb_h);
var thumbbase64 = thumb.toDataURL("image/png");
$('#templates label').css('background-image','url('+thumbbase64+')');
$('<img/>').attr('src',base64)
.load(function() {
var value = $('input[name=template]:checked').val();
container_size = $userimage.width(),
userimage_size = [this.width,this.height];
resizeDragger(userimage_size,container_size,value);
$loading.hide();
$uploading.fadeOut();
});
}
}
function getImgSize(src)
{
var newImg = new Image();
newImg.src = src;
return [newImg.width, newImg.height];
}
function getBackgroundImage(element)
{
var url = element.css('background-image');
return url.replace(/^url\(["']?/, '').replace(/["']?\)$/, '');
}
function resizeDragger(size,wrapper,value,upload)
{
value = typeof value !== 'undefined' ? value : 1;
upload = typeof upload !== 'undefined' ? upload : 0;
var scale, width, height, top, left;
if(size[0] > size[1]) {
scale = (wrapper/size[1]);
width = size[0]*scale;
height = wrapper;
top = 0;
left = (width - wrapper)*0.5*-1;
}
else {
scale = (wrapper/size[0]);
width = wrapper;
height = size[1]*scale;
top = (height - wrapper)*0.5*-1;
left = 0;
}
if(value == 6){
left = wrapper*0.2*-1;
if(size[0] > size[1]) left -= (width-wrapper)*0.5;
}
else if(value == 9){
$sizer.slider('value',65);
if(size[0] > size[1]) {
left = wrapper*0.65*0.13*0.5;
width *=0.65;
height *=0.65;
top = (wrapper - height)*0.48;
}
else {
left = wrapper*0.65*0.13*0.5;
width *=0.65;
height *=0.65;
top = (wrapper - height)*0.48;
}
}
else if(value == 10){
$sizer.slider('value',92);
if(size[0] > size[1]) {
width = wrapper*0.92;
height = width*(size[1]/size[0]);
top = wrapper*0.045;
left = (wrapper-width)*0.5;
}
else {
width = width*0.92;
height = height*0.92;
top = wrapper*0.045;
left = (wrapper-width)*0.5;
}
}
$userimage
.css('background-size',width+'px '+height+'px')
.css('background-position',left+'px '+top+'px');
}
function getBackgroundSize(string)
{
size = string.split(' ');
return [px2int(size[0]),px2int(size[1])];
}
function getBackgroundPosition(string)
{
position = string.split(' ');
return [px2int(position[0]),px2int(position[1])];
}
function getBackgroundCenterPoint(size,position){
return [size[0]*0.5 + position[0],size[1]*0.5 + position[1]]
}
function px2int(string){
return parseFloat(string.replace('px',''));
}
| 26.676385 | 117 | 0.598142 |
c60cd7ca0a70e0a08c4d2e23f4f68bb8dda55757 | 469 | js | JavaScript | test/unit/specs/components/common/Page404.spec.js | Forkbox/lunie | 681e2a4c29b2de398d99a3e95d814328cc686305 | [
"Apache-2.0"
] | 2 | 2019-09-25T12:09:57.000Z | 2019-09-25T18:43:53.000Z | test/unit/specs/components/common/Page404.spec.js | Forkbox/lunie | 681e2a4c29b2de398d99a3e95d814328cc686305 | [
"Apache-2.0"
] | 8 | 2020-09-07T20:49:36.000Z | 2022-01-22T10:07:40.000Z | test/unit/specs/components/common/Page404.spec.js | Forkbox/lunie | 681e2a4c29b2de398d99a3e95d814328cc686305 | [
"Apache-2.0"
] | 1 | 2019-06-15T19:07:48.000Z | 2019-06-15T19:07:48.000Z | import { shallowMount } from "@vue/test-utils"
import Page404 from "src/components/common/Page404"
describe(`Page404`, () => {
let wrapper
beforeEach(() => {
wrapper = shallowMount(Page404, {
stubs: [`router-link`]
})
})
it(`should show the 404 page`, async () => {
expect(wrapper.vm.$el).toMatchSnapshot()
})
it(`should show links to other pages`, () => {
expect(wrapper.findAll(`router-link-stub`).length > 0).toBe(true)
})
})
| 22.333333 | 69 | 0.618337 |
c60ce4f4068bc7f1b8807d86636994c8dc5859ca | 829 | js | JavaScript | widgets/Edit/nls/pt-pt/strings.js | CristinaHornoKort/web_app_builder_experto | dec2429e3b893869513c5c052c3d58f8978d7456 | [
"Apache-2.0"
] | 15 | 2018-07-18T07:39:47.000Z | 2019-09-25T17:33:52.000Z | widgets/Edit/nls/pt-pt/strings.js | CristinaHornoKort/web_app_builder_experto | dec2429e3b893869513c5c052c3d58f8978d7456 | [
"Apache-2.0"
] | null | null | null | widgets/Edit/nls/pt-pt/strings.js | CristinaHornoKort/web_app_builder_experto | dec2429e3b893869513c5c052c3d58f8978d7456 | [
"Apache-2.0"
] | 4 | 2019-01-07T10:23:42.000Z | 2019-09-02T08:03:08.000Z | define({
"_widgetLabel": "Editar",
"_featureAction_Edit": "Editar",
"title": "Escolha um template para criar elementos",
"pressStr": "Pressione ",
"ctrlStr": " CTRL ",
"snapStr": " para ativar o ajuste automático",
"close": "Fechar",
"featureLayers": "Camadas de elementos",
"searchTemplates": "Pesquisar modelos",
"noAvailableTempaltes": "Modelos não disponíveis",
"noCanCreateLayerAreCurrentlyVisible": "Não sencontram visíveis quaisquer camadas que possam ser criadas.",
"relatedTables": "Tabelas relacionadas:",
"relatedRecords": "Registos relacionados:",
"noRelatedRecotds": "Não foram encontrados quaisquer registos relacionados.",
"startToDraw": "Clique para começar a desenhar",
"startToAddPoint": "Clique para adicionar um ponto",
"editRelatedFeature": "Editar elemento relacionado"
}); | 43.631579 | 109 | 0.732207 |
c60d07ba7a6aa77ffafc166f0d85c25d83ac0378 | 2,909 | js | JavaScript | commands/reminder.js | Gerlesh/ibpowerbot | 82665f7abdffe72d094a47cee080fbcfae3874d2 | [
"MIT"
] | 1 | 2019-09-28T21:12:11.000Z | 2019-09-28T21:12:11.000Z | commands/reminder.js | Gerlesh/ibpowerbot | 82665f7abdffe72d094a47cee080fbcfae3874d2 | [
"MIT"
] | 1 | 2019-09-27T20:40:21.000Z | 2019-09-27T20:41:00.000Z | commands/reminder.js | Gerlesh/ibpowerbot | 82665f7abdffe72d094a47cee080fbcfae3874d2 | [
"MIT"
] | 1 | 2019-10-04T17:14:29.000Z | 2019-10-04T17:14:29.000Z | const Discord = require('discord.js');
class Reminder {
constructor(time,message) {
this.reminder = message;
this.expires = 0;
const timeValues = time.split(/[a-zA-Z]/);
timeValues.pop();
const timeUnitsRaw = time.split(/[0-9]+/);
timeUnitsRaw.shift();
const timeUnits = timeUnitsRaw.map(x => x.toLowerCase());
for (var i = timeUnits.length - 1; i >= 0; i--) {
switch (timeUnits[i]) {
case 'w':
case 'wks':
case 'weeks':
case 'week':
this.expires += parseFloat(timeValues[i])*604800000;
break;
case 'd':
case 'days':
case 'day':
this.expires += parseFloat(timeValues[i])*86400000;
break;
case 'h':
case 'hrs':
case 'hr':
case 'hours':
case 'hour':
this.expires += parseFloat(timeValues[i])*3600000;
break;
case 'm':
case 'min':
case 'minutes':
case 'minute':
this.expires += parseFloat(timeValues[i])*60000;
break;
case 's':
case 'sec':
case 'seconds':
case 'second':
this.expires += parseFloat(timeValues[i])*1000;
break;
};
};
const timeLeft = [Math.floor(this.expires/604800000) + " week(s)",Math.floor(this.expires%604800000/86400000) + " day(s)",Math.floor(this.expires%604800000%86400000/3600000) + " hour(s)",Math.floor(this.expires%604800000%86400000%3600000/60000) + " minute(s)",Math.floor(this.expires%604800000%86400000%3600000%60000/1000) + " second(s)"];
for (var i = timeLeft.length - 1; i >= 0; i--) {
if (parseFloat(timeLeft[i]) == 0) {
timeLeft.splice(i,1);
};
};
this.timeLeft = timeLeft.join(', ');
};
};
module.exports = {
name: 'reminder', //Name of command
description: 'Reminds you after a set amount of time\nWARNING: If the bot dies for any period of time, the reminder will not be carried out.', //Description of Command
args: true, //Arguments necessary? (true/false)
usage: '<time until reply> <message>', //Optional/necessary arguments
guildOnly: true, //Server only? (true/false)
cooldown: 10, //Cooldown in seconds for command
aliases: ['remind','r'], //Other possible ways to call command, written in '' marks and separated by ,
execute(message, args) {
const reminder = new Reminder(args[0],args.length > 1 ? message.content.slice(message.content.indexOf(args[1])) : '');
if (reminder.timeLeft.length > 0) {
if (reminder.reminder.length > 0){
message.channel.send(`Reminder set for ${reminder.timeLeft} from now: ${reminder.reminder}`);
} else {
message.channel.send(`Reminder set for ${reminder.timeLeft} from now!`);
};
setTimeout(function() {message.reply(reminder.timeLeft + " ago: " + reminder.reminder + "\n\nhttps://discordapp.com/channels/" + message.guild.id + "/" + message.channel.id + "/" + message.id)},reminder.expires);
} else {
message.channel.send(`Please provide a valid time (with units, i.e. \`-reminder 5m wake up\`)`);
};
}
};
| 33.056818 | 341 | 0.642833 |
c60e38fa522f6485f47d1ec9597a81c5a0c8cb11 | 7,822 | js | JavaScript | dashboard/client/src/components/workloads/jobs/JobCard.js | pulasthi/twister2 | 40b73bdf7dcb778d957c3f146baf825a97dceae5 | [
"Apache-2.0"
] | 63 | 2017-08-31T10:02:52.000Z | 2021-12-18T21:42:14.000Z | dashboard/client/src/components/workloads/jobs/JobCard.js | pulasthi/twister2 | 40b73bdf7dcb778d957c3f146baf825a97dceae5 | [
"Apache-2.0"
] | 284 | 2017-10-20T15:35:26.000Z | 2020-09-11T15:25:40.000Z | dashboard/client/src/components/workloads/jobs/JobCard.js | pulasthi/twister2 | 40b73bdf7dcb778d957c3f146baf825a97dceae5 | [
"Apache-2.0"
] | 44 | 2017-08-21T19:47:57.000Z | 2020-11-22T22:45:50.000Z | import React from "react";
import {Button, Card, Collapse, Elevation, Icon, Intent, Position, Tag, Tooltip} from "@blueprintjs/core";
import "./JobCard.css";
import JobService from "../../../services/JobService";
import {DashToaster} from "../../Dashboard";
import ClusterTag from "../../grid/clusters/ClusterTag";
import NodeTag from "../../grid/nodes/NodeTag";
import {ComputeResourceCard} from "../../grid/compute-resource/ComputeResourceCard";
import {Link} from "react-router-dom";
import {JobUtils} from "./JobUtils";
export default class JobCard extends React.Component {
constructor(props) {
super(props);
this.state = {
job: this.props.job,
syncing: false,
stateIntent: JobUtils.getStateIntent(this.props.job.state),
infoOpen: false
};
}
componentWillReceiveProps(nextProps, nextContext) {
this.setState({
job: nextProps.job,
stateIntent: JobUtils.getStateIntent(nextProps.job.state)
});
}
syncJob = () => {
this.setState({
syncing: true
});
JobService.getJobById(this.state.job.jobID).then(respone => {
this.setState({
job: respone.data,
syncing: false,
stateIntent: JobUtils.getStateIntent(respone.data.state)
});
DashToaster.show({
message: "Successfully synced Job: " + this.state.job.jobID,
intent: Intent.SUCCESS
});
}).catch(err => {
DashToaster.show({
message: "Failed to sync Job: " + this.state.job.jobID,
intent: Intent.DANGER
});
this.setState({
syncing: false
});
});
};
getStateIntent = (state) => {
switch (state) {
case "STARTED":
return Intent.PRIMARY;
case "COMPLETED":
return Intent.SUCCESS;
case "FAILED":
return Intent.DANGER;
default:
return Intent.NONE;
}
};
toggleInfo = (event) => {
event.stopPropagation();
this.setState({
infoOpen: !this.state.infoOpen
})
};
getTimeString = () => {
let time = new Date(this.state.job.createdTime);
return `${time.getMonth() + 1} / ${time.getDate()} ~ ${time.getHours()}:${time.getMinutes()}:${time.getSeconds()}`;
};
render() {
return (
<Card interactive={true} elevation={Elevation.ZERO} className="tw-table-row tw-job-row">
<div className="tw-job-row-summary">
<div className="tw-job-row-icon">
<Icon icon="new-grid-item" iconSize={18} className="tw-row-icon"/>
</div>
<Link to={`jobs/${this.state.job.jobID}`}>
<div className="tw-table-row-left">
<div className="tw-job-row-name">
{this.state.job.jobName}
</div>
</div>
</Link>
<div className="tw-table-row-right">
{/*<NodeTag node={this.state.job.node}/>*/}
<Tooltip content="Job ID" position={Position.TOP}>
<Tag intent={Intent.NONE} icon="tag" minimal={true} style={{height: 25}}
className="tw-job-row-status-tag">{this.state.job.jobID}</Tag>
</Tooltip>
<Tooltip content="Number of Workers" position={Position.TOP}>
<Tag intent={Intent.NONE} icon="ninja" minimal={true} style={{height: 25, width: 60}}
className="tw-job-row-status-tag">{this.state.job.numberOfWorkers}</Tag>
</Tooltip>
<Tag intent={this.state.stateIntent}
className="tw-job-row-status-tag">{this.state.job.state}</Tag>
<Button rightIcon="refresh" text="" small={true} minimal={true} onClick={this.syncJob}/>
<Button rightIcon="caret-down" text="" small={true} minimal={true}
onClick={this.toggleInfo}/>
</div>
</div>
<div className="tw-job-row-info">
<Collapse isOpen={this.state.infoOpen} keepChildrenMounted={true}>
<table className=" bp3-html-table bp3-html-table-striped bp3-html-table-condensed"
width="100%">
<tbody>
<tr>
<td>
Job ID
</td>
<td>
{this.state.job.jobID}
</td>
</tr>
<tr>
<td>
Worker Class
</td>
<td>
{this.state.job.workerClass}
</td>
</tr>
<tr>
<td>
Cluster
</td>
<td>
<ClusterTag cluster={this.state.job.node.cluster}/>
</td>
</tr>
<tr>
<td>
Node
</td>
<td>
<NodeTag node={this.state.job.node}/>
</td>
</tr>
<tr>
<td>
Number of Workers
</td>
<td>
{this.state.job.numberOfWorkers}
</td>
</tr>
<tr>
<td>
Start Time
</td>
<td>
{new Date(this.state.job.createdTime).toUTCString()}
</td>
</tr>
<tr>
<td>
State
</td>
<td>
<Tag minimal={true} intent={this.state.stateIntent}>{this.state.job.state}</Tag>
</td>
</tr>
<tr>
<td>
Compute Resources
</td>
<td>
{this.state.job.computeResources.map(cr => {
return <ComputeResourceCard cr={cr} key={cr.index}/>
})}
</td>
</tr>
</tbody>
</table>
</Collapse>
</div>
</Card>
)
}
} | 40.112821 | 123 | 0.368064 |
c60e750a43bc12485a9e3a9b29f00ff77f378a60 | 20,939 | js | JavaScript | packages/node_modules/@ractivejs/core/test/browser/shuffling.js | fskreuz/ractive-monorepo | be27e0ba6466dd679245e891262715eb62bb317a | [
"MIT"
] | null | null | null | packages/node_modules/@ractivejs/core/test/browser/shuffling.js | fskreuz/ractive-monorepo | be27e0ba6466dd679245e891262715eb62bb317a | [
"MIT"
] | null | null | null | packages/node_modules/@ractivejs/core/test/browser/shuffling.js | fskreuz/ractive-monorepo | be27e0ba6466dd679245e891262715eb62bb317a | [
"MIT"
] | null | null | null | import { fire } from 'simulant';
import { initModule } from '../helpers/test-config';
import { test } from 'qunit';
export default function() {
initModule( 'shuffling.js' );
test( 'Pattern observers on arrays fire correctly after mutations (mirror of test in observe.js)', t => {
const ractive = new Ractive({
data: {
items: [ 'a', 'b', 'c' ]
}
});
let lastKeypath;
let lastValue;
let observedLengthChange = false;
ractive.observe( 'items.*', ( n, o, k ) => {
lastKeypath = k;
lastValue = n;
if ( k === 'items.length' ) {
observedLengthChange = true;
}
}, { init: false });
ractive.push( 'items', 'd' );
t.equal( lastKeypath, 'items.3' );
t.equal( lastValue, 'd' );
ractive.pop( 'items' );
// TODO this appears to directly contradict related tests in observe.js???
// t.equal( lastKeypath, 'items.3' );
// t.equal( lastValue, undefined );
t.ok( !observedLengthChange );
ractive.set( 'items.length', 4 );
t.ok( observedLengthChange );
});
test( '#if sections only render once when arrays are mutated', t => {
const ractive = new Ractive({
el: fixture,
template: '{{#if list}}yes{{else}}no{{/if}}',
data: {
list: [ 'a', 'b', 'c' ]
}
});
t.htmlEqual( fixture.innerHTML, 'yes' );
ractive.push( 'list', 'd' );
t.htmlEqual( fixture.innerHTML, 'yes' );
ractive.splice( 'list', 0, 0, 'e', 'f' );
t.htmlEqual( fixture.innerHTML, 'yes' );
});
test( 'an appropriate error is thrown when shuffling a non-array keypath', t => {
const r = new Ractive({
data: { foo: null }
});
t.throws( () => {
r.push('foo', 1);
}, /.*push.*non-array.*foo.*/i);
});
test( 'conditional attributes shuffle correctly', t => {
const r = new Ractive({
el: fixture,
template: '{{#each items}}<div {{#if .cond}}foo="{{.bar}}"{{/if}}>yep</div>{{/each}}',
data: {
items: [ { cond: true, bar: 'baz' } ]
}
});
t.htmlEqual( fixture.innerHTML, '<div foo="baz">yep</div>' );
r.unshift( 'items', { cond: true, bar: 'bat' } );
t.htmlEqual( fixture.innerHTML, '<div foo="bat">yep</div><div foo="baz">yep</div>' );
});
test( 'yielders shuffle correctly', t => {
const cmp = Ractive.extend({
template: '{{yield}}'
});
const r = new Ractive({
el: fixture,
components: { cmp },
template: '{{#each items}}<cmp>{{.bar}}</cmp>{{/each}}',
data: {
items: [ { bar: 'baz' } ]
}
});
t.htmlEqual( fixture.innerHTML, 'baz' );
r.unshift( 'items', { bar: 'bat' } );
t.htmlEqual( fixture.innerHTML, 'batbaz' );
});
test( 'event directives should shuffle correctly', t => {
t.expect( 5 );
const r = new Ractive({
el: fixture,
template: '{{#each items}}<div id="div{{@index}}" on-click="@this.fire("foo", event, .bar)" />{{/each}}',
data: {
items: [ { bar: 'baz' } ]
}
});
const listener = r.on( 'foo', ( ev, bar ) => {
t.equal( r.get( 'items.0.bar' ), bar );
});
fire( r.find( '#div0' ), 'click' );
r.unshift( 'items', { bar: 'bat' } );
fire( r.find( '#div0' ), 'click' );
listener.cancel();
r.on( 'foo', ev => {
t.equal( ev.resolve(), 'items.1' );
});
fire( r.find( '#div1' ), 'click' );
r.push( 'items', {} );
r.splice( 'items', 0, 1 );
t.equal( r.findAll( 'div' )[ 1 ].id, 'div1' );
fire( r.find( '#div1' ), 'click' );
});
test( 'method event directives should shuffle correctly', t => {
t.expect( 9 );
let group = 0;
const r = new Ractive({
el: fixture,
template: '{{#each items}}<div id="div{{@index}}" on-click="@this.foo(@keypath, .bar)" />{{/each}}',
data: {
items: [ { bar: 'baz' } ]
},
foo( path, bar ) {
if ( group === 0 ) {
t.equal( bar, r.get( 'items.0.bar' ) );
t.equal( path, 'items.0' );
} else {
t.equal( path, 'items.1' );
t.equal( this.event.resolve(), 'items.1' );
}
}
});
const listener = r.on( 'foo', ( path ) => {
t.equal( r.get( 'items.0' ), path );
});
fire( r.find( '#div0' ), 'click' );
r.unshift( 'items', { bar: 'bar' } );
fire( r.find( '#div0' ), 'click' );
listener.cancel();
group = 1;
fire( r.find( '#div1' ), 'click' );
r.push( 'items', {} );
r.splice( 'items', 0, 1 );
t.equal( r.findAll( 'div' )[ 1 ].id, 'div1' );
fire( r.find( '#div1' ), 'click' );
});
test( 'method event directives with no args should shuffle without throwing', t => {
t.expect( 0 );
const r = new Ractive({
el: fixture,
template: '{{#each items}}<button on-click="@this.foo()">clickme</button>{{/each}}',
data: { items: [ 1 ] }
});
r.unshift( 'items', 2 );
});
test( 'shuffling around a computation with an index ref', t => {
const r = new Ractive({
el: fixture,
template: `{{#each items.slice(1)}}{{2 * @index}} {{@index * .}}|{{/each}}`,
data: {
items: [ 1, 2 ]
}
});
t.htmlEqual( fixture.innerHTML, '0 0|' );
r.splice( 'items', 1, 0, 3, 4 );
t.htmlEqual( fixture.innerHTML, '0 0|2 4|4 4|' );
r.splice( 'items', 0, 1 );
t.htmlEqual( fixture.innerHTML, '0 0|2 2|' );
});
test( 'shuffling a computation should not cause the computation to shuffle (#2267 #2269)', t => {
const r = new Ractive({
el: fixture,
template: `{{#each items.slice(1)}}{{.}}{{/each}}`,
data: {
items: [ 1, 2 ]
}
});
t.htmlEqual( fixture.innerHTML, '2' );
r.splice( 'items', 0, 1 );
t.htmlEqual( fixture.innerHTML, '' );
});
test( 'shuffled sections that unrender at the same time should not leave orphans (#2277)', t => {
const r = new Ractive({
el: fixture,
template: `{{#if items.length}}{{#each items}}{{.}}{{/each}}{{/if}}`,
data: {
items: [ 1 ]
}
});
t.htmlEqual( fixture.innerHTML, '1' );
r.splice( 'items', 0, 1 );
t.htmlEqual( fixture.innerHTML, '' );
});
test( `shuffled elements with attributes depending on template context (@index, etc) should have appropriately updated attributes (#2422)`, t => {
const r = new Ractive({
el: fixture,
template: `{{#each foo}}<span data-wat="{{50 * @index}}">{{50 * @index}}</span>{{/each}}`,
data: { foo: [ 0, 0, 0 ] }
});
r.push( 'foo', 0 );
let spans = r.findAll( 'span' );
for ( let i = 0; i < spans.length; i++ ) t.equal( spans[i].getAttribute( 'data-wat' ), spans[i].innerHTML );
r.splice( 'foo', 2, 1 );
r.splice( 'foo', 1, 0, 0 );
spans = r.findAll( 'span' );
for ( let i = 0; i < spans.length; i++ ) t.equal( spans[i].getAttribute( 'data-wat' ), spans[i].innerHTML );
});
test( 'computations with reference expressions that resolve to an array length should be marked on shuffle (#2541)', t => {
const r = new Ractive({
el: fixture,
template: '{{foo[v].length + 1}}',
data: {
foo: { bar: [ 1, 2 ] },
v: 'bar'
}
});
t.htmlEqual( fixture.innerHTML, '3' );
r.push( 'foo.bar', 3 );
t.htmlEqual( fixture.innerHTML, '4' );
});
test( 'shuffled computations are updated with their shuffled member', t => {
const r = new Ractive({
el: fixture,
template: `{{#each list as item:i}}{{item + i}}{{/each}}`,
data: {
list: [ 1 ]
}
});
t.htmlEqual( fixture.innerHTML, '1' );
r.unshift( 'list', 2 );
t.htmlEqual( fixture.innerHTML, '22' );
r.set( 'list.1', 10 );
t.htmlEqual( fixture.innerHTML, '211' );
});
test( 'children of shuffled reference expressions survive the shuffle', t => {
const r = new Ractive({
el: fixture,
template: '{{#each lists[name]}}{{.foo}}{{/each}}',
data: {
lists: {
list: [ { foo: 'bar' } ]
},
name: 'list'
}
});
t.htmlEqual( fixture.innerHTML, 'bar' );
r.unshift( 'lists.list', { foo: 'foo' } );
t.htmlEqual( fixture.innerHTML, 'foobar' );
r.set( 'lists.list.1.foo', 'baz' );
t.htmlEqual( fixture.innerHTML, 'foobaz' );
});
test( 'reference expression members shuffle safely', t => {
const r = new Ractive({
el: fixture,
template: '{{#each lists[name.0]}}{{.foo}}{{/each}}',
data: {
lists: {
list: [ { foo: 'bar' } ],
other: [ { foo: 'baz' } ]
},
name: [ 'list', 'other' ]
}
});
t.htmlEqual( fixture.innerHTML, 'bar' );
r.shift( 'name' );
t.htmlEqual( fixture.innerHTML, 'baz' );
r.set( 'lists.other.0.foo', 'bat' );
t.htmlEqual( fixture.innerHTML, 'bat' );
});
// TODO reinstate this in some form. Commented out for purposes of #1740
//test( `Array shuffling only adjusts context and doesn't tear stuff down to rebuild it`, t => {
// let ractive = new Ractive({
// el: fixture,
// template: '{{#each items}}{{.name}}{{.name + "_expr"}}{{.[~/name]}}<span {{#.name}}ok{{/}} class="{{.name}}">{{.name}}</span>{{/each}}',
// data: { items: [ { name: 'foo' } ], name: 'name' }
// });
// t.htmlEqual( fixture.innerHTML, 'foofoo_exprfoo<span ok class="foo">foo</span>' );
// let iter = ractive.fragment.items[0].fragments[0],
// ref = iter.items[0],
// exp = iter.items[1],
// mem = iter.items[2],
// el = iter.items[3];
// // make sure these little suckers don't get re-rendered
// ref.node.data += 'a';
// exp.node.data += 'b';
// mem.node.data += 'c';
// ractive.unshift( 'items', { name: 'bar' } );
// t.htmlEqual( fixture.innerHTML, 'barbar_exprbar<span ok class="bar">bar</span>fooafoo_exprbfooc<span ok class="foo">foo</span>' );
// let shifted = ractive.fragment.items[0].fragments[1];
// t.strictEqual( iter, shifted );
// t.strictEqual( ref, shifted.items[0]);
// t.strictEqual( exp, shifted.items[1]);
// t.strictEqual( mem, shifted.items[2]);
// t.strictEqual( el, shifted.items[3]);
// });
function removedElementsTest ( action, fn ) {
test( `Array elements removed via ${action} do not trigger updates in removed sections`, t => {
let observed = false;
let errored = false;
t.expect( 5 );
const ractive = new Ractive({
debug: true,
el: fixture,
template: '{{#options}}{{get(this)}}{{/options}}',
data: {
options: [ 'a', 'b', 'c' ],
get ( item ){
if (!item ) errored = true;
return item;
}
}
});
ractive.observe( 'options.2', ( n, o ) => {
t.ok( !n );
t.equal( o, 'c' );
observed = true;
}, { init: false } );
t.ok( !observed );
fn( ractive );
t.ok( observed );
t.ok( !errored );
});
}
removedElementsTest( 'splice', ractive => ractive.splice( 'options', 1, 1 ) );
removedElementsTest( 'merge', ractive => ractive.set( 'options', [ 'a', 'c' ], { shuffle: true } ) );
test( `mapped unresolved computations should shuffle correctly (#2602)`, t => {
const cmp = Ractive.extend({
template: '{{foo.baz || 1}}-{{foo.bar}}|'
});
const r = new Ractive({
el: fixture,
template: `{{#each list}}<cmp foo="{{.}}" />{{/each}}`,
data: {
list: [ { bar: 1 }, { bar: 2 }, { bar: 3 } ]
},
components: { cmp }
});
t.htmlEqual( fixture.innerHTML, '1-1|1-2|1-3|' );
r.splice( 'list', 0, 0, r.splice( 'list', 2, 1 ).result[0] );
r.findAllComponents()[1].set( 'foo.baz', 10 );
t.htmlEqual( fixture.innerHTML, '1-3|10-1|1-2|' );
});
test( 'pattern observers should shuffle correctly (#2601)', t => {
let count = 0;
const cmp = Ractive.extend({
template: '{{foo.bar}}',
onconfig () {
this.observe( 'foo.*', v => {
count++;
t.equal( v, 'd' );
}, { init: false } );
}
});
const r = new Ractive({
el: fixture,
template: '{{#each list}}<cmp foo="{{.}}" />{{/each}}',
components: { cmp },
data: {
list: [ { bar: 'a' }, { bar: 'b' }, { bar: 'c' } ]
}
});
t.htmlEqual( fixture.innerHTML, 'abc' );
let item = r.splice( 'list', 2, 1 ).result[0];
r.splice( 'list', 0, 0, item );
t.htmlEqual( fixture.innerHTML, 'cab' );
item = r.splice( 'list', 2, 1 ).result[0];
r.splice( 'list', 0, 0, item );
t.htmlEqual( fixture.innerHTML, 'bca' );
t.equal( count, 0 );
r.set( 'list.0.bar', 'd' );
t.equal( count, 1 );
});
test( 'components that are spliced out should not fire observers - #2604', t => {
const cmp = Ractive.extend({
template: '<div />',
onconfig () {
this.observe( 'item.foo', () => {
this.set( 'item.bar', 0 );
}, { defer: true });
}
});
const r = new Ractive({
el: fixture,
template: '{{#each list}}<cmp item="{{.}}" />{{/each}}',
data: {
list: [ { foo: 1 }, { foo: 2 }, { foo: 3 } ]
},
components: { cmp }
});
t.equal( r.findAll( 'div' ).length, 3 );
const i = r.pop( 'list' ).result;
r.unshift( 'list', i );
t.equal( r.findAll( 'div' ).length, 3 );
});
test( 'components that are spliced out should not fire pattern observers - #2604', t => {
let count = 0;
const cmp = Ractive.extend({
template: '<div />',
onconfig () {
this.observe( 'item.*', () => {
count++;
}, { defer: true });
}
});
const r = new Ractive({
el: fixture,
template: '{{#each list}}<cmp item="{{.}}" />{{/each}}',
data: {
list: [ { foo: 1 }, { foo: 2 }, { foo: 3 } ]
},
components: { cmp }
});
t.equal( count, 3 );
const i = r.pop( 'list' ).result;
t.equal( count, 3 );
r.unshift( 'list', i );
t.equal( count, 4 );
});
test( 'shuffling around nested lists', t => {
const r = new Ractive({
el: fixture,
template: '{{#each outer}}{{#each inner}}{{.foo}}{{../0.foo}}{{~/outer.0.inner.0.foo}}{{/each}}{{.inner.0.foo}}{{/each}}',
data: {
outer: [
{ inner: [ { foo: 1 }, { foo: 2 } ] },
{ inner: [ { foo: 3 }, { foo: 4 } ] }
]
}
});
t.htmlEqual( fixture.innerHTML, '11121113314313' );
r.unshift( 'outer', { inner: [ { foo: 5 } ] } );
t.htmlEqual( fixture.innerHTML, '555511521513354353' );
r.unshift( 'outer.0.inner', { foo: 9 } );
t.htmlEqual( fixture.innerHTML, '999559911921913394393' );
});
test( 'observers shuffle correctly', t => {
let val;
const r = new Ractive({
el: fixture,
onconfig () {
this.observe( 'list.0.bar', v => val = v );
},
data: {
list: [ { bar: 1 } ]
}
});
t.equal( val, 1 );
r.unshift( 'list', { bar: 3 } );
t.equal( val, 3 );
r.set( 'list.0.bar', 4 );
t.equal( val, 4 );
});
test( 'pattern observers shuffle correctly', t => {
let val;
const r = new Ractive({
el: fixture,
onconfig () {
this.observe( 'list.0.*', v => val = v );
},
data: {
list: [ { bar: 1 } ]
}
});
t.equal( val, 1 );
r.unshift( 'list', { bar: 3 } );
t.equal( val, 3 );
r.set( 'list.0.bar', 4 );
t.equal( val, 4 );
});
test( 'mapped observers shuffle correctly', t => {
let rel;
let stat;
let relKey;
let statKey;
const cmp = Ractive.extend({
onconfig () {
this.observe( 'foo.bar', ( v, o, k ) => {
rel = v;
relKey = k;
});
this.observe( 'bar.bar', ( v, o, k ) => {
stat = v;
statKey = k;
});
}
});
const r = new Ractive({
el: fixture,
template: '{{#each list}}<cmp foo="{{.}}" bar="{{~/list.0}}" />{{/each}}',
data: {
list: [ { bar: 1 } ]
},
components: { cmp }
});
t.equal( rel, 1 );
t.equal( relKey, 'foo.bar' );
t.equal( stat, 1 );
t.equal( statKey, 'bar.bar' );
r.unshift( 'list', { bar: 3 } );
t.equal( rel, 3 );
t.equal( relKey, 'foo.bar' );
t.equal( stat, 3 );
t.equal( statKey, 'bar.bar' );
r.set( 'list.0.bar', 4 );
t.equal( rel, 4 );
t.equal( stat, 4 );
});
test( 'mapped pattern observers shuffle correctly', t => {
let rel;
let stat;
let relKey;
let statKey;
let relPart;
let statPart;
const cmp = Ractive.extend({
onconfig () {
this.observe( 'foo.*', ( v, o, k, p ) => {
rel = v;
relKey = k;
relPart = p;
});
this.observe( 'bar.*', ( v, o, k, p ) => {
stat = v;
statKey = k;
statPart = p;
});
}
});
const r = new Ractive({
el: fixture,
template: '{{#each list}}<cmp foo="{{.}}" bar="{{~/list.0}}" />{{/each}}',
data: {
list: [ { bar: 1 } ]
},
components: { cmp }
});
t.equal( rel, 1 );
t.equal( stat, 1 );
t.equal( relKey, 'foo.bar' );
t.equal( relPart, 'bar' );
t.equal( statKey, 'bar.bar' );
t.equal( statPart, 'bar' );
r.unshift( 'list', { bar: 3 } );
t.equal( rel, 3 );
t.equal( stat, 3 );
t.equal( relKey, 'foo.bar' );
t.equal( relPart, 'bar' );
t.equal( statKey, 'bar.bar' );
t.equal( statPart, 'bar' );
r.set( 'list.0.bar', 4 );
t.equal( rel, 4 );
t.equal( stat, 4 );
});
test( 'decorators shuffle correctly', t => {
let inits = 0;
let upds = 0;
let tears = 0;
const r = new Ractive({
el: fixture,
template: '{{#each list}}<span as-foo="." />{{/each}}',
data: { list: [ 1, 2, 3 ] },
decorators: {
foo ( node, num ) {
inits++;
node.innerHTML = num;
return {
update ( num ) {
upds++;
node.innerHTML = num;
},
teardown () { tears++; }
};
}
}
});
t.equal( inits, 3 );
t.htmlEqual( fixture.innerHTML, '<span>1</span><span>2</span><span>3</span>' );
r.shift( 'list' );
t.ok( tears === 1 && inits === 3 && upds === 0 );
t.htmlEqual( fixture.innerHTML, '<span>2</span><span>3</span>' );
r.set( 'list.0', 7 );
t.ok( tears === 1 && inits === 3 && upds === 1 );
t.htmlEqual( fixture.innerHTML, '<span>7</span><span>3</span>' );
});
test( 'transitions shuffle correctly', t => {
const map = { 1: 0, 2: 0, undefined: 0 };
const r = new Ractive({
el: fixture,
template: '{{#each list}}{{#if .show}}<span foo-out=".num" />{{/if}}{{/each}}',
data: { list: [ { num: 1, show: true }, { num: 2, show: true } ] },
transitions: {
foo ( trans, num ) {
map[num]++;
trans.complete();
}
}
});
r.shift( 'list' );
t.ok( map[undefined] === 1 && map[1] === 0 && map[2] === 0 );
r.toggle( 'list.0.show' );
t.ok( map[undefined] === 1 && map[1] === 0 && map[2] === 1 );
r.toggle( 'list.0.show' );
r.shift( 'list' );
t.ok( map[undefined] === 2 && map[1] === 0 && map[2] === 1 );
});
test( `shuffling lists with nested lists with same-named keypaths (#2491)`, t => {
const r = new Ractive({
el: fixture,
template: '{{#each list}}{{#each list}}<span>{{@keypath}}</span>{{/each}}{{/each}}',
data: {
list: [ { list: [0] }, { list: [{ list: [0] }, 1, 2] } ]
}
});
t.equal( fixture.innerHTML, '<span>list.0.list.0</span><span>list.1.list.0</span><span>list.1.list.1</span><span>list.1.list.2</span>' );
const tmp = r.splice( 'list.1.list', 0, 1 ).result[0];
t.equal( fixture.innerHTML, '<span>list.0.list.0</span><span>list.1.list.0</span><span>list.1.list.1</span>' );
r.splice( 'list', 0, 0, tmp );
t.equal( fixture.innerHTML, '<span>list.0.list.0</span><span>list.1.list.0</span><span>list.2.list.0</span><span>list.2.list.1</span>' );
t.equal( r.getContext( r.findAll( 'span' )[2] ).resolve(), 'list.2.list.0' );
});
test( `shuffle set should also check for element updates (#3010)`, t => {
const r = new Ractive({
target: fixture,
template: `{{#each items}}<div>{{.name}}</div>{{/each}}`,
data: {
items: [
{ name: 'apple', id: 1 },
{ name: 'filler1', id: 200 },
{ name: 'filler2', id: 201 },
{ name: 'orange', id: 2 },
{ name: 'banana', id: 3 }
]
}
});
t.htmlEqual( fixture.innerHTML, '<div>apple</div><div>filler1</div><div>filler2</div><div>orange</div><div>banana</div>' );
r.set( 'items', [
{ id: 3, name: 'gwen stefani' },
{ id: 4, name: 'george lucas' },
{ id: 1, name: 'granny smith' },
], { shuffle: 'id' });
t.htmlEqual( fixture.innerHTML, '<div>gwen stefani</div><div>george lucas</div><div>granny smith</div>' );
});
test( `reference expressions update correctly when their target model rebinds (#3045)`, t => {
const r = new Ractive({
target: fixture,
template: `{{foo[bar].baz.bat}}`,
data: {
dest1: { path: { baz: { bat: 42 } } },
dest2: { path: { baz: { bat: 99 } } },
bar: 'path'
}
});
r.link( 'dest1', 'foo' );
t.htmlEqual( fixture.innerHTML, '42' );
r.link( 'dest2', 'foo' );
t.htmlEqual( fixture.innerHTML, '99' );
});
test( `reference expression children invalidate correctly on shuffle (#3045)`, t => {
const one = [ { bat: 42, bop: 43, bip: 44 } ];
const two = [ { bat: 99, bop: 98, bip: 97 }, { bat: 98, bop: 10, bip: 9 } ];
const r = new Ractive({
target: fixture,
template: `<select>{{#each foo[bar]}}<option title="{{.bop}}" value="{{.bat}}" label="{{.bip}}">{{.bop}}</option>{{/each}}</select>`,
data: {
dest1: { path: one },
bar: 'path'
}
});
r.link( 'dest1', 'foo' );
t.equal( r.findAll( 'option' ).map( o => o.value ).join( '' ), '42' );
t.equal( r.findAll( 'option' ).map( o => o.label ).join( '' ), '44' );
r.set( 'dest1.path', two );
t.equal( r.findAll( 'option' ).map( o => o.value ).join( '' ), '9998' );
t.equal( r.findAll( 'option' ).map( o => o.label ).join( '' ), '979' );
r.set( 'dest1.path', one );
t.equal( r.findAll( 'option' ).map( o => o.value ).join( '' ), '42' );
t.equal( r.findAll( 'option' ).map( o => o.label ).join( '' ), '44' );
});
}
| 26.272271 | 147 | 0.532881 |
c60e83ad4d85e6a243830686a31559047054c92c | 14,432 | js | JavaScript | ppersonal-python/webapp/src/assets/js/editor.md/lib/codemirror/addon/hint/show-hint.js | corner4world/cubeai | ffe3ded358a70cd0a512420f7df2bb931eaae1c9 | [
"Apache-2.0"
] | null | null | null | ppersonal-python/webapp/src/assets/js/editor.md/lib/codemirror/addon/hint/show-hint.js | corner4world/cubeai | ffe3ded358a70cd0a512420f7df2bb931eaae1c9 | [
"Apache-2.0"
] | null | null | null | ppersonal-python/webapp/src/assets/js/editor.md/lib/codemirror/addon/hint/show-hint.js | corner4world/cubeai | ffe3ded358a70cd0a512420f7df2bb931eaae1c9 | [
"Apache-2.0"
] | null | null | null | // CodeMirrror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirrror);
})(function(CodeMirrror) {
"use strict";
var HINT_ELEMENT_CLASS = "CodeMirrror-hint";
var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirrror-hint-active";
// This is the old interface, kept around for now to stay
// backwards-compatible.
CodeMirrror.showHint = function(cm, getHints, options) {
if (!getHints) return cm.showHint(options);
if (options && options.async) getHints.async = true;
var newOpts = {hint: getHints};
if (options) for (var prop in options) newOpts[prop] = options[prop];
return cm.showHint(newOpts);
};
var asyncRunID = 0;
function retrieveHints(getter, cm, options, then) {
if (getter.async) {
var id = ++asyncRunID;
getter(cm, function(hints) {
if (asyncRunID == id) then(hints);
}, options);
} else {
then(getter(cm, options));
}
}
CodeMirrror.defineExtension("showHint", function(options) {
// We want a single cursor position.
if (this.listSelections().length > 1 || this.somethingSelected()) return;
if (this.state.completionActive) this.state.completionActive.close();
var completion = this.state.completionActive = new Completion(this, options);
var getHints = completion.options.hint;
if (!getHints) return;
CodeMirrror.signal(this, "startCompletion", this);
return retrieveHints(getHints, this, completion.options, function(hints) { completion.showHints(hints); });
});
function Completion(cm, options) {
this.cm = cm;
this.options = this.buildOptions(options);
this.widget = this.onClose = null;
}
Completion.prototype = {
close: function() {
if (!this.active()) return;
this.cm.state.completionActive = null;
if (this.widget) this.widget.close();
if (this.onClose) this.onClose();
CodeMirrror.signal(this.cm, "endCompletion", this.cm);
},
active: function() {
return this.cm.state.completionActive == this;
},
pick: function(data, i) {
var completion = data.list[i];
if (completion.hint) completion.hint(this.cm, data, completion);
else this.cm.replaceRange(getText(completion), completion.from || data.from,
completion.to || data.to, "complete");
CodeMirrror.signal(data, "pick", completion);
this.close();
},
showHints: function(data) {
if (!data || !data.list.length || !this.active()) return this.close();
if (this.options.completeSingle && data.list.length == 1)
this.pick(data, 0);
else
this.showWidget(data);
},
showWidget: function(data) {
this.widget = new Widget(this, data);
CodeMirrror.signal(data, "shown");
var debounce = 0, completion = this, finished;
var closeOn = this.options.closeCharacters;
var startPos = this.cm.getCursor(), startLen = this.cm.getLine(startPos.line).length;
var requestAnimationFrame = window.requestAnimationFrame || function(fn) {
return setTimeout(fn, 1000/60);
};
var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;
function done() {
if (finished) return;
finished = true;
completion.close();
completion.cm.off("cursorActivity", activity);
if (data) CodeMirrror.signal(data, "close");
}
function update() {
if (finished) return;
CodeMirrror.signal(data, "update");
retrieveHints(completion.options.hint, completion.cm, completion.options, finishUpdate);
}
function finishUpdate(data_) {
data = data_;
if (finished) return;
if (!data || !data.list.length) return done();
if (completion.widget) completion.widget.close();
completion.widget = new Widget(completion, data);
}
function clearDebounce() {
if (debounce) {
cancelAnimationFrame(debounce);
debounce = 0;
}
}
function activity() {
clearDebounce();
var pos = completion.cm.getCursor(), line = completion.cm.getLine(pos.line);
if (pos.line != startPos.line || line.length - pos.ch != startLen - startPos.ch ||
pos.ch < startPos.ch || completion.cm.somethingSelected() ||
(pos.ch && closeOn.test(line.charAt(pos.ch - 1)))) {
completion.close();
} else {
debounce = requestAnimationFrame(update);
if (completion.widget) completion.widget.close();
}
}
this.cm.on("cursorActivity", activity);
this.onClose = done;
},
buildOptions: function(options) {
var editor = this.cm.options.hintOptions;
var out = {};
for (var prop in defaultOptions) out[prop] = defaultOptions[prop];
if (editor) for (var prop in editor)
if (editor[prop] !== undefined) out[prop] = editor[prop];
if (options) for (var prop in options)
if (options[prop] !== undefined) out[prop] = options[prop];
return out;
}
};
function getText(completion) {
if (typeof completion == "string") return completion;
else return completion.text;
}
function buildKeyMap(completion, handle) {
var baseMap = {
Up: function() {handle.moveFocus(-1);},
Down: function() {handle.moveFocus(1);},
PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},
PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},
Home: function() {handle.setFocus(0);},
End: function() {handle.setFocus(handle.length - 1);},
Enter: handle.pick,
Tab: handle.pick,
Esc: handle.close
};
var custom = completion.options.customKeys;
var ourMap = custom ? {} : baseMap;
function addBinding(key, val) {
var bound;
if (typeof val != "string")
bound = function(cm) { return val(cm, handle); };
// This mechanism is deprecated
else if (baseMap.hasOwnProperty(val))
bound = baseMap[val];
else
bound = val;
ourMap[key] = bound;
}
if (custom)
for (var key in custom) if (custom.hasOwnProperty(key))
addBinding(key, custom[key]);
var extra = completion.options.extraKeys;
if (extra)
for (var key in extra) if (extra.hasOwnProperty(key))
addBinding(key, extra[key]);
return ourMap;
}
function getHintElement(hintsElement, el) {
while (el && el != hintsElement) {
if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el;
el = el.parentNode;
}
}
function Widget(completion, data) {
this.completion = completion;
this.data = data;
var widget = this, cm = completion.cm;
var hints = this.hints = document.createElement("ul");
hints.className = "CodeMirrror-hints";
this.selectedHint = data.selectedHint || 0;
var completions = data.list;
for (var i = 0; i < completions.length; ++i) {
var elt = hints.appendChild(document.createElement("li")), cur = completions[i];
var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS);
if (cur.className != null) className = cur.className + " " + className;
elt.className = className;
if (cur.render) cur.render(elt, data, cur);
else elt.appendChild(document.createTextNode(cur.displayText || getText(cur)));
elt.hintId = i;
}
var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);
var left = pos.left, top = pos.bottom, below = true;
hints.style.left = left + "px";
hints.style.top = top + "px";
// If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
(completion.options.container || document.body).appendChild(hints);
var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;
if (overlapY > 0) {
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
if (curTop - height > 0) { // Fits above cursor
hints.style.top = (top = pos.top - height) + "px";
below = false;
} else if (height > winH) {
hints.style.height = (winH - 5) + "px";
hints.style.top = (top = pos.bottom - box.top) + "px";
var cursor = cm.getCursor();
if (data.from.ch != cursor.ch) {
pos = cm.cursorCoords(cursor);
hints.style.left = (left = pos.left) + "px";
box = hints.getBoundingClientRect();
}
}
}
var overlapX = box.right - winW;
if (overlapX > 0) {
if (box.right - box.left > winW) {
hints.style.width = (winW - 5) + "px";
overlapX -= (box.right - box.left) - winW;
}
hints.style.left = (left = pos.left - overlapX) + "px";
}
cm.addKeyMap(this.keyMap = buildKeyMap(completion, {
moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },
setFocus: function(n) { widget.changeActive(n); },
menuSize: function() { return widget.screenAmount(); },
length: completions.length,
close: function() { completion.close(); },
pick: function() { widget.pick(); },
data: data
}));
if (completion.options.closeOnUnfocus) {
var closingOnBlur;
cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });
cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); });
}
var startScroll = cm.getScrollInfo();
cm.on("scroll", this.onScroll = function() {
var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
var newTop = top + startScroll.top - curScroll.top;
var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop);
if (!below) point += hints.offsetHeight;
if (point <= editor.top || point >= editor.bottom) return completion.close();
hints.style.top = newTop + "px";
hints.style.left = (left + startScroll.left - curScroll.left) + "px";
});
CodeMirrror.on(hints, "dblclick", function(e) {
var t = getHintElement(hints, e.target || e.srcElement);
if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}
});
CodeMirrror.on(hints, "click", function(e) {
var t = getHintElement(hints, e.target || e.srcElement);
if (t && t.hintId != null) {
widget.changeActive(t.hintId);
if (completion.options.completeOnSingleClick) widget.pick();
}
});
CodeMirrror.on(hints, "mousedown", function() {
setTimeout(function(){cm.focus();}, 20);
});
CodeMirrror.signal(data, "select", completions[0], hints.firstChild);
return true;
}
Widget.prototype = {
close: function() {
if (this.completion.widget != this) return;
this.completion.widget = null;
this.hints.parentNode.removeChild(this.hints);
this.completion.cm.removeKeyMap(this.keyMap);
var cm = this.completion.cm;
if (this.completion.options.closeOnUnfocus) {
cm.off("blur", this.onBlur);
cm.off("focus", this.onFocus);
}
cm.off("scroll", this.onScroll);
},
pick: function() {
this.completion.pick(this.data, this.selectedHint);
},
changeActive: function(i, avoidWrap) {
if (i >= this.data.list.length)
i = avoidWrap ? this.data.list.length - 1 : 0;
else if (i < 0)
i = avoidWrap ? 0 : this.data.list.length - 1;
if (this.selectedHint == i) return;
var node = this.hints.childNodes[this.selectedHint];
node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, "");
node = this.hints.childNodes[this.selectedHint = i];
node.className += " " + ACTIVE_HINT_ELEMENT_CLASS;
if (node.offsetTop < this.hints.scrollTop)
this.hints.scrollTop = node.offsetTop - 3;
else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;
CodeMirrror.signal(this.data, "select", this.data.list[this.selectedHint], node);
},
screenAmount: function() {
return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;
}
};
CodeMirrror.registerHelper("hint", "auto", function(cm, options) {
var helpers = cm.getHelpers(cm.getCursor(), "hint"), words;
if (helpers.length) {
for (var i = 0; i < helpers.length; i++) {
var cur = helpers[i](cm, options);
if (cur && cur.list.length) return cur;
}
} else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
if (words) return CodeMirrror.hint.fromList(cm, {words: words});
} else if (CodeMirrror.hint.anyword) {
return CodeMirrror.hint.anyword(cm, options);
}
});
CodeMirrror.registerHelper("hint", "fromList", function(cm, options) {
var cur = cm.getCursor(), token = cm.getTokenAt(cur);
var found = [];
for (var i = 0; i < options.words.length; i++) {
var word = options.words[i];
if (word.slice(0, token.string.length) == token.string)
found.push(word);
}
if (found.length) return {
list: found,
from: CodeMirrror.Pos(cur.line, token.start),
to: CodeMirrror.Pos(cur.line, token.end)
};
});
CodeMirrror.commands.autocomplete = CodeMirrror.showHint;
var defaultOptions = {
hint: CodeMirrror.hint.auto,
completeSingle: true,
alignWithWord: true,
closeCharacters: /[\s()\[\]{};:>,]/,
closeOnUnfocus: true,
completeOnSingleClick: false,
container: null,
customKeys: null,
extraKeys: null
};
CodeMirrror.defineOption("hintOptions", null);
});
| 36.536709 | 119 | 0.62209 |
c60f63527dffccc69713be3f7b52983532a53921 | 671 | js | JavaScript | src/static/js/tabular/export.js | intersystems-ru/iknow-entity-browser | ddd0ae56af93183e10695719ff382a862fb8ab2d | [
"MIT"
] | null | null | null | src/static/js/tabular/export.js | intersystems-ru/iknow-entity-browser | ddd0ae56af93183e10695719ff382a862fb8ab2d | [
"MIT"
] | 7 | 2017-04-19T01:31:29.000Z | 2018-08-29T18:44:58.000Z | src/static/js/tabular/export.js | intersystems-ru/iknow-entity-browser | ddd0ae56af93183e10695719ff382a862fb8ab2d | [
"MIT"
] | 4 | 2017-11-18T10:55:07.000Z | 2019-03-26T02:47:34.000Z | /**
* @param {*[][]} dataArray - Table to be exported.
*/
export function csv (dataArray = []) {
console.log(dataArray);
let csvContent = "data:text/csv;charset=utf-8,";
dataArray.forEach((infoArray, index) => {
let dataString = infoArray.join(",");
csvContent += index < dataArray.length ? dataString + "\n" : dataString;
});
let encodedUri = encodeURI(csvContent),
link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", "entityGraph.csv");
document.body.appendChild(link);
link.click();
setTimeout(() => link.parentNode.removeChild(link), 10);
} | 25.807692 | 80 | 0.627422 |
c60faa31d7cad2836eb17666c0928951ea7c7c4d | 354 | js | JavaScript | problems/1047/index.js | zhangJQK/leetcode | 6538c45c83cf9bcc66a41dcc2ad9676f27c22e46 | [
"MIT"
] | null | null | null | problems/1047/index.js | zhangJQK/leetcode | 6538c45c83cf9bcc66a41dcc2ad9676f27c22e46 | [
"MIT"
] | null | null | null | problems/1047/index.js | zhangJQK/leetcode | 6538c45c83cf9bcc66a41dcc2ad9676f27c22e46 | [
"MIT"
] | null | null | null | /**
* @param {string} S
* @return {string}
*/
const removeDuplicates = (S) => {
if (S.length <= 1) {
return S;
}
const removedS = removeDuplicates(S.slice(0, S.length - 1));
if (removedS[removedS.length - 1] === S[S.length - 1]) {
return removedS.slice(0, removedS.length - 1);
} else {
return removedS + S[S.length - 1];
}
};
| 22.125 | 62 | 0.573446 |
c60fcca00895ecfd442276c6875c43c7cf4c2104 | 10,866 | js | JavaScript | sollus3/src/main/webapp/openui/sap/ui/documentation/sdk/thirdparty/jsanalyzer/ModuleAnalyzer.js | guilhermepe/SOLLUS | dca8c366390b2b36b3cd520802e603f5767875d1 | [
"MIT"
] | null | null | null | sollus3/src/main/webapp/openui/sap/ui/documentation/sdk/thirdparty/jsanalyzer/ModuleAnalyzer.js | guilhermepe/SOLLUS | dca8c366390b2b36b3cd520802e603f5767875d1 | [
"MIT"
] | null | null | null | sollus3/src/main/webapp/openui/sap/ui/documentation/sdk/thirdparty/jsanalyzer/ModuleAnalyzer.js | guilhermepe/SOLLUS | dca8c366390b2b36b3cd520802e603f5767875d1 | [
"MIT"
] | null | null | null | /*!
* UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-2018 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
sap.ui.define(['jquery.sap.global','sap/ui/base/ManagedObjectMetadata','./ASTUtils','./Doclet','sap/ui/documentation/sdk/thirdparty/esprima'],function(q,M,A,D,e){"use strict";var S=esprima.Syntax;var c;var I;var p;var C;var s;var a=A.createPropertyMap;var u=A.unlend;var g=M._guessSingularName;var b=D.get;var d=q.sap.log.error;var w=q.sap.log.warning;var v=q.sap.log.debug;function f(n){return(n&&n.type===S.CallExpression&&n.callee.type===S.MemberExpression&&n.callee.property.type===S.Identifier&&n.callee.property.name==='extend'&&n.arguments.length>=2&&n.arguments[0].type===S.Literal&&typeof n.arguments[0].value==="string"&&u(n.arguments[1]).type===S.ObjectExpression);}function h(n){return(n&&n.type===S.CallExpression&&n.callee.type===S.MemberExpression&&k(n.callee)==='sap.ui.define');}function k(n){if(n.type===S.MemberExpression){var i=k(n.object);return i?i+"."+n.property.name:null;}else if(n.type===S.Identifier){return s[n.name]?s[n.name]:n.name;}else{return null;}}function l(n,i){var j;if(n.type===S.Literal){return n.value;}else if(n.type===S.UnaryExpression&&n.prefix&&n.argument.type===S.Literal&&typeof n.argument.value==='number'&&(n.operator==='-'||n.operator==='+')){j=n.argument.value;return n.operator==='-'?-j:j;}else if(n.type===S.MemberExpression&&i){j=k(n);if(j.indexOf(i+".")===0){return j.slice(i.length+1);}else if(j.indexOf(i.split(".").slice(-1)[0]+".")===0){return j.slice(i.split(".").slice(-1)[0].length+1);}else{w("did not understand default value '%s', falling back to source",j);return j;}}else if(n.type===S.Identifier&&n.name==='undefined'){return undefined;}else if(n.type===S.ArrayExpression&&n.elements.length===0){return"[]";}d("unexpected type of default value (type='%s', source='%s'), falling back to '???'",n.type,JSON.stringify(n,null,"\t"));return'???';}function m(i,j){var E=k(i.callee.object);var F={metatype:'control',name:i.arguments[0].value,baseType:E,doc:j&&(j.classdesc||j.description),deprecation:j&&j.deprecated,since:j&&j.since,experimental:j&&j.experimental,specialSettings:{},properties:{},aggregations:{},associations:{},events:{},methods:{}};function G(n){return n.slice(0,1).toUpperCase()+n.slice(1);}function H(N,O,P){var Q,n,R,T;Q=N&&a(N.value);if(Q){for(n in Q){if(Q.hasOwnProperty(n)){T=b(Q[n]);R=a(Q[n].value,O);if(R==null){d("no valid metadata for "+n+" (AST type '"+Q[n].value.type+"')");continue;}P(n,R,T,Q[n]);}}}}var J=u(i.arguments[1]);var K=a(J);if(K&&K.metadata&&K.metadata.value.type!==S.ObjectExpression){w("class metadata exists but can't be analyzed. It is not of type 'ObjectExpression', but a '"+K.metadata.value.type+"'.");return null;}var L=K&&K.metadata&&a(K.metadata.value);if(L){v(" analyzing metadata for '"+F.name+"'");F["abstract"]=!!(L["abstract"]&&L["abstract"].value.value);F["final"]=!!(L["final"]&&L["final"].value.value);H(L.specialSettings,"readonly",function(n,N,O){F.specialSettings[n]={name:n,doc:O&&O.description,since:O&&O.since,deprecation:O&&O.deprecated,experimental:O&&O.experimental,visibility:(N.visibility&&N.visibility.value.value)||"public",type:N.type?N.type.value.value:"any",readonly:(N.readyonly&&N.readonly.value.value)||true};});H(L.properties,"type",function(n,O,P){var Q;var N=G(n);var R;F.properties[n]={name:n,doc:P&&P.description,since:P&&P.since,deprecation:P&&P.deprecated,experimental:P&&P.experimental,visibility:(O.visibility&&O.visibility.value.value)||"public",type:(Q=O.type?O.type.value.value:"string"),defaultValue:O.defaultValue?l(O.defaultValue.value,Q):null,group:O.group?O.group.value.value:'Misc',bindable:O.bindable?!!l(O.bindable.value):false,methods:(R={"get":"get"+N,"set":"set"+N})};if(F.properties[n].bindable){R["bind"]="bind"+N;R["unbind"]="unbind"+N;}});F.defaultAggregation=(L.defaultAggregation&&L.defaultAggregation.value.value)||undefined;H(L.aggregations,"type",function(n,O,P){var N=G(n);var Q;F.aggregations[n]={name:n,doc:P&&P.description,deprecation:P&&P.deprecated,since:P&&P.since,experimental:P&&P.experimental,visibility:(O.visibility&&O.visibility.value.value)||"public",type:O.type?O.type.value.value:"sap.ui.core.Control",singularName:O.singularName?O.singularName.value.value:g(n),cardinality:(O.multiple&&!O.multiple.value.value)?"0..1":"0..n",bindable:O.bindable?!!l(O.bindable.value):false,methods:(Q={"get":"get"+N,"destroy":"destroy"+N})};if(F.aggregations[n].cardinality==="0..1"){Q["set"]="set"+N;}else{var R=G(F.aggregations[n].singularName);Q["insert"]="insert"+R;Q["add"]="add"+R;Q["remove"]="remove"+R;Q["indexOf"]="indexOf"+R;Q["removeAll"]="removeAll"+N;}if(F.aggregations[n].bindable){Q["bind"]="bind"+N;Q["unbind"]="unbind"+N;}});H(L.associations,"type",function(n,O,P){var N=G(n);var Q;F.associations[n]={name:n,doc:P&&P.description,deprecation:P&&P.deprecated,since:P&&P.since,experimental:P&&P.experimental,visibility:(O.visibility&&O.visibility.value.value)||"public",type:O.type?O.type.value.value:"sap.ui.core.Control",singularName:O.singularName?O.singularName.value.value:g(n),cardinality:(O.multiple&&O.multiple.value.value)?"0..n":"0..1",methods:(Q={"get":"get"+N})};if(F.associations[n].cardinality==="0..1"){Q["set"]="set"+N;}else{var R=G(F.associations[n].singularName);Q["add"]="add"+R;Q["remove"]="remove"+R;Q["removeAll"]="removeAll"+N;}});H(L.events,null,function(n,O,P){var N=G(n);var Q=F.events[n]={name:n,doc:P&&P.description,deprecation:P&&P.deprecated,since:P&&P.since,experimental:P&&P.experimental,allowPreventDefault:!!(O.allowPreventDefault&&O.allowPreventDefault.value.value),parameters:{},methods:{"attach":"attach"+N,"detach":"detach"+N,"fire":"fire"+N}};H(O.parameters,null,function(R,T,U){Q.parameters[R]={name:R,doc:U&&U.description,deprecation:U&&U.deprecated,since:U&&U.since,experimental:U&&U.experimental,type:T&&T.type?T.type.value.value:""};});});}return F;}function o(n){var j=D.get(n);var E=k(n.expression.left);if(E&&j&&j.isPublic()){var T={metatype:"type",doc:undefined,deprecation:false,visibility:'public'};T.name=E;if(j){T.doc=j.description;T.deprecation=j.deprecation;T.since=j.since;T.experimental=j.experimental;}var F=n.expression.right.properties||[];T.values={};for(var i=0;i<F.length;i++){var G=D.get(F[i]);var H=F[i].key;var J=F[i].value;var K={};if(H.type==S.Identifier){K.name=H.name;}else if(H.type==S.Literal){K.name=H.value;}else{throw new Error();}if(J.type==S.Literal){K.value=J.value;}else{throw new Error();}if(G!=null){K.doc=G.description;K.deprecation=G.deprecation;K.since=G.since;K.experimental=G.experimental;}T.values[K.name]=K;}I.push(T);}}function r(n){var i=D.get(n);var j=n.expression.right.arguments[0].value;var E=A.createPropertyMap(n.expression.right.arguments[1]);var F=null;if(n.expression.right.arguments.length>2&&n.expression.right.arguments[2].type==S.CallExpression&&n.expression.right.arguments[2].callee.type==S.MemberExpression&&k(n.expression.right.arguments[2].callee)=="sap.ui.base.DataType.getType"&&n.expression.right.arguments[2].arguments.length>0&&n.expression.right.arguments[2].arguments[0].type==S.Literal){F=n.expression.right.arguments[2].arguments[0].value;}if(j&&i&&i.isPublic()){var T={metatype:"type",doc:undefined,deprecation:false,visibility:'public'};T.name=j;if(i){T.doc=i.description;T.deprecation=i.deprecation;T.since=i.since;T.experimental=i.experimental;}var G=E.defaultValue;if(G){T.defaultValue=l(G.value,j);}var H=E.isValid;if(H&&H.value.type==S.FunctionExpression&&H.value.body&&H.value.body.body.length>0&&H.value.body.body[0].type==S.ReturnStatement&&H.value.body.body[0].argument.type==S.CallExpression&&H.value.body.body[0].argument.callee.type==S.MemberExpression&&H.value.body.body[0].argument.callee.object.type==S.Literal&&H.value.body.body[0].argument.callee.object.value instanceof RegExp){var J=H.value.body.body[0].argument.callee.object.value.source;if(/^\^\(.*\)\$$/.test(J)){J=J.slice(2,-2);}T.pattern=J;}T.baseType=F;I.push(T);}}function t(i){return/^\.\//.test(i)?c+i.slice(1):i;}function x(P,j){var n='',E='',F,G,H=/{(.*)}/,J;for(var i=0;i<j.length;i++){if(j[i].tag!=='param'){continue;}J=H.exec(j[i].content);F=j[i].content.indexOf(P);if(J&&F>-1){n=J[1];G=F+P.length;E=j[i].content.substr(G);E=E.replace(/[-]/,'').trim();break;}}return{name:P,type:n,doc:E};}var y={"ExpressionStatement":function(n){if(h(n.expression)){var i=0;var E,F;if(i<n.expression.arguments.length&&n.expression.arguments[i].type===S.Literal){n.expression.arguments[i++].value;}if(i<n.expression.arguments.length&&n.expression.arguments[i].type===S.ArrayExpression){E=n.expression.arguments[i++].elements;}if(i<n.expression.arguments.length&&n.expression.arguments[i].type===S.FunctionExpression){F=n.expression.arguments[i++];}if(E&&F&&F.params){for(var j=0;j<E.length;j++){var G=E[j].type===S.Literal?t(E[j].value):null;var H=j<F.params.length?F.params[j].name:null;if(G&&H){s[H]=G.replace(/\//g,'.');}}}}if(n.expression.type==S.AssignmentExpression&&n.expression.right.type==S.ObjectExpression&&n.expression.left.type==S.MemberExpression){o(n);}if(n.expression.type===S.AssignmentExpression&&n.expression.right.type===S.CallExpression&&n.expression.right.callee.type===S.MemberExpression&&n.expression.right.callee.property.type===S.Identifier&&n.expression.right.callee.property.name==='createType'&&k(n.expression.right.callee.object)=='sap.ui.base.DataType'&&n.expression.right.arguments.length>=2&&n.expression.right.arguments[0].type===S.Literal&&n.expression.right.arguments[1].type===S.ObjectExpression){r(n);}if(f(n.expression)){var J=D.get(n)||D.get(n.expression);var K=m(n.expression,J);if(K){I.push(K);}}},"VariableDeclaration":function(n){if(n.declarations.length==1&&n.declarations[0].init&&f(n.declarations[0].init)){var i=D.get(n)||D.get(n.declarations[0]);var j=m(n.declarations[0].init,i);if(j){I.push(j);}}},"FunctionExpression":function(n){var F=n.body.body;F.forEach(function(i){if(i.expression&&i.expression.type!==S.AssignmentExpression){return;}var P=i;var j=D.get(i);if(j&&j.isPublic()&&P.expression&&P.expression.left&&P.expression.left.property&&P.expression.left.object&&P.expression.left.object.object&&P.expression.left.object.object.name===C){var E={},G=P.expression.right.params?P.expression.right.params:[];E.name=P.expression.left.property.name;E.doc=j.description;E.since=j.since;E.experimental=j.experimental;E.deprecation=j.deprecated;E.type=j.type?j.type:'';E.parameters=[];G.forEach(function(H){var J=x(H.name,j.tags);E.parameters.push(J);});p[E.name]=E;}});}};function z(i){i.methods=p;}function B(j,E,n){c=n.split('/').slice(0,-1).join('/');I=[];p={};s={};C=E.split('.').pop();var F=esprima.parse(j,{comment:true,attachComment:true});A.visit(F,y);for(var i=0;i<I.length;i++){if(I[i].name===E){z(I[i]);return I[i];}}}return{analyze:B};},false);
| 1,552.285714 | 10,679 | 0.714798 |
c61021d86d23742694ecfe10f4a960deb6886005 | 931 | js | JavaScript | src/Currency.js | DePayFi/depay-local-currency | 939ea071610947554a005f3be302585e0673ba7f | [
"MIT"
] | 1 | 2021-09-22T23:45:08.000Z | 2021-09-22T23:45:08.000Z | src/Currency.js | DePayFi/depay-local-currency | 939ea071610947554a005f3be302585e0673ba7f | [
"MIT"
] | null | null | null | src/Currency.js | DePayFi/depay-local-currency | 939ea071610947554a005f3be302585e0673ba7f | [
"MIT"
] | null | null | null | import timezoneToCurrency from './timezoneToCurrency'
class Currency {
constructor({ amount, code, timeZone = Currency.timeZone() }) {
this.amount = amount
this.code = code || timezoneToCurrency[timeZone] || 'USD'
this.timeZone = timeZone
}
static async fromUSD({ amount, code, timeZone, apiKey }) {
let currency = new Currency({ amount, code, timeZone })
let rate = await fetch('https://api.depay.fi/v2/currencies/' + currency.code, {
headers: { 'X-Api-Key': apiKey },
})
.then((response) => response.json())
.then((data) => parseFloat(data))
currency.amount = currency.amount * rate
return currency
}
static timeZone() {
return Intl.DateTimeFormat().resolvedOptions().timeZone
}
toString() {
return new Intl.NumberFormat(navigator.language, {
style: 'currency',
currency: this.code,
}).format(this.amount)
}
}
export default Currency
| 27.382353 | 83 | 0.653061 |
c610342c2b6a09511c67793a4c08c6ec3d14b65f | 19,622 | js | JavaScript | node_modules/rc-tabs/lib/TabNavList/index.js | inspi-writer001/swap_token | 58c16c18e955992946db8f065abb9211a1148a6f | [
"MIT"
] | null | null | null | node_modules/rc-tabs/lib/TabNavList/index.js | inspi-writer001/swap_token | 58c16c18e955992946db8f065abb9211a1148a6f | [
"MIT"
] | null | null | null | node_modules/rc-tabs/lib/TabNavList/index.js | inspi-writer001/swap_token | 58c16c18e955992946db8f065abb9211a1148a6f | [
"MIT"
] | null | null | null | "use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var React = _interopRequireWildcard(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _raf = _interopRequireDefault(require("rc-util/lib/raf"));
var _rcResizeObserver = _interopRequireDefault(require("rc-resize-observer"));
var _useRaf = _interopRequireWildcard(require("../hooks/useRaf"));
var _TabNode = _interopRequireDefault(require("./TabNode"));
var _useOffsets = _interopRequireDefault(require("../hooks/useOffsets"));
var _useVisibleRange3 = _interopRequireDefault(require("../hooks/useVisibleRange"));
var _OperationNode = _interopRequireDefault(require("./OperationNode"));
var _TabContext = _interopRequireDefault(require("../TabContext"));
var _useTouchMove = _interopRequireDefault(require("../hooks/useTouchMove"));
var _useRefs3 = _interopRequireDefault(require("../hooks/useRefs"));
var _AddButton = _interopRequireDefault(require("./AddButton"));
var _useSyncState5 = _interopRequireDefault(require("../hooks/useSyncState"));
var ExtraContent = function ExtraContent(_ref) {
var position = _ref.position,
prefixCls = _ref.prefixCls,
extra = _ref.extra;
if (!extra) return null;
var content; // Parse extra
var assertExtra = {};
if (extra && (0, _typeof2.default)(extra) === 'object' && ! /*#__PURE__*/React.isValidElement(extra)) {
assertExtra = extra;
} else {
assertExtra.right = extra;
}
if (position === 'right') {
content = assertExtra.right;
}
if (position === 'left') {
content = assertExtra.left;
}
return content ? /*#__PURE__*/React.createElement("div", {
className: "".concat(prefixCls, "-extra-content")
}, content) : null;
};
function TabNavList(props, ref) {
var _classNames;
var _React$useContext = React.useContext(_TabContext.default),
prefixCls = _React$useContext.prefixCls,
tabs = _React$useContext.tabs;
var className = props.className,
style = props.style,
id = props.id,
animated = props.animated,
activeKey = props.activeKey,
rtl = props.rtl,
extra = props.extra,
editable = props.editable,
locale = props.locale,
tabPosition = props.tabPosition,
tabBarGutter = props.tabBarGutter,
children = props.children,
onTabClick = props.onTabClick,
onTabScroll = props.onTabScroll;
var tabsWrapperRef = (0, React.useRef)();
var tabListRef = (0, React.useRef)();
var operationsRef = (0, React.useRef)();
var innerAddButtonRef = (0, React.useRef)();
var _useRefs = (0, _useRefs3.default)(),
_useRefs2 = (0, _slicedToArray2.default)(_useRefs, 2),
getBtnRef = _useRefs2[0],
removeBtnRef = _useRefs2[1];
var tabPositionTopOrBottom = tabPosition === 'top' || tabPosition === 'bottom';
var _useSyncState = (0, _useSyncState5.default)(0, function (next, prev) {
if (tabPositionTopOrBottom && onTabScroll) {
onTabScroll({
direction: next > prev ? 'left' : 'right'
});
}
}),
_useSyncState2 = (0, _slicedToArray2.default)(_useSyncState, 2),
transformLeft = _useSyncState2[0],
setTransformLeft = _useSyncState2[1];
var _useSyncState3 = (0, _useSyncState5.default)(0, function (next, prev) {
if (!tabPositionTopOrBottom && onTabScroll) {
onTabScroll({
direction: next > prev ? 'top' : 'bottom'
});
}
}),
_useSyncState4 = (0, _slicedToArray2.default)(_useSyncState3, 2),
transformTop = _useSyncState4[0],
setTransformTop = _useSyncState4[1];
var _useState = (0, React.useState)(0),
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
wrapperScrollWidth = _useState2[0],
setWrapperScrollWidth = _useState2[1];
var _useState3 = (0, React.useState)(0),
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
wrapperScrollHeight = _useState4[0],
setWrapperScrollHeight = _useState4[1];
var _useState5 = (0, React.useState)(0),
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
wrapperContentWidth = _useState6[0],
setWrapperContentWidth = _useState6[1];
var _useState7 = (0, React.useState)(0),
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
wrapperContentHeight = _useState8[0],
setWrapperContentHeight = _useState8[1];
var _useState9 = (0, React.useState)(null),
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
wrapperWidth = _useState10[0],
setWrapperWidth = _useState10[1];
var _useState11 = (0, React.useState)(null),
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
wrapperHeight = _useState12[0],
setWrapperHeight = _useState12[1];
var _useState13 = (0, React.useState)(0),
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
addWidth = _useState14[0],
setAddWidth = _useState14[1];
var _useState15 = (0, React.useState)(0),
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
addHeight = _useState16[0],
setAddHeight = _useState16[1];
var _useRafState = (0, _useRaf.useRafState)(new Map()),
_useRafState2 = (0, _slicedToArray2.default)(_useRafState, 2),
tabSizes = _useRafState2[0],
setTabSizes = _useRafState2[1];
var tabOffsets = (0, _useOffsets.default)(tabs, tabSizes, wrapperScrollWidth); // ========================== Util =========================
var operationsHiddenClassName = "".concat(prefixCls, "-nav-operations-hidden");
var transformMin = 0;
var transformMax = 0;
if (!tabPositionTopOrBottom) {
transformMin = Math.min(0, wrapperHeight - wrapperScrollHeight);
transformMax = 0;
} else if (rtl) {
transformMin = 0;
transformMax = Math.max(0, wrapperScrollWidth - wrapperWidth);
} else {
transformMin = Math.min(0, wrapperWidth - wrapperScrollWidth);
transformMax = 0;
}
function alignInRange(value) {
if (value < transformMin) {
return transformMin;
}
if (value > transformMax) {
return transformMax;
}
return value;
} // ========================= Mobile ========================
var touchMovingRef = (0, React.useRef)();
var _useState17 = (0, React.useState)(),
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
lockAnimation = _useState18[0],
setLockAnimation = _useState18[1];
function doLockAnimation() {
setLockAnimation(Date.now());
}
function clearTouchMoving() {
window.clearTimeout(touchMovingRef.current);
}
(0, _useTouchMove.default)(tabsWrapperRef, function (offsetX, offsetY) {
function doMove(setState, offset) {
setState(function (value) {
var newValue = alignInRange(value + offset);
return newValue;
});
}
if (tabPositionTopOrBottom) {
// Skip scroll if place is enough
if (wrapperWidth >= wrapperScrollWidth) {
return false;
}
doMove(setTransformLeft, offsetX);
} else {
if (wrapperHeight >= wrapperScrollHeight) {
return false;
}
doMove(setTransformTop, offsetY);
}
clearTouchMoving();
doLockAnimation();
return true;
});
(0, React.useEffect)(function () {
clearTouchMoving();
if (lockAnimation) {
touchMovingRef.current = window.setTimeout(function () {
setLockAnimation(0);
}, 100);
}
return clearTouchMoving;
}, [lockAnimation]); // ========================= Scroll ========================
function scrollToTab() {
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : activeKey;
var tabOffset = tabOffsets.get(key) || {
width: 0,
height: 0,
left: 0,
right: 0,
top: 0
};
if (tabPositionTopOrBottom) {
// ============ Align with top & bottom ============
var newTransform = transformLeft; // RTL
if (rtl) {
if (tabOffset.right < transformLeft) {
newTransform = tabOffset.right;
} else if (tabOffset.right + tabOffset.width > transformLeft + wrapperWidth) {
newTransform = tabOffset.right + tabOffset.width - wrapperWidth;
}
} // LTR
else if (tabOffset.left < -transformLeft) {
newTransform = -tabOffset.left;
} else if (tabOffset.left + tabOffset.width > -transformLeft + wrapperWidth) {
newTransform = -(tabOffset.left + tabOffset.width - wrapperWidth);
}
setTransformTop(0);
setTransformLeft(alignInRange(newTransform));
} else {
// ============ Align with left & right ============
var _newTransform = transformTop;
if (tabOffset.top < -transformTop) {
_newTransform = -tabOffset.top;
} else if (tabOffset.top + tabOffset.height > -transformTop + wrapperHeight) {
_newTransform = -(tabOffset.top + tabOffset.height - wrapperHeight);
}
setTransformLeft(0);
setTransformTop(alignInRange(_newTransform));
}
} // ========================== Tab ==========================
// Render tab node & collect tab offset
var _useVisibleRange = (0, _useVisibleRange3.default)(tabOffsets, {
width: wrapperWidth,
height: wrapperHeight,
left: transformLeft,
top: transformTop
}, {
width: wrapperContentWidth,
height: wrapperContentHeight
}, {
width: addWidth,
height: addHeight
}, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
tabs: tabs
})),
_useVisibleRange2 = (0, _slicedToArray2.default)(_useVisibleRange, 2),
visibleStart = _useVisibleRange2[0],
visibleEnd = _useVisibleRange2[1];
var tabNodeStyle = {};
if (tabPosition === 'top' || tabPosition === 'bottom') {
tabNodeStyle[rtl ? 'marginRight' : 'marginLeft'] = tabBarGutter;
} else {
tabNodeStyle.marginTop = tabBarGutter;
}
var tabNodes = tabs.map(function (tab, i) {
var key = tab.key;
return /*#__PURE__*/React.createElement(_TabNode.default, {
id: id,
prefixCls: prefixCls,
key: key,
tab: tab
/* first node should not have margin left */
,
style: i === 0 ? undefined : tabNodeStyle,
closable: tab.closable,
editable: editable,
active: key === activeKey,
renderWrapper: children,
removeAriaLabel: locale === null || locale === void 0 ? void 0 : locale.removeAriaLabel,
ref: getBtnRef(key),
onClick: function onClick(e) {
onTabClick(key, e);
},
onRemove: function onRemove() {
removeBtnRef(key);
},
onFocus: function onFocus() {
scrollToTab(key);
doLockAnimation();
if (!tabsWrapperRef.current) {
return;
} // Focus element will make scrollLeft change which we should reset back
if (!rtl) {
tabsWrapperRef.current.scrollLeft = 0;
}
tabsWrapperRef.current.scrollTop = 0;
}
});
});
var onListHolderResize = (0, _useRaf.default)(function () {
var _tabsWrapperRef$curre, _tabsWrapperRef$curre2, _innerAddButtonRef$cu, _innerAddButtonRef$cu2, _operationsRef$curren, _operationsRef$curren2, _tabListRef$current, _tabListRef$current2, _operationsRef$curren3;
// Update wrapper records
var offsetWidth = ((_tabsWrapperRef$curre = tabsWrapperRef.current) === null || _tabsWrapperRef$curre === void 0 ? void 0 : _tabsWrapperRef$curre.offsetWidth) || 0;
var offsetHeight = ((_tabsWrapperRef$curre2 = tabsWrapperRef.current) === null || _tabsWrapperRef$curre2 === void 0 ? void 0 : _tabsWrapperRef$curre2.offsetHeight) || 0;
var newAddWidth = ((_innerAddButtonRef$cu = innerAddButtonRef.current) === null || _innerAddButtonRef$cu === void 0 ? void 0 : _innerAddButtonRef$cu.offsetWidth) || 0;
var newAddHeight = ((_innerAddButtonRef$cu2 = innerAddButtonRef.current) === null || _innerAddButtonRef$cu2 === void 0 ? void 0 : _innerAddButtonRef$cu2.offsetHeight) || 0;
var newOperationWidth = ((_operationsRef$curren = operationsRef.current) === null || _operationsRef$curren === void 0 ? void 0 : _operationsRef$curren.offsetWidth) || 0;
var newOperationHeight = ((_operationsRef$curren2 = operationsRef.current) === null || _operationsRef$curren2 === void 0 ? void 0 : _operationsRef$curren2.offsetHeight) || 0;
setWrapperWidth(offsetWidth);
setWrapperHeight(offsetHeight);
setAddWidth(newAddWidth);
setAddHeight(newAddHeight);
var newWrapperScrollWidth = (((_tabListRef$current = tabListRef.current) === null || _tabListRef$current === void 0 ? void 0 : _tabListRef$current.offsetWidth) || 0) - newAddWidth;
var newWrapperScrollHeight = (((_tabListRef$current2 = tabListRef.current) === null || _tabListRef$current2 === void 0 ? void 0 : _tabListRef$current2.offsetHeight) || 0) - newAddHeight;
setWrapperScrollWidth(newWrapperScrollWidth);
setWrapperScrollHeight(newWrapperScrollHeight);
var isOperationHidden = (_operationsRef$curren3 = operationsRef.current) === null || _operationsRef$curren3 === void 0 ? void 0 : _operationsRef$curren3.className.includes(operationsHiddenClassName);
setWrapperContentWidth(newWrapperScrollWidth - (isOperationHidden ? 0 : newOperationWidth));
setWrapperContentHeight(newWrapperScrollHeight - (isOperationHidden ? 0 : newOperationHeight)); // Update buttons records
setTabSizes(function () {
var newSizes = new Map();
tabs.forEach(function (_ref2) {
var key = _ref2.key;
var btnNode = getBtnRef(key).current;
if (btnNode) {
newSizes.set(key, {
width: btnNode.offsetWidth,
height: btnNode.offsetHeight,
left: btnNode.offsetLeft,
top: btnNode.offsetTop
});
}
});
return newSizes;
});
}); // ======================== Dropdown =======================
var startHiddenTabs = tabs.slice(0, visibleStart);
var endHiddenTabs = tabs.slice(visibleEnd + 1);
var hiddenTabs = [].concat((0, _toConsumableArray2.default)(startHiddenTabs), (0, _toConsumableArray2.default)(endHiddenTabs)); // =================== Link & Operations ===================
var _useState19 = (0, React.useState)(),
_useState20 = (0, _slicedToArray2.default)(_useState19, 2),
inkStyle = _useState20[0],
setInkStyle = _useState20[1];
var activeTabOffset = tabOffsets.get(activeKey); // Delay set ink style to avoid remove tab blink
var inkBarRafRef = (0, React.useRef)();
function cleanInkBarRaf() {
_raf.default.cancel(inkBarRafRef.current);
}
(0, React.useEffect)(function () {
var newInkStyle = {};
if (activeTabOffset) {
if (tabPositionTopOrBottom) {
if (rtl) {
newInkStyle.right = activeTabOffset.right;
} else {
newInkStyle.left = activeTabOffset.left;
}
newInkStyle.width = activeTabOffset.width;
} else {
newInkStyle.top = activeTabOffset.top;
newInkStyle.height = activeTabOffset.height;
}
}
cleanInkBarRaf();
inkBarRafRef.current = (0, _raf.default)(function () {
setInkStyle(newInkStyle);
});
return cleanInkBarRaf;
}, [activeTabOffset, tabPositionTopOrBottom, rtl]); // ========================= Effect ========================
(0, React.useEffect)(function () {
scrollToTab();
}, [activeKey, activeTabOffset, tabOffsets, tabPositionTopOrBottom]); // Should recalculate when rtl changed
(0, React.useEffect)(function () {
onListHolderResize();
}, [rtl, tabBarGutter, activeKey, tabs.map(function (tab) {
return tab.key;
}).join('_')]); // ========================= Render ========================
var hasDropdown = !!hiddenTabs.length;
var wrapPrefix = "".concat(prefixCls, "-nav-wrap");
var pingLeft;
var pingRight;
var pingTop;
var pingBottom;
if (tabPositionTopOrBottom) {
if (rtl) {
pingRight = transformLeft > 0;
pingLeft = transformLeft + wrapperWidth < wrapperScrollWidth;
} else {
pingLeft = transformLeft < 0;
pingRight = -transformLeft + wrapperWidth < wrapperScrollWidth;
}
} else {
pingTop = transformTop < 0;
pingBottom = -transformTop + wrapperHeight < wrapperScrollHeight;
}
return /*#__PURE__*/React.createElement("div", {
ref: ref,
role: "tablist",
className: (0, _classnames.default)("".concat(prefixCls, "-nav"), className),
style: style,
onKeyDown: function onKeyDown() {
// No need animation when use keyboard
doLockAnimation();
}
}, /*#__PURE__*/React.createElement(ExtraContent, {
position: "left",
extra: extra,
prefixCls: prefixCls
}), /*#__PURE__*/React.createElement(_rcResizeObserver.default, {
onResize: onListHolderResize
}, /*#__PURE__*/React.createElement("div", {
className: (0, _classnames.default)(wrapPrefix, (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(wrapPrefix, "-ping-left"), pingLeft), (0, _defineProperty2.default)(_classNames, "".concat(wrapPrefix, "-ping-right"), pingRight), (0, _defineProperty2.default)(_classNames, "".concat(wrapPrefix, "-ping-top"), pingTop), (0, _defineProperty2.default)(_classNames, "".concat(wrapPrefix, "-ping-bottom"), pingBottom), _classNames)),
ref: tabsWrapperRef
}, /*#__PURE__*/React.createElement(_rcResizeObserver.default, {
onResize: onListHolderResize
}, /*#__PURE__*/React.createElement("div", {
ref: tabListRef,
className: "".concat(prefixCls, "-nav-list"),
style: {
transform: "translate(".concat(transformLeft, "px, ").concat(transformTop, "px)"),
transition: lockAnimation ? 'none' : undefined
}
}, tabNodes, /*#__PURE__*/React.createElement(_AddButton.default, {
ref: innerAddButtonRef,
prefixCls: prefixCls,
locale: locale,
editable: editable,
style: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, tabNodes.length === 0 ? undefined : tabNodeStyle), {}, {
visibility: hasDropdown ? 'hidden' : null
})
}), /*#__PURE__*/React.createElement("div", {
className: (0, _classnames.default)("".concat(prefixCls, "-ink-bar"), (0, _defineProperty2.default)({}, "".concat(prefixCls, "-ink-bar-animated"), animated.inkBar)),
style: inkStyle
}))))), /*#__PURE__*/React.createElement(_OperationNode.default, (0, _extends2.default)({}, props, {
removeAriaLabel: locale === null || locale === void 0 ? void 0 : locale.removeAriaLabel,
ref: operationsRef,
prefixCls: prefixCls,
tabs: hiddenTabs,
className: !hasDropdown && operationsHiddenClassName,
tabMoving: !!lockAnimation
})), /*#__PURE__*/React.createElement(ExtraContent, {
position: "right",
extra: extra,
prefixCls: prefixCls
}));
/* eslint-enable */
}
var _default = /*#__PURE__*/React.forwardRef(TabNavList);
exports.default = _default; | 36.13628 | 453 | 0.65503 |
c610352cb68469e471e926ad3353890dd3501f3f | 17,920 | js | JavaScript | node_modules/babel-core/node_modules/babel-generator/node_modules/is-integer/node_modules/is-finite/node_modules/ava/node_modules/log-symbols/node_modules/chalk/node_modules/coveralls/node_modules/jshint/dist/jshint-1.0.0.js | y04nqt/startingReact | bdca259ba6104edec247dac6cdbc01dbca8611ba | [
"MIT"
] | null | null | null | node_modules/babel-core/node_modules/babel-generator/node_modules/is-integer/node_modules/is-finite/node_modules/ava/node_modules/log-symbols/node_modules/chalk/node_modules/coveralls/node_modules/jshint/dist/jshint-1.0.0.js | y04nqt/startingReact | bdca259ba6104edec247dac6cdbc01dbca8611ba | [
"MIT"
] | null | null | null | node_modules/babel-core/node_modules/babel-generator/node_modules/is-integer/node_modules/is-finite/node_modules/ava/node_modules/log-symbols/node_modules/chalk/node_modules/coveralls/node_modules/jshint/dist/jshint-1.0.0.js | y04nqt/startingReact | bdca259ba6104edec247dac6cdbc01dbca8611ba | [
"MIT"
] | null | null | null | // 1.0.0
var JSHINT;
(function(){var require = function (file, cwd) {
var resolved = require.resolve(file, cwd || '/');
var mod = require.modules[resolved];
if (!mod) throw new Error(
'Failed to resolve module ' + file + ', tried ' + resolved
);
var cached = require.cache[resolved];
var res = cached? cached.exports : mod();
return res;
};
require.paths = [];
require.modules = {};
require.cache = {};
require.extensions = [".js",".coffee",".json"];
require._core = {
'assert': true,
'events': true,
'fs': true,
'path': true,
'vm': true
};
require.resolve = (function () {
return function (x, cwd) {
if (!cwd) cwd = '/';
if (require._core[x]) return x;
var path = require.modules.path();
cwd = path.resolve('/', cwd);
var y = cwd || '/';
if (x.match(/^(?:\.\.?\/|\/)/)) {
var m = loadAsFileSync(path.resolve(y, x))
|| loadAsDirectorySync(path.resolve(y, x));
if (m) return m;
}
var n = loadNodeModulesSync(x, y);
if (n) return n;
throw new Error("Cannot find module '" + x + "'");
function loadAsFileSync (x) {
x = path.normalize(x);
if (require.modules[x]) {
return x;
}
for (var i = 0; i < require.extensions.length; i++) {
var ext = require.extensions[i];
if (require.modules[x + ext]) return x + ext;
}
}
function loadAsDirectorySync (x) {
x = x.replace(/\/+$/, '');
var pkgfile = path.normalize(x + '/package.json');
if (require.modules[pkgfile]) {
var pkg = require.modules[pkgfile]();
var b = pkg.browserify;
if (typeof b === 'object' && b.main) {
var m = loadAsFileSync(path.resolve(x, b.main));
if (m) return m;
}
else if (typeof b === 'string') {
var m = loadAsFileSync(path.resolve(x, b));
if (m) return m;
}
else if (pkg.main) {
var m = loadAsFileSync(path.resolve(x, pkg.main));
if (m) return m;
}
}
return loadAsFileSync(x + '/index');
}
function loadNodeModulesSync (x, start) {
var dirs = nodeModulesPathsSync(start);
for (var i = 0; i < dirs.length; i++) {
var dir = dirs[i];
var m = loadAsFileSync(dir + '/' + x);
if (m) return m;
var n = loadAsDirectorySync(dir + '/' + x);
if (n) return n;
}
var m = loadAsFileSync(x);
if (m) return m;
}
function nodeModulesPathsSync (start) {
var parts;
if (start === '/') parts = [ '' ];
else parts = path.normalize(start).split('/');
var dirs = [];
for (var i = parts.length - 1; i >= 0; i--) {
if (parts[i] === 'node_modules') continue;
var dir = parts.slice(0, i + 1).join('/') + '/node_modules';
dirs.push(dir);
}
return dirs;
}
};
})();
require.alias = function (from, to) {
var path = require.modules.path();
var res = null;
try {
res = require.resolve(from + '/package.json', '/');
}
catch (err) {
res = require.resolve(from, '/');
}
var basedir = path.dirname(res);
var keys = (Object.keys || function (obj) {
var res = [];
for (var key in obj) res.push(key);
return res;
})(require.modules);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.slice(0, basedir.length + 1) === basedir + '/') {
var f = key.slice(basedir.length);
require.modules[to + f] = require.modules[basedir + f];
}
else if (key === basedir) {
require.modules[to] = require.modules[basedir];
}
}
};
(function () {
var process = {};
var global = typeof window !== 'undefined' ? window : {};
var definedProcess = false;
require.define = function (filename, fn) {
if (!definedProcess && require.modules.__browserify_process) {
process = require.modules.__browserify_process();
definedProcess = true;
}
var dirname = require._core[filename]
? ''
: require.modules.path().dirname(filename)
;
var require_ = function (file) {
var requiredModule = require(file, dirname);
var cached = require.cache[require.resolve(file, dirname)];
if (cached && cached.parent === null) {
cached.parent = module_;
}
return requiredModule;
};
require_.resolve = function (name) {
return require.resolve(name, dirname);
};
require_.modules = require.modules;
require_.define = require.define;
require_.cache = require.cache;
var module_ = {
id : filename,
filename: filename,
exports : {},
loaded : false,
parent: null
};
require.modules[filename] = function () {
require.cache[filename] = module_;
fn.call(
module_.exports,
require_,
module_,
module_.exports,
dirname,
filename,
process,
global
);
module_.loaded = true;
return module_.exports;
};
};
})();
require.define("path",Function(['require','module','exports','__dirname','__filename','process','global'],"function filter (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (fn(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length; i >= 0; i--) {\n var last = parts[i];\n if (last == '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Regex to split a filename into [*, dir, basename, ext]\n// posix version\nvar splitPathRe = /^(.+\\/(?!$)|\\/)?((?:.+?)?(\\.[^.]*)?)$/;\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\nvar resolvedPath = '',\n resolvedAbsolute = false;\n\nfor (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0)\n ? arguments[i]\n : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string' || !path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n}\n\n// At this point the path should be resolved to a full absolute path, but\n// handle relative paths to be safe (might happen when process.cwd() fails)\n\n// Normalize the path\nresolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\nvar isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.slice(-1) === '/';\n\n// Normalize the path\npath = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n \n return (isAbsolute ? '/' : '') + path;\n};\n\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n return p && typeof p === 'string';\n }).join('/'));\n};\n\n\nexports.dirname = function(path) {\n var dir = splitPathRe.exec(path)[1] || '';\n var isWindows = false;\n if (!dir) {\n // No dirname\n return '.';\n } else if (dir.length === 1 ||\n (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {\n // It is just a slash or a drive letter with a slash\n return dir;\n } else {\n // It is a full dirname, strip trailing slash\n return dir.substring(0, dir.length - 1);\n }\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPathRe.exec(path)[2] || '';\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPathRe.exec(path)[3] || '';\n};\n\n//@ sourceURL=path"
));
require.define("__browserify_process",Function(['require','module','exports','__dirname','__filename','process','global'],"var process = module.exports = {};\n\nprocess.nextTick = (function () {\n var canSetImmediate = typeof window !== 'undefined'\n && window.setImmediate;\n var canPost = typeof window !== 'undefined'\n && window.postMessage && window.addEventListener\n ;\n\n if (canSetImmediate) {\n return window.setImmediate;\n }\n\n if (canPost) {\n var queue = [];\n window.addEventListener('message', function (ev) {\n if (ev.source === window && ev.data === 'browserify-tick') {\n ev.stopPropagation();\n if (queue.length > 0) {\n var fn = queue.shift();\n fn();\n }\n }\n }, true);\n\n return function nextTick(fn) {\n queue.push(fn);\n window.postMessage('browserify-tick', '*');\n };\n }\n\n return function nextTick(fn) {\n setTimeout(fn, 0);\n };\n})();\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\n\nprocess.binding = function (name) {\n if (name === 'evals') return (require)('vm')\n else throw new Error('No such module. (Possibly not yet loaded)')\n};\n\n(function () {\n var cwd = '/';\n var path;\n process.cwd = function () { return cwd };\n process.chdir = function (dir) {\n if (!path) path = require('path');\n cwd = path.resolve(dir, cwd);\n };\n})();\n\n//@ sourceURL=__browserify_process"
));
require.define("/node_modules/underscore/package.json",Function(['require','module','exports','__dirname','__filename','process','global'],"module.exports = {\"main\":\"underscore.js\"}\n//@ sourceURL=/node_modules/underscore/package.json"
));
require.define("/node_modules/underscore/underscore.js",Function(['require','module','exports','__dirname','__filename','process','global'],"// Underscore.js 1.4.4\n// http://underscorejs.org\n// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.\n// Underscore may be freely distributed under the MIT license.\n\n(function() {\n\n // Baseline setup\n // --------------\n\n // Establish the root object, `window` in the browser, or `global` on the server.\n var root = this;\n\n // Save the previous value of the `_` variable.\n var previousUnderscore = root._;\n\n // Establish the object that gets returned to break out of a loop iteration.\n var breaker = {};\n\n // Save bytes in the minified (but not gzipped) version:\n var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;\n\n // Create quick reference variables for speed access to core prototypes.\n var push = ArrayProto.push,\n slice = ArrayProto.slice,\n concat = ArrayProto.concat,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n // All **ECMAScript 5** native function implementations that we hope to use\n // are declared here.\n var\n nativeForEach = ArrayProto.forEach,\n nativeMap = ArrayProto.map,\n nativeReduce = ArrayProto.reduce,\n nativeReduceRight = ArrayProto.reduceRight,\n nativeFilter = ArrayProto.filter,\n nativeEvery = ArrayProto.every,\n nativeSome = ArrayProto.some,\n nativeIndexOf = ArrayProto.indexOf,\n nativeLastIndexOf = ArrayProto.lastIndexOf,\n nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeBind = FuncProto.bind;\n\n // Create a safe reference to the Underscore object for use below.\n var _ = function(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n };\n\n // Export the Underscore object for **Node.js**, with\n // backwards-compatibility for the old `require()` API. If we're in\n // the browser, add `_` as a global object via a string identifier,\n // for Closure Compiler \"advanced\" mode.\n if (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = _;\n }\n exports._ = _;\n } else {\n root._ = _;\n }\n\n // Current version.\n _.VERSION = '1.4.4';\n\n // Collection Functions\n // --------------------\n\n // The cornerstone, an `each` implementation, aka `forEach`.\n // Handles objects with the built-in `forEach`, arrays, and raw objects.\n // Delegates to **ECMAScript 5**'s native `forEach` if available.\n var each = _.each = _.forEach = function(obj, iterator, context) {\n if (obj == null) return;\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (iterator.call(context, obj[i], i, obj) === breaker) return;\n }\n } else {\n for (var key in obj) {\n if (_.has(obj, key)) {\n if (iterator.call(context, obj[key], key, obj) === breaker) return;\n }\n }\n }\n };\n\n // Return the results of applying the iterator to each element.\n // Delegates to **ECMAScript 5**'s native `map` if available.\n _.map = _.collect = function(obj, iterator, context) {\n var results = [];\n if (obj == null) return results;\n if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);\n each(obj, function(value, index, list) {\n results[results.length] = iterator.call(context, value, index, list);\n });\n return results;\n };\n\n var reduceError = 'Reduce of empty array with no initial value';\n\n // **Reduce** builds up a single result from a list of values, aka `inject`,\n // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.\n _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {\n var initial = arguments.length > 2;\n if (obj == null) obj = [];\n if (nativeReduce && obj.reduce === nativeReduce) {\n if (context) iterator = _.bind(iterator, context);\n return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);\n }\n each(obj, function(value, index, list) {\n if (!initial) {\n memo = value;\n initial = true;\n } else {\n memo = iterator.call(context, memo, value, index, list);\n }\n });\n if (!initial) throw new TypeError(reduceError);\n return memo;\n };\n\n // The right-associative version of reduce, also known as `foldr`.\n // Delegates to **ECMAScript 5**'s native `reduceRight` if available.\n _.reduceRight = _.foldr = function(obj, iterator, memo, context) {\n var initial = arguments.length > 2;\n if (obj == null) obj = [];\n if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {\n if (context) iterator = _.bind(iterator, context);\n return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);\n }\n var length = obj.length;\n if (length !== +length) {\n var keys = _.keys(obj);\n length = keys.length;\n }\n each(obj, function(value, index, list) {\n index = keys ? keys[--length] : --length;\n if (!initial) {\n memo = obj[index];\n initial = true;\n } else {\n memo = iterator.call(context, memo, obj[index], index, list);\n }\n });\n if (!initial) throw new TypeError(reduceError);\n return memo;\n };\n\n // Return the first value which passes a truth test. Aliased as `detect`.\n _.find = _.detect = function(obj, iterator, context) {\n var result;\n any(obj, function(value, index, list) {\n if (iterator.call(context, value, index, list)) {\n result = value;\n return true;\n }\n });\n return result;\n };\n\n // Return all the elements that pass a truth test.\n // Delegates to **ECMAScript 5**'s native `filter` if available.\n // Aliased as `select`.\n _.filter = _.select = function(obj, iterator, context) {\n var results = [];\n if (obj == null) return results;\n if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); | 85.333333 | 6,410 | 0.561272 |
c6104b2848aee4020279a4a0c30677cc1bb43d56 | 868 | js | JavaScript | app/views/About.js | pratikbhd/website | a15bff2f2a84bfffe533a23ba9bb4eedb665620e | [
"MIT"
] | null | null | null | app/views/About.js | pratikbhd/website | a15bff2f2a84bfffe533a23ba9bb4eedb665620e | [
"MIT"
] | 3 | 2021-03-09T16:22:53.000Z | 2022-02-10T19:09:39.000Z | app/views/About.js | pratikbhd/website | a15bff2f2a84bfffe533a23ba9bb4eedb665620e | [
"MIT"
] | null | null | null | import React from 'react';
import { Link } from 'react-router-dom';
import Helmet from 'react-helmet';
import ReactMarkdown from 'react-markdown';
import Main from '../layouts/Main';
import markdown from '../data/about.md';
const count = markdown.split(/\s+/)
.map((s) => s.replace(/\W/g, ''))
.filter((s) => s.length).length;
// Make all hrefs react router links
const LinkRenderer = ({ ...children }) => <Link {...children} />;
const About = () => (
<Main>
<Helmet title="About" />
<article className="post" id="about">
<header>
<div className="title">
<h2><Link to="/about">About Me</Link></h2>
</div>
</header>
<ReactMarkdown
source={markdown}
renderers={{
Link: LinkRenderer,
}}
escapeHtml={false}
/>
</article>
</Main>
);
export default About;
| 22.842105 | 65 | 0.574885 |
c610eab1d64d081d2b031536549d44462d9032e3 | 1,591 | js | JavaScript | mini-microservices-demo/comments/index.js | stevendelro/Kur8 | 5a835e0ef31dce7a3b182f2073d9d73018503a06 | [
"MIT"
] | 3 | 2021-03-31T04:12:00.000Z | 2022-01-08T00:43:45.000Z | mini-microservices-demo/comments/index.js | stevendelro/Kur8 | 5a835e0ef31dce7a3b182f2073d9d73018503a06 | [
"MIT"
] | null | null | null | mini-microservices-demo/comments/index.js | stevendelro/Kur8 | 5a835e0ef31dce7a3b182f2073d9d73018503a06 | [
"MIT"
] | null | null | null | const express = require("express");
const bodyParser = require("body-parser");
const { randomBytes } = require("crypto");
const cors = require("cors");
const axios = require("axios");
const app = express();
app.use(bodyParser.json());
app.use(cors());
const commentsByPostId = {};
app.get("/posts/:id/comments", (req, res) => {
res.send(commentsByPostId[req.params.id] || []);
});
app.post("/posts/:id/comments", async (req, res) => {
const commentId = randomBytes(4).toString("hex");
const { content } = req.body;
const comments = commentsByPostId[req.params.id] || [];
comments.push({ id: commentId, content, status: "pending" });
commentsByPostId[req.params.id] = comments;
await axios.post("http://event-bus-srv:4005/events", {
type: "CommentCreated",
data: {
id: commentId,
content,
postId: req.params.id,
status: "pending",
},
});
res.status(201).send(comments);
});
app.post("/events", async (req, res) => {
console.log("Event Received:", req.body.type);
const { type, data } = req.body;
if (type === "CommentModerated") {
const { postId, id, status, content } = data;
const comments = commentsByPostId[postId];
const comment = comments.find((comment) => {
return comment.id === id;
});
comment.status = status;
await axios.post("http://event-bus-srv:4005/events", {
type: "CommentUpdated",
data: {
id,
status,
postId,
content,
},
});
}
res.send({});
});
app.listen(4001, () => {
console.log("Listening on 4001");
});
| 22.408451 | 63 | 0.600251 |
c61116843807d2e377f44114871d6ded94237bd8 | 485 | js | JavaScript | jstests/concurrency/fsm_workloads/update_array_noindex.js | EdwardPrentice/wrongo | 1e7c9136f5fab7040b5bd5df51b4946876625c88 | [
"Apache-2.0"
] | 72 | 2020-06-12T06:33:41.000Z | 2021-03-22T03:15:56.000Z | jstests/concurrency/fsm_workloads/update_array_noindex.js | EdwardPrentice/wrongo | 1e7c9136f5fab7040b5bd5df51b4946876625c88 | [
"Apache-2.0"
] | 9 | 2020-07-02T09:36:49.000Z | 2021-03-25T23:54:00.000Z | jstests/concurrency/fsm_workloads/update_array_noindex.js | EdwardPrentice/wrongo | 1e7c9136f5fab7040b5bd5df51b4946876625c88 | [
"Apache-2.0"
] | 14 | 2020-06-12T03:08:03.000Z | 2021-02-03T11:43:09.000Z | 'use strict';
/**
* update_array_noindex.js
*
* Executes the update_array.js workload after dropping all non-_id indexes on
* the collection.
*/
load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
load('jstests/concurrency/fsm_workloads/update_array.js'); // for $config
load('jstests/concurrency/fsm_workload_modifiers/drop_all_indexes.js'); // for dropAllIndexes
var $config = extendWorkload($config, dropAllIndexes);
| 34.642857 | 94 | 0.725773 |
c6115232158e9db92328ad07a9f3af3d3592b135 | 453,574 | js | JavaScript | dist/app.js | bahmutov/hydrate-vdom-todo | f1700dc86bcc0ed63a345ebee22e2a936eaf9f47 | [
"MIT",
"Unlicense"
] | 8 | 2015-12-21T10:51:00.000Z | 2021-05-07T11:07:48.000Z | dist/app.js | bahmutov/hydrate-vdom-todo | f1700dc86bcc0ed63a345ebee22e2a936eaf9f47 | [
"MIT",
"Unlicense"
] | 5 | 2015-12-20T19:27:25.000Z | 2015-12-23T13:58:08.000Z | dist/app.js | bahmutov/hydrate-vdom-todo | f1700dc86bcc0ed63a345ebee22e2a936eaf9f47 | [
"MIT",
"Unlicense"
] | null | null | null | /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict'
__webpack_require__(1)
__webpack_require__(2)
const is = __webpack_require__(3)
const tinyToast = __webpack_require__(4)
const diff = __webpack_require__(5)
const patch = __webpack_require__(18)
const appNode = document.getElementById('app')
var renderedNode = appNode.firstElementChild
const VNode = __webpack_require__(27)
const VText = __webpack_require__(28)
const convertHTML = __webpack_require__(29)({
VNode: VNode,
VText: VText
})
const render = __webpack_require__(97)
var prevView = convertHTML(renderedNode.outerHTML)
const Todos = __webpack_require__(112)
/* global localStorage */
const appLabel = 'hydrate-vdom-todo'
const todosStorageLabel = appLabel + '-todo-items'
var updatedTodos = localStorage.getItem(todosStorageLabel)
if (updatedTodos) {
updatedTodos = JSON.parse(updatedTodos)
Todos.items = updatedTodos
console.log('set todos to local storage value with %d items',
updatedTodos.length)
} else {
console.log('No previous todo items found, using initial')
Todos.items = __webpack_require__(114)
}
function saveApp () {
localStorage.setItem(todosStorageLabel, JSON.stringify(Todos.items))
}
// add rendering call after data methods
// also save items
Object.keys(Todos).forEach(function (key) {
const value = Todos[key]
if (is.fn(value)) {
Todos[key] = function () {
const result = value.apply(Todos, arguments)
saveApp()
renderApp()
return result
}
}
})
function renderApp () {
console.log('rendering %d todos', Todos.items.length)
const view = render(Todos)
const patches = diff(prevView, view)
renderedNode = patch(renderedNode, patches)
prevView = view
}
console.log('initial render')
renderApp()
tinyToast.show('Rendered web app')
tinyToast.hide(2000)
window.renderApp = renderApp
/***/ },
/* 1 */
/***/ function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ },
/* 2 */
/***/ function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {(function checkMoreTypes() {
'use strict';
/**
Custom assertions and predicates around https://github.com/philbooth/check-types.js
Created by Kensho https://github.com/kensho
Copyright @ 2014 Kensho https://www.kensho.com/
License: MIT
@module check
*/
if (typeof Function.prototype.bind !== 'function') {
throw new Error('Missing Function.prototype.bind, please load es5-shim first');
}
// utility method
function curry2(fn, strict2) {
return function curried(a) {
if (strict2 && arguments.length > 2) {
throw new Error('Curry2 function ' + fn.name +
' called with too many arguments ' + arguments.length);
}
if (arguments.length === 2) {
return fn(arguments[0], arguments[1]);
}
return function second(b) {
return fn(a, b);
};
};
}
// most of the old methods from check-types.js
function isFn(x) { return typeof x === 'function'; }
function isString(x) { return typeof x === 'string'; }
function unemptyString(x) {
return isString(x) && x;
}
function isObject(x) {
return typeof x === 'object' &&
!Array.isArray(x) &&
!isNull(x) &&
!isDate(x);
}
function isEmptyObject(x) {
return isObject(x) &&
Object.keys(x).length === 0;
}
function isNumber(x) {
return typeof x === 'number' &&
!isNaN(x) &&
x !== Infinity &&
x !== -Infinity;
}
function isInteger(x) {
return isNumber(x) && x % 1 === 0;
}
function isFloat(x) {
return isNumber(x) && x % 1 !== 0;
}
function isNull(x) { return x === null; }
function positiveNumber(x) {
return isNumber(x) && x > 0;
}
function negativeNumber(x) {
return isNumber(x) && x < 0;
}
function isDate(x) {
return x instanceof Date;
}
function isRegExp(x) {
return x instanceof RegExp;
}
function instance(x, type) {
return x instanceof type;
}
function hasLength(x, k) {
if (typeof x === 'number' && typeof k !== 'number') {
// swap arguments
return hasLength(k, x);
}
return (Array.isArray(x) || isString(x)) && x.length === k;
}
/**
Checks if the given index is valid in an array or string or -1
@method found
*/
function found(index) {
return index >= 0;
}
function startsWith(prefix, x) {
return isString(prefix) &&
isString(x) &&
x.indexOf(prefix) === 0;
}
/**
Checks if the type of second argument matches the name in the first
@method type
*/
function type(expectedType, x) {
return typeof x === expectedType;
}
var startsWithHttp = startsWith.bind(null, 'http://');
var startsWithHttps = startsWith.bind(null, 'https://');
function webUrl(x) {
return isString(x) &&
(startsWithHttp(x) || startsWithHttps(x));
}
function every(predicateResults) {
var property, value;
for (property in predicateResults) {
if (predicateResults.hasOwnProperty(property)) {
value = predicateResults[property];
if (isObject(value) && every(value) === false) {
return false;
}
if (value === false) {
return false;
}
}
}
return true;
}
function map(things, predicates) {
var property, result = {}, predicate;
for (property in predicates) {
if (predicates.hasOwnProperty(property)) {
predicate = predicates[property];
if (isFn(predicate)) {
result[property] = predicate(things[property]);
} else if (isObject(predicate)) {
result[property] = map(things[property], predicate);
}
}
}
return result;
}
var check = {
maybe: {},
verify: {},
not: {},
every: every,
map: map
};
/**
Checks if argument is defined or not
This method now is part of the check-types.js
@method defined
*/
function defined(value) {
return typeof value !== 'undefined';
}
/**
Checks if argument is a valid Date instance
@method validDate
*/
function validDate(value) {
return check.date(value) &&
check.number(Number(value));
}
/**
Checks if it is exact semver
@method semver
*/
function semver(s) {
return check.unemptyString(s) &&
/^\d+\.\d+\.\d+$/.test(s);
}
/**
Returns true if the argument is primitive JavaScript type
@method primitive
*/
function primitive(value) {
var type = typeof value;
return type === 'number' ||
type === 'boolean' ||
type === 'string' ||
type === 'symbol';
}
/**
Returns true if the value is a number 0
@method zero
*/
function zero(x) {
return typeof x === 'number' && x === 0;
}
/**
same as ===
@method same
*/
function same(a, b) {
return a === b;
}
/**
Returns true if the index is valid for give string / array
@method index
*/
function index(list, k) {
return defined(list) &&
has(list, 'length') &&
k >= 0 &&
k < list.length;
}
/**
Returns true if both objects are the same type and have same length property
@method sameLength
*/
function sameLength(a, b) {
return typeof a === typeof b &&
a && b &&
a.length === b.length;
}
/**
Returns true if all items in an array are the same reference
@method allSame
*/
function allSame(arr) {
if (!check.array(arr)) {
return false;
}
if (!arr.length) {
return true;
}
var first = arr[0];
return arr.every(function (item) {
return item === first;
});
}
/**
Returns true if given item is in the array
@method oneOf
*/
function oneOf(arr, x) {
check.verify.array(arr, 'expected an array');
return arr.indexOf(x) !== -1;
}
/**
Returns true for urls of the format `git@....git`
@method git
*/
function git(url) {
return check.unemptyString(url) &&
/^git@/.test(url);
}
/**
Checks if given value is 0 or 1
@method bit
*/
function bit(value) {
return value === 0 || value === 1;
}
/**
Checks if given value is true of false
@method bool
*/
function bool(value) {
return typeof value === 'boolean';
}
/**
Checks if given object has a property
@method has
*/
function has(o, property) {
if (arguments.length !== 2) {
throw new Error('Expected two arguments to check.has, got only ' + arguments.length);
}
return Boolean(o && property &&
typeof property === 'string' &&
typeof o[property] !== 'undefined');
}
/**
Checks if given string is already in lower case
@method lowerCase
*/
function lowerCase(str) {
return check.string(str) &&
str.toLowerCase() === str;
}
/**
Returns true if the argument is an array with at least one value
@method unemptyArray
*/
function unemptyArray(a) {
return check.array(a) && a.length > 0;
}
/**
Returns true if each item in the array passes the predicate
@method arrayOf
@param rule Predicate function
@param a Array to check
*/
function arrayOf(rule, a) {
return check.array(a) && a.every(rule);
}
/**
Returns items from array that do not passes the predicate
@method badItems
@param rule Predicate function
@param a Array with items
*/
function badItems(rule, a) {
check.verify.array(a, 'expected array to find bad items');
return a.filter(notModifier(rule));
}
/**
Returns true if given array only has strings
@method arrayOfStrings
@param a Array to check
@param checkLowerCase Checks if all strings are lowercase
*/
function arrayOfStrings(a, checkLowerCase) {
var v = check.array(a) && a.every(check.string);
if (v && check.bool(checkLowerCase) && checkLowerCase) {
return a.every(check.lowerCase);
}
return v;
}
/**
Returns true if given argument is array of arrays of strings
@method arrayOfArraysOfStrings
@param a Array to check
@param checkLowerCase Checks if all strings are lowercase
*/
function arrayOfArraysOfStrings(a, checkLowerCase) {
return check.array(a) && a.every(function (arr) {
return check.arrayOfStrings(arr, checkLowerCase);
});
}
/**
Checks if object passes all rules in predicates.
check.all({ foo: 'foo' }, { foo: check.string }, 'wrong object');
This is a composition of check.every(check.map ...) calls
https://github.com/philbooth/check-types.js#batch-operations
@method all
@param {object} object object to check
@param {object} predicates rules to check. Usually one per property.
@public
@returns true or false
*/
function all(obj, predicates) {
check.verify.fn(check.every, 'missing check.every method');
check.verify.fn(check.map, 'missing check.map method');
check.verify.object(obj, 'missing object to check');
check.verify.object(predicates, 'missing predicates object');
Object.keys(predicates).forEach(function (property) {
if (!check.fn(predicates[property])) {
throw new Error('not a predicate function for ' + property + ' but ' + predicates[property]);
}
});
return check.every(check.map(obj, predicates));
}
/**
Checks given object against predicates object
@method schema
*/
function schema(predicates, obj) {
return all(obj, predicates);
}
/** Checks if given function raises an error
@method raises
*/
function raises(fn, errorValidator) {
check.verify.fn(fn, 'expected function that raises');
try {
fn();
} catch (err) {
if (typeof errorValidator === 'undefined') {
return true;
}
if (typeof errorValidator === 'function') {
return errorValidator(err);
}
return false;
}
// error has not been raised
return false;
}
/**
Returns true if given value is ''
@method emptyString
*/
function emptyString(a) {
return a === '';
}
/**
Returns true if given value is [], {} or ''
@method empty
*/
function empty(a) {
var hasLength = typeof a === 'string' ||
Array.isArray(a);
if (hasLength) {
return !a.length;
}
if (a instanceof Object) {
return !Object.keys(a).length;
}
return false;
}
/**
Returns true if given value has .length and it is not zero, or has properties
@method unempty
*/
function unempty(a) {
var hasLength = typeof a === 'string' ||
Array.isArray(a);
if (hasLength) {
return a.length;
}
if (a instanceof Object) {
return Object.keys(a).length;
}
return true;
}
/**
Returns true if 0 <= value <= 1
@method unit
*/
function unit(value) {
return check.number(value) &&
value >= 0.0 && value <= 1.0;
}
var rgb = /^#(?:[0-9a-fA-F]{3}){1,2}$/;
/**
Returns true if value is hex RGB between '#000000' and '#FFFFFF'
@method hexRgb
*/
function hexRgb(value) {
return check.string(value) &&
rgb.test(value);
}
// typical git SHA commit id is 40 digit hex string, like
// 3b819803cdf2225ca1338beb17e0c506fdeedefc
var shaReg = /^[0-9a-f]{40}$/;
/**
Returns true if the given string is 40 digit SHA commit id
@method commitId
*/
function commitId(id) {
return check.string(id) &&
id.length === 40 &&
shaReg.test(id);
}
// when using git log --oneline short ids are displayed, first 7 characters
var shortShaReg = /^[0-9a-f]{7}$/;
/**
Returns true if the given string is short 7 character SHA id part
@method shortCommitId
*/
function shortCommitId(id) {
return check.string(id) &&
id.length === 7 &&
shortShaReg.test(id);
}
//
// helper methods
//
if (!check.defend) {
var checkPredicates = function checksPredicates(fn, predicates, args) {
check.verify.fn(fn, 'expected a function');
check.verify.array(predicates, 'expected list of predicates');
check.verify.defined(args, 'missing args');
var k = 0, // iterates over predicates
j = 0, // iterates over arguments
n = predicates.length;
for (k = 0; k < n; k += 1) {
var predicate = predicates[k];
if (!check.fn(predicate)) {
continue;
}
if (!predicate.call(null, args[j])) {
var msg = 'Argument ' + (j + 1) + ': ' + args[j] + ' does not pass predicate';
if (check.unemptyString(predicates[k + 1])) {
msg += ': ' + predicates[k + 1];
}
throw new Error(msg);
}
j += 1;
}
return fn.apply(null, args);
};
check.defend = function defend(fn) {
var predicates = Array.prototype.slice.call(arguments, 1);
return function () {
return checkPredicates(fn, predicates, arguments);
};
};
}
/**
Combines multiple predicate functions to produce new OR predicate
@method or
*/
function or() {
var predicates = Array.prototype.slice.call(arguments, 0);
if (!predicates.length) {
throw new Error('empty list of arguments to or');
}
return function orCheck() {
var values = Array.prototype.slice.call(arguments, 0);
return predicates.some(function (predicate) {
try {
return check.fn(predicate) ?
predicate.apply(null, values) : Boolean(predicate);
} catch (err) {
// treat exceptions as false
return false;
}
});
};
}
/**
Combines multiple predicate functions to produce new AND predicate
@method or
*/
function and() {
var predicates = Array.prototype.slice.call(arguments, 0);
if (!predicates.length) {
throw new Error('empty list of arguments to or');
}
return function orCheck() {
var values = Array.prototype.slice.call(arguments, 0);
return predicates.every(function (predicate) {
return check.fn(predicate) ?
predicate.apply(null, values) : Boolean(predicate);
});
};
}
/**
* Public modifier `not`.
*
* Negates `predicate`.
* copied from check-types.js
*/
function notModifier(predicate) {
return function () {
return !predicate.apply(null, arguments);
};
}
if (!check.mixin) {
/** Adds new predicate to all objects
@method mixin */
check.mixin = function mixin(fn, name) {
if (isString(fn) && isFn(name)) {
var tmp = fn;
fn = name;
name = tmp;
}
if (!isFn(fn)) {
throw new Error('expected predicate function');
}
if (!unemptyString(name)) {
name = fn.name;
}
if (!unemptyString(name)) {
throw new Error('predicate function missing name\n' + fn.toString());
}
function registerPredicate(obj, name, fn) {
if (!isObject(obj)) {
throw new Error('missing object ' + obj);
}
if (!unemptyString(name)) {
throw new Error('missing name');
}
if (!isFn(fn)) {
throw new Error('missing function');
}
if (!obj[name]) {
obj[name] = fn;
}
}
/**
* Public modifier `maybe`.
*
* Returns `true` if `predicate` is `null` or `undefined`,
* otherwise propagates the return value from `predicate`.
* copied from check-types.js
*/
function maybeModifier(predicate) {
return function () {
if (!check.defined(arguments[0]) || check.nulled(arguments[0])) {
return true;
}
return predicate.apply(null, arguments);
};
}
/**
* Public modifier `verify`.
*
* Throws if `predicate` returns `false`.
* copied from check-types.js
*/
function verifyModifier(predicate, defaultMessage) {
return function () {
var message;
if (predicate.apply(null, arguments) === false) {
message = arguments[arguments.length - 1];
throw new Error(check.unemptyString(message) ? message : defaultMessage);
}
};
}
registerPredicate(check, name, fn);
registerPredicate(check.maybe, name, maybeModifier(fn));
registerPredicate(check.not, name, notModifier(fn));
registerPredicate(check.verify, name, verifyModifier(fn, name + ' failed'));
};
}
if (!check.then) {
/**
Executes given function only if condition is truthy.
@method then
*/
check.then = function then(condition, fn) {
return function () {
var ok = typeof condition === 'function' ?
condition.apply(null, arguments) : condition;
if (ok) {
return fn.apply(null, arguments);
}
};
};
}
var promiseSchema = {
then: isFn
};
// work around reserved keywords checks
promiseSchema['catch'] = isFn;
promiseSchema['finally'] = isFn;
var hasPromiseApi = schema.bind(null, promiseSchema);
/**
Returns true if argument implements promise api (.then, .catch, .finally)
@method promise
*/
function isPromise(p) {
return check.object(p) && hasPromiseApi(p);
}
/**
Shallow strict comparison
@method equal
*/
function equal(a, b) {
return a === b;
}
// new predicates to be added to check object. Use object to preserve names
var predicates = {
nulled: isNull,
fn: isFn,
string: isString,
unemptyString: unemptyString,
object: isObject,
number: isNumber,
array: Array.isArray,
positiveNumber: positiveNumber,
negativeNumber: negativeNumber,
// a couple of aliases
positive: positiveNumber,
negative: negativeNumber,
defined: defined,
same: same,
allSame: allSame,
bit: bit,
bool: bool,
has: has,
lowerCase: lowerCase,
unemptyArray: unemptyArray,
arrayOfStrings: arrayOfStrings,
arrayOfArraysOfStrings: arrayOfArraysOfStrings,
all: all,
schema: curry2(schema),
raises: raises,
empty: empty,
found: found,
emptyString: emptyString,
unempty: unempty,
unit: unit,
hexRgb: hexRgb,
sameLength: sameLength,
commitId: commitId,
shortCommitId: shortCommitId,
index: index,
git: git,
arrayOf: arrayOf,
badItems: badItems,
oneOf: curry2(oneOf, true),
promise: isPromise,
validDate: validDate,
equal: curry2(equal),
or: or,
and: and,
primitive: primitive,
zero: zero,
date: isDate,
regexp: isRegExp,
instance: instance,
emptyObject: isEmptyObject,
length: curry2(hasLength),
floatNumber: isFloat,
intNumber: isInteger,
startsWith: startsWith,
webUrl: webUrl,
semver: semver,
type: curry2(type)
};
Object.keys(predicates).forEach(function (name) {
check.mixin(predicates[name], name);
});
if (true) {
module.exports = check;
}
// if we are loaded under Node, but "window" object is available, put a reference
// there too - maybe we are running inside a synthetic browser environment
if (typeof window === 'object') {
window.check = check;
}
if (typeof global === 'object') {
global.check = check;
}
}());
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 4 */
/***/ function(module, exports) {
var tinyToast
function createDom () {
if (tinyToast) {
return tinyToast
}
tinyToast = document.createElement('h3')
var style = tinyToast.style
style.color = '#333'
style.position = 'fixed'
style.bottom = '0em'
style.right = '1em'
style.backgroundColor = '#7FFFD4'
style.borderRadius = '5px'
style.borderWidth = '1px'
style.borderColor = '#73E1BC'
style.borderStyle = 'solid'
style.padding = '1em 2em'
style.zIndex = 1000
document.body.appendChild(tinyToast)
return tinyToast
}
function createMessage (text) {
createDom().textContent = text
}
function closeMessage () {
if (tinyToast) {
document.body.removeChild(tinyToast)
tinyToast = null
}
}
function maybeDefer (fn, timeoutMs) {
if (timeoutMs) {
setTimeout(fn, timeoutMs)
} else {
fn()
}
}
var tinyToastApi = {
show: function show (text) {
createMessage(text)
},
hide: function (timeoutMs) {
maybeDefer(closeMessage, timeoutMs)
}
}
module.exports = tinyToastApi
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
var diff = __webpack_require__(6)
module.exports = diff
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(7)
var VPatch = __webpack_require__(8)
var isVNode = __webpack_require__(10)
var isVText = __webpack_require__(11)
var isWidget = __webpack_require__(12)
var isThunk = __webpack_require__(13)
var handleThunk = __webpack_require__(14)
var diffProps = __webpack_require__(15)
module.exports = diff
function diff(a, b) {
var patch = { a: a }
walk(a, b, patch, 0)
return patch
}
function walk(a, b, patch, index) {
if (a === b) {
return
}
var apply = patch[index]
var applyClear = false
if (isThunk(a) || isThunk(b)) {
thunks(a, b, patch, index)
} else if (b == null) {
// If a is a widget we will add a remove patch for it
// Otherwise any child widgets/hooks must be destroyed.
// This prevents adding two remove patches for a widget.
if (!isWidget(a)) {
clearState(a, patch, index)
apply = patch[index]
}
apply = appendPatch(apply, new VPatch(VPatch.REMOVE, a, b))
} else if (isVNode(b)) {
if (isVNode(a)) {
if (a.tagName === b.tagName &&
a.namespace === b.namespace &&
a.key === b.key) {
var propsPatch = diffProps(a.properties, b.properties)
if (propsPatch) {
apply = appendPatch(apply,
new VPatch(VPatch.PROPS, a, propsPatch))
}
apply = diffChildren(a, b, patch, apply, index)
} else {
apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b))
applyClear = true
}
} else {
apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b))
applyClear = true
}
} else if (isVText(b)) {
if (!isVText(a)) {
apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b))
applyClear = true
} else if (a.text !== b.text) {
apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b))
}
} else if (isWidget(b)) {
if (!isWidget(a)) {
applyClear = true
}
apply = appendPatch(apply, new VPatch(VPatch.WIDGET, a, b))
}
if (apply) {
patch[index] = apply
}
if (applyClear) {
clearState(a, patch, index)
}
}
function diffChildren(a, b, patch, apply, index) {
var aChildren = a.children
var orderedSet = reorder(aChildren, b.children)
var bChildren = orderedSet.children
var aLen = aChildren.length
var bLen = bChildren.length
var len = aLen > bLen ? aLen : bLen
for (var i = 0; i < len; i++) {
var leftNode = aChildren[i]
var rightNode = bChildren[i]
index += 1
if (!leftNode) {
if (rightNode) {
// Excess nodes in b need to be added
apply = appendPatch(apply,
new VPatch(VPatch.INSERT, null, rightNode))
}
} else {
walk(leftNode, rightNode, patch, index)
}
if (isVNode(leftNode) && leftNode.count) {
index += leftNode.count
}
}
if (orderedSet.moves) {
// Reorder nodes last
apply = appendPatch(apply, new VPatch(
VPatch.ORDER,
a,
orderedSet.moves
))
}
return apply
}
function clearState(vNode, patch, index) {
// TODO: Make this a single walk, not two
unhook(vNode, patch, index)
destroyWidgets(vNode, patch, index)
}
// Patch records for all destroyed widgets must be added because we need
// a DOM node reference for the destroy function
function destroyWidgets(vNode, patch, index) {
if (isWidget(vNode)) {
if (typeof vNode.destroy === "function") {
patch[index] = appendPatch(
patch[index],
new VPatch(VPatch.REMOVE, vNode, null)
)
}
} else if (isVNode(vNode) && (vNode.hasWidgets || vNode.hasThunks)) {
var children = vNode.children
var len = children.length
for (var i = 0; i < len; i++) {
var child = children[i]
index += 1
destroyWidgets(child, patch, index)
if (isVNode(child) && child.count) {
index += child.count
}
}
} else if (isThunk(vNode)) {
thunks(vNode, null, patch, index)
}
}
// Create a sub-patch for thunks
function thunks(a, b, patch, index) {
var nodes = handleThunk(a, b)
var thunkPatch = diff(nodes.a, nodes.b)
if (hasPatches(thunkPatch)) {
patch[index] = new VPatch(VPatch.THUNK, null, thunkPatch)
}
}
function hasPatches(patch) {
for (var index in patch) {
if (index !== "a") {
return true
}
}
return false
}
// Execute hooks when two nodes are identical
function unhook(vNode, patch, index) {
if (isVNode(vNode)) {
if (vNode.hooks) {
patch[index] = appendPatch(
patch[index],
new VPatch(
VPatch.PROPS,
vNode,
undefinedKeys(vNode.hooks)
)
)
}
if (vNode.descendantHooks || vNode.hasThunks) {
var children = vNode.children
var len = children.length
for (var i = 0; i < len; i++) {
var child = children[i]
index += 1
unhook(child, patch, index)
if (isVNode(child) && child.count) {
index += child.count
}
}
}
} else if (isThunk(vNode)) {
thunks(vNode, null, patch, index)
}
}
function undefinedKeys(obj) {
var result = {}
for (var key in obj) {
result[key] = undefined
}
return result
}
// List diff, naive left to right reordering
function reorder(aChildren, bChildren) {
// O(M) time, O(M) memory
var bChildIndex = keyIndex(bChildren)
var bKeys = bChildIndex.keys
var bFree = bChildIndex.free
if (bFree.length === bChildren.length) {
return {
children: bChildren,
moves: null
}
}
// O(N) time, O(N) memory
var aChildIndex = keyIndex(aChildren)
var aKeys = aChildIndex.keys
var aFree = aChildIndex.free
if (aFree.length === aChildren.length) {
return {
children: bChildren,
moves: null
}
}
// O(MAX(N, M)) memory
var newChildren = []
var freeIndex = 0
var freeCount = bFree.length
var deletedItems = 0
// Iterate through a and match a node in b
// O(N) time,
for (var i = 0 ; i < aChildren.length; i++) {
var aItem = aChildren[i]
var itemIndex
if (aItem.key) {
if (bKeys.hasOwnProperty(aItem.key)) {
// Match up the old keys
itemIndex = bKeys[aItem.key]
newChildren.push(bChildren[itemIndex])
} else {
// Remove old keyed items
itemIndex = i - deletedItems++
newChildren.push(null)
}
} else {
// Match the item in a with the next free item in b
if (freeIndex < freeCount) {
itemIndex = bFree[freeIndex++]
newChildren.push(bChildren[itemIndex])
} else {
// There are no free items in b to match with
// the free items in a, so the extra free nodes
// are deleted.
itemIndex = i - deletedItems++
newChildren.push(null)
}
}
}
var lastFreeIndex = freeIndex >= bFree.length ?
bChildren.length :
bFree[freeIndex]
// Iterate through b and append any new keys
// O(M) time
for (var j = 0; j < bChildren.length; j++) {
var newItem = bChildren[j]
if (newItem.key) {
if (!aKeys.hasOwnProperty(newItem.key)) {
// Add any new keyed items
// We are adding new items to the end and then sorting them
// in place. In future we should insert new items in place.
newChildren.push(newItem)
}
} else if (j >= lastFreeIndex) {
// Add any leftover non-keyed items
newChildren.push(newItem)
}
}
var simulate = newChildren.slice()
var simulateIndex = 0
var removes = []
var inserts = []
var simulateItem
for (var k = 0; k < bChildren.length;) {
var wantedItem = bChildren[k]
simulateItem = simulate[simulateIndex]
// remove items
while (simulateItem === null && simulate.length) {
removes.push(remove(simulate, simulateIndex, null))
simulateItem = simulate[simulateIndex]
}
if (!simulateItem || simulateItem.key !== wantedItem.key) {
// if we need a key in this position...
if (wantedItem.key) {
if (simulateItem && simulateItem.key) {
// if an insert doesn't put this key in place, it needs to move
if (bKeys[simulateItem.key] !== k + 1) {
removes.push(remove(simulate, simulateIndex, simulateItem.key))
simulateItem = simulate[simulateIndex]
// if the remove didn't put the wanted item in place, we need to insert it
if (!simulateItem || simulateItem.key !== wantedItem.key) {
inserts.push({key: wantedItem.key, to: k})
}
// items are matching, so skip ahead
else {
simulateIndex++
}
}
else {
inserts.push({key: wantedItem.key, to: k})
}
}
else {
inserts.push({key: wantedItem.key, to: k})
}
k++
}
// a key in simulate has no matching wanted key, remove it
else if (simulateItem && simulateItem.key) {
removes.push(remove(simulate, simulateIndex, simulateItem.key))
}
}
else {
simulateIndex++
k++
}
}
// remove all the remaining nodes from simulate
while(simulateIndex < simulate.length) {
simulateItem = simulate[simulateIndex]
removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))
}
// If the only moves we have are deletes then we can just
// let the delete patch remove these items.
if (removes.length === deletedItems && !inserts.length) {
return {
children: newChildren,
moves: null
}
}
return {
children: newChildren,
moves: {
removes: removes,
inserts: inserts
}
}
}
function remove(arr, index, key) {
arr.splice(index, 1)
return {
from: index,
key: key
}
}
function keyIndex(children) {
var keys = {}
var free = []
var length = children.length
for (var i = 0; i < length; i++) {
var child = children[i]
if (child.key) {
keys[child.key] = i
} else {
free.push(i)
}
}
return {
keys: keys, // A hash of key name to index
free: free // An array of unkeyed item indices
}
}
function appendPatch(apply, patch) {
if (apply) {
if (isArray(apply)) {
apply.push(patch)
} else {
apply = [apply, patch]
}
return apply
} else {
return patch
}
}
/***/ },
/* 7 */
/***/ function(module, exports) {
var nativeIsArray = Array.isArray
var toString = Object.prototype.toString
module.exports = nativeIsArray || isArray
function isArray(obj) {
return toString.call(obj) === "[object Array]"
}
/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {
var version = __webpack_require__(9)
VirtualPatch.NONE = 0
VirtualPatch.VTEXT = 1
VirtualPatch.VNODE = 2
VirtualPatch.WIDGET = 3
VirtualPatch.PROPS = 4
VirtualPatch.ORDER = 5
VirtualPatch.INSERT = 6
VirtualPatch.REMOVE = 7
VirtualPatch.THUNK = 8
module.exports = VirtualPatch
function VirtualPatch(type, vNode, patch) {
this.type = Number(type)
this.vNode = vNode
this.patch = patch
}
VirtualPatch.prototype.version = version
VirtualPatch.prototype.type = "VirtualPatch"
/***/ },
/* 9 */
/***/ function(module, exports) {
module.exports = "2"
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
var version = __webpack_require__(9)
module.exports = isVirtualNode
function isVirtualNode(x) {
return x && x.type === "VirtualNode" && x.version === version
}
/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {
var version = __webpack_require__(9)
module.exports = isVirtualText
function isVirtualText(x) {
return x && x.type === "VirtualText" && x.version === version
}
/***/ },
/* 12 */
/***/ function(module, exports) {
module.exports = isWidget
function isWidget(w) {
return w && w.type === "Widget"
}
/***/ },
/* 13 */
/***/ function(module, exports) {
module.exports = isThunk
function isThunk(t) {
return t && t.type === "Thunk"
}
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
var isVNode = __webpack_require__(10)
var isVText = __webpack_require__(11)
var isWidget = __webpack_require__(12)
var isThunk = __webpack_require__(13)
module.exports = handleThunk
function handleThunk(a, b) {
var renderedA = a
var renderedB = b
if (isThunk(b)) {
renderedB = renderThunk(b, a)
}
if (isThunk(a)) {
renderedA = renderThunk(a, null)
}
return {
a: renderedA,
b: renderedB
}
}
function renderThunk(thunk, previous) {
var renderedThunk = thunk.vnode
if (!renderedThunk) {
renderedThunk = thunk.vnode = thunk.render(previous)
}
if (!(isVNode(renderedThunk) ||
isVText(renderedThunk) ||
isWidget(renderedThunk))) {
throw new Error("thunk did not return a valid node");
}
return renderedThunk
}
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(16)
var isHook = __webpack_require__(17)
module.exports = diffProps
function diffProps(a, b) {
var diff
for (var aKey in a) {
if (!(aKey in b)) {
diff = diff || {}
diff[aKey] = undefined
}
var aValue = a[aKey]
var bValue = b[aKey]
if (aValue === bValue) {
continue
} else if (isObject(aValue) && isObject(bValue)) {
if (getPrototype(bValue) !== getPrototype(aValue)) {
diff = diff || {}
diff[aKey] = bValue
} else if (isHook(bValue)) {
diff = diff || {}
diff[aKey] = bValue
} else {
var objectDiff = diffProps(aValue, bValue)
if (objectDiff) {
diff = diff || {}
diff[aKey] = objectDiff
}
}
} else {
diff = diff || {}
diff[aKey] = bValue
}
}
for (var bKey in b) {
if (!(bKey in a)) {
diff = diff || {}
diff[bKey] = b[bKey]
}
}
return diff
}
function getPrototype(value) {
if (Object.getPrototypeOf) {
return Object.getPrototypeOf(value)
} else if (value.__proto__) {
return value.__proto__
} else if (value.constructor) {
return value.constructor.prototype
}
}
/***/ },
/* 16 */
/***/ function(module, exports) {
"use strict";
module.exports = function isObject(x) {
return typeof x === "object" && x !== null;
};
/***/ },
/* 17 */
/***/ function(module, exports) {
module.exports = isHook
function isHook(hook) {
return hook &&
(typeof hook.hook === "function" && !hook.hasOwnProperty("hook") ||
typeof hook.unhook === "function" && !hook.hasOwnProperty("unhook"))
}
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
var patch = __webpack_require__(19)
module.exports = patch
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
var document = __webpack_require__(20)
var isArray = __webpack_require__(7)
var render = __webpack_require__(22)
var domIndex = __webpack_require__(24)
var patchOp = __webpack_require__(25)
module.exports = patch
function patch(rootNode, patches, renderOptions) {
renderOptions = renderOptions || {}
renderOptions.patch = renderOptions.patch && renderOptions.patch !== patch
? renderOptions.patch
: patchRecursive
renderOptions.render = renderOptions.render || render
return renderOptions.patch(rootNode, patches, renderOptions)
}
function patchRecursive(rootNode, patches, renderOptions) {
var indices = patchIndices(patches)
if (indices.length === 0) {
return rootNode
}
var index = domIndex(rootNode, patches.a, indices)
var ownerDocument = rootNode.ownerDocument
if (!renderOptions.document && ownerDocument !== document) {
renderOptions.document = ownerDocument
}
for (var i = 0; i < indices.length; i++) {
var nodeIndex = indices[i]
rootNode = applyPatch(rootNode,
index[nodeIndex],
patches[nodeIndex],
renderOptions)
}
return rootNode
}
function applyPatch(rootNode, domNode, patchList, renderOptions) {
if (!domNode) {
return rootNode
}
var newNode
if (isArray(patchList)) {
for (var i = 0; i < patchList.length; i++) {
newNode = patchOp(patchList[i], domNode, renderOptions)
if (domNode === rootNode) {
rootNode = newNode
}
}
} else {
newNode = patchOp(patchList, domNode, renderOptions)
if (domNode === rootNode) {
rootNode = newNode
}
}
return rootNode
}
function patchIndices(patches) {
var indices = []
for (var key in patches) {
if (key !== "a") {
indices.push(Number(key))
}
}
return indices
}
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var topLevel = typeof global !== 'undefined' ? global :
typeof window !== 'undefined' ? window : {}
var minDoc = __webpack_require__(21);
if (typeof document !== 'undefined') {
module.exports = document;
} else {
var doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];
if (!doccy) {
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;
}
module.exports = doccy;
}
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 21 */
/***/ function(module, exports) {
/* (ignored) */
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
var document = __webpack_require__(20)
var applyProperties = __webpack_require__(23)
var isVNode = __webpack_require__(10)
var isVText = __webpack_require__(11)
var isWidget = __webpack_require__(12)
var handleThunk = __webpack_require__(14)
module.exports = createElement
function createElement(vnode, opts) {
var doc = opts ? opts.document || document : document
var warn = opts ? opts.warn : null
vnode = handleThunk(vnode).a
if (isWidget(vnode)) {
return vnode.init()
} else if (isVText(vnode)) {
return doc.createTextNode(vnode.text)
} else if (!isVNode(vnode)) {
if (warn) {
warn("Item is not a valid virtual dom node", vnode)
}
return null
}
var node = (vnode.namespace === null) ?
doc.createElement(vnode.tagName) :
doc.createElementNS(vnode.namespace, vnode.tagName)
var props = vnode.properties
applyProperties(node, props)
var children = vnode.children
for (var i = 0; i < children.length; i++) {
var childNode = createElement(children[i], opts)
if (childNode) {
node.appendChild(childNode)
}
}
return node
}
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(16)
var isHook = __webpack_require__(17)
module.exports = applyProperties
function applyProperties(node, props, previous) {
for (var propName in props) {
var propValue = props[propName]
if (propValue === undefined) {
removeProperty(node, propName, propValue, previous);
} else if (isHook(propValue)) {
removeProperty(node, propName, propValue, previous)
if (propValue.hook) {
propValue.hook(node,
propName,
previous ? previous[propName] : undefined)
}
} else {
if (isObject(propValue)) {
patchObject(node, props, previous, propName, propValue);
} else {
node[propName] = propValue
}
}
}
}
function removeProperty(node, propName, propValue, previous) {
if (previous) {
var previousValue = previous[propName]
if (!isHook(previousValue)) {
if (propName === "attributes") {
for (var attrName in previousValue) {
node.removeAttribute(attrName)
}
} else if (propName === "style") {
for (var i in previousValue) {
node.style[i] = ""
}
} else if (typeof previousValue === "string") {
node[propName] = ""
} else {
node[propName] = null
}
} else if (previousValue.unhook) {
previousValue.unhook(node, propName, propValue)
}
}
}
function patchObject(node, props, previous, propName, propValue) {
var previousValue = previous ? previous[propName] : undefined
// Set attributes
if (propName === "attributes") {
for (var attrName in propValue) {
var attrValue = propValue[attrName]
if (attrValue === undefined) {
node.removeAttribute(attrName)
} else {
node.setAttribute(attrName, attrValue)
}
}
return
}
if(previousValue && isObject(previousValue) &&
getPrototype(previousValue) !== getPrototype(propValue)) {
node[propName] = propValue
return
}
if (!isObject(node[propName])) {
node[propName] = {}
}
var replacer = propName === "style" ? "" : undefined
for (var k in propValue) {
var value = propValue[k]
node[propName][k] = (value === undefined) ? replacer : value
}
}
function getPrototype(value) {
if (Object.getPrototypeOf) {
return Object.getPrototypeOf(value)
} else if (value.__proto__) {
return value.__proto__
} else if (value.constructor) {
return value.constructor.prototype
}
}
/***/ },
/* 24 */
/***/ function(module, exports) {
// Maps a virtual DOM tree onto a real DOM tree in an efficient manner.
// We don't want to read all of the DOM nodes in the tree so we use
// the in-order tree indexing to eliminate recursion down certain branches.
// We only recurse into a DOM node if we know that it contains a child of
// interest.
var noChild = {}
module.exports = domIndex
function domIndex(rootNode, tree, indices, nodes) {
if (!indices || indices.length === 0) {
return {}
} else {
indices.sort(ascending)
return recurse(rootNode, tree, indices, nodes, 0)
}
}
function recurse(rootNode, tree, indices, nodes, rootIndex) {
nodes = nodes || {}
if (rootNode) {
if (indexInRange(indices, rootIndex, rootIndex)) {
nodes[rootIndex] = rootNode
}
var vChildren = tree.children
if (vChildren) {
var childNodes = rootNode.childNodes
for (var i = 0; i < tree.children.length; i++) {
rootIndex += 1
var vChild = vChildren[i] || noChild
var nextIndex = rootIndex + (vChild.count || 0)
// skip recursion down the tree if there are no nodes down here
if (indexInRange(indices, rootIndex, nextIndex)) {
recurse(childNodes[i], vChild, indices, nodes, rootIndex)
}
rootIndex = nextIndex
}
}
}
return nodes
}
// Binary search for an index in the interval [left, right]
function indexInRange(indices, left, right) {
if (indices.length === 0) {
return false
}
var minIndex = 0
var maxIndex = indices.length - 1
var currentIndex
var currentItem
while (minIndex <= maxIndex) {
currentIndex = ((maxIndex + minIndex) / 2) >> 0
currentItem = indices[currentIndex]
if (minIndex === maxIndex) {
return currentItem >= left && currentItem <= right
} else if (currentItem < left) {
minIndex = currentIndex + 1
} else if (currentItem > right) {
maxIndex = currentIndex - 1
} else {
return true
}
}
return false;
}
function ascending(a, b) {
return a > b ? 1 : -1
}
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
var applyProperties = __webpack_require__(23)
var isWidget = __webpack_require__(12)
var VPatch = __webpack_require__(8)
var updateWidget = __webpack_require__(26)
module.exports = applyPatch
function applyPatch(vpatch, domNode, renderOptions) {
var type = vpatch.type
var vNode = vpatch.vNode
var patch = vpatch.patch
switch (type) {
case VPatch.REMOVE:
return removeNode(domNode, vNode)
case VPatch.INSERT:
return insertNode(domNode, patch, renderOptions)
case VPatch.VTEXT:
return stringPatch(domNode, vNode, patch, renderOptions)
case VPatch.WIDGET:
return widgetPatch(domNode, vNode, patch, renderOptions)
case VPatch.VNODE:
return vNodePatch(domNode, vNode, patch, renderOptions)
case VPatch.ORDER:
reorderChildren(domNode, patch)
return domNode
case VPatch.PROPS:
applyProperties(domNode, patch, vNode.properties)
return domNode
case VPatch.THUNK:
return replaceRoot(domNode,
renderOptions.patch(domNode, patch, renderOptions))
default:
return domNode
}
}
function removeNode(domNode, vNode) {
var parentNode = domNode.parentNode
if (parentNode) {
parentNode.removeChild(domNode)
}
destroyWidget(domNode, vNode);
return null
}
function insertNode(parentNode, vNode, renderOptions) {
var newNode = renderOptions.render(vNode, renderOptions)
if (parentNode) {
parentNode.appendChild(newNode)
}
return parentNode
}
function stringPatch(domNode, leftVNode, vText, renderOptions) {
var newNode
if (domNode.nodeType === 3) {
domNode.replaceData(0, domNode.length, vText.text)
newNode = domNode
} else {
var parentNode = domNode.parentNode
newNode = renderOptions.render(vText, renderOptions)
if (parentNode && newNode !== domNode) {
parentNode.replaceChild(newNode, domNode)
}
}
return newNode
}
function widgetPatch(domNode, leftVNode, widget, renderOptions) {
var updating = updateWidget(leftVNode, widget)
var newNode
if (updating) {
newNode = widget.update(leftVNode, domNode) || domNode
} else {
newNode = renderOptions.render(widget, renderOptions)
}
var parentNode = domNode.parentNode
if (parentNode && newNode !== domNode) {
parentNode.replaceChild(newNode, domNode)
}
if (!updating) {
destroyWidget(domNode, leftVNode)
}
return newNode
}
function vNodePatch(domNode, leftVNode, vNode, renderOptions) {
var parentNode = domNode.parentNode
var newNode = renderOptions.render(vNode, renderOptions)
if (parentNode && newNode !== domNode) {
parentNode.replaceChild(newNode, domNode)
}
return newNode
}
function destroyWidget(domNode, w) {
if (typeof w.destroy === "function" && isWidget(w)) {
w.destroy(domNode)
}
}
function reorderChildren(domNode, moves) {
var childNodes = domNode.childNodes
var keyMap = {}
var node
var remove
var insert
for (var i = 0; i < moves.removes.length; i++) {
remove = moves.removes[i]
node = childNodes[remove.from]
if (remove.key) {
keyMap[remove.key] = node
}
domNode.removeChild(node)
}
var length = childNodes.length
for (var j = 0; j < moves.inserts.length; j++) {
insert = moves.inserts[j]
node = keyMap[insert.key]
// this is the weirdest bug i've ever seen in webkit
domNode.insertBefore(node, insert.to >= length++ ? null : childNodes[insert.to])
}
}
function replaceRoot(oldRoot, newRoot) {
if (oldRoot && newRoot && oldRoot !== newRoot && oldRoot.parentNode) {
oldRoot.parentNode.replaceChild(newRoot, oldRoot)
}
return newRoot;
}
/***/ },
/* 26 */
/***/ function(module, exports, __webpack_require__) {
var isWidget = __webpack_require__(12)
module.exports = updateWidget
function updateWidget(a, b) {
if (isWidget(a) && isWidget(b)) {
if ("name" in a && "name" in b) {
return a.id === b.id
} else {
return a.init === b.init
}
}
return false
}
/***/ },
/* 27 */
/***/ function(module, exports, __webpack_require__) {
var version = __webpack_require__(9)
var isVNode = __webpack_require__(10)
var isWidget = __webpack_require__(12)
var isThunk = __webpack_require__(13)
var isVHook = __webpack_require__(17)
module.exports = VirtualNode
var noProperties = {}
var noChildren = []
function VirtualNode(tagName, properties, children, key, namespace) {
this.tagName = tagName
this.properties = properties || noProperties
this.children = children || noChildren
this.key = key != null ? String(key) : undefined
this.namespace = (typeof namespace === "string") ? namespace : null
var count = (children && children.length) || 0
var descendants = 0
var hasWidgets = false
var hasThunks = false
var descendantHooks = false
var hooks
for (var propName in properties) {
if (properties.hasOwnProperty(propName)) {
var property = properties[propName]
if (isVHook(property) && property.unhook) {
if (!hooks) {
hooks = {}
}
hooks[propName] = property
}
}
}
for (var i = 0; i < count; i++) {
var child = children[i]
if (isVNode(child)) {
descendants += child.count || 0
if (!hasWidgets && child.hasWidgets) {
hasWidgets = true
}
if (!hasThunks && child.hasThunks) {
hasThunks = true
}
if (!descendantHooks && (child.hooks || child.descendantHooks)) {
descendantHooks = true
}
} else if (!hasWidgets && isWidget(child)) {
if (typeof child.destroy === "function") {
hasWidgets = true
}
} else if (!hasThunks && isThunk(child)) {
hasThunks = true;
}
}
this.count = count + descendants
this.hasWidgets = hasWidgets
this.hasThunks = hasThunks
this.hooks = hooks
this.descendantHooks = descendantHooks
}
VirtualNode.prototype.version = version
VirtualNode.prototype.type = "VirtualNode"
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
var version = __webpack_require__(9)
module.exports = VirtualText
function VirtualText(text) {
this.text = String(text)
}
VirtualText.prototype.version = version
VirtualText.prototype.type = "VirtualText"
/***/ },
/* 29 */
/***/ function(module, exports, __webpack_require__) {
var convertHTML = __webpack_require__(30);
module.exports = function initializeConverter (dependencies) {
if (!dependencies.VNode || !dependencies.VText) {
throw new Error('html-to-vdom needs to be initialized with VNode and VText');
}
return convertHTML(dependencies.VNode, dependencies.VText);
};
/***/ },
/* 30 */
/***/ function(module, exports, __webpack_require__) {
var createConverter = __webpack_require__(31);
var parseHTML = __webpack_require__(40);
module.exports = function initializeHtmlToVdom (VTree, VText) {
var htmlparserToVdom = createConverter(VTree, VText);
return function convertHTML(options, html) {
var noOptions = typeof html === 'undefined' && typeof options === 'string';
var hasOptions = !noOptions;
// was html supplied as the only argument?
var htmlToConvert = noOptions ? options : html;
var getVNodeKey = hasOptions ? options.getVNodeKey : undefined;
var tags = parseHTML(htmlToConvert);
var convertedHTML;
if (tags.length > 1) {
convertedHTML = tags.map(function (tag) {
return htmlparserToVdom.convert(tag, getVNodeKey);
});
}
else {
convertedHTML = htmlparserToVdom.convert(tags[0], getVNodeKey);
}
return convertedHTML;
};
};
/***/ },
/* 31 */
/***/ function(module, exports, __webpack_require__) {
var decode = __webpack_require__(32).decode;
var convertTagAttributes = __webpack_require__(39);
module.exports = function createConverter (VNode, VText) {
var converter = {
convert: function (node, getVNodeKey) {
if (node.type === 'tag' || node.type === 'script' || node.type === 'style') {
return converter.convertTag(node, getVNodeKey);
} else if (node.type === 'text') {
return new VText(decode(node.data));
} else {
// converting an unsupported node, return an empty text node instead.
return new VText('');
}
},
convertTag: function (tag, getVNodeKey) {
var attributes = convertTagAttributes(tag);
var key;
if (getVNodeKey) {
key = getVNodeKey(attributes);
}
var children = Array.prototype.map.call(tag.children || [], function(node) {
return converter.convert(node, getVNodeKey);
});
return new VNode(tag.name, attributes, children, key);
}
};
return converter;
};
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
exports.encode = __webpack_require__(33);
exports.decode = __webpack_require__(37);
/***/ },
/* 33 */
/***/ function(module, exports, __webpack_require__) {
var punycode = __webpack_require__(34);
var revEntities = __webpack_require__(36);
module.exports = encode;
function encode (str, opts) {
if (typeof str !== 'string') {
throw new TypeError('Expected a String');
}
if (!opts) opts = {};
var numeric = true;
if (opts.named) numeric = false;
if (opts.numeric !== undefined) numeric = opts.numeric;
var special = opts.special || {
'"': true, "'": true,
'<': true, '>': true,
'&': true
};
var codePoints = punycode.ucs2.decode(str);
var chars = [];
for (var i = 0; i < codePoints.length; i++) {
var cc = codePoints[i];
var c = punycode.ucs2.encode([ cc ]);
var e = revEntities[cc];
if (e && (cc >= 127 || special[c]) && !numeric) {
chars.push('&' + (/;$/.test(e) ? e : e + ';'));
}
else if (cc < 32 || cc >= 127 || special[c]) {
chars.push('&#' + cc + ';');
}
else {
chars.push(c);
}
}
return chars.join('');
}
/***/ },
/* 34 */
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.4.0 by @mathias */
;(function(root) {
/** Detect free variables */
var freeExports = typeof exports == 'object' && exports &&
!exports.nodeType && exports;
var freeModule = typeof module == 'object' && module &&
!module.nodeType && module;
var freeGlobal = typeof global == 'object' && global;
if (
freeGlobal.global === freeGlobal ||
freeGlobal.window === freeGlobal ||
freeGlobal.self === freeGlobal
) {
root = freeGlobal;
}
/**
* The `punycode` object.
* @name punycode
* @type Object
*/
var punycode,
/** Highest positive signed 32-bit float value */
maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
/** Bootstring parameters */
base = 36,
tMin = 1,
tMax = 26,
skew = 38,
damp = 700,
initialBias = 72,
initialN = 128, // 0x80
delimiter = '-', // '\x2D'
/** Regular expressions */
regexPunycode = /^xn--/,
regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
/** Error messages */
errors = {
'overflow': 'Overflow: input needs wider integers to process',
'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
'invalid-input': 'Invalid input'
},
/** Convenience shortcuts */
baseMinusTMin = base - tMin,
floor = Math.floor,
stringFromCharCode = String.fromCharCode,
/** Temporary variable */
key;
/*--------------------------------------------------------------------------*/
/**
* A generic error utility function.
* @private
* @param {String} type The error type.
* @returns {Error} Throws a `RangeError` with the applicable error message.
*/
function error(type) {
throw new RangeError(errors[type]);
}
/**
* A generic `Array#map` utility function.
* @private
* @param {Array} array The array to iterate over.
* @param {Function} callback The function that gets called for every array
* item.
* @returns {Array} A new array of values returned by the callback function.
*/
function map(array, fn) {
var length = array.length;
var result = [];
while (length--) {
result[length] = fn(array[length]);
}
return result;
}
/**
* A simple `Array#map`-like wrapper to work with domain name strings or email
* addresses.
* @private
* @param {String} domain The domain name or email address.
* @param {Function} callback The function that gets called for every
* character.
* @returns {Array} A new string of characters returned by the callback
* function.
*/
function mapDomain(string, fn) {
var parts = string.split('@');
var result = '';
if (parts.length > 1) {
// In email addresses, only the domain name should be punycoded. Leave
// the local part (i.e. everything up to `@`) intact.
result = parts[0] + '@';
string = parts[1];
}
// Avoid `split(regex)` for IE8 compatibility. See #17.
string = string.replace(regexSeparators, '\x2E');
var labels = string.split('.');
var encoded = map(labels, fn).join('.');
return result + encoded;
}
/**
* Creates an array containing the numeric code points of each Unicode
* character in the string. While JavaScript uses UCS-2 internally,
* this function will convert a pair of surrogate halves (each of which
* UCS-2 exposes as separate characters) into a single code point,
* matching UTF-16.
* @see `punycode.ucs2.encode`
* @see <https://mathiasbynens.be/notes/javascript-encoding>
* @memberOf punycode.ucs2
* @name decode
* @param {String} string The Unicode input string (UCS-2).
* @returns {Array} The new array of code points.
*/
function ucs2decode(string) {
var output = [],
counter = 0,
length = string.length,
value,
extra;
while (counter < length) {
value = string.charCodeAt(counter++);
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
// high surrogate, and there is a next character
extra = string.charCodeAt(counter++);
if ((extra & 0xFC00) == 0xDC00) { // low surrogate
output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
} else {
// unmatched surrogate; only append this code unit, in case the next
// code unit is the high surrogate of a surrogate pair
output.push(value);
counter--;
}
} else {
output.push(value);
}
}
return output;
}
/**
* Creates a string based on an array of numeric code points.
* @see `punycode.ucs2.decode`
* @memberOf punycode.ucs2
* @name encode
* @param {Array} codePoints The array of numeric code points.
* @returns {String} The new Unicode string (UCS-2).
*/
function ucs2encode(array) {
return map(array, function(value) {
var output = '';
if (value > 0xFFFF) {
value -= 0x10000;
output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
value = 0xDC00 | value & 0x3FF;
}
output += stringFromCharCode(value);
return output;
}).join('');
}
/**
* Converts a basic code point into a digit/integer.
* @see `digitToBasic()`
* @private
* @param {Number} codePoint The basic numeric code point value.
* @returns {Number} The numeric value of a basic code point (for use in
* representing integers) in the range `0` to `base - 1`, or `base` if
* the code point does not represent a value.
*/
function basicToDigit(codePoint) {
if (codePoint - 48 < 10) {
return codePoint - 22;
}
if (codePoint - 65 < 26) {
return codePoint - 65;
}
if (codePoint - 97 < 26) {
return codePoint - 97;
}
return base;
}
/**
* Converts a digit/integer into a basic code point.
* @see `basicToDigit()`
* @private
* @param {Number} digit The numeric value of a basic code point.
* @returns {Number} The basic code point whose value (when used for
* representing integers) is `digit`, which needs to be in the range
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
* used; else, the lowercase form is used. The behavior is undefined
* if `flag` is non-zero and `digit` has no uppercase form.
*/
function digitToBasic(digit, flag) {
// 0..25 map to ASCII a..z or A..Z
// 26..35 map to ASCII 0..9
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
}
/**
* Bias adaptation function as per section 3.4 of RFC 3492.
* https://tools.ietf.org/html/rfc3492#section-3.4
* @private
*/
function adapt(delta, numPoints, firstTime) {
var k = 0;
delta = firstTime ? floor(delta / damp) : delta >> 1;
delta += floor(delta / numPoints);
for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
delta = floor(delta / baseMinusTMin);
}
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
}
/**
* Converts a Punycode string of ASCII-only symbols to a string of Unicode
* symbols.
* @memberOf punycode
* @param {String} input The Punycode string of ASCII-only symbols.
* @returns {String} The resulting string of Unicode symbols.
*/
function decode(input) {
// Don't use UCS-2
var output = [],
inputLength = input.length,
out,
i = 0,
n = initialN,
bias = initialBias,
basic,
j,
index,
oldi,
w,
k,
digit,
t,
/** Cached calculation results */
baseMinusT;
// Handle the basic code points: let `basic` be the number of input code
// points before the last delimiter, or `0` if there is none, then copy
// the first basic code points to the output.
basic = input.lastIndexOf(delimiter);
if (basic < 0) {
basic = 0;
}
for (j = 0; j < basic; ++j) {
// if it's not a basic code point
if (input.charCodeAt(j) >= 0x80) {
error('not-basic');
}
output.push(input.charCodeAt(j));
}
// Main decoding loop: start just after the last delimiter if any basic code
// points were copied; start at the beginning otherwise.
for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
// `index` is the index of the next character to be consumed.
// Decode a generalized variable-length integer into `delta`,
// which gets added to `i`. The overflow checking is easier
// if we increase `i` as we go, then subtract off its starting
// value at the end to obtain `delta`.
for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
if (index >= inputLength) {
error('invalid-input');
}
digit = basicToDigit(input.charCodeAt(index++));
if (digit >= base || digit > floor((maxInt - i) / w)) {
error('overflow');
}
i += digit * w;
t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
if (digit < t) {
break;
}
baseMinusT = base - t;
if (w > floor(maxInt / baseMinusT)) {
error('overflow');
}
w *= baseMinusT;
}
out = output.length + 1;
bias = adapt(i - oldi, out, oldi == 0);
// `i` was supposed to wrap around from `out` to `0`,
// incrementing `n` each time, so we'll fix that now:
if (floor(i / out) > maxInt - n) {
error('overflow');
}
n += floor(i / out);
i %= out;
// Insert `n` at position `i` of the output
output.splice(i++, 0, n);
}
return ucs2encode(output);
}
/**
* Converts a string of Unicode symbols (e.g. a domain name label) to a
* Punycode string of ASCII-only symbols.
* @memberOf punycode
* @param {String} input The string of Unicode symbols.
* @returns {String} The resulting Punycode string of ASCII-only symbols.
*/
function encode(input) {
var n,
delta,
handledCPCount,
basicLength,
bias,
j,
m,
q,
k,
t,
currentValue,
output = [],
/** `inputLength` will hold the number of code points in `input`. */
inputLength,
/** Cached calculation results */
handledCPCountPlusOne,
baseMinusT,
qMinusT;
// Convert the input in UCS-2 to Unicode
input = ucs2decode(input);
// Cache the length
inputLength = input.length;
// Initialize the state
n = initialN;
delta = 0;
bias = initialBias;
// Handle the basic code points
for (j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue < 0x80) {
output.push(stringFromCharCode(currentValue));
}
}
handledCPCount = basicLength = output.length;
// `handledCPCount` is the number of code points that have been handled;
// `basicLength` is the number of basic code points.
// Finish the basic string - if it is not empty - with a delimiter
if (basicLength) {
output.push(delimiter);
}
// Main encoding loop:
while (handledCPCount < inputLength) {
// All non-basic code points < n have been handled already. Find the next
// larger one:
for (m = maxInt, j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue >= n && currentValue < m) {
m = currentValue;
}
}
// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
// but guard against overflow
handledCPCountPlusOne = handledCPCount + 1;
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
error('overflow');
}
delta += (m - n) * handledCPCountPlusOne;
n = m;
for (j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue < n && ++delta > maxInt) {
error('overflow');
}
if (currentValue == n) {
// Represent delta as a generalized variable-length integer
for (q = delta, k = base; /* no condition */; k += base) {
t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
if (q < t) {
break;
}
qMinusT = q - t;
baseMinusT = base - t;
output.push(
stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
);
q = floor(qMinusT / baseMinusT);
}
output.push(stringFromCharCode(digitToBasic(q, 0)));
bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
delta = 0;
++handledCPCount;
}
}
++delta;
++n;
}
return output.join('');
}
/**
* Converts a Punycode string representing a domain name or an email address
* to Unicode. Only the Punycoded parts of the input will be converted, i.e.
* it doesn't matter if you call it on a string that has already been
* converted to Unicode.
* @memberOf punycode
* @param {String} input The Punycoded domain name or email address to
* convert to Unicode.
* @returns {String} The Unicode representation of the given Punycode
* string.
*/
function toUnicode(input) {
return mapDomain(input, function(string) {
return regexPunycode.test(string)
? decode(string.slice(4).toLowerCase())
: string;
});
}
/**
* Converts a Unicode string representing a domain name or an email address to
* Punycode. Only the non-ASCII parts of the domain name will be converted,
* i.e. it doesn't matter if you call it with a domain that's already in
* ASCII.
* @memberOf punycode
* @param {String} input The domain name or email address to convert, as a
* Unicode string.
* @returns {String} The Punycode representation of the given domain name or
* email address.
*/
function toASCII(input) {
return mapDomain(input, function(string) {
return regexNonASCII.test(string)
? 'xn--' + encode(string)
: string;
});
}
/*--------------------------------------------------------------------------*/
/** Define the public API */
punycode = {
/**
* A string representing the current Punycode.js version number.
* @memberOf punycode
* @type String
*/
'version': '1.3.2',
/**
* An object of methods to convert from JavaScript's internal character
* representation (UCS-2) to Unicode code points, and back.
* @see <https://mathiasbynens.be/notes/javascript-encoding>
* @memberOf punycode
* @type Object
*/
'ucs2': {
'decode': ucs2decode,
'encode': ucs2encode
},
'decode': decode,
'encode': encode,
'toASCII': toASCII,
'toUnicode': toUnicode
};
/** Expose `punycode` */
// Some AMD build optimizers, like r.js, check for specific condition patterns
// like the following:
if (
true
) {
!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
return punycode;
}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else if (freeExports && freeModule) {
if (module.exports == freeExports) {
// in Node.js, io.js, or RingoJS v0.8.0+
freeModule.exports = punycode;
} else {
// in Narwhal or RingoJS v0.7.0-
for (key in punycode) {
punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
}
}
} else {
// in Rhino or a web browser
root.punycode = punycode;
}
}(this));
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(35)(module), (function() { return this; }())))
/***/ },
/* 35 */
/***/ function(module, exports) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
module.children = [];
module.webpackPolyfill = 1;
}
return module;
}
/***/ },
/* 36 */
/***/ function(module, exports) {
module.exports = {
"9": "Tab;",
"10": "NewLine;",
"33": "excl;",
"34": "quot;",
"35": "num;",
"36": "dollar;",
"37": "percnt;",
"38": "amp;",
"39": "apos;",
"40": "lpar;",
"41": "rpar;",
"42": "midast;",
"43": "plus;",
"44": "comma;",
"46": "period;",
"47": "sol;",
"58": "colon;",
"59": "semi;",
"60": "lt;",
"61": "equals;",
"62": "gt;",
"63": "quest;",
"64": "commat;",
"91": "lsqb;",
"92": "bsol;",
"93": "rsqb;",
"94": "Hat;",
"95": "UnderBar;",
"96": "grave;",
"123": "lcub;",
"124": "VerticalLine;",
"125": "rcub;",
"160": "NonBreakingSpace;",
"161": "iexcl;",
"162": "cent;",
"163": "pound;",
"164": "curren;",
"165": "yen;",
"166": "brvbar;",
"167": "sect;",
"168": "uml;",
"169": "copy;",
"170": "ordf;",
"171": "laquo;",
"172": "not;",
"173": "shy;",
"174": "reg;",
"175": "strns;",
"176": "deg;",
"177": "pm;",
"178": "sup2;",
"179": "sup3;",
"180": "DiacriticalAcute;",
"181": "micro;",
"182": "para;",
"183": "middot;",
"184": "Cedilla;",
"185": "sup1;",
"186": "ordm;",
"187": "raquo;",
"188": "frac14;",
"189": "half;",
"190": "frac34;",
"191": "iquest;",
"192": "Agrave;",
"193": "Aacute;",
"194": "Acirc;",
"195": "Atilde;",
"196": "Auml;",
"197": "Aring;",
"198": "AElig;",
"199": "Ccedil;",
"200": "Egrave;",
"201": "Eacute;",
"202": "Ecirc;",
"203": "Euml;",
"204": "Igrave;",
"205": "Iacute;",
"206": "Icirc;",
"207": "Iuml;",
"208": "ETH;",
"209": "Ntilde;",
"210": "Ograve;",
"211": "Oacute;",
"212": "Ocirc;",
"213": "Otilde;",
"214": "Ouml;",
"215": "times;",
"216": "Oslash;",
"217": "Ugrave;",
"218": "Uacute;",
"219": "Ucirc;",
"220": "Uuml;",
"221": "Yacute;",
"222": "THORN;",
"223": "szlig;",
"224": "agrave;",
"225": "aacute;",
"226": "acirc;",
"227": "atilde;",
"228": "auml;",
"229": "aring;",
"230": "aelig;",
"231": "ccedil;",
"232": "egrave;",
"233": "eacute;",
"234": "ecirc;",
"235": "euml;",
"236": "igrave;",
"237": "iacute;",
"238": "icirc;",
"239": "iuml;",
"240": "eth;",
"241": "ntilde;",
"242": "ograve;",
"243": "oacute;",
"244": "ocirc;",
"245": "otilde;",
"246": "ouml;",
"247": "divide;",
"248": "oslash;",
"249": "ugrave;",
"250": "uacute;",
"251": "ucirc;",
"252": "uuml;",
"253": "yacute;",
"254": "thorn;",
"255": "yuml;",
"256": "Amacr;",
"257": "amacr;",
"258": "Abreve;",
"259": "abreve;",
"260": "Aogon;",
"261": "aogon;",
"262": "Cacute;",
"263": "cacute;",
"264": "Ccirc;",
"265": "ccirc;",
"266": "Cdot;",
"267": "cdot;",
"268": "Ccaron;",
"269": "ccaron;",
"270": "Dcaron;",
"271": "dcaron;",
"272": "Dstrok;",
"273": "dstrok;",
"274": "Emacr;",
"275": "emacr;",
"278": "Edot;",
"279": "edot;",
"280": "Eogon;",
"281": "eogon;",
"282": "Ecaron;",
"283": "ecaron;",
"284": "Gcirc;",
"285": "gcirc;",
"286": "Gbreve;",
"287": "gbreve;",
"288": "Gdot;",
"289": "gdot;",
"290": "Gcedil;",
"292": "Hcirc;",
"293": "hcirc;",
"294": "Hstrok;",
"295": "hstrok;",
"296": "Itilde;",
"297": "itilde;",
"298": "Imacr;",
"299": "imacr;",
"302": "Iogon;",
"303": "iogon;",
"304": "Idot;",
"305": "inodot;",
"306": "IJlig;",
"307": "ijlig;",
"308": "Jcirc;",
"309": "jcirc;",
"310": "Kcedil;",
"311": "kcedil;",
"312": "kgreen;",
"313": "Lacute;",
"314": "lacute;",
"315": "Lcedil;",
"316": "lcedil;",
"317": "Lcaron;",
"318": "lcaron;",
"319": "Lmidot;",
"320": "lmidot;",
"321": "Lstrok;",
"322": "lstrok;",
"323": "Nacute;",
"324": "nacute;",
"325": "Ncedil;",
"326": "ncedil;",
"327": "Ncaron;",
"328": "ncaron;",
"329": "napos;",
"330": "ENG;",
"331": "eng;",
"332": "Omacr;",
"333": "omacr;",
"336": "Odblac;",
"337": "odblac;",
"338": "OElig;",
"339": "oelig;",
"340": "Racute;",
"341": "racute;",
"342": "Rcedil;",
"343": "rcedil;",
"344": "Rcaron;",
"345": "rcaron;",
"346": "Sacute;",
"347": "sacute;",
"348": "Scirc;",
"349": "scirc;",
"350": "Scedil;",
"351": "scedil;",
"352": "Scaron;",
"353": "scaron;",
"354": "Tcedil;",
"355": "tcedil;",
"356": "Tcaron;",
"357": "tcaron;",
"358": "Tstrok;",
"359": "tstrok;",
"360": "Utilde;",
"361": "utilde;",
"362": "Umacr;",
"363": "umacr;",
"364": "Ubreve;",
"365": "ubreve;",
"366": "Uring;",
"367": "uring;",
"368": "Udblac;",
"369": "udblac;",
"370": "Uogon;",
"371": "uogon;",
"372": "Wcirc;",
"373": "wcirc;",
"374": "Ycirc;",
"375": "ycirc;",
"376": "Yuml;",
"377": "Zacute;",
"378": "zacute;",
"379": "Zdot;",
"380": "zdot;",
"381": "Zcaron;",
"382": "zcaron;",
"402": "fnof;",
"437": "imped;",
"501": "gacute;",
"567": "jmath;",
"710": "circ;",
"711": "Hacek;",
"728": "breve;",
"729": "dot;",
"730": "ring;",
"731": "ogon;",
"732": "tilde;",
"733": "DiacriticalDoubleAcute;",
"785": "DownBreve;",
"913": "Alpha;",
"914": "Beta;",
"915": "Gamma;",
"916": "Delta;",
"917": "Epsilon;",
"918": "Zeta;",
"919": "Eta;",
"920": "Theta;",
"921": "Iota;",
"922": "Kappa;",
"923": "Lambda;",
"924": "Mu;",
"925": "Nu;",
"926": "Xi;",
"927": "Omicron;",
"928": "Pi;",
"929": "Rho;",
"931": "Sigma;",
"932": "Tau;",
"933": "Upsilon;",
"934": "Phi;",
"935": "Chi;",
"936": "Psi;",
"937": "Omega;",
"945": "alpha;",
"946": "beta;",
"947": "gamma;",
"948": "delta;",
"949": "epsilon;",
"950": "zeta;",
"951": "eta;",
"952": "theta;",
"953": "iota;",
"954": "kappa;",
"955": "lambda;",
"956": "mu;",
"957": "nu;",
"958": "xi;",
"959": "omicron;",
"960": "pi;",
"961": "rho;",
"962": "varsigma;",
"963": "sigma;",
"964": "tau;",
"965": "upsilon;",
"966": "phi;",
"967": "chi;",
"968": "psi;",
"969": "omega;",
"977": "vartheta;",
"978": "upsih;",
"981": "varphi;",
"982": "varpi;",
"988": "Gammad;",
"989": "gammad;",
"1008": "varkappa;",
"1009": "varrho;",
"1013": "varepsilon;",
"1014": "bepsi;",
"1025": "IOcy;",
"1026": "DJcy;",
"1027": "GJcy;",
"1028": "Jukcy;",
"1029": "DScy;",
"1030": "Iukcy;",
"1031": "YIcy;",
"1032": "Jsercy;",
"1033": "LJcy;",
"1034": "NJcy;",
"1035": "TSHcy;",
"1036": "KJcy;",
"1038": "Ubrcy;",
"1039": "DZcy;",
"1040": "Acy;",
"1041": "Bcy;",
"1042": "Vcy;",
"1043": "Gcy;",
"1044": "Dcy;",
"1045": "IEcy;",
"1046": "ZHcy;",
"1047": "Zcy;",
"1048": "Icy;",
"1049": "Jcy;",
"1050": "Kcy;",
"1051": "Lcy;",
"1052": "Mcy;",
"1053": "Ncy;",
"1054": "Ocy;",
"1055": "Pcy;",
"1056": "Rcy;",
"1057": "Scy;",
"1058": "Tcy;",
"1059": "Ucy;",
"1060": "Fcy;",
"1061": "KHcy;",
"1062": "TScy;",
"1063": "CHcy;",
"1064": "SHcy;",
"1065": "SHCHcy;",
"1066": "HARDcy;",
"1067": "Ycy;",
"1068": "SOFTcy;",
"1069": "Ecy;",
"1070": "YUcy;",
"1071": "YAcy;",
"1072": "acy;",
"1073": "bcy;",
"1074": "vcy;",
"1075": "gcy;",
"1076": "dcy;",
"1077": "iecy;",
"1078": "zhcy;",
"1079": "zcy;",
"1080": "icy;",
"1081": "jcy;",
"1082": "kcy;",
"1083": "lcy;",
"1084": "mcy;",
"1085": "ncy;",
"1086": "ocy;",
"1087": "pcy;",
"1088": "rcy;",
"1089": "scy;",
"1090": "tcy;",
"1091": "ucy;",
"1092": "fcy;",
"1093": "khcy;",
"1094": "tscy;",
"1095": "chcy;",
"1096": "shcy;",
"1097": "shchcy;",
"1098": "hardcy;",
"1099": "ycy;",
"1100": "softcy;",
"1101": "ecy;",
"1102": "yucy;",
"1103": "yacy;",
"1105": "iocy;",
"1106": "djcy;",
"1107": "gjcy;",
"1108": "jukcy;",
"1109": "dscy;",
"1110": "iukcy;",
"1111": "yicy;",
"1112": "jsercy;",
"1113": "ljcy;",
"1114": "njcy;",
"1115": "tshcy;",
"1116": "kjcy;",
"1118": "ubrcy;",
"1119": "dzcy;",
"8194": "ensp;",
"8195": "emsp;",
"8196": "emsp13;",
"8197": "emsp14;",
"8199": "numsp;",
"8200": "puncsp;",
"8201": "ThinSpace;",
"8202": "VeryThinSpace;",
"8203": "ZeroWidthSpace;",
"8204": "zwnj;",
"8205": "zwj;",
"8206": "lrm;",
"8207": "rlm;",
"8208": "hyphen;",
"8211": "ndash;",
"8212": "mdash;",
"8213": "horbar;",
"8214": "Vert;",
"8216": "OpenCurlyQuote;",
"8217": "rsquor;",
"8218": "sbquo;",
"8220": "OpenCurlyDoubleQuote;",
"8221": "rdquor;",
"8222": "ldquor;",
"8224": "dagger;",
"8225": "ddagger;",
"8226": "bullet;",
"8229": "nldr;",
"8230": "mldr;",
"8240": "permil;",
"8241": "pertenk;",
"8242": "prime;",
"8243": "Prime;",
"8244": "tprime;",
"8245": "bprime;",
"8249": "lsaquo;",
"8250": "rsaquo;",
"8254": "OverBar;",
"8257": "caret;",
"8259": "hybull;",
"8260": "frasl;",
"8271": "bsemi;",
"8279": "qprime;",
"8287": "MediumSpace;",
"8288": "NoBreak;",
"8289": "ApplyFunction;",
"8290": "it;",
"8291": "InvisibleComma;",
"8364": "euro;",
"8411": "TripleDot;",
"8412": "DotDot;",
"8450": "Copf;",
"8453": "incare;",
"8458": "gscr;",
"8459": "Hscr;",
"8460": "Poincareplane;",
"8461": "quaternions;",
"8462": "planckh;",
"8463": "plankv;",
"8464": "Iscr;",
"8465": "imagpart;",
"8466": "Lscr;",
"8467": "ell;",
"8469": "Nopf;",
"8470": "numero;",
"8471": "copysr;",
"8472": "wp;",
"8473": "primes;",
"8474": "rationals;",
"8475": "Rscr;",
"8476": "Rfr;",
"8477": "Ropf;",
"8478": "rx;",
"8482": "trade;",
"8484": "Zopf;",
"8487": "mho;",
"8488": "Zfr;",
"8489": "iiota;",
"8492": "Bscr;",
"8493": "Cfr;",
"8495": "escr;",
"8496": "expectation;",
"8497": "Fscr;",
"8499": "phmmat;",
"8500": "oscr;",
"8501": "aleph;",
"8502": "beth;",
"8503": "gimel;",
"8504": "daleth;",
"8517": "DD;",
"8518": "DifferentialD;",
"8519": "exponentiale;",
"8520": "ImaginaryI;",
"8531": "frac13;",
"8532": "frac23;",
"8533": "frac15;",
"8534": "frac25;",
"8535": "frac35;",
"8536": "frac45;",
"8537": "frac16;",
"8538": "frac56;",
"8539": "frac18;",
"8540": "frac38;",
"8541": "frac58;",
"8542": "frac78;",
"8592": "slarr;",
"8593": "uparrow;",
"8594": "srarr;",
"8595": "ShortDownArrow;",
"8596": "leftrightarrow;",
"8597": "varr;",
"8598": "UpperLeftArrow;",
"8599": "UpperRightArrow;",
"8600": "searrow;",
"8601": "swarrow;",
"8602": "nleftarrow;",
"8603": "nrightarrow;",
"8605": "rightsquigarrow;",
"8606": "twoheadleftarrow;",
"8607": "Uarr;",
"8608": "twoheadrightarrow;",
"8609": "Darr;",
"8610": "leftarrowtail;",
"8611": "rightarrowtail;",
"8612": "mapstoleft;",
"8613": "UpTeeArrow;",
"8614": "RightTeeArrow;",
"8615": "mapstodown;",
"8617": "larrhk;",
"8618": "rarrhk;",
"8619": "looparrowleft;",
"8620": "rarrlp;",
"8621": "leftrightsquigarrow;",
"8622": "nleftrightarrow;",
"8624": "lsh;",
"8625": "rsh;",
"8626": "ldsh;",
"8627": "rdsh;",
"8629": "crarr;",
"8630": "curvearrowleft;",
"8631": "curvearrowright;",
"8634": "olarr;",
"8635": "orarr;",
"8636": "lharu;",
"8637": "lhard;",
"8638": "upharpoonright;",
"8639": "upharpoonleft;",
"8640": "RightVector;",
"8641": "rightharpoondown;",
"8642": "RightDownVector;",
"8643": "LeftDownVector;",
"8644": "rlarr;",
"8645": "UpArrowDownArrow;",
"8646": "lrarr;",
"8647": "llarr;",
"8648": "uuarr;",
"8649": "rrarr;",
"8650": "downdownarrows;",
"8651": "ReverseEquilibrium;",
"8652": "rlhar;",
"8653": "nLeftarrow;",
"8654": "nLeftrightarrow;",
"8655": "nRightarrow;",
"8656": "Leftarrow;",
"8657": "Uparrow;",
"8658": "Rightarrow;",
"8659": "Downarrow;",
"8660": "Leftrightarrow;",
"8661": "vArr;",
"8662": "nwArr;",
"8663": "neArr;",
"8664": "seArr;",
"8665": "swArr;",
"8666": "Lleftarrow;",
"8667": "Rrightarrow;",
"8669": "zigrarr;",
"8676": "LeftArrowBar;",
"8677": "RightArrowBar;",
"8693": "duarr;",
"8701": "loarr;",
"8702": "roarr;",
"8703": "hoarr;",
"8704": "forall;",
"8705": "complement;",
"8706": "PartialD;",
"8707": "Exists;",
"8708": "NotExists;",
"8709": "varnothing;",
"8711": "nabla;",
"8712": "isinv;",
"8713": "notinva;",
"8715": "SuchThat;",
"8716": "NotReverseElement;",
"8719": "Product;",
"8720": "Coproduct;",
"8721": "sum;",
"8722": "minus;",
"8723": "mp;",
"8724": "plusdo;",
"8726": "ssetmn;",
"8727": "lowast;",
"8728": "SmallCircle;",
"8730": "Sqrt;",
"8733": "vprop;",
"8734": "infin;",
"8735": "angrt;",
"8736": "angle;",
"8737": "measuredangle;",
"8738": "angsph;",
"8739": "VerticalBar;",
"8740": "nsmid;",
"8741": "spar;",
"8742": "nspar;",
"8743": "wedge;",
"8744": "vee;",
"8745": "cap;",
"8746": "cup;",
"8747": "Integral;",
"8748": "Int;",
"8749": "tint;",
"8750": "oint;",
"8751": "DoubleContourIntegral;",
"8752": "Cconint;",
"8753": "cwint;",
"8754": "cwconint;",
"8755": "CounterClockwiseContourIntegral;",
"8756": "therefore;",
"8757": "because;",
"8758": "ratio;",
"8759": "Proportion;",
"8760": "minusd;",
"8762": "mDDot;",
"8763": "homtht;",
"8764": "Tilde;",
"8765": "bsim;",
"8766": "mstpos;",
"8767": "acd;",
"8768": "wreath;",
"8769": "nsim;",
"8770": "esim;",
"8771": "TildeEqual;",
"8772": "nsimeq;",
"8773": "TildeFullEqual;",
"8774": "simne;",
"8775": "NotTildeFullEqual;",
"8776": "TildeTilde;",
"8777": "NotTildeTilde;",
"8778": "approxeq;",
"8779": "apid;",
"8780": "bcong;",
"8781": "CupCap;",
"8782": "HumpDownHump;",
"8783": "HumpEqual;",
"8784": "esdot;",
"8785": "eDot;",
"8786": "fallingdotseq;",
"8787": "risingdotseq;",
"8788": "coloneq;",
"8789": "eqcolon;",
"8790": "eqcirc;",
"8791": "cire;",
"8793": "wedgeq;",
"8794": "veeeq;",
"8796": "trie;",
"8799": "questeq;",
"8800": "NotEqual;",
"8801": "equiv;",
"8802": "NotCongruent;",
"8804": "leq;",
"8805": "GreaterEqual;",
"8806": "LessFullEqual;",
"8807": "GreaterFullEqual;",
"8808": "lneqq;",
"8809": "gneqq;",
"8810": "NestedLessLess;",
"8811": "NestedGreaterGreater;",
"8812": "twixt;",
"8813": "NotCupCap;",
"8814": "NotLess;",
"8815": "NotGreater;",
"8816": "NotLessEqual;",
"8817": "NotGreaterEqual;",
"8818": "lsim;",
"8819": "gtrsim;",
"8820": "NotLessTilde;",
"8821": "NotGreaterTilde;",
"8822": "lg;",
"8823": "gtrless;",
"8824": "ntlg;",
"8825": "ntgl;",
"8826": "Precedes;",
"8827": "Succeeds;",
"8828": "PrecedesSlantEqual;",
"8829": "SucceedsSlantEqual;",
"8830": "prsim;",
"8831": "succsim;",
"8832": "nprec;",
"8833": "nsucc;",
"8834": "subset;",
"8835": "supset;",
"8836": "nsub;",
"8837": "nsup;",
"8838": "SubsetEqual;",
"8839": "supseteq;",
"8840": "nsubseteq;",
"8841": "nsupseteq;",
"8842": "subsetneq;",
"8843": "supsetneq;",
"8845": "cupdot;",
"8846": "uplus;",
"8847": "SquareSubset;",
"8848": "SquareSuperset;",
"8849": "SquareSubsetEqual;",
"8850": "SquareSupersetEqual;",
"8851": "SquareIntersection;",
"8852": "SquareUnion;",
"8853": "oplus;",
"8854": "ominus;",
"8855": "otimes;",
"8856": "osol;",
"8857": "odot;",
"8858": "ocir;",
"8859": "oast;",
"8861": "odash;",
"8862": "plusb;",
"8863": "minusb;",
"8864": "timesb;",
"8865": "sdotb;",
"8866": "vdash;",
"8867": "LeftTee;",
"8868": "top;",
"8869": "UpTee;",
"8871": "models;",
"8872": "vDash;",
"8873": "Vdash;",
"8874": "Vvdash;",
"8875": "VDash;",
"8876": "nvdash;",
"8877": "nvDash;",
"8878": "nVdash;",
"8879": "nVDash;",
"8880": "prurel;",
"8882": "vltri;",
"8883": "vrtri;",
"8884": "trianglelefteq;",
"8885": "trianglerighteq;",
"8886": "origof;",
"8887": "imof;",
"8888": "mumap;",
"8889": "hercon;",
"8890": "intercal;",
"8891": "veebar;",
"8893": "barvee;",
"8894": "angrtvb;",
"8895": "lrtri;",
"8896": "xwedge;",
"8897": "xvee;",
"8898": "xcap;",
"8899": "xcup;",
"8900": "diamond;",
"8901": "sdot;",
"8902": "Star;",
"8903": "divonx;",
"8904": "bowtie;",
"8905": "ltimes;",
"8906": "rtimes;",
"8907": "lthree;",
"8908": "rthree;",
"8909": "bsime;",
"8910": "cuvee;",
"8911": "cuwed;",
"8912": "Subset;",
"8913": "Supset;",
"8914": "Cap;",
"8915": "Cup;",
"8916": "pitchfork;",
"8917": "epar;",
"8918": "ltdot;",
"8919": "gtrdot;",
"8920": "Ll;",
"8921": "ggg;",
"8922": "LessEqualGreater;",
"8923": "gtreqless;",
"8926": "curlyeqprec;",
"8927": "curlyeqsucc;",
"8928": "nprcue;",
"8929": "nsccue;",
"8930": "nsqsube;",
"8931": "nsqsupe;",
"8934": "lnsim;",
"8935": "gnsim;",
"8936": "prnsim;",
"8937": "succnsim;",
"8938": "ntriangleleft;",
"8939": "ntriangleright;",
"8940": "ntrianglelefteq;",
"8941": "ntrianglerighteq;",
"8942": "vellip;",
"8943": "ctdot;",
"8944": "utdot;",
"8945": "dtdot;",
"8946": "disin;",
"8947": "isinsv;",
"8948": "isins;",
"8949": "isindot;",
"8950": "notinvc;",
"8951": "notinvb;",
"8953": "isinE;",
"8954": "nisd;",
"8955": "xnis;",
"8956": "nis;",
"8957": "notnivc;",
"8958": "notnivb;",
"8965": "barwedge;",
"8966": "doublebarwedge;",
"8968": "LeftCeiling;",
"8969": "RightCeiling;",
"8970": "lfloor;",
"8971": "RightFloor;",
"8972": "drcrop;",
"8973": "dlcrop;",
"8974": "urcrop;",
"8975": "ulcrop;",
"8976": "bnot;",
"8978": "profline;",
"8979": "profsurf;",
"8981": "telrec;",
"8982": "target;",
"8988": "ulcorner;",
"8989": "urcorner;",
"8990": "llcorner;",
"8991": "lrcorner;",
"8994": "sfrown;",
"8995": "ssmile;",
"9005": "cylcty;",
"9006": "profalar;",
"9014": "topbot;",
"9021": "ovbar;",
"9023": "solbar;",
"9084": "angzarr;",
"9136": "lmoustache;",
"9137": "rmoustache;",
"9140": "tbrk;",
"9141": "UnderBracket;",
"9142": "bbrktbrk;",
"9180": "OverParenthesis;",
"9181": "UnderParenthesis;",
"9182": "OverBrace;",
"9183": "UnderBrace;",
"9186": "trpezium;",
"9191": "elinters;",
"9251": "blank;",
"9416": "oS;",
"9472": "HorizontalLine;",
"9474": "boxv;",
"9484": "boxdr;",
"9488": "boxdl;",
"9492": "boxur;",
"9496": "boxul;",
"9500": "boxvr;",
"9508": "boxvl;",
"9516": "boxhd;",
"9524": "boxhu;",
"9532": "boxvh;",
"9552": "boxH;",
"9553": "boxV;",
"9554": "boxdR;",
"9555": "boxDr;",
"9556": "boxDR;",
"9557": "boxdL;",
"9558": "boxDl;",
"9559": "boxDL;",
"9560": "boxuR;",
"9561": "boxUr;",
"9562": "boxUR;",
"9563": "boxuL;",
"9564": "boxUl;",
"9565": "boxUL;",
"9566": "boxvR;",
"9567": "boxVr;",
"9568": "boxVR;",
"9569": "boxvL;",
"9570": "boxVl;",
"9571": "boxVL;",
"9572": "boxHd;",
"9573": "boxhD;",
"9574": "boxHD;",
"9575": "boxHu;",
"9576": "boxhU;",
"9577": "boxHU;",
"9578": "boxvH;",
"9579": "boxVh;",
"9580": "boxVH;",
"9600": "uhblk;",
"9604": "lhblk;",
"9608": "block;",
"9617": "blk14;",
"9618": "blk12;",
"9619": "blk34;",
"9633": "square;",
"9642": "squf;",
"9643": "EmptyVerySmallSquare;",
"9645": "rect;",
"9646": "marker;",
"9649": "fltns;",
"9651": "xutri;",
"9652": "utrif;",
"9653": "utri;",
"9656": "rtrif;",
"9657": "triangleright;",
"9661": "xdtri;",
"9662": "dtrif;",
"9663": "triangledown;",
"9666": "ltrif;",
"9667": "triangleleft;",
"9674": "lozenge;",
"9675": "cir;",
"9708": "tridot;",
"9711": "xcirc;",
"9720": "ultri;",
"9721": "urtri;",
"9722": "lltri;",
"9723": "EmptySmallSquare;",
"9724": "FilledSmallSquare;",
"9733": "starf;",
"9734": "star;",
"9742": "phone;",
"9792": "female;",
"9794": "male;",
"9824": "spadesuit;",
"9827": "clubsuit;",
"9829": "heartsuit;",
"9830": "diams;",
"9834": "sung;",
"9837": "flat;",
"9838": "natural;",
"9839": "sharp;",
"10003": "checkmark;",
"10007": "cross;",
"10016": "maltese;",
"10038": "sext;",
"10072": "VerticalSeparator;",
"10098": "lbbrk;",
"10099": "rbbrk;",
"10184": "bsolhsub;",
"10185": "suphsol;",
"10214": "lobrk;",
"10215": "robrk;",
"10216": "LeftAngleBracket;",
"10217": "RightAngleBracket;",
"10218": "Lang;",
"10219": "Rang;",
"10220": "loang;",
"10221": "roang;",
"10229": "xlarr;",
"10230": "xrarr;",
"10231": "xharr;",
"10232": "xlArr;",
"10233": "xrArr;",
"10234": "xhArr;",
"10236": "xmap;",
"10239": "dzigrarr;",
"10498": "nvlArr;",
"10499": "nvrArr;",
"10500": "nvHarr;",
"10501": "Map;",
"10508": "lbarr;",
"10509": "rbarr;",
"10510": "lBarr;",
"10511": "rBarr;",
"10512": "RBarr;",
"10513": "DDotrahd;",
"10514": "UpArrowBar;",
"10515": "DownArrowBar;",
"10518": "Rarrtl;",
"10521": "latail;",
"10522": "ratail;",
"10523": "lAtail;",
"10524": "rAtail;",
"10525": "larrfs;",
"10526": "rarrfs;",
"10527": "larrbfs;",
"10528": "rarrbfs;",
"10531": "nwarhk;",
"10532": "nearhk;",
"10533": "searhk;",
"10534": "swarhk;",
"10535": "nwnear;",
"10536": "toea;",
"10537": "tosa;",
"10538": "swnwar;",
"10547": "rarrc;",
"10549": "cudarrr;",
"10550": "ldca;",
"10551": "rdca;",
"10552": "cudarrl;",
"10553": "larrpl;",
"10556": "curarrm;",
"10557": "cularrp;",
"10565": "rarrpl;",
"10568": "harrcir;",
"10569": "Uarrocir;",
"10570": "lurdshar;",
"10571": "ldrushar;",
"10574": "LeftRightVector;",
"10575": "RightUpDownVector;",
"10576": "DownLeftRightVector;",
"10577": "LeftUpDownVector;",
"10578": "LeftVectorBar;",
"10579": "RightVectorBar;",
"10580": "RightUpVectorBar;",
"10581": "RightDownVectorBar;",
"10582": "DownLeftVectorBar;",
"10583": "DownRightVectorBar;",
"10584": "LeftUpVectorBar;",
"10585": "LeftDownVectorBar;",
"10586": "LeftTeeVector;",
"10587": "RightTeeVector;",
"10588": "RightUpTeeVector;",
"10589": "RightDownTeeVector;",
"10590": "DownLeftTeeVector;",
"10591": "DownRightTeeVector;",
"10592": "LeftUpTeeVector;",
"10593": "LeftDownTeeVector;",
"10594": "lHar;",
"10595": "uHar;",
"10596": "rHar;",
"10597": "dHar;",
"10598": "luruhar;",
"10599": "ldrdhar;",
"10600": "ruluhar;",
"10601": "rdldhar;",
"10602": "lharul;",
"10603": "llhard;",
"10604": "rharul;",
"10605": "lrhard;",
"10606": "UpEquilibrium;",
"10607": "ReverseUpEquilibrium;",
"10608": "RoundImplies;",
"10609": "erarr;",
"10610": "simrarr;",
"10611": "larrsim;",
"10612": "rarrsim;",
"10613": "rarrap;",
"10614": "ltlarr;",
"10616": "gtrarr;",
"10617": "subrarr;",
"10619": "suplarr;",
"10620": "lfisht;",
"10621": "rfisht;",
"10622": "ufisht;",
"10623": "dfisht;",
"10629": "lopar;",
"10630": "ropar;",
"10635": "lbrke;",
"10636": "rbrke;",
"10637": "lbrkslu;",
"10638": "rbrksld;",
"10639": "lbrksld;",
"10640": "rbrkslu;",
"10641": "langd;",
"10642": "rangd;",
"10643": "lparlt;",
"10644": "rpargt;",
"10645": "gtlPar;",
"10646": "ltrPar;",
"10650": "vzigzag;",
"10652": "vangrt;",
"10653": "angrtvbd;",
"10660": "ange;",
"10661": "range;",
"10662": "dwangle;",
"10663": "uwangle;",
"10664": "angmsdaa;",
"10665": "angmsdab;",
"10666": "angmsdac;",
"10667": "angmsdad;",
"10668": "angmsdae;",
"10669": "angmsdaf;",
"10670": "angmsdag;",
"10671": "angmsdah;",
"10672": "bemptyv;",
"10673": "demptyv;",
"10674": "cemptyv;",
"10675": "raemptyv;",
"10676": "laemptyv;",
"10677": "ohbar;",
"10678": "omid;",
"10679": "opar;",
"10681": "operp;",
"10683": "olcross;",
"10684": "odsold;",
"10686": "olcir;",
"10687": "ofcir;",
"10688": "olt;",
"10689": "ogt;",
"10690": "cirscir;",
"10691": "cirE;",
"10692": "solb;",
"10693": "bsolb;",
"10697": "boxbox;",
"10701": "trisb;",
"10702": "rtriltri;",
"10703": "LeftTriangleBar;",
"10704": "RightTriangleBar;",
"10716": "iinfin;",
"10717": "infintie;",
"10718": "nvinfin;",
"10723": "eparsl;",
"10724": "smeparsl;",
"10725": "eqvparsl;",
"10731": "lozf;",
"10740": "RuleDelayed;",
"10742": "dsol;",
"10752": "xodot;",
"10753": "xoplus;",
"10754": "xotime;",
"10756": "xuplus;",
"10758": "xsqcup;",
"10764": "qint;",
"10765": "fpartint;",
"10768": "cirfnint;",
"10769": "awint;",
"10770": "rppolint;",
"10771": "scpolint;",
"10772": "npolint;",
"10773": "pointint;",
"10774": "quatint;",
"10775": "intlarhk;",
"10786": "pluscir;",
"10787": "plusacir;",
"10788": "simplus;",
"10789": "plusdu;",
"10790": "plussim;",
"10791": "plustwo;",
"10793": "mcomma;",
"10794": "minusdu;",
"10797": "loplus;",
"10798": "roplus;",
"10799": "Cross;",
"10800": "timesd;",
"10801": "timesbar;",
"10803": "smashp;",
"10804": "lotimes;",
"10805": "rotimes;",
"10806": "otimesas;",
"10807": "Otimes;",
"10808": "odiv;",
"10809": "triplus;",
"10810": "triminus;",
"10811": "tritime;",
"10812": "iprod;",
"10815": "amalg;",
"10816": "capdot;",
"10818": "ncup;",
"10819": "ncap;",
"10820": "capand;",
"10821": "cupor;",
"10822": "cupcap;",
"10823": "capcup;",
"10824": "cupbrcap;",
"10825": "capbrcup;",
"10826": "cupcup;",
"10827": "capcap;",
"10828": "ccups;",
"10829": "ccaps;",
"10832": "ccupssm;",
"10835": "And;",
"10836": "Or;",
"10837": "andand;",
"10838": "oror;",
"10839": "orslope;",
"10840": "andslope;",
"10842": "andv;",
"10843": "orv;",
"10844": "andd;",
"10845": "ord;",
"10847": "wedbar;",
"10854": "sdote;",
"10858": "simdot;",
"10861": "congdot;",
"10862": "easter;",
"10863": "apacir;",
"10864": "apE;",
"10865": "eplus;",
"10866": "pluse;",
"10867": "Esim;",
"10868": "Colone;",
"10869": "Equal;",
"10871": "eDDot;",
"10872": "equivDD;",
"10873": "ltcir;",
"10874": "gtcir;",
"10875": "ltquest;",
"10876": "gtquest;",
"10877": "LessSlantEqual;",
"10878": "GreaterSlantEqual;",
"10879": "lesdot;",
"10880": "gesdot;",
"10881": "lesdoto;",
"10882": "gesdoto;",
"10883": "lesdotor;",
"10884": "gesdotol;",
"10885": "lessapprox;",
"10886": "gtrapprox;",
"10887": "lneq;",
"10888": "gneq;",
"10889": "lnapprox;",
"10890": "gnapprox;",
"10891": "lesseqqgtr;",
"10892": "gtreqqless;",
"10893": "lsime;",
"10894": "gsime;",
"10895": "lsimg;",
"10896": "gsiml;",
"10897": "lgE;",
"10898": "glE;",
"10899": "lesges;",
"10900": "gesles;",
"10901": "eqslantless;",
"10902": "eqslantgtr;",
"10903": "elsdot;",
"10904": "egsdot;",
"10905": "el;",
"10906": "eg;",
"10909": "siml;",
"10910": "simg;",
"10911": "simlE;",
"10912": "simgE;",
"10913": "LessLess;",
"10914": "GreaterGreater;",
"10916": "glj;",
"10917": "gla;",
"10918": "ltcc;",
"10919": "gtcc;",
"10920": "lescc;",
"10921": "gescc;",
"10922": "smt;",
"10923": "lat;",
"10924": "smte;",
"10925": "late;",
"10926": "bumpE;",
"10927": "preceq;",
"10928": "succeq;",
"10931": "prE;",
"10932": "scE;",
"10933": "prnE;",
"10934": "succneqq;",
"10935": "precapprox;",
"10936": "succapprox;",
"10937": "prnap;",
"10938": "succnapprox;",
"10939": "Pr;",
"10940": "Sc;",
"10941": "subdot;",
"10942": "supdot;",
"10943": "subplus;",
"10944": "supplus;",
"10945": "submult;",
"10946": "supmult;",
"10947": "subedot;",
"10948": "supedot;",
"10949": "subseteqq;",
"10950": "supseteqq;",
"10951": "subsim;",
"10952": "supsim;",
"10955": "subsetneqq;",
"10956": "supsetneqq;",
"10959": "csub;",
"10960": "csup;",
"10961": "csube;",
"10962": "csupe;",
"10963": "subsup;",
"10964": "supsub;",
"10965": "subsub;",
"10966": "supsup;",
"10967": "suphsub;",
"10968": "supdsub;",
"10969": "forkv;",
"10970": "topfork;",
"10971": "mlcp;",
"10980": "DoubleLeftTee;",
"10982": "Vdashl;",
"10983": "Barv;",
"10984": "vBar;",
"10985": "vBarv;",
"10987": "Vbar;",
"10988": "Not;",
"10989": "bNot;",
"10990": "rnmid;",
"10991": "cirmid;",
"10992": "midcir;",
"10993": "topcir;",
"10994": "nhpar;",
"10995": "parsim;",
"11005": "parsl;",
"64256": "fflig;",
"64257": "filig;",
"64258": "fllig;",
"64259": "ffilig;",
"64260": "ffllig;"
};
/***/ },
/* 37 */
/***/ function(module, exports, __webpack_require__) {
var punycode = __webpack_require__(34);
var entities = __webpack_require__(38);
module.exports = decode;
function decode (str) {
if (typeof str !== 'string') {
throw new TypeError('Expected a String');
}
return str.replace(/&(#?[^;\W]+;?)/g, function (_, match) {
var m;
if (m = /^#(\d+);?$/.exec(match)) {
return punycode.ucs2.encode([ parseInt(m[1], 10) ]);
} else if (m = /^#[Xx]([A-Fa-f0-9]+);?/.exec(match)) {
return punycode.ucs2.encode([ parseInt(m[1], 16) ]);
} else {
// named entity
var hasSemi = /;$/.test(match);
var withoutSemi = hasSemi ? match.replace(/;$/, '') : match;
var target = entities[withoutSemi] || (hasSemi && entities[match]);
if (typeof target === 'number') {
return punycode.ucs2.encode([ target ]);
} else if (typeof target === 'string') {
return target;
} else {
return '&' + match;
}
}
});
}
/***/ },
/* 38 */
/***/ function(module, exports) {
module.exports = {
"Aacute;": "Á",
"Aacute": "Á",
"aacute;": "á",
"aacute": "á",
"Abreve;": "Ă",
"abreve;": "ă",
"ac;": "∾",
"acd;": "∿",
"acE;": "∾̳",
"Acirc;": "Â",
"Acirc": "Â",
"acirc;": "â",
"acirc": "â",
"acute;": "´",
"acute": "´",
"Acy;": "А",
"acy;": "а",
"AElig;": "Æ",
"AElig": "Æ",
"aelig;": "æ",
"aelig": "æ",
"af;": "",
"Afr;": "𝔄",
"afr;": "𝔞",
"Agrave;": "À",
"Agrave": "À",
"agrave;": "à",
"agrave": "à",
"alefsym;": "ℵ",
"aleph;": "ℵ",
"Alpha;": "Α",
"alpha;": "α",
"Amacr;": "Ā",
"amacr;": "ā",
"amalg;": "⨿",
"AMP;": "&",
"AMP": "&",
"amp;": "&",
"amp": "&",
"And;": "⩓",
"and;": "∧",
"andand;": "⩕",
"andd;": "⩜",
"andslope;": "⩘",
"andv;": "⩚",
"ang;": "∠",
"ange;": "⦤",
"angle;": "∠",
"angmsd;": "∡",
"angmsdaa;": "⦨",
"angmsdab;": "⦩",
"angmsdac;": "⦪",
"angmsdad;": "⦫",
"angmsdae;": "⦬",
"angmsdaf;": "⦭",
"angmsdag;": "⦮",
"angmsdah;": "⦯",
"angrt;": "∟",
"angrtvb;": "⊾",
"angrtvbd;": "⦝",
"angsph;": "∢",
"angst;": "Å",
"angzarr;": "⍼",
"Aogon;": "Ą",
"aogon;": "ą",
"Aopf;": "𝔸",
"aopf;": "𝕒",
"ap;": "≈",
"apacir;": "⩯",
"apE;": "⩰",
"ape;": "≊",
"apid;": "≋",
"apos;": "'",
"ApplyFunction;": "",
"approx;": "≈",
"approxeq;": "≊",
"Aring;": "Å",
"Aring": "Å",
"aring;": "å",
"aring": "å",
"Ascr;": "𝒜",
"ascr;": "𝒶",
"Assign;": "≔",
"ast;": "*",
"asymp;": "≈",
"asympeq;": "≍",
"Atilde;": "Ã",
"Atilde": "Ã",
"atilde;": "ã",
"atilde": "ã",
"Auml;": "Ä",
"Auml": "Ä",
"auml;": "ä",
"auml": "ä",
"awconint;": "∳",
"awint;": "⨑",
"backcong;": "≌",
"backepsilon;": "϶",
"backprime;": "‵",
"backsim;": "∽",
"backsimeq;": "⋍",
"Backslash;": "∖",
"Barv;": "⫧",
"barvee;": "⊽",
"Barwed;": "⌆",
"barwed;": "⌅",
"barwedge;": "⌅",
"bbrk;": "⎵",
"bbrktbrk;": "⎶",
"bcong;": "≌",
"Bcy;": "Б",
"bcy;": "б",
"bdquo;": "„",
"becaus;": "∵",
"Because;": "∵",
"because;": "∵",
"bemptyv;": "⦰",
"bepsi;": "϶",
"bernou;": "ℬ",
"Bernoullis;": "ℬ",
"Beta;": "Β",
"beta;": "β",
"beth;": "ℶ",
"between;": "≬",
"Bfr;": "𝔅",
"bfr;": "𝔟",
"bigcap;": "⋂",
"bigcirc;": "◯",
"bigcup;": "⋃",
"bigodot;": "⨀",
"bigoplus;": "⨁",
"bigotimes;": "⨂",
"bigsqcup;": "⨆",
"bigstar;": "★",
"bigtriangledown;": "▽",
"bigtriangleup;": "△",
"biguplus;": "⨄",
"bigvee;": "⋁",
"bigwedge;": "⋀",
"bkarow;": "⤍",
"blacklozenge;": "⧫",
"blacksquare;": "▪",
"blacktriangle;": "▴",
"blacktriangledown;": "▾",
"blacktriangleleft;": "◂",
"blacktriangleright;": "▸",
"blank;": "␣",
"blk12;": "▒",
"blk14;": "░",
"blk34;": "▓",
"block;": "█",
"bne;": "=⃥",
"bnequiv;": "≡⃥",
"bNot;": "⫭",
"bnot;": "⌐",
"Bopf;": "𝔹",
"bopf;": "𝕓",
"bot;": "⊥",
"bottom;": "⊥",
"bowtie;": "⋈",
"boxbox;": "⧉",
"boxDL;": "╗",
"boxDl;": "╖",
"boxdL;": "╕",
"boxdl;": "┐",
"boxDR;": "╔",
"boxDr;": "╓",
"boxdR;": "╒",
"boxdr;": "┌",
"boxH;": "═",
"boxh;": "─",
"boxHD;": "╦",
"boxHd;": "╤",
"boxhD;": "╥",
"boxhd;": "┬",
"boxHU;": "╩",
"boxHu;": "╧",
"boxhU;": "╨",
"boxhu;": "┴",
"boxminus;": "⊟",
"boxplus;": "⊞",
"boxtimes;": "⊠",
"boxUL;": "╝",
"boxUl;": "╜",
"boxuL;": "╛",
"boxul;": "┘",
"boxUR;": "╚",
"boxUr;": "╙",
"boxuR;": "╘",
"boxur;": "└",
"boxV;": "║",
"boxv;": "│",
"boxVH;": "╬",
"boxVh;": "╫",
"boxvH;": "╪",
"boxvh;": "┼",
"boxVL;": "╣",
"boxVl;": "╢",
"boxvL;": "╡",
"boxvl;": "┤",
"boxVR;": "╠",
"boxVr;": "╟",
"boxvR;": "╞",
"boxvr;": "├",
"bprime;": "‵",
"Breve;": "˘",
"breve;": "˘",
"brvbar;": "¦",
"brvbar": "¦",
"Bscr;": "ℬ",
"bscr;": "𝒷",
"bsemi;": "⁏",
"bsim;": "∽",
"bsime;": "⋍",
"bsol;": "\\",
"bsolb;": "⧅",
"bsolhsub;": "⟈",
"bull;": "•",
"bullet;": "•",
"bump;": "≎",
"bumpE;": "⪮",
"bumpe;": "≏",
"Bumpeq;": "≎",
"bumpeq;": "≏",
"Cacute;": "Ć",
"cacute;": "ć",
"Cap;": "⋒",
"cap;": "∩",
"capand;": "⩄",
"capbrcup;": "⩉",
"capcap;": "⩋",
"capcup;": "⩇",
"capdot;": "⩀",
"CapitalDifferentialD;": "ⅅ",
"caps;": "∩︀",
"caret;": "⁁",
"caron;": "ˇ",
"Cayleys;": "ℭ",
"ccaps;": "⩍",
"Ccaron;": "Č",
"ccaron;": "č",
"Ccedil;": "Ç",
"Ccedil": "Ç",
"ccedil;": "ç",
"ccedil": "ç",
"Ccirc;": "Ĉ",
"ccirc;": "ĉ",
"Cconint;": "∰",
"ccups;": "⩌",
"ccupssm;": "⩐",
"Cdot;": "Ċ",
"cdot;": "ċ",
"cedil;": "¸",
"cedil": "¸",
"Cedilla;": "¸",
"cemptyv;": "⦲",
"cent;": "¢",
"cent": "¢",
"CenterDot;": "·",
"centerdot;": "·",
"Cfr;": "ℭ",
"cfr;": "𝔠",
"CHcy;": "Ч",
"chcy;": "ч",
"check;": "✓",
"checkmark;": "✓",
"Chi;": "Χ",
"chi;": "χ",
"cir;": "○",
"circ;": "ˆ",
"circeq;": "≗",
"circlearrowleft;": "↺",
"circlearrowright;": "↻",
"circledast;": "⊛",
"circledcirc;": "⊚",
"circleddash;": "⊝",
"CircleDot;": "⊙",
"circledR;": "®",
"circledS;": "Ⓢ",
"CircleMinus;": "⊖",
"CirclePlus;": "⊕",
"CircleTimes;": "⊗",
"cirE;": "⧃",
"cire;": "≗",
"cirfnint;": "⨐",
"cirmid;": "⫯",
"cirscir;": "⧂",
"ClockwiseContourIntegral;": "∲",
"CloseCurlyDoubleQuote;": "”",
"CloseCurlyQuote;": "’",
"clubs;": "♣",
"clubsuit;": "♣",
"Colon;": "∷",
"colon;": ":",
"Colone;": "⩴",
"colone;": "≔",
"coloneq;": "≔",
"comma;": ",",
"commat;": "@",
"comp;": "∁",
"compfn;": "∘",
"complement;": "∁",
"complexes;": "ℂ",
"cong;": "≅",
"congdot;": "⩭",
"Congruent;": "≡",
"Conint;": "∯",
"conint;": "∮",
"ContourIntegral;": "∮",
"Copf;": "ℂ",
"copf;": "𝕔",
"coprod;": "∐",
"Coproduct;": "∐",
"COPY;": "©",
"COPY": "©",
"copy;": "©",
"copy": "©",
"copysr;": "℗",
"CounterClockwiseContourIntegral;": "∳",
"crarr;": "↵",
"Cross;": "⨯",
"cross;": "✗",
"Cscr;": "𝒞",
"cscr;": "𝒸",
"csub;": "⫏",
"csube;": "⫑",
"csup;": "⫐",
"csupe;": "⫒",
"ctdot;": "⋯",
"cudarrl;": "⤸",
"cudarrr;": "⤵",
"cuepr;": "⋞",
"cuesc;": "⋟",
"cularr;": "↶",
"cularrp;": "⤽",
"Cup;": "⋓",
"cup;": "∪",
"cupbrcap;": "⩈",
"CupCap;": "≍",
"cupcap;": "⩆",
"cupcup;": "⩊",
"cupdot;": "⊍",
"cupor;": "⩅",
"cups;": "∪︀",
"curarr;": "↷",
"curarrm;": "⤼",
"curlyeqprec;": "⋞",
"curlyeqsucc;": "⋟",
"curlyvee;": "⋎",
"curlywedge;": "⋏",
"curren;": "¤",
"curren": "¤",
"curvearrowleft;": "↶",
"curvearrowright;": "↷",
"cuvee;": "⋎",
"cuwed;": "⋏",
"cwconint;": "∲",
"cwint;": "∱",
"cylcty;": "⌭",
"Dagger;": "‡",
"dagger;": "†",
"daleth;": "ℸ",
"Darr;": "↡",
"dArr;": "⇓",
"darr;": "↓",
"dash;": "‐",
"Dashv;": "⫤",
"dashv;": "⊣",
"dbkarow;": "⤏",
"dblac;": "˝",
"Dcaron;": "Ď",
"dcaron;": "ď",
"Dcy;": "Д",
"dcy;": "д",
"DD;": "ⅅ",
"dd;": "ⅆ",
"ddagger;": "‡",
"ddarr;": "⇊",
"DDotrahd;": "⤑",
"ddotseq;": "⩷",
"deg;": "°",
"deg": "°",
"Del;": "∇",
"Delta;": "Δ",
"delta;": "δ",
"demptyv;": "⦱",
"dfisht;": "⥿",
"Dfr;": "𝔇",
"dfr;": "𝔡",
"dHar;": "⥥",
"dharl;": "⇃",
"dharr;": "⇂",
"DiacriticalAcute;": "´",
"DiacriticalDot;": "˙",
"DiacriticalDoubleAcute;": "˝",
"DiacriticalGrave;": "`",
"DiacriticalTilde;": "˜",
"diam;": "⋄",
"Diamond;": "⋄",
"diamond;": "⋄",
"diamondsuit;": "♦",
"diams;": "♦",
"die;": "¨",
"DifferentialD;": "ⅆ",
"digamma;": "ϝ",
"disin;": "⋲",
"div;": "÷",
"divide;": "÷",
"divide": "÷",
"divideontimes;": "⋇",
"divonx;": "⋇",
"DJcy;": "Ђ",
"djcy;": "ђ",
"dlcorn;": "⌞",
"dlcrop;": "⌍",
"dollar;": "$",
"Dopf;": "𝔻",
"dopf;": "𝕕",
"Dot;": "¨",
"dot;": "˙",
"DotDot;": "⃜",
"doteq;": "≐",
"doteqdot;": "≑",
"DotEqual;": "≐",
"dotminus;": "∸",
"dotplus;": "∔",
"dotsquare;": "⊡",
"doublebarwedge;": "⌆",
"DoubleContourIntegral;": "∯",
"DoubleDot;": "¨",
"DoubleDownArrow;": "⇓",
"DoubleLeftArrow;": "⇐",
"DoubleLeftRightArrow;": "⇔",
"DoubleLeftTee;": "⫤",
"DoubleLongLeftArrow;": "⟸",
"DoubleLongLeftRightArrow;": "⟺",
"DoubleLongRightArrow;": "⟹",
"DoubleRightArrow;": "⇒",
"DoubleRightTee;": "⊨",
"DoubleUpArrow;": "⇑",
"DoubleUpDownArrow;": "⇕",
"DoubleVerticalBar;": "∥",
"DownArrow;": "↓",
"Downarrow;": "⇓",
"downarrow;": "↓",
"DownArrowBar;": "⤓",
"DownArrowUpArrow;": "⇵",
"DownBreve;": "̑",
"downdownarrows;": "⇊",
"downharpoonleft;": "⇃",
"downharpoonright;": "⇂",
"DownLeftRightVector;": "⥐",
"DownLeftTeeVector;": "⥞",
"DownLeftVector;": "↽",
"DownLeftVectorBar;": "⥖",
"DownRightTeeVector;": "⥟",
"DownRightVector;": "⇁",
"DownRightVectorBar;": "⥗",
"DownTee;": "⊤",
"DownTeeArrow;": "↧",
"drbkarow;": "⤐",
"drcorn;": "⌟",
"drcrop;": "⌌",
"Dscr;": "𝒟",
"dscr;": "𝒹",
"DScy;": "Ѕ",
"dscy;": "ѕ",
"dsol;": "⧶",
"Dstrok;": "Đ",
"dstrok;": "đ",
"dtdot;": "⋱",
"dtri;": "▿",
"dtrif;": "▾",
"duarr;": "⇵",
"duhar;": "⥯",
"dwangle;": "⦦",
"DZcy;": "Џ",
"dzcy;": "џ",
"dzigrarr;": "⟿",
"Eacute;": "É",
"Eacute": "É",
"eacute;": "é",
"eacute": "é",
"easter;": "⩮",
"Ecaron;": "Ě",
"ecaron;": "ě",
"ecir;": "≖",
"Ecirc;": "Ê",
"Ecirc": "Ê",
"ecirc;": "ê",
"ecirc": "ê",
"ecolon;": "≕",
"Ecy;": "Э",
"ecy;": "э",
"eDDot;": "⩷",
"Edot;": "Ė",
"eDot;": "≑",
"edot;": "ė",
"ee;": "ⅇ",
"efDot;": "≒",
"Efr;": "𝔈",
"efr;": "𝔢",
"eg;": "⪚",
"Egrave;": "È",
"Egrave": "È",
"egrave;": "è",
"egrave": "è",
"egs;": "⪖",
"egsdot;": "⪘",
"el;": "⪙",
"Element;": "∈",
"elinters;": "⏧",
"ell;": "ℓ",
"els;": "⪕",
"elsdot;": "⪗",
"Emacr;": "Ē",
"emacr;": "ē",
"empty;": "∅",
"emptyset;": "∅",
"EmptySmallSquare;": "◻",
"emptyv;": "∅",
"EmptyVerySmallSquare;": "▫",
"emsp;": " ",
"emsp13;": " ",
"emsp14;": " ",
"ENG;": "Ŋ",
"eng;": "ŋ",
"ensp;": " ",
"Eogon;": "Ę",
"eogon;": "ę",
"Eopf;": "𝔼",
"eopf;": "𝕖",
"epar;": "⋕",
"eparsl;": "⧣",
"eplus;": "⩱",
"epsi;": "ε",
"Epsilon;": "Ε",
"epsilon;": "ε",
"epsiv;": "ϵ",
"eqcirc;": "≖",
"eqcolon;": "≕",
"eqsim;": "≂",
"eqslantgtr;": "⪖",
"eqslantless;": "⪕",
"Equal;": "⩵",
"equals;": "=",
"EqualTilde;": "≂",
"equest;": "≟",
"Equilibrium;": "⇌",
"equiv;": "≡",
"equivDD;": "⩸",
"eqvparsl;": "⧥",
"erarr;": "⥱",
"erDot;": "≓",
"Escr;": "ℰ",
"escr;": "ℯ",
"esdot;": "≐",
"Esim;": "⩳",
"esim;": "≂",
"Eta;": "Η",
"eta;": "η",
"ETH;": "Ð",
"ETH": "Ð",
"eth;": "ð",
"eth": "ð",
"Euml;": "Ë",
"Euml": "Ë",
"euml;": "ë",
"euml": "ë",
"euro;": "€",
"excl;": "!",
"exist;": "∃",
"Exists;": "∃",
"expectation;": "ℰ",
"ExponentialE;": "ⅇ",
"exponentiale;": "ⅇ",
"fallingdotseq;": "≒",
"Fcy;": "Ф",
"fcy;": "ф",
"female;": "♀",
"ffilig;": "ffi",
"fflig;": "ff",
"ffllig;": "ffl",
"Ffr;": "𝔉",
"ffr;": "𝔣",
"filig;": "fi",
"FilledSmallSquare;": "◼",
"FilledVerySmallSquare;": "▪",
"fjlig;": "fj",
"flat;": "♭",
"fllig;": "fl",
"fltns;": "▱",
"fnof;": "ƒ",
"Fopf;": "𝔽",
"fopf;": "𝕗",
"ForAll;": "∀",
"forall;": "∀",
"fork;": "⋔",
"forkv;": "⫙",
"Fouriertrf;": "ℱ",
"fpartint;": "⨍",
"frac12;": "½",
"frac12": "½",
"frac13;": "⅓",
"frac14;": "¼",
"frac14": "¼",
"frac15;": "⅕",
"frac16;": "⅙",
"frac18;": "⅛",
"frac23;": "⅔",
"frac25;": "⅖",
"frac34;": "¾",
"frac34": "¾",
"frac35;": "⅗",
"frac38;": "⅜",
"frac45;": "⅘",
"frac56;": "⅚",
"frac58;": "⅝",
"frac78;": "⅞",
"frasl;": "⁄",
"frown;": "⌢",
"Fscr;": "ℱ",
"fscr;": "𝒻",
"gacute;": "ǵ",
"Gamma;": "Γ",
"gamma;": "γ",
"Gammad;": "Ϝ",
"gammad;": "ϝ",
"gap;": "⪆",
"Gbreve;": "Ğ",
"gbreve;": "ğ",
"Gcedil;": "Ģ",
"Gcirc;": "Ĝ",
"gcirc;": "ĝ",
"Gcy;": "Г",
"gcy;": "г",
"Gdot;": "Ġ",
"gdot;": "ġ",
"gE;": "≧",
"ge;": "≥",
"gEl;": "⪌",
"gel;": "⋛",
"geq;": "≥",
"geqq;": "≧",
"geqslant;": "⩾",
"ges;": "⩾",
"gescc;": "⪩",
"gesdot;": "⪀",
"gesdoto;": "⪂",
"gesdotol;": "⪄",
"gesl;": "⋛︀",
"gesles;": "⪔",
"Gfr;": "𝔊",
"gfr;": "𝔤",
"Gg;": "⋙",
"gg;": "≫",
"ggg;": "⋙",
"gimel;": "ℷ",
"GJcy;": "Ѓ",
"gjcy;": "ѓ",
"gl;": "≷",
"gla;": "⪥",
"glE;": "⪒",
"glj;": "⪤",
"gnap;": "⪊",
"gnapprox;": "⪊",
"gnE;": "≩",
"gne;": "⪈",
"gneq;": "⪈",
"gneqq;": "≩",
"gnsim;": "⋧",
"Gopf;": "𝔾",
"gopf;": "𝕘",
"grave;": "`",
"GreaterEqual;": "≥",
"GreaterEqualLess;": "⋛",
"GreaterFullEqual;": "≧",
"GreaterGreater;": "⪢",
"GreaterLess;": "≷",
"GreaterSlantEqual;": "⩾",
"GreaterTilde;": "≳",
"Gscr;": "𝒢",
"gscr;": "ℊ",
"gsim;": "≳",
"gsime;": "⪎",
"gsiml;": "⪐",
"GT;": ">",
"GT": ">",
"Gt;": "≫",
"gt;": ">",
"gt": ">",
"gtcc;": "⪧",
"gtcir;": "⩺",
"gtdot;": "⋗",
"gtlPar;": "⦕",
"gtquest;": "⩼",
"gtrapprox;": "⪆",
"gtrarr;": "⥸",
"gtrdot;": "⋗",
"gtreqless;": "⋛",
"gtreqqless;": "⪌",
"gtrless;": "≷",
"gtrsim;": "≳",
"gvertneqq;": "≩︀",
"gvnE;": "≩︀",
"Hacek;": "ˇ",
"hairsp;": " ",
"half;": "½",
"hamilt;": "ℋ",
"HARDcy;": "Ъ",
"hardcy;": "ъ",
"hArr;": "⇔",
"harr;": "↔",
"harrcir;": "⥈",
"harrw;": "↭",
"Hat;": "^",
"hbar;": "ℏ",
"Hcirc;": "Ĥ",
"hcirc;": "ĥ",
"hearts;": "♥",
"heartsuit;": "♥",
"hellip;": "…",
"hercon;": "⊹",
"Hfr;": "ℌ",
"hfr;": "𝔥",
"HilbertSpace;": "ℋ",
"hksearow;": "⤥",
"hkswarow;": "⤦",
"hoarr;": "⇿",
"homtht;": "∻",
"hookleftarrow;": "↩",
"hookrightarrow;": "↪",
"Hopf;": "ℍ",
"hopf;": "𝕙",
"horbar;": "―",
"HorizontalLine;": "─",
"Hscr;": "ℋ",
"hscr;": "𝒽",
"hslash;": "ℏ",
"Hstrok;": "Ħ",
"hstrok;": "ħ",
"HumpDownHump;": "≎",
"HumpEqual;": "≏",
"hybull;": "⁃",
"hyphen;": "‐",
"Iacute;": "Í",
"Iacute": "Í",
"iacute;": "í",
"iacute": "í",
"ic;": "",
"Icirc;": "Î",
"Icirc": "Î",
"icirc;": "î",
"icirc": "î",
"Icy;": "И",
"icy;": "и",
"Idot;": "İ",
"IEcy;": "Е",
"iecy;": "е",
"iexcl;": "¡",
"iexcl": "¡",
"iff;": "⇔",
"Ifr;": "ℑ",
"ifr;": "𝔦",
"Igrave;": "Ì",
"Igrave": "Ì",
"igrave;": "ì",
"igrave": "ì",
"ii;": "ⅈ",
"iiiint;": "⨌",
"iiint;": "∭",
"iinfin;": "⧜",
"iiota;": "℩",
"IJlig;": "IJ",
"ijlig;": "ij",
"Im;": "ℑ",
"Imacr;": "Ī",
"imacr;": "ī",
"image;": "ℑ",
"ImaginaryI;": "ⅈ",
"imagline;": "ℐ",
"imagpart;": "ℑ",
"imath;": "ı",
"imof;": "⊷",
"imped;": "Ƶ",
"Implies;": "⇒",
"in;": "∈",
"incare;": "℅",
"infin;": "∞",
"infintie;": "⧝",
"inodot;": "ı",
"Int;": "∬",
"int;": "∫",
"intcal;": "⊺",
"integers;": "ℤ",
"Integral;": "∫",
"intercal;": "⊺",
"Intersection;": "⋂",
"intlarhk;": "⨗",
"intprod;": "⨼",
"InvisibleComma;": "",
"InvisibleTimes;": "",
"IOcy;": "Ё",
"iocy;": "ё",
"Iogon;": "Į",
"iogon;": "į",
"Iopf;": "𝕀",
"iopf;": "𝕚",
"Iota;": "Ι",
"iota;": "ι",
"iprod;": "⨼",
"iquest;": "¿",
"iquest": "¿",
"Iscr;": "ℐ",
"iscr;": "𝒾",
"isin;": "∈",
"isindot;": "⋵",
"isinE;": "⋹",
"isins;": "⋴",
"isinsv;": "⋳",
"isinv;": "∈",
"it;": "",
"Itilde;": "Ĩ",
"itilde;": "ĩ",
"Iukcy;": "І",
"iukcy;": "і",
"Iuml;": "Ï",
"Iuml": "Ï",
"iuml;": "ï",
"iuml": "ï",
"Jcirc;": "Ĵ",
"jcirc;": "ĵ",
"Jcy;": "Й",
"jcy;": "й",
"Jfr;": "𝔍",
"jfr;": "𝔧",
"jmath;": "ȷ",
"Jopf;": "𝕁",
"jopf;": "𝕛",
"Jscr;": "𝒥",
"jscr;": "𝒿",
"Jsercy;": "Ј",
"jsercy;": "ј",
"Jukcy;": "Є",
"jukcy;": "є",
"Kappa;": "Κ",
"kappa;": "κ",
"kappav;": "ϰ",
"Kcedil;": "Ķ",
"kcedil;": "ķ",
"Kcy;": "К",
"kcy;": "к",
"Kfr;": "𝔎",
"kfr;": "𝔨",
"kgreen;": "ĸ",
"KHcy;": "Х",
"khcy;": "х",
"KJcy;": "Ќ",
"kjcy;": "ќ",
"Kopf;": "𝕂",
"kopf;": "𝕜",
"Kscr;": "𝒦",
"kscr;": "𝓀",
"lAarr;": "⇚",
"Lacute;": "Ĺ",
"lacute;": "ĺ",
"laemptyv;": "⦴",
"lagran;": "ℒ",
"Lambda;": "Λ",
"lambda;": "λ",
"Lang;": "⟪",
"lang;": "⟨",
"langd;": "⦑",
"langle;": "⟨",
"lap;": "⪅",
"Laplacetrf;": "ℒ",
"laquo;": "«",
"laquo": "«",
"Larr;": "↞",
"lArr;": "⇐",
"larr;": "←",
"larrb;": "⇤",
"larrbfs;": "⤟",
"larrfs;": "⤝",
"larrhk;": "↩",
"larrlp;": "↫",
"larrpl;": "⤹",
"larrsim;": "⥳",
"larrtl;": "↢",
"lat;": "⪫",
"lAtail;": "⤛",
"latail;": "⤙",
"late;": "⪭",
"lates;": "⪭︀",
"lBarr;": "⤎",
"lbarr;": "⤌",
"lbbrk;": "❲",
"lbrace;": "{",
"lbrack;": "[",
"lbrke;": "⦋",
"lbrksld;": "⦏",
"lbrkslu;": "⦍",
"Lcaron;": "Ľ",
"lcaron;": "ľ",
"Lcedil;": "Ļ",
"lcedil;": "ļ",
"lceil;": "⌈",
"lcub;": "{",
"Lcy;": "Л",
"lcy;": "л",
"ldca;": "⤶",
"ldquo;": "“",
"ldquor;": "„",
"ldrdhar;": "⥧",
"ldrushar;": "⥋",
"ldsh;": "↲",
"lE;": "≦",
"le;": "≤",
"LeftAngleBracket;": "⟨",
"LeftArrow;": "←",
"Leftarrow;": "⇐",
"leftarrow;": "←",
"LeftArrowBar;": "⇤",
"LeftArrowRightArrow;": "⇆",
"leftarrowtail;": "↢",
"LeftCeiling;": "⌈",
"LeftDoubleBracket;": "⟦",
"LeftDownTeeVector;": "⥡",
"LeftDownVector;": "⇃",
"LeftDownVectorBar;": "⥙",
"LeftFloor;": "⌊",
"leftharpoondown;": "↽",
"leftharpoonup;": "↼",
"leftleftarrows;": "⇇",
"LeftRightArrow;": "↔",
"Leftrightarrow;": "⇔",
"leftrightarrow;": "↔",
"leftrightarrows;": "⇆",
"leftrightharpoons;": "⇋",
"leftrightsquigarrow;": "↭",
"LeftRightVector;": "⥎",
"LeftTee;": "⊣",
"LeftTeeArrow;": "↤",
"LeftTeeVector;": "⥚",
"leftthreetimes;": "⋋",
"LeftTriangle;": "⊲",
"LeftTriangleBar;": "⧏",
"LeftTriangleEqual;": "⊴",
"LeftUpDownVector;": "⥑",
"LeftUpTeeVector;": "⥠",
"LeftUpVector;": "↿",
"LeftUpVectorBar;": "⥘",
"LeftVector;": "↼",
"LeftVectorBar;": "⥒",
"lEg;": "⪋",
"leg;": "⋚",
"leq;": "≤",
"leqq;": "≦",
"leqslant;": "⩽",
"les;": "⩽",
"lescc;": "⪨",
"lesdot;": "⩿",
"lesdoto;": "⪁",
"lesdotor;": "⪃",
"lesg;": "⋚︀",
"lesges;": "⪓",
"lessapprox;": "⪅",
"lessdot;": "⋖",
"lesseqgtr;": "⋚",
"lesseqqgtr;": "⪋",
"LessEqualGreater;": "⋚",
"LessFullEqual;": "≦",
"LessGreater;": "≶",
"lessgtr;": "≶",
"LessLess;": "⪡",
"lesssim;": "≲",
"LessSlantEqual;": "⩽",
"LessTilde;": "≲",
"lfisht;": "⥼",
"lfloor;": "⌊",
"Lfr;": "𝔏",
"lfr;": "𝔩",
"lg;": "≶",
"lgE;": "⪑",
"lHar;": "⥢",
"lhard;": "↽",
"lharu;": "↼",
"lharul;": "⥪",
"lhblk;": "▄",
"LJcy;": "Љ",
"ljcy;": "љ",
"Ll;": "⋘",
"ll;": "≪",
"llarr;": "⇇",
"llcorner;": "⌞",
"Lleftarrow;": "⇚",
"llhard;": "⥫",
"lltri;": "◺",
"Lmidot;": "Ŀ",
"lmidot;": "ŀ",
"lmoust;": "⎰",
"lmoustache;": "⎰",
"lnap;": "⪉",
"lnapprox;": "⪉",
"lnE;": "≨",
"lne;": "⪇",
"lneq;": "⪇",
"lneqq;": "≨",
"lnsim;": "⋦",
"loang;": "⟬",
"loarr;": "⇽",
"lobrk;": "⟦",
"LongLeftArrow;": "⟵",
"Longleftarrow;": "⟸",
"longleftarrow;": "⟵",
"LongLeftRightArrow;": "⟷",
"Longleftrightarrow;": "⟺",
"longleftrightarrow;": "⟷",
"longmapsto;": "⟼",
"LongRightArrow;": "⟶",
"Longrightarrow;": "⟹",
"longrightarrow;": "⟶",
"looparrowleft;": "↫",
"looparrowright;": "↬",
"lopar;": "⦅",
"Lopf;": "𝕃",
"lopf;": "𝕝",
"loplus;": "⨭",
"lotimes;": "⨴",
"lowast;": "∗",
"lowbar;": "_",
"LowerLeftArrow;": "↙",
"LowerRightArrow;": "↘",
"loz;": "◊",
"lozenge;": "◊",
"lozf;": "⧫",
"lpar;": "(",
"lparlt;": "⦓",
"lrarr;": "⇆",
"lrcorner;": "⌟",
"lrhar;": "⇋",
"lrhard;": "⥭",
"lrm;": "",
"lrtri;": "⊿",
"lsaquo;": "‹",
"Lscr;": "ℒ",
"lscr;": "𝓁",
"Lsh;": "↰",
"lsh;": "↰",
"lsim;": "≲",
"lsime;": "⪍",
"lsimg;": "⪏",
"lsqb;": "[",
"lsquo;": "‘",
"lsquor;": "‚",
"Lstrok;": "Ł",
"lstrok;": "ł",
"LT;": "<",
"LT": "<",
"Lt;": "≪",
"lt;": "<",
"lt": "<",
"ltcc;": "⪦",
"ltcir;": "⩹",
"ltdot;": "⋖",
"lthree;": "⋋",
"ltimes;": "⋉",
"ltlarr;": "⥶",
"ltquest;": "⩻",
"ltri;": "◃",
"ltrie;": "⊴",
"ltrif;": "◂",
"ltrPar;": "⦖",
"lurdshar;": "⥊",
"luruhar;": "⥦",
"lvertneqq;": "≨︀",
"lvnE;": "≨︀",
"macr;": "¯",
"macr": "¯",
"male;": "♂",
"malt;": "✠",
"maltese;": "✠",
"Map;": "⤅",
"map;": "↦",
"mapsto;": "↦",
"mapstodown;": "↧",
"mapstoleft;": "↤",
"mapstoup;": "↥",
"marker;": "▮",
"mcomma;": "⨩",
"Mcy;": "М",
"mcy;": "м",
"mdash;": "—",
"mDDot;": "∺",
"measuredangle;": "∡",
"MediumSpace;": " ",
"Mellintrf;": "ℳ",
"Mfr;": "𝔐",
"mfr;": "𝔪",
"mho;": "℧",
"micro;": "µ",
"micro": "µ",
"mid;": "∣",
"midast;": "*",
"midcir;": "⫰",
"middot;": "·",
"middot": "·",
"minus;": "−",
"minusb;": "⊟",
"minusd;": "∸",
"minusdu;": "⨪",
"MinusPlus;": "∓",
"mlcp;": "⫛",
"mldr;": "…",
"mnplus;": "∓",
"models;": "⊧",
"Mopf;": "𝕄",
"mopf;": "𝕞",
"mp;": "∓",
"Mscr;": "ℳ",
"mscr;": "𝓂",
"mstpos;": "∾",
"Mu;": "Μ",
"mu;": "μ",
"multimap;": "⊸",
"mumap;": "⊸",
"nabla;": "∇",
"Nacute;": "Ń",
"nacute;": "ń",
"nang;": "∠⃒",
"nap;": "≉",
"napE;": "⩰̸",
"napid;": "≋̸",
"napos;": "ʼn",
"napprox;": "≉",
"natur;": "♮",
"natural;": "♮",
"naturals;": "ℕ",
"nbsp;": " ",
"nbsp": " ",
"nbump;": "≎̸",
"nbumpe;": "≏̸",
"ncap;": "⩃",
"Ncaron;": "Ň",
"ncaron;": "ň",
"Ncedil;": "Ņ",
"ncedil;": "ņ",
"ncong;": "≇",
"ncongdot;": "⩭̸",
"ncup;": "⩂",
"Ncy;": "Н",
"ncy;": "н",
"ndash;": "–",
"ne;": "≠",
"nearhk;": "⤤",
"neArr;": "⇗",
"nearr;": "↗",
"nearrow;": "↗",
"nedot;": "≐̸",
"NegativeMediumSpace;": "",
"NegativeThickSpace;": "",
"NegativeThinSpace;": "",
"NegativeVeryThinSpace;": "",
"nequiv;": "≢",
"nesear;": "⤨",
"nesim;": "≂̸",
"NestedGreaterGreater;": "≫",
"NestedLessLess;": "≪",
"NewLine;": "\n",
"nexist;": "∄",
"nexists;": "∄",
"Nfr;": "𝔑",
"nfr;": "𝔫",
"ngE;": "≧̸",
"nge;": "≱",
"ngeq;": "≱",
"ngeqq;": "≧̸",
"ngeqslant;": "⩾̸",
"nges;": "⩾̸",
"nGg;": "⋙̸",
"ngsim;": "≵",
"nGt;": "≫⃒",
"ngt;": "≯",
"ngtr;": "≯",
"nGtv;": "≫̸",
"nhArr;": "⇎",
"nharr;": "↮",
"nhpar;": "⫲",
"ni;": "∋",
"nis;": "⋼",
"nisd;": "⋺",
"niv;": "∋",
"NJcy;": "Њ",
"njcy;": "њ",
"nlArr;": "⇍",
"nlarr;": "↚",
"nldr;": "‥",
"nlE;": "≦̸",
"nle;": "≰",
"nLeftarrow;": "⇍",
"nleftarrow;": "↚",
"nLeftrightarrow;": "⇎",
"nleftrightarrow;": "↮",
"nleq;": "≰",
"nleqq;": "≦̸",
"nleqslant;": "⩽̸",
"nles;": "⩽̸",
"nless;": "≮",
"nLl;": "⋘̸",
"nlsim;": "≴",
"nLt;": "≪⃒",
"nlt;": "≮",
"nltri;": "⋪",
"nltrie;": "⋬",
"nLtv;": "≪̸",
"nmid;": "∤",
"NoBreak;": "",
"NonBreakingSpace;": " ",
"Nopf;": "ℕ",
"nopf;": "𝕟",
"Not;": "⫬",
"not;": "¬",
"not": "¬",
"NotCongruent;": "≢",
"NotCupCap;": "≭",
"NotDoubleVerticalBar;": "∦",
"NotElement;": "∉",
"NotEqual;": "≠",
"NotEqualTilde;": "≂̸",
"NotExists;": "∄",
"NotGreater;": "≯",
"NotGreaterEqual;": "≱",
"NotGreaterFullEqual;": "≧̸",
"NotGreaterGreater;": "≫̸",
"NotGreaterLess;": "≹",
"NotGreaterSlantEqual;": "⩾̸",
"NotGreaterTilde;": "≵",
"NotHumpDownHump;": "≎̸",
"NotHumpEqual;": "≏̸",
"notin;": "∉",
"notindot;": "⋵̸",
"notinE;": "⋹̸",
"notinva;": "∉",
"notinvb;": "⋷",
"notinvc;": "⋶",
"NotLeftTriangle;": "⋪",
"NotLeftTriangleBar;": "⧏̸",
"NotLeftTriangleEqual;": "⋬",
"NotLess;": "≮",
"NotLessEqual;": "≰",
"NotLessGreater;": "≸",
"NotLessLess;": "≪̸",
"NotLessSlantEqual;": "⩽̸",
"NotLessTilde;": "≴",
"NotNestedGreaterGreater;": "⪢̸",
"NotNestedLessLess;": "⪡̸",
"notni;": "∌",
"notniva;": "∌",
"notnivb;": "⋾",
"notnivc;": "⋽",
"NotPrecedes;": "⊀",
"NotPrecedesEqual;": "⪯̸",
"NotPrecedesSlantEqual;": "⋠",
"NotReverseElement;": "∌",
"NotRightTriangle;": "⋫",
"NotRightTriangleBar;": "⧐̸",
"NotRightTriangleEqual;": "⋭",
"NotSquareSubset;": "⊏̸",
"NotSquareSubsetEqual;": "⋢",
"NotSquareSuperset;": "⊐̸",
"NotSquareSupersetEqual;": "⋣",
"NotSubset;": "⊂⃒",
"NotSubsetEqual;": "⊈",
"NotSucceeds;": "⊁",
"NotSucceedsEqual;": "⪰̸",
"NotSucceedsSlantEqual;": "⋡",
"NotSucceedsTilde;": "≿̸",
"NotSuperset;": "⊃⃒",
"NotSupersetEqual;": "⊉",
"NotTilde;": "≁",
"NotTildeEqual;": "≄",
"NotTildeFullEqual;": "≇",
"NotTildeTilde;": "≉",
"NotVerticalBar;": "∤",
"npar;": "∦",
"nparallel;": "∦",
"nparsl;": "⫽⃥",
"npart;": "∂̸",
"npolint;": "⨔",
"npr;": "⊀",
"nprcue;": "⋠",
"npre;": "⪯̸",
"nprec;": "⊀",
"npreceq;": "⪯̸",
"nrArr;": "⇏",
"nrarr;": "↛",
"nrarrc;": "⤳̸",
"nrarrw;": "↝̸",
"nRightarrow;": "⇏",
"nrightarrow;": "↛",
"nrtri;": "⋫",
"nrtrie;": "⋭",
"nsc;": "⊁",
"nsccue;": "⋡",
"nsce;": "⪰̸",
"Nscr;": "𝒩",
"nscr;": "𝓃",
"nshortmid;": "∤",
"nshortparallel;": "∦",
"nsim;": "≁",
"nsime;": "≄",
"nsimeq;": "≄",
"nsmid;": "∤",
"nspar;": "∦",
"nsqsube;": "⋢",
"nsqsupe;": "⋣",
"nsub;": "⊄",
"nsubE;": "⫅̸",
"nsube;": "⊈",
"nsubset;": "⊂⃒",
"nsubseteq;": "⊈",
"nsubseteqq;": "⫅̸",
"nsucc;": "⊁",
"nsucceq;": "⪰̸",
"nsup;": "⊅",
"nsupE;": "⫆̸",
"nsupe;": "⊉",
"nsupset;": "⊃⃒",
"nsupseteq;": "⊉",
"nsupseteqq;": "⫆̸",
"ntgl;": "≹",
"Ntilde;": "Ñ",
"Ntilde": "Ñ",
"ntilde;": "ñ",
"ntilde": "ñ",
"ntlg;": "≸",
"ntriangleleft;": "⋪",
"ntrianglelefteq;": "⋬",
"ntriangleright;": "⋫",
"ntrianglerighteq;": "⋭",
"Nu;": "Ν",
"nu;": "ν",
"num;": "#",
"numero;": "№",
"numsp;": " ",
"nvap;": "≍⃒",
"nVDash;": "⊯",
"nVdash;": "⊮",
"nvDash;": "⊭",
"nvdash;": "⊬",
"nvge;": "≥⃒",
"nvgt;": ">⃒",
"nvHarr;": "⤄",
"nvinfin;": "⧞",
"nvlArr;": "⤂",
"nvle;": "≤⃒",
"nvlt;": "<⃒",
"nvltrie;": "⊴⃒",
"nvrArr;": "⤃",
"nvrtrie;": "⊵⃒",
"nvsim;": "∼⃒",
"nwarhk;": "⤣",
"nwArr;": "⇖",
"nwarr;": "↖",
"nwarrow;": "↖",
"nwnear;": "⤧",
"Oacute;": "Ó",
"Oacute": "Ó",
"oacute;": "ó",
"oacute": "ó",
"oast;": "⊛",
"ocir;": "⊚",
"Ocirc;": "Ô",
"Ocirc": "Ô",
"ocirc;": "ô",
"ocirc": "ô",
"Ocy;": "О",
"ocy;": "о",
"odash;": "⊝",
"Odblac;": "Ő",
"odblac;": "ő",
"odiv;": "⨸",
"odot;": "⊙",
"odsold;": "⦼",
"OElig;": "Œ",
"oelig;": "œ",
"ofcir;": "⦿",
"Ofr;": "𝔒",
"ofr;": "𝔬",
"ogon;": "˛",
"Ograve;": "Ò",
"Ograve": "Ò",
"ograve;": "ò",
"ograve": "ò",
"ogt;": "⧁",
"ohbar;": "⦵",
"ohm;": "Ω",
"oint;": "∮",
"olarr;": "↺",
"olcir;": "⦾",
"olcross;": "⦻",
"oline;": "‾",
"olt;": "⧀",
"Omacr;": "Ō",
"omacr;": "ō",
"Omega;": "Ω",
"omega;": "ω",
"Omicron;": "Ο",
"omicron;": "ο",
"omid;": "⦶",
"ominus;": "⊖",
"Oopf;": "𝕆",
"oopf;": "𝕠",
"opar;": "⦷",
"OpenCurlyDoubleQuote;": "“",
"OpenCurlyQuote;": "‘",
"operp;": "⦹",
"oplus;": "⊕",
"Or;": "⩔",
"or;": "∨",
"orarr;": "↻",
"ord;": "⩝",
"order;": "ℴ",
"orderof;": "ℴ",
"ordf;": "ª",
"ordf": "ª",
"ordm;": "º",
"ordm": "º",
"origof;": "⊶",
"oror;": "⩖",
"orslope;": "⩗",
"orv;": "⩛",
"oS;": "Ⓢ",
"Oscr;": "𝒪",
"oscr;": "ℴ",
"Oslash;": "Ø",
"Oslash": "Ø",
"oslash;": "ø",
"oslash": "ø",
"osol;": "⊘",
"Otilde;": "Õ",
"Otilde": "Õ",
"otilde;": "õ",
"otilde": "õ",
"Otimes;": "⨷",
"otimes;": "⊗",
"otimesas;": "⨶",
"Ouml;": "Ö",
"Ouml": "Ö",
"ouml;": "ö",
"ouml": "ö",
"ovbar;": "⌽",
"OverBar;": "‾",
"OverBrace;": "⏞",
"OverBracket;": "⎴",
"OverParenthesis;": "⏜",
"par;": "∥",
"para;": "¶",
"para": "¶",
"parallel;": "∥",
"parsim;": "⫳",
"parsl;": "⫽",
"part;": "∂",
"PartialD;": "∂",
"Pcy;": "П",
"pcy;": "п",
"percnt;": "%",
"period;": ".",
"permil;": "‰",
"perp;": "⊥",
"pertenk;": "‱",
"Pfr;": "𝔓",
"pfr;": "𝔭",
"Phi;": "Φ",
"phi;": "φ",
"phiv;": "ϕ",
"phmmat;": "ℳ",
"phone;": "☎",
"Pi;": "Π",
"pi;": "π",
"pitchfork;": "⋔",
"piv;": "ϖ",
"planck;": "ℏ",
"planckh;": "ℎ",
"plankv;": "ℏ",
"plus;": "+",
"plusacir;": "⨣",
"plusb;": "⊞",
"pluscir;": "⨢",
"plusdo;": "∔",
"plusdu;": "⨥",
"pluse;": "⩲",
"PlusMinus;": "±",
"plusmn;": "±",
"plusmn": "±",
"plussim;": "⨦",
"plustwo;": "⨧",
"pm;": "±",
"Poincareplane;": "ℌ",
"pointint;": "⨕",
"Popf;": "ℙ",
"popf;": "𝕡",
"pound;": "£",
"pound": "£",
"Pr;": "⪻",
"pr;": "≺",
"prap;": "⪷",
"prcue;": "≼",
"prE;": "⪳",
"pre;": "⪯",
"prec;": "≺",
"precapprox;": "⪷",
"preccurlyeq;": "≼",
"Precedes;": "≺",
"PrecedesEqual;": "⪯",
"PrecedesSlantEqual;": "≼",
"PrecedesTilde;": "≾",
"preceq;": "⪯",
"precnapprox;": "⪹",
"precneqq;": "⪵",
"precnsim;": "⋨",
"precsim;": "≾",
"Prime;": "″",
"prime;": "′",
"primes;": "ℙ",
"prnap;": "⪹",
"prnE;": "⪵",
"prnsim;": "⋨",
"prod;": "∏",
"Product;": "∏",
"profalar;": "⌮",
"profline;": "⌒",
"profsurf;": "⌓",
"prop;": "∝",
"Proportion;": "∷",
"Proportional;": "∝",
"propto;": "∝",
"prsim;": "≾",
"prurel;": "⊰",
"Pscr;": "𝒫",
"pscr;": "𝓅",
"Psi;": "Ψ",
"psi;": "ψ",
"puncsp;": " ",
"Qfr;": "𝔔",
"qfr;": "𝔮",
"qint;": "⨌",
"Qopf;": "ℚ",
"qopf;": "𝕢",
"qprime;": "⁗",
"Qscr;": "𝒬",
"qscr;": "𝓆",
"quaternions;": "ℍ",
"quatint;": "⨖",
"quest;": "?",
"questeq;": "≟",
"QUOT;": "\"",
"QUOT": "\"",
"quot;": "\"",
"quot": "\"",
"rAarr;": "⇛",
"race;": "∽̱",
"Racute;": "Ŕ",
"racute;": "ŕ",
"radic;": "√",
"raemptyv;": "⦳",
"Rang;": "⟫",
"rang;": "⟩",
"rangd;": "⦒",
"range;": "⦥",
"rangle;": "⟩",
"raquo;": "»",
"raquo": "»",
"Rarr;": "↠",
"rArr;": "⇒",
"rarr;": "→",
"rarrap;": "⥵",
"rarrb;": "⇥",
"rarrbfs;": "⤠",
"rarrc;": "⤳",
"rarrfs;": "⤞",
"rarrhk;": "↪",
"rarrlp;": "↬",
"rarrpl;": "⥅",
"rarrsim;": "⥴",
"Rarrtl;": "⤖",
"rarrtl;": "↣",
"rarrw;": "↝",
"rAtail;": "⤜",
"ratail;": "⤚",
"ratio;": "∶",
"rationals;": "ℚ",
"RBarr;": "⤐",
"rBarr;": "⤏",
"rbarr;": "⤍",
"rbbrk;": "❳",
"rbrace;": "}",
"rbrack;": "]",
"rbrke;": "⦌",
"rbrksld;": "⦎",
"rbrkslu;": "⦐",
"Rcaron;": "Ř",
"rcaron;": "ř",
"Rcedil;": "Ŗ",
"rcedil;": "ŗ",
"rceil;": "⌉",
"rcub;": "}",
"Rcy;": "Р",
"rcy;": "р",
"rdca;": "⤷",
"rdldhar;": "⥩",
"rdquo;": "”",
"rdquor;": "”",
"rdsh;": "↳",
"Re;": "ℜ",
"real;": "ℜ",
"realine;": "ℛ",
"realpart;": "ℜ",
"reals;": "ℝ",
"rect;": "▭",
"REG;": "®",
"REG": "®",
"reg;": "®",
"reg": "®",
"ReverseElement;": "∋",
"ReverseEquilibrium;": "⇋",
"ReverseUpEquilibrium;": "⥯",
"rfisht;": "⥽",
"rfloor;": "⌋",
"Rfr;": "ℜ",
"rfr;": "𝔯",
"rHar;": "⥤",
"rhard;": "⇁",
"rharu;": "⇀",
"rharul;": "⥬",
"Rho;": "Ρ",
"rho;": "ρ",
"rhov;": "ϱ",
"RightAngleBracket;": "⟩",
"RightArrow;": "→",
"Rightarrow;": "⇒",
"rightarrow;": "→",
"RightArrowBar;": "⇥",
"RightArrowLeftArrow;": "⇄",
"rightarrowtail;": "↣",
"RightCeiling;": "⌉",
"RightDoubleBracket;": "⟧",
"RightDownTeeVector;": "⥝",
"RightDownVector;": "⇂",
"RightDownVectorBar;": "⥕",
"RightFloor;": "⌋",
"rightharpoondown;": "⇁",
"rightharpoonup;": "⇀",
"rightleftarrows;": "⇄",
"rightleftharpoons;": "⇌",
"rightrightarrows;": "⇉",
"rightsquigarrow;": "↝",
"RightTee;": "⊢",
"RightTeeArrow;": "↦",
"RightTeeVector;": "⥛",
"rightthreetimes;": "⋌",
"RightTriangle;": "⊳",
"RightTriangleBar;": "⧐",
"RightTriangleEqual;": "⊵",
"RightUpDownVector;": "⥏",
"RightUpTeeVector;": "⥜",
"RightUpVector;": "↾",
"RightUpVectorBar;": "⥔",
"RightVector;": "⇀",
"RightVectorBar;": "⥓",
"ring;": "˚",
"risingdotseq;": "≓",
"rlarr;": "⇄",
"rlhar;": "⇌",
"rlm;": "",
"rmoust;": "⎱",
"rmoustache;": "⎱",
"rnmid;": "⫮",
"roang;": "⟭",
"roarr;": "⇾",
"robrk;": "⟧",
"ropar;": "⦆",
"Ropf;": "ℝ",
"ropf;": "𝕣",
"roplus;": "⨮",
"rotimes;": "⨵",
"RoundImplies;": "⥰",
"rpar;": ")",
"rpargt;": "⦔",
"rppolint;": "⨒",
"rrarr;": "⇉",
"Rrightarrow;": "⇛",
"rsaquo;": "›",
"Rscr;": "ℛ",
"rscr;": "𝓇",
"Rsh;": "↱",
"rsh;": "↱",
"rsqb;": "]",
"rsquo;": "’",
"rsquor;": "’",
"rthree;": "⋌",
"rtimes;": "⋊",
"rtri;": "▹",
"rtrie;": "⊵",
"rtrif;": "▸",
"rtriltri;": "⧎",
"RuleDelayed;": "⧴",
"ruluhar;": "⥨",
"rx;": "℞",
"Sacute;": "Ś",
"sacute;": "ś",
"sbquo;": "‚",
"Sc;": "⪼",
"sc;": "≻",
"scap;": "⪸",
"Scaron;": "Š",
"scaron;": "š",
"sccue;": "≽",
"scE;": "⪴",
"sce;": "⪰",
"Scedil;": "Ş",
"scedil;": "ş",
"Scirc;": "Ŝ",
"scirc;": "ŝ",
"scnap;": "⪺",
"scnE;": "⪶",
"scnsim;": "⋩",
"scpolint;": "⨓",
"scsim;": "≿",
"Scy;": "С",
"scy;": "с",
"sdot;": "⋅",
"sdotb;": "⊡",
"sdote;": "⩦",
"searhk;": "⤥",
"seArr;": "⇘",
"searr;": "↘",
"searrow;": "↘",
"sect;": "§",
"sect": "§",
"semi;": ";",
"seswar;": "⤩",
"setminus;": "∖",
"setmn;": "∖",
"sext;": "✶",
"Sfr;": "𝔖",
"sfr;": "𝔰",
"sfrown;": "⌢",
"sharp;": "♯",
"SHCHcy;": "Щ",
"shchcy;": "щ",
"SHcy;": "Ш",
"shcy;": "ш",
"ShortDownArrow;": "↓",
"ShortLeftArrow;": "←",
"shortmid;": "∣",
"shortparallel;": "∥",
"ShortRightArrow;": "→",
"ShortUpArrow;": "↑",
"shy;": "",
"shy": "",
"Sigma;": "Σ",
"sigma;": "σ",
"sigmaf;": "ς",
"sigmav;": "ς",
"sim;": "∼",
"simdot;": "⩪",
"sime;": "≃",
"simeq;": "≃",
"simg;": "⪞",
"simgE;": "⪠",
"siml;": "⪝",
"simlE;": "⪟",
"simne;": "≆",
"simplus;": "⨤",
"simrarr;": "⥲",
"slarr;": "←",
"SmallCircle;": "∘",
"smallsetminus;": "∖",
"smashp;": "⨳",
"smeparsl;": "⧤",
"smid;": "∣",
"smile;": "⌣",
"smt;": "⪪",
"smte;": "⪬",
"smtes;": "⪬︀",
"SOFTcy;": "Ь",
"softcy;": "ь",
"sol;": "/",
"solb;": "⧄",
"solbar;": "⌿",
"Sopf;": "𝕊",
"sopf;": "𝕤",
"spades;": "♠",
"spadesuit;": "♠",
"spar;": "∥",
"sqcap;": "⊓",
"sqcaps;": "⊓︀",
"sqcup;": "⊔",
"sqcups;": "⊔︀",
"Sqrt;": "√",
"sqsub;": "⊏",
"sqsube;": "⊑",
"sqsubset;": "⊏",
"sqsubseteq;": "⊑",
"sqsup;": "⊐",
"sqsupe;": "⊒",
"sqsupset;": "⊐",
"sqsupseteq;": "⊒",
"squ;": "□",
"Square;": "□",
"square;": "□",
"SquareIntersection;": "⊓",
"SquareSubset;": "⊏",
"SquareSubsetEqual;": "⊑",
"SquareSuperset;": "⊐",
"SquareSupersetEqual;": "⊒",
"SquareUnion;": "⊔",
"squarf;": "▪",
"squf;": "▪",
"srarr;": "→",
"Sscr;": "𝒮",
"sscr;": "𝓈",
"ssetmn;": "∖",
"ssmile;": "⌣",
"sstarf;": "⋆",
"Star;": "⋆",
"star;": "☆",
"starf;": "★",
"straightepsilon;": "ϵ",
"straightphi;": "ϕ",
"strns;": "¯",
"Sub;": "⋐",
"sub;": "⊂",
"subdot;": "⪽",
"subE;": "⫅",
"sube;": "⊆",
"subedot;": "⫃",
"submult;": "⫁",
"subnE;": "⫋",
"subne;": "⊊",
"subplus;": "⪿",
"subrarr;": "⥹",
"Subset;": "⋐",
"subset;": "⊂",
"subseteq;": "⊆",
"subseteqq;": "⫅",
"SubsetEqual;": "⊆",
"subsetneq;": "⊊",
"subsetneqq;": "⫋",
"subsim;": "⫇",
"subsub;": "⫕",
"subsup;": "⫓",
"succ;": "≻",
"succapprox;": "⪸",
"succcurlyeq;": "≽",
"Succeeds;": "≻",
"SucceedsEqual;": "⪰",
"SucceedsSlantEqual;": "≽",
"SucceedsTilde;": "≿",
"succeq;": "⪰",
"succnapprox;": "⪺",
"succneqq;": "⪶",
"succnsim;": "⋩",
"succsim;": "≿",
"SuchThat;": "∋",
"Sum;": "∑",
"sum;": "∑",
"sung;": "♪",
"Sup;": "⋑",
"sup;": "⊃",
"sup1;": "¹",
"sup1": "¹",
"sup2;": "²",
"sup2": "²",
"sup3;": "³",
"sup3": "³",
"supdot;": "⪾",
"supdsub;": "⫘",
"supE;": "⫆",
"supe;": "⊇",
"supedot;": "⫄",
"Superset;": "⊃",
"SupersetEqual;": "⊇",
"suphsol;": "⟉",
"suphsub;": "⫗",
"suplarr;": "⥻",
"supmult;": "⫂",
"supnE;": "⫌",
"supne;": "⊋",
"supplus;": "⫀",
"Supset;": "⋑",
"supset;": "⊃",
"supseteq;": "⊇",
"supseteqq;": "⫆",
"supsetneq;": "⊋",
"supsetneqq;": "⫌",
"supsim;": "⫈",
"supsub;": "⫔",
"supsup;": "⫖",
"swarhk;": "⤦",
"swArr;": "⇙",
"swarr;": "↙",
"swarrow;": "↙",
"swnwar;": "⤪",
"szlig;": "ß",
"szlig": "ß",
"Tab;": "\t",
"target;": "⌖",
"Tau;": "Τ",
"tau;": "τ",
"tbrk;": "⎴",
"Tcaron;": "Ť",
"tcaron;": "ť",
"Tcedil;": "Ţ",
"tcedil;": "ţ",
"Tcy;": "Т",
"tcy;": "т",
"tdot;": "⃛",
"telrec;": "⌕",
"Tfr;": "𝔗",
"tfr;": "𝔱",
"there4;": "∴",
"Therefore;": "∴",
"therefore;": "∴",
"Theta;": "Θ",
"theta;": "θ",
"thetasym;": "ϑ",
"thetav;": "ϑ",
"thickapprox;": "≈",
"thicksim;": "∼",
"ThickSpace;": " ",
"thinsp;": " ",
"ThinSpace;": " ",
"thkap;": "≈",
"thksim;": "∼",
"THORN;": "Þ",
"THORN": "Þ",
"thorn;": "þ",
"thorn": "þ",
"Tilde;": "∼",
"tilde;": "˜",
"TildeEqual;": "≃",
"TildeFullEqual;": "≅",
"TildeTilde;": "≈",
"times;": "×",
"times": "×",
"timesb;": "⊠",
"timesbar;": "⨱",
"timesd;": "⨰",
"tint;": "∭",
"toea;": "⤨",
"top;": "⊤",
"topbot;": "⌶",
"topcir;": "⫱",
"Topf;": "𝕋",
"topf;": "𝕥",
"topfork;": "⫚",
"tosa;": "⤩",
"tprime;": "‴",
"TRADE;": "™",
"trade;": "™",
"triangle;": "▵",
"triangledown;": "▿",
"triangleleft;": "◃",
"trianglelefteq;": "⊴",
"triangleq;": "≜",
"triangleright;": "▹",
"trianglerighteq;": "⊵",
"tridot;": "◬",
"trie;": "≜",
"triminus;": "⨺",
"TripleDot;": "⃛",
"triplus;": "⨹",
"trisb;": "⧍",
"tritime;": "⨻",
"trpezium;": "⏢",
"Tscr;": "𝒯",
"tscr;": "𝓉",
"TScy;": "Ц",
"tscy;": "ц",
"TSHcy;": "Ћ",
"tshcy;": "ћ",
"Tstrok;": "Ŧ",
"tstrok;": "ŧ",
"twixt;": "≬",
"twoheadleftarrow;": "↞",
"twoheadrightarrow;": "↠",
"Uacute;": "Ú",
"Uacute": "Ú",
"uacute;": "ú",
"uacute": "ú",
"Uarr;": "↟",
"uArr;": "⇑",
"uarr;": "↑",
"Uarrocir;": "⥉",
"Ubrcy;": "Ў",
"ubrcy;": "ў",
"Ubreve;": "Ŭ",
"ubreve;": "ŭ",
"Ucirc;": "Û",
"Ucirc": "Û",
"ucirc;": "û",
"ucirc": "û",
"Ucy;": "У",
"ucy;": "у",
"udarr;": "⇅",
"Udblac;": "Ű",
"udblac;": "ű",
"udhar;": "⥮",
"ufisht;": "⥾",
"Ufr;": "𝔘",
"ufr;": "𝔲",
"Ugrave;": "Ù",
"Ugrave": "Ù",
"ugrave;": "ù",
"ugrave": "ù",
"uHar;": "⥣",
"uharl;": "↿",
"uharr;": "↾",
"uhblk;": "▀",
"ulcorn;": "⌜",
"ulcorner;": "⌜",
"ulcrop;": "⌏",
"ultri;": "◸",
"Umacr;": "Ū",
"umacr;": "ū",
"uml;": "¨",
"uml": "¨",
"UnderBar;": "_",
"UnderBrace;": "⏟",
"UnderBracket;": "⎵",
"UnderParenthesis;": "⏝",
"Union;": "⋃",
"UnionPlus;": "⊎",
"Uogon;": "Ų",
"uogon;": "ų",
"Uopf;": "𝕌",
"uopf;": "𝕦",
"UpArrow;": "↑",
"Uparrow;": "⇑",
"uparrow;": "↑",
"UpArrowBar;": "⤒",
"UpArrowDownArrow;": "⇅",
"UpDownArrow;": "↕",
"Updownarrow;": "⇕",
"updownarrow;": "↕",
"UpEquilibrium;": "⥮",
"upharpoonleft;": "↿",
"upharpoonright;": "↾",
"uplus;": "⊎",
"UpperLeftArrow;": "↖",
"UpperRightArrow;": "↗",
"Upsi;": "ϒ",
"upsi;": "υ",
"upsih;": "ϒ",
"Upsilon;": "Υ",
"upsilon;": "υ",
"UpTee;": "⊥",
"UpTeeArrow;": "↥",
"upuparrows;": "⇈",
"urcorn;": "⌝",
"urcorner;": "⌝",
"urcrop;": "⌎",
"Uring;": "Ů",
"uring;": "ů",
"urtri;": "◹",
"Uscr;": "𝒰",
"uscr;": "𝓊",
"utdot;": "⋰",
"Utilde;": "Ũ",
"utilde;": "ũ",
"utri;": "▵",
"utrif;": "▴",
"uuarr;": "⇈",
"Uuml;": "Ü",
"Uuml": "Ü",
"uuml;": "ü",
"uuml": "ü",
"uwangle;": "⦧",
"vangrt;": "⦜",
"varepsilon;": "ϵ",
"varkappa;": "ϰ",
"varnothing;": "∅",
"varphi;": "ϕ",
"varpi;": "ϖ",
"varpropto;": "∝",
"vArr;": "⇕",
"varr;": "↕",
"varrho;": "ϱ",
"varsigma;": "ς",
"varsubsetneq;": "⊊︀",
"varsubsetneqq;": "⫋︀",
"varsupsetneq;": "⊋︀",
"varsupsetneqq;": "⫌︀",
"vartheta;": "ϑ",
"vartriangleleft;": "⊲",
"vartriangleright;": "⊳",
"Vbar;": "⫫",
"vBar;": "⫨",
"vBarv;": "⫩",
"Vcy;": "В",
"vcy;": "в",
"VDash;": "⊫",
"Vdash;": "⊩",
"vDash;": "⊨",
"vdash;": "⊢",
"Vdashl;": "⫦",
"Vee;": "⋁",
"vee;": "∨",
"veebar;": "⊻",
"veeeq;": "≚",
"vellip;": "⋮",
"Verbar;": "‖",
"verbar;": "|",
"Vert;": "‖",
"vert;": "|",
"VerticalBar;": "∣",
"VerticalLine;": "|",
"VerticalSeparator;": "❘",
"VerticalTilde;": "≀",
"VeryThinSpace;": " ",
"Vfr;": "𝔙",
"vfr;": "𝔳",
"vltri;": "⊲",
"vnsub;": "⊂⃒",
"vnsup;": "⊃⃒",
"Vopf;": "𝕍",
"vopf;": "𝕧",
"vprop;": "∝",
"vrtri;": "⊳",
"Vscr;": "𝒱",
"vscr;": "𝓋",
"vsubnE;": "⫋︀",
"vsubne;": "⊊︀",
"vsupnE;": "⫌︀",
"vsupne;": "⊋︀",
"Vvdash;": "⊪",
"vzigzag;": "⦚",
"Wcirc;": "Ŵ",
"wcirc;": "ŵ",
"wedbar;": "⩟",
"Wedge;": "⋀",
"wedge;": "∧",
"wedgeq;": "≙",
"weierp;": "℘",
"Wfr;": "𝔚",
"wfr;": "𝔴",
"Wopf;": "𝕎",
"wopf;": "𝕨",
"wp;": "℘",
"wr;": "≀",
"wreath;": "≀",
"Wscr;": "𝒲",
"wscr;": "𝓌",
"xcap;": "⋂",
"xcirc;": "◯",
"xcup;": "⋃",
"xdtri;": "▽",
"Xfr;": "𝔛",
"xfr;": "𝔵",
"xhArr;": "⟺",
"xharr;": "⟷",
"Xi;": "Ξ",
"xi;": "ξ",
"xlArr;": "⟸",
"xlarr;": "⟵",
"xmap;": "⟼",
"xnis;": "⋻",
"xodot;": "⨀",
"Xopf;": "𝕏",
"xopf;": "𝕩",
"xoplus;": "⨁",
"xotime;": "⨂",
"xrArr;": "⟹",
"xrarr;": "⟶",
"Xscr;": "𝒳",
"xscr;": "𝓍",
"xsqcup;": "⨆",
"xuplus;": "⨄",
"xutri;": "△",
"xvee;": "⋁",
"xwedge;": "⋀",
"Yacute;": "Ý",
"Yacute": "Ý",
"yacute;": "ý",
"yacute": "ý",
"YAcy;": "Я",
"yacy;": "я",
"Ycirc;": "Ŷ",
"ycirc;": "ŷ",
"Ycy;": "Ы",
"ycy;": "ы",
"yen;": "¥",
"yen": "¥",
"Yfr;": "𝔜",
"yfr;": "𝔶",
"YIcy;": "Ї",
"yicy;": "ї",
"Yopf;": "𝕐",
"yopf;": "𝕪",
"Yscr;": "𝒴",
"yscr;": "𝓎",
"YUcy;": "Ю",
"yucy;": "ю",
"Yuml;": "Ÿ",
"yuml;": "ÿ",
"yuml": "ÿ",
"Zacute;": "Ź",
"zacute;": "ź",
"Zcaron;": "Ž",
"zcaron;": "ž",
"Zcy;": "З",
"zcy;": "з",
"Zdot;": "Ż",
"zdot;": "ż",
"zeetrf;": "ℨ",
"ZeroWidthSpace;": "",
"Zeta;": "Ζ",
"zeta;": "ζ",
"Zfr;": "ℨ",
"zfr;": "𝔷",
"ZHcy;": "Ж",
"zhcy;": "ж",
"zigrarr;": "⇝",
"Zopf;": "ℤ",
"zopf;": "𝕫",
"Zscr;": "𝒵",
"zscr;": "𝓏",
"zwj;": "",
"zwnj;": ""
};
/***/ },
/* 39 */
/***/ function(module, exports, __webpack_require__) {
/*
Adapted from https://github.com/facebook/react/blob/c265504fe2fdeadf0e5358879a3c141628b37a23/src/renderers/dom/shared/HTMLDOMPropertyConfig.js
*/
var decode = __webpack_require__(32).decode;
var MUST_USE_ATTRIBUTE = 0x1;
var MUST_USE_PROPERTY = 0x2;
var HAS_BOOLEAN_VALUE = 0x8;
var HAS_NUMERIC_VALUE = 0x10;
var HAS_POSITIVE_NUMERIC_VALUE = 0x20 | 0x10;
var HAS_OVERLOADED_BOOLEAN_VALUE = 0x40;
function checkMask(value, bitmask) {
return (value & bitmask) === bitmask;
}
var isCustomAttribute = RegExp.prototype.test.bind(
/^(data|aria)-[a-z_][a-z\d_.\-]*$/
);
var HTMLDOMPropertyConfig = {
Properties: {
/**
* Standard Properties
*/
accept: null,
acceptCharset: null,
accessKey: null,
action: null,
allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
allowTransparency: MUST_USE_ATTRIBUTE,
alt: null,
async: HAS_BOOLEAN_VALUE,
autoComplete: null,
autoFocus: HAS_BOOLEAN_VALUE,
autoPlay: HAS_BOOLEAN_VALUE,
capture: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
cellPadding: null,
cellSpacing: null,
charSet: MUST_USE_ATTRIBUTE,
challenge: MUST_USE_ATTRIBUTE,
checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
classID: MUST_USE_ATTRIBUTE,
// To set className on SVG elements, it's necessary to use .setAttribute;
// this works on HTML elements too in all browsers except IE8.
className: MUST_USE_ATTRIBUTE,
cols: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
colSpan: null,
content: null,
contentEditable: null,
contextMenu: MUST_USE_ATTRIBUTE,
controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
coords: null,
crossOrigin: null,
data: null, // For `<object />` acts as `src`.
dateTime: MUST_USE_ATTRIBUTE,
defer: HAS_BOOLEAN_VALUE,
dir: null,
disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
download: HAS_OVERLOADED_BOOLEAN_VALUE,
draggable: null,
encType: null,
form: MUST_USE_ATTRIBUTE,
formAction: MUST_USE_ATTRIBUTE,
formEncType: MUST_USE_ATTRIBUTE,
formMethod: MUST_USE_ATTRIBUTE,
formNoValidate: HAS_BOOLEAN_VALUE,
formTarget: MUST_USE_ATTRIBUTE,
frameBorder: MUST_USE_ATTRIBUTE,
headers: null,
height: MUST_USE_ATTRIBUTE,
hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
high: null,
href: null,
hrefLang: null,
htmlFor: null,
httpEquiv: null,
icon: null,
id: MUST_USE_PROPERTY,
is: MUST_USE_ATTRIBUTE,
keyParams: MUST_USE_ATTRIBUTE,
keyType: MUST_USE_ATTRIBUTE,
label: null,
lang: null,
list: MUST_USE_ATTRIBUTE,
loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
low: null,
manifest: MUST_USE_ATTRIBUTE,
marginHeight: null,
marginWidth: null,
max: null,
maxLength: MUST_USE_ATTRIBUTE,
media: MUST_USE_ATTRIBUTE,
mediaGroup: null,
method: null,
min: null,
minLength: MUST_USE_ATTRIBUTE,
multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
name: null,
noValidate: HAS_BOOLEAN_VALUE,
open: HAS_BOOLEAN_VALUE,
optimum: null,
pattern: null,
placeholder: null,
poster: null,
preload: null,
radioGroup: null,
readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
rel: null,
required: HAS_BOOLEAN_VALUE,
role: MUST_USE_ATTRIBUTE,
rows: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
rowSpan: null,
sandbox: null,
scope: null,
scoped: HAS_BOOLEAN_VALUE,
scrolling: null,
seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
shape: null,
size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
sizes: MUST_USE_ATTRIBUTE,
span: HAS_POSITIVE_NUMERIC_VALUE,
spellCheck: null,
src: null,
srcDoc: MUST_USE_PROPERTY,
srcSet: MUST_USE_ATTRIBUTE,
start: HAS_NUMERIC_VALUE,
step: null,
style: null,
tabIndex: null,
target: null,
title: null,
type: null,
useMap: null,
value: MUST_USE_PROPERTY,
width: MUST_USE_ATTRIBUTE,
wmode: MUST_USE_ATTRIBUTE,
/**
* Non-standard Properties
*/
// autoCapitalize and autoCorrect are supported in Mobile Safari for
// keyboard hints.
autoCapitalize: null,
autoCorrect: null,
// itemProp, itemScope, itemType are for
// Microdata support. See http://schema.org/docs/gs.html
itemProp: MUST_USE_ATTRIBUTE,
itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
itemType: MUST_USE_ATTRIBUTE,
// itemID and itemRef are for Microdata support as well but
// only specified in the the WHATWG spec document. See
// https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
itemID: MUST_USE_ATTRIBUTE,
itemRef: MUST_USE_ATTRIBUTE,
// property is supported for OpenGraph in meta tags.
property: null,
// IE-only attribute that controls focus behavior
unselectable: MUST_USE_ATTRIBUTE
}
};
var parseStyles = function(input) {
var attributes = input.split(';');
var styles = attributes.reduce(function(object, attribute){
var entry = attribute.split(/:(.+)/);
if (entry[0] && entry[1]) {
object[entry[0].trim()] = entry[1].trim();
}
return object;
},{});
return styles;
};
var propertyToAttributeMapping = {
'className': 'class',
'htmlFor': 'for',
'httpEquiv': 'http-equiv',
'acceptCharset': 'accept-charset'
};
var propertyValueConversions = {
'style': parseStyles,
'placeholder': decode,
'title': decode,
'alt': decode
};
var getPropertyInfo = (function () {
var propInfoByAttributeName = {};
Object.keys(HTMLDOMPropertyConfig.Properties).forEach(function (propName) {
var propConfig = HTMLDOMPropertyConfig.Properties[propName];
var attributeName = propertyToAttributeMapping[propName] || propName.toLowerCase();
var propertyInfo = {
attributeName: attributeName,
propertyName: propName,
mustUseAttribute: checkMask(propConfig, MUST_USE_ATTRIBUTE),
mustUseProperty: checkMask(propConfig, MUST_USE_PROPERTY),
hasBooleanValue: checkMask(propConfig, HAS_BOOLEAN_VALUE),
hasNumericValue: checkMask(propConfig, HAS_NUMERIC_VALUE),
hasPositiveNumericValue:
checkMask(propConfig, HAS_POSITIVE_NUMERIC_VALUE),
hasOverloadedBooleanValue:
checkMask(propConfig, HAS_OVERLOADED_BOOLEAN_VALUE),
};
propInfoByAttributeName[attributeName] = propertyInfo;
});
return function (attributeName) {
return propInfoByAttributeName[attributeName];
};
})();
var convertTagAttributes = function (tag) {
var attributes = tag.attribs;
var vdomProperties = {
attributes: {}
};
Object.keys(attributes).forEach(function (attributeName) {
var lowerCased = attributeName.toLowerCase();
var propInfo = getPropertyInfo(lowerCased);
var value = attributes[attributeName];
if (isCustomAttribute(attributeName) || !propInfo) {
vdomProperties.attributes[attributeName] = value;
return;
}
var valueConverter = propertyValueConversions[propInfo.propertyName];
if (valueConverter) {
value = valueConverter(value);
}
if (propInfo.mustUseAttribute) {
if (propInfo.hasBooleanValue) {
// Boolean attributes come in as an empty string or the
vdomProperties.attributes[propInfo.attributeName] = '';
}
else {
vdomProperties.attributes[propInfo.attributeName] = value;
}
}
// Anything we don't set as an attribute is treated as a property
else {
var isTrue;
if (propInfo.hasBooleanValue) {
isTrue = (value === '' || value.toLowerCase() === propInfo.attributeName);
vdomProperties[propInfo.propertyName] = isTrue ? true : false;
}
else if (propInfo.hasOverloadedBooleanValue) {
isTrue = (value === '');
vdomProperties[propInfo.propertyName] = isTrue ? true : value;
}
else if (propInfo.hasNumericValue || propInfo.hasPositiveNumericValue) {
vdomProperties[propInfo.propertyName] = Number(value);
}
else {
vdomProperties[propInfo.propertyName] = value;
}
}
});
return vdomProperties;
};
module.exports = convertTagAttributes;
/***/ },
/* 40 */
/***/ function(module, exports, __webpack_require__) {
var htmlparser = __webpack_require__(41);
var parseHTML = function parseHTML (html) {
var handler = new htmlparser.DomHandler();
var parser = new htmlparser.Parser(handler, {
lowerCaseAttributeNames: false
});
parser.parseComplete(html);
return handler.dom;
};
module.exports = parseHTML;
/***/ },
/* 41 */
/***/ function(module, exports, __webpack_require__) {
var Parser = __webpack_require__(42),
DomHandler = __webpack_require__(54);
function defineProp(name, value){
delete module.exports[name];
module.exports[name] = value;
return value;
}
module.exports = {
Parser: Parser,
Tokenizer: __webpack_require__(43),
ElementType: __webpack_require__(55),
DomHandler: DomHandler,
get FeedHandler(){
return defineProp("FeedHandler", __webpack_require__(58));
},
get Stream(){
return defineProp("Stream", __webpack_require__(59));
},
get WritableStream(){
return defineProp("WritableStream", __webpack_require__(60));
},
get ProxyHandler(){
return defineProp("ProxyHandler", __webpack_require__(83));
},
get DomUtils(){
return defineProp("DomUtils", __webpack_require__(84));
},
get CollectingHandler(){
return defineProp("CollectingHandler", __webpack_require__(96));
},
// For legacy support
DefaultHandler: DomHandler,
get RssHandler(){
return defineProp("RssHandler", this.FeedHandler);
},
//helper methods
parseDOM: function(data, options){
var handler = new DomHandler(options);
new Parser(handler, options).end(data);
return handler.dom;
},
parseFeed: function(feed, options){
var handler = new module.exports.FeedHandler(options);
new Parser(handler, options).end(feed);
return handler.dom;
},
createDomStream: function(cb, options, elementCb){
var handler = new DomHandler(cb, options, elementCb);
return new Parser(handler, options);
},
// List of all events that the parser emits
EVENTS: { /* Format: eventname: number of arguments */
attribute: 2,
cdatastart: 0,
cdataend: 0,
text: 1,
processinginstruction: 2,
comment: 1,
commentend: 0,
closetag: 1,
opentag: 2,
opentagname: 1,
error: 1,
end: 0
}
};
/***/ },
/* 42 */
/***/ function(module, exports, __webpack_require__) {
var Tokenizer = __webpack_require__(43);
/*
Options:
xmlMode: Disables the special behavior for script/style tags (false by default)
lowerCaseAttributeNames: call .toLowerCase for each attribute name (true if xmlMode is `false`)
lowerCaseTags: call .toLowerCase for each tag name (true if xmlMode is `false`)
*/
/*
Callbacks:
oncdataend,
oncdatastart,
onclosetag,
oncomment,
oncommentend,
onerror,
onopentag,
onprocessinginstruction,
onreset,
ontext
*/
var formTags = {
input: true,
option: true,
optgroup: true,
select: true,
button: true,
datalist: true,
textarea: true
};
var openImpliesClose = {
tr : { tr:true, th:true, td:true },
th : { th:true },
td : { thead:true, th:true, td:true },
body : { head:true, link:true, script:true },
li : { li:true },
p : { p:true },
h1 : { p:true },
h2 : { p:true },
h3 : { p:true },
h4 : { p:true },
h5 : { p:true },
h6 : { p:true },
select : formTags,
input : formTags,
output : formTags,
button : formTags,
datalist: formTags,
textarea: formTags,
option : { option:true },
optgroup: { optgroup:true }
};
var voidElements = {
__proto__: null,
area: true,
base: true,
basefont: true,
br: true,
col: true,
command: true,
embed: true,
frame: true,
hr: true,
img: true,
input: true,
isindex: true,
keygen: true,
link: true,
meta: true,
param: true,
source: true,
track: true,
wbr: true,
//common self closing svg elements
path: true,
circle: true,
ellipse: true,
line: true,
rect: true,
use: true,
stop: true,
polyline: true,
polygon: true
};
var re_nameEnd = /\s|\//;
function Parser(cbs, options){
this._options = options || {};
this._cbs = cbs || {};
this._tagname = "";
this._attribname = "";
this._attribvalue = "";
this._attribs = null;
this._stack = [];
this.startIndex = 0;
this.endIndex = null;
this._lowerCaseTagNames = "lowerCaseTags" in this._options ?
!!this._options.lowerCaseTags :
!this._options.xmlMode;
this._lowerCaseAttributeNames = "lowerCaseAttributeNames" in this._options ?
!!this._options.lowerCaseAttributeNames :
!this._options.xmlMode;
if(!!this._options.Tokenizer) {
Tokenizer = this._options.Tokenizer;
}
this._tokenizer = new Tokenizer(this._options, this);
if(this._cbs.onparserinit) this._cbs.onparserinit(this);
}
__webpack_require__(49).inherits(Parser, __webpack_require__(53).EventEmitter);
Parser.prototype._updatePosition = function(initialOffset){
if(this.endIndex === null){
if(this._tokenizer._sectionStart <= initialOffset){
this.startIndex = 0;
} else {
this.startIndex = this._tokenizer._sectionStart - initialOffset;
}
}
else this.startIndex = this.endIndex + 1;
this.endIndex = this._tokenizer.getAbsoluteIndex();
};
//Tokenizer event handlers
Parser.prototype.ontext = function(data){
this._updatePosition(1);
this.endIndex--;
if(this._cbs.ontext) this._cbs.ontext(data);
};
Parser.prototype.onopentagname = function(name){
if(this._lowerCaseTagNames){
name = name.toLowerCase();
}
this._tagname = name;
if(!this._options.xmlMode && name in openImpliesClose) {
for(
var el;
(el = this._stack[this._stack.length - 1]) in openImpliesClose[name];
this.onclosetag(el)
);
}
if(this._options.xmlMode || !(name in voidElements)){
this._stack.push(name);
}
if(this._cbs.onopentagname) this._cbs.onopentagname(name);
if(this._cbs.onopentag) this._attribs = {};
};
Parser.prototype.onopentagend = function(){
this._updatePosition(1);
if(this._attribs){
if(this._cbs.onopentag) this._cbs.onopentag(this._tagname, this._attribs);
this._attribs = null;
}
if(!this._options.xmlMode && this._cbs.onclosetag && this._tagname in voidElements){
this._cbs.onclosetag(this._tagname);
}
this._tagname = "";
};
Parser.prototype.onclosetag = function(name){
this._updatePosition(1);
if(this._lowerCaseTagNames){
name = name.toLowerCase();
}
if(this._stack.length && (!(name in voidElements) || this._options.xmlMode)){
var pos = this._stack.lastIndexOf(name);
if(pos !== -1){
if(this._cbs.onclosetag){
pos = this._stack.length - pos;
while(pos--) this._cbs.onclosetag(this._stack.pop());
}
else this._stack.length = pos;
} else if(name === "p" && !this._options.xmlMode){
this.onopentagname(name);
this._closeCurrentTag();
}
} else if(!this._options.xmlMode && (name === "br" || name === "p")){
this.onopentagname(name);
this._closeCurrentTag();
}
};
Parser.prototype.onselfclosingtag = function(){
if(this._options.xmlMode || this._options.recognizeSelfClosing){
this._closeCurrentTag();
} else {
this.onopentagend();
}
};
Parser.prototype._closeCurrentTag = function(){
var name = this._tagname;
this.onopentagend();
//self-closing tags will be on the top of the stack
//(cheaper check than in onclosetag)
if(this._stack[this._stack.length - 1] === name){
if(this._cbs.onclosetag){
this._cbs.onclosetag(name);
}
this._stack.pop();
}
};
Parser.prototype.onattribname = function(name){
if(this._lowerCaseAttributeNames){
name = name.toLowerCase();
}
this._attribname = name;
};
Parser.prototype.onattribdata = function(value){
this._attribvalue += value;
};
Parser.prototype.onattribend = function(){
if(this._cbs.onattribute) this._cbs.onattribute(this._attribname, this._attribvalue);
if(
this._attribs &&
!Object.prototype.hasOwnProperty.call(this._attribs, this._attribname)
){
this._attribs[this._attribname] = this._attribvalue;
}
this._attribname = "";
this._attribvalue = "";
};
Parser.prototype._getInstructionName = function(value){
var idx = value.search(re_nameEnd),
name = idx < 0 ? value : value.substr(0, idx);
if(this._lowerCaseTagNames){
name = name.toLowerCase();
}
return name;
};
Parser.prototype.ondeclaration = function(value){
if(this._cbs.onprocessinginstruction){
var name = this._getInstructionName(value);
this._cbs.onprocessinginstruction("!" + name, "!" + value);
}
};
Parser.prototype.onprocessinginstruction = function(value){
if(this._cbs.onprocessinginstruction){
var name = this._getInstructionName(value);
this._cbs.onprocessinginstruction("?" + name, "?" + value);
}
};
Parser.prototype.oncomment = function(value){
this._updatePosition(4);
if(this._cbs.oncomment) this._cbs.oncomment(value);
if(this._cbs.oncommentend) this._cbs.oncommentend();
};
Parser.prototype.oncdata = function(value){
this._updatePosition(1);
if(this._options.xmlMode || this._options.recognizeCDATA){
if(this._cbs.oncdatastart) this._cbs.oncdatastart();
if(this._cbs.ontext) this._cbs.ontext(value);
if(this._cbs.oncdataend) this._cbs.oncdataend();
} else {
this.oncomment("[CDATA[" + value + "]]");
}
};
Parser.prototype.onerror = function(err){
if(this._cbs.onerror) this._cbs.onerror(err);
};
Parser.prototype.onend = function(){
if(this._cbs.onclosetag){
for(
var i = this._stack.length;
i > 0;
this._cbs.onclosetag(this._stack[--i])
);
}
if(this._cbs.onend) this._cbs.onend();
};
//Resets the parser to a blank state, ready to parse a new HTML document
Parser.prototype.reset = function(){
if(this._cbs.onreset) this._cbs.onreset();
this._tokenizer.reset();
this._tagname = "";
this._attribname = "";
this._attribs = null;
this._stack = [];
if(this._cbs.onparserinit) this._cbs.onparserinit(this);
};
//Parses a complete HTML document and pushes it to the handler
Parser.prototype.parseComplete = function(data){
this.reset();
this.end(data);
};
Parser.prototype.write = function(chunk){
this._tokenizer.write(chunk);
};
Parser.prototype.end = function(chunk){
this._tokenizer.end(chunk);
};
Parser.prototype.pause = function(){
this._tokenizer.pause();
};
Parser.prototype.resume = function(){
this._tokenizer.resume();
};
//alias for backwards compat
Parser.prototype.parseChunk = Parser.prototype.write;
Parser.prototype.done = Parser.prototype.end;
module.exports = Parser;
/***/ },
/* 43 */
/***/ function(module, exports, __webpack_require__) {
module.exports = Tokenizer;
var decodeCodePoint = __webpack_require__(44),
entityMap = __webpack_require__(46),
legacyMap = __webpack_require__(47),
xmlMap = __webpack_require__(48),
i = 0,
TEXT = i++,
BEFORE_TAG_NAME = i++, //after <
IN_TAG_NAME = i++,
IN_SELF_CLOSING_TAG = i++,
BEFORE_CLOSING_TAG_NAME = i++,
IN_CLOSING_TAG_NAME = i++,
AFTER_CLOSING_TAG_NAME = i++,
//attributes
BEFORE_ATTRIBUTE_NAME = i++,
IN_ATTRIBUTE_NAME = i++,
AFTER_ATTRIBUTE_NAME = i++,
BEFORE_ATTRIBUTE_VALUE = i++,
IN_ATTRIBUTE_VALUE_DQ = i++, // "
IN_ATTRIBUTE_VALUE_SQ = i++, // '
IN_ATTRIBUTE_VALUE_NQ = i++,
//declarations
BEFORE_DECLARATION = i++, // !
IN_DECLARATION = i++,
//processing instructions
IN_PROCESSING_INSTRUCTION = i++, // ?
//comments
BEFORE_COMMENT = i++,
IN_COMMENT = i++,
AFTER_COMMENT_1 = i++,
AFTER_COMMENT_2 = i++,
//cdata
BEFORE_CDATA_1 = i++, // [
BEFORE_CDATA_2 = i++, // C
BEFORE_CDATA_3 = i++, // D
BEFORE_CDATA_4 = i++, // A
BEFORE_CDATA_5 = i++, // T
BEFORE_CDATA_6 = i++, // A
IN_CDATA = i++, // [
AFTER_CDATA_1 = i++, // ]
AFTER_CDATA_2 = i++, // ]
//special tags
BEFORE_SPECIAL = i++, //S
BEFORE_SPECIAL_END = i++, //S
BEFORE_SCRIPT_1 = i++, //C
BEFORE_SCRIPT_2 = i++, //R
BEFORE_SCRIPT_3 = i++, //I
BEFORE_SCRIPT_4 = i++, //P
BEFORE_SCRIPT_5 = i++, //T
AFTER_SCRIPT_1 = i++, //C
AFTER_SCRIPT_2 = i++, //R
AFTER_SCRIPT_3 = i++, //I
AFTER_SCRIPT_4 = i++, //P
AFTER_SCRIPT_5 = i++, //T
BEFORE_STYLE_1 = i++, //T
BEFORE_STYLE_2 = i++, //Y
BEFORE_STYLE_3 = i++, //L
BEFORE_STYLE_4 = i++, //E
AFTER_STYLE_1 = i++, //T
AFTER_STYLE_2 = i++, //Y
AFTER_STYLE_3 = i++, //L
AFTER_STYLE_4 = i++, //E
BEFORE_ENTITY = i++, //&
BEFORE_NUMERIC_ENTITY = i++, //#
IN_NAMED_ENTITY = i++,
IN_NUMERIC_ENTITY = i++,
IN_HEX_ENTITY = i++, //X
j = 0,
SPECIAL_NONE = j++,
SPECIAL_SCRIPT = j++,
SPECIAL_STYLE = j++;
function whitespace(c){
return c === " " || c === "\n" || c === "\t" || c === "\f" || c === "\r";
}
function characterState(char, SUCCESS){
return function(c){
if(c === char) this._state = SUCCESS;
};
}
function ifElseState(upper, SUCCESS, FAILURE){
var lower = upper.toLowerCase();
if(upper === lower){
return function(c){
if(c === lower){
this._state = SUCCESS;
} else {
this._state = FAILURE;
this._index--;
}
};
} else {
return function(c){
if(c === lower || c === upper){
this._state = SUCCESS;
} else {
this._state = FAILURE;
this._index--;
}
};
}
}
function consumeSpecialNameChar(upper, NEXT_STATE){
var lower = upper.toLowerCase();
return function(c){
if(c === lower || c === upper){
this._state = NEXT_STATE;
} else {
this._state = IN_TAG_NAME;
this._index--; //consume the token again
}
};
}
function Tokenizer(options, cbs){
this._state = TEXT;
this._buffer = "";
this._sectionStart = 0;
this._index = 0;
this._bufferOffset = 0; //chars removed from _buffer
this._baseState = TEXT;
this._special = SPECIAL_NONE;
this._cbs = cbs;
this._running = true;
this._ended = false;
this._xmlMode = !!(options && options.xmlMode);
this._decodeEntities = !!(options && options.decodeEntities);
}
Tokenizer.prototype._stateText = function(c){
if(c === "<"){
if(this._index > this._sectionStart){
this._cbs.ontext(this._getSection());
}
this._state = BEFORE_TAG_NAME;
this._sectionStart = this._index;
} else if(this._decodeEntities && this._special === SPECIAL_NONE && c === "&"){
if(this._index > this._sectionStart){
this._cbs.ontext(this._getSection());
}
this._baseState = TEXT;
this._state = BEFORE_ENTITY;
this._sectionStart = this._index;
}
};
Tokenizer.prototype._stateBeforeTagName = function(c){
if(c === "/"){
this._state = BEFORE_CLOSING_TAG_NAME;
} else if(c === ">" || this._special !== SPECIAL_NONE || whitespace(c)) {
this._state = TEXT;
} else if(c === "!"){
this._state = BEFORE_DECLARATION;
this._sectionStart = this._index + 1;
} else if(c === "?"){
this._state = IN_PROCESSING_INSTRUCTION;
this._sectionStart = this._index + 1;
} else if(c === "<"){
this._cbs.ontext(this._getSection());
this._sectionStart = this._index;
} else {
this._state = (!this._xmlMode && (c === "s" || c === "S")) ?
BEFORE_SPECIAL : IN_TAG_NAME;
this._sectionStart = this._index;
}
};
Tokenizer.prototype._stateInTagName = function(c){
if(c === "/" || c === ">" || whitespace(c)){
this._emitToken("onopentagname");
this._state = BEFORE_ATTRIBUTE_NAME;
this._index--;
}
};
Tokenizer.prototype._stateBeforeCloseingTagName = function(c){
if(whitespace(c));
else if(c === ">"){
this._state = TEXT;
} else if(this._special !== SPECIAL_NONE){
if(c === "s" || c === "S"){
this._state = BEFORE_SPECIAL_END;
} else {
this._state = TEXT;
this._index--;
}
} else {
this._state = IN_CLOSING_TAG_NAME;
this._sectionStart = this._index;
}
};
Tokenizer.prototype._stateInCloseingTagName = function(c){
if(c === ">" || whitespace(c)){
this._emitToken("onclosetag");
this._state = AFTER_CLOSING_TAG_NAME;
this._index--;
}
};
Tokenizer.prototype._stateAfterCloseingTagName = function(c){
//skip everything until ">"
if(c === ">"){
this._state = TEXT;
this._sectionStart = this._index + 1;
}
};
Tokenizer.prototype._stateBeforeAttributeName = function(c){
if(c === ">"){
this._cbs.onopentagend();
this._state = TEXT;
this._sectionStart = this._index + 1;
} else if(c === "/"){
this._state = IN_SELF_CLOSING_TAG;
} else if(!whitespace(c)){
this._state = IN_ATTRIBUTE_NAME;
this._sectionStart = this._index;
}
};
Tokenizer.prototype._stateInSelfClosingTag = function(c){
if(c === ">"){
this._cbs.onselfclosingtag();
this._state = TEXT;
this._sectionStart = this._index + 1;
} else if(!whitespace(c)){
this._state = BEFORE_ATTRIBUTE_NAME;
this._index--;
}
};
Tokenizer.prototype._stateInAttributeName = function(c){
if(c === "=" || c === "/" || c === ">" || whitespace(c)){
this._cbs.onattribname(this._getSection());
this._sectionStart = -1;
this._state = AFTER_ATTRIBUTE_NAME;
this._index--;
}
};
Tokenizer.prototype._stateAfterAttributeName = function(c){
if(c === "="){
this._state = BEFORE_ATTRIBUTE_VALUE;
} else if(c === "/" || c === ">"){
this._cbs.onattribend();
this._state = BEFORE_ATTRIBUTE_NAME;
this._index--;
} else if(!whitespace(c)){
this._cbs.onattribend();
this._state = IN_ATTRIBUTE_NAME;
this._sectionStart = this._index;
}
};
Tokenizer.prototype._stateBeforeAttributeValue = function(c){
if(c === "\""){
this._state = IN_ATTRIBUTE_VALUE_DQ;
this._sectionStart = this._index + 1;
} else if(c === "'"){
this._state = IN_ATTRIBUTE_VALUE_SQ;
this._sectionStart = this._index + 1;
} else if(!whitespace(c)){
this._state = IN_ATTRIBUTE_VALUE_NQ;
this._sectionStart = this._index;
this._index--; //reconsume token
}
};
Tokenizer.prototype._stateInAttributeValueDoubleQuotes = function(c){
if(c === "\""){
this._emitToken("onattribdata");
this._cbs.onattribend();
this._state = BEFORE_ATTRIBUTE_NAME;
} else if(this._decodeEntities && c === "&"){
this._emitToken("onattribdata");
this._baseState = this._state;
this._state = BEFORE_ENTITY;
this._sectionStart = this._index;
}
};
Tokenizer.prototype._stateInAttributeValueSingleQuotes = function(c){
if(c === "'"){
this._emitToken("onattribdata");
this._cbs.onattribend();
this._state = BEFORE_ATTRIBUTE_NAME;
} else if(this._decodeEntities && c === "&"){
this._emitToken("onattribdata");
this._baseState = this._state;
this._state = BEFORE_ENTITY;
this._sectionStart = this._index;
}
};
Tokenizer.prototype._stateInAttributeValueNoQuotes = function(c){
if(whitespace(c) || c === ">"){
this._emitToken("onattribdata");
this._cbs.onattribend();
this._state = BEFORE_ATTRIBUTE_NAME;
this._index--;
} else if(this._decodeEntities && c === "&"){
this._emitToken("onattribdata");
this._baseState = this._state;
this._state = BEFORE_ENTITY;
this._sectionStart = this._index;
}
};
Tokenizer.prototype._stateBeforeDeclaration = function(c){
this._state = c === "[" ? BEFORE_CDATA_1 :
c === "-" ? BEFORE_COMMENT :
IN_DECLARATION;
};
Tokenizer.prototype._stateInDeclaration = function(c){
if(c === ">"){
this._cbs.ondeclaration(this._getSection());
this._state = TEXT;
this._sectionStart = this._index + 1;
}
};
Tokenizer.prototype._stateInProcessingInstruction = function(c){
if(c === ">"){
this._cbs.onprocessinginstruction(this._getSection());
this._state = TEXT;
this._sectionStart = this._index + 1;
}
};
Tokenizer.prototype._stateBeforeComment = function(c){
if(c === "-"){
this._state = IN_COMMENT;
this._sectionStart = this._index + 1;
} else {
this._state = IN_DECLARATION;
}
};
Tokenizer.prototype._stateInComment = function(c){
if(c === "-") this._state = AFTER_COMMENT_1;
};
Tokenizer.prototype._stateAfterComment1 = function(c){
if(c === "-"){
this._state = AFTER_COMMENT_2;
} else {
this._state = IN_COMMENT;
}
};
Tokenizer.prototype._stateAfterComment2 = function(c){
if(c === ">"){
//remove 2 trailing chars
this._cbs.oncomment(this._buffer.substring(this._sectionStart, this._index - 2));
this._state = TEXT;
this._sectionStart = this._index + 1;
} else if(c !== "-"){
this._state = IN_COMMENT;
}
// else: stay in AFTER_COMMENT_2 (`--->`)
};
Tokenizer.prototype._stateBeforeCdata1 = ifElseState("C", BEFORE_CDATA_2, IN_DECLARATION);
Tokenizer.prototype._stateBeforeCdata2 = ifElseState("D", BEFORE_CDATA_3, IN_DECLARATION);
Tokenizer.prototype._stateBeforeCdata3 = ifElseState("A", BEFORE_CDATA_4, IN_DECLARATION);
Tokenizer.prototype._stateBeforeCdata4 = ifElseState("T", BEFORE_CDATA_5, IN_DECLARATION);
Tokenizer.prototype._stateBeforeCdata5 = ifElseState("A", BEFORE_CDATA_6, IN_DECLARATION);
Tokenizer.prototype._stateBeforeCdata6 = function(c){
if(c === "["){
this._state = IN_CDATA;
this._sectionStart = this._index + 1;
} else {
this._state = IN_DECLARATION;
this._index--;
}
};
Tokenizer.prototype._stateInCdata = function(c){
if(c === "]") this._state = AFTER_CDATA_1;
};
Tokenizer.prototype._stateAfterCdata1 = characterState("]", AFTER_CDATA_2);
Tokenizer.prototype._stateAfterCdata2 = function(c){
if(c === ">"){
//remove 2 trailing chars
this._cbs.oncdata(this._buffer.substring(this._sectionStart, this._index - 2));
this._state = TEXT;
this._sectionStart = this._index + 1;
} else if(c !== "]") {
this._state = IN_CDATA;
}
//else: stay in AFTER_CDATA_2 (`]]]>`)
};
Tokenizer.prototype._stateBeforeSpecial = function(c){
if(c === "c" || c === "C"){
this._state = BEFORE_SCRIPT_1;
} else if(c === "t" || c === "T"){
this._state = BEFORE_STYLE_1;
} else {
this._state = IN_TAG_NAME;
this._index--; //consume the token again
}
};
Tokenizer.prototype._stateBeforeSpecialEnd = function(c){
if(this._special === SPECIAL_SCRIPT && (c === "c" || c === "C")){
this._state = AFTER_SCRIPT_1;
} else if(this._special === SPECIAL_STYLE && (c === "t" || c === "T")){
this._state = AFTER_STYLE_1;
}
else this._state = TEXT;
};
Tokenizer.prototype._stateBeforeScript1 = consumeSpecialNameChar("R", BEFORE_SCRIPT_2);
Tokenizer.prototype._stateBeforeScript2 = consumeSpecialNameChar("I", BEFORE_SCRIPT_3);
Tokenizer.prototype._stateBeforeScript3 = consumeSpecialNameChar("P", BEFORE_SCRIPT_4);
Tokenizer.prototype._stateBeforeScript4 = consumeSpecialNameChar("T", BEFORE_SCRIPT_5);
Tokenizer.prototype._stateBeforeScript5 = function(c){
if(c === "/" || c === ">" || whitespace(c)){
this._special = SPECIAL_SCRIPT;
}
this._state = IN_TAG_NAME;
this._index--; //consume the token again
};
Tokenizer.prototype._stateAfterScript1 = ifElseState("R", AFTER_SCRIPT_2, TEXT);
Tokenizer.prototype._stateAfterScript2 = ifElseState("I", AFTER_SCRIPT_3, TEXT);
Tokenizer.prototype._stateAfterScript3 = ifElseState("P", AFTER_SCRIPT_4, TEXT);
Tokenizer.prototype._stateAfterScript4 = ifElseState("T", AFTER_SCRIPT_5, TEXT);
Tokenizer.prototype._stateAfterScript5 = function(c){
if(c === ">" || whitespace(c)){
this._special = SPECIAL_NONE;
this._state = IN_CLOSING_TAG_NAME;
this._sectionStart = this._index - 6;
this._index--; //reconsume the token
}
else this._state = TEXT;
};
Tokenizer.prototype._stateBeforeStyle1 = consumeSpecialNameChar("Y", BEFORE_STYLE_2);
Tokenizer.prototype._stateBeforeStyle2 = consumeSpecialNameChar("L", BEFORE_STYLE_3);
Tokenizer.prototype._stateBeforeStyle3 = consumeSpecialNameChar("E", BEFORE_STYLE_4);
Tokenizer.prototype._stateBeforeStyle4 = function(c){
if(c === "/" || c === ">" || whitespace(c)){
this._special = SPECIAL_STYLE;
}
this._state = IN_TAG_NAME;
this._index--; //consume the token again
};
Tokenizer.prototype._stateAfterStyle1 = ifElseState("Y", AFTER_STYLE_2, TEXT);
Tokenizer.prototype._stateAfterStyle2 = ifElseState("L", AFTER_STYLE_3, TEXT);
Tokenizer.prototype._stateAfterStyle3 = ifElseState("E", AFTER_STYLE_4, TEXT);
Tokenizer.prototype._stateAfterStyle4 = function(c){
if(c === ">" || whitespace(c)){
this._special = SPECIAL_NONE;
this._state = IN_CLOSING_TAG_NAME;
this._sectionStart = this._index - 5;
this._index--; //reconsume the token
}
else this._state = TEXT;
};
Tokenizer.prototype._stateBeforeEntity = ifElseState("#", BEFORE_NUMERIC_ENTITY, IN_NAMED_ENTITY);
Tokenizer.prototype._stateBeforeNumericEntity = ifElseState("X", IN_HEX_ENTITY, IN_NUMERIC_ENTITY);
//for entities terminated with a semicolon
Tokenizer.prototype._parseNamedEntityStrict = function(){
//offset = 1
if(this._sectionStart + 1 < this._index){
var entity = this._buffer.substring(this._sectionStart + 1, this._index),
map = this._xmlMode ? xmlMap : entityMap;
if(map.hasOwnProperty(entity)){
this._emitPartial(map[entity]);
this._sectionStart = this._index + 1;
}
}
};
//parses legacy entities (without trailing semicolon)
Tokenizer.prototype._parseLegacyEntity = function(){
var start = this._sectionStart + 1,
limit = this._index - start;
if(limit > 6) limit = 6; //the max length of legacy entities is 6
while(limit >= 2){ //the min length of legacy entities is 2
var entity = this._buffer.substr(start, limit);
if(legacyMap.hasOwnProperty(entity)){
this._emitPartial(legacyMap[entity]);
this._sectionStart += limit + 1;
return;
} else {
limit--;
}
}
};
Tokenizer.prototype._stateInNamedEntity = function(c){
if(c === ";"){
this._parseNamedEntityStrict();
if(this._sectionStart + 1 < this._index && !this._xmlMode){
this._parseLegacyEntity();
}
this._state = this._baseState;
} else if((c < "a" || c > "z") && (c < "A" || c > "Z") && (c < "0" || c > "9")){
if(this._xmlMode);
else if(this._sectionStart + 1 === this._index);
else if(this._baseState !== TEXT){
if(c !== "="){
this._parseNamedEntityStrict();
}
} else {
this._parseLegacyEntity();
}
this._state = this._baseState;
this._index--;
}
};
Tokenizer.prototype._decodeNumericEntity = function(offset, base){
var sectionStart = this._sectionStart + offset;
if(sectionStart !== this._index){
//parse entity
var entity = this._buffer.substring(sectionStart, this._index);
var parsed = parseInt(entity, base);
this._emitPartial(decodeCodePoint(parsed));
this._sectionStart = this._index;
} else {
this._sectionStart--;
}
this._state = this._baseState;
};
Tokenizer.prototype._stateInNumericEntity = function(c){
if(c === ";"){
this._decodeNumericEntity(2, 10);
this._sectionStart++;
} else if(c < "0" || c > "9"){
if(!this._xmlMode){
this._decodeNumericEntity(2, 10);
} else {
this._state = this._baseState;
}
this._index--;
}
};
Tokenizer.prototype._stateInHexEntity = function(c){
if(c === ";"){
this._decodeNumericEntity(3, 16);
this._sectionStart++;
} else if((c < "a" || c > "f") && (c < "A" || c > "F") && (c < "0" || c > "9")){
if(!this._xmlMode){
this._decodeNumericEntity(3, 16);
} else {
this._state = this._baseState;
}
this._index--;
}
};
Tokenizer.prototype._cleanup = function (){
if(this._sectionStart < 0){
this._buffer = "";
this._index = 0;
this._bufferOffset += this._index;
} else if(this._running){
if(this._state === TEXT){
if(this._sectionStart !== this._index){
this._cbs.ontext(this._buffer.substr(this._sectionStart));
}
this._buffer = "";
this._index = 0;
this._bufferOffset += this._index;
} else if(this._sectionStart === this._index){
//the section just started
this._buffer = "";
this._index = 0;
this._bufferOffset += this._index;
} else {
//remove everything unnecessary
this._buffer = this._buffer.substr(this._sectionStart);
this._index -= this._sectionStart;
this._bufferOffset += this._sectionStart;
}
this._sectionStart = 0;
}
};
//TODO make events conditional
Tokenizer.prototype.write = function(chunk){
if(this._ended) this._cbs.onerror(Error(".write() after done!"));
this._buffer += chunk;
this._parse();
};
Tokenizer.prototype._parse = function(){
while(this._index < this._buffer.length && this._running){
var c = this._buffer.charAt(this._index);
if(this._state === TEXT) {
this._stateText(c);
} else if(this._state === BEFORE_TAG_NAME){
this._stateBeforeTagName(c);
} else if(this._state === IN_TAG_NAME) {
this._stateInTagName(c);
} else if(this._state === BEFORE_CLOSING_TAG_NAME){
this._stateBeforeCloseingTagName(c);
} else if(this._state === IN_CLOSING_TAG_NAME){
this._stateInCloseingTagName(c);
} else if(this._state === AFTER_CLOSING_TAG_NAME){
this._stateAfterCloseingTagName(c);
} else if(this._state === IN_SELF_CLOSING_TAG){
this._stateInSelfClosingTag(c);
}
/*
* attributes
*/
else if(this._state === BEFORE_ATTRIBUTE_NAME){
this._stateBeforeAttributeName(c);
} else if(this._state === IN_ATTRIBUTE_NAME){
this._stateInAttributeName(c);
} else if(this._state === AFTER_ATTRIBUTE_NAME){
this._stateAfterAttributeName(c);
} else if(this._state === BEFORE_ATTRIBUTE_VALUE){
this._stateBeforeAttributeValue(c);
} else if(this._state === IN_ATTRIBUTE_VALUE_DQ){
this._stateInAttributeValueDoubleQuotes(c);
} else if(this._state === IN_ATTRIBUTE_VALUE_SQ){
this._stateInAttributeValueSingleQuotes(c);
} else if(this._state === IN_ATTRIBUTE_VALUE_NQ){
this._stateInAttributeValueNoQuotes(c);
}
/*
* declarations
*/
else if(this._state === BEFORE_DECLARATION){
this._stateBeforeDeclaration(c);
} else if(this._state === IN_DECLARATION){
this._stateInDeclaration(c);
}
/*
* processing instructions
*/
else if(this._state === IN_PROCESSING_INSTRUCTION){
this._stateInProcessingInstruction(c);
}
/*
* comments
*/
else if(this._state === BEFORE_COMMENT){
this._stateBeforeComment(c);
} else if(this._state === IN_COMMENT){
this._stateInComment(c);
} else if(this._state === AFTER_COMMENT_1){
this._stateAfterComment1(c);
} else if(this._state === AFTER_COMMENT_2){
this._stateAfterComment2(c);
}
/*
* cdata
*/
else if(this._state === BEFORE_CDATA_1){
this._stateBeforeCdata1(c);
} else if(this._state === BEFORE_CDATA_2){
this._stateBeforeCdata2(c);
} else if(this._state === BEFORE_CDATA_3){
this._stateBeforeCdata3(c);
} else if(this._state === BEFORE_CDATA_4){
this._stateBeforeCdata4(c);
} else if(this._state === BEFORE_CDATA_5){
this._stateBeforeCdata5(c);
} else if(this._state === BEFORE_CDATA_6){
this._stateBeforeCdata6(c);
} else if(this._state === IN_CDATA){
this._stateInCdata(c);
} else if(this._state === AFTER_CDATA_1){
this._stateAfterCdata1(c);
} else if(this._state === AFTER_CDATA_2){
this._stateAfterCdata2(c);
}
/*
* special tags
*/
else if(this._state === BEFORE_SPECIAL){
this._stateBeforeSpecial(c);
} else if(this._state === BEFORE_SPECIAL_END){
this._stateBeforeSpecialEnd(c);
}
/*
* script
*/
else if(this._state === BEFORE_SCRIPT_1){
this._stateBeforeScript1(c);
} else if(this._state === BEFORE_SCRIPT_2){
this._stateBeforeScript2(c);
} else if(this._state === BEFORE_SCRIPT_3){
this._stateBeforeScript3(c);
} else if(this._state === BEFORE_SCRIPT_4){
this._stateBeforeScript4(c);
} else if(this._state === BEFORE_SCRIPT_5){
this._stateBeforeScript5(c);
}
else if(this._state === AFTER_SCRIPT_1){
this._stateAfterScript1(c);
} else if(this._state === AFTER_SCRIPT_2){
this._stateAfterScript2(c);
} else if(this._state === AFTER_SCRIPT_3){
this._stateAfterScript3(c);
} else if(this._state === AFTER_SCRIPT_4){
this._stateAfterScript4(c);
} else if(this._state === AFTER_SCRIPT_5){
this._stateAfterScript5(c);
}
/*
* style
*/
else if(this._state === BEFORE_STYLE_1){
this._stateBeforeStyle1(c);
} else if(this._state === BEFORE_STYLE_2){
this._stateBeforeStyle2(c);
} else if(this._state === BEFORE_STYLE_3){
this._stateBeforeStyle3(c);
} else if(this._state === BEFORE_STYLE_4){
this._stateBeforeStyle4(c);
}
else if(this._state === AFTER_STYLE_1){
this._stateAfterStyle1(c);
} else if(this._state === AFTER_STYLE_2){
this._stateAfterStyle2(c);
} else if(this._state === AFTER_STYLE_3){
this._stateAfterStyle3(c);
} else if(this._state === AFTER_STYLE_4){
this._stateAfterStyle4(c);
}
/*
* entities
*/
else if(this._state === BEFORE_ENTITY){
this._stateBeforeEntity(c);
} else if(this._state === BEFORE_NUMERIC_ENTITY){
this._stateBeforeNumericEntity(c);
} else if(this._state === IN_NAMED_ENTITY){
this._stateInNamedEntity(c);
} else if(this._state === IN_NUMERIC_ENTITY){
this._stateInNumericEntity(c);
} else if(this._state === IN_HEX_ENTITY){
this._stateInHexEntity(c);
}
else {
this._cbs.onerror(Error("unknown _state"), this._state);
}
this._index++;
}
this._cleanup();
};
Tokenizer.prototype.pause = function(){
this._running = false;
};
Tokenizer.prototype.resume = function(){
this._running = true;
if(this._index < this._buffer.length){
this._parse();
}
if(this._ended){
this._finish();
}
};
Tokenizer.prototype.end = function(chunk){
if(this._ended) this._cbs.onerror(Error(".end() after done!"));
if(chunk) this.write(chunk);
this._ended = true;
if(this._running) this._finish();
};
Tokenizer.prototype._finish = function(){
//if there is remaining data, emit it in a reasonable way
if(this._sectionStart < this._index){
this._handleTrailingData();
}
this._cbs.onend();
};
Tokenizer.prototype._handleTrailingData = function(){
var data = this._buffer.substr(this._sectionStart);
if(this._state === IN_CDATA || this._state === AFTER_CDATA_1 || this._state === AFTER_CDATA_2){
this._cbs.oncdata(data);
} else if(this._state === IN_COMMENT || this._state === AFTER_COMMENT_1 || this._state === AFTER_COMMENT_2){
this._cbs.oncomment(data);
} else if(this._state === IN_NAMED_ENTITY && !this._xmlMode){
this._parseLegacyEntity();
if(this._sectionStart < this._index){
this._state = this._baseState;
this._handleTrailingData();
}
} else if(this._state === IN_NUMERIC_ENTITY && !this._xmlMode){
this._decodeNumericEntity(2, 10);
if(this._sectionStart < this._index){
this._state = this._baseState;
this._handleTrailingData();
}
} else if(this._state === IN_HEX_ENTITY && !this._xmlMode){
this._decodeNumericEntity(3, 16);
if(this._sectionStart < this._index){
this._state = this._baseState;
this._handleTrailingData();
}
} else if(
this._state !== IN_TAG_NAME &&
this._state !== BEFORE_ATTRIBUTE_NAME &&
this._state !== BEFORE_ATTRIBUTE_VALUE &&
this._state !== AFTER_ATTRIBUTE_NAME &&
this._state !== IN_ATTRIBUTE_NAME &&
this._state !== IN_ATTRIBUTE_VALUE_SQ &&
this._state !== IN_ATTRIBUTE_VALUE_DQ &&
this._state !== IN_ATTRIBUTE_VALUE_NQ &&
this._state !== IN_CLOSING_TAG_NAME
){
this._cbs.ontext(data);
}
//else, ignore remaining data
//TODO add a way to remove current tag
};
Tokenizer.prototype.reset = function(){
Tokenizer.call(this, {xmlMode: this._xmlMode, decodeEntities: this._decodeEntities}, this._cbs);
};
Tokenizer.prototype.getAbsoluteIndex = function(){
return this._bufferOffset + this._index;
};
Tokenizer.prototype._getSection = function(){
return this._buffer.substring(this._sectionStart, this._index);
};
Tokenizer.prototype._emitToken = function(name){
this._cbs[name](this._getSection());
this._sectionStart = -1;
};
Tokenizer.prototype._emitPartial = function(value){
if(this._baseState !== TEXT){
this._cbs.onattribdata(value); //TODO implement the new event
} else {
this._cbs.ontext(value);
}
};
/***/ },
/* 44 */
/***/ function(module, exports, __webpack_require__) {
var decodeMap = __webpack_require__(45);
module.exports = decodeCodePoint;
// modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119
function decodeCodePoint(codePoint){
if((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF){
return "\uFFFD";
}
if(codePoint in decodeMap){
codePoint = decodeMap[codePoint];
}
var output = "";
if(codePoint > 0xFFFF){
codePoint -= 0x10000;
output += String.fromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);
codePoint = 0xDC00 | codePoint & 0x3FF;
}
output += String.fromCharCode(codePoint);
return output;
}
/***/ },
/* 45 */
/***/ function(module, exports) {
module.exports = {
"0": 65533,
"128": 8364,
"130": 8218,
"131": 402,
"132": 8222,
"133": 8230,
"134": 8224,
"135": 8225,
"136": 710,
"137": 8240,
"138": 352,
"139": 8249,
"140": 338,
"142": 381,
"145": 8216,
"146": 8217,
"147": 8220,
"148": 8221,
"149": 8226,
"150": 8211,
"151": 8212,
"152": 732,
"153": 8482,
"154": 353,
"155": 8250,
"156": 339,
"158": 382,
"159": 376
};
/***/ },
/* 46 */
/***/ function(module, exports) {
module.exports = {
"Aacute": "Á",
"aacute": "á",
"Abreve": "Ă",
"abreve": "ă",
"ac": "∾",
"acd": "∿",
"acE": "∾̳",
"Acirc": "Â",
"acirc": "â",
"acute": "´",
"Acy": "А",
"acy": "а",
"AElig": "Æ",
"aelig": "æ",
"af": "",
"Afr": "𝔄",
"afr": "𝔞",
"Agrave": "À",
"agrave": "à",
"alefsym": "ℵ",
"aleph": "ℵ",
"Alpha": "Α",
"alpha": "α",
"Amacr": "Ā",
"amacr": "ā",
"amalg": "⨿",
"amp": "&",
"AMP": "&",
"andand": "⩕",
"And": "⩓",
"and": "∧",
"andd": "⩜",
"andslope": "⩘",
"andv": "⩚",
"ang": "∠",
"ange": "⦤",
"angle": "∠",
"angmsdaa": "⦨",
"angmsdab": "⦩",
"angmsdac": "⦪",
"angmsdad": "⦫",
"angmsdae": "⦬",
"angmsdaf": "⦭",
"angmsdag": "⦮",
"angmsdah": "⦯",
"angmsd": "∡",
"angrt": "∟",
"angrtvb": "⊾",
"angrtvbd": "⦝",
"angsph": "∢",
"angst": "Å",
"angzarr": "⍼",
"Aogon": "Ą",
"aogon": "ą",
"Aopf": "𝔸",
"aopf": "𝕒",
"apacir": "⩯",
"ap": "≈",
"apE": "⩰",
"ape": "≊",
"apid": "≋",
"apos": "'",
"ApplyFunction": "",
"approx": "≈",
"approxeq": "≊",
"Aring": "Å",
"aring": "å",
"Ascr": "𝒜",
"ascr": "𝒶",
"Assign": "≔",
"ast": "*",
"asymp": "≈",
"asympeq": "≍",
"Atilde": "Ã",
"atilde": "ã",
"Auml": "Ä",
"auml": "ä",
"awconint": "∳",
"awint": "⨑",
"backcong": "≌",
"backepsilon": "϶",
"backprime": "‵",
"backsim": "∽",
"backsimeq": "⋍",
"Backslash": "∖",
"Barv": "⫧",
"barvee": "⊽",
"barwed": "⌅",
"Barwed": "⌆",
"barwedge": "⌅",
"bbrk": "⎵",
"bbrktbrk": "⎶",
"bcong": "≌",
"Bcy": "Б",
"bcy": "б",
"bdquo": "„",
"becaus": "∵",
"because": "∵",
"Because": "∵",
"bemptyv": "⦰",
"bepsi": "϶",
"bernou": "ℬ",
"Bernoullis": "ℬ",
"Beta": "Β",
"beta": "β",
"beth": "ℶ",
"between": "≬",
"Bfr": "𝔅",
"bfr": "𝔟",
"bigcap": "⋂",
"bigcirc": "◯",
"bigcup": "⋃",
"bigodot": "⨀",
"bigoplus": "⨁",
"bigotimes": "⨂",
"bigsqcup": "⨆",
"bigstar": "★",
"bigtriangledown": "▽",
"bigtriangleup": "△",
"biguplus": "⨄",
"bigvee": "⋁",
"bigwedge": "⋀",
"bkarow": "⤍",
"blacklozenge": "⧫",
"blacksquare": "▪",
"blacktriangle": "▴",
"blacktriangledown": "▾",
"blacktriangleleft": "◂",
"blacktriangleright": "▸",
"blank": "␣",
"blk12": "▒",
"blk14": "░",
"blk34": "▓",
"block": "█",
"bne": "=⃥",
"bnequiv": "≡⃥",
"bNot": "⫭",
"bnot": "⌐",
"Bopf": "𝔹",
"bopf": "𝕓",
"bot": "⊥",
"bottom": "⊥",
"bowtie": "⋈",
"boxbox": "⧉",
"boxdl": "┐",
"boxdL": "╕",
"boxDl": "╖",
"boxDL": "╗",
"boxdr": "┌",
"boxdR": "╒",
"boxDr": "╓",
"boxDR": "╔",
"boxh": "─",
"boxH": "═",
"boxhd": "┬",
"boxHd": "╤",
"boxhD": "╥",
"boxHD": "╦",
"boxhu": "┴",
"boxHu": "╧",
"boxhU": "╨",
"boxHU": "╩",
"boxminus": "⊟",
"boxplus": "⊞",
"boxtimes": "⊠",
"boxul": "┘",
"boxuL": "╛",
"boxUl": "╜",
"boxUL": "╝",
"boxur": "└",
"boxuR": "╘",
"boxUr": "╙",
"boxUR": "╚",
"boxv": "│",
"boxV": "║",
"boxvh": "┼",
"boxvH": "╪",
"boxVh": "╫",
"boxVH": "╬",
"boxvl": "┤",
"boxvL": "╡",
"boxVl": "╢",
"boxVL": "╣",
"boxvr": "├",
"boxvR": "╞",
"boxVr": "╟",
"boxVR": "╠",
"bprime": "‵",
"breve": "˘",
"Breve": "˘",
"brvbar": "¦",
"bscr": "𝒷",
"Bscr": "ℬ",
"bsemi": "⁏",
"bsim": "∽",
"bsime": "⋍",
"bsolb": "⧅",
"bsol": "\\",
"bsolhsub": "⟈",
"bull": "•",
"bullet": "•",
"bump": "≎",
"bumpE": "⪮",
"bumpe": "≏",
"Bumpeq": "≎",
"bumpeq": "≏",
"Cacute": "Ć",
"cacute": "ć",
"capand": "⩄",
"capbrcup": "⩉",
"capcap": "⩋",
"cap": "∩",
"Cap": "⋒",
"capcup": "⩇",
"capdot": "⩀",
"CapitalDifferentialD": "ⅅ",
"caps": "∩︀",
"caret": "⁁",
"caron": "ˇ",
"Cayleys": "ℭ",
"ccaps": "⩍",
"Ccaron": "Č",
"ccaron": "č",
"Ccedil": "Ç",
"ccedil": "ç",
"Ccirc": "Ĉ",
"ccirc": "ĉ",
"Cconint": "∰",
"ccups": "⩌",
"ccupssm": "⩐",
"Cdot": "Ċ",
"cdot": "ċ",
"cedil": "¸",
"Cedilla": "¸",
"cemptyv": "⦲",
"cent": "¢",
"centerdot": "·",
"CenterDot": "·",
"cfr": "𝔠",
"Cfr": "ℭ",
"CHcy": "Ч",
"chcy": "ч",
"check": "✓",
"checkmark": "✓",
"Chi": "Χ",
"chi": "χ",
"circ": "ˆ",
"circeq": "≗",
"circlearrowleft": "↺",
"circlearrowright": "↻",
"circledast": "⊛",
"circledcirc": "⊚",
"circleddash": "⊝",
"CircleDot": "⊙",
"circledR": "®",
"circledS": "Ⓢ",
"CircleMinus": "⊖",
"CirclePlus": "⊕",
"CircleTimes": "⊗",
"cir": "○",
"cirE": "⧃",
"cire": "≗",
"cirfnint": "⨐",
"cirmid": "⫯",
"cirscir": "⧂",
"ClockwiseContourIntegral": "∲",
"CloseCurlyDoubleQuote": "”",
"CloseCurlyQuote": "’",
"clubs": "♣",
"clubsuit": "♣",
"colon": ":",
"Colon": "∷",
"Colone": "⩴",
"colone": "≔",
"coloneq": "≔",
"comma": ",",
"commat": "@",
"comp": "∁",
"compfn": "∘",
"complement": "∁",
"complexes": "ℂ",
"cong": "≅",
"congdot": "⩭",
"Congruent": "≡",
"conint": "∮",
"Conint": "∯",
"ContourIntegral": "∮",
"copf": "𝕔",
"Copf": "ℂ",
"coprod": "∐",
"Coproduct": "∐",
"copy": "©",
"COPY": "©",
"copysr": "℗",
"CounterClockwiseContourIntegral": "∳",
"crarr": "↵",
"cross": "✗",
"Cross": "⨯",
"Cscr": "𝒞",
"cscr": "𝒸",
"csub": "⫏",
"csube": "⫑",
"csup": "⫐",
"csupe": "⫒",
"ctdot": "⋯",
"cudarrl": "⤸",
"cudarrr": "⤵",
"cuepr": "⋞",
"cuesc": "⋟",
"cularr": "↶",
"cularrp": "⤽",
"cupbrcap": "⩈",
"cupcap": "⩆",
"CupCap": "≍",
"cup": "∪",
"Cup": "⋓",
"cupcup": "⩊",
"cupdot": "⊍",
"cupor": "⩅",
"cups": "∪︀",
"curarr": "↷",
"curarrm": "⤼",
"curlyeqprec": "⋞",
"curlyeqsucc": "⋟",
"curlyvee": "⋎",
"curlywedge": "⋏",
"curren": "¤",
"curvearrowleft": "↶",
"curvearrowright": "↷",
"cuvee": "⋎",
"cuwed": "⋏",
"cwconint": "∲",
"cwint": "∱",
"cylcty": "⌭",
"dagger": "†",
"Dagger": "‡",
"daleth": "ℸ",
"darr": "↓",
"Darr": "↡",
"dArr": "⇓",
"dash": "‐",
"Dashv": "⫤",
"dashv": "⊣",
"dbkarow": "⤏",
"dblac": "˝",
"Dcaron": "Ď",
"dcaron": "ď",
"Dcy": "Д",
"dcy": "д",
"ddagger": "‡",
"ddarr": "⇊",
"DD": "ⅅ",
"dd": "ⅆ",
"DDotrahd": "⤑",
"ddotseq": "⩷",
"deg": "°",
"Del": "∇",
"Delta": "Δ",
"delta": "δ",
"demptyv": "⦱",
"dfisht": "⥿",
"Dfr": "𝔇",
"dfr": "𝔡",
"dHar": "⥥",
"dharl": "⇃",
"dharr": "⇂",
"DiacriticalAcute": "´",
"DiacriticalDot": "˙",
"DiacriticalDoubleAcute": "˝",
"DiacriticalGrave": "`",
"DiacriticalTilde": "˜",
"diam": "⋄",
"diamond": "⋄",
"Diamond": "⋄",
"diamondsuit": "♦",
"diams": "♦",
"die": "¨",
"DifferentialD": "ⅆ",
"digamma": "ϝ",
"disin": "⋲",
"div": "÷",
"divide": "÷",
"divideontimes": "⋇",
"divonx": "⋇",
"DJcy": "Ђ",
"djcy": "ђ",
"dlcorn": "⌞",
"dlcrop": "⌍",
"dollar": "$",
"Dopf": "𝔻",
"dopf": "𝕕",
"Dot": "¨",
"dot": "˙",
"DotDot": "⃜",
"doteq": "≐",
"doteqdot": "≑",
"DotEqual": "≐",
"dotminus": "∸",
"dotplus": "∔",
"dotsquare": "⊡",
"doublebarwedge": "⌆",
"DoubleContourIntegral": "∯",
"DoubleDot": "¨",
"DoubleDownArrow": "⇓",
"DoubleLeftArrow": "⇐",
"DoubleLeftRightArrow": "⇔",
"DoubleLeftTee": "⫤",
"DoubleLongLeftArrow": "⟸",
"DoubleLongLeftRightArrow": "⟺",
"DoubleLongRightArrow": "⟹",
"DoubleRightArrow": "⇒",
"DoubleRightTee": "⊨",
"DoubleUpArrow": "⇑",
"DoubleUpDownArrow": "⇕",
"DoubleVerticalBar": "∥",
"DownArrowBar": "⤓",
"downarrow": "↓",
"DownArrow": "↓",
"Downarrow": "⇓",
"DownArrowUpArrow": "⇵",
"DownBreve": "̑",
"downdownarrows": "⇊",
"downharpoonleft": "⇃",
"downharpoonright": "⇂",
"DownLeftRightVector": "⥐",
"DownLeftTeeVector": "⥞",
"DownLeftVectorBar": "⥖",
"DownLeftVector": "↽",
"DownRightTeeVector": "⥟",
"DownRightVectorBar": "⥗",
"DownRightVector": "⇁",
"DownTeeArrow": "↧",
"DownTee": "⊤",
"drbkarow": "⤐",
"drcorn": "⌟",
"drcrop": "⌌",
"Dscr": "𝒟",
"dscr": "𝒹",
"DScy": "Ѕ",
"dscy": "ѕ",
"dsol": "⧶",
"Dstrok": "Đ",
"dstrok": "đ",
"dtdot": "⋱",
"dtri": "▿",
"dtrif": "▾",
"duarr": "⇵",
"duhar": "⥯",
"dwangle": "⦦",
"DZcy": "Џ",
"dzcy": "џ",
"dzigrarr": "⟿",
"Eacute": "É",
"eacute": "é",
"easter": "⩮",
"Ecaron": "Ě",
"ecaron": "ě",
"Ecirc": "Ê",
"ecirc": "ê",
"ecir": "≖",
"ecolon": "≕",
"Ecy": "Э",
"ecy": "э",
"eDDot": "⩷",
"Edot": "Ė",
"edot": "ė",
"eDot": "≑",
"ee": "ⅇ",
"efDot": "≒",
"Efr": "𝔈",
"efr": "𝔢",
"eg": "⪚",
"Egrave": "È",
"egrave": "è",
"egs": "⪖",
"egsdot": "⪘",
"el": "⪙",
"Element": "∈",
"elinters": "⏧",
"ell": "ℓ",
"els": "⪕",
"elsdot": "⪗",
"Emacr": "Ē",
"emacr": "ē",
"empty": "∅",
"emptyset": "∅",
"EmptySmallSquare": "◻",
"emptyv": "∅",
"EmptyVerySmallSquare": "▫",
"emsp13": " ",
"emsp14": " ",
"emsp": " ",
"ENG": "Ŋ",
"eng": "ŋ",
"ensp": " ",
"Eogon": "Ę",
"eogon": "ę",
"Eopf": "𝔼",
"eopf": "𝕖",
"epar": "⋕",
"eparsl": "⧣",
"eplus": "⩱",
"epsi": "ε",
"Epsilon": "Ε",
"epsilon": "ε",
"epsiv": "ϵ",
"eqcirc": "≖",
"eqcolon": "≕",
"eqsim": "≂",
"eqslantgtr": "⪖",
"eqslantless": "⪕",
"Equal": "⩵",
"equals": "=",
"EqualTilde": "≂",
"equest": "≟",
"Equilibrium": "⇌",
"equiv": "≡",
"equivDD": "⩸",
"eqvparsl": "⧥",
"erarr": "⥱",
"erDot": "≓",
"escr": "ℯ",
"Escr": "ℰ",
"esdot": "≐",
"Esim": "⩳",
"esim": "≂",
"Eta": "Η",
"eta": "η",
"ETH": "Ð",
"eth": "ð",
"Euml": "Ë",
"euml": "ë",
"euro": "€",
"excl": "!",
"exist": "∃",
"Exists": "∃",
"expectation": "ℰ",
"exponentiale": "ⅇ",
"ExponentialE": "ⅇ",
"fallingdotseq": "≒",
"Fcy": "Ф",
"fcy": "ф",
"female": "♀",
"ffilig": "ffi",
"fflig": "ff",
"ffllig": "ffl",
"Ffr": "𝔉",
"ffr": "𝔣",
"filig": "fi",
"FilledSmallSquare": "◼",
"FilledVerySmallSquare": "▪",
"fjlig": "fj",
"flat": "♭",
"fllig": "fl",
"fltns": "▱",
"fnof": "ƒ",
"Fopf": "𝔽",
"fopf": "𝕗",
"forall": "∀",
"ForAll": "∀",
"fork": "⋔",
"forkv": "⫙",
"Fouriertrf": "ℱ",
"fpartint": "⨍",
"frac12": "½",
"frac13": "⅓",
"frac14": "¼",
"frac15": "⅕",
"frac16": "⅙",
"frac18": "⅛",
"frac23": "⅔",
"frac25": "⅖",
"frac34": "¾",
"frac35": "⅗",
"frac38": "⅜",
"frac45": "⅘",
"frac56": "⅚",
"frac58": "⅝",
"frac78": "⅞",
"frasl": "⁄",
"frown": "⌢",
"fscr": "𝒻",
"Fscr": "ℱ",
"gacute": "ǵ",
"Gamma": "Γ",
"gamma": "γ",
"Gammad": "Ϝ",
"gammad": "ϝ",
"gap": "⪆",
"Gbreve": "Ğ",
"gbreve": "ğ",
"Gcedil": "Ģ",
"Gcirc": "Ĝ",
"gcirc": "ĝ",
"Gcy": "Г",
"gcy": "г",
"Gdot": "Ġ",
"gdot": "ġ",
"ge": "≥",
"gE": "≧",
"gEl": "⪌",
"gel": "⋛",
"geq": "≥",
"geqq": "≧",
"geqslant": "⩾",
"gescc": "⪩",
"ges": "⩾",
"gesdot": "⪀",
"gesdoto": "⪂",
"gesdotol": "⪄",
"gesl": "⋛︀",
"gesles": "⪔",
"Gfr": "𝔊",
"gfr": "𝔤",
"gg": "≫",
"Gg": "⋙",
"ggg": "⋙",
"gimel": "ℷ",
"GJcy": "Ѓ",
"gjcy": "ѓ",
"gla": "⪥",
"gl": "≷",
"glE": "⪒",
"glj": "⪤",
"gnap": "⪊",
"gnapprox": "⪊",
"gne": "⪈",
"gnE": "≩",
"gneq": "⪈",
"gneqq": "≩",
"gnsim": "⋧",
"Gopf": "𝔾",
"gopf": "𝕘",
"grave": "`",
"GreaterEqual": "≥",
"GreaterEqualLess": "⋛",
"GreaterFullEqual": "≧",
"GreaterGreater": "⪢",
"GreaterLess": "≷",
"GreaterSlantEqual": "⩾",
"GreaterTilde": "≳",
"Gscr": "𝒢",
"gscr": "ℊ",
"gsim": "≳",
"gsime": "⪎",
"gsiml": "⪐",
"gtcc": "⪧",
"gtcir": "⩺",
"gt": ">",
"GT": ">",
"Gt": "≫",
"gtdot": "⋗",
"gtlPar": "⦕",
"gtquest": "⩼",
"gtrapprox": "⪆",
"gtrarr": "⥸",
"gtrdot": "⋗",
"gtreqless": "⋛",
"gtreqqless": "⪌",
"gtrless": "≷",
"gtrsim": "≳",
"gvertneqq": "≩︀",
"gvnE": "≩︀",
"Hacek": "ˇ",
"hairsp": " ",
"half": "½",
"hamilt": "ℋ",
"HARDcy": "Ъ",
"hardcy": "ъ",
"harrcir": "⥈",
"harr": "↔",
"hArr": "⇔",
"harrw": "↭",
"Hat": "^",
"hbar": "ℏ",
"Hcirc": "Ĥ",
"hcirc": "ĥ",
"hearts": "♥",
"heartsuit": "♥",
"hellip": "…",
"hercon": "⊹",
"hfr": "𝔥",
"Hfr": "ℌ",
"HilbertSpace": "ℋ",
"hksearow": "⤥",
"hkswarow": "⤦",
"hoarr": "⇿",
"homtht": "∻",
"hookleftarrow": "↩",
"hookrightarrow": "↪",
"hopf": "𝕙",
"Hopf": "ℍ",
"horbar": "―",
"HorizontalLine": "─",
"hscr": "𝒽",
"Hscr": "ℋ",
"hslash": "ℏ",
"Hstrok": "Ħ",
"hstrok": "ħ",
"HumpDownHump": "≎",
"HumpEqual": "≏",
"hybull": "⁃",
"hyphen": "‐",
"Iacute": "Í",
"iacute": "í",
"ic": "",
"Icirc": "Î",
"icirc": "î",
"Icy": "И",
"icy": "и",
"Idot": "İ",
"IEcy": "Е",
"iecy": "е",
"iexcl": "¡",
"iff": "⇔",
"ifr": "𝔦",
"Ifr": "ℑ",
"Igrave": "Ì",
"igrave": "ì",
"ii": "ⅈ",
"iiiint": "⨌",
"iiint": "∭",
"iinfin": "⧜",
"iiota": "℩",
"IJlig": "IJ",
"ijlig": "ij",
"Imacr": "Ī",
"imacr": "ī",
"image": "ℑ",
"ImaginaryI": "ⅈ",
"imagline": "ℐ",
"imagpart": "ℑ",
"imath": "ı",
"Im": "ℑ",
"imof": "⊷",
"imped": "Ƶ",
"Implies": "⇒",
"incare": "℅",
"in": "∈",
"infin": "∞",
"infintie": "⧝",
"inodot": "ı",
"intcal": "⊺",
"int": "∫",
"Int": "∬",
"integers": "ℤ",
"Integral": "∫",
"intercal": "⊺",
"Intersection": "⋂",
"intlarhk": "⨗",
"intprod": "⨼",
"InvisibleComma": "",
"InvisibleTimes": "",
"IOcy": "Ё",
"iocy": "ё",
"Iogon": "Į",
"iogon": "į",
"Iopf": "𝕀",
"iopf": "𝕚",
"Iota": "Ι",
"iota": "ι",
"iprod": "⨼",
"iquest": "¿",
"iscr": "𝒾",
"Iscr": "ℐ",
"isin": "∈",
"isindot": "⋵",
"isinE": "⋹",
"isins": "⋴",
"isinsv": "⋳",
"isinv": "∈",
"it": "",
"Itilde": "Ĩ",
"itilde": "ĩ",
"Iukcy": "І",
"iukcy": "і",
"Iuml": "Ï",
"iuml": "ï",
"Jcirc": "Ĵ",
"jcirc": "ĵ",
"Jcy": "Й",
"jcy": "й",
"Jfr": "𝔍",
"jfr": "𝔧",
"jmath": "ȷ",
"Jopf": "𝕁",
"jopf": "𝕛",
"Jscr": "𝒥",
"jscr": "𝒿",
"Jsercy": "Ј",
"jsercy": "ј",
"Jukcy": "Є",
"jukcy": "є",
"Kappa": "Κ",
"kappa": "κ",
"kappav": "ϰ",
"Kcedil": "Ķ",
"kcedil": "ķ",
"Kcy": "К",
"kcy": "к",
"Kfr": "𝔎",
"kfr": "𝔨",
"kgreen": "ĸ",
"KHcy": "Х",
"khcy": "х",
"KJcy": "Ќ",
"kjcy": "ќ",
"Kopf": "𝕂",
"kopf": "𝕜",
"Kscr": "𝒦",
"kscr": "𝓀",
"lAarr": "⇚",
"Lacute": "Ĺ",
"lacute": "ĺ",
"laemptyv": "⦴",
"lagran": "ℒ",
"Lambda": "Λ",
"lambda": "λ",
"lang": "⟨",
"Lang": "⟪",
"langd": "⦑",
"langle": "⟨",
"lap": "⪅",
"Laplacetrf": "ℒ",
"laquo": "«",
"larrb": "⇤",
"larrbfs": "⤟",
"larr": "←",
"Larr": "↞",
"lArr": "⇐",
"larrfs": "⤝",
"larrhk": "↩",
"larrlp": "↫",
"larrpl": "⤹",
"larrsim": "⥳",
"larrtl": "↢",
"latail": "⤙",
"lAtail": "⤛",
"lat": "⪫",
"late": "⪭",
"lates": "⪭︀",
"lbarr": "⤌",
"lBarr": "⤎",
"lbbrk": "❲",
"lbrace": "{",
"lbrack": "[",
"lbrke": "⦋",
"lbrksld": "⦏",
"lbrkslu": "⦍",
"Lcaron": "Ľ",
"lcaron": "ľ",
"Lcedil": "Ļ",
"lcedil": "ļ",
"lceil": "⌈",
"lcub": "{",
"Lcy": "Л",
"lcy": "л",
"ldca": "⤶",
"ldquo": "“",
"ldquor": "„",
"ldrdhar": "⥧",
"ldrushar": "⥋",
"ldsh": "↲",
"le": "≤",
"lE": "≦",
"LeftAngleBracket": "⟨",
"LeftArrowBar": "⇤",
"leftarrow": "←",
"LeftArrow": "←",
"Leftarrow": "⇐",
"LeftArrowRightArrow": "⇆",
"leftarrowtail": "↢",
"LeftCeiling": "⌈",
"LeftDoubleBracket": "⟦",
"LeftDownTeeVector": "⥡",
"LeftDownVectorBar": "⥙",
"LeftDownVector": "⇃",
"LeftFloor": "⌊",
"leftharpoondown": "↽",
"leftharpoonup": "↼",
"leftleftarrows": "⇇",
"leftrightarrow": "↔",
"LeftRightArrow": "↔",
"Leftrightarrow": "⇔",
"leftrightarrows": "⇆",
"leftrightharpoons": "⇋",
"leftrightsquigarrow": "↭",
"LeftRightVector": "⥎",
"LeftTeeArrow": "↤",
"LeftTee": "⊣",
"LeftTeeVector": "⥚",
"leftthreetimes": "⋋",
"LeftTriangleBar": "⧏",
"LeftTriangle": "⊲",
"LeftTriangleEqual": "⊴",
"LeftUpDownVector": "⥑",
"LeftUpTeeVector": "⥠",
"LeftUpVectorBar": "⥘",
"LeftUpVector": "↿",
"LeftVectorBar": "⥒",
"LeftVector": "↼",
"lEg": "⪋",
"leg": "⋚",
"leq": "≤",
"leqq": "≦",
"leqslant": "⩽",
"lescc": "⪨",
"les": "⩽",
"lesdot": "⩿",
"lesdoto": "⪁",
"lesdotor": "⪃",
"lesg": "⋚︀",
"lesges": "⪓",
"lessapprox": "⪅",
"lessdot": "⋖",
"lesseqgtr": "⋚",
"lesseqqgtr": "⪋",
"LessEqualGreater": "⋚",
"LessFullEqual": "≦",
"LessGreater": "≶",
"lessgtr": "≶",
"LessLess": "⪡",
"lesssim": "≲",
"LessSlantEqual": "⩽",
"LessTilde": "≲",
"lfisht": "⥼",
"lfloor": "⌊",
"Lfr": "𝔏",
"lfr": "𝔩",
"lg": "≶",
"lgE": "⪑",
"lHar": "⥢",
"lhard": "↽",
"lharu": "↼",
"lharul": "⥪",
"lhblk": "▄",
"LJcy": "Љ",
"ljcy": "љ",
"llarr": "⇇",
"ll": "≪",
"Ll": "⋘",
"llcorner": "⌞",
"Lleftarrow": "⇚",
"llhard": "⥫",
"lltri": "◺",
"Lmidot": "Ŀ",
"lmidot": "ŀ",
"lmoustache": "⎰",
"lmoust": "⎰",
"lnap": "⪉",
"lnapprox": "⪉",
"lne": "⪇",
"lnE": "≨",
"lneq": "⪇",
"lneqq": "≨",
"lnsim": "⋦",
"loang": "⟬",
"loarr": "⇽",
"lobrk": "⟦",
"longleftarrow": "⟵",
"LongLeftArrow": "⟵",
"Longleftarrow": "⟸",
"longleftrightarrow": "⟷",
"LongLeftRightArrow": "⟷",
"Longleftrightarrow": "⟺",
"longmapsto": "⟼",
"longrightarrow": "⟶",
"LongRightArrow": "⟶",
"Longrightarrow": "⟹",
"looparrowleft": "↫",
"looparrowright": "↬",
"lopar": "⦅",
"Lopf": "𝕃",
"lopf": "𝕝",
"loplus": "⨭",
"lotimes": "⨴",
"lowast": "∗",
"lowbar": "_",
"LowerLeftArrow": "↙",
"LowerRightArrow": "↘",
"loz": "◊",
"lozenge": "◊",
"lozf": "⧫",
"lpar": "(",
"lparlt": "⦓",
"lrarr": "⇆",
"lrcorner": "⌟",
"lrhar": "⇋",
"lrhard": "⥭",
"lrm": "",
"lrtri": "⊿",
"lsaquo": "‹",
"lscr": "𝓁",
"Lscr": "ℒ",
"lsh": "↰",
"Lsh": "↰",
"lsim": "≲",
"lsime": "⪍",
"lsimg": "⪏",
"lsqb": "[",
"lsquo": "‘",
"lsquor": "‚",
"Lstrok": "Ł",
"lstrok": "ł",
"ltcc": "⪦",
"ltcir": "⩹",
"lt": "<",
"LT": "<",
"Lt": "≪",
"ltdot": "⋖",
"lthree": "⋋",
"ltimes": "⋉",
"ltlarr": "⥶",
"ltquest": "⩻",
"ltri": "◃",
"ltrie": "⊴",
"ltrif": "◂",
"ltrPar": "⦖",
"lurdshar": "⥊",
"luruhar": "⥦",
"lvertneqq": "≨︀",
"lvnE": "≨︀",
"macr": "¯",
"male": "♂",
"malt": "✠",
"maltese": "✠",
"Map": "⤅",
"map": "↦",
"mapsto": "↦",
"mapstodown": "↧",
"mapstoleft": "↤",
"mapstoup": "↥",
"marker": "▮",
"mcomma": "⨩",
"Mcy": "М",
"mcy": "м",
"mdash": "—",
"mDDot": "∺",
"measuredangle": "∡",
"MediumSpace": " ",
"Mellintrf": "ℳ",
"Mfr": "𝔐",
"mfr": "𝔪",
"mho": "℧",
"micro": "µ",
"midast": "*",
"midcir": "⫰",
"mid": "∣",
"middot": "·",
"minusb": "⊟",
"minus": "−",
"minusd": "∸",
"minusdu": "⨪",
"MinusPlus": "∓",
"mlcp": "⫛",
"mldr": "…",
"mnplus": "∓",
"models": "⊧",
"Mopf": "𝕄",
"mopf": "𝕞",
"mp": "∓",
"mscr": "𝓂",
"Mscr": "ℳ",
"mstpos": "∾",
"Mu": "Μ",
"mu": "μ",
"multimap": "⊸",
"mumap": "⊸",
"nabla": "∇",
"Nacute": "Ń",
"nacute": "ń",
"nang": "∠⃒",
"nap": "≉",
"napE": "⩰̸",
"napid": "≋̸",
"napos": "ʼn",
"napprox": "≉",
"natural": "♮",
"naturals": "ℕ",
"natur": "♮",
"nbsp": " ",
"nbump": "≎̸",
"nbumpe": "≏̸",
"ncap": "⩃",
"Ncaron": "Ň",
"ncaron": "ň",
"Ncedil": "Ņ",
"ncedil": "ņ",
"ncong": "≇",
"ncongdot": "⩭̸",
"ncup": "⩂",
"Ncy": "Н",
"ncy": "н",
"ndash": "–",
"nearhk": "⤤",
"nearr": "↗",
"neArr": "⇗",
"nearrow": "↗",
"ne": "≠",
"nedot": "≐̸",
"NegativeMediumSpace": "",
"NegativeThickSpace": "",
"NegativeThinSpace": "",
"NegativeVeryThinSpace": "",
"nequiv": "≢",
"nesear": "⤨",
"nesim": "≂̸",
"NestedGreaterGreater": "≫",
"NestedLessLess": "≪",
"NewLine": "\n",
"nexist": "∄",
"nexists": "∄",
"Nfr": "𝔑",
"nfr": "𝔫",
"ngE": "≧̸",
"nge": "≱",
"ngeq": "≱",
"ngeqq": "≧̸",
"ngeqslant": "⩾̸",
"nges": "⩾̸",
"nGg": "⋙̸",
"ngsim": "≵",
"nGt": "≫⃒",
"ngt": "≯",
"ngtr": "≯",
"nGtv": "≫̸",
"nharr": "↮",
"nhArr": "⇎",
"nhpar": "⫲",
"ni": "∋",
"nis": "⋼",
"nisd": "⋺",
"niv": "∋",
"NJcy": "Њ",
"njcy": "њ",
"nlarr": "↚",
"nlArr": "⇍",
"nldr": "‥",
"nlE": "≦̸",
"nle": "≰",
"nleftarrow": "↚",
"nLeftarrow": "⇍",
"nleftrightarrow": "↮",
"nLeftrightarrow": "⇎",
"nleq": "≰",
"nleqq": "≦̸",
"nleqslant": "⩽̸",
"nles": "⩽̸",
"nless": "≮",
"nLl": "⋘̸",
"nlsim": "≴",
"nLt": "≪⃒",
"nlt": "≮",
"nltri": "⋪",
"nltrie": "⋬",
"nLtv": "≪̸",
"nmid": "∤",
"NoBreak": "",
"NonBreakingSpace": " ",
"nopf": "𝕟",
"Nopf": "ℕ",
"Not": "⫬",
"not": "¬",
"NotCongruent": "≢",
"NotCupCap": "≭",
"NotDoubleVerticalBar": "∦",
"NotElement": "∉",
"NotEqual": "≠",
"NotEqualTilde": "≂̸",
"NotExists": "∄",
"NotGreater": "≯",
"NotGreaterEqual": "≱",
"NotGreaterFullEqual": "≧̸",
"NotGreaterGreater": "≫̸",
"NotGreaterLess": "≹",
"NotGreaterSlantEqual": "⩾̸",
"NotGreaterTilde": "≵",
"NotHumpDownHump": "≎̸",
"NotHumpEqual": "≏̸",
"notin": "∉",
"notindot": "⋵̸",
"notinE": "⋹̸",
"notinva": "∉",
"notinvb": "⋷",
"notinvc": "⋶",
"NotLeftTriangleBar": "⧏̸",
"NotLeftTriangle": "⋪",
"NotLeftTriangleEqual": "⋬",
"NotLess": "≮",
"NotLessEqual": "≰",
"NotLessGreater": "≸",
"NotLessLess": "≪̸",
"NotLessSlantEqual": "⩽̸",
"NotLessTilde": "≴",
"NotNestedGreaterGreater": "⪢̸",
"NotNestedLessLess": "⪡̸",
"notni": "∌",
"notniva": "∌",
"notnivb": "⋾",
"notnivc": "⋽",
"NotPrecedes": "⊀",
"NotPrecedesEqual": "⪯̸",
"NotPrecedesSlantEqual": "⋠",
"NotReverseElement": "∌",
"NotRightTriangleBar": "⧐̸",
"NotRightTriangle": "⋫",
"NotRightTriangleEqual": "⋭",
"NotSquareSubset": "⊏̸",
"NotSquareSubsetEqual": "⋢",
"NotSquareSuperset": "⊐̸",
"NotSquareSupersetEqual": "⋣",
"NotSubset": "⊂⃒",
"NotSubsetEqual": "⊈",
"NotSucceeds": "⊁",
"NotSucceedsEqual": "⪰̸",
"NotSucceedsSlantEqual": "⋡",
"NotSucceedsTilde": "≿̸",
"NotSuperset": "⊃⃒",
"NotSupersetEqual": "⊉",
"NotTilde": "≁",
"NotTildeEqual": "≄",
"NotTildeFullEqual": "≇",
"NotTildeTilde": "≉",
"NotVerticalBar": "∤",
"nparallel": "∦",
"npar": "∦",
"nparsl": "⫽⃥",
"npart": "∂̸",
"npolint": "⨔",
"npr": "⊀",
"nprcue": "⋠",
"nprec": "⊀",
"npreceq": "⪯̸",
"npre": "⪯̸",
"nrarrc": "⤳̸",
"nrarr": "↛",
"nrArr": "⇏",
"nrarrw": "↝̸",
"nrightarrow": "↛",
"nRightarrow": "⇏",
"nrtri": "⋫",
"nrtrie": "⋭",
"nsc": "⊁",
"nsccue": "⋡",
"nsce": "⪰̸",
"Nscr": "𝒩",
"nscr": "𝓃",
"nshortmid": "∤",
"nshortparallel": "∦",
"nsim": "≁",
"nsime": "≄",
"nsimeq": "≄",
"nsmid": "∤",
"nspar": "∦",
"nsqsube": "⋢",
"nsqsupe": "⋣",
"nsub": "⊄",
"nsubE": "⫅̸",
"nsube": "⊈",
"nsubset": "⊂⃒",
"nsubseteq": "⊈",
"nsubseteqq": "⫅̸",
"nsucc": "⊁",
"nsucceq": "⪰̸",
"nsup": "⊅",
"nsupE": "⫆̸",
"nsupe": "⊉",
"nsupset": "⊃⃒",
"nsupseteq": "⊉",
"nsupseteqq": "⫆̸",
"ntgl": "≹",
"Ntilde": "Ñ",
"ntilde": "ñ",
"ntlg": "≸",
"ntriangleleft": "⋪",
"ntrianglelefteq": "⋬",
"ntriangleright": "⋫",
"ntrianglerighteq": "⋭",
"Nu": "Ν",
"nu": "ν",
"num": "#",
"numero": "№",
"numsp": " ",
"nvap": "≍⃒",
"nvdash": "⊬",
"nvDash": "⊭",
"nVdash": "⊮",
"nVDash": "⊯",
"nvge": "≥⃒",
"nvgt": ">⃒",
"nvHarr": "⤄",
"nvinfin": "⧞",
"nvlArr": "⤂",
"nvle": "≤⃒",
"nvlt": "<⃒",
"nvltrie": "⊴⃒",
"nvrArr": "⤃",
"nvrtrie": "⊵⃒",
"nvsim": "∼⃒",
"nwarhk": "⤣",
"nwarr": "↖",
"nwArr": "⇖",
"nwarrow": "↖",
"nwnear": "⤧",
"Oacute": "Ó",
"oacute": "ó",
"oast": "⊛",
"Ocirc": "Ô",
"ocirc": "ô",
"ocir": "⊚",
"Ocy": "О",
"ocy": "о",
"odash": "⊝",
"Odblac": "Ő",
"odblac": "ő",
"odiv": "⨸",
"odot": "⊙",
"odsold": "⦼",
"OElig": "Œ",
"oelig": "œ",
"ofcir": "⦿",
"Ofr": "𝔒",
"ofr": "𝔬",
"ogon": "˛",
"Ograve": "Ò",
"ograve": "ò",
"ogt": "⧁",
"ohbar": "⦵",
"ohm": "Ω",
"oint": "∮",
"olarr": "↺",
"olcir": "⦾",
"olcross": "⦻",
"oline": "‾",
"olt": "⧀",
"Omacr": "Ō",
"omacr": "ō",
"Omega": "Ω",
"omega": "ω",
"Omicron": "Ο",
"omicron": "ο",
"omid": "⦶",
"ominus": "⊖",
"Oopf": "𝕆",
"oopf": "𝕠",
"opar": "⦷",
"OpenCurlyDoubleQuote": "“",
"OpenCurlyQuote": "‘",
"operp": "⦹",
"oplus": "⊕",
"orarr": "↻",
"Or": "⩔",
"or": "∨",
"ord": "⩝",
"order": "ℴ",
"orderof": "ℴ",
"ordf": "ª",
"ordm": "º",
"origof": "⊶",
"oror": "⩖",
"orslope": "⩗",
"orv": "⩛",
"oS": "Ⓢ",
"Oscr": "𝒪",
"oscr": "ℴ",
"Oslash": "Ø",
"oslash": "ø",
"osol": "⊘",
"Otilde": "Õ",
"otilde": "õ",
"otimesas": "⨶",
"Otimes": "⨷",
"otimes": "⊗",
"Ouml": "Ö",
"ouml": "ö",
"ovbar": "⌽",
"OverBar": "‾",
"OverBrace": "⏞",
"OverBracket": "⎴",
"OverParenthesis": "⏜",
"para": "¶",
"parallel": "∥",
"par": "∥",
"parsim": "⫳",
"parsl": "⫽",
"part": "∂",
"PartialD": "∂",
"Pcy": "П",
"pcy": "п",
"percnt": "%",
"period": ".",
"permil": "‰",
"perp": "⊥",
"pertenk": "‱",
"Pfr": "𝔓",
"pfr": "𝔭",
"Phi": "Φ",
"phi": "φ",
"phiv": "ϕ",
"phmmat": "ℳ",
"phone": "☎",
"Pi": "Π",
"pi": "π",
"pitchfork": "⋔",
"piv": "ϖ",
"planck": "ℏ",
"planckh": "ℎ",
"plankv": "ℏ",
"plusacir": "⨣",
"plusb": "⊞",
"pluscir": "⨢",
"plus": "+",
"plusdo": "∔",
"plusdu": "⨥",
"pluse": "⩲",
"PlusMinus": "±",
"plusmn": "±",
"plussim": "⨦",
"plustwo": "⨧",
"pm": "±",
"Poincareplane": "ℌ",
"pointint": "⨕",
"popf": "𝕡",
"Popf": "ℙ",
"pound": "£",
"prap": "⪷",
"Pr": "⪻",
"pr": "≺",
"prcue": "≼",
"precapprox": "⪷",
"prec": "≺",
"preccurlyeq": "≼",
"Precedes": "≺",
"PrecedesEqual": "⪯",
"PrecedesSlantEqual": "≼",
"PrecedesTilde": "≾",
"preceq": "⪯",
"precnapprox": "⪹",
"precneqq": "⪵",
"precnsim": "⋨",
"pre": "⪯",
"prE": "⪳",
"precsim": "≾",
"prime": "′",
"Prime": "″",
"primes": "ℙ",
"prnap": "⪹",
"prnE": "⪵",
"prnsim": "⋨",
"prod": "∏",
"Product": "∏",
"profalar": "⌮",
"profline": "⌒",
"profsurf": "⌓",
"prop": "∝",
"Proportional": "∝",
"Proportion": "∷",
"propto": "∝",
"prsim": "≾",
"prurel": "⊰",
"Pscr": "𝒫",
"pscr": "𝓅",
"Psi": "Ψ",
"psi": "ψ",
"puncsp": " ",
"Qfr": "𝔔",
"qfr": "𝔮",
"qint": "⨌",
"qopf": "𝕢",
"Qopf": "ℚ",
"qprime": "⁗",
"Qscr": "𝒬",
"qscr": "𝓆",
"quaternions": "ℍ",
"quatint": "⨖",
"quest": "?",
"questeq": "≟",
"quot": "\"",
"QUOT": "\"",
"rAarr": "⇛",
"race": "∽̱",
"Racute": "Ŕ",
"racute": "ŕ",
"radic": "√",
"raemptyv": "⦳",
"rang": "⟩",
"Rang": "⟫",
"rangd": "⦒",
"range": "⦥",
"rangle": "⟩",
"raquo": "»",
"rarrap": "⥵",
"rarrb": "⇥",
"rarrbfs": "⤠",
"rarrc": "⤳",
"rarr": "→",
"Rarr": "↠",
"rArr": "⇒",
"rarrfs": "⤞",
"rarrhk": "↪",
"rarrlp": "↬",
"rarrpl": "⥅",
"rarrsim": "⥴",
"Rarrtl": "⤖",
"rarrtl": "↣",
"rarrw": "↝",
"ratail": "⤚",
"rAtail": "⤜",
"ratio": "∶",
"rationals": "ℚ",
"rbarr": "⤍",
"rBarr": "⤏",
"RBarr": "⤐",
"rbbrk": "❳",
"rbrace": "}",
"rbrack": "]",
"rbrke": "⦌",
"rbrksld": "⦎",
"rbrkslu": "⦐",
"Rcaron": "Ř",
"rcaron": "ř",
"Rcedil": "Ŗ",
"rcedil": "ŗ",
"rceil": "⌉",
"rcub": "}",
"Rcy": "Р",
"rcy": "р",
"rdca": "⤷",
"rdldhar": "⥩",
"rdquo": "”",
"rdquor": "”",
"rdsh": "↳",
"real": "ℜ",
"realine": "ℛ",
"realpart": "ℜ",
"reals": "ℝ",
"Re": "ℜ",
"rect": "▭",
"reg": "®",
"REG": "®",
"ReverseElement": "∋",
"ReverseEquilibrium": "⇋",
"ReverseUpEquilibrium": "⥯",
"rfisht": "⥽",
"rfloor": "⌋",
"rfr": "𝔯",
"Rfr": "ℜ",
"rHar": "⥤",
"rhard": "⇁",
"rharu": "⇀",
"rharul": "⥬",
"Rho": "Ρ",
"rho": "ρ",
"rhov": "ϱ",
"RightAngleBracket": "⟩",
"RightArrowBar": "⇥",
"rightarrow": "→",
"RightArrow": "→",
"Rightarrow": "⇒",
"RightArrowLeftArrow": "⇄",
"rightarrowtail": "↣",
"RightCeiling": "⌉",
"RightDoubleBracket": "⟧",
"RightDownTeeVector": "⥝",
"RightDownVectorBar": "⥕",
"RightDownVector": "⇂",
"RightFloor": "⌋",
"rightharpoondown": "⇁",
"rightharpoonup": "⇀",
"rightleftarrows": "⇄",
"rightleftharpoons": "⇌",
"rightrightarrows": "⇉",
"rightsquigarrow": "↝",
"RightTeeArrow": "↦",
"RightTee": "⊢",
"RightTeeVector": "⥛",
"rightthreetimes": "⋌",
"RightTriangleBar": "⧐",
"RightTriangle": "⊳",
"RightTriangleEqual": "⊵",
"RightUpDownVector": "⥏",
"RightUpTeeVector": "⥜",
"RightUpVectorBar": "⥔",
"RightUpVector": "↾",
"RightVectorBar": "⥓",
"RightVector": "⇀",
"ring": "˚",
"risingdotseq": "≓",
"rlarr": "⇄",
"rlhar": "⇌",
"rlm": "",
"rmoustache": "⎱",
"rmoust": "⎱",
"rnmid": "⫮",
"roang": "⟭",
"roarr": "⇾",
"robrk": "⟧",
"ropar": "⦆",
"ropf": "𝕣",
"Ropf": "ℝ",
"roplus": "⨮",
"rotimes": "⨵",
"RoundImplies": "⥰",
"rpar": ")",
"rpargt": "⦔",
"rppolint": "⨒",
"rrarr": "⇉",
"Rrightarrow": "⇛",
"rsaquo": "›",
"rscr": "𝓇",
"Rscr": "ℛ",
"rsh": "↱",
"Rsh": "↱",
"rsqb": "]",
"rsquo": "’",
"rsquor": "’",
"rthree": "⋌",
"rtimes": "⋊",
"rtri": "▹",
"rtrie": "⊵",
"rtrif": "▸",
"rtriltri": "⧎",
"RuleDelayed": "⧴",
"ruluhar": "⥨",
"rx": "℞",
"Sacute": "Ś",
"sacute": "ś",
"sbquo": "‚",
"scap": "⪸",
"Scaron": "Š",
"scaron": "š",
"Sc": "⪼",
"sc": "≻",
"sccue": "≽",
"sce": "⪰",
"scE": "⪴",
"Scedil": "Ş",
"scedil": "ş",
"Scirc": "Ŝ",
"scirc": "ŝ",
"scnap": "⪺",
"scnE": "⪶",
"scnsim": "⋩",
"scpolint": "⨓",
"scsim": "≿",
"Scy": "С",
"scy": "с",
"sdotb": "⊡",
"sdot": "⋅",
"sdote": "⩦",
"searhk": "⤥",
"searr": "↘",
"seArr": "⇘",
"searrow": "↘",
"sect": "§",
"semi": ";",
"seswar": "⤩",
"setminus": "∖",
"setmn": "∖",
"sext": "✶",
"Sfr": "𝔖",
"sfr": "𝔰",
"sfrown": "⌢",
"sharp": "♯",
"SHCHcy": "Щ",
"shchcy": "щ",
"SHcy": "Ш",
"shcy": "ш",
"ShortDownArrow": "↓",
"ShortLeftArrow": "←",
"shortmid": "∣",
"shortparallel": "∥",
"ShortRightArrow": "→",
"ShortUpArrow": "↑",
"shy": "",
"Sigma": "Σ",
"sigma": "σ",
"sigmaf": "ς",
"sigmav": "ς",
"sim": "∼",
"simdot": "⩪",
"sime": "≃",
"simeq": "≃",
"simg": "⪞",
"simgE": "⪠",
"siml": "⪝",
"simlE": "⪟",
"simne": "≆",
"simplus": "⨤",
"simrarr": "⥲",
"slarr": "←",
"SmallCircle": "∘",
"smallsetminus": "∖",
"smashp": "⨳",
"smeparsl": "⧤",
"smid": "∣",
"smile": "⌣",
"smt": "⪪",
"smte": "⪬",
"smtes": "⪬︀",
"SOFTcy": "Ь",
"softcy": "ь",
"solbar": "⌿",
"solb": "⧄",
"sol": "/",
"Sopf": "𝕊",
"sopf": "𝕤",
"spades": "♠",
"spadesuit": "♠",
"spar": "∥",
"sqcap": "⊓",
"sqcaps": "⊓︀",
"sqcup": "⊔",
"sqcups": "⊔︀",
"Sqrt": "√",
"sqsub": "⊏",
"sqsube": "⊑",
"sqsubset": "⊏",
"sqsubseteq": "⊑",
"sqsup": "⊐",
"sqsupe": "⊒",
"sqsupset": "⊐",
"sqsupseteq": "⊒",
"square": "□",
"Square": "□",
"SquareIntersection": "⊓",
"SquareSubset": "⊏",
"SquareSubsetEqual": "⊑",
"SquareSuperset": "⊐",
"SquareSupersetEqual": "⊒",
"SquareUnion": "⊔",
"squarf": "▪",
"squ": "□",
"squf": "▪",
"srarr": "→",
"Sscr": "𝒮",
"sscr": "𝓈",
"ssetmn": "∖",
"ssmile": "⌣",
"sstarf": "⋆",
"Star": "⋆",
"star": "☆",
"starf": "★",
"straightepsilon": "ϵ",
"straightphi": "ϕ",
"strns": "¯",
"sub": "⊂",
"Sub": "⋐",
"subdot": "⪽",
"subE": "⫅",
"sube": "⊆",
"subedot": "⫃",
"submult": "⫁",
"subnE": "⫋",
"subne": "⊊",
"subplus": "⪿",
"subrarr": "⥹",
"subset": "⊂",
"Subset": "⋐",
"subseteq": "⊆",
"subseteqq": "⫅",
"SubsetEqual": "⊆",
"subsetneq": "⊊",
"subsetneqq": "⫋",
"subsim": "⫇",
"subsub": "⫕",
"subsup": "⫓",
"succapprox": "⪸",
"succ": "≻",
"succcurlyeq": "≽",
"Succeeds": "≻",
"SucceedsEqual": "⪰",
"SucceedsSlantEqual": "≽",
"SucceedsTilde": "≿",
"succeq": "⪰",
"succnapprox": "⪺",
"succneqq": "⪶",
"succnsim": "⋩",
"succsim": "≿",
"SuchThat": "∋",
"sum": "∑",
"Sum": "∑",
"sung": "♪",
"sup1": "¹",
"sup2": "²",
"sup3": "³",
"sup": "⊃",
"Sup": "⋑",
"supdot": "⪾",
"supdsub": "⫘",
"supE": "⫆",
"supe": "⊇",
"supedot": "⫄",
"Superset": "⊃",
"SupersetEqual": "⊇",
"suphsol": "⟉",
"suphsub": "⫗",
"suplarr": "⥻",
"supmult": "⫂",
"supnE": "⫌",
"supne": "⊋",
"supplus": "⫀",
"supset": "⊃",
"Supset": "⋑",
"supseteq": "⊇",
"supseteqq": "⫆",
"supsetneq": "⊋",
"supsetneqq": "⫌",
"supsim": "⫈",
"supsub": "⫔",
"supsup": "⫖",
"swarhk": "⤦",
"swarr": "↙",
"swArr": "⇙",
"swarrow": "↙",
"swnwar": "⤪",
"szlig": "ß",
"Tab": "\t",
"target": "⌖",
"Tau": "Τ",
"tau": "τ",
"tbrk": "⎴",
"Tcaron": "Ť",
"tcaron": "ť",
"Tcedil": "Ţ",
"tcedil": "ţ",
"Tcy": "Т",
"tcy": "т",
"tdot": "⃛",
"telrec": "⌕",
"Tfr": "𝔗",
"tfr": "𝔱",
"there4": "∴",
"therefore": "∴",
"Therefore": "∴",
"Theta": "Θ",
"theta": "θ",
"thetasym": "ϑ",
"thetav": "ϑ",
"thickapprox": "≈",
"thicksim": "∼",
"ThickSpace": " ",
"ThinSpace": " ",
"thinsp": " ",
"thkap": "≈",
"thksim": "∼",
"THORN": "Þ",
"thorn": "þ",
"tilde": "˜",
"Tilde": "∼",
"TildeEqual": "≃",
"TildeFullEqual": "≅",
"TildeTilde": "≈",
"timesbar": "⨱",
"timesb": "⊠",
"times": "×",
"timesd": "⨰",
"tint": "∭",
"toea": "⤨",
"topbot": "⌶",
"topcir": "⫱",
"top": "⊤",
"Topf": "𝕋",
"topf": "𝕥",
"topfork": "⫚",
"tosa": "⤩",
"tprime": "‴",
"trade": "™",
"TRADE": "™",
"triangle": "▵",
"triangledown": "▿",
"triangleleft": "◃",
"trianglelefteq": "⊴",
"triangleq": "≜",
"triangleright": "▹",
"trianglerighteq": "⊵",
"tridot": "◬",
"trie": "≜",
"triminus": "⨺",
"TripleDot": "⃛",
"triplus": "⨹",
"trisb": "⧍",
"tritime": "⨻",
"trpezium": "⏢",
"Tscr": "𝒯",
"tscr": "𝓉",
"TScy": "Ц",
"tscy": "ц",
"TSHcy": "Ћ",
"tshcy": "ћ",
"Tstrok": "Ŧ",
"tstrok": "ŧ",
"twixt": "≬",
"twoheadleftarrow": "↞",
"twoheadrightarrow": "↠",
"Uacute": "Ú",
"uacute": "ú",
"uarr": "↑",
"Uarr": "↟",
"uArr": "⇑",
"Uarrocir": "⥉",
"Ubrcy": "Ў",
"ubrcy": "ў",
"Ubreve": "Ŭ",
"ubreve": "ŭ",
"Ucirc": "Û",
"ucirc": "û",
"Ucy": "У",
"ucy": "у",
"udarr": "⇅",
"Udblac": "Ű",
"udblac": "ű",
"udhar": "⥮",
"ufisht": "⥾",
"Ufr": "𝔘",
"ufr": "𝔲",
"Ugrave": "Ù",
"ugrave": "ù",
"uHar": "⥣",
"uharl": "↿",
"uharr": "↾",
"uhblk": "▀",
"ulcorn": "⌜",
"ulcorner": "⌜",
"ulcrop": "⌏",
"ultri": "◸",
"Umacr": "Ū",
"umacr": "ū",
"uml": "¨",
"UnderBar": "_",
"UnderBrace": "⏟",
"UnderBracket": "⎵",
"UnderParenthesis": "⏝",
"Union": "⋃",
"UnionPlus": "⊎",
"Uogon": "Ų",
"uogon": "ų",
"Uopf": "𝕌",
"uopf": "𝕦",
"UpArrowBar": "⤒",
"uparrow": "↑",
"UpArrow": "↑",
"Uparrow": "⇑",
"UpArrowDownArrow": "⇅",
"updownarrow": "↕",
"UpDownArrow": "↕",
"Updownarrow": "⇕",
"UpEquilibrium": "⥮",
"upharpoonleft": "↿",
"upharpoonright": "↾",
"uplus": "⊎",
"UpperLeftArrow": "↖",
"UpperRightArrow": "↗",
"upsi": "υ",
"Upsi": "ϒ",
"upsih": "ϒ",
"Upsilon": "Υ",
"upsilon": "υ",
"UpTeeArrow": "↥",
"UpTee": "⊥",
"upuparrows": "⇈",
"urcorn": "⌝",
"urcorner": "⌝",
"urcrop": "⌎",
"Uring": "Ů",
"uring": "ů",
"urtri": "◹",
"Uscr": "𝒰",
"uscr": "𝓊",
"utdot": "⋰",
"Utilde": "Ũ",
"utilde": "ũ",
"utri": "▵",
"utrif": "▴",
"uuarr": "⇈",
"Uuml": "Ü",
"uuml": "ü",
"uwangle": "⦧",
"vangrt": "⦜",
"varepsilon": "ϵ",
"varkappa": "ϰ",
"varnothing": "∅",
"varphi": "ϕ",
"varpi": "ϖ",
"varpropto": "∝",
"varr": "↕",
"vArr": "⇕",
"varrho": "ϱ",
"varsigma": "ς",
"varsubsetneq": "⊊︀",
"varsubsetneqq": "⫋︀",
"varsupsetneq": "⊋︀",
"varsupsetneqq": "⫌︀",
"vartheta": "ϑ",
"vartriangleleft": "⊲",
"vartriangleright": "⊳",
"vBar": "⫨",
"Vbar": "⫫",
"vBarv": "⫩",
"Vcy": "В",
"vcy": "в",
"vdash": "⊢",
"vDash": "⊨",
"Vdash": "⊩",
"VDash": "⊫",
"Vdashl": "⫦",
"veebar": "⊻",
"vee": "∨",
"Vee": "⋁",
"veeeq": "≚",
"vellip": "⋮",
"verbar": "|",
"Verbar": "‖",
"vert": "|",
"Vert": "‖",
"VerticalBar": "∣",
"VerticalLine": "|",
"VerticalSeparator": "❘",
"VerticalTilde": "≀",
"VeryThinSpace": " ",
"Vfr": "𝔙",
"vfr": "𝔳",
"vltri": "⊲",
"vnsub": "⊂⃒",
"vnsup": "⊃⃒",
"Vopf": "𝕍",
"vopf": "𝕧",
"vprop": "∝",
"vrtri": "⊳",
"Vscr": "𝒱",
"vscr": "𝓋",
"vsubnE": "⫋︀",
"vsubne": "⊊︀",
"vsupnE": "⫌︀",
"vsupne": "⊋︀",
"Vvdash": "⊪",
"vzigzag": "⦚",
"Wcirc": "Ŵ",
"wcirc": "ŵ",
"wedbar": "⩟",
"wedge": "∧",
"Wedge": "⋀",
"wedgeq": "≙",
"weierp": "℘",
"Wfr": "𝔚",
"wfr": "𝔴",
"Wopf": "𝕎",
"wopf": "𝕨",
"wp": "℘",
"wr": "≀",
"wreath": "≀",
"Wscr": "𝒲",
"wscr": "𝓌",
"xcap": "⋂",
"xcirc": "◯",
"xcup": "⋃",
"xdtri": "▽",
"Xfr": "𝔛",
"xfr": "𝔵",
"xharr": "⟷",
"xhArr": "⟺",
"Xi": "Ξ",
"xi": "ξ",
"xlarr": "⟵",
"xlArr": "⟸",
"xmap": "⟼",
"xnis": "⋻",
"xodot": "⨀",
"Xopf": "𝕏",
"xopf": "𝕩",
"xoplus": "⨁",
"xotime": "⨂",
"xrarr": "⟶",
"xrArr": "⟹",
"Xscr": "𝒳",
"xscr": "𝓍",
"xsqcup": "⨆",
"xuplus": "⨄",
"xutri": "△",
"xvee": "⋁",
"xwedge": "⋀",
"Yacute": "Ý",
"yacute": "ý",
"YAcy": "Я",
"yacy": "я",
"Ycirc": "Ŷ",
"ycirc": "ŷ",
"Ycy": "Ы",
"ycy": "ы",
"yen": "¥",
"Yfr": "𝔜",
"yfr": "𝔶",
"YIcy": "Ї",
"yicy": "ї",
"Yopf": "𝕐",
"yopf": "𝕪",
"Yscr": "𝒴",
"yscr": "𝓎",
"YUcy": "Ю",
"yucy": "ю",
"yuml": "ÿ",
"Yuml": "Ÿ",
"Zacute": "Ź",
"zacute": "ź",
"Zcaron": "Ž",
"zcaron": "ž",
"Zcy": "З",
"zcy": "з",
"Zdot": "Ż",
"zdot": "ż",
"zeetrf": "ℨ",
"ZeroWidthSpace": "",
"Zeta": "Ζ",
"zeta": "ζ",
"zfr": "𝔷",
"Zfr": "ℨ",
"ZHcy": "Ж",
"zhcy": "ж",
"zigrarr": "⇝",
"zopf": "𝕫",
"Zopf": "ℤ",
"Zscr": "𝒵",
"zscr": "𝓏",
"zwj": "",
"zwnj": ""
};
/***/ },
/* 47 */
/***/ function(module, exports) {
module.exports = {
"Aacute": "Á",
"aacute": "á",
"Acirc": "Â",
"acirc": "â",
"acute": "´",
"AElig": "Æ",
"aelig": "æ",
"Agrave": "À",
"agrave": "à",
"amp": "&",
"AMP": "&",
"Aring": "Å",
"aring": "å",
"Atilde": "Ã",
"atilde": "ã",
"Auml": "Ä",
"auml": "ä",
"brvbar": "¦",
"Ccedil": "Ç",
"ccedil": "ç",
"cedil": "¸",
"cent": "¢",
"copy": "©",
"COPY": "©",
"curren": "¤",
"deg": "°",
"divide": "÷",
"Eacute": "É",
"eacute": "é",
"Ecirc": "Ê",
"ecirc": "ê",
"Egrave": "È",
"egrave": "è",
"ETH": "Ð",
"eth": "ð",
"Euml": "Ë",
"euml": "ë",
"frac12": "½",
"frac14": "¼",
"frac34": "¾",
"gt": ">",
"GT": ">",
"Iacute": "Í",
"iacute": "í",
"Icirc": "Î",
"icirc": "î",
"iexcl": "¡",
"Igrave": "Ì",
"igrave": "ì",
"iquest": "¿",
"Iuml": "Ï",
"iuml": "ï",
"laquo": "«",
"lt": "<",
"LT": "<",
"macr": "¯",
"micro": "µ",
"middot": "·",
"nbsp": " ",
"not": "¬",
"Ntilde": "Ñ",
"ntilde": "ñ",
"Oacute": "Ó",
"oacute": "ó",
"Ocirc": "Ô",
"ocirc": "ô",
"Ograve": "Ò",
"ograve": "ò",
"ordf": "ª",
"ordm": "º",
"Oslash": "Ø",
"oslash": "ø",
"Otilde": "Õ",
"otilde": "õ",
"Ouml": "Ö",
"ouml": "ö",
"para": "¶",
"plusmn": "±",
"pound": "£",
"quot": "\"",
"QUOT": "\"",
"raquo": "»",
"reg": "®",
"REG": "®",
"sect": "§",
"shy": "",
"sup1": "¹",
"sup2": "²",
"sup3": "³",
"szlig": "ß",
"THORN": "Þ",
"thorn": "þ",
"times": "×",
"Uacute": "Ú",
"uacute": "ú",
"Ucirc": "Û",
"ucirc": "û",
"Ugrave": "Ù",
"ugrave": "ù",
"uml": "¨",
"Uuml": "Ü",
"uuml": "ü",
"Yacute": "Ý",
"yacute": "ý",
"yen": "¥",
"yuml": "ÿ"
};
/***/ },
/* 48 */
/***/ function(module, exports) {
module.exports = {
"amp": "&",
"apos": "'",
"gt": ">",
"lt": "<",
"quot": "\""
};
/***/ },
/* 49 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var formatRegExp = /%[sdj%]/g;
exports.format = function(f) {
if (!isString(f)) {
var objects = [];
for (var i = 0; i < arguments.length; i++) {
objects.push(inspect(arguments[i]));
}
return objects.join(' ');
}
var i = 1;
var args = arguments;
var len = args.length;
var str = String(f).replace(formatRegExp, function(x) {
if (x === '%%') return '%';
if (i >= len) return x;
switch (x) {
case '%s': return String(args[i++]);
case '%d': return Number(args[i++]);
case '%j':
try {
return JSON.stringify(args[i++]);
} catch (_) {
return '[Circular]';
}
default:
return x;
}
});
for (var x = args[i]; i < len; x = args[++i]) {
if (isNull(x) || !isObject(x)) {
str += ' ' + x;
} else {
str += ' ' + inspect(x);
}
}
return str;
};
// Mark that a method should not be used.
// Returns a modified function which warns once by default.
// If --no-deprecation is set, then it is a no-op.
exports.deprecate = function(fn, msg) {
// Allow for deprecating things in the process of starting up.
if (isUndefined(global.process)) {
return function() {
return exports.deprecate(fn, msg).apply(this, arguments);
};
}
if (process.noDeprecation === true) {
return fn;
}
var warned = false;
function deprecated() {
if (!warned) {
if (process.throwDeprecation) {
throw new Error(msg);
} else if (process.traceDeprecation) {
console.trace(msg);
} else {
console.error(msg);
}
warned = true;
}
return fn.apply(this, arguments);
}
return deprecated;
};
var debugs = {};
var debugEnviron;
exports.debuglog = function(set) {
if (isUndefined(debugEnviron))
debugEnviron = process.env.NODE_DEBUG || '';
set = set.toUpperCase();
if (!debugs[set]) {
if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
var pid = process.pid;
debugs[set] = function() {
var msg = exports.format.apply(exports, arguments);
console.error('%s %d: %s', set, pid, msg);
};
} else {
debugs[set] = function() {};
}
}
return debugs[set];
};
/**
* Echos the value of a value. Trys to print the value out
* in the best way possible given the different types.
*
* @param {Object} obj The object to print out.
* @param {Object} opts Optional options object that alters the output.
*/
/* legacy: obj, showHidden, depth, colors*/
function inspect(obj, opts) {
// default options
var ctx = {
seen: [],
stylize: stylizeNoColor
};
// legacy...
if (arguments.length >= 3) ctx.depth = arguments[2];
if (arguments.length >= 4) ctx.colors = arguments[3];
if (isBoolean(opts)) {
// legacy...
ctx.showHidden = opts;
} else if (opts) {
// got an "options" object
exports._extend(ctx, opts);
}
// set default options
if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
if (isUndefined(ctx.depth)) ctx.depth = 2;
if (isUndefined(ctx.colors)) ctx.colors = false;
if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
if (ctx.colors) ctx.stylize = stylizeWithColor;
return formatValue(ctx, obj, ctx.depth);
}
exports.inspect = inspect;
// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
inspect.colors = {
'bold' : [1, 22],
'italic' : [3, 23],
'underline' : [4, 24],
'inverse' : [7, 27],
'white' : [37, 39],
'grey' : [90, 39],
'black' : [30, 39],
'blue' : [34, 39],
'cyan' : [36, 39],
'green' : [32, 39],
'magenta' : [35, 39],
'red' : [31, 39],
'yellow' : [33, 39]
};
// Don't use 'blue' not visible on cmd.exe
inspect.styles = {
'special': 'cyan',
'number': 'yellow',
'boolean': 'yellow',
'undefined': 'grey',
'null': 'bold',
'string': 'green',
'date': 'magenta',
// "name": intentionally not styling
'regexp': 'red'
};
function stylizeWithColor(str, styleType) {
var style = inspect.styles[styleType];
if (style) {
return '\u001b[' + inspect.colors[style][0] + 'm' + str +
'\u001b[' + inspect.colors[style][1] + 'm';
} else {
return str;
}
}
function stylizeNoColor(str, styleType) {
return str;
}
function arrayToHash(array) {
var hash = {};
array.forEach(function(val, idx) {
hash[val] = true;
});
return hash;
}
function formatValue(ctx, value, recurseTimes) {
// Provide a hook for user-specified inspect functions.
// Check that value is an object with an inspect function on it
if (ctx.customInspect &&
value &&
isFunction(value.inspect) &&
// Filter out the util module, it's inspect function is special
value.inspect !== exports.inspect &&
// Also filter out any prototype objects using the circular check.
!(value.constructor && value.constructor.prototype === value)) {
var ret = value.inspect(recurseTimes, ctx);
if (!isString(ret)) {
ret = formatValue(ctx, ret, recurseTimes);
}
return ret;
}
// Primitive types cannot have properties
var primitive = formatPrimitive(ctx, value);
if (primitive) {
return primitive;
}
// Look up the keys of the object.
var keys = Object.keys(value);
var visibleKeys = arrayToHash(keys);
if (ctx.showHidden) {
keys = Object.getOwnPropertyNames(value);
}
// IE doesn't make error fields non-enumerable
// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
if (isError(value)
&& (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
return formatError(value);
}
// Some type of object without properties can be shortcutted.
if (keys.length === 0) {
if (isFunction(value)) {
var name = value.name ? ': ' + value.name : '';
return ctx.stylize('[Function' + name + ']', 'special');
}
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
}
if (isDate(value)) {
return ctx.stylize(Date.prototype.toString.call(value), 'date');
}
if (isError(value)) {
return formatError(value);
}
}
var base = '', array = false, braces = ['{', '}'];
// Make Array say that they are Array
if (isArray(value)) {
array = true;
braces = ['[', ']'];
}
// Make functions say that they are functions
if (isFunction(value)) {
var n = value.name ? ': ' + value.name : '';
base = ' [Function' + n + ']';
}
// Make RegExps say that they are RegExps
if (isRegExp(value)) {
base = ' ' + RegExp.prototype.toString.call(value);
}
// Make dates with properties first say the date
if (isDate(value)) {
base = ' ' + Date.prototype.toUTCString.call(value);
}
// Make error with message first say the error
if (isError(value)) {
base = ' ' + formatError(value);
}
if (keys.length === 0 && (!array || value.length == 0)) {
return braces[0] + base + braces[1];
}
if (recurseTimes < 0) {
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
} else {
return ctx.stylize('[Object]', 'special');
}
}
ctx.seen.push(value);
var output;
if (array) {
output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
} else {
output = keys.map(function(key) {
return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
});
}
ctx.seen.pop();
return reduceToSingleString(output, base, braces);
}
function formatPrimitive(ctx, value) {
if (isUndefined(value))
return ctx.stylize('undefined', 'undefined');
if (isString(value)) {
var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
.replace(/'/g, "\\'")
.replace(/\\"/g, '"') + '\'';
return ctx.stylize(simple, 'string');
}
if (isNumber(value))
return ctx.stylize('' + value, 'number');
if (isBoolean(value))
return ctx.stylize('' + value, 'boolean');
// For some reason typeof null is "object", so special case here.
if (isNull(value))
return ctx.stylize('null', 'null');
}
function formatError(value) {
return '[' + Error.prototype.toString.call(value) + ']';
}
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
var output = [];
for (var i = 0, l = value.length; i < l; ++i) {
if (hasOwnProperty(value, String(i))) {
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
String(i), true));
} else {
output.push('');
}
}
keys.forEach(function(key) {
if (!key.match(/^\d+$/)) {
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
key, true));
}
});
return output;
}
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
var name, str, desc;
desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
if (desc.get) {
if (desc.set) {
str = ctx.stylize('[Getter/Setter]', 'special');
} else {
str = ctx.stylize('[Getter]', 'special');
}
} else {
if (desc.set) {
str = ctx.stylize('[Setter]', 'special');
}
}
if (!hasOwnProperty(visibleKeys, key)) {
name = '[' + key + ']';
}
if (!str) {
if (ctx.seen.indexOf(desc.value) < 0) {
if (isNull(recurseTimes)) {
str = formatValue(ctx, desc.value, null);
} else {
str = formatValue(ctx, desc.value, recurseTimes - 1);
}
if (str.indexOf('\n') > -1) {
if (array) {
str = str.split('\n').map(function(line) {
return ' ' + line;
}).join('\n').substr(2);
} else {
str = '\n' + str.split('\n').map(function(line) {
return ' ' + line;
}).join('\n');
}
}
} else {
str = ctx.stylize('[Circular]', 'special');
}
}
if (isUndefined(name)) {
if (array && key.match(/^\d+$/)) {
return str;
}
name = JSON.stringify('' + key);
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
name = name.substr(1, name.length - 2);
name = ctx.stylize(name, 'name');
} else {
name = name.replace(/'/g, "\\'")
.replace(/\\"/g, '"')
.replace(/(^"|"$)/g, "'");
name = ctx.stylize(name, 'string');
}
}
return name + ': ' + str;
}
function reduceToSingleString(output, base, braces) {
var numLinesEst = 0;
var length = output.reduce(function(prev, cur) {
numLinesEst++;
if (cur.indexOf('\n') >= 0) numLinesEst++;
return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
}, 0);
if (length > 60) {
return braces[0] +
(base === '' ? '' : base + '\n ') +
' ' +
output.join(',\n ') +
' ' +
braces[1];
}
return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
}
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) {
return Array.isArray(ar);
}
exports.isArray = isArray;
function isBoolean(arg) {
return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;
function isNull(arg) {
return arg === null;
}
exports.isNull = isNull;
function isNullOrUndefined(arg) {
return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;
function isNumber(arg) {
return typeof arg === 'number';
}
exports.isNumber = isNumber;
function isString(arg) {
return typeof arg === 'string';
}
exports.isString = isString;
function isSymbol(arg) {
return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;
function isUndefined(arg) {
return arg === void 0;
}
exports.isUndefined = isUndefined;
function isRegExp(re) {
return isObject(re) && objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;
function isDate(d) {
return isObject(d) && objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
return isObject(e) &&
(objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
function isFunction(arg) {
return typeof arg === 'function';
}
exports.isFunction = isFunction;
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
exports.isBuffer = __webpack_require__(51);
function objectToString(o) {
return Object.prototype.toString.call(o);
}
function pad(n) {
return n < 10 ? '0' + n.toString(10) : n.toString(10);
}
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
'Oct', 'Nov', 'Dec'];
// 26 Feb 16:19:34
function timestamp() {
var d = new Date();
var time = [pad(d.getHours()),
pad(d.getMinutes()),
pad(d.getSeconds())].join(':');
return [d.getDate(), months[d.getMonth()], time].join(' ');
}
// log is just a thin wrapper to console.log that prepends a timestamp
exports.log = function() {
console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
};
/**
* Inherit the prototype methods from one constructor into another.
*
* The Function.prototype.inherits from lang.js rewritten as a standalone
* function (not on Function.prototype). NOTE: If this file is to be loaded
* during bootstrapping this function needs to be rewritten using some native
* functions as prototype setup using normal JavaScript does not work as
* expected during bootstrapping (see mirror.js in r114903).
*
* @param {function} ctor Constructor function which needs to inherit the
* prototype.
* @param {function} superCtor Constructor function to inherit prototype from.
*/
exports.inherits = __webpack_require__(52);
exports._extend = function(origin, add) {
// Don't do anything if add isn't an object
if (!add || !isObject(add)) return origin;
var keys = Object.keys(add);
var i = keys.length;
while (i--) {
origin[keys[i]] = add[keys[i]];
}
return origin;
};
function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(50)))
/***/ },
/* 50 */
/***/ function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = setTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
clearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
setTimeout(drainQueue, 0);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ },
/* 51 */
/***/ function(module, exports) {
module.exports = function isBuffer(arg) {
return arg && typeof arg === 'object'
&& typeof arg.copy === 'function'
&& typeof arg.fill === 'function'
&& typeof arg.readUInt8 === 'function';
}
/***/ },
/* 52 */
/***/ function(module, exports) {
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
/***/ },
/* 53 */
/***/ function(module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
function EventEmitter() {
this._events = this._events || {};
this._maxListeners = this._maxListeners || undefined;
}
module.exports = EventEmitter;
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
EventEmitter.defaultMaxListeners = 10;
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function(n) {
if (!isNumber(n) || n < 0 || isNaN(n))
throw TypeError('n must be a positive number');
this._maxListeners = n;
return this;
};
EventEmitter.prototype.emit = function(type) {
var er, handler, len, args, i, listeners;
if (!this._events)
this._events = {};
// If there is no 'error' event listener then throw.
if (type === 'error') {
if (!this._events.error ||
(isObject(this._events.error) && !this._events.error.length)) {
er = arguments[1];
if (er instanceof Error) {
throw er; // Unhandled 'error' event
}
throw TypeError('Uncaught, unspecified "error" event.');
}
}
handler = this._events[type];
if (isUndefined(handler))
return false;
if (isFunction(handler)) {
switch (arguments.length) {
// fast cases
case 1:
handler.call(this);
break;
case 2:
handler.call(this, arguments[1]);
break;
case 3:
handler.call(this, arguments[1], arguments[2]);
break;
// slower
default:
args = Array.prototype.slice.call(arguments, 1);
handler.apply(this, args);
}
} else if (isObject(handler)) {
args = Array.prototype.slice.call(arguments, 1);
listeners = handler.slice();
len = listeners.length;
for (i = 0; i < len; i++)
listeners[i].apply(this, args);
}
return true;
};
EventEmitter.prototype.addListener = function(type, listener) {
var m;
if (!isFunction(listener))
throw TypeError('listener must be a function');
if (!this._events)
this._events = {};
// To avoid recursion in the case that type === "newListener"! Before
// adding it to the listeners, first emit "newListener".
if (this._events.newListener)
this.emit('newListener', type,
isFunction(listener.listener) ?
listener.listener : listener);
if (!this._events[type])
// Optimize the case of one listener. Don't need the extra array object.
this._events[type] = listener;
else if (isObject(this._events[type]))
// If we've already got an array, just append.
this._events[type].push(listener);
else
// Adding the second element, need to change to array.
this._events[type] = [this._events[type], listener];
// Check for listener leak
if (isObject(this._events[type]) && !this._events[type].warned) {
if (!isUndefined(this._maxListeners)) {
m = this._maxListeners;
} else {
m = EventEmitter.defaultMaxListeners;
}
if (m && m > 0 && this._events[type].length > m) {
this._events[type].warned = true;
console.error('(node) warning: possible EventEmitter memory ' +
'leak detected. %d listeners added. ' +
'Use emitter.setMaxListeners() to increase limit.',
this._events[type].length);
if (typeof console.trace === 'function') {
// not supported in IE 10
console.trace();
}
}
}
return this;
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.once = function(type, listener) {
if (!isFunction(listener))
throw TypeError('listener must be a function');
var fired = false;
function g() {
this.removeListener(type, g);
if (!fired) {
fired = true;
listener.apply(this, arguments);
}
}
g.listener = listener;
this.on(type, g);
return this;
};
// emits a 'removeListener' event iff the listener was removed
EventEmitter.prototype.removeListener = function(type, listener) {
var list, position, length, i;
if (!isFunction(listener))
throw TypeError('listener must be a function');
if (!this._events || !this._events[type])
return this;
list = this._events[type];
length = list.length;
position = -1;
if (list === listener ||
(isFunction(list.listener) && list.listener === listener)) {
delete this._events[type];
if (this._events.removeListener)
this.emit('removeListener', type, listener);
} else if (isObject(list)) {
for (i = length; i-- > 0;) {
if (list[i] === listener ||
(list[i].listener && list[i].listener === listener)) {
position = i;
break;
}
}
if (position < 0)
return this;
if (list.length === 1) {
list.length = 0;
delete this._events[type];
} else {
list.splice(position, 1);
}
if (this._events.removeListener)
this.emit('removeListener', type, listener);
}
return this;
};
EventEmitter.prototype.removeAllListeners = function(type) {
var key, listeners;
if (!this._events)
return this;
// not listening for removeListener, no need to emit
if (!this._events.removeListener) {
if (arguments.length === 0)
this._events = {};
else if (this._events[type])
delete this._events[type];
return this;
}
// emit removeListener for all listeners on all events
if (arguments.length === 0) {
for (key in this._events) {
if (key === 'removeListener') continue;
this.removeAllListeners(key);
}
this.removeAllListeners('removeListener');
this._events = {};
return this;
}
listeners = this._events[type];
if (isFunction(listeners)) {
this.removeListener(type, listeners);
} else if (listeners) {
// LIFO order
while (listeners.length)
this.removeListener(type, listeners[listeners.length - 1]);
}
delete this._events[type];
return this;
};
EventEmitter.prototype.listeners = function(type) {
var ret;
if (!this._events || !this._events[type])
ret = [];
else if (isFunction(this._events[type]))
ret = [this._events[type]];
else
ret = this._events[type].slice();
return ret;
};
EventEmitter.prototype.listenerCount = function(type) {
if (this._events) {
var evlistener = this._events[type];
if (isFunction(evlistener))
return 1;
else if (evlistener)
return evlistener.length;
}
return 0;
};
EventEmitter.listenerCount = function(emitter, type) {
return emitter.listenerCount(type);
};
function isFunction(arg) {
return typeof arg === 'function';
}
function isNumber(arg) {
return typeof arg === 'number';
}
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
function isUndefined(arg) {
return arg === void 0;
}
/***/ },
/* 54 */
/***/ function(module, exports, __webpack_require__) {
var ElementType = __webpack_require__(55);
var re_whitespace = /\s+/g;
var NodePrototype = __webpack_require__(56);
var ElementPrototype = __webpack_require__(57);
function DomHandler(callback, options, elementCB){
if(typeof callback === "object"){
elementCB = options;
options = callback;
callback = null;
} else if(typeof options === "function"){
elementCB = options;
options = defaultOpts;
}
this._callback = callback;
this._options = options || defaultOpts;
this._elementCB = elementCB;
this.dom = [];
this._done = false;
this._tagStack = [];
this._parser = this._parser || null;
}
//default options
var defaultOpts = {
normalizeWhitespace: false, //Replace all whitespace with single spaces
withStartIndices: false, //Add startIndex properties to nodes
};
DomHandler.prototype.onparserinit = function(parser){
this._parser = parser;
};
//Resets the handler back to starting state
DomHandler.prototype.onreset = function(){
DomHandler.call(this, this._callback, this._options, this._elementCB);
};
//Signals the handler that parsing is done
DomHandler.prototype.onend = function(){
if(this._done) return;
this._done = true;
this._parser = null;
this._handleCallback(null);
};
DomHandler.prototype._handleCallback =
DomHandler.prototype.onerror = function(error){
if(typeof this._callback === "function"){
this._callback(error, this.dom);
} else {
if(error) throw error;
}
};
DomHandler.prototype.onclosetag = function(){
//if(this._tagStack.pop().name !== name) this._handleCallback(Error("Tagname didn't match!"));
var elem = this._tagStack.pop();
if(this._elementCB) this._elementCB(elem);
};
DomHandler.prototype._addDomElement = function(element){
var parent = this._tagStack[this._tagStack.length - 1];
var siblings = parent ? parent.children : this.dom;
var previousSibling = siblings[siblings.length - 1];
element.next = null;
if(this._options.withStartIndices){
element.startIndex = this._parser.startIndex;
}
if (this._options.withDomLvl1) {
element.__proto__ = element.type === "tag" ? ElementPrototype : NodePrototype;
}
if(previousSibling){
element.prev = previousSibling;
previousSibling.next = element;
} else {
element.prev = null;
}
siblings.push(element);
element.parent = parent || null;
};
DomHandler.prototype.onopentag = function(name, attribs){
var element = {
type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag,
name: name,
attribs: attribs,
children: []
};
this._addDomElement(element);
this._tagStack.push(element);
};
DomHandler.prototype.ontext = function(data){
//the ignoreWhitespace is officially dropped, but for now,
//it's an alias for normalizeWhitespace
var normalize = this._options.normalizeWhitespace || this._options.ignoreWhitespace;
var lastTag;
if(!this._tagStack.length && this.dom.length && (lastTag = this.dom[this.dom.length-1]).type === ElementType.Text){
if(normalize){
lastTag.data = (lastTag.data + data).replace(re_whitespace, " ");
} else {
lastTag.data += data;
}
} else {
if(
this._tagStack.length &&
(lastTag = this._tagStack[this._tagStack.length - 1]) &&
(lastTag = lastTag.children[lastTag.children.length - 1]) &&
lastTag.type === ElementType.Text
){
if(normalize){
lastTag.data = (lastTag.data + data).replace(re_whitespace, " ");
} else {
lastTag.data += data;
}
} else {
if(normalize){
data = data.replace(re_whitespace, " ");
}
this._addDomElement({
data: data,
type: ElementType.Text
});
}
}
};
DomHandler.prototype.oncomment = function(data){
var lastTag = this._tagStack[this._tagStack.length - 1];
if(lastTag && lastTag.type === ElementType.Comment){
lastTag.data += data;
return;
}
var element = {
data: data,
type: ElementType.Comment
};
this._addDomElement(element);
this._tagStack.push(element);
};
DomHandler.prototype.oncdatastart = function(){
var element = {
children: [{
data: "",
type: ElementType.Text
}],
type: ElementType.CDATA
};
this._addDomElement(element);
this._tagStack.push(element);
};
DomHandler.prototype.oncommentend = DomHandler.prototype.oncdataend = function(){
this._tagStack.pop();
};
DomHandler.prototype.onprocessinginstruction = function(name, data){
this._addDomElement({
name: name,
data: data,
type: ElementType.Directive
});
};
module.exports = DomHandler;
/***/ },
/* 55 */
/***/ function(module, exports) {
//Types of elements found in the DOM
module.exports = {
Text: "text", //Text
Directive: "directive", //<? ... ?>
Comment: "comment", //<!-- ... -->
Script: "script", //<script> tags
Style: "style", //<style> tags
Tag: "tag", //Any tag
CDATA: "cdata", //<![CDATA[ ... ]]>
Doctype: "doctype",
isTag: function(elem){
return elem.type === "tag" || elem.type === "script" || elem.type === "style";
}
};
/***/ },
/* 56 */
/***/ function(module, exports) {
// This object will be used as the prototype for Nodes when creating a
// DOM-Level-1-compliant structure.
var NodePrototype = module.exports = {
get firstChild() {
var children = this.children;
return children && children[0] || null;
},
get lastChild() {
var children = this.children;
return children && children[children.length - 1] || null;
},
get nodeType() {
return nodeTypes[this.type] || nodeTypes.element;
}
};
var domLvl1 = {
tagName: "name",
childNodes: "children",
parentNode: "parent",
previousSibling: "prev",
nextSibling: "next",
nodeValue: "data"
};
var nodeTypes = {
element: 1,
text: 3,
cdata: 4,
comment: 8
};
Object.keys(domLvl1).forEach(function(key) {
var shorthand = domLvl1[key];
Object.defineProperty(NodePrototype, key, {
get: function() {
return this[shorthand] || null;
},
set: function(val) {
this[shorthand] = val;
return val;
}
});
});
/***/ },
/* 57 */
/***/ function(module, exports, __webpack_require__) {
// DOM-Level-1-compliant structure
var NodePrototype = __webpack_require__(56);
var ElementPrototype = module.exports = Object.create(NodePrototype);
var domLvl1 = {
tagName: "name"
};
Object.keys(domLvl1).forEach(function(key) {
var shorthand = domLvl1[key];
Object.defineProperty(ElementPrototype, key, {
get: function() {
return this[shorthand] || null;
},
set: function(val) {
this[shorthand] = val;
return val;
}
});
});
/***/ },
/* 58 */
/***/ function(module, exports, __webpack_require__) {
var index = __webpack_require__(41),
DomHandler = index.DomHandler,
DomUtils = index.DomUtils;
//TODO: make this a streamable handler
function FeedHandler(callback, options){
this.init(callback, options);
}
__webpack_require__(49).inherits(FeedHandler, DomHandler);
FeedHandler.prototype.init = DomHandler;
function getElements(what, where){
return DomUtils.getElementsByTagName(what, where, true);
}
function getOneElement(what, where){
return DomUtils.getElementsByTagName(what, where, true, 1)[0];
}
function fetch(what, where, recurse){
return DomUtils.getText(
DomUtils.getElementsByTagName(what, where, recurse, 1)
).trim();
}
function addConditionally(obj, prop, what, where, recurse){
var tmp = fetch(what, where, recurse);
if(tmp) obj[prop] = tmp;
}
var isValidFeed = function(value){
return value === "rss" || value === "feed" || value === "rdf:RDF";
};
FeedHandler.prototype.onend = function(){
var feed = {},
feedRoot = getOneElement(isValidFeed, this.dom),
tmp, childs;
if(feedRoot){
if(feedRoot.name === "feed"){
childs = feedRoot.children;
feed.type = "atom";
addConditionally(feed, "id", "id", childs);
addConditionally(feed, "title", "title", childs);
if((tmp = getOneElement("link", childs)) && (tmp = tmp.attribs) && (tmp = tmp.href)) feed.link = tmp;
addConditionally(feed, "description", "subtitle", childs);
if((tmp = fetch("updated", childs))) feed.updated = new Date(tmp);
addConditionally(feed, "author", "email", childs, true);
feed.items = getElements("entry", childs).map(function(item){
var entry = {}, tmp;
item = item.children;
addConditionally(entry, "id", "id", item);
addConditionally(entry, "title", "title", item);
if((tmp = getOneElement("link", item)) && (tmp = tmp.attribs) && (tmp = tmp.href)) entry.link = tmp;
if((tmp = fetch("summary", item) || fetch("content", item))) entry.description = tmp;
if((tmp = fetch("updated", item))) entry.pubDate = new Date(tmp);
return entry;
});
} else {
childs = getOneElement("channel", feedRoot.children).children;
feed.type = feedRoot.name.substr(0, 3);
feed.id = "";
addConditionally(feed, "title", "title", childs);
addConditionally(feed, "link", "link", childs);
addConditionally(feed, "description", "description", childs);
if((tmp = fetch("lastBuildDate", childs))) feed.updated = new Date(tmp);
addConditionally(feed, "author", "managingEditor", childs, true);
feed.items = getElements("item", feedRoot.children).map(function(item){
var entry = {}, tmp;
item = item.children;
addConditionally(entry, "id", "guid", item);
addConditionally(entry, "title", "title", item);
addConditionally(entry, "link", "link", item);
addConditionally(entry, "description", "description", item);
if((tmp = fetch("pubDate", item))) entry.pubDate = new Date(tmp);
return entry;
});
}
}
this.dom = feed;
DomHandler.prototype._handleCallback.call(
this, feedRoot ? null : Error("couldn't find root of feed")
);
};
module.exports = FeedHandler;
/***/ },
/* 59 */
/***/ function(module, exports, __webpack_require__) {
module.exports = Stream;
var Parser = __webpack_require__(60);
function Stream(options){
Parser.call(this, new Cbs(this), options);
}
__webpack_require__(49).inherits(Stream, Parser);
Stream.prototype.readable = true;
function Cbs(scope){
this.scope = scope;
}
var EVENTS = __webpack_require__(41).EVENTS;
Object.keys(EVENTS).forEach(function(name){
if(EVENTS[name] === 0){
Cbs.prototype["on" + name] = function(){
this.scope.emit(name);
};
} else if(EVENTS[name] === 1){
Cbs.prototype["on" + name] = function(a){
this.scope.emit(name, a);
};
} else if(EVENTS[name] === 2){
Cbs.prototype["on" + name] = function(a, b){
this.scope.emit(name, a, b);
};
} else {
throw Error("wrong number of arguments!");
}
});
/***/ },
/* 60 */
/***/ function(module, exports, __webpack_require__) {
module.exports = Stream;
var Parser = __webpack_require__(42),
WritableStream = __webpack_require__(61).Writable || __webpack_require__(82).Writable;
function Stream(cbs, options){
var parser = this._parser = new Parser(cbs, options);
WritableStream.call(this, {decodeStrings: false});
this.once("finish", function(){
parser.end();
});
}
__webpack_require__(49).inherits(Stream, WritableStream);
WritableStream.prototype._write = function(chunk, encoding, cb){
this._parser.write(chunk);
cb();
};
/***/ },
/* 61 */
/***/ function(module, exports, __webpack_require__) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
module.exports = Stream;
var EE = __webpack_require__(53).EventEmitter;
var inherits = __webpack_require__(62);
inherits(Stream, EE);
Stream.Readable = __webpack_require__(63);
Stream.Writable = __webpack_require__(78);
Stream.Duplex = __webpack_require__(79);
Stream.Transform = __webpack_require__(80);
Stream.PassThrough = __webpack_require__(81);
// Backwards-compat with node 0.4.x
Stream.Stream = Stream;
// old-style streams. Note that the pipe method (the only relevant
// part of this class) is overridden in the Readable class.
function Stream() {
EE.call(this);
}
Stream.prototype.pipe = function(dest, options) {
var source = this;
function ondata(chunk) {
if (dest.writable) {
if (false === dest.write(chunk) && source.pause) {
source.pause();
}
}
}
source.on('data', ondata);
function ondrain() {
if (source.readable && source.resume) {
source.resume();
}
}
dest.on('drain', ondrain);
// If the 'end' option is not supplied, dest.end() will be called when
// source gets the 'end' or 'close' events. Only dest.end() once.
if (!dest._isStdio && (!options || options.end !== false)) {
source.on('end', onend);
source.on('close', onclose);
}
var didOnEnd = false;
function onend() {
if (didOnEnd) return;
didOnEnd = true;
dest.end();
}
function onclose() {
if (didOnEnd) return;
didOnEnd = true;
if (typeof dest.destroy === 'function') dest.destroy();
}
// don't leave dangling pipes when there are errors.
function onerror(er) {
cleanup();
if (EE.listenerCount(this, 'error') === 0) {
throw er; // Unhandled stream error in pipe.
}
}
source.on('error', onerror);
dest.on('error', onerror);
// remove all the event listeners that were added.
function cleanup() {
source.removeListener('data', ondata);
dest.removeListener('drain', ondrain);
source.removeListener('end', onend);
source.removeListener('close', onclose);
source.removeListener('error', onerror);
dest.removeListener('error', onerror);
source.removeListener('end', cleanup);
source.removeListener('close', cleanup);
dest.removeListener('close', cleanup);
}
source.on('end', cleanup);
source.on('close', cleanup);
dest.on('close', cleanup);
dest.emit('pipe', source);
// Allow for unix-like usage: A.pipe(B).pipe(C)
return dest;
};
/***/ },
/* 62 */
/***/ function(module, exports) {
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
/***/ },
/* 63 */
/***/ function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(64);
exports.Stream = __webpack_require__(61);
exports.Readable = exports;
exports.Writable = __webpack_require__(74);
exports.Duplex = __webpack_require__(73);
exports.Transform = __webpack_require__(76);
exports.PassThrough = __webpack_require__(77);
/***/ },
/* 64 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
module.exports = Readable;
/*<replacement>*/
var isArray = __webpack_require__(65);
/*</replacement>*/
/*<replacement>*/
var Buffer = __webpack_require__(66).Buffer;
/*</replacement>*/
Readable.ReadableState = ReadableState;
var EE = __webpack_require__(53).EventEmitter;
/*<replacement>*/
if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
return emitter.listeners(type).length;
};
/*</replacement>*/
var Stream = __webpack_require__(61);
/*<replacement>*/
var util = __webpack_require__(70);
util.inherits = __webpack_require__(71);
/*</replacement>*/
var StringDecoder;
/*<replacement>*/
var debug = __webpack_require__(72);
if (debug && debug.debuglog) {
debug = debug.debuglog('stream');
} else {
debug = function () {};
}
/*</replacement>*/
util.inherits(Readable, Stream);
function ReadableState(options, stream) {
var Duplex = __webpack_require__(73);
options = options || {};
// the point at which it stops calling _read() to fill the buffer
// Note: 0 is a valid value, means "don't call _read preemptively ever"
var hwm = options.highWaterMark;
var defaultHwm = options.objectMode ? 16 : 16 * 1024;
this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
// cast to ints.
this.highWaterMark = ~~this.highWaterMark;
this.buffer = [];
this.length = 0;
this.pipes = null;
this.pipesCount = 0;
this.flowing = null;
this.ended = false;
this.endEmitted = false;
this.reading = false;
// a flag to be able to tell if the onwrite cb is called immediately,
// or on a later tick. We set this to true at first, because any
// actions that shouldn't happen until "later" should generally also
// not happen before the first write call.
this.sync = true;
// whenever we return null, then we set a flag to say
// that we're awaiting a 'readable' event emission.
this.needReadable = false;
this.emittedReadable = false;
this.readableListening = false;
// object stream flag. Used to make read(n) ignore n and to
// make all the buffer merging and length checks go away
this.objectMode = !!options.objectMode;
if (stream instanceof Duplex)
this.objectMode = this.objectMode || !!options.readableObjectMode;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// when piping, we only care about 'readable' events that happen
// after read()ing all the bytes and not getting any pushback.
this.ranOut = false;
// the number of writers that are awaiting a drain event in .pipe()s
this.awaitDrain = 0;
// if true, a maybeReadMore has been scheduled
this.readingMore = false;
this.decoder = null;
this.encoding = null;
if (options.encoding) {
if (!StringDecoder)
StringDecoder = __webpack_require__(75).StringDecoder;
this.decoder = new StringDecoder(options.encoding);
this.encoding = options.encoding;
}
}
function Readable(options) {
var Duplex = __webpack_require__(73);
if (!(this instanceof Readable))
return new Readable(options);
this._readableState = new ReadableState(options, this);
// legacy
this.readable = true;
Stream.call(this);
}
// Manually shove something into the read() buffer.
// This returns true if the highWaterMark has not been hit yet,
// similar to how Writable.write() returns true if you should
// write() some more.
Readable.prototype.push = function(chunk, encoding) {
var state = this._readableState;
if (util.isString(chunk) && !state.objectMode) {
encoding = encoding || state.defaultEncoding;
if (encoding !== state.encoding) {
chunk = new Buffer(chunk, encoding);
encoding = '';
}
}
return readableAddChunk(this, state, chunk, encoding, false);
};
// Unshift should *always* be something directly out of read()
Readable.prototype.unshift = function(chunk) {
var state = this._readableState;
return readableAddChunk(this, state, chunk, '', true);
};
function readableAddChunk(stream, state, chunk, encoding, addToFront) {
var er = chunkInvalid(state, chunk);
if (er) {
stream.emit('error', er);
} else if (util.isNullOrUndefined(chunk)) {
state.reading = false;
if (!state.ended)
onEofChunk(stream, state);
} else if (state.objectMode || chunk && chunk.length > 0) {
if (state.ended && !addToFront) {
var e = new Error('stream.push() after EOF');
stream.emit('error', e);
} else if (state.endEmitted && addToFront) {
var e = new Error('stream.unshift() after end event');
stream.emit('error', e);
} else {
if (state.decoder && !addToFront && !encoding)
chunk = state.decoder.write(chunk);
if (!addToFront)
state.reading = false;
// if we want the data now, just emit it.
if (state.flowing && state.length === 0 && !state.sync) {
stream.emit('data', chunk);
stream.read(0);
} else {
// update the buffer info.
state.length += state.objectMode ? 1 : chunk.length;
if (addToFront)
state.buffer.unshift(chunk);
else
state.buffer.push(chunk);
if (state.needReadable)
emitReadable(stream);
}
maybeReadMore(stream, state);
}
} else if (!addToFront) {
state.reading = false;
}
return needMoreData(state);
}
// if it's past the high water mark, we can push in some more.
// Also, if we have no data yet, we can stand some
// more bytes. This is to work around cases where hwm=0,
// such as the repl. Also, if the push() triggered a
// readable event, and the user called read(largeNumber) such that
// needReadable was set, then we ought to push more, so that another
// 'readable' event will be triggered.
function needMoreData(state) {
return !state.ended &&
(state.needReadable ||
state.length < state.highWaterMark ||
state.length === 0);
}
// backwards compatibility.
Readable.prototype.setEncoding = function(enc) {
if (!StringDecoder)
StringDecoder = __webpack_require__(75).StringDecoder;
this._readableState.decoder = new StringDecoder(enc);
this._readableState.encoding = enc;
return this;
};
// Don't raise the hwm > 128MB
var MAX_HWM = 0x800000;
function roundUpToNextPowerOf2(n) {
if (n >= MAX_HWM) {
n = MAX_HWM;
} else {
// Get the next highest power of 2
n--;
for (var p = 1; p < 32; p <<= 1) n |= n >> p;
n++;
}
return n;
}
function howMuchToRead(n, state) {
if (state.length === 0 && state.ended)
return 0;
if (state.objectMode)
return n === 0 ? 0 : 1;
if (isNaN(n) || util.isNull(n)) {
// only flow one buffer at a time
if (state.flowing && state.buffer.length)
return state.buffer[0].length;
else
return state.length;
}
if (n <= 0)
return 0;
// If we're asking for more than the target buffer level,
// then raise the water mark. Bump up to the next highest
// power of 2, to prevent increasing it excessively in tiny
// amounts.
if (n > state.highWaterMark)
state.highWaterMark = roundUpToNextPowerOf2(n);
// don't have that much. return null, unless we've ended.
if (n > state.length) {
if (!state.ended) {
state.needReadable = true;
return 0;
} else
return state.length;
}
return n;
}
// you can override either this method, or the async _read(n) below.
Readable.prototype.read = function(n) {
debug('read', n);
var state = this._readableState;
var nOrig = n;
if (!util.isNumber(n) || n > 0)
state.emittedReadable = false;
// if we're doing read(0) to trigger a readable event, but we
// already have a bunch of data in the buffer, then just trigger
// the 'readable' event and move on.
if (n === 0 &&
state.needReadable &&
(state.length >= state.highWaterMark || state.ended)) {
debug('read: emitReadable', state.length, state.ended);
if (state.length === 0 && state.ended)
endReadable(this);
else
emitReadable(this);
return null;
}
n = howMuchToRead(n, state);
// if we've ended, and we're now clear, then finish it up.
if (n === 0 && state.ended) {
if (state.length === 0)
endReadable(this);
return null;
}
// All the actual chunk generation logic needs to be
// *below* the call to _read. The reason is that in certain
// synthetic stream cases, such as passthrough streams, _read
// may be a completely synchronous operation which may change
// the state of the read buffer, providing enough data when
// before there was *not* enough.
//
// So, the steps are:
// 1. Figure out what the state of things will be after we do
// a read from the buffer.
//
// 2. If that resulting state will trigger a _read, then call _read.
// Note that this may be asynchronous, or synchronous. Yes, it is
// deeply ugly to write APIs this way, but that still doesn't mean
// that the Readable class should behave improperly, as streams are
// designed to be sync/async agnostic.
// Take note if the _read call is sync or async (ie, if the read call
// has returned yet), so that we know whether or not it's safe to emit
// 'readable' etc.
//
// 3. Actually pull the requested chunks out of the buffer and return.
// if we need a readable event, then we need to do some reading.
var doRead = state.needReadable;
debug('need readable', doRead);
// if we currently have less than the highWaterMark, then also read some
if (state.length === 0 || state.length - n < state.highWaterMark) {
doRead = true;
debug('length less than watermark', doRead);
}
// however, if we've ended, then there's no point, and if we're already
// reading, then it's unnecessary.
if (state.ended || state.reading) {
doRead = false;
debug('reading or ended', doRead);
}
if (doRead) {
debug('do read');
state.reading = true;
state.sync = true;
// if the length is currently zero, then we *need* a readable event.
if (state.length === 0)
state.needReadable = true;
// call internal read method
this._read(state.highWaterMark);
state.sync = false;
}
// If _read pushed data synchronously, then `reading` will be false,
// and we need to re-evaluate how much data we can return to the user.
if (doRead && !state.reading)
n = howMuchToRead(nOrig, state);
var ret;
if (n > 0)
ret = fromList(n, state);
else
ret = null;
if (util.isNull(ret)) {
state.needReadable = true;
n = 0;
}
state.length -= n;
// If we have nothing in the buffer, then we want to know
// as soon as we *do* get something into the buffer.
if (state.length === 0 && !state.ended)
state.needReadable = true;
// If we tried to read() past the EOF, then emit end on the next tick.
if (nOrig !== n && state.ended && state.length === 0)
endReadable(this);
if (!util.isNull(ret))
this.emit('data', ret);
return ret;
};
function chunkInvalid(state, chunk) {
var er = null;
if (!util.isBuffer(chunk) &&
!util.isString(chunk) &&
!util.isNullOrUndefined(chunk) &&
!state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
return er;
}
function onEofChunk(stream, state) {
if (state.decoder && !state.ended) {
var chunk = state.decoder.end();
if (chunk && chunk.length) {
state.buffer.push(chunk);
state.length += state.objectMode ? 1 : chunk.length;
}
}
state.ended = true;
// emit 'readable' now to make sure it gets picked up.
emitReadable(stream);
}
// Don't emit readable right away in sync mode, because this can trigger
// another read() call => stack overflow. This way, it might trigger
// a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) {
var state = stream._readableState;
state.needReadable = false;
if (!state.emittedReadable) {
debug('emitReadable', state.flowing);
state.emittedReadable = true;
if (state.sync)
process.nextTick(function() {
emitReadable_(stream);
});
else
emitReadable_(stream);
}
}
function emitReadable_(stream) {
debug('emit readable');
stream.emit('readable');
flow(stream);
}
// at this point, the user has presumably seen the 'readable' event,
// and called read() to consume some data. that may have triggered
// in turn another _read(n) call, in which case reading = true if
// it's in progress.
// However, if we're not ended, or reading, and the length < hwm,
// then go ahead and try to read some more preemptively.
function maybeReadMore(stream, state) {
if (!state.readingMore) {
state.readingMore = true;
process.nextTick(function() {
maybeReadMore_(stream, state);
});
}
}
function maybeReadMore_(stream, state) {
var len = state.length;
while (!state.reading && !state.flowing && !state.ended &&
state.length < state.highWaterMark) {
debug('maybeReadMore read 0');
stream.read(0);
if (len === state.length)
// didn't get any data, stop spinning.
break;
else
len = state.length;
}
state.readingMore = false;
}
// abstract method. to be overridden in specific implementation classes.
// call cb(er, data) where data is <= n in length.
// for virtual (non-string, non-buffer) streams, "length" is somewhat
// arbitrary, and perhaps not very meaningful.
Readable.prototype._read = function(n) {
this.emit('error', new Error('not implemented'));
};
Readable.prototype.pipe = function(dest, pipeOpts) {
var src = this;
var state = this._readableState;
switch (state.pipesCount) {
case 0:
state.pipes = dest;
break;
case 1:
state.pipes = [state.pipes, dest];
break;
default:
state.pipes.push(dest);
break;
}
state.pipesCount += 1;
debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
dest !== process.stdout &&
dest !== process.stderr;
var endFn = doEnd ? onend : cleanup;
if (state.endEmitted)
process.nextTick(endFn);
else
src.once('end', endFn);
dest.on('unpipe', onunpipe);
function onunpipe(readable) {
debug('onunpipe');
if (readable === src) {
cleanup();
}
}
function onend() {
debug('onend');
dest.end();
}
// when the dest drains, it reduces the awaitDrain counter
// on the source. This would be more elegant with a .once()
// handler in flow(), but adding and removing repeatedly is
// too slow.
var ondrain = pipeOnDrain(src);
dest.on('drain', ondrain);
function cleanup() {
debug('cleanup');
// cleanup event handlers once the pipe is broken
dest.removeListener('close', onclose);
dest.removeListener('finish', onfinish);
dest.removeListener('drain', ondrain);
dest.removeListener('error', onerror);
dest.removeListener('unpipe', onunpipe);
src.removeListener('end', onend);
src.removeListener('end', cleanup);
src.removeListener('data', ondata);
// if the reader is waiting for a drain event from this
// specific writer, then it would cause it to never start
// flowing again.
// So, if this is awaiting a drain, then we just call it now.
// If we don't know, then assume that we are waiting for one.
if (state.awaitDrain &&
(!dest._writableState || dest._writableState.needDrain))
ondrain();
}
src.on('data', ondata);
function ondata(chunk) {
debug('ondata');
var ret = dest.write(chunk);
if (false === ret) {
debug('false write response, pause',
src._readableState.awaitDrain);
src._readableState.awaitDrain++;
src.pause();
}
}
// if the dest has an error, then stop piping into it.
// however, don't suppress the throwing behavior for this.
function onerror(er) {
debug('onerror', er);
unpipe();
dest.removeListener('error', onerror);
if (EE.listenerCount(dest, 'error') === 0)
dest.emit('error', er);
}
// This is a brutally ugly hack to make sure that our error handler
// is attached before any userland ones. NEVER DO THIS.
if (!dest._events || !dest._events.error)
dest.on('error', onerror);
else if (isArray(dest._events.error))
dest._events.error.unshift(onerror);
else
dest._events.error = [onerror, dest._events.error];
// Both close and finish should trigger unpipe, but only once.
function onclose() {
dest.removeListener('finish', onfinish);
unpipe();
}
dest.once('close', onclose);
function onfinish() {
debug('onfinish');
dest.removeListener('close', onclose);
unpipe();
}
dest.once('finish', onfinish);
function unpipe() {
debug('unpipe');
src.unpipe(dest);
}
// tell the dest that it's being piped to
dest.emit('pipe', src);
// start the flow if it hasn't been started already.
if (!state.flowing) {
debug('pipe resume');
src.resume();
}
return dest;
};
function pipeOnDrain(src) {
return function() {
var state = src._readableState;
debug('pipeOnDrain', state.awaitDrain);
if (state.awaitDrain)
state.awaitDrain--;
if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) {
state.flowing = true;
flow(src);
}
};
}
Readable.prototype.unpipe = function(dest) {
var state = this._readableState;
// if we're not piping anywhere, then do nothing.
if (state.pipesCount === 0)
return this;
// just one destination. most common case.
if (state.pipesCount === 1) {
// passed in one, but it's not the right one.
if (dest && dest !== state.pipes)
return this;
if (!dest)
dest = state.pipes;
// got a match.
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
if (dest)
dest.emit('unpipe', this);
return this;
}
// slow case. multiple pipe destinations.
if (!dest) {
// remove all.
var dests = state.pipes;
var len = state.pipesCount;
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
for (var i = 0; i < len; i++)
dests[i].emit('unpipe', this);
return this;
}
// try to find the right one.
var i = indexOf(state.pipes, dest);
if (i === -1)
return this;
state.pipes.splice(i, 1);
state.pipesCount -= 1;
if (state.pipesCount === 1)
state.pipes = state.pipes[0];
dest.emit('unpipe', this);
return this;
};
// set up data events if they are asked for
// Ensure readable listeners eventually get something
Readable.prototype.on = function(ev, fn) {
var res = Stream.prototype.on.call(this, ev, fn);
// If listening to data, and it has not explicitly been paused,
// then call resume to start the flow of data on the next tick.
if (ev === 'data' && false !== this._readableState.flowing) {
this.resume();
}
if (ev === 'readable' && this.readable) {
var state = this._readableState;
if (!state.readableListening) {
state.readableListening = true;
state.emittedReadable = false;
state.needReadable = true;
if (!state.reading) {
var self = this;
process.nextTick(function() {
debug('readable nexttick read 0');
self.read(0);
});
} else if (state.length) {
emitReadable(this, state);
}
}
}
return res;
};
Readable.prototype.addListener = Readable.prototype.on;
// pause() and resume() are remnants of the legacy readable stream API
// If the user uses them, then switch into old mode.
Readable.prototype.resume = function() {
var state = this._readableState;
if (!state.flowing) {
debug('resume');
state.flowing = true;
if (!state.reading) {
debug('resume read 0');
this.read(0);
}
resume(this, state);
}
return this;
};
function resume(stream, state) {
if (!state.resumeScheduled) {
state.resumeScheduled = true;
process.nextTick(function() {
resume_(stream, state);
});
}
}
function resume_(stream, state) {
state.resumeScheduled = false;
stream.emit('resume');
flow(stream);
if (state.flowing && !state.reading)
stream.read(0);
}
Readable.prototype.pause = function() {
debug('call pause flowing=%j', this._readableState.flowing);
if (false !== this._readableState.flowing) {
debug('pause');
this._readableState.flowing = false;
this.emit('pause');
}
return this;
};
function flow(stream) {
var state = stream._readableState;
debug('flow', state.flowing);
if (state.flowing) {
do {
var chunk = stream.read();
} while (null !== chunk && state.flowing);
}
}
// wrap an old-style stream as the async data source.
// This is *not* part of the readable stream interface.
// It is an ugly unfortunate mess of history.
Readable.prototype.wrap = function(stream) {
var state = this._readableState;
var paused = false;
var self = this;
stream.on('end', function() {
debug('wrapped end');
if (state.decoder && !state.ended) {
var chunk = state.decoder.end();
if (chunk && chunk.length)
self.push(chunk);
}
self.push(null);
});
stream.on('data', function(chunk) {
debug('wrapped data');
if (state.decoder)
chunk = state.decoder.write(chunk);
if (!chunk || !state.objectMode && !chunk.length)
return;
var ret = self.push(chunk);
if (!ret) {
paused = true;
stream.pause();
}
});
// proxy all the other methods.
// important when wrapping filters and duplexes.
for (var i in stream) {
if (util.isFunction(stream[i]) && util.isUndefined(this[i])) {
this[i] = function(method) { return function() {
return stream[method].apply(stream, arguments);
}}(i);
}
}
// proxy certain important events.
var events = ['error', 'close', 'destroy', 'pause', 'resume'];
forEach(events, function(ev) {
stream.on(ev, self.emit.bind(self, ev));
});
// when we try to consume some more bytes, simply unpause the
// underlying stream.
self._read = function(n) {
debug('wrapped _read', n);
if (paused) {
paused = false;
stream.resume();
}
};
return self;
};
// exposed for testing purposes only.
Readable._fromList = fromList;
// Pluck off n bytes from an array of buffers.
// Length is the combined lengths of all the buffers in the list.
function fromList(n, state) {
var list = state.buffer;
var length = state.length;
var stringMode = !!state.decoder;
var objectMode = !!state.objectMode;
var ret;
// nothing in the list, definitely empty.
if (list.length === 0)
return null;
if (length === 0)
ret = null;
else if (objectMode)
ret = list.shift();
else if (!n || n >= length) {
// read it all, truncate the array.
if (stringMode)
ret = list.join('');
else
ret = Buffer.concat(list, length);
list.length = 0;
} else {
// read just some of it.
if (n < list[0].length) {
// just take a part of the first list item.
// slice is the same for buffers and strings.
var buf = list[0];
ret = buf.slice(0, n);
list[0] = buf.slice(n);
} else if (n === list[0].length) {
// first list is a perfect match
ret = list.shift();
} else {
// complex case.
// we have enough to cover it, but it spans past the first buffer.
if (stringMode)
ret = '';
else
ret = new Buffer(n);
var c = 0;
for (var i = 0, l = list.length; i < l && c < n; i++) {
var buf = list[0];
var cpy = Math.min(n - c, buf.length);
if (stringMode)
ret += buf.slice(0, cpy);
else
buf.copy(ret, c, 0, cpy);
if (cpy < buf.length)
list[0] = buf.slice(cpy);
else
list.shift();
c += cpy;
}
}
}
return ret;
}
function endReadable(stream) {
var state = stream._readableState;
// If we get here before consuming all the bytes, then that is a
// bug in node. Should never happen.
if (state.length > 0)
throw new Error('endReadable called on non-empty stream');
if (!state.endEmitted) {
state.ended = true;
process.nextTick(function() {
// Check that we didn't get one last unshift.
if (!state.endEmitted && state.length === 0) {
state.endEmitted = true;
stream.readable = false;
stream.emit('end');
}
});
}
}
function forEach (xs, f) {
for (var i = 0, l = xs.length; i < l; i++) {
f(xs[i], i);
}
}
function indexOf (xs, x) {
for (var i = 0, l = xs.length; i < l; i++) {
if (xs[i] === x) return i;
}
return -1;
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(50)))
/***/ },
/* 65 */
/***/ function(module, exports) {
module.exports = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) == '[object Array]';
};
/***/ },
/* 66 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer, global) {/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
/* eslint-disable no-proto */
'use strict'
var base64 = __webpack_require__(67)
var ieee754 = __webpack_require__(68)
var isArray = __webpack_require__(69)
exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50
Buffer.poolSize = 8192 // not used by this implementation
var rootParent = {}
/**
* If `Buffer.TYPED_ARRAY_SUPPORT`:
* === true Use Uint8Array implementation (fastest)
* === false Use Object implementation (most compatible, even IE6)
*
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
* Opera 11.6+, iOS 4.2+.
*
* Due to various browser bugs, sometimes the Object implementation will be used even
* when the browser supports typed arrays.
*
* Note:
*
* - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
*
* - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property
* on objects.
*
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
*
* - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
* incorrect length in some situations.
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
* get the Object implementation, which is slower but behaves correctly.
*/
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
? global.TYPED_ARRAY_SUPPORT
: typedArraySupport()
function typedArraySupport () {
function Bar () {}
try {
var arr = new Uint8Array(1)
arr.foo = function () { return 42 }
arr.constructor = Bar
return arr.foo() === 42 && // typed array instances can be augmented
arr.constructor === Bar && // constructor can be set
typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
} catch (e) {
return false
}
}
function kMaxLength () {
return Buffer.TYPED_ARRAY_SUPPORT
? 0x7fffffff
: 0x3fffffff
}
/**
* Class: Buffer
* =============
*
* The Buffer constructor returns instances of `Uint8Array` that are augmented
* with function properties for all the node `Buffer` API functions. We use
* `Uint8Array` so that square bracket notation works as expected -- it returns
* a single octet.
*
* By augmenting the instances, we can avoid modifying the `Uint8Array`
* prototype.
*/
function Buffer (arg) {
if (!(this instanceof Buffer)) {
// Avoid going through an ArgumentsAdaptorTrampoline in the common case.
if (arguments.length > 1) return new Buffer(arg, arguments[1])
return new Buffer(arg)
}
if (!Buffer.TYPED_ARRAY_SUPPORT) {
this.length = 0
this.parent = undefined
}
// Common case.
if (typeof arg === 'number') {
return fromNumber(this, arg)
}
// Slightly less common case.
if (typeof arg === 'string') {
return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')
}
// Unusual.
return fromObject(this, arg)
}
function fromNumber (that, length) {
that = allocate(that, length < 0 ? 0 : checked(length) | 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) {
for (var i = 0; i < length; i++) {
that[i] = 0
}
}
return that
}
function fromString (that, string, encoding) {
if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8'
// Assumption: byteLength() return value is always < kMaxLength.
var length = byteLength(string, encoding) | 0
that = allocate(that, length)
that.write(string, encoding)
return that
}
function fromObject (that, object) {
if (Buffer.isBuffer(object)) return fromBuffer(that, object)
if (isArray(object)) return fromArray(that, object)
if (object == null) {
throw new TypeError('must start with number, buffer, array or string')
}
if (typeof ArrayBuffer !== 'undefined') {
if (object.buffer instanceof ArrayBuffer) {
return fromTypedArray(that, object)
}
if (object instanceof ArrayBuffer) {
return fromArrayBuffer(that, object)
}
}
if (object.length) return fromArrayLike(that, object)
return fromJsonObject(that, object)
}
function fromBuffer (that, buffer) {
var length = checked(buffer.length) | 0
that = allocate(that, length)
buffer.copy(that, 0, 0, length)
return that
}
function fromArray (that, array) {
var length = checked(array.length) | 0
that = allocate(that, length)
for (var i = 0; i < length; i += 1) {
that[i] = array[i] & 255
}
return that
}
// Duplicate of fromArray() to keep fromArray() monomorphic.
function fromTypedArray (that, array) {
var length = checked(array.length) | 0
that = allocate(that, length)
// Truncating the elements is probably not what people expect from typed
// arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior
// of the old Buffer constructor.
for (var i = 0; i < length; i += 1) {
that[i] = array[i] & 255
}
return that
}
function fromArrayBuffer (that, array) {
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
array.byteLength
that = Buffer._augment(new Uint8Array(array))
} else {
// Fallback: Return an object instance of the Buffer class
that = fromTypedArray(that, new Uint8Array(array))
}
return that
}
function fromArrayLike (that, array) {
var length = checked(array.length) | 0
that = allocate(that, length)
for (var i = 0; i < length; i += 1) {
that[i] = array[i] & 255
}
return that
}
// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object.
// Returns a zero-length buffer for inputs that don't conform to the spec.
function fromJsonObject (that, object) {
var array
var length = 0
if (object.type === 'Buffer' && isArray(object.data)) {
array = object.data
length = checked(array.length) | 0
}
that = allocate(that, length)
for (var i = 0; i < length; i += 1) {
that[i] = array[i] & 255
}
return that
}
if (Buffer.TYPED_ARRAY_SUPPORT) {
Buffer.prototype.__proto__ = Uint8Array.prototype
Buffer.__proto__ = Uint8Array
} else {
// pre-set for values that may exist in the future
Buffer.prototype.length = undefined
Buffer.prototype.parent = undefined
}
function allocate (that, length) {
if (Buffer.TYPED_ARRAY_SUPPORT) {
// Return an augmented `Uint8Array` instance, for best performance
that = Buffer._augment(new Uint8Array(length))
that.__proto__ = Buffer.prototype
} else {
// Fallback: Return an object instance of the Buffer class
that.length = length
that._isBuffer = true
}
var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1
if (fromPool) that.parent = rootParent
return that
}
function checked (length) {
// Note: cannot use `length < kMaxLength` here because that fails when
// length is NaN (which is otherwise coerced to zero.)
if (length >= kMaxLength()) {
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
'size: 0x' + kMaxLength().toString(16) + ' bytes')
}
return length | 0
}
function SlowBuffer (subject, encoding) {
if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding)
var buf = new Buffer(subject, encoding)
delete buf.parent
return buf
}
Buffer.isBuffer = function isBuffer (b) {
return !!(b != null && b._isBuffer)
}
Buffer.compare = function compare (a, b) {
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
throw new TypeError('Arguments must be Buffers')
}
if (a === b) return 0
var x = a.length
var y = b.length
var i = 0
var len = Math.min(x, y)
while (i < len) {
if (a[i] !== b[i]) break
++i
}
if (i !== len) {
x = a[i]
y = b[i]
}
if (x < y) return -1
if (y < x) return 1
return 0
}
Buffer.isEncoding = function isEncoding (encoding) {
switch (String(encoding).toLowerCase()) {
case 'hex':
case 'utf8':
case 'utf-8':
case 'ascii':
case 'binary':
case 'base64':
case 'raw':
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return true
default:
return false
}
}
Buffer.concat = function concat (list, length) {
if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.')
if (list.length === 0) {
return new Buffer(0)
}
var i
if (length === undefined) {
length = 0
for (i = 0; i < list.length; i++) {
length += list[i].length
}
}
var buf = new Buffer(length)
var pos = 0
for (i = 0; i < list.length; i++) {
var item = list[i]
item.copy(buf, pos)
pos += item.length
}
return buf
}
function byteLength (string, encoding) {
if (typeof string !== 'string') string = '' + string
var len = string.length
if (len === 0) return 0
// Use a for loop to avoid recursion
var loweredCase = false
for (;;) {
switch (encoding) {
case 'ascii':
case 'binary':
// Deprecated
case 'raw':
case 'raws':
return len
case 'utf8':
case 'utf-8':
return utf8ToBytes(string).length
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return len * 2
case 'hex':
return len >>> 1
case 'base64':
return base64ToBytes(string).length
default:
if (loweredCase) return utf8ToBytes(string).length // assume utf8
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.byteLength = byteLength
function slowToString (encoding, start, end) {
var loweredCase = false
start = start | 0
end = end === undefined || end === Infinity ? this.length : end | 0
if (!encoding) encoding = 'utf8'
if (start < 0) start = 0
if (end > this.length) end = this.length
if (end <= start) return ''
while (true) {
switch (encoding) {
case 'hex':
return hexSlice(this, start, end)
case 'utf8':
case 'utf-8':
return utf8Slice(this, start, end)
case 'ascii':
return asciiSlice(this, start, end)
case 'binary':
return binarySlice(this, start, end)
case 'base64':
return base64Slice(this, start, end)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return utf16leSlice(this, start, end)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = (encoding + '').toLowerCase()
loweredCase = true
}
}
}
Buffer.prototype.toString = function toString () {
var length = this.length | 0
if (length === 0) return ''
if (arguments.length === 0) return utf8Slice(this, 0, length)
return slowToString.apply(this, arguments)
}
Buffer.prototype.equals = function equals (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return true
return Buffer.compare(this, b) === 0
}
Buffer.prototype.inspect = function inspect () {
var str = ''
var max = exports.INSPECT_MAX_BYTES
if (this.length > 0) {
str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
if (this.length > max) str += ' ... '
}
return '<Buffer ' + str + '>'
}
Buffer.prototype.compare = function compare (b) {
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
if (this === b) return 0
return Buffer.compare(this, b)
}
Buffer.prototype.indexOf = function indexOf (val, byteOffset) {
if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff
else if (byteOffset < -0x80000000) byteOffset = -0x80000000
byteOffset >>= 0
if (this.length === 0) return -1
if (byteOffset >= this.length) return -1
// Negative offsets start from the end of the buffer
if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0)
if (typeof val === 'string') {
if (val.length === 0) return -1 // special case: looking for empty string always fails
return String.prototype.indexOf.call(this, val, byteOffset)
}
if (Buffer.isBuffer(val)) {
return arrayIndexOf(this, val, byteOffset)
}
if (typeof val === 'number') {
if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') {
return Uint8Array.prototype.indexOf.call(this, val, byteOffset)
}
return arrayIndexOf(this, [ val ], byteOffset)
}
function arrayIndexOf (arr, val, byteOffset) {
var foundIndex = -1
for (var i = 0; byteOffset + i < arr.length; i++) {
if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) {
if (foundIndex === -1) foundIndex = i
if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex
} else {
foundIndex = -1
}
}
return -1
}
throw new TypeError('val must be string, number or Buffer')
}
// `get` is deprecated
Buffer.prototype.get = function get (offset) {
console.log('.get() is deprecated. Access using array indexes instead.')
return this.readUInt8(offset)
}
// `set` is deprecated
Buffer.prototype.set = function set (v, offset) {
console.log('.set() is deprecated. Access using array indexes instead.')
return this.writeUInt8(v, offset)
}
function hexWrite (buf, string, offset, length) {
offset = Number(offset) || 0
var remaining = buf.length - offset
if (!length) {
length = remaining
} else {
length = Number(length)
if (length > remaining) {
length = remaining
}
}
// must be an even number of digits
var strLen = string.length
if (strLen % 2 !== 0) throw new Error('Invalid hex string')
if (length > strLen / 2) {
length = strLen / 2
}
for (var i = 0; i < length; i++) {
var parsed = parseInt(string.substr(i * 2, 2), 16)
if (isNaN(parsed)) throw new Error('Invalid hex string')
buf[offset + i] = parsed
}
return i
}
function utf8Write (buf, string, offset, length) {
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}
function asciiWrite (buf, string, offset, length) {
return blitBuffer(asciiToBytes(string), buf, offset, length)
}
function binaryWrite (buf, string, offset, length) {
return asciiWrite(buf, string, offset, length)
}
function base64Write (buf, string, offset, length) {
return blitBuffer(base64ToBytes(string), buf, offset, length)
}
function ucs2Write (buf, string, offset, length) {
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}
Buffer.prototype.write = function write (string, offset, length, encoding) {
// Buffer#write(string)
if (offset === undefined) {
encoding = 'utf8'
length = this.length
offset = 0
// Buffer#write(string, encoding)
} else if (length === undefined && typeof offset === 'string') {
encoding = offset
length = this.length
offset = 0
// Buffer#write(string, offset[, length][, encoding])
} else if (isFinite(offset)) {
offset = offset | 0
if (isFinite(length)) {
length = length | 0
if (encoding === undefined) encoding = 'utf8'
} else {
encoding = length
length = undefined
}
// legacy write(string, encoding, offset, length) - remove in v0.13
} else {
var swap = encoding
encoding = offset
offset = length | 0
length = swap
}
var remaining = this.length - offset
if (length === undefined || length > remaining) length = remaining
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
throw new RangeError('attempt to write outside buffer bounds')
}
if (!encoding) encoding = 'utf8'
var loweredCase = false
for (;;) {
switch (encoding) {
case 'hex':
return hexWrite(this, string, offset, length)
case 'utf8':
case 'utf-8':
return utf8Write(this, string, offset, length)
case 'ascii':
return asciiWrite(this, string, offset, length)
case 'binary':
return binaryWrite(this, string, offset, length)
case 'base64':
// Warning: maxLength not taken into account in base64Write
return base64Write(this, string, offset, length)
case 'ucs2':
case 'ucs-2':
case 'utf16le':
case 'utf-16le':
return ucs2Write(this, string, offset, length)
default:
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
encoding = ('' + encoding).toLowerCase()
loweredCase = true
}
}
}
Buffer.prototype.toJSON = function toJSON () {
return {
type: 'Buffer',
data: Array.prototype.slice.call(this._arr || this, 0)
}
}
function base64Slice (buf, start, end) {
if (start === 0 && end === buf.length) {
return base64.fromByteArray(buf)
} else {
return base64.fromByteArray(buf.slice(start, end))
}
}
function utf8Slice (buf, start, end) {
end = Math.min(buf.length, end)
var res = []
var i = start
while (i < end) {
var firstByte = buf[i]
var codePoint = null
var bytesPerSequence = (firstByte > 0xEF) ? 4
: (firstByte > 0xDF) ? 3
: (firstByte > 0xBF) ? 2
: 1
if (i + bytesPerSequence <= end) {
var secondByte, thirdByte, fourthByte, tempCodePoint
switch (bytesPerSequence) {
case 1:
if (firstByte < 0x80) {
codePoint = firstByte
}
break
case 2:
secondByte = buf[i + 1]
if ((secondByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
if (tempCodePoint > 0x7F) {
codePoint = tempCodePoint
}
}
break
case 3:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
codePoint = tempCodePoint
}
}
break
case 4:
secondByte = buf[i + 1]
thirdByte = buf[i + 2]
fourthByte = buf[i + 3]
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
codePoint = tempCodePoint
}
}
}
}
if (codePoint === null) {
// we did not generate a valid codePoint so insert a
// replacement char (U+FFFD) and advance only 1 byte
codePoint = 0xFFFD
bytesPerSequence = 1
} else if (codePoint > 0xFFFF) {
// encode to utf16 (surrogate pair dance)
codePoint -= 0x10000
res.push(codePoint >>> 10 & 0x3FF | 0xD800)
codePoint = 0xDC00 | codePoint & 0x3FF
}
res.push(codePoint)
i += bytesPerSequence
}
return decodeCodePointsArray(res)
}
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000
function decodeCodePointsArray (codePoints) {
var len = codePoints.length
if (len <= MAX_ARGUMENTS_LENGTH) {
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
}
// Decode in chunks to avoid "call stack size exceeded".
var res = ''
var i = 0
while (i < len) {
res += String.fromCharCode.apply(
String,
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
)
}
return res
}
function asciiSlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; i++) {
ret += String.fromCharCode(buf[i] & 0x7F)
}
return ret
}
function binarySlice (buf, start, end) {
var ret = ''
end = Math.min(buf.length, end)
for (var i = start; i < end; i++) {
ret += String.fromCharCode(buf[i])
}
return ret
}
function hexSlice (buf, start, end) {
var len = buf.length
if (!start || start < 0) start = 0
if (!end || end < 0 || end > len) end = len
var out = ''
for (var i = start; i < end; i++) {
out += toHex(buf[i])
}
return out
}
function utf16leSlice (buf, start, end) {
var bytes = buf.slice(start, end)
var res = ''
for (var i = 0; i < bytes.length; i += 2) {
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
}
return res
}
Buffer.prototype.slice = function slice (start, end) {
var len = this.length
start = ~~start
end = end === undefined ? len : ~~end
if (start < 0) {
start += len
if (start < 0) start = 0
} else if (start > len) {
start = len
}
if (end < 0) {
end += len
if (end < 0) end = 0
} else if (end > len) {
end = len
}
if (end < start) end = start
var newBuf
if (Buffer.TYPED_ARRAY_SUPPORT) {
newBuf = Buffer._augment(this.subarray(start, end))
} else {
var sliceLen = end - start
newBuf = new Buffer(sliceLen, undefined)
for (var i = 0; i < sliceLen; i++) {
newBuf[i] = this[i + start]
}
}
if (newBuf.length) newBuf.parent = this.parent || this
return newBuf
}
/*
* Need to make sure that buffer isn't trying to write out of bounds.
*/
function checkOffset (offset, ext, length) {
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
return val
}
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) {
checkOffset(offset, byteLength, this.length)
}
var val = this[offset + --byteLength]
var mul = 1
while (byteLength > 0 && (mul *= 0x100)) {
val += this[offset + --byteLength] * mul
}
return val
}
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
return this[offset]
}
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return this[offset] | (this[offset + 1] << 8)
}
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
return (this[offset] << 8) | this[offset + 1]
}
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ((this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16)) +
(this[offset + 3] * 0x1000000)
}
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3])
}
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var val = this[offset]
var mul = 1
var i = 0
while (++i < byteLength && (mul *= 0x100)) {
val += this[offset + i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkOffset(offset, byteLength, this.length)
var i = byteLength
var mul = 1
var val = this[offset + --i]
while (i > 0 && (mul *= 0x100)) {
val += this[offset + --i] * mul
}
mul *= 0x80
if (val >= mul) val -= Math.pow(2, 8 * byteLength)
return val
}
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
if (!noAssert) checkOffset(offset, 1, this.length)
if (!(this[offset] & 0x80)) return (this[offset])
return ((0xff - this[offset] + 1) * -1)
}
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset] | (this[offset + 1] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 2, this.length)
var val = this[offset + 1] | (this[offset] << 8)
return (val & 0x8000) ? val | 0xFFFF0000 : val
}
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset]) |
(this[offset + 1] << 8) |
(this[offset + 2] << 16) |
(this[offset + 3] << 24)
}
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return (this[offset] << 24) |
(this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3])
}
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, true, 23, 4)
}
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 4, this.length)
return ieee754.read(this, offset, false, 23, 4)
}
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, true, 52, 8)
}
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
if (!noAssert) checkOffset(offset, 8, this.length)
return ieee754.read(this, offset, false, 52, 8)
}
function checkInt (buf, value, offset, ext, max, min) {
if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance')
if (value > max || value < min) throw new RangeError('value is out of bounds')
if (offset + ext > buf.length) throw new RangeError('index out of range')
}
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
var mul = 1
var i = 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
byteLength = byteLength | 0
if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0)
var i = byteLength - 1
var mul = 1
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = (value / mul) & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
this[offset] = (value & 0xff)
return offset + 1
}
function objectWriteUInt16 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) {
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
(littleEndian ? i : 1 - i) * 8
}
}
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
function objectWriteUInt32 (buf, value, offset, littleEndian) {
if (value < 0) value = 0xffffffff + value + 1
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) {
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
}
}
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset + 3] = (value >>> 24)
this[offset + 2] = (value >>> 16)
this[offset + 1] = (value >>> 8)
this[offset] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = 0
var mul = 1
var sub = value < 0 ? 1 : 0
this[offset] = value & 0xFF
while (++i < byteLength && (mul *= 0x100)) {
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) {
var limit = Math.pow(2, 8 * byteLength - 1)
checkInt(this, value, offset, byteLength, limit - 1, -limit)
}
var i = byteLength - 1
var mul = 1
var sub = value < 0 ? 1 : 0
this[offset + i] = value & 0xFF
while (--i >= 0 && (mul *= 0x100)) {
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
}
return offset + byteLength
}
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
if (value < 0) value = 0xff + value + 1
this[offset] = (value & 0xff)
return offset + 1
}
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
} else {
objectWriteUInt16(this, value, offset, true)
}
return offset + 2
}
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 8)
this[offset + 1] = (value & 0xff)
} else {
objectWriteUInt16(this, value, offset, false)
}
return offset + 2
}
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value & 0xff)
this[offset + 1] = (value >>> 8)
this[offset + 2] = (value >>> 16)
this[offset + 3] = (value >>> 24)
} else {
objectWriteUInt32(this, value, offset, true)
}
return offset + 4
}
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
value = +value
offset = offset | 0
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
if (value < 0) value = 0xffffffff + value + 1
if (Buffer.TYPED_ARRAY_SUPPORT) {
this[offset] = (value >>> 24)
this[offset + 1] = (value >>> 16)
this[offset + 2] = (value >>> 8)
this[offset + 3] = (value & 0xff)
} else {
objectWriteUInt32(this, value, offset, false)
}
return offset + 4
}
function checkIEEE754 (buf, value, offset, ext, max, min) {
if (value > max || value < min) throw new RangeError('value is out of bounds')
if (offset + ext > buf.length) throw new RangeError('index out of range')
if (offset < 0) throw new RangeError('index out of range')
}
function writeFloat (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
}
ieee754.write(buf, value, offset, littleEndian, 23, 4)
return offset + 4
}
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
return writeFloat(this, value, offset, true, noAssert)
}
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
return writeFloat(this, value, offset, false, noAssert)
}
function writeDouble (buf, value, offset, littleEndian, noAssert) {
if (!noAssert) {
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
}
ieee754.write(buf, value, offset, littleEndian, 52, 8)
return offset + 8
}
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
return writeDouble(this, value, offset, true, noAssert)
}
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
return writeDouble(this, value, offset, false, noAssert)
}
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
if (!start) start = 0
if (!end && end !== 0) end = this.length
if (targetStart >= target.length) targetStart = target.length
if (!targetStart) targetStart = 0
if (end > 0 && end < start) end = start
// Copy 0 bytes; we're done
if (end === start) return 0
if (target.length === 0 || this.length === 0) return 0
// Fatal error conditions
if (targetStart < 0) {
throw new RangeError('targetStart out of bounds')
}
if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
if (end < 0) throw new RangeError('sourceEnd out of bounds')
// Are we oob?
if (end > this.length) end = this.length
if (target.length - targetStart < end - start) {
end = target.length - targetStart + start
}
var len = end - start
var i
if (this === target && start < targetStart && targetStart < end) {
// descending copy from end
for (i = len - 1; i >= 0; i--) {
target[i + targetStart] = this[i + start]
}
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
// ascending copy from start
for (i = 0; i < len; i++) {
target[i + targetStart] = this[i + start]
}
} else {
target._set(this.subarray(start, start + len), targetStart)
}
return len
}
// fill(value, start=0, end=buffer.length)
Buffer.prototype.fill = function fill (value, start, end) {
if (!value) value = 0
if (!start) start = 0
if (!end) end = this.length
if (end < start) throw new RangeError('end < start')
// Fill 0 bytes; we're done
if (end === start) return
if (this.length === 0) return
if (start < 0 || start >= this.length) throw new RangeError('start out of bounds')
if (end < 0 || end > this.length) throw new RangeError('end out of bounds')
var i
if (typeof value === 'number') {
for (i = start; i < end; i++) {
this[i] = value
}
} else {
var bytes = utf8ToBytes(value.toString())
var len = bytes.length
for (i = start; i < end; i++) {
this[i] = bytes[i % len]
}
}
return this
}
/**
* Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
* Added in Node 0.12. Only available in browsers that support ArrayBuffer.
*/
Buffer.prototype.toArrayBuffer = function toArrayBuffer () {
if (typeof Uint8Array !== 'undefined') {
if (Buffer.TYPED_ARRAY_SUPPORT) {
return (new Buffer(this)).buffer
} else {
var buf = new Uint8Array(this.length)
for (var i = 0, len = buf.length; i < len; i += 1) {
buf[i] = this[i]
}
return buf.buffer
}
} else {
throw new TypeError('Buffer.toArrayBuffer not supported in this browser')
}
}
// HELPER FUNCTIONS
// ================
var BP = Buffer.prototype
/**
* Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
*/
Buffer._augment = function _augment (arr) {
arr.constructor = Buffer
arr._isBuffer = true
// save reference to original Uint8Array set method before overwriting
arr._set = arr.set
// deprecated
arr.get = BP.get
arr.set = BP.set
arr.write = BP.write
arr.toString = BP.toString
arr.toLocaleString = BP.toString
arr.toJSON = BP.toJSON
arr.equals = BP.equals
arr.compare = BP.compare
arr.indexOf = BP.indexOf
arr.copy = BP.copy
arr.slice = BP.slice
arr.readUIntLE = BP.readUIntLE
arr.readUIntBE = BP.readUIntBE
arr.readUInt8 = BP.readUInt8
arr.readUInt16LE = BP.readUInt16LE
arr.readUInt16BE = BP.readUInt16BE
arr.readUInt32LE = BP.readUInt32LE
arr.readUInt32BE = BP.readUInt32BE
arr.readIntLE = BP.readIntLE
arr.readIntBE = BP.readIntBE
arr.readInt8 = BP.readInt8
arr.readInt16LE = BP.readInt16LE
arr.readInt16BE = BP.readInt16BE
arr.readInt32LE = BP.readInt32LE
arr.readInt32BE = BP.readInt32BE
arr.readFloatLE = BP.readFloatLE
arr.readFloatBE = BP.readFloatBE
arr.readDoubleLE = BP.readDoubleLE
arr.readDoubleBE = BP.readDoubleBE
arr.writeUInt8 = BP.writeUInt8
arr.writeUIntLE = BP.writeUIntLE
arr.writeUIntBE = BP.writeUIntBE
arr.writeUInt16LE = BP.writeUInt16LE
arr.writeUInt16BE = BP.writeUInt16BE
arr.writeUInt32LE = BP.writeUInt32LE
arr.writeUInt32BE = BP.writeUInt32BE
arr.writeIntLE = BP.writeIntLE
arr.writeIntBE = BP.writeIntBE
arr.writeInt8 = BP.writeInt8
arr.writeInt16LE = BP.writeInt16LE
arr.writeInt16BE = BP.writeInt16BE
arr.writeInt32LE = BP.writeInt32LE
arr.writeInt32BE = BP.writeInt32BE
arr.writeFloatLE = BP.writeFloatLE
arr.writeFloatBE = BP.writeFloatBE
arr.writeDoubleLE = BP.writeDoubleLE
arr.writeDoubleBE = BP.writeDoubleBE
arr.fill = BP.fill
arr.inspect = BP.inspect
arr.toArrayBuffer = BP.toArrayBuffer
return arr
}
var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
function base64clean (str) {
// Node strips out invalid characters like \n and \t from the string, base64-js does not
str = stringtrim(str).replace(INVALID_BASE64_RE, '')
// Node converts strings with length < 2 to ''
if (str.length < 2) return ''
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
while (str.length % 4 !== 0) {
str = str + '='
}
return str
}
function stringtrim (str) {
if (str.trim) return str.trim()
return str.replace(/^\s+|\s+$/g, '')
}
function toHex (n) {
if (n < 16) return '0' + n.toString(16)
return n.toString(16)
}
function utf8ToBytes (string, units) {
units = units || Infinity
var codePoint
var length = string.length
var leadSurrogate = null
var bytes = []
for (var i = 0; i < length; i++) {
codePoint = string.charCodeAt(i)
// is surrogate component
if (codePoint > 0xD7FF && codePoint < 0xE000) {
// last char was a lead
if (!leadSurrogate) {
// no lead yet
if (codePoint > 0xDBFF) {
// unexpected trail
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
}
// valid lead
leadSurrogate = codePoint
continue
}
// 2 leads in a row
if (codePoint < 0xDC00) {
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
leadSurrogate = codePoint
continue
}
// valid surrogate pair
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
} else if (leadSurrogate) {
// valid bmp char, but last char was a lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
}
leadSurrogate = null
// encode utf8
if (codePoint < 0x80) {
if ((units -= 1) < 0) break
bytes.push(codePoint)
} else if (codePoint < 0x800) {
if ((units -= 2) < 0) break
bytes.push(
codePoint >> 0x6 | 0xC0,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x10000) {
if ((units -= 3) < 0) break
bytes.push(
codePoint >> 0xC | 0xE0,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else if (codePoint < 0x110000) {
if ((units -= 4) < 0) break
bytes.push(
codePoint >> 0x12 | 0xF0,
codePoint >> 0xC & 0x3F | 0x80,
codePoint >> 0x6 & 0x3F | 0x80,
codePoint & 0x3F | 0x80
)
} else {
throw new Error('Invalid code point')
}
}
return bytes
}
function asciiToBytes (str) {
var byteArray = []
for (var i = 0; i < str.length; i++) {
// Node's code seems to be doing this and not & 0x7F..
byteArray.push(str.charCodeAt(i) & 0xFF)
}
return byteArray
}
function utf16leToBytes (str, units) {
var c, hi, lo
var byteArray = []
for (var i = 0; i < str.length; i++) {
if ((units -= 2) < 0) break
c = str.charCodeAt(i)
hi = c >> 8
lo = c % 256
byteArray.push(lo)
byteArray.push(hi)
}
return byteArray
}
function base64ToBytes (str) {
return base64.toByteArray(base64clean(str))
}
function blitBuffer (src, dst, offset, length) {
for (var i = 0; i < length; i++) {
if ((i + offset >= dst.length) || (i >= src.length)) break
dst[i + offset] = src[i]
}
return i
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(66).Buffer, (function() { return this; }())))
/***/ },
/* 67 */
/***/ function(module, exports, __webpack_require__) {
var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
;(function (exports) {
'use strict';
var Arr = (typeof Uint8Array !== 'undefined')
? Uint8Array
: Array
var PLUS = '+'.charCodeAt(0)
var SLASH = '/'.charCodeAt(0)
var NUMBER = '0'.charCodeAt(0)
var LOWER = 'a'.charCodeAt(0)
var UPPER = 'A'.charCodeAt(0)
var PLUS_URL_SAFE = '-'.charCodeAt(0)
var SLASH_URL_SAFE = '_'.charCodeAt(0)
function decode (elt) {
var code = elt.charCodeAt(0)
if (code === PLUS ||
code === PLUS_URL_SAFE)
return 62 // '+'
if (code === SLASH ||
code === SLASH_URL_SAFE)
return 63 // '/'
if (code < NUMBER)
return -1 //no match
if (code < NUMBER + 10)
return code - NUMBER + 26 + 26
if (code < UPPER + 26)
return code - UPPER
if (code < LOWER + 26)
return code - LOWER + 26
}
function b64ToByteArray (b64) {
var i, j, l, tmp, placeHolders, arr
if (b64.length % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4')
}
// the number of equal signs (place holders)
// if there are two placeholders, than the two characters before it
// represent one byte
// if there is only one, then the three characters before it represent 2 bytes
// this is just a cheap hack to not do indexOf twice
var len = b64.length
placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
// base64 is 4/3 + up to two characters of the original data
arr = new Arr(b64.length * 3 / 4 - placeHolders)
// if there are placeholders, only get up to the last complete 4 chars
l = placeHolders > 0 ? b64.length - 4 : b64.length
var L = 0
function push (v) {
arr[L++] = v
}
for (i = 0, j = 0; i < l; i += 4, j += 3) {
tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
push((tmp & 0xFF0000) >> 16)
push((tmp & 0xFF00) >> 8)
push(tmp & 0xFF)
}
if (placeHolders === 2) {
tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
push(tmp & 0xFF)
} else if (placeHolders === 1) {
tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
push((tmp >> 8) & 0xFF)
push(tmp & 0xFF)
}
return arr
}
function uint8ToBase64 (uint8) {
var i,
extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
output = "",
temp, length
function encode (num) {
return lookup.charAt(num)
}
function tripletToBase64 (num) {
return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
}
// go through the array every three bytes, we'll deal with trailing stuff later
for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
output += tripletToBase64(temp)
}
// pad the end with zeros, but make sure to not forget the extra bytes
switch (extraBytes) {
case 1:
temp = uint8[uint8.length - 1]
output += encode(temp >> 2)
output += encode((temp << 4) & 0x3F)
output += '=='
break
case 2:
temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
output += encode(temp >> 10)
output += encode((temp >> 4) & 0x3F)
output += encode((temp << 2) & 0x3F)
output += '='
break
}
return output
}
exports.toByteArray = b64ToByteArray
exports.fromByteArray = uint8ToBase64
}( false ? (this.base64js = {}) : exports))
/***/ },
/* 68 */
/***/ function(module, exports) {
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = nBytes * 8 - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var nBits = -7
var i = isLE ? (nBytes - 1) : 0
var d = isLE ? -1 : 1
var s = buffer[offset + i]
i += d
e = s & ((1 << (-nBits)) - 1)
s >>= (-nBits)
nBits += eLen
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << (-nBits)) - 1)
e >>= (-nBits)
nBits += mLen
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) {
e = 1 - eBias
} else if (e === eMax) {
return m ? NaN : ((s ? -1 : 1) * Infinity)
} else {
m = m + Math.pow(2, mLen)
e = e - eBias
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c
var eLen = nBytes * 8 - mLen - 1
var eMax = (1 << eLen) - 1
var eBias = eMax >> 1
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
var i = isLE ? 0 : (nBytes - 1)
var d = isLE ? 1 : -1
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
value = Math.abs(value)
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0
e = eMax
} else {
e = Math.floor(Math.log(value) / Math.LN2)
if (value * (c = Math.pow(2, -e)) < 1) {
e--
c *= 2
}
if (e + eBias >= 1) {
value += rt / c
} else {
value += rt * Math.pow(2, 1 - eBias)
}
if (value * c >= 2) {
e++
c /= 2
}
if (e + eBias >= eMax) {
m = 0
e = eMax
} else if (e + eBias >= 1) {
m = (value * c - 1) * Math.pow(2, mLen)
e = e + eBias
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
e = 0
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m
eLen += mLen
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128
}
/***/ },
/* 69 */
/***/ function(module, exports) {
var toString = {}.toString;
module.exports = Array.isArray || function (arr) {
return toString.call(arr) == '[object Array]';
};
/***/ },
/* 70 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(arg) {
if (Array.isArray) {
return Array.isArray(arg);
}
return objectToString(arg) === '[object Array]';
}
exports.isArray = isArray;
function isBoolean(arg) {
return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;
function isNull(arg) {
return arg === null;
}
exports.isNull = isNull;
function isNullOrUndefined(arg) {
return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;
function isNumber(arg) {
return typeof arg === 'number';
}
exports.isNumber = isNumber;
function isString(arg) {
return typeof arg === 'string';
}
exports.isString = isString;
function isSymbol(arg) {
return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;
function isUndefined(arg) {
return arg === void 0;
}
exports.isUndefined = isUndefined;
function isRegExp(re) {
return objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;
function isDate(d) {
return objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
return (objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
function isFunction(arg) {
return typeof arg === 'function';
}
exports.isFunction = isFunction;
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
exports.isBuffer = Buffer.isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(66).Buffer))
/***/ },
/* 71 */
/***/ function(module, exports) {
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
/***/ },
/* 72 */
/***/ function(module, exports) {
/* (ignored) */
/***/ },
/* 73 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a duplex stream is just a stream that is both readable and writable.
// Since JS doesn't have multiple prototypal inheritance, this class
// prototypally inherits from Readable, and then parasitically from
// Writable.
module.exports = Duplex;
/*<replacement>*/
var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) keys.push(key);
return keys;
}
/*</replacement>*/
/*<replacement>*/
var util = __webpack_require__(70);
util.inherits = __webpack_require__(71);
/*</replacement>*/
var Readable = __webpack_require__(64);
var Writable = __webpack_require__(74);
util.inherits(Duplex, Readable);
forEach(objectKeys(Writable.prototype), function(method) {
if (!Duplex.prototype[method])
Duplex.prototype[method] = Writable.prototype[method];
});
function Duplex(options) {
if (!(this instanceof Duplex))
return new Duplex(options);
Readable.call(this, options);
Writable.call(this, options);
if (options && options.readable === false)
this.readable = false;
if (options && options.writable === false)
this.writable = false;
this.allowHalfOpen = true;
if (options && options.allowHalfOpen === false)
this.allowHalfOpen = false;
this.once('end', onend);
}
// the no-half-open enforcer
function onend() {
// if we allow half-open state, or if the writable side ended,
// then we're ok.
if (this.allowHalfOpen || this._writableState.ended)
return;
// no more data can be written.
// But allow more writes to happen in this tick.
process.nextTick(this.end.bind(this));
}
function forEach (xs, f) {
for (var i = 0, l = xs.length; i < l; i++) {
f(xs[i], i);
}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(50)))
/***/ },
/* 74 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// A bit simpler than readable streams.
// Implement an async ._write(chunk, cb), and it'll handle all
// the drain event emission and buffering.
module.exports = Writable;
/*<replacement>*/
var Buffer = __webpack_require__(66).Buffer;
/*</replacement>*/
Writable.WritableState = WritableState;
/*<replacement>*/
var util = __webpack_require__(70);
util.inherits = __webpack_require__(71);
/*</replacement>*/
var Stream = __webpack_require__(61);
util.inherits(Writable, Stream);
function WriteReq(chunk, encoding, cb) {
this.chunk = chunk;
this.encoding = encoding;
this.callback = cb;
}
function WritableState(options, stream) {
var Duplex = __webpack_require__(73);
options = options || {};
// the point at which write() starts returning false
// Note: 0 is a valid value, means that we always return false if
// the entire buffer is not flushed immediately on write()
var hwm = options.highWaterMark;
var defaultHwm = options.objectMode ? 16 : 16 * 1024;
this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
// object stream flag to indicate whether or not this stream
// contains buffers or objects.
this.objectMode = !!options.objectMode;
if (stream instanceof Duplex)
this.objectMode = this.objectMode || !!options.writableObjectMode;
// cast to ints.
this.highWaterMark = ~~this.highWaterMark;
this.needDrain = false;
// at the start of calling end()
this.ending = false;
// when end() has been called, and returned
this.ended = false;
// when 'finish' is emitted
this.finished = false;
// should we decode strings into buffers before passing to _write?
// this is here so that some node-core streams can optimize string
// handling at a lower level.
var noDecode = options.decodeStrings === false;
this.decodeStrings = !noDecode;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
// not an actual buffer we keep track of, but a measurement
// of how much we're waiting to get pushed to some underlying
// socket or file.
this.length = 0;
// a flag to see when we're in the middle of a write.
this.writing = false;
// when true all writes will be buffered until .uncork() call
this.corked = 0;
// a flag to be able to tell if the onwrite cb is called immediately,
// or on a later tick. We set this to true at first, because any
// actions that shouldn't happen until "later" should generally also
// not happen before the first write call.
this.sync = true;
// a flag to know if we're processing previously buffered items, which
// may call the _write() callback in the same tick, so that we don't
// end up in an overlapped onwrite situation.
this.bufferProcessing = false;
// the callback that's passed to _write(chunk,cb)
this.onwrite = function(er) {
onwrite(stream, er);
};
// the callback that the user supplies to write(chunk,encoding,cb)
this.writecb = null;
// the amount that is being written when _write is called.
this.writelen = 0;
this.buffer = [];
// number of pending user-supplied write callbacks
// this must be 0 before 'finish' can be emitted
this.pendingcb = 0;
// emit prefinish if the only thing we're waiting for is _write cbs
// This is relevant for synchronous Transform streams
this.prefinished = false;
// True if the error was already emitted and should not be thrown again
this.errorEmitted = false;
}
function Writable(options) {
var Duplex = __webpack_require__(73);
// Writable ctor is applied to Duplexes, though they're not
// instanceof Writable, they're instanceof Readable.
if (!(this instanceof Writable) && !(this instanceof Duplex))
return new Writable(options);
this._writableState = new WritableState(options, this);
// legacy.
this.writable = true;
Stream.call(this);
}
// Otherwise people can pipe Writable streams, which is just wrong.
Writable.prototype.pipe = function() {
this.emit('error', new Error('Cannot pipe. Not readable.'));
};
function writeAfterEnd(stream, state, cb) {
var er = new Error('write after end');
// TODO: defer error events consistently everywhere, not just the cb
stream.emit('error', er);
process.nextTick(function() {
cb(er);
});
}
// If we get something that is not a buffer, string, null, or undefined,
// and we're not in objectMode, then that's an error.
// Otherwise stream chunks are all considered to be of length=1, and the
// watermarks determine how many objects to keep in the buffer, rather than
// how many bytes or characters.
function validChunk(stream, state, chunk, cb) {
var valid = true;
if (!util.isBuffer(chunk) &&
!util.isString(chunk) &&
!util.isNullOrUndefined(chunk) &&
!state.objectMode) {
var er = new TypeError('Invalid non-string/buffer chunk');
stream.emit('error', er);
process.nextTick(function() {
cb(er);
});
valid = false;
}
return valid;
}
Writable.prototype.write = function(chunk, encoding, cb) {
var state = this._writableState;
var ret = false;
if (util.isFunction(encoding)) {
cb = encoding;
encoding = null;
}
if (util.isBuffer(chunk))
encoding = 'buffer';
else if (!encoding)
encoding = state.defaultEncoding;
if (!util.isFunction(cb))
cb = function() {};
if (state.ended)
writeAfterEnd(this, state, cb);
else if (validChunk(this, state, chunk, cb)) {
state.pendingcb++;
ret = writeOrBuffer(this, state, chunk, encoding, cb);
}
return ret;
};
Writable.prototype.cork = function() {
var state = this._writableState;
state.corked++;
};
Writable.prototype.uncork = function() {
var state = this._writableState;
if (state.corked) {
state.corked--;
if (!state.writing &&
!state.corked &&
!state.finished &&
!state.bufferProcessing &&
state.buffer.length)
clearBuffer(this, state);
}
};
function decodeChunk(state, chunk, encoding) {
if (!state.objectMode &&
state.decodeStrings !== false &&
util.isString(chunk)) {
chunk = new Buffer(chunk, encoding);
}
return chunk;
}
// if we're already writing something, then just put this
// in the queue, and wait our turn. Otherwise, call _write
// If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, chunk, encoding, cb) {
chunk = decodeChunk(state, chunk, encoding);
if (util.isBuffer(chunk))
encoding = 'buffer';
var len = state.objectMode ? 1 : chunk.length;
state.length += len;
var ret = state.length < state.highWaterMark;
// we must ensure that previous needDrain will not be reset to false.
if (!ret)
state.needDrain = true;
if (state.writing || state.corked)
state.buffer.push(new WriteReq(chunk, encoding, cb));
else
doWrite(stream, state, false, len, chunk, encoding, cb);
return ret;
}
function doWrite(stream, state, writev, len, chunk, encoding, cb) {
state.writelen = len;
state.writecb = cb;
state.writing = true;
state.sync = true;
if (writev)
stream._writev(chunk, state.onwrite);
else
stream._write(chunk, encoding, state.onwrite);
state.sync = false;
}
function onwriteError(stream, state, sync, er, cb) {
if (sync)
process.nextTick(function() {
state.pendingcb--;
cb(er);
});
else {
state.pendingcb--;
cb(er);
}
stream._writableState.errorEmitted = true;
stream.emit('error', er);
}
function onwriteStateUpdate(state) {
state.writing = false;
state.writecb = null;
state.length -= state.writelen;
state.writelen = 0;
}
function onwrite(stream, er) {
var state = stream._writableState;
var sync = state.sync;
var cb = state.writecb;
onwriteStateUpdate(state);
if (er)
onwriteError(stream, state, sync, er, cb);
else {
// Check if we're actually ready to finish, but don't emit yet
var finished = needFinish(stream, state);
if (!finished &&
!state.corked &&
!state.bufferProcessing &&
state.buffer.length) {
clearBuffer(stream, state);
}
if (sync) {
process.nextTick(function() {
afterWrite(stream, state, finished, cb);
});
} else {
afterWrite(stream, state, finished, cb);
}
}
}
function afterWrite(stream, state, finished, cb) {
if (!finished)
onwriteDrain(stream, state);
state.pendingcb--;
cb();
finishMaybe(stream, state);
}
// Must force callback to be called on nextTick, so that we don't
// emit 'drain' before the write() consumer gets the 'false' return
// value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) {
if (state.length === 0 && state.needDrain) {
state.needDrain = false;
stream.emit('drain');
}
}
// if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) {
state.bufferProcessing = true;
if (stream._writev && state.buffer.length > 1) {
// Fast case, write everything using _writev()
var cbs = [];
for (var c = 0; c < state.buffer.length; c++)
cbs.push(state.buffer[c].callback);
// count the one we are adding, as well.
// TODO(isaacs) clean this up
state.pendingcb++;
doWrite(stream, state, true, state.length, state.buffer, '', function(err) {
for (var i = 0; i < cbs.length; i++) {
state.pendingcb--;
cbs[i](err);
}
});
// Clear buffer
state.buffer = [];
} else {
// Slow case, write chunks one-by-one
for (var c = 0; c < state.buffer.length; c++) {
var entry = state.buffer[c];
var chunk = entry.chunk;
var encoding = entry.encoding;
var cb = entry.callback;
var len = state.objectMode ? 1 : chunk.length;
doWrite(stream, state, false, len, chunk, encoding, cb);
// if we didn't call the onwrite immediately, then
// it means that we need to wait until it does.
// also, that means that the chunk and cb are currently
// being processed, so move the buffer counter past them.
if (state.writing) {
c++;
break;
}
}
if (c < state.buffer.length)
state.buffer = state.buffer.slice(c);
else
state.buffer.length = 0;
}
state.bufferProcessing = false;
}
Writable.prototype._write = function(chunk, encoding, cb) {
cb(new Error('not implemented'));
};
Writable.prototype._writev = null;
Writable.prototype.end = function(chunk, encoding, cb) {
var state = this._writableState;
if (util.isFunction(chunk)) {
cb = chunk;
chunk = null;
encoding = null;
} else if (util.isFunction(encoding)) {
cb = encoding;
encoding = null;
}
if (!util.isNullOrUndefined(chunk))
this.write(chunk, encoding);
// .end() fully uncorks
if (state.corked) {
state.corked = 1;
this.uncork();
}
// ignore unnecessary end() calls.
if (!state.ending && !state.finished)
endWritable(this, state, cb);
};
function needFinish(stream, state) {
return (state.ending &&
state.length === 0 &&
!state.finished &&
!state.writing);
}
function prefinish(stream, state) {
if (!state.prefinished) {
state.prefinished = true;
stream.emit('prefinish');
}
}
function finishMaybe(stream, state) {
var need = needFinish(stream, state);
if (need) {
if (state.pendingcb === 0) {
prefinish(stream, state);
state.finished = true;
stream.emit('finish');
} else
prefinish(stream, state);
}
return need;
}
function endWritable(stream, state, cb) {
state.ending = true;
finishMaybe(stream, state);
if (cb) {
if (state.finished)
process.nextTick(cb);
else
stream.once('finish', cb);
}
state.ended = true;
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(50)))
/***/ },
/* 75 */
/***/ function(module, exports, __webpack_require__) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var Buffer = __webpack_require__(66).Buffer;
var isBufferEncoding = Buffer.isEncoding
|| function(encoding) {
switch (encoding && encoding.toLowerCase()) {
case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
default: return false;
}
}
function assertEncoding(encoding) {
if (encoding && !isBufferEncoding(encoding)) {
throw new Error('Unknown encoding: ' + encoding);
}
}
// StringDecoder provides an interface for efficiently splitting a series of
// buffers into a series of JS strings without breaking apart multi-byte
// characters. CESU-8 is handled as part of the UTF-8 encoding.
//
// @TODO Handling all encodings inside a single object makes it very difficult
// to reason about this code, so it should be split up in the future.
// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
// points as used by CESU-8.
var StringDecoder = exports.StringDecoder = function(encoding) {
this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
assertEncoding(encoding);
switch (this.encoding) {
case 'utf8':
// CESU-8 represents each of Surrogate Pair by 3-bytes
this.surrogateSize = 3;
break;
case 'ucs2':
case 'utf16le':
// UTF-16 represents each of Surrogate Pair by 2-bytes
this.surrogateSize = 2;
this.detectIncompleteChar = utf16DetectIncompleteChar;
break;
case 'base64':
// Base-64 stores 3 bytes in 4 chars, and pads the remainder.
this.surrogateSize = 3;
this.detectIncompleteChar = base64DetectIncompleteChar;
break;
default:
this.write = passThroughWrite;
return;
}
// Enough space to store all bytes of a single character. UTF-8 needs 4
// bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
this.charBuffer = new Buffer(6);
// Number of bytes received for the current incomplete multi-byte character.
this.charReceived = 0;
// Number of bytes expected for the current incomplete multi-byte character.
this.charLength = 0;
};
// write decodes the given buffer and returns it as JS string that is
// guaranteed to not contain any partial multi-byte characters. Any partial
// character found at the end of the buffer is buffered up, and will be
// returned when calling write again with the remaining bytes.
//
// Note: Converting a Buffer containing an orphan surrogate to a String
// currently works, but converting a String to a Buffer (via `new Buffer`, or
// Buffer#write) will replace incomplete surrogates with the unicode
// replacement character. See https://codereview.chromium.org/121173009/ .
StringDecoder.prototype.write = function(buffer) {
var charStr = '';
// if our last write ended with an incomplete multibyte character
while (this.charLength) {
// determine how many remaining bytes this buffer has to offer for this char
var available = (buffer.length >= this.charLength - this.charReceived) ?
this.charLength - this.charReceived :
buffer.length;
// add the new bytes to the char buffer
buffer.copy(this.charBuffer, this.charReceived, 0, available);
this.charReceived += available;
if (this.charReceived < this.charLength) {
// still not enough chars in this buffer? wait for more ...
return '';
}
// remove bytes belonging to the current character from the buffer
buffer = buffer.slice(available, buffer.length);
// get the character that was split
charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
// CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
var charCode = charStr.charCodeAt(charStr.length - 1);
if (charCode >= 0xD800 && charCode <= 0xDBFF) {
this.charLength += this.surrogateSize;
charStr = '';
continue;
}
this.charReceived = this.charLength = 0;
// if there are no more bytes in this buffer, just emit our char
if (buffer.length === 0) {
return charStr;
}
break;
}
// determine and set charLength / charReceived
this.detectIncompleteChar(buffer);
var end = buffer.length;
if (this.charLength) {
// buffer the incomplete character bytes we got
buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
end -= this.charReceived;
}
charStr += buffer.toString(this.encoding, 0, end);
var end = charStr.length - 1;
var charCode = charStr.charCodeAt(end);
// CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
if (charCode >= 0xD800 && charCode <= 0xDBFF) {
var size = this.surrogateSize;
this.charLength += size;
this.charReceived += size;
this.charBuffer.copy(this.charBuffer, size, 0, size);
buffer.copy(this.charBuffer, 0, 0, size);
return charStr.substring(0, end);
}
// or just emit the charStr
return charStr;
};
// detectIncompleteChar determines if there is an incomplete UTF-8 character at
// the end of the given buffer. If so, it sets this.charLength to the byte
// length that character, and sets this.charReceived to the number of bytes
// that are available for this character.
StringDecoder.prototype.detectIncompleteChar = function(buffer) {
// determine how many bytes we have to check at the end of this buffer
var i = (buffer.length >= 3) ? 3 : buffer.length;
// Figure out if one of the last i bytes of our buffer announces an
// incomplete char.
for (; i > 0; i--) {
var c = buffer[buffer.length - i];
// See http://en.wikipedia.org/wiki/UTF-8#Description
// 110XXXXX
if (i == 1 && c >> 5 == 0x06) {
this.charLength = 2;
break;
}
// 1110XXXX
if (i <= 2 && c >> 4 == 0x0E) {
this.charLength = 3;
break;
}
// 11110XXX
if (i <= 3 && c >> 3 == 0x1E) {
this.charLength = 4;
break;
}
}
this.charReceived = i;
};
StringDecoder.prototype.end = function(buffer) {
var res = '';
if (buffer && buffer.length)
res = this.write(buffer);
if (this.charReceived) {
var cr = this.charReceived;
var buf = this.charBuffer;
var enc = this.encoding;
res += buf.slice(0, cr).toString(enc);
}
return res;
};
function passThroughWrite(buffer) {
return buffer.toString(this.encoding);
}
function utf16DetectIncompleteChar(buffer) {
this.charReceived = buffer.length % 2;
this.charLength = this.charReceived ? 2 : 0;
}
function base64DetectIncompleteChar(buffer) {
this.charReceived = buffer.length % 3;
this.charLength = this.charReceived ? 3 : 0;
}
/***/ },
/* 76 */
/***/ function(module, exports, __webpack_require__) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a transform stream is a readable/writable stream where you do
// something with the data. Sometimes it's called a "filter",
// but that's not a great name for it, since that implies a thing where
// some bits pass through, and others are simply ignored. (That would
// be a valid example of a transform, of course.)
//
// While the output is causally related to the input, it's not a
// necessarily symmetric or synchronous transformation. For example,
// a zlib stream might take multiple plain-text writes(), and then
// emit a single compressed chunk some time in the future.
//
// Here's how this works:
//
// The Transform stream has all the aspects of the readable and writable
// stream classes. When you write(chunk), that calls _write(chunk,cb)
// internally, and returns false if there's a lot of pending writes
// buffered up. When you call read(), that calls _read(n) until
// there's enough pending readable data buffered up.
//
// In a transform stream, the written data is placed in a buffer. When
// _read(n) is called, it transforms the queued up data, calling the
// buffered _write cb's as it consumes chunks. If consuming a single
// written chunk would result in multiple output chunks, then the first
// outputted bit calls the readcb, and subsequent chunks just go into
// the read buffer, and will cause it to emit 'readable' if necessary.
//
// This way, back-pressure is actually determined by the reading side,
// since _read has to be called to start processing a new chunk. However,
// a pathological inflate type of transform can cause excessive buffering
// here. For example, imagine a stream where every byte of input is
// interpreted as an integer from 0-255, and then results in that many
// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
// 1kb of data being output. In this case, you could write a very small
// amount of input, and end up with a very large amount of output. In
// such a pathological inflating mechanism, there'd be no way to tell
// the system to stop doing the transform. A single 4MB write could
// cause the system to run out of memory.
//
// However, even in such a pathological case, only a single written chunk
// would be consumed, and then the rest would wait (un-transformed) until
// the results of the previous transformed chunk were consumed.
module.exports = Transform;
var Duplex = __webpack_require__(73);
/*<replacement>*/
var util = __webpack_require__(70);
util.inherits = __webpack_require__(71);
/*</replacement>*/
util.inherits(Transform, Duplex);
function TransformState(options, stream) {
this.afterTransform = function(er, data) {
return afterTransform(stream, er, data);
};
this.needTransform = false;
this.transforming = false;
this.writecb = null;
this.writechunk = null;
}
function afterTransform(stream, er, data) {
var ts = stream._transformState;
ts.transforming = false;
var cb = ts.writecb;
if (!cb)
return stream.emit('error', new Error('no writecb in Transform class'));
ts.writechunk = null;
ts.writecb = null;
if (!util.isNullOrUndefined(data))
stream.push(data);
if (cb)
cb(er);
var rs = stream._readableState;
rs.reading = false;
if (rs.needReadable || rs.length < rs.highWaterMark) {
stream._read(rs.highWaterMark);
}
}
function Transform(options) {
if (!(this instanceof Transform))
return new Transform(options);
Duplex.call(this, options);
this._transformState = new TransformState(options, this);
// when the writable side finishes, then flush out anything remaining.
var stream = this;
// start out asking for a readable event once data is transformed.
this._readableState.needReadable = true;
// we have implemented the _read method, and done the other things
// that Readable wants before the first _read call, so unset the
// sync guard flag.
this._readableState.sync = false;
this.once('prefinish', function() {
if (util.isFunction(this._flush))
this._flush(function(er) {
done(stream, er);
});
else
done(stream);
});
}
Transform.prototype.push = function(chunk, encoding) {
this._transformState.needTransform = false;
return Duplex.prototype.push.call(this, chunk, encoding);
};
// This is the part where you do stuff!
// override this function in implementation classes.
// 'chunk' is an input chunk.
//
// Call `push(newChunk)` to pass along transformed output
// to the readable side. You may call 'push' zero or more times.
//
// Call `cb(err)` when you are done with this chunk. If you pass
// an error, then that'll put the hurt on the whole operation. If you
// never call cb(), then you'll never get another chunk.
Transform.prototype._transform = function(chunk, encoding, cb) {
throw new Error('not implemented');
};
Transform.prototype._write = function(chunk, encoding, cb) {
var ts = this._transformState;
ts.writecb = cb;
ts.writechunk = chunk;
ts.writeencoding = encoding;
if (!ts.transforming) {
var rs = this._readableState;
if (ts.needTransform ||
rs.needReadable ||
rs.length < rs.highWaterMark)
this._read(rs.highWaterMark);
}
};
// Doesn't matter what the args are here.
// _transform does all the work.
// That we got here means that the readable side wants more data.
Transform.prototype._read = function(n) {
var ts = this._transformState;
if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) {
ts.transforming = true;
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
} else {
// mark that we need a transform, so that any data that comes in
// will get processed, now that we've asked for it.
ts.needTransform = true;
}
};
function done(stream, er) {
if (er)
return stream.emit('error', er);
// if there's nothing in the write buffer, then that means
// that nothing more will ever be provided
var ws = stream._writableState;
var ts = stream._transformState;
if (ws.length)
throw new Error('calling transform done when ws.length != 0');
if (ts.transforming)
throw new Error('calling transform done when still transforming');
return stream.push(null);
}
/***/ },
/* 77 */
/***/ function(module, exports, __webpack_require__) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// a passthrough stream.
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.
module.exports = PassThrough;
var Transform = __webpack_require__(76);
/*<replacement>*/
var util = __webpack_require__(70);
util.inherits = __webpack_require__(71);
/*</replacement>*/
util.inherits(PassThrough, Transform);
function PassThrough(options) {
if (!(this instanceof PassThrough))
return new PassThrough(options);
Transform.call(this, options);
}
PassThrough.prototype._transform = function(chunk, encoding, cb) {
cb(null, chunk);
};
/***/ },
/* 78 */
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(74)
/***/ },
/* 79 */
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(73)
/***/ },
/* 80 */
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(76)
/***/ },
/* 81 */
/***/ function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(77)
/***/ },
/* 82 */
/***/ function(module, exports) {
/* (ignored) */
/***/ },
/* 83 */
/***/ function(module, exports, __webpack_require__) {
module.exports = ProxyHandler;
function ProxyHandler(cbs){
this._cbs = cbs || {};
}
var EVENTS = __webpack_require__(41).EVENTS;
Object.keys(EVENTS).forEach(function(name){
if(EVENTS[name] === 0){
name = "on" + name;
ProxyHandler.prototype[name] = function(){
if(this._cbs[name]) this._cbs[name]();
};
} else if(EVENTS[name] === 1){
name = "on" + name;
ProxyHandler.prototype[name] = function(a){
if(this._cbs[name]) this._cbs[name](a);
};
} else if(EVENTS[name] === 2){
name = "on" + name;
ProxyHandler.prototype[name] = function(a, b){
if(this._cbs[name]) this._cbs[name](a, b);
};
} else {
throw Error("wrong number of arguments");
}
});
/***/ },
/* 84 */
/***/ function(module, exports, __webpack_require__) {
var DomUtils = module.exports;
[
__webpack_require__(85),
__webpack_require__(91),
__webpack_require__(92),
__webpack_require__(93),
__webpack_require__(94),
__webpack_require__(95)
].forEach(function(ext){
Object.keys(ext).forEach(function(key){
DomUtils[key] = ext[key].bind(DomUtils);
});
});
/***/ },
/* 85 */
/***/ function(module, exports, __webpack_require__) {
var ElementType = __webpack_require__(55),
getOuterHTML = __webpack_require__(86),
isTag = ElementType.isTag;
module.exports = {
getInnerHTML: getInnerHTML,
getOuterHTML: getOuterHTML,
getText: getText
};
function getInnerHTML(elem, opts){
return elem.children ? elem.children.map(function(elem){
return getOuterHTML(elem, opts);
}).join("") : "";
}
function getText(elem){
if(Array.isArray(elem)) return elem.map(getText).join("");
if(isTag(elem) || elem.type === ElementType.CDATA) return getText(elem.children);
if(elem.type === ElementType.Text) return elem.data;
return "";
}
/***/ },
/* 86 */
/***/ function(module, exports, __webpack_require__) {
/*
Module dependencies
*/
var ElementType = __webpack_require__(87);
var entities = __webpack_require__(88);
/*
Boolean Attributes
*/
var booleanAttributes = {
__proto__: null,
allowfullscreen: true,
async: true,
autofocus: true,
autoplay: true,
checked: true,
controls: true,
default: true,
defer: true,
disabled: true,
hidden: true,
ismap: true,
loop: true,
multiple: true,
muted: true,
open: true,
readonly: true,
required: true,
reversed: true,
scoped: true,
seamless: true,
selected: true,
typemustmatch: true
};
var unencodedElements = {
__proto__: null,
style: true,
script: true,
xmp: true,
iframe: true,
noembed: true,
noframes: true,
plaintext: true,
noscript: true
};
/*
Format attributes
*/
function formatAttrs(attributes, opts) {
if (!attributes) return;
var output = '',
value;
// Loop through the attributes
for (var key in attributes) {
value = attributes[key];
if (output) {
output += ' ';
}
if (!value && booleanAttributes[key]) {
output += key;
} else {
output += key + '="' + (opts.decodeEntities ? entities.encodeXML(value) : value) + '"';
}
}
return output;
}
/*
Self-enclosing tags (stolen from node-htmlparser)
*/
var singleTag = {
__proto__: null,
area: true,
base: true,
basefont: true,
br: true,
col: true,
command: true,
embed: true,
frame: true,
hr: true,
img: true,
input: true,
isindex: true,
keygen: true,
link: true,
meta: true,
param: true,
source: true,
track: true,
wbr: true,
};
var render = module.exports = function(dom, opts) {
if (!Array.isArray(dom) && !dom.cheerio) dom = [dom];
opts = opts || {};
var output = '';
for(var i = 0; i < dom.length; i++){
var elem = dom[i];
if (elem.type === 'root')
output += render(elem.children, opts);
else if (ElementType.isTag(elem))
output += renderTag(elem, opts);
else if (elem.type === ElementType.Directive)
output += renderDirective(elem);
else if (elem.type === ElementType.Comment)
output += renderComment(elem);
else if (elem.type === ElementType.CDATA)
output += renderCdata(elem);
else
output += renderText(elem, opts);
}
return output;
};
function renderTag(elem, opts) {
// Handle SVG
if (elem.name === "svg") opts = {decodeEntities: opts.decodeEntities, xmlMode: true};
var tag = '<' + elem.name,
attribs = formatAttrs(elem.attribs, opts);
if (attribs) {
tag += ' ' + attribs;
}
if (
opts.xmlMode
&& (!elem.children || elem.children.length === 0)
) {
tag += '/>';
} else {
tag += '>';
if (elem.children) {
tag += render(elem.children, opts);
}
if (!singleTag[elem.name] || opts.xmlMode) {
tag += '</' + elem.name + '>';
}
}
return tag;
}
function renderDirective(elem) {
return '<' + elem.data + '>';
}
function renderText(elem, opts) {
var data = elem.data || '';
// if entities weren't decoded, no need to encode them back
if (opts.decodeEntities && !(elem.parent && elem.parent.name in unencodedElements)) {
data = entities.encodeXML(data);
}
return data;
}
function renderCdata(elem) {
return '<![CDATA[' + elem.children[0].data + ']]>';
}
function renderComment(elem) {
return '<!--' + elem.data + '-->';
}
/***/ },
/* 87 */
/***/ function(module, exports) {
//Types of elements found in the DOM
module.exports = {
Text: "text", //Text
Directive: "directive", //<? ... ?>
Comment: "comment", //<!-- ... -->
Script: "script", //<script> tags
Style: "style", //<style> tags
Tag: "tag", //Any tag
CDATA: "cdata", //<![CDATA[ ... ]]>
isTag: function(elem){
return elem.type === "tag" || elem.type === "script" || elem.type === "style";
}
};
/***/ },
/* 88 */
/***/ function(module, exports, __webpack_require__) {
var encode = __webpack_require__(89),
decode = __webpack_require__(90);
exports.decode = function(data, level){
return (!level || level <= 0 ? decode.XML : decode.HTML)(data);
};
exports.decodeStrict = function(data, level){
return (!level || level <= 0 ? decode.XML : decode.HTMLStrict)(data);
};
exports.encode = function(data, level){
return (!level || level <= 0 ? encode.XML : encode.HTML)(data);
};
exports.encodeXML = encode.XML;
exports.encodeHTML4 =
exports.encodeHTML5 =
exports.encodeHTML = encode.HTML;
exports.decodeXML =
exports.decodeXMLStrict = decode.XML;
exports.decodeHTML4 =
exports.decodeHTML5 =
exports.decodeHTML = decode.HTML;
exports.decodeHTML4Strict =
exports.decodeHTML5Strict =
exports.decodeHTMLStrict = decode.HTMLStrict;
exports.escape = encode.escape;
/***/ },
/* 89 */
/***/ function(module, exports, __webpack_require__) {
var inverseXML = getInverseObj(__webpack_require__(48)),
xmlReplacer = getInverseReplacer(inverseXML);
exports.XML = getInverse(inverseXML, xmlReplacer);
var inverseHTML = getInverseObj(__webpack_require__(46)),
htmlReplacer = getInverseReplacer(inverseHTML);
exports.HTML = getInverse(inverseHTML, htmlReplacer);
function getInverseObj(obj){
return Object.keys(obj).sort().reduce(function(inverse, name){
inverse[obj[name]] = "&" + name + ";";
return inverse;
}, {});
}
function getInverseReplacer(inverse){
var single = [],
multiple = [];
Object.keys(inverse).forEach(function(k){
if(k.length === 1){
single.push("\\" + k);
} else {
multiple.push(k);
}
});
//TODO add ranges
multiple.unshift("[" + single.join("") + "]");
return new RegExp(multiple.join("|"), "g");
}
var re_nonASCII = /[^\0-\x7F]/g,
re_astralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
function singleCharReplacer(c){
return "&#x" + c.charCodeAt(0).toString(16).toUpperCase() + ";";
}
function astralReplacer(c){
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
var high = c.charCodeAt(0);
var low = c.charCodeAt(1);
var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;
return "&#x" + codePoint.toString(16).toUpperCase() + ";";
}
function getInverse(inverse, re){
function func(name){
return inverse[name];
}
return function(data){
return data
.replace(re, func)
.replace(re_astralSymbols, astralReplacer)
.replace(re_nonASCII, singleCharReplacer);
};
}
var re_xmlChars = getInverseReplacer(inverseXML);
function escapeXML(data){
return data
.replace(re_xmlChars, singleCharReplacer)
.replace(re_astralSymbols, astralReplacer)
.replace(re_nonASCII, singleCharReplacer);
}
exports.escape = escapeXML;
/***/ },
/* 90 */
/***/ function(module, exports, __webpack_require__) {
var entityMap = __webpack_require__(46),
legacyMap = __webpack_require__(47),
xmlMap = __webpack_require__(48),
decodeCodePoint = __webpack_require__(44);
var decodeXMLStrict = getStrictDecoder(xmlMap),
decodeHTMLStrict = getStrictDecoder(entityMap);
function getStrictDecoder(map){
var keys = Object.keys(map).join("|"),
replace = getReplacer(map);
keys += "|#[xX][\\da-fA-F]+|#\\d+";
var re = new RegExp("&(?:" + keys + ");", "g");
return function(str){
return String(str).replace(re, replace);
};
}
var decodeHTML = (function(){
var legacy = Object.keys(legacyMap)
.sort(sorter);
var keys = Object.keys(entityMap)
.sort(sorter);
for(var i = 0, j = 0; i < keys.length; i++){
if(legacy[j] === keys[i]){
keys[i] += ";?";
j++;
} else {
keys[i] += ";";
}
}
var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"),
replace = getReplacer(entityMap);
function replacer(str){
if(str.substr(-1) !== ";") str += ";";
return replace(str);
}
//TODO consider creating a merged map
return function(str){
return String(str).replace(re, replacer);
};
}());
function sorter(a, b){
return a < b ? 1 : -1;
}
function getReplacer(map){
return function replace(str){
if(str.charAt(1) === "#"){
if(str.charAt(2) === "X" || str.charAt(2) === "x"){
return decodeCodePoint(parseInt(str.substr(3), 16));
}
return decodeCodePoint(parseInt(str.substr(2), 10));
}
return map[str.slice(1, -1)];
};
}
module.exports = {
XML: decodeXMLStrict,
HTML: decodeHTML,
HTMLStrict: decodeHTMLStrict
};
/***/ },
/* 91 */
/***/ function(module, exports) {
var getChildren = exports.getChildren = function(elem){
return elem.children;
};
var getParent = exports.getParent = function(elem){
return elem.parent;
};
exports.getSiblings = function(elem){
var parent = getParent(elem);
return parent ? getChildren(parent) : [elem];
};
exports.getAttributeValue = function(elem, name){
return elem.attribs && elem.attribs[name];
};
exports.hasAttrib = function(elem, name){
return !!elem.attribs && hasOwnProperty.call(elem.attribs, name);
};
exports.getName = function(elem){
return elem.name;
};
/***/ },
/* 92 */
/***/ function(module, exports) {
exports.removeElement = function(elem){
if(elem.prev) elem.prev.next = elem.next;
if(elem.next) elem.next.prev = elem.prev;
if(elem.parent){
var childs = elem.parent.children;
childs.splice(childs.lastIndexOf(elem), 1);
}
};
exports.replaceElement = function(elem, replacement){
var prev = replacement.prev = elem.prev;
if(prev){
prev.next = replacement;
}
var next = replacement.next = elem.next;
if(next){
next.prev = replacement;
}
var parent = replacement.parent = elem.parent;
if(parent){
var childs = parent.children;
childs[childs.lastIndexOf(elem)] = replacement;
}
};
exports.appendChild = function(elem, child){
child.parent = elem;
if(elem.children.push(child) !== 1){
var sibling = elem.children[elem.children.length - 2];
sibling.next = child;
child.prev = sibling;
child.next = null;
}
};
exports.append = function(elem, next){
var parent = elem.parent,
currNext = elem.next;
next.next = currNext;
next.prev = elem;
elem.next = next;
next.parent = parent;
if(currNext){
currNext.prev = next;
if(parent){
var childs = parent.children;
childs.splice(childs.lastIndexOf(currNext), 0, next);
}
} else if(parent){
parent.children.push(next);
}
};
exports.prepend = function(elem, prev){
var parent = elem.parent;
if(parent){
var childs = parent.children;
childs.splice(childs.lastIndexOf(elem), 0, prev);
}
if(elem.prev){
elem.prev.next = prev;
}
prev.parent = parent;
prev.prev = elem.prev;
prev.next = elem;
elem.prev = prev;
};
/***/ },
/* 93 */
/***/ function(module, exports, __webpack_require__) {
var isTag = __webpack_require__(55).isTag;
module.exports = {
filter: filter,
find: find,
findOneChild: findOneChild,
findOne: findOne,
existsOne: existsOne,
findAll: findAll
};
function filter(test, element, recurse, limit){
if(!Array.isArray(element)) element = [element];
if(typeof limit !== "number" || !isFinite(limit)){
limit = Infinity;
}
return find(test, element, recurse !== false, limit);
}
function find(test, elems, recurse, limit){
var result = [], childs;
for(var i = 0, j = elems.length; i < j; i++){
if(test(elems[i])){
result.push(elems[i]);
if(--limit <= 0) break;
}
childs = elems[i].children;
if(recurse && childs && childs.length > 0){
childs = find(test, childs, recurse, limit);
result = result.concat(childs);
limit -= childs.length;
if(limit <= 0) break;
}
}
return result;
}
function findOneChild(test, elems){
for(var i = 0, l = elems.length; i < l; i++){
if(test(elems[i])) return elems[i];
}
return null;
}
function findOne(test, elems){
var elem = null;
for(var i = 0, l = elems.length; i < l && !elem; i++){
if(!isTag(elems[i])){
continue;
} else if(test(elems[i])){
elem = elems[i];
} else if(elems[i].children.length > 0){
elem = findOne(test, elems[i].children);
}
}
return elem;
}
function existsOne(test, elems){
for(var i = 0, l = elems.length; i < l; i++){
if(
isTag(elems[i]) && (
test(elems[i]) || (
elems[i].children.length > 0 &&
existsOne(test, elems[i].children)
)
)
){
return true;
}
}
return false;
}
function findAll(test, elems){
var result = [];
for(var i = 0, j = elems.length; i < j; i++){
if(!isTag(elems[i])) continue;
if(test(elems[i])) result.push(elems[i]);
if(elems[i].children.length > 0){
result = result.concat(findAll(test, elems[i].children));
}
}
return result;
}
/***/ },
/* 94 */
/***/ function(module, exports, __webpack_require__) {
var ElementType = __webpack_require__(55);
var isTag = exports.isTag = ElementType.isTag;
exports.testElement = function(options, element){
for(var key in options){
if(!options.hasOwnProperty(key));
else if(key === "tag_name"){
if(!isTag(element) || !options.tag_name(element.name)){
return false;
}
} else if(key === "tag_type"){
if(!options.tag_type(element.type)) return false;
} else if(key === "tag_contains"){
if(isTag(element) || !options.tag_contains(element.data)){
return false;
}
} else if(!element.attribs || !options[key](element.attribs[key])){
return false;
}
}
return true;
};
var Checks = {
tag_name: function(name){
if(typeof name === "function"){
return function(elem){ return isTag(elem) && name(elem.name); };
} else if(name === "*"){
return isTag;
} else {
return function(elem){ return isTag(elem) && elem.name === name; };
}
},
tag_type: function(type){
if(typeof type === "function"){
return function(elem){ return type(elem.type); };
} else {
return function(elem){ return elem.type === type; };
}
},
tag_contains: function(data){
if(typeof data === "function"){
return function(elem){ return !isTag(elem) && data(elem.data); };
} else {
return function(elem){ return !isTag(elem) && elem.data === data; };
}
}
};
function getAttribCheck(attrib, value){
if(typeof value === "function"){
return function(elem){ return elem.attribs && value(elem.attribs[attrib]); };
} else {
return function(elem){ return elem.attribs && elem.attribs[attrib] === value; };
}
}
function combineFuncs(a, b){
return function(elem){
return a(elem) || b(elem);
};
}
exports.getElements = function(options, element, recurse, limit){
var funcs = Object.keys(options).map(function(key){
var value = options[key];
return key in Checks ? Checks[key](value) : getAttribCheck(key, value);
});
return funcs.length === 0 ? [] : this.filter(
funcs.reduce(combineFuncs),
element, recurse, limit
);
};
exports.getElementById = function(id, element, recurse){
if(!Array.isArray(element)) element = [element];
return this.findOne(getAttribCheck("id", id), element, recurse !== false);
};
exports.getElementsByTagName = function(name, element, recurse, limit){
return this.filter(Checks.tag_name(name), element, recurse, limit);
};
exports.getElementsByTagType = function(type, element, recurse, limit){
return this.filter(Checks.tag_type(type), element, recurse, limit);
};
/***/ },
/* 95 */
/***/ function(module, exports) {
// removeSubsets
// Given an array of nodes, remove any member that is contained by another.
exports.removeSubsets = function(nodes) {
var idx = nodes.length, node, ancestor, replace;
// Check if each node (or one of its ancestors) is already contained in the
// array.
while (--idx > -1) {
node = ancestor = nodes[idx];
// Temporarily remove the node under consideration
nodes[idx] = null;
replace = true;
while (ancestor) {
if (nodes.indexOf(ancestor) > -1) {
replace = false;
nodes.splice(idx, 1);
break;
}
ancestor = ancestor.parent;
}
// If the node has been found to be unique, re-insert it.
if (replace) {
nodes[idx] = node;
}
}
return nodes;
};
// Source: http://dom.spec.whatwg.org/#dom-node-comparedocumentposition
var POSITION = {
DISCONNECTED: 1,
PRECEDING: 2,
FOLLOWING: 4,
CONTAINS: 8,
CONTAINED_BY: 16
};
// Compare the position of one node against another node in any other document.
// The return value is a bitmask with the following values:
//
// document order:
// > There is an ordering, document order, defined on all the nodes in the
// > document corresponding to the order in which the first character of the
// > XML representation of each node occurs in the XML representation of the
// > document after expansion of general entities. Thus, the document element
// > node will be the first node. Element nodes occur before their children.
// > Thus, document order orders element nodes in order of the occurrence of
// > their start-tag in the XML (after expansion of entities). The attribute
// > nodes of an element occur after the element and before its children. The
// > relative order of attribute nodes is implementation-dependent./
// Source:
// http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
//
// @argument {Node} nodaA The first node to use in the comparison
// @argument {Node} nodeB The second node to use in the comparison
//
// @return {Number} A bitmask describing the input nodes' relative position.
// See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
// a description of these values.
var comparePos = exports.compareDocumentPosition = function(nodeA, nodeB) {
var aParents = [];
var bParents = [];
var current, sharedParent, siblings, aSibling, bSibling, idx;
if (nodeA === nodeB) {
return 0;
}
current = nodeA;
while (current) {
aParents.unshift(current);
current = current.parent;
}
current = nodeB;
while (current) {
bParents.unshift(current);
current = current.parent;
}
idx = 0;
while (aParents[idx] === bParents[idx]) {
idx++;
}
if (idx === 0) {
return POSITION.DISCONNECTED;
}
sharedParent = aParents[idx - 1];
siblings = sharedParent.children;
aSibling = aParents[idx];
bSibling = bParents[idx];
if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
if (sharedParent === nodeB) {
return POSITION.FOLLOWING | POSITION.CONTAINED_BY;
}
return POSITION.FOLLOWING;
} else {
if (sharedParent === nodeA) {
return POSITION.PRECEDING | POSITION.CONTAINS;
}
return POSITION.PRECEDING;
}
};
// Sort an array of nodes based on their relative position in the document and
// remove any duplicate nodes. If the array contains nodes that do not belong
// to the same document, sort order is unspecified.
//
// @argument {Array} nodes Array of DOM nodes
//
// @returns {Array} collection of unique nodes, sorted in document order
exports.uniqueSort = function(nodes) {
var idx = nodes.length, node, position;
nodes = nodes.slice();
while (--idx > -1) {
node = nodes[idx];
position = nodes.indexOf(node);
if (position > -1 && position < idx) {
nodes.splice(idx, 1);
}
}
nodes.sort(function(a, b) {
var relative = comparePos(a, b);
if (relative & POSITION.PRECEDING) {
return -1;
} else if (relative & POSITION.FOLLOWING) {
return 1;
}
return 0;
});
return nodes;
};
/***/ },
/* 96 */
/***/ function(module, exports, __webpack_require__) {
module.exports = CollectingHandler;
function CollectingHandler(cbs){
this._cbs = cbs || {};
this.events = [];
}
var EVENTS = __webpack_require__(41).EVENTS;
Object.keys(EVENTS).forEach(function(name){
if(EVENTS[name] === 0){
name = "on" + name;
CollectingHandler.prototype[name] = function(){
this.events.push([name]);
if(this._cbs[name]) this._cbs[name]();
};
} else if(EVENTS[name] === 1){
name = "on" + name;
CollectingHandler.prototype[name] = function(a){
this.events.push([name, a]);
if(this._cbs[name]) this._cbs[name](a);
};
} else if(EVENTS[name] === 2){
name = "on" + name;
CollectingHandler.prototype[name] = function(a, b){
this.events.push([name, a, b]);
if(this._cbs[name]) this._cbs[name](a, b);
};
} else {
throw Error("wrong number of arguments");
}
});
CollectingHandler.prototype.onreset = function(){
this.events = [];
if(this._cbs.onreset) this._cbs.onreset();
};
CollectingHandler.prototype.restart = function(){
if(this._cbs.onreset) this._cbs.onreset();
for(var i = 0, len = this.events.length; i < len; i++){
if(this._cbs[this.events[i][0]]){
var num = this.events[i].length;
if(num === 1){
this._cbs[this.events[i][0]]();
} else if(num === 2){
this._cbs[this.events[i][0]](this.events[i][1]);
} else {
this._cbs[this.events[i][0]](this.events[i][1], this.events[i][2]);
}
}
}
};
/***/ },
/* 97 */
/***/ function(module, exports, __webpack_require__) {
const h = __webpack_require__(98)
const header = __webpack_require__(107)
const renderTodos = __webpack_require__(108)
const footer = __webpack_require__(110)
const la = __webpack_require__(111)
const is = __webpack_require__(3)
const isTodos = is.schema({
items: is.array,
clearCompleted: is.fn,
add: is.fn,
mark: is.fn,
remove: is.fn
})
function render (Todos) {
la(isTodos(Todos), 'Todos has incorrect interface', Todos)
return h('section', {className: 'todoapp'}, [
header(Todos),
renderTodos(Todos),
footer(Todos)
])
}
module.exports = render
/***/ },
/* 98 */
/***/ function(module, exports, __webpack_require__) {
var h = __webpack_require__(99)
module.exports = h
/***/ },
/* 99 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var isArray = __webpack_require__(7);
var VNode = __webpack_require__(27);
var VText = __webpack_require__(28);
var isVNode = __webpack_require__(10);
var isVText = __webpack_require__(11);
var isWidget = __webpack_require__(12);
var isHook = __webpack_require__(17);
var isVThunk = __webpack_require__(13);
var parseTag = __webpack_require__(100);
var softSetHook = __webpack_require__(102);
var evHook = __webpack_require__(103);
module.exports = h;
function h(tagName, properties, children) {
var childNodes = [];
var tag, props, key, namespace;
if (!children && isChildren(properties)) {
children = properties;
props = {};
}
props = props || properties || {};
tag = parseTag(tagName, props);
// support keys
if (props.hasOwnProperty('key')) {
key = props.key;
props.key = undefined;
}
// support namespace
if (props.hasOwnProperty('namespace')) {
namespace = props.namespace;
props.namespace = undefined;
}
// fix cursor bug
if (tag === 'INPUT' &&
!namespace &&
props.hasOwnProperty('value') &&
props.value !== undefined &&
!isHook(props.value)
) {
props.value = softSetHook(props.value);
}
transformProperties(props);
if (children !== undefined && children !== null) {
addChild(children, childNodes, tag, props);
}
return new VNode(tag, props, childNodes, key, namespace);
}
function addChild(c, childNodes, tag, props) {
if (typeof c === 'string') {
childNodes.push(new VText(c));
} else if (typeof c === 'number') {
childNodes.push(new VText(String(c)));
} else if (isChild(c)) {
childNodes.push(c);
} else if (isArray(c)) {
for (var i = 0; i < c.length; i++) {
addChild(c[i], childNodes, tag, props);
}
} else if (c === null || c === undefined) {
return;
} else {
throw UnexpectedVirtualElement({
foreignObject: c,
parentVnode: {
tagName: tag,
properties: props
}
});
}
}
function transformProperties(props) {
for (var propName in props) {
if (props.hasOwnProperty(propName)) {
var value = props[propName];
if (isHook(value)) {
continue;
}
if (propName.substr(0, 3) === 'ev-') {
// add ev-foo support
props[propName] = evHook(value);
}
}
}
}
function isChild(x) {
return isVNode(x) || isVText(x) || isWidget(x) || isVThunk(x);
}
function isChildren(x) {
return typeof x === 'string' || isArray(x) || isChild(x);
}
function UnexpectedVirtualElement(data) {
var err = new Error();
err.type = 'virtual-hyperscript.unexpected.virtual-element';
err.message = 'Unexpected virtual child passed to h().\n' +
'Expected a VNode / Vthunk / VWidget / string but:\n' +
'got:\n' +
errorString(data.foreignObject) +
'.\n' +
'The parent vnode is:\n' +
errorString(data.parentVnode)
'\n' +
'Suggested fix: change your `h(..., [ ... ])` callsite.';
err.foreignObject = data.foreignObject;
err.parentVnode = data.parentVnode;
return err;
}
function errorString(obj) {
try {
return JSON.stringify(obj, null, ' ');
} catch (e) {
return String(obj);
}
}
/***/ },
/* 100 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var split = __webpack_require__(101);
var classIdSplit = /([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/;
var notClassId = /^\.|#/;
module.exports = parseTag;
function parseTag(tag, props) {
if (!tag) {
return 'DIV';
}
var noId = !(props.hasOwnProperty('id'));
var tagParts = split(tag, classIdSplit);
var tagName = null;
if (notClassId.test(tagParts[1])) {
tagName = 'DIV';
}
var classes, part, type, i;
for (i = 0; i < tagParts.length; i++) {
part = tagParts[i];
if (!part) {
continue;
}
type = part.charAt(0);
if (!tagName) {
tagName = part;
} else if (type === '.') {
classes = classes || [];
classes.push(part.substring(1, part.length));
} else if (type === '#' && noId) {
props.id = part.substring(1, part.length);
}
}
if (classes) {
if (props.className) {
classes.push(props.className);
}
props.className = classes.join(' ');
}
return props.namespace ? tagName : tagName.toUpperCase();
}
/***/ },
/* 101 */
/***/ function(module, exports) {
/*!
* Cross-Browser Split 1.1.1
* Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
* Available under the MIT License
* ECMAScript compliant, uniform cross-browser split method
*/
/**
* Splits a string into an array of strings using a regex or string separator. Matches of the
* separator are not included in the result array. However, if `separator` is a regex that contains
* capturing groups, backreferences are spliced into the result each time `separator` is matched.
* Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably
* cross-browser.
* @param {String} str String to split.
* @param {RegExp|String} separator Regex or string to use for separating the string.
* @param {Number} [limit] Maximum number of items to include in the result array.
* @returns {Array} Array of substrings.
* @example
*
* // Basic use
* split('a b c d', ' ');
* // -> ['a', 'b', 'c', 'd']
*
* // With limit
* split('a b c d', ' ', 2);
* // -> ['a', 'b']
*
* // Backreferences in result array
* split('..word1 word2..', /([a-z]+)(\d+)/i);
* // -> ['..', 'word', '1', ' ', 'word', '2', '..']
*/
module.exports = (function split(undef) {
var nativeSplit = String.prototype.split,
compliantExecNpcg = /()??/.exec("")[1] === undef,
// NPCG: nonparticipating capturing group
self;
self = function(str, separator, limit) {
// If `separator` is not a regex, use `nativeSplit`
if (Object.prototype.toString.call(separator) !== "[object RegExp]") {
return nativeSplit.call(str, separator, limit);
}
var output = [],
flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.extended ? "x" : "") + // Proposed for ES6
(separator.sticky ? "y" : ""),
// Firefox 3+
lastLastIndex = 0,
// Make `global` and avoid `lastIndex` issues by working with a copy
separator = new RegExp(separator.source, flags + "g"),
separator2, match, lastIndex, lastLength;
str += ""; // Type-convert
if (!compliantExecNpcg) {
// Doesn't need flags gy, but they don't hurt
separator2 = new RegExp("^" + separator.source + "$(?!\\s)", flags);
}
/* Values for `limit`, per the spec:
* If undefined: 4294967295 // Math.pow(2, 32) - 1
* If 0, Infinity, or NaN: 0
* If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
* If negative number: 4294967296 - Math.floor(Math.abs(limit))
* If other: Type-convert, then use the above rules
*/
limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1
limit >>> 0; // ToUint32(limit)
while (match = separator.exec(str)) {
// `separator.lastIndex` is not reliable cross-browser
lastIndex = match.index + match[0].length;
if (lastIndex > lastLastIndex) {
output.push(str.slice(lastLastIndex, match.index));
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1) {
match[0].replace(separator2, function() {
for (var i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undef) {
match[i] = undef;
}
}
});
}
if (match.length > 1 && match.index < str.length) {
Array.prototype.push.apply(output, match.slice(1));
}
lastLength = match[0].length;
lastLastIndex = lastIndex;
if (output.length >= limit) {
break;
}
}
if (separator.lastIndex === match.index) {
separator.lastIndex++; // Avoid an infinite loop
}
}
if (lastLastIndex === str.length) {
if (lastLength || !separator.test("")) {
output.push("");
}
} else {
output.push(str.slice(lastLastIndex));
}
return output.length > limit ? output.slice(0, limit) : output;
};
return self;
})();
/***/ },
/* 102 */
/***/ function(module, exports) {
'use strict';
module.exports = SoftSetHook;
function SoftSetHook(value) {
if (!(this instanceof SoftSetHook)) {
return new SoftSetHook(value);
}
this.value = value;
}
SoftSetHook.prototype.hook = function (node, propertyName) {
if (node[propertyName] !== this.value) {
node[propertyName] = this.value;
}
};
/***/ },
/* 103 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var EvStore = __webpack_require__(104);
module.exports = EvHook;
function EvHook(value) {
if (!(this instanceof EvHook)) {
return new EvHook(value);
}
this.value = value;
}
EvHook.prototype.hook = function (node, propertyName) {
var es = EvStore(node);
var propName = propertyName.substr(3);
es[propName] = this.value;
};
EvHook.prototype.unhook = function(node, propertyName) {
var es = EvStore(node);
var propName = propertyName.substr(3);
es[propName] = undefined;
};
/***/ },
/* 104 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var OneVersionConstraint = __webpack_require__(105);
var MY_VERSION = '7';
OneVersionConstraint('ev-store', MY_VERSION);
var hashKey = '__EV_STORE_KEY@' + MY_VERSION;
module.exports = EvStore;
function EvStore(elem) {
var hash = elem[hashKey];
if (!hash) {
hash = elem[hashKey] = {};
}
return hash;
}
/***/ },
/* 105 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var Individual = __webpack_require__(106);
module.exports = OneVersion;
function OneVersion(moduleName, version, defaultValue) {
var key = '__INDIVIDUAL_ONE_VERSION_' + moduleName;
var enforceKey = key + '_ENFORCE_SINGLETON';
var versionValue = Individual(enforceKey, version);
if (versionValue !== version) {
throw new Error('Can only have one copy of ' +
moduleName + '.\n' +
'You already have version ' + versionValue +
' installed.\n' +
'This means you cannot install version ' + version);
}
return Individual(key, defaultValue);
}
/***/ },
/* 106 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {'use strict';
/*global window, global*/
var root = typeof window !== 'undefined' ?
window : typeof global !== 'undefined' ?
global : {};
module.exports = Individual;
function Individual(key, value) {
if (key in root) {
return root[key];
}
root[key] = value;
return value;
}
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 107 */
/***/ function(module, exports, __webpack_require__) {
const h = __webpack_require__(98)
function render (Todos) {
function isEnter (e) {
return e.keyCode === 13
}
function onKey (e) {
console.log('pressed', e.target.value)
if (isEnter(e)) {
Todos.add(e.target.value)
e.target.value = ''
}
}
return h('header', {className: 'header'}, [
h('h1', {}, 'todos'),
h('input', {
className: 'new-todo',
placeholder: 'What needs to be done?',
autofocus: true,
onkeyup: onKey
}, [])
])
}
module.exports = render
/***/ },
/* 108 */
/***/ function(module, exports, __webpack_require__) {
const h = __webpack_require__(98)
const renderTodo = __webpack_require__(109)
function render (Todos) {
return h('section', {className: 'main'}, [
h('input', {
className: 'toggle-all',
type: 'checkbox',
onclick: function (e) {
console.log('nothing')
// Todos.mark(e.target.checked);
// renderApp();
}
}),
h('label', {htmlFor: 'toggle-all'}, 'Mark all as complete'),
h('ul', {className: 'todo-list'},
Todos.items.map(renderTodo.bind(null, Todos)))
])
}
module.exports = render
/***/ },
/* 109 */
/***/ function(module, exports, __webpack_require__) {
const h = __webpack_require__(98)
function render (Todos, todo) {
return h('li', {className: todo.done ? 'completed' : '', key: todo.id}, [
h('div', {className: 'view'}, [
h('input', {
className: 'toggle',
type: 'checkbox',
checked: todo.done,
onchange: function (e) {
Todos.mark(todo.id, e.target.checked)
}
}),
h('label', todo.what),
h('button', {
className: 'destroy',
onclick: function (e) {
console.log('nothing')
Todos.remove(todo)
}
})
])
])
}
module.exports = render
/***/ },
/* 110 */
/***/ function(module, exports, __webpack_require__) {
const h = __webpack_require__(98)
function hashFragment () {
return typeof window !== 'undefined' && window.location.hash.split('/')[1] || ''
}
function countRemaining (todos) {
return todos.length - todos.reduce(function (count, todo) {
return count + Number(todo.done)
}, 0)
}
function hasCompleted (todos) {
return todos && todos.some(function (todo) {
return todo.done
})
}
function render (Todos) {
const remaining = countRemaining(Todos.items)
const route = hashFragment()
return h('footer', {className: 'footer'}, [
h('span', {className: 'todo-count'}, [
h('strong', {}, String(remaining)),
' items left'
]),
h('ul', {className: 'filters'}, [
h('li', [
h('a', {
className: !route ? 'selected' : '',
href: '#/'
}, 'All')
]),
h('li', [
h('a', {
className: route === 'active' ? 'selected' : '',
href: '#/active'
}, 'Active')
]),
h('li', [
h('a', {
className: route === 'completed' ? 'selected' : '',
href: '#/completed'
}, 'Completed')
])
]),
h('button', {
className: 'clear-completed',
style: {
display: hasCompleted(Todos.items) ? 'block' : 'none'
},
onclick: function () {
// todos && todos.clearCompleted();
// renderApp();
}
}, 'Clear completed')
])
}
module.exports = render
/***/ },
/* 111 */
/***/ function(module, exports) {
/* WEBPACK VAR INJECTION */(function(global) {(function initLazyAss() {
function isArrayLike(a) {
return a && typeof a.length === 'number';
}
function toStringArray(arr) {
return 'array with ' + arr.length + ' items.\n[' +
arr.map(toString).join(',') + ']\n';
}
function isPrimitive(arg) {
return typeof arg === 'string' ||
typeof arg === 'number' ||
typeof arg === 'boolean';
}
function toString(arg, k) {
if (isPrimitive(arg)) {
return JSON.stringify(arg);
}
if (arg instanceof Error) {
return arg.name + ' ' + arg.message;
}
if (Array.isArray(arg)) {
return toStringArray(arg);
}
if (isArrayLike(arg)) {
return toStringArray(Array.prototype.slice.call(arg, 0));
}
var argString;
try {
argString = JSON.stringify(arg, null, 2);
} catch (err) {
argString = '{ cannot stringify arg ' + k + ', it has type "' + typeof arg + '"';
if (typeof arg === 'object') {
argString += ' with keys ' + Object.keys(arg).join(', ') + ' }';
} else {
argString += ' }';
}
}
return argString;
}
function endsWithNewLine(s) {
return /\n$/.test(s);
}
function formMessage(args) {
var msg = args.reduce(function (total, arg, k) {
if (k && !endsWithNewLine(total)) {
total += ' ';
}
if (typeof arg === 'string') {
return total + arg;
}
if (typeof arg === 'function') {
var fnResult;
try {
fnResult = arg();
} catch (err) {
// ignore the error
fnResult = '[function ' + arg.name + ' threw error!]';
}
return total + fnResult;
}
var argString = toString(arg, k);
return total + argString;
}, '');
return msg;
}
function lazyAssLogic(condition) {
var fn = typeof condition === 'function' ? condition : null;
if (fn) {
condition = fn();
}
if (!condition) {
var args = [].slice.call(arguments, 1);
if (fn) {
args.unshift(fn.toString());
}
return new Error(formMessage(args));
}
}
var lazyAss = function lazyAss() {
var err = lazyAssLogic.apply(null, arguments);
if (err) {
throw err;
}
};
var lazyAssync = function lazyAssync() {
var err = lazyAssLogic.apply(null, arguments);
if (err) {
setTimeout(function () {
throw err;
}, 0);
}
};
lazyAss.async = lazyAssync;
function isNode() {
return typeof global === 'object';
}
function isBrowser() {
return typeof window === 'object';
}
function isCommonJS() {
return typeof module === 'object';
}
function globalRegister() {
if (isNode()) {
/* global global */
register(global, lazyAss, 'lazyAss', 'la');
register(global, lazyAssync, 'lazyAssync', 'lac');
}
}
function register(root, value, name, alias) {
root[name] = root[alias] = value;
}
lazyAss.globalRegister = globalRegister;
if (isBrowser()) {
/* global window */
register(window, lazyAss, 'lazyAss', 'la');
register(window, lazyAssync, 'lazyAssync', 'lac');
}
if (isCommonJS()) {
/* global module */
module.exports = lazyAss;
}
}());
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 112 */
/***/ function(module, exports, __webpack_require__) {
const la = __webpack_require__(111)
const is = __webpack_require__(3)
const uuid = __webpack_require__(113)
var Todos = {
add: function add (what) {
la(is.unemptyString(what), 'expected unempty string', what)
Todos.items.unshift({
what: what,
done: false,
id: uuid()
})
},
mark: function mark (id, done) {
la(is.unemptyString(id), 'expected id', id)
Todos.items.forEach(function (todo) {
if (todo.id === id) {
todo.done = done
}
})
},
remove: function remove (todo) {
la(is.object(todo), 'missing todo to remove', todo)
Todos.items = Todos.items.filter(function (t) {
return t.id !== todo.id
})
},
clearCompleted: function clearCompleted () {
console.log('clearCompleted not implemented')
},
items: []
}
la(is.array(Todos.items), 'expected list of todos', Todos.items)
module.exports = Todos
/***/ },
/* 113 */
/***/ function(module, exports) {
// from http://jsfiddle.net/briguy37/2mvfd/
function uuid () {
var d = new Date().getTime()
var uuidFormat = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
var id = uuidFormat.replace(/[xy]/g, function (c) {
var r = (d + Math.random() * 16) % 16 | 0
d = Math.floor(d / 16)
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16)
})
return id
}
module.exports = uuid
/***/ },
/* 114 */
/***/ function(module, exports) {
module.exports = [
{
"what": "help fix fines",
"due": "tomorrow",
"done": false,
"id": "db2f5b89-7143-4be1-a25d-aafda9b95f31"
},
{
"what": "skip exercising fines",
"due": "tomorrow",
"done": false,
"id": "54cb20a5-56d3-4c82-bb27-e8944981aee9"
},
{
"what": "sell books",
"due": "tomorrow",
"done": false,
"id": "ea373b4d-24cf-457a-9ca3-8ab10f3cbb84"
},
{
"what": "pretend to pick principles",
"due": "tomorrow",
"done": false,
"id": "69e5161e-d038-42aa-b5cb-9a6b3f5fa529"
},
{
"what": "buy bird",
"due": "tomorrow",
"done": false,
"id": "1d1ec006-d05b-4d4a-a82c-9f1f88d332e3"
},
{
"what": "tweet Node.js",
"due": "tomorrow",
"done": false,
"id": "d2db157a-d13b-41ac-9379-12ea5862ef17"
},
{
"what": "help buy castle",
"due": "tomorrow",
"done": false,
"id": "4db10c6f-acb5-4695-9255-5d2f5ecf39ed"
},
{
"what": "help avoid fishing rod",
"due": "tomorrow",
"done": false,
"id": "687c5467-8ec9-45a6-a4b0-88a5caea195c"
},
{
"what": "promote principles",
"due": "tomorrow",
"done": false,
"id": "9119ec04-748c-4a23-95b6-352a6e2379ba"
},
{
"what": "try to tweet distant relatives",
"due": "tomorrow",
"done": false,
"id": "ca5fc106-89e3-4a75-8ef6-2ce67fde5f2f"
},
{
"what": "pick bird",
"due": "tomorrow",
"done": false,
"id": "55149f97-d2e9-4bf6-a3f2-115880c50c76"
},
{
"what": "add bird",
"due": "tomorrow",
"done": false,
"id": "97a31a80-cf42-4970-9cc3-b1f67da623a3"
},
{
"what": "skip exercising needle work",
"due": "tomorrow",
"done": false,
"id": "860423a6-8fc4-4129-8059-97102f9f2132"
},
{
"what": "buy distant relatives",
"due": "tomorrow",
"done": false,
"id": "7e39613a-fd6a-49b2-900b-cc63151be19f"
},
{
"what": "promote Italian",
"due": "tomorrow",
"done": false,
"id": "111b7758-1dfc-414f-bf22-0fc138312089"
},
{
"what": "try to code laptop",
"due": "tomorrow",
"done": false,
"id": "36f8afa1-831b-4361-bd8f-0ca9569c1c94"
},
{
"what": "fix chess",
"due": "tomorrow",
"done": false,
"id": "4b77d626-40ba-43f6-80dc-ddf5aca037b6"
},
{
"what": "try to code bird",
"due": "tomorrow",
"done": false,
"id": "411dae7a-35e4-4a01-8a0f-46a15fec9445"
},
{
"what": "make distant relatives",
"due": "tomorrow",
"done": false,
"id": "30364285-b2ad-4b57-aade-3bfe2e5f45a5"
},
{
"what": "pretend to buy fines",
"due": "tomorrow",
"done": false,
"id": "3d9cf7df-73ca-4fa9-8ca2-b1c992ad9a1e"
},
{
"what": "make Node.js",
"due": "tomorrow",
"done": false,
"id": "f9b60833-ff75-41c4-a38e-1159f37ee687"
},
{
"what": "make castle",
"due": "tomorrow",
"done": false,
"id": "78afe710-2473-4f4d-89c2-1b230d84c364"
},
{
"what": "avoid crashing boots",
"due": "tomorrow",
"done": false,
"id": "12e16af5-498b-41a3-ad99-d27f271ee732"
},
{
"what": "submit books",
"due": "tomorrow",
"done": false,
"id": "b4280a63-5c90-4ddc-83d4-4c11a3e36c5b"
},
{
"what": "skip avoiding milk",
"due": "tomorrow",
"done": false,
"id": "d62cb8f3-a5d4-4851-a578-90672ba7f541"
},
{
"what": "pretend to clean distant relatives",
"due": "tomorrow",
"done": false,
"id": "368f499c-69fc-42a0-97ac-f2920d5b222b"
},
{
"what": "make fines",
"due": "tomorrow",
"done": false,
"id": "7dd2f859-3e98-4b9d-9b75-d204fa111d2e"
},
{
"what": "skip throwing milk",
"due": "tomorrow",
"done": false,
"id": "0f790690-a29d-416e-8a70-bd498f5697c5"
},
{
"what": "promote boots",
"due": "tomorrow",
"done": false,
"id": "bca35e5f-c758-4c0f-8b08-bdf0b4bd2524"
},
{
"what": "play knife",
"due": "tomorrow",
"done": false,
"id": "a02292d9-74a0-4a13-a798-79bc55e2153f"
},
{
"what": "try to avoid adults",
"due": "tomorrow",
"done": false,
"id": "3ca10aa8-3f90-4b9a-bf5b-7959b108a4c6"
},
{
"what": "tweet fines",
"due": "tomorrow",
"done": false,
"id": "cc07b3e2-f734-4f6a-8317-1d314d27d816"
},
{
"what": "avoid chess",
"due": "tomorrow",
"done": false,
"id": "50f66997-e070-45d8-b388-8dc4a4c7d739"
},
{
"what": "forget adults",
"due": "tomorrow",
"done": false,
"id": "2d8dac09-c602-4caa-b13a-21fb4bf5a8bd"
},
{
"what": "pick distant relatives",
"due": "tomorrow",
"done": false,
"id": "3fa0f111-0b93-4f38-821b-1b6bcf7e9e8a"
},
{
"what": "help code knife",
"due": "tomorrow",
"done": false,
"id": "1f93ce72-20c4-454e-bac1-ae44124d321d"
},
{
"what": "crash distant relatives",
"due": "tomorrow",
"done": false,
"id": "d636e89a-a5a1-405d-8b64-0898eff6f489"
},
{
"what": "try to forget principles",
"due": "tomorrow",
"done": false,
"id": "ae761cb2-6e1d-4188-be9e-5a375e54097e"
},
{
"what": "promote Italian",
"due": "tomorrow",
"done": false,
"id": "c9a36858-acd4-4273-9554-057b7cc75c8c"
},
{
"what": "avoid making distant relatives",
"due": "tomorrow",
"done": false,
"id": "bac8d783-5c57-4819-a27c-b823991ee188"
},
{
"what": "pretend to exercise charges",
"due": "tomorrow",
"done": false,
"id": "8408dcc7-a8d8-4a9b-b7a4-c1b85622c50a"
},
{
"what": "help do castle",
"due": "tomorrow",
"done": false,
"id": "0260a1b5-84e4-4ad5-8a1f-fda53eace79c"
},
{
"what": "tweet Node.js",
"due": "tomorrow",
"done": false,
"id": "83872342-eaf0-4c5e-b55a-bd2fcafa927a"
},
{
"what": "pretend to find fines",
"due": "tomorrow",
"done": false,
"id": "76227a1c-ba09-4b7f-8800-0ba652ffeb07"
},
{
"what": "make Node.js",
"due": "tomorrow",
"done": false,
"id": "8424e9f6-675a-459d-b044-74085a43c223"
},
{
"what": "pretend to buy fishing rod",
"due": "tomorrow",
"done": false,
"id": "785f758c-44e3-445a-897d-fd6b865b40a7"
},
{
"what": "avoid milk",
"due": "tomorrow",
"done": false,
"id": "f91d84a6-d555-42a1-b51d-aca1a200e939"
},
{
"what": "fix chess",
"due": "tomorrow",
"done": false,
"id": "830325d9-cd54-4031-806c-c431eecc6fe6"
},
{
"what": "pretend to buy Node.js",
"due": "tomorrow",
"done": false,
"id": "3d74ca36-8b11-471d-9cb0-5c75de529095"
},
{
"what": "try to tweet milk",
"due": "tomorrow",
"done": false,
"id": "05eca89c-9c07-419a-9849-d0bb877448eb"
},
{
"what": "help promote principles",
"due": "tomorrow",
"done": false,
"id": "1c5d10eb-c792-4106-8be2-d89dda1aa75d"
},
{
"what": "try to promote fines",
"due": "tomorrow",
"done": false,
"id": "ae76add3-4ee6-48e1-bdf4-a9cb336b5bfe"
},
{
"what": "try to play adults",
"due": "tomorrow",
"done": false,
"id": "972bc87c-0437-4d27-aa6a-2d808268e717"
},
{
"what": "fix adults",
"due": "tomorrow",
"done": false,
"id": "270bdc2c-781f-4f71-bb91-83fc11426623"
},
{
"what": "promote boots",
"due": "tomorrow",
"done": false,
"id": "be153dff-fa1f-463e-83ec-48daf1391e70"
},
{
"what": "submit knife",
"due": "tomorrow",
"done": false,
"id": "c40a01ba-4bbe-497e-a058-b444dfc1f012"
},
{
"what": "fix needle work",
"due": "tomorrow",
"done": false,
"id": "5b800671-644c-4616-93f1-ab6f75502f9f"
},
{
"what": "make laptop",
"due": "tomorrow",
"done": false,
"id": "6d3360bd-07d1-4db1-b8f8-aa4399ca9c28"
},
{
"what": "play charges",
"due": "tomorrow",
"done": false,
"id": "6fd5180a-f354-4d86-9036-4ae459bffacf"
},
{
"what": "play Italian",
"due": "tomorrow",
"done": false,
"id": "1faa6017-cbd8-4ba9-a5d3-47e5bd40b50d"
},
{
"what": "skip cleaning bird",
"due": "tomorrow",
"done": false,
"id": "50f58690-a02d-4936-b073-a6feb814c950"
},
{
"what": "pick boots",
"due": "tomorrow",
"done": false,
"id": "038c1d0f-59cb-463c-8764-801670f6d556"
},
{
"what": "pretend to skip bird",
"due": "tomorrow",
"done": false,
"id": "8fbf1e0c-a195-40e9-b0ee-0d67d5ed3a12"
},
{
"what": "pretend to throw boots",
"due": "tomorrow",
"done": false,
"id": "e56b4fcc-65e2-497d-af8d-59727d7f525b"
},
{
"what": "clean Node.js",
"due": "tomorrow",
"done": false,
"id": "f8d78d57-10fa-4565-9c1f-7ba435f800b1"
},
{
"what": "code castle",
"due": "tomorrow",
"done": false,
"id": "32296241-9e13-4b5b-858a-52be96778377"
},
{
"what": "crash castle",
"due": "tomorrow",
"done": false,
"id": "e36011dd-100c-4db2-8808-55fe4091ae00"
},
{
"what": "try to buy adults",
"due": "tomorrow",
"done": false,
"id": "1b29b9f0-5f3c-42d6-937d-6f688dba6661"
},
{
"what": "pretend to make laptop",
"due": "tomorrow",
"done": false,
"id": "1da7d7b1-152f-461f-8072-2b84290490db"
},
{
"what": "avoid castle",
"due": "tomorrow",
"done": false,
"id": "20217340-ecc5-40ba-aac3-3b1385ca0681"
},
{
"what": "try to fix Node.js",
"due": "tomorrow",
"done": false,
"id": "373b895d-8662-4d09-9da0-0a6d5d9ff115"
},
{
"what": "avoid throwing charges",
"due": "tomorrow",
"done": false,
"id": "362f3256-295d-4baa-9821-4e5ece50f154"
},
{
"what": "try to tweet fishing rod",
"due": "tomorrow",
"done": false,
"id": "9e721b88-58b0-4055-b216-7be02e6f8470"
},
{
"what": "add castle",
"due": "tomorrow",
"done": false,
"id": "6ecd397f-34bb-4622-8eb3-a4d9058cbdf8"
},
{
"what": "throw laptop",
"due": "tomorrow",
"done": false,
"id": "e4e8ab3f-3ede-4b31-b00b-a61abd730b84"
},
{
"what": "try to learn charges",
"due": "tomorrow",
"done": false,
"id": "49384468-e893-4ada-8b1f-530776038946"
},
{
"what": "try to skip charges",
"due": "tomorrow",
"done": false,
"id": "24a037d1-5136-4f72-9242-0c133bb5d5f3"
},
{
"what": "sell books",
"due": "tomorrow",
"done": false,
"id": "076aba82-a0b5-45a5-959b-a9fca4799763"
},
{
"what": "throw knife",
"due": "tomorrow",
"done": false,
"id": "7c3bcfcf-18b4-41a4-9f4a-9ad74905d282"
},
{
"what": "help throw Node.js",
"due": "tomorrow",
"done": false,
"id": "67f8be37-3555-415c-9f34-0dd4b77e5481"
},
{
"what": "try to find chess",
"due": "tomorrow",
"done": false,
"id": "9d62e22d-ea24-4e4a-a80c-fad106d16d4f"
},
{
"what": "try to add fishing rod",
"due": "tomorrow",
"done": false,
"id": "ead32ebd-a5f7-4d2e-8e7a-5b822838133d"
},
{
"what": "skip finding Italian",
"due": "tomorrow",
"done": false,
"id": "4c4bdaa2-3864-4e40-800b-6059d117dcd8"
},
{
"what": "avoid needle work",
"due": "tomorrow",
"done": false,
"id": "ca87cbb2-fe5f-4a72-bf4f-dcc7016d9c46"
},
{
"what": "pretend to code boots",
"due": "tomorrow",
"done": false,
"id": "21cb6d6c-d9c8-4fb0-b661-20a6dcbfeaf4"
},
{
"what": "forget adults",
"due": "tomorrow",
"done": false,
"id": "4a565cff-f3a2-4956-9e01-b83a6739b9d9"
},
{
"what": "promote boots",
"due": "tomorrow",
"done": false,
"id": "a0a258d8-24e7-4c76-9c2e-d1cca2ceaa1e"
},
{
"what": "avoid playing adults",
"due": "tomorrow",
"done": false,
"id": "d4010122-4800-4e97-a739-f37f1fc38cfa"
},
{
"what": "make milk",
"due": "tomorrow",
"done": false,
"id": "16ecb5c5-14fd-4554-98c2-07f53ae9c827"
},
{
"what": "fix chess",
"due": "tomorrow",
"done": false,
"id": "a6c1ba29-b142-4bea-9e63-02484fc7a3d9"
},
{
"what": "throw knife",
"due": "tomorrow",
"done": false,
"id": "dc77f679-1848-4a89-84cb-53aa377ac0da"
},
{
"what": "add Italian",
"due": "tomorrow",
"done": false,
"id": "190f0191-af71-4fac-a467-58f276c14739"
},
{
"what": "pretend to code laptop",
"due": "tomorrow",
"done": false,
"id": "73ad3df5-530c-4327-a0d2-296d5d1a8388"
},
{
"what": "try to avoid distant relatives",
"due": "tomorrow",
"done": false,
"id": "8bd52ae0-0aac-48ea-b474-19951eb59166"
},
{
"what": "help learn boots",
"due": "tomorrow",
"done": false,
"id": "d2eec216-285f-4e44-8c4c-6248592583f9"
},
{
"what": "add needle work",
"due": "tomorrow",
"done": false,
"id": "42beb520-cacd-4b66-b740-85f2c83ab7c9"
},
{
"what": "help forget laptop",
"due": "tomorrow",
"done": false,
"id": "18d31c9b-f2f9-4538-89ad-d0f3766a9830"
},
{
"what": "code fishing rod",
"due": "tomorrow",
"done": false,
"id": "4a254ad7-ab70-4257-bc59-c0f2b5e61dae"
},
{
"what": "try to promote laptop",
"due": "tomorrow",
"done": false,
"id": "82e54f4b-0507-4127-90a1-ab3a919790d7"
},
{
"what": "exercise laptop",
"due": "tomorrow",
"done": false,
"id": "2cecf0c2-d0b1-4cf6-9ee2-d3ac87e18284"
}
];
/***/ }
/******/ ]); | 24.238444 | 177 | 0.561112 |
c61156ad4ecf861b7f8a369022cbae45d18dc2b5 | 462 | js | JavaScript | client/src/Components/Nav/Nav.js | NastyaShafir/returnship-project-voting | fa0224c3beff2b9c800576f4b38b4ee4efa2ad21 | [
"MIT"
] | 3 | 2020-05-04T18:31:06.000Z | 2021-06-08T18:25:18.000Z | client/src/Components/Nav/Nav.js | NastyaShafir/returnship-project-voting | fa0224c3beff2b9c800576f4b38b4ee4efa2ad21 | [
"MIT"
] | 33 | 2020-04-14T22:09:04.000Z | 2021-01-10T02:58:49.000Z | client/src/Components/Nav/Nav.js | NastyaShafir/returnship-project-voting | fa0224c3beff2b9c800576f4b38b4ee4efa2ad21 | [
"MIT"
] | 1 | 2021-05-06T13:22:57.000Z | 2021-05-06T13:22:57.000Z | import React from "react";
import { NavLink } from "react-router-dom";
import Logo from "../Images/Logo.svg";
import NavLinks from "./NavLinks";
export default function Nav() {
return (
<nav className="nav__large">
<div className="nav__large-logo">
<img src={Logo} alt="Career Returnship Logo" />
<NavLink to="/">CAREER RETURNSHIP</NavLink>
</div>
<div className="spacer" />
<NavLinks />
</nav>
);
}
| 22 | 55 | 0.603896 |
c612b8f35a87e7fcba568a3576dba928e7b29d35 | 1,552 | js | JavaScript | test/e2e.test.js | adobe/asset-compute-pipeline | e07c77ae1213b48b229cc0d657c648850bb17597 | [
"Apache-2.0"
] | null | null | null | test/e2e.test.js | adobe/asset-compute-pipeline | e07c77ae1213b48b229cc0d657c648850bb17597 | [
"Apache-2.0"
] | 33 | 2021-07-28T17:01:45.000Z | 2022-03-31T16:08:38.000Z | test/e2e.test.js | adobe/asset-compute-pipeline | e07c77ae1213b48b229cc0d657c648850bb17597 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
/* eslint-env mocha */
'use strict';
// alternative debug configuration in VSCode
// in settings.json under mochaExplorer.env add these
// "DEBUG": "pipeline:*",
// "DEBUG_HIDE_DATE": "1",
process.env.DEBUG_HIDE_DATE = "1";
const debugConfig = require('debug');
debugConfig.enable("pipeline:*,test:*");
//const debug = require('debug')('test:engine');
const path = require("path");
// const fs = require("fs-extra");
require('dotenv').config({ path: path.join(__dirname, 'test.env') });
describe.skip("E2E Pipeline tests", function () {
before(function () {
process.env.__OW_NAMESPACE = process.env.OW_NAMESPACE;
process.env.__OW_API_KEY = process.env.OW_API_KEY;
process.env.WORKER_BASE_DIRECTORY = 'build/work';
});
after(function(){
delete process.env.__OW_NAMESPACE;
delete process.env.__OW_API_KEY;
delete process.env.WORKER_BASE_DIRECTORY;
});
});
| 33.73913 | 89 | 0.703608 |
c61336a4befca71875e2c45ce8fb14198552cfb0 | 672 | js | JavaScript | prod/index.min.js | Ivl-Nunez/Babel | 869d4a522a02f60b92b4e6fe839ebbe59102a931 | [
"MIT"
] | null | null | null | prod/index.min.js | Ivl-Nunez/Babel | 869d4a522a02f60b92b4e6fe839ebbe59102a931 | [
"MIT"
] | 1 | 2021-05-11T18:41:41.000Z | 2021-05-11T18:41:41.000Z | prod/index.min.js | Ivl-Nunez/Babel | 869d4a522a02f60b92b4e6fe839ebbe59102a931 | [
"MIT"
] | null | null | null | "use strict";function _classCallCheck(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,n,t){return n&&_defineProperties(e.prototype,n),t&&_defineProperties(e,t),e}var Planet=function(){function e(n,t){_classCallCheck(this,e),this.mass=n,this.moons=t||0}return _createClass(e,[{key:"reportMoons",value:function(){console.log("I have ".concat(this.moons," moons."))}}]),e}(),jupiter=new Planet("Pretty Big",67);jupiter.reportMoons();
| 336 | 671 | 0.739583 |
c61350106533a9c0c9f0fab6e61c05df9854b150 | 27 | js | JavaScript | research/techs/micro/balancer/public/main.js | Silver-birder/think-micro-frontends | 620337e40c360447cbfee7919d2ddbe1b424ef66 | [
"MIT"
] | 4 | 2020-11-05T00:11:45.000Z | 2022-02-22T18:05:15.000Z | research/techs/micro/balancer/public/main.js | Silver-birder/think-micro-frontends | 620337e40c360447cbfee7919d2ddbe1b424ef66 | [
"MIT"
] | null | null | null | research/techs/micro/balancer/public/main.js | Silver-birder/think-micro-frontends | 620337e40c360447cbfee7919d2ddbe1b424ef66 | [
"MIT"
] | null | null | null | require('./style.css!css')
| 13.5 | 26 | 0.666667 |
c6146343906ff799fe72eec20a7f24ac528c4898 | 2,251 | js | JavaScript | test/service/provider/urlShortening.provider.test.js | taulinger/bav4-nomigration | 1d39037bc27b931d5fbdf04110fda4e7c714184e | [
"Apache-2.0"
] | null | null | null | test/service/provider/urlShortening.provider.test.js | taulinger/bav4-nomigration | 1d39037bc27b931d5fbdf04110fda4e7c714184e | [
"Apache-2.0"
] | 2 | 2020-11-16T15:09:27.000Z | 2020-12-14T20:28:20.000Z | test/service/provider/urlShortening.provider.test.js | taulinger/bav4-nomigration | 1d39037bc27b931d5fbdf04110fda4e7c714184e | [
"Apache-2.0"
] | 1 | 2020-11-16T14:30:12.000Z | 2020-11-16T14:30:12.000Z | import { $injector } from '../../../src/injection';
import { shortenBvvUrls } from '../../../src/services/provider/urlShorteningProvider';
describe('UrlShortening provider', () => {
describe('Bvv UrlShortening provider', () => {
const configService = {
getValueAsPath: () => { }
};
const httpService = {
get: async () => { }
};
beforeAll(() => {
$injector
.registerSingleton('ConfigService', configService)
.registerSingleton('HttpService', httpService);
});
it('shortens an url', async () => {
const urlShorteningServiceUrl = 'https://shortening.url';
const urlToShorten = 'https://makeme.shorter';
const expectedShortUrl = 'https://much.shorter';
const expectedArgs0 = urlShorteningServiceUrl + '?createcode=' + encodeURIComponent(urlToShorten);
const configServiceSpy = spyOn(configService, 'getValueAsPath').withArgs('SHORTENING_SERVICE_URL').and.returnValue(urlShorteningServiceUrl);
const httpServiceSpy = spyOn(httpService, 'get').withArgs(expectedArgs0).and.returnValue(Promise.resolve(
new Response(
JSON.stringify({
shorturl: expectedShortUrl
})
)
));
const shortUrl = await shortenBvvUrls(urlToShorten);
expect(configServiceSpy).toHaveBeenCalled();
expect(httpServiceSpy).toHaveBeenCalled();
expect(shortUrl).toBe(expectedShortUrl);
});
it('rejects when backend request cannot be fulfilled', async () => {
const urlShorteningServiceUrl = 'https://shortening.url';
const urlToShorten = 'https://makeme.shorter';
const expectedArgs0 = urlShorteningServiceUrl + '?createcode=' + encodeURIComponent(urlToShorten);
const configServiceSpy = spyOn(configService, 'getValueAsPath').withArgs('SHORTENING_SERVICE_URL').and.returnValue(urlShorteningServiceUrl);
const httpServiceSpy = spyOn(httpService, 'get').withArgs(expectedArgs0).and.returnValue(Promise.resolve(
new Response(null, { status: 404 })
));
try {
await shortenBvvUrls(urlToShorten);
throw new Error('Promise should not be resolved');
}
catch (error) {
expect(configServiceSpy).toHaveBeenCalled();
expect(httpServiceSpy).toHaveBeenCalled();
expect(error.message).toBe('A short url could not be retrieved');
}
});
});
});
| 33.102941 | 143 | 0.704131 |
c6146f162ef12339e6109ff279eaf75dca59e323 | 998 | js | JavaScript | dist/index.js | exodevhub/exodev-components | aa002fce80d7da6ca1020f292143a3c63519b39d | [
"MIT"
] | null | null | null | dist/index.js | exodevhub/exodev-components | aa002fce80d7da6ca1020f292143a3c63519b39d | [
"MIT"
] | null | null | null | dist/index.js | exodevhub/exodev-components | aa002fce80d7da6ca1020f292143a3c63519b39d | [
"MIT"
] | null | null | null | "use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var RowLayout1Centered_1 = __importDefault(require("./components/Grids/RowLayout1Centered"));
exports.RowLayout1Centered = RowLayout1Centered_1.default;
var RowLayout3And3And3And3_1 = __importDefault(require("./components/Grids/RowLayout3And3And3And3"));
exports.RowLayout3And3And3And3 = RowLayout3And3And3And3_1.default;
var RowLayout4And4And4_1 = __importDefault(require("./components/Grids/RowLayout4And4And4"));
exports.RowLayout4And4And4 = RowLayout4And4And4_1.default;
var RowLayout4And8_1 = __importDefault(require("./components/Grids/RowLayout4And8"));
exports.RowLayout4And8 = RowLayout4And8_1.default;
var RowLayout6And6_1 = __importDefault(require("./components/Grids/RowLayout6And6"));
exports.RowLayout6And6 = RowLayout6And6_1.default;
//# sourceMappingURL=index.js.map | 62.375 | 101 | 0.803607 |
c6147e389b2dd74ac9d80fec7479833991f2d1ec | 1,261 | js | JavaScript | src/library/stream.js | ArtOfCode-/nails | 1ba9158742ba72bc727ad5c881035ee9d99b700c | [
"MIT"
] | 9 | 2017-03-22T00:40:27.000Z | 2018-11-12T23:38:27.000Z | src/library/stream.js | ArtOfCode-/nails | 1ba9158742ba72bc727ad5c881035ee9d99b700c | [
"MIT"
] | 220 | 2017-03-23T22:44:15.000Z | 2018-05-04T19:39:41.000Z | src/library/stream.js | ArtOfCode-/nails | 1ba9158742ba72bc727ad5c881035ee9d99b700c | [
"MIT"
] | 3 | 2017-03-23T23:37:35.000Z | 2017-04-22T14:45:28.000Z | 'use strict';
const fs = require('fs');
const chalk = require('chalk');
const debug = require('./util')('stream');
/**
* @function stream
* @description
* Stream something to the response.
* This function is also a writable stream, so streams
* can be piped into it:
* `myStream.pipe(this.stream)`
* @param {Object} options The options
* @param {string} [options.path] The path to a file to stream into the response
* @memberof Context
* @instance
**/
module.exports = res => {
const stream = arg => {
if (arg.path) {
const { path, encoding = 'utf-8', options = {} } = arg;
const fileStream = fs.createReadStream(path, Object.assign({
encoding,
}, options));
fileStream.pipe(stream);
return Promise.resolve(fileStream);
}
};
const keys = Object.keys(require('events').prototype).concat(Object.keys(require('stream').Writable.prototype));
for (const key of keys) {
if (key[0] === '_' || ['domain'].includes(key) || !(key in res)) {
continue;
}
/* istanbul ignore else */
if (typeof res[key] === 'function') {
stream[key] = res[key].bind(res);
} else {
debug(chalk.bold(key), 'key not processed in context. Value:', res[key]);
}
}
return stream;
};
| 27.413043 | 114 | 0.614592 |
c614eb03ea1e26f08e436e5c41c616fbd2a7b899 | 20,354 | js | JavaScript | public/static/lib/modules/ml.js | 1826888766/think-admin | 2119f77ab8202fba1ce9ccdd0a7db78bceb882ae | [
"Apache-2.0"
] | null | null | null | public/static/lib/modules/ml.js | 1826888766/think-admin | 2119f77ab8202fba1ce9ccdd0a7db78bceb882ae | [
"Apache-2.0"
] | null | null | null | public/static/lib/modules/ml.js | 1826888766/think-admin | 2119f77ab8202fba1ce9ccdd0a7db78bceb882ae | [
"Apache-2.0"
] | null | null | null | function eq(a, b) {
return a == b;
}
layui.define([
'jquery',
'form',
'table',
'laydate',
'laytpl',
'upload',
], function (exports) {
'use strict';
const $ = layui.$;
const table = layui.table;
const laydate = layui.laydate;
const form = layui.form;
const laytpl = layui.laytpl;
const upload = layui.upload;
var searchTpl = " <style>\n" +
" .page-toolbar {\n" +
" height: auto;\n" +
" }\n" +
"\n" +
" .page-filter {\n" +
" height: auto;\n" +
" }\n" +
" </style>\n" +
" <div class=\"layui-form-item\">\n" +
" {{# for (var key in d.field){\n" +
" var item = d.field[key];\n" +
" }}\n" +
" <div class=\"layui-inline\">\n" +
" {{# if(item.showLabel!==false){ }}\n" +
" <label class=\"layui-form-label\" style=\" min-width: 60px;width: auto;\">{{item.title}}</label>\n" +
" {{# } }}\n" +
" <div class=\"layui-input-inline\" style=\"width: {{d.width?d.width:180}}px;\">\n" +
" {{# if (item.type == 'select') { }}\n" +
" <select data-key=\"{{key}}\" {{item.search ?'lay-search':''}}\n" +
" lay-filter=\"mlSearchSelect\"\n" +
" name=\"{{item.field}}\">\n" +
" {{# for(var i in item.options) {\n" +
" var option = item.options[i];\n" +
" }}\n" +
" <option value=\"{{option.value}}\" {{option.value==item.value?'selected':''}}>{{option.name}}</option>\n" +
" {{# } }}\n" +
" </select>\n" +
" {{# } else if(item.type == 'date') { }}\n" +
" <input type=\"text\" data-key=\"{{key}}\"\n" +
" name=\"{{item.field}}\"\n" +
" autocomplete=\"off\"\n" +
" value=\"{{item.value||''}}\"\n" +
" placeholder=\"{{item.placeholder||('请选择'+item.title)}}\"\n" +
" class=\"layui-input date{{item.range?'-range':''}}\">\n" +
" {{# } else { }}\n" +
" <input data-key=\"{{key}}\"\n" +
" value=\"{{item.value||''}}\"\n" +
" autocomplete=\"off\"\n" +
" type=\"text\" name=\"{{item.field}}\"\n" +
" placeholder=\"{{item.placeholder||('请输入'+item.title)}}\"\n" +
" class=\"layui-input\">\n" +
" {{# } }}\n" +
" </div>\n" +
" </div>\n" +
" {{# } }}\n" +
"\n" +
" <div class=\"layui-inline\">\n" +
" <button type=\"submit\" lay-submit lay-filter=\"mlSearch\"\n" +
" class=\"layui-btn layui-btn-normal\">\n" +
" 搜索\n" +
" </button>\n" +
" <button type=\"reset\" onclick=\"ml.reload()\"\n" +
" class=\"layui-btn layui-btn-primary \">\n" +
" 重置\n" +
" </button>\n" +
" </div>\n" +
" </div>";
var ml = function () {
this.v = "0.0.1";
this.config = {}
}
ml.prototype.on = function (e, t) {
return layui.onevent.call(e, t)
}
ml.prototype.success = function () {
}
ml.prototype.render = function (config) {
this.config = initConfig(config)
renderSearchForm(this.config.search)
renderTable(this.config.table)
this.searchListen();
this.tableListen();
this.success()
}
ml.prototype.search = null
ml.prototype.reload = function (config) {
config && (this.config = initConfig(config));
reloadSearchForm(this.config.search)
reloadTable(this.config.table)
}
ml.prototype.reloadTable = function (config) {
config && (this.config = initConfig(config));
reloadTable(this.config.table)
}
ml.prototype.reloadSearch = function (config) {
config && (this.config = initConfig(config));
reloadSearchForm(this.config.search)
}
function createBtns(btns) {
var html = [];
$.each(btns, function () {
var btn = "<span onclick=" + this.click + " class='layui-btn layui-btn-xs " + (this.class || 'layui-btn-normal') + " '>" + this.title + "</span>"
html.push(btn)
})
return "<div><div class='layui-btn-group '>" + html.join("") + "</div></div>"
}
function createSwitch(row) {
var value = row.default ? row.default.split("|") : [];
var valueDefault = 0;
var valueChecked = 1;
if (value.length === 2) {
valueDefault = value[0]
valueChecked = value[1]
} else if (value.length === 1) {
valueChecked = value[0];
}
var text = row.text || '是|否'
return "<div><input data-id='{{d.id}}' data-url='" + row.url + "' " +
'confirm="'+row.confirm + '"' + "name='"+row.field+"'" +
"{{eq(d." + row.field + "," + valueChecked + ")?'checked':' '}}" +
" lay-filter='mlSwitch' type='checkbox' value='" + valueDefault + "|" + valueChecked + "' lay-skin='switch' lay-text='" + text + "'></div>";
}
function getUpdateField(config) {
var update = [];
$.each(config, function () {
if (this.update !== false && this.field && this.field !== 'field') {
update.push(this.field)
}
})
return update;
}
function initConfig(config) {
var filed = []
$.each(config.cols[0], function () {
if (this.search) {
filed.push(this)
}
if (this.field == "field") {
this['templet'] = this['templet'] || createBtns(this.btns)
}
if (this.type == "switch") {
this['templet'] = this['templet'] || createSwitch(this)
}
})
var new_config = {
table: $.extend({
elem: "#mlTableData",
page: true,
url: GetUrlRelativePath()
}, config),
search: {
elem: config.search_elem || "#mlTableDataSearch",
field: filed
},
update: {
field: config.update_field || getUpdateField(config.cols[0]),
url: config.update_url || "edit",
primary: config.update_primary || "id"
}
};
return new_config;
}
function GetUrlRelativePath() {
var url = document.location.toString();
var arrUrl = url.split("//");
var start = arrUrl[1].indexOf("/");
var relUrl = arrUrl[1].substring(start);
if (relUrl.indexOf("?") != -1) {
relUrl = relUrl.split("?")[0];
}
return relUrl;
}
function renderSearchForm(config) {
var html = laytpl(searchTpl).render(config)
$(config.elem).html(html)
form.render()
}
function reloadSearchForm(config) {
var formJson = {};
// 转换表单为json
var formArray = dom.serializeArray();
$.each(formArray, function () {
if (formJson[this.name]) {
if (!formJson[this.name].push) {
formJson[this.name] = [formJson[this.name]];
}
formJson[this.name].push(this.value || '');
} else {
formJson[this.name] = this.value || '';
}
});
if (config.field) {
$.each(config.field, function () {
if (formJson.hasOwnProperty(this.field) && formJson[this.field]) {
if (!this.value) {
this['value'] = formJson[this.field]
}
}
});
}
renderSearchForm(config)
}
function renderTable(config) {
ml.tableInstance = table.render(config)
}
function reloadTable(config) {
ml.tableInstance.reload(config)
}
// 渲染多个上传组件
ml.prototype.renderUploadList = function (elem) {
var uploadConfig = {
elem: elem,
choose: function (obj) {
console.log(obj)
var item = this.item;
var data = $(item).data()
// 是否预览
if (data.preview) {
var demoListView = $('#' + data.name + 'List')
var files; //将每次选择的文件追加到文件队列
if (this.multiple) {
files = this.files = obj.pushFile()
} else {
this.files = [];
files = this.files = obj.pushFile();
demoListView.html("")
}
if (this.accept !== 'images') {
//读取本地文件
obj.preview(function (index, file, result) {
var tr = $(['<tr id="upload-' + index + '">'
, '<td>' + file.name + '</td>'
, '<td>' + (file.size / 1024).toFixed(1) + 'kb</td>'
, '<td>等待上传</td>'
, '<td>'
, '<button type="button" class="layui-btn layui-btn-xs ml-upload-reload layui-hide">重传</button>'
, '<button type="button" class="layui-btn layui-btn-xs layui-btn-danger ml-upload-delete">删除</button>'
, '</td>'
, '</tr>'].join(''));
//单个重传
tr.find('.ml-upload-reload').on('click', function () {
tr.remove();
obj.upload(index, file);
});
//删除
tr.find('.ml-upload-delete').on('click', function () {
delete files[index]; //删除对应的文件
tr.remove();
$(item).next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
});
demoListView.append(tr);
});
} else {
obj.preview(function (index, file, result) {
$('#demo1').attr('src', result); //图片链接(base64)
var tr = $([
'<tr id="upload-' + index + '">'
, '<td>' + '<img src=' + result + '> ' + file.name + '</td>'
, '<td>' + (file.size / 1024).toFixed(1) + 'kb</td>'
, '<td>等待上传</td>'
, '<td>'
, '<button type="button" class="layui-btn layui-btn-xs ml-upload-reload layui-hide">重传</button>'
, '<button type="button" class="layui-btn layui-btn-xs layui-btn-danger ml-upload-delete">删除</button>'
, '</td>'
, '</tr>'].join(''));
//单个重传
tr.find('.ml-upload-reload').on('click', function () {
tr.remove();
obj.upload(index, file);
});
//删除
tr.find('.ml-upload-delete').on('click', function () {
delete files[index]; //删除对应的文件
tr.remove();
$(item).next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
});
demoListView.append(tr);
});
}
}
},
url: "/console/upload/index?full_path=yes"
, done: function (res, index, upload) {
//获取当前触发上传的元素,一般用于 elem 绑定 class 的情况,注意:此乃 layui 2.1.0 新增
var item = this.item;
console.log(this);
var data = $(item).data()
var demoListView = $('#' + data.name + 'List')
var domInput = $("input[name='" + data.name + "']");
var value = domInput.val().split(',')
if (res.code = 1) { //上传成功
// 是否多图
if (this.multiple) {
value[index] = res.data.file;
} else {
value = [res.data.file];
}
domInput.val(value.join(','));
if ($(item).hasClass('layui-btn-avatar')){
$(item).find('img').attr('src',value.join(',')).removeClass('layui-hide')
$(item).find('.layui-avatar-bg').addClass('layui-hide')
return ;
}
if (data.preview) {
if (data.type == 'file') {
var tr = demoListView.find('tr#upload-' + index)
, tds = tr.children();
tds.eq(2).html('<span style="color: #5FB878;">上传成功</span>');
tds.eq(3).html(''); //清空操作
return delete this.files[index]; //删除文件队列已经上传成功的文件
}
} else {
var tr = demoListView.find('tr#upload-' + index)
, tds = tr.children();
tds.eq(2).html('<span style="color: #5FB878;">上传成功</span>');
tds.eq(3).html(''); //清空操作
return delete this.files[index]; //删除文件队列已经上传成功的文件
}
}
this.error(index, upload);
}, error: function (index, upload) {
var item = this.item;
var data = $(item).data()
var demoListView = $('#' + data.name + 'List')
setTimeout(function () {
var tr = demoListView.find('tr#upload-' + index)
, tds = tr.children();
tds.eq(2).html('<span style="color: #FF5722;">上传失败</span>');
tds.eq(3).find('.ml-upload-reload').removeClass('layui-hide'); //显示重传
})
}
}
$(elem).each(function () {
uploadConfig.elem = this
var layData = $(this).attr('lay-data');
layData = new Function("return " + layData)();
var newUploadConfig = $.extend(layData || {}, uploadConfig)
upload.render(newUploadConfig)
})
}
ml.prototype.searchListen = function () {
var searchDom = $(this.config.search.elem)
var that = this;
form.on("submit(mlSearch)", function (obj) {
typeof that.search == "function" && that.search(obj);
reloadTable({
where: obj.field,
page: {
curr: 1
}
})
return false;
})
form.on('select(mlSearchSelect)', selectChange)
searchDom.on("change", "input", inputChange)
function inputChange() {
var key = $(this).data('key');
var field = that.config.search.field[key]
var data = {
type: "input",
value: $(this).val(),
name: field.name,
field: field
}
that.config.search.field[key].value = data.value
typeof that.config.search.change == "function" && that.config.search.change(data, that.config.search);
}
function selectChange(obj) {
var key = $(obj.elem).data('key');
var field = that.config.search.field[key]
var data = {
type: "select",
value: obj.value,
name: field.name,
field: field
}
that.config.search.field[key].value = obj.value
typeof that.config.search.change == "function" && that.config.search.change(data, that.config.search);
}
$(".date").each(function () {
laydate.render({
elem: this, done: dateChange,
mark: {},
isInitValue: false,
})
})
$(".date-range").each(function () {
laydate.render({
elem: this,
range: true,
mark: {},
isInitValue: false,
done: dateChange
})
})
function dateChange(value, date, endDate) {
var elem = $(this)[0].elem;
var key = $(elem).data('key');
var field = that.config.search.field[key]
var data = {
type: "date",
value: value,
name: field.name,
field: field
}
that.config.search.field[key].value = value
typeof that.config.search.change == "function" && that.config.search.change(data, that.config.search);
}
}
ml.prototype.setUpdateParam = function (update) {
var data = {};
$.each(this.config.update.field, function () {
data[this] = update[this]
})
return data;
}
ml.prototype.tableListen = function () {
var that = this;
form.on("switch(mlSwitch)", function (obj) {
if (typeof that.switch == "function") {
return that.switch(obj);
}
var url = $(this).data('url')
if (url && url !== "undefined") {
var dom = $(this),field=dom.attr('name'), status = 0, func = function () {
var data = {
edit_status:1
};
data['field'] = field;
data['val'] = status;
url = setUrlParams(url,{id:dom.data('id')})
$.get(url, data, function (res) {
layui.layer.msg(res.msg);
if (res.code != 0) {
dom.trigger('click');
form.render('checkbox');
}
});
};
if (this.checked) {
status = 1;
}
var confirm = $(this).attr('confirm');
if (confirm === undefined) {
func();
} else {
layer.confirm(confirm === 'undefined' ? '你确定要执行操作吗?' : confirm, {
title: false,
closeBtn: 0
}, function (index) {
func();
}, function () {
dom.trigger('click');
form.render('checkbox');
});
}
}
return false;
})
table.on("edit(myTable)", function (obj) {
var data = obj.data;
data[obj.field] = obj.value;
var params = that.setUpdateParam(data)
params[that.config.update.primary] = data[that.config.update.primary];
if (!params[that.config.update.primary]) {
return layer.msg('主键不存在');
}
$.post(that.config.update.url, params, function (res) {
layer.msg(res.msg);
if (res.code == 0) {
ml.tableInstance.reload()
}
})
})
}
ml = new ml();
exports("ml", ml)
});
| 38.622391 | 157 | 0.401887 |
c614f4740f4b9ea6955033d4186c94c5552d0394 | 1,759 | js | JavaScript | src/Fixtures/Animation/TheDual.js | disc-in/UltimateApp | b68aa34852768026e8bd909468c9fdc0404992c5 | [
"MIT"
] | 12 | 2020-12-03T18:46:01.000Z | 2022-01-28T22:46:24.000Z | src/Fixtures/Animation/TheDual.js | UltimateApp/UltimateApp | b68aa34852768026e8bd909468c9fdc0404992c5 | [
"MIT"
] | 101 | 2020-03-21T15:14:03.000Z | 2020-10-13T13:58:28.000Z | src/Fixtures/Animation/TheDual.js | UltimateApp/UltimateApp | b68aa34852768026e8bd909468c9fdc0404992c5 | [
"MIT"
] | 3 | 2020-03-20T19:54:56.000Z | 2020-04-27T09:40:27.000Z | const theDual = {
positions: [
[
[[0.4509389641848342, 0.416666616514477]],
[[0.36323952796425907, 0.3866817198252902]],
[[0.40740251538178707, 0.7729639850467915]],
[[0.35091749803492756, 0.7119065853853922]],
[
[0.4463033216678828, 0.7622957292890337],
[0.6231832101032431, 0.5148554759717571],
],
],
[
[[0.5759084505793822, 0.20894730444540233]],
[[0.6364023678483656, 0.116247897148193]],
null,
null,
[[0.67780966608714, 0.11888902945550185]],
],
[
[[0.4175832078483331, 0.4060501532178891]],
[[0.3743784125448357, 0.38736567768571795]],
null,
null,
[[0.4324788318468359, 0.7757886604601352]],
],
[
[[0.5925557316956753, 0.5041355162566931]],
[[0.6246859592761768, 0.5173002536065576]],
null,
null,
[[0.6611775536911505, 0.5371523644085404]],
],
[
[[0.45734761870747526, 0.5059480753899176]],
[[0.38426194644277184, 0.46691110970291616]],
null,
null,
[
[0.4231861548376981, 0.7757886604601352],
[0.5366123934304681, 0.39107242433020784],
],
],
[
[[0.284221413693579, 0.1647726894574399]],
[[0.1954592584120196, 0.07710734653885148]],
null,
null,
[[0.21485791174119043, 0.09118395563518768]],
],
[
[[0.4157822282827874, 0.7722152992533106]],
[[0.3426760838087744, 0.7108298119753111]],
[[0.41109515304867916, 0.4530213841013073]],
[[0.32870070045367455, 0.4061537027386837]],
[[0.43967364516810253, 0.7722671271160262]],
],
],
ids: ['defense', 'offense', 'offense', 'defense', 'disc'],
texts: [1, 1, 2, 2, 1],
};
export default theDual;
| 27.484375 | 60 | 0.599773 |
c615d384eded0b7133f6426528ee8d148b683ad4 | 1,242 | js | JavaScript | public/js/pvr_map_google.js | grecocomer/proygre | 7f054dbabc5efdfcbd22a4f5283c5a97c5825fed | [
"MIT"
] | null | null | null | public/js/pvr_map_google.js | grecocomer/proygre | 7f054dbabc5efdfcbd22a4f5283c5a97c5825fed | [
"MIT"
] | null | null | null | public/js/pvr_map_google.js | grecocomer/proygre | 7f054dbabc5efdfcbd22a4f5283c5a97c5825fed | [
"MIT"
] | 2 | 2020-02-28T14:42:22.000Z | 2021-09-05T15:15:40.000Z | "use strict";
var full_screen = function () {
"use strict";
var a = [ {
featureType: "all",
elementType: "all",
stylers : [ {
invert_lightness: true
}, {
saturation: 15
}, {
lightness: 15
}, {
gamma: .8
}, {
hue: "#4e54c8"
} ]
}, {
featureType: "water",
stylers : [ {
visibility: "on"
}, {
color: "#293036"
} ]
} ];
function t() {
var t = {
zoom : 13,
center : new google.maps.LatLng(12.970, 77.600),
mapTypeId : google.maps.MapTypeId.ROADMAP,
disableDefaultUI: true
};
e = new google.maps.Map(document.getElementById("google-map"), t);
e.setOptions({
styles: a
});
}
var e;
google.maps.event.addDomListener(window, "load", t);
$(window).on("resize", function () {
google.maps.event.trigger(e, "resize")
});
};
var map = function () {
"use strict";
return {
init: function () {
full_screen();
}
}
}();
$(function () {
map.init();
}); | 21.050847 | 74 | 0.419485 |