1import{V as f,ao as u,c as l,o as d,E as o,a as h,g as p,t as c}from"./Dfl0qPmI.js";import{s as v}from"./Cwbl0bnP.js";import"./QjYCpqYP.js";var b=` 2 .p-knob-range { 3 fill: none; 4 transition: stroke 0.1s ease-in; 5 } 6 7 .p-knob-value { 8 animation-name: p-knob-dash-frame; 9 animation-fill-mode: forwards; 10 fill: none; 11 } 12 13 .p-knob-text { 14 font-size: 1.3rem; 15 text-align: center; 16 } 17 18 .p-knob svg { 19 border-radius: 50%; 20 outline-color: transparent; 21 transition: 22 background dt('knob.transition.duration'), 23 color dt('knob.transition.duration'), 24 outline-color dt('knob.transition.duration'), 25 box-shadow dt('knob.transition.duration'); 26 } 27 28 .p-knob svg:focus-visible { 29 box-shadow: dt('knob.focus.ring.shadow'); 30 outline: dt('knob.focus.ring.width') dt('knob.focus.ring.style') dt('knob.focus.ring.color'); 31 outline-offset: dt('knob.focus.ring.offset'); 32 } 33 34 @keyframes p-knob-dash-frame { 35 100% { 36 stroke-dashoffset: 0; 37 } 38 } 39`,g={root:function(t){var n=t.instance,i=t.props;return["p-knob p-component",{"p-disabled":i.disabled,"p-invalid":n.$invalid}]},range:"p-knob-range",value:"p-knob-value",text:"p-knob-text"},y=f.extend({name:"knob",style:b,classes:g}),w={name:"BaseKnob",extends:v,props:{size:{type:Number,default:100},readonly:{type:Boolean,default:!1},step:{type:Number,default:1},min:{type:Number,default:0},max:{type:Number,default:100},valueColor:{type:String,default:function(){return u("knob.value.background").variable}},rangeColor:{type:String,default:function(){return u("knob.range.background").variable}},textColor:{type:String,default:function(){return u("knob.text.color").variable}},strokeWidth:{type:Number,default:14},showValue:{type:Boolean,default:!0},valueTemplate:{type:[String,Function],default:"{value}"},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:y,provide:function(){return{$pcKnob:this,$parentInstance:this}}},r=3.14159265358979,k={name:"Knob",extends:w,inheritAttrs:!1,emits:["change"],data:function(){return{radius:40,midX:50,midY:50,minRadians:4*r/3,maxRadians:-3.14159265358979/3}},methods:{updateValueByOffset:function(t,n){var i=t-this.size/2,s=this.size/2-n,a=Math.atan2(s,i),m=-3.14159265358979/2-r/6;this.updateModel(a,m)},updateModel:function(t,n){var i;if(t>this.maxRadians)i=this.mapRange(t,this.minRadians,this.maxRadians,this.min,this.max);else if(t<n)i=this.mapRange(t+2*r,this.minRadians,this.maxRadians,this.min,this.max);else return;var s=Math.round((i-this.min)/this.step)*this.step+this.min;this.writeValue(s),this.$emit("change",s)},updateModelValue:function(t){t>this.max?this.writeValue(this.max):t<this.min?this.writeValue(this.min):this.writeValue(t)},mapRange:function(t,n,i,s,a){return(t-n)*(a-s)/(i-n)+s},onClick:function(t){!this.disabled&&!this.readonly&&this.updateValueByOffset(t.offsetX,t.offsetY)},onBlur:function(t){var n,i;(n=(i=this.formField).onBlur)===null||n===void 0||n.call(i,t)},onMouseDown:function(t){!this.disabled&&!this.readonly&&(window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("mouseup",this.onMouseUp),t.preventDefault())},onMouseUp:function(t){!this.disabled&&!this.readonly&&(window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("mouseup",this.onMouseUp),t.preventDefault())},onTouchStart:function(t){!this.disabled&&!this.readonly&&(window.addEventListener("touchmove",this.onTouchMove),window.addEventListener("touchend",this.onTouchEnd),t.preventDefault())},onTouchEnd:function(t){!this.disabled&&!this.readonly&&(window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("touchend",this.onTouchEnd),t.preventDefault())},onMouseMove:function(t){!this.disabled&&!this.readonly&&(this.updateValueByOffset(t.offsetX,t.offsetY),t.preventDefault())},onTouchMove:function(t){if(!this.disabled&&!this.readonly&&t.touches.length==1){var n=this.$el.getBoundingClientRect(),i=t.targetTouches.item(0),s=i.
39clientX-n.left,a=i.clientY-n.top;this.updateValueByOffset(s,a)}},onKeyDown:function(t){if(!this.disabled&&!this.readonly)switch(t.code){case"ArrowRight":case"ArrowUp":{t.preventDefault(),this.updateModelValue(this.d_value+this.step);break}case"ArrowLeft":case"ArrowDown":{t.preventDefault(),this.updateModelValue(this.d_value-this.step);break}case"Home":{t.preventDefault(),this.writeValue(this.min);break}case"End":{t.preventDefault(),this.writeValue(this.max);break}case"PageUp":{t.preventDefault(),this.updateModelValue(this.d_value+10);break}case"PageDown":{t.preventDefault(),this.updateModelValue(this.d_value-10);break}}}},computed:{rangePath:function(){return"M ".concat(this.minX," ").concat(this.minY," A ").concat(this.radius," ").concat(this.radius," 0 1 1 ").concat(this.maxX," ").concat(this.maxY)},valuePath:function(){return"M ".concat(this.zeroX," ").concat(this.zeroY," A ").concat(this.radius," ").concat(this.radius," 0 ").concat(this.largeArc," ").concat(this.sweep," ").concat(this.valueX," ").concat(this.valueY)},zeroRadians:function(){return this.min>0&&this.max>0?this.mapRange(this.min,this.min,this.max,this.minRadians,this.maxRadians):this.mapRange(0,this.min,this.max,this.minRadians,this.maxRadians)},valueRadians:function(){return this.mapRange(this.d_value,this.min,this.max,this.minRadians,this.maxRadians)},minX:function(){return this.midX+Math.cos(this.minRadians)*this.radius},minY:function(){return this.midY-Math.sin(this.minRadians)*this.radius},maxX:function(){return this.midX+Math.cos(this.maxRadians)*this.radius},maxY:function(){return this.midY-Math.sin(this.maxRadians)*this.radius},zeroX:function(){return this.midX+Math.cos(this.zeroRadians)*this.radius},zeroY:function(){return this.midY-Math.sin(this.zeroRadians)*this.radius},valueX:function(){return this.midX+Math.cos(this.valueRadians)*this.radius},valueY:function(){return this.midY-Math.sin(this.valueRadians)*this.radius},largeArc:function(){return Math.abs(this.zeroRadians-this.valueRadians)<r?0:1},sweep:function(){return this.valueRadians>this.zeroRadians?0:1},valueToDisplay:function(){return typeof this.valueTemplate=="string"?this.valueTemplate.replace(/{value}/g,this.d_value):this.valueTemplate(this.d_value)}}},M=["width","height","tabindex","aria-valuemin","aria-valuemax","aria-valuenow","aria-labelledby","aria-label"],R=["d","stroke-width","stroke"],x=["d","stroke-width","stroke"],D=["fill"];function T(e,t,n,i,s,a){return d(),l("div",o({class:e.cx("root")},e.ptmi("root")),[(d(),l("svg",o({viewBox:"0 0 100 100",role:"slider",width:e.size,height:e.size,tabindex:e.readonly||e.disabled?-1:e.tabindex,"aria-valuemin":e.min,"aria-valuemax":e.max,"aria-valuenow":e.d_value,"aria-labelledby":e.ariaLabelledby,"aria-label":e.ariaLabel,onClick:t[0]||(t[0]=function(){return a.onClick&&a.onClick.apply(a,arguments)}),onBlur:t[1]||(t[1]=function(){return a.onBlur&&a.onBlur.apply(a,arguments)}),onKeydown:t[2]||(t[2]=function(){return a.onKeyDown&&a.onKeyDown.apply(a,arguments)}),onMousedown:t[3]||(t[3]=function(){return a.onMouseDown&&a.onMouseDown.apply(a,arguments)}),onMouseup:t[4]||(t[4]=function(){return a.onMouseUp&&a.onMouseUp.apply(a,arguments)}),onTouchstart:t[5]||(t[5]=function(){return a.onTouchStart&&a.onTouchStart.apply(a,arguments)}),onTouchend:t[6]||(t[6]=function(){return a.onTouchEnd&&a.onTouchEnd.apply(a,arguments)})},e.ptm("svg")),[h("path",o({d:a.rangePath,"stroke-width":e.strokeWidth,stroke:e.rangeColor,class:e.cx("range")},e.ptm("range")),null,16,R),h("path",o({d:a.valuePath,"stroke-width":e.strokeWidth,stroke:e.valueColor,class:e.cx("value")},e.ptm("value")),null,16,x),e.showValue?(d(),l("text",o({key:0,x:50,y:57,"text-anchor":"middle",fill:e.textColor,class:e.cx("text")},e.ptm("text")),c(a.valueToDisplay),17,D)):p("",!0)],16,M))],16)}k.render=T;export{k as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.