PageSourceSearch

https://niko366.com.br/assets/OrderSessionPage-BQXtlVfl.js

js niko366.com.br collected 2026-09-29 01:45:35 UTC 33,654 bytes, 12 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2995ef3f-ceeb-5823-b407-154234e8f6b5")}catch(e){}}();
3import{q as _,j as c,bP as Be,B as H,P as S,a as Ae,y as Ke,r as qe,Y as Je,Z as Ye,$ as Qe,R as M,bQ as Se,c as Te,aw as Ge,ay as We,aD as Ze,bR as Xe,bS as et,bM as tt,bT as nt,D as rt,ae as ot}from"./index-CVhO1mfm.js";import{P as it}from"./Products-Clk528Gk.js";function de({open:e,onClose:t,onContinue:i}){const r=_(({orderSession:o})=>o.session),n=o=>{o.preventDefault(),i&&(i(),t())};return c.jsx(Be,{open:e,PaperProps:{className:"dialog"},children:c.jsxs("form",{className:"flex w-80 flex-col items-center justify-center space-y-8 p-5",onSubmit:n,children:[c.jsx("div",{className:"text-center text-gray-700",children:c.jsxs("span",{className:"text-lg font-medium",children:["Confirmar fechamento da ",r==null?void 0:r.mode,"?"]})}),c.jsxs("div",{className:"flex w-full space-x-3",children:[c.jsx(H,{color:"primary",variant:"outlined",size:"large",className:"w-full",onClick:t,children:"Voltar"}),c.jsx(H,{color:"primary",variant:"contained",size:"large",type:"submit",className:"w-full",children:"Confirmar"})]})]})})}de.propTypes={open:S.bool,onClose:S.func,onContinue:S.func};de.defaultProps={open:void 0,onClose:void 0,onContinue:void 0};function st(){const e=Ae();return c.jsx("div",{className:"bounce fixed bottom-12 z-30 flex h-14 w-full flex-shrink-0 cursor-pointer items-center bg-primary px-4 text-primary-contrast shadow-top-md",onClick:()=>{var t;return e.push(`/${(t=e.location.pathname)==null?void 0:t.split("/")[1]}`)},children:c.jsx("div",{className:"flex flex-1 items-center justify-center text-base font-medium",children:c.jsx("span",{children:"Fazer um novo pedido"})})})}const te={pending:{label:"Pendente",color:"#BCDEFA"},waiting:{label:"Confirmado",color:"#A2F5BF"},ok:{label:"Confirmado",color:"#A2F5BF"},production:{label:"Confirmado",color:"#A2F5BF"},ready:{label:"Confirmado",color:"#A2F5BF"},canceled:{label:"Cancelado",color:"#F9ACAA"}};function at(){return c.jsxs("div",{className:"rounded-md border border-gray-200 bg-white p-3",children:[c.jsxs("div",{className:"flex",children:[c.jsx("div",{className:"mr-1 min-w-10",children:c.jsx("div",{className:"h-7 w-7 animate-pulse rounded bg-gray-200 px-1.5 py-1 font-medium"})}),c.jsxs("div",{className:"flex flex-1 flex-col space-y-2",children:[c.jsx("div",{className:"h-6 w-2/3 animate-pulse rounded-md bg-gray-200"}),c.jsx("div",{className:"h-5 w-4/5 animate-pulse rounded-md bg-gray-200"})]}),c.jsx("div",{className:"h-6 w-20 animate-pulse rounded-md bg-gray-200"})]}),c.jsx("div",{className:"my-2.5 w-full border-t border-dashed border-gray-200"}),c.jsxs("div",{className:"flex items-center justify-between text-msm",children:[c.jsx("div",{className:"h-6 w-1/4 animate-pulse rounded-md bg-gray-200"}),c.jsx("div",{className:"h-6 w-1/4 animate-pulse rounded-md bg-gray-200"})]})]})}function Pe({orderItem:e}){return c.jsxs("div",{className:"rounded-md border border-gray-200 bg-white p-3",children:[c.jsx(it,{product:e}),c.jsx("div",{className:"my-2.5 w-full border-t border-dashed border-gray-200"}),te[e.status]&&c.jsxs("div",{className:"flex items-center justify-between text-msm",children:[c.jsxs("div",{className:"font-light text-gray-500",children:["Pedido às ",Ke(e.created_at).format("HH:mm")]}),c.jsx("div",{className:"rounded-md px-2 py-1 font-normal text-gray-600",style:{backgroundColor:te[e.status].color},children:te[e.status].label})]})]})}Pe.propTypes={orderItem:S.shape({id:S.number,name:S.string,price:S.number,quantity:S.number,status:S.string,created_at:S.string}).isRequired};var fe={},lt=Qe,ct=Ye;Object.defineProperty(fe,"__esModule",{value:!0});var ge=fe.default=void 0,ut=ct(qe),dt=lt(Je()),ft=(0,dt.default)(ut.createElement("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z"}),"ShareRounded");ge=fe.default=ft;var $={},gt=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Ie={},A={};let he;const ht=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];A.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};A.getSymbolTotalCodewords=function(t){return ht[t]};A.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};A.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');he=t};A.isKanjiModeEnabled=function(){return typeof he<"u"};A.toSJIS=function(t){return he(t)};var G={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};
vendor: 20,593 bytes, lines 3-9
3function t(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+i)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,n){if(e.isValid(r))return r;try{return t(r)}catch{return n}}})(G);function je(){this.buffer=[],this.length=0}je.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let i=0;i<t;i++)this.putBit((e>>>t-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var mt=je;function K(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}K.prototype.set=function(e,t,i,r){const n=e*this.size+t;this.data[n]=i,r&&(this.reservedBit[n]=!0)};K.prototype.get=function(e,t){return this.data[e*this.size+t]};K.prototype.xor=function(e,t,i){this.data[e*this.size+t]^=i};K.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var pt=K,ve={};(function(e){const t=A.getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const n=Math.floor(r/7)+2,o=t(r),s=o===145?26:Math.ceil((o-13)/(2*n-2))*2,a=[o-7];for(let l=1;l<n-1;l++)a[l]=a[l-1]-s;return a.push(6),a.reverse()},e.getPositions=function(r){const n=[],o=e.getRowColCoords(r),s=o.length;for(let a=0;a<s;a++)for(let l=0;l<s;l++)a===0&&l===0||a===0&&l===s-1||a===s-1&&l===0||n.push([o[a],o[l]]);return n}})(ve);var Me={};const yt=A.getSymbolSize,Ee=7;Me.getPositions=function(t){const i=yt(t);return[[0,0],[i-Ee,0],[0,i-Ee]]};var Re={};(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const o=n.size;let s=0,a=0,l=0,u=null,d=null;for(let E=0;E<o;E++){a=l=0,u=d=null;for(let m=0;m<o;m++){let f=n.get(E,m);f===u?a++:(a>=5&&(s+=t.N1+(a-5)),u=f,a=1),f=n.get(m,E),f===d?l++:(l>=5&&(s+=t.N1+(l-5)),d=f,l=1)}a>=5&&(s+=t.N1+(a-5)),l>=5&&(s+=t.N1+(l-5))}return s},e.getPenaltyN2=function(n){const o=n.size;let s=0;for(let a=0;a<o-1;a++)for(let l=0;l<o-1;l++){const u=n.get(a,l)+n.get(a,l+1)+n.get(a+1,l)+n.get(a+1,l+1);(u===4||u===0)&&s++}return s*t.N2},e.getPenaltyN3=function(n){const o=n.size;let s=0,a=0,l=0;for(let u=0;u<o;u++){a=l=0;for(let d=0;d<o;d++)a=a<<1&2047|n.get(u,d),d>=10&&(a===1488||a===93)&&s++,l=l<<1&2047|n.get(d,u),d>=10&&(l===1488||l===93)&&s++}return s*t.N3},e.getPenaltyN4=function(n){let o=0;const s=n.data.length;for(let l=0;l<s;l++)o+=n.data[l];return Math.abs(Math.ceil(o*100/s/5)-10)*t.N4};function i(r,n,o){switch(r){case e.Patterns.PATTERN000:return(n+o)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return o%3===0;case e.Patterns.PATTERN011:return(n+o)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(o/3))%2===0;case e.Patterns.PATTERN101:return n*o%2+n*o%3===0;case e.Patterns.PATTERN110:return(n*o%2+n*o%3)%2===0;case e.Patterns.PATTERN111:return(n*o%3+(n+o)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(n,o){const s=o.size;for(let a=0;a<s;a++)for(let l=0;l<s;l++)o.isReserved(l,a)||o.xor(l,a,i(n,l,a))},e.getBestMask=function(n,o){const s=Object.keys(e.Patterns).length;let a=0,l=1/0;for(let u=0;u<s;u++){o(u),e.applyMask(u,n);const d=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(u,n),d<l&&(l=d,a=u)}return a}})(Re);var W={};const R=G,q=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],J=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];W.getBlocksCount=function(t,i){switch(i){case R.L:return q[(t-1)*4+0];case R.M:return q[(t-1)*4+1];case R.Q:return q[(t-1)*4+2];case R.H:return q[(t-1)*4+3];default:return}};W.getTotalCodewordsCount=function(t,i){switch(i){case R.L:return J[(t-1)*4+0];case R.M:return J[(t-1)*4+1];case R.Q:return J[(t-1)*4+2];case R.H:return J[(t-1)*4+3];default:return}};var Le={},Z={};const O=new Uint8Array(512),Y=new Uint8Array(256);(function(){let t=1;for(let i=0;i<255;i++)O[i]=t,Y[t]=i,t<<=1,t&256&&(t^=285);for(let i=255;i<512;i++)O[i]=O[i-255]})();Z.log=function(t){if(t<1)throw new Error("log("+t+")");return Y[t]};Z.exp=function(t){return O[t]};Z.mul=function(t,i){return t===0||i===0?0:O[Y[t]+Y[i]]};(function(e){const t=Z;e.mul=function(r,n){const o=new Uint8Array(r.length+n.length-1);for(let s=0;s<r.length;s++)for(let a=0;a<n.length;a++)o[s+a]^=t.mul(r[s],n[a]);return o},e.mod=function(r,n){let o=new Uint8Array(r);for(;o.length-n.length>=0;){const s=o[0];for(let l=0;l<n.length;l++)o[l]^=t.mul(n[l],s);let a=0;for(;a<o.length&&o[a]===0;)a++;o=o.slice(a)}return o},e.generateECPolynomial=function(r){let n=new Uint8Array([1]);for(let o=0;o<r;o++)n=e.mul(n,new Uint8Array([1,t.exp(o)]));return n}})(Le);const _e=Le;function me(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}me.prototype.initialize=function(t){this.degree=t,this.genPoly=_e.generateECPolynomial(this.degree)};me.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(t.length+this.degree);i.set(t);const r=_e.mod(i,this.genPoly),n=this.degree-r.length;if(n>0){const o=new Uint8Array(this.degree);return o.set(r,n),o}return r};var wt=me,De={},L={},pe={};pe.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var I={};const Fe="[0-9]+",Ct="[A-Z $%*+\\-./:]+";let V="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";V=V.replace(/u/g,"\\u");const Nt="(?:(?![A-Z0-9 $%*+\\-./:]|"+V+`)(?:.|[\r
4]))+`;I.KANJI=new RegExp(V,"g");I.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");I.BYTE=new RegExp(Nt,"g");I.NUMERIC=new RegExp(Fe,"g");I.ALPHANUMERIC=new RegExp(Ct,"g");const Et=new RegExp("^"+V+"$"),bt=new RegExp("^"+Fe+"$"),xt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");I.testKanji=function(t){return Et.test(t)};I.testNumeric=function(t){return bt.test(t)};I.testAlphanumeric=function(t){return xt.test(t)};(function(e){const t=pe,i=I;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},e.getBestModeForData=function(o){return i.testNumeric(o)?e.NUMERIC:i.testAlphanumeric(o)?e.ALPHANUMERIC:i.testKanji(o)?e.KANJI:e.BYTE},e.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},e.isValid=function(o){return o&&o.bit&&o.ccBits};function r(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(o,s){if(e.isValid(o))return o;try{return r(o)}catch{return s}}})(L);(function(e){const t=A,i=W,r=G,n=L,o=pe,s=7973,a=t.getBCHDigit(s);function l(m,f,w){for(let g=1;g<=40;g++)if(f<=e.getCapacity(g,w,m))return g}function u(m,f){return n.getCharCountIndicator(m,f)+4}function d(m,f){let w=0;return m.forEach(function(g){const B=u(g.mode,f);w+=B+g.getBitsLength()}),w}function E(m,f){for(let w=1;w<=40;w++)if(d(m,w)<=e.getCapacity(w,f,n.MIXED))return w}e.from=function(f,w){return o.isValid(f)?parseInt(f,10):w},e.getCapacity=function(f,w,g){if(!o.isValid(f))throw new Error("Invalid QR Code version");typeof g>"u"&&(g=n.BYTE);const B=t.getSymbolTotalCodewords(f),y=i.getTotalCodewordsCount(f,w),C=(B-y)*8;if(g===n.MIXED)return C;const p=C-u(g,f);switch(g){case n.NUMERIC:return Math.floor(p/10*3);case n.ALPHANUMERIC:return Math.floor(p/11*2);case n.KANJI:return Math.floor(p/13);case n.BYTE:default:return Math.floor(p/8)}},e.getBestVersionForData=function(f,w){let g;const B=r.from(w,r.M);if(Array.isArray(f)){if(f.length>1)return E(f,B);if(f.length===0)return 1;g=f[0]}else g=f;return l(g.mode,g.getLength(),B)},e.getEncodedBits=function(f){if(!o.isValid(f)||f<7)throw new Error("Invalid QR Code version");let w=f<<12;for(;t.getBCHDigit(w)-a>=0;)w^=s<<t.getBCHDigit(w)-a;return f<<12|w}})(De);var Ue={};const ae=A,ke=1335,Bt=21522,be=ae.getBCHDigit(ke);Ue.getEncodedBits=function(t,i){const r=t.bit<<3|i;let n=r<<10;for(;ae.getBCHDigit(n)-be>=0;)n^=ke<<ae.getBCHDigit(n)-be;return(r<<10|n)^Bt};var ze={};const At=L;function D(e){this.mode=At.NUMERIC,this.data=e.toString()}D.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};D.prototype.getLength=function(){return this.data.length};D.prototype.getBitsLength=function(){return D.getBitsLength(this.data.length)};D.prototype.write=function(t){let i,r,n;for(i=0;i+3<=this.data.length;i+=3)r=this.data.substr(i,3),n=parseInt(r,10),t.put(n,10);const o=this.data.length-i;o>0&&(r=this.data.substr(i),n=parseInt(r,10),t.put(n,o*3+1))};var St=D;const Tt=L,ne=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function F(e){this.mode=Tt.ALPHANUMERIC,this.data=e}F.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};F.prototype.getLength=function(){return this.data.length};F.prototype.getBitsLength=function(){return F.getBitsLength(this.data.length)};F.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let r=ne.indexOf(this.data[i])*45;r+=ne.indexOf(this.data[i+1]),t.put(r,11)}this.data.length%2&&t.put(ne.indexOf(this.data[i]),6)};var Pt=F;const It=L;function U(e){this.mode=It.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}U.getBitsLength=function(t){return t*8};U.prototype.getLength=function(){return this.data.length};U.prototype.getBitsLength=function(){return U.getBitsLength(this.data.length)};U.prototype.write=function(e){for(let t=0,i=this.data.length;t<i;t++)e.put(this.data[t],8)};var jt=U;const vt=L,Mt=A;function k(e){this.mode=vt.KANJI,this.data=e}k.getBitsLength=function(t){return t*13};k.prototype.getLength=function(){return this.data.length};k.prototype.getBitsLength=function(){return k.getBitsLength(this.data.length)};k.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let i=Mt.toSJIS(this.data[t]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
5Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),e.put(i,13)}};var Rt=k,Oe={exports:{}};(function(e){var t={single_source_shortest_paths:function(i,r,n){var o={},s={};s[r]=0;var a=t.PriorityQueue.make();a.push(r,0);for(var l,u,d,E,m,f,w,g,B;!a.empty();){l=a.pop(),u=l.value,E=l.cost,m=i[u]||{};for(d in m)m.hasOwnProperty(d)&&(f=m[d],w=E+f,g=s[d],B=typeof s[d]>"u",(B||g>w)&&(s[d]=w,a.push(d,w),o[d]=u))}if(typeof n<"u"&&typeof s[n]>"u"){var y=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(y)}return o},extract_shortest_path_from_predecessor_list:function(i,r){for(var n=[],o=r;o;)n.push(o),i[o],o=i[o];return n.reverse(),n},find_path:function(i,r,n){var o=t.single_source_shortest_paths(i,r,n);return t.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(i){var r=t.PriorityQueue,n={},o;i=i||{};for(o in r)r.hasOwnProperty(o)&&(n[o]=r[o]);return n.queue=[],n.sorter=i.sorter||r.default_sorter,n},default_sorter:function(i,r){return i.cost-r.cost},push:function(i,r){var n={value:i,cost:r};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Oe);var Lt=Oe.exports;(function(e){const t=L,i=St,r=Pt,n=jt,o=Rt,s=I,a=A,l=Lt;function u(y){return unescape(encodeURIComponent(y)).length}function d(y,C,p){const h=[];let N;for(;(N=y.exec(p))!==null;)h.push({data:N[0],index:N.index,mode:C,length:N[0].length});return h}function E(y){const C=d(s.NUMERIC,t.NUMERIC,y),p=d(s.ALPHANUMERIC,t.ALPHANUMERIC,y);let h,N;return a.isKanjiModeEnabled()?(h=d(s.BYTE,t.BYTE,y),N=d(s.KANJI,t.KANJI,y)):(h=d(s.BYTE_KANJI,t.BYTE,y),N=[]),C.concat(p,h,N).sort(function(x,T){return x.index-T.index}).map(function(x){return{data:x.data,mode:x.mode,length:x.length}})}function m(y,C){switch(C){case t.NUMERIC:return i.getBitsLength(y);case t.ALPHANUMERIC:return r.getBitsLength(y);case t.KANJI:return o.getBitsLength(y);case t.BYTE:return n.getBitsLength(y)}}function f(y){return y.reduce(function(C,p){const h=C.length-1>=0?C[C.length-1]:null;return h&&h.mode===p.mode?(C[C.length-1].data+=p.data,C):(C.push(p),C)},[])}function w(y){const C=[];for(let p=0;p<y.length;p++){const h=y[p];switch(h.mode){case t.NUMERIC:C.push([h,{data:h.data,mode:t.ALPHANUMERIC,length:h.length},{data:h.data,mode:t.BYTE,length:h.length}]);break;case t.ALPHANUMERIC:C.push([h,{data:h.data,mode:t.BYTE,length:h.length}]);break;case t.KANJI:C.push([h,{data:h.data,mode:t.BYTE,length:u(h.data)}]);break;case t.BYTE:C.push([{data:h.data,mode:t.BYTE,length:u(h.data)}])}}return C}function g(y,C){const p={},h={start:{}};let N=["start"];for(let b=0;b<y.length;b++){const x=y[b],T=[];for(let v=0;v<x.length;v++){const P=x[v],z=""+b+v;T.push(z),p[z]={node:P,lastCount:0},h[z]={};for(let ee=0;ee<N.length;ee++){const j=N[ee];p[j]&&p[j].node.mode===P.mode?(h[j][z]=m(p[j].lastCount+P.length,P.mode)-m(p[j].lastCount,P.mode),p[j].lastCount+=P.length):(p[j]&&(p[j].lastCount=P.length),h[j][z]=m(P.length,P.mode)+4+t.getCharCountIndicator(P.mode,C))}}N=T}for(let b=0;b<N.length;b++)h[N[b]].end=0;return{map:h,table:p}}function B(y,C){let p;const h=t.getBestModeForData(y);if(p=t.from(C,h),p!==t.BYTE&&p.bit<h.bit)throw new Error('"'+y+'" cannot be encoded with mode '+t.toString(p)+`.
6 Suggested mode is: `+t.toString(h));switch(p===t.KANJI&&!a.isKanjiModeEnabled()&&(p=t.BYTE),p){case t.NUMERIC:return new i(y);case t.ALPHANUMERIC:return new r(y);case t.KANJI:return new o(y);case t.BYTE:return new n(y)}}e.fromArray=function(C){return C.reduce(function(p,h){return typeof h=="string"?p.push(B(h,null)):h.data&&p.push(B(h.data,h.mode)),p},[])},e.fromString=function(C,p){const h=E(C,a.isKanjiModeEnabled()),N=w(h),b=g(N,p),x=l.find_path(b.map,"start","end"),T=[];for(let v=1;v<x.length-1;v++)T.push(b.table[x[v]].node);return e.fromArray(f(T))},e.rawSplit=function(C){return e.fromArray(E(C,a.isKanjiModeEnabled()))}})(ze);const X=A,re=G,_t=mt,Dt=pt,Ft=ve,Ut=Me,le=Re,ce=W,kt=wt,Q=De,zt=Ue,Ot=L,oe=ze;function Ht(e,t){const i=e.size,r=Ut.getPositions(t);for(let n=0;n<r.length;n++){const o=r[n][0],s=r[n][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||i<=o+a))for(let l=-1;l<=7;l++)s+l<=-1||i<=s+l||(a>=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?e.set(o+a,s+l,!0,!0):e.set(o+a,s+l,!1,!0))}}function Vt(e){const t=e.size;for(let i=8;i<t-8;i++){const r=i%2===0;e.set(i,6,r,!0),e.set(6,i,r,!0)}}function $t(e,t){const i=Ft.getPositions(t);for(let r=0;r<i.length;r++){const n=i[r][0],o=i[r][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?e.set(n+s,o+a,!0,!0):e.set(n+s,o+a,!1,!0)}}function Kt(e,t){const i=e.size,r=Q.getEncodedBits(t);let n,o,s;for(let a=0;a<18;a++)n=Math.floor(a/3),o=a%3+i-8-3,s=(r>>a&1)===1,e.set(n,o,s,!0),e.set(o,n,s,!0)}function ie(e,t,i){const r=e.size,n=zt.getEncodedBits(t,i);let o,s;for(o=0;o<15;o++)s=(n>>o&1)===1,o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(r-15+o,8,s,!0),o<8?e.set(8,r-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(r-8,8,1,!0)}function qt(e,t){const i=e.size;let r=-1,n=i-1,o=7,s=0;for(let a=i-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!e.isReserved(n,a-l)){let u=!1;s<t.length&&(u=(t[s]>>>o&1)===1),e.set(n,a-l,u),o--,o===-1&&(s++,o=7)}if(n+=r,n<0||i<=n){n-=r,r=-r;break}}}function Jt(e,t,i){const r=new _t;i.forEach(function(l){r.put(l.mode.bit,4),r.put(l.getLength(),Ot.getCharCountIndicator(l.mode,e)),l.write(r)});const n=X.getSymbolTotalCodewords(e),o=ce.getTotalCodewordsCount(e,t),s=(n-o)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const a=(s-r.getLengthInBits())/8;for(let l=0;l<a;l++)r.put(l%2?17:236,8);return Yt(r,e,t)}function Yt(e,t,i){const r=X.getSymbolTotalCodewords(t),n=ce.getTotalCodewordsCount(t,i),o=r-n,s=ce.getBlocksCount(t,i),a=r%s,l=s-a,u=Math.floor(r/s),d=Math.floor(o/s),E=d+1,m=u-d,f=new kt(m);let w=0;const g=new Array(s),B=new Array(s);let y=0;const C=new Uint8Array(e.buffer);for(let x=0;x<s;x++){const T=x<l?d:E;g[x]=C.slice(w,w+T),B[x]=f.encode(g[x]),w+=T,y=Math.max(y,T)}const p=new Uint8Array(r);let h=0,N,b;for(N=0;N<y;N++)for(b=0;b<s;b++)N<g[b].length&&(p[h++]=g[b][N]);for(N=0;N<m;N++)for(b=0;b<s;b++)p[h++]=B[b][N];return p}function Qt(e,t,i,r){let n;if(Array.isArray(e))n=oe.fromArray(e);else if(typeof e=="string"){let u=t;if(!u){const d=oe.rawSplit(e);u=Q.getBestVersionForData(d,i)}n=oe.fromString(e,u||40)}else throw new Error("Invalid data");const o=Q.getBestVersionForData(n,i);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=o;else if(t<o)throw new Error(`
7The chosen QR Code version cannot contain this amount of data.
8Minimum version required to store current data is: `+o+`.
9`);const s=Jt(t,i,n),a=X.getSymbolSize(t),l=new Dt(a);return Ht(l,t),Vt(l),$t(l,t),ie(l,i,0),t>=7&&Kt(l,t),qt(l,s),isNaN(r)&&(r=le.getBestMask(l,ie.bind(null,l,i))),le.applyMask(r,l),ie(l,i,r),{modules:l,version:t,errorCorrectionLevel:i,maskPattern:r,segments:n}}Ie.create=function(t,i){if(typeof t>"u"||t==="")throw new Error("No input text");let r=re.M,n,o;return typeof i<"u"&&(r=re.from(i.errorCorrectionLevel,re.M),n=Q.from(i.version),o=le.from(i.maskPattern),i.toSJISFunc&&X.setToSJISFunction(i.toSJISFunc)),Qt(t,n,r,o)};var He={},ye={};(function(e){function t(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let r=i.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+i);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(o){return[o,o]}))),r.length===6&&r.push("F","F");const n=parseInt(r.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const n=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,o=r.width&&r.width>=21?r.width:void 0,s=r.scale||4;return{width:o,scale:o?4:s,margin:n,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,n){return n.width&&n.width>=r+n.margin*2?n.width/(r+n.margin*2):n.scale},e.getImageWidth=function(r,n){const o=e.getScale(r,n);return Math.floor((r+n.margin*2)*o)},e.qrToImageData=function(r,n,o){const s=n.modules.size,a=n.modules.data,l=e.getScale(s,o),u=Math.floor((s+o.margin*2)*l),d=o.margin*l,E=[o.color.light,o.color.dark];for(let m=0;m<u;m++)for(let f=0;f<u;f++){let w=(m*u+f)*4,g=o.color.light;if(m>=d&&f>
9=d&&m<u-d&&f<u-d){const B=Math.floor((m-d)/l),y=Math.floor((f-d)/l);g=E[a[B*s+y]?1:0]}r[w++]=g.r,r[w++]=g.g,r[w++]=g.b,r[w]=g.a}}})(ye);(function(e){const t=ye;function i(n,o,s){n.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=s,o.width=s,o.style.height=s+"px",o.style.width=s+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(o,s,a){let l=a,u=s;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(u=r()),l=t.getOptions(l);const d=t.getImageWidth(o.modules.size,l),E=u.getContext("2d"),m=E.createImageData(d,d);return t.qrToImageData(m.data,o,l),i(E,u,d),E.putImageData(m,0,0),u},e.renderToDataURL=function(o,s,a){let l=a;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const u=e.render(o,s,l),d=l.type||"image/png",E=l.rendererOpts||{};return u.toDataURL(d,E.quality)}})(He);var Ve={};const Gt=ye;function xe(e,t){const i=e.a/255,r=t+'="'+e.hex+'"';return i<1?r+" "+t+'-opacity="'+i.toFixed(2).slice(1)+'"':r}function se(e,t,i){let r=e+t;return typeof i<"u"&&(r+=" "+i),r}function Wt(e,t,i){let r="",n=0,o=!1,s=0;for(let a=0;a<e.length;a++){const l=Math.floor(a%t),u=Math.floor(a/t);!l&&!o&&(o=!0),e[a]?(s++,a>0&&l>0&&e[a-1]||(r+=o?se("M",l+i,.5+u+i):se("m",n,0),n=0,o=!1),l+1<t&&e[a+1]||(r+=se("h",s),s=0)):n++}return r}Ve.render=function(t,i,r){const n=Gt.getOptions(i),o=t.modules.size,s=t.modules.data,a=o+n.margin*2,l=n.color.light.a?"<path "+xe(n.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",u="<path "+xe(n.color.dark,"stroke")+' d="'+Wt(s,o,n.margin)+'"/>',d='viewBox="0 0 '+a+" "+a+'"',m='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+d+' shape-rendering="crispEdges">'+l+u+`</svg>
10`;return typeof r=="function"&&r(null,m),m};const Zt=gt,ue=Ie,$e=He,Xt=Ve;function we(e,t,i,r,n){const o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!Zt())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(n=i,i=t,t=r=void 0):s===3&&(t.getContext&&typeof n>"u"?(n=r,r=void 0):(n=r,r=i,i=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(i=t,t=r=void 0):s===2&&!t.getContext&&(r=i,i=t,t=void 0),new Promise(function(l,u){try{const d=ue.create(i,r);l(e(d,t,r))}catch(d){u(d)}})}try{const l=ue.create(i,r);n(null,e(l,t,r))}catch(l){n(l)}}$.create=ue.create;$.toCanvas=we.bind(null,$e.render);$.toDataURL=we.bind(null,$e.renderToDataURL);$.toString=we.bind(null,function(e,t,i){return Xt.render(e,i)});function Ce({size:e}){return c.jsx(Se,{primary:c.jsx("div",{className:"mb-1 flex w-full",children:c.jsx("div",{className:"h-5 w-3/5 animate-pulse rounded-md bg-gray-200"})}),secondary:c.jsx("div",{className:"flex",children:c.jsx("div",{className:"h-5 w-3/4 animate-pulse rounded-md bg-gray-200"})}),Icon:c.jsx(ge,{className:Te("text-gray-400",e==="large"?"mr-1 text-3xl":"text-2xl")})})}Ce.propTypes={size:S.string};Ce.defaultProps={size:void 0};function Ne({size:e="default"}){const[t,i]=M.useState(!1),r=_(({orderSession:l})=>l.session),n=_(({orderSession:l})=>l.loading),o=_(({company:l})=>l.company.url_name),[s,a]=M.useState(null);return M.useEffect(()=>{r&&(async()=>{try{const u=`${window.origin}/${o}?uid=${r.uid}&code=${r==null?void 0:r.code}`,d=await $.toDataURL(u||"Link",{margin:1,width:140});a(d)}catch{}})()},[o,r]),n?c.jsx(Ce,{size:e}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"cursor-pointer",onClick:()=>i(!0),children:c.jsx(Se,{primary:c.jsxs("div",{className:"text-sm",children:["Compartilhar o acesso à ",r==null?void 0:r.mode]}),secondary:c.jsx("div",{className:"whitespace-normal text-sm",children:"Clique aqui e acesse em outros dispositivos"}),Icon:c.jsx(ge,{className:Te("text-gray-400",e==="large"?"mr-1 text-3xl":"text-2xl")})})}),c.jsx(Be,{open:t,onClose:()=>i(!1),PaperProps:{className:"dialog"},children:c.jsxs("div",{className:"relative",children:[c.jsx(Ge,{title:`Compartilhar ${r==null?void 0:r.mode}`,onClose:()=>i(!1)}),c.jsxs("div",{className:"flex flex-col items-center space-y-8 overflow-auto p-5 sm:p-6",children:[c.jsxs("div",{className:"text-md max-w-xs font-light text-gray-500",children:["Para acessar esta ",r==null?void 0:r.mode," em outro dispositivo, leia o"," ",c.jsx("strong",{className:"font-medium",children:"QR Code"})," abaixo. Ou, caso seja solicitado, informe o ",c.jsx("strong",{className:"font-medium",children:"código de acesso"}),"."]}),c.jsxs("div",{className:"flex items-center space-x-8",children:[c.jsx("img",{src:s,alt:"QR Code para compartilhar a mesa/comanda"}),c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-center font-light text-gray-500",children:"Código de acesso"}),c.jsx("div",{className:"text-center text-3xl font-medium text-gray-600",children:r==null?void 0:r.code})]})]}),c.jsx("div",{className:"flex w-full space-x-3",children:c.jsx(H,{variant:"contained",color:"primary",size:"large",fullWidth:!0,onClick:()=>i(!1),children:"Fechar janela"})})]})]})})]})}Ne.propTypes={size:S.string};Ne.defaultProps={size:void 0};
10function nn(){const e=We(),t=Ae(),[i,r]=M.useState(!1),n=_(({orderSession:g})=>g.session),o=_(({orderSession:g})=>g.loading),s=Ze("(max-width:1024px)"),{data:a,isLoading:l}=Xe(),[u,d]=M.useState(!1),E=M.useCallback(async()=>{d(!0),await e(et(n.uid,n.code)),d(!1)},[e,n.code,n.uid]),m=M.useMemo(()=>a==null?void 0:a.order_items.every(g=>g.status!=="pending"),[a==null?void 0:a.order_items]),f=M.useMemo(()=>tt((a==null?void 0:a.order_items)||[],["id"],["desc"]),[a==null?void 0:a.order_items]),w=f.length;return c.jsxs("div",{className:"relative mx-auto w-full max-w-lg",children:[c.jsxs("div",{className:"h-full px-3 py-4 pb-24 sm:p-8",children:[c.jsx("div",{className:"mb-2.5 rounded-md border border-gray-200 bg-white",children:c.jsx(nt,{size:"large"})}),c.jsx("div",{className:"mb-2.5 rounded-md border border-gray-200 bg-white",children:c.jsx(Ne,{size:"large"})}),((n==null?void 0:n.status)==="closing_request"||(n==null?void 0:n.status)==="closing")&&c.jsxs("div",{className:"p-2.5 text-center text-gray-700",children:[c.jsx("span",{className:"font-medium",children:"Só um instante"}),c.jsx("br",{}),c.jsx("span",{children:"um garçom irá trazer sua conta"})]}),!m&&w>0&&c.jsx("div",{className:"p-2.5 text-center text-gray-700",children:c.jsx("span",{children:"Não é possível pedir a conta tendo itens pendentes"})}),((n==null?void 0:n.status)==="open"||(n==null?void 0:n.status)==="pending_order")&&w>0&&c.jsx("div",{className:"flex justify-center py-2.5",children:c.jsx(H,{color:"primary",variant:"contained",disabled:!m||u,onClick:()=>r(!0),size:"large",className:"w-64",fullWidth:!0,children:u?c.jsx(rt,{size:22}):"Pedir a conta"})}),c.jsx("h3",{className:"py-4 text-xl font-semibold text-gray-700",children:"Resumo do pedido"}),c.jsxs("div",{className:"space-y-3",children:[!l&&f.length===0&&c.jsxs("div",{className:"flex h-64 flex-1 flex-col items-center justify-center space-y-7 p-4 text-gray-400",children:[c.jsx(ot,{className:"h-28 w-28 fill-current sm:h-32 sm:w-32"}),c.jsx("div",{className:"text-center text-xl font-semibold",children:"Nenhum pedido encontrado"})]}),l&&[1,2,3,4,5,6].map(g=>c.jsx(at,{},g)),!s&&!o&&n.status!=="closing_request"&&n.status!=="closing"&&c.jsx("div",{className:"flex justify-center py-2.5",children:c.jsx(H,{color:"primary",variant:"contained",onClick:()=>{var g;return t.push(`/${(g=t.location.pathname)==null?void 0:g.split("/")[1]}`)},className:"w-64",size:"large",children:"Fazer um novo pedido"})}),!l&&f.map(g=>c.jsx(Pe,{orderItem:g},g.id))]})]}),s&&!l&&!o&&n.status!=="closing_request"&&n.status!=="closing"&&c.jsx(st,{}),c.jsx(de,{open:i,onClose:()=>r(!1),onContinue:E})]})}export{nn as default};
11
12//# debugId=2995ef3f-ceeb-5823-b407-154234e8f6b5

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.