{% layout none %}
<!doctype html>
  {%- liquid
    assign iso_code  = request.locale.iso_code
    assign config_rtl  = settings.right_to_left | default: 'enable-with-list'
    assign is_rtl = false
    assign dir = 'ltr'
    if config_rtl == 'enable-with-list'
      assign iso_code_ck = iso_code | split: '-' | first | append: ';' | prepend: ';'
      assign lis_rtl = ';ae;ar;arc;bqi;ckb;dv;fa;glk;ha;he;kwh;ks;ku;mzn;nqo;pnb;ps;sd;ug;ur;yi;'
      if lis_rtl contains iso_code_ck
        assign is_rtl = true
        assign dir = 'rtl'
      endif
    elsif config_rtl == 'enable'
      assign is_rtl = true
      assign dir = 'rtl'
    endif
  -%}
<html lang="{{ request.locale.iso_code }}" class="hdt-badge__shape-{{ settings.badge_shape }} dir--{{ dir }}" dir--{{ dir }} >
  <head>
    <script src="{{ 'vendor/qrcode.js' | shopify_asset_url }}" defer></script>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="theme-color" content="{{ settings.color_background }}">
    <link rel="canonical" href="{{ canonical_url }}">
    {%- if settings.favicon != blank -%}
      <link rel="icon" type="image/png" href="{{ settings.favicon | image_url: width: 32, height: 32 }}">
      <link rel="apple-touch-icon" href="{{ settings.favicon | image_url: width: 48, height: 48 }}">
    {%- endif -%}
    {%- if settings.library_font == "shopify" -%}
      {%- unless settings.type_header_font.system? and settings.type_body_font.system? -%}
        <link rel="preconnect" href="https://fonts.shopifycdn.com" crossorigin>
      {%- endunless -%}
    {%- endif -%}
    {%- assign formatted_balance = gift_card.balance | money_without_trailing_zeros | strip_html -%}

    <title>{{ 'gift_cards.issued.title' | t: value: formatted_balance, shop: shop.name }}</title>

    <meta name="description" content="{{ 'gift_cards.issued.subtext' | t }}">

    {%- liquid
      render 'social-meta-tags'
      render 'js-head'
      render 'css-variables', is_rtl: is_rtl
      echo 'theme.css' | asset_url | stylesheet_tag
    -%}
    {{ content_for_header }}
  </head>

  <body class="hdt-page-type-{{ request.page_type }}{% if settings.animations_hover_elements != 'none' %} animate--hover-{{ settings.animations_hover_elements }}{% endif %} template-{{ template.name }}">
    <main id="MainContent" class="content-for-layout focus-none" role="main" tabindex="-1">
      {% section 'main-gift-cart' %}
    </main>
    <div hidden>
      <span id="a11y-new-window-message">{{ 'accessibility.link_messages.new_window' | t }}</span>
    </div>
  </body>
