;; rehab-resort-og

(impl-trait 'SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait.nft-trait)

(define-non-fungible-token rehab-resort-og uint)

;; Constants
(define-constant DEPLOYER tx-sender)
(define-constant COMM u1000)
(define-constant COMM-ADDR 'SPNWZ5V2TPWGQGVDR6T7B6RQ4XMGZ4PXTEE0VQ0S)

(define-constant ERR-NO-MORE-NFTS u100)
(define-constant ERR-NOT-ENOUGH-PASSES u101)
(define-constant ERR-PUBLIC-SALE-DISABLED u102)
(define-constant ERR-CONTRACT-INITIALIZED u103)
(define-constant ERR-NOT-AUTHORIZED u104)
(define-constant ERR-INVALID-USER u105)
(define-constant ERR-LISTING u106)
(define-constant ERR-WRONG-COMMISSION u107)
(define-constant ERR-NOT-FOUND u108)
(define-constant ERR-PAUSED u109)
(define-constant ERR-MINT-LIMIT u110)
(define-constant ERR-METADATA-FROZEN u111)
(define-constant ERR-AIRDROP-CALLED u112)
(define-constant ERR-NO-MORE-MINTS u113)

;; Internal variables
(define-data-var mint-limit uint u10)
(define-data-var last-id uint u1)
(define-data-var total-price uint u50000000)
(define-data-var artist-address principal 'SP2SE1WTDPJEJ417SJEJPG31QBP1W3SD9CGB4759A)
(define-data-var ipfs-root (string-ascii 80) "ipfs://ipfs/QmQ2TjYsX6bazDP9vKN8eGvWN84eBP9UErVX1bY3s92Fej/json/")
(define-data-var mint-paused bool false)
(define-data-var og-premint-enabled bool false)
(define-data-var wl-premint-enabled bool false)
(define-data-var sale-enabled bool false)
(define-data-var metadata-frozen bool false)
(define-data-var airdrop-called bool false)
(define-data-var mint-cap uint u0)

(define-map mints-per-user principal uint)
(define-map og-mint-passes principal uint)
(define-map wl-mint-passes principal uint)

(define-public (claim) 
  (mint (list true)))

(define-public (claim-three) (mint (list true true true)))

(define-public (claim-five) (mint (list true true true true true)))

;; Mintpass Minting
(define-private (mint (orders (list 25 bool)))
  (let 
    (
      (passes (get-passes tx-sender))
    )
    (if (var-get og-premint-enabled)
      (begin
        (asserts! (>= passes (len orders)) (err ERR-NOT-ENOUGH-PASSES))
        (map-set og-mint-passes tx-sender (- passes (len orders)))
        (mint-many orders)
      )
      (if (var-get wl-premint-enabled)
        (begin
          (asserts! (>= passes (len orders)) (err ERR-NOT-ENOUGH-PASSES))
          (map-set wl-mint-passes tx-sender (- passes (len orders)))
          (map-set og-mint-passes tx-sender (- passes (len orders)))
          (mint-many orders)
        )
        (begin
          (asserts! (var-get sale-enabled) (err ERR-PUBLIC-SALE-DISABLED))
          (mint-many orders)
        )
      )
    )))

(define-private (mint-many (orders (list 25 bool )))  
  (let 
    (
      (last-nft-id (var-get last-id))
      (enabled (asserts! (<= last-nft-id (var-get mint-limit)) (err ERR-NO-MORE-NFTS)))
      (art-addr (var-get artist-address))
      (id-reached (fold mint-many-iter orders last-nft-id))
      (price (* (var-get total-price) (- id-reached last-nft-id)))
      (total-commission (/ (* price COMM) u10000))
      (current-balance (get-balance tx-sender))
      (total-artist (- price total-commission))
      (capped (> (var-get mint-cap) u0))
      (user-mints (get-mints tx-sender))
    )
    (asserts! (or (is-eq false (var-get mint-paused)) (is-eq tx-sender DEPLOYER)) (err ERR-PAUSED))
    (asserts! (or (not capped) (is-eq tx-sender DEPLOYER) (is-eq tx-sender art-addr) (>= (var-get mint-cap) (+ (len orders) user-mints))) (err ERR-NO-MORE-MINTS))
    (map-set mints-per-user tx-sender (+ (len orders) user-mints))
    (if (or (is-eq tx-sender art-addr) (is-eq tx-sender DEPLOYER) (is-eq (var-get total-price) u0000000))
      (begin
        (var-set last-id id-reached)
        (map-set token-count tx-sender (+ current-balance (- id-reached last-nft-id)))
      )
      (begin
        (var-set last-id id-reached)
        (map-set token-count tx-sender (+ current-balance (- id-reached last-nft-id)))
        (try! (stx-transfer? total-artist tx-sender (var-get artist-address)))
        (try! (stx-transfer? total-commission tx-sender COMM-ADDR))
      )    
    )
    (ok id-reached)))

(define-private (mint-many-iter (ignore bool) (next-id uint))
  (if (<= next-id (var-get mint-limit))
    (begin
      (unwrap! (nft-mint? rehab-resort-og next-id tx-sender) next-id)
      (+ next-id u1)    
    )
    next-id))

(define-public (set-artist-address (address principal))
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-INVALID-USER))
    (ok (var-set artist-address address))))

