1import{g as t}from"./randomUtils.5ebaf0f9.js";import{n as s}from"./vueComponentNormalizer.fc2fb13f.js";var i=function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",{staticClass:"dice-roller"},[i("div",{staticClass:"row"},[i("div",{staticClass:"col-lg-7"},[i("div",{staticClass:"card shadow-sm"},[i("div",{staticClass:"card-body"},[i("form",{on:{submit:function(s){return s.preventDefault(),t.rollDice(s)}}},[i("div",{staticClass:"form-group"},[i("label",{attrs:{for:"dice-count"}},[t._v("Dice per roll")]),t._v(" "),i("input",{directives:[{name:"model",rawName:"v-model.number",value:t.diceCount,expression:"diceCount",modifiers:{number:!0}}],staticClass:"form-control",attrs:{id:"dice-count",type:"number",min:"1",max:"100",required:""},domProps:{value:t.diceCount},on:{input:function(s){s.target.composing||(t.diceCount=t._n(s.target.value))},blur:function(s){return t.$forceUpdate()}}})]),t._v(" "),i("div",{staticClass:"form-group"},[i("label",{attrs:{for:"dice-sides"}},[t._v("Sides per die")]),t._v(" "),i("input",{directives:[{name:"model",rawName:"v-model.number",value:t.sides,expression:"sides",modifiers:{number:!0}}],staticClass:"form-control",attrs:{id:"dice-sides",type:"number",min:"2",max:"1000",required:""},domProps:{value:t.sides},on:{input:function(s){s.target.composing||(t.sides=t._n(s.target.value))},blur:function(s){return t.$forceUpdate()}}})]),t._v(" "),i("div",{staticClass:"form-group"},[i("label",{attrs:{for:"rolls-count"}},[t._v("Number of rolls")]),t._v(" "),i("input",{directives:[{name:"model",rawName:"v-model.number",value:t.rolls,expression:"rolls",modifiers:{number:!0}}],staticClass:"form-control",attrs:{id:"rolls-count",type:"number",min:"1",max:"100",required:""},domProps:{value:t.rolls},on:{input:function(s){s.target.composing||(t.rolls=t._n(s.target.value))},blur:function(s){return t.$forceUpdate()}}})]),t._v(" "),i("div",{staticClass:"quick-dice mb-3"},[i("span",{staticClass:"text-muted small d-block mb-2"},[t._v("Quick dice")]),t._v(" "),t._l(t.presets,function(s){return i("button",{key:s,staticClass:"btn btn-outline-primary btn-sm mr-2 mb-2",attrs:{type:"button"},on:{click:function(i){return t.applyPreset(s)}}},[t._v("d"+t._s(s))])})],2),t._v(" "),i("div",{staticClass:"d-flex flex-wrap"},[i("button",{staticClass:"btn btn-primary mr-2 mb-2",attrs:{type:"submit",disabled:t.rolling}},[i("i",{staticClass:"fa fa-dice"}),t._v(" "+t._s(t.rolling?"Rolling...":"Roll Dice")+"\n ")]),t._v(" "),i("button",{staticClass:"btn btn-secondary mb-2",attrs:{type:"button",disabled:!t.history.length},on:{click:t.clearHistory}},[t._v("Clear History")])])])])])]),t._v(" "),i("div",{staticClass:"col-lg-5 mt-3 mt-lg-0"},[i("div",{staticClass:"card stats-card"},[i("div",{staticClass:"card-body"},[i("h6",{staticClass:"text-uppercase text-muted"},[t._v("Live Stats")]),t._v(" "),i("div",{staticClass:"stats-grid"},[i("div",{staticClass:"stat"},[i("span",{staticClass:"stat-label"},[t._v("Sessions")]),t._v(" "),i("span",{staticClass:"stat-value"},[t._v(t._s(t.history.length))])]),t._v(" "),t.latestSession?i("div",{staticClass:"stat"},[i("span",{staticClass:"stat-label"},[t._v("Session Total")]),t._v(" "),i("span",{staticClass:"stat-value"},[t._v(t._s(t.latestSession.totals.sum))])]):t._e(),t._v(" "),t.latestSession?i("div",{staticClass:"stat"},[i("span",{staticClass:"stat-label"},[t._v("Avg / Roll")]),t._v(" "),i("span",{staticClass:"stat-value"},[t._v(t._s(t.latestSession.totals.avg.toFixed(2)))])]):t._e(),t._v(" "),t.latestSession?i("div",{staticClass:"stat"},[i("span",{staticClass:"stat-label"},[t._v("Range")]),t._v(" "),i("span",{staticClass:"stat-value"},[t._v(t._s(t.latestSession.totals.min)+"â"+t._s(t.latestSession.totals.max))])]):t._e()]),t._v(" "),t.latestSession?i("div",{staticClass:"text-muted small mt-3"},[t._v("\n Last roll: "+t._s(t.latestSession.diceCount)+"d"+t._s(t.latestSession.sides)+" · "+t._s(t.latestSession.rolls)+" roll"+t._s(t.latestSession.rolls>1?"s":"")+" · "+t._s(t.formatTimestamp(t.latestSession.timestamp))+"\n ")]):t._e()])])])]),t._v(" "),t.latestSession?i("div",{staticClass:"row mt-4"},[i("div",{staticClass:"col-md-12"},[i("div",{staticClass:"card result-card"},[i("div",{staticClass:"card-body"},[i("div",{staticClass:"d-flex justify-content-between align-items-center mb-3"},[i("h5",{staticClass:"mb-0"},[t._v("Latest Roll")]),t._v(" "),i("div",{staticClass:"btn-group"},[i("button",{staticClass:"btn btn-outline-primary btn-sm",on:{click:function(s){return t.copySession(t.latestSession)}}},[i("i",{staticClass:"fa fa-copy"}),t._v(" Copy")]),t._v(" "),i("button",{staticClass:"btn btn-outline-secondary btn-sm",on:{click:function(s){return t.downloadSession(t.latestSession)}}},[i("i",{staticClass:"fa fa-download"}),t._v(" Download")])])]),t._v(" "),i("div",{staticClass:"roll-list",class:{rolling:t.rolling}},t._l(t.latestSession.results,function(s,a){return i("div",{key:`latest-${a}`,staticClass:"roll-row"},[i("div",{staticClass:"roll-index"},[t._v("#"+t._s(a+1))]),t._v(" "),i("div",{staticClass:"dice-row"},t._l(s.values,function(s,e){return i("button",{key:`die-${a}-${e}`,staticClass:"die",on:{click:function(i){return t.copyDie(s)}}},[t._v(t._s(s))])}),0),t._v(" "),i("div",{staticClass:"roll-total"},[t._v("Total "+t._s(s.total))])])}),0)])])])]):t._e(),t._v(" "),t.history.length?i("div",{staticClass:"row mt-4"},[i("div",{staticClass:"col-md-12"},[i("h5",{staticClass:"mb-3"},[t._v("Roll History")]),t._v(" "),i("div",{staticClass:"history-grid"},t._l(t.history,function(s){return i("div",{key:s.id,staticClass:"history-card"},[i("div",{staticClass:"history-header"},[i("div",[i("strong",[t._v(t._s(s.diceCount)+"d"+t._s(s.sides))]),t._v(" "),i("span",{staticClass:"text-muted small"},[t._v(" · "+t._s(s.rolls)+" roll"+t._s(s.rolls>1?"s":""))])]),t._v(" "),i("div",{staticClass:"text-muted small"},[t._v(t._s(t.formatTimestamp(s.timestamp)))])]),t._v(" "),i("div",{staticClass:"history-stats"},[i("span",[t._v("Total "+t._s(s.totals.sum))]),t._v(" "),i("span",[t._v("Avg "+t._s(s.totals.avg.toFixed(2)))]),t._v(" "),i("span",[t._v("Min "+t._s(s.totals.min))]),t._v(" "),i("span",[t._v("Max "+t._s(s.totals.max))])]),t._v(" "),i("button",{staticClass:"btn btn-link p-0",on:{click:function(i){return t.toggleDetails(s.id
1)}}},[t._v("\n "+t._s(t.showDetails[s.id]?"Hide details":"Show details")+"\n ")]),t._v(" "),t.showDetails[s.id]?i("div",{staticClass:"history-details mt-2"},[t._l(s.results,function(a,e){return i("div",{key:`history-${s.id}-${e}`,staticClass:"roll-row"},[i("div",{staticClass:"roll-index"},[t._v("#"+t._s(e+1))]),t._v(" "),i("div",{staticClass:"dice-row"},t._l(a.values,function(a,e){return i("span",{key:`history-die-${s.id}-${e}`,staticClass:"die pill"},[t._v(t._s(a))])}),0),t._v(" "),i("div",{staticClass:"roll-total"},[t._v("Total "+t._s(a.total))])])}),t._v(" "),i("div",{staticClass:"mt-2"},[i("button",{staticClass:"btn btn-outline-primary btn-sm mr-2",on:{click:function(i){return t.copySession(s)}}},[t._v("Copy")]),t._v(" "),i("button",{staticClass:"btn btn-outline-secondary btn-sm",on:{click:function(i){return t.downloadSession(s)}}},[t._v("Download")])])],2):t._e()])}),0)])]):t._e(),t._v(" "),t.error?i("div",{staticClass:"alert alert-danger mt-3"},[t._v(t._s(t.error))]):t._e()])},a=[];const e={};var l=s({name:"DiceRoller",data:()=>
1({diceCount:2,sides:6,rolls:1,results:[],history:[],showDetails:{},presets:[4,6,8,10,12,20,100],historyLimit:20,rolling:!1,error:""}),computed:{latestSession(){return this.history[0]||null}},mounted(){this.rollDice()},methods:{rollDice(){this.error="",this.results=[],this.diceCount<1||this.sides<2||this.rolls<1?this.error="Please enter valid dice settings.":(this.rolling=!0,setTimeout(()=>{for(let a=0;a<this.rolls;a+=1){const s=[];let i=0;for(let a=0;a<this.diceCount;a+=1){const a=t(1,this.sides);s.push(a),i+=a}this.results.push({values:s,total:i})}const s=this.calculateTotals(this.results),i={id:`${Date.now()}-${Math.random().toString(16).slice(2)}`,timestamp:new Date,diceCount:this.diceCount,sides:this.sides,rolls:this.rolls,results:this.results,totals:s};this.history.unshift(i),this.history.length>this.historyLimit&&(this.history=this.history.slice(0,this.historyLimit)),this.rolling=!1},200))},calculateTotals(t){const s=t.map(t=>t.total),i=s.reduce((t,s)=>t+s,0);return{sum:i,min:Math.min(...s),max:Math.max(...s),avg:i/s.length}},applyPreset(t){this.sides=t,this.rollDice()}
1,clearHistory(){this.history=[],this.showDetails={}},toggleDetails(t){this.$set(this.showDetails,t,!this.showDetails[t])},copySession(t){const s=t.results.map((t,s)=>`Roll ${s+1}: ${t.values.join(", ")} (Total ${t.total})`).join("\n");APP.TOOLS.copy(s),$.toast({title:"Copied",message:"Dice results copied.",style:"success"})},downloadSession(t){const s=t.results.map((t,s)=>`Roll ${s+1}: ${t.values.join(", ")} (Total ${t.total})`).join("\n"),i=new Blob([s],{type:"text/plain;charset=utf-8"}),a=URL.createObjectURL(i),e=document.createElement("a");e.href=a,e.download="dice_rolls.txt",e.click(),URL.revokeObjectURL(a)},copyDie(t){APP.TOOLS.copy(t),$.toast({title:"Copied",message:`Die value ${t} copied.`,style:"success"})},formatTimestamp:t=>new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}},i,a,!1,o,"6f7c955c",null,null);function o(t){for(let s in e)this[s]=e[s]}const n=function(){return l.exports}();export{n 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.