</html>
<script type="text/javascript">var QRCode;!function(){function t(t){this.mode=n.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var _=[],e=0,r=this.data.length;r>e;e++){var o=this.data.charCodeAt(e);o>65536?(_[0]=240|(1835008&o)>>>18,_[1]=128|(258048&o)>>>12,_[2]=128|(4032&o)>>>6,_[3]=128|63&o):o>2048?(_[0]=224|(61440&o)>>>12,_[1]=128|(4032&o)>>>6,_[2]=128|63&o):o>128?(_[0]=192|(1984&o)>>>6,_[1]=128|63&o):_[0]=o,this.parsedData=this.parsedData.concat(_)}this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function _(t,_){this.typeNumber=t,this.errorCorrectLevel=_,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function e(t,_){if(void 0==t.length)throw Error(t.length+"/"+_);for(var e=0;e<t.length&&0==t[e];)e++;this.num=Array(t.length-e+_);for(var r=0;r<t.length-e;r++)this.num[r]=t[r+e]}function r(t,_){this.totalCount=t,this.dataCount=_}function o(){this.buffer=[],this.length=0}function i(){var t=!1,_=navigator.userAgent;return/android/i.test(_)&&(t=!0,(aMat=_.toString().match(/android ([0-9]\.[0-9])/i))&&aMat[1]&&(t=parseFloat(aMat[1]))),t}t.prototype={getLength:function(){return this.parsedData.length},write:function(t){for(var _=0,e=this.parsedData.length;e>_;_++)t.put(this.parsedData[_],8)}},_.prototype={addData:function(_){var e=new t(_);this.dataList.push(e),this.dataCache=null},isDark:function(t,_){if(0>t||this.moduleCount<=t||0>_||this.moduleCount<=_)throw Error(t+","+_);return this.modules[t][_]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=Array(this.moduleCount);for(var o=0;o<this.moduleCount;o++)this.modules[r][o]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=_.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,_){for(var e=-1;7>=e;e++)if(!(-1>=t+e||this.moduleCount<=t+e))for(var r=-1;7>=r;r++)-1>=_+r||this.moduleCount<=_+r||(this.modules[t+e][_+r]=e>=0&&6>=e&&(0==r||6==r)||r>=0&&6>=r&&(0==e||6==e)||e>=2&&4>=e&&r>=2&&4>=r)},getBestMaskPattern:function(){for(var t=0,_=0,e=0;8>e;e++){this.makeImpl(!0,e);var r=h.getLostPoint(this);(0==e||t>r)&&(t=r,_=e)}return _},createMovieClip:function(t,_,e){var r=t.createEmptyMovieClip(_,e);this.make();for(var o=0;o<this.modules.length;o++)for(var i=1*o,n=0;n<this.modules[o].length;n++){var a=1*n;this.modules[o][n]&&(r.beginFill(0,100),r.moveTo(a,i),r.lineTo(a+1,i),r.lineTo(a+1,i+1),r.lineTo(a,i+1),r.endFill())}return r},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=0==t%2);for(var _=8;_<this.moduleCount-8;_++)null==this.modules[6][_]&&(this.modules[6][_]=0==_%2)},setupPositionAdjustPattern:function(){for(var t=h.getPatternPosition(this.typeNumber),_=0;_<t.length;_++)for(var e=0;e<t.length;e++){var r=t[_],o=t[e];if(null==this.modules[r][o])for(var i=-2;2>=i;i++)for(var n=-2;2>=n;n++)this.modules[r+i][o+n]=-2==i||2==i||-2==n||2==n||0==i&&0==n}},setupTypeNumber:function(t){for(var _=h.getBCHTypeNumber(this.typeNumber),e=0;18>e;e++){var r=!t&&1==(1&_>>e);this.modules[Math.floor(e/3)][e%3+this.moduleCount-8-3]=r}for(var e=0;18>e;e++){var r=!t&&1==(1&_>>e);this.modules[e%3+this.moduleCount-8-3][Math.floor(e/3)]=r}},setupTypeInfo:function(t,_){for(var e=this.errorCorrectLevel<<3|_,r=h.getBCHTypeInfo(e),o=0;15>o;o++){var i=!t&&1==(1&r>>o);6>o?this.modules[o][8]=i:8>o?this.modules[o+1][8]=i:this.modules[this.moduleCount-15+o][8]=i}for(var o=0;15>o;o++){var i=!t&&1==(1&r>>o);8>o?this.modules[8][this.moduleCount-o-1]=i:9>o?this.modules[8][15-o-1+1]=i:this.modules[8][15-o-1]=i}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,_){for(var e=-1,r=this.moduleCount-1,o=7,i=0,n=this.moduleCount-1;n>0;n-=2)for(6==n&&n--;;){for(var a=0;2>a;a++)if(null==this.modules[r][n-a]){var s=!1;i<t.length&&(s=1==(1&t[i]>>>o)),h.getMask(_,r,n-a)&&(s=!s),this.modules[r][n-a]=s,-1==--o&&(i++,o=7)}if(0>(r+=e)||this.moduleCount<=r){r-=e,e=-e;break}}}},_.PAD0=236,_.PAD1=17,_.createData=function(t,e,i){for(var n=r.getRSBlocks(t,e),a=new o,s=0;s<i.length;s++){var $=i[s];a.put($.mode,4),a.put($.getLength(),h.getLengthInBits($.mode,t)),$.write(a)}for(var l=0,s=0;s<n.length;s++)l+=n[s].dataCount;if(a.getLengthInBits()>8*l)throw Error("code length overflow. ("+a.getLengthInBits()+">"+8*l+")");for(a.getLengthInBits()+4<=8*l&&a.put(0,4);0!=a.getLengthInBits()%8;)a.putBit(!1);for(;!(a.getLengthInBits()>=8*l)&&(a.put(_.PAD0,8),!(a.getLengthInBits()>=8*l));)a.put(_.PAD1,8);return _.createBytes(a,n)},_.createBytes=function(t,_){for(var r=0,o=0,i=0,n=Array(_.length),a=Array(_.length),s=0;s<_.length;s++){var $=_[s].dataCount,l=_[s].totalCount-$;o=Math.max(o,$),i=Math.max(i,l),n[s]=Array($);for(var u=0;u<n[s].length;u++)n[s][u]=255&t.buffer[u+r];r+=$;var f=h.getErrorCorrectPolynomial(l),g=new e(n[s],f.getLength()-1).mod(f);a[s]=Array(f.getLength()-1);for(var u=0;u<a[s].length;u++){var d=u+g.getLength()-a[s].length;a[s][u]=d>=0?g.get(d):0}}for(var c=0,u=0;u<_.length;u++)c+=_[u].totalCount;for(var p=Array(c),m=0,u=0;o>u;u++)for(var s=0;s<_.length;s++)u<n[s].length&&(p[m++]=n[s][u]);for(var u=0;i>u;u++)for(var s=0;s<_.length;s++)u<a[s].length&&(p[m++]=a[s][u]);return p};for(var n={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},a={L:1,M:0,Q:3,H:2},s={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},h={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var _=t<<10;h.getBCHDigit(_)-h.getBCHDigit(h.G15)>=0;)_^=h.G15<<h.getBCHDigit(_)-h.getBCHDigit(h.G15);return(t<<10|_)^h.G15_MASK},getBCHTypeNumber:function(t){for(var _=t<<12;h.getBCHDigit(_)-h.getBCHDigit(h.G18)>=0;)_^=h.G18<<h.getBCHDigit(_)-h.getBCHDigit(h.G18);return t<<12|_},getBCHDigit:function(t){for(var _=0;0!=t;)_++,t>>>=1;return _},getPatternPosition:function(t){return h.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,_,e){switch(t){case s.PATTERN000:return 0==(_+e)%2;case s.PATTERN001:return 0==_%2;case s.PATTERN010:return 0==e%3;case s.PATTERN011:return 0==(_+e)%3;case s.PATTERN100:return 0==(Math.floor(_/2)+Math.floor(e/3))%2;case s.PATTERN101:return 0==_*e%2+_*e%3;case s.PATTERN110:return 0==(_*e%2+_*e%3)%2;case s.PATTERN111:return 0==(_*e%3+(_+e)%2)%2;default:throw Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var _=new e([1],0),r=0;t>r;r++)_=_.multiply(new e([1,$.gexp(r)],0));return _},getLengthInBits:function(t,_){if(_>=1&&10>_)switch(t){case n.MODE_NUMBER:return 10;case n.MODE_ALPHA_NUM:return 9;case n.MODE_8BIT_BYTE:case n.MODE_KANJI:return 8;default:throw Error("mode:"+t)}else if(27>_)switch(t){case n.MODE_NUMBER:return 12;case n.MODE_ALPHA_NUM:return 11;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 10;default:throw Error("mode:"+t)}else{if(!(41>_))throw Error("type:"+_);switch(t){case n.MODE_NUMBER:return 14;case n.MODE_ALPHA_NUM:return 13;case n.MODE_8BIT_BYTE:return 16;case n.MODE_KANJI:return 12;default:throw Error("mode:"+t)}}},getLostPoint:function(t){for(var _=t.getModuleCount(),e=0,r=0;_>r;r++)for(var o=0;_>o;o++){for(var i=0,n=t.isDark(r,o),a=-1;1>=a;a++)if(!(0>r+a||r+a>=_))for(var s=-1;1>=s;s++)0>o+s||o+s>=_||(0!=a||0!=s)&&n==t.isDark(r+a,o+s)&&i++;i>5&&(e+=3+i-5)}for(var r=0;_-1>r;r++)for(var o=0;_-1>o;o++){var h=0;t.isDark(r,o)&&h++,t.isDark(r+1,o)&&h++,t.isDark(r,o+1)&&h++,t.isDark(r+1,o+1)&&h++,(0==h||4==h)&&(e+=3)}for(var r=0;_>r;r++)for(var o=0;_-6>o;o++)t.isDark(r,o)&&!t.isDark(r,o+1)&&t.isDark(r,o+2)&&t.isDark(r,o+3)&&t.isDark(r,o+4)&&!t.isDark(r,o+5)&&t.isDark(r,o+6)&&(e+=40);for(var o=0;_>o;o++)for(var r=0;_-6>r;r++)t.isDark(r,o)&&!t.isDark(r+1,o)&&t.isDark(r+2,o)&&t.isDark(r+3,o)&&t.isDark(r+4,o)&&!t.isDark(r+5,o)&&t.isDark(r+6,o)&&(e+=40);for(var $=0,o=0;_>o;o++)for(var r=0;_>r;r++)t.isDark(r,o)&&$++;return e+10*(Math.abs(100*$/_/_-50)/5)}},$={glog:function(t){if(1>t)throw Error("glog("+t+")");return $.LOG_TABLE[t]},gexp:function(t){for(;0>t;)t+=255;for(;t>=256;)t-=255;return $.EXP_TABLE[t]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},l=0;8>l;l++)$.EXP_TABLE[l]=1<<l;for(var l=8;256>l;l++)$.EXP_TABLE[l]=$.EXP_TABLE[l-4]^$.EXP_TABLE[l-5]^$.EXP_TABLE[l-6]^$.EXP_TABLE[l-8];for(var l=0;255>l;l++)$.LOG_TABLE[$.EXP_TABLE[l]]=l;e.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var _=Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var o=0;o<t.getLength();o++)_[r+o]^=$.gexp($.glog(this.get(r))+$.glog(t.get(o)));return new e(_,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var _=$.glog(this.get(0))-$.glog(t.get(0)),r=Array(this.getLength()),o=0;o<this.getLength();o++)r[o]=this.get(o);for(var o=0;o<t.getLength();o++)r[o]^=$.gexp($.glog(t.get(o))+_);return new e(r,0).mod(t)}},r.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r.getRSBlocks=function(t,_){var e=r.getRsBlockTable(t,_);if(void 0==e)throw Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+_);for(var o=e.length/3,i=[],n=0;o>n;n++)for(var a=e[3*n+0],s=e[3*n+1],h=e[3*n+2],$=0;a>$;$++)i.push(new r(s,h));return i},r.getRsBlockTable=function(t,_){switch(_){case a.L:return r.RS_BLOCK_TABLE[4*(t-1)+0];case a.M:return r.RS_BLOCK_TABLE[4*(t-1)+1];case a.Q:return r.RS_BLOCK_TABLE[4*(t-1)+2];case a.H:return r.RS_BLOCK_TABLE[4*(t-1)+3];default:return}},o.prototype={get:function(t){var _=Math.floor(t/8);return 1==(1&this.buffer[_]>>>7-t%8)},put:function(t,_){for(var e=0;_>e;e++)this.putBit(1==(1&t>>>_-e-1))},getLengthInBits:function(){return this.length},putBit:function(t){var _=Math.floor(this.length/8);this.buffer.length<=_&&this.buffer.push(0),t&&(this.buffer[_]|=128>>>this.length%8),this.length++}};var u,f,g=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],d=((u=function(t,_){this._el=t,this._htOption=_}).prototype.draw=function(t){function _(t,_){var e=document.createElementNS("http://www.w3.org/2000/svg",t);for(var r in _)_.hasOwnProperty(r)&&e.setAttribute(r,_[r]);return e}var e=this._htOption,r=this._el,o=t.getModuleCount();e.width,e.height,this.clear();var i=_("svg",{viewBox:"0 0 "+String(o)+" "+String(o),width:"100%",height:"100%",fill:e.colorLight});i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),r.appendChild(i),i.appendChild(_("rect",{fill:e.colorDark,width:"1",height:"1",id:"template"}));for(var n=0;o>n;n++)for(var a=0;o>a;a++)if(t.isDark(n,a)){var s=_("use",{x:String(n),y:String(a)});s.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),i.appendChild(s)}},u.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},u),c="svg"===document.documentElement.tagName.toLowerCase()?d:"undefined"!=typeof CanvasRenderingContext2D?function(){function t(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function _(t,_){var e=this;if(e._fFail=_,e._fSuccess=t,null===e._bSupportDataURI){var r=document.createElement("img"),o=function(){e._bSupportDataURI=!1,e._fFail&&_fFail.call(e)},i=function(){e._bSupportDataURI=!0,e._fSuccess&&e._fSuccess.call(e)};return r.onabort=o,r.onerror=o,r.onload=i,void(r.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")}!0===e._bSupportDataURI&&e._fSuccess?e._fSuccess.call(e):!1===e._bSupportDataURI&&e._fFail&&e._fFail.call(e)}if(this._android&&this._android<=2.1){var e=1/window.devicePixelRatio,r=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(t,_,o,i,n,a,s,h){if("nodeName"in t&&/img/i.test(t.nodeName))for(var $=arguments.length-1;$>=1;$--)arguments[$]=arguments[$]*e;else void 0===h&&(arguments[1]*=e,arguments[2]*=e,arguments[3]*=e,arguments[4]*=e);r.apply(this,arguments)}}var o=function(t,_){this._bIsPainted=!1,this._android=i(),this._htOption=_,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=_.width,this._elCanvas.height=_.height,t.appendChild(this._elCanvas),this._el=t,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return o.prototype.draw=function(t){var _=this._elImage,e=this._oContext,r=this._htOption,o=t.getModuleCount(),i=r.width/o,n=r.height/o,a=Math.round(i),s=Math.round(n);_.style.display="none",this.clear();for(var h=0;o>h;h++)for(var $=0;o>$;$++){var l=t.isDark(h,$),u=$*i,f=h*n;e.strokeStyle=l?r.colorDark:r.colorLight,e.lineWidth=1,e.fillStyle=l?r.colorDark:r.colorLight,e.fillRect(u,f,i,n),e.strokeRect(Math.floor(u)+.5,Math.floor(f)+.5,a,s),e.strokeRect(Math.ceil(u)-.5,Math.ceil(f)-.5,a,s)}this._bIsPainted=!0},o.prototype.makeImage=function(){this._bIsPainted&&_.call(this,t)},o.prototype.isPainted=function(){return this._bIsPainted},o.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},o.prototype.round=function(t){return t?Math.floor(1e3*t)/1e3:t},o}():((f=function(t,_){this._el=t,this._htOption=_}).prototype.draw=function(t){for(var _=this._htOption,e=this._el,r=t.getModuleCount(),o=Math.floor(_.width/r),i=Math.floor(_.height/r),n=['<table style="border:0;border-collapse:collapse;">'],a=0;r>a;a++){n.push("<tr>");for(var s=0;r>s;s++)n.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:'+o+"px;height:"+i+"px;background-color:"+(t.isDark(a,s)?_.colorDark:_.colorLight)+';"></td>');n.push("</tr>")}n.push("</table>"),e.innerHTML=n.join("");var h=e.childNodes[0],$=(_.width-h.offsetWidth)/2,l=(_.height-h.offsetHeight)/2;$>0&&l>0&&(h.style.margin=l+"px "+$+"px")},f.prototype.clear=function(){this._el.innerHTML=""},f);(QRCode=function(t,_){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:a.H},"string"==typeof _&&(_={text:_}),_)for(var e in _)this._htOption[e]=_[e];"string"==typeof t&&(t=document.getElementById(t)),this._android=i(),this._el=t,this._oQRCode=null,this._oDrawing=new c(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)}).prototype.makeCode=function(t){this._oQRCode=new _(function t(_,e){for(var r,o,i=1,n=(r=_,o=encodeURI(r).toString().replace(/\%[0-9a-fA-F]{2}/g,"a"),o.length+(o.length!=r?3:0)),s=0,h=g.length;h>=s;s++){var $=0;switch(e){case a.L:$=g[s][0];break;case a.M:$=g[s][1];break;case a.Q:$=g[s][2];break;case a.H:$=g[s][3]}if($>=n)break;i++}if(i>g.length)throw Error("Too long data");return i}(t,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(t),this._oQRCode.make(),this._el.title=t,this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCode.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCode.prototype.clear=function(){this._oDrawing.clear()},QRCode.CorrectLevel=a}();</script>
<script type="text/javascript">
  var string = { qrImageAlt: {{ 'gift_cards.issued.qr_image_alt' | t | json }} };
  var template = document.getElementsByTagName("template")[0],
  clonedTemplate = template.content.cloneNode(true);
  makeCode();
  copyGift();

  if (Shopify.designMode) {
    document.addEventListener('shopify:section:select', (event) => {
      makeCode();
      copyGift();
    })
  }
  function makeCode () {
    document.querySelector('.hdt-gift-card__qr-code').innerHTML = '';
    return new QRCode( document.querySelector('.hdt-gift-card__qr-code'), {
      text: document.querySelector('.hdt-gift-card__qr-code').dataset.identifier,
      width: 126,
      height: 126,
      imageAltText: string.qrImageAlt
    });
  }
  function copyGift(){
    var isMessageDisplayed = false;
    document.querySelector('.hdt-gift-card__copy-button').addEventListener('click', () => {
      var textarea = document.createElement("textarea");
      textarea.value = document.getElementById('hdt-gift-card-code').innerText;
      document.body.appendChild(textarea);

      textarea.select();
      document.execCommand("copy");

      document.body.removeChild(textarea);
      if (!isMessageDisplayed) {
        document.querySelector('.hdt-gift-card__copy-success').appendChild(clonedTemplate);
        isMessageDisplayed = true
      }
    });
  }
</script>