(define-public (set-price (price uint))
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-INVALID-USER))
    (ok (var-set total-price price))))

(define-public (toggle-pause)
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-INVALID-USER))
    (ok (var-set mint-paused (not (var-get mint-paused))))))

(define-public (set-mint-limit (limit uint))
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-INVALID-USER))
    (ok (var-set mint-limit limit))))

(define-public (burn (token-id uint))
  (begin 
    (asserts! (is-owner token-id tx-sender) (err ERR-NOT-AUTHORIZED))
    (nft-burn? rehab-resort-og token-id tx-sender)))

(define-private (is-owner (token-id uint) (user principal))
    (is-eq user (unwrap! (nft-get-owner? rehab-resort-og token-id) false)))

(define-public (set-base-uri (new-base-uri (string-ascii 80)))
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-NOT-AUTHORIZED))
    (asserts! (not (var-get metadata-frozen)) (err ERR-METADATA-FROZEN))
    (var-set ipfs-root new-base-uri)
    (ok true)))

(define-public (freeze-metadata)
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-NOT-AUTHORIZED))
    (var-set metadata-frozen true)
    (ok true)))

;; Non-custodial SIP-009 transfer function
(define-public (transfer (id uint) (sender principal) (recipient principal))
  (begin
    (asserts! (is-eq tx-sender sender) (err ERR-NOT-AUTHORIZED))
    (asserts! (is-none (map-get? market id)) (err ERR-LISTING))
    (trnsfr id sender recipient)))

;; read-only functions
(define-read-only (get-owner (token-id uint))
  (ok (nft-get-owner? rehab-resort-og token-id)))

(define-read-only (get-last-token-id)
  (ok (- (var-get last-id) u1)))

(define-read-only (get-token-uri (token-id uint))
  (ok (some (concat (concat (var-get ipfs-root) "{id}") ".json"))))

(define-read-only (get-paused)
  (ok (var-get mint-paused)))

(define-read-only (get-price)
  (ok (var-get total-price)))

(define-read-only (get-mints (caller principal))
  (default-to u0 (map-get? mints-per-user caller)))

(define-read-only (get-mint-limit)
  (ok (var-get mint-limit)))

;; Non-custodial marketplace extras
(define-trait commission-trait
  ((pay (uint uint) (response bool uint))))

(define-map token-count principal uint)
(define-map market uint {price: uint, commission: principal})

(define-read-only (get-balance (account principal))
  (default-to u0
    (map-get? token-count account)))

(define-private (trnsfr (id uint) (sender principal) (recipient principal))
  (match (nft-transfer? rehab-resort-og id sender recipient)
    success
      (let
        ((sender-balance (get-balance sender))
        (recipient-balance (get-balance recipient)))
          (map-set token-count
            sender
            (- sender-balance u1))
          (map-set token-count
            recipient
            (+ recipient-balance u1))
          (ok success))
    error (err error)))

(define-private (is-sender-owner (id uint))
  (let ((owner (unwrap! (nft-get-owner? rehab-resort-og id) false)))
    (or (is-eq tx-sender owner) (is-eq contract-caller owner))))

(define-read-only (get-listing-in-ustx (id uint))
  (map-get? market id))

(define-public (list-in-ustx (id uint) (price uint) (comm-trait <commission-trait>))
  (let ((listing  {price: price, commission: (contract-of comm-trait)}))
    (asserts! (is-sender-owner id) (err ERR-NOT-AUTHORIZED))
    (map-set market id listing)
    (print (merge listing {a: "list-in-ustx", id: id}))
    (ok true)))

(define-public (unlist-in-ustx (id uint))
  (begin
    (asserts! (is-sender-owner id) (err ERR-NOT-AUTHORIZED))
    (map-delete market id)
    (print {a: "unlist-in-ustx", id: id})
    (ok true)))

(define-public (buy-in-ustx (id uint) (comm-trait <commission-trait>))
  (let ((owner (unwrap! (nft-get-owner? rehab-resort-og id) (err ERR-NOT-FOUND)))
      (listing (unwrap! (map-get? market id) (err ERR-LISTING)))
      (price (get price listing)))
    (asserts! (is-eq (contract-of comm-trait) (get commission listing)) (err ERR-WRONG-COMMISSION))
    (try! (stx-transfer? price tx-sender owner))
    (try! (contract-call? comm-trait pay id price))
    (try! (trnsfr id owner tx-sender))
    (map-delete market id)
    (print {a: "buy-in-ustx", id: id})
    (ok true)))

;; Extra functionality required for mintpass
(define-public (toggle-sale-state)
  (let 
    (
      (sale (not (var-get sale-enabled)))
    )
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-NOT-AUTHORIZED))
    (var-set og-premint-enabled false)
    (var-set wl-premint-enabled false)
    (var-set sale-enabled sale)
    (print { sale: sale })
    (ok true)))

(define-public (enable-og-premint)
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-NOT-AUTHORIZED))
    (var-set wl-premint-enabled false)
    (ok (var-set og-premint-enabled true))))

(define-public (enable-wl-premint)
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-NOT-AUTHORIZED))
    (var-set og-premint-enabled false)
    (ok (var-set wl-premint-enabled true))))

(define-public (disable-premint)
  (begin
    (asserts! (or (is-eq tx-sender (var-get artist-address)) (is-eq tx-sender DEPLOYER)) (err ERR-NOT-AUTHORIZED))
    (ok (and (var-set wl-premint-enabled false) (var-set og-premint-enabled false)))
))

(define-read-only (get-passes (caller principal))
  (let (
    (og-mints (default-to u0 (map-get? og-mint-passes caller)))
    (wl-mints (default-to u0 (map-get? wl-mint-passes caller)))
  )
  (if (var-get og-premint-enabled) og-mints (+ og-mints wl-mints))))

(define-read-only (get-premint-enabled)
  (ok (or (var-get og-premint-enabled) (var-get wl-premint-enabled))))

(define-read-only (get-sale-enabled)
  (ok (var-get sale-enabled)))

(map-set og-mint-passes 'SP1B7FFVFHHBCB466DVJR02BQ7PS9TNW02YA29DR3 u1)
(map-set og-mint-passes 'SP1CCC68DRYZZKMPAZPWKE3VP2R7YSVN9DZJG86Y8 u1)
(map-set og-mint-passes 'SP1K8RG4PV202FHT8J9023G1WJRPFTSZXN9TPNEJX u1)
(map-set og-mint-passes 'SP1YT6QRRHPGJVDKQY89MSGGFHYAETD4FKVTBRH1P u1)
(map-set og-mint-passes 'SP1QJHD37YHVR01F2YY7Z4A9DY5SPJYA2T1TNMJR2 u1)
(map-set og-mint-passes 'SP2KJC2WBNJPGVRB0GG30666PQW96MAKH7YWGPWB0 u1)
(map-set og-mint-passes 'SP25HAV8ZKNE8B7QCT1FPKPD8JQF2KK06VKQE6JSE u1)
(map-set og-mint-passes 'SPMWVJWPNA60MSNF14PR9C0G65GCDM4GXDH8CJE5 u1)
(map-set og-mint-passes 'SP3HYFVG35TW1RF47N6RKYYDNPX6T47J6ZJB3B4PE u1)
(map-set og-mint-passes 'SPYWT3H4JQG72G0PVZW4E2M6FAK997KN6PDC26GM u1)
(map-set og-mint-passes 'SP18WRH4SF7F1M5QZZ2BQDZZYBCJWT9VWQMDSTFY5 u1)
(map-set og-mint-passes 'SP2EJMPGZKE983KP58VRZZVTYV6Q99HHZ0WYEKGZR u1)
(map-set og-mint-passes 'SPQ26P6MFYC1C59YM4GKWYV3S84CK2Q5ZER7DW60 u1)
(map-set og-mint-passes 'SP1KWCYXS5N2C0CWDBXFJWRXXWVGVPDBG008Q1C6D u1)
(map-set og-mint-passes 'SP3XM3WZDJ6YGA5ANTSABJ6XRFPST7Y2C5KH0Z1W5 u1)
(map-set og-mint-passes 'SP30KD0JV9B3XX6DSPXSH90J621R7VBSSY2GNBC26 u1)
(map-set og-mint-passes 'SP2MG753Q0B9HGCS9BMJEH1C1N8BVBXSK7B5KCTAN u1)
(map-set og-mint-passes 'SPDXC0NM3YQDHV1HN3V9P5Y4P26QWY709NB86EYB u1)
(map-set og-mint-passes 'SP2EQXAKMCK9H3RBG5W26BVTCY46RVHJFH9VBPE7R u1)
(map-set og-mint-passes 'SP9J6BTSPCXGQ5HC066NRYQPK43S48V7K299PTQX u1)
(map-set og-mint-passes 'SP6K8CTMC52XBCNG9TRCF3JBE76S2BFYS985DANQ u1)
(map-set og-mint-passes 'SP3R04S6DNK9GPETVWT954KZVJXGKGNJ2A5XRNQQY u1)
(map-set og-mint-passes 'SP2Q1SZSETS27AZ9FE0BH6C6B7MVC25E4N6C2VE7D u1)
(map-set og-mint-passes 'SP1CMFJW9J8WN7R2XJ26AC90AARGW68R1CWNYDANC u1)
(map-set og-mint-passes 'SP3G9BMCJ0858Y68MM35R6HA0WAZDNYXWZBN4RYK1 u1)
(map-set og-mint-passes 'SP23X8JVMHN2A9N1PWSGNW83Q0VV5T7NF2N6PJW9J u1)
(map-set og-mint-passes 'SP2W0KJMJB2601KK53Y7F8W9FV5YJ1QVCT0GBJHTA u1)
(map-set og-mint-passes 'SP1J4SFHSMMT5Z0PG3WDD1TNGZVCWMB5QBYHNFECG u1)
(map-set og-mint-passes 'SPV00QHST52GD7D0SEWV3R5N04RD4Q1PMA3TE2MP u1)
(map-set og-mint-passes 'SPTETNN57BDV0X796ZVW41B5VVN99JQRDH68Z5W6 u1)
(map-set og-mint-passes 'SPPKV3KBDQRZ6JJK2VWB2JKTXHVYF40J253TY20B u1)
(map-set og-mint-passes 'SP3TYX5H6CRETTYFZ6578KJ6M55V950D3YN4K97S2 u1)
(map-set og-mint-passes 'SP3BT9XA6A4E46KKHYBV09N271C8NQ70ZHGWW9WCD u1)
(map-set og-mint-passes 'SP2DW9RTN82J2MR2FHQXY5EE0Y616JJ076RYG8PTY u1)
(map-set og-mint-passes 'SP2R3CHRAP1HE4M64X1NZXHZT41JG3XGNHJW4HX2W u1)
(map-set og-mint-passes 'SP3YSS74QDCSHYJCEQ69559T3YMRRWT4FXK1XBF6Z u1)
(map-set og-mint-passes 'SPDAV1G8FQ0TMEWKVE0A9WS8RNDJ7K808X2MY22E u1)
(map-set og-mint-passes 'SP27A09VG1SH1J8Z76NXHBGKB0ZWSBZ99DRGAC8NB u1)
(map-set og-mint-passes 'SPF4FR0X9Q4PAF6KENDD3NVAGQTM8A830A4F96YG u1)
(map-set og-mint-passes 'SPQ2HN9TYF8ZYY9D3G45NGYA9GHA6QZHQ8AXF5QM u1)
(map-set og-mint-passes 'SP3MQAQ3ZSF1GM1ZSPGTP6H3W5BDNHNWK4W18M625 u1)
(map-set og-mint-passes 'SP5CQR0EPFKM8WET982GNG3GJF59K7CBFBF4S71G u1)
(map-set og-mint-passes 'SP27P4FECZXC2TXPS24C1CCTNKB0K1JEK3SZK7CB u1)
(map-set og-mint-passes 'SP0CW9AB35MW3EXKG35N1ZG563GZFXW1PYMPKGNE u1)
(map-set og-mint-passes 'SP37N35P4903CB8S91SHHYYQ3Q44Q3HCJSBP8DCVF u1)
(map-set og-mint-passes 'SP3K22XKPT9WJFCE957J94J6XXVZHP7747YNPDTFD u1)
(map-set og-mint-passes 'SP690PDD045XTP8Y10MQZJT3S5W9DPGWQJ4P3X4P u1)
(map-set og-mint-passes 'SPQJN9008GBDXCPVS2CZSPXAPYV8251GZX1GX64R u1)
(map-set og-mint-passes 'SP329G766AV8Z01X9EEAHPDQ4WDJXT2A0XB383MGP u1)
(map-set og-mint-passes 'SP17NZ4FXJAKJYM3976YT216ZTJVMJ6XACRB089XH u1)
(map-set og-mint-passes 'SP3EYT7KF5ERWQFTWW3SWHS8QRYBNSMRZ7JW73YXR u1)
(map-set og-mint-passes 'SPX0FKCZ2QNS7AWYT95HQ89S1YGEEY89AYG8ASZ4 u1)
(map-set og-mint-passes 'SP2HK7J6617VBSKXQGZWMXP2R64MMDX3S54M0S1Q6 u1)
(map-set og-mint-passes 'SP1WY2NB1DXCV4K2H5H88D4G1QNKKZ3VZ398CET8G u1)
(map-set og-mint-passes 'SP35MEYYBHSFCFXY296YGP7NAT6Y4XBJW2VETR8AV u1)
(map-set og-mint-passes 'SP1HZ3M9D4F19D80HZC66R93XKQ18PRT70KYFCF8A u1)
(map-set og-mint-passes 'SP3TZ3BCB16A0W0PPFYMGTTWTT3DVWTQEP8DFRAG1 u1)
(map-set og-mint-passes 'SP2HV9HYWZRAPTCC10VXCK72P3W4F9NDB8E1HBEZH u1)
(map-set og-mint-passes 'SP2HVP68NY5BD2RDFX0JNXSYRS8AA6R7S30N08NJZ u1)
(map-set og-mint-passes 'SP779SC9CDWQVMTRXT0HZCEHSDBXCHNGG7BC1H9B u1)
(map-set og-mint-passes 'SP38Z9JA0Q1ZXBN3DPH9SD9AN8RE2MMPZV8D2DVX u1)
(map-set og-mint-passes 'SP265DNHNK1NHX7FE9MZKCCA4G1VS7TT3BMES5TR u1)
(map-set og-mint-passes 'SPYAX2RNZA18KQA8Y0S5G393QBE8SWPNZ6R08XNH u1)
(map-set og-mint-passes 'SP2KJC2WBNJPGVRB0GG30666PQW96MAKH7YWGPWB0 u1)
(map-set og-mint-passes 'SP16VFAB98FZ3GEM00SYYRV1V7J87JXZERWR9FQ6Y u1)

(map-set wl-mint-passes 'SP3R2PCDYP8DA38P3SH7K67Q626T45FDMSNFDZR9V u1)
(map-set wl-mint-passes 'SP25GGWDPFJ7WCGC6YB5ZSX2C4DBP4V74R386AX69 u1)
(map-set wl-mint-passes 'SP32DFA3HXYZ2BV3P8H6XQM8EN94D2212QM71BRYG u1)
(map-set wl-mint-passes 'SP12A8MDDGGW4TPVX392GNHG34CN61ETJ1RZDE6WG u1)
(map-set wl-mint-passes 'SP38REZNW2QD8CSSQ3PZKWJZ84TTBTXDJDD20GKW4 u1)
(map-set wl-mint-passes 'SP3EQ7FQ8TFXB792P7VAGRXER0YNFMGM1Y8RS69RC u1)
(map-set wl-mint-passes 'SP3ZTYBN9PYVVFKBEFVSZ2BEGK3HXRNVP6FDG79WV u1)
(map-set wl-mint-passes 'SP2BS1YY80GGWKA0PFHXWXH2NQHFTCZ600HDH8BR5 u1)
(map-set wl-mint-passes 'SP2CZMH9A6FH5QPAJAR8ZG091Z15JKAGY1X0F3EJ0 u1)
(map-set wl-mint-passes 'SP1PCEAP62X5BZSMH257ZHAPGAPSX3BDT3TDVCN4M u1)
(map-set wl-mint-passes 'SP3S235BVRBYBAVVS5ASPGS3CB2G93S2QM1DJ6M4K u1)
(map-set wl-mint-passes 'SP1CCC68DRYZZKMPAZPWKE3VP2R7YSVN9DZJG86Y8 u1)
(map-set wl-mint-passes 'SP398XE371G08T84A99TCBD8XKWY3S7VVX6JKJWKY u1)
(map-set wl-mint-passes 'SP2RWS7D7RW6DDZCTXJC0VTK86CKD0TF445116V8A u1)
(map-set wl-mint-passes 'SP2M5YGRBM1WD9PNFCS0SX2S15PAVEGN9B8VAAR0J u1)
(map-set wl-mint-passes 'SP1K8RG4PV202FHT8J9023G1WJRPFTSZXN9TPNEJX u1)
(map-set wl-mint-passes 'SPSS7WAYA17Y8Z5Q6GJTMH4FH4MRJ7HZZ6JPGAGR u1)
(map-set wl-mint-passes 'SPS6543QSVCWM0B1CQYD67RV4QP3MGFPJEHG4FHS u1)
(map-set wl-mint-passes 'SP3S5XN50S5TQF045P30JQBDJ3K19DFCC1P98X4J1 u1)
(map-set wl-mint-passes 'SP1QJHD37YHVR01F2YY7Z4A9DY5SPJYA2T1TNMJR2 u1)
(map-set wl-mint-passes 'SP2KJC2WBNJPGVRB0GG30666PQW96MAKH7YWGPWB0 u1)
(map-set wl-mint-passes 'SP25HAV8ZKNE8B7QCT1FPKPD8JQF2KK06VKQE6JSE u1)
(map-set wl-mint-passes 'SP9XD6041FFN5BW6ZR9J3FSESR4S442JPYZJVXBW u1)
(map-set wl-mint-passes 'SP19KPWZDPBD13N07C7Q1BENQMEPRTNA6J6ACBJB3 u1)
(map-set wl-mint-passes 'SPMWVJWPNA60MSNF14PR9C0G65GCDM4GXDH8CJE5 u1)
(map-set wl-mint-passes 'SP3HYFVG35TW1RF47N6RKYYDNPX6T47J6ZJB3B4PE u1)
(map-set wl-mint-passes 'SPYWT3H4JQG72G0PVZW4E2M6FAK997KN6PDC26GM u1)
(map-set wl-mint-passes 'SPN8ZJW7PXA5NGHJND77Q52CAG0WEW747BWXTXTH u1)
(map-set wl-mint-passes 'SP223QGRP81XNHPJKCYNR3X3QWF3ZG799TZ9PYXFS u1)
(map-set wl-mint-passes 'SP11BM4N515NM88M87WWCB74RV739VWNH11D6E3JC u1)
(map-set wl-mint-passes 'SP2RTAF93N1X140RJH9SD66V7EQAWRC7M0EC1ZYFE u1)
(map-set wl-mint-passes 'SP18WRH4SF7F1M5QZZ2BQDZZYBCJWT9VWQMDSTFY5 u1)
(map-set wl-mint-passes 'SP2PJZBF432ZNW05R7PAGQF7MDKERMMSNNM1VFT2H u1)
(map-set wl-mint-passes 'SP3RZ1J989HT2TFVQ81WDXFX3RYZ3WNCZVDY1Z7PG u1)
(map-set wl-mint-passes 'SP1GYWMYK320ASBBAERSC40TA3PA99ZHV3GF256T8 u1)
(map-set wl-mint-passes 'SP17PTWQQTAYMRPXGBPASYH0EJGX158BR6G7HQBVN u1)
(map-set wl-mint-passes 'SPT2R1YCF5CKYFVGBGJB8NJHW0ACTRQ2RPQPCD1M u1)
(map-set wl-mint-passes 'SPQ26P6MFYC1C59YM4GKWYV3S84CK2Q5ZER7DW60 u1)
(map-set wl-mint-passes 'SP1KWCYXS5N2C0CWDBXFJWRXXWVGVPDBG008Q1C6D u1)
(map-set wl-mint-passes 'SP3XM3WZDJ6YGA5ANTSABJ6XRFPST7Y2C5KH0Z1W5 u1)
(map-set wl-mint-passes 'SP35TW1P6V9H3GE0SVQ4JFY3Z6YN8XJT6V9Z9KRM9 u1)
(map-set wl-mint-passes 'SP213BHFYJ54M0R7C84MHN04JYJYE4V363XRHXKHD u1)
(map-set wl-mint-passes 'SPWQQVGCW8Q7AC1MF1WWA4T0GGQPWQXMHWTQ31KS u1)
(map-set wl-mint-passes 'SP30KD0JV9B3XX6DSPXSH90J621R7VBSSY2GNBC26 u1)
(map-set wl-mint-passes 'SPDXC0NM3YQDHV1HN3V9P5Y4P26QWY709NB86EYB u1)
(map-set wl-mint-passes 'SPJRW4D4JACQQQQ5DK09P1K7M2TE8PGZJ638HCW1 u1)
(map-set wl-mint-passes 'SP2F2KH0RVX6GF1Y9FWMMSR9RHG0TW3NN72D724NX u1)
(map-set wl-mint-passes 'SP3C5ECA2QFB2XF6BTBY3Z006NVTDKNHJM1NTMQT u1)
(map-set wl-mint-passes 'SP3766HJFN7ZRB6708Y2EZ367H4M3PWBJTNVCYV6G u1)
(map-set wl-mint-passes 'SP1FR2M102H4DE4DH96R4D29RC8AGQZG5D5Y4S7CH u1)
(map-set wl-mint-passes 'SP3CES9R2SAE5MMB5A8ADK3TPRTYCXJZ9WTFJ5ZA3 u1)
(map-set wl-mint-passes 'SP22K0WRRKXY1GK91Y7JAR19XBQ6H6RDG6XSW696C u1)
(map-set wl-mint-passes 'SP1BSM0HS0WPJXMWPR5S1N21WQZRDTH1Y46BYQXMQ u1)
(map-set wl-mint-passes 'SP33QBZQF9CZYDQTA7A5SADQA47J7FBC00G5Z85CD u1)
(map-set wl-mint-passes 'SP3R04S6DNK9GPETVWT954KZVJXGKGNJ2A5XRNQQY u1)
(map-set wl-mint-passes 'SP2Q1SZSETS27AZ9FE0BH6C6B7MVC25E4N6C2VE7D u1)
(map-set wl-mint-passes 'SP3G9BMCJ0858Y68MM35R6HA0WAZDNYXWZBN4RYK1 u1)
(map-set wl-mint-passes 'SP23X8JVMHN2A9N1PWSGNW83Q0VV5T7NF2N6PJW9J u1)
(map-set wl-mint-passes 'SP1B8CHAEDJH87WCC78K8BZ1DF4DJG0DTG3FCMSQB u1)
(map-set wl-mint-passes 'SP3P8M5J25457Q73MKS8EGD5Z19Z57RKYSPNEAK85 u1)
(map-set wl-mint-passes 'SP1VCG4HXMG02BMJCSAZDBS1WR4N2YG3RPHMNP9WR u1)
(map-set wl-mint-passes 'SP17D8VXMW81SR9R9JK986HB0DESVRD2D24XWKZ3J u1)
(map-set wl-mint-passes 'SPGM4RBXP6GM6M2FDCPVZYCKPK1FXYH1767XR7FC u1)
(map-set wl-mint-passes 'SP26C9TWJYK6DTCD4T6HKBC76DPMK2DXXRNWS3E2D u1)
(map-set wl-mint-passes 'SPV00QHST52GD7D0SEWV3R5N04RD4Q1PMA3TE2MP u1)
(map-set wl-mint-passes 'SP12986AR4WZP2KF9FRJ55KYRZDGNJNZV5G9Y0XH4 u1)
(map-set wl-mint-passes 'SPFK6E20DN1PFBY02956QN23TCWSPHMY76KYWGEZ u1)
(map-set wl-mint-passes 'SP2BZQ48MADDN62X044NNJCNXF5BA33C3BFQ3TZJW u1)
(map-set wl-mint-passes 'SPTETNN57BDV0X796ZVW41B5VVN99JQRDH68Z5W6 u1)
(map-set wl-mint-passes 'SPPKV3KBDQRZ6JJK2VWB2JKTXHVYF40J253TY20B u1)
(map-set wl-mint-passes 'SP35BMHFQCR0ZXPX9VZ4HB9YRFR64N7KCSSZC4TE2 u1)
(map-set wl-mint-passes 'SP2A4R43TCNHZ19AKK44WEBP4R16X7DV4093GQ0X4 u1)
(map-set wl-mint-passes 'SP3TYX5H6CRETTYFZ6578KJ6M55V950D3YN4K97S2 u1)
(map-set wl-mint-passes 'SP2ZGVSV6JDJ6SCGJETE3ZT0PNRSB90FM01P830D4 u1)
(map-set wl-mint-passes 'SP5QBKZJM7MKJ0TN4XBH0N80SY3X90JFMJX73HY9 u1)
(map-set wl-mint-passes 'SP2R3CHRAP1HE4M64X1NZXHZT41JG3XGNHJW4HX2W u1)
(map-set wl-mint-passes 'SPDAV1G8FQ0TMEWKVE0A9WS8RNDJ7K808X2MY22E u1)
(map-set wl-mint-passes 'SP162D87CY84QVVCMJKNKGHC7GGXFGA0TAR9D0XJW u1)
(map-set wl-mint-passes 'SP27A09VG1SH1J8Z76NXHBGKB0ZWSBZ99DRGAC8NB u1)
(map-set wl-mint-passes 'SP134377BE00PYV1N2D5VSKTZ7P8PS2932KK5PGRQ u1)
(map-set wl-mint-passes 'SPF4FR0X9Q4PAF6KENDD3NVAGQTM8A830A4F96YG u1)
(map-set wl-mint-passes 'SP3CRGM0QHHD36B57FXZW60EQS7NM6XJK8WC7T34S u1)
(map-set wl-mint-passes 'SP1GYWMYK320ASBBAERSC40TA3PA99ZHV3GF256T8 u1)
(map-set wl-mint-passes 'SP3C27ZAE4K2RE9M5WNRTN7W2626H4CZDGE2TPDWF u1)
(map-set wl-mint-passes 'SP2TV9WT5FM6TEDCS5C10X7P7R813MTA3W5GAGJHQ u1)
(map-set wl-mint-passes 'SP1GYWMYK320ASBBAERSC40TA3PA99ZHV3GF256T8 u1)
(map-set wl-mint-passes 'SP2H94BXVGSH92VD407JX18VZ7S2ZFW2CFT5TJKKZ u1)
(map-set wl-mint-passes 'SP7RKS2TA7SF2WC67CGQTTNX4HNV5D17AT0V52VF u1)
(map-set wl-mint-passes 'SPQ2HN9TYF8ZYY9D3G45NGYA9GHA6QZHQ8AXF5QM u1)
(map-set wl-mint-passes 'SP14E544B2FY8BSKTV5V7W8NCRYX2B7NXRQ7B7NJ9 u1)
(map-set wl-mint-passes 'SP3VS5M4CT2JS74VEECCDTHSBZ4YZTAVWD4SE372K u1)
(map-set wl-mint-passes 'SP28RZ1QXMXJXVKRRCR3D7GR5D48XY0NNA9MZWHJB u1)
(map-set wl-mint-passes 'SP141GZ0KBEF3PGEVSFZ1GSSNZ8NHFGMMSFZQCDMY u1)
(map-set wl-mint-passes 'SPW1MN5C4HG2B3V5GBPHAFDDE88YNCX35ECVX4B u1)
(map-set wl-mint-passes 'SP27P4FECZXC2TXPS24C1CCTNKB0K1JEK3SZK7CB u1)
(map-set wl-mint-passes 'SP3WVWGYZ9NPFJ44Q0D1MNQ3P1XCQAQ0A1KEFKSQD u1)
(map-set wl-mint-passes 'SP13ZDF0VZBZSJ19W7DXNHWJDBCS9WSZB880PQXQS u1)
(map-set wl-mint-passes 'SP3356JJ54Q0YB2Q7EN3ZPV7DAY8E2NAS9P8E2WZ0 u1)
(map-set wl-mint-passes 'SP37N35P4903CB8S91SHHYYQ3Q44Q3HCJSBP8DCVF u1)
(map-set wl-mint-passes 'SP247RS63PWW7ZQZ9EYYA9CXKKPWEP71M14W8N294 u1)
(map-set wl-mint-passes 'SP3W5KN5XC7RQ5M0TMFGEZANE4P80Z7KQF1PJJB55 u1)
(map-set wl-mint-passes 'SPAT01J1XN77CT1CQM44M9TCS99DNWYZFNMMHXH8 u1)
(map-set wl-mint-passes 'SP3B84QWAXRAKB67Z4TB33SY5G0BGGVQC36526QN6 u1)
(map-set wl-mint-passes 'SP33N5R751MG99QAM4CN6HQ3MDTYBR71SB4NXVGT1 u1)
(map-set wl-mint-passes 'SP3K22XKPT9WJFCE957J94J6XXVZHP7747YNPDTFD u1)
(map-set wl-mint-passes 'SP1SXFE323XBDFEK6D5BV7P20BD3B4Y8W1RFN759H u1)
(map-set wl-mint-passes 'SPYFF8C8SMRQSYNR4TFZKDY270AN6GGDNXVWDRDW u1)
(map-set wl-mint-passes 'SP3HKZAJE54JT38T82208T3WJ6WNQDWJPPTZDGKX4 u1)
(map-set wl-mint-passes 'SP3K56FKA65F4AVTA69N02M02B9N1M8AARJMS49N2 u1)
(map-set wl-mint-passes 'SP3Y4DWNK7PG9YM46SMXA870JX5K9CQ6DTHKMAPMJ u1)
(map-set wl-mint-passes 'SPHWY482ANTWNTW2618HYHQSDY1WCW7P20BW5F7Y u1)
(map-set wl-mint-passes 'SPQJN9008GBDXCPVS2CZSPXAPYV8251GZX1GX64R u1)
(map-set wl-mint-passes 'SP2F18PH7FP22EHS0J0X3A6EFZ9PAW0EZJRET0GXZ u1)
(map-set wl-mint-passes 'SP329G766AV8Z01X9EEAHPDQ4WDJXT2A0XB383MGP u1)
(map-set wl-mint-passes 'SP17NZ4FXJAKJYM3976YT216ZTJVMJ6XACRB089XH u1)
(map-set wl-mint-passes 'SP3VJCMXAGTVF4BJ81JGTYVEBCXWZARFN60D8VSKG u1)
(map-set wl-mint-passes 'SP3EYT7KF5ERWQFTWW3SWHS8QRYBNSMRZ7JW73YXR u1)
(map-set wl-mint-passes 'SP3YDEFRTWZ7TG78C98K55JCE8FEQX8QVARPNQPGC u1)
(map-set wl-mint-passes 'SP9748CXTYEWCSTAQRQ1KHDV08AC37JCNW95NKMJ u1)
(map-set wl-mint-passes 'SP2HK7J6617VBSKXQGZWMXP2R64MMDX3S54M0S1Q6 u1)
(map-set wl-mint-passes 'SP1WY2NB1DXCV4K2H5H88D4G1QNKKZ3VZ398CET8G u1)
(map-set wl-mint-passes 'SP35MEYYBHSFCFXY296YGP7NAT6Y4XBJW2VETR8AV u1)
(map-set wl-mint-passes 'SP3VGG6F6BAMQ9XJNMNHQWNJ9X2KTAJYJGQAWXC5T u1)
(map-set wl-mint-passes 'SP38VF4ED0WKFH9SGEE4C873CSX6W7A2SPFDCJ15E u1)
(map-set wl-mint-passes 'SP1HZ3M9D4F19D80HZC66R93XKQ18PRT70KYFCF8A u1)
(map-set wl-mint-passes 'SP31WTJ415SNJM9H6202S3WK9AFQXQZMT48PESBQE u1)
(map-set wl-mint-passes 'SP3MMG05H6T48W5NJEEST0RR3FTPGKPM7C19X5M16 u1)
(map-set wl-mint-passes 'SP3CV98G6W9B2NPDX3XT7V96BBYKKJ004GYSJAFY0 u1)
(map-set wl-mint-passes 'SP3E545ADCKY56EVCXZPA87525VM0ZA8DQQAEP77Z u1)
(map-set wl-mint-passes 'SP3TZ3BCB16A0W0PPFYMGTTWTT3DVWTQEP8DFRAG1 u1)
(map-set wl-mint-passes 'SP226P4V1G7T6KVD39VMAGQV6HXKDM97T009AV579 u1)
(map-set wl-mint-passes 'SPS2FZ3K6N2CZPBM4BSQCEQV23V2334E7MJ4CHZT u1)
(map-set wl-mint-passes 'SP2HV9HYWZRAPTCC10VXCK72P3W4F9NDB8E1HBEZH u1)
(map-set wl-mint-passes 'SP15PC0B651BMR0ET11PFSNZQMA1T6JHG23141N0J u1)
(map-set wl-mint-passes 'SP2HVP68NY5BD2RDFX0JNXSYRS8AA6R7S30N08NJZ u1)
(map-set wl-mint-passes 'SP197GMEG6WGBRDTCTGGWMRA1G77E65TRXWYKGCT7 u1)
(map-set wl-mint-passes 'SP779SC9CDWQVMTRXT0HZCEHSDBXCHNGG7BC1H9B u1)
(map-set wl-mint-passes 'SP1P637C9NB6GSK9TY8AT8SN3QKH1WSV5ZVCZZSKS u1)
(map-set wl-mint-passes 'SP3G2203JNVE8BQ10YJ352RBPMNWN023PJ1R7AP8S u1)
(map-set wl-mint-passes 'SP2RKVC8PYANWJ40VSRCK2K935HSN4H0AHTVHD73D u1)
(map-set wl-mint-passes 'SP38Z9JA0Q1ZXBN3DPH9SD9AN8RE2MMPZV8D2DVX u1)
(map-set wl-mint-passes 'SP3XJ6Y9B5XY9ETHER209847D6DS9SC3N0SK7GAF9 u1)
(map-set wl-mint-passes 'SP13NK68ADVWYDZM2GZCNF0ZCFMCYAYGCTK22YE6T u1)
(map-set wl-mint-passes 'SP265DNHNK1NHX7FE9MZKCCA4G1VS7TT3BMES5TR u1)
(map-set wl-mint-passes 'SP3EHXKH36BKE33ZY1VVER4A35ZQD9Z552XQ38AFS u1)
(map-set wl-mint-passes 'SP1BFAYGH3G7AK91A5ZZHKD4E9N1RDV5Q483S9S2Y u1)
(map-set wl-mint-passes 'SP3MPTWZFFS12C2GKSABZVAMY7NEBCWG2JAYRB7W3 u1)
(map-set wl-mint-passes 'SPYAX2RNZA18KQA8Y0S5G393QBE8SWPNZ6R08XNH u1)
(map-set wl-mint-passes 'SP182H8WREVR0QAAKK3EDPV82A04KGE71ZTTKFFK u1)
(map-set wl-mint-passes 'SPZ5DJGRVZHXEEEYYGWEX84KQB8P69GC715ZRNW1 u1)
(map-set wl-mint-passes 'SP1XJC7RMAK03F2XP8KT27ST7S5C409DMVFWFJ4HD u1)
(map-set wl-mint-passes 'SP23RS2V3BAWHNQ3RHVZHK10F51RA99C1FHQKY9QH u1)
(map-set wl-mint-passes 'SP4QA0NHP03T3T9GJKR5KEA7VQ2KNSXRK5JC74NG u1)
(map-set wl-mint-passes 'SP16VFAB98FZ3GEM00SYYRV1V7J87JXZERWR9FQ6Y u1)
(map-set wl-mint-passes 'SP26C9TWJYK6DTCD4T6HKBC76DPMK2DXXRNWS3E2D u1